@dcl/shop 0.1.0-29942574523.commit-573f25e → 0.1.0-29942650568.commit-3cdb6da

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 (176) hide show
  1. package/assets/{AnimatedBackground-CzCwcFdY.js → AnimatedBackground-CysLhvvU.js} +3 -3
  2. package/assets/{Assets-BTdyC00C.js → Assets-DsvJ5f0v.js} +1 -1
  3. package/assets/{Assets.styles-eeqx94WS.js → Assets.styles-CA7lhkqC.js} +26 -27
  4. package/assets/{Authorizations-BZhmfDD4.js → Authorizations-vnz0r2Ax.js} +3 -3
  5. package/assets/{Cart-BicSZMzV.js → Cart-CTQAeaCb.js} +2 -2
  6. package/assets/{CircularProgress-BivMeg1W.js → CircularProgress-BoWkcKSM.js} +3 -3
  7. package/assets/{Collection-DQAOAaC9.js → Collection-DFg8H4cI.js} +1 -1
  8. package/assets/{CollectionCarousel-D_udpdxX.js → CollectionCarousel-BgmGp9gP.js} +1 -1
  9. package/assets/{Creator-X75Qvpr4.js → Creator-DpJL7xsg.js} +1 -1
  10. package/assets/{CssVarsProvider-C0ny30E-.js → CssVarsProvider-CVkDPUQi.js} +1 -1
  11. package/assets/{ExchangeController-D0l6M3tj.js → ExchangeController-XYLG0Onl.js} +1 -1
  12. package/assets/{GetCredits-CMdoboQp.js → GetCredits-C41Akzju.js} +1 -1
  13. package/assets/{HelpersUtil-hamZLlhX.js → HelpersUtil-CXmyL-9f.js} +1 -1
  14. package/assets/{ImportListings-BFIpuuBM.js → ImportListings-DL4qvnkm.js} +1 -1
  15. package/assets/ItemDetail-8kxMVjol.js +78 -0
  16. package/assets/{LoadMore-BLy9p9ul.js → LoadMore-DwH_uJJ9.js} +1 -1
  17. package/assets/{MarketCheckout-DSl7Bl-M.js → MarketCheckout-0NCiBi_9.js} +1 -1
  18. package/assets/MyAssets-ChdfSyve.js +258 -0
  19. package/assets/{MyFavorites-Dul-WC6l.js → MyFavorites-BAgv7K26.js} +1 -1
  20. package/assets/{MyPurchases-DI0zzNTZ.js → MyPurchases-DlfJ7xtX.js} +4 -4
  21. package/assets/{NotFound-Bdg_iIpB.js → NotFound-uK-Ostnl.js} +1 -1
  22. package/assets/PrimaryListModal-Bm7Lx1a1.js +1 -0
  23. package/assets/{StoreSettings-2cViRT0c.js → StoreSettings-jeamoHJO.js} +5 -5
  24. package/assets/{Success-D9l7pr2K.js → Success-IAIc5xBC.js} +1 -1
  25. package/assets/{SwapController-DKBIcDPA.js → SwapController-B81AJRRn.js} +1 -1
  26. package/assets/{Tooltip-DJ7HtAmB.js → Tooltip-CYItdKnL.js} +1 -1
  27. package/assets/{TradeService-BpWgN8zg.js → TradeService-BxBTy4_C.js} +1 -1
  28. package/assets/{W3MFrameProviderSingleton-B40OWK0h.js → W3MFrameProviderSingleton-WHc1zToo.js} +3 -3
  29. package/assets/{WebCryptoP256-Ccr1DsYO.js → WebCryptoP256-BQQeByzz.js} +1 -1
  30. package/assets/{authorizations-sU14ILrd.js → authorizations-C600xDT9.js} +1 -1
  31. package/assets/{basic-DaSuNoEa.js → basic-CaSER4PW.js} +1 -1
  32. package/assets/{biconomy-DmmBzkXG.js → biconomy-nsDuvr1X.js} +1 -1
  33. package/assets/{buy-BRLq1STf.js → buy-C5J6mAtx.js} +1 -1
  34. package/assets/{buy-gasless-hR2bH0iR.js → buy-gasless-Sy6Gurph.js} +1 -1
  35. package/assets/{cart-checkout-CifIjL1z.js → cart-checkout-BwJruvi6.js} +1 -1
  36. package/assets/{categories-BPU8ySTe.js → categories-CQMvcQ_A.js} +1 -1
  37. package/assets/{ccip-C1DhAmlP.js → ccip-CVFd9-T6.js} +1 -1
  38. package/assets/{ccip-pv6qu637.js → ccip-C_DKTuDg.js} +1 -1
  39. package/assets/{collection-DhudRI2A.js → collection-BButATLz.js} +1 -1
  40. package/assets/{controller-DBPpBNi9.js → controller-C4IlqRFi.js} +2 -2
  41. package/assets/{core-CftjJZSY.js → core-Bsb1vtZ6.js} +4 -4
  42. package/assets/{custom-CLjHEVcz.js → custom-B2_bVLxh.js} +1 -1
  43. package/assets/{data-capture-ClKTWWBL.js → data-capture-CeCg7Ckv.js} +1 -1
  44. package/assets/{email-Dx9BSTtw.js → email-DGWqulOs.js} +1 -1
  45. package/assets/{embedded-wallet-CCKNmFwm.js → embedded-wallet-BDA__pmu.js} +1 -1
  46. package/assets/emotion-styled.browser.esm-Of0yAmXP.js +1 -0
  47. package/assets/{engine-1UaDNb6s.js → engine-COT4y3N6.js} +1 -1
  48. package/assets/{errors-DKFg2ql0.js → errors-B2rT3Gvo.js} +1 -1
  49. package/assets/{estimate-l1-fee-cQM6_GVS.js → estimate-l1-fee-DSG403IA.js} +1 -1
  50. package/assets/{execute-BuVfiwvM.js → execute-zpOqUNic.js} +2 -2
  51. package/assets/{features-ieqkL6m1.js → features-CMZ-QMXf.js} +1 -1
  52. package/assets/{fetchTokenMetadata-D8OWz4cP.js → fetchTokenMetadata-CZyR6DMv.js} +2 -2
  53. package/assets/{get-ecosystem-wallet-info-LZLHBFVZ.js → get-ecosystem-wallet-info-Cll7wRD7.js} +1 -1
  54. package/assets/{getBalance-Ck1YHbUL.js → getBalance-BlSTzNnh.js} +1 -1
  55. package/assets/{getNFT-DYxVn0Et.js → getNFT-bAbPTgKN.js} +1 -1
  56. package/assets/{getNFT-DnYNAiji.js → getNFT-yZahXefO.js} +1 -1
  57. package/assets/{getOverlayAlpha-Jb_9sPPd.js → getOverlayAlpha-CH1E19pc.js} +1 -1
  58. package/assets/{hashTypedData-Bqz6FRnB.js → hashTypedData-BjKHZJt2.js} +1 -1
  59. package/assets/{hashTypedData-BHOeb4kN.js → hashTypedData-CoI7qham.js} +1 -1
  60. package/assets/{import-CyzZeEcP.js → import-B-7LIWfg.js} +1 -1
  61. package/assets/{in-app-yMA-tvKO.js → in-app-DuAkMaop.js} +1 -1
  62. package/assets/{in-app-wallet-calls-BJRqCE4k.js → in-app-wallet-calls-VVaW7dWC.js} +1 -1
  63. package/assets/{index-BgMPhDEY.js → index-2LZVA_H9.js} +1 -1
  64. package/assets/{index-C0MEN305.js → index-B14E9dDt.js} +1 -1
  65. package/assets/{index-DwFc8v1Z.js → index-B5bMVqc5.js} +1 -1
  66. package/assets/{index-CstoEHiD.js → index-BC--wvbP.js} +1 -1
  67. package/assets/{index-D0tMQ_oG.js → index-BCa080Jk.js} +1 -1
  68. package/assets/{index-mc7xea6T.js → index-BEL4KhCu.js} +1 -1
  69. package/assets/{index-Bxu_HZv7.js → index-BSSPgvD1.js} +1 -1
  70. package/assets/{index-DSbcS8Gm.js → index-BaDAgjcA.js} +1 -1
  71. package/assets/{index-nmCuLAGG.js → index-BlnhiyW1.js} +1 -1
  72. package/assets/{index-KyO7a8ne.js → index-BmwayVyG.js} +3 -3
  73. package/assets/{index-D18uHh6f.js → index-BsY45tr2.js} +1 -1
  74. package/assets/{index-CWcMLN9O.js → index-Bwtbao7B.js} +1 -1
  75. package/assets/{index-0Z5nkscP.js → index-Bzlo07t4.js} +1 -1
  76. package/assets/{index-DPjEYQhJ.js → index-C0_U8Amn.js} +1 -1
  77. package/assets/{index-DJEb_i4T.js → index-C0utXQ6l.js} +1 -1
  78. package/assets/{index-B55KertC.js → index-C2JrnQDe.js} +1 -1
  79. package/assets/{index-Chx72aoA.js → index-C4vAJ3fL.js} +1 -1
  80. package/assets/{index-B7YJ2-NC.js → index-CBhum_yI.js} +1 -1
  81. package/assets/{index-DPm2T7me.js → index-CJs5gUNJ.js} +3 -3
  82. package/assets/{index-B8PSEU0f.js → index-CRZSv11U.js} +1 -1
  83. package/assets/{index-Cenx9VIL.js → index-CUV4Rf3F.js} +1 -1
  84. package/assets/{index-Dil5ESgb.js → index-ChF-gCVV.js} +1 -1
  85. package/assets/{index-BVjayAtf.js → index-CiH0W5Hj.js} +1 -1
  86. package/assets/{index-LQPmlKJw.js → index-Cj8JMZ6F.js} +1 -1
  87. package/assets/{index-0C8jHF02.js → index-CjnhvTx0.js} +1 -1
  88. package/assets/{index-BlKccc7B.js → index-CkTptFnK.js} +2 -2
  89. package/assets/{index-CVG4mg1H.js → index-ClDUuLhd.js} +1 -1
  90. package/assets/{index-zfsFyt-v.js → index-Cok_sFK3.js} +1 -1
  91. package/assets/{index-BLpc0PAw.js → index-CyMsSal1.js} +1 -1
  92. package/assets/{index-WrHr3vKs.js → index-CzOo8tvO.js} +2 -2
  93. package/assets/{index-Df4qngsG.js → index-D2i7N7FD.js} +1 -1
  94. package/assets/{index-Dx4oKUoK.js → index-D4mGcEtB.js} +1 -1
  95. package/assets/{index-CCr2J09y.js → index-D7J0TuHz.js} +2 -2
  96. package/assets/{index-CqYieDft.js → index-DIZEbKwM.js} +1 -1
  97. package/assets/{index-CO9CUrPm.js → index-DIusB22U.js} +2 -2
  98. package/assets/{index-Dc1nvyn9.js → index-DJCp8uIp.js} +1 -1
  99. package/assets/index-DYDor-ZM.css +1 -0
  100. package/assets/{index-B_fPkyQt.js → index-DcAG03_T.js} +1 -1
  101. package/assets/{index-fvb_2ePt.js → index-DeO2Srep.js} +2 -2
  102. package/assets/{index-DM6cwvvh.js → index-Dfv7PJQh.js} +1 -1
  103. package/assets/{index-BEOJi3Jo.js → index-DmSOW0PY.js} +1 -1
  104. package/assets/{index-LMkzNUyd.js → index-Dp2XIou0.js} +1 -1
  105. package/assets/{index-Bc63dzBj.js → index-DsttSp14.js} +3 -3
  106. package/assets/{index-YX1mo09T.js → index-DuM3vKAV.js} +1 -1
  107. package/assets/{index-uESxdvPf.js → index-DvbuNJKq.js} +1 -1
  108. package/assets/{index-O1MAeCt1.js → index-DxHb67V2.js} +1 -1
  109. package/assets/index-Q9d0V8TZ.js +289 -0
  110. package/assets/{index-3c-o1deN.js → index-VrPb_Zz5.js} +1 -1
  111. package/assets/{index-DHzasbYL.js → index-ZjDtH0Hr.js} +1 -1
  112. package/assets/{index-a_8ZLAR0.js → index-gcnUvFrd.js} +1 -1
  113. package/assets/{index-xFOezD9a.js → index-tAmGgcla.js} +1 -1
  114. package/assets/{index-B6Hb0r15.js → index-uk-CfnlL.js} +1 -1
  115. package/assets/{index-Dszgr0BR.js → index-zvLgVYhW.js} +1 -1
  116. package/assets/{index.es-Dy8PEmK4.js → index.es-BzMx-nup.js} +4 -4
  117. package/assets/{index.es-CP2cNM9F.js → index.es-DAd9yxMt.js} +1 -1
  118. package/assets/{index.es-B-uJmNhd.js → index.es-fI5nPWfV.js} +1 -1
  119. package/assets/{localBatchGatewayRequest-Dg8trW1f.js → localBatchGatewayRequest-BIFDJTSD.js} +1 -1
  120. package/assets/{mana-rate-DtQ8WpoI.js → mana-rate-CC-yyhWK.js} +1 -1
  121. package/assets/{networks-BaSDToU0.js → networks-DkdE2sZd.js} +1 -1
  122. package/assets/{onramp-D6REu-OE.js → onramp-C_i59kJR.js} +1 -1
  123. package/assets/{openzeppelin-DsZ0ZpWh.js → openzeppelin-BMNh5qua.js} +1 -1
  124. package/assets/{parseNft-BrwItloF.js → parseNft-CW-hWGBI.js} +2 -2
  125. package/assets/{parseSignature-CtBPNsAi.js → parseSignature-C3GhRBL-.js} +3 -3
  126. package/assets/{parseSignature-C67g8Ikn.js → parseSignature-NZopg6IG.js} +1 -1
  127. package/assets/{passkeys-CkVvpC6F.js → passkeys-DuQQbJhZ.js} +1 -1
  128. package/assets/{pay-with-exchange-DDftQXGa.js → pay-with-exchange-DH6Kt6OD.js} +1 -1
  129. package/assets/{qr-overlay-CHyDfEfF.js → qr-overlay-u2BzHEzf.js} +1 -1
  130. package/assets/{receive-BqeMp3_k.js → receive-D2V6X2tA.js} +1 -1
  131. package/assets/{resolveImplementation-D6GNwvZn.js → resolveImplementation-BsuIKFkz.js} +1 -1
  132. package/assets/{rpc-D1wZc4pd.js → rpc-BIhelmqB.js} +1 -1
  133. package/assets/{secp256k1-Cu8gqKOi.js → secp256k1-BHmvTUzO.js} +1 -1
  134. package/assets/{secp256k1-DKdkwurr.js → secp256k1-BtgeD6jy.js} +1 -1
  135. package/assets/{secp256k1-tM-HU4Wb.js → secp256k1-hNsXkUex.js} +1 -1
  136. package/assets/{send-C5LlTSZw.js → send-DkPpjCf1.js} +1 -1
  137. package/assets/{send-batch-transaction-2M20mpyd.js → send-batch-transaction-Bt9-Q0FO.js} +1 -1
  138. package/assets/{send-eip712-transaction-DxCA-Uwd.js → send-eip712-transaction-CJ8Dr-eb.js} +2 -2
  139. package/assets/{send-gasless-transaction-VjwN2uQK.js → send-gasless-transaction-D5eQ85CY.js} +2 -2
  140. package/assets/{send-transaction-Bb0Q9hmN.js → send-transaction-BK1KmPMR.js} +2 -2
  141. package/assets/{sendRawTransaction-CED77ONZ.js → sendRawTransaction-Ddh_tSjE.js} +3 -3
  142. package/assets/{serializeTransaction-7yAEy3FU.js → serializeTransaction-f04zsBlb.js} +1 -1
  143. package/assets/{session-proposal-DGrkZ9Ix.js → session-proposal-r1mPrmCX.js} +1 -1
  144. package/assets/{session-request-Dg8cFRll.js → session-request-Cfr7jp2h.js} +2 -2
  145. package/assets/{signing-DuUwyfpZ.js → signing-C-mKTJFW.js} +3 -3
  146. package/assets/{socials-cbGvEEpM.js → socials-pmAt6WyL.js} +1 -1
  147. package/assets/{swaps-EURvYFti.js → swaps-XKJYQXAz.js} +1 -1
  148. package/assets/{thirdweb-D4Tt3SPK.js → thirdweb-B_kKfwse.js} +3 -3
  149. package/assets/{to-serializable-transaction-Dh5bAtyQ.js → to-serializable-transaction-rhTmQPEU.js} +2 -2
  150. package/assets/{trade-encoding-0IFZ39Tk.js → trade-encoding-CaZYjVNs.js} +1 -1
  151. package/assets/{transactionReceipt-DIw9ApVw.js → transactionReceipt-BcU054L-.js} +1 -1
  152. package/assets/{transactions-xAqHSp91.js → transactions-lrp4i700.js} +1 -1
  153. package/assets/useCreditPacks-Be9cG5vr.js +1 -0
  154. package/assets/{useInfiniteGrid-BbeLTVdN.js → useInfiniteGrid-8c-8xSTi.js} +1 -1
  155. package/assets/{useStore-PWA7dbNJ.js → useStore-Ccbed9Z-.js} +1 -1
  156. package/assets/useTheme-7-Mr4FFJ.js +1 -0
  157. package/assets/useTheme-C3YHg0O0.js +1 -0
  158. package/assets/{verifyHash-sv4aRvH_.js → verifyHash-z4q1c5J1.js} +1 -1
  159. package/assets/{w3m-modal-D1RMqW5z.js → w3m-modal-2GWsHPDh.js} +1 -1
  160. package/assets/{w3m-modal-BoTSPCYe.js → w3m-modal-DUSXSzQv.js} +1 -1
  161. package/assets/{wait-for-tx-receipt-CnoUxMtV.js → wait-for-tx-receipt-CAc2Bmoi.js} +1 -1
  162. package/assets/{wallets-Cuqbvnoy.js → wallets-BD_QGCV9.js} +5 -5
  163. package/assets/{web-connector-0FomZsHS.js → web-connector-Da5xZh52.js} +3 -3
  164. package/assets/{writeContract-Bicvfabo.js → writeContract-zNHMPW7R.js} +1 -1
  165. package/assets/{zoraTestnet-4QPNkDlh.js → zoraTestnet-Csb8JMNL.js} +1 -1
  166. package/index.html +11 -11
  167. package/package.json +2 -2
  168. package/assets/ItemDetail-C0Sm18Me.js +0 -78
  169. package/assets/MyAssets-UFPrjPwu.js +0 -258
  170. package/assets/PrimaryListModal-CnlMOkG5.js +0 -1
  171. package/assets/emotion-styled.browser.esm-B6FBNgF3.js +0 -1
  172. package/assets/index-CJ4mXolB.js +0 -289
  173. package/assets/index-CqYr0ABc.css +0 -1
  174. package/assets/useCreditPacks-DO-uyk4N.js +0 -1
  175. package/assets/useTheme-BHtz4hyG.js +0 -1
  176. package/assets/useTheme-Ciqd957r.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-29942574523.commit-573f25e/favicon.ico" sizes="16x16 32x32 48x48" />
20
- <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/apple-touch-icon.png" />
19
+ <link rel="icon" type="image/x-icon" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/favicon.ico" sizes="16x16 32x32 48x48" />
20
+ <link rel="apple-touch-icon" sizes="180x180" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/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-29942574523.commit-573f25e/site.webmanifest" />
22
+ <link rel="manifest" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/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-29942574523.commit-573f25e/sitemap.xml" />
51
+ <link rel="sitemap" type="application/xml" title="Sitemap" href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/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-29942574523.commit-573f25e/assets/index-CJ4mXolB.js"></script>
64
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/react-BrLDncxD.js">
65
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/dcl-schemas-BICTSpB5.js">
66
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/sentry-DYZXk5O5.js">
67
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/ethers-CLB2z3On.js">
68
- <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/intl-CBcMB1D2.js">
69
- <link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942574523.commit-573f25e/assets/index-CqYr0ABc.css">
63
+ <script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/assets/index-Q9d0V8TZ.js"></script>
64
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/assets/react-BrLDncxD.js">
65
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/assets/dcl-schemas-BICTSpB5.js">
66
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/assets/sentry-DYZXk5O5.js">
67
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/assets/ethers-CLB2z3On.js">
68
+ <link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/assets/intl-CBcMB1D2.js">
69
+ <link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/shop/0.1.0-29942650568.commit-3cdb6da/assets/index-DYDor-ZM.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-29942574523.commit-573f25e",
3
+ "version": "0.1.0-29942650568.commit-3cdb6da",
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": "573f25e7b7e3c31bb27bfbd2447c4cd3b2d3477c"
11
+ "commit": "3cdb6da7995cf67cd36ecb17a4946295828958bd"
12
12
  }
@@ -1,78 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-fvb_2ePt.js","assets/react-BrLDncxD.js","assets/dcl-schemas-BICTSpB5.js","assets/index-CJ4mXolB.js","assets/sentry-DYZXk5O5.js","assets/ethers-CLB2z3On.js","assets/intl-CBcMB1D2.js","assets/index-CqYr0ABc.css","assets/emotion-styled.browser.esm-B6FBNgF3.js","assets/useTheme-BHtz4hyG.js","assets/CircularProgress-BivMeg1W.js","assets/index-BlKccc7B.js","assets/useTheme-Ciqd957r.js","assets/CssVarsProvider-C0ny30E-.js","assets/getOverlayAlpha-Jb_9sPPd.js","assets/index-BgMPhDEY.js","assets/colors-LINLm1ux.js"])))=>i.map(i=>d[i]);
2
- import{a as pe,r as c,j as e,d as ha,u as _a,L as ya}from"./react-BrLDncxD.js";import{d as Y,n as pa,o as Ge,t,ai as fa,i as ba,b as xa,w as ja,q as ie,x as V,y as Re,z as _e,aj as va,E as le,h as M,j as ne,_ as ye,an as ga,ax as Na,ay as wa,az as ka,aA as Ia,c as fe,aB as Ca,a6 as He,m as R,aC as Aa,I as F,F as O,s as z,aD as Sa,aE as Ma,aF as Pa,G as Ea,af as qe,a as $e,aG as Fa,aH as La,aI as Da,aJ as Ta,aK as Ba,ag as Ra,u as qa,aL as $a,aM as Oa,aN as za,g as Ka,aO as Oe,aP as Wa,B as be,f as Va,J as Qa,ao as Ua,aQ as Ga,aR as Ha,ap as Ja,aS as Ya,aT as Za}from"./index-CJ4mXolB.js";import{d as Q}from"./dcl-schemas-BICTSpB5.js";import{b as ze,c as Xa}from"./buy-BRLq1STf.js";import{S as et,P as at,f as tt}from"./PrimaryListModal-CnlMOkG5.js";import{g as st,b as it,w as rt,S as nt,G as lt}from"./buy-gasless-hR2bH0iR.js";import{u as dt,c as ot}from"./useCreditPacks-DO-uyk4N.js";import{R as Ke}from"./resume-buy-Bf0zIH7y.js";import{a as ct,f as We,i as mt}from"./errors-DKFg2ql0.js";import{E as xe}from"./ErrorNotice-BDH9xoG4.js";import{l as ut}from"./loader-logo-BzY9EKdC.js";import{C as ht}from"./CircularProgress-BivMeg1W.js";import{u as _t,M as yt}from"./MarketCheckout-DSl7Bl-M.js";import{s as pt}from"./address-DrURAr9O.js";import{C as ft}from"./CollectionCarousel-D_udpdxX.js";import{T as Je}from"./Tooltip-DJ7HtAmB.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./authorizations-sU14ILrd.js";import"./index-HN6Rk25C.js";import"./trade-encoding-0IFZ39Tk.js";import"./mana-rate-DtQ8WpoI.js";import"./emotion-CSxEP8yM.js";function bt({item:s,onClose:n,resume:r=!1}){var X,ee;const{session:d}=Y(),{data:o}=pa(d),h=Ge(),g=pe(),j=dt().packs.slice(0,3),[m,l]=c.useState("loading"),[a,N]=c.useState(null),[p,w]=c.useState(""),[L,b]=c.useState(s.priceCredits),[f,D]=c.useState(null),P=c.useRef(null),A=(f==null?void 0:f.credits)??L,Z=(o==null?void 0:o.credits)??0;c.useEffect(()=>{let u=!1;if(!d){l("error"),N(t("buyModal.signInToCheckout"));return}const k=_=>{const I=_-((o==null?void 0:o.credits)??0),x=j.find(T=>T.credits>=I)??j[j.length-1];w(x.id),V("Shop Buy Credits Prompted",{from:"item_checkout",credits_needed:_,credits_balance:(o==null?void 0:o.credits)??0,shortfall:Math.max(0,I)}),l("nofunds")};return(async()=>{var _,I;try{const x=await fa(s);if(!x)throw new Error("not for sale");if(ba(x,d.address))throw new Error("You can't buy your own listing.");const T=xa((I=(_=x.received)==null?void 0:_[0])==null?void 0:I.amount);if(!Number.isFinite(T)||T<=0)throw new Error("price unavailable");const K=Math.ceil(T/10);if(u)return;if(b(K),o!=null&&o.credits<K){k(K);return}try{const{credit:C,maxCreditedValue:G,usdCents:$}=await ja(d.identity,T,x.id);if(u){ie(d.identity,[C.id]).catch(()=>{});return}P.current=C.id;const ae=Math.ceil($/10);b(ae);const W={trade:x,credit:C,maxCreditedValue:G,usdCents:$,credits:ae};D(W),r?U(W):l("ready")}catch(C){if(u)return;if(ct(C)){k(K);return}throw C}}catch(x){if(u)return;V(_e(x)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"authorize",error_code:Re(x)}),l("error"),N(We(x,t("buyModal.error.generic"),{sale:!0}))}})(),()=>{u=!0,P.current&&d&&(ie(d.identity,[P.current]).catch(()=>{}),P.current=null)}},[]);async function U(u=f){if(!d||!u)return;l("processing"),N(null);let k=!1;try{const _={trade:u.trade,buyer:d.address,signer:d.signer,credits:[u.credit],maxCreditedValue:u.maxCreditedValue};let I;if(st())try{I=await it(_),await rt(I),k=!0}catch(x){if(x instanceof nt)k=!0;else if(x instanceof lt)I=await ze(_);else throw x}else I=await ze(_);P.current=null,V("Shop Completed Purchase",{...va([s]),payment_type:"credits",no_crypto_step:k,transaction_hash:I??null}),h.invalidateQueries({queryKey:["usd-balance"]}),l("complete")}catch(_){_e(_)||le(_,{flow:"buy",step:"submit",gasless:k}),ie(d.identity,[u.credit.id]).catch(()=>{}),P.current=null,V(_e(_)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Re(_)}),h.invalidateQueries({queryKey:["usd-balance"]}),N(We(_,t("buyModal.error.generic"),{sale:!0})),l("error")}}async function de(){if(!(!p||!d)){try{sessionStorage.setItem(Ke,JSON.stringify(s))}catch{}f&&ie(d.identity,[f.credit.id]).catch(()=>{}),P.current=null,l("loading");try{const u=await ot(p,{address:d.address,identity:d.identity});if(u.url){window.location.href=u.url;return}g("/credits")}catch(u){le(u,{flow:"buy_credits_and_item"});try{sessionStorage.removeItem(Ke)}catch{}N(t("buyModal.error.creditsCheckout")),l("error")}}}const q=m==="processing",E=m==="complete"?t("buyModal.titleComplete"):m==="nofunds"?t("buyModal.titleNoFunds"):t("buyModal.titleBuy");return e.jsxs("div",{className:"buy-modal",role:"dialog","aria-modal":"true","aria-label":t("buyModal.dialogAria",{name:s.name}),children:[e.jsx("div",{className:"buy-modal__scrim",onClick:q?void 0:n,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${m==="processing"||m==="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:E}),!q&&e.jsx("button",{className:"buy-modal__x",onClick:n,"aria-label":t("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:m==="nofunds"?t("buyModal.dclBalance"):t("buyModal.myCreditsBalance")}),e.jsx(M,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:ne(Z)})]})]}),m==="loading"&&e.jsx("div",{className:"buy-modal__body buy-modal__processing",children:e.jsx(ht,{size:44})}),m==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(xe,{message:a}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:n,children:t("buyModal.close")})})]}),m==="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:t("buyModal.insufficientFunds")})," ",t("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:t("buyModal.warningCreditsAmount",{count:Math.max(0,A-Z)})})," ",t("buyModal.warningToPurchase",{count:1})]})]}),e.jsx(Ve,{item:s,priceCredits:A}),e.jsx("div",{className:"buy-modal__packs",children:j.map(u=>{const k=u.credits,_=u.id===p;return e.jsxs("button",{className:`buy-modal__pack${_?" buy-modal__pack--on":""}`,onClick:()=>w(u.id),children:[e.jsx(M,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:ne(k)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",u.usd.toFixed(2),")"]})]},u.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:ne(((X=j.find(u=>u.id===p))==null?void 0:X.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",(((ee=j.find(u=>u.id===p))==null?void 0:ee.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:n,children:t("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:()=>void de(),children:t("buyModal.buy")})]})]}),m==="ready"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsx(Ve,{item:s,priceCredits:A}),e.jsx("div",{className:"buy-modal__ctas",children:e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient buy-modal__btn--full",onClick:()=>void U(),children:t("buyModal.buy")})})]}),m==="processing"&&e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:ut,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:r?t("buyModal.completingPurchase"):t("buyModal.completingTransaction")}),e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]}),m==="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:t("getCredits.successTitle")})," ",t("buyModal.successBody")]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:()=>g("/assets?tab=mine"),children:t("buyModal.myAssets")}),e.jsxs("button",{className:"buy-modal__btn buy-modal__btn--ruby",onClick:n,children:[t("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 Ve({item:s,priceCredits:n}){return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:s.thumbnail?e.jsx("img",{src:s.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:s.name,children:s.name||t("buyModal.itemFallback")}),s.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:t("search.byCreator",{name:s.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(M,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:ne(n)})]})]})]})}const xt=c.lazy(async()=>{const[{EmoteControls:s},{Experimental_CssVarsProvider:n},{light:r}]=await Promise.all([ye(()=>import("./index-fvb_2ePt.js").then(d=>d.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),ye(()=>import("./index-BlKccc7B.js"),__vite__mapDeps([11,3,1,2,4,5,6,7,12,9,13,14])),ye(()=>import("./index-BgMPhDEY.js"),__vite__mapDeps([15,3,1,2,4,5,6,7,16,14,13,9]))]);return{default:d=>e.jsx(n,{theme:r,children:e.jsx(s,{...d})})}});function jt(s){return e.jsx(c.Suspense,{fallback:null,children:e.jsx(xt,{...s})})}function vt({item:s}){const n=Y(f=>{var D;return(D=f.session)==null?void 0:D.address}),{data:r,isLoading:d}=ga(n),o=n&&r?n:"default",h=s.category==="emote",[g,j]=c.useState("item"),m=!h&&g==="item",l=m||!d,[a,N]=c.useState(!0);c.useEffect(()=>{N(!0)},[s.id,m]);const p=!!n&&!!r,w=p&&Na(s,wa(r)),L=ka(s)[0],b=p&&!w&&!h;return e.jsxs(e.Fragment,{children:[l?e.jsx(Ia,{id:"shop-item-preview",contractAddress:s.contractAddress,tokenId:s.tokenId??void 0,itemId:s.tokenId?void 0:s.itemId??void 0,profile:m?void 0:w?o:"default",bodyShape:m||w?void 0:L,type:h?void 0:m?Q.PreviewType.WEARABLE:Q.PreviewType.AVATAR,emote:h||m?void 0:Q.PreviewEmote.FASHION,disableBackground:!0,wheelZoom:h?1.5:void 0,wheelStart:h?100:void 0,dev:fe.chainId===80002,onLoad:()=>N(!1)}):null,!l||a?e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("itemPreview.loading"),children:e.jsx("span",{className:"item-preview__spinner","aria-hidden":!0})}):null,b&&!m?e.jsx("p",{className:"item-preview__note",children:t("itemPreview.shownOnBody",{shape:Ca(L)})}):null,h?e.jsx("div",{className:"item-preview__emote-controls","data-testid":"emote-controls",children:e.jsx(jt,{wearablePreviewId:"shop-item-preview",hideFrameInput:!0})}):e.jsxs("div",{className:"item-preview__toggle",role:"group","aria-label":t("itemPreview.previewMode"),children:[e.jsxs("button",{type:"button",className:g==="avatar"?"is-active":"","aria-pressed":g==="avatar","aria-label":t("itemPreview.onAvatar"),onClick:()=>j("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:t("itemPreview.onAvatar")})]}),e.jsxs("button",{type:"button",className:g==="item"?"is-active":"","aria-pressed":g==="item","aria-label":t("itemPreview.item"),onClick:()=>j("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:t("itemPreview.item")})]})]})]})}function Ye(){return fe.shopServerUrl||(typeof window<"u"?window.location.origin:"")}async function gt(s,n,r){const d=new URLSearchParams({contractAddress:s,itemId:n}),o=`${Ye()}/notify-requests?${d.toString()}`,h=await He(o,{method:"GET",identity:r,metadata:{}});if(!h.ok)throw new Error(`getNotifyRequest ${h.status}`);return h.json()}async function Nt(s,n){const r=`${Ye()}/notify-requests`,d=await He(r,{method:"POST",identity:n,metadata:{},headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!d.ok)throw new Error(`createNotifyRequest ${d.status}: ${await d.text()}`);await d.json().catch(()=>{})}function Qe(s){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.trim())}function wt({item:s}){const n=Y(b=>b.session),r=Y(b=>b.signIn),[d,o]=c.useState(""),[h,g]=c.useState(!1),[j,m]=c.useState(!1),[l,a]=c.useState(null),N=!!n&&!!s.contractAddress&&!!s.itemId,{data:p}=R({queryKey:["notify-request",s.contractAddress,s.itemId,n==null?void 0:n.address],enabled:N,queryFn:()=>gt(s.contractAddress,s.itemId,n.identity)});c.useEffect(()=>{p!=null&&p.email&&o(b=>b||p.email)},[p==null?void 0:p.email]),c.useEffect(()=>{if(!n)return;let b=!1;return Aa().then(f=>{!b&&f&&o(D=>D||f)}),()=>{b=!0}},[n]);const w=j||!!(p!=null&&p.subscribed);async function L(b){if(b.preventDefault(),!(!n||!s.itemId||!Qe(d)||h)){g(!0),a(null);try{await Nt({contractAddress:s.contractAddress,itemId:s.itemId,chainId:s.chainId,email:d.trim()},n.identity),m(!0)}catch(f){le(f,{flow:"notify-me",contractAddress:s.contractAddress,itemId:s.itemId}),a(t("notifyMe.error"))}finally{g(!1)}}}return n?w?e.jsxs("div",{className:"notify notify__done","data-testid":"notify-subscribed",children:[e.jsx("span",{className:"notify__done-check","aria-hidden":!0,children:e.jsx(F,{name:"check",size:12})}),e.jsx("span",{className:"notify__done-text",children:t("notifyMe.subscribedBody")})]}):e.jsxs("form",{className:"notify",onSubmit:L,"data-testid":"notify",children:[e.jsx("label",{className:"notify__label",htmlFor:"notify-email",children:t("notifyMe.label")}),e.jsxs("div",{className:"notify__row",children:[e.jsx("input",{id:"notify-email",className:"notify__input",type:"email",inputMode:"email",autoComplete:"email",placeholder:t("notifyMe.placeholder"),value:d,onChange:b=>o(b.target.value),"data-testid":"notify-email"}),e.jsx("button",{type:"submit",className:"notify__btn",disabled:!Qe(d)||h,"data-testid":"notify-submit",children:h?t("notifyMe.working"):t("notifyMe.cta")})]}),e.jsx(xe,{message:l})]}):e.jsx("div",{className:"notify","data-testid":"notify",children:e.jsx("button",{type:"button",className:"notify__signin",onClick:r,"data-testid":"notify-signin",children:t("notifyMe.signInCta")})})}const kt=z.button`
3
- display: flex;
4
- align-items: center;
5
- justify-content: center;
6
- gap: 8px;
7
- width: 100%;
8
- height: 40px;
9
- padding: 0 12px;
10
- border: 2px solid #c640cd;
11
- border-radius: 8px;
12
- background: transparent;
13
- color: ${O.colors.accent};
14
- font-family: ${O.font.sans};
15
- font-weight: 600;
16
- font-size: 15px;
17
- line-height: 24px;
18
- letter-spacing: 0.46px;
19
- text-transform: uppercase;
20
- cursor: not-allowed;
21
- opacity: 0.55;
22
- transition: opacity 0.15s ease;
23
-
24
- &:hover,
25
- &:focus-visible {
26
- opacity: 0.75;
27
- }
28
- &:focus-visible {
29
- outline: 2px solid ${O.colors.accent};
30
- outline-offset: 2px;
31
- }
32
- `;function It({item:s}){return e.jsx(Je,{block:!0,content:t("makeOffer.comingSoon"),onShow:()=>V("Shop Make Offer Tooltip Shown",{contractAddress:s.contractAddress,itemId:s.itemId}),children:e.jsxs(kt,{type:"button","aria-disabled":!0,onClick:n=>n.preventDefault(),"data-testid":"make-offer",children:[e.jsx(F,{name:"offer",size:20,"aria-hidden":!0}),e.jsx("span",{children:t("makeOffer.cta")})]})})}const Ct=z(Sa)`
33
- display: flex;
34
- flex-direction: column;
35
- overflow: hidden;
36
- gap: 1px;
37
- background: ${O.colors.lineStrong};
38
- `;function At({contractAddress:s,name:n,items:r,className:d}){const o=pe();if(!s||!n)return null;const h=(r??[]).map(m=>m.thumbnail).filter(m=>!!m).slice(0,4),g=h.slice(0,2),j=h.slice(2,4);return e.jsxs(Ma,{as:"button","data-link":!0,className:d,"data-testid":"creator",onClick:m=>{m.stopPropagation(),o(`/collection/${s}`)},children:[h.length>0?e.jsxs(Ct,{as:"span","data-avatar":!0,"data-testid":"creator-ava","aria-hidden":!0,children:[e.jsx("span",{className:`collection-collage__row${j.length===0?" collection-collage__row--full":""}`,children:g.map((m,l)=>e.jsx("img",{src:m,alt:""},l))}),j.length>0?e.jsx("span",{className:"collection-collage__row",children:j.map((m,l)=>e.jsx("img",{src:m,alt:""},l))}):null]}):null,e.jsx(Pa,{"data-testid":"creator-name",children:Ea(n)})]})}const St=z(be)`
39
- margin-top: 6px;
40
- `,re=z(be)`
41
- && {
42
- width: 100%;
43
- height: 48px;
44
- font-size: 15px;
45
- font-weight: 600;
46
- letter-spacing: 0.46px;
47
- display: flex;
48
- align-items: center;
49
- justify-content: center;
50
- gap: 8px;
51
- }
52
-
53
- ${O.media.down("lg")} {
54
- .item-detail__ctas--dual && {
55
- flex: 1 1 auto;
56
- width: auto;
57
- }
58
- }
59
- `,Mt=z("div")`
60
- display: flex;
61
- flex-direction: column;
62
- gap: 10px;
63
- width: 100%;
64
- `,Pt=z(be)`
65
- && {
66
- width: 100%;
67
- height: 44px;
68
- }
69
- `,Et=z("p")`
70
- margin: 4px 0 0;
71
- font-size: 13px;
72
- color: ${O.colors.muted};
73
-
74
- a {
75
- color: ${O.colors.accent};
76
- font-weight: 600;
77
- }
78
- `;function Ft(s){return Object.values(Q.Rarity).includes(s)}function Lt(s){return s==="male"?t("itemDetail.genderMale"):s==="female"?t("itemDetail.genderFemale"):s==="unisex"?t("itemDetail.genderUnisex"):null}function Ue(s){return s.wearableCategory?s.wearableCategory.replace(/_/g," "):s.category==="emote"?t("itemDetail.categoryEmote"):t("itemDetail.categoryWearable")}function ls(){var Te;const{contractAddress:s,tokenId:n}=ha(),{state:r}=_a(),d=pe(),o=!!(r!=null&&r.market),h=(r==null?void 0:r.marketPriceCredits)??null,g=qe(i=>i.add),j=qe(i=>i.items),m=$e(i=>i.toggle),{session:l}=Y(),[a,N]=c.useState(()=>r!=null&&r.item?{...r.item,tradeId:r.tradeId??r.item.tradeId}:{id:`${s}-${n}`,name:"",creator:"",contractAddress:s??"",itemId:null,category:"wearable",rarity:"common",network:"MATIC",chainId:fe.chainId,thumbnail:"",priceCredits:0,gender:null,isSmart:!1,tokenId:n??void 0,tradeId:r==null?void 0:r.tradeId}),[p,w]=c.useState(!1),[L,b]=c.useState(!!(r!=null&&r.resumeBuy));c.useEffect(()=>{r!=null&&r.resumeBuy&&w(!0)},[r==null?void 0:r.resumeBuy]);const{data:f=[],isFetched:D}=R({queryKey:["collection-items",a.contractAddress],enabled:!!a.contractAddress,queryFn:()=>Ua(a.contractAddress,{first:20}).then(i=>i.items)}),P=a.available==null&&!a.tokenId,{data:A,isLoading:Z}=R({queryKey:["shop-item",a.contractAddress,n],enabled:!o&&!!a.contractAddress&&!!n&&(!(r!=null&&r.item)||P),queryFn:()=>Ga(a.contractAddress,n)});c.useEffect(()=>{A&&N(i=>i.tradeId?i.available!=null&&i.wearableCategory?i:{...i,available:i.available??A.available,wearableCategory:i.wearableCategory??A.wearableCategory}:{...A})},[A]);const[U,de]=c.useState(!1),{data:q=""}=R({queryKey:["item-desc",a.contractAddress,a.itemId],enabled:!!a.contractAddress&&!!a.itemId,staleTime:5*6e4,queryFn:()=>Ha(a.contractAddress,a.itemId)}),{data:E}=R({queryKey:["collection-meta",a.contractAddress],enabled:!!a.contractAddress,staleTime:5*6e4,queryFn:()=>Ja(a.contractAddress)});c.useEffect(()=>{if(a.name||A||f.length===0)return;const i=n&&f.find(v=>v.tokenId===n||v.itemId===n)||f.find(v=>v.contractAddress===a.contractAddress);i&&N(v=>({...i,tradeId:v.tradeId??i.tradeId}))},[f,A]);const X=c.useMemo(()=>{const i=new Set,v=[];for(const S of f){if(S.id===a.id||a.itemId&&S.itemId===a.itemId||a.tokenId&&S.tokenId===a.tokenId)continue;const Be=`${S.contractAddress}-${S.itemId??S.tokenId??S.id}`;i.has(Be)||(i.add(Be),v.push(S))}return v},[f,a.id,a.itemId,a.tokenId]),{data:ee,isLoading:u}=R({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 i=await Ya(a.contractAddress,a.itemId);return(i==null?void 0:i.id)??null}return null}}),k=a.tradeId??ee??void 0,_=!!k,{data:I}=_t(o),x=c.useMemo(()=>{if(!o||!(r!=null&&r.item))return null;const i=r.item;return i.manaWei?{tradeId:i.tradeId??i.id,listingType:"primary",contractAddress:i.contractAddress,itemId:i.itemId??"",name:i.name,thumbnail:i.thumbnail,rarity:i.rarity,category:i.category,wearableCategory:i.wearableCategory??null,creator:i.creator,manaWei:i.manaWei,available:1,network:i.network,chainId:i.chainId,createdAt:0}:null},[o,r==null?void 0:r.item]),T=o&&h!=null&&!!I&&!!x,K=Fa({priceCredits:a.priceCredits,compareAtCredits:a.compareAtCredits,saleEndsAt:a.saleEndsAt}),C=c.useMemo(()=>({...a,tradeId:k,id:k??a.id}),[a,k]),G=j.some(i=>i.id===C.id),$=!C.tokenId,ae=((Te=j.find(i=>i.id===C.id))==null?void 0:Te.quantity)??0,W=$&&typeof a.available=="number"&&ae>=a.available,B=$e(i=>!!i.items[a.id]),je=c.useRef(null);c.useEffect(()=>{!a.name||u||je.current===a.id||(je.current=a.id,V("Shop Viewed Item",{...La(a),for_sale:_}),Da(a))},[a.id,a.name,u,_]);const te=`${s}/${n}`,ve=c.useRef(te);c.useEffect(()=>{ve.current!==te&&(ve.current=te,r!=null&&r.item&&N({...r.item,tradeId:r.tradeId??r.item.tradeId}),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[te]);function Ze(){!_||ce||u||!$&&G||W||g(C,"item_detail")}const oe=Ft(a.rarity)?a.rarity:Q.Rarity.COMMON,ge=Lt(a.gender),Ne=Ta(a),we=Ba(a.gender),Xe=_&&K,ea=t("itemDetail.moreFromCollection"),ce=Ra(a,l==null?void 0:l.address),se=Ge(),[aa,ke]=c.useState(!1),[ta,Ie]=c.useState(!1),[H,Ce]=c.useState(!1),[sa,Ae]=c.useState(null),{data:y,isLoading:ia}=R({queryKey:["owned-token",a.contractAddress,a.tokenId,l==null?void 0:l.address],enabled:!o&&!!(l!=null&&l.address)&&!!a.contractAddress&&!!a.tokenId,queryFn:()=>l?Za(l.address,a.contractAddress,a.tokenId):null});c.useEffect(()=>{y&&N(i=>i.name?i.issuedId?i:{...i,issuedId:y.issuedId}:{id:y.id,name:y.name,creator:"",contractAddress:y.contractAddress,itemId:y.itemId,category:y.category,rarity:y.rarity??"common",network:y.network,chainId:y.chainId,thumbnail:y.image,priceCredits:y.listingPrice??0,gender:null,isSmart:!1,tokenId:y.tokenId,issuedId:y.issuedId,tradeId:y.tradeId})},[y]);const{data:me}=R({queryKey:["publishable-item",a.contractAddress,a.itemId,l==null?void 0:l.address],enabled:ce&&!!l&&!!a.itemId,queryFn:async()=>l?(await tt(l.address,l.identity)).find(v=>v.contractAddress.toLowerCase()===a.contractAddress.toLowerCase()&&v.blockchainItemId===a.itemId)??null:null}),J=!!y,ue=!o&&(ce||J),ra=J?!!(y!=null&&y.isOnSale):_,he=J?y==null?void 0:y.tradeId:k,Se=J?!!y:!!me;async function Me(){await Promise.all([se.invalidateQueries({queryKey:["owned-token",a.contractAddress,a.tokenId]}),se.invalidateQueries({queryKey:["detail-trade"]}),se.invalidateQueries({queryKey:["shop-item"]}),se.invalidateQueries({queryKey:["collection-sale-state"]})])}async function Pe(i={}){if(!l||!he)return!1;Ae(null),Ce(!0);try{const v=await Va(he);return await Xa({trade:v,signer:l.signer}),i.silent||Qa.success(t("myAssets.removedFromSale",{name:a.name})),await Me(),!0}catch(v){const S=mt(v);return S||le(v,{flow:"remove-listing",tradeId:he}),Ae(S?t("getCredits.errorCanceled"):t("myAssets.removeListingError")),!1}finally{Ce(!1)}}function Ee(){J?ke(!0):Ie(!0)}async function na(){await Pe({silent:!0})&&Ee()}function Fe(){ke(!1),Ie(!1),Me()}const Le=_?u?t("itemDetail.checking"):W?t("itemDetail.maxInCart"):!$&&G?t("assetCard.inCart"):t("assetCard.addToCart"):t("itemDetail.notForSale"),la=typeof a.available=="number"&&a.available>0&&!a.tokenId&&!o,da=!o&&!a.tokenId&&a.available===0,oa=!ue&&_&&!o,ca=o||!ue,ma=Z||!!a.contractAddress&&!D||!a.name&&ia,De=!a.name&&!ma,ua=/^https?:\/\//i.test(a.thumbnail);return qa(De?{title:t("seo.item.notFoundTitle"),noindex:!0}:a.name?{title:a.name,description:q||t("seo.item.fallbackDescription",{name:a.name,rarity:a.rarity,category:Ue(a),creator:pt(a.creator)}),image:ua?a.thumbnail:void 0,type:"product"}:{}),De?e.jsxs("div",{className:"item-detail item-detail--notfound",children:[e.jsx(F,{name:"cart",className:"item-detail__notfound-ico"}),e.jsx("h1",{className:"item-detail__notfound-title",children:t("itemDetail.notAvailableTitle")}),e.jsx("p",{className:"muted",children:t("itemDetail.notAvailableBody")}),e.jsx(St,{variant:"purple",onClick:()=>d("/assets"),children:t("notFound.cta")})]}):e.jsxs("div",{className:"item-detail",children:[e.jsxs("nav",{className:"item-detail__crumbs","aria-label":t("itemDetail.breadcrumbAria"),children:[e.jsx("button",{className:"item-detail__crumb-link",onClick:()=>d("/assets"),children:t("nav.collectibles")}),e.jsx("span",{className:"item-detail__crumb-sep",children:"/"}),e.jsx("span",{className:"item-detail__crumb-current",children:a.name||t("itemDetail.itemFallback")})]}),e.jsxs("div",{className:"item-detail__main",children:[e.jsxs("div",{className:"item-detail__preview","data-testid":"item-preview",children:[a.name?e.jsx(vt,{item:a}):e.jsx("div",{className:"item-preview__loading","aria-busy":"true","aria-label":t("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${B?" is-on":""}`,onClick:()=>m(a),"aria-pressed":B,"aria-label":B?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(F,{name:B?"heart-solid":"heart",size:18})})]}),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${B?" is-on":""}`,onClick:()=>m(a),"aria-pressed":B,"aria-label":B?t("assetCard.removeFromFavorites"):t("assetCard.addToFavorites"),children:e.jsx(F,{name:B?"heart-solid":"heart",size:18})})]}),e.jsxs("div",{className:"item-detail__chips",children:[e.jsx("span",{className:"chip chip--rarity",style:{background:za(oe),color:Oa(oe)},title:$a(a.rarity),children:a.rarity}),e.jsxs("span",{className:"chip item-detail__chip",children:[Ne?e.jsx(F,{name:Ne,size:18,color:"var(--text-2)"}):null,Ue(a)]}),ge?e.jsxs("span",{className:"chip item-detail__chip",children:[we?e.jsx(F,{name:we,size:18,color:"var(--text-2)"}):null,ge]}):null,a.issuedId?e.jsxs("span",{className:"chip item-detail__chip","data-testid":"detail-issued",children:["#",a.issuedId]}):null]}),q?e.jsxs("div",{className:"item-detail__section item-detail__description",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.description")}),e.jsx("p",{className:`item-detail__desc-text${U?" is-expanded":""}`,children:q}),q.length>140?e.jsx("button",{className:"link item-detail__desc-toggle",onClick:()=>de(i=>!i),children:U?t("itemDetail.showLess"):t("itemDetail.readMore")}):null]}):null,a.creator||E!=null&&E.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:t("itemDetail.creator")}),e.jsx(Ka,{address:a.creator,className:"item-detail__creator",linkToProfile:!0,hidePrefix:!0})]}):null,E!=null&&E.name?e.jsxs("div",{className:"item-detail__meta-col item-detail__meta-col--collection",children:[e.jsx("div",{className:"item-detail__label",children:t("itemDetail.collection")}),e.jsx(At,{contractAddress:a.contractAddress,name:E.name,items:f,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:[o||_?e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.price")}):null,o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"item-detail__price item-detail__price--market",children:h==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:h})]})}),e.jsx("div",{className:"item-detail__market-note muted",children:t("assetCard.marketPrice")})]}):_?Xe?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]}),Oe(a.compareAtCredits,a.priceCredits)>0?e.jsx("span",{className:"item-detail__sale-badge",children:t("assetCard.saleWithDiscount",{pct:Oe(a.compareAtCredits,a.priceCredits)})}):null,e.jsx(Wa,{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.jsxs("div",{className:"item-detail__price item-detail__price--none",children:[e.jsx("span",{children:t("itemDetail.notForSale")}),e.jsx(Je,{content:t("itemDetail.notForSaleHint"),children:e.jsx("span",{className:"item-detail__price-info",tabIndex:0,role:"img","aria-label":t("itemDetail.notForSaleHint"),children:e.jsx(F,{name:"info",size:14})})})]})]}),la?e.jsxs("div",{className:"item-detail__stock-col",children:[e.jsx("div",{className:"item-detail__price-label",children:t("itemDetail.stock")}),e.jsxs("div",{className:"item-detail__stock-value",children:[(a.available??0).toLocaleString(),"/",Q.Rarity.getMaxSupply(oe).toLocaleString()]})]}):da?e.jsx("div",{className:"item-detail__stock-col",children:e.jsx("div",{className:"item-detail__stock-value item-detail__stock-value--out","data-testid":"out-of-stock",children:t("itemDetail.outOfStock")})}):null]})}),e.jsx("div",{className:`item-detail__ctas${ca?" item-detail__ctas--buttons":""}${oa?" item-detail__ctas--dual":""}`,children:o?e.jsxs(re,{variant:"purple",onClick:()=>w(!0),disabled:!T,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),h!=null?e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(M,{className:"item-detail__cta-diamond"}),h]}):null]}):ue?e.jsxs(Mt,{"data-testid":"manage-actions",children:[e.jsx(xe,{message:sa}),ra?e.jsxs(e.Fragment,{children:[e.jsx(re,{variant:"purple",onClick:()=>void na(),disabled:H||!Se,children:e.jsx("span",{className:"item-detail__cta-label",children:H?t("itemDetail.manageWorking"):t("itemDetail.manageUpdatePrice")})}),e.jsx(Pt,{variant:"ghost",onClick:()=>void Pe(),disabled:H,children:H?t("myAssets.removing"):t("itemDetail.manageRemove")})]}):e.jsx(re,{variant:"purple",onClick:Ee,disabled:H||!Se,children:e.jsx("span",{className:"item-detail__cta-label",children:t("itemDetail.manageList")})}),e.jsxs(Et,{children:[t("itemDetail.ownItemPrefix")," ",e.jsx(ya,{to:"/my-assets",children:t("nav.myAssets")}),t("itemDetail.ownItemSuffix")]})]}):_?e.jsxs(e.Fragment,{children:[e.jsxs(re,{variant:"purple",onClick:()=>w(!0),disabled:u,children:[e.jsx("span",{className:"item-detail__cta-label",children:t("assetCard.buyNow")}),e.jsxs("span",{className:"item-detail__cta-price","aria-hidden":!0,children:[e.jsx(M,{className:"item-detail__cta-diamond"}),a.priceCredits]})]}),e.jsxs("button",{className:"item-detail__addcart",onClick:Ze,disabled:u||($?W:G),"aria-label":Le,children:[e.jsx(F,{name:"cart-solid"}),e.jsx("span",{className:"item-detail__addcart-label",children:Le})]})]}):e.jsxs(e.Fragment,{children:[e.jsx(wt,{item:a}),e.jsx(It,{item:a})]})})]}):e.jsx(Dt,{})})]}),e.jsx(ft,{title:ea,items:X,onViewAll:a.contractAddress?()=>d(`/collection/${a.contractAddress}`):void 0}),p&&o&&x&&I?e.jsx(yt,{listing:x,rate:I,onClose:()=>w(!1),onSold:()=>w(!1)}):p&&!o?e.jsx(bt,{item:C,resume:L,onClose:()=>{w(!1),b(!1)}}):null,aa&&y&&l?e.jsx(et,{asset:y,session:l,onClose:Fe}):null,ta&&me&&l?e.jsx(at,{item:me,session:l,onClose:Fe}):null]})}function Dt(){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{ls as ItemDetail,ls as default};
@@ -1,258 +0,0 @@
1
- import{L as ve,b as Ve,r as c,j as t}from"./react-BrLDncxD.js";import{s as a,F as s,I as j,u as Ze,t as r,d as Xe,o as et,G as pe,m as N,B as tt,A as q,x as ue,H as st,f as ot,J as nt,E as rt,c as at,K as it}from"./index-CJ4mXolB.js";import{f as lt}from"./import-CyzZeEcP.js";import{S as ct,P as dt,f as mt}from"./PrimaryListModal-CnlMOkG5.js";import{c as pt}from"./buy-BRLq1STf.js";import{R as G,C as ut,a as ft,F as xt,S as D,b as fe}from"./categories-BPU8ySTe.js";import{L as ht}from"./LoadMore-BLy9p9ul.js";import{D as xe,F as he,R as yt,a as gt,b as bt,c as St,d as wt,S as jt,e as $t,f as Ct,g as It,h as vt,i as kt,j as At,k as Et,C as Tt,l as Ft,m as Rt,n as _t,M as Lt}from"./Assets.styles-eeqx94WS.js";import{u as Ot}from"./useInfiniteGrid-BbeLTVdN.js";import{E as Q}from"./ErrorNotice-BDH9xoG4.js";import{n as ke}from"./emotion-CSxEP8yM.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DYZXk5O5.js";import"./ethers-CLB2z3On.js";import"./intl-CBcMB1D2.js";import"./mana-rate-DtQ8WpoI.js";import"./index-HN6Rk25C.js";import"./trade-encoding-0IFZ39Tk.js";import"./authorizations-sU14ILrd.js";import"./errors-DKFg2ql0.js";import"./Tooltip-DJ7HtAmB.js";a.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: 4px;
5
- width: 100%;
6
- `;a.h2`
7
- margin: 0;
8
- padding: 4px 4px 2px;
9
- font-family: ${s.font.sans};
10
- font-weight: 700;
11
- font-size: 12px;
12
- letter-spacing: 0.46px;
13
- text-transform: uppercase;
14
- color: ${s.colors.muted};
15
- `;a("button",ke("selected"))`
16
- display: flex;
17
- align-items: center;
18
- gap: 10px;
19
- width: 100%;
20
- height: 40px;
21
- padding: 4px 12px;
22
- border: 0;
23
- border-radius: 8px;
24
- background: ${({selected:o})=>o?s.colors.media:"transparent"};
25
- color: ${s.colors.text};
26
- font-family: ${s.font.sans};
27
- font-weight: ${({selected:o})=>o?600:400};
28
- font-size: 14px;
29
- text-align: left;
30
- cursor: pointer;
31
-
32
- @media (hover: hover) {
33
- &:hover {
34
- background: ${s.colors.media};
35
- }
36
- }
37
- &:focus-visible {
38
- outline: 2px solid ${s.colors.accent};
39
- outline-offset: 2px;
40
- }
41
- `;a(j)`
42
- width: 18px;
43
- height: 18px;
44
- flex: none;
45
- color: ${s.colors.muted};
46
- `;a.div`
47
- display: flex;
48
- flex-direction: column;
49
- gap: 8px;
50
- width: 100%;
51
- `;a.span`
52
- font-family: ${s.font.sans};
53
- font-weight: 600;
54
- font-size: 14px;
55
- line-height: 1.43;
56
- color: ${s.colors.text};
57
- padding: 0 4px;
58
- `;a.div`
59
- display: flex;
60
- flex-wrap: wrap;
61
- gap: 8px;
62
- padding: 4px;
63
- `;a("button",ke("selected"))`
64
- display: inline-flex;
65
- align-items: center;
66
- gap: 4px;
67
- padding: 4px 10px;
68
- border-radius: 6px;
69
- background: ${({selected:o})=>o?s.colors.text:s.colors.softWhite};
70
- border: ${({selected:o})=>o?`1px solid ${s.colors.text}`:`0.5px solid ${s.colors.gray4}`};
71
- color: ${({selected:o})=>o?s.colors.white:s.colors.gray0};
72
- font-family: ${s.font.sans};
73
- font-weight: ${({selected:o})=>o?600:400};
74
- font-size: 12px;
75
- cursor: pointer;
76
-
77
- &:hover {
78
- border-color: ${s.colors.text};
79
- }
80
- &:focus-visible {
81
- outline: 2px solid ${s.colors.accent};
82
- outline-offset: 2px;
83
- }
84
- `;const Pt=a.div`
85
- display: flex;
86
- align-items: center;
87
- gap: 8px;
88
- height: 44px;
89
- padding: 0 12px;
90
- margin-bottom: 16px;
91
- border: 1px solid ${s.colors.lineStrong};
92
- border-radius: ${s.radius.btn};
93
- background: ${s.colors.white};
94
-
95
- &:focus-within {
96
- border-color: ${s.colors.accent};
97
- }
98
- `,zt=a(j)`
99
- width: 18px;
100
- height: 18px;
101
- flex: none;
102
- color: ${s.colors.muted};
103
- `,Bt=a.input`
104
- flex: 1;
105
- min-width: 0;
106
- border: 0;
107
- background: none;
108
- padding: 0;
109
- font-family: ${s.font.sans};
110
- font-size: 14px;
111
- color: ${s.colors.text};
112
-
113
- &::placeholder {
114
- color: ${s.colors.muted2};
115
- }
116
- &:focus {
117
- outline: 0;
118
- }
119
- `,Kt=a.button`
120
- display: grid;
121
- place-items: center;
122
- width: 24px;
123
- height: 24px;
124
- border: 0;
125
- border-radius: 50%;
126
- background: ${s.colors.chip};
127
- color: ${s.colors.text};
128
- cursor: pointer;
129
- flex: none;
130
-
131
- &:focus-visible {
132
- outline: 2px solid ${s.colors.accent};
133
- outline-offset: 2px;
134
- }
135
- `,Mt=a(j)`
136
- width: 12px;
137
- height: 12px;
138
- `,ye=a.div`
139
- display: grid;
140
- grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
141
- gap: 20px;
142
-
143
- ${s.media.down("sm")} {
144
- grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
145
- gap: 12px;
146
- }
147
- `;a.p`
148
- margin: 24px 0;
149
- font-family: ${s.font.sans};
150
- font-size: 14px;
151
- color: ${s.colors.muted};
152
- `;const ge=a.div`
153
- display: flex;
154
- flex-direction: column;
155
- align-items: center;
156
- justify-content: center;
157
- gap: 6px;
158
- padding: 72px 24px;
159
- text-align: center;
160
- `,be=a.div`
161
- display: flex;
162
- align-items: center;
163
- justify-content: center;
164
- width: 72px;
165
- height: 72px;
166
- margin-bottom: 10px;
167
- border-radius: 50%;
168
- background: ${s.colors.navViolet};
169
- color: ${s.colors.accent};
170
- `,Se=a.p`
171
- margin: 0;
172
- font-family: ${s.font.sans};
173
- font-size: 18px;
174
- font-weight: 600;
175
- color: ${s.colors.text};
176
- `,we=a.p`
177
- margin: 0;
178
- max-width: 360px;
179
- font-family: ${s.font.sans};
180
- font-size: 14px;
181
- line-height: 1.5;
182
- color: ${s.colors.muted};
183
- `,Nt=a(ve)`
184
- margin-top: 12px;
185
- display: inline-flex;
186
- align-items: center;
187
- height: 40px;
188
- padding: 0 20px;
189
- border-radius: 8px;
190
- background: ${s.colors.accent};
191
- color: #fff;
192
- font-family: ${s.font.sans};
193
- font-size: 14px;
194
- font-weight: 600;
195
- text-decoration: none;
196
- cursor: pointer;
197
-
198
- &:hover {
199
- background: ${s.colors.accentHover};
200
- }
201
- `,qt=a.section`
202
- max-width: 520px;
203
- margin: 48px auto;
204
- text-align: center;
205
- display: flex;
206
- flex-direction: column;
207
- gap: 16px;
208
- align-items: center;
209
- `,Gt=a.h1`
210
- margin: 0;
211
- font-family: ${s.font.sans};
212
- font-weight: 700;
213
- font-size: 24px;
214
- color: ${s.colors.text};
215
- `,Dt=a.p`
216
- margin: 0;
217
- font-family: ${s.font.sans};
218
- font-size: 15px;
219
- color: ${s.colors.muted};
220
- `,Qt=a(ve)`
221
- display: flex;
222
- align-items: center;
223
- gap: 12px;
224
- margin-bottom: 16px;
225
- padding: 12px 16px;
226
- border-radius: ${s.radius.btn};
227
- background: ${s.colors.rarityBg};
228
- color: ${s.colors.text};
229
- text-decoration: none;
230
-
231
- &:hover {
232
- filter: brightness(0.98);
233
- }
234
- &:focus-visible {
235
- outline: 2px solid ${s.colors.accent};
236
- outline-offset: 2px;
237
- }
238
- `,Ht=a.span`
239
- display: flex;
240
- flex-direction: column;
241
- flex: 1;
242
- min-width: 0;
243
- font-family: ${s.font.sans};
244
- `,Ut=a.strong`
245
- font-weight: 600;
246
- font-size: 14px;
247
- color: ${s.colors.text};
248
- `,Wt=a.span`
249
- font-size: 12px;
250
- color: ${s.colors.muted};
251
- `,Yt=a.span`
252
- flex: none;
253
- font-weight: 600;
254
- font-size: 13px;
255
- color: ${s.colors.accent};
256
- text-transform: uppercase;
257
- letter-spacing: 0.046em;
258
- `,Jt=48,je=[{key:"wearables",labelKey:"myAssets.sectionWearables",category:"wearable"},{key:"emotes",labelKey:"myAssets.sectionEmotes",category:"emote"},{key:"names",labelKey:"myAssets.sectionNames",category:"ens"},{key:"creations",labelKey:"myAssets.sectionCreations"}],H=[{key:"newest",label:"filterBar.sortNewest",server:"newest"},{key:"name",label:"filterBar.sortName",server:"name"},{key:"cheapest",label:"filterBar.sortCheapest",server:"cheapest"}];function $e(o){return o==="wearables"||o==="emotes"}const Ce={wearables:"wearable",emotes:"emote",names:"names",creations:""},Vt={wearable:"wearables",emote:"emotes",names:"names"};function Ie(o){return{id:o.id,name:o.name,creator:"",contractAddress:o.contractAddress,itemId:o.itemId,category:o.category,rarity:o.rarity??"common",network:o.network,chainId:o.chainId,thumbnail:o.image,priceCredits:o.listingPrice??0,gender:null,isSmart:!1,tokenId:o.tokenId,issuedId:o.issuedId}}function Zt(o,T=0){return{id:`${o.contractAddress}-${o.blockchainItemId}`,name:o.name,creator:"",contractAddress:o.contractAddress,itemId:o.blockchainItemId,category:o.category,rarity:o.rarity,network:"MATIC",chainId:at.chainId,thumbnail:o.thumbnail,priceCredits:T,gender:null,isSmart:!1}}function Ss(){var ce,de;Ze({title:r("nav.myAssets"),noindex:!0});const{session:o,error:T,signIn:Ae,restore:U}=Xe(),F=et(),[Ee,Te]=Ve(),W=Ee.get("section"),l=je.some(e=>e.key===W)?W:"wearables",[m,R]=c.useState("all"),[h,_]=c.useState([]),[p,$]=c.useState(null),[S,Fe]=c.useState("newest"),[C,Y]=c.useState(""),[y,Re]=c.useState(""),[I,g]=c.useState(!1),[_e,Le]=c.useState(!0),[Oe,Pe]=c.useState(!1),[J,V]=c.useState(null),[Z,X]=c.useState(null),[ee,te]=c.useState(null),[ze,se]=c.useState(null);c.useEffect(()=>{U()},[U]),c.useEffect(()=>{const e=setTimeout(()=>Re(C.trim()),300);return()=>clearTimeout(e)},[C]),c.useEffect(()=>{if(!I)return;const e=i=>{i.key==="Escape"&&g(!1)};document.addEventListener("keydown",e);const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",e),document.body.style.overflow=n}},[I]);const u=o==null?void 0:o.address,Be=je.find(e=>e.key===l),v=$e(l),oe=(H.find(e=>e.key===S)??H[0]).server,Ke=m==="on_sale"?r("filter.onSale"):m==="not_for_sale"?r("filter.notForSale"):"",Me=G.filter(e=>h.includes(e)).map(pe).join(", ");function ne(e){Te(n=>{const i=new URLSearchParams(n);return i.set("section",e),i},{replace:!0}),$(null),$e(e)||_([]),g(!1)}function re(e){_(n=>n.includes(e)?n.filter(i=>i!==e):[...n,e])}function Ne(e){const n=Vt[e];n&&ne(n)}const{items:L,total:qe,isLoading:O,isPlaceholderData:P,error:Ge,hasNextPage:De,isFetchingNextPage:ae,fetchNextPage:Qe}=Ot(["my-assets",u,l,m,h,p,y,oe],e=>st(u,{category:Be.category,first:Jt,skip:e,search:y||void 0,rarities:v&&h.length?h:void 0,wearableCategories:l==="wearables"&&p?fe[p]:void 0,emoteCategories:l==="emotes"&&p?fe[p]:void 0,onlyOnSale:m==="on_sale"||void 0,sortBy:oe}).then(n=>({items:n.assets,total:n.total})),{enabled:!!u&&l!=="creations"}),z=c.useMemo(()=>m==="not_for_sale"?L.filter(e=>!e.isOnSale):L,[L,m]),{data:k,isLoading:B,isError:He}=N({queryKey:["publishable-items",u],queryFn:()=>mt(u,o.identity),enabled:!!o&&l==="creations",retry:!1}),K=c.useMemo(()=>[...new Set((k??[]).map(e=>e.contractAddress))],[k]),{data:A}=N({queryKey:["collection-sale-state",u,K],enabled:K.length>0,queryFn:async()=>{const e=await Promise.all(K.map(async i=>[i,await it(i)])),n={};for(const[i,d]of e)for(const[f,x]of Object.entries(d))n[`${i}-${f}`]=x;return n}}),w=e=>A==null?void 0:A[`${e.contractAddress}-${e.blockchainItemId}`],M=c.useMemo(()=>{let e=k??[];if(m==="on_sale"?e=e.filter(i=>{var d;return(d=w(i))==null?void 0:d.isOnSale}):m==="not_for_sale"&&(e=e.filter(i=>{var d;return!((d=w(i))!=null&&d.isOnSale)})),y){const i=y.toLowerCase();e=e.filter(d=>d.name.toLowerCase().includes(i))}const n=[...e];return S==="name"?n.sort((i,d)=>i.name.localeCompare(d.name)):S==="cheapest"&&n.sort((i,d)=>{var f,x;return(((f=w(i))==null?void 0:f.priceCredits)??0)-(((x=w(d))==null?void 0:x.priceCredits)??0)}),n},[k,A,m,y,S]),{data:b}=N({queryKey:["importable",u],queryFn:()=>lt(u),enabled:!!u}),ie=((b==null?void 0:b.creations.length)??0)+((b==null?void 0:b.owned.length)??0);async function le(e,n,i){if(o){se(null),te(i);try{const d=await ot(e);await pt({trade:d,signer:o.signer}),nt.success(r("myAssets.removedFromSale",{name:n})),await F.invalidateQueries({queryKey:["my-assets",o.address]}),await F.invalidateQueries({queryKey:["collection-sale-state"]}),await F.invalidateQueries({queryKey:["publishable-items"]})}catch(d){const f=d,x=(f.message??"").toLowerCase(),me=f.code===4001||x.includes("reject")||x.includes("denied");me||rt(d,{flow:"remove-listing",tradeId:e}),se(me?r("getCredits.errorCanceled"):r("myAssets.removeListingError"))}finally{te(null)}}}if(!o)return t.jsxs(qt,{children:[t.jsx(Gt,{children:r("nav.myAssets")}),t.jsx(Dt,{children:r("myAssets.signInPrompt")}),t.jsx(tt,{variant:"purple",onClick:()=>Ae(),children:r("storeSettings.signIn")}),t.jsx(Q,{message:T})]});const Ue=l==="creations"?B:O||P,We=l==="creations"?M.length:m==="not_for_sale"?z.length:qe,E=[];if(m!=="all"&&E.push({key:"status",label:m==="on_sale"?r("filter.onSale"):r("filter.notForSale"),onRemove:()=>R("all")}),v)for(const e of G)h.includes(e)&&E.push({key:`rarity-${e}`,label:pe(e),onRemove:()=>re(e)});if(v&&p){const e=(de=(ce=ut.find(n=>n.key===Ce[l]))==null?void 0:ce.subs)==null?void 0:de.find(n=>n.key===p);E.push({key:"sub",label:e?r(e.labelKey):p,onRemove:()=>$(null)})}function Ye(){R("all"),_([]),$(null)}const Je=t.jsxs(t.Fragment,{children:[t.jsx(ft,{title:r("myAssets.assetsHeading"),category:Ce[l],subCategory:p,onCategory:Ne,onSub:$,onCollections:()=>ne("creations"),collections:l==="creations",extraLabelKey:"myAssets.sectionCreations",hideAll:!0}),v?t.jsxs(t.Fragment,{children:[t.jsx(xe,{}),t.jsx(he,{title:r("assets.rarity"),open:Oe,onToggle:()=>Pe(e=>!e),summary:Me,headerTestId:"sidebar-section-toggle",children:t.jsx(yt,{"data-testid":"rarity-filter",children:G.map(e=>{const n=h.includes(e);return t.jsxs(gt,{type:"button",selected:n,"aria-pressed":n,onClick:()=>re(e),"data-testid":"rarity-filter-check",children:[t.jsx(bt,{color:s.rarities[e],children:n?t.jsx(St,{name:"check","aria-hidden":!0}):null}),t.jsx(wt,{selected:n,children:e})]},e)})})})]}):null,t.jsx(xe,{}),t.jsx(he,{title:r("filter.status"),open:_e,onToggle:()=>Le(e=>!e),summary:Ke,children:[["all",r("filter.statusAll")],["on_sale",r("filter.onSale")],["not_for_sale",r("filter.notForSale")]].map(([e,n])=>t.jsxs(jt,{children:[t.jsx($t,{type:"radio",name:"myassets-status",checked:m===e,onChange:()=>R(e)}),t.jsx(Ct,{children:n})]},e))})]});return t.jsxs(It,{"data-testid":"my-assets",children:[I?t.jsx(vt,{onClick:()=>g(!1),"aria-hidden":!0}):null,t.jsxs(kt,{className:I?"is-open":"","data-testid":"my-assets-sidebar",children:[t.jsxs(At,{children:[t.jsx(Et,{children:r("assets.filters")}),t.jsx(Tt,{onClick:()=>g(!1),"aria-label":r("assets.closeFilters"),children:"✕"})]}),t.jsx(Ft,{children:Je}),t.jsx(Rt,{children:t.jsx(_t,{type:"button",onClick:()=>g(!1),children:r("assets.showItems")})})]}),t.jsxs(Lt,{children:[t.jsxs(Pt,{children:[t.jsx(zt,{name:"search","aria-hidden":!0}),t.jsx(Bt,{type:"search",value:C,placeholder:r("myAssets.searchPlaceholder"),"aria-label":r("myAssets.searchPlaceholder"),onChange:e=>Y(e.target.value)}),C?t.jsx(Kt,{type:"button","aria-label":r("myAssets.clearSearch"),onClick:()=>Y(""),children:t.jsx(Mt,{name:"close","aria-hidden":!0})}):null]}),ie>0?t.jsxs(Qt,{to:"/import",children:[t.jsx("span",{"aria-hidden":!0,children:"📦"}),t.jsxs(Ht,{children:[t.jsx(Ut,{children:r("myAssets.importTitle")}),t.jsx(Wt,{children:r("myAssets.importSub",{count:ie})})]}),t.jsx(Yt,{children:r("myAssets.import")})]}):null,t.jsx(xt,{sort:S,onSort:Fe,sortOptions:H,total:We,loading:Ue,query:y,onOpenFilters:()=>g(!0),chips:E,onClearChips:Ye}),(l==="creations"?He:Ge)?t.jsx(Q,{message:r("myAssets.ownedError"),testId:"my-assets-error"}):null,t.jsx(Q,{message:ze}),l==="creations"?t.jsxs(t.Fragment,{children:[t.jsx(ye,{"data-testid":"grid",children:B?t.jsx(D,{count:12}):M.map(e=>{const n=w(e),i=!!(n!=null&&n.isOnSale);return t.jsx(q,{item:Zt(e,(n==null?void 0:n.priceCredits)??0),mode:"manage",listed:i,busy:ee===e.id,onList:()=>{ue("Shop Started Listing",{listing_type:"primary",item_id:e.blockchainItemId}),X(e)},onUnlist:()=>{n!=null&&n.tradeId&&le(n.tradeId,e.name,e.id)}},`${e.contractAddress}-${e.blockchainItemId}`)})}),!B&&M.length===0?t.jsxs(ge,{children:[t.jsx(be,{children:t.jsx(j,{name:"pen",size:30,"aria-hidden":!0})}),t.jsx(Se,{children:r("myAssets.emptyCreationsTitle")}),t.jsx(we,{children:r("myAssets.nothingToPublish")})]}):null]}):t.jsxs(t.Fragment,{children:[t.jsxs(ye,{"data-testid":"grid",children:[O||P?t.jsx(D,{count:12}):z.map(e=>l==="names"?t.jsx(q,{item:{...Ie(e),category:"ens"},mode:"view"},e.id):t.jsx(q,{item:Ie(e),mode:"manage",listed:e.isOnSale,busy:ee===e.id,onList:()=>{ue("Shop Started Listing",{listing_type:"secondary",item_id:e.itemId??e.tokenId??null}),V(e)},onUnlist:()=>{e.tradeId&&le(e.tradeId,e.name,e.id)}},e.id)),ae?t.jsx(D,{count:6}):null]}),m!=="not_for_sale"?t.jsx(ht,{hasNextPage:De,isFetching:ae,onLoadMore:()=>void Qe()}):null,!O&&!P&&z.length===0?t.jsxs(ge,{children:[t.jsx(be,{children:t.jsx(j,{name:l==="names"?"website":l==="emotes"?"emote-dance":"cat-upper",size:30,"aria-hidden":!0})}),t.jsx(Se,{children:l==="names"?r("myAssets.emptyNamesTitle"):r("myAssets.emptyOwnedTitle")}),t.jsx(we,{children:l==="names"?r("myAssets.namesEmpty"):r("myAssets.ownedEmpty")}),l!=="names"?t.jsx(Nt,{to:"/assets",children:r("myAssets.emptyBrowse")}):null]}):null]})]}),J?t.jsx(ct,{asset:J,session:o,onClose:()=>V(null)}):null,Z?t.jsx(dt,{item:Z,session:o,onClose:()=>X(null)}):null]})}export{Ss as MyAssets};
@@ -1 +0,0 @@
1
- import{c as w,a6 as K,o as M,t as s,h as P,B as f,C as j,p as E,x as C,J as $,E as T,y as O,e as H}from"./index-CJ4mXolB.js";import{d as F}from"./dcl-schemas-BICTSpB5.js";import{a as R,r as m,j as a}from"./react-BrLDncxD.js";import{a as J,b as X,i as V,e as Y,c as z}from"./trade-encoding-0IFZ39Tk.js";import{f as U}from"./errors-DKFg2ql0.js";import{E as q}from"./ErrorNotice-BDH9xoG4.js";const I=()=>`${w.builderServerUrl}/v1`;function B(e){return Array.isArray(e)?e:"results"in e&&Array.isArray(e.results)?e.results:"data"in e&&Array.isArray(e.data)?e.data:[]}async function Q(e,r){const t=await K(e,{method:"GET",identity:r,metadata:{}});if(!t.ok)throw new Error(`builder-server ${t.status}: ${await t.text()}`);const l=await t.json();return l.data??l}function Z(e,r){const t=r-e;return t>0?t:0}function ee(e){var r,t,l,i,n;return((t=(r=e.data)==null?void 0:r.wearable)==null?void 0:t.category)??((i=(l=e.data)==null?void 0:l.emote)==null?void 0:i.category)??((n=e.data)==null?void 0:n.category)??e.type??"wearable"}function A(e){return`${I()}/storage/contents/${e}`}function S(e,r){if(!e)return"";if(/^https?:\/\//.test(e))return e;const t=r==null?void 0:r[e];return t?A(t):/^(ba|Qm)/.test(e)?A(e):""}async function ae(e,r){try{const t=await fetch(`${I()}/items/${e}/${r}/contents`);if(!t.ok)return{};const l=await t.json();return l.data??l}catch{return{}}}async function se(e,r,t){const l=S(e.thumbnail,e.contents)||S("thumbnail.png",e.contents);if(l)return l;if(r&&t){const i=await ae(r,t);return S(e.thumbnail,i)||S("thumbnail.png",i)||S("image.png",i)}return""}async function te(e,r){const t=`${I()}/${e.toLowerCase()}/collections?is_published=true`,l=await Q(t,r);return B(l).filter(i=>i.is_published&&!!i.contract_address).map(i=>({id:i.id,name:i.name,contractAddress:i.contract_address.toLowerCase(),isPublished:i.is_published,isApproved:i.is_approved,minters:(i.minters??[]).map(n=>n.toLowerCase())}))}async function re(e,r){const t=`${I()}/collections/${e.id}/items`,l=await Q(t,r);return(await Promise.all(B(l).map(async n=>{const x=n.rarity??"common",y=Number(n.total_supply??0)||0;let o;try{o=F.Rarity.getMaxSupply(x)}catch{o=0}const _=(n.contract_address??e.contractAddress).toLowerCase(),p=n.blockchain_item_id??"";return{id:n.id,collectionId:e.id,collectionName:e.name,contractAddress:_,blockchainItemId:p,name:n.name,category:ee(n),rarity:x,thumbnail:await se(n,_,p),type:n.type??"wearable",isPublished:n.is_published??e.isPublished,isApproved:n.is_approved??e.isApproved,totalSupply:y,maxSupply:o,remainingSupply:Z(y,o),minters:e.minters}}))).filter(ie)}function ie(e){return e.isPublished&&e.isApproved&&e.blockchainItemId!==""&&e.blockchainItemId!=null&&e.remainingSupply>0}async function he(e,r){const t=await te(e,r);return(await Promise.all(t.map(async i=>{try{return await re(i,r)}catch{return[]}}))).flat()}const ne=1e3*60*60*24*182;function ye({asset:e,session:r,onClose:t}){const l=M(),i=R(),[n,x]=m.useState("10"),[y,o]=m.useState(null),[_,p]=m.useState(null),[u,N]=m.useState(!1),[h,v]=m.useState(null);async function k(){p(null);const c=Number(n);if(!Number.isInteger(c)||c<=0){p(s("sellModal.errorWholeNumber"));return}N(!0);try{o(s("sellModal.statusPreparing")),await J({signer:r.signer,contractAddress:e.contractAddress,chainId:e.chainId}),o(s("sellModal.statusListing"));const g=await X({signer:r.signer,nft:{contractAddress:e.contractAddress,tokenId:e.tokenId,network:e.network,chainId:e.chainId},usdPrice:c/10,expiresAtMs:Date.now()+ne});o(s("sellModal.statusPublishing")),await E(g,r.identity),o(null),v(c),C("Shop Listed Item",{item_id:e.itemId??e.tokenId??null,contract_address:e.contractAddress,price_credits:c,price_usd:c/10,listing_type:"secondary",is_primary:!1}),$.success(s("sellModal.toastOnSale",{name:e.name})),l.invalidateQueries({queryKey:["my-assets",r.address]})}catch(g){T(g,{flow:"list_secondary"}),C("Shop Listing Failed",{listing_type:"secondary",error_code:O(g)}),p(U(g,s("sellModal.errorGeneric"))),o(null)}finally{N(!1)}}function L(){t(),i(`/item/${e.contractAddress}/${e.tokenId}`)}return h!==null?a.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:a.jsxs("div",{className:"modal modal--success",onClick:c=>c.stopPropagation(),role:"dialog","aria-modal":"true",children:[a.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),a.jsx("h2",{className:"modal__title",children:s("sellModal.successTitle")}),e.image?a.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,a.jsx("p",{className:"modal-success__name",children:e.name}),a.jsxs("p",{className:"muted small",children:[s("sellModal.listedFor")," ",a.jsxs("strong",{children:[a.jsx(P,{className:"ccy-mark"})," ",h]})]}),a.jsxs("div",{className:"modal__actions",children:[a.jsx(f,{variant:"ghost",onClick:t,children:s("getCredits.done")}),a.jsx(f,{variant:"purple",onClick:L,children:s("sellModal.viewInShop")})]})]})}):a.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:a.jsxs("div",{className:"modal","data-testid":"modal",onClick:c=>c.stopPropagation(),role:"dialog","aria-modal":"true",children:[a.jsx("h2",{className:"modal__title",children:s("sellModal.listTitle",{name:e.name})}),e.image?a.jsx("img",{className:"modal__img",src:e.image,alt:e.name}):null,a.jsxs("label",{className:"field",children:[a.jsx("span",{children:s("sellModal.priceLabel",{currency:j.name})}),a.jsx("input",{type:"number",min:"1",step:"1",value:n,onChange:c=>x(c.target.value),disabled:u})]}),a.jsx("p",{className:"muted small",children:s("sellModal.pricedInWhole",{currency:j.name,currencySingular:j.nameSingular})}),y?a.jsx("p",{className:"muted",children:y}):null,a.jsx(q,{message:_}),a.jsxs("div",{className:"modal__actions",children:[a.jsx(f,{variant:"ghost",onClick:t,disabled:u,children:s("sellModal.cancel")}),a.jsx(f,{onClick:()=>void k(),disabled:u,children:u?s("sellModal.listing"):s("sellModal.putOnSale")})]})]})})}const le=1e3*60*60*24*182;function ge({item:e,session:r,onClose:t}){const l=M(),i=R(),[n,x]=m.useState("10"),[y,o]=m.useState(null),[_,p]=m.useState(null),[u,N]=m.useState(!1),[h,v]=m.useState(null),[k,L]=m.useState(null),c=w.chainId,g=H(r.providerType);m.useEffect(()=>{let d=!1;return(async()=>{try{const b=await V({contractAddress:e.contractAddress,chainId:c});d||v(b)}catch{d||v(!1)}})(),()=>{d=!0}},[e.contractAddress,c]);async function W(){p(null);const d=Number(n);if(!Number.isInteger(d)||d<=0){p(s("primaryList.errorWholeNumber"));return}N(!0);try{h||(o(s("primaryList.statusEnabling")),await Y({signer:r.signer,contractAddress:e.contractAddress,chainId:c}),v(!0)),o(s("primaryList.statusPublishing"));const b=await z({signer:r.signer,item:{contractAddress:e.contractAddress,itemId:e.blockchainItemId,network:F.Network.MATIC,chainId:c},usdPrice:d/10,uses:e.remainingSupply,expiresAtMs:Date.now()+le});o(s("primaryList.statusFinishing")),await E(b,r.identity),o(null),L(d),C("Shop Listed Item",{item_id:e.blockchainItemId,contract_address:e.contractAddress,price_credits:d,price_usd:d/10,listing_type:"primary",is_primary:!0}),$.success(s("primaryList.toastOnSale",{name:e.name})),l.invalidateQueries({queryKey:["publishable-items"]}),l.invalidateQueries({queryKey:["collection-sale-state"]})}catch(b){T(b,{flow:"list_primary"}),C("Shop Listing Failed",{listing_type:"primary",error_code:O(b)}),p(U(b,s("primaryList.errorGeneric"))),o(null)}finally{N(!1)}}function D(){t(),i(`/item/${e.contractAddress}/${e.blockchainItemId}`)}const G=u?s("primaryList.listing"):h===!1?s("primaryList.enableAndPutOnSale"):s("primaryList.putOnSale");return k!==null?a.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:a.jsxs("div",{className:"modal modal--success",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[a.jsx("div",{className:"modal-success__check","aria-hidden":!0,children:"✓"}),a.jsx("h2",{className:"modal__title",children:s("primaryList.successTitle")}),e.thumbnail?a.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,a.jsx("p",{className:"modal-success__name",children:e.name}),a.jsxs("p",{className:"muted small",children:[s("primaryList.listedFor")," ",a.jsxs("strong",{children:[a.jsx(P,{className:"ccy-mark"})," ",k]})," ",s("primaryList.dotAvailable",{count:e.remainingSupply})]}),a.jsxs("div",{className:"modal__actions",children:[a.jsx(f,{variant:"ghost",onClick:t,children:s("getCredits.done")}),a.jsx(f,{variant:"purple",onClick:D,children:s("primaryList.viewInShop")})]})]})}):a.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:a.jsxs("div",{className:"modal","data-testid":"modal",onClick:d=>d.stopPropagation(),role:"dialog","aria-modal":"true",children:[a.jsx("h2",{className:"modal__title",children:s("primaryList.publishTitle",{name:e.name})}),e.thumbnail?a.jsx("img",{className:"modal__img",src:e.thumbnail,alt:e.name}):null,a.jsx("p",{className:"muted small",children:s("primaryList.fromCollection",{collectionName:e.collectionName,count:e.remainingSupply})}),a.jsxs("label",{className:"field",children:[a.jsx("span",{children:s("primaryList.priceLabel",{currency:j.name})}),a.jsx("input",{type:"number",min:"1",step:"1",value:n,onChange:d=>x(d.target.value),disabled:u})]}),a.jsx("p",{className:"muted small",children:s("primaryList.pricedInWhole",{currency:j.name,currencySingular:j.nameSingular})}),h===!1&&!u?g?a.jsx("p",{className:"muted small primary-note",children:s("primaryList.firstTimeConfirm",{collectionName:e.collectionName})}):a.jsx("p",{className:"muted small primary-note",children:s("primaryList.firstTimeManaged",{collectionName:e.collectionName})}):h===!0&&!u?g?a.jsx("p",{className:"muted small primary-note",children:s("primaryList.readyConfirm")}):a.jsx("p",{className:"muted small primary-note",children:s("primaryList.readyManaged")}):null,y?a.jsx("p",{className:"muted",children:y}):null,a.jsx(q,{message:_}),a.jsxs("div",{className:"modal__actions",children:[a.jsx(f,{variant:"ghost",onClick:t,disabled:u,children:s("primaryList.cancel")}),a.jsx(f,{onClick:()=>void W(),disabled:u||h===null,children:h===null?s("primaryList.checking"):G})]})]})})}export{ge as P,ye as S,he as f};
@@ -1 +0,0 @@
1
- import{R as z,Y as I,Z as j,$ as q,a0 as R,a1 as A,a2 as D,a3 as G,a4 as U}from"./index-CJ4mXolB.js";import{r as c}from"./react-BrLDncxD.js";var V=I,W=function(e){return e!=="theme"},E=function(e){return typeof e=="string"&&e.charCodeAt(0)>96?V:W},O=function(e,t,s){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(d){return e.__emotion_forwardProp(d)&&i(d)}:i}return typeof r!="function"&&s&&(r=e.__emotion_forwardProp),r},Y=function(e){var t=e.cache,s=e.serialized,r=e.isStringTag;return D(t,s,r),G(function(){return U(t,s,r)}),null},Z=function o(e,t){var s=e.__emotion_real===e,r=s&&e.__emotion_base||e,i,d;t!==void 0&&(i=t.label,d=t.target);var b=O(e,t,s),w=b||E(r),_=!w("as");return function(){var m=arguments,l=s&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(i!==void 0&&l.push("label:"+i+";"),m[0]==null||m[0].raw===void 0)l.push.apply(l,m);else{var S=m[0];l.push(S[0]);for(var x=m.length,p=1;p<x;p++)l.push(m[p],S[p])}var n=j(function(a,u,v){var P=_&&a.as||r,f="",F=[],h=a;if(a.theme==null){h={};for(var C in a)h[C]=a[C];h.theme=c.useContext(q)}typeof a.className=="string"?f=R(u.registered,F,a.className):a.className!=null&&(f=a.className+" ");var N=A(l.concat(F),u.registered,h);f+=u.key+"-"+N.name,d!==void 0&&(f+=" "+d);var k=_&&b===void 0?E(P):w,g={};for(var y in a)_&&y==="as"||k(y)&&(g[y]=a[y]);return g.className=f,v&&(g.ref=v),c.createElement(c.Fragment,null,c.createElement(Y,{cache:u,serialized:N,isStringTag:typeof P=="string"}),c.createElement(P,g))});return n.displayName=i!==void 0?i:"Styled("+(typeof r=="string"?r:r.displayName||r.name||"Component")+")",n.defaultProps=e.defaultProps,n.__emotion_real=n,n.__emotion_base=r,n.__emotion_styles=l,n.__emotion_forwardProp=b,Object.defineProperty(n,"toString",{value:function(){return"."+d}}),n.withComponent=function(a,u){var v=o(a,z({},t,u,{shouldForwardProp:O(n,u,!0)}));return v.apply(void 0,l)},n}},$=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],T=Z.bind(null);$.forEach(function(o){T[o]=T(o)});export{T as n};