@dcl/shop 1.13.1-35089162367.commit-0e406b3 → 1.13.1-35110739985.commit-7718205

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 (416) hide show
  1. package/_assets/{Activity-DYJnR-dU.js → Activity-O6LT8hqU.js} +4 -4
  2. package/_assets/{AnimatedBackground-DRpjnuJP.js → AnimatedBackground-CB4PvfXA.js} +6 -6
  3. package/_assets/{Assets-vQLVJulF.js → Assets-Ctos_NmX.js} +3 -3
  4. package/_assets/{Authorizations-cXDczUgT.js → Authorizations-DyW6TgVG.js} +3 -3
  5. package/_assets/{Cart-B3kWP_gw.js → Cart-KBBb4RPC.js} +6 -6
  6. package/_assets/{Collection-Do-dLqoB.js → Collection-B763ift6.js} +5 -5
  7. package/_assets/{CollectionCarousel-DAV9JOqM.js → CollectionCarousel-DFNRTOFP.js} +3 -3
  8. package/_assets/Confetti-B1XP6v1O.js +18 -0
  9. package/_assets/{ConstantsUtil-DDMGVRmP.js → ConstantsUtil-6Pwi3OKY.js} +2 -2
  10. package/_assets/{ContentClient-BvDblAyC.js → ContentClient-BuElv52x.js} +2 -2
  11. package/_assets/{Creator-DmiAP0wc.js → Creator-JaygbdxX.js} +31 -31
  12. package/_assets/{DeploymentBuilder-DhQdJpYM.js → DeploymentBuilder-aEYKwzH4.js} +3 -3
  13. package/_assets/{EmotePlaybackBar-CDmI7Nwh.js → EmotePlaybackBar-BJLqHcgD.js} +5 -5
  14. package/_assets/{ErrorNotice-Bad8DXlE.js → ErrorNotice-CehMoY9b.js} +2 -2
  15. package/_assets/{Event-C7kzdzHi.js → Event-BKsvAEZR.js} +2 -2
  16. package/_assets/{ExchangeController-BT_TzDs2.js → ExchangeController-m6NotXbL.js} +2 -2
  17. package/_assets/{Faq-BOKr5kwe.js → Faq-DHIkLMIT.js} +2 -2
  18. package/_assets/{GetCredits-D971kFsS.js → GetCredits-DcNwBHxf.js} +11 -11
  19. package/_assets/{Grow-Cw2p4wKt.js → Grow-C2g65qe9.js} +2 -2
  20. package/_assets/{HelpersUtil-11Shmaqu.js → HelpersUtil-Bnvdbw4V.js} +2 -2
  21. package/_assets/ItemDetail-DJM4Utdh.js +3779 -0
  22. package/_assets/LoadMore-D1ApwWXh.js +8 -0
  23. package/_assets/{ManaPricingBanner.styles-DZWNvHY9.js → ManaPricingBanner.styles-BJpi8rP5.js} +2 -2
  24. package/_assets/MyAssets-DC5W_tsB.js +1142 -0
  25. package/_assets/{MyFavorites-CqLVYQwg.js → MyFavorites-VcdUYwK3.js} +9 -9
  26. package/_assets/{NetworkUtil-Dpg7IEQE.js → NetworkUtil-DNxN28kF.js} +2 -2
  27. package/_assets/NotFound-Bh3Yk2Sb.js +18 -0
  28. package/_assets/{NotificationsBell-CLjcNU-p.js → NotificationsBell-CYBZ8jux.js} +2 -2
  29. package/_assets/{OutfitDetail-BH-6eLXm.js → OutfitDetail-Bsult-u3.js} +7 -7
  30. package/_assets/OutfitPreview-MOY2qAET.js +7 -0
  31. package/_assets/{OutfitStudio-Dr5PdT4m.js → OutfitStudio-BPLVgE7b.js} +18 -18
  32. package/_assets/{PhArrowCircleDown-6iRUjaQT.js → PhArrowCircleDown-Bmy0XPqd.js} +5 -5
  33. package/_assets/{PhArrowClockwise-CIVwCL-l.js → PhArrowClockwise-Bklo7MBV.js} +3 -3
  34. package/_assets/{PhArrowDown-D3Qpf9aN.js → PhArrowDown-CBjJCstB.js} +3 -3
  35. package/_assets/{PhArrowLeft--wJbrUzB.js → PhArrowLeft-BCeYPtMx.js} +4 -4
  36. package/_assets/{PhArrowRight-BTIKUgk-.js → PhArrowRight-Ch61WxZn.js} +4 -4
  37. package/_assets/{PhArrowSquareOut-DPwbQcP5.js → PhArrowSquareOut-Bk5nSBoz.js} +5 -5
  38. package/_assets/{PhArrowUp-tbd9Vo3U.js → PhArrowUp-CzPwFe1F.js} +5 -5
  39. package/_assets/PhArrowUpRight-DF87CEc7.js +15 -0
  40. package/_assets/{PhArrowsClockwise-BSfkaVhX.js → PhArrowsClockwise-D5XWB216.js} +2 -2
  41. package/_assets/{PhArrowsDownUp-BizHrerJ.js → PhArrowsDownUp-CVtoWYS-.js} +5 -5
  42. package/_assets/{PhArrowsLeftRight-wuaUs2S1.js → PhArrowsLeftRight-Cu83Wp7y.js} +3 -3
  43. package/_assets/{PhBank-BzJNe1lT.js → PhBank-BjB_uqsX.js} +3 -3
  44. package/_assets/{PhBrowser-DtA3UvKM.js → PhBrowser-CW3ZGiB7.js} +5 -5
  45. package/_assets/PhCaretDown-PT_hkshh.js +15 -0
  46. package/_assets/{PhCaretLeft-4kPjHdmT.js → PhCaretLeft-DPSFahQA.js} +3 -3
  47. package/_assets/PhCaretRight-EEBUAb9H.js +15 -0
  48. package/_assets/{PhCaretUp-D9YioiHV.js → PhCaretUp-Bit2hvKo.js} +3 -3
  49. package/_assets/{PhCheck-CHpcW9AR.js → PhCheck-BHmNQJ6P.js} +4 -4
  50. package/_assets/{PhCircleHalf-YS1UFN0E.js → PhCircleHalf-AD4oTWoj.js} +3 -3
  51. package/_assets/{PhClock-CSboNJh9.js → PhClock-3t4anT3D.js} +5 -5
  52. package/_assets/{PhCompass-D_0mucCp.js → PhCompass-DpvhkfDj.js} +5 -5
  53. package/_assets/{PhCopy-CDCUCR3f.js → PhCopy-We2XYWCm.js} +5 -5
  54. package/_assets/{PhCreditCard-DRX4uPYj.js → PhCreditCard-BBnTMXbe.js} +4 -4
  55. package/_assets/{PhCurrencyDollar-DLUjVe8H.js → PhCurrencyDollar-dPV4byY8.js} +2 -2
  56. package/_assets/{PhDesktop-_u-_n84T.js → PhDesktop-DVuLe5q1.js} +3 -3
  57. package/_assets/{PhDeviceMobile-BS_c6Vl8.js → PhDeviceMobile-D6knI_PD.js} +5 -5
  58. package/_assets/{PhDotsThree-CzsXASup.js → PhDotsThree-D_uTiViU.js} +3 -3
  59. package/_assets/{PhEnvelope-Cw4-Hk4L.js → PhEnvelope-Bkk7fDMT.js} +5 -5
  60. package/_assets/{PhFunnelSimple-DpBt0vi9.js → PhFunnelSimple-BVx2yoJC.js} +4 -4
  61. package/_assets/{PhGlobe-rs-o4lxw.js → PhGlobe-BUa1rAnN.js} +2 -2
  62. package/_assets/{PhIdentificationCard-DuF1gYTt.js → PhIdentificationCard-D7mCEldI.js} +5 -5
  63. package/_assets/{PhImage-DIhy5LKN.js → PhImage-DN8upEaC.js} +2 -2
  64. package/_assets/{PhInfo-D_98hoRZ.js → PhInfo-BRv5JqkG.js} +5 -5
  65. package/_assets/{PhLightbulb-jwjURN0E.js → PhLightbulb-LZ8Bksrw.js} +4 -4
  66. package/_assets/{PhMagnifyingGlass-Cl9SVL64.js → PhMagnifyingGlass-Nlml1ksU.js} +5 -5
  67. package/_assets/{PhPaperPlaneRight-CDqjDiqA.js → PhPaperPlaneRight-QfFyGr7O.js} +3 -3
  68. package/_assets/{PhPlus-Bqy0oPbi.js → PhPlus-C6YKBVJU.js} +4 -4
  69. package/_assets/{PhPower-BQaWuBX1.js → PhPower-BtHcdIUq.js} +4 -4
  70. package/_assets/{PhPuzzlePiece-D499-d4h.js → PhPuzzlePiece-D5mYYrHE.js} +3 -3
  71. package/_assets/{PhQrCode-BQ5rQwnD.js → PhQrCode-MfgEx90-.js} +4 -4
  72. package/_assets/{PhQuestion-bCmP-feI.js → PhQuestion-BHeGiiUF.js} +3 -3
  73. package/_assets/{PhQuestionMark-DyfGY3RD.js → PhQuestionMark-DNtDU6-_.js} +4 -4
  74. package/_assets/{PhSealCheck-H9-Y7aNH.js → PhSealCheck-CDWno5AE.js} +2 -2
  75. package/_assets/{PhSignOut-BZcBXokG.js → PhSignOut-BWUfOWAY.js} +3 -3
  76. package/_assets/{PhSpinner-Do01OpHj.js → PhSpinner-Chbk-Rrh.js} +3 -3
  77. package/_assets/{PhTrash-CuF_XmzC.js → PhTrash-CknzCMhK.js} +2 -2
  78. package/_assets/{PhUser-DjwKjO5y.js → PhUser-DBmpCM-x.js} +5 -5
  79. package/_assets/{PhVault-Sk9K_rlP.js → PhVault-B_-lceT6.js} +2 -2
  80. package/_assets/{PhWallet-Cx-DY6Ai.js → PhWallet-DzHci4bI.js} +3 -3
  81. package/_assets/{PhWarning-RJrWRAZK.js → PhWarning-DNajgYKH.js} +5 -5
  82. package/_assets/{PhWarningCircle-BM_6Vsrk.js → PhWarningCircle-DaWHEJd0.js} +4 -4
  83. package/_assets/{PhX-zfSxrDJY.js → PhX-o_0aqvnZ.js} +2 -2
  84. package/_assets/SaleCountdown-CZ2zCEuD.js +99 -0
  85. package/_assets/{Spinner-BaFOYlOl.js → Spinner-Bli82tb5.js} +2 -2
  86. package/_assets/{StoreSettings-BKSOrY6R.js → StoreSettings-C1Gv-cCN.js} +7 -7
  87. package/_assets/{Success-DnVZDsHH.js → Success-B2Z93qNy.js} +5 -5
  88. package/_assets/{SwapController-Bi8TMeHN.js → SwapController-Cek3YsoY.js} +2 -2
  89. package/_assets/{TradeService-C-Qn-1X7.js → TradeService-C-AbGVlE.js} +2 -2
  90. package/_assets/{W3MFrameProviderSingleton-BF9YxOex.js → W3MFrameProviderSingleton-mF4CCLmj.js} +4 -4
  91. package/_assets/{WebCryptoP256-4w42Mna6.js → WebCryptoP256-B-dLbvSm.js} +2 -2
  92. package/_assets/{add-yuh2coGX.js → add-DMqlCS_5.js} +2 -2
  93. package/_assets/all-wallets-jltIqTjt.js +7 -0
  94. package/_assets/{app-store-CjVSQSMw.js → app-store-8U-XnKiq.js} +3 -3
  95. package/_assets/{apple--Q1_9qVz.js → apple-DqtIUOT7.js} +2 -2
  96. package/_assets/{arrow-bottom-BDd5zC7G.js → arrow-bottom-PA3nOuzV.js} +2 -2
  97. package/_assets/{arrow-bottom-circle-DeoWT_5e.js → arrow-bottom-circle-C-CSXtk9.js} +3 -3
  98. package/_assets/arrow-left-Cddzsk1s.js +9 -0
  99. package/_assets/{arrow-right-D5rgj1x7.js → arrow-right-FkB0kPcW.js} +3 -3
  100. package/_assets/{arrow-top-CZJvfHy5.js → arrow-top-BAZtnW6A.js} +3 -3
  101. package/_assets/async-directive-C0XTxdV5.js +10 -0
  102. package/_assets/{authorizations-BY8rUeq2.js → authorizations-BF60RZYU.js} +2 -2
  103. package/_assets/{bank-QdF2JRAj.js → bank-C-8Jh-Iw.js} +2 -2
  104. package/_assets/{basic-C-cPR1Xg.js → basic-TAsmd6Xa.js} +2 -2
  105. package/_assets/{biconomy-Bo75n0xt.js → biconomy-BROTTSQq.js} +2 -2
  106. package/_assets/{browseLayout.styles-DpMLT488.js → browseLayout.styles-DJ6ptfco.js} +8 -8
  107. package/_assets/{browser-BTxM9pEM.js → browser-BXKNeaZx.js} +2 -2
  108. package/_assets/{browser-C_zVhiSm.js → browser-D7KHILZd.js} +2 -2
  109. package/_assets/{browser-C4RTBBgQ.js → browser-DNnsZJT3.js} +2 -2
  110. package/_assets/{browser-ponyfill-ehmP07YL.js → browser-ponyfill-D-2OW3pz.js} +2 -2
  111. package/_assets/builder-Bi-1rymv.js +2 -0
  112. package/_assets/{buy-D3bggF5F.js → buy-CiksvueJ.js} +2 -2
  113. package/_assets/{buy-gasless-2AtEStAb.js → buy-gasless-DG2qGHrJ.js} +2 -2
  114. package/_assets/{card-Eo0szEyd.js → card-Uc0KebvL.js} +2 -2
  115. package/_assets/{categories-C7j5ito7.js → categories-BNbtxrs7.js} +2 -2
  116. package/_assets/{ccip-CSglH5kI.js → ccip-BNDG19W5.js} +2 -2
  117. package/_assets/{ccip-DzkZLgRX.js → ccip-pGTY1Hnw.js} +2 -2
  118. package/_assets/{chains-DY7GoZtE.js → chains-1XVMAf69.js} +2 -2
  119. package/_assets/{checkmark-B1VwDgk_.js → checkmark-7uWcPB0u.js} +3 -3
  120. package/_assets/{checkmark-bold-BXR2Uavz.js → checkmark-bold-BwTefyx7.js} +3 -3
  121. package/_assets/{chevron-bottom-CjUlcMur.js → chevron-bottom-CJ9Wl9Xm.js} +3 -3
  122. package/_assets/{chevron-left-DypZfS5Y.js → chevron-left-DKH1P9Pf.js} +3 -3
  123. package/_assets/{chevron-right-CBfGDvpC.js → chevron-right-DeNTJHBI.js} +2 -2
  124. package/_assets/{chevron-top-ccW9fiNv.js → chevron-top-Dn0py8bk.js} +3 -3
  125. package/_assets/{chrome-store-CXaVZVMO.js → chrome-store-DUbm69Gl.js} +3 -3
  126. package/_assets/{class-map-B8fTg_8Q.js → class-map-C7I-HYAi.js} +6 -6
  127. package/_assets/{clock-CbjAmrVY.js → clock-CMav6VuQ.js} +2 -2
  128. package/_assets/{close-C44p4Qpf.js → close-Byftwzmc.js} +2 -2
  129. package/_assets/{coinPlaceholder-9sNtxYvg.js → coinPlaceholder-C0F4r6oU.js} +2 -2
  130. package/_assets/{collectionPage.styles-BfrxwFCm.js → collectionPage.styles-RZVhtMJK.js} +7 -7
  131. package/_assets/common-Bwhl0TxO.js +2 -0
  132. package/_assets/{compass-8jFoOhNF.js → compass-CPDOuTyF.js} +3 -3
  133. package/_assets/{controller-eTU2QJWK.js → controller-DVUx791t.js} +3 -3
  134. package/_assets/{copy-Die0K-07.js → copy-CjXNbdx3.js} +2 -2
  135. package/_assets/{core-Cj6Xigq6.js → core-BwSauelP.js} +5 -5
  136. package/_assets/{createSvgIcon-CBWMbrOw.js → createSvgIcon-B_LncRTh.js} +3 -3
  137. package/_assets/crumbs.styles-BD0KsEdc.js +10 -0
  138. package/_assets/{cursor-B5zKTXqZ.js → cursor-D-SkqFO5.js} +3 -3
  139. package/_assets/{cursor-transparent-Dp8bO7rL.js → cursor-transparent-RE6Zec8w.js} +3 -3
  140. package/_assets/{custom-C0AcC3Sp.js → custom-9Ox9ngZH.js} +2 -2
  141. package/_assets/{data-capture-BFzHU6an.js → data-capture-DSDu9OaX.js} +2 -2
  142. package/_assets/{dcl-schemas-DtCjG7r3.js → dcl-schemas-BfFZv5Pe.js} +2 -2
  143. package/_assets/decimals-C6k5mXUX.js +2 -0
  144. package/_assets/decimals-CeH4Zk94.js +2 -0
  145. package/_assets/{desktop-1vPdJJzq.js → desktop-tp0dY4sR.js} +3 -3
  146. package/_assets/detectExtension-BozHquzY.js +2 -0
  147. package/_assets/{disconnect-10T9vPyj.js → disconnect-PN0ATTQe.js} +3 -3
  148. package/_assets/{discord-BC_Ueh7y.js → discord-ISYEjXZK.js} +3 -3
  149. package/_assets/{disposePreview-B50no60r.js → disposePreview-CTqm0wil.js} +2 -2
  150. package/_assets/{email-BWpBPC6C.js → email-W_rvVD_7.js} +2 -2
  151. package/_assets/{embedded-wallet-CLxwPFoY.js → embedded-wallet-CylC0mwp.js} +2 -2
  152. package/_assets/{emotion-styled.browser.esm-Dr8VipON.js → emotion-styled.browser.esm-CQtWGpOn.js} +2 -2
  153. package/_assets/{engine-BaF7feQX.js → engine-XmlRLqF0.js} +2 -2
  154. package/_assets/errors-BAO7_A7a.js +2 -0
  155. package/_assets/estimate-l1-fee-C6pUU9Gj.js +2 -0
  156. package/_assets/eth_estimateGas-DjOsaEES.js +2 -0
  157. package/_assets/eth_getStorageAt-Bckr5iRY.js +2 -0
  158. package/_assets/eth_getTransactionCount-C5Jy7jT6.js +2 -0
  159. package/_assets/ethereum-D9mzJwLc.js +2 -0
  160. package/_assets/{ethers-BzSO0Arq.js → ethers-rfaBand6.js} +2 -2
  161. package/_assets/{etherscan-C2G3o1uJ.js → etherscan-CjB1AtvG.js} +2 -2
  162. package/_assets/{events-BidS3Gqx.js → events-C9-d0wKW.js} +2 -2
  163. package/_assets/{exclamation-triangle-DwAzeOp6.js → exclamation-triangle-Vw_jmJIs.js} +2 -2
  164. package/_assets/{execute-csfAyWZ8.js → execute-97e39I17.js} +3 -3
  165. package/_assets/{extension-DzOqtmMr.js → extension-p5vqJTq0.js} +3 -3
  166. package/_assets/{external-link-CJFUahWS.js → external-link-6l8BDrnZ.js} +2 -2
  167. package/_assets/{extractIPFS-NFv54jmr.js → extractIPFS-DrYyPyFp.js} +2 -2
  168. package/_assets/{facebook-x3bYUdwS.js → facebook-BdpnpvkK.js} +3 -3
  169. package/_assets/{farcaster-TSNolEe6.js → farcaster-DyedtTLV.js} +3 -3
  170. package/_assets/{features-CjU9qHUS.js → features-DPENc6M_.js} +2 -2
  171. package/_assets/fetchTokenMetadata-CKjngqLO.js +3 -0
  172. package/_assets/{field.styles-DXv4mils.js → field.styles-SsNLO8pf.js} +2 -2
  173. package/_assets/{filters-UiyRH_AA.js → filters-CMt2xly-.js} +3 -3
  174. package/_assets/{fortmatic-DzOmbODA.js → fortmatic-Br6NCLjK.js} +2 -2
  175. package/_assets/{get-bytecode-CmL5Me3I.js → get-bytecode-DnzzQt09.js} +2 -2
  176. package/_assets/get-ecosystem-wallet-info-D5A19ioN.js +2 -0
  177. package/_assets/{getBalance-B53N6zLM.js → getBalance-CG19_hcj.js} +3 -3
  178. package/_assets/getInstalledModules-D3apLTNL.js +2 -0
  179. package/_assets/getNFT-CLwGPsGb.js +2 -0
  180. package/_assets/{getNFT-Da7nBvLS.js → getNFT-DErsYxl1.js} +3 -3
  181. package/_assets/{github-DKEnSSaC.js → github-DpuVIU6C.js} +2 -2
  182. package/_assets/{google-Ct_bf34c.js → google-BwS7c7G5.js} +2 -2
  183. package/_assets/{grid.styles-DBQapXvv.js → grid.styles-BRtgKeAE.js} +2 -2
  184. package/_assets/{hashTypedData-ccYQaGrx.js → hashTypedData-CB0WoLGg.js} +2 -2
  185. package/_assets/{hashTypedData-HyNLHlNf.js → hashTypedData-DXatJfP_.js} +2 -2
  186. package/_assets/{help-circle-CtxTuyd5.js → help-circle-D4e71YxP.js} +3 -3
  187. package/_assets/{id-CBP3kShs.js → id-CkCU8Jqk.js} +3 -3
  188. package/_assets/{image-CU2z53Sh.js → image-BgNr9PHW.js} +2 -2
  189. package/_assets/{import-CVru7lXO.js → import-vNIvljOs.js} +2 -2
  190. package/_assets/{in-app-sla2DZri.js → in-app-KVeRiFav.js} +2 -2
  191. package/_assets/in-app-wallet-calls-BGgHKG4E.js +2 -0
  192. package/_assets/{index-D0eKqmLQ.js → index-4JmY5_RP.js} +2 -2
  193. package/_assets/{index-DYi85mv-.js → index-5rIJfAZy.js} +2 -2
  194. package/_assets/{index-DJxF0Ec9.js → index-ALUnxrx5.js} +2 -2
  195. package/_assets/{index-B6iLGtVd.js → index-B-3nI4H_.js} +3 -3
  196. package/_assets/{index-ohOkRG9J.js → index-B4z00rU5.js} +3 -3
  197. package/_assets/{index-C9NWcWvf.js → index-B6htjYue.js} +3 -3
  198. package/_assets/{index-BIUc8Ud3.js → index-B6oBqK3x.js} +4 -4
  199. package/_assets/{index-Moh9fNq1.js → index-BCazbM3i.js} +3 -3
  200. package/_assets/{index-D_RiZrkh.js → index-BM-LiAJT.js} +2 -2
  201. package/_assets/{index-co4Bf7aO.js → index-BOcVPMst.js} +2 -2
  202. package/_assets/{index-DezZOi4n.js → index-BXtnar-h.js} +4 -4
  203. package/_assets/{index-DUAoJM9d.js → index-BeulnmWl.js} +7 -7
  204. package/_assets/{index-C1MoH6g3.js → index-BgUxbRek.js} +2 -2
  205. package/_assets/{index-Bk9henhQ.js → index-BkL9KpHE.js} +3 -3
  206. package/_assets/{index-DIxWyGMz.js → index-BphkB5h5.js} +2 -2
  207. package/_assets/{index-CaEpiFHi.js → index-By6o2Lqu.js} +9 -9
  208. package/_assets/{index-BUF-UAJT.js → index-ByLI3MnY.js} +2 -2
  209. package/_assets/{index-DEHjpiIO.js → index-C8lRlbcU.js} +2 -2
  210. package/_assets/{index-mhQiITlL.js → index-C9c1P_dO.js} +6 -6
  211. package/_assets/{index-8clmro1q.js → index-CD5F8xRq.js} +2 -2
  212. package/_assets/index-CDYCnNEZ.js +2 -0
  213. package/_assets/{index-k0nGJhn_.js → index-CHspDov_.js} +4 -4
  214. package/_assets/{index-CmKW_19F.js → index-C_KbxGyM.js} +2 -2
  215. package/_assets/{index-C2nOCu6S.js → index-CcQaDuSy.js} +2 -2
  216. package/_assets/index-CcTwxjsV.js +2 -0
  217. package/_assets/{index-_-FniPw-.js → index-CdYlEnpz.js} +2 -2
  218. package/_assets/{index-D_l2gdtt.js → index-CeVIXHhQ.js} +4 -4
  219. package/_assets/{index-DCTeKTys.js → index-CfYZS3Gd.js} +2 -2
  220. package/_assets/{index-DFXaxPdb.js → index-CkxowA1-.js} +2 -2
  221. package/_assets/{index-BqaS5Klo.js → index-CrcEiZEu.js} +9 -9
  222. package/_assets/{index-BN9Rrq7a.js → index-CuQaF0PK.js} +2 -2
  223. package/_assets/{index-BLObnC6L.js → index-CuovT0LH.js} +2 -2
  224. package/_assets/{index-DIpHvB9b.js → index-Cwv6CxNk.js} +3 -3
  225. package/_assets/{index-BTM4cu-0.js → index-CyVGgMkK.js} +498 -499
  226. package/_assets/{index-DZ0U56Nr.js → index-D29HW6CF.js} +2 -2
  227. package/_assets/{index-BnOL7CyY.js → index-D3GehksE.js} +2 -2
  228. package/_assets/{index-COEk7tOJ.js → index-D4yqXYo7.js} +4 -4
  229. package/_assets/{index-C4ZHPuoB.js → index-D9atNHM1.js} +4 -4
  230. package/_assets/{index-BOpvOAji.js → index-DA3Q9xWC.js} +2 -2
  231. package/_assets/{index-D_4P0qnS.js → index-DHFZfpXa.js} +2 -2
  232. package/_assets/{index-B275es-g.js → index-DJ2ef_Qi.js} +9 -9
  233. package/_assets/{index-CHvwao64.js → index-DJNds9OD.js} +2 -2
  234. package/_assets/{index-CkS0P8Z6.js → index-DKffn2SX.js} +4 -4
  235. package/_assets/index-DRbMF22n.css +1 -0
  236. package/_assets/{index-Cgx34YII.js → index-DT143eSv.js} +2 -2
  237. package/_assets/{index-B8MLoEyF.js → index-DTtoNYtG.js} +2 -2
  238. package/_assets/{index-D7G5SgsP.js → index-DXiZbXpt.js} +2 -2
  239. package/_assets/{index-Dfaj2lWF.js → index-DYCC7rPf.js} +3 -3
  240. package/_assets/{index-B_FP2GBo.js → index-Daf64xZr.js} +4 -4
  241. package/_assets/{index-CqpYF-_E.js → index-DbWZDnMx.js} +2 -2
  242. package/_assets/{index-DeSSAdoD.js → index-Dc8QkZVC.js} +3 -3
  243. package/_assets/{index-C4_0LDiU.js → index-DexDa-x6.js} +2 -2
  244. package/_assets/{index-BEG_ung4.js → index-DhIqKIxS.js} +2 -2
  245. package/_assets/{index-CQf-dUXx.js → index-DmY8v3gX.js} +2 -2
  246. package/_assets/{index-DPV6y3Gx.js → index-Dnf-yL2f.js} +5 -5
  247. package/_assets/{index-CxE0xZ39.js → index-DwU-rTe_.js} +5 -5
  248. package/_assets/{index-CcLPS_OG.js → index-DzVDhWN3.js} +4 -4
  249. package/_assets/{index-8xEldEby.js → index-ISYU3o6e.js} +2 -2
  250. package/_assets/{index-BQMgOj3E.js → index-SvKZEdOG.js} +3 -3
  251. package/_assets/{index-BPbYeSMG.js → index-TKsvI-NM.js} +8 -8
  252. package/_assets/{index-C3lmBJ62.js → index-fUxRvoXH.js} +3 -3
  253. package/_assets/{index-ciiAiV7A.js → index-gO3cCHE1.js} +6 -6
  254. package/_assets/{index-CbIqTu1l.js → index-htwtpupR.js} +4 -4
  255. package/_assets/{index-CuFmPeod.js → index-ikXmGLHB.js} +2 -2
  256. package/_assets/{index-9DQAkd_c.js → index-mvEa1F06.js} +5 -5
  257. package/_assets/{index-CTgoEKoL.js → index-o0uVygcP.js} +4 -4
  258. package/_assets/{index-DypxQ9KO.js → index-pSYYTNRD.js} +3 -3
  259. package/_assets/{index-CR2ei2RE.js → index-x2xGnkT4.js} +7 -7
  260. package/_assets/{index.es-afldYbyx.js → index.es-Cd0iKBsN.js} +2 -2
  261. package/_assets/{index.es-B-A4YN-9.js → index.es-CeYojd2g.js} +5 -5
  262. package/_assets/{index.es-CBHQ7Hyd.js → index.es-D8l4zpKy.js} +2 -2
  263. package/_assets/{index.es-g2lN0X26.js → index.es-yl8dzxKR.js} +2 -2
  264. package/_assets/{info-D8HlAvAX.js → info-CULnZZaj.js} +2 -2
  265. package/_assets/{info-circle-BhZLPW19.js → info-circle-lLJ-CNp2.js} +3 -3
  266. package/_assets/{items-empty-oFicHXNU.js → items-empty-DdvLsLv8.js} +2 -2
  267. package/_assets/jsxRuntime.module-gjtb1wYS.js +2 -0
  268. package/_assets/{jump-BiSfOGvd.js → jump-DVwOeoW4.js} +2 -2
  269. package/_assets/{lightbulb-DzXtr_43.js → lightbulb-4T7s9a-o.js} +2 -2
  270. package/_assets/linkAccount-VTa1gyga.js +2 -0
  271. package/_assets/{localBatchGatewayRequest-D-VBOWHA.js → localBatchGatewayRequest-CiuE3Uyi.js} +2 -2
  272. package/_assets/{mail-OX9dKj1y.js → mail-DhJDk7cH.js} +3 -3
  273. package/_assets/{mobile-yC6FSqHV.js → mobile-CydJ5WdV.js} +3 -3
  274. package/_assets/{modal.styles-Bftj7-o4.js → modal.styles-BrAS9zAx.js} +2 -2
  275. package/_assets/{more-DOT52_aN.js → more-Dg2B8rio.js} +3 -3
  276. package/_assets/{native-wVZelYoB.js → native-CpLbYufg.js} +2 -2
  277. package/_assets/{network-placeholder-CCjuxrNi.js → network-placeholder-h8TrKQkX.js} +2 -2
  278. package/_assets/{networks-oACiu-J6.js → networks-HjNF9J92.js} +2 -2
  279. package/_assets/{nftPlaceholder-DKgXm473.js → nftPlaceholder-B4g7qDN6.js} +3 -3
  280. package/_assets/off-UwuZMWU-.js +9 -0
  281. package/_assets/{onramp-DSIl2L8s.js → onramp-BOMs0oY_.js} +2 -2
  282. package/_assets/openzeppelin-BKXlFThB.js +2 -0
  283. package/_assets/ownerOf-DN3_LnJB.js +2 -0
  284. package/_assets/parseNft-d1FcpMcn.js +3 -0
  285. package/_assets/{parseSignature-BMyUmAUo.js → parseSignature-CJgDc_lf.js} +4 -4
  286. package/_assets/{parseSignature-DwtA_Edf.js → parseSignature-WztwOX0T.js} +2 -2
  287. package/_assets/{passkeys-DBCmcs86.js → passkeys-Bbt6ZFiZ.js} +2 -2
  288. package/_assets/{pay-with-exchange-BLMpjnKt.js → pay-with-exchange-4pYYuso4.js} +2 -2
  289. package/_assets/{play-store-bj7y3y5Y.js → play-store-B1ADa5-a.js} +2 -2
  290. package/_assets/{plus-CfzKaqvY.js → plus-CkIDGwOx.js} +2 -2
  291. package/_assets/{prepare-contract-call-AkXX3DMm.js → prepare-contract-call-CzqNBdjC.js} +2 -2
  292. package/_assets/{qr-code-Bn6kdgY5.js → qr-code-DInpw8H9.js} +3 -3
  293. package/_assets/{qr-overlay-eu2Tkv6u.js → qr-overlay-D-zdQAjb.js} +4 -4
  294. package/_assets/{react-BgjNrwEJ.js → react-BDtnT4_L.js} +2 -2
  295. package/_assets/{receive-D_lvFuvZ.js → receive-BAEAd1F0.js} +2 -2
  296. package/_assets/{recycle-horizontal-Com6QZtq.js → recycle-horizontal-frlUVLoe.js} +2 -2
  297. package/_assets/{ref-CZIG3V0U.js → ref-BDtPbYkK.js} +3 -3
  298. package/_assets/{refresh-KnsbHvKc.js → refresh-BJgYdDWe.js} +3 -3
  299. package/_assets/{reown-logo-BuYZi0Rx.js → reown-logo-CptpO-OK.js} +2 -2
  300. package/_assets/{resolveImplementation-85NkoS1t.js → resolveImplementation-vgG3euf-.js} +2 -2
  301. package/_assets/{resume-buy-KAs8Xa7R.js → resume-buy-CSgJ-XwR.js} +2 -2
  302. package/_assets/{rpc-BCkgC6ai.js → rpc-CtbKgNnw.js} +2 -2
  303. package/_assets/{sales-empty-C0_9DELX.js → sales-empty-D73ma-y1.js} +2 -2
  304. package/_assets/{search-Ce8CzTDv.js → search-CovtTjFk.js} +3 -3
  305. package/_assets/{search-empty-DtZQ-HDE.js → search-empty-D0-TyK_V.js} +2 -2
  306. package/_assets/{secp256k1-CKEmO5Uc.js → secp256k1-Bx7FlDx1.js} +2 -2
  307. package/_assets/{secp256k1-Dpz0tHJr.js → secp256k1-CzsGuHty.js} +2 -2
  308. package/_assets/{secp256k1-drx90L4z.js → secp256k1-M4GB_fDX.js} +2 -2
  309. package/_assets/{send-CoETEAuq.js → send-B6flY4x2.js} +2 -2
  310. package/_assets/{send-B-AElJGe.js → send-BqmhOSPb.js} +2 -2
  311. package/_assets/{send-batch-transaction-CXSlBWuN.js → send-batch-transaction-Co4ePIo5.js} +2 -2
  312. package/_assets/{send-eip712-transaction-Gq1DKXGK.js → send-eip712-transaction-Cs4IqHVW.js} +3 -3
  313. package/_assets/send-gasless-transaction-DWAk7bwN.js +3 -0
  314. package/_assets/send-transaction-B9T50Ic_.js +3 -0
  315. package/_assets/{sendMetaTransaction-BB1HX_Rt.js → sendMetaTransaction-CVkzKCvR.js} +2 -2
  316. package/_assets/{sendRawTransaction-Dhfh6kWs.js → sendRawTransaction-CQA22kgz.js} +4 -4
  317. package/_assets/{sentry-Dnu7IBJF.js → sentry-DJtBihbA.js} +3 -3
  318. package/_assets/{serializeTransaction-D56_NXYm.js → serializeTransaction-BXSGxjck.js} +2 -2
  319. package/_assets/session-proposal-BZ-s21nV.js +2 -0
  320. package/_assets/{session-request-3d_RxaoD.js → session-request-6undDdyN.js} +3 -3
  321. package/_assets/{sha256-DR8gIABD.js → sha256-5LafXqux.js} +2 -2
  322. package/_assets/{sha3-CEhaZjUH.js → sha3--a5gJVIr.js} +2 -2
  323. package/_assets/signin-empty-pUeXGLFR.js +2 -0
  324. package/_assets/{signing-DajTxTYm.js → signing-smJEu_aC.js} +4 -4
  325. package/_assets/{skeleton.styles-RN6Pyt5j.js → skeleton.styles-Cqgtx7q8.js} +2 -2
  326. package/_assets/{socials-jsrt6NGZ.js → socials-BB50T59X.js} +2 -2
  327. package/_assets/{styled-C-pQHjkZ.js → styled-sEDZsWVx.js} +3 -3
  328. package/_assets/{swapHorizontal-CVwm3cGO.js → swapHorizontal-BzkqO77h.js} +3 -3
  329. package/_assets/{swapHorizontalBold-BJtM3bfy.js → swapHorizontalBold-Ci7CW-Ps.js} +2 -2
  330. package/_assets/{swapHorizontalMedium-Dy-L1gY3.js → swapHorizontalMedium-BIJFHqWY.js} +3 -3
  331. package/_assets/{swapHorizontalRoundedBold-CISDmUGp.js → swapHorizontalRoundedBold-DgbOKQnq.js} +2 -2
  332. package/_assets/{swapVertical-DOqonLJ7.js → swapVertical-AbfbZRwH.js} +2 -2
  333. package/_assets/{swaps-CUv3xD4H.js → swaps--hKKZcn7.js} +2 -2
  334. package/_assets/{telegram-BgdgHDgu.js → telegram-D7G_eJ_b.js} +2 -2
  335. package/_assets/{thirdweb-COVgxIld.js → thirdweb-NC84C-A5.js} +4 -4
  336. package/_assets/{three-dots-QLVpeBJu.js → three-dots-OoMaedcW.js} +2 -2
  337. package/_assets/{to-serializable-transaction-CWoMcCAx.js → to-serializable-transaction-DhaCLdH1.js} +3 -3
  338. package/_assets/totalSupply-BEc4Cg1i.js +2 -0
  339. package/_assets/{transaction-C7yifnVj.js → transaction-D4x9bx9b.js} +2 -2
  340. package/_assets/transactionReceipt-BqZyCLMn.js +2 -0
  341. package/_assets/transactions-BWtQOgJv.js +17 -0
  342. package/_assets/{twitch-DQ-6J5eN.js → twitch-XFZ_dW-0.js} +2 -2
  343. package/_assets/{twitterIcon-DqfN9e83.js → twitterIcon-DFIrOz7L.js} +2 -2
  344. package/_assets/{useCreditPacks-psaq5SS1.js → useCreditPacks-L9xKGYZ4.js} +2 -2
  345. package/_assets/{useInfiniteGrid-DSCqBx9m.js → useInfiniteGrid-3LXYF7KT.js} +2 -2
  346. package/_assets/useStore-pULSLKbx.js +3 -0
  347. package/_assets/useTheme-BblsW0tr.js +2 -0
  348. package/_assets/{utils-DPcRgz0c.js → utils-rjss_XXl.js} +2 -2
  349. package/_assets/{verify-B6D4ZoTL.js → verify-CtqWYnsr.js} +3 -3
  350. package/_assets/{verify-filled-IL97d6Q4.js → verify-filled-db_bDI2X.js} +3 -3
  351. package/_assets/{verifyHash-CIpOvXV8.js → verifyHash-DRixXMjz.js} +2 -2
  352. package/_assets/{w3m-modal-Bm-yRTmY.js → w3m-modal-BZ1FGn4r.js} +2 -2
  353. package/_assets/{w3m-modal-DeYW__hH.js → w3m-modal-DMH1kr4I.js} +2 -2
  354. package/_assets/wait-for-tx-receipt-ChEdZDPJ.js +2 -0
  355. package/_assets/{wallet-CeCbopsa.js → wallet-C7Nkm-1r.js} +3 -3
  356. package/_assets/{wallet-placeholder-Crzo6d1g.js → wallet-placeholder-BAZfiJ4M.js} +2 -2
  357. package/_assets/{walletconnect-CeZHyiFa.js → walletconnect-jD4HJXgj.js} +2 -2
  358. package/_assets/{wallets-BdkvTNEm.js → wallets-CFIKit6R.js} +6 -6
  359. package/_assets/{warning-circle-CYZb1kuW.js → warning-circle-DG9C8ETA.js} +3 -3
  360. package/_assets/{web-connector-QySkEtZ6.js → web-connector-hTbyWCSc.js} +4 -4
  361. package/_assets/{writeContract-C_oiGwiS.js → writeContract-B5nOXYik.js} +2 -2
  362. package/_assets/{x-EU6Vt-ZK.js → x-B-2M90IQ.js} +2 -2
  363. package/_assets/{zora-sepolia-vhmz8iBk.js → zora-sepolia-CmUXMudA.js} +2 -2
  364. package/_assets/{zoraTestnet-CJY-WE9S.js → zoraTestnet-DiuTPx_I.js} +2 -2
  365. package/index.html +11 -11
  366. package/package.json +2 -2
  367. package/_assets/Confetti-DUz5LavU.js +0 -18
  368. package/_assets/ItemDetail-DvuG65JG.js +0 -3778
  369. package/_assets/LoadMore-BIYZWNS_.js +0 -8
  370. package/_assets/MyAssets-cXWUL3nU.js +0 -1077
  371. package/_assets/NotFound-DxXkndXK.js +0 -18
  372. package/_assets/OutfitPreview-CzujP4HT.js +0 -7
  373. package/_assets/PhArrowUpRight-8pk20n2b.js +0 -15
  374. package/_assets/PhCaretDown-CAvzPGfo.js +0 -15
  375. package/_assets/PhCaretRight-fBgGDQoN.js +0 -15
  376. package/_assets/all-wallets-BC47z7en.js +0 -7
  377. package/_assets/arrow-left-ClBN6Qh3.js +0 -9
  378. package/_assets/async-directive-DRvTtDkq.js +0 -10
  379. package/_assets/builder-D849MmZ4.js +0 -2
  380. package/_assets/common-CBybEEpf.js +0 -2
  381. package/_assets/crumbs.styles-g8BBq9ew.js +0 -10
  382. package/_assets/decimals-BKh7MELC.js +0 -2
  383. package/_assets/decimals-CaKieL_8.js +0 -2
  384. package/_assets/detectExtension-BnRvU-dh.js +0 -2
  385. package/_assets/errors-DwTDExim.js +0 -2
  386. package/_assets/estimate-l1-fee-db1DTXjY.js +0 -2
  387. package/_assets/eth_estimateGas-QRbjuHW3.js +0 -2
  388. package/_assets/eth_getStorageAt-CxYwD8Oh.js +0 -2
  389. package/_assets/eth_getTransactionCount-DrgjWgH5.js +0 -2
  390. package/_assets/ethereum-DanPMws3.js +0 -2
  391. package/_assets/fetchTokenMetadata-_6oIuSzE.js +0 -3
  392. package/_assets/get-ecosystem-wallet-info-CYhkeivW.js +0 -2
  393. package/_assets/getInstalledModules-CaxJCgx7.js +0 -2
  394. package/_assets/getNFT-Di36Jr07.js +0 -2
  395. package/_assets/in-app-wallet-calls-BN5hWdsy.js +0 -2
  396. package/_assets/index-D96bF07b.js +0 -2
  397. package/_assets/index-D9w1ZNKN.js +0 -2
  398. package/_assets/index-DHzm0i-x.css +0 -1
  399. package/_assets/jsxRuntime.module-DnBCkw57.js +0 -2
  400. package/_assets/linkAccount-WoX5ABfO.js +0 -2
  401. package/_assets/off-B-mPtvC1.js +0 -9
  402. package/_assets/openzeppelin-CDG3mzrN.js +0 -2
  403. package/_assets/ownerOf-CkqDhEoc.js +0 -2
  404. package/_assets/parseNft-CqOyRv3D.js +0 -3
  405. package/_assets/send-gasless-transaction-DfbdfUZY.js +0 -3
  406. package/_assets/send-transaction-RwhylVeo.js +0 -3
  407. package/_assets/session-proposal-DqIkOh28.js +0 -2
  408. package/_assets/signin-empty-Bm8pJeYJ.js +0 -2
  409. package/_assets/totalSupply-D_fM5MnZ.js +0 -2
  410. package/_assets/transactionReceipt-BtAeIRK9.js +0 -2
  411. package/_assets/transactions-DcSj7HEd.js +0 -17
  412. package/_assets/useStore-Bm04RL8T.js +0 -3
  413. package/_assets/useTheme-BRpY2-Ib.js +0 -2
  414. package/_assets/wait-for-tx-receipt-ZDr_yvxW.js +0 -2
  415. package/_assets/wallet-CbF1yy6Y.js +0 -2
  416. /package/_assets/{ItemDetail-B4Ll03xN.css → SaleCountdown-B4Ll03xN.css} +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-CR2ei2RE.js","_assets/react-BgjNrwEJ.js","_assets/index-BTM4cu-0.js","_assets/dcl-schemas-DtCjG7r3.js","_assets/sentry-Dnu7IBJF.js","_assets/ethers-BzSO0Arq.js","_assets/intl-AKLEHPeO.js","_assets/index-DHzm0i-x.css","_assets/import-CVru7lXO.js","_assets/buy-D3bggF5F.js","_assets/authorizations-BY8rUeq2.js","_assets/sendMetaTransaction-BB1HX_Rt.js","_assets/modal.styles-Bftj7-o4.js","_assets/ManaPricingBanner.styles-DZWNvHY9.js","_assets/Faq-BOKr5kwe.js","_assets/sales-empty-C0_9DELX.js","_assets/field.styles-DXv4mils.js"])))=>i.map(i=>d[i]);
2
- import{m as Ae,bS as Ee,F as U,E,bT as Le,s as h,d,k as Ne,J as $e,c as o,X as Pe,aR as Te,Z as ce,bU as ne,bV as ae,bW as Se,_ as Ce,K as L,aw as K,bX as Fe,L as De,bv as B,I as X,S as Me,bY as He,N as $,bZ as Re,b_ as Q}from"./index-BTM4cu-0.js";import{r as f,a as _e,j as t,e as qe,L as Oe}from"./react-BgjNrwEJ.js";import{u as ze,s as We}from"./sales-empty-C0_9DELX.js";import{L as Ge}from"./LoadMore-BIYZWNS_.js";import{u as P}from"./useInfiniteGrid-DSCqBx9m.js";import{m as le}from"./mana-matic-CEqvSwrJ.js";import{n as Ue}from"./name-glyph-aUugT8vq.js";import{s as Ke}from"./signin-empty-Bm8pJeYJ.js";import"./dcl-schemas-DtCjG7r3.js";import"./sentry-Dnu7IBJF.js";import"./ethers-BzSO0Arq.js";import"./intl-AKLEHPeO.js";import"./import-CVru7lXO.js";import"./buy-D3bggF5F.js";import"./authorizations-BY8rUeq2.js";import"./sendMetaTransaction-BB1HX_Rt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="e87684e5-2c91-47e9-8e3c-949a9db2327e",e._sentryDebugIdIdentifier="sentry-dbid-e87684e5-2c91-47e9-8e3c-949a9db2327e")}catch{}})();const Be=15e3;function Xe(e,s){return e.txHash&&s.txHash?e.txHash===s.txHash:e.txHash||s.txHash?!1:e.status===s.status&&Math.abs(e.createdAt-s.createdAt)<=Be}function Qe(e){const s=[...e].sort((i,a)=>a.createdAt-i.createdAt),n=[];for(const i of s){const a=n[n.length-1];a&&Xe(a[a.length-1],i)?a.push(i):n.push([i])}return n.map(i=>{var a;return{id:((a=i.find(c=>c.txHash))==null?void 0:a.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:Ve(i),totalCredits:i.reduce((c,l)=>c+l.credits,0),lines:i}})}function Ve(e){return e.some(s=>s.status==="PENDING")?"PENDING":e.some(s=>s.status==="SETTLED")?"SETTLED":"EXPIRED"}function Ye(e){return e==="SETTLED"?"SETTLED":e==="EXPIRED"?"FAILED":"PENDING"}function Ze(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Je(e){const s=[],n=new Map;for(const i of e){const a=Ze(i);if(!a){s.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits});continue}const c=n.get(a);if(c){c.quantity+=1,c.credits+=i.credits;continue}const l={key:a,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits};n.set(a,l),s.push(l)}return s}function et(e,s){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:s?Ae(e.manaWei,s):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function tt(e){return e.status!=="EXPIRED"||!!e.submittedTxHash}function it(e){const n=Qe(e.purchases.filter(tt)).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),i=e.sales.map(r=>{const p=et(r,e.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),a=(e.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(e.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),l=(e.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...n,...i,...a,...l].sort((r,p)=>p.createdAt-r.createdAt||(r.id<p.id?-1:1))}function st(e,s){return s==="all"?e:s==="sales"?e.filter(n=>n.kind==="sale"):e.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const ue=e=>e.trim().toLowerCase();function nt(e){const s=new Map;for(const n of e??[]){const i=ue(n.txHash??"");if(!i)continue;const a=s.get(i);a?a.push(n):s.set(i,[n])}return s}function at(e,s,n=Date.now()){const i=s.txHash?e.get(ue(s.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const a=i.length===1?rt(i[0].netCents):null,c=i.filter(r=>!r.available&&r.availableAt>n);if(c.length===0)return{kind:"credited",credits:a};const l=c.reduce((r,p)=>Math.max(r,p.availableAt),0);return{kind:"pending",credits:a,availableAt:l}}function rt(e){return Ee(e)}function ot(){const e=U(i=>{var a;return(a=i.session)==null?void 0:a.address}),{data:s,isLoading:n}=E({queryKey:["listing-count",e],queryFn:()=>Le({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:s==null?void 0:s.total,isLoading:n}}const dt="https://cdn.decentraland.org/@dcl/shop/1.13.1-35089162367.commit-0e406b3/_assets/credits-product-vs4Q6u6l.svg",V=Ne`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-x2xGnkT4.js","_assets/react-BDtnT4_L.js","_assets/index-CyVGgMkK.js","_assets/dcl-schemas-BfFZv5Pe.js","_assets/sentry-DJtBihbA.js","_assets/ethers-rfaBand6.js","_assets/intl-AKLEHPeO.js","_assets/index-DRbMF22n.css","_assets/import-vNIvljOs.js","_assets/buy-CiksvueJ.js","_assets/authorizations-BF60RZYU.js","_assets/sendMetaTransaction-CVkzKCvR.js","_assets/modal.styles-BrAS9zAx.js","_assets/ManaPricingBanner.styles-BJpi8rP5.js","_assets/Faq-DHIkLMIT.js","_assets/sales-empty-D73ma-y1.js","_assets/field.styles-SsNLO8pf.js"])))=>i.map(i=>d[i]);
2
+ import{m as Ae,bS as Ee,E as U,D as E,bT as Le,s as h,d,k as Ne,H as $e,c as o,X as Pe,aR as Te,Z as ce,bU as ne,bV as ae,bW as Se,_ as Ce,K as L,aw as K,bX as Fe,L as De,bv as B,I as X,S as Me,bY as He,N as $,bZ as Re,b_ as Q}from"./index-CyVGgMkK.js";import{r as f,a as _e,j as t,e as qe,L as Oe}from"./react-BDtnT4_L.js";import{u as ze,s as We}from"./sales-empty-D73ma-y1.js";import{L as Ge}from"./LoadMore-D1ApwWXh.js";import{u as P}from"./useInfiniteGrid-3LXYF7KT.js";import{m as le}from"./mana-matic-CEqvSwrJ.js";import{n as Ue}from"./name-glyph-aUugT8vq.js";import{s as Ke}from"./signin-empty-pUeXGLFR.js";import"./dcl-schemas-BfFZv5Pe.js";import"./sentry-DJtBihbA.js";import"./ethers-rfaBand6.js";import"./intl-AKLEHPeO.js";import"./import-vNIvljOs.js";import"./buy-CiksvueJ.js";import"./authorizations-BF60RZYU.js";import"./sendMetaTransaction-CVkzKCvR.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="69e5bd30-8b2d-4dbb-95c2-d49219d4f524",e._sentryDebugIdIdentifier="sentry-dbid-69e5bd30-8b2d-4dbb-95c2-d49219d4f524")}catch{}})();const Be=15e3;function Xe(e,s){return e.txHash&&s.txHash?e.txHash===s.txHash:e.txHash||s.txHash?!1:e.status===s.status&&Math.abs(e.createdAt-s.createdAt)<=Be}function Qe(e){const s=[...e].sort((i,a)=>a.createdAt-i.createdAt),n=[];for(const i of s){const a=n[n.length-1];a&&Xe(a[a.length-1],i)?a.push(i):n.push([i])}return n.map(i=>{var a;return{id:((a=i.find(c=>c.txHash))==null?void 0:a.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:Ve(i),totalCredits:i.reduce((c,l)=>c+l.credits,0),lines:i}})}function Ve(e){return e.some(s=>s.status==="PENDING")?"PENDING":e.some(s=>s.status==="SETTLED")?"SETTLED":"EXPIRED"}function Ye(e){return e==="SETTLED"?"SETTLED":e==="EXPIRED"?"FAILED":"PENDING"}function Ze(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Je(e){const s=[],n=new Map;for(const i of e){const a=Ze(i);if(!a){s.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits});continue}const c=n.get(a);if(c){c.quantity+=1,c.credits+=i.credits;continue}const l={key:a,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,registeredName:i.registeredName??null,quantity:1,credits:i.credits};n.set(a,l),s.push(l)}return s}function et(e,s){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:s?Ae(e.manaWei,s):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function tt(e){return e.status!=="EXPIRED"||!!e.submittedTxHash}function it(e){const n=Qe(e.purchases.filter(tt)).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),i=e.sales.map(r=>{const p=et(r,e.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),a=(e.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(e.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),l=(e.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...n,...i,...a,...l].sort((r,p)=>p.createdAt-r.createdAt||(r.id<p.id?-1:1))}function st(e,s){return s==="all"?e:s==="sales"?e.filter(n=>n.kind==="sale"):e.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const ue=e=>e.trim().toLowerCase();function nt(e){const s=new Map;for(const n of e??[]){const i=ue(n.txHash??"");if(!i)continue;const a=s.get(i);a?a.push(n):s.set(i,[n])}return s}function at(e,s,n=Date.now()){const i=s.txHash?e.get(ue(s.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const a=i.length===1?rt(i[0].netCents):null,c=i.filter(r=>!r.available&&r.availableAt>n);if(c.length===0)return{kind:"credited",credits:a};const l=c.reduce((r,p)=>Math.max(r,p.availableAt),0);return{kind:"pending",credits:a,availableAt:l}}function rt(e){return Ee(e)}function ot(){const e=U(i=>{var a;return(a=i.session)==null?void 0:a.address}),{data:s,isLoading:n}=E({queryKey:["listing-count",e],queryFn:()=>Le({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:s==null?void 0:s.total,isLoading:n}}const dt="https://cdn.decentraland.org/@dcl/shop/1.13.1-35110739985.commit-7718205/_assets/credits-product-vs4Q6u6l.svg",V=Ne`
3
3
  0% { background-position: 200% 0; }
4
4
  100% { background-position: -200% 0; }
5
5
  `,ct=h.section`
@@ -369,5 +369,5 @@ import{m as Ae,bS as Ee,F as U,E,bT as Le,s as h,d,k as Ne,J as $e,c as o,X as P
369
369
  height: 26px;
370
370
  object-fit: contain;
371
371
  }
372
- `,ee=N.withComponent(Oe),wt=f.lazy(()=>Ce(()=>import("./index-CR2ei2RE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])).then(e=>({default:e.ImportListings}))),T=24,It=["all","purchases","sales"],W="section",de="listings",G="view",At="migrate";function A(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function xe(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function ge(e){const s=Number(e)/1e18;return Number.isFinite(s)?s.toLocaleString("en",{maximumFractionDigits:2}):"0"}function fe({children:e}){const s=f.useRef(null),[n,i]=f.useState(null),a=()=>{var l;const c=(l=s.current)==null?void 0:l.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(bt,{ref:s,tabIndex:0,onMouseEnter:a,onMouseLeave:()=>i(null),onFocus:a,onBlur:()=>i(null),children:[e,n?qe.createPortal(t.jsx(yt,{style:{top:n.top,left:n.left},role:"tooltip",children:o("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const s=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||s,{data:i,isLoading:a}=E({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Re(e.tradeId):Q(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),c=n&&a,l=(i==null?void 0:i.name)??o("activity.itemFallback"),r=(i==null?void 0:i.thumbnail)??"",p=B({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,w=t.jsxs(t.Fragment,{children:[c?t.jsx(Z,{}):t.jsx(_,{children:r?t.jsx("img",{src:r,alt:l}):t.jsx(X,{name:"cart",size:20})}),t.jsxs(q,{children:[c?t.jsx(J,{}):t.jsx(O,{title:l,children:l}),e.quantity>1?t.jsx(z,{children:o("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]});return p?t.jsx(ee,{to:p,"data-link":"true",children:w}):t.jsx(N,{children:w})}function Lt({item:e}){const s=`@${e.registeredName}`;return t.jsxs(N,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:Ue,alt:""})}),t.jsxs(q,{children:[t.jsx(O,{title:s,children:s}),t.jsx(z,{children:o("activity.nameRegistration")})]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const s=Je(e.lines),n=s.reduce((c,l)=>c+l.quantity,0),i=Ye(e.status),a=i==="SETTLED"?o("activity.completed"):i==="FAILED"?o("activity.failed"):o("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.purchaseLabel")," · ",o("activity.itemCount",{count:n})]})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":i,children:a}),t.jsxs(k,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(vt,{children:o("activity.purchaseFailedNote")}):null,t.jsx(Y,{children:s.map(c=>c.registeredName?t.jsx(Lt,{item:c},c.key):t.jsx(Et,{item:c},c.key))})]})}function $t({sale:e}){const{data:s,isLoading:n}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(s==null?void 0:s.name)??o("activity.itemFallback"),a=(s==null?void 0:s.thumbnail)??"",c=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,l=t.jsxs(t.Fragment,{children:[n?t.jsx(Z,{}):t.jsx(_,{children:a?t.jsx("img",{src:a,alt:i}):t.jsx(X,{name:"offer",size:20})}),t.jsxs(q,{children:[n?t.jsx(J,{}):t.jsx(O,{title:i,children:i}),t.jsx(z,{children:o("activity.boughtFrom",{account:xe(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.paidWithMana")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":"SETTLED",children:o("activity.completed")}),t.jsxs(k,{children:[ge(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]})]})]}),t.jsx(Y,{children:c?t.jsx(ee,{to:c,"data-link":"true",children:l}):t.jsx(N,{children:l})})]})}function Pt({sale:e,payout:s}){const{data:n,isLoading:i}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),a=(n==null?void 0:n.name)??o("activity.itemFallback"),c=(n==null?void 0:n.thumbnail)??"",l=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,r=t.jsxs(t.Fragment,{children:[i?t.jsx(Z,{}):t.jsx(_,{children:c?t.jsx("img",{src:c,alt:a}):t.jsx(X,{name:"offer",size:20})}),t.jsxs(q,{children:[i?t.jsx(J,{}):t.jsx(O,{title:a,children:a}),t.jsxs(z,{children:[o("activity.soldTo",{account:xe(e.counterparty)}),s.kind==="pending"?` · ${o("activity.payoutPendingOn",{date:A(s.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.saleLabel")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":s.kind==="pending"?"PENDING":"SOLD",children:s.kind==="pending"?o("activity.payoutPending"):o("activity.sold")}),s.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",ge(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]}):s.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(L,{className:"ccy-mark"})," +",Me(s.credits)]}):t.jsx(k,{"data-kind":"income",children:o("activity.payoutCredited")})]})]}),t.jsx(Y,{children:l?t.jsx(ee,{to:l,"data-link":"true",children:r}):t.jsx(N,{children:r})})]})}function Tt({order:e}){const s=`$${(e.usdCents/100).toFixed(2)}`,n=Fe(e.status),i=n==="SETTLED"?o("activity.completed"):n==="FAILED"?o("activity.failed"):n==="UNFINISHED"?o("activity.unfinished"):o("activity.processing"),a=U(m=>m.session),c=De(),[l,r]=f.useState(!1),p=e.status==="initiated"&&!!a;f.useEffect(()=>{const m=()=>r(!1);return window.addEventListener("pageshow",m),()=>window.removeEventListener("pageshow",m)},[]);async function w(){if(!(!a||l)){r(!0);try{const m=await He(e.id,a.identity);if(m.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(m.url)){window.location.href=m.url;return}$.error(o("activity.resumeUnavailable"))}else m.kind==="expired"?($.info(o("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})):m.kind==="paid"?($.success(o("activity.resumePaid")),c.invalidateQueries({queryKey:["credit-orders"]})):$.error(o("activity.resumeUnavailable"));r(!1)}catch{r(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(C,{children:[t.jsx(gt,{children:t.jsx("img",{src:dt,alt:"","aria-hidden":!0})}),t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.creditPurchaseLabel")," · ",o("activity.creditPaid",{usd:s})]})]}),t.jsxs(H,{children:[p?t.jsx(ft,{type:"button",onClick:()=>void w(),disabled:l,"data-testid":"resume-order",children:l?o("activity.resuming"):o("activity.resume")}):null,t.jsx(R,{"data-status":n,children:i}),t.jsxs(k,{"data-kind":n==="UNFINISHED"?void 0:"income",children:[n==="UNFINISHED"?"":"+",t.jsx(L,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]})]})})}function St({filter:e}){const s={all:o("activity.emptyAllBody"),purchases:o("activity.emptyPurchasesBody"),sales:o("activity.emptySalesBody")}[e];return t.jsx(jt,{children:t.jsx(ce,{testId:`activity-empty-${e}`,icon:We,title:o("activity.emptyTitle"),body:s,cta:{label:o("assets.empty.cta"),to:"/items"}})})}function Qt(){const{session:e,signIn:s}=U(),[n,i]=f.useState("all"),[a,c]=_e(),l=a.get(W)===de||a.get(G)===At;$e({title:l?o("seo.import.title"):o("nav.activity"),noindex:!0});const{count:r}=ze(),{count:p}=ot(),m=r!==void 0&&p!==void 0&&(r>0||p>0||l),x=!!e&&!l&&n!=="sales",g=!!e&&!l&&n!=="purchases",b=P(["purchases",e==null?void 0:e.address],u=>Se(e.address,e.identity,{first:T,skip:u}),{enabled:x}),y=P(["sales",e==null?void 0:e.address],u=>ne(e.address,{role:"seller",first:T,skip:u}),{enabled:g}),v=P(["credit-orders",e==null?void 0:e.address],u=>ae(e.address,e.identity,{first:T,skip:u}),{enabled:x}),j=P(["mana-purchases",e==null?void 0:e.address],u=>ne(e.address,{role:"buyer",first:T,skip:u}),{enabled:x}),{data:te}=E({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ae(e.address,e.identity,{first:200}).then(u=>u.payouts),enabled:g,staleTime:6e4}),be=f.useMemo(()=>nt(te),[te]),{data:ye}=Pe(g);if(!e)return t.jsx(Te,{children:t.jsx(ce,{testId:"activity-signin",icon:Ke,title:o("activity.signInTitle"),body:o("activity.signInBody"),cta:{label:o("storeSettings.signIn"),onClick:()=>s()},ctaVariant:"solid",fill:!0})});const ie=st(it({purchases:x?b.items:[],sales:g?y.items:[],creditOrders:x?v.items:[],manaPurchases:x?j.items:[],rate:ye}),n),ve=x&&(b.isLoading||v.isLoading||j.isLoading)||g&&y.isLoading,se=x&&(b.isFetchingNextPage||v.isFetchingNextPage||j.isFetchingNextPage)||g&&y.isFetchingNextPage,je=x&&(b.hasNextPage||v.hasNextPage||j.hasNextPage)||g&&y.hasNextPage;function ke(){x&&b.hasNextPage&&b.fetchNextPage(),x&&v.hasNextPage&&v.fetchNextPage(),x&&j.hasNextPage&&j.fetchNextPage(),g&&y.hasNextPage&&y.fetchNextPage()}function we(u){if(i(u),!l)return;const I=new URLSearchParams(a);I.delete(W),I.delete(G),c(I,{replace:!0})}function Ie(){const u=new URLSearchParams(a);u.set(W,de),u.delete(G),c(u,{replace:!0})}return t.jsxs(ct,{children:[t.jsx(lt,{children:t.jsx(ut,{children:o("nav.activity")})}),t.jsxs(ht,{role:"tablist","aria-label":o("nav.activity"),children:[It.map(u=>t.jsx(he,{type:"button",role:"tab","aria-selected":!l&&n===u,"data-active":!l&&n===u,"data-testid":`activity-filter-${u}`,onClick:()=>we(u),children:o(`activity.filter.${u}`)},u)),m?t.jsxs(pt,{type:"button",role:"tab","aria-selected":l,"data-active":l,"data-testid":"activity-filter-migrate","aria-label":r?o("activity.migrate.chipAria",{count:r}):void 0,onClick:Ie,children:[o("activity.migrate.chip"),r?t.jsx(mt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:r}):null]}):null]}),l?t.jsx(f.Suspense,{fallback:t.jsx(xt,{"aria-busy":"true"}),children:t.jsx(wt,{})}):ve?t.jsx(re,{children:Array.from({length:5}).map((u,I)=>t.jsx(oe,{},I))}):ie.length===0?t.jsx(St,{filter:n}):t.jsxs(t.Fragment,{children:[t.jsxs(re,{children:[ie.map(u=>u.kind==="purchase"?t.jsx(Nt,{order:u.order},u.id):u.kind==="credit"?t.jsx(Tt,{order:u.order},u.id):u.kind==="mana-purchase"?t.jsx($t,{sale:u.sale},u.id):t.jsx(Pt,{sale:u.sale,payout:at(be,u.sale)},u.id)),se?t.jsx(oe,{}):null]}),t.jsx(Ge,{hasNextPage:je,isFetching:se,onLoadMore:ke})]})]})}export{Qt as Activity};
373
- //# sourceMappingURL=Activity-DYJnR-dU.js.map
372
+ `,ee=N.withComponent(Oe),wt=f.lazy(()=>Ce(()=>import("./index-x2xGnkT4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16])).then(e=>({default:e.ImportListings}))),T=24,It=["all","purchases","sales"],W="section",de="listings",G="view",At="migrate";function A(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function xe(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function ge(e){const s=Number(e)/1e18;return Number.isFinite(s)?s.toLocaleString("en",{maximumFractionDigits:2}):"0"}function fe({children:e}){const s=f.useRef(null),[n,i]=f.useState(null),a=()=>{var l;const c=(l=s.current)==null?void 0:l.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(bt,{ref:s,tabIndex:0,onMouseEnter:a,onMouseLeave:()=>i(null),onFocus:a,onBlur:()=>i(null),children:[e,n?qe.createPortal(t.jsx(yt,{style:{top:n.top,left:n.left},role:"tooltip",children:o("activity.polygonMana")}),document.body):null]})}function Et({item:e}){const s=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||s,{data:i,isLoading:a}=E({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Re(e.tradeId):Q(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),c=n&&a,l=(i==null?void 0:i.name)??o("activity.itemFallback"),r=(i==null?void 0:i.thumbnail)??"",p=B({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,w=t.jsxs(t.Fragment,{children:[c?t.jsx(Z,{}):t.jsx(_,{children:r?t.jsx("img",{src:r,alt:l}):t.jsx(X,{name:"cart",size:20})}),t.jsxs(q,{children:[c?t.jsx(J,{}):t.jsx(O,{title:l,children:l}),e.quantity>1?t.jsx(z,{children:o("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]});return p?t.jsx(ee,{to:p,"data-link":"true",children:w}):t.jsx(N,{children:w})}function Lt({item:e}){const s=`@${e.registeredName}`;return t.jsxs(N,{"data-testid":"activity-name-line",children:[t.jsx(kt,{children:t.jsx("img",{src:Ue,alt:""})}),t.jsxs(q,{children:[t.jsx(O,{title:s,children:s}),t.jsx(z,{children:o("activity.nameRegistration")})]}),t.jsxs(me,{children:[t.jsx(L,{className:"ccy-mark"})," ",e.credits]})]})}function Nt({order:e}){const s=Je(e.lines),n=s.reduce((c,l)=>c+l.quantity,0),i=Ye(e.status),a=i==="SETTLED"?o("activity.completed"):i==="FAILED"?o("activity.failed"):o("activity.processing");return t.jsxs(S,{"data-testid":"purchase-order",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.purchaseLabel")," · ",o("activity.itemCount",{count:n})]})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":i,children:a}),t.jsxs(k,{children:[t.jsx(L,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.totalCredits})]})]})]}),i==="FAILED"?t.jsx(vt,{children:o("activity.purchaseFailedNote")}):null,t.jsx(Y,{children:s.map(c=>c.registeredName?t.jsx(Lt,{item:c},c.key):t.jsx(Et,{item:c},c.key))})]})}function $t({sale:e}){const{data:s,isLoading:n}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(s==null?void 0:s.name)??o("activity.itemFallback"),a=(s==null?void 0:s.thumbnail)??"",c=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,l=t.jsxs(t.Fragment,{children:[n?t.jsx(Z,{}):t.jsx(_,{children:a?t.jsx("img",{src:a,alt:i}):t.jsx(X,{name:"offer",size:20})}),t.jsxs(q,{children:[n?t.jsx(J,{}):t.jsx(O,{title:i,children:i}),t.jsx(z,{children:o("activity.boughtFrom",{account:xe(e.seller)})})]})]});return t.jsxs(S,{"data-testid":"activity-mana-purchase",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.paidWithMana")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":"SETTLED",children:o("activity.completed")}),t.jsxs(k,{children:[ge(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]})]})]}),t.jsx(Y,{children:c?t.jsx(ee,{to:c,"data-link":"true",children:l}):t.jsx(N,{children:l})})]})}function Pt({sale:e,payout:s}){const{data:n,isLoading:i}=E({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>Q(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),a=(n==null?void 0:n.name)??o("activity.itemFallback"),c=(n==null?void 0:n.thumbnail)??"",l=B({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,r=t.jsxs(t.Fragment,{children:[i?t.jsx(Z,{}):t.jsx(_,{children:c?t.jsx("img",{src:c,alt:a}):t.jsx(X,{name:"offer",size:20})}),t.jsxs(q,{children:[i?t.jsx(J,{}):t.jsx(O,{title:a,children:a}),t.jsxs(z,{children:[o("activity.soldTo",{account:xe(e.counterparty)}),s.kind==="pending"?` · ${o("activity.payoutPendingOn",{date:A(s.availableAt)})}`:""]})]})]});return t.jsxs(S,{"data-testid":"activity-sale",children:[t.jsxs(C,{children:[t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsx(M,{children:o("activity.saleLabel")})]}),t.jsxs(H,{children:[t.jsx(R,{"data-status":s.kind==="pending"?"PENDING":"SOLD",children:s.kind==="pending"?o("activity.payoutPending"):o("activity.sold")}),s.kind==="direct"?t.jsxs(k,{"data-kind":"income",children:["+",ge(e.manaWei)," ",t.jsx(fe,{children:t.jsx(pe,{src:le,alt:"MANA"})})]}):s.credits!==null?t.jsxs(k,{"data-kind":"income",children:[t.jsx(L,{className:"ccy-mark"})," +",Me(s.credits)]}):t.jsx(k,{"data-kind":"income",children:o("activity.payoutCredited")})]})]}),t.jsx(Y,{children:l?t.jsx(ee,{to:l,"data-link":"true",children:r}):t.jsx(N,{children:r})})]})}function Tt({order:e}){const s=`$${(e.usdCents/100).toFixed(2)}`,n=Fe(e.status),i=n==="SETTLED"?o("activity.completed"):n==="FAILED"?o("activity.failed"):n==="UNFINISHED"?o("activity.unfinished"):o("activity.processing"),a=U(m=>m.session),c=De(),[l,r]=f.useState(!1),p=e.status==="initiated"&&!!a;f.useEffect(()=>{const m=()=>r(!1);return window.addEventListener("pageshow",m),()=>window.removeEventListener("pageshow",m)},[]);async function w(){if(!(!a||l)){r(!0);try{const m=await He(e.id,a.identity);if(m.kind==="url"){if(/^https:\/\/([a-z0-9-]+\.)*stripe\.com\//i.test(m.url)){window.location.href=m.url;return}$.error(o("activity.resumeUnavailable"))}else m.kind==="expired"?($.info(o("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})):m.kind==="paid"?($.success(o("activity.resumePaid")),c.invalidateQueries({queryKey:["credit-orders"]})):$.error(o("activity.resumeUnavailable"));r(!1)}catch{r(!1)}}}return t.jsx(S,{"data-testid":"credit-order",children:t.jsxs(C,{children:[t.jsx(gt,{children:t.jsx("img",{src:dt,alt:"","aria-hidden":!0})}),t.jsxs(F,{children:[t.jsx(D,{children:A(e.createdAt)}),t.jsxs(M,{children:[o("activity.creditPurchaseLabel")," · ",o("activity.creditPaid",{usd:s})]})]}),t.jsxs(H,{children:[p?t.jsx(ft,{type:"button",onClick:()=>void w(),disabled:l,"data-testid":"resume-order",children:l?o("activity.resuming"):o("activity.resume")}):null,t.jsx(R,{"data-status":n,children:i}),t.jsxs(k,{"data-kind":n==="UNFINISHED"?void 0:"income",children:[n==="UNFINISHED"?"":"+",t.jsx(L,{className:"ccy-mark"})," ",t.jsx(K,{credits:e.credits})]})]})]})})}function St({filter:e}){const s={all:o("activity.emptyAllBody"),purchases:o("activity.emptyPurchasesBody"),sales:o("activity.emptySalesBody")}[e];return t.jsx(jt,{children:t.jsx(ce,{testId:`activity-empty-${e}`,icon:We,title:o("activity.emptyTitle"),body:s,cta:{label:o("assets.empty.cta"),to:"/items"}})})}function Qt(){const{session:e,signIn:s}=U(),[n,i]=f.useState("all"),[a,c]=_e(),l=a.get(W)===de||a.get(G)===At;$e({title:l?o("seo.import.title"):o("nav.activity"),noindex:!0});const{count:r}=ze(),{count:p}=ot(),m=r!==void 0&&p!==void 0&&(r>0||p>0||l),x=!!e&&!l&&n!=="sales",g=!!e&&!l&&n!=="purchases",b=P(["purchases",e==null?void 0:e.address],u=>Se(e.address,e.identity,{first:T,skip:u}),{enabled:x}),y=P(["sales",e==null?void 0:e.address],u=>ne(e.address,{role:"seller",first:T,skip:u}),{enabled:g}),v=P(["credit-orders",e==null?void 0:e.address],u=>ae(e.address,e.identity,{first:T,skip:u}),{enabled:x}),j=P(["mana-purchases",e==null?void 0:e.address],u=>ne(e.address,{role:"buyer",first:T,skip:u}),{enabled:x}),{data:te}=E({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ae(e.address,e.identity,{first:200}).then(u=>u.payouts),enabled:g,staleTime:6e4}),be=f.useMemo(()=>nt(te),[te]),{data:ye}=Pe(g);if(!e)return t.jsx(Te,{children:t.jsx(ce,{testId:"activity-signin",icon:Ke,title:o("activity.signInTitle"),body:o("activity.signInBody"),cta:{label:o("storeSettings.signIn"),onClick:()=>s()},ctaVariant:"solid",fill:!0})});const ie=st(it({purchases:x?b.items:[],sales:g?y.items:[],creditOrders:x?v.items:[],manaPurchases:x?j.items:[],rate:ye}),n),ve=x&&(b.isLoading||v.isLoading||j.isLoading)||g&&y.isLoading,se=x&&(b.isFetchingNextPage||v.isFetchingNextPage||j.isFetchingNextPage)||g&&y.isFetchingNextPage,je=x&&(b.hasNextPage||v.hasNextPage||j.hasNextPage)||g&&y.hasNextPage;function ke(){x&&b.hasNextPage&&b.fetchNextPage(),x&&v.hasNextPage&&v.fetchNextPage(),x&&j.hasNextPage&&j.fetchNextPage(),g&&y.hasNextPage&&y.fetchNextPage()}function we(u){if(i(u),!l)return;const I=new URLSearchParams(a);I.delete(W),I.delete(G),c(I,{replace:!0})}function Ie(){const u=new URLSearchParams(a);u.set(W,de),u.delete(G),c(u,{replace:!0})}return t.jsxs(ct,{children:[t.jsx(lt,{children:t.jsx(ut,{children:o("nav.activity")})}),t.jsxs(ht,{role:"tablist","aria-label":o("nav.activity"),children:[It.map(u=>t.jsx(he,{type:"button",role:"tab","aria-selected":!l&&n===u,"data-active":!l&&n===u,"data-testid":`activity-filter-${u}`,onClick:()=>we(u),children:o(`activity.filter.${u}`)},u)),m?t.jsxs(pt,{type:"button",role:"tab","aria-selected":l,"data-active":l,"data-testid":"activity-filter-migrate","aria-label":r?o("activity.migrate.chipAria",{count:r}):void 0,onClick:Ie,children:[o("activity.migrate.chip"),r?t.jsx(mt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:r}):null]}):null]}),l?t.jsx(f.Suspense,{fallback:t.jsx(xt,{"aria-busy":"true"}),children:t.jsx(wt,{})}):ve?t.jsx(re,{children:Array.from({length:5}).map((u,I)=>t.jsx(oe,{},I))}):ie.length===0?t.jsx(St,{filter:n}):t.jsxs(t.Fragment,{children:[t.jsxs(re,{children:[ie.map(u=>u.kind==="purchase"?t.jsx(Nt,{order:u.order},u.id):u.kind==="credit"?t.jsx(Tt,{order:u.order},u.id):u.kind==="mana-purchase"?t.jsx($t,{sale:u.sale},u.id):t.jsx(Pt,{sale:u.sale,payout:at(be,u.sale)},u.id)),se?t.jsx(oe,{}):null]}),t.jsx(Ge,{hasNextPage:je,isFetching:se,onLoadMore:ke})]})]})}export{Qt as Activity};
373
+ //# sourceMappingURL=Activity-O6LT8hqU.js.map
@@ -1,4 +1,4 @@
1
- import{r as u,j as d}from"./react-BgjNrwEJ.js";import{s as m}from"./index-BTM4cu-0.js";import"./dcl-schemas-DtCjG7r3.js";import"./sentry-Dnu7IBJF.js";import"./ethers-BzSO0Arq.js";import"./intl-AKLEHPeO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="94a47f13-d85b-464a-b112-ed06e6975c1a",e._sentryDebugIdIdentifier="sentry-dbid-94a47f13-d85b-464a-b112-ed06e6975c1a")}catch{}})();const D="https://cdn.decentraland.org/@dcl/shop/1.13.1-35089162367.commit-0e406b3/_assets/custom-welcome-background-BxlFQma9.webp",P="https://cdn.decentraland.org/@dcl/shop/1.13.1-35089162367.commit-0e406b3/_assets/DCL_LogoPattern-BryBPc3d.png",L=`
1
+ import{r as u,j as d}from"./react-BDtnT4_L.js";import{s as f}from"./index-CyVGgMkK.js";import"./dcl-schemas-BfFZv5Pe.js";import"./sentry-DJtBihbA.js";import"./ethers-rfaBand6.js";import"./intl-AKLEHPeO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="279f19d4-0752-4708-b9ec-9f4cb0f7a02b",e._sentryDebugIdIdentifier="sentry-dbid-279f19d4-0752-4708-b9ec-9f4cb0f7a02b")}catch{}})();const D="https://cdn.decentraland.org/@dcl/shop/1.13.1-35110739985.commit-7718205/_assets/custom-welcome-background-BxlFQma9.webp",P="https://cdn.decentraland.org/@dcl/shop/1.13.1-35110739985.commit-7718205/_assets/DCL_LogoPattern-BryBPc3d.png",L=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -77,11 +77,11 @@ void main() {
77
77
 
78
78
  gl_FragColor = result;
79
79
  }
80
- `;function p(e,a,n){const r=e.createShader(a);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(console.error("Shader compile error:",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function B(e,a,n){const r=e.createProgram();return r?(e.attachShader(r,a),e.attachShader(r,n),e.linkProgram(r),e.getProgramParameter(r,e.LINK_STATUS)?r:(console.error("Program link error:",e.getProgramInfoLog(r)),e.deleteProgram(r),null)):null}function F(e,a,n){const r=e.createTexture();if(!r)return null;e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([128,128,128,255]));const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{n!=null&&n()||(e.bindTexture(e.TEXTURE_2D,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.generateMipmap(e.TEXTURE_2D))},o.src=a,r}const C=m.div`
80
+ `;function p(e,a,n){const r=e.createShader(a);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(console.error("Shader compile error:",e.getShaderInfoLog(r)),e.deleteShader(r),null)):null}function B(e,a,n){const r=e.createProgram();return r?(e.attachShader(r,a),e.attachShader(r,n),e.linkProgram(r),e.getProgramParameter(r,e.LINK_STATUS)?r:(console.error("Program link error:",e.getProgramInfoLog(r)),e.deleteProgram(r),null)):null}function F(e,a,n){const r=e.createTexture();if(!r)return null;e.bindTexture(e.TEXTURE_2D,r),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([128,128,128,255]));const o=new Image;return o.crossOrigin="anonymous",o.onload=()=>{n!=null&&n()||(e.bindTexture(e.TEXTURE_2D,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.generateMipmap(e.TEXTURE_2D))},o.src=a,r}const C=f.div`
81
81
  position: absolute;
82
82
  inset: 0;
83
83
  overflow: hidden;
84
- `,k=m.div`
84
+ `,k=f.div`
85
85
  position: absolute;
86
86
  inset: 0;
87
87
  width: 100%;
@@ -89,10 +89,10 @@ void main() {
89
89
  background-size: cover;
90
90
  background-position: center;
91
91
  background-repeat: no-repeat;
92
- `,V=m.canvas`
92
+ `,V=f.canvas`
93
93
  position: absolute;
94
94
  inset: 0;
95
95
  width: 100%;
96
96
  height: 100%;
97
- `;function K({patternTiling:e=1.66}){const a=u.useRef(null),n=u.useRef(0),r=u.useRef(e);return r.current=e,u.useEffect(()=>{var _;const o=a.current;if(!o||(_=window.matchMedia)!=null&&_.call(window,"(prefers-reduced-motion: reduce)").matches)return;const t=o.getContext("webgl",{alpha:!1,antialias:!1});if(!t)return;const c=p(t,t.VERTEX_SHADER,L),s=p(t,t.FRAGMENT_SHADER,I);if(!c||!s){c&&t.deleteShader(c),s&&t.deleteShader(s);return}const i=B(t,c,s);if(!i){t.deleteShader(c),t.deleteShader(s);return}const f=t.getAttribLocation(i,"a_position"),R=t.getUniformLocation(i,"u_time"),w=t.getUniformLocation(i,"u_resolution"),b=t.getUniformLocation(i,"u_overlayTex"),A=t.getUniformLocation(i,"u_overlayTiling"),v=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW);let g=!1;const h=F(t,P,()=>g),S=()=>{const l=window.devicePixelRatio||1,E=o.clientWidth*l,x=o.clientHeight*l;(o.width!==E||o.height!==x)&&(o.width=E,o.height=x)},U=performance.now()/1e3,y=()=>{S(),t.viewport(0,0,o.width,o.height),t.useProgram(i),t.uniform1f(R,performance.now()/1e3-U),t.uniform2f(w,o.width,o.height),t.uniform1f(A,r.current),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,h),t.uniform1i(b,0),t.enableVertexAttribArray(f),t.bindBuffer(t.ARRAY_BUFFER,v),t.vertexAttribPointer(f,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLES,0,6),n.current=requestAnimationFrame(y)},T=l=>{l.preventDefault(),cancelAnimationFrame(n.current),o.style.opacity="0"};return o.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(y),()=>{g=!0,cancelAnimationFrame(n.current),o.removeEventListener("webglcontextlost",T),t.deleteProgram(i),t.deleteShader(c),t.deleteShader(s),t.deleteBuffer(v),t.deleteTexture(h)}},[]),d.jsxs(C,{"aria-hidden":!0,children:[d.jsx(k,{style:{backgroundImage:`url(${D})`}}),d.jsx(V,{ref:a})]})}export{K as default};
98
- //# sourceMappingURL=AnimatedBackground-DRpjnuJP.js.map
97
+ `;function K({patternTiling:e=1.66}){const a=u.useRef(null),n=u.useRef(0),r=u.useRef(e);return r.current=e,u.useEffect(()=>{var _;const o=a.current;if(!o||(_=window.matchMedia)!=null&&_.call(window,"(prefers-reduced-motion: reduce)").matches)return;const t=o.getContext("webgl",{alpha:!1,antialias:!1});if(!t)return;const c=p(t,t.VERTEX_SHADER,L),s=p(t,t.FRAGMENT_SHADER,I);if(!c||!s){c&&t.deleteShader(c),s&&t.deleteShader(s);return}const i=B(t,c,s);if(!i){t.deleteShader(c),t.deleteShader(s);return}const m=t.getAttribLocation(i,"a_position"),R=t.getUniformLocation(i,"u_time"),w=t.getUniformLocation(i,"u_resolution"),b=t.getUniformLocation(i,"u_overlayTex"),A=t.getUniformLocation(i,"u_overlayTiling"),v=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,v),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW);let g=!1;const h=F(t,P,()=>g),S=()=>{const l=window.devicePixelRatio||1,E=o.clientWidth*l,x=o.clientHeight*l;(o.width!==E||o.height!==x)&&(o.width=E,o.height=x)},U=performance.now()/1e3,y=()=>{S(),t.viewport(0,0,o.width,o.height),t.useProgram(i),t.uniform1f(R,performance.now()/1e3-U),t.uniform2f(w,o.width,o.height),t.uniform1f(A,r.current),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,h),t.uniform1i(b,0),t.enableVertexAttribArray(m),t.bindBuffer(t.ARRAY_BUFFER,v),t.vertexAttribPointer(m,2,t.FLOAT,!1,0,0),t.drawArrays(t.TRIANGLES,0,6),n.current=requestAnimationFrame(y)},T=l=>{l.preventDefault(),cancelAnimationFrame(n.current),o.style.opacity="0"};return o.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(y),()=>{g=!0,cancelAnimationFrame(n.current),o.removeEventListener("webglcontextlost",T),t.deleteProgram(i),t.deleteShader(c),t.deleteShader(s),t.deleteBuffer(v),t.deleteTexture(h)}},[]),d.jsxs(C,{"aria-hidden":!0,children:[d.jsx(k,{style:{backgroundImage:`url(${D})`}}),d.jsx(V,{ref:a})]})}export{K as default};
98
+ //# sourceMappingURL=AnimatedBackground-CB4PvfXA.js.map
@@ -1,4 +1,4 @@
1
- import{r as u,u as Ve,j as e,a as dt}from"./react-BgjNrwEJ.js";import{h as Q,r as ht,i as pt,bH as ut,bD as ft,aI as mt,n as xt,E as gt,cJ as bt,cK as yt,s as i,d as t,F as Qe,bn as wt,L as vt,S as $e,c as s,e as jt,I as _,K as D,cL as he,bl as Ct,al as ce,bx as We,bG as $t,bF as kt,J as Ze,X as Ke,m as Je,cM as St,G as Et,az as Tt,Z as Rt,a0 as Fe,a1 as te,aQ as _t,bQ as It}from"./index-BTM4cu-0.js";import{u as Lt,s as Nt}from"./search-empty-DtZQ-HDE.js";import{i as At,u as zt,j as Mt,S as Wt,R as Ft,a as Bt,b as Pt,c as Ot,D as Ut,d as Ht,C as Dt,e as Gt,F as qt,f as Vt,g as Qt,M as Zt,h as Kt}from"./browseLayout.styles-DpMLT488.js";import{L as Jt}from"./LoadMore-BIYZWNS_.js";import{u as Xt}from"./useInfiniteGrid-DSCqBx9m.js";import{n as Yt,S as en}from"./categories-C7j5ito7.js";import{E as tn}from"./ErrorNotice-Bad8DXlE.js";import{d as nn}from"./dcl-schemas-DtCjG7r3.js";import{s as sn,G as on,w as an,S as rn}from"./buy-gasless-2AtEStAb.js";import{t as ln,u as cn}from"./buy-D3bggF5F.js";import{f as dn}from"./errors-DwTDExim.js";import{J as hn,C as pn,B as ke}from"./ethers-BzSO0Arq.js";import{n as un}from"./name-glyph-aUugT8vq.js";import{c as fn}from"./crumbs.styles-g8BBq9ew.js";import{G as mn}from"./grid.styles-DBQapXvv.js";import"./sentry-Dnu7IBJF.js";import"./intl-AKLEHPeO.js";import"./skeleton.styles-RN6Pyt5j.js";import"./authorizations-BY8rUeq2.js";import"./sendMetaTransaction-BB1HX_Rt.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new n.Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="0d6a3dd4-270b-4753-a846-321079f587e1",n._sentryDebugIdIdentifier="sentry-dbid-0d6a3dd4-270b-4753-a846-321079f587e1")}catch{}})();function ne(n){const o=n.source??"item",r=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${o}:${r}`}const K="100000000000000000000",Xe=2,de=15,xn=/^[a-zA-Z0-9]+$/;function Be(n){const o=n.trim();return o.length===0?{ok:!1,reason:"empty"}:xn.test(o)?o.length<Xe?{ok:!1,reason:"too-short"}:o.length>de?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function gn(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,de)}const bn=["function available(string _subdomain) view returns (bool)"],Pe={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function yn(){return Q.chainId===Number(nn.ChainId.MATIC_MAINNET)?Pe.mainnet:Pe.sepolia}async function wn(n,o={}){var m;const{rpc:r,address:h}=yn(),d=new hn(r),b=new pn(h,bn,d);console.info(`[names] availability check → DCLRegistrar(${h}).available("${n}") on ${r}`);const l=await b.available(n);if((m=o.signal)!=null&&m.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${l}`),l?"available":"taken"}const vn="https://app.across.to/api";class Te extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}class Se extends Error{constructor(){super("The name could not be registered on Ethereum; your funds were recovered."),this.name="NameNotRegisteredError"}}class Ee extends Error{constructor(){super("We couldn't confirm whether the purchase went through."),this.name="NameSettlementUnknownError"}}function jn(n){return mt(K,n)}async function Cn(n,o,r={}){var m;const h=r.chainId??Q.chainId,d=r.provider??"across",b=`${Q.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(o)}&chainId=${h}&provider=${d}`,l=await xt(b,{method:"GET",identity:n,metadata:{}});if(!l.ok){let c;try{c=(m=await l.json())==null?void 0:m.code}catch{}throw c==="ROUTE_COST_TOO_HIGH"?new Te:new Error(`fetchNameCreditRoute ${l.status}`)}return l.json()}function $n(n,o){const r=ke.from(n.availableAmount),d=ke.from(K).sub(r);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:cn(n.id)}],creditsSignatures:[n.signature],externalCall:{target:o.externalCall.target,selector:o.externalCall.selector,data:o.externalCall.data,expiresAt:o.externalCall.expiresAt,salt:o.externalCall.salt},customExternalCallSignature:o.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:K}}async function kn(n,o={}){const r=vn,h=o.intervalMs??1e4,d=o.maxAttempts??60;let b={status:"pending",destinationTxHash:null,actionsSucceeded:null};for(let l=0;l<d;l++){try{const m=await fetch(`${r}/deposit/status?originChainId=137&depositTxHash=${n}`);if(m.ok){const c=await m.json(),y=(c.status??"pending").toLowerCase(),f=c.fillTx??c.fillTxnRef??null,j=typeof c.actionsSucceeded=="boolean"?c.actionsSucceeded:null;if(y==="filled")return{status:"filled",destinationTxHash:f,actionsSucceeded:j};if(y==="refunded"||y==="expired")return{status:y,destinationTxHash:null,actionsSucceeded:!1};b={status:"pending",destinationTxHash:f,actionsSucceeded:j}}}catch{}l<d-1&&await new Promise(m=>setTimeout(m,h))}return b}async function Sn(n){const{name:o,identity:r,signer:h}=n,d=f=>{var j;try{(j=n.onProgress)==null||j.call(n,f)}catch{}},b=n.chainId??Q.chainId,l=n.provider??"across",m=(n.beneficiary??await h.getAddress()).toLowerCase();let c=null,y="unconfirmed";console.info("[names] register start",{name:o,buyer:m,chainId:b,provider:l}),d("preparing");try{const f=await ht(pt(Q.chainId).address),j=jn(f);console.info("[names] step 1/6 sized reservation",{usdCents:j,manaRate:f});const C=await Cn(r,o,{chainId:b,provider:l});console.info("[names] step 2/6 route fetched",{target:C.externalCall.target,selector:C.externalCall.selector,provider:C.provider,quoteId:C.quoteId});const x=await ut(r,j,void 0,void 0,o);if(c=x.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:x.credit.id,maxCreditedValue:x.maxCreditedValue}),ke.from(x.maxCreditedValue).lt(K))throw new Error("Credit under-sized for the name price");d("awaiting-confirmation");const S=$n(x.credit,C);let p;try{p=await sn({chainId:b,buyer:m,signer:h,args:S})}catch(g){if(!(g instanceof on))throw g;if(g.reason==="relayer-unreachable"){y="unobservable";const I=new Ee;throw I.cause=g,I}p=await ln(b,S,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:p}),d("confirming"),await an(p),y="confirmed",console.info("[names] step 5/6 origin tx confirmed",{originTxHash:p}),l==="across"){d("registering");const g=await kn(p,n.acrossPoll);if(console.info("[names] step 6/6 across status",g),g.status==="pending")return{status:"pending",originTxHash:p};if(g.status==="filled"&&g.actionsSucceeded===null)return console.warn("[names] across filled without reporting actionsSucceeded — reporting pending",{originTxHash:p}),{status:"pending",originTxHash:p};if(g.status!=="filled"||g.actionsSucceeded!==!0)throw new Se;return{status:"registered",originTxHash:p,destinationTxHash:g.destinationTxHash}}return{status:"pending",originTxHash:p}}catch(f){if(console.error("[names] register failed — raw error:",f,{name:o,buyer:m,originState:y}),f instanceof rn)return{status:"pending",originTxHash:f.txHash};if(c&&y==="unconfirmed"&&await ft(r,[c]).catch(()=>{}),f instanceof Te||f instanceof Se||f instanceof Ee)throw f;const j=new Error(dn(f,"Couldn't register the name. Please try again.",{sale:!0}));throw j.cause=f,j}}function En(){const{data:n}=gt({queryKey:["feature-flag","shop-names"],queryFn:()=>bt(yt.SHOP_NAMES),staleTime:6e4,refetchOnWindowFocus:!0,retry:1});return n===!0}const Tn=60,Rn=700,_n=25;function In(n){if(!n)return[];const o=[];for(let r=1;r<=n.length;r++)o.push({text:n.slice(0,r),delay:Tn});o[o.length-1]={text:n,delay:Rn};for(let r=n.length-1;r>=1;r--)o.push({text:n.slice(0,r),delay:_n});return o}function Ln(n){return n.flatMap(In)}function Nn(n,o){const r=u.useMemo(()=>Ln(n),[n]),[h,d]=u.useState(0);return u.useEffect(()=>{if(!o||r.length===0)return;const b=setTimeout(()=>d(l=>(l+1)%r.length),r[h%r.length].delay);return()=>clearTimeout(b)},[h,o,r]),!o||r.length===0?"":r[h%r.length].text}const An="https://cdn.decentraland.org/@dcl/shop/1.13.1-35089162367.commit-0e406b3/_assets/name-verified-oGwQ3ntb.svg",zn="#34fee6",Mn=i.div`
1
+ import{r as u,u as Ve,j as e,a as dt}from"./react-BDtnT4_L.js";import{e as Q,r as ht,h as pt,bH as ut,bD as ft,aI as mt,j as xt,D as gt,cJ as bt,cK as yt,s as i,d as t,E as Qe,bn as wt,L as vt,S as $e,c as s,J as jt,I as _,K as D,cL as he,bl as Ct,al as ce,bx as We,bG as $t,bF as kt,H as Ze,X as Ke,m as Je,cM as St,F as Et,az as Tt,Z as Rt,a0 as Fe,a1 as te,aQ as _t,bQ as It}from"./index-CyVGgMkK.js";import{u as Lt,s as Nt}from"./search-empty-D0-TyK_V.js";import{i as At,u as zt,j as Mt,S as Wt,R as Ft,a as Bt,b as Pt,c as Ot,D as Ut,d as Ht,C as Dt,e as Gt,F as qt,f as Vt,g as Qt,M as Zt,h as Kt}from"./browseLayout.styles-DJ6ptfco.js";import{L as Jt}from"./LoadMore-D1ApwWXh.js";import{u as Xt}from"./useInfiniteGrid-3LXYF7KT.js";import{n as Yt,S as en}from"./categories-BNbtxrs7.js";import{E as tn}from"./ErrorNotice-CehMoY9b.js";import{d as nn}from"./dcl-schemas-BfFZv5Pe.js";import{s as sn,G as on,w as an,S as rn}from"./buy-gasless-DG2qGHrJ.js";import{t as ln,u as cn}from"./buy-CiksvueJ.js";import{f as dn}from"./errors-BAO7_A7a.js";import{J as hn,C as pn,B as ke}from"./ethers-rfaBand6.js";import{n as un}from"./name-glyph-aUugT8vq.js";import{c as fn}from"./crumbs.styles-BD0KsEdc.js";import{G as mn}from"./grid.styles-BRtgKeAE.js";import"./sentry-DJtBihbA.js";import"./intl-AKLEHPeO.js";import"./skeleton.styles-Cqgtx7q8.js";import"./authorizations-BF60RZYU.js";import"./sendMetaTransaction-CVkzKCvR.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new n.Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="9748e949-af63-43ab-808f-29ad63da4ba6",n._sentryDebugIdIdentifier="sentry-dbid-9748e949-af63-43ab-808f-29ad63da4ba6")}catch{}})();function ne(n){const o=n.source??"item",r=n.tradeId||`${n.contractAddress}-${n.tokenId??n.itemId??""}`;return`${o}:${r}`}const K="100000000000000000000",Xe=2,de=15,xn=/^[a-zA-Z0-9]+$/;function Be(n){const o=n.trim();return o.length===0?{ok:!1,reason:"empty"}:xn.test(o)?o.length<Xe?{ok:!1,reason:"too-short"}:o.length>de?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function gn(n){return n.replace(/[^a-zA-Z0-9]/g,"").slice(0,de)}const bn=["function available(string _subdomain) view returns (bool)"],Pe={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function yn(){return Q.chainId===Number(nn.ChainId.MATIC_MAINNET)?Pe.mainnet:Pe.sepolia}async function wn(n,o={}){var m;const{rpc:r,address:h}=yn(),d=new hn(r),b=new pn(h,bn,d);console.info(`[names] availability check → DCLRegistrar(${h}).available("${n}") on ${r}`);const l=await b.available(n);if((m=o.signal)!=null&&m.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${n}" available=${l}`),l?"available":"taken"}const vn="https://app.across.to/api";class Te extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}class Se extends Error{constructor(){super("The name could not be registered on Ethereum; your funds were recovered."),this.name="NameNotRegisteredError"}}class Ee extends Error{constructor(){super("We couldn't confirm whether the purchase went through."),this.name="NameSettlementUnknownError"}}function jn(n){return mt(K,n)}async function Cn(n,o,r={}){var m;const h=r.chainId??Q.chainId,d=r.provider??"across",b=`${Q.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(o)}&chainId=${h}&provider=${d}`,l=await xt(b,{method:"GET",identity:n,metadata:{}});if(!l.ok){let c;try{c=(m=await l.json())==null?void 0:m.code}catch{}throw c==="ROUTE_COST_TOO_HIGH"?new Te:new Error(`fetchNameCreditRoute ${l.status}`)}return l.json()}function $n(n,o){const r=ke.from(n.availableAmount),d=ke.from(K).sub(r);return{credits:[{value:n.amount,expiresAt:Number(n.expiresAt),salt:cn(n.id)}],creditsSignatures:[n.signature],externalCall:{target:o.externalCall.target,selector:o.externalCall.selector,data:o.externalCall.data,expiresAt:o.externalCall.expiresAt,salt:o.externalCall.salt},customExternalCallSignature:o.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:K}}async function kn(n,o={}){const r=vn,h=o.intervalMs??1e4,d=o.maxAttempts??60;let b={status:"pending",destinationTxHash:null,actionsSucceeded:null};for(let l=0;l<d;l++){try{const m=await fetch(`${r}/deposit/status?originChainId=137&depositTxHash=${n}`);if(m.ok){const c=await m.json(),y=(c.status??"pending").toLowerCase(),f=c.fillTx??c.fillTxnRef??null,j=typeof c.actionsSucceeded=="boolean"?c.actionsSucceeded:null;if(y==="filled")return{status:"filled",destinationTxHash:f,actionsSucceeded:j};if(y==="refunded"||y==="expired")return{status:y,destinationTxHash:null,actionsSucceeded:!1};b={status:"pending",destinationTxHash:f,actionsSucceeded:j}}}catch{}l<d-1&&await new Promise(m=>setTimeout(m,h))}return b}async function Sn(n){const{name:o,identity:r,signer:h}=n,d=f=>{var j;try{(j=n.onProgress)==null||j.call(n,f)}catch{}},b=n.chainId??Q.chainId,l=n.provider??"across",m=(n.beneficiary??await h.getAddress()).toLowerCase();let c=null,y="unconfirmed";console.info("[names] register start",{name:o,buyer:m,chainId:b,provider:l}),d("preparing");try{const f=await ht(pt(Q.chainId).address),j=jn(f);console.info("[names] step 1/6 sized reservation",{usdCents:j,manaRate:f});const C=await Cn(r,o,{chainId:b,provider:l});console.info("[names] step 2/6 route fetched",{target:C.externalCall.target,selector:C.externalCall.selector,provider:C.provider,quoteId:C.quoteId});const x=await ut(r,j,void 0,void 0,o);if(c=x.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:x.credit.id,maxCreditedValue:x.maxCreditedValue}),ke.from(x.maxCreditedValue).lt(K))throw new Error("Credit under-sized for the name price");d("awaiting-confirmation");const S=$n(x.credit,C);let p;try{p=await sn({chainId:b,buyer:m,signer:h,args:S})}catch(g){if(!(g instanceof on))throw g;if(g.reason==="relayer-unreachable"){y="unobservable";const I=new Ee;throw I.cause=g,I}p=await ln(b,S,h)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:p}),d("confirming"),await an(p),y="confirmed",console.info("[names] step 5/6 origin tx confirmed",{originTxHash:p}),l==="across"){d("registering");const g=await kn(p,n.acrossPoll);if(console.info("[names] step 6/6 across status",g),g.status==="pending")return{status:"pending",originTxHash:p};if(g.status==="filled"&&g.actionsSucceeded===null)return console.warn("[names] across filled without reporting actionsSucceeded — reporting pending",{originTxHash:p}),{status:"pending",originTxHash:p};if(g.status!=="filled"||g.actionsSucceeded!==!0)throw new Se;return{status:"registered",originTxHash:p,destinationTxHash:g.destinationTxHash}}return{status:"pending",originTxHash:p}}catch(f){if(console.error("[names] register failed — raw error:",f,{name:o,buyer:m,originState:y}),f instanceof rn)return{status:"pending",originTxHash:f.txHash};if(c&&y==="unconfirmed"&&await ft(r,[c]).catch(()=>{}),f instanceof Te||f instanceof Se||f instanceof Ee)throw f;const j=new Error(dn(f,"Couldn't register the name. Please try again.",{sale:!0}));throw j.cause=f,j}}function En(){const{data:n}=gt({queryKey:["feature-flag","shop-names"],queryFn:()=>bt(yt.SHOP_NAMES),staleTime:6e4,refetchOnWindowFocus:!0,retry:1});return n===!0}const Tn=60,Rn=700,_n=25;function In(n){if(!n)return[];const o=[];for(let r=1;r<=n.length;r++)o.push({text:n.slice(0,r),delay:Tn});o[o.length-1]={text:n,delay:Rn};for(let r=n.length-1;r>=1;r--)o.push({text:n.slice(0,r),delay:_n});return o}function Ln(n){return n.flatMap(In)}function Nn(n,o){const r=u.useMemo(()=>Ln(n),[n]),[h,d]=u.useState(0);return u.useEffect(()=>{if(!o||r.length===0)return;const b=setTimeout(()=>d(l=>(l+1)%r.length),r[h%r.length].delay);return()=>clearTimeout(b)},[h,o,r]),!o||r.length===0?"":r[h%r.length].text}const An="https://cdn.decentraland.org/@dcl/shop/1.13.1-35110739985.commit-7718205/_assets/name-verified-oGwQ3ntb.svg",zn="#34fee6",Mn=i.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -458,7 +458,7 @@ import{r as u,u as Ve,j as e,a as dt}from"./react-BgjNrwEJ.js";import{h as Q,r a
458
458
  color: ${t.colors.accent};
459
459
  }
460
460
  }
461
- `;function rs({name:n,priceCredits:o,onClose:r}){const{session:h}=Qe(),{data:d,isError:b}=wt(h),l=vt(),m=Ve(),[c,y]=u.useState("confirm"),[f,j]=u.useState(""),[C,x]=u.useState(null),[S,p]=u.useState(!1),[g,I]=u.useState("preparing"),L=u.useRef(!1),N=f.trim().toLowerCase()===n.toLowerCase(),E=c==="completing",P=o!=null?$e(o):"—",$=o==null,k=d==null?void 0:d.credits,A=o!=null&&k!=null?o-k:0,T=A>0,G=$?s("names.priceUnavailable"):T?s("names.insufficientCredits",{credits:$e(A)}):null;u.useEffect(()=>{const w=O=>{O.key==="Escape"&&!E&&r()};document.addEventListener("keydown",w);const B=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",w),document.body.style.overflow=B}},[E,r]);async function z(){if(!(!h||!N||$||T||L.current)){L.current=!0,y("completing"),x(null),I("preparing");try{const w=await Sn({name:n,identity:h.identity,signer:h.signer,onProgress:I});ce("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:We(o??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:o??null,value_usd:We(o??0),transaction_hash:w.originTxHash??null,settlement:w.status}),l.invalidateQueries({queryKey:["usd-balance"]}),l.invalidateQueries({queryKey:["my-assets"]}),y(w.status==="registered"?"success":"pending")}catch(w){ce(kt(w)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:$t(w),purchase_type:"name"});const B=w instanceof Se,O=w instanceof Ee;x(w instanceof Te?s("names.errorRouteCost"):B?s("names.errorNotRegistered"):O?s("names.errorSettlementUnknown"):(w==null?void 0:w.message)||s("names.errorGeneric")),p(B||O),y("error")}finally{L.current=!1}}}const M=c!=="success"&&c!=="pending",v=jt(h==null?void 0:h.providerType),W=v?2:1,F=v&&(g==="preparing"||g==="awaiting-confirmation"),R=F?1:W,J=F?s("names.confirming"):s("names.completing"),Z=g==="registering"?s("names.processingRegistering"):null;return e.jsx(Mn,{onClick:E?void 0:r,role:"presentation",children:e.jsxs(Wn,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:w=>w.stopPropagation(),children:[M&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:c==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(fe,{onClick:r,disabled:E,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{})]}),(c==="confirm"||c==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(Oe,{"aria-hidden":!0,children:"@"}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),P]})]}),c==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Ce,{children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),S?e.jsx(je,{onClick:r,children:s("names.errorSpentDismiss")}):e.jsx(je,{onClick:()=>y("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Un,{children:[e.jsx(Hn,{children:s("names.confirmTitle")}),e.jsx(Dn,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${ls(n)}</b>`})}}),e.jsxs(Gn,{children:[e.jsx(qn,{"aria-hidden":!0,children:"@"}),e.jsx(Vn,{value:f,onChange:w=>j(w.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(f.length,8)}ch`}}),e.jsx(Qn,{children:".dcl.eth"})]})]}),G?e.jsxs(Ce,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsx("span",{children:G})]}):null,e.jsx(je,{onClick:()=>void z(),disabled:!N||!h||$||T,children:s("names.buyCta")})]})]}),c==="completing"&&e.jsxs(Zn,{children:[e.jsx(Kn,{src:Ct,alt:"",width:61,height:61}),e.jsxs(Jn,{children:[e.jsx(Xn,{children:J}),e.jsxs(es,{children:[e.jsx(ts,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(ns,{"data-testid":"name-progress-count",children:`${R}/${W}`})]}),Z?e.jsx(Yn,{children:Z}):null]})]}),c==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:s("names.pendingHeaderTitle")}),e.jsx(fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{}),e.jsxs(Ce,{"data-tone":"info",children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:s("names.pendingBannerBold")})," ",s("names.pendingBannerRest")]})]}),e.jsxs(ge,{style:{marginTop:20},children:[e.jsx(Oe,{"aria-hidden":!0,children:"@"}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),P]})]}),e.jsx(Ue,{children:e.jsx(He,{onClick:()=>{r(),m("/my-items")},children:s("names.myItems")})})]}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:s("names.successHeaderTitle")}),e.jsx(fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{}),e.jsxs(ss,{children:[e.jsx(is,{"aria-hidden":!0,children:e.jsx(_,{name:"check"})}),e.jsxs(os,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs(ge,{style:{marginTop:20},children:[e.jsxs(Fn,{"data-testid":"name-success-tile",children:[e.jsx(Bn,{src:un,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(Pn,{children:[e.jsx("span",{"aria-hidden":!0,children:n}),e.jsx(On,{src:An,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),P]})]}),e.jsxs(Ue,{children:[e.jsx(He,{onClick:()=>{r(),m("/my-items")},children:s("names.myItems")}),e.jsx(as,{href:Q.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function ls(n){return n.replace(/[&<>"']/g,o=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[o])}const cs="https://cdn.decentraland.org/@dcl/shop/1.13.1-35089162367.commit-0e406b3/_assets/identity-icon-C8yAW_Gq.svg",ds="https://cdn.decentraland.org/@dcl/shop/1.13.1-35089162367.commit-0e406b3/_assets/world-icon-6xQ-PmmW.svg",hs="https://cdn.decentraland.org/@dcl/shop/1.13.1-35089162367.commit-0e406b3/_assets/invite-icon-Bz6lCTuB.svg",ps="data:image/svg+xml,%3csvg%20width='55.6797'%20height='63.6174'%20viewBox='0%200%2055.6797%2063.6174'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vote'%3e%3cpath%20id='Vector'%20d='M0.055012%2039.1045C1.61191%2039.4989%202.83757%2039.3938%204.4307%2039.392L8.27108%2039.3878L20.7762%2039.3883L42.8819%2039.3904L50.0954%2039.3907C51.793%2039.3907%2054.0562%2039.5509%2055.6466%2039.0843C55.5909%2040.7931%2055.647%2042.8581%2055.6469%2044.5864L55.6479%2055.616L55.6559%2059.5618C55.6583%2060.6219%2055.8213%2061.9838%2055.261%2062.8837C55.2205%2062.9265%2055.1794%2062.9688%2055.1377%2063.0104C54.7986%2063.3482%2054.3791%2063.5594%2053.9021%2063.5761C52.0714%2063.642%2050.1544%2063.6097%2048.3241%2063.6078L37.4452%2063.6066L2.97352%2063.6103C2.2022%2063.6084%201.15943%2063.6718%200.589171%2063.0576C-0.204857%2062.2037%200.0327979%2060.3244%200.0349529%2059.1687L0.0414734%2054.3929C0.0413119%2049.3191%20-0.00749456%2044.1727%200.055012%2039.1045Z'%20fill='white'%20fill-opacity='0.8'/%3e%3cpath%20id='Subtract'%20d='M37.1168%200.00495927C38.1773%200.00461149%2039.2888%20-0.0284991%2040.3433%200.0811311C41.0714%200.15695%2041.7266%200.914583%2041.7857%201.63484C41.853%202.45491%2041.8268%203.31926%2041.8258%204.15144L41.8189%208.70418L41.8199%2023.9639L40.1099%2023.9659L13.8726%2023.963L13.8678%209.0909L13.8648%204.29793C13.8644%202.52652%2013.3942%200.34203%2015.6754%200.0342561C15.8907%200.016712%2016.237%200.0120998%2016.4557%200.0117952C21.6059%200.00480262%2026.761%200.0117634%2031.9107%200.00788896L37.1168%200.00495927ZM33.3834%206.17293C32.439%206.55612%2031.0531%208.12922%2030.3014%208.88191L25.8297%2013.3634C25.3537%2012.824%2023.3455%2010.7605%2022.8209%2010.4239C22.5581%2010.2549%2022.2566%2010.1546%2021.9449%2010.1329C21.4563%2010.1008%2020.9754%2010.2879%2020.6139%2010.6134C20.2442%2010.9428%2020.0227%2011.4077%2020.0006%2011.9024C19.9561%2013.0748%2021.3406%2014.1198%2022.1256%2014.8868C22.9429%2015.714%2024.1669%2017.1028%2025.1168%2017.67C26.1632%2018.2949%2027.3471%2017.2145%2027.9723%2016.4942C30.25%2014.2025%2032.5393%2011.9456%2034.8101%209.64949C35.2937%209.16062%2035.7138%208.69126%2035.6851%207.96199C35.6419%206.86558%2034.7821%206.09682%2033.6959%206.14656C33.5914%206.15085%2033.4872%206.16001%2033.3834%206.17293Z'%20fill='%23FF7439'/%3e%3cpath%20id='Vector_2'%20d='M45.5498%2015.976C46.6399%2015.986%2049.9504%2015.7705%2050.7361%2016.241C51.0104%2016.4053%2051.2831%2016.6446%2051.4181%2016.9397C51.892%2017.9763%2052.1015%2019.357%2052.3802%2020.4819L54.0582%2027.2308C54.5046%2028.9073%2054.9023%2030.6043%2055.3338%2032.2824C55.6029%2033.329%2055.9417%2034.4293%2054.9705%2035.2255C54.8158%2035.359%2054.4427%2035.5934%2054.2329%2035.6091C52.7731%2035.7184%2051.1693%2035.6701%2049.7108%2035.6679L39.4635%2035.6649L14.5239%2035.6632C10.471%2035.6631%206.41808%2035.6665%202.36531%2035.6698C1.79359%2035.6657%201.33794%2035.6604%200.844568%2035.337C-0.57365%2034.4073%200.381076%2032.2112%200.72189%2030.8501L1.93462%2025.9936L3.28579%2020.566C3.53371%2019.5688%203.77194%2018.5694%204.04289%2017.5781C4.30559%2016.6172%204.74298%2016.1492%205.73966%2015.9892C7.15095%2015.9419%208.72017%2015.9778%2010.1434%2015.9809L10.1451%2023.9585C7.37011%2024.097%207.74242%2027.5535%209.84963%2027.6469C11.6268%2027.7258%2013.6164%2027.6909%2015.4098%2027.691L26.229%2027.6915L39.1339%2027.691L43.273%2027.6909C44.748%2027.6909%2047.2174%2028.0848%2047.3773%2025.9908C47.4212%2025.4807%2047.2565%2024.9745%2046.9209%2024.5879C46.5265%2024.141%2046.1143%2024.0046%2045.5418%2023.9673L45.5498%2015.976Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",us=i.div`
461
+ `;function rs({name:n,priceCredits:o,onClose:r}){const{session:h}=Qe(),{data:d,isError:b}=wt(h),l=vt(),m=Ve(),[c,y]=u.useState("confirm"),[f,j]=u.useState(""),[C,x]=u.useState(null),[S,p]=u.useState(!1),[g,I]=u.useState("preparing"),L=u.useRef(!1),N=f.trim().toLowerCase()===n.toLowerCase(),E=c==="completing",P=o!=null?$e(o):"—",$=o==null,k=d==null?void 0:d.credits,A=o!=null&&k!=null?o-k:0,T=A>0,G=$?s("names.priceUnavailable"):T?s("names.insufficientCredits",{credits:$e(A)}):null;u.useEffect(()=>{const w=O=>{O.key==="Escape"&&!E&&r()};document.addEventListener("keydown",w);const B=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",w),document.body.style.overflow=B}},[E,r]);async function z(){if(!(!h||!N||$||T||L.current)){L.current=!0,y("completing"),x(null),I("preparing");try{const w=await Sn({name:n,identity:h.identity,signer:h.signer,onProgress:I});ce("Shop Completed Purchase",{items:[{item_id:null,contract_address:null,token_id:null,price_usd:We(o??0),category:"name",is_smart:!1}],purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:o??null,value_usd:We(o??0),transaction_hash:w.originTxHash??null,settlement:w.status}),l.invalidateQueries({queryKey:["usd-balance"]}),l.invalidateQueries({queryKey:["my-assets"]}),y(w.status==="registered"?"success":"pending")}catch(w){ce(kt(w)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:$t(w),purchase_type:"name"});const B=w instanceof Se,O=w instanceof Ee;x(w instanceof Te?s("names.errorRouteCost"):B?s("names.errorNotRegistered"):O?s("names.errorSettlementUnknown"):(w==null?void 0:w.message)||s("names.errorGeneric")),p(B||O),y("error")}finally{L.current=!1}}}const M=c!=="success"&&c!=="pending",v=jt(h==null?void 0:h.providerType),W=v?2:1,F=v&&(g==="preparing"||g==="awaiting-confirmation"),R=F?1:W,J=F?s("names.confirming"):s("names.completing"),Z=g==="registering"?s("names.processingRegistering"):null;return e.jsx(Mn,{onClick:E?void 0:r,role:"presentation",children:e.jsxs(Wn,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:w=>w.stopPropagation(),children:[M&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:c==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(fe,{onClick:r,disabled:E,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{})]}),(c==="confirm"||c==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ge,{children:[e.jsx(Oe,{"aria-hidden":!0,children:"@"}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),P]})]}),c==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(Ce,{children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),S?e.jsx(je,{onClick:r,children:s("names.errorSpentDismiss")}):e.jsx(je,{onClick:()=>y("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(Un,{children:[e.jsx(Hn,{children:s("names.confirmTitle")}),e.jsx(Dn,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${ls(n)}</b>`})}}),e.jsxs(Gn,{children:[e.jsx(qn,{"aria-hidden":!0,children:"@"}),e.jsx(Vn,{value:f,onChange:w=>j(w.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(f.length,8)}ch`}}),e.jsx(Qn,{children:".dcl.eth"})]})]}),G?e.jsxs(Ce,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsx("span",{children:G})]}):null,e.jsx(je,{onClick:()=>void z(),disabled:!N||!h||$||T,children:s("names.buyCta")})]})]}),c==="completing"&&e.jsxs(Zn,{children:[e.jsx(Kn,{src:Ct,alt:"",width:61,height:61}),e.jsxs(Jn,{children:[e.jsx(Xn,{children:J}),e.jsxs(es,{children:[e.jsx(ts,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(ns,{"data-testid":"name-progress-count",children:`${R}/${W}`})]}),Z?e.jsx(Yn,{children:Z}):null]})]}),c==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:s("names.pendingHeaderTitle")}),e.jsx(fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{}),e.jsxs(Ce,{"data-tone":"info",children:[e.jsx(_,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:s("names.pendingBannerBold")})," ",s("names.pendingBannerRest")]})]}),e.jsxs(ge,{style:{marginTop:20},children:[e.jsx(Oe,{"aria-hidden":!0,children:"@"}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),P]})]}),e.jsx(Ue,{children:e.jsx(He,{onClick:()=>{r(),m("/my-items")},children:s("names.myItems")})})]}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(ue,{children:s("names.successHeaderTitle")}),e.jsx(fe,{onClick:r,"aria-label":s("buyModal.close"),children:e.jsx(_,{name:"close"})})]}),e.jsxs(me,{children:[s("names.myCreditsBalance")," ",e.jsx(D,{})," ",he(d,b)]}),e.jsx(xe,{}),e.jsxs(ss,{children:[e.jsx(is,{"aria-hidden":!0,children:e.jsx(_,{name:"check"})}),e.jsxs(os,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs(ge,{style:{marginTop:20},children:[e.jsxs(Fn,{"data-testid":"name-success-tile",children:[e.jsx(Bn,{src:un,alt:"","aria-hidden":!0,width:47,height:47}),e.jsxs(Pn,{children:[e.jsx("span",{"aria-hidden":!0,children:n}),e.jsx(On,{src:An,alt:"","aria-hidden":!0,width:14,height:14})]})]}),e.jsxs(be,{children:[e.jsxs(ye,{children:[n,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(we,{children:s("names.subtitle")})]}),e.jsxs(ve,{children:[e.jsx(D,{}),P]})]}),e.jsxs(Ue,{children:[e.jsx(He,{onClick:()=>{r(),m("/my-items")},children:s("names.myItems")}),e.jsx(as,{href:Q.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function ls(n){return n.replace(/[&<>"']/g,o=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[o])}const cs="https://cdn.decentraland.org/@dcl/shop/1.13.1-35110739985.commit-7718205/_assets/identity-icon-C8yAW_Gq.svg",ds="https://cdn.decentraland.org/@dcl/shop/1.13.1-35110739985.commit-7718205/_assets/world-icon-6xQ-PmmW.svg",hs="https://cdn.decentraland.org/@dcl/shop/1.13.1-35110739985.commit-7718205/_assets/invite-icon-Bz6lCTuB.svg",ps="data:image/svg+xml,%3csvg%20width='55.6797'%20height='63.6174'%20viewBox='0%200%2055.6797%2063.6174'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Vote'%3e%3cpath%20id='Vector'%20d='M0.055012%2039.1045C1.61191%2039.4989%202.83757%2039.3938%204.4307%2039.392L8.27108%2039.3878L20.7762%2039.3883L42.8819%2039.3904L50.0954%2039.3907C51.793%2039.3907%2054.0562%2039.5509%2055.6466%2039.0843C55.5909%2040.7931%2055.647%2042.8581%2055.6469%2044.5864L55.6479%2055.616L55.6559%2059.5618C55.6583%2060.6219%2055.8213%2061.9838%2055.261%2062.8837C55.2205%2062.9265%2055.1794%2062.9688%2055.1377%2063.0104C54.7986%2063.3482%2054.3791%2063.5594%2053.9021%2063.5761C52.0714%2063.642%2050.1544%2063.6097%2048.3241%2063.6078L37.4452%2063.6066L2.97352%2063.6103C2.2022%2063.6084%201.15943%2063.6718%200.589171%2063.0576C-0.204857%2062.2037%200.0327979%2060.3244%200.0349529%2059.1687L0.0414734%2054.3929C0.0413119%2049.3191%20-0.00749456%2044.1727%200.055012%2039.1045Z'%20fill='white'%20fill-opacity='0.8'/%3e%3cpath%20id='Subtract'%20d='M37.1168%200.00495927C38.1773%200.00461149%2039.2888%20-0.0284991%2040.3433%200.0811311C41.0714%200.15695%2041.7266%200.914583%2041.7857%201.63484C41.853%202.45491%2041.8268%203.31926%2041.8258%204.15144L41.8189%208.70418L41.8199%2023.9639L40.1099%2023.9659L13.8726%2023.963L13.8678%209.0909L13.8648%204.29793C13.8644%202.52652%2013.3942%200.34203%2015.6754%200.0342561C15.8907%200.016712%2016.237%200.0120998%2016.4557%200.0117952C21.6059%200.00480262%2026.761%200.0117634%2031.9107%200.00788896L37.1168%200.00495927ZM33.3834%206.17293C32.439%206.55612%2031.0531%208.12922%2030.3014%208.88191L25.8297%2013.3634C25.3537%2012.824%2023.3455%2010.7605%2022.8209%2010.4239C22.5581%2010.2549%2022.2566%2010.1546%2021.9449%2010.1329C21.4563%2010.1008%2020.9754%2010.2879%2020.6139%2010.6134C20.2442%2010.9428%2020.0227%2011.4077%2020.0006%2011.9024C19.9561%2013.0748%2021.3406%2014.1198%2022.1256%2014.8868C22.9429%2015.714%2024.1669%2017.1028%2025.1168%2017.67C26.1632%2018.2949%2027.3471%2017.2145%2027.9723%2016.4942C30.25%2014.2025%2032.5393%2011.9456%2034.8101%209.64949C35.2937%209.16062%2035.7138%208.69126%2035.6851%207.96199C35.6419%206.86558%2034.7821%206.09682%2033.6959%206.14656C33.5914%206.15085%2033.4872%206.16001%2033.3834%206.17293Z'%20fill='%23FF7439'/%3e%3cpath%20id='Vector_2'%20d='M45.5498%2015.976C46.6399%2015.986%2049.9504%2015.7705%2050.7361%2016.241C51.0104%2016.4053%2051.2831%2016.6446%2051.4181%2016.9397C51.892%2017.9763%2052.1015%2019.357%2052.3802%2020.4819L54.0582%2027.2308C54.5046%2028.9073%2054.9023%2030.6043%2055.3338%2032.2824C55.6029%2033.329%2055.9417%2034.4293%2054.9705%2035.2255C54.8158%2035.359%2054.4427%2035.5934%2054.2329%2035.6091C52.7731%2035.7184%2051.1693%2035.6701%2049.7108%2035.6679L39.4635%2035.6649L14.5239%2035.6632C10.471%2035.6631%206.41808%2035.6665%202.36531%2035.6698C1.79359%2035.6657%201.33794%2035.6604%200.844568%2035.337C-0.57365%2034.4073%200.381076%2032.2112%200.72189%2030.8501L1.93462%2025.9936L3.28579%2020.566C3.53371%2019.5688%203.77194%2018.5694%204.04289%2017.5781C4.30559%2016.6172%204.74298%2016.1492%205.73966%2015.9892C7.15095%2015.9419%208.72017%2015.9778%2010.1434%2015.9809L10.1451%2023.9585C7.37011%2024.097%207.74242%2027.5535%209.84963%2027.6469C11.6268%2027.7258%2013.6164%2027.6909%2015.4098%2027.691L26.229%2027.6915L39.1339%2027.691L43.273%2027.6909C44.748%2027.6909%2047.2174%2028.0848%2047.3773%2025.9908C47.4212%2025.4807%2047.2565%2024.9745%2046.9209%2024.5879C46.5265%2024.141%2046.1143%2024.0046%2045.5418%2023.9673L45.5498%2015.976Z'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",us=i.div`
462
462
  width: 100%;
463
463
  min-width: 0;
464
464
  `,fs=i.nav`
@@ -936,4 +936,4 @@ import{r as u,u as Ve,j as e,a as dt}from"./react-BgjNrwEJ.js";import{h as Q,r a
936
936
  color: ${t.colors.err};
937
937
  }
938
938
  `,qe=48,Qs=["all","on_sale","not_for_sale"],Zs=n=>n?"all":"on_sale";function gi({contracts:n,hideNames:o=!1,seo:r,lockStatus:h}={}){const[d]=dt(),b=Ve(),l=(d.get("q")??"").trim().toLowerCase(),m=(d.get("q")??"").trim();Ze(r??{title:m?s("seo.collectibles.searchTitle",{query:m}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const c=Zs(!!l),y=St(),f=y&&d.get("deals")==="true",j=u.useMemo(()=>({category:"all",status:c,subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,deals:!1,sort:f?"discount":"newest"}),[c,f]),[C,x]=Lt(j),{subCategory:S,rarities:p,priceMin:g,priceMax:I,smart:L,sort:N}=C,E=y&&C.deals,$=At.map(a=>a.key).filter(a=>!(o&&a==="names")).includes(C.category)?C.category:"all",k=h??(Qs.includes(C.status)?C.status:c);zt(`${$}:${S??""}`);const[A,T]=u.useState(!1);u.useEffect(()=>{if(!A)return;const a=ee=>{ee.key==="Escape"&&T(!1)};document.addEventListener("keydown",a);const H=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",a),document.body.style.overflow=H}},[A]);const G=n!==void 0&&n.length===0,z=k==="on_sale",M=g&&!Number.isNaN(Number(g))?Number(g):void 0,v=I&&!Number.isNaN(Number(I))?Number(I):void 0,W=Et(),F=S?en[S]:void 0,R=E?Mt:Wt,J=(R.find(a=>a.key===N)??R[0]).server,Z={category:$,rarities:p.length?p:void 0,wearableCategories:F,minPriceCredits:M,maxPriceCredits:v,search:l||void 0,sortBy:J,isSmart:L||void 0,onSale:!0,discounted:E||void 0,listingType:W?void 0:"primary",contractAddresses:n!=null&&n.length?n:void 0},w={category:$,rarities:p.length?p:void 0,wearableCategories:F,search:l||void 0,sortBy:J,isWearableSmart:L||void 0,isOnSale:k==="not_for_sale"?!1:void 0,contractAddresses:n!=null&&n.length?n:void 0},{items:B,total:O,isLoading:U,isPlaceholderData:q,error:Re,hasNextPage:tt,isFetchingNextPage:_e,isFetchNextPageError:nt,fetchNextPage:st}=Xt(z?["shop-items",Z]:["catalog-items",w],a=>z?_t({...Z,first:qe,skip:a}):It({...w,first:qe,skip:a}),{enabled:$!=="names"&&!G}),X=O,{data:Ie,isError:it,isPending:ot}=Ke(),at=a=>Ie&&a.manaWei?Je(a.manaWei,Ie):null,rt=z&&ot&&B.some(a=>a.source==="legacy"),Le=U||q||rt,lt=U?15:Math.max(B.length,1),Ne=u.useRef(null);u.useEffect(()=>{U||q||!l||Ne.current===l||(Ne.current=l,ce("Shop Searched",{query:l,result_count:X}))},[l,U,q,X]);const Y=u.useRef("__init__");u.useEffect(()=>{if(U||q)return;const a=JSON.stringify({category:$,subCategory:S,rarities:p,min:M,max:v,sort:N,status:k,smart:L});if(Y.current==="__init__"||Y.current===a){Y.current=a;return}Y.current=a,ce("Shop Applied Filter",{filters:{category:$,sub_category:S,rarities:p,min_price_credits:M??null,max_price_credits:v??null,status:k,smart:L,sort:N},result_count:X})},[$,S,p,M,v,N,k,L,U,q,X]);function Ae(a){x({category:a,subCategory:null})}function ze(a){x({status:a})}function Me(a){x({rarities:p.includes(a)?p.filter(H=>H!==a):[...p,a]})}function ct(){x(j)}const V=[];(M!=null||v!=null)&&V.push({key:"price",label:s("filter.price"),onRemove:()=>{x({priceMin:"",priceMax:""})}});for(const a of Ft)p.includes(a)&&V.push({key:`rarity-${a}`,label:Tt(a),onRemove:()=>Me(a)});return L&&V.push({key:"smart",label:s("filter.smart"),onRemove:()=>x({smart:!1})}),E&&V.push({key:"deals",label:s("filter.deals"),onRemove:()=>x({deals:!1,sort:"newest"})}),k!==c&&V.push({key:"status",label:k==="all"?s("filter.statusAll"):k==="on_sale"?s("filter.onSale"):s("filter.notForSale"),onRemove:()=>ze(c)}),e.jsxs(Bt,{"data-testid":"browse",children:[$!=="names"&&e.jsxs(e.Fragment,{children:[A?e.jsx(Pt,{onClick:()=>T(!1),"aria-hidden":!0}):null,e.jsxs(Ot,{"data-open":A||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(Ut,{children:[e.jsx(Ht,{children:s("assets.filters")}),e.jsx(Dt,{onClick:()=>T(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(Gt,{children:e.jsx(qt,{category:$,subCategory:S,onCategory:Ae,onSub:a=>x({subCategory:a}),priceMin:g,priceMax:I,onPriceMin:a=>x({priceMin:a}),onPriceMax:a=>x({priceMax:a}),rarities:p,onToggleRarity:Me,status:k,onStatus:ze,hideNames:o,smart:L,onSmart:a=>x({smart:a}),deals:E,onDeals:y?a=>x(a?{deals:!0,sort:"discount"}:{deals:!1,sort:"newest"}):void 0})}),e.jsx(Vt,{children:e.jsx(Qt,{type:"button",onClick:()=>T(!1),children:s("assets.showItems")})})]})]}),e.jsx(Zt,{children:$==="names"?e.jsx(qs,{onBack:()=>Ae("all")}):e.jsxs(e.Fragment,{children:[e.jsx(Kt,{sort:N,sortOptions:R,onSort:a=>x({sort:a}),total:O,loading:U||q,query:l,onOpenFilters:()=>T(!0),chips:V,onClearChips:ct}),it&&z&&B.some(a=>a.source==="legacy")?e.jsx(Vs,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,Re?e.jsx(tn,{message:s("assets.loadError"),testId:"browse-error"}):null,!Le&&B.length===0&&!Re?e.jsx(Rt,{testId:"browse-empty",icon:Nt,title:s("assets.empty.title"),body:m?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:m}),s("assets.empty.searchAfter")]}):s("assets.empty.filters"),cta:{label:s("assets.empty.cta"),onClick:()=>b("/overview")}}):e.jsxs(e.Fragment,{children:[e.jsx(mn,{"data-testid":"grid",children:Le?e.jsx(Fe,{count:lt}):e.jsxs(e.Fragment,{children:[B.map(a=>{if(!z)return e.jsx(te,{item:a,mode:"view"},ne(a));const H=a;if(H.source!=="legacy")return e.jsx(te,{item:a},ne(a));const ee=at(H);return ee==null?e.jsx(te,{item:a,mode:"view"},ne(a)):e.jsx(te,{item:{...H,priceCredits:ee}},ne(a))}),_e?e.jsx(Fe,{count:6}):null]})}),e.jsx(Jt,{hasNextPage:tt,isFetching:_e,isError:nt,onLoadMore:()=>void st()})]})]})})]})}export{gi as Assets};
939
- //# sourceMappingURL=Assets-vQLVJulF.js.map
939
+ //# sourceMappingURL=Assets-Ctos_NmX.js.map
@@ -1,4 +1,4 @@
1
- import{j as e,L as G,r as B}from"./react-BgjNrwEJ.js";import{d as o,s as n,H as K,k as P,J as H,c as i,F as Q,e as X,I as v,K as J,E as k,L as V,h as Z,M as U,N as T,j as Y,O as tt,P as M}from"./index-BTM4cu-0.js";import{c as et,d as it,e as C,a as ot,f as at,s as nt,g as st}from"./authorizations-BY8rUeq2.js";import{f as rt}from"./builder-D849MmZ4.js";import{m as D}from"./mana-matic-CEqvSwrJ.js";import{f as ct}from"./errors-DwTDExim.js";import"./dcl-schemas-DtCjG7r3.js";import"./sentry-Dnu7IBJF.js";import"./ethers-BzSO0Arq.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-BB1HX_Rt.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="c410ee34-5007-46cb-954b-4d47b03aa45d",t._sentryDebugIdIdentifier="sentry-dbid-c410ee34-5007-46cb-954b-4d47b03aa45d")}catch{}})();const lt=P`
1
+ import{j as e,L as F,r as B}from"./react-BDtnT4_L.js";import{d as o,s as n,G as K,k as P,H,c as i,E as Q,J as X,I as v,K as J,D as k,L as V,e as Z,M as U,N as T,i as Y,O as tt,P as D}from"./index-CyVGgMkK.js";import{c as et,d as it,e as C,a as ot,f as at,s as nt,g as st}from"./authorizations-BF60RZYU.js";import{f as rt}from"./builder-Bi-1rymv.js";import{m as M}from"./mana-matic-CEqvSwrJ.js";import{f as ct}from"./errors-BAO7_A7a.js";import"./dcl-schemas-BfFZv5Pe.js";import"./sentry-DJtBihbA.js";import"./ethers-rfaBand6.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-CVkzKCvR.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="b5bff7eb-01e2-4392-9125-40218127e2d1",t._sentryDebugIdIdentifier="sentry-dbid-b5bff7eb-01e2-4392-9125-40218127e2d1")}catch{}})();const lt=P`
2
2
  to { transform: rotate(360deg); }
3
3
  `,dt=P`
4
4
  to { background-position: -200% 0; }
@@ -188,5 +188,5 @@ import{j as e,L as G,r as B}from"./react-BgjNrwEJ.js";import{d as o,s as n,H as
188
188
  color: ${o.colors.gray4};
189
189
  `,W=n(K)`
190
190
  margin-top: 12px;
191
- `;function y({descriptor:t,owner:s,signer:r,name:a,description:c,image:d,icon:g,revokeOnly:$=!1}){const m=V(),[z,j]=B.useState(!1),{data:u,isLoading:l,refetch:h}=k({queryKey:["authorization",t.id,s],queryFn:()=>st(t,s),staleTime:3e4});async function p(){if(z||l)return;const w=!u;j(!0);try{await nt({auth:t,signer:r,active:w}),await h(),m.setQueryData(["authorization",t.id,s],w),T.success(w?i("authorizations.toastActivated",{name:a}):i("authorizations.toastDeactivated",{name:a}))}catch(I){Y(I,{flow:"authorizations",step:w?"grant":"revoke"}),T.error(ct(I,i("authorizations.errorGeneric")))}finally{j(!1)}}if($&&u===!1)return null;const f=l?i("authorizations.checking"):u?i("authorizations.active"):i("authorizations.inactive");return e.jsxs(mt,{"data-testid":`authorization-${t.id}`,"data-active":!!u,children:[e.jsx(ft,{children:d?e.jsx("img",{src:d,alt:""}):g}),e.jsxs(xt,{children:[e.jsx(yt,{title:a,children:a}),e.jsx(bt,{children:c})]}),e.jsxs(jt,{children:[e.jsx(zt,{"data-active":!!u,children:f}),z?e.jsx(vt,{"aria-label":i("authorizations.working")}):e.jsx(wt,{type:"button","data-testid":`authorization-toggle-${t.id}`,"data-active":!!u,role:"switch","aria-checked":!!u,"aria-label":u?i("authorizations.deactivateAria",{name:a}):i("authorizations.activateAria",{name:a}),disabled:l,onClick:()=>void p()})]})]})}const b=500,F=10,$t=b*F;async function q(t,s){const r=await M(t,{category:s,first:b}),a=Math.min(Math.ceil(r.total/b),F),c=await Promise.all(Array.from({length:Math.max(0,a-1)},(d,g)=>M(t,{category:s,first:b,skip:(g+1)*b})));return{assets:[...r.assets,...c.flatMap(d=>d.assets)],truncated:r.total>$t}}function Ct(t){return k({queryKey:["owned-collections",t],enabled:!!t,staleTime:6e4,queryFn:async()=>{const[s,r]=await Promise.all([q(t,"wearable"),q(t,"emote")]),a=new Map;for(const c of[...s.assets,...r.assets]){const d=c.contractAddress.toLowerCase();a.has(d)||a.set(d,c)}return{collections:[...a.values()],truncated:s.truncated||r.truncated,scanned:s.assets.length+r.assets.length}}})}function At(t){return k({queryKey:["contract-registry"],enabled:t,staleTime:1/0,gcTime:1/0,queryFn:tt})}function Et(t,s){const r=s==null?void 0:s.get(t.toLowerCase());if(r)return r;const a=U(t);return a===t?i("authorizations.collectionFallback"):a}function It(t,s){return k({queryKey:["creator-collections",t],enabled:!!t&&!!s,staleTime:6e4,queryFn:async()=>{const r=await rt(t,s),a=new Map;for(const c of r){const d=c.contractAddress.toLowerCase();a.has(d)||a.set(d,c)}return[...a.values()]}})}function Pt(){H({title:i("authorizations.title"),noindex:!0});const{session:t,signIn:s}=Q(),r=Z.chainId,a=X(t==null?void 0:t.providerType),{data:c,isLoading:d}=Ct(a?t==null?void 0:t.address:void 0),{data:g,isLoading:$}=At(!!a&&!!(t!=null&&t.address)),{data:m,isLoading:z}=It(a?t==null?void 0:t.address:void 0,a?t==null?void 0:t.identity:void 0);if(!t)return e.jsxs(_,{children:[e.jsx(v,{name:"info",size:40,color:o.colors.muted2}),e.jsx(R,{children:i("authorizations.signInTitle")}),e.jsx(O,{children:i("authorizations.signInBody")}),e.jsx(W,{variant:"white",onClick:()=>s(),children:i("storeSettings.signIn")})]});if(!a)return e.jsxs(_,{children:[e.jsx(v,{name:"check",size:40,color:o.colors.ok}),e.jsx(R,{children:i("authorizations.managedTitle")}),e.jsx(O,{children:i("authorizations.managedBody")}),e.jsx(W,{as:G,to:"/items",variant:"white",children:i("authorizations.managedCta")})]});const j=et(r),u=it(r);return e.jsxs(ut,{children:[e.jsxs(ht,{children:[e.jsx(pt,{children:i("authorizations.title")}),e.jsx(gt,{children:i("authorizations.intro")})]}),e.jsxs(A,{children:[e.jsx(E,{children:i("authorizations.buyingTitle")}),e.jsxs(x,{children:[e.jsx(y,{descriptor:j,owner:t.address,signer:t.signer,name:i("authorizations.creditsName"),description:i("authorizations.creditsDesc"),icon:e.jsx(J,{className:"ccy-mark"})}),e.jsx(y,{descriptor:u,owner:t.address,signer:t.signer,name:i("authorizations.manaName"),description:i("authorizations.manaDesc"),icon:e.jsx(S,{src:D,alt:"","aria-hidden":!0})}),C(u).map(l=>e.jsx(y,{descriptor:l,owner:t.address,signer:t.signer,name:`${i("authorizations.manaName")} ${i("authorizations.previousVersion")}`,description:i("authorizations.manaDesc"),icon:e.jsx(S,{src:D,alt:"","aria-hidden":!0}),revokeOnly:!0},l.id))]})]}),e.jsxs(A,{children:[e.jsx(E,{children:i("authorizations.sellingTitle")}),c!=null&&c.truncated?e.jsx(kt,{"data-testid":"authorizations-selling-truncated",children:i("authorizations.sellingTruncated",{count:c.scanned})}):null,d||$?e.jsx(x,{"aria-busy":"true","aria-label":i("authorizations.checking"),children:Array.from({length:3}).map((l,h)=>e.jsx(L,{"aria-hidden":!0},h))}):c&&c.collections.length>0?e.jsx(x,{children:c.collections.flatMap(l=>{const h=ot(l.contractAddress,r);return[h,...C(h)].map((p,f)=>e.jsx(y,{descriptor:p,owner:t.address,signer:t.signer,name:Et(l.contractAddress,g),description:i("authorizations.sellingDesc"),image:l.image,icon:e.jsx(v,{name:"pen",size:18}),revokeOnly:f>0},p.id))})}):e.jsx(N,{children:i("authorizations.sellingEmpty")})]}),e.jsxs(A,{children:[e.jsx(E,{children:i("authorizations.mintingTitle")}),z?e.jsx(x,{"aria-busy":"true","aria-label":i("authorizations.checking"),children:Array.from({length:3}).map((l,h)=>e.jsx(L,{"aria-hidden":!0},h))}):m&&m.length>0?e.jsx(x,{children:m.flatMap(l=>{const h=at(l.contractAddress,r);return[h,...C(h)].map((p,f)=>e.jsx(y,{descriptor:p,owner:t.address,signer:t.signer,name:l.name||i("authorizations.collectionFallback"),description:i("authorizations.mintingDesc"),icon:e.jsx(v,{name:"pen",size:18}),revokeOnly:f>0},p.id))})}):e.jsx(N,{children:i("authorizations.mintingEmpty")})]})]})}export{Pt as Authorizations};
192
- //# sourceMappingURL=Authorizations-cXDczUgT.js.map
191
+ `;function y({descriptor:t,owner:s,signer:r,name:a,description:c,image:d,icon:g,revokeOnly:$=!1}){const m=V(),[z,j]=B.useState(!1),{data:u,isLoading:l,refetch:h}=k({queryKey:["authorization",t.id,s],queryFn:()=>st(t,s),staleTime:3e4});async function p(){if(z||l)return;const w=!u;j(!0);try{await nt({auth:t,signer:r,active:w}),await h(),m.setQueryData(["authorization",t.id,s],w),T.success(w?i("authorizations.toastActivated",{name:a}):i("authorizations.toastDeactivated",{name:a}))}catch(I){Y(I,{flow:"authorizations",step:w?"grant":"revoke"}),T.error(ct(I,i("authorizations.errorGeneric")))}finally{j(!1)}}if($&&u===!1)return null;const f=l?i("authorizations.checking"):u?i("authorizations.active"):i("authorizations.inactive");return e.jsxs(mt,{"data-testid":`authorization-${t.id}`,"data-active":!!u,children:[e.jsx(ft,{children:d?e.jsx("img",{src:d,alt:""}):g}),e.jsxs(xt,{children:[e.jsx(yt,{title:a,children:a}),e.jsx(bt,{children:c})]}),e.jsxs(jt,{children:[e.jsx(zt,{"data-active":!!u,children:f}),z?e.jsx(vt,{"aria-label":i("authorizations.working")}):e.jsx(wt,{type:"button","data-testid":`authorization-toggle-${t.id}`,"data-active":!!u,role:"switch","aria-checked":!!u,"aria-label":u?i("authorizations.deactivateAria",{name:a}):i("authorizations.activateAria",{name:a}),disabled:l,onClick:()=>void p()})]})]})}const b=500,G=10,$t=b*G;async function q(t,s){const r=await D(t,{category:s,first:b}),a=Math.min(Math.ceil(r.total/b),G),c=await Promise.all(Array.from({length:Math.max(0,a-1)},(d,g)=>D(t,{category:s,first:b,skip:(g+1)*b})));return{assets:[...r.assets,...c.flatMap(d=>d.assets)],truncated:r.total>$t}}function Ct(t){return k({queryKey:["owned-collections",t],enabled:!!t,staleTime:6e4,queryFn:async()=>{const[s,r]=await Promise.all([q(t,"wearable"),q(t,"emote")]),a=new Map;for(const c of[...s.assets,...r.assets]){const d=c.contractAddress.toLowerCase();a.has(d)||a.set(d,c)}return{collections:[...a.values()],truncated:s.truncated||r.truncated,scanned:s.assets.length+r.assets.length}}})}function At(t){return k({queryKey:["contract-registry"],enabled:t,staleTime:1/0,gcTime:1/0,queryFn:tt})}function Et(t,s){const r=s==null?void 0:s.get(t.toLowerCase());if(r)return r;const a=U(t);return a===t?i("authorizations.collectionFallback"):a}function It(t,s){return k({queryKey:["creator-collections",t],enabled:!!t&&!!s,staleTime:6e4,queryFn:async()=>{const r=await rt(t,s),a=new Map;for(const c of r){const d=c.contractAddress.toLowerCase();a.has(d)||a.set(d,c)}return[...a.values()]}})}function Pt(){H({title:i("authorizations.title"),noindex:!0});const{session:t,signIn:s}=Q(),r=Z.chainId,a=X(t==null?void 0:t.providerType),{data:c,isLoading:d}=Ct(a?t==null?void 0:t.address:void 0),{data:g,isLoading:$}=At(!!a&&!!(t!=null&&t.address)),{data:m,isLoading:z}=It(a?t==null?void 0:t.address:void 0,a?t==null?void 0:t.identity:void 0);if(!t)return e.jsxs(_,{children:[e.jsx(v,{name:"info",size:40,color:o.colors.muted2}),e.jsx(R,{children:i("authorizations.signInTitle")}),e.jsx(O,{children:i("authorizations.signInBody")}),e.jsx(W,{variant:"white",onClick:()=>s(),children:i("storeSettings.signIn")})]});if(!a)return e.jsxs(_,{children:[e.jsx(v,{name:"check",size:40,color:o.colors.ok}),e.jsx(R,{children:i("authorizations.managedTitle")}),e.jsx(O,{children:i("authorizations.managedBody")}),e.jsx(W,{as:F,to:"/items",variant:"white",children:i("authorizations.managedCta")})]});const j=et(r),u=it(r);return e.jsxs(ut,{children:[e.jsxs(ht,{children:[e.jsx(pt,{children:i("authorizations.title")}),e.jsx(gt,{children:i("authorizations.intro")})]}),e.jsxs(A,{children:[e.jsx(E,{children:i("authorizations.buyingTitle")}),e.jsxs(x,{children:[e.jsx(y,{descriptor:j,owner:t.address,signer:t.signer,name:i("authorizations.creditsName"),description:i("authorizations.creditsDesc"),icon:e.jsx(J,{className:"ccy-mark"})}),e.jsx(y,{descriptor:u,owner:t.address,signer:t.signer,name:i("authorizations.manaName"),description:i("authorizations.manaDesc"),icon:e.jsx(S,{src:M,alt:"","aria-hidden":!0})}),C(u).map(l=>e.jsx(y,{descriptor:l,owner:t.address,signer:t.signer,name:`${i("authorizations.manaName")} ${i("authorizations.previousVersion")}`,description:i("authorizations.manaDesc"),icon:e.jsx(S,{src:M,alt:"","aria-hidden":!0}),revokeOnly:!0},l.id))]})]}),e.jsxs(A,{children:[e.jsx(E,{children:i("authorizations.sellingTitle")}),c!=null&&c.truncated?e.jsx(kt,{"data-testid":"authorizations-selling-truncated",children:i("authorizations.sellingTruncated",{count:c.scanned})}):null,d||$?e.jsx(x,{"aria-busy":"true","aria-label":i("authorizations.checking"),children:Array.from({length:3}).map((l,h)=>e.jsx(L,{"aria-hidden":!0},h))}):c&&c.collections.length>0?e.jsx(x,{children:c.collections.flatMap(l=>{const h=ot(l.contractAddress,r);return[h,...C(h)].map((p,f)=>e.jsx(y,{descriptor:p,owner:t.address,signer:t.signer,name:Et(l.contractAddress,g),description:i("authorizations.sellingDesc"),image:l.image,icon:e.jsx(v,{name:"pen",size:18}),revokeOnly:f>0},p.id))})}):e.jsx(N,{children:i("authorizations.sellingEmpty")})]}),e.jsxs(A,{children:[e.jsx(E,{children:i("authorizations.mintingTitle")}),z?e.jsx(x,{"aria-busy":"true","aria-label":i("authorizations.checking"),children:Array.from({length:3}).map((l,h)=>e.jsx(L,{"aria-hidden":!0},h))}):m&&m.length>0?e.jsx(x,{children:m.flatMap(l=>{const h=at(l.contractAddress,r);return[h,...C(h)].map((p,f)=>e.jsx(y,{descriptor:p,owner:t.address,signer:t.signer,name:l.name||i("authorizations.collectionFallback"),description:i("authorizations.mintingDesc"),icon:e.jsx(v,{name:"pen",size:18}),revokeOnly:f>0},p.id))})}):e.jsx(N,{children:i("authorizations.mintingEmpty")})]})]})}export{Pt as Authorizations};
192
+ //# sourceMappingURL=Authorizations-DyW6TgVG.js.map
@@ -1,4 +1,4 @@
1
- import{j as e,L as Yt,r as M,u as ja,b as ka}from"./react-BgjNrwEJ.js";import{s as r,d as z,c as a,K as Ae,S as ae,bk as Le,C as Te,bl as $a,R as Ke,bm as Sa,Q as Ma,I as Y,y as Ze,J as Ta,aj as O,W as Tt,F as Ia,G as Aa,E as Ea,bn as Pa,L as za,bo as Ra,X as Ba,bp as _a,bq as qa,br as Fa,bs as It,Z as Wa,bt as La,bu as Ka,bv as Qa,aw as Qe,$ as Na,e as Ua,bw as At,al as V,bx as Et,by as Ga,bz as Ha,j as oe,bA as Oa,bB as Da,bC as Va,bD as Ne,a3 as Ya,bE as Ce,bF as je,bG as Pt,bH as Ja,w as zt,x as Rt,bI as Xa}from"./index-BTM4cu-0.js";import{M as Za,S as es,C as ts,H as as,a as ss,T as ns,X as is,b as rs,B as os,c as cs,d as Bt,e as ls,f as Ee,g as ds,h as us,i as hs,j as ps,k as Xe,l as ge,L as gs,P as xs,m as _t,n as qt,W as fs,o as ms,p as bs,q as ys,A as vs,r as ws,s as Cs,t as js,u as ks,v as $s,w as Ss,x as Ms,y as Ts,z as Is,D as As,E as Es,F as Ps,G as zs,I as Rs,J as Bs,K as _s,N as Ue,O as qs,Q as Fs,R as Ws,U as Ft,V as Wt,Y as Ls,Z as Ks,_ as Qs,$ as Ns,a0 as Lt,a1 as Us}from"./CollectionCarousel-DAV9JOqM.js";import{m as Ie}from"./mana-matic-light-Bl5duieC.js";import{l as Gs,n as Hs,g as Os,o as Ds,h as Vs,A as Ys}from"./authorizations-BY8rUeq2.js";import{p as Kt,g as Js,h as Ge}from"./buy-D3bggF5F.js";import{w as Xs,S as He,b as Zs,G as en}from"./buy-gasless-2AtEStAb.js";import{u as tn,M as an,R as ke,r as sn,c as nn,g as rn,a as on,p as Qt,b as Oe}from"./useCreditPacks-psaq5SS1.js";import{i as cn,a as ln}from"./errors-DwTDExim.js";import{E as dn}from"./ErrorNotice-Bad8DXlE.js";import"./dcl-schemas-DtCjG7r3.js";import"./sentry-Dnu7IBJF.js";import"./ethers-BzSO0Arq.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-BB1HX_Rt.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new i.Error().stack;d&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[d]="951ab4c9-ecf9-46de-96a5-7170cff68a11",i._sentryDebugIdIdentifier="sentry-dbid-951ab4c9-ecf9-46de-96a5-7170cff68a11")}catch{}})();const un=r.div`
1
+ import{j as e,L as Yt,r as M,u as ja,b as ka}from"./react-BDtnT4_L.js";import{s as r,d as z,c as a,K as Ae,S as ae,bk as Le,C as Te,bl as $a,R as Ke,bm as Sa,Q as Ma,I as Y,x as Ze,H as Ta,aj as O,W as Tt,E as Ia,F as Aa,D as Ea,bn as Pa,L as za,bo as Ra,X as Ba,bp as _a,bq as qa,br as Fa,bs as It,Z as Wa,bt as La,bu as Ka,bv as Qa,aw as Qe,$ as Na,J as Ua,bw as At,al as V,bx as Et,by as Ga,bz as Ha,i as oe,bA as Oa,bB as Da,bC as Va,bD as Ne,a3 as Ya,bE as Ce,bF as je,bG as Pt,bH as Ja,v as zt,w as Rt,bI as Xa}from"./index-CyVGgMkK.js";import{M as Za,S as es,C as ts,H as as,a as ss,T as ns,X as is,b as rs,B as os,c as cs,d as Bt,e as ls,f as Ee,g as ds,h as us,i as hs,j as ps,k as Xe,l as ge,L as gs,P as xs,m as _t,n as qt,W as ms,o as fs,p as bs,q as ys,A as vs,r as ws,s as Cs,t as js,u as ks,v as $s,w as Ss,x as Ms,y as Ts,z as Is,D as As,E as Es,F as Ps,G as zs,I as Rs,J as Bs,K as _s,N as Ue,O as qs,Q as Fs,R as Ws,U as Ft,V as Wt,Y as Ls,Z as Ks,_ as Qs,$ as Ns,a0 as Lt,a1 as Us}from"./CollectionCarousel-DFNRTOFP.js";import{m as Ie}from"./mana-matic-light-Bl5duieC.js";import{l as Gs,n as Hs,g as Os,o as Ds,h as Vs,A as Ys}from"./authorizations-BF60RZYU.js";import{p as Kt,g as Js,h as Ge}from"./buy-CiksvueJ.js";import{w as Xs,S as He,b as Zs,G as en}from"./buy-gasless-DG2qGHrJ.js";import{u as tn,M as an,R as ke,r as sn,c as nn,g as rn,a as on,p as Qt,b as Oe}from"./useCreditPacks-L9xKGYZ4.js";import{i as cn,a as ln}from"./errors-BAO7_A7a.js";import{E as dn}from"./ErrorNotice-CehMoY9b.js";import"./dcl-schemas-BfFZv5Pe.js";import"./sentry-DJtBihbA.js";import"./ethers-rfaBand6.js";import"./intl-AKLEHPeO.js";import"./sendMetaTransaction-CVkzKCvR.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new i.Error().stack;d&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[d]="01e2da6c-e8fa-4a56-9536-eaab151d7785",i._sentryDebugIdIdentifier="sentry-dbid-01e2da6c-e8fa-4a56-9536-eaab151d7785")}catch{}})();const un=r.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -101,13 +101,13 @@ import{j as e,L as Yt,r as M,u as ja,b as ka}from"./react-BgjNrwEJ.js";import{s
101
101
  line-height: 1.4;
102
102
  color: ${z.colors.muted};
103
103
  text-align: center;
104
- `;function Xt({options:i,totalCents:d,onPay:k,busy:$=!1,creditsLabel:R,shortfall:U,showCreditsAmount:H=!0,creditsFallback:E=null}){const J=i.some(n=>n.method==="credits");return e.jsxs(un,{children:[!J&&E?e.jsx(Nt,{type:"button","data-testid":"pay-with-credits-topup",onClick:E.onClick,disabled:$,children:e.jsx("span",{children:E.label})}):null,i.map(n=>n.method==="credits"?e.jsxs(Nt,{type:"button","data-testid":"pay-with-credits",onClick:()=>k("credits"),disabled:$,children:[e.jsx("span",{children:R??a("buyModal.buy")}),H?e.jsxs($e,{children:[e.jsx(Ae,{}),e.jsx("span",{children:ae(n.credits)})]}):null]},"credits"):n.method==="mana"?e.jsxs(De,{type:"button","data-testid":"pay-with-mana",onClick:()=>k("mana"),disabled:$,children:[e.jsx("span",{children:a("buyModal.buyWithMana")}),e.jsxs($e,{children:[e.jsx(Ve,{children:e.jsx("img",{src:Ie,alt:"","aria-hidden":!0})}),e.jsx("span",{children:Le(n.manaWei)})]})]},"mana"):e.jsxs(De,{type:"button","data-testid":"pay-with-combined",onClick:()=>k("combined"),disabled:$,children:[e.jsx("span",{children:a("buyModal.buyWith")}),e.jsxs($e,{children:[e.jsx(Ae,{}),e.jsx("span",{children:ae(n.credits)}),e.jsx(pn,{children:"+"}),e.jsx(Ve,{children:e.jsx("img",{src:Ie,alt:"","aria-hidden":!0})}),e.jsx("span",{children:Le(n.manaWei)}),e.jsx(hn,{children:"MANA"})]})]},"combined")),U?e.jsxs(e.Fragment,{children:[e.jsxs(De,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[e.jsx("span",{children:a("buyModal.buyWithMana")}),e.jsxs($e,{children:[e.jsx(Ve,{children:e.jsx("img",{src:Ie,alt:"","aria-hidden":!0})}),e.jsx("span",{children:Le(U.manaWei)})]})]},"mana-short"),e.jsx(gn,{"data-testid":"mana-shortfall-note",children:a("buyModal.notEnoughMana")})]}):null,e.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:d})]})}const{colors:ce,radius:xn}=z,fn=r.div`
104
+ `;function Xt({options:i,totalCents:d,onPay:k,busy:$=!1,creditsLabel:R,shortfall:U,showCreditsAmount:H=!0,creditsFallback:E=null}){const J=i.some(n=>n.method==="credits");return e.jsxs(un,{children:[!J&&E?e.jsx(Nt,{type:"button","data-testid":"pay-with-credits-topup",onClick:E.onClick,disabled:$,children:e.jsx("span",{children:E.label})}):null,i.map(n=>n.method==="credits"?e.jsxs(Nt,{type:"button","data-testid":"pay-with-credits",onClick:()=>k("credits"),disabled:$,children:[e.jsx("span",{children:R??a("buyModal.buy")}),H?e.jsxs($e,{children:[e.jsx(Ae,{}),e.jsx("span",{children:ae(n.credits)})]}):null]},"credits"):n.method==="mana"?e.jsxs(De,{type:"button","data-testid":"pay-with-mana",onClick:()=>k("mana"),disabled:$,children:[e.jsx("span",{children:a("buyModal.buyWithMana")}),e.jsxs($e,{children:[e.jsx(Ve,{children:e.jsx("img",{src:Ie,alt:"","aria-hidden":!0})}),e.jsx("span",{children:Le(n.manaWei)})]})]},"mana"):e.jsxs(De,{type:"button","data-testid":"pay-with-combined",onClick:()=>k("combined"),disabled:$,children:[e.jsx("span",{children:a("buyModal.buyWith")}),e.jsxs($e,{children:[e.jsx(Ae,{}),e.jsx("span",{children:ae(n.credits)}),e.jsx(pn,{children:"+"}),e.jsx(Ve,{children:e.jsx("img",{src:Ie,alt:"","aria-hidden":!0})}),e.jsx("span",{children:Le(n.manaWei)}),e.jsx(hn,{children:"MANA"})]})]},"combined")),U?e.jsxs(e.Fragment,{children:[e.jsxs(De,{type:"button","data-testid":"pay-with-mana-disabled",disabled:!0,children:[e.jsx("span",{children:a("buyModal.buyWithMana")}),e.jsxs($e,{children:[e.jsx(Ve,{children:e.jsx("img",{src:Ie,alt:"","aria-hidden":!0})}),e.jsx("span",{children:Le(U.manaWei)})]})]},"mana-short"),e.jsx(gn,{"data-testid":"mana-shortfall-note",children:a("buyModal.notEnoughMana")})]}):null,e.jsx("span",{hidden:!0,"data-testid":"pay-total-cents",children:d})]})}const{colors:ce,radius:xn}=z,mn=r.div`
105
105
  display: flex;
106
106
  align-items: center;
107
107
  justify-content: center;
108
108
  gap: 8px;
109
109
  width: 100%;
110
- `,mn=r.span`
110
+ `,fn=r.span`
111
111
  font-size: 16px;
112
112
  line-height: 22px;
113
113
  color: ${ce.text2};
@@ -170,7 +170,7 @@ import{j as e,L as Yt,r as M,u as ja,b as ka}from"./react-BgjNrwEJ.js";import{s
170
170
  font-size: 14px;
171
171
  line-height: 1.334;
172
172
  color: ${z.colors.text2};
173
- `;function Cn(i){const{phase:d,balanceCredits:k,onClose:$}=i,R=d==="processing",U=d==="error"?a("cartCheckout.errorTitle"):d==="nofunds"?a("cartCheckout.titleNoFunds"):d==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),H=d==="processing";return e.jsxs(Za,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(es,{onClick:R?void 0:$,"aria-hidden":!0}),e.jsxs(ts,{"data-tall":H||void 0,children:[e.jsxs(as,{children:[e.jsxs(ss,{children:[e.jsx(ns,{children:U}),!R&&e.jsx(is,{onClick:$,"aria-label":a("buyModal.close"),children:e.jsx(rs,{})})]}),e.jsxs(os,{children:[e.jsx(cs,{children:d==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(Bt,{}),e.jsx(ls,{children:ae(k)})]}),i.heldCreditsCount&&(d==="choose"||d==="nofunds")?e.jsx(wn,{"data-testid":"cart-held-notice",children:a("buyModal.heldExplainer",{credits:i.heldCreditsCount,currency:Te.name})}):null]}),d==="choose"&&e.jsxs(Ee,{children:[e.jsxs(vn,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(Bt,{}),ae(i.totalCredits??0)]})]}),e.jsx(Xt,{options:i.options??[],totalCents:i.totalCents??0,shortfall:i.shortfall,onPay:i.onPay??(()=>{})})]}),d==="processing"&&e.jsx(jn,{stage:i.stage??"reserving",step:i.step??1,total:i.total??1,isSelfCustody:!!i.isSelfCustody,signatures:i.signatures}),d==="nofunds"&&e.jsx(kn,{lines:i.lines??[],shortfallCredits:i.shortfallCredits??0,packs:i.packs??[],selectedPack:i.selectedPack??"",onSelectPack:i.onSelectPack??(()=>{}),onBuyPacks:i.onBuyPacks??(()=>{}),onCancel:$}),d==="error"&&e.jsxs(Ee,{children:[e.jsxs(ds,{"data-testid":"buy-error",children:[e.jsx(us,{src:hs,alt:"",width:64,height:80}),e.jsxs(ps,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",i.heldCredits?e.jsxs(e.Fragment,{children:[i.message?e.jsxs(e.Fragment,{children:[i.message," "]}):null,a("cartCheckout.heldLead",{currency:Te.name}),e.jsx("b",{children:a("cartCheckout.heldBold")}),a("cartCheckout.heldTail",{currency:Te.name})]}):i.message??a("cartCheckout.errorBody")]})]}),i.heldCredits?e.jsx(Xe,{children:e.jsx(ge,{"data-variant":"purple","data-full":!0,onClick:$,children:a("cartCheckout.gotIt")})}):e.jsxs(Xe,{children:[e.jsx(ge,{"data-variant":"outline",onClick:$,children:a("buyModal.cancel")}),e.jsx(ge,{"data-variant":"purple",onClick:i.onRetry??$,children:a("cartCheckout.tryAgain")})]})]})]})]})}function jn({stage:i,step:d,total:k,isSelfCustody:$,signatures:R}){const U=i==="reserving",H=k>0?Math.min(100,Math.round(d/k*100)):0,E=$&&R&&R.total>1,J=i==="awaiting-signature"?$?E?a("cartCheckout.confirmMultiple",{current:R.current,total:R.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):i==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(Ee,{"data-processing":!0,children:[e.jsx(gs,{src:$a,alt:"",width:61,height:61}),e.jsx(xs,{children:J}),U?e.jsxs(fn,{children:[e.jsx(_t,{"aria-hidden":!0,children:e.jsx(qt,{"data-step":!0,style:{width:`${H}%`}})}),k>1?e.jsxs(mn,{children:[d,"/",k]}):null]}):e.jsx(_t,{"aria-hidden":!0,children:e.jsx(qt,{})})]})}function kn({lines:i,shortfallCredits:d,packs:k,selectedPack:$,onSelectPack:R,onBuyPacks:U,onCancel:H}){const E=k.find(n=>n.id===$),J=i.reduce((n,G)=>n+(G.quantity??1),0);return e.jsxs(Ee,{children:[e.jsxs(fs,{"data-testid":"nofunds-warning",children:[e.jsx(ms,{}),e.jsxs(bs,{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:J}),Ke()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(ys,{href:Sa("/credits"),target:"_blank",rel:"noopener noreferrer",children:a("buyModal.warningLearnMore")})]})]})]}),e.jsx(bn,{children:i.map(n=>{const G=n.quantity??1;return e.jsxs(vs,{children:[e.jsx(ws,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Cs,{children:[e.jsxs("div",{children:[e.jsxs(js,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),G>1?e.jsx(yn,{children:a("cartCheckout.qty",{count:G})}):null]}),n.item.creator?e.jsx(ks,{address:n.item.creator}):null]}),e.jsxs($s,{children:[e.jsx(Ss,{}),e.jsx("span",{children:ae(n.priceCredits*G)})]})]})]},n.item.id)})}),Ke()?null:e.jsxs(e.Fragment,{children:[e.jsx(Ms,{children:k.map(n=>{const G=n.id===$;return e.jsxs(Ts,{"data-testid":"credit-pack","data-on":G||void 0,onClick:()=>R(n.id),children:[e.jsx(Is,{src:As,alt:""}),e.jsx(Es,{children:ae(n.credits)}),e.jsxs(Ps,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(zs,{children:[e.jsxs(Rs,{children:[e.jsx(Bs,{}),e.jsx("span",{children:ae((E==null?void 0:E.credits)??0)})]}),e.jsxs(_s,{children:["$",((E==null?void 0:E.usd)??0).toFixed(2)]})]})]}),e.jsxs(Xe,{children:[e.jsx(ge,{"data-variant":"outline",onClick:H,children:a("buyModal.cancel")}),Ke()?null:e.jsx(ge,{"data-variant":"gradient",onClick:U,children:a("buyModal.buy")})]})]})}const{colors:l,gradients:$n,radius:le}=z,Zt="@media (max-width: 1080px)",A="@media (max-width: 880px)",Ut=r.div`
173
+ `;function Cn(i){const{phase:d,balanceCredits:k,onClose:$}=i,R=d==="processing",U=d==="error"?a("cartCheckout.errorTitle"):d==="nofunds"?a("cartCheckout.titleNoFunds"):d==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),H=d==="processing";return e.jsxs(Za,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(es,{onClick:R?void 0:$,"aria-hidden":!0}),e.jsxs(ts,{"data-tall":H||void 0,children:[e.jsxs(as,{children:[e.jsxs(ss,{children:[e.jsx(ns,{children:U}),!R&&e.jsx(is,{onClick:$,"aria-label":a("buyModal.close"),children:e.jsx(rs,{})})]}),e.jsxs(os,{children:[e.jsx(cs,{children:d==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(Bt,{}),e.jsx(ls,{children:ae(k)})]}),i.heldCreditsCount&&(d==="choose"||d==="nofunds")?e.jsx(wn,{"data-testid":"cart-held-notice",children:a("buyModal.heldExplainer",{credits:i.heldCreditsCount,currency:Te.name})}):null]}),d==="choose"&&e.jsxs(Ee,{children:[e.jsxs(vn,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(Bt,{}),ae(i.totalCredits??0)]})]}),e.jsx(Xt,{options:i.options??[],totalCents:i.totalCents??0,shortfall:i.shortfall,onPay:i.onPay??(()=>{})})]}),d==="processing"&&e.jsx(jn,{stage:i.stage??"reserving",step:i.step??1,total:i.total??1,isSelfCustody:!!i.isSelfCustody,signatures:i.signatures}),d==="nofunds"&&e.jsx(kn,{lines:i.lines??[],shortfallCredits:i.shortfallCredits??0,packs:i.packs??[],selectedPack:i.selectedPack??"",onSelectPack:i.onSelectPack??(()=>{}),onBuyPacks:i.onBuyPacks??(()=>{}),onCancel:$}),d==="error"&&e.jsxs(Ee,{children:[e.jsxs(ds,{"data-testid":"buy-error",children:[e.jsx(us,{src:hs,alt:"",width:64,height:80}),e.jsxs(ps,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",i.heldCredits?e.jsxs(e.Fragment,{children:[i.message?e.jsxs(e.Fragment,{children:[i.message," "]}):null,a("cartCheckout.heldLead",{currency:Te.name}),e.jsx("b",{children:a("cartCheckout.heldBold")}),a("cartCheckout.heldTail",{currency:Te.name})]}):i.message??a("cartCheckout.errorBody")]})]}),i.heldCredits?e.jsx(Xe,{children:e.jsx(ge,{"data-variant":"purple","data-full":!0,onClick:$,children:a("cartCheckout.gotIt")})}):e.jsxs(Xe,{children:[e.jsx(ge,{"data-variant":"outline",onClick:$,children:a("buyModal.cancel")}),e.jsx(ge,{"data-variant":"purple",onClick:i.onRetry??$,children:a("cartCheckout.tryAgain")})]})]})]})]})}function jn({stage:i,step:d,total:k,isSelfCustody:$,signatures:R}){const U=i==="reserving",H=k>0?Math.min(100,Math.round(d/k*100)):0,E=$&&R&&R.total>1,J=i==="awaiting-signature"?$?E?a("cartCheckout.confirmMultiple",{current:R.current,total:R.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):i==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(Ee,{"data-processing":!0,children:[e.jsx(gs,{src:$a,alt:"",width:61,height:61}),e.jsx(xs,{children:J}),U?e.jsxs(mn,{children:[e.jsx(_t,{"aria-hidden":!0,children:e.jsx(qt,{"data-step":!0,style:{width:`${H}%`}})}),k>1?e.jsxs(fn,{children:[d,"/",k]}):null]}):e.jsx(_t,{"aria-hidden":!0,children:e.jsx(qt,{})})]})}function kn({lines:i,shortfallCredits:d,packs:k,selectedPack:$,onSelectPack:R,onBuyPacks:U,onCancel:H}){const E=k.find(n=>n.id===$),J=i.reduce((n,G)=>n+(G.quantity??1),0);return e.jsxs(Ee,{children:[e.jsxs(ms,{"data-testid":"nofunds-warning",children:[e.jsx(fs,{}),e.jsxs(bs,{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:J}),Ke()?null:e.jsxs(e.Fragment,{children:[e.jsx("br",{}),e.jsx(ys,{href:Sa("/credits"),target:"_blank",rel:"noopener noreferrer",children:a("buyModal.warningLearnMore")})]})]})]}),e.jsx(bn,{children:i.map(n=>{const G=n.quantity??1;return e.jsxs(vs,{children:[e.jsx(ws,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Cs,{children:[e.jsxs("div",{children:[e.jsxs(js,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),G>1?e.jsx(yn,{children:a("cartCheckout.qty",{count:G})}):null]}),n.item.creator?e.jsx(ks,{address:n.item.creator}):null]}),e.jsxs($s,{children:[e.jsx(Ss,{}),e.jsx("span",{children:ae(n.priceCredits*G)})]})]})]},n.item.id)})}),Ke()?null:e.jsxs(e.Fragment,{children:[e.jsx(Ms,{children:k.map(n=>{const G=n.id===$;return e.jsxs(Ts,{"data-testid":"credit-pack","data-on":G||void 0,onClick:()=>R(n.id),children:[e.jsx(Is,{src:As,alt:""}),e.jsx(Es,{children:ae(n.credits)}),e.jsxs(Ps,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(zs,{children:[e.jsxs(Rs,{children:[e.jsx(Bs,{}),e.jsx("span",{children:ae((E==null?void 0:E.credits)??0)})]}),e.jsxs(_s,{children:["$",((E==null?void 0:E.usd)??0).toFixed(2)]})]})]}),e.jsxs(Xe,{children:[e.jsx(ge,{"data-variant":"outline",onClick:H,children:a("buyModal.cancel")}),Ke()?null:e.jsx(ge,{"data-variant":"gradient",onClick:U,children:a("buyModal.buy")})]})]})}const{colors:l,gradients:$n,radius:le}=z,Zt="@media (max-width: 1080px)",A="@media (max-width: 880px)",Ut=r.div`
174
174
  max-width: 1510px;
175
175
  margin: 0 auto;
176
176
  /* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
@@ -744,5 +744,5 @@ import{j as e,L as Yt,r as M,u as ja,b as ka}from"./react-BgjNrwEJ.js";import{s
744
744
  & section {
745
745
  margin-top: 0;
746
746
  }
747
- `;function Ye(i){if(cn(i))return a("errors.rejected");const d=(i.message??"").toLowerCase();return d.includes("insufficient")?a("cart.error.insufficient",{currency:Te.name}):d.includes("no active listing")||d.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const pi=12e4;function gi(i){const d=[];return i.unavailable.length&&d.push(a("cart.drop.unavailable",{count:i.unavailable.length})),i.own.length&&d.push(a("cart.drop.own",{count:i.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Je=i=>i.reduce((d,k)=>d+k.priceCredits*k.quantity,0),Me=i=>i.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1}))),Vt=8;function Ai(){var $t,St,Mt;Ta({title:a("nav.cart"),noindex:!0});const i=O(t=>t.items),d=O(t=>t.remove),k=O(t=>t.increment),$=O(t=>t.decrement),R=O(t=>t.clear),U=O(t=>t.restore),H=O(t=>t.setFittingOpen),E=Tt(t=>t.items),J=Tt(t=>t.toggle),{session:n,signIn:G}=Ia(),sa=Aa(),xe=tn().packs.slice(0,an);M.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const na=i.some(t=>t.category!=="emote"),{data:Pe}=Ea({queryKey:["upsell-listings"],queryFn:()=>Xa({first:40}),staleTime:6e4}),{data:j}=Pa(n),y=za(),X=ja(),{state:B}=ka(),[ia,de]=M.useState(null),[et,fe]=M.useState(null),[ra,_]=M.useState(!1),[q,D]=M.useState(null),tt=M.useRef(0),[h,S]=M.useState(null),{data:me}=Ra(n),{data:ue}=Ba(!0),[ze,at]=M.useState(""),he=M.useRef(null),st=_a(i),nt=t=>At(st[t.id]),Re=i.filter(nt),it=i.length>0&&Re.length===0,oa=Re.reduce((t,s)=>t+s.priceCredits*s.quantity,0),ca=i.reduce((t,s)=>t+s.quantity,0),la=Re.reduce((t,s)=>t+s.quantity,0),rt=q?q.liveTotalCredits:oa,da=new Set(i.map(t=>t.id)),ot=((Pe==null?void 0:Pe.items)??[]).filter(t=>!da.has(t.id)).slice(0,12),ct=M.useMemo(()=>i.map(t=>t.contractAddress&&t.itemId?`${t.contractAddress.toLowerCase()}-${t.itemId}`:null).filter(t=>t!==null),[i]),se=qa(Vt,{exclude:ct}),lt=Fa({enabled:se.enabled,hasSignal:se.hasSignal,isLoading:se.isLoading,isError:se.isError,personalized:($t=se.result)==null?void 0:$t.personalized,rowCount:((St=se.result)==null?void 0:St.data.length)??0}),ua=new Map(q==null?void 0:q.buyable.map(t=>[t.item.id,t])),be=(j==null?void 0:j.credits)??0,Be=rt*10,ha=ue?It(Be,ue):0n,_e=Ue({priceCents:Be,priceManaWei:ha,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:me??0n}),pa=t=>t.flatMap(s=>{const o=Oe(s);return o.kind==="store"?[o.mint]:[]}),ga=t=>t.flatMap(s=>s.acquisition==="trade"?[s.trade]:[]),xa=t=>Object.fromEntries(t.flatMap(s=>s.acquisition==="trade"&&s.coupon?[[s.trade.id,s.coupon]]:[])),fa=Ga,ma=t=>Da(t.contractAddress,String(t.itemId));function ye(t){t(),D(null),fe(null),de(null)}function ba(){S(null),_(!1)}function dt(t){const s=Je(t),o=Math.max(0,s-be),c=xe.find(u=>u.credits>=o)??xe[xe.length-1];at(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:be,shortfall:o}),S({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:o}),_(!1)}async function qe(t){if(!n||t.length===0)return;const s=Me(t),o=s.map(m=>({...m.item,priceCredits:m.priceCredits})),c=t.map(m=>({...m.item,priceCredits:m.priceCredits,quantity:m.quantity})),u=[];let v="authorize";const g=new Set,T=new Set,L=new Set,F=[];let w=!1;S({phase:"processing",stage:"reserving",step:1,total:s.length});try{const m=[],P=rn(s,Kt);let K=0;for(const p of P){S({phase:"processing",stage:"reserving",step:K+1,total:s.length});try{const{credit:f,maxCreditedValue:b}=await Va(n.identity,p.units.map(on));p.units.forEach((N,re)=>{u.push({salt:f.id,itemId:N.item.id}),m.push({...p.drafts[re],credits:[f],maxCreditedValue:b})}),K+=p.units.length}catch(f){if(ln(f)){if(u.length){try{await Ne(n.identity,[...new Set(u.map(b=>b.salt))])}catch(b){oe(b,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}dt(t);return}throw f}}u.length&&y.invalidateQueries({queryKey:["usd-balance"]}),v="submit";const Q=Js(m).length,te=p=>Q>1?{current:p,total:Q}:void 0,W=(p,f)=>S({phase:"processing",stage:p,step:s.length,total:s.length,signatures:te(f)}),C=p=>p<Q?W("awaiting-signature",p+1):W("settling",Q);W("awaiting-signature",1);let x=[];const I=new Map,ne=async p=>{const f=await Promise.allSettled(p.map(b=>Xs(b)));return f.forEach((b,N)=>{const re=I.get(p[N])??[];b.status==="fulfilled"?(re.forEach(We=>T.add(We)),F.push(p[N])):b.reason instanceof He||re.forEach(We=>L.add(We))}),f.flatMap(b=>b.status==="rejected"?[b.reason]:[])};if(Gs())try{let p=0;x=await Zs({purchases:m,buyer:n.address,signer:n.signer,identity:n.identity,onSigned:()=>W("settling",Math.min(p+1,Q)),onBroadcast:({txHash:b,salts:N})=>{p+=1,I.set(b,N),N.forEach(re=>g.add(re))},onGroupSettling:({settled:b})=>W("settling",b)});const f=await ne(x);if(f.length&&!f.some(b=>b instanceof He))throw f[0];w=!0}catch(p){if(p instanceof He)throw await ne([...I.keys()]),p;if(!(p instanceof en)||!Ya(n.providerType))throw p;x=await Ge({purchases:m,buyer:n.address,signer:n.signer,onSigned:C,onBroadcast:({salts:f})=>f.forEach(b=>g.add(b)),onSettled:({txHash:f,salts:b})=>{b.forEach(N=>T.add(N)),F.push(f)},onReverted:({salts:f})=>f.forEach(b=>L.add(b))})}else x=await Ge({purchases:m,buyer:n.address,signer:n.signer,onSigned:C,onBroadcast:({salts:p})=>p.forEach(f=>g.add(f)),onSettled:({txHash:p,salts:f})=>{f.forEach(b=>T.add(b)),F.push(p)},onReverted:({salts:p})=>p.forEach(f=>L.add(f))});t.forEach(p=>d(p.item.id)),D(null),V("Shop Completed Purchase",{...Ce(o),payment_type:"credits",no_crypto_step:w,transaction_hash:x[0]??null}),Wt(y);const we=he.current;he.current=null,S(null),_(!1);const ie={items:c,txHash:x[0]??void 0,txHashes:x,settled:!0,...we?{creditsAdded:we}:{}};X("/success",{state:ie,replace:!0})}catch(m){je(m)||oe(m,{flow:"cart_checkout",step:v,cart_size:t.length});const P=new Set([...g].filter(x=>!L.has(x))),{toRelease:K,boughtItemIds:Q}=Qt({reservations:u,spent:P,settled:T}),te=[...P].some(x=>!T.has(x)),W=o.filter(x=>Q.includes(x.id)),C=o.filter(x=>!Q.includes(x.id));if(V(je(m)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Pt(m),value_usd:Et(C.reduce((x,I)=>x+I.priceCredits,0)),cart_size:s.length,partial:W.length>0}),K.length)try{await Ne(n.identity,K)}catch(x){oe(x,{flow:"cart_checkout",step:"release"})}if(y.invalidateQueries({queryKey:["usd-balance"]}),W.length>0){Q.forEach(x=>d(x)),D(null),Wt(y),V("Shop Completed Purchase",{...Ce(W),payment_type:"credits",no_crypto_step:w,transaction_hash:F[0]??null,partial:!0}),S({phase:"error",message:a("cart.error.partiallyBought"),heldCredits:te}),_(!1);return}S({phase:"error",message:te?void 0:Ye(m),heldCredits:te})}}function ut(t,s){y.invalidateQueries({queryKey:["usd-balance"]}),y.invalidateQueries({queryKey:["detail-trade"]}),y.invalidateQueries({queryKey:["shop-item"]}),y.invalidateQueries({queryKey:["owned-token"]}),y.invalidateQueries({queryKey:["public-token"]}),y.invalidateQueries({queryKey:["item-resales"]}),y.invalidateQueries({queryKey:["shop-items"]}),y.invalidateQueries({queryKey:["catalog-items"]}),y.invalidateQueries({queryKey:["my-assets"]}),y.invalidateQueries({queryKey:["purchases"]}),y.invalidateQueries({queryKey:["owned-item-count"]}),y.invalidateQueries({queryKey:["overview-listings"]}),y.invalidateQueries({queryKey:["upsell-listings"]});const o=he.current;he.current=null,S(null),_(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...o?{creditsAdded:o}:{}};X("/success",{state:c,replace:!0})}function ht(t,s){je(t)||oe(t,{flow:s,step:"submit"}),V(je(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Pt(t)}),S({phase:"error",message:Ye(t)}),_(!1)}async function ya(t,s,o){const c=zt(Rt.MANAToken,s),u=zt(Rt.CreditsManager,s);await Vs({auth:{kind:Ys.Allowance,contractAddress:c.address,spenderAddress:u.address,chainId:s},signer:t,requiredWei:o})}async function pt(){if(ue)return ue;try{return await y.fetchQuery(Oa())}catch{return}}async function va(t){const s=Me(t).reduce((v,g)=>v+g.usdCents,0),c=(me??0n)>0n?await pt():ue,u=c?It(s,c):0n;return{totalCents:s,manaWei:u}}async function gt(t,s){const o=Je(t),{totalCents:c,manaWei:u}=await va(t),v=Ue({priceCents:c,priceManaWei:u,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:me??0n});if(s&&v.options.some(g=>g.method===s)){if(s==="credits"){qe(t);return}const g=bt(v,s);await ft(xt(s,t),g,()=>s==="mana"?void yt(t,g):void vt(t,c,u));return}if(v.options.some(g=>g.method==="mana"||g.method==="combined")){S({phase:"choose",lines:t,totalCents:c,manaWei:u}),_(!1);return}if(j!=null&&j.credits<o){dt(t);return}qe(t)}function Fe(t){return Ue({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:me??0n})}const[pe,ve]=M.useState(null);function xt(t,s){const o=new Map;for(const c of s){const u=Ls(t,Oe(c));o.set(`${u.chainId}:${u.spender.toLowerCase()}`,u)}return[...o.values()]}async function ft(t,s,o){const c=[];for(const{spender:u,chainId:v}of t){const g=Hs(v,u),T=n?await Os(g,n.address,s).catch(()=>!0):!0;Ds(n==null?void 0:n.providerType,T)&&c.push(g)}if(c.length===0){o();return}_(!1),mt(c,0,o)}function mt(t,s,o){ve({auth:t[s],index:s+1,total:t.length,run:()=>s+1<t.length?mt(t,s+1,o):o()})}function bt(t,s){var o;return((o=t.options.find(c=>c.method===s))==null?void 0:o.manaWei)??0n}function wa(t){if((h==null?void 0:h.phase)!=="choose")return;const{lines:s,totalCents:o,manaWei:c}=h;if(t==="credits"){qe(s);return}const u=bt(Fe(h),t);ft(xt(t,s),u,()=>t==="mana"?void yt(s,u):void vt(s,o,c))}async function yt(t,s){if(!n||t.length===0)return;const o=Me(t),c=o.map(g=>({...g.item,priceCredits:g.priceCredits})),u=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),v=()=>S({phase:"processing",stage:"settling",step:o.length,total:o.length});S({phase:"processing",stage:"awaiting-signature",step:o.length,total:o.length});try{const g=await Ks({trades:ga(o),coupons:xa(o),mints:pa(o),buyer:n.address,signer:n.signer,onSigned:v,manaWei:s});t.forEach(T=>d(T.item.id)),D(null),V("Shop Completed Purchase",{...Ce(c),payment_type:"mana",transaction_hash:g[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(u,g)}catch(g){ht(g,"buy_cart_mana")}}async function vt(t,s,o){if(!n||t.length===0)return;const c=Me(t),u=c.map(w=>({...w.item,priceCredits:w.priceCredits})),v=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),g=Qs(c.map(w=>w.usdCents),(j==null?void 0:j.balanceCents)??0),T=[],L=new Set,F=new Set;S({phase:"processing",stage:"reserving",step:1,total:c.length});try{const w=c.map(Oe),m=[],P=new Map,K=new Map;for(let C=0;C<c.length;C++){const x=c[C],I=w[C],ne=g[C],we=Ns(Math.max(0,x.usdCents-ne),s,o);let ie;if(ne<=0)ie=Lt(I,[],"0");else{S({phase:"processing",stage:"reserving",step:C+1,total:c.length});const f=x.item,{credit:b,maxCreditedValue:N}=await Ja(n.identity,ne,I.kind==="trade"?I.trade.id:void 0,f.contractAddress&&f.itemId!=null?{contractAddress:f.contractAddress,itemId:String(f.itemId)}:void 0);T.push({salt:b.id,itemId:f.id}),ie=Lt(I,[b],N)}const p=Kt(ie);P.set(p,(P.get(p)??0n)+we),K.has(p)||K.set(p,m.length),m.push(ie)}T.length&&y.invalidateQueries({queryKey:["usd-balance"]});for(const[C,x]of P){const I=K.get(C);I==null||x<=0n||(m[I]={...m[I],maxCreditedValue:(BigInt(m[I].maxCreditedValue)+x).toString()})}const Q=[...P.values()].reduce((C,x)=>C+x,0n);await ya(n.signer,Us(w[0]),Q);const te=()=>S({phase:"processing",stage:"settling",step:c.length,total:c.length});S({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const W=await Ge({purchases:m,buyer:n.address,signer:n.signer,onSigned:te,onBroadcast:({salts:C})=>C.forEach(x=>L.add(x)),onReverted:({salts:C})=>C.forEach(x=>F.add(x))});t.forEach(C=>d(C.item.id)),D(null),V("Shop Completed Purchase",{...Ce(u),payment_type:"credits_and_mana",transaction_hash:W[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(v,W)}catch(w){const{toRelease:m}=Qt({reservations:T,spent:new Set([...L].filter(P=>!F.has(P))),settled:new Set});m.length&&Ne(n.identity,m).catch(()=>{}),T.length&&y.invalidateQueries({queryKey:["usd-balance"]}),ht(w,"buy_cart_combined")}}async function Z(t){if(!n){Ft({type:"cart-checkout"}),G();return}const s=O.getState().items.filter(nt);if(s.length===0)return;de(null),fe(null),_(!0);const o=s.reduce((c,u)=>c+u.priceCredits*u.quantity,0);V("Shop Started Checkout",{checkout_source:"cart",cart_size:s.length,cart_value_credits:o,cart_value_usd:Et(o),has_sufficient_credits:be>=o});try{const c=await sn(s,n.address,fa,await pt(),ma,Ha),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(v=>d(v.id)),fe(gi(c))),c.buyable.length===0){de(a("cart.error.noneAvailable")),D(null);return}if(c.orderChanged){D(c),tt.current=Date.now();return}await gt(c.buyable,t)}catch(c){oe(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),de(Ye(c))}finally{_(!1)}}async function wt(){if(q){if(!n){Ft({type:"cart-checkout"}),G();return}if(Date.now()-tt.current>pi){D(null),fe(null),await Z();return}de(null),gt(q.buyable)}}async function Ca(){if(ze){try{sessionStorage.setItem(ke,JSON.stringify(O.getState().items))}catch{}_(!0);try{const t=await nn(ze,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}X("/credits")}catch(t){try{sessionStorage.removeItem(ke)}catch{}oe(t,{flow:"cart_buy_credits"}),S({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{_(!1)}}}const Ct=M.useRef(!1);M.useEffect(()=>{if(!n||Ct.current||!qs("cart-checkout"))return;Ct.current=!0;const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[n]);const jt=M.useRef(!1);M.useEffect(()=>{if(!(B!=null&&B.resumeCheckout)||jt.current)return;jt.current=!0,he.current=B.creditsAdded??null;try{const s=sessionStorage.getItem(ke);if(s){sessionStorage.removeItem(ke);const o=JSON.parse(s);Array.isArray(o)&&o.length&&U(o)}}catch{}y.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[B==null?void 0:B.resumeCheckout]);const kt=M.useRef(!1);M.useEffect(()=>{if(!(B!=null&&B.startCheckout)||kt.current)return;kt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[B==null?void 0:B.startCheckout]);const ee=ra||(h==null?void 0:h.phase)==="processing";return i.length===0&&!h?e.jsx(Ut,{children:e.jsxs(Ht,{children:[e.jsxs(Gt,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsx(An,{children:e.jsx(Wa,{variant:"light",testId:"cart-empty",icon:La,title:a("cart.empty.title"),body:a("cart.empty.body"),cta:{label:a("cart.empty.cta"),to:"/items"}})})]})}):e.jsxs(Ut,{children:[e.jsxs(Ht,{children:[e.jsxs(Gt,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Sn,{children:[e.jsxs(Mn,{children:[e.jsxs(Tn,{children:[e.jsx(En,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(Y,{name:"arrow-left"})}),e.jsx(Pn,{children:a("cart.panelTitle",{count:ca})}),na?e.jsxs(zn,{onClick:()=>H(!0),disabled:ee,children:[e.jsx(Y,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(In,{children:[e.jsx(Rn,{children:i.map(t=>{const s=ua.get(t.id),o=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,v=t.quantity,g=typeof t.available=="number"&&v>=t.available,T=o*v,L=Ka(t),F=!!L&&!!E[L],w=Qa(t),m=st[t.id],P=!At(m),K=m==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(Bn,{"data-unavailable":P||void 0,children:[e.jsxs(_n,{"data-thumb":!0,children:[w?e.jsx(qn,{to:w,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(Fn,{"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(Wn,{children:[e.jsxs(Ln,{"data-desc":!0,children:[w?e.jsx(Qn,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Kn,{title:t.name,children:t.name}),t.creator?e.jsx(Nn,{address:t.creator,linkToProfile:!0}):null,sa&&u?e.jsxs(Zn,{"data-testid":"cart-creator-tag",children:[e.jsx(ei,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Un,{children:P?e.jsxs(Jn,{children:[e.jsx(Xn,{name:"warning-fill",size:24}),K]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(Gn,{children:[e.jsx(Ot,{onClick:()=>ye(()=>$(t.id)),disabled:ee||v<=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(Hn,{children:v}),e.jsx(Ot,{onClick:()=>ye(()=>k(t.id)),disabled:ee||g,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(On,{children:[e.jsx(Dn,{})," ",e.jsx(Qe,{credits:T}),c?e.jsx(Vn,{children:e.jsx(Qe,{credits:t.priceCredits*v})}):null]})]})})]}),e.jsxs(Yn,{children:[L?e.jsx(ti,{"data-on":F||void 0,onClick:()=>J(t),"aria-label":F?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:F?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(Y,{name:F?"heart-solid":"heart"})}):null,e.jsx(ai,{onClick:()=>ye(()=>d(t.id)),disabled:ee,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(Y,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(si,{children:e.jsx("button",{className:"link",onClick:()=>ye(R),disabled:ee,children:a("cart.clearCart")})})]})]}),e.jsxs(ni,{children:[e.jsx(ii,{children:a("cart.purchaseSummary")}),e.jsxs(ri,{children:[e.jsxs(oi,{children:[e.jsx(ci,{children:a("cart.totalItems",{count:la})}),e.jsx(di,{children:e.jsxs(li,{children:[e.jsx(ui,{})," ",e.jsx(Qe,{credits:rt})]})})]}),e.jsx(Xt,{options:_e.options,totalCents:Be,shortfall:_e.manaShortfall,showCreditsAmount:!1,creditsLabel:q?a("marketCheckout.confirmPurchase"):_e.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:ee||it,onPay:t=>void(q?wt():Z(t)),creditsFallback:{label:ee?a("cart.working"):q?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(q?wt():Z())}}),it?e.jsx(Se,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(Se,{className:"muted",children:a("cart.signInHint")}),q?e.jsx(Se,{className:"muted",children:a("cart.priceChanged")}):null,et?e.jsx(Se,{className:"muted",children:et}):null,e.jsx(hi,{message:ia})]})]})]})]}),lt===null&&e.jsx(Dt,{"data-testid":"cart-personal-upsell",children:e.jsx(Na,{exclude:ct,title:a("cart.suggestedTitle"),surface:"cart",first:Vt})}),lt!==null&&ot.length>0?e.jsx(Dt,{children:e.jsx(Fs,{title:a("cart.youMightAlsoLike"),items:ot})}):null,pe&&n?e.jsx(Ws,{auth:pe.auth,signer:n.signer,step:{index:pe.index,total:pe.total},title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:Ie,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=pe;ve(null),t()},onCancel:()=>ve(null),onClose:()=>ve(null)}):null,h?e.jsx(Cn,{phase:h.phase,balanceCredits:be,heldCreditsCount:((Mt=j==null?void 0:j.held)==null?void 0:Mt.credits)??null,onClose:ba,stage:h.phase==="processing"?h.stage:void 0,step:h.phase==="processing"?h.step:void 0,total:h.phase==="processing"?h.total:void 0,isSelfCustody:Ua(n==null?void 0:n.providerType),signatures:h.phase==="processing"?h.signatures:void 0,options:h.phase==="choose"?Fe(h).options:void 0,shortfall:h.phase==="choose"?Fe(h).manaShortfall:void 0,onPay:wa,totalCents:h.phase==="choose"?h.totalCents:void 0,totalManaWei:h.phase==="choose"?h.manaWei:void 0,totalCredits:h.phase==="choose"?Je(h.lines):void 0,lines:h.phase==="nofunds"?h.lines:void 0,shortfallCredits:h.phase==="nofunds"?h.shortfall:void 0,packs:xe,selectedPack:ze,onSelectPack:at,onBuyPacks:()=>void Ca(),message:h.phase==="error"?h.message:void 0,heldCredits:h.phase==="error"&&!!h.heldCredits,onRetry:()=>void Z()}):null]})}export{Ai as Cart};
748
- //# sourceMappingURL=Cart-B3kWP_gw.js.map
747
+ `;function Ye(i){if(cn(i))return a("errors.rejected");const d=(i.message??"").toLowerCase();return d.includes("insufficient")?a("cart.error.insufficient",{currency:Te.name}):d.includes("no active listing")||d.includes("your own listing")?a("cart.error.listingChanged"):a("marketCheckout.error.generic")}const pi=12e4;function gi(i){const d=[];return i.unavailable.length&&d.push(a("cart.drop.unavailable",{count:i.unavailable.length})),i.own.length&&d.push(a("cart.drop.own",{count:i.own.length})),a("cart.drop.removed",{items:d.join(` ${a("cart.drop.and")} `)})}const Je=i=>i.reduce((d,k)=>d+k.priceCredits*k.quantity,0),Me=i=>i.flatMap(d=>Array.from({length:d.quantity},()=>({...d,quantity:1}))),Vt=8;function Ai(){var $t,St,Mt;Ta({title:a("nav.cart"),noindex:!0});const i=O(t=>t.items),d=O(t=>t.remove),k=O(t=>t.increment),$=O(t=>t.decrement),R=O(t=>t.clear),U=O(t=>t.restore),H=O(t=>t.setFittingOpen),E=Tt(t=>t.items),J=Tt(t=>t.toggle),{session:n,signIn:G}=Ia(),sa=Aa(),xe=tn().packs.slice(0,an);M.useEffect(()=>(document.body.classList.add("shop-cart-bg"),()=>document.body.classList.remove("shop-cart-bg")),[]);const na=i.some(t=>t.category!=="emote"),{data:Pe}=Ea({queryKey:["upsell-listings"],queryFn:()=>Xa({first:40}),staleTime:6e4}),{data:j}=Pa(n),y=za(),X=ja(),{state:B}=ka(),[ia,de]=M.useState(null),[et,me]=M.useState(null),[ra,_]=M.useState(!1),[q,D]=M.useState(null),tt=M.useRef(0),[h,S]=M.useState(null),{data:fe}=Ra(n),{data:ue}=Ba(!0),[ze,at]=M.useState(""),he=M.useRef(null),st=_a(i),nt=t=>At(st[t.id]),Re=i.filter(nt),it=i.length>0&&Re.length===0,oa=Re.reduce((t,s)=>t+s.priceCredits*s.quantity,0),ca=i.reduce((t,s)=>t+s.quantity,0),la=Re.reduce((t,s)=>t+s.quantity,0),rt=q?q.liveTotalCredits:oa,da=new Set(i.map(t=>t.id)),ot=((Pe==null?void 0:Pe.items)??[]).filter(t=>!da.has(t.id)).slice(0,12),ct=M.useMemo(()=>i.map(t=>t.contractAddress&&t.itemId?`${t.contractAddress.toLowerCase()}-${t.itemId}`:null).filter(t=>t!==null),[i]),se=qa(Vt,{exclude:ct}),lt=Fa({enabled:se.enabled,hasSignal:se.hasSignal,isLoading:se.isLoading,isError:se.isError,personalized:($t=se.result)==null?void 0:$t.personalized,rowCount:((St=se.result)==null?void 0:St.data.length)??0}),ua=new Map(q==null?void 0:q.buyable.map(t=>[t.item.id,t])),be=(j==null?void 0:j.credits)??0,Be=rt*10,ha=ue?It(Be,ue):0n,_e=Ue({priceCents:Be,priceManaWei:ha,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n}),pa=t=>t.flatMap(s=>{const o=Oe(s);return o.kind==="store"?[o.mint]:[]}),ga=t=>t.flatMap(s=>s.acquisition==="trade"?[s.trade]:[]),xa=t=>Object.fromEntries(t.flatMap(s=>s.acquisition==="trade"&&s.coupon?[[s.trade.id,s.coupon]]:[])),ma=Ga,fa=t=>Da(t.contractAddress,String(t.itemId));function ye(t){t(),D(null),me(null),de(null)}function ba(){S(null),_(!1)}function dt(t){const s=Je(t),o=Math.max(0,s-be),c=xe.find(u=>u.credits>=o)??xe[xe.length-1];at(c.id),V("Shop Buy Credits Prompted",{from:"cart_checkout",credits_needed:s,credits_balance:be,shortfall:o}),S({phase:"nofunds",lines:t.map(u=>({item:u.item,priceCredits:u.priceCredits,quantity:u.quantity})),shortfall:o}),_(!1)}async function qe(t){if(!n||t.length===0)return;const s=Me(t),o=s.map(f=>({...f.item,priceCredits:f.priceCredits})),c=t.map(f=>({...f.item,priceCredits:f.priceCredits,quantity:f.quantity})),u=[];let v="authorize";const g=new Set,T=new Set,L=new Set,F=[];let w=!1;S({phase:"processing",stage:"reserving",step:1,total:s.length});try{const f=[],P=rn(s,Kt);let K=0;for(const p of P){S({phase:"processing",stage:"reserving",step:K+1,total:s.length});try{const{credit:m,maxCreditedValue:b}=await Va(n.identity,p.units.map(on));p.units.forEach((N,re)=>{u.push({salt:m.id,itemId:N.item.id}),f.push({...p.drafts[re],credits:[m],maxCreditedValue:b})}),K+=p.units.length}catch(m){if(ln(m)){if(u.length){try{await Ne(n.identity,[...new Set(u.map(b=>b.salt))])}catch(b){oe(b,{flow:"cart_checkout",step:"release"})}y.invalidateQueries({queryKey:["usd-balance"]})}dt(t);return}throw m}}u.length&&y.invalidateQueries({queryKey:["usd-balance"]}),v="submit";const Q=Js(f).length,te=p=>Q>1?{current:p,total:Q}:void 0,W=(p,m)=>S({phase:"processing",stage:p,step:s.length,total:s.length,signatures:te(m)}),C=p=>p<Q?W("awaiting-signature",p+1):W("settling",Q);W("awaiting-signature",1);let x=[];const I=new Map,ne=async p=>{const m=await Promise.allSettled(p.map(b=>Xs(b)));return m.forEach((b,N)=>{const re=I.get(p[N])??[];b.status==="fulfilled"?(re.forEach(We=>T.add(We)),F.push(p[N])):b.reason instanceof He||re.forEach(We=>L.add(We))}),m.flatMap(b=>b.status==="rejected"?[b.reason]:[])};if(Gs())try{let p=0;x=await Zs({purchases:f,buyer:n.address,signer:n.signer,identity:n.identity,onSigned:()=>W("settling",Math.min(p+1,Q)),onBroadcast:({txHash:b,salts:N})=>{p+=1,I.set(b,N),N.forEach(re=>g.add(re))},onGroupSettling:({settled:b})=>W("settling",b)});const m=await ne(x);if(m.length&&!m.some(b=>b instanceof He))throw m[0];w=!0}catch(p){if(p instanceof He)throw await ne([...I.keys()]),p;if(!(p instanceof en)||!Ya(n.providerType))throw p;x=await Ge({purchases:f,buyer:n.address,signer:n.signer,onSigned:C,onBroadcast:({salts:m})=>m.forEach(b=>g.add(b)),onSettled:({txHash:m,salts:b})=>{b.forEach(N=>T.add(N)),F.push(m)},onReverted:({salts:m})=>m.forEach(b=>L.add(b))})}else x=await Ge({purchases:f,buyer:n.address,signer:n.signer,onSigned:C,onBroadcast:({salts:p})=>p.forEach(m=>g.add(m)),onSettled:({txHash:p,salts:m})=>{m.forEach(b=>T.add(b)),F.push(p)},onReverted:({salts:p})=>p.forEach(m=>L.add(m))});t.forEach(p=>d(p.item.id)),D(null),V("Shop Completed Purchase",{...Ce(o),payment_type:"credits",no_crypto_step:w,transaction_hash:x[0]??null}),Wt(y);const we=he.current;he.current=null,S(null),_(!1);const ie={items:c,txHash:x[0]??void 0,txHashes:x,settled:!0,...we?{creditsAdded:we}:{}};X("/success",{state:ie,replace:!0})}catch(f){je(f)||oe(f,{flow:"cart_checkout",step:v,cart_size:t.length});const P=new Set([...g].filter(x=>!L.has(x))),{toRelease:K,boughtItemIds:Q}=Qt({reservations:u,spent:P,settled:T}),te=[...P].some(x=>!T.has(x)),W=o.filter(x=>Q.includes(x.id)),C=o.filter(x=>!Q.includes(x.id));if(V(je(f)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:v,error_code:Pt(f),value_usd:Et(C.reduce((x,I)=>x+I.priceCredits,0)),cart_size:s.length,partial:W.length>0}),K.length)try{await Ne(n.identity,K)}catch(x){oe(x,{flow:"cart_checkout",step:"release"})}if(y.invalidateQueries({queryKey:["usd-balance"]}),W.length>0){Q.forEach(x=>d(x)),D(null),Wt(y),V("Shop Completed Purchase",{...Ce(W),payment_type:"credits",no_crypto_step:w,transaction_hash:F[0]??null,partial:!0}),S({phase:"error",message:a("cart.error.partiallyBought"),heldCredits:te}),_(!1);return}S({phase:"error",message:te?void 0:Ye(f),heldCredits:te})}}function ut(t,s){y.invalidateQueries({queryKey:["usd-balance"]}),y.invalidateQueries({queryKey:["detail-trade"]}),y.invalidateQueries({queryKey:["shop-item"]}),y.invalidateQueries({queryKey:["owned-token"]}),y.invalidateQueries({queryKey:["public-token"]}),y.invalidateQueries({queryKey:["item-resales"]}),y.invalidateQueries({queryKey:["shop-items"]}),y.invalidateQueries({queryKey:["catalog-items"]}),y.invalidateQueries({queryKey:["my-assets"]}),y.invalidateQueries({queryKey:["purchases"]}),y.invalidateQueries({queryKey:["owned-item-count"]}),y.invalidateQueries({queryKey:["overview-listings"]}),y.invalidateQueries({queryKey:["upsell-listings"]});const o=he.current;he.current=null,S(null),_(!1);const c={items:t,txHash:s[0]??void 0,txHashes:s,settled:!0,...o?{creditsAdded:o}:{}};X("/success",{state:c,replace:!0})}function ht(t,s){je(t)||oe(t,{flow:s,step:"submit"}),V(je(t)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:Pt(t)}),S({phase:"error",message:Ye(t)}),_(!1)}async function ya(t,s,o){const c=zt(Rt.MANAToken,s),u=zt(Rt.CreditsManager,s);await Vs({auth:{kind:Ys.Allowance,contractAddress:c.address,spenderAddress:u.address,chainId:s},signer:t,requiredWei:o})}async function pt(){if(ue)return ue;try{return await y.fetchQuery(Oa())}catch{return}}async function va(t){const s=Me(t).reduce((v,g)=>v+g.usdCents,0),c=(fe??0n)>0n?await pt():ue,u=c?It(s,c):0n;return{totalCents:s,manaWei:u}}async function gt(t,s){const o=Je(t),{totalCents:c,manaWei:u}=await va(t),v=Ue({priceCents:c,priceManaWei:u,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n});if(s&&v.options.some(g=>g.method===s)){if(s==="credits"){qe(t);return}const g=bt(v,s);await mt(xt(s,t),g,()=>s==="mana"?void yt(t,g):void vt(t,c,u));return}if(v.options.some(g=>g.method==="mana"||g.method==="combined")){S({phase:"choose",lines:t,totalCents:c,manaWei:u}),_(!1);return}if(j!=null&&j.credits<o){dt(t);return}qe(t)}function Fe(t){return Ue({priceCents:t.totalCents,priceManaWei:t.manaWei,balanceCents:(j==null?void 0:j.balanceCents)??0,manaBalanceWei:fe??0n})}const[pe,ve]=M.useState(null);function xt(t,s){const o=new Map;for(const c of s){const u=Ls(t,Oe(c));o.set(`${u.chainId}:${u.spender.toLowerCase()}`,u)}return[...o.values()]}async function mt(t,s,o){const c=[];for(const{spender:u,chainId:v}of t){const g=Hs(v,u),T=n?await Os(g,n.address,s).catch(()=>!0):!0;Ds(n==null?void 0:n.providerType,T)&&c.push(g)}if(c.length===0){o();return}_(!1),ft(c,0,o)}function ft(t,s,o){ve({auth:t[s],index:s+1,total:t.length,run:()=>s+1<t.length?ft(t,s+1,o):o()})}function bt(t,s){var o;return((o=t.options.find(c=>c.method===s))==null?void 0:o.manaWei)??0n}function wa(t){if((h==null?void 0:h.phase)!=="choose")return;const{lines:s,totalCents:o,manaWei:c}=h;if(t==="credits"){qe(s);return}const u=bt(Fe(h),t);mt(xt(t,s),u,()=>t==="mana"?void yt(s,u):void vt(s,o,c))}async function yt(t,s){if(!n||t.length===0)return;const o=Me(t),c=o.map(g=>({...g.item,priceCredits:g.priceCredits})),u=t.map(g=>({...g.item,priceCredits:g.priceCredits,quantity:g.quantity})),v=()=>S({phase:"processing",stage:"settling",step:o.length,total:o.length});S({phase:"processing",stage:"awaiting-signature",step:o.length,total:o.length});try{const g=await Ks({trades:ga(o),coupons:xa(o),mints:pa(o),buyer:n.address,signer:n.signer,onSigned:v,manaWei:s});t.forEach(T=>d(T.item.id)),D(null),V("Shop Completed Purchase",{...Ce(c),payment_type:"mana",transaction_hash:g[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(u,g)}catch(g){ht(g,"buy_cart_mana")}}async function vt(t,s,o){if(!n||t.length===0)return;const c=Me(t),u=c.map(w=>({...w.item,priceCredits:w.priceCredits})),v=t.map(w=>({...w.item,priceCredits:w.priceCredits,quantity:w.quantity})),g=Qs(c.map(w=>w.usdCents),(j==null?void 0:j.balanceCents)??0),T=[],L=new Set,F=new Set;S({phase:"processing",stage:"reserving",step:1,total:c.length});try{const w=c.map(Oe),f=[],P=new Map,K=new Map;for(let C=0;C<c.length;C++){const x=c[C],I=w[C],ne=g[C],we=Ns(Math.max(0,x.usdCents-ne),s,o);let ie;if(ne<=0)ie=Lt(I,[],"0");else{S({phase:"processing",stage:"reserving",step:C+1,total:c.length});const m=x.item,{credit:b,maxCreditedValue:N}=await Ja(n.identity,ne,I.kind==="trade"?I.trade.id:void 0,m.contractAddress&&m.itemId!=null?{contractAddress:m.contractAddress,itemId:String(m.itemId)}:void 0);T.push({salt:b.id,itemId:m.id}),ie=Lt(I,[b],N)}const p=Kt(ie);P.set(p,(P.get(p)??0n)+we),K.has(p)||K.set(p,f.length),f.push(ie)}T.length&&y.invalidateQueries({queryKey:["usd-balance"]});for(const[C,x]of P){const I=K.get(C);I==null||x<=0n||(f[I]={...f[I],maxCreditedValue:(BigInt(f[I].maxCreditedValue)+x).toString()})}const Q=[...P.values()].reduce((C,x)=>C+x,0n);await ya(n.signer,Us(w[0]),Q);const te=()=>S({phase:"processing",stage:"settling",step:c.length,total:c.length});S({phase:"processing",stage:"awaiting-signature",step:c.length,total:c.length});const W=await Ge({purchases:f,buyer:n.address,signer:n.signer,onSigned:te,onBroadcast:({salts:C})=>C.forEach(x=>L.add(x)),onReverted:({salts:C})=>C.forEach(x=>F.add(x))});t.forEach(C=>d(C.item.id)),D(null),V("Shop Completed Purchase",{...Ce(u),payment_type:"credits_and_mana",transaction_hash:W[0]??null}),y.invalidateQueries({queryKey:["mana-balance"]}),ut(v,W)}catch(w){const{toRelease:f}=Qt({reservations:T,spent:new Set([...L].filter(P=>!F.has(P))),settled:new Set});f.length&&Ne(n.identity,f).catch(()=>{}),T.length&&y.invalidateQueries({queryKey:["usd-balance"]}),ht(w,"buy_cart_combined")}}async function Z(t){if(!n){Ft({type:"cart-checkout"}),G();return}const s=O.getState().items.filter(nt);if(s.length===0)return;de(null),me(null),_(!0);const o=s.reduce((c,u)=>c+u.priceCredits*u.quantity,0);V("Shop Started Checkout",{checkout_source:"cart",cart_size:s.length,cart_value_credits:o,cart_value_usd:Et(o),has_sufficient_credits:be>=o});try{const c=await sn(s,n.address,ma,await pt(),fa,Ha),u=[...c.unavailable,...c.own];if(u.length&&(u.forEach(v=>d(v.id)),me(gi(c))),c.buyable.length===0){de(a("cart.error.noneAvailable")),D(null);return}if(c.orderChanged){D(c),tt.current=Date.now();return}await gt(c.buyable,t)}catch(c){oe(c,{flow:"cart_checkout",step:"review",cart_size:s.length}),de(Ye(c))}finally{_(!1)}}async function wt(){if(q){if(!n){Ft({type:"cart-checkout"}),G();return}if(Date.now()-tt.current>pi){D(null),me(null),await Z();return}de(null),gt(q.buyable)}}async function Ca(){if(ze){try{sessionStorage.setItem(ke,JSON.stringify(O.getState().items))}catch{}_(!0);try{const t=await nn(ze,n?{address:n.address,identity:n.identity}:void 0);if(t.url){window.location.href=t.url;return}X("/credits")}catch(t){try{sessionStorage.removeItem(ke)}catch{}oe(t,{flow:"cart_buy_credits"}),S({phase:"error",message:a("buyModal.error.creditsCheckout")})}finally{_(!1)}}}const Ct=M.useRef(!1);M.useEffect(()=>{if(!n||Ct.current||!qs("cart-checkout"))return;Ct.current=!0;const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[n]);const jt=M.useRef(!1);M.useEffect(()=>{if(!(B!=null&&B.resumeCheckout)||jt.current)return;jt.current=!0,he.current=B.creditsAdded??null;try{const s=sessionStorage.getItem(ke);if(s){sessionStorage.removeItem(ke);const o=JSON.parse(s);Array.isArray(o)&&o.length&&U(o)}}catch{}y.invalidateQueries({queryKey:["usd-balance"]});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[B==null?void 0:B.resumeCheckout]);const kt=M.useRef(!1);M.useEffect(()=>{if(!(B!=null&&B.startCheckout)||kt.current)return;kt.current=!0,X(".",{replace:!0,state:null});const t=setTimeout(()=>void Z(),0);return()=>clearTimeout(t)},[B==null?void 0:B.startCheckout]);const ee=ra||(h==null?void 0:h.phase)==="processing";return i.length===0&&!h?e.jsx(Ut,{children:e.jsxs(Ht,{children:[e.jsxs(Gt,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsx(An,{children:e.jsx(Wa,{variant:"light",testId:"cart-empty",icon:La,title:a("cart.empty.title"),body:a("cart.empty.body"),cta:{label:a("cart.empty.cta"),to:"/items"}})})]})}):e.jsxs(Ut,{children:[e.jsxs(Ht,{children:[e.jsxs(Gt,{onClick:()=>X(-1),type:"button",children:[e.jsx(Y,{name:"arrow-left"}),a("nav.cart")]}),e.jsxs(Sn,{children:[e.jsxs(Mn,{children:[e.jsxs(Tn,{children:[e.jsx(En,{onClick:()=>X(-1),type:"button","aria-label":a("cart.goBack"),children:e.jsx(Y,{name:"arrow-left"})}),e.jsx(Pn,{children:a("cart.panelTitle",{count:ca})}),na?e.jsxs(zn,{onClick:()=>H(!0),disabled:ee,children:[e.jsx(Y,{name:"fitting-room"}),a("cart.fittingRoom")]}):null]}),e.jsxs(In,{children:[e.jsx(Rn,{children:i.map(t=>{const s=ua.get(t.id),o=s?s.priceCredits:t.priceCredits,c=!!s&&s.priceCredits!==t.priceCredits,u=!t.tokenId,v=t.quantity,g=typeof t.available=="number"&&v>=t.available,T=o*v,L=Ka(t),F=!!L&&!!E[L],w=Qa(t),f=st[t.id],P=!At(f),K=f==="sold-out"?a("cart.availability.soldOut"):a("cart.availability.unavailable");return e.jsxs(Bn,{"data-unavailable":P||void 0,children:[e.jsxs(_n,{"data-thumb":!0,children:[w?e.jsx(qn,{to:w,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(Fn,{"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(Wn,{children:[e.jsxs(Ln,{"data-desc":!0,children:[w?e.jsx(Qn,{to:w,state:{item:t,tradeId:t.tradeId},title:t.name,children:t.name}):e.jsx(Kn,{title:t.name,children:t.name}),t.creator?e.jsx(Nn,{address:t.creator,linkToProfile:!0}):null,sa&&u?e.jsxs(Zn,{"data-testid":"cart-creator-tag",children:[e.jsx(ei,{name:"buy-from-creator"}),a("cart.creatorTag")]}):null]}),e.jsx(Un,{children:P?e.jsxs(Jn,{children:[e.jsx(Xn,{name:"warning-fill",size:24}),K]}):e.jsxs(e.Fragment,{children:[u?e.jsxs(Gn,{children:[e.jsx(Ot,{onClick:()=>ye(()=>$(t.id)),disabled:ee||v<=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(Hn,{children:v}),e.jsx(Ot,{onClick:()=>ye(()=>k(t.id)),disabled:ee||g,"aria-label":a("cart.increaseQuantity"),children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,focusable:"false",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}):null,e.jsxs(On,{children:[e.jsx(Dn,{})," ",e.jsx(Qe,{credits:T}),c?e.jsx(Vn,{children:e.jsx(Qe,{credits:t.priceCredits*v})}):null]})]})})]}),e.jsxs(Yn,{children:[L?e.jsx(ti,{"data-on":F||void 0,onClick:()=>J(t),"aria-label":F?a("cart.removeFromFavorites",{name:t.name}):a("cart.addToFavorites",{name:t.name}),title:F?a("assetCard.removeFromFavorites"):a("assetCard.addToFavorites"),children:e.jsx(Y,{name:F?"heart-solid":"heart"})}):null,e.jsx(ai,{onClick:()=>ye(()=>d(t.id)),disabled:ee,"aria-label":a("cart.remove",{name:t.name}),title:a("cart.removeTitle"),children:e.jsx(Y,{name:"trash",size:24})})]})]},t.id)})}),e.jsx(si,{children:e.jsx("button",{className:"link",onClick:()=>ye(R),disabled:ee,children:a("cart.clearCart")})})]})]}),e.jsxs(ni,{children:[e.jsx(ii,{children:a("cart.purchaseSummary")}),e.jsxs(ri,{children:[e.jsxs(oi,{children:[e.jsx(ci,{children:a("cart.totalItems",{count:la})}),e.jsx(di,{children:e.jsxs(li,{children:[e.jsx(ui,{})," ",e.jsx(Qe,{credits:rt})]})})]}),e.jsx(Xt,{options:_e.options,totalCents:Be,shortfall:_e.manaShortfall,showCreditsAmount:!1,creditsLabel:q?a("marketCheckout.confirmPurchase"):_e.options.length>1?a("cart.buyWithCredits"):a("cart.checkout"),busy:ee||it,onPay:t=>void(q?wt():Z(t)),creditsFallback:{label:ee?a("cart.working"):q?a("marketCheckout.confirmPurchase"):a("cart.checkout"),onClick:()=>void(q?wt():Z())}}),it?e.jsx(Se,{className:"muted",children:a("cart.allUnavailable")}):null,n?null:e.jsx(Se,{className:"muted",children:a("cart.signInHint")}),q?e.jsx(Se,{className:"muted",children:a("cart.priceChanged")}):null,et?e.jsx(Se,{className:"muted",children:et}):null,e.jsx(hi,{message:ia})]})]})]})]}),lt===null&&e.jsx(Dt,{"data-testid":"cart-personal-upsell",children:e.jsx(Na,{exclude:ct,title:a("cart.suggestedTitle"),surface:"cart",first:Vt})}),lt!==null&&ot.length>0?e.jsx(Dt,{children:e.jsx(Fs,{title:a("cart.youMightAlsoLike"),items:ot})}):null,pe&&n?e.jsx(Ws,{auth:pe.auth,signer:n.signer,step:{index:pe.index,total:pe.total},title:a("authorizeStep.manaTitle"),name:a("authorizeStep.manaName"),reason:a("authorizeStep.manaReason"),icon:e.jsx("img",{src:Ie,width:24,height:24,alt:"","aria-hidden":!0}),onAuthorized:()=>{const{run:t}=pe;ve(null),t()},onCancel:()=>ve(null),onClose:()=>ve(null)}):null,h?e.jsx(Cn,{phase:h.phase,balanceCredits:be,heldCreditsCount:((Mt=j==null?void 0:j.held)==null?void 0:Mt.credits)??null,onClose:ba,stage:h.phase==="processing"?h.stage:void 0,step:h.phase==="processing"?h.step:void 0,total:h.phase==="processing"?h.total:void 0,isSelfCustody:Ua(n==null?void 0:n.providerType),signatures:h.phase==="processing"?h.signatures:void 0,options:h.phase==="choose"?Fe(h).options:void 0,shortfall:h.phase==="choose"?Fe(h).manaShortfall:void 0,onPay:wa,totalCents:h.phase==="choose"?h.totalCents:void 0,totalManaWei:h.phase==="choose"?h.manaWei:void 0,totalCredits:h.phase==="choose"?Je(h.lines):void 0,lines:h.phase==="nofunds"?h.lines:void 0,shortfallCredits:h.phase==="nofunds"?h.shortfall:void 0,packs:xe,selectedPack:ze,onSelectPack:at,onBuyPacks:()=>void Ca(),message:h.phase==="error"?h.message:void 0,heldCredits:h.phase==="error"&&!!h.heldCredits,onRetry:()=>void Z()}):null]})}export{Ai as Cart};
748
+ //# sourceMappingURL=Cart-KBBb4RPC.js.map