@dcl/shop 0.6.1-30950057562.commit-5ce11cd → 0.6.1-30951438943.commit-29cea86

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 (172) hide show
  1. package/_assets/{Activity-Gzy4GicN.js → Activity-Bcut5fRy.js} +3 -3
  2. package/_assets/{AnimatedBackground-Biiq2Y4P.js → AnimatedBackground-C0Bpklcd.js} +2 -2
  3. package/_assets/{Assets-B3QTH2pR.js → Assets-CVN8kbVX.js} +13 -12
  4. package/_assets/{Assets.styles-BbXlLgvi.js → Assets.styles-DTCjJoYe.js} +1 -1
  5. package/_assets/{Authorizations-DEGUI_-D.js → Authorizations-Doo9Zgdg.js} +1 -1
  6. package/_assets/{Cart-CG6BPi0p.js → Cart-W7w0zqfv.js} +2 -2
  7. package/_assets/{CircularProgress-BHeCdSwv.js → CircularProgress-DuQoJ6hf.js} +1 -1
  8. package/_assets/{Collection-DeXbCENt.js → Collection-DiBZWSLl.js} +1 -1
  9. package/_assets/{CollectionCarousel-DGelHypZ.js → CollectionCarousel-DbpF1h5w.js} +1 -1
  10. package/_assets/{Creator-DbMBaOUq.js → Creator-gV7PR2lz.js} +1 -1
  11. package/_assets/{ErrorNotice-D5yaB3Z_.js → ErrorNotice-vGKBE1Hj.js} +1 -1
  12. package/_assets/{ExchangeController-DnTekpEE.js → ExchangeController-C7H6XSRu.js} +1 -1
  13. package/_assets/{GetCredits-Dhtzz_nn.js → GetCredits-BClB8S1_.js} +1 -1
  14. package/_assets/{HelpersUtil-DsfsYJYj.js → HelpersUtil-B2odRbT4.js} +1 -1
  15. package/_assets/ItemDetail-o9GnfAIZ.js +3393 -0
  16. package/_assets/{LoadMore-DtVUvE_o.js → LoadMore-69ZjUVQ9.js} +1 -1
  17. package/_assets/{ManaPricingBanner.styles-tAMFzN8I.js → ManaPricingBanner.styles-06X913rg.js} +1 -1
  18. package/_assets/{MenuList-0BtiFlBr.js → MenuList-CYuJjTkq.js} +1 -1
  19. package/_assets/{MyAssets-BaOL_xvH.js → MyAssets-7DlPFZzH.js} +1 -1
  20. package/_assets/{MyFavorites-CS3x1nw4.js → MyFavorites-CvUWGM2g.js} +1 -1
  21. package/_assets/{NotFound-Cjh1AYGW.js → NotFound-BfKww1lP.js} +1 -1
  22. package/_assets/{NotificationsBell-DZkHVwW_.js → NotificationsBell-8BV2V_7m.js} +1 -1
  23. package/_assets/{OutfitDetail-BG-aXjtW.js → OutfitDetail-i6KGnd11.js} +1 -1
  24. package/_assets/{OutfitPreview-Ds-E41xg.js → OutfitPreview-BO-tY6LN.js} +1 -1
  25. package/_assets/{OutfitStudio-B45FZ7f2.js → OutfitStudio-DHMsd1iV.js} +1 -1
  26. package/_assets/{StoreSettings-x-eB9azk.js → StoreSettings-BBKP2P89.js} +1 -1
  27. package/_assets/{Success-GJTwaVK-.js → Success-RKKJMbUR.js} +1 -1
  28. package/_assets/{SwapController-BOkswRBU.js → SwapController-uaC5iBTR.js} +1 -1
  29. package/_assets/{Tooltip-BrPrB_FF.js → Tooltip-Dh4BuhSJ.js} +1 -1
  30. package/_assets/{TradeService-BeFUQo8S.js → TradeService-B44oeYAt.js} +1 -1
  31. package/_assets/{W3MFrameProviderSingleton-pXBowcJX.js → W3MFrameProviderSingleton-CtKoZGPW.js} +3 -3
  32. package/_assets/{WebCryptoP256-DNvuHIon.js → WebCryptoP256-BgVEe5M8.js} +1 -1
  33. package/_assets/{authorizations-B8y7ie6D.js → authorizations-BWL7qlKm.js} +1 -1
  34. package/_assets/{basic-jTDdNVTt.js → basic-_OLz7uwX.js} +1 -1
  35. package/_assets/{biconomy-D6iQ1Qz7.js → biconomy-U_kcYvmd.js} +1 -1
  36. package/_assets/{builder-DC4gtQTj.js → builder-I4cDZvRJ.js} +1 -1
  37. package/_assets/{buy-D7FZvFCT.js → buy-PW05H439.js} +1 -1
  38. package/_assets/{buy-gasless-Bn8YCJUN.js → buy-gasless-B2bIFHQv.js} +1 -1
  39. package/_assets/{categories-CR3vurm1.js → categories-Cewsb8Ef.js} +1 -1
  40. package/_assets/{ccip-DaB7uDx0.js → ccip-BYTqCIcr.js} +1 -1
  41. package/_assets/{ccip-DWg6dYhE.js → ccip-DZw0ptqC.js} +1 -1
  42. package/_assets/{clsx-Dzrazxv9.js → clsx-ChZXKlM3.js} +1 -1
  43. package/_assets/{collectionPage.styles-qZQe9tC2.js → collectionPage.styles-Dd3m9ofi.js} +5 -5
  44. package/_assets/{controller-BuQdjcgl.js → controller-CGfzFXj8.js} +2 -2
  45. package/_assets/{core-BK1g_OXy.js → core-Eb3TLPcG.js} +4 -4
  46. package/_assets/{createSvgIcon-J8yChvhn.js → createSvgIcon-DIV4UAHy.js} +1 -1
  47. package/_assets/{custom--rWIIG-D.js → custom-D9XFQnk4.js} +1 -1
  48. package/_assets/{data-capture-CN0COz6e.js → data-capture-DH1mVPA3.js} +1 -1
  49. package/_assets/{email-D_dJRcsa.js → email-Da1yvej9.js} +1 -1
  50. package/_assets/{embedded-wallet-Bp75sJw7.js → embedded-wallet-DBHQI3mh.js} +1 -1
  51. package/_assets/{emotion-styled.browser.esm-DMxIZn9h.js → emotion-styled.browser.esm-BQQ0TwU4.js} +1 -1
  52. package/_assets/{engine-D6hd1szl.js → engine-C32OFyoP.js} +1 -1
  53. package/_assets/{errors-BQIZnT7j.js → errors-Dyyi7AS1.js} +1 -1
  54. package/_assets/{estimate-l1-fee-DO8EDZWK.js → estimate-l1-fee-BUpWNCY1.js} +1 -1
  55. package/_assets/{execute-BCnNryMb.js → execute-mSR8LGc4.js} +2 -2
  56. package/_assets/{features-BbAiY1Jf.js → features-Dd4HBrMX.js} +1 -1
  57. package/_assets/{fetchTokenMetadata-zps63-TP.js → fetchTokenMetadata-BZB4GCl8.js} +2 -2
  58. package/_assets/{field.styles-gjTACzK4.js → field.styles-vC92Xftn.js} +1 -1
  59. package/_assets/{get-ecosystem-wallet-info-bG3GimfG.js → get-ecosystem-wallet-info-DwWRMl-N.js} +1 -1
  60. package/_assets/{getBalance-BE89ywjU.js → getBalance-DSh23fMH.js} +1 -1
  61. package/_assets/{getNFT-D38v5tzD.js → getNFT-BBp6M0pq.js} +1 -1
  62. package/_assets/{getNFT-D14_mrBb.js → getNFT-BevVadL_.js} +1 -1
  63. package/_assets/{getThemeProps-v7o8wjpE.js → getThemeProps-BF7zjQVr.js} +1 -1
  64. package/_assets/{grid.styles-B9VqL4eC.js → grid.styles-Bb1W1YT9.js} +1 -1
  65. package/_assets/{hashTypedData-D09x9kVt.js → hashTypedData-C5G1DAop.js} +1 -1
  66. package/_assets/{hashTypedData-DpbwbA5Y.js → hashTypedData-Wfn9v-Hf.js} +1 -1
  67. package/_assets/{in-app-DHJssTEZ.js → in-app-BXEo5oJI.js} +1 -1
  68. package/_assets/{in-app-wallet-calls-BVCtyy0o.js → in-app-wallet-calls-Bd6X0KWG.js} +1 -1
  69. package/_assets/{index-Dv7d7TF7.js → index-2BF-jN6f.js} +1 -1
  70. package/_assets/{index-FgbyyQq_.js → index-6Oq8x_-m.js} +1 -1
  71. package/_assets/{index-D8ruhsoC.js → index-7e_Syhad.js} +1 -1
  72. package/_assets/{index-BgOwfYhI.js → index-B-wUrKiv.js} +3 -3
  73. package/_assets/{index-DlyyISQj.js → index-B1Fh_Ntj.js} +1 -1
  74. package/_assets/{index-0yVVDwVO.js → index-B1eEwkzz.js} +1 -1
  75. package/_assets/{index-CkuUHmKI.js → index-B8FkQHkj.js} +1 -1
  76. package/_assets/{index-D4a1k1Lx.js → index-BCpKNpfr.js} +1 -1
  77. package/_assets/{index-C_Egq9tp.js → index-BF7hghuG.js} +1 -1
  78. package/_assets/{index-BOIPVf6Y.js → index-BFwmH5r2.js} +1 -1
  79. package/_assets/{index-Crv-6FMt.js → index-BK186nFF.js} +281 -281
  80. package/_assets/{index-BI1kDThq.js → index-BMDKd-Ff.js} +1 -1
  81. package/_assets/{index-B83Hgnlb.js → index-BNXLnSJ4.js} +1 -1
  82. package/_assets/{index-2D5lvzn3.js → index-BQlATUFi.js} +1 -1
  83. package/_assets/{index-m-mREpXI.js → index-BehGKAc6.js} +3 -3
  84. package/_assets/{index-BgiFUjpr.js → index-BlneDIUK.js} +1 -1
  85. package/_assets/{index-DT-li7A4.js → index-Bpxazn1C.js} +1 -1
  86. package/_assets/{index-CnBcGWDj.js → index-BqMHKneq.js} +1 -1
  87. package/_assets/{index-BQCxs7C9.js → index-CABCJq7C.js} +1 -1
  88. package/_assets/{index-BOi75v-l.js → index-CCwIHj2Z.js} +1 -1
  89. package/_assets/{index-P2UKF5rf.js → index-CGga9MZU.js} +1 -1
  90. package/_assets/{index-DBVdLIyV.js → index-Cl0OwOQC.js} +2 -2
  91. package/_assets/{index-CaP_Za_c.js → index-CmOMlUK3.js} +1 -1
  92. package/_assets/{index-DW0v82LH.js → index-CnYjUY-N.js} +1 -1
  93. package/_assets/{index-ROWP5zCo.js → index-CpXK1eyp.js} +1 -1
  94. package/_assets/{index-CwJqeIVQ.js → index-D3ia8xPb.js} +1 -1
  95. package/_assets/{index-CHV83zbw.js → index-D58_3pMX.js} +1 -1
  96. package/_assets/{index-7ZmsD7pV.js → index-D6jXV4v6.js} +3 -3
  97. package/_assets/{index-DWDGpmbP.js → index-DBY7pfsX.js} +1 -1
  98. package/_assets/{index-DNRAeXhX.js → index-DCDkfxBQ.js} +1 -1
  99. package/_assets/{index-Bx9FQGUD.js → index-DHBBVF0A.js} +1 -1
  100. package/_assets/{index-kB6El_bb.js → index-DNzD8lGd.js} +1 -1
  101. package/_assets/{index-DVXg4hbd.js → index-DQllllFW.js} +1 -1
  102. package/_assets/{index-aARUoJGj.js → index-D_Rc0VlP.js} +1 -1
  103. package/_assets/{index-CGtw5iLJ.js → index-DabDoxcF.js} +2 -2
  104. package/_assets/{index-Bs1_PcA9.js → index-DbyFw-p2.js} +1 -1
  105. package/_assets/{index-CF866r37.js → index-DeMedGEt.js} +1 -1
  106. package/_assets/{index-DXK0dOW2.js → index-DgM4asaI.js} +1 -1
  107. package/_assets/{index-fcirgr-r.js → index-DoaAKgT7.js} +1 -1
  108. package/_assets/{index-SZ_CvoIV.js → index-Dsgz061o.js} +1 -1
  109. package/_assets/{index-CtjyKch3.js → index-DtNkXFsH.js} +2 -2
  110. package/_assets/{index-D6knqZUY.js → index-OM8C66gb.js} +1 -1
  111. package/_assets/{index-zUSsLBXU.js → index-QshQ-X06.js} +1 -1
  112. package/_assets/{index-CKFRCfS4.js → index-b5E6PDAn.js} +1 -1
  113. package/_assets/{index-Cy9EOdYJ.js → index-fkuvr7Fy.js} +1 -1
  114. package/_assets/{index-C05A2Y5e.js → index-mDuPP0v8.js} +1 -1
  115. package/_assets/{index-Cv-aotc4.js → index-ncNzPsNV.js} +1 -1
  116. package/_assets/{index-Dg5jak8-.js → index-ti6Xx8KP.js} +1 -1
  117. package/_assets/{index-D0J6AIzv.js → index-uYRD9E52.js} +1 -1
  118. package/_assets/{index-KhNGJKgC.js → index-vlz-Aki7.js} +1 -1
  119. package/_assets/{index-BSk7Bxcl.js → index-vrvK7bcx.js} +1 -1
  120. package/_assets/{index-CyA8lg3a.js → index-yp3Medz4.js} +1 -1
  121. package/_assets/{index.es-vvA0Lt9I.js → index.es-BG9tAoxq.js} +1 -1
  122. package/_assets/{index.es-CEzDYUYH.js → index.es-Bq-mnMqp.js} +4 -4
  123. package/_assets/{index.es-ChO6Qu9w.js → index.es-D5Y2l8N-.js} +1 -1
  124. package/_assets/{localBatchGatewayRequest-BTNx9qgN.js → localBatchGatewayRequest-DQzEn08n.js} +1 -1
  125. package/_assets/{networks-CVci8sPT.js → networks-7mAev_So.js} +1 -1
  126. package/_assets/{onramp-BCoU4Jyj.js → onramp-C5rbJZZQ.js} +1 -1
  127. package/_assets/{openzeppelin-DZ76Bjhm.js → openzeppelin-cUgS_fFv.js} +1 -1
  128. package/_assets/{parseNft-Wz3HLkrh.js → parseNft-BtgCWBfG.js} +2 -2
  129. package/_assets/{parseSignature-h1NXN_yq.js → parseSignature-0U8LTkYq.js} +3 -3
  130. package/_assets/{parseSignature-D-GX-OPq.js → parseSignature-BL815h22.js} +1 -1
  131. package/_assets/{passkeys-5-LJYN4N.js → passkeys-CenbJOC4.js} +1 -1
  132. package/_assets/{pay-with-exchange-B3YFxSq-.js → pay-with-exchange-fg2iyPQf.js} +1 -1
  133. package/_assets/{qr-overlay-DhBzxblG.js → qr-overlay-Db9bn8si.js} +1 -1
  134. package/_assets/{receive-B_6FCkZX.js → receive-Cy92xKIA.js} +1 -1
  135. package/_assets/{resolveImplementation-D1PTZvev.js → resolveImplementation-CphK2kw-.js} +1 -1
  136. package/_assets/{rpc-Dnr7Ho6n.js → rpc-tPaaI0wQ.js} +1 -1
  137. package/_assets/{secp256k1-DRVWswpU.js → secp256k1-BefPXR71.js} +1 -1
  138. package/_assets/{secp256k1-DSyr_erP.js → secp256k1-BuRL31Pv.js} +1 -1
  139. package/_assets/{secp256k1-_hKozEef.js → secp256k1-rc9cttcQ.js} +1 -1
  140. package/_assets/{send-CkVArLZ6.js → send-B85QTpWb.js} +1 -1
  141. package/_assets/{send-batch-transaction-D_N3Pmuj.js → send-batch-transaction-IhphBGXV.js} +1 -1
  142. package/_assets/{send-eip712-transaction-CD7uH6nJ.js → send-eip712-transaction-D1F2l2MF.js} +2 -2
  143. package/_assets/{send-gasless-transaction-CIlguYRL.js → send-gasless-transaction-B32TPIoL.js} +2 -2
  144. package/_assets/{send-transaction-C5_TnN20.js → send-transaction-DAsAIcLp.js} +2 -2
  145. package/_assets/{sendMetaTransaction-B7Mr50I5.js → sendMetaTransaction-X4QLi3Hi.js} +1 -1
  146. package/_assets/{sendRawTransaction-B058K9Kh.js → sendRawTransaction-Bp5LMxhF.js} +3 -3
  147. package/_assets/{serializeTransaction-KF-03cJY.js → serializeTransaction-CcoTA2oD.js} +1 -1
  148. package/_assets/{session-proposal-D8lydRcg.js → session-proposal-BFRFzBM9.js} +1 -1
  149. package/_assets/{session-request-CaHU4009.js → session-request-Kq_RHzZu.js} +2 -2
  150. package/_assets/{signing-Bq3g4A7Y.js → signing-Dqg6cmff.js} +3 -3
  151. package/_assets/{socials-BrG-c6Aa.js → socials-D13NM4Eg.js} +1 -1
  152. package/_assets/{swaps-DHaKmVZn.js → swaps-CQuH4Q4P.js} +1 -1
  153. package/_assets/{thirdweb-aTdCGpIK.js → thirdweb-CIKZzA4I.js} +3 -3
  154. package/_assets/{to-serializable-transaction-BcqoQHx0.js → to-serializable-transaction-Bs3gRQ4f.js} +2 -2
  155. package/_assets/{trade-encoding-Bf-VP6DB.js → trade-encoding-C7Wym_F1.js} +1 -1
  156. package/_assets/{transactionReceipt-DcJzxeq0.js → transactionReceipt-Bp1hf_iD.js} +1 -1
  157. package/_assets/{transactions-BLfm3Gn6.js → transactions-Bli31a16.js} +1 -1
  158. package/_assets/{useCreditPacks-RMR6xQ90.js → useCreditPacks-CHzNSIvf.js} +1 -1
  159. package/_assets/{useImportable-DDSrqfP0.js → useImportable-kOA7rsjp.js} +1 -1
  160. package/_assets/{useInfiniteGrid-Bxq6R4at.js → useInfiniteGrid-CdPr9eL9.js} +1 -1
  161. package/_assets/{useTheme-CT47H6Fl.js → useTheme-CGp2hobC.js} +1 -1
  162. package/_assets/{verifyHash-ClgmzB1L.js → verifyHash-tFRgslhI.js} +1 -1
  163. package/_assets/{w3m-modal-16eQ9GHq.js → w3m-modal-Cd7LAwQP.js} +1 -1
  164. package/_assets/{w3m-modal-DbJYmEbS.js → w3m-modal-DIDR69iz.js} +1 -1
  165. package/_assets/{wait-for-tx-receipt-DdcASAzC.js → wait-for-tx-receipt-BlFYuYR0.js} +1 -1
  166. package/_assets/{wallets-CQ9eMOop.js → wallets-0QMnCoJB.js} +5 -5
  167. package/_assets/{web-connector-CT2Y5er0.js → web-connector-C-yPSxwg.js} +3 -3
  168. package/_assets/{writeContract-D-02hbjh.js → writeContract-BWpBg5cs.js} +1 -1
  169. package/_assets/{zoraTestnet-1Y8XuTqt.js → zoraTestnet-YDHc7FSH.js} +1 -1
  170. package/index.html +11 -11
  171. package/package.json +2 -2
  172. package/_assets/ItemDetail-NzNfUTW6.js +0 -3375
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-DlyyISQj.js","_assets/react-DehiWSvs.js","_assets/index-Crv-6FMt.js","_assets/sentry-973sfbO9.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/ethers-CtNGBird.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/useImportable-DDSrqfP0.js","_assets/buy-D7FZvFCT.js","_assets/authorizations-B8y7ie6D.js","_assets/sendMetaTransaction-B7Mr50I5.js","_assets/trade-encoding-Bf-VP6DB.js","_assets/ManaPricingBanner.styles-tAMFzN8I.js","_assets/field.styles-gjTACzK4.js"])))=>i.map(i=>d[i]);
2
- import{m as bt,bv as yt,s as h,t as s,q as vt,B as wt,l as jt,v as kt,d,o as $,b3 as It,I as j,bw as Z,bx as J,by as At,_ as $t,x as P,bz as Pt,b7 as z,av as Lt,bA as Tt,bB as H}from"./index-Crv-6FMt.js";import{r as y,e as Nt,j as e,L as et,a as Et}from"./react-DehiWSvs.js";import{u as Ct}from"./useImportable-DDSrqfP0.js";import{L as St}from"./LoadMore-DtVUvE_o.js";import{u as I}from"./useInfiniteGrid-Bxq6R4at.js";import{m as it}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./buy-D7FZvFCT.js";import"./authorizations-B8y7ie6D.js";import"./sendMetaTransaction-B7Mr50I5.js";import"./trade-encoding-Bf-VP6DB.js";const Ft=15e3;function Mt(t,a){return t.txHash&&a.txHash?t.txHash===a.txHash:t.txHash||a.txHash?!1:t.status===a.status&&Math.abs(t.createdAt-a.createdAt)<=Ft}function Dt(t){const a=[...t].sort((i,c)=>c.createdAt-i.createdAt),n=[];for(const i of a){const c=n[n.length-1];c&&Mt(c[c.length-1],i)?c.push(i):n.push([i])}return n.map(i=>{var c;return{id:((c=i.find(r=>r.txHash))==null?void 0:c.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(r=>r.createdAt)),status:i.some(r=>r.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((r,u)=>r+u.credits,0),lines:i}})}function zt(t){return t.tradeId?`trade:${t.tradeId}`:t.contractAddress&&t.itemId?`item:${t.contractAddress.toLowerCase()}:${t.itemId}`:null}function Ht(t){const a=[],n=new Map;for(const i of t){const c=zt(i);if(!c){a.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const r=n.get(c);if(r){r.quantity+=1,r.credits+=i.credits;continue}const u={key:c,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};n.set(c,u),a.push(u)}return a}function qt(t,a){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:a?bt(t.manaWei,a):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Ot(t){const n=Dt(t.purchases.filter(o=>o.status!=="EXPIRED")).map(o=>({kind:"purchase",id:`purchase:${o.id}`,createdAt:o.createdAt,order:o})),i=t.sales.map(o=>{const p=qt(o,t.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),c=(t.creditOrders??[]).filter(o=>o.status!=="failed"&&o.status!=="abandoned").map(o=>({kind:"credit",id:`credit:${o.id}`,createdAt:o.createdAt,order:o})),r=new Set(t.purchases.filter(o=>o.txHash).map(o=>o.txHash.toLowerCase())),u=(t.manaPurchases??[]).filter(o=>!r.has(o.txHash.toLowerCase())).map(o=>({kind:"mana-purchase",id:`mana-purchase:${o.id}`,createdAt:o.createdAt,sale:o}));return[...n,...i,...c,...u].sort((o,p)=>p.createdAt-o.createdAt||(o.id<p.id?-1:1))}function Wt(t,a){return a==="all"?t:a==="sales"?t.filter(n=>n.kind==="sale"):t.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const at=t=>t.trim().toLowerCase();function Rt(t){const a=new Map;for(const n of t??[]){const i=at(n.txHash??"");if(!i)continue;const c=a.get(i);c?c.push(n):a.set(i,[n])}return a}function _t(t,a,n=Date.now()){const i=a.txHash?t.get(at(a.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const c=i.length===1?Bt(i[0].netCents):null,r=i.filter(o=>!o.available&&o.availableAt>n);if(r.length===0)return{kind:"credited",credits:c};const u=r.reduce((o,p)=>Math.max(o,p.availableAt),0);return{kind:"pending",credits:c,availableAt:u}}function Bt(t){return yt(t)}const Gt="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/credits-product-vs4Q6u6l.svg",q=vt`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_assets/index-B1Fh_Ntj.js","_assets/react-DehiWSvs.js","_assets/index-BK186nFF.js","_assets/sentry-973sfbO9.js","_assets/dcl-schemas-Dr9BTjb7.js","_assets/ethers-CtNGBird.js","_assets/intl-CBcMB1D2.js","_assets/index-D-NhBWWr.css","_assets/useImportable-kOA7rsjp.js","_assets/buy-PW05H439.js","_assets/authorizations-BWL7qlKm.js","_assets/sendMetaTransaction-X4QLi3Hi.js","_assets/trade-encoding-C7Wym_F1.js","_assets/ManaPricingBanner.styles-06X913rg.js","_assets/field.styles-vC92Xftn.js"])))=>i.map(i=>d[i]);
2
+ import{m as bt,bv as yt,s as h,t as s,q as vt,B as wt,l as jt,v as kt,d,o as $,b3 as It,I as j,bw as Z,bx as J,by as At,_ as $t,x as P,bz as Pt,b7 as z,av as Lt,bA as Tt,bB as H}from"./index-BK186nFF.js";import{r as y,e as Nt,j as e,L as et,a as Et}from"./react-DehiWSvs.js";import{u as Ct}from"./useImportable-kOA7rsjp.js";import{L as St}from"./LoadMore-69ZjUVQ9.js";import{u as I}from"./useInfiniteGrid-CdPr9eL9.js";import{m as it}from"./mana-matic-C4e1sNO3.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./buy-PW05H439.js";import"./authorizations-BWL7qlKm.js";import"./sendMetaTransaction-X4QLi3Hi.js";import"./trade-encoding-C7Wym_F1.js";const Ft=15e3;function Mt(t,a){return t.txHash&&a.txHash?t.txHash===a.txHash:t.txHash||a.txHash?!1:t.status===a.status&&Math.abs(t.createdAt-a.createdAt)<=Ft}function Dt(t){const a=[...t].sort((i,c)=>c.createdAt-i.createdAt),n=[];for(const i of a){const c=n[n.length-1];c&&Mt(c[c.length-1],i)?c.push(i):n.push([i])}return n.map(i=>{var c;return{id:((c=i.find(r=>r.txHash))==null?void 0:c.txHash)??i[i.length-1].id,createdAt:Math.max(...i.map(r=>r.createdAt)),status:i.some(r=>r.status==="PENDING")?"PENDING":"SETTLED",totalCredits:i.reduce((r,u)=>r+u.credits,0),lines:i}})}function zt(t){return t.tradeId?`trade:${t.tradeId}`:t.contractAddress&&t.itemId?`item:${t.contractAddress.toLowerCase()}:${t.itemId}`:null}function Ht(t){const a=[],n=new Map;for(const i of t){const c=zt(i);if(!c){a.push({key:i.id,tradeId:null,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits});continue}const r=n.get(c);if(r){r.quantity+=1,r.credits+=i.credits;continue}const u={key:c,tradeId:i.tradeId,contractAddress:i.contractAddress??null,itemId:i.itemId??null,quantity:1,credits:i.credits};n.set(c,u),a.push(u)}return a}function qt(t,a){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:a?bt(t.manaWei,a):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Ot(t){const n=Dt(t.purchases.filter(o=>o.status!=="EXPIRED")).map(o=>({kind:"purchase",id:`purchase:${o.id}`,createdAt:o.createdAt,order:o})),i=t.sales.map(o=>{const p=qt(o,t.rate);return{kind:"sale",id:`sale:${p.id}`,createdAt:p.createdAt,sale:p}}),c=(t.creditOrders??[]).filter(o=>o.status!=="failed"&&o.status!=="abandoned").map(o=>({kind:"credit",id:`credit:${o.id}`,createdAt:o.createdAt,order:o})),r=new Set(t.purchases.filter(o=>o.txHash).map(o=>o.txHash.toLowerCase())),u=(t.manaPurchases??[]).filter(o=>!r.has(o.txHash.toLowerCase())).map(o=>({kind:"mana-purchase",id:`mana-purchase:${o.id}`,createdAt:o.createdAt,sale:o}));return[...n,...i,...c,...u].sort((o,p)=>p.createdAt-o.createdAt||(o.id<p.id?-1:1))}function Wt(t,a){return a==="all"?t:a==="sales"?t.filter(n=>n.kind==="sale"):t.filter(n=>n.kind==="purchase"||n.kind==="credit"||n.kind==="mana-purchase")}const at=t=>t.trim().toLowerCase();function Rt(t){const a=new Map;for(const n of t??[]){const i=at(n.txHash??"");if(!i)continue;const c=a.get(i);c?c.push(n):a.set(i,[n])}return a}function _t(t,a,n=Date.now()){const i=a.txHash?t.get(at(a.txHash)):void 0;if(!i||i.length===0)return{kind:"direct"};const c=i.length===1?Bt(i[0].netCents):null,r=i.filter(o=>!o.available&&o.availableAt>n);if(r.length===0)return{kind:"credited",credits:c};const u=r.reduce((o,p)=>Math.max(o,p.availableAt),0);return{kind:"pending",credits:c,availableAt:u}}function Bt(t){return yt(t)}const Gt="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/credits-product-vs4Q6u6l.svg",q=vt`
3
3
  0% { background-position: 200% 0; }
4
4
  100% { background-position: -200% 0; }
5
5
  `,Ut=h.section`
@@ -354,4 +354,4 @@ import{m as bt,bv as yt,s as h,t as s,q as vt,B as wt,l as jt,v as kt,d,o as $,b
354
354
  margin: 6px 0 0;
355
355
  `,ae=h(wt)`
356
356
  margin-top: 12px;
357
- `,K=M.withComponent(et),se=y.lazy(()=>$t(()=>import("./index-DlyyISQj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(t=>({default:t.ImportListings}))),A=24,ne=["all","purchases","sales"],D="migrate";function w(t){try{return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ct(t){return t.length>10?`${t.slice(0,6)}…${t.slice(-4)}`:t}function dt(t){const a=Number(t)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function lt({children:t}){const a=y.useRef(null),[n,i]=y.useState(null),c=()=>{var u;const r=(u=a.current)==null?void 0:u.getBoundingClientRect();r&&i({top:r.bottom+8,left:r.left+r.width/2})};return e.jsxs(te,{ref:a,tabIndex:0,onMouseEnter:c,onMouseLeave:()=>i(null),onFocus:c,onBlur:()=>i(null),children:[t,n?Et.createPortal(e.jsx(ee,{style:{top:n.top,left:n.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function re({item:t}){const a=!!t.contractAddress&&!!t.itemId,n=!!t.tradeId||a,{data:i,isLoading:c}=$({queryKey:["order-line-display",t.tradeId,t.contractAddress,t.itemId],queryFn:()=>t.tradeId?Tt(t.tradeId):H(t.contractAddress,{itemId:t.itemId}),enabled:n,staleTime:5*6e4}),r=n&&c,u=(i==null?void 0:i.name)??d("activity.itemFallback"),o=(i==null?void 0:i.thumbnail)??"",p=z({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,x=e.jsxs(e.Fragment,{children:[r?e.jsx(R,{}):e.jsx(W,{children:o?e.jsx("img",{src:o,alt:u}):e.jsx(j,{name:"cart",size:20})}),e.jsxs(_,{children:[r?e.jsx(G,{}):e.jsx(B,{title:u,children:u}),t.quantity>1?e.jsx(U,{children:d("activity.quantity",{count:t.quantity})}):null]}),e.jsxs(ie,{children:[e.jsx(P,{className:"ccy-mark"})," ",t.credits]})]});return p?e.jsx(K,{to:p,"data-link":"true",children:x}):e.jsx(M,{children:x})}function oe({order:t}){const a=Ht(t.lines),n=a.reduce((i,c)=>i+c.quantity,0);return e.jsxs(L,{"data-testid":"purchase-order",children:[e.jsxs(T,{children:[e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsxs(C,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:n})]})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":t.status,children:t.status==="PENDING"?d("activity.processing"):d("activity.completed")}),e.jsxs(v,{children:[e.jsx(P,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),e.jsx(O,{children:a.map(i=>e.jsx(re,{item:i},i.key))})]})}function ce({sale:t}){const{data:a,isLoading:n}=$({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>H(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??d("activity.itemFallback"),c=(a==null?void 0:a.thumbnail)??"",r=z({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,u=e.jsxs(e.Fragment,{children:[n?e.jsx(R,{}):e.jsx(W,{children:c?e.jsx("img",{src:c,alt:i}):e.jsx(j,{name:"offer",size:20})}),e.jsxs(_,{children:[n?e.jsx(G,{}):e.jsx(B,{title:i,children:i}),e.jsx(U,{children:d("activity.boughtFrom",{account:ct(t.seller)})})]})]});return e.jsxs(L,{"data-testid":"activity-mana-purchase",children:[e.jsxs(T,{children:[e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsx(C,{children:d("activity.paidWithMana")})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":"SETTLED",children:d("activity.completed")}),e.jsxs(v,{children:[dt(t.manaWei)," ",e.jsx(lt,{children:e.jsx(nt,{src:it,alt:"MANA"})})]})]})]}),e.jsx(O,{children:r?e.jsx(K,{to:r,"data-link":"true",children:u}):e.jsx(M,{children:u})})]})}function de({sale:t,payout:a}){const{data:n,isLoading:i}=$({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>H(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),c=(n==null?void 0:n.name)??d("activity.itemFallback"),r=(n==null?void 0:n.thumbnail)??"",u=z({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,o=e.jsxs(e.Fragment,{children:[i?e.jsx(R,{}):e.jsx(W,{children:r?e.jsx("img",{src:r,alt:c}):e.jsx(j,{name:"offer",size:20})}),e.jsxs(_,{children:[i?e.jsx(G,{}):e.jsx(B,{title:c,children:c}),e.jsxs(U,{children:[d("activity.soldTo",{account:ct(t.counterparty)}),a.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:w(a.availableAt)})}`:""]})]})]});return e.jsxs(L,{"data-testid":"activity-sale",children:[e.jsxs(T,{children:[e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsx(C,{children:d("activity.saleLabel")})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),a.kind==="direct"?e.jsxs(v,{"data-kind":"income",children:["+",dt(t.manaWei)," ",e.jsx(lt,{children:e.jsx(nt,{src:it,alt:"MANA"})})]}):a.credits!==null?e.jsxs(v,{"data-kind":"income",children:[e.jsx(P,{className:"ccy-mark"})," +",Lt(a.credits)]}):e.jsx(v,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),e.jsx(O,{children:u?e.jsx(K,{to:u,"data-link":"true",children:o}):e.jsx(M,{children:o})})]})}function le({order:t}){const a=`$${(t.usdCents/100).toFixed(2)}`,n=Pt(t.status),i=n==="SETTLED"?d("activity.completed"):n==="FAILED"?d("activity.failed"):d("activity.processing");return e.jsx(L,{"data-testid":"credit-order",children:e.jsxs(T,{children:[e.jsx(Yt,{children:e.jsx("img",{src:Gt,alt:"","aria-hidden":!0})}),e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsxs(C,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:a})]})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":n,children:i}),e.jsxs(v,{"data-kind":"income",children:["+",e.jsx(P,{className:"ccy-mark"})," ",t.credits]})]})]})})}function he({filter:t}){const a={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")}}[t];return e.jsxs(rt,{children:[e.jsx(j,{name:a.icon,size:40,color:s.colors.muted2}),e.jsx(ot,{children:a.title}),e.jsx("p",{className:"muted",children:a.body}),t!=="sales"?e.jsx(ae,{as:et,to:"/items",variant:"purple",children:d("notFound.cta")}):null]})}function $e(){const{session:t}=jt(),[a,n]=y.useState("all"),[i,c]=Nt(),r=i.get("view")===D;kt({title:r?d("seo.import.title"):d("nav.activity"),noindex:!0});const{count:u}=Ct(),o=u!==void 0&&(u>0||r),p=!!t&&!r&&a!=="sales",x=!!t&&!r&&a!=="purchases",m=I(["purchases",t==null?void 0:t.address],l=>At(t.address,t.identity,{first:A,skip:l}),{enabled:p}),g=I(["sales",t==null?void 0:t.address],l=>Z(t.address,{role:"seller",first:A,skip:l}),{enabled:x}),f=I(["credit-orders",t==null?void 0:t.address],l=>J(t.address,t.identity,{first:A,skip:l}),{enabled:p}),b=I(["mana-purchases",t==null?void 0:t.address],l=>Z(t.address,{role:"buyer",first:A,skip:l}),{enabled:p}),{data:V}=$({queryKey:["sale-payouts",t==null?void 0:t.address],queryFn:()=>J(t.address,t.identity,{first:200}).then(l=>l.payouts),enabled:x,staleTime:6e4}),ht=y.useMemo(()=>Rt(V),[V]),{data:ut}=It(x);if(!t)return e.jsxs(rt,{children:[e.jsx(j,{name:"clock",size:40,color:s.colors.muted2}),e.jsx(ot,{children:d("activity.signInTitle")}),e.jsx("p",{className:"muted",children:d("activity.signInBody")})]});const Q=Wt(Ot({purchases:p?m.items:[],sales:x?g.items:[],creditOrders:p?f.items:[],manaPurchases:p?b.items:[],rate:ut}),a),pt=p&&(m.isLoading||f.isLoading||b.isLoading)||x&&g.isLoading,X=p&&(m.isFetchingNextPage||f.isFetchingNextPage||b.isFetchingNextPage)||x&&g.isFetchingNextPage,xt=p&&(m.hasNextPage||f.hasNextPage||b.hasNextPage)||x&&g.hasNextPage;function mt(){p&&m.hasNextPage&&m.fetchNextPage(),p&&f.hasNextPage&&f.fetchNextPage(),p&&b.hasNextPage&&b.fetchNextPage(),x&&g.hasNextPage&&g.fetchNextPage()}function gt(l){if(n(l),!r)return;const k=new URLSearchParams(i);k.delete("view"),c(k,{replace:!0})}function ft(){const l=new URLSearchParams(i);l.set("view",D),c(l,{replace:!0})}return e.jsxs(Ut,{"data-view":r?D:"feed",children:[e.jsx(Kt,{children:e.jsx(Vt,{children:d("nav.activity")})}),e.jsxs(Qt,{role:"tablist","aria-label":d("nav.activity"),children:[ne.map(l=>e.jsx(st,{type:"button",role:"tab","aria-selected":!r&&a===l,"data-active":!r&&a===l,"data-testid":`activity-filter-${l}`,onClick:()=>gt(l),children:d(`activity.filter.${l}`)},l)),o?e.jsxs(Xt,{type:"button",role:"tab","aria-selected":r,"data-active":r,"data-testid":"activity-filter-migrate","aria-label":u?d("activity.migrate.chipAria",{count:u}):void 0,onClick:ft,children:[d("activity.migrate.chip"),u?e.jsx(Zt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:u}):null]}):null]}),r?e.jsx(y.Suspense,{fallback:e.jsx(Jt,{"aria-busy":"true"}),children:e.jsx(se,{})}):pt?e.jsx(Y,{children:Array.from({length:5}).map((l,k)=>e.jsx(tt,{},k))}):Q.length===0?e.jsx(he,{filter:a}):e.jsxs(e.Fragment,{children:[e.jsxs(Y,{children:[Q.map(l=>l.kind==="purchase"?e.jsx(oe,{order:l.order},l.id):l.kind==="credit"?e.jsx(le,{order:l.order},l.id):l.kind==="mana-purchase"?e.jsx(ce,{sale:l.sale},l.id):e.jsx(de,{sale:l.sale,payout:_t(ht,l.sale)},l.id)),X?e.jsx(tt,{}):null]}),e.jsx(St,{hasNextPage:xt,isFetching:X,onLoadMore:mt})]})]})}export{$e as Activity};
357
+ `,K=M.withComponent(et),se=y.lazy(()=>$t(()=>import("./index-B1Fh_Ntj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])).then(t=>({default:t.ImportListings}))),A=24,ne=["all","purchases","sales"],D="migrate";function w(t){try{return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return""}}function ct(t){return t.length>10?`${t.slice(0,6)}…${t.slice(-4)}`:t}function dt(t){const a=Number(t)/1e18;return Number.isFinite(a)?a.toLocaleString("en",{maximumFractionDigits:2}):"0"}function lt({children:t}){const a=y.useRef(null),[n,i]=y.useState(null),c=()=>{var u;const r=(u=a.current)==null?void 0:u.getBoundingClientRect();r&&i({top:r.bottom+8,left:r.left+r.width/2})};return e.jsxs(te,{ref:a,tabIndex:0,onMouseEnter:c,onMouseLeave:()=>i(null),onFocus:c,onBlur:()=>i(null),children:[t,n?Et.createPortal(e.jsx(ee,{style:{top:n.top,left:n.left},role:"tooltip",children:d("activity.polygonMana")}),document.body):null]})}function re({item:t}){const a=!!t.contractAddress&&!!t.itemId,n=!!t.tradeId||a,{data:i,isLoading:c}=$({queryKey:["order-line-display",t.tradeId,t.contractAddress,t.itemId],queryFn:()=>t.tradeId?Tt(t.tradeId):H(t.contractAddress,{itemId:t.itemId}),enabled:n,staleTime:5*6e4}),r=n&&c,u=(i==null?void 0:i.name)??d("activity.itemFallback"),o=(i==null?void 0:i.thumbnail)??"",p=z({contractAddress:i==null?void 0:i.contractAddress,tokenId:i==null?void 0:i.tokenId,itemId:i==null?void 0:i.itemId})??void 0,x=e.jsxs(e.Fragment,{children:[r?e.jsx(R,{}):e.jsx(W,{children:o?e.jsx("img",{src:o,alt:u}):e.jsx(j,{name:"cart",size:20})}),e.jsxs(_,{children:[r?e.jsx(G,{}):e.jsx(B,{title:u,children:u}),t.quantity>1?e.jsx(U,{children:d("activity.quantity",{count:t.quantity})}):null]}),e.jsxs(ie,{children:[e.jsx(P,{className:"ccy-mark"})," ",t.credits]})]});return p?e.jsx(K,{to:p,"data-link":"true",children:x}):e.jsx(M,{children:x})}function oe({order:t}){const a=Ht(t.lines),n=a.reduce((i,c)=>i+c.quantity,0);return e.jsxs(L,{"data-testid":"purchase-order",children:[e.jsxs(T,{children:[e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsxs(C,{children:[d("activity.purchaseLabel")," · ",d("activity.itemCount",{count:n})]})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":t.status,children:t.status==="PENDING"?d("activity.processing"):d("activity.completed")}),e.jsxs(v,{children:[e.jsx(P,{className:"ccy-mark"})," ",t.totalCredits]})]})]}),e.jsx(O,{children:a.map(i=>e.jsx(re,{item:i},i.key))})]})}function ce({sale:t}){const{data:a,isLoading:n}=$({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>H(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),i=(a==null?void 0:a.name)??d("activity.itemFallback"),c=(a==null?void 0:a.thumbnail)??"",r=z({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,u=e.jsxs(e.Fragment,{children:[n?e.jsx(R,{}):e.jsx(W,{children:c?e.jsx("img",{src:c,alt:i}):e.jsx(j,{name:"offer",size:20})}),e.jsxs(_,{children:[n?e.jsx(G,{}):e.jsx(B,{title:i,children:i}),e.jsx(U,{children:d("activity.boughtFrom",{account:ct(t.seller)})})]})]});return e.jsxs(L,{"data-testid":"activity-mana-purchase",children:[e.jsxs(T,{children:[e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsx(C,{children:d("activity.paidWithMana")})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":"SETTLED",children:d("activity.completed")}),e.jsxs(v,{children:[dt(t.manaWei)," ",e.jsx(lt,{children:e.jsx(nt,{src:it,alt:"MANA"})})]})]})]}),e.jsx(O,{children:r?e.jsx(K,{to:r,"data-link":"true",children:u}):e.jsx(M,{children:u})})]})}function de({sale:t,payout:a}){const{data:n,isLoading:i}=$({queryKey:["asset-display",t.contractAddress,t.tokenId,t.itemId],queryFn:()=>H(t.contractAddress,{tokenId:t.tokenId,itemId:t.itemId}),enabled:!!t.contractAddress,staleTime:3e5}),c=(n==null?void 0:n.name)??d("activity.itemFallback"),r=(n==null?void 0:n.thumbnail)??"",u=z({contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId})??void 0,o=e.jsxs(e.Fragment,{children:[i?e.jsx(R,{}):e.jsx(W,{children:r?e.jsx("img",{src:r,alt:c}):e.jsx(j,{name:"offer",size:20})}),e.jsxs(_,{children:[i?e.jsx(G,{}):e.jsx(B,{title:c,children:c}),e.jsxs(U,{children:[d("activity.soldTo",{account:ct(t.counterparty)}),a.kind==="pending"?` · ${d("activity.payoutPendingOn",{date:w(a.availableAt)})}`:""]})]})]});return e.jsxs(L,{"data-testid":"activity-sale",children:[e.jsxs(T,{children:[e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsx(C,{children:d("activity.saleLabel")})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":a.kind==="pending"?"PENDING":"SOLD",children:a.kind==="pending"?d("activity.payoutPending"):d("activity.sold")}),a.kind==="direct"?e.jsxs(v,{"data-kind":"income",children:["+",dt(t.manaWei)," ",e.jsx(lt,{children:e.jsx(nt,{src:it,alt:"MANA"})})]}):a.credits!==null?e.jsxs(v,{"data-kind":"income",children:[e.jsx(P,{className:"ccy-mark"})," +",Lt(a.credits)]}):e.jsx(v,{"data-kind":"income",children:d("activity.payoutCredited")})]})]}),e.jsx(O,{children:u?e.jsx(K,{to:u,"data-link":"true",children:o}):e.jsx(M,{children:o})})]})}function le({order:t}){const a=`$${(t.usdCents/100).toFixed(2)}`,n=Pt(t.status),i=n==="SETTLED"?d("activity.completed"):n==="FAILED"?d("activity.failed"):d("activity.processing");return e.jsx(L,{"data-testid":"credit-order",children:e.jsxs(T,{children:[e.jsx(Yt,{children:e.jsx("img",{src:Gt,alt:"","aria-hidden":!0})}),e.jsxs(N,{children:[e.jsx(E,{children:w(t.createdAt)}),e.jsxs(C,{children:[d("activity.creditPurchaseLabel")," · ",d("activity.creditPaid",{usd:a})]})]}),e.jsxs(S,{children:[e.jsx(F,{"data-status":n,children:i}),e.jsxs(v,{"data-kind":"income",children:["+",e.jsx(P,{className:"ccy-mark"})," ",t.credits]})]})]})})}function he({filter:t}){const a={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")}}[t];return e.jsxs(rt,{children:[e.jsx(j,{name:a.icon,size:40,color:s.colors.muted2}),e.jsx(ot,{children:a.title}),e.jsx("p",{className:"muted",children:a.body}),t!=="sales"?e.jsx(ae,{as:et,to:"/items",variant:"purple",children:d("notFound.cta")}):null]})}function $e(){const{session:t}=jt(),[a,n]=y.useState("all"),[i,c]=Nt(),r=i.get("view")===D;kt({title:r?d("seo.import.title"):d("nav.activity"),noindex:!0});const{count:u}=Ct(),o=u!==void 0&&(u>0||r),p=!!t&&!r&&a!=="sales",x=!!t&&!r&&a!=="purchases",m=I(["purchases",t==null?void 0:t.address],l=>At(t.address,t.identity,{first:A,skip:l}),{enabled:p}),g=I(["sales",t==null?void 0:t.address],l=>Z(t.address,{role:"seller",first:A,skip:l}),{enabled:x}),f=I(["credit-orders",t==null?void 0:t.address],l=>J(t.address,t.identity,{first:A,skip:l}),{enabled:p}),b=I(["mana-purchases",t==null?void 0:t.address],l=>Z(t.address,{role:"buyer",first:A,skip:l}),{enabled:p}),{data:V}=$({queryKey:["sale-payouts",t==null?void 0:t.address],queryFn:()=>J(t.address,t.identity,{first:200}).then(l=>l.payouts),enabled:x,staleTime:6e4}),ht=y.useMemo(()=>Rt(V),[V]),{data:ut}=It(x);if(!t)return e.jsxs(rt,{children:[e.jsx(j,{name:"clock",size:40,color:s.colors.muted2}),e.jsx(ot,{children:d("activity.signInTitle")}),e.jsx("p",{className:"muted",children:d("activity.signInBody")})]});const Q=Wt(Ot({purchases:p?m.items:[],sales:x?g.items:[],creditOrders:p?f.items:[],manaPurchases:p?b.items:[],rate:ut}),a),pt=p&&(m.isLoading||f.isLoading||b.isLoading)||x&&g.isLoading,X=p&&(m.isFetchingNextPage||f.isFetchingNextPage||b.isFetchingNextPage)||x&&g.isFetchingNextPage,xt=p&&(m.hasNextPage||f.hasNextPage||b.hasNextPage)||x&&g.hasNextPage;function mt(){p&&m.hasNextPage&&m.fetchNextPage(),p&&f.hasNextPage&&f.fetchNextPage(),p&&b.hasNextPage&&b.fetchNextPage(),x&&g.hasNextPage&&g.fetchNextPage()}function gt(l){if(n(l),!r)return;const k=new URLSearchParams(i);k.delete("view"),c(k,{replace:!0})}function ft(){const l=new URLSearchParams(i);l.set("view",D),c(l,{replace:!0})}return e.jsxs(Ut,{"data-view":r?D:"feed",children:[e.jsx(Kt,{children:e.jsx(Vt,{children:d("nav.activity")})}),e.jsxs(Qt,{role:"tablist","aria-label":d("nav.activity"),children:[ne.map(l=>e.jsx(st,{type:"button",role:"tab","aria-selected":!r&&a===l,"data-active":!r&&a===l,"data-testid":`activity-filter-${l}`,onClick:()=>gt(l),children:d(`activity.filter.${l}`)},l)),o?e.jsxs(Xt,{type:"button",role:"tab","aria-selected":r,"data-active":r,"data-testid":"activity-filter-migrate","aria-label":u?d("activity.migrate.chipAria",{count:u}):void 0,onClick:ft,children:[d("activity.migrate.chip"),u?e.jsx(Zt,{"data-testid":"activity-migrate-count","aria-hidden":!0,children:u}):null]}):null]}),r?e.jsx(y.Suspense,{fallback:e.jsx(Jt,{"aria-busy":"true"}),children:e.jsx(se,{})}):pt?e.jsx(Y,{children:Array.from({length:5}).map((l,k)=>e.jsx(tt,{},k))}):Q.length===0?e.jsx(he,{filter:a}):e.jsxs(e.Fragment,{children:[e.jsxs(Y,{children:[Q.map(l=>l.kind==="purchase"?e.jsx(oe,{order:l.order},l.id):l.kind==="credit"?e.jsx(le,{order:l.order},l.id):l.kind==="mana-purchase"?e.jsx(ce,{sale:l.sale},l.id):e.jsx(de,{sale:l.sale,payout:_t(ht,l.sale)},l.id)),X?e.jsx(tt,{}):null]}),e.jsx(St,{hasNextPage:xt,isFetching:X,onLoadMore:mt})]})]})}export{$e as Activity};
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-Crv-6FMt.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-DehiWSvs.js";import{s as u}from"./index-BK186nFF.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_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{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k as st,bc as ot,bd as rt,aq as it,b as at,s,t,l as Ue,b1 as lt,y as ct,av as be,d as n,w as dt,I as R,x as M,bK as se,b0 as pt,U as ee,bg as ht,bf as xt,v as He,b3 as Oe,m as Ge,n as mt,ae as ft,ag as Ie,ah as V,ax as ut,bH as gt}from"./index-Crv-6FMt.js";import{g as bt,h as yt,i as wt,j as jt,k as vt,C as $t,l as Ct,o as kt,m as St,n as Et,M as Rt,u as _t,E as Tt,v as zt,p as It,q as At,r as Nt,s as Pt,t as Mt}from"./Assets.styles-BbXlLgvi.js";import{S as Ae,R as Wt,F as Bt,e as Ft}from"./categories-CR3vurm1.js";import{L as Lt}from"./LoadMore-DtVUvE_o.js";import{u as Ut}from"./useInfiniteGrid-Bxq6R4at.js";import{E as Ht}from"./ErrorNotice-D5yaB3Z_.js";import{d as Ot}from"./dcl-schemas-Dr9BTjb7.js";import{s as Gt,G as Dt,w as qt,S as Vt}from"./buy-gasless-Bn8YCJUN.js";import{s as Kt}from"./buy-D7FZvFCT.js";import{j as Zt}from"./trade-encoding-Bf-VP6DB.js";import{f as Jt}from"./errors-BQIZnT7j.js";import{J as Qt,C as Xt,B as ye}from"./ethers-CtNGBird.js";import{n as Yt}from"./Tooltip-BrPrB_FF.js";import{G as en}from"./grid.styles-B9VqL4eC.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-B8y7ie6D.js";import"./sendMetaTransaction-B7Mr50I5.js";function K(o){const i=o.source??"item",h=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${h}`}const H="100000000000000000000",De=2,te=15,tn=/^[a-zA-Z0-9]+$/;function Ne(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:tn.test(i)?i.length<De?{ok:!1,reason:"too-short"}:i.length>te?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function nn(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,te)}const sn=["function available(string _subdomain) view returns (bool)"],Pe={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function on(){return U.chainId===Number(Ot.ChainId.MATIC_MAINNET)?Pe.mainnet:Pe.sepolia}async function rn(o,i={}){var l;const{rpc:h,address:c}=on(),d=new Qt(h),a=new Xt(c,sn,d);console.info(`[names] availability check → DCLRegistrar(${c}).available("${o}") on ${h}`);const m=await a.available(o);if((l=i.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${m}`),m?"available":"taken"}const an="https://app.across.to/api";class we extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function ln(o){return it(H,o)}async function cn(o,i,h={}){var l;const c=h.chainId??U.chainId,d=h.provider??"across",a=`${U.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${c}&provider=${d}`,m=await at(a,{method:"GET",identity:o,metadata:{}});if(!m.ok){let p;try{p=(l=await m.json())==null?void 0:l.code}catch{}throw p==="ROUTE_COST_TOO_HIGH"?new we:new Error(`fetchNameCreditRoute ${m.status}`)}return m.json()}function dn(o,i){const h=ye.from(o.availableAmount),d=ye.from(H).sub(h);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Zt(o.id)}],creditsSignatures:[o.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:H}}async function pn(o,i={}){const h=an,c=i.intervalMs??1e4,d=i.maxAttempts??60;let a={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let m=0;m<d;m++){try{const l=await fetch(`${h}/deposit/status?originChainId=137&depositTxHash=${o}`);if(l.ok){const p=await l.json(),x=(p.status??"pending").toLowerCase(),y=p.fillTx??p.fillTxnRef??null,f=p.actionsSucceeded!==!1;if(x==="filled")return{status:"filled",destinationTxHash:y,actionsSucceeded:f};if(x==="refunded"||x==="expired")return{status:x,destinationTxHash:null,actionsSucceeded:!1};a={status:"pending",destinationTxHash:y,actionsSucceeded:f}}}catch{}m<d-1&&await new Promise(l=>setTimeout(l,c))}return a}async function hn(o){const{name:i,identity:h,signer:c}=o,d=o.chainId??U.chainId,a=o.provider??"across",m=(o.beneficiary??await c.getAddress()).toLowerCase();let l=null,p=!1;console.info("[names] register start",{name:i,buyer:m,chainId:d,provider:a});try{const x=await st(d),y=ln(x);console.info("[names] step 1/6 sized reservation",{usdCents:y,manaRate:x});const f=await cn(h,i,{chainId:d,provider:a});console.info("[names] step 2/6 route fetched",{target:f.externalCall.target,selector:f.externalCall.selector,provider:f.provider,quoteId:f.quoteId});const C=await ot(h,y);if(l=C.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:C.credit.id,maxCreditedValue:C.maxCreditedValue}),ye.from(C.maxCreditedValue).lt(H))throw new Error("Credit under-sized for the name price");const k=dn(C.credit,f);let g;try{g=await Gt({chainId:d,buyer:m,signer:c,args:k})}catch(b){if(!(b instanceof Dt))throw b;g=await Kt(d,k,c)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:g}),await qt(g),p=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:g}),a==="across"){const b=await pn(g,o.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:g};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:g,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:g}}catch(x){if(console.error("[names] register failed — raw error:",x,{name:i,buyer:m,originConfirmed:p}),x instanceof Vt)return{status:"pending",originTxHash:x.txHash};if(l&&!p&&await rt(h,[l]).catch(()=>{}),x instanceof we)throw x;const y=new Error(Jt(x,"Couldn't register the name. Please try again.",{sale:!0}));throw y.cause=x,y}}const xn=s.div`
1
+ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k as st,bc as rt,bd as ot,aq as it,b as at,s,t,l as Ue,b1 as lt,y as ct,av as be,d as n,w as dt,I as R,x as M,bK as se,b0 as pt,U as ee,bg as ht,bf as xt,v as He,b3 as Oe,m as Ge,n as mt,ae as ft,ag as Ie,ah as V,ax as ut,bH as gt}from"./index-BK186nFF.js";import{g as bt,h as yt,i as wt,j as jt,k as vt,C as $t,l as Ct,o as kt,m as St,n as Et,M as Rt,u as _t,E as Tt,v as zt,p as It,q as At,r as Nt,s as Pt,t as Mt}from"./Assets.styles-DTCjJoYe.js";import{S as Ae,R as Wt,F as Bt,e as Ft}from"./categories-Cewsb8Ef.js";import{L as Lt}from"./LoadMore-69ZjUVQ9.js";import{u as Ut}from"./useInfiniteGrid-CdPr9eL9.js";import{E as Ht}from"./ErrorNotice-vGKBE1Hj.js";import{d as Ot}from"./dcl-schemas-Dr9BTjb7.js";import{s as Gt,G as Dt,w as qt,S as Vt}from"./buy-gasless-B2bIFHQv.js";import{s as Kt}from"./buy-PW05H439.js";import{j as Zt}from"./trade-encoding-C7Wym_F1.js";import{f as Jt}from"./errors-Dyyi7AS1.js";import{J as Qt,C as Xt,B as ye}from"./ethers-CtNGBird.js";import{n as Yt}from"./Tooltip-Dh4BuhSJ.js";import{G as en}from"./grid.styles-Bb1W1YT9.js";import"./sentry-973sfbO9.js";import"./intl-CBcMB1D2.js";import"./authorizations-BWL7qlKm.js";import"./sendMetaTransaction-X4QLi3Hi.js";function K(r){const i=r.source??"item",h=r.tradeId||`${r.contractAddress}-${r.tokenId??r.itemId??""}`;return`${i}:${h}`}const H="100000000000000000000",De=2,te=15,tn=/^[a-zA-Z0-9]+$/;function Ne(r){const i=r.trim();return i.length===0?{ok:!1,reason:"empty"}:tn.test(i)?i.length<De?{ok:!1,reason:"too-short"}:i.length>te?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function nn(r){return r.replace(/[^a-zA-Z0-9]/g,"").slice(0,te)}const sn=["function available(string _subdomain) view returns (bool)"],Pe={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function rn(){return U.chainId===Number(Ot.ChainId.MATIC_MAINNET)?Pe.mainnet:Pe.sepolia}async function on(r,i={}){var l;const{rpc:h,address:c}=rn(),d=new Qt(h),a=new Xt(c,sn,d);console.info(`[names] availability check → DCLRegistrar(${c}).available("${r}") on ${h}`);const m=await a.available(r);if((l=i.signal)!=null&&l.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${r}" available=${m}`),m?"available":"taken"}const an="https://app.across.to/api";class we extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function ln(r){return it(H,r)}async function cn(r,i,h={}){var l;const c=h.chainId??U.chainId,d=h.provider??"across",a=`${U.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${c}&provider=${d}`,m=await at(a,{method:"GET",identity:r,metadata:{}});if(!m.ok){let p;try{p=(l=await m.json())==null?void 0:l.code}catch{}throw p==="ROUTE_COST_TOO_HIGH"?new we:new Error(`fetchNameCreditRoute ${m.status}`)}return m.json()}function dn(r,i){const h=ye.from(r.availableAmount),d=ye.from(H).sub(h);return{credits:[{value:r.amount,expiresAt:Number(r.expiresAt),salt:Zt(r.id)}],creditsSignatures:[r.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:d.isNegative()?"0":d.toString(),maxCreditedValue:H}}async function pn(r,i={}){const h=an,c=i.intervalMs??1e4,d=i.maxAttempts??60;let a={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let m=0;m<d;m++){try{const l=await fetch(`${h}/deposit/status?originChainId=137&depositTxHash=${r}`);if(l.ok){const p=await l.json(),x=(p.status??"pending").toLowerCase(),y=p.fillTx??p.fillTxnRef??null,f=p.actionsSucceeded!==!1;if(x==="filled")return{status:"filled",destinationTxHash:y,actionsSucceeded:f};if(x==="refunded"||x==="expired")return{status:x,destinationTxHash:null,actionsSucceeded:!1};a={status:"pending",destinationTxHash:y,actionsSucceeded:f}}}catch{}m<d-1&&await new Promise(l=>setTimeout(l,c))}return a}async function hn(r){const{name:i,identity:h,signer:c}=r,d=r.chainId??U.chainId,a=r.provider??"across",m=(r.beneficiary??await c.getAddress()).toLowerCase();let l=null,p=!1;console.info("[names] register start",{name:i,buyer:m,chainId:d,provider:a});try{const x=await st(d),y=ln(x);console.info("[names] step 1/6 sized reservation",{usdCents:y,manaRate:x});const f=await cn(h,i,{chainId:d,provider:a});console.info("[names] step 2/6 route fetched",{target:f.externalCall.target,selector:f.externalCall.selector,provider:f.provider,quoteId:f.quoteId});const C=await rt(h,y);if(l=C.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:C.credit.id,maxCreditedValue:C.maxCreditedValue}),ye.from(C.maxCreditedValue).lt(H))throw new Error("Credit under-sized for the name price");const k=dn(C.credit,f);let g;try{g=await Gt({chainId:d,buyer:m,signer:c,args:k})}catch(b){if(!(b instanceof Dt))throw b;g=await Kt(d,k,c)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:g}),await qt(g),p=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:g}),a==="across"){const b=await pn(g,r.acrossPoll);if(console.info("[names] step 6/6 across status",b),b.status==="pending")return{status:"pending",originTxHash:g};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:g,destinationTxHash:b.destinationTxHash}}return{status:"pending",originTxHash:g}}catch(x){if(console.error("[names] register failed — raw error:",x,{name:i,buyer:m,originConfirmed:p}),x instanceof Vt)return{status:"pending",originTxHash:x.txHash};if(l&&!p&&await ot(h,[l]).catch(()=>{}),x instanceof we)throw x;const y=new Error(Jt(x,"Couldn't register the name. Please try again.",{sale:!0}));throw y.cause=x,y}}const xn=s.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -20,12 +20,12 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k a
20
20
  ${t.media.maxWidth("mobile")} {
21
21
  padding: 16px;
22
22
  }
23
- `,oe=s.div`
23
+ `,re=s.div`
24
24
  display: flex;
25
25
  align-items: flex-start;
26
26
  justify-content: space-between;
27
27
  gap: 12px;
28
- `,re=s.h2`
28
+ `,oe=s.h2`
29
29
  margin: 0;
30
30
  font-family: ${t.font.sans};
31
31
  font-weight: 700;
@@ -379,7 +379,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k a
379
379
  color: ${t.colors.accent};
380
380
  }
381
381
  }
382
- `;function In({name:o,priceCredits:i,onClose:h}){const{session:c}=Ue(),{data:d,isError:a}=lt(c),m=ct(),l=Le(),[p,x]=u.useState("confirm"),[y,f]=u.useState(""),[C,k]=u.useState(null),g=u.useRef(!1),b=y.trim().toLowerCase()===o.toLowerCase(),S=p==="completing",v=i!=null?be(i):"—",_=i==null,E=d==null?void 0:d.credits,W=i!=null&&E!=null?i-E:0,$=W>0,T=_?n("names.priceUnavailable"):$?n("names.insufficientCredits",{credits:be(W)}):null;u.useEffect(()=>{const w=G=>{G.key==="Escape"&&!S&&h()};document.addEventListener("keydown",w);const O=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",w),document.body.style.overflow=O}},[S,h]);async function I(){if(!(!c||!b||_||$||g.current)){g.current=!0,x("completing"),k(null);try{const w=await hn({name:o,identity:c.identity,signer:c.signer});ee("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null,settlement:w.status}),m.invalidateQueries({queryKey:["usd-balance"]}),m.invalidateQueries({queryKey:["my-assets"]}),x(w.status==="registered"?"success":"pending")}catch(w){ee(xt(w)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:ht(w),purchase_type:"name"}),k(w instanceof we?n("names.errorRouteCost"):(w==null?void 0:w.message)||n("names.errorGeneric")),x("error")}finally{g.current=!1}}}const A=p!=="success"&&p!=="pending",N=dt(c==null?void 0:c.providerType);return e.jsx(xn,{onClick:S?void 0:h,role:"presentation",children:e.jsxs(mn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:w=>w.stopPropagation(),children:[A&&e.jsxs(e.Fragment,{children:[e.jsxs(oe,{children:[e.jsx(re,{children:p==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ie,{onClick:h,disabled:S,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{})]}),(p==="confirm"||p==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(me,{children:[e.jsx(M,{}),v]})]}),p==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(fe,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),e.jsx(Me,{onClick:()=>x("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(fn,{children:[e.jsx(un,{children:n("names.confirmTitle")}),e.jsx(gn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${An(o)}</b>`})}}),e.jsxs(bn,{children:[e.jsx(yn,{"aria-hidden":!0,children:"@"}),e.jsx(wn,{value:y,onChange:w=>f(w.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(y.length,8)}ch`}}),e.jsx(jn,{children:".dcl.eth"})]})]}),T?e.jsxs(fe,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:T})]}):null,e.jsx(Me,{onClick:()=>void I(),disabled:!b||!c||_||$,children:n("names.buyCta")})]})]}),p==="completing"&&e.jsxs(vn,{children:[e.jsx($n,{src:pt,alt:"",width:56,height:56}),e.jsx(Cn,{children:N?n("names.confirming"):n("names.completing")}),e.jsxs(kn,{children:[e.jsx(Sn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(En,{children:"1/1"})]})]}),p==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(oe,{children:[e.jsx(re,{children:n("names.pendingHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(fe,{"data-tone":"info",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(me,{children:[e.jsx(M,{}),v]})]}),e.jsx(We,{children:e.jsx(Be,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")})})]}),p==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(oe,{children:[e.jsx(re,{children:n("names.successHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(Rn,{children:[e.jsx(_n,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(Tn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(me,{children:[e.jsx(M,{}),v]})]}),e.jsxs(We,{children:[e.jsx(Be,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")}),e.jsx(zn,{href:U.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function An(o){return o.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Nn="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/identity-B4DXDuJP.webp",Pn="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/world-B-9aPlxu.webp",Mn="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/invite-BfwIhP2C.webp",Wn="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/governance-DnazlIjy.webp",Bn=s.div`
382
+ `;function In({name:r,priceCredits:i,onClose:h}){const{session:c}=Ue(),{data:d,isError:a}=lt(c),m=ct(),l=Le(),[p,x]=u.useState("confirm"),[y,f]=u.useState(""),[C,k]=u.useState(null),g=u.useRef(!1),b=y.trim().toLowerCase()===r.toLowerCase(),S=p==="completing",v=i!=null?be(i):"—",_=i==null,E=d==null?void 0:d.credits,W=i!=null&&E!=null?i-E:0,$=W>0,T=_?n("names.priceUnavailable"):$?n("names.insufficientCredits",{credits:be(W)}):null;u.useEffect(()=>{const w=G=>{G.key==="Escape"&&!S&&h()};document.addEventListener("keydown",w);const O=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",w),document.body.style.overflow=O}},[S,h]);async function I(){if(!(!c||!b||_||$||g.current)){g.current=!0,x("completing"),k(null);try{const w=await hn({name:r,identity:c.identity,signer:c.signer});ee("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null,settlement:w.status}),m.invalidateQueries({queryKey:["usd-balance"]}),m.invalidateQueries({queryKey:["my-assets"]}),x(w.status==="registered"?"success":"pending")}catch(w){ee(xt(w)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:ht(w),purchase_type:"name"}),k(w instanceof we?n("names.errorRouteCost"):(w==null?void 0:w.message)||n("names.errorGeneric")),x("error")}finally{g.current=!1}}}const A=p!=="success"&&p!=="pending",N=dt(c==null?void 0:c.providerType);return e.jsx(xn,{onClick:S?void 0:h,role:"presentation",children:e.jsxs(mn,{role:"dialog","aria-modal":"true","aria-label":n("names.buyTitle"),onClick:w=>w.stopPropagation(),children:[A&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:p==="error"?n("names.errorTitle"):n("names.buyTitle")}),e.jsx(ie,{onClick:h,disabled:S,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{})]}),(p==="confirm"||p==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs(ce,{children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(me,{children:[e.jsx(M,{}),v]})]}),p==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(fe,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:C})]}),e.jsx(Me,{onClick:()=>x("confirm"),children:n("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(fn,{children:[e.jsx(un,{children:n("names.confirmTitle")}),e.jsx(gn,{dangerouslySetInnerHTML:{__html:n("names.confirmBody",{name:`<b>@${An(r)}</b>`})}}),e.jsxs(bn,{children:[e.jsx(yn,{"aria-hidden":!0,children:"@"}),e.jsx(wn,{value:y,onChange:w=>f(w.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":n("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(y.length,8)}ch`}}),e.jsx(jn,{children:".dcl.eth"})]})]}),T?e.jsxs(fe,{"data-tone":"info","data-testid":"name-blocked-reason",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:T})]}):null,e.jsx(Me,{onClick:()=>void I(),disabled:!b||!c||_||$,children:n("names.buyCta")})]})]}),p==="completing"&&e.jsxs(vn,{children:[e.jsx($n,{src:pt,alt:"",width:56,height:56}),e.jsx(Cn,{children:N?n("names.confirming"):n("names.completing")}),e.jsxs(kn,{children:[e.jsx(Sn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(En,{children:"1/1"})]})]}),p==="pending"&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:n("names.pendingHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(fe,{"data-tone":"info",children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsxs("span",{children:[e.jsx("b",{children:n("names.pendingBannerBold")})," ",n("names.pendingBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(me,{children:[e.jsx(M,{}),v]})]}),e.jsx(We,{children:e.jsx(Be,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")})})]}),p==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(oe,{children:n("names.successHeaderTitle")}),e.jsx(ie,{onClick:h,"aria-label":n("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(ae,{children:[n("names.myCreditsBalance")," ",e.jsx(M,{})," ",se(d,a)]}),e.jsx(le,{}),e.jsxs(Rn,{children:[e.jsx(_n,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(Tn,{children:[e.jsx("b",{children:n("names.successBannerBold")})," ",n("names.successBannerRest")]})]}),e.jsxs(ce,{style:{marginTop:20},children:[e.jsx(de,{"aria-hidden":!0,children:"@"}),e.jsxs(pe,{children:[e.jsxs(he,{children:[r,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(xe,{children:n("names.subtitle")})]}),e.jsxs(me,{children:[e.jsx(M,{}),v]})]}),e.jsxs(We,{children:[e.jsx(Be,{onClick:()=>{h(),l("/my-items")},children:n("names.myItems")}),e.jsx(zn,{href:U.profileUrl,target:"_blank",rel:"noopener noreferrer",children:n("names.assignToAvatar")})]})]})]})})}function An(r){return r.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Nn="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/identity-B4DXDuJP.webp",Pn="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/world-B-9aPlxu.webp",Mn="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/invite-BfwIhP2C.webp",Wn="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/governance-DnazlIjy.webp",Bn=s.div`
383
383
  width: 100%;
384
384
  min-width: 0;
385
385
  `,Fn=s.nav`
@@ -479,11 +479,11 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k a
479
479
  gap: 8px;
480
480
  padding: 8px 8px 8px 16px;
481
481
  background: ${t.colors.softWhite};
482
- border: 1.5px solid ${({invalid:o})=>o?t.colors.dclRed:t.colors.line};
482
+ border: 1.5px solid ${({invalid:r})=>r?t.colors.dclRed:t.colors.line};
483
483
  border-radius: 20px;
484
484
 
485
485
  &:focus-within {
486
- border-color: ${({invalid:o})=>o?t.colors.dclRed:t.colors.magenta};
486
+ border-color: ${({invalid:r})=>r?t.colors.dclRed:t.colors.magenta};
487
487
  }
488
488
 
489
489
  ${t.media.maxWidth("mobile")} {
@@ -639,7 +639,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k a
639
639
  ${t.media.maxWidth("mobile")} {
640
640
  display: none;
641
641
  }
642
- `,os=s(qe)`
642
+ `,rs=s(qe)`
643
643
  display: none;
644
644
 
645
645
  ${t.media.maxWidth("mobile")} {
@@ -648,7 +648,7 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k a
648
648
  height: 48px;
649
649
  border-radius: 12px;
650
650
  }
651
- `,rs=s.span`
651
+ `,os=s.span`
652
652
  display: inline-flex;
653
653
  align-items: center;
654
654
  gap: 4px;
@@ -669,8 +669,8 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k a
669
669
  font-weight: 500;
670
670
  text-align: left;
671
671
 
672
- background: ${({tone:o})=>o==="error"?"rgba(255, 45, 85, 0.12)":o==="ok"?"rgba(30, 166, 114, 0.14)":"rgba(255,255,255,0.14)"};
673
- color: ${({tone:o})=>o==="error"?t.colors.dclRed:o==="ok"?"#0f7a4f":"#ecebed"};
672
+ background: ${({tone:r})=>r==="error"?"rgba(255, 45, 85, 0.12)":r==="ok"?"rgba(30, 166, 114, 0.14)":"rgba(255,255,255,0.14)"};
673
+ color: ${({tone:r})=>r==="error"?t.colors.dclRed:r==="ok"?"#0f7a4f":"#ecebed"};
674
674
 
675
675
  .ico {
676
676
  width: 16px;
@@ -739,7 +739,8 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k a
739
739
  overflow: hidden;
740
740
  `,J=s.img`
741
741
  display: block;
742
- width: 100%;
742
+ width: calc(100% + 0.5px);
743
+ margin: -0.25px -0.25px 0;
743
744
  aspect-ratio: 388 / 235;
744
745
  object-fit: cover;
745
746
  `,Q=s.div`
@@ -797,4 +798,4 @@ import{d as Le,r as u,j as e,e as nt}from"./react-DehiWSvs.js";import{c as U,k a
797
798
  clip: rect(0, 0, 0, 0);
798
799
  white-space: nowrap;
799
800
  border: 0;
800
- `,xs="https://docs.decentraland.org/creator/worlds/about/",ms="https://governance.decentraland.org";function fs(o){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(o)}`}function us({onBack:o}){He({title:n("seo.names.title"),description:n("seo.names.description")});const{session:i,signIn:h}=Ue(),{data:c}=Oe(),d=c?Ge(H,c):null,[a,m]=u.useState(""),[l,p]=u.useState("idle"),[x,y]=u.useState(!1),f=u.useRef(null),[C,k]=u.useState(void 0);u.useLayoutEffect(()=>{f.current&&k(f.current.offsetWidth)},[a]),u.useEffect(()=>{if(!Ne(a).ok){p(a.length===0?"idle":"invalid");return}p("checking");const E=new AbortController,W=setTimeout(()=>{(async()=>{try{const $=await rn(a,{signal:E.signal});p($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;p("error")}})()},400);return()=>{clearTimeout(W),E.abort()}},[a]);const g=Ne(a),b=g.ok&&(l==="available"||l==="error");function S(){if(b){if(!i){h();return}y(!0)}}const v=e.jsxs(e.Fragment,{children:[n("names.claim"),d!=null?e.jsxs(rs,{children:[e.jsx(M,{}),be(d)]}):null]});return e.jsxs(Bn,{"data-testid":"names-page",children:[e.jsxs(Fn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Ln,{onClick:o,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Un,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{children:[e.jsx(Dn,{children:n("names.heroTitle")}),e.jsx(qn,{children:n("names.heroSubtitle")})]}),e.jsxs(Vn,{children:[e.jsxs(Kn,{children:[e.jsxs(Zn,{invalid:l==="taken",children:[e.jsxs(Yn,{children:[e.jsx(es,{"aria-hidden":!0,children:"@"}),e.jsx(ts,{value:a,onChange:_=>m(nn(_.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:te,style:{width:C!=null?`${C}px`:void 0}}),e.jsx(Jn,{ref:f,"aria-hidden":!0,children:a||n("names.inputPlaceholder")}),e.jsx(ns,{children:n("names.suffix")})]}),a.length>0?e.jsxs(ss,{"aria-hidden":!0,children:[a.length,"/",te]}):null,e.jsx(qe,{onClick:S,disabled:!b,"data-testid":"names-claim",children:v})]}),l==="taken"?e.jsxs(Qn,{role:"status","data-testid":"names-taken",children:[e.jsx(R,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Xn,{href:fs(a),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(R,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(os,{onClick:S,disabled:!b,children:v}),l==="checking"?e.jsx(ue,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):l==="error"?e.jsx(ue,{tone:"muted",role:"status",children:n("names.checkError")}):l==="invalid"&&!g.ok&&g.reason==="too-short"?e.jsx(ue,{tone:"muted",role:"status",children:n("names.tooShort",{min:De})}):null,e.jsx(hs,{role:"status","aria-live":"polite",children:l==="available"?n("names.available",{name:a}):""})]})]}),e.jsxs(is,{children:[e.jsxs(as,{children:[e.jsx(ls,{children:n("names.whyTitle")}),e.jsx(cs,{children:n("names.whyIntro")})]}),e.jsxs(ds,{children:[e.jsxs(Z,{children:[e.jsx(J,{src:Nn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why1Title")}),e.jsx(Y,{children:n("names.why1")})]})]}),e.jsxs(Z,{children:[e.jsx(J,{src:Pn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why2Title")}),e.jsxs(Y,{children:[n("names.why2")," ",e.jsx(ps,{children:n("names.why2Address")})]}),e.jsxs(Fe,{href:xs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(J,{src:Mn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why3Title")}),e.jsx(Y,{children:n("names.why3")})]})]}),e.jsxs(Z,{children:[e.jsx(J,{src:Wn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why4Title")}),e.jsx(Y,{children:n("names.why4")}),e.jsxs(Fe,{href:ms,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),x?e.jsx(In,{name:a,priceCredits:d,onClose:()=>y(!1)}):null]})}const gs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ge=48,bs=["all","on_sale","not_for_sale"];function Bs(){const[o,i]=nt(),h=Le(),c=(o.get("q")??"").trim().toLowerCase(),d=(o.get("q")??"").trim();He({title:d?n("seo.collectibles.searchTitle",{query:d}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const a=o.get("category")??(c?"all":"wearable"),m=o.get("status"),l=m&&bs.includes(m)?m:"on_sale",p=(r,j)=>i(z=>{const ne=new URLSearchParams(z);return j==null?ne.delete(r):ne.set(r,j),ne},{replace:!0}),[x,y]=u.useState(null),[f,C]=u.useState([]),[k,g]=u.useState(""),[b,S]=u.useState(""),[v,_]=u.useState(!1),[E,W]=u.useState("newest"),[$,T]=u.useState(!1);u.useEffect(()=>{if(!$)return;const r=z=>{z.key==="Escape"&&T(!1)};document.addEventListener("keydown",r);const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=j}},[$]);const I=l==="on_sale",A=k&&!Number.isNaN(Number(k))?Number(k):void 0,N=b&&!Number.isNaN(Number(b))?Number(b):void 0,w=mt(),O=x?Ft[x]:void 0,G=(Ae.find(r=>r.key===E)??Ae[0]).server,je={category:a,rarities:f.length?f:void 0,wearableCategories:O,minPriceCredits:A,maxPriceCredits:N,search:c||void 0,sortBy:G,isSmart:v||void 0,onSale:!0,listingType:w?void 0:"primary"},ve={category:a,rarities:f.length?f:void 0,wearableCategories:O,search:c||void 0,sortBy:G,isWearableSmart:v||void 0,isOnSale:l==="not_for_sale"?!1:void 0},{items:F,total:$e,isLoading:P,isPlaceholderData:B,error:Ce,hasNextPage:Ve,isFetchingNextPage:ke,isFetchNextPageError:Ke,fetchNextPage:Ze}=Ut(I?["shop-items",je]:["catalog-items",ve],r=>I?ut({...je,first:ge,skip:r}):gt({...ve,first:ge,skip:r}),{enabled:a!=="names"}),D=$e,{data:Se,isError:Je,isPending:Qe}=Oe(),Xe=r=>Se&&r.manaWei?Ge(r.manaWei,Se):null,Ye=I&&Qe&&F.some(r=>r.source==="legacy"),Ee=P||B||Ye,et=P?15:Math.min(Math.max(F.length,1),ge),Re=u.useRef(null);u.useEffect(()=>{P||B||!c||Re.current===c||(Re.current=c,ee("Shop Searched",{query:c,result_count:D}))},[c,P,B,D]);const q=u.useRef("__init__");u.useEffect(()=>{if(P||B)return;const r=JSON.stringify({category:a,subCategory:x,rarities:f,min:A,max:N,sort:E,status:l,smart:v});if(q.current==="__init__"||q.current===r){q.current=r;return}q.current=r,ee("Shop Applied Filter",{filters:{category:a,sub_category:x,rarities:f,min_price_credits:A??null,max_price_credits:N??null,status:l,smart:v,sort:E},result_count:D})},[a,x,f,A,N,E,l,v,P,B,D]);function _e(r){p("category",r),y(null)}function Te(r){p("status",r==="on_sale"?null:r)}function ze(r){C(j=>j.includes(r)?j.filter(z=>z!==r):[...j,r])}function tt(){i(r=>{const j=new URLSearchParams(r);return j.delete("category"),j.delete("status"),j},{replace:!0}),y(null),C([]),g(""),S(""),_(!1)}const L=[];(A!=null||N!=null)&&L.push({key:"price",label:n("filter.price"),onRemove:()=>{g(""),S("")}});for(const r of Wt)f.includes(r)&&L.push({key:`rarity-${r}`,label:ft(r),onRemove:()=>ze(r)});return v&&L.push({key:"smart",label:n("filter.smart"),onRemove:()=>_(!1)}),l!=="on_sale"&&L.push({key:"status",label:l==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>Te("on_sale")}),e.jsxs(bt,{"data-testid":"browse",children:[a!=="names"&&e.jsxs(e.Fragment,{children:[$?e.jsx(yt,{onClick:()=>T(!1),"aria-hidden":!0}):null,e.jsxs(wt,{"data-open":$||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(jt,{children:[e.jsx(vt,{children:n("assets.filters")}),e.jsx($t,{onClick:()=>T(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(Ct,{children:e.jsx(kt,{category:a,subCategory:x,onCategory:_e,onSub:y,priceMin:k,priceMax:b,onPriceMin:g,onPriceMax:S,rarities:f,onToggleRarity:ze,status:l,onStatus:Te,smart:v,onSmart:_})}),e.jsx(St,{children:e.jsx(Et,{type:"button",onClick:()=>T(!1),children:n("assets.showItems")})})]})]}),e.jsx(Rt,{children:a==="names"?e.jsx(us,{onBack:()=>_e("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Bt,{sort:E,onSort:W,total:$e,loading:P||B,query:c,onOpenFilters:()=>T(!0),chips:L,onClearChips:tt}),Je&&I&&F.some(r=>r.source==="legacy")?e.jsx(_t,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,Ce?e.jsx(Ht,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ee&&F.length===0&&!Ce?e.jsxs(Tt,{"data-testid":"browse-empty",children:[e.jsx(zt,{src:gs,alt:""}),e.jsxs(It,{children:[e.jsx(At,{children:n("assets.empty.title")}),e.jsx(Nt,{children:d?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:d}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(Pt,{children:e.jsx(Mt,{type:"button",onClick:()=>h("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(en,{"data-testid":"grid",children:Ee?e.jsx(Ie,{count:et}):e.jsxs(e.Fragment,{children:[F.map(r=>{if(!I)return e.jsx(V,{item:r,mode:"view"},K(r));const j=r;if(j.source!=="legacy")return e.jsx(V,{item:r},K(r));const z=Xe(j);return z==null?e.jsx(V,{item:r,mode:"view"},K(r)):e.jsx(V,{item:{...j,priceCredits:z}},K(r))}),ke?e.jsx(Ie,{count:6}):null]})}),e.jsx(Lt,{hasNextPage:Ve,isFetching:ke,isError:Ke,onLoadMore:()=>void Ze()})]})]})})]})}export{Bs as Assets};
801
+ `,xs="https://docs.decentraland.org/creator/worlds/about/",ms="https://governance.decentraland.org";function fs(r){const i=typeof window<"u"?window.location.hostname:"";return`${i.endsWith("decentraland.org")?"https://decentraland.org":i.endsWith("decentraland.today")?"https://decentraland.today":"https://decentraland.zone"}/marketplace/names/browse?search=${encodeURIComponent(r)}`}function us({onBack:r}){He({title:n("seo.names.title"),description:n("seo.names.description")});const{session:i,signIn:h}=Ue(),{data:c}=Oe(),d=c?Ge(H,c):null,[a,m]=u.useState(""),[l,p]=u.useState("idle"),[x,y]=u.useState(!1),f=u.useRef(null),[C,k]=u.useState(void 0);u.useLayoutEffect(()=>{f.current&&k(f.current.offsetWidth)},[a]),u.useEffect(()=>{if(!Ne(a).ok){p(a.length===0?"idle":"invalid");return}p("checking");const E=new AbortController,W=setTimeout(()=>{(async()=>{try{const $=await on(a,{signal:E.signal});p($)}catch($){if(($==null?void 0:$.name)==="AbortError")return;p("error")}})()},400);return()=>{clearTimeout(W),E.abort()}},[a]);const g=Ne(a),b=g.ok&&(l==="available"||l==="error");function S(){if(b){if(!i){h();return}y(!0)}}const v=e.jsxs(e.Fragment,{children:[n("names.claim"),d!=null?e.jsxs(os,{children:[e.jsx(M,{}),be(d)]}):null]});return e.jsxs(Bn,{"data-testid":"names-page",children:[e.jsxs(Fn,{"aria-label":n("names.breadcrumbAria"),children:[e.jsx(Ln,{onClick:r,children:n("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Un,{children:n("names.breadcrumbCurrent")})]}),e.jsxs(Hn,{children:[e.jsxs(On,{children:[e.jsxs(Gn,{children:[e.jsx(Dn,{children:n("names.heroTitle")}),e.jsx(qn,{children:n("names.heroSubtitle")})]}),e.jsxs(Vn,{children:[e.jsxs(Kn,{children:[e.jsxs(Zn,{invalid:l==="taken",children:[e.jsxs(Yn,{children:[e.jsx(es,{"aria-hidden":!0,children:"@"}),e.jsx(ts,{value:a,onChange:_=>m(nn(_.target.value)),placeholder:n("names.inputPlaceholder"),"aria-label":n("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:te,style:{width:C!=null?`${C}px`:void 0}}),e.jsx(Jn,{ref:f,"aria-hidden":!0,children:a||n("names.inputPlaceholder")}),e.jsx(ns,{children:n("names.suffix")})]}),a.length>0?e.jsxs(ss,{"aria-hidden":!0,children:[a.length,"/",te]}):null,e.jsx(qe,{onClick:S,disabled:!b,"data-testid":"names-claim",children:v})]}),l==="taken"?e.jsxs(Qn,{role:"status","data-testid":"names-taken",children:[e.jsx(R,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:n("names.taken")}),e.jsxs(Xn,{href:fs(a),target:"_blank",rel:"noopener noreferrer",children:[n("names.takenMakeOffer"),e.jsx(R,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(rs,{onClick:S,disabled:!b,children:v}),l==="checking"?e.jsx(ue,{tone:"muted",role:"status","data-testid":"names-checking",children:n("names.checking")}):l==="error"?e.jsx(ue,{tone:"muted",role:"status",children:n("names.checkError")}):l==="invalid"&&!g.ok&&g.reason==="too-short"?e.jsx(ue,{tone:"muted",role:"status",children:n("names.tooShort",{min:De})}):null,e.jsx(hs,{role:"status","aria-live":"polite",children:l==="available"?n("names.available",{name:a}):""})]})]}),e.jsxs(is,{children:[e.jsxs(as,{children:[e.jsx(ls,{children:n("names.whyTitle")}),e.jsx(cs,{children:n("names.whyIntro")})]}),e.jsxs(ds,{children:[e.jsxs(Z,{children:[e.jsx(J,{src:Nn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why1Title")}),e.jsx(Y,{children:n("names.why1")})]})]}),e.jsxs(Z,{children:[e.jsx(J,{src:Pn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why2Title")}),e.jsxs(Y,{children:[n("names.why2")," ",e.jsx(ps,{children:n("names.why2Address")})]}),e.jsxs(Fe,{href:xs,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(Z,{children:[e.jsx(J,{src:Mn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why3Title")}),e.jsx(Y,{children:n("names.why3")})]})]}),e.jsxs(Z,{children:[e.jsx(J,{src:Wn,alt:""}),e.jsxs(Q,{children:[e.jsx(X,{children:n("names.why4Title")}),e.jsx(Y,{children:n("names.why4")}),e.jsxs(Fe,{href:ms,target:"_blank",rel:"noopener noreferrer",children:[n("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),x?e.jsx(In,{name:a,priceCredits:d,onClose:()=>y(!1)}):null]})}const gs="data:image/svg+xml,%3csvg%20width='101'%20height='101'%20viewBox='0%200%20101%20101'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.4493%2040.9855L30.7394%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M30.7391%2040.9855L42.449%2052.6954'%20stroke='%23FF5A57'%20stroke-width='3.15625'%20stroke-linecap='round'/%3e%3cpath%20d='M36.2621%2071.0604C29.6047%2071.0604%2023.9709%2068.7542%2019.3608%2064.1416C14.7507%2059.5291%2012.4445%2053.8953%2012.442%2047.2404C12.4396%2040.5854%2014.7459%2034.9516%2019.3608%2030.3391C23.9758%2025.7266%2029.6096%2023.4203%2036.2621%2023.4203C42.9146%2023.4203%2048.5496%2025.7266%2053.167%2030.3391C57.7844%2034.9516%2060.0895%2040.5854%2060.0822%2047.2404C60.0822%2049.9277%2059.6546%2052.4624%2058.7995%2054.8445C57.9445%2057.2265%2056.784%2059.3336%2055.3181%2061.1659L75.84%2081.6878C76.5119%2082.3597%2076.8478%2083.2148%2076.8478%2084.2531C76.8478%2085.2914%2076.5119%2086.1465%2075.84%2086.8183C75.1682%2087.4902%2074.3131%2087.8261%2073.2748%2087.8261C72.2365%2087.8261%2071.3814%2087.4902%2070.7096%2086.8183L50.1877%2066.2964C48.3554%2067.7623%2046.2482%2068.9227%2043.8662%2069.7778C41.4842%2070.6329%2038.9495%2071.0604%2036.2621%2071.0604ZM36.2621%2063.7312C40.8429%2063.7312%2044.7372%2062.1285%2047.9449%2058.9232C51.1527%2055.7179%2052.7554%2051.8236%2052.7529%2047.2404C52.7505%2042.6571%2051.1478%2038.7641%2047.9449%2035.5612C44.742%2032.3583%2040.8478%2030.7544%2036.2621%2030.7495C31.6764%2030.7447%2027.7834%2032.3485%2024.5829%2035.5612C21.3825%2038.7739%2019.7786%2042.6669%2019.7713%2047.2404C19.764%2051.8138%2021.3678%2055.7081%2024.5829%2058.9232C27.798%2062.1383%2031.6911%2063.7409%2036.2621%2063.7312Z'%20fill='url(%23paint0_linear_search_empty)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_search_empty'%20x1='10.4127'%20y1='55.6273'%20x2='124.009'%20y2='44.925'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF2D55'/%3e%3cstop%20offset='1'%20stop-color='%23FFBC5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",ge=48,bs=["all","on_sale","not_for_sale"];function Bs(){const[r,i]=nt(),h=Le(),c=(r.get("q")??"").trim().toLowerCase(),d=(r.get("q")??"").trim();He({title:d?n("seo.collectibles.searchTitle",{query:d}):n("seo.collectibles.title"),description:n("seo.collectibles.description")});const a=r.get("category")??(c?"all":"wearable"),m=r.get("status"),l=m&&bs.includes(m)?m:"on_sale",p=(o,j)=>i(z=>{const ne=new URLSearchParams(z);return j==null?ne.delete(o):ne.set(o,j),ne},{replace:!0}),[x,y]=u.useState(null),[f,C]=u.useState([]),[k,g]=u.useState(""),[b,S]=u.useState(""),[v,_]=u.useState(!1),[E,W]=u.useState("newest"),[$,T]=u.useState(!1);u.useEffect(()=>{if(!$)return;const o=z=>{z.key==="Escape"&&T(!1)};document.addEventListener("keydown",o);const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",o),document.body.style.overflow=j}},[$]);const I=l==="on_sale",A=k&&!Number.isNaN(Number(k))?Number(k):void 0,N=b&&!Number.isNaN(Number(b))?Number(b):void 0,w=mt(),O=x?Ft[x]:void 0,G=(Ae.find(o=>o.key===E)??Ae[0]).server,je={category:a,rarities:f.length?f:void 0,wearableCategories:O,minPriceCredits:A,maxPriceCredits:N,search:c||void 0,sortBy:G,isSmart:v||void 0,onSale:!0,listingType:w?void 0:"primary"},ve={category:a,rarities:f.length?f:void 0,wearableCategories:O,search:c||void 0,sortBy:G,isWearableSmart:v||void 0,isOnSale:l==="not_for_sale"?!1:void 0},{items:F,total:$e,isLoading:P,isPlaceholderData:B,error:Ce,hasNextPage:Ve,isFetchingNextPage:ke,isFetchNextPageError:Ke,fetchNextPage:Ze}=Ut(I?["shop-items",je]:["catalog-items",ve],o=>I?ut({...je,first:ge,skip:o}):gt({...ve,first:ge,skip:o}),{enabled:a!=="names"}),D=$e,{data:Se,isError:Je,isPending:Qe}=Oe(),Xe=o=>Se&&o.manaWei?Ge(o.manaWei,Se):null,Ye=I&&Qe&&F.some(o=>o.source==="legacy"),Ee=P||B||Ye,et=P?15:Math.min(Math.max(F.length,1),ge),Re=u.useRef(null);u.useEffect(()=>{P||B||!c||Re.current===c||(Re.current=c,ee("Shop Searched",{query:c,result_count:D}))},[c,P,B,D]);const q=u.useRef("__init__");u.useEffect(()=>{if(P||B)return;const o=JSON.stringify({category:a,subCategory:x,rarities:f,min:A,max:N,sort:E,status:l,smart:v});if(q.current==="__init__"||q.current===o){q.current=o;return}q.current=o,ee("Shop Applied Filter",{filters:{category:a,sub_category:x,rarities:f,min_price_credits:A??null,max_price_credits:N??null,status:l,smart:v,sort:E},result_count:D})},[a,x,f,A,N,E,l,v,P,B,D]);function _e(o){p("category",o),y(null)}function Te(o){p("status",o==="on_sale"?null:o)}function ze(o){C(j=>j.includes(o)?j.filter(z=>z!==o):[...j,o])}function tt(){i(o=>{const j=new URLSearchParams(o);return j.delete("category"),j.delete("status"),j},{replace:!0}),y(null),C([]),g(""),S(""),_(!1)}const L=[];(A!=null||N!=null)&&L.push({key:"price",label:n("filter.price"),onRemove:()=>{g(""),S("")}});for(const o of Wt)f.includes(o)&&L.push({key:`rarity-${o}`,label:ft(o),onRemove:()=>ze(o)});return v&&L.push({key:"smart",label:n("filter.smart"),onRemove:()=>_(!1)}),l!=="on_sale"&&L.push({key:"status",label:l==="all"?n("filter.statusAll"):n("filter.notForSale"),onRemove:()=>Te("on_sale")}),e.jsxs(bt,{"data-testid":"browse",children:[a!=="names"&&e.jsxs(e.Fragment,{children:[$?e.jsx(yt,{onClick:()=>T(!1),"aria-hidden":!0}):null,e.jsxs(wt,{"data-open":$||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(jt,{children:[e.jsx(vt,{children:n("assets.filters")}),e.jsx($t,{onClick:()=>T(!1),"aria-label":n("assets.closeFilters"),children:"✕"})]}),e.jsx(Ct,{children:e.jsx(kt,{category:a,subCategory:x,onCategory:_e,onSub:y,priceMin:k,priceMax:b,onPriceMin:g,onPriceMax:S,rarities:f,onToggleRarity:ze,status:l,onStatus:Te,smart:v,onSmart:_})}),e.jsx(St,{children:e.jsx(Et,{type:"button",onClick:()=>T(!1),children:n("assets.showItems")})})]})]}),e.jsx(Rt,{children:a==="names"?e.jsx(us,{onBack:()=>_e("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Bt,{sort:E,onSort:W,total:$e,loading:P||B,query:c,onOpenFilters:()=>T(!0),chips:L,onClearChips:tt}),Je&&I&&F.some(o=>o.source==="legacy")?e.jsx(_t,{"data-variant":"warn",children:n("assets.marketUnavailable")}):null,Ce?e.jsx(Ht,{message:n("assets.loadError"),testId:"browse-error"}):null,!Ee&&F.length===0&&!Ce?e.jsxs(Tt,{"data-testid":"browse-empty",children:[e.jsx(zt,{src:gs,alt:""}),e.jsxs(It,{children:[e.jsx(At,{children:n("assets.empty.title")}),e.jsx(Nt,{children:d?e.jsxs(e.Fragment,{children:[n("assets.empty.searchBefore"),e.jsx("b",{children:d}),n("assets.empty.searchAfter")]}):n("assets.empty.filters")})]}),e.jsx(Pt,{children:e.jsx(Mt,{type:"button",onClick:()=>h("/overview"),children:n("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(en,{"data-testid":"grid",children:Ee?e.jsx(Ie,{count:et}):e.jsxs(e.Fragment,{children:[F.map(o=>{if(!I)return e.jsx(V,{item:o,mode:"view"},K(o));const j=o;if(j.source!=="legacy")return e.jsx(V,{item:o},K(o));const z=Xe(j);return z==null?e.jsx(V,{item:o,mode:"view"},K(o)):e.jsx(V,{item:{...j,priceCredits:z}},K(o))}),ke?e.jsx(Ie,{count:6}):null]})}),e.jsx(Lt,{hasNextPage:Ve,isFetching:ke,isError:Ke,onLoadMore:()=>void Ze()})]})]})})]})}export{Bs as Assets};
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-DehiWSvs.js";import{R as T,C as se,a as ae,b as re}from"./categories-CR3vurm1.js";import{n as c,T as le}from"./Tooltip-BrPrB_FF.js";import{t as e,s as o,I as g,d as s,ae as ce,e as v}from"./index-Crv-6FMt.js";const de=o.div`
1
+ import{r as $,j as t}from"./react-DehiWSvs.js";import{R as T,C as se,a as ae,b as re}from"./categories-Cewsb8Ef.js";import{n as c,T as le}from"./Tooltip-Dh4BuhSJ.js";import{t as e,s as o,I as g,d as s,ae as ce,e as v}from"./index-BK186nFF.js";const de=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-DehiWSvs.js";import{s as n,B as P,t as a,q as D,v as W,d as e,l as G,w as O,I as b,x as B,o as w,y as K,c as Q,z as H,A,D as X,E as Z,F as E}from"./index-Crv-6FMt.js";import{d as J,f as U,b as V,h as Y,s as tt,a as it}from"./authorizations-B8y7ie6D.js";import{f as et}from"./builder-DC4gtQTj.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-BQIZnT7j.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-B7Mr50I5.js";const nt=D`
1
+ import{j as i,L as _,r as F}from"./react-DehiWSvs.js";import{s as n,B as P,t as a,q as D,v as W,d as e,l as G,w as O,I as b,x as B,o as w,y as K,c as Q,z as H,A,D as X,E as Z,F as E}from"./index-BK186nFF.js";import{d as J,f as U,b as V,h as Y,s as tt,a as it}from"./authorizations-BWL7qlKm.js";import{f as et}from"./builder-I4cDZvRJ.js";import{m as ot}from"./mana-matic-C4e1sNO3.js";import{f as at}from"./errors-Dyyi7AS1.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-X4QLi3Hi.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,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as ue,s as i,d as a,av as le,b0 as sa,au as na,I as H,x as Mt,ad as Qe,v as ia,Q as N,af as dt,l as ra,n as oa,o as ca,b1 as da,y as la,b2 as ua,b3 as ha,b4 as pa,b5 as lt,b6 as ga,b7 as xa,w as ma,b8 as ut,U as G,b9 as ht,ba as fa,D as ae,k as ya,c as pt,bb as ba,e as va,bc as gt,bd as _e,be as ye,bf as be,bg as xt,g as ve,a as wa,C as We,bh as Ca}from"./index-Crv-6FMt.js";import{M as ja,S as ka,C as Sa,H as $a,a as Ma,T as Ta,X as Ia,b as Pa,B as za,c as Aa,d as mt,e as Ea,f as ke,P as Tt,m as qa,g as Ba,h as Ra,i as _a,j as It,k as Se,L as Wa,l as Fa,n as ft,o as yt,W as La,p as Ua,q as Ka,A as Qa,r as Na,s as Ha,t as Oa,u as Va,v as Ga,w as Da,x as Ya,y as Ja,z as Xa,D as Za,E as es,F as ts,G as as,I as ss,J as ns,K as Fe,N as is,O as rs,Q as os,R as cs,U as bt,V as vt,Y as ds,Z as ls,_ as us}from"./CollectionCarousel-DGelHypZ.js";import{j as hs,k as ps,a as gs,n as xs,i as ms,A as fs}from"./authorizations-B8y7ie6D.js";import{g as ys,b as Le}from"./buy-D7FZvFCT.js";import{b as bs,w as vs,S as wt,G as ws}from"./buy-gasless-Bn8YCJUN.js";import{u as Cs,M as js,R as we,r as ks,c as Ss,p as Ct}from"./useCreditPacks-RMR6xQ90.js";import{i as $s,a as Ms}from"./errors-BQIZnT7j.js";import{E as Ts}from"./ErrorNotice-D5yaB3Z_.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-Bf-VP6DB.js";import"./sendMetaTransaction-B7Mr50I5.js";const{colors:se,radius:Is}=ue,Ps=i.div`
1
+ import{j as e,L as $e,r as P,d as ta,b as aa}from"./react-DehiWSvs.js";import{t as ue,s as i,d as a,av as le,b0 as sa,au as na,I as H,x as Mt,ad as Qe,v as ia,Q as N,af as dt,l as ra,n as oa,o as ca,b1 as da,y as la,b2 as ua,b3 as ha,b4 as pa,b5 as lt,b6 as ga,b7 as xa,w as ma,b8 as ut,U as G,b9 as ht,ba as fa,D as ae,k as ya,c as pt,bb as ba,e as va,bc as gt,bd as _e,be as ye,bf as be,bg as xt,g as ve,a as wa,C as We,bh as Ca}from"./index-BK186nFF.js";import{M as ja,S as ka,C as Sa,H as $a,a as Ma,T as Ta,X as Ia,b as Pa,B as za,c as Aa,d as mt,e as Ea,f as ke,P as Tt,m as qa,g as Ba,h as Ra,i as _a,j as It,k as Se,L as Wa,l as Fa,n as ft,o as yt,W as La,p as Ua,q as Ka,A as Qa,r as Na,s as Ha,t as Oa,u as Va,v as Ga,w as Da,x as Ya,y as Ja,z as Xa,D as Za,E as es,F as ts,G as as,I as ss,J as ns,K as Fe,N as is,O as rs,Q as os,R as cs,U as bt,V as vt,Y as ds,Z as ls,_ as us}from"./CollectionCarousel-DbpF1h5w.js";import{j as hs,k as ps,a as gs,n as xs,i as ms,A as fs}from"./authorizations-BWL7qlKm.js";import{g as ys,b as Le}from"./buy-PW05H439.js";import{b as bs,w as vs,S as wt,G as ws}from"./buy-gasless-B2bIFHQv.js";import{u as Cs,M as js,R as we,r as ks,c as Ss,p as Ct}from"./useCreditPacks-CHzNSIvf.js";import{i as $s,a as Ms}from"./errors-Dyyi7AS1.js";import{E as Ts}from"./ErrorNotice-vGKBE1Hj.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./trade-encoding-C7Wym_F1.js";import"./sendMetaTransaction-X4QLi3Hi.js";const{colors:se,radius:Is}=ue,Ps=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,d as ta,b as aa}from"./react-DehiWSvs.js";import{t
58
58
  font-weight: 700;
59
59
  color: ${se.text};
60
60
  }
61
- `,Bs="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/buy-error-22UunaPC.png";function Rs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(ja,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ka,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Sa,{"data-tall":Y||void 0,children:[e.jsxs($a,{children:[e.jsxs(Ma,{children:[e.jsx(Ta,{children:D}),!W&&e.jsx(Ia,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Pa,{})})]}),e.jsxs(za,{children:[e.jsx(Aa,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(mt,{}),e.jsx(Ea,{children:le(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(mt,{}),le(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=qa(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Ws,{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(ke,{children:[e.jsxs(Ba,{"data-testid":"buy-error",children:[e.jsx(Ra,{src:Bs,alt:"",width:64,height:80}),e.jsxs(_a,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=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(ke,{"data-processing":!0,children:[e.jsx(Wa,{src:sa,alt:"",width:61,height:61}),e.jsx(Fa,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}function Ws({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(La,{"data-testid":"nofunds-warning",children:[e.jsx(Ua,{}),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(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Qa,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ha,{children:[e.jsxs("div",{children:[e.jsxs(Oa,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(Es,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Va,{address:n.item.creator}):null]}),e.jsxs(Ga,{children:[e.jsx(Da,{}),e.jsx("span",{children:le(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ya,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ja,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Xa,{}),e.jsx(Za,{children:le(n.credits)}),e.jsxs(es,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(ts,{children:[e.jsxs(as,{children:[e.jsx(ss,{}),e.jsx("span",{children:le((A==null?void 0:A.credits)??0)})]}),e.jsxs(ns,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=ue,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=i.div`
61
+ `,Bs="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/buy-error-22UunaPC.png";function Rs(o){const{phase:l,balanceCredits:I,onClose:z}=o,W=l==="processing",D=l==="error"?a("cartCheckout.errorTitle"):l==="nofunds"?a("cartCheckout.titleNoFunds"):l==="choose"?a("buyModal.choosePayment"):a("cartCheckout.titleBuy"),Y=l==="processing";return e.jsxs(ja,{role:"dialog","aria-modal":"true","aria-label":a("cartCheckout.dialogAria"),children:[e.jsx(ka,{onClick:W?void 0:z,"aria-hidden":!0}),e.jsxs(Sa,{"data-tall":Y||void 0,children:[e.jsxs($a,{children:[e.jsxs(Ma,{children:[e.jsx(Ta,{children:D}),!W&&e.jsx(Ia,{onClick:z,"aria-label":a("buyModal.close"),children:e.jsx(Pa,{})})]}),e.jsxs(za,{children:[e.jsx(Aa,{children:l==="nofunds"?a("buyModal.dclBalance"):a("buyModal.myCreditsBalance")}),e.jsx(mt,{}),e.jsx(Ea,{children:le(I)})]})]}),l==="choose"&&e.jsxs(ke,{children:[e.jsxs(qs,{children:[e.jsx("span",{children:a("cart.purchaseSummary")}),e.jsxs("strong",{children:[e.jsx(mt,{}),le(o.totalCredits??0)]})]}),e.jsx(Tt,{options:o.options??[],totalCents:o.totalCents??0,onPay:o.onPay??(()=>{}),rateNote:(()=>{const A=qa(o.totalCents??0,o.totalManaWei??0n);return A!=null?a("buyModal.manaRate",{mana:A.toLocaleString("en",{maximumFractionDigits:2})}):null})()})]}),l==="processing"&&e.jsx(_s,{stage:o.stage??"reserving",step:o.step??1,total:o.total??1,isSelfCustody:!!o.isSelfCustody,signatures:o.signatures}),l==="nofunds"&&e.jsx(Ws,{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(ke,{children:[e.jsxs(Ba,{"data-testid":"buy-error",children:[e.jsx(Ra,{src:Bs,alt:"",width:64,height:80}),e.jsxs(_a,{children:[e.jsx("b",{children:a("cartCheckout.errorHeadline")})," ",o.message??a("cartCheckout.errorBody")]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:z,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"purple",onClick:o.onRetry??z,children:a("cartCheckout.tryAgain")})]})]})]})]})}function _s({stage:o,step:l,total:I,isSelfCustody:z,signatures:W}){const D=o==="reserving",Y=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(ke,{"data-processing":!0,children:[e.jsx(Wa,{src:sa,alt:"",width:61,height:61}),e.jsx(Fa,{children:ne}),D?e.jsxs(Ps,{children:[e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{"data-step":!0,style:{width:`${Y}%`}})}),I>1?e.jsxs(zs,{children:[l,"/",I]}):null]}):e.jsx(ft,{"aria-hidden":!0,children:e.jsx(yt,{})})]})}function Ws({lines:o,shortfallCredits:l,packs:I,selectedPack:z,onSelectPack:W,onBuyPacks:D,onCancel:Y}){const A=I.find(n=>n.id===z),ne=o.reduce((n,L)=>n+(L.quantity??1),0);return e.jsxs(ke,{children:[e.jsxs(La,{"data-testid":"nofunds-warning",children:[e.jsx(Ua,{}),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(As,{children:o.map(n=>{const L=n.quantity??1;return e.jsxs(Qa,{children:[e.jsx(Na,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsxs(Ha,{children:[e.jsxs("div",{children:[e.jsxs(Oa,{title:n.item.name,children:[n.item.name||a("buyModal.itemFallback"),L>1?e.jsx(Es,{children:a("cartCheckout.qty",{count:L})}):null]}),n.item.creator?e.jsx(Va,{address:n.item.creator}):null]}),e.jsxs(Ga,{children:[e.jsx(Da,{}),e.jsx("span",{children:le(n.priceCredits*L)})]})]})]},n.item.id)})}),e.jsx(Ya,{children:I.map(n=>{const L=n.id===z;return e.jsxs(Ja,{"data-testid":"credit-pack","data-on":L||void 0,onClick:()=>W(n.id),children:[e.jsx(Xa,{}),e.jsx(Za,{children:le(n.credits)}),e.jsxs(es,{children:["($",n.usd.toFixed(2),")"]})]},n.id)})}),e.jsxs(ts,{children:[e.jsxs(as,{children:[e.jsx(ss,{}),e.jsx("span",{children:le((A==null?void 0:A.credits)??0)})]}),e.jsxs(ns,{children:["$",((A==null?void 0:A.usd)??0).toFixed(2)]})]}),e.jsxs(It,{children:[e.jsx(Se,{"data-variant":"outline",onClick:Y,children:a("buyModal.cancel")}),e.jsx(Se,{"data-variant":"gradient",onClick:D,children:a("buyModal.buy")})]})]})}const{colors:r,gradients:Pt,radius:Z}=ue,zt="@media (max-width: 1080px)",T="@media (max-width: 880px)",jt=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{a9 as N,aa as U,ab as o,ac as n,ad as D,q as M}from"./index-Crv-6FMt.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-Dzrazxv9.js";function K(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 a=44,q=M(P||(P=l`
1
+ import{a9 as N,aa as U,ab as o,ac as n,ad as D,q as M}from"./index-BK186nFF.js";import{r as w,j as g}from"./react-DehiWSvs.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-ChZXKlM3.js";function K(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 a=44,q=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,u as Z,d as J}from"./react-DehiWSvs.js";import{t as b,s,bi as ee,X as te,z as T,bj as ae,bk as oe,I as ie,d as a,c as re,D as se,o as ne,v as ce,e as le,ag as F,ah as de,bl as pe,bm as xe}from"./index-Crv-6FMt.js";import{E as me}from"./ErrorNotice-D5yaB3Z_.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-qZQe9tC2.js";import{S as L,C as je,F as ye,c as we,P as Ce,d as $e,H as ke,e as Ne}from"./categories-CR3vurm1.js";import{L as Pe}from"./LoadMore-DtVUvE_o.js";import{u as Se}from"./useInfiniteGrid-Bxq6R4at.js";import{G as Ae}from"./grid.styles-B9VqL4eC.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Me=s.section`
1
+ import{j as e,r as h,u as Z,d as J}from"./react-DehiWSvs.js";import{t as b,s,bi as ee,X as te,z as T,bj as ae,bk as oe,I as ie,d as a,c as re,D as se,o as ne,v as ce,e as le,ag as F,ah as de,bl as pe,bm as xe}from"./index-BK186nFF.js";import{E as me}from"./ErrorNotice-vGKBE1Hj.js";import{d as he,P as ue,C as ge,a as be,b as fe,A as ve}from"./collectionPage.styles-Dd3m9ofi.js";import{S as L,C as je,F as ye,c as we,P as Ce,d as $e,H as ke,e as Ne}from"./categories-Cewsb8Ef.js";import{L as Pe}from"./LoadMore-69ZjUVQ9.js";import{u as Se}from"./useInfiniteGrid-CdPr9eL9.js";import{G as Ae}from"./grid.styles-Bb1W1YT9.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const Me=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-DehiWSvs.js";import{s as e,t as o,d as f,x as k,av as j,bC as C,e as G,q as Y,I as Q,D as X,g as W,C as B,a as Z,a1 as q,c3 as F,ah as J}from"./index-Crv-6FMt.js";import{s as ee,i as U,A as H,g as D,r as te,m as ne,c as ae,M as ie,e as oe}from"./authorizations-B8y7ie6D.js";import{i as se}from"./errors-BQIZnT7j.js";import{E as re}from"./ErrorNotice-D5yaB3Z_.js";import{a as ce}from"./buy-D7FZvFCT.js";import{g as de,a as le}from"./trade-encoding-Bf-VP6DB.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-B7Mr50I5.js";import{I as xe,C as ge}from"./ethers-CtNGBird.js";const R="shop:resume_after_signin",fe=900*1e3;function dt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function lt(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}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 pt(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 ht(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 M(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ut(a,n){return a.options.find(i=>i.method===n)??null}function xt(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-DehiWSvs.js";import{s as e,t as o,d as f,x as k,av as j,bC as C,e as G,q as Y,I as Q,D as X,g as W,C as B,a as Z,a1 as q,c3 as F,ah as J}from"./index-BK186nFF.js";import{s as ee,i as U,A as H,g as D,r as te,m as ne,c as ae,M as ie,e as oe}from"./authorizations-BWL7qlKm.js";import{i as se}from"./errors-Dyyi7AS1.js";import{E as re}from"./ErrorNotice-vGKBE1Hj.js";import{a as ce}from"./buy-PW05H439.js";import{g as de,a as le}from"./trade-encoding-C7Wym_F1.js";import{s as pe,M as he,E as ue}from"./sendMetaTransaction-X4QLi3Hi.js";import{I as xe,C as ge}from"./ethers-CtNGBird.js";const R="shop:resume_after_signin",fe=900*1e3;function dt(a){try{sessionStorage.setItem(R,JSON.stringify({...a,at:Date.now()}))}catch{}}function lt(a){let n;try{n=sessionStorage.getItem(R)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(R)}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 pt(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 ht(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 M(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function ut(a,n){return a.options.find(i=>i.method===n)??null}function xt(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,4 +1,4 @@
1
- import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";import{t as he,H as Ae,K as Y,J as Z,s,bD as Ie,au as Re,bE as ze,d as o,bF as Be,bG as ee,B as Me,ad as me,X as xe,bi as _e,l as Te,z as ue,bp as We,bj as De,bk as Ge,I as te,c as Oe,v as Ke,o as He,ae as Ue,ag as A,ah as oe,bH as re,bI as qe}from"./index-Crv-6FMt.js";import{d as Ve,P as Je,C as Qe,a as Xe,b as Ye,A as Ze,c as et,e as tt}from"./collectionPage.styles-qZQe9tC2.js";import{g as ot,h as rt,i as it,j as st,k as at,C as nt,l as lt,o as ct,m as dt,n as ht,M as mt,E as xt,p as ut,q as pt,r as gt,s as ft,t as bt}from"./Assets.styles-BbXlLgvi.js";import{S as ie,R as wt,F as jt,e as vt}from"./categories-CR3vurm1.js";import{L as se}from"./LoadMore-DtVUvE_o.js";import{u as ae}from"./useInfiniteGrid-Bxq6R4at.js";import{E as W}from"./ErrorNotice-D5yaB3Z_.js";import{G as ne}from"./grid.styles-B9VqL4eC.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./Tooltip-BrPrB_FF.js";function yt(r){const{gridLoading:i,gridError:a,gridCount:n,baselinePending:h,baselineError:l,baselineCount:m}=r;return i?"skeletons":a?"error":n>0?"items":h?"skeletons":l?"error":m===0?"no-creations":"filters"}const{colors:b,radius:pe,media:Ct}=he,kt=s.article`
1
+ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";import{t as he,H as Ae,K as Y,J as Z,s,bD as Ie,au as Re,bE as ze,d as o,bF as Be,bG as ee,B as Me,ad as me,X as xe,bi as _e,l as Te,z as ue,bp as We,bj as De,bk as Ge,I as te,c as Oe,v as Ke,o as He,ae as Ue,ag as A,ah as oe,bH as re,bI as qe}from"./index-BK186nFF.js";import{d as Ve,P as Je,C as Qe,a as Xe,b as Ye,A as Ze,c as et,e as tt}from"./collectionPage.styles-Dd3m9ofi.js";import{g as ot,h as rt,i as it,j as st,k as at,C as nt,l as lt,o as ct,m as dt,n as ht,M as mt,E as xt,p as ut,q as pt,r as gt,s as ft,t as bt}from"./Assets.styles-DTCjJoYe.js";import{S as ie,R as wt,F as jt,e as vt}from"./categories-Cewsb8Ef.js";import{L as se}from"./LoadMore-69ZjUVQ9.js";import{u as ae}from"./useInfiniteGrid-CdPr9eL9.js";import{E as W}from"./ErrorNotice-vGKBE1Hj.js";import{G as ne}from"./grid.styles-Bb1W1YT9.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./Tooltip-Dh4BuhSJ.js";function yt(r){const{gridLoading:i,gridError:a,gridCount:n,baselinePending:h,baselineError:l,baselineCount:m}=r;return i?"skeletons":a?"error":n>0?"items":h?"skeletons":l?"error":m===0?"no-creations":"filters"}const{colors:b,radius:pe,media:Ct}=he,kt=s.article`
2
2
  height: 300px;
3
3
  background: ${b.bg};
4
4
  border-radius: ${pe.card};
@@ -1 +1 @@
1
- import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-Crv-6FMt.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-DehiWSvs.js";import{I as i}from"./index-BK186nFF.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-pXBowcJX.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-7ZmsD7pV.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-CtKoZGPW.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-D6jXV4v6.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{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,q as B,v as ge,d as r,e as p,l as ue,y as fe,U as u,b7 as me,D as N,bg as U,I as ie,b0 as D,x as re,bJ as H}from"./index-Crv-6FMt.js";import{R as K}from"./resume-buy-Bf0zIH7y.js";import{u as be,a as we,R as ye,c as ke,i as Ce,b as ve}from"./useCreditPacks-RMR6xQ90.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const P="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/pack-stacks-D-V2jSHW.webp",oe="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/pack-chest-BX_j84xW.webp",$e="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/credit-coin-CmcTCd5i.webp",je="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",Se="https://cdn.decentraland.org/@dcl/shop/0.6.1-30950057562.commit-5ce11cd/_assets/packs-backdrop-BcXiUPeP.webp",O="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Pe=i.div`
1
+ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,q as B,v as ge,d as r,e as p,l as ue,y as fe,U as u,b7 as me,D as N,bg as U,I as ie,b0 as D,x as re,bJ as H}from"./index-BK186nFF.js";import{R as K}from"./resume-buy-Bf0zIH7y.js";import{u as be,a as we,R as ye,c as ke,i as Ce,b as ve}from"./useCreditPacks-CHzNSIvf.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const P="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/pack-stacks-D-V2jSHW.webp",oe="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/pack-chest-BX_j84xW.webp",$e="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/credit-coin-CmcTCd5i.webp",je="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",Se="https://cdn.decentraland.org/@dcl/shop/0.6.1-30951438943.commit-29cea86/_assets/packs-backdrop-BcXiUPeP.webp",O="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Pe=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 24px;
@@ -1,4 +1,4 @@
1
- import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-BI1kDThq.js";import{d as g,r as v}from"./index-7ZmsD7pV.js";import{C as c}from"./ConstantsUtil-Di3dRDAF.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-pXBowcJX.js";import{au as y}from"./NetworkUtil-EoWQDMpU.js";const b=g`
1
+ import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-BMDKd-Ff.js";import{d as g,r as v}from"./index-D6jXV4v6.js";import{C as c}from"./ConstantsUtil-Di3dRDAF.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-CtKoZGPW.js";import{au as y}from"./NetworkUtil-EoWQDMpU.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;