@jmruthers/pace-core 0.5.126 → 0.5.128

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 (180) hide show
  1. package/dist/{DataTable-6FN7XDXA.js → DataTable-3Z5HLOWF.js} +6 -6
  2. package/dist/{PublicLoadingSpinner-CaoRbHvJ.d.ts → PublicLoadingSpinner-CUAnTvcg.d.ts} +41 -21
  3. package/dist/{UnifiedAuthProvider-6C47WIML.js → UnifiedAuthProvider-CQDZRJIS.js} +3 -3
  4. package/dist/{chunk-QXGLU2O5.js → chunk-27MGXDD6.js} +282 -147
  5. package/dist/chunk-27MGXDD6.js.map +1 -0
  6. package/dist/{chunk-ZBLK676C.js → chunk-3CG5L6RN.js} +1 -19
  7. package/dist/chunk-3CG5L6RN.js.map +1 -0
  8. package/dist/{chunk-35ZDPMBM.js → chunk-BYXRHAIF.js} +3 -3
  9. package/dist/{chunk-IJOZZOGT.js → chunk-CQZU6TFE.js} +5 -5
  10. package/dist/{chunk-C43QIDN3.js → chunk-CTJRBUX2.js} +2 -2
  11. package/dist/{chunk-R4CRQUJJ.js → chunk-ENE3AB75.js} +463 -453
  12. package/dist/chunk-ENE3AB75.js.map +1 -0
  13. package/dist/{chunk-ESJTIADP.js → chunk-F64FFPOZ.js} +5 -15
  14. package/dist/{chunk-ESJTIADP.js.map → chunk-F64FFPOZ.js.map} +1 -1
  15. package/dist/{chunk-4MXVZVNS.js → chunk-TGIY2AR2.js} +2 -2
  16. package/dist/{chunk-XN6GWKMV.js → chunk-VZ5OR6HD.js} +161 -14
  17. package/dist/chunk-VZ5OR6HD.js.map +1 -0
  18. package/dist/{chunk-QWNJCQXZ.js → chunk-ZV77RZMU.js} +2 -2
  19. package/dist/{chunk-NZGLXZGP.js → chunk-ZYZCRSBD.js} +3 -54
  20. package/dist/chunk-ZYZCRSBD.js.map +1 -0
  21. package/dist/components.d.ts +1 -1
  22. package/dist/components.js +9 -9
  23. package/dist/hooks.js +7 -7
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.js +12 -12
  26. package/dist/providers.js +2 -2
  27. package/dist/rbac/index.js +7 -7
  28. package/dist/utils.d.ts +1 -1
  29. package/dist/utils.js +1 -1
  30. package/docs/api/classes/ColumnFactory.md +1 -1
  31. package/docs/api/classes/ErrorBoundary.md +1 -1
  32. package/docs/api/classes/InvalidScopeError.md +1 -1
  33. package/docs/api/classes/MissingUserContextError.md +1 -1
  34. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  35. package/docs/api/classes/PermissionDeniedError.md +1 -1
  36. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  37. package/docs/api/classes/RBACAuditManager.md +1 -1
  38. package/docs/api/classes/RBACCache.md +1 -1
  39. package/docs/api/classes/RBACEngine.md +1 -1
  40. package/docs/api/classes/RBACError.md +1 -1
  41. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  42. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  43. package/docs/api/classes/StorageUtils.md +1 -1
  44. package/docs/api/enums/FileCategory.md +1 -1
  45. package/docs/api/interfaces/AggregateConfig.md +1 -1
  46. package/docs/api/interfaces/ButtonProps.md +1 -1
  47. package/docs/api/interfaces/CardProps.md +1 -1
  48. package/docs/api/interfaces/ColorPalette.md +1 -1
  49. package/docs/api/interfaces/ColorShade.md +1 -1
  50. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  51. package/docs/api/interfaces/DataRecord.md +1 -1
  52. package/docs/api/interfaces/DataTableAction.md +1 -1
  53. package/docs/api/interfaces/DataTableColumn.md +1 -1
  54. package/docs/api/interfaces/DataTableProps.md +1 -1
  55. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  56. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  57. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  58. package/docs/api/interfaces/EventAppRoleData.md +1 -1
  59. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  60. package/docs/api/interfaces/FileMetadata.md +1 -1
  61. package/docs/api/interfaces/FileReference.md +1 -1
  62. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  63. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  64. package/docs/api/interfaces/FileUploadProps.md +1 -1
  65. package/docs/api/interfaces/FooterProps.md +1 -1
  66. package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
  67. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  68. package/docs/api/interfaces/InputProps.md +1 -1
  69. package/docs/api/interfaces/LabelProps.md +1 -1
  70. package/docs/api/interfaces/LoginFormProps.md +1 -1
  71. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  72. package/docs/api/interfaces/NavigationContextType.md +1 -1
  73. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  74. package/docs/api/interfaces/NavigationItem.md +1 -1
  75. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  76. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  77. package/docs/api/interfaces/Organisation.md +1 -1
  78. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  79. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  80. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  81. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  82. package/docs/api/interfaces/PaceAppLayoutProps.md +27 -27
  83. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  84. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  85. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  86. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  87. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  88. package/docs/api/interfaces/PaletteData.md +1 -1
  89. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  90. package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
  91. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  92. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  93. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  94. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  95. package/docs/api/interfaces/PublicPageHeaderProps.md +10 -62
  96. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  97. package/docs/api/interfaces/RBACConfig.md +1 -1
  98. package/docs/api/interfaces/RBACLogger.md +1 -1
  99. package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
  100. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  101. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  102. package/docs/api/interfaces/RoleManagementResult.md +1 -1
  103. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  104. package/docs/api/interfaces/RouteConfig.md +1 -1
  105. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  106. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  107. package/docs/api/interfaces/StorageConfig.md +1 -1
  108. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  109. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  110. package/docs/api/interfaces/StorageListOptions.md +1 -1
  111. package/docs/api/interfaces/StorageListResult.md +1 -1
  112. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  113. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  114. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  115. package/docs/api/interfaces/StyleImport.md +1 -1
  116. package/docs/api/interfaces/SwitchProps.md +1 -1
  117. package/docs/api/interfaces/ToastActionElement.md +1 -1
  118. package/docs/api/interfaces/ToastProps.md +1 -1
  119. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  120. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  121. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  122. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  123. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  124. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  125. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
  126. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
  127. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  128. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  129. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  130. package/docs/api/interfaces/UserEventAccess.md +1 -1
  131. package/docs/api/interfaces/UserMenuProps.md +1 -1
  132. package/docs/api/interfaces/UserProfile.md +1 -1
  133. package/docs/api/modules.md +53 -28
  134. package/docs/api-reference/components.md +24 -0
  135. package/docs/api-reference/types.md +28 -0
  136. package/docs/architecture/rpc-function-standards.md +39 -5
  137. package/docs/implementation-guides/data-tables.md +55 -10
  138. package/docs/implementation-guides/permission-enforcement.md +4 -0
  139. package/docs/rbac/super-admin-guide.md +43 -5
  140. package/package.json +1 -1
  141. package/src/components/Button/Button.tsx +1 -1
  142. package/src/components/DataTable/__tests__/DataTable.export.test.tsx +702 -0
  143. package/src/components/DataTable/components/DataTableCore.tsx +55 -36
  144. package/src/components/DataTable/components/ImportModal.tsx +134 -2
  145. package/src/components/DataTable/index.ts +3 -1
  146. package/src/components/DataTable/types.ts +68 -0
  147. package/src/components/Dialog/Dialog.tsx +0 -13
  148. package/src/components/FileDisplay/FileDisplay.tsx +76 -0
  149. package/src/components/Header/Header.tsx +5 -0
  150. package/src/components/PaceAppLayout/PaceAppLayout.tsx +72 -50
  151. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +81 -1
  152. package/src/components/PublicLayout/PublicPageFooter.tsx +1 -1
  153. package/src/components/PublicLayout/PublicPageHeader.tsx +69 -128
  154. package/src/components/PublicLayout/PublicPageLayout.tsx +4 -4
  155. package/src/components/PublicLayout/PublicPageProvider.tsx +12 -3
  156. package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +1 -1
  157. package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +3 -18
  158. package/src/hooks/__tests__/useAppConfig.unit.test.ts +3 -1
  159. package/src/hooks/__tests__/usePermissionCache.unit.test.ts +11 -5
  160. package/src/hooks/__tests__/usePublicRouteParams.unit.test.ts +8 -7
  161. package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +41 -46
  162. package/src/hooks/public/usePublicFileDisplay.ts +176 -7
  163. package/src/hooks/public/usePublicRouteParams.ts +0 -12
  164. package/src/hooks/useAppConfig.ts +15 -6
  165. package/src/hooks/usePermissionCache.test.ts +12 -4
  166. package/src/hooks/usePermissionCache.ts +3 -19
  167. package/src/hooks/useSecureDataAccess.ts +0 -63
  168. package/src/services/EventService.ts +0 -19
  169. package/dist/chunk-NZGLXZGP.js.map +0 -1
  170. package/dist/chunk-QXGLU2O5.js.map +0 -1
  171. package/dist/chunk-R4CRQUJJ.js.map +0 -1
  172. package/dist/chunk-XN6GWKMV.js.map +0 -1
  173. package/dist/chunk-ZBLK676C.js.map +0 -1
  174. /package/dist/{DataTable-6FN7XDXA.js.map → DataTable-3Z5HLOWF.js.map} +0 -0
  175. /package/dist/{UnifiedAuthProvider-6C47WIML.js.map → UnifiedAuthProvider-CQDZRJIS.js.map} +0 -0
  176. /package/dist/{chunk-35ZDPMBM.js.map → chunk-BYXRHAIF.js.map} +0 -0
  177. /package/dist/{chunk-IJOZZOGT.js.map → chunk-CQZU6TFE.js.map} +0 -0
  178. /package/dist/{chunk-C43QIDN3.js.map → chunk-CTJRBUX2.js.map} +0 -0
  179. /package/dist/{chunk-4MXVZVNS.js.map → chunk-TGIY2AR2.js.map} +0 -0
  180. /package/dist/{chunk-QWNJCQXZ.js.map → chunk-ZV77RZMU.js.map} +0 -0
@@ -25,13 +25,13 @@ import {
25
25
  SelectSeparator,
26
26
  SelectTrigger,
27
27
  SelectValue
28
- } from "./chunk-QXGLU2O5.js";
28
+ } from "./chunk-27MGXDD6.js";
29
29
  import {
30
30
  useCan,
31
31
  usePermissions,
32
32
  useRBAC,
33
33
  useResolvedScope
34
- } from "./chunk-35ZDPMBM.js";
34
+ } from "./chunk-BYXRHAIF.js";
35
35
  import {
36
36
  isSuperAdmin
37
37
  } from "./chunk-WP5I5GLN.js";
@@ -50,7 +50,7 @@ import {
50
50
  useIsPublicPage,
51
51
  usePublicFileDisplay,
52
52
  usePublicPageContext
53
- } from "./chunk-XN6GWKMV.js";
53
+ } from "./chunk-VZ5OR6HD.js";
54
54
  import {
55
55
  useToast
56
56
  } from "./chunk-GKHF54DI.js";
@@ -58,11 +58,11 @@ import {
58
58
  init_useOrganisations,
59
59
  useEvents,
60
60
  useOrganisations
61
- } from "./chunk-4MXVZVNS.js";
61
+ } from "./chunk-TGIY2AR2.js";
62
62
  import {
63
63
  UnifiedAuthProvider_exports,
64
64
  init_UnifiedAuthProvider as init_UnifiedAuthProvider2
65
- } from "./chunk-C43QIDN3.js";
65
+ } from "./chunk-CTJRBUX2.js";
66
66
  import {
67
67
  EventServiceContext,
68
68
  EventServiceProvider,
@@ -72,7 +72,7 @@ import {
72
72
  useEventService,
73
73
  useSessionRestoration,
74
74
  useUnifiedAuth
75
- } from "./chunk-ZBLK676C.js";
75
+ } from "./chunk-3CG5L6RN.js";
76
76
  import {
77
77
  LoadingSpinner
78
78
  } from "./chunk-CDQ3PX7L.js";
@@ -258,42 +258,13 @@ var Switch = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
258
258
  ));
259
259
  Switch.displayName = SwitchPrimitive.Root.displayName;
260
260
 
261
- // src/components/Progress/Progress.tsx
262
- import * as React4 from "react";
263
- import * as ProgressPrimitive from "@radix-ui/react-progress";
264
- import { jsx as jsx4 } from "react/jsx-runtime";
265
- var Progress = React4.forwardRef(({ className, value, max = 100, ...props }, ref) => /* @__PURE__ */ jsx4(
266
- ProgressPrimitive.Root,
267
- {
268
- ref,
269
- className: cn(
270
- "relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
271
- className
272
- ),
273
- ...props,
274
- value,
275
- max,
276
- "aria-valuenow": value,
277
- "aria-valuemax": max,
278
- "aria-valuemin": 0,
279
- children: /* @__PURE__ */ jsx4(
280
- ProgressPrimitive.Indicator,
281
- {
282
- className: "h-full w-full flex-1 bg-primary transition-all",
283
- style: { transform: `translateX(-${100 - (value || 0)}%)` }
284
- }
285
- )
286
- }
287
- ));
288
- Progress.displayName = ProgressPrimitive.Root.displayName;
289
-
290
261
  // src/components/Toast/Toast.tsx
291
- import * as React5 from "react";
262
+ import * as React4 from "react";
292
263
  import * as ToastPrimitives from "@radix-ui/react-toast";
293
264
  import { X } from "lucide-react";
294
- import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
265
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
295
266
  var ToastProvider = ToastPrimitives.Provider;
296
- var ToastViewport = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
267
+ var ToastViewport = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
297
268
  ToastPrimitives.Viewport,
298
269
  {
299
270
  ref,
@@ -306,8 +277,8 @@ var ToastViewport = React5.forwardRef(({ className, ...props }, ref) => /* @__PU
306
277
  }
307
278
  ));
308
279
  ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
309
- var Toast = React5.forwardRef(({ className, ...props }, ref) => {
310
- return /* @__PURE__ */ jsx5(
280
+ var Toast = React4.forwardRef(({ className, ...props }, ref) => {
281
+ return /* @__PURE__ */ jsx4(
311
282
  ToastPrimitives.Root,
312
283
  {
313
284
  ref,
@@ -321,7 +292,7 @@ var Toast = React5.forwardRef(({ className, ...props }, ref) => {
321
292
  );
322
293
  });
323
294
  Toast.displayName = ToastPrimitives.Root.displayName;
324
- var ToastAction = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
295
+ var ToastAction = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
325
296
  ToastPrimitives.Action,
326
297
  {
327
298
  ref,
@@ -334,7 +305,7 @@ var ToastAction = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE
334
305
  }
335
306
  ));
336
307
  ToastAction.displayName = ToastPrimitives.Action.displayName;
337
- var ToastClose = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
308
+ var ToastClose = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
338
309
  ToastPrimitives.Close,
339
310
  {
340
311
  ref,
@@ -345,11 +316,11 @@ var ToastClose = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE_
345
316
  ),
346
317
  "toast-close": "",
347
318
  ...props,
348
- children: /* @__PURE__ */ jsx5(X, { className: "h-4 w-4" })
319
+ children: /* @__PURE__ */ jsx4(X, { className: "h-4 w-4" })
349
320
  }
350
321
  ));
351
322
  ToastClose.displayName = ToastPrimitives.Close.displayName;
352
- var ToastTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
323
+ var ToastTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
353
324
  ToastPrimitives.Title,
354
325
  {
355
326
  ref,
@@ -359,7 +330,7 @@ var ToastTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE_
359
330
  }
360
331
  ));
361
332
  ToastTitle.displayName = ToastPrimitives.Title.displayName;
362
- var ToastDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
333
+ var ToastDescription = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
363
334
  ToastPrimitives.Description,
364
335
  {
365
336
  ref,
@@ -372,14 +343,14 @@ ToastDescription.displayName = ToastPrimitives.Description.displayName;
372
343
  function Toaster() {
373
344
  const { toasts } = useToast();
374
345
  return /* @__PURE__ */ jsxs2(ToastProvider, { "data-testid": "toast-provider", children: [
375
- /* @__PURE__ */ jsx5(ToastViewport, {}),
346
+ /* @__PURE__ */ jsx4(ToastViewport, {}),
376
347
  toasts.map((toast) => {
377
348
  const { id, title, description, action, dismiss, duration, ...toastProps } = toast;
378
349
  return /* @__PURE__ */ jsxs2(Toast, { ...toastProps, duration, children: [
379
- title && /* @__PURE__ */ jsx5(ToastTitle, { children: title }),
380
- description && /* @__PURE__ */ jsx5(ToastDescription, { children: description }),
350
+ title && /* @__PURE__ */ jsx4(ToastTitle, { children: title }),
351
+ description && /* @__PURE__ */ jsx4(ToastDescription, { children: description }),
381
352
  action && action,
382
- /* @__PURE__ */ jsx5(ToastClose, { onClick: dismiss })
353
+ /* @__PURE__ */ jsx4(ToastClose, { onClick: dismiss })
383
354
  ] }, id);
384
355
  })
385
356
  ] });
@@ -388,7 +359,7 @@ function Toaster() {
388
359
  // src/components/Form/Form.tsx
389
360
  import { useForm, FormProvider } from "react-hook-form";
390
361
  import { zodResolver } from "@hookform/resolvers/zod";
391
- import { jsx as jsx6 } from "react/jsx-runtime";
362
+ import { jsx as jsx5 } from "react/jsx-runtime";
392
363
  function Form({
393
364
  schema,
394
365
  defaultValues,
@@ -404,13 +375,13 @@ function Form({
404
375
  mode
405
376
  });
406
377
  const handleSubmit = methods.handleSubmit(onSubmit, onError);
407
- return /* @__PURE__ */ jsx6(FormProvider, { ...methods, children: /* @__PURE__ */ jsx6("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: typeof children === "function" ? children(methods) : children }) });
378
+ return /* @__PURE__ */ jsx5(FormProvider, { ...methods, children: /* @__PURE__ */ jsx5("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: typeof children === "function" ? children(methods) : children }) });
408
379
  }
409
380
 
410
381
  // src/components/LoginForm/LoginForm.tsx
411
- import React6, { useState, useCallback, useMemo } from "react";
412
- import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
413
- var LoginForm = React6.memo(({
382
+ import React5, { useState, useCallback, useMemo } from "react";
383
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
384
+ var LoginForm = React5.memo(({
414
385
  onSignIn,
415
386
  onSuccess,
416
387
  onError,
@@ -451,15 +422,15 @@ var LoginForm = React6.memo(({
451
422
  }, [onSignUp]);
452
423
  const displayTitle = useMemo(() => title || (appName ? `Sign in to ${appName}` : "Sign In"), [title, appName]);
453
424
  const displaySubtitle = useMemo(() => subtitle || "Enter your credentials to continue.", [subtitle]);
454
- return /* @__PURE__ */ jsx7(Card, { className: cn("w-full max-w-md mx-auto", className), children: /* @__PURE__ */ jsxs3("form", { onSubmit: handleSubmit, "data-testid": "login-form", children: [
425
+ return /* @__PURE__ */ jsx6(Card, { className: cn("w-full max-w-md mx-auto", className), children: /* @__PURE__ */ jsxs3("form", { onSubmit: handleSubmit, "data-testid": "login-form", children: [
455
426
  /* @__PURE__ */ jsxs3(CardHeader, { className: "space-y-1", children: [
456
- /* @__PURE__ */ jsx7(CardTitle, { className: "text-2xl text-center", children: displayTitle }),
457
- /* @__PURE__ */ jsx7(CardDescription, { className: "text-center", children: displaySubtitle })
427
+ /* @__PURE__ */ jsx6(CardTitle, { className: "text-2xl text-center", children: displayTitle }),
428
+ /* @__PURE__ */ jsx6(CardDescription, { className: "text-center", children: displaySubtitle })
458
429
  ] }),
459
430
  /* @__PURE__ */ jsxs3(CardContent, { className: "space-y-4", children: [
460
- error && /* @__PURE__ */ jsx7(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx7(AlertDescription, { children: error }) }),
461
- /* @__PURE__ */ jsx7(Label, { htmlFor: "email", children: "Email" }),
462
- /* @__PURE__ */ jsx7(
431
+ error && /* @__PURE__ */ jsx6(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx6(AlertDescription, { children: error }) }),
432
+ /* @__PURE__ */ jsx6(Label, { htmlFor: "email", children: "Email" }),
433
+ /* @__PURE__ */ jsx6(
463
434
  Input,
464
435
  {
465
436
  id: "email",
@@ -471,8 +442,8 @@ var LoginForm = React6.memo(({
471
442
  disabled: isLoading
472
443
  }
473
444
  ),
474
- /* @__PURE__ */ jsx7(Label, { htmlFor: "password", children: "Password" }),
475
- /* @__PURE__ */ jsx7(
445
+ /* @__PURE__ */ jsx6(Label, { htmlFor: "password", children: "Password" }),
446
+ /* @__PURE__ */ jsx6(
476
447
  Input,
477
448
  {
478
449
  id: "password",
@@ -486,7 +457,7 @@ var LoginForm = React6.memo(({
486
457
  )
487
458
  ] }),
488
459
  /* @__PURE__ */ jsxs3(CardFooter, { className: "flex flex-col space-y-4", children: [
489
- /* @__PURE__ */ jsx7(
460
+ /* @__PURE__ */ jsx6(
490
461
  Button,
491
462
  {
492
463
  type: "submit",
@@ -495,7 +466,7 @@ var LoginForm = React6.memo(({
495
466
  children: isLoading ? "Signing in..." : "Sign In"
496
467
  }
497
468
  ),
498
- showSignUp && (onSignUp ? /* @__PURE__ */ jsx7("div", { className: "text-sm text-center text-muted-foreground", children: /* @__PURE__ */ jsx7(
469
+ showSignUp && (onSignUp ? /* @__PURE__ */ jsx6("div", { className: "text-sm text-center text-muted-foreground", children: /* @__PURE__ */ jsx6(
499
470
  "button",
500
471
  {
501
472
  type: "button",
@@ -506,7 +477,7 @@ var LoginForm = React6.memo(({
506
477
  ) }) : /* @__PURE__ */ jsxs3("p", { className: "text-center text-muted-foreground", children: [
507
478
  "Don't have an account?",
508
479
  " ",
509
- /* @__PURE__ */ jsx7("a", { href: "/signup", className: "text-primary hover:underline", children: "Sign up" })
480
+ /* @__PURE__ */ jsx6("a", { href: "/signup", className: "text-primary hover:underline", children: "Sign up" })
510
481
  ] }))
511
482
  ] })
512
483
  ] }) });
@@ -515,7 +486,7 @@ var LoginForm = React6.memo(({
515
486
  // src/components/EventSelector/EventSelector.tsx
516
487
  import { RefreshCw, AlertCircle, Lock, Calendar, Star } from "lucide-react";
517
488
  import { useEffect, useMemo as useMemo2 } from "react";
518
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
489
+ import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
519
490
  function EventSelector({
520
491
  placeholder = "Select an event",
521
492
  className,
@@ -611,15 +582,15 @@ function EventSelector({
611
582
  }, [events, selectedEvent, setSelectedEvent, onEventChange, isLoading]);
612
583
  if (isLoading) {
613
584
  return /* @__PURE__ */ jsxs4("div", { className: `flex items-center gap-2 ${className}`, children: [
614
- /* @__PURE__ */ jsx8(LoadingSpinner, { size: "sm" }),
615
- /* @__PURE__ */ jsx8("span", { className: "text-sm text-muted-foreground", children: "Loading events..." })
585
+ /* @__PURE__ */ jsx7(LoadingSpinner, { size: "sm" }),
586
+ /* @__PURE__ */ jsx7("span", { className: "text-sm text-muted-foreground", children: "Loading events..." })
616
587
  ] });
617
588
  }
618
589
  if (error) {
619
- return /* @__PURE__ */ jsx8("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "destructive", children: [
620
- /* @__PURE__ */ jsx8(Lock, { className: "h-4 w-4" }),
590
+ return /* @__PURE__ */ jsx7("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "destructive", children: [
591
+ /* @__PURE__ */ jsx7(Lock, { className: "h-4 w-4" }),
621
592
  /* @__PURE__ */ jsxs4(AlertDescription, { className: "flex items-center justify-between", children: [
622
- /* @__PURE__ */ jsx8("span", { children: error.message }),
593
+ /* @__PURE__ */ jsx7("span", { children: error.message }),
623
594
  showRetryButton && /* @__PURE__ */ jsxs4(
624
595
  Button,
625
596
  {
@@ -628,7 +599,7 @@ function EventSelector({
628
599
  onClick: handleRetry,
629
600
  className: "ml-2",
630
601
  children: [
631
- /* @__PURE__ */ jsx8(RefreshCw, { className: "h-3 w-3 mr-1" }),
602
+ /* @__PURE__ */ jsx7(RefreshCw, { className: "h-3 w-3 mr-1" }),
632
603
  "Retry"
633
604
  ]
634
605
  }
@@ -638,10 +609,10 @@ function EventSelector({
638
609
  }
639
610
  if (events.length === 0) {
640
611
  if (showNoEventsMessage) {
641
- return /* @__PURE__ */ jsx8("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "inline", children: [
642
- /* @__PURE__ */ jsx8(AlertCircle, { className: "h-4 w-4 text-acc-700" }),
612
+ return /* @__PURE__ */ jsx7("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "inline", children: [
613
+ /* @__PURE__ */ jsx7(AlertCircle, { className: "h-4 w-4 text-acc-700" }),
643
614
  /* @__PURE__ */ jsxs4(AlertDescription, { className: "flex items-center justify-between", children: [
644
- /* @__PURE__ */ jsx8("span", { children: "No events available." }),
615
+ /* @__PURE__ */ jsx7("span", { children: "No events available." }),
645
616
  showRetryButton && /* @__PURE__ */ jsxs4(
646
617
  Button,
647
618
  {
@@ -650,7 +621,7 @@ function EventSelector({
650
621
  onClick: handleRetry,
651
622
  className: "ml-2",
652
623
  children: [
653
- /* @__PURE__ */ jsx8(RefreshCw, { className: "h-3 w-3 mr-1" }),
624
+ /* @__PURE__ */ jsx7(RefreshCw, { className: "h-3 w-3 mr-1" }),
654
625
  "Refresh"
655
626
  ]
656
627
  }
@@ -667,34 +638,34 @@ function EventSelector({
667
638
  onValueChange: handleValueChange,
668
639
  className,
669
640
  children: [
670
- /* @__PURE__ */ jsx8(SelectTrigger, { className: "text-left", variant: "outline", children: /* @__PURE__ */ jsx8(SelectValue, { placeholder, children: selectedEvent && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
671
- /* @__PURE__ */ jsx8(Calendar, { className: "h-4 w-4 flex-shrink-0" }),
672
- /* @__PURE__ */ jsx8("span", { className: "truncate", children: selectedEvent.event_name || selectedEvent.name }),
641
+ /* @__PURE__ */ jsx7(SelectTrigger, { className: "text-left", variant: "outline", children: /* @__PURE__ */ jsx7(SelectValue, { placeholder, children: selectedEvent && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
642
+ /* @__PURE__ */ jsx7(Calendar, { className: "h-4 w-4 flex-shrink-0" }),
643
+ /* @__PURE__ */ jsx7("span", { className: "truncate", children: selectedEvent.event_name || selectedEvent.name }),
673
644
  selectedEvent.event_date && /* @__PURE__ */ jsxs4("span", { className: "text-xs text-muted-foreground flex-shrink-0", children: [
674
645
  "(",
675
646
  formatEventDate(selectedEvent.event_date),
676
647
  ")"
677
648
  ] })
678
649
  ] }) }) }),
679
- /* @__PURE__ */ jsx8(SelectContent, { children: sortedEvents.map((event) => {
650
+ /* @__PURE__ */ jsx7(SelectContent, { children: sortedEvents.map((event) => {
680
651
  const isNext = isNextEvent(event);
681
652
  const isSelected = selectedEvent && (selectedEvent.event_id === event.event_id || selectedEvent.id === event.id);
682
- return /* @__PURE__ */ jsx8(
653
+ return /* @__PURE__ */ jsx7(
683
654
  SelectItem,
684
655
  {
685
656
  value: event.event_id || event.id,
686
657
  className: "flex items-center justify-between",
687
658
  children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 w-full", children: [
688
- showNextEventIndicator && isNext && /* @__PURE__ */ jsx8(Star, { className: "h-3 w-3 text-acc-500" }),
659
+ showNextEventIndicator && isNext && /* @__PURE__ */ jsx7(Star, { className: "h-3 w-3 text-acc-500" }),
689
660
  /* @__PURE__ */ jsxs4("div", { className: "flex-1", children: [
690
661
  /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
691
- /* @__PURE__ */ jsx8("span", { className: isSelected ? "font-semibold" : "", children: event.event_name || event.name }),
692
- isSelected && /* @__PURE__ */ jsx8("span", { className: "text-xs bg-primary text-primary-foreground px-1 rounded", children: "Current" })
662
+ /* @__PURE__ */ jsx7("span", { className: isSelected ? "font-semibold" : "", children: event.event_name || event.name }),
663
+ isSelected && /* @__PURE__ */ jsx7("span", { className: "text-xs bg-primary text-primary-foreground px-1 rounded", children: "Current" })
693
664
  ] }),
694
665
  showEventDetails && event.event_date && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
695
- /* @__PURE__ */ jsx8(Calendar, { className: "h-3 w-3" }),
696
- /* @__PURE__ */ jsx8("span", { children: formatEventDate(event.event_date) }),
697
- showNextEventIndicator && isNext && /* @__PURE__ */ jsx8("span", { className: "text-acc-600 font-medium", children: "(Next)" })
666
+ /* @__PURE__ */ jsx7(Calendar, { className: "h-3 w-3" }),
667
+ /* @__PURE__ */ jsx7("span", { children: formatEventDate(event.event_date) }),
668
+ showNextEventIndicator && isNext && /* @__PURE__ */ jsx7("span", { className: "text-acc-600 font-medium", children: "(Next)" })
698
669
  ] }),
699
670
  showEventDetails && event.event_venue && /* @__PURE__ */ jsxs4("div", { className: "text-xs text-muted-foreground", children: [
700
671
  "\u{1F4CD} ",
@@ -713,7 +684,7 @@ function EventSelector({
713
684
 
714
685
  // src/components/PasswordReset/PasswordChangeForm.tsx
715
686
  import { useState as useState2 } from "react";
716
- import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
687
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
717
688
  function PasswordChangeForm({ onSubmit, className }) {
718
689
  const [newPassword, setNewPassword] = useState2("");
719
690
  const [confirmPassword, setConfirmPassword] = useState2("");
@@ -743,10 +714,10 @@ function PasswordChangeForm({ onSubmit, className }) {
743
714
  }
744
715
  };
745
716
  return /* @__PURE__ */ jsxs5("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: [
746
- error && /* @__PURE__ */ jsx9("div", { role: "alert", children: error }),
717
+ error && /* @__PURE__ */ jsx8("div", { role: "alert", children: error }),
747
718
  /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
748
- /* @__PURE__ */ jsx9(Label, { htmlFor: "new-password", children: "New Password" }),
749
- /* @__PURE__ */ jsx9(
719
+ /* @__PURE__ */ jsx8(Label, { htmlFor: "new-password", children: "New Password" }),
720
+ /* @__PURE__ */ jsx8(
750
721
  Input,
751
722
  {
752
723
  id: "new-password",
@@ -759,8 +730,8 @@ function PasswordChangeForm({ onSubmit, className }) {
759
730
  )
760
731
  ] }),
761
732
  /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
762
- /* @__PURE__ */ jsx9(Label, { htmlFor: "confirm-password", children: "Confirm Password" }),
763
- /* @__PURE__ */ jsx9(
733
+ /* @__PURE__ */ jsx8(Label, { htmlFor: "confirm-password", children: "Confirm Password" }),
734
+ /* @__PURE__ */ jsx8(
764
735
  Input,
765
736
  {
766
737
  id: "confirm-password",
@@ -772,7 +743,7 @@ function PasswordChangeForm({ onSubmit, className }) {
772
743
  }
773
744
  )
774
745
  ] }),
775
- /* @__PURE__ */ jsx9(
746
+ /* @__PURE__ */ jsx8(
776
747
  Button,
777
748
  {
778
749
  type: "submit",
@@ -785,10 +756,10 @@ function PasswordChangeForm({ onSubmit, className }) {
785
756
  }
786
757
 
787
758
  // src/components/UserMenu/UserMenu.tsx
788
- import React8, { useCallback as useCallback2, useMemo as useMemo3, useState as useState3 } from "react";
759
+ import React7, { useCallback as useCallback2, useMemo as useMemo3, useState as useState3 } from "react";
789
760
  import { ChevronDown, LogOut, KeyRound } from "lucide-react";
790
- import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
791
- var UserMenu = React8.memo(function UserMenu2({
761
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
762
+ var UserMenu = React7.memo(function UserMenu2({
792
763
  user,
793
764
  onSignOut,
794
765
  onChangePassword,
@@ -813,34 +784,34 @@ var UserMenu = React8.memo(function UserMenu2({
813
784
  }
814
785
  return /* @__PURE__ */ jsxs6(Dialog, { open: isPasswordDialogOpen, onOpenChange: setPasswordDialogOpen, children: [
815
786
  /* @__PURE__ */ jsxs6(Select, { className, children: [
816
- /* @__PURE__ */ jsx10(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(Button, { variant: "outline", className: "flex items-center gap-2", "aria-label": userInfo.displayName, children: [
787
+ /* @__PURE__ */ jsx9(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(Button, { variant: "outline", className: "flex items-center gap-2", "aria-label": userInfo.displayName, children: [
817
788
  showAvatar && /* @__PURE__ */ jsxs6(Avatar, { className: "size-7", children: [
818
- /* @__PURE__ */ jsx10(AvatarImage, { src: userInfo.avatarUrl, alt: userInfo.displayName }),
819
- /* @__PURE__ */ jsx10(AvatarFallback, { children: userInfo.initial })
789
+ /* @__PURE__ */ jsx9(AvatarImage, { src: userInfo.avatarUrl, alt: userInfo.displayName }),
790
+ /* @__PURE__ */ jsx9(AvatarFallback, { children: userInfo.initial })
820
791
  ] }),
821
- /* @__PURE__ */ jsx10("span", { children: userInfo.displayName }),
822
- /* @__PURE__ */ jsx10(ChevronDown, { className: "h-4 w-4" })
792
+ /* @__PURE__ */ jsx9("span", { children: userInfo.displayName }),
793
+ /* @__PURE__ */ jsx9(ChevronDown, { className: "h-4 w-4" })
823
794
  ] }) }),
824
795
  /* @__PURE__ */ jsxs6(SelectContent, { children: [
825
- /* @__PURE__ */ jsx10(SelectLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col space-y-1", children: [
826
- /* @__PURE__ */ jsx10("p", { className: "font-medium", children: userInfo.displayName }),
827
- /* @__PURE__ */ jsx10("p", { className: "text-muted-foreground", children: userInfo.email })
796
+ /* @__PURE__ */ jsx9(SelectLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col space-y-1", children: [
797
+ /* @__PURE__ */ jsx9("p", { className: "font-medium", children: userInfo.displayName }),
798
+ /* @__PURE__ */ jsx9("p", { className: "text-muted-foreground", children: userInfo.email })
828
799
  ] }) }),
829
- /* @__PURE__ */ jsx10(SelectSeparator, {}),
830
- /* @__PURE__ */ jsx10(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(SelectItem, { value: "change-password", children: [
831
- /* @__PURE__ */ jsx10(KeyRound, { className: "mr-2 h-4 w-4" }),
832
- /* @__PURE__ */ jsx10("span", { children: "Change Password" })
800
+ /* @__PURE__ */ jsx9(SelectSeparator, {}),
801
+ /* @__PURE__ */ jsx9(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(SelectItem, { value: "change-password", children: [
802
+ /* @__PURE__ */ jsx9(KeyRound, { className: "mr-2 h-4 w-4" }),
803
+ /* @__PURE__ */ jsx9("span", { children: "Change Password" })
833
804
  ] }) }),
834
805
  /* @__PURE__ */ jsxs6(SelectItem, { value: "sign-out", onClick: handleSignOut, children: [
835
- /* @__PURE__ */ jsx10(LogOut, { className: "mr-2 h-4 w-4" }),
836
- /* @__PURE__ */ jsx10("span", { children: "Sign out" })
806
+ /* @__PURE__ */ jsx9(LogOut, { className: "mr-2 h-4 w-4" }),
807
+ /* @__PURE__ */ jsx9("span", { children: "Sign out" })
837
808
  ] })
838
809
  ] })
839
810
  ] }),
840
- /* @__PURE__ */ jsx10(DialogOverlay, {}),
811
+ /* @__PURE__ */ jsx9(DialogOverlay, {}),
841
812
  /* @__PURE__ */ jsxs6(DialogContent, { className, children: [
842
- /* @__PURE__ */ jsx10(DialogHeader, { children: /* @__PURE__ */ jsx10(DialogTitle, { children: "Change Password" }) }),
843
- /* @__PURE__ */ jsx10(
813
+ /* @__PURE__ */ jsx9(DialogHeader, { children: /* @__PURE__ */ jsx9(DialogTitle, { children: "Change Password" }) }),
814
+ /* @__PURE__ */ jsx9(
844
815
  PasswordChangeForm,
845
816
  {
846
817
  onSubmit: async ({ newPassword, confirmPassword }) => {
@@ -858,7 +829,7 @@ var UserMenu = React8.memo(function UserMenu2({
858
829
  ] })
859
830
  ] });
860
831
  });
861
- var UserMenuLoading = React8.memo(function UserMenuLoading2() {
832
+ var UserMenuLoading = React7.memo(function UserMenuLoading2() {
862
833
  return /* @__PURE__ */ jsxs6("div", { className: "relative inline-block text-left", children: [
863
834
  /* @__PURE__ */ jsxs6(
864
835
  "button",
@@ -867,23 +838,23 @@ var UserMenuLoading = React8.memo(function UserMenuLoading2() {
867
838
  disabled: true,
868
839
  className: "flex items-center space-x-2 px-3 py-2 text-sm font-medium text-muted-foreground bg-muted border border-input rounded-md",
869
840
  children: [
870
- /* @__PURE__ */ jsx10("div", { className: "w-6 h-6 rounded-full bg-muted animate-pulse" }),
871
- /* @__PURE__ */ jsx10("span", { className: "truncate max-w-[150px]", children: "Loading..." }),
872
- /* @__PURE__ */ jsx10(ChevronDown, { className: "w-4 h-4 text-muted-foreground" })
841
+ /* @__PURE__ */ jsx9("div", { className: "w-6 h-6 rounded-full bg-muted animate-pulse" }),
842
+ /* @__PURE__ */ jsx9("span", { className: "truncate max-w-[150px]", children: "Loading..." }),
843
+ /* @__PURE__ */ jsx9(ChevronDown, { className: "w-4 h-4 text-muted-foreground" })
873
844
  ]
874
845
  }
875
846
  ),
876
- /* @__PURE__ */ jsx10("div", { role: "status", "aria-label": "Loading user menu", "aria-live": "polite", className: "w-6 h-6 rounded-full bg-muted animate-pulse" })
847
+ /* @__PURE__ */ jsx9("div", { role: "status", "aria-label": "Loading user menu", "aria-live": "polite", className: "w-6 h-6 rounded-full bg-muted animate-pulse" })
877
848
  ] });
878
849
  });
879
850
  UserMenu.Loading = UserMenuLoading;
880
851
 
881
852
  // src/components/NavigationMenu/NavigationMenu.tsx
882
- import * as React9 from "react";
853
+ import * as React8 from "react";
883
854
  import { ChevronDown as ChevronDown2 } from "lucide-react";
884
855
  init_UnifiedAuthProvider2();
885
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
886
- var NavigationMenu = React9.forwardRef(({
856
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
857
+ var NavigationMenu = React8.forwardRef(({
887
858
  items,
888
859
  mode = "dropdown",
889
860
  currentPath,
@@ -901,8 +872,8 @@ var NavigationMenu = React9.forwardRef(({
901
872
  filterByPermissions = true,
902
873
  ...props
903
874
  }, ref) => {
904
- const [expandedItems, setExpandedItems] = React9.useState(/* @__PURE__ */ new Set());
905
- const buttonRef = React9.useRef(null);
875
+ const [expandedItems, setExpandedItems] = React8.useState(/* @__PURE__ */ new Set());
876
+ const buttonRef = React8.useRef(null);
906
877
  let authContext = null;
907
878
  try {
908
879
  authContext = useUnifiedAuth();
@@ -923,7 +894,7 @@ var NavigationMenu = React9.forwardRef(({
923
894
  selectedOrganisationId: selectedOrganisation?.id || null,
924
895
  selectedEventId: selectedEvent?.event_id || null
925
896
  });
926
- const stableScopeRef = React9.useRef({
897
+ const stableScopeRef = React8.useRef({
927
898
  organisationId: "",
928
899
  eventId: void 0,
929
900
  appId: void 0
@@ -954,8 +925,8 @@ var NavigationMenu = React9.forwardRef(({
954
925
  userId,
955
926
  stableScope
956
927
  );
957
- const previousFilteredItemsRef = React9.useRef([]);
958
- const filteredItems = React9.useMemo(() => {
928
+ const previousFilteredItemsRef = React8.useRef([]);
929
+ const filteredItems = React8.useMemo(() => {
959
930
  if (filterByPermissions) {
960
931
  if (!authContext || !rbacContext || scopeLoading || !resolvedScope?.organisationId) {
961
932
  return [];
@@ -1094,7 +1065,7 @@ var NavigationMenu = React9.forwardRef(({
1094
1065
  resolvedScope,
1095
1066
  auditLog
1096
1067
  ]);
1097
- React9.useEffect(() => {
1068
+ React8.useEffect(() => {
1098
1069
  if (auditLog && authContext) {
1099
1070
  console.log("[NavigationMenu] Navigation access attempt:", {
1100
1071
  itemId: "navigation-menu",
@@ -1228,7 +1199,7 @@ var NavigationMenu = React9.forwardRef(({
1228
1199
  const hasChildren = item.children && item.children.length > 0;
1229
1200
  const isExpanded = expandedItems.has(item.id);
1230
1201
  const itemIsActive = isActiveItem(item);
1231
- return /* @__PURE__ */ jsx11("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs7("div", { children: [
1202
+ return /* @__PURE__ */ jsx10("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs7("div", { children: [
1232
1203
  /* @__PURE__ */ jsxs7(
1233
1204
  "button",
1234
1205
  {
@@ -1238,21 +1209,21 @@ var NavigationMenu = React9.forwardRef(({
1238
1209
  "aria-controls": `submenu-${item.id}`,
1239
1210
  "aria-current": itemIsActive ? "page" : void 0,
1240
1211
  children: [
1241
- /* @__PURE__ */ jsx11("span", { children: item.label }),
1242
- /* @__PURE__ */ jsx11(ChevronDown2, { "aria-hidden": "true" })
1212
+ /* @__PURE__ */ jsx10("span", { children: item.label }),
1213
+ /* @__PURE__ */ jsx10(ChevronDown2, { "aria-hidden": "true" })
1243
1214
  ]
1244
1215
  }
1245
1216
  ),
1246
- isExpanded && item.children && /* @__PURE__ */ jsx11(
1217
+ isExpanded && item.children && /* @__PURE__ */ jsx10(
1247
1218
  "ul",
1248
1219
  {
1249
1220
  id: `submenu-${item.id}`,
1250
1221
  role: "menu",
1251
1222
  "aria-label": `${item.label} submenu`,
1252
- children: item.children.map((child) => /* @__PURE__ */ jsx11(React9.Fragment, { children: renderHierarchicalItem(child, level + 1) }, child.id))
1223
+ children: item.children.map((child) => /* @__PURE__ */ jsx10(React8.Fragment, { children: renderHierarchicalItem(child, level + 1) }, child.id))
1253
1224
  }
1254
1225
  )
1255
- ] }) : /* @__PURE__ */ jsx11(
1226
+ ] }) : /* @__PURE__ */ jsx10(
1256
1227
  "a",
1257
1228
  {
1258
1229
  href: item.href || "#",
@@ -1277,19 +1248,19 @@ var NavigationMenu = React9.forwardRef(({
1277
1248
  className,
1278
1249
  "data-testid": "navigation-menu-root",
1279
1250
  children: [
1280
- /* @__PURE__ */ jsx11(
1251
+ /* @__PURE__ */ jsx10(
1281
1252
  SelectTrigger,
1282
1253
  {
1283
1254
  ref: buttonRef,
1284
1255
  disabled,
1285
1256
  "aria-label": buttonText,
1286
1257
  "data-testid": "navigation-menu-trigger",
1287
- children: /* @__PURE__ */ jsx11(SelectValue, { placeholder: buttonText })
1258
+ children: /* @__PURE__ */ jsx10(SelectValue, { placeholder: buttonText })
1288
1259
  }
1289
1260
  ),
1290
- /* @__PURE__ */ jsx11(SelectContent, { children: filteredItems.map((item) => {
1261
+ /* @__PURE__ */ jsx10(SelectContent, { children: filteredItems.map((item) => {
1291
1262
  const isActive = isActiveItem(item);
1292
- return /* @__PURE__ */ jsx11(
1263
+ return /* @__PURE__ */ jsx10(
1293
1264
  SelectItem,
1294
1265
  {
1295
1266
  value: item.id,
@@ -1304,14 +1275,14 @@ var NavigationMenu = React9.forwardRef(({
1304
1275
  }
1305
1276
  );
1306
1277
  }
1307
- return /* @__PURE__ */ jsx11(
1278
+ return /* @__PURE__ */ jsx10(
1308
1279
  "nav",
1309
1280
  {
1310
1281
  ref,
1311
1282
  className,
1312
1283
  "aria-label": navigationLabel,
1313
1284
  ...props,
1314
- children: /* @__PURE__ */ jsx11("ul", { role: "menubar", children: filteredItems.map((item) => /* @__PURE__ */ jsx11(React9.Fragment, { children: renderHierarchicalItem(item, 0) }, item.id)) })
1285
+ children: /* @__PURE__ */ jsx10("ul", { role: "menubar", children: filteredItems.map((item) => /* @__PURE__ */ jsx10(React8.Fragment, { children: renderHierarchicalItem(item, 0) }, item.id)) })
1315
1286
  }
1316
1287
  );
1317
1288
  });
@@ -1319,7 +1290,7 @@ NavigationMenu.displayName = "NavigationMenu";
1319
1290
 
1320
1291
  // src/components/Header/Header.tsx
1321
1292
  import { Link } from "react-router-dom";
1322
- import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
1293
+ import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
1323
1294
  function Header({
1324
1295
  logoUrl,
1325
1296
  logoAlt = "Logo",
@@ -1337,32 +1308,32 @@ function Header({
1337
1308
  onNavigate,
1338
1309
  logoHref
1339
1310
  }) {
1340
- return /* @__PURE__ */ jsx12("header", { className: cn(
1311
+ return /* @__PURE__ */ jsx11("header", { className: cn(
1341
1312
  "w-full border-b border-main-200 h-16 shadow-sm bg-main-100 ",
1342
1313
  className
1343
1314
  ), role: "banner", children: /* @__PURE__ */ jsxs8("nav", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto grid grid-cols-[auto_auto_1fr_auto] gap-4 h-full items-center", children: [
1344
- logo ? logoHref ? /* @__PURE__ */ jsx12(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: logo }) : logo : logoUrl ? logoHref ? /* @__PURE__ */ jsx12(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx12(
1315
+ logo ? logoHref ? /* @__PURE__ */ jsx11(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: logo }) : logo : logoUrl ? logoHref ? /* @__PURE__ */ jsx11(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx11(
1345
1316
  "img",
1346
1317
  {
1347
1318
  src: logoUrl,
1348
1319
  alt: logoAlt || "Logo",
1349
1320
  className: "h-[2.15rem] w-auto max-w-[200px] object-contain rounded-md shadow-md bg-transparent"
1350
1321
  }
1351
- ) }) : /* @__PURE__ */ jsx12(
1322
+ ) }) : /* @__PURE__ */ jsx11(
1352
1323
  "img",
1353
1324
  {
1354
1325
  src: logoUrl,
1355
1326
  alt: logoAlt || "Logo",
1356
1327
  className: "h-[2.15rem] w-auto max-w-[200px] object-contain rounded-md shadow-md bg-transparent"
1357
1328
  }
1358
- ) : logoHref ? /* @__PURE__ */ jsx12(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx12(
1329
+ ) : logoHref ? /* @__PURE__ */ jsx11(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx11(
1359
1330
  "img",
1360
1331
  {
1361
1332
  src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23000'/%3E%3Ctext x='16' y='20' text-anchor='middle' fill='white' font-family='Arial' font-size='14' font-weight='bold'%3EL%3C/text%3E%3C/svg%3E",
1362
1333
  alt: logoAlt || "Logo",
1363
1334
  className: "h-8 w-8 shadow-md"
1364
1335
  }
1365
- ) }) : /* @__PURE__ */ jsx12(
1336
+ ) }) : /* @__PURE__ */ jsx11(
1366
1337
  "img",
1367
1338
  {
1368
1339
  src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23000'/%3E%3Ctext x='16' y='20' text-anchor='middle' fill='white' font-family='Arial' font-size='14' font-weight='bold'%3EL%3C/text%3E%3C/svg%3E",
@@ -1370,7 +1341,7 @@ function Header({
1370
1341
  className: "h-8 w-8 shadow-md"
1371
1342
  }
1372
1343
  ),
1373
- navItems && navItems.length > 0 && /* @__PURE__ */ jsx12(
1344
+ navItems && navItems.length > 0 && /* @__PURE__ */ jsx11(
1374
1345
  NavigationMenu,
1375
1346
  {
1376
1347
  items: navItems,
@@ -1380,16 +1351,16 @@ function Header({
1380
1351
  className: "w-48"
1381
1352
  }
1382
1353
  ),
1383
- showEventSelector ? /* @__PURE__ */ jsx12(
1354
+ showEventSelector ? /* @__PURE__ */ jsx11(
1384
1355
  EventSelector,
1385
1356
  {
1386
1357
  placeholder: "Select event",
1387
1358
  className: "justify-self-end w-96",
1388
1359
  "data-testid": "event-selector"
1389
1360
  }
1390
- ) : /* @__PURE__ */ jsx12("del", { className: "justify-self-end invisible", children: "Event Selector N/A" }),
1361
+ ) : /* @__PURE__ */ jsx11("del", { className: "justify-self-end invisible", children: "Event Selector N/A" }),
1391
1362
  actions,
1392
- showUserMenu && (userMenu ? userMenu : /* @__PURE__ */ jsx12(
1363
+ showUserMenu && (userMenu ? userMenu : /* @__PURE__ */ jsx11(
1393
1364
  UserMenu,
1394
1365
  {
1395
1366
  user: user || null,
@@ -1402,8 +1373,8 @@ function Header({
1402
1373
  }
1403
1374
 
1404
1375
  // src/components/Footer/Footer.tsx
1405
- import React10 from "react";
1406
- import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
1376
+ import React9 from "react";
1377
+ import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
1407
1378
  var FooterComponent = ({
1408
1379
  companyName = "Solvera Solutions Pty Ltd",
1409
1380
  year = (/* @__PURE__ */ new Date()).getFullYear(),
@@ -1414,15 +1385,15 @@ var FooterComponent = ({
1414
1385
  children
1415
1386
  }) => {
1416
1387
  const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
1417
- return /* @__PURE__ */ jsx13("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs9("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
1418
- logo && /* @__PURE__ */ jsx13("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
1419
- children && /* @__PURE__ */ jsx13(Fragment3, { children }),
1420
- /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: copyrightText }),
1421
- links && links.length > 0 && /* @__PURE__ */ jsx13("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsx13("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
1388
+ return /* @__PURE__ */ jsx12("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs9("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
1389
+ logo && /* @__PURE__ */ jsx12("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
1390
+ children && /* @__PURE__ */ jsx12(Fragment3, { children }),
1391
+ /* @__PURE__ */ jsx12("span", { className: "text-muted-foreground", children: copyrightText }),
1392
+ links && links.length > 0 && /* @__PURE__ */ jsx12("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx12("li", { children: /* @__PURE__ */ jsx12("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
1422
1393
  ] }) });
1423
1394
  };
1424
1395
  FooterComponent.displayName = "Footer";
1425
- var Footer = React10.memo(FooterComponent);
1396
+ var Footer = React9.memo(FooterComponent);
1426
1397
  Footer.displayName = "Footer";
1427
1398
 
1428
1399
  // src/components/PaceAppLayout/PaceAppLayout.tsx
@@ -1430,7 +1401,7 @@ init_UnifiedAuthProvider2();
1430
1401
  init_useOrganisations();
1431
1402
  import { useState as useState5, useEffect as useEffect3, useMemo as useMemo5 } from "react";
1432
1403
  import { Outlet, useNavigate, useLocation } from "react-router-dom";
1433
- import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
1404
+ import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
1434
1405
  var EMPTY_PAGE_ID_MAPPING = {};
1435
1406
  var EMPTY_ROUTE_PERMISSIONS = {};
1436
1407
  function PaceAppLayout({
@@ -1503,7 +1474,11 @@ function PaceAppLayout({
1503
1474
  }, [location.pathname, routePermissions, defaultPermission]);
1504
1475
  const currentPageId = useMemo5(() => {
1505
1476
  const currentPath = location.pathname;
1506
- return pageIdMapping[currentPath] || currentPath.slice(1) || "home";
1477
+ if (pageIdMapping[currentPath]) {
1478
+ return pageIdMapping[currentPath];
1479
+ }
1480
+ const pathSegments = currentPath.slice(1).split("/").filter(Boolean);
1481
+ return pathSegments[0] || "home";
1507
1482
  }, [location.pathname, pageIdMapping]);
1508
1483
  const currentPermission = useMemo5(() => {
1509
1484
  if (!enforcePermissions) {
@@ -1512,7 +1487,29 @@ function PaceAppLayout({
1512
1487
  const permissionString = `${currentRoutePermission}:page.${currentPageId}`;
1513
1488
  return permissionString;
1514
1489
  }, [enforcePermissions, currentRoutePermission, currentPageId]);
1515
- const { can, isLoading: isCheckingPermission, error: permissionError } = useCan(
1490
+ const [isSuperAdminUser, setIsSuperAdminUser] = useState5(false);
1491
+ const [isCheckingSuperAdmin, setIsCheckingSuperAdmin] = useState5(false);
1492
+ useEffect3(() => {
1493
+ const checkSuperAdminStatus = async () => {
1494
+ if (!user?.id) {
1495
+ setIsSuperAdminUser(false);
1496
+ setIsCheckingSuperAdmin(false);
1497
+ return;
1498
+ }
1499
+ setIsCheckingSuperAdmin(true);
1500
+ try {
1501
+ const superAdminStatus = await isSuperAdmin(user.id);
1502
+ setIsSuperAdminUser(superAdminStatus);
1503
+ } catch (error) {
1504
+ console.error("[PaceAppLayout] Error checking super admin status:", error);
1505
+ setIsSuperAdminUser(false);
1506
+ } finally {
1507
+ setIsCheckingSuperAdmin(false);
1508
+ }
1509
+ };
1510
+ checkSuperAdminStatus();
1511
+ }, [user?.id]);
1512
+ const { can: canFromHook, isLoading: isCheckingPermission, error: permissionError } = useCan(
1516
1513
  user?.id || "",
1517
1514
  scope,
1518
1515
  currentPermission,
@@ -1520,39 +1517,31 @@ function PaceAppLayout({
1520
1517
  true
1521
1518
  // useCache
1522
1519
  );
1520
+ const can = isSuperAdminUser ? true : canFromHook;
1523
1521
  const hasPermission = enforcePermissions ? can : true;
1524
1522
  useEffect3(() => {
1525
1523
  if (!enforcePermissions) {
1526
1524
  return;
1527
1525
  }
1528
- if (isCheckingPermission) {
1526
+ if (isCheckingSuperAdmin || isCheckingPermission) {
1529
1527
  return;
1530
1528
  }
1531
- if (auditLog) {
1532
- console.log(`[PaceAppLayout] Page access attempt:`, {
1533
- pageName: currentPageId,
1534
- operation: currentRoutePermission,
1535
- userId: user?.id,
1536
- allowed: can,
1537
- strictMode,
1538
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1539
- });
1540
- }
1541
- if (strictMode && !can) {
1529
+ if (strictMode && !isSuperAdminUser && !can) {
1542
1530
  console.error(`[PaceAppLayout] STRICT MODE VIOLATION: User attempted to access protected page without permission`, {
1543
1531
  pageName: currentPageId,
1544
1532
  operation: currentRoutePermission,
1545
1533
  userId: user?.id,
1534
+ isSuperAdmin: isSuperAdminUser,
1546
1535
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
1547
1536
  });
1548
1537
  if (onStrictModeViolation) {
1549
1538
  onStrictModeViolation(currentPageId, currentRoutePermission);
1550
1539
  }
1551
1540
  }
1552
- if (!can && onPageAccessDenied) {
1541
+ if (!isSuperAdminUser && !can && onPageAccessDenied) {
1553
1542
  onPageAccessDenied(currentPageId, currentRoutePermission);
1554
1543
  }
1555
- }, [enforcePermissions, can, isCheckingPermission, currentPageId, currentRoutePermission, user?.id, strictMode, auditLog, onPageAccessDenied, onStrictModeViolation]);
1544
+ }, [enforcePermissions, can, isCheckingPermission, isCheckingSuperAdmin, isSuperAdminUser, currentPageId, currentRoutePermission, user?.id, strictMode, auditLog, onPageAccessDenied, onStrictModeViolation]);
1556
1545
  const [filteredMenuItems, setFilteredMenuItems] = useState5(baseMenuItems);
1557
1546
  useEffect3(() => {
1558
1547
  if (!filterNavigationByPermissions) {
@@ -1605,15 +1594,6 @@ function PaceAppLayout({
1605
1594
  const permission = routePermissions[item.href] || defaultPermission;
1606
1595
  const fullPermission = permission.includes(":") ? permission : pageId ? `${permission}:page.${pageId}` : permission;
1607
1596
  const hasAccess = permissionMap["*"] === true || permissionMap[fullPermission] === true;
1608
- if (auditLog) {
1609
- console.log(`[PaceAppLayout] Navigation filtering:`, {
1610
- item: item.label,
1611
- href: item.href,
1612
- pageId,
1613
- permission: fullPermission,
1614
- hasAccess
1615
- });
1616
- }
1617
1597
  return { item, hasAccess };
1618
1598
  });
1619
1599
  if (!isMounted) return;
@@ -1669,7 +1649,7 @@ function PaceAppLayout({
1669
1649
  }
1670
1650
  }
1671
1651
  if (hasAccess && currentRoute.roles && currentRoute.roles.length > 0 && user?.id) {
1672
- const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-6C47WIML.js");
1652
+ const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-CQDZRJIS.js");
1673
1653
  hasAccess = true;
1674
1654
  }
1675
1655
  if (!isMounted) return;
@@ -1693,17 +1673,6 @@ function PaceAppLayout({
1693
1673
  navigate(fallbackRoute, { replace: true });
1694
1674
  return;
1695
1675
  }
1696
- if (auditLog) {
1697
- console.log(`[PaceAppLayout] Route access attempt:`, {
1698
- route: currentPath,
1699
- userId: user?.id,
1700
- allowed: hasAccess,
1701
- permissions: currentRoute.permissions,
1702
- roles: currentRoute.roles,
1703
- accessLevel: currentRoute.accessLevel,
1704
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1705
- });
1706
- }
1707
1676
  };
1708
1677
  checkRouteAccess();
1709
1678
  return () => {
@@ -1720,32 +1689,32 @@ function PaceAppLayout({
1720
1689
  }
1721
1690
  return result || { error: null };
1722
1691
  };
1723
- if (enforcePermissions && isCheckingPermission) {
1724
- return /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
1725
- /* @__PURE__ */ jsx14("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-sec-900 mx-auto mb-4" }),
1726
- /* @__PURE__ */ jsx14("p", { className: "text-sec-600", children: "Checking permissions..." })
1692
+ if (enforcePermissions && (isCheckingSuperAdmin || isCheckingPermission)) {
1693
+ return /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
1694
+ /* @__PURE__ */ jsx13("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-sec-900 mx-auto mb-4" }),
1695
+ /* @__PURE__ */ jsx13("p", { className: "text-sec-600", children: "Checking permissions..." })
1727
1696
  ] }) });
1728
1697
  }
1729
1698
  if (enforcePermissions && permissionError) {
1730
- return /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
1731
- /* @__PURE__ */ jsx14("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Permission Error" }),
1732
- /* @__PURE__ */ jsx14("p", { className: "text-sec-600 mb-4", children: permissionError.message }),
1733
- /* @__PURE__ */ jsx14(Button, { onClick: () => navigate("/"), children: "Go Home" })
1699
+ return /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
1700
+ /* @__PURE__ */ jsx13("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Permission Error" }),
1701
+ /* @__PURE__ */ jsx13("p", { className: "text-sec-600 mb-4", children: permissionError.message }),
1702
+ /* @__PURE__ */ jsx13(Button, { onClick: () => navigate("/"), children: "Go Home" })
1734
1703
  ] }) });
1735
1704
  }
1736
1705
  if (enforcePermissions && hasPermission === false) {
1737
1706
  if (enforcePagePermissions && pagePermissionFallback) {
1738
- return /* @__PURE__ */ jsx14(Fragment4, { children: pagePermissionFallback });
1707
+ return /* @__PURE__ */ jsx13(Fragment4, { children: pagePermissionFallback });
1739
1708
  }
1740
1709
  if (permissionFallback) {
1741
- return /* @__PURE__ */ jsx14(Fragment4, { children: permissionFallback });
1710
+ return /* @__PURE__ */ jsx13(Fragment4, { children: permissionFallback });
1742
1711
  }
1743
- return /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
1744
- /* @__PURE__ */ jsx14("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Access Denied" }),
1745
- /* @__PURE__ */ jsx14("p", { className: "text-sec-600 mb-4", children: "You don't have permission to access this page." }),
1712
+ return /* @__PURE__ */ jsx13("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
1713
+ /* @__PURE__ */ jsx13("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Access Denied" }),
1714
+ /* @__PURE__ */ jsx13("p", { className: "text-sec-600 mb-4", children: "You don't have permission to access this page." }),
1746
1715
  /* @__PURE__ */ jsxs10("div", { className: "flex gap-2 justify-center", children: [
1747
- /* @__PURE__ */ jsx14(Button, { onClick: () => navigate("/"), children: "Go Home" }),
1748
- /* @__PURE__ */ jsx14(
1716
+ /* @__PURE__ */ jsx13(Button, { onClick: () => navigate("/"), children: "Go Home" }),
1717
+ /* @__PURE__ */ jsx13(
1749
1718
  Button,
1750
1719
  {
1751
1720
  variant: "outline",
@@ -1760,7 +1729,7 @@ function PaceAppLayout({
1760
1729
  ] }) });
1761
1730
  }
1762
1731
  return /* @__PURE__ */ jsxs10(Fragment4, { children: [
1763
- /* @__PURE__ */ jsx14(
1732
+ /* @__PURE__ */ jsx13(
1764
1733
  Header,
1765
1734
  {
1766
1735
  logo: customLogo || void 0,
@@ -1784,8 +1753,8 @@ function PaceAppLayout({
1784
1753
  className: headerClassName || "sticky top-0 z-[40] w-full"
1785
1754
  }
1786
1755
  ),
1787
- /* @__PURE__ */ jsx14("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: /* @__PURE__ */ jsx14(Outlet, {}) }),
1788
- /* @__PURE__ */ jsx14(Footer, {})
1756
+ /* @__PURE__ */ jsx13("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: /* @__PURE__ */ jsx13(Outlet, {}) }),
1757
+ /* @__PURE__ */ jsx13(Footer, {})
1789
1758
  ] });
1790
1759
  }
1791
1760
 
@@ -1793,7 +1762,7 @@ function PaceAppLayout({
1793
1762
  import { useEffect as useEffect4, useState as useState6, useContext } from "react";
1794
1763
  import { useNavigate as useNavigate2, useLocation as useLocation2 } from "react-router-dom";
1795
1764
  init_EventServiceProvider();
1796
- import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
1765
+ import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
1797
1766
  var PaceLoginPage = ({
1798
1767
  appName = "Pace",
1799
1768
  onSuccessRedirectPath = "/",
@@ -1925,7 +1894,7 @@ var PaceLoginPage = ({
1925
1894
  }
1926
1895
  };
1927
1896
  return /* @__PURE__ */ jsxs11("main", { className: "min-h-screen grid mx-auto w-fit content-center justify-items-center gap-y-8", "aria-label": `${appName} Login Page`, children: [
1928
- /* @__PURE__ */ jsx15(
1897
+ /* @__PURE__ */ jsx14(
1929
1898
  "img",
1930
1899
  {
1931
1900
  src: `/${appName.toLowerCase()}_logo_square.svg`,
@@ -1933,7 +1902,7 @@ var PaceLoginPage = ({
1933
1902
  className: "h-48"
1934
1903
  }
1935
1904
  ),
1936
- /* @__PURE__ */ jsx15(
1905
+ /* @__PURE__ */ jsx14(
1937
1906
  LoginForm,
1938
1907
  {
1939
1908
  className: "w-md",
@@ -1947,15 +1916,15 @@ var PaceLoginPage = ({
1947
1916
  ),
1948
1917
  (() => {
1949
1918
  const benign = !!(authError && (authError.name === "AuthSessionMissingError" || /Auth session missing/i.test(authError.message)));
1950
- return authError && !benign ? /* @__PURE__ */ jsx15("em", { className: "mt-4 text-destructive text-center", children: authError.message }) : null;
1919
+ return authError && !benign ? /* @__PURE__ */ jsx14("em", { className: "mt-4 text-destructive text-center", children: authError.message }) : null;
1951
1920
  })(),
1952
- accessError && /* @__PURE__ */ jsx15("em", { className: "mt-4 text-destructive text-center", children: accessError }),
1953
- isCheckingAccess && /* @__PURE__ */ jsx15("em", { className: "mt-4 text-muted-foreground text-center", children: "Checking permissions..." })
1921
+ accessError && /* @__PURE__ */ jsx14("em", { className: "mt-4 text-destructive text-center", children: accessError }),
1922
+ isCheckingAccess && /* @__PURE__ */ jsx14("em", { className: "mt-4 text-muted-foreground text-center", children: "Checking permissions..." })
1954
1923
  ] });
1955
1924
  };
1956
1925
 
1957
1926
  // src/components/SessionRestorationLoader.tsx
1958
- import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
1927
+ import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
1959
1928
  var SessionRestorationLoader = ({
1960
1929
  message = "Restoring session..."
1961
1930
  }) => {
@@ -1975,8 +1944,8 @@ var SessionRestorationLoader = ({
1975
1944
  background: "var(--background, transparent)"
1976
1945
  },
1977
1946
  children: [
1978
- /* @__PURE__ */ jsx16(LoadingSpinner, { size: "lg" }),
1979
- /* @__PURE__ */ jsx16(
1947
+ /* @__PURE__ */ jsx15(LoadingSpinner, { size: "lg" }),
1948
+ /* @__PURE__ */ jsx15(
1980
1949
  "div",
1981
1950
  {
1982
1951
  style: {
@@ -1996,7 +1965,7 @@ init_UnifiedAuthProvider();
1996
1965
  init_useSessionRestoration();
1997
1966
  import { useMemo as useMemo6 } from "react";
1998
1967
  import { Navigate, Outlet as Outlet2 } from "react-router-dom";
1999
- import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
1968
+ import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
2000
1969
  function ProtectedRoute({
2001
1970
  requireEvent = true,
2002
1971
  allowSuperAdminBypass = false,
@@ -2016,13 +1985,13 @@ function ProtectedRoute({
2016
1985
  sessionRestoration.hasTimedOut
2017
1986
  ]);
2018
1987
  if (isRestoringSession) {
2019
- return /* @__PURE__ */ jsx17(SessionRestorationLoader, {});
1988
+ return /* @__PURE__ */ jsx16(SessionRestorationLoader, {});
2020
1989
  }
2021
1990
  if (requireEvent && eventLoading) {
2022
- return /* @__PURE__ */ jsx17(Outlet2, {});
1991
+ return /* @__PURE__ */ jsx16(Outlet2, {});
2023
1992
  }
2024
1993
  if (authLoading && !sessionRestoration.hasTimedOut) {
2025
- return loadingFallback || /* @__PURE__ */ jsx17("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx17(LoadingSpinner, {}) });
1994
+ return loadingFallback || /* @__PURE__ */ jsx16("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx16(LoadingSpinner, {}) });
2026
1995
  }
2027
1996
  if (!isAuthenticated) {
2028
1997
  if (sessionRestoration.hasTimedOut || sessionRestoration.restorationError) {
@@ -2031,27 +2000,27 @@ function ProtectedRoute({
2031
2000
  error: sessionRestoration.restorationError?.message
2032
2001
  });
2033
2002
  }
2034
- return /* @__PURE__ */ jsx17(Navigate, { to: loginPath, replace: true });
2003
+ return /* @__PURE__ */ jsx16(Navigate, { to: loginPath, replace: true });
2035
2004
  }
2036
2005
  if (!requireEvent) {
2037
- return /* @__PURE__ */ jsx17(Outlet2, {});
2006
+ return /* @__PURE__ */ jsx16(Outlet2, {});
2038
2007
  }
2039
2008
  if (!events || events.length === 0) {
2040
- return noEventsFallback || /* @__PURE__ */ jsx17("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh", padding: "2rem" }, children: /* @__PURE__ */ jsxs13(Alert, { variant: "destructive", className: "max-w-md", children: [
2041
- /* @__PURE__ */ jsx17(AlertTitle, { children: "No Events Available" }),
2042
- /* @__PURE__ */ jsx17(AlertDescription, { children: "You don't have access to any events. Please contact your administrator if you believe this is an error." })
2009
+ return noEventsFallback || /* @__PURE__ */ jsx16("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh", padding: "2rem" }, children: /* @__PURE__ */ jsxs13(Alert, { variant: "destructive", className: "max-w-md", children: [
2010
+ /* @__PURE__ */ jsx16(AlertTitle, { children: "No Events Available" }),
2011
+ /* @__PURE__ */ jsx16(AlertDescription, { children: "You don't have access to any events. Please contact your administrator if you believe this is an error." })
2043
2012
  ] }) });
2044
2013
  }
2045
2014
  if (!selectedEvent) {
2046
2015
  console.debug("[ProtectedRoute] Events available but none selected - allowing render so selector is visible");
2047
- return /* @__PURE__ */ jsx17(Outlet2, {});
2016
+ return /* @__PURE__ */ jsx16(Outlet2, {});
2048
2017
  }
2049
- return /* @__PURE__ */ jsx17(Outlet2, {});
2018
+ return /* @__PURE__ */ jsx16(Outlet2, {});
2050
2019
  }
2051
2020
 
2052
2021
  // src/components/ErrorBoundary/ErrorBoundary.tsx
2053
2022
  import { Component } from "react";
2054
- import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
2023
+ import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
2055
2024
  var ErrorBoundary = class extends Component {
2056
2025
  constructor(props) {
2057
2026
  super(props);
@@ -2124,20 +2093,20 @@ var ErrorBoundary = class extends Component {
2124
2093
  if (fallback) {
2125
2094
  return fallback;
2126
2095
  }
2127
- return /* @__PURE__ */ jsx18(
2096
+ return /* @__PURE__ */ jsx17(
2128
2097
  "div",
2129
2098
  {
2130
2099
  role: "alert",
2131
2100
  className: "p-6 bg-destructive/10 border border-destructive/20 rounded-lg",
2132
2101
  "data-error-boundary": errorId,
2133
2102
  children: /* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-3", children: [
2134
- /* @__PURE__ */ jsx18("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx18("svg", { className: "w-5 h-5 text-destructive", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx18("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }) }),
2103
+ /* @__PURE__ */ jsx17("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx17("svg", { className: "w-5 h-5 text-destructive", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx17("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }) }),
2135
2104
  /* @__PURE__ */ jsxs14("div", { className: "flex-1 min-w-0", children: [
2136
2105
  /* @__PURE__ */ jsxs14("h3", { className: "text-destructive", children: [
2137
2106
  "Error in ",
2138
2107
  componentName
2139
2108
  ] }),
2140
- /* @__PURE__ */ jsx18("p", { className: "text-destructive/80", children: this.state.error?.message || "An unexpected error occurred." }),
2109
+ /* @__PURE__ */ jsx17("p", { className: "text-destructive/80", children: this.state.error?.message || "An unexpected error occurred." }),
2141
2110
  enableRetry && retryCount < maxRetries && /* @__PURE__ */ jsxs14("div", { className: "flex gap-3 mb-4", children: [
2142
2111
  /* @__PURE__ */ jsxs14(
2143
2112
  "button",
@@ -2153,7 +2122,7 @@ var ErrorBoundary = class extends Component {
2153
2122
  ]
2154
2123
  }
2155
2124
  ),
2156
- /* @__PURE__ */ jsx18(
2125
+ /* @__PURE__ */ jsx17(
2157
2126
  "button",
2158
2127
  {
2159
2128
  onClick: () => window.location.reload(),
@@ -2163,8 +2132,8 @@ var ErrorBoundary = class extends Component {
2163
2132
  )
2164
2133
  ] }),
2165
2134
  retryCount >= maxRetries && /* @__PURE__ */ jsxs14("div", { className: "mb-4 p-3 bg-acc-50 border border-acc-200 rounded-md", children: [
2166
- /* @__PURE__ */ jsx18("p", { className: "text-acc-800", children: "Maximum retry attempts reached. Please reload the page or contact support." }),
2167
- /* @__PURE__ */ jsx18(
2135
+ /* @__PURE__ */ jsx17("p", { className: "text-acc-800", children: "Maximum retry attempts reached. Please reload the page or contact support." }),
2136
+ /* @__PURE__ */ jsx17(
2168
2137
  "button",
2169
2138
  {
2170
2139
  onClick: () => window.location.reload(),
@@ -2174,7 +2143,7 @@ var ErrorBoundary = class extends Component {
2174
2143
  )
2175
2144
  ] }),
2176
2145
  import.meta.env.MODE === "development" && this.state.error && /* @__PURE__ */ jsxs14("details", { className: "text-sm text-destructive/70", children: [
2177
- /* @__PURE__ */ jsx18("summary", { className: "cursor-pointer font-medium mb-2", children: "Error Details (Development)" }),
2146
+ /* @__PURE__ */ jsx17("summary", { className: "cursor-pointer font-medium mb-2", children: "Error Details (Development)" }),
2178
2147
  /* @__PURE__ */ jsxs14("div", { className: "bg-destructive/5 p-3 rounded border", children: [
2179
2148
  /* @__PURE__ */ jsxs14("p", { className: "font-mono", children: [
2180
2149
  "Error ID: ",
@@ -2199,7 +2168,7 @@ var ErrorBoundary = class extends Component {
2199
2168
  import { useState as useState7, useCallback as useCallback4 } from "react";
2200
2169
  init_OrganisationProvider();
2201
2170
  import { RefreshCw as RefreshCw2, AlertCircle as AlertCircle2, Building2, Shield } from "lucide-react";
2202
- import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
2171
+ import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
2203
2172
  function OrganisationSelector({
2204
2173
  placeholder = "Select organisation",
2205
2174
  className,
@@ -2264,14 +2233,14 @@ function OrganisationSelector({
2264
2233
  }, [refreshOrganisations]);
2265
2234
  if (orgLoading) {
2266
2235
  return /* @__PURE__ */ jsxs15("div", { className: `flex items-center gap-2 ${className}`, children: [
2267
- /* @__PURE__ */ jsx19(LoadingSpinner, { size: "sm" }),
2268
- /* @__PURE__ */ jsx19("span", { className: "text-sm text-muted-foreground", children: compact ? "Loading..." : "Loading organisations..." })
2236
+ /* @__PURE__ */ jsx18(LoadingSpinner, { size: "sm" }),
2237
+ /* @__PURE__ */ jsx18("span", { className: "text-sm text-muted-foreground", children: compact ? "Loading..." : "Loading organisations..." })
2269
2238
  ] });
2270
2239
  }
2271
2240
  if (orgError) {
2272
2241
  return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
2273
2242
  /* @__PURE__ */ jsxs15(Alert, { variant: "destructive", children: [
2274
- /* @__PURE__ */ jsx19(AlertCircle2, { className: "h-4 w-4" }),
2243
+ /* @__PURE__ */ jsx18(AlertCircle2, { className: "h-4 w-4" }),
2275
2244
  /* @__PURE__ */ jsxs15(AlertDescription, { children: [
2276
2245
  "Failed to load organisations: ",
2277
2246
  orgError.message
@@ -2286,7 +2255,7 @@ function OrganisationSelector({
2286
2255
  disabled: isLoading,
2287
2256
  className: "w-full",
2288
2257
  children: [
2289
- /* @__PURE__ */ jsx19(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
2258
+ /* @__PURE__ */ jsx18(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
2290
2259
  "Retry"
2291
2260
  ]
2292
2261
  }
@@ -2297,8 +2266,8 @@ function OrganisationSelector({
2297
2266
  if (showNoOrganisationsMessage) {
2298
2267
  return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
2299
2268
  /* @__PURE__ */ jsxs15(Alert, { children: [
2300
- /* @__PURE__ */ jsx19(Building2, { className: "h-4 w-4" }),
2301
- /* @__PURE__ */ jsx19(AlertDescription, { children: "No organisations available. Please contact your administrator to be added to an organisation." })
2269
+ /* @__PURE__ */ jsx18(Building2, { className: "h-4 w-4" }),
2270
+ /* @__PURE__ */ jsx18(AlertDescription, { children: "No organisations available. Please contact your administrator to be added to an organisation." })
2302
2271
  ] }),
2303
2272
  showRetryButton && /* @__PURE__ */ jsxs15(
2304
2273
  Button,
@@ -2309,7 +2278,7 @@ function OrganisationSelector({
2309
2278
  disabled: isLoading,
2310
2279
  className: "w-full",
2311
2280
  children: [
2312
- /* @__PURE__ */ jsx19(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
2281
+ /* @__PURE__ */ jsx18(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
2313
2282
  "Check Again"
2314
2283
  ]
2315
2284
  }
@@ -2319,8 +2288,8 @@ function OrganisationSelector({
2319
2288
  return null;
2320
2289
  }
2321
2290
  const switchErrorDisplay = switchError && /* @__PURE__ */ jsxs15(Alert, { variant: "destructive", className: "mt-2", children: [
2322
- /* @__PURE__ */ jsx19(AlertCircle2, { className: "h-4 w-4" }),
2323
- /* @__PURE__ */ jsx19(AlertDescription, { children: switchError })
2291
+ /* @__PURE__ */ jsx18(AlertCircle2, { className: "h-4 w-4" }),
2292
+ /* @__PURE__ */ jsx18(AlertDescription, { children: switchError })
2324
2293
  ] });
2325
2294
  return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
2326
2295
  /* @__PURE__ */ jsxs15(
@@ -2330,14 +2299,14 @@ function OrganisationSelector({
2330
2299
  onValueChange: handleOrganisationChange,
2331
2300
  disabled: disabled || isLoading || !selectedOrganisation,
2332
2301
  children: [
2333
- /* @__PURE__ */ jsx19(SelectTrigger, { className: `${isLoading ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
2334
- isLoading ? /* @__PURE__ */ jsx19(LoadingSpinner, { size: "sm" }) : /* @__PURE__ */ jsx19(Building2, { className: "h-4 w-4 text-muted-foreground" }),
2335
- /* @__PURE__ */ jsx19(SelectValue, { placeholder })
2302
+ /* @__PURE__ */ jsx18(SelectTrigger, { className: `${isLoading ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
2303
+ isLoading ? /* @__PURE__ */ jsx18(LoadingSpinner, { size: "sm" }) : /* @__PURE__ */ jsx18(Building2, { className: "h-4 w-4 text-muted-foreground" }),
2304
+ /* @__PURE__ */ jsx18(SelectValue, { placeholder })
2336
2305
  ] }) }),
2337
- /* @__PURE__ */ jsx19(SelectContent, { children: organisations.map((org) => {
2306
+ /* @__PURE__ */ jsx18(SelectContent, { children: organisations.map((org) => {
2338
2307
  const userRole = getUserRole(org.id);
2339
2308
  const hasAccess = validateOrganisationAccess(org.id);
2340
- return /* @__PURE__ */ jsx19(
2309
+ return /* @__PURE__ */ jsx18(
2341
2310
  SelectItem,
2342
2311
  {
2343
2312
  value: org.id,
@@ -2345,15 +2314,15 @@ function OrganisationSelector({
2345
2314
  className: !hasAccess ? "opacity-50" : "",
2346
2315
  children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between w-full", children: [
2347
2316
  /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
2348
- /* @__PURE__ */ jsx19(Building2, { className: "h-4 w-4" }),
2317
+ /* @__PURE__ */ jsx18(Building2, { className: "h-4 w-4" }),
2349
2318
  /* @__PURE__ */ jsxs15("div", { className: "flex flex-col", children: [
2350
- /* @__PURE__ */ jsx19("span", { className: "font-medium", children: org.display_name }),
2351
- !compact && org.description && /* @__PURE__ */ jsx19("span", { className: "text-xs text-muted-foreground truncate max-w-40", children: org.description })
2319
+ /* @__PURE__ */ jsx18("span", { className: "font-medium", children: org.display_name }),
2320
+ !compact && org.description && /* @__PURE__ */ jsx18("span", { className: "text-xs text-muted-foreground truncate max-w-40", children: org.description })
2352
2321
  ] })
2353
2322
  ] }),
2354
2323
  showRole && /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1 ml-4", children: [
2355
- /* @__PURE__ */ jsx19(Shield, { className: "h-3 w-3 text-muted-foreground" }),
2356
- /* @__PURE__ */ jsx19("span", { className: "text-xs text-muted-foreground capitalize", children: userRole?.replace("_", " ") || "No Role" })
2324
+ /* @__PURE__ */ jsx18(Shield, { className: "h-3 w-3 text-muted-foreground" }),
2325
+ /* @__PURE__ */ jsx18("span", { className: "text-xs text-muted-foreground capitalize", children: userRole?.replace("_", " ") || "No Role" })
2357
2326
  ] })
2358
2327
  ] })
2359
2328
  },
@@ -2370,7 +2339,7 @@ function OrganisationSelector({
2370
2339
  // src/components/PasswordReset/PasswordResetForm.tsx
2371
2340
  import { useState as useState8 } from "react";
2372
2341
  init_UnifiedAuthProvider2();
2373
- import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
2342
+ import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
2374
2343
  function PasswordResetForm({
2375
2344
  onSuccess,
2376
2345
  onError,
@@ -2411,13 +2380,13 @@ function PasswordResetForm({
2411
2380
  setError(null);
2412
2381
  };
2413
2382
  if (isSuccess) {
2414
- return /* @__PURE__ */ jsx20("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-4 text-center", children: [
2415
- /* @__PURE__ */ jsx20("h2", { children: "Check your email" }),
2383
+ return /* @__PURE__ */ jsx19("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-4 text-center", children: [
2384
+ /* @__PURE__ */ jsx19("h2", { children: "Check your email" }),
2416
2385
  /* @__PURE__ */ jsxs16("p", { className: "text-sec-600", children: [
2417
2386
  "We have sent a password reset link to ",
2418
2387
  email
2419
2388
  ] }),
2420
- /* @__PURE__ */ jsx20(
2389
+ /* @__PURE__ */ jsx19(
2421
2390
  Button,
2422
2391
  {
2423
2392
  variant: "outline",
@@ -2428,15 +2397,15 @@ function PasswordResetForm({
2428
2397
  )
2429
2398
  ] }) });
2430
2399
  }
2431
- return /* @__PURE__ */ jsx20("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-4", children: [
2400
+ return /* @__PURE__ */ jsx19("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-4", children: [
2432
2401
  /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
2433
- /* @__PURE__ */ jsx20("h2", { children: "Reset Password" }),
2434
- /* @__PURE__ */ jsx20("p", { className: "text-sec-600", children: "Enter your email address and we'll send you a reset link." })
2402
+ /* @__PURE__ */ jsx19("h2", { children: "Reset Password" }),
2403
+ /* @__PURE__ */ jsx19("p", { className: "text-sec-600", children: "Enter your email address and we'll send you a reset link." })
2435
2404
  ] }),
2436
2405
  /* @__PURE__ */ jsxs16("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
2437
2406
  /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
2438
- /* @__PURE__ */ jsx20(Label, { htmlFor: "email", children: "Email Address" }),
2439
- /* @__PURE__ */ jsx20(
2407
+ /* @__PURE__ */ jsx19(Label, { htmlFor: "email", children: "Email Address" }),
2408
+ /* @__PURE__ */ jsx19(
2440
2409
  Input,
2441
2410
  {
2442
2411
  id: "email",
@@ -2449,8 +2418,8 @@ function PasswordResetForm({
2449
2418
  }
2450
2419
  )
2451
2420
  ] }),
2452
- error && /* @__PURE__ */ jsx20("div", { className: "text-sm text-destructive", role: "alert", children: error }),
2453
- /* @__PURE__ */ jsx20(
2421
+ error && /* @__PURE__ */ jsx19("div", { className: "text-sm text-destructive", role: "alert", children: error }),
2422
+ /* @__PURE__ */ jsx19(
2454
2423
  Button,
2455
2424
  {
2456
2425
  type: "submit",
@@ -2843,7 +2812,7 @@ var CachedAppIdResolver = class {
2843
2812
  var cachedAppIdResolver = new CachedAppIdResolver();
2844
2813
 
2845
2814
  // src/components/FileUpload/FileUpload.tsx
2846
- import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
2815
+ import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
2847
2816
  function FileUpload({
2848
2817
  supabase,
2849
2818
  table_name,
@@ -3176,7 +3145,7 @@ function FileUpload({
3176
3145
  onClick: !isDisabled ? handleClick : void 0,
3177
3146
  children: [
3178
3147
  children || /* @__PURE__ */ jsxs17("div", { className: "space-y-2", children: [
3179
- /* @__PURE__ */ jsx21(
3148
+ /* @__PURE__ */ jsx20(
3180
3149
  "input",
3181
3150
  {
3182
3151
  ref: fileInputRef,
@@ -3189,8 +3158,8 @@ function FileUpload({
3189
3158
  "data-testid": "file-input"
3190
3159
  }
3191
3160
  ),
3192
- /* @__PURE__ */ jsx21("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs17(Fragment5, { children: [
3193
- /* @__PURE__ */ jsx21("span", { className: "font-medium", children: "Click to upload" }),
3161
+ /* @__PURE__ */ jsx20("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs17(Fragment5, { children: [
3162
+ /* @__PURE__ */ jsx20("span", { className: "font-medium", children: "Click to upload" }),
3194
3163
  " ",
3195
3164
  "or drag and drop"
3196
3165
  ] }) }),
@@ -3200,11 +3169,11 @@ function FileUpload({
3200
3169
  !isResolvingAppId && multiple && " \u2022 Multiple files allowed"
3201
3170
  ] })
3202
3171
  ] }),
3203
- isUploading && !showProgress && /* @__PURE__ */ jsx21("div", { className: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center", children: /* @__PURE__ */ jsx21("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) })
3172
+ isUploading && !showProgress && /* @__PURE__ */ jsx20("div", { className: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center", children: /* @__PURE__ */ jsx20("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) })
3204
3173
  ]
3205
3174
  }
3206
3175
  ),
3207
- showProgress && uploadStates.size > 0 && /* @__PURE__ */ jsx21("div", { className: "space-y-2", children: Array.from(uploadStates.entries()).map(([fileId, uploadState]) => {
3176
+ showProgress && uploadStates.size > 0 && /* @__PURE__ */ jsx20("div", { className: "space-y-2", children: Array.from(uploadStates.entries()).map(([fileId, uploadState]) => {
3208
3177
  const { file, progress, preview, result } = uploadState;
3209
3178
  const isError = progress.status === "error";
3210
3179
  const isCompleted = progress.status === "completed";
@@ -3214,23 +3183,23 @@ function FileUpload({
3214
3183
  {
3215
3184
  className: `flex items-center space-x-3 p-3 rounded-lg border ${isError ? "bg-acc-50 border-acc-200" : isCompleted ? "bg-success-50 border-success-200" : "bg-sec-50 border-sec-200"}`,
3216
3185
  children: [
3217
- /* @__PURE__ */ jsx21("div", { className: "flex-shrink-0", children: preview ? /* @__PURE__ */ jsx21(
3186
+ /* @__PURE__ */ jsx20("div", { className: "flex-shrink-0", children: preview ? /* @__PURE__ */ jsx20(
3218
3187
  "img",
3219
3188
  {
3220
3189
  src: preview,
3221
3190
  alt: file.name,
3222
3191
  className: "w-12 h-12 object-cover rounded"
3223
3192
  }
3224
- ) : /* @__PURE__ */ jsx21("div", { className: "w-12 h-12 flex items-center justify-center bg-sec-200 rounded", children: /* @__PURE__ */ jsx21("span", { className: "text-2xl", children: "\u{1F4C4}" }) }) }),
3193
+ ) : /* @__PURE__ */ jsx20("div", { className: "w-12 h-12 flex items-center justify-center bg-sec-200 rounded", children: /* @__PURE__ */ jsx20("span", { className: "text-2xl", children: "\u{1F4C4}" }) }) }),
3225
3194
  /* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
3226
- /* @__PURE__ */ jsx21("div", { className: "font-medium text-sec-900 truncate", children: file.name }),
3195
+ /* @__PURE__ */ jsx20("div", { className: "font-medium text-sec-900 truncate", children: file.name }),
3227
3196
  /* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
3228
3197
  formatFileSize(file.size),
3229
3198
  isCompleted && result && " \u2022 Uploaded",
3230
3199
  isError && progress.error && ` \u2022 ${progress.error}`
3231
3200
  ] }),
3232
3201
  showProgress && (isUploading2 || isError) && /* @__PURE__ */ jsxs17("div", { className: "mt-2", children: [
3233
- /* @__PURE__ */ jsx21("div", { className: "w-full bg-sec-200 rounded-full h-2", children: /* @__PURE__ */ jsx21(
3202
+ /* @__PURE__ */ jsx20("div", { className: "w-full bg-sec-200 rounded-full h-2", children: /* @__PURE__ */ jsx20(
3234
3203
  "div",
3235
3204
  {
3236
3205
  className: `h-2 rounded-full transition-all duration-300 ${isError ? "bg-acc-500" : "bg-main-500"}`,
@@ -3247,17 +3216,17 @@ function FileUpload({
3247
3216
  ] })
3248
3217
  ] }),
3249
3218
  /* @__PURE__ */ jsxs17("div", { className: "flex-shrink-0", children: [
3250
- isCompleted && /* @__PURE__ */ jsx21("span", { className: "text-success-500 text-xl", children: "\u2713" }),
3251
- isError && /* @__PURE__ */ jsx21("span", { className: "text-acc-500 text-xl", children: "\u2715" }),
3252
- isUploading2 && /* @__PURE__ */ jsx21("div", { className: "animate-spin rounded-full h-5 w-5 border-b-2 border-main-500" })
3219
+ isCompleted && /* @__PURE__ */ jsx20("span", { className: "text-success-500 text-xl", children: "\u2713" }),
3220
+ isError && /* @__PURE__ */ jsx20("span", { className: "text-acc-500 text-xl", children: "\u2715" }),
3221
+ isUploading2 && /* @__PURE__ */ jsx20("div", { className: "animate-spin rounded-full h-5 w-5 border-b-2 border-main-500" })
3253
3222
  ] })
3254
3223
  ]
3255
3224
  },
3256
3225
  fileId
3257
3226
  );
3258
3227
  }) }),
3259
- appIdError && /* @__PURE__ */ jsx21("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: appIdError }),
3260
- error && /* @__PURE__ */ jsx21("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: error })
3228
+ appIdError && /* @__PURE__ */ jsx20("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: appIdError }),
3229
+ error && /* @__PURE__ */ jsx20("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: error })
3261
3230
  ] });
3262
3231
  }
3263
3232
 
@@ -3336,7 +3305,7 @@ function useFileUrl(fileReference, options) {
3336
3305
 
3337
3306
  // src/components/FileDisplay/FileDisplay.tsx
3338
3307
  init_UnifiedAuthProvider();
3339
- import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
3308
+ import { Fragment as Fragment6, jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
3340
3309
  var fallbackSizeClasses = {
3341
3310
  xs: "h-4 w-4 text-xs",
3342
3311
  sm: "h-6 w-6 text-sm",
@@ -3443,17 +3412,17 @@ function FileDisplayContent({
3443
3412
  };
3444
3413
  if (error) {
3445
3414
  if (ErrorComponent) {
3446
- return /* @__PURE__ */ jsx22(ErrorComponent, { error, retry: clearError });
3415
+ return /* @__PURE__ */ jsx21(ErrorComponent, { error, retry: clearError });
3447
3416
  }
3448
3417
  if (showFallback) {
3449
- return /* @__PURE__ */ jsx22("div", { className: fallbackClasses, title: "File unavailable", children: computedFallbackText });
3418
+ return /* @__PURE__ */ jsx21("div", { className: fallbackClasses, title: "File unavailable", children: computedFallbackText });
3450
3419
  }
3451
3420
  return /* @__PURE__ */ jsxs18("div", { className: `p-4 bg-acc-50 border border-acc-200 rounded-lg ${className}`, children: [
3452
3421
  /* @__PURE__ */ jsxs18("div", { className: "text-acc-600", children: [
3453
3422
  "Error loading file: ",
3454
3423
  error instanceof Error ? error.message : String(error)
3455
3424
  ] }),
3456
- clearError && /* @__PURE__ */ jsx22(
3425
+ clearError && /* @__PURE__ */ jsx21(
3457
3426
  "button",
3458
3427
  {
3459
3428
  onClick: clearError,
@@ -3483,20 +3452,20 @@ function FileDisplayContent({
3483
3452
  }
3484
3453
  if (isLoading) {
3485
3454
  if (LoadingComponent) {
3486
- return /* @__PURE__ */ jsx22(LoadingComponent, {});
3455
+ return /* @__PURE__ */ jsx21(LoadingComponent, {});
3487
3456
  }
3488
- return /* @__PURE__ */ jsx22("div", { className: `flex items-center justify-center p-4 ${className}`, children: /* @__PURE__ */ jsx22("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) });
3457
+ return /* @__PURE__ */ jsx21("div", { className: `flex items-center justify-center p-4 ${className}`, children: /* @__PURE__ */ jsx21("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) });
3489
3458
  }
3490
3459
  if ((category || displayOnly) && fileReference) {
3491
3460
  const isImage = fileReference.file_metadata.fileType?.startsWith("image/");
3492
3461
  if (displayOnly && isImage && !showDelete) {
3493
3462
  if (imageError && showFallback) {
3494
- return /* @__PURE__ */ jsx22("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
3463
+ return /* @__PURE__ */ jsx21("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
3495
3464
  }
3496
3465
  if (!fileUrl) {
3497
- return /* @__PURE__ */ jsx22("div", { className: `bg-sec-100 rounded animate-pulse ${className || "max-w-full h-48"}`, children: /* @__PURE__ */ jsx22("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ jsx22("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) }) });
3466
+ return /* @__PURE__ */ jsx21("div", { className: `bg-sec-100 rounded animate-pulse ${className || "max-w-full h-48"}`, children: /* @__PURE__ */ jsx21("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ jsx21("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) }) });
3498
3467
  }
3499
- return /* @__PURE__ */ jsx22(
3468
+ return /* @__PURE__ */ jsx21(
3500
3469
  "img",
3501
3470
  {
3502
3471
  src: fileUrl,
@@ -3507,11 +3476,11 @@ function FileDisplayContent({
3507
3476
  );
3508
3477
  }
3509
3478
  if (displayOnly && showFallback && (!fileUrl || imageError || !isImage)) {
3510
- return /* @__PURE__ */ jsx22("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
3479
+ return /* @__PURE__ */ jsx21("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
3511
3480
  }
3512
3481
  return /* @__PURE__ */ jsxs18("div", { className: `space-y-2 ${className}`, children: [
3513
3482
  isImage && fileUrl && !imageError ? /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
3514
- /* @__PURE__ */ jsx22(
3483
+ /* @__PURE__ */ jsx21(
3515
3484
  "img",
3516
3485
  {
3517
3486
  src: fileUrl,
@@ -3521,7 +3490,7 @@ function FileDisplayContent({
3521
3490
  }
3522
3491
  ),
3523
3492
  showDelete && /* @__PURE__ */ jsxs18(Fragment6, { children: [
3524
- /* @__PURE__ */ jsx22(
3493
+ /* @__PURE__ */ jsx21(
3525
3494
  "button",
3526
3495
  {
3527
3496
  onClick: handleDeleteClick,
@@ -3531,29 +3500,29 @@ function FileDisplayContent({
3531
3500
  children: "\xD7"
3532
3501
  }
3533
3502
  ),
3534
- /* @__PURE__ */ jsx22(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs18(DialogContent, { size: "sm", children: [
3535
- /* @__PURE__ */ jsx22(DialogHeader, { children: /* @__PURE__ */ jsx22(DialogTitle, { children: "Confirm Delete" }) }),
3536
- /* @__PURE__ */ jsx22(DialogBody, { children: /* @__PURE__ */ jsx22("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
3503
+ /* @__PURE__ */ jsx21(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs18(DialogContent, { size: "sm", children: [
3504
+ /* @__PURE__ */ jsx21(DialogHeader, { children: /* @__PURE__ */ jsx21(DialogTitle, { children: "Confirm Delete" }) }),
3505
+ /* @__PURE__ */ jsx21(DialogBody, { children: /* @__PURE__ */ jsx21("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
3537
3506
  /* @__PURE__ */ jsxs18(DialogFooter, { children: [
3538
- /* @__PURE__ */ jsx22(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
3539
- /* @__PURE__ */ jsx22(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
3507
+ /* @__PURE__ */ jsx21(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
3508
+ /* @__PURE__ */ jsx21(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
3540
3509
  ] })
3541
3510
  ] }) })
3542
3511
  ] })
3543
3512
  ] }) : isImage && imageError && showFallback ? (
3544
3513
  // Show fallback when image fails to load and fallback is enabled
3545
- /* @__PURE__ */ jsx22("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText })
3514
+ /* @__PURE__ */ jsx21("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText })
3546
3515
  ) : /* @__PURE__ */ jsxs18("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
3547
- /* @__PURE__ */ jsx22("span", { className: "text-2xl", children: getFileIcon(fileReference.file_metadata.fileType || "") }),
3516
+ /* @__PURE__ */ jsx21("span", { className: "text-2xl", children: getFileIcon(fileReference.file_metadata.fileType || "") }),
3548
3517
  /* @__PURE__ */ jsxs18("div", { className: "flex-1 min-w-0", children: [
3549
- /* @__PURE__ */ jsx22("div", { className: "font-medium text-sec-900 truncate", children: fileReference.file_metadata.fileName || "Unknown file" }),
3518
+ /* @__PURE__ */ jsx21("div", { className: "font-medium text-sec-900 truncate", children: fileReference.file_metadata.fileName || "Unknown file" }),
3550
3519
  /* @__PURE__ */ jsxs18("div", { className: "text-sm text-sec-500", children: [
3551
3520
  fileReference.file_metadata.fileSize && formatFileSize(fileReference.file_metadata.fileSize),
3552
3521
  fileReference.file_metadata.fileType && ` \u2022 ${fileReference.file_metadata.fileType}`
3553
3522
  ] })
3554
3523
  ] }),
3555
3524
  showDelete && /* @__PURE__ */ jsxs18(Fragment6, { children: [
3556
- /* @__PURE__ */ jsx22(
3525
+ /* @__PURE__ */ jsx21(
3557
3526
  "button",
3558
3527
  {
3559
3528
  onClick: handleDeleteClick,
@@ -3563,12 +3532,12 @@ function FileDisplayContent({
3563
3532
  children: "\xD7"
3564
3533
  }
3565
3534
  ),
3566
- /* @__PURE__ */ jsx22(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs18(DialogContent, { size: "sm", children: [
3567
- /* @__PURE__ */ jsx22(DialogHeader, { children: /* @__PURE__ */ jsx22(DialogTitle, { children: "Confirm Delete" }) }),
3568
- /* @__PURE__ */ jsx22(DialogBody, { children: /* @__PURE__ */ jsx22("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
3535
+ /* @__PURE__ */ jsx21(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs18(DialogContent, { size: "sm", children: [
3536
+ /* @__PURE__ */ jsx21(DialogHeader, { children: /* @__PURE__ */ jsx21(DialogTitle, { children: "Confirm Delete" }) }),
3537
+ /* @__PURE__ */ jsx21(DialogBody, { children: /* @__PURE__ */ jsx21("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
3569
3538
  /* @__PURE__ */ jsxs18(DialogFooter, { children: [
3570
- /* @__PURE__ */ jsx22(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
3571
- /* @__PURE__ */ jsx22(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
3539
+ /* @__PURE__ */ jsx21(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
3540
+ /* @__PURE__ */ jsx21(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
3572
3541
  ] })
3573
3542
  ] }) })
3574
3543
  ] })
@@ -3582,7 +3551,7 @@ function FileDisplayContent({
3582
3551
  const fileUrl2 = internalFileUrls.get(fileRef.id) || null;
3583
3552
  const canDownload = !isImage && fileUrl2;
3584
3553
  return /* @__PURE__ */ jsxs18("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
3585
- isImage && fileUrl2 ? /* @__PURE__ */ jsx22(
3554
+ isImage && fileUrl2 ? /* @__PURE__ */ jsx21(
3586
3555
  "img",
3587
3556
  {
3588
3557
  src: fileUrl2,
@@ -3590,9 +3559,9 @@ function FileDisplayContent({
3590
3559
  className: "w-12 h-12 object-cover rounded",
3591
3560
  onError: handleImageError
3592
3561
  }
3593
- ) : /* @__PURE__ */ jsx22("span", { className: "text-2xl", children: getFileIcon(fileRef.file_metadata.fileType || "") }),
3562
+ ) : /* @__PURE__ */ jsx21("span", { className: "text-2xl", children: getFileIcon(fileRef.file_metadata.fileType || "") }),
3594
3563
  /* @__PURE__ */ jsxs18("div", { className: "flex-1 min-w-0", children: [
3595
- /* @__PURE__ */ jsx22("div", { className: "font-medium text-sec-900 truncate", children: fileRef.file_metadata.fileName || "Unknown file" }),
3564
+ /* @__PURE__ */ jsx21("div", { className: "font-medium text-sec-900 truncate", children: fileRef.file_metadata.fileName || "Unknown file" }),
3596
3565
  /* @__PURE__ */ jsxs18("div", { className: "text-sm text-sec-500", children: [
3597
3566
  fileRef.file_metadata.fileSize && formatFileSize(fileRef.file_metadata.fileSize),
3598
3567
  fileRef.file_metadata.fileType && ` \u2022 ${fileRef.file_metadata.fileType}`,
@@ -3600,7 +3569,7 @@ function FileDisplayContent({
3600
3569
  ] })
3601
3570
  ] }),
3602
3571
  /* @__PURE__ */ jsxs18("div", { className: "flex items-center space-x-2", children: [
3603
- canDownload && /* @__PURE__ */ jsx22(
3572
+ canDownload && /* @__PURE__ */ jsx21(
3604
3573
  "a",
3605
3574
  {
3606
3575
  href: fileRef.file_path,
@@ -3610,7 +3579,7 @@ function FileDisplayContent({
3610
3579
  children: "\u2193"
3611
3580
  }
3612
3581
  ),
3613
- showDelete && onDelete && /* @__PURE__ */ jsx22(
3582
+ showDelete && onDelete && /* @__PURE__ */ jsx21(
3614
3583
  "button",
3615
3584
  {
3616
3585
  onClick: handleDeleteClick,
@@ -3644,8 +3613,48 @@ function FileDisplayPublic({
3644
3613
  }) {
3645
3614
  const publicPageContext = useContext2(PublicPageContext);
3646
3615
  const supabase = publicPageContext?.supabase ?? null;
3616
+ console.log("[FileDisplayPublic] Supabase Client Context:", {
3617
+ hasPublicPageContext: !!publicPageContext,
3618
+ hasSupabaseClient: !!supabase,
3619
+ supabaseUrl: publicPageContext?.environment?.supabaseUrl || "not available",
3620
+ hasAnonKey: !!publicPageContext?.environment?.supabaseKey,
3621
+ hasAuth: !!supabase?.auth,
3622
+ organisation_id,
3623
+ table_name,
3624
+ record_id,
3625
+ category,
3626
+ context: "public_page_anonymous_user",
3627
+ note: "Public pages use anonymous Supabase client (no user session)"
3628
+ });
3647
3629
  if (!supabase) {
3648
- return /* @__PURE__ */ jsx22("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in public context" });
3630
+ if (showFallback) {
3631
+ return /* @__PURE__ */ jsx21(
3632
+ FileDisplayContent,
3633
+ {
3634
+ isLoading: false,
3635
+ error: null,
3636
+ fileUrl: null,
3637
+ fileReference: null,
3638
+ fileReferences: [],
3639
+ fileUrls: /* @__PURE__ */ new Map(),
3640
+ fileCount: 0,
3641
+ category,
3642
+ displayOnly,
3643
+ showDelete: false,
3644
+ className,
3645
+ children,
3646
+ onDelete: void 0,
3647
+ organisation_id,
3648
+ loadingComponent,
3649
+ errorComponent,
3650
+ showFallback,
3651
+ generateFallbackText,
3652
+ fallbackText,
3653
+ fallbackSize
3654
+ }
3655
+ );
3656
+ }
3657
+ return /* @__PURE__ */ jsx21("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in public context" });
3649
3658
  }
3650
3659
  const {
3651
3660
  fileUrl,
@@ -3663,6 +3672,33 @@ function FileDisplayPublic({
3663
3672
  category,
3664
3673
  { supabase }
3665
3674
  );
3675
+ if (error) {
3676
+ console.error("[FileDisplayPublic] Error fetching file:", {
3677
+ table_name,
3678
+ record_id,
3679
+ organisation_id,
3680
+ category,
3681
+ error: error.message,
3682
+ errorStack: error.stack
3683
+ });
3684
+ }
3685
+ if (fileUrl && !isLoading && !error) {
3686
+ console.log("[FileDisplayPublic] File loaded successfully:", {
3687
+ table_name,
3688
+ record_id,
3689
+ category,
3690
+ fileUrl: fileUrl.substring(0, 50) + "..."
3691
+ // Truncate URL for logging
3692
+ });
3693
+ }
3694
+ if (!isLoading && !error && !fileUrl && !fileReference) {
3695
+ console.log("[FileDisplayPublic] No file found (will show fallback if enabled):", {
3696
+ table_name,
3697
+ record_id,
3698
+ category,
3699
+ showFallback
3700
+ });
3701
+ }
3666
3702
  const handleDelete = async () => {
3667
3703
  };
3668
3704
  let finalFileReference = fileReference;
@@ -3679,7 +3715,7 @@ function FileDisplayPublic({
3679
3715
  finalFileCount = 1;
3680
3716
  finalFileUrl = fileUrls.get(targetFile.id) || null;
3681
3717
  }
3682
- return /* @__PURE__ */ jsx22(
3718
+ return /* @__PURE__ */ jsx21(
3683
3719
  FileDisplayContent,
3684
3720
  {
3685
3721
  isLoading,
@@ -3723,7 +3759,7 @@ function FileDisplayAuthenticated({
3723
3759
  }) {
3724
3760
  const { supabase } = useUnifiedAuth();
3725
3761
  if (!supabase) {
3726
- return /* @__PURE__ */ jsx22("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in authenticated context" });
3762
+ return /* @__PURE__ */ jsx21("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in authenticated context" });
3727
3763
  }
3728
3764
  const {
3729
3765
  fileUrl,
@@ -3781,7 +3817,7 @@ function FileDisplayAuthenticated({
3781
3817
  finalError = error || displayOnlyFileUrlHook.error;
3782
3818
  }
3783
3819
  }
3784
- return /* @__PURE__ */ jsx22(
3820
+ return /* @__PURE__ */ jsx21(
3785
3821
  FileDisplayContent,
3786
3822
  {
3787
3823
  isLoading: finalIsLoading,
@@ -3826,7 +3862,7 @@ function FileDisplay({
3826
3862
  }) {
3827
3863
  const isPublicPage = useIsPublicPage();
3828
3864
  if (isPublicPage) {
3829
- return /* @__PURE__ */ jsx22(
3865
+ return /* @__PURE__ */ jsx21(
3830
3866
  FileDisplayPublic,
3831
3867
  {
3832
3868
  table_name,
@@ -3846,7 +3882,7 @@ function FileDisplay({
3846
3882
  }
3847
3883
  );
3848
3884
  }
3849
- return /* @__PURE__ */ jsx22(
3885
+ return /* @__PURE__ */ jsx21(
3850
3886
  FileDisplayAuthenticated,
3851
3887
  {
3852
3888
  table_name,
@@ -3868,9 +3904,9 @@ function FileDisplay({
3868
3904
  }
3869
3905
 
3870
3906
  // src/components/Table/Table.tsx
3871
- import * as React19 from "react";
3872
- import { jsx as jsx23 } from "react/jsx-runtime";
3873
- var Table = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3907
+ import * as React18 from "react";
3908
+ import { jsx as jsx22 } from "react/jsx-runtime";
3909
+ var Table = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3874
3910
  "table",
3875
3911
  {
3876
3912
  ref,
@@ -3879,9 +3915,9 @@ var Table = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
3879
3915
  }
3880
3916
  ));
3881
3917
  Table.displayName = "Table";
3882
- var TableHeader = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
3918
+ var TableHeader = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
3883
3919
  TableHeader.displayName = "TableHeader";
3884
- var TableBody = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3920
+ var TableBody = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3885
3921
  "tbody",
3886
3922
  {
3887
3923
  ref,
@@ -3890,7 +3926,7 @@ var TableBody = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE_
3890
3926
  }
3891
3927
  ));
3892
3928
  TableBody.displayName = "TableBody";
3893
- var TableFooter = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3929
+ var TableFooter = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3894
3930
  "tfoot",
3895
3931
  {
3896
3932
  ref,
@@ -3902,7 +3938,7 @@ var TableFooter = React19.forwardRef(({ className, ...props }, ref) => /* @__PUR
3902
3938
  }
3903
3939
  ));
3904
3940
  TableFooter.displayName = "TableFooter";
3905
- var TableRow = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3941
+ var TableRow = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3906
3942
  "tr",
3907
3943
  {
3908
3944
  ref,
@@ -3914,7 +3950,7 @@ var TableRow = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__
3914
3950
  }
3915
3951
  ));
3916
3952
  TableRow.displayName = "TableRow";
3917
- var TableHead = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3953
+ var TableHead = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3918
3954
  "th",
3919
3955
  {
3920
3956
  ref,
@@ -3926,7 +3962,7 @@ var TableHead = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE_
3926
3962
  }
3927
3963
  ));
3928
3964
  TableHead.displayName = "TableHead";
3929
- var TableCell = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3965
+ var TableCell = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3930
3966
  "td",
3931
3967
  {
3932
3968
  ref,
@@ -3935,7 +3971,7 @@ var TableCell = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE_
3935
3971
  }
3936
3972
  ));
3937
3973
  TableCell.displayName = "TableCell";
3938
- var TableCaption = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx23(
3974
+ var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22(
3939
3975
  "caption",
3940
3976
  {
3941
3977
  ref,
@@ -3946,8 +3982,7 @@ var TableCaption = React19.forwardRef(({ className, ...props }, ref) => /* @__PU
3946
3982
  TableCaption.displayName = "TableCaption";
3947
3983
 
3948
3984
  // src/components/PublicLayout/PublicPageHeader.tsx
3949
- import { Link as Link2 } from "react-router-dom";
3950
- import { Fragment as Fragment7, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
3985
+ import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
3951
3986
  function PublicPageHeader({
3952
3987
  event,
3953
3988
  eventCode,
@@ -3957,91 +3992,67 @@ function PublicPageHeader({
3957
3992
  showAppLogo = true,
3958
3993
  className = "",
3959
3994
  children,
3960
- customAppLogo,
3961
- customEventLogo,
3962
- logoUrl,
3963
- logoAlt,
3964
- logoHref
3995
+ customEventLogo
3965
3996
  }) {
3966
3997
  const { appName } = useAppConfig();
3967
3998
  return /* @__PURE__ */ jsxs19("header", { className: cn(
3968
- " px-4 w-[min(var(--app-width),100%)] mx-auto bg-background border-b border-sec-200 grid grid-cols-[auto_1fr_auto] place-items-center gap-2",
3999
+ "w-full px-[max(0rem,calc((100vw-var(--app-width))/2-0.5rem))] grid grid-cols-[auto_1fr_auto] place-items-center gap-2",
3969
4000
  className
3970
4001
  ), children: [
3971
- showAppLogo && /* @__PURE__ */ jsx24(Fragment7, { children: customAppLogo ? logoHref ? /* @__PURE__ */ jsx24(Link2, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: customAppLogo }) : customAppLogo : logoUrl ? logoHref ? /* @__PURE__ */ jsx24(Link2, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx24(
3972
- "img",
3973
- {
3974
- className: "max-w-36 object-contain row-span-2",
3975
- src: logoUrl,
3976
- alt: logoAlt || appName
3977
- }
3978
- ) }) : /* @__PURE__ */ jsx24(
3979
- "img",
3980
- {
3981
- className: "max-w-36 object-contain row-span-2",
3982
- src: logoUrl,
3983
- alt: logoAlt || appName
3984
- }
3985
- ) : appName ? logoHref ? /* @__PURE__ */ jsx24(Link2, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx24(
3986
- "img",
3987
- {
3988
- className: "max-w-36 object-contain row-span-2",
3989
- src: `/${appName.toLowerCase()}_logo_wide.svg`,
3990
- alt: logoAlt || appName
3991
- }
3992
- ) }) : /* @__PURE__ */ jsx24(
4002
+ showAppLogo && appName && /* @__PURE__ */ jsx23(
3993
4003
  "img",
3994
4004
  {
3995
- className: "max-w-36 object-contain row-span-2",
4005
+ className: "ml-4 max-w-36 object-contain row-span-2",
3996
4006
  src: `/${appName.toLowerCase()}_logo_wide.svg`,
3997
- alt: logoAlt || appName
3998
- }
3999
- ) : logoHref ? /* @__PURE__ */ jsx24(Link2, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx24(
4000
- "img",
4001
- {
4002
- src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23000'/%3E%3Ctext x='16' y='20' text-anchor='middle' fill='white' font-family='Arial' font-size='14' font-weight='bold'%3EL%3C/text%3E%3C/svg%3E",
4003
- alt: logoAlt || "Logo",
4004
- className: "max-w-36 object-contain row-span-2"
4007
+ alt: appName
4005
4008
  }
4006
- ) }) : /* @__PURE__ */ jsx24(
4007
- "img",
4008
- {
4009
- src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23000'/%3E%3Ctext x='16' y='20' text-anchor='middle' fill='white' font-family='Arial' font-size='14' font-weight='bold'%3EL%3C/text%3E%3C/svg%3E",
4010
- alt: logoAlt || "Logo",
4011
- className: "max-w-36 object-contain row-span-2"
4012
- }
4013
- ) }),
4009
+ ),
4014
4010
  event && /* @__PURE__ */ jsxs19(Fragment7, { children: [
4015
- /* @__PURE__ */ jsx24("h1", { children: event.event_name }),
4016
- showEventLogo && event && /* @__PURE__ */ jsx24(Fragment7, { children: customEventLogo || /* @__PURE__ */ jsx24(
4017
- FileDisplay,
4018
- {
4019
- table_name: "event",
4020
- record_id: event.event_id,
4021
- organisation_id: event.organisation_id,
4022
- category: "event_logos" /* EVENT_LOGOS */,
4023
- displayOnly: true,
4024
- showFallback: true,
4025
- fallbackSize: "md",
4026
- className: "max-w-36 row-span-2",
4027
- generateFallbackText: (fileName) => {
4028
- if (!event.event_name) return "EV";
4029
- return event.event_name.split(/[\s\-_]+/).map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
4011
+ /* @__PURE__ */ jsx23("h1", { children: event.event_name }),
4012
+ showEventLogo && event && /* @__PURE__ */ jsx23(Fragment7, { children: customEventLogo || /* @__PURE__ */ jsxs19(Fragment7, { children: [
4013
+ (() => {
4014
+ console.log("[PublicPageHeader] Organisation ID Derivation Chain:", {
4015
+ eventCode,
4016
+ eventId: event.event_id,
4017
+ eventName: event.event_name,
4018
+ organisationId: event.organisation_id,
4019
+ organisationIdType: typeof event.organisation_id,
4020
+ organisationIdValid: !!event.organisation_id && event.organisation_id !== "",
4021
+ derivation: "URL \u2192 eventCode \u2192 usePublicEvent \u2192 event.organisation_id \u2192 FileDisplay",
4022
+ note: "Organisation ID is derived from event data fetched using event code from URL"
4023
+ });
4024
+ return null;
4025
+ })(),
4026
+ /* @__PURE__ */ jsx23(
4027
+ FileDisplay,
4028
+ {
4029
+ table_name: "event",
4030
+ record_id: event.event_id,
4031
+ organisation_id: event.organisation_id,
4032
+ category: "event_logos" /* EVENT_LOGOS */,
4033
+ displayOnly: true,
4034
+ showFallback: true,
4035
+ fallbackSize: "md",
4036
+ className: "mr-4 max-w-36 row-span-2",
4037
+ generateFallbackText: (fileName) => {
4038
+ if (!event.event_name) return "EV";
4039
+ return event.event_name.split(/[\s\-_]+/).map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
4040
+ }
4030
4041
  }
4031
- }
4032
- ) }),
4033
- event.event_venue && /* @__PURE__ */ jsx24("h4", { children: event.event_venue })
4042
+ )
4043
+ ] }) }),
4044
+ event.event_venue && /* @__PURE__ */ jsx23("h4", { children: event.event_venue })
4034
4045
  ] }),
4035
4046
  title && /* @__PURE__ */ jsxs19(Fragment7, { children: [
4036
- /* @__PURE__ */ jsx24("h1", { children: title }),
4037
- description && /* @__PURE__ */ jsx24("p", { className: "text-lg text-sec-600 max-w-3xl mx-auto", children: description })
4047
+ /* @__PURE__ */ jsx23("h1", { children: title }),
4048
+ description && /* @__PURE__ */ jsx23("p", { className: "text-lg text-sec-600 max-w-3xl mx-auto", children: description })
4038
4049
  ] }),
4039
- children && /* @__PURE__ */ jsx24(Fragment7, { children })
4050
+ children && /* @__PURE__ */ jsx23(Fragment7, { children })
4040
4051
  ] });
4041
4052
  }
4042
4053
 
4043
4054
  // src/components/PublicLayout/PublicPageFooter.tsx
4044
- import { Fragment as Fragment8, jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
4055
+ import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
4045
4056
  function PublicPageFooter({
4046
4057
  event,
4047
4058
  companyName = "Solvera Solutions Pty Ltd",
@@ -4053,16 +4064,16 @@ function PublicPageFooter({
4053
4064
  children
4054
4065
  }) {
4055
4066
  const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
4056
- return /* @__PURE__ */ jsx25("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs20("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
4057
- logo && /* @__PURE__ */ jsx25("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
4058
- children && /* @__PURE__ */ jsx25(Fragment8, { children }),
4059
- /* @__PURE__ */ jsx25("span", { className: "text-muted-foreground", children: copyrightText }),
4060
- links && links.length > 0 && /* @__PURE__ */ jsx25("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx25("li", { children: /* @__PURE__ */ jsx25("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
4067
+ return /* @__PURE__ */ jsx24("footer", { className: cn("mt-8 py-6 flex justify-center", className), children: /* @__PURE__ */ jsxs20("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
4068
+ logo && /* @__PURE__ */ jsx24("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
4069
+ children && /* @__PURE__ */ jsx24(Fragment8, { children }),
4070
+ /* @__PURE__ */ jsx24("span", { className: "text-muted-foreground", children: copyrightText }),
4071
+ links && links.length > 0 && /* @__PURE__ */ jsx24("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx24("li", { children: /* @__PURE__ */ jsx24("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
4061
4072
  ] }) });
4062
4073
  }
4063
4074
 
4064
4075
  // src/components/PublicLayout/PublicLoadingSpinner.tsx
4065
- import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
4076
+ import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
4066
4077
  var sizeClasses = {
4067
4078
  sm: "h-4 w-4",
4068
4079
  md: "h-8 w-8",
@@ -4080,7 +4091,7 @@ function PublicLoadingSpinner({
4080
4091
  const sizeClass = sizeClasses[size];
4081
4092
  const displayMessage = customMessage || message;
4082
4093
  const content = /* @__PURE__ */ jsxs21("div", { className: cn("flex flex-col items-center", className), children: [
4083
- showLogo && /* @__PURE__ */ jsx26("div", { className: "mb-4", children: /* @__PURE__ */ jsx26(
4094
+ showLogo && /* @__PURE__ */ jsx25("div", { className: "mb-4", children: /* @__PURE__ */ jsx25(
4084
4095
  "img",
4085
4096
  {
4086
4097
  className: "h-8 w-auto",
@@ -4089,7 +4100,7 @@ function PublicLoadingSpinner({
4089
4100
  }
4090
4101
  ) }),
4091
4102
  /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
4092
- /* @__PURE__ */ jsx26(
4103
+ /* @__PURE__ */ jsx25(
4093
4104
  "div",
4094
4105
  {
4095
4106
  className: cn(
@@ -4100,12 +4111,12 @@ function PublicLoadingSpinner({
4100
4111
  "aria-label": "Loading"
4101
4112
  }
4102
4113
  ),
4103
- /* @__PURE__ */ jsx26("span", { className: "sr-only", children: displayMessage })
4114
+ /* @__PURE__ */ jsx25("span", { className: "sr-only", children: displayMessage })
4104
4115
  ] }),
4105
- displayMessage && /* @__PURE__ */ jsx26("p", { className: "mt-4 text-sm text-sec-600 text-center", children: displayMessage })
4116
+ displayMessage && /* @__PURE__ */ jsx25("p", { className: "mt-4 text-sm text-sec-600 text-center", children: displayMessage })
4106
4117
  ] });
4107
4118
  if (centered) {
4108
- return /* @__PURE__ */ jsx26("div", { className: "min-h-screen bg-background flex items-center justify-center", children: /* @__PURE__ */ jsx26("div", { className: "max-w-md mx-auto px-4", children: content }) });
4119
+ return /* @__PURE__ */ jsx25("div", { className: "min-h-screen bg-background flex items-center justify-center", children: /* @__PURE__ */ jsx25("div", { className: "max-w-md mx-auto px-4", children: content }) });
4109
4120
  }
4110
4121
  return content;
4111
4122
  }
@@ -4114,11 +4125,11 @@ function PublicLoadingSpinnerFullPage({
4114
4125
  eventName,
4115
4126
  className = ""
4116
4127
  }) {
4117
- return /* @__PURE__ */ jsx26("div", { className: cn(
4128
+ return /* @__PURE__ */ jsx25("div", { className: cn(
4118
4129
  "min-h-screen bg-background flex items-center justify-center",
4119
4130
  className
4120
4131
  ), children: /* @__PURE__ */ jsxs21("div", { className: "max-w-md mx-auto text-center px-4", children: [
4121
- /* @__PURE__ */ jsx26("div", { className: "mb-8", children: /* @__PURE__ */ jsx26(
4132
+ /* @__PURE__ */ jsx25("div", { className: "mb-8", children: /* @__PURE__ */ jsx25(
4122
4133
  "img",
4123
4134
  {
4124
4135
  className: "h-12 w-auto mx-auto",
@@ -4126,8 +4137,8 @@ function PublicLoadingSpinnerFullPage({
4126
4137
  alt: "PACE Core"
4127
4138
  }
4128
4139
  ) }),
4129
- eventName && /* @__PURE__ */ jsx26("h1", { className: "text-2xl font-bold text-sec-900 mb-4", children: eventName }),
4130
- /* @__PURE__ */ jsx26("div", { className: "relative mb-6", children: /* @__PURE__ */ jsx26(
4140
+ eventName && /* @__PURE__ */ jsx25("h1", { className: "text-2xl font-bold text-sec-900 mb-4", children: eventName }),
4141
+ /* @__PURE__ */ jsx25("div", { className: "relative mb-6", children: /* @__PURE__ */ jsx25(
4131
4142
  "div",
4132
4143
  {
4133
4144
  className: "h-12 w-12 border-4 border-sec-200 border-t-main-600 rounded-full animate-spin mx-auto",
@@ -4135,11 +4146,11 @@ function PublicLoadingSpinnerFullPage({
4135
4146
  "aria-label": "Loading"
4136
4147
  }
4137
4148
  ) }),
4138
- /* @__PURE__ */ jsx26("p", { className: "text-lg text-sec-600", children: message }),
4149
+ /* @__PURE__ */ jsx25("p", { className: "text-lg text-sec-600", children: message }),
4139
4150
  /* @__PURE__ */ jsxs21("div", { className: "mt-4 flex justify-center space-x-1", children: [
4140
- /* @__PURE__ */ jsx26("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
4141
- /* @__PURE__ */ jsx26("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
4142
- /* @__PURE__ */ jsx26("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
4151
+ /* @__PURE__ */ jsx25("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
4152
+ /* @__PURE__ */ jsx25("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
4153
+ /* @__PURE__ */ jsx25("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
4143
4154
  ] })
4144
4155
  ] }) });
4145
4156
  }
@@ -4147,7 +4158,7 @@ function PublicLoadingSkeleton({
4147
4158
  lines = 3,
4148
4159
  className = ""
4149
4160
  }) {
4150
- return /* @__PURE__ */ jsx26("div", { className: cn("animate-pulse", className), children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx26(
4161
+ return /* @__PURE__ */ jsx25("div", { className: cn("animate-pulse", className), children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx25(
4151
4162
  "div",
4152
4163
  {
4153
4164
  className: cn(
@@ -4160,7 +4171,7 @@ function PublicLoadingSkeleton({
4160
4171
  }
4161
4172
 
4162
4173
  // src/components/PublicLayout/PublicPageLayout.tsx
4163
- import { Fragment as Fragment9, jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
4174
+ import { Fragment as Fragment9, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
4164
4175
  function PublicPageLayout({
4165
4176
  eventCode,
4166
4177
  children,
@@ -4182,7 +4193,7 @@ function PublicPageLayout({
4182
4193
  });
4183
4194
  if (isLoading) {
4184
4195
  if (LoadingFallback === PublicLoadingSpinner) {
4185
- return /* @__PURE__ */ jsx27(
4196
+ return /* @__PURE__ */ jsx26(
4186
4197
  PublicLoadingSpinner,
4187
4198
  {
4188
4199
  className: "items-center justify-center",
@@ -4190,39 +4201,39 @@ function PublicPageLayout({
4190
4201
  }
4191
4202
  );
4192
4203
  }
4193
- return /* @__PURE__ */ jsx27(LoadingFallback, {});
4204
+ return /* @__PURE__ */ jsx26(LoadingFallback, {});
4194
4205
  }
4195
4206
  if (error && showValidationErrors) {
4196
4207
  if (ErrorFallback) {
4197
- return /* @__PURE__ */ jsx27(ErrorFallback, { error, retry: handleRefetch });
4208
+ return /* @__PURE__ */ jsx26(ErrorFallback, { error, retry: handleRefetch });
4198
4209
  }
4199
- return /* @__PURE__ */ jsx27("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: /* @__PURE__ */ jsxs22("div", { className: "text-center", children: [
4200
- /* @__PURE__ */ jsx27("h1", { children: "Event Not Found" }),
4210
+ return /* @__PURE__ */ jsxs22("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
4211
+ /* @__PURE__ */ jsx26("h1", { children: "Event Not Found" }),
4201
4212
  /* @__PURE__ */ jsxs22("p", { children: [
4202
4213
  'The event code "',
4203
4214
  eventCode,
4204
4215
  '" is invalid or the event is not available for public viewing.'
4205
4216
  ] }),
4206
- /* @__PURE__ */ jsx27(Button, { onClick: handleRefetch, children: "Try Again" })
4207
- ] }) });
4217
+ /* @__PURE__ */ jsx26(Button, { onClick: handleRefetch, children: "Try Again" })
4218
+ ] });
4208
4219
  }
4209
4220
  if (!event && showValidationErrors) {
4210
- return /* @__PURE__ */ jsx27("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: /* @__PURE__ */ jsxs22("div", { className: "text-center", children: [
4211
- /* @__PURE__ */ jsx27("h1", { children: "Event Not Available" }),
4212
- /* @__PURE__ */ jsx27("p", { children: "This event is not available for public viewing." }),
4213
- handleRefetch && /* @__PURE__ */ jsx27(Button, { onClick: handleRefetch, children: "Try Again" })
4214
- ] }) });
4221
+ return /* @__PURE__ */ jsxs22("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
4222
+ /* @__PURE__ */ jsx26("h1", { children: "Event Not Available" }),
4223
+ /* @__PURE__ */ jsx26("p", { children: "This event is not available for public viewing." }),
4224
+ handleRefetch && /* @__PURE__ */ jsx26(Button, { onClick: handleRefetch, children: "Try Again" })
4225
+ ] });
4215
4226
  }
4216
- return /* @__PURE__ */ jsx27(PublicErrorBoundary, { children: /* @__PURE__ */ jsxs22(Fragment9, { children: [
4217
- customHeader || /* @__PURE__ */ jsx27(
4227
+ return /* @__PURE__ */ jsx26(PublicErrorBoundary, { children: /* @__PURE__ */ jsxs22(Fragment9, { children: [
4228
+ customHeader || /* @__PURE__ */ jsx26(
4218
4229
  PublicPageHeader,
4219
4230
  {
4220
4231
  event: event || void 0,
4221
4232
  eventCode
4222
4233
  }
4223
4234
  ),
4224
- /* @__PURE__ */ jsx27("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children }),
4225
- showFooter && event && (customFooter || /* @__PURE__ */ jsx27(PublicPageFooter, { event }))
4235
+ /* @__PURE__ */ jsx26("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children }),
4236
+ showFooter && event && (customFooter || /* @__PURE__ */ jsx26(PublicPageFooter, { event }))
4226
4237
  ] }) });
4227
4238
  }
4228
4239
  function usePublicPageContext2() {
@@ -4240,7 +4251,7 @@ function usePublicPageContext2() {
4240
4251
 
4241
4252
  // src/components/PublicLayout/PublicPageDebugger.tsx
4242
4253
  import { useEffect as useEffect9 } from "react";
4243
- import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
4254
+ import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
4244
4255
  function PublicPageDebugger({ enabled = true, label = "PublicPage" }) {
4245
4256
  useEffect9(() => {
4246
4257
  if (!enabled) return;
@@ -4294,14 +4305,14 @@ function PublicPageDebugger({ enabled = true, label = "PublicPage" }) {
4294
4305
  zIndex: 9999,
4295
4306
  fontFamily: "monospace"
4296
4307
  }, children: [
4297
- /* @__PURE__ */ jsx28("div", { children: "Public Page Debugger" }),
4298
- /* @__PURE__ */ jsx28("div", { children: "Check console for context analysis" })
4308
+ /* @__PURE__ */ jsx27("div", { children: "Public Page Debugger" }),
4309
+ /* @__PURE__ */ jsx27("div", { children: "Check console for context analysis" })
4299
4310
  ] });
4300
4311
  }
4301
4312
 
4302
4313
  // src/components/PublicLayout/PublicPageDiagnostic.tsx
4303
4314
  import { useEffect as useEffect10, useState as useState13 } from "react";
4304
- import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
4315
+ import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
4305
4316
  function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
4306
4317
  const [diagnostics, setDiagnostics] = useState13({
4307
4318
  hasPublicPageContext: false,
@@ -4395,7 +4406,7 @@ function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
4395
4406
  maxWidth: "300px",
4396
4407
  borderRadius: "0 0 8px 0"
4397
4408
  }, children: [
4398
- /* @__PURE__ */ jsx29("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F50D} Public Page Diagnostics" }),
4409
+ /* @__PURE__ */ jsx28("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F50D} Public Page Diagnostics" }),
4399
4410
  /* @__PURE__ */ jsxs24("div", { children: [
4400
4411
  "Public Context: ",
4401
4412
  diagnostics.hasPublicPageContext ? "\u2705" : "\u274C"
@@ -4420,13 +4431,13 @@ function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
4420
4431
  "Route Params: ",
4421
4432
  diagnostics.routeParams ? "\u2705" : "\u274C"
4422
4433
  ] }),
4423
- /* @__PURE__ */ jsx29("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.8 }, children: "Check console for detailed analysis" })
4434
+ /* @__PURE__ */ jsx28("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.8 }, children: "Check console for detailed analysis" })
4424
4435
  ] });
4425
4436
  }
4426
4437
 
4427
4438
  // src/components/PublicLayout/PublicPageContextChecker.tsx
4428
4439
  import { useEffect as useEffect11 } from "react";
4429
- import { jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
4440
+ import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
4430
4441
  function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
4431
4442
  useEffect11(() => {
4432
4443
  if (!enabled) return;
@@ -4504,9 +4515,9 @@ function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
4504
4515
  borderRadius: "0 0 8px 0",
4505
4516
  border: "2px solid #dc2626"
4506
4517
  }, children: [
4507
- /* @__PURE__ */ jsx30("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F6A8} PUBLIC PAGE CONTEXT CHECK" }),
4508
- /* @__PURE__ */ jsx30("div", { children: "Check console for authentication context analysis" }),
4509
- /* @__PURE__ */ jsx30("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.9 }, children: "If you see \u274C errors in console, your public page is inside auth context!" })
4518
+ /* @__PURE__ */ jsx29("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F6A8} PUBLIC PAGE CONTEXT CHECK" }),
4519
+ /* @__PURE__ */ jsx29("div", { children: "Check console for authentication context analysis" }),
4520
+ /* @__PURE__ */ jsx29("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.9 }, children: "If you see \u274C errors in console, your public page is inside auth context!" })
4510
4521
  ] });
4511
4522
  }
4512
4523
 
@@ -4517,7 +4528,6 @@ export {
4517
4528
  AvatarImage,
4518
4529
  AvatarFallback,
4519
4530
  Switch,
4520
- Progress,
4521
4531
  ToastProvider,
4522
4532
  ToastViewport,
4523
4533
  Toast,
@@ -4566,4 +4576,4 @@ export {
4566
4576
  PublicPageDiagnostic,
4567
4577
  PublicPageContextChecker
4568
4578
  };
4569
- //# sourceMappingURL=chunk-R4CRQUJJ.js.map
4579
+ //# sourceMappingURL=chunk-ENE3AB75.js.map