@questpie/admin 3.2.4 → 3.2.5

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 (248) hide show
  1. package/dist/client/blocks/block-renderer.d.mts +2 -2
  2. package/dist/client/blocks/block-renderer.mjs +164 -339
  3. package/dist/client/components/actions/action-button.mjs +9 -9
  4. package/dist/client/components/actions/action-dialog.mjs +195 -493
  5. package/dist/client/components/actions/confirmation-dialog.mjs +44 -159
  6. package/dist/client/components/actions/header-actions.mjs +73 -165
  7. package/dist/client/components/admin-link.mjs +40 -126
  8. package/dist/client/components/auth/auth-loading.mjs +9 -44
  9. package/dist/client/components/blocks/block-canvas.mjs +31 -95
  10. package/dist/client/components/blocks/block-editor-context.mjs +13 -57
  11. package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
  12. package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
  13. package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
  14. package/dist/client/components/blocks/block-insert-button.mjs +49 -165
  15. package/dist/client/components/blocks/block-item-menu.mjs +102 -301
  16. package/dist/client/components/blocks/block-item.mjs +136 -370
  17. package/dist/client/components/blocks/block-library-sidebar.mjs +103 -230
  18. package/dist/client/components/blocks/block-tree.mjs +12 -68
  19. package/dist/client/components/blocks/block-type-icon.mjs +14 -56
  20. package/dist/client/components/brand-logo.mjs +35 -149
  21. package/dist/client/components/component-renderer.mjs +42 -118
  22. package/dist/client/components/error-boundary.mjs +14 -58
  23. package/dist/client/components/fields/array-field.mjs +209 -521
  24. package/dist/client/components/fields/asset-preview-field.mjs +41 -141
  25. package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
  26. package/dist/client/components/fields/boolean-field.mjs +29 -59
  27. package/dist/client/components/fields/date-field.mjs +7 -37
  28. package/dist/client/components/fields/datetime-field.mjs +7 -38
  29. package/dist/client/components/fields/email-field.mjs +25 -54
  30. package/dist/client/components/fields/field-wrapper.mjs +30 -105
  31. package/dist/client/components/fields/json-field.mjs +94 -296
  32. package/dist/client/components/fields/locale-badge.mjs +6 -15
  33. package/dist/client/components/fields/number-field.mjs +27 -60
  34. package/dist/client/components/fields/object-array-field.mjs +283 -659
  35. package/dist/client/components/fields/object-field.mjs +165 -633
  36. package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
  37. package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
  38. package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
  39. package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
  40. package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
  41. package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
  42. package/dist/client/components/fields/relation-field.mjs +10 -66
  43. package/dist/client/components/fields/relation-picker.mjs +18 -18
  44. package/dist/client/components/fields/relation-select.mjs +12 -12
  45. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -180
  46. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +2 -2
  47. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
  48. package/dist/client/components/fields/rich-text-editor/index.mjs +195 -513
  49. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
  50. package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
  51. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
  52. package/dist/client/components/fields/rich-text-field.mjs +14 -53
  53. package/dist/client/components/fields/select-field.mjs +39 -74
  54. package/dist/client/components/fields/text-field.mjs +26 -59
  55. package/dist/client/components/fields/textarea-field.mjs +26 -58
  56. package/dist/client/components/fields/time-field.mjs +7 -35
  57. package/dist/client/components/fields/upload-field.mjs +47 -165
  58. package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
  59. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
  60. package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
  61. package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
  62. package/dist/client/components/history-sidebar.mjs +285 -605
  63. package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
  64. package/dist/client/components/locale-switcher.mjs +106 -228
  65. package/dist/client/components/media/media-grid.mjs +84 -273
  66. package/dist/client/components/media/media-picker-dialog.mjs +176 -476
  67. package/dist/client/components/preview/live-preview-mode.mjs +233 -458
  68. package/dist/client/components/preview/preview-pane.mjs +22 -22
  69. package/dist/client/components/primitives/asset-preview.mjs +290 -666
  70. package/dist/client/components/primitives/checkbox-input.mjs +9 -35
  71. package/dist/client/components/primitives/date-input.mjs +109 -327
  72. package/dist/client/components/primitives/dropzone.mjs +209 -336
  73. package/dist/client/components/primitives/field-select-control.mjs +12 -80
  74. package/dist/client/components/primitives/number-input.mjs +4 -4
  75. package/dist/client/components/primitives/select-multi.mjs +200 -559
  76. package/dist/client/components/primitives/select-single.mjs +165 -499
  77. package/dist/client/components/primitives/time-input.mjs +43 -117
  78. package/dist/client/components/primitives/toggle-input.mjs +9 -29
  79. package/dist/client/components/sheets/resource-sheet.mjs +61 -70
  80. package/dist/client/components/ui/accordion.mjs +35 -155
  81. package/dist/client/components/ui/alert.mjs +13 -68
  82. package/dist/client/components/ui/badge.mjs +9 -51
  83. package/dist/client/components/ui/button.mjs +8 -54
  84. package/dist/client/components/ui/card.mjs +37 -193
  85. package/dist/client/components/ui/checkbox.mjs +12 -68
  86. package/dist/client/components/ui/command.mjs +48 -219
  87. package/dist/client/components/ui/dialog.mjs +50 -262
  88. package/dist/client/components/ui/drawer.mjs +55 -259
  89. package/dist/client/components/ui/dropdown-menu.mjs +86 -427
  90. package/dist/client/components/ui/empty-state.mjs +28 -98
  91. package/dist/client/components/ui/field.mjs +73 -309
  92. package/dist/client/components/ui/input-group.mjs +42 -167
  93. package/dist/client/components/ui/input.mjs +7 -37
  94. package/dist/client/components/ui/kbd.mjs +6 -36
  95. package/dist/client/components/ui/label.mjs +7 -37
  96. package/dist/client/components/ui/popover.mjs +34 -169
  97. package/dist/client/components/ui/responsive-dialog.mjs +67 -273
  98. package/dist/client/components/ui/scroll-fade.mjs +63 -158
  99. package/dist/client/components/ui/search-input.mjs +33 -100
  100. package/dist/client/components/ui/select.mjs +72 -393
  101. package/dist/client/components/ui/separator.mjs +7 -38
  102. package/dist/client/components/ui/sheet.mjs +49 -269
  103. package/dist/client/components/ui/sidebar.mjs +171 -690
  104. package/dist/client/components/ui/skeleton.mjs +7 -38
  105. package/dist/client/components/ui/sonner.mjs +11 -42
  106. package/dist/client/components/ui/switch.mjs +9 -45
  107. package/dist/client/components/ui/table.mjs +48 -266
  108. package/dist/client/components/ui/tabs.mjs +26 -139
  109. package/dist/client/components/ui/textarea.mjs +6 -32
  110. package/dist/client/components/ui/tooltip.mjs +27 -129
  111. package/dist/client/components/widgets/chart-widget.mjs +174 -522
  112. package/dist/client/components/widgets/progress-widget.mjs +66 -172
  113. package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
  114. package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
  115. package/dist/client/components/widgets/stats-widget.mjs +41 -175
  116. package/dist/client/components/widgets/table-widget.mjs +9 -9
  117. package/dist/client/components/widgets/timeline-widget.mjs +86 -226
  118. package/dist/client/components/widgets/value-widget.mjs +74 -381
  119. package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
  120. package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
  121. package/dist/client/contexts/focus-context.mjs +63 -146
  122. package/dist/client/hooks/typed-hooks.mjs +241 -701
  123. package/dist/client/hooks/use-action.mjs +62 -198
  124. package/dist/client/hooks/use-admin-config.mjs +5 -35
  125. package/dist/client/hooks/use-admin-preferences.mjs +16 -88
  126. package/dist/client/hooks/use-admin-routes.mjs +22 -56
  127. package/dist/client/hooks/use-audit-history.mjs +21 -69
  128. package/dist/client/hooks/use-brand.mjs +1 -9
  129. package/dist/client/hooks/use-collection-fields.mjs +17 -57
  130. package/dist/client/hooks/use-collection-meta.mjs +12 -44
  131. package/dist/client/hooks/use-collection-schema.mjs +10 -33
  132. package/dist/client/hooks/use-collection-validation.mjs +23 -53
  133. package/dist/client/hooks/use-collection.mjs +194 -614
  134. package/dist/client/hooks/use-current-user.mjs +0 -1
  135. package/dist/client/hooks/use-field-hooks.mjs +10 -10
  136. package/dist/client/hooks/use-field-options.mjs +61 -202
  137. package/dist/client/hooks/use-global-fields.mjs +14 -46
  138. package/dist/client/hooks/use-global-meta.mjs +9 -30
  139. package/dist/client/hooks/use-global-schema.mjs +9 -30
  140. package/dist/client/hooks/use-global.mjs +63 -219
  141. package/dist/client/hooks/use-locks.mjs +117 -325
  142. package/dist/client/hooks/use-media-query.mjs +16 -36
  143. package/dist/client/hooks/use-prefill-params.mjs +0 -1
  144. package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
  145. package/dist/client/hooks/use-reactive-fields.mjs +1 -1
  146. package/dist/client/hooks/use-reactive-prop.mjs +65 -223
  147. package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
  148. package/dist/client/hooks/use-saved-views.mjs +22 -103
  149. package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
  150. package/dist/client/hooks/use-search.mjs +31 -143
  151. package/dist/client/hooks/use-server-actions.mjs +18 -50
  152. package/dist/client/hooks/use-server-validation.mjs +72 -166
  153. package/dist/client/hooks/use-server-widget-data.mjs +7 -33
  154. package/dist/client/hooks/use-setup-status.mjs +12 -25
  155. package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
  156. package/dist/client/hooks/use-transition-stage.mjs +8 -38
  157. package/dist/client/hooks/use-upload.mjs +54 -152
  158. package/dist/client/hooks/use-validation-error-map.mjs +6 -26
  159. package/dist/client/hooks/use-view-state.mjs +187 -437
  160. package/dist/client/i18n/hooks.mjs +65 -197
  161. package/dist/client/lib/render-profiler.mjs +14 -41
  162. package/dist/client/preview/block-scope-context.d.mts +2 -2
  163. package/dist/client/preview/block-scope-context.mjs +14 -36
  164. package/dist/client/preview/preview-banner.d.mts +2 -2
  165. package/dist/client/preview/preview-banner.mjs +42 -108
  166. package/dist/client/preview/preview-field.d.mts +4 -4
  167. package/dist/client/preview/preview-field.mjs +167 -348
  168. package/dist/client/preview/use-collection-preview.mjs +121 -215
  169. package/dist/client/runtime/content-locales-provider.mjs +31 -83
  170. package/dist/client/runtime/locale-scope.mjs +22 -63
  171. package/dist/client/runtime/provider.mjs +100 -255
  172. package/dist/client/runtime/translations-provider.mjs +41 -107
  173. package/dist/client/scope/picker.d.mts +2 -2
  174. package/dist/client/scope/picker.mjs +86 -321
  175. package/dist/client/scope/provider.d.mts +2 -2
  176. package/dist/client/scope/provider.mjs +8 -17
  177. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  178. package/dist/client/views/auth/accept-invite-form.mjs +121 -412
  179. package/dist/client/views/auth/auth-layout.d.mts +3 -3
  180. package/dist/client/views/auth/auth-layout.mjs +104 -284
  181. package/dist/client/views/auth/forgot-password-form.mjs +94 -325
  182. package/dist/client/views/auth/invite-form.mjs +107 -442
  183. package/dist/client/views/auth/login-form.d.mts +2 -2
  184. package/dist/client/views/auth/login-form.mjs +116 -337
  185. package/dist/client/views/auth/reset-password-form.d.mts +2 -2
  186. package/dist/client/views/auth/reset-password-form.mjs +128 -453
  187. package/dist/client/views/auth/setup-form.d.mts +2 -2
  188. package/dist/client/views/auth/setup-form.mjs +140 -478
  189. package/dist/client/views/collection/auto-form-fields.mjs +243 -615
  190. package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -379
  191. package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
  192. package/dist/client/views/collection/cells/primitive-cells.mjs +109 -363
  193. package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
  194. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
  195. package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
  196. package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
  197. package/dist/client/views/collection/columns/build-columns.mjs +8 -48
  198. package/dist/client/views/collection/field-renderer.mjs +58 -182
  199. package/dist/client/views/collection/form-view.mjs +284 -518
  200. package/dist/client/views/collection/table-view.mjs +231 -463
  201. package/dist/client/views/collection/view-skeletons.mjs +112 -237
  202. package/dist/client/views/common/global-search.mjs +241 -560
  203. package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
  204. package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
  205. package/dist/client/views/dashboard/widget-card.mjs +61 -269
  206. package/dist/client/views/globals/global-form-view.mjs +477 -1301
  207. package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
  208. package/dist/client/views/layout/admin-layout.mjs +83 -246
  209. package/dist/client/views/layout/admin-router.mjs +458 -1274
  210. package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
  211. package/dist/client/views/layout/admin-theme.mjs +30 -64
  212. package/dist/client/views/layout/admin-view-layout.mjs +40 -144
  213. package/dist/client/views/pages/accept-invite-page.d.mts +2 -2
  214. package/dist/client/views/pages/accept-invite-page.mjs +95 -290
  215. package/dist/client/views/pages/dashboard-page.d.mts +2 -2
  216. package/dist/client/views/pages/dashboard-page.mjs +11 -57
  217. package/dist/client/views/pages/forgot-password-page.d.mts +2 -2
  218. package/dist/client/views/pages/forgot-password-page.mjs +31 -83
  219. package/dist/client/views/pages/invite-page.d.mts +2 -2
  220. package/dist/client/views/pages/invite-page.mjs +35 -90
  221. package/dist/client/views/pages/login-page.mjs +41 -121
  222. package/dist/client/views/pages/reset-password-page.mjs +46 -173
  223. package/dist/client/views/pages/setup-page.mjs +33 -95
  224. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  225. package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
  226. package/dist/server/modules/admin/collections/account.d.mts +46 -46
  227. package/dist/server/modules/admin/collections/admin-locks.d.mts +50 -50
  228. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  229. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  230. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  231. package/dist/server/modules/admin/collections/assets.d.mts +39 -39
  232. package/dist/server/modules/admin/collections/session.d.mts +41 -41
  233. package/dist/server/modules/admin/collections/user.d.mts +63 -63
  234. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  235. package/dist/server/modules/admin/index.d.mts +20 -19
  236. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  237. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  238. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  239. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  240. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  241. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  242. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  243. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  244. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +45 -45
  245. package/dist/server/modules/audit/.generated/module.d.mts +6 -6
  246. package/dist/server/modules/audit/collections/audit-log.d.mts +78 -78
  247. package/dist/server/modules/audit/jobs/audit-cleanup.d.mts +2 -2
  248. package/package.json +3 -5
@@ -13,7 +13,6 @@ import { getGlobalMetaQueryOptions } from "../../hooks/use-global-meta.mjs";
13
13
  import { AdminViewHeader } from "./admin-view-layout.mjs";
14
14
  import { FormViewSkeleton, TableViewSkeleton } from "../collection/view-skeletons.mjs";
15
15
  import { DashboardGrid } from "../dashboard/dashboard-grid.mjs";
16
- import { c } from "react/compiler-runtime";
17
16
  import { Icon } from "@iconify/react";
18
17
  import * as React from "react";
19
18
  import { useQueryClient } from "@tanstack/react-query";
@@ -49,92 +48,36 @@ const componentLoaderCache = /* @__PURE__ */ new WeakMap();
49
48
  * Suspends until server config is loaded - no loading checks needed.
50
49
  */
51
50
  function useRouterConfig(props) {
52
- const $ = c(20);
53
- const admin = useAdminStore(_temp);
51
+ const admin = useAdminStore((s) => s.admin);
54
52
  const { data: serverConfig } = useSuspenseAdminConfig();
55
- let t0;
56
- if ($[0] !== admin) {
57
- t0 = admin.getPages();
58
- $[0] = admin;
59
- $[1] = t0;
60
- } else t0 = $[1];
61
- const storePages = t0;
62
- let t1;
63
- if ($[2] !== admin) {
64
- t1 = admin.getViews();
65
- $[2] = admin;
66
- $[3] = t1;
67
- } else t1 = $[3];
68
- const storeViews = t1;
53
+ const storePages = admin.getPages();
54
+ const storeViews = admin.getViews();
69
55
  let serverCollections;
70
56
  if (props.collections) serverCollections = props.collections;
71
- else if ($[4] !== serverConfig) {
57
+ else {
72
58
  serverCollections = {};
73
- if (serverConfig?.collections) {
74
- let t2$1;
75
- if ($[6] !== serverConfig.collections) {
76
- t2$1 = Object.entries(serverConfig.collections);
77
- $[6] = serverConfig.collections;
78
- $[7] = t2$1;
79
- } else t2$1 = $[7];
80
- for (const [name, meta] of t2$1) serverCollections[name] = meta ?? {};
81
- }
82
- $[4] = serverConfig;
83
- $[5] = serverCollections;
84
- } else serverCollections = $[5];
59
+ if (serverConfig?.collections) for (const [name, meta] of Object.entries(serverConfig.collections)) serverCollections[name] = meta ?? {};
60
+ }
85
61
  let serverGlobals;
86
62
  if (props.globals) serverGlobals = props.globals;
87
- else if ($[8] !== serverConfig) {
63
+ else {
88
64
  serverGlobals = {};
89
- if (serverConfig?.globals) {
90
- let t2$1;
91
- if ($[10] !== serverConfig.globals) {
92
- t2$1 = Object.entries(serverConfig.globals);
93
- $[10] = serverConfig.globals;
94
- $[11] = t2$1;
95
- } else t2$1 = $[11];
96
- for (const [name_0, meta_0] of t2$1) serverGlobals[name_0] = meta_0 ?? {};
97
- }
98
- $[8] = serverConfig;
99
- $[9] = serverGlobals;
100
- } else serverGlobals = $[9];
101
- serverConfig?.dashboard;
102
- let t2;
103
- bb0: {
104
- const serverDashboard = serverConfig?.dashboard;
105
- if (serverDashboard?.items?.length) {
106
- t2 = serverDashboard;
107
- break bb0;
108
- }
109
- t2 = props.dashboardConfig;
65
+ if (serverConfig?.globals) for (const [name, meta] of Object.entries(serverConfig.globals)) serverGlobals[name] = meta ?? {};
110
66
  }
111
- const mergedDashboard = t2;
112
- const t3 = props.pages ?? storePages;
113
- const t4 = serverConfig?.branding?.name;
114
- let t5;
115
- if ($[12] !== mergedDashboard || $[13] !== props.DashboardComponent || $[14] !== serverCollections || $[15] !== serverGlobals || $[16] !== storeViews || $[17] !== t3 || $[18] !== t4) {
116
- t5 = {
117
- collections: serverCollections,
118
- globals: serverGlobals,
119
- pages: t3,
120
- views: storeViews,
121
- brandingName: t4,
122
- dashboardConfig: mergedDashboard,
123
- DashboardComponent: props.DashboardComponent
124
- };
125
- $[12] = mergedDashboard;
126
- $[13] = props.DashboardComponent;
127
- $[14] = serverCollections;
128
- $[15] = serverGlobals;
129
- $[16] = storeViews;
130
- $[17] = t3;
131
- $[18] = t4;
132
- $[19] = t5;
133
- } else t5 = $[19];
134
- return t5;
135
- }
136
- function _temp(s) {
137
- return s.admin;
67
+ const mergedDashboard = React.useMemo(() => {
68
+ const serverDashboard = serverConfig?.dashboard;
69
+ if (serverDashboard?.items?.length) return serverDashboard;
70
+ return props.dashboardConfig;
71
+ }, [props.dashboardConfig, serverConfig?.dashboard]);
72
+ return {
73
+ collections: serverCollections,
74
+ globals: serverGlobals,
75
+ pages: props.pages ?? storePages,
76
+ views: storeViews,
77
+ brandingName: serverConfig?.branding?.name,
78
+ dashboardConfig: mergedDashboard,
79
+ DashboardComponent: props.DashboardComponent
80
+ };
138
81
  }
139
82
  function matchRoute(segments, _collections = {}, globals = {}, pages = {}) {
140
83
  if (segments.length === 0) return { type: "dashboard" };
@@ -234,170 +177,94 @@ function cacheComponent(loader, Component) {
234
177
  if (!isDynamicImportLoader(loader)) return;
235
178
  componentLoaderCache.set(loader, Component);
236
179
  }
237
- function ViewLoadingState(t0) {
238
- const $ = c(2);
239
- const { viewKind } = t0;
240
- let t1;
241
- if ($[0] !== viewKind) {
242
- t1 = viewKind === "list" ? /* @__PURE__ */ jsx(TableViewSkeleton, {}) : /* @__PURE__ */ jsx(FormViewSkeleton, {});
243
- $[0] = viewKind;
244
- $[1] = t1;
245
- } else t1 = $[1];
246
- return t1;
180
+ function ViewLoadingState({ viewKind }) {
181
+ return viewKind === "list" ? /* @__PURE__ */ jsx(TableViewSkeleton, {}) : /* @__PURE__ */ jsx(FormViewSkeleton, {});
247
182
  }
248
- function UnknownViewState(t0) {
249
- const $ = c(13);
250
- const { viewKind, viewId } = t0;
183
+ function UnknownViewState({ viewKind, viewId }) {
251
184
  const { t } = useTranslation();
252
- let t1;
253
- if ($[0] !== t || $[1] !== viewKind) {
254
- t1 = t("error.failedToLoadView", { viewType: viewKind });
255
- $[0] = t;
256
- $[1] = viewKind;
257
- $[2] = t1;
258
- } else t1 = $[2];
259
- let t2;
260
- if ($[3] !== t1) {
261
- t2 = /* @__PURE__ */ jsx("h1", {
262
- className: "text-lg font-semibold",
263
- children: t1
264
- });
265
- $[3] = t1;
266
- $[4] = t2;
267
- } else t2 = $[4];
268
- let t3;
269
- if ($[5] !== t || $[6] !== viewId) {
270
- t3 = t("error.unregisteredViewDescription", { viewId });
271
- $[5] = t;
272
- $[6] = viewId;
273
- $[7] = t3;
274
- } else t3 = $[7];
275
- let t4;
276
- if ($[8] !== t3) {
277
- t4 = /* @__PURE__ */ jsx("p", {
278
- className: "text-muted-foreground mt-2 text-sm",
279
- children: t3
280
- });
281
- $[8] = t3;
282
- $[9] = t4;
283
- } else t4 = $[9];
284
- let t5;
285
- if ($[10] !== t2 || $[11] !== t4) {
286
- t5 = /* @__PURE__ */ jsx("div", {
287
- className: "container",
288
- children: /* @__PURE__ */ jsxs(Card, {
289
- className: "border-warning/30 bg-warning/5 p-6",
290
- children: [t2, t4]
291
- })
292
- });
293
- $[10] = t2;
294
- $[11] = t4;
295
- $[12] = t5;
296
- } else t5 = $[12];
297
- return t5;
185
+ return /* @__PURE__ */ jsx("div", {
186
+ className: "container",
187
+ children: /* @__PURE__ */ jsxs(Card, {
188
+ className: "border-warning/30 bg-warning/5 p-6",
189
+ children: [/* @__PURE__ */ jsx("h1", {
190
+ className: "text-lg font-semibold",
191
+ children: t("error.failedToLoadView", { viewType: viewKind })
192
+ }), /* @__PURE__ */ jsx("p", {
193
+ className: "text-muted-foreground mt-2 text-sm",
194
+ children: t("error.unregisteredViewDescription", { viewId })
195
+ })]
196
+ })
197
+ });
298
198
  }
299
199
  /**
300
200
  * Skeleton shown while router config is loading (Suspense fallback)
301
201
  */
302
202
  function RouterSkeleton() {
303
- const $ = c(3);
304
- let t0;
305
- let t1;
306
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
307
- t0 = /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-48" });
308
- t1 = /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" });
309
- $[0] = t0;
310
- $[1] = t1;
311
- } else {
312
- t0 = $[0];
313
- t1 = $[1];
314
- }
315
- let t2;
316
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
317
- t2 = /* @__PURE__ */ jsxs("div", {
318
- className: "qa-router-skeleton container space-y-4 py-6",
319
- children: [
320
- t0,
321
- t1,
322
- /* @__PURE__ */ jsxs("div", {
323
- className: "space-y-2",
324
- children: [
325
- /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
326
- /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
327
- /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" })
328
- ]
329
- })
330
- ]
331
- });
332
- $[2] = t2;
333
- } else t2 = $[2];
334
- return t2;
203
+ return /* @__PURE__ */ jsxs("div", {
204
+ className: "qa-router-skeleton container space-y-4 py-6",
205
+ children: [
206
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-48" }),
207
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" }),
208
+ /* @__PURE__ */ jsxs("div", {
209
+ className: "space-y-2",
210
+ children: [
211
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
212
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" }),
213
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-12 w-full" })
214
+ ]
215
+ })
216
+ ]
217
+ });
335
218
  }
336
219
  function AuthPageSkeleton() {
337
- const $ = c(3);
338
- let t0;
339
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
340
- t0 = /* @__PURE__ */ jsxs("aside", {
341
- className: "qa-auth-layout__brand flex flex-col items-center justify-center gap-8",
342
- children: [/* @__PURE__ */ jsxs("div", {
343
- className: "flex items-center gap-3",
344
- children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-9" }), /* @__PURE__ */ jsx(Skeleton, {
220
+ return /* @__PURE__ */ jsx("div", {
221
+ className: "qa-auth-layout bg-background text-foreground relative flex min-h-screen items-center justify-center overflow-hidden px-5 py-8 sm:px-8",
222
+ children: /* @__PURE__ */ jsxs("div", {
223
+ className: "qa-auth-layout__shell grid w-full max-w-4xl items-center gap-10 lg:grid-cols-[minmax(220px,280px)_minmax(360px,384px)] lg:gap-16",
224
+ children: [/* @__PURE__ */ jsxs("aside", {
225
+ className: "qa-auth-layout__brand flex flex-col items-center justify-center gap-8",
226
+ children: [/* @__PURE__ */ jsxs("div", {
227
+ className: "flex items-center gap-3",
228
+ children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-9" }), /* @__PURE__ */ jsx(Skeleton, {
229
+ variant: "text",
230
+ className: "h-4 w-36"
231
+ })]
232
+ }), /* @__PURE__ */ jsx(Skeleton, {
345
233
  variant: "text",
346
- className: "h-4 w-36"
234
+ className: "hidden h-3 w-40 lg:block"
347
235
  })]
348
- }), /* @__PURE__ */ jsx(Skeleton, {
349
- variant: "text",
350
- className: "hidden h-3 w-40 lg:block"
351
- })]
352
- });
353
- $[0] = t0;
354
- } else t0 = $[0];
355
- let t1;
356
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
357
- t1 = /* @__PURE__ */ jsxs("div", {
358
- className: "space-y-2",
359
- children: [/* @__PURE__ */ jsx(Skeleton, {
360
- variant: "text",
361
- className: "h-4 w-20"
362
- }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
363
- });
364
- $[1] = t1;
365
- } else t1 = $[1];
366
- let t2;
367
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
368
- t2 = /* @__PURE__ */ jsx("div", {
369
- className: "qa-auth-layout bg-background text-foreground relative flex min-h-screen items-center justify-center overflow-hidden px-5 py-8 sm:px-8",
370
- children: /* @__PURE__ */ jsxs("div", {
371
- className: "qa-auth-layout__shell grid w-full max-w-4xl items-center gap-10 lg:grid-cols-[minmax(220px,280px)_minmax(360px,384px)] lg:gap-16",
372
- children: [t0, /* @__PURE__ */ jsx("main", {
373
- className: "qa-auth-layout__form-panel flex items-center justify-center",
374
- children: /* @__PURE__ */ jsx(Card, {
375
- className: "border-border-subtle w-full max-w-sm shadow-none",
376
- children: /* @__PURE__ */ jsxs("div", {
377
- className: "space-y-5 p-4",
378
- children: [
379
- t1,
380
- /* @__PURE__ */ jsxs("div", {
381
- className: "space-y-2",
382
- children: [/* @__PURE__ */ jsx(Skeleton, {
383
- variant: "text",
384
- className: "h-4 w-24"
385
- }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
386
- }),
387
- /* @__PURE__ */ jsx(Skeleton, {
236
+ }), /* @__PURE__ */ jsx("main", {
237
+ className: "qa-auth-layout__form-panel flex items-center justify-center",
238
+ children: /* @__PURE__ */ jsx(Card, {
239
+ className: "border-border-subtle w-full max-w-sm shadow-none",
240
+ children: /* @__PURE__ */ jsxs("div", {
241
+ className: "space-y-5 p-4",
242
+ children: [
243
+ /* @__PURE__ */ jsxs("div", {
244
+ className: "space-y-2",
245
+ children: [/* @__PURE__ */ jsx(Skeleton, {
246
+ variant: "text",
247
+ className: "h-4 w-20"
248
+ }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
249
+ }),
250
+ /* @__PURE__ */ jsxs("div", {
251
+ className: "space-y-2",
252
+ children: [/* @__PURE__ */ jsx(Skeleton, {
388
253
  variant: "text",
389
- className: "h-4 w-28"
390
- }),
391
- /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })
392
- ]
393
- })
254
+ className: "h-4 w-24"
255
+ }), /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })]
256
+ }),
257
+ /* @__PURE__ */ jsx(Skeleton, {
258
+ variant: "text",
259
+ className: "h-4 w-28"
260
+ }),
261
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-full" })
262
+ ]
394
263
  })
395
- })]
396
- })
397
- });
398
- $[2] = t2;
399
- } else t2 = $[2];
400
- return t2;
264
+ })
265
+ })]
266
+ })
267
+ });
401
268
  }
402
269
  function getFallbackForSegments(segments) {
403
270
  const [first, second, third] = segments;
@@ -420,534 +287,223 @@ function areRegistryViewRendererPropsEqual(prev, next) {
420
287
  if (prev.viewId !== next.viewId) return false;
421
288
  return shallowEqualComponentProps(prev.componentProps, next.componentProps);
422
289
  }
423
- const RegistryViewRenderer = React.memo(function RegistryViewRenderer$1(t0) {
424
- const $ = c(23);
425
- const { loader, componentProps, viewKind, viewId } = t0;
426
- let t1;
427
- if ($[0] !== loader) {
428
- t1 = isDynamicImportLoader(loader);
429
- $[0] = loader;
430
- $[1] = t1;
431
- } else t1 = $[1];
432
- const loaderIsDynamic = t1;
290
+ const RegistryViewRenderer = React.memo(function RegistryViewRenderer$1({ loader, componentProps, viewKind, viewId }) {
291
+ const loaderIsDynamic = isDynamicImportLoader(loader);
433
292
  const directComponent = loader && !loaderIsDynamic ? loader : null;
434
- let t2;
435
- if ($[2] !== loader || $[3] !== loaderIsDynamic) {
436
- t2 = loaderIsDynamic ? getCachedComponent(loader) ?? null : null;
437
- $[2] = loader;
438
- $[3] = loaderIsDynamic;
439
- $[4] = t2;
440
- } else t2 = $[4];
441
- const cachedComponent = t2;
293
+ const cachedComponent = React.useMemo(() => loaderIsDynamic ? getCachedComponent(loader) ?? null : null, [loader, loaderIsDynamic]);
442
294
  const needsAsyncLoad = loaderIsDynamic && !cachedComponent;
443
- let t3;
444
- if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
445
- t3 = {
446
- loader: null,
447
- Component: null,
448
- error: null
449
- };
450
- $[5] = t3;
451
- } else t3 = $[5];
452
- const [asyncState, setAsyncState] = React.useState(t3);
453
- let t4;
454
- let t5;
455
- if ($[6] !== loader || $[7] !== needsAsyncLoad) {
456
- t4 = () => {
457
- if (!needsAsyncLoad || !isDynamicImportLoader(loader)) return;
458
- let mounted = true;
459
- (async () => {
460
- try {
461
- const result = await loader();
462
- if (!mounted) return;
463
- let Component;
464
- if (result.default) Component = result.default;
465
- else Component = result;
466
- cacheComponent(loader, Component);
467
- setAsyncState({
468
- loader,
469
- Component,
470
- error: null
471
- });
472
- } catch (t6$1) {
473
- const error = t6$1;
474
- if (!mounted) return;
475
- let resolvedError;
476
- if (error instanceof Error) resolvedError = error;
477
- else resolvedError = /* @__PURE__ */ new Error("Failed to load view component");
478
- setAsyncState({
479
- loader,
480
- Component: null,
481
- error: resolvedError
482
- });
483
- }
484
- })();
485
- return () => {
486
- mounted = false;
487
- };
295
+ const [asyncState, setAsyncState] = React.useState({
296
+ loader: null,
297
+ Component: null,
298
+ error: null
299
+ });
300
+ React.useEffect(() => {
301
+ if (!needsAsyncLoad || !isDynamicImportLoader(loader)) return;
302
+ let mounted = true;
303
+ (async () => {
304
+ try {
305
+ const result = await loader();
306
+ if (!mounted) return;
307
+ let Component$1;
308
+ if (result.default) Component$1 = result.default;
309
+ else Component$1 = result;
310
+ cacheComponent(loader, Component$1);
311
+ setAsyncState({
312
+ loader,
313
+ Component: Component$1,
314
+ error: null
315
+ });
316
+ } catch (error$1) {
317
+ if (!mounted) return;
318
+ let resolvedError;
319
+ if (error$1 instanceof Error) resolvedError = error$1;
320
+ else resolvedError = /* @__PURE__ */ new Error("Failed to load view component");
321
+ setAsyncState({
322
+ loader,
323
+ Component: null,
324
+ error: resolvedError
325
+ });
326
+ }
327
+ })();
328
+ return () => {
329
+ mounted = false;
488
330
  };
489
- t5 = [loader, needsAsyncLoad];
490
- $[6] = loader;
491
- $[7] = needsAsyncLoad;
492
- $[8] = t4;
493
- $[9] = t5;
494
- } else {
495
- t4 = $[8];
496
- t5 = $[9];
497
- }
498
- React.useEffect(t4, t5);
331
+ }, [loader, needsAsyncLoad]);
499
332
  const asyncMatches = asyncState.loader === loader;
500
- const Component_0 = directComponent ?? cachedComponent ?? (asyncMatches ? asyncState.Component : null);
501
- const error_0 = asyncMatches ? asyncState.error : null;
502
- if (needsAsyncLoad && !Component_0 && !error_0) {
503
- let t6$1;
504
- if ($[10] !== viewKind) {
505
- t6$1 = /* @__PURE__ */ jsx(ViewLoadingState, { viewKind });
506
- $[10] = viewKind;
507
- $[11] = t6$1;
508
- } else t6$1 = $[11];
509
- return t6$1;
510
- }
511
- if (error_0 || !Component_0) {
512
- let t6$1;
513
- if ($[12] !== viewId || $[13] !== viewKind) {
514
- t6$1 = /* @__PURE__ */ jsx(UnknownViewState, {
515
- viewKind,
516
- viewId
517
- });
518
- $[12] = viewId;
519
- $[13] = viewKind;
520
- $[14] = t6$1;
521
- } else t6$1 = $[14];
522
- return t6$1;
523
- }
524
- let t6;
525
- if ($[15] !== viewKind) {
526
- t6 = /* @__PURE__ */ jsx(ViewLoadingState, { viewKind });
527
- $[15] = viewKind;
528
- $[16] = t6;
529
- } else t6 = $[16];
530
- let t7;
531
- if ($[17] !== Component_0 || $[18] !== componentProps) {
532
- t7 = /* @__PURE__ */ jsx(Component_0, { ...componentProps });
533
- $[17] = Component_0;
534
- $[18] = componentProps;
535
- $[19] = t7;
536
- } else t7 = $[19];
537
- let t8;
538
- if ($[20] !== t6 || $[21] !== t7) {
539
- t8 = /* @__PURE__ */ jsx(React.Suspense, {
540
- fallback: t6,
541
- children: t7
542
- });
543
- $[20] = t6;
544
- $[21] = t7;
545
- $[22] = t8;
546
- } else t8 = $[22];
547
- return t8;
333
+ const Component = directComponent ?? cachedComponent ?? (asyncMatches ? asyncState.Component : null);
334
+ const error = asyncMatches ? asyncState.error : null;
335
+ if (needsAsyncLoad && !Component && !error) return /* @__PURE__ */ jsx(ViewLoadingState, { viewKind });
336
+ if (error || !Component) return /* @__PURE__ */ jsx(UnknownViewState, {
337
+ viewKind,
338
+ viewId
339
+ });
340
+ return /* @__PURE__ */ jsx(React.Suspense, {
341
+ fallback: /* @__PURE__ */ jsx(ViewLoadingState, { viewKind }),
342
+ children: /* @__PURE__ */ jsx(Component, { ...componentProps })
343
+ });
548
344
  }, areRegistryViewRendererPropsEqual);
549
345
  function DefaultDashboard() {
550
- const $ = c(27);
551
346
  const { t, formatDate } = useTranslation();
552
- let t0;
553
- if ($[0] !== formatDate) {
554
- t0 = formatDate(/* @__PURE__ */ new Date(), {
555
- weekday: "long",
556
- year: "numeric",
557
- month: "long",
558
- day: "numeric"
559
- });
560
- $[0] = formatDate;
561
- $[1] = t0;
562
- } else t0 = $[1];
563
- const date = t0;
564
- let t1;
565
- if ($[2] !== t) {
566
- t1 = t("dashboard.title");
567
- $[2] = t;
568
- $[3] = t1;
569
- } else t1 = $[3];
570
- let t2;
571
- if ($[4] !== date || $[5] !== t1) {
572
- t2 = /* @__PURE__ */ jsx(AdminViewHeader, {
347
+ const date = formatDate(/* @__PURE__ */ new Date(), {
348
+ weekday: "long",
349
+ year: "numeric",
350
+ month: "long",
351
+ day: "numeric"
352
+ });
353
+ return /* @__PURE__ */ jsxs("div", {
354
+ className: "qa-default-dashboard container",
355
+ children: [/* @__PURE__ */ jsx(AdminViewHeader, {
573
356
  className: "mb-4",
574
- title: t1,
357
+ title: t("dashboard.title"),
575
358
  meta: date
576
- });
577
- $[4] = date;
578
- $[5] = t1;
579
- $[6] = t2;
580
- } else t2 = $[6];
581
- let t3;
582
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
583
- t3 = /* @__PURE__ */ jsx("div", { className: "bg-primary h-2 w-2 rounded-full" });
584
- $[7] = t3;
585
- } else t3 = $[7];
586
- let t4;
587
- if ($[8] !== t) {
588
- t4 = t("dashboard.systemStatus");
589
- $[8] = t;
590
- $[9] = t4;
591
- } else t4 = $[9];
592
- let t5;
593
- if ($[10] !== t4) {
594
- t5 = /* @__PURE__ */ jsxs("div", {
595
- className: "mb-4 flex items-center gap-3",
596
- children: [t3, /* @__PURE__ */ jsx("h3", {
597
- className: "text-muted-foreground font-chrome chrome-meta text-xs font-medium",
598
- children: t4
599
- })]
600
- });
601
- $[10] = t4;
602
- $[11] = t5;
603
- } else t5 = $[11];
604
- let t6;
605
- if ($[12] !== t) {
606
- t6 = t("dashboard.welcome");
607
- $[12] = t;
608
- $[13] = t6;
609
- } else t6 = $[13];
610
- let t7;
611
- if ($[14] !== t6) {
612
- t7 = /* @__PURE__ */ jsx("h2", {
613
- className: "mb-2 text-xl font-semibold",
614
- children: t6
615
- });
616
- $[14] = t6;
617
- $[15] = t7;
618
- } else t7 = $[15];
619
- let t8;
620
- if ($[16] !== t) {
621
- t8 = t("dashboard.welcomeDescription");
622
- $[16] = t;
623
- $[17] = t8;
624
- } else t8 = $[17];
625
- let t9;
626
- if ($[18] !== t8) {
627
- t9 = /* @__PURE__ */ jsx("p", {
628
- className: "text-muted-foreground text-sm leading-relaxed",
629
- children: t8
630
- });
631
- $[18] = t8;
632
- $[19] = t9;
633
- } else t9 = $[19];
634
- let t10;
635
- if ($[20] !== t5 || $[21] !== t7 || $[22] !== t9) {
636
- t10 = /* @__PURE__ */ jsx("div", {
359
+ }), /* @__PURE__ */ jsx("div", {
637
360
  className: "grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3",
638
361
  children: /* @__PURE__ */ jsx(Card, {
639
362
  className: "p-6",
640
363
  children: /* @__PURE__ */ jsxs("div", { children: [
641
- t5,
642
- t7,
643
- t9
364
+ /* @__PURE__ */ jsxs("div", {
365
+ className: "mb-4 flex items-center gap-3",
366
+ children: [/* @__PURE__ */ jsx("div", { className: "bg-primary h-2 w-2 rounded-full" }), /* @__PURE__ */ jsx("h3", {
367
+ className: "text-muted-foreground font-chrome chrome-meta text-xs font-medium",
368
+ children: t("dashboard.systemStatus")
369
+ })]
370
+ }),
371
+ /* @__PURE__ */ jsx("h2", {
372
+ className: "mb-2 text-xl font-semibold",
373
+ children: t("dashboard.welcome")
374
+ }),
375
+ /* @__PURE__ */ jsx("p", {
376
+ className: "text-muted-foreground text-sm leading-relaxed",
377
+ children: t("dashboard.welcomeDescription")
378
+ })
644
379
  ] })
645
380
  })
646
- });
647
- $[20] = t5;
648
- $[21] = t7;
649
- $[22] = t9;
650
- $[23] = t10;
651
- } else t10 = $[23];
652
- let t11;
653
- if ($[24] !== t10 || $[25] !== t2) {
654
- t11 = /* @__PURE__ */ jsxs("div", {
655
- className: "qa-default-dashboard container",
656
- children: [t2, t10]
657
- });
658
- $[24] = t10;
659
- $[25] = t2;
660
- $[26] = t11;
661
- } else t11 = $[26];
662
- return t11;
381
+ })]
382
+ });
663
383
  }
664
384
  function DefaultNotFound() {
665
- const $ = c(11);
666
385
  const { t } = useTranslation();
667
- let t0;
668
- if ($[0] !== t) {
669
- t0 = t("error.pageNotFound");
670
- $[0] = t;
671
- $[1] = t0;
672
- } else t0 = $[1];
673
- let t1;
674
- if ($[2] !== t0) {
675
- t1 = /* @__PURE__ */ jsx("h1", {
386
+ return /* @__PURE__ */ jsxs("div", {
387
+ className: "qa-not-found container",
388
+ children: [/* @__PURE__ */ jsx("h1", {
676
389
  className: "mb-4 text-2xl font-bold",
677
- children: t0
678
- });
679
- $[2] = t0;
680
- $[3] = t1;
681
- } else t1 = $[3];
682
- let t2;
683
- if ($[4] !== t) {
684
- t2 = t("error.pageNotFoundDescription");
685
- $[4] = t;
686
- $[5] = t2;
687
- } else t2 = $[5];
688
- let t3;
689
- if ($[6] !== t2) {
690
- t3 = /* @__PURE__ */ jsx("p", {
390
+ children: t("error.pageNotFound")
391
+ }), /* @__PURE__ */ jsx("p", {
691
392
  className: "text-muted-foreground",
692
- children: t2
693
- });
694
- $[6] = t2;
695
- $[7] = t3;
696
- } else t3 = $[7];
697
- let t4;
698
- if ($[8] !== t1 || $[9] !== t3) {
699
- t4 = /* @__PURE__ */ jsxs("div", {
700
- className: "qa-not-found container",
701
- children: [t1, t3]
702
- });
703
- $[8] = t1;
704
- $[9] = t3;
705
- $[10] = t4;
706
- } else t4 = $[10];
707
- return t4;
393
+ children: t("error.pageNotFoundDescription")
394
+ })]
395
+ });
708
396
  }
709
- function RestrictedAccess(t0) {
710
- const $ = c(24);
711
- const { type, name, navigate, basePath } = t0;
397
+ function RestrictedAccess({ type, name, navigate, basePath }) {
712
398
  const { t } = useTranslation();
713
- let t1;
714
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
715
- t1 = /* @__PURE__ */ jsx("div", {
716
- className: "bg-muted mx-auto mb-6 flex h-16 w-16 items-center justify-center rounded-full",
717
- children: /* @__PURE__ */ jsx(Icon, {
718
- icon: "ph:lock-simple",
719
- className: "text-muted-foreground h-8 w-8"
720
- })
721
- });
722
- $[0] = t1;
723
- } else t1 = $[0];
724
- let t2;
725
- if ($[1] !== t) {
726
- t2 = t("error.accessRestricted");
727
- $[1] = t;
728
- $[2] = t2;
729
- } else t2 = $[2];
730
- let t3;
731
- if ($[3] !== t2) {
732
- t3 = /* @__PURE__ */ jsx("h1", {
733
- className: "mb-2 text-xl font-semibold",
734
- children: t2
735
- });
736
- $[3] = t2;
737
- $[4] = t3;
738
- } else t3 = $[4];
739
- let t4;
740
- if ($[5] !== name || $[6] !== t || $[7] !== type) {
741
- t4 = t("error.accessRestrictedResourceDescription", {
742
- type,
743
- name
744
- });
745
- $[5] = name;
746
- $[6] = t;
747
- $[7] = type;
748
- $[8] = t4;
749
- } else t4 = $[8];
750
- let t5;
751
- if ($[9] !== t4) {
752
- t5 = /* @__PURE__ */ jsx("p", {
753
- className: "text-muted-foreground mb-6 text-sm",
754
- children: t4
755
- });
756
- $[9] = t4;
757
- $[10] = t5;
758
- } else t5 = $[10];
759
- let t6;
760
- if ($[11] !== basePath || $[12] !== navigate) {
761
- t6 = () => navigate(basePath);
762
- $[11] = basePath;
763
- $[12] = navigate;
764
- $[13] = t6;
765
- } else t6 = $[13];
766
- let t7;
767
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
768
- t7 = /* @__PURE__ */ jsx(Icon, {
769
- icon: "ph:arrow-left",
770
- className: "h-4 w-4"
771
- });
772
- $[14] = t7;
773
- } else t7 = $[14];
774
- let t8;
775
- if ($[15] !== t) {
776
- t8 = t("error.backToDashboard");
777
- $[15] = t;
778
- $[16] = t8;
779
- } else t8 = $[16];
780
- let t9;
781
- if ($[17] !== t6 || $[18] !== t8) {
782
- t9 = /* @__PURE__ */ jsxs(Button, {
783
- variant: "outline",
784
- onClick: t6,
785
- children: [t7, t8]
786
- });
787
- $[17] = t6;
788
- $[18] = t8;
789
- $[19] = t9;
790
- } else t9 = $[19];
791
- let t10;
792
- if ($[20] !== t3 || $[21] !== t5 || $[22] !== t9) {
793
- t10 = /* @__PURE__ */ jsx("div", {
794
- className: "qa-restricted-access container py-12",
795
- children: /* @__PURE__ */ jsx(Card, {
796
- className: "mx-auto max-w-lg p-8 text-center",
797
- children: /* @__PURE__ */ jsxs("div", { children: [
798
- t1,
799
- t3,
800
- t5,
801
- t9
802
- ] })
803
- })
804
- });
805
- $[20] = t3;
806
- $[21] = t5;
807
- $[22] = t9;
808
- $[23] = t10;
809
- } else t10 = $[23];
810
- return t10;
399
+ return /* @__PURE__ */ jsx("div", {
400
+ className: "qa-restricted-access container py-12",
401
+ children: /* @__PURE__ */ jsx(Card, {
402
+ className: "mx-auto max-w-lg p-8 text-center",
403
+ children: /* @__PURE__ */ jsxs("div", { children: [
404
+ /* @__PURE__ */ jsx("div", {
405
+ className: "bg-muted mx-auto mb-6 flex h-16 w-16 items-center justify-center rounded-full",
406
+ children: /* @__PURE__ */ jsx(Icon, {
407
+ icon: "ph:lock-simple",
408
+ className: "text-muted-foreground h-8 w-8"
409
+ })
410
+ }),
411
+ /* @__PURE__ */ jsx("h1", {
412
+ className: "mb-2 text-xl font-semibold",
413
+ children: t("error.accessRestricted")
414
+ }),
415
+ /* @__PURE__ */ jsx("p", {
416
+ className: "text-muted-foreground mb-6 text-sm",
417
+ children: t("error.accessRestrictedResourceDescription", {
418
+ type,
419
+ name
420
+ })
421
+ }),
422
+ /* @__PURE__ */ jsxs(Button, {
423
+ variant: "outline",
424
+ onClick: () => navigate(basePath),
425
+ children: [/* @__PURE__ */ jsx(Icon, {
426
+ icon: "ph:arrow-left",
427
+ className: "h-4 w-4"
428
+ }), t("error.backToDashboard")]
429
+ })
430
+ ] })
431
+ })
432
+ });
811
433
  }
812
- function LazyPageRenderer(t0) {
813
- const $ = c(21);
814
- const { config } = t0;
434
+ function LazyPageRenderer({ config }) {
815
435
  const { t } = useTranslation();
816
436
  const component = config.component;
817
- let t1;
818
- if ($[0] !== component) {
819
- t1 = () => getCachedComponent(component) ?? null;
820
- $[0] = component;
821
- $[1] = t1;
822
- } else t1 = $[1];
823
- const [Component, setComponent] = React.useState(t1);
824
- let t2;
825
- if ($[2] !== Component) {
826
- t2 = () => Component == null;
827
- $[2] = Component;
828
- $[3] = t2;
829
- } else t2 = $[3];
830
- const [loading, setLoading] = React.useState(t2);
437
+ const [Component, setComponent] = React.useState(() => getCachedComponent(component) ?? null);
438
+ const [loading, setLoading] = React.useState(() => Component == null);
831
439
  const [error, setError] = React.useState(null);
832
- let t3;
833
- let t4;
834
- if ($[4] !== component || $[5] !== t) {
835
- t3 = () => {
836
- let mounted = true;
837
- (async function load() {
838
- try {
839
- const cachedComponent = getCachedComponent(component);
840
- if (cachedComponent) {
841
- if (mounted) {
842
- setComponent(() => cachedComponent);
843
- setLoading(false);
844
- setError(null);
845
- }
846
- return;
847
- }
440
+ React.useEffect(() => {
441
+ let mounted = true;
442
+ async function load() {
443
+ try {
444
+ const cachedComponent = getCachedComponent(component);
445
+ if (cachedComponent) {
848
446
  if (mounted) {
849
- setLoading(true);
447
+ setComponent(() => cachedComponent);
448
+ setLoading(false);
850
449
  setError(null);
851
450
  }
852
- if (typeof component === "function") {
853
- const result = component();
854
- let isThenable = false;
855
- if (result != null) {
856
- if (typeof result.then === "function") isThenable = true;
857
- }
858
- if (isThenable) {
859
- const mod = await result;
860
- if (mounted) {
861
- let resolved;
862
- if (mod.default) resolved = mod.default;
863
- else resolved = mod;
864
- cacheComponent(component, resolved);
865
- setComponent(() => resolved);
866
- }
867
- } else if (mounted) setComponent(() => component);
868
- } else if (component) {
869
- if (mounted) setComponent(() => component);
870
- }
871
- if (mounted) setLoading(false);
872
- } catch (t5$1) {
873
- const err = t5$1;
874
- if (mounted) {
875
- let resolvedError;
876
- if (err instanceof Error) resolvedError = err;
877
- else resolvedError = new Error(t("error.failedToLoad"));
878
- setError(resolvedError);
451
+ return;
452
+ }
453
+ if (mounted) {
454
+ setLoading(true);
455
+ setError(null);
456
+ }
457
+ if (typeof component === "function") {
458
+ const result = component();
459
+ let isThenable = false;
460
+ if (result != null) {
461
+ if (typeof result.then === "function") isThenable = true;
879
462
  }
880
- if (mounted) setLoading(false);
463
+ if (isThenable) {
464
+ const mod = await result;
465
+ if (mounted) {
466
+ let resolved;
467
+ if (mod.default) resolved = mod.default;
468
+ else resolved = mod;
469
+ cacheComponent(component, resolved);
470
+ setComponent(() => resolved);
471
+ }
472
+ } else if (mounted) setComponent(() => component);
473
+ } else if (component) {
474
+ if (mounted) setComponent(() => component);
881
475
  }
882
- })();
883
- return () => {
884
- mounted = false;
885
- };
476
+ if (mounted) setLoading(false);
477
+ } catch (err) {
478
+ if (mounted) {
479
+ let resolvedError;
480
+ if (err instanceof Error) resolvedError = err;
481
+ else resolvedError = new Error(t("error.failedToLoad"));
482
+ setError(resolvedError);
483
+ }
484
+ if (mounted) setLoading(false);
485
+ }
486
+ }
487
+ load();
488
+ return () => {
489
+ mounted = false;
886
490
  };
887
- t4 = [component, t];
888
- $[4] = component;
889
- $[5] = t;
890
- $[6] = t3;
891
- $[7] = t4;
892
- } else {
893
- t3 = $[6];
894
- t4 = $[7];
895
- }
896
- React.useEffect(t3, t4);
491
+ }, [component, t]);
897
492
  if (loading) {
898
- let t5$1;
899
- if ($[8] !== config.path) {
900
- const path = config.path?.replace(/^\//, "") ?? "";
901
- t5$1 = AUTH_ROUTE_SEGMENTS.has(path) ? /* @__PURE__ */ jsx(AuthPageSkeleton, {}) : /* @__PURE__ */ jsx(RouterSkeleton, {});
902
- $[8] = config.path;
903
- $[9] = t5$1;
904
- } else t5$1 = $[9];
905
- return t5$1;
906
- }
907
- if (error) {
908
- let t5$1;
909
- if ($[10] !== t) {
910
- t5$1 = t("error.unexpectedError");
911
- $[10] = t;
912
- $[11] = t5$1;
913
- } else t5$1 = $[11];
914
- let t6;
915
- if ($[12] !== t5$1) {
916
- t6 = /* @__PURE__ */ jsx("h1", {
917
- className: "text-destructive mb-4 text-2xl font-bold",
918
- children: t5$1
919
- });
920
- $[12] = t5$1;
921
- $[13] = t6;
922
- } else t6 = $[13];
923
- let t7;
924
- if ($[14] !== error.message) {
925
- t7 = /* @__PURE__ */ jsx("p", {
926
- className: "text-muted-foreground",
927
- children: error.message
928
- });
929
- $[14] = error.message;
930
- $[15] = t7;
931
- } else t7 = $[15];
932
- let t8;
933
- if ($[16] !== t6 || $[17] !== t7) {
934
- t8 = /* @__PURE__ */ jsxs("div", {
935
- className: "container",
936
- children: [t6, t7]
937
- });
938
- $[16] = t6;
939
- $[17] = t7;
940
- $[18] = t8;
941
- } else t8 = $[18];
942
- return t8;
493
+ const path = config.path?.replace(/^\//, "") ?? "";
494
+ return AUTH_ROUTE_SEGMENTS.has(path) ? /* @__PURE__ */ jsx(AuthPageSkeleton, {}) : /* @__PURE__ */ jsx(RouterSkeleton, {});
943
495
  }
944
- let t5;
945
- if ($[19] !== Component) {
946
- t5 = Component ? /* @__PURE__ */ jsx(Component, {}) : /* @__PURE__ */ jsx(DefaultNotFound, {});
947
- $[19] = Component;
948
- $[20] = t5;
949
- } else t5 = $[20];
950
- return t5;
496
+ if (error) return /* @__PURE__ */ jsxs("div", {
497
+ className: "container",
498
+ children: [/* @__PURE__ */ jsx("h1", {
499
+ className: "text-destructive mb-4 text-2xl font-bold",
500
+ children: t("error.unexpectedError")
501
+ }), /* @__PURE__ */ jsx("p", {
502
+ className: "text-muted-foreground",
503
+ children: error.message
504
+ })]
505
+ });
506
+ return Component ? /* @__PURE__ */ jsx(Component, {}) : /* @__PURE__ */ jsx(DefaultNotFound, {});
951
507
  }
952
508
  /**
953
509
  * AdminRouter Component
@@ -956,602 +512,230 @@ function LazyPageRenderer(t0) {
956
512
  * Uses Suspense internally - shows skeleton while config loads.
957
513
  */
958
514
  function AdminRouter(props) {
959
- const $ = c(7);
960
- let t0;
961
- if ($[0] !== props.segments) {
962
- t0 = getFallbackForSegments(props.segments);
963
- $[0] = props.segments;
964
- $[1] = t0;
965
- } else t0 = $[1];
966
- let t1;
967
- if ($[2] !== props) {
968
- t1 = /* @__PURE__ */ jsx(AdminRouterInner, { ...props });
969
- $[2] = props;
970
- $[3] = t1;
971
- } else t1 = $[3];
972
- let t2;
973
- if ($[4] !== t0 || $[5] !== t1) {
974
- t2 = /* @__PURE__ */ jsx(React.Suspense, {
975
- fallback: t0,
976
- children: t1
977
- });
978
- $[4] = t0;
979
- $[5] = t1;
980
- $[6] = t2;
981
- } else t2 = $[6];
982
- return t2;
515
+ return /* @__PURE__ */ jsx(React.Suspense, {
516
+ fallback: getFallbackForSegments(props.segments),
517
+ children: /* @__PURE__ */ jsx(AdminRouterInner, { ...props })
518
+ });
983
519
  }
984
520
  /**
985
521
  * Inner router component that uses Suspense for data loading.
986
522
  * Guaranteed to have config loaded when rendering.
987
523
  */
988
- function AdminRouterInner(t0) {
989
- const $ = c(153);
990
- const { segments, navigate, basePath: t1, searchParams: searchParamsProp, collections: collectionsProp, globals: globalsProp, pages: pagesProp, DashboardComponent: DashboardComponentProp, dashboardConfig: dashboardConfigProp, collectionComponents, globalComponents, registry, NotFoundComponent } = t0;
991
- const basePath = t1 === void 0 ? "/admin" : t1;
524
+ function AdminRouterInner({ segments, navigate, basePath = "/admin", searchParams: searchParamsProp, collections: collectionsProp, globals: globalsProp, pages: pagesProp, DashboardComponent: DashboardComponentProp, dashboardConfig: dashboardConfigProp, collectionComponents, globalComponents, renderFormFields: _renderFormFields, registry, NotFoundComponent }) {
992
525
  const resolvedCollectionComponents = collectionComponents ?? EMPTY_COLLECTION_COMPONENTS;
993
526
  const resolvedGlobalComponents = globalComponents ?? EMPTY_GLOBAL_COMPONENTS;
994
- let t2;
995
- bb0: {
996
- if (searchParamsProp) {
997
- t2 = searchParamsProp;
998
- break bb0;
999
- }
1000
- if (typeof window !== "undefined") {
1001
- let t3$2;
1002
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
1003
- t3$2 = new URLSearchParams(window.location.search);
1004
- $[0] = t3$2;
1005
- } else t3$2 = $[0];
1006
- t2 = t3$2;
1007
- break bb0;
1008
- }
1009
- let t3$1;
1010
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
1011
- t3$1 = new URLSearchParams();
1012
- $[1] = t3$1;
1013
- } else t3$1 = $[1];
1014
- t2 = t3$1;
1015
- }
1016
- const searchParams = t2;
1017
- let t3;
1018
- if ($[2] !== searchParams) {
1019
- t3 = parsePrefillParams(searchParams);
1020
- $[2] = searchParams;
1021
- $[3] = t3;
1022
- } else t3 = $[3];
1023
- const prefillValues = t3;
1024
- let t4;
1025
- if ($[4] !== DashboardComponentProp || $[5] !== collectionsProp || $[6] !== dashboardConfigProp || $[7] !== globalsProp || $[8] !== pagesProp) {
1026
- t4 = {
1027
- collections: collectionsProp,
1028
- globals: globalsProp,
1029
- pages: pagesProp,
1030
- dashboardConfig: dashboardConfigProp,
1031
- DashboardComponent: DashboardComponentProp
1032
- };
1033
- $[4] = DashboardComponentProp;
1034
- $[5] = collectionsProp;
1035
- $[6] = dashboardConfigProp;
1036
- $[7] = globalsProp;
1037
- $[8] = pagesProp;
1038
- $[9] = t4;
1039
- } else t4 = $[9];
1040
- const { collections, globals, pages, views, brandingName, dashboardConfig, DashboardComponent } = useRouterConfig(t4);
1041
- let t5;
1042
- if ($[10] !== collections || $[11] !== globals || $[12] !== pages || $[13] !== segments) {
1043
- t5 = matchRoute(segments, collections, globals, pages);
1044
- $[10] = collections;
1045
- $[11] = globals;
1046
- $[12] = pages;
1047
- $[13] = segments;
1048
- $[14] = t5;
1049
- } else t5 = $[14];
1050
- const route = t5;
527
+ const searchParams = React.useMemo(() => {
528
+ if (searchParamsProp) return searchParamsProp;
529
+ if (typeof window !== "undefined") return new URLSearchParams(window.location.search);
530
+ return new URLSearchParams();
531
+ }, [searchParamsProp]);
532
+ const prefillValues = React.useMemo(() => parsePrefillParams(searchParams), [searchParams]);
533
+ const { collections, globals, pages, views, brandingName, dashboardConfig, DashboardComponent } = useRouterConfig({
534
+ collections: collectionsProp,
535
+ globals: globalsProp,
536
+ pages: pagesProp,
537
+ dashboardConfig: dashboardConfigProp,
538
+ DashboardComponent: DashboardComponentProp
539
+ });
540
+ const route = React.useMemo(() => matchRoute(segments, collections, globals, pages), [
541
+ segments,
542
+ collections,
543
+ globals,
544
+ pages
545
+ ]);
1051
546
  const activeCollectionName = route.type === "collection-list" || route.type === "collection-create" || route.type === "collection-edit" ? route.name : "";
1052
547
  const activeGlobalName = route.type === "global-edit" ? route.name : "";
1053
548
  const queryClient = useQueryClient();
1054
549
  const client = useAdminStore(selectClient);
1055
550
  if (activeCollectionName && client) queryClient.prefetchQuery(getCollectionMetaQueryOptions(activeCollectionName, client));
1056
551
  if (activeGlobalName && client) queryClient.prefetchQuery(getGlobalMetaQueryOptions(activeGlobalName, client));
1057
- const t6 = !!activeCollectionName;
1058
- let t7;
1059
- if ($[15] !== t6) {
1060
- t7 = { enabled: t6 };
1061
- $[15] = t6;
1062
- $[16] = t7;
1063
- } else t7 = $[16];
1064
- const { data: activeCollectionSchema } = useCollectionSchema(activeCollectionName, t7);
1065
- const t8 = !!activeGlobalName;
1066
- let t9;
1067
- if ($[17] !== t8) {
1068
- t9 = { enabled: t8 };
1069
- $[17] = t8;
1070
- $[18] = t9;
1071
- } else t9 = $[18];
1072
- const { data: activeGlobalSchema } = useGlobalSchema(activeGlobalName, t9);
552
+ const { data: activeCollectionSchema } = useCollectionSchema(activeCollectionName, { enabled: !!activeCollectionName });
553
+ const { data: activeGlobalSchema } = useGlobalSchema(activeGlobalName, { enabled: !!activeGlobalName });
1073
554
  const { t } = useTranslation();
1074
555
  const resolveText = useResolveText();
1075
- let t10;
1076
- if ($[19] !== activeCollectionSchema || $[20] !== activeGlobalSchema || $[21] !== brandingName || $[22] !== collections || $[23] !== dashboardConfig?.description || $[24] !== dashboardConfig?.title || $[25] !== globals || $[26] !== resolveText || $[27] !== route.config || $[28] !== route.name || $[29] !== route.type || $[30] !== t) {
1077
- t10 = () => {
1078
- const appTitle = resolveText(brandingName, "Admin");
1079
- let pageTitle = t("dashboard.title");
1080
- let metaDescription = pageTitle;
1081
- const resolveResourceLabel = (config, schemaConfig, fallback) => resolveText(config?.label ?? config?.meta?.label ?? schemaConfig?.label, formatLabel(fallback));
1082
- const resolveResourceDescription = (config_0, schemaConfig_0) => resolveText(config_0?.description ?? config_0?.meta?.description ?? schemaConfig_0?.description).trim();
1083
- bb104: switch (route.type) {
1084
- case "dashboard":
1085
- pageTitle = resolveText(dashboardConfig?.title, t("dashboard.title"));
1086
- metaDescription = resolveText(dashboardConfig?.description).trim() || pageTitle;
1087
- break bb104;
1088
- case "collection-list": {
1089
- const config_4 = collections[route.name];
1090
- const schemaConfig_4 = activeCollectionSchema?.admin?.config;
1091
- const label_2 = resolveResourceLabel(config_4, schemaConfig_4, route.name);
1092
- pageTitle = label_2;
1093
- metaDescription = resolveResourceDescription(config_4, schemaConfig_4) || t("collection.list", { name: label_2 });
1094
- break bb104;
1095
- }
1096
- case "collection-create": {
1097
- const config_3 = collections[route.name];
1098
- const schemaConfig_3 = activeCollectionSchema?.admin?.config;
1099
- const label_1 = resolveResourceLabel(config_3, schemaConfig_3, route.name);
1100
- pageTitle = `${label_1}: ${t("common.create")}`;
1101
- metaDescription = resolveResourceDescription(config_3, schemaConfig_3) || t("collection.create", { name: label_1 });
1102
- break bb104;
1103
- }
1104
- case "collection-edit": {
1105
- const config_2 = collections[route.name];
1106
- const schemaConfig_2 = activeCollectionSchema?.admin?.config;
1107
- const label_0 = resolveResourceLabel(config_2, schemaConfig_2, route.name);
1108
- pageTitle = `${label_0}: ${t("common.edit")}`;
1109
- metaDescription = resolveResourceDescription(config_2, schemaConfig_2) || t("collection.edit", { name: label_0 });
1110
- break bb104;
1111
- }
1112
- case "global-edit": {
1113
- const config_1 = globals[route.name];
1114
- const schemaConfig_1 = activeGlobalSchema?.admin?.config;
1115
- const label = resolveResourceLabel(config_1, schemaConfig_1, route.name);
1116
- pageTitle = label;
1117
- metaDescription = resolveResourceDescription(config_1, schemaConfig_1) || label;
1118
- break bb104;
1119
- }
1120
- case "page":
1121
- pageTitle = resolveText(route.config.label, formatLabel(route.name));
1122
- metaDescription = pageTitle;
1123
- break bb104;
1124
- case "not-found":
1125
- pageTitle = t("error.notFound");
1126
- metaDescription = pageTitle;
556
+ React.useEffect(() => {
557
+ const appTitle = resolveText(brandingName, "Admin");
558
+ let pageTitle = t("dashboard.title");
559
+ let metaDescription = pageTitle;
560
+ const resolveResourceLabel = (config, schemaConfig, fallback) => resolveText(config?.label ?? config?.meta?.label ?? schemaConfig?.label, formatLabel(fallback));
561
+ const resolveResourceDescription = (config, schemaConfig) => resolveText(config?.description ?? config?.meta?.description ?? schemaConfig?.description).trim();
562
+ switch (route.type) {
563
+ case "dashboard":
564
+ pageTitle = resolveText(dashboardConfig?.title, t("dashboard.title"));
565
+ metaDescription = resolveText(dashboardConfig?.description).trim() || pageTitle;
566
+ break;
567
+ case "collection-list": {
568
+ const config = collections[route.name];
569
+ const schemaConfig = activeCollectionSchema?.admin?.config;
570
+ const label = resolveResourceLabel(config, schemaConfig, route.name);
571
+ pageTitle = label;
572
+ metaDescription = resolveResourceDescription(config, schemaConfig) || t("collection.list", { name: label });
573
+ break;
1127
574
  }
1128
- document.title = formatDocumentTitle(pageTitle, appTitle);
1129
- setDocumentMetaDescription(metaDescription || pageTitle);
1130
- };
1131
- $[19] = activeCollectionSchema;
1132
- $[20] = activeGlobalSchema;
1133
- $[21] = brandingName;
1134
- $[22] = collections;
1135
- $[23] = dashboardConfig?.description;
1136
- $[24] = dashboardConfig?.title;
1137
- $[25] = globals;
1138
- $[26] = resolveText;
1139
- $[27] = route.config;
1140
- $[28] = route.name;
1141
- $[29] = route.type;
1142
- $[30] = t;
1143
- $[31] = t10;
1144
- } else t10 = $[31];
1145
- let t11;
1146
- if ($[32] !== activeCollectionSchema || $[33] !== activeGlobalSchema || $[34] !== brandingName || $[35] !== collections || $[36] !== dashboardConfig || $[37] !== globals || $[38] !== resolveText || $[39] !== route || $[40] !== t) {
1147
- t11 = [
1148
- activeCollectionSchema,
1149
- activeGlobalSchema,
1150
- brandingName,
1151
- collections,
1152
- dashboardConfig,
1153
- globals,
1154
- resolveText,
1155
- route,
1156
- t
1157
- ];
1158
- $[32] = activeCollectionSchema;
1159
- $[33] = activeGlobalSchema;
1160
- $[34] = brandingName;
1161
- $[35] = collections;
1162
- $[36] = dashboardConfig;
1163
- $[37] = globals;
1164
- $[38] = resolveText;
1165
- $[39] = route;
1166
- $[40] = t;
1167
- $[41] = t11;
1168
- } else t11 = $[41];
1169
- React.useEffect(t10, t11);
1170
- let t12;
1171
- if ($[42] !== segments) {
1172
- t12 = segments.join("/");
1173
- $[42] = segments;
1174
- $[43] = t12;
1175
- } else t12 = $[43];
1176
- const routeKey = t12;
1177
- let t13;
1178
- if ($[44] !== routeKey) {
1179
- t13 = [routeKey];
1180
- $[44] = routeKey;
1181
- $[45] = t13;
1182
- } else t13 = $[45];
1183
- React.useEffect(_temp2, t13);
1184
- if (route.type === "dashboard") {
1185
- if (DashboardComponent) {
1186
- let t14$2;
1187
- if ($[46] !== DashboardComponent) {
1188
- t14$2 = /* @__PURE__ */ jsx(DashboardComponent, {});
1189
- $[46] = DashboardComponent;
1190
- $[47] = t14$2;
1191
- } else t14$2 = $[47];
1192
- return t14$2;
1193
- }
1194
- if (dashboardConfig?.items?.length || dashboardConfig?.widgets?.length) {
1195
- let t14$2;
1196
- if ($[48] !== basePath || $[49] !== dashboardConfig || $[50] !== navigate) {
1197
- t14$2 = /* @__PURE__ */ jsx(DashboardGrid, {
1198
- config: dashboardConfig,
1199
- basePath,
1200
- navigate
1201
- });
1202
- $[48] = basePath;
1203
- $[49] = dashboardConfig;
1204
- $[50] = navigate;
1205
- $[51] = t14$2;
1206
- } else t14$2 = $[51];
1207
- return t14$2;
575
+ case "collection-create": {
576
+ const config = collections[route.name];
577
+ const schemaConfig = activeCollectionSchema?.admin?.config;
578
+ const label = resolveResourceLabel(config, schemaConfig, route.name);
579
+ pageTitle = `${label}: ${t("common.create")}`;
580
+ metaDescription = resolveResourceDescription(config, schemaConfig) || t("collection.create", { name: label });
581
+ break;
582
+ }
583
+ case "collection-edit": {
584
+ const config = collections[route.name];
585
+ const schemaConfig = activeCollectionSchema?.admin?.config;
586
+ const label = resolveResourceLabel(config, schemaConfig, route.name);
587
+ pageTitle = `${label}: ${t("common.edit")}`;
588
+ metaDescription = resolveResourceDescription(config, schemaConfig) || t("collection.edit", { name: label });
589
+ break;
590
+ }
591
+ case "global-edit": {
592
+ const config = globals[route.name];
593
+ const schemaConfig = activeGlobalSchema?.admin?.config;
594
+ const label = resolveResourceLabel(config, schemaConfig, route.name);
595
+ pageTitle = label;
596
+ metaDescription = resolveResourceDescription(config, schemaConfig) || label;
597
+ break;
598
+ }
599
+ case "page":
600
+ pageTitle = resolveText(route.config.label, formatLabel(route.name));
601
+ metaDescription = pageTitle;
602
+ break;
603
+ case "not-found":
604
+ pageTitle = t("error.notFound");
605
+ metaDescription = pageTitle;
606
+ break;
1208
607
  }
1209
- let t14$1;
1210
- if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
1211
- t14$1 = /* @__PURE__ */ jsx(DefaultDashboard, {});
1212
- $[52] = t14$1;
1213
- } else t14$1 = $[52];
1214
- return t14$1;
608
+ document.title = formatDocumentTitle(pageTitle, appTitle);
609
+ setDocumentMetaDescription(metaDescription || pageTitle);
610
+ }, [
611
+ activeCollectionSchema,
612
+ activeGlobalSchema,
613
+ brandingName,
614
+ collections,
615
+ dashboardConfig,
616
+ globals,
617
+ resolveText,
618
+ route,
619
+ t
620
+ ]);
621
+ const routeKey = segments.join("/");
622
+ React.useEffect(() => {
623
+ const main = document.getElementById("main-content");
624
+ if (main) requestAnimationFrame(() => {
625
+ main.focus({ preventScroll: true });
626
+ });
627
+ }, [routeKey]);
628
+ if (route.type === "dashboard") {
629
+ if (DashboardComponent) return /* @__PURE__ */ jsx(DashboardComponent, {});
630
+ if (dashboardConfig?.items?.length || dashboardConfig?.widgets?.length) return /* @__PURE__ */ jsx(DashboardGrid, {
631
+ config: dashboardConfig,
632
+ basePath,
633
+ navigate
634
+ });
635
+ return /* @__PURE__ */ jsx(DefaultDashboard, {});
1215
636
  }
1216
637
  if (route.type === "collection-list") {
1217
638
  const { name } = route;
1218
- const config_5 = collections[name];
1219
- if (!config_5) {
1220
- let t14$2;
1221
- if ($[53] !== basePath || $[54] !== name || $[55] !== navigate) {
1222
- t14$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
1223
- type: "collection",
1224
- name,
1225
- navigate,
1226
- basePath
1227
- });
1228
- $[53] = basePath;
1229
- $[54] = name;
1230
- $[55] = navigate;
1231
- $[56] = t14$2;
1232
- } else t14$2 = $[56];
1233
- return t14$2;
1234
- }
639
+ const config = collections[name];
640
+ if (!config) return /* @__PURE__ */ jsx(RestrictedAccess, {
641
+ type: "collection",
642
+ name,
643
+ navigate,
644
+ basePath
645
+ });
1235
646
  const custom = resolvedCollectionComponents[name];
1236
647
  const viewNameFromSchema = activeCollectionSchema?.admin?.list?.view;
1237
- const t14$1 = config_5?.list;
1238
- let t15;
1239
- if ($[57] !== t14$1) {
1240
- t15 = getConfiguredViewName(t14$1);
1241
- $[57] = t14$1;
1242
- $[58] = t15;
1243
- } else t15 = $[58];
1244
- const viewNameFromConfig = t15;
1245
- let t16;
1246
- if ($[59] !== viewNameFromConfig || $[60] !== viewNameFromSchema || $[61] !== views) {
1247
- t16 = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "list");
1248
- $[59] = viewNameFromConfig;
1249
- $[60] = viewNameFromSchema;
1250
- $[61] = views;
1251
- $[62] = t16;
1252
- } else t16 = $[62];
1253
- const selectedListView = t16;
648
+ const viewNameFromConfig = getConfiguredViewName(config?.list);
649
+ const selectedListView = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "list");
1254
650
  const selectedListViewDefinition = views[selectedListView];
1255
- let t17;
1256
- if ($[63] !== activeCollectionSchema || $[64] !== config_5 || $[65] !== selectedListViewDefinition) {
1257
- t17 = mergeViewConfig(getViewBaseConfig(selectedListViewDefinition), config_5?.list?.config ?? config_5?.list ?? activeCollectionSchema?.admin?.list);
1258
- $[63] = activeCollectionSchema;
1259
- $[64] = config_5;
1260
- $[65] = selectedListViewDefinition;
1261
- $[66] = t17;
1262
- } else t17 = $[66];
1263
- const selectedListViewConfig = t17;
1264
- let t18;
1265
- if ($[67] !== selectedListViewDefinition) {
1266
- t18 = getViewLoader(selectedListViewDefinition);
1267
- $[67] = selectedListViewDefinition;
1268
- $[68] = t18;
1269
- } else t18 = $[68];
1270
- const listViewLoader = t18;
651
+ const selectedListViewConfig = mergeViewConfig(getViewBaseConfig(selectedListViewDefinition), config?.list?.config ?? config?.list ?? activeCollectionSchema?.admin?.list);
652
+ const listViewLoader = getViewLoader(selectedListViewDefinition);
1271
653
  if (selectedListViewDefinition && selectedListViewDefinition.kind !== "list" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedListView}" kind "${selectedListViewDefinition.kind}" != expected "list"`);
1272
- if (custom?.List) {
1273
- let t19$1;
1274
- if ($[69] !== custom.List) {
1275
- t19$1 = /* @__PURE__ */ jsx(custom.List, {});
1276
- $[69] = custom.List;
1277
- $[70] = t19$1;
1278
- } else t19$1 = $[70];
1279
- return t19$1;
1280
- }
1281
- let t19;
1282
- if ($[71] !== basePath || $[72] !== config_5 || $[73] !== name || $[74] !== navigate || $[75] !== selectedListViewConfig) {
1283
- t19 = {
654
+ if (custom?.List) return /* @__PURE__ */ jsx(custom.List, {});
655
+ return /* @__PURE__ */ jsx(RegistryViewRenderer, {
656
+ loader: listViewLoader,
657
+ viewKind: "list",
658
+ viewId: selectedListView,
659
+ componentProps: {
1284
660
  collection: name,
1285
- config: config_5,
661
+ config,
1286
662
  viewConfig: selectedListViewConfig,
1287
663
  navigate,
1288
664
  basePath
1289
- };
1290
- $[71] = basePath;
1291
- $[72] = config_5;
1292
- $[73] = name;
1293
- $[74] = navigate;
1294
- $[75] = selectedListViewConfig;
1295
- $[76] = t19;
1296
- } else t19 = $[76];
1297
- const listComponentProps = t19;
1298
- let t20;
1299
- if ($[77] !== listComponentProps || $[78] !== listViewLoader || $[79] !== name || $[80] !== selectedListView) {
1300
- t20 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
1301
- loader: listViewLoader,
1302
- viewKind: "list",
1303
- viewId: selectedListView,
1304
- componentProps: listComponentProps
1305
- }, name);
1306
- $[77] = listComponentProps;
1307
- $[78] = listViewLoader;
1308
- $[79] = name;
1309
- $[80] = selectedListView;
1310
- $[81] = t20;
1311
- } else t20 = $[81];
1312
- return t20;
665
+ }
666
+ }, name);
1313
667
  }
1314
668
  if (route.type === "collection-create" || route.type === "collection-edit") {
1315
- const { name: name_0 } = route;
669
+ const { name } = route;
1316
670
  const id = route.type === "collection-edit" ? route.id : void 0;
1317
- const config_6 = collections[name_0];
1318
- if (!config_6) {
1319
- let t14$2;
1320
- if ($[82] !== basePath || $[83] !== name_0 || $[84] !== navigate) {
1321
- t14$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
1322
- type: "collection",
1323
- name: name_0,
1324
- navigate,
1325
- basePath
1326
- });
1327
- $[82] = basePath;
1328
- $[83] = name_0;
1329
- $[84] = navigate;
1330
- $[85] = t14$2;
1331
- } else t14$2 = $[85];
1332
- return t14$2;
1333
- }
1334
- const custom_0 = resolvedCollectionComponents[name_0];
1335
- const viewNameFromSchema_0 = activeCollectionSchema?.admin?.form?.view;
1336
- const t14$1 = config_6?.form;
1337
- let t15;
1338
- if ($[86] !== t14$1) {
1339
- t15 = getConfiguredViewName(t14$1);
1340
- $[86] = t14$1;
1341
- $[87] = t15;
1342
- } else t15 = $[87];
1343
- const viewNameFromConfig_0 = t15;
1344
- let t16;
1345
- if ($[88] !== viewNameFromConfig_0 || $[89] !== viewNameFromSchema_0 || $[90] !== views) {
1346
- t16 = viewNameFromSchema_0 ?? viewNameFromConfig_0 ?? findDefaultView(views, "form");
1347
- $[88] = viewNameFromConfig_0;
1348
- $[89] = viewNameFromSchema_0;
1349
- $[90] = views;
1350
- $[91] = t16;
1351
- } else t16 = $[91];
1352
- const selectedFormView = t16;
671
+ const config = collections[name];
672
+ if (!config) return /* @__PURE__ */ jsx(RestrictedAccess, {
673
+ type: "collection",
674
+ name,
675
+ navigate,
676
+ basePath
677
+ });
678
+ const custom = resolvedCollectionComponents[name];
679
+ const viewNameFromSchema = activeCollectionSchema?.admin?.form?.view;
680
+ const viewNameFromConfig = getConfiguredViewName(config?.form);
681
+ const selectedFormView = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "form");
1353
682
  const selectedFormViewDefinition = views[selectedFormView];
1354
- let t17;
1355
- if ($[92] !== activeCollectionSchema || $[93] !== config_6 || $[94] !== selectedFormViewDefinition) {
1356
- t17 = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition), config_6?.form?.config ?? config_6?.form ?? activeCollectionSchema?.admin?.form);
1357
- $[92] = activeCollectionSchema;
1358
- $[93] = config_6;
1359
- $[94] = selectedFormViewDefinition;
1360
- $[95] = t17;
1361
- } else t17 = $[95];
1362
- const selectedFormViewConfig = t17;
1363
- let t18;
1364
- if ($[96] !== selectedFormViewDefinition) {
1365
- t18 = getViewLoader(selectedFormViewDefinition);
1366
- $[96] = selectedFormViewDefinition;
1367
- $[97] = t18;
1368
- } else t18 = $[97];
1369
- const formViewLoader = t18;
683
+ const selectedFormViewConfig = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition), config?.form?.config ?? config?.form ?? activeCollectionSchema?.admin?.form);
684
+ const formViewLoader = getViewLoader(selectedFormViewDefinition);
1370
685
  if (selectedFormViewDefinition && selectedFormViewDefinition.kind !== "form" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedFormView}" kind "${selectedFormViewDefinition.kind}" != expected "form"`);
1371
- if (custom_0?.Form) {
1372
- let t19$1;
1373
- if ($[98] !== custom_0.Form) {
1374
- t19$1 = /* @__PURE__ */ jsx(custom_0.Form, {});
1375
- $[98] = custom_0.Form;
1376
- $[99] = t19$1;
1377
- } else t19$1 = $[99];
1378
- return t19$1;
1379
- }
1380
- let t19;
1381
- if ($[100] !== prefillValues || $[101] !== route.type) {
1382
- t19 = route.type === "collection-create" && Object.keys(prefillValues).length > 0 ? prefillValues : void 0;
1383
- $[100] = prefillValues;
1384
- $[101] = route.type;
1385
- $[102] = t19;
1386
- } else t19 = $[102];
1387
- const defaultValues = t19;
1388
- let t20;
1389
- if ($[103] !== basePath || $[104] !== collections || $[105] !== config_6 || $[106] !== defaultValues || $[107] !== id || $[108] !== name_0 || $[109] !== navigate || $[110] !== registry || $[111] !== selectedFormViewConfig) {
1390
- t20 = {
1391
- collection: name_0,
686
+ if (custom?.Form) return /* @__PURE__ */ jsx(custom.Form, {});
687
+ return /* @__PURE__ */ jsx(RegistryViewRenderer, {
688
+ loader: formViewLoader,
689
+ viewKind: "form",
690
+ viewId: selectedFormView,
691
+ componentProps: {
692
+ collection: name,
1392
693
  id,
1393
- config: config_6,
694
+ config,
1394
695
  viewConfig: selectedFormViewConfig,
1395
696
  navigate,
1396
697
  basePath,
1397
- defaultValues,
698
+ defaultValues: route.type === "collection-create" && Object.keys(prefillValues).length > 0 ? prefillValues : void 0,
1398
699
  registry,
1399
700
  allCollectionsConfig: collections
1400
- };
1401
- $[103] = basePath;
1402
- $[104] = collections;
1403
- $[105] = config_6;
1404
- $[106] = defaultValues;
1405
- $[107] = id;
1406
- $[108] = name_0;
1407
- $[109] = navigate;
1408
- $[110] = registry;
1409
- $[111] = selectedFormViewConfig;
1410
- $[112] = t20;
1411
- } else t20 = $[112];
1412
- const editComponentProps = t20;
1413
- const t21 = `${name_0}-${id ?? "create"}`;
1414
- let t22;
1415
- if ($[113] !== editComponentProps || $[114] !== formViewLoader || $[115] !== selectedFormView || $[116] !== t21) {
1416
- t22 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
1417
- loader: formViewLoader,
1418
- viewKind: "form",
1419
- viewId: selectedFormView,
1420
- componentProps: editComponentProps
1421
- }, t21);
1422
- $[113] = editComponentProps;
1423
- $[114] = formViewLoader;
1424
- $[115] = selectedFormView;
1425
- $[116] = t21;
1426
- $[117] = t22;
1427
- } else t22 = $[117];
1428
- return t22;
701
+ }
702
+ }, `${name}-${id ?? "create"}`);
1429
703
  }
1430
704
  if (route.type === "global-edit") {
1431
- const { name: name_1 } = route;
1432
- const config_7 = globals[name_1];
1433
- if (!config_7) {
1434
- let t14$2;
1435
- if ($[118] !== basePath || $[119] !== name_1 || $[120] !== navigate) {
1436
- t14$2 = /* @__PURE__ */ jsx(RestrictedAccess, {
1437
- type: "global",
1438
- name: name_1,
1439
- navigate,
1440
- basePath
1441
- });
1442
- $[118] = basePath;
1443
- $[119] = name_1;
1444
- $[120] = navigate;
1445
- $[121] = t14$2;
1446
- } else t14$2 = $[121];
1447
- return t14$2;
1448
- }
1449
- const custom_1 = resolvedGlobalComponents[name_1];
1450
- const viewNameFromSchema_1 = activeGlobalSchema?.admin?.form?.view;
1451
- const t14$1 = config_7?.form;
1452
- let t15;
1453
- if ($[122] !== t14$1) {
1454
- t15 = getConfiguredViewName(t14$1);
1455
- $[122] = t14$1;
1456
- $[123] = t15;
1457
- } else t15 = $[123];
1458
- const viewNameFromConfig_1 = t15;
1459
- let t16;
1460
- if ($[124] !== viewNameFromConfig_1 || $[125] !== viewNameFromSchema_1 || $[126] !== views) {
1461
- t16 = viewNameFromSchema_1 ?? viewNameFromConfig_1 ?? findDefaultView(views, "form");
1462
- $[124] = viewNameFromConfig_1;
1463
- $[125] = viewNameFromSchema_1;
1464
- $[126] = views;
1465
- $[127] = t16;
1466
- } else t16 = $[127];
1467
- const selectedFormView_0 = t16;
1468
- const selectedFormViewDefinition_0 = views[selectedFormView_0];
1469
- let t17;
1470
- if ($[128] !== activeGlobalSchema || $[129] !== config_7 || $[130] !== selectedFormViewDefinition_0) {
1471
- t17 = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition_0), config_7?.form?.config ?? config_7?.form ?? activeGlobalSchema?.admin?.form);
1472
- $[128] = activeGlobalSchema;
1473
- $[129] = config_7;
1474
- $[130] = selectedFormViewDefinition_0;
1475
- $[131] = t17;
1476
- } else t17 = $[131];
1477
- const selectedFormViewConfig_0 = t17;
1478
- let t18;
1479
- if ($[132] !== selectedFormViewDefinition_0) {
1480
- t18 = getViewLoader(selectedFormViewDefinition_0);
1481
- $[132] = selectedFormViewDefinition_0;
1482
- $[133] = t18;
1483
- } else t18 = $[133];
1484
- const globalViewLoader = t18;
1485
- if (selectedFormViewDefinition_0 && selectedFormViewDefinition_0.kind !== "form" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedFormView_0}" kind "${selectedFormViewDefinition_0.kind}" != expected "form"`);
1486
- if (custom_1?.Form) {
1487
- let t19$1;
1488
- if ($[134] !== custom_1.Form) {
1489
- t19$1 = /* @__PURE__ */ jsx(custom_1.Form, {});
1490
- $[134] = custom_1.Form;
1491
- $[135] = t19$1;
1492
- } else t19$1 = $[135];
1493
- return t19$1;
1494
- }
1495
- let t19;
1496
- if ($[136] !== basePath || $[137] !== config_7 || $[138] !== globals || $[139] !== name_1 || $[140] !== navigate || $[141] !== registry || $[142] !== selectedFormViewConfig_0) {
1497
- t19 = {
1498
- global: name_1,
1499
- config: config_7,
1500
- viewConfig: selectedFormViewConfig_0,
705
+ const { name } = route;
706
+ const config = globals[name];
707
+ if (!config) return /* @__PURE__ */ jsx(RestrictedAccess, {
708
+ type: "global",
709
+ name,
710
+ navigate,
711
+ basePath
712
+ });
713
+ const custom = resolvedGlobalComponents[name];
714
+ const viewNameFromSchema = activeGlobalSchema?.admin?.form?.view;
715
+ const viewNameFromConfig = getConfiguredViewName(config?.form);
716
+ const selectedFormView = viewNameFromSchema ?? viewNameFromConfig ?? findDefaultView(views, "form");
717
+ const selectedFormViewDefinition = views[selectedFormView];
718
+ const selectedFormViewConfig = mergeViewConfig(getViewBaseConfig(selectedFormViewDefinition), config?.form?.config ?? config?.form ?? activeGlobalSchema?.admin?.form);
719
+ const globalViewLoader = getViewLoader(selectedFormViewDefinition);
720
+ if (selectedFormViewDefinition && selectedFormViewDefinition.kind !== "form" && process.env.NODE_ENV !== "production") console.warn(`View "${selectedFormView}" kind "${selectedFormViewDefinition.kind}" != expected "form"`);
721
+ if (custom?.Form) return /* @__PURE__ */ jsx(custom.Form, {});
722
+ return /* @__PURE__ */ jsx(RegistryViewRenderer, {
723
+ loader: globalViewLoader,
724
+ viewKind: "form",
725
+ viewId: selectedFormView,
726
+ componentProps: {
727
+ global: name,
728
+ config,
729
+ viewConfig: selectedFormViewConfig,
1501
730
  navigate,
1502
731
  basePath,
1503
732
  registry,
1504
733
  allGlobalsConfig: globals
1505
- };
1506
- $[136] = basePath;
1507
- $[137] = config_7;
1508
- $[138] = globals;
1509
- $[139] = name_1;
1510
- $[140] = navigate;
1511
- $[141] = registry;
1512
- $[142] = selectedFormViewConfig_0;
1513
- $[143] = t19;
1514
- } else t19 = $[143];
1515
- const globalComponentProps = t19;
1516
- let t20;
1517
- if ($[144] !== globalComponentProps || $[145] !== globalViewLoader || $[146] !== name_1 || $[147] !== selectedFormView_0) {
1518
- t20 = /* @__PURE__ */ jsx(RegistryViewRenderer, {
1519
- loader: globalViewLoader,
1520
- viewKind: "form",
1521
- viewId: selectedFormView_0,
1522
- componentProps: globalComponentProps
1523
- }, name_1);
1524
- $[144] = globalComponentProps;
1525
- $[145] = globalViewLoader;
1526
- $[146] = name_1;
1527
- $[147] = selectedFormView_0;
1528
- $[148] = t20;
1529
- } else t20 = $[148];
1530
- return t20;
1531
- }
1532
- if (route.type === "page") {
1533
- let t14$1;
1534
- if ($[149] !== route.config) {
1535
- t14$1 = /* @__PURE__ */ jsx(LazyPageRenderer, { config: route.config });
1536
- $[149] = route.config;
1537
- $[150] = t14$1;
1538
- } else t14$1 = $[150];
1539
- return t14$1;
734
+ }
735
+ }, name);
1540
736
  }
1541
- const NotFound = NotFoundComponent || DefaultNotFound;
1542
- let t14;
1543
- if ($[151] !== NotFound) {
1544
- t14 = /* @__PURE__ */ jsx(NotFound, {});
1545
- $[151] = NotFound;
1546
- $[152] = t14;
1547
- } else t14 = $[152];
1548
- return t14;
1549
- }
1550
- function _temp2() {
1551
- const main = document.getElementById("main-content");
1552
- if (main) requestAnimationFrame(() => {
1553
- main.focus({ preventScroll: true });
1554
- });
737
+ if (route.type === "page") return /* @__PURE__ */ jsx(LazyPageRenderer, { config: route.config });
738
+ return /* @__PURE__ */ jsx(NotFoundComponent || DefaultNotFound, {});
1555
739
  }
1556
740
 
1557
741
  //#endregion