@dcl/shop 0.1.0-29869835587.commit-e6e6578 → 0.1.0-29905759067.commit-1f1fc48

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 (170) hide show
  1. package/assets/{AnimatedBackground-BvysF8a0.js → AnimatedBackground-iuUEWVvX.js} +1 -1
  2. package/assets/{Assets-DoUIRoSX.js → Assets-Boa_vcsA.js} +48 -48
  3. package/assets/{Cart-Cyj_u0xP.js → Cart-DmysAv-C.js} +2 -2
  4. package/assets/{CircularProgress-Bf7cTa84.js → CircularProgress-BbpUGXBC.js} +1 -1
  5. package/assets/{Collection-BFUSn0Z_.js → Collection-CaNHH8rp.js} +1 -1
  6. package/assets/{CollectionCarousel-BaK4BZqg.js → CollectionCarousel-DZRKlb8f.js} +1 -1
  7. package/assets/{Creator-CTfg9WAL.js → Creator-BB_N6Oar.js} +1 -1
  8. package/assets/{CssVarsProvider-DQXUaIP8.js → CssVarsProvider-CD9SUox4.js} +1 -1
  9. package/assets/{ExchangeController-H99cRhIr.js → ExchangeController-BWSsNG4e.js} +1 -1
  10. package/assets/{GetCredits-BqhYAHL0.js → GetCredits-Br21K9mc.js} +1 -1
  11. package/assets/{HelpersUtil-CN9OoRaT.js → HelpersUtil-Dn9aiv4g.js} +1 -1
  12. package/assets/{ImportListings-CCQDdZMF.js → ImportListings-BALL6CWe.js} +1 -1
  13. package/assets/{ItemDetail-C6EEFa3M.js → ItemDetail-B_zPbtC5.js} +2 -2
  14. package/assets/{LoadMore-QYabEF53.js → LoadMore-DUwOaKdq.js} +1 -1
  15. package/assets/{MarketCheckout-B1QbAQBC.js → MarketCheckout-DkLDRrfN.js} +3 -3
  16. package/assets/{MyAssets-gjvqMgx3.js → MyAssets-CTQx_QVe.js} +1 -1
  17. package/assets/{MyFavorites-CCbFgdqL.js → MyFavorites-DWHAFj8B.js} +1 -1
  18. package/assets/{MyPurchases-D04-_M8f.js → MyPurchases-BVQzJeQX.js} +1 -1
  19. package/assets/{NotFound-ViHzr3Nr.js → NotFound-CHQS62la.js} +1 -1
  20. package/assets/{PrimaryListModal-D6DU8-ZC.js → PrimaryListModal-gfgyzr3S.js} +1 -1
  21. package/assets/{StoreSettings-BnHjda9z.js → StoreSettings-CRxzmt3b.js} +5 -5
  22. package/assets/{Success-CbfD54bz.js → Success-cIWboc7p.js} +1 -1
  23. package/assets/{SwapController-Tfj7j5wZ.js → SwapController-DjGJvhyC.js} +1 -1
  24. package/assets/{TradeService-kxdTGO_i.js → TradeService-3mwR2v1C.js} +1 -1
  25. package/assets/{W3MFrameProviderSingleton-BWjqHbac.js → W3MFrameProviderSingleton-CH9k7C8I.js} +3 -3
  26. package/assets/{WebCryptoP256-8HU24K3x.js → WebCryptoP256-Lp5-qWkz.js} +1 -1
  27. package/assets/{basic-DX-B5_bS.js → basic-g_xHs-jl.js} +1 -1
  28. package/assets/{biconomy-DIiiyQwz.js → biconomy-wuZgdDji.js} +1 -1
  29. package/assets/{buy-C5_gzZWJ.js → buy-CgIgEqv9.js} +1 -1
  30. package/assets/{buy-gasless-Cxx1jwuH.js → buy-gasless-pwHqA_mF.js} +1 -1
  31. package/assets/{cart-checkout-C3WNM4cy.js → cart-checkout-vzYBjbSV.js} +1 -1
  32. package/assets/{categories-DQ55lr2p.js → categories-D5VGMfW4.js} +1 -1
  33. package/assets/{ccip-BafcYzQ9.js → ccip-B9Wl4rCZ.js} +1 -1
  34. package/assets/{ccip-CYEnvd4I.js → ccip-DugdnJIL.js} +1 -1
  35. package/assets/collection-7YyqOIsA.js +1 -0
  36. package/assets/{controller-B80HcZCL.js → controller-BIXF8m7m.js} +2 -2
  37. package/assets/{core-BtRDOtev.js → core-CPMlxlfe.js} +4 -4
  38. package/assets/{custom-DiiPEfeO.js → custom-C8eYncem.js} +1 -1
  39. package/assets/{data-capture-BFGedRFL.js → data-capture-BT3tUeZ2.js} +1 -1
  40. package/assets/{decimals-Cdn10TAV.js → decimals-2cHWSu_l.js} +1 -1
  41. package/assets/{decimals-DCazhsdS.js → decimals-C-EZF79s.js} +1 -1
  42. package/assets/{detectExtension-BSAkQ0I6.js → detectExtension-C-xKGK-n.js} +1 -1
  43. package/assets/{email-D8YhsjSC.js → email-DCkZGiuY.js} +1 -1
  44. package/assets/{embedded-wallet-CIVu6rdk.js → embedded-wallet-BwjbVQqZ.js} +1 -1
  45. package/assets/{emotion-styled.browser.esm-ClqtCiJQ.js → emotion-styled.browser.esm-CM5xiqPE.js} +1 -1
  46. package/assets/{engine-DsQHyohE.js → engine-BCIagDLK.js} +1 -1
  47. package/assets/{errors-BLIsDEoc.js → errors-BVwqXLe5.js} +1 -1
  48. package/assets/{estimate-l1-fee-Cna0j8C0.js → estimate-l1-fee-kxkgQ66r.js} +1 -1
  49. package/assets/{eth_estimateGas-A7dV8Dq8.js → eth_estimateGas-rl3D263K.js} +1 -1
  50. package/assets/{eth_getStorageAt-DVqXAuzZ.js → eth_getStorageAt-IB0eULMI.js} +1 -1
  51. package/assets/{eth_getTransactionCount-DLrwUt6V.js → eth_getTransactionCount-CtQzPcnF.js} +1 -1
  52. package/assets/{extractIPFS-Dq1wghef.js → extractIPFS-Cpl91fgz.js} +1 -1
  53. package/assets/{features-CFz8G3yF.js → features-BlHQSMzN.js} +1 -1
  54. package/assets/{fetchTokenMetadata-BTRazXId.js → fetchTokenMetadata-DJ4cCYA_.js} +2 -2
  55. package/assets/{get-ecosystem-wallet-info-B8H2bbhI.js → get-ecosystem-wallet-info-DwdeAhbV.js} +1 -1
  56. package/assets/{getBalance-BewKvJ6T.js → getBalance-DkBROkHj.js} +1 -1
  57. package/assets/{getInstalledModules-ByFUGStC.js → getInstalledModules-BfypScWD.js} +1 -1
  58. package/assets/{getNFT-BuDjU8-b.js → getNFT-Cv97lepQ.js} +2 -2
  59. package/assets/{getNFT-1nUsfQAJ.js → getNFT-DmshVHQV.js} +1 -1
  60. package/assets/{getOverlayAlpha-B_CoLTSj.js → getOverlayAlpha-mkhFONg0.js} +1 -1
  61. package/assets/{hashTypedData-BYNsvxyc.js → hashTypedData-6sx2OuME.js} +1 -1
  62. package/assets/{hashTypedData-DHR5yJit.js → hashTypedData-C9IqLTPk.js} +1 -1
  63. package/assets/{import-CWsWpkUA.js → import-Bsky-xMs.js} +1 -1
  64. package/assets/{in-app-wallet-calls-Fj_OJpWi.js → in-app-wallet-calls-s_cSY41h.js} +1 -1
  65. package/assets/{index-BCGZozX2.js → index-B0YrK5ZH.js} +1 -1
  66. package/assets/{index-C_jKIil3.js → index-BB1no6U7.js} +1 -1
  67. package/assets/{index-CN5ZLDnc.js → index-BDohxhb7.js} +1 -1
  68. package/assets/{index-Y6b_vUQr.js → index-BLPhH8eL.js} +1 -1
  69. package/assets/{index-DkfyzgR8.js → index-BU56N61z.js} +1 -1
  70. package/assets/{index-FUu8bz4c.js → index-BV1TWYA2.js} +1 -1
  71. package/assets/{index-Cuf2In7m.js → index-Bn_065d4.js} +1 -1
  72. package/assets/{index-B4p2eLga.js → index-BoxWf2CA.js} +1 -1
  73. package/assets/{index-DJsdR_Dh.js → index-BwU057Dz.js} +1 -1
  74. package/assets/{index-B04ndUbB.js → index-BwqmHtXi.js} +2 -2
  75. package/assets/{index-BSjx8-a9.js → index-BxhrtCIn.js} +1 -1
  76. package/assets/{index-DfnBxBKK.js → index-C-0iOuYu.js} +1 -1
  77. package/assets/{index-CzDOjIXr.js → index-C-sj52rG.js} +1 -1
  78. package/assets/{index-Da6whmyR.js → index-C1J9hW3D.js} +1 -1
  79. package/assets/{index-Cv6TsksD.js → index-CGUO0Y4Y.js} +1 -1
  80. package/assets/{index-CcJuo_B4.js → index-CG_iwpLC.js} +1 -1
  81. package/assets/{index-BufR0bxC.js → index-CHEQB_Cx.js} +1 -1
  82. package/assets/{index-B4OkjZ5Z.js → index-CPaULSDF.js} +3 -3
  83. package/assets/{index-C7VPGrdO.js → index-CTWPqZAC.js} +1 -1
  84. package/assets/{index-Do7lLz-O.js → index-CTwvZCoF.js} +1 -1
  85. package/assets/{index-mfpj9mGL.js → index-CYcVlGMR.js} +1 -1
  86. package/assets/{index-Cr7q_wI-.js → index-CjzqNOFR.js} +1 -1
  87. package/assets/{index-BQwZ_U1w.js → index-Co5hU_e6.js} +1 -1
  88. package/assets/{index-tKIgdudq.js → index-CrdpO7C8.js} +1 -1
  89. package/assets/{index-PGZV0u8x.js → index-CsD_onu6.js} +1 -1
  90. package/assets/{index-CtzfdSwK.js → index-CxFzTyPL.js} +1 -1
  91. package/assets/{index-BBuZMaWr.js → index-CxiM65Mp.js} +10 -10
  92. package/assets/{index-Cmi7sq59.js → index-DEyKdf7n.js} +1 -1
  93. package/assets/{index-BMFRmVon.js → index-DHmaSZRj.js} +1 -1
  94. package/assets/{index-CXYokVDz.js → index-DVePmEob.js} +1 -1
  95. package/assets/{index--JSSHFMQ.js → index-DaAuLTDJ.js} +1 -1
  96. package/assets/{index-BDfpUFpd.js → index-DcTQA0a2.js} +1 -1
  97. package/assets/{index-fOZ3JG1l.js → index-DcsTTH3Q.js} +1 -1
  98. package/assets/{index-gvpjFbR1.js → index-DdkbGf7r.js} +1 -1
  99. package/assets/{index-CaHcCfyv.js → index-DdxPPzlC.js} +1 -1
  100. package/assets/{index-CTwiT5J0.js → index-DgiZIEtb.js} +1 -1
  101. package/assets/{index-CWuMb79R.js → index-DiC-MoGd.js} +3 -3
  102. package/assets/{index-nRbKhfJe.js → index-DkJQfwjP.js} +2 -2
  103. package/assets/{index-CwWLPHI8.js → index-DmHTXw6k.js} +1 -1
  104. package/assets/{index-B3vzzuVP.js → index-DmTT-8Pb.js} +1 -1
  105. package/assets/{index-BtmcJRGy.js → index-Dv5PeJiX.js} +1 -1
  106. package/assets/{index-BDRB8FDm.js → index-I6QJl4JU.js} +1 -1
  107. package/assets/{index-goSkKmOv.js → index-LP7qradW.js} +1 -1
  108. package/assets/{index-Dhu9IXc1.js → index-S-phlU07.js} +1 -1
  109. package/assets/{index-BmxotHif.js → index-dYKVGrG9.js} +1 -1
  110. package/assets/{index-Cuq6iGY1.js → index-dysXdEH6.js} +1 -1
  111. package/assets/{index-g3sxw2b2.js → index-ntwLOBCc.js} +2 -2
  112. package/assets/{index-CdfmzGmf.js → index-pgEJuCvY.js} +1 -1
  113. package/assets/{index-BuMOiAUw.js → index-t2OgUZgI.js} +1 -1
  114. package/assets/{index-07n_zhYq.js → index-xIavEcfj.js} +1 -1
  115. package/assets/{index-2yTqM9xZ.js → index-yfYb8KLO.js} +1 -1
  116. package/assets/{index.es-Dvmu0NoU.js → index.es-DaC3JFFU.js} +4 -4
  117. package/assets/{index.es-CiHN99GO.js → index.es-KR7fFIjl.js} +1 -1
  118. package/assets/{index.es-BsTkmkjS.js → index.es-_UBQCq8d.js} +1 -1
  119. package/assets/{loader-logo-CK-TcJ-S.js → loader-logo-CmjwjqNs.js} +1 -1
  120. package/assets/{localBatchGatewayRequest-Cej95COc.js → localBatchGatewayRequest-p2Ks9d9x.js} +1 -1
  121. package/assets/{mana-rate-Disk-ReT.js → mana-rate-BSdhcAxH.js} +1 -1
  122. package/assets/{networks-Dapm2cWP.js → networks-DeWfvl_y.js} +1 -1
  123. package/assets/{onramp-DLQLHSLI.js → onramp-DRTE3n_-.js} +1 -1
  124. package/assets/{openzeppelin-B2ua0Itn.js → openzeppelin-CnjCMhne.js} +1 -1
  125. package/assets/{ownerOf-DOppg2jR.js → ownerOf-LGp4E5X6.js} +1 -1
  126. package/assets/{parseNft-D_8M9mfO.js → parseNft-ZibRZ1De.js} +2 -2
  127. package/assets/{parseSignature-O3FZfUUc.js → parseSignature-BVSxuf_G.js} +1 -1
  128. package/assets/{parseSignature-BUx9b-zW.js → parseSignature-qW8HDWC-.js} +3 -3
  129. package/assets/{pay-with-exchange-DaiVhZAg.js → pay-with-exchange-D01MHjgZ.js} +1 -1
  130. package/assets/{qr-overlay-CGmkZvV0.js → qr-overlay-BYvxaKdb.js} +1 -1
  131. package/assets/{receive-DVL3YCyE.js → receive-CqdylKzQ.js} +1 -1
  132. package/assets/{resolveImplementation-06H3horI.js → resolveImplementation-6K4nQmoD.js} +1 -1
  133. package/assets/{rpc-q1fg-PaK.js → rpc-CFw65GwW.js} +1 -1
  134. package/assets/{secp256k1-Dj-unqH_.js → secp256k1-Bn6bifwd.js} +1 -1
  135. package/assets/{secp256k1-DT5nTJQH.js → secp256k1-DHZdqghI.js} +1 -1
  136. package/assets/{secp256k1-D6rN1PGV.js → secp256k1-_DgqGs2V.js} +1 -1
  137. package/assets/{send-CjhoocaG.js → send-XfLoBs9R.js} +1 -1
  138. package/assets/{send-batch-transaction-Bbiva6rb.js → send-batch-transaction-BXPWrXSK.js} +1 -1
  139. package/assets/{send-eip712-transaction-NxK7USDp.js → send-eip712-transaction-4z6WNabr.js} +2 -2
  140. package/assets/{send-gasless-transaction-x5mofsoE.js → send-gasless-transaction-BcnQyjxj.js} +2 -2
  141. package/assets/{sendRawTransaction-CxX-WJOv.js → sendRawTransaction-GKBmcmEE.js} +3 -3
  142. package/assets/{serializeTransaction-KtBgxNjB.js → serializeTransaction-3d8pZ0Iy.js} +1 -1
  143. package/assets/{session-proposal-KoaDAo-a.js → session-proposal-B5ZHcD2T.js} +1 -1
  144. package/assets/{session-request-CSef7ndM.js → session-request-CAaoIKVS.js} +2 -2
  145. package/assets/{sha256-DkPvB4om.js → sha256-Dj7svQcS.js} +1 -1
  146. package/assets/{signing-B9F_g0GG.js → signing-CE_zI5_x.js} +4 -4
  147. package/assets/{socials-BqxUUXtR.js → socials-5v3xVdXT.js} +1 -1
  148. package/assets/{swaps-EDZta6zk.js → swaps-8AiJfIFs.js} +1 -1
  149. package/assets/{thirdweb-D99mQjH-.js → thirdweb-RN8sw7m_.js} +3 -3
  150. package/assets/{totalSupply-BhpAtMjH.js → totalSupply-CokjmPid.js} +1 -1
  151. package/assets/{trade-encoding-CWytSFjw.js → trade-encoding-D-nmkwVz.js} +1 -1
  152. package/assets/{transactionReceipt-OilL7-NS.js → transactionReceipt-CXYiDrev.js} +1 -1
  153. package/assets/{transactions-CGvL3Aj1.js → transactions-DtyT5OjZ.js} +1 -1
  154. package/assets/useInfiniteGrid-DMPijgdc.js +1 -0
  155. package/assets/{useStore-CQIJvFZA.js → useStore-B_g31vF6.js} +1 -1
  156. package/assets/{useTheme-6tr3eE7K.js → useTheme-BNMMOZXE.js} +1 -1
  157. package/assets/useTheme-Dym7bhKm.js +1 -0
  158. package/assets/{verifyHash-2hJaw2xF.js → verifyHash-Bm1x5_X2.js} +1 -1
  159. package/assets/{w3m-modal-DZpfNka8.js → w3m-modal-CvxdzPI1.js} +1 -1
  160. package/assets/{w3m-modal-CXTIrAhw.js → w3m-modal-DASeu1UW.js} +1 -1
  161. package/assets/{wait-for-tx-receipt-Dt-8wYDQ.js → wait-for-tx-receipt-B0NrXGCa.js} +1 -1
  162. package/assets/{wallets-v6YyPYY8.js → wallets-DOy020MN.js} +6 -6
  163. package/assets/{web-connector-DBKfHuJF.js → web-connector-BDLq1v7V.js} +3 -3
  164. package/assets/{writeContract-CJkUo9D7.js → writeContract-CvT6Z86X.js} +1 -1
  165. package/assets/{zoraTestnet-CRD_79WO.js → zoraTestnet-hCARxX58.js} +1 -1
  166. package/index.html +11 -11
  167. package/package.json +2 -2
  168. package/assets/collection-DHOETntw.js +0 -1
  169. package/assets/useInfiniteGrid-CpiD11c4.js +0 -1
  170. package/assets/useTheme-Dpdkvivv.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-C51i12iP.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29869835587.commit-e6e6578/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29869835587.commit-e6e6578/assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-C51i12iP.js";const w="https://cdn.decentraland.org/@dcl/shop/0.1.0-29905759067.commit-1f1fc48/assets/custom-welcome-background-BxlFQma9.webp",S="https://cdn.decentraland.org/@dcl/shop/0.1.0-29905759067.commit-1f1fc48/assets/DCL_LogoPattern-BryBPc3d.png",U=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -1,4 +1,4 @@
1
- import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I as W,t as n,ab as ge,h as J,n as Ce,u as Re,o as ne,A as ee,ac as Ne,ad as _e}from"./index-BBuZMaWr.js";import{m as Pe}from"./mana-rate-Disk-ReT.js";import{T as Fe,u as Ie,M as Te}from"./MarketCheckout-B1QbAQBC.js";import{R as te,C as ze,a as Ae,b as Ee,S as re,F as Le,c as ae,d as Me}from"./categories-DQ55lr2p.js";import{n as S}from"./emotion-CSxEP8yM.js";import{L as Oe}from"./LoadMore-QYabEF53.js";import{u as We}from"./useInfiniteGrid-CpiD11c4.js";import{E as qe}from"./ErrorNotice-C7soUjRV.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./buy-C5_gzZWJ.js";import"./trade-encoding-CWytSFjw.js";import"./buy-gasless-Cxx1jwuH.js";import"./errors-BLIsDEoc.js";const He=i.div`
1
+ import{r as c,j as e,b as Pe}from"./react-C51i12iP.js";import{s as i,a2 as t,I as W,t as r,as as be,h as J,n as _e,u as Ie,o as ae,A as ee,at as Fe,au as Te}from"./index-CxiM65Mp.js";import{m as ze}from"./mana-rate-BSdhcAxH.js";import{T as Ae,u as Ee,M as Me}from"./MarketCheckout-DkLDRrfN.js";import{R as ie,C as Le,a as Oe,b as We,S as le,F as qe,c as ce,d as He}from"./categories-D5VGMfW4.js";import{n as j}from"./emotion-CSxEP8yM.js";import{L as Be}from"./LoadMore-DUwOaKdq.js";import{u as De}from"./useInfiniteGrid-DMPijgdc.js";import{E as Ye}from"./ErrorNotice-C7soUjRV.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./index-HN6Rk25C.js";import"./buy-CgIgEqv9.js";import"./trade-encoding-D-nmkwVz.js";import"./buy-gasless-pwHqA_mF.js";import"./errors-BVwqXLe5.js";const Ge=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -7,11 +7,11 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
7
7
  height: 1px;
8
8
  background: ${t.colors.media};
9
9
  width: 100%;
10
- `,Be=i.div`
10
+ `,Ke=i.div`
11
11
  display: flex;
12
12
  flex-direction: column;
13
13
  width: 100%;
14
- `,De=i("button",S("desktopStatic"))`
14
+ `,Ue=i("button",j("desktopStatic"))`
15
15
  display: flex;
16
16
  align-items: center;
17
17
  justify-content: space-between;
@@ -44,7 +44,7 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
44
44
  cursor: default;
45
45
  &:hover { background: transparent; }
46
46
  }`:""}
47
- `,Ye=i.span`
47
+ `,Qe=i.span`
48
48
  font-family: ${t.font.sans};
49
49
  font-weight: 600;
50
50
  font-size: 14px;
@@ -54,12 +54,12 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
54
54
  ${t.media.down("lg")} {
55
55
  font-size: 16px;
56
56
  }
57
- `,Ue=i.span`
57
+ `,Je=i.span`
58
58
  display: inline-flex;
59
59
  ${t.media.up("lg")} {
60
60
  display: none;
61
61
  }
62
- `,Ge=i("p",S("desktopHidden"))`
62
+ `,Ve=i("p",j("desktopHidden"))`
63
63
  margin: 0;
64
64
  padding: 0 4px 4px;
65
65
  font-family: ${t.font.sans};
@@ -70,7 +70,7 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
70
70
  text-transform: capitalize;
71
71
 
72
72
  ${({desktopHidden:o})=>o?`${t.media.up("lg")} { display: none; }`:""}
73
- `,Ke=i("div",S("open","desktopStatic"))`
73
+ `,Xe=i("div",j("open","desktopStatic"))`
74
74
  display: grid;
75
75
  grid-template-rows: ${({open:o})=>o?"1fr":"0fr"};
76
76
  transition: grid-template-rows 0.22s ease;
@@ -80,27 +80,27 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
80
80
  @media (prefers-reduced-motion: reduce) {
81
81
  transition: none;
82
82
  }
83
- `,Qe=i.div`
83
+ `,Ze=i.div`
84
84
  overflow: hidden;
85
85
  min-height: 0;
86
- `,Je=i.div`
86
+ `,et=i.div`
87
87
  display: flex;
88
88
  align-items: flex-end;
89
89
  justify-content: center;
90
90
  gap: 6px;
91
91
  padding: 8px 4px 0;
92
- `,le=i.label`
92
+ `,de=i.label`
93
93
  display: flex;
94
94
  flex: 1;
95
95
  min-width: 0;
96
96
  flex-direction: column;
97
97
  gap: 4px;
98
- `,ce=i.span`
98
+ `,pe=i.span`
99
99
  font-family: ${t.font.sans};
100
100
  font-weight: 400;
101
101
  font-size: 12px;
102
102
  color: ${t.colors.muted};
103
- `,de=i.span`
103
+ `,xe=i.span`
104
104
  display: flex;
105
105
  align-items: center;
106
106
  gap: 4px;
@@ -113,11 +113,11 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
113
113
  &:focus-within {
114
114
  border-color: ${t.rarities.epic};
115
115
  }
116
- `,pe=i(W)`
116
+ `,ue=i(W)`
117
117
  width: 16px;
118
118
  height: 16px;
119
119
  color: ${t.colors.rarity};
120
- `,xe=i.input`
120
+ `,he=i.input`
121
121
  width: 100%;
122
122
  min-width: 0;
123
123
  border: 0;
@@ -135,16 +135,16 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
135
135
  -webkit-appearance: none;
136
136
  margin: 0;
137
137
  }
138
- `,Ve=i.span`
138
+ `,tt=i.span`
139
139
  padding-bottom: 12px;
140
140
  color: ${t.colors.text};
141
141
  font-family: ${t.font.sans};
142
142
  font-size: 13px;
143
- `,Xe=i.div`
143
+ `,ot=i.div`
144
144
  position: relative;
145
145
  height: 20px;
146
146
  margin: 24px 4px 0;
147
- `,Ze=i.div`
147
+ `,it=i.div`
148
148
  position: absolute;
149
149
  top: 50%;
150
150
  left: 0;
@@ -153,7 +153,7 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
153
153
  transform: translateY(-50%);
154
154
  background: ${t.colors.media};
155
155
  border-radius: 2px;
156
- `,et=i("div",S("minPct","maxPct"))`
156
+ `,st=i("div",j("minPct","maxPct"))`
157
157
  position: absolute;
158
158
  top: 50%;
159
159
  height: 2px;
@@ -162,7 +162,7 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
162
162
  right: ${({maxPct:o})=>`${100-o}%`};
163
163
  background: ${t.colors.rarity};
164
164
  border-radius: 2px;
165
- `,ue=i.input`
165
+ `,me=i.input`
166
166
  position: absolute;
167
167
  top: 0;
168
168
  left: 0;
@@ -196,23 +196,23 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
196
196
  box-shadow: 0 1px 3px rgba(22, 21, 24, 0.25);
197
197
  cursor: pointer;
198
198
  }
199
- `,tt=i.div`
199
+ `,nt=i.div`
200
200
  display: flex;
201
201
  align-items: center;
202
202
  justify-content: space-between;
203
203
  padding: 12px 4px 0;
204
- `,he=i.span`
204
+ `,fe=i.span`
205
205
  display: inline-flex;
206
206
  align-items: center;
207
207
  gap: 2px;
208
208
  font-family: ${t.font.sans};
209
209
  font-size: 13px;
210
210
  color: ${t.colors.text};
211
- `,me=i(W)`
211
+ `,ge=i(W)`
212
212
  width: 16px;
213
213
  height: 16px;
214
214
  color: ${t.colors.text};
215
- `,ot=i.div`
215
+ `,rt=i.div`
216
216
  display: flex;
217
217
  flex-wrap: wrap;
218
218
  gap: 12px;
@@ -221,7 +221,7 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
221
221
  ${t.media.down("lg")} {
222
222
  gap: 12px 16px;
223
223
  }
224
- `,it=i("button",S("selected"))`
224
+ `,at=i("button",j("selected"))`
225
225
  display: inline-flex;
226
226
  align-items: center;
227
227
  gap: 4px;
@@ -238,20 +238,20 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
238
238
  outline: 2px solid ${t.colors.accent};
239
239
  outline-offset: 2px;
240
240
  }
241
- `,st=i("span",S("color"))`
241
+ `,lt=i("span",j("color"))`
242
242
  position: relative;
243
243
  width: 16px;
244
244
  height: 16px;
245
245
  border-radius: 4px;
246
246
  background: ${({color:o})=>o};
247
247
  flex: none;
248
- `,nt=i(W)`
248
+ `,ct=i(W)`
249
249
  position: absolute;
250
250
  inset: 0;
251
251
  width: 16px;
252
252
  height: 16px;
253
253
  color: ${t.colors.white};
254
- `,rt=i("span",S("selected"))`
254
+ `,dt=i("span",j("selected"))`
255
255
  font-family: ${t.font.sans};
256
256
  font-weight: ${({selected:o})=>o?600:400};
257
257
  font-size: 12px;
@@ -262,27 +262,27 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
262
262
  ${t.media.down("lg")} {
263
263
  font-size: 14px;
264
264
  }
265
- `,at=i.label`
265
+ `,pt=i.label`
266
266
  display: flex;
267
267
  align-items: center;
268
268
  gap: 8px;
269
269
  height: 40px;
270
270
  padding: 4px 4px 4px 24px;
271
271
  cursor: pointer;
272
- `,lt=i.input`
272
+ `,xt=i.input`
273
273
  width: 18px;
274
274
  height: 18px;
275
275
  margin: 0;
276
276
  accent-color: ${t.colors.accent};
277
277
  cursor: pointer;
278
278
  flex: none;
279
- `,ct=i.span`
279
+ `,ut=i.span`
280
280
  font-family: ${t.font.sans};
281
281
  font-weight: 400;
282
282
  font-size: 14px;
283
283
  line-height: 1.43;
284
284
  color: ${t.colors.gray0};
285
- `,dt=i.div`
285
+ `,ht=i.div`
286
286
  display: flex;
287
287
  align-items: center;
288
288
  justify-content: space-between;
@@ -296,11 +296,11 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
296
296
  ${t.media.down("lg")} {
297
297
  height: 52px;
298
298
  }
299
- `,pt=i.div`
299
+ `,mt=i.div`
300
300
  display: flex;
301
301
  align-items: center;
302
302
  gap: 6px;
303
- `,xt=i(W)`
303
+ `,ft=i(W)`
304
304
  width: 14px;
305
305
  height: 14px;
306
306
  color: ${t.colors.text};
@@ -309,7 +309,7 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
309
309
  width: 16px;
310
310
  height: 16px;
311
311
  }
312
- `,ut=i.span`
312
+ `,gt=i.span`
313
313
  font-family: ${t.font.sans};
314
314
  font-weight: 600;
315
315
  font-size: 14px;
@@ -322,11 +322,11 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
322
322
  ${t.media.down("lg")} {
323
323
  font-size: 16px;
324
324
  }
325
- `,ht=i(W)`
325
+ `,bt=i(W)`
326
326
  width: 12px;
327
327
  height: 12px;
328
328
  color: ${t.colors.muted2};
329
- `,mt=i("button",S("on"))`
329
+ `,yt=i("button",j("on"))`
330
330
  position: relative;
331
331
  width: 24px;
332
332
  height: 14px;
@@ -350,7 +350,7 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
350
350
  width: 40px;
351
351
  height: 22px;
352
352
  }
353
- `,ft=i("span",S("on"))`
353
+ `,wt=i("span",j("on"))`
354
354
  position: absolute;
355
355
  top: 50%;
356
356
  left: ${({on:o})=>o?"calc(100% - 12px)":"0px"};
@@ -367,7 +367,7 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
367
367
  height: 18px;
368
368
  left: ${({on:o})=>o?"calc(100% - 18px)":"2px"};
369
369
  }
370
- `,k=1e5;function gt(o){var a;for(const C of Ae){const h=(a=C.subs)==null?void 0:a.find(l=>l.key===o);if(h)return n(h.labelKey)}return o}function X({title:o,open:a,onToggle:C,summary:h,desktopStatic:l,headerTestId:m,headerAria:u,children:j}){const d=e.jsx(Ee,{up:a,size:24,color:"var(--text)"});return e.jsxs(Be,{children:[e.jsxs(De,{type:"button",desktopStatic:l,onClick:C,"aria-expanded":a,"aria-label":u,"data-testid":m,children:[e.jsx(Ye,{children:o}),l?e.jsx(Ue,{children:d}):d]}),!a&&h?e.jsx(Ge,{desktopHidden:l,children:h}):null,e.jsx(Ke,{open:a,desktopStatic:l,children:e.jsx(Qe,{children:j})})]})}function bt({category:o,subCategory:a,onCategory:C,onSub:h,priceMin:l,priceMax:m,onPriceMin:u,onPriceMax:j,rarities:d,onToggleRarity:q,status:v,onStatus:z,smart:b,onSmart:A}){const[f,E]=c.useState(!0),[y,L]=c.useState(!0),[R,Z]=c.useState(!1),[F,N]=c.useState(!0),I=l&&!Number.isNaN(Number(l))?Number(l):void 0,_=m&&!Number.isNaN(Number(m))?Number(m):void 0,w=I!=null?Math.min(I,k):0,g=_!=null?Math.min(_,k):k,P=w/k*100,H=g/k*100;function B(r){const p=Math.min(r,g);u(p<=0?"":String(p))}function D(r){const p=Math.max(r,w);j(p>=k?"":String(p))}const Y=a?gt(a):o!=="wearable"?n(`categories.${o==="emote"?"emotes":o==="all"?"shopAll":o}`):"",T=I!=null||_!=null?`${l||"0"}-${m||"∞"}`:"",U=te.filter(r=>d.includes(r)).map(ge).join(", "),$=v==="on_sale"?n("filter.onSale"):v==="not_for_sale"?n("filter.notForSale"):"";return e.jsxs(He,{children:[e.jsx(X,{title:n("assets.category"),open:f,onToggle:()=>E(r=>!r),summary:Y,desktopStatic:!0,children:e.jsx(ze,{category:o,subCategory:a,onCategory:C,onSub:h})}),e.jsx(V,{}),e.jsxs(X,{title:n("filter.price"),open:y,onToggle:()=>L(r=>!r),summary:T,desktopStatic:!0,children:[e.jsxs(Je,{children:[e.jsxs(le,{children:[e.jsx(ce,{children:n("assets.min")}),e.jsxs(de,{children:[e.jsx(pe,{name:J.iconName,"aria-hidden":!0}),e.jsx(xe,{type:"number",min:"0","aria-label":n("assets.minPriceAria"),placeholder:"0",value:l,onChange:r=>u(r.target.value)})]})]}),e.jsx(Ve,{children:n("assets.priceTo")}),e.jsxs(le,{children:[e.jsx(ce,{children:n("assets.max")}),e.jsxs(de,{children:[e.jsx(pe,{name:J.iconName,"aria-hidden":!0}),e.jsx(xe,{type:"number",min:"0","aria-label":n("assets.maxPriceAria"),placeholder:"0",value:m,onChange:r=>j(r.target.value)})]})]})]}),e.jsxs(Xe,{children:[e.jsx(Ze,{"aria-hidden":!0}),e.jsx(et,{minPct:P,maxPct:H,"aria-hidden":!0}),e.jsx(ue,{type:"range",min:0,max:k,value:w,"aria-label":n("assets.minPriceSliderAria"),onChange:r=>B(Number(r.target.value))}),e.jsx(ue,{type:"range",min:0,max:k,value:g,"aria-label":n("assets.maxPriceSliderAria"),onChange:r=>D(Number(r.target.value))})]}),e.jsxs(tt,{children:[e.jsxs(he,{children:[e.jsx(me,{name:J.iconName,"aria-hidden":!0}),w.toLocaleString()]}),e.jsxs(he,{children:[e.jsx(me,{name:J.iconName,"aria-hidden":!0}),g.toLocaleString()]})]})]}),e.jsx(V,{}),e.jsx(X,{title:n("assets.rarity"),open:R,onToggle:()=>Z(r=>!r),summary:U,headerTestId:"sidebar-section-toggle",children:e.jsx(ot,{"data-testid":"rarity-filter",children:te.map(r=>{const p=d.includes(r);return e.jsxs(it,{type:"button",selected:p,"aria-pressed":p,onClick:()=>q(r),"data-testid":"rarity-filter-check",children:[e.jsx(st,{color:t.rarities[r],children:p?e.jsx(nt,{name:"check","aria-hidden":!0}):null}),e.jsx(rt,{selected:p,children:r})]},r)})})}),e.jsx(V,{}),e.jsx(X,{title:n("filter.status"),open:F,onToggle:()=>N(r=>!r),summary:$,children:[["all",n("filter.statusAll")],["on_sale",n("filter.onSale")],["not_for_sale",n("filter.notForSale")]].map(([r,p])=>e.jsxs(at,{children:[e.jsx(lt,{type:"radio",name:"shop-status",checked:v===r,onChange:()=>z(r)}),e.jsx(ct,{children:p})]},r))}),e.jsx(V,{}),e.jsxs(dt,{children:[e.jsxs(pt,{children:[e.jsx(xt,{name:"smart","aria-hidden":!0}),e.jsx(ut,{children:n("filter.smart")}),e.jsx(Fe,{content:n("filter.smartHint"),placement:"bottom",children:e.jsx(ht,{name:"info",role:"img","aria-label":n("filter.smartHint"),tabIndex:0})})]}),e.jsx(mt,{type:"button",role:"switch",on:b,"aria-checked":b,"aria-label":n("filter.smart"),onClick:()=>A(!b),children:e.jsx(ft,{on:b})})]})]})}const yt=i.div`
370
+ `,C=1e5;function $t(o){var a;for(const y of Oe){const h=(a=y.subs)==null?void 0:a.find(l=>l.key===o);if(h)return r(h.labelKey)}return o}function X({title:o,open:a,onToggle:y,summary:h,desktopStatic:l,headerTestId:m,headerAria:u,children:v}){const d=e.jsx(We,{up:a,size:24,color:"var(--text)"});return e.jsxs(Ke,{children:[e.jsxs(Ue,{type:"button",desktopStatic:l,onClick:y,"aria-expanded":a,"aria-label":u,"data-testid":m,children:[e.jsx(Qe,{children:o}),l?e.jsx(Je,{children:d}):d]}),!a&&h?e.jsx(Ve,{desktopHidden:l,children:h}):null,e.jsx(Xe,{open:a,desktopStatic:l,children:e.jsx(Ze,{children:v})})]})}function St({category:o,subCategory:a,onCategory:y,onSub:h,priceMin:l,priceMax:m,onPriceMin:u,onPriceMax:v,rarities:d,onToggleRarity:q,status:k,onStatus:z,smart:w,onSmart:A}){const[f,E]=c.useState(!0),[$,M]=c.useState(!0),[R,Z]=c.useState(!1),[F,N]=c.useState(!0),T=l&&!Number.isNaN(Number(l))?Number(l):void 0,P=m&&!Number.isNaN(Number(m))?Number(m):void 0,S=T!=null?Math.min(T,C):0,g=P!=null?Math.min(P,C):C,_=S/C*100,H=g/C*100;function B(s){const p=Math.min(s,g);u(p<=0?"":String(p))}function D(s){const p=Math.max(s,S);v(p>=C?"":String(p))}const Y=a?$t(a):o!=="wearable"?r(`categories.${o==="emote"?"emotes":o==="all"?"shopAll":o}`):"",I=T!=null||P!=null?`${l||"0"}-${m||"∞"}`:"",G=ie.filter(s=>d.includes(s)).map(be).join(", "),b=k==="on_sale"?r("filter.onSale"):k==="not_for_sale"?r("filter.notForSale"):"";return e.jsxs(Ge,{children:[e.jsx(X,{title:r("assets.category"),open:f,onToggle:()=>E(s=>!s),summary:Y,desktopStatic:!0,children:e.jsx(Le,{category:o,subCategory:a,onCategory:y,onSub:h})}),e.jsx(V,{}),e.jsxs(X,{title:r("filter.price"),open:$,onToggle:()=>M(s=>!s),summary:I,desktopStatic:!0,children:[e.jsxs(et,{children:[e.jsxs(de,{children:[e.jsx(pe,{children:r("assets.min")}),e.jsxs(xe,{children:[e.jsx(ue,{name:J.iconName,"aria-hidden":!0}),e.jsx(he,{type:"number",min:"0","aria-label":r("assets.minPriceAria"),placeholder:"0",value:l,onChange:s=>u(s.target.value)})]})]}),e.jsx(tt,{children:r("assets.priceTo")}),e.jsxs(de,{children:[e.jsx(pe,{children:r("assets.max")}),e.jsxs(xe,{children:[e.jsx(ue,{name:J.iconName,"aria-hidden":!0}),e.jsx(he,{type:"number",min:"0","aria-label":r("assets.maxPriceAria"),placeholder:"0",value:m,onChange:s=>v(s.target.value)})]})]})]}),e.jsxs(ot,{children:[e.jsx(it,{"aria-hidden":!0}),e.jsx(st,{minPct:_,maxPct:H,"aria-hidden":!0}),e.jsx(me,{type:"range",min:0,max:C,value:S,"aria-label":r("assets.minPriceSliderAria"),onChange:s=>B(Number(s.target.value))}),e.jsx(me,{type:"range",min:0,max:C,value:g,"aria-label":r("assets.maxPriceSliderAria"),onChange:s=>D(Number(s.target.value))})]}),e.jsxs(nt,{children:[e.jsxs(fe,{children:[e.jsx(ge,{name:J.iconName,"aria-hidden":!0}),S.toLocaleString()]}),e.jsxs(fe,{children:[e.jsx(ge,{name:J.iconName,"aria-hidden":!0}),g.toLocaleString()]})]})]}),e.jsx(V,{}),e.jsx(X,{title:r("assets.rarity"),open:R,onToggle:()=>Z(s=>!s),summary:G,headerTestId:"sidebar-section-toggle",children:e.jsx(rt,{"data-testid":"rarity-filter",children:ie.map(s=>{const p=d.includes(s);return e.jsxs(at,{type:"button",selected:p,"aria-pressed":p,onClick:()=>q(s),"data-testid":"rarity-filter-check",children:[e.jsx(lt,{color:t.rarities[s],children:p?e.jsx(ct,{name:"check","aria-hidden":!0}):null}),e.jsx(dt,{selected:p,children:s})]},s)})})}),e.jsx(V,{}),e.jsx(X,{title:r("filter.status"),open:F,onToggle:()=>N(s=>!s),summary:b,children:[["all",r("filter.statusAll")],["on_sale",r("filter.onSale")],["not_for_sale",r("filter.notForSale")]].map(([s,p])=>e.jsxs(pt,{children:[e.jsx(xt,{type:"radio",name:"shop-status",checked:k===s,onChange:()=>z(s)}),e.jsx(ut,{children:p})]},s))}),e.jsx(V,{}),e.jsxs(ht,{children:[e.jsxs(mt,{children:[e.jsx(ft,{name:"smart","aria-hidden":!0}),e.jsx(gt,{children:r("filter.smart")}),e.jsx(Ae,{content:r("filter.smartHint"),placement:"bottom",children:e.jsx(bt,{name:"info",role:"img","aria-label":r("filter.smartHint"),tabIndex:0})})]}),e.jsx(yt,{type:"button",role:"switch",on:w,"aria-checked":w,"aria-label":r("filter.smart"),onClick:()=>A(!w),children:e.jsx(wt,{on:w})})]})]})}function te(o){const a=o.source??"item",y=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${a}:${y}`}const jt=i.div`
371
371
  position: relative;
372
372
  display: flex;
373
373
  gap: 32px;
@@ -376,14 +376,14 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
376
376
  ${t.media.down("lg")} {
377
377
  display: block;
378
378
  }
379
- `,wt=i.div`
379
+ `,vt=i.div`
380
380
  flex: 1;
381
381
  min-width: 0;
382
382
 
383
383
  ${t.media.down("lg")} {
384
384
  width: 100%;
385
385
  }
386
- `,$t=i.aside`
386
+ `,kt=i.aside`
387
387
  flex: none;
388
388
  width: 265px;
389
389
 
@@ -411,7 +411,7 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
411
411
  visibility: visible;
412
412
  }
413
413
  }
414
- `,St=i.div`
414
+ `,Ct=i.div`
415
415
  ${t.media.down("lg")} {
416
416
  flex: 1;
417
417
  min-height: 0;
@@ -419,12 +419,12 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
419
419
  /* Room so the last filter row clears the sticky "Show items" bar (Figma bottom bar). */
420
420
  padding-bottom: 24px;
421
421
  }
422
- `,jt=i.div`
422
+ `,Rt=i.div`
423
423
  position: fixed;
424
424
  inset: 0;
425
425
  z-index: 9998;
426
426
  background: rgba(0, 0, 0, 0.4);
427
- `,vt=i.div`
427
+ `,Nt=i.div`
428
428
  display: none;
429
429
 
430
430
  ${t.media.down("lg")} {
@@ -439,14 +439,14 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
439
439
  padding: 16px 16px 12px;
440
440
  border-radius: 16px 16px 0 0;
441
441
  }
442
- `,kt=i.span`
442
+ `,Pt=i.span`
443
443
  font-family: ${t.font.sans};
444
444
  font-weight: 700;
445
445
  font-size: 15px;
446
446
  letter-spacing: 0.46px;
447
447
  text-transform: uppercase;
448
448
  color: ${t.colors.text};
449
- `,Ct=i.button`
449
+ `,_t=i.button`
450
450
  display: grid;
451
451
  place-items: center;
452
452
  width: 32px;
@@ -463,7 +463,7 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
463
463
  outline: 2px solid ${t.colors.accent};
464
464
  outline-offset: 2px;
465
465
  }
466
- `,Rt=i.div`
466
+ `,It=i.div`
467
467
  display: none;
468
468
 
469
469
  ${t.media.down("lg")} {
@@ -478,7 +478,7 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
478
478
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
479
479
  z-index: 1;
480
480
  }
481
- `,Nt=i.button`
481
+ `,Ft=i.button`
482
482
  flex: 1;
483
483
  height: 40px;
484
484
  border: 0;
@@ -500,4 +500,4 @@ import{r as c,j as e,b as ke}from"./react-C51i12iP.js";import{s as i,a2 as t,I a
500
500
  outline: 2px solid ${t.colors.accent};
501
501
  outline-offset: 2px;
502
502
  }
503
- `,fe=48;function _t(o){return{tradeId:o.tradeId??o.id,listingType:"primary",contractAddress:o.contractAddress,itemId:o.itemId??"",name:o.name,thumbnail:o.thumbnail,rarity:o.rarity,category:o.category,wearableCategory:o.wearableCategory??null,creator:o.creator,manaWei:o.manaWei??"0",available:1,network:o.network,chainId:o.chainId,createdAt:0}}function Kt(){const[o]=ke(),a=(o.get("q")??"").trim().toLowerCase(),C=Ce(),h=(o.get("q")??"").trim();Re({title:h?n("seo.collectibles.searchTitle",{query:h}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const[l,m]=c.useState("wearable"),[u,j]=c.useState(null),[d,q]=c.useState([]),[v,z]=c.useState(""),[b,A]=c.useState(""),[f,E]=c.useState("on_sale"),[y,L]=c.useState(!1),[R,Z]=c.useState("newest"),[F,N]=c.useState(!1),[I,_]=c.useState(null);c.useEffect(()=>{if(!F)return;const s=O=>{O.key==="Escape"&&N(!1)};document.addEventListener("keydown",s);const x=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",s),document.body.style.overflow=x}},[F]);const w=f==="on_sale",g=v&&!Number.isNaN(Number(v))?Number(v):void 0,P=b&&!Number.isNaN(Number(b))?Number(b):void 0,H=u?Me[u]:void 0,B=(re.find(s=>s.key===R)??re[0]).server,D={category:l,rarities:d.length?d:void 0,wearableCategories:H,minPriceCredits:g,maxPriceCredits:P,search:a||void 0,sortBy:B,isSmart:y||void 0,onSale:!0},Y={category:l,rarities:d.length?d:void 0,wearableCategories:H,search:a||void 0,sortBy:B,isWearableSmart:y||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:T,total:U,isLoading:$,error:r,hasNextPage:p,isFetchingNextPage:oe,fetchNextPage:be}=We(w?["unified-listings",D]:["catalog-items",Y],s=>w?Ne({...D,first:fe,skip:s}):_e({...Y,first:fe,skip:s})),G=U,{data:K,isError:ye}=Ie(),we=s=>K&&s.manaWei?Pe(s.manaWei,K):null,ie=c.useRef(null);c.useEffect(()=>{$||!a||ie.current===a||(ie.current=a,ne("Shop Searched",{query:a,result_count:G}))},[a,$,G]);const Q=c.useRef("__init__");c.useEffect(()=>{if($)return;const s=JSON.stringify({category:l,subCategory:u,rarities:d,min:g,max:P,sort:R,status:f,smart:y});if(Q.current==="__init__"||Q.current===s){Q.current=s;return}Q.current=s,ne("Shop Applied Filter",{filters:{category:l,sub_category:u,rarities:d,min_price_credits:g??null,max_price_credits:P??null,status:f,smart:y,sort:R},result_count:G})},[l,u,d,g,P,R,f,y,$,G]);function $e(s){m(s),j(null)}function se(s){q(x=>x.includes(s)?x.filter(O=>O!==s):[...x,s])}function Se(){m("wearable"),j(null),q([]),z(""),A(""),E("on_sale"),L(!1)}function je(s){const x=T.find(O=>O.id===s.id);x&&x.source==="legacy"&&x.manaWei&&_(_t(x))}function ve(){C.invalidateQueries({queryKey:["unified-listings"]})}const M=[];(g!=null||P!=null)&&M.push({key:"price",label:n("filter.price"),onRemove:()=>{z(""),A("")}});for(const s of te)d.includes(s)&&M.push({key:`rarity-${s}`,label:ge(s),onRemove:()=>se(s)});return y&&M.push({key:"smart",label:n("filter.smart"),onRemove:()=>L(!1)}),f!=="on_sale"&&M.push({key:"status",label:f==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>E("on_sale")}),e.jsxs(yt,{"data-testid":"browse",children:[F?e.jsx(jt,{onClick:()=>N(!1),"aria-hidden":!0}):null,e.jsxs($t,{className:F?"is-open":"","data-testid":"browse-sidebar",children:[e.jsxs(vt,{children:[e.jsx(kt,{children:n("assets.filters")}),e.jsx(Ct,{onClick:()=>N(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(St,{children:e.jsx(bt,{category:l,subCategory:u,onCategory:$e,onSub:j,priceMin:v,priceMax:b,onPriceMin:z,onPriceMax:A,rarities:d,onToggleRarity:se,status:f,onStatus:E,smart:y,onSmart:L})}),e.jsx(Rt,{children:e.jsx(Nt,{type:"button",onClick:()=>N(!1),children:n("assets.showItems")})})]}),e.jsxs(wt,{children:[e.jsx(Le,{sort:R,onSort:Z,total:U,loading:$,query:a,onOpenFilters:()=>N(!0),chips:M,onClearChips:Se}),ye&&w&&T.some(s=>s.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:n("assets.marketUnavailable")}):null,r?e.jsx(qe,{message:n("assets.loadError"),testId:"browse-error"}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:$?e.jsx(ae,{count:15}):e.jsxs(e.Fragment,{children:[T.map(s=>{if(!w)return e.jsx(ee,{item:s,mode:"view"},s.id);const x=s;return x.source==="legacy"?e.jsx(ee,{item:x,mode:"market",marketPriceCredits:we(x),onBuyNow:je},s.id):e.jsx(ee,{item:s},s.id)}),oe?e.jsx(ae,{count:6}):null]})}),e.jsx(Oe,{hasNextPage:p,isFetching:oe,onLoadMore:()=>void be()}),!$&&T.length===0?e.jsx("p",{className:"muted",children:n("assets.noItems")}):null]}),I&&K?e.jsx(Te,{listing:I,rate:K,onClose:()=>_(null),onSold:()=>{_(null),ve()}}):null]})}export{Kt as Assets};
503
+ `,oe=48;function Tt(o){return{tradeId:o.tradeId??o.id,listingType:"primary",contractAddress:o.contractAddress,itemId:o.itemId??"",name:o.name,thumbnail:o.thumbnail,rarity:o.rarity,category:o.category,wearableCategory:o.wearableCategory??null,creator:o.creator,manaWei:o.manaWei??"0",available:1,network:o.network,chainId:o.chainId,createdAt:0}}function Xt(){const[o]=Pe(),a=(o.get("q")??"").trim().toLowerCase(),y=_e(),h=(o.get("q")??"").trim();Ie({title:h?r("seo.collectibles.searchTitle",{query:h}):r("seo.collectibles.title"),description:r("seo.collectibles.description")});const[l,m]=c.useState("wearable"),[u,v]=c.useState(null),[d,q]=c.useState([]),[k,z]=c.useState(""),[w,A]=c.useState(""),[f,E]=c.useState("on_sale"),[$,M]=c.useState(!1),[R,Z]=c.useState("newest"),[F,N]=c.useState(!1),[T,P]=c.useState(null);c.useEffect(()=>{if(!F)return;const n=O=>{O.key==="Escape"&&N(!1)};document.addEventListener("keydown",n);const x=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",n),document.body.style.overflow=x}},[F]);const S=f==="on_sale",g=k&&!Number.isNaN(Number(k))?Number(k):void 0,_=w&&!Number.isNaN(Number(w))?Number(w):void 0,H=u?He[u]:void 0,B=(le.find(n=>n.key===R)??le[0]).server,D={category:l,rarities:d.length?d:void 0,wearableCategories:H,minPriceCredits:g,maxPriceCredits:_,search:a||void 0,sortBy:B,isSmart:$||void 0,onSale:!0},Y={category:l,rarities:d.length?d:void 0,wearableCategories:H,search:a||void 0,sortBy:B,isWearableSmart:$||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:I,total:G,isLoading:b,isPlaceholderData:s,error:p,hasNextPage:ye,isFetchingNextPage:se,fetchNextPage:we}=De(S?["unified-listings",D]:["catalog-items",Y],n=>S?Fe({...D,first:oe,skip:n}):Te({...Y,first:oe,skip:n})),K=G,$e=b||s,Se=b?15:Math.min(Math.max(I.length,1),oe),{data:U,isError:je}=Ee(),ve=n=>U&&n.manaWei?ze(n.manaWei,U):null,ne=c.useRef(null);c.useEffect(()=>{b||s||!a||ne.current===a||(ne.current=a,ae("Shop Searched",{query:a,result_count:K}))},[a,b,s,K]);const Q=c.useRef("__init__");c.useEffect(()=>{if(b||s)return;const n=JSON.stringify({category:l,subCategory:u,rarities:d,min:g,max:_,sort:R,status:f,smart:$});if(Q.current==="__init__"||Q.current===n){Q.current=n;return}Q.current=n,ae("Shop Applied Filter",{filters:{category:l,sub_category:u,rarities:d,min_price_credits:g??null,max_price_credits:_??null,status:f,smart:$,sort:R},result_count:K})},[l,u,d,g,_,R,f,$,b,s,K]);function ke(n){m(n),v(null)}function re(n){q(x=>x.includes(n)?x.filter(O=>O!==n):[...x,n])}function Ce(){m("wearable"),v(null),q([]),z(""),A(""),E("on_sale"),M(!1)}function Re(n){const x=I.find(O=>O.id===n.id);x&&x.source==="legacy"&&x.manaWei&&P(Tt(x))}function Ne(){y.invalidateQueries({queryKey:["unified-listings"]})}const L=[];(g!=null||_!=null)&&L.push({key:"price",label:r("filter.price"),onRemove:()=>{z(""),A("")}});for(const n of ie)d.includes(n)&&L.push({key:`rarity-${n}`,label:be(n),onRemove:()=>re(n)});return $&&L.push({key:"smart",label:r("filter.smart"),onRemove:()=>M(!1)}),f!=="on_sale"&&L.push({key:"status",label:f==="all"?r("filter.statusAll"):r("filter.notForSale"),onRemove:()=>E("on_sale")}),e.jsxs(jt,{"data-testid":"browse",children:[F?e.jsx(Rt,{onClick:()=>N(!1),"aria-hidden":!0}):null,e.jsxs(kt,{className:F?"is-open":"","data-testid":"browse-sidebar",children:[e.jsxs(Nt,{children:[e.jsx(Pt,{children:r("assets.filters")}),e.jsx(_t,{onClick:()=>N(!1),"aria-label":r("assets.closeFilters"),children:"✕"})]}),e.jsx(Ct,{children:e.jsx(St,{category:l,subCategory:u,onCategory:ke,onSub:v,priceMin:k,priceMax:w,onPriceMin:z,onPriceMax:A,rarities:d,onToggleRarity:re,status:f,onStatus:E,smart:$,onSmart:M})}),e.jsx(It,{children:e.jsx(Ft,{type:"button",onClick:()=>N(!1),children:r("assets.showItems")})})]}),e.jsxs(vt,{children:[e.jsx(qe,{sort:R,onSort:Z,total:G,loading:b||s,query:a,onOpenFilters:()=>N(!0),chips:L,onClearChips:Ce}),je&&S&&I.some(n=>n.source==="legacy")?e.jsx("p",{className:"market-banner market-banner--warn",children:r("assets.marketUnavailable")}):null,p?e.jsx(Ye,{message:r("assets.loadError"),testId:"browse-error"}):null,e.jsx("div",{className:"grid","data-testid":"grid",children:$e?e.jsx(ce,{count:Se}):e.jsxs(e.Fragment,{children:[I.map(n=>{if(!S)return e.jsx(ee,{item:n,mode:"view"},te(n));const x=n;return x.source==="legacy"?e.jsx(ee,{item:x,mode:"market",marketPriceCredits:ve(x),onBuyNow:Re},te(n)):e.jsx(ee,{item:n},te(n))}),se?e.jsx(ce,{count:6}):null]})}),e.jsx(Be,{hasNextPage:ye,isFetching:se,onLoadMore:()=>void we()}),!b&&!s&&I.length===0?e.jsx("p",{className:"muted",children:r("assets.noItems")}):null]}),T&&U?e.jsx(Me,{listing:T,rate:U,onClose:()=>P(null),onSold:()=>{P(null),Ne()}}):null]})}export{Xt as Assets};
@@ -1,3 +1,3 @@
1
- import{j as e,r as j,u as Se,a as Le,L as Z}from"./react-C51i12iP.js";import{t as a,C as I,am as W,u as qe,ak as C,a as ie,b as Ie,c as Te,ae as Pe,n as Ee,I as E,an as Be,o as J,ao as de,ap as Fe,m as R,s as Ae,B as Re,g as We,h as Ue,ai as ze,af as ue,aq as $e,aj as he,X as Qe,ar as Ke}from"./index-BBuZMaWr.js";import{s as Oe}from"./wallet-kind-B9P1TeIH.js";import{a as me}from"./buy-C5_gzZWJ.js";import{g as Ge,a as Je,w as De,S as He,G as Ve}from"./buy-gasless-Cxx1jwuH.js";import{R as D,r as Ye}from"./cart-checkout-C3WNM4cy.js";import{l as Xe,u as Ze,c as es}from"./loader-logo-CK-TcJ-S.js";import{i as ss,a as as}from"./errors-BLIsDEoc.js";import{E as ts}from"./ErrorNotice-C7soUjRV.js";import{C as cs}from"./CollectionCarousel-BaK4BZqg.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-CWytSFjw.js";import"./index-HN6Rk25C.js";const rs="https://cdn.decentraland.org/@dcl/shop/0.1.0-29869835587.commit-e6e6578/assets/buy-error-22UunaPC.png";function ns(t){const{phase:r,balanceCredits:u,onClose:l}=t,_=r==="processing",w=r!=="complete",M=r==="error"?a("cartCheckout.errorTitle"):r==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),g=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:_?void 0:l,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${g?" buy-modal__card--tall":""}`,children:[w&&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:M}),!_&&e.jsx("button",{className:"buy-modal__x",onClick:l,"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(I,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:W(u)})]})]}),r==="processing"&&e.jsx(os,{stage:t.stage??"reserving",step:t.step??1,total:t.total??1,isSelfCustody:!!t.isSelfCustody}),r==="nofunds"&&e.jsx(ls,{lines:t.lines??[],shortfallCredits:t.shortfallCredits??0,packs:t.packs??[],selectedPack:t.selectedPack??"",onSelectPack:t.onSelectPack??(()=>{}),onBuyPacks:t.onBuyPacks??(()=>{}),onCancel:l}),r==="complete"&&e.jsx(is,{purchased:t.purchased??[],onMyAssets:t.onMyAssets??l,onTryInWorld:t.onTryInWorld??l}),r==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:rs,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),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--purple",onClick:t.onRetry??l,children:a("cartCheckout.tryAgain")})]})]})]})]})}function os({stage:t,step:r,total:u,isSelfCustody:l}){const _=t==="reserving",w=u>0?Math.min(100,Math.round(r/u*100)):0,M=t==="awaiting-signature"?l?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):t==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:Xe,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:M}),_?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 buy-modal__progress-fill--step",style:{width:`${w}%`}})}),u>1?e.jsxs("span",{className:"cart-checkout__step",children:[r,"/",u]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function ls({lines:t,shortfallCredits:r,packs:u,selectedPack:l,onSelectPack:_,onBuyPacks:w,onCancel:M}){const g=u.find(c=>c.id===l),H=t.reduce((c,y)=>c+(y.quantity??1),0);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:H})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:t.map(c=>{const y=c.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:c.item.thumbnail?e.jsx("img",{src:c.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:c.item.name,children:[c.item.name||a("buyModal.itemFallback"),y>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:y})}):null]}),c.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:c.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(I,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:W(c.priceCredits*y)})]})]})]},c.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:u.map(c=>{const y=c.id===l;return e.jsxs("button",{className:`buy-modal__pack${y?" buy-modal__pack--on":""}`,onClick:()=>_(c.id),children:[e.jsx(I,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:W(c.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",c.usd.toFixed(2),")"]})]},c.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(I,{className:"buy-modal__total-ico"}),e.jsx("span",{children:W((g==null?void 0:g.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((g==null?void 0:g.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:M,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:a("buyModal.buy")})]})]})}function is({purchased:t,onMyAssets:r,onTryInWorld:u}){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(l=>{const _=l.quantity??1;return e.jsxs("div",{className:"cart-checkout__done-row",children:[e.jsxs("div",{className:"cart-checkout__done-thumb",children:[l.thumbnail?e.jsx("img",{src:l.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.jsxs("div",{className:"cart-checkout__done-name",title:l.name,children:[l.name||a("buyModal.itemFallback"),_>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:_})}):null]}),l.creator?e.jsx("div",{className:"cart-checkout__done-creator",children:a("search.byCreator",{name:l.creator})}):null]}),e.jsxs("div",{className:"cart-checkout__done-price",children:[e.jsx(I,{className:"cart-checkout__done-price-ico"}),e.jsx("span",{children:W(l.priceCredits*_)})]})]},l.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:u,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"})})]})]})]})}const ds=Ae(Re)`
1
+ import{j as e,r as g,u as Se,a as Le,L as Z}from"./react-C51i12iP.js";import{t as a,C as T,aj as W,u as Ie,ah as C,a as ie,b as Te,c as qe,ab as Pe,n as Ee,I as E,ak as Be,o as J,al as de,am as Fe,m as R,s as Ae,B as Re,g as We,h as Ue,af as ze,ac as ue,an as $e,ag as he,X as Qe,ao as Ke}from"./index-CxiM65Mp.js";import{s as Oe}from"./wallet-kind-B9P1TeIH.js";import{a as me}from"./buy-CgIgEqv9.js";import{g as Ge,a as Je,w as De,S as He,G as Ve}from"./buy-gasless-pwHqA_mF.js";import{R as D,r as Ye}from"./cart-checkout-vzYBjbSV.js";import{l as Xe,u as Ze,c as es}from"./loader-logo-CmjwjqNs.js";import{i as ss,a as as}from"./errors-BVwqXLe5.js";import{E as ts}from"./ErrorNotice-C7soUjRV.js";import{C as cs}from"./CollectionCarousel-DZRKlb8f.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-D-nmkwVz.js";import"./index-HN6Rk25C.js";const rs="https://cdn.decentraland.org/@dcl/shop/0.1.0-29905759067.commit-1f1fc48/assets/buy-error-22UunaPC.png";function ns(t){const{phase:r,balanceCredits:u,onClose:l}=t,_=r==="processing",w=r!=="complete",M=r==="error"?a("cartCheckout.errorTitle"):r==="nofunds"?a("cartCheckout.titleNoFunds"):a("cartCheckout.titleBuy"),j=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:_?void 0:l,"aria-hidden":!0}),e.jsxs("div",{className:`buy-modal__card${j?" buy-modal__card--tall":""}`,children:[w&&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:M}),!_&&e.jsx("button",{className:"buy-modal__x",onClick:l,"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(T,{className:"buy-modal__balance-ico"}),e.jsx("span",{className:"buy-modal__balance-value",children:W(u)})]})]}),r==="processing"&&e.jsx(os,{stage:t.stage??"reserving",step:t.step??1,total:t.total??1,isSelfCustody:!!t.isSelfCustody}),r==="nofunds"&&e.jsx(ls,{lines:t.lines??[],shortfallCredits:t.shortfallCredits??0,packs:t.packs??[],selectedPack:t.selectedPack??"",onSelectPack:t.onSelectPack??(()=>{}),onBuyPacks:t.onBuyPacks??(()=>{}),onCancel:l}),r==="complete"&&e.jsx(is,{purchased:t.purchased??[],onMyAssets:t.onMyAssets??l,onTryInWorld:t.onTryInWorld??l}),r==="error"&&e.jsxs("div",{className:"buy-modal__body",children:[e.jsxs("div",{className:"buy-error",children:[e.jsx("img",{className:"buy-error__art",src:rs,alt:"",width:64,height:80}),e.jsxs("p",{className:"buy-error__text",children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),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--purple",onClick:t.onRetry??l,children:a("cartCheckout.tryAgain")})]})]})]})]})}function os({stage:t,step:r,total:u,isSelfCustody:l}){const _=t==="reserving",w=u>0?Math.min(100,Math.round(r/u*100)):0,M=t==="awaiting-signature"?l?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):t==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs("div",{className:"buy-modal__body buy-modal__processing",children:[e.jsx("img",{className:"buy-modal__logo",src:Xe,alt:"",width:61,height:61}),e.jsx("div",{className:"buy-modal__processing-text",children:M}),_?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 buy-modal__progress-fill--step",style:{width:`${w}%`}})}),u>1?e.jsxs("span",{className:"cart-checkout__step",children:[r,"/",u]}):null]}):e.jsx("div",{className:"buy-modal__progress","aria-hidden":!0,children:e.jsx("span",{className:"buy-modal__progress-fill"})})]})}function ls({lines:t,shortfallCredits:r,packs:u,selectedPack:l,onSelectPack:_,onBuyPacks:w,onCancel:M}){const j=u.find(c=>c.id===l),H=t.reduce((c,y)=>c+(y.quantity??1),0);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:H})]})]}),e.jsx("div",{className:"cart-checkout__scroll",children:t.map(c=>{const y=c.quantity??1;return e.jsxs("div",{className:"buy-modal__asset",children:[e.jsx("div",{className:"buy-modal__asset-thumb",children:c.item.thumbnail?e.jsx("img",{src:c.item.thumbnail,alt:""}):null}),e.jsxs("div",{className:"buy-modal__asset-info",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"buy-modal__asset-name",title:c.item.name,children:[c.item.name||a("buyModal.itemFallback"),y>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:y})}):null]}),c.item.creator?e.jsx("div",{className:"buy-modal__asset-creator",children:a("search.byCreator",{name:c.item.creator})}):null]}),e.jsxs("div",{className:"buy-modal__asset-price",children:[e.jsx(T,{className:"buy-modal__asset-price-ico"}),e.jsx("span",{children:W(c.priceCredits*y)})]})]})]},c.item.id)})}),e.jsx("div",{className:"buy-modal__packs",children:u.map(c=>{const y=c.id===l;return e.jsxs("button",{className:`buy-modal__pack${y?" buy-modal__pack--on":""}`,onClick:()=>_(c.id),children:[e.jsx(T,{className:"buy-modal__pack-ico"}),e.jsx("span",{className:"buy-modal__pack-amount",children:W(c.credits)}),e.jsxs("span",{className:"buy-modal__pack-usd",children:["($",c.usd.toFixed(2),")"]})]},c.id)})}),e.jsxs("div",{className:"buy-modal__total",children:[e.jsxs("div",{className:"buy-modal__total-credits",children:[e.jsx(T,{className:"buy-modal__total-ico"}),e.jsx("span",{children:W((j==null?void 0:j.credits)??0)})]}),e.jsxs("span",{className:"buy-modal__total-usd",children:["$",((j==null?void 0:j.usd)??0).toFixed(2)]})]}),e.jsxs("div",{className:"buy-modal__ctas",children:[e.jsx("button",{className:"buy-modal__btn buy-modal__btn--outline",onClick:M,children:a("buyModal.cancel")}),e.jsx("button",{className:"buy-modal__btn buy-modal__btn--gradient",onClick:w,children:a("buyModal.buy")})]})]})}function is({purchased:t,onMyAssets:r,onTryInWorld:u}){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(l=>{const _=l.quantity??1;return e.jsxs("div",{className:"cart-checkout__done-row",children:[e.jsxs("div",{className:"cart-checkout__done-thumb",children:[l.thumbnail?e.jsx("img",{src:l.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.jsxs("div",{className:"cart-checkout__done-name",title:l.name,children:[l.name||a("buyModal.itemFallback"),_>1?e.jsx("span",{className:"cart-checkout__qty-tag",children:a("cartCheckout.qty",{count:_})}):null]}),l.creator?e.jsx("div",{className:"cart-checkout__done-creator",children:a("search.byCreator",{name:l.creator})}):null]}),e.jsxs("div",{className:"cart-checkout__done-price",children:[e.jsx(T,{className:"cart-checkout__done-price-ico"}),e.jsx("span",{children:W(l.priceCredits*_)})]})]},l.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:u,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"})})]})]})]})}const ds=Ae(Re)`
2
2
  margin-top: 12px;
3
- `;function _e(t){if(ss(t))return a("errors.rejected");const r=(t.message??"").toLowerCase();return r.includes("insufficient")?a("cart.error.insufficient",{currency:Ue.name}):r.includes("no active listing")||r.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const us=12e4,hs=We.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump";function ms(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")} `)})}const ye=t=>t.reduce((r,u)=>r+u.priceCredits*u.quantity,0),_s=t=>t.flatMap(r=>Array.from({length:r.quantity},()=>({...r,quantity:1})));function Is(){qe({title:a("nav.cart"),noindex:!0});const t=C(s=>s.items),r=C(s=>s.remove),u=C(s=>s.increment),l=C(s=>s.decrement),_=C(s=>s.clear),w=C(s=>s.restore),M=C(s=>s.setFittingOpen),g=ie(s=>s.items),H=ie(s=>s.toggle),{session:c}=Ie(),y=Ze().packs.slice(0,3);j.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const pe=t.some(s=>s.category!=="emote"),{data:V}=Te({queryKey:["upsell-listings"],queryFn:()=>Ke({first:40}),staleTime:6e4}),{data:B}=Pe(c),U=Ee(),z=Se(),{state:T}=Le(),[ee,F]=j.useState(null),[be,S]=j.useState(null),[se,$]=j.useState(null),[xe,P]=j.useState(!1),[k,A]=j.useState(null),ae=j.useRef(0),[i,v]=j.useState(null),[Y,te]=j.useState(""),je=t.reduce((s,n)=>s+n.priceCredits*n.quantity,0),ce=t.reduce((s,n)=>s+n.quantity,0),ge=k?k.liveTotalCredits:je,ke=new Set(t.map(s=>s.id)),re=((V==null?void 0:V.items)??[]).filter(s=>!ke.has(s.id)).slice(0,12),fe=new Map(k==null?void 0:k.buyable.map(s=>[s.item.id,s])),Q=(B==null?void 0:B.credits)??0,ve=Fe;function K(s){s(),A(null),$(null),S(null)}function Ne(){v(null),P(!1)}function ne(s){const n=ye(s),o=Math.max(0,n-Q),b=y.find(h=>h.credits>=o)??y[y.length-1];te(b.id),J("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:n,credits_balance:Q,shortfall:o}),v({phase:"nofunds",lines:s.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),P(!1)}async function Ce(s){if(!c||s.length===0)return;const n=_s(s),o=n.map(d=>({...d.item,priceCredits:d.priceCredits})),b=s.map(d=>({...d.item,priceCredits:d.priceCredits,quantity:d.quantity})),h=[];let N="authorize",G=!1;v({phase:"processing",stage:"reserving",step:1,total:n.length});try{const d=[];for(let m=0;m<n.length;m++){const q=n[m];v({phase:"processing",stage:"reserving",step:m+1,total:n.length});try{const{credit:p,maxCreditedValue:X}=await ze(c.identity,q.usdCents,q.trade.id);h.push(p.id),d.push({trade:q.trade,credits:[p],maxCreditedValue:X})}catch(p){if(as(p)){if(h.length){try{await ue(c.identity,h)}catch(X){R(X,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw p}}N="submit";const x=()=>v({phase:"processing",stage:"settling",step:n.length,total:n.length});v({phase:"processing",stage:"awaiting-signature",step:n.length,total:n.length});let f=[];if(Ge())try{f=await Je({purchases:d,buyer:c.address,signer:c.signer,onSigned:x});const q=(await Promise.allSettled(f.map(p=>De(p)))).flatMap(p=>p.status==="rejected"?[p.reason]:[]);if(q.length&&!q.some(p=>p instanceof He))throw q[0];G=!0}catch(m){if(!(m instanceof Ve))throw m;f=await me({purchases:d,buyer:c.address,signer:c.signer,onSigned:x})}else f=await me({purchases:d,buyer:c.address,signer:c.signer});s.forEach(m=>r(m.item.id)),A(null),J("Shop Completed Purchase",{...$e(o),payment_type:"credits",no_crypto_step:G,transaction_hash:f[0]??null}),U.invalidateQueries({queryKey:["usd-balance"]}),v({phase:"complete",purchased:b})}catch(d){if(he(d)||R(d,{flow:"cart_checkout",step:N,cart_size:s.length}),J(he(d)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:N,error_code:Qe(d),value_usd:de(o.reduce((x,f)=>x+f.priceCredits,0)),cart_size:n.length}),h.length){try{await ue(c.identity,h)}catch(x){R(x,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}v({phase:"error",message:_e(d)})}}function oe(s){const n=ye(s);if(B!=null&&B.credits<n){ne(s);return}Ce(s)}async function O(){if(!c){S(a("buyModal.signInToCheckout"));return}const s=C.getState().items;if(s.length===0)return;S(null),$(null),P(!0);const n=s.reduce((o,b)=>o+b.priceCredits*b.quantity,0);J("Shop Started Checkout",{cart_size:s.length,cart_value_credits:n,cart_value_usd:de(n),has_sufficient_credits:Q>=n});try{F(a("cart.status.reviewing"));const o=await Ye(s,c.address,ve),b=[...o.unavailable,...o.own];if(b.length&&(b.forEach(h=>r(h.id)),$(ms(o))),o.buyable.length===0){S(a("cart.error.noneAvailable")),A(null),F(null);return}if(o.orderChanged){A(o),ae.current=Date.now(),F(null);return}F(null),oe(o.buyable)}catch(o){R(o,{flow:"cart_checkout",step:"review",cart_size:s.length}),S(_e(o)),F(null)}finally{P(!1)}}async function we(){if(k){if(!c){S(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>us){A(null),$(null),await O();return}S(null),oe(k.buyable)}}async function Me(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(C.getState().items))}catch{}P(!0);try{const s=await es(Y,c?{address:c.address,identity:c.identity}:void 0);if(s.url){window.location.href=s.url;return}z("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}R(s,{flow:"cart_buy_credits"}),v({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{P(!1)}}}const le=j.useRef(!1);j.useEffect(()=>{if(!(T!=null&&T.resumeCheckout)||le.current)return;le.current=!0;try{const n=sessionStorage.getItem(D);if(n){sessionStorage.removeItem(D);const o=JSON.parse(n);Array.isArray(o)&&o.length&&w(o)}}catch{}U.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void O(),0);return()=>clearTimeout(s)},[T==null?void 0:T.resumeCheckout]);const L=xe||(i==null?void 0:i.phase)==="processing";return t.length===0&&!i?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(E,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(ds,{as:Z,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>z(-1),type:"button",children:[e.jsx(E,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>z(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(E,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:ce})}),pe?e.jsxs("button",{className:"checkout__fitting",onClick:()=>M(!0),disabled:L,children:[e.jsx(E,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:t.map(s=>{const n=fe.get(s.id),o=n?n.priceCredits:s.priceCredits,b=!!n&&n.priceCredits!==s.priceCredits,h=!s.tokenId,N=s.quantity,G=typeof s.available=="number"&&N>=s.available,d=o*N,x=!!g[s.id],f=s.tokenId??s.itemId,m=s.contractAddress&&f?`/item/${s.contractAddress}/${f}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[m?e.jsx(Z,{className:"checkout__thumb-link",to:m,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:[m?e.jsx(Z,{className:"checkout__name",to:m,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(Be,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[h?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>l(s.id)),disabled:L||N<=1,"aria-label":a("cart.decreaseQuantity",{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:N}),e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>u(s.id)),disabled:L||G,"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"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(I,{className:"checkout__price-ico"})," ",d,b?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*N}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${x?" is-on":""}`,onClick:()=>H(s),"aria-label":x?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:x?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(E,{name:x?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>K(()=>r(s.id)),disabled:L,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(E,{name:"trash",size:24})})]})]},s.id)})}),e.jsxs("div",{className:"checkout__utils",children:[e.jsx("button",{className:"link",onClick:()=>K(_),disabled:L,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:ce})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(I,{className:"checkout__total-ico"})," ",ge]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(k?we():O()),disabled:L,children:L?a("cart.working"):k?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),k?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,se?e.jsx("p",{className:"muted checkout__msg",children:se}):null,ee?e.jsx("p",{className:"muted checkout__msg",children:ee}):null,e.jsx(ts,{message:be,className:"checkout__msg"})]})]})]})]}),re.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(cs,{title:a("cart.youMightAlsoLike"),items:re})}):null,i?e.jsx(ns,{phase:i.phase,balanceCredits:Q,onClose:Ne,stage:i.phase==="processing"?i.stage:void 0,step:i.phase==="processing"?i.step:void 0,total:i.phase==="processing"?i.total:void 0,isSelfCustody:Oe(c==null?void 0:c.providerType),lines:i.phase==="nofunds"?i.lines:void 0,shortfallCredits:i.phase==="nofunds"?i.shortfall:void 0,packs:y,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Me(),purchased:i.phase==="complete"?i.purchased:void 0,onMyAssets:()=>z("/assets?tab=mine"),onTryInWorld:()=>window.open(hs,"_blank","noopener"),message:i.phase==="error"?i.message:void 0,onRetry:()=>void O()}):null]})}export{Is as Cart};
3
+ `;function _e(t){if(ss(t))return a("errors.rejected");const r=(t.message??"").toLowerCase();return r.includes("insufficient")?a("cart.error.insufficient",{currency:Ue.name}):r.includes("no active listing")||r.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const us=12e4,hs=We.chainId===80002?"https://decentraland.zone/jump":"https://decentraland.org/jump";function ms(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")} `)})}const ye=t=>t.reduce((r,u)=>r+u.priceCredits*u.quantity,0),_s=t=>t.flatMap(r=>Array.from({length:r.quantity},()=>({...r,quantity:1})));function Ts(){Ie({title:a("nav.cart"),noindex:!0});const t=C(s=>s.items),r=C(s=>s.remove),u=C(s=>s.increment),l=C(s=>s.decrement),_=C(s=>s.clear),w=C(s=>s.restore),M=C(s=>s.setFittingOpen),j=ie(s=>s.items),H=ie(s=>s.toggle),{session:c}=Te(),y=Ze().packs.slice(0,3);g.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const pe=t.some(s=>s.category!=="emote"),{data:V}=qe({queryKey:["upsell-listings"],queryFn:()=>Ke({first:40}),staleTime:6e4}),{data:B}=Pe(c),U=Ee(),z=Se(),{state:q}=Le(),[ee,F]=g.useState(null),[be,S]=g.useState(null),[se,$]=g.useState(null),[xe,P]=g.useState(!1),[k,A]=g.useState(null),ae=g.useRef(0),[i,v]=g.useState(null),[Y,te]=g.useState(""),ge=t.reduce((s,n)=>s+n.priceCredits*n.quantity,0),ce=t.reduce((s,n)=>s+n.quantity,0),je=k?k.liveTotalCredits:ge,ke=new Set(t.map(s=>s.id)),re=((V==null?void 0:V.items)??[]).filter(s=>!ke.has(s.id)).slice(0,12),fe=new Map(k==null?void 0:k.buyable.map(s=>[s.item.id,s])),Q=(B==null?void 0:B.credits)??0,ve=Fe;function K(s){s(),A(null),$(null),S(null)}function Ne(){v(null),P(!1)}function ne(s){const n=ye(s),o=Math.max(0,n-Q),b=y.find(h=>h.credits>=o)??y[y.length-1];te(b.id),J("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:n,credits_balance:Q,shortfall:o}),v({phase:"nofunds",lines:s.map(h=>({item:h.item,priceCredits:h.priceCredits,quantity:h.quantity})),shortfall:o}),P(!1)}async function Ce(s){if(!c||s.length===0)return;const n=_s(s),o=n.map(d=>({...d.item,priceCredits:d.priceCredits})),b=s.map(d=>({...d.item,priceCredits:d.priceCredits,quantity:d.quantity})),h=[];let N="authorize",G=!1;v({phase:"processing",stage:"reserving",step:1,total:n.length});try{const d=[];for(let m=0;m<n.length;m++){const I=n[m];v({phase:"processing",stage:"reserving",step:m+1,total:n.length});try{const{credit:p,maxCreditedValue:X}=await ze(c.identity,I.usdCents,I.trade.id);h.push(p.id),d.push({trade:I.trade,credits:[p],maxCreditedValue:X})}catch(p){if(as(p)){if(h.length){try{await ue(c.identity,h)}catch(X){R(X,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}ne(s);return}throw p}}N="submit";const x=()=>v({phase:"processing",stage:"settling",step:n.length,total:n.length});v({phase:"processing",stage:"awaiting-signature",step:n.length,total:n.length});let f=[];if(Ge())try{f=await Je({purchases:d,buyer:c.address,signer:c.signer,onSigned:x});const I=(await Promise.allSettled(f.map(p=>De(p)))).flatMap(p=>p.status==="rejected"?[p.reason]:[]);if(I.length&&!I.some(p=>p instanceof He))throw I[0];G=!0}catch(m){if(!(m instanceof Ve))throw m;f=await me({purchases:d,buyer:c.address,signer:c.signer,onSigned:x})}else f=await me({purchases:d,buyer:c.address,signer:c.signer});s.forEach(m=>r(m.item.id)),A(null),J("Shop Completed Purchase",{...$e(o),payment_type:"credits",no_crypto_step:G,transaction_hash:f[0]??null}),U.invalidateQueries({queryKey:["usd-balance"]}),v({phase:"complete",purchased:b})}catch(d){if(he(d)||R(d,{flow:"cart_checkout",step:N,cart_size:s.length}),J(he(d)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:N,error_code:Qe(d),value_usd:de(o.reduce((x,f)=>x+f.priceCredits,0)),cart_size:n.length}),h.length){try{await ue(c.identity,h)}catch(x){R(x,{flow:"cart_checkout",step:"release"})}U.invalidateQueries({queryKey:["usd-balance"]})}v({phase:"error",message:_e(d)})}}function oe(s){const n=ye(s);if(B!=null&&B.credits<n){ne(s);return}Ce(s)}async function O(){if(!c){S(a("buyModal.signInToCheckout"));return}const s=C.getState().items;if(s.length===0)return;S(null),$(null),P(!0);const n=s.reduce((o,b)=>o+b.priceCredits*b.quantity,0);J("Shop Started Checkout",{cart_size:s.length,cart_value_credits:n,cart_value_usd:de(n),has_sufficient_credits:Q>=n});try{F(a("cart.status.reviewing"));const o=await Ye(s,c.address,ve),b=[...o.unavailable,...o.own];if(b.length&&(b.forEach(h=>r(h.id)),$(ms(o))),o.buyable.length===0){S(a("cart.error.noneAvailable")),A(null),F(null);return}if(o.orderChanged){A(o),ae.current=Date.now(),F(null);return}F(null),oe(o.buyable)}catch(o){R(o,{flow:"cart_checkout",step:"review",cart_size:s.length}),S(_e(o)),F(null)}finally{P(!1)}}async function we(){if(k){if(!c){S(a("buyModal.signInToCheckout"));return}if(Date.now()-ae.current>us){A(null),$(null),await O();return}S(null),oe(k.buyable)}}async function Me(){if(Y){try{sessionStorage.setItem(D,JSON.stringify(C.getState().items))}catch{}P(!0);try{const s=await es(Y,c?{address:c.address,identity:c.identity}:void 0);if(s.url){window.location.href=s.url;return}z("/credits")}catch(s){try{sessionStorage.removeItem(D)}catch{}R(s,{flow:"cart_buy_credits"}),v({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{P(!1)}}}const le=g.useRef(!1);g.useEffect(()=>{if(!(q!=null&&q.resumeCheckout)||le.current)return;le.current=!0;try{const n=sessionStorage.getItem(D);if(n){sessionStorage.removeItem(D);const o=JSON.parse(n);Array.isArray(o)&&o.length&&w(o)}}catch{}U.invalidateQueries({queryKey:["usd-balance"]});const s=setTimeout(()=>void O(),0);return()=>clearTimeout(s)},[q==null?void 0:q.resumeCheckout]);const L=xe||(i==null?void 0:i.phase)==="processing";return t.length===0&&!i?e.jsxs("div",{className:"cart cart--empty",children:[e.jsx(E,{name:"cart",size:44,color:"var(--muted-2)"}),e.jsx("p",{className:"cart-empty__title",children:a("cart.empty.title")}),e.jsx("p",{className:"muted",children:a("cart.empty.body")}),e.jsx(ds,{as:Z,to:"/assets",variant:"purple",children:a("cart.empty.cta")})]}):e.jsxs("div",{className:"checkout",children:[e.jsxs("div",{className:"checkout__top",children:[e.jsxs("button",{className:"checkout__back",onClick:()=>z(-1),type:"button",children:[e.jsx(E,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs("div",{className:"checkout__body",children:[e.jsxs("div",{className:"checkout__left",children:[e.jsxs("div",{className:"checkout__head-card",children:[e.jsx("button",{className:"checkout__panel-back",onClick:()=>z(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(E,{name:"arrow-left"})}),e.jsx("h1",{className:"checkout__panel-title",children:a("cart.panelTitle",{count:ce})}),pe?e.jsxs("button",{className:"checkout__fitting",onClick:()=>M(!0),disabled:L,children:[e.jsx(E,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs("section",{className:"checkout__panel",children:[e.jsx("div",{className:"checkout__list",children:t.map(s=>{const n=fe.get(s.id),o=n?n.priceCredits:s.priceCredits,b=!!n&&n.priceCredits!==s.priceCredits,h=!s.tokenId,N=s.quantity,G=typeof s.available=="number"&&N>=s.available,d=o*N,x=!!j[s.id],f=s.tokenId??s.itemId,m=s.contractAddress&&f?`/item/${s.contractAddress}/${f}`:null;return e.jsxs("div",{className:"checkout__card",children:[e.jsxs("div",{className:"checkout__thumb",children:[m?e.jsx(Z,{className:"checkout__thumb-link",to:m,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:[m?e.jsx(Z,{className:"checkout__name",to:m,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(Be,{address:s.creator,className:"checkout__creator",linkToProfile:!0}):null]}),e.jsxs("div",{className:"checkout__foot",children:[h?e.jsxs("div",{className:"checkout__stepper",children:[e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>l(s.id)),disabled:L||N<=1,"aria-label":a("cart.decreaseQuantity",{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:N}),e.jsx("button",{className:"checkout__step",onClick:()=>K(()=>u(s.id)),disabled:L||G,"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"})})})]}):null,e.jsxs("div",{className:"checkout__price",children:[e.jsx(T,{className:"checkout__price-ico"})," ",d,b?e.jsx("span",{className:"checkout__price-was",children:s.priceCredits*N}):null]})]})]}),e.jsxs("div",{className:"checkout__actions",children:[e.jsx("button",{className:`checkout__fav${x?" is-on":""}`,onClick:()=>H(s),"aria-label":x?a("cart.removeFromFavorites",{name:s.name}):a("cart.addToFavorites",{name:s.name}),title:x?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(E,{name:x?"heart-solid":"heart"})}),e.jsx("button",{className:"checkout__remove",onClick:()=>K(()=>r(s.id)),disabled:L,"aria-label":a("cart.remove",{name:s.name}),title:a("cart.removeTitle"),children:e.jsx(E,{name:"trash",size:24})})]})]},s.id)})}),e.jsxs("div",{className:"checkout__utils",children:[e.jsx("button",{className:"link",onClick:()=>K(_),disabled:L,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:ce})}),e.jsxs("span",{className:"checkout__total-value",children:[e.jsx(T,{className:"checkout__total-ico"})," ",je]})]}),e.jsx("button",{className:"checkout__cta",onClick:()=>void(k?we():O()),disabled:L,children:L?a("cart.working"):k?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),k?e.jsx("p",{className:"muted checkout__msg",children:a("cart.priceChanged")}):null,se?e.jsx("p",{className:"muted checkout__msg",children:se}):null,ee?e.jsx("p",{className:"muted checkout__msg",children:ee}):null,e.jsx(ts,{message:be,className:"checkout__msg"})]})]})]})]}),re.length>0?e.jsx("div",{className:"cart-upsell",children:e.jsx(cs,{title:a("cart.youMightAlsoLike"),items:re})}):null,i?e.jsx(ns,{phase:i.phase,balanceCredits:Q,onClose:Ne,stage:i.phase==="processing"?i.stage:void 0,step:i.phase==="processing"?i.step:void 0,total:i.phase==="processing"?i.total:void 0,isSelfCustody:Oe(c==null?void 0:c.providerType),lines:i.phase==="nofunds"?i.lines:void 0,shortfallCredits:i.phase==="nofunds"?i.shortfall:void 0,packs:y,selectedPack:Y,onSelectPack:te,onBuyPacks:()=>void Me(),purchased:i.phase==="complete"?i.purchased:void 0,onMyAssets:()=>z("/assets?tab=mine"),onTryInWorld:()=>window.open(hs,"_blank","noopener"),message:i.phase==="error"?i.message:void 0,onRetry:()=>void O()}):null]})}export{Ts as Cart};
@@ -1,4 +1,4 @@
1
- import{x as N,y as z,z as E,D as U,E as o,F as w,G as c,H as F,J as g,K as $,L as M}from"./index-BBuZMaWr.js";import{r as I,j as v}from"./react-C51i12iP.js";function K(r){return N("MuiCircularProgress",r)}z("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const G=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,D;const t=44,L=M(P||(P=l`
1
+ import{x as N,y as z,z as E,D as U,E as o,F as w,G as c,H as F,J as g,K as $,L as M}from"./index-CxiM65Mp.js";import{r as I,j as v}from"./react-C51i12iP.js";function K(r){return N("MuiCircularProgress",r)}z("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const G=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,S,b,D;const t=44,L=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,r as p,d as Q,u as Y}from"./react-C51i12iP.js";import{a2 as N,s as v,a3 as Z,I as J,t,g as V,m as W,c as X,u as ee,A as ae,av as te,h as re,aw as se}from"./index-BBuZMaWr.js";import{E as oe}from"./ErrorNotice-C7soUjRV.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-DHOETntw.js";import{u as de}from"./useStore-CQIJvFZA.js";import{s as E}from"./address-DrURAr9O.js";import{S as F,C as me,F as pe,e as ue,c as R,d as ge}from"./categories-DQ55lr2p.js";import{L as xe}from"./LoadMore-QYabEF53.js";import{u as he}from"./useInfiniteGrid-CpiD11c4.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";const be=v.section`
1
+ import{j as e,r as p,d as Q,u as Y}from"./react-C51i12iP.js";import{a2 as N,s as v,a3 as Z,I as J,t,g as V,m as W,c as X,u as ee,A as ae,av as te,h as re,aw as se}from"./index-CxiM65Mp.js";import{E as oe}from"./ErrorNotice-C7soUjRV.js";import{d as ie,g as ce,a as ne,A as le}from"./collection-7YyqOIsA.js";import{u as de}from"./useStore-B_g31vF6.js";import{s as E}from"./address-DrURAr9O.js";import{S as F,C as me,F as pe,e as ue,c as R,d as ge}from"./categories-D5VGMfW4.js";import{L as xe}from"./LoadMore-DUwOaKdq.js";import{u as he}from"./useInfiniteGrid-DMPijgdc.js";import"./dcl-schemas-BICTSpB5.js";import"./sentry-DKBoGDXH.js";import"./ethers-BeFqf2KO.js";import"./intl-CBcMB1D2.js";import"./emotion-CSxEP8yM.js";const be=v.section`
2
2
  position: relative;
3
3
  border-radius: ${N.radius.card};
4
4
  overflow: hidden;
@@ -1 +1 @@
1
- import{r as o,j as t}from"./react-C51i12iP.js";import{t as s,I as k,w as f,A as N}from"./index-BBuZMaWr.js";function L({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,w]=o.useState(!0),[C,b]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),w(e<=1),b(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function p(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:C,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>p(e)},e))}):null]})}export{L as C};
1
+ import{r as o,j as t}from"./react-C51i12iP.js";import{t as s,I as k,w as f,A as N}from"./index-CxiM65Mp.js";function L({title:v,items:a,onViewAll:i}){const r=o.useRef(null),[u,x]=o.useState(1),[d,g]=o.useState(0),[j,w]=o.useState(!0),[C,b]=o.useState(!1),c=o.useCallback(()=>{const l=r.current;if(!l)return;const{scrollLeft:e,scrollWidth:m,clientWidth:n}=l,_=Math.max(1,Math.ceil(m/n));x(_),g(Math.min(_-1,Math.round(e/n))),w(e<=1),b(e+n>=m-1)},[]);if(o.useEffect(()=>{c();const l=r.current;if(l)return l.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{l.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[c,a.length]),a.length===0)return null;function h(l){const e=r.current;e&&e.scrollBy({left:l*e.clientWidth,behavior:"smooth"})}function p(l){const e=r.current;e&&e.scrollTo({left:l*e.clientWidth,behavior:"smooth"})}return t.jsxs("section",{className:"collection-carousel",children:[t.jsxs("div",{className:"collection-carousel__head",children:[t.jsx("h2",{className:"collection-carousel__title",children:v}),i?t.jsxs("button",{className:"collection-carousel__viewall",onClick:i,children:[s("collectionCarousel.viewAll"),t.jsx(k,{name:"chevron-down",size:16,className:"collection-carousel__viewall-ico"})]}):null]}),t.jsxs("div",{className:"collection-carousel__viewport",children:[t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--left",onClick:()=>h(-1),"aria-label":s("collectionCarousel.scrollLeft"),disabled:j,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})}),t.jsx("div",{className:"collection-carousel__track",ref:r,children:a.map(l=>t.jsx(N,{item:l},l.id))}),t.jsx("button",{className:"collection-carousel__arrow collection-carousel__arrow--right",onClick:()=>h(1),"aria-label":s("collectionCarousel.scrollRight"),disabled:C,children:t.jsx("img",{src:f,alt:"","aria-hidden":!0})})]}),u>1?t.jsx("div",{className:"collection-carousel__dots","aria-label":s("collectionCarousel.pages"),children:Array.from({length:u}).map((l,e)=>t.jsx("button",{className:`collection-carousel__dot${e===d?" is-active":""}`,"aria-label":s("collectionCarousel.goToPage",{page:e+1}),"aria-current":e===d?"true":void 0,onClick:()=>p(e)},e))}):null]})}export{L as C};