@dcl/shop 0.1.0-30465483842.commit-35256d2 → 0.1.0-30497598696.commit-4ea1dde

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 (229) hide show
  1. package/assets/{Activity-BeTqkBj9.js → Activity-B_s4shG9.js} +1 -1
  2. package/assets/{AnimatedBackground-Cn4Zf2W1.js → AnimatedBackground-DB5Ss4ap.js} +1 -1
  3. package/assets/{Assets-DudI0KEf.js → Assets-DGVOgeRG.js} +2 -2
  4. package/assets/{Assets.styles-BVt9ny1H.js → Assets.styles-BlqCpVPA.js} +2 -2
  5. package/assets/{Authorizations-BAz8f3JR.js → Authorizations-ClSgzEm9.js} +1 -1
  6. package/assets/{Cart-ivYSIGG2.js → Cart-Cr7qdGKk.js} +16 -11
  7. package/assets/{CircularProgress-CtiP6dpx.js → CircularProgress-KUMU3U08.js} +1 -1
  8. package/assets/{Collection-DtymV7vw.js → Collection-97efqPC8.js} +1 -1
  9. package/assets/{CollectionCarousel-cAnwcIFc.js → CollectionCarousel-MJIfHIAG.js} +34 -16
  10. package/assets/{ConstantsUtil-CtukCvy7.js → ConstantsUtil-Dfwpy1eP.js} +1 -1
  11. package/assets/{ContentClient-Y4SsAlAh.js → ContentClient-gZyDAKO3.js} +1 -1
  12. package/assets/{Creator-BXEtxAG-.js → Creator-Bv3gNXme.js} +1 -1
  13. package/assets/{DeploymentBuilder-GpEcBaRI.js → DeploymentBuilder-DufsvYDr.js} +1 -1
  14. package/assets/{ErrorNotice-CCmfdXO-.js → ErrorNotice-T3U1x2gM.js} +1 -1
  15. package/assets/{ExchangeController-DricVZKh.js → ExchangeController-GCK_R7Ey.js} +1 -1
  16. package/assets/{GetCredits-CteYpfxR.js → GetCredits-BJv8YlhP.js} +1 -1
  17. package/assets/{HelpersUtil-CGIcCkK_.js → HelpersUtil-DRAzH_Eb.js} +1 -1
  18. package/assets/{ImportListings-Bbmrn90L.js → ImportListings-X8oBIjzn.js} +27 -13
  19. package/assets/{ItemDetail-0VoDt4ER.js → ItemDetail-DceF2pIM.js} +278 -276
  20. package/assets/{LoadMore-C4ahcKGI.js → LoadMore-EzzDujll.js} +1 -1
  21. package/assets/{MenuList-B2tx2Rax.js → MenuList-DzP2GuNW.js} +1 -1
  22. package/assets/{MyAssets-CN-grtYY.js → MyAssets-BVAVBC1I.js} +1 -1
  23. package/assets/{MyFavorites-BbfXGeat.js → MyFavorites-Bwu_IAMr.js} +1 -1
  24. package/assets/{NetworkUtil-DXqql1Wz.js → NetworkUtil-HlUKXKcF.js} +1 -1
  25. package/assets/{NotFound-3nwiotnn.js → NotFound-Br6vUFaQ.js} +1 -1
  26. package/assets/{NotificationsBell-HgkcWigI.js → NotificationsBell-CpzWIV_f.js} +1 -1
  27. package/assets/{StoreSettings-qabn4ON-.js → StoreSettings-CAGNuG5P.js} +1 -1
  28. package/assets/{Success-CjzxOGc_.js → Success-DATDpbL1.js} +1 -1
  29. package/assets/{SwapController-DMsZNMmX.js → SwapController-0Egz5gvE.js} +1 -1
  30. package/assets/Tooltip-DaxPnuDE.js +45 -0
  31. package/assets/{TradeService-DPp_8P7A.js → TradeService-DugSIG-T.js} +1 -1
  32. package/assets/{W3MFrameProviderSingleton-CTol_EUI.js → W3MFrameProviderSingleton-CRyphTNj.js} +3 -3
  33. package/assets/{WebCryptoP256-DpdlkbHJ.js → WebCryptoP256-DDiLCxeu.js} +1 -1
  34. package/assets/{authorizations-93IYCFGd.js → authorizations-Dz891X4r.js} +1 -1
  35. package/assets/{basic-CpElrsn8.js → basic-7T85qGyt.js} +1 -1
  36. package/assets/{biconomy-DxKbEqvI.js → biconomy-CbuwbQ7f.js} +1 -1
  37. package/assets/{browseLayout.styles-oJ6cJp3z.js → browseLayout.styles-Cyml9DBN.js} +2 -2
  38. package/assets/{browser-DxF-qILS.js → browser-BGlawS--.js} +1 -1
  39. package/assets/browser-ponyfill-B4tSdV4O.js +1 -0
  40. package/assets/{browser-ponyfill-CxIDDbrC.js → browser-ponyfill-BvriZgAo.js} +1 -1
  41. package/assets/{builder-BxP8tT4f.js → builder-Di_i0uie.js} +1 -1
  42. package/assets/{buy-BYXdfz24.js → buy-KTMkFDbF.js} +1 -1
  43. package/assets/{buy-gasless-BS7n5_qI.js → buy-gasless-Ce5WXr0l.js} +1 -1
  44. package/assets/{categories-5tCT8xWh.js → categories-BtM8_SSI.js} +1 -1
  45. package/assets/{ccip-Bl6ljmaH.js → ccip-DNSvOrJz.js} +1 -1
  46. package/assets/{ccip-D8XoWaW0.js → ccip-NhvY-DuA.js} +1 -1
  47. package/assets/{chains-Dlj4CXzw.js → chains-DjVUcpdx.js} +1 -1
  48. package/assets/{clsx-GM87-Mfi.js → clsx-DZSbGRZP.js} +1 -1
  49. package/assets/{common-B0ixkeRu.js → common-BzdjGk0Y.js} +1 -1
  50. package/assets/{controller-B9756Ryj.js → controller-2WxetY20.js} +2 -2
  51. package/assets/{core-CnxuTyuu.js → core-Xele3HnH.js} +4 -4
  52. package/assets/{createSvgIcon-tZB5vU5t.js → createSvgIcon-CAdQcjOA.js} +1 -1
  53. package/assets/{custom-BpAwBsCt.js → custom-RQA18iWz.js} +1 -1
  54. package/assets/{data-capture-CHeYJ3vX.js → data-capture-CZb0JOnd.js} +1 -1
  55. package/assets/decimals-CTAJwKFW.js +1 -0
  56. package/assets/{decimals-CqRsKj6U.js → decimals-rMqzXjFU.js} +1 -1
  57. package/assets/{detectExtension-DX7grDLh.js → detectExtension-0JcORGBX.js} +1 -1
  58. package/assets/{email-XSD702LD.js → email-DiUkHxNq.js} +1 -1
  59. package/assets/{embedded-wallet-DXacld5x.js → embedded-wallet-46mRUp3B.js} +1 -1
  60. package/assets/{emotion-styled.browser.esm-CDVeR2pU.js → emotion-styled.browser.esm-DgGrnFNo.js} +1 -1
  61. package/assets/{engine-Dh3r5QUk.js → engine-CBrsJEKs.js} +1 -1
  62. package/assets/{errors-DLr34B3-.js → errors-JUBkzG87.js} +1 -1
  63. package/assets/estimate-l1-fee-Cs-PSPSm.js +1 -0
  64. package/assets/eth_estimateGas-BfIHMLbI.js +1 -0
  65. package/assets/{eth_getStorageAt-E4OzrSEc.js → eth_getStorageAt-DIGus6Ic.js} +1 -1
  66. package/assets/eth_getTransactionCount-CmmgCgZ1.js +1 -0
  67. package/assets/{ethereum-CBeS7QFR.js → ethereum-7duKFA0R.js} +1 -1
  68. package/assets/{ethers--abqWJu6.js → ethers-CpLYx0ea.js} +1 -1
  69. package/assets/{execute-BjxgVD5q.js → execute-Clg1mM_X.js} +2 -2
  70. package/assets/{extractIPFS-ChPZSPQw.js → extractIPFS-CTs5XnuT.js} +1 -1
  71. package/assets/{features-ZVa1PXQo.js → features-iVV39qjI.js} +1 -1
  72. package/assets/{fetchTokenMetadata-BonGxoWN.js → fetchTokenMetadata-JFitoLaN.js} +2 -2
  73. package/assets/{fortmatic-HaPICQeD.js → fortmatic-CCMQbesB.js} +1 -1
  74. package/assets/{get-bytecode-BRKTQsHC.js → get-bytecode-Bg8NviKV.js} +1 -1
  75. package/assets/get-ecosystem-wallet-info-BbqTZN-t.js +1 -0
  76. package/assets/{getBalance-D4riIp1B.js → getBalance-BhKN1EHb.js} +2 -2
  77. package/assets/{getInstalledModules-DbNUTCf0.js → getInstalledModules-KP-LSI0j.js} +1 -1
  78. package/assets/getNFT-B9xXf-dO.js +1 -0
  79. package/assets/{getNFT-BZdDzwN-.js → getNFT-CV15WhdD.js} +2 -2
  80. package/assets/{getThemeProps-_DRrmPGx.js → getThemeProps-D49OFksO.js} +1 -1
  81. package/assets/{grid.styles-Cw26IyBx.js → grid.styles-beZx-O42.js} +1 -1
  82. package/assets/{hashTypedData-4FQ0aWPB.js → hashTypedData-BG9Q-Idk.js} +1 -1
  83. package/assets/{hashTypedData-DjUej2SL.js → hashTypedData-CrzHCRn3.js} +1 -1
  84. package/assets/{import-BDu1boR-.js → import-4RvqLrjt.js} +1 -1
  85. package/assets/{in-app-BS6ANRK_.js → in-app-B4RKRM1u.js} +1 -1
  86. package/assets/{in-app-wallet-calls-DISlGB0f.js → in-app-wallet-calls-CSGbWPV4.js} +1 -1
  87. package/assets/{index-DGZgLX5H.js → index-3x98-rKq.js} +1 -1
  88. package/assets/{index-C8dqc2e-.js → index-5RCIEGJN.js} +1 -1
  89. package/assets/{index-_c5LJlQE.js → index-8EYFemjW.js} +1 -1
  90. package/assets/index-9H7pG6F1.js +1 -0
  91. package/assets/{index-BqbJpa0j.js → index-B-Kqr2Lr.js} +1 -1
  92. package/assets/{index-BJvvuyHt.js → index-B1bBhgOG.js} +1 -1
  93. package/assets/{index-DbPcoBNe.js → index-B2lClF4r.js} +1 -1
  94. package/assets/{index-DLR5U5u7.js → index-B5OOzrw0.js} +1 -1
  95. package/assets/{index-CLqMYMp_.js → index-B6nk66gw.js} +1 -1
  96. package/assets/{index-BQEI0eWt.js → index-B7ResnK5.js} +1 -1
  97. package/assets/{index-tvUXHAjm.js → index-B9kD__eY.js} +1 -1
  98. package/assets/{index-DGHjUc9b.js → index-BEdImmf3.js} +2 -2
  99. package/assets/{index-CCfTPrm0.js → index-BJQJ6qaf.js} +1 -1
  100. package/assets/{index-C_NJ5W3Q.js → index-BOF2imBG.js} +1 -1
  101. package/assets/{index-D19PQguq.js → index-BVMf-qn6.js} +1 -1
  102. package/assets/{index-gugejC0m.js → index-BVOMemqH.js} +1 -1
  103. package/assets/{index-BQgkgQ46.js → index-BYE8hYx-.js} +1 -1
  104. package/assets/{index-798yU1Mw.js → index-BiUDBy6C.js} +1 -1
  105. package/assets/{index-CLrPXCJt.js → index-BjbR46a4.js} +1 -1
  106. package/assets/{index-T2XOIIOd.js → index-BtO7iASi.js} +1 -1
  107. package/assets/{index-OMa8Tj-T.js → index-BvLvK2MW.js} +1 -1
  108. package/assets/{index-eefVCnI5.js → index-BwPbh62F.js} +1 -1
  109. package/assets/{index-DMKlwtPQ.js → index-C0sxJ5xX.js} +3 -3
  110. package/assets/{index-LJjUqlEi.js → index-C6ODV4-L.js} +1 -1
  111. package/assets/{index-eFPFED8d.js → index-C7yagPy7.js} +1 -1
  112. package/assets/{index-M7UEwjGY.js → index-C8x4NMNb.js} +1 -1
  113. package/assets/{index-DQ6JWiqD.js → index-C9aPSlyC.js} +341 -308
  114. package/assets/{index-zwRq9h0X.js → index-CElkFvVm.js} +1 -1
  115. package/assets/{index-DoKViOPe.js → index-CIPbxoP5.js} +2 -2
  116. package/assets/{index-D8oxVq2h.js → index-CK7WvZif.js} +1 -1
  117. package/assets/{index-BSGQxCOa.js → index-CMgkT5ZH.js} +1 -1
  118. package/assets/{index-DgrIRrjH.js → index-CcQtz-MR.js} +3 -3
  119. package/assets/{index-BX3lLNL7.js → index-CcRW7qMf.js} +1 -1
  120. package/assets/{index-CtOaoAtu.js → index-CemA9uz4.js} +1 -1
  121. package/assets/{index-CpLfF_C5.js → index-CkI5XL5y.js} +1 -1
  122. package/assets/{index-Cg7CPUHg.js → index-Co9OL6oW.js} +1 -1
  123. package/assets/{index-B-BkGVd_.js → index-CpgYRLFY.js} +2 -2
  124. package/assets/{index-DSiEomXM.js → index-D4_KbPRN.js} +2 -2
  125. package/assets/{index-DTDCTp2g.js → index-D8e_T9CW.js} +1 -1
  126. package/assets/{index-CeV-QjPU.js → index-DAo8QTgz.js} +1 -1
  127. package/assets/{index-DVuMdLqo.js → index-DG4sRlUX.js} +1 -1
  128. package/assets/{index-BoRS8U2O.js → index-DIDeduvS.js} +1 -1
  129. package/assets/{index-CbCySxiP.js → index-DJRbW62L.js} +1 -1
  130. package/assets/{index-BxLxzt3o.js → index-DQqq6tsa.js} +1 -1
  131. package/assets/{index-DN_GgU69.js → index-DWmHtPGK.js} +1 -1
  132. package/assets/{index-DOjpmFkl.js → index-Dd-jgJaZ.js} +1 -1
  133. package/assets/{index-CDthvVRG.js → index-DdaAtig5.js} +1 -1
  134. package/assets/{index-w01WQ1OT.js → index-DgMAf2q5.js} +1 -1
  135. package/assets/{index-C_q9eRuG.js → index-DiUUPZT7.js} +1 -1
  136. package/assets/{index-Dh0Sv0e8.js → index-DjiJYFQu.js} +1 -1
  137. package/assets/{index-BuvFoyTD.js → index-Dk_pfUan.js} +1 -1
  138. package/assets/{index-BzdD6V6H.js → index-DlLNQPiR.js} +1 -1
  139. package/assets/{index-Am_UuYtn.js → index-DlkFYSp0.js} +1 -1
  140. package/assets/{index-BDJa77HS.js → index-DnQ9kkjE.js} +1 -1
  141. package/assets/{index-CWWazwi9.js → index-DsXwCxFn.js} +1 -1
  142. package/assets/{index-B25RdNLD.js → index-DutOGRmD.js} +1 -1
  143. package/assets/{index-B4kPBdQm.js → index-Ftx7PR7I.js} +1 -1
  144. package/assets/{index-CwklEm59.js → index-Fyrl3bgj.js} +1 -1
  145. package/assets/{index-DO6Qu3WW.js → index-Jvvdliqx.js} +3 -3
  146. package/assets/{index-vHUJJrBU.js → index-LUwrgypY.js} +1 -1
  147. package/assets/{index-C1Asz4E8.js → index-O5oS9IfZ.js} +1 -1
  148. package/assets/{index-C7XgriCO.js → index-Rze78fpx.js} +1 -1
  149. package/assets/index-YUVIXaKh.css +1 -0
  150. package/assets/{index-d7uAVQJc.js → index-rYXL6QOv.js} +1 -1
  151. package/assets/{index.es-DF0fPg1w.js → index.es-8XmDF3sU.js} +1 -1
  152. package/assets/{index.es-DwC36uQk.js → index.es-CDI5J76a.js} +4 -4
  153. package/assets/{index.es-B7o2FOqd.js → index.es-h__2fQBA.js} +1 -1
  154. package/assets/{linkAccount-BtAQZlYa.js → linkAccount-D303ryxj.js} +1 -1
  155. package/assets/{localBatchGatewayRequest-CMQNhumX.js → localBatchGatewayRequest-CNc2tb7Q.js} +1 -1
  156. package/assets/{mana-convert-DVF4taBh.js → mana-convert-519jIoGv.js} +1 -1
  157. package/assets/{mana-rate-DghhfRg4.js → mana-rate-C-S8V8OH.js} +1 -1
  158. package/assets/{native-CPZ4GKee.js → native-BbO8hggJ.js} +1 -1
  159. package/assets/{networks-CTtxcDaZ.js → networks-CkEF1R2G.js} +1 -1
  160. package/assets/{onramp-DH1m5q3Z.js → onramp-BkPO4411.js} +1 -1
  161. package/assets/{openzeppelin-C43jcpbd.js → openzeppelin-BbRuTYZV.js} +1 -1
  162. package/assets/{ownerOf-DmpjD1-R.js → ownerOf-B0AowHTZ.js} +1 -1
  163. package/assets/{parseNft-DfOGe9m5.js → parseNft-fkQ67kUG.js} +2 -2
  164. package/assets/{parseSignature-DikUb694.js → parseSignature-Cd8xeqSc.js} +1 -1
  165. package/assets/{parseSignature-aw_zZz28.js → parseSignature-DDbo_j_P.js} +3 -3
  166. package/assets/{passkeys-nBMLF2xb.js → passkeys-C2AoFBHz.js} +1 -1
  167. package/assets/{pay-with-exchange-BvzhQXq9.js → pay-with-exchange-BZPweYB5.js} +1 -1
  168. package/assets/{prepare-contract-call-DDzIRXLv.js → prepare-contract-call-BreQKHF6.js} +1 -1
  169. package/assets/{qr-overlay-DraTWZGb.js → qr-overlay-KdBj8v0r.js} +3 -3
  170. package/assets/{react-BYHuwl8r.js → react-vyZjIDcS.js} +1 -1
  171. package/assets/{receive-4VdJwQ5p.js → receive-CFeT9xrk.js} +1 -1
  172. package/assets/{resolveImplementation-BeIaeyw0.js → resolveImplementation-DBJfh-FY.js} +1 -1
  173. package/assets/{rpc-BBuy0siA.js → rpc-B2oNfk4l.js} +1 -1
  174. package/assets/{secp256k1-BB8knln0.js → secp256k1-DB5XegfY.js} +1 -1
  175. package/assets/{secp256k1-CNxo_fPH.js → secp256k1-DNCmoZeu.js} +1 -1
  176. package/assets/{secp256k1-vpgDrCPF.js → secp256k1-E5dSGQB7.js} +1 -1
  177. package/assets/{send-DVC7onZT.js → send-BzZFVa7V.js} +1 -1
  178. package/assets/{send-batch-transaction-98lAmXJd.js → send-batch-transaction-DmhNrrl2.js} +1 -1
  179. package/assets/{send-eip712-transaction-Eg93axAQ.js → send-eip712-transaction-Dpp-Tnhx.js} +2 -2
  180. package/assets/send-gasless-transaction-S-k5TeaE.js +2 -0
  181. package/assets/{send-transaction-DIVDHo0b.js → send-transaction-B44ZAxgB.js} +2 -2
  182. package/assets/{sendMetaTransaction-BjStTgy8.js → sendMetaTransaction-Dgxdo_cy.js} +1 -1
  183. package/assets/{sendRawTransaction-C0hCcwaF.js → sendRawTransaction-Djol22Yy.js} +3 -3
  184. package/assets/{sentry-Dx-KuLV3.js → sentry-B35L1FdR.js} +1 -1
  185. package/assets/{serializeTransaction-CTD81sCU.js → serializeTransaction-Dgv65AON.js} +1 -1
  186. package/assets/{session-proposal-BqbaK0vH.js → session-proposal-DAuPQ12D.js} +1 -1
  187. package/assets/{session-request-DQi229nq.js → session-request-CBU8H1tR.js} +2 -2
  188. package/assets/{sha256-CfLwtdyC.js → sha256-NdAeiB0X.js} +1 -1
  189. package/assets/{signing-C-hS2sII.js → signing-D2AdVilf.js} +3 -3
  190. package/assets/{socials-CBTjIC0C.js → socials-CuQWRkr5.js} +1 -1
  191. package/assets/{swaps-BMaKKFJL.js → swaps-LzxNCpsb.js} +1 -1
  192. package/assets/{thirdweb-gVaYX1Nm.js → thirdweb-B0DOT-R5.js} +3 -3
  193. package/assets/{to-serializable-transaction-BRT7Q8xs.js → to-serializable-transaction-BeekAn8A.js} +2 -2
  194. package/assets/{totalSupply-DRNaCAzP.js → totalSupply-BVfGieGk.js} +1 -1
  195. package/assets/{trade-encoding-BTpnbAqu.js → trade-encoding-BwYos8Ms.js} +1 -1
  196. package/assets/{transaction-Col-q-Ce.js → transaction-8aHmZ7ni.js} +1 -1
  197. package/assets/{transactionReceipt-DKKCsI26.js → transactionReceipt-BQu4Oof3.js} +1 -1
  198. package/assets/{transactions-CadGL-lV.js → transactions-iYCPh2Id.js} +1 -1
  199. package/assets/{useCreditPacks-B4TLB8Ir.js → useCreditPacks-BN70ICff.js} +1 -1
  200. package/assets/{useInfiniteGrid-C6HwGwYR.js → useInfiniteGrid-_0aqBjgd.js} +1 -1
  201. package/assets/useManaRate-BrwJXTcH.js +1 -0
  202. package/assets/{useSecondarySales-BTqJsuhI.js → useSecondarySales-zW-UzRs8.js} +1 -1
  203. package/assets/{useStore-BzU6Jh1o.js → useStore-BmRyRgKo.js} +2 -2
  204. package/assets/useTheme-QSimE3Um.js +1 -0
  205. package/assets/{utils-BQF5MiO5.js → utils-jd03xFBb.js} +1 -1
  206. package/assets/{verifyHash-u7AIFmcv.js → verifyHash-DOqRIddZ.js} +1 -1
  207. package/assets/{w3m-modal-D-H2XJii.js → w3m-modal-ClJX2BXB.js} +1 -1
  208. package/assets/{w3m-modal-pEA1kWyU.js → w3m-modal-hMvbKBgL.js} +1 -1
  209. package/assets/{wait-for-tx-receipt-h9USNCLV.js → wait-for-tx-receipt-BZid7VP6.js} +1 -1
  210. package/assets/{wallets-BwDMgJZD.js → wallets-U_fUqeG7.js} +5 -5
  211. package/assets/{web-connector-CPZEHhv9.js → web-connector-DT8PRFV7.js} +3 -3
  212. package/assets/{writeContract-D2343X96.js → writeContract-BHlhXUjY.js} +1 -1
  213. package/assets/{zora-sepolia-5SAdD430.js → zora-sepolia-Bt1F-uU9.js} +1 -1
  214. package/assets/{zoraTestnet-C10IoprX.js → zoraTestnet-B0nd7orZ.js} +1 -1
  215. package/index.html +11 -11
  216. package/package.json +2 -2
  217. package/assets/Tooltip-C7o9WgVx.js +0 -48
  218. package/assets/browser-ponyfill-Bfl4ugg_.js +0 -1
  219. package/assets/decimals-CMCAWgOh.js +0 -1
  220. package/assets/estimate-l1-fee-2qvKT5Nf.js +0 -1
  221. package/assets/eth_estimateGas-BZtzeL48.js +0 -1
  222. package/assets/eth_getTransactionCount-Ck8bEyl_.js +0 -1
  223. package/assets/get-ecosystem-wallet-info-BxqcPq0B.js +0 -1
  224. package/assets/getNFT-D06wHDW0.js +0 -1
  225. package/assets/index-DCpWUtOQ.css +0 -1
  226. package/assets/index-DbLpdy-5.js +0 -1
  227. package/assets/send-gasless-transaction-B7IHL-9x.js +0 -2
  228. package/assets/useManaRate-iYCZTzak.js +0 -1
  229. package/assets/useTheme-BoNwKDMf.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as b,j as e,L as _,e as dt}from"./react-BYHuwl8r.js";import{aE as lt,s as l,t as o,w as ut,B as ht,l as xt,d,m as pt,u as j,I as g,aF as G,aG as R,aH as mt,y as v,aI as gt,al as E,z as Q,H as ft,aJ as yt,aK as X}from"./index-DQ6JWiqD.js";import{m as bt}from"./mana-convert-DVF4taBh.js";import{u as jt}from"./useManaRate-iYCZTzak.js";import{L as vt}from"./LoadMore-C4ahcKGI.js";import{u as f}from"./useInfiniteGrid-C6HwGwYR.js";import"./sentry-Dx-KuLV3.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers--abqWJu6.js";import"./intl-CBcMB1D2.js";import"./mana-rate-DghhfRg4.js";const kt=15e3;function wt(t,i){return t.txHash&&i.txHash?t.txHash===i.txHash:t.txHash||i.txHash?!1:t.status===i.status&&Math.abs(t.createdAt-i.createdAt)<=kt}function It(t){const i=[...t].sort((a,n)=>n.createdAt-a.createdAt),s=[];for(const a of i){const n=s[s.length-1];n&&wt(n[n.length-1],a)?n.push(a):s.push([a])}return s.map(a=>{var n;return{id:((n=a.find(c=>c.txHash))==null?void 0:n.txHash)??a[a.length-1].id,createdAt:Math.max(...a.map(c=>c.createdAt)),status:a.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:a.reduce((c,h)=>c+h.credits,0),lines:a}})}function At(t){const i=[],s=new Map;for(const a of t)if(a.tradeId){const n=s.get(a.tradeId);if(n){n.quantity+=1,n.credits+=a.credits;continue}const c={key:a.tradeId,tradeId:a.tradeId,quantity:1,credits:a.credits};s.set(a.tradeId,c),i.push(c)}else i.push({key:a.id,tradeId:null,quantity:1,credits:a.credits});return i}function $t(t,i){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:i?bt(t.manaWei,i):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Pt(t){const s=It(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),a=t.sales.map(r=>{const x=$t(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),n=(t.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(t.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),h=(t.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...s,...a,...n,...h].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Lt(t,i){return i==="all"?t:i==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const J=t=>t.trim().toLowerCase();function Nt(t){const i=new Map;for(const s of t??[]){const a=J(s.txHash??"");if(!a)continue;const n=i.get(a);n?n.push(s):i.set(a,[s])}return i}function Et(t,i,s=Date.now()){const a=i.txHash?t.get(J(i.txHash)):void 0;if(!a||a.length===0)return{kind:"direct"};const n=a.length===1?Tt(a[0].netCents):null,c=a.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:n};const h=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:n,availableAt:h}}function Tt(t){return lt(t)}const Ct="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/credits-product-vs4Q6u6l.svg",T=ut`
1
+ import{r as b,j as e,L as _,d as dt}from"./react-vyZjIDcS.js";import{aE as lt,s as l,t as o,w as ut,B as ht,l as xt,d,m as pt,u as j,I as g,aF as G,aG as R,aH as mt,y as v,aI as gt,al as E,z as Q,H as ft,aJ as yt,aK as X}from"./index-C9aPSlyC.js";import{m as bt}from"./mana-convert-519jIoGv.js";import{u as jt}from"./useManaRate-BrwJXTcH.js";import{L as vt}from"./LoadMore-EzzDujll.js";import{u as f}from"./useInfiniteGrid-_0aqBjgd.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CpLYx0ea.js";import"./intl-CBcMB1D2.js";import"./mana-rate-C-S8V8OH.js";const kt=15e3;function wt(t,i){return t.txHash&&i.txHash?t.txHash===i.txHash:t.txHash||i.txHash?!1:t.status===i.status&&Math.abs(t.createdAt-i.createdAt)<=kt}function It(t){const i=[...t].sort((a,n)=>n.createdAt-a.createdAt),s=[];for(const a of i){const n=s[s.length-1];n&&wt(n[n.length-1],a)?n.push(a):s.push([a])}return s.map(a=>{var n;return{id:((n=a.find(c=>c.txHash))==null?void 0:n.txHash)??a[a.length-1].id,createdAt:Math.max(...a.map(c=>c.createdAt)),status:a.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:a.reduce((c,h)=>c+h.credits,0),lines:a}})}function At(t){const i=[],s=new Map;for(const a of t)if(a.tradeId){const n=s.get(a.tradeId);if(n){n.quantity+=1,n.credits+=a.credits;continue}const c={key:a.tradeId,tradeId:a.tradeId,quantity:1,credits:a.credits};s.set(a.tradeId,c),i.push(c)}else i.push({key:a.id,tradeId:null,quantity:1,credits:a.credits});return i}function $t(t,i){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:i?bt(t.manaWei,i):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Pt(t){const s=It(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),a=t.sales.map(r=>{const x=$t(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),n=(t.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(t.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),h=(t.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...s,...a,...n,...h].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Lt(t,i){return i==="all"?t:i==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const J=t=>t.trim().toLowerCase();function Nt(t){const i=new Map;for(const s of t??[]){const a=J(s.txHash??"");if(!a)continue;const n=i.get(a);n?n.push(s):i.set(a,[s])}return i}function Et(t,i,s=Date.now()){const a=i.txHash?t.get(J(i.txHash)):void 0;if(!a||a.length===0)return{kind:"direct"};const n=a.length===1?Tt(a[0].netCents):null,c=a.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:n};const h=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:n,availableAt:h}}function Tt(t){return lt(t)}const Ct="https://cdn.decentraland.org/@dcl/shop/0.1.0-30497598696.commit-4ea1dde/assets/credits-product-vs4Q6u6l.svg",T=ut`
2
2
  0% { background-position: 200% 0; }
3
3
  100% { background-position: -200% 0; }
4
4
  `,Ft=l.section`
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-BYHuwl8r.js";import{s as u}from"./index-DQ6JWiqD.js";import"./sentry-Dx-KuLV3.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers--abqWJu6.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-vyZjIDcS.js";import{s as u}from"./index-C9aPSlyC.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CpLYx0ea.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30497598696.commit-4ea1dde/assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.1.0-30497598696.commit-4ea1dde/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{b as ze,r as m,j as e,u as Ve}from"./react-BYHuwl8r.js";import{c as B,aq as Ze,ar as Ke,b as Je,s as n,t,m as Ie,ai as Qe,D as Xe,H as Ae,x as Ye,d as s,I as R,y as W,aN as he,an as J,au as et,at as tt,l as Ne,n as nt,S as fe,A as O,aO as st,aP as ot}from"./index-DQ6JWiqD.js";import{u as it}from"./useSecondarySales-BTqJsuhI.js";import{a as rt,m as Me}from"./mana-convert-DVF4taBh.js";import{u as Pe}from"./useManaRate-iYCZTzak.js";import{g as at,h as lt,i as ct,j as dt,k as pt,C as xt,l as ht,o as ft,m as mt,n as ut,M as gt,p as bt,E as yt,q as wt,r as jt,s as vt,t as $t,u as Ct,v as kt}from"./Assets.styles-BVt9ny1H.js";import{c as me,R as St,F as Et,S as Rt}from"./categories-5tCT8xWh.js";import{L as Tt}from"./LoadMore-C4ahcKGI.js";import{u as _t}from"./useInfiniteGrid-C6HwGwYR.js";import{E as zt}from"./ErrorNotice-CCmfdXO-.js";import{d as It}from"./dcl-schemas-BICTSpB5.js";import{s as At,G as Nt,w as Mt,S as Pt}from"./buy-gasless-BS7n5_qI.js";import{s as Wt}from"./buy-BYXdfz24.js";import{i as Bt}from"./trade-encoding-BTpnbAqu.js";import{r as Ft}from"./mana-rate-DghhfRg4.js";import{f as Lt}from"./errors-DLr34B3-.js";import{J as Ht,C as Ut,B as ee}from"./ethers--abqWJu6.js";import{l as Ot}from"./loader-logo-BzY9EKdC.js";import{n as Dt}from"./Tooltip-C7o9WgVx.js";import{G as Gt}from"./grid.styles-Cw26IyBx.js";import"./sentry-Dx-KuLV3.js";import"./intl-CBcMB1D2.js";import"./authorizations-93IYCFGd.js";import"./sendMetaTransaction-BjStTgy8.js";function D(o){const i=o.source??"item",l=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${l}`}const F="100000000000000000000",We=2,Q=15,qt=/^[a-zA-Z0-9]+$/;function ue(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:qt.test(i)?i.length<We?{ok:!1,reason:"too-short"}:i.length>Q?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Vt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,Q)}const Zt=["function available(string _subdomain) view returns (bool)"],ge={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Kt(){return B.chainId===Number(It.ChainId.MATIC_MAINNET)?ge.mainnet:ge.sepolia}async function Jt(o,i={}){var p;const{rpc:l,address:x}=Kt(),c=new Ht(l),d=new Ut(x,Zt,c);console.info(`[names] availability check → DCLRegistrar(${x}).available("${o}") on ${l}`);const h=await d.available(o);if((p=i.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${h}`),h?"available":"taken"}const Qt="https://app.across.to/api";class Be extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function Xt(o){return rt(F,o)}async function Yt(o,i,l={}){var p;const x=l.chainId??B.chainId,c=l.provider??"across",d=`${B.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${x}&provider=${c}`,h=await Je(d,{method:"GET",identity:o,metadata:{}});if(!h.ok){let a;try{a=(p=await h.json())==null?void 0:p.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Be:new Error(`fetchNameCreditRoute ${h.status}`)}return h.json()}function en(o,i){const l=ee.from(o.availableAmount),c=ee.from(F).sub(l);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Bt(o.id)}],creditsSignatures:[o.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:c.isNegative()?"0":c.toString(),maxCreditedValue:F}}async function tn(o,i={}){const l=Qt,x=i.intervalMs??1e4,c=i.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let h=0;h<c;h++){try{const p=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${o}`);if(p.ok){const a=await p.json(),u=(a.status??"pending").toLowerCase(),b=a.fillTx??a.fillTxnRef??null,w=a.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:b,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:b,actionsSucceeded:w}}}catch{}h<c-1&&await new Promise(p=>setTimeout(p,x))}return d}async function nn(o){const{name:i,identity:l,signer:x}=o,c=o.chainId??B.chainId,d=o.provider??"across",h=(o.beneficiary??await x.getAddress()).toLowerCase();let p=null,a=!1;console.info("[names] register start",{name:i,buyer:h,chainId:c,provider:d});try{const u=await Ft(c),b=Xt(u);console.info("[names] step 1/6 sized reservation",{usdCents:b,manaRate:u});const w=await Yt(l,i,{chainId:c,provider:d});console.info("[names] step 2/6 route fetched",{target:w.externalCall.target,selector:w.externalCall.selector,provider:w.provider,quoteId:w.quoteId});const j=await Ze(l,b);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),ee.from(j.maxCreditedValue).lt(F))throw new Error("Credit under-sized for the name price");const $=en(j.credit,w);let f;try{f=await At({chainId:c,buyer:h,signer:x,args:$})}catch(y){if(!(y instanceof Nt))throw y;f=await Wt(c,$,x)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Mt(f),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const y=await tn(f,o.acrossPoll);if(console.info("[names] step 6/6 across status",y),y.status==="pending")return{status:"pending",originTxHash:f};if(y.status!=="filled"||!y.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:y.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:i,buyer:h,originConfirmed:a}),u instanceof Pt)return{status:"pending",originTxHash:u.txHash};if(p&&!a&&await Ke(l,[p]).catch(()=>{}),u instanceof Be)throw u;const b=new Error(Lt(u,"Couldn't register the name. Please try again.",{sale:!0}));throw b.cause=u,b}}const sn=n.div`
1
+ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,aq as Ze,ar as Ke,b as Je,s as n,t,m as Ie,ai as Qe,D as Xe,H as Ae,x as Ye,d as s,I as R,y as W,aN as he,an as J,au as et,at as tt,l as Ne,n as nt,S as fe,A as O,aO as st,aP as ot}from"./index-C9aPSlyC.js";import{u as it}from"./useSecondarySales-zW-UzRs8.js";import{a as rt,m as Me}from"./mana-convert-519jIoGv.js";import{u as Pe}from"./useManaRate-BrwJXTcH.js";import{g as at,h as lt,i as ct,j as dt,k as pt,C as xt,l as ht,o as ft,m as mt,n as ut,M as gt,p as bt,E as yt,q as wt,r as jt,s as vt,t as $t,u as Ct,v as kt}from"./Assets.styles-BlqCpVPA.js";import{c as me,R as St,F as Et,S as Rt}from"./categories-BtM8_SSI.js";import{L as Tt}from"./LoadMore-EzzDujll.js";import{u as _t}from"./useInfiniteGrid-_0aqBjgd.js";import{E as zt}from"./ErrorNotice-T3U1x2gM.js";import{d as It}from"./dcl-schemas-BICTSpB5.js";import{s as At,G as Nt,w as Mt,S as Pt}from"./buy-gasless-Ce5WXr0l.js";import{s as Wt}from"./buy-KTMkFDbF.js";import{i as Bt}from"./trade-encoding-BwYos8Ms.js";import{r as Ft}from"./mana-rate-C-S8V8OH.js";import{f as Lt}from"./errors-JUBkzG87.js";import{J as Ht,C as Ut,B as ee}from"./ethers-CpLYx0ea.js";import{l as Ot}from"./loader-logo-BzY9EKdC.js";import{n as Dt}from"./Tooltip-DaxPnuDE.js";import{G as Gt}from"./grid.styles-beZx-O42.js";import"./sentry-B35L1FdR.js";import"./intl-CBcMB1D2.js";import"./authorizations-Dz891X4r.js";import"./sendMetaTransaction-Dgxdo_cy.js";function D(o){const i=o.source??"item",l=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${l}`}const F="100000000000000000000",We=2,Q=15,qt=/^[a-zA-Z0-9]+$/;function ue(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:qt.test(i)?i.length<We?{ok:!1,reason:"too-short"}:i.length>Q?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Vt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,Q)}const Zt=["function available(string _subdomain) view returns (bool)"],ge={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Kt(){return B.chainId===Number(It.ChainId.MATIC_MAINNET)?ge.mainnet:ge.sepolia}async function Jt(o,i={}){var p;const{rpc:l,address:x}=Kt(),c=new Ht(l),d=new Ut(x,Zt,c);console.info(`[names] availability check → DCLRegistrar(${x}).available("${o}") on ${l}`);const h=await d.available(o);if((p=i.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${h}`),h?"available":"taken"}const Qt="https://app.across.to/api";class Be extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function Xt(o){return rt(F,o)}async function Yt(o,i,l={}){var p;const x=l.chainId??B.chainId,c=l.provider??"across",d=`${B.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${x}&provider=${c}`,h=await Je(d,{method:"GET",identity:o,metadata:{}});if(!h.ok){let a;try{a=(p=await h.json())==null?void 0:p.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Be:new Error(`fetchNameCreditRoute ${h.status}`)}return h.json()}function en(o,i){const l=ee.from(o.availableAmount),c=ee.from(F).sub(l);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Bt(o.id)}],creditsSignatures:[o.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:c.isNegative()?"0":c.toString(),maxCreditedValue:F}}async function tn(o,i={}){const l=Qt,x=i.intervalMs??1e4,c=i.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let h=0;h<c;h++){try{const p=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${o}`);if(p.ok){const a=await p.json(),u=(a.status??"pending").toLowerCase(),b=a.fillTx??a.fillTxnRef??null,w=a.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:b,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:b,actionsSucceeded:w}}}catch{}h<c-1&&await new Promise(p=>setTimeout(p,x))}return d}async function nn(o){const{name:i,identity:l,signer:x}=o,c=o.chainId??B.chainId,d=o.provider??"across",h=(o.beneficiary??await x.getAddress()).toLowerCase();let p=null,a=!1;console.info("[names] register start",{name:i,buyer:h,chainId:c,provider:d});try{const u=await Ft(c),b=Xt(u);console.info("[names] step 1/6 sized reservation",{usdCents:b,manaRate:u});const w=await Yt(l,i,{chainId:c,provider:d});console.info("[names] step 2/6 route fetched",{target:w.externalCall.target,selector:w.externalCall.selector,provider:w.provider,quoteId:w.quoteId});const j=await Ze(l,b);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),ee.from(j.maxCreditedValue).lt(F))throw new Error("Credit under-sized for the name price");const $=en(j.credit,w);let f;try{f=await At({chainId:c,buyer:h,signer:x,args:$})}catch(y){if(!(y instanceof Nt))throw y;f=await Wt(c,$,x)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Mt(f),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const y=await tn(f,o.acrossPoll);if(console.info("[names] step 6/6 across status",y),y.status==="pending")return{status:"pending",originTxHash:f};if(y.status!=="filled"||!y.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:y.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:i,buyer:h,originConfirmed:a}),u instanceof Pt)return{status:"pending",originTxHash:u.txHash};if(p&&!a&&await Ke(l,[p]).catch(()=>{}),u instanceof Be)throw u;const b=new Error(Lt(u,"Couldn't register the name. Please try again.",{sale:!0}));throw b.cause=u,b}}const sn=n.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -366,7 +366,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-BYHuwl8r.js";import{c as B,aq
366
366
  flex: none;
367
367
  color: ${t.colors.dclRed};
368
368
  }
369
- `;function Sn({name:o,priceCredits:i,onClose:l}){const{session:x}=Ie(),{data:c,isError:d}=Qe(x),h=Xe(),p=ze(),[a,u]=m.useState("confirm"),[b,w]=m.useState(""),[j,$]=m.useState(null),f=m.useRef(!1),y=b.trim().toLowerCase()===o.toLowerCase(),v=a==="completing",k=i!=null?Ae(i):"—";m.useEffect(()=>{const g=T=>{T.key==="Escape"&&!v&&l()};document.addEventListener("keydown",g);const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=I}},[v,l]);async function C(){if(!(!x||!y||f.current)){f.current=!0,u("completing"),$(null);try{await nn({name:o,identity:x.identity,signer:x.signer}),J("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),h.invalidateQueries({queryKey:["usd-balance"]}),h.invalidateQueries({queryKey:["my-assets"]}),u("success")}catch(g){J(tt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:et(g),purchase_type:"name"}),$((g==null?void 0:g.message)||s("names.errorGeneric")),u("error")}finally{f.current=!1}}}const z=a!=="success",E=Ye(x==null?void 0:x.providerType);return e.jsx(sn,{onClick:v?void 0:l,role:"presentation",children:e.jsxs(on,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:a==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(we,{onClick:l,disabled:v,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(kn,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Te,{onClick:()=>u("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(rn,{children:[e.jsx(an,{children:s("names.confirmTitle")}),e.jsx(ln,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${En(o)}</b>`})}}),e.jsxs(cn,{children:[e.jsx(dn,{"aria-hidden":!0,children:"@"}),e.jsx(pn,{value:b,onChange:g=>w(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx(xn,{children:".dcl.eth"})]})]}),e.jsx(Te,{onClick:()=>void C(),disabled:!y||!x,children:s("names.buyCta")})]})]}),a==="completing"&&e.jsxs(hn,{children:[e.jsx(fn,{src:Ot,alt:"",width:56,height:56}),e.jsx(mn,{children:E?s("names.confirming"):s("names.completing")}),e.jsxs(un,{children:[e.jsx(gn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(bn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:s("names.successHeaderTitle")}),e.jsx(we,{onClick:l,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{}),e.jsxs(yn,{children:[e.jsx(wn,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(jn,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs($e,{style:{marginTop:20},children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),e.jsxs(vn,{children:[e.jsx($n,{onClick:()=>{l(),p("/my-assets")},children:s("names.myItems")}),e.jsx(Cn,{href:B.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function En(o){return o.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Rn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/identity-B4DXDuJP.webp",Tn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/world-B-9aPlxu.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/invite-BfwIhP2C.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/governance-DnazlIjy.webp",In=n.div`
369
+ `;function Sn({name:o,priceCredits:i,onClose:l}){const{session:x}=Ie(),{data:c,isError:d}=Qe(x),h=Xe(),p=ze(),[a,u]=m.useState("confirm"),[b,w]=m.useState(""),[j,$]=m.useState(null),f=m.useRef(!1),y=b.trim().toLowerCase()===o.toLowerCase(),v=a==="completing",k=i!=null?Ae(i):"—";m.useEffect(()=>{const g=T=>{T.key==="Escape"&&!v&&l()};document.addEventListener("keydown",g);const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=I}},[v,l]);async function C(){if(!(!x||!y||f.current)){f.current=!0,u("completing"),$(null);try{await nn({name:o,identity:x.identity,signer:x.signer}),J("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),h.invalidateQueries({queryKey:["usd-balance"]}),h.invalidateQueries({queryKey:["my-assets"]}),u("success")}catch(g){J(tt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:et(g),purchase_type:"name"}),$((g==null?void 0:g.message)||s("names.errorGeneric")),u("error")}finally{f.current=!1}}}const z=a!=="success",E=Ye(x==null?void 0:x.providerType);return e.jsx(sn,{onClick:v?void 0:l,role:"presentation",children:e.jsxs(on,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:a==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(we,{onClick:l,disabled:v,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(kn,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Te,{onClick:()=>u("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(rn,{children:[e.jsx(an,{children:s("names.confirmTitle")}),e.jsx(ln,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${En(o)}</b>`})}}),e.jsxs(cn,{children:[e.jsx(dn,{"aria-hidden":!0,children:"@"}),e.jsx(pn,{value:b,onChange:g=>w(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx(xn,{children:".dcl.eth"})]})]}),e.jsx(Te,{onClick:()=>void C(),disabled:!y||!x,children:s("names.buyCta")})]})]}),a==="completing"&&e.jsxs(hn,{children:[e.jsx(fn,{src:Ot,alt:"",width:56,height:56}),e.jsx(mn,{children:E?s("names.confirming"):s("names.completing")}),e.jsxs(un,{children:[e.jsx(gn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(bn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:s("names.successHeaderTitle")}),e.jsx(we,{onClick:l,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{}),e.jsxs(yn,{children:[e.jsx(wn,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(jn,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs($e,{style:{marginTop:20},children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),e.jsxs(vn,{children:[e.jsx($n,{onClick:()=>{l(),p("/my-assets")},children:s("names.myItems")}),e.jsx(Cn,{href:B.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function En(o){return o.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Rn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30497598696.commit-4ea1dde/assets/identity-B4DXDuJP.webp",Tn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30497598696.commit-4ea1dde/assets/world-B-9aPlxu.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.1.0-30497598696.commit-4ea1dde/assets/invite-BfwIhP2C.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30497598696.commit-4ea1dde/assets/governance-DnazlIjy.webp",In=n.div`
370
370
  width: 100%;
371
371
  min-width: 0;
372
372
  `,An=n.nav`
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-BYHuwl8r.js";import{R as C,a as oe,C as ie,b as ne}from"./categories-5tCT8xWh.js";import{n as c,T as se}from"./Tooltip-C7o9WgVx.js";import{t as e,s as o,I as g,d as s,n as ae,e as v}from"./index-DQ6JWiqD.js";const re=o.div`
1
+ import{r as $,j as t}from"./react-vyZjIDcS.js";import{R as C,a as oe,C as ie,b as ne}from"./categories-BtM8_SSI.js";import{n as c,T as se}from"./Tooltip-DaxPnuDE.js";import{t as e,s as o,I as g,d as s,n as ae,e as v}from"./index-C9aPSlyC.js";const re=o.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -367,7 +367,7 @@ import{r as $,j as t}from"./react-BYHuwl8r.js";import{R as C,a as oe,C as ie,b a
367
367
  height: 18px;
368
368
  left: ${({on:i})=>i?"calc(100% - 18px)":"2px"};
369
369
  }
370
- `,d=1e5;function Ae(i){var l;for(const h of ie){const p=(l=h.subs)==null?void 0:l.find(a=>a.key===i);if(p)return s(p.labelKey)}return i}function j({title:i,open:l,onToggle:h,summary:p,desktopStatic:a,headerTestId:x,headerAria:f,children:u}){const m=t.jsx(ne,{up:l,size:24,color:e.colors.text});return t.jsxs(le,{children:[t.jsxs(ce,{type:"button",desktopStatic:a,onClick:h,"aria-expanded":l,"aria-label":f,"data-testid":x,children:[t.jsx(de,{children:i}),a?t.jsx(pe,{children:m}):m]}),!l&&p?t.jsx(xe,{desktopHidden:a,children:p}):null,t.jsx(he,{open:l,desktopStatic:a,children:t.jsx(me,{children:u})})]})}function Oe({category:i,subCategory:l,onCategory:h,onSub:p,priceMin:a,priceMax:x,onPriceMin:f,onPriceMax:u,rarities:m,onToggleRarity:H,status:S,onStatus:B,smart:b,onSmart:D}){const[L,O]=$.useState(!0),[_,M]=$.useState(!0),[Y,K]=$.useState(!1),[U,q]=$.useState(!0),R=a&&!Number.isNaN(Number(a))?Number(a):void 0,z=x&&!Number.isNaN(Number(x))?Number(x):void 0,w=R!=null?Math.min(R,d):0,y=z!=null?Math.min(z,d):d,G=w/d*100,V=y/d*100;function X(n){const r=Math.min(n,y);f(r<=0?"":String(r))}function J(n){const r=Math.max(n,w);u(r>=d?"":String(r))}const Q=l?Ae(l):i!=="wearable"?s(`categories.${i==="emote"?"emotes":i==="all"?"shopAll":i}`):"",Z=R!=null||z!=null?`${a||"0"}-${x||"∞"}`:"",ee=C.filter(n=>m.includes(n)).map(ae).join(", "),te=S==="on_sale"?s("filter.onSale"):S==="not_for_sale"?s("filter.notForSale"):"";return t.jsxs(re,{children:[t.jsx(j,{title:s("assets.category"),open:L,onToggle:()=>O(n=>!n),summary:Q,desktopStatic:!0,children:t.jsx(oe,{category:i,subCategory:l,onCategory:h,onSub:p})}),t.jsx(k,{}),t.jsxs(j,{title:s("filter.price"),open:_,onToggle:()=>M(n=>!n),summary:Z,desktopStatic:!0,children:[t.jsxs(ge,{children:[t.jsxs(T,{children:[t.jsx(W,{children:s("assets.min")}),t.jsxs(N,{children:[t.jsx(P,{name:v.iconName,"aria-hidden":!0}),t.jsx(F,{type:"number",min:"0","aria-label":s("assets.minPriceAria"),placeholder:"0",value:a,onChange:n=>f(n.target.value)})]})]}),t.jsx(fe,{children:s("assets.priceTo")}),t.jsxs(T,{children:[t.jsx(W,{children:s("assets.max")}),t.jsxs(N,{children:[t.jsx(P,{name:v.iconName,"aria-hidden":!0}),t.jsx(F,{type:"number",min:"0","aria-label":s("assets.maxPriceAria"),placeholder:"0",value:x,onChange:n=>u(n.target.value)})]})]})]}),t.jsxs(ue,{children:[t.jsx(be,{"aria-hidden":!0}),t.jsx(we,{minPct:G,maxPct:V,"aria-hidden":!0}),t.jsx(E,{type:"range",min:0,max:d,value:w,"aria-label":s("assets.minPriceSliderAria"),onChange:n=>X(Number(n.target.value))}),t.jsx(E,{type:"range",min:0,max:d,value:y,"aria-label":s("assets.maxPriceSliderAria"),onChange:n=>J(Number(n.target.value))})]}),t.jsxs(ye,{children:[t.jsxs(I,{children:[t.jsx(A,{name:v.iconName,"aria-hidden":!0}),w.toLocaleString()]}),t.jsxs(I,{children:[t.jsx(A,{name:v.iconName,"aria-hidden":!0}),y.toLocaleString()]})]})]}),t.jsx(k,{}),t.jsx(j,{title:s("assets.rarity"),open:Y,onToggle:()=>K(n=>!n),summary:ee,headerTestId:"sidebar-section-toggle",children:t.jsx($e,{"data-testid":"rarity-filter",children:C.map(n=>{const r=m.includes(n);return t.jsxs(ve,{type:"button",selected:r,"aria-pressed":r,onClick:()=>H(n),"data-testid":"rarity-filter-check",children:[t.jsx(ke,{color:e.rarities[n],children:r?t.jsx(je,{name:"check","aria-hidden":!0}):null}),t.jsx(Se,{selected:r,children:n})]},n)})})}),t.jsx(k,{}),t.jsx(j,{title:s("filter.status"),open:U,onToggle:()=>q(n=>!n),summary:te,children:[["all",s("filter.statusAll")],["on_sale",s("filter.onSale")],["not_for_sale",s("filter.notForSale")]].map(([n,r])=>t.jsxs(Re,{children:[t.jsx(ze,{type:"radio",name:"shop-status",checked:S===n,onChange:()=>B(n)}),t.jsx(Ce,{children:r})]},n))}),t.jsx(k,{}),t.jsxs(Te,{children:[t.jsxs(We,{children:[t.jsx(Ne,{name:"smart","aria-hidden":!0}),t.jsx(Pe,{children:s("filter.smart")}),t.jsx(se,{content:s("filter.smartHint"),placement:"bottom",children:t.jsx(Fe,{name:"info",role:"img","aria-label":s("filter.smartHint"),tabIndex:0})})]}),t.jsx(Ee,{type:"button",role:"switch",on:b,"aria-checked":b,"aria-label":s("filter.smart"),onClick:()=>D(!b),children:t.jsx(Ie,{on:b})})]})]})}const _e=o.div`
370
+ `,d=1e5;function Ae(i){var l;for(const h of ie){const p=(l=h.subs)==null?void 0:l.find(a=>a.key===i);if(p)return s(p.labelKey)}return i}function j({title:i,open:l,onToggle:h,summary:p,desktopStatic:a,headerTestId:x,headerAria:f,children:u}){const m=t.jsx(ne,{up:l,size:24,color:e.colors.text});return t.jsxs(le,{children:[t.jsxs(ce,{type:"button",desktopStatic:a,onClick:h,"aria-expanded":l,"aria-label":f,"data-testid":x,children:[t.jsx(de,{children:i}),a?t.jsx(pe,{children:m}):m]}),!l&&p?t.jsx(xe,{desktopHidden:a,children:p}):null,t.jsx(he,{open:l,desktopStatic:a,children:t.jsx(me,{children:u})})]})}function Oe({category:i,subCategory:l,onCategory:h,onSub:p,priceMin:a,priceMax:x,onPriceMin:f,onPriceMax:u,rarities:m,onToggleRarity:H,status:S,onStatus:B,smart:b,onSmart:D}){const[L,O]=$.useState(!0),[_,M]=$.useState(!0),[Y,K]=$.useState(!1),[U,q]=$.useState(!0),R=a&&!Number.isNaN(Number(a))?Number(a):void 0,z=x&&!Number.isNaN(Number(x))?Number(x):void 0,w=R!=null?Math.min(R,d):0,y=z!=null?Math.min(z,d):d,G=w/d*100,V=y/d*100;function X(n){const r=Math.min(n,y);f(r<=0?"":String(r))}function J(n){const r=Math.max(n,w);u(r>=d?"":String(r))}const Q=l?Ae(l):i!=="wearable"?s(`categories.${i==="emote"?"emotes":i==="all"?"shopAll":i}`):"",Z=R!=null||z!=null?`${a||"0"}-${x||"∞"}`:"",ee=C.filter(n=>m.includes(n)).map(ae).join(", "),te=S==="on_sale"?s("filter.onSale"):S==="not_for_sale"?s("filter.notForSale"):"";return t.jsxs(re,{children:[t.jsx(j,{title:s("assets.category"),open:L,onToggle:()=>O(n=>!n),summary:Q,desktopStatic:!0,children:t.jsx(oe,{category:i,subCategory:l,onCategory:h,onSub:p})}),t.jsx(k,{}),t.jsxs(j,{title:s("filter.price"),open:_,onToggle:()=>M(n=>!n),summary:Z,desktopStatic:!0,children:[t.jsxs(ge,{children:[t.jsxs(T,{children:[t.jsx(W,{children:s("assets.min")}),t.jsxs(N,{children:[t.jsx(P,{name:v.iconName,"aria-hidden":!0}),t.jsx(F,{type:"number",min:"0","aria-label":s("assets.minPriceAria"),placeholder:"0",value:a,onChange:n=>f(n.target.value)})]})]}),t.jsx(fe,{children:s("assets.priceTo")}),t.jsxs(T,{children:[t.jsx(W,{children:s("assets.max")}),t.jsxs(N,{children:[t.jsx(P,{name:v.iconName,"aria-hidden":!0}),t.jsx(F,{type:"number",min:"0","aria-label":s("assets.maxPriceAria"),placeholder:"0",value:x,onChange:n=>u(n.target.value)})]})]})]}),t.jsxs(ue,{children:[t.jsx(be,{"aria-hidden":!0}),t.jsx(we,{minPct:G,maxPct:V,"aria-hidden":!0}),t.jsx(E,{type:"range",min:0,max:d,value:w,"aria-label":s("assets.minPriceSliderAria"),onChange:n=>X(Number(n.target.value))}),t.jsx(E,{type:"range",min:0,max:d,value:y,"aria-label":s("assets.maxPriceSliderAria"),onChange:n=>J(Number(n.target.value))})]}),t.jsxs(ye,{children:[t.jsxs(I,{children:[t.jsx(A,{name:v.iconName,"aria-hidden":!0}),w.toLocaleString()]}),t.jsxs(I,{children:[t.jsx(A,{name:v.iconName,"aria-hidden":!0}),y.toLocaleString()]})]})]}),t.jsx(k,{}),t.jsx(j,{title:s("assets.rarity"),open:Y,onToggle:()=>K(n=>!n),summary:ee,headerTestId:"sidebar-section-toggle",children:t.jsx($e,{"data-testid":"rarity-filter",children:C.map(n=>{const r=m.includes(n);return t.jsxs(ve,{type:"button",selected:r,"aria-pressed":r,onClick:()=>H(n),"data-testid":"rarity-filter-check",children:[t.jsx(ke,{color:e.rarities[n],children:r?t.jsx(je,{name:"check","aria-hidden":!0}):null}),t.jsx(Se,{selected:r,children:n})]},n)})})}),t.jsx(k,{}),t.jsx(j,{title:s("filter.status"),open:U,onToggle:()=>q(n=>!n),summary:te,children:[["all",s("filter.statusAll")],["on_sale",s("filter.onSale")],["not_for_sale",s("filter.notForSale")]].map(([n,r])=>t.jsxs(Re,{children:[t.jsx(ze,{type:"radio",name:"shop-status",checked:S===n,onChange:()=>B(n)}),t.jsx(Ce,{children:r})]},n))}),t.jsx(k,{}),t.jsxs(Te,{children:[t.jsxs(We,{children:[t.jsx(Ne,{name:"smart","aria-hidden":!0}),t.jsx(Pe,{children:s("filter.smart")}),t.jsx(se,{content:s("filter.smartHint"),placement:"bottom",children:t.jsx(Fe,{name:"info",role:"img","aria-label":s("filter.smartHint"),tabIndex:0,"data-testid":"smart-hint"})})]}),t.jsx(Ee,{type:"button",role:"switch",on:b,"aria-checked":b,"aria-label":s("filter.smart"),onClick:()=>D(!b),children:t.jsx(Ie,{on:b})})]})]})}const _e=o.div`
371
371
  position: relative;
372
372
  display: flex;
373
373
  gap: 32px;
@@ -1,4 +1,4 @@
1
- import{j as t,L as q,r as M}from"./react-BYHuwl8r.js";import{s as a,B as N,t as o,w as I,l as B,d as e,m as F,x as W,I as f,y as G,z as K,u as w,D as P,c as Q,E as k,k as H,o as $}from"./index-DQ6JWiqD.js";import{a as O,b as _,c as X,d as J,s as U,f as V}from"./authorizations-93IYCFGd.js";import{a as Y}from"./builder-BxP8tT4f.js";import{f as Z}from"./errors-DLr34B3-.js";import"./sentry-Dx-KuLV3.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers--abqWJu6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BjStTgy8.js";const tt=I`
1
+ import{j as t,L as q,r as M}from"./react-vyZjIDcS.js";import{s as a,B as N,t as o,w as I,l as B,d as e,m as F,x as W,I as f,y as G,z as K,u as w,D as P,c as Q,E as k,k as H,o as $}from"./index-C9aPSlyC.js";import{a as O,b as _,c as X,d as J,s as U,f as V}from"./authorizations-Dz891X4r.js";import{a as Y}from"./builder-Di_i0uie.js";import{f as Z}from"./errors-JUBkzG87.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CpLYx0ea.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-Dgxdo_cy.js";const tt=I`
2
2
  to { transform: rotate(360deg); }
3
3
  `,it=I`
4
4
  to { background-position: -200% 0; }
@@ -1,4 +1,4 @@
1
- import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-BYHuwl8r.js";import{t as ee,s as i,d as a,H as Z,F as Qt,I as R,y as xt,G as ze,l as Kt,ah as q,O as Ze,m as Ut,u as Ot,ai as Ht,D as Vt,aj as Dt,ak as Gt,al as Yt,x as Jt,am as et,an as Q,ao as tt,ap as Xt,k as V,c as at,e as Zt,aq as st,ar as we,as as ke,at as ce,au as nt,g as le,a as ea,C as $e,av as ta}from"./index-DQ6JWiqD.js";import{M as aa,S as sa,C as na,H as ia,a as ra,T as oa,X as ca,b as la,B as da,c as ua,d as it,e as ha,f as pe,P as gt,m as mt,g as pa,h as xa,i as ga,j as ft,k as xe,L as ma,l as fa,n as rt,o as ot,W as ya,p as ba,q as va,A as Ca,r as ja,s as wa,t as ka,u as $a,v as Sa,w as Ma,x as Ta,y as Pa,z as za,D as Aa,E as Ia,F as qa,G as Ra,I as _a,J as Ba,K as Se,N as Ea,O as Fa,Q as Wa,R as La,U as ct,V as Na,Y as Qa,Z as Ka,_ as Ua}from"./CollectionCarousel-cAnwcIFc.js";import{u as Oa}from"./useManaRate-iYCZTzak.js";import{r as Ha}from"./mana-rate-DghhfRg4.js";import{i as Va,j as Da,f as Ga,n as Ya,h as Ja,A as Xa}from"./authorizations-93IYCFGd.js";import{b as Me}from"./buy-BYXdfz24.js";import{b as Za,w as es,S as ts,G as as}from"./buy-gasless-BS7n5_qI.js";import{u as ss,M as ns,R as de,r as is,c as rs}from"./useCreditPacks-B4TLB8Ir.js";import{l as os}from"./loader-logo-BzY9EKdC.js";import{i as cs,a as ls}from"./errors-DLr34B3-.js";import{E as ds}from"./ErrorNotice-CCmfdXO-.js";import{u as lt}from"./mana-convert-DVF4taBh.js";import"./sentry-Dx-KuLV3.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers--abqWJu6.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BTpnbAqu.js";import"./sendMetaTransaction-BjStTgy8.js";const{colors:D,radius:us}=ee,hs=i.div`
1
+ import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-vyZjIDcS.js";import{t as ee,s as i,d as a,H as Z,F as Qt,I as R,y as xt,G as ze,l as Kt,ah as q,O as Ze,m as Ut,u as Ot,ai as Ht,D as Vt,aj as Dt,ak as Gt,al as Yt,x as Jt,am as et,an as Q,ao as tt,ap as Xt,k as V,c as at,e as Zt,aq as st,ar as je,as as ke,at as ce,au as nt,g as le,a as ea,C as $e,av as ta}from"./index-C9aPSlyC.js";import{M as aa,S as sa,C as na,H as ia,a as ra,T as oa,X as ca,b as la,B as da,c as ua,d as it,e as ha,f as pe,P as gt,m as mt,g as pa,h as xa,i as ga,j as ft,k as xe,L as ma,l as fa,n as rt,o as ot,W as ya,p as ba,q as va,A as Ca,r as wa,s as ja,t as ka,u as $a,v as Sa,w as Ma,x as Ta,y as Pa,z as za,D as Aa,E as Ia,F as qa,G as Ra,I as _a,J as Ba,K as Se,N as Ea,O as Fa,Q as Wa,R as La,U as ct,V as Na,Y as Qa,Z as Ka,_ as Ua}from"./CollectionCarousel-MJIfHIAG.js";import{u as Oa}from"./useManaRate-BrwJXTcH.js";import{r as Ha}from"./mana-rate-C-S8V8OH.js";import{i as Va,j as Da,f as Ga,n as Ya,h as Ja,A as Xa}from"./authorizations-Dz891X4r.js";import{b as Me}from"./buy-KTMkFDbF.js";import{b as Za,w as es,S as ts,G as as}from"./buy-gasless-Ce5WXr0l.js";import{u as ss,M as ns,R as de,r as is,c as rs}from"./useCreditPacks-BN70ICff.js";import{l as os}from"./loader-logo-BzY9EKdC.js";import{i as cs,a as ls}from"./errors-JUBkzG87.js";import{E as ds}from"./ErrorNotice-T3U1x2gM.js";import{u as lt}from"./mana-convert-519jIoGv.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CpLYx0ea.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-BwYos8Ms.js";import"./sendMetaTransaction-Dgxdo_cy.js";const{colors:D,radius:us}=ee,hs=i.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -14,6 +14,11 @@ import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-BYHuwl8r.js";import{t
14
14
  display: flex;
15
15
  flex-direction: column;
16
16
  gap: 8px;
17
+ /* The list is the modal's elastic region: inside a viewport-capped card it gives up height first, so
18
+ the pack picker, total and Cancel/Buy below it stay on screen without scrolling. The floor is an
19
+ explicit ~one row because a scroll container's automatic minimum size is zero — it would otherwise
20
+ collapse to nothing on a short screen. */
21
+ min-height: 120px;
17
22
  max-height: 360px;
18
23
  overflow-y: auto;
19
24
  width: 100%;
@@ -53,7 +58,7 @@ import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-BYHuwl8r.js";import{t
53
58
  font-weight: 700;
54
59
  color: ${D.text};
55
60
  }
56
- `,fs="https://cdn.decentraland.org/@dcl/shop/0.1.0-30465483842.commit-35256d2/assets/buy-error-22UunaPC.png";function ys(c){const{phase:d,balanceCredits:k,onClose:T}=c,_=d==="processing",F=d==="error"?a("cartCheckout.errorTitle"):d==="nofunds"?a("cartCheckout.titleNoFunds"):d==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),W=d==="processing";return e.jsxs(aa,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(sa,{onClick:_?void 0:T,"aria-hidden":!0}),e.jsxs(na,{"data-tall":W||void 0,children:[e.jsxs(ia,{children:[e.jsxs(ra,{children:[e.jsx(oa,{children:F}),!_&&e.jsx(ca,{onClick:T,"aria-label":a("buyModal.close"),children:e.jsx(la,{})})]}),e.jsxs(da,{children:[e.jsx(ua,{children:d==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(it,{}),e.jsx(ha,{children:Z(k)})]})]}),d==="choose"&&e.jsxs(pe,{children:[e.jsxs(ms,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(it,{}),Z(c.totalCredits??0)]})]}),e.jsx(gt,{options:c.options??[],totalCents:c.totalCents??0,onPay:c.onPay??(()=>{}),rateNote:(()=>{const z=mt(c.totalCents??0,c.totalManaWei??0n);return z!=null?a("buyModal.manaRate",{mana:z.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),d==="processing"&&e.jsx(bs,{stage:c.stage??"reserving",step:c.step??1,total:c.total??1,isSelfCustody:!!c.isSelfCustody}),d==="nofunds"&&e.jsx(vs,{lines:c.lines??[],shortfallCredits:c.shortfallCredits??0,packs:c.packs??[],selectedPack:c.selectedPack??"",onSelectPack:c.onSelectPack??(()=>{}),onBuyPacks:c.onBuyPacks??(()=>{}),onCancel:T}),d==="error"&&e.jsxs(pe,{children:[e.jsxs(pa,{"data-testid":"buy-error",children:[e.jsx(xa,{src:fs,alt:"",width:64,height:80}),e.jsxs(ga,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs(ft,{children:[e.jsx(xe,{"data-variant":"outline",onClick:T,children:a("buyModal.cancel")}),e.jsx(xe,{"data-variant":"purple",onClick:c.onRetry??T,children:a("cartCheckout.tryAgain")})]})]})]})]})}function bs({stage:c,step:d,total:k,isSelfCustody:T}){const _=c==="reserving",F=k>0?Math.min(100,Math.round(d/k*100)):0,W=c==="awaiting-signature"?T?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):c==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(pe,{"data-processing":!0,children:[e.jsx(ma,{src:os,alt:"",width:61,height:61}),e.jsx(fa,{children:W}),_?e.jsxs(hs,{children:[e.jsx(rt,{"aria-hidden":!0,children:e.jsx(ot,{"data-step":!0,style:{width:`${F}%`}})}),k>1?e.jsxs(ps,{children:[d,"/",k]}):null]}):e.jsx(rt,{"aria-hidden":!0,children:e.jsx(ot,{})})]})}function vs({lines:c,shortfallCredits:d,packs:k,selectedPack:T,onSelectPack:_,onBuyPacks:F,onCancel:W}){const z=k.find(n=>n.id===T),me=c.reduce((n,I)=>n+(I.quantity??1),0);return e.jsxs(pe,{children:[e.jsxs(ya,{"data-testid":"nofunds-warning",children:[e.jsx(ba,{}),e.jsxs(va,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,d)})})," ",a("buyModal.warningToPurchase",{count:me})]})]}),e.jsx(xs,{children:c.map(n=>{const I=n.quantity??1;return e.jsxs(Ca,{children:[e.jsx(ja,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(wa,{children:[e.jsxs("div",{children:[e.jsxs(ka,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),I>1?e.jsx(gs,{children:a("cartCheckout.qty",{count:I})}):null]}),n.item.creator?e.jsx($a,{address:n.item.creator}):null]}),e.jsxs(Sa,{children:[e.jsx(Ma,{}),e.jsx("span",{children:Z(n.priceCredits*I)})]})]})]},n.item.id)})}),e.jsx(Ta,{children:k.map(n=>{const I=n.id===T;return e.jsxs(Pa,{"data-testid":"credit-pack","data-on":I||void 0,onClick:()=>_(n.id),children:[e.jsx(za,{}),e.jsx(Aa,{children:Z(n.credits)}),e.jsxs(Ia,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(qa,{children:[e.jsxs(Ra,{children:[e.jsx(_a,{}),e.jsx("span",{children:Z((z==null?void 0:z.credits)??0)})]}),e.jsxs(Ba,{children:["$",((z==null?void 0:z.usd)??0).toFixed(2)]})]}),e.jsxs(ft,{children:[e.jsx(xe,{"data-variant":"outline",onClick:W,children:a("buyModal.cancel")}),e.jsx(xe,{"data-variant":"gradient",onClick:F,children:a("buyModal.buy")})]})]})}const{colors:o,gradients:yt,radius:K}=ee,bt="@media (max-width: 1080px)",S="@media (max-width: 880px)",dt=i.div`
61
+ `,fs="https://cdn.decentraland.org/@dcl/shop/0.1.0-30497598696.commit-4ea1dde/assets/buy-error-22UunaPC.png";function ys(c){const{phase:d,balanceCredits:k,onClose:T}=c,_=d==="processing",F=d==="error"?a("cartCheckout.errorTitle"):d==="nofunds"?a("cartCheckout.titleNoFunds"):d==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),W=d==="processing";return e.jsxs(aa,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(sa,{onClick:_?void 0:T,"aria-hidden":!0}),e.jsxs(na,{"data-tall":W||void 0,children:[e.jsxs(ia,{children:[e.jsxs(ra,{children:[e.jsx(oa,{children:F}),!_&&e.jsx(ca,{onClick:T,"aria-label":a("buyModal.close"),children:e.jsx(la,{})})]}),e.jsxs(da,{children:[e.jsx(ua,{children:d==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(it,{}),e.jsx(ha,{children:Z(k)})]})]}),d==="choose"&&e.jsxs(pe,{children:[e.jsxs(ms,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(it,{}),Z(c.totalCredits??0)]})]}),e.jsx(gt,{options:c.options??[],totalCents:c.totalCents??0,onPay:c.onPay??(()=>{}),rateNote:(()=>{const z=mt(c.totalCents??0,c.totalManaWei??0n);return z!=null?a("buyModal.manaRate",{mana:z.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),d==="processing"&&e.jsx(bs,{stage:c.stage??"reserving",step:c.step??1,total:c.total??1,isSelfCustody:!!c.isSelfCustody}),d==="nofunds"&&e.jsx(vs,{lines:c.lines??[],shortfallCredits:c.shortfallCredits??0,packs:c.packs??[],selectedPack:c.selectedPack??"",onSelectPack:c.onSelectPack??(()=>{}),onBuyPacks:c.onBuyPacks??(()=>{}),onCancel:T}),d==="error"&&e.jsxs(pe,{children:[e.jsxs(pa,{"data-testid":"buy-error",children:[e.jsx(xa,{src:fs,alt:"",width:64,height:80}),e.jsxs(ga,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",a("cartCheckout.errorBody")]})]}),e.jsxs(ft,{children:[e.jsx(xe,{"data-variant":"outline",onClick:T,children:a("buyModal.cancel")}),e.jsx(xe,{"data-variant":"purple",onClick:c.onRetry??T,children:a("cartCheckout.tryAgain")})]})]})]})]})}function bs({stage:c,step:d,total:k,isSelfCustody:T}){const _=c==="reserving",F=k>0?Math.min(100,Math.round(d/k*100)):0,W=c==="awaiting-signature"?T?a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):c==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(pe,{"data-processing":!0,children:[e.jsx(ma,{src:os,alt:"",width:61,height:61}),e.jsx(fa,{children:W}),_?e.jsxs(hs,{children:[e.jsx(rt,{"aria-hidden":!0,children:e.jsx(ot,{"data-step":!0,style:{width:`${F}%`}})}),k>1?e.jsxs(ps,{children:[d,"/",k]}):null]}):e.jsx(rt,{"aria-hidden":!0,children:e.jsx(ot,{})})]})}function vs({lines:c,shortfallCredits:d,packs:k,selectedPack:T,onSelectPack:_,onBuyPacks:F,onCancel:W}){const z=k.find(n=>n.id===T),me=c.reduce((n,I)=>n+(I.quantity??1),0);return e.jsxs(pe,{children:[e.jsxs(ya,{"data-testid":"nofunds-warning",children:[e.jsx(ba,{}),e.jsxs(va,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,d)})})," ",a("buyModal.warningToPurchase",{count:me})]})]}),e.jsx(xs,{children:c.map(n=>{const I=n.quantity??1;return e.jsxs(Ca,{children:[e.jsx(wa,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(ja,{children:[e.jsxs("div",{children:[e.jsxs(ka,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),I>1?e.jsx(gs,{children:a("cartCheckout.qty",{count:I})}):null]}),n.item.creator?e.jsx($a,{address:n.item.creator}):null]}),e.jsxs(Sa,{children:[e.jsx(Ma,{}),e.jsx("span",{children:Z(n.priceCredits*I)})]})]})]},n.item.id)})}),e.jsx(Ta,{children:k.map(n=>{const I=n.id===T;return e.jsxs(Pa,{"data-testid":"credit-pack","data-on":I||void 0,onClick:()=>_(n.id),children:[e.jsx(za,{}),e.jsx(Aa,{children:Z(n.credits)}),e.jsxs(Ia,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(qa,{children:[e.jsxs(Ra,{children:[e.jsx(_a,{}),e.jsx("span",{children:Z((z==null?void 0:z.credits)??0)})]}),e.jsxs(Ba,{children:["$",((z==null?void 0:z.usd)??0).toFixed(2)]})]}),e.jsxs(ft,{children:[e.jsx(xe,{"data-variant":"outline",onClick:W,children:a("buyModal.cancel")}),e.jsx(xe,{"data-variant":"gradient",onClick:F,children:a("buyModal.buy")})]})]})}const{colors:o,gradients:yt,radius:K}=ee,bt="@media (max-width: 1080px)",S="@media (max-width: 880px)",dt=i.div`
57
62
  max-width: 1510px;
58
63
  margin: 0 auto;
59
64
 
@@ -98,12 +103,12 @@ import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-BYHuwl8r.js";import{t
98
103
  }
99
104
  `,ht=i.div`
100
105
  position: relative;
101
- `,js=i.div`
106
+ `,ws=i.div`
102
107
  min-width: 0;
103
108
  display: flex;
104
109
  flex-direction: column;
105
110
  gap: 12px;
106
- `,ws=i.div`
111
+ `,js=i.div`
107
112
  display: flex;
108
113
  align-items: center;
109
114
  justify-content: space-between;
@@ -490,7 +495,7 @@ import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-BYHuwl8r.js";import{t
490
495
  width: 11.31px;
491
496
  height: 10.94px;
492
497
  background: ${o.text};
493
- `,jt=ze`
498
+ `,wt=ze`
494
499
  display: grid;
495
500
  place-items: center;
496
501
  width: 24px;
@@ -507,7 +512,7 @@ import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-BYHuwl8r.js";import{t
507
512
  cursor: default;
508
513
  }
509
514
  `,en=i.button`
510
- ${jt};
515
+ ${wt};
511
516
 
512
517
  &:hover:not(:disabled) {
513
518
  color: ${o.text};
@@ -516,7 +521,7 @@ import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-BYHuwl8r.js";import{t
516
521
  color: ${o.dclRed};
517
522
  }
518
523
  `,tn=i.button`
519
- ${jt};
524
+ ${wt};
520
525
 
521
526
  &:hover:not(:disabled) {
522
527
  color: ${o.dclRed};
@@ -636,13 +641,13 @@ import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-BYHuwl8r.js";import{t
636
641
  opacity: 0.6;
637
642
  cursor: default;
638
643
  }
639
- `,wt=ze`
644
+ `,jt=ze`
640
645
  margin: 0;
641
646
  font-size: 13px;
642
647
  `,ue=i.p`
643
- ${wt};
648
+ ${jt};
644
649
  `,xn=i(ds)`
645
- ${wt};
650
+ ${jt};
646
651
  `,gn=i.div`
647
652
  position: relative;
648
653
  margin-top: 48px;
@@ -668,4 +673,4 @@ import{j as e,L as ge,r as $,b as Lt,a as Nt}from"./react-BYHuwl8r.js";import{t
668
673
  & section {
669
674
  margin-top: 0;
670
675
  }
671
- `;function Te(c){if(cs(c))return a("errors.rejected");const d=(c.message??"").toLowerCase();return d.includes("insufficient")?a("cart.error.insufficient",{currency:Zt.name}):d.includes("no active listing")||d.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const mn=12e4;function fn(c){const d=[];return c.unavailable.length&&d.push(a("cart.drop.unavailable",{count:c.unavailable.length})),c.own.length&&d.push(a("cart.drop.own",{count:c.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Pe=c=>c.reduce((d,k)=>d+k.priceCredits*k.quantity,0),he=c=>c.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1})));function En(){Kt({title:a("nav.cart"),noindex:!0});const c=q(t=>t.items),d=q(t=>t.remove),k=q(t=>t.increment),T=q(t=>t.decrement),_=q(t=>t.clear),F=q(t=>t.restore),W=q(t=>t.setFittingOpen),z=Ze(t=>t.items),me=Ze(t=>t.toggle),{session:n,signIn:I}=Ut(),te=ss().packs.slice(0,ns);$.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const kt=c.some(t=>t.category!=="emote"),{data:fe}=Ot({queryKey:["upsell-listings"],queryFn:()=>ta({first:40}),staleTime:6e4}),{data:C}=Ht(n),m=Vt(),U=Lt(),{state:L}=Nt(),[$t,G]=$.useState(null),[Ae,ae]=$.useState(null),[St,A]=$.useState(!1),[P,N]=$.useState(null),Ie=$.useRef(0),[p,b]=$.useState(null),{data:Y}=Dt(n),{data:J}=Oa(!0),[ye,qe]=$.useState(""),X=$.useRef(null),Re=Gt(c),_e=t=>et(Re[t.id]),be=c.filter(_e),ve=c.length>0&&be.length===0,Mt=be.reduce((t,s)=>t+s.priceCredits*s.quantity,0),Tt=c.reduce((t,s)=>t+s.quantity,0),Pt=be.reduce((t,s)=>t+s.quantity,0),Be=P?P.liveTotalCredits:Mt,zt=new Set(c.map(t=>t.id)),Ee=((fe==null?void 0:fe.items)??[]).filter(t=>!zt.has(t.id)).slice(0,12),At=new Map(P==null?void 0:P.buyable.map(t=>[t.item.id,t])),se=(C==null?void 0:C.credits)??0,ne=Be*10,Fe=J?lt(ne,J):0n,ie=Se({priceCents:ne,priceManaWei:Fe,balanceCents:(C==null?void 0:C.balanceCents)??0,manaBalanceWei:Y??0n}),We=mt(ne,Fe),Le=We!=null?a("buyModal.manaRate",{mana:We.toLocaleString("en",{maximumFractionDigits:2})}):null,It=Xt;function re(t){t(),N(null),ae(null),G(null)}function qt(){b(null),A(!1)}function Ne(t){const s=Pe(t),l=Math.max(0,s-se),r=te.find(u=>u.credits>=l)??te[te.length-1];qe(r.id),Q("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:se,shortfall:l}),b({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:l}),A(!1)}async function Ce(t){if(!n||t.length===0)return;const s=he(t),l=s.map(g=>({...g.item,priceCredits:g.priceCredits})),r=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),u=[];let h="authorize",f=!1;b({phase:"processing",stage:"reserving",step:1,total:s.length});try{const g=[];for(let w=0;w<s.length;w++){const v=s[w];b({phase:"processing",stage:"reserving",step:w+1,total:s.length});try{const{credit:j,maxCreditedValue:H}=await st(n.identity,v.usdCents,v.trade.id);u.push(j.id),g.push({trade:v.trade,credits:[j],maxCreditedValue:H})}catch(j){if(ls(j)){if(u.length){try{await we(n.identity,u)}catch(H){V(H,{flow:"cart_checkout",step:"release"})}m.invalidateQueries({queryKey:["usd-balance"]})}Ne(t);return}throw j}}h="submit";const M=()=>b({phase:"processing",stage:"settling",step:s.length,total:s.length});b({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});let y=[];if(Va())try{y=await Za({purchases:g,buyer:n.address,signer:n.signer,onSigned:M});const v=(await Promise.allSettled(y.map(j=>es(j)))).flatMap(j=>j.status==="rejected"?[j.reason]:[]);if(v.length&&!v.some(j=>j instanceof ts))throw v[0];f=!0}catch(w){if(!(w instanceof as))throw w;y=await Me({purchases:g,buyer:n.address,signer:n.signer,onSigned:M})}else y=await Me({purchases:g,buyer:n.address,signer:n.signer});t.forEach(w=>d(w.item.id)),N(null),Q("Shop Completed Purchase",{...ke(l),payment_type:"credits",no_crypto_step:f,transaction_hash:y[0]??null}),Na(m);const x=X.current;X.current=null,b(null),A(!1);const E={items:r,txHash:y[0]??void 0,settled:!0,...x?{creditsAdded:x}:{}};U("/success",{state:E,replace:!0})}catch(g){if(ce(g)||V(g,{flow:"cart_checkout",step:h,cart_size:t.length}),Q(ce(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:nt(g),value_usd:tt(l.reduce((M,y)=>M+y.priceCredits,0)),cart_size:s.length}),u.length){try{await we(n.identity,u)}catch(M){V(M,{flow:"cart_checkout",step:"release"})}m.invalidateQueries({queryKey:["usd-balance"]})}b({phase:"error",message:Te(g)})}}function Qe(t,s){m.invalidateQueries({queryKey:["usd-balance"]}),m.invalidateQueries({queryKey:["detail-trade"]}),m.invalidateQueries({queryKey:["shop-item"]}),m.invalidateQueries({queryKey:["owned-token"]}),m.invalidateQueries({queryKey:["public-token"]}),m.invalidateQueries({queryKey:["item-resales"]}),m.invalidateQueries({queryKey:["shop-items"]}),m.invalidateQueries({queryKey:["catalog-items"]}),m.invalidateQueries({queryKey:["my-assets"]}),m.invalidateQueries({queryKey:["purchases"]}),m.invalidateQueries({queryKey:["owned-item-count"]}),m.invalidateQueries({queryKey:["overview-listings"]}),m.invalidateQueries({queryKey:["upsell-listings"]});const l=X.current;X.current=null,b(null),A(!1);const r={items:t,txHash:s[0]??void 0,settled:!0,...l?{creditsAdded:l}:{}};U("/success",{state:r,replace:!0})}function Ke(t,s){ce(t)||V(t,{flow:s,step:"submit"}),Q(ce(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:nt(t)}),b({phase:"error",message:Te(t)}),A(!1)}async function Rt(t,s){const l=le($e.MANAToken,s),r=le($e.CreditsManager,s);await Ja({auth:{kind:Xa.Allowance,contractAddress:l.address,spenderAddress:r.address,chainId:s},signer:t})}async function Ue(){if(J)return J;try{return await m.fetchQuery({queryKey:["mana-rate",at.chainId],queryFn:()=>Ha(at.chainId),staleTime:6e4})}catch{return}}async function _t(t){const s=he(t).reduce((h,f)=>h+f.usdCents,0),r=(Y??0n)>0n?await Ue():J,u=r?lt(s,r):0n;return{totalCents:s,manaWei:u}}async function Oe(t,s){const l=Pe(t),{totalCents:r,manaWei:u}=await _t(t),h=Se({priceCents:r,priceManaWei:u,balanceCents:(C==null?void 0:C.balanceCents)??0,manaBalanceWei:Y??0n});if(s&&h.options.some(f=>f.method===s)){if(s==="credits"){Ce(t);return}const{spender:f,chainId:g}=He(s,t);await Ve(f,g,()=>s==="mana"?void De(t):void Ge(t,r,u));return}if(h.options.some(f=>f.method==="mana"||f.method==="combined")){b({phase:"choose",lines:t,totalCents:r,manaWei:u}),A(!1);return}if(C!=null&&C.credits<l){Ne(t);return}Ce(t)}function Bt(t){return Se({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(C==null?void 0:C.balanceCents)??0,manaBalanceWei:Y??0n})}const[je,oe]=$.useState(null);function He(t,s){const l=s[0].trade;return{spender:t==="mana"?le(ea(l.contract),l.chainId).address:le($e.CreditsManager,l.chainId).address,chainId:l.chainId}}async function Ve(t,s,l){const r=Da(s,t),u=n?await Ga(r,n.address).catch(()=>!0):!0;if(Ya(n==null?void 0:n.providerType,u)){A(!1),oe({auth:r,run:l});return}l()}function Et(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:s,totalCents:l,manaWei:r}=p;if(t==="credits"){Ce(s);return}const{spender:u,chainId:h}=He(t,s);Ve(u,h,()=>t==="mana"?void De(s):void Ge(s,l,r))}async function De(t){if(!n||t.length===0)return;const s=he(t),l=s.map(h=>({...h.item,priceCredits:h.priceCredits})),r=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>b({phase:"processing",stage:"settling",step:s.length,total:s.length});b({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await Qa({trades:s.map(f=>f.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(f=>d(f.item.id)),N(null),Q("Shop Completed Purchase",{...ke(l),payment_type:"mana",transaction_hash:h[0]??null}),m.invalidateQueries({queryKey:["mana-balance"]}),Qe(r,h)}catch(h){Ke(h,"buy_cart_mana")}}async function Ge(t,s,l){if(!n||t.length===0)return;const r=he(t),u=r.map(x=>({...x.item,priceCredits:x.priceCredits})),h=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),f=Ka(r.map(x=>x.usdCents),(C==null?void 0:C.balanceCents)??0),g=f.reduce((x,E)=>x+E,0),M=Ua(Math.max(0,s-g),s,l),y=[];b({phase:"processing",stage:"reserving",step:1,total:r.length});try{const x=[];for(let v=0;v<r.length;v++){const j=f[v];if(j<=0)continue;b({phase:"processing",stage:"reserving",step:v+1,total:r.length});const{credit:H,maxCreditedValue:Wt}=await st(n.identity,j,r[v].trade.id);y.push(H.id),x.push({trade:r[v].trade,credits:[H],maxCreditedValue:Wt})}r.forEach((v,j)=>{f[j]<=0&&x.push({trade:v.trade,credits:[],maxCreditedValue:"0"})}),x[0]={...x[0],maxCreditedValue:(BigInt(x[0].maxCreditedValue)+M).toString()},await Rt(n.signer,r[0].trade.chainId);const E=()=>b({phase:"processing",stage:"settling",step:r.length,total:r.length});b({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const w=await Me({purchases:x,buyer:n.address,signer:n.signer,onSigned:E});t.forEach(v=>d(v.item.id)),N(null),Q("Shop Completed Purchase",{...ke(u),payment_type:"credits_and_mana",transaction_hash:w[0]??null}),m.invalidateQueries({queryKey:["mana-balance"]}),Qe(h,w)}catch(x){y.length&&(we(n.identity,y).catch(()=>{}),m.invalidateQueries({queryKey:["usd-balance"]})),Ke(x,"buy_cart_combined")}}async function O(t){if(!n){ct({type:"cart-checkout"}),I();return}const s=q.getState().items.filter(_e);if(s.length===0)return;G(null),ae(null),A(!0);const l=s.reduce((r,u)=>r+u.priceCredits*u.quantity,0);Q("Shop Started Checkout",{cart_size:s.length,cart_value_credits:l,cart_value_usd:tt(l),has_sufficient_credits:se>=l});try{const r=await is(s,n.address,It,await Ue()),u=[...r.unavailable,...r.own];if(u.length&&(u.forEach(h=>d(h.id)),ae(fn(r))),r.buyable.length===0){G(a("cart.error.noneAvailable")),N(null);return}if(r.orderChanged){N(r),Ie.current=Date.now();return}await Oe(r.buyable,t)}catch(r){V(r,{flow:"cart_checkout",step:"review",cart_size:s.length}),G(Te(r))}finally{A(!1)}}async function Ye(){if(P){if(!n){ct({type:"cart-checkout"}),I();return}if(Date.now()-Ie.current>mn){N(null),ae(null),await O();return}G(null),Oe(P.buyable)}}async function Ft(){if(ye){try{sessionStorage.setItem(de,JSON.stringify(q.getState().items))}catch{}A(!0);try{const t=await rs(ye,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}U("/credits")}catch(t){try{sessionStorage.removeItem(de)}catch{}V(t,{flow:"cart_buy_credits"}),b({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{A(!1)}}}const Je=$.useRef(!1);$.useEffect(()=>{if(!n||Je.current||!Ea("cart-checkout"))return;Je.current=!0;const t=setTimeout(()=>void O(),0);return()=>clearTimeout(t)},[n]);const Xe=$.useRef(!1);$.useEffect(()=>{if(!(L!=null&&L.resumeCheckout)||Xe.current)return;Xe.current=!0,X.current=L.creditsAdded??null;try{const s=sessionStorage.getItem(de);if(s){sessionStorage.removeItem(de);const l=JSON.parse(s);Array.isArray(l)&&l.length&&F(l)}}catch{}m.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void O(),0);return()=>clearTimeout(t)},[L==null?void 0:L.resumeCheckout]);const B=St||(p==null?void 0:p.phase)==="processing";return c.length===0&&!p?e.jsx(dt,{children:e.jsxs(ht,{children:[e.jsxs(ut,{onClick:()=>U(-1),type:"button",children:[e.jsx(R,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(ks,{"data-testid":"cart-empty",children:[e.jsx(R,{name:"cart-plus",size:110}),e.jsxs($s,{children:[e.jsx(Ss,{children:a("cart.empty.title")}),e.jsx(Ms,{children:a("cart.empty.body")})]}),e.jsx(Ts,{to:"/assets",children:a("cart.empty.cta")})]})]})}):e.jsxs(dt,{children:[e.jsxs(ht,{children:[e.jsxs(ut,{onClick:()=>U(-1),type:"button",children:[e.jsx(R,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Cs,{children:[e.jsxs(js,{children:[e.jsxs(ws,{children:[e.jsx(Ps,{onClick:()=>U(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(R,{name:"arrow-left"})}),e.jsx(zs,{children:a("cart.panelTitle",{count:Tt})}),kt?e.jsxs(As,{onClick:()=>W(!0),disabled:B,children:[e.jsx(R,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(vt,{children:[e.jsx(Is,{children:c.map(t=>{const s=At.get(t.id),l=s?s.priceCredits:t.priceCredits,r=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,f=typeof t.available=="number"&&h>=t.available,g=l*h,M=!!z[t.id],y=Yt(t),x=Re[t.id],E=!et(x),w=x==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(qs,{"data-unavailable":E||void 0,children:[e.jsxs(Rs,{"data-thumb":!0,children:[y?e.jsx(_s,{to:y,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Bs,{"data-check":!0,"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(Es,{children:[e.jsxs(Fs,{"data-desc":!0,children:[y?e.jsx(Ls,{to:y,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Ws,{title:t.name,children:t.name}),t.creator?e.jsx(Ns,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(Xs,{"data-testid":"cart-creator-tag",children:[e.jsx(Zs,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Qs,{children:E?e.jsxs(e.Fragment,{children:[e.jsxs(Gs,{children:[e.jsx(Ys,{name:"warning-fill",size:24}),w]}),y?e.jsx(Js,{to:y,state:{item:t,tradeId:t.tradeId},children:a("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(Ks,{children:[e.jsx(pt,{onClick:()=>re(()=>T(t.id)),disabled:B||h<=1,"aria-label":a("cart.decreaseQuantity",{name:t.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(Us,{children:h}),e.jsx(pt,{onClick:()=>re(()=>k(t.id)),disabled:B||f,"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(Os,{children:[e.jsx(Hs,{})," ",g,r?e.jsx(Vs,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(Ds,{children:[e.jsx(en,{"data-on":M||void 0,onClick:()=>me(t),"aria-label":M?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:M?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(R,{name:M?"heart-solid":"heart"})}),e.jsx(tn,{onClick:()=>re(()=>d(t.id)),disabled:B,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(R,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(an,{children:e.jsx("button",{className:"link",onClick:()=>re(_),disabled:B,children:a("cart.clearCart")})})]})]}),e.jsxs(sn,{children:[e.jsx(nn,{children:a("cart.purchaseSummary")}),e.jsxs(rn,{children:[e.jsxs(on,{children:[e.jsx(cn,{children:a("cart.totalItems",{count:Pt})}),e.jsxs(dn,{children:[e.jsxs(ln,{children:[e.jsx(hn,{})," ",Be]}),Le&&(Y??0n)>0n?e.jsx(un,{"data-testid":"cart-mana-rate",children:Le}):null]})]}),ie.options.length>0||ie.manaShortfall?e.jsx(gt,{options:ie.options,totalCents:ne,shortfall:ie.manaShortfall,creditsLabel:P?a("marketCheckout.confirmPurchase"):a("cart.buyWithCredits"),busy:B||ve,onPay:t=>void(P?Ye():O(t))}):e.jsx(pn,{onClick:()=>void(P?Ye():O()),disabled:B||ve,children:B?a("cart.working"):P?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),ve?e.jsx(ue,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(ue,{className:"muted",children:a("cart.signInHint")}),P?e.jsx(ue,{className:"muted",children:a("cart.priceChanged")}):null,Ae?e.jsx(ue,{className:"muted",children:Ae}):null,e.jsx(xn,{message:$t})]})]})]})]}),Ee.length>0?e.jsx(gn,{children:e.jsx(Fa,{title:a("cart.youMightAlsoLike"),items:Ee})}):null,je&&n?e.jsx(Wa,{auth:je.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:La,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=je;oe(null),t()},onCancel:()=>oe(null),onClose:()=>oe(null)}):null,p?e.jsx(ys,{phase:p.phase,balanceCredits:se,onClose:qt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:Jt(n==null?void 0:n.providerType),options:p.phase==="choose"?Bt(p).options:void 0,onPay:Et,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Pe(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:te,selectedPack:ye,onSelectPack:qe,onBuyPacks:()=>void Ft(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void O()}):null]})}export{En as Cart};
676
+ `;function Te(c){if(cs(c))return a("errors.rejected");const d=(c.message??"").toLowerCase();return d.includes("insufficient")?a("cart.error.insufficient",{currency:Zt.name}):d.includes("no active listing")||d.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const mn=12e4;function fn(c){const d=[];return c.unavailable.length&&d.push(a("cart.drop.unavailable",{count:c.unavailable.length})),c.own.length&&d.push(a("cart.drop.own",{count:c.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Pe=c=>c.reduce((d,k)=>d+k.priceCredits*k.quantity,0),he=c=>c.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1})));function En(){Kt({title:a("nav.cart"),noindex:!0});const c=q(t=>t.items),d=q(t=>t.remove),k=q(t=>t.increment),T=q(t=>t.decrement),_=q(t=>t.clear),F=q(t=>t.restore),W=q(t=>t.setFittingOpen),z=Ze(t=>t.items),me=Ze(t=>t.toggle),{session:n,signIn:I}=Ut(),te=ss().packs.slice(0,ns);$.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const kt=c.some(t=>t.category!=="emote"),{data:fe}=Ot({queryKey:["upsell-listings"],queryFn:()=>ta({first:40}),staleTime:6e4}),{data:C}=Ht(n),m=Vt(),U=Lt(),{state:L}=Nt(),[$t,G]=$.useState(null),[Ae,ae]=$.useState(null),[St,A]=$.useState(!1),[P,N]=$.useState(null),Ie=$.useRef(0),[p,b]=$.useState(null),{data:Y}=Dt(n),{data:J}=Oa(!0),[ye,qe]=$.useState(""),X=$.useRef(null),Re=Gt(c),_e=t=>et(Re[t.id]),be=c.filter(_e),ve=c.length>0&&be.length===0,Mt=be.reduce((t,s)=>t+s.priceCredits*s.quantity,0),Tt=c.reduce((t,s)=>t+s.quantity,0),Pt=be.reduce((t,s)=>t+s.quantity,0),Be=P?P.liveTotalCredits:Mt,zt=new Set(c.map(t=>t.id)),Ee=((fe==null?void 0:fe.items)??[]).filter(t=>!zt.has(t.id)).slice(0,12),At=new Map(P==null?void 0:P.buyable.map(t=>[t.item.id,t])),se=(C==null?void 0:C.credits)??0,ne=Be*10,Fe=J?lt(ne,J):0n,ie=Se({priceCents:ne,priceManaWei:Fe,balanceCents:(C==null?void 0:C.balanceCents)??0,manaBalanceWei:Y??0n}),We=mt(ne,Fe),Le=We!=null?a("buyModal.manaRate",{mana:We.toLocaleString("en",{maximumFractionDigits:2})}):null,It=Xt;function re(t){t(),N(null),ae(null),G(null)}function qt(){b(null),A(!1)}function Ne(t){const s=Pe(t),l=Math.max(0,s-se),r=te.find(u=>u.credits>=l)??te[te.length-1];qe(r.id),Q("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:se,shortfall:l}),b({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:l}),A(!1)}async function Ce(t){if(!n||t.length===0)return;const s=he(t),l=s.map(g=>({...g.item,priceCredits:g.priceCredits})),r=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),u=[];let h="authorize",f=!1;b({phase:"processing",stage:"reserving",step:1,total:s.length});try{const g=[];for(let j=0;j<s.length;j++){const v=s[j];b({phase:"processing",stage:"reserving",step:j+1,total:s.length});try{const{credit:w,maxCreditedValue:H}=await st(n.identity,v.usdCents,v.trade.id);u.push(w.id),g.push({trade:v.trade,credits:[w],maxCreditedValue:H})}catch(w){if(ls(w)){if(u.length){try{await je(n.identity,u)}catch(H){V(H,{flow:"cart_checkout",step:"release"})}m.invalidateQueries({queryKey:["usd-balance"]})}Ne(t);return}throw w}}h="submit";const M=()=>b({phase:"processing",stage:"settling",step:s.length,total:s.length});b({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});let y=[];if(Va())try{y=await Za({purchases:g,buyer:n.address,signer:n.signer,onSigned:M});const v=(await Promise.allSettled(y.map(w=>es(w)))).flatMap(w=>w.status==="rejected"?[w.reason]:[]);if(v.length&&!v.some(w=>w instanceof ts))throw v[0];f=!0}catch(j){if(!(j instanceof as))throw j;y=await Me({purchases:g,buyer:n.address,signer:n.signer,onSigned:M})}else y=await Me({purchases:g,buyer:n.address,signer:n.signer});t.forEach(j=>d(j.item.id)),N(null),Q("Shop Completed Purchase",{...ke(l),payment_type:"credits",no_crypto_step:f,transaction_hash:y[0]??null}),Na(m);const x=X.current;X.current=null,b(null),A(!1);const E={items:r,txHash:y[0]??void 0,settled:!0,...x?{creditsAdded:x}:{}};U("/success",{state:E,replace:!0})}catch(g){if(ce(g)||V(g,{flow:"cart_checkout",step:h,cart_size:t.length}),Q(ce(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:h,error_code:nt(g),value_usd:tt(l.reduce((M,y)=>M+y.priceCredits,0)),cart_size:s.length}),u.length){try{await je(n.identity,u)}catch(M){V(M,{flow:"cart_checkout",step:"release"})}m.invalidateQueries({queryKey:["usd-balance"]})}b({phase:"error",message:Te(g)})}}function Qe(t,s){m.invalidateQueries({queryKey:["usd-balance"]}),m.invalidateQueries({queryKey:["detail-trade"]}),m.invalidateQueries({queryKey:["shop-item"]}),m.invalidateQueries({queryKey:["owned-token"]}),m.invalidateQueries({queryKey:["public-token"]}),m.invalidateQueries({queryKey:["item-resales"]}),m.invalidateQueries({queryKey:["shop-items"]}),m.invalidateQueries({queryKey:["catalog-items"]}),m.invalidateQueries({queryKey:["my-assets"]}),m.invalidateQueries({queryKey:["purchases"]}),m.invalidateQueries({queryKey:["owned-item-count"]}),m.invalidateQueries({queryKey:["overview-listings"]}),m.invalidateQueries({queryKey:["upsell-listings"]});const l=X.current;X.current=null,b(null),A(!1);const r={items:t,txHash:s[0]??void 0,settled:!0,...l?{creditsAdded:l}:{}};U("/success",{state:r,replace:!0})}function Ke(t,s){ce(t)||V(t,{flow:s,step:"submit"}),Q(ce(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:nt(t)}),b({phase:"error",message:Te(t)}),A(!1)}async function Rt(t,s){const l=le($e.MANAToken,s),r=le($e.CreditsManager,s);await Ja({auth:{kind:Xa.Allowance,contractAddress:l.address,spenderAddress:r.address,chainId:s},signer:t})}async function Ue(){if(J)return J;try{return await m.fetchQuery({queryKey:["mana-rate",at.chainId],queryFn:()=>Ha(at.chainId),staleTime:6e4})}catch{return}}async function _t(t){const s=he(t).reduce((h,f)=>h+f.usdCents,0),r=(Y??0n)>0n?await Ue():J,u=r?lt(s,r):0n;return{totalCents:s,manaWei:u}}async function Oe(t,s){const l=Pe(t),{totalCents:r,manaWei:u}=await _t(t),h=Se({priceCents:r,priceManaWei:u,balanceCents:(C==null?void 0:C.balanceCents)??0,manaBalanceWei:Y??0n});if(s&&h.options.some(f=>f.method===s)){if(s==="credits"){Ce(t);return}const{spender:f,chainId:g}=He(s,t);await Ve(f,g,()=>s==="mana"?void De(t):void Ge(t,r,u));return}if(h.options.some(f=>f.method==="mana"||f.method==="combined")){b({phase:"choose",lines:t,totalCents:r,manaWei:u}),A(!1);return}if(C!=null&&C.credits<l){Ne(t);return}Ce(t)}function Bt(t){return Se({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(C==null?void 0:C.balanceCents)??0,manaBalanceWei:Y??0n})}const[we,oe]=$.useState(null);function He(t,s){const l=s[0].trade;return{spender:t==="mana"?le(ea(l.contract),l.chainId).address:le($e.CreditsManager,l.chainId).address,chainId:l.chainId}}async function Ve(t,s,l){const r=Da(s,t),u=n?await Ga(r,n.address).catch(()=>!0):!0;if(Ya(n==null?void 0:n.providerType,u)){A(!1),oe({auth:r,run:l});return}l()}function Et(t){if((p==null?void 0:p.phase)!=="choose")return;const{lines:s,totalCents:l,manaWei:r}=p;if(t==="credits"){Ce(s);return}const{spender:u,chainId:h}=He(t,s);Ve(u,h,()=>t==="mana"?void De(s):void Ge(s,l,r))}async function De(t){if(!n||t.length===0)return;const s=he(t),l=s.map(h=>({...h.item,priceCredits:h.priceCredits})),r=t.map(h=>({...h.item,priceCredits:h.priceCredits,quantity:h.quantity})),u=()=>b({phase:"processing",stage:"settling",step:s.length,total:s.length});b({phase:"processing",stage:"awaiting-signature",step:s.length,total:s.length});try{const h=await Qa({trades:s.map(f=>f.trade),buyer:n.address,signer:n.signer,onSigned:u});t.forEach(f=>d(f.item.id)),N(null),Q("Shop Completed Purchase",{...ke(l),payment_type:"mana",transaction_hash:h[0]??null}),m.invalidateQueries({queryKey:["mana-balance"]}),Qe(r,h)}catch(h){Ke(h,"buy_cart_mana")}}async function Ge(t,s,l){if(!n||t.length===0)return;const r=he(t),u=r.map(x=>({...x.item,priceCredits:x.priceCredits})),h=t.map(x=>({...x.item,priceCredits:x.priceCredits,quantity:x.quantity})),f=Ka(r.map(x=>x.usdCents),(C==null?void 0:C.balanceCents)??0),g=f.reduce((x,E)=>x+E,0),M=Ua(Math.max(0,s-g),s,l),y=[];b({phase:"processing",stage:"reserving",step:1,total:r.length});try{const x=[];for(let v=0;v<r.length;v++){const w=f[v];if(w<=0)continue;b({phase:"processing",stage:"reserving",step:v+1,total:r.length});const{credit:H,maxCreditedValue:Wt}=await st(n.identity,w,r[v].trade.id);y.push(H.id),x.push({trade:r[v].trade,credits:[H],maxCreditedValue:Wt})}r.forEach((v,w)=>{f[w]<=0&&x.push({trade:v.trade,credits:[],maxCreditedValue:"0"})}),x[0]={...x[0],maxCreditedValue:(BigInt(x[0].maxCreditedValue)+M).toString()},await Rt(n.signer,r[0].trade.chainId);const E=()=>b({phase:"processing",stage:"settling",step:r.length,total:r.length});b({phase:"processing",stage:"awaiting-signature",step:r.length,total:r.length});const j=await Me({purchases:x,buyer:n.address,signer:n.signer,onSigned:E});t.forEach(v=>d(v.item.id)),N(null),Q("Shop Completed Purchase",{...ke(u),payment_type:"credits_and_mana",transaction_hash:j[0]??null}),m.invalidateQueries({queryKey:["mana-balance"]}),Qe(h,j)}catch(x){y.length&&(je(n.identity,y).catch(()=>{}),m.invalidateQueries({queryKey:["usd-balance"]})),Ke(x,"buy_cart_combined")}}async function O(t){if(!n){ct({type:"cart-checkout"}),I();return}const s=q.getState().items.filter(_e);if(s.length===0)return;G(null),ae(null),A(!0);const l=s.reduce((r,u)=>r+u.priceCredits*u.quantity,0);Q("Shop Started Checkout",{cart_size:s.length,cart_value_credits:l,cart_value_usd:tt(l),has_sufficient_credits:se>=l});try{const r=await is(s,n.address,It,await Ue()),u=[...r.unavailable,...r.own];if(u.length&&(u.forEach(h=>d(h.id)),ae(fn(r))),r.buyable.length===0){G(a("cart.error.noneAvailable")),N(null);return}if(r.orderChanged){N(r),Ie.current=Date.now();return}await Oe(r.buyable,t)}catch(r){V(r,{flow:"cart_checkout",step:"review",cart_size:s.length}),G(Te(r))}finally{A(!1)}}async function Ye(){if(P){if(!n){ct({type:"cart-checkout"}),I();return}if(Date.now()-Ie.current>mn){N(null),ae(null),await O();return}G(null),Oe(P.buyable)}}async function Ft(){if(ye){try{sessionStorage.setItem(de,JSON.stringify(q.getState().items))}catch{}A(!0);try{const t=await rs(ye,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}U("/credits")}catch(t){try{sessionStorage.removeItem(de)}catch{}V(t,{flow:"cart_buy_credits"}),b({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{A(!1)}}}const Je=$.useRef(!1);$.useEffect(()=>{if(!n||Je.current||!Ea("cart-checkout"))return;Je.current=!0;const t=setTimeout(()=>void O(),0);return()=>clearTimeout(t)},[n]);const Xe=$.useRef(!1);$.useEffect(()=>{if(!(L!=null&&L.resumeCheckout)||Xe.current)return;Xe.current=!0,X.current=L.creditsAdded??null;try{const s=sessionStorage.getItem(de);if(s){sessionStorage.removeItem(de);const l=JSON.parse(s);Array.isArray(l)&&l.length&&F(l)}}catch{}m.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void O(),0);return()=>clearTimeout(t)},[L==null?void 0:L.resumeCheckout]);const B=St||(p==null?void 0:p.phase)==="processing";return c.length===0&&!p?e.jsx(dt,{children:e.jsxs(ht,{children:[e.jsxs(ut,{onClick:()=>U(-1),type:"button",children:[e.jsx(R,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(ks,{"data-testid":"cart-empty",children:[e.jsx(R,{name:"cart-plus",size:110}),e.jsxs($s,{children:[e.jsx(Ss,{children:a("cart.empty.title")}),e.jsx(Ms,{children:a("cart.empty.body")})]}),e.jsx(Ts,{to:"/assets",children:a("cart.empty.cta")})]})]})}):e.jsxs(dt,{children:[e.jsxs(ht,{children:[e.jsxs(ut,{onClick:()=>U(-1),type:"button",children:[e.jsx(R,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Cs,{children:[e.jsxs(ws,{children:[e.jsxs(js,{children:[e.jsx(Ps,{onClick:()=>U(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(R,{name:"arrow-left"})}),e.jsx(zs,{children:a("cart.panelTitle",{count:Tt})}),kt?e.jsxs(As,{onClick:()=>W(!0),disabled:B,children:[e.jsx(R,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(vt,{children:[e.jsx(Is,{children:c.map(t=>{const s=At.get(t.id),l=s?s.priceCredits:t.priceCredits,r=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,h=t.quantity,f=typeof t.available=="number"&&h>=t.available,g=l*h,M=!!z[t.id],y=Yt(t),x=Re[t.id],E=!et(x),j=x==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(qs,{"data-unavailable":E||void 0,children:[e.jsxs(Rs,{"data-thumb":!0,children:[y?e.jsx(_s,{to:y,state:{item:t,tradeId:t.tradeId},"aria-label":t.name,children:t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.name}):null,e.jsx(Bs,{"data-check":!0,"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(Es,{children:[e.jsxs(Fs,{"data-desc":!0,children:[y?e.jsx(Ls,{to:y,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Ws,{title:t.name,children:t.name}),t.creator?e.jsx(Ns,{address:t.creator,linkToProfile:!0}):null,u?e.jsxs(Xs,{"data-testid":"cart-creator-tag",children:[e.jsx(Zs,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Qs,{children:E?e.jsxs(e.Fragment,{children:[e.jsxs(Gs,{children:[e.jsx(Ys,{name:"warning-fill",size:24}),j]}),y?e.jsx(Js,{to:y,state:{item:t,tradeId:t.tradeId},children:a("cart.availability.viewResales")}):null]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(Ks,{children:[e.jsx(pt,{onClick:()=>re(()=>T(t.id)),disabled:B||h<=1,"aria-label":a("cart.decreaseQuantity",{name:t.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(Us,{children:h}),e.jsx(pt,{onClick:()=>re(()=>k(t.id)),disabled:B||f,"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(Os,{children:[e.jsx(Hs,{})," ",g,r?e.jsx(Vs,{children:t.priceCredits*h}):null]})]})})]}),e.jsxs(Ds,{children:[e.jsx(en,{"data-on":M||void 0,onClick:()=>me(t),"aria-label":M?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:M?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(R,{name:M?"heart-solid":"heart"})}),e.jsx(tn,{onClick:()=>re(()=>d(t.id)),disabled:B,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(R,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(an,{children:e.jsx("button",{className:"link",onClick:()=>re(_),disabled:B,children:a("cart.clearCart")})})]})]}),e.jsxs(sn,{children:[e.jsx(nn,{children:a("cart.purchaseSummary")}),e.jsxs(rn,{children:[e.jsxs(on,{children:[e.jsx(cn,{children:a("cart.totalItems",{count:Pt})}),e.jsxs(dn,{children:[e.jsxs(ln,{children:[e.jsx(hn,{})," ",Be]}),Le&&(Y??0n)>0n?e.jsx(un,{"data-testid":"cart-mana-rate",children:Le}):null]})]}),ie.options.length>0||ie.manaShortfall?e.jsx(gt,{options:ie.options,totalCents:ne,shortfall:ie.manaShortfall,creditsLabel:P?a("marketCheckout.confirmPurchase"):a("cart.buyWithCredits"),busy:B||ve,onPay:t=>void(P?Ye():O(t))}):e.jsx(pn,{onClick:()=>void(P?Ye():O()),disabled:B||ve,children:B?a("cart.working"):P?a("marketCheckout.confirmPurchase"):a("assetCard.buyNow")}),ve?e.jsx(ue,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(ue,{className:"muted",children:a("cart.signInHint")}),P?e.jsx(ue,{className:"muted",children:a("cart.priceChanged")}):null,Ae?e.jsx(ue,{className:"muted",children:Ae}):null,e.jsx(xn,{message:$t})]})]})]})]}),Ee.length>0?e.jsx(gn,{children:e.jsx(Fa,{title:a("cart.youMightAlsoLike"),items:Ee})}):null,we&&n?e.jsx(Wa,{auth:we.auth,signer:n.signer,title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:La,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=we;oe(null),t()},onCancel:()=>oe(null),onClose:()=>oe(null)}):null,p?e.jsx(ys,{phase:p.phase,balanceCredits:se,onClose:qt,stage:p.phase==="processing"?p.stage:void 0,step:p.phase==="processing"?p.step:void 0,total:p.phase==="processing"?p.total:void 0,isSelfCustody:Jt(n==null?void 0:n.providerType),options:p.phase==="choose"?Bt(p).options:void 0,onPay:Et,totalCents:p.phase==="choose"?p.totalCents:void 0,totalManaWei:p.phase==="choose"?p.manaWei:void 0,totalCredits:p.phase==="choose"?Pe(p.lines):void 0,lines:p.phase==="nofunds"?p.lines:void 0,shortfallCredits:p.phase==="nofunds"?p.shortfall:void 0,packs:te,selectedPack:ye,onSelectPack:qe,onBuyPacks:()=>void Ft(),message:p.phase==="error"?p.message:void 0,onRetry:()=>void O()}):null]})}export{En as Cart};
@@ -1,4 +1,4 @@
1
- import{K as N,L as w,M as o,N as n,G as D,w as M}from"./index-DQ6JWiqD.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K,s as v}from"./clsx-GM87-Mfi.js";function F(r){return z("MuiCircularProgress",r)}E("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,b,S,$;const t=44,L=M(P||(P=l`
1
+ import{K as N,L as w,M as o,N as n,G as D,w as M}from"./index-C9aPSlyC.js";import{r as U,j as g}from"./react-vyZjIDcS.js";import{g as z,a as E,c as I,b as K,s as v}from"./clsx-DZSbGRZP.js";function F(r){return z("MuiCircularProgress",r)}E("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,b,S,$;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 m,d as Y,b as Z}from"./react-BYHuwl8r.js";import{t as v,s as c,ad as J,ae as z,I as X,d as a,c as ee,k as te,u as ae,l as re,e as oe,S as E,A as ie,af as se,ag as ne}from"./index-DQ6JWiqD.js";import{E as ce}from"./ErrorNotice-CCmfdXO-.js";import{d as le,g as de,a as pe,P as xe,C as ue,b as me,c as ge,B as he,S as be,M as fe,A as je}from"./browseLayout.styles-oJ6cJp3z.js";import{u as ve}from"./useStore-BzU6Jh1o.js";import{c as F,a as ye,F as Ce,d as we,P as Se,e as ke,H as Ae,S as Ne}from"./categories-5tCT8xWh.js";import{L as $e}from"./LoadMore-C4ahcKGI.js";import{u as Pe}from"./useInfiniteGrid-C6HwGwYR.js";import{G as Me}from"./grid.styles-Cw26IyBx.js";import"./sentry-Dx-KuLV3.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers--abqWJu6.js";import"./intl-CBcMB1D2.js";const Re=c.section`
1
+ import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as c,ad as J,ae as z,I as X,d as a,c as ee,k as te,u as ae,l as re,e as oe,S as E,A as ie,af as se,ag as ne}from"./index-C9aPSlyC.js";import{E as ce}from"./ErrorNotice-T3U1x2gM.js";import{d as le,g as de,a as pe,P as xe,C as ue,b as me,c as ge,B as he,S as be,M as fe,A as je}from"./browseLayout.styles-Cyml9DBN.js";import{u as ve}from"./useStore-BmRyRgKo.js";import{c as F,a as ye,F as Ce,d as we,P as Se,e as ke,H as Ae,S as Ne}from"./categories-BtM8_SSI.js";import{L as $e}from"./LoadMore-EzzDujll.js";import{u as Pe}from"./useInfiniteGrid-_0aqBjgd.js";import{G as Me}from"./grid.styles-beZx-O42.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CpLYx0ea.js";import"./intl-CBcMB1D2.js";const Re=c.section`
2
2
  position: relative;
3
3
  border-radius: ${v.radius.card};
4
4
  overflow: hidden;
@@ -1,4 +1,4 @@
1
- import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as k,H as j,b8 as C,e as G,w as Y,I as Q,k as X,g as W,C as B,a as Z,b9 as J,ba as F,A as q}from"./index-DQ6JWiqD.js";import{s as ee,h as H,A as U,g as K,r as te,m as ne,e as ae}from"./authorizations-93IYCFGd.js";import{i as ie}from"./errors-DLr34B3-.js";import{E as oe}from"./ErrorNotice-CCmfdXO-.js";import{a as se}from"./buy-BYXdfz24.js";import{d as re,f as ce}from"./trade-encoding-BTpnbAqu.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-BjStTgy8.js";import{I as he,C as ue}from"./ethers--abqWJu6.js";const L="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(L,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(L)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(L)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(a){var m,f,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,d=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const l=n-i,b=fe(l,n,s);d>=b&&c.push({method:"combined",creditsCents:i,manaWei:b})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((m=c.find(l=>l.method==="credits"))==null?void 0:m.method)??((f=c.find(l=>l.method==="combined"))==null?void 0:f.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,y=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:y}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const E="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",be=e.div`
1
+ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,d as g,y as k,H as j,b8 as C,e as G,w as Y,I as Q,k as X,g as W,C as B,a as Z,b9 as J,ba as F,A as q}from"./index-C9aPSlyC.js";import{s as ee,h as H,A as U,g as K,r as te,m as ne,e as ae}from"./authorizations-Dz891X4r.js";import{i as ie}from"./errors-JUBkzG87.js";import{E as oe}from"./ErrorNotice-T3U1x2gM.js";import{a as se}from"./buy-KTMkFDbF.js";import{d as re,f as ce}from"./trade-encoding-BwYos8Ms.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-Dgxdo_cy.js";import{I as he,C as ue}from"./ethers-CpLYx0ea.js";const L="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(L,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(L)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(L)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(a){var m,f,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,d=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const l=n-i,b=fe(l,n,s);d>=b&&c.push({method:"combined",creditsCents:i,manaWei:b})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((m=c.find(l=>l.method==="credits"))==null?void 0:m.method)??((f=c.find(l=>l.method==="combined"))==null?void 0:f.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,y=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:y}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",be=e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -42,7 +42,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as
42
42
  &:hover:not(:disabled) {
43
43
  filter: brightness(1.08);
44
44
  }
45
- `,T=e.button`
45
+ `,N=e.button`
46
46
  ${_}
47
47
  background: ${o.colors.text2};
48
48
 
@@ -66,7 +66,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as
66
66
  height: 24px;
67
67
  background: ${o.colors.softWhite};
68
68
  }
69
- `,N=e.span`
69
+ `,E=e.span`
70
70
  position: relative;
71
71
  display: block;
72
72
  width: 30px;
@@ -109,7 +109,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as
109
109
  line-height: 1.4;
110
110
  color: ${o.colors.muted};
111
111
  text-align: center;
112
- `;function ut({options:a,totalCents:n,onPay:i,busy:s=!1,rateNote:d,creditsLabel:c,shortfall:p}){return t.jsxs(be,{children:[a.map(h=>h.method==="credits"?t.jsxs(ye,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:s,children:[t.jsx("span",{children:c??g("buyModal.buy")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(h.creditsCents))})]})]},"credits"):h.method==="mana"?t.jsxs(T,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(N,{children:t.jsx("img",{src:E,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.manaWei)})]})]},"mana"):t.jsxs(T,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWith")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(h.creditsCents))}),t.jsx(ve,{children:"+"}),t.jsx(N,{children:t.jsx("img",{src:E,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.manaWei)}),t.jsx(we,{children:"MANA"})]})]},"combined")),p?t.jsxs(t.Fragment,{children:[t.jsxs(T,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[t.jsx("span",{children:g("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(N,{children:t.jsx("img",{src:E,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(p.manaWei)})]})]},"mana-short"),t.jsx($e,{"data-testid":"mana-shortfall-note",children:g("buyModal.manaWorth",{mana:C(p.manaWei),credits:j(z(p.manaCents)),price:j(z(p.priceCents)),currency:G.name})})]}):null,d?t.jsx(ke,{"data-testid":"mana-rate-note",children:d}):null,t.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:n})]})}function xt(a,n){const i=(s,...d)=>void a.invalidateQueries({queryKey:n?[s,...d]:[s]});a.invalidateQueries({queryKey:["usd-balance"]}),a.invalidateQueries({queryKey:["detail-trade"]}),a.invalidateQueries({queryKey:["shop-item"]}),i("owned-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("public-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("item-resales",n==null?void 0:n.contractAddress,n==null?void 0:n.itemId),a.invalidateQueries({queryKey:["shop-items"]}),a.invalidateQueries({queryKey:["catalog-items"]}),a.invalidateQueries({queryKey:["overview-listings"]}),a.invalidateQueries({queryKey:["upsell-listings"]}),a.invalidateQueries({queryKey:["my-assets"]}),a.invalidateQueries({queryKey:["purchases"]}),a.invalidateQueries({queryKey:["owned-item-count"]})}const je=Y`
112
+ `;function ut({options:a,totalCents:n,onPay:i,busy:s=!1,rateNote:d,creditsLabel:c,shortfall:p}){return t.jsxs(be,{children:[a.map(h=>h.method==="credits"?t.jsxs(ye,{type:"button","data-testid":"pay-with-credits",onClick:()=>i("credits"),disabled:s,children:[t.jsx("span",{children:c??g("buyModal.buy")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(h.creditsCents))})]})]},"credits"):h.method==="mana"?t.jsxs(N,{type:"button","data-testid":"pay-with-mana",onClick:()=>i("mana"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.manaWei)})]})]},"mana"):t.jsxs(N,{type:"button","data-testid":"pay-with-combined",onClick:()=>i("combined"),disabled:s,children:[t.jsx("span",{children:g("buyModal.buyWith")}),t.jsxs(M,{children:[t.jsx(k,{}),t.jsx("span",{children:j(z(h.creditsCents))}),t.jsx(ve,{children:"+"}),t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(h.manaWei)}),t.jsx(we,{children:"MANA"})]})]},"combined")),p?t.jsxs(t.Fragment,{children:[t.jsxs(N,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[t.jsx("span",{children:g("buyModal.buyWithMana")}),t.jsxs(M,{children:[t.jsx(E,{children:t.jsx("img",{src:T,alt:"","aria-hidden":!0})}),t.jsx("span",{children:C(p.manaWei)})]})]},"mana-short"),t.jsx($e,{"data-testid":"mana-shortfall-note",children:g("buyModal.manaWorth",{mana:C(p.manaWei),credits:j(z(p.manaCents)),price:j(z(p.priceCents)),currency:G.name})})]}):null,d?t.jsx(ke,{"data-testid":"mana-rate-note",children:d}):null,t.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:n})]})}function xt(a,n){const i=(s,...d)=>void a.invalidateQueries({queryKey:n?[s,...d]:[s]});a.invalidateQueries({queryKey:["usd-balance"]}),a.invalidateQueries({queryKey:["detail-trade"]}),a.invalidateQueries({queryKey:["shop-item"]}),i("owned-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("public-token",n==null?void 0:n.contractAddress,n==null?void 0:n.tokenId),i("item-resales",n==null?void 0:n.contractAddress,n==null?void 0:n.itemId),a.invalidateQueries({queryKey:["shop-items"]}),a.invalidateQueries({queryKey:["catalog-items"]}),a.invalidateQueries({queryKey:["overview-listings"]}),a.invalidateQueries({queryKey:["upsell-listings"]}),a.invalidateQueries({queryKey:["my-assets"]}),a.invalidateQueries({queryKey:["purchases"]}),a.invalidateQueries({queryKey:["owned-item-count"]})}const je=Y`
113
113
  to { transform: rotate(360deg); }
114
114
  `,Ce=e.div`
115
115
  position: fixed;
@@ -198,15 +198,15 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as
198
198
  width: 26px;
199
199
  height: 26px;
200
200
  }
201
- `,Ee=e.div`
201
+ `,Te=e.div`
202
202
  min-width: 0;
203
203
  display: flex;
204
204
  flex-direction: column;
205
205
  gap: 4px;
206
- `,Te=e.span`
206
+ `,Ne=e.span`
207
207
  font-weight: 700;
208
208
  color: ${o.colors.text};
209
- `,Ne=e.span`
209
+ `,Ee=e.span`
210
210
  font-size: 13px;
211
211
  line-height: 1.45;
212
212
  color: ${o.colors.muted};
@@ -289,26 +289,34 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as
289
289
  @media (prefers-reduced-motion: reduce) {
290
290
  animation: none;
291
291
  }
292
- `;function gt({auth:a,signer:n,title:i,reason:s,name:d,image:c,icon:p,onAuthorized:h,onCancel:y,onClose:m}){const[f,w]=v.useState(!1),[l,b]=v.useState(null);async function $(){w(!0),b(null);try{await ee({auth:a,signer:n,active:!0}),h()}catch(u){ie(u)?b(g("authorizeStep.errorRejected")):(X(u,{flow:"authorize_step",kind:a.kind}),b(g("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Ce,{onClick:f?void 0:m,role:"presentation",children:t.jsxs(ze,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(Me,{children:[t.jsx(Ae,{children:i}),t.jsx(We,{onClick:m,disabled:f,"aria-label":g("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Ie,{"data-testid":"authorize-step-row",children:[t.jsx(Se,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Ee,{children:[t.jsx(Te,{title:d,children:d}),t.jsx(Ne,{children:s})]})]}),t.jsx(Be,{children:g("authorizeStep.note")}),t.jsx(oe,{message:l}),t.jsxs(Le,{children:[t.jsx(Re,{type:"button",onClick:y,disabled:f,children:g("authorizeStep.cancel")}),t.jsx(Pe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:f,children:f?t.jsxs(t.Fragment,{children:[t.jsx(Fe,{"aria-hidden":!0}),g("authorizeStep.authorizing")]}):g("authorizeStep.authorize")})]})]})})}async function ft(a){const[n]=await Ke({...a,trades:[a.trade]});return n}async function Ke(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const h of n){const y=`${h.chainId}:${h.contract.toLowerCase()}`,m=c.get(y);m?m.push(h):c.set(y,[h])}const p=[];for(const h of c.values())p.push(await De({trades:h,buyer:i,signer:s,onSigned:d}));return p}async function De(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a,c=n[0],p=W(Z(c.contract),c.chainId),h=W(B.MANAToken,c.chainId);await H({auth:{kind:U.Allowance,contractAddress:h.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const y=n.map(l=>re(l,i));if(K.enabled)try{const l=new he(p.abi).encodeFunctionData("accept",[y]),b=te(),$=ne(s.provider,b),u=await de($,b,l,p,{serverURL:K.relayerUrl});return d==null||d(),await b.waitForTransaction(u,1,12e4),u}catch(l){if(l instanceof le&&l.code===pe.USER_DENIED)throw l;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",l)}await ae(s.provider,c.chainId);const f=await new ue(p.address,p.abi,s).accept(y,ce(c.chainId));return d==null||d(),(await f.wait()).transactionHash}async function mt(a){const{trade:n,buyer:i,signer:s,credits:d,manaGapWei:c}=a;if(d.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const p=W(B.MANAToken,n.chainId),h=W(B.CreditsManager,n.chainId);await H({auth:{kind:U.Allowance,contractAddress:p.address,spenderAddress:h.address,chainId:n.chainId},signer:s});const m=(d.reduce((f,w)=>f+BigInt(w.availableAmount),0n)+c).toString();return se({trade:n,buyer:i,signer:s,credits:d,maxCreditedValue:m})}function bt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function yt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:O,radius:V,z:Qe}=o,wt=e.div`
292
+ `;function gt({auth:a,signer:n,title:i,reason:s,name:d,image:c,icon:p,onAuthorized:h,onCancel:y,onClose:m}){const[f,w]=v.useState(!1),[l,b]=v.useState(null);async function $(){w(!0),b(null);try{await ee({auth:a,signer:n,active:!0}),h()}catch(u){ie(u)?b(g("authorizeStep.errorRejected")):(X(u,{flow:"authorize_step",kind:a.kind}),b(g("authorizeStep.errorGeneric"))),w(!1)}}return t.jsx(Ce,{onClick:f?void 0:m,role:"presentation",children:t.jsxs(ze,{onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":i,children:[t.jsxs(Me,{children:[t.jsx(Ae,{children:i}),t.jsx(We,{onClick:m,disabled:f,"aria-label":g("authorizeStep.close"),children:t.jsx(Q,{name:"close",className:"ico"})})]}),t.jsxs(Ie,{"data-testid":"authorize-step-row",children:[t.jsx(Se,{children:c?t.jsx("img",{src:c,alt:""}):p}),t.jsxs(Te,{children:[t.jsx(Ne,{title:d,children:d}),t.jsx(Ee,{children:s})]})]}),t.jsx(Be,{children:g("authorizeStep.note")}),t.jsx(oe,{message:l}),t.jsxs(Le,{children:[t.jsx(Re,{type:"button",onClick:y,disabled:f,children:g("authorizeStep.cancel")}),t.jsx(Pe,{type:"button","data-testid":"authorize-step-action",onClick:()=>void $(),disabled:f,children:f?t.jsxs(t.Fragment,{children:[t.jsx(Fe,{"aria-hidden":!0}),g("authorizeStep.authorizing")]}):g("authorizeStep.authorize")})]})]})})}async function ft(a){const[n]=await Ke({...a,trades:[a.trade]});return n}async function Ke(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a;if(n.length===0)throw new Error("No items to buy");const c=new Map;for(const h of n){const y=`${h.chainId}:${h.contract.toLowerCase()}`,m=c.get(y);m?m.push(h):c.set(y,[h])}const p=[];for(const h of c.values())p.push(await De({trades:h,buyer:i,signer:s,onSigned:d}));return p}async function De(a){const{trades:n,buyer:i,signer:s,onSigned:d}=a,c=n[0],p=W(Z(c.contract),c.chainId),h=W(B.MANAToken,c.chainId);await H({auth:{kind:U.Allowance,contractAddress:h.address,spenderAddress:p.address,chainId:c.chainId},signer:s});const y=n.map(l=>re(l,i));if(K.enabled)try{const l=new he(p.abi).encodeFunctionData("accept",[y]),b=te(),$=ne(s.provider,b),u=await de($,b,l,p,{serverURL:K.relayerUrl});return d==null||d(),await b.waitForTransaction(u,1,12e4),u}catch(l){if(l instanceof le&&l.code===pe.USER_DENIED)throw l;console.warn("[buyWithMana] gasless meta-tx failed, falling back to a direct tx:",l)}await ae(s.provider,c.chainId);const f=await new ue(p.address,p.abi,s).accept(y,ce(c.chainId));return d==null||d(),(await f.wait()).transactionHash}async function mt(a){const{trade:n,buyer:i,signer:s,credits:d,manaGapWei:c}=a;if(d.length===0)throw new Error("No credits to spend — use buyWithMana for a MANA-only purchase");if(c<=0n)throw new Error("No MANA gap to cover — use buyWithCredits for a credits-only purchase");const p=W(B.MANAToken,n.chainId),h=W(B.CreditsManager,n.chainId);await H({auth:{kind:U.Allowance,contractAddress:p.address,spenderAddress:h.address,chainId:n.chainId},signer:s});const m=(d.reduce((f,w)=>f+BigInt(w.availableAmount),0n)+c).toString();return se({trade:n,buyer:i,signer:s,credits:d,maxCreditedValue:m})}function bt(a){return t.jsx("svg",{viewBox:"0 0 18 18",width:"18",height:"18","aria-hidden":!0,...a,children:t.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"#161518",strokeWidth:"1.8",strokeLinecap:"round"})})}function yt(a){return t.jsxs("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":!0,...a,children:[t.jsx("path",{d:"M12 3L2 20h20L12 3z",fill:"none",stroke:"#691fa9",strokeWidth:"1.8",strokeLinejoin:"round"}),t.jsx("path",{d:"M12 9v5",stroke:"#691fa9",strokeWidth:"1.8",strokeLinecap:"round"}),t.jsx("circle",{cx:"12",cy:"17",r:"1.1",fill:"#691fa9"})]})}const{colors:r,gradients:O,radius:V,z:Qe}=o,wt=e.div`
293
293
  position: fixed;
294
294
  inset: 0;
295
295
  z-index: ${Qe.overlay};
296
- display: grid;
297
- place-items: center;
296
+ display: flex;
297
+ overflow-y: auto;
298
298
  padding: 20px;
299
299
  `,vt=e.div`
300
- position: absolute;
300
+ position: fixed;
301
301
  inset: 0;
302
302
  background: rgba(22, 21, 24, 0.45);
303
303
  `,kt=e.div`
304
304
  position: relative;
305
305
  z-index: 1;
306
+ margin: auto;
306
307
  width: 100%;
307
308
  /* Wide enough to fit all 4 credit bundles comfortably in a single row (the credits-server returns 4;
308
309
  the Figma mock showed 3 at ~180px). The pack tiles flex to share this width. */
309
310
  max-width: 700px;
310
- /* Grid-item auto-minimum can otherwise push the card past the viewport on a narrow screen. */
311
+ /* Flex-item auto-minimum can otherwise push the card past the viewport on a narrow screen. */
311
312
  min-width: 0;
313
+ /* Never taller than the viewport (100% of the padded overlay): the no-funds state stacks a warning, a
314
+ line list, 4 pack tiles, the total AND the Cancel/Buy pair, which overflows a laptop screen at 100%
315
+ zoom and used to take the CTAs off-screen with it. The body absorbs the difference, and the clip is
316
+ the backstop — a phase that forgets to make itself shrinkable is then visibly cut off at the card's
317
+ edge instead of painting its buttons out on the scrim. */
318
+ max-height: 100%;
319
+ overflow: hidden;
312
320
  background: ${r.white};
313
321
  border-radius: 16px;
314
322
  padding: 12px 16px 16px;
@@ -365,6 +373,11 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as
365
373
  display: flex;
366
374
  flex-direction: column;
367
375
  gap: 24px;
376
+ /* Shrink inside a viewport-capped card instead of overflowing it. Anything with its own flexible
377
+ region (e.g. the cart's line list) gives up height first; this scroll is the last resort so the
378
+ CTAs are always reachable on a short screen. */
379
+ min-height: 0;
380
+ overflow-y: auto;
368
381
 
369
382
  /* Processing / loading states centre a single element in a taller body. */
370
383
  &[data-processing] {
@@ -374,11 +387,11 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as
374
387
  gap: 32px;
375
388
  padding: 24px 0;
376
389
  }
377
- `,Et=e.div`
390
+ `,Tt=e.div`
378
391
  display: flex;
379
392
  gap: 12px;
380
393
  align-items: center;
381
- `,Tt=e.div`
394
+ `,Nt=e.div`
382
395
  flex-shrink: 0;
383
396
  width: 180px;
384
397
  height: 180px;
@@ -395,7 +408,7 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as
395
408
  object-fit: contain;
396
409
  filter: drop-shadow(0.7px 2.9px 3.7px rgba(0, 0, 0, 0.1));
397
410
  }
398
- `,Nt=e.div`
411
+ `,Et=e.div`
399
412
  flex: 1;
400
413
  min-width: 0;
401
414
  display: flex;
@@ -497,8 +510,13 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as
497
510
  font-weight: 600;
498
511
  color: ${r.muted1};
499
512
  `,Xt=e.div`
513
+ position: sticky;
514
+ bottom: 0;
500
515
  display: flex;
501
516
  gap: 12px;
517
+ margin-top: -8px;
518
+ padding-top: 8px;
519
+ background: ${r.white};
502
520
  `,Zt=e.button`
503
521
  flex: 1;
504
522
  /* Let the CTAs shrink so their min-content can't widen the modal past the viewport on mobile. */
@@ -783,4 +801,4 @@ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,d as g,y as
783
801
  opacity: 1;
784
802
  transform: scale(1.1);
785
803
  }
786
- `;function cn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[d,c]=v.useState(1),[p,h]=v.useState(0),[y,m]=v.useState(!0),[f,w]=v.useState(!1),l=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:R,clientWidth:S}=u,P=Math.max(1,Math.ceil(R/S));c(P),h(Math.min(P-1,Math.round(x/S))),m(x<=1),w(x+S>=R-1)},[]);if(v.useEffect(()=>{l();const u=s.current;if(u)return u.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),()=>{u.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[l,n.length]),n.length===0)return null;function b(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(He,{children:[t.jsxs(Ue,{children:[t.jsx(_e,{children:a}),i?t.jsxs(Oe,{onClick:i,children:[g("collectionCarousel.viewAll"),t.jsx(Ve,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Ge,{children:[t.jsx(D,{"data-side":"left",onClick:()=>b(-1),"aria-label":g("collectionCarousel.scrollLeft"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ye,{ref:s,children:n.map(u=>t.jsx(q,{item:u},u.id))}),t.jsx(D,{"data-side":"right",onClick:()=>b(1),"aria-label":g("collectionCarousel.scrollRight"),disabled:f,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),d>1?t.jsx(Xe,{"aria-label":g("collectionCarousel.pages"),children:Array.from({length:d}).map((u,x)=>t.jsx(Ze,{"data-active":x===p||void 0,"aria-label":g("collectionCarousel.goToPage",{page:x+1}),"aria-current":x===p?"true":void 0,onClick:()=>$(x)},x))}):null]})}export{z as $,Et as A,Mt as B,kt as C,Ut as D,_t as E,Ot as F,Vt as G,$t as H,Gt as I,Yt as J,dt as K,Jt as L,wt as M,ct as N,cn as O,ut as P,gt as Q,E as R,vt as S,Ct as T,rt as U,xt as V,Ft as W,zt as X,Ke as Y,lt as Z,fe as _,jt as a,sn as a0,rn as a1,ft as a2,pt as a3,mt as a4,bt as b,At as c,Wt as d,It as e,St as f,qt as g,en as h,tn as i,Xt as j,Zt as k,nn as l,ht as m,an as n,on as o,yt as p,Kt as q,Tt as r,Nt as s,Bt as t,Lt as u,Rt as v,Pt as w,Dt as x,Qt as y,Ht as z};
804
+ `;function cn({title:a,items:n,onViewAll:i}){const s=v.useRef(null),[d,c]=v.useState(1),[p,h]=v.useState(0),[y,m]=v.useState(!0),[f,w]=v.useState(!1),l=v.useCallback(()=>{const u=s.current;if(!u)return;const{scrollLeft:x,scrollWidth:R,clientWidth:S}=u,P=Math.max(1,Math.ceil(R/S));c(P),h(Math.min(P-1,Math.round(x/S))),m(x<=1),w(x+S>=R-1)},[]);if(v.useEffect(()=>{l();const u=s.current;if(u)return u.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),()=>{u.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[l,n.length]),n.length===0)return null;function b(u){const x=s.current;x&&x.scrollBy({left:u*x.clientWidth,behavior:"smooth"})}function $(u){const x=s.current;x&&x.scrollTo({left:u*x.clientWidth,behavior:"smooth"})}return t.jsxs(He,{children:[t.jsxs(Ue,{children:[t.jsx(_e,{children:a}),i?t.jsxs(Oe,{onClick:i,children:[g("collectionCarousel.viewAll"),t.jsx(Ve,{name:"chevron-down",size:16})]}):null]}),t.jsxs(Ge,{children:[t.jsx(D,{"data-side":"left",onClick:()=>b(-1),"aria-label":g("collectionCarousel.scrollLeft"),disabled:y,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})}),t.jsx(Ye,{ref:s,children:n.map(u=>t.jsx(q,{item:u},u.id))}),t.jsx(D,{"data-side":"right",onClick:()=>b(1),"aria-label":g("collectionCarousel.scrollRight"),disabled:f,children:t.jsx("img",{src:F,alt:"","aria-hidden":!0})})]}),d>1?t.jsx(Xe,{"aria-label":g("collectionCarousel.pages"),children:Array.from({length:d}).map((u,x)=>t.jsx(Ze,{"data-active":x===p||void 0,"aria-label":g("collectionCarousel.goToPage",{page:x+1}),"aria-current":x===p?"true":void 0,onClick:()=>$(x)},x))}):null]})}export{z as $,Tt as A,Mt as B,kt as C,Ut as D,_t as E,Ot as F,Vt as G,$t as H,Gt as I,Yt as J,dt as K,Jt as L,wt as M,ct as N,cn as O,ut as P,gt as Q,T as R,vt as S,Ct as T,rt as U,xt as V,Ft as W,zt as X,Ke as Y,lt as Z,fe as _,jt as a,sn as a0,rn as a1,ft as a2,pt as a3,mt as a4,bt as b,At as c,Wt as d,It as e,St as f,qt as g,en as h,tn as i,Xt as j,Zt as k,nn as l,ht as m,an as n,on as o,yt as p,Kt as q,Nt as r,Et as s,Bt as t,Lt as u,Rt as v,Pt as w,Dt as x,Qt as y,Ht as z};
@@ -1 +1 @@
1
- import{p as t}from"./sentry-Dx-KuLV3.js";var e={};const o={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof t<"u"&&typeof e<"u"?e.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{o as C};
1
+ import{p as t}from"./sentry-B35L1FdR.js";var e={};const o={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof t<"u"&&typeof e<"u"?e.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]};export{o as C};