@dcl/shop 0.1.0-30565861644.commit-86fa62d → 0.1.0-30631213700.commit-6a36b1d

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 (177) hide show
  1. package/assets/{Activity-YIu0M1Kf.js → Activity-9H_Nw9g2.js} +1 -1
  2. package/assets/{AnimatedBackground-BrxVl8X0.js → AnimatedBackground-Dl4OPt3I.js} +1 -1
  3. package/assets/{Assets-Dwlho6_C.js → Assets-hIVs4QX5.js} +7 -7
  4. package/assets/{Assets.styles-CfTWTkg9.js → Assets.styles-DxYgoIuy.js} +1 -1
  5. package/assets/{Authorizations-BMPo5lsC.js → Authorizations-7_r3pX8t.js} +1 -1
  6. package/assets/Cart-D0AduPfq.js +695 -0
  7. package/assets/{CircularProgress-BrgD7rFE.js → CircularProgress-4d3-DQmu.js} +1 -1
  8. package/assets/{Collection-wJlJYfNj.js → Collection-jJGlXbaI.js} +1 -1
  9. package/assets/{CollectionCarousel-Bns794gp.js → CollectionCarousel-Cf-VTi1F.js} +1 -1
  10. package/assets/{Creator-Bz4Ol9VJ.js → Creator-C7C3IC7M.js} +2 -2
  11. package/assets/{ErrorNotice-Z0D8os9s.js → ErrorNotice-B02EvdVc.js} +1 -1
  12. package/assets/{ExchangeController-DWJqUlaQ.js → ExchangeController-_mEAVfMP.js} +1 -1
  13. package/assets/{GetCredits-DaqSIDEt.js → GetCredits-DATwdND2.js} +97 -60
  14. package/assets/{HelpersUtil-BmEt66tk.js → HelpersUtil-B9-8MjrT.js} +1 -1
  15. package/assets/{ImportListings-tR_OXub1.js → ImportListings-Brvy0E2Q.js} +8 -8
  16. package/assets/{ItemDetail-n9hpow28.js → ItemDetail-iIR1rraN.js} +3 -3
  17. package/assets/{LoadMore-DI4Wyn-C.js → LoadMore-DmJy1HhZ.js} +1 -1
  18. package/assets/{MenuList-CYC3zRYf.js → MenuList-DaaQcK3Y.js} +1 -1
  19. package/assets/{MyAssets-CRBhFPGQ.js → MyAssets-BNDWBTvM.js} +1 -1
  20. package/assets/{MyFavorites-B6grtRZj.js → MyFavorites-DsQJRQwa.js} +1 -1
  21. package/assets/{NotFound-0L1xj8db.js → NotFound-DLfA3_kx.js} +1 -1
  22. package/assets/{NotificationsBell-B5Q9EIqa.js → NotificationsBell-BFpFtQ3R.js} +1 -1
  23. package/assets/{StoreSettings-CUyzwheq.js → StoreSettings-g8hG7Zop.js} +1 -1
  24. package/assets/Success-MIHHTcKK.js +276 -0
  25. package/assets/{SwapController-CP6wYtUi.js → SwapController-DR2uYAaA.js} +1 -1
  26. package/assets/{Tooltip-BbHzoPIy.js → Tooltip-gJZXgo0b.js} +1 -1
  27. package/assets/{TradeService-CbR5e6j8.js → TradeService-CY3xpaff.js} +1 -1
  28. package/assets/{W3MFrameProviderSingleton-CAciSeGb.js → W3MFrameProviderSingleton-DSb_b_EZ.js} +3 -3
  29. package/assets/{WebCryptoP256-BJObUJ75.js → WebCryptoP256-CDxnkGVK.js} +1 -1
  30. package/assets/{authorizations-B6wWjXdQ.js → authorizations-BPcNtN-P.js} +1 -1
  31. package/assets/{basic-PrtqXBMx.js → basic-C5_ZcnK9.js} +1 -1
  32. package/assets/{biconomy-CXoNqd-Z.js → biconomy-CvmOdG97.js} +1 -1
  33. package/assets/{browseLayout.styles-B_NNL83E.js → browseLayout.styles-C9FVX_ZJ.js} +5 -5
  34. package/assets/{builder-DJzcrQAM.js → builder-CLIpwOL9.js} +1 -1
  35. package/assets/buy-B0vN0t4_.js +1 -0
  36. package/assets/{buy-gasless-CmOMFX1L.js → buy-gasless-DLYP_J55.js} +1 -1
  37. package/assets/{categories-CX6i4K78.js → categories-Ci0NfrXM.js} +1 -1
  38. package/assets/{ccip-Dd-dexDO.js → ccip-EF1o04u9.js} +1 -1
  39. package/assets/{ccip-w3FPfxqw.js → ccip-kyPwi4iD.js} +1 -1
  40. package/assets/{clsx-BRGjhjlu.js → clsx-CPW1aX4x.js} +2 -2
  41. package/assets/{controller-DwX-jKZc.js → controller-DC-xBsw3.js} +2 -2
  42. package/assets/{core-D2eU58P9.js → core-C7azBZfw.js} +4 -4
  43. package/assets/{createSvgIcon-BVcvIe2E.js → createSvgIcon-CE_QXUPt.js} +3 -3
  44. package/assets/{custom-C8kunAUg.js → custom-C7OSaKW8.js} +1 -1
  45. package/assets/{data-capture-5SXe7x0r.js → data-capture-D90UA04z.js} +1 -1
  46. package/assets/{email-Bn0Sv8j4.js → email-DdwMxrSu.js} +1 -1
  47. package/assets/{embedded-wallet-C8c_78Uv.js → embedded-wallet-CLTSxZAJ.js} +1 -1
  48. package/assets/{emotion-styled.browser.esm-3ejjGoWk.js → emotion-styled.browser.esm-C4PVOCRF.js} +1 -1
  49. package/assets/{engine-CNGw5SdF.js → engine-D-dAvXbf.js} +1 -1
  50. package/assets/{errors-BYKPLdNJ.js → errors-BSoF7pTC.js} +1 -1
  51. package/assets/{estimate-l1-fee-BrG1mArn.js → estimate-l1-fee-Cw86yh3k.js} +1 -1
  52. package/assets/{execute-BuBESW09.js → execute-CiNfIIwI.js} +2 -2
  53. package/assets/{features-DJEePSdY.js → features-CrsLW0vi.js} +1 -1
  54. package/assets/{fetchTokenMetadata-DbJ4fJYd.js → fetchTokenMetadata-DdYtEXX-.js} +2 -2
  55. package/assets/{get-ecosystem-wallet-info-BVDQHXZz.js → get-ecosystem-wallet-info-B9Lyre9K.js} +1 -1
  56. package/assets/{getBalance-Dwa97iHq.js → getBalance-C-EmBEJE.js} +1 -1
  57. package/assets/{getNFT-KnOGHpCx.js → getNFT-BQlxSGM2.js} +1 -1
  58. package/assets/{getNFT-8vTqe5mx.js → getNFT-ytL1936_.js} +1 -1
  59. package/assets/{getThemeProps-BkCaIJdf.js → getThemeProps-BGg8uFXd.js} +1 -1
  60. package/assets/{grid.styles-Cflo-ZKg.js → grid.styles-DMgsxY7L.js} +1 -1
  61. package/assets/{hashTypedData-ByA_PXdL.js → hashTypedData-BasXuEvC.js} +1 -1
  62. package/assets/{hashTypedData-zHAZUnlP.js → hashTypedData-j5fdDs4Y.js} +1 -1
  63. package/assets/{import-Da_I6gAZ.js → import-Dm0CsIi0.js} +1 -1
  64. package/assets/{in-app-DAfU34Xj.js → in-app-BEVydnuY.js} +1 -1
  65. package/assets/{in-app-wallet-calls-C8MSEj6u.js → in-app-wallet-calls-BY3W5GQ0.js} +1 -1
  66. package/assets/{index-Dla9ohqE.js → index-1J_FpndO.js} +2 -2
  67. package/assets/{index-IEBvb9g0.js → index-8VXxtKF1.js} +1 -1
  68. package/assets/{index-CRiWMT-r.js → index-B13XAdNZ.js} +1 -1
  69. package/assets/{index-Azrqm6Av.js → index-B1aFfP1l.js} +1 -1
  70. package/assets/{index-I6AhOucd.js → index-B3KRDhro.js} +1 -1
  71. package/assets/{index-vQ_2c6zv.js → index-B7JR23Ob.js} +1 -1
  72. package/assets/{index-Ddw9OYjW.js → index-BAljEUxu.js} +1 -1
  73. package/assets/{index-Q9aqPNo3.js → index-BE79xpUL.js} +1 -1
  74. package/assets/{index-CzKTIGRh.js → index-BFDvoquz.js} +2 -2
  75. package/assets/{index-DX8GIl1w.js → index-BLchEKaw.js} +2 -2
  76. package/assets/{index-DJk-Gyy6.js → index-BO8tonq1.js} +1 -1
  77. package/assets/{index-DeUn3r_V.js → index-BO95Zc7f.js} +1 -1
  78. package/assets/{index-DWsuciPI.js → index-BOKR1ZSE.js} +1 -1
  79. package/assets/{index-CkshIr8A.js → index-BRa-XcLg.js} +1 -1
  80. package/assets/{index-SG2QR9w5.js → index-BSBIVFxM.js} +3 -3
  81. package/assets/{index-Kl09Ztwk.js → index-BUmLgBCF.js} +1 -1
  82. package/assets/{index-DTtN3FMo.js → index-B_OIhLt0.js} +1 -1
  83. package/assets/{index-MmxQtN7S.js → index-Be7WGkuv.js} +1 -1
  84. package/assets/{index-BnWc8jyR.js → index-BgUZsiWa.js} +1 -1
  85. package/assets/{index-D34PBlHH.js → index-BkTT5bsx.js} +1 -1
  86. package/assets/{index-CkqeusMi.js → index-BwKYmXD4.js} +1 -1
  87. package/assets/{index-DMlJeY00.js → index-C1XoasUk.js} +1 -1
  88. package/assets/{index-BCGTwY9C.js → index-C9UOpi9s.js} +1 -1
  89. package/assets/{index-CGd-1UpW.js → index-CBgMGilO.js} +1 -1
  90. package/assets/{index-B6EsaBwe.js → index-CQm9diQZ.js} +1 -1
  91. package/assets/{index-DQwfF15K.js → index-CVglB0vh.js} +1 -1
  92. package/assets/{index-Dltarl5j.js → index-CYLjPyy6.js} +1 -1
  93. package/assets/{index-1YMH7MTk.js → index-CaRubzmQ.js} +1 -1
  94. package/assets/{index-DTvh0ZYF.js → index-CcaSnuYK.js} +1 -1
  95. package/assets/{index-MBO4iF-x.js → index-Ce4-q8Tn.js} +1 -1
  96. package/assets/{index-Dl_EomMH.js → index-ChgR_gSr.js} +1 -1
  97. package/assets/{index-DhHGVFYf.js → index-Cm1rAYH-.js} +1 -1
  98. package/assets/{index-BkQsw_6m.js → index-CqHixIDx.js} +1 -1
  99. package/assets/{index-Bvsc2jDb.js → index-CtyORnm3.js} +1 -1
  100. package/assets/{index-BOei64ey.js → index-D4au8-Sv.js} +1 -1
  101. package/assets/{index-CSAUfzci.js → index-D8fCyz4G.js} +1 -1
  102. package/assets/{index-CgmlJw-S.js → index-DCMoy5ft.js} +1 -1
  103. package/assets/{index-DiUDVsbw.js → index-DCNmX8Jr.js} +3 -3
  104. package/assets/{index-CkzcSx5U.js → index-DSjn_4OZ.js} +1 -1
  105. package/assets/{index-BzmmiLep.js → index-D_M6bHMQ.js} +1 -1
  106. package/assets/{index-BRBJXQFj.js → index-Df6G0l6L.js} +3 -3
  107. package/assets/{index-CuYL-Baw.js → index-DjDUzcsH.js} +2 -2
  108. package/assets/{index-BnbwrW-6.js → index-DzVTWEvS.js} +252 -252
  109. package/assets/{index-CVY0sxwP.js → index-I1HziGSE.js} +1 -1
  110. package/assets/{index-CfiHgp7t.js → index-NfzBgkBr.js} +2 -2
  111. package/assets/{index-BFQ3WGPq.js → index-O4GwlnrF.js} +1 -1
  112. package/assets/{index-BKmu2o-E.js → index-RrRV6pR_.js} +1 -1
  113. package/assets/{index-CvD8tr1x.js → index-S4WGeB0l.js} +1 -1
  114. package/assets/{index-DmUPrDg1.js → index-g7wbqJm1.js} +1 -1
  115. package/assets/{index-BBHWbqVq.js → index-t2owpKkf.js} +1 -1
  116. package/assets/{index-DHNHHzGW.js → index-uOJSYwZG.js} +1 -1
  117. package/assets/{index.es-Dcl8xzFM.js → index.es-B3rSZSDt.js} +4 -4
  118. package/assets/{index.es-1Eex98-c.js → index.es-DM2qW0lw.js} +1 -1
  119. package/assets/{index.es-8mJw4ztI.js → index.es-Dienktq9.js} +1 -1
  120. package/assets/{localBatchGatewayRequest-DLZcpxp5.js → localBatchGatewayRequest-DuHrf2MN.js} +1 -1
  121. package/assets/{mana-convert-Bc7WVBn5.js → mana-convert-CHkCsdrS.js} +1 -1
  122. package/assets/{mana-rate-CFfqtCHS.js → mana-rate-Dt1fufbZ.js} +1 -1
  123. package/assets/{networks-C9v8SYzv.js → networks-KCk_6KCy.js} +1 -1
  124. package/assets/{onramp-vHeI0Bdi.js → onramp-DIsBeuYv.js} +1 -1
  125. package/assets/{openzeppelin-yMR9b1FL.js → openzeppelin-DNjbwrBL.js} +1 -1
  126. package/assets/{parseNft-DOgBlFyM.js → parseNft-BftD-FxK.js} +2 -2
  127. package/assets/{parseSignature-CCtT275H.js → parseSignature-BWVrkDRs.js} +3 -3
  128. package/assets/{parseSignature-B_BQDXEi.js → parseSignature-znC0lvc7.js} +1 -1
  129. package/assets/{passkeys-DC9ui3MW.js → passkeys-BJPRW0V_.js} +1 -1
  130. package/assets/{pay-with-exchange-DzS3VV5h.js → pay-with-exchange-oV9YjYRd.js} +1 -1
  131. package/assets/{qr-overlay-DBMFsWbT.js → qr-overlay-BYTSXp-R.js} +1 -1
  132. package/assets/{receive-DL6eap6Y.js → receive-DWXEUP1p.js} +1 -1
  133. package/assets/{resolveImplementation-CbIwAEHk.js → resolveImplementation-D6NoPFBv.js} +1 -1
  134. package/assets/{rpc-4rFMN8E0.js → rpc-BRol_aMy.js} +1 -1
  135. package/assets/{secp256k1-CJEeTac_.js → secp256k1-BIRnWaVR.js} +1 -1
  136. package/assets/{secp256k1-7K_lKgAG.js → secp256k1-DnitHy6K.js} +1 -1
  137. package/assets/{secp256k1-Cc-OBcqq.js → secp256k1-xEJ152PU.js} +1 -1
  138. package/assets/{send-LziflfC8.js → send-IjXisfbb.js} +1 -1
  139. package/assets/{send-batch-transaction-cPuMc9MS.js → send-batch-transaction-DPQqc2pa.js} +1 -1
  140. package/assets/{send-eip712-transaction-DrVlY4sm.js → send-eip712-transaction-D0KKXrDM.js} +2 -2
  141. package/assets/{send-gasless-transaction-C7GQuNPZ.js → send-gasless-transaction-DEZ5jsUe.js} +2 -2
  142. package/assets/{send-transaction-DsHae-07.js → send-transaction-DSWW1MHr.js} +2 -2
  143. package/assets/{sendMetaTransaction-DVALeVb8.js → sendMetaTransaction-Ci7WU1n2.js} +1 -1
  144. package/assets/{sendRawTransaction-BwoXNrfy.js → sendRawTransaction-BhLbtdw6.js} +3 -3
  145. package/assets/{serializeTransaction-HjwgZYgE.js → serializeTransaction-BpvjoWlt.js} +1 -1
  146. package/assets/{session-proposal-D2B7jyYw.js → session-proposal-CySo5Ayx.js} +1 -1
  147. package/assets/{session-request-qG7jHYd4.js → session-request-CcKMNi2Y.js} +2 -2
  148. package/assets/{signing-2d-SxI7E.js → signing-1MEhDZTe.js} +3 -3
  149. package/assets/{socials-C5lHDsWb.js → socials-BxeqgBhJ.js} +1 -1
  150. package/assets/{swaps-D-FCeao1.js → swaps-gmJBWPLn.js} +1 -1
  151. package/assets/{thirdweb-BzCYZVQU.js → thirdweb-D1mOG5l6.js} +3 -3
  152. package/assets/{to-serializable-transaction-mtITaKz7.js → to-serializable-transaction-B0ueqSml.js} +2 -2
  153. package/assets/trade-encoding-8_nNixrP.js +1 -0
  154. package/assets/{transactionReceipt-C0Zt7siR.js → transactionReceipt-C4bedM4w.js} +1 -1
  155. package/assets/{transactions-3oKW7X2A.js → transactions-OfZRD4zD.js} +1 -1
  156. package/assets/useCreditPacks-By64V7Im.js +1 -0
  157. package/assets/{useInfiniteGrid-DxkPmxZ9.js → useInfiniteGrid-BRS4FUdG.js} +1 -1
  158. package/assets/useManaRate-B_yvKRm8.js +1 -0
  159. package/assets/{useSecondarySales-uafEfAWN.js → useSecondarySales-DvaILn1P.js} +1 -1
  160. package/assets/{useStore-HaFF1p2U.js → useStore-DT6_uEJ5.js} +1 -1
  161. package/assets/{useTheme-DVLL-c1A.js → useTheme-DxD5b5GX.js} +1 -1
  162. package/assets/{verifyHash-DR9pCFUe.js → verifyHash-B6ZBhWEY.js} +1 -1
  163. package/assets/{w3m-modal-B4U6A0YE.js → w3m-modal-BDgG1mEs.js} +1 -1
  164. package/assets/{w3m-modal-CaY0gxk7.js → w3m-modal-cY_JeRk0.js} +1 -1
  165. package/assets/{wait-for-tx-receipt-BDXxYIXq.js → wait-for-tx-receipt-BtuweTJB.js} +1 -1
  166. package/assets/{wallets-Y1872Ad0.js → wallets-7MiPMysL.js} +5 -5
  167. package/assets/{web-connector-CYEfuYp5.js → web-connector-UMu-oPn4.js} +3 -3
  168. package/assets/{writeContract-DrFAVNON.js → writeContract-Byuqugox.js} +1 -1
  169. package/assets/{zoraTestnet-CZflXjbY.js → zoraTestnet-CkN0XqkJ.js} +1 -1
  170. package/index.html +11 -11
  171. package/package.json +2 -2
  172. package/assets/Cart-DS3i-ZcL.js +0 -695
  173. package/assets/Success-DXPvtMrB.js +0 -276
  174. package/assets/buy-D3hY4JG8.js +0 -1
  175. package/assets/trade-encoding-ZhCceq00.js +0 -1
  176. package/assets/useCreditPacks-DTZSsQrR.js +0 -1
  177. package/assets/useManaRate-DJlj41tJ.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as b,j as e,L as _,d as dt}from"./react-vyZjIDcS.js";import{aI as lt,s as l,t as o,x as ut,B as ht,m as xt,e as d,n as pt,u as j,I as g,aJ as R,aK as G,aL as mt,z as v,aM as gt,ap as T,D as J,J as ft,aN as yt,aO as Q}from"./index-BnbwrW-6.js";import{m as bt}from"./mana-convert-Bc7WVBn5.js";import{u as jt}from"./useManaRate-DJlj41tJ.js";import{L as vt}from"./LoadMore-DI4Wyn-C.js";import{u as f}from"./useInfiniteGrid-DxkPmxZ9.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-rate-CFfqtCHS.js";const kt=15e3;function wt(t,i){return t.txHash&&i.txHash?t.txHash===i.txHash:t.txHash||i.txHash?!1:t.status===i.status&&Math.abs(t.createdAt-i.createdAt)<=kt}function It(t){const i=[...t].sort((a,n)=>n.createdAt-a.createdAt),s=[];for(const a of i){const n=s[s.length-1];n&&wt(n[n.length-1],a)?n.push(a):s.push([a])}return s.map(a=>{var n;return{id:((n=a.find(c=>c.txHash))==null?void 0:n.txHash)??a[a.length-1].id,createdAt:Math.max(...a.map(c=>c.createdAt)),status:a.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:a.reduce((c,h)=>c+h.credits,0),lines:a}})}function At(t){const i=[],s=new Map;for(const a of t)if(a.tradeId){const n=s.get(a.tradeId);if(n){n.quantity+=1,n.credits+=a.credits;continue}const c={key:a.tradeId,tradeId:a.tradeId,quantity:1,credits:a.credits};s.set(a.tradeId,c),i.push(c)}else i.push({key:a.id,tradeId:null,quantity:1,credits:a.credits});return i}function $t(t,i){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:i?bt(t.manaWei,i):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Pt(t){const s=It(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),a=t.sales.map(r=>{const x=$t(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),n=(t.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(t.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),h=(t.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...s,...a,...n,...h].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Lt(t,i){return i==="all"?t:i==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const X=t=>t.trim().toLowerCase();function Nt(t){const i=new Map;for(const s of t??[]){const a=X(s.txHash??"");if(!a)continue;const n=i.get(a);n?n.push(s):i.set(a,[s])}return i}function Tt(t,i,s=Date.now()){const a=i.txHash?t.get(X(i.txHash)):void 0;if(!a||a.length===0)return{kind:"direct"};const n=a.length===1?Et(a[0].netCents):null,c=a.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:n};const h=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:n,availableAt:h}}function Et(t){return lt(t)}const Ct="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/credits-product-vs4Q6u6l.svg",E=ut`
1
+ import{r as b,j as e,L as _,d as dt}from"./react-vyZjIDcS.js";import{aJ as lt,s as l,t as o,x as ut,B as ht,m as xt,e as d,n as pt,u as j,I as g,aK as R,aL as G,aM as mt,z as v,aN as gt,ap as T,D as J,J as ft,aO as yt,aP as Q}from"./index-DzVTWEvS.js";import{m as bt}from"./mana-convert-CHkCsdrS.js";import{u as jt}from"./useManaRate-B_yvKRm8.js";import{L as vt}from"./LoadMore-DmJy1HhZ.js";import{u as f}from"./useInfiniteGrid-BRS4FUdG.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-rate-Dt1fufbZ.js";const kt=15e3;function wt(t,i){return t.txHash&&i.txHash?t.txHash===i.txHash:t.txHash||i.txHash?!1:t.status===i.status&&Math.abs(t.createdAt-i.createdAt)<=kt}function It(t){const i=[...t].sort((a,n)=>n.createdAt-a.createdAt),s=[];for(const a of i){const n=s[s.length-1];n&&wt(n[n.length-1],a)?n.push(a):s.push([a])}return s.map(a=>{var n;return{id:((n=a.find(c=>c.txHash))==null?void 0:n.txHash)??a[a.length-1].id,createdAt:Math.max(...a.map(c=>c.createdAt)),status:a.some(c=>c.status==="PENDING")?"PENDING":"SETTLED",totalCredits:a.reduce((c,h)=>c+h.credits,0),lines:a}})}function At(t){const i=[],s=new Map;for(const a of t)if(a.tradeId){const n=s.get(a.tradeId);if(n){n.quantity+=1,n.credits+=a.credits;continue}const c={key:a.tradeId,tradeId:a.tradeId,quantity:1,credits:a.credits};s.set(a.tradeId,c),i.push(c)}else i.push({key:a.id,tradeId:null,quantity:1,credits:a.credits});return i}function $t(t,i){return{id:t.id,contractAddress:t.contractAddress,tokenId:t.tokenId,itemId:t.itemId,counterparty:t.buyer,credits:i?bt(t.manaWei,i):null,manaWei:t.manaWei,createdAt:t.createdAt,txHash:t.txHash}}function Pt(t){const s=It(t.purchases.filter(r=>r.status!=="EXPIRED")).map(r=>({kind:"purchase",id:`purchase:${r.id}`,createdAt:r.createdAt,order:r})),a=t.sales.map(r=>{const x=$t(r,t.rate);return{kind:"sale",id:`sale:${x.id}`,createdAt:x.createdAt,sale:x}}),n=(t.creditOrders??[]).filter(r=>r.status!=="failed"&&r.status!=="abandoned").map(r=>({kind:"credit",id:`credit:${r.id}`,createdAt:r.createdAt,order:r})),c=new Set(t.purchases.filter(r=>r.txHash).map(r=>r.txHash.toLowerCase())),h=(t.manaPurchases??[]).filter(r=>!c.has(r.txHash.toLowerCase())).map(r=>({kind:"mana-purchase",id:`mana-purchase:${r.id}`,createdAt:r.createdAt,sale:r}));return[...s,...a,...n,...h].sort((r,x)=>x.createdAt-r.createdAt||(r.id<x.id?-1:1))}function Lt(t,i){return i==="all"?t:i==="sales"?t.filter(s=>s.kind==="sale"):t.filter(s=>s.kind==="purchase"||s.kind==="credit"||s.kind==="mana-purchase")}const X=t=>t.trim().toLowerCase();function Nt(t){const i=new Map;for(const s of t??[]){const a=X(s.txHash??"");if(!a)continue;const n=i.get(a);n?n.push(s):i.set(a,[s])}return i}function Tt(t,i,s=Date.now()){const a=i.txHash?t.get(X(i.txHash)):void 0;if(!a||a.length===0)return{kind:"direct"};const n=a.length===1?Et(a[0].netCents):null,c=a.filter(r=>!r.available&&r.availableAt>s);if(c.length===0)return{kind:"credited",credits:n};const h=c.reduce((r,x)=>Math.max(r,x.availableAt),0);return{kind:"pending",credits:n,availableAt:h}}function Et(t){return lt(t)}const Ct="https://cdn.decentraland.org/@dcl/shop/0.1.0-30631213700.commit-6a36b1d/assets/credits-product-vs4Q6u6l.svg",E=ut`
2
2
  0% { background-position: 200% 0; }
3
3
  100% { background-position: -200% 0; }
4
4
  `,Ft=l.section`
@@ -1,4 +1,4 @@
1
- import{r as l,j as v}from"./react-vyZjIDcS.js";import{s as u}from"./index-BnbwrW-6.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/DCL_LogoPattern-BryBPc3d.png",U=`
1
+ import{r as l,j as v}from"./react-vyZjIDcS.js";import{s as u}from"./index-DzVTWEvS.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30631213700.commit-6a36b1d/assets/custom-welcome-background-BxlFQma9.webp",b="https://cdn.decentraland.org/@dcl/shop/0.1.0-30631213700.commit-6a36b1d/assets/DCL_LogoPattern-BryBPc3d.png",U=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_uv;
4
4
  void main() {
@@ -1,4 +1,4 @@
1
- import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,au as Ze,av as Je,d as Ke,s as n,t,n as Ie,al as Qe,E as Xe,J as Ae,y as Ye,e as s,I as R,z as W,aR as he,aj as et,ar as K,ay as tt,ax as nt,m as Ne,o as st,S as fe,A as O,aS as ot,aT as it}from"./index-BnbwrW-6.js";import{u as rt}from"./useSecondarySales-uafEfAWN.js";import{a as at,m as Me}from"./mana-convert-Bc7WVBn5.js";import{u as Pe}from"./useManaRate-DJlj41tJ.js";import{g as lt,h as ct,i as dt,j as pt,k as xt,C as ht,l as ft,o as mt,m as ut,n as gt,M as bt,p as yt,E as wt,q as jt,r as vt,s as $t,t as Ct,u as kt,v as St}from"./Assets.styles-CfTWTkg9.js";import{c as me,R as Et,F as Rt,S as Tt}from"./categories-CX6i4K78.js";import{L as _t}from"./LoadMore-DI4Wyn-C.js";import{u as zt}from"./useInfiniteGrid-DxkPmxZ9.js";import{E as It}from"./ErrorNotice-Z0D8os9s.js";import{d as At}from"./dcl-schemas-BICTSpB5.js";import{s as Nt,G as Mt,w as Pt,S as Wt}from"./buy-gasless-CmOMFX1L.js";import{s as Bt}from"./buy-D3hY4JG8.js";import{i as Ft}from"./trade-encoding-ZhCceq00.js";import{r as Lt}from"./mana-rate-CFfqtCHS.js";import{f as Ht}from"./errors-BYKPLdNJ.js";import{J as Ut,C as Ot,B as ee}from"./ethers-CXBJm_wN.js";import{n as Gt}from"./Tooltip-BbHzoPIy.js";import{G as Dt}from"./grid.styles-Cflo-ZKg.js";import"./sentry-B35L1FdR.js";import"./intl-CBcMB1D2.js";import"./authorizations-B6wWjXdQ.js";import"./sendMetaTransaction-DVALeVb8.js";function G(o){const i=o.source??"item",l=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${l}`}const F="100000000000000000000",We=2,Q=15,qt=/^[a-zA-Z0-9]+$/;function ue(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:qt.test(i)?i.length<We?{ok:!1,reason:"too-short"}:i.length>Q?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Vt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,Q)}const Zt=["function available(string _subdomain) view returns (bool)"],ge={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Jt(){return B.chainId===Number(At.ChainId.MATIC_MAINNET)?ge.mainnet:ge.sepolia}async function Kt(o,i={}){var p;const{rpc:l,address:x}=Jt(),c=new Ut(l),d=new Ot(x,Zt,c);console.info(`[names] availability check → DCLRegistrar(${x}).available("${o}") on ${l}`);const h=await d.available(o);if((p=i.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${h}`),h?"available":"taken"}const Qt="https://app.across.to/api";class Be extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function Xt(o){return at(F,o)}async function Yt(o,i,l={}){var p;const x=l.chainId??B.chainId,c=l.provider??"across",d=`${B.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${x}&provider=${c}`,h=await Ke(d,{method:"GET",identity:o,metadata:{}});if(!h.ok){let a;try{a=(p=await h.json())==null?void 0:p.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Be:new Error(`fetchNameCreditRoute ${h.status}`)}return h.json()}function en(o,i){const l=ee.from(o.availableAmount),c=ee.from(F).sub(l);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Ft(o.id)}],creditsSignatures:[o.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:c.isNegative()?"0":c.toString(),maxCreditedValue:F}}async function tn(o,i={}){const l=Qt,x=i.intervalMs??1e4,c=i.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let h=0;h<c;h++){try{const p=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${o}`);if(p.ok){const a=await p.json(),u=(a.status??"pending").toLowerCase(),b=a.fillTx??a.fillTxnRef??null,w=a.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:b,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:b,actionsSucceeded:w}}}catch{}h<c-1&&await new Promise(p=>setTimeout(p,x))}return d}async function nn(o){const{name:i,identity:l,signer:x}=o,c=o.chainId??B.chainId,d=o.provider??"across",h=(o.beneficiary??await x.getAddress()).toLowerCase();let p=null,a=!1;console.info("[names] register start",{name:i,buyer:h,chainId:c,provider:d});try{const u=await Lt(c),b=Xt(u);console.info("[names] step 1/6 sized reservation",{usdCents:b,manaRate:u});const w=await Yt(l,i,{chainId:c,provider:d});console.info("[names] step 2/6 route fetched",{target:w.externalCall.target,selector:w.externalCall.selector,provider:w.provider,quoteId:w.quoteId});const j=await Ze(l,b);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),ee.from(j.maxCreditedValue).lt(F))throw new Error("Credit under-sized for the name price");const $=en(j.credit,w);let f;try{f=await Nt({chainId:c,buyer:h,signer:x,args:$})}catch(y){if(!(y instanceof Mt))throw y;f=await Bt(c,$,x)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Pt(f),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const y=await tn(f,o.acrossPoll);if(console.info("[names] step 6/6 across status",y),y.status==="pending")return{status:"pending",originTxHash:f};if(y.status!=="filled"||!y.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:y.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:i,buyer:h,originConfirmed:a}),u instanceof Wt)return{status:"pending",originTxHash:u.txHash};if(p&&!a&&await Je(l,[p]).catch(()=>{}),u instanceof Be)throw u;const b=new Error(Ht(u,"Couldn't register the name. Please try again.",{sale:!0}));throw b.cause=u,b}}const sn=n.div`
1
+ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,av as Ze,aw as Je,d as Ke,s as n,t,n as Ie,al as Qe,E as Xe,J as Ae,y as Ye,e as s,I as T,z as W,aS as he,aj as et,ar as K,az as tt,ay as nt,m as Ne,o as st,S as fe,A as O,aT as ot,aU as it}from"./index-DzVTWEvS.js";import{u as rt}from"./useSecondarySales-DvaILn1P.js";import{a as at,m as Me}from"./mana-convert-CHkCsdrS.js";import{u as Pe}from"./useManaRate-B_yvKRm8.js";import{g as lt,h as ct,i as dt,j as pt,k as xt,C as ht,l as ft,o as mt,m as ut,n as gt,M as bt,p as yt,E as wt,q as jt,r as vt,s as $t,t as Ct,u as kt,v as St}from"./Assets.styles-DxYgoIuy.js";import{c as me,R as Et,F as Tt,S as Rt}from"./categories-Ci0NfrXM.js";import{L as _t}from"./LoadMore-DmJy1HhZ.js";import{u as zt}from"./useInfiniteGrid-BRS4FUdG.js";import{E as It}from"./ErrorNotice-B02EvdVc.js";import{d as At}from"./dcl-schemas-BICTSpB5.js";import{s as Nt,G as Mt,w as Pt,S as Wt}from"./buy-gasless-DLYP_J55.js";import{s as Bt}from"./buy-B0vN0t4_.js";import{i as Ft}from"./trade-encoding-8_nNixrP.js";import{r as Lt}from"./mana-rate-Dt1fufbZ.js";import{f as Ut}from"./errors-BSoF7pTC.js";import{J as Ht,C as Ot,B as ee}from"./ethers-CXBJm_wN.js";import{n as Gt}from"./Tooltip-gJZXgo0b.js";import{G as Dt}from"./grid.styles-DMgsxY7L.js";import"./sentry-B35L1FdR.js";import"./intl-CBcMB1D2.js";import"./authorizations-BPcNtN-P.js";import"./sendMetaTransaction-Ci7WU1n2.js";function G(o){const i=o.source??"item",l=o.tradeId||`${o.contractAddress}-${o.tokenId??o.itemId??""}`;return`${i}:${l}`}const F="100000000000000000000",We=2,Q=15,qt=/^[a-zA-Z0-9]+$/;function ue(o){const i=o.trim();return i.length===0?{ok:!1,reason:"empty"}:qt.test(i)?i.length<We?{ok:!1,reason:"too-short"}:i.length>Q?{ok:!1,reason:"too-long"}:{ok:!0}:{ok:!1,reason:"invalid-chars"}}function Vt(o){return o.replace(/[^a-zA-Z0-9]/g,"").slice(0,Q)}const Zt=["function available(string _subdomain) view returns (bool)"],ge={mainnet:{rpc:"https://rpc.decentraland.org/mainnet",address:"0x2a187453064356c898cae034eaed119e1663acb8"},sepolia:{rpc:"https://rpc.decentraland.org/sepolia",address:"0x7518456ae93eb98f3e64571b689c626616bb7f30"}};function Jt(){return B.chainId===Number(At.ChainId.MATIC_MAINNET)?ge.mainnet:ge.sepolia}async function Kt(o,i={}){var p;const{rpc:l,address:x}=Jt(),c=new Ht(l),d=new Ot(x,Zt,c);console.info(`[names] availability check → DCLRegistrar(${x}).available("${o}") on ${l}`);const h=await d.available(o);if((p=i.signal)!=null&&p.aborted)throw new DOMException("Aborted","AbortError");return console.info(`[names] "${o}" available=${h}`),h?"available":"taken"}const Qt="https://app.across.to/api";class Be extends Error{constructor(){super("Name registration is temporarily unavailable due to high network costs"),this.name="NameRouteCostTooHighError"}}function Xt(o){return at(F,o)}async function Yt(o,i,l={}){var p;const x=l.chainId??B.chainId,c=l.provider??"across",d=`${B.creditsServerUrl}/credits-name-route?name=${encodeURIComponent(i)}&chainId=${x}&provider=${c}`,h=await Ke(d,{method:"GET",identity:o,metadata:{}});if(!h.ok){let a;try{a=(p=await h.json())==null?void 0:p.code}catch{}throw a==="ROUTE_COST_TOO_HIGH"?new Be:new Error(`fetchNameCreditRoute ${h.status}`)}return h.json()}function en(o,i){const l=ee.from(o.availableAmount),c=ee.from(F).sub(l);return{credits:[{value:o.amount,expiresAt:Number(o.expiresAt),salt:Ft(o.id)}],creditsSignatures:[o.signature],externalCall:{target:i.externalCall.target,selector:i.externalCall.selector,data:i.externalCall.data,expiresAt:i.externalCall.expiresAt,salt:i.externalCall.salt},customExternalCallSignature:i.customExternalCallSignature,maxUncreditedValue:c.isNegative()?"0":c.toString(),maxCreditedValue:F}}async function tn(o,i={}){const l=Qt,x=i.intervalMs??1e4,c=i.maxAttempts??60;let d={status:"pending",destinationTxHash:null,actionsSucceeded:!1};for(let h=0;h<c;h++){try{const p=await fetch(`${l}/deposit/status?originChainId=137&depositTxHash=${o}`);if(p.ok){const a=await p.json(),u=(a.status??"pending").toLowerCase(),b=a.fillTx??a.fillTxnRef??null,w=a.actionsSucceeded!==!1;if(u==="filled")return{status:"filled",destinationTxHash:b,actionsSucceeded:w};if(u==="refunded"||u==="expired")return{status:u,destinationTxHash:null,actionsSucceeded:!1};d={status:"pending",destinationTxHash:b,actionsSucceeded:w}}}catch{}h<c-1&&await new Promise(p=>setTimeout(p,x))}return d}async function nn(o){const{name:i,identity:l,signer:x}=o,c=o.chainId??B.chainId,d=o.provider??"across",h=(o.beneficiary??await x.getAddress()).toLowerCase();let p=null,a=!1;console.info("[names] register start",{name:i,buyer:h,chainId:c,provider:d});try{const u=await Lt(c),b=Xt(u);console.info("[names] step 1/6 sized reservation",{usdCents:b,manaRate:u});const w=await Yt(l,i,{chainId:c,provider:d});console.info("[names] step 2/6 route fetched",{target:w.externalCall.target,selector:w.externalCall.selector,provider:w.provider,quoteId:w.quoteId});const j=await Ze(l,b);if(p=j.credit.id,console.info("[names] step 3/6 credit authorized",{creditId:j.credit.id,maxCreditedValue:j.maxCreditedValue}),ee.from(j.maxCreditedValue).lt(F))throw new Error("Credit under-sized for the name price");const $=en(j.credit,w);let f;try{f=await Nt({chainId:c,buyer:h,signer:x,args:$})}catch(y){if(!(y instanceof Mt))throw y;f=await Bt(c,$,x)}if(console.info("[names] step 4/6 useCredits submitted (Polygon origin tx)",{originTxHash:f}),await Pt(f),a=!0,console.info("[names] step 5/6 origin tx confirmed",{originTxHash:f}),d==="across"){const y=await tn(f,o.acrossPoll);if(console.info("[names] step 6/6 across status",y),y.status==="pending")return{status:"pending",originTxHash:f};if(y.status!=="filled"||!y.actionsSucceeded)throw new Error("The name could not be registered on Ethereum; your funds were recovered.");return{status:"registered",originTxHash:f,destinationTxHash:y.destinationTxHash}}return{status:"pending",originTxHash:f}}catch(u){if(console.error("[names] register failed — raw error:",u,{name:i,buyer:h,originConfirmed:a}),u instanceof Wt)return{status:"pending",originTxHash:u.txHash};if(p&&!a&&await Je(l,[p]).catch(()=>{}),u instanceof Be)throw u;const b=new Error(Ut(u,"Couldn't register the name. Please try again.",{sale:!0}));throw b.cause=u,b}}const sn=n.div`
2
2
  position: fixed;
3
3
  inset: 0;
4
4
  z-index: 10000;
@@ -112,7 +112,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,au
112
112
  font-family: ${t.font.sans};
113
113
  font-size: 14px;
114
114
  color: ${t.colors.muted2};
115
- `,Re=n.div`
115
+ `,Te=n.div`
116
116
  flex: none;
117
117
  display: flex;
118
118
  align-items: center;
@@ -186,7 +186,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,au
186
186
  font-family: ${t.font.sans};
187
187
  font-size: 16px;
188
188
  color: ${t.colors.muted2};
189
- `,Te=n.button`
189
+ `,Re=n.button`
190
190
  margin-top: 16px;
191
191
  width: 100%;
192
192
  height: 52px;
@@ -366,7 +366,7 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,au
366
366
  flex: none;
367
367
  color: ${t.colors.dclRed};
368
368
  }
369
- `;function Sn({name:o,priceCredits:i,onClose:l}){const{session:x}=Ie(),{data:c,isError:d}=Qe(x),h=Xe(),p=ze(),[a,u]=m.useState("confirm"),[b,w]=m.useState(""),[j,$]=m.useState(null),f=m.useRef(!1),y=b.trim().toLowerCase()===o.toLowerCase(),v=a==="completing",k=i!=null?Ae(i):"—";m.useEffect(()=>{const g=T=>{T.key==="Escape"&&!v&&l()};document.addEventListener("keydown",g);const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=I}},[v,l]);async function C(){if(!(!x||!y||f.current)){f.current=!0,u("completing"),$(null);try{await nn({name:o,identity:x.identity,signer:x.signer}),K("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),h.invalidateQueries({queryKey:["usd-balance"]}),h.invalidateQueries({queryKey:["my-assets"]}),u("success")}catch(g){K(nt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:tt(g),purchase_type:"name"}),$((g==null?void 0:g.message)||s("names.errorGeneric")),u("error")}finally{f.current=!1}}}const z=a!=="success",E=Ye(x==null?void 0:x.providerType);return e.jsx(sn,{onClick:v?void 0:l,role:"presentation",children:e.jsxs(on,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:a==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(we,{onClick:l,disabled:v,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(kn,{children:[e.jsx(R,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Te,{onClick:()=>u("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(rn,{children:[e.jsx(an,{children:s("names.confirmTitle")}),e.jsx(ln,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${En(o)}</b>`})}}),e.jsxs(cn,{children:[e.jsx(dn,{"aria-hidden":!0,children:"@"}),e.jsx(pn,{value:b,onChange:g=>w(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx(xn,{children:".dcl.eth"})]})]}),e.jsx(Te,{onClick:()=>void C(),disabled:!y||!x,children:s("names.buyCta")})]})]}),a==="completing"&&e.jsxs(hn,{children:[e.jsx(fn,{src:et,alt:"",width:56,height:56}),e.jsx(mn,{children:E?s("names.confirming"):s("names.completing")}),e.jsxs(un,{children:[e.jsx(gn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(bn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:s("names.successHeaderTitle")}),e.jsx(we,{onClick:l,"aria-label":s("buyModal.close"),children:e.jsx(R,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{}),e.jsxs(yn,{children:[e.jsx(wn,{"aria-hidden":!0,children:e.jsx(R,{name:"check"})}),e.jsxs(jn,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs($e,{style:{marginTop:20},children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Re,{children:[e.jsx(W,{}),k]})]}),e.jsxs(vn,{children:[e.jsx($n,{onClick:()=>{l(),p("/my-assets")},children:s("names.myItems")}),e.jsx(Cn,{href:B.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function En(o){return o.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Rn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/identity-B4DXDuJP.webp",Tn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/world-B-9aPlxu.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/invite-BfwIhP2C.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30565861644.commit-86fa62d/assets/governance-DnazlIjy.webp",In=n.div`
369
+ `;function Sn({name:o,priceCredits:i,onClose:l}){const{session:x}=Ie(),{data:c,isError:d}=Qe(x),h=Xe(),p=ze(),[a,u]=m.useState("confirm"),[b,w]=m.useState(""),[j,$]=m.useState(null),f=m.useRef(!1),y=b.trim().toLowerCase()===o.toLowerCase(),v=a==="completing",k=i!=null?Ae(i):"—";m.useEffect(()=>{const g=R=>{R.key==="Escape"&&!v&&l()};document.addEventListener("keydown",g);const I=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=I}},[v,l]);async function C(){if(!(!x||!y||f.current)){f.current=!0,u("completing"),$(null);try{await nn({name:o,identity:x.identity,signer:x.signer}),K("Shop Completed Purchase",{purchase_type:"name",is_primary:!0,payment_type:"credits",value_credits:i??null}),h.invalidateQueries({queryKey:["usd-balance"]}),h.invalidateQueries({queryKey:["my-assets"]}),u("success")}catch(g){K(nt(g)?"Shop Purchase Cancelled":"Shop Purchase Failed",{step:"submit",error_code:tt(g),purchase_type:"name"}),$((g==null?void 0:g.message)||s("names.errorGeneric")),u("error")}finally{f.current=!1}}}const z=a!=="success",E=Ye(x==null?void 0:x.providerType);return e.jsx(sn,{onClick:v?void 0:l,role:"presentation",children:e.jsxs(on,{role:"dialog","aria-modal":"true","aria-label":s("names.buyTitle"),onClick:g=>g.stopPropagation(),children:[z&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:a==="error"?s("names.errorTitle"):s("names.buyTitle")}),e.jsx(we,{onClick:l,disabled:v,"aria-label":s("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{})]}),(a==="confirm"||a==="error")&&e.jsxs(e.Fragment,{children:[e.jsxs($e,{children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Te,{children:[e.jsx(W,{}),k]})]}),a==="error"?e.jsxs(e.Fragment,{children:[e.jsxs(kn,{children:[e.jsx(T,{name:"info","aria-hidden":!0}),e.jsx("span",{children:j})]}),e.jsx(Re,{onClick:()=>u("confirm"),children:s("names.tryAgain")})]}):e.jsxs(e.Fragment,{children:[e.jsxs(rn,{children:[e.jsx(an,{children:s("names.confirmTitle")}),e.jsx(ln,{dangerouslySetInnerHTML:{__html:s("names.confirmBody",{name:`<b>@${En(o)}</b>`})}}),e.jsxs(cn,{children:[e.jsx(dn,{"aria-hidden":!0,children:"@"}),e.jsx(pn,{value:b,onChange:g=>w(g.target.value.replace(/[^a-zA-Z0-9]/g,"")),placeholder:"yourname","aria-label":s("names.reenterAria"),autoComplete:"off",spellCheck:!1,style:{width:`${Math.max(b.length,8)}ch`}}),e.jsx(xn,{children:".dcl.eth"})]})]}),e.jsx(Re,{onClick:()=>void C(),disabled:!y||!x,children:s("names.buyCta")})]})]}),a==="completing"&&e.jsxs(hn,{children:[e.jsx(fn,{src:et,alt:"",width:56,height:56}),e.jsx(mn,{children:E?s("names.confirming"):s("names.completing")}),e.jsxs(un,{children:[e.jsx(gn,{"aria-hidden":!0,children:e.jsx("span",{})}),e.jsx(bn,{children:"1/1"})]})]}),a==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsx(ye,{children:s("names.successHeaderTitle")}),e.jsx(we,{onClick:l,"aria-label":s("buyModal.close"),children:e.jsx(T,{name:"close"})})]}),e.jsxs(je,{children:[s("names.myCreditsBalance")," ",e.jsx(W,{})," ",he(c,d)]}),e.jsx(ve,{}),e.jsxs(yn,{children:[e.jsx(wn,{"aria-hidden":!0,children:e.jsx(T,{name:"check"})}),e.jsxs(jn,{children:[e.jsx("b",{children:s("names.successBannerBold")})," ",s("names.successBannerRest")]})]}),e.jsxs($e,{style:{marginTop:20},children:[e.jsx(Ce,{"aria-hidden":!0,children:"@"}),e.jsxs(ke,{children:[e.jsxs(Se,{children:[o,e.jsx("span",{children:".dcl.eth"})]}),e.jsx(Ee,{children:s("names.subtitle")})]}),e.jsxs(Te,{children:[e.jsx(W,{}),k]})]}),e.jsxs(vn,{children:[e.jsx($n,{onClick:()=>{l(),p("/my-assets")},children:s("names.myItems")}),e.jsx(Cn,{href:B.profileUrl,target:"_blank",rel:"noopener noreferrer",children:s("names.assignToAvatar")})]})]})]})})}function En(o){return o.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i])}const Tn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30631213700.commit-6a36b1d/assets/identity-B4DXDuJP.webp",Rn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30631213700.commit-6a36b1d/assets/world-B-9aPlxu.webp",_n="https://cdn.decentraland.org/@dcl/shop/0.1.0-30631213700.commit-6a36b1d/assets/invite-BfwIhP2C.webp",zn="https://cdn.decentraland.org/@dcl/shop/0.1.0-30631213700.commit-6a36b1d/assets/governance-DnazlIjy.webp",In=n.div`
370
370
  width: 100%;
371
371
  min-width: 0;
372
372
  `,An=n.nav`
@@ -453,12 +453,12 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,au
453
453
  ${t.media.maxWidth("mobile")} {
454
454
  font-size: 16px;
455
455
  }
456
- `,Hn=n.div`
456
+ `,Un=n.div`
457
457
  width: min(785px, 100%);
458
458
  display: flex;
459
459
  flex-direction: column;
460
460
  gap: 12px;
461
- `,Un=n.div`
461
+ `,Hn=n.div`
462
462
  position: relative;
463
463
  `,On=n("div",Gt("invalid"))`
464
464
  display: flex;
@@ -784,4 +784,4 @@ import{b as ze,r as m,j as e,u as Ve}from"./react-vyZjIDcS.js";import{c as B,au
784
784
  clip: rect(0, 0, 0, 0);
785
785
  white-space: nowrap;
786
786
  border: 0;
787
- `,as="https://docs.decentraland.org/creator/worlds/about/",ls="https://governance.decentraland.org";function cs(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 ds({onBack:o}){Ne({title:s("seo.names.title"),description:s("seo.names.description")});const{session:i,signIn:l}=Ie(),{data:x}=Pe(),c=x?Me(F,x):null,[d,h]=m.useState(""),[p,a]=m.useState("idle"),[u,b]=m.useState(!1),w=m.useRef(null),[j,$]=m.useState(void 0);m.useLayoutEffect(()=>{w.current&&$(w.current.offsetWidth)},[d]),m.useEffect(()=>{if(!ue(d).ok){a(d.length===0?"idle":"invalid");return}a("checking");const z=new AbortController,E=setTimeout(()=>{(async()=>{try{const g=await Kt(d,{signal:z.signal});a(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(E),z.abort()}},[d]);const f=ue(d),y=f.ok&&(p==="available"||p==="error");function v(){if(y){if(!i){l();return}b(!0)}}const k=e.jsxs(e.Fragment,{children:[s("names.claim"),c!=null?e.jsxs(Yn,{children:[e.jsx(W,{}),Ae(c)]}):null]});return e.jsxs(In,{"data-testid":"names-page",children:[e.jsxs(An,{"aria-label":s("names.breadcrumbAria"),children:[e.jsx(Nn,{onClick:o,children:s("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Mn,{children:s("names.breadcrumbCurrent")})]}),e.jsxs(Pn,{children:[e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsx(Fn,{children:s("names.heroTitle")}),e.jsx(Ln,{children:s("names.heroSubtitle")})]}),e.jsxs(Hn,{children:[e.jsxs(Un,{children:[e.jsxs(On,{invalid:p==="taken",children:[e.jsxs(Vn,{children:[e.jsx(Zn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:d,onChange:C=>h(Vt(C.target.value)),placeholder:s("names.inputPlaceholder"),"aria-label":s("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Q,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Gn,{ref:w,"aria-hidden":!0,children:d||s("names.inputPlaceholder")}),e.jsx(Kn,{children:s("names.suffix")})]}),d.length>0?e.jsxs(Qn,{"aria-hidden":!0,children:[d.length,"/",Q]}):null,e.jsx(Fe,{onClick:v,disabled:!y,"data-testid":"names-claim",children:k})]}),p==="taken"?e.jsxs(Dn,{role:"status","data-testid":"names-taken",children:[e.jsx(R,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.taken")}),e.jsxs(qn,{href:cs(d),target:"_blank",rel:"noopener noreferrer",children:[s("names.takenMakeOffer"),e.jsx(R,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Xn,{onClick:v,disabled:!y,children:k}),p==="checking"?e.jsx(X,{tone:"muted",role:"status","data-testid":"names-checking",children:s("names.checking")}):p==="error"?e.jsx(X,{tone:"muted",role:"status",children:s("names.checkError")}):p==="invalid"&&!f.ok&&f.reason==="too-short"?e.jsx(X,{tone:"muted",role:"status",children:s("names.tooShort",{min:We})}):null,e.jsx(rs,{role:"status","aria-live":"polite",children:p==="available"?s("names.available",{name:d}):""})]})]}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(ns,{children:s("names.whyTitle")}),e.jsx(ss,{children:s("names.whyIntro")})]}),e.jsxs(os,{children:[e.jsxs(D,{children:[e.jsx(q,{src:Rn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why1Title")}),e.jsx(J,{children:s("names.why1")})]})]}),e.jsxs(D,{children:[e.jsx(q,{src:Tn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why2Title")}),e.jsxs(J,{children:[s("names.why2")," ",e.jsx(is,{children:s("names.why2Address")})]}),e.jsxs(_e,{href:as,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(D,{children:[e.jsx(q,{src:_n,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why3Title")}),e.jsx(J,{children:s("names.why3")})]})]}),e.jsxs(D,{children:[e.jsx(q,{src:zn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why4Title")}),e.jsx(J,{children:s("names.why4")}),e.jsxs(_e,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(R,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(Sn,{name:d,priceCredits:c,onClose:()=>b(!1)}):null]})}const ps="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",Y=48;function Ms(){const[o]=Ve(),i=ze(),l=(o.get("q")??"").trim().toLowerCase(),x=(o.get("q")??"").trim();Ne({title:x?s("seo.collectibles.searchTitle",{query:x}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const[c,d]=m.useState("wearable"),[h,p]=m.useState(null),[a,u]=m.useState([]),[b,w]=m.useState(""),[j,$]=m.useState(""),[f,y]=m.useState("on_sale"),[v,k]=m.useState(!1),[C,z]=m.useState("newest"),[E,g]=m.useState(!1);m.useEffect(()=>{if(!E)return;const r=N=>{N.key==="Escape"&&g(!1)};document.addEventListener("keydown",r);const S=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=S}},[E]);const I=f==="on_sale",T=b&&!Number.isNaN(Number(b))?Number(b):void 0,M=j&&!Number.isNaN(Number(j))?Number(j):void 0,Le=rt(),te=h?Tt[h]:void 0,ne=(me.find(r=>r.key===C)??me[0]).server,se={category:c,rarities:a.length?a:void 0,wearableCategories:te,minPriceCredits:T,maxPriceCredits:M,search:l||void 0,sortBy:ne,isSmart:v||void 0,onSale:!0,listingType:Le?void 0:"primary"},oe={category:c,rarities:a.length?a:void 0,wearableCategories:te,search:l||void 0,sortBy:ne,isWearableSmart:v||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:L,total:ie,isLoading:_,isPlaceholderData:A,error:re,hasNextPage:He,isFetchingNextPage:ae,fetchNextPage:Ue}=zt(I?["shop-items",se]:["catalog-items",oe],r=>I?ot({...se,first:Y,skip:r}):it({...oe,first:Y,skip:r}),{enabled:c!=="names"}),H=ie,le=_||A,Oe=_?15:Math.min(Math.max(L.length,1),Y),{data:ce,isError:Ge}=Pe(),De=r=>ce&&r.manaWei?Me(r.manaWei,ce):null,de=m.useRef(null);m.useEffect(()=>{_||A||!l||de.current===l||(de.current=l,K("Shop Searched",{query:l,result_count:H}))},[l,_,A,H]);const U=m.useRef("__init__");m.useEffect(()=>{if(_||A)return;const r=JSON.stringify({category:c,subCategory:h,rarities:a,min:T,max:M,sort:C,status:f,smart:v});if(U.current==="__init__"||U.current===r){U.current=r;return}U.current=r,K("Shop Applied Filter",{filters:{category:c,sub_category:h,rarities:a,min_price_credits:T??null,max_price_credits:M??null,status:f,smart:v,sort:C},result_count:H})},[c,h,a,T,M,C,f,v,_,A,H]);function pe(r){d(r),p(null)}function xe(r){u(S=>S.includes(r)?S.filter(N=>N!==r):[...S,r])}function qe(){d("wearable"),p(null),u([]),w(""),$(""),y("on_sale"),k(!1)}const P=[];(T!=null||M!=null)&&P.push({key:"price",label:s("filter.price"),onRemove:()=>{w(""),$("")}});for(const r of Et)a.includes(r)&&P.push({key:`rarity-${r}`,label:st(r),onRemove:()=>xe(r)});return v&&P.push({key:"smart",label:s("filter.smart"),onRemove:()=>k(!1)}),f!=="on_sale"&&P.push({key:"status",label:f==="all"?s("filter.statusAll"):s("filter.notForSale"),onRemove:()=>y("on_sale")}),e.jsxs(lt,{"data-testid":"browse",children:[c!=="names"&&e.jsxs(e.Fragment,{children:[E?e.jsx(ct,{onClick:()=>g(!1),"aria-hidden":!0}):null,e.jsxs(dt,{"data-open":E||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(pt,{children:[e.jsx(xt,{children:s("assets.filters")}),e.jsx(ht,{onClick:()=>g(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(ft,{children:e.jsx(mt,{category:c,subCategory:h,onCategory:pe,onSub:p,priceMin:b,priceMax:j,onPriceMin:w,onPriceMax:$,rarities:a,onToggleRarity:xe,status:f,onStatus:y,smart:v,onSmart:k})}),e.jsx(ut,{children:e.jsx(gt,{type:"button",onClick:()=>g(!1),children:s("assets.showItems")})})]})]}),e.jsx(bt,{children:c==="names"?e.jsx(ds,{onBack:()=>pe("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{sort:C,onSort:z,total:ie,loading:_||A,query:l,onOpenFilters:()=>g(!0),chips:P,onClearChips:qe}),Ge&&I&&L.some(r=>r.source==="legacy")?e.jsx(yt,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,re?e.jsx(It,{message:s("assets.loadError"),testId:"browse-error"}):null,!le&&L.length===0&&!re?e.jsxs(wt,{"data-testid":"browse-empty",children:[e.jsx(jt,{src:ps,alt:""}),e.jsxs(vt,{children:[e.jsx($t,{children:s("assets.empty.title")}),e.jsx(Ct,{children:x?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:x}),s("assets.empty.searchAfter")]}):s("assets.empty.filters")})]}),e.jsx(kt,{children:e.jsx(St,{type:"button",onClick:()=>i("/overview"),children:s("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Dt,{"data-testid":"grid",children:le?e.jsx(fe,{count:Oe}):e.jsxs(e.Fragment,{children:[L.map(r=>{if(!I)return e.jsx(O,{item:r,mode:"view"},G(r));const S=r;if(S.source!=="legacy")return e.jsx(O,{item:r},G(r));const N=De(S);return N==null?e.jsx(O,{item:r,mode:"view"},G(r)):e.jsx(O,{item:{...S,priceCredits:N}},G(r))}),ae?e.jsx(fe,{count:6}):null]})}),e.jsx(_t,{hasNextPage:He,isFetching:ae,onLoadMore:()=>void Ue()})]})]})})]})}export{Ms as Assets};
787
+ `,as="https://docs.decentraland.org/creator/worlds/about/",ls="https://governance.decentraland.org";function cs(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 ds({onBack:o}){Ne({title:s("seo.names.title"),description:s("seo.names.description")});const{session:i,signIn:l}=Ie(),{data:x}=Pe(),c=x?Me(F,x):null,[d,h]=m.useState(""),[p,a]=m.useState("idle"),[u,b]=m.useState(!1),w=m.useRef(null),[j,$]=m.useState(void 0);m.useLayoutEffect(()=>{w.current&&$(w.current.offsetWidth)},[d]),m.useEffect(()=>{if(!ue(d).ok){a(d.length===0?"idle":"invalid");return}a("checking");const z=new AbortController,E=setTimeout(()=>{(async()=>{try{const g=await Kt(d,{signal:z.signal});a(g)}catch(g){if((g==null?void 0:g.name)==="AbortError")return;a("error")}})()},400);return()=>{clearTimeout(E),z.abort()}},[d]);const f=ue(d),y=f.ok&&(p==="available"||p==="error");function v(){if(y){if(!i){l();return}b(!0)}}const k=e.jsxs(e.Fragment,{children:[s("names.claim"),c!=null?e.jsxs(Yn,{children:[e.jsx(W,{}),Ae(c)]}):null]});return e.jsxs(In,{"data-testid":"names-page",children:[e.jsxs(An,{"aria-label":s("names.breadcrumbAria"),children:[e.jsx(Nn,{onClick:o,children:s("names.breadcrumbCollectibles")}),e.jsx("span",{"aria-hidden":!0,children:">"}),e.jsx(Mn,{children:s("names.breadcrumbCurrent")})]}),e.jsxs(Pn,{children:[e.jsxs(Wn,{children:[e.jsxs(Bn,{children:[e.jsx(Fn,{children:s("names.heroTitle")}),e.jsx(Ln,{children:s("names.heroSubtitle")})]}),e.jsxs(Un,{children:[e.jsxs(Hn,{children:[e.jsxs(On,{invalid:p==="taken",children:[e.jsxs(Vn,{children:[e.jsx(Zn,{"aria-hidden":!0,children:"@"}),e.jsx(Jn,{value:d,onChange:C=>h(Vt(C.target.value)),placeholder:s("names.inputPlaceholder"),"aria-label":s("names.inputAria"),autoComplete:"off",spellCheck:!1,maxLength:Q,style:{width:j!=null?`${j}px`:void 0}}),e.jsx(Gn,{ref:w,"aria-hidden":!0,children:d||s("names.inputPlaceholder")}),e.jsx(Kn,{children:s("names.suffix")})]}),d.length>0?e.jsxs(Qn,{"aria-hidden":!0,children:[d.length,"/",Q]}):null,e.jsx(Fe,{onClick:v,disabled:!y,"data-testid":"names-claim",children:k})]}),p==="taken"?e.jsxs(Dn,{role:"status","data-testid":"names-taken",children:[e.jsx(T,{name:"info",size:16,"aria-hidden":!0}),e.jsx("span",{children:s("names.taken")}),e.jsxs(qn,{href:cs(d),target:"_blank",rel:"noopener noreferrer",children:[s("names.takenMakeOffer"),e.jsx(T,{name:"external-link",size:13,"aria-hidden":!0})]})]}):null]}),e.jsx(Xn,{onClick:v,disabled:!y,children:k}),p==="checking"?e.jsx(X,{tone:"muted",role:"status","data-testid":"names-checking",children:s("names.checking")}):p==="error"?e.jsx(X,{tone:"muted",role:"status",children:s("names.checkError")}):p==="invalid"&&!f.ok&&f.reason==="too-short"?e.jsx(X,{tone:"muted",role:"status",children:s("names.tooShort",{min:We})}):null,e.jsx(rs,{role:"status","aria-live":"polite",children:p==="available"?s("names.available",{name:d}):""})]})]}),e.jsxs(es,{children:[e.jsxs(ts,{children:[e.jsx(ns,{children:s("names.whyTitle")}),e.jsx(ss,{children:s("names.whyIntro")})]}),e.jsxs(os,{children:[e.jsxs(D,{children:[e.jsx(q,{src:Tn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why1Title")}),e.jsx(J,{children:s("names.why1")})]})]}),e.jsxs(D,{children:[e.jsx(q,{src:Rn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why2Title")}),e.jsxs(J,{children:[s("names.why2")," ",e.jsx(is,{children:s("names.why2Address")})]}),e.jsxs(_e,{href:as,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]}),e.jsxs(D,{children:[e.jsx(q,{src:_n,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why3Title")}),e.jsx(J,{children:s("names.why3")})]})]}),e.jsxs(D,{children:[e.jsx(q,{src:zn,alt:""}),e.jsxs(V,{children:[e.jsx(Z,{children:s("names.why4Title")}),e.jsx(J,{children:s("names.why4")}),e.jsxs(_e,{href:ls,target:"_blank",rel:"noopener noreferrer",children:[s("names.learnMore"),e.jsx(T,{name:"external-link","aria-hidden":!0})]})]})]})]})]})]}),u?e.jsx(Sn,{name:d,priceCredits:c,onClose:()=>b(!1)}):null]})}const ps="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",Y=48;function Ms(){const[o]=Ve(),i=ze(),l=(o.get("q")??"").trim().toLowerCase(),x=(o.get("q")??"").trim();Ne({title:x?s("seo.collectibles.searchTitle",{query:x}):s("seo.collectibles.title"),description:s("seo.collectibles.description")});const[c,d]=m.useState("wearable"),[h,p]=m.useState(null),[a,u]=m.useState([]),[b,w]=m.useState(""),[j,$]=m.useState(""),[f,y]=m.useState("on_sale"),[v,k]=m.useState(!1),[C,z]=m.useState("newest"),[E,g]=m.useState(!1);m.useEffect(()=>{if(!E)return;const r=N=>{N.key==="Escape"&&g(!1)};document.addEventListener("keydown",r);const S=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",r),document.body.style.overflow=S}},[E]);const I=f==="on_sale",R=b&&!Number.isNaN(Number(b))?Number(b):void 0,M=j&&!Number.isNaN(Number(j))?Number(j):void 0,Le=rt(),te=h?Rt[h]:void 0,ne=(me.find(r=>r.key===C)??me[0]).server,se={category:c,rarities:a.length?a:void 0,wearableCategories:te,minPriceCredits:R,maxPriceCredits:M,search:l||void 0,sortBy:ne,isSmart:v||void 0,onSale:!0,listingType:Le?void 0:"primary"},oe={category:c,rarities:a.length?a:void 0,wearableCategories:te,search:l||void 0,sortBy:ne,isWearableSmart:v||void 0,isOnSale:f==="not_for_sale"?!1:void 0},{items:L,total:ie,isLoading:_,isPlaceholderData:A,error:re,hasNextPage:Ue,isFetchingNextPage:ae,fetchNextPage:He}=zt(I?["shop-items",se]:["catalog-items",oe],r=>I?ot({...se,first:Y,skip:r}):it({...oe,first:Y,skip:r}),{enabled:c!=="names"}),U=ie,le=_||A,Oe=_?15:Math.min(Math.max(L.length,1),Y),{data:ce,isError:Ge}=Pe(),De=r=>ce&&r.manaWei?Me(r.manaWei,ce):null,de=m.useRef(null);m.useEffect(()=>{_||A||!l||de.current===l||(de.current=l,K("Shop Searched",{query:l,result_count:U}))},[l,_,A,U]);const H=m.useRef("__init__");m.useEffect(()=>{if(_||A)return;const r=JSON.stringify({category:c,subCategory:h,rarities:a,min:R,max:M,sort:C,status:f,smart:v});if(H.current==="__init__"||H.current===r){H.current=r;return}H.current=r,K("Shop Applied Filter",{filters:{category:c,sub_category:h,rarities:a,min_price_credits:R??null,max_price_credits:M??null,status:f,smart:v,sort:C},result_count:U})},[c,h,a,R,M,C,f,v,_,A,U]);function pe(r){d(r),p(null)}function xe(r){u(S=>S.includes(r)?S.filter(N=>N!==r):[...S,r])}function qe(){d("wearable"),p(null),u([]),w(""),$(""),y("on_sale"),k(!1)}const P=[];(R!=null||M!=null)&&P.push({key:"price",label:s("filter.price"),onRemove:()=>{w(""),$("")}});for(const r of Et)a.includes(r)&&P.push({key:`rarity-${r}`,label:st(r),onRemove:()=>xe(r)});return v&&P.push({key:"smart",label:s("filter.smart"),onRemove:()=>k(!1)}),f!=="on_sale"&&P.push({key:"status",label:f==="all"?s("filter.statusAll"):s("filter.notForSale"),onRemove:()=>y("on_sale")}),e.jsxs(lt,{"data-testid":"browse",children:[c!=="names"&&e.jsxs(e.Fragment,{children:[E?e.jsx(ct,{onClick:()=>g(!1),"aria-hidden":!0}):null,e.jsxs(dt,{"data-open":E||void 0,"data-testid":"browse-sidebar",children:[e.jsxs(pt,{children:[e.jsx(xt,{children:s("assets.filters")}),e.jsx(ht,{onClick:()=>g(!1),"aria-label":s("assets.closeFilters"),children:"✕"})]}),e.jsx(ft,{children:e.jsx(mt,{category:c,subCategory:h,onCategory:pe,onSub:p,priceMin:b,priceMax:j,onPriceMin:w,onPriceMax:$,rarities:a,onToggleRarity:xe,status:f,onStatus:y,smart:v,onSmart:k})}),e.jsx(ut,{children:e.jsx(gt,{type:"button",onClick:()=>g(!1),children:s("assets.showItems")})})]})]}),e.jsx(bt,{children:c==="names"?e.jsx(ds,{onBack:()=>pe("wearable")}):e.jsxs(e.Fragment,{children:[e.jsx(Tt,{sort:C,onSort:z,total:ie,loading:_||A,query:l,onOpenFilters:()=>g(!0),chips:P,onClearChips:qe}),Ge&&I&&L.some(r=>r.source==="legacy")?e.jsx(yt,{"data-variant":"warn",children:s("assets.marketUnavailable")}):null,re?e.jsx(It,{message:s("assets.loadError"),testId:"browse-error"}):null,!le&&L.length===0&&!re?e.jsxs(wt,{"data-testid":"browse-empty",children:[e.jsx(jt,{src:ps,alt:""}),e.jsxs(vt,{children:[e.jsx($t,{children:s("assets.empty.title")}),e.jsx(Ct,{children:x?e.jsxs(e.Fragment,{children:[s("assets.empty.searchBefore"),e.jsx("b",{children:x}),s("assets.empty.searchAfter")]}):s("assets.empty.filters")})]}),e.jsx(kt,{children:e.jsx(St,{type:"button",onClick:()=>i("/overview"),children:s("assets.empty.cta")})})]}):e.jsxs(e.Fragment,{children:[e.jsx(Dt,{"data-testid":"grid",children:le?e.jsx(fe,{count:Oe}):e.jsxs(e.Fragment,{children:[L.map(r=>{if(!I)return e.jsx(O,{item:r,mode:"view"},G(r));const S=r;if(S.source!=="legacy")return e.jsx(O,{item:r},G(r));const N=De(S);return N==null?e.jsx(O,{item:r,mode:"view"},G(r)):e.jsx(O,{item:{...S,priceCredits:N}},G(r))}),ae?e.jsx(fe,{count:6}):null]})}),e.jsx(_t,{hasNextPage:Ue,isFetching:ae,onLoadMore:()=>void He()})]})]})})]})}export{Ms as Assets};
@@ -1,4 +1,4 @@
1
- import{r as $,j as t}from"./react-vyZjIDcS.js";import{R as C,a as oe,C as ie,b as ne}from"./categories-CX6i4K78.js";import{n as c,T as se}from"./Tooltip-BbHzoPIy.js";import{t as e,s as o,I as g,e as s,o as ae,h as v}from"./index-BnbwrW-6.js";const re=o.div`
1
+ import{r as $,j as t}from"./react-vyZjIDcS.js";import{R as C,a as oe,C as ie,b as ne}from"./categories-Ci0NfrXM.js";import{n as c,T as se}from"./Tooltip-gJZXgo0b.js";import{t as e,s as o,I as g,e as s,o as ae,h as v}from"./index-DzVTWEvS.js";const re=o.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -1,4 +1,4 @@
1
- import{j as t,L as R,r as M}from"./react-vyZjIDcS.js";import{s as a,B as N,t as o,x as I,m as F,e,n as B,y as W,I as f,z as G,D as K,u as w,E as P,c as Q,F as k,l as H,q as $}from"./index-BnbwrW-6.js";import{a as O,b as _,c as X,d as J,s as U,f as V}from"./authorizations-B6wWjXdQ.js";import{a as Y}from"./builder-DJzcrQAM.js";import{f as Z}from"./errors-BYKPLdNJ.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-DVALeVb8.js";const tt=I`
1
+ import{j as t,L as R,r as M}from"./react-vyZjIDcS.js";import{s as a,B as N,t as o,x as I,m as F,e,n as B,y as W,I as f,z as G,D as K,u as w,E as P,c as Q,F as k,l as H,q as $}from"./index-DzVTWEvS.js";import{a as O,b as _,c as X,d as J,s as U,f as V}from"./authorizations-BPcNtN-P.js";import{a as Y}from"./builder-CLIpwOL9.js";import{f as Z}from"./errors-BSoF7pTC.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./sendMetaTransaction-Ci7WU1n2.js";const tt=I`
2
2
  to { transform: rotate(360deg); }
3
3
  `,it=I`
4
4
  to { background-position: -200% 0; }