@questpie/admin 3.2.3 → 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 (244) 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.d.mts +2 -2
  8. package/dist/client/components/admin-link.mjs +40 -126
  9. package/dist/client/components/auth/auth-loading.mjs +9 -44
  10. package/dist/client/components/blocks/block-canvas.mjs +31 -95
  11. package/dist/client/components/blocks/block-editor-context.mjs +13 -57
  12. package/dist/client/components/blocks/block-editor-layout.mjs +72 -166
  13. package/dist/client/components/blocks/block-editor-provider.mjs +184 -245
  14. package/dist/client/components/blocks/block-fields-renderer.mjs +54 -229
  15. package/dist/client/components/blocks/block-insert-button.mjs +49 -165
  16. package/dist/client/components/blocks/block-item-menu.mjs +102 -301
  17. package/dist/client/components/blocks/block-item.mjs +136 -370
  18. package/dist/client/components/blocks/block-library-sidebar.mjs +106 -220
  19. package/dist/client/components/blocks/block-tree.mjs +12 -68
  20. package/dist/client/components/blocks/block-type-icon.mjs +14 -56
  21. package/dist/client/components/brand-logo.mjs +35 -149
  22. package/dist/client/components/component-renderer.mjs +42 -118
  23. package/dist/client/components/error-boundary.mjs +14 -58
  24. package/dist/client/components/fields/array-field.mjs +209 -521
  25. package/dist/client/components/fields/asset-preview-field.mjs +41 -141
  26. package/dist/client/components/fields/blocks-field/blocks-field.mjs +60 -156
  27. package/dist/client/components/fields/boolean-field.mjs +29 -59
  28. package/dist/client/components/fields/date-field.mjs +7 -37
  29. package/dist/client/components/fields/datetime-field.mjs +7 -38
  30. package/dist/client/components/fields/email-field.mjs +25 -54
  31. package/dist/client/components/fields/field-wrapper.mjs +30 -105
  32. package/dist/client/components/fields/json-field.mjs +107 -313
  33. package/dist/client/components/fields/locale-badge.mjs +6 -15
  34. package/dist/client/components/fields/number-field.mjs +27 -60
  35. package/dist/client/components/fields/object-array-field.mjs +283 -659
  36. package/dist/client/components/fields/object-field.mjs +165 -633
  37. package/dist/client/components/fields/relation/displays/cards-display.mjs +106 -220
  38. package/dist/client/components/fields/relation/displays/chips-display.mjs +78 -150
  39. package/dist/client/components/fields/relation/displays/grid-display.mjs +92 -186
  40. package/dist/client/components/fields/relation/displays/list-display.mjs +122 -239
  41. package/dist/client/components/fields/relation/displays/table-display.mjs +70 -244
  42. package/dist/client/components/fields/relation/relation-items-display.mjs +30 -126
  43. package/dist/client/components/fields/relation-field.mjs +10 -66
  44. package/dist/client/components/fields/relation-picker.mjs +18 -18
  45. package/dist/client/components/fields/relation-select.mjs +12 -12
  46. package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +80 -182
  47. package/dist/client/components/fields/rich-text-editor/image-popover.mjs +8 -19
  48. package/dist/client/components/fields/rich-text-editor/image-upload.mjs +13 -29
  49. package/dist/client/components/fields/rich-text-editor/index.mjs +196 -530
  50. package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +61 -111
  51. package/dist/client/components/fields/rich-text-editor/table-controls.mjs +105 -415
  52. package/dist/client/components/fields/rich-text-editor/toolbar.mjs +256 -511
  53. package/dist/client/components/fields/rich-text-field.mjs +14 -53
  54. package/dist/client/components/fields/select-field.mjs +39 -74
  55. package/dist/client/components/fields/text-field.mjs +26 -59
  56. package/dist/client/components/fields/textarea-field.mjs +26 -58
  57. package/dist/client/components/fields/time-field.mjs +7 -35
  58. package/dist/client/components/fields/upload-field.mjs +47 -165
  59. package/dist/client/components/filter-builder/columns-tab.mjs +80 -280
  60. package/dist/client/components/filter-builder/filter-builder-sheet.mjs +197 -540
  61. package/dist/client/components/filter-builder/filters-tab.mjs +96 -386
  62. package/dist/client/components/filter-builder/saved-views-tab.mjs +133 -351
  63. package/dist/client/components/history-sidebar.mjs +306 -611
  64. package/dist/client/components/layout/field-layout-renderer.mjs +106 -254
  65. package/dist/client/components/locale-switcher.mjs +106 -228
  66. package/dist/client/components/media/media-grid.mjs +84 -273
  67. package/dist/client/components/media/media-picker-dialog.mjs +177 -494
  68. package/dist/client/components/preview/live-preview-mode.mjs +240 -438
  69. package/dist/client/components/preview/preview-pane.mjs +22 -22
  70. package/dist/client/components/primitives/asset-preview.mjs +290 -666
  71. package/dist/client/components/primitives/checkbox-input.mjs +9 -35
  72. package/dist/client/components/primitives/date-input.mjs +109 -327
  73. package/dist/client/components/primitives/dropzone.mjs +209 -336
  74. package/dist/client/components/primitives/field-select-control.mjs +12 -80
  75. package/dist/client/components/primitives/number-input.mjs +4 -4
  76. package/dist/client/components/primitives/select-multi.mjs +200 -559
  77. package/dist/client/components/primitives/select-single.mjs +165 -499
  78. package/dist/client/components/primitives/time-input.mjs +43 -117
  79. package/dist/client/components/primitives/toggle-input.mjs +9 -29
  80. package/dist/client/components/sheets/resource-sheet.mjs +61 -70
  81. package/dist/client/components/ui/accordion.mjs +35 -155
  82. package/dist/client/components/ui/alert.mjs +13 -68
  83. package/dist/client/components/ui/badge.mjs +9 -51
  84. package/dist/client/components/ui/button.mjs +8 -54
  85. package/dist/client/components/ui/card.mjs +37 -193
  86. package/dist/client/components/ui/checkbox.mjs +12 -68
  87. package/dist/client/components/ui/command.mjs +48 -219
  88. package/dist/client/components/ui/dialog.mjs +50 -262
  89. package/dist/client/components/ui/drawer.mjs +55 -259
  90. package/dist/client/components/ui/dropdown-menu.mjs +86 -427
  91. package/dist/client/components/ui/empty-state.mjs +28 -98
  92. package/dist/client/components/ui/field.mjs +73 -309
  93. package/dist/client/components/ui/input-group.mjs +42 -167
  94. package/dist/client/components/ui/input.mjs +7 -37
  95. package/dist/client/components/ui/kbd.mjs +6 -36
  96. package/dist/client/components/ui/label.mjs +7 -37
  97. package/dist/client/components/ui/popover.mjs +34 -169
  98. package/dist/client/components/ui/responsive-dialog.mjs +67 -273
  99. package/dist/client/components/ui/scroll-fade.mjs +63 -158
  100. package/dist/client/components/ui/search-input.mjs +33 -100
  101. package/dist/client/components/ui/select.mjs +72 -393
  102. package/dist/client/components/ui/separator.mjs +7 -38
  103. package/dist/client/components/ui/sheet.mjs +49 -269
  104. package/dist/client/components/ui/sidebar.mjs +171 -690
  105. package/dist/client/components/ui/skeleton.mjs +7 -38
  106. package/dist/client/components/ui/sonner.mjs +11 -42
  107. package/dist/client/components/ui/switch.mjs +9 -45
  108. package/dist/client/components/ui/table.mjs +48 -266
  109. package/dist/client/components/ui/tabs.mjs +26 -139
  110. package/dist/client/components/ui/textarea.mjs +6 -32
  111. package/dist/client/components/ui/tooltip.mjs +27 -129
  112. package/dist/client/components/widgets/chart-widget.mjs +174 -522
  113. package/dist/client/components/widgets/progress-widget.mjs +66 -172
  114. package/dist/client/components/widgets/quick-actions-widget.mjs +102 -261
  115. package/dist/client/components/widgets/recent-items-widget.mjs +69 -195
  116. package/dist/client/components/widgets/stats-widget.mjs +41 -175
  117. package/dist/client/components/widgets/table-widget.mjs +9 -9
  118. package/dist/client/components/widgets/timeline-widget.mjs +86 -226
  119. package/dist/client/components/widgets/value-widget.mjs +74 -381
  120. package/dist/client/components/widgets/widget-empty-state.mjs +26 -76
  121. package/dist/client/components/widgets/widget-skeletons.mjs +138 -421
  122. package/dist/client/contexts/focus-context.d.mts +4 -0
  123. package/dist/client/contexts/focus-context.mjs +87 -150
  124. package/dist/client/hooks/typed-hooks.mjs +241 -701
  125. package/dist/client/hooks/use-action.mjs +62 -198
  126. package/dist/client/hooks/use-admin-config.mjs +5 -35
  127. package/dist/client/hooks/use-admin-preferences.mjs +16 -88
  128. package/dist/client/hooks/use-admin-routes.mjs +22 -56
  129. package/dist/client/hooks/use-audit-history.mjs +21 -69
  130. package/dist/client/hooks/use-brand.mjs +1 -9
  131. package/dist/client/hooks/use-collection-fields.mjs +17 -57
  132. package/dist/client/hooks/use-collection-meta.mjs +12 -44
  133. package/dist/client/hooks/use-collection-schema.mjs +10 -33
  134. package/dist/client/hooks/use-collection-validation.mjs +23 -53
  135. package/dist/client/hooks/use-collection.mjs +194 -614
  136. package/dist/client/hooks/use-current-user.mjs +0 -1
  137. package/dist/client/hooks/use-field-hooks.mjs +10 -10
  138. package/dist/client/hooks/use-field-options.mjs +61 -202
  139. package/dist/client/hooks/use-global-fields.mjs +14 -46
  140. package/dist/client/hooks/use-global-meta.mjs +9 -30
  141. package/dist/client/hooks/use-global-schema.mjs +9 -30
  142. package/dist/client/hooks/use-global.mjs +63 -219
  143. package/dist/client/hooks/use-locks.mjs +117 -325
  144. package/dist/client/hooks/use-media-query.mjs +16 -36
  145. package/dist/client/hooks/use-prefill-params.mjs +0 -1
  146. package/dist/client/hooks/use-questpie-query-options.mjs +12 -29
  147. package/dist/client/hooks/use-reactive-fields.mjs +1 -1
  148. package/dist/client/hooks/use-reactive-prop.mjs +65 -223
  149. package/dist/client/hooks/use-realtime-highlight.mjs +51 -114
  150. package/dist/client/hooks/use-saved-views.mjs +22 -103
  151. package/dist/client/hooks/use-search-param-toggle.mjs +28 -79
  152. package/dist/client/hooks/use-search.mjs +31 -143
  153. package/dist/client/hooks/use-server-actions.mjs +18 -50
  154. package/dist/client/hooks/use-server-validation.mjs +72 -166
  155. package/dist/client/hooks/use-server-widget-data.mjs +7 -33
  156. package/dist/client/hooks/use-setup-status.mjs +12 -25
  157. package/dist/client/hooks/use-sidebar-search-param.mjs +33 -78
  158. package/dist/client/hooks/use-transition-stage.mjs +8 -38
  159. package/dist/client/hooks/use-upload.mjs +54 -152
  160. package/dist/client/hooks/use-validation-error-map.mjs +6 -26
  161. package/dist/client/hooks/use-view-state.mjs +187 -437
  162. package/dist/client/i18n/hooks.mjs +65 -197
  163. package/dist/client/lib/render-profiler.mjs +14 -41
  164. package/dist/client/preview/block-scope-context.d.mts +2 -2
  165. package/dist/client/preview/block-scope-context.mjs +14 -36
  166. package/dist/client/preview/diff.mjs +110 -0
  167. package/dist/client/preview/preview-banner.mjs +42 -108
  168. package/dist/client/preview/preview-field.d.mts +4 -4
  169. package/dist/client/preview/preview-field.mjs +166 -409
  170. package/dist/client/preview/use-collection-preview.mjs +135 -201
  171. package/dist/client/runtime/content-locales-provider.mjs +31 -83
  172. package/dist/client/runtime/locale-scope.mjs +22 -63
  173. package/dist/client/runtime/provider.mjs +100 -255
  174. package/dist/client/runtime/translations-provider.mjs +41 -107
  175. package/dist/client/scope/picker.d.mts +2 -2
  176. package/dist/client/scope/picker.mjs +86 -321
  177. package/dist/client/scope/provider.d.mts +2 -2
  178. package/dist/client/scope/provider.mjs +8 -17
  179. package/dist/client/views/auth/accept-invite-form.d.mts +2 -2
  180. package/dist/client/views/auth/accept-invite-form.mjs +121 -412
  181. package/dist/client/views/auth/auth-layout.d.mts +3 -3
  182. package/dist/client/views/auth/auth-layout.mjs +104 -284
  183. package/dist/client/views/auth/forgot-password-form.d.mts +2 -2
  184. package/dist/client/views/auth/forgot-password-form.mjs +94 -325
  185. package/dist/client/views/auth/invite-form.mjs +107 -442
  186. package/dist/client/views/auth/login-form.d.mts +2 -2
  187. package/dist/client/views/auth/login-form.mjs +116 -337
  188. package/dist/client/views/auth/reset-password-form.mjs +128 -453
  189. package/dist/client/views/auth/setup-form.mjs +140 -478
  190. package/dist/client/views/collection/auto-form-fields.mjs +243 -615
  191. package/dist/client/views/collection/bulk-action-toolbar.mjs +212 -400
  192. package/dist/client/views/collection/cells/complex-cells.mjs +183 -611
  193. package/dist/client/views/collection/cells/primitive-cells.mjs +109 -363
  194. package/dist/client/views/collection/cells/relation-cells.mjs +86 -233
  195. package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +142 -371
  196. package/dist/client/views/collection/cells/shared/relation-chip.mjs +35 -131
  197. package/dist/client/views/collection/cells/upload-cells.mjs +60 -177
  198. package/dist/client/views/collection/columns/build-columns.mjs +8 -48
  199. package/dist/client/views/collection/field-renderer.mjs +11 -24
  200. package/dist/client/views/collection/form-view.mjs +288 -560
  201. package/dist/client/views/collection/table-view.mjs +239 -469
  202. package/dist/client/views/collection/view-skeletons.mjs +112 -237
  203. package/dist/client/views/common/global-search.mjs +241 -543
  204. package/dist/client/views/dashboard/dashboard-grid.mjs +256 -775
  205. package/dist/client/views/dashboard/dashboard-widget.mjs +38 -126
  206. package/dist/client/views/dashboard/widget-card.mjs +61 -269
  207. package/dist/client/views/globals/global-form-view.mjs +478 -1298
  208. package/dist/client/views/layout/admin-layout-provider.mjs +28 -88
  209. package/dist/client/views/layout/admin-layout.mjs +83 -246
  210. package/dist/client/views/layout/admin-router.mjs +457 -1289
  211. package/dist/client/views/layout/admin-sidebar.mjs +510 -1292
  212. package/dist/client/views/layout/admin-theme.mjs +30 -64
  213. package/dist/client/views/layout/admin-view-layout.mjs +40 -144
  214. package/dist/client/views/pages/accept-invite-page.mjs +95 -290
  215. package/dist/client/views/pages/dashboard-page.mjs +11 -57
  216. package/dist/client/views/pages/forgot-password-page.mjs +31 -83
  217. package/dist/client/views/pages/invite-page.mjs +35 -90
  218. package/dist/client/views/pages/login-page.mjs +41 -121
  219. package/dist/client/views/pages/reset-password-page.d.mts +2 -2
  220. package/dist/client/views/pages/reset-password-page.mjs +46 -173
  221. package/dist/client/views/pages/setup-page.d.mts +2 -2
  222. package/dist/client/views/pages/setup-page.mjs +33 -95
  223. package/dist/components/rich-text/rich-text-renderer.d.mts +2 -2
  224. package/dist/components/rich-text/rich-text-renderer.mjs +9 -33
  225. package/dist/server/modules/admin/collections/account.d.mts +50 -50
  226. package/dist/server/modules/admin/collections/admin-locks.d.mts +54 -54
  227. package/dist/server/modules/admin/collections/admin-preferences.d.mts +39 -39
  228. package/dist/server/modules/admin/collections/admin-saved-views.d.mts +47 -47
  229. package/dist/server/modules/admin/collections/apikey.d.mts +68 -68
  230. package/dist/server/modules/admin/collections/assets.d.mts +34 -34
  231. package/dist/server/modules/admin/collections/session.d.mts +42 -42
  232. package/dist/server/modules/admin/collections/user.d.mts +53 -53
  233. package/dist/server/modules/admin/collections/verification.d.mts +36 -36
  234. package/dist/server/modules/admin/index.d.mts +21 -20
  235. package/dist/server/modules/admin/routes/admin-config.d.mts +2 -2
  236. package/dist/server/modules/admin/routes/execute-action.d.mts +9 -9
  237. package/dist/server/modules/admin/routes/locales.d.mts +2 -2
  238. package/dist/server/modules/admin/routes/preview.d.mts +11 -11
  239. package/dist/server/modules/admin/routes/reactive.d.mts +9 -9
  240. package/dist/server/modules/admin/routes/setup.d.mts +7 -7
  241. package/dist/server/modules/admin/routes/translations.d.mts +4 -4
  242. package/dist/server/modules/admin/routes/widget-data.d.mts +5 -5
  243. package/dist/server/modules/admin-preferences/collections/saved-views.d.mts +27 -27
  244. package/package.json +3 -5
@@ -15,7 +15,6 @@ import { useCurrentUser, useSessionState } from "../../hooks/use-current-user.mj
15
15
  import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuItem, SidebarSeparator, SidebarTrigger, useSidebar } from "../../components/ui/sidebar.mjs";
16
16
  import { BrandLogoMark } from "../../components/brand-logo.mjs";
17
17
  import { getAdminPreferenceQueryKey, useAdminPreference, useSetAdminPreference } from "../../hooks/use-admin-preferences.mjs";
18
- import { c } from "react/compiler-runtime";
19
18
  import { Icon } from "@iconify/react";
20
19
  import * as React from "react";
21
20
  import { useQueryClient } from "@tanstack/react-query";
@@ -50,127 +49,91 @@ function getSidebarItemProps(item) {
50
49
  * only for page items (which are client-only).
51
50
  */
52
51
  function useServerNavigation() {
53
- const $ = c(6);
54
52
  const { data: serverConfig } = useAdminConfig();
55
- const storeNavigation = useAdminStore(_temp);
53
+ const storeNavigation = useAdminStore((s) => s.navigation);
56
54
  const basePath = useAdminStore(selectBasePath);
57
- let t0;
58
- bb0: {
55
+ return React.useMemo(() => {
59
56
  const sections = serverConfig?.sidebar?.sections;
60
- if (!sections?.length) {
61
- t0 = void 0;
62
- break bb0;
57
+ if (!sections?.length) return void 0;
58
+ const pageMap = /* @__PURE__ */ new Map();
59
+ for (const group of storeNavigation ?? []) for (const element of group.items ?? []) if (element.type !== "divider" && "id" in element) {
60
+ const navItem = element;
61
+ if (navItem.type === "page") pageMap.set(navItem.id, navItem);
63
62
  }
64
- let t1;
65
- if ($[0] !== basePath || $[1] !== sections || $[2] !== serverConfig?.collections || $[3] !== serverConfig?.globals || $[4] !== storeNavigation) {
66
- const pageMap = /* @__PURE__ */ new Map();
67
- for (const group of storeNavigation ?? []) for (const element of group.items ?? []) if (element.type !== "divider" && "id" in element) {
68
- const navItem = element;
69
- if (navItem.type === "page") pageMap.set(navItem.id, navItem);
70
- }
71
- const convertItem = function convertItem$1(item) {
72
- const props = getSidebarItemProps(item);
73
- switch (item.type) {
74
- case "collection": {
75
- const collectionName = props.collection;
76
- const meta_0 = serverConfig?.collections?.[collectionName];
77
- return {
78
- id: `collection:${collectionName}`,
79
- label: props.label ?? meta_0?.label ?? formatLabel(collectionName),
80
- href: `${basePath}/collections/${collectionName}`,
81
- icon: props.icon ?? meta_0?.icon,
82
- type: "collection",
83
- order: 0
84
- };
85
- }
86
- case "global": {
87
- const globalName = props.global;
88
- const meta = serverConfig?.globals?.[globalName];
89
- return {
90
- id: `global:${globalName}`,
91
- label: props.label ?? meta?.label ?? formatLabel(globalName),
92
- href: `${basePath}/globals/${globalName}`,
93
- icon: props.icon ?? meta?.icon,
94
- type: "global",
95
- order: 0
96
- };
97
- }
98
- case "page": {
99
- const found = pageMap.get(`page:${props.pageId}`);
100
- if (!found) return;
101
- return {
102
- ...found,
103
- label: props.label ?? found.label,
104
- icon: props.icon ?? found.icon
105
- };
106
- }
107
- case "link": return {
108
- id: `link:${props.href}`,
109
- label: props.label ?? "",
110
- href: props.href,
111
- icon: props.icon,
112
- type: "link",
63
+ function convertItem(item) {
64
+ const props = getSidebarItemProps(item);
65
+ switch (item.type) {
66
+ case "collection": {
67
+ const collectionName = props.collection;
68
+ const meta = serverConfig?.collections?.[collectionName];
69
+ return {
70
+ id: `collection:${collectionName}`,
71
+ label: props.label ?? meta?.label ?? formatLabel(collectionName),
72
+ href: `${basePath}/collections/${collectionName}`,
73
+ icon: props.icon ?? meta?.icon,
74
+ type: "collection",
113
75
  order: 0
114
76
  };
115
- case "divider": return { type: "divider" };
116
- default: return;
117
77
  }
118
- };
119
- function convertSection(section) {
120
- return {
121
- id: section.id,
122
- label: section.title,
123
- icon: section.icon,
124
- collapsible: section.collapsible,
125
- items: (section.items ?? []).map(convertItem).filter(_temp2),
126
- sections: section.sections?.map(convertSection)
78
+ case "global": {
79
+ const globalName = props.global;
80
+ const meta = serverConfig?.globals?.[globalName];
81
+ return {
82
+ id: `global:${globalName}`,
83
+ label: props.label ?? meta?.label ?? formatLabel(globalName),
84
+ href: `${basePath}/globals/${globalName}`,
85
+ icon: props.icon ?? meta?.icon,
86
+ type: "global",
87
+ order: 0
88
+ };
89
+ }
90
+ case "page": {
91
+ const found = pageMap.get(`page:${props.pageId}`);
92
+ if (!found) return void 0;
93
+ return {
94
+ ...found,
95
+ label: props.label ?? found.label,
96
+ icon: props.icon ?? found.icon
97
+ };
98
+ }
99
+ case "link": return {
100
+ id: `link:${props.href}`,
101
+ label: props.label ?? "",
102
+ href: props.href,
103
+ icon: props.icon,
104
+ type: "link",
105
+ order: 0
127
106
  };
107
+ case "divider": return { type: "divider" };
108
+ default: return;
128
109
  }
129
- t1 = sections.map(convertSection);
130
- $[0] = basePath;
131
- $[1] = sections;
132
- $[2] = serverConfig?.collections;
133
- $[3] = serverConfig?.globals;
134
- $[4] = storeNavigation;
135
- $[5] = t1;
136
- } else t1 = $[5];
137
- t0 = t1;
138
- }
139
- return t0;
140
- }
141
- function _temp2(i) {
142
- return i !== void 0;
143
- }
144
- function _temp(s) {
145
- return s.navigation;
110
+ }
111
+ function convertSection(section) {
112
+ return {
113
+ id: section.id,
114
+ label: section.title,
115
+ icon: section.icon,
116
+ collapsible: section.collapsible,
117
+ items: (section.items ?? []).map(convertItem).filter((i) => i !== void 0),
118
+ sections: section.sections?.map(convertSection)
119
+ };
120
+ }
121
+ return sections.map(convertSection);
122
+ }, [
123
+ serverConfig,
124
+ storeNavigation,
125
+ basePath
126
+ ]);
146
127
  }
147
128
  function useSidebarProps(props) {
148
- const $ = c(7);
149
- const storeNavigation = useAdminStore(_temp3);
150
- const storeBrandName = useAdminStore(_temp4);
151
- const storeBrandLogo = useAdminStore(_temp5);
152
- const serverNavigation = useServerNavigation();
153
- let t0;
154
- if ($[0] !== serverNavigation || $[1] !== storeNavigation) {
155
- t0 = serverNavigation ?? storeNavigation ?? [];
156
- $[0] = serverNavigation;
157
- $[1] = storeNavigation;
158
- $[2] = t0;
159
- } else t0 = $[2];
160
- const t1 = props.brandName ?? storeBrandName ?? "Admin";
161
- let t2;
162
- if ($[3] !== storeBrandLogo || $[4] !== t0 || $[5] !== t1) {
163
- t2 = {
164
- navigation: t0,
165
- brandName: t1,
166
- brandLogo: storeBrandLogo
167
- };
168
- $[3] = storeBrandLogo;
169
- $[4] = t0;
170
- $[5] = t1;
171
- $[6] = t2;
172
- } else t2 = $[6];
173
- return t2;
129
+ const storeNavigation = useAdminStore((s) => s.navigation);
130
+ const storeBrandName = useAdminStore((s) => s.brandName);
131
+ const storeBrandLogo = useAdminStore((s) => s.brandLogo);
132
+ return {
133
+ navigation: useServerNavigation() ?? storeNavigation ?? [],
134
+ brandName: props.brandName ?? storeBrandName ?? "Admin",
135
+ brandLogo: storeBrandLogo
136
+ };
174
137
  }
175
138
  /**
176
139
  * Render an icon - handles ComponentReference and React components.
@@ -184,15 +147,6 @@ function useSidebarProps(props) {
184
147
  * <RenderIcon icon={{ type: "icon", props: { name: "ph:users" } }} />
185
148
  * ```
186
149
  */
187
- function _temp5(s_1) {
188
- return s_1.brandLogo;
189
- }
190
- function _temp4(s_0) {
191
- return s_0.brandName;
192
- }
193
- function _temp3(s) {
194
- return s.navigation;
195
- }
196
150
  function areIconValuesEqual(a, b) {
197
151
  if (a === b) return true;
198
152
  if (!a || !b) return false;
@@ -211,100 +165,40 @@ function areIconValuesEqual(a, b) {
211
165
  return false;
212
166
  }
213
167
  const RenderIcon = React.memo(function RenderIcon$1(props) {
214
- const $ = c(10);
215
168
  const { icon, className } = props;
216
- let t0;
217
- if ($[0] !== className) {
218
- t0 = cn("size-4 shrink-0", className);
219
- $[0] = className;
220
- $[1] = t0;
221
- } else t0 = $[1];
222
- const mergedClassName = t0;
223
- let t1;
224
- if ($[2] !== mergedClassName) {
225
- t1 = { className: mergedClassName };
226
- $[2] = mergedClassName;
227
- $[3] = t1;
228
- } else t1 = $[3];
229
- const additionalProps = t1;
169
+ const mergedClassName = React.useMemo(() => cn("size-4 shrink-0", className), [className]);
170
+ const additionalProps = React.useMemo(() => ({ className: mergedClassName }), [mergedClassName]);
230
171
  if (!icon) return null;
231
- if (typeof icon === "object" && icon !== null && "type" in icon) {
232
- const t2$1 = icon;
233
- let t3;
234
- if ($[4] !== additionalProps || $[5] !== t2$1) {
235
- t3 = /* @__PURE__ */ jsx(ComponentRenderer, {
236
- reference: t2$1,
237
- additionalProps
238
- });
239
- $[4] = additionalProps;
240
- $[5] = t2$1;
241
- $[6] = t3;
242
- } else t3 = $[6];
243
- return t3;
244
- }
245
- const IconComp = icon;
246
- let t2;
247
- if ($[7] !== IconComp || $[8] !== mergedClassName) {
248
- t2 = /* @__PURE__ */ jsx(IconComp, { className: mergedClassName });
249
- $[7] = IconComp;
250
- $[8] = mergedClassName;
251
- $[9] = t2;
252
- } else t2 = $[9];
253
- return t2;
172
+ if (typeof icon === "object" && icon !== null && "type" in icon) return /* @__PURE__ */ jsx(ComponentRenderer, {
173
+ reference: icon,
174
+ additionalProps
175
+ });
176
+ return /* @__PURE__ */ jsx(icon, { className: mergedClassName });
254
177
  }, (prev, next) => {
255
178
  if (prev.className !== next.className) return false;
256
179
  return areIconValuesEqual(prev.icon, next.icon);
257
180
  });
258
- function QuestpieSymbol(t0) {
259
- const $ = c(7);
260
- const { className } = t0;
261
- let t1;
262
- if ($[0] !== className) {
263
- t1 = cn("size-6 shrink-0", className);
264
- $[0] = className;
265
- $[1] = t1;
266
- } else t1 = $[1];
267
- let t2;
268
- let t3;
269
- let t4;
270
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
271
- t2 = /* @__PURE__ */ jsx("title", { children: "QUESTPIE" });
272
- t3 = /* @__PURE__ */ jsx("path", {
273
- d: "M22 10V2H2V22H10",
274
- stroke: "currentColor",
275
- strokeWidth: "2",
276
- strokeLinecap: "square",
277
- className: "text-foreground"
278
- });
279
- t4 = /* @__PURE__ */ jsx("path", {
280
- d: "M23 13H13V23H23V13Z",
281
- fill: "#B700FF"
282
- });
283
- $[2] = t2;
284
- $[3] = t3;
285
- $[4] = t4;
286
- } else {
287
- t2 = $[2];
288
- t3 = $[3];
289
- t4 = $[4];
290
- }
291
- let t5;
292
- if ($[5] !== t1) {
293
- t5 = /* @__PURE__ */ jsxs("svg", {
294
- xmlns: "http://www.w3.org/2000/svg",
295
- viewBox: "0 0 24 24",
296
- fill: "none",
297
- className: t1,
298
- children: [
299
- t2,
300
- t3,
301
- t4
302
- ]
303
- });
304
- $[5] = t1;
305
- $[6] = t5;
306
- } else t5 = $[6];
307
- return t5;
181
+ function QuestpieSymbol({ className }) {
182
+ return /* @__PURE__ */ jsxs("svg", {
183
+ xmlns: "http://www.w3.org/2000/svg",
184
+ viewBox: "0 0 24 24",
185
+ fill: "none",
186
+ className: cn("size-6 shrink-0", className),
187
+ children: [
188
+ /* @__PURE__ */ jsx("title", { children: "QUESTPIE" }),
189
+ /* @__PURE__ */ jsx("path", {
190
+ d: "M22 10V2H2V22H10",
191
+ stroke: "currentColor",
192
+ strokeWidth: "2",
193
+ strokeLinecap: "square",
194
+ className: "text-foreground"
195
+ }),
196
+ /* @__PURE__ */ jsx("path", {
197
+ d: "M23 13H13V23H23V13Z",
198
+ fill: "#B700FF"
199
+ })
200
+ ]
201
+ });
308
202
  }
309
203
  /**
310
204
  * Check if element is a navigation item (not divider)
@@ -330,157 +224,63 @@ function isRouteActive(activeRoute, itemHref, basePath, exact = false) {
330
224
  */
331
225
  const menuButtonStyles = cn("item-surface font-chrome flex w-full items-center gap-2 px-2 py-2 text-[13px] font-medium transition-[background-color,color,border-color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] active:scale-[0.96] motion-reduce:transition-none motion-reduce:active:scale-100", "text-sidebar-foreground/75 hover:bg-sidebar-accent hover:text-sidebar-foreground", "focus-visible:ring-sidebar-ring focus-visible:ring-1 focus-visible:outline-none", "group-data-[collapsible=icon]:size-8 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:px-2");
332
226
  const menuButtonActiveStyles = cn("border-transparent bg-[var(--sidebar-active-background)] text-[var(--sidebar-active-foreground)]");
333
- function NavItem(t0) {
334
- const $ = c(45);
335
- const { item, isActive, LinkComponent, renderNavItem, useActiveProps, className, depth: t1 } = t0;
227
+ function NavItem({ item, isActive, LinkComponent, renderNavItem, useActiveProps, className, depth = 0 }) {
336
228
  const { state, isMobile, setOpenMobile } = useSidebar();
337
229
  const collapsed = state === "collapsed";
338
- const resolveText = useResolveText();
339
- let t2;
340
- if ($[0] !== item.label || $[1] !== resolveText) {
341
- t2 = resolveText(item.label);
342
- $[0] = item.label;
343
- $[1] = resolveText;
344
- $[2] = t2;
345
- } else t2 = $[2];
346
- const label = t2;
230
+ const label = useResolveText()(item.label);
347
231
  const shouldUseExact = item.type === "link" || item.type === "page";
348
- let t3;
349
- if ($[3] !== shouldUseExact || $[4] !== useActiveProps) {
350
- t3 = useActiveProps ? {
351
- activeProps: { className: menuButtonActiveStyles },
352
- activeOptions: { exact: shouldUseExact }
353
- } : {};
354
- $[3] = shouldUseExact;
355
- $[4] = useActiveProps;
356
- $[5] = t3;
357
- } else t3 = $[5];
358
- const linkActiveProps = t3;
232
+ const linkActiveProps = useActiveProps ? {
233
+ activeProps: { className: menuButtonActiveStyles },
234
+ activeOptions: { exact: shouldUseExact }
235
+ } : {};
359
236
  const ariaCurrent = isActive ? "page" : void 0;
360
- let t4;
361
- if ($[6] !== isMobile || $[7] !== setOpenMobile) {
362
- t4 = () => {
363
- if (isMobile) setOpenMobile(false);
364
- };
365
- $[6] = isMobile;
366
- $[7] = setOpenMobile;
367
- $[8] = t4;
368
- } else t4 = $[8];
369
- const handleClick = t4;
370
- const t5 = item.href;
371
- const t6 = collapsed ? label : void 0;
372
- const t7 = isActive && "qa-sidebar__nav-link--active";
373
- const t8 = isActive && menuButtonActiveStyles;
374
- let t9;
375
- if ($[9] !== t7 || $[10] !== t8) {
376
- t9 = cn("qa-sidebar__nav-link", menuButtonStyles, t7, t8);
377
- $[9] = t7;
378
- $[10] = t8;
379
- $[11] = t9;
380
- } else t9 = $[11];
381
- let t10;
382
- if ($[12] !== item.icon) {
383
- t10 = item.icon && /* @__PURE__ */ jsx(RenderIcon, {
237
+ const handleClick = React.useCallback(() => {
238
+ if (isMobile) setOpenMobile(false);
239
+ }, [isMobile, setOpenMobile]);
240
+ const linkContent = /* @__PURE__ */ jsxs(LinkComponent, {
241
+ to: item.href,
242
+ "aria-label": collapsed ? label : void 0,
243
+ className: cn("qa-sidebar__nav-link", menuButtonStyles, isActive && "qa-sidebar__nav-link--active", isActive && menuButtonActiveStyles),
244
+ ...linkActiveProps,
245
+ children: [item.icon && /* @__PURE__ */ jsx(RenderIcon, {
384
246
  icon: item.icon,
385
247
  className: "qa-sidebar__nav-icon"
386
- });
387
- $[12] = item.icon;
388
- $[13] = t10;
389
- } else t10 = $[13];
390
- let t11;
391
- if ($[14] !== label) {
392
- t11 = /* @__PURE__ */ jsx("span", {
248
+ }), /* @__PURE__ */ jsx("span", {
393
249
  className: "qa-sidebar__nav-label truncate group-data-[collapsible=icon]:hidden",
394
250
  children: label
395
- });
396
- $[14] = label;
397
- $[15] = t11;
398
- } else t11 = $[15];
399
- let t12;
400
- if ($[16] !== LinkComponent || $[17] !== item.href || $[18] !== linkActiveProps || $[19] !== t10 || $[20] !== t11 || $[21] !== t6 || $[22] !== t9) {
401
- t12 = /* @__PURE__ */ jsxs(LinkComponent, {
402
- to: t5,
403
- "aria-label": t6,
404
- className: t9,
251
+ })]
252
+ });
253
+ const builtInNavItem = collapsed && !isMobile ? /* @__PURE__ */ jsx(SidebarMenuItem, {
254
+ className: "qa-sidebar__nav-item",
255
+ onClickCapture: handleClick,
256
+ "aria-current": ariaCurrent,
257
+ children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs(LinkComponent, {
258
+ to: item.href,
259
+ className: cn("qa-sidebar__nav-link", menuButtonStyles, isActive && "qa-sidebar__nav-link--active", isActive && menuButtonActiveStyles),
405
260
  ...linkActiveProps,
406
- children: [t10, t11]
407
- });
408
- $[16] = LinkComponent;
409
- $[17] = item.href;
410
- $[18] = linkActiveProps;
411
- $[19] = t10;
412
- $[20] = t11;
413
- $[21] = t6;
414
- $[22] = t9;
415
- $[23] = t12;
416
- } else t12 = $[23];
417
- const linkContent = t12;
418
- let t13;
419
- if ($[24] !== LinkComponent || $[25] !== ariaCurrent || $[26] !== className || $[27] !== collapsed || $[28] !== handleClick || $[29] !== isActive || $[30] !== isMobile || $[31] !== item.href || $[32] !== item.icon || $[33] !== label || $[34] !== linkActiveProps || $[35] !== linkContent) {
420
- t13 = collapsed && !isMobile ? /* @__PURE__ */ jsx(SidebarMenuItem, {
421
- className: "qa-sidebar__nav-item",
422
- onClickCapture: handleClick,
423
- "aria-current": ariaCurrent,
424
- children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsxs(LinkComponent, {
425
- to: item.href,
426
- className: cn("qa-sidebar__nav-link", menuButtonStyles, isActive && "qa-sidebar__nav-link--active", isActive && menuButtonActiveStyles),
427
- ...linkActiveProps,
428
- children: [item.icon && /* @__PURE__ */ jsx(RenderIcon, { icon: item.icon }), /* @__PURE__ */ jsx("span", {
429
- className: "truncate group-data-[collapsible=icon]:hidden",
430
- children: label
431
- })]
432
- }) }), /* @__PURE__ */ jsx(TooltipContent, {
433
- side: "right",
434
- align: "center",
261
+ children: [item.icon && /* @__PURE__ */ jsx(RenderIcon, { icon: item.icon }), /* @__PURE__ */ jsx("span", {
262
+ className: "truncate group-data-[collapsible=icon]:hidden",
435
263
  children: label
436
- })] })
437
- }) : /* @__PURE__ */ jsx(SidebarMenuItem, {
438
- className: cn("qa-sidebar__nav-item", className),
439
- onClickCapture: handleClick,
440
- "aria-current": ariaCurrent,
441
- children: linkContent
442
- });
443
- $[24] = LinkComponent;
444
- $[25] = ariaCurrent;
445
- $[26] = className;
446
- $[27] = collapsed;
447
- $[28] = handleClick;
448
- $[29] = isActive;
449
- $[30] = isMobile;
450
- $[31] = item.href;
451
- $[32] = item.icon;
452
- $[33] = label;
453
- $[34] = linkActiveProps;
454
- $[35] = linkContent;
455
- $[36] = t13;
456
- } else t13 = $[36];
457
- const builtInNavItem = t13;
458
- if (renderNavItem) {
459
- let t14;
460
- if ($[37] !== collapsed || $[38] !== isActive || $[39] !== item || $[40] !== renderNavItem) {
461
- t14 = renderNavItem({
462
- item,
463
- isActive,
464
- collapsed
465
- });
466
- $[37] = collapsed;
467
- $[38] = isActive;
468
- $[39] = item;
469
- $[40] = renderNavItem;
470
- $[41] = t14;
471
- } else t14 = $[41];
472
- let t15;
473
- if ($[42] !== builtInNavItem || $[43] !== t14) {
474
- t15 = /* @__PURE__ */ jsx(React.Suspense, {
475
- fallback: builtInNavItem,
476
- children: t14
477
- });
478
- $[42] = builtInNavItem;
479
- $[43] = t14;
480
- $[44] = t15;
481
- } else t15 = $[44];
482
- return t15;
483
- }
264
+ })]
265
+ }) }), /* @__PURE__ */ jsx(TooltipContent, {
266
+ side: "right",
267
+ align: "center",
268
+ children: label
269
+ })] })
270
+ }) : /* @__PURE__ */ jsx(SidebarMenuItem, {
271
+ className: cn("qa-sidebar__nav-item", className),
272
+ onClickCapture: handleClick,
273
+ "aria-current": ariaCurrent,
274
+ children: linkContent
275
+ });
276
+ if (renderNavItem) return /* @__PURE__ */ jsx(React.Suspense, {
277
+ fallback: builtInNavItem,
278
+ children: renderNavItem({
279
+ item,
280
+ isActive,
281
+ collapsed
282
+ })
283
+ });
484
284
  return builtInNavItem;
485
285
  }
486
286
  const SIDEBAR_COLLAPSED_SECTIONS_KEY = "sidebar:collapsed-sections";
@@ -490,124 +290,70 @@ const SIDEBAR_COLLAPSED_SECTIONS_KEY = "sidebar:collapsed-sections";
490
290
  * Collapsible sections default to collapsed (true) when no preference is stored.
491
291
  */
492
292
  function useSidebarCollapsedSections() {
493
- const $ = c(13);
494
293
  const user = useCurrentUser();
495
294
  const queryClient = useQueryClient();
496
295
  const { data: stored, isLoading } = useAdminPreference(SIDEBAR_COLLAPSED_SECTIONS_KEY);
497
296
  const { mutate: persist } = useSetAdminPreference(SIDEBAR_COLLAPSED_SECTIONS_KEY);
498
- const t0 = user?.id;
499
- let t1;
500
- if ($[0] !== t0) {
501
- t1 = getAdminPreferenceQueryKey(t0, SIDEBAR_COLLAPSED_SECTIONS_KEY);
502
- $[0] = t0;
503
- $[1] = t1;
504
- } else t1 = $[1];
505
- const queryKey = t1;
506
- let t2;
507
- if ($[2] !== stored) {
508
- t2 = (sectionId, collapsible) => {
297
+ const queryKey = getAdminPreferenceQueryKey(user?.id, SIDEBAR_COLLAPSED_SECTIONS_KEY);
298
+ return {
299
+ isSectionCollapsed: React.useCallback((sectionId, collapsible) => {
509
300
  if (!collapsible || !sectionId) return false;
510
301
  return stored?.[sectionId] ?? false;
511
- };
512
- $[2] = stored;
513
- $[3] = t2;
514
- } else t2 = $[3];
515
- const isSectionCollapsed = t2;
516
- let t3;
517
- if ($[4] !== persist || $[5] !== queryClient || $[6] !== queryKey || $[7] !== stored) {
518
- t3 = (sectionId_0) => {
302
+ }, [stored]),
303
+ toggleSection: React.useCallback((sectionId) => {
519
304
  const current = stored ?? {};
520
- const isCurrentlyCollapsed = current[sectionId_0] ?? false;
305
+ const isCurrentlyCollapsed = current[sectionId] ?? false;
521
306
  const next = {
522
307
  ...current,
523
- [sectionId_0]: !isCurrentlyCollapsed
308
+ [sectionId]: !isCurrentlyCollapsed
524
309
  };
525
310
  queryClient.setQueryData(queryKey, next);
526
311
  persist(next);
527
- };
528
- $[4] = persist;
529
- $[5] = queryClient;
530
- $[6] = queryKey;
531
- $[7] = stored;
532
- $[8] = t3;
533
- } else t3 = $[8];
534
- const toggleSection = t3;
535
- let t4;
536
- if ($[9] !== isLoading || $[10] !== isSectionCollapsed || $[11] !== toggleSection) {
537
- t4 = {
538
- isSectionCollapsed,
539
- toggleSection,
540
- isLoading
541
- };
542
- $[9] = isLoading;
543
- $[10] = isSectionCollapsed;
544
- $[11] = toggleSection;
545
- $[12] = t4;
546
- } else t4 = $[12];
547
- return t4;
312
+ }, [
313
+ stored,
314
+ queryClient,
315
+ queryKey,
316
+ persist
317
+ ]),
318
+ isLoading
319
+ };
548
320
  }
549
- function NavGroup(t0) {
550
- const $ = c(26);
551
- const { group, activeRoute, LinkComponent, renderNavItem, basePath, useActiveProps, isSectionCollapsed, toggleSection, depth: t1 } = t0;
552
- const depth = t1 === void 0 ? 0 : t1;
321
+ function NavGroup({ group, activeRoute, LinkComponent, renderNavItem, basePath, useActiveProps, isSectionCollapsed, toggleSection, depth = 0 }) {
553
322
  const isCollapsed = isSectionCollapsed(group.id, group.collapsible);
554
- const resolveText = useResolveText();
555
- let t2;
556
- if ($[0] !== group.label || $[1] !== resolveText) {
557
- t2 = resolveText(group.label);
558
- $[0] = group.label;
559
- $[1] = resolveText;
560
- $[2] = t2;
561
- } else t2 = $[2];
562
- const groupLabel = t2;
563
- let t3;
564
- if ($[3] !== group.items) {
565
- t3 = group.items ?? [];
566
- $[3] = group.items;
567
- $[4] = t3;
568
- } else t3 = $[4];
569
- const items = t3;
570
- let t4;
571
- if ($[5] !== group.sections) {
572
- t4 = group.sections ?? [];
573
- $[5] = group.sections;
574
- $[6] = t4;
575
- } else t4 = $[6];
576
- const sections = t4;
323
+ const groupLabel = useResolveText()(group.label);
324
+ const items = group.items ?? [];
325
+ const sections = group.sections ?? [];
577
326
  const hasContent = items.length > 0 || sections.length > 0;
578
- const T0 = SidebarGroup;
579
- const t5 = "qa-sidebar__group";
580
- const t6 = groupLabel && /* @__PURE__ */ jsxs(SidebarGroupLabel, {
581
- className: cn("qa-sidebar__group-label mt-2 gap-2 px-3", group.collapsible && "hover:text-sidebar-foreground cursor-pointer", depth > 0 && "pl-6"),
582
- role: group.collapsible ? "button" : void 0,
583
- tabIndex: group.collapsible ? 0 : void 0,
584
- "aria-expanded": group.collapsible ? !isCollapsed : void 0,
585
- onClick: group.collapsible && group.id ? () => toggleSection(group.id) : void 0,
586
- onKeyDown: group.collapsible && group.id ? (e) => {
587
- if (e.key === "Enter" || e.key === " ") {
588
- e.preventDefault();
589
- toggleSection(group.id);
590
- }
591
- } : void 0,
592
- children: [
593
- group.icon && /* @__PURE__ */ jsx(RenderIcon, {
594
- icon: group.icon,
595
- className: "size-3.5"
596
- }),
597
- /* @__PURE__ */ jsx("span", {
598
- className: "flex-1 text-left",
599
- children: groupLabel
600
- }),
601
- group.collapsible && /* @__PURE__ */ jsx(Icon, {
602
- icon: "ph:caret-down",
603
- className: cn("size-3.5 transition-transform", isCollapsed && "-rotate-90"),
604
- "aria-hidden": "true"
605
- })
606
- ]
607
- });
608
- let t7;
609
- if ($[7] !== LinkComponent || $[8] !== activeRoute || $[9] !== basePath || $[10] !== depth || $[11] !== group.id || $[12] !== groupLabel || $[13] !== hasContent || $[14] !== isCollapsed || $[15] !== isSectionCollapsed || $[16] !== items || $[17] !== renderNavItem || $[18] !== sections || $[19] !== toggleSection || $[20] !== useActiveProps) {
610
- t7 = !isCollapsed && hasContent && /* @__PURE__ */ jsxs(SidebarGroupContent, {
327
+ return /* @__PURE__ */ jsxs(SidebarGroup, {
328
+ className: "qa-sidebar__group",
329
+ children: [groupLabel && /* @__PURE__ */ jsxs(SidebarGroupLabel, {
330
+ className: cn("qa-sidebar__group-label mt-2 gap-2 px-3", group.collapsible && "hover:text-sidebar-foreground cursor-pointer", depth > 0 && "pl-6"),
331
+ role: group.collapsible ? "button" : void 0,
332
+ tabIndex: group.collapsible ? 0 : void 0,
333
+ "aria-expanded": group.collapsible ? !isCollapsed : void 0,
334
+ onClick: group.collapsible && group.id ? () => toggleSection(group.id) : void 0,
335
+ onKeyDown: group.collapsible && group.id ? (e) => {
336
+ if (e.key === "Enter" || e.key === " ") {
337
+ e.preventDefault();
338
+ toggleSection(group.id);
339
+ }
340
+ } : void 0,
341
+ children: [
342
+ group.icon && /* @__PURE__ */ jsx(RenderIcon, {
343
+ icon: group.icon,
344
+ className: "size-3.5"
345
+ }),
346
+ /* @__PURE__ */ jsx("span", {
347
+ className: "flex-1 text-left",
348
+ children: groupLabel
349
+ }),
350
+ group.collapsible && /* @__PURE__ */ jsx(Icon, {
351
+ icon: "ph:caret-down",
352
+ className: cn("size-3.5 transition-transform", isCollapsed && "-rotate-90"),
353
+ "aria-hidden": "true"
354
+ })
355
+ ]
356
+ }), !isCollapsed && hasContent && /* @__PURE__ */ jsxs(SidebarGroupContent, {
611
357
  className: cn(depth > 0 && "pl-3"),
612
358
  children: [items.length > 0 && /* @__PURE__ */ jsx(SidebarMenu, { children: items.map((element, elementIndex) => {
613
359
  if (!isNavigationItem(element)) return /* @__PURE__ */ jsx(SidebarSeparator, { className: "my-2" }, `${group.id ?? groupLabel ?? "group"}-divider-${elementIndex}`);
@@ -631,88 +377,31 @@ function NavGroup(t0) {
631
377
  toggleSection,
632
378
  depth: depth + 1
633
379
  }, subSection.id))]
634
- });
635
- $[7] = LinkComponent;
636
- $[8] = activeRoute;
637
- $[9] = basePath;
638
- $[10] = depth;
639
- $[11] = group.id;
640
- $[12] = groupLabel;
641
- $[13] = hasContent;
642
- $[14] = isCollapsed;
643
- $[15] = isSectionCollapsed;
644
- $[16] = items;
645
- $[17] = renderNavItem;
646
- $[18] = sections;
647
- $[19] = toggleSection;
648
- $[20] = useActiveProps;
649
- $[21] = t7;
650
- } else t7 = $[21];
651
- let t8;
652
- if ($[22] !== T0 || $[23] !== t6 || $[24] !== t7) {
653
- t8 = /* @__PURE__ */ jsxs(T0, {
654
- className: t5,
655
- children: [t6, t7]
656
- });
657
- $[22] = T0;
658
- $[23] = t6;
659
- $[24] = t7;
660
- $[25] = t8;
661
- } else t8 = $[25];
662
- return t8;
380
+ })]
381
+ });
663
382
  }
664
383
  /**
665
384
  * Loading skeleton for UserFooter
666
385
  */
667
- function UserFooterSkeleton(t0) {
668
- const $ = c(8);
669
- const { collapsed } = t0;
670
- const t1 = collapsed && "justify-center";
671
- let t2;
672
- if ($[0] !== t1) {
673
- t2 = cn("item-surface border-sidebar-border/40 flex items-center gap-2.5 p-2", t1);
674
- $[0] = t1;
675
- $[1] = t2;
676
- } else t2 = $[1];
677
- let t3;
678
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
679
- t3 = /* @__PURE__ */ jsx(Skeleton, { className: "size-8 shrink-0" });
680
- $[2] = t3;
681
- } else t3 = $[2];
682
- let t4;
683
- if ($[3] !== collapsed) {
684
- t4 = !collapsed && /* @__PURE__ */ jsxs("div", {
685
- className: "grid flex-1 gap-1",
686
- children: [/* @__PURE__ */ jsx(Skeleton, {
687
- variant: "text",
688
- className: "h-3 w-24"
689
- }), /* @__PURE__ */ jsx(Skeleton, {
690
- variant: "text",
691
- className: "h-2 w-32"
386
+ function UserFooterSkeleton({ collapsed }) {
387
+ return /* @__PURE__ */ jsx(SidebarFooter, {
388
+ className: "border-sidebar-border border-t p-2",
389
+ children: /* @__PURE__ */ jsxs("div", {
390
+ className: cn("item-surface border-sidebar-border/40 flex items-center gap-2.5 p-2", collapsed && "justify-center"),
391
+ children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-8 shrink-0" }), !collapsed && /* @__PURE__ */ jsxs("div", {
392
+ className: "grid flex-1 gap-1",
393
+ children: [/* @__PURE__ */ jsx(Skeleton, {
394
+ variant: "text",
395
+ className: "h-3 w-24"
396
+ }), /* @__PURE__ */ jsx(Skeleton, {
397
+ variant: "text",
398
+ className: "h-2 w-32"
399
+ })]
692
400
  })]
693
- });
694
- $[3] = collapsed;
695
- $[4] = t4;
696
- } else t4 = $[4];
697
- let t5;
698
- if ($[5] !== t2 || $[6] !== t4) {
699
- t5 = /* @__PURE__ */ jsx(SidebarFooter, {
700
- className: "border-sidebar-border border-t p-2",
701
- children: /* @__PURE__ */ jsxs("div", {
702
- className: t2,
703
- children: [t3, t4]
704
- })
705
- });
706
- $[5] = t2;
707
- $[6] = t4;
708
- $[7] = t5;
709
- } else t5 = $[7];
710
- return t5;
401
+ })
402
+ });
711
403
  }
712
- function UserFooter(t0) {
713
- const $ = c(109);
714
- const { theme: t1, setTheme, showThemeToggle } = t0;
715
- const theme = t1 === void 0 ? "system" : t1;
404
+ function UserFooter({ theme = "system", setTheme, showThemeToggle }) {
716
405
  const { state, isMobile, setOpenMobile } = useSidebar();
717
406
  const collapsed = state === "collapsed";
718
407
  const authClient = useAuthClientSafe();
@@ -725,454 +414,198 @@ function UserFooter(t0) {
725
414
  const localeConfig = admin.getLocale();
726
415
  const uiLocales = i18nAdapter?.locales ?? localeConfig.supported ?? ["en"];
727
416
  const hasMultipleUiLocales = uiLocales.length > 1;
728
- let t2;
729
- if ($[0] !== getLocaleName) {
730
- t2 = (code) => ({
731
- code,
732
- label: getLocaleName(code)
733
- });
734
- $[0] = getLocaleName;
735
- $[1] = t2;
736
- } else t2 = $[1];
737
- const uiLocaleOptions = uiLocales.map(t2);
417
+ const uiLocaleOptions = uiLocales.map((code) => ({
418
+ code,
419
+ label: getLocaleName(code)
420
+ }));
738
421
  const contentLocales = useSafeContentLocales();
739
422
  const contentLocale = useAdminStore(selectContentLocale);
740
423
  const setContentLocale = useAdminStore(selectSetContentLocale);
741
424
  const hasMultipleContentLocales = (contentLocales?.locales?.length ?? 0) > 1;
742
425
  const shouldShowThemeToggle = !!setTheme && showThemeToggle !== false;
743
- let t3;
744
- if ($[2] !== t) {
745
- t3 = t("ui.themeLight");
746
- $[2] = t;
747
- $[3] = t3;
748
- } else t3 = $[3];
749
- let t4;
750
- if ($[4] !== t3) {
751
- t4 = {
426
+ const themeOptions = [
427
+ {
752
428
  value: "light",
753
- label: t3,
429
+ label: t("ui.themeLight"),
754
430
  icon: "ph:sun"
755
- };
756
- $[4] = t3;
757
- $[5] = t4;
758
- } else t4 = $[5];
759
- let t5;
760
- if ($[6] !== t) {
761
- t5 = t("ui.themeDark");
762
- $[6] = t;
763
- $[7] = t5;
764
- } else t5 = $[7];
765
- let t6;
766
- if ($[8] !== t5) {
767
- t6 = {
431
+ },
432
+ {
768
433
  value: "dark",
769
- label: t5,
434
+ label: t("ui.themeDark"),
770
435
  icon: "ph:moon"
771
- };
772
- $[8] = t5;
773
- $[9] = t6;
774
- } else t6 = $[9];
775
- let t7;
776
- if ($[10] !== t) {
777
- t7 = t("ui.themeSystem");
778
- $[10] = t;
779
- $[11] = t7;
780
- } else t7 = $[11];
781
- let t8;
782
- if ($[12] !== t7) {
783
- t8 = {
436
+ },
437
+ {
784
438
  value: "system",
785
- label: t7,
439
+ label: t("ui.themeSystem"),
786
440
  icon: "ph:monitor"
787
- };
788
- $[12] = t7;
789
- $[13] = t8;
790
- } else t8 = $[13];
791
- let t9;
792
- if ($[14] !== t4 || $[15] !== t6 || $[16] !== t8) {
793
- t9 = [
794
- t4,
795
- t6,
796
- t8
797
- ];
798
- $[14] = t4;
799
- $[15] = t6;
800
- $[16] = t8;
801
- $[17] = t9;
802
- } else t9 = $[17];
803
- const themeOptions = t9;
804
- let t10;
805
- if ($[18] !== isMobile || $[19] !== setOpenMobile) {
806
- t10 = () => {
807
- if (isMobile) setOpenMobile(false);
808
- };
809
- $[18] = isMobile;
810
- $[19] = setOpenMobile;
811
- $[20] = t10;
812
- } else t10 = $[20];
813
- const closeSidebarOnMobile = t10;
814
- let t11;
815
- if ($[21] !== authClient || $[22] !== basePath || $[23] !== closeSidebarOnMobile || $[24] !== navigate || $[25] !== t) {
816
- t11 = async () => {
817
- if (!authClient) return;
818
- try {
819
- await authClient.signOut();
820
- closeSidebarOnMobile();
821
- navigate(`${basePath}/login`);
822
- } catch (t12$1) {
823
- toast.error(t("auth.logoutFailed"));
824
- }
825
- };
826
- $[21] = authClient;
827
- $[22] = basePath;
828
- $[23] = closeSidebarOnMobile;
829
- $[24] = navigate;
830
- $[25] = t;
831
- $[26] = t11;
832
- } else t11 = $[26];
833
- const handleLogout = t11;
834
- let t12;
835
- if ($[27] !== basePath || $[28] !== closeSidebarOnMobile || $[29] !== navigate || $[30] !== user) {
836
- t12 = () => {
837
- if (user?.id) {
838
- closeSidebarOnMobile();
839
- navigate(`${basePath}/collections/user/${user.id}`);
840
- }
841
- };
842
- $[27] = basePath;
843
- $[28] = closeSidebarOnMobile;
844
- $[29] = navigate;
845
- $[30] = user;
846
- $[31] = t12;
847
- } else t12 = $[31];
848
- const handleMyAccount = t12;
849
- if (isPending) {
850
- let t13$1;
851
- if ($[32] !== collapsed) {
852
- t13$1 = /* @__PURE__ */ jsx(UserFooterSkeleton, { collapsed });
853
- $[32] = collapsed;
854
- $[33] = t13$1;
855
- } else t13$1 = $[33];
856
- return t13$1;
857
- }
441
+ }
442
+ ];
443
+ const closeSidebarOnMobile = React.useCallback(() => {
444
+ if (isMobile) setOpenMobile(false);
445
+ }, [isMobile, setOpenMobile]);
446
+ const handleLogout = React.useCallback(async () => {
447
+ if (!authClient) return;
448
+ try {
449
+ await authClient.signOut();
450
+ closeSidebarOnMobile();
451
+ navigate(`${basePath}/login`);
452
+ } catch (error) {
453
+ toast.error(t("auth.logoutFailed"));
454
+ }
455
+ }, [
456
+ authClient,
457
+ navigate,
458
+ basePath,
459
+ closeSidebarOnMobile,
460
+ t
461
+ ]);
462
+ const handleMyAccount = () => {
463
+ if (user?.id) {
464
+ closeSidebarOnMobile();
465
+ navigate(`${basePath}/collections/user/${user.id}`);
466
+ }
467
+ };
468
+ if (isPending) return /* @__PURE__ */ jsx(UserFooterSkeleton, { collapsed });
858
469
  if (!authClient || !user) return null;
859
- let t13;
860
- if ($[34] !== user.email || $[35] !== user.name) {
861
- t13 = user.name || user.email?.split("@")[0] || "User";
862
- $[34] = user.email;
863
- $[35] = user.name;
864
- $[36] = t13;
865
- } else t13 = $[36];
866
- const displayName = t13;
470
+ const displayName = user.name || user.email?.split("@")[0] || "User";
867
471
  const displayEmail = user.email || "";
868
- const T0 = SidebarFooter;
869
- const t14 = "qa-sidebar__footer border-sidebar-border/70 border-t p-2";
870
- const T1 = SidebarMenu;
871
- const T2 = SidebarMenuItem;
872
- const T3 = DropdownMenu;
873
- const t15 = collapsed && "justify-center";
874
- let t16;
875
- if ($[37] !== t15) {
876
- t16 = cn("qa-sidebar__user-trigger flex w-full items-center gap-2.5 rounded-md p-2 text-left transition-[background-color,color,transform] duration-150 ease-out active:scale-[0.96]", "hover:bg-sidebar-accent text-sidebar-foreground", "focus-visible:ring-sidebar-ring focus-visible:ring-1 focus-visible:outline-none", t15);
877
- $[37] = t15;
878
- $[38] = t16;
879
- } else t16 = $[38];
880
- let t17;
881
- if ($[39] !== user.image) {
882
- t17 = /* @__PURE__ */ jsx("div", {
883
- className: "qa-sidebar__user-avatar border-sidebar-border bg-sidebar-accent text-sidebar-accent-foreground flex size-8 shrink-0 items-center justify-center rounded-md border",
884
- children: user.image ? /* @__PURE__ */ jsx("img", {
885
- src: user.image,
886
- alt: "",
887
- className: "image-outline size-full rounded-md object-cover"
888
- }) : /* @__PURE__ */ jsx(Icon, {
889
- icon: "ph:user-bold",
890
- className: "size-4"
891
- })
892
- });
893
- $[39] = user.image;
894
- $[40] = t17;
895
- } else t17 = $[40];
896
- let t18;
897
- if ($[41] !== collapsed || $[42] !== displayEmail || $[43] !== displayName) {
898
- t18 = !collapsed && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
899
- className: "grid flex-1 text-left leading-tight",
900
- children: [/* @__PURE__ */ jsx("span", {
901
- className: "qa-sidebar__user-name truncate text-sm font-medium",
902
- children: displayName
903
- }), /* @__PURE__ */ jsx("span", {
904
- className: "qa-sidebar__user-email text-sidebar-foreground/55 truncate text-xs",
905
- children: displayEmail
906
- })]
907
- }), /* @__PURE__ */ jsx(Icon, {
908
- icon: "ph:caret-up-down",
909
- className: "text-sidebar-foreground/60 ml-auto size-3.5",
910
- "aria-hidden": "true"
911
- })] });
912
- $[41] = collapsed;
913
- $[42] = displayEmail;
914
- $[43] = displayName;
915
- $[44] = t18;
916
- } else t18 = $[44];
917
- let t19;
918
- if ($[45] !== t16 || $[46] !== t17 || $[47] !== t18) {
919
- t19 = /* @__PURE__ */ jsxs(DropdownMenuTrigger, {
920
- className: t16,
921
- children: [t17, t18]
922
- });
923
- $[45] = t16;
924
- $[46] = t17;
925
- $[47] = t18;
926
- $[48] = t19;
927
- } else t19 = $[48];
928
- const T4 = DropdownMenuContent;
929
- const t20 = collapsed ? "right" : "top";
930
- const t21 = collapsed ? "start" : "start";
931
- const t22 = "w-56";
932
- let t23;
933
- if ($[49] !== displayName) {
934
- t23 = /* @__PURE__ */ jsx("p", {
935
- className: "text-sm font-medium",
936
- children: displayName
937
- });
938
- $[49] = displayName;
939
- $[50] = t23;
940
- } else t23 = $[50];
941
- let t24;
942
- if ($[51] !== displayEmail) {
943
- t24 = /* @__PURE__ */ jsx("p", {
944
- className: "text-muted-foreground text-xs",
945
- children: displayEmail
946
- });
947
- $[51] = displayEmail;
948
- $[52] = t24;
949
- } else t24 = $[52];
950
- let t25;
951
- if ($[53] !== user.role) {
952
- t25 = user.role && /* @__PURE__ */ jsx("p", {
953
- className: "text-muted-foreground mt-0.5 text-xs capitalize",
954
- children: user.role
955
- });
956
- $[53] = user.role;
957
- $[54] = t25;
958
- } else t25 = $[54];
959
- let t26;
960
- if ($[55] !== t23 || $[56] !== t24 || $[57] !== t25) {
961
- t26 = /* @__PURE__ */ jsxs("div", {
962
- className: "px-2 py-1.5",
963
- children: [
964
- t23,
965
- t24,
966
- t25
967
- ]
968
- });
969
- $[55] = t23;
970
- $[56] = t24;
971
- $[57] = t25;
972
- $[58] = t26;
973
- } else t26 = $[58];
974
- let t27;
975
- if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
976
- t27 = /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
977
- $[59] = t27;
978
- } else t27 = $[59];
979
- let t28;
980
- if ($[60] === Symbol.for("react.memo_cache_sentinel")) {
981
- t28 = /* @__PURE__ */ jsx(Icon, {
982
- icon: "ph:user-circle",
983
- className: "size-4"
984
- });
985
- $[60] = t28;
986
- } else t28 = $[60];
987
- let t29;
988
- if ($[61] !== t) {
989
- t29 = t("auth.myAccount");
990
- $[61] = t;
991
- $[62] = t29;
992
- } else t29 = $[62];
993
- let t30;
994
- if ($[63] !== handleMyAccount || $[64] !== t29) {
995
- t30 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
996
- onClick: handleMyAccount,
997
- children: [t28, t29]
998
- });
999
- $[63] = handleMyAccount;
1000
- $[64] = t29;
1001
- $[65] = t30;
1002
- } else t30 = $[65];
1003
- let t31;
1004
- if ($[66] !== setTheme || $[67] !== shouldShowThemeToggle || $[68] !== t || $[69] !== theme || $[70] !== themeOptions) {
1005
- t31 = shouldShowThemeToggle && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:circle-half" }), t("ui.toggleTheme")] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: themeOptions.map((option) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
1006
- onClick: () => setTheme(option.value),
1007
- children: [
1008
- /* @__PURE__ */ jsx(Icon, {
1009
- icon: option.icon,
472
+ return /* @__PURE__ */ jsx(SidebarFooter, {
473
+ className: "qa-sidebar__footer border-sidebar-border/70 border-t p-2",
474
+ children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsxs(DropdownMenuTrigger, {
475
+ className: cn("qa-sidebar__user-trigger flex w-full items-center gap-2.5 rounded-md p-2 text-left transition-[background-color,color,transform] duration-150 ease-out active:scale-[0.96]", "hover:bg-sidebar-accent text-sidebar-foreground", "focus-visible:ring-sidebar-ring focus-visible:ring-1 focus-visible:outline-none", collapsed && "justify-center"),
476
+ children: [/* @__PURE__ */ jsx("div", {
477
+ className: "qa-sidebar__user-avatar border-sidebar-border bg-sidebar-accent text-sidebar-accent-foreground flex size-8 shrink-0 items-center justify-center rounded-md border",
478
+ children: user.image ? /* @__PURE__ */ jsx("img", {
479
+ src: user.image,
480
+ alt: "",
481
+ className: "image-outline size-full rounded-md object-cover"
482
+ }) : /* @__PURE__ */ jsx(Icon, {
483
+ icon: "ph:user-bold",
1010
484
  className: "size-4"
1011
- }),
1012
- /* @__PURE__ */ jsx("span", {
1013
- className: "flex-1",
1014
- children: option.label
1015
- }),
1016
- theme === option.value && /* @__PURE__ */ jsx(Icon, {
1017
- icon: "ph:check",
1018
- className: "text-foreground size-4"
1019
485
  })
1020
- ]
1021
- }, option.value)) })] });
1022
- $[66] = setTheme;
1023
- $[67] = shouldShowThemeToggle;
1024
- $[68] = t;
1025
- $[69] = theme;
1026
- $[70] = themeOptions;
1027
- $[71] = t31;
1028
- } else t31 = $[71];
1029
- const t32 = hasMultipleUiLocales && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:globe" }), t("locale.uiLanguage")] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: uiLocaleOptions.map((locale) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
1030
- onClick: () => setUiLocale(locale.code),
1031
- children: [
1032
- /* @__PURE__ */ jsx("img", {
1033
- src: getFlagUrl(locale.code),
1034
- alt: locale.code,
1035
- className: "image-outline h-3 w-4 object-cover",
1036
- onError: _temp6
1037
- }),
1038
- /* @__PURE__ */ jsx("span", {
1039
- className: "font-chrome chrome-meta w-6 text-xs font-medium",
1040
- children: locale.code
1041
- }),
1042
- /* @__PURE__ */ jsx("span", {
1043
- className: "flex-1",
1044
- children: locale.label
1045
- }),
1046
- locale.code === uiLocale && /* @__PURE__ */ jsx(Icon, {
1047
- icon: "ph:check",
1048
- className: "text-foreground size-4"
1049
- })
1050
- ]
1051
- }, locale.code)) })] });
1052
- let t33;
1053
- if ($[72] !== contentLocale || $[73] !== contentLocales || $[74] !== hasMultipleContentLocales || $[75] !== setContentLocale || $[76] !== t) {
1054
- t33 = hasMultipleContentLocales && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:translate" }), t("locale.contentLanguage")] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: contentLocales.locales.map((locale_0) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
1055
- onClick: () => setContentLocale(locale_0.code),
486
+ }), !collapsed && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
487
+ className: "grid flex-1 text-left leading-tight",
488
+ children: [/* @__PURE__ */ jsx("span", {
489
+ className: "qa-sidebar__user-name truncate text-sm font-medium",
490
+ children: displayName
491
+ }), /* @__PURE__ */ jsx("span", {
492
+ className: "qa-sidebar__user-email text-sidebar-foreground/55 truncate text-xs",
493
+ children: displayEmail
494
+ })]
495
+ }), /* @__PURE__ */ jsx(Icon, {
496
+ icon: "ph:caret-up-down",
497
+ className: "text-sidebar-foreground/60 ml-auto size-3.5",
498
+ "aria-hidden": "true"
499
+ })] })]
500
+ }), /* @__PURE__ */ jsxs(DropdownMenuContent, {
501
+ side: collapsed ? "right" : "top",
502
+ align: collapsed ? "start" : "start",
503
+ className: "w-56",
1056
504
  children: [
1057
- /* @__PURE__ */ jsx("img", {
1058
- src: getFlagUrl(locale_0.flagCountryCode ?? locale_0.code),
1059
- alt: locale_0.code,
1060
- className: "image-outline h-3 w-4 object-cover",
1061
- onError: _temp7
505
+ /* @__PURE__ */ jsxs("div", {
506
+ className: "px-2 py-1.5",
507
+ children: [
508
+ /* @__PURE__ */ jsx("p", {
509
+ className: "text-sm font-medium",
510
+ children: displayName
511
+ }),
512
+ /* @__PURE__ */ jsx("p", {
513
+ className: "text-muted-foreground text-xs",
514
+ children: displayEmail
515
+ }),
516
+ user.role && /* @__PURE__ */ jsx("p", {
517
+ className: "text-muted-foreground mt-0.5 text-xs capitalize",
518
+ children: user.role
519
+ })
520
+ ]
1062
521
  }),
1063
- /* @__PURE__ */ jsx("span", {
1064
- className: "font-chrome chrome-meta w-6 text-xs font-medium",
1065
- children: locale_0.code
1066
- }),
1067
- /* @__PURE__ */ jsx("span", {
1068
- className: "flex-1",
1069
- children: locale_0.label ?? locale_0.code
522
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
523
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
524
+ onClick: handleMyAccount,
525
+ children: [/* @__PURE__ */ jsx(Icon, {
526
+ icon: "ph:user-circle",
527
+ className: "size-4"
528
+ }), t("auth.myAccount")]
1070
529
  }),
1071
- locale_0.code === contentLocale && /* @__PURE__ */ jsx(Icon, {
1072
- icon: "ph:check",
1073
- className: "text-foreground size-4"
530
+ shouldShowThemeToggle && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:circle-half" }), t("ui.toggleTheme")] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: themeOptions.map((option) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
531
+ onClick: () => setTheme(option.value),
532
+ children: [
533
+ /* @__PURE__ */ jsx(Icon, {
534
+ icon: option.icon,
535
+ className: "size-4"
536
+ }),
537
+ /* @__PURE__ */ jsx("span", {
538
+ className: "flex-1",
539
+ children: option.label
540
+ }),
541
+ theme === option.value && /* @__PURE__ */ jsx(Icon, {
542
+ icon: "ph:check",
543
+ className: "text-foreground size-4"
544
+ })
545
+ ]
546
+ }, option.value)) })] }),
547
+ hasMultipleUiLocales && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:globe" }), t("locale.uiLanguage")] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: uiLocaleOptions.map((locale) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
548
+ onClick: () => setUiLocale(locale.code),
549
+ children: [
550
+ /* @__PURE__ */ jsx("img", {
551
+ src: getFlagUrl(locale.code),
552
+ alt: locale.code,
553
+ className: "image-outline h-3 w-4 object-cover",
554
+ onError: (e) => {
555
+ e.currentTarget.style.display = "none";
556
+ }
557
+ }),
558
+ /* @__PURE__ */ jsx("span", {
559
+ className: "font-chrome chrome-meta w-6 text-xs font-medium",
560
+ children: locale.code
561
+ }),
562
+ /* @__PURE__ */ jsx("span", {
563
+ className: "flex-1",
564
+ children: locale.label
565
+ }),
566
+ locale.code === uiLocale && /* @__PURE__ */ jsx(Icon, {
567
+ icon: "ph:check",
568
+ className: "text-foreground size-4"
569
+ })
570
+ ]
571
+ }, locale.code)) })] }),
572
+ hasMultipleContentLocales && /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { children: [/* @__PURE__ */ jsx(Icon, { icon: "ph:translate" }), t("locale.contentLanguage")] }), /* @__PURE__ */ jsx(DropdownMenuSubContent, { children: contentLocales.locales.map((locale) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
573
+ onClick: () => setContentLocale(locale.code),
574
+ children: [
575
+ /* @__PURE__ */ jsx("img", {
576
+ src: getFlagUrl(locale.flagCountryCode ?? locale.code),
577
+ alt: locale.code,
578
+ className: "image-outline h-3 w-4 object-cover",
579
+ onError: (e) => {
580
+ e.currentTarget.style.display = "none";
581
+ }
582
+ }),
583
+ /* @__PURE__ */ jsx("span", {
584
+ className: "font-chrome chrome-meta w-6 text-xs font-medium",
585
+ children: locale.code
586
+ }),
587
+ /* @__PURE__ */ jsx("span", {
588
+ className: "flex-1",
589
+ children: locale.label ?? locale.code
590
+ }),
591
+ locale.code === contentLocale && /* @__PURE__ */ jsx(Icon, {
592
+ icon: "ph:check",
593
+ className: "text-foreground size-4"
594
+ })
595
+ ]
596
+ }, locale.code)) })] }),
597
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
598
+ /* @__PURE__ */ jsxs(DropdownMenuItem, {
599
+ variant: "destructive",
600
+ onClick: handleLogout,
601
+ children: [/* @__PURE__ */ jsx(Icon, {
602
+ icon: "ph:sign-out",
603
+ className: "size-4"
604
+ }), t("auth.logout")]
1074
605
  })
1075
606
  ]
1076
- }, locale_0.code)) })] });
1077
- $[72] = contentLocale;
1078
- $[73] = contentLocales;
1079
- $[74] = hasMultipleContentLocales;
1080
- $[75] = setContentLocale;
1081
- $[76] = t;
1082
- $[77] = t33;
1083
- } else t33 = $[77];
1084
- let t34;
1085
- if ($[78] === Symbol.for("react.memo_cache_sentinel")) {
1086
- t34 = /* @__PURE__ */ jsx(DropdownMenuSeparator, {});
1087
- $[78] = t34;
1088
- } else t34 = $[78];
1089
- let t35;
1090
- if ($[79] === Symbol.for("react.memo_cache_sentinel")) {
1091
- t35 = /* @__PURE__ */ jsx(Icon, {
1092
- icon: "ph:sign-out",
1093
- className: "size-4"
1094
- });
1095
- $[79] = t35;
1096
- } else t35 = $[79];
1097
- let t36;
1098
- if ($[80] !== t) {
1099
- t36 = t("auth.logout");
1100
- $[80] = t;
1101
- $[81] = t36;
1102
- } else t36 = $[81];
1103
- let t37;
1104
- if ($[82] !== handleLogout || $[83] !== t36) {
1105
- t37 = /* @__PURE__ */ jsxs(DropdownMenuItem, {
1106
- variant: "destructive",
1107
- onClick: handleLogout,
1108
- children: [t35, t36]
1109
- });
1110
- $[82] = handleLogout;
1111
- $[83] = t36;
1112
- $[84] = t37;
1113
- } else t37 = $[84];
1114
- let t38;
1115
- if ($[85] !== T4 || $[86] !== t20 || $[87] !== t21 || $[88] !== t26 || $[89] !== t27 || $[90] !== t30 || $[91] !== t31 || $[92] !== t32 || $[93] !== t33 || $[94] !== t37) {
1116
- t38 = /* @__PURE__ */ jsxs(T4, {
1117
- side: t20,
1118
- align: t21,
1119
- className: t22,
1120
- children: [
1121
- t26,
1122
- t27,
1123
- t30,
1124
- t31,
1125
- t32,
1126
- t33,
1127
- t34,
1128
- t37
1129
- ]
1130
- });
1131
- $[85] = T4;
1132
- $[86] = t20;
1133
- $[87] = t21;
1134
- $[88] = t26;
1135
- $[89] = t27;
1136
- $[90] = t30;
1137
- $[91] = t31;
1138
- $[92] = t32;
1139
- $[93] = t33;
1140
- $[94] = t37;
1141
- $[95] = t38;
1142
- } else t38 = $[95];
1143
- let t39;
1144
- if ($[96] !== T3 || $[97] !== t19 || $[98] !== t38) {
1145
- t39 = /* @__PURE__ */ jsxs(T3, { children: [t19, t38] });
1146
- $[96] = T3;
1147
- $[97] = t19;
1148
- $[98] = t38;
1149
- $[99] = t39;
1150
- } else t39 = $[99];
1151
- let t40;
1152
- if ($[100] !== T2 || $[101] !== t39) {
1153
- t40 = /* @__PURE__ */ jsx(T2, { children: t39 });
1154
- $[100] = T2;
1155
- $[101] = t39;
1156
- $[102] = t40;
1157
- } else t40 = $[102];
1158
- let t41;
1159
- if ($[103] !== T1 || $[104] !== t40) {
1160
- t41 = /* @__PURE__ */ jsx(T1, { children: t40 });
1161
- $[103] = T1;
1162
- $[104] = t40;
1163
- $[105] = t41;
1164
- } else t41 = $[105];
1165
- let t42;
1166
- if ($[106] !== T0 || $[107] !== t41) {
1167
- t42 = /* @__PURE__ */ jsx(T0, {
1168
- className: t14,
1169
- children: t41
1170
- });
1171
- $[106] = T0;
1172
- $[107] = t41;
1173
- $[108] = t42;
1174
- } else t42 = $[108];
1175
- return t42;
607
+ })] }) }) })
608
+ });
1176
609
  }
1177
610
  /**
1178
611
  * AdminSidebar Component
@@ -1199,137 +632,56 @@ function UserFooter(t0) {
1199
632
  * </SidebarProvider>
1200
633
  * ```
1201
634
  */
1202
- function _temp7(e_0) {
1203
- e_0.currentTarget.style.display = "none";
1204
- }
1205
- function _temp6(e) {
1206
- e.currentTarget.style.display = "none";
1207
- }
1208
- function AdminSidebar(t0) {
1209
- const $ = c(99);
1210
- const { LinkComponent, activeRoute, basePath: t1, brandName: brandNameProp, className, renderBrand, renderNavItem, footer, onSearchOpen, afterBrand, beforeFooter, theme, setTheme, showThemeToggle, useActiveProps: t2 } = t0;
1211
- const basePath = t1 === void 0 ? "/admin" : t1;
1212
- const useActiveProps = t2 === void 0 ? true : t2;
1213
- let t3;
1214
- if ($[0] !== brandNameProp) {
1215
- t3 = { brandName: brandNameProp };
1216
- $[0] = brandNameProp;
1217
- $[1] = t3;
1218
- } else t3 = $[1];
1219
- const { navigation, brandName, brandLogo } = useSidebarProps(t3);
635
+ function AdminSidebar({ LinkComponent, activeRoute, basePath = "/admin", brandName: brandNameProp, className, renderBrand, renderNavItem, footer, onSearchOpen, afterBrand, beforeFooter, theme, setTheme, showThemeToggle, useActiveProps = true }) {
636
+ const { navigation, brandName, brandLogo } = useSidebarProps({ brandName: brandNameProp });
1220
637
  const { t } = useTranslation();
1221
638
  const { state, isMobile, setOpenMobile, toggleSidebar } = useSidebar();
1222
639
  const collapsed = state === "collapsed";
1223
640
  const currentActiveRoute = activeRoute ?? (typeof window !== "undefined" ? window.location.pathname : void 0);
1224
641
  const { isSectionCollapsed, toggleSection } = useSidebarCollapsedSections();
1225
642
  const admin = useAdminStoreRaw()?.getState().admin;
1226
- let t4;
1227
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
1228
- t4 = { allowDynamicImportLoaders: false };
1229
- $[2] = t4;
1230
- } else t4 = $[2];
1231
- const { Component: BrandOverride } = useLazyComponent(admin?.getComponent("adminSidebarBrand"), t4);
1232
- let t5;
1233
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
1234
- t5 = { allowDynamicImportLoaders: false };
1235
- $[3] = t5;
1236
- } else t5 = $[3];
1237
- const { Component: NavItemOverride } = useLazyComponent(admin?.getComponent("adminSidebarNavItem"), t5);
1238
- let t6;
1239
- if ($[4] !== BrandOverride || $[5] !== renderBrand) {
1240
- t6 = renderBrand ?? (BrandOverride ? (props) => /* @__PURE__ */ jsx(BrandOverride, { ...props }) : void 0);
1241
- $[4] = BrandOverride;
1242
- $[5] = renderBrand;
1243
- $[6] = t6;
1244
- } else t6 = $[6];
1245
- const effectiveRenderBrand = t6;
1246
- let t7;
1247
- if ($[7] !== NavItemOverride || $[8] !== renderNavItem) {
1248
- t7 = renderNavItem ?? (NavItemOverride ? (props_0) => /* @__PURE__ */ jsx(NavItemOverride, { ...props_0 }) : void 0);
1249
- $[7] = NavItemOverride;
1250
- $[8] = renderNavItem;
1251
- $[9] = t7;
1252
- } else t7 = $[9];
1253
- const effectiveRenderNavItem = t7;
1254
- let t8;
1255
- if ($[10] !== isMobile || $[11] !== setOpenMobile) {
1256
- t8 = () => {
1257
- if (isMobile) setOpenMobile(false);
1258
- };
1259
- $[10] = isMobile;
1260
- $[11] = setOpenMobile;
1261
- $[12] = t8;
1262
- } else t8 = $[12];
1263
- const handleBrandClick = t8;
1264
- let t9;
1265
- if ($[13] !== brandLogo || $[14] !== brandName) {
1266
- t9 = (isCollapsed) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BrandLogoMark, {
1267
- logo: brandLogo,
1268
- alt: brandName,
1269
- fallback: /* @__PURE__ */ jsx(QuestpieSymbol, {})
1270
- }), !isCollapsed && /* @__PURE__ */ jsx("div", {
1271
- className: "grid flex-1 text-left leading-tight",
1272
- children: /* @__PURE__ */ jsx("span", {
1273
- className: "qa-sidebar__brand-name font-chrome truncate text-sm font-medium",
1274
- children: brandName
643
+ const { Component: BrandOverride } = useLazyComponent(admin?.getComponent("adminSidebarBrand"), { allowDynamicImportLoaders: false });
644
+ const { Component: NavItemOverride } = useLazyComponent(admin?.getComponent("adminSidebarNavItem"), { allowDynamicImportLoaders: false });
645
+ const effectiveRenderBrand = React.useMemo(() => renderBrand ?? (BrandOverride ? (props) => /* @__PURE__ */ jsx(BrandOverride, { ...props }) : void 0), [BrandOverride, renderBrand]);
646
+ const effectiveRenderNavItem = React.useMemo(() => renderNavItem ?? (NavItemOverride ? (props) => /* @__PURE__ */ jsx(NavItemOverride, { ...props }) : void 0), [NavItemOverride, renderNavItem]);
647
+ const handleBrandClick = React.useCallback(() => {
648
+ if (isMobile) setOpenMobile(false);
649
+ }, [isMobile, setOpenMobile]);
650
+ const renderBuiltInBrand = React.useCallback((isCollapsed) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BrandLogoMark, {
651
+ logo: brandLogo,
652
+ alt: brandName,
653
+ fallback: /* @__PURE__ */ jsx(QuestpieSymbol, {})
654
+ }), !isCollapsed && /* @__PURE__ */ jsx("div", {
655
+ className: "grid flex-1 text-left leading-tight",
656
+ children: /* @__PURE__ */ jsx("span", {
657
+ className: "qa-sidebar__brand-name font-chrome truncate text-sm font-medium",
658
+ children: brandName
659
+ })
660
+ })] }), [brandLogo, brandName]);
661
+ const renderBrandContent = React.useCallback((isCollapsed) => {
662
+ const builtInBrand = renderBuiltInBrand(isCollapsed);
663
+ if (!effectiveRenderBrand) return builtInBrand;
664
+ return /* @__PURE__ */ jsx(React.Suspense, {
665
+ fallback: builtInBrand,
666
+ children: effectiveRenderBrand({
667
+ name: brandName,
668
+ collapsed: isCollapsed
1275
669
  })
1276
- })] });
1277
- $[13] = brandLogo;
1278
- $[14] = brandName;
1279
- $[15] = t9;
1280
- } else t9 = $[15];
1281
- const renderBuiltInBrand = t9;
1282
- let t10;
1283
- if ($[16] !== brandName || $[17] !== effectiveRenderBrand || $[18] !== renderBuiltInBrand) {
1284
- t10 = (isCollapsed_0) => {
1285
- const builtInBrand = renderBuiltInBrand(isCollapsed_0);
1286
- if (!effectiveRenderBrand) return builtInBrand;
1287
- return /* @__PURE__ */ jsx(React.Suspense, {
1288
- fallback: builtInBrand,
1289
- children: effectiveRenderBrand({
1290
- name: brandName,
1291
- collapsed: isCollapsed_0
1292
- })
1293
- });
1294
- };
1295
- $[16] = brandName;
1296
- $[17] = effectiveRenderBrand;
1297
- $[18] = renderBuiltInBrand;
1298
- $[19] = t10;
1299
- } else t10 = $[19];
1300
- const renderBrandContent = t10;
1301
- let t11;
1302
- if ($[20] !== collapsed || $[21] !== renderBrandContent) {
1303
- t11 = renderBrandContent(collapsed);
1304
- $[20] = collapsed;
1305
- $[21] = renderBrandContent;
1306
- $[22] = t11;
1307
- } else t11 = $[22];
1308
- const brandContent = t11;
1309
- const t12 = collapsed && "justify-center";
1310
- let t13;
1311
- if ($[23] !== t12) {
1312
- t13 = cn("qa-sidebar__brand flex items-center gap-2 rounded-md p-2 transition-[background-color,color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] active:scale-[0.96] motion-reduce:transition-none motion-reduce:active:scale-100", "hover:bg-sidebar-accent", t12);
1313
- $[23] = t12;
1314
- $[24] = t13;
1315
- } else t13 = $[24];
1316
- let t14;
1317
- if ($[25] !== LinkComponent || $[26] !== basePath || $[27] !== brandContent || $[28] !== t13) {
1318
- t14 = /* @__PURE__ */ jsx(LinkComponent, {
1319
- to: basePath,
1320
- className: t13,
1321
- children: brandContent
1322
670
  });
1323
- $[25] = LinkComponent;
1324
- $[26] = basePath;
1325
- $[27] = brandContent;
1326
- $[28] = t13;
1327
- $[29] = t14;
1328
- } else t14 = $[29];
1329
- const brandLink = t14;
1330
- let t15;
1331
- if ($[30] !== onSearchOpen || $[31] !== t) {
1332
- t15 = onSearchOpen && /* @__PURE__ */ jsx(Button, {
671
+ }, [
672
+ brandName,
673
+ effectiveRenderBrand,
674
+ renderBuiltInBrand
675
+ ]);
676
+ const brandContent = renderBrandContent(collapsed);
677
+ const brandLink = /* @__PURE__ */ jsx(LinkComponent, {
678
+ to: basePath,
679
+ className: cn("qa-sidebar__brand flex items-center gap-2 rounded-md p-2 transition-[background-color,color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] active:scale-[0.96] motion-reduce:transition-none motion-reduce:active:scale-100", "hover:bg-sidebar-accent", collapsed && "justify-center"),
680
+ children: brandContent
681
+ });
682
+ const sidebarActions = /* @__PURE__ */ jsxs("div", {
683
+ className: "qa-sidebar__header-actions flex shrink-0 items-center gap-1",
684
+ children: [onSearchOpen && /* @__PURE__ */ jsx(Button, {
1333
685
  type: "button",
1334
686
  variant: "ghost",
1335
687
  size: "icon-xs",
@@ -1338,223 +690,89 @@ function AdminSidebar(t0) {
1338
690
  title: t("common.search"),
1339
691
  "aria-label": t("common.search"),
1340
692
  children: /* @__PURE__ */ jsx(Icon, { icon: "ph:magnifying-glass" })
1341
- });
1342
- $[30] = onSearchOpen;
1343
- $[31] = t;
1344
- $[32] = t15;
1345
- } else t15 = $[32];
1346
- let t16;
1347
- if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
1348
- t16 = /* @__PURE__ */ jsx(SidebarTrigger, { className: "text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground" });
1349
- $[33] = t16;
1350
- } else t16 = $[33];
1351
- let t17;
1352
- if ($[34] !== t15) {
1353
- t17 = /* @__PURE__ */ jsxs("div", {
1354
- className: "qa-sidebar__header-actions flex shrink-0 items-center gap-1",
1355
- children: [t15, t16]
1356
- });
1357
- $[34] = t15;
1358
- $[35] = t17;
1359
- } else t17 = $[35];
1360
- const sidebarActions = t17;
1361
- let t18;
1362
- if ($[36] !== className) {
1363
- t18 = cn("qa-sidebar bg-sidebar relative border-none", className);
1364
- $[36] = className;
1365
- $[37] = t18;
1366
- } else t18 = $[37];
1367
- let t19;
1368
- if ($[38] !== LinkComponent || $[39] !== basePath || $[40] !== brandLink || $[41] !== brandName || $[42] !== collapsed || $[43] !== isMobile || $[44] !== renderBrandContent) {
1369
- t19 = collapsed && !isMobile ? /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(LinkComponent, {
1370
- to: basePath,
1371
- className: cn("flex items-center gap-2 rounded-md p-2 transition-[background-color,color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] active:scale-[0.96] motion-reduce:transition-none motion-reduce:active:scale-100", "hover:bg-sidebar-accent", "justify-center"),
1372
- children: renderBrandContent(true)
1373
- }) }), /* @__PURE__ */ jsx(TooltipContent, {
1374
- side: "right",
1375
- children: brandName
1376
- })] }) : brandLink;
1377
- $[38] = LinkComponent;
1378
- $[39] = basePath;
1379
- $[40] = brandLink;
1380
- $[41] = brandName;
1381
- $[42] = collapsed;
1382
- $[43] = isMobile;
1383
- $[44] = renderBrandContent;
1384
- $[45] = t19;
1385
- } else t19 = $[45];
1386
- let t20;
1387
- if ($[46] !== handleBrandClick || $[47] !== t19) {
1388
- t20 = /* @__PURE__ */ jsx(SidebarMenu, {
1389
- className: "min-w-0 flex-1",
1390
- children: /* @__PURE__ */ jsx(SidebarMenuItem, {
1391
- onClickCapture: handleBrandClick,
1392
- children: t19
1393
- })
1394
- });
1395
- $[46] = handleBrandClick;
1396
- $[47] = t19;
1397
- $[48] = t20;
1398
- } else t20 = $[48];
1399
- const t21 = !collapsed && sidebarActions;
1400
- let t22;
1401
- if ($[49] !== t20 || $[50] !== t21) {
1402
- t22 = /* @__PURE__ */ jsxs(SidebarHeader, {
1403
- className: "qa-sidebar__header h-auto flex-row items-center gap-2 border-none px-3 pt-3 pb-1",
1404
- children: [t20, t21]
1405
- });
1406
- $[49] = t20;
1407
- $[50] = t21;
1408
- $[51] = t22;
1409
- } else t22 = $[51];
1410
- let t23;
1411
- if ($[52] !== collapsed || $[53] !== isMobile || $[54] !== onSearchOpen || $[55] !== t || $[56] !== toggleSidebar) {
1412
- t23 = collapsed && !isMobile && /* @__PURE__ */ jsxs("div", {
1413
- className: "qa-sidebar__collapsed-peek group/peek absolute top-4 -right-3 z-50 flex items-center",
1414
- children: [/* @__PURE__ */ jsx(Button, {
1415
- type: "button",
1416
- variant: "ghost",
1417
- size: "icon-xs",
1418
- className: "border-sidebar-border/70 bg-sidebar text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground h-8 w-3 rounded-l-none rounded-r-md border border-l-0 p-0 shadow-[var(--floating-shadow)]",
1419
- onClick: toggleSidebar,
1420
- "aria-label": t("ui.expandSidebar"),
1421
- children: /* @__PURE__ */ jsx("span", { className: "h-3 w-0.5 rounded-full bg-current opacity-55" })
1422
- }), /* @__PURE__ */ jsxs("div", {
1423
- className: "floating-surface ml-1 flex scale-95 items-center gap-1 p-1 opacity-0 transition-[opacity,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-enter)] group-focus-within/peek:scale-100 group-focus-within/peek:opacity-100 group-hover/peek:scale-100 group-hover/peek:opacity-100 motion-reduce:scale-100 motion-reduce:transition-none",
1424
- children: [/* @__PURE__ */ jsx(SidebarTrigger, {
1425
- className: "text-muted-foreground hover:bg-muted hover:text-foreground",
1426
- "aria-label": t("ui.expandSidebar")
1427
- }), onSearchOpen && /* @__PURE__ */ jsx(Button, {
693
+ }), /* @__PURE__ */ jsx(SidebarTrigger, { className: "text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground" })]
694
+ });
695
+ return /* @__PURE__ */ jsxs(Sidebar, {
696
+ collapsible: "icon",
697
+ variant: "inset",
698
+ className: cn("qa-sidebar bg-sidebar relative border-none", className),
699
+ children: [
700
+ /* @__PURE__ */ jsxs(SidebarHeader, {
701
+ className: "qa-sidebar__header h-auto flex-row items-center gap-2 border-none px-3 pt-3 pb-1",
702
+ children: [/* @__PURE__ */ jsx(SidebarMenu, {
703
+ className: "min-w-0 flex-1",
704
+ children: /* @__PURE__ */ jsx(SidebarMenuItem, {
705
+ onClickCapture: handleBrandClick,
706
+ children: collapsed && !isMobile ? /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(LinkComponent, {
707
+ to: basePath,
708
+ className: cn("flex items-center gap-2 rounded-md p-2 transition-[background-color,color,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-standard)] active:scale-[0.96] motion-reduce:transition-none motion-reduce:active:scale-100", "hover:bg-sidebar-accent", "justify-center"),
709
+ children: renderBrandContent(true)
710
+ }) }), /* @__PURE__ */ jsx(TooltipContent, {
711
+ side: "right",
712
+ children: brandName
713
+ })] }) : brandLink
714
+ })
715
+ }), !collapsed && sidebarActions]
716
+ }),
717
+ collapsed && !isMobile && /* @__PURE__ */ jsxs("div", {
718
+ className: "qa-sidebar__collapsed-peek group/peek absolute top-4 -right-3 z-50 flex items-center",
719
+ children: [/* @__PURE__ */ jsx(Button, {
1428
720
  type: "button",
1429
721
  variant: "ghost",
1430
- size: "icon-sm",
1431
- className: "text-muted-foreground hover:bg-muted hover:text-foreground",
1432
- onClick: onSearchOpen,
1433
- title: t("common.search"),
1434
- "aria-label": t("common.search"),
1435
- children: /* @__PURE__ */ jsx(Icon, { icon: "ph:magnifying-glass" })
722
+ size: "icon-xs",
723
+ className: "border-sidebar-border/70 bg-sidebar text-sidebar-foreground/60 hover:bg-sidebar-accent hover:text-sidebar-foreground h-8 w-3 rounded-l-none rounded-r-md border border-l-0 p-0 shadow-[var(--floating-shadow)]",
724
+ onClick: toggleSidebar,
725
+ "aria-label": t("ui.expandSidebar"),
726
+ children: /* @__PURE__ */ jsx("span", { className: "h-3 w-0.5 rounded-full bg-current opacity-55" })
727
+ }), /* @__PURE__ */ jsxs("div", {
728
+ className: "floating-surface ml-1 flex scale-95 items-center gap-1 p-1 opacity-0 transition-[opacity,transform] duration-[var(--motion-duration-base)] ease-[var(--motion-ease-enter)] group-focus-within/peek:scale-100 group-focus-within/peek:opacity-100 group-hover/peek:scale-100 group-hover/peek:opacity-100 motion-reduce:scale-100 motion-reduce:transition-none",
729
+ children: [/* @__PURE__ */ jsx(SidebarTrigger, {
730
+ className: "text-muted-foreground hover:bg-muted hover:text-foreground",
731
+ "aria-label": t("ui.expandSidebar")
732
+ }), onSearchOpen && /* @__PURE__ */ jsx(Button, {
733
+ type: "button",
734
+ variant: "ghost",
735
+ size: "icon-sm",
736
+ className: "text-muted-foreground hover:bg-muted hover:text-foreground",
737
+ onClick: onSearchOpen,
738
+ title: t("common.search"),
739
+ "aria-label": t("common.search"),
740
+ children: /* @__PURE__ */ jsx(Icon, { icon: "ph:magnifying-glass" })
741
+ })]
1436
742
  })]
1437
- })]
1438
- });
1439
- $[52] = collapsed;
1440
- $[53] = isMobile;
1441
- $[54] = onSearchOpen;
1442
- $[55] = t;
1443
- $[56] = toggleSidebar;
1444
- $[57] = t23;
1445
- } else t23 = $[57];
1446
- let t24;
1447
- if ($[58] !== afterBrand || $[59] !== collapsed) {
1448
- t24 = afterBrand && !collapsed && /* @__PURE__ */ jsx("div", {
1449
- className: "qa-sidebar__after-brand border-sidebar-border/70 border-b px-3 py-2",
1450
- children: afterBrand
1451
- });
1452
- $[58] = afterBrand;
1453
- $[59] = collapsed;
1454
- $[60] = t24;
1455
- } else t24 = $[60];
1456
- let t25;
1457
- if ($[61] !== t) {
1458
- t25 = t("nav.adminNavigation");
1459
- $[61] = t;
1460
- $[62] = t25;
1461
- } else t25 = $[62];
1462
- let t26;
1463
- if ($[63] !== LinkComponent || $[64] !== basePath || $[65] !== currentActiveRoute || $[66] !== effectiveRenderNavItem || $[67] !== isSectionCollapsed || $[68] !== navigation || $[69] !== toggleSection || $[70] !== useActiveProps) {
1464
- let t27$1;
1465
- if ($[72] !== LinkComponent || $[73] !== basePath || $[74] !== currentActiveRoute || $[75] !== effectiveRenderNavItem || $[76] !== isSectionCollapsed || $[77] !== toggleSection || $[78] !== useActiveProps) {
1466
- t27$1 = (group, index) => /* @__PURE__ */ jsx(NavGroup, {
1467
- group,
1468
- activeRoute: currentActiveRoute,
1469
- LinkComponent,
1470
- renderNavItem: effectiveRenderNavItem,
1471
- basePath,
1472
- useActiveProps: useActiveProps && !currentActiveRoute,
1473
- isSectionCollapsed,
1474
- toggleSection
1475
- }, group.id ?? `group-${index}`);
1476
- $[72] = LinkComponent;
1477
- $[73] = basePath;
1478
- $[74] = currentActiveRoute;
1479
- $[75] = effectiveRenderNavItem;
1480
- $[76] = isSectionCollapsed;
1481
- $[77] = toggleSection;
1482
- $[78] = useActiveProps;
1483
- $[79] = t27$1;
1484
- } else t27$1 = $[79];
1485
- t26 = navigation.map(t27$1);
1486
- $[63] = LinkComponent;
1487
- $[64] = basePath;
1488
- $[65] = currentActiveRoute;
1489
- $[66] = effectiveRenderNavItem;
1490
- $[67] = isSectionCollapsed;
1491
- $[68] = navigation;
1492
- $[69] = toggleSection;
1493
- $[70] = useActiveProps;
1494
- $[71] = t26;
1495
- } else t26 = $[71];
1496
- let t27;
1497
- if ($[80] !== t25 || $[81] !== t26) {
1498
- t27 = /* @__PURE__ */ jsx(SidebarContent, {
1499
- className: "qa-sidebar__content gap-3 px-2 py-3 group-data-[collapsible=icon]:gap-2",
1500
- children: /* @__PURE__ */ jsx("nav", {
1501
- "aria-label": t25,
1502
- className: "qa-sidebar__nav",
1503
- children: t26
743
+ }),
744
+ afterBrand && !collapsed && /* @__PURE__ */ jsx("div", {
745
+ className: "qa-sidebar__after-brand border-sidebar-border/70 border-b px-3 py-2",
746
+ children: afterBrand
747
+ }),
748
+ /* @__PURE__ */ jsx(SidebarContent, {
749
+ className: "qa-sidebar__content gap-3 px-2 py-3 group-data-[collapsible=icon]:gap-2",
750
+ children: /* @__PURE__ */ jsx("nav", {
751
+ "aria-label": t("nav.adminNavigation"),
752
+ className: "qa-sidebar__nav",
753
+ children: navigation.map((group, index) => /* @__PURE__ */ jsx(NavGroup, {
754
+ group,
755
+ activeRoute: currentActiveRoute,
756
+ LinkComponent,
757
+ renderNavItem: effectiveRenderNavItem,
758
+ basePath,
759
+ useActiveProps: useActiveProps && !currentActiveRoute,
760
+ isSectionCollapsed,
761
+ toggleSection
762
+ }, group.id ?? `group-${index}`))
763
+ })
764
+ }),
765
+ beforeFooter && !collapsed && /* @__PURE__ */ jsx("div", {
766
+ className: "qa-sidebar__before-footer border-sidebar-border/70 border-t px-3 py-2",
767
+ children: beforeFooter
768
+ }),
769
+ footer ?? /* @__PURE__ */ jsx(UserFooter, {
770
+ theme,
771
+ setTheme,
772
+ showThemeToggle
1504
773
  })
1505
- });
1506
- $[80] = t25;
1507
- $[81] = t26;
1508
- $[82] = t27;
1509
- } else t27 = $[82];
1510
- let t28;
1511
- if ($[83] !== beforeFooter || $[84] !== collapsed) {
1512
- t28 = beforeFooter && !collapsed && /* @__PURE__ */ jsx("div", {
1513
- className: "qa-sidebar__before-footer border-sidebar-border/70 border-t px-3 py-2",
1514
- children: beforeFooter
1515
- });
1516
- $[83] = beforeFooter;
1517
- $[84] = collapsed;
1518
- $[85] = t28;
1519
- } else t28 = $[85];
1520
- let t29;
1521
- if ($[86] !== footer || $[87] !== setTheme || $[88] !== showThemeToggle || $[89] !== theme) {
1522
- t29 = footer ?? /* @__PURE__ */ jsx(UserFooter, {
1523
- theme,
1524
- setTheme,
1525
- showThemeToggle
1526
- });
1527
- $[86] = footer;
1528
- $[87] = setTheme;
1529
- $[88] = showThemeToggle;
1530
- $[89] = theme;
1531
- $[90] = t29;
1532
- } else t29 = $[90];
1533
- let t30;
1534
- if ($[91] !== t18 || $[92] !== t22 || $[93] !== t23 || $[94] !== t24 || $[95] !== t27 || $[96] !== t28 || $[97] !== t29) {
1535
- t30 = /* @__PURE__ */ jsxs(Sidebar, {
1536
- collapsible: "icon",
1537
- variant: "inset",
1538
- className: t18,
1539
- children: [
1540
- t22,
1541
- t23,
1542
- t24,
1543
- t27,
1544
- t28,
1545
- t29
1546
- ]
1547
- });
1548
- $[91] = t18;
1549
- $[92] = t22;
1550
- $[93] = t23;
1551
- $[94] = t24;
1552
- $[95] = t27;
1553
- $[96] = t28;
1554
- $[97] = t29;
1555
- $[98] = t30;
1556
- } else t30 = $[98];
1557
- return t30;
774
+ ]
775
+ });
1558
776
  }
1559
777
 
1560
778
  //#endregion