@dcl/landing-site 0.5.1-24685869120.commit-1de5712 → 0.5.1-24686484792.commit-e56f2bf

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 (182) hide show
  1. package/assets/{AnimatedBackground--tmRk4pB.js → AnimatedBackground-BbbuCmrW.js} +2 -2
  2. package/assets/{AnimatedBackground--tmRk4pB.js.map → AnimatedBackground-BbbuCmrW.js.map} +1 -1
  3. package/assets/{AnimatedSection-4VTaj_2R.js → AnimatedSection-CcAt5h6R.js} +1 -1
  4. package/assets/{AnimatedSection-4VTaj_2R.js.map → AnimatedSection-CcAt5h6R.js.map} +1 -1
  5. package/assets/{ArrowBackIosNew-BmStpKu0.js → ArrowBackIosNew-lqzUFZQL.js} +1 -1
  6. package/assets/{ArrowBackIosNew-BmStpKu0.js.map → ArrowBackIosNew-lqzUFZQL.js.map} +1 -1
  7. package/assets/{AuthorPage-DsEGDjQw.js → AuthorPage-4inFQH2X.js} +1 -1
  8. package/assets/{AuthorPage-DsEGDjQw.js.map → AuthorPage-4inFQH2X.js.map} +1 -1
  9. package/assets/{Badges-DFm-dJP0.js → Badges-DPcq_7dC.js} +1 -1
  10. package/assets/{Badges-DFm-dJP0.js.map → Badges-DPcq_7dC.js.map} +1 -1
  11. package/assets/{BlogLayout-CxiSrxYR.js → BlogLayout-Bl9FID_L.js} +1 -1
  12. package/assets/{BlogLayout-CxiSrxYR.js.map → BlogLayout-Bl9FID_L.js.map} +1 -1
  13. package/assets/{BlogPage-BrmWjpqW.js → BlogPage-4c8ZFzdw.js} +1 -1
  14. package/assets/{BlogPage-BrmWjpqW.js.map → BlogPage-4c8ZFzdw.js.map} +1 -1
  15. package/assets/{CTAButton-DiWefRTF.js → CTAButton-D8_9d6Wu.js} +1 -1
  16. package/assets/{CTAButton-DiWefRTF.js.map → CTAButton-D8_9d6Wu.js.map} +1 -1
  17. package/assets/{CardContent-BGQcwSBj.js → CardContent-BQ0iSa2p.js} +1 -1
  18. package/assets/{CardContent-BGQcwSBj.js.map → CardContent-BQ0iSa2p.js.map} +1 -1
  19. package/assets/{CardMedia-RFT7-c29.js → CardMedia-B6PneSTk.js} +1 -1
  20. package/assets/{CardMedia-RFT7-c29.js.map → CardMedia-B6PneSTk.js.map} +1 -1
  21. package/assets/{Carousel-pw-zJClB.js → Carousel-DJd7E-wq.js} +1 -1
  22. package/assets/{Carousel-pw-zJClB.js.map → Carousel-DJd7E-wq.js.map} +1 -1
  23. package/assets/{CategoryPage-ZdXQJP2n.js → CategoryPage-DNQI3nXz.js} +1 -1
  24. package/assets/{CategoryPage-ZdXQJP2n.js.map → CategoryPage-DNQI3nXz.js.map} +1 -1
  25. package/assets/{CircleAndArrow-DjRydx_v.js → CircleAndArrow-DIeWRbH9.js} +1 -1
  26. package/assets/{CircleAndArrow-DjRydx_v.js.map → CircleAndArrow-DIeWRbH9.js.map} +1 -1
  27. package/assets/{CircularProgress-CpGrVwOe.js → CircularProgress-AsNM1BvH.js} +1 -1
  28. package/assets/{CircularProgress-CpGrVwOe.js.map → CircularProgress-AsNM1BvH.js.map} +1 -1
  29. package/assets/{ContentCopy-Biu7mI_B.js → ContentCopy-CDhBZqHF.js} +1 -1
  30. package/assets/{ContentCopy-Biu7mI_B.js.map → ContentCopy-CDhBZqHF.js.map} +1 -1
  31. package/assets/{CreateEventPage-CSyGxQEM.js → CreateEventPage-NcQUT47j.js} +1 -1
  32. package/assets/{CreateEventPage-CSyGxQEM.js.map → CreateEventPage-NcQUT47j.js.map} +1 -1
  33. package/assets/{CreatorHubDownload-C0lTqfvy.js → CreatorHubDownload-y9x_B8ll.js} +1 -1
  34. package/assets/{CreatorHubDownload-C0lTqfvy.js.map → CreatorHubDownload-y9x_B8ll.js.map} +1 -1
  35. package/assets/{CreatorHubDownloadSuccess-OmyWSLJA.js → CreatorHubDownloadSuccess-BP7MSbSp.js} +1 -1
  36. package/assets/{CreatorHubDownloadSuccess-OmyWSLJA.js.map → CreatorHubDownloadSuccess-BP7MSbSp.js.map} +1 -1
  37. package/assets/{DappsShell-DNMjP5_u.js → DappsShell-HNAsXcn5.js} +1 -1
  38. package/assets/{DappsShell-DNMjP5_u.js.map → DappsShell-HNAsXcn5.js.map} +1 -1
  39. package/assets/{DownloadSuccessLayout-OfN-COoN.js → DownloadSuccessLayout-COBp7A1N.js} +1 -1
  40. package/assets/{DownloadSuccessLayout-OfN-COoN.js.map → DownloadSuccessLayout-COBp7A1N.js.map} +1 -1
  41. package/assets/{Grow-vvw5xHGO.js → Grow-eKASrvPe.js} +1 -1
  42. package/assets/{Grow-vvw5xHGO.js.map → Grow-eKASrvPe.js.map} +1 -1
  43. package/assets/HomePage-CZwkfB5G.js +3 -0
  44. package/assets/HomePage-CZwkfB5G.js.map +1 -0
  45. package/assets/{InviteFaqs-VtXtD9Y7.js → InviteFaqs-BkOvxqyN.js} +1 -1
  46. package/assets/{InviteFaqs-VtXtD9Y7.js.map → InviteFaqs-BkOvxqyN.js.map} +1 -1
  47. package/assets/{InvitePage-B2ILV0JT.js → InvitePage-D5lELZNP.js} +2 -2
  48. package/assets/{InvitePage-B2ILV0JT.js.map → InvitePage-D5lELZNP.js.map} +1 -1
  49. package/assets/{JumpInIcon-DQLZFf5_.js → JumpInIcon-bPOWl5ae.js} +1 -1
  50. package/assets/{JumpInIcon-DQLZFf5_.js.map → JumpInIcon-bPOWl5ae.js.map} +1 -1
  51. package/assets/{LegalPageLayout-BPmxsGkt.js → LegalPageLayout-DeH35WpT.js} +1 -1
  52. package/assets/{LegalPageLayout-BPmxsGkt.js.map → LegalPageLayout-DeH35WpT.js.map} +1 -1
  53. package/assets/{Link-CRy-ui2j.js → Link-C3GGl2C6.js} +1 -1
  54. package/assets/{Link-CRy-ui2j.js.map → Link-C3GGl2C6.js.map} +1 -1
  55. package/assets/{MenuItem--w_lFNXz.js → MenuItem-B0piwgTa.js} +1 -1
  56. package/assets/{MenuItem--w_lFNXz.js.map → MenuItem-B0piwgTa.js.map} +1 -1
  57. package/assets/{Paper-DkTuC9MF.js → Paper-BfSYUoim.js} +1 -1
  58. package/assets/{Paper-DkTuC9MF.js.map → Paper-BfSYUoim.js.map} +1 -1
  59. package/assets/{PostCard-CoBBQR_z.js → PostCard-Zsk0_WYz.js} +1 -1
  60. package/assets/{PostCard-CoBBQR_z.js.map → PostCard-Zsk0_WYz.js.map} +1 -1
  61. package/assets/{PostPage-DTs37H2-.js → PostPage-FBb63V37.js} +1 -1
  62. package/assets/{PostPage-DTs37H2-.js.map → PostPage-FBb63V37.js.map} +1 -1
  63. package/assets/{PostPage.styled-DLL8lMAH.js → PostPage.styled-B7Xofl3c.js} +3 -3
  64. package/assets/{PostPage.styled-DLL8lMAH.js.map → PostPage.styled-B7Xofl3c.js.map} +1 -1
  65. package/assets/{PreviewPage-CM24MWpu.js → PreviewPage-Dla6vQZW.js} +1 -1
  66. package/assets/{PreviewPage-CM24MWpu.js.map → PreviewPage-Dla6vQZW.js.map} +1 -1
  67. package/assets/{SEO-B1CZcHhQ.js → SEO-CGGKu_zm.js} +1 -1
  68. package/assets/{SEO-B1CZcHhQ.js.map → SEO-CGGKu_zm.js.map} +1 -1
  69. package/assets/{SearchPage-Bc-IQg_Z.js → SearchPage-ByMcz1c8.js} +1 -1
  70. package/assets/{SearchPage-Bc-IQg_Z.js.map → SearchPage-ByMcz1c8.js.map} +1 -1
  71. package/assets/{SignInRedirect-CytWMFc_.js → SignInRedirect-BNwfxyGB.js} +1 -1
  72. package/assets/{SignInRedirect-CytWMFc_.js.map → SignInRedirect-BNwfxyGB.js.map} +1 -1
  73. package/assets/{SignInRedirect-CHd5tZSP.js → SignInRedirect-Bxl1dwag.js} +1 -1
  74. package/assets/{SignInRedirect-CHd5tZSP.js.map → SignInRedirect-Bxl1dwag.js.map} +1 -1
  75. package/assets/{Skeleton-Bp_3tZG7.js → Skeleton-BP1Os8gY.js} +1 -1
  76. package/assets/{Skeleton-Bp_3tZG7.js.map → Skeleton-BP1Os8gY.js.map} +1 -1
  77. package/assets/{TwitterEmbed-qGRZ9Jyy.js → TwitterEmbed-BbSYYog-.js} +1 -1
  78. package/assets/{TwitterEmbed-qGRZ9Jyy.js.map → TwitterEmbed-BbSYYog-.js.map} +1 -1
  79. package/assets/{Video-DnCE7TZC.js → Video--A0fBGqz.js} +1 -1
  80. package/assets/{Video-DnCE7TZC.js.map → Video--A0fBGqz.js.map} +1 -1
  81. package/assets/WearablePreview-KunRQByO.js +4 -0
  82. package/assets/{WearablePreview-DLAIz58Z.js.map → WearablePreview-KunRQByO.js.map} +1 -1
  83. package/assets/{auto-track-DyJFTD4H.js → auto-track-DJw7KsLA.js} +1 -1
  84. package/assets/{auto-track-DyJFTD4H.js.map → auto-track-DJw7KsLA.js.map} +1 -1
  85. package/assets/{ccip-Dh2ZOi0c.js → ccip-EHA4QwVS.js} +1 -1
  86. package/assets/{ccip-Dh2ZOi0c.js.map → ccip-EHA4QwVS.js.map} +1 -1
  87. package/assets/{createSvgIcon-DPMfLii4.js → createSvgIcon-CnAtXIjx.js} +1 -1
  88. package/assets/{createSvgIcon-DPMfLii4.js.map → createSvgIcon-CnAtXIjx.js.map} +1 -1
  89. package/assets/{download-30qm_WAk.js → download-Csh0UAX4.js} +2 -2
  90. package/assets/{download-30qm_WAk.js.map → download-Csh0UAX4.js.map} +1 -1
  91. package/assets/{downloadWithIdentity-BtEnlEpV.js → downloadWithIdentity-imzC-1Iy.js} +1 -1
  92. package/assets/{downloadWithIdentity-BtEnlEpV.js.map → downloadWithIdentity-imzC-1Iy.js.map} +1 -1
  93. package/assets/{events.client-Cm_vJXoK.js → events.client-BypQp_hx.js} +1 -1
  94. package/assets/{events.client-Cm_vJXoK.js.map → events.client-BypQp_hx.js.map} +1 -1
  95. package/assets/{index-DphyojdM.js → index-0VgKmd34.js} +1 -1
  96. package/assets/{index-DphyojdM.js.map → index-0VgKmd34.js.map} +1 -1
  97. package/assets/{index-CnliSg2U.js → index-B-PLjKpI.js} +1 -1
  98. package/assets/{index-CnliSg2U.js.map → index-B-PLjKpI.js.map} +1 -1
  99. package/assets/{index-3Yl6UR--.js → index-BKY10VNY.js} +1 -1
  100. package/assets/{index-3Yl6UR--.js.map → index-BKY10VNY.js.map} +1 -1
  101. package/assets/{index-CcVwIken.js → index-BO6ciUn8.js} +1 -1
  102. package/assets/{index-CcVwIken.js.map → index-BO6ciUn8.js.map} +1 -1
  103. package/assets/{index-C1q8L88E.js → index-BVu5N7d0.js} +1 -1
  104. package/assets/{index-C1q8L88E.js.map → index-BVu5N7d0.js.map} +1 -1
  105. package/assets/{index-BxZNYwr3.js → index-BaEE4ZXP.js} +1 -1
  106. package/assets/{index-BxZNYwr3.js.map → index-BaEE4ZXP.js.map} +1 -1
  107. package/assets/{index-C7VbadJ8.js → index-Bd63106P.js} +1 -1
  108. package/assets/{index-C7VbadJ8.js.map → index-Bd63106P.js.map} +1 -1
  109. package/assets/{index-SmcmwtEm.js → index-Bfn0rTR9.js} +1 -1
  110. package/assets/{index-SmcmwtEm.js.map → index-Bfn0rTR9.js.map} +1 -1
  111. package/assets/{index-BMggQVV_.js → index-Bq7PojkE.js} +1 -1
  112. package/assets/{index-BMggQVV_.js.map → index-Bq7PojkE.js.map} +1 -1
  113. package/assets/{index-BgUWva8u.js → index-BtL1Whr6.js} +1 -1
  114. package/assets/{index-BgUWva8u.js.map → index-BtL1Whr6.js.map} +1 -1
  115. package/assets/{index-XqSXzv-4.js → index-BzmWmDt2.js} +1 -1
  116. package/assets/{index-XqSXzv-4.js.map → index-BzmWmDt2.js.map} +1 -1
  117. package/assets/{index-Dgp9VKxh.js → index-C1apFG92.js} +1 -1
  118. package/assets/{index-Dgp9VKxh.js.map → index-C1apFG92.js.map} +1 -1
  119. package/assets/{index-CAq1HW41.js → index-CC8b5SLA.js} +1 -1
  120. package/assets/{index-CAq1HW41.js.map → index-CC8b5SLA.js.map} +1 -1
  121. package/assets/{index-D6BepkG_.js → index-CJ9b6HdV.js} +1 -1
  122. package/assets/{index-D6BepkG_.js.map → index-CJ9b6HdV.js.map} +1 -1
  123. package/assets/{index--KeAUoz4.js → index-CXMTgMUj.js} +1 -1
  124. package/assets/{index--KeAUoz4.js.map → index-CXMTgMUj.js.map} +1 -1
  125. package/assets/{index-C62RHb__.js → index-CfKiEnnb.js} +1 -1
  126. package/assets/{index-C62RHb__.js.map → index-CfKiEnnb.js.map} +1 -1
  127. package/assets/{index-vUzwsML4.js → index-CqU_IKja.js} +1 -1
  128. package/assets/{index-vUzwsML4.js.map → index-CqU_IKja.js.map} +1 -1
  129. package/assets/{index-DchvHHlK.js → index-CsY_wahP.js} +1 -1
  130. package/assets/{index-DchvHHlK.js.map → index-CsY_wahP.js.map} +1 -1
  131. package/assets/{index-B6K794Rf.js → index-DIU7xr_7.js} +1 -1
  132. package/assets/{index-B6K794Rf.js.map → index-DIU7xr_7.js.map} +1 -1
  133. package/assets/{index-BY3JByxP.js → index-DJdpP3iF.js} +1 -1
  134. package/assets/{index-BY3JByxP.js.map → index-DJdpP3iF.js.map} +1 -1
  135. package/assets/{index-D0nE3AYE.js → index-DUmIu2EK.js} +37 -37
  136. package/assets/index-DUmIu2EK.js.map +1 -0
  137. package/assets/{index-C8cR2Ojr.js → index-DV8UooZK.js} +1 -1
  138. package/assets/{index-C8cR2Ojr.js.map → index-DV8UooZK.js.map} +1 -1
  139. package/assets/{index-DLkc1FLr.js → index-DW87VeBc.js} +1 -1
  140. package/assets/{index-DLkc1FLr.js.map → index-DW87VeBc.js.map} +1 -1
  141. package/assets/{index-BrT6YuSM.js → index-DwKCx_Fj.js} +4 -4
  142. package/assets/{index-BrT6YuSM.js.map → index-DwKCx_Fj.js.map} +1 -1
  143. package/assets/{index-C_4lnhwn.js → index-Dx9lzInm.js} +1 -1
  144. package/assets/{index-C_4lnhwn.js.map → index-Dx9lzInm.js.map} +1 -1
  145. package/assets/{index-DsMEKak1.js → index-FcfsIuei.js} +1 -1
  146. package/assets/{index-DsMEKak1.js.map → index-FcfsIuei.js.map} +1 -1
  147. package/assets/{index-tdgsZ4Yr.js → index-Hs2OtJ7_.js} +1 -1
  148. package/assets/{index-tdgsZ4Yr.js.map → index-Hs2OtJ7_.js.map} +1 -1
  149. package/assets/{index-CALzixlI.js → index-KkMZZ6nz.js} +1 -1
  150. package/assets/{index-CALzixlI.js.map → index-KkMZZ6nz.js.map} +1 -1
  151. package/assets/{index-CTcKnQdc.js → index-XwRFjo-F.js} +3 -3
  152. package/assets/{index-CTcKnQdc.js.map → index-XwRFjo-F.js.map} +1 -1
  153. package/assets/{index-Fbn9W4zr.js → index-fmnLygLZ.js} +1 -1
  154. package/assets/{index-Fbn9W4zr.js.map → index-fmnLygLZ.js.map} +1 -1
  155. package/assets/{index-DklThyvZ.js → index-iTL2dY0l.js} +1 -1
  156. package/assets/{index-DklThyvZ.js.map → index-iTL2dY0l.js.map} +1 -1
  157. package/assets/{index-cnaXlDby.js → index-pguZ7Pr7.js} +2 -2
  158. package/assets/{index-cnaXlDby.js.map → index-pguZ7Pr7.js.map} +1 -1
  159. package/assets/{profile.client-DJkJAVO7.js → profile.client-BtZZbgxj.js} +1 -1
  160. package/assets/{profile.client-DJkJAVO7.js.map → profile.client-BtZZbgxj.js.map} +1 -1
  161. package/assets/{shared.styled-CdKr8-z1.js → shared.styled-D8qloAmp.js} +1 -1
  162. package/assets/{shared.styled-CdKr8-z1.js.map → shared.styled-D8qloAmp.js.map} +1 -1
  163. package/assets/{store-B-SZNpsH.js → store-OyTPwmKI.js} +1 -1
  164. package/assets/{store-B-SZNpsH.js.map → store-OyTPwmKI.js.map} +1 -1
  165. package/assets/{url-B6S3bwqB.js → url-BHzlJYXC.js} +1 -1
  166. package/assets/{url-B6S3bwqB.js.map → url-BHzlJYXC.js.map} +1 -1
  167. package/assets/{useAuthIdentity-BlDTBxRE.js → useAuthIdentity-D2zQ3q5X.js} +1 -1
  168. package/assets/{useAuthIdentity-BlDTBxRE.js.map → useAuthIdentity-D2zQ3q5X.js.map} +1 -1
  169. package/assets/{useCreatorHubDownload-TIbrehIm.js → useCreatorHubDownload-Dp_zMaiv.js} +1 -1
  170. package/assets/{useCreatorHubDownload-TIbrehIm.js.map → useCreatorHubDownload-Dp_zMaiv.js.map} +1 -1
  171. package/assets/{useInfiniteBlogPosts-DKtXiohd.js → useInfiniteBlogPosts-B9Mv_Fup.js} +1 -1
  172. package/assets/{useInfiniteBlogPosts-DKtXiohd.js.map → useInfiniteBlogPosts-B9Mv_Fup.js.map} +1 -1
  173. package/assets/{useSlot-B74_4mYS.js → useSlot-DM_UQPu8.js} +1 -1
  174. package/assets/{useSlot-B74_4mYS.js.map → useSlot-DM_UQPu8.js.map} +1 -1
  175. package/assets/{utils-B-HvTNW5.js → utils-CJGePSnj.js} +1 -1
  176. package/assets/{utils-B-HvTNW5.js.map → utils-CJGePSnj.js.map} +1 -1
  177. package/index.html +15 -15
  178. package/package.json +3 -3
  179. package/assets/HomePage-9QTR-dt7.js +0 -3
  180. package/assets/HomePage-9QTR-dt7.js.map +0 -1
  181. package/assets/WearablePreview-DLAIz58Z.js +0 -4
  182. package/assets/index-D0nE3AYE.js.map +0 -1
@@ -1 +1 @@
1
- import{r as a}from"./vendor-router-D_36sTKu.js";import{g as f}from"./index-D0nE3AYE.js";const d={data:null,loaded:!1,fetching:null},g={data:null,isLoading:!1},u=new Map,i=new Map,o=new Map;function p(t){return{data:t.data,isLoading:!t.loaded}}function h(t){o.get(t)?.forEach(e=>e())}function r(t,e){u.set(t,e),i.set(t,p(e)),h(t)}async function E(t){try{const e=f("PEER_URL");return await(await fetch(`${e}/lambdas/profiles/${t.toLowerCase()}`)).json()??null}catch{return null}}function w(t){const e=u.get(t)??d;if(e.loaded||e.fetching)return e.fetching??Promise.resolve();const n=(async()=>{try{const s=await E(t);r(t,{data:s,loaded:!0,fetching:null})}catch{r(t,{data:null,loaded:!0,fetching:null})}})();return r(t,{...e,fetching:n}),n}function b(t,e){let n=o.get(t);return n||(n=new Set,o.set(t,n)),n.add(e),w(t),()=>{n.delete(e),n.size===0&&o.delete(t)}}function m(t){const e=i.get(t);if(e)return e;const n={data:null,isLoading:!0};return i.set(t,n),n}function L(t,e={}){const n=e.skip||!t?"":t.toLowerCase(),s=a.useCallback(l=>n?b(n,l):()=>{},[n]),c=a.useCallback(()=>n?m(n):g,[n]);return a.useSyncExternalStore(s,c,c)}export{L as u};
1
+ import{r as a}from"./vendor-router-D_36sTKu.js";import{g as f}from"./index-DUmIu2EK.js";const d={data:null,loaded:!1,fetching:null},g={data:null,isLoading:!1},u=new Map,i=new Map,o=new Map;function p(t){return{data:t.data,isLoading:!t.loaded}}function h(t){o.get(t)?.forEach(e=>e())}function r(t,e){u.set(t,e),i.set(t,p(e)),h(t)}async function E(t){try{const e=f("PEER_URL");return await(await fetch(`${e}/lambdas/profiles/${t.toLowerCase()}`)).json()??null}catch{return null}}function w(t){const e=u.get(t)??d;if(e.loaded||e.fetching)return e.fetching??Promise.resolve();const n=(async()=>{try{const s=await E(t);r(t,{data:s,loaded:!0,fetching:null})}catch{r(t,{data:null,loaded:!0,fetching:null})}})();return r(t,{...e,fetching:n}),n}function b(t,e){let n=o.get(t);return n||(n=new Set,o.set(t,n)),n.add(e),w(t),()=>{n.delete(e),n.size===0&&o.delete(t)}}function m(t){const e=i.get(t);if(e)return e;const n={data:null,isLoading:!0};return i.set(t,n),n}function L(t,e={}){const n=e.skip||!t?"":t.toLowerCase(),s=a.useCallback(l=>n?b(n,l):()=>{},[n]),c=a.useCallback(()=>n?m(n):g,[n]);return a.useSyncExternalStore(s,c,c)}export{L as u};
@@ -1 +1 @@
1
- {"version":3,"file":"profile.client-DJkJAVO7.js","sources":["../../src/features/profile/profile.client.ts"],"sourcesContent":["import { useCallback, useSyncExternalStore } from 'react'\nimport type { Profile } from 'dcl-catalyst-client/dist/client/specs/lambdas-client'\nimport { getEnv } from '../../config/env'\n\ntype Entry = {\n data: Profile | null\n loaded: boolean\n fetching: Promise<void> | null\n}\n\ntype Snapshot = { data: Profile | null; isLoading: boolean }\n\nconst EMPTY_ENTRY: Entry = { data: null, loaded: false, fetching: null }\nconst EMPTY_SNAPSHOT: Snapshot = { data: null, isLoading: false }\n\nconst entries = new Map<string, Entry>()\nconst snapshots = new Map<string, Snapshot>()\nconst listenersByKey = new Map<string, Set<() => void>>()\n\nfunction snapshotOf(entry: Entry): Snapshot {\n return { data: entry.data, isLoading: !entry.loaded }\n}\n\nfunction notify(key: string) {\n listenersByKey.get(key)?.forEach(fn => fn())\n}\n\nfunction setEntry(key: string, next: Entry) {\n entries.set(key, next)\n snapshots.set(key, snapshotOf(next))\n notify(key)\n}\n\nasync function fetchProfile(address: string): Promise<Profile | null> {\n try {\n const peerUrl = getEnv('PEER_URL')\n const response = await fetch(`${peerUrl}/lambdas/profiles/${address.toLowerCase()}`)\n const data = await response.json()\n return data ?? null\n } catch {\n return null\n }\n}\n\nfunction ensureFetch(key: string): Promise<void> {\n const existing = entries.get(key) ?? EMPTY_ENTRY\n if (existing.loaded || existing.fetching) return existing.fetching ?? Promise.resolve()\n\n const promise = (async () => {\n try {\n const data = await fetchProfile(key)\n setEntry(key, { data, loaded: true, fetching: null })\n } catch {\n setEntry(key, { data: null, loaded: true, fetching: null })\n }\n })()\n\n setEntry(key, { ...existing, fetching: promise })\n return promise\n}\n\nfunction subscribeTo(key: string, listener: () => void): () => void {\n let set = listenersByKey.get(key)\n if (!set) {\n set = new Set()\n listenersByKey.set(key, set)\n }\n set.add(listener)\n void ensureFetch(key)\n return () => {\n set.delete(listener)\n if (set.size === 0) listenersByKey.delete(key)\n }\n}\n\nfunction getSnapshotFor(key: string): Snapshot {\n const snap = snapshots.get(key)\n if (snap) return snap\n // Seed a stable pending snapshot so useSyncExternalStore doesn't loop.\n const pending: Snapshot = { data: null, isLoading: true }\n snapshots.set(key, pending)\n return pending\n}\n\ntype QueryOptions = { skip?: boolean }\n\nfunction useGetProfileQuery(address: string | undefined, options: QueryOptions = {}): Snapshot {\n const key = options.skip || !address ? '' : address.toLowerCase()\n\n const subscribe = useCallback(\n (listener: () => void) => {\n if (!key) return () => undefined\n return subscribeTo(key, listener)\n },\n [key]\n )\n\n const getSnapshot = useCallback(() => {\n if (!key) return EMPTY_SNAPSHOT\n return getSnapshotFor(key)\n }, [key])\n\n return useSyncExternalStore(subscribe, getSnapshot, getSnapshot)\n}\n\nexport { useGetProfileQuery, type Profile }\n"],"names":["EMPTY_ENTRY","EMPTY_SNAPSHOT","entries","snapshots","listenersByKey","snapshotOf","entry","notify","key","fn","setEntry","next","fetchProfile","address","peerUrl","getEnv","ensureFetch","existing","promise","data","subscribeTo","listener","set","getSnapshotFor","snap","pending","useGetProfileQuery","options","subscribe","useCallback","getSnapshot","useSyncExternalStore"],"mappings":"wFAYA,MAAMA,EAAqB,CAAE,KAAM,KAAM,OAAQ,GAAO,SAAU,IAAA,EAC5DC,EAA2B,CAAE,KAAM,KAAM,UAAW,EAAA,EAEpDC,MAAc,IACdC,MAAgB,IAChBC,MAAqB,IAE3B,SAASC,EAAWC,EAAwB,CAC1C,MAAO,CAAE,KAAMA,EAAM,KAAM,UAAW,CAACA,EAAM,MAAA,CAC/C,CAEA,SAASC,EAAOC,EAAa,CAC3BJ,EAAe,IAAII,CAAG,GAAG,QAAQC,GAAMA,GAAI,CAC7C,CAEA,SAASC,EAASF,EAAaG,EAAa,CAC1CT,EAAQ,IAAIM,EAAKG,CAAI,EACrBR,EAAU,IAAIK,EAAKH,EAAWM,CAAI,CAAC,EACnCJ,EAAOC,CAAG,CACZ,CAEA,eAAeI,EAAaC,EAA0C,CACpE,GAAI,CACF,MAAMC,EAAUC,EAAO,UAAU,EAGjC,OADa,MADI,MAAM,MAAM,GAAGD,CAAO,qBAAqBD,EAAQ,YAAA,CAAa,EAAE,GACvD,KAAA,GACb,IACjB,MAAQ,CACN,OAAO,IACT,CACF,CAEA,SAASG,EAAYR,EAA4B,CAC/C,MAAMS,EAAWf,EAAQ,IAAIM,CAAG,GAAKR,EACrC,GAAIiB,EAAS,QAAUA,EAAS,gBAAiBA,EAAS,UAAY,QAAQ,QAAA,EAE9E,MAAMC,GAAW,SAAY,CAC3B,GAAI,CACF,MAAMC,EAAO,MAAMP,EAAaJ,CAAG,EACnCE,EAASF,EAAK,CAAE,KAAAW,EAAM,OAAQ,GAAM,SAAU,KAAM,CACtD,MAAQ,CACNT,EAASF,EAAK,CAAE,KAAM,KAAM,OAAQ,GAAM,SAAU,KAAM,CAC5D,CACF,GAAA,EAEA,OAAAE,EAASF,EAAK,CAAE,GAAGS,EAAU,SAAUC,EAAS,EACzCA,CACT,CAEA,SAASE,EAAYZ,EAAaa,EAAkC,CAClE,IAAIC,EAAMlB,EAAe,IAAII,CAAG,EAChC,OAAKc,IACHA,MAAU,IACVlB,EAAe,IAAII,EAAKc,CAAG,GAE7BA,EAAI,IAAID,CAAQ,EACXL,EAAYR,CAAG,EACb,IAAM,CACXc,EAAI,OAAOD,CAAQ,EACfC,EAAI,OAAS,GAAGlB,EAAe,OAAOI,CAAG,CAC/C,CACF,CAEA,SAASe,EAAef,EAAuB,CAC7C,MAAMgB,EAAOrB,EAAU,IAAIK,CAAG,EAC9B,GAAIgB,EAAM,OAAOA,EAEjB,MAAMC,EAAoB,CAAE,KAAM,KAAM,UAAW,EAAA,EACnD,OAAAtB,EAAU,IAAIK,EAAKiB,CAAO,EACnBA,CACT,CAIA,SAASC,EAAmBb,EAA6Bc,EAAwB,GAAc,CAC7F,MAAMnB,EAAMmB,EAAQ,MAAQ,CAACd,EAAU,GAAKA,EAAQ,YAAA,EAE9Ce,EAAYC,EAAAA,YACfR,GACMb,EACEY,EAAYZ,EAAKa,CAAQ,EADf,OAGnB,CAACb,CAAG,CAAA,EAGAsB,EAAcD,EAAAA,YAAY,IACzBrB,EACEe,EAAef,CAAG,EADRP,EAEhB,CAACO,CAAG,CAAC,EAER,OAAOuB,uBAAqBH,EAAWE,EAAaA,CAAW,CACjE"}
1
+ {"version":3,"file":"profile.client-BtZZbgxj.js","sources":["../../src/features/profile/profile.client.ts"],"sourcesContent":["import { useCallback, useSyncExternalStore } from 'react'\nimport type { Profile } from 'dcl-catalyst-client/dist/client/specs/lambdas-client'\nimport { getEnv } from '../../config/env'\n\ntype Entry = {\n data: Profile | null\n loaded: boolean\n fetching: Promise<void> | null\n}\n\ntype Snapshot = { data: Profile | null; isLoading: boolean }\n\nconst EMPTY_ENTRY: Entry = { data: null, loaded: false, fetching: null }\nconst EMPTY_SNAPSHOT: Snapshot = { data: null, isLoading: false }\n\nconst entries = new Map<string, Entry>()\nconst snapshots = new Map<string, Snapshot>()\nconst listenersByKey = new Map<string, Set<() => void>>()\n\nfunction snapshotOf(entry: Entry): Snapshot {\n return { data: entry.data, isLoading: !entry.loaded }\n}\n\nfunction notify(key: string) {\n listenersByKey.get(key)?.forEach(fn => fn())\n}\n\nfunction setEntry(key: string, next: Entry) {\n entries.set(key, next)\n snapshots.set(key, snapshotOf(next))\n notify(key)\n}\n\nasync function fetchProfile(address: string): Promise<Profile | null> {\n try {\n const peerUrl = getEnv('PEER_URL')\n const response = await fetch(`${peerUrl}/lambdas/profiles/${address.toLowerCase()}`)\n const data = await response.json()\n return data ?? null\n } catch {\n return null\n }\n}\n\nfunction ensureFetch(key: string): Promise<void> {\n const existing = entries.get(key) ?? EMPTY_ENTRY\n if (existing.loaded || existing.fetching) return existing.fetching ?? Promise.resolve()\n\n const promise = (async () => {\n try {\n const data = await fetchProfile(key)\n setEntry(key, { data, loaded: true, fetching: null })\n } catch {\n setEntry(key, { data: null, loaded: true, fetching: null })\n }\n })()\n\n setEntry(key, { ...existing, fetching: promise })\n return promise\n}\n\nfunction subscribeTo(key: string, listener: () => void): () => void {\n let set = listenersByKey.get(key)\n if (!set) {\n set = new Set()\n listenersByKey.set(key, set)\n }\n set.add(listener)\n void ensureFetch(key)\n return () => {\n set.delete(listener)\n if (set.size === 0) listenersByKey.delete(key)\n }\n}\n\nfunction getSnapshotFor(key: string): Snapshot {\n const snap = snapshots.get(key)\n if (snap) return snap\n // Seed a stable pending snapshot so useSyncExternalStore doesn't loop.\n const pending: Snapshot = { data: null, isLoading: true }\n snapshots.set(key, pending)\n return pending\n}\n\ntype QueryOptions = { skip?: boolean }\n\nfunction useGetProfileQuery(address: string | undefined, options: QueryOptions = {}): Snapshot {\n const key = options.skip || !address ? '' : address.toLowerCase()\n\n const subscribe = useCallback(\n (listener: () => void) => {\n if (!key) return () => undefined\n return subscribeTo(key, listener)\n },\n [key]\n )\n\n const getSnapshot = useCallback(() => {\n if (!key) return EMPTY_SNAPSHOT\n return getSnapshotFor(key)\n }, [key])\n\n return useSyncExternalStore(subscribe, getSnapshot, getSnapshot)\n}\n\nexport { useGetProfileQuery, type Profile }\n"],"names":["EMPTY_ENTRY","EMPTY_SNAPSHOT","entries","snapshots","listenersByKey","snapshotOf","entry","notify","key","fn","setEntry","next","fetchProfile","address","peerUrl","getEnv","ensureFetch","existing","promise","data","subscribeTo","listener","set","getSnapshotFor","snap","pending","useGetProfileQuery","options","subscribe","useCallback","getSnapshot","useSyncExternalStore"],"mappings":"wFAYA,MAAMA,EAAqB,CAAE,KAAM,KAAM,OAAQ,GAAO,SAAU,IAAA,EAC5DC,EAA2B,CAAE,KAAM,KAAM,UAAW,EAAA,EAEpDC,MAAc,IACdC,MAAgB,IAChBC,MAAqB,IAE3B,SAASC,EAAWC,EAAwB,CAC1C,MAAO,CAAE,KAAMA,EAAM,KAAM,UAAW,CAACA,EAAM,MAAA,CAC/C,CAEA,SAASC,EAAOC,EAAa,CAC3BJ,EAAe,IAAII,CAAG,GAAG,QAAQC,GAAMA,GAAI,CAC7C,CAEA,SAASC,EAASF,EAAaG,EAAa,CAC1CT,EAAQ,IAAIM,EAAKG,CAAI,EACrBR,EAAU,IAAIK,EAAKH,EAAWM,CAAI,CAAC,EACnCJ,EAAOC,CAAG,CACZ,CAEA,eAAeI,EAAaC,EAA0C,CACpE,GAAI,CACF,MAAMC,EAAUC,EAAO,UAAU,EAGjC,OADa,MADI,MAAM,MAAM,GAAGD,CAAO,qBAAqBD,EAAQ,YAAA,CAAa,EAAE,GACvD,KAAA,GACb,IAC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EhB,CAACO,CAAG,CAAC,EAER,OAAOuB,uBAAqBH,EAAWE,EAAaA,CAAW,CACjE"}
@@ -1 +1 @@
1
- import{s as t,a}from"./index-D0nE3AYE.js";const s=t(a)(({theme:o})=>({textAlign:"center",paddingTop:o.spacing(8),paddingBottom:o.spacing(8)}));export{s as C};
1
+ import{s as t,a}from"./index-DUmIu2EK.js";const s=t(a)(({theme:o})=>({textAlign:"center",paddingTop:o.spacing(8),paddingBottom:o.spacing(8)}));export{s as C};
@@ -1 +1 @@
1
- {"version":3,"file":"shared.styled-CdKr8-z1.js","sources":["../../src/pages/blog/shared.styled.ts"],"sourcesContent":["import { Box, styled } from 'decentraland-ui2'\n\nconst CenteredBox = styled(Box)(({ theme }) => ({\n textAlign: 'center',\n paddingTop: theme.spacing(8),\n paddingBottom: theme.spacing(8)\n}))\n\nexport { CenteredBox }\n"],"names":["CenteredBox","styled","Box","theme"],"mappings":"0CAEA,MAAMA,EAAcC,EAAOC,CAAG,EAAE,CAAC,CAAE,MAAAC,MAAa,CAC9C,UAAW,SACX,WAAYA,EAAM,QAAQ,CAAC,EAC3B,cAAeA,EAAM,QAAQ,CAAC,CAChC,EAAE"}
1
+ {"version":3,"file":"shared.styled-D8qloAmp.js","sources":["../../src/pages/blog/shared.styled.ts"],"sourcesContent":["import { Box, styled } from 'decentraland-ui2'\n\nconst CenteredBox = styled(Box)(({ theme }) => ({\n textAlign: 'center',\n paddingTop: theme.spacing(8),\n paddingBottom: theme.spacing(8)\n}))\n\nexport { CenteredBox }\n"],"names":["CenteredBox","styled","Box","theme"],"mappings":"0CAEA,MAAMA,EAAcC,EAAOC,CAAG,EAAE,CAAC,CAAE,MAAAC,MAAa,CAC9C,UAAW,SACX,WAAYA,EAAM,QAAQ,CAAC,EAC3B,cAAeA,EAAM,QAAQ,CAAC,CAChC,EAAE"}
@@ -1 +1 @@
1
- import{c,f as d,a as u,b as i,d as p,u as g,e as f,g as m,h as r}from"./events.client-Cm_vJXoK.js";import{g as n}from"./index-D0nE3AYE.js";const A=()=>{const e=n("CMS_BASE_URL");if(!e)throw new Error("CMS_BASE_URL environment variable is not set");return e},B=n("CMS_BASE_URL")??"",a=c({reducerPath:"cmsClient",baseQuery:d({baseUrl:""}),tagTypes:["BlogPosts","BlogPost","Categories","Authors"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:()=>({})}),o=c({reducerPath:"algoliaClient",baseQuery:u(),tagTypes:["SearchResults"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:()=>({})}),s=i(),S=s.getInitialState(),l=p({name:"blog",initialState:S,reducers:{postUpserted:(e,t)=>s.upsertOne(e,t),postsUpserted:(e,t)=>s.upsertMany(e,t),postsClear:e=>s.removeAll(e)}}),{postUpserted:R,postsUpserted:y,postsClear:P}=l.actions,h=l.reducer,v=s.getSelectors(),C=m({[r.reducerPath]:r.reducer,blog:h,[a.reducerPath]:a.reducer,[o.reducerPath]:o.reducer}),w=f({reducer:C,middleware:e=>e().concat(r.middleware,a.middleware,o.middleware),devTools:!1}),E=g;export{a,y as b,B as c,o as d,A as g,v as p,w as s,E as u};
1
+ import{c,f as d,a as u,b as i,d as p,u as g,e as f,g as m,h as r}from"./events.client-BypQp_hx.js";import{g as n}from"./index-DUmIu2EK.js";const A=()=>{const e=n("CMS_BASE_URL");if(!e)throw new Error("CMS_BASE_URL environment variable is not set");return e},B=n("CMS_BASE_URL")??"",a=c({reducerPath:"cmsClient",baseQuery:d({baseUrl:""}),tagTypes:["BlogPosts","BlogPost","Categories","Authors"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:()=>({})}),o=c({reducerPath:"algoliaClient",baseQuery:u(),tagTypes:["SearchResults"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:()=>({})}),s=i(),S=s.getInitialState(),l=p({name:"blog",initialState:S,reducers:{postUpserted:(e,t)=>s.upsertOne(e,t),postsUpserted:(e,t)=>s.upsertMany(e,t),postsClear:e=>s.removeAll(e)}}),{postUpserted:R,postsUpserted:y,postsClear:P}=l.actions,h=l.reducer,v=s.getSelectors(),C=m({[r.reducerPath]:r.reducer,blog:h,[a.reducerPath]:a.reducer,[o.reducerPath]:o.reducer}),w=f({reducer:C,middleware:e=>e().concat(r.middleware,a.middleware,o.middleware),devTools:!1}),E=g;export{a,y as b,B as c,o as d,A as g,v as p,w as s,E as u};
@@ -1 +1 @@
1
- {"version":3,"file":"store-B-SZNpsH.js","sources":["../../src/services/blogClient.ts","../../src/features/blog/blog.slice.ts","../../src/shells/store.ts"],"sourcesContent":["import { createApi, fakeBaseQuery, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\nimport { getEnv } from '../config/env'\n\n// Lazy getter — throws only when a query actually runs, not at import time.\n// A module-level throw crashes DappsShell at import even when no blog query is made.\nconst getCmsBaseUrl = (): string => {\n const url = getEnv('CMS_BASE_URL')\n if (!url) throw new Error('CMS_BASE_URL environment variable is not set')\n // In development, use the Vite proxy to avoid CORS issues; in production, use the direct CMS URL\n return import.meta.env.DEV ? '/api/cms' : url\n}\n\n// Exposed for blog.helpers.ts (fetchFromCMS uses it to resolve references)\nconst cmsBaseUrl = import.meta.env.DEV ? '/api/cms' : getEnv('CMS_BASE_URL') ?? ''\n\n/**\n * CMS Client - For blog posts, categories, and authors from Contentful\n * Uses fetchBaseQuery with Vite proxy in development to avoid CORS\n */\nconst cmsClient = createApi({\n reducerPath: 'cmsClient',\n // baseUrl is resolved lazily per-request so the module can be imported without CMS_BASE_URL set\n baseQuery: fetchBaseQuery({ baseUrl: '' }),\n tagTypes: ['BlogPosts', 'BlogPost', 'Categories', 'Authors'],\n keepUnusedDataFor: 300, // Cache for 5 minutes\n refetchOnFocus: false,\n refetchOnReconnect: false,\n endpoints: () => ({})\n})\n\n/**\n * Algolia Client - For search functionality\n * Uses fakeBaseQuery since we use Algolia SDK directly\n */\nconst algoliaClient = createApi({\n reducerPath: 'algoliaClient',\n baseQuery: fakeBaseQuery(),\n tagTypes: ['SearchResults'],\n keepUnusedDataFor: 300, // Cache for 5 minutes\n refetchOnFocus: false,\n refetchOnReconnect: false,\n endpoints: () => ({})\n})\n\nexport { algoliaClient, cmsBaseUrl, cmsClient, getCmsBaseUrl }\n","import { createEntityAdapter, createSlice } from '@reduxjs/toolkit'\nimport type { BlogPost } from '../../shared/blog/types/blog.domain'\n\n// Entity adapter for normalized posts storage\nconst postsAdapter = createEntityAdapter<BlogPost>()\n\n// Initial state using the adapter\nconst initialState = postsAdapter.getInitialState()\n\nconst blogSlice = createSlice({\n name: 'blog',\n initialState,\n reducers: {\n postUpserted: (state, action) => postsAdapter.upsertOne(state, action),\n postsUpserted: (state, action) => postsAdapter.upsertMany(state, action),\n postsClear: state => postsAdapter.removeAll(state)\n }\n})\n\nconst { postUpserted, postsUpserted, postsClear } = blogSlice.actions\n\nconst blogReducer = blogSlice.reducer\n\n// Export adapter selectors (will be used with RootState in selectors file)\nconst postsSelectors = postsAdapter.getSelectors()\n\nexport { blogReducer, blogSlice, postsClear, postUpserted, postsSelectors, postsUpserted }\n","import { useDispatch, useSelector } from 'react-redux'\nimport type { TypedUseSelectorHook } from 'react-redux'\nimport { combineReducers, configureStore } from '@reduxjs/toolkit'\nimport { blogReducer } from '../features/blog/blog.slice'\nimport { eventsClient } from '../features/explore-events/events.client'\nimport { algoliaClient, cmsClient } from '../services/blogClient'\n\nconst rootReducer = combineReducers({\n [eventsClient.reducerPath]: eventsClient.reducer,\n blog: blogReducer,\n [cmsClient.reducerPath]: cmsClient.reducer,\n [algoliaClient.reducerPath]: algoliaClient.reducer\n})\n\nconst store = configureStore({\n reducer: rootReducer,\n middleware: getDefaultMiddleware =>\n getDefaultMiddleware().concat(eventsClient.middleware, cmsClient.middleware, algoliaClient.middleware),\n devTools: import.meta.env.DEV\n})\n\ntype RootState = ReturnType<typeof store.getState>\ntype AppDispatch = typeof store.dispatch\n\nconst useAppDispatch = () => useDispatch<AppDispatch>()\nconst useAppSelector: TypedUseSelectorHook<RootState> = useSelector\n\nexport { store, useAppDispatch, useAppSelector }\nexport type { RootState, AppDispatch }\n"],"names":["getCmsBaseUrl","url","getEnv","cmsBaseUrl","cmsClient","createApi","fetchBaseQuery","algoliaClient","fakeBaseQuery","postsAdapter","createEntityAdapter","initialState","blogSlice","createSlice","state","action","postUpserted","postsUpserted","postsClear","blogReducer","postsSelectors","rootReducer","combineReducers","eventsClient","store","configureStore","getDefaultMiddleware","useAppSelector","useSelector"],"mappings":"2IAKA,MAAMA,EAAgB,IAAc,CAClC,MAAMC,EAAMC,EAAO,cAAc,EACjC,GAAI,CAACD,EAAK,MAAM,IAAI,MAAM,8CAA8C,EAExE,OAA0CA,CAC5C,EAGME,EAAgDD,EAAO,cAAc,GAAK,GAM1EE,EAAYC,EAAU,CAC1B,YAAa,YAEb,UAAWC,EAAe,CAAE,QAAS,GAAI,EACzC,SAAU,CAAC,YAAa,WAAY,aAAc,SAAS,EAC3D,kBAAmB,IACnB,eAAgB,GAChB,mBAAoB,GACpB,UAAW,KAAO,CAAA,EACpB,CAAC,EAMKC,EAAgBF,EAAU,CAC9B,YAAa,gBACb,UAAWG,EAAA,EACX,SAAU,CAAC,eAAe,EAC1B,kBAAmB,IACnB,eAAgB,GAChB,mBAAoB,GACpB,UAAW,KAAO,CAAA,EACpB,CAAC,ECtCKC,EAAeC,EAAA,EAGfC,EAAeF,EAAa,gBAAA,EAE5BG,EAAYC,EAAY,CAC5B,KAAM,OACN,aAAAF,EACA,SAAU,CACR,aAAc,CAACG,EAAOC,IAAWN,EAAa,UAAUK,EAAOC,CAAM,EACrE,cAAe,CAACD,EAAOC,IAAWN,EAAa,WAAWK,EAAOC,CAAM,EACvE,WAAYD,GAASL,EAAa,UAAUK,CAAK,CAAA,CAErD,CAAC,EAEK,CAAE,aAAAE,EAAc,cAAAC,EAAe,WAAAC,CAAA,EAAeN,EAAU,QAExDO,EAAcP,EAAU,QAGxBQ,EAAiBX,EAAa,aAAA,ECjB9BY,EAAcC,EAAgB,CAClC,CAACC,EAAa,WAAW,EAAGA,EAAa,QACzC,KAAMJ,EACN,CAACf,EAAU,WAAW,EAAGA,EAAU,QACnC,CAACG,EAAc,WAAW,EAAGA,EAAc,OAC7C,CAAC,EAEKiB,EAAQC,EAAe,CAC3B,QAASJ,EACT,WAAYK,GACVA,EAAA,EAAuB,OAAOH,EAAa,WAAYnB,EAAU,WAAYG,EAAc,UAAU,EACvG,SAAU,EACZ,CAAC,EAMKoB,EAAkDC"}
1
+ {"version":3,"file":"store-OyTPwmKI.js","sources":["../../src/services/blogClient.ts","../../src/features/blog/blog.slice.ts","../../src/shells/store.ts"],"sourcesContent":["import { createApi, fakeBaseQuery, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\nimport { getEnv } from '../config/env'\n\n// Lazy getter — throws only when a query actually runs, not at import time.\n// A module-level throw crashes DappsShell at import even when no blog query is made.\nconst getCmsBaseUrl = (): string => {\n const url = getEnv('CMS_BASE_URL')\n if (!url) throw new Error('CMS_BASE_URL environment variable is not set')\n // In development, use the Vite proxy to avoid CORS issues; in production, use the direct CMS URL\n return import.meta.env.DEV ? '/api/cms' : url\n}\n\n// Exposed for blog.helpers.ts (fetchFromCMS uses it to resolve references)\nconst cmsBaseUrl = import.meta.env.DEV ? '/api/cms' : getEnv('CMS_BASE_URL') ?? ''\n\n/**\n * CMS Client - For blog posts, categories, and authors from Contentful\n * Uses fetchBaseQuery with Vite proxy in development to avoid CORS\n */\nconst cmsClient = createApi({\n reducerPath: 'cmsClient',\n // baseUrl is resolved lazily per-request so the module can be imported without CMS_BASE_URL set\n baseQuery: fetchBaseQuery({ baseUrl: '' }),\n tagTypes: ['BlogPosts', 'BlogPost', 'Categories', 'Authors'],\n keepUnusedDataFor: 300, // Cache for 5 minutes\n refetchOnFocus: false,\n refetchOnReconnect: false,\n endpoints: () => ({})\n})\n\n/**\n * Algolia Client - For search functionality\n * Uses fakeBaseQuery since we use Algolia SDK directly\n */\nconst algoliaClient = createApi({\n reducerPath: 'algoliaClient',\n baseQuery: fakeBaseQuery(),\n tagTypes: ['SearchResults'],\n keepUnusedDataFor: 300, // Cache for 5 minutes\n refetchOnFocus: false,\n refetchOnReconnect: false,\n endpoints: () => ({})\n})\n\nexport { algoliaClient, cmsBaseUrl, cmsClient, getCmsBaseUrl }\n","import { createEntityAdapter, createSlice } from '@reduxjs/toolkit'\nimport type { BlogPost } from '../../shared/blog/types/blog.domain'\n\n// Entity adapter for normalized posts storage\nconst postsAdapter = createEntityAdapter<BlogPost>()\n\n// Initial state using the adapter\nconst initialState = postsAdapter.getInitialState()\n\nconst blogSlice = createSlice({\n name: 'blog',\n initialState,\n reducers: {\n postUpserted: (state, action) => postsAdapter.upsertOne(state, action),\n postsUpserted: (state, action) => postsAdapter.upsertMany(state, action),\n postsClear: state => postsAdapter.removeAll(state)\n }\n})\n\nconst { postUpserted, postsUpserted, postsClear } = blogSlice.actions\n\nconst blogReducer = blogSlice.reducer\n\n// Export adapter selectors (will be used with RootState in selectors file)\nconst postsSelectors = postsAdapter.getSelectors()\n\nexport { blogReducer, blogSlice, postsClear, postUpserted, postsSelectors, postsUpserted }\n","import { useDispatch, useSelector } from 'react-redux'\nimport type { TypedUseSelectorHook } from 'react-redux'\nimport { combineReducers, configureStore } from '@reduxjs/toolkit'\nimport { blogReducer } from '../features/blog/blog.slice'\nimport { eventsClient } from '../features/explore-events/events.client'\nimport { algoliaClient, cmsClient } from '../services/blogClient'\n\nconst rootReducer = combineReducers({\n [eventsClient.reducerPath]: eventsClient.reducer,\n blog: blogReducer,\n [cmsClient.reducerPath]: cmsClient.reducer,\n [algoliaClient.reducerPath]: algoliaClient.reducer\n})\n\nconst store = configureStore({\n reducer: rootReducer,\n middleware: getDefaultMiddleware =>\n getDefaultMiddleware().concat(eventsClient.middleware, cmsClient.middleware, algoliaClient.middleware),\n devTools: import.meta.env.DEV\n})\n\ntype RootState = ReturnType<typeof store.getState>\ntype AppDispatch = typeof store.dispatch\n\nconst useAppDispatch = () => useDispatch<AppDispatch>()\nconst useAppSelector: TypedUseSelectorHook<RootState> = useSelector\n\nexport { store, useAppDispatch, useAppSelector }\nexport type { RootState, AppDispatch }\n"],"names":["getCmsBaseUrl","url","getEnv","cmsBaseUrl","cmsClient","createApi","fetchBaseQuery","algoliaClient","fakeBaseQuery","postsAdapter","createEntityAdapter","initialState","blogSlice","createSlice","state","action","postUpserted","postsUpserted","postsClear","blogReducer","postsSelectors","rootReducer","combineReducers","eventsClient","store","configureStore","getDefaultMiddleware","useAppSelector","useSelector"],"mappings":"2IAKA,MAAMA,EAAgB,IAAc,CAClC,MAAMC,EAAMC,EAAO,cAAc,EACjC,GAAI,CAACD,EAAK,MAAM,IAAI,MAAM,8CAA8C,EAExE,OAA0CA,CAC5C,EAGME,EAAgDD,EAAO,cAAc,GAAK,GAM1EE,EAAYC,EAAU,CAC1B,YAAa,YAEb,UAAWC,EAAe,CAAE,QAAS,GAAI,EACzC,SAAU,CAAC,YAAa,WAAY,aAAc,SAAS,EAC3D,kBAAmB,IACnB,eAAgB,GAChB,mBAAoB,GACpB,UAAW,KAAO,CAAA,EACpB,CAAC,EAMKC,EAAgBF,EAAU,CAC9B,YAAa,gBACb,UAAWG,EAAA,EACX,SAAU,CAAC,eAAe,EAC1B,kBAAmB,IACnB,eAAgB,GAChB,mBAAoB,GACpB,UAAW,KAAO,CAAA,EACpB,CAAC,ECtCKC,EAAeC,EAAA,EAGfC,EAAeF,EAAa,gBAAA,EAE5BG,EAAYC,EAAY,CAC5B,KAAM,OACN,aAAAF,EACA,SAAU,CACR,aAAc,CAACG,EAAOC,IAAWN,EAAa,UAAUK,EAAOC,CAAM,EACrE,cAAe,CAACD,EAAOC,IAAWN,EAAa,WAAWK,EAAOC,CAAM,EACvE,WAAYD,GAASL,EAAa,UAAUK,CAAK,CAAA,CAErD,CAAC,EAEK,CAAE,aAAAE,EAAc,cAAAC,EAAe,WAAAC,CAAA,EAAeN,EAAU,QAExDO,EAAcP,EAAU,QAGxBQ,EAAiBX,EAAa,aAAA,ECjB9BY,EAAcC,EAAgB,CAClC,CAACC,EAAa,WAAW,EAAGA,EAAa,QACzC,KAAMJ,EACN,CAACf,EAAU,WAAW,EAAGA,EAAU,QACnC,CAACG,EAAc,WAAW,EAAGA,EAAc,OAC7C,CAAC,EAEKiB,EAAQC,EAAe,CAC3B,QAASJ,EACT,WAAYK,GACVA,EAAA,EAAuB,OAAOH,EAAa,WAAYnB,EAAU,WAAYG,EAAc,UAAU,EACvG,SAAU,EACZ,CAAC,EAMKoB,EAAkDC"}
@@ -1 +1 @@
1
- import{c as A}from"./index-BxZNYwr3.js";var c;(function(e){e.WINDOWS="Windows",e.MACOS="macOS"})(c||(c={}));var s;(function(e){e.LAUNCHER="launcher",e.AUTO_SIGNING="auto-signing"})(s||(s={}));const u="https://explorer-artifacts.decentraland.org/launcher-rust",N="https://explorer-artifacts.decentraland.org/launcher/dcl",O=A.get("AUTO_SIGNING_BASE_URL"),L={[s.LAUNCHER]:{urls:{[c.WINDOWS]:{amd64:`${u}/Decentraland_installer.exe`},[c.MACOS]:{amd64:`${N}/Decentraland%20Outdated-mac-x64.dmg`,arm64:`${u}/Decentraland_installer.dmg`}}},[s.AUTO_SIGNING]:{urls:{[c.WINDOWS]:{amd64:`${O}/:identityId/decentraland.exe`},[c.MACOS]:{amd64:`${N}/Decentraland%20Outdated-mac-x64.dmg`,arm64:`${O}/:identityId/decentraland.dmg`}}}},i=(e=s.LAUNCHER,t)=>{const n=L[e];if(!n)return null;const r=a=>a&&(e===s.AUTO_SIGNING&&t?a.replace(":identityId",t):a);return{[c.WINDOWS]:{amd64:r(n.urls.Windows.amd64)},[c.MACOS]:{amd64:r(n.urls.macOS.amd64),arm64:r(n.urls.macOS.arm64)}}},m=(e,t)=>{if(!t||Object.keys(t).length===0)return e;const n=new URL(e);return Object.entries(t).forEach(([r,a])=>{a!=null&&n.searchParams.append(r,a)}),n.toString()},C=(e,t,n)=>{const r=new URL(e);return r.searchParams.delete(t),r.searchParams.append(t,n),r.toString()},d=e=>{if(!e)return null;const t={};for(const[n,r]of Object.entries(e)){const a={};for(const[l,o]of Object.entries(r))o&&(a[l]=o);Object.keys(a).length>0&&(t[n]=a)}return Object.keys(t).length>0?t:null},I=async(e,t)=>{if(!e){const n=i(s.LAUNCHER);return t||d(n)}try{const n=await e(),r=n?i(s.AUTO_SIGNING,n):i(s.LAUNCHER);return d(r)||t||null}catch(n){console.error("Failed to generate identityId:",n);const r=i(s.LAUNCHER);return d(r)||t||null}},f=(e,t,n,r)=>{if(!r?.[e])return n;const a=r[e];return t&&a[t]?a[t]:Object.values(a)[0]||n},U=d(i(s.LAUNCHER))||{};export{s as C,U as F,m as a,I as c,f as e,i as g,d as s,C as u};
1
+ import{c as A}from"./index-BaEE4ZXP.js";var c;(function(e){e.WINDOWS="Windows",e.MACOS="macOS"})(c||(c={}));var s;(function(e){e.LAUNCHER="launcher",e.AUTO_SIGNING="auto-signing"})(s||(s={}));const u="https://explorer-artifacts.decentraland.org/launcher-rust",N="https://explorer-artifacts.decentraland.org/launcher/dcl",O=A.get("AUTO_SIGNING_BASE_URL"),L={[s.LAUNCHER]:{urls:{[c.WINDOWS]:{amd64:`${u}/Decentraland_installer.exe`},[c.MACOS]:{amd64:`${N}/Decentraland%20Outdated-mac-x64.dmg`,arm64:`${u}/Decentraland_installer.dmg`}}},[s.AUTO_SIGNING]:{urls:{[c.WINDOWS]:{amd64:`${O}/:identityId/decentraland.exe`},[c.MACOS]:{amd64:`${N}/Decentraland%20Outdated-mac-x64.dmg`,arm64:`${O}/:identityId/decentraland.dmg`}}}},i=(e=s.LAUNCHER,t)=>{const n=L[e];if(!n)return null;const r=a=>a&&(e===s.AUTO_SIGNING&&t?a.replace(":identityId",t):a);return{[c.WINDOWS]:{amd64:r(n.urls.Windows.amd64)},[c.MACOS]:{amd64:r(n.urls.macOS.amd64),arm64:r(n.urls.macOS.arm64)}}},m=(e,t)=>{if(!t||Object.keys(t).length===0)return e;const n=new URL(e);return Object.entries(t).forEach(([r,a])=>{a!=null&&n.searchParams.append(r,a)}),n.toString()},C=(e,t,n)=>{const r=new URL(e);return r.searchParams.delete(t),r.searchParams.append(t,n),r.toString()},d=e=>{if(!e)return null;const t={};for(const[n,r]of Object.entries(e)){const a={};for(const[l,o]of Object.entries(r))o&&(a[l]=o);Object.keys(a).length>0&&(t[n]=a)}return Object.keys(t).length>0?t:null},I=async(e,t)=>{if(!e){const n=i(s.LAUNCHER);return t||d(n)}try{const n=await e(),r=n?i(s.AUTO_SIGNING,n):i(s.LAUNCHER);return d(r)||t||null}catch(n){console.error("Failed to generate identityId:",n);const r=i(s.LAUNCHER);return d(r)||t||null}},f=(e,t,n,r)=>{if(!r?.[e])return n;const a=r[e];return t&&a[t]?a[t]:Object.values(a)[0]||n},U=d(i(s.LAUNCHER))||{};export{s as C,U as F,m as a,I as c,f as e,i as g,d as s,C as u};
@@ -1 +1 @@
1
- {"version":3,"file":"url-B6S3bwqB.js","sources":["../../node_modules/decentraland-ui2/dist/components/DownloadButton/DownloadButton.types.js","../../node_modules/decentraland-ui2/dist/modules/cdnReleases.js","../../src/modules/url.ts"],"sourcesContent":["var OperativeSystem;\n(function (OperativeSystem) {\n OperativeSystem[\"WINDOWS\"] = \"Windows\";\n OperativeSystem[\"MACOS\"] = \"macOS\";\n})(OperativeSystem || (OperativeSystem = {}));\nexport { OperativeSystem };\n//# sourceMappingURL=DownloadButton.types.js.map","import { OperativeSystem } from '../components/DownloadButton';\nimport { config } from '../config';\nvar CDNSource;\n(function (CDNSource) {\n CDNSource[\"LAUNCHER\"] = \"launcher\";\n CDNSource[\"AUTO_SIGNING\"] = \"auto-signing\";\n // Add future CDN sources here\n})(CDNSource || (CDNSource = {}));\nconst LAUNCHER_BASE_URL = 'https://explorer-artifacts.decentraland.org/launcher-rust';\nconst LAUNCHER_LEGACY_BASE_URL = 'https://explorer-artifacts.decentraland.org/launcher/dcl';\nconst AUTO_SIGNING_BASE_URL = config.get('AUTO_SIGNING_BASE_URL');\nconst CDN_CONFIGS = {\n [CDNSource.LAUNCHER]: {\n urls: {\n [OperativeSystem.WINDOWS]: {\n amd64: `${LAUNCHER_BASE_URL}/Decentraland_installer.exe`\n },\n [OperativeSystem.MACOS]: {\n amd64: `${LAUNCHER_LEGACY_BASE_URL}/Decentraland%20Outdated-mac-x64.dmg`,\n arm64: `${LAUNCHER_BASE_URL}/Decentraland_installer.dmg`\n }\n }\n },\n [CDNSource.AUTO_SIGNING]: {\n urls: {\n [OperativeSystem.WINDOWS]: {\n amd64: `${AUTO_SIGNING_BASE_URL}/:identityId/decentraland.exe`\n },\n [OperativeSystem.MACOS]: {\n amd64: `${LAUNCHER_LEGACY_BASE_URL}/Decentraland%20Outdated-mac-x64.dmg`,\n arm64: `${AUTO_SIGNING_BASE_URL}/:identityId/decentraland.dmg`\n }\n }\n }\n // Add more CDN configurations here as needed\n};\nconst getCDNRelease = (source = CDNSource.LAUNCHER, identityId) => {\n const cdnConfig = CDN_CONFIGS[source];\n if (!cdnConfig) {\n return null;\n }\n const replaceIdentityId = (url) => {\n if (!url)\n return url;\n // Replace :identityId placeholder in the path for AUTO_SIGNING source\n if (source === CDNSource.AUTO_SIGNING && identityId) {\n return url.replace(':identityId', identityId);\n }\n return url;\n };\n return {\n [OperativeSystem.WINDOWS]: {\n amd64: replaceIdentityId(cdnConfig.urls.Windows.amd64)\n },\n [OperativeSystem.MACOS]: {\n amd64: replaceIdentityId(cdnConfig.urls.macOS.amd64),\n arm64: replaceIdentityId(cdnConfig.urls.macOS.arm64)\n }\n };\n};\nexport { getCDNRelease, CDNSource };\n//# sourceMappingURL=cdnReleases.js.map","import { CDNSource, getCDNRelease } from 'decentraland-ui2/dist/modules/cdnReleases'\nimport { Architecture } from '../types/download.types'\n\nconst addQueryParamsToUrlString = (url: string, params: Record<string, string | undefined | null>): string => {\n if (!params || Object.keys(params).length === 0) {\n return url\n }\n\n const urlObj = new URL(url)\n\n Object.entries(params).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n urlObj.searchParams.append(key, value)\n }\n })\n\n return urlObj.toString()\n}\n\nconst updateUrlWithLastValue = (url: string, paramKey: string, paramValue: string) => {\n const urlObj = new URL(url)\n\n urlObj.searchParams.delete(paramKey)\n urlObj.searchParams.append(paramKey, paramValue)\n\n return urlObj.toString()\n}\n\nconst sanitizeCDNReleaseLinks = (\n cdnLinks: Record<string, Record<string, string | undefined>> | null\n): Record<string, Record<string, string>> | null => {\n if (!cdnLinks) return null\n\n const sanitizedLinks: Record<string, Record<string, string>> = {}\n for (const [os, archLinks] of Object.entries(cdnLinks)) {\n const sanitizedArchLinks: Record<string, string> = {}\n for (const [arch, link] of Object.entries(archLinks)) {\n if (link) {\n sanitizedArchLinks[arch] = link\n }\n }\n if (Object.keys(sanitizedArchLinks).length > 0) {\n sanitizedLinks[os] = sanitizedArchLinks\n }\n }\n return Object.keys(sanitizedLinks).length > 0 ? sanitizedLinks : null\n}\n\nconst calculateCDNReleaseLinksWithIdentity = async (\n getIdentityId?: () => Promise<string | undefined>,\n fallbackLinks?: Record<string, Record<string, string>> | null\n): Promise<Record<string, Record<string, string>> | null> => {\n if (!getIdentityId) {\n const launcherLinks = getCDNRelease(CDNSource.LAUNCHER)\n return fallbackLinks || sanitizeCDNReleaseLinks(launcherLinks)\n }\n\n try {\n const currentIdentityId = await getIdentityId()\n const cdnLinks = currentIdentityId ? getCDNRelease(CDNSource.AUTO_SIGNING, currentIdentityId) : getCDNRelease(CDNSource.LAUNCHER)\n\n return sanitizeCDNReleaseLinks(cdnLinks) || fallbackLinks || null\n } catch (error) {\n console.error('Failed to generate identityId:', error)\n const launcherLinks = getCDNRelease(CDNSource.LAUNCHER)\n return sanitizeCDNReleaseLinks(launcherLinks) || fallbackLinks || null\n }\n}\n\nconst extractDownloadLinkFromCDNReleaseOption = (\n optionText: string,\n optionArch: Architecture | undefined,\n optionFallbackLink: string | undefined,\n cdnReleaseLinks: Record<string, Record<string, string>> | null\n): string | undefined => {\n if (!cdnReleaseLinks?.[optionText]) return optionFallbackLink\n\n const osLinks = cdnReleaseLinks[optionText]\n if (optionArch && osLinks[optionArch]) {\n return osLinks[optionArch]\n }\n\n const firstAvailableLink = Object.values(osLinks)[0]\n return firstAvailableLink || optionFallbackLink\n}\n\nconst FALLBACK_CDN_RELEASE_LINKS = sanitizeCDNReleaseLinks(getCDNRelease(CDNSource.LAUNCHER)) || {}\n\nexport {\n FALLBACK_CDN_RELEASE_LINKS,\n addQueryParamsToUrlString,\n calculateCDNReleaseLinksWithIdentity,\n extractDownloadLinkFromCDNReleaseOption,\n sanitizeCDNReleaseLinks,\n updateUrlWithLastValue\n}\n"],"names":["OperativeSystem","CDNSource","LAUNCHER_BASE_URL","LAUNCHER_LEGACY_BASE_URL","AUTO_SIGNING_BASE_URL","config","CDN_CONFIGS","getCDNRelease","source","identityId","cdnConfig","replaceIdentityId","url","addQueryParamsToUrlString","params","urlObj","key","value","updateUrlWithLastValue","paramKey","paramValue","sanitizeCDNReleaseLinks","cdnLinks","sanitizedLinks","os","archLinks","sanitizedArchLinks","arch","link","calculateCDNReleaseLinksWithIdentity","getIdentityId","fallbackLinks","launcherLinks","currentIdentityId","error","extractDownloadLinkFromCDNReleaseOption","optionText","optionArch","optionFallbackLink","cdnReleaseLinks","osLinks","FALLBACK_CDN_RELEASE_LINKS"],"mappings":"wCAAA,IAAIA,GACH,SAAUA,EAAiB,CACxBA,EAAgB,QAAa,UAC7BA,EAAgB,MAAW,OAC/B,GAAGA,IAAoBA,EAAkB,CAAA,EAAG,ECFzC,IAACC,GACH,SAAUA,EAAW,CAClBA,EAAU,SAAc,WACxBA,EAAU,aAAkB,cAEhC,GAAGA,IAAcA,EAAY,CAAA,EAAG,EAChC,MAAMC,EAAoB,4DACpBC,EAA2B,2DAC3BC,EAAwBC,EAAO,IAAI,uBAAuB,EAC1DC,EAAc,CAChB,CAACL,EAAU,QAAQ,EAAG,CAClB,KAAM,CACF,CAACD,EAAgB,OAAO,EAAG,CACvB,MAAO,GAAGE,CAAiB,6BA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{"version":3,"file":"url-BHzlJYXC.js","sources":["../../node_modules/decentraland-ui2/dist/components/DownloadButton/DownloadButton.types.js","../../node_modules/decentraland-ui2/dist/modules/cdnReleases.js","../../src/modules/url.ts"],"sourcesContent":["var OperativeSystem;\n(function (OperativeSystem) {\n OperativeSystem[\"WINDOWS\"] = \"Windows\";\n OperativeSystem[\"MACOS\"] = \"macOS\";\n})(OperativeSystem || (OperativeSystem = {}));\nexport { OperativeSystem };\n//# sourceMappingURL=DownloadButton.types.js.map","import { OperativeSystem } from '../components/DownloadButton';\nimport { config } from '../config';\nvar CDNSource;\n(function (CDNSource) {\n CDNSource[\"LAUNCHER\"] = \"launcher\";\n CDNSource[\"AUTO_SIGNING\"] = \"auto-signing\";\n // Add future CDN sources here\n})(CDNSource || (CDNSource = {}));\nconst LAUNCHER_BASE_URL = 'https://explorer-artifacts.decentraland.org/launcher-rust';\nconst LAUNCHER_LEGACY_BASE_URL = 'https://explorer-artifacts.decentraland.org/launcher/dcl';\nconst AUTO_SIGNING_BASE_URL = config.get('AUTO_SIGNING_BASE_URL');\nconst CDN_CONFIGS = {\n [CDNSource.LAUNCHER]: {\n urls: {\n [OperativeSystem.WINDOWS]: {\n amd64: `${LAUNCHER_BASE_URL}/Decentraland_installer.exe`\n },\n [OperativeSystem.MACOS]: {\n amd64: `${LAUNCHER_LEGACY_BASE_URL}/Decentraland%20Outdated-mac-x64.dmg`,\n arm64: `${LAUNCHER_BASE_URL}/Decentraland_installer.dmg`\n }\n }\n },\n [CDNSource.AUTO_SIGNING]: {\n urls: {\n [OperativeSystem.WINDOWS]: {\n amd64: `${AUTO_SIGNING_BASE_URL}/:identityId/decentraland.exe`\n },\n [OperativeSystem.MACOS]: {\n amd64: `${LAUNCHER_LEGACY_BASE_URL}/Decentraland%20Outdated-mac-x64.dmg`,\n arm64: `${AUTO_SIGNING_BASE_URL}/:identityId/decentraland.dmg`\n }\n }\n }\n // Add more CDN configurations here as needed\n};\nconst getCDNRelease = (source = CDNSource.LAUNCHER, identityId) => {\n const cdnConfig = CDN_CONFIGS[source];\n if (!cdnConfig) {\n return null;\n }\n const replaceIdentityId = (url) => {\n if (!url)\n return url;\n // Replace :identityId placeholder in the path for AUTO_SIGNING source\n if (source === CDNSource.AUTO_SIGNING && identityId) {\n return url.replace(':identityId', identityId);\n }\n return url;\n };\n return {\n [OperativeSystem.WINDOWS]: {\n amd64: replaceIdentityId(cdnConfig.urls.Windows.amd64)\n },\n [OperativeSystem.MACOS]: {\n amd64: replaceIdentityId(cdnConfig.urls.macOS.amd64),\n arm64: replaceIdentityId(cdnConfig.urls.macOS.arm64)\n }\n };\n};\nexport { getCDNRelease, CDNSource };\n//# sourceMappingURL=cdnReleases.js.map","import { CDNSource, getCDNRelease } from 'decentraland-ui2/dist/modules/cdnReleases'\nimport { Architecture } from '../types/download.types'\n\nconst addQueryParamsToUrlString = (url: string, params: Record<string, string | undefined | null>): string => {\n if (!params || Object.keys(params).length === 0) {\n return url\n }\n\n const urlObj = new URL(url)\n\n Object.entries(params).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n urlObj.searchParams.append(key, value)\n }\n })\n\n return urlObj.toString()\n}\n\nconst updateUrlWithLastValue = (url: string, paramKey: string, paramValue: string) => {\n const urlObj = new URL(url)\n\n urlObj.searchParams.delete(paramKey)\n urlObj.searchParams.append(paramKey, paramValue)\n\n return urlObj.toString()\n}\n\nconst sanitizeCDNReleaseLinks = (\n cdnLinks: Record<string, Record<string, string | undefined>> | null\n): Record<string, Record<string, string>> | null => {\n if (!cdnLinks) return null\n\n const sanitizedLinks: Record<string, Record<string, string>> = {}\n for (const [os, archLinks] of Object.entries(cdnLinks)) {\n const sanitizedArchLinks: Record<string, string> = {}\n for (const [arch, link] of Object.entries(archLinks)) {\n if (link) {\n sanitizedArchLinks[arch] = link\n }\n }\n if (Object.keys(sanitizedArchLinks).length > 0) {\n sanitizedLinks[os] = sanitizedArchLinks\n }\n }\n return Object.keys(sanitizedLinks).length > 0 ? sanitizedLinks : null\n}\n\nconst calculateCDNReleaseLinksWithIdentity = async (\n getIdentityId?: () => Promise<string | undefined>,\n fallbackLinks?: Record<string, Record<string, string>> | null\n): Promise<Record<string, Record<string, string>> | null> => {\n if (!getIdentityId) {\n const launcherLinks = getCDNRelease(CDNSource.LAUNCHER)\n return fallbackLinks || sanitizeCDNReleaseLinks(launcherLinks)\n }\n\n try {\n const currentIdentityId = await getIdentityId()\n const cdnLinks = currentIdentityId ? getCDNRelease(CDNSource.AUTO_SIGNING, currentIdentityId) : getCDNRelease(CDNSource.LAUNCHER)\n\n return sanitizeCDNReleaseLinks(cdnLinks) || fallbackLinks || null\n } catch (error) {\n console.error('Failed to generate identityId:', error)\n const launcherLinks = getCDNRelease(CDNSource.LAUNCHER)\n return sanitizeCDNReleaseLinks(launcherLinks) || fallbackLinks || null\n }\n}\n\nconst extractDownloadLinkFromCDNReleaseOption = (\n optionText: string,\n optionArch: Architecture | undefined,\n optionFallbackLink: string | undefined,\n cdnReleaseLinks: Record<string, Record<string, string>> | null\n): string | undefined => {\n if (!cdnReleaseLinks?.[optionText]) return optionFallbackLink\n\n const osLinks = cdnReleaseLinks[optionText]\n if (optionArch && osLinks[optionArch]) {\n return osLinks[optionArch]\n }\n\n const firstAvailableLink = Object.values(osLinks)[0]\n return firstAvailableLink || optionFallbackLink\n}\n\nconst FALLBACK_CDN_RELEASE_LINKS = sanitizeCDNReleaseLinks(getCDNRelease(CDNSource.LAUNCHER)) || {}\n\nexport {\n FALLBACK_CDN_RELEASE_LINKS,\n addQueryParamsToUrlString,\n calculateCDNReleaseLinksWithIdentity,\n extractDownloadLinkFromCDNReleaseOption,\n sanitizeCDNReleaseLinks,\n updateUrlWithLastValue\n}\n"],"names":["OperativeSystem","CDNSource","LAUNCHER_BASE_URL","LAUNCHER_LEGACY_BASE_URL","AUTO_SIGNING_BASE_URL","config","CDN_CONFIGS","getCDNRelease","source","identityId","cdnConfig","replaceIdentityId","url","addQueryParamsToUrlString","params","urlObj","key","value","updateUrlWithLastValue","paramKey","paramValue","sanitizeCDNReleaseLinks","cdnLinks","sanitizedLinks","os","archLinks","sanitizedArchLinks","arch","link","calculateCDNReleaseLinksWithIdentity","getIdentityId","fallbackLinks","launcherLinks","currentIdentityId","error","extractDownloadLinkFromCDNReleaseOption","optionText","optionArch","optionFallbackLink","cdnReleaseLinks","osLinks","FALLBACK_CDN_RELEASE_LINKS"],"mappings":"wCAAA,IAAIA,GACH,SAAUA,EAAiB,CACxBA,EAAgB,QAAa,UAC7BA,EAAgB,MAAW,OAC/B,GAAGA,IAAoBA,EAAkB,CAAA,EAAG,ECFzC,IAACC,GACH,SAAUA,EAAW,CAClBA,EAAU,SAAc,WACxBA,EAAU,aAAkB,cAEhC,GAAGA,IAAcA,EAAY,CAAA,EAAG,EAChC,MAAMC,EAAoB,4DACpBC,EAA2B,2DAC3BC,EAAwBC,EAAO,IAAI,uBAAuB,EAC1DC,EAAc,CAChB,CAACL,EAAU,QAAQ,EAAG,CAClB,KAAM,CACF,CAACD,EAAgB,OAAO,EAAG,CACvB,MAAO,GAAGE,CAAiB,6BAC3C,EACY,CAACF,EAAgB,KAAK,EAAG,CACrB,MAAO,GAAGG,CAAwB,uCAClC,MAAO,GAAGD,CAAiB,6BAC3C,CACA,CACA,EACI,CAACD,EAAU,YAAY,EAAG,CACtB,KAAM,CACF,CAACD,EAAgB,OAAO,EAAG,CACvB,MAAO,GAAGI,CAAqB,+BAC/C,EACY,CAACJ,EAAgB,KAAK,EAAG,CACrB,MAAO,GAAGG,CAAwB,uCAClC,MAAO,GAAGC,CAAqB,+BAC/C,CACA,CACA,CAEA,EACMG,EAAgB,CAACC,EAASP,EAAU,SAAUQ,IAAe,CAC/D,MAAMC,EAAYJ,EAAYE,CAAM,EACpC,GAAI,CAACE,EACD,OAAO,KAEX,MAAMC,EAAqBC,GAClBA,IAGDJ,IAAWP,EAAU,cAAgBQ,EAC9BG,EAAI,QAAQ,cAAeH,CAAU,EAEzCG,GAEX,MAAO,CACH,CAACZ,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,EAAwBW,CAAa,CAC/D,CAEA,GAAI,CACF,MAAMC,EAAoB,MAAMH,EAAA,EAC1BR,EAAWW,EAAoB1B,EAAcN,EAAU,aAAcgC,CAAiB,EAAI1B,EAAcN,EAAU,QAAQ,EAEhI,OAAOoB,EAAwBC,CAAQ,GAAKS,GAAiB,IAC/D,OAASG,EAAO,CACd,QAAQ,MAAM,iCAAkCA,CAAK,EACrD,MAAMF,EAAgBzB,EAAcN,EAAU,QAAQ,EACtD,OAAOoB,EAAwBW,CAAa,GAAKD,GAAiB,IACpE,CACF,EAEMI,EAA0C,CAC9CC,EACAC,EACAC,EACAC,IACuB,CACvB,GAAI,CAACA,IAAkBH,CAAU,EAAG,OAAOE,EAE3C,MAAME,EAAUD,EAAgBH,CAAU,EAC1C,OAAIC,GAAcG,EAAQH,CAAU,EAC3BG,EAAQH,CAAU,EAGA,OAAO,OAAOG,CAAO,EAAE,CAAC,GACtBF,CAC/B,EAEMG,EAA6BpB,EAAwBd,EAAcN,EAAU,QAAQ,CAAC,GAAK,CAAA","x_google_ignoreList":[0,1]}
@@ -1 +1 @@
1
- import{r as s}from"./vendor-router-D_36sTKu.js";import{u as d,d as i}from"./index-D0nE3AYE.js";function u(){const{address:e}=d(),t=e||void 0,r=s.useMemo(()=>{if(t)try{return i.localStorageGetIdentity(t.toLowerCase())??void 0}catch(o){console.error("[useAuthIdentity] Failed to get identity:",o);return}},[t]);return{identity:r,hasValidIdentity:!!r,address:t}}export{u};
1
+ import{r as s}from"./vendor-router-D_36sTKu.js";import{u as d,d as i}from"./index-DUmIu2EK.js";function u(){const{address:e}=d(),t=e||void 0,r=s.useMemo(()=>{if(t)try{return i.localStorageGetIdentity(t.toLowerCase())??void 0}catch(o){console.error("[useAuthIdentity] Failed to get identity:",o);return}},[t]);return{identity:r,hasValidIdentity:!!r,address:t}}export{u};
@@ -1 +1 @@
1
- {"version":3,"file":"useAuthIdentity-BlDTBxRE.js","sources":["../../src/hooks/useAuthIdentity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport type { AuthIdentity } from '@dcl/crypto'\nimport { localStorageGetIdentity } from '@dcl/single-sign-on-client'\nimport { useWalletAddress } from './useWalletAddress'\n\ntype UseAuthIdentityResult = {\n identity: AuthIdentity | undefined\n hasValidIdentity: boolean\n address: `0x${string}` | undefined\n}\n\nfunction useAuthIdentity(): UseAuthIdentityResult {\n const { address } = useWalletAddress()\n const walletAddress = address ? (address as `0x${string}`) : undefined\n\n const identity = useMemo<AuthIdentity | undefined>(() => {\n if (!walletAddress) return undefined\n try {\n return localStorageGetIdentity(walletAddress.toLowerCase()) ?? undefined\n } catch (error) {\n console.error('[useAuthIdentity] Failed to get identity:', error)\n return undefined\n }\n }, [walletAddress])\n\n return {\n identity,\n hasValidIdentity: Boolean(identity),\n address: walletAddress\n }\n}\n\nexport { useAuthIdentity }\nexport type { UseAuthIdentityResult }\n"],"names":["useAuthIdentity","address","useWalletAddress","walletAddress","identity","useMemo","localStorageGetIdentity","error"],"mappings":"+FAWA,SAASA,GAAyC,CAChD,KAAM,CAAE,QAAAC,CAAA,EAAYC,EAAA,EACdC,EAAgBF,GAAuC,OAEvDG,EAAWC,EAAAA,QAAkC,IAAM,CACvD,GAAKF,EACL,GAAI,CACF,OAAOG,EAAAA,wBAAwBH,EAAc,YAAA,CAAa,GAAK,MACjE,OAASI,EAAO,CACd,QAAQ,MAAM,4CAA6CA,CAAK,EAChE,MACF,CACF,EAAG,CAACJ,CAAa,CAAC,EAElB,MAAO,CACL,SAAAC,EACA,iBAAkB,EAAQA,EAC1B,QAASD,CAAA,CAEb"}
1
+ {"version":3,"file":"useAuthIdentity-D2zQ3q5X.js","sources":["../../src/hooks/useAuthIdentity.ts"],"sourcesContent":["import { useMemo } from 'react'\nimport type { AuthIdentity } from '@dcl/crypto'\nimport { localStorageGetIdentity } from '@dcl/single-sign-on-client'\nimport { useWalletAddress } from './useWalletAddress'\n\ntype UseAuthIdentityResult = {\n identity: AuthIdentity | undefined\n hasValidIdentity: boolean\n address: `0x${string}` | undefined\n}\n\nfunction useAuthIdentity(): UseAuthIdentityResult {\n const { address } = useWalletAddress()\n const walletAddress = address ? (address as `0x${string}`) : undefined\n\n const identity = useMemo<AuthIdentity | undefined>(() => {\n if (!walletAddress) return undefined\n try {\n return localStorageGetIdentity(walletAddress.toLowerCase()) ?? undefined\n } catch (error) {\n console.error('[useAuthIdentity] Failed to get identity:', error)\n return undefined\n }\n }, [walletAddress])\n\n return {\n identity,\n hasValidIdentity: Boolean(identity),\n address: walletAddress\n }\n}\n\nexport { useAuthIdentity }\nexport type { UseAuthIdentityResult }\n"],"names":["useAuthIdentity","address","useWalletAddress","walletAddress","identity","useMemo","localStorageGetIdentity","error"],"mappings":"+FAWA,SAASA,GAAyC,CAChD,KAAM,CAAE,QAAAC,CAAA,EAAYC,EAAA,EACdC,EAAgBF,GAAuC,OAEvDG,EAAWC,EAAAA,QAAkC,IAAM,CACvD,GAAKF,EACL,GAAI,CACF,OAAOG,EAAAA,wBAAwBH,EAAc,YAAA,CAAa,GAAK,MACjE,OAASI,EAAO,CACd,QAAQ,MAAM,4CAA6CA,CAAK,EAChE,MACF,CACF,EAAG,CAACJ,CAAa,CAAC,EAElB,MAAO,CACL,SAAAC,EACA,iBAAkB,EAAQA,EAC1B,QAASD,CAAA,CAEb"}
@@ -1 +1 @@
1
- import{s,a as h,p as A,O as r,q as x,t as b}from"./index-D0nE3AYE.js";import{r as o}from"./vendor-router-D_36sTKu.js";import{t as O}from"./file-Cr_gl9BS.js";import{u as y,a as C}from"./url-B6S3bwqB.js";import{u as R,R as k}from"./useLatestGithubRelease-lPlpQBOj.js";const E=s("img")({width:"20px",height:"20px",filter:"brightness(0) invert(1)"}),I=s(h)({display:"flex",alignItems:"center",gap:"8px",marginTop:"8px",justifyContent:"center"}),U=s("span")({fontSize:"14px",color:"rgba(255, 255, 255, 0.7)"}),B=s("button")(({theme:l})=>({background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",outline:"none","&:focus-visible":{outline:`2px solid ${l.palette.primary.main}`,outlineOffset:2}})),_=s("img")({width:"20px",height:"20px",filter:"brightness(0) invert(1)"}),w="/download/creator-hub-success",D=3e3,u={[r.WINDOWS]:b,[r.MACOS]:x};function j(){const[l,e]=A(),{links:t,loading:m}=R(k.CREATOR_HUB),a=o.useRef(null);o.useEffect(()=>()=>{a.current!==null&&clearTimeout(a.current)},[]);const p=!m&&!!t&&!l,d=o.useMemo(()=>!t||!e?null:e.os.name===r.MACOS?{text:r.MACOS,image:u[r.MACOS],link:t[r.MACOS]?.arm64||t[r.MACOS]?.amd64,arch:e.cpu.architecture}:t[e.os.name]?{text:e.os.name,image:u[e.os.name],link:t[e.os.name]?.[e.cpu.architecture],arch:e.cpu.architecture}:null,[e,t]),g=o.useMemo(()=>!t||!e?[]:Object.keys(t).filter(n=>n!==e.os.name).map(n=>{const i=t[n],c=Object.keys(i)[0];return{text:n,image:u[n],link:i?.[c],arch:c}}),[e,t]),f=o.useCallback(n=>{if(!n.link)return;a.current!==null&&(clearTimeout(a.current),a.current=null),O(n.link);const i=y(new URL(w,window.location.origin).toString(),"os",n.text),c=C(i,{arch:n.arch});a.current=setTimeout(()=>{window.location.href=c},D)},[]);return{isReady:p,primaryOption:d,secondaryOptions:g,handleDownload:f}}export{I as A,E as D,U as a,B as b,_ as c,j as u};
1
+ import{s,a as h,p as A,O as r,q as x,t as b}from"./index-DUmIu2EK.js";import{r as o}from"./vendor-router-D_36sTKu.js";import{t as O}from"./file-Cr_gl9BS.js";import{u as y,a as C}from"./url-BHzlJYXC.js";import{u as R,R as k}from"./useLatestGithubRelease-lPlpQBOj.js";const E=s("img")({width:"20px",height:"20px",filter:"brightness(0) invert(1)"}),I=s(h)({display:"flex",alignItems:"center",gap:"8px",marginTop:"8px",justifyContent:"center"}),U=s("span")({fontSize:"14px",color:"rgba(255, 255, 255, 0.7)"}),B=s("button")(({theme:l})=>({background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",outline:"none","&:focus-visible":{outline:`2px solid ${l.palette.primary.main}`,outlineOffset:2}})),_=s("img")({width:"20px",height:"20px",filter:"brightness(0) invert(1)"}),w="/download/creator-hub-success",D=3e3,u={[r.WINDOWS]:b,[r.MACOS]:x};function j(){const[l,e]=A(),{links:t,loading:m}=R(k.CREATOR_HUB),a=o.useRef(null);o.useEffect(()=>()=>{a.current!==null&&clearTimeout(a.current)},[]);const p=!m&&!!t&&!l,d=o.useMemo(()=>!t||!e?null:e.os.name===r.MACOS?{text:r.MACOS,image:u[r.MACOS],link:t[r.MACOS]?.arm64||t[r.MACOS]?.amd64,arch:e.cpu.architecture}:t[e.os.name]?{text:e.os.name,image:u[e.os.name],link:t[e.os.name]?.[e.cpu.architecture],arch:e.cpu.architecture}:null,[e,t]),g=o.useMemo(()=>!t||!e?[]:Object.keys(t).filter(n=>n!==e.os.name).map(n=>{const i=t[n],c=Object.keys(i)[0];return{text:n,image:u[n],link:i?.[c],arch:c}}),[e,t]),f=o.useCallback(n=>{if(!n.link)return;a.current!==null&&(clearTimeout(a.current),a.current=null),O(n.link);const i=y(new URL(w,window.location.origin).toString(),"os",n.text),c=C(i,{arch:n.arch});a.current=setTimeout(()=>{window.location.href=c},D)},[]);return{isReady:p,primaryOption:d,secondaryOptions:g,handleDownload:f}}export{I as A,E as D,U as a,B as b,_ as c,j as u};
@@ -1 +1 @@
1
- {"version":3,"file":"useCreatorHubDownload-TIbrehIm.js","sources":["../../src/components/Create/DownloadButtons.styled.ts","../../src/hooks/useCreatorHubDownload.ts"],"sourcesContent":["import { Box, styled } from 'decentraland-ui2'\n\nconst DownloadButtonImage = styled('img')({\n width: '20px',\n height: '20px',\n filter: 'brightness(0) invert(1)'\n})\n\nconst AlsoAvailableContainer = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n marginTop: '8px',\n justifyContent: 'center'\n})\n\nconst AlsoAvailableText = styled('span')({\n fontSize: '14px',\n color: 'rgba(255, 255, 255, 0.7)'\n})\n\nconst AlternativeIconButton = styled('button')(({ theme }) => ({\n background: 'none',\n border: 'none',\n cursor: 'pointer',\n padding: '4px',\n display: 'flex',\n alignItems: 'center',\n outline: 'none',\n ['&:focus-visible']: {\n outline: `2px solid ${theme.palette.primary.main}`,\n outlineOffset: 2\n }\n}))\n\nconst AlternativeButtonImage = styled('img')({\n width: '20px',\n height: '20px',\n filter: 'brightness(0) invert(1)'\n})\n\nexport { AlsoAvailableContainer, AlsoAvailableText, AlternativeButtonImage, AlternativeIconButton, DownloadButtonImage }\n","import { useCallback, useEffect, useMemo, useRef } from 'react'\nimport { useAdvancedUserAgentData } from '@dcl/hooks'\nimport appleLogo from '../images/apple-logo.svg'\nimport microsoftLogo from '../images/microsoft-logo.svg'\nimport { triggerFileDownload } from '../modules/file'\nimport { addQueryParamsToUrlString, updateUrlWithLastValue } from '../modules/url'\nimport { OperativeSystem } from '../types/download.types'\nimport type { Architecture } from '../types/download.types'\nimport { Repo, useLatestGithubRelease } from './useLatestGithubRelease'\n\nconst REDIRECT_PATH = '/download/creator-hub-success'\nconst REDIRECT_DELAY_MS = 3000\n\ntype DownloadOption = {\n text: string\n image: string\n link?: string\n arch?: Architecture\n}\n\nconst imageByOs: Record<string, string> = {\n [OperativeSystem.WINDOWS]: microsoftLogo,\n [OperativeSystem.MACOS]: appleLogo\n}\n\nfunction useCreatorHubDownload() {\n const [isLoadingUserAgentData, userAgentData] = useAdvancedUserAgentData()\n const { links, loading: isLoadingLinks } = useLatestGithubRelease(Repo.CREATOR_HUB)\n const redirectTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(() => {\n return () => {\n if (redirectTimerRef.current !== null) {\n clearTimeout(redirectTimerRef.current)\n }\n }\n }, [])\n\n const isReady = !isLoadingLinks && !!links && !isLoadingUserAgentData\n\n const primaryOption: DownloadOption | null = useMemo(() => {\n if (!links || !userAgentData) return null\n\n if (userAgentData.os.name === OperativeSystem.MACOS) {\n return {\n text: OperativeSystem.MACOS,\n image: imageByOs[OperativeSystem.MACOS],\n link: links[OperativeSystem.MACOS]?.arm64 || links[OperativeSystem.MACOS]?.amd64,\n arch: userAgentData.cpu.architecture as Architecture\n }\n }\n\n if (links[userAgentData.os.name]) {\n return {\n text: userAgentData.os.name,\n image: imageByOs[userAgentData.os.name],\n link: links[userAgentData.os.name]?.[userAgentData.cpu.architecture],\n arch: userAgentData.cpu.architecture as Architecture\n }\n }\n\n return null\n }, [userAgentData, links])\n\n const secondaryOptions: DownloadOption[] = useMemo(() => {\n if (!links || !userAgentData) return []\n\n return Object.keys(links)\n .filter(os => os !== userAgentData.os.name)\n .map(os => {\n const osLinks = links[os]\n const firstArch = Object.keys(osLinks)[0]\n return {\n text: os,\n image: imageByOs[os],\n link: osLinks?.[firstArch],\n arch: firstArch as Architecture\n }\n })\n }, [userAgentData, links])\n\n const handleDownload = useCallback((option: DownloadOption) => {\n if (!option.link) return\n\n if (redirectTimerRef.current !== null) {\n clearTimeout(redirectTimerRef.current)\n redirectTimerRef.current = null\n }\n\n triggerFileDownload(option.link)\n\n const redirectUrl = updateUrlWithLastValue(new URL(REDIRECT_PATH, window.location.origin).toString(), 'os', option.text)\n const finalUrl = addQueryParamsToUrlString(redirectUrl, { arch: option.arch })\n redirectTimerRef.current = setTimeout(() => {\n window.location.href = finalUrl\n }, REDIRECT_DELAY_MS)\n }, [])\n\n return { isReady, primaryOption, secondaryOptions, handleDownload }\n}\n\nexport { useCreatorHubDownload }\nexport type { DownloadOption }\n"],"names":["DownloadButtonImage","styled","AlsoAvailableContainer","Box","AlsoAvailableText","AlternativeIconButton","theme","AlternativeButtonImage","REDIRECT_PATH","REDIRECT_DELAY_MS","imageByOs","OperativeSystem","microsoftLogo","appleLogo","useCreatorHubDownload","isLoadingUserAgentData","userAgentData","useAdvancedUserAgentData","links","isLoadingLinks","useLatestGithubRelease","Repo","redirectTimerRef","useRef","useEffect","isReady","primaryOption","useMemo","secondaryOptions","os","osLinks","firstArch","handleDownload","useCallback","option","triggerFileDownload","redirectUr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version":3,"file":"useCreatorHubDownload-Dp_zMaiv.js","sources":["../../src/components/Create/DownloadButtons.styled.ts","../../src/hooks/useCreatorHubDownload.ts"],"sourcesContent":["import { Box, styled } from 'decentraland-ui2'\n\nconst DownloadButtonImage = styled('img')({\n width: '20px',\n height: '20px',\n filter: 'brightness(0) invert(1)'\n})\n\nconst AlsoAvailableContainer = styled(Box)({\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n marginTop: '8px',\n justifyContent: 'center'\n})\n\nconst AlsoAvailableText = styled('span')({\n fontSize: '14px',\n color: 'rgba(255, 255, 255, 0.7)'\n})\n\nconst AlternativeIconButton = styled('button')(({ theme }) => ({\n background: 'none',\n border: 'none',\n cursor: 'pointer',\n padding: '4px',\n display: 'flex',\n alignItems: 'center',\n outline: 'none',\n ['&:focus-visible']: {\n outline: `2px solid ${theme.palette.primary.main}`,\n outlineOffset: 2\n }\n}))\n\nconst AlternativeButtonImage = styled('img')({\n width: '20px',\n height: '20px',\n filter: 'brightness(0) invert(1)'\n})\n\nexport { AlsoAvailableContainer, AlsoAvailableText, AlternativeButtonImage, AlternativeIconButton, DownloadButtonImage }\n","import { useCallback, useEffect, useMemo, useRef } from 'react'\nimport { useAdvancedUserAgentData } from '@dcl/hooks'\nimport appleLogo from '../images/apple-logo.svg'\nimport microsoftLogo from '../images/microsoft-logo.svg'\nimport { triggerFileDownload } from '../modules/file'\nimport { addQueryParamsToUrlString, updateUrlWithLastValue } from '../modules/url'\nimport { OperativeSystem } from '../types/download.types'\nimport type { Architecture } from '../types/download.types'\nimport { Repo, useLatestGithubRelease } from './useLatestGithubRelease'\n\nconst REDIRECT_PATH = '/download/creator-hub-success'\nconst REDIRECT_DELAY_MS = 3000\n\ntype DownloadOption = {\n text: string\n image: string\n link?: string\n arch?: Architecture\n}\n\nconst imageByOs: Record<string, string> = {\n [OperativeSystem.WINDOWS]: microsoftLogo,\n [OperativeSystem.MACOS]: appleLogo\n}\n\nfunction useCreatorHubDownload() {\n const [isLoadingUserAgentData, userAgentData] = useAdvancedUserAgentData()\n const { links, loading: isLoadingLinks } = useLatestGithubRelease(Repo.CREATOR_HUB)\n const redirectTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(() => {\n return () => {\n if (redirectTimerRef.current !== null) {\n clearTimeout(redirectTimerRef.current)\n }\n }\n }, [])\n\n const isReady = !isLoadingLinks && !!links && !isLoadingUserAgentData\n\n const primaryOption: DownloadOption | null = useMemo(() => {\n if (!links || !userAgentData) return null\n\n if (userAgentData.os.name === OperativeSystem.MACOS) {\n return {\n text: OperativeSystem.MACOS,\n image: imageByOs[OperativeSystem.MACOS],\n link: links[OperativeSystem.MACOS]?.arm64 || links[OperativeSystem.MACOS]?.amd64,\n arch: userAgentData.cpu.architecture as Architecture\n }\n }\n\n if (links[userAgentData.os.name]) {\n return {\n text: userAgentData.os.name,\n image: imageByOs[userAgentData.os.name],\n link: links[userAgentData.os.name]?.[userAgentData.cpu.architecture],\n arch: userAgentData.cpu.architecture as Architecture\n }\n }\n\n return null\n }, [userAgentData, links])\n\n const secondaryOptions: DownloadOption[] = useMemo(() => {\n if (!links || !userAgentData) return []\n\n return Object.keys(links)\n .filter(os => os !== userAgentData.os.name)\n .map(os => {\n const osLinks = links[os]\n const firstArch = Object.keys(osLinks)[0]\n return {\n text: os,\n image: imageByOs[os],\n link: osLinks?.[firstArch],\n arch: firstArch as Architecture\n }\n })\n }, [userAgentData, links])\n\n const handleDownload = useCallback((option: DownloadOption) => {\n if (!option.link) return\n\n if (redirectTimerRef.current !== null) {\n clearTimeout(redirectTimerRef.current)\n redirectTimerRef.current = null\n }\n\n triggerFileDownload(option.link)\n\n const redirectUrl = updateUrlWithLastValue(new URL(REDIRECT_PATH, window.location.origin).toString(), 'os', option.text)\n const finalUrl = addQueryParamsToUrlString(redirectUrl, { arch: option.arch })\n redirectTimerRef.current = setTimeout(() => {\n window.location.href = finalUrl\n }, REDIRECT_DELAY_MS)\n }, [])\n\n return { isReady, primaryOption, secondaryOptions, handleDownload }\n}\n\nexport { useCreatorHubDownload }\nexport type { DownloadOption }\n"],"names":["DownloadButtonImage","styled","AlsoAvailableContainer","Box","AlsoAvailableText","AlternativeIconButton","theme","AlternativeButtonImage","REDIRECT_PATH","REDIRECT_DELAY_MS","imageByOs","OperativeSystem","microsoftLogo","appleLogo","useCreatorHubDownload","isLoadingUserAgentData","userAgentData","useAdvancedUserAgentData","links","isLoadingLinks","useLatestGithubRelease","Repo","redirectTimerRef","useRef","useEffect","isReady","primaryOption","useMemo","secondaryOptions","os","osLinks","firstArch","handleDownload","useCallback","option","triggerFileDownload","redirectUrl","updateUrlWithLastValue","finalUrl","addQueryParamsToUrlString"],"mappings":"0QAEA,MAAMA,EAAsBC,EAAO,KAAK,EAAE,CACxC,MAAO,OACP,OAAQ,OACR,OAAQ,yBACV,CAAC,EAEKC,EAAyBD,EAAOE,CAAG,EAAE,CACzC,QAAS,OACT,WAAY,SACZ,IAAK,MACL,UAAW,MACX,eAAgB,QAClB,CAAC,EAEKC,EAAoBH,EAAO,MAAM,EAAE,CACvC,SAAU,OACV,MAAO,0BACT,CAAC,EAEKI,EAAwBJ,EAAO,QAAQ,EAAE,CAAC,CAAE,MAAAK,MAAa,CAC7D,WAAY,OACZ,OAAQ,OACR,OAAQ,UACR,QAAS,MACT,QAAS,OACT,WAAY,SACZ,QAAS,OACR,kBAAoB,CACnB,QAAS,aAAaA,EAAM,QAAQ,QAAQ,IAAI,GAChD,cAAe,CAAA,CAEnB,EAAE,EAEIC,EAAyBN,EAAO,KAAK,EAAE,CAC3C,MAAO,OACP,OAAQ,OACR,OAAQ,yBACV,CAAC,EC7BKO,EAAgB,gCAChBC,EAAoB,IASpBC,EAAoC,CACxC,CAACC,EAAgB,OAAO,EAAGC,EAC3B,CAACD,EAAgB,KAAK,EAAGE,CAC3B,EAEA,SAASC,GAAwB,CAC/B,KAAM,CAACC,EAAwBC,CAAa,EAAIC,EAAA,EAC1C,CAAE,MAAAC,EAAO,QAASC,GAAm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ba,EAAoBD,EAAO,IAAI,EAE/B,MAAME,EAAcC,EAAuB,IAAI,IAAI7B,EAAe,OAAO,SAAS,MAAM,EAAE,SAAA,EAAY,KAAM0B,EAAO,IAAI,EACjHI,EAAWC,EAA0BH,EAAa,CAAE,KAAMF,EAAO,KAAM,EAC7EZ,EAAiB,QAAU,WAAW,IAAM,CAC1C,OAAO,SAAS,KAAOgB,CACzB,EAAG7B,CAAiB,CACtB,EAAG,CAAA,CAAE,EAEL,MAAO,CAAE,QAAAgB,EAAS,cAAAC,EAAe,iBAAAE,EAAkB,eAAAI,CAAA,CACrD"}
@@ -1 +1 @@
1
- import{s as r,a as g,j as t,v as E,X as I}from"./index-D0nE3AYE.js";import{r as a,L as B}from"./vendor-router-D_36sTKu.js";import{C as D,M,D as H,a as A,P as j}from"./PostCard-CoBBQR_z.js";import{S as u}from"./Skeleton-Bp_3tZG7.js";import"./vendor-ua-D7qqAxdq.js";import{g as _}from"./BlogLayout-CxiSrxYR.js";const F=({onLoadMore:e,hasMore:n,isLoading:o,threshold:s=500,debounceMs:p=500})=>{const d=a.useRef(e),i=a.useRef(0);a.useEffect(()=>{d.current=e},[e]),a.useEffect(()=>{const c=()=>{const f=Date.now();if(f-i.current<p)return;const l=document.documentElement.scrollHeight,m=document.documentElement.scrollTop,h=document.documentElement.clientHeight;l-(m+h)<s&&n&&!o&&(i.current=f,d.current())};window.addEventListener("scroll",c,{passive:!0});const x=setTimeout(c,500);return()=>{window.removeEventListener("scroll",c),clearTimeout(x)}},[n,o,s,p])},S=r(g)(()=>({width:"100%",margin:"0 40px 40px 0",position:"relative",display:"flex",justifyContent:"space-between","@media (max-width: 1096px)":{display:"none"}})),O=r("img")(()=>({objectFit:"cover",boxShadow:"0 2px 4px 0 rgba(0, 0, 0, 0.16)",borderRadius:"5px",width:"697px",height:"349px",marginRight:"31px",transition:"transform 250ms ease, box-shadow 250ms ease"})),P=r(g)({width:"335px"}),W=r(B)(({theme:e})=>({textDecoration:"none",display:"block",color:e.palette.text.primary,"& h2, & h3":{fontSize:"34px",lineHeight:"42px",color:e.palette.text.primary,fontWeight:500},"&:visited, &:link, &:active":{color:e.palette.text.primary},"& *":{color:e.palette.text.primary}})),$=r("p")(({theme:e})=>({display:"block",fontSize:"17px",lineHeight:"26px",letterSpacing:"-0.4px",margin:0,paddingTop:"8px",fontWeight:400,color:e.palette.text.primary})),z=r(g)(()=>({display:"flex",justifyContent:"space-between"})),Q=r(u)(()=>({width:"697px",height:"348px"})),G=r(u)(()=>({width:"100%",height:"40px"})),N=r(u)(()=>({width:"90%",height:"40px"})),k=r(u)(()=>({width:"100px"})),y=r(u)(()=>({width:"100%"})),X=r(u)(()=>({width:"80%"})),q=r(g)(({theme:e})=>({marginTop:e.spacing(2)})),C=e=>{const{post:n,loading:o}=e;return o?t.jsxs(S,{children:[t.jsx(Q,{variant:"rectangular"}),t.jsxs(P,{children:[t.jsxs(z,{children:[t.jsx(k,{variant:"text"}),t.jsx(k,{variant:"text"})]}),t.jsx(G,{variant:"text"}),t.jsx(N,{variant:"text"}),t.jsxs(q,{children:[t.jsx(y,{variant:"text"}),t.jsx(y,{variant:"text"}),t.jsx(y,{variant:"text"}),t.jsx(X,{variant:"text"})]})]})]}):n?t.jsxs(S,{children:[t.jsx(D,{to:n.url,children:t.jsx(O,{src:n.image.url,alt:n.title,width:697,height:349,fetchPriority:"high",decoding:"async"})}),t.jsxs(P,{children:[t.jsxs(M,{children:[t.jsx(H,{children:n.publishedDate}),t.jsx("span",{children:t.jsx(A,{to:n.category.url,children:n.category.title})})]}),t.jsx(W,{to:n.url,children:t.jsx(E,{variant:"h3",component:"h2",children:n.title})}),t.jsx($,{children:n.description})]})]}):null},T=r(g,{shouldForwardProp:e=>e!=="hasMainPost"})(({theme:e,hasMainPost:n})=>({display:"flex",flexWrap:"wrap",justifyContent:"flex-start",paddingBottom:e.spacing(2.5),"& > div:nth-of-type(3n)":{marginRight:e.spacing(4)},...n&&{"& > div:nth-of-type(3n + 1)":{marginRight:0}},...!n&&{"& > div:nth-of-type(3n + 3)":{marginRight:0}},"@media (max-width: 1096px)":{justifyContent:"space-between","& > div, & > div:nth-of-type(3n)":{marginRight:0}}})),w=e=>"isPlaceholder"in e&&e.isPlaceholder===!0,nt=a.memo(e=>{const{posts:n,loading:o,hasMainPost:s=!1}=e,p=I("(min-width: 1096px)");if(o&&n.length===0){const i=s?7:6;return t.jsxs(T,{hasMainPost:s,children:[s&&t.jsx(C,{loading:!0}),Array.from(Array(i),(c,x)=>s&&x===0?null:t.jsx(j,{loading:!0},`skeleton-${x}`))]})}if(!n||n.length===0)return null;const d=n.find(i=>!w(i));return t.jsxs(T,{hasMainPost:s,children:[s&&p&&d&&t.jsx(C,{post:d}),n.map(i=>s&&p&&!w(i)&&i===d?null:w(i)?t.jsx(j,{loading:!0},i.id):t.jsx(j,{post:i},i.id))]})}),J=7,R=6,K=(e,n)=>Array.from({length:e},(o,s)=>({id:`placeholder-${n}-${s}`,isPlaceholder:!0}));function it({category:e,author:n}={}){const[o,s]=a.useState(0),[p,d]=a.useState(!1),i=a.useRef(0),{data:c,isLoading:x,error:f,isFetching:l}=_({category:e,author:n,limit:o===0?J:R,skip:o}),m=a.useMemo(()=>{const L=c?.posts??[];return p&&l?[...L,...K(R,i.current)]:L},[c?.posts,p,l]),h=c?.hasMore??!0,v=x&&o===0;a.useEffect(()=>{s(0),d(!1),i.current=0},[e,n]),a.useEffect(()=>{l&&o>0?(i.current+=1,d(!0)):l||d(!1)},[l,o]);const b=a.useCallback(()=>{l||!h||!c||s(c.nextCmsSkip)},[l,h,c]);return F({onLoadMore:b,hasMore:h,isLoading:l}),{posts:m,isLoading:x,isLoadingInitial:v,isFetching:l,hasMore:h,error:f}}export{nt as P,it as u};
1
+ import{s as r,a as g,j as t,v as E,X as I}from"./index-DUmIu2EK.js";import{r as a,L as B}from"./vendor-router-D_36sTKu.js";import{C as D,M,D as H,a as A,P as j}from"./PostCard-Zsk0_WYz.js";import{S as u}from"./Skeleton-BP1Os8gY.js";import"./vendor-ua-D7qqAxdq.js";import{g as _}from"./BlogLayout-Bl9FID_L.js";const F=({onLoadMore:e,hasMore:n,isLoading:o,threshold:s=500,debounceMs:p=500})=>{const d=a.useRef(e),i=a.useRef(0);a.useEffect(()=>{d.current=e},[e]),a.useEffect(()=>{const c=()=>{const f=Date.now();if(f-i.current<p)return;const l=document.documentElement.scrollHeight,m=document.documentElement.scrollTop,h=document.documentElement.clientHeight;l-(m+h)<s&&n&&!o&&(i.current=f,d.current())};window.addEventListener("scroll",c,{passive:!0});const x=setTimeout(c,500);return()=>{window.removeEventListener("scroll",c),clearTimeout(x)}},[n,o,s,p])},S=r(g)(()=>({width:"100%",margin:"0 40px 40px 0",position:"relative",display:"flex",justifyContent:"space-between","@media (max-width: 1096px)":{display:"none"}})),O=r("img")(()=>({objectFit:"cover",boxShadow:"0 2px 4px 0 rgba(0, 0, 0, 0.16)",borderRadius:"5px",width:"697px",height:"349px",marginRight:"31px",transition:"transform 250ms ease, box-shadow 250ms ease"})),P=r(g)({width:"335px"}),W=r(B)(({theme:e})=>({textDecoration:"none",display:"block",color:e.palette.text.primary,"& h2, & h3":{fontSize:"34px",lineHeight:"42px",color:e.palette.text.primary,fontWeight:500},"&:visited, &:link, &:active":{color:e.palette.text.primary},"& *":{color:e.palette.text.primary}})),$=r("p")(({theme:e})=>({display:"block",fontSize:"17px",lineHeight:"26px",letterSpacing:"-0.4px",margin:0,paddingTop:"8px",fontWeight:400,color:e.palette.text.primary})),z=r(g)(()=>({display:"flex",justifyContent:"space-between"})),Q=r(u)(()=>({width:"697px",height:"348px"})),G=r(u)(()=>({width:"100%",height:"40px"})),N=r(u)(()=>({width:"90%",height:"40px"})),k=r(u)(()=>({width:"100px"})),y=r(u)(()=>({width:"100%"})),X=r(u)(()=>({width:"80%"})),q=r(g)(({theme:e})=>({marginTop:e.spacing(2)})),C=e=>{const{post:n,loading:o}=e;return o?t.jsxs(S,{children:[t.jsx(Q,{variant:"rectangular"}),t.jsxs(P,{children:[t.jsxs(z,{children:[t.jsx(k,{variant:"text"}),t.jsx(k,{variant:"text"})]}),t.jsx(G,{variant:"text"}),t.jsx(N,{variant:"text"}),t.jsxs(q,{children:[t.jsx(y,{variant:"text"}),t.jsx(y,{variant:"text"}),t.jsx(y,{variant:"text"}),t.jsx(X,{variant:"text"})]})]})]}):n?t.jsxs(S,{children:[t.jsx(D,{to:n.url,children:t.jsx(O,{src:n.image.url,alt:n.title,width:697,height:349,fetchPriority:"high",decoding:"async"})}),t.jsxs(P,{children:[t.jsxs(M,{children:[t.jsx(H,{children:n.publishedDate}),t.jsx("span",{children:t.jsx(A,{to:n.category.url,children:n.category.title})})]}),t.jsx(W,{to:n.url,children:t.jsx(E,{variant:"h3",component:"h2",children:n.title})}),t.jsx($,{children:n.description})]})]}):null},T=r(g,{shouldForwardProp:e=>e!=="hasMainPost"})(({theme:e,hasMainPost:n})=>({display:"flex",flexWrap:"wrap",justifyContent:"flex-start",paddingBottom:e.spacing(2.5),"& > div:nth-of-type(3n)":{marginRight:e.spacing(4)},...n&&{"& > div:nth-of-type(3n + 1)":{marginRight:0}},...!n&&{"& > div:nth-of-type(3n + 3)":{marginRight:0}},"@media (max-width: 1096px)":{justifyContent:"space-between","& > div, & > div:nth-of-type(3n)":{marginRight:0}}})),w=e=>"isPlaceholder"in e&&e.isPlaceholder===!0,nt=a.memo(e=>{const{posts:n,loading:o,hasMainPost:s=!1}=e,p=I("(min-width: 1096px)");if(o&&n.length===0){const i=s?7:6;return t.jsxs(T,{hasMainPost:s,children:[s&&t.jsx(C,{loading:!0}),Array.from(Array(i),(c,x)=>s&&x===0?null:t.jsx(j,{loading:!0},`skeleton-${x}`))]})}if(!n||n.length===0)return null;const d=n.find(i=>!w(i));return t.jsxs(T,{hasMainPost:s,children:[s&&p&&d&&t.jsx(C,{post:d}),n.map(i=>s&&p&&!w(i)&&i===d?null:w(i)?t.jsx(j,{loading:!0},i.id):t.jsx(j,{post:i},i.id))]})}),J=7,R=6,K=(e,n)=>Array.from({length:e},(o,s)=>({id:`placeholder-${n}-${s}`,isPlaceholder:!0}));function it({category:e,author:n}={}){const[o,s]=a.useState(0),[p,d]=a.useState(!1),i=a.useRef(0),{data:c,isLoading:x,error:f,isFetching:l}=_({category:e,author:n,limit:o===0?J:R,skip:o}),m=a.useMemo(()=>{const L=c?.posts??[];return p&&l?[...L,...K(R,i.current)]:L},[c?.posts,p,l]),h=c?.hasMore??!0,v=x&&o===0;a.useEffect(()=>{s(0),d(!1),i.current=0},[e,n]),a.useEffect(()=>{l&&o>0?(i.current+=1,d(!0)):l||d(!1)},[l,o]);const b=a.useCallback(()=>{l||!h||!c||s(c.nextCmsSkip)},[l,h,c]);return F({onLoadMore:b,hasMore:h,isLoading:l}),{posts:m,isLoading:x,isLoadingInitial:v,isFetching:l,hasMore:h,error:f}}export{nt as P,it as u};
@@ -1 +1 @@
1
- {"version":3,"file":"useInfiniteBlogPosts-DKtXiohd.js","sources":["../../node_modules/@dcl/hooks/esm/hooks/useInfiniteScroll.js","../../src/components/blog/MainPostCard/MainPostCard.styled.ts","../../src/components/blog/MainPostCard/MainPostCard.tsx","../../src/components/blog/PostList/PostList.styled.ts","../../src/components/blog/PostList/PostList.tsx","../../src/features/blog/useInfiniteBlogPosts.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n/**\n * Hook to implement infinite scroll functionality\n * Triggers onLoadMore callback when user scrolls near the bottom of the page\n * @param options - Configuration options for infinite scroll\n * @param options.onLoadMore - Callback to trigger when user scrolls near the end\n * @param options.hasMore - Whether more data is available to load\n * @param options.isLoading - Whether data is currently loading\n * @param options.threshold - Distance from bottom (in pixels) to trigger load. Default: 500\n * @param options.debounceMs - Minimum time (in milliseconds) between triggers to prevent multiple calls. Default: 500\n */\nconst useInfiniteScroll = ({ onLoadMore, hasMore, isLoading, threshold = 500, debounceMs = 500, }) => {\n const onLoadMoreRef = useRef(onLoadMore);\n const lastTriggerRef = useRef(0);\n useEffect(() => {\n onLoadMoreRef.current = onLoadMore;\n }, [onLoadMore]);\n useEffect(() => {\n const handleScroll = () => {\n const now = Date.now();\n if (now - lastTriggerRef.current < debounceMs) {\n return;\n }\n const scrollHeight = document.documentElement.scrollHeight;\n const scrollTop = document.documentElement.scrollTop;\n const clientHeight = document.documentElement.clientHeight;\n const distanceFromBottom = scrollHeight - (scrollTop + clientHeight);\n if (distanceFromBottom < threshold && hasMore && !isLoading) {\n lastTriggerRef.current = now;\n onLoadMoreRef.current();\n }\n };\n window.addEventListener(\"scroll\", handleScroll, { passive: true });\n const timeoutId = setTimeout(handleScroll, 500);\n return () => {\n window.removeEventListener(\"scroll\", handleScroll);\n clearTimeout(timeoutId);\n };\n }, [hasMore, isLoading, threshold, debounceMs]);\n};\nexport { useInfiniteScroll };\n//# sourceMappingURL=useInfiniteScroll.js.map","/* eslint-disable @typescript-eslint/naming-convention */\nimport { Link } from 'react-router-dom'\nimport { Box, Skeleton, styled } from 'decentraland-ui2'\nimport { CardImageLink, CategoryLink, DateText, MetaBox } from '../shared/PostCard.styled'\n\nconst CardContainer = styled(Box)(() => ({\n width: '100%',\n margin: '0 40px 40px 0',\n position: 'relative',\n display: 'flex',\n justifyContent: 'space-between',\n '@media (max-width: 1096px)': {\n display: 'none'\n }\n}))\n\nconst CardImage = styled('img')(() => ({\n objectFit: 'cover',\n boxShadow: '0 2px 4px 0 rgba(0, 0, 0, 0.16)',\n borderRadius: '5px',\n width: '697px',\n height: '349px',\n marginRight: '31px',\n transition: 'transform 250ms ease, box-shadow 250ms ease'\n}))\n\nconst CardInfo = styled(Box)({\n width: '335px'\n})\n\nconst TitleLink = styled(Link)(({ theme }) => ({\n textDecoration: 'none',\n display: 'block',\n color: theme.palette.text.primary,\n '& h2, & h3': {\n fontSize: '34px',\n lineHeight: '42px',\n color: theme.palette.text.primary,\n fontWeight: 500\n },\n '&:visited, &:link, &:active': {\n color: theme.palette.text.primary\n },\n '& *': {\n color: theme.palette.text.primary\n }\n}))\n\nconst Description = styled('p')(({ theme }) => ({\n display: 'block',\n fontSize: '17px',\n lineHeight: '26px',\n letterSpacing: '-0.4px',\n margin: 0,\n paddingTop: '8px',\n fontWeight: 400,\n color: theme.palette.text.primary\n}))\n\nconst LoadingHeader = styled(Box)(() => ({\n display: 'flex',\n justifyContent: 'space-between'\n}))\n\nconst LoadingImage = styled(Skeleton)(() => ({\n width: '697px',\n height: '348px'\n}))\n\nconst LoadingTitleLine = styled(Skeleton)(() => ({\n width: '100%',\n height: '40px'\n}))\n\nconst LoadingTitleLineShort = styled(Skeleton)(() => ({\n width: '90%',\n height: '40px'\n}))\n\nconst LoadingMetaSkeleton = styled(Skeleton)(() => ({\n width: '100px'\n}))\n\nconst LoadingTextSkeleton = styled(Skeleton)(() => ({\n width: '100%'\n}))\n\nconst LoadingTextSkeletonShort = styled(Skeleton)(() => ({\n width: '80%'\n}))\n\nconst LoadingContentBox = styled(Box)(({ theme }) => ({\n marginTop: theme.spacing(2)\n}))\n\nexport {\n CardContainer,\n CardImage,\n CardImageLink,\n CardInfo,\n CategoryLink,\n DateText,\n Description,\n LoadingContentBox,\n LoadingHeader,\n LoadingImage,\n LoadingMetaSkeleton,\n LoadingTextSkeleton,\n LoadingTextSkeletonShort,\n LoadingTitleLine,\n LoadingTitleLineShort,\n MetaBox,\n TitleLink\n}\n","import { Typography } from 'decentraland-ui2'\nimport type { MainPostCardProps } from './MainPostCard.types'\nimport {\n CardContainer,\n CardImage,\n CardImageLink,\n CardInfo,\n CategoryLink,\n DateText,\n Description,\n LoadingContentBox,\n LoadingHeader,\n LoadingImage,\n LoadingMetaSkeleton,\n LoadingTextSkeleton,\n LoadingTextSkeletonShort,\n LoadingTitleLine,\n LoadingTitleLineShort,\n MetaBox,\n TitleLink\n} from './MainPostCard.styled'\n\nconst MainPostCard = (props: MainPostCardProps) => {\n const { post, loading } = props\n\n if (loading) {\n return (\n <CardContainer>\n <LoadingImage variant=\"rectangular\" />\n <CardInfo>\n <LoadingHeader>\n <LoadingMetaSkeleton variant=\"text\" />\n <LoadingMetaSkeleton variant=\"text\" />\n </LoadingHeader>\n <LoadingTitleLine variant=\"text\" />\n <LoadingTitleLineShort variant=\"text\" />\n <LoadingContentBox>\n <LoadingTextSkeleton variant=\"text\" />\n <LoadingTextSkeleton variant=\"text\" />\n <LoadingTextSkeleton variant=\"text\" />\n <LoadingTextSkeletonShort variant=\"text\" />\n </LoadingContentBox>\n </CardInfo>\n </CardContainer>\n )\n }\n\n if (!post) return null\n\n return (\n <CardContainer>\n <CardImageLink to={post.url}>\n <CardImage src={post.image.url} alt={post.title} width={697} height={349} fetchPriority=\"high\" decoding=\"async\" />\n </CardImageLink>\n <CardInfo>\n <MetaBox>\n <DateText>{post.publishedDate}</DateText>\n <span>\n <CategoryLink to={post.category.url}>{post.category.title}</CategoryLink>\n </span>\n </MetaBox>\n <TitleLink to={post.url}>\n <Typography variant=\"h3\" component=\"h2\">\n {post.title}\n </Typography>\n </TitleLink>\n <Description>{post.description}</Description>\n </CardInfo>\n </CardContainer>\n )\n}\n\nexport { MainPostCard }\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { Box, styled } from 'decentraland-ui2'\n\nconst PostListWrapper = styled(Box, { shouldForwardProp: prop => prop !== 'hasMainPost' })<{ hasMainPost: boolean }>(\n ({ theme, hasMainPost }) => ({\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n paddingBottom: theme.spacing(2.5),\n '& > div:nth-of-type(3n)': {\n marginRight: theme.spacing(4)\n },\n ...(hasMainPost && {\n '& > div:nth-of-type(3n + 1)': {\n marginRight: 0\n }\n }),\n ...(!hasMainPost && {\n '& > div:nth-of-type(3n + 3)': {\n marginRight: 0\n }\n }),\n '@media (max-width: 1096px)': {\n justifyContent: 'space-between',\n '& > div, & > div:nth-of-type(3n)': {\n marginRight: 0\n }\n }\n })\n)\n\nexport { PostListWrapper }\n","import { memo } from 'react'\nimport { useMediaQuery } from 'decentraland-ui2'\nimport type { BlogPost } from '../../../shared/blog/types/blog.domain'\nimport { MainPostCard } from '../MainPostCard'\nimport { PostCard } from '../PostCard'\nimport type { PostListProps } from './PostList.types'\nimport { PostListWrapper } from './PostList.styled'\n\n// Type guard to check if a post is a placeholder\nconst isPlaceholder = (post: { id: string; isPlaceholder?: boolean }): post is { id: string; isPlaceholder: true } => {\n return 'isPlaceholder' in post && post.isPlaceholder === true\n}\n\nconst PostList = memo((props: PostListProps) => {\n const { posts, loading, hasMainPost = false } = props\n const isBigScreen = useMediaQuery('(min-width: 1096px)')\n\n // Initial loading with no posts at all\n if (loading && posts.length === 0) {\n const count = hasMainPost ? 7 : 6\n\n return (\n <PostListWrapper hasMainPost={hasMainPost}>\n {hasMainPost && <MainPostCard loading />}\n {Array.from(Array(count), (_, index) => {\n if (hasMainPost && index === 0) {\n return null // MainPostCard already rendered\n }\n return <PostCard key={`skeleton-${index}`} loading />\n })}\n </PostListWrapper>\n )\n }\n\n if (!posts || posts.length === 0) {\n return null\n }\n\n // Get first real post for MainPostCard (if applicable)\n const firstRealPost = posts.find(p => !isPlaceholder(p)) as BlogPost | undefined\n\n return (\n <PostListWrapper hasMainPost={hasMainPost}>\n {hasMainPost && isBigScreen && firstRealPost && <MainPostCard post={firstRealPost} />}\n {posts.map(post => {\n // Skip the first real post if we're showing it as MainPostCard\n if (hasMainPost && isBigScreen && !isPlaceholder(post) && post === firstRealPost) {\n return null\n }\n\n // Render placeholder as loading skeleton\n if (isPlaceholder(post)) {\n return <PostCard key={post.id} loading />\n }\n\n return <PostCard key={post.id} post={post} />\n })}\n </PostListWrapper>\n )\n})\n\nexport { PostList }\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { useInfiniteScroll } from '@dcl/hooks'\nimport type { PostOrPlaceholder } from '../../shared/blog/types/blog.domain'\nimport { useGetBlogPostsQuery } from './blog.client'\n\nconst POSTS_INITIAL_LOAD = 7\nconst POSTS_PER_LOAD = 6\n\ninterface UseInfiniteBlogPostsParams {\n category?: string\n author?: string\n}\n\ninterface UseInfiniteBlogPostsResult {\n posts: PostOrPlaceholder[]\n isLoading: boolean\n isLoadingInitial: boolean\n isFetching: boolean\n hasMore: boolean\n error: unknown\n}\n\n// Helper to create placeholder posts\nconst createPlaceholders = (count: number, batchId: number): PostOrPlaceholder[] => {\n return Array.from({ length: count }, (_, i) => ({\n id: `placeholder-${batchId}-${i}`,\n isPlaceholder: true as const\n }))\n}\n\nfunction useInfiniteBlogPosts({ category, author }: UseInfiniteBlogPostsParams = {}): UseInfiniteBlogPostsResult {\n const [currentSkip, setCurrentSkip] = useState(0)\n const [showPlaceholders, setShowPlaceholders] = useState(false)\n const batchIdRef = useRef(0)\n\n // Use RTK Query with pagination - cache handles accumulation via merge\n // Backend handles category/author filtering, so we request real page sizes\n const { data, isLoading, error, isFetching } = useGetBlogPostsQuery({\n category,\n author,\n limit: currentSkip === 0 ? POSTS_INITIAL_LOAD : POSTS_PER_LOAD,\n skip: currentSkip\n })\n\n // Build display posts: cached posts + placeholders when loading more\n const displayPosts = useMemo<PostOrPlaceholder[]>(() => {\n const posts = data?.posts ?? []\n if (showPlaceholders && isFetching) {\n return [...posts, ...createPlaceholders(POSTS_PER_LOAD, batchIdRef.current)]\n }\n return posts\n }, [data?.posts, showPlaceholders, isFetching])\n\n const hasMore = data?.hasMore ?? true\n const isLoadingInitial = isLoading && currentSkip === 0\n\n // Reset skip when filters change\n useEffect(() => {\n setCurrentSkip(0)\n setShowPlaceholders(false)\n batchIdRef.current = 0\n }, [category, author])\n\n // Show placeholders when fetching more (not initial)\n useEffect(() => {\n if (isFetching && currentSkip > 0) {\n batchIdRef.current += 1\n setShowPlaceholders(true)\n } else if (!isFetching) {\n setShowPlaceholders(false)\n }\n }, [isFetching, currentSkip])\n\n // Load more function - use nextCmsSkip to properly paginate\n const loadMore = useCallback(() => {\n if (isFetching || !hasMore || !data) {\n return\n }\n // Use the CMS-level skip for proper pagination\n setCurrentSkip(data.nextCmsSkip)\n }, [isFetching, hasMore, data])\n\n // Use @dcl/hooks infinite scroll\n useInfiniteScroll({\n onLoadMore: loadMore,\n hasMore,\n isLoading: isFetching\n })\n\n return {\n posts: displayPosts,\n isLoading,\n isLoadingInitial,\n isFetching,\n hasMore,\n error\n }\n}\n\nexport { useInfiniteBlogPosts, type UseInfiniteBlogPostsParams, type UseInfiniteBlogPostsResult }\n"],"names":["useInfiniteScroll","onLoadMore","hasMore","isLoading","threshold","debounceMs","onLoadMoreRef","useRef","lastTriggerRef","useEffect","handleScroll","now","scrollHeight","scrollTop","clientHeight","timeoutId","CardContainer","styled","Box","CardImage","CardInfo","TitleLink","Link","theme","Description","LoadingHeader","LoadingImage","Skeleton","LoadingTitleLine","LoadingTitleLineShort","LoadingMetaSkeleton","LoadingTextSkeleton","LoadingTextSkeletonShort","LoadingContentBox","MainPostCard","props","post","loading","jsx","jsxs","CardImageLink","MetaBox","DateText","CategoryLink","Typography","PostListWrapper","prop","hasMainPost","isPlaceholder","PostList","memo","posts","isBigScreen","useMediaQuery","count","_","index","PostCard","firstRealPost","p","POSTS_INITIAL_LOAD","POSTS_PER_LOAD","createPlaceholders","batchId","i","useInfiniteBlogPosts","category","author","currentSkip","setCurrentSkip","useState","showPlaceholders","setShowPlaceholders","batchIdRef","data","error","isFetching","useGetBlogPostsQuery","displayPosts","useMemo","isLoadingInitial","loadMore","useCallback"],"mappings":"qTAWA,MAAMA,EAAoB,CAAC,CAAE,WAAAC,EAAY,QAAAC,EAAS,UAAAC,EAAW,UAAAC,EAAY,IAAK,WAAAC,EAAa,OAAW,CAClG,MAAMC,EAAgBC,EAAAA,OAAON,CAAU,EACjCO,EAAiBD,EAAAA,OAAO,CAAC,EAC/BE,EAAAA,UAAU,IAAM,CACZH,EAAc,QAAUL,CAC5B,EAAG,CAACA,CAAU,CAAC,EACfQ,EAAAA,UAAU,IAAM,CACZ,MAAMC,EAAe,IAAM,CACvB,MAAMC,EAAM,KAAK,IAAG,EACpB,GAAIA,EAAMH,EAAe,QAAUH,EAC/B,OAEJ,MAAMO,EAAe,SAAS,gBAAgB,aACxC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A,QAAA1E,EACA,MAAAyE,CAAA,CAEJ","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"useInfiniteBlogPosts-B9Mv_Fup.js","sources":["../../node_modules/@dcl/hooks/esm/hooks/useInfiniteScroll.js","../../src/components/blog/MainPostCard/MainPostCard.styled.ts","../../src/components/blog/MainPostCard/MainPostCard.tsx","../../src/components/blog/PostList/PostList.styled.ts","../../src/components/blog/PostList/PostList.tsx","../../src/features/blog/useInfiniteBlogPosts.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n/**\n * Hook to implement infinite scroll functionality\n * Triggers onLoadMore callback when user scrolls near the bottom of the page\n * @param options - Configuration options for infinite scroll\n * @param options.onLoadMore - Callback to trigger when user scrolls near the end\n * @param options.hasMore - Whether more data is available to load\n * @param options.isLoading - Whether data is currently loading\n * @param options.threshold - Distance from bottom (in pixels) to trigger load. Default: 500\n * @param options.debounceMs - Minimum time (in milliseconds) between triggers to prevent multiple calls. Default: 500\n */\nconst useInfiniteScroll = ({ onLoadMore, hasMore, isLoading, threshold = 500, debounceMs = 500, }) => {\n const onLoadMoreRef = useRef(onLoadMore);\n const lastTriggerRef = useRef(0);\n useEffect(() => {\n onLoadMoreRef.current = onLoadMore;\n }, [onLoadMore]);\n useEffect(() => {\n const handleScroll = () => {\n const now = Date.now();\n if (now - lastTriggerRef.current < debounceMs) {\n return;\n }\n const scrollHeight = document.documentElement.scrollHeight;\n const scrollTop = document.documentElement.scrollTop;\n const clientHeight = document.documentElement.clientHeight;\n const distanceFromBottom = scrollHeight - (scrollTop + clientHeight);\n if (distanceFromBottom < threshold && hasMore && !isLoading) {\n lastTriggerRef.current = now;\n onLoadMoreRef.current();\n }\n };\n window.addEventListener(\"scroll\", handleScroll, { passive: true });\n const timeoutId = setTimeout(handleScroll, 500);\n return () => {\n window.removeEventListener(\"scroll\", handleScroll);\n clearTimeout(timeoutId);\n };\n }, [hasMore, isLoading, threshold, debounceMs]);\n};\nexport { useInfiniteScroll };\n//# sourceMappingURL=useInfiniteScroll.js.map","/* eslint-disable @typescript-eslint/naming-convention */\nimport { Link } from 'react-router-dom'\nimport { Box, Skeleton, styled } from 'decentraland-ui2'\nimport { CardImageLink, CategoryLink, DateText, MetaBox } from '../shared/PostCard.styled'\n\nconst CardContainer = styled(Box)(() => ({\n width: '100%',\n margin: '0 40px 40px 0',\n position: 'relative',\n display: 'flex',\n justifyContent: 'space-between',\n '@media (max-width: 1096px)': {\n display: 'none'\n }\n}))\n\nconst CardImage = styled('img')(() => ({\n objectFit: 'cover',\n boxShadow: '0 2px 4px 0 rgba(0, 0, 0, 0.16)',\n borderRadius: '5px',\n width: '697px',\n height: '349px',\n marginRight: '31px',\n transition: 'transform 250ms ease, box-shadow 250ms ease'\n}))\n\nconst CardInfo = styled(Box)({\n width: '335px'\n})\n\nconst TitleLink = styled(Link)(({ theme }) => ({\n textDecoration: 'none',\n display: 'block',\n color: theme.palette.text.primary,\n '& h2, & h3': {\n fontSize: '34px',\n lineHeight: '42px',\n color: theme.palette.text.primary,\n fontWeight: 500\n },\n '&:visited, &:link, &:active': {\n color: theme.palette.text.primary\n },\n '& *': {\n color: theme.palette.text.primary\n }\n}))\n\nconst Description = styled('p')(({ theme }) => ({\n display: 'block',\n fontSize: '17px',\n lineHeight: '26px',\n letterSpacing: '-0.4px',\n margin: 0,\n paddingTop: '8px',\n fontWeight: 400,\n color: theme.palette.text.primary\n}))\n\nconst LoadingHeader = styled(Box)(() => ({\n display: 'flex',\n justifyContent: 'space-between'\n}))\n\nconst LoadingImage = styled(Skeleton)(() => ({\n width: '697px',\n height: '348px'\n}))\n\nconst LoadingTitleLine = styled(Skeleton)(() => ({\n width: '100%',\n height: '40px'\n}))\n\nconst LoadingTitleLineShort = styled(Skeleton)(() => ({\n width: '90%',\n height: '40px'\n}))\n\nconst LoadingMetaSkeleton = styled(Skeleton)(() => ({\n width: '100px'\n}))\n\nconst LoadingTextSkeleton = styled(Skeleton)(() => ({\n width: '100%'\n}))\n\nconst LoadingTextSkeletonShort = styled(Skeleton)(() => ({\n width: '80%'\n}))\n\nconst LoadingContentBox = styled(Box)(({ theme }) => ({\n marginTop: theme.spacing(2)\n}))\n\nexport {\n CardContainer,\n CardImage,\n CardImageLink,\n CardInfo,\n CategoryLink,\n DateText,\n Description,\n LoadingContentBox,\n LoadingHeader,\n LoadingImage,\n LoadingMetaSkeleton,\n LoadingTextSkeleton,\n LoadingTextSkeletonShort,\n LoadingTitleLine,\n LoadingTitleLineShort,\n MetaBox,\n TitleLink\n}\n","import { Typography } from 'decentraland-ui2'\nimport type { MainPostCardProps } from './MainPostCard.types'\nimport {\n CardContainer,\n CardImage,\n CardImageLink,\n CardInfo,\n CategoryLink,\n DateText,\n Description,\n LoadingContentBox,\n LoadingHeader,\n LoadingImage,\n LoadingMetaSkeleton,\n LoadingTextSkeleton,\n LoadingTextSkeletonShort,\n LoadingTitleLine,\n LoadingTitleLineShort,\n MetaBox,\n TitleLink\n} from './MainPostCard.styled'\n\nconst MainPostCard = (props: MainPostCardProps) => {\n const { post, loading } = props\n\n if (loading) {\n return (\n <CardContainer>\n <LoadingImage variant=\"rectangular\" />\n <CardInfo>\n <LoadingHeader>\n <LoadingMetaSkeleton variant=\"text\" />\n <LoadingMetaSkeleton variant=\"text\" />\n </LoadingHeader>\n <LoadingTitleLine variant=\"text\" />\n <LoadingTitleLineShort variant=\"text\" />\n <LoadingContentBox>\n <LoadingTextSkeleton variant=\"text\" />\n <LoadingTextSkeleton variant=\"text\" />\n <LoadingTextSkeleton variant=\"text\" />\n <LoadingTextSkeletonShort variant=\"text\" />\n </LoadingContentBox>\n </CardInfo>\n </CardContainer>\n )\n }\n\n if (!post) return null\n\n return (\n <CardContainer>\n <CardImageLink to={post.url}>\n <CardImage src={post.image.url} alt={post.title} width={697} height={349} fetchPriority=\"high\" decoding=\"async\" />\n </CardImageLink>\n <CardInfo>\n <MetaBox>\n <DateText>{post.publishedDate}</DateText>\n <span>\n <CategoryLink to={post.category.url}>{post.category.title}</CategoryLink>\n </span>\n </MetaBox>\n <TitleLink to={post.url}>\n <Typography variant=\"h3\" component=\"h2\">\n {post.title}\n </Typography>\n </TitleLink>\n <Description>{post.description}</Description>\n </CardInfo>\n </CardContainer>\n )\n}\n\nexport { MainPostCard }\n","/* eslint-disable @typescript-eslint/naming-convention */\nimport { Box, styled } from 'decentraland-ui2'\n\nconst PostListWrapper = styled(Box, { shouldForwardProp: prop => prop !== 'hasMainPost' })<{ hasMainPost: boolean }>(\n ({ theme, hasMainPost }) => ({\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n paddingBottom: theme.spacing(2.5),\n '& > div:nth-of-type(3n)': {\n marginRight: theme.spacing(4)\n },\n ...(hasMainPost && {\n '& > div:nth-of-type(3n + 1)': {\n marginRight: 0\n }\n }),\n ...(!hasMainPost && {\n '& > div:nth-of-type(3n + 3)': {\n marginRight: 0\n }\n }),\n '@media (max-width: 1096px)': {\n justifyContent: 'space-between',\n '& > div, & > div:nth-of-type(3n)': {\n marginRight: 0\n }\n }\n })\n)\n\nexport { PostListWrapper }\n","import { memo } from 'react'\nimport { useMediaQuery } from 'decentraland-ui2'\nimport type { BlogPost } from '../../../shared/blog/types/blog.domain'\nimport { MainPostCard } from '../MainPostCard'\nimport { PostCard } from '../PostCard'\nimport type { PostListProps } from './PostList.types'\nimport { PostListWrapper } from './PostList.styled'\n\n// Type guard to check if a post is a placeholder\nconst isPlaceholder = (post: { id: string; isPlaceholder?: boolean }): post is { id: string; isPlaceholder: true } => {\n return 'isPlaceholder' in post && post.isPlaceholder === true\n}\n\nconst PostList = memo((props: PostListProps) => {\n const { posts, loading, hasMainPost = false } = props\n const isBigScreen = useMediaQuery('(min-width: 1096px)')\n\n // Initial loading with no posts at all\n if (loading && posts.length === 0) {\n const count = hasMainPost ? 7 : 6\n\n return (\n <PostListWrapper hasMainPost={hasMainPost}>\n {hasMainPost && <MainPostCard loading />}\n {Array.from(Array(count), (_, index) => {\n if (hasMainPost && index === 0) {\n return null // MainPostCard already rendered\n }\n return <PostCard key={`skeleton-${index}`} loading />\n })}\n </PostListWrapper>\n )\n }\n\n if (!posts || posts.length === 0) {\n return null\n }\n\n // Get first real post for MainPostCard (if applicable)\n const firstRealPost = posts.find(p => !isPlaceholder(p)) as BlogPost | undefined\n\n return (\n <PostListWrapper hasMainPost={hasMainPost}>\n {hasMainPost && isBigScreen && firstRealPost && <MainPostCard post={firstRealPost} />}\n {posts.map(post => {\n // Skip the first real post if we're showing it as MainPostCard\n if (hasMainPost && isBigScreen && !isPlaceholder(post) && post === firstRealPost) {\n return null\n }\n\n // Render placeholder as loading skeleton\n if (isPlaceholder(post)) {\n return <PostCard key={post.id} loading />\n }\n\n return <PostCard key={post.id} post={post} />\n })}\n </PostListWrapper>\n )\n})\n\nexport { PostList }\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { useInfiniteScroll } from '@dcl/hooks'\nimport type { PostOrPlaceholder } from '../../shared/blog/types/blog.domain'\nimport { useGetBlogPostsQuery } from './blog.client'\n\nconst POSTS_INITIAL_LOAD = 7\nconst POSTS_PER_LOAD = 6\n\ninterface UseInfiniteBlogPostsParams {\n category?: string\n author?: string\n}\n\ninterface UseInfiniteBlogPostsResult {\n posts: PostOrPlaceholder[]\n isLoading: boolean\n isLoadingInitial: boolean\n isFetching: boolean\n hasMore: boolean\n error: unknown\n}\n\n// Helper to create placeholder posts\nconst createPlaceholders = (count: number, batchId: number): PostOrPlaceholder[] => {\n return Array.from({ length: count }, (_, i) => ({\n id: `placeholder-${batchId}-${i}`,\n isPlaceholder: true as const\n }))\n}\n\nfunction useInfiniteBlogPosts({ category, author }: UseInfiniteBlogPostsParams = {}): UseInfiniteBlogPostsResult {\n const [currentSkip, setCurrentSkip] = useState(0)\n const [showPlaceholders, setShowPlaceholders] = useState(false)\n const batchIdRef = useRef(0)\n\n // Use RTK Query with pagination - cache handles accumulation via merge\n // Backend handles category/author filtering, so we request real page sizes\n const { data, isLoading, error, isFetching } = useGetBlogPostsQuery({\n category,\n author,\n limit: currentSkip === 0 ? POSTS_INITIAL_LOAD : POSTS_PER_LOAD,\n skip: currentSkip\n })\n\n // Build display posts: cached posts + placeholders when loading more\n const displayPosts = useMemo<PostOrPlaceholder[]>(() => {\n const posts = data?.posts ?? []\n if (showPlaceholders && isFetching) {\n return [...posts, ...createPlaceholders(POSTS_PER_LOAD, batchIdRef.current)]\n }\n return posts\n }, [data?.posts, showPlaceholders, isFetching])\n\n const hasMore = data?.hasMore ?? true\n const isLoadingInitial = isLoading && currentSkip === 0\n\n // Reset skip when filters change\n useEffect(() => {\n setCurrentSkip(0)\n setShowPlaceholders(false)\n batchIdRef.current = 0\n }, [category, author])\n\n // Show placeholders when fetching more (not initial)\n useEffect(() => {\n if (isFetching && currentSkip > 0) {\n batchIdRef.current += 1\n setShowPlaceholders(true)\n } else if (!isFetching) {\n setShowPlaceholders(false)\n }\n }, [isFetching, currentSkip])\n\n // Load more function - use nextCmsSkip to properly paginate\n const loadMore = useCallback(() => {\n if (isFetching || !hasMore || !data) {\n return\n }\n // Use the CMS-level skip for proper pagination\n setCurrentSkip(data.nextCmsSkip)\n }, [isFetching, hasMore, data])\n\n // Use @dcl/hooks infinite scroll\n useInfiniteScroll({\n onLoadMore: loadMore,\n hasMore,\n isLoading: isFetching\n })\n\n return {\n posts: displayPosts,\n isLoading,\n isLoadingInitial,\n isFetching,\n hasMore,\n error\n }\n}\n\nexport { useInfiniteBlogPosts, type UseInfiniteBlogPostsParams, type UseInfiniteBlogPostsResult }\n"],"names":["useInfiniteScroll","onLoadMore","hasMore","isLoading","threshold","debounceMs","onLoadMoreRef","useRef","lastTriggerRef","useEffect","handleScroll","now","scrollHeight","scrollTop","clientHeight","timeoutId","CardContainer","styled","Box","CardImage","CardInfo","TitleLink","Link","theme","Description","LoadingHeader","LoadingImage","Skeleton","LoadingTitleLine","LoadingTitleLineShort","LoadingMetaSkeleton","LoadingTextSkeleton","LoadingTextSkeletonShort","LoadingContentBox","MainPostCard","props","post","loading","jsx","jsxs","CardImageLink","MetaBox","DateText","CategoryLink","Typography","PostListWrapper","prop","hasMainPost","isPlaceholder","PostList","memo","posts","isBigScreen","useMediaQuery","count","_","index","PostCard","firstRealPost","p","POSTS_INITIAL_LOAD","POSTS_PER_LOAD","createPlaceholders","batchId","i","useInfiniteBlogPosts","category","author","currentSkip","setCurrentSkip","useState","showPlaceholders","setShowPlaceholders","batchIdRef","data","error","isFetching","useGetBlogPostsQuery","displayPosts","useMemo","isLoadingInitial","loadMore","useCallback"],"mappings":"qTAWA,MAAMA,EAAoB,CAAC,CAAE,WAAAC,EAAY,QAAAC,EAAS,UAAAC,EAAW,UAAAC,EAAY,IAAK,WAAAC,EAAa,OAAW,CAClG,MAAMC,EAAgBC,EAAAA,OAAON,CAAU,EACjCO,EAAiBD,EAAAA,OAAO,CAAC,EAC/BE,EAAAA,UAAU,IAAM,CACZH,EAAc,QAAUL,CAC5B,EAAG,CAACA,CAAU,CAAC,EACfQ,EAAAA,UAAU,IAAM,CACZ,MAAMC,EAAe,IAAM,CACvB,MAAMC,EAAM,KAAK,IAAG,EACpB,GAAIA,EAAMH,EAAe,QAAUH,EAC/B,OAEJ,MAAMO,EAAe,SAAS,gBAAgB,aACxCC,EAAY,SAAS,gBAAgB,UACrCC,EAAe,SAAS,gBAAgB,aACnBF,GAAgBC,EAAYC,GAC9BV,GAAaF,GAAW,CAACC,IAC9CK,EAAe,QAAUG,EACzBL,EAAc,QAAO,EAE7B,EACA,OAAO,iBAAiB,SAAUI,EAAc,CAAE,QAAS,GAAM,EACjE,MAAMK,EAAY,WAAWL,EAAc,GAAG,EAC9C,MAAO,IAAM,CACT,OAAO,oBAAoB,SAAUA,CAAY,EACjD,aAAaK,CAAS,CAC1B,CACJ,EAAG,CAACb,EAASC,EAAWC,EAAWC,CAAU,CAAC,CAClD,EClCMW,EAAgBC,EAAOC,CAAG,EAAE,KAAO,CACvC,MAAO,OACP,OAAQ,gBACR,SAAU,WACV,QAAS,OACT,eAAgB,gBAChB,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C,GAAGzB,EAAO,GAAGW,EAAmBD,EAAgBY,EAAW,OAAO,CAAC,EAEtEtB,CACT,EAAG,CAACuB,GAAM,MAAOH,EAAkBK,CAAU,CAAC,EAExC1E,EAAUwE,GAAM,SAAW,GAC3BM,EAAmB7E,GAAaiE,IAAgB,EAGtD3D,EAAAA,UAAU,IAAM,CACd4D,EAAe,CAAC,EAChBG,EAAoB,EAAK,EACzBC,EAAW,QAAU,CACvB,EAAG,CAACP,EAAUC,CAAM,CAAC,EAGrB1D,EAAAA,UAAU,IAAM,CACVmE,GAAcR,EAAc,GAC9BK,EAAW,SAAW,EACtBD,EAAoB,EAAI,GACdI,GACVJ,EAAoB,EAAK,CAE7B,EAAG,CAACI,EAAYR,CAAW,CAAC,EAG5B,MAAMa,EAAWC,EAAAA,YAAY,IAAM,CAC7BN,GAAc,CAAC1E,GAAW,CAACwE,GAI/BL,EAAeK,EAAK,WAAW,CACjC,EAAG,CAACE,EAAY1E,EAASwE,CAAI,CAAC,EAG9B,OAAA1E,EAAkB,CAChB,WAAYiF,EACZ,QAAA/E,EACA,UAAW0E,CAAA,CACZ,EAEM,CACL,MAAOE,EACP,UAAA3E,EACA,iBAAA6E,EACA,WAAAJ,EACA,QAAA1E,EACA,MAAAyE,CAAA,CAEJ","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- import{_ as s,b as h,m as v,c as n,e as j,f as k}from"./index-D0nE3AYE.js";const E=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],L=["component","slots","slotProps"],N=["component"];function W(e,o){const{className:x,elementType:_,ownerState:l,externalForwardedProps:p,getSlotOwnerState:d,internalForwardedProps:a}=o,F=s(o,E),{component:c,slots:t={[e]:void 0},slotProps:O={[e]:void 0}}=p,g=s(p,L),P=t[e]||_,r=h(O[e],l),i=v(n({className:x},F,{externalForwardedProps:e==="root"?g:void 0,externalSlotProps:r})),{props:{component:f},internalRef:y}=i,u=s(i.props,N),C=j(y,r?.ref,o.ref),S=d?d(u):{},T=n({},l,S),w=e==="root"?f||c:f,m=k(P,n({},e==="root"&&!c&&!t[e]&&a,e!=="root"&&!t[e]&&a,u,w&&{as:w},{ref:C}),T);return Object.keys(S).forEach(b=>{delete m[b]}),[P,m]}export{W as u};
1
+ import{_ as s,b as h,m as v,c as n,e as j,f as k}from"./index-DUmIu2EK.js";const E=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],L=["component","slots","slotProps"],N=["component"];function W(e,o){const{className:x,elementType:_,ownerState:l,externalForwardedProps:p,getSlotOwnerState:d,internalForwardedProps:a}=o,F=s(o,E),{component:c,slots:t={[e]:void 0},slotProps:O={[e]:void 0}}=p,g=s(p,L),P=t[e]||_,r=h(O[e],l),i=v(n({className:x},F,{externalForwardedProps:e==="root"?g:void 0,externalSlotProps:r})),{props:{component:f},internalRef:y}=i,u=s(i.props,N),C=j(y,r?.ref,o.ref),S=d?d(u):{},T=n({},l,S),w=e==="root"?f||c:f,m=k(P,n({},e==="root"&&!c&&!t[e]&&a,e!=="root"&&!t[e]&&a,u,w&&{as:w},{ref:C}),T);return Object.keys(S).forEach(b=>{delete m[b]}),[P,m]}export{W as u};
@@ -1 +1 @@
1
- {"version":3,"file":"useSlot-B74_4mYS.js","sources":["../../node_modules/decentraland-ui2/node_modules/@mui/material/utils/useSlot.js"],"sourcesContent":["'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"elementType\", \"ownerState\", \"externalForwardedProps\", \"getSlotOwnerState\", \"internalForwardedProps\"],\n _excluded2 = [\"component\", \"slots\", \"slotProps\"],\n _excluded3 = [\"component\"];\nimport useForkRef from '@mui/utils/useForkRef';\nimport { appendOwnerState, resolveComponentProps, mergeSlotProps } from '@mui/base/utils';\n/**\n * An internal function to create a Material UI slot.\n *\n * This is an advanced version of Base UI `useSlotProps` because Material UI allows leaf component to be customized via `component` prop\n * while Base UI does not need to support leaf component customization.\n *\n * @param {string} name: name of the slot\n * @param {object} parameters\n * @returns {[Slot, slotProps]} The slot's React component and the slot's props\n *\n * Note: the returned slot's props\n * - will never contain `component` prop.\n * - might contain `as` prop.\n */\nexport default function useSlot(\n/**\n * The slot's name. All Material UI components should have `root` slot.\n *\n * If the name is `root`, the logic behaves differently from other slots,\n * e.g. the `externalForwardedProps` are spread to `root` slot but not other slots.\n */\nname, parameters) {\n const {\n className,\n elementType: initialElementType,\n ownerState,\n externalForwardedProps,\n getSlotOwnerState,\n internalForwardedProps\n } = parameters,\n useSlotPropsParams = _objectWithoutPropertiesLoose(parameters, _excluded);\n const {\n component: rootComponent,\n slots = {\n [name]: undefined\n },\n slotProps = {\n [name]: undefined\n }\n } = externalForwardedProps,\n other = _objectWithoutPropertiesLoose(externalForwardedProps, _excluded2);\n const elementType = slots[name] || initialElementType;\n\n // `slotProps[name]` can be a callback that receives the component's ownerState.\n // `resolvedComponentsProps` is always a plain object.\n const resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState);\n const _mergeSlotProps = mergeSlotProps(_extends({\n className\n }, useSlotPropsParams, {\n externalForwardedProps: name === 'root' ? other : undefined,\n externalSlotProps: resolvedComponentsProps\n })),\n {\n props: {\n component: slotComponent\n },\n internalRef\n } = _mergeSlotProps,\n mergedProps = _objectWithoutPropertiesLoose(_mergeSlotProps.props, _excluded3);\n const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, parameters.ref);\n const slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};\n const finalOwnerState = _extends({}, ownerState, slotOwnerState);\n const LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;\n const props = appendOwnerState(elementType, _extends({}, name === 'root' && !rootComponent && !slots[name] && internalForwardedProps, name !== 'root' && !slots[name] && internalForwardedProps, mergedProps, LeafComponent && {\n as: LeafComponent\n }, {\n ref\n }), finalOwnerState);\n Object.keys(slotOwnerState).forEach(propName => {\n delete props[propName];\n });\n return [elementType, props];\n}"],"names":["_excluded","_excluded2","_excluded3","useSlot","name","parameters","className","initialElementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps","useSlotPropsParams","_objectWithoutPropertiesLoose","rootComponent","slots","slotProps","other","elementType","resolvedComponentsProps","resolveComponentProps","_mergeSlotProps","mergeSlotProps","_extends","slotComponent","internalRef","mergedProps","ref","useForkRef","slotOwnerState","finalOwnerState","LeafComponent","props","appendOwnerState","propName"],"mappings":"2EAIA,MAAMA,EAAY,CAAC,YAAa,cAAe,aAAc,yBAA0B,oBAAqB,wBAAwB,EAClIC,EAAa,CAAC,YAAa,QAAS,WAAW,EAC/CC,EAAa,CAAC,WAAW,EAiBZ,SAASC,EAOxBC,EAAMC,EAAY,CAChB,KAAM,CACF,UAAAC,EACA,YAAaC,EACb,WAAAC,EACA,uBAAAC,EACA,kBAAAC,EACA,uBAAAC,CACN,EAAQN,EACJO,EAAqBC,EAA8BR,EAAYL,CAAS,EACpE,CACF,UAAWc,EACX,MAAAC,EAAQ,CACN,CAACX,CAAI,EAAG,MAChB,EACM,UAAAY,EAAY,CACV,CAACZ,CAAI,EAAG,MAChB,CACA,EAAQK,EACJQ,EAAQJ,EAA8BJ,EAAwBR,CAAU,EACpEiB,EAAcH,EAAMX,CAAI,GAAKG,EAI7BY,EAA0BC,EAAsBJ,EAAUZ,CAAI,EAAGI,CAAU,EAC3Ea,EAAkBC,EAAeC,EAAS,CAC5C,UAAAjB,CACN,EAAOM,EAAoB,CACrB,uBAAwBR,IAAS,OAASa,EAAQ,OAClD,kBAAmBE,CACzB,CAAK,CAAC,EACF,CACE,MAAO,CACL,UAAWK,CACnB,EACM,YAAAC,CACN,EAAQJ,EACJK,EAAcb,EAA8BQ,EAAgB,MAAOnB,CAAU,EACzEyB,EAAMC,EAAWH,EAAwDN,GAAwB,IAAKd,EAAW,GAAG,EACpHwB,EAAiBnB,EAAoBA,EAAkBgB,CAAW,EAAI,CAAA,EACtEI,EAAkBP,EAAS,GAAIf,EAAYqB,CAAc,EACzDE,EAAgB3B,IAAS,OAASoB,GAAiBV,EAAgBU,EACnEQ,EAAQC,EAAiBf,EAAaK,EAAS,CAAA,EAAInB,IAAS,QAAU,CAACU,GAAiB,CAACC,EAAMX,CAAI,GAAKO,EAAwBP,IAAS,QAAU,CAACW,EAAMX,CAAI,GAAKO,EAAwBe,EAAaK,GAAiB,CAC7N,GAAIA,CACR,EAAK,CACD,IAAAJ,CACJ,CAAG,EAAGG,CAAe,EACnB,cAAO,KAAKD,CAAc,EAAE,QAAQK,GAAY,CAC9C,OAAOF,EAAME,CAAQ,CACvB,CAAC,EACM,CAAChB,EAAac,CAAK,CAC5B","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"useSlot-DM_UQPu8.js","sources":["../../node_modules/decentraland-ui2/node_modules/@mui/material/utils/useSlot.js"],"sourcesContent":["'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"elementType\", \"ownerState\", \"externalForwardedProps\", \"getSlotOwnerState\", \"internalForwardedProps\"],\n _excluded2 = [\"component\", \"slots\", \"slotProps\"],\n _excluded3 = [\"component\"];\nimport useForkRef from '@mui/utils/useForkRef';\nimport { appendOwnerState, resolveComponentProps, mergeSlotProps } from '@mui/base/utils';\n/**\n * An internal function to create a Material UI slot.\n *\n * This is an advanced version of Base UI `useSlotProps` because Material UI allows leaf component to be customized via `component` prop\n * while Base UI does not need to support leaf component customization.\n *\n * @param {string} name: name of the slot\n * @param {object} parameters\n * @returns {[Slot, slotProps]} The slot's React component and the slot's props\n *\n * Note: the returned slot's props\n * - will never contain `component` prop.\n * - might contain `as` prop.\n */\nexport default function useSlot(\n/**\n * The slot's name. All Material UI components should have `root` slot.\n *\n * If the name is `root`, the logic behaves differently from other slots,\n * e.g. the `externalForwardedProps` are spread to `root` slot but not other slots.\n */\nname, parameters) {\n const {\n className,\n elementType: initialElementType,\n ownerState,\n externalForwardedProps,\n getSlotOwnerState,\n internalForwardedProps\n } = parameters,\n useSlotPropsParams = _objectWithoutPropertiesLoose(parameters, _excluded);\n const {\n component: rootComponent,\n slots = {\n [name]: undefined\n },\n slotProps = {\n [name]: undefined\n }\n } = externalForwardedProps,\n other = _objectWithoutPropertiesLoose(externalForwardedProps, _excluded2);\n const elementType = slots[name] || initialElementType;\n\n // `slotProps[name]` can be a callback that receives the component's ownerState.\n // `resolvedComponentsProps` is always a plain object.\n const resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState);\n const _mergeSlotProps = mergeSlotProps(_extends({\n className\n }, useSlotPropsParams, {\n externalForwardedProps: name === 'root' ? other : undefined,\n externalSlotProps: resolvedComponentsProps\n })),\n {\n props: {\n component: slotComponent\n },\n internalRef\n } = _mergeSlotProps,\n mergedProps = _objectWithoutPropertiesLoose(_mergeSlotProps.props, _excluded3);\n const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, parameters.ref);\n const slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};\n const finalOwnerState = _extends({}, ownerState, slotOwnerState);\n const LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;\n const props = appendOwnerState(elementType, _extends({}, name === 'root' && !rootComponent && !slots[name] && internalForwardedProps, name !== 'root' && !slots[name] && internalForwardedProps, mergedProps, LeafComponent && {\n as: LeafComponent\n }, {\n ref\n }), finalOwnerState);\n Object.keys(slotOwnerState).forEach(propName => {\n delete props[propName];\n });\n return [elementType, props];\n}"],"names":["_excluded","_excluded2","_excluded3","useSlot","name","parameters","className","initialElementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps","useSlotPropsParams","_objectWithoutPropertiesLoose","rootComponent","slots","slotProps","other","elementType","resolvedComponentsProps","resolveComponentProps","_mergeSlotProps","mergeSlotProps","_extends","slotComponent","internalRef","mergedProps","ref","useForkRef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