@dcl/shop 0.10.1-31034473421.commit-bc8c007 → 0.10.1-31040959942.commit-e9e6433

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 (174) hide show
  1. package/_assets/{Activity-CC-drZTD.js → Activity-CUf8ogRR.js} +3 -3
  2. package/_assets/{AnimatedBackground-C2Ncq3_E.js → AnimatedBackground-_78VlBdV.js} +2 -2
  3. package/_assets/{Assets-DG4ddvEA.js → Assets-UkGI952T.js} +2 -2
  4. package/_assets/{Assets.styles-BR6LRzsi.js → Assets.styles-D1Vg-U1C.js} +1 -1
  5. package/_assets/{Authorizations-BfVJlMW8.js → Authorizations-B3yDMR41.js} +1 -1
  6. package/_assets/{Cart-DDHGXB0M.js → Cart-CbY3Hhq6.js} +2 -2
  7. package/_assets/{CircularProgress-CsPPGJq-.js → CircularProgress-CB62Wg9m.js} +1 -1
  8. package/_assets/{Collection-IF46ulmh.js → Collection-CSv9R6xZ.js} +1 -1
  9. package/_assets/{CollectionCarousel-BKyJ1qJ0.js → CollectionCarousel-Cg2MTF9W.js} +1 -1
  10. package/_assets/{Confetti-BvaNvqo_.js → Confetti-Blr9NSjA.js} +1 -1
  11. package/_assets/{Creator-BZ6noM_Z.js → Creator-sh_sYH1o.js} +26 -27
  12. package/_assets/{ErrorNotice-DuHUqzrI.js → ErrorNotice-CXsnDhEh.js} +1 -1
  13. package/_assets/{ExchangeController-D18bEO7-.js → ExchangeController-GIzn0xGk.js} +1 -1
  14. package/_assets/{Faq-C46L8GKX.js → Faq-C0nCohQD.js} +1 -1
  15. package/_assets/{GetCredits-GeJS2N53.js → GetCredits-CBLkNO-w.js} +1 -1
  16. package/_assets/{Grow-Dh2-4jak.js → Grow-Nzyme9Oa.js} +1 -1
  17. package/_assets/{HelpersUtil-daecOugO.js → HelpersUtil-D0wBF1PA.js} +1 -1
  18. package/_assets/{ItemDetail-DMKpiTyj.js → ItemDetail-DZ3mEshJ.js} +1 -1
  19. package/_assets/LazyEmoteControls-BEt_49wK.js +2 -0
  20. package/_assets/{LoadMore-DSfpb61Y.js → LoadMore-CKNE48ED.js} +1 -1
  21. package/_assets/{ManaPricingBanner.styles-BR2K9M4o.js → ManaPricingBanner.styles-CJS5V2Di.js} +1 -1
  22. package/_assets/{MyAssets-DK-Fl0qf.js → MyAssets-Ble658vU.js} +1 -1
  23. package/_assets/{MyFavorites-CQSlRzjv.js → MyFavorites-Qri7XFuW.js} +1 -1
  24. package/_assets/{NotFound-I4xImBrl.js → NotFound-BnEiiuoJ.js} +1 -1
  25. package/_assets/{NotificationsBell-B3CjtPKY.js → NotificationsBell-CXzlEnr9.js} +1 -1
  26. package/_assets/{OutfitDetail-JHw4Anck.js → OutfitDetail-CL1Y8ii5.js} +1 -1
  27. package/_assets/{OutfitPreview-CD1I4FGA.js → OutfitPreview-DRqW1c5F.js} +1 -1
  28. package/_assets/{OutfitStudio-BmPDW-4_.js → OutfitStudio-DgL1kI47.js} +1 -1
  29. package/_assets/{StoreSettings-BaxaylF_.js → StoreSettings--R4i191j.js} +1 -1
  30. package/_assets/{Success-CmsOOzv5.js → Success-DApKfyee.js} +1 -1
  31. package/_assets/{SwapController-C3FH350F.js → SwapController-0aVdHfMW.js} +1 -1
  32. package/_assets/{Tooltip-BUoy_yBS.js → Tooltip-B2qDq-8v.js} +1 -1
  33. package/_assets/{TradeService-BfkCpUVP.js → TradeService-COZXjCcV.js} +1 -1
  34. package/_assets/{W3MFrameProviderSingleton-C5e_NZU2.js → W3MFrameProviderSingleton-BYmipTKt.js} +3 -3
  35. package/_assets/{WebCryptoP256-DThOAe5r.js → WebCryptoP256-Cid44am7.js} +1 -1
  36. package/_assets/{authorizations-C46pWUg_.js → authorizations-dpp0OnHI.js} +1 -1
  37. package/_assets/{basic-CFr4oW8e.js → basic-An6X8Awg.js} +1 -1
  38. package/_assets/{biconomy-EIHI94HW.js → biconomy-CeZnHUNK.js} +1 -1
  39. package/_assets/{builder-BxyqTcR8.js → builder-Ce37-lC-.js} +1 -1
  40. package/_assets/{buy-CrEjBbQr.js → buy-Dgj0sRqb.js} +1 -1
  41. package/_assets/{buy-gasless-DX2i6M46.js → buy-gasless-CYY_v3bj.js} +1 -1
  42. package/_assets/{categories-Djn1x7W5.js → categories-KFHNUm7E.js} +1 -1
  43. package/_assets/{ccip-bf8ZEccw.js → ccip-8Mu0bgFv.js} +1 -1
  44. package/_assets/{ccip-Cj8VnD6W.js → ccip-BsYdmRqX.js} +1 -1
  45. package/_assets/{collectionPage.styles-D2QDYBrf.js → collectionPage.styles-jwKyDncq.js} +2 -2
  46. package/_assets/{controller-Btwq_67O.js → controller-Cam05qfJ.js} +2 -2
  47. package/_assets/{core-BoZKMv7D.js → core-BdiPiyom.js} +4 -4
  48. package/_assets/{createSvgIcon-CFkg424z.js → createSvgIcon-cAMuQ1mD.js} +1 -1
  49. package/_assets/{custom-CnxdXktY.js → custom-C7A-Vb1Q.js} +1 -1
  50. package/_assets/{data-capture-DE3s9XBD.js → data-capture-COGpG9-r.js} +1 -1
  51. package/_assets/{email-CyUtvnHn.js → email-WblN0-6I.js} +1 -1
  52. package/_assets/{embedded-wallet-CNutXAKp.js → embedded-wallet-BDGaY-OT.js} +1 -1
  53. package/_assets/{emotion-styled.browser.esm-tTp1XoI0.js → emotion-styled.browser.esm-D7YX5KN0.js} +1 -1
  54. package/_assets/{engine-DDh_khSi.js → engine-DjipK7B5.js} +1 -1
  55. package/_assets/{errors-DB8YoX8H.js → errors-CzBZCztT.js} +1 -1
  56. package/_assets/{estimate-l1-fee-FPPQQb_O.js → estimate-l1-fee-Bk8rxjZm.js} +1 -1
  57. package/_assets/{execute-CbtU2HHN.js → execute-C4AIZjft.js} +2 -2
  58. package/_assets/{features-CTzqOm7l.js → features-Dz4wLY98.js} +1 -1
  59. package/_assets/{fetchTokenMetadata-DL00Yl1V.js → fetchTokenMetadata-DjPW-ayp.js} +2 -2
  60. package/_assets/{field.styles-VS1Bp3SY.js → field.styles-BThVZLzX.js} +1 -1
  61. package/_assets/{get-ecosystem-wallet-info-Ts3YeqO0.js → get-ecosystem-wallet-info-DMVrxBpI.js} +1 -1
  62. package/_assets/{getBalance-Ci8oL4mO.js → getBalance-DeFn5Yjk.js} +1 -1
  63. package/_assets/{getNFT-DDI0kKlm.js → getNFT-CRgzh5wf.js} +1 -1
  64. package/_assets/{getNFT-Fy7sCZrd.js → getNFT-iw9a-h4A.js} +1 -1
  65. package/_assets/{grid.styles-B8-aHr-Z.js → grid.styles-U_Gpy1wT.js} +1 -1
  66. package/_assets/{hashTypedData-CgBoKib0.js → hashTypedData-9Zh9SRr-.js} +1 -1
  67. package/_assets/{hashTypedData-DRSL-xFv.js → hashTypedData-CqewBwVq.js} +1 -1
  68. package/_assets/{in-app-CZhXNWAN.js → in-app-DNl1emxp.js} +1 -1
  69. package/_assets/{in-app-wallet-calls-BiloEdY1.js → in-app-wallet-calls-CBy5UcNA.js} +1 -1
  70. package/_assets/{index-BqiBjV7M.js → index-1tktbprD.js} +1 -1
  71. package/_assets/{index-D695ADYc.js → index-5SMH4VL2.js} +1 -1
  72. package/_assets/{index-CVQqdafr.js → index-B0wdLudq.js} +1 -1
  73. package/_assets/{index-BNALoEFc.js → index-B3jctKqs.js} +2 -2
  74. package/_assets/{index-RnP4upXv.js → index-B7Rm4vXt.js} +1 -1
  75. package/_assets/{index-Bkq0noih.js → index-BC_qLj4b.js} +1 -1
  76. package/_assets/{index-DKkcKHt7.js → index-BIJiNaiS.js} +1 -1
  77. package/_assets/{index-3uaNnNo1.js → index-BVDj7GJL.js} +1 -1
  78. package/_assets/{index-Yk813Dlf.js → index-Ba-yhU-2.js} +1 -1
  79. package/_assets/{index-COM2HkFw.js → index-Bc0mTSPi.js} +1 -1
  80. package/_assets/{index-CWQ_hyD9.js → index-BdQAMxgJ.js} +2 -2
  81. package/_assets/{index-8JB2rkjo.js → index-BdkbjSWP.js} +1 -1
  82. package/_assets/{index-B1qAF-bB.js → index-BsZ1af_A.js} +1 -1
  83. package/_assets/{index-BbcqV6dl.js → index-BwGtaRec.js} +1 -1
  84. package/_assets/{index-BaZrYmBG.js → index-ByPjVaiq.js} +1 -1
  85. package/_assets/{index-CcEkPG2d.js → index-C6rF-YrH.js} +1 -1
  86. package/_assets/{index-Cb-Xyz4U.js → index-CHCVsh7P.js} +1 -1
  87. package/_assets/{index-BB1Alh6i.js → index-CJCxe5kr.js} +1 -1
  88. package/_assets/{index-BIsmMKyp.js → index-CU5QiUkb.js} +1 -1
  89. package/_assets/{index-BcYeQL6D.js → index-C_r09vuw.js} +1 -1
  90. package/_assets/{index-0Vjq0BuP.js → index-CcihKRSf.js} +1 -1
  91. package/_assets/{index-BFPc-Id9.js → index-CjvMMH2k.js} +1 -1
  92. package/_assets/{index-D5xfzJYu.js → index-Cmc0GHkA.js} +1 -1
  93. package/_assets/{index-DH5xRkV0.js → index-CpQbv3Zu.js} +1 -1
  94. package/_assets/{index-CMsqXnmJ.js → index-CqJzKRxe.js} +2 -2
  95. package/_assets/{index-I-YHePeT.js → index-D3iRZfgO.js} +1 -1
  96. package/_assets/{index-Be3z0ef5.js → index-D3qXchU2.js} +1 -1
  97. package/_assets/{index-9o15Whth.js → index-D6LfEXYp.js} +1 -1
  98. package/_assets/{index-i-zDqv41.js → index-D8LZCVOB.js} +1 -1
  99. package/_assets/{index-BV1tKLO5.js → index-DM2dLJ-M.js} +1 -1
  100. package/_assets/{index-Gq4sV0iH.js → index-DO0NylVf.js} +1 -1
  101. package/_assets/{index-Bw4kOn5N.js → index-DQ7Kosvv.js} +3 -3
  102. package/_assets/{index-ojZHdJoW.js → index-DT4Zi23l.js} +1 -1
  103. package/_assets/{index-BtW2kxAX.js → index-DXURSM0-.js} +1 -1
  104. package/_assets/{index-CN25d8be.js → index-Dax05iV5.js} +1 -1
  105. package/_assets/{index-DN1XWQxE.js → index-Dd8eTuKB.js} +1 -1
  106. package/_assets/{index-CRLgNgTE.js → index-DfIQCR2U.js} +1 -1
  107. package/_assets/{index-Dqgl-D8m.js → index-DgPfV4X0.js} +1 -1
  108. package/_assets/{index-BW_by1p8.js → index-DhRx4LkD.js} +1 -1
  109. package/_assets/{index-CAAx9kV_.js → index-Dqdf5xVB.js} +1 -1
  110. package/_assets/{index-D8gWMfNo.js → index-DtAsm8Nr.js} +1 -1
  111. package/_assets/{index-Dk6WNfYc.js → index-DwrPmkl2.js} +1 -1
  112. package/_assets/{index-CeLWKxYJ.js → index-HQUcvKn4.js} +3 -3
  113. package/_assets/{index-CeFSJ06M.js → index-Kq5fobWt.js} +1 -1
  114. package/_assets/{index-B_dDd-2o.js → index-MPYM0LiN.js} +1 -1
  115. package/_assets/{index-CMdaU3Fe.js → index-RHSCZ-t0.js} +1 -1
  116. package/_assets/{index-9yrtZWWe.js → index-buu21jrH.js} +13 -13
  117. package/_assets/{index-B44uRV_0.js → index-h--qqRrb.js} +1 -1
  118. package/_assets/{index-B5Ot6UoK.js → index-m-SAK4uo.js} +1 -1
  119. package/_assets/{index-CAixpuE6.js → index-xLgJxfJy.js} +1 -1
  120. package/_assets/{index-Di-G-FMZ.js → index-xMSSxrHn.js} +1 -1
  121. package/_assets/{index-BGDJC7BF.js → index-y3U1nB0H.js} +3 -3
  122. package/_assets/{index.es-Bb6fWqbI.js → index.es-CLldxJUJ.js} +1 -1
  123. package/_assets/{index.es-Cw9YevXi.js → index.es-DGQjR0dR.js} +4 -4
  124. package/_assets/{index.es-BPLGTRUs.js → index.es-DqD9HkXC.js} +1 -1
  125. package/_assets/{localBatchGatewayRequest-DV-Qiqwg.js → localBatchGatewayRequest-COpd6g60.js} +1 -1
  126. package/_assets/{networks-BidiJn0z.js → networks-ChmokwGp.js} +1 -1
  127. package/_assets/{onramp-CC1FvFBK.js → onramp-BmIZ6r8P.js} +1 -1
  128. package/_assets/{openzeppelin-DxfcoOmD.js → openzeppelin-CzypsJB4.js} +1 -1
  129. package/_assets/{parseNft-D5_2xvn3.js → parseNft-CydF3Edv.js} +2 -2
  130. package/_assets/{parseSignature-DGREosgl.js → parseSignature-BeoYj8uB.js} +1 -1
  131. package/_assets/{parseSignature-DCVnoEud.js → parseSignature-u2B-ofRt.js} +3 -3
  132. package/_assets/{passkeys-c0mSn9d_.js → passkeys-CVYlDRWu.js} +1 -1
  133. package/_assets/{pay-with-exchange-tOzIsJn8.js → pay-with-exchange-DqJU65WS.js} +1 -1
  134. package/_assets/{qr-overlay-C238jsQe.js → qr-overlay-DNwX_TPq.js} +1 -1
  135. package/_assets/{receive-YJVe-YsN.js → receive-uVtJpZxa.js} +1 -1
  136. package/_assets/{resolveImplementation-Bup3lN7e.js → resolveImplementation-CRaloAyf.js} +1 -1
  137. package/_assets/{rpc-DRG5dkgN.js → rpc-CqfSA8g9.js} +1 -1
  138. package/_assets/{secp256k1-DGfmtJOR.js → secp256k1-2YskFph9.js} +1 -1
  139. package/_assets/{secp256k1-DyD-7xzT.js → secp256k1-Do9ofviG.js} +1 -1
  140. package/_assets/{secp256k1-BLTf96Dw.js → secp256k1-DvDQYEQd.js} +1 -1
  141. package/_assets/{send-HB6wuoPf.js → send-IbCZj2la.js} +1 -1
  142. package/_assets/{send-batch-transaction-BLLreTbC.js → send-batch-transaction-DFD_LTct.js} +1 -1
  143. package/_assets/{send-eip712-transaction-1tvGSDlM.js → send-eip712-transaction-DBf5Z4g_.js} +2 -2
  144. package/_assets/{send-gasless-transaction-Ctg5l4BN.js → send-gasless-transaction-TFSfXMLh.js} +2 -2
  145. package/_assets/{send-transaction-XQn5-Ih2.js → send-transaction-DGhInFte.js} +2 -2
  146. package/_assets/{sendMetaTransaction-BHIBWrRl.js → sendMetaTransaction-CzqCMKMd.js} +1 -1
  147. package/_assets/{sendRawTransaction-DcRJfXtJ.js → sendRawTransaction-qf9SJfpX.js} +3 -3
  148. package/_assets/{serializeTransaction-BovQs4W4.js → serializeTransaction-D4cHSu0O.js} +1 -1
  149. package/_assets/{session-proposal-Dh0H2iMq.js → session-proposal-5AODiiln.js} +1 -1
  150. package/_assets/{session-request-PjE6-slV.js → session-request-hpYNptgl.js} +2 -2
  151. package/_assets/{signing-D_b9YpxC.js → signing-BQUpSEqZ.js} +3 -3
  152. package/_assets/{skeleton.styles-BkB0ehmF.js → skeleton.styles-BfEPveSL.js} +1 -1
  153. package/_assets/{socials-BdH7MtQ-.js → socials-D6EP9g5a.js} +1 -1
  154. package/_assets/{styled-DO__i5OQ.js → styled-FDInU8Rs.js} +1 -1
  155. package/_assets/{swaps-8XaXvjLz.js → swaps-CqwmfiPX.js} +1 -1
  156. package/_assets/{thirdweb-CQkxIvb0.js → thirdweb-Cecbmps_.js} +3 -3
  157. package/_assets/{to-serializable-transaction-BKduqsBs.js → to-serializable-transaction-u0MhoPX5.js} +2 -2
  158. package/_assets/{transactionReceipt-B0NXQ6bs.js → transactionReceipt-l4NJYcz9.js} +1 -1
  159. package/_assets/{transactions-B8KmPj9n.js → transactions-CeFT9Jfi.js} +1 -1
  160. package/_assets/{useCreditPacks-B2mrQzTg.js → useCreditPacks-DQE6Gg5O.js} +1 -1
  161. package/_assets/{useImportable-B5Yrq7z2.js → useImportable-Dh1ZOsU2.js} +1 -1
  162. package/_assets/{useInfiniteGrid-ByXPg4Cl.js → useInfiniteGrid--LOCzyU9.js} +1 -1
  163. package/_assets/{useTheme-Dr5b6sGg.js → useTheme-CpSHkSMG.js} +1 -1
  164. package/_assets/{verifyHash-kfqTlL2t.js → verifyHash-BSS9_MWX.js} +1 -1
  165. package/_assets/{w3m-modal-D8CVGu-q.js → w3m-modal-BCjN4Uqc.js} +1 -1
  166. package/_assets/{w3m-modal-qsbw4UhH.js → w3m-modal-ByuBko0g.js} +1 -1
  167. package/_assets/{wait-for-tx-receipt-C6x4RXLY.js → wait-for-tx-receipt-CfVB-CU0.js} +1 -1
  168. package/_assets/{wallets-OabXbDr9.js → wallets-tUzLLBvA.js} +5 -5
  169. package/_assets/{web-connector-BIGf2LgP.js → web-connector-BfVr5QpB.js} +3 -3
  170. package/_assets/{writeContract-C3LPgHro.js → writeContract-B4n8yTsB.js} +1 -1
  171. package/_assets/{zoraTestnet-EWvUityH.js → zoraTestnet-CNY7oWT9.js} +1 -1
  172. package/index.html +11 -11
  173. package/package.json +2 -2
  174. package/_assets/LazyEmoteControls-CgDq4t3s.js +0 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-i-zDqv41.js","_assets/react-BYHuwl8r.js","_assets/index-9yrtZWWe.js","_assets/dcl-schemas-CmtP3U6y.js","_assets/sentry-Dx-KuLV3.js","_assets/ethers-BDpbhgX6.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/useImportable-B5Yrq7z2.js","_assets/buy-CrEjBbQr.js","_assets/authorizations-C46pWUg_.js","_assets/sendMetaTransaction-BHIBWrRl.js","_assets/ManaPricingBanner.styles-BR2K9M4o.js","_assets/Faq-C46L8GKX.js","_assets/field.styles-VS1Bp3SY.js"])))=>i.map(i=>d[i]);
2
- import{n as ke,bM as Ie,o as z,v as A,bN as Ae,s as h,t as a,w as $e,B as Le,x as Pe,b as d,ao as Ne,I as $,bO as te,bP as ie,bQ as Ee,_ as Te,z as N,bR as Ce,A as Se,bh as R,L as Fe,bS as Me,E as De,bT as Oe,bU as _}from"./index-9yrtZWWe.js";import{r as g,u as He,j as t,L as re,e as qe}from"./react-BYHuwl8r.js";import{u as ze}from"./useImportable-B5Yrq7z2.js";import{L as Re}from"./LoadMore-DSfpb61Y.js";import{u as L}from"./useInfiniteGrid-ByXPg4Cl.js";import{m as oe}from"./mana-matic-C4e1sNO3.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./buy-CrEjBbQr.js";import"./authorizations-C46pWUg_.js";import"./sendMetaTransaction-BHIBWrRl.js";const _e=15e3;function Ge(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)<=_e}function We(e){const s=[...e].sort((i,r)=>r.createdAt-i.createdAt),n=[];for(const i of s){const r=n[n.length-1];r&&Ge(r[r.length-1],i)?r.push(i):n.push([i])}return n.map(i=>{var r;return{id:((r=i.find(c=>c.txHash))==null?void 0:r.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:i.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((c,u)=>c+u.credits,0),lines:i}})}function Be(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Ue(e){const s=[],n=new Map;for(const i of e){const r=Be(i);if(!r){s.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const c=n.get(r);if(c){c.quantity+=1,c.credits+=i.credits;continue}const u={key:r,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};n.set(r,u),s.push(u)}return s}function Ke(e,s){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:s?ke(e.manaWei,s):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function Qe(e){const n=We(e.purchases.filter(o=>o.status!=="EXPIRED")).map(o=>({kind:"purchase",id:`purchase:${o.id}`,createdAt:o.createdAt,order:o})),i=e.sales.map(o=>{const x=Ke(o,e.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),r=(e.creditOrders??[]).filter(o=>o.status!=="failed"&&o.status!=="abandoned").map(o=>({kind:"credit",id:`credit:${o.id}`,createdAt:o.createdAt,order:o})),c=new Set(e.purchases.filter(o=>o.txHash).map(o=>o.txHash.toLowerCase())),u=(e.manaPurchases??[]).filter(o=>!c.has(o.txHash.toLowerCase())).map(o=>({kind:"mana-purchase",id:`mana-purchase:${o.id}`,createdAt:o.createdAt,sale:o}));return[...n,...i,...r,...u].sort((o,x)=>x.createdAt-o.createdAt||(o.id<x.id?-1:1))}function Ve(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 ce=e=>e.trim().toLowerCase();function Xe(e){const s=new Map;for(const n of e??[]){const i=ce(n.txHash??"");if(!i)continue;const r=s.get(i);r?r.push(n):s.set(i,[n])}return s}function Ye(e,s,n=Date.now()){const i=s.txHash?e.get(ce(s.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const r=i.length===1?Ze(i[0].netCents):null,c=i.filter(o=>!o.available&&o.availableAt>n);if(c.length===0)return{kind:"credited",credits:r};const u=c.reduce((o,x)=>Math.max(o,x.availableAt),0);return{kind:"pending",credits:r,availableAt:u}}function Ze(e){return Ie(e)}function Je(){const e=z(i=>{var r;return(r=i.session)==null?void 0:r.address}),{data:s,isLoading:n}=A({queryKey:["listing-count",e],queryFn:()=>Ae({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:s==null?void 0:s.total,isLoading:n}}const et="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/credits-product-vs4Q6u6l.svg",G=$e`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-D8LZCVOB.js","_assets/react-BYHuwl8r.js","_assets/index-buu21jrH.js","_assets/dcl-schemas-CmtP3U6y.js","_assets/sentry-Dx-KuLV3.js","_assets/ethers-BDpbhgX6.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/useImportable-Dh1ZOsU2.js","_assets/buy-Dgj0sRqb.js","_assets/authorizations-dpp0OnHI.js","_assets/sendMetaTransaction-CzqCMKMd.js","_assets/ManaPricingBanner.styles-CJS5V2Di.js","_assets/Faq-C0nCohQD.js","_assets/field.styles-BThVZLzX.js"])))=>i.map(i=>d[i]);
2
+ import{n as ke,bM as Ie,o as z,v as A,bN as Ae,s as h,t as a,w as $e,B as Le,x as Pe,b as d,ao as Ne,I as $,bO as te,bP as ie,bQ as Ee,_ as Te,z as N,bR as Ce,A as Se,bh as R,L as Fe,bS as Me,E as De,bT as Oe,bU as _}from"./index-buu21jrH.js";import{r as g,u as He,j as t,L as re,e as qe}from"./react-BYHuwl8r.js";import{u as ze}from"./useImportable-Dh1ZOsU2.js";import{L as Re}from"./LoadMore-CKNE48ED.js";import{u as L}from"./useInfiniteGrid--LOCzyU9.js";import{m as oe}from"./mana-matic-C4e1sNO3.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./buy-Dgj0sRqb.js";import"./authorizations-dpp0OnHI.js";import"./sendMetaTransaction-CzqCMKMd.js";const _e=15e3;function Ge(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)<=_e}function We(e){const s=[...e].sort((i,r)=>r.createdAt-i.createdAt),n=[];for(const i of s){const r=n[n.length-1];r&&Ge(r[r.length-1],i)?r.push(i):n.push([i])}return n.map(i=>{var r;return{id:((r=i.find(c=>c.txHash))==null?void 0:r.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(c=>c.createdAt)),status:i.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((c,u)=>c+u.credits,0),lines:i}})}function Be(e){return e.tradeId?`trade:${e.tradeId}`:e.contractAddress&&e.itemId?`item:${e.contractAddress.toLowerCase()}:${e.itemId}`:null}function Ue(e){const s=[],n=new Map;for(const i of e){const r=Be(i);if(!r){s.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const c=n.get(r);if(c){c.quantity+=1,c.credits+=i.credits;continue}const u={key:r,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};n.set(r,u),s.push(u)}return s}function Ke(e,s){return{id:e.id,contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId,counterparty:e.buyer,credits:s?ke(e.manaWei,s):null,manaWei:e.manaWei,createdAt:e.createdAt,txHash:e.txHash}}function Qe(e){const n=We(e.purchases.filter(o=>o.status!=="EXPIRED")).map(o=>({kind:"purchase",id:`purchase:${o.id}`,createdAt:o.createdAt,order:o})),i=e.sales.map(o=>{const x=Ke(o,e.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),r=(e.creditOrders??[]).filter(o=>o.status!=="failed"&&o.status!=="abandoned").map(o=>({kind:"credit",id:`credit:${o.id}`,createdAt:o.createdAt,order:o})),c=new Set(e.purchases.filter(o=>o.txHash).map(o=>o.txHash.toLowerCase())),u=(e.manaPurchases??[]).filter(o=>!c.has(o.txHash.toLowerCase())).map(o=>({kind:"mana-purchase",id:`mana-purchase:${o.id}`,createdAt:o.createdAt,sale:o}));return[...n,...i,...r,...u].sort((o,x)=>x.createdAt-o.createdAt||(o.id<x.id?-1:1))}function Ve(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 ce=e=>e.trim().toLowerCase();function Xe(e){const s=new Map;for(const n of e??[]){const i=ce(n.txHash??"");if(!i)continue;const r=s.get(i);r?r.push(n):s.set(i,[n])}return s}function Ye(e,s,n=Date.now()){const i=s.txHash?e.get(ce(s.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const r=i.length===1?Ze(i[0].netCents):null,c=i.filter(o=>!o.available&&o.availableAt>n);if(c.length===0)return{kind:"credited",credits:r};const u=c.reduce((o,x)=>Math.max(o,x.availableAt),0);return{kind:"pending",credits:r,availableAt:u}}function Ze(e){return Ie(e)}function Je(){const e=z(i=>{var r;return(r=i.session)==null?void 0:r.address}),{data:s,isLoading:n}=A({queryKey:["listing-count",e],queryFn:()=>Ae({creator:e,onSale:!0,first:1}),enabled:!!e,staleTime:5*6e4});return{count:s==null?void 0:s.total,isLoading:n}}const et="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/credits-product-vs4Q6u6l.svg",G=$e`
3
3
  0% { background-position: 200% 0; }
4
4
  100% { background-position: -200% 0; }
5
5
  `,tt=h.section`
@@ -378,4 +378,4 @@ import{n as ke,bM as Ie,o as z,v as A,bN as Ae,s as h,t as a,w as $e,B as Le,x a
378
378
  margin: 6px 0 0;
379
379
  `,pt=h(Le)`
380
380
  margin-top: 12px;
381
- `,Y=O.withComponent(re),xt=g.lazy(()=>Te(()=>import("./index-i-zDqv41.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.ImportListings}))),P=24,mt=["all","purchases","sales"],H="section",ne="listings",q="view",gt="migrate";function I(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function pe(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function xe(e){const s=Number(e)/1e18;return Number.isFinite(s)?s.toLocaleString("en",{maximumFractionDigits:2}):"0"}function me({children:e}){const s=g.useRef(null),[n,i]=g.useState(null),r=()=>{var u;const c=(u=s.current)==null?void 0:u.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(lt,{ref:s,tabIndex:0,onMouseEnter:r,onMouseLeave:()=>i(null),onFocus:r,onBlur:()=>i(null),children:[e,n?qe.createPortal(t.jsx(ht,{style:{top:n.top,left:n.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function ft({item:e}){const s=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||s,{data:i,isLoading:r}=A({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Oe(e.tradeId):_(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),c=n&&r,u=(i==null?void 0:i.name)??d("activity.itemFallback"),o=(i==null?void 0:i.thumbnail)??"",x=R({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,f=t.jsxs(t.Fragment,{children:[c?t.jsx(U,{}):t.jsx(B,{children:o?t.jsx("img",{src:o,alt:u}):t.jsx($,{name:"cart",size:20})}),t.jsxs(K,{children:[c?t.jsx(V,{}):t.jsx(Q,{title:u,children:u}),e.quantity>1?t.jsx(X,{children:d("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(ut,{children:[t.jsx(N,{className:"ccy-mark"})," ",e.credits]})]});return x?t.jsx(Y,{to:x,"data-link":"true",children:f}):t.jsx(O,{children:f})}function bt({order:e}){const s=Ue(e.lines),n=s.reduce((i,r)=>i+r.quantity,0);return t.jsxs(E,{"data-testid":"purchase-order",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:I(e.createdAt)}),t.jsxs(F,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:n})]})]}),t.jsxs(M,{children:[t.jsx(D,{"data-status":e.status,children:e.status==="PENDING"?d("activity.processing"):d("activity.completed")}),t.jsxs(j,{children:[t.jsx(N,{className:"ccy-mark"})," ",e.totalCredits]})]})]}),t.jsx(W,{children:s.map(i=>t.jsx(ft,{item:i},i.key))})]})}function yt({sale:e}){const{data:s,isLoading:n}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>_(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(s==null?void 0:s.name)??d("activity.itemFallback"),r=(s==null?void 0:s.thumbnail)??"",c=R({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,u=t.jsxs(t.Fragment,{children:[n?t.jsx(U,{}):t.jsx(B,{children:r?t.jsx("img",{src:r,alt:i}):t.jsx($,{name:"offer",size:20})}),t.jsxs(K,{children:[n?t.jsx(V,{}):t.jsx(Q,{title:i,children:i}),t.jsx(X,{children:d("activity.boughtFrom",{account:pe(e.seller)})})]})]});return t.jsxs(E,{"data-testid":"activity-mana-purchase",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:I(e.createdAt)}),t.jsx(F,{children:d("activity.paidWithMana")})]}),t.jsxs(M,{children:[t.jsx(D,{"data-status":"SETTLED",children:d("activity.completed")}),t.jsxs(j,{children:[xe(e.manaWei)," ",t.jsx(me,{children:t.jsx(le,{src:oe,alt:"MANA"})})]})]})]}),t.jsx(W,{children:c?t.jsx(Y,{to:c,"data-link":"true",children:u}):t.jsx(O,{children:u})})]})}function vt({sale:e,payout:s}){const{data:n,isLoading:i}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>_(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),r=(n==null?void 0:n.name)??d("activity.itemFallback"),c=(n==null?void 0:n.thumbnail)??"",u=R({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,o=t.jsxs(t.Fragment,{children:[i?t.jsx(U,{}):t.jsx(B,{children:c?t.jsx("img",{src:c,alt:r}):t.jsx($,{name:"offer",size:20})}),t.jsxs(K,{children:[i?t.jsx(V,{}):t.jsx(Q,{title:r,children:r}),t.jsxs(X,{children:[d("activity.soldTo",{account:pe(e.counterparty)}),s.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:I(s.availableAt)})}`:""]})]})]});return t.jsxs(E,{"data-testid":"activity-sale",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:I(e.createdAt)}),t.jsx(F,{children:d("activity.saleLabel")})]}),t.jsxs(M,{children:[t.jsx(D,{"data-status":s.kind==="pending"?"PENDING":"SOLD",children:s.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),s.kind==="direct"?t.jsxs(j,{"data-kind":"income",children:["+",xe(e.manaWei)," ",t.jsx(me,{children:t.jsx(le,{src:oe,alt:"MANA"})})]}):s.credits!==null?t.jsxs(j,{"data-kind":"income",children:[t.jsx(N,{className:"ccy-mark"})," +",Fe(s.credits)]}):t.jsx(j,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),t.jsx(W,{children:u?t.jsx(Y,{to:u,"data-link":"true",children:o}):t.jsx(O,{children:o})})]})}function wt({order:e}){const s=`$${(e.usdCents/100).toFixed(2)}`,n=Ce(e.status),i=n==="SETTLED"?d("activity.completed"):n==="FAILED"?d("activity.failed"):n==="UNFINISHED"?d("activity.unfinished"):d("activity.processing"),r=z(p=>p.session),c=Se(),[u,o]=g.useState(!1),x=e.status==="initiated"&&!!r;async function f(){if(!(!r||u)){o(!0);try{const p=await Me(e.id,r.identity);if(p){window.location.href=p;return}De.info(d("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})}finally{o(!1)}}}return t.jsx(E,{"data-testid":"credit-order",children:t.jsxs(T,{children:[t.jsx(ct,{children:t.jsx("img",{src:et,alt:"","aria-hidden":!0})}),t.jsxs(C,{children:[t.jsx(S,{children:I(e.createdAt)}),t.jsxs(F,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:s})]})]}),t.jsxs(M,{children:[x?t.jsx(dt,{type:"button",onClick:()=>void f(),disabled:u,"data-testid":"resume-order",children:u?d("activity.resuming"):d("activity.resume")}):null,t.jsx(D,{"data-status":n,children:i}),t.jsxs(j,{"data-kind":"income",children:["+",t.jsx(N,{className:"ccy-mark"})," ",e.credits]})]})]})})}function jt({filter:e}){const s={all:{icon:"clock",title:d("activity.emptyAllTitle"),body:d("activity.emptyAllBody")},purchases:{icon:"cart",title:d("activity.emptyPurchasesTitle"),body:d("activity.emptyPurchasesBody")},sales:{icon:"offer",title:d("activity.emptySalesTitle"),body:d("activity.emptySalesBody")}}[e];return t.jsxs(he,{children:[t.jsx($,{name:s.icon,size:40,color:a.colors.muted2}),t.jsx(ue,{children:s.title}),t.jsx("p",{className:"muted",children:s.body}),e!=="sales"?t.jsx(pt,{as:re,to:"/items",variant:"purple",children:d("notFound.cta")}):null]})}function Dt(){const{session:e}=z(),[s,n]=g.useState("all"),[i,r]=He(),c=i.get(H)===ne||i.get(q)===gt;Pe({title:c?d("seo.import.title"):d("nav.activity"),noindex:!0});const{count:u}=ze(),{count:o}=Je(),f=u!==void 0&&o!==void 0&&(u>0||o>0||c),p=!!e&&!c&&s!=="sales",m=!!e&&!c&&s!=="purchases",b=L(["purchases",e==null?void 0:e.address],l=>Ee(e.address,e.identity,{first:P,skip:l}),{enabled:p}),y=L(["sales",e==null?void 0:e.address],l=>te(e.address,{role:"seller",first:P,skip:l}),{enabled:m}),v=L(["credit-orders",e==null?void 0:e.address],l=>ie(e.address,e.identity,{first:P,skip:l}),{enabled:p}),w=L(["mana-purchases",e==null?void 0:e.address],l=>te(e.address,{role:"buyer",first:P,skip:l}),{enabled:p}),{data:Z}=A({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ie(e.address,e.identity,{first:200}).then(l=>l.payouts),enabled:m,staleTime:6e4}),ge=g.useMemo(()=>Xe(Z),[Z]),{data:fe}=Ne(m);if(!e)return t.jsxs(he,{children:[t.jsx($,{name:"clock",size:40,color:a.colors.muted2}),t.jsx(ue,{children:d("activity.signInTitle")}),t.jsx("p",{className:"muted",children:d("activity.signInBody")})]});const J=Ve(Qe({purchases:p?b.items:[],sales:m?y.items:[],creditOrders:p?v.items:[],manaPurchases:p?w.items:[],rate:fe}),s),be=p&&(b.isLoading||v.isLoading||w.isLoading)||m&&y.isLoading,ee=p&&(b.isFetchingNextPage||v.isFetchingNextPage||w.isFetchingNextPage)||m&&y.isFetchingNextPage,ye=p&&(b.hasNextPage||v.hasNextPage||w.hasNextPage)||m&&y.hasNextPage;function ve(){p&&b.hasNextPage&&b.fetchNextPage(),p&&v.hasNextPage&&v.fetchNextPage(),p&&w.hasNextPage&&w.fetchNextPage(),m&&y.hasNextPage&&y.fetchNextPage()}function we(l){if(n(l),!c)return;const k=new URLSearchParams(i);k.delete(H),k.delete(q),r(k,{replace:!0})}function je(){const l=new URLSearchParams(i);l.set(H,ne),l.delete(q),r(l,{replace:!0})}return t.jsxs(tt,{children:[t.jsx(it,{children:t.jsx(st,{children:d("nav.activity")})}),t.jsxs(at,{role:"tablist","aria-label":d("nav.activity"),children:[mt.map(l=>t.jsx(de,{type:"button",role:"tab","aria-selected":!c&&s===l,"data-active":!c&&s===l,"data-testid":`activity-filter-${l}`,onClick:()=>we(l),children:d(`activity.filter.${l}`)},l)),f?t.jsxs(nt,{type:"button",role:"tab","aria-selected":c,"data-active":c,"data-testid":"activity-filter-migrate","aria-label":u?d("activity.migrate.chipAria",{count:u}):void 0,onClick:je,children:[d("activity.migrate.chip"),u?t.jsx(rt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:u}):null]}):null]}),c?t.jsx(g.Suspense,{fallback:t.jsx(ot,{"aria-busy":"true"}),children:t.jsx(xt,{})}):be?t.jsx(se,{children:Array.from({length:5}).map((l,k)=>t.jsx(ae,{},k))}):J.length===0?t.jsx(jt,{filter:s}):t.jsxs(t.Fragment,{children:[t.jsxs(se,{children:[J.map(l=>l.kind==="purchase"?t.jsx(bt,{order:l.order},l.id):l.kind==="credit"?t.jsx(wt,{order:l.order},l.id):l.kind==="mana-purchase"?t.jsx(yt,{sale:l.sale},l.id):t.jsx(vt,{sale:l.sale,payout:Ye(ge,l.sale)},l.id)),ee?t.jsx(ae,{}):null]}),t.jsx(Re,{hasNextPage:ye,isFetching:ee,onLoadMore:ve})]})]})}export{Dt as Activity};
381
+ `,Y=O.withComponent(re),xt=g.lazy(()=>Te(()=>import("./index-D8LZCVOB.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(e=>({default:e.ImportListings}))),P=24,mt=["all","purchases","sales"],H="section",ne="listings",q="view",gt="migrate";function I(e){try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function pe(e){return e.length>10?`${e.slice(0,6)}…${e.slice(-4)}`:e}function xe(e){const s=Number(e)/1e18;return Number.isFinite(s)?s.toLocaleString("en",{maximumFractionDigits:2}):"0"}function me({children:e}){const s=g.useRef(null),[n,i]=g.useState(null),r=()=>{var u;const c=(u=s.current)==null?void 0:u.getBoundingClientRect();c&&i({top:c.bottom+8,left:c.left+c.width/2})};return t.jsxs(lt,{ref:s,tabIndex:0,onMouseEnter:r,onMouseLeave:()=>i(null),onFocus:r,onBlur:()=>i(null),children:[e,n?qe.createPortal(t.jsx(ht,{style:{top:n.top,left:n.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function ft({item:e}){const s=!!e.contractAddress&&!!e.itemId,n=!!e.tradeId||s,{data:i,isLoading:r}=A({queryKey:["order-line-display",e.tradeId,e.contractAddress,e.itemId],queryFn:()=>e.tradeId?Oe(e.tradeId):_(e.contractAddress,{itemId:e.itemId}),enabled:n,staleTime:5*6e4}),c=n&&r,u=(i==null?void 0:i.name)??d("activity.itemFallback"),o=(i==null?void 0:i.thumbnail)??"",x=R({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,f=t.jsxs(t.Fragment,{children:[c?t.jsx(U,{}):t.jsx(B,{children:o?t.jsx("img",{src:o,alt:u}):t.jsx($,{name:"cart",size:20})}),t.jsxs(K,{children:[c?t.jsx(V,{}):t.jsx(Q,{title:u,children:u}),e.quantity>1?t.jsx(X,{children:d("activity.quantity",{count:e.quantity})}):null]}),t.jsxs(ut,{children:[t.jsx(N,{className:"ccy-mark"})," ",e.credits]})]});return x?t.jsx(Y,{to:x,"data-link":"true",children:f}):t.jsx(O,{children:f})}function bt({order:e}){const s=Ue(e.lines),n=s.reduce((i,r)=>i+r.quantity,0);return t.jsxs(E,{"data-testid":"purchase-order",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:I(e.createdAt)}),t.jsxs(F,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:n})]})]}),t.jsxs(M,{children:[t.jsx(D,{"data-status":e.status,children:e.status==="PENDING"?d("activity.processing"):d("activity.completed")}),t.jsxs(j,{children:[t.jsx(N,{className:"ccy-mark"})," ",e.totalCredits]})]})]}),t.jsx(W,{children:s.map(i=>t.jsx(ft,{item:i},i.key))})]})}function yt({sale:e}){const{data:s,isLoading:n}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>_(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),i=(s==null?void 0:s.name)??d("activity.itemFallback"),r=(s==null?void 0:s.thumbnail)??"",c=R({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,u=t.jsxs(t.Fragment,{children:[n?t.jsx(U,{}):t.jsx(B,{children:r?t.jsx("img",{src:r,alt:i}):t.jsx($,{name:"offer",size:20})}),t.jsxs(K,{children:[n?t.jsx(V,{}):t.jsx(Q,{title:i,children:i}),t.jsx(X,{children:d("activity.boughtFrom",{account:pe(e.seller)})})]})]});return t.jsxs(E,{"data-testid":"activity-mana-purchase",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:I(e.createdAt)}),t.jsx(F,{children:d("activity.paidWithMana")})]}),t.jsxs(M,{children:[t.jsx(D,{"data-status":"SETTLED",children:d("activity.completed")}),t.jsxs(j,{children:[xe(e.manaWei)," ",t.jsx(me,{children:t.jsx(le,{src:oe,alt:"MANA"})})]})]})]}),t.jsx(W,{children:c?t.jsx(Y,{to:c,"data-link":"true",children:u}):t.jsx(O,{children:u})})]})}function vt({sale:e,payout:s}){const{data:n,isLoading:i}=A({queryKey:["asset-display",e.contractAddress,e.tokenId,e.itemId],queryFn:()=>_(e.contractAddress,{tokenId:e.tokenId,itemId:e.itemId}),enabled:!!e.contractAddress,staleTime:3e5}),r=(n==null?void 0:n.name)??d("activity.itemFallback"),c=(n==null?void 0:n.thumbnail)??"",u=R({contractAddress:e.contractAddress,tokenId:e.tokenId,itemId:e.itemId})??void 0,o=t.jsxs(t.Fragment,{children:[i?t.jsx(U,{}):t.jsx(B,{children:c?t.jsx("img",{src:c,alt:r}):t.jsx($,{name:"offer",size:20})}),t.jsxs(K,{children:[i?t.jsx(V,{}):t.jsx(Q,{title:r,children:r}),t.jsxs(X,{children:[d("activity.soldTo",{account:pe(e.counterparty)}),s.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:I(s.availableAt)})}`:""]})]})]});return t.jsxs(E,{"data-testid":"activity-sale",children:[t.jsxs(T,{children:[t.jsxs(C,{children:[t.jsx(S,{children:I(e.createdAt)}),t.jsx(F,{children:d("activity.saleLabel")})]}),t.jsxs(M,{children:[t.jsx(D,{"data-status":s.kind==="pending"?"PENDING":"SOLD",children:s.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),s.kind==="direct"?t.jsxs(j,{"data-kind":"income",children:["+",xe(e.manaWei)," ",t.jsx(me,{children:t.jsx(le,{src:oe,alt:"MANA"})})]}):s.credits!==null?t.jsxs(j,{"data-kind":"income",children:[t.jsx(N,{className:"ccy-mark"})," +",Fe(s.credits)]}):t.jsx(j,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),t.jsx(W,{children:u?t.jsx(Y,{to:u,"data-link":"true",children:o}):t.jsx(O,{children:o})})]})}function wt({order:e}){const s=`$${(e.usdCents/100).toFixed(2)}`,n=Ce(e.status),i=n==="SETTLED"?d("activity.completed"):n==="FAILED"?d("activity.failed"):n==="UNFINISHED"?d("activity.unfinished"):d("activity.processing"),r=z(p=>p.session),c=Se(),[u,o]=g.useState(!1),x=e.status==="initiated"&&!!r;async function f(){if(!(!r||u)){o(!0);try{const p=await Me(e.id,r.identity);if(p){window.location.href=p;return}De.info(d("activity.resumeExpired")),c.invalidateQueries({queryKey:["credit-orders"]})}finally{o(!1)}}}return t.jsx(E,{"data-testid":"credit-order",children:t.jsxs(T,{children:[t.jsx(ct,{children:t.jsx("img",{src:et,alt:"","aria-hidden":!0})}),t.jsxs(C,{children:[t.jsx(S,{children:I(e.createdAt)}),t.jsxs(F,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:s})]})]}),t.jsxs(M,{children:[x?t.jsx(dt,{type:"button",onClick:()=>void f(),disabled:u,"data-testid":"resume-order",children:u?d("activity.resuming"):d("activity.resume")}):null,t.jsx(D,{"data-status":n,children:i}),t.jsxs(j,{"data-kind":"income",children:["+",t.jsx(N,{className:"ccy-mark"})," ",e.credits]})]})]})})}function jt({filter:e}){const s={all:{icon:"clock",title:d("activity.emptyAllTitle"),body:d("activity.emptyAllBody")},purchases:{icon:"cart",title:d("activity.emptyPurchasesTitle"),body:d("activity.emptyPurchasesBody")},sales:{icon:"offer",title:d("activity.emptySalesTitle"),body:d("activity.emptySalesBody")}}[e];return t.jsxs(he,{children:[t.jsx($,{name:s.icon,size:40,color:a.colors.muted2}),t.jsx(ue,{children:s.title}),t.jsx("p",{className:"muted",children:s.body}),e!=="sales"?t.jsx(pt,{as:re,to:"/items",variant:"purple",children:d("notFound.cta")}):null]})}function Dt(){const{session:e}=z(),[s,n]=g.useState("all"),[i,r]=He(),c=i.get(H)===ne||i.get(q)===gt;Pe({title:c?d("seo.import.title"):d("nav.activity"),noindex:!0});const{count:u}=ze(),{count:o}=Je(),f=u!==void 0&&o!==void 0&&(u>0||o>0||c),p=!!e&&!c&&s!=="sales",m=!!e&&!c&&s!=="purchases",b=L(["purchases",e==null?void 0:e.address],l=>Ee(e.address,e.identity,{first:P,skip:l}),{enabled:p}),y=L(["sales",e==null?void 0:e.address],l=>te(e.address,{role:"seller",first:P,skip:l}),{enabled:m}),v=L(["credit-orders",e==null?void 0:e.address],l=>ie(e.address,e.identity,{first:P,skip:l}),{enabled:p}),w=L(["mana-purchases",e==null?void 0:e.address],l=>te(e.address,{role:"buyer",first:P,skip:l}),{enabled:p}),{data:Z}=A({queryKey:["sale-payouts",e==null?void 0:e.address],queryFn:()=>ie(e.address,e.identity,{first:200}).then(l=>l.payouts),enabled:m,staleTime:6e4}),ge=g.useMemo(()=>Xe(Z),[Z]),{data:fe}=Ne(m);if(!e)return t.jsxs(he,{children:[t.jsx($,{name:"clock",size:40,color:a.colors.muted2}),t.jsx(ue,{children:d("activity.signInTitle")}),t.jsx("p",{className:"muted",children:d("activity.signInBody")})]});const J=Ve(Qe({purchases:p?b.items:[],sales:m?y.items:[],creditOrders:p?v.items:[],manaPurchases:p?w.items:[],rate:fe}),s),be=p&&(b.isLoading||v.isLoading||w.isLoading)||m&&y.isLoading,ee=p&&(b.isFetchingNextPage||v.isFetchingNextPage||w.isFetchingNextPage)||m&&y.isFetchingNextPage,ye=p&&(b.hasNextPage||v.hasNextPage||w.hasNextPage)||m&&y.hasNextPage;function ve(){p&&b.hasNextPage&&b.fetchNextPage(),p&&v.hasNextPage&&v.fetchNextPage(),p&&w.hasNextPage&&w.fetchNextPage(),m&&y.hasNextPage&&y.fetchNextPage()}function we(l){if(n(l),!c)return;const k=new URLSearchParams(i);k.delete(H),k.delete(q),r(k,{replace:!0})}function je(){const l=new URLSearchParams(i);l.set(H,ne),l.delete(q),r(l,{replace:!0})}return t.jsxs(tt,{children:[t.jsx(it,{children:t.jsx(st,{children:d("nav.activity")})}),t.jsxs(at,{role:"tablist","aria-label":d("nav.activity"),children:[mt.map(l=>t.jsx(de,{type:"button",role:"tab","aria-selected":!c&&s===l,"data-active":!c&&s===l,"data-testid":`activity-filter-${l}`,onClick:()=>we(l),children:d(`activity.filter.${l}`)},l)),f?t.jsxs(nt,{type:"button",role:"tab","aria-selected":c,"data-active":c,"data-testid":"activity-filter-migrate","aria-label":u?d("activity.migrate.chipAria",{count:u}):void 0,onClick:je,children:[d("activity.migrate.chip"),u?t.jsx(rt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:u}):null]}):null]}),c?t.jsx(g.Suspense,{fallback:t.jsx(ot,{"aria-busy":"true"}),children:t.jsx(xt,{})}):be?t.jsx(se,{children:Array.from({length:5}).map((l,k)=>t.jsx(ae,{},k))}):J.length===0?t.jsx(jt,{filter:s}):t.jsxs(t.Fragment,{children:[t.jsxs(se,{children:[J.map(l=>l.kind==="purchase"?t.jsx(bt,{order:l.order},l.id):l.kind==="credit"?t.jsx(wt,{order:l.order},l.id):l.kind==="mana-purchase"?t.jsx(yt,{sale:l.sale},l.id):t.jsx(vt,{sale:l.sale,payout:Ye(ge,l.sale)},l.id)),ee?t.jsx(ae,{}):null]}),t.jsx(Re,{hasNextPage:ye,isFetching:ee,onLoadMore:ve})]})]})}export{Dt as Activity};
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-BYHuwl8r.js";import{s as u}from"./index-9yrtZWWe.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-BYHuwl8r.js";import{s as u}from"./index-buu21jrH.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -94,4 +94,4 @@ void main() {
94
94
  inset: 0;
95
95
  width: 100%;
96
96
  height: 100%;
97
- `;function G(){const t=l.useRef(null),n=l.useRef(0);return l.useEffect(()=>{var x;const r=t.current;if(!r||(x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=p(e,e.VERTEX_SHADER,U),c=p(e,e.FRAGMENT_SHADER,P);if(!o||!c){o&&e.deleteShader(o),c&&e.deleteShader(c);return}const a=D(e,o,c);if(!a){e.deleteShader(o),e.deleteShader(c);return}const m=e.getAttribLocation(a,"a_position"),R=e.getUniformLocation(a,"u_time"),_=e.getUniformLocation(a,"u_resolution"),y=e.getUniformLocation(a,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let d=!1;const f=L(e,b,()=>d),w=()=>{const i=window.devicePixelRatio||1,E=r.clientWidth*i,g=r.clientHeight*i;(r.width!==E||r.height!==g)&&(r.width=E,r.height=g)},A=performance.now()/1e3,h=()=>{w(),e.viewport(0,0,r.width,r.height),e.useProgram(a),e.uniform1f(R,performance.now()/1e3-A),e.uniform2f(_,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,f),e.uniform1i(y,0),e.enableVertexAttribArray(m),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(m,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),n.current=requestAnimationFrame(h)},T=i=>{i.preventDefault(),cancelAnimationFrame(n.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(h),()=>{d=!0,cancelAnimationFrame(n.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(a),e.deleteShader(o),e.deleteShader(c),e.deleteBuffer(s),e.deleteTexture(f)}},[]),v.jsxs(B,{"aria-hidden":!0,children:[v.jsx(F,{style:{backgroundImage:`url(${S})`}}),v.jsx(I,{ref:t})]})}export{G as default};
97
+ `;function G(){const t=l.useRef(null),n=l.useRef(0);return l.useEffect(()=>{var x;const r=t.current;if(!r||(x=window.matchMedia)!=null&&x.call(window,"(prefers-reduced-motion: reduce)").matches)return;const e=r.getContext("webgl",{alpha:!1,antialias:!1});if(!e)return;const o=p(e,e.VERTEX_SHADER,U),i=p(e,e.FRAGMENT_SHADER,P);if(!o||!i){o&&e.deleteShader(o),i&&e.deleteShader(i);return}const a=D(e,o,i);if(!a){e.deleteShader(o),e.deleteShader(i);return}const m=e.getAttribLocation(a,"a_position"),R=e.getUniformLocation(a,"u_time"),_=e.getUniformLocation(a,"u_resolution"),y=e.getUniformLocation(a,"u_overlayTex"),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),e.STATIC_DRAW);let d=!1;const f=L(e,b,()=>d),w=()=>{const c=window.devicePixelRatio||1,E=r.clientWidth*c,g=r.clientHeight*c;(r.width!==E||r.height!==g)&&(r.width=E,r.height=g)},A=performance.now()/1e3,h=()=>{w(),e.viewport(0,0,r.width,r.height),e.useProgram(a),e.uniform1f(R,performance.now()/1e3-A),e.uniform2f(_,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,f),e.uniform1i(y,0),e.enableVertexAttribArray(m),e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(m,2,e.FLOAT,!1,0,0),e.drawArrays(e.TRIANGLES,0,6),n.current=requestAnimationFrame(h)},T=c=>{c.preventDefault(),cancelAnimationFrame(n.current),r.style.opacity="0"};return r.addEventListener("webglcontextlost",T,!1),n.current=requestAnimationFrame(h),()=>{d=!0,cancelAnimationFrame(n.current),r.removeEventListener("webglcontextlost",T),e.deleteProgram(a),e.deleteShader(o),e.deleteShader(i),e.deleteBuffer(s),e.deleteTexture(f)}},[]),v.jsxs(B,{"aria-hidden":!0,children:[v.jsx(F,{style:{backgroundImage:`url(${S})`}}),v.jsx(I,{ref:t})]})}export{G as default};
@@ -1,4 +1,4 @@
1
- import{b as Ae,r as w,j as e,u as Ke}from"./react-BYHuwl8r.js";import{u as Je}from"./useUrlFilters-DH-gxdfV.js";import{u as Qe,S as ke,R as Xe,F as Ye,e as et}from"./categories-Djn1x7W5.js";import{c as W,r as tt,bm as nt,bn as st,aC as rt,a as it,s,t,o as Me,bc as ot,A as at,L as me,b as n,y as lt,I as T,z as A,bZ as Y,bb as ct,$ as Q,br as dt,bq as pt,x as Ne,ao as Pe,n as We,q as ht,am as xt,aq as Se,ar as G,aG as mt,bK as ft}from"./index-9yrtZWWe.js";import{g as ut,h as gt,i as bt,j as yt,k as wt,C as jt,l as vt,o as $t,m as Ct,n as kt,M as St,u as Et,E as Tt,v as _t,p as Rt,q as zt,r as It,s as At,t as Mt}from"./Assets.styles-BR6LRzsi.js";import{L as Nt}from"./LoadMore-DSfpb61Y.js";import{u as Pt}from"./useInfiniteGrid-ByXPg4Cl.js";import{E as Wt}from"./ErrorNotice-DuHUqzrI.js";import{d as Bt}from"./dcl-schemas-CmtP3U6y.js";import{s as Ft,G as Lt,w as Ut,S as Ht}from"./buy-gasless-DX2i6M46.js";import{s as Ot,k as Gt}from"./buy-CrEjBbQr.js";import{f as Dt}from"./errors-DB8YoX8H.js";import{J as qt,C as Vt,B as fe}from"./ethers-BDpbhgX6.js";import{n as Zt}from"./Tooltip-BUoy_yBS.js";import{G as Kt}from"./grid.styles-B8-aHr-Z.js";import"./skeleton.styles-BkB0ehmF.js";import"./sentry-Dx-KuLV3.js";import"./intl-CBcMB1D2.js";import"./authorizations-C46pWUg_.js";import"./sendMetaTransaction-BHIBWrRl.js";function D(r){const o=r.source??"item",l=r.tradeId||`${r.contractAddress}-${r.tokenId??r.itemId??""}`;return`${o}:${l}`}const B="100000000000000000000",Be=2,X=15,Jt=/^[a-zA-Z0-9]+$/;function Ee(r){const o=r.trim();return o.length===0?{ok:!1,reason:"empty"}:Jt.test(o)?o.length<Be?{ok:!1,reason:"too-short"}:o.length>X?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Qt(r){return r.replace(/[^a-zA-Z0-9]/g,"").slice(0,X)}const Xt=["function available(string _subdomain) view returns (bool)"],Te={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Yt(){return W.chainId===Number(Bt.ChainId.MATIC_MAINNET)?Te.mainnet:Te.sepolia}async function en(r,o={}){var c;const{rpc:l,address:x}=Yt(),h=new qt(l),d=new Vt(x,Xt,h);console.info(`[names] availability check → DCLRegistrar(${x}).available("${r}") on ${l}`);const p=await d.available(r);if((c=o.signal)!=null&&c.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${r}" available=${p}`),p?"available":"taken"}const tn="https://app.across.to/api";class ue extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function nn(r){return rt(B,r)}async function sn(r,o,l={}){var c;const x=l.chainId??W.chainId,h=l.provider??"across",d=`${W.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(o)}&chainId=${x}&provider=${h}`,p=await it(d,{method:"GET",identity:r,metadata:{}});if(!p.ok){let a;try{a=(c=await p.json())==null?void 0:c.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new ue:new Error(`fetchNameCreditRoute ${p.status}`)}return p.json()}function rn(r,o){const l=fe.from(r.availableAmount),h=fe.from(B).sub(l);return{credits:[{value:r.amount,expiresAt:Number(r.expiresAt),salt:Gt(r.id)}],creditsSignatures:[r.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:h.isNegative()?"0":h.toString(),maxCreditedValue:B}}async function on(r,o={}){const l=tn,x=o.intervalMs??1e4,h=o.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let p=0;p<h;p++){try{const c=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${r}`);if(c.ok){const a=await c.json(),m=(a.status??"pending").toLowerCase(),g=a.fillTx??a.fillTxnRef??null,u=a.actionsSucceeded!==!1;if(m==="filled")return{status:"filled",destinationTxHash:g,actionsSucceeded:u};if(m==="refunded"||m==="expired")return{status:m,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:g,actionsSucceeded:u}}}catch{}p<h-1&&await new Promise(c=>setTimeout(c,x))}return d}async function an(r){const{name:o,identity:l,signer:x}=r,h=r.chainId??W.chainId,d=r.provider??"across",p=(r.beneficiary??await x.getAddress()).toLowerCase();let c=null,a=!1;console.info("[names] register start",{name:o,buyer:p,chainId:h,provider:d});try{const m=await tt(h),g=nn(m);console.info("[names] step 1/6 sized reservation",{usdCents:g,manaRate:m});const u=await sn(l,o,{chainId:h,provider:d});console.info("[names] step 2/6 route fetched",{target:u.externalCall.target,selector:u.externalCall.selector,provider:u.provider,quoteId:u.quoteId});const v=await nt(l,g);if(c=v.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:v.credit.id,maxCreditedValue:v.maxCreditedValue}),fe.from(v.maxCreditedValue).lt(B))throw new Error("Credit under-sized for the name price");const j=rn(v.credit,u);let f;try{f=await Ft({chainId:h,buyer:p,signer:x,args:j})}catch(b){if(!(b instanceof Lt))throw b;f=await Ot(h,j,x)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Ut(f),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const b=await on(f,r.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:f};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(m){if(console.error("[names] register failed — raw error:",m,{name:o,buyer:p,originConfirmed:a}),m instanceof Ht)return{status:"pending",originTxHash:m.txHash};if(c&&!a&&await st(l,[c]).catch(()=>{}),m instanceof ue)throw m;const g=new Error(Dt(m,"Couldn't register the name. Please try again.",{sale:!0}));throw g.cause=m,g}}const ln=s.div`
1
+ import{b as Ae,r as w,j as e,u as Ke}from"./react-BYHuwl8r.js";import{u as Je}from"./useUrlFilters-DH-gxdfV.js";import{u as Qe,S as ke,R as Xe,F as Ye,e as et}from"./categories-KFHNUm7E.js";import{c as W,r as tt,bm as nt,bn as st,aC as rt,a as it,s,t,o as Me,bc as ot,A as at,L as me,b as n,y as lt,I as T,z as A,bZ as Y,bb as ct,$ as Q,br as dt,bq as pt,x as Ne,ao as Pe,n as We,q as ht,am as xt,aq as Se,ar as G,aG as mt,bK as ft}from"./index-buu21jrH.js";import{g as ut,h as gt,i as bt,j as yt,k as wt,C as jt,l as vt,o as $t,m as Ct,n as kt,M as St,u as Et,E as Tt,v as _t,p as Rt,q as zt,r as It,s as At,t as Mt}from"./Assets.styles-D1Vg-U1C.js";import{L as Nt}from"./LoadMore-CKNE48ED.js";import{u as Pt}from"./useInfiniteGrid--LOCzyU9.js";import{E as Wt}from"./ErrorNotice-CXsnDhEh.js";import{d as Bt}from"./dcl-schemas-CmtP3U6y.js";import{s as Ft,G as Lt,w as Ut,S as Ht}from"./buy-gasless-CYY_v3bj.js";import{s as Ot,k as Gt}from"./buy-Dgj0sRqb.js";import{f as Dt}from"./errors-CzBZCztT.js";import{J as qt,C as Vt,B as fe}from"./ethers-BDpbhgX6.js";import{n as Zt}from"./Tooltip-B2qDq-8v.js";import{G as Kt}from"./grid.styles-U_Gpy1wT.js";import"./skeleton.styles-BfEPveSL.js";import"./sentry-Dx-KuLV3.js";import"./intl-CBcMB1D2.js";import"./authorizations-dpp0OnHI.js";import"./sendMetaTransaction-CzqCMKMd.js";function D(r){const o=r.source??"item",l=r.tradeId||`${r.contractAddress}-${r.tokenId??r.itemId??""}`;return`${o}:${l}`}const B="100000000000000000000",Be=2,X=15,Jt=/^[a-zA-Z0-9]+$/;function Ee(r){const o=r.trim();return o.length===0?{ok:!1,reason:"empty"}:Jt.test(o)?o.length<Be?{ok:!1,reason:"too-short"}:o.length>X?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Qt(r){return r.replace(/[^a-zA-Z0-9]/g,"").slice(0,X)}const Xt=["function available(string _subdomain) view returns (bool)"],Te={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Yt(){return W.chainId===Number(Bt.ChainId.MATIC_MAINNET)?Te.mainnet:Te.sepolia}async function en(r,o={}){var c;const{rpc:l,address:x}=Yt(),h=new qt(l),d=new Vt(x,Xt,h);console.info(`[names] availability check → DCLRegistrar(${x}).available("${r}") on ${l}`);const p=await d.available(r);if((c=o.signal)!=null&&c.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${r}" available=${p}`),p?"available":"taken"}const tn="https://app.across.to/api";class ue extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function nn(r){return rt(B,r)}async function sn(r,o,l={}){var c;const x=l.chainId??W.chainId,h=l.provider??"across",d=`${W.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(o)}&chainId=${x}&provider=${h}`,p=await it(d,{method:"GET",identity:r,metadata:{}});if(!p.ok){let a;try{a=(c=await p.json())==null?void 0:c.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new ue:new Error(`fetchNameCreditRoute ${p.status}`)}return p.json()}function rn(r,o){const l=fe.from(r.availableAmount),h=fe.from(B).sub(l);return{credits:[{value:r.amount,expiresAt:Number(r.expiresAt),salt:Gt(r.id)}],creditsSignatures:[r.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:h.isNegative()?"0":h.toString(),maxCreditedValue:B}}async function on(r,o={}){const l=tn,x=o.intervalMs??1e4,h=o.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let p=0;p<h;p++){try{const c=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${r}`);if(c.ok){const a=await c.json(),m=(a.status??"pending").toLowerCase(),g=a.fillTx??a.fillTxnRef??null,u=a.actionsSucceeded!==!1;if(m==="filled")return{status:"filled",destinationTxHash:g,actionsSucceeded:u};if(m==="refunded"||m==="expired")return{status:m,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:g,actionsSucceeded:u}}}catch{}p<h-1&&await new Promise(c=>setTimeout(c,x))}return d}async function an(r){const{name:o,identity:l,signer:x}=r,h=r.chainId??W.chainId,d=r.provider??"across",p=(r.beneficiary??await x.getAddress()).toLowerCase();let c=null,a=!1;console.info("[names] register start",{name:o,buyer:p,chainId:h,provider:d});try{const m=await tt(h),g=nn(m);console.info("[names] step 1/6 sized reservation",{usdCents:g,manaRate:m});const u=await sn(l,o,{chainId:h,provider:d});console.info("[names] step 2/6 route fetched",{target:u.externalCall.target,selector:u.externalCall.selector,provider:u.provider,quoteId:u.quoteId});const v=await nt(l,g);if(c=v.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:v.credit.id,maxCreditedValue:v.maxCreditedValue}),fe.from(v.maxCreditedValue).lt(B))throw new Error("Credit under-sized for the name price");const j=rn(v.credit,u);let f;try{f=await Ft({chainId:h,buyer:p,signer:x,args:j})}catch(b){if(!(b instanceof Lt))throw b;f=await Ot(h,j,x)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Ut(f),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const b=await on(f,r.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:f};if(b.status!=="filled"||!b.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(m){if(console.error("[names] register failed — raw error:",m,{name:o,buyer:p,originConfirmed:a}),m instanceof Ht)return{status:"pending",originTxHash:m.txHash};if(c&&!a&&await st(l,[c]).catch(()=>{}),m instanceof ue)throw m;const g=new Error(Dt(m,"Couldn't register the name. Please try again.",{sale:!0}));throw g.cause=m,g}}const ln=s.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -379,7 +379,7 @@ import{b as Ae,r as w,j as e,u as Ke}from"./react-BYHuwl8r.js";import{u as Je}fr
379
379
  color: ${t.colors.accent};
380
380
  }
381
381
  }
382
- `;function En({name:r,priceCredits:o,onClose:l}){const{session:x}=Me(),{data:h,isError:d}=ot(x),p=at(),c=Ae(),[a,m]=w.useState("confirm"),[g,u]=w.useState(""),[v,j]=w.useState(null),f=w.useRef(!1),b=g.trim().toLowerCase()===r.toLowerCase(),$=a==="completing",C=o!=null?me(o):"—",k=o==null,E=h==null?void 0:h.credits,M=o!=null&&E!=null?o-E:0,S=M>0,N=k?n("names.priceUnavailable"):S?n("names.insufficientCredits",{credits:me(M)}):null;w.useEffect(()=>{const y=R=>{R.key==="Escape"&&!$&&l()};document.addEventListener("keydown",y);const _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=_}},[$,l]);async function F(){if(!(!x||!b||k||S||f.current)){f.current=!0,m("completing"),j(null);try{const y=await an({name:r,identity:x.identity,signer:x.signer});Q("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:o??null,settlement:y.status}),p.invalidateQueries({queryKey:["usd-balance"]}),p.invalidateQueries({queryKey:["my-assets"]}),m(y.status==="registered"?"success":"pending")}catch(y){Q(pt(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:dt(y),purchase_type:"name"}),j(y instanceof ue?n("names.errorRouteCost"):(y==null?void 0:y.message)||n("names.errorGeneric")),m("error")}finally{f.current=!1}}}const L=a!=="success"&&a!=="pending",z=lt(x==null?void 0:x.providerType);return e.jsx(ln,{onClick:$?void 0:l,role:"presentation",children:e.jsxs(cn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:y=>y.stopPropagation(),children:[L&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:a==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ne,{onClick:l,disabled:$,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(se,{children:[n("names.myCreditsBalance")," ",e.jsx(A,{})," ",Y(h,d)]}),e.jsx(re,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ie,{children:[e.jsx(oe,{"aria-hidden":!0,children:"@"}),e.jsxs(ae,{children:[e.jsxs(le,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(A,{}),C]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:v})]}),e.jsx(_e,{onClick:()=>m("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(dn,{children:[e.jsx(pn,{children:n("names.confirmTitle")}),e.jsx(hn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Tn(r)}</b>`})}}),e.jsxs(xn,{children:[e.jsx(mn,{"aria-hidden":!0,children:"@"}),e.jsx(fn,{value:g,onChange:y=>u(y.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(g.length,8)}ch`}}),e.jsx(un,{children:".dcl.eth"})]})]}),N?e.jsxs(pe,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:N})]}):null,e.jsx(_e,{onClick:()=>void F(),disabled:!b||!x||k||S,children:n("names.buyCta")})]})]}),a==="completing"&&e.jsxs(gn,{children:[e.jsx(bn,{src:ct,alt:"",width:56,height:56}),e.jsx(yn,{children:z?n("names.confirming"):n("names.completing")}),e.jsxs(wn,{children:[e.jsx(jn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(vn,{children:"1/1"})]})]}),a==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:n("names.pendingHeaderTitle")}),e.jsx(ne,{onClick:l,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(se,{children:[n("names.myCreditsBalance")," ",e.jsx(A,{})," ",Y(h,d)]}),e.jsx(re,{}),e.jsxs(pe,{"data-tone":"info",children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(ie,{style:{marginTop:20},children:[e.jsx(oe,{"aria-hidden":!0,children:"@"}),e.jsxs(ae,{children:[e.jsxs(le,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(A,{}),C]})]}),e.jsx(Re,{children:e.jsx(ze,{onClick:()=>{l(),c("/my-items")},children:n("names.myItems")})})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:n("names.successHeaderTitle")}),e.jsx(ne,{onClick:l,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(se,{children:[n("names.myCreditsBalance")," ",e.jsx(A,{})," ",Y(h,d)]}),e.jsx(re,{}),e.jsxs($n,{children:[e.jsx(Cn,{"aria-hidden":!0,children:e.jsx(T,{name:"check"})}),e.jsxs(kn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(ie,{style:{marginTop:20},children:[e.jsx(oe,{"aria-hidden":!0,children:"@"}),e.jsxs(ae,{children:[e.jsxs(le,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(A,{}),C]})]}),e.jsxs(Re,{children:[e.jsx(ze,{onClick:()=>{l(),c("/my-items")},children:n("names.myItems")}),e.jsx(Sn,{href:W.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Tn(r){return r.replace(/[&<>"']/g,o=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[o])}const _n="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/identity-B4DXDuJP.webp",Rn="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/world-B-9aPlxu.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/invite-BfwIhP2C.webp",In="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/governance-DnazlIjy.webp",An=s.div`
382
+ `;function En({name:r,priceCredits:o,onClose:l}){const{session:x}=Me(),{data:h,isError:d}=ot(x),p=at(),c=Ae(),[a,m]=w.useState("confirm"),[g,u]=w.useState(""),[v,j]=w.useState(null),f=w.useRef(!1),b=g.trim().toLowerCase()===r.toLowerCase(),$=a==="completing",C=o!=null?me(o):"—",k=o==null,E=h==null?void 0:h.credits,M=o!=null&&E!=null?o-E:0,S=M>0,N=k?n("names.priceUnavailable"):S?n("names.insufficientCredits",{credits:me(M)}):null;w.useEffect(()=>{const y=R=>{R.key==="Escape"&&!$&&l()};document.addEventListener("keydown",y);const _=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",y),document.body.style.overflow=_}},[$,l]);async function F(){if(!(!x||!b||k||S||f.current)){f.current=!0,m("completing"),j(null);try{const y=await an({name:r,identity:x.identity,signer:x.signer});Q("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:o??null,settlement:y.status}),p.invalidateQueries({queryKey:["usd-balance"]}),p.invalidateQueries({queryKey:["my-assets"]}),m(y.status==="registered"?"success":"pending")}catch(y){Q(pt(y)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:dt(y),purchase_type:"name"}),j(y instanceof ue?n("names.errorRouteCost"):(y==null?void 0:y.message)||n("names.errorGeneric")),m("error")}finally{f.current=!1}}}const L=a!=="success"&&a!=="pending",z=lt(x==null?void 0:x.providerType);return e.jsx(ln,{onClick:$?void 0:l,role:"presentation",children:e.jsxs(cn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:y=>y.stopPropagation(),children:[L&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:a==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ne,{onClick:l,disabled:$,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(se,{children:[n("names.myCreditsBalance")," ",e.jsx(A,{})," ",Y(h,d)]}),e.jsx(re,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ie,{children:[e.jsx(oe,{"aria-hidden":!0,children:"@"}),e.jsxs(ae,{children:[e.jsxs(le,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(A,{}),C]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(pe,{children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:v})]}),e.jsx(_e,{onClick:()=>m("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(dn,{children:[e.jsx(pn,{children:n("names.confirmTitle")}),e.jsx(hn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${Tn(r)}</b>`})}}),e.jsxs(xn,{children:[e.jsx(mn,{"aria-hidden":!0,children:"@"}),e.jsx(fn,{value:g,onChange:y=>u(y.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(g.length,8)}ch`}}),e.jsx(un,{children:".dcl.eth"})]})]}),N?e.jsxs(pe,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:N})]}):null,e.jsx(_e,{onClick:()=>void F(),disabled:!b||!x||k||S,children:n("names.buyCta")})]})]}),a==="completing"&&e.jsxs(gn,{children:[e.jsx(bn,{src:ct,alt:"",width:56,height:56}),e.jsx(yn,{children:z?n("names.confirming"):n("names.completing")}),e.jsxs(wn,{children:[e.jsx(jn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(vn,{children:"1/1"})]})]}),a==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:n("names.pendingHeaderTitle")}),e.jsx(ne,{onClick:l,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(se,{children:[n("names.myCreditsBalance")," ",e.jsx(A,{})," ",Y(h,d)]}),e.jsx(re,{}),e.jsxs(pe,{"data-tone":"info",children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(ie,{style:{marginTop:20},children:[e.jsx(oe,{"aria-hidden":!0,children:"@"}),e.jsxs(ae,{children:[e.jsxs(le,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(A,{}),C]})]}),e.jsx(Re,{children:e.jsx(ze,{onClick:()=>{l(),c("/my-items")},children:n("names.myItems")})})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(ee,{children:[e.jsx(te,{children:n("names.successHeaderTitle")}),e.jsx(ne,{onClick:l,"aria-label":n("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(se,{children:[n("names.myCreditsBalance")," ",e.jsx(A,{})," ",Y(h,d)]}),e.jsx(re,{}),e.jsxs($n,{children:[e.jsx(Cn,{"aria-hidden":!0,children:e.jsx(T,{name:"check"})}),e.jsxs(kn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(ie,{style:{marginTop:20},children:[e.jsx(oe,{"aria-hidden":!0,children:"@"}),e.jsxs(ae,{children:[e.jsxs(le,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(ce,{children:n("names.subtitle")})]}),e.jsxs(de,{children:[e.jsx(A,{}),C]})]}),e.jsxs(Re,{children:[e.jsx(ze,{onClick:()=>{l(),c("/my-items")},children:n("names.myItems")}),e.jsx(Sn,{href:W.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function Tn(r){return r.replace(/[&<>"']/g,o=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[o])}const _n="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/identity-B4DXDuJP.webp",Rn="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/world-B-9aPlxu.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/invite-BfwIhP2C.webp",In="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/governance-DnazlIjy.webp",An=s.div`
383
383
  width: 100%;
384
384
  min-width: 0;
385
385
  `,Mn=s.nav`
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-BYHuwl8r.js";import{C as O,R as N,a as ce,b as de}from"./categories-Djn1x7W5.js";import{n as c,T as pe}from"./Tooltip-BUoy_yBS.js";import{t as e,s as o,I as g,b as s,am as P,C as v}from"./index-9yrtZWWe.js";const xe=o.div`
1
+ import{r as $,j as t}from"./react-BYHuwl8r.js";import{C as O,R as N,a as ce,b as de}from"./categories-KFHNUm7E.js";import{n as c,T as pe}from"./Tooltip-B2qDq-8v.js";import{t as e,s as o,I as g,b as s,am as P,C as v}from"./index-buu21jrH.js";const xe=o.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -1,4 +1,4 @@
1
- import{j as i,L as _,r as F}from"./react-BYHuwl8r.js";import{s as n,B as G,t as a,w as D,x as P,b as e,o as W,y as O,I as z,z as B,v as w,A as K,c as H,D as Q,E as A,F as X,G as Z,H as E}from"./index-9yrtZWWe.js";import{c as J,d as U,b as V,e as Y,s as tt,a as it}from"./authorizations-C46pWUg_.js";import{f as et}from"./builder-BxyqTcR8.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-DB8YoX8H.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BHIBWrRl.js";const nt=D`
1
+ import{j as i,L as _,r as F}from"./react-BYHuwl8r.js";import{s as n,B as G,t as a,w as D,x as P,b as e,o as W,y as O,I as z,z as B,v as w,A as K,c as H,D as Q,E as A,F as X,G as Z,H as E}from"./index-buu21jrH.js";import{c as J,d as U,b as V,e as Y,s as tt,a as it}from"./authorizations-dpp0OnHI.js";import{f as et}from"./builder-Ce37-lC-.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-CzBZCztT.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-CzqCMKMd.js";const nt=D`
2
2
  to { transform: rotate(360deg); }
3
3
  `,st=D`
4
4
  to { background-position: -200% 0; }
@@ -1,4 +1,4 @@
1
- import{j as e,L as $e,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t as le,s as i,b as a,L as de,bb as ta,J as aa,I as H,z as $t,K as Ke,x as sa,Y as Q,an as ot,o as na,q as ia,v as ra,bc as oa,A as ca,bd as da,ao as la,be as ua,bf as ct,bg as ha,bh as pa,y as ga,bi as dt,$ as G,bj as lt,bk as xa,F as ae,r as ma,c as ut,bl as fa,C as ya,bm as ht,bn as Be,bo as ba,bp as fe,bq as ye,br as pt,g as be,f as va,h as Re,bs as wa}from"./index-9yrtZWWe.js";import{M as Ca,S as ja,C as ka,H as $a,a as Sa,T as Ma,X as Ta,b as Ia,B as Pa,c as za,d as gt,e as Aa,f as je,P as St,m as Ea,g as qa,h as Ba,i as Ra,j as Mt,k as ke,L as _a,l as Wa,n as xt,o as mt,W as Fa,p as La,q as Ka,A as Ua,r as Na,s as Qa,t as Ha,u as Oa,v as Va,w as Ga,x as Ya,y as Da,z as Ja,D as Xa,E as Za,F as es,G as ts,I as as,J as ss,K as _e,N as ns,O as is,Q as rs,R as os,U as ft,V as yt,Y as cs,Z as ds,_ as ls}from"./CollectionCarousel-BKyJ1qJ0.js";import{k as us,l as hs,a as ps,n as gs,f as xs,A as ms}from"./authorizations-C46pWUg_.js";import{g as fs,j as We}from"./buy-CrEjBbQr.js";import{b as ys,w as bs,S as bt,G as vs}from"./buy-gasless-DX2i6M46.js";import{u as ws,M as Cs,R as ve,r as js,c as ks,p as vt}from"./useCreditPacks-B2mrQzTg.js";import{i as $s,a as Ss}from"./errors-DB8YoX8H.js";import{E as Ms}from"./ErrorNotice-DuHUqzrI.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-BHIBWrRl.js";const{colors:se,radius:Ts}=le,Is=i.div`
1
+ import{j as e,L as $e,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t as le,s as i,b as a,L as de,bb as ta,J as aa,I as H,z as $t,K as Ke,x as sa,Y as Q,an as ot,o as na,q as ia,v as ra,bc as oa,A as ca,bd as da,ao as la,be as ua,bf as ct,bg as ha,bh as pa,y as ga,bi as dt,$ as G,bj as lt,bk as xa,F as ae,r as ma,c as ut,bl as fa,C as ya,bm as ht,bn as Be,bo as ba,bp as fe,bq as ye,br as pt,g as be,f as va,h as Re,bs as wa}from"./index-buu21jrH.js";import{M as Ca,S as ja,C as ka,H as $a,a as Sa,T as Ma,X as Ta,b as Ia,B as Pa,c as za,d as gt,e as Aa,f as je,P as St,m as Ea,g as qa,h as Ba,i as Ra,j as Mt,k as ke,L as _a,l as Wa,n as xt,o as mt,W as Fa,p as La,q as Ka,A as Ua,r as Na,s as Qa,t as Ha,u as Oa,v as Va,w as Ga,x as Ya,y as Da,z as Ja,D as Xa,E as Za,F as es,G as ts,I as as,J as ss,K as _e,N as ns,O as is,Q as rs,R as os,U as ft,V as yt,Y as cs,Z as ds,_ as ls}from"./CollectionCarousel-Cg2MTF9W.js";import{k as us,l as hs,a as ps,n as gs,f as xs,A as ms}from"./authorizations-dpp0OnHI.js";import{g as fs,j as We}from"./buy-Dgj0sRqb.js";import{b as ys,w as bs,S as bt,G as vs}from"./buy-gasless-CYY_v3bj.js";import{u as ws,M as Cs,R as ve,r as js,c as ks,p as vt}from"./useCreditPacks-DQE6Gg5O.js";import{i as $s,a as Ss}from"./errors-CzBZCztT.js";import{E as Ms}from"./ErrorNotice-CXsnDhEh.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-CzqCMKMd.js";const{colors:se,radius:Ts}=le,Is=i.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -58,7 +58,7 @@ import{j as e,L as $e,r as P,b as Zt,a as ea}from"./react-BYHuwl8r.js";import{t
58
58
  font-weight: 700;
59
59
  color: ${se.text};
60
60
  }
61
- `,qs="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/buy-error-22UunaPC.png";function Bs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",Y=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),D=l==="processing";return e.jsxs(Ca,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ja,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(ka,{"data-tall":D||void 0,children:[e.jsxs($a,{children:[e.jsxs(Sa,{children:[e.jsx(Ma,{children:Y}),!W&&e.jsx(Ta,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Ia,{})})]}),e.jsxs(Pa,{children:[e.jsx(za,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(gt,{}),e.jsx(Aa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(je,{children:[e.jsxs(Es,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(gt,{}),de(o.totalCredits??0)]})]}),e.jsx(St,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Ea(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Rs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(_s,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(je,{children:[e.jsxs(qa,{"data-testid":"buy-error",children:[e.jsx(Ba,{src:qs,alt:"",width:64,height:80}),e.jsxs(Ra,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Rs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const Y=o==="reserving",D=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(je,{"data-processing":!0,children:[e.jsx(_a,{src:ta,alt:"",width:61,height:61}),e.jsx(Wa,{children:ne}),Y?e.jsxs(Is,{children:[e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{"data-step":!0,style:{width:`${D}%`}})}),I>1?e.jsxs(Ps,{children:[l,"/",I]}):null]}):e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{})})]})}function _s({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:Y,onCancel:D}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(je,{children:[e.jsxs(Fa,{"data-testid":"nofunds-warning",children:[e.jsx(La,{}),e.jsxs(Ka,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(zs,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Ua,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Qa,{children:[e.jsxs("div",{children:[e.jsxs(Ha,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(As,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Oa,{address:n.item.creator}):null]}),e.jsxs(Va,{children:[e.jsx(Ga,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ya,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Da,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ja,{}),e.jsx(Xa,{children:de(n.credits)}),e.jsxs(Za,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(as,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ss,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:D,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"gradient",onClick:Y,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Tt,radius:Z}=le,It="@media (max-width: 1080px)",T="@media (max-width: 880px)",wt=i.div`
61
+ `,qs="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/buy-error-22UunaPC.png";function Bs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",Y=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),D=l==="processing";return e.jsxs(Ca,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ja,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(ka,{"data-tall":D||void 0,children:[e.jsxs($a,{children:[e.jsxs(Sa,{children:[e.jsx(Ma,{children:Y}),!W&&e.jsx(Ta,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Ia,{})})]}),e.jsxs(Pa,{children:[e.jsx(za,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(gt,{}),e.jsx(Aa,{children:de(I)})]})]}),l==="choose"&&e.jsxs(je,{children:[e.jsxs(Es,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(gt,{}),de(o.totalCredits??0)]})]}),e.jsx(St,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=Ea(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(Rs,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(_s,{lines:o.lines??[],shortfallCredits:o.shortfallCredits??0,packs:o.packs??[],selectedPack:o.selectedPack??"",onSelectPack:o.onSelectPack??(()=>{}),onBuyPacks:o.onBuyPacks??(()=>{}),onCancel:z}),l==="error"&&e.jsxs(je,{children:[e.jsxs(qa,{"data-testid":"buy-error",children:[e.jsx(Ba,{src:qs,alt:"",width:64,height:80}),e.jsxs(Ra,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function Rs({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const Y=o==="reserving",D=I>0?Math.min(100,Math.round(l/I*100)):0,A=z&&W&&W.total>1,ne=o==="awaiting-signature"?z?A?a("cartCheckout.confirmMultiple",{current:W.current,total:W.total}):a("buyModal.confirmToContinue"):a("buyModal.completingTransaction"):o==="settling"?a("buyModal.completingTransaction"):a("cartCheckout.preparing");return e.jsxs(je,{"data-processing":!0,children:[e.jsx(_a,{src:ta,alt:"",width:61,height:61}),e.jsx(Wa,{children:ne}),Y?e.jsxs(Is,{children:[e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{"data-step":!0,style:{width:`${D}%`}})}),I>1?e.jsxs(Ps,{children:[l,"/",I]}):null]}):e.jsx(xt,{"aria-hidden":!0,children:e.jsx(mt,{})})]})}function _s({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:Y,onCancel:D}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(je,{children:[e.jsxs(Fa,{"data-testid":"nofunds-warning",children:[e.jsx(La,{}),e.jsxs(Ka,{children:[e.jsx("b",{children:a("buyModal.insufficientFunds")})," ",a("buyModal.warningNeedToBuy")," ",e.jsx("b",{children:a("buyModal.warningCreditsAmount",{count:Math.max(0,l)})})," ",a("buyModal.warningToPurchase",{count:ne})]})]}),e.jsx(zs,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Ua,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Qa,{children:[e.jsxs("div",{children:[e.jsxs(Ha,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(As,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Oa,{address:n.item.creator}):null]}),e.jsxs(Va,{children:[e.jsx(Ga,{}),e.jsx("span",{children:de(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ya,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Da,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Ja,{}),e.jsx(Xa,{children:de(n.credits)}),e.jsxs(Za,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(as,{}),e.jsx("span",{children:de((A==null?void 0:A.credits)??0)})]}),e.jsxs(ss,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(Mt,{children:[e.jsx(ke,{"data-variant":"outline",onClick:D,children:a("buyModal.cancel")}),e.jsx(ke,{"data-variant":"gradient",onClick:Y,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Tt,radius:Z}=le,It="@media (max-width: 1080px)",T="@media (max-width: 880px)",wt=i.div`
62
62
  max-width: 1510px;
63
63
  margin: 0 auto;
64
64
  /* Grows into the page's leftover height and passes it down to Upsell, so the white cross-sell band ends at
@@ -1,4 +1,4 @@
1
- import{ai as N,aj as w,ak as o,al as n,K as D,w as M}from"./index-9yrtZWWe.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-DO__i5OQ.js";function F(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
1
+ import{ai as N,aj as w,ak as o,al as n,K as D,w as M}from"./index-buu21jrH.js";import{r as U,j as g}from"./react-BYHuwl8r.js";import{g as z,a as E,c as I,b as K}from"./clsx-WwvpwSg0.js";import{s as v}from"./styled-FDInU8Rs.js";function F(r){return z("MuiCircularProgress",r)}E("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const W=["className","color","disableShrink","size","style","thickness","value","variant"];let l=r=>r,P,b,S,$;const t=44,B=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,r as h,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bt as ee,a2 as te,D as R,bu as ae,bv as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,aq as z,ar as de,bw as pe,bx as xe}from"./index-9yrtZWWe.js";import{E as me}from"./ErrorNotice-DuHUqzrI.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-D2QDYBrf.js";import{u as je,S as L,a as ye,F as Ce,c as we,P as $e,d as ke,H as Ne,e as Se}from"./categories-Djn1x7W5.js";import{L as Pe}from"./LoadMore-DSfpb61Y.js";import{u as Ae}from"./useInfiniteGrid-ByXPg4Cl.js";import{G as Me}from"./grid.styles-B8-aHr-Z.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./skeleton.styles-BkB0ehmF.js";const Te=s.section`
1
+ import{j as e,r as h,d as J,b as X}from"./react-BYHuwl8r.js";import{t as b,s,bt as ee,a2 as te,D as R,bu as ae,bv as oe,I as ie,b as a,c as re,F as se,v as ne,x as ce,C as le,aq as z,ar as de,bw as pe,bx as xe}from"./index-buu21jrH.js";import{E as me}from"./ErrorNotice-CXsnDhEh.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-jwKyDncq.js";import{u as je,S as L,a as ye,F as Ce,c as we,P as $e,d as ke,H as Ne,e as Se}from"./categories-KFHNUm7E.js";import{L as Pe}from"./LoadMore-CKNE48ED.js";import{u as Ae}from"./useInfiniteGrid--LOCzyU9.js";import{G as Me}from"./grid.styles-U_Gpy1wT.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./skeleton.styles-BfEPveSL.js";const Te=s.section`
2
2
  position: relative;
3
3
  border-radius: ${b.radius.card};
4
4
  overflow: hidden;
@@ -1,4 +1,4 @@
1
- import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as k,L as j,bW as C,C as G,w as Y,I as Q,F as X,g as W,h as B,f as Z,at as q,aa as J,b_ as F,ar as ee}from"./index-9yrtZWWe.js";import{s as te,f as U,A as _,g as K,r as ne,m as ae,i as ie,j as oe}from"./authorizations-C46pWUg_.js";import{i as se}from"./errors-DB8YoX8H.js";import{E as re}from"./ErrorNotice-DuHUqzrI.js";import{l as ce,m as de,n as le}from"./buy-CrEjBbQr.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-BHIBWrRl.js";import{I as xe,C as ge}from"./ethers-BDpbhgX6.js";const L="shop:resume_after_signin",fe=900*1e3;function ct(a){try{sessionStorage.setItem(L,JSON.stringify({...a,at:Date.now()}))}catch{}}function dt(a){let n;try{n=sessionStorage.getItem(L)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(L)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function lt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function pt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ht(a,n){return a.options.find(i=>i.method===n)??null}function ut(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",we=e.div`
1
+ import{j as t,r as v}from"./react-BYHuwl8r.js";import{s as e,t as o,b as f,z as k,L as j,bW as C,C as G,w as Y,I as Q,F as X,g as W,h as B,f as Z,at as q,aa as J,b_ as F,ar as ee}from"./index-buu21jrH.js";import{s as te,f as U,A as _,g as K,r as ne,m as ae,i as ie,j as oe}from"./authorizations-dpp0OnHI.js";import{i as se}from"./errors-CzBZCztT.js";import{E as re}from"./ErrorNotice-CXsnDhEh.js";import{l as ce,m as de,n as le}from"./buy-Dgj0sRqb.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-CzqCMKMd.js";import{I as xe,C as ge}from"./ethers-BDpbhgX6.js";const L="shop:resume_after_signin",fe=900*1e3;function ct(a){try{sessionStorage.setItem(L,JSON.stringify({...a,at:Date.now()}))}catch{}}function dt(a){let n;try{n=sessionStorage.getItem(L)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(L)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>fe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function me(a,n){return(a+n-1n)/n}function be(a,n,i){return a<=0||n<=0?0n:a>=n?i:me(i*BigInt(a),BigInt(n))}function lt(a){var b,y,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,l=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const d=n-i,m=be(d,n,s);l>=m&&c.push({method:"combined",creditsCents:i,manaWei:m})}s>0n&&l>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((b=c.find(d=>d.method==="credits"))==null?void 0:b.method)??((y=c.find(d=>d.method==="combined"))==null?void 0:y.method)??((w=c.find(d=>d.method==="mana"))==null?void 0:w.method)??null,u=!c.some(d=>d.method==="mana"||d.method==="combined")&&s>0n&&l>0n?{manaWei:l,manaCents:ye(l,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:u}}function ye(a,n,i){return Number(a*BigInt(n)/i)}function pt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const l=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(l,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ht(a,n){return a.options.find(i=>i.method===n)??null}function ut(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",we=e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index.es-C4oAOZ2V.js","_assets/react-BYHuwl8r.js"])))=>i.map(i=>d[i]);
2
- import{s as o,_ as a}from"./index-9yrtZWWe.js";import{r as n,j as e}from"./react-BYHuwl8r.js";const s=o.div`
2
+ import{s as o,_ as a}from"./index-buu21jrH.js";import{r as n,j as e}from"./react-BYHuwl8r.js";const s=o.div`
3
3
  position: fixed;
4
4
  inset: 0;
5
5
  /**
@@ -1,4 +1,4 @@
1
- import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";import{u as Ie}from"./useUrlFilters-DH-gxdfV.js";import{u as Re,S as Z,R as Te,F as _e,e as Be}from"./categories-Djn1x7W5.js";import{t as he,O as ze,Q as X,P as ee,s as i,bG as We,J as De,bH as Oe,b as o,bI as Ge,bJ as te,B as Ke,K as ue,a2 as me,bt as Ue,o as He,D as pe,bA as qe,bu as Ve,bv as Je,I as oe,c as Qe,x as Ye,v as Ze,am as Xe,ao as et,ap as tt,aq as M,ar as re,bK as se,bL as ot}from"./index-9yrtZWWe.js";import{T as xe}from"./skeleton.styles-BkB0ehmF.js";import{d as rt,P as st,C as it,a as at,b as nt,A as lt,c as ct,e as dt}from"./collectionPage.styles-D2QDYBrf.js";import{g as ht,h as ut,i as mt,j as pt,k as xt,C as gt,l as ft,o as bt,m as wt,n as vt,M as yt,E as jt,p as Ct,q as kt,r as $t,s as St,t as Nt}from"./Assets.styles-BR6LRzsi.js";import{L as ie}from"./LoadMore-DSfpb61Y.js";import{u as ae}from"./useInfiniteGrid-ByXPg4Cl.js";import{E as T}from"./ErrorNotice-DuHUqzrI.js";import{G as ne}from"./grid.styles-B8-aHr-Z.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./Tooltip-BUoy_yBS.js";function Et(r){const{gridLoading:s,gridError:a,gridCount:l,baselinePending:c,baselineError:d,baselineCount:b}=r;return s?"skeletons":a?"error":l>0?"items":c?"skeletons":d?"error":b===0?"no-creations":"filters"}const{colors:w,radius:ge,media:Pt}=he,Ft=i.article`
1
+ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";import{u as Ie}from"./useUrlFilters-DH-gxdfV.js";import{u as Re,S as Z,R as Be,F as Te,e as _e}from"./categories-KFHNUm7E.js";import{t as he,O as ze,Q as X,P as ee,s as i,bG as We,J as De,bH as Oe,b as o,bI as Ge,bJ as te,B as Ke,K as ue,a2 as me,bt as Ue,o as He,D as xe,bA as qe,bu as Ve,bv as Je,I as oe,c as Qe,x as Ye,v as Ze,am as Xe,ao as et,ap as tt,aq as M,ar as re,bK as se,bL as ot}from"./index-buu21jrH.js";import{T as pe}from"./skeleton.styles-BfEPveSL.js";import{d as rt,P as st,C as it,a as at,b as nt,A as lt,c as ct,e as dt}from"./collectionPage.styles-jwKyDncq.js";import{g as ht,h as ut,i as mt,j as xt,k as pt,C as gt,l as ft,o as bt,m as wt,n as vt,M as yt,E as jt,p as Ct,q as kt,r as $t,s as St,t as Nt}from"./Assets.styles-D1Vg-U1C.js";import{L as ie}from"./LoadMore-CKNE48ED.js";import{u as ae}from"./useInfiniteGrid--LOCzyU9.js";import{E as B}from"./ErrorNotice-CXsnDhEh.js";import{G as ne}from"./grid.styles-U_Gpy1wT.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";import"./Tooltip-B2qDq-8v.js";function Et(r){const{gridLoading:s,gridError:a,gridCount:l,baselinePending:c,baselineError:d,baselineCount:b}=r;return s?"skeletons":a?"error":l>0?"items":c?"skeletons":d?"error":b===0?"no-creations":"filters"}const{colors:w,radius:ge,media:Pt}=he,Ft=i.article`
2
2
  height: 300px;
3
3
  background: ${w.bg};
4
4
  border-radius: ${ge.card};
@@ -74,7 +74,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
74
74
  ${Pt.maxWidth("mobile")} {
75
75
  font-size: 16px;
76
76
  }
77
- `,Tt=i.div`
77
+ `,Bt=i.div`
78
78
  flex: 1;
79
79
  min-height: 0;
80
80
  display: grid;
@@ -84,12 +84,12 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
84
84
  & > * {
85
85
  grid-area: stack;
86
86
  }
87
- `,_t=i.div`
87
+ `,Tt=i.div`
88
88
  display: flex;
89
89
  align-items: center;
90
90
  justify-content: space-between;
91
91
  gap: 10px;
92
- `,Bt=i(De)`
92
+ `,_t=i(De)`
93
93
  min-width: 0;
94
94
  color: ${w.muted};
95
95
 
@@ -135,16 +135,15 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
135
135
  &:active {
136
136
  background: ${w.accentActive};
137
137
  }
138
- `;function Ot({collection:r,cover:s,itemCount:a}){const l=de(),{contractAddress:c,name:d,creator:b}=r,y=s==null||a==null,{data:n}=Oe(c,y),g=s==null?(n==null?void 0:n.items)??[]:[],f=a??(n==null?void 0:n.total);function h(){l(`/collection/${c}`)}return e.jsxs(Ft,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:h,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),h())},children:[e.jsx(Lt,{children:s?e.jsx(Mt,{"data-testid":"coll-card-img",src:s,alt:"",loading:"lazy"}):g.length>0?e.jsx(At,{items:g,tinted:!1}):null}),e.jsxs(It,{children:[e.jsx(Rt,{title:d,children:d}),e.jsxs(Tt,{children:[e.jsxs(_t,{"data-meta":!0,"data-testid":"coll-card-meta",children:[b?e.jsx(Bt,{address:b,linkToProfile:!0}):e.jsx(zt,{children:" "}),e.jsx(Wt,{"data-testid":"coll-card-count","aria-busy":f==null||void 0,children:f==null?e.jsx(xe,{className:"skeleton",width:54,"data-testid":"coll-card-count-skeleton","aria-hidden":!0}):o("collectionCard.itemCount",{count:f})})]}),e.jsx(Dt,{"data-view":!0,"data-testid":"coll-card-view",onClick:m=>{m.stopPropagation(),h()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Gt({address:r,className:s=""}){const a=Ge(),l=te(d=>d.followed.includes(r.toLowerCase())),c=te(d=>d.toggle);return!a||!r?null:e.jsx(Ke,{type:"button",size:"sm",variant:l?"ghost":"outline",className:s||void 0,"data-testid":"follow-button","aria-pressed":l,title:l?o("creator.unfollowTitle"):o("creator.followTitle"),onClick:()=>c(r),children:l?o("creator.following"):o("creator.follow")})}const{colors:C,radius:fe,media:v}=he,be=ue`
138
+ `;function Ot({collection:r,cover:s,itemCount:a}){const l=de(),{contractAddress:c,name:d,creator:b}=r,j=s==null||a==null,{data:n}=Oe(c,j),g=s==null?(n==null?void 0:n.items)??[]:[],f=a??(n==null?void 0:n.total);function h(){l(`/collection/${c}`)}return e.jsxs(Ft,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:h,onKeyDown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),h())},children:[e.jsx(Lt,{children:s?e.jsx(Mt,{"data-testid":"coll-card-img",src:s,alt:"",loading:"lazy"}):g.length>0?e.jsx(At,{items:g,tinted:!1}):null}),e.jsxs(It,{children:[e.jsx(Rt,{title:d,children:d}),e.jsxs(Bt,{children:[e.jsxs(Tt,{"data-meta":!0,"data-testid":"coll-card-meta",children:[b?e.jsx(_t,{address:b,linkToProfile:!0}):e.jsx(zt,{children:" "}),e.jsx(Wt,{"data-testid":"coll-card-count","aria-busy":f==null||void 0,children:f==null?e.jsx(pe,{className:"skeleton",width:54,"data-testid":"coll-card-count-skeleton","aria-hidden":!0}):o("collectionCard.itemCount",{count:f})})]}),e.jsx(Dt,{"data-view":!0,"data-testid":"coll-card-view",onClick:m=>{m.stopPropagation(),h()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Gt({address:r,className:s=""}){const a=Ge(),l=te(d=>d.followed.includes(r.toLowerCase())),c=te(d=>d.toggle);return!a||!r?null:e.jsx(Ke,{type:"button",size:"sm",variant:l?"ghost":"outline",className:s||void 0,"data-testid":"follow-button","aria-pressed":l,title:l?o("creator.unfollowTitle"):o("creator.followTitle"),onClick:()=>c(r),children:l?o("creator.following"):o("creator.follow")})}const{colors:v,radius:fe,media:y}=he,be=ue`
139
139
  display: inline-flex;
140
140
  align-items: center;
141
141
  justify-content: center;
142
- height: 44px;
142
+ height: 40px;
143
143
  padding: 0 28px;
144
- border: 2px solid ${C.white};
145
144
  border-radius: ${fe.btn};
146
- background: transparent;
147
- color: ${C.white};
145
+ background: rgba(0, 0, 0, 0.5);
146
+ color: ${v.white};
148
147
  font-weight: 600;
149
148
  font-size: 13px;
150
149
  text-transform: uppercase;
@@ -164,10 +163,10 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
164
163
  ${be};
165
164
  }
166
165
  && .creator-hero__follow:hover:not(:disabled) {
167
- background: rgba(255, 255, 255, 0.14);
166
+ background: ${v.blackBtn};
168
167
  }
169
168
 
170
- ${v.maxWidth("mobile")} {
169
+ ${y.maxWidth("mobile")} {
171
170
  min-height: 260px;
172
171
  }
173
172
  `,Ut=i.div`
@@ -182,7 +181,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
182
181
  `,qt=i.div`
183
182
  position: absolute;
184
183
  inset: 0;
185
- background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
184
+ background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
186
185
  `,Vt=i.div`
187
186
  position: absolute;
188
187
  top: 16px;
@@ -192,7 +191,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
192
191
  align-items: center;
193
192
  gap: 8px;
194
193
 
195
- ${v.maxWidth("mobile")} {
194
+ ${y.maxWidth("mobile")} {
196
195
  top: 12px;
197
196
  right: 12px;
198
197
  gap: 6px;
@@ -201,7 +200,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
201
200
  display: flex;
202
201
  align-items: center;
203
202
  justify-content: center;
204
- color: ${C.white};
203
+ color: ${v.white};
205
204
  transition: opacity 0.15s linear;
206
205
 
207
206
  &:hover {
@@ -211,7 +210,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
211
210
  width: 36px;
212
211
  height: 36px;
213
212
  }
214
- ${v.maxWidth("mobile")} {
213
+ ${y.maxWidth("mobile")} {
215
214
  & .ico {
216
215
  width: 30px;
217
216
  height: 30px;
@@ -224,7 +223,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
224
223
  width: 32px;
225
224
  height: 32px;
226
225
  border-radius: 50%;
227
- border: 2px solid ${C.white};
226
+ border: 2px solid ${v.white};
228
227
  transition: background-color 0.15s linear;
229
228
 
230
229
  &:hover {
@@ -235,7 +234,7 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
235
234
  width: 16px;
236
235
  height: 16px;
237
236
  }
238
- ${v.maxWidth("mobile")} {
237
+ ${y.maxWidth("mobile")} {
239
238
  width: 28px;
240
239
  height: 28px;
241
240
  & .ico {
@@ -251,9 +250,9 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
251
250
  align-items: center;
252
251
  text-align: center;
253
252
  gap: 24px;
254
- padding: 32px 20px;
253
+ padding: 40px 20px;
255
254
 
256
- ${v.maxWidth("mobile")} {
255
+ ${y.maxWidth("mobile")} {
257
256
  padding: 56px 16px 24px;
258
257
  }
259
258
  `,le=i.img`
@@ -262,11 +261,11 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
262
261
  height: 112px;
263
262
  border-radius: 50%;
264
263
  object-fit: cover;
265
- border: 4px solid ${C.white};
264
+ border: 4px solid ${v.white};
266
265
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
267
266
  background: #ff4bed;
268
267
 
269
- ${v.maxWidth("mobile")} {
268
+ ${y.maxWidth("mobile")} {
270
269
  width: 88px;
271
270
  height: 88px;
272
271
  }
@@ -274,20 +273,20 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
274
273
  margin: 0;
275
274
  font-size: 18px;
276
275
  font-weight: 700;
277
- color: ${C.white};
276
+ color: ${v.white};
278
277
  line-height: 1.6;
279
278
 
280
- ${v.maxWidth("mobile")} {
279
+ ${y.maxWidth("mobile")} {
281
280
  font-size: 16px;
282
281
  }
283
282
  `,Xt=i.p`
284
283
  margin: 0;
285
284
  font-size: 15px;
286
- color: ${C.white};
285
+ color: ${v.white};
287
286
  line-height: 1.6;
288
287
  max-width: 520px;
289
288
 
290
- ${v.maxWidth("mobile")} {
289
+ ${y.maxWidth("mobile")} {
291
290
  font-size: 14px;
292
291
  }
293
292
  `,eo=i.div`
@@ -301,6 +300,6 @@ import{b as de,j as e,L as Le,d as Me,u as Ae,r as L}from"./react-BYHuwl8r.js";i
301
300
  transition: background 0.15s ease;
302
301
 
303
302
  &:hover {
304
- background: rgba(255, 255, 255, 0.14);
303
+ background: ${v.blackBtn};
305
304
  }
306
- `,oo={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function ro({address:r}){var m,j;const{data:s}=me(r),{data:a}=Ue(r),l=He(p=>{var $;return($=p.session)==null?void 0:$.address}),c=!!l&&l.toLowerCase()===r.toLowerCase(),d=(s==null?void 0:s.name)||pe(r),b=(j=(m=s==null?void 0:s.avatar)==null?void 0:m.snapshots)==null?void 0:j.face256,y=(a==null?void 0:a.cover)||rt,n=a==null?void 0:a.description,g=`${Qe.profileUrl}/${r}`,f=qe.filter(p=>a==null?void 0:a.links[p]),h=Ve(Je({name:s==null?void 0:s.name,hasClaimedName:s==null?void 0:s.hasClaimedName,ethAddress:(s==null?void 0:s.ethAddress)??r}));return e.jsxs(Kt,{"aria-label":`${d} storefront`,children:[e.jsxs(Ut,{children:[e.jsx(Ht,{src:y,alt:"",loading:"eager"}),e.jsx(qt,{"aria-hidden":!0})]}),(f.length>0||c)&&e.jsxs(Vt,{children:[f.map(p=>e.jsx(Jt,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[p])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${p}`),"aria-label":o(`creator.link.${p}`),children:e.jsx(oe,{name:oo[p]})},p)),c&&e.jsx(Qt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(oe,{name:"pen"})})]}),e.jsxs(Yt,{children:[b?e.jsx(le,{src:b,alt:"",loading:"eager",style:{backgroundColor:h}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:h}}),e.jsxs("div",{children:[e.jsx(Zt,{children:d}),n?e.jsx(Xt,{children:n}):null]}),e.jsxs(eo,{children:[e.jsx(to,{"data-testid":"creator-hero-view",href:g,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Gt,{address:r,className:"creator-hero__follow"})]})]})]})}const so=["all","on_sale","not_for_sale"],ce=48;function jo(){var Q,Y;const{address:r}=Me(),s=de(),[a]=Ae(),l=a.has("collections"),{data:c}=me(r),d=(c==null?void 0:c.name)||(r?pe(r):o("creator.fallbackName"));Ye({title:d,description:o("seo.creator.description",{name:d}),image:(Y=(Q=c==null?void 0:c.avatar)==null?void 0:Q.snapshots)==null?void 0:Y.face256});const b=L.useMemo(()=>({category:"all",status:"all",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[y,n]=Ie(b),{category:g,subCategory:f,rarities:h,priceMin:m,priceMax:j,smart:p,sort:$}=y,S=so.includes(y.status)?y.status:"all",_=t=>n({status:t});Re(`${l}:${g}:${f??""}`);const[E,N]=L.useState(!1);L.useEffect(()=>{if(!E)return;const t=Fe=>{Fe.key==="Escape"&&N(!1)};document.addEventListener("keydown",t);const x=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=x}},[E]);const B=m&&!Number.isNaN(Number(m))?Number(m):void 0,z=j&&!Number.isNaN(Number(j))?Number(j):void 0,ve=f?Be[f]:void 0,ye=(Z.find(t=>t.key===$)??Z[0]).server,W={creator:r,category:g,rarities:h.length?h:void 0,wearableCategories:ve,minPriceCredits:B,maxPriceCredits:z,isWearableSmart:p||void 0,isOnSale:S==="all"?void 0:S==="on_sale",sortBy:ye},{items:A,total:je,isLoading:Ce,isPlaceholderData:ke,error:D,hasNextPage:$e,isFetchingNextPage:O,isFetchNextPageError:Se,fetchNextPage:Ne}=ae(["creator-items",W],t=>se({...W,first:ce,skip:t}),{enabled:!!r&&!l}),P=Ze({queryKey:["creator-item-count",r],queryFn:()=>se({creator:r,first:1}).then(t=>t.total),enabled:!!r}),u=ae(["creator-collections",r],t=>ot(r,{first:ce,skip:t}).then(x=>({items:x.collections,total:x.total})),{enabled:!!r&&l});function G(t){n({category:t,subCategory:null},{drop:l?["collections"]:void 0})}function Ee(){const t=new URLSearchParams(a);t.delete("collections");const x=t.toString();s({search:x?`?${x}`:""},{replace:!0})}function Pe(){if(l){Ee();return}const t=new URLSearchParams(a);t.delete("collections");const x=t.toString();s({search:x?`?${x}&collections`:"?collections"},{replace:!0})}function K(t){n({rarities:h.includes(t)?h.filter(x=>x!==t):[...h,t]})}function U(){n(b)}const k=[];(g==="wearable"||g==="emote")&&k.push({key:"category",label:o(g==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>G("all")}),(B!=null||z!=null)&&k.push({key:"price",label:o("filter.price"),onRemove:()=>{n({priceMin:"",priceMax:""})}});for(const t of Te)h.includes(t)&&k.push({key:`rarity-${t}`,label:Xe(t),onRemove:()=>K(t)});p&&k.push({key:"smart",label:o("filter.smart"),onRemove:()=>n({smart:!1})}),S!=="all"&&k.push({key:"status",label:S==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>_("all")});const F=Et({gridLoading:Ce||ke,gridError:!!D,gridCount:A.length,baselinePending:P.isPending,baselineError:P.isError,baselineCount:P.data}),I=F==="skeletons",{data:H}=et(),q=L.useMemo(()=>A.map(t=>({...t,priceCredits:tt(t,H)})),[A,H]),V=t=>t.priceCredits>0||!!t.manaWei,J=q.filter(V),R=F==="items"||F==="skeletons"?null:F;return e.jsxs(st,{children:[e.jsxs(it,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(at,{onClick:()=>s("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(nt,{children:d})]}),r?e.jsx(ro,{address:r}):null,!l&&!I&&J.length>0?e.jsx(lt,{items:J,source:"creator"}):null,e.jsxs(ht,{children:[E?e.jsx(ut,{onClick:()=>N(!1),"aria-hidden":!0}):null,e.jsxs(mt,{"data-open":E||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(pt,{children:[e.jsx(xt,{children:o("assets.filters")}),e.jsx(gt,{onClick:()=>N(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(ft,{children:e.jsx(bt,{category:g,subCategory:f,onCategory:G,onSub:t=>n({subCategory:t}),priceMin:m,priceMax:j,onPriceMin:t=>n({priceMin:t}),onPriceMax:t=>n({priceMax:t}),rarities:h,onToggleRarity:K,status:S,onStatus:_,smart:p,onSmart:t=>n({smart:t}),hideNames:!0,collections:l,onCollections:Pe})}),e.jsx(wt,{children:e.jsx(vt,{type:"button",onClick:()=>N(!1),children:o("assets.showItems")})})]}),e.jsx(yt,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(ct,{children:e.jsx(dt,{"data-testid":"creator-collections-count","aria-busy":u.isLoading||void 0,children:u.isLoading?e.jsx(xe,{className:"skeleton",width:72,"data-testid":"creator-collections-count-skeleton","aria-hidden":!0}):o("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(T,{message:o("creator.error")}):null,e.jsx(ne,{"data-variant":"collections",children:u.isLoading?e.jsx(M,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(t=>e.jsx(Ot,{collection:t,itemCount:t.itemCount},t.contractAddress)),u.isFetchingNextPage?e.jsx(M,{count:6}):null]})}),e.jsx(ie,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,isError:u.isFetchNextPageError,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(_e,{sort:$,onSort:t=>n({sort:t}),total:je,loading:I,onOpenFilters:()=>N(!0),chips:k,onClearChips:U}),D?e.jsx(T,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ne,{"data-testid":"creator-grid",children:I?e.jsx(M,{count:15}):e.jsxs(e.Fragment,{children:[q.map(t=>V(t)?e.jsx(re,{item:t},t.id):e.jsx(re,{item:t,mode:"view"},t.id)),O?e.jsx(M,{count:6}):null]})}),e.jsx(ie,{hasNextPage:$e,isFetching:O,isError:Se,onLoadMore:()=>void Ne()}),R==="error"?e.jsx(T,{message:o("creator.error"),testId:"creator-empty-error"}):R==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):R==="filters"?e.jsxs(jt,{"data-testid":"creator-empty-filters",children:[e.jsxs(Ct,{children:[e.jsx(kt,{children:o("creator.emptyFilters.title")}),e.jsx($t,{children:o("creator.emptyFilters.body",{count:P.data??0})})]}),e.jsx(St,{children:e.jsx(Nt,{type:"button",onClick:U,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{jo as Creator,jo as default};
305
+ `,oo={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function ro({address:r}){var m,C;const{data:s}=me(r),{data:a}=Ue(r),l=He(x=>{var $;return($=x.session)==null?void 0:$.address}),c=!!l&&l.toLowerCase()===r.toLowerCase(),d=(s==null?void 0:s.name)||xe(r),b=(C=(m=s==null?void 0:s.avatar)==null?void 0:m.snapshots)==null?void 0:C.face256,j=(a==null?void 0:a.cover)||rt,n=a==null?void 0:a.description,g=`${Qe.profileUrl}/${r}`,f=qe.filter(x=>a==null?void 0:a.links[x]),h=Ve(Je({name:s==null?void 0:s.name,hasClaimedName:s==null?void 0:s.hasClaimedName,ethAddress:(s==null?void 0:s.ethAddress)??r}));return e.jsxs(Kt,{"aria-label":`${d} storefront`,children:[e.jsxs(Ut,{children:[e.jsx(Ht,{src:j,alt:"",loading:"eager"}),e.jsx(qt,{"aria-hidden":!0})]}),(f.length>0||c)&&e.jsxs(Vt,{children:[f.map(x=>e.jsx(Jt,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[x])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${x}`),"aria-label":o(`creator.link.${x}`),children:e.jsx(oe,{name:oo[x]})},x)),c&&e.jsx(Qt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(oe,{name:"pen"})})]}),e.jsxs(Yt,{children:[b?e.jsx(le,{src:b,alt:"",loading:"eager",style:{backgroundColor:h}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:h}}),e.jsxs("div",{children:[e.jsx(Zt,{children:d}),n?e.jsx(Xt,{children:n}):null]}),e.jsxs(eo,{children:[e.jsx(to,{"data-testid":"creator-hero-view",href:g,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Gt,{address:r,className:"creator-hero__follow"})]})]})]})}const so=["all","on_sale","not_for_sale"],ce=48;function jo(){var Q,Y;const{address:r}=Me(),s=de(),[a]=Ae(),l=a.has("collections"),{data:c}=me(r),d=(c==null?void 0:c.name)||(r?xe(r):o("creator.fallbackName"));Ye({title:d,description:o("seo.creator.description",{name:d}),image:(Y=(Q=c==null?void 0:c.avatar)==null?void 0:Q.snapshots)==null?void 0:Y.face256});const b=L.useMemo(()=>({category:"all",status:"all",subCategory:null,rarities:[],priceMin:"",priceMax:"",smart:!1,sort:"newest"}),[]),[j,n]=Ie(b),{category:g,subCategory:f,rarities:h,priceMin:m,priceMax:C,smart:x,sort:$}=j,S=so.includes(j.status)?j.status:"all",T=t=>n({status:t});Re(`${l}:${g}:${f??""}`);const[E,N]=L.useState(!1);L.useEffect(()=>{if(!E)return;const t=Fe=>{Fe.key==="Escape"&&N(!1)};document.addEventListener("keydown",t);const p=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=p}},[E]);const _=m&&!Number.isNaN(Number(m))?Number(m):void 0,z=C&&!Number.isNaN(Number(C))?Number(C):void 0,ve=f?_e[f]:void 0,ye=(Z.find(t=>t.key===$)??Z[0]).server,W={creator:r,category:g,rarities:h.length?h:void 0,wearableCategories:ve,minPriceCredits:_,maxPriceCredits:z,isWearableSmart:x||void 0,isOnSale:S==="all"?void 0:S==="on_sale",sortBy:ye},{items:A,total:je,isLoading:Ce,isPlaceholderData:ke,error:D,hasNextPage:$e,isFetchingNextPage:O,isFetchNextPageError:Se,fetchNextPage:Ne}=ae(["creator-items",W],t=>se({...W,first:ce,skip:t}),{enabled:!!r&&!l}),P=Ze({queryKey:["creator-item-count",r],queryFn:()=>se({creator:r,first:1}).then(t=>t.total),enabled:!!r}),u=ae(["creator-collections",r],t=>ot(r,{first:ce,skip:t}).then(p=>({items:p.collections,total:p.total})),{enabled:!!r&&l});function G(t){n({category:t,subCategory:null},{drop:l?["collections"]:void 0})}function Ee(){const t=new URLSearchParams(a);t.delete("collections");const p=t.toString();s({search:p?`?${p}`:""},{replace:!0})}function Pe(){if(l){Ee();return}const t=new URLSearchParams(a);t.delete("collections");const p=t.toString();s({search:p?`?${p}&collections`:"?collections"},{replace:!0})}function K(t){n({rarities:h.includes(t)?h.filter(p=>p!==t):[...h,t]})}function U(){n(b)}const k=[];(g==="wearable"||g==="emote")&&k.push({key:"category",label:o(g==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>G("all")}),(_!=null||z!=null)&&k.push({key:"price",label:o("filter.price"),onRemove:()=>{n({priceMin:"",priceMax:""})}});for(const t of Be)h.includes(t)&&k.push({key:`rarity-${t}`,label:Xe(t),onRemove:()=>K(t)});x&&k.push({key:"smart",label:o("filter.smart"),onRemove:()=>n({smart:!1})}),S!=="all"&&k.push({key:"status",label:S==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>T("all")});const F=Et({gridLoading:Ce||ke,gridError:!!D,gridCount:A.length,baselinePending:P.isPending,baselineError:P.isError,baselineCount:P.data}),I=F==="skeletons",{data:H}=et(),q=L.useMemo(()=>A.map(t=>({...t,priceCredits:tt(t,H)})),[A,H]),V=t=>t.priceCredits>0||!!t.manaWei,J=q.filter(V),R=F==="items"||F==="skeletons"?null:F;return e.jsxs(st,{children:[e.jsxs(it,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(at,{onClick:()=>s("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(nt,{children:d})]}),r?e.jsx(ro,{address:r}):null,!l&&!I&&J.length>0?e.jsx(lt,{items:J,source:"creator"}):null,e.jsxs(ht,{children:[E?e.jsx(ut,{onClick:()=>N(!1),"aria-hidden":!0}):null,e.jsxs(mt,{"data-open":E||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(xt,{children:[e.jsx(pt,{children:o("assets.filters")}),e.jsx(gt,{onClick:()=>N(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(ft,{children:e.jsx(bt,{category:g,subCategory:f,onCategory:G,onSub:t=>n({subCategory:t}),priceMin:m,priceMax:C,onPriceMin:t=>n({priceMin:t}),onPriceMax:t=>n({priceMax:t}),rarities:h,onToggleRarity:K,status:S,onStatus:T,smart:x,onSmart:t=>n({smart:t}),hideNames:!0,collections:l,onCollections:Pe})}),e.jsx(wt,{children:e.jsx(vt,{type:"button",onClick:()=>N(!1),children:o("assets.showItems")})})]}),e.jsx(yt,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(ct,{children:e.jsx(dt,{"data-testid":"creator-collections-count","aria-busy":u.isLoading||void 0,children:u.isLoading?e.jsx(pe,{className:"skeleton",width:72,"data-testid":"creator-collections-count-skeleton","aria-hidden":!0}):o("creator.collectionsCount",{count:u.total})})}),u.error?e.jsx(B,{message:o("creator.error")}):null,e.jsx(ne,{"data-variant":"collections",children:u.isLoading?e.jsx(M,{count:9}):e.jsxs(e.Fragment,{children:[u.items.map(t=>e.jsx(Ot,{collection:t,itemCount:t.itemCount},t.contractAddress)),u.isFetchingNextPage?e.jsx(M,{count:6}):null]})}),e.jsx(ie,{hasNextPage:u.hasNextPage,isFetching:u.isFetchingNextPage,isError:u.isFetchNextPageError,onLoadMore:()=>void u.fetchNextPage()}),!u.isLoading&&!u.error&&u.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Te,{sort:$,onSort:t=>n({sort:t}),total:je,loading:I,onOpenFilters:()=>N(!0),chips:k,onClearChips:U}),D?e.jsx(B,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ne,{"data-testid":"creator-grid",children:I?e.jsx(M,{count:15}):e.jsxs(e.Fragment,{children:[q.map(t=>V(t)?e.jsx(re,{item:t},t.id):e.jsx(re,{item:t,mode:"view"},t.id)),O?e.jsx(M,{count:6}):null]})}),e.jsx(ie,{hasNextPage:$e,isFetching:O,isError:Se,onLoadMore:()=>void Ne()}),R==="error"?e.jsx(B,{message:o("creator.error"),testId:"creator-empty-error"}):R==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):R==="filters"?e.jsxs(jt,{"data-testid":"creator-empty-filters",children:[e.jsxs(Ct,{children:[e.jsx(kt,{children:o("creator.emptyFilters.title")}),e.jsx($t,{children:o("creator.emptyFilters.body",{count:P.data??0})})]}),e.jsx(St,{children:e.jsx(Nt,{type:"button",onClick:U,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{jo as Creator,jo as default};
@@ -1 +1 @@
1
- import{j as r}from"./react-BYHuwl8r.js";import{I as i}from"./index-9yrtZWWe.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
1
+ import{j as r}from"./react-BYHuwl8r.js";import{I as i}from"./index-buu21jrH.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
@@ -1 +1 @@
1
- import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-C5e_NZU2.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-BGDJC7BF.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
1
+ import{C as l,E as w,b as E,S as A,d as k,O as U,N as P,g as f,B as x,e as N,i as I,p as L}from"./W3MFrameProviderSingleton-BYmipTKt.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-y3U1nB0H.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
@@ -1,4 +1,4 @@
1
- import{r as h,j as o}from"./react-BYHuwl8r.js";import{t as e,s as a,b as r,I as f}from"./index-9yrtZWWe.js";const w=a.section`
1
+ import{r as h,j as o}from"./react-BYHuwl8r.js";import{t as e,s as a,b as r,I as f}from"./index-buu21jrH.js";const w=a.section`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 36px;
@@ -1,4 +1,4 @@
1
- import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t as e,w as F,x as ge,b as n,C as h,o as fe,A as me,$ as g,bh as be,F as G,br as N,bX as we,bb as H,z as re,I as ye,bY as Q}from"./index-9yrtZWWe.js";import{C as ke}from"./Confetti-BvaNvqo_.js";import{F as Ce}from"./Faq-C46L8GKX.js";import{R as D}from"./resume-buy-Bf0zIH7y.js";import{u as ve,a as $e,R as je,c as Se,i as Ae,b as Pe}from"./useCreditPacks-B2mrQzTg.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";const A="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/pack-chest-BX_j84xW.webp",Re="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/credit-coin-CmcTCd5i.webp",Te="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",_e="https://cdn.decentraland.org/@dcl/shop/0.10.1-31034473421.commit-bc8c007/_assets/packs-backdrop-BcXiUPeP.webp",Y="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Be=i.div`
1
+ import{b as ue,u as xe,r as l,j as t}from"./react-BYHuwl8r.js";import{s as i,t as e,w as F,x as ge,b as n,C as h,o as fe,A as me,$ as g,bh as be,F as G,br as N,bX as we,bb as H,z as re,I as ye,bY as Q}from"./index-buu21jrH.js";import{C as ke}from"./Confetti-Blr9NSjA.js";import{F as Ce}from"./Faq-C0nCohQD.js";import{R as D}from"./resume-buy-Bf0zIH7y.js";import{u as ve,a as $e,R as je,c as Se,i as Ae,b as Pe}from"./useCreditPacks-DQE6Gg5O.js";import"./dcl-schemas-CmtP3U6y.js";import"./sentry-Dx-KuLV3.js";import"./ethers-BDpbhgX6.js";import"./intl-CBcMB1D2.js";const A="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/pack-chest-BX_j84xW.webp",Re="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/credit-coin-CmcTCd5i.webp",Te="data:image/svg+xml,%3csvg%20width='60'%20height='60'%20viewBox='0%200%2060%2060'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='60'%20height='60'%20rx='30'%20fill='%2334CE77'/%3e%3cpath%20d='M21.6583%2046.1067L11.4656%2036.0591C10.1688%2034.829%2010.1905%2032.7207%2011.4769%2031.4622L13.6868%2029.3591C14.9732%2028.1006%2017.1615%2028.1058%2018.4582%2029.3359L23.8747%2034.6197L41.9704%2015.6527C43.2568%2014.3942%2045.4291%2014.2093%2046.7258%2015.4394L48.8765%2017.3628C50.1732%2018.5929%2050.3491%2020.6844%2049.0626%2021.9429L26.6112%2045.8766C25.1433%2047.342%2022.955%2047.3368%2021.6583%2046.1067Z'%20fill='%23FCFCFC'/%3e%3c/svg%3e",_e="https://cdn.decentraland.org/@dcl/shop/0.10.1-31040959942.commit-e9e6433/_assets/packs-backdrop-BcXiUPeP.webp",Y="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Be=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 24px;