@dcl/shop 0.1.0-30535358248.commit-2722a7f → 0.1.0-30555147117.commit-c0cc5df

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 (175) hide show
  1. package/assets/{Activity-CvucBHHY.js → Activity-DCbV7Dlz.js} +4 -4
  2. package/assets/{AnimatedBackground-RAMrqGx_.js → AnimatedBackground-D7rZFX-y.js} +2 -2
  3. package/assets/{Assets-knlkMAu5.js → Assets-DbLl1p1e.js} +2 -2
  4. package/assets/{Assets.styles-CvuyiKqx.js → Assets.styles-CHGtG3LU.js} +1 -1
  5. package/assets/{Authorizations-6ASyROzc.js → Authorizations-DJNBkPEr.js} +1 -1
  6. package/assets/Cart-BghZZpIP.js +695 -0
  7. package/assets/{CircularProgress-DNgXJHy_.js → CircularProgress-BrEKWj5U.js} +1 -1
  8. package/assets/{Collection-BMVrfLkT.js → Collection-BcOlqkP2.js} +1 -1
  9. package/assets/{CollectionCarousel-CEeV8t-a.js → CollectionCarousel-C3qgLsBY.js} +1 -1
  10. package/assets/{Creator-BpM4S3Hm.js → Creator-CuPJUn5F.js} +2 -2
  11. package/assets/{ErrorNotice-BStoa2Qo.js → ErrorNotice-DwAAnUwA.js} +1 -1
  12. package/assets/{ExchangeController-BYHmUZwM.js → ExchangeController-D02GxCIy.js} +1 -1
  13. package/assets/{GetCredits-BkAuC3jt.js → GetCredits-BLTnXBjj.js} +7 -7
  14. package/assets/{HelpersUtil-DRtQnbop.js → HelpersUtil-BfxyEXTh.js} +1 -1
  15. package/assets/{ImportListings-Dmc9cvXJ.js → ImportListings-CFXHsPKY.js} +6 -6
  16. package/assets/{ItemDetail-DHe174rO.js → ItemDetail-gmzGWkMe.js} +197 -197
  17. package/assets/{LoadMore-D2rhC3FV.js → LoadMore-D8bZTLv8.js} +1 -1
  18. package/assets/{MenuList-BWVPPtBW.js → MenuList-iDFhw9sU.js} +1 -1
  19. package/assets/{MyAssets-BKeT--Ql.js → MyAssets-BRzGjYcN.js} +1 -1
  20. package/assets/{MyFavorites-BHrdEY10.js → MyFavorites-CM49GENl.js} +44 -17
  21. package/assets/{NotFound-vJnWF5cu.js → NotFound-D7aOezUK.js} +1 -1
  22. package/assets/{NotificationsBell-Chozh7TD.js → NotificationsBell-BO0w1qMB.js} +1 -1
  23. package/assets/{StoreSettings-TqML4NDY.js → StoreSettings-Dl8TtNvz.js} +1 -1
  24. package/assets/{Success-D3O1Ladi.js → Success-B8p6G_k7.js} +1 -1
  25. package/assets/{SwapController-Da0gS2ji.js → SwapController-DXYt8eCk.js} +1 -1
  26. package/assets/{Tooltip-DG5HvItw.js → Tooltip-CmtPsxJu.js} +1 -1
  27. package/assets/{TradeService-DZaBK_Qv.js → TradeService-C1yOBoUa.js} +1 -1
  28. package/assets/{W3MFrameProviderSingleton-DAYqclPH.js → W3MFrameProviderSingleton-_nUMMN_r.js} +3 -3
  29. package/assets/{WebCryptoP256-C0lhkhci.js → WebCryptoP256-BOLkPPIP.js} +1 -1
  30. package/assets/{authorizations-BVmXaQeu.js → authorizations-CzNpcwj-.js} +1 -1
  31. package/assets/{basic-DO7LyzkW.js → basic-IpbulmwC.js} +1 -1
  32. package/assets/{biconomy-DmIZbqMf.js → biconomy-C9xwq1iP.js} +1 -1
  33. package/assets/{browseLayout.styles-DBRHDPrA.js → browseLayout.styles-Gi_W6L0Y.js} +8 -8
  34. package/assets/{builder-D-ICo29L.js → builder-BLl0dWNe.js} +1 -1
  35. package/assets/{buy-Ccaxv3lt.js → buy-VVCbwxmX.js} +1 -1
  36. package/assets/{buy-gasless-UjTpzokh.js → buy-gasless-Cw6IFMAC.js} +1 -1
  37. package/assets/{categories-BFgtEsDl.js → categories-D7Zdwanh.js} +1 -1
  38. package/assets/{ccip--AYEzQZX.js → ccip-D3gG15Tx.js} +1 -1
  39. package/assets/{ccip-XSek2mtN.js → ccip-DxAXdNb6.js} +1 -1
  40. package/assets/{clsx-CsyFr0ZL.js → clsx-CWRNqKvL.js} +2 -2
  41. package/assets/{controller-UEFY0vzS.js → controller-z_ubtZAp.js} +2 -2
  42. package/assets/{core-BvM6vAlM.js → core-B3AJ_0ua.js} +4 -4
  43. package/assets/{createSvgIcon-CqEJzhBK.js → createSvgIcon-CPVuPy9d.js} +2 -2
  44. package/assets/{custom-CmDrwoPL.js → custom-Dz8prIE7.js} +1 -1
  45. package/assets/{data-capture-BGpPQSe4.js → data-capture-BB1fv1MC.js} +1 -1
  46. package/assets/{email-MR7l-5-Z.js → email-fbqqGJ2s.js} +1 -1
  47. package/assets/{embedded-wallet-jJ0wwb2F.js → embedded-wallet-BJhLZ3lj.js} +1 -1
  48. package/assets/{emotion-styled.browser.esm-BjI-2U8x.js → emotion-styled.browser.esm-CyKS4j--.js} +1 -1
  49. package/assets/{engine-CLWZ2d9c.js → engine-BGXLTiQ_.js} +1 -1
  50. package/assets/{errors-BfJQR72Z.js → errors-w45osmm9.js} +1 -1
  51. package/assets/{estimate-l1-fee-DZ79UIrf.js → estimate-l1-fee-dybW3PfS.js} +1 -1
  52. package/assets/{execute-DOgqp-6j.js → execute-CbayRz2e.js} +2 -2
  53. package/assets/{features-ChZmqAVE.js → features-94WCX2Ou.js} +1 -1
  54. package/assets/{fetchTokenMetadata-C3VIvOiy.js → fetchTokenMetadata-EsaUgq3p.js} +2 -2
  55. package/assets/{get-ecosystem-wallet-info-1W7jn21T.js → get-ecosystem-wallet-info-DWv-IFz5.js} +1 -1
  56. package/assets/{getBalance-ofifHtS7.js → getBalance-Dz92_v99.js} +1 -1
  57. package/assets/{getNFT-D3I1Pmv7.js → getNFT-B1pdUf6E.js} +1 -1
  58. package/assets/{getNFT-0GUqM1mE.js → getNFT-EyZ4qlqr.js} +1 -1
  59. package/assets/{getThemeProps-DMJMKWz1.js → getThemeProps-CpslPeXJ.js} +1 -1
  60. package/assets/{grid.styles-BdzonCru.js → grid.styles-BT8g6G1w.js} +1 -1
  61. package/assets/{hashTypedData-BQ7YG-GD.js → hashTypedData-BkhJypb9.js} +1 -1
  62. package/assets/{hashTypedData-SMqK0Bvk.js → hashTypedData-VXV11ywt.js} +1 -1
  63. package/assets/{import-BBD0DWIT.js → import-CjcH4cDS.js} +1 -1
  64. package/assets/{in-app-wallet-calls-D8u8Lb5V.js → in-app-wallet-calls-Ymglwrpz.js} +1 -1
  65. package/assets/{in-app-CxfPziwR.js → in-app-x5rZbfaN.js} +1 -1
  66. package/assets/{index-uF4O1HZa.js → index-8ajBsaIg.js} +1 -1
  67. package/assets/{index-DpRFZG3X.js → index-9PvOV8po.js} +1 -1
  68. package/assets/{index-BYWBHUre.js → index-9QCAyhSS.js} +1 -1
  69. package/assets/{index-D7jjeu20.js → index-BBMJuL6J.js} +2 -2
  70. package/assets/{index-pFP2Nx_c.js → index-BFnETbyc.js} +1 -1
  71. package/assets/{index-CF_sMyTl.js → index-BLFM-OTz.js} +2 -2
  72. package/assets/{index-YUVIXaKh.css → index-BMzstP-8.css} +1 -1
  73. package/assets/{index-CwAAZj9L.js → index-BU6KJB83.js} +3 -3
  74. package/assets/{index-DBpv4hR1.js → index-BX6zRkQu.js} +1 -1
  75. package/assets/{index-BIl576Hj.js → index-BcMB9SzQ.js} +1 -1
  76. package/assets/{index-DK6Afp1x.js → index-BfQNtRN2.js} +2 -2
  77. package/assets/{index-CDKfv2bi.js → index-BgtS_WGf.js} +2 -2
  78. package/assets/index-BuQvO-I_.js +2815 -0
  79. package/assets/{index-CufAJ6Dp.js → index-C5sGgO2Z.js} +1 -1
  80. package/assets/{index-BhaRkjyI.js → index-C7ZO8TeQ.js} +1 -1
  81. package/assets/{index-De2dnF3o.js → index-C98Y4Kcd.js} +1 -1
  82. package/assets/{index-DAMK8alV.js → index-CAKt5A1a.js} +1 -1
  83. package/assets/{index-BHA1eBb6.js → index-CE288NDM.js} +1 -1
  84. package/assets/{index-BMX5hUGo.js → index-CEeFcj09.js} +1 -1
  85. package/assets/{index-BumYVyPx.js → index-CLHh2p8J.js} +1 -1
  86. package/assets/{index-_MfLxWCe.js → index-CPgr_tFp.js} +1 -1
  87. package/assets/{index-r9DiwXAN.js → index-CV4-Elfa.js} +1 -1
  88. package/assets/{index-DkzGDwlW.js → index-Ca6u28zB.js} +1 -1
  89. package/assets/{index-CDl1_5Gn.js → index-CdVDWbCf.js} +1 -1
  90. package/assets/{index-C-lIghD5.js → index-CfEIPaZw.js} +3 -3
  91. package/assets/{index-CbdwidXO.js → index-ChJR2Cb6.js} +1 -1
  92. package/assets/{index-B8hqb_ut.js → index-Cif8I2ag.js} +1 -1
  93. package/assets/{index-Dvv2TfLB.js → index-CkmitkFW.js} +1 -1
  94. package/assets/{index-DCo_b6w_.js → index-CtNwLSfQ.js} +1 -1
  95. package/assets/{index-XhO07huK.js → index-CwxnxxLC.js} +1 -1
  96. package/assets/{index-BiuoTYZN.js → index-CxfClWVp.js} +1 -1
  97. package/assets/{index-2vrBl8sT.js → index-D1DRMy8J.js} +1 -1
  98. package/assets/{index-C1nKRU6X.js → index-D5knZcXs.js} +1 -1
  99. package/assets/{index-Bf-t954n.js → index-DEUtIbvw.js} +1 -1
  100. package/assets/{index-DLYns3Ur.js → index-DNn84jht.js} +1 -1
  101. package/assets/{index-CbbvhaCZ.js → index-DRYd17R7.js} +1 -1
  102. package/assets/{index-CheBwFGj.js → index-DVj7ZD_M.js} +1 -1
  103. package/assets/{index-zc0VnW3D.js → index-DfwSZDrU.js} +1 -1
  104. package/assets/{index-BsLfKftk.js → index-DkJikW0i.js} +2 -2
  105. package/assets/{index-m5SntnZ-.js → index-Dl5is3QK.js} +1 -1
  106. package/assets/{index-2cVzfxOB.js → index-Dyl2Q7D5.js} +1 -1
  107. package/assets/{index-CQqiVn6f.js → index-DzvSkfmg.js} +1 -1
  108. package/assets/{index-BTZdGMI1.js → index-ExQbvVoB.js} +1 -1
  109. package/assets/{index-Du25SJyr.js → index-HythI0O3.js} +3 -3
  110. package/assets/{index-_FQ-SV4x.js → index-LKOnauOl.js} +1 -1
  111. package/assets/{index-B56ftAbJ.js → index-RIvQTx8Y.js} +1 -1
  112. package/assets/{index-SqWDQHXX.js → index-R_BTue84.js} +1 -1
  113. package/assets/{index-CfG77Wyl.js → index-cT8CoAgc.js} +1 -1
  114. package/assets/{index-BU6Q-KL3.js → index-m4CDcFCJ.js} +1 -1
  115. package/assets/{index-CEiPmUBh.js → index-mX19fYJK.js} +1 -1
  116. package/assets/{index-Do9Xy8lr.js → index-vhIb1kkg.js} +1 -1
  117. package/assets/{index-C_o1Zom8.js → index-ywZbqGdK.js} +1 -1
  118. package/assets/{index.es-DXmbtBur.js → index.es-9cuw7AIG.js} +1 -1
  119. package/assets/{index.es-D3lybDuO.js → index.es-C3lxlyK0.js} +1 -1
  120. package/assets/{index.es-DXhNuD76.js → index.es-CdIjtqga.js} +4 -4
  121. package/assets/{localBatchGatewayRequest-CExVMgRH.js → localBatchGatewayRequest-D8nesUnT.js} +1 -1
  122. package/assets/{mana-convert-cZR9DTGN.js → mana-convert-CJwIMTsi.js} +1 -1
  123. package/assets/{mana-rate-cSpFrGml.js → mana-rate-BjJ4VPVX.js} +1 -1
  124. package/assets/{networks-DRyUri_T.js → networks-DJ8NMmpk.js} +1 -1
  125. package/assets/{onramp-B1GVlRI3.js → onramp-Dp70skLy.js} +1 -1
  126. package/assets/{openzeppelin-78-FJYh6.js → openzeppelin-o4LserP7.js} +1 -1
  127. package/assets/{parseNft-Ci4sX3gJ.js → parseNft-DyV_faDA.js} +2 -2
  128. package/assets/{parseSignature-uB_1oAEz.js → parseSignature-DcV_CWPU.js} +1 -1
  129. package/assets/{parseSignature-CTZ9pKw7.js → parseSignature-nmdMwQ7H.js} +3 -3
  130. package/assets/{passkeys-CA3YYnAU.js → passkeys-DSmRIXvD.js} +1 -1
  131. package/assets/{pay-with-exchange-DAyDjUqu.js → pay-with-exchange-CMlWCwA-.js} +1 -1
  132. package/assets/{qr-overlay-BTio6zaV.js → qr-overlay-Dr097QQh.js} +1 -1
  133. package/assets/{receive-yChzvN3k.js → receive-BA30V6DG.js} +1 -1
  134. package/assets/{resolveImplementation-CJVJqdzd.js → resolveImplementation-CMn2be6C.js} +1 -1
  135. package/assets/{rpc-DUGIeI5g.js → rpc-DInWGKvF.js} +1 -1
  136. package/assets/{secp256k1-C54GlILm.js → secp256k1-BTduTORI.js} +1 -1
  137. package/assets/{secp256k1-DwMMQidi.js → secp256k1-BUubbbM8.js} +1 -1
  138. package/assets/{secp256k1-B3QC3RZg.js → secp256k1-CfCSXbGA.js} +1 -1
  139. package/assets/{send-XMScNnJu.js → send-C9h_Nq4W.js} +1 -1
  140. package/assets/{send-batch-transaction-ByP9c7mI.js → send-batch-transaction-CxCYZMmx.js} +1 -1
  141. package/assets/{send-eip712-transaction-B6wWlCEV.js → send-eip712-transaction-DtfuXZ3d.js} +2 -2
  142. package/assets/{send-gasless-transaction-CCtF_hMm.js → send-gasless-transaction-DCcHZj4r.js} +2 -2
  143. package/assets/{send-transaction-D8-Foq0N.js → send-transaction-CS28b2D9.js} +2 -2
  144. package/assets/{sendMetaTransaction-CdI6QA-v.js → sendMetaTransaction-BZ7AB8iM.js} +1 -1
  145. package/assets/{sendRawTransaction-BZO-KbQ7.js → sendRawTransaction-DYCcmGM8.js} +3 -3
  146. package/assets/{serializeTransaction-LcE2ddKR.js → serializeTransaction-BURsrWBP.js} +1 -1
  147. package/assets/{session-proposal-BGYLVtWS.js → session-proposal-Fqbqs3BQ.js} +1 -1
  148. package/assets/{session-request-B4DLpo1c.js → session-request-SGm1lg_K.js} +2 -2
  149. package/assets/{signing-D-serK4b.js → signing-DYbMGJXG.js} +3 -3
  150. package/assets/{socials-DOdAv2Kb.js → socials-I4tJUDyJ.js} +1 -1
  151. package/assets/{swaps-DDatq7je.js → swaps-CwWUu5zw.js} +1 -1
  152. package/assets/{thirdweb-tS0phgDU.js → thirdweb-ClhSV9RB.js} +3 -3
  153. package/assets/{to-serializable-transaction-BjLSxJFE.js → to-serializable-transaction-CJKUUbtG.js} +2 -2
  154. package/assets/{trade-encoding-CJDVWYcF.js → trade-encoding-9Q36L1oR.js} +1 -1
  155. package/assets/{transactionReceipt-C1bkyZl1.js → transactionReceipt-D6SA5WI-.js} +1 -1
  156. package/assets/{transactions-BQh9q_5C.js → transactions-B_RyJBLE.js} +1 -1
  157. package/assets/{useCreditPacks-puL7tAtr.js → useCreditPacks-CQLtHnQk.js} +1 -1
  158. package/assets/{useInfiniteGrid-BxfEkchv.js → useInfiniteGrid-CaF2w2LC.js} +1 -1
  159. package/assets/useManaRate-B4xS82Ma.js +1 -0
  160. package/assets/{useSecondarySales-W8e5_GEF.js → useSecondarySales-BL0-GE0K.js} +1 -1
  161. package/assets/{useStore-B7PIu8Uw.js → useStore-GXb9v5v6.js} +1 -1
  162. package/assets/{useTheme-CbnMJ7mn.js → useTheme-JT9c87P9.js} +1 -1
  163. package/assets/{verifyHash-CjYiVJ2q.js → verifyHash-BNsLW48c.js} +1 -1
  164. package/assets/{w3m-modal-q4l3tcYV.js → w3m-modal-C-8IZr2V.js} +1 -1
  165. package/assets/{w3m-modal-BFtxRT9O.js → w3m-modal-Dnehziva.js} +1 -1
  166. package/assets/{wait-for-tx-receipt-DTWTovYR.js → wait-for-tx-receipt-BXVft6N8.js} +1 -1
  167. package/assets/{wallets-Dka8GiAQ.js → wallets-BcnalF0U.js} +5 -5
  168. package/assets/{web-connector-BB8cyTKu.js → web-connector-AcMV6Y4R.js} +3 -3
  169. package/assets/{writeContract-CznbjJyh.js → writeContract-Cnl1Hojy.js} +1 -1
  170. package/assets/{zoraTestnet-DhqU039o.js → zoraTestnet-Dwinu5_g.js} +1 -1
  171. package/index.html +11 -11
  172. package/package.json +2 -2
  173. package/assets/Cart-CktbEy9V.js +0 -676
  174. package/assets/index-D6kQ69Bn.js +0 -2815
  175. package/assets/useManaRate-x5FL9eAV.js +0 -1
@@ -1,4 +1,4 @@
1
- import{M as N,N as U,O as o,P as n,H as D,x as M}from"./index-D6kQ69Bn.js";import{r as w,j as g}from"./react-vyZjIDcS.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-CsyFr0ZL.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 t=44,B=M(P||(P=l`
1
+ import{M as N,N as U,O as o,P as n,H as D,x as M}from"./index-BuQvO-I_.js";import{r as w,j as g}from"./react-vyZjIDcS.js";import{g as z,a as E,c as I,b as F,s as v}from"./clsx-CWRNqKvL.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 t=44,B=M(P||(P=l`
2
2
  0% {
3
3
  transform: rotate(0deg);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as c,af as J,ag as z,I as X,e as a,c as ee,l as te,u as ae,m as re,h as oe,S as E,A as ie,ah as se,ai as ne}from"./index-D6kQ69Bn.js";import{E as ce}from"./ErrorNotice-BStoa2Qo.js";import{d as le,g as de,a as pe,P as xe,C as ue,b as me,c as ge,B as he,S as be,M as fe,A as je}from"./browseLayout.styles-DBRHDPrA.js";import{u as ve}from"./useStore-B7PIu8Uw.js";import{c as F,a as ye,F as Ce,d as we,P as Se,e as ke,H as Ae,S as Ne}from"./categories-BFgtEsDl.js";import{L as $e}from"./LoadMore-D2rhC3FV.js";import{u as Pe}from"./useInfiniteGrid-BxfEkchv.js";import{G as Me}from"./grid.styles-BdzonCru.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const Re=c.section`
1
+ import{j as e,r as m,e as Y,b as Z}from"./react-vyZjIDcS.js";import{t as v,s as c,af as J,ag as z,I as X,e as a,c as ee,l as te,u as ae,m as re,h as oe,S as E,A as ie,ah as se,ai as ne}from"./index-BuQvO-I_.js";import{E as ce}from"./ErrorNotice-DwAAnUwA.js";import{d as le,g as de,a as pe,P as xe,C as ue,b as me,c as ge,B as he,S as be,M as fe,A as je}from"./browseLayout.styles-Gi_W6L0Y.js";import{u as ve}from"./useStore-GXb9v5v6.js";import{c as F,a as ye,F as Ce,d as we,P as Se,e as ke,H as Ae,S as Ne}from"./categories-D7Zdwanh.js";import{L as $e}from"./LoadMore-D8bZTLv8.js";import{u as Pe}from"./useInfiniteGrid-CaF2w2LC.js";import{G as Me}from"./grid.styles-BT8g6G1w.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const Re=c.section`
2
2
  position: relative;
3
3
  border-radius: ${v.radius.card};
4
4
  overflow: hidden;
@@ -1,4 +1,4 @@
1
- import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as k,J as j,bb as C,h as G,x as Y,I as Q,l as X,a as W,C as B,b as J,bc as Z,bd as F,A as q}from"./index-D6kQ69Bn.js";import{s as ee,h as U,A as H,g as K,r as te,m as ne,e as ae}from"./authorizations-BVmXaQeu.js";import{i as ie}from"./errors-BfJQR72Z.js";import{E as oe}from"./ErrorNotice-BStoa2Qo.js";import{a as se}from"./buy-Ccaxv3lt.js";import{g as re,d as ce}from"./trade-encoding-CJDVWYcF.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-CdI6QA-v.js";import{I as he,C as ue}from"./ethers-CXBJm_wN.js";const L="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(L,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(L)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(L)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(a){var m,f,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,d=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const l=n-i,b=fe(l,n,s);d>=b&&c.push({method:"combined",creditsCents:i,manaWei:b})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((m=c.find(l=>l.method==="credits"))==null?void 0:m.method)??((f=c.find(l=>l.method==="combined"))==null?void 0:f.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,y=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:y}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",be=e.div`
1
+ import{j as t,r as v}from"./react-vyZjIDcS.js";import{s as e,t as o,e as g,z as k,J as j,bc as C,h as G,x as Y,I as Q,l as X,a as W,C as B,b as J,bd as Z,be as F,A as q}from"./index-BuQvO-I_.js";import{s as ee,h as U,A as H,g as K,r as te,m as ne,e as ae}from"./authorizations-CzNpcwj-.js";import{i as ie}from"./errors-w45osmm9.js";import{E as oe}from"./ErrorNotice-DwAAnUwA.js";import{a as se}from"./buy-VVCbwxmX.js";import{g as re,d as ce}from"./trade-encoding-9Q36L1oR.js";import{s as de,M as le,E as pe}from"./sendMetaTransaction-BZ7AB8iM.js";import{I as he,C as ue}from"./ethers-CXBJm_wN.js";const L="shop:resume_after_signin",xe=900*1e3;function rt(a){try{sessionStorage.setItem(L,JSON.stringify({...a,at:Date.now()}))}catch{}}function ct(a){let n;try{n=sessionStorage.getItem(L)}catch{return null}if(!n)return null;try{sessionStorage.removeItem(L)}catch{}let i;try{i=JSON.parse(n)}catch{return null}return!i||i.type!==a||typeof i.at!="number"||Date.now()-i.at>xe?null:i.type==="cart-checkout"?{type:"cart-checkout"}:{type:"item-buy",path:i.path}}function ge(a,n){return(a+n-1n)/n}function fe(a,n,i){return a<=0||n<=0?0n:a>=n?i:ge(i*BigInt(a),BigInt(n))}function dt(a){var m,f,w;const n=Number.isFinite(a.priceCents)?Math.max(0,Math.trunc(a.priceCents)):0,i=Number.isFinite(a.balanceCents)?Math.max(0,Math.trunc(a.balanceCents)):0,s=a.priceManaWei>0n?a.priceManaWei:0n,d=a.manaBalanceWei>0n?a.manaBalanceWei:0n;if(n<=0)return{options:[],preferred:null,manaShortfall:null};const c=[];if(i>=n&&c.push({method:"credits",creditsCents:n,manaWei:0n}),s>0n&&i>0&&i<n){const l=n-i,b=fe(l,n,s);d>=b&&c.push({method:"combined",creditsCents:i,manaWei:b})}s>0n&&d>=s&&c.push({method:"mana",creditsCents:0,manaWei:s});const p=((m=c.find(l=>l.method==="credits"))==null?void 0:m.method)??((f=c.find(l=>l.method==="combined"))==null?void 0:f.method)??((w=c.find(l=>l.method==="mana"))==null?void 0:w.method)??null,y=!c.some(l=>l.method==="mana"||l.method==="combined")&&s>0n&&d>0n?{manaWei:d,manaCents:me(d,n,s),priceCents:n}:null;return{options:c,preferred:p,manaShortfall:y}}function me(a,n,i){return Number(a*BigInt(n)/i)}function lt(a,n){let i=Number.isFinite(n)?Math.max(0,Math.trunc(n)):0;return a.map(s=>{const d=Number.isFinite(s)?Math.max(0,Math.trunc(s)):0,c=Math.min(d,i);return i-=c,c})}function z(a){return Number.isFinite(a)?Math.max(0,a)/10:0}function pt(a,n){return a.options.find(i=>i.method===n)??null}function ht(a,n){if(!Number.isFinite(a)||a<=0||n<=0n)return null;const i=a/10;return Number(n)/1e18/i}const T="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201'%3e%3cpath%20id='Vector'%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%202L22%2012L12%2022L2%2012L12%202ZM12%204.8L19.2%2012L12%2019.2L4.8%2012L12%204.8ZM12%2015.6C12.9548%2015.6001%2013.8705%2015.2209%2014.5457%2014.5459C15.2209%2013.8708%2015.6003%2012.9552%2015.6004%2012.0004C15.6005%2011.0456%2015.2213%2010.1299%2014.5463%209.45471C13.8712%208.7795%2012.9556%208.40011%2012.0008%208.4C11.0461%208.4%2010.1304%208.77928%209.45525%209.45442C8.78012%2010.1295%208.40083%2011.0452%208.40083%2012C8.40083%2012.9548%208.78012%2013.8705%209.45525%2014.5456C10.1304%2015.2207%2011.0461%2015.6%2012.0008%2015.6H12Z'%20fill='white'/%3e%3cg%20id='Rectangle%201'%3e%3c/g%3e%3c/g%3e%3c/svg%3e",be=e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 12px;
@@ -1,4 +1,4 @@
1
- import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";import{t as Z,az as we,aA as R,aB as _,s as a,aC as je,G as ve,aD as Ce,e as t,aE as W,B as ye,H as q,af as J,n as $e,ag as Q,I as T,c as ke,m as Ne,S,h as Pe,A as Se,ay as Le,aF as Ae}from"./index-D6kQ69Bn.js";import{d as Me,g as ze,a as Fe,P as Be,C as Ee,b as Ie,c as Re,A as _e,B as We,S as Te,M as He,e as Ge,f as Ue}from"./browseLayout.styles-DBRHDPrA.js";import{u as De,L as Ke}from"./useStore-B7PIu8Uw.js";import{c as H,a as Oe,F as Ve,d as Ye,P as Ze,e as qe,H as Je,S as Qe}from"./categories-BFgtEsDl.js";import{L as G}from"./LoadMore-D2rhC3FV.js";import{u as U}from"./useInfiniteGrid-BxfEkchv.js";import{E as D}from"./ErrorNotice-BStoa2Qo.js";import{G as K}from"./grid.styles-BdzonCru.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const{colors:m,radius:X,media:Xe}=Z,et=a.article`
1
+ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";import{t as Z,aA as we,aB as R,aC as _,s as a,aD as je,G as ve,aE as Ce,e as t,aF as W,B as ye,H as q,af as J,n as $e,ag as Q,I as T,c as ke,m as Ne,S,h as Pe,A as Se,az as Le,aG as Ae}from"./index-BuQvO-I_.js";import{d as Me,g as ze,a as Fe,P as Be,C as Ee,b as Ie,c as Re,A as _e,B as We,S as Te,M as Ge,e as He,f as Ue}from"./browseLayout.styles-Gi_W6L0Y.js";import{u as De,L as Ke}from"./useStore-GXb9v5v6.js";import{c as G,a as Oe,F as Ve,d as Ye,P as Ze,e as qe,H as Je,S as Qe}from"./categories-D7Zdwanh.js";import{L as H}from"./LoadMore-D8bZTLv8.js";import{u as U}from"./useInfiniteGrid-CaF2w2LC.js";import{E as D}from"./ErrorNotice-DwAAnUwA.js";import{G as K}from"./grid.styles-BT8g6G1w.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";const{colors:m,radius:X,media:Xe}=Z,et=a.article`
2
2
  height: 300px;
3
3
  background: ${m.bg};
4
4
  border-radius: ${X.card};
@@ -303,4 +303,4 @@ import{b as Y,j as e,L as ue,e as fe,u as be,r as y}from"./react-vyZjIDcS.js";im
303
303
  &:hover {
304
304
  background: rgba(255, 255, 255, 0.14);
305
305
  }
306
- `,Nt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Pt({address:r}){var h,$;const{data:i}=J(r),{data:n}=De(r),l=$e(c=>{var k;return(k=c.session)==null?void 0:k.address}),x=!!l&&l.toLowerCase()===r.toLowerCase(),u=(i==null?void 0:i.name)||Q(r),f=($=(h=i==null?void 0:i.avatar)==null?void 0:h.snapshots)==null?void 0:$.face256,C=(n==null?void 0:n.cover)||Me,d=n==null?void 0:n.description,w=`${ke.profileUrl}/${r}`,g=Ke.filter(c=>n==null?void 0:n.links[c]),b=ze(Fe({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??r}));return e.jsxs(gt,{"aria-label":`${u} storefront`,children:[e.jsxs(mt,{children:[e.jsx(ut,{src:C,alt:"",loading:"eager"}),e.jsx(ft,{"aria-hidden":!0})]}),(g.length>0||x)&&e.jsxs(bt,{children:[g.map(c=>e.jsx(wt,{"data-testid":"creator-hero-link",href:(n==null?void 0:n.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:t(`creator.link.${c}`),"aria-label":t(`creator.link.${c}`),children:e.jsx(T,{name:Nt[c]})},c)),x&&e.jsx(jt,{to:"/store-settings",title:t("creator.editStore"),"aria-label":t("creator.editStore"),children:e.jsx(T,{name:"pen"})})]}),e.jsxs(vt,{children:[f?e.jsx(O,{src:f,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(O,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsxs("div",{children:[e.jsx(Ct,{children:u}),d?e.jsx(yt,{children:d}):null]}),e.jsxs($t,{children:[e.jsx(kt,{"data-testid":"creator-hero-view",href:w,target:"_blank",rel:"noopener noreferrer",children:t("creator.viewProfile")}),e.jsx(pt,{address:r,className:"creator-hero__follow"})]})]})]})}const V=48;function Ht(){const{address:r}=fe(),i=Y(),[n]=be(),l=n.has("collections"),{data:x}=J(r),u=(x==null?void 0:x.name)||(r?Q(r):t("creator.fallbackName"));Ne({title:u,description:t("seo.creator.description",{name:u})});const[f,C]=y.useState("wearable"),[d,w]=y.useState(null),[g,b]=y.useState([]),[h,$]=y.useState(""),[c,k]=y.useState(""),[A,oe]=y.useState("newest"),M=h&&!Number.isNaN(Number(h))?Number(h):void 0,z=c&&!Number.isNaN(Number(c))?Number(c):void 0,ae=d?Qe[d]:void 0,re=(H.find(o=>o.key===A)??H[0]).server,F={creator:r,category:f,rarities:g.length?g:void 0,wearableCategories:ae,minPriceCredits:M,maxPriceCredits:z,sortBy:re},{items:N,total:ne,isLoading:P,error:B,hasNextPage:se,isFetchingNextPage:E,fetchNextPage:ce}=U(["creator-listings",F],o=>Le({...F,first:V,skip:o}),{enabled:!!r&&!l}),p=U(["creator-collections",r],o=>Ae(r,{first:V,skip:o}).then(s=>({items:s.collections,total:s.total})),{enabled:!!r&&l});function le(o){C(o),w(null),l&&I()}function I(){const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}`:""},{replace:!0})}function de(){if(l){I();return}const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}&collections`:"?collections"},{replace:!0})}function he(o){b(s=>s.includes(o)?s.filter(me=>me!==o):[...s,o])}function xe(){C("wearable"),w(null),b([]),$(""),k("")}const L=!!(M||z),pe=L?`${h||"0"}–${c||"∞"}`:t("filter.price"),ge=f!=="wearable"||!!d||g.length>0||L;return e.jsxs(Be,{children:[e.jsxs(Ee,{"aria-label":t("creator.breadcrumbAria"),children:[e.jsx(Ie,{onClick:()=>i("/assets"),children:t("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Re,{children:u})]}),r?e.jsx(Pt,{address:r}):null,!l&&!P&&N.length>0?e.jsx(_e,{items:N,source:"creator"}):null,e.jsxs(We,{children:[e.jsx(Te,{children:e.jsx(Oe,{category:f,subCategory:d,onCategory:le,onSub:w,title:t("creator.category"),flat:!0,collections:l,onCollections:de})}),e.jsx(He,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(Ge,{children:e.jsx(Ue,{children:p.isLoading?"…":t("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{"data-variant":"collections",children:p.isLoading?e.jsx(S,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(o=>e.jsx(xt,{collection:o,itemCount:o.itemCount},o.contractAddress)),p.isFetchingNextPage?e.jsx(S,{count:6}):null]})}),e.jsx(G,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:t("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{rarities:g,onToggleRarity:he,sort:A,onSort:oe,total:ne,loading:P,anyActive:ge,onClear:xe,renderTrailing:o=>e.jsx(Ye,{panelKey:"price",label:pe,active:L,panel:o,children:e.jsxs(Ze,{"data-variant":"price",children:[e.jsxs(qe,{children:[e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMin"),placeholder:t("creator.priceMinPlaceholder"),value:h,onChange:s=>$(s.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMax"),placeholder:t("creator.priceMaxPlaceholder"),value:c,onChange:s=>k(s.target.value)})]}),e.jsx(Je,{children:t("creator.priceHint",{currency:Pe.name})})]})})}),B?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{children:P?e.jsx(S,{count:15}):e.jsxs(e.Fragment,{children:[N.map(o=>e.jsx(Se,{item:o},o.id)),E?e.jsx(S,{count:6}):null]})}),e.jsx(G,{hasNextPage:se,isFetching:E,onLoadMore:()=>void ce()}),!P&&!B&&N.length===0?e.jsx("p",{className:"muted",children:t("creator.empty")}):null]})})]})]})}export{Ht as Creator,Ht as default};
306
+ `,Nt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Pt({address:r}){var h,$;const{data:i}=J(r),{data:n}=De(r),l=$e(c=>{var k;return(k=c.session)==null?void 0:k.address}),x=!!l&&l.toLowerCase()===r.toLowerCase(),u=(i==null?void 0:i.name)||Q(r),f=($=(h=i==null?void 0:i.avatar)==null?void 0:h.snapshots)==null?void 0:$.face256,C=(n==null?void 0:n.cover)||Me,d=n==null?void 0:n.description,w=`${ke.profileUrl}/${r}`,g=Ke.filter(c=>n==null?void 0:n.links[c]),b=ze(Fe({name:i==null?void 0:i.name,hasClaimedName:i==null?void 0:i.hasClaimedName,ethAddress:(i==null?void 0:i.ethAddress)??r}));return e.jsxs(gt,{"aria-label":`${u} storefront`,children:[e.jsxs(mt,{children:[e.jsx(ut,{src:C,alt:"",loading:"eager"}),e.jsx(ft,{"aria-hidden":!0})]}),(g.length>0||x)&&e.jsxs(bt,{children:[g.map(c=>e.jsx(wt,{"data-testid":"creator-hero-link",href:(n==null?void 0:n.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:t(`creator.link.${c}`),"aria-label":t(`creator.link.${c}`),children:e.jsx(T,{name:Nt[c]})},c)),x&&e.jsx(jt,{to:"/store-settings",title:t("creator.editStore"),"aria-label":t("creator.editStore"),children:e.jsx(T,{name:"pen"})})]}),e.jsxs(vt,{children:[f?e.jsx(O,{src:f,alt:"",loading:"eager",style:{backgroundColor:b}}):e.jsx(O,{as:"span","aria-hidden":!0,style:{backgroundColor:b}}),e.jsxs("div",{children:[e.jsx(Ct,{children:u}),d?e.jsx(yt,{children:d}):null]}),e.jsxs($t,{children:[e.jsx(kt,{"data-testid":"creator-hero-view",href:w,target:"_blank",rel:"noopener noreferrer",children:t("creator.viewProfile")}),e.jsx(pt,{address:r,className:"creator-hero__follow"})]})]})]})}const V=48;function Gt(){const{address:r}=fe(),i=Y(),[n]=be(),l=n.has("collections"),{data:x}=J(r),u=(x==null?void 0:x.name)||(r?Q(r):t("creator.fallbackName"));Ne({title:u,description:t("seo.creator.description",{name:u})});const[f,C]=y.useState("wearable"),[d,w]=y.useState(null),[g,b]=y.useState([]),[h,$]=y.useState(""),[c,k]=y.useState(""),[A,oe]=y.useState("newest"),M=h&&!Number.isNaN(Number(h))?Number(h):void 0,z=c&&!Number.isNaN(Number(c))?Number(c):void 0,ae=d?Qe[d]:void 0,re=(G.find(o=>o.key===A)??G[0]).server,F={creator:r,category:f,rarities:g.length?g:void 0,wearableCategories:ae,minPriceCredits:M,maxPriceCredits:z,sortBy:re},{items:N,total:ne,isLoading:P,error:B,hasNextPage:se,isFetchingNextPage:E,fetchNextPage:ce}=U(["creator-listings",F],o=>Le({...F,first:V,skip:o}),{enabled:!!r&&!l}),p=U(["creator-collections",r],o=>Ae(r,{first:V,skip:o}).then(s=>({items:s.collections,total:s.total})),{enabled:!!r&&l});function le(o){C(o),w(null),l&&I()}function I(){const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}`:""},{replace:!0})}function de(){if(l){I();return}const o=new URLSearchParams(n);o.delete("collections");const s=o.toString();i({search:s?`?${s}&collections`:"?collections"},{replace:!0})}function he(o){b(s=>s.includes(o)?s.filter(me=>me!==o):[...s,o])}function xe(){C("wearable"),w(null),b([]),$(""),k("")}const L=!!(M||z),pe=L?`${h||"0"}–${c||"∞"}`:t("filter.price"),ge=f!=="wearable"||!!d||g.length>0||L;return e.jsxs(Be,{children:[e.jsxs(Ee,{"aria-label":t("creator.breadcrumbAria"),children:[e.jsx(Ie,{onClick:()=>i("/assets"),children:t("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Re,{children:u})]}),r?e.jsx(Pt,{address:r}):null,!l&&!P&&N.length>0?e.jsx(_e,{items:N,source:"creator"}):null,e.jsxs(We,{children:[e.jsx(Te,{children:e.jsx(Oe,{category:f,subCategory:d,onCategory:le,onSub:w,title:t("creator.category"),flat:!0,collections:l,onCollections:de})}),e.jsx(Ge,{children:l?e.jsxs(e.Fragment,{children:[e.jsx(He,{children:e.jsx(Ue,{children:p.isLoading?"…":t("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{"data-variant":"collections",children:p.isLoading?e.jsx(S,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(o=>e.jsx(xt,{collection:o,itemCount:o.itemCount},o.contractAddress)),p.isFetchingNextPage?e.jsx(S,{count:6}):null]})}),e.jsx(H,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:t("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(Ve,{rarities:g,onToggleRarity:he,sort:A,onSort:oe,total:ne,loading:P,anyActive:ge,onClear:xe,renderTrailing:o=>e.jsx(Ye,{panelKey:"price",label:pe,active:L,panel:o,children:e.jsxs(Ze,{"data-variant":"price",children:[e.jsxs(qe,{children:[e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMin"),placeholder:t("creator.priceMinPlaceholder"),value:h,onChange:s=>$(s.target.value)}),e.jsx("span",{children:"–"}),e.jsx("input",{type:"number",min:"0","aria-label":t("creator.priceMax"),placeholder:t("creator.priceMaxPlaceholder"),value:c,onChange:s=>k(s.target.value)})]}),e.jsx(Je,{children:t("creator.priceHint",{currency:Pe.name})})]})})}),B?e.jsx(D,{message:t("creator.error")}):null,e.jsx(K,{children:P?e.jsx(S,{count:15}):e.jsxs(e.Fragment,{children:[N.map(o=>e.jsx(Se,{item:o},o.id)),E?e.jsx(S,{count:6}):null]})}),e.jsx(H,{hasNextPage:se,isFetching:E,onLoadMore:()=>void ce()}),!P&&!B&&N.length===0?e.jsx("p",{className:"muted",children:t("creator.empty")}):null]})})]})]})}export{Gt as Creator,Gt as default};
@@ -1 +1 @@
1
- import{j as r}from"./react-vyZjIDcS.js";import{I as i}from"./index-D6kQ69Bn.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-vyZjIDcS.js";import{I as i}from"./index-BuQvO-I_.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-DAYqclPH.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-Du25SJyr.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-_nUMMN_r.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-HythI0O3.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{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t as e,x as E,m as ue,e as r,h as p,n as he,E as ge,aq as g,ao as fe,l as G,ax as U,I as ee,aj as N,z as te,aP as me}from"./index-D6kQ69Bn.js";import{R as H}from"./resume-buy-Bf0zIH7y.js";import{u as be,p as we,R as ye,c as ke,i as Ce}from"./useCreditPacks-puL7tAtr.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-convert-cZR9DTGN.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30535358248.commit-2722a7f/assets/pack-coins-BDh1ZDbh.webp",ie="https://cdn.decentraland.org/@dcl/shop/0.1.0-30535358248.commit-2722a7f/assets/pack-stacks-D-V2jSHW.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-30535358248.commit-2722a7f/assets/pack-chest-BX_j84xW.webp",je="https://cdn.decentraland.org/@dcl/shop/0.1.0-30535358248.commit-2722a7f/assets/credit-coin-CmcTCd5i.webp",$e="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",ve="https://cdn.decentraland.org/@dcl/shop/0.1.0-30535358248.commit-2722a7f/assets/packs-backdrop-BcXiUPeP.webp",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Se=i.div`
1
+ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t as e,x as E,m as ue,e as r,h as p,n as he,E as ge,ar as g,ap as fe,l as G,ay as U,I as ee,aj as N,z as te,aQ as me}from"./index-BuQvO-I_.js";import{R as H}from"./resume-buy-Bf0zIH7y.js";import{u as be,p as we,R as ye,c as ke,i as Ce}from"./useCreditPacks-CQLtHnQk.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./mana-convert-CJwIMTsi.js";const S="https://cdn.decentraland.org/@dcl/shop/0.1.0-30555147117.commit-c0cc5df/assets/pack-coins-BDh1ZDbh.webp",ie="https://cdn.decentraland.org/@dcl/shop/0.1.0-30555147117.commit-c0cc5df/assets/pack-stacks-D-V2jSHW.webp",re="https://cdn.decentraland.org/@dcl/shop/0.1.0-30555147117.commit-c0cc5df/assets/pack-chest-BX_j84xW.webp",je="https://cdn.decentraland.org/@dcl/shop/0.1.0-30555147117.commit-c0cc5df/assets/credit-coin-CmcTCd5i.webp",$e="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",ve="https://cdn.decentraland.org/@dcl/shop/0.1.0-30555147117.commit-c0cc5df/assets/packs-backdrop-BcXiUPeP.webp",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",Se=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 24px;
@@ -380,7 +380,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
380
380
  font-size: 16px;
381
381
  line-height: 1.4;
382
382
  color: rgba(255, 255, 255, 0.88);
383
- `,qe=E`
383
+ `,Qe=E`
384
384
  0%, 100% {
385
385
  transform: scale(1);
386
386
  opacity: 1;
@@ -400,12 +400,12 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
400
400
  `,ne=i.img`
401
401
  width: 61px;
402
402
  height: 61px;
403
- animation: ${qe} 1.2s ease-in-out infinite;
403
+ animation: ${Qe} 1.2s ease-in-out infinite;
404
404
 
405
405
  @media (prefers-reduced-motion: reduce) {
406
406
  animation: none;
407
407
  }
408
- `,Qe=i(ne)`
408
+ `,qe=i(ne)`
409
409
  width: 72px;
410
410
  height: 72px;
411
411
  `,Ze=i.div`
@@ -604,7 +604,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
604
604
  outline: 2px solid ${e.colors.accent};
605
605
  outline-offset: 2px;
606
606
  }
607
- `,q=i.div`
607
+ `,Q=i.div`
608
608
  display: flex;
609
609
  flex-direction: column;
610
610
  align-items: center;
@@ -623,7 +623,7 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
623
623
  &[data-tone='error'] {
624
624
  color: ${e.colors.err};
625
625
  }
626
- `,Q=i.div`
626
+ `,q=i.div`
627
627
  display: flex;
628
628
  gap: 12px;
629
629
  margin-top: 16px;
@@ -631,4 +631,4 @@ import{b as pe,u as xe,r as l,j as t}from"./react-vyZjIDcS.js";import{s as i,t a
631
631
  margin: 0;
632
632
  font-family: ${e.font.sans};
633
633
  color: ${e.colors.err};
634
- `,C=Ce()?"mock":"stripe",Z=[S,S,ie,re],mt={pack_5:S,pack_10:S,pack_25:ie,pack_50:re};function se(a,s){return mt[a.id]??Z[s%Z.length]}function bt(a,s){return a.artUrl??se(a,s)}const wt="https://docs.decentraland.org";function J(a){const s=a;if((s==null?void 0:s.name)==="AbortError")return r("getCredits.errorCanceled");const f=((s==null?void 0:s.message)??"").toLowerCase();return f.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function zt(){var I;ue({title:r("nav.getCredits",{currency:p.name}),noindex:!0});const a=pe(),{session:s,signIn:f}=he(),d=ge(),[m,j]=xe(),{packs:b,isLoading:oe}=be(),[u,x]=l.useState("select"),[c,T]=l.useState(null),[$,F]=l.useState(null),ae=($!=null?(I=b.find(n=>n.credits===$))==null?void 0:I.artUrl:void 0)??je,[de,y]=l.useState(null),[ce,P]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var n;return(n=R.current)==null?void 0:n.abort()},[]);const L=l.useCallback(()=>{j(n=>{const o=new URLSearchParams(n);return o.delete("order"),o.delete("canceled"),o},{replace:!0})},[j]),_=l.useCallback(async n=>{x("processing");const o=new AbortController;R.current=o;try{const h=await we(n,{signal:o.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(h.status==="credited"){const w=h.creditsGranted??(c==null?void 0:c.credits)??0;F(w>0?w:null),x("success"),g("Shop Completed Buy Credits",{order_id:n,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:C}),d.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ye)){const v={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:v});return}}catch{}try{const v=sessionStorage.getItem(H);if(v){sessionStorage.removeItem(H);const W=JSON.parse(v),M=fe(W);if(M){a(M,{state:{item:W,resumeBuy:!0}});return}}}catch{}}else h.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),d.invalidateQueries({queryKey:["usd-balance"]}),x("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),y(h.error??r("getCredits.errorGrant",{currency:p.name})),x("error"))}catch(h){G(h,{flow:"get_credits",step:"grant",order_id:n}),g("Shop Buy Credits Failed",{step:"grant",error_code:U(h),pack_usd:(c==null?void 0:c.usd)??null}),y(J(h)),x("error")}},[c,s,d,a]),le=l.useCallback(async n=>{if(!s){f();return}y(null),P(!1),T(n),x(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:C});try{const o=await ke(n.id,{address:s.address,identity:s.identity});if(o.mock)_(o.orderId);else if(o.url)g("Shop Redirected To Stripe",{order_id:o.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=o.url;else throw new Error("Checkout did not return a redirect url")}catch(o){G(o,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:U(o),pack_usd:n.usd}),y(J(o)),x("error")}},[s,f,_]),z=l.useRef(!1);l.useEffect(()=>{if(z.current)return;const n=m.get("order");if(m.get("canceled")!=null){z.current=!0,g("Shop Buy Credits Cancelled",{order_id:n,provider:C}),L(),P(!0),x("select");return}n&&(x("processing"),s&&(z.current=!0,L(),_(n)))},[m,s]);function A(){var n;(n=R.current)==null||n.abort(),x("select"),T(null),F(null),y(null),P(!1)}return t.jsxs(Se,{children:[(u==="select"||u==="redirecting")&&t.jsxs(Pe,{"data-testid":"credits-hero",children:[t.jsx(Re,{"aria-hidden":!0}),t.jsxs(_e,{$hidden:u==="redirecting",children:[t.jsxs(ze,{children:[t.jsx(Ae,{children:r("getCredits.title",{currency:p.name})}),t.jsxs(Ee,{children:[t.jsx(Be,{children:r("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Te,{href:wt,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(ee,{name:"link-out"})]})]})]}),ce&&t.jsx(Fe,{role:"status",children:r("getCredits.canceledNote")}),t.jsx(yt,{packs:b,loading:oe,onSelect:n=>void le(n)})]}),u==="redirecting"&&t.jsxs(Ye,{role:"status","aria-live":"polite",children:[t.jsx(Qe,{src:N,alt:"",width:72,height:72}),t.jsx(Ve,{children:r("getCredits.redirecting")})]})]}),u==="processing"&&t.jsxs(Xe,{role:"status","aria-live":"polite",children:[t.jsx(ne,{src:N,alt:"",width:61,height:61}),t.jsxs(Ze,{children:[t.jsxs(Je,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(et,{"aria-hidden":!0,children:[t.jsx(it,{children:t.jsx(rt,{})}),t.jsx(nt,{children:"1/1"})]})]})]}),u==="success"&&t.jsxs(st,{role:"status","aria-live":"polite",children:[t.jsxs(ot,{children:[t.jsx(at,{src:$e,alt:"",width:60,height:60}),t.jsxs(dt,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:p.name})]})]}),$!=null&&t.jsx(ct,{children:t.jsxs(lt,{children:[t.jsx(pt,{src:ae,alt:"",width:93,height:93}),t.jsxs(xt,{children:[t.jsx(te,{}),t.jsxs("span",{children:[t.jsx(ut,{children:r("getCredits.creditsAmount",{credits:$,currency:p.name})})," ",t.jsx(ht,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(gt,{children:[t.jsx(k,{"data-variant":"outline",onClick:A,children:r("getCredits.buyMore",{currency:p.name})}),t.jsx(k,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")})]})]}),u==="pending"&&t.jsxs(q,{role:"status","aria-live":"polite",children:[t.jsx(X,{children:r("getCredits.pendingTitle",{currency:p.name})}),t.jsx(Oe,{children:r("getCredits.pendingBody")}),t.jsxs(Q,{children:[t.jsx(k,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")}),t.jsx(k,{"data-variant":"outline",onClick:A,children:r("getCredits.done")})]})]}),u==="error"&&t.jsxs(q,{role:"alert",children:[t.jsx(X,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(ft,{children:de}),t.jsx(Q,{children:t.jsx(k,{onClick:A,children:r("getCredits.tryAgain")})})]})]})}function yt({packs:a,loading:s,onSelect:f}){return s?t.jsx(D,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(d=>t.jsxs(O,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(Y,{children:[t.jsx(V,{children:t.jsx(He,{})}),t.jsx(Ke,{})]}),t.jsx(De,{})]},d))}):t.jsx(D,{children:a.map((d,m)=>t.jsxs(O,{type:"button","data-testid":"pack","data-best":d.bestValue?"true":void 0,onClick:()=>f(d),"aria-label":r("getCredits.packAria",{amount:me(d.credits),usd:d.usd}),children:[d.bestValue&&t.jsxs(Le,{children:[t.jsx(ee,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(Y,{children:[t.jsxs(V,{children:[t.jsxs(Ie,{children:[t.jsx(te,{}),t.jsx(We,{children:d.credits})]}),t.jsx(Me,{children:r("getCredits.packUnit",{currency:p.name})})]}),t.jsx(Ge,{children:t.jsx("img",{src:bt(d,m),alt:"",loading:"lazy",width:507,height:507,onError:j=>{const b=j.currentTarget;b.dataset.artFallback||(b.dataset.artFallback="done",b.src=se(d,m))}})})]}),t.jsxs(Ue,{children:["$",d.usd.toFixed(2)]})]},d.id))})}export{zt as GetCredits,zt as default};
634
+ `,C=Ce()?"mock":"stripe",Z=[S,S,ie,re],mt={pack_5:S,pack_10:S,pack_25:ie,pack_50:re};function se(a,s){return mt[a.id]??Z[s%Z.length]}function bt(a,s){return a.artUrl??se(a,s)}const wt="https://docs.decentraland.org";function J(a){const s=a;if((s==null?void 0:s.name)==="AbortError")return r("getCredits.errorCanceled");const f=((s==null?void 0:s.message)??"").toLowerCase();return f.includes("sign in")?r("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?r("getCredits.errorTimeout",{currency:p.name}):r("getCredits.errorGeneric")}function zt(){var I;ue({title:r("nav.getCredits",{currency:p.name}),noindex:!0});const a=pe(),{session:s,signIn:f}=he(),d=ge(),[m,j]=xe(),{packs:b,isLoading:oe}=be(),[u,x]=l.useState("select"),[c,T]=l.useState(null),[$,F]=l.useState(null),ae=($!=null?(I=b.find(n=>n.credits===$))==null?void 0:I.artUrl:void 0)??je,[de,y]=l.useState(null),[ce,P]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var n;return(n=R.current)==null?void 0:n.abort()},[]);const L=l.useCallback(()=>{j(n=>{const o=new URLSearchParams(n);return o.delete("order"),o.delete("canceled"),o},{replace:!0})},[j]),_=l.useCallback(async n=>{x("processing");const o=new AbortController;R.current=o;try{const h=await we(n,{signal:o.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(h.status==="credited"){const w=h.creditsGranted??(c==null?void 0:c.credits)??0;F(w>0?w:null),x("success"),g("Shop Completed Buy Credits",{order_id:n,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:C}),d.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ye)){const v={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:v});return}}catch{}try{const v=sessionStorage.getItem(H);if(v){sessionStorage.removeItem(H);const W=JSON.parse(v),M=fe(W);if(M){a(M,{state:{item:W,resumeBuy:!0}});return}}}catch{}}else h.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),d.invalidateQueries({queryKey:["usd-balance"]}),x("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),y(h.error??r("getCredits.errorGrant",{currency:p.name})),x("error"))}catch(h){G(h,{flow:"get_credits",step:"grant",order_id:n}),g("Shop Buy Credits Failed",{step:"grant",error_code:U(h),pack_usd:(c==null?void 0:c.usd)??null}),y(J(h)),x("error")}},[c,s,d,a]),le=l.useCallback(async n=>{if(!s){f();return}y(null),P(!1),T(n),x(C==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:n.usd,credits:n.credits,provider:C});try{const o=await ke(n.id,{address:s.address,identity:s.identity});if(o.mock)_(o.orderId);else if(o.url)g("Shop Redirected To Stripe",{order_id:o.orderId,pack_usd:n.usd,credits:n.credits}),window.location.href=o.url;else throw new Error("Checkout did not return a redirect url")}catch(o){G(o,{flow:"get_credits",step:"checkout",provider:C}),g("Shop Buy Credits Failed",{step:"checkout",error_code:U(o),pack_usd:n.usd}),y(J(o)),x("error")}},[s,f,_]),z=l.useRef(!1);l.useEffect(()=>{if(z.current)return;const n=m.get("order");if(m.get("canceled")!=null){z.current=!0,g("Shop Buy Credits Cancelled",{order_id:n,provider:C}),L(),P(!0),x("select");return}n&&(x("processing"),s&&(z.current=!0,L(),_(n)))},[m,s]);function A(){var n;(n=R.current)==null||n.abort(),x("select"),T(null),F(null),y(null),P(!1)}return t.jsxs(Se,{children:[(u==="select"||u==="redirecting")&&t.jsxs(Pe,{"data-testid":"credits-hero",children:[t.jsx(Re,{"aria-hidden":!0}),t.jsxs(_e,{$hidden:u==="redirecting",children:[t.jsxs(ze,{children:[t.jsx(Ae,{children:r("getCredits.title",{currency:p.name})}),t.jsxs(Ee,{children:[t.jsx(Be,{children:r("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Te,{href:wt,target:"_blank",rel:"noreferrer",children:[r("getCredits.learnMore"),t.jsx(ee,{name:"link-out"})]})]})]}),ce&&t.jsx(Fe,{role:"status",children:r("getCredits.canceledNote")}),t.jsx(yt,{packs:b,loading:oe,onSelect:n=>void le(n)})]}),u==="redirecting"&&t.jsxs(Ye,{role:"status","aria-live":"polite",children:[t.jsx(qe,{src:N,alt:"",width:72,height:72}),t.jsx(Ve,{children:r("getCredits.redirecting")})]})]}),u==="processing"&&t.jsxs(Xe,{role:"status","aria-live":"polite",children:[t.jsx(ne,{src:N,alt:"",width:61,height:61}),t.jsxs(Ze,{children:[t.jsxs(Je,{children:[t.jsx("strong",{children:r("getCredits.processing")}),"…"]}),t.jsxs(et,{"aria-hidden":!0,children:[t.jsx(it,{children:t.jsx(rt,{})}),t.jsx(nt,{children:"1/1"})]})]})]}),u==="success"&&t.jsxs(st,{role:"status","aria-live":"polite",children:[t.jsxs(ot,{children:[t.jsx(at,{src:$e,alt:"",width:60,height:60}),t.jsxs(dt,{children:[t.jsx("strong",{children:r("getCredits.successTitle")})," ",r("getCredits.successBody",{currency:p.name})]})]}),$!=null&&t.jsx(ct,{children:t.jsxs(lt,{children:[t.jsx(pt,{src:ae,alt:"",width:93,height:93}),t.jsxs(xt,{children:[t.jsx(te,{}),t.jsxs("span",{children:[t.jsx(ut,{children:r("getCredits.creditsAmount",{credits:$,currency:p.name})})," ",t.jsx(ht,{children:r("getCredits.creditsAdded")})]})]})]})}),t.jsxs(gt,{children:[t.jsx(k,{"data-variant":"outline",onClick:A,children:r("getCredits.buyMore",{currency:p.name})}),t.jsx(k,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")})]})]}),u==="pending"&&t.jsxs(Q,{role:"status","aria-live":"polite",children:[t.jsx(X,{children:r("getCredits.pendingTitle",{currency:p.name})}),t.jsx(Oe,{children:r("getCredits.pendingBody")}),t.jsxs(q,{children:[t.jsx(k,{onClick:()=>a("/assets"),children:r("getCredits.startShopping")}),t.jsx(k,{"data-variant":"outline",onClick:A,children:r("getCredits.done")})]})]}),u==="error"&&t.jsxs(Q,{role:"alert",children:[t.jsx(X,{"data-tone":"error",children:r("getCredits.errorTitle")}),t.jsx(ft,{children:de}),t.jsx(q,{children:t.jsx(k,{onClick:A,children:r("getCredits.tryAgain")})})]})]})}function yt({packs:a,loading:s,onSelect:f}){return s?t.jsx(D,{"aria-busy":"true","aria-label":r("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(d=>t.jsxs(O,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(Y,{children:[t.jsx(V,{children:t.jsx(He,{})}),t.jsx(Ke,{})]}),t.jsx(De,{})]},d))}):t.jsx(D,{children:a.map((d,m)=>t.jsxs(O,{type:"button","data-testid":"pack","data-best":d.bestValue?"true":void 0,onClick:()=>f(d),"aria-label":r("getCredits.packAria",{amount:me(d.credits),usd:d.usd}),children:[d.bestValue&&t.jsxs(Le,{children:[t.jsx(ee,{name:"star-rounded"}),r("getCredits.packBadge")]}),t.jsxs(Y,{children:[t.jsxs(V,{children:[t.jsxs(Ie,{children:[t.jsx(te,{}),t.jsx(We,{children:d.credits})]}),t.jsx(Me,{children:r("getCredits.packUnit",{currency:p.name})})]}),t.jsx(Ge,{children:t.jsx("img",{src:bt(d,m),alt:"",loading:"lazy",width:507,height:507,onError:j=>{const b=j.currentTarget;b.dataset.artFallback||(b.dataset.artFallback="done",b.src=se(d,m))}})})]}),t.jsxs(Ue,{children:["$",d.usd.toFixed(2)]})]},d.id))})}export{zt as GetCredits,zt as default};
@@ -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-BIl576Hj.js";import{d as g,r as v}from"./index-Du25SJyr.js";import{C as c}from"./ConstantsUtil-Dfwpy1eP.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-DAYqclPH.js";import{au as y}from"./NetworkUtil-HlUKXKcF.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-BcMB9SzQ.js";import{d as g,r as v}from"./index-HythI0O3.js";import{C as c}from"./ConstantsUtil-Dfwpy1eP.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-_nUMMN_r.js";import{au as y}from"./NetworkUtil-HlUKXKcF.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;
@@ -1,4 +1,4 @@
1
- import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s as t,x as ie,y as se,e as i,h as R,B as I,z,aq as ne,aO as K,l as W,m as re,n as oe,E as ae,u as de,F as ce}from"./index-D6kQ69Bn.js";import{i as le,R as pe,f as ge}from"./import-BBD0DWIT.js";import{u as xe}from"./useSecondarySales-W8e5_GEF.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./buy-Ccaxv3lt.js";import"./authorizations-BVmXaQeu.js";import"./sendMetaTransaction-CdI6QA-v.js";import"./trade-encoding-CJDVWYcF.js";import"./mana-rate-cSpFrGml.js";import"./mana-convert-cZR9DTGN.js";function U({size:o=12,...w}){return e.jsx("svg",{viewBox:"0 0 20 20",width:o,height:o,fill:"none","aria-hidden":!0,focusable:"false",...w,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:M,radius:me,z:ue}=S,he=ie`
1
+ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s as t,x as ie,y as se,e as i,h as R,B as I,z,ar as ne,aP as K,l as W,m as re,n as oe,E as ae,u as de,F as ce}from"./index-BuQvO-I_.js";import{i as le,R as pe,f as ge}from"./import-CjcH4cDS.js";import{u as xe}from"./useSecondarySales-BL0-GE0K.js";import"./sentry-B35L1FdR.js";import"./dcl-schemas-BICTSpB5.js";import"./ethers-CXBJm_wN.js";import"./intl-CBcMB1D2.js";import"./buy-VVCbwxmX.js";import"./authorizations-CzNpcwj-.js";import"./sendMetaTransaction-BZ7AB8iM.js";import"./trade-encoding-9Q36L1oR.js";import"./mana-rate-BjJ4VPVX.js";import"./mana-convert-CJwIMTsi.js";function U({size:o=12,...w}){return e.jsx("svg",{viewBox:"0 0 20 20",width:o,height:o,fill:"none","aria-hidden":!0,focusable:"false",...w,children:e.jsx("path",{d:"M5 10.5l3 3 7-7.5",stroke:"#fff",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const{colors:M,radius:me,z:ue}=S,he=ie`
2
2
  0% {
3
3
  transform: scale(0);
4
4
  opacity: 0;
@@ -179,7 +179,7 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
179
179
  font-size: 12px;
180
180
  `,Ne=t.p`
181
181
  margin: 12px 0 0;
182
- `;function Be({queue:o,session:w,onClose:j,onDone:m}){const v=ee(),p=se(w.providerType),[g,b]=h.useState(()=>o.map(()=>"pending")),[A,Q]=h.useState("running"),k=h.useRef(!1);h.useEffect(()=>{if(k.current)return;k.current=!0;let n=!1;return(async()=>{for(let a=0;a<o.length;a++){if(n)return;b(x=>x.map((u,f)=>f===a?"active":u));try{await le(o[a].item,o[a].priceCredits,w),ne("Shop Migrated Listing",{item_id:o[a].item.itemId??o[a].item.oldTradeId??null,contract_address:o[a].item.contractAddress,new_price_credits:o[a].priceCredits,new_price_usd:K(o[a].priceCredits)}),n||b(x=>x.map((u,f)=>f===a?"done":u))}catch(x){if(x instanceof pe)W(x,{flow:"import_listing",step:"relist",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(u=>u.map((f,C)=>C===a?"unlisted":f));else{const u=x,f=u.code===4001||/reject|denied|cancel/i.test(u.message??"");f||W(x,{flow:"import_listing",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(C=>C.map((B,F)=>F===a?f?"skipped":"failed":B))}}}n||Q("finished")})(),()=>{n=!0}},[]);const $=g.filter(n=>n==="done").length,E=g.findIndex(n=>n==="active"),N=Math.round(g.filter(n=>n!=="pending"&&n!=="active").length/o.length*100);function L(){m(),j()}if(A==="finished"){const n=g.filter(a=>a==="skipped"||a==="failed").length,l=g.filter(a=>a==="unlisted").length;return e.jsx(H,{role:"presentation",children:e.jsxs(Z,{"data-success":!0,role:"dialog","aria-modal":"true",children:[e.jsx(be,{"aria-hidden":!0,children:e.jsx(U,{size:30})}),e.jsx(O,{children:$>0?i("migrate.successTitle"):i("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[$>0?i("migrate.listedSummary",{count:$,currency:R.name}):i("migrate.noneListed"),n>0?" "+i("migrate.skippedSummary",{count:n}):"",l>0?" "+i("migrate.unlistedSummary",{count:l}):""]}),e.jsxs(fe,{"data-actions":!0,children:[e.jsx(I,{variant:"ghost",onClick:L,children:i("getCredits.done")}),l>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/my-assets")},children:i("migrate.goToMyAssets")}):$>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/assets")},children:i("migrate.viewInShop")}):null]})]})})}return e.jsx(H,{role:"presentation",children:e.jsxs(je,{"data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx(O,{children:i("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[p?i("migrate.subConfirm"):i("migrate.subManaged")," ",E>=0?i("migrate.progressCount",{current:E+1,total:o.length}):""]}),e.jsx(ve,{children:e.jsx(ke,{style:{width:`${N}%`}})}),e.jsx($e,{children:o.map((n,l)=>e.jsxs(Se,{"data-status":g[l],children:[e.jsx(Ie,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsx(Le,{title:n.item.name,children:n.item.name||i("migrate.itemFallback")}),e.jsxs(Ce,{children:[e.jsx(z,{className:"ccy-mark"})," ",n.priceCredits.toLocaleString()]}),e.jsx(Te,{children:g[l]==="active"?e.jsxs(e.Fragment,{children:[e.jsx(Me,{className:"spinner","aria-hidden":!0})," ",p?i("migrate.statusConfirm"):i("migrate.statusAdding")]}):g[l]==="done"?e.jsx(Ee,{children:e.jsx(U,{})}):g[l]==="skipped"?e.jsx(_,{children:i("migrate.statusSkipped")}):g[l]==="failed"?e.jsx(_,{children:i("migrate.statusFailed")}):g[l]==="unlisted"?e.jsx(_,{title:i("migrate.unlistedTooltip"),children:i("migrate.statusUnlisted")}):e.jsx(ze,{children:i("migrate.statusWaiting")})})]},n.item.oldTradeId))}),e.jsx(Ne,{className:"muted small",children:p?i("migrate.hintConfirm"):i("migrate.hintManaged")})]})})}const{colors:r,gradients:Re,radius:Ae}=S,D="@media (max-width: 620px)",G=t.div`
182
+ `;function Be({queue:o,session:w,onClose:j,onDone:m}){const v=ee(),p=se(w.providerType),[g,b]=h.useState(()=>o.map(()=>"pending")),[A,P]=h.useState("running"),k=h.useRef(!1);h.useEffect(()=>{if(k.current)return;k.current=!0;let n=!1;return(async()=>{for(let a=0;a<o.length;a++){if(n)return;b(x=>x.map((u,f)=>f===a?"active":u));try{await le(o[a].item,o[a].priceCredits,w),ne("Shop Migrated Listing",{item_id:o[a].item.itemId??o[a].item.oldTradeId??null,contract_address:o[a].item.contractAddress,new_price_credits:o[a].priceCredits,new_price_usd:K(o[a].priceCredits)}),n||b(x=>x.map((u,f)=>f===a?"done":u))}catch(x){if(x instanceof pe)W(x,{flow:"import_listing",step:"relist",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(u=>u.map((f,C)=>C===a?"unlisted":f));else{const u=x,f=u.code===4001||/reject|denied|cancel/i.test(u.message??"");f||W(x,{flow:"import_listing",itemId:o[a].item.itemId??o[a].item.oldTradeId}),n||b(C=>C.map((B,Q)=>Q===a?f?"skipped":"failed":B))}}}n||P("finished")})(),()=>{n=!0}},[]);const $=g.filter(n=>n==="done").length,E=g.findIndex(n=>n==="active"),N=Math.round(g.filter(n=>n!=="pending"&&n!=="active").length/o.length*100);function L(){m(),j()}if(A==="finished"){const n=g.filter(a=>a==="skipped"||a==="failed").length,l=g.filter(a=>a==="unlisted").length;return e.jsx(H,{role:"presentation",children:e.jsxs(Z,{"data-success":!0,role:"dialog","aria-modal":"true",children:[e.jsx(be,{"aria-hidden":!0,children:e.jsx(U,{size:30})}),e.jsx(O,{children:$>0?i("migrate.successTitle"):i("migrate.nothingTitle")}),e.jsxs("p",{className:"muted",style:{margin:0},children:[$>0?i("migrate.listedSummary",{count:$,currency:R.name}):i("migrate.noneListed"),n>0?" "+i("migrate.skippedSummary",{count:n}):"",l>0?" "+i("migrate.unlistedSummary",{count:l}):""]}),e.jsxs(fe,{"data-actions":!0,children:[e.jsx(I,{variant:"ghost",onClick:L,children:i("getCredits.done")}),l>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/my-assets")},children:i("migrate.goToMyAssets")}):$>0?e.jsx(I,{variant:"purple",onClick:()=>{m(),j(),v("/assets")},children:i("migrate.viewInShop")}):null]})]})})}return e.jsx(H,{role:"presentation",children:e.jsxs(je,{"data-testid":"modal",role:"dialog","aria-modal":"true","aria-live":"polite",children:[e.jsx(O,{children:i("migrate.listingTitle")}),e.jsxs("p",{className:"muted small",style:{margin:"0 0 4px"},children:[p?i("migrate.subConfirm"):i("migrate.subManaged")," ",E>=0?i("migrate.progressCount",{current:E+1,total:o.length}):""]}),e.jsx(ve,{children:e.jsx(ke,{style:{width:`${N}%`}})}),e.jsx($e,{children:o.map((n,l)=>e.jsxs(Se,{"data-status":g[l],children:[e.jsx(Ie,{children:n.item.thumbnail?e.jsx("img",{src:n.item.thumbnail,alt:""}):null}),e.jsx(Le,{title:n.item.name,children:n.item.name||i("migrate.itemFallback")}),e.jsxs(Ce,{children:[e.jsx(z,{className:"ccy-mark"})," ",n.priceCredits.toLocaleString()]}),e.jsx(Te,{children:g[l]==="active"?e.jsxs(e.Fragment,{children:[e.jsx(Me,{className:"spinner","aria-hidden":!0})," ",p?i("migrate.statusConfirm"):i("migrate.statusAdding")]}):g[l]==="done"?e.jsx(Ee,{children:e.jsx(U,{})}):g[l]==="skipped"?e.jsx(_,{children:i("migrate.statusSkipped")}):g[l]==="failed"?e.jsx(_,{children:i("migrate.statusFailed")}):g[l]==="unlisted"?e.jsx(_,{title:i("migrate.unlistedTooltip"),children:i("migrate.statusUnlisted")}):e.jsx(ze,{children:i("migrate.statusWaiting")})})]},n.item.oldTradeId))}),e.jsx(Ne,{className:"muted small",children:p?i("migrate.hintConfirm"):i("migrate.hintManaged")})]})})}const{colors:r,gradients:Re,radius:Ae}=S,D="@media (max-width: 620px)",G=t.div`
183
183
  max-width: 520px;
184
184
  margin: 0 auto;
185
185
  text-align: center;
@@ -196,13 +196,13 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
196
196
  margin: 4px 0 0;
197
197
  `,V=t(I)`
198
198
  margin-top: 10px;
199
- `,Qe=t.div`
199
+ `,Pe=t.div`
200
200
  max-width: 860px;
201
201
  margin: 0 auto;
202
202
  padding-bottom: 120px;
203
- `,Fe=t.header`
203
+ `,Qe=t.header`
204
204
  margin-bottom: 18px;
205
- `,Pe=t.span`
205
+ `,Fe=t.span`
206
206
  display: inline-block;
207
207
  font-size: 12px;
208
208
  font-weight: 700;
@@ -444,4 +444,4 @@ import{j as e,b as ee,r as h,L as te}from"./react-vyZjIDcS.js";import{t as S,s a
444
444
  flex: 1 1 auto;
445
445
  `,xt=t(I)`
446
446
  padding: 13px 24px;
447
- `,mt=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub",secondary:!0}];function Tt(){re({title:i("seo.import.title"),noindex:!0});const{session:o,signIn:w,restore:j}=oe(),m=ae(),v=o==null?void 0:o.address;h.useEffect(()=>{j()},[j]);const{data:p,isLoading:g}=de({queryKey:["importable",v],queryFn:()=>ge(v),enabled:!!v}),b=xe(),A=h.useMemo(()=>mt.filter(d=>!d.secondary||b),[b]),[Q,k]=h.useState({}),[$,E]=h.useState(new Set),[N,L]=h.useState(null),n=h.useMemo(()=>[...(p==null?void 0:p.creations)??[],...b?(p==null?void 0:p.owned)??[]:[]],[p,b]);h.useEffect(()=>{n.length&&k(d=>{const c={...d};for(const s of n)c[s.oldTradeId]==null&&(c[s.oldTradeId]=s.suggestedCredits);return c})},[n]);const l=d=>!$.has(d),a=d=>Q[d.oldTradeId]??d.suggestedCredits,x=n.filter(d=>l(d.oldTradeId)),u=x.reduce((d,c)=>d+a(c),0);function f(d,c){const s=c.replace(/[^\d]/g,"");k(T=>({...T,[d]:s===""?0:parseInt(s,10)}))}function C(d){E(c=>{const s=new Set(c);return s.has(d)?s.delete(d):s.add(d),s})}function B(d){return d.map(c=>({item:c,priceCredits:Math.max(1,a(c))}))}function F(){m.invalidateQueries({queryKey:["importable"]}),m.invalidateQueries({queryKey:["shop-items"]}),m.invalidateQueries({queryKey:["catalog-items"]}),m.invalidateQueries({queryKey:["overview-listings"]}),m.invalidateQueries({queryKey:["upsell-listings"]}),m.invalidateQueries({queryKey:["my-assets"]}),m.invalidateQueries({queryKey:["collection-sale-state"]}),ce.success(i("importListings.toastUpdated"))}return o?!g&&n.length===0?e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"✨"}),e.jsx(J,{children:i("importListings.emptyTitle")}),e.jsx("p",{className:"muted",children:i("importListings.emptyBody")}),e.jsx(V,{as:te,to:"/my-assets",variant:"purple",children:i("importListings.goToMyAssets")})]}):e.jsxs(Qe,{children:[e.jsxs(Fe,{children:[e.jsx(Pe,{children:i("importListings.eyebrow")}),e.jsxs(_e,{children:[i("importListings.titleLead")," ",e.jsx(Ke,{children:i("importListings.titleAccent")})]}),e.jsx(De,{children:i("importListings.lede",{currency:R.name})})]}),e.jsxs(We,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",i("importListings.rate",{currency:R.nameSingular})]}),g?e.jsx(X,{children:Array.from({length:4}).map((d,c)=>e.jsx(Je,{},c))}):A.map(d=>{const c=(p==null?void 0:p[d.key])??[];return c.length===0?null:e.jsxs(Ue,{children:[e.jsxs(He,{children:[e.jsx(Oe,{children:i(d.title)}),e.jsx(Ge,{children:i(d.sub)})]}),e.jsx(X,{children:c.map(s=>{const T=a(s),q=T!==s.suggestedCredits;return e.jsxs(Ye,{"data-off":l(s.oldTradeId)?void 0:!0,children:[e.jsx(Ve,{type:"checkbox",checked:l(s.oldTradeId),onChange:()=>C(s.oldTradeId),"aria-label":i("importListings.includeItem",{name:s.name})}),e.jsx(Xe,{children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs(Ze,{children:[e.jsx(qe,{title:s.name,children:s.name||i("importListings.itemFallback")}),e.jsx(et,{children:s.rarity})]}),e.jsxs(tt,{children:[e.jsxs(it,{children:[e.jsx(z,{size:15,color:S.colors.text}),e.jsx(st,{"data-testid":"imp-price-input",inputMode:"numeric",value:T.toLocaleString(),onChange:P=>f(s.oldTradeId,P.target.value),"aria-label":i("importListings.priceAria",{currency:R.name,name:s.name})})]}),e.jsxs(nt,{children:[e.jsxs("span",{children:["$",K(T).toFixed(2)]}),q?e.jsxs(rt,{onClick:()=>k(P=>({...P,[s.oldTradeId]:s.suggestedCredits})),children:[i("importListings.resetTo")," ",e.jsx(z,{className:"ccy-mark"}),s.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx(ot,{children:e.jsx(at,{size:"sm",disabled:!l(s.oldTradeId),onClick:()=>L(B([s])),children:i("importListings.list")})})]},s.oldTradeId)})})]},d.key)}),e.jsx(dt,{children:e.jsxs(ct,{children:[e.jsxs("div",{children:[e.jsxs(lt,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",u.toLocaleString()]}),e.jsx(pt,{children:i("importListings.selectedSummary",{count:x.length,usd:K(u).toFixed(2)})})]}),e.jsx(gt,{}),e.jsx(xt,{variant:"purple",disabled:x.length===0,onClick:()=>L(B(x)),children:i("importListings.listAll",{count:x.length})})]})}),N&&o?e.jsx(Be,{queue:N,session:o,onClose:()=>L(null),onDone:F}):null]}):e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"📦"}),e.jsx(J,{children:i("importListings.signInTitle")}),e.jsx("p",{className:"muted",children:i("importListings.signInBody")}),e.jsx(V,{variant:"purple",onClick:()=>w(),children:i("storeSettings.signIn")})]})}export{Tt as ImportListings};
447
+ `,mt=[{key:"creations",title:"importListings.creations.title",sub:"importListings.creations.sub"},{key:"owned",title:"importListings.owned.title",sub:"importListings.owned.sub",secondary:!0}];function Tt(){re({title:i("seo.import.title"),noindex:!0});const{session:o,signIn:w,restore:j}=oe(),m=ae(),v=o==null?void 0:o.address;h.useEffect(()=>{j()},[j]);const{data:p,isLoading:g}=de({queryKey:["importable",v],queryFn:()=>ge(v),enabled:!!v}),b=xe(),A=h.useMemo(()=>mt.filter(d=>!d.secondary||b),[b]),[P,k]=h.useState({}),[$,E]=h.useState(new Set),[N,L]=h.useState(null),n=h.useMemo(()=>[...(p==null?void 0:p.creations)??[],...b?(p==null?void 0:p.owned)??[]:[]],[p,b]);h.useEffect(()=>{n.length&&k(d=>{const c={...d};for(const s of n)c[s.oldTradeId]==null&&(c[s.oldTradeId]=s.suggestedCredits);return c})},[n]);const l=d=>!$.has(d),a=d=>P[d.oldTradeId]??d.suggestedCredits,x=n.filter(d=>l(d.oldTradeId)),u=x.reduce((d,c)=>d+a(c),0);function f(d,c){const s=c.replace(/[^\d]/g,"");k(T=>({...T,[d]:s===""?0:parseInt(s,10)}))}function C(d){E(c=>{const s=new Set(c);return s.has(d)?s.delete(d):s.add(d),s})}function B(d){return d.map(c=>({item:c,priceCredits:Math.max(1,a(c))}))}function Q(){m.invalidateQueries({queryKey:["importable"]}),m.invalidateQueries({queryKey:["shop-items"]}),m.invalidateQueries({queryKey:["catalog-items"]}),m.invalidateQueries({queryKey:["overview-listings"]}),m.invalidateQueries({queryKey:["upsell-listings"]}),m.invalidateQueries({queryKey:["my-assets"]}),m.invalidateQueries({queryKey:["collection-sale-state"]}),ce.success(i("importListings.toastUpdated"))}return o?!g&&n.length===0?e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"✨"}),e.jsx(J,{children:i("importListings.emptyTitle")}),e.jsx("p",{className:"muted",children:i("importListings.emptyBody")}),e.jsx(V,{as:te,to:"/my-assets",variant:"purple",children:i("importListings.goToMyAssets")})]}):e.jsxs(Pe,{children:[e.jsxs(Qe,{children:[e.jsx(Fe,{children:i("importListings.eyebrow")}),e.jsxs(_e,{children:[i("importListings.titleLead")," ",e.jsx(Ke,{children:i("importListings.titleAccent")})]}),e.jsx(De,{children:i("importListings.lede",{currency:R.name})})]}),e.jsxs(We,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",i("importListings.rate",{currency:R.nameSingular})]}),g?e.jsx(X,{children:Array.from({length:4}).map((d,c)=>e.jsx(Je,{},c))}):A.map(d=>{const c=(p==null?void 0:p[d.key])??[];return c.length===0?null:e.jsxs(Ue,{children:[e.jsxs(He,{children:[e.jsx(Oe,{children:i(d.title)}),e.jsx(Ge,{children:i(d.sub)})]}),e.jsx(X,{children:c.map(s=>{const T=a(s),q=T!==s.suggestedCredits;return e.jsxs(Ye,{"data-off":l(s.oldTradeId)?void 0:!0,children:[e.jsx(Ve,{type:"checkbox",checked:l(s.oldTradeId),onChange:()=>C(s.oldTradeId),"aria-label":i("importListings.includeItem",{name:s.name})}),e.jsx(Xe,{children:s.thumbnail?e.jsx("img",{src:s.thumbnail,alt:""}):null}),e.jsxs(Ze,{children:[e.jsx(qe,{title:s.name,children:s.name||i("importListings.itemFallback")}),e.jsx(et,{children:s.rarity})]}),e.jsxs(tt,{children:[e.jsxs(it,{children:[e.jsx(z,{size:15,color:S.colors.text}),e.jsx(st,{"data-testid":"imp-price-input",inputMode:"numeric",value:T.toLocaleString(),onChange:F=>f(s.oldTradeId,F.target.value),"aria-label":i("importListings.priceAria",{currency:R.name,name:s.name})})]}),e.jsxs(nt,{children:[e.jsxs("span",{children:["$",K(T).toFixed(2)]}),q?e.jsxs(rt,{onClick:()=>k(F=>({...F,[s.oldTradeId]:s.suggestedCredits})),children:[i("importListings.resetTo")," ",e.jsx(z,{className:"ccy-mark"}),s.suggestedCredits.toLocaleString()]}):null]})]}),e.jsx(ot,{children:e.jsx(at,{size:"sm",disabled:!l(s.oldTradeId),onClick:()=>L(B([s])),children:i("importListings.list")})})]},s.oldTradeId)})})]},d.key)}),e.jsx(dt,{children:e.jsxs(ct,{children:[e.jsxs("div",{children:[e.jsxs(lt,{children:[e.jsx(z,{className:"ccy-mark",color:S.colors.text})," ",u.toLocaleString()]}),e.jsx(pt,{children:i("importListings.selectedSummary",{count:x.length,usd:K(u).toFixed(2)})})]}),e.jsx(gt,{}),e.jsx(xt,{variant:"purple",disabled:x.length===0,onClick:()=>L(B(x)),children:i("importListings.listAll",{count:x.length})})]})}),N&&o?e.jsx(Be,{queue:N,session:o,onClose:()=>L(null),onDone:Q}):null]}):e.jsxs(G,{children:[e.jsx(Y,{"aria-hidden":!0,children:"📦"}),e.jsx(J,{children:i("importListings.signInTitle")}),e.jsx("p",{className:"muted",children:i("importListings.signInBody")}),e.jsx(V,{variant:"purple",onClick:()=>w(),children:i("storeSettings.signIn")})]})}export{Tt as ImportListings};