@strapi/admin 5.0.0-beta.9 → 5.0.0-rc.0

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 (299) hide show
  1. package/LICENSE +18 -3
  2. package/dist/admin/{AdminSeatInfo-cqB8nHFZ.js → AdminSeatInfo-E8azTFQY.js} +5 -5
  3. package/dist/admin/AdminSeatInfo-E8azTFQY.js.map +1 -0
  4. package/dist/admin/{AdminSeatInfo-_UxgNKbX.mjs → AdminSeatInfo-Q_hUNC5B.mjs} +5 -5
  5. package/dist/admin/AdminSeatInfo-Q_hUNC5B.mjs.map +1 -0
  6. package/dist/admin/{ApplicationInfoPage-6PD2owY8.mjs → ApplicationInfoPage-dUIGrQGe.mjs} +153 -158
  7. package/dist/admin/ApplicationInfoPage-dUIGrQGe.mjs.map +1 -0
  8. package/dist/admin/{ApplicationInfoPage-S18loXTF.js → ApplicationInfoPage-g82dXg6q.js} +161 -166
  9. package/dist/admin/ApplicationInfoPage-g82dXg6q.js.map +1 -0
  10. package/dist/admin/{AuthResponse-Y4lblDuD.mjs → AuthResponse-J8A48xdo.mjs} +9 -5
  11. package/dist/admin/AuthResponse-J8A48xdo.mjs.map +1 -0
  12. package/dist/admin/{AuthResponse-EiDRhJY8.js → AuthResponse-KlTDmm2i.js} +10 -6
  13. package/dist/admin/AuthResponse-KlTDmm2i.js.map +1 -0
  14. package/dist/admin/{AuthenticatedLayout-gOaUXjO8.mjs → AuthenticatedLayout-Nvdzrzx5.mjs} +177 -166
  15. package/dist/admin/AuthenticatedLayout-Nvdzrzx5.mjs.map +1 -0
  16. package/dist/admin/{AuthenticatedLayout-MDNNJRPg.js → AuthenticatedLayout-zi65roOD.js} +192 -181
  17. package/dist/admin/AuthenticatedLayout-zi65roOD.js.map +1 -0
  18. package/dist/admin/CreateActionEE-Yfp4hs7a.mjs +49 -0
  19. package/dist/admin/CreateActionEE-Yfp4hs7a.mjs.map +1 -0
  20. package/dist/admin/CreateActionEE-uqyKLxwI.js +76 -0
  21. package/dist/admin/CreateActionEE-uqyKLxwI.js.map +1 -0
  22. package/dist/admin/{CreatePage-puzZjQXr.mjs → CreatePage--JuxyfiM.mjs} +13 -14
  23. package/dist/admin/CreatePage--JuxyfiM.mjs.map +1 -0
  24. package/dist/admin/{CreatePage-GD7KENsP.mjs → CreatePage-N7P4KHBw.mjs} +3 -3
  25. package/dist/admin/{CreatePage-GD7KENsP.mjs.map → CreatePage-N7P4KHBw.mjs.map} +1 -1
  26. package/dist/admin/{CreatePage-5V60DKB0.js → CreatePage-cmQo1lsI.js} +18 -19
  27. package/dist/admin/CreatePage-cmQo1lsI.js.map +1 -0
  28. package/dist/admin/{CreatePage-Z_y-A5xj.js → CreatePage-pdMfqmVQ.js} +5 -5
  29. package/dist/admin/{CreatePage-Z_y-A5xj.js.map → CreatePage-pdMfqmVQ.js.map} +1 -1
  30. package/dist/admin/{CreateView-jM_w7R83.mjs → CreateView-XmSKJfeA.mjs} +3 -3
  31. package/dist/admin/{CreateView-jM_w7R83.mjs.map → CreateView-XmSKJfeA.mjs.map} +1 -1
  32. package/dist/admin/CreateView-d40DvWop.js +17 -0
  33. package/dist/admin/{CreateView-5V271zBl.js.map → CreateView-d40DvWop.js.map} +1 -1
  34. package/dist/admin/CreateView-pnws3TX-.js +17 -0
  35. package/dist/admin/{CreateView-VYprogwB.js.map → CreateView-pnws3TX-.js.map} +1 -1
  36. package/dist/admin/{CreateView-EjqRVjU_.mjs → CreateView-yZaKlylD.mjs} +3 -3
  37. package/dist/admin/{CreateView-EjqRVjU_.mjs.map → CreateView-yZaKlylD.mjs.map} +1 -1
  38. package/dist/admin/{EditPage-WuJtih1X.js → EditPage--0bmE7_N.js} +96 -91
  39. package/dist/admin/EditPage--0bmE7_N.js.map +1 -0
  40. package/dist/admin/{EditPage-8_dXc9y1.mjs → EditPage-0LYEDOqM.mjs} +9 -9
  41. package/dist/admin/EditPage-0LYEDOqM.mjs.map +1 -0
  42. package/dist/admin/{EditPage-W_qlhF-2.mjs → EditPage-EnZY6R8C.mjs} +11 -11
  43. package/dist/admin/EditPage-EnZY6R8C.mjs.map +1 -0
  44. package/dist/admin/{EditPage-8fk5JEO7.mjs → EditPage-SEqJd8aL.mjs} +91 -86
  45. package/dist/admin/EditPage-SEqJd8aL.mjs.map +1 -0
  46. package/dist/admin/{EditPage-HsLjcfgK.js → EditPage-aTVcZqIw.js} +15 -15
  47. package/dist/admin/EditPage-aTVcZqIw.js.map +1 -0
  48. package/dist/admin/{EditPage-vRwS2OJZ.js → EditPage-lZSLQ_kW.js} +19 -19
  49. package/dist/admin/EditPage-lZSLQ_kW.js.map +1 -0
  50. package/dist/admin/{EditView-Cac025JW.mjs → EditView-Xnf-Y_i6.mjs} +10 -10
  51. package/dist/admin/EditView-Xnf-Y_i6.mjs.map +1 -0
  52. package/dist/admin/{EditView-lhhZAQtN.js → EditView-lT8-jopG.js} +19 -19
  53. package/dist/admin/EditView-lT8-jopG.js.map +1 -0
  54. package/dist/admin/{EditViewPage-f56oKqQ-.mjs → EditViewPage-Ol2GfMki.mjs} +23 -23
  55. package/dist/admin/EditViewPage-Ol2GfMki.mjs.map +1 -0
  56. package/dist/admin/{EditViewPage-Q7N1TLU9.js → EditViewPage-l54jnFq5.js} +32 -32
  57. package/dist/admin/EditViewPage-l54jnFq5.js.map +1 -0
  58. package/dist/admin/{EventsTable-y6XT7dVi.js → EventsTable-wSeeoOYt.js} +2 -2
  59. package/dist/admin/{EventsTable-y6XT7dVi.js.map → EventsTable-wSeeoOYt.js.map} +1 -1
  60. package/dist/admin/{EventsTable-duSraBTj.mjs → EventsTable-x8idMSyd.mjs} +2 -2
  61. package/dist/admin/{EventsTable-duSraBTj.mjs.map → EventsTable-x8idMSyd.mjs.map} +1 -1
  62. package/dist/admin/{HomePage-d4h0KEnw.mjs → HomePage-XGnQE7ny.mjs} +12 -12
  63. package/dist/admin/HomePage-XGnQE7ny.mjs.map +1 -0
  64. package/dist/admin/{HomePage-UTLFs-4n.mjs → HomePage-Zmtc9RWT.mjs} +3 -3
  65. package/dist/admin/{HomePage-UTLFs-4n.mjs.map → HomePage-Zmtc9RWT.mjs.map} +1 -1
  66. package/dist/admin/{HomePage-vTms2gld.js → HomePage-ivlZamVP.js} +3 -3
  67. package/dist/admin/{HomePage-vTms2gld.js.map → HomePage-ivlZamVP.js.map} +1 -1
  68. package/dist/admin/{HomePage-4Hk9puW_.js → HomePage-rO315cxr.js} +18 -18
  69. package/dist/admin/HomePage-rO315cxr.js.map +1 -0
  70. package/dist/admin/{InstalledPluginsPage-9ooKCsS7.js → InstalledPluginsPage-Jr5ITmO2.js} +10 -10
  71. package/dist/admin/{InstalledPluginsPage-9ooKCsS7.js.map → InstalledPluginsPage-Jr5ITmO2.js.map} +1 -1
  72. package/dist/admin/{InstalledPluginsPage-nCdAsAAu.mjs → InstalledPluginsPage-WaPhGz8o.mjs} +4 -4
  73. package/dist/admin/{InstalledPluginsPage-nCdAsAAu.mjs.map → InstalledPluginsPage-WaPhGz8o.mjs.map} +1 -1
  74. package/dist/admin/{Layout-Bmmqv9h6.js → Layout-oY1FywRQ.js} +26 -14
  75. package/dist/admin/Layout-oY1FywRQ.js.map +1 -0
  76. package/dist/admin/{Layout-Ax9QtxH1.mjs → Layout-zkpMXAoS.mjs} +22 -10
  77. package/dist/admin/Layout-zkpMXAoS.mjs.map +1 -0
  78. package/dist/admin/{ListPage-10_h7FUt.js → ListPage-1rd2okih.js} +50 -49
  79. package/dist/admin/ListPage-1rd2okih.js.map +1 -0
  80. package/dist/admin/{ListPage-gbCO5Otz.mjs → ListPage-6FZt3Rsr.mjs} +3 -3
  81. package/dist/admin/{ListPage-gbCO5Otz.mjs.map → ListPage-6FZt3Rsr.mjs.map} +1 -1
  82. package/dist/admin/{ListPage-EPIYY3Uf.mjs → ListPage-8mH-itGQ.mjs} +71 -35
  83. package/dist/admin/ListPage-8mH-itGQ.mjs.map +1 -0
  84. package/dist/admin/{ListPage-OE9xQffQ.mjs → ListPage-CwIQBV8p.mjs} +18 -23
  85. package/dist/admin/ListPage-CwIQBV8p.mjs.map +1 -0
  86. package/dist/admin/{ListPage-TWLqkRt6.js → ListPage-Hr65IOSg.js} +27 -32
  87. package/dist/admin/ListPage-Hr65IOSg.js.map +1 -0
  88. package/dist/admin/{ListPage-IgkmnCSY.js → ListPage-Lg5YOMva.js} +15 -22
  89. package/dist/admin/ListPage-Lg5YOMva.js.map +1 -0
  90. package/dist/admin/{ListPage-VGqEsiEA.mjs → ListPage-O5tDuG9A.mjs} +7 -14
  91. package/dist/admin/ListPage-O5tDuG9A.mjs.map +1 -0
  92. package/dist/admin/{ListPage-4nzagne8.js → ListPage-Z6tGG3Ab.js} +79 -43
  93. package/dist/admin/ListPage-Z6tGG3Ab.js.map +1 -0
  94. package/dist/admin/{ListPage-4n-Xb2aE.js → ListPage-e73kfoF7.js} +3 -3
  95. package/dist/admin/{ListPage-4n-Xb2aE.js.map → ListPage-e73kfoF7.js.map} +1 -1
  96. package/dist/admin/{ListPage-4kGSO2Ri.mjs → ListPage-ecQ9qHgD.mjs} +40 -39
  97. package/dist/admin/ListPage-ecQ9qHgD.mjs.map +1 -0
  98. package/dist/admin/{ListView-pT2a-fdi.js → ListView-5P4j7mTu.js} +13 -13
  99. package/dist/admin/{ListView-pT2a-fdi.js.map → ListView-5P4j7mTu.js.map} +1 -1
  100. package/dist/admin/{ListView-Zvs5X2St.mjs → ListView-el6fHHck.mjs} +4 -4
  101. package/dist/admin/{ListView-Zvs5X2St.mjs.map → ListView-el6fHHck.mjs.map} +1 -1
  102. package/dist/admin/{ListView-uHb_Hgib.js → ListView-qyoVbUIE.js} +13 -13
  103. package/dist/admin/{ListView-uHb_Hgib.js.map → ListView-qyoVbUIE.js.map} +1 -1
  104. package/dist/admin/{ListView-gKrpPLEM.mjs → ListView-z5iwLF2-.mjs} +4 -4
  105. package/dist/admin/{ListView-gKrpPLEM.mjs.map → ListView-z5iwLF2-.mjs.map} +1 -1
  106. package/dist/admin/{Login-EcSP4AMG.js → Login-KZbFZfrN.js} +5 -5
  107. package/dist/admin/{Login-EcSP4AMG.js.map → Login-KZbFZfrN.js.map} +1 -1
  108. package/dist/admin/{Login-w4BUlNaE.mjs → Login-N5NSuTVF.mjs} +4 -4
  109. package/dist/admin/{Login-w4BUlNaE.mjs.map → Login-N5NSuTVF.mjs.map} +1 -1
  110. package/dist/admin/{MagicLinkEE-b9NK8XXY.mjs → MagicLinkEE-XXdnsS6S.mjs} +3 -3
  111. package/dist/admin/{MagicLinkEE-b9NK8XXY.mjs.map → MagicLinkEE-XXdnsS6S.mjs.map} +1 -1
  112. package/dist/admin/{MagicLinkEE-qT5OE9Pm.js → MagicLinkEE-sKqh4jBd.js} +3 -3
  113. package/dist/admin/{MagicLinkEE-qT5OE9Pm.js.map → MagicLinkEE-sKqh4jBd.js.map} +1 -1
  114. package/dist/admin/{MarketplacePage-MVRrpUSk.js → MarketplacePage-_xLLmtgL.js} +123 -150
  115. package/dist/admin/MarketplacePage-_xLLmtgL.js.map +1 -0
  116. package/dist/admin/{MarketplacePage-oGhZBKgX.mjs → MarketplacePage-tOb2ZzOl.mjs} +111 -138
  117. package/dist/admin/MarketplacePage-tOb2ZzOl.mjs.map +1 -0
  118. package/dist/admin/{Ornaments-h_LCCr5P.mjs → Ornaments-jAwgQeK0.mjs} +2 -2
  119. package/dist/admin/{Ornaments-h_LCCr5P.mjs.map → Ornaments-jAwgQeK0.mjs.map} +1 -1
  120. package/dist/admin/{Ornaments-UTssGzOw.js → Ornaments-sFPQPOtb.js} +2 -2
  121. package/dist/admin/{Ornaments-UTssGzOw.js.map → Ornaments-sFPQPOtb.js.map} +1 -1
  122. package/dist/admin/{Permissions-kNVZVLmu.js → Permissions-SuZE5tW3.js} +265 -277
  123. package/dist/admin/Permissions-SuZE5tW3.js.map +1 -0
  124. package/dist/admin/{Permissions-lf6dNG4S.mjs → Permissions-oxdduJgE.mjs} +256 -269
  125. package/dist/admin/Permissions-oxdduJgE.mjs.map +1 -0
  126. package/dist/admin/{PrivateRoute-1hyhztQM.mjs → PrivateRoute-4oRTB_tX.mjs} +2 -2
  127. package/dist/admin/{PrivateRoute-1hyhztQM.mjs.map → PrivateRoute-4oRTB_tX.mjs.map} +1 -1
  128. package/dist/admin/{PrivateRoute-wBE5vMxe.js → PrivateRoute-ndqg7K6H.js} +3 -3
  129. package/dist/admin/{PrivateRoute-wBE5vMxe.js.map → PrivateRoute-ndqg7K6H.js.map} +1 -1
  130. package/dist/admin/{ProfilePage-ZlpnTKEF.js → ProfilePage-CcfGiB1f.js} +23 -23
  131. package/dist/admin/ProfilePage-CcfGiB1f.js.map +1 -0
  132. package/dist/admin/{ProfilePage-zk-Py9wt.mjs → ProfilePage-ktCLvQFd.mjs} +10 -10
  133. package/dist/admin/ProfilePage-ktCLvQFd.mjs.map +1 -0
  134. package/dist/admin/{PurchaseAuditLogs-iOYsTJA-.mjs → PurchaseAuditLogs-FFyc1iqD.mjs} +2 -2
  135. package/dist/admin/{PurchaseAuditLogs-iOYsTJA-.mjs.map → PurchaseAuditLogs-FFyc1iqD.mjs.map} +1 -1
  136. package/dist/admin/{PurchaseAuditLogs-9reb0oGz.js → PurchaseAuditLogs-vw0PH1V9.js} +2 -2
  137. package/dist/admin/{PurchaseAuditLogs-9reb0oGz.js.map → PurchaseAuditLogs-vw0PH1V9.js.map} +1 -1
  138. package/dist/admin/{PurchaseSingleSignOn-S3xLiiv7.js → PurchaseSingleSignOn-6LucYXfi.js} +2 -2
  139. package/dist/admin/{PurchaseSingleSignOn-S3xLiiv7.js.map → PurchaseSingleSignOn-6LucYXfi.js.map} +1 -1
  140. package/dist/admin/{PurchaseSingleSignOn-X629iA7K.mjs → PurchaseSingleSignOn-xU0fuX_i.mjs} +2 -2
  141. package/dist/admin/{PurchaseSingleSignOn-X629iA7K.mjs.map → PurchaseSingleSignOn-xU0fuX_i.mjs.map} +1 -1
  142. package/dist/admin/{SSOProviders-AirHFyBl.js → SSOProviders-QBcyB9VI.js} +5 -5
  143. package/dist/admin/SSOProviders-QBcyB9VI.js.map +1 -0
  144. package/dist/admin/{SSOProviders-t8D-v8As.mjs → SSOProviders-nMmBLr8g.mjs} +6 -6
  145. package/dist/admin/SSOProviders-nMmBLr8g.mjs.map +1 -0
  146. package/dist/admin/{SelectRoles-hyiyvsCG.js → SelectRoles-9mmcvACr.js} +5 -5
  147. package/dist/admin/{SelectRoles-hyiyvsCG.js.map → SelectRoles-9mmcvACr.js.map} +1 -1
  148. package/dist/admin/{SelectRoles-yM-LT458.mjs → SelectRoles-N6X582ND.mjs} +4 -4
  149. package/dist/admin/{SelectRoles-yM-LT458.mjs.map → SelectRoles-N6X582ND.mjs.map} +1 -1
  150. package/dist/admin/{SingleSignOnPage-wPZ1tqEk.mjs → SingleSignOnPage-4wlUp8RB.mjs} +7 -7
  151. package/dist/admin/SingleSignOnPage-4wlUp8RB.mjs.map +1 -0
  152. package/dist/admin/{SingleSignOnPage-3Mfu4dgn.js → SingleSignOnPage-UAjYb3Du.js} +17 -17
  153. package/dist/admin/SingleSignOnPage-UAjYb3Du.js.map +1 -0
  154. package/dist/admin/{Table-N9PZc6xL.js → Table-0h7ykSft.js} +11 -23
  155. package/dist/admin/Table-0h7ykSft.js.map +1 -0
  156. package/dist/admin/{Table-OcYvBab7.mjs → Table-xRelygoM.mjs} +10 -22
  157. package/dist/admin/Table-xRelygoM.mjs.map +1 -0
  158. package/dist/admin/{rbac-5b9ylhpa.js → Theme-7W0we6BI.js} +147 -80
  159. package/dist/admin/Theme-7W0we6BI.js.map +1 -0
  160. package/dist/admin/{rbac-oJEkQdXG.mjs → Theme-PrUuuGtN.mjs} +140 -81
  161. package/dist/admin/Theme-PrUuuGtN.mjs.map +1 -0
  162. package/dist/admin/{TokenTypeSelect-dWn05yGP.js → TokenTypeSelect-hdjIIxHs.js} +10 -12
  163. package/dist/admin/TokenTypeSelect-hdjIIxHs.js.map +1 -0
  164. package/dist/admin/{TokenTypeSelect-v6IYPaBF.mjs → TokenTypeSelect-zY7AWGQx.mjs} +7 -9
  165. package/dist/admin/TokenTypeSelect-zY7AWGQx.mjs.map +1 -0
  166. package/dist/admin/{UseCasePage-ijq-Bur_.js → UseCasePage-qujErAl0.js} +6 -6
  167. package/dist/admin/{UseCasePage-ijq-Bur_.js.map → UseCasePage-qujErAl0.js.map} +1 -1
  168. package/dist/admin/{UseCasePage-P4AFdcDQ.mjs → UseCasePage-zJ0ShP4K.mjs} +4 -4
  169. package/dist/admin/{UseCasePage-P4AFdcDQ.mjs.map → UseCasePage-zJ0ShP4K.mjs.map} +1 -1
  170. package/dist/admin/{constants-sfZ2gFzJ.js → constants-4XMdB2M2.js} +5 -5
  171. package/dist/admin/{constants-sfZ2gFzJ.js.map → constants-4XMdB2M2.js.map} +1 -1
  172. package/dist/admin/{constants-Z-zrJ7Zs.mjs → constants-cKzCiJ5m.mjs} +4 -4
  173. package/dist/admin/{constants-Z-zrJ7Zs.mjs.map → constants-cKzCiJ5m.mjs.map} +1 -1
  174. package/dist/admin/{en-K35WIWVM.mjs → en-0Ld-ipyI.mjs} +3 -2
  175. package/dist/admin/{en-K35WIWVM.mjs.map → en-0Ld-ipyI.mjs.map} +1 -1
  176. package/dist/admin/{en-G-ukrF2h.js → en-TbnMBjZf.js} +3 -2
  177. package/dist/admin/{en-G-ukrF2h.js.map → en-TbnMBjZf.js.map} +1 -1
  178. package/dist/admin/{index-EQL2s09p.mjs → index-8-k5RCnK.mjs} +1574 -1486
  179. package/dist/admin/index-8-k5RCnK.mjs.map +1 -0
  180. package/dist/admin/{index-duYn5r8_.js → index-r7BCTgkx.js} +1510 -1425
  181. package/dist/admin/index-r7BCTgkx.js.map +1 -0
  182. package/dist/admin/index.js +12 -12
  183. package/dist/admin/index.mjs +2 -2
  184. package/dist/admin/{selectors-Ilww6FA-.mjs → selectors-ZpHhvPK4.mjs} +2 -2
  185. package/dist/admin/{selectors-Ilww6FA-.mjs.map → selectors-ZpHhvPK4.mjs.map} +1 -1
  186. package/dist/admin/selectors-zQKcCNuz.js +8 -0
  187. package/dist/admin/{selectors-NDEu6dJa.js.map → selectors-zQKcCNuz.js.map} +1 -1
  188. package/dist/admin/src/StrapiApp.d.ts +17 -45
  189. package/dist/admin/src/components/ConfirmDialog.d.ts +18 -8
  190. package/dist/admin/src/components/Filters.d.ts +4 -8
  191. package/dist/admin/src/components/Form.d.ts +6 -1
  192. package/dist/admin/src/components/FormInputs/Checkbox.d.ts +1 -1
  193. package/dist/admin/src/components/FormInputs/types.d.ts +1 -1
  194. package/dist/admin/src/components/Layouts/HeaderLayout.d.ts +1 -1
  195. package/dist/admin/src/components/Layouts/Layout.d.ts +1 -1
  196. package/dist/admin/src/components/MainNav/NavUser.d.ts +1 -1
  197. package/dist/admin/src/components/Table.d.ts +1 -1
  198. package/dist/admin/src/constants/filters.d.ts +2 -1
  199. package/dist/admin/src/constants.d.ts +3 -3
  200. package/dist/admin/src/core/apis/router.d.ts +73 -0
  201. package/dist/admin/src/features/Auth.d.ts +2 -2
  202. package/dist/admin/src/features/StrapiApp.d.ts +2 -1
  203. package/dist/admin/src/hooks/useSettingsMenu.d.ts +2 -2
  204. package/dist/admin/src/index.d.ts +2 -1
  205. package/dist/admin/src/pages/Settings/pages/Roles/components/CollapsePropertyMatrix.d.ts +0 -6
  206. package/dist/admin/src/pages/Settings/pages/Roles/components/ConditionsButton.d.ts +4 -2
  207. package/dist/admin/src/pages/Settings/pages/Roles/components/ConditionsModal.d.ts +2 -4
  208. package/dist/admin/src/pages/Settings/pages/Users/components/CreateActionCE.d.ts +2 -1
  209. package/dist/admin/src/reducer.d.ts +7 -2
  210. package/dist/admin/src/render.d.ts +1 -0
  211. package/dist/admin/src/router.d.ts +7 -0
  212. package/dist/admin/src/services/admin.d.ts +5 -5
  213. package/dist/admin/test.js +17 -16
  214. package/dist/admin/test.js.map +1 -1
  215. package/dist/admin/test.mjs +10 -9
  216. package/dist/admin/test.mjs.map +1 -1
  217. package/dist/admin/tests/store.d.ts +2 -1
  218. package/dist/admin/tests/utils.d.ts +2 -1
  219. package/dist/admin/{useAdminRoles-2VDDweuC.js → useAdminRoles-L_erbna_.js} +2 -2
  220. package/dist/admin/{useAdminRoles-2VDDweuC.js.map → useAdminRoles-L_erbna_.js.map} +1 -1
  221. package/dist/admin/{useAdminRoles-cq3ZckdQ.mjs → useAdminRoles-SYx-GXvp.mjs} +2 -2
  222. package/dist/admin/{useAdminRoles-cq3ZckdQ.mjs.map → useAdminRoles-SYx-GXvp.mjs.map} +1 -1
  223. package/dist/admin/{useLicenseLimitNotification-1Xo24v-C.mjs → useLicenseLimitNotification-PaR7jmqd.mjs} +2 -2
  224. package/dist/admin/{useLicenseLimitNotification-1Xo24v-C.mjs.map → useLicenseLimitNotification-PaR7jmqd.mjs.map} +1 -1
  225. package/dist/admin/{useLicenseLimitNotification-9iq0TFuF.js → useLicenseLimitNotification-g1vq6nzk.js} +3 -3
  226. package/dist/admin/{useLicenseLimitNotification-9iq0TFuF.js.map → useLicenseLimitNotification-g1vq6nzk.js.map} +1 -1
  227. package/dist/admin/{useWebhooks-opYGugiT.js → useWebhooks-0RUEkKAV.js} +4 -4
  228. package/dist/admin/{useWebhooks-opYGugiT.js.map → useWebhooks-0RUEkKAV.js.map} +1 -1
  229. package/dist/admin/{useWebhooks-bgdpL7W6.mjs → useWebhooks-7thg-d57.mjs} +4 -4
  230. package/dist/admin/{useWebhooks-bgdpL7W6.mjs.map → useWebhooks-7thg-d57.mjs.map} +1 -1
  231. package/dist/admin/{validation-qUTUIssJ.mjs → validation-OmnQSHJ4.mjs} +2 -2
  232. package/dist/admin/{validation-qUTUIssJ.mjs.map → validation-OmnQSHJ4.mjs.map} +1 -1
  233. package/dist/admin/{validation-6PUPWFkz.js → validation-m5K7EGQS.js} +2 -2
  234. package/dist/admin/{validation-6PUPWFkz.js.map → validation-m5K7EGQS.js.map} +1 -1
  235. package/dist/ee/admin/src/pages/SettingsPage/pages/Users/components/CreateActionEE.d.ts +2 -1
  236. package/dist/package.json.d.ts +13 -10
  237. package/dist/server/index.js +20 -1
  238. package/dist/server/index.js.map +1 -1
  239. package/dist/server/index.mjs +18 -1
  240. package/dist/server/index.mjs.map +1 -1
  241. package/dist/server/src/controllers/webhooks.d.ts.map +1 -1
  242. package/package.json +14 -11
  243. package/dist/admin/AdminSeatInfo-_UxgNKbX.mjs.map +0 -1
  244. package/dist/admin/AdminSeatInfo-cqB8nHFZ.js.map +0 -1
  245. package/dist/admin/ApplicationInfoPage-6PD2owY8.mjs.map +0 -1
  246. package/dist/admin/ApplicationInfoPage-S18loXTF.js.map +0 -1
  247. package/dist/admin/AuthResponse-EiDRhJY8.js.map +0 -1
  248. package/dist/admin/AuthResponse-Y4lblDuD.mjs.map +0 -1
  249. package/dist/admin/AuthenticatedLayout-MDNNJRPg.js.map +0 -1
  250. package/dist/admin/AuthenticatedLayout-gOaUXjO8.mjs.map +0 -1
  251. package/dist/admin/CreateActionEE-dGj-JbWV.js +0 -53
  252. package/dist/admin/CreateActionEE-dGj-JbWV.js.map +0 -1
  253. package/dist/admin/CreateActionEE-uBGAkLbn.mjs +0 -45
  254. package/dist/admin/CreateActionEE-uBGAkLbn.mjs.map +0 -1
  255. package/dist/admin/CreatePage-5V60DKB0.js.map +0 -1
  256. package/dist/admin/CreatePage-puzZjQXr.mjs.map +0 -1
  257. package/dist/admin/CreateView-5V271zBl.js +0 -17
  258. package/dist/admin/CreateView-VYprogwB.js +0 -17
  259. package/dist/admin/EditPage-8_dXc9y1.mjs.map +0 -1
  260. package/dist/admin/EditPage-8fk5JEO7.mjs.map +0 -1
  261. package/dist/admin/EditPage-HsLjcfgK.js.map +0 -1
  262. package/dist/admin/EditPage-W_qlhF-2.mjs.map +0 -1
  263. package/dist/admin/EditPage-WuJtih1X.js.map +0 -1
  264. package/dist/admin/EditPage-vRwS2OJZ.js.map +0 -1
  265. package/dist/admin/EditView-Cac025JW.mjs.map +0 -1
  266. package/dist/admin/EditView-lhhZAQtN.js.map +0 -1
  267. package/dist/admin/EditViewPage-Q7N1TLU9.js.map +0 -1
  268. package/dist/admin/EditViewPage-f56oKqQ-.mjs.map +0 -1
  269. package/dist/admin/HomePage-4Hk9puW_.js.map +0 -1
  270. package/dist/admin/HomePage-d4h0KEnw.mjs.map +0 -1
  271. package/dist/admin/Layout-Ax9QtxH1.mjs.map +0 -1
  272. package/dist/admin/Layout-Bmmqv9h6.js.map +0 -1
  273. package/dist/admin/ListPage-10_h7FUt.js.map +0 -1
  274. package/dist/admin/ListPage-4kGSO2Ri.mjs.map +0 -1
  275. package/dist/admin/ListPage-4nzagne8.js.map +0 -1
  276. package/dist/admin/ListPage-EPIYY3Uf.mjs.map +0 -1
  277. package/dist/admin/ListPage-IgkmnCSY.js.map +0 -1
  278. package/dist/admin/ListPage-OE9xQffQ.mjs.map +0 -1
  279. package/dist/admin/ListPage-TWLqkRt6.js.map +0 -1
  280. package/dist/admin/ListPage-VGqEsiEA.mjs.map +0 -1
  281. package/dist/admin/MarketplacePage-MVRrpUSk.js.map +0 -1
  282. package/dist/admin/MarketplacePage-oGhZBKgX.mjs.map +0 -1
  283. package/dist/admin/Permissions-kNVZVLmu.js.map +0 -1
  284. package/dist/admin/Permissions-lf6dNG4S.mjs.map +0 -1
  285. package/dist/admin/ProfilePage-ZlpnTKEF.js.map +0 -1
  286. package/dist/admin/ProfilePage-zk-Py9wt.mjs.map +0 -1
  287. package/dist/admin/SSOProviders-AirHFyBl.js.map +0 -1
  288. package/dist/admin/SSOProviders-t8D-v8As.mjs.map +0 -1
  289. package/dist/admin/SingleSignOnPage-3Mfu4dgn.js.map +0 -1
  290. package/dist/admin/SingleSignOnPage-wPZ1tqEk.mjs.map +0 -1
  291. package/dist/admin/Table-N9PZc6xL.js.map +0 -1
  292. package/dist/admin/Table-OcYvBab7.mjs.map +0 -1
  293. package/dist/admin/TokenTypeSelect-dWn05yGP.js.map +0 -1
  294. package/dist/admin/TokenTypeSelect-v6IYPaBF.mjs.map +0 -1
  295. package/dist/admin/index-EQL2s09p.mjs.map +0 -1
  296. package/dist/admin/index-duYn5r8_.js.map +0 -1
  297. package/dist/admin/rbac-5b9ylhpa.js.map +0 -1
  298. package/dist/admin/rbac-oJEkQdXG.mjs.map +0 -1
  299. package/dist/admin/selectors-NDEu6dJa.js +0 -8
@@ -1,35 +1,34 @@
1
1
  import { createRoot } from 'react-dom/client';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
- import * as React from 'react';
4
- import { useEffect, Suspense, useCallback, useMemo, useState, forwardRef, memo } from 'react';
5
- import { Link, Alert, Typography, Main, Flex, Button, useCallbackRef, useComposedRefs, Dialog, DialogBody, DialogFooter, Field, Toggle, Checkbox, DatePicker, DateTimePicker, TextInput, SingleSelect, SingleSelectOption, JSONInput, NumberInput, Textarea, TimePicker, Box, Portal, IconButton, VisuallyHidden, Grid, GridItem, EmptyStateLayout, LinkButton, lightTheme, darkTheme, PopoverPrimitives, Tag, Pagination as Pagination$1, PreviousLink, PageLink, Dots, NextLink, SearchForm, Searchbar, Table as Table$1, Thead, Tr, Th, Tooltip, BaseCheckbox, Tbody, Td, Loader } from '@strapi/design-system';
3
+ import { Link, Alert, Typography, Main, Flex, Button, Box, useCallbackRef, EmptyStateLayout, LinkButton, useComposedRefs, Dialog, Field, Toggle, Checkbox, DatePicker, DateTimePicker, TextInput, SingleSelect, SingleSelectOption, JSONInput, NumberInput, Textarea, TimePicker, Portal, IconButton, VisuallyHidden, Grid, lightTheme, darkTheme, Popover, Tag, Pagination as Pagination$1, PreviousLink, PageLink, Dots, NextLink, SearchForm, Searchbar, Table as Table$1, Thead, Tr, Th, Tooltip, Tbody, Td, Loader } from '@strapi/design-system';
6
4
  import invariant from 'invariant';
7
5
  import isFunction from 'lodash/isFunction';
8
6
  import merge from 'lodash/merge';
9
7
  import pick from 'lodash/pick';
8
+ import { NavLink, useLocation, useNavigate, Outlet, useRouteError, Link as Link$1, useBlocker, useMatch, Navigate, createMemoryRouter, createBrowserRouter, RouterProvider } from 'react-router-dom';
9
+ import { x as createContext, S as StrapiAppProvider, A as AuthProvider, L as LanguageProvider, T as Theme, N as NotificationsProvider, y as TrackingProvider, z as ConfigurationProvider, B as LANGUAGE_LOCAL_STORAGE_KEY, P as Page, D as getIn, E as setIn, p as useConfiguration, b as useTypedSelector, e as useTypedDispatch, F as setLocale, u as useAuth, f as useAPIErrorHandler, G as useForgotPasswordMutation, a as useNotification, n as useAppInfo, d as useTracking, H as useGetRegistrationInfoQuery, I as useRegisterAdminMutation, J as useRegisterUserMutation, m as login, K as useResetPasswordMutation, r as reducer$3, M as logout, R as RBAC, O as THEME_LOCAL_STORAGE_KEY, q as getStoredToken, Q as useTypedStore } from './Theme-PrUuuGtN.mjs';
10
10
  import { Provider as Provider$1 } from 'react-redux';
11
- import { NavLink, useLocation, useNavigate, Outlet, useRouteError, useBlocker, useMatch, Navigate, Link as Link$1, createBrowserRouter, RouterProvider } from 'react-router-dom';
12
- import { t as createContext, S as StrapiAppProvider, A as AuthProvider, L as LanguageProvider, T as Theme, N as NotificationsProvider, v as TrackingProvider, w as ConfigurationProvider, x as LANGUAGE_LOCAL_STORAGE_KEY, P as Page, r as reducer$3, o as useConfiguration, b as useTypedSelector, e as useTypedDispatch, y as setLocale, a as useAuth, f as useAPIErrorHandler, z as useForgotPasswordMutation, u as useNotification, m as useAppInfo, d as useTracking, B as useGetRegistrationInfoQuery, D as useRegisterAdminMutation, E as useRegisterUserMutation, F as useResetPasswordMutation, R as RBAC, G as THEME_LOCAL_STORAGE_KEY, H as useTypedStore } from './rbac-oJEkQdXG.mjs';
11
+ import * as React from 'react';
12
+ import { useEffect, Suspense, useCallback, useMemo, useState, forwardRef, memo } from 'react';
13
13
  import { QueryClient, QueryClientProvider } from 'react-query';
14
- import { ArrowLeft, WarningCircle, Duplicate, Eye, EyeStriked, Cross, ArrowRight, Filter, Plus, Search, CaretDown } from '@strapi/icons';
14
+ import { ArrowLeft, WarningCircle, Duplicate, ArrowRight, Eye, EyeStriked, Cross, Filter, Plus, Search, CaretDown } from '@strapi/icons';
15
15
  import { produce } from 'immer';
16
16
  import { useIntl } from 'react-intl';
17
17
  import get from 'lodash/get';
18
18
  import set from 'lodash/set';
19
19
  import { styled } from 'styled-components';
20
- import { configureStore, combineReducers } from '@reduxjs/toolkit';
21
- import { b as adminApi, i as isBaseQueryError, e as useInitQuery, j as createAbsoluteUrl, k as getFetchClient } from './admin-B6AW0Kov.mjs';
20
+ import { EmptyPictures, EmptyDocuments } from '@strapi/icons/symbols';
22
21
  import { u as useEnterprise } from './useEnterprise-jpsYZWzn.mjs';
22
+ import { i as isBaseQueryError, e as useInitQuery, b as adminApi, j as createAbsoluteUrl, k as getFetchClient } from './admin-B6AW0Kov.mjs';
23
23
  import camelCase from 'lodash/camelCase';
24
24
  import * as yup from 'yup';
25
25
  import { ValidationError } from 'yup';
26
26
  import { generateNKeysBetween } from 'fractional-indexing';
27
27
  import isEqual from 'lodash/isEqual';
28
- import clone from 'lodash/clone';
29
- import toPath from 'lodash/toPath';
28
+ import { getLocalTimeZone, parseAbsolute, toCalendarDate } from '@internationalized/date';
30
29
  import omit from 'lodash/omit';
31
30
  import { Formik, Form as Form$1 } from 'formik';
32
- import { EmptyPictures, EmptyDocuments } from '@strapi/icons/symbols';
31
+ import { configureStore, isRejected, combineReducers } from '@reduxjs/toolkit';
33
32
  import throttle from 'lodash/throttle';
34
33
  import { parse, stringify } from 'qs';
35
34
 
@@ -68,7 +67,7 @@ const getEERoutes$1 = () => window.strapi.isEE ? [
68
67
  {
69
68
  path: "auth/login/:authResponse",
70
69
  lazy: async () => {
71
- const { AuthResponse } = await import('./AuthResponse-Y4lblDuD.mjs');
70
+ const { AuthResponse } = await import('./AuthResponse-J8A48xdo.mjs');
72
71
  return {
73
72
  Component: AuthResponse
74
73
  };
@@ -103,375 +102,649 @@ const constants = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
103
102
  getEERoutes: getEERoutes$1
104
103
  }, Symbol.toStringTag, { value: 'Module' }));
105
104
 
106
- const getEERoutes = () => [
107
- ...window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) ? [
108
- {
109
- path: "audit-logs",
110
- lazy: async () => {
111
- const { ProtectedListPage } = await import('./ListPage-OE9xQffQ.mjs');
112
- return {
113
- Component: ProtectedListPage
114
- };
105
+ const StrapiLogo = "data:image/svg+xml,%3csvg%20width='800'%20height='800'%20viewBox='0%200%20800%20800'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M39%20282c0-118%200-176.9%2036.6-213.5C112.2%2032%20171.1%2032%20288.9%2032h221.2c117.8%200%20176.7%200%20213.3%2036.6C760%20105.2%20760%20164.1%20760%20281.9v221.2c0%20117.8%200%20176.7-36.6%20213.3C686.8%20753%20627.9%20753%20510.1%20753H288.9c-117.8%200-176.7%200-213.3-36.6C39%20679.8%2039%20620.9%2039%20503.1V281.9Z'%20fill='%234945FF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M536.4%20250.7H293.7v123.8h123.8v123.7h123.8V255.5c0-2.6-2.2-4.8-4.9-4.8Z'%20fill='%23fff'/%3e%3cpath%20fill='%23fff'%20d='M412.7%20374.5h4.8v4.8h-4.8z'/%3e%3cpath%20d='M293.8%20374.5h119c2.6%200%204.8%202.1%204.8%204.8v119h-119a4.8%204.8%200%200%201-4.8-4.9v-119Z'%20fill='%239593FF'/%3e%3cpath%20d='M417.5%20498.2h123.8L421.6%20618a2.4%202.4%200%200%201-4-1.7v-118ZM293.8%20374.5h-118a2.4%202.4%200%200%201-1.7-4.1l119.7-119.7v123.8Z'%20fill='%239593FF'/%3e%3c/svg%3e";
106
+
107
+ const ADMIN_PERMISSIONS_CE = {
108
+ contentManager: {
109
+ main: [],
110
+ collectionTypesConfigurations: [
111
+ {
112
+ action: "plugin::content-manager.collection-types.configure-view",
113
+ subject: null
115
114
  }
116
- }
117
- ] : [],
118
- ...window.strapi.features.isEnabled(window.strapi.features.SSO) ? [
119
- {
120
- path: "single-sign-on",
121
- lazy: async () => {
122
- const { ProtectedSSO } = await import('./SingleSignOnPage-wPZ1tqEk.mjs');
123
- return {
124
- Component: ProtectedSSO
125
- };
115
+ ],
116
+ componentsConfigurations: [
117
+ {
118
+ action: "plugin::content-manager.components.configure-layout",
119
+ subject: null
126
120
  }
127
- }
128
- ] : []
129
- ];
130
-
131
- const [Provider, useHistory] = createContext("History", {
132
- history: [],
133
- currentLocationIndex: 0,
134
- currentLocation: "",
135
- canGoBack: false,
136
- pushState: () => {
137
- throw new Error("You must use the `HistoryProvider` to access the `pushState` function.");
138
- },
139
- goBack: () => {
140
- throw new Error("You must use the `HistoryProvider` to access the `goBack` function.");
141
- }
142
- });
143
- const HistoryProvider = ({ children }) => {
144
- const location = useLocation();
145
- const navigate = useNavigate();
146
- const [state, dispatch] = React.useReducer(reducer$2, {
147
- history: [],
148
- currentLocationIndex: 0,
149
- currentLocation: "",
150
- canGoBack: false
151
- });
152
- const isGoingBack = React.useRef(false);
153
- const pushState = React.useCallback((path) => {
154
- dispatch({
155
- type: "PUSH_STATE",
156
- payload: typeof path === "string" ? { to: path, search: "" } : path
157
- });
158
- }, []);
159
- const goBack = React.useCallback(() => {
160
- navigate(-1);
161
- dispatch({ type: "GO_BACK" });
162
- isGoingBack.current = true;
163
- }, [navigate]);
164
- const prevIndex = React.useRef(state.currentLocationIndex);
165
- React.useEffect(() => {
166
- if (state.currentLocationIndex !== prevIndex.current) {
167
- dispatch({
168
- type: "SET_CAN_GO_BACK",
169
- payload: state.currentLocationIndex > 1 && state.history.length > 1
170
- });
171
- prevIndex.current = state.currentLocationIndex;
172
- }
173
- }, [prevIndex, state.currentLocationIndex, state.history.length]);
174
- React.useLayoutEffect(() => {
175
- if (isGoingBack.current) {
176
- isGoingBack.current = false;
177
- } else {
178
- dispatch({
179
- type: "PUSH_STATE",
180
- payload: { to: location.pathname, search: location.search }
181
- });
182
- }
183
- }, [dispatch, location.pathname, location.search]);
184
- return /* @__PURE__ */ jsx(Provider, { pushState, goBack, ...state, children });
185
- };
186
- const reducer$2 = (state, action) => produce(state, (draft) => {
187
- switch (action.type) {
188
- case "PUSH_STATE": {
189
- const path = `${action.payload.to}${action.payload.search}`;
190
- if (state.currentLocationIndex === state.history.length) {
191
- draft.history = [...state.history, path];
192
- } else {
193
- draft.history = [...state.history.slice(0, state.currentLocationIndex), path];
121
+ ],
122
+ singleTypesConfigurations: [
123
+ {
124
+ action: "plugin::content-manager.single-types.configure-view",
125
+ subject: null
194
126
  }
195
- draft.currentLocation = path;
196
- draft.currentLocationIndex += 1;
197
- break;
198
- }
199
- case "GO_BACK": {
200
- const newIndex = state.currentLocationIndex - 1;
201
- draft.currentLocation = state.history[newIndex - 1];
202
- draft.currentLocationIndex = newIndex;
203
- break;
204
- }
205
- case "SET_CAN_GO_BACK": {
206
- draft.canGoBack = action.payload;
207
- break;
127
+ ]
128
+ },
129
+ marketplace: {
130
+ main: [{ action: "admin::marketplace.read", subject: null }],
131
+ read: [{ action: "admin::marketplace.read", subject: null }]
132
+ },
133
+ settings: {
134
+ roles: {
135
+ main: [
136
+ { action: "admin::roles.create", subject: null },
137
+ { action: "admin::roles.update", subject: null },
138
+ { action: "admin::roles.read", subject: null },
139
+ { action: "admin::roles.delete", subject: null }
140
+ ],
141
+ create: [{ action: "admin::roles.create", subject: null }],
142
+ delete: [{ action: "admin::roles.delete", subject: null }],
143
+ read: [{ action: "admin::roles.read", subject: null }],
144
+ update: [{ action: "admin::roles.update", subject: null }]
145
+ },
146
+ users: {
147
+ main: [
148
+ { action: "admin::users.create", subject: null },
149
+ { action: "admin::users.read", subject: null },
150
+ { action: "admin::users.update", subject: null },
151
+ { action: "admin::users.delete", subject: null }
152
+ ],
153
+ create: [{ action: "admin::users.create", subject: null }],
154
+ delete: [{ action: "admin::users.delete", subject: null }],
155
+ read: [{ action: "admin::users.read", subject: null }],
156
+ update: [{ action: "admin::users.update", subject: null }]
157
+ },
158
+ webhooks: {
159
+ main: [
160
+ { action: "admin::webhooks.create", subject: null },
161
+ { action: "admin::webhooks.read", subject: null },
162
+ { action: "admin::webhooks.update", subject: null },
163
+ { action: "admin::webhooks.delete", subject: null }
164
+ ],
165
+ create: [{ action: "admin::webhooks.create", subject: null }],
166
+ delete: [{ action: "admin::webhooks.delete", subject: null }],
167
+ read: [
168
+ { action: "admin::webhooks.read", subject: null },
169
+ // NOTE: We need to check with the API
170
+ { action: "admin::webhooks.update", subject: null },
171
+ { action: "admin::webhooks.delete", subject: null }
172
+ ],
173
+ update: [{ action: "admin::webhooks.update", subject: null }]
174
+ },
175
+ "api-tokens": {
176
+ main: [{ action: "admin::api-tokens.access", subject: null }],
177
+ create: [{ action: "admin::api-tokens.create", subject: null }],
178
+ delete: [{ action: "admin::api-tokens.delete", subject: null }],
179
+ read: [{ action: "admin::api-tokens.read", subject: null }],
180
+ update: [{ action: "admin::api-tokens.update", subject: null }],
181
+ regenerate: [{ action: "admin::api-tokens.regenerate", subject: null }]
182
+ },
183
+ "transfer-tokens": {
184
+ main: [{ action: "admin::transfer.tokens.access", subject: null }],
185
+ create: [{ action: "admin::transfer.tokens.create", subject: null }],
186
+ delete: [{ action: "admin::transfer.tokens.delete", subject: null }],
187
+ read: [{ action: "admin::transfer.tokens.read", subject: null }],
188
+ update: [{ action: "admin::transfer.tokens.update", subject: null }],
189
+ regenerate: [{ action: "admin::transfer.tokens.regenerate", subject: null }]
190
+ },
191
+ "project-settings": {
192
+ read: [{ action: "admin::project-settings.read", subject: null }],
193
+ update: [{ action: "admin::project-settings.update", subject: null }]
208
194
  }
209
195
  }
210
- });
211
- const BackButton = React.forwardRef(({ disabled }, ref) => {
212
- const { formatMessage } = useIntl();
213
- const canGoBack = useHistory("BackButton", (state) => state.canGoBack);
214
- const goBack = useHistory("BackButton", (state) => state.goBack);
215
- const history = useHistory("BackButton", (state) => state.history);
216
- const handleClick = (e) => {
217
- e.preventDefault();
218
- goBack();
219
- };
220
- return /* @__PURE__ */ jsx(
221
- Link,
196
+ };
197
+ const HOOKS = {
198
+ /**
199
+ * Hook that allows to mutate the displayed headers of the list view table
200
+ * @constant
201
+ * @type {string}
202
+ */
203
+ INJECT_COLUMN_IN_TABLE: "Admin/CM/pages/ListView/inject-column-in-table",
204
+ /**
205
+ * Hook that allows to mutate the CM's collection types links pre-set filters
206
+ * @constant
207
+ * @type {string}
208
+ */
209
+ MUTATE_COLLECTION_TYPES_LINKS: "Admin/CM/pages/App/mutate-collection-types-links",
210
+ /**
211
+ * Hook that allows to mutate the CM's edit view layout
212
+ * @constant
213
+ * @type {string}
214
+ */
215
+ MUTATE_EDIT_VIEW_LAYOUT: "Admin/CM/pages/EditView/mutate-edit-view-layout",
216
+ /**
217
+ * Hook that allows to mutate the CM's single types links pre-set filters
218
+ * @constant
219
+ * @type {string}
220
+ */
221
+ MUTATE_SINGLE_TYPES_LINKS: "Admin/CM/pages/App/mutate-single-types-links"
222
+ };
223
+ const SETTINGS_LINKS_CE = () => ({
224
+ global: [
222
225
  {
223
- ref,
224
- tag: NavLink,
225
- to: history.at(-1) ?? "",
226
- onClick: handleClick,
227
- disabled: disabled || !canGoBack,
228
- "aria-disabled": disabled || !canGoBack,
229
- startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
230
- children: formatMessage({
231
- id: "global.back",
232
- defaultMessage: "Back"
233
- })
234
- }
235
- );
236
- });
237
-
238
- const GUIDED_TOUR_COMPLETED_STEPS = "GUIDED_TOUR_COMPLETED_STEPS";
239
- const GUIDED_TOUR_CURRENT_STEP = "GUIDED_TOUR_CURRENT_STEP";
240
- const GUIDED_TOUR_SKIPPED = "GUIDED_TOUR_SKIPPED";
241
- const [GuidedTourProviderImpl, useGuidedTour] = createContext("GuidedTour");
242
- const GuidedTourProvider = ({ children }) => {
243
- const [{ currentStep, guidedTourState, isGuidedTourVisible, isSkipped }, dispatch] = React.useReducer(reducer$1, initialState, initialiseState);
244
- const setCurrentStep = (step) => {
245
- if (step !== null) {
246
- const isStepAlreadyDone = get(guidedTourState, step);
247
- const [sectionName, stepName] = step.split(".");
248
- const sectionArray = Object.entries(guidedTourState[sectionName]);
249
- const currentStepIndex = sectionArray.findIndex(([key]) => key === stepName);
250
- const previousSteps = sectionArray.slice(0, currentStepIndex);
251
- const isStepToShow = previousSteps.every(([, sectionValue]) => sectionValue);
252
- if (isStepAlreadyDone || isSkipped || !isStepToShow) {
253
- return null;
226
+ intlLabel: { id: "Settings.application.title", defaultMessage: "Overview" },
227
+ to: "/settings/application-infos",
228
+ id: "000-application-infos"
229
+ },
230
+ {
231
+ intlLabel: { id: "Settings.webhooks.title", defaultMessage: "Webhooks" },
232
+ to: "/settings/webhooks",
233
+ id: "webhooks"
234
+ },
235
+ {
236
+ intlLabel: { id: "Settings.apiTokens.title", defaultMessage: "API Tokens" },
237
+ to: "/settings/api-tokens?sort=name:ASC",
238
+ id: "api-tokens"
239
+ },
240
+ {
241
+ intlLabel: { id: "Settings.transferTokens.title", defaultMessage: "Transfer Tokens" },
242
+ to: "/settings/transfer-tokens?sort=name:ASC",
243
+ id: "transfer-tokens"
244
+ },
245
+ // If the Enterprise/Cloud feature is not enabled and if the config doesn't disable it, we promote the Enterprise/Cloud feature by displaying them in the settings menu.
246
+ // Disable this by adding "promoteEE: false" to your `./config/admin.js` file
247
+ ...!window.strapi.features.isEnabled(window.strapi.features.SSO) && window.strapi?.flags?.promoteEE ? [
248
+ {
249
+ intlLabel: { id: "Settings.sso.title", defaultMessage: "Single Sign-On" },
250
+ to: "/settings/purchase-single-sign-on",
251
+ id: "sso-purchase-page",
252
+ licenseOnly: true
254
253
  }
255
- }
256
- window.localStorage.setItem(GUIDED_TOUR_CURRENT_STEP, JSON.stringify(null));
257
- return dispatch({
258
- type: "SET_CURRENT_STEP",
259
- step
260
- });
261
- };
262
- const setGuidedTourVisibility = (value) => {
263
- dispatch({
264
- type: "SET_GUIDED_TOUR_VISIBILITY",
265
- value
266
- });
267
- };
268
- const setStepState = (currentStep2, value) => {
269
- addCompletedStep(currentStep2);
270
- dispatch({
271
- type: "SET_STEP_STATE",
272
- currentStep: currentStep2,
273
- value
274
- });
275
- };
276
- const startSection = (sectionName) => {
277
- const sectionSteps = guidedTourState[sectionName];
278
- if (sectionSteps) {
279
- const guidedTourArray = Object.entries(guidedTourState);
280
- const currentSectionIndex = guidedTourArray.findIndex(([key]) => key === sectionName);
281
- const previousSections = guidedTourArray.slice(0, currentSectionIndex);
282
- const isSectionToShow = previousSections.every(
283
- ([, sectionValue]) => Object.values(sectionValue).every(Boolean)
254
+ ] : []
255
+ ],
256
+ admin: [
257
+ {
258
+ intlLabel: { id: "global.roles", defaultMessage: "Roles" },
259
+ to: "/settings/roles",
260
+ id: "roles"
261
+ },
262
+ {
263
+ intlLabel: { id: "global.users", defaultMessage: "Users" },
264
+ // Init the search params directly
265
+ to: "/settings/users?pageSize=10&page=1&sort=firstname",
266
+ id: "users"
267
+ },
268
+ ...!window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) && window.strapi?.flags?.promoteEE ? [
269
+ {
270
+ intlLabel: { id: "global.auditLogs", defaultMessage: "Audit Logs" },
271
+ to: "/settings/purchase-audit-logs",
272
+ id: "auditLogs-purchase-page",
273
+ licenseOnly: true
274
+ }
275
+ ] : []
276
+ ]
277
+ });
278
+
279
+ const ALLOWED_TYPES = [
280
+ "biginteger",
281
+ "boolean",
282
+ "date",
283
+ "datetime",
284
+ "decimal",
285
+ "email",
286
+ "enumeration",
287
+ "float",
288
+ "integer",
289
+ "json",
290
+ "password",
291
+ "richtext",
292
+ "string",
293
+ "text",
294
+ "time",
295
+ "uid"
296
+ ];
297
+ const ALLOWED_ROOT_LEVEL_OPTIONS = [
298
+ "min",
299
+ "minLength",
300
+ "max",
301
+ "maxLength",
302
+ "required",
303
+ "regex",
304
+ "enum",
305
+ "unique",
306
+ "private",
307
+ "default"
308
+ ];
309
+ class CustomFields {
310
+ customFields;
311
+ constructor() {
312
+ this.customFields = {};
313
+ }
314
+ register = (customFields) => {
315
+ if (Array.isArray(customFields)) {
316
+ customFields.forEach((customField) => {
317
+ this.register(customField);
318
+ });
319
+ } else {
320
+ const { name, pluginId, type, intlLabel, intlDescription, components, options } = customFields;
321
+ invariant(name, "A name must be provided");
322
+ invariant(type, "A type must be provided");
323
+ invariant(intlLabel, "An intlLabel must be provided");
324
+ invariant(intlDescription, "An intlDescription must be provided");
325
+ invariant(components, "A components object must be provided");
326
+ invariant(components.Input, "An Input component must be provided");
327
+ invariant(
328
+ ALLOWED_TYPES.includes(type),
329
+ `Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`
284
330
  );
285
- const [firstStep] = Object.keys(sectionSteps);
286
- const isFirstStepDone = sectionSteps[firstStep];
287
- if (isSectionToShow && !currentStep && !isFirstStepDone) {
288
- setCurrentStep(`${sectionName}.${firstStep}`);
331
+ const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;
332
+ invariant(
333
+ isValidObjectKey.test(name),
334
+ `Custom field name: '${name}' is not a valid object key`
335
+ );
336
+ const allFormOptions = [...options?.base || [], ...options?.advanced || []];
337
+ if (allFormOptions.length) {
338
+ const optionPathValidations = allFormOptions.reduce(optionsValidationReducer, []);
339
+ optionPathValidations.forEach(({ isValidOptionPath, errorMessage }) => {
340
+ invariant(isValidOptionPath, errorMessage);
341
+ });
289
342
  }
343
+ const uid = pluginId ? `plugin::${pluginId}.${name}` : `global::${name}`;
344
+ const uidAlreadyUsed = Object.prototype.hasOwnProperty.call(this.customFields, uid);
345
+ invariant(!uidAlreadyUsed, `Custom field: '${uid}' has already been registered`);
346
+ this.customFields[uid] = customFields;
290
347
  }
291
348
  };
292
- const setSkipped = (value) => {
293
- window.localStorage.setItem(GUIDED_TOUR_SKIPPED, JSON.stringify(value));
294
- dispatch({
295
- type: "SET_SKIPPED",
296
- value
297
- });
349
+ getAll = () => {
350
+ return this.customFields;
298
351
  };
299
- return /* @__PURE__ */ jsx(
300
- GuidedTourProviderImpl,
301
- {
302
- guidedTourState,
303
- currentStep,
304
- setCurrentStep,
305
- setGuidedTourVisibility,
306
- setSkipped,
307
- setStepState,
308
- startSection,
309
- isGuidedTourVisible,
310
- isSkipped,
311
- children
312
- }
313
- );
314
- };
315
- const initialState = {
316
- currentStep: null,
317
- guidedTourState: {
318
- contentTypeBuilder: {
319
- create: false,
320
- success: false
321
- },
322
- contentManager: {
323
- create: false,
324
- success: false
325
- },
326
- apiTokens: {
327
- create: false,
328
- success: false
329
- },
330
- transferTokens: {
331
- create: false,
332
- success: false
333
- }
334
- },
335
- isGuidedTourVisible: false,
336
- isSkipped: false
337
- };
338
- const reducer$1 = (state = initialState, action) => produce(state, (draftState) => {
339
- switch (action.type) {
340
- case "SET_CURRENT_STEP": {
341
- draftState.currentStep = action.step;
342
- break;
343
- }
344
- case "SET_STEP_STATE": {
345
- const [section, step] = action.currentStep.split(".");
346
- draftState.guidedTourState[section][step] = action.value;
347
- break;
348
- }
349
- case "SET_SKIPPED": {
350
- draftState.isSkipped = action.value;
351
- break;
352
- }
353
- case "SET_GUIDED_TOUR_VISIBILITY": {
354
- draftState.isGuidedTourVisible = action.value;
355
- break;
356
- }
357
- default: {
358
- return draftState;
359
- }
352
+ get = (uid) => {
353
+ return this.customFields[uid];
354
+ };
355
+ }
356
+ const optionsValidationReducer = (acc, option) => {
357
+ if ("items" in option) {
358
+ return option.items.reduce(optionsValidationReducer, acc);
360
359
  }
361
- });
362
- const initialiseState = (initialState2) => {
363
- const copyInitialState = { ...initialState2 };
364
- const guidedTourLocaleStorage = JSON.parse(
365
- window.localStorage.getItem(GUIDED_TOUR_COMPLETED_STEPS) ?? "[]"
366
- );
367
- const currentStepLocaleStorage = JSON.parse(
368
- window.localStorage.getItem(GUIDED_TOUR_CURRENT_STEP) ?? "null"
369
- );
370
- const skippedLocaleStorage = JSON.parse(
371
- window.localStorage.getItem(GUIDED_TOUR_SKIPPED) ?? "false"
372
- );
373
- if (Array.isArray(guidedTourLocaleStorage)) {
374
- guidedTourLocaleStorage.forEach((step) => {
375
- const [sectionName, stepName] = step.split(".");
376
- set(copyInitialState, ["guidedTourState", sectionName, stepName], true);
360
+ if (!option.name) {
361
+ acc.push({
362
+ isValidOptionPath: false,
363
+ errorMessage: "The 'name' property is required on an options object"
364
+ });
365
+ } else {
366
+ acc.push({
367
+ isValidOptionPath: option.name.startsWith("options") || ALLOWED_ROOT_LEVEL_OPTIONS.includes(option.name),
368
+ errorMessage: `'${option.name}' must be prefixed with 'options.'`
377
369
  });
378
370
  }
379
- if (currentStepLocaleStorage) {
380
- const [sectionName, stepName] = currentStepLocaleStorage.split(".");
381
- set(copyInitialState, ["guidedTourState", sectionName, stepName], true);
382
- addCompletedStep(currentStepLocaleStorage);
383
- window.localStorage.setItem(GUIDED_TOUR_CURRENT_STEP, JSON.stringify(null));
371
+ return acc;
372
+ };
373
+
374
+ class Plugin {
375
+ apis;
376
+ initializer;
377
+ injectionZones;
378
+ isReady;
379
+ name;
380
+ pluginId;
381
+ constructor(pluginConf) {
382
+ this.apis = pluginConf.apis || {};
383
+ this.initializer = pluginConf.initializer || null;
384
+ this.injectionZones = pluginConf.injectionZones || {};
385
+ this.isReady = pluginConf.isReady !== void 0 ? pluginConf.isReady : true;
386
+ this.name = pluginConf.name;
387
+ this.pluginId = pluginConf.id;
384
388
  }
385
- if (skippedLocaleStorage !== null) {
386
- set(copyInitialState, "isSkipped", skippedLocaleStorage);
389
+ getInjectedComponents(containerName, blockName) {
390
+ try {
391
+ return this.injectionZones[containerName][blockName] || [];
392
+ } catch (err) {
393
+ console.error("Cannot get injected component", err);
394
+ return [];
395
+ }
387
396
  }
388
- return copyInitialState;
389
- };
390
- const addCompletedStep = (completedStep) => {
391
- const currentSteps = JSON.parse(window.localStorage.getItem(GUIDED_TOUR_COMPLETED_STEPS) ?? "[]");
392
- if (!Array.isArray(currentSteps)) {
393
- return;
397
+ injectComponent(containerName, blockName, component) {
398
+ try {
399
+ this.injectionZones[containerName][blockName].push(component);
400
+ } catch (err) {
401
+ console.error("Cannot inject component", err);
402
+ }
394
403
  }
395
- const isAlreadyStored = currentSteps.includes(completedStep);
396
- if (isAlreadyStored) {
397
- return;
404
+ }
405
+
406
+ const [Provider, useHistory] = createContext("History", {
407
+ history: [],
408
+ currentLocationIndex: 0,
409
+ currentLocation: "",
410
+ canGoBack: false,
411
+ pushState: () => {
412
+ throw new Error("You must use the `HistoryProvider` to access the `pushState` function.");
413
+ },
414
+ goBack: () => {
415
+ throw new Error("You must use the `HistoryProvider` to access the `goBack` function.");
398
416
  }
399
- window.localStorage.setItem(
400
- GUIDED_TOUR_COMPLETED_STEPS,
401
- JSON.stringify([...currentSteps, completedStep])
402
- );
417
+ });
418
+ const HistoryProvider = ({ children }) => {
419
+ const location = useLocation();
420
+ const navigate = useNavigate();
421
+ const [state, dispatch] = React.useReducer(reducer$2, {
422
+ history: [],
423
+ currentLocationIndex: 0,
424
+ currentLocation: "",
425
+ canGoBack: false
426
+ });
427
+ const isGoingBack = React.useRef(false);
428
+ const pushState = React.useCallback((path) => {
429
+ dispatch({
430
+ type: "PUSH_STATE",
431
+ payload: typeof path === "string" ? { to: path, search: "" } : path
432
+ });
433
+ }, []);
434
+ const goBack = React.useCallback(() => {
435
+ navigate(-1);
436
+ dispatch({ type: "GO_BACK" });
437
+ isGoingBack.current = true;
438
+ }, [navigate]);
439
+ const prevIndex = React.useRef(state.currentLocationIndex);
440
+ React.useEffect(() => {
441
+ if (state.currentLocationIndex !== prevIndex.current) {
442
+ dispatch({
443
+ type: "SET_CAN_GO_BACK",
444
+ payload: state.currentLocationIndex > 1 && state.history.length > 1
445
+ });
446
+ prevIndex.current = state.currentLocationIndex;
447
+ }
448
+ }, [prevIndex, state.currentLocationIndex, state.history.length]);
449
+ React.useLayoutEffect(() => {
450
+ if (isGoingBack.current) {
451
+ isGoingBack.current = false;
452
+ } else {
453
+ dispatch({
454
+ type: "PUSH_STATE",
455
+ payload: { to: location.pathname, search: location.search }
456
+ });
457
+ }
458
+ }, [dispatch, location.pathname, location.search]);
459
+ return /* @__PURE__ */ jsx(Provider, { pushState, goBack, ...state, children });
403
460
  };
404
-
405
- const queryClient = new QueryClient({
406
- defaultOptions: {
407
- queries: {
408
- refetchOnWindowFocus: false
461
+ const reducer$2 = (state, action) => produce(state, (draft) => {
462
+ switch (action.type) {
463
+ case "PUSH_STATE": {
464
+ const path = `${action.payload.to}${action.payload.search}`;
465
+ if (state.currentLocationIndex === state.history.length) {
466
+ draft.history = [...state.history, path];
467
+ } else {
468
+ draft.history = [...state.history.slice(0, state.currentLocationIndex), path];
469
+ }
470
+ draft.currentLocation = path;
471
+ draft.currentLocationIndex += 1;
472
+ break;
473
+ }
474
+ case "GO_BACK": {
475
+ const newIndex = state.currentLocationIndex - 1;
476
+ draft.currentLocation = state.history[newIndex - 1];
477
+ draft.currentLocationIndex = newIndex;
478
+ break;
479
+ }
480
+ case "SET_CAN_GO_BACK": {
481
+ draft.canGoBack = action.payload;
482
+ break;
409
483
  }
410
484
  }
411
485
  });
412
- const Providers = ({ children, strapi, store }) => {
486
+ const BackButton = React.forwardRef(({ disabled }, ref) => {
487
+ const { formatMessage } = useIntl();
488
+ const canGoBack = useHistory("BackButton", (state) => state.canGoBack);
489
+ const goBack = useHistory("BackButton", (state) => state.goBack);
490
+ const history = useHistory("BackButton", (state) => state.history);
491
+ const handleClick = (e) => {
492
+ e.preventDefault();
493
+ goBack();
494
+ };
413
495
  return /* @__PURE__ */ jsx(
414
- StrapiAppProvider,
496
+ Link,
415
497
  {
416
- components: strapi.library.components,
417
- customFields: strapi.customFields,
418
- fields: strapi.library.fields,
419
- menu: strapi.menu,
420
- getAdminInjectedComponents: strapi.getAdminInjectedComponents,
421
- getPlugin: strapi.getPlugin,
422
- plugins: strapi.plugins,
423
- rbac: strapi.rbac,
424
- runHookParallel: strapi.runHookParallel,
425
- runHookWaterfall: (name, initialValue) => strapi.runHookWaterfall(name, initialValue, store),
426
- runHookSeries: strapi.runHookSeries,
427
- settings: strapi.settings,
428
- children: /* @__PURE__ */ jsx(Provider$1, { store, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(AuthProvider, { children: /* @__PURE__ */ jsx(HistoryProvider, { children: /* @__PURE__ */ jsx(LanguageProvider, { messages: strapi.configurations.translations, children: /* @__PURE__ */ jsx(Theme, { themes: strapi.configurations.themes, children: /* @__PURE__ */ jsx(NotificationsProvider, { children: /* @__PURE__ */ jsx(TrackingProvider, { children: /* @__PURE__ */ jsx(GuidedTourProvider, { children: /* @__PURE__ */ jsx(
429
- ConfigurationProvider,
430
- {
431
- defaultAuthLogo: strapi.configurations.authLogo,
432
- defaultMenuLogo: strapi.configurations.menuLogo,
433
- showTutorials: strapi.configurations.tutorials,
434
- showReleaseNotification: strapi.configurations.notifications.releases,
435
- children
436
- }
437
- ) }) }) }) }) }) }) }) }) })
498
+ ref,
499
+ tag: NavLink,
500
+ to: history.at(-1) ?? "",
501
+ onClick: handleClick,
502
+ disabled: disabled || !canGoBack,
503
+ "aria-disabled": disabled || !canGoBack,
504
+ startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
505
+ children: formatMessage({
506
+ id: "global.back",
507
+ defaultMessage: "Back"
508
+ })
438
509
  }
439
510
  );
440
- };
441
-
442
- const App = ({ strapi, store }) => {
443
- useEffect(() => {
444
- const language = localStorage.getItem(LANGUAGE_LOCAL_STORAGE_KEY) || "en";
445
- if (language) {
446
- document.documentElement.lang = language;
447
- }
448
- }, []);
449
- return /* @__PURE__ */ jsx(Providers, { strapi, store, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Outlet, {}) }) });
450
- };
451
-
452
- const StrapiLogo = "data:image/svg+xml,%3csvg%20width='800'%20height='800'%20viewBox='0%200%20800%20800'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M39%20282c0-118%200-176.9%2036.6-213.5C112.2%2032%20171.1%2032%20288.9%2032h221.2c117.8%200%20176.7%200%20213.3%2036.6C760%20105.2%20760%20164.1%20760%20281.9v221.2c0%20117.8%200%20176.7-36.6%20213.3C686.8%20753%20627.9%20753%20510.1%20753H288.9c-117.8%200-176.7%200-213.3-36.6C39%20679.8%2039%20620.9%2039%20503.1V281.9Z'%20fill='%234945FF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M536.4%20250.7H293.7v123.8h123.8v123.7h123.8V255.5c0-2.6-2.2-4.8-4.9-4.8Z'%20fill='%23fff'/%3e%3cpath%20fill='%23fff'%20d='M412.7%20374.5h4.8v4.8h-4.8z'/%3e%3cpath%20d='M293.8%20374.5h119c2.6%200%204.8%202.1%204.8%204.8v119h-119a4.8%204.8%200%200%201-4.8-4.9v-119Z'%20fill='%239593FF'/%3e%3cpath%20d='M417.5%20498.2h123.8L421.6%20618a2.4%202.4%200%200%201-4-1.7v-118ZM293.8%20374.5h-118a2.4%202.4%200%200%201-1.7-4.1l119.7-119.7v123.8Z'%20fill='%239593FF'/%3e%3c/svg%3e";
511
+ });
453
512
 
454
- const useClipboard = () => {
455
- const copy = useCallback(async (value) => {
456
- try {
457
- if (typeof value !== "string" && typeof value !== "number") {
458
- throw new Error(
459
- `Cannot copy typeof ${typeof value} to clipboard, must be a string or number`
460
- );
461
- } else if (value === "") {
462
- throw new Error(`Cannot copy empty string to clipboard.`);
513
+ const GUIDED_TOUR_COMPLETED_STEPS = "GUIDED_TOUR_COMPLETED_STEPS";
514
+ const GUIDED_TOUR_CURRENT_STEP = "GUIDED_TOUR_CURRENT_STEP";
515
+ const GUIDED_TOUR_SKIPPED = "GUIDED_TOUR_SKIPPED";
516
+ const [GuidedTourProviderImpl, useGuidedTour] = createContext("GuidedTour");
517
+ const GuidedTourProvider = ({ children }) => {
518
+ const [{ currentStep, guidedTourState, isGuidedTourVisible, isSkipped }, dispatch] = React.useReducer(reducer$1, initialState, initialiseState);
519
+ const setCurrentStep = (step) => {
520
+ if (step !== null) {
521
+ const isStepAlreadyDone = get(guidedTourState, step);
522
+ const [sectionName, stepName] = step.split(".");
523
+ const sectionArray = Object.entries(guidedTourState[sectionName]);
524
+ const currentStepIndex = sectionArray.findIndex(([key]) => key === stepName);
525
+ const previousSteps = sectionArray.slice(0, currentStepIndex);
526
+ const isStepToShow = previousSteps.every(([, sectionValue]) => sectionValue);
527
+ if (isStepAlreadyDone || isSkipped || !isStepToShow) {
528
+ return null;
463
529
  }
464
- const stringifiedValue = value.toString();
465
- await navigator.clipboard.writeText(stringifiedValue);
466
- return true;
467
- } catch (error) {
468
- if (process.env.NODE_ENV === "development") {
469
- console.warn("Copy failed", error);
530
+ }
531
+ window.localStorage.setItem(GUIDED_TOUR_CURRENT_STEP, JSON.stringify(null));
532
+ return dispatch({
533
+ type: "SET_CURRENT_STEP",
534
+ step
535
+ });
536
+ };
537
+ const setGuidedTourVisibility = (value) => {
538
+ dispatch({
539
+ type: "SET_GUIDED_TOUR_VISIBILITY",
540
+ value
541
+ });
542
+ };
543
+ const setStepState = (currentStep2, value) => {
544
+ addCompletedStep(currentStep2);
545
+ dispatch({
546
+ type: "SET_STEP_STATE",
547
+ currentStep: currentStep2,
548
+ value
549
+ });
550
+ };
551
+ const startSection = (sectionName) => {
552
+ const sectionSteps = guidedTourState[sectionName];
553
+ if (sectionSteps) {
554
+ const guidedTourArray = Object.entries(guidedTourState);
555
+ const currentSectionIndex = guidedTourArray.findIndex(([key]) => key === sectionName);
556
+ const previousSections = guidedTourArray.slice(0, currentSectionIndex);
557
+ const isSectionToShow = previousSections.every(
558
+ ([, sectionValue]) => Object.values(sectionValue).every(Boolean)
559
+ );
560
+ const [firstStep] = Object.keys(sectionSteps);
561
+ const isFirstStepDone = sectionSteps[firstStep];
562
+ if (isSectionToShow && !currentStep && !isFirstStepDone) {
563
+ setCurrentStep(`${sectionName}.${firstStep}`);
470
564
  }
471
- return false;
472
565
  }
473
- }, []);
474
- return { copy };
566
+ };
567
+ const setSkipped = (value) => {
568
+ window.localStorage.setItem(GUIDED_TOUR_SKIPPED, JSON.stringify(value));
569
+ dispatch({
570
+ type: "SET_SKIPPED",
571
+ value
572
+ });
573
+ };
574
+ return /* @__PURE__ */ jsx(
575
+ GuidedTourProviderImpl,
576
+ {
577
+ guidedTourState,
578
+ currentStep,
579
+ setCurrentStep,
580
+ setGuidedTourVisibility,
581
+ setSkipped,
582
+ setStepState,
583
+ startSection,
584
+ isGuidedTourVisible,
585
+ isSkipped,
586
+ children
587
+ }
588
+ );
589
+ };
590
+ const initialState = {
591
+ currentStep: null,
592
+ guidedTourState: {
593
+ contentTypeBuilder: {
594
+ create: false,
595
+ success: false
596
+ },
597
+ contentManager: {
598
+ create: false,
599
+ success: false
600
+ },
601
+ apiTokens: {
602
+ create: false,
603
+ success: false
604
+ },
605
+ transferTokens: {
606
+ create: false,
607
+ success: false
608
+ }
609
+ },
610
+ isGuidedTourVisible: false,
611
+ isSkipped: false
612
+ };
613
+ const reducer$1 = (state = initialState, action) => produce(state, (draftState) => {
614
+ switch (action.type) {
615
+ case "SET_CURRENT_STEP": {
616
+ draftState.currentStep = action.step;
617
+ break;
618
+ }
619
+ case "SET_STEP_STATE": {
620
+ const [section, step] = action.currentStep.split(".");
621
+ draftState.guidedTourState[section][step] = action.value;
622
+ break;
623
+ }
624
+ case "SET_SKIPPED": {
625
+ draftState.isSkipped = action.value;
626
+ break;
627
+ }
628
+ case "SET_GUIDED_TOUR_VISIBILITY": {
629
+ draftState.isGuidedTourVisible = action.value;
630
+ break;
631
+ }
632
+ default: {
633
+ return draftState;
634
+ }
635
+ }
636
+ });
637
+ const initialiseState = (initialState2) => {
638
+ const copyInitialState = { ...initialState2 };
639
+ const guidedTourLocaleStorage = JSON.parse(
640
+ window.localStorage.getItem(GUIDED_TOUR_COMPLETED_STEPS) ?? "[]"
641
+ );
642
+ const currentStepLocaleStorage = JSON.parse(
643
+ window.localStorage.getItem(GUIDED_TOUR_CURRENT_STEP) ?? "null"
644
+ );
645
+ const skippedLocaleStorage = JSON.parse(
646
+ window.localStorage.getItem(GUIDED_TOUR_SKIPPED) ?? "false"
647
+ );
648
+ if (Array.isArray(guidedTourLocaleStorage)) {
649
+ guidedTourLocaleStorage.forEach((step) => {
650
+ const [sectionName, stepName] = step.split(".");
651
+ set(copyInitialState, ["guidedTourState", sectionName, stepName], true);
652
+ });
653
+ }
654
+ if (currentStepLocaleStorage) {
655
+ const [sectionName, stepName] = currentStepLocaleStorage.split(".");
656
+ set(copyInitialState, ["guidedTourState", sectionName, stepName], true);
657
+ addCompletedStep(currentStepLocaleStorage);
658
+ window.localStorage.setItem(GUIDED_TOUR_CURRENT_STEP, JSON.stringify(null));
659
+ }
660
+ if (skippedLocaleStorage !== null) {
661
+ set(copyInitialState, "isSkipped", skippedLocaleStorage);
662
+ }
663
+ return copyInitialState;
664
+ };
665
+ const addCompletedStep = (completedStep) => {
666
+ const currentSteps = JSON.parse(window.localStorage.getItem(GUIDED_TOUR_COMPLETED_STEPS) ?? "[]");
667
+ if (!Array.isArray(currentSteps)) {
668
+ return;
669
+ }
670
+ const isAlreadyStored = currentSteps.includes(completedStep);
671
+ if (isAlreadyStored) {
672
+ return;
673
+ }
674
+ window.localStorage.setItem(
675
+ GUIDED_TOUR_COMPLETED_STEPS,
676
+ JSON.stringify([...currentSteps, completedStep])
677
+ );
678
+ };
679
+
680
+ const queryClient = new QueryClient({
681
+ defaultOptions: {
682
+ queries: {
683
+ refetchOnWindowFocus: false
684
+ }
685
+ }
686
+ });
687
+ const Providers = ({ children, strapi, store }) => {
688
+ return /* @__PURE__ */ jsx(
689
+ StrapiAppProvider,
690
+ {
691
+ components: strapi.library.components,
692
+ customFields: strapi.customFields,
693
+ fields: strapi.library.fields,
694
+ menu: strapi.router.menu,
695
+ getAdminInjectedComponents: strapi.getAdminInjectedComponents,
696
+ getPlugin: strapi.getPlugin,
697
+ plugins: strapi.plugins,
698
+ rbac: strapi.rbac,
699
+ runHookParallel: strapi.runHookParallel,
700
+ runHookWaterfall: (name, initialValue) => strapi.runHookWaterfall(name, initialValue, store),
701
+ runHookSeries: strapi.runHookSeries,
702
+ settings: strapi.router.settings,
703
+ children: /* @__PURE__ */ jsx(Provider$1, { store, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(AuthProvider, { children: /* @__PURE__ */ jsx(HistoryProvider, { children: /* @__PURE__ */ jsx(LanguageProvider, { messages: strapi.configurations.translations, children: /* @__PURE__ */ jsx(Theme, { themes: strapi.configurations.themes, children: /* @__PURE__ */ jsx(NotificationsProvider, { children: /* @__PURE__ */ jsx(TrackingProvider, { children: /* @__PURE__ */ jsx(GuidedTourProvider, { children: /* @__PURE__ */ jsx(
704
+ ConfigurationProvider,
705
+ {
706
+ defaultAuthLogo: strapi.configurations.authLogo,
707
+ defaultMenuLogo: strapi.configurations.menuLogo,
708
+ showTutorials: strapi.configurations.tutorials,
709
+ showReleaseNotification: strapi.configurations.notifications.releases,
710
+ children
711
+ }
712
+ ) }) }) }) }) }) }) }) }) })
713
+ }
714
+ );
715
+ };
716
+
717
+ const App = ({ strapi, store }) => {
718
+ useEffect(() => {
719
+ const language = localStorage.getItem(LANGUAGE_LOCAL_STORAGE_KEY) || "en";
720
+ if (language) {
721
+ document.documentElement.lang = language;
722
+ }
723
+ }, []);
724
+ return /* @__PURE__ */ jsx(Providers, { strapi, store, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Outlet, {}) }) });
725
+ };
726
+
727
+ const useClipboard = () => {
728
+ const copy = useCallback(async (value) => {
729
+ try {
730
+ if (typeof value !== "string" && typeof value !== "number") {
731
+ throw new Error(
732
+ `Cannot copy typeof ${typeof value} to clipboard, must be a string or number`
733
+ );
734
+ } else if (value === "") {
735
+ throw new Error(`Cannot copy empty string to clipboard.`);
736
+ }
737
+ const stringifiedValue = value.toString();
738
+ await navigator.clipboard.writeText(stringifiedValue);
739
+ return true;
740
+ } catch (error) {
741
+ if (process.env.NODE_ENV === "development") {
742
+ console.warn("Copy failed", error);
743
+ }
744
+ return false;
745
+ }
746
+ }, []);
747
+ return { copy };
475
748
  };
476
749
 
477
750
  const ErrorElement = () => {
@@ -552,431 +825,245 @@ const ErrorType = styled(Typography)`
552
825
  color: ${({ theme }) => theme.colors.danger600};
553
826
  `;
554
827
 
555
- const ADMIN_PERMISSIONS_CE = {
556
- contentManager: {
557
- main: [],
558
- collectionTypesConfigurations: [
559
- {
560
- action: "plugin::content-manager.collection-types.configure-view",
561
- subject: null
562
- }
563
- ],
564
- componentsConfigurations: [
565
- {
566
- action: "plugin::content-manager.components.configure-layout",
567
- subject: null
568
- }
569
- ],
570
- singleTypesConfigurations: [
571
- {
572
- action: "plugin::content-manager.single-types.configure-view",
573
- subject: null
574
- }
575
- ]
576
- },
577
- marketplace: {
578
- main: [{ action: "admin::marketplace.read", subject: null }],
579
- read: [{ action: "admin::marketplace.read", subject: null }]
580
- },
581
- settings: {
582
- roles: {
583
- main: [
584
- { action: "admin::roles.create", subject: null },
585
- { action: "admin::roles.update", subject: null },
586
- { action: "admin::roles.read", subject: null },
587
- { action: "admin::roles.delete", subject: null }
588
- ],
589
- create: [{ action: "admin::roles.create", subject: null }],
590
- delete: [{ action: "admin::roles.delete", subject: null }],
591
- read: [{ action: "admin::roles.read", subject: null }],
592
- update: [{ action: "admin::roles.update", subject: null }]
593
- },
594
- users: {
595
- main: [
596
- { action: "admin::users.create", subject: null },
597
- { action: "admin::users.read", subject: null },
598
- { action: "admin::users.update", subject: null },
599
- { action: "admin::users.delete", subject: null }
600
- ],
601
- create: [{ action: "admin::users.create", subject: null }],
602
- delete: [{ action: "admin::users.delete", subject: null }],
603
- read: [{ action: "admin::users.read", subject: null }],
604
- update: [{ action: "admin::users.update", subject: null }]
605
- },
606
- webhooks: {
607
- main: [
608
- { action: "admin::webhooks.create", subject: null },
609
- { action: "admin::webhooks.read", subject: null },
610
- { action: "admin::webhooks.update", subject: null },
611
- { action: "admin::webhooks.delete", subject: null }
612
- ],
613
- create: [{ action: "admin::webhooks.create", subject: null }],
614
- delete: [{ action: "admin::webhooks.delete", subject: null }],
615
- read: [
616
- { action: "admin::webhooks.read", subject: null },
617
- // NOTE: We need to check with the API
618
- { action: "admin::webhooks.update", subject: null },
619
- { action: "admin::webhooks.delete", subject: null }
620
- ],
621
- update: [{ action: "admin::webhooks.update", subject: null }]
622
- },
623
- "api-tokens": {
624
- main: [{ action: "admin::api-tokens.access", subject: null }],
625
- create: [{ action: "admin::api-tokens.create", subject: null }],
626
- delete: [{ action: "admin::api-tokens.delete", subject: null }],
627
- read: [{ action: "admin::api-tokens.read", subject: null }],
628
- update: [{ action: "admin::api-tokens.update", subject: null }],
629
- regenerate: [{ action: "admin::api-tokens.regenerate", subject: null }]
630
- },
631
- "transfer-tokens": {
632
- main: [{ action: "admin::transfer.tokens.access", subject: null }],
633
- create: [{ action: "admin::transfer.tokens.create", subject: null }],
634
- delete: [{ action: "admin::transfer.tokens.delete", subject: null }],
635
- read: [{ action: "admin::transfer.tokens.read", subject: null }],
636
- update: [{ action: "admin::transfer.tokens.update", subject: null }],
637
- regenerate: [{ action: "admin::transfer.tokens.regenerate", subject: null }]
638
- },
639
- "project-settings": {
640
- read: [{ action: "admin::project-settings.read", subject: null }],
641
- update: [{ action: "admin::project-settings.update", subject: null }]
642
- }
828
+ const ActionLayout = ({ startActions, endActions }) => {
829
+ if (!startActions && !endActions) {
830
+ return null;
643
831
  }
832
+ return /* @__PURE__ */ jsxs(
833
+ Flex,
834
+ {
835
+ justifyContent: "space-between",
836
+ alignItems: "flex-start",
837
+ paddingBottom: 4,
838
+ paddingLeft: 10,
839
+ paddingRight: 10,
840
+ children: [
841
+ /* @__PURE__ */ jsx(Flex, { gap: 2, wrap: "wrap", children: startActions }),
842
+ /* @__PURE__ */ jsx(Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
843
+ ]
844
+ }
845
+ );
644
846
  };
645
- const HOOKS = {
646
- /**
647
- * Hook that allows to mutate the displayed headers of the list view table
648
- * @constant
649
- * @type {string}
650
- */
651
- INJECT_COLUMN_IN_TABLE: "Admin/CM/pages/ListView/inject-column-in-table",
652
- /**
653
- * Hook that allows to mutate the CM's collection types links pre-set filters
654
- * @constant
655
- * @type {string}
656
- */
657
- MUTATE_COLLECTION_TYPES_LINKS: "Admin/CM/pages/App/mutate-collection-types-links",
658
- /**
659
- * Hook that allows to mutate the CM's edit view layout
660
- * @constant
661
- * @type {string}
662
- */
663
- MUTATE_EDIT_VIEW_LAYOUT: "Admin/CM/pages/EditView/mutate-edit-view-layout",
664
- /**
665
- * Hook that allows to mutate the CM's single types links pre-set filters
666
- * @constant
667
- * @type {string}
668
- */
669
- MUTATE_SINGLE_TYPES_LINKS: "Admin/CM/pages/App/mutate-single-types-links"
847
+
848
+ const ContentLayout = ({ children }) => {
849
+ return /* @__PURE__ */ jsx(Box, { paddingLeft: 10, paddingRight: 10, children });
670
850
  };
671
- const SETTINGS_LINKS_CE = () => ({
672
- global: [
673
- {
674
- intlLabel: { id: "Settings.application.title", defaultMessage: "Overview" },
675
- to: "/settings/application-infos",
676
- id: "000-application-infos"
677
- },
678
- {
679
- intlLabel: { id: "Settings.webhooks.title", defaultMessage: "Webhooks" },
680
- to: "/settings/webhooks",
681
- id: "webhooks"
682
- },
683
- {
684
- intlLabel: { id: "Settings.apiTokens.title", defaultMessage: "API Tokens" },
685
- to: "/settings/api-tokens?sort=name:ASC",
686
- id: "api-tokens"
687
- },
688
- {
689
- intlLabel: { id: "Settings.transferTokens.title", defaultMessage: "Transfer Tokens" },
690
- to: "/settings/transfer-tokens?sort=name:ASC",
691
- id: "transfer-tokens"
692
- },
693
- // If the Enterprise/Cloud feature is not enabled and if the config doesn't disable it, we promote the Enterprise/Cloud feature by displaying them in the settings menu.
694
- // Disable this by adding "promoteEE: false" to your `./config/admin.js` file
695
- ...!window.strapi.features.isEnabled(window.strapi.features.SSO) && window.strapi?.flags?.promoteEE ? [
696
- {
697
- intlLabel: { id: "Settings.sso.title", defaultMessage: "Single Sign-On" },
698
- to: "/settings/purchase-single-sign-on",
699
- id: "sso-purchase-page",
700
- lockIcon: true
701
- }
702
- ] : []
703
- ],
704
- admin: [
705
- {
706
- intlLabel: { id: "global.roles", defaultMessage: "Roles" },
707
- to: "/settings/roles",
708
- id: "roles"
709
- },
710
- {
711
- intlLabel: { id: "global.users", defaultMessage: "Users" },
712
- // Init the search params directly
713
- to: "/settings/users?pageSize=10&page=1&sort=firstname",
714
- id: "users"
715
- },
716
- ...!window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) && window.strapi?.flags?.promoteEE ? [
717
- {
718
- intlLabel: { id: "global.auditLogs", defaultMessage: "Audit Logs" },
719
- to: "/settings/purchase-audit-logs",
720
- id: "auditLogs-purchase-page",
721
- lockIcon: true
722
- }
723
- ] : []
724
- ]
725
- });
726
851
 
727
- const ALLOWED_TYPES = [
728
- "biginteger",
729
- "boolean",
730
- "date",
731
- "datetime",
732
- "decimal",
733
- "email",
734
- "enumeration",
735
- "float",
736
- "integer",
737
- "json",
738
- "password",
739
- "richtext",
740
- "string",
741
- "text",
742
- "time",
743
- "uid"
744
- ];
745
- const ALLOWED_ROOT_LEVEL_OPTIONS = [
746
- "min",
747
- "minLength",
748
- "max",
749
- "maxLength",
750
- "required",
751
- "regex",
752
- "enum",
753
- "unique",
754
- "private",
755
- "default"
756
- ];
757
- class CustomFields {
758
- customFields;
759
- constructor() {
760
- this.customFields = {};
761
- }
762
- register = (customFields) => {
763
- if (Array.isArray(customFields)) {
764
- customFields.forEach((customField) => {
765
- this.register(customField);
766
- });
767
- } else {
768
- const { name, pluginId, type, intlLabel, intlDescription, components, options } = customFields;
769
- invariant(name, "A name must be provided");
770
- invariant(type, "A type must be provided");
771
- invariant(intlLabel, "An intlLabel must be provided");
772
- invariant(intlDescription, "An intlDescription must be provided");
773
- invariant(components, "A components object must be provided");
774
- invariant(components.Input, "An Input component must be provided");
775
- invariant(
776
- ALLOWED_TYPES.includes(type),
777
- `Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`
778
- );
779
- const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;
780
- invariant(
781
- isValidObjectKey.test(name),
782
- `Custom field name: '${name}' is not a valid object key`
783
- );
784
- const allFormOptions = [...options?.base || [], ...options?.advanced || []];
785
- if (allFormOptions.length) {
786
- const optionPathValidations = allFormOptions.reduce(optionsValidationReducer, []);
787
- optionPathValidations.forEach(({ isValidOptionPath, errorMessage }) => {
788
- invariant(isValidOptionPath, errorMessage);
789
- });
790
- }
791
- const uid = pluginId ? `plugin::${pluginId}.${name}` : `global::${name}`;
792
- const uidAlreadyUsed = Object.prototype.hasOwnProperty.call(this.customFields, uid);
793
- invariant(!uidAlreadyUsed, `Custom field: '${uid}' has already been registered`);
794
- this.customFields[uid] = customFields;
795
- }
796
- };
797
- getAll = () => {
798
- return this.customFields;
799
- };
800
- get = (uid) => {
801
- return this.customFields[uid];
802
- };
803
- }
804
- const optionsValidationReducer = (acc, option) => {
805
- if ("items" in option) {
806
- return option.items.reduce(optionsValidationReducer, acc);
807
- }
808
- if (!option.name) {
809
- acc.push({
810
- isValidOptionPath: false,
811
- errorMessage: "The 'name' property is required on an options object"
812
- });
813
- } else {
814
- acc.push({
815
- isValidOptionPath: option.name.startsWith("options") || ALLOWED_ROOT_LEVEL_OPTIONS.includes(option.name),
816
- errorMessage: `'${option.name}' must be prefixed with 'options.'`
817
- });
818
- }
819
- return acc;
852
+ const GridColSize = {
853
+ S: 180,
854
+ M: 250
855
+ };
856
+ const StyledGrid = styled(Box)`
857
+ display: grid;
858
+ grid-template-columns: repeat(
859
+ auto-fit,
860
+ minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
861
+ );
862
+ grid-gap: ${({ theme }) => theme.spaces[4]};
863
+ `;
864
+ const GridLayout = ({ size, children }) => {
865
+ return /* @__PURE__ */ jsx(StyledGrid, { $size: size, children });
820
866
  };
821
867
 
822
- class Plugin {
823
- apis;
824
- initializer;
825
- injectionZones;
826
- isReady;
827
- name;
828
- pluginId;
829
- constructor(pluginConf) {
830
- this.apis = pluginConf.apis || {};
831
- this.initializer = pluginConf.initializer || null;
832
- this.injectionZones = pluginConf.injectionZones || {};
833
- this.isReady = pluginConf.isReady !== void 0 ? pluginConf.isReady : true;
834
- this.name = pluginConf.name;
835
- this.pluginId = pluginConf.id;
836
- }
837
- getInjectedComponents(containerName, blockName) {
838
- try {
839
- return this.injectionZones[containerName][blockName] || [];
840
- } catch (err) {
841
- console.error("Cannot get injected component", err);
842
- return [];
868
+ const BaseHeaderLayout = React.forwardRef(
869
+ ({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
870
+ const isSubtitleString = typeof subtitle === "string";
871
+ if (sticky) {
872
+ return /* @__PURE__ */ jsx(
873
+ Box,
874
+ {
875
+ paddingLeft: 6,
876
+ paddingRight: 6,
877
+ paddingTop: 3,
878
+ paddingBottom: 3,
879
+ position: "fixed",
880
+ top: 0,
881
+ right: 0,
882
+ background: "neutral0",
883
+ shadow: "tableShadow",
884
+ width: `${width}rem`,
885
+ zIndex: 1,
886
+ "data-strapi-header-sticky": true,
887
+ children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
888
+ /* @__PURE__ */ jsxs(Flex, { children: [
889
+ navigationAction && /* @__PURE__ */ jsx(Box, { paddingRight: 3, children: navigationAction }),
890
+ /* @__PURE__ */ jsxs(Box, { children: [
891
+ /* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h1", ...props, children: title }),
892
+ isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
893
+ ] }),
894
+ secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
895
+ ] }),
896
+ /* @__PURE__ */ jsx(Flex, { children: primaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
897
+ ] })
898
+ }
899
+ );
843
900
  }
901
+ return /* @__PURE__ */ jsxs(
902
+ Box,
903
+ {
904
+ ref,
905
+ paddingLeft: 10,
906
+ paddingRight: 10,
907
+ paddingBottom: 8,
908
+ paddingTop: navigationAction ? 6 : 8,
909
+ background: "neutral100",
910
+ "data-strapi-header": true,
911
+ children: [
912
+ navigationAction ? /* @__PURE__ */ jsx(Box, { paddingBottom: 2, children: navigationAction }) : null,
913
+ /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
914
+ /* @__PURE__ */ jsxs(Flex, { minWidth: 0, children: [
915
+ /* @__PURE__ */ jsx(Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
916
+ secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
917
+ ] }),
918
+ primaryAction
919
+ ] }),
920
+ isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
921
+ ]
922
+ }
923
+ );
844
924
  }
845
- injectComponent(containerName, blockName, component) {
846
- try {
847
- this.injectionZones[containerName][blockName].push(component);
848
- } catch (err) {
849
- console.error("Cannot inject component", err);
925
+ );
926
+ const HeaderLayout = (props) => {
927
+ const baseHeaderLayoutRef = React.useRef(null);
928
+ const [headerSize, setHeaderSize] = React.useState(null);
929
+ const [containerRef, isVisible] = useElementOnScreen({
930
+ root: null,
931
+ rootMargin: "0px",
932
+ threshold: 0
933
+ });
934
+ useResizeObserver(containerRef, () => {
935
+ if (containerRef.current) {
936
+ setHeaderSize(containerRef.current.getBoundingClientRect());
850
937
  }
851
- }
852
- }
853
-
854
- const staticReducers = {
855
- [adminApi.reducerPath]: adminApi.reducer,
856
- admin_app: reducer$3
857
- };
858
- const injectReducerStoreEnhancer = (appReducers) => (next) => (...args) => {
859
- const store = next(...args);
860
- const asyncReducers = {};
861
- return {
862
- ...store,
863
- asyncReducers,
864
- injectReducer: (key, asyncReducer) => {
865
- asyncReducers[key] = asyncReducer;
866
- store.replaceReducer(
867
- // @ts-expect-error we dynamically add reducers which makes the types uncomfortable.
868
- combineReducers({
869
- ...appReducers,
870
- ...asyncReducers
871
- })
872
- );
938
+ });
939
+ React.useEffect(() => {
940
+ if (baseHeaderLayoutRef.current) {
941
+ setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
873
942
  }
943
+ }, [baseHeaderLayoutRef]);
944
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
945
+ /* @__PURE__ */ jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
946
+ !isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
947
+ ] });
948
+ };
949
+ HeaderLayout.displayName = "HeaderLayout";
950
+ const useElementOnScreen = (options) => {
951
+ const containerRef = React.useRef(null);
952
+ const [isVisible, setIsVisible] = React.useState(true);
953
+ const callback = ([entry]) => {
954
+ setIsVisible(entry.isIntersecting);
874
955
  };
956
+ React.useEffect(() => {
957
+ const containerEl = containerRef.current;
958
+ const observer = new IntersectionObserver(callback, options);
959
+ if (containerEl) {
960
+ observer.observe(containerRef.current);
961
+ }
962
+ return () => {
963
+ if (containerEl) {
964
+ observer.disconnect();
965
+ }
966
+ };
967
+ }, [containerRef, options]);
968
+ return [containerRef, isVisible];
875
969
  };
876
- const configureStoreImpl = (preloadedState = {}, appMiddlewares = [], injectedReducers = {}) => {
877
- const coreReducers = { ...staticReducers, ...injectedReducers };
878
- const defaultMiddlewareOptions = {};
879
- if (process.env.NODE_ENV === "test") {
880
- defaultMiddlewareOptions.serializableCheck = false;
881
- defaultMiddlewareOptions.immutableCheck = false;
882
- }
883
- const store = configureStore({
884
- preloadedState: {
885
- admin_app: preloadedState.admin_app
886
- },
887
- reducer: coreReducers,
888
- devTools: process.env.NODE_ENV !== "production",
889
- middleware: (getDefaultMiddleware) => [
890
- ...getDefaultMiddleware(defaultMiddlewareOptions),
891
- adminApi.middleware,
892
- ...appMiddlewares.map((m) => m())
893
- ],
894
- enhancers: [injectReducerStoreEnhancer(coreReducers)]
895
- });
896
- return store;
970
+ const useResizeObserver = (sources, onResize) => {
971
+ const handleResize = useCallbackRef(onResize);
972
+ React.useLayoutEffect(() => {
973
+ const resizeObs = new ResizeObserver(handleResize);
974
+ if (Array.isArray(sources)) {
975
+ sources.forEach((source) => {
976
+ if (source.current) {
977
+ resizeObs.observe(source.current);
978
+ }
979
+ });
980
+ } else if (sources.current) {
981
+ resizeObs.observe(sources.current);
982
+ }
983
+ return () => {
984
+ resizeObs.disconnect();
985
+ };
986
+ }, [sources, handleResize]);
897
987
  };
898
988
 
899
- const getBasename = () => (process.env.ADMIN_PATH ?? "").replace(window.location.origin, "");
989
+ const GridContainer = styled(Box)`
990
+ display: grid;
991
+ grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
992
+ `;
993
+ const OverflowingItem = styled(Box)`
994
+ overflow-x: hidden;
995
+ `;
996
+ const RootLayout = ({ sideNav, children }) => {
997
+ return /* @__PURE__ */ jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
998
+ sideNav,
999
+ /* @__PURE__ */ jsx(OverflowingItem, { paddingBottom: 10, children })
1000
+ ] });
1001
+ };
1002
+ const Layouts = {
1003
+ Root: RootLayout,
1004
+ Header: HeaderLayout,
1005
+ BaseHeader: BaseHeaderLayout,
1006
+ Grid: GridLayout,
1007
+ Action: ActionLayout,
1008
+ Content: ContentLayout
1009
+ };
900
1010
 
901
- const createHook = () => {
902
- const _handlers = [];
903
- return {
904
- register(fn) {
905
- _handlers.push(fn);
906
- },
907
- delete(handler) {
908
- _handlers.splice(_handlers.indexOf(handler), 1);
909
- },
910
- runWaterfall(args, store) {
911
- return _handlers.reduce((acc, fn) => fn(acc, store), args);
912
- },
913
- async runWaterfallAsync(args, store) {
914
- let result = args;
915
- for (const fn of _handlers) {
916
- result = await fn(result, store);
1011
+ const NotFoundPage = () => {
1012
+ const { formatMessage } = useIntl();
1013
+ return /* @__PURE__ */ jsxs(Page.Main, { labelledBy: "title", children: [
1014
+ /* @__PURE__ */ jsx(
1015
+ Layouts.Header,
1016
+ {
1017
+ id: "title",
1018
+ title: formatMessage({
1019
+ id: "content-manager.pageNotFound",
1020
+ defaultMessage: "Page not found"
1021
+ })
917
1022
  }
918
- return result;
919
- },
920
- runSeries(...args) {
921
- return _handlers.map((fn) => fn(...args));
922
- },
923
- async runSeriesAsync(...args) {
924
- const result = [];
925
- for (const fn of _handlers) {
926
- result.push(await fn(...args));
1023
+ ),
1024
+ /* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsx(
1025
+ EmptyStateLayout,
1026
+ {
1027
+ action: /* @__PURE__ */ jsx(LinkButton, { tag: Link$1, variant: "secondary", endIcon: /* @__PURE__ */ jsx(ArrowRight, {}), to: "/", children: formatMessage({
1028
+ id: "app.components.NotFoundPage.back",
1029
+ defaultMessage: "Back to homepage"
1030
+ }) }),
1031
+ content: formatMessage({
1032
+ id: "app.page.not.found",
1033
+ defaultMessage: "Oops! We can't seem to find the page you're looging for..."
1034
+ }),
1035
+ hasRadius: true,
1036
+ icon: /* @__PURE__ */ jsx(EmptyPictures, { width: "16rem" }),
1037
+ shadow: "tableShadow"
927
1038
  }
928
- return result;
929
- },
930
- runParallel(...args) {
931
- return Promise.all(
932
- _handlers.map((fn) => {
933
- return fn(...args);
934
- })
935
- );
936
- }
937
- };
1039
+ ) })
1040
+ ] });
938
1041
  };
939
1042
 
940
- function getIn(obj, key, def, pathStartIndex = 0) {
941
- const path = toPath(key);
942
- while (obj && pathStartIndex < path.length) {
943
- obj = obj[path[pathStartIndex++]];
944
- }
945
- if (pathStartIndex !== path.length && !obj) {
946
- return def;
947
- }
948
- return obj === void 0 ? def : obj;
949
- }
950
- const isObject = (obj) => obj !== null && typeof obj === "object" && !Array.isArray(obj);
951
- const isInteger = (obj) => String(Math.floor(Number(obj))) === obj;
952
- function setIn(obj, path, value) {
953
- const res = clone(obj);
954
- let resVal = res;
955
- let i = 0;
956
- const pathArray = toPath(path);
957
- for (; i < pathArray.length - 1; i++) {
958
- const currentPath = pathArray[i];
959
- const currentObj = getIn(obj, pathArray.slice(0, i + 1));
960
- if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {
961
- resVal = resVal[currentPath] = clone(currentObj);
962
- } else {
963
- const nextPath = pathArray[i + 1];
964
- resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};
1043
+ const getEERoutes = () => [
1044
+ ...window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) ? [
1045
+ {
1046
+ path: "audit-logs",
1047
+ lazy: async () => {
1048
+ const { ProtectedListPage } = await import('./ListPage-CwIQBV8p.mjs');
1049
+ return {
1050
+ Component: ProtectedListPage
1051
+ };
1052
+ }
965
1053
  }
966
- }
967
- if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {
968
- return obj;
969
- }
970
- if (value === void 0) {
971
- delete resVal[pathArray[i]];
972
- } else {
973
- resVal[pathArray[i]] = value;
974
- }
975
- if (i === 0 && value === void 0) {
976
- delete res[pathArray[i]];
977
- }
978
- return res;
979
- }
1054
+ ] : [],
1055
+ ...window.strapi.features.isEnabled(window.strapi.features.SSO) ? [
1056
+ {
1057
+ path: "single-sign-on",
1058
+ lazy: async () => {
1059
+ const { ProtectedSSO } = await import('./SingleSignOnPage-4wlUp8RB.mjs');
1060
+ return {
1061
+ Component: ProtectedSSO
1062
+ };
1063
+ }
1064
+ }
1065
+ ] : []
1066
+ ];
980
1067
 
981
1068
  const ERR_MSG = "The Form Component has not been initialised, ensure you are using this hook within a Form component";
982
1069
  const [FormProvider, useForm] = createContext("Form", {
@@ -1015,11 +1102,11 @@ const [FormProvider, useForm] = createContext("Form", {
1015
1102
  values: {}
1016
1103
  });
1017
1104
  const Form = React.forwardRef(
1018
- ({ disabled = false, method, onSubmit, ...props }, ref) => {
1105
+ ({ disabled = false, method, onSubmit, initialErrors, ...props }, ref) => {
1019
1106
  const formRef = React.useRef(null);
1020
1107
  const initialValues = React.useRef(props.initialValues ?? {});
1021
1108
  const [state, dispatch] = React.useReducer(reducer, {
1022
- errors: {},
1109
+ errors: initialErrors ?? {},
1023
1110
  isSubmitting: false,
1024
1111
  values: props.initialValues ?? {}
1025
1112
  });
@@ -1327,7 +1414,7 @@ const reducer = (state, action) => produce(state, (draft) => {
1327
1414
  draft.values = setIn(
1328
1415
  state.values,
1329
1416
  action.payload.field,
1330
- newValue.length > 0 ? newValue : void 0
1417
+ newValue.length > 0 ? newValue : []
1331
1418
  );
1332
1419
  break;
1333
1420
  }
@@ -1357,11 +1444,18 @@ const useField = (path) => {
1357
1444
  (state) => getIn(state.values, path)
1358
1445
  );
1359
1446
  const handleChange = useForm("useField", (state) => state.onChange);
1360
- const error = useForm("useField", (state) => getIn(state.errors, path));
1447
+ const error = useForm("useField", (state) => {
1448
+ const error2 = getIn(state.errors, path);
1449
+ if (isErrorMessageDescriptor(error2)) {
1450
+ const { values, ...message } = error2;
1451
+ return formatMessage(message, values);
1452
+ }
1453
+ return error2;
1454
+ });
1361
1455
  return {
1362
1456
  initialValue,
1363
1457
  /**
1364
- * Errors can be a string, or a MesaageDescriptor, so we need to handle both cases.
1458
+ * Errors can be a string, or a MessageDescriptor, so we need to handle both cases.
1365
1459
  * If it's anything else, we don't return it.
1366
1460
  */
1367
1461
  error: isErrorMessageDescriptor(error) ? formatMessage(
@@ -1376,7 +1470,7 @@ const useField = (path) => {
1376
1470
  };
1377
1471
  };
1378
1472
  const isErrorMessageDescriptor = (object) => {
1379
- return typeof object === "object" && object !== null && "id" in object && "defaultMessage" in object;
1473
+ return typeof object === "object" && object !== null && !Array.isArray(object) && "id" in object && "defaultMessage" in object;
1380
1474
  };
1381
1475
  const Blocker = ({ onProceed = () => {
1382
1476
  }, onCancel = () => {
@@ -1388,53 +1482,42 @@ const Blocker = ({ onProceed = () => {
1388
1482
  return !isSubmitting && modified && (currentLocation.pathname !== nextLocation.pathname || currentLocation.search !== nextLocation.search);
1389
1483
  });
1390
1484
  if (blocker.state === "blocked") {
1391
- const handleCancel = () => {
1392
- onCancel();
1393
- blocker.reset();
1394
- };
1395
- return /* @__PURE__ */ jsxs(
1396
- Dialog,
1397
- {
1398
- isOpen: true,
1399
- title: formatMessage({
1400
- id: "app.components.ConfirmDialog.title",
1401
- defaultMessage: "Confirmation"
1402
- }),
1403
- onClose: handleCancel,
1404
- children: [
1405
- /* @__PURE__ */ jsx(DialogBody, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
1406
- /* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }),
1407
- /* @__PURE__ */ jsx(Typography, { tag: "p", variant: "omega", textAlign: "center", children: formatMessage({
1408
- id: "global.prompt.unsaved",
1409
- defaultMessage: "You have unsaved changes, are you sure you want to leave?"
1410
- }) })
1411
- ] }) }),
1412
- /* @__PURE__ */ jsx(
1413
- DialogFooter,
1414
- {
1415
- startAction: /* @__PURE__ */ jsx(Button, { onClick: handleCancel, variant: "tertiary", children: formatMessage({
1416
- id: "app.components.Button.cancel",
1417
- defaultMessage: "Cancel"
1418
- }) }),
1419
- endAction: /* @__PURE__ */ jsx(
1420
- Button,
1421
- {
1422
- onClick: () => {
1423
- onProceed();
1424
- blocker.proceed();
1425
- },
1426
- variant: "danger",
1427
- children: formatMessage({
1428
- id: "app.components.Button.confirm",
1429
- defaultMessage: "Confirm"
1430
- })
1431
- }
1432
- )
1433
- }
1434
- )
1435
- ]
1485
+ const handleCancel = (isOpen) => {
1486
+ if (!isOpen) {
1487
+ onCancel();
1488
+ blocker.reset();
1436
1489
  }
1437
- );
1490
+ };
1491
+ return /* @__PURE__ */ jsx(Dialog.Root, { open: true, onOpenChange: handleCancel, children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
1492
+ /* @__PURE__ */ jsx(Dialog.Header, { children: formatMessage({
1493
+ id: "app.components.ConfirmDialog.title",
1494
+ defaultMessage: "Confirmation"
1495
+ }) }),
1496
+ /* @__PURE__ */ jsx(Dialog.Body, { icon: /* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }), children: formatMessage({
1497
+ id: "global.prompt.unsaved",
1498
+ defaultMessage: "You have unsaved changes, are you sure you want to leave?"
1499
+ }) }),
1500
+ /* @__PURE__ */ jsxs(Dialog.Footer, { children: [
1501
+ /* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", children: formatMessage({
1502
+ id: "app.components.Button.cancel",
1503
+ defaultMessage: "Cancel"
1504
+ }) }) }),
1505
+ /* @__PURE__ */ jsx(
1506
+ Button,
1507
+ {
1508
+ onClick: () => {
1509
+ onProceed();
1510
+ blocker.proceed();
1511
+ },
1512
+ variant: "danger",
1513
+ children: formatMessage({
1514
+ id: "app.components.Button.confirm",
1515
+ defaultMessage: "Confirm"
1516
+ })
1517
+ }
1518
+ )
1519
+ ] })
1520
+ ] }) });
1438
1521
  }
1439
1522
  return null;
1440
1523
  };
@@ -1487,7 +1570,7 @@ const BooleanInput = forwardRef(
1487
1570
  const MemoizedBooleanInput = memo(BooleanInput);
1488
1571
 
1489
1572
  const CheckboxInput = forwardRef(
1490
- ({ name, required, label, hint, ...props }, ref) => {
1573
+ ({ name, required, label, hint, type: _type, ...props }, ref) => {
1491
1574
  const field = useField(name);
1492
1575
  const fieldRef = useFocusInputField(name);
1493
1576
  const composedRefs = useComposedRefs(ref, fieldRef);
@@ -1495,9 +1578,9 @@ const CheckboxInput = forwardRef(
1495
1578
  /* @__PURE__ */ jsx(
1496
1579
  Checkbox,
1497
1580
  {
1498
- onValueChange: (checked) => field.onChange(name, checked),
1581
+ onCheckedChange: (checked) => field.onChange(name, !!checked),
1499
1582
  ref: composedRefs,
1500
- value: field.value,
1583
+ checked: field.value,
1501
1584
  ...props,
1502
1585
  children: label || props["aria-label"]
1503
1586
  }
@@ -1524,10 +1607,10 @@ const DateInput = forwardRef(
1524
1607
  ref: composedRefs,
1525
1608
  clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
1526
1609
  onChange: (date) => {
1527
- field.onChange(name, date);
1610
+ field.onChange(name, date ? convertLocalDateToUTCDate(date) : null);
1528
1611
  },
1529
- onClear: () => field.onChange(name, void 0),
1530
- value,
1612
+ onClear: () => field.onChange(name, null),
1613
+ value: value ? convertLocalDateToUTCDate(value) : value,
1531
1614
  ...props
1532
1615
  }
1533
1616
  ),
@@ -1536,6 +1619,12 @@ const DateInput = forwardRef(
1536
1619
  ] });
1537
1620
  }
1538
1621
  );
1622
+ const convertLocalDateToUTCDate = (date) => {
1623
+ const utcDateString = date.toISOString();
1624
+ const timeZone = getLocalTimeZone();
1625
+ const zonedDateTime = parseAbsolute(utcDateString, timeZone);
1626
+ return toCalendarDate(zonedDateTime).toDate("UTC");
1627
+ };
1539
1628
  const MemoizedDateInput = memo(DateInput);
1540
1629
 
1541
1630
  const DateTimeInput = forwardRef(
@@ -1553,9 +1642,9 @@ const DateTimeInput = forwardRef(
1553
1642
  ref: composedRefs,
1554
1643
  clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
1555
1644
  onChange: (date) => {
1556
- field.onChange(name, date);
1645
+ field.onChange(name, date ? date : null);
1557
1646
  },
1558
- onClear: () => field.onChange(name, void 0),
1647
+ onClear: () => field.onChange(name, null),
1559
1648
  value,
1560
1649
  ...props
1561
1650
  }
@@ -1785,7 +1874,7 @@ const TimeInput = forwardRef(
1785
1874
  ref: composedRefs,
1786
1875
  clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
1787
1876
  onChange: (time) => {
1788
- field.onChange(name, time);
1877
+ field.onChange(name, `${time}:00.000`);
1789
1878
  },
1790
1879
  onClear: () => field.onChange(name, void 0),
1791
1880
  value: field.value ?? "",
@@ -1805,6 +1894,7 @@ const InputRenderer = memo(
1805
1894
  case "biginteger":
1806
1895
  case "timestamp":
1807
1896
  case "string":
1897
+ case "uid":
1808
1898
  return /* @__PURE__ */ jsx(MemoizedStringInput, { ref: forwardRef2, ...props });
1809
1899
  case "boolean":
1810
1900
  return /* @__PURE__ */ jsx(MemoizedBooleanInput, { ref: forwardRef2, ...props });
@@ -2229,12 +2319,12 @@ const FieldWrapper = styled(Field.Root)`
2229
2319
  const delays = {
2230
2320
  postResponse: 90 * 24 * 60 * 60 * 1e3,
2231
2321
  // 90 days in ms
2232
- postFirstDismissal: 7 * 24 * 60 * 60 * 1e3,
2233
- // 7 days in ms
2322
+ postFirstDismissal: 14 * 24 * 60 * 60 * 1e3,
2323
+ // 14 days in ms
2234
2324
  postSubsequentDismissal: 90 * 24 * 60 * 60 * 1e3,
2235
2325
  // 90 days in ms
2236
- display: 5 * 60 * 1e3
2237
- // 5 minutes in ms
2326
+ display: 30 * 60 * 1e3
2327
+ // 30 minutes in ms
2238
2328
  };
2239
2329
  const ratingArray = [...Array(11).keys()];
2240
2330
  const checkIfShouldShowSurvey = (settings) => {
@@ -2371,7 +2461,7 @@ const NpsSurvey = () => {
2371
2461
  bottom: 0,
2372
2462
  left: "50%",
2373
2463
  transform: "translateX(-50%)",
2374
- zIndex: "popover",
2464
+ zIndex: "200",
2375
2465
  width: "50%",
2376
2466
  children: isFeedbackResponse ? /* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", children: formatMessage({
2377
2467
  id: "app.components.NpsSurvey.feedback-response",
@@ -2588,11 +2678,11 @@ const Register = ({ hasAdmin }) => {
2588
2678
  }, [error, formatAPIError, navigate, toggleNotification]);
2589
2679
  const [registerAdmin] = useRegisterAdminMutation();
2590
2680
  const [registerUser] = useRegisterUserMutation();
2591
- const { setToken } = useAuth("Register", (auth) => auth);
2681
+ const dispatch = useTypedDispatch();
2592
2682
  const handleRegisterAdmin = async ({ news, ...body }, setFormErrors) => {
2593
2683
  const res = await registerAdmin(body);
2594
2684
  if ("data" in res) {
2595
- setToken(res.data.token);
2685
+ dispatch(login({ token: res.data.token }));
2596
2686
  const { roles } = res.data.user;
2597
2687
  if (roles) {
2598
2688
  const isUserSuperAdmin = roles.find(({ code }) => code === "strapi-super-admin");
@@ -2625,7 +2715,7 @@ const Register = ({ hasAdmin }) => {
2625
2715
  const handleRegisterUser = async ({ news, ...body }, setFormErrors) => {
2626
2716
  const res = await registerUser(body);
2627
2717
  if ("data" in res) {
2628
- setToken(res.data.token);
2718
+ dispatch(login({ token: res.data.token }));
2629
2719
  if (news) {
2630
2720
  setNpsSurveySettings((s) => ({ ...s, enabled: true }));
2631
2721
  navigate({
@@ -2719,7 +2809,7 @@ const Register = ({ hasAdmin }) => {
2719
2809
  }
2720
2810
  },
2721
2811
  children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 6, marginTop: 7, children: [
2722
- /* @__PURE__ */ jsx(Grid, { gap: 4, children: [
2812
+ /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: [
2723
2813
  {
2724
2814
  label: formatMessage({
2725
2815
  id: "Auth.form.firstname.label",
@@ -2795,7 +2885,7 @@ const Register = ({ hasAdmin }) => {
2795
2885
  size: 12,
2796
2886
  type: "checkbox"
2797
2887
  }
2798
- ].map(({ size, ...field }) => /* @__PURE__ */ jsx(GridItem, { col: size, children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field }) }, field.name)) }),
2888
+ ].map(({ size, ...field }) => /* @__PURE__ */ jsx(Grid.Item, { col: size, children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field }) }, field.name)) }),
2799
2889
  /* @__PURE__ */ jsx(Button, { fullWidth: true, size: "L", type: "submit", children: formatMessage({
2800
2890
  id: "Auth.form.button.register",
2801
2891
  defaultMessage: "Let's start"
@@ -2863,16 +2953,16 @@ const RESET_PASSWORD_SCHEMA = yup.object().shape({
2863
2953
  });
2864
2954
  const ResetPassword = () => {
2865
2955
  const { formatMessage } = useIntl();
2956
+ const dispatch = useTypedDispatch();
2866
2957
  const navigate = useNavigate();
2867
2958
  const { search: searchString } = useLocation();
2868
2959
  const query = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
2869
2960
  const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
2870
- const { setToken } = useAuth("ResetPassword", (auth) => auth);
2871
2961
  const [resetPassword, { error }] = useResetPasswordMutation();
2872
2962
  const handleSubmit = async (body) => {
2873
2963
  const res = await resetPassword(body);
2874
2964
  if ("data" in res) {
2875
- setToken(res.data.token);
2965
+ dispatch(login({ token: res.data.token }));
2876
2966
  navigate("/");
2877
2967
  }
2878
2968
  };
@@ -2962,11 +3052,11 @@ const AuthPage = () => {
2962
3052
  const { hasAdmin } = data ?? {};
2963
3053
  const Login$1 = useEnterprise(
2964
3054
  Login,
2965
- async () => (await import('./Login-w4BUlNaE.mjs')).LoginEE
3055
+ async () => (await import('./Login-N5NSuTVF.mjs')).LoginEE
2966
3056
  );
2967
3057
  const forms = useEnterprise(
2968
3058
  FORMS,
2969
- async () => (await import('./constants-Z-zrJ7Zs.mjs')).FORMS,
3059
+ async () => (await import('./constants-cKzCiJ5m.mjs')).FORMS,
2970
3060
  {
2971
3061
  combine(ceForms, eeForms) {
2972
3062
  return {
@@ -3003,228 +3093,13 @@ const AuthPage = () => {
3003
3093
  } else if (authType === "login" && !Login$1) {
3004
3094
  return null;
3005
3095
  }
3006
- return /* @__PURE__ */ jsx(Component, { hasAdmin });
3007
- };
3008
-
3009
- const ActionLayout = ({ startActions, endActions }) => {
3010
- if (!startActions && !endActions) {
3011
- return null;
3012
- }
3013
- return /* @__PURE__ */ jsxs(
3014
- Flex,
3015
- {
3016
- justifyContent: "space-between",
3017
- alignItems: "flex-start",
3018
- paddingBottom: 4,
3019
- paddingLeft: 10,
3020
- paddingRight: 10,
3021
- children: [
3022
- /* @__PURE__ */ jsx(Flex, { gap: 2, wrap: "wrap", children: startActions }),
3023
- /* @__PURE__ */ jsx(Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
3024
- ]
3025
- }
3026
- );
3027
- };
3028
-
3029
- const ContentLayout = ({ children }) => {
3030
- return /* @__PURE__ */ jsx(Box, { paddingLeft: 10, paddingRight: 10, children });
3031
- };
3032
-
3033
- const GridColSize = {
3034
- S: 180,
3035
- M: 250
3036
- };
3037
- const StyledGrid = styled(Box)`
3038
- display: grid;
3039
- grid-template-columns: repeat(
3040
- auto-fit,
3041
- minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
3042
- );
3043
- grid-gap: ${({ theme }) => theme.spaces[4]};
3044
- `;
3045
- const GridLayout = ({ size, children }) => {
3046
- return /* @__PURE__ */ jsx(StyledGrid, { $size: size, children });
3047
- };
3048
-
3049
- const BaseHeaderLayout = React.forwardRef(
3050
- ({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
3051
- const isSubtitleString = typeof subtitle === "string";
3052
- if (sticky) {
3053
- return /* @__PURE__ */ jsx(
3054
- Box,
3055
- {
3056
- paddingLeft: 6,
3057
- paddingRight: 6,
3058
- paddingTop: 3,
3059
- paddingBottom: 3,
3060
- position: "fixed",
3061
- top: 0,
3062
- right: 0,
3063
- background: "neutral0",
3064
- shadow: "tableShadow",
3065
- width: `${width}rem`,
3066
- zIndex: 1,
3067
- "data-strapi-header-sticky": true,
3068
- children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
3069
- /* @__PURE__ */ jsxs(Flex, { children: [
3070
- navigationAction && /* @__PURE__ */ jsx(Box, { paddingRight: 3, children: navigationAction }),
3071
- /* @__PURE__ */ jsxs(Box, { children: [
3072
- /* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h1", ...props, children: title }),
3073
- isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
3074
- ] }),
3075
- secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
3076
- ] }),
3077
- /* @__PURE__ */ jsx(Flex, { children: primaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
3078
- ] })
3079
- }
3080
- );
3081
- }
3082
- return /* @__PURE__ */ jsxs(
3083
- Box,
3084
- {
3085
- ref,
3086
- paddingLeft: 10,
3087
- paddingRight: 10,
3088
- paddingBottom: 8,
3089
- paddingTop: navigationAction ? 6 : 8,
3090
- background: "neutral100",
3091
- "data-strapi-header": true,
3092
- children: [
3093
- navigationAction ? /* @__PURE__ */ jsx(Box, { paddingBottom: 2, children: navigationAction }) : null,
3094
- /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
3095
- /* @__PURE__ */ jsxs(Flex, { minWidth: 0, children: [
3096
- /* @__PURE__ */ jsx(Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
3097
- secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
3098
- ] }),
3099
- primaryAction
3100
- ] }),
3101
- isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
3102
- ]
3103
- }
3104
- );
3105
- }
3106
- );
3107
- const HeaderLayout = (props) => {
3108
- const baseHeaderLayoutRef = React.useRef(null);
3109
- const [headerSize, setHeaderSize] = React.useState(null);
3110
- const [containerRef, isVisible] = useElementOnScreen({
3111
- root: null,
3112
- rootMargin: "0px",
3113
- threshold: 0
3114
- });
3115
- useResizeObserver(containerRef, () => {
3116
- if (containerRef.current) {
3117
- setHeaderSize(containerRef.current.getBoundingClientRect());
3118
- }
3119
- });
3120
- React.useEffect(() => {
3121
- if (baseHeaderLayoutRef.current) {
3122
- setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
3123
- }
3124
- }, [baseHeaderLayoutRef]);
3125
- return /* @__PURE__ */ jsxs(Fragment, { children: [
3126
- /* @__PURE__ */ jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
3127
- !isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
3128
- ] });
3129
- };
3130
- HeaderLayout.displayName = "HeaderLayout";
3131
- const useElementOnScreen = (options) => {
3132
- const containerRef = React.useRef(null);
3133
- const [isVisible, setIsVisible] = React.useState(true);
3134
- const callback = ([entry]) => {
3135
- setIsVisible(entry.isIntersecting);
3136
- };
3137
- React.useEffect(() => {
3138
- const containerEl = containerRef.current;
3139
- const observer = new IntersectionObserver(callback, options);
3140
- if (containerEl) {
3141
- observer.observe(containerRef.current);
3142
- }
3143
- return () => {
3144
- if (containerEl) {
3145
- observer.disconnect();
3146
- }
3147
- };
3148
- }, [containerRef, options]);
3149
- return [containerRef, isVisible];
3150
- };
3151
- const useResizeObserver = (sources, onResize) => {
3152
- const handleResize = useCallbackRef(onResize);
3153
- React.useLayoutEffect(() => {
3154
- const resizeObs = new ResizeObserver(handleResize);
3155
- if (Array.isArray(sources)) {
3156
- sources.forEach((source) => {
3157
- if (source.current) {
3158
- resizeObs.observe(source.current);
3159
- }
3160
- });
3161
- } else if (sources.current) {
3162
- resizeObs.observe(sources.current);
3163
- }
3164
- return () => {
3165
- resizeObs.disconnect();
3166
- };
3167
- }, [sources, handleResize]);
3168
- };
3169
-
3170
- const GridContainer = styled(Box)`
3171
- display: grid;
3172
- grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
3173
- `;
3174
- const OverflowingItem = styled(Box)`
3175
- overflow-x: hidden;
3176
- `;
3177
- const RootLayout = ({ sideNav, children }) => {
3178
- return /* @__PURE__ */ jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
3179
- sideNav,
3180
- /* @__PURE__ */ jsx(OverflowingItem, { paddingBottom: 10, children })
3181
- ] });
3182
- };
3183
- const Layouts = {
3184
- Root: RootLayout,
3185
- Header: HeaderLayout,
3186
- BaseHeader: BaseHeaderLayout,
3187
- Grid: GridLayout,
3188
- Action: ActionLayout,
3189
- Content: ContentLayout
3190
- };
3191
-
3192
- const NotFoundPage = () => {
3193
- const { formatMessage } = useIntl();
3194
- return /* @__PURE__ */ jsxs(Page.Main, { labelledBy: "title", children: [
3195
- /* @__PURE__ */ jsx(
3196
- Layouts.Header,
3197
- {
3198
- id: "title",
3199
- title: formatMessage({
3200
- id: "content-manager.pageNotFound",
3201
- defaultMessage: "Page not found"
3202
- })
3203
- }
3204
- ),
3205
- /* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsx(
3206
- EmptyStateLayout,
3207
- {
3208
- action: /* @__PURE__ */ jsx(LinkButton, { tag: Link$1, variant: "secondary", endIcon: /* @__PURE__ */ jsx(ArrowRight, {}), to: "/", children: formatMessage({
3209
- id: "app.components.NotFoundPage.back",
3210
- defaultMessage: "Back to homepage"
3211
- }) }),
3212
- content: formatMessage({
3213
- id: "app.page.not.found",
3214
- defaultMessage: "Oops! We can't seem to find the page you're looging for..."
3215
- }),
3216
- hasRadius: true,
3217
- icon: /* @__PURE__ */ jsx(EmptyPictures, { width: "16rem" }),
3218
- shadow: "tableShadow"
3219
- }
3220
- ) })
3221
- ] });
3096
+ return /* @__PURE__ */ jsx(Component, { hasAdmin });
3222
3097
  };
3223
3098
 
3224
3099
  const ROUTES_CE = [
3225
3100
  {
3226
3101
  lazy: async () => {
3227
- const { ProtectedListPage } = await import('./ListPage-VGqEsiEA.mjs');
3102
+ const { ProtectedListPage } = await import('./ListPage-O5tDuG9A.mjs');
3228
3103
  return {
3229
3104
  Component: ProtectedListPage
3230
3105
  };
@@ -3233,7 +3108,7 @@ const ROUTES_CE = [
3233
3108
  },
3234
3109
  {
3235
3110
  lazy: async () => {
3236
- const { ProtectedCreatePage } = await import('./CreatePage-puzZjQXr.mjs');
3111
+ const { ProtectedCreatePage } = await import('./CreatePage--JuxyfiM.mjs');
3237
3112
  return {
3238
3113
  Component: ProtectedCreatePage
3239
3114
  };
@@ -3242,7 +3117,7 @@ const ROUTES_CE = [
3242
3117
  },
3243
3118
  {
3244
3119
  lazy: async () => {
3245
- const { ProtectedCreatePage } = await import('./CreatePage-puzZjQXr.mjs');
3120
+ const { ProtectedCreatePage } = await import('./CreatePage--JuxyfiM.mjs');
3246
3121
  return {
3247
3122
  Component: ProtectedCreatePage
3248
3123
  };
@@ -3251,7 +3126,7 @@ const ROUTES_CE = [
3251
3126
  },
3252
3127
  {
3253
3128
  lazy: async () => {
3254
- const { ProtectedEditPage } = await import('./EditPage-8_dXc9y1.mjs');
3129
+ const { ProtectedEditPage } = await import('./EditPage-0LYEDOqM.mjs');
3255
3130
  return {
3256
3131
  Component: ProtectedEditPage
3257
3132
  };
@@ -3260,7 +3135,7 @@ const ROUTES_CE = [
3260
3135
  },
3261
3136
  {
3262
3137
  lazy: async () => {
3263
- const { ProtectedListPage } = await import('./ListPage-4kGSO2Ri.mjs');
3138
+ const { ProtectedListPage } = await import('./ListPage-ecQ9qHgD.mjs');
3264
3139
  return {
3265
3140
  Component: ProtectedListPage
3266
3141
  };
@@ -3269,7 +3144,7 @@ const ROUTES_CE = [
3269
3144
  },
3270
3145
  {
3271
3146
  lazy: async () => {
3272
- const { ProtectedEditPage } = await import('./EditPage-W_qlhF-2.mjs');
3147
+ const { ProtectedEditPage } = await import('./EditPage-EnZY6R8C.mjs');
3273
3148
  return {
3274
3149
  Component: ProtectedEditPage
3275
3150
  };
@@ -3278,7 +3153,7 @@ const ROUTES_CE = [
3278
3153
  },
3279
3154
  {
3280
3155
  lazy: async () => {
3281
- const { ProtectedCreatePage } = await import('./CreatePage-GD7KENsP.mjs');
3156
+ const { ProtectedCreatePage } = await import('./CreatePage-N7P4KHBw.mjs');
3282
3157
  return {
3283
3158
  Component: ProtectedCreatePage
3284
3159
  };
@@ -3287,7 +3162,7 @@ const ROUTES_CE = [
3287
3162
  },
3288
3163
  {
3289
3164
  lazy: async () => {
3290
- const { ProtectedEditPage } = await import('./EditPage-8fk5JEO7.mjs').then(n => n.b);
3165
+ const { ProtectedEditPage } = await import('./EditPage-SEqJd8aL.mjs').then(n => n.b);
3291
3166
  return {
3292
3167
  Component: ProtectedEditPage
3293
3168
  };
@@ -3296,7 +3171,7 @@ const ROUTES_CE = [
3296
3171
  },
3297
3172
  {
3298
3173
  lazy: async () => {
3299
- const { ProtectedListPage } = await import('./ListPage-EPIYY3Uf.mjs');
3174
+ const { ProtectedListPage } = await import('./ListPage-8mH-itGQ.mjs');
3300
3175
  return {
3301
3176
  Component: ProtectedListPage
3302
3177
  };
@@ -3305,7 +3180,7 @@ const ROUTES_CE = [
3305
3180
  },
3306
3181
  {
3307
3182
  lazy: async () => {
3308
- const { ProtectedListView } = await import('./ListView-gKrpPLEM.mjs');
3183
+ const { ProtectedListView } = await import('./ListView-z5iwLF2-.mjs');
3309
3184
  return {
3310
3185
  Component: ProtectedListView
3311
3186
  };
@@ -3314,7 +3189,7 @@ const ROUTES_CE = [
3314
3189
  },
3315
3190
  {
3316
3191
  lazy: async () => {
3317
- const { ProtectedCreateView } = await import('./CreateView-EjqRVjU_.mjs');
3192
+ const { ProtectedCreateView } = await import('./CreateView-yZaKlylD.mjs');
3318
3193
  return {
3319
3194
  Component: ProtectedCreateView
3320
3195
  };
@@ -3323,7 +3198,7 @@ const ROUTES_CE = [
3323
3198
  },
3324
3199
  {
3325
3200
  lazy: async () => {
3326
- const { ProtectedEditView } = await import('./EditViewPage-f56oKqQ-.mjs');
3201
+ const { ProtectedEditView } = await import('./EditViewPage-Ol2GfMki.mjs');
3327
3202
  return {
3328
3203
  Component: ProtectedEditView
3329
3204
  };
@@ -3332,7 +3207,7 @@ const ROUTES_CE = [
3332
3207
  },
3333
3208
  {
3334
3209
  lazy: async () => {
3335
- const { ProtectedCreateView } = await import('./CreateView-jM_w7R83.mjs');
3210
+ const { ProtectedCreateView } = await import('./CreateView-XmSKJfeA.mjs');
3336
3211
  return {
3337
3212
  Component: ProtectedCreateView
3338
3213
  };
@@ -3341,7 +3216,7 @@ const ROUTES_CE = [
3341
3216
  },
3342
3217
  {
3343
3218
  lazy: async () => {
3344
- const { ProtectedListView } = await import('./ListView-Zvs5X2St.mjs');
3219
+ const { ProtectedListView } = await import('./ListView-el6fHHck.mjs');
3345
3220
  return {
3346
3221
  Component: ProtectedListView
3347
3222
  };
@@ -3350,32 +3225,455 @@ const ROUTES_CE = [
3350
3225
  },
3351
3226
  {
3352
3227
  lazy: async () => {
3353
- const { ProtectedEditView } = await import('./EditView-Cac025JW.mjs');
3228
+ const { ProtectedEditView } = await import('./EditView-Xnf-Y_i6.mjs');
3354
3229
  return {
3355
3230
  Component: ProtectedEditView
3356
3231
  };
3357
3232
  },
3358
- path: "transfer-tokens/:id"
3359
- },
3360
- {
3361
- lazy: async () => {
3362
- const { PurchaseAuditLogs } = await import('./PurchaseAuditLogs-iOYsTJA-.mjs');
3363
- return {
3364
- Component: PurchaseAuditLogs
3365
- };
3233
+ path: "transfer-tokens/:id"
3234
+ },
3235
+ {
3236
+ lazy: async () => {
3237
+ const { PurchaseAuditLogs } = await import('./PurchaseAuditLogs-FFyc1iqD.mjs');
3238
+ return {
3239
+ Component: PurchaseAuditLogs
3240
+ };
3241
+ },
3242
+ path: "purchase-audit-logs"
3243
+ },
3244
+ {
3245
+ lazy: async () => {
3246
+ const { PurchaseSingleSignOn } = await import('./PurchaseSingleSignOn-xU0fuX_i.mjs');
3247
+ return {
3248
+ Component: PurchaseSingleSignOn
3249
+ };
3250
+ },
3251
+ path: "purchase-single-sign-on"
3252
+ }
3253
+ ];
3254
+
3255
+ const getImmutableRoutes = () => [
3256
+ {
3257
+ path: "usecase",
3258
+ lazy: async () => {
3259
+ const { PrivateUseCasePage } = await import('./UseCasePage-zJ0ShP4K.mjs');
3260
+ return {
3261
+ Component: PrivateUseCasePage
3262
+ };
3263
+ }
3264
+ },
3265
+ // this needs to go before auth/:authType because otherwise it won't match the route
3266
+ ...getEERoutes$1(),
3267
+ {
3268
+ path: "auth/:authType",
3269
+ element: /* @__PURE__ */ jsx(AuthPage, {})
3270
+ }
3271
+ ];
3272
+ const getInitialRoutes = () => [
3273
+ {
3274
+ index: true,
3275
+ lazy: async () => {
3276
+ const { HomePage } = await import('./HomePage-XGnQE7ny.mjs');
3277
+ return {
3278
+ Component: HomePage
3279
+ };
3280
+ }
3281
+ },
3282
+ {
3283
+ path: "me",
3284
+ lazy: async () => {
3285
+ const { ProfilePage } = await import('./ProfilePage-ktCLvQFd.mjs');
3286
+ return {
3287
+ Component: ProfilePage
3288
+ };
3289
+ }
3290
+ },
3291
+ {
3292
+ path: "list-plugins",
3293
+ lazy: async () => {
3294
+ const { ProtectedInstalledPluginsPage } = await import('./InstalledPluginsPage-WaPhGz8o.mjs');
3295
+ return {
3296
+ Component: ProtectedInstalledPluginsPage
3297
+ };
3298
+ }
3299
+ },
3300
+ {
3301
+ path: "marketplace",
3302
+ lazy: async () => {
3303
+ const { ProtectedMarketplacePage } = await import('./MarketplacePage-tOb2ZzOl.mjs');
3304
+ return {
3305
+ Component: ProtectedMarketplacePage
3306
+ };
3307
+ }
3308
+ },
3309
+ {
3310
+ path: "settings/*",
3311
+ lazy: async () => {
3312
+ const { Layout } = await import('./Layout-zkpMXAoS.mjs');
3313
+ return {
3314
+ Component: Layout
3315
+ };
3316
+ },
3317
+ children: [
3318
+ {
3319
+ path: "application-infos",
3320
+ lazy: async () => {
3321
+ const { ApplicationInfoPage } = await import('./ApplicationInfoPage-dUIGrQGe.mjs');
3322
+ return {
3323
+ Component: ApplicationInfoPage
3324
+ };
3325
+ }
3326
+ },
3327
+ // ...Object.values(this.settings).flatMap(({ links }) =>
3328
+ // links.map(({ to, Component }) => ({
3329
+ // path: `${to}/*`,
3330
+ // element: (
3331
+ // <React.Suspense fallback={<Page.Loading />}>
3332
+ // <Component />
3333
+ // </React.Suspense>
3334
+ // ),
3335
+ // }))
3336
+ // ),
3337
+ ...[...getEERoutes(), ...ROUTES_CE].filter(
3338
+ (route, index, refArray) => refArray.findIndex((obj) => obj.path === route.path) === index
3339
+ )
3340
+ ]
3341
+ }
3342
+ ];
3343
+
3344
+ class Router {
3345
+ _routes = [];
3346
+ router = null;
3347
+ _menu = [];
3348
+ _settings = {
3349
+ global: {
3350
+ id: "global",
3351
+ intlLabel: {
3352
+ id: "Settings.global",
3353
+ defaultMessage: "Global Settings"
3354
+ },
3355
+ links: []
3356
+ }
3357
+ };
3358
+ constructor(initialRoutes) {
3359
+ this._routes = initialRoutes;
3360
+ }
3361
+ get routes() {
3362
+ return this._routes;
3363
+ }
3364
+ get menu() {
3365
+ return this._menu;
3366
+ }
3367
+ get settings() {
3368
+ return this._settings;
3369
+ }
3370
+ /**
3371
+ * @internal This method is used internally by Strapi to create the router.
3372
+ * It should not be used by plugins, doing so will likely break the application.
3373
+ */
3374
+ createRouter(strapi, { memory, ...opts } = {}) {
3375
+ const routes = [
3376
+ {
3377
+ path: "/*",
3378
+ errorElement: /* @__PURE__ */ jsx(Provider$1, { store: strapi.store, children: /* @__PURE__ */ jsx(LanguageProvider, { messages: strapi.configurations.translations, children: /* @__PURE__ */ jsx(Theme, { themes: strapi.configurations.themes, children: /* @__PURE__ */ jsx(ErrorElement, {}) }) }) }),
3379
+ element: /* @__PURE__ */ jsx(App, { strapi, store: strapi.store }),
3380
+ children: [
3381
+ ...getImmutableRoutes(),
3382
+ {
3383
+ path: "/*",
3384
+ lazy: async () => {
3385
+ const { PrivateAdminLayout } = await import('./AuthenticatedLayout-Nvdzrzx5.mjs');
3386
+ return {
3387
+ Component: PrivateAdminLayout
3388
+ };
3389
+ },
3390
+ children: [
3391
+ ...this.routes,
3392
+ {
3393
+ path: "*",
3394
+ element: /* @__PURE__ */ jsx(NotFoundPage, {})
3395
+ }
3396
+ ]
3397
+ }
3398
+ ]
3399
+ }
3400
+ ];
3401
+ if (memory) {
3402
+ this.router = createMemoryRouter(routes, opts);
3403
+ } else {
3404
+ this.router = createBrowserRouter(routes, opts);
3405
+ }
3406
+ return this.router;
3407
+ }
3408
+ addMenuLink = (link) => {
3409
+ invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
3410
+ invariant(
3411
+ typeof link.to === "string",
3412
+ `[${link.intlLabel.defaultMessage}]: Expected link.to to be a string instead received ${typeof link.to}`
3413
+ );
3414
+ invariant(
3415
+ link.intlLabel?.id && link.intlLabel?.defaultMessage,
3416
+ `[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage should be defined`
3417
+ );
3418
+ invariant(
3419
+ !link.Component || link.Component && typeof link.Component === "function",
3420
+ `[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise that returns a default component. Please use: \`Component: () => import(path)\` instead.`
3421
+ );
3422
+ if (!link.Component || link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
3423
+ link.Component[Symbol.toStringTag] === "AsyncFunction") {
3424
+ console.warn(
3425
+ `
3426
+ [${link.intlLabel.defaultMessage}]: [deprecated] addMenuLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
3427
+ `.trim()
3428
+ );
3429
+ }
3430
+ if (link.to.startsWith("/")) {
3431
+ console.warn(
3432
+ `[${link.intlLabel.defaultMessage}]: the \`to\` property of your menu link is an absolute path, it should be relative to the root of the application. This has been corrected for you but will be removed in a future version of Strapi.`
3433
+ );
3434
+ link.to = link.to.slice(1);
3435
+ }
3436
+ const { Component, ...restLink } = link;
3437
+ if (Component) {
3438
+ this._routes.push({
3439
+ path: `${link.to}/*`,
3440
+ lazy: async () => {
3441
+ const mod = await Component();
3442
+ if ("default" in mod) {
3443
+ return { Component: mod.default };
3444
+ } else {
3445
+ return { Component: mod };
3446
+ }
3447
+ }
3448
+ });
3449
+ }
3450
+ this.menu.push(restLink);
3451
+ };
3452
+ addSettingsLink(section, link) {
3453
+ if (typeof section === "object" && "links" in section) {
3454
+ invariant(section.id, "section.id should be defined");
3455
+ invariant(
3456
+ section.intlLabel?.id && section.intlLabel?.defaultMessage,
3457
+ "section.intlLabel should be defined"
3458
+ );
3459
+ invariant(this.settings[section.id] === void 0, "A similar section already exists");
3460
+ invariant(Array.isArray(section.links), "TypeError expected links to be an array");
3461
+ this.settings[section.id] = { ...section, links: [] };
3462
+ section.links.forEach((link2) => {
3463
+ this.createSettingsLink(section.id, link2);
3464
+ });
3465
+ } else if (typeof section === "object" && link) {
3466
+ invariant(section.id, "section.id should be defined");
3467
+ invariant(
3468
+ section.intlLabel?.id && section.intlLabel?.defaultMessage,
3469
+ "section.intlLabel should be defined"
3470
+ );
3471
+ invariant(this.settings[section.id] === void 0, "A similar section already exists");
3472
+ this.settings[section.id] = { ...section, links: [] };
3473
+ if (Array.isArray(link)) {
3474
+ link.forEach((l) => this.createSettingsLink(section.id, l));
3475
+ } else {
3476
+ this.createSettingsLink(section.id, link);
3477
+ }
3478
+ } else if (typeof section === "string" && link) {
3479
+ if (Array.isArray(link)) {
3480
+ link.forEach((l) => this.createSettingsLink(section, l));
3481
+ } else {
3482
+ this.createSettingsLink(section, link);
3483
+ }
3484
+ } else {
3485
+ throw new Error(
3486
+ "Invalid arguments provided to addSettingsLink, at minimum a sectionId and link are required."
3487
+ );
3488
+ }
3489
+ }
3490
+ createSettingsLink = (sectionId, link) => {
3491
+ invariant(this._settings[sectionId], "The section does not exist");
3492
+ invariant(link.id, `[${link.intlLabel.defaultMessage}]: link.id should be defined`);
3493
+ invariant(
3494
+ link.intlLabel?.id && link.intlLabel?.defaultMessage,
3495
+ `[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage`
3496
+ );
3497
+ invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
3498
+ invariant(
3499
+ !link.Component || link.Component && typeof link.Component === "function",
3500
+ `[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise. Please use: \`Component: () => import(path)\` instead.`
3501
+ );
3502
+ if (!link.Component || link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
3503
+ link.Component[Symbol.toStringTag] === "AsyncFunction") {
3504
+ console.warn(
3505
+ `
3506
+ [${link.intlLabel.defaultMessage}]: [deprecated] addSettingsLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
3507
+ `.trim()
3508
+ );
3509
+ }
3510
+ if (link.to.startsWith("/")) {
3511
+ console.warn(
3512
+ `[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link is an absolute path. It should be relative to \`/settings\`. This has been corrected for you but will be removed in a future version of Strapi.`
3513
+ );
3514
+ link.to = link.to.slice(1);
3515
+ }
3516
+ if (link.to.split("/")[0] === "settings") {
3517
+ console.warn(
3518
+ `[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link has \`settings\` as the first part of it's path. It should be relative to \`settings\` and therefore, not include it. This has been corrected for you but will be removed in a future version of Strapi.`
3519
+ );
3520
+ link.to = link.to.split("/").slice(1).join("/");
3521
+ }
3522
+ const { Component, ...restLink } = link;
3523
+ const settingsIndex = this._routes.findIndex((route) => route.path === "settings/*");
3524
+ if (!settingsIndex) {
3525
+ console.warn(
3526
+ "A third party plugin has removed the settings section, the settings link cannot be added."
3527
+ );
3528
+ return;
3529
+ } else if (!this._routes[settingsIndex].children) {
3530
+ this._routes[settingsIndex].children = [];
3531
+ }
3532
+ if (Component) {
3533
+ this._routes[settingsIndex].children.push({
3534
+ path: `${link.to}/*`,
3535
+ lazy: async () => {
3536
+ const mod = await Component();
3537
+ if ("default" in mod) {
3538
+ return { Component: mod.default };
3539
+ } else {
3540
+ return { Component: mod };
3541
+ }
3542
+ }
3543
+ });
3544
+ }
3545
+ this._settings[sectionId].links.push(restLink);
3546
+ };
3547
+ /**
3548
+ * @alpha
3549
+ * @description Adds a route or an array of routes to the router.
3550
+ * Otherwise, pass a function that receives the current routes and
3551
+ * returns the new routes in a reducer like fashion.
3552
+ */
3553
+ addRoute(route) {
3554
+ if (Array.isArray(route)) {
3555
+ this._routes = [...this._routes, ...route];
3556
+ } else if (typeof route === "object" && route !== null) {
3557
+ this._routes.push(route);
3558
+ } else if (typeof route === "function") {
3559
+ this._routes = route(this._routes);
3560
+ } else {
3561
+ throw new Error(
3562
+ `Expected the \`route\` passed to \`addRoute\` to be an array or a function, but received ${getPrintableType(
3563
+ route
3564
+ )}`
3565
+ );
3566
+ }
3567
+ }
3568
+ }
3569
+ const getPrintableType = (value) => {
3570
+ const nativeType = typeof value;
3571
+ if (nativeType === "object") {
3572
+ if (value === null)
3573
+ return "null";
3574
+ if (Array.isArray(value))
3575
+ return "array";
3576
+ if (value instanceof Object && value.constructor.name !== "Object") {
3577
+ return value.constructor.name;
3578
+ }
3579
+ }
3580
+ return nativeType;
3581
+ };
3582
+
3583
+ const staticReducers = {
3584
+ [adminApi.reducerPath]: adminApi.reducer,
3585
+ admin_app: reducer$3
3586
+ };
3587
+ const injectReducerStoreEnhancer = (appReducers) => (next) => (...args) => {
3588
+ const store = next(...args);
3589
+ const asyncReducers = {};
3590
+ return {
3591
+ ...store,
3592
+ asyncReducers,
3593
+ injectReducer: (key, asyncReducer) => {
3594
+ asyncReducers[key] = asyncReducer;
3595
+ store.replaceReducer(
3596
+ // @ts-expect-error we dynamically add reducers which makes the types uncomfortable.
3597
+ combineReducers({
3598
+ ...appReducers,
3599
+ ...asyncReducers
3600
+ })
3601
+ );
3602
+ }
3603
+ };
3604
+ };
3605
+ const configureStoreImpl = (preloadedState = {}, appMiddlewares = [], injectedReducers = {}) => {
3606
+ const coreReducers = { ...staticReducers, ...injectedReducers };
3607
+ const defaultMiddlewareOptions = {};
3608
+ if (process.env.NODE_ENV === "test") {
3609
+ defaultMiddlewareOptions.serializableCheck = false;
3610
+ defaultMiddlewareOptions.immutableCheck = false;
3611
+ }
3612
+ const store = configureStore({
3613
+ preloadedState: {
3614
+ admin_app: preloadedState.admin_app
3615
+ },
3616
+ reducer: coreReducers,
3617
+ devTools: process.env.NODE_ENV !== "production",
3618
+ middleware: (getDefaultMiddleware) => [
3619
+ ...getDefaultMiddleware(defaultMiddlewareOptions),
3620
+ rtkQueryUnauthorizedMiddleware,
3621
+ adminApi.middleware,
3622
+ ...appMiddlewares.map((m) => m())
3623
+ ],
3624
+ enhancers: [injectReducerStoreEnhancer(coreReducers)]
3625
+ });
3626
+ return store;
3627
+ };
3628
+ const rtkQueryUnauthorizedMiddleware = ({ dispatch }) => (next) => (action) => {
3629
+ if (isRejected(action) && action.payload?.status === 401) {
3630
+ dispatch(logout());
3631
+ window.location.href = "/admin/auth/login";
3632
+ return;
3633
+ }
3634
+ return next(action);
3635
+ };
3636
+
3637
+ const getBasename = () => (process.env.ADMIN_PATH ?? "").replace(window.location.origin, "");
3638
+
3639
+ const createHook = () => {
3640
+ const _handlers = [];
3641
+ return {
3642
+ register(fn) {
3643
+ _handlers.push(fn);
3644
+ },
3645
+ delete(handler) {
3646
+ _handlers.splice(_handlers.indexOf(handler), 1);
3647
+ },
3648
+ runWaterfall(args, store) {
3649
+ return _handlers.reduce((acc, fn) => fn(acc, store), args);
3650
+ },
3651
+ async runWaterfallAsync(args, store) {
3652
+ let result = args;
3653
+ for (const fn of _handlers) {
3654
+ result = await fn(result, store);
3655
+ }
3656
+ return result;
3657
+ },
3658
+ runSeries(...args) {
3659
+ return _handlers.map((fn) => fn(...args));
3366
3660
  },
3367
- path: "purchase-audit-logs"
3368
- },
3369
- {
3370
- lazy: async () => {
3371
- const { PurchaseSingleSignOn } = await import('./PurchaseSingleSignOn-X629iA7K.mjs');
3372
- return {
3373
- Component: PurchaseSingleSignOn
3374
- };
3661
+ async runSeriesAsync(...args) {
3662
+ const result = [];
3663
+ for (const fn of _handlers) {
3664
+ result.push(await fn(...args));
3665
+ }
3666
+ return result;
3375
3667
  },
3376
- path: "purchase-single-sign-on"
3377
- }
3378
- ];
3668
+ runParallel(...args) {
3669
+ return Promise.all(
3670
+ _handlers.map((fn) => {
3671
+ return fn(...args);
3672
+ })
3673
+ );
3674
+ }
3675
+ };
3676
+ };
3379
3677
 
3380
3678
  const languageNativeNames = {
3381
3679
  ar: "العربية",
@@ -3428,20 +3726,6 @@ class StrapiApp {
3428
3726
  injectionZones: {}
3429
3727
  };
3430
3728
  translations = {};
3431
- /**
3432
- * MENU API
3433
- */
3434
- menu = [];
3435
- settings = {
3436
- global: {
3437
- id: "global",
3438
- intlLabel: {
3439
- id: "Settings.global",
3440
- defaultMessage: "Global Settings"
3441
- },
3442
- links: []
3443
- }
3444
- };
3445
3729
  configurations = {
3446
3730
  authLogo: StrapiLogo,
3447
3731
  head: { favicon: "" },
@@ -3456,12 +3740,14 @@ class StrapiApp {
3456
3740
  * APIs
3457
3741
  */
3458
3742
  rbac = new RBAC();
3743
+ router;
3459
3744
  library = {
3460
3745
  components: {},
3461
3746
  fields: {}
3462
3747
  };
3463
3748
  middlewares = [];
3464
3749
  reducers = {};
3750
+ store = null;
3465
3751
  customFields = new CustomFields();
3466
3752
  constructor({ config, appPlugins } = {}) {
3467
3753
  this.appPlugins = appPlugins || {};
@@ -3470,6 +3756,7 @@ class StrapiApp {
3470
3756
  this.createHook(MUTATE_COLLECTION_TYPES_LINKS);
3471
3757
  this.createHook(MUTATE_SINGLE_TYPES_LINKS);
3472
3758
  this.createHook(MUTATE_EDIT_VIEW_LAYOUT);
3759
+ this.router = new Router(getInitialRoutes());
3473
3760
  }
3474
3761
  addComponents = (components) => {
3475
3762
  if (Array.isArray(components)) {
@@ -3497,46 +3784,6 @@ class StrapiApp {
3497
3784
  this.library.fields[fields.type] = fields.Component;
3498
3785
  }
3499
3786
  };
3500
- addMenuLink = (link) => {
3501
- invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
3502
- invariant(
3503
- typeof link.to === "string",
3504
- `[${link.intlLabel.defaultMessage}]: Expected link.to to be a string instead received ${typeof link.to}`
3505
- );
3506
- invariant(
3507
- link.intlLabel?.id && link.intlLabel?.defaultMessage,
3508
- `[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage should be defined`
3509
- );
3510
- invariant(
3511
- link.Component && typeof link.Component === "function",
3512
- `[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise that returns a default component. Please use: \`Component: () => import(path)\` instead.`
3513
- );
3514
- if (link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
3515
- link.Component[Symbol.toStringTag] === "AsyncFunction") {
3516
- console.warn(
3517
- `
3518
- [${link.intlLabel.defaultMessage}]: [deprecated] addMenuLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
3519
- `.trim()
3520
- );
3521
- }
3522
- if (link.to.startsWith("/")) {
3523
- console.warn(
3524
- `[${link.intlLabel.defaultMessage}]: the \`to\` property of your menu link is an absolute path, it should be relative to the root of the application. This has been corrected for you but will be removed in a future version of Strapi.`
3525
- );
3526
- link.to = link.to.slice(1);
3527
- }
3528
- this.menu.push({
3529
- ...link,
3530
- Component: React.lazy(async () => {
3531
- const mod = await link.Component();
3532
- if ("default" in mod) {
3533
- return mod;
3534
- } else {
3535
- return { default: mod };
3536
- }
3537
- })
3538
- });
3539
- };
3540
3787
  addMiddlewares = (middlewares) => {
3541
3788
  middlewares.forEach((middleware) => {
3542
3789
  this.middlewares.push(middleware);
@@ -3554,56 +3801,22 @@ class StrapiApp {
3554
3801
  this.reducers[name] = reducer;
3555
3802
  });
3556
3803
  };
3557
- addSettingsLink = (sectionId, link) => {
3558
- invariant(this.settings[sectionId], "The section does not exist");
3559
- invariant(link.id, `[${link.intlLabel.defaultMessage}]: link.id should be defined`);
3560
- invariant(
3561
- link.intlLabel?.id && link.intlLabel?.defaultMessage,
3562
- `[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage`
3563
- );
3564
- invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
3565
- invariant(
3566
- link.Component && typeof link.Component === "function",
3567
- `[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise. Please use: \`Component: () => import(path)\` instead.`
3568
- );
3569
- if (link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
3570
- link.Component[Symbol.toStringTag] === "AsyncFunction") {
3571
- console.warn(
3572
- `
3573
- [${link.intlLabel.defaultMessage}]: [deprecated] addSettingsLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
3574
- `.trim()
3575
- );
3576
- }
3577
- if (link.to.startsWith("/")) {
3578
- console.warn(
3579
- `[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link is an absolute path. It should be relative to \`/settings\`. This has been corrected for you but will be removed in a future version of Strapi.`
3580
- );
3581
- link.to = link.to.slice(1);
3582
- }
3583
- if (link.to.split("/")[0] === "settings") {
3584
- console.warn(
3585
- `[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link has \`settings\` as the first part of it's path. It should be relative to \`settings\` and therefore, not include it. This has been corrected for you but will be removed in a future version of Strapi.`
3586
- );
3587
- link.to = link.to.split("/").slice(1).join("/");
3588
- }
3589
- this.settings[sectionId].links.push({
3590
- ...link,
3591
- Component: React.lazy(async () => {
3592
- const mod = await link.Component();
3593
- if ("default" in mod) {
3594
- return mod;
3595
- } else {
3596
- return { default: mod };
3597
- }
3598
- })
3599
- });
3600
- };
3804
+ addMenuLink = (link) => this.router.addMenuLink(link);
3805
+ /**
3806
+ * @deprecated use `addSettingsLink` instead, it internally supports
3807
+ * adding multiple links at once.
3808
+ */
3601
3809
  addSettingsLinks = (sectionId, links) => {
3602
- invariant(this.settings[sectionId], "The section does not exist");
3603
3810
  invariant(Array.isArray(links), "TypeError expected links to be an array");
3604
- links.forEach((link) => {
3605
- this.addSettingsLink(sectionId, link);
3606
- });
3811
+ this.router.addSettingsLink(sectionId, links);
3812
+ };
3813
+ /**
3814
+ * @deprecated use `addSettingsLink` instead, you can pass a section object to
3815
+ * create the section and links at the same time.
3816
+ */
3817
+ createSettingSection = (section, links) => this.router.addSettingsLink(section, links);
3818
+ addSettingsLink = (sectionId, link) => {
3819
+ this.router.addSettingsLink(sectionId, link);
3607
3820
  };
3608
3821
  async bootstrap(customBootstrap) {
3609
3822
  Object.keys(this.appPlugins).forEach((plugin) => {
@@ -3670,19 +3883,6 @@ class StrapiApp {
3670
3883
  createHook = (name) => {
3671
3884
  this.hooksDict[name] = createHook();
3672
3885
  };
3673
- createSettingSection = (section, links) => {
3674
- invariant(section.id, "section.id should be defined");
3675
- invariant(
3676
- section.intlLabel?.id && section.intlLabel?.defaultMessage,
3677
- "section.intlLabel should be defined"
3678
- );
3679
- invariant(Array.isArray(links), "TypeError expected links to be an array");
3680
- invariant(this.settings[section.id] === void 0, "A similar section already exists");
3681
- this.settings[section.id] = { ...section, links: [] };
3682
- links.forEach((link) => {
3683
- this.addSettingsLink(section.id, link);
3684
- });
3685
- };
3686
3886
  getAdminInjectedComponents = (moduleName, containerName, blockName) => {
3687
3887
  try {
3688
3888
  return this.admin.injectionZones[moduleName][containerName][blockName] || [];
@@ -3692,16 +3892,19 @@ class StrapiApp {
3692
3892
  }
3693
3893
  };
3694
3894
  getPlugin = (pluginId) => this.plugins[pluginId];
3695
- async register() {
3895
+ async register(customRegister) {
3696
3896
  Object.keys(this.appPlugins).forEach((plugin) => {
3697
3897
  this.appPlugins[plugin].register(this);
3698
3898
  });
3899
+ if (isFunction(customRegister)) {
3900
+ customRegister(this);
3901
+ }
3699
3902
  }
3700
3903
  async loadAdminTrads() {
3701
3904
  const adminLocales = await Promise.all(
3702
3905
  this.configurations.locales.map(async (locale) => {
3703
3906
  try {
3704
- const { default: data } = await __variableDynamicImportRuntimeHelper((/* #__PURE__ */ Object.assign({"./translations/ar.json": () => import('./ar-gTQs8p7A.mjs'),"./translations/ca.json": () => import('./ca-A-U5stlG.mjs'),"./translations/cs.json": () => import('./cs-iYqoHUVt.mjs'),"./translations/de.json": () => import('./de-uZBjRd6a.mjs'),"./translations/dk.json": () => import('./dk-nXAO32DE.mjs'),"./translations/en.json": () => import('./en-K35WIWVM.mjs'),"./translations/es.json": () => import('./es-i0dEHPPQ.mjs'),"./translations/eu.json": () => import('./eu-wFmYHERY.mjs'),"./translations/fr.json": () => import('./fr-OI7VyC_k.mjs'),"./translations/gu.json": () => import('./gu-zSaMc-a6.mjs'),"./translations/he.json": () => import('./he-YzAGShlQ.mjs'),"./translations/hi.json": () => import('./hi-ZQ4t6UdY.mjs'),"./translations/hu.json": () => import('./hu-O1FJoY8c.mjs'),"./translations/id.json": () => import('./id-Lb_0kPQU.mjs'),"./translations/it.json": () => import('./it-136monzD.mjs'),"./translations/ja.json": () => import('./ja-0-FUC0T4.mjs'),"./translations/ko.json": () => import('./ko-H3Y8GpnD.mjs'),"./translations/ml.json": () => import('./ml-NPdcpJoN.mjs'),"./translations/ms.json": () => import('./ms-v9c434YI.mjs'),"./translations/nl.json": () => import('./nl-qHmOt3d1.mjs'),"./translations/no.json": () => import('./no-XGZQN-Ji.mjs'),"./translations/pl.json": () => import('./pl-Id5YX-Pw.mjs'),"./translations/pt-BR.json": () => import('./pt-BR-0o0Gf-P8.mjs'),"./translations/pt.json": () => import('./pt-f52AXrxz.mjs'),"./translations/ru.json": () => import('./ru-FpmG9SEf.mjs'),"./translations/sa.json": () => import('./sa-KUwV8aRB.mjs'),"./translations/sk.json": () => import('./sk-g_1C955P.mjs'),"./translations/sv.json": () => import('./sv-lzyY1dsz.mjs'),"./translations/th.json": () => import('./th-7LJ9Y8EL.mjs'),"./translations/tr.json": () => import('./tr-09v-DLMg.mjs'),"./translations/uk.json": () => import('./uk-38IblmOr.mjs'),"./translations/vi.json": () => import('./vi-ryNZtXtk.mjs'),"./translations/zh-Hans.json": () => import('./zh-Hans-HlxDUeVA.mjs'),"./translations/zh.json": () => import('./zh-WEteLuNm.mjs')})), `./translations/${locale}.json`);
3907
+ const { default: data } = await __variableDynamicImportRuntimeHelper((/* #__PURE__ */ Object.assign({"./translations/ar.json": () => import('./ar-gTQs8p7A.mjs'),"./translations/ca.json": () => import('./ca-A-U5stlG.mjs'),"./translations/cs.json": () => import('./cs-iYqoHUVt.mjs'),"./translations/de.json": () => import('./de-uZBjRd6a.mjs'),"./translations/dk.json": () => import('./dk-nXAO32DE.mjs'),"./translations/en.json": () => import('./en-0Ld-ipyI.mjs'),"./translations/es.json": () => import('./es-i0dEHPPQ.mjs'),"./translations/eu.json": () => import('./eu-wFmYHERY.mjs'),"./translations/fr.json": () => import('./fr-OI7VyC_k.mjs'),"./translations/gu.json": () => import('./gu-zSaMc-a6.mjs'),"./translations/he.json": () => import('./he-YzAGShlQ.mjs'),"./translations/hi.json": () => import('./hi-ZQ4t6UdY.mjs'),"./translations/hu.json": () => import('./hu-O1FJoY8c.mjs'),"./translations/id.json": () => import('./id-Lb_0kPQU.mjs'),"./translations/it.json": () => import('./it-136monzD.mjs'),"./translations/ja.json": () => import('./ja-0-FUC0T4.mjs'),"./translations/ko.json": () => import('./ko-H3Y8GpnD.mjs'),"./translations/ml.json": () => import('./ml-NPdcpJoN.mjs'),"./translations/ms.json": () => import('./ms-v9c434YI.mjs'),"./translations/nl.json": () => import('./nl-qHmOt3d1.mjs'),"./translations/no.json": () => import('./no-XGZQN-Ji.mjs'),"./translations/pl.json": () => import('./pl-Id5YX-Pw.mjs'),"./translations/pt-BR.json": () => import('./pt-BR-0o0Gf-P8.mjs'),"./translations/pt.json": () => import('./pt-f52AXrxz.mjs'),"./translations/ru.json": () => import('./ru-FpmG9SEf.mjs'),"./translations/sa.json": () => import('./sa-KUwV8aRB.mjs'),"./translations/sk.json": () => import('./sk-g_1C955P.mjs'),"./translations/sv.json": () => import('./sv-lzyY1dsz.mjs'),"./translations/th.json": () => import('./th-7LJ9Y8EL.mjs'),"./translations/tr.json": () => import('./tr-09v-DLMg.mjs'),"./translations/uk.json": () => import('./uk-38IblmOr.mjs'),"./translations/vi.json": () => import('./vi-ryNZtXtk.mjs'),"./translations/zh-Hans.json": () => import('./zh-Hans-HlxDUeVA.mjs'),"./translations/zh.json": () => import('./zh-WEteLuNm.mjs')})), `./translations/${locale}.json`);
3705
3908
  return { data, locale };
3706
3909
  } catch {
3707
3910
  return { data: null, locale };
@@ -3775,7 +3978,7 @@ class StrapiApp {
3775
3978
  render() {
3776
3979
  const localeNames = pick(languageNativeNames, this.configurations.locales || []);
3777
3980
  const locale = localStorage.getItem(LANGUAGE_LOCAL_STORAGE_KEY) || "en";
3778
- const store = configureStoreImpl(
3981
+ this.store = configureStoreImpl(
3779
3982
  {
3780
3983
  admin_app: {
3781
3984
  permissions: merge({}, ADMIN_PERMISSIONS_CE, ADMIN_PERMISSIONS_EE),
@@ -3786,126 +3989,16 @@ class StrapiApp {
3786
3989
  language: {
3787
3990
  locale: localeNames[locale] ? locale : "en",
3788
3991
  localeNames
3789
- }
3992
+ },
3993
+ token: getStoredToken()
3790
3994
  }
3791
3995
  },
3792
3996
  this.middlewares,
3793
3997
  this.reducers
3794
3998
  );
3795
- const settingsRoutes = [...getEERoutes(), ...ROUTES_CE].filter(
3796
- (route, index, refArray) => refArray.findIndex((obj) => obj.path === route.path) === index
3797
- );
3798
- const router = createBrowserRouter(
3799
- [
3800
- {
3801
- path: "/*",
3802
- errorElement: /* @__PURE__ */ jsx(Provider$1, { store, children: /* @__PURE__ */ jsx(LanguageProvider, { messages: this.configurations.translations, children: /* @__PURE__ */ jsx(Theme, { themes: this.configurations.themes, children: /* @__PURE__ */ jsx(ErrorElement, {}) }) }) }),
3803
- element: /* @__PURE__ */ jsx(App, { strapi: this, store }),
3804
- children: [
3805
- {
3806
- path: "usecase",
3807
- lazy: async () => {
3808
- const { PrivateUseCasePage } = await import('./UseCasePage-P4AFdcDQ.mjs');
3809
- return {
3810
- Component: PrivateUseCasePage
3811
- };
3812
- }
3813
- },
3814
- // this needs to go before auth/:authType because otherwise it won't match the route
3815
- ...getEERoutes$1(),
3816
- {
3817
- path: "auth/:authType",
3818
- element: /* @__PURE__ */ jsx(AuthPage, {})
3819
- },
3820
- {
3821
- path: "/*",
3822
- lazy: async () => {
3823
- const { PrivateAdminLayout } = await import('./AuthenticatedLayout-gOaUXjO8.mjs');
3824
- return {
3825
- Component: PrivateAdminLayout
3826
- };
3827
- },
3828
- children: [
3829
- {
3830
- index: true,
3831
- lazy: async () => {
3832
- const { HomePage } = await import('./HomePage-d4h0KEnw.mjs');
3833
- return {
3834
- Component: HomePage
3835
- };
3836
- }
3837
- },
3838
- {
3839
- path: "me",
3840
- lazy: async () => {
3841
- const { ProfilePage } = await import('./ProfilePage-zk-Py9wt.mjs');
3842
- return {
3843
- Component: ProfilePage
3844
- };
3845
- }
3846
- },
3847
- {
3848
- path: "list-plugins",
3849
- lazy: async () => {
3850
- const { ProtectedInstalledPluginsPage } = await import('./InstalledPluginsPage-nCdAsAAu.mjs');
3851
- return {
3852
- Component: ProtectedInstalledPluginsPage
3853
- };
3854
- }
3855
- },
3856
- {
3857
- path: "marketplace",
3858
- lazy: async () => {
3859
- const { ProtectedMarketplacePage } = await import('./MarketplacePage-oGhZBKgX.mjs');
3860
- return {
3861
- Component: ProtectedMarketplacePage
3862
- };
3863
- }
3864
- },
3865
- {
3866
- path: "settings/*",
3867
- lazy: async () => {
3868
- const { Layout } = await import('./Layout-Ax9QtxH1.mjs');
3869
- return {
3870
- Component: Layout
3871
- };
3872
- },
3873
- children: [
3874
- {
3875
- path: "application-infos",
3876
- lazy: async () => {
3877
- const { ApplicationInfoPage } = await import('./ApplicationInfoPage-6PD2owY8.mjs');
3878
- return {
3879
- Component: ApplicationInfoPage
3880
- };
3881
- }
3882
- },
3883
- ...Object.values(this.settings).flatMap(
3884
- ({ links }) => links.map(({ to, Component }) => ({
3885
- path: `${to}/*`,
3886
- element: /* @__PURE__ */ jsx(React.Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Component, {}) })
3887
- }))
3888
- ),
3889
- ...settingsRoutes
3890
- ]
3891
- },
3892
- ...this.menu.map(({ to, Component }) => ({
3893
- path: `${to}/*`,
3894
- element: /* @__PURE__ */ jsx(React.Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Component, {}) })
3895
- })),
3896
- {
3897
- path: "*",
3898
- element: /* @__PURE__ */ jsx(NotFoundPage, {})
3899
- }
3900
- ]
3901
- }
3902
- ]
3903
- }
3904
- ],
3905
- {
3906
- basename: getBasename()
3907
- }
3908
- );
3999
+ const router = this.router.createRouter(this, {
4000
+ basename: getBasename()
4001
+ });
3909
4002
  return /* @__PURE__ */ jsx(RouterProvider, { router });
3910
4003
  }
3911
4004
  }
@@ -3967,7 +4060,7 @@ const renderAdmin = async (mountNode, { plugins, customisations, features }) =>
3967
4060
  config: customisations?.config,
3968
4061
  appPlugins: plugins
3969
4062
  });
3970
- await app.register();
4063
+ await app.register(customisations?.register);
3971
4064
  await app.bootstrap(customisations?.bootstrap);
3972
4065
  await app.loadTrads(customisations?.config?.translations);
3973
4066
  createRoot(mountNode).render(app.render());
@@ -3978,13 +4071,12 @@ const renderAdmin = async (mountNode, { plugins, customisations, features }) =>
3978
4071
 
3979
4072
  const ConfirmDialog = ({
3980
4073
  children,
3981
- icon = /* @__PURE__ */ jsx(WarningCircle, {}),
3982
- onClose,
4074
+ icon = /* @__PURE__ */ jsx(StyledWarning, {}),
3983
4075
  onConfirm,
3984
- variant = "danger",
4076
+ variant = "danger-light",
3985
4077
  startAction,
3986
4078
  endAction,
3987
- ...props
4079
+ title
3988
4080
  }) => {
3989
4081
  const { formatMessage } = useIntl();
3990
4082
  const [isConfirming, setIsConfirming] = React.useState(false);
@@ -3992,49 +4084,53 @@ const ConfirmDialog = ({
3992
4084
  id: "app.confirm.body",
3993
4085
  defaultMessage: "Are you sure?"
3994
4086
  });
3995
- const handleConfirm = async () => {
4087
+ const handleConfirm = async (e) => {
3996
4088
  if (!onConfirm) {
3997
4089
  return;
3998
4090
  }
3999
4091
  try {
4000
4092
  setIsConfirming(true);
4001
- await onConfirm();
4002
- onClose();
4093
+ await onConfirm(e);
4003
4094
  } finally {
4004
4095
  setIsConfirming(false);
4005
4096
  }
4006
4097
  };
4007
- return /* @__PURE__ */ jsxs(
4008
- Dialog,
4009
- {
4010
- title: formatMessage({
4011
- id: "app.components.ConfirmDialog.title",
4012
- defaultMessage: "Confirmation"
4013
- }),
4014
- onClose,
4015
- ...props,
4016
- children: [
4017
- /* @__PURE__ */ jsx(DialogBody, { icon, children: typeof content === "string" ? /* @__PURE__ */ jsx(DefaultBodyWrapper, { children: content }) : content }),
4018
- /* @__PURE__ */ jsx(
4019
- DialogFooter,
4020
- {
4021
- startAction: startAction || /* @__PURE__ */ jsx(Button, { onClick: onClose, variant: "tertiary", children: formatMessage({
4022
- id: "app.components.Button.cancel",
4023
- defaultMessage: "Cancel"
4024
- }) }),
4025
- endAction: endAction || /* @__PURE__ */ jsx(Button, { onClick: handleConfirm, variant, loading: isConfirming, children: formatMessage({
4026
- id: "app.components.Button.confirm",
4027
- defaultMessage: "Confirm"
4028
- }) })
4029
- }
4030
- )
4031
- ]
4032
- }
4033
- );
4034
- };
4035
- const DefaultBodyWrapper = ({ children }) => {
4036
- return /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 2, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { variant: "omega", children }) }) });
4098
+ return /* @__PURE__ */ jsxs(Dialog.Content, { children: [
4099
+ /* @__PURE__ */ jsx(Dialog.Header, { children: title || formatMessage({
4100
+ id: "app.components.ConfirmDialog.title",
4101
+ defaultMessage: "Confirmation"
4102
+ }) }),
4103
+ /* @__PURE__ */ jsx(Dialog.Body, { icon, children: content }),
4104
+ /* @__PURE__ */ jsxs(Dialog.Footer, { children: [
4105
+ startAction || /* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(
4106
+ Button,
4107
+ {
4108
+ fullWidth: true,
4109
+ variant: "tertiary",
4110
+ onClick: (e) => {
4111
+ e.stopPropagation();
4112
+ },
4113
+ children: formatMessage({
4114
+ id: "app.components.Button.cancel",
4115
+ defaultMessage: "Cancel"
4116
+ })
4117
+ }
4118
+ ) }),
4119
+ endAction || /* @__PURE__ */ jsx(Dialog.Action, { children: /* @__PURE__ */ jsx(Button, { fullWidth: true, onClick: handleConfirm, variant, loading: isConfirming, children: formatMessage({
4120
+ id: "app.components.Button.confirm",
4121
+ defaultMessage: "Confirm"
4122
+ }) }) })
4123
+ ] })
4124
+ ] });
4037
4125
  };
4126
+ const StyledWarning = styled(WarningCircle)`
4127
+ width: 24px;
4128
+ height: 24px;
4129
+
4130
+ path {
4131
+ fill: ${({ theme }) => theme.colors.danger600};
4132
+ }
4133
+ `;
4038
4134
 
4039
4135
  const useIsMounted = () => {
4040
4136
  const isMounted = React.useRef(false);
@@ -4299,6 +4395,7 @@ const STRING_PARSE_FILTERS = [
4299
4395
  value: "$endsWithi"
4300
4396
  }
4301
4397
  ];
4398
+ const FILTERS_WITH_NO_VALUE = ["$null", "$notNull"];
4302
4399
 
4303
4400
  function useControllableState({
4304
4401
  prop,
@@ -4376,90 +4473,78 @@ const Root$2 = ({
4376
4473
  children,
4377
4474
  disabled = false,
4378
4475
  onChange,
4476
+ options = [],
4379
4477
  onOpenChange,
4380
4478
  open: openProp,
4381
4479
  defaultOpen,
4382
- options = []
4480
+ ...restProps
4383
4481
  }) => {
4384
- const [triggerNode, setTriggerNode] = React.useState(null);
4385
- const [open = false, setOpen] = useControllableState({
4386
- prop: openProp,
4387
- defaultProp: defaultOpen,
4388
- onChange: onOpenChange
4389
- });
4390
4482
  const handleChange = (data) => {
4391
4483
  if (onChange) {
4392
4484
  onChange(data);
4393
4485
  }
4394
4486
  };
4395
- return /* @__PURE__ */ jsx(
4487
+ const [open = false, setOpen] = useControllableState({
4488
+ prop: openProp,
4489
+ defaultProp: defaultOpen,
4490
+ onChange: onOpenChange
4491
+ });
4492
+ return /* @__PURE__ */ jsx(Popover.Root, { open, onOpenChange: setOpen, ...restProps, children: /* @__PURE__ */ jsx(
4396
4493
  FiltersProvider,
4397
4494
  {
4495
+ setOpen,
4398
4496
  disabled,
4399
4497
  onChange: handleChange,
4400
- open,
4401
4498
  options,
4402
- setOpen,
4403
- setTriggerNode,
4404
- triggerNode,
4405
4499
  children
4406
4500
  }
4407
- );
4501
+ ) });
4408
4502
  };
4409
4503
  const Trigger = React.forwardRef(
4410
4504
  ({ label }, forwardedRef) => {
4411
4505
  const { formatMessage } = useIntl();
4412
- const { setTriggerNode, setOpen } = useFilters("Trigger", ({ setTriggerNode: setTriggerNode2, setOpen: setOpen2 }) => ({
4413
- setTriggerNode: setTriggerNode2,
4414
- setOpen: setOpen2
4415
- }));
4416
4506
  const disabled = useFilters("Trigger", ({ disabled: disabled2 }) => disabled2);
4417
- const open = useFilters("Trigger", ({ open: open2 }) => open2);
4418
- const composedRefs = useComposedRefs(forwardedRef, setTriggerNode);
4419
- const handleClick = () => setOpen(!open);
4420
- return /* @__PURE__ */ jsx(
4507
+ return /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
4421
4508
  Button,
4422
4509
  {
4423
4510
  variant: "tertiary",
4424
- ref: composedRefs,
4511
+ ref: forwardedRef,
4425
4512
  startIcon: /* @__PURE__ */ jsx(Filter, {}),
4426
- onClick: handleClick,
4427
4513
  size: "S",
4428
4514
  disabled,
4429
4515
  children: label || formatMessage({ id: "app.utils.filters", defaultMessage: "Filters" })
4430
4516
  }
4431
- );
4517
+ ) });
4432
4518
  }
4433
4519
  );
4434
4520
  const PopoverImpl = () => {
4435
4521
  const [{ query }, setQuery] = useQueryParams();
4436
4522
  const { formatMessage } = useIntl();
4437
- const open = useFilters("Popover", ({ open: open2 }) => open2);
4438
4523
  const options = useFilters("Popover", ({ options: options2 }) => options2);
4439
- const triggerNode = useFilters("Popover", ({ triggerNode: triggerNode2 }) => triggerNode2);
4440
- const setOpen = useFilters("Popover", ({ setOpen: setOpen2 }) => setOpen2);
4441
4524
  const onChange = useFilters("Popover", ({ onChange: onChange2 }) => onChange2);
4442
- if (!open || options.length === 0 || !triggerNode) {
4525
+ const setOpen = useFilters("Popover", ({ setOpen: setOpen2 }) => setOpen2);
4526
+ if (options.length === 0) {
4443
4527
  return null;
4444
4528
  }
4445
4529
  const handleSubmit = (data) => {
4446
- if (!data.value) {
4530
+ const value = FILTERS_WITH_NO_VALUE.includes(data.filter) ? "true" : data.value;
4531
+ if (!value) {
4447
4532
  return;
4448
4533
  }
4449
4534
  if (onChange) {
4450
4535
  onChange(data);
4451
4536
  }
4452
- const filterType = options.find((filter) => filter.name === data.name).type;
4537
+ const fieldOptions = options.find((filter) => filter.name === data.name);
4453
4538
  const operatorValuePairing = {
4454
- [data.filter]: data.value
4539
+ [data.filter]: value
4455
4540
  };
4456
4541
  const newFilterQuery = {
4457
4542
  ...query.filters,
4458
4543
  $and: [
4459
4544
  ...query.filters?.$and ?? [],
4460
4545
  {
4461
- [data.name]: filterType === "relation" ? {
4462
- id: operatorValuePairing
4546
+ [data.name]: fieldOptions.type === "relation" ? {
4547
+ [fieldOptions.mainField?.name ?? "id"]: operatorValuePairing
4463
4548
  } : operatorValuePairing
4464
4549
  }
4465
4550
  ]
@@ -4467,89 +4552,79 @@ const PopoverImpl = () => {
4467
4552
  setQuery({ filters: newFilterQuery, page: 1 });
4468
4553
  setOpen(false);
4469
4554
  };
4470
- return /* @__PURE__ */ jsx(
4471
- PopoverPrimitives.Content,
4555
+ return /* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsx(Box, { padding: 3, children: /* @__PURE__ */ jsx(
4556
+ Form,
4472
4557
  {
4473
- source: { current: triggerNode },
4474
- onDismiss: () => setOpen(false),
4475
- padding: 3,
4476
- spacing: 4,
4477
- maxHeight: "unset",
4478
- children: /* @__PURE__ */ jsx(
4479
- Form,
4480
- {
4481
- method: "POST",
4482
- initialValues: {
4483
- name: options[0]?.name,
4484
- filter: BASE_FILTERS[0].value
4485
- },
4486
- onSubmit: handleSubmit,
4487
- children: ({ values: formValues, modified, isSubmitting }) => {
4488
- const filter = options.find((filter2) => filter2.name === formValues.name);
4489
- const Input = filter?.input || MemoizedInputRenderer;
4490
- return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, style: { minWidth: 184 }, children: [
4491
- [
4492
- {
4493
- ["aria-label"]: formatMessage({
4494
- id: "app.utils.select-field",
4495
- defaultMessage: "Select field"
4496
- }),
4497
- name: "name",
4498
- options: options.map((filter2) => ({
4499
- label: filter2.label,
4500
- value: filter2.name
4501
- })),
4502
- placholder: formatMessage({
4503
- id: "app.utils.select-field",
4504
- defaultMessage: "Select field"
4505
- }),
4506
- type: "enumeration"
4507
- },
4508
- {
4509
- ["aria-label"]: formatMessage({
4510
- id: "app.utils.select-filter",
4511
- defaultMessage: "Select filter"
4512
- }),
4513
- name: "filter",
4514
- options: filter?.operators || getFilterList(filter).map((opt) => ({
4515
- label: formatMessage(opt.label),
4516
- value: opt.value
4517
- })),
4518
- placeholder: formatMessage({
4519
- id: "app.utils.select-filter",
4520
- defaultMessage: "Select filter"
4521
- }),
4522
- type: "enumeration"
4523
- }
4524
- ].map((field) => /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field }, field.name)),
4525
- filter && formValues.filter && formValues.filter !== "$null" && formValues.filter !== "$notNull" ? /* @__PURE__ */ jsx(
4526
- Input,
4527
- {
4528
- ...filter,
4529
- label: null,
4530
- "aria-label": filter.label,
4531
- name: "value",
4532
- type: filter.mainField?.type ?? filter.type
4533
- }
4534
- ) : null,
4535
- /* @__PURE__ */ jsx(
4536
- Button,
4537
- {
4538
- disabled: !modified || isSubmitting,
4539
- size: "L",
4540
- variant: "secondary",
4541
- startIcon: /* @__PURE__ */ jsx(Plus, {}),
4542
- type: "submit",
4543
- fullWidth: true,
4544
- children: formatMessage({ id: "app.utils.add-filter", defaultMessage: "Add filter" })
4545
- }
4546
- )
4547
- ] });
4548
- }
4549
- }
4550
- )
4558
+ method: "POST",
4559
+ initialValues: {
4560
+ name: options[0]?.name,
4561
+ filter: BASE_FILTERS[0].value
4562
+ },
4563
+ onSubmit: handleSubmit,
4564
+ children: ({ values: formValues, modified, isSubmitting }) => {
4565
+ const filter = options.find((filter2) => filter2.name === formValues.name);
4566
+ const Input = filter?.input || MemoizedInputRenderer;
4567
+ return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, style: { minWidth: 184 }, children: [
4568
+ [
4569
+ {
4570
+ ["aria-label"]: formatMessage({
4571
+ id: "app.utils.select-field",
4572
+ defaultMessage: "Select field"
4573
+ }),
4574
+ name: "name",
4575
+ options: options.map((filter2) => ({
4576
+ label: filter2.label,
4577
+ value: filter2.name
4578
+ })),
4579
+ placholder: formatMessage({
4580
+ id: "app.utils.select-field",
4581
+ defaultMessage: "Select field"
4582
+ }),
4583
+ type: "enumeration"
4584
+ },
4585
+ {
4586
+ ["aria-label"]: formatMessage({
4587
+ id: "app.utils.select-filter",
4588
+ defaultMessage: "Select filter"
4589
+ }),
4590
+ name: "filter",
4591
+ options: filter?.operators || getFilterList(filter).map((opt) => ({
4592
+ label: formatMessage(opt.label),
4593
+ value: opt.value
4594
+ })),
4595
+ placeholder: formatMessage({
4596
+ id: "app.utils.select-filter",
4597
+ defaultMessage: "Select filter"
4598
+ }),
4599
+ type: "enumeration"
4600
+ }
4601
+ ].map((field) => /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field }, field.name)),
4602
+ filter && formValues.filter && formValues.filter !== "$null" && formValues.filter !== "$notNull" ? /* @__PURE__ */ jsx(
4603
+ Input,
4604
+ {
4605
+ ...filter,
4606
+ label: null,
4607
+ "aria-label": filter.label,
4608
+ name: "value",
4609
+ type: filter.mainField?.type ?? filter.type
4610
+ }
4611
+ ) : null,
4612
+ /* @__PURE__ */ jsx(
4613
+ Button,
4614
+ {
4615
+ disabled: !modified || isSubmitting,
4616
+ size: "L",
4617
+ variant: "secondary",
4618
+ startIcon: /* @__PURE__ */ jsx(Plus, {}),
4619
+ type: "submit",
4620
+ fullWidth: true,
4621
+ children: formatMessage({ id: "app.utils.add-filter", defaultMessage: "Add filter" })
4622
+ }
4623
+ )
4624
+ ] });
4625
+ }
4551
4626
  }
4552
- );
4627
+ ) }) });
4553
4628
  };
4554
4629
  const getFilterList = (filter) => {
4555
4630
  if (!filter) {
@@ -4559,7 +4634,6 @@ const getFilterList = (filter) => {
4559
4634
  switch (type) {
4560
4635
  case "email":
4561
4636
  case "text":
4562
- case "enumeration":
4563
4637
  case "string": {
4564
4638
  return [
4565
4639
  ...BASE_FILTERS,
@@ -4581,6 +4655,9 @@ const getFilterList = (filter) => {
4581
4655
  case "datetime": {
4582
4656
  return [...BASE_FILTERS, ...NUMERIC_FILTERS];
4583
4657
  }
4658
+ case "enumeration": {
4659
+ return BASE_FILTERS;
4660
+ }
4584
4661
  default:
4585
4662
  return [...BASE_FILTERS, ...IS_SENSITIVE_FILTERS];
4586
4663
  }
@@ -4733,18 +4810,28 @@ const Root$1 = React.forwardRef(
4733
4810
  onPageSizeChange(pageSize);
4734
4811
  }
4735
4812
  };
4736
- return /* @__PURE__ */ jsx(Flex, { ref: forwardedRef, paddingTop: 4, alignItems: "flex-end", justifyContent: "space-between", children: /* @__PURE__ */ jsx(
4737
- PaginationProvider,
4813
+ return /* @__PURE__ */ jsx(
4814
+ Flex,
4738
4815
  {
4739
- currentQuery: query,
4740
- page: query.page,
4741
- pageSize: query.pageSize,
4742
- pageCount: pageCount.toString(),
4743
- setPageSize,
4744
- total,
4745
- children
4816
+ ref: forwardedRef,
4817
+ paddingTop: 4,
4818
+ paddingBottom: 4,
4819
+ alignItems: "flex-end",
4820
+ justifyContent: "space-between",
4821
+ children: /* @__PURE__ */ jsx(
4822
+ PaginationProvider,
4823
+ {
4824
+ currentQuery: query,
4825
+ page: query.page,
4826
+ pageSize: query.pageSize,
4827
+ pageCount: pageCount.toString(),
4828
+ setPageSize,
4829
+ total,
4830
+ children
4831
+ }
4832
+ )
4746
4833
  }
4747
- ) });
4834
+ );
4748
4835
  }
4749
4836
  );
4750
4837
  const PageSize = ({ options = ["10", "20", "50", "100"] }) => {
@@ -4920,7 +5007,7 @@ const SearchInput = ({
4920
5007
  disabled,
4921
5008
  label: formatMessage({ id: "global.search", defaultMessage: "Search" }),
4922
5009
  onClick: handleToggle,
4923
- children: /* @__PURE__ */ jsx(Search, { fill: "neutral800" })
5010
+ children: /* @__PURE__ */ jsx(Search, {})
4924
5011
  }
4925
5012
  );
4926
5013
  };
@@ -5059,16 +5146,15 @@ const HeaderCheckboxCell = () => {
5059
5146
  }
5060
5147
  };
5061
5148
  return /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(
5062
- BaseCheckbox,
5149
+ Checkbox,
5063
5150
  {
5064
5151
  "aria-label": formatMessage({
5065
5152
  id: "global.select-all-entries",
5066
5153
  defaultMessage: "Select all entries"
5067
5154
  }),
5068
5155
  disabled: rows.length === 0,
5069
- checked: areAllEntriesSelected,
5070
- indeterminate: isIndeterminate,
5071
- onChange: handleSelectAll
5156
+ checked: isIndeterminate ? "indeterminate" : areAllEntriesSelected,
5157
+ onCheckedChange: handleSelectAll
5072
5158
  }
5073
5159
  ) });
5074
5160
  };
@@ -5112,7 +5198,9 @@ const Body = ({ children }) => {
5112
5198
  const Row = (props) => {
5113
5199
  return /* @__PURE__ */ jsx(Tr, { ...props });
5114
5200
  };
5115
- const Cell = Td;
5201
+ const Cell = (props) => {
5202
+ return /* @__PURE__ */ jsx(Td, { ...props });
5203
+ };
5116
5204
  const CheckboxCell = ({ id, ...props }) => {
5117
5205
  const rows = useTable("CheckboxCell", (state) => state.rows);
5118
5206
  const selectedRows = useTable("CheckboxCell", (state) => state.selectedRows);
@@ -5123,7 +5211,7 @@ const CheckboxCell = ({ id, ...props }) => {
5123
5211
  };
5124
5212
  const isChecked = selectedRows.findIndex((row) => row.id === id) > -1;
5125
5213
  return /* @__PURE__ */ jsx(Cell, { ...props, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
5126
- BaseCheckbox,
5214
+ Checkbox,
5127
5215
  {
5128
5216
  "aria-label": formatMessage(
5129
5217
  {
@@ -5134,7 +5222,7 @@ const CheckboxCell = ({ id, ...props }) => {
5134
5222
  ),
5135
5223
  disabled: rows.length === 0,
5136
5224
  checked: isChecked,
5137
- onChange: handleSelectRow
5225
+ onCheckedChange: handleSelectRow
5138
5226
  }
5139
5227
  ) });
5140
5228
  };
@@ -5350,5 +5438,5 @@ const {
5350
5438
  } = usersService;
5351
5439
  const useAdminUsers = useGetUsersQuery;
5352
5440
 
5353
- export { isObject as A, BackButton as B, ConfirmDialog as C, useInjectReducer as D, useFocusInputField as E, Form as F, renderAdmin as G, DescriptionComponentRenderer as H, Blocker as I, getYupValidationErrors as J, useTable as K, LayoutContent as L, MemoizedInputRenderer as M, NpsSurvey as N, constants as O, Pagination as P, SearchInput as S, Table as T, UnauthenticatedLayout as U, Logo as a, Layouts as b, useGetRolesQuery as c, Login as d, errorsTrads as e, useGetRolePermissionLayoutQuery as f, useGetRolePermissionsQuery as g, useCreateRoleMutation as h, useUpdateRolePermissionsMutation as i, useUpdateUserMutation as j, useAdminUsers as k, useGuidedTour as l, getBasename as m, Column as n, useQueryParams as o, useFetchClient as p, useUpdateRoleMutation as q, SETTINGS_LINKS_CE as r, useCreateUserMutation as s, useDeleteManyUsersMutation as t, useField as u, Filters as v, useClipboard as w, useForm as x, MemoizedStringInput as y, StrapiLogo as z };
5354
- //# sourceMappingURL=index-EQL2s09p.mjs.map
5441
+ export { useInjectReducer as A, BackButton as B, ConfirmDialog as C, useFocusInputField as D, renderAdmin as E, Form as F, DescriptionComponentRenderer as G, Blocker as H, getYupValidationErrors as I, useTable as J, constants as K, LayoutContent as L, MemoizedInputRenderer as M, NpsSurvey as N, Pagination as P, SearchInput as S, Table as T, UnauthenticatedLayout as U, Logo as a, Layouts as b, useGetRolesQuery as c, Login as d, errorsTrads as e, useGetRolePermissionLayoutQuery as f, useGetRolePermissionsQuery as g, useCreateRoleMutation as h, useUpdateRolePermissionsMutation as i, useUpdateUserMutation as j, useAdminUsers as k, useGuidedTour as l, getBasename as m, Column as n, useQueryParams as o, useFetchClient as p, useUpdateRoleMutation as q, SETTINGS_LINKS_CE as r, useCreateUserMutation as s, useDeleteManyUsersMutation as t, useField as u, Filters as v, useClipboard as w, useForm as x, MemoizedStringInput as y, StrapiLogo as z };
5442
+ //# sourceMappingURL=index-8-k5RCnK.mjs.map