@dcl/shop 0.6.1 → 0.6.2-30958394678.commit-3968c2a

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 (183) hide show
  1. package/_assets/{Activity-CCVwnN-d.js → Activity-3zyI1IRX.js} +3 -3
  2. package/_assets/{AnimatedBackground-CNn-Vax_.js → AnimatedBackground-nIupuP8l.js} +1 -1
  3. package/_assets/{Assets-BPgkfGkc.js → Assets-BI3c9ohq.js} +8 -8
  4. package/_assets/{Assets.styles-BAy3by3Z.js → Assets.styles-9ki_t5x3.js} +1 -1
  5. package/_assets/{Authorizations-CdqHugnL.js → Authorizations-DXc8lpwm.js} +1 -1
  6. package/_assets/{Cart-CzNOpZkY.js → Cart-DuHl9E6I.js} +2 -2
  7. package/_assets/{CircularProgress-DqLGsuLk.js → CircularProgress-U_mjuju1.js} +3 -3
  8. package/_assets/{Collection-DmrD6mAW.js → Collection-CIcLTFPZ.js} +1 -1
  9. package/_assets/{CollectionCarousel-BpMj1RRH.js → CollectionCarousel-B7TB_OMj.js} +7 -7
  10. package/_assets/{Creator-DYPK74k6.js → Creator-BFMpAq2T.js} +7 -7
  11. package/_assets/{ErrorNotice-6j32LCd-.js → ErrorNotice-B5gvtysl.js} +1 -1
  12. package/_assets/{ExchangeController-CjtWowut.js → ExchangeController-Chujc587.js} +1 -1
  13. package/_assets/{GetCredits-9nCD-_vL.js → GetCredits-DUE68Ofv.js} +17 -17
  14. package/_assets/{HelpersUtil-6C8PzEL7.js → HelpersUtil-DzsKL2ac.js} +1 -1
  15. package/_assets/{ItemDetail-lJyiLtT6.js → ItemDetail-Ch7JVJ39.js} +193 -194
  16. package/_assets/LazyEmoteControls-BwHr8-X7.js +2 -0
  17. package/_assets/{LoadMore-C6sUcyIf.js → LoadMore-BO9-NgF0.js} +1 -1
  18. package/_assets/{ManaPricingBanner.styles-zp0428S7.js → ManaPricingBanner.styles-LfXG3P0z.js} +3 -3
  19. package/_assets/{MenuList-BTdUxA4D.js → MenuList-BX6yO7Ac.js} +2 -2
  20. package/_assets/{MyAssets-BbmsS4SI.js → MyAssets-DVZ_pZXb.js} +1 -1
  21. package/_assets/{MyFavorites-B_Mv89Yf.js → MyFavorites-CbvKYAiN.js} +35 -24
  22. package/_assets/{NotFound-0lsOfC5s.js → NotFound-B3230xyR.js} +1 -1
  23. package/_assets/NotificationsBell-x9qG4JAm.js +34 -0
  24. package/_assets/OutfitDetail-DQa5i9Jk.js +334 -0
  25. package/_assets/OutfitPreview-D4-9krF1.js +6 -0
  26. package/_assets/OutfitStudio-8RdjVeCY.js +537 -0
  27. package/_assets/{StoreSettings-BxTLlxHn.js → StoreSettings-DWBD4fbU.js} +1 -1
  28. package/_assets/{Success-DMCTT33h.js → Success-Couk7Hdv.js} +5 -5
  29. package/_assets/{SwapController-Ci7sPB_-.js → SwapController-k6QIzYEE.js} +1 -1
  30. package/_assets/{Tooltip-BZ-qUO0l.js → Tooltip-BQX-SlPA.js} +1 -1
  31. package/_assets/{TradeService-Cu6fpwnh.js → TradeService-mV7WtrBG.js} +1 -1
  32. package/_assets/{W3MFrameProviderSingleton-8GeYldkk.js → W3MFrameProviderSingleton-DrpRVilu.js} +3 -3
  33. package/_assets/{WebCryptoP256-fMzbuVHl.js → WebCryptoP256-CMlkql0I.js} +1 -1
  34. package/_assets/{authorizations-DOwEBZw0.js → authorizations-CtiOXVNn.js} +1 -1
  35. package/_assets/{basic-CNB5RbBM.js → basic-DdbQHLj0.js} +1 -1
  36. package/_assets/{biconomy-VIh33SiE.js → biconomy-2kmLuYrH.js} +1 -1
  37. package/_assets/{builder-ENYhtC9A.js → builder-Be5eHY-S.js} +1 -1
  38. package/_assets/{buy-DME37PMo.js → buy-Bm7LPL_y.js} +1 -1
  39. package/_assets/{buy-gasless-CsB_UciL.js → buy-gasless-Cna5Um4K.js} +1 -1
  40. package/_assets/{categories-SI1YlvJt.js → categories-B0u9Kgh7.js} +1 -1
  41. package/_assets/{ccip-r6C5X7kR.js → ccip-Ci5E3IwV.js} +1 -1
  42. package/_assets/{ccip-BWQZvTr_.js → ccip-DGfiuVqj.js} +1 -1
  43. package/_assets/clsx-WwvpwSg0.js +1 -0
  44. package/_assets/{collectionPage.styles-DTQE0MEN.js → collectionPage.styles-zJMtUweU.js} +5 -5
  45. package/_assets/{controller-D4hrVQu3.js → controller-DsSvMbNo.js} +2 -2
  46. package/_assets/{core-CG9Ai3BM.js → core-Cq1jU2ZC.js} +4 -4
  47. package/_assets/{createSvgIcon-BBqN76DB.js → createSvgIcon-WjfcCScq.js} +2 -2
  48. package/_assets/{custom-CoESkeU0.js → custom-C3YA4NkW.js} +1 -1
  49. package/_assets/{data-capture-DsD2q2fn.js → data-capture-CEkcLxes.js} +1 -1
  50. package/_assets/{email-2Crwdpgb.js → email-Dsb8bC4V.js} +1 -1
  51. package/_assets/{embedded-wallet-B5qGTlLf.js → embedded-wallet-DYwTFWHC.js} +1 -1
  52. package/_assets/emotion-styled.browser.esm-CXHuvzN7.js +1 -0
  53. package/_assets/{engine-DMQKkPgK.js → engine-CRG7y_Dc.js} +1 -1
  54. package/_assets/{errors-BNZ7sBF_.js → errors-md0_v65i.js} +1 -1
  55. package/_assets/{estimate-l1-fee-D7epFE-D.js → estimate-l1-fee-pM-7mo0C.js} +1 -1
  56. package/_assets/{execute-DKumTrX9.js → execute-By-QAyMu.js} +2 -2
  57. package/_assets/{features-DI5UMV_W.js → features-CE9fos6_.js} +1 -1
  58. package/_assets/{fetchTokenMetadata-D4n2TjLB.js → fetchTokenMetadata-CCRHppyJ.js} +2 -2
  59. package/_assets/{field.styles-CjeX0pR0.js → field.styles-I7yK67N6.js} +1 -1
  60. package/_assets/{get-ecosystem-wallet-info-b6CDxjL2.js → get-ecosystem-wallet-info-CfkIBkrv.js} +1 -1
  61. package/_assets/{getBalance-k1LJAZwU.js → getBalance-r2d5SR8J.js} +1 -1
  62. package/_assets/{getNFT-B39rY-PL.js → getNFT-CdMO9Qsb.js} +1 -1
  63. package/_assets/{getNFT-BMgMzvsZ.js → getNFT-DJwtmi5E.js} +1 -1
  64. package/_assets/{getThemeProps-CppRRpEN.js → getThemeProps-Dfsert1D.js} +1 -1
  65. package/_assets/{grid.styles-Ckr_d1Os.js → grid.styles-nOJmORwE.js} +1 -1
  66. package/_assets/{hashTypedData-CiesaRhT.js → hashTypedData-BUyuoUS1.js} +1 -1
  67. package/_assets/{hashTypedData-DUwT6kJz.js → hashTypedData-Cn4NLSva.js} +1 -1
  68. package/_assets/{in-app-B5W9FA6J.js → in-app-Bbyp_hac.js} +1 -1
  69. package/_assets/{in-app-wallet-calls--fTMhgRz.js → in-app-wallet-calls-B-gR9DjX.js} +1 -1
  70. package/_assets/{index-COM-LGX-.js → index-2aeigaSb.js} +1 -1
  71. package/_assets/{index-DmlHhfEt.js → index-2hXh3Lug.js} +1 -1
  72. package/_assets/{index-C4Mo9qnf.js → index-40kmd_aK.js} +3 -3
  73. package/_assets/{index-8Gs8aT7x.js → index-42pSYxn6.js} +1 -1
  74. package/_assets/{index-Ct4YR2LP.js → index-7y51FKRL.js} +1 -1
  75. package/_assets/{index-CjmdU7lV.js → index-8KyAMGS-.js} +3 -3
  76. package/_assets/{index-D0JaJVwf.js → index-B-vjn9pq.js} +1 -1
  77. package/_assets/{index-C2R_7cZP.js → index-BF0WiBHh.js} +1 -1
  78. package/_assets/{index-CqYYwjL0.js → index-BF64P65M.js} +1 -1
  79. package/_assets/{index-BwnQwSAu.js → index-BLLKqfcD.js} +2 -2
  80. package/_assets/{index-MSDyZgBz.js → index-BLT6_sje.js} +2 -2
  81. package/_assets/{index-DIYC-eqY.js → index-BRbJkxhy.js} +1 -1
  82. package/_assets/{index-C_8wyBUp.js → index-BRg1smL5.js} +1 -1
  83. package/_assets/{index-CROLwqLK.js → index-BSPthC5D.js} +1 -1
  84. package/_assets/{index-6lOpuU8D.js → index-BVV_fmte.js} +1 -1
  85. package/_assets/{index--5-WNACO.js → index-BmI_VY2L.js} +1 -1
  86. package/_assets/{index-DCUHwzVB.js → index-BmXWASOw.js} +1 -1
  87. package/_assets/{index-BlTW8bE5.js → index-C4paiR8G.js} +1 -1
  88. package/_assets/{index-pzI9SPYg.js → index-C74Kz078.js} +1 -1
  89. package/_assets/index-CFNN4IQh.js +1 -0
  90. package/_assets/{index-CWl1zAsC.js → index-CGvsSnH5.js} +2 -2
  91. package/_assets/{index-7Jx0RbBI.js → index-CHP45HLF.js} +1 -1
  92. package/_assets/{index-r_ie-fYk.js → index-CKh-MxqM.js} +1 -1
  93. package/_assets/{index-D1Kwe229.js → index-CN7oQ8au.js} +1 -1
  94. package/_assets/{index-hzUEG0Wn.js → index-CT-IhRIi.js} +1 -1
  95. package/_assets/{index-D3b-6hLL.js → index-C_2RtD-k.js} +3 -3
  96. package/_assets/{index-DyyMlzME.js → index-Cjv0VYHk.js} +1 -1
  97. package/_assets/{index-BjDpMJu4.js → index-ClooG4VA.js} +1 -1
  98. package/_assets/{index-baUyxxA5.js → index-CoQL2VdI.js} +1 -1
  99. package/_assets/{index-6hXQkpzo.js → index-Cqxr1K7X.js} +1 -1
  100. package/_assets/{index-CnU32wDE.js → index-CrL-oicn.js} +1 -1
  101. package/_assets/{index-BvHiSowo.js → index-CxyxAB7h.js} +1 -1
  102. package/_assets/{index-BPLQs7pP.js → index-CyPEmEh2.js} +1 -1
  103. package/_assets/index-DBKr5jDP.js +3318 -0
  104. package/_assets/{index-DUdz_zrJ.js → index-DD3YA4Xc.js} +1 -1
  105. package/_assets/{index-CMt6SGgd.js → index-DItNTWlM.js} +1 -1
  106. package/_assets/{index-D0VlnNE3.js → index-DVtU3QsJ.js} +1 -1
  107. package/_assets/{index-Cz0mItuU.js → index-DWFeJSdC.js} +1 -1
  108. package/_assets/{index-DIpNccsB.js → index-Dvtk0M13.js} +1 -1
  109. package/_assets/{index-3Gl3qzVg.js → index-Dz2HX_tG.js} +1 -1
  110. package/_assets/{index-CiVLOnq4.js → index-DzE64ywR.js} +1 -1
  111. package/_assets/{index-DN_XFLDI.js → index-M6ot6iel.js} +9 -9
  112. package/_assets/index-T0WMmU10.js +2 -0
  113. package/_assets/{index-CWDp9PWh.js → index-UVas8o3a.js} +1 -1
  114. package/_assets/{index-BH9Lj6j_.js → index-YodNRE0F.js} +1 -1
  115. package/_assets/{index-BSMtncI0.js → index-aPDIsvsp.js} +1 -1
  116. package/_assets/{index-DLJMJNYR.js → index-cNFvNcyv.js} +1 -1
  117. package/_assets/{index-DIGH_-jR.js → index-g_bSpYWE.js} +1 -1
  118. package/_assets/{index-CdMXnYZl.js → index-nD_B3x2a.js} +1 -1
  119. package/_assets/{index-brzaaZ1P.js → index-o26JQUSX.js} +1 -1
  120. package/_assets/{index-DJigbyYH.js → index-wYE8B-zV.js} +1 -1
  121. package/_assets/index-yT06p0hy.js +4 -0
  122. package/_assets/{index.es-BfycRISM.js → index.es-AvY6da-n.js} +1 -1
  123. package/_assets/{index.es-Dz4gJjtG.js → index.es-BjABjHDS.js} +1 -1
  124. package/_assets/{index.es-CEspgBOo.js → index.es-CjrBlA2t.js} +4 -4
  125. package/_assets/{localBatchGatewayRequest-C2ejDWSe.js → localBatchGatewayRequest-DASiMtj6.js} +1 -1
  126. package/_assets/{networks-C8W7qTmi.js → networks-C8ez-bvH.js} +1 -1
  127. package/_assets/{onramp-gMYCcz-L.js → onramp-Mm39n2H9.js} +1 -1
  128. package/_assets/{openzeppelin-DoXqKfoL.js → openzeppelin-DM4th0ON.js} +1 -1
  129. package/_assets/{parseNft-CG6mXwGw.js → parseNft-jU70OzWf.js} +2 -2
  130. package/_assets/{parseSignature-YB0y-EIH.js → parseSignature-DgPEk7JG.js} +3 -3
  131. package/_assets/{parseSignature-BtFyUMyh.js → parseSignature-Vz1kWqBf.js} +1 -1
  132. package/_assets/{passkeys-DMD6dHpE.js → passkeys-DUP0d8Zb.js} +1 -1
  133. package/_assets/{pay-with-exchange-DmOk5KUk.js → pay-with-exchange-bcJ8587x.js} +1 -1
  134. package/_assets/{qr-overlay-BmfI4Van.js → qr-overlay-BgqdrAQN.js} +1 -1
  135. package/_assets/{receive-C8CxHyfZ.js → receive-DLQ1rgxk.js} +1 -1
  136. package/_assets/{resolveImplementation-D10q4uG8.js → resolveImplementation-D5VOTogv.js} +1 -1
  137. package/_assets/{rpc-C6XV-dPj.js → rpc-CZqGf5Pw.js} +1 -1
  138. package/_assets/{secp256k1-BmbnB2T6.js → secp256k1-CeIqoHzM.js} +1 -1
  139. package/_assets/{secp256k1-i1ynB1kh.js → secp256k1-DFodyUE2.js} +1 -1
  140. package/_assets/{secp256k1-CplZyQx1.js → secp256k1-wpoFdYyv.js} +1 -1
  141. package/_assets/{send-r-sbW-NR.js → send-5wSIIKSl.js} +1 -1
  142. package/_assets/{send-batch-transaction-DPGUnjFL.js → send-batch-transaction-BsHJzRR6.js} +1 -1
  143. package/_assets/{send-eip712-transaction-DDBiSwZa.js → send-eip712-transaction-CfdZenAu.js} +2 -2
  144. package/_assets/{send-gasless-transaction-TUww1FFr.js → send-gasless-transaction-DdUHdO7Q.js} +2 -2
  145. package/_assets/{send-transaction-INP2LgJd.js → send-transaction-BI-LBwbQ.js} +2 -2
  146. package/_assets/{sendMetaTransaction-CtlcvZ2u.js → sendMetaTransaction-DZqdC6fw.js} +1 -1
  147. package/_assets/{sendRawTransaction-BiF1pCL3.js → sendRawTransaction-BHUyxFbw.js} +3 -3
  148. package/_assets/{serializeTransaction-_CDXrMP2.js → serializeTransaction-ByXeuyQy.js} +1 -1
  149. package/_assets/{session-proposal-Cyo4-zWW.js → session-proposal-BbxUdmu_.js} +1 -1
  150. package/_assets/{session-request-DhBEeqtM.js → session-request-iIRNVfwz.js} +2 -2
  151. package/_assets/{signing-eZY4IKkr.js → signing-Cnwo6tva.js} +3 -3
  152. package/_assets/{socials-ez11BKnF.js → socials-JesVWt33.js} +1 -1
  153. package/_assets/styled-B0-_jC66.js +9 -0
  154. package/_assets/{swaps-D50dXpS9.js → swaps-DiHFkz3h.js} +1 -1
  155. package/_assets/{thirdweb-DtMwg5nw.js → thirdweb-BgDawyw0.js} +3 -3
  156. package/_assets/{to-serializable-transaction-Bo2k0bHN.js → to-serializable-transaction-Cy2ugr3u.js} +2 -2
  157. package/_assets/{trade-encoding-DBrxq_08.js → trade-encoding-DYGW0EG6.js} +1 -1
  158. package/_assets/{transactionReceipt-D84_cL1Y.js → transactionReceipt-BN5uajuZ.js} +1 -1
  159. package/_assets/{transactions-BxDrgH0T.js → transactions-vLsZNFPY.js} +1 -1
  160. package/_assets/{useCreditPacks-DJGSwrlc.js → useCreditPacks-Bxxs5gPt.js} +1 -1
  161. package/_assets/{useImportable-8-eoe6U0.js → useImportable-DaFCiZt-.js} +1 -1
  162. package/_assets/{useInfiniteGrid-BioQWUj3.js → useInfiniteGrid-aaW1umo4.js} +1 -1
  163. package/_assets/{useTheme-CuHYv3yr.js → useTheme-CWDPVAdC.js} +1 -1
  164. package/_assets/{verifyHash-Dp410C0R.js → verifyHash-Bfqcsnfy.js} +1 -1
  165. package/_assets/{w3m-modal-q1294Ir0.js → w3m-modal-7IzsWep_.js} +1 -1
  166. package/_assets/{w3m-modal-ChBvc6av.js → w3m-modal-dbHO42vZ.js} +1 -1
  167. package/_assets/{wait-for-tx-receipt-GGiAUH7I.js → wait-for-tx-receipt-CNCHrX28.js} +1 -1
  168. package/_assets/{wallets-B8DTTYN0.js → wallets-D-L32AGp.js} +5 -5
  169. package/_assets/{web-connector-CwvhuMom.js → web-connector-PVStra29.js} +3 -3
  170. package/_assets/{writeContract-CsfeVlnc.js → writeContract-znr6ni3L.js} +1 -1
  171. package/_assets/{zoraTestnet-CaYytGcL.js → zoraTestnet-Ux1B_UMW.js} +1 -1
  172. package/index.html +11 -11
  173. package/package.json +2 -2
  174. package/_assets/NotificationsBell-CaKoTXrL.js +0 -34
  175. package/_assets/OutfitDetail-ME6t5FNU.js +0 -326
  176. package/_assets/OutfitPreview-BCoX8M6g.js +0 -6
  177. package/_assets/OutfitStudio-DeiWpnBW.js +0 -500
  178. package/_assets/clsx-Dp2xNKFR.js +0 -9
  179. package/_assets/emotion-styled.browser.esm-Cc0eNU1p.js +0 -1
  180. package/_assets/index-BQADEYsi.js +0 -1
  181. package/_assets/index-BYQ4eOXE.js +0 -2
  182. package/_assets/index-C50bRdDg.js +0 -3318
  183. package/_assets/index-C5xtRArG.js +0 -4
@@ -1,4 +1,4 @@
1
- import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";import{t as he,H as Ae,K as Y,J as Z,s,bE as Ie,au as Re,bF as ze,d as o,bG as Be,bH as ee,B as Me,ad as me,X as xe,bi as _e,l as Te,z as ue,bp as We,bj as De,bk as Ge,I as te,c as Oe,v as Ke,o as He,ae as Ue,ag as A,ah as oe,bI as re,bJ as qe}from"./index-C50bRdDg.js";import{d as Ve,P as Je,C as Qe,a as Xe,b as Ye,A as Ze,c as et,e as tt}from"./collectionPage.styles-DTQE0MEN.js";import{g as ot,h as rt,i as it,j as st,k as at,C as nt,l as lt,o as ct,m as dt,n as ht,M as mt,E as xt,p as ut,q as pt,r as gt,s as ft,t as bt}from"./Assets.styles-BAy3by3Z.js";import{S as ie,R as wt,F as jt,e as vt}from"./categories-SI1YlvJt.js";import{L as se}from"./LoadMore-C6sUcyIf.js";import{u as ae}from"./useInfiniteGrid-BioQWUj3.js";import{E as W}from"./ErrorNotice-6j32LCd-.js";import{G as ne}from"./grid.styles-Ckr_d1Os.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./Tooltip-BZ-qUO0l.js";function yt(r){const{gridLoading:i,gridError:a,gridCount:n,baselinePending:h,baselineError:l,baselineCount:m}=r;return i?"skeletons":a?"error":n>0?"items":h?"skeletons":l?"error":m===0?"no-creations":"filters"}const{colors:b,radius:pe,media:Ct}=he,kt=s.article`
1
+ import{d as de,j as e,L as Ee,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";import{t as he,H as Ae,K as Y,J as Z,s,bH as Ie,ax as Re,bI as ze,d as o,bJ as Me,bK as ee,B as Be,ae as me,X as xe,bl as _e,l as Te,z as ue,bs as We,bm as De,bn as Ke,I as te,c as Oe,v as Ge,o as He,af as Ue,aj as A,ak as oe,bL as re,bM as qe}from"./index-DBKr5jDP.js";import{d as Ve,P as Je,C as Qe,a as Xe,b as Ye,A as Ze,c as et,e as tt}from"./collectionPage.styles-zJMtUweU.js";import{g as ot,h as rt,i as it,j as st,k as at,C as nt,l as lt,o as ct,m as dt,n as ht,M as mt,E as xt,p as ut,q as pt,r as gt,s as ft,t as bt}from"./Assets.styles-9ki_t5x3.js";import{S as ie,R as wt,F as jt,e as vt}from"./categories-B0u9Kgh7.js";import{L as se}from"./LoadMore-BO9-NgF0.js";import{u as ae}from"./useInfiniteGrid-aaW1umo4.js";import{E as W}from"./ErrorNotice-B5gvtysl.js";import{G as ne}from"./grid.styles-nOJmORwE.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";import"./Tooltip-BQX-SlPA.js";function yt(r){const{gridLoading:i,gridError:a,gridCount:n,baselinePending:h,baselineError:l,baselineCount:m}=r;return i?"skeletons":a?"error":n>0?"items":h?"skeletons":l?"error":m===0?"no-creations":"filters"}const{colors:b,radius:pe,media:Ct}=he,kt=s.article`
2
2
  height: 300px;
3
3
  background: ${b.bg};
4
4
  border-radius: ${pe.card};
@@ -54,14 +54,14 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
54
54
  object-fit: contain;
55
55
  padding: 10px;
56
56
  }
57
- `,Et=s.div`
57
+ `,Pt=s.div`
58
58
  flex: 0 0 102px;
59
59
  height: 102px;
60
60
  padding: 12px 14px;
61
61
  display: flex;
62
62
  flex-direction: column;
63
63
  gap: 8px;
64
- `,Pt=s.h3`
64
+ `,Et=s.h3`
65
65
  margin: 0;
66
66
  font-weight: 700;
67
67
  font-size: 18px;
@@ -135,7 +135,7 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
135
135
  &:active {
136
136
  background: ${b.accentActive};
137
137
  }
138
- `;function Bt({collection:r,cover:i,itemCount:a}){const n=de(),{contractAddress:h,name:l,creator:m}=r,C=i==null||a==null,{data:x}=ze(h,C),j=i==null?(x==null?void 0:x.items)??[]:[],g=a??(x==null?void 0:x.total);function w(){n(`/collection/${h}`)}return e.jsxs(kt,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:w,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),w())},children:[e.jsx($t,{children:i?e.jsx(St,{"data-testid":"coll-card-img",src:i,alt:"",loading:"lazy"}):j.length>0?e.jsx(Nt,{items:j,tinted:!1}):null}),e.jsxs(Et,{children:[e.jsx(Pt,{title:l,children:l}),e.jsxs(Ft,{children:[e.jsxs(Lt,{"data-meta":!0,"data-testid":"coll-card-meta",children:[m?e.jsx(At,{address:m,linkToProfile:!0}):e.jsx(It,{children:" "}),e.jsx(Rt,{children:g==null?"…":o("collectionCard.itemCount",{count:g})})]}),e.jsx(zt,{"data-view":!0,"data-testid":"coll-card-view",onClick:u=>{u.stopPropagation(),w()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Mt({address:r,className:i=""}){const a=Be(),n=ee(l=>l.followed.includes(r.toLowerCase())),h=ee(l=>l.toggle);return!a||!r?null:e.jsx(Me,{type:"button",size:"sm",variant:n?"ghost":"outline",className:i||void 0,"data-testid":"follow-button","aria-pressed":n,title:n?o("creator.unfollowTitle"):o("creator.followTitle"),onClick:()=>h(r),children:n?o("creator.following"):o("creator.follow")})}const{colors:y,radius:ge,media:v}=he,fe=me`
138
+ `;function Mt({collection:r,cover:i,itemCount:a}){const n=de(),{contractAddress:h,name:l,creator:m}=r,C=i==null||a==null,{data:x}=ze(h,C),j=i==null?(x==null?void 0:x.items)??[]:[],g=a??(x==null?void 0:x.total);function w(){n(`/collection/${h}`)}return e.jsxs(kt,{"data-testid":"coll-card",role:"link",tabIndex:0,onClick:w,onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),w())},children:[e.jsx($t,{children:i?e.jsx(St,{"data-testid":"coll-card-img",src:i,alt:"",loading:"lazy"}):j.length>0?e.jsx(Nt,{items:j,tinted:!1}):null}),e.jsxs(Pt,{children:[e.jsx(Et,{title:l,children:l}),e.jsxs(Ft,{children:[e.jsxs(Lt,{"data-meta":!0,"data-testid":"coll-card-meta",children:[m?e.jsx(At,{address:m,linkToProfile:!0}):e.jsx(It,{children:" "}),e.jsx(Rt,{children:g==null?"…":o("collectionCard.itemCount",{count:g})})]}),e.jsx(zt,{"data-view":!0,"data-testid":"coll-card-view",onClick:u=>{u.stopPropagation(),w()},tabIndex:-1,children:o("collectionCard.viewCollection")})]})]})]})}function Bt({address:r,className:i=""}){const a=Me(),n=ee(l=>l.followed.includes(r.toLowerCase())),h=ee(l=>l.toggle);return!a||!r?null:e.jsx(Be,{type:"button",size:"sm",variant:n?"ghost":"outline",className:i||void 0,"data-testid":"follow-button","aria-pressed":n,title:n?o("creator.unfollowTitle"):o("creator.followTitle"),onClick:()=>h(r),children:n?o("creator.following"):o("creator.follow")})}const{colors:y,radius:ge,media:v}=he,fe=me`
139
139
  display: inline-flex;
140
140
  align-items: center;
141
141
  justify-content: center;
@@ -183,7 +183,7 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
183
183
  position: absolute;
184
184
  inset: 0;
185
185
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 100%);
186
- `,Gt=s.div`
186
+ `,Kt=s.div`
187
187
  position: absolute;
188
188
  top: 16px;
189
189
  right: 16px;
@@ -219,7 +219,7 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
219
219
  }
220
220
  `,Ot=s.a`
221
221
  ${be};
222
- `,Kt=s(Pe)`
222
+ `,Gt=s(Ee)`
223
223
  ${be};
224
224
  width: 32px;
225
225
  height: 32px;
@@ -303,4 +303,4 @@ import{d as de,j as e,L as Pe,u as Fe,e as Le,r as f}from"./react-DehiWSvs.js";i
303
303
  &:hover {
304
304
  background: rgba(255, 255, 255, 0.14);
305
305
  }
306
- `,Qt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Xt({address:r}){var u,k;const{data:i}=xe(r),{data:a}=_e(r),n=Te(c=>{var $;return($=c.session)==null?void 0:$.address}),h=!!n&&n.toLowerCase()===r.toLowerCase(),l=(i==null?void 0:i.name)||ue(r),m=(k=(u=i==null?void 0:i.avatar)==null?void 0:u.snapshots)==null?void 0:k.face256,C=(a==null?void 0:a.cover)||Ve,x=a==null?void 0:a.description,j=`${Oe.profileUrl}/${r}`,g=We.filter(c=>a==null?void 0:a.links[c]),w=De(Ge({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(_t,{"aria-label":`${l} storefront`,children:[e.jsxs(Tt,{children:[e.jsx(Wt,{src:C,alt:"",loading:"eager"}),e.jsx(Dt,{"aria-hidden":!0})]}),(g.length>0||h)&&e.jsxs(Gt,{children:[g.map(c=>e.jsx(Ot,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${c}`),"aria-label":o(`creator.link.${c}`),children:e.jsx(te,{name:Qt[c]})},c)),h&&e.jsx(Kt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(te,{name:"pen"})})]}),e.jsxs(Ht,{children:[m?e.jsx(le,{src:m,alt:"",loading:"eager",style:{backgroundColor:w}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:w}}),e.jsxs("div",{children:[e.jsx(Ut,{children:l}),x?e.jsx(qt,{children:x}):null]}),e.jsxs(Vt,{children:[e.jsx(Jt,{"data-testid":"creator-hero-view",href:j,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Mt,{address:r,className:"creator-hero__follow"})]})]})]})}const ce=48;function xo(){const{address:r}=Fe(),i=de(),[a]=Le(),n=a.has("collections"),{data:h}=xe(r),l=(h==null?void 0:h.name)||(r?ue(r):o("creator.fallbackName"));Ke({title:l,description:o("seo.creator.description",{name:l})});const[m,C]=f.useState("all"),[x,j]=f.useState(null),[g,w]=f.useState([]),[u,k]=f.useState(""),[c,$]=f.useState(""),[N,I]=f.useState("all"),[R,z]=f.useState(!1),[D,we]=f.useState("newest"),[P,E]=f.useState(!1);f.useEffect(()=>{if(!P)return;const t=T=>{T.key==="Escape"&&E(!1)};document.addEventListener("keydown",t);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=d}},[P]);const G=u&&!Number.isNaN(Number(u))?Number(u):void 0,O=c&&!Number.isNaN(Number(c))?Number(c):void 0,je=x?vt[x]:void 0,ve=(ie.find(t=>t.key===D)??ie[0]).server,K={creator:r,category:m,rarities:g.length?g:void 0,wearableCategories:je,minPriceCredits:G,maxPriceCredits:O,isWearableSmart:R||void 0,isOnSale:N==="all"?void 0:N==="on_sale",sortBy:ve},{items:B,total:ye,isLoading:Ce,isPlaceholderData:ke,error:H,hasNextPage:$e,isFetchingNextPage:U,isFetchNextPageError:Se,fetchNextPage:Ne}=ae(["creator-items",K],t=>re({...K,first:ce,skip:t}),{enabled:!!r&&!n}),F=He({queryKey:["creator-item-count",r],queryFn:()=>re({creator:r,first:1}).then(t=>t.total),enabled:!!r}),p=ae(["creator-collections",r],t=>qe(r,{first:ce,skip:t}).then(d=>({items:d.collections,total:d.total})),{enabled:!!r&&n});function q(t){C(t),j(null),n&&V()}function V(){const t=new URLSearchParams(a);t.delete("collections");const d=t.toString();i({search:d?`?${d}`:""},{replace:!0})}function Ee(){if(n){V();return}const t=new URLSearchParams(a);t.delete("collections");const d=t.toString();i({search:d?`?${d}&collections`:"?collections"},{replace:!0})}function J(t){w(d=>d.includes(t)?d.filter(T=>T!==t):[...d,t])}function Q(){C("all"),j(null),w([]),k(""),$(""),I("all"),z(!1)}const S=[];(m==="wearable"||m==="emote")&&S.push({key:"category",label:o(m==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>q("all")}),(G!=null||O!=null)&&S.push({key:"price",label:o("filter.price"),onRemove:()=>{k(""),$("")}});for(const t of wt)g.includes(t)&&S.push({key:`rarity-${t}`,label:Ue(t),onRemove:()=>J(t)});R&&S.push({key:"smart",label:o("filter.smart"),onRemove:()=>z(!1)}),N!=="all"&&S.push({key:"status",label:N==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>I("all")});const L=yt({gridLoading:Ce||ke,gridError:!!H,gridCount:B.length,baselinePending:F.isPending,baselineError:F.isError,baselineCount:F.data}),M=L==="skeletons",X=B.filter(t=>t.priceCredits>0),_=L==="items"||L==="skeletons"?null:L;return e.jsxs(Je,{children:[e.jsxs(Qe,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(Xe,{onClick:()=>i("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Ye,{children:l})]}),r?e.jsx(Xt,{address:r}):null,!n&&!M&&X.length>0?e.jsx(Ze,{items:X,source:"creator"}):null,e.jsxs(ot,{children:[P?e.jsx(rt,{onClick:()=>E(!1),"aria-hidden":!0}):null,e.jsxs(it,{"data-open":P||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(st,{children:[e.jsx(at,{children:o("assets.filters")}),e.jsx(nt,{onClick:()=>E(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(lt,{children:e.jsx(ct,{category:m,subCategory:x,onCategory:q,onSub:j,priceMin:u,priceMax:c,onPriceMin:k,onPriceMax:$,rarities:g,onToggleRarity:J,status:N,onStatus:I,smart:R,onSmart:z,hideNames:!0,collections:n,onCollections:Ee})}),e.jsx(dt,{children:e.jsx(ht,{type:"button",onClick:()=>E(!1),children:o("assets.showItems")})})]}),e.jsx(mt,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(et,{children:e.jsx(tt,{children:p.isLoading?"…":o("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(W,{message:o("creator.error")}):null,e.jsx(ne,{"data-variant":"collections",children:p.isLoading?e.jsx(A,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(t=>e.jsx(Bt,{collection:t,itemCount:t.itemCount},t.contractAddress)),p.isFetchingNextPage?e.jsx(A,{count:6}):null]})}),e.jsx(se,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,isError:p.isFetchNextPageError,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(jt,{sort:D,onSort:we,total:ye,loading:M,onOpenFilters:()=>E(!0),chips:S,onClearChips:Q}),H?e.jsx(W,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ne,{"data-testid":"creator-grid",children:M?e.jsx(A,{count:15}):e.jsxs(e.Fragment,{children:[B.map(t=>t.priceCredits>0?e.jsx(oe,{item:t},t.id):e.jsx(oe,{item:t,mode:"view"},t.id)),U?e.jsx(A,{count:6}):null]})}),e.jsx(se,{hasNextPage:$e,isFetching:U,isError:Se,onLoadMore:()=>void Ne()}),_==="error"?e.jsx(W,{message:o("creator.error"),testId:"creator-empty-error"}):_==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):_==="filters"?e.jsxs(xt,{"data-testid":"creator-empty-filters",children:[e.jsxs(ut,{children:[e.jsx(pt,{children:o("creator.emptyFilters.title")}),e.jsx(gt,{children:o("creator.emptyFilters.body",{count:F.data??0})})]}),e.jsx(ft,{children:e.jsx(bt,{type:"button",onClick:Q,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{xo as Creator,xo as default};
306
+ `,Qt={website:"website",twitter:"twitter",discord:"discord",facebook:"facebook"};function Xt({address:r}){var u,k;const{data:i}=xe(r),{data:a}=_e(r),n=Te(c=>{var $;return($=c.session)==null?void 0:$.address}),h=!!n&&n.toLowerCase()===r.toLowerCase(),l=(i==null?void 0:i.name)||ue(r),m=(k=(u=i==null?void 0:i.avatar)==null?void 0:u.snapshots)==null?void 0:k.face256,C=(a==null?void 0:a.cover)||Ve,x=a==null?void 0:a.description,j=`${Oe.profileUrl}/${r}`,g=We.filter(c=>a==null?void 0:a.links[c]),w=De(Ke({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(_t,{"aria-label":`${l} storefront`,children:[e.jsxs(Tt,{children:[e.jsx(Wt,{src:C,alt:"",loading:"eager"}),e.jsx(Dt,{"aria-hidden":!0})]}),(g.length>0||h)&&e.jsxs(Kt,{children:[g.map(c=>e.jsx(Ot,{"data-testid":"creator-hero-link",href:(a==null?void 0:a.links[c])??"",target:"_blank",rel:"noopener noreferrer",title:o(`creator.link.${c}`),"aria-label":o(`creator.link.${c}`),children:e.jsx(te,{name:Qt[c]})},c)),h&&e.jsx(Gt,{to:"/store-settings",title:o("creator.editStore"),"aria-label":o("creator.editStore"),children:e.jsx(te,{name:"pen"})})]}),e.jsxs(Ht,{children:[m?e.jsx(le,{src:m,alt:"",loading:"eager",style:{backgroundColor:w}}):e.jsx(le,{as:"span","aria-hidden":!0,style:{backgroundColor:w}}),e.jsxs("div",{children:[e.jsx(Ut,{children:l}),x?e.jsx(qt,{children:x}):null]}),e.jsxs(Vt,{children:[e.jsx(Jt,{"data-testid":"creator-hero-view",href:j,target:"_blank",rel:"noopener noreferrer",children:o("creator.viewProfile")}),e.jsx(Bt,{address:r,className:"creator-hero__follow"})]})]})]})}const ce=48;function xo(){const{address:r}=Fe(),i=de(),[a]=Le(),n=a.has("collections"),{data:h}=xe(r),l=(h==null?void 0:h.name)||(r?ue(r):o("creator.fallbackName"));Ge({title:l,description:o("seo.creator.description",{name:l})});const[m,C]=f.useState("all"),[x,j]=f.useState(null),[g,w]=f.useState([]),[u,k]=f.useState(""),[c,$]=f.useState(""),[N,I]=f.useState("all"),[R,z]=f.useState(!1),[D,we]=f.useState("newest"),[E,P]=f.useState(!1);f.useEffect(()=>{if(!E)return;const t=T=>{T.key==="Escape"&&P(!1)};document.addEventListener("keydown",t);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=d}},[E]);const K=u&&!Number.isNaN(Number(u))?Number(u):void 0,O=c&&!Number.isNaN(Number(c))?Number(c):void 0,je=x?vt[x]:void 0,ve=(ie.find(t=>t.key===D)??ie[0]).server,G={creator:r,category:m,rarities:g.length?g:void 0,wearableCategories:je,minPriceCredits:K,maxPriceCredits:O,isWearableSmart:R||void 0,isOnSale:N==="all"?void 0:N==="on_sale",sortBy:ve},{items:M,total:ye,isLoading:Ce,isPlaceholderData:ke,error:H,hasNextPage:$e,isFetchingNextPage:U,isFetchNextPageError:Se,fetchNextPage:Ne}=ae(["creator-items",G],t=>re({...G,first:ce,skip:t}),{enabled:!!r&&!n}),F=He({queryKey:["creator-item-count",r],queryFn:()=>re({creator:r,first:1}).then(t=>t.total),enabled:!!r}),p=ae(["creator-collections",r],t=>qe(r,{first:ce,skip:t}).then(d=>({items:d.collections,total:d.total})),{enabled:!!r&&n});function q(t){C(t),j(null),n&&V()}function V(){const t=new URLSearchParams(a);t.delete("collections");const d=t.toString();i({search:d?`?${d}`:""},{replace:!0})}function Pe(){if(n){V();return}const t=new URLSearchParams(a);t.delete("collections");const d=t.toString();i({search:d?`?${d}&collections`:"?collections"},{replace:!0})}function J(t){w(d=>d.includes(t)?d.filter(T=>T!==t):[...d,t])}function Q(){C("all"),j(null),w([]),k(""),$(""),I("all"),z(!1)}const S=[];(m==="wearable"||m==="emote")&&S.push({key:"category",label:o(m==="emote"?"categories.emotes":"categories.wearables"),onRemove:()=>q("all")}),(K!=null||O!=null)&&S.push({key:"price",label:o("filter.price"),onRemove:()=>{k(""),$("")}});for(const t of wt)g.includes(t)&&S.push({key:`rarity-${t}`,label:Ue(t),onRemove:()=>J(t)});R&&S.push({key:"smart",label:o("filter.smart"),onRemove:()=>z(!1)}),N!=="all"&&S.push({key:"status",label:N==="on_sale"?o("filter.onSale"):o("filter.notForSale"),onRemove:()=>I("all")});const L=yt({gridLoading:Ce||ke,gridError:!!H,gridCount:M.length,baselinePending:F.isPending,baselineError:F.isError,baselineCount:F.data}),B=L==="skeletons",X=M.filter(t=>t.priceCredits>0),_=L==="items"||L==="skeletons"?null:L;return e.jsxs(Je,{children:[e.jsxs(Qe,{"aria-label":o("creator.breadcrumbAria"),children:[e.jsx(Xe,{onClick:()=>i("/items"),children:o("creator.breadcrumb")}),e.jsx("span",{children:"/"}),e.jsx(Ye,{children:l})]}),r?e.jsx(Xt,{address:r}):null,!n&&!B&&X.length>0?e.jsx(Ze,{items:X,source:"creator"}):null,e.jsxs(ot,{children:[E?e.jsx(rt,{onClick:()=>P(!1),"aria-hidden":!0}):null,e.jsxs(it,{"data-open":E||void 0,"data-testid":"creator-sidebar",children:[e.jsxs(st,{children:[e.jsx(at,{children:o("assets.filters")}),e.jsx(nt,{onClick:()=>P(!1),"aria-label":o("assets.closeFilters"),children:"✕"})]}),e.jsx(lt,{children:e.jsx(ct,{category:m,subCategory:x,onCategory:q,onSub:j,priceMin:u,priceMax:c,onPriceMin:k,onPriceMax:$,rarities:g,onToggleRarity:J,status:N,onStatus:I,smart:R,onSmart:z,hideNames:!0,collections:n,onCollections:Pe})}),e.jsx(dt,{children:e.jsx(ht,{type:"button",onClick:()=>P(!1),children:o("assets.showItems")})})]}),e.jsx(mt,{children:n?e.jsxs(e.Fragment,{children:[e.jsx(et,{children:e.jsx(tt,{children:p.isLoading?"…":o("creator.collectionsCount",{count:p.total})})}),p.error?e.jsx(W,{message:o("creator.error")}):null,e.jsx(ne,{"data-variant":"collections",children:p.isLoading?e.jsx(A,{count:9}):e.jsxs(e.Fragment,{children:[p.items.map(t=>e.jsx(Mt,{collection:t,itemCount:t.itemCount},t.contractAddress)),p.isFetchingNextPage?e.jsx(A,{count:6}):null]})}),e.jsx(se,{hasNextPage:p.hasNextPage,isFetching:p.isFetchingNextPage,isError:p.isFetchNextPageError,onLoadMore:()=>void p.fetchNextPage()}),!p.isLoading&&!p.error&&p.items.length===0?e.jsx("p",{className:"muted",children:o("creator.collectionsEmpty")}):null]}):e.jsxs(e.Fragment,{children:[e.jsx(jt,{sort:D,onSort:we,total:ye,loading:B,onOpenFilters:()=>P(!0),chips:S,onClearChips:Q}),H?e.jsx(W,{message:o("creator.error"),testId:"creator-error"}):null,e.jsx(ne,{"data-testid":"creator-grid",children:B?e.jsx(A,{count:15}):e.jsxs(e.Fragment,{children:[M.map(t=>t.priceCredits>0?e.jsx(oe,{item:t},t.id):e.jsx(oe,{item:t,mode:"view"},t.id)),U?e.jsx(A,{count:6}):null]})}),e.jsx(se,{hasNextPage:$e,isFetching:U,isError:Se,onLoadMore:()=>void Ne()}),_==="error"?e.jsx(W,{message:o("creator.error"),testId:"creator-empty-error"}):_==="no-creations"?e.jsx("p",{className:"muted","data-testid":"creator-empty-none",children:o("creator.emptyNoCreations")}):_==="filters"?e.jsxs(xt,{"data-testid":"creator-empty-filters",children:[e.jsxs(ut,{children:[e.jsx(pt,{children:o("creator.emptyFilters.title")}),e.jsx(gt,{children:o("creator.emptyFilters.body",{count:F.data??0})})]}),e.jsx(ft,{children:e.jsx(bt,{type:"button",onClick:Q,children:o("filterBar.clearAll")})})]}):null]})})]})]})}export{xo as Creator,xo as default};
@@ -1 +1 @@
1
- import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-C50bRdDg.js";function a({message:e,className:o,testId:t}){return e?r.jsxs("p",{className:o?`error-notice ${o}`:"error-notice","data-testid":t,role:"alert",children:[r.jsx(i,{name:"alert",className:"error-notice__ico",size:18}),r.jsx("span",{className:"error-notice__msg",children:e})]}):null}export{a as E};
1
+ import{j as r}from"./react-DehiWSvs.js";import{I as i}from"./index-DBKr5jDP.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-8GeYldkk.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-D3b-6hLL.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-DrpRVilu.js";import{g as T,a as W,f as b,b as _,c as v}from"./index-C_2RtD-k.js";const D=0,C={paymentAsset:null,amount:null,tokenAmount:0,priceLoading:!1,error:null,exchanges:[],isLoading:!1,currentPayment:void 0,isPaymentInProgress:!1,paymentId:"",assets:[]},e=L(C),m={state:e,subscribe(t){return I(e,()=>t(e))},subscribeKey(t,n){return N(e,t,n)},resetState(){Object.assign(e,{...C})},async getAssetsForNetwork(t){const n=v(t),s=await m.getAssetsImageAndPrice(n),r=n.map(a=>{var c,o,p,y;const u=a.asset==="native"?f():`${a.network}:${a.asset}`,i=s.find(S=>{var g,d,h;return((h=(d=(g=S.fungibles)==null?void 0:g[0])==null?void 0:d.address)==null?void 0:h.toLowerCase())===u.toLowerCase()});return{...a,price:((o=(c=i==null?void 0:i.fungibles)==null?void 0:c[0])==null?void 0:o.price)||1,metadata:{...a.metadata,iconUrl:(y=(p=i==null?void 0:i.fungibles)==null?void 0:p[0])==null?void 0:y.iconUrl}}});return e.assets=r,r},async getAssetsImageAndPrice(t){const n=t.map(r=>r.asset==="native"?f():`${r.network}:${r.asset}`);return await Promise.all(n.map(r=>x.fetchTokenPrice({addresses:[r]})))},getTokenAmount(){var s;if(!((s=e==null?void 0:e.paymentAsset)!=null&&s.price))throw new Error("Cannot get token price");const t=P.bigNumber(e.amount??0).round(8),n=P.bigNumber(e.paymentAsset.price).round(8);return t.div(n).round(8).toNumber()},setAmount(t){var n;e.amount=t,(n=e.paymentAsset)!=null&&n.price&&(e.tokenAmount=m.getTokenAmount())},setPaymentAsset(t){e.paymentAsset=t},isPayWithExchangeEnabled(){var t;return(t=U.state.remoteFeatures)==null?void 0:t.payWithExchange},isPayWithExchangeSupported(){return m.isPayWithExchangeEnabled()&&l.state.activeCaipNetwork&&k.PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES.includes(l.state.activeCaipNetwork.chainNamespace)},async fetchExchanges(){var t;try{const n=m.isPayWithExchangeSupported();if(!e.paymentAsset||!n){e.exchanges=[],e.isLoading=!1;return}e.isLoading=!0;const s=await _({page:D,asset:b(e.paymentAsset.network,e.paymentAsset.asset),amount:((t=e.amount)==null?void 0:t.toString())??"0"});e.exchanges=s.exchanges.slice(0,2)}catch{throw A.showError("Unable to get exchanges"),new Error("Unable to get exchanges")}finally{e.isLoading=!1}},async getPayUrl(t,n){try{const s=Number(n.amount),r=await W({exchangeId:t,asset:b(n.network,n.asset),amount:s.toString(),recipient:`${n.network}:${n.recipient}`});return w.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{exchange:{id:t},configuration:{network:n.network,asset:n.asset,recipient:n.recipient,amount:s},currentPayment:{type:"exchange",exchangeId:t},source:"fund-from-exchange",headless:!1}}),r}catch(s){throw s instanceof Error&&s.message.includes("is not supported")?new Error("Asset not supported"):new Error(s.message)}},async handlePayWithExchange(t){var n;try{const s=(n=l.getAccountData())==null?void 0:n.address;if(!s)throw new Error("No account connected");if(!e.paymentAsset)throw new Error("No payment asset selected");const r=E.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!r)throw new Error("Could not create popup window");e.isPaymentInProgress=!0,e.paymentId=crypto.randomUUID(),e.currentPayment={type:"exchange",exchangeId:t};const{network:a,asset:u}=e.paymentAsset,i={network:a,asset:u,amount:e.tokenAmount,recipient:s},c=await m.getPayUrl(t,i);if(!c){try{r.close()}catch(o){console.error("Unable to close popup window",o)}throw new Error("Unable to initiate payment")}e.currentPayment.sessionId=c.sessionId,e.currentPayment.status="IN_PROGRESS",e.currentPayment.exchangeId=t,r.location.href=c.url}catch{e.error="Unable to initiate payment",A.showError(e.error)}},async waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r=20}){const a=await m.getBuyStatus(t,n,s);if(a.status==="SUCCESS"||a.status==="FAILED")return a;if(r===0)throw new Error("Unable to get deposit status");return await new Promise(u=>{setTimeout(u,5e3)}),m.waitUntilComplete({exchangeId:t,sessionId:n,paymentId:s,retries:r-1})},async getBuyStatus(t,n,s){var r,a,u,i,c;try{if(!e.currentPayment)throw new Error("No current payment");const o=await T({sessionId:n,exchangeId:t});if(e.currentPayment.status=o.status,o.status==="SUCCESS"||o.status==="FAILED"){const p=(r=l.getAccountData())==null?void 0:r.address;e.currentPayment.result=o.txHash,e.isPaymentInProgress=!1,w.sendEvent({type:"track",event:o.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:o.status==="FAILED"?E.parseError(e.error):void 0,source:"fund-from-exchange",paymentId:s,configuration:{network:((a=e.paymentAsset)==null?void 0:a.network)||"",asset:((u=e.paymentAsset)==null?void 0:u.asset)||"",recipient:p||"",amount:e.amount??0},currentPayment:{type:"exchange",exchangeId:(i=e.currentPayment)==null?void 0:i.exchangeId,sessionId:(c=e.currentPayment)==null?void 0:c.sessionId,result:o.txHash}}})}return o}catch{return{status:"UNKNOWN",txHash:""}}},reset(){e.currentPayment=void 0,e.isPaymentInProgress=!1,e.paymentId="",e.paymentAsset=null,e.amount=0,e.tokenAmount=0,e.priceLoading=!1,e.error=null,e.exchanges=[],e.isLoading=!1}};export{m as E};
@@ -1,4 +1,4 @@
1
- import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,q as B,v as ge,d as n,e as p,l as ue,y as fe,U as u,b7 as me,D as N,bg as U,bK as be,I as ie,b0 as D,x as re,bL as H}from"./index-C50bRdDg.js";import{R as K}from"./resume-buy-Bf0zIH7y.js";import{u as we,a as ye,R as ke,c as Ce,i as ve,b as $e}from"./useCreditPacks-DJGSwrlc.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const P="https://cdn.decentraland.org/@dcl/shop/0.6.1/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.6.1/_assets/pack-stacks-D-V2jSHW.webp",se="https://cdn.decentraland.org/@dcl/shop/0.6.1/_assets/pack-chest-BX_j84xW.webp",je="https://cdn.decentraland.org/@dcl/shop/0.6.1/_assets/credit-coin-CmcTCd5i.webp",Se="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",Pe="https://cdn.decentraland.org/@dcl/shop/0.6.1/_assets/packs-backdrop-BcXiUPeP.webp",O="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",_e=i.div`
1
+ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t as e,q as B,v as ue,d as n,e as p,l as ge,y as fe,U as g,ba as me,D as G,bj as U,bN as be,I as ie,b4 as O,x as re,bO as D}from"./index-DBKr5jDP.js";import{R as H}from"./resume-buy-Bf0zIH7y.js";import{u as we,a as ye,R as ke,c as Ce,i as ve,b as $e}from"./useCreditPacks-Bxxs5gPt.js";import"./sentry-973sfbO9.js";import"./dcl-schemas-Dr9BTjb7.js";import"./ethers-CtNGBird.js";import"./intl-CBcMB1D2.js";const P="https://cdn.decentraland.org/@dcl/shop/0.6.2-30958394678.commit-3968c2a/_assets/pack-coins-BDh1ZDbh.webp",ne="https://cdn.decentraland.org/@dcl/shop/0.6.2-30958394678.commit-3968c2a/_assets/pack-stacks-D-V2jSHW.webp",oe="https://cdn.decentraland.org/@dcl/shop/0.6.2-30958394678.commit-3968c2a/_assets/pack-chest-BX_j84xW.webp",je="https://cdn.decentraland.org/@dcl/shop/0.6.2-30958394678.commit-3968c2a/_assets/credit-coin-CmcTCd5i.webp",Se="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",Pe="https://cdn.decentraland.org/@dcl/shop/0.6.2-30958394678.commit-3968c2a/_assets/packs-backdrop-BcXiUPeP.webp",K="linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",_e=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 24px;
@@ -175,9 +175,9 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
175
175
  inset: 0;
176
176
  border-radius: inherit;
177
177
  pointer-events: none;
178
- -webkit-mask: ${O};
178
+ -webkit-mask: ${K};
179
179
  -webkit-mask-composite: xor;
180
- mask: ${O};
180
+ mask: ${K};
181
181
  mask-composite: exclude;
182
182
  transition: opacity 0.15s ease;
183
183
  }
@@ -307,7 +307,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
307
307
  height: 24.81px;
308
308
  }
309
309
  }
310
- `,Ge=i.span`
310
+ `,Ne=i.span`
311
311
  font-family: ${e.font.sans};
312
312
  font-size: 40px;
313
313
  font-weight: 800;
@@ -318,7 +318,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
318
318
  font-size: 32px;
319
319
  line-height: 24px;
320
320
  }
321
- `,Ne=i.span`
321
+ `,Ge=i.span`
322
322
  font-family: ${e.font.sans};
323
323
  font-size: 20px;
324
324
  font-weight: 500;
@@ -341,7 +341,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
341
341
  height: 100%;
342
342
  object-fit: contain;
343
343
  }
344
- `,De=i.span`
344
+ `,Oe=i.span`
345
345
  display: flex;
346
346
  align-items: center;
347
347
  justify-content: center;
@@ -365,7 +365,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
365
365
  letter-spacing: 0.46px;
366
366
  color: ${e.colors.text2};
367
367
  text-transform: uppercase;
368
- `,He=B`
368
+ `,De=B`
369
369
  to {
370
370
  background-position: -200% 0;
371
371
  }
@@ -378,16 +378,16 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
378
378
  rgba(255, 255, 255, 0.08) 70%
379
379
  );
380
380
  background-size: 200% 100%;
381
- animation: ${He} 1.4s infinite linear;
381
+ animation: ${De} 1.4s infinite linear;
382
382
 
383
383
  @media (prefers-reduced-motion: reduce) {
384
384
  animation: none;
385
385
  }
386
- `,Ke=i(E)`
386
+ `,He=i(E)`
387
387
  width: 60%;
388
388
  height: 30px;
389
389
  border-radius: ${e.radius.chip};
390
- `,Oe=i(E)`
390
+ `,Ke=i(E)`
391
391
  width: 253.5px;
392
392
  max-width: 100%;
393
393
  aspect-ratio: 1;
@@ -434,7 +434,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
434
434
  gap: 32px;
435
435
  padding: 64px 24px;
436
436
  min-height: 42vh;
437
- `,oe=i.img`
437
+ `,se=i.img`
438
438
  width: 61px;
439
439
  height: 61px;
440
440
  animation: ${Qe} 1.2s ease-in-out infinite;
@@ -442,7 +442,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
442
442
  @media (prefers-reduced-motion: reduce) {
443
443
  animation: none;
444
444
  }
445
- `,Je=i(oe)`
445
+ `,Je=i(se)`
446
446
  width: 72px;
447
447
  height: 72px;
448
448
  `,et=i.div`
@@ -479,7 +479,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
479
479
  border-radius: ${e.radius.pill};
480
480
  background: ${e.colors.chip};
481
481
  overflow: hidden;
482
- `,st=i.span`
482
+ `,ot=i.span`
483
483
  position: absolute;
484
484
  top: 0;
485
485
  left: -40%;
@@ -494,7 +494,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
494
494
  width: 30%;
495
495
  animation: none;
496
496
  }
497
- `,ot=i.span`
497
+ `,st=i.span`
498
498
  font-family: ${e.font.sans};
499
499
  font-size: 16px;
500
500
  line-height: 22px;
@@ -577,7 +577,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
577
577
  top: 16px;
578
578
  transform: translateX(-50%);
579
579
  }
580
- `,gt=i.p`
580
+ `,ut=i.p`
581
581
  display: inline-flex;
582
582
  align-items: center;
583
583
  gap: 8px;
@@ -590,7 +590,7 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
590
590
  height: 30px;
591
591
  color: ${e.colors.text};
592
592
  }
593
- `,ut=i.strong`
593
+ `,gt=i.strong`
594
594
  font-size: 24px;
595
595
  font-weight: 700;
596
596
  text-transform: capitalize;
@@ -668,4 +668,4 @@ import{d as he,e as xe,r as l,j as t}from"./react-DehiWSvs.js";import{s as i,t a
668
668
  margin: 0;
669
669
  font-family: ${e.font.sans};
670
670
  color: ${e.colors.err};
671
- `,v=ve()?"mock":"stripe",ee=[P,P,ne,se],wt={pack_5:P,pack_10:P,pack_25:ne,pack_50:se};function ae(a,s){return wt[a.id]??ee[s%ee.length]}function yt(a,s){return a.artUrl??ae(a,s)}const kt="https://docs.decentraland.org";function te(a){const s=a;if((s==null?void 0:s.name)==="AbortError")return n("getCredits.errorCanceled");const f=((s==null?void 0:s.message)??"").toLowerCase();return f.includes("sign in")?n("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?n("getCredits.errorTimeout",{currency:p.name}):n("getCredits.errorGeneric")}function At(){var W;ge({title:n("nav.getCredits",{currency:p.name}),noindex:!0});const a=he(),{session:s,signIn:f}=ue(),o=fe(),[m,b]=xe(),{packs:$,isLoading:y}=we(),[x,h]=l.useState("select"),[c,F]=l.useState(null),[j,L]=l.useState(null),de=(j!=null?(W=$.find(r=>r.credits===j))==null?void 0:W.artUrl:void 0)??je,[ce,k]=l.useState(null),[le,_]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var r;return(r=R.current)==null?void 0:r.abort()},[]);const I=l.useCallback(()=>{b(r=>{const d=new URLSearchParams(r);return d.delete("order"),d.delete("canceled"),d},{replace:!0})},[b]),T=l.useCallback(async r=>{h("processing");const d=new AbortController;R.current=d;try{const g=await ye(r,{signal:d.signal,address:s==null?void 0:s.address,identity:s==null?void 0:s.identity});if(g.status==="credited"){const w=g.creditsGranted??(c==null?void 0:c.credits)??0;L(w>0?w:null),h("success"),u("Shop Completed Buy Credits",{order_id:r,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:v}),o.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ke)){const S={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:S});return}}catch{}try{const S=sessionStorage.getItem(K);if(S){sessionStorage.removeItem(K);const M=JSON.parse(S),G=me(M);if(G){a(G,{state:{item:M,resumeBuy:!0}});return}}}catch{}}else g.status==="pending"?(u("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),o.invalidateQueries({queryKey:["usd-balance"]}),h("pending")):(u("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),k(g.error??n("getCredits.errorGrant",{currency:p.name})),h("error"))}catch(g){N(g,{flow:"get_credits",step:"grant",order_id:r}),u("Shop Buy Credits Failed",{step:"grant",error_code:U(g),pack_usd:(c==null?void 0:c.usd)??null}),k(te(g)),h("error")}},[c,s,o,a]),pe=l.useCallback(async r=>{if(!s){f();return}k(null),_(!1),F(r),h(v==="mock"?"processing":"redirecting"),u("Shop Started Buy Credits",{pack_usd:r.usd,credits:r.credits,provider:v});try{const d=await Ce(r.id,{address:s.address,identity:s.identity});if(d.mock)T(d.orderId);else if(d.url)u("Shop Redirected To Stripe",{order_id:d.orderId,pack_usd:r.usd,credits:r.credits}),window.location.href=d.url;else throw new Error("Checkout did not return a redirect url")}catch(d){N(d,{flow:"get_credits",step:"checkout",provider:v}),u("Shop Buy Credits Failed",{step:"checkout",error_code:U(d),pack_usd:r.usd}),k(te(d)),h("error")}},[s,f,T]),A=l.useRef(!1);l.useEffect(()=>{if(A.current)return;const r=m.get("order");if(m.get("canceled")!=null){A.current=!0,u("Shop Buy Credits Cancelled",{order_id:r,provider:v}),r&&s&&be(r,s.identity),I(),_(!0),h("select");return}r&&(h("processing"),s&&(A.current=!0,I(),T(r)))},[m,s]);function z(){var r;(r=R.current)==null||r.abort(),h("select"),F(null),L(null),k(null),_(!1)}return t.jsxs(_e,{children:[(x==="select"||x==="redirecting")&&t.jsxs(Re,{"data-testid":"credits-hero",children:[t.jsx(Te,{"aria-hidden":!0}),t.jsxs(Ae,{$hidden:x==="redirecting",children:[t.jsxs(ze,{children:[t.jsx(Be,{children:n("getCredits.title",{currency:p.name})}),t.jsxs(Ee,{children:[t.jsx(Fe,{children:n("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Le,{href:kt,target:"_blank",rel:"noreferrer",children:[n("getCredits.learnMore"),t.jsx(ie,{name:"link-out"})]})]})]}),le&&t.jsx(Ie,{role:"status",children:n("getCredits.canceledNote")}),t.jsx(Ct,{packs:$,loading:y,onSelect:r=>void pe(r)})]}),x==="redirecting"&&t.jsxs(qe,{role:"status","aria-live":"polite",children:[t.jsx(Je,{src:D,alt:"",width:72,height:72}),t.jsx(Xe,{children:n("getCredits.redirecting")})]})]}),x==="processing"&&t.jsxs(Ze,{role:"status","aria-live":"polite",children:[t.jsx(oe,{src:D,alt:"",width:61,height:61}),t.jsxs(et,{children:[t.jsxs(tt,{children:[t.jsx("strong",{children:n("getCredits.processing")}),"…"]}),t.jsxs(it,{"aria-hidden":!0,children:[t.jsx(nt,{children:t.jsx(st,{})}),t.jsx(ot,{children:"1/1"})]})]})]}),x==="success"&&t.jsxs(at,{role:"status","aria-live":"polite",children:[t.jsxs(dt,{children:[t.jsx(ct,{src:Se,alt:"",width:60,height:60}),t.jsxs(lt,{children:[t.jsx("strong",{children:n("getCredits.successTitle")})," ",n("getCredits.successBody",{currency:p.name})]})]}),j!=null&&t.jsx(pt,{children:t.jsxs(ht,{children:[t.jsx(xt,{src:de,alt:"",width:93,height:93}),t.jsxs(gt,{children:[t.jsx(re,{}),t.jsxs("span",{children:[t.jsx(ut,{children:n("getCredits.creditsAmount",{credits:j,currency:p.name})})," ",t.jsx(ft,{children:n("getCredits.creditsAdded")})]})]})]})}),t.jsxs(mt,{children:[t.jsx(C,{"data-variant":"outline",onClick:z,children:n("getCredits.buyMore",{currency:p.name})}),t.jsx(C,{onClick:()=>a("/items"),children:n("getCredits.startShopping")})]})]}),x==="pending"&&t.jsxs(Q,{role:"status","aria-live":"polite",children:[t.jsx(Z,{children:n("getCredits.pendingTitle",{currency:p.name})}),t.jsx(Ve,{children:n("getCredits.pendingBody")}),t.jsxs(J,{children:[t.jsx(C,{onClick:()=>a("/items"),children:n("getCredits.startShopping")}),t.jsx(C,{"data-variant":"outline",onClick:z,children:n("getCredits.done")})]})]}),x==="error"&&t.jsxs(Q,{role:"alert",children:[t.jsx(Z,{"data-tone":"error",children:n("getCredits.errorTitle")}),t.jsx(bt,{children:ce}),t.jsx(J,{children:t.jsx(C,{onClick:z,children:n("getCredits.tryAgain")})})]})]})}function Ct({packs:a,loading:s,onSelect:f}){return s?t.jsx(Y,{"aria-busy":"true","aria-label":n("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(o=>t.jsxs(V,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(q,{children:[t.jsx(X,{children:t.jsx(Ke,{})}),t.jsx(Oe,{})]}),t.jsx(Ye,{})]},o))}):t.jsx(Y,{children:a.map((o,m)=>{const b=$e(o,a);return t.jsxs(V,{type:"button","data-testid":"pack","data-best":o.bestValue?"true":void 0,onClick:()=>f(o),"aria-label":b?n("getCredits.packAriaBonus",{amount:H(o.credits),usd:o.usd,bonus:b.bonus,baseline:b.baseline}):n("getCredits.packAria",{amount:H(o.credits),usd:o.usd}),children:[o.bestValue&&t.jsxs(We,{children:[t.jsx(ie,{name:"star-rounded"}),n("getCredits.packBadge")]}),t.jsxs(q,{children:[t.jsxs(X,{children:[t.jsxs(Me,{children:[t.jsx(re,{}),t.jsx(Ge,{children:o.credits})]}),t.jsx(Ne,{children:n("getCredits.packUnit",{currency:p.name})})]}),t.jsx(Ue,{children:t.jsx("img",{src:yt(o,m),alt:"",loading:"lazy",width:507,height:507,onError:$=>{const y=$.currentTarget;y.dataset.artFallback||(y.dataset.artFallback="done",y.src=ae(o,m))}})})]}),t.jsxs(De,{children:["$",o.usd.toFixed(2)]})]},o.id)})})}export{At as GetCredits,At as default};
671
+ `,v=ve()?"mock":"stripe",ee=[P,P,ne,oe],wt={pack_5:P,pack_10:P,pack_25:ne,pack_50:oe};function ae(a,o){return wt[a.id]??ee[o%ee.length]}function yt(a,o){return a.artUrl??ae(a,o)}const kt="https://docs.decentraland.org";function te(a){const o=a;if((o==null?void 0:o.name)==="AbortError")return n("getCredits.errorCanceled");const f=((o==null?void 0:o.message)??"").toLowerCase();return f.includes("sign in")?n("getCredits.errorSignIn",{currency:p.name}):f.includes("timed out")?n("getCredits.errorTimeout",{currency:p.name}):n("getCredits.errorGeneric")}function At(){var W;ue({title:n("nav.getCredits",{currency:p.name}),noindex:!0});const a=he(),{session:o,signIn:f}=ge(),s=fe(),[m,b]=xe(),{packs:$,isLoading:y}=we(),[x,h]=l.useState("select"),[c,F]=l.useState(null),[j,L]=l.useState(null),de=(j!=null?(W=$.find(r=>r.credits===j))==null?void 0:W.artUrl:void 0)??je,[ce,k]=l.useState(null),[le,_]=l.useState(!1),R=l.useRef(null);l.useEffect(()=>()=>{var r;return(r=R.current)==null?void 0:r.abort()},[]);const I=l.useCallback(()=>{b(r=>{const d=new URLSearchParams(r);return d.delete("order"),d.delete("canceled"),d},{replace:!0})},[b]),T=l.useCallback(async r=>{h("processing");const d=new AbortController;R.current=d;try{const u=await ye(r,{signal:d.signal,address:o==null?void 0:o.address,identity:o==null?void 0:o.identity});if(u.status==="credited"){const w=u.creditsGranted??(c==null?void 0:c.credits)??0;L(w>0?w:null),h("success"),g("Shop Completed Buy Credits",{order_id:r,pack_usd:(c==null?void 0:c.usd)??null,credits:w>0?w:null,provider:v}),s.invalidateQueries({queryKey:["usd-balance"]});try{if(sessionStorage.getItem(ke)){const S={resumeCheckout:!0,...w>0?{creditsAdded:w}:{}};a("/cart",{state:S});return}}catch{}try{const S=sessionStorage.getItem(H);if(S){sessionStorage.removeItem(H);const M=JSON.parse(S),N=me(M);if(N){a(N,{state:{item:M,resumeBuy:!0}});return}}}catch{}}else u.status==="pending"?(g("Shop Buy Credits Pending",{step:"grant",pack_usd:(c==null?void 0:c.usd)??null}),s.invalidateQueries({queryKey:["usd-balance"]}),h("pending")):(g("Shop Buy Credits Failed",{step:"grant",error_code:"grant_failed",pack_usd:(c==null?void 0:c.usd)??null}),k(u.error??n("getCredits.errorGrant",{currency:p.name})),h("error"))}catch(u){G(u,{flow:"get_credits",step:"grant",order_id:r}),g("Shop Buy Credits Failed",{step:"grant",error_code:U(u),pack_usd:(c==null?void 0:c.usd)??null}),k(te(u)),h("error")}},[c,o,s,a]),pe=l.useCallback(async r=>{if(!o){f();return}k(null),_(!1),F(r),h(v==="mock"?"processing":"redirecting"),g("Shop Started Buy Credits",{pack_usd:r.usd,credits:r.credits,provider:v});try{const d=await Ce(r.id,{address:o.address,identity:o.identity});if(d.mock)T(d.orderId);else if(d.url)g("Shop Redirected To Stripe",{order_id:d.orderId,pack_usd:r.usd,credits:r.credits}),window.location.href=d.url;else throw new Error("Checkout did not return a redirect url")}catch(d){G(d,{flow:"get_credits",step:"checkout",provider:v}),g("Shop Buy Credits Failed",{step:"checkout",error_code:U(d),pack_usd:r.usd}),k(te(d)),h("error")}},[o,f,T]),A=l.useRef(!1);l.useEffect(()=>{if(A.current)return;const r=m.get("order");if(m.get("canceled")!=null){A.current=!0,g("Shop Buy Credits Cancelled",{order_id:r,provider:v}),r&&o&&be(r,o.identity),I(),_(!0),h("select");return}r&&(h("processing"),o&&(A.current=!0,I(),T(r)))},[m,o]);function z(){var r;(r=R.current)==null||r.abort(),h("select"),F(null),L(null),k(null),_(!1)}return t.jsxs(_e,{children:[(x==="select"||x==="redirecting")&&t.jsxs(Re,{"data-testid":"credits-hero",children:[t.jsx(Te,{"aria-hidden":!0}),t.jsxs(Ae,{$hidden:x==="redirecting",children:[t.jsxs(ze,{children:[t.jsx(Be,{children:n("getCredits.title",{currency:p.name})}),t.jsxs(Ee,{children:[t.jsx(Fe,{children:n("getCredits.subtitle",{currency:p.nameSingular})}),t.jsxs(Le,{href:kt,target:"_blank",rel:"noreferrer",children:[n("getCredits.learnMore"),t.jsx(ie,{name:"link-out"})]})]})]}),le&&t.jsx(Ie,{role:"status",children:n("getCredits.canceledNote")}),t.jsx(Ct,{packs:$,loading:y,onSelect:r=>void pe(r)})]}),x==="redirecting"&&t.jsxs(qe,{role:"status","aria-live":"polite",children:[t.jsx(Je,{src:O,alt:"",width:72,height:72}),t.jsx(Xe,{children:n("getCredits.redirecting")})]})]}),x==="processing"&&t.jsxs(Ze,{role:"status","aria-live":"polite",children:[t.jsx(se,{src:O,alt:"",width:61,height:61}),t.jsxs(et,{children:[t.jsxs(tt,{children:[t.jsx("strong",{children:n("getCredits.processing")}),"…"]}),t.jsxs(it,{"aria-hidden":!0,children:[t.jsx(nt,{children:t.jsx(ot,{})}),t.jsx(st,{children:"1/1"})]})]})]}),x==="success"&&t.jsxs(at,{role:"status","aria-live":"polite",children:[t.jsxs(dt,{children:[t.jsx(ct,{src:Se,alt:"",width:60,height:60}),t.jsxs(lt,{children:[t.jsx("strong",{children:n("getCredits.successTitle")})," ",n("getCredits.successBody",{currency:p.name})]})]}),j!=null&&t.jsx(pt,{children:t.jsxs(ht,{children:[t.jsx(xt,{src:de,alt:"",width:93,height:93}),t.jsxs(ut,{children:[t.jsx(re,{}),t.jsxs("span",{children:[t.jsx(gt,{children:n("getCredits.creditsAmount",{credits:j,currency:p.name})})," ",t.jsx(ft,{children:n("getCredits.creditsAdded")})]})]})]})}),t.jsxs(mt,{children:[t.jsx(C,{"data-variant":"outline",onClick:z,children:n("getCredits.buyMore",{currency:p.name})}),t.jsx(C,{onClick:()=>a("/items"),children:n("getCredits.startShopping")})]})]}),x==="pending"&&t.jsxs(Q,{role:"status","aria-live":"polite",children:[t.jsx(Z,{children:n("getCredits.pendingTitle",{currency:p.name})}),t.jsx(Ve,{children:n("getCredits.pendingBody")}),t.jsxs(J,{children:[t.jsx(C,{onClick:()=>a("/items"),children:n("getCredits.startShopping")}),t.jsx(C,{"data-variant":"outline",onClick:z,children:n("getCredits.done")})]})]}),x==="error"&&t.jsxs(Q,{role:"alert",children:[t.jsx(Z,{"data-tone":"error",children:n("getCredits.errorTitle")}),t.jsx(bt,{children:ce}),t.jsx(J,{children:t.jsx(C,{onClick:z,children:n("getCredits.tryAgain")})})]})]})}function Ct({packs:a,loading:o,onSelect:f}){return o?t.jsx(Y,{"aria-busy":"true","aria-label":n("getCredits.packsLoading",{currency:p.name}),children:[0,1,2,3].map(s=>t.jsxs(V,{as:"div","data-skeleton":"true","data-testid":"pack-skeleton","aria-hidden":!0,children:[t.jsxs(q,{children:[t.jsx(X,{children:t.jsx(He,{})}),t.jsx(Ke,{})]}),t.jsx(Ye,{})]},s))}):t.jsx(Y,{children:a.map((s,m)=>{const b=$e(s,a);return t.jsxs(V,{type:"button","data-testid":"pack","data-best":s.bestValue?"true":void 0,onClick:()=>f(s),"aria-label":b?n("getCredits.packAriaBonus",{amount:D(s.credits),usd:s.usd,bonus:b.bonus,baseline:b.baseline}):n("getCredits.packAria",{amount:D(s.credits),usd:s.usd}),children:[s.bestValue&&t.jsxs(We,{children:[t.jsx(ie,{name:"star-rounded"}),n("getCredits.packBadge")]}),t.jsxs(q,{children:[t.jsxs(X,{children:[t.jsxs(Me,{children:[t.jsx(re,{}),t.jsx(Ne,{children:s.credits})]}),t.jsx(Ge,{children:n("getCredits.packUnit",{currency:p.name})})]}),t.jsx(Ue,{children:t.jsx("img",{src:yt(s,m),alt:"",loading:"lazy",width:507,height:507,onError:$=>{const y=$.currentTarget;y.dataset.artFallback||(y.dataset.artFallback="done",y.src=ae(s,m))}})})]}),t.jsxs(Oe,{children:["$",s.usd.toFixed(2)]})]},s.id)})})}export{At as GetCredits,At 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-r_ie-fYk.js";import{d as g,r as v}from"./index-D3b-6hLL.js";import{C as c}from"./ConstantsUtil-Di3dRDAF.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-8GeYldkk.js";import{au as y}from"./NetworkUtil-EoWQDMpU.js";const b=g`
1
+ import{i as f,b as h}from"./lit-element-B3y9oplH.js";import{n as m}from"./class-map-CxwNmq0D.js";import{c as p}from"./index-CKh-MxqM.js";import{d as g,r as v}from"./index-C_2RtD-k.js";import{C as c}from"./ConstantsUtil-Di3dRDAF.js";import{R as $,O as u}from"./W3MFrameProviderSingleton-DrpRVilu.js";import{au as y}from"./NetworkUtil-EoWQDMpU.js";const b=g`
2
2
  :host {
3
3
  display: flex;
4
4
  justify-content: center;