@jmruthers/pace-core 0.5.181 → 0.5.183

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 (756) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +16 -2
  3. package/dist/{AuthService-DYuQPJj6.d.ts → AuthService-B-cd2MA4.d.ts} +9 -11
  4. package/dist/{DataTable-CWAZZcXC.d.ts → DataTable-Bz8ffqyA.d.ts} +1 -1
  5. package/dist/{DataTable-UA6CL4JI.js → DataTable-QAB34V6K.js} +14 -15
  6. package/dist/UnifiedAuthProvider-7F6T4B6K.js +13 -0
  7. package/dist/{UnifiedAuthProvider-DJxGTftH.d.ts → UnifiedAuthProvider-F86d7dSi.d.ts} +5 -6
  8. package/dist/{api-45XYYO2A.js → api-ROMBCNKU.js} +5 -5
  9. package/dist/{audit-64X3VJXB.js → audit-WRS3KJKI.js} +4 -4
  10. package/dist/auth-BZOJqrdd.d.ts +49 -0
  11. package/dist/{chunk-CX5M4ZAG.js → chunk-5DRSZLL2.js} +1 -1
  12. package/dist/chunk-5DRSZLL2.js.map +1 -0
  13. package/dist/{chunk-BESYRHQM.js → chunk-6C4YBBJM.js} +10 -7
  14. package/dist/chunk-6C4YBBJM.js.map +1 -0
  15. package/dist/{chunk-PLDDJCW6.js → chunk-7D4SUZUM.js} +2 -13
  16. package/dist/{chunk-HRO5HWN2.js → chunk-CSOFYHAG.js} +55 -162
  17. package/dist/chunk-CSOFYHAG.js.map +1 -0
  18. package/dist/{chunk-ANBQRTPX.js → chunk-E66EQZE6.js} +3 -5
  19. package/dist/{chunk-ANBQRTPX.js.map → chunk-E66EQZE6.js.map} +1 -1
  20. package/dist/{chunk-Q5QRDWKI.js → chunk-F2IMUDXZ.js} +4 -6
  21. package/dist/chunk-F2IMUDXZ.js.map +1 -0
  22. package/dist/{chunk-SBVILCCA.js → chunk-FSFQFJCU.js} +28 -6
  23. package/dist/chunk-FSFQFJCU.js.map +1 -0
  24. package/dist/chunk-FUEYYMX5.js +2296 -0
  25. package/dist/chunk-FUEYYMX5.js.map +1 -0
  26. package/dist/{chunk-FFKNH6U5.js → chunk-HKIT6O7W.js} +3 -5
  27. package/dist/{chunk-FFKNH6U5.js.map → chunk-HKIT6O7W.js.map} +1 -1
  28. package/dist/chunk-KQCRWDSA.js +1 -0
  29. package/dist/{chunk-S5OFRT4M.js → chunk-KUEN3HFB.js} +6 -6
  30. package/dist/chunk-KUEN3HFB.js.map +1 -0
  31. package/dist/chunk-LMC26NLJ.js +84 -0
  32. package/dist/chunk-LMC26NLJ.js.map +1 -0
  33. package/dist/{chunk-BVYWGZVV.js → chunk-M7W4CP3M.js} +52 -19
  34. package/dist/chunk-M7W4CP3M.js.map +1 -0
  35. package/dist/{chunk-HZLDFOE4.js → chunk-MI7HBHN3.js} +164 -243
  36. package/dist/chunk-MI7HBHN3.js.map +1 -0
  37. package/dist/{chunk-PPMP5J6T.js → chunk-PWAHJW4G.js} +180 -29
  38. package/dist/chunk-PWAHJW4G.js.map +1 -0
  39. package/dist/chunk-PWLANIRT.js +127 -0
  40. package/dist/{chunk-XDNLUEXI.js.map → chunk-PWLANIRT.js.map} +1 -1
  41. package/dist/chunk-QCDXODCA.js +75 -0
  42. package/dist/chunk-QCDXODCA.js.map +1 -0
  43. package/dist/{chunk-D7LCGMVS.js → chunk-QETLRQI6.js} +526 -887
  44. package/dist/chunk-QETLRQI6.js.map +1 -0
  45. package/dist/{chunk-5MT24GKJ.js → chunk-QUVSNGIP.js} +264 -262
  46. package/dist/chunk-QUVSNGIP.js.map +1 -0
  47. package/dist/chunk-QXHPKYJV.js +113 -0
  48. package/dist/chunk-QXHPKYJV.js.map +1 -0
  49. package/dist/{chunk-OWAG3GSU.js → chunk-R77UEZ4E.js} +11 -1
  50. package/dist/chunk-R77UEZ4E.js.map +1 -0
  51. package/dist/{chunk-ZYTYSTO5.js → chunk-RA3JUFMW.js} +314 -161
  52. package/dist/chunk-RA3JUFMW.js.map +1 -0
  53. package/dist/{chunk-ERISIBYU.js → chunk-SQGMNID3.js} +3 -8
  54. package/dist/chunk-SQGMNID3.js.map +1 -0
  55. package/dist/{chunk-XJ2HZOBU.js → chunk-UHNYIBXL.js} +1 -1
  56. package/dist/chunk-UHNYIBXL.js.map +1 -0
  57. package/{src/utils/secureStorage.ts → dist/chunk-VBXEHIUJ.js} +113 -88
  58. package/dist/{chunk-7QCC6MCP.js.map → chunk-VBXEHIUJ.js.map} +1 -1
  59. package/dist/{chunk-VZ4VDGTB.js → chunk-W22JP75J.js} +5 -13
  60. package/dist/{chunk-VZ4VDGTB.js.map → chunk-W22JP75J.js.map} +1 -1
  61. package/dist/components.d.ts +12 -93
  62. package/dist/components.js +23 -106
  63. package/dist/components.js.map +1 -1
  64. package/dist/core-CUElvH_C.d.ts +164 -0
  65. package/dist/database.generated-CBmg2950.d.ts +8284 -0
  66. package/dist/event-CW5YB_2p.d.ts +239 -0
  67. package/dist/{file-reference-C6Gkn77H.d.ts → file-reference-D06mEEWW.d.ts} +7 -5
  68. package/dist/functions-D_kgHktt.d.ts +208 -0
  69. package/dist/hooks.d.ts +54 -7
  70. package/dist/hooks.js +204 -17
  71. package/dist/hooks.js.map +1 -1
  72. package/dist/{EventLogo-B3V3otev.d.ts → index-Bl--n7-T.d.ts} +387 -397
  73. package/dist/index.d.ts +94 -261
  74. package/dist/index.js +314 -126
  75. package/dist/index.js.map +1 -1
  76. package/dist/providers.d.ts +7 -8
  77. package/dist/providers.js +6 -13
  78. package/dist/rbac/index.d.ts +171 -101
  79. package/dist/rbac/index.js +23 -17
  80. package/dist/styles/index.d.ts +1 -3
  81. package/dist/styles/index.js +2 -17
  82. package/dist/theming/runtime.js +3 -3
  83. package/dist/types-UU913iLA.d.ts +102 -0
  84. package/dist/{types-Dfz9dmVH.d.ts → types-_x1f4QBF.d.ts} +6 -6
  85. package/dist/types.d.ts +88 -227
  86. package/dist/types.js +64 -112
  87. package/dist/types.js.map +1 -1
  88. package/dist/{usePublicRouteParams-B7PabvuH.d.ts → usePublicRouteParams-JJczomYq.d.ts} +203 -6
  89. package/dist/utils.d.ts +299 -13
  90. package/dist/utils.js +481 -55
  91. package/dist/utils.js.map +1 -1
  92. package/dist/validation-643vUDZW.d.ts +177 -0
  93. package/docs/DOCUMENTATION_REVIEW_TRACKER.md +511 -0
  94. package/docs/README.md +9 -8
  95. package/docs/api/README.md +16 -2
  96. package/docs/api/classes/ColumnFactory.md +1 -1
  97. package/docs/api/classes/ErrorBoundary.md +1 -1
  98. package/docs/api/classes/InvalidScopeError.md +4 -4
  99. package/docs/api/classes/MissingUserContextError.md +4 -4
  100. package/docs/api/classes/OrganisationContextRequiredError.md +4 -4
  101. package/docs/api/classes/PermissionDeniedError.md +4 -4
  102. package/docs/api/classes/RBACAuditManager.md +14 -14
  103. package/docs/api/classes/RBACCache.md +1 -1
  104. package/docs/api/classes/RBACEngine.md +2 -2
  105. package/docs/api/classes/RBACError.md +4 -4
  106. package/docs/api/classes/RBACNotInitializedError.md +4 -4
  107. package/docs/api/classes/SecureSupabaseClient.md +29 -9
  108. package/docs/api/classes/StorageUtils.md +1 -1
  109. package/docs/api/enums/FileCategory.md +17 -17
  110. package/docs/api/enums/RBACErrorCode.md +228 -0
  111. package/docs/api/enums/RPCFunction.md +118 -0
  112. package/docs/api/interfaces/AggregateConfig.md +1 -1
  113. package/docs/api/interfaces/BadgeProps.md +1 -1
  114. package/docs/api/interfaces/ButtonProps.md +2 -2
  115. package/docs/api/interfaces/CalendarProps.md +1 -1
  116. package/docs/api/interfaces/CardProps.md +29 -3
  117. package/docs/api/interfaces/ColorPalette.md +1 -1
  118. package/docs/api/interfaces/ColorShade.md +1 -1
  119. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  120. package/docs/api/interfaces/DataRecord.md +1 -1
  121. package/docs/api/interfaces/DataTableAction.md +2 -2
  122. package/docs/api/interfaces/DataTableColumn.md +6 -6
  123. package/docs/api/interfaces/DataTableProps.md +1 -1
  124. package/docs/api/interfaces/DataTableToolbarButton.md +2 -2
  125. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  126. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  127. package/docs/api/interfaces/EventAppRoleData.md +1 -1
  128. package/docs/api/interfaces/ExportColumn.md +5 -5
  129. package/docs/api/interfaces/ExportOptions.md +4 -4
  130. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  131. package/docs/api/interfaces/FileMetadata.md +13 -13
  132. package/docs/api/interfaces/FileReference.md +12 -12
  133. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  134. package/docs/api/interfaces/FileUploadOptions.md +10 -10
  135. package/docs/api/interfaces/FileUploadProps.md +19 -19
  136. package/docs/api/interfaces/FooterProps.md +1 -1
  137. package/docs/api/interfaces/FormFieldProps.md +166 -0
  138. package/docs/api/interfaces/FormProps.md +113 -0
  139. package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
  140. package/docs/api/interfaces/InactivityWarningModalProps.md +8 -8
  141. package/docs/api/interfaces/InputProps.md +2 -2
  142. package/docs/api/interfaces/LabelProps.md +8 -8
  143. package/docs/api/interfaces/LoginFormProps.md +1 -1
  144. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  145. package/docs/api/interfaces/NavigationContextType.md +1 -1
  146. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  147. package/docs/api/interfaces/NavigationItem.md +17 -73
  148. package/docs/api/interfaces/NavigationMenuProps.md +38 -53
  149. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  150. package/docs/api/interfaces/Organisation.md +13 -13
  151. package/docs/api/interfaces/OrganisationContextType.md +21 -21
  152. package/docs/api/interfaces/OrganisationMembership.md +15 -15
  153. package/docs/api/interfaces/OrganisationProviderProps.md +59 -2
  154. package/docs/api/interfaces/OrganisationSecurityError.md +5 -5
  155. package/docs/api/interfaces/PaceAppLayoutProps.md +26 -39
  156. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  157. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  158. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  159. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  160. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  161. package/docs/api/interfaces/PaletteData.md +1 -1
  162. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  163. package/docs/api/interfaces/ProgressProps.md +50 -0
  164. package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
  165. package/docs/api/interfaces/PublicPageFooterProps.md +9 -9
  166. package/docs/api/interfaces/PublicPageHeaderProps.md +10 -10
  167. package/docs/api/interfaces/PublicPageLayoutProps.md +15 -15
  168. package/docs/api/interfaces/RBACAccessValidateParams.md +52 -0
  169. package/docs/api/interfaces/RBACAccessValidateResult.md +41 -0
  170. package/docs/api/interfaces/RBACAuditLogParams.md +85 -0
  171. package/docs/api/interfaces/RBACAuditLogResult.md +52 -0
  172. package/docs/api/interfaces/RBACConfig.md +2 -2
  173. package/docs/api/interfaces/RBACContext.md +52 -0
  174. package/docs/api/interfaces/RBACLogger.md +1 -1
  175. package/docs/api/interfaces/RBACPageAccessCheckParams.md +74 -0
  176. package/docs/api/interfaces/RBACPermissionCheckParams.md +74 -0
  177. package/docs/api/interfaces/RBACPermissionCheckResult.md +52 -0
  178. package/docs/api/interfaces/RBACPermissionsGetParams.md +63 -0
  179. package/docs/api/interfaces/RBACPermissionsGetResult.md +63 -0
  180. package/docs/api/interfaces/RBACResult.md +58 -0
  181. package/docs/api/interfaces/RBACRoleGrantParams.md +63 -0
  182. package/docs/api/interfaces/RBACRoleGrantResult.md +52 -0
  183. package/docs/api/interfaces/RBACRoleRevokeParams.md +63 -0
  184. package/docs/api/interfaces/RBACRoleRevokeResult.md +52 -0
  185. package/docs/api/interfaces/RBACRoleValidateParams.md +52 -0
  186. package/docs/api/interfaces/RBACRoleValidateResult.md +63 -0
  187. package/docs/api/interfaces/RBACRolesListParams.md +52 -0
  188. package/docs/api/interfaces/RBACRolesListResult.md +74 -0
  189. package/docs/api/interfaces/RBACSessionTrackParams.md +74 -0
  190. package/docs/api/interfaces/RBACSessionTrackResult.md +52 -0
  191. package/docs/api/interfaces/ResourcePermissions.md +1 -1
  192. package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
  193. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  194. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  195. package/docs/api/interfaces/RoleManagementResult.md +1 -1
  196. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  197. package/docs/api/interfaces/RouteConfig.md +1 -1
  198. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  199. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  200. package/docs/api/interfaces/SessionRestorationLoaderProps.md +15 -2
  201. package/docs/api/interfaces/StorageConfig.md +1 -1
  202. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  203. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  204. package/docs/api/interfaces/StorageListOptions.md +1 -1
  205. package/docs/api/interfaces/StorageListResult.md +1 -1
  206. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  207. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  208. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  209. package/docs/api/interfaces/StyleImport.md +1 -1
  210. package/docs/api/interfaces/SwitchProps.md +1 -1
  211. package/docs/api/interfaces/TabsContentProps.md +1 -1
  212. package/docs/api/interfaces/TabsListProps.md +1 -1
  213. package/docs/api/interfaces/TabsProps.md +1 -1
  214. package/docs/api/interfaces/TabsTriggerProps.md +43 -2
  215. package/docs/api/interfaces/TextareaProps.md +2 -2
  216. package/docs/api/interfaces/ToastActionElement.md +1 -1
  217. package/docs/api/interfaces/ToastProps.md +1 -1
  218. package/docs/api/interfaces/UnifiedAuthContextType.md +61 -61
  219. package/docs/api/interfaces/UnifiedAuthProviderProps.md +13 -13
  220. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  221. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  222. package/docs/api/interfaces/UsePublicEventLogoOptions.md +87 -0
  223. package/docs/api/interfaces/UsePublicEventLogoReturn.md +81 -0
  224. package/docs/api/interfaces/UsePublicEventOptions.md +3 -3
  225. package/docs/api/interfaces/UsePublicEventReturn.md +5 -5
  226. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +2 -2
  227. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
  228. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  229. package/docs/api/interfaces/UseResolvedScopeOptions.md +2 -2
  230. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  231. package/docs/api/interfaces/UseResourcePermissionsOptions.md +1 -1
  232. package/docs/api/interfaces/UserEventAccess.md +1 -1
  233. package/docs/api/interfaces/UserMenuProps.md +4 -4
  234. package/docs/api/interfaces/UserProfile.md +7 -7
  235. package/docs/api/modules.md +484 -462
  236. package/docs/api-reference/components.md +186 -15
  237. package/docs/api-reference/deprecated.md +376 -0
  238. package/docs/api-reference/hooks.md +149 -19
  239. package/docs/api-reference/providers.md +61 -6
  240. package/docs/api-reference/rpc-functions.md +397 -0
  241. package/docs/api-reference/types.md +135 -78
  242. package/docs/api-reference/utilities.md +51 -380
  243. package/docs/architecture/README.md +49 -3
  244. package/docs/architecture/database-schema-requirements.md +40 -3
  245. package/docs/architecture/rbac-security-architecture.md +41 -4
  246. package/docs/architecture/services.md +127 -42
  247. package/docs/best-practices/README.md +51 -5
  248. package/docs/best-practices/accessibility.md +32 -3
  249. package/docs/best-practices/common-patterns.md +50 -3
  250. package/docs/best-practices/deployment.md +50 -4
  251. package/docs/best-practices/performance.md +50 -3
  252. package/docs/best-practices/security.md +94 -41
  253. package/docs/best-practices/testing.md +33 -4
  254. package/docs/core-concepts/authentication.md +5 -5
  255. package/docs/core-concepts/events.md +3 -3
  256. package/docs/core-concepts/organisations.md +3 -3
  257. package/docs/core-concepts/permissions.md +3 -3
  258. package/docs/core-concepts/rbac-system.md +5 -5
  259. package/docs/documentation-index.md +30 -8
  260. package/docs/getting-started/documentation-index.md +1 -1
  261. package/docs/getting-started/examples/README.md +7 -5
  262. package/docs/getting-started/examples/basic-auth-app.md +3 -0
  263. package/docs/getting-started/examples/full-featured-app.md +5 -3
  264. package/docs/getting-started/faq.md +6 -6
  265. package/docs/getting-started/installation-guide.md +192 -13
  266. package/docs/getting-started/local-development.md +303 -0
  267. package/docs/getting-started/quick-reference.md +3 -3
  268. package/docs/getting-started/quick-start.md +517 -0
  269. package/docs/implementation-guides/app-layout.md +45 -3
  270. package/docs/implementation-guides/authentication.md +66 -7
  271. package/docs/implementation-guides/component-styling.md +53 -3
  272. package/docs/implementation-guides/data-tables.md +76 -7
  273. package/docs/implementation-guides/datatable-filtering.md +1 -2
  274. package/docs/implementation-guides/datatable-rbac-usage.md +0 -1
  275. package/docs/implementation-guides/dynamic-colors.md +155 -4
  276. package/docs/implementation-guides/file-reference-system.md +72 -3
  277. package/docs/implementation-guides/file-upload-storage.md +72 -3
  278. package/docs/implementation-guides/forms.md +53 -3
  279. package/docs/implementation-guides/inactivity-tracking.md +53 -3
  280. package/docs/implementation-guides/large-datasets.md +1 -1
  281. package/docs/implementation-guides/navigation.md +55 -5
  282. package/docs/implementation-guides/organisation-security.md +72 -3
  283. package/docs/implementation-guides/performance.md +57 -1
  284. package/docs/implementation-guides/permission-enforcement.md +81 -8
  285. package/docs/implementation-guides/public-pages.md +560 -14
  286. package/docs/migration/MIGRATION_GUIDE.md +409 -50
  287. package/docs/migration/README.md +37 -3
  288. package/docs/migration/organisation-context-timing-fix.md +39 -4
  289. package/docs/migration/quick-migration-guide.md +41 -5
  290. package/docs/migration/rbac-migration.md +59 -3
  291. package/docs/migration/service-architecture.md +77 -14
  292. package/docs/rbac/README.md +79 -3
  293. package/docs/rbac/advanced-patterns.md +47 -3
  294. package/docs/rbac/api-reference.md +77 -8
  295. package/docs/rbac/event-based-apps.md +50 -5
  296. package/docs/rbac/examples/rbac-rls-integration-example.md +3 -3
  297. package/docs/rbac/examples.md +39 -3
  298. package/docs/rbac/getting-started.md +63 -4
  299. package/docs/rbac/quick-start.md +57 -5
  300. package/docs/rbac/rbac-rls-integration.md +68 -6
  301. package/docs/rbac/super-admin-guide.md +47 -3
  302. package/docs/rbac/troubleshooting.md +3 -3
  303. package/docs/security/README.md +68 -3
  304. package/docs/security/checklist.md +50 -3
  305. package/docs/standards/01-architecture-standard.md +39 -0
  306. package/docs/standards/02-api-and-rpc-standard.md +39 -0
  307. package/docs/standards/03-component-standard.md +32 -0
  308. package/docs/standards/04-code-style-standard.md +32 -0
  309. package/docs/standards/05-security-standard.md +30 -0
  310. package/docs/standards/06-testing-and-docs-standard.md +29 -0
  311. package/docs/standards/README.md +35 -0
  312. package/docs/styles/README.md +89 -8
  313. package/docs/testing/README.md +175 -24
  314. package/docs/troubleshooting/README.md +50 -3
  315. package/docs/troubleshooting/common-issues.md +271 -5
  316. package/docs/troubleshooting/debugging.md +54 -1
  317. package/docs/troubleshooting/migration.md +54 -1
  318. package/docs/troubleshooting/organisation-context-setup.md +29 -3
  319. package/docs/troubleshooting/styling-issues.md +246 -4
  320. package/{src/components/DataTable/examples → examples/DataTable}/GroupingAggregationExample.tsx +1 -1
  321. package/examples/{components 2/DataTable/HierarchicalActionsExample.tsx → DataTable/HierarchicalActionsExample.tsx} +7 -6
  322. package/{src/components/DataTable/examples → examples/DataTable}/HierarchicalExample.tsx +8 -6
  323. package/examples/{components 2/DataTable/PerformanceExample.tsx → DataTable/PerformanceExample.tsx} +2 -2
  324. package/examples/{components 2/DataTable/index.ts → DataTable/index.ts} +1 -0
  325. package/{src/components/Dialog/examples → examples/Dialog}/HtmlDialogExample.tsx +3 -3
  326. package/examples/{components 2/Dialog/ScrollableDialogExample.tsx → Dialog/ScrollableDialogExample.tsx} +1 -1
  327. package/{src/components/Dialog/examples → examples/Dialog}/SmartDialogExample.tsx +1 -1
  328. package/examples/{components 2/Dialog/index.ts → Dialog/index.ts} +0 -3
  329. package/examples/{features/public-pages → PublicPages}/CorrectPublicPageImplementation.tsx +52 -17
  330. package/examples/{features/public-pages → PublicPages}/PublicEventPage.tsx +65 -35
  331. package/examples/{features/public-pages → PublicPages}/PublicPageApp.tsx +52 -18
  332. package/examples/{features/public-pages → PublicPages}/PublicPageUsageExample.tsx +28 -15
  333. package/examples/README.md +81 -33
  334. package/examples/index.ts +14 -12
  335. package/examples/{RBAC → rbac}/CompleteRBACExample.tsx +1 -1
  336. package/examples/{features/rbac → rbac}/EventBasedApp.tsx +4 -4
  337. package/examples/{features/rbac → rbac}/PermissionExample.tsx +5 -3
  338. package/package.json +21 -27
  339. package/src/__tests__/helpers/test-utils.tsx +29 -3
  340. package/src/__tests__/rbac/PagePermissionGuard.test.tsx +7 -5
  341. package/src/components/Alert/Alert.test.tsx +2 -2
  342. package/src/components/Alert/Alert.tsx +4 -4
  343. package/src/components/Avatar/Avatar.test.tsx +17 -6
  344. package/src/components/Badge/Badge.test.tsx +1 -1
  345. package/src/components/Badge/Badge.tsx +2 -2
  346. package/src/components/Button/Button.test.tsx +2 -2
  347. package/src/components/Button/Button.tsx +11 -7
  348. package/src/components/Calendar/Calendar.test.tsx +41 -8
  349. package/src/components/Calendar/Calendar.tsx +39 -36
  350. package/src/components/Card/Card.tsx +51 -13
  351. package/src/components/Checkbox/Checkbox.test.tsx +36 -12
  352. package/src/components/DataTable/DataTable.test.tsx +1 -1
  353. package/src/components/DataTable/__tests__/DataTable.comprehensive.test.tsx +13 -7
  354. package/src/components/DataTable/__tests__/DataTable.default-state.test.tsx +14 -42
  355. package/src/components/DataTable/__tests__/DataTable.export.test.tsx +13 -10
  356. package/src/components/DataTable/__tests__/DataTable.grouping-aggregation.test.tsx +14 -11
  357. package/src/components/DataTable/__tests__/DataTable.hooks.test.tsx +4 -2
  358. package/src/components/DataTable/__tests__/DataTable.test.tsx +13 -7
  359. package/src/components/DataTable/__tests__/DataTableCore.test-setup.ts +13 -10
  360. package/src/components/DataTable/__tests__/DataTableCore.test.tsx +15 -11
  361. package/src/components/DataTable/__tests__/a11y.basic.test.tsx +12 -6
  362. package/src/components/DataTable/__tests__/keyboard.test.tsx +12 -6
  363. package/src/components/DataTable/__tests__/pagination.modes.test.tsx +10 -6
  364. package/src/components/DataTable/__tests__/test-utils/sharedTestUtils.tsx +1 -1
  365. package/src/components/DataTable/components/DataTableBody.tsx +10 -25
  366. package/src/components/DataTable/components/DataTableCore.tsx +1 -1
  367. package/src/components/DataTable/components/FilterRow.tsx +3 -1
  368. package/src/components/DataTable/components/ImportModal.tsx +1 -1
  369. package/src/components/DataTable/components/VirtualizedDataTable.tsx +9 -9
  370. package/src/components/DataTable/core/ColumnFactory.ts +6 -6
  371. package/src/components/DataTable/core/DataTableContext.tsx +14 -10
  372. package/src/components/DataTable/core/LocalDataAdapter.ts +2 -1
  373. package/src/components/DataTable/core/PluginRegistry.ts +3 -3
  374. package/src/components/DataTable/core/StateManager.ts +12 -11
  375. package/src/components/DataTable/core/__tests__/ActionManager.test.ts +104 -0
  376. package/src/components/DataTable/core/__tests__/DataManager.test.ts +101 -0
  377. package/src/components/DataTable/core/__tests__/LocalDataAdapter.test.ts +84 -0
  378. package/src/components/DataTable/core/__tests__/PluginRegistry.test.ts +102 -0
  379. package/src/components/DataTable/core/__tests__/StateManager.test.ts +104 -0
  380. package/src/components/DataTable/core/interfaces.ts +17 -17
  381. package/src/components/DataTable/hooks/__tests__/useDataTableConfiguration.test.ts +124 -0
  382. package/src/components/DataTable/hooks/__tests__/useDataTableDataPipeline.test.ts +117 -0
  383. package/src/components/DataTable/hooks/__tests__/useDataTablePermissions.test.ts +102 -0
  384. package/src/components/DataTable/hooks/__tests__/useEffectiveColumnOrder.test.ts +53 -0
  385. package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +0 -2
  386. package/src/components/DataTable/hooks/useDataTablePermissions.ts +9 -8
  387. package/src/components/DataTable/types.ts +5 -5
  388. package/src/components/DataTable/utils/aggregationUtils.ts +4 -4
  389. package/src/components/DataTable/utils/columnUtils.ts +3 -2
  390. package/src/components/DataTable/utils/debugTools.ts +1 -1
  391. package/src/components/DataTable/utils/exportUtils.ts +6 -6
  392. package/src/components/DataTable/utils/hierarchicalSorting.ts +6 -6
  393. package/src/components/DataTable/utils/hierarchicalUtils.ts +0 -8
  394. package/src/components/DataTable/utils/index.ts +0 -1
  395. package/src/components/DataTable/utils/performanceUtils.ts +9 -4
  396. package/src/components/Dialog/Dialog.test.tsx +49 -27
  397. package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +13 -8
  398. package/src/components/EventSelector/EventSelector.test.tsx +60 -12
  399. package/src/components/EventSelector/EventSelector.tsx +38 -15
  400. package/src/components/EventSelector/index.ts +2 -2
  401. package/src/components/FileDisplay/FileDisplay.test.tsx +143 -85
  402. package/src/components/FileDisplay/FileDisplay.tsx +1 -0
  403. package/src/components/FileUpload/FileUpload.test.tsx +532 -152
  404. package/src/components/FileUpload/FileUpload.tsx +43 -8
  405. package/src/components/Footer/Footer.test.tsx +19 -14
  406. package/src/components/Form/Form.test.tsx +96 -14
  407. package/src/components/Form/Form.tsx +210 -1
  408. package/src/components/Form/index.ts +3 -7
  409. package/src/components/Header/Header.test.tsx +24 -17
  410. package/src/components/Header/Header.tsx +3 -1
  411. package/src/components/InactivityWarningModal/InactivityWarningModal.tsx +2 -4
  412. package/src/components/Input/Input.test.tsx +61 -36
  413. package/src/components/Label/{__tests__/Label.test.tsx → Label.test.tsx} +2 -2
  414. package/src/components/Label/Label.tsx +2 -3
  415. package/src/components/LoadingSpinner/LoadingSpinner.test.tsx +6 -5
  416. package/src/components/LoadingSpinner/LoadingSpinner.tsx +6 -2
  417. package/src/components/LoginForm/LoginForm.test.tsx +14 -13
  418. package/src/components/LoginForm/LoginForm.tsx +1 -1
  419. package/src/components/LoginForm/index.ts +7 -0
  420. package/src/components/NavigationMenu/NavigationMenu.test.tsx +233 -20
  421. package/src/components/NavigationMenu/NavigationMenu.tsx +191 -55
  422. package/src/components/NavigationMenu/index.ts +1 -1
  423. package/src/components/OrganisationSelector/OrganisationSelector.test.tsx +20 -11
  424. package/src/components/OrganisationSelector/OrganisationSelector.tsx +1 -1
  425. package/src/components/PaceAppLayout/{__tests__/PaceAppLayout.integration.test.tsx → PaceAppLayout.integration.test.tsx} +272 -79
  426. package/src/components/PaceAppLayout/{__tests__/PaceAppLayout.performance.test.tsx → PaceAppLayout.performance.test.tsx} +155 -32
  427. package/src/components/PaceAppLayout/{__tests__/PaceAppLayout.security.test.tsx → PaceAppLayout.security.test.tsx} +211 -65
  428. package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +498 -210
  429. package/src/components/PaceAppLayout/PaceAppLayout.tsx +63 -64
  430. package/src/components/PaceAppLayout/test-setup.tsx +192 -0
  431. package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +193 -39
  432. package/src/components/{PasswordReset → PasswordChange}/PasswordChangeForm.test.tsx +2 -2
  433. package/src/components/{PasswordReset → PasswordChange}/PasswordChangeForm.tsx +10 -4
  434. package/src/components/PasswordChange/index.ts +2 -0
  435. package/src/components/Progress/Progress.test.tsx +11 -0
  436. package/src/components/Progress/Progress.tsx +1 -1
  437. package/src/components/Progress/index.ts +10 -0
  438. package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +2 -1
  439. package/src/components/PublicLayout/PublicLayout.test.tsx +1210 -0
  440. package/src/components/PublicLayout/PublicPageLayout.tsx +190 -36
  441. package/src/components/PublicLayout/PublicPageProvider.tsx +8 -7
  442. package/src/components/PublicLayout/index.ts +10 -28
  443. package/src/components/Select/Select.test.tsx +7 -7
  444. package/src/components/Select/Select.tsx +277 -11
  445. package/src/components/Select/index.ts +1 -2
  446. package/src/components/SessionRestorationLoader/SessionRestorationLoader.test.tsx +232 -0
  447. package/src/components/SessionRestorationLoader/SessionRestorationLoader.tsx +40 -19
  448. package/src/components/Table/{__tests__/Table.test.tsx → Table.test.tsx} +94 -41
  449. package/src/components/Tabs/Tabs.test.tsx +10 -9
  450. package/src/components/Tabs/Tabs.tsx +61 -33
  451. package/src/components/Textarea/Textarea.test.tsx +31 -18
  452. package/src/components/Toast/Toast.tsx +2 -2
  453. package/src/components/Tooltip/Tooltip.test.tsx +1 -1
  454. package/src/components/UserMenu/UserMenu.test.tsx +7 -6
  455. package/src/components/UserMenu/UserMenu.tsx +2 -2
  456. package/src/components/index.ts +5 -4
  457. package/src/constants/performance.ts +19 -8
  458. package/src/hooks/__tests__/useAppConfig.unit.test.ts +21 -22
  459. package/src/hooks/__tests__/useEvents.unit.test.ts +5 -4
  460. package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +2 -2
  461. package/src/hooks/__tests__/usePermissionCache.simple.test.ts +17 -0
  462. package/src/hooks/__tests__/usePermissionCache.unit.test.ts +16 -11
  463. package/src/hooks/__tests__/usePublicEvent.simple.test.ts +1 -3
  464. package/src/hooks/__tests__/usePublicEvent.unit.test.ts +1 -3
  465. package/src/hooks/__tests__/useRBAC.unit.test.ts +24 -2
  466. package/src/hooks/index.ts +4 -0
  467. package/src/hooks/public/index.ts +2 -0
  468. package/src/hooks/public/usePublicEvent.ts +4 -6
  469. package/src/hooks/public/usePublicEventLogo.test.ts +147 -0
  470. package/src/hooks/public/usePublicRouteParams.ts +1 -1
  471. package/src/hooks/services/useAuth.ts +2 -4
  472. package/src/hooks/services/useCurrentEvent.ts +1 -1
  473. package/src/hooks/useAppConfig.ts +1 -1
  474. package/src/hooks/useDataTablePerformance.ts +2 -2
  475. package/src/hooks/useEventTheme.ts +1 -1
  476. package/src/hooks/useEvents.ts +51 -10
  477. package/src/hooks/useOrganisationPermissions.test.ts +3 -3
  478. package/src/hooks/useOrganisationPermissions.ts +1 -1
  479. package/src/hooks/useOrganisationSecurity.ts +2 -2
  480. package/src/hooks/usePermissionCache.test.ts +9 -9
  481. package/src/hooks/usePermissionCache.ts +2 -2
  482. package/src/index.ts +19 -12
  483. package/src/providers/OrganisationProvider.tsx +73 -9
  484. package/src/providers/UnifiedAuthProvider.smoke.test.tsx +113 -13
  485. package/src/providers/__tests__/AuthProvider.test.tsx +2 -1
  486. package/src/providers/__tests__/EventProvider.test.tsx +24 -15
  487. package/src/providers/__tests__/OrganisationProvider.test.tsx +87 -36
  488. package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +80 -24
  489. package/src/providers/index.ts +0 -3
  490. package/src/providers/services/AuthServiceProvider.tsx +2 -17
  491. package/src/providers/services/EventServiceProvider.tsx +11 -16
  492. package/src/providers/services/InactivityServiceProvider.tsx +9 -12
  493. package/src/providers/services/OrganisationServiceProvider.tsx +9 -12
  494. package/src/providers/services/UnifiedAuthProvider.tsx +85 -18
  495. package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +11 -4
  496. package/src/rbac/__tests__/scenarios.user-role.test.tsx +105 -21
  497. package/src/rbac/adapters.tsx +1 -1
  498. package/src/rbac/api.ts +20 -4
  499. package/src/rbac/audit-enhanced.ts +47 -2
  500. package/src/rbac/audit.ts +47 -2
  501. package/src/rbac/components/NavigationGuard.tsx +1 -1
  502. package/src/rbac/components/NavigationProvider.test.tsx +7 -6
  503. package/src/rbac/components/NavigationProvider.tsx +1 -1
  504. package/src/rbac/components/PagePermissionGuard.tsx +1 -1
  505. package/src/rbac/components/PagePermissionProvider.test.tsx +7 -6
  506. package/src/rbac/components/PagePermissionProvider.tsx +1 -1
  507. package/src/rbac/components/PermissionEnforcer.tsx +1 -1
  508. package/src/rbac/components/RoleBasedRouter.tsx +1 -1
  509. package/src/rbac/components/SecureDataProvider.test.tsx +7 -6
  510. package/src/rbac/components/SecureDataProvider.tsx +1 -1
  511. package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +6 -6
  512. package/src/rbac/components/__tests__/NavigationGuard.test.tsx +11 -10
  513. package/src/rbac/components/__tests__/NavigationProvider.test.tsx +10 -11
  514. package/src/rbac/components/__tests__/PagePermissionGuard.race-condition.test.tsx +19 -15
  515. package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +13 -12
  516. package/src/rbac/components/__tests__/PagePermissionGuard.verification.test.tsx +19 -15
  517. package/src/rbac/components/__tests__/PagePermissionProvider.test.tsx +18 -18
  518. package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +11 -10
  519. package/src/rbac/components/__tests__/RoleBasedRouter.test.tsx +8 -7
  520. package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +10 -11
  521. package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +48 -19
  522. package/src/rbac/hooks/__tests__/useSecureSupabase.test.ts +476 -0
  523. package/src/rbac/hooks/index.ts +3 -0
  524. package/src/rbac/hooks/usePermissions.ts +31 -85
  525. package/src/rbac/hooks/useRBAC.test.ts +13 -1
  526. package/src/rbac/hooks/useRBAC.ts +13 -67
  527. package/src/rbac/hooks/useResolvedScope.ts +11 -0
  528. package/src/rbac/hooks/useSecureSupabase.ts +308 -0
  529. package/src/rbac/index.ts +3 -0
  530. package/src/rbac/secureClient.ts +53 -6
  531. package/src/rbac/security.ts +37 -1
  532. package/src/{types/rbac-functions.ts → rbac/types/functions.ts} +30 -30
  533. package/src/rbac/types.ts +3 -2
  534. package/src/services/AuthService.ts +33 -25
  535. package/src/services/EventService.ts +56 -44
  536. package/src/services/InactivityService.ts +33 -53
  537. package/src/services/OrganisationService.ts +36 -40
  538. package/src/services/__tests__/AuthService.restoreSession.test.ts +6 -2
  539. package/src/services/__tests__/EventService.test.ts +67 -33
  540. package/src/services/interfaces/IEventService.ts +1 -1
  541. package/src/styles/core.css +2 -2
  542. package/src/styles/index.test.ts +21 -0
  543. package/src/styles/index.ts +1 -5
  544. package/src/types/__tests__/guards.test.ts +1 -1
  545. package/src/types/__tests__/organisation.roles.test.ts +55 -0
  546. package/src/types/__tests__/type-validation.test.ts +0 -1
  547. package/src/types/auth.ts +42 -2
  548. package/src/types/core.ts +251 -0
  549. package/src/types/database.ts +11 -496
  550. package/src/types/event.ts +102 -0
  551. package/src/types/file-reference.ts +6 -4
  552. package/src/types/guards.ts +2 -1
  553. package/src/types/index.ts +48 -14
  554. package/src/types/lodash.debounce.d.ts +15 -0
  555. package/src/types/organisation.ts +14 -10
  556. package/src/types/supabase.ts +15 -17
  557. package/src/utils/__tests__/secureErrors.unit.test.ts +1 -1
  558. package/src/utils/__tests__/validationUtils.unit.test.ts +0 -29
  559. package/src/utils/app/appNameResolver.ts +1 -1
  560. package/src/utils/audit/audit.test.ts +65 -0
  561. package/src/utils/device/deviceFingerprint.test.ts +171 -0
  562. package/src/utils/dynamic/dynamicUtils.ts +3 -2
  563. package/src/utils/file-reference/index.ts +25 -6
  564. package/src/utils/security/secureErrors.ts +1 -1
  565. package/src/utils/validation/__tests__/validationUtils.test.ts +72 -0
  566. package/src/utils/validation/index.ts +6 -12
  567. package/src/utils/validation/validationUtils.ts +0 -13
  568. package/dist/UnifiedAuthProvider-B37ATQHE.js +0 -16
  569. package/dist/auth-DReDSLq9.d.ts +0 -16
  570. package/dist/chunk-3JI76CYK.js +0 -2444
  571. package/dist/chunk-3JI76CYK.js.map +0 -1
  572. package/dist/chunk-56XJ3TU6.js +0 -11
  573. package/dist/chunk-56XJ3TU6.js.map +0 -1
  574. package/dist/chunk-5MT24GKJ.js.map +0 -1
  575. package/dist/chunk-7QCC6MCP.js +0 -288
  576. package/dist/chunk-BESYRHQM.js.map +0 -1
  577. package/dist/chunk-BJPBT3CU.js +0 -21
  578. package/dist/chunk-BJPBT3CU.js.map +0 -1
  579. package/dist/chunk-BVYWGZVV.js.map +0 -1
  580. package/dist/chunk-CX5M4ZAG.js.map +0 -1
  581. package/dist/chunk-D7LCGMVS.js.map +0 -1
  582. package/dist/chunk-EGI6MUL6.js +0 -27
  583. package/dist/chunk-EGI6MUL6.js.map +0 -1
  584. package/dist/chunk-ERISIBYU.js.map +0 -1
  585. package/dist/chunk-HRO5HWN2.js.map +0 -1
  586. package/dist/chunk-HZLDFOE4.js.map +0 -1
  587. package/dist/chunk-JISYG63F.js +0 -70
  588. package/dist/chunk-JISYG63F.js.map +0 -1
  589. package/dist/chunk-LIMSTKYD.js +0 -61
  590. package/dist/chunk-LIMSTKYD.js.map +0 -1
  591. package/dist/chunk-OWAG3GSU.js.map +0 -1
  592. package/dist/chunk-PPMP5J6T.js.map +0 -1
  593. package/dist/chunk-Q5QRDWKI.js.map +0 -1
  594. package/dist/chunk-S5OFRT4M.js.map +0 -1
  595. package/dist/chunk-SBVILCCA.js.map +0 -1
  596. package/dist/chunk-TUMEWN34.js +0 -15
  597. package/dist/chunk-TUMEWN34.js.map +0 -1
  598. package/dist/chunk-XDNLUEXI.js +0 -138
  599. package/dist/chunk-XJ2HZOBU.js.map +0 -1
  600. package/dist/chunk-ZYTYSTO5.js.map +0 -1
  601. package/dist/chunk-ZZ2SS7NI.js +0 -237
  602. package/dist/chunk-ZZ2SS7NI.js.map +0 -1
  603. package/dist/database-C6jy7EOu.d.ts +0 -500
  604. package/dist/organisation-D6qRDtbF.d.ts +0 -93
  605. package/dist/schema-DTDZQe2u.d.ts +0 -28
  606. package/dist/unified-DQ4VcT7H.d.ts +0 -198
  607. package/dist/useInactivityTracker-TO6ZOF35.js +0 -11
  608. package/dist/validation.d.ts +0 -47
  609. package/dist/validation.js +0 -24
  610. package/dist/validation.js.map +0 -1
  611. package/docs/DOCUMENTATION_AUDIT.md +0 -172
  612. package/docs/DOCUMENTATION_STANDARD.md +0 -137
  613. package/docs/api/classes/PublicErrorBoundary.md +0 -132
  614. package/docs/api/interfaces/EventLogoProps.md +0 -152
  615. package/docs/api/interfaces/PublicErrorBoundaryProps.md +0 -94
  616. package/docs/api/interfaces/PublicErrorBoundaryState.md +0 -68
  617. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +0 -86
  618. package/docs/architecture/rpc-function-standards.md +0 -1106
  619. package/docs/getting-started/consuming-app-vite-config.md +0 -239
  620. package/docs/implementation-guides/event-theming-summary.md +0 -226
  621. package/docs/implementation-guides/public-pages-advanced.md +0 -1038
  622. package/docs/migration/v0.4.15-tailwind-scanning.md +0 -278
  623. package/docs/migration/v0.4.16-css-first-approach.md +0 -312
  624. package/docs/migration/v0.4.17-source-path-fix.md +0 -235
  625. package/docs/rbac/RBAC_EVENT_CONTEXT_LOADING.md +0 -222
  626. package/docs/rbac/RBAC_LOGIN_SAFETY_FIX.md +0 -95
  627. package/docs/rbac/RBAC_V0.5.147_FIX.md +0 -117
  628. package/docs/rbac/README-rbac-rls-integration.md +0 -374
  629. package/docs/styles/usage.md +0 -227
  630. package/docs/testing/visual-testing.md +0 -120
  631. package/docs/troubleshooting/DEBUG_NETWORK_ERROR.md +0 -152
  632. package/docs/troubleshooting/FIX_SUPABASE_CORS.md +0 -184
  633. package/docs/troubleshooting/cake-page-permission-guard-issue-summary.md +0 -193
  634. package/docs/troubleshooting/database-view-compatibility.md +0 -125
  635. package/docs/troubleshooting/react-hooks-issue-analysis.md +0 -172
  636. package/docs/troubleshooting/tailwind-content-scanning.md +0 -219
  637. package/examples/RBAC/EventBasedApp.tsx +0 -239
  638. package/examples/RBAC/PermissionExample.tsx +0 -151
  639. package/examples/STRUCTURE.md +0 -125
  640. package/examples/components 2/DataTable/HierarchicalExample.tsx +0 -475
  641. package/examples/components 2/Dialog/BasicHtmlTest.tsx +0 -55
  642. package/examples/components 2/Dialog/DebugHtmlExample.tsx +0 -68
  643. package/examples/components 2/Dialog/HtmlDialogExample.tsx +0 -202
  644. package/examples/components 2/Dialog/SimpleHtmlTest.tsx +0 -61
  645. package/examples/components 2/Dialog/SmartDialogExample.tsx +0 -322
  646. package/examples/components 2/index.ts +0 -11
  647. package/examples/features/index.ts +0 -12
  648. package/examples/features/rbac/CompleteRBACExample.tsx +0 -324
  649. package/examples/features/rbac/index.ts +0 -13
  650. package/examples/public-pages/CorrectPublicPageImplementation.tsx +0 -301
  651. package/examples/public-pages/PublicEventPage.tsx +0 -274
  652. package/examples/public-pages/PublicPageApp.tsx +0 -308
  653. package/examples/public-pages/PublicPageUsageExample.tsx +0 -216
  654. package/examples/public-pages/index.ts +0 -14
  655. package/src/__tests__/TEST_STANDARD.md +0 -1008
  656. package/src/components/Checkbox/__mocks__/Checkbox.tsx +0 -2
  657. package/src/components/DataTable/examples/HierarchicalActionsExample.tsx +0 -421
  658. package/src/components/DataTable/examples/InitialPageSizeExample.tsx +0 -177
  659. package/src/components/DataTable/examples/PerformanceExample.tsx +0 -506
  660. package/src/components/DataTable/examples/__tests__/HierarchicalActionsExample.test.tsx +0 -316
  661. package/src/components/DataTable/examples/__tests__/HierarchicalExample.test.tsx +0 -45
  662. package/src/components/DataTable/examples/__tests__/InitialPageSizeExample.test.tsx +0 -211
  663. package/src/components/DataTable/examples/__tests__/PerformanceExample.test.tsx +0 -126
  664. package/src/components/Dialog/README.md +0 -804
  665. package/src/components/Dialog/examples/BasicHtmlTest.tsx +0 -55
  666. package/src/components/Dialog/examples/DebugHtmlExample.tsx +0 -68
  667. package/src/components/Dialog/examples/ScrollableDialogExample.tsx +0 -290
  668. package/src/components/Dialog/examples/SimpleHtmlTest.tsx +0 -61
  669. package/src/components/Dialog/examples/__tests__/HtmlDialogExample.test.tsx +0 -71
  670. package/src/components/Dialog/examples/__tests__/SimpleHtmlTest.test.tsx +0 -122
  671. package/src/components/Dialog/examples/__tests__/SmartDialogExample.unit.test.tsx +0 -147
  672. package/src/components/Dialog/utils/__tests__/safeHtml.unit.test.ts +0 -611
  673. package/src/components/Dialog/utils/safeHtml.ts +0 -185
  674. package/src/components/EventSelector/types.ts +0 -79
  675. package/src/components/Form/FormErrorSummary.tsx +0 -113
  676. package/src/components/Form/FormField.tsx +0 -249
  677. package/src/components/Form/FormFieldset.tsx +0 -127
  678. package/src/components/Form/FormLiveRegion.tsx +0 -198
  679. package/src/components/Input/__mocks__/Input.tsx +0 -2
  680. package/src/components/NavigationMenu/types.ts +0 -85
  681. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.accessibility.test.tsx +0 -326
  682. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +0 -1078
  683. package/src/components/PasswordReset/PasswordResetForm.test.tsx +0 -597
  684. package/src/components/PasswordReset/PasswordResetForm.tsx +0 -201
  685. package/src/components/PasswordReset/index.ts +0 -2
  686. package/src/components/ProtectedRoute/README.md +0 -164
  687. package/src/components/PublicLayout/EventLogo.tsx +0 -175
  688. package/src/components/PublicLayout/PublicErrorBoundary.tsx +0 -282
  689. package/src/components/PublicLayout/PublicLoadingSpinner.tsx +0 -216
  690. package/src/components/PublicLayout/PublicPageContextChecker.tsx +0 -131
  691. package/src/components/PublicLayout/PublicPageDebugger.tsx +0 -104
  692. package/src/components/PublicLayout/PublicPageDiagnostic.tsx +0 -162
  693. package/src/components/PublicLayout/PublicPageFooter.tsx +0 -124
  694. package/src/components/PublicLayout/PublicPageHeader.tsx +0 -209
  695. package/src/components/PublicLayout/__tests__/PublicErrorBoundary.test.tsx +0 -449
  696. package/src/components/PublicLayout/__tests__/PublicLoadingSpinner.test.tsx +0 -393
  697. package/src/components/PublicLayout/__tests__/PublicPageContextChecker.test.tsx +0 -192
  698. package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +0 -351
  699. package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +0 -402
  700. package/src/components/PublicLayout/__tests__/PublicPageLayout.test.tsx +0 -460
  701. package/src/components/PublicLayout/__tests__/PublicPageProvider.test.tsx +0 -313
  702. package/src/components/Select/hooks.ts +0 -289
  703. package/src/hooks/useCounter.test.ts +0 -131
  704. package/src/hooks/useDebounce.test.ts +0 -375
  705. package/src/providers/AuthProvider.tsx +0 -15
  706. package/src/providers/EventProvider.tsx +0 -16
  707. package/src/providers/InactivityProvider.tsx +0 -15
  708. package/src/providers/OrganisationProvider.context.test.tsx +0 -169
  709. package/src/providers/UnifiedAuthProvider.tsx +0 -15
  710. package/src/types/theme.ts +0 -6
  711. package/src/types/unified.ts +0 -265
  712. package/src/utils/appConfig.ts +0 -47
  713. package/src/utils/appIdResolver.test.ts +0 -499
  714. package/src/utils/appIdResolver.ts +0 -130
  715. package/src/utils/appNameResolver.simple.test.ts +0 -212
  716. package/src/utils/appNameResolver.test.ts +0 -121
  717. package/src/utils/appNameResolver.ts +0 -191
  718. package/src/utils/audit.ts +0 -127
  719. package/src/utils/auth-utils.ts +0 -96
  720. package/src/utils/bundleAnalysis.ts +0 -129
  721. package/src/utils/debugLogger.ts +0 -67
  722. package/src/utils/deviceFingerprint.ts +0 -215
  723. package/src/utils/dynamicUtils.ts +0 -105
  724. package/src/utils/file-reference.test.ts +0 -788
  725. package/src/utils/file-reference.ts +0 -519
  726. package/src/utils/formatDate.test.ts +0 -237
  727. package/src/utils/formatting.ts +0 -170
  728. package/src/utils/lazyLoad.tsx +0 -44
  729. package/src/utils/logger.ts +0 -179
  730. package/src/utils/organisationContext.test.ts +0 -322
  731. package/src/utils/organisationContext.ts +0 -153
  732. package/src/utils/performanceBenchmark.ts +0 -64
  733. package/src/utils/performanceBudgets.ts +0 -110
  734. package/src/utils/permissionTypes.ts +0 -37
  735. package/src/utils/permissionUtils.test.ts +0 -393
  736. package/src/utils/permissionUtils.ts +0 -34
  737. package/src/utils/sanitization.ts +0 -264
  738. package/src/utils/schemaUtils.ts +0 -37
  739. package/src/utils/secureDataAccess.test.ts +0 -711
  740. package/src/utils/secureDataAccess.ts +0 -377
  741. package/src/utils/secureErrors.ts +0 -79
  742. package/src/utils/security.ts +0 -156
  743. package/src/utils/securityMonitor.ts +0 -45
  744. package/src/utils/sessionTracking.ts +0 -126
  745. package/src/utils/validation.ts +0 -111
  746. package/src/utils/validationUtils.ts +0 -120
  747. package/src/validation/index.ts +0 -12
  748. /package/dist/{DataTable-UA6CL4JI.js.map → DataTable-QAB34V6K.js.map} +0 -0
  749. /package/dist/{UnifiedAuthProvider-B37ATQHE.js.map → UnifiedAuthProvider-7F6T4B6K.js.map} +0 -0
  750. /package/dist/{api-45XYYO2A.js.map → api-ROMBCNKU.js.map} +0 -0
  751. /package/dist/{audit-64X3VJXB.js.map → audit-WRS3KJKI.js.map} +0 -0
  752. /package/dist/{chunk-PLDDJCW6.js.map → chunk-7D4SUZUM.js.map} +0 -0
  753. /package/dist/{useInactivityTracker-TO6ZOF35.js.map → chunk-KQCRWDSA.js.map} +0 -0
  754. /package/examples/{components 2/DataTable → DataTable}/InitialPageSizeExample.tsx +0 -0
  755. /package/examples/{features/public-pages → PublicPages}/index.ts +0 -0
  756. /package/examples/{RBAC → rbac}/index.ts +0 -0
@@ -25,95 +25,61 @@ import {
25
25
  SelectSeparator,
26
26
  SelectTrigger,
27
27
  SelectValue
28
- } from "./chunk-5MT24GKJ.js";
28
+ } from "./chunk-QUVSNGIP.js";
29
29
  import {
30
30
  useCan,
31
31
  usePermissions,
32
32
  useRBAC,
33
33
  useResolvedScope
34
- } from "./chunk-ZYTYSTO5.js";
34
+ } from "./chunk-RA3JUFMW.js";
35
35
  import {
36
36
  isSuperAdmin
37
- } from "./chunk-BVYWGZVV.js";
37
+ } from "./chunk-M7W4CP3M.js";
38
38
  import {
39
- OrganisationProvider_exports,
40
- PublicErrorBoundary,
39
+ ErrorBoundary,
41
40
  PublicPageContext,
42
41
  createFileReferenceService,
43
42
  getPublicUrl,
44
43
  getSignedUrl,
45
- init_OrganisationProvider,
46
44
  uploadFileWithReference,
47
45
  useAppConfig,
48
46
  useEventTheme,
49
47
  useFileDisplay,
50
48
  useIsPublicPage,
51
- usePublicFileDisplay,
52
- usePublicPageContext
53
- } from "./chunk-HZLDFOE4.js";
49
+ usePublicFileDisplay
50
+ } from "./chunk-MI7HBHN3.js";
54
51
  import {
55
52
  useToast
56
- } from "./chunk-BESYRHQM.js";
53
+ } from "./chunk-6C4YBBJM.js";
57
54
  import {
58
- init_useOrganisations,
59
55
  useEvents,
60
56
  useOrganisations
61
- } from "./chunk-LIMSTKYD.js";
62
- import {
63
- UnifiedAuthProvider_exports,
64
- init_UnifiedAuthProvider as init_UnifiedAuthProvider2
65
- } from "./chunk-EGI6MUL6.js";
57
+ } from "./chunk-QCDXODCA.js";
66
58
  import {
67
59
  EventServiceContext,
68
- EventServiceProvider,
69
- init_EventServiceProvider,
70
- init_UnifiedAuthProvider,
71
- init_useSessionRestoration,
72
- useEventService,
73
60
  useSessionRestoration,
74
61
  useUnifiedAuth
75
- } from "./chunk-3JI76CYK.js";
62
+ } from "./chunk-FUEYYMX5.js";
63
+ import {
64
+ assertAppId
65
+ } from "./chunk-QXHPKYJV.js";
76
66
  import {
77
67
  LoadingSpinner,
78
68
  getAppId
79
- } from "./chunk-S5OFRT4M.js";
80
- import {
81
- getCurrentAppName
82
- } from "./chunk-Q5QRDWKI.js";
83
- import {
84
- performanceBudgetMonitor
85
- } from "./chunk-FMUCXFII.js";
69
+ } from "./chunk-KUEN3HFB.js";
86
70
  import {
87
71
  cn
88
- } from "./chunk-56XJ3TU6.js";
72
+ } from "./chunk-R77UEZ4E.js";
73
+ import {
74
+ getCurrentAppName
75
+ } from "./chunk-F2IMUDXZ.js";
89
76
  import {
90
77
  clearPalette
91
- } from "./chunk-ERISIBYU.js";
78
+ } from "./chunk-SQGMNID3.js";
92
79
  import {
93
80
  createLogger,
94
- init_logger,
95
81
  logger
96
- } from "./chunk-XDNLUEXI.js";
97
- import {
98
- __esm,
99
- __export,
100
- __toCommonJS
101
- } from "./chunk-PLDDJCW6.js";
102
-
103
- // src/providers/EventProvider.tsx
104
- var EventProvider_exports = {};
105
- __export(EventProvider_exports, {
106
- EventProvider: () => EventServiceProvider,
107
- EventServiceContext: () => EventServiceContext,
108
- useEventService: () => useEventService
109
- });
110
- var init_EventProvider = __esm({
111
- "src/providers/EventProvider.tsx"() {
112
- "use strict";
113
- init_EventServiceProvider();
114
- init_EventServiceProvider();
115
- }
116
- });
82
+ } from "./chunk-PWLANIRT.js";
117
83
 
118
84
  // src/components/Label/Label.tsx
119
85
  import * as React from "react";
@@ -152,7 +118,7 @@ var Label = React.forwardRef(({
152
118
  children: [
153
119
  children,
154
120
  required && /* @__PURE__ */ jsx(
155
- "label",
121
+ "span",
156
122
  {
157
123
  "aria-label": "required",
158
124
  className: cn(
@@ -291,7 +257,8 @@ function buildVariantClasses(style, color, shade) {
291
257
  `shadow-${color}-${cfg.bg}`,
292
258
  `text-${color}-${cfg.text}`,
293
259
  "my-1",
294
- "mx-1",
260
+ "ml-1",
261
+ "mr-2",
295
262
  "py-0",
296
263
  "px-2"
297
264
  );
@@ -312,7 +279,7 @@ function generateVariantClasses() {
312
279
  }
313
280
  var variantClassesMap = generateVariantClasses();
314
281
  function getBadgeClasses(variant = "solid-main-normal") {
315
- const baseClasses = "inline-flex text-balance items-center rounded-2xl px-3 py-1 text-xs font-medium transition-colors box-border";
282
+ const baseClasses = "text-balance rounded-2xl px-3 py-1 mr-1 text-xs font-medium transition-colors box-border";
316
283
  return `${baseClasses} ${variantClassesMap[variant]}`;
317
284
  }
318
285
  var Badge = React4.forwardRef(
@@ -396,45 +363,50 @@ Switch.displayName = SwitchPrimitive.Root.displayName;
396
363
  import * as React6 from "react";
397
364
  import * as TabsPrimitive from "@radix-ui/react-tabs";
398
365
  import { jsx as jsx6 } from "react/jsx-runtime";
399
- var Tabs = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(TabsPrimitive.Root, { ref, ...props }));
366
+ var Tabs = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx6(TabsPrimitive.Root, { asChild: true, ...props, children: /* @__PURE__ */ jsx6("section", { ref, className, children }) }));
400
367
  Tabs.displayName = TabsPrimitive.Root.displayName || "Tabs";
401
- var TabsList = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
402
- TabsPrimitive.List,
368
+ var TabsList = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx6(TabsPrimitive.List, { asChild: true, ...props, children: /* @__PURE__ */ jsx6(
369
+ "nav",
403
370
  {
404
371
  ref,
405
372
  className: cn(
406
- "inline-flex h-10 items-center justify-center rounded-md bg-sec-100 p-1 text-sec-600",
373
+ "mb-0",
407
374
  className
408
375
  ),
409
- ...props
376
+ children
410
377
  }
411
- ));
378
+ ) }));
412
379
  TabsList.displayName = TabsPrimitive.List.displayName || "TabsList";
413
- var TabsTrigger = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
414
- TabsPrimitive.Trigger,
415
- {
416
- ref,
417
- className: cn(
418
- "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-main-600 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
419
- "data-[state=active]:bg-background data-[state=active]:text-main-600 data-[state=active]:shadow-sm",
420
- "data-[state=inactive]:text-sec-600 data-[state=inactive]:hover:text-main-600",
421
- className
422
- ),
423
- ...props
424
- }
425
- ));
380
+ var TabsTrigger = React6.forwardRef(({ className, variant, size, children, ...props }, ref) => {
381
+ return /* @__PURE__ */ jsx6(TabsPrimitive.Trigger, { asChild: true, ...props, children: /* @__PURE__ */ jsx6(
382
+ Button,
383
+ {
384
+ ref,
385
+ variant,
386
+ size,
387
+ className: cn(
388
+ "rounded-b-none",
389
+ "data-[state=active]:bg-main-50 data-[state=active]:text-main-950 data-[state=active]:border-t-1 data-[state=active]:border-x-1 data-[state=active]:shadow-md",
390
+ "data-[state=inactive]:bg-main-300 data-[state=inactive]:text-main-800 ",
391
+ "data-[state=inactive]:hover:bg-acc-400",
392
+ className
393
+ ),
394
+ children
395
+ }
396
+ ) });
397
+ });
426
398
  TabsTrigger.displayName = TabsPrimitive.Trigger.displayName || "TabsTrigger";
427
- var TabsContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
428
- TabsPrimitive.Content,
399
+ var TabsContent = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx6(TabsPrimitive.Content, { asChild: true, ...props, children: /* @__PURE__ */ jsx6(
400
+ "aside",
429
401
  {
430
402
  ref,
431
403
  className: cn(
432
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-main-600 focus-visible:ring-offset-2",
404
+ "focus-visible:outline-none focus-visible:bg-main-300",
433
405
  className
434
406
  ),
435
- ...props
407
+ children
436
408
  }
437
- ));
409
+ ) }));
438
410
  TabsContent.displayName = TabsPrimitive.Content.displayName || "TabsContent";
439
411
 
440
412
  // src/components/Calendar/Calendar.tsx
@@ -442,11 +414,45 @@ import * as React7 from "react";
442
414
  import { DayPicker } from "react-day-picker";
443
415
  import { jsx as jsx7 } from "react/jsx-runtime";
444
416
  var Calendar = React7.forwardRef(
445
- ({ className, classNames, mode, ...props }, ref) => {
417
+ ({ className, classNames, mode, components, ...props }, ref) => {
418
+ const defaultComponents = {
419
+ IconLeft: ({ ...iconProps }) => /* @__PURE__ */ jsx7(
420
+ "svg",
421
+ {
422
+ xmlns: "http://www.w3.org/2000/svg",
423
+ viewBox: "0 0 24 24",
424
+ fill: "none",
425
+ stroke: "currentColor",
426
+ strokeWidth: "2",
427
+ strokeLinecap: "round",
428
+ strokeLinejoin: "round",
429
+ className: "h-4 w-4",
430
+ ...iconProps,
431
+ children: /* @__PURE__ */ jsx7("path", { d: "m15 18-6-6 6-6" })
432
+ }
433
+ ),
434
+ IconRight: ({ ...iconProps }) => /* @__PURE__ */ jsx7(
435
+ "svg",
436
+ {
437
+ xmlns: "http://www.w3.org/2000/svg",
438
+ viewBox: "0 0 24 24",
439
+ fill: "none",
440
+ stroke: "currentColor",
441
+ strokeWidth: "2",
442
+ strokeLinecap: "round",
443
+ strokeLinejoin: "round",
444
+ className: "h-4 w-4",
445
+ ...iconProps,
446
+ children: /* @__PURE__ */ jsx7("path", { d: "m9 18 6-6-6-6" })
447
+ }
448
+ ),
449
+ ...components
450
+ };
446
451
  return /* @__PURE__ */ jsx7("div", { ref, className: cn("p-3", className), children: /* @__PURE__ */ jsx7(
447
452
  DayPicker,
448
453
  {
449
- mode,
454
+ ...mode ? { mode } : {},
455
+ ...props,
450
456
  className: "rounded-md border border-sec-200 bg-background",
451
457
  classNames: {
452
458
  months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
@@ -482,40 +488,7 @@ var Calendar = React7.forwardRef(
482
488
  day_hidden: "invisible",
483
489
  ...classNames
484
490
  },
485
- components: {
486
- IconLeft: ({ ...props2 }) => /* @__PURE__ */ jsx7(
487
- "svg",
488
- {
489
- xmlns: "http://www.w3.org/2000/svg",
490
- viewBox: "0 0 24 24",
491
- fill: "none",
492
- stroke: "currentColor",
493
- strokeWidth: "2",
494
- strokeLinecap: "round",
495
- strokeLinejoin: "round",
496
- className: "h-4 w-4",
497
- ...props2,
498
- children: /* @__PURE__ */ jsx7("path", { d: "m15 18-6-6 6-6" })
499
- }
500
- ),
501
- IconRight: ({ ...props2 }) => /* @__PURE__ */ jsx7(
502
- "svg",
503
- {
504
- xmlns: "http://www.w3.org/2000/svg",
505
- viewBox: "0 0 24 24",
506
- fill: "none",
507
- stroke: "currentColor",
508
- strokeWidth: "2",
509
- strokeLinecap: "round",
510
- strokeLinejoin: "round",
511
- className: "h-4 w-4",
512
- ...props2,
513
- children: /* @__PURE__ */ jsx7("path", { d: "m9 18 6-6-6-6" })
514
- }
515
- ),
516
- ...props.components
517
- },
518
- ...props
491
+ components: defaultComponents
519
492
  }
520
493
  ) });
521
494
  }
@@ -621,9 +594,9 @@ function Toaster() {
621
594
  }
622
595
 
623
596
  // src/components/Form/Form.tsx
624
- import { useForm, FormProvider } from "react-hook-form";
597
+ import { useForm, FormProvider, useFormContext, Controller } from "react-hook-form";
625
598
  import { zodResolver } from "@hookform/resolvers/zod";
626
- import { jsx as jsx9 } from "react/jsx-runtime";
599
+ import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
627
600
  function Form({
628
601
  schema,
629
602
  defaultValues,
@@ -641,10 +614,60 @@ function Form({
641
614
  const handleSubmit = methods.handleSubmit(onSubmit, onError);
642
615
  return /* @__PURE__ */ jsx9(FormProvider, { ...methods, children: /* @__PURE__ */ jsx9("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: typeof children === "function" ? children(methods) : children }) });
643
616
  }
617
+ function FormField({
618
+ name,
619
+ label,
620
+ type = "text",
621
+ placeholder,
622
+ inputProps,
623
+ validation,
624
+ render,
625
+ "data-testid": testId,
626
+ className
627
+ }) {
628
+ const { control, formState: { errors } } = useFormContext();
629
+ const fieldError = errors[name];
630
+ const errorMessage = fieldError && typeof fieldError === "object" && "message" in fieldError ? String(fieldError.message) : void 0;
631
+ return /* @__PURE__ */ jsxs3("div", { className: cn("space-y-2", className), children: [
632
+ label && /* @__PURE__ */ jsxs3(Label, { htmlFor: name, children: [
633
+ label,
634
+ validation?.required && /* @__PURE__ */ jsx9("span", { className: "text-destructive ml-1", "aria-label": "required", children: "*" })
635
+ ] }),
636
+ /* @__PURE__ */ jsx9(
637
+ Controller,
638
+ {
639
+ name,
640
+ control,
641
+ rules: validation,
642
+ render: (props) => {
643
+ if (render) {
644
+ return render(props);
645
+ }
646
+ return /* @__PURE__ */ jsx9(
647
+ "input",
648
+ {
649
+ ...props.field,
650
+ id: name,
651
+ type,
652
+ placeholder,
653
+ "data-testid": testId,
654
+ className: cn(
655
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
656
+ fieldError && "border-destructive focus-visible:ring-destructive"
657
+ ),
658
+ ...inputProps
659
+ }
660
+ );
661
+ }
662
+ }
663
+ ),
664
+ errorMessage && /* @__PURE__ */ jsx9("p", { className: "text-destructive", role: "alert", children: errorMessage })
665
+ ] });
666
+ }
644
667
 
645
668
  // src/components/LoginForm/LoginForm.tsx
646
669
  import React9, { useState, useCallback, useMemo } from "react";
647
- import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
670
+ import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
648
671
  var LoginForm = React9.memo(({
649
672
  onSignIn,
650
673
  onSuccess,
@@ -686,13 +709,13 @@ var LoginForm = React9.memo(({
686
709
  }, [onSignUp]);
687
710
  const displayTitle = useMemo(() => title || (appName ? `Sign in to ${appName}` : "Sign In"), [title, appName]);
688
711
  const displaySubtitle = useMemo(() => subtitle || "Enter your credentials to continue.", [subtitle]);
689
- return /* @__PURE__ */ jsx10(Card, { className: cn("w-full max-w-md mx-auto", className), children: /* @__PURE__ */ jsxs3("form", { onSubmit: handleSubmit, "data-testid": "login-form", children: [
690
- /* @__PURE__ */ jsxs3(CardHeader, { className: "space-y-1", children: [
712
+ return /* @__PURE__ */ jsx10(Card, { className: cn("w-full max-w-md mx-auto", className), children: /* @__PURE__ */ jsxs4("form", { onSubmit: handleSubmit, "data-testid": "login-form", children: [
713
+ /* @__PURE__ */ jsxs4(CardHeader, { className: "space-y-1", children: [
691
714
  /* @__PURE__ */ jsx10(CardTitle, { className: "text-2xl text-center", children: displayTitle }),
692
715
  /* @__PURE__ */ jsx10(CardDescription, { className: "text-center", children: displaySubtitle })
693
716
  ] }),
694
- /* @__PURE__ */ jsxs3(CardContent, { className: "space-y-4", children: [
695
- error && /* @__PURE__ */ jsx10(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx10(AlertDescription, { children: error }) }),
717
+ /* @__PURE__ */ jsxs4(CardContent, { className: "space-y-4", children: [
718
+ error && /* @__PURE__ */ jsx10(Alert, { variant: "destructive", role: "alert", "aria-live": "assertive", children: /* @__PURE__ */ jsx10(AlertDescription, { children: error }) }),
696
719
  /* @__PURE__ */ jsx10(Label, { htmlFor: "email", children: "Email" }),
697
720
  /* @__PURE__ */ jsx10(
698
721
  Input,
@@ -720,7 +743,7 @@ var LoginForm = React9.memo(({
720
743
  }
721
744
  )
722
745
  ] }),
723
- /* @__PURE__ */ jsxs3(CardFooter, { className: "flex flex-col space-y-4", children: [
746
+ /* @__PURE__ */ jsxs4(CardFooter, { className: "flex flex-col space-y-4", children: [
724
747
  /* @__PURE__ */ jsx10(
725
748
  Button,
726
749
  {
@@ -738,7 +761,7 @@ var LoginForm = React9.memo(({
738
761
  className: "text-primary hover:underline",
739
762
  children: "Don't have an account? Sign up"
740
763
  }
741
- ) }) : /* @__PURE__ */ jsxs3("p", { className: "text-center text-muted-foreground", children: [
764
+ ) }) : /* @__PURE__ */ jsxs4("p", { className: "text-center text-muted-foreground", children: [
742
765
  "Don't have an account?",
743
766
  " ",
744
767
  /* @__PURE__ */ jsx10("a", { href: "/signup", className: "text-primary hover:underline", children: "Sign up" })
@@ -749,9 +772,8 @@ var LoginForm = React9.memo(({
749
772
 
750
773
  // src/components/EventSelector/EventSelector.tsx
751
774
  import { RefreshCw, AlertCircle, Lock, Calendar as Calendar2, Star } from "lucide-react";
752
- init_logger();
753
- import { useEffect, useMemo as useMemo2 } from "react";
754
- import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
775
+ import { useEffect, useMemo as useMemo2, useRef } from "react";
776
+ import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
755
777
  function EventSelector({
756
778
  placeholder = "Select an event",
757
779
  className,
@@ -769,13 +791,6 @@ function EventSelector({
769
791
  setSelectedEvent,
770
792
  refreshEvents
771
793
  } = useEvents();
772
- logger.debug("EventSelector", "Component render:", {
773
- eventsCount: events.length,
774
- events: events.map((e) => ({ id: e.event_id, name: e.event_name })),
775
- selectedEvent: selectedEvent ? { id: selectedEvent.event_id, name: selectedEvent.event_name } : null,
776
- isLoading,
777
- error: error?.message
778
- });
779
794
  const handleValueChange = (eventId) => {
780
795
  const event = events.find((e) => (e.event_id || e.id) === eventId);
781
796
  if (event) {
@@ -820,8 +835,26 @@ function EventSelector({
820
835
  const getTime = (e) => e.event_date ? new Date(e.event_date).getTime() : Number.NEGATIVE_INFINITY;
821
836
  return [...events].sort((a, b) => getTime(b) - getTime(a));
822
837
  }, [events]);
838
+ const prevEventsLengthRef = useRef(events.length);
839
+ const prevSelectedEventIdRef = useRef(selectedEvent?.event_id);
840
+ const hasAutoSelectedRef = useRef(false);
823
841
  useEffect(() => {
824
- if (!selectedEvent && events.length > 0 && !isLoading) {
842
+ const eventsLengthChanged = events.length !== prevEventsLengthRef.current;
843
+ const selectedEventChanged = selectedEvent?.event_id !== prevSelectedEventIdRef.current;
844
+ if (eventsLengthChanged) {
845
+ prevEventsLengthRef.current = events.length;
846
+ if (events.length > 0) {
847
+ hasAutoSelectedRef.current = false;
848
+ }
849
+ }
850
+ if (selectedEventChanged) {
851
+ prevSelectedEventIdRef.current = selectedEvent?.event_id;
852
+ if (selectedEvent) {
853
+ hasAutoSelectedRef.current = false;
854
+ }
855
+ }
856
+ if (!selectedEvent && events.length > 0 && !isLoading && eventsLengthChanged && !hasAutoSelectedRef.current) {
857
+ hasAutoSelectedRef.current = true;
825
858
  autoSelectEvent();
826
859
  }
827
860
  function autoSelectEvent() {
@@ -844,19 +877,19 @@ function EventSelector({
844
877
  }
845
878
  }
846
879
  }
847
- }, [events, selectedEvent, setSelectedEvent, onEventChange, isLoading]);
880
+ }, [events.length, selectedEvent?.event_id, isLoading, setSelectedEvent, onEventChange]);
848
881
  if (isLoading) {
849
- return /* @__PURE__ */ jsxs4("div", { className: `flex items-center gap-2 ${className}`, children: [
882
+ return /* @__PURE__ */ jsxs5("div", { className: `flex items-center gap-2 ${className}`, children: [
850
883
  /* @__PURE__ */ jsx11(LoadingSpinner, { size: "sm" }),
851
884
  /* @__PURE__ */ jsx11("span", { className: "text-sm text-muted-foreground", children: "Loading events..." })
852
885
  ] });
853
886
  }
854
887
  if (error) {
855
- return /* @__PURE__ */ jsx11("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "destructive", children: [
888
+ return /* @__PURE__ */ jsx11("div", { className, children: /* @__PURE__ */ jsxs5(Alert, { variant: "destructive", children: [
856
889
  /* @__PURE__ */ jsx11(Lock, { className: "h-4 w-4" }),
857
- /* @__PURE__ */ jsxs4(AlertDescription, { className: "flex items-center justify-between", children: [
890
+ /* @__PURE__ */ jsxs5(AlertDescription, { className: "flex items-center justify-between", children: [
858
891
  /* @__PURE__ */ jsx11("span", { children: error.message }),
859
- showRetryButton && /* @__PURE__ */ jsxs4(
892
+ showRetryButton && /* @__PURE__ */ jsxs5(
860
893
  Button,
861
894
  {
862
895
  variant: "outline",
@@ -874,11 +907,11 @@ function EventSelector({
874
907
  }
875
908
  if (events.length === 0) {
876
909
  if (showNoEventsMessage) {
877
- return /* @__PURE__ */ jsx11("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "inline", children: [
910
+ return /* @__PURE__ */ jsx11("div", { className, children: /* @__PURE__ */ jsxs5(Alert, { variant: "inline", children: [
878
911
  /* @__PURE__ */ jsx11(AlertCircle, { className: "h-4 w-4 text-acc-700" }),
879
- /* @__PURE__ */ jsxs4(AlertDescription, { className: "flex items-center justify-between", children: [
912
+ /* @__PURE__ */ jsxs5(AlertDescription, { className: "flex items-center justify-between", children: [
880
913
  /* @__PURE__ */ jsx11("span", { children: "No events available." }),
881
- showRetryButton && /* @__PURE__ */ jsxs4(
914
+ showRetryButton && /* @__PURE__ */ jsxs5(
882
915
  Button,
883
916
  {
884
917
  variant: "outline",
@@ -896,17 +929,17 @@ function EventSelector({
896
929
  }
897
930
  return null;
898
931
  }
899
- return /* @__PURE__ */ jsxs4(
932
+ return /* @__PURE__ */ jsxs5(
900
933
  Select,
901
934
  {
902
935
  value: selectedEvent ? selectedEvent.event_id || selectedEvent.id : "",
903
936
  onValueChange: handleValueChange,
904
937
  className,
905
938
  children: [
906
- /* @__PURE__ */ jsx11(SelectTrigger, { className: "text-left", variant: "outline", children: /* @__PURE__ */ jsx11(SelectValue, { placeholder, children: selectedEvent && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
939
+ /* @__PURE__ */ jsx11(SelectTrigger, { className: "text-left", variant: "outline", children: /* @__PURE__ */ jsx11(SelectValue, { placeholder, children: selectedEvent && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
907
940
  /* @__PURE__ */ jsx11(Calendar2, { className: "h-4 w-4 flex-shrink-0" }),
908
- /* @__PURE__ */ jsx11("span", { className: "truncate", children: selectedEvent.event_name || selectedEvent.name }),
909
- selectedEvent.event_date && /* @__PURE__ */ jsxs4("span", { className: "text-xs text-muted-foreground flex-shrink-0", children: [
941
+ /* @__PURE__ */ jsx11("span", { className: "truncate", children: selectedEvent.event_name }),
942
+ selectedEvent.event_date && /* @__PURE__ */ jsxs5("span", { className: "text-xs text-muted-foreground flex-shrink-0", children: [
910
943
  "(",
911
944
  formatEventDate(selectedEvent.event_date),
912
945
  ")"
@@ -920,19 +953,19 @@ function EventSelector({
920
953
  {
921
954
  value: event.event_id || event.id,
922
955
  className: "flex items-center justify-between",
923
- children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 w-full", children: [
956
+ children: /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 w-full", children: [
924
957
  showNextEventIndicator && isNext && /* @__PURE__ */ jsx11(Star, { className: "h-3 w-3 text-acc-500" }),
925
- /* @__PURE__ */ jsxs4("div", { className: "flex-1", children: [
926
- /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
927
- /* @__PURE__ */ jsx11("span", { className: isSelected ? "font-semibold" : "", children: event.event_name || event.name }),
958
+ /* @__PURE__ */ jsxs5("div", { className: "flex-1", children: [
959
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
960
+ /* @__PURE__ */ jsx11("span", { className: isSelected ? "font-semibold" : "", children: event.event_name }),
928
961
  isSelected && /* @__PURE__ */ jsx11("span", { className: "text-xs bg-primary text-primary-foreground px-1 rounded", children: "Current" })
929
962
  ] }),
930
- showEventDetails && event.event_date && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
963
+ showEventDetails && event.event_date && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
931
964
  /* @__PURE__ */ jsx11(Calendar2, { className: "h-3 w-3" }),
932
965
  /* @__PURE__ */ jsx11("span", { children: formatEventDate(event.event_date) }),
933
966
  showNextEventIndicator && isNext && /* @__PURE__ */ jsx11("span", { className: "text-acc-600 font-medium", children: "(Next)" })
934
967
  ] }),
935
- showEventDetails && event.event_venue && /* @__PURE__ */ jsxs4("div", { className: "text-xs text-muted-foreground", children: [
968
+ showEventDetails && event.event_venue && /* @__PURE__ */ jsxs5("div", { className: "text-xs text-muted-foreground", children: [
936
969
  "\u{1F4CD} ",
937
970
  event.event_venue
938
971
  ] })
@@ -947,9 +980,9 @@ function EventSelector({
947
980
  );
948
981
  }
949
982
 
950
- // src/components/PasswordReset/PasswordChangeForm.tsx
983
+ // src/components/PasswordChange/PasswordChangeForm.tsx
951
984
  import { useState as useState2 } from "react";
952
- import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
985
+ import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
953
986
  function PasswordChangeForm({ onSubmit, className }) {
954
987
  const [newPassword, setNewPassword] = useState2("");
955
988
  const [confirmPassword, setConfirmPassword] = useState2("");
@@ -973,14 +1006,15 @@ function PasswordChangeForm({ onSubmit, className }) {
973
1006
  setError(result.error.message || "Failed to change password.");
974
1007
  }
975
1008
  } catch (err) {
976
- setError(err?.message || "An unexpected error occurred.");
1009
+ const errorObj = err instanceof Error ? err : new Error("An unexpected error occurred");
1010
+ setError(errorObj.message);
977
1011
  } finally {
978
1012
  setIsSubmitting(false);
979
1013
  }
980
1014
  };
981
- return /* @__PURE__ */ jsxs5("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: [
1015
+ return /* @__PURE__ */ jsxs6("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: [
982
1016
  error && /* @__PURE__ */ jsx12("div", { role: "alert", children: error }),
983
- /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
1017
+ /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
984
1018
  /* @__PURE__ */ jsx12(Label, { htmlFor: "new-password", children: "New Password" }),
985
1019
  /* @__PURE__ */ jsx12(
986
1020
  Input,
@@ -994,7 +1028,7 @@ function PasswordChangeForm({ onSubmit, className }) {
994
1028
  }
995
1029
  )
996
1030
  ] }),
997
- /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
1031
+ /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
998
1032
  /* @__PURE__ */ jsx12(Label, { htmlFor: "confirm-password", children: "Confirm Password" }),
999
1033
  /* @__PURE__ */ jsx12(
1000
1034
  Input,
@@ -1023,7 +1057,7 @@ function PasswordChangeForm({ onSubmit, className }) {
1023
1057
  // src/components/UserMenu/UserMenu.tsx
1024
1058
  import React11, { useCallback as useCallback2, useMemo as useMemo3, useState as useState3 } from "react";
1025
1059
  import { ChevronDown, LogOut, KeyRound } from "lucide-react";
1026
- import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
1060
+ import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
1027
1061
  var UserMenu = React11.memo(function UserMenu2({
1028
1062
  user,
1029
1063
  onSignOut,
@@ -1047,34 +1081,34 @@ var UserMenu = React11.memo(function UserMenu2({
1047
1081
  if (!user || !userInfo) {
1048
1082
  return null;
1049
1083
  }
1050
- return /* @__PURE__ */ jsxs6(Dialog, { open: isPasswordDialogOpen, onOpenChange: setPasswordDialogOpen, children: [
1051
- /* @__PURE__ */ jsxs6(Select, { className, children: [
1052
- /* @__PURE__ */ jsx13(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(Button, { variant: "outline", className: "flex items-center gap-2", "aria-label": userInfo.displayName, children: [
1053
- showAvatar && /* @__PURE__ */ jsxs6(Avatar, { className: "size-7", children: [
1084
+ return /* @__PURE__ */ jsxs7(Dialog, { open: isPasswordDialogOpen, onOpenChange: setPasswordDialogOpen, children: [
1085
+ /* @__PURE__ */ jsxs7(Select, { className, children: [
1086
+ /* @__PURE__ */ jsx13(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs7(Button, { variant: "outline", className: "flex items-center gap-2", "aria-label": userInfo.displayName, children: [
1087
+ showAvatar && /* @__PURE__ */ jsxs7(Avatar, { className: "size-7", children: [
1054
1088
  /* @__PURE__ */ jsx13(AvatarImage, { src: userInfo.avatarUrl, alt: userInfo.displayName }),
1055
1089
  /* @__PURE__ */ jsx13(AvatarFallback, { children: userInfo.initial })
1056
1090
  ] }),
1057
1091
  /* @__PURE__ */ jsx13("span", { children: userInfo.displayName }),
1058
1092
  /* @__PURE__ */ jsx13(ChevronDown, { className: "h-4 w-4" })
1059
1093
  ] }) }),
1060
- /* @__PURE__ */ jsxs6(SelectContent, { children: [
1061
- /* @__PURE__ */ jsx13(SelectLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col space-y-1", children: [
1094
+ /* @__PURE__ */ jsxs7(SelectContent, { children: [
1095
+ /* @__PURE__ */ jsx13(SelectLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs7("div", { className: "flex flex-col space-y-1", children: [
1062
1096
  /* @__PURE__ */ jsx13("p", { className: "font-medium", children: userInfo.displayName }),
1063
1097
  /* @__PURE__ */ jsx13("p", { className: "text-muted-foreground", children: userInfo.email })
1064
1098
  ] }) }),
1065
1099
  /* @__PURE__ */ jsx13(SelectSeparator, {}),
1066
- /* @__PURE__ */ jsx13(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(SelectItem, { value: "change-password", children: [
1100
+ /* @__PURE__ */ jsx13(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs7(SelectItem, { value: "change-password", children: [
1067
1101
  /* @__PURE__ */ jsx13(KeyRound, { className: "mr-2 h-4 w-4" }),
1068
1102
  /* @__PURE__ */ jsx13("span", { children: "Change Password" })
1069
1103
  ] }) }),
1070
- /* @__PURE__ */ jsxs6(SelectItem, { value: "sign-out", onClick: handleSignOut, children: [
1104
+ /* @__PURE__ */ jsxs7(SelectItem, { value: "sign-out", onClick: handleSignOut, children: [
1071
1105
  /* @__PURE__ */ jsx13(LogOut, { className: "mr-2 h-4 w-4" }),
1072
1106
  /* @__PURE__ */ jsx13("span", { children: "Sign out" })
1073
1107
  ] })
1074
1108
  ] })
1075
1109
  ] }),
1076
1110
  /* @__PURE__ */ jsx13(DialogOverlay, {}),
1077
- /* @__PURE__ */ jsxs6(DialogContent, { className, children: [
1111
+ /* @__PURE__ */ jsxs7(DialogContent, { className, children: [
1078
1112
  /* @__PURE__ */ jsx13(DialogHeader, { children: /* @__PURE__ */ jsx13(DialogTitle, { children: "Change Password" }) }),
1079
1113
  /* @__PURE__ */ jsx13(
1080
1114
  PasswordChangeForm,
@@ -1095,8 +1129,8 @@ var UserMenu = React11.memo(function UserMenu2({
1095
1129
  ] });
1096
1130
  });
1097
1131
  var UserMenuLoading = React11.memo(function UserMenuLoading2() {
1098
- return /* @__PURE__ */ jsxs6("div", { className: "relative inline-block text-left", children: [
1099
- /* @__PURE__ */ jsxs6(
1132
+ return /* @__PURE__ */ jsxs7("div", { className: "relative inline-block text-left", children: [
1133
+ /* @__PURE__ */ jsxs7(
1100
1134
  "button",
1101
1135
  {
1102
1136
  type: "button",
@@ -1117,9 +1151,7 @@ UserMenu.Loading = UserMenuLoading;
1117
1151
  // src/components/NavigationMenu/NavigationMenu.tsx
1118
1152
  import * as React12 from "react";
1119
1153
  import { ChevronDown as ChevronDown2 } from "lucide-react";
1120
- init_UnifiedAuthProvider2();
1121
- init_logger();
1122
- import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
1154
+ import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
1123
1155
  var NavigationMenu = React12.forwardRef(({
1124
1156
  items,
1125
1157
  mode = "dropdown",
@@ -1135,7 +1167,7 @@ var NavigationMenu = React12.forwardRef(({
1135
1167
  auditLog = true,
1136
1168
  onNavigationAccessDenied,
1137
1169
  onStrictModeViolation,
1138
- filterByPermissions = true,
1170
+ itemsPreFiltered = false,
1139
1171
  ...props
1140
1172
  }, ref) => {
1141
1173
  const [expandedItems, setExpandedItems] = React12.useState(/* @__PURE__ */ new Set());
@@ -1159,9 +1191,10 @@ var NavigationMenu = React12.forwardRef(({
1159
1191
  const { supabase } = authContext || {};
1160
1192
  const { selectedOrganisation } = authContext || {};
1161
1193
  const { resolvedScope, isLoading: scopeLoading, error: scopeError } = useResolvedScope({
1162
- supabase: filterByPermissions ? supabase || null : null,
1163
- selectedOrganisationId: filterByPermissions ? selectedOrganisation?.id || null : null,
1164
- selectedEventId: filterByPermissions ? selectedEvent?.event_id || null : null
1194
+ supabase: itemsPreFiltered ? null : supabase || null,
1195
+ // Skip expensive resolution if pre-filtered
1196
+ selectedOrganisationId: itemsPreFiltered ? null : selectedOrganisation?.id || null,
1197
+ selectedEventId: itemsPreFiltered ? null : selectedEvent?.event_id || null
1165
1198
  });
1166
1199
  const [resolvedAppId, setResolvedAppId] = React12.useState(void 0);
1167
1200
  React12.useEffect(() => {
@@ -1171,7 +1204,7 @@ var NavigationMenu = React12.forwardRef(({
1171
1204
  }
1172
1205
  const userId2 = authContext.user.id;
1173
1206
  const appName = authContext.appName;
1174
- import("./api-45XYYO2A.js").then(({ resolveAppContext }) => {
1207
+ import("./api-ROMBCNKU.js").then(({ resolveAppContext }) => {
1175
1208
  resolveAppContext({
1176
1209
  userId: userId2,
1177
1210
  appName
@@ -1186,9 +1219,10 @@ var NavigationMenu = React12.forwardRef(({
1186
1219
  }
1187
1220
  }, [scopeLoading, resolvedScope?.appId, selectedOrganisation?.id, authContext?.appName, authContext?.user?.id, resolvedAppId]);
1188
1221
  const effectiveScope = React12.useMemo(() => {
1189
- if (!scopeLoading && resolvedScope?.organisationId) {
1222
+ if (resolvedScope?.organisationId) {
1190
1223
  return resolvedScope;
1191
- } else if (!scopeLoading && selectedOrganisation?.id) {
1224
+ }
1225
+ if (selectedOrganisation?.id) {
1192
1226
  const fallbackScope = {
1193
1227
  organisationId: selectedOrganisation.id,
1194
1228
  eventId: selectedEvent?.event_id || void 0,
@@ -1197,7 +1231,7 @@ var NavigationMenu = React12.forwardRef(({
1197
1231
  return fallbackScope;
1198
1232
  }
1199
1233
  return null;
1200
- }, [scopeLoading, resolvedScope, selectedOrganisation?.id, selectedEvent?.event_id, resolvedAppId]);
1234
+ }, [resolvedScope, selectedOrganisation?.id, selectedEvent?.event_id, resolvedAppId]);
1201
1235
  const scopeKey = effectiveScope ? `${effectiveScope.organisationId || ""}-${effectiveScope.eventId || ""}-${effectiveScope.appId || ""}` : "empty";
1202
1236
  const stableScope = React12.useMemo(() => {
1203
1237
  if (effectiveScope?.organisationId) {
@@ -1215,37 +1249,63 @@ var NavigationMenu = React12.forwardRef(({
1215
1249
  }, [scopeKey, effectiveScope]);
1216
1250
  const userId = authContext?.user?.id || "";
1217
1251
  const { permissions: permissionMap, hasAnyPermission, isLoading: permissionsLoading, error: permissionsError } = usePermissions(
1218
- userId,
1219
- stableScope.organisationId,
1220
- stableScope.eventId,
1221
- stableScope.appId
1252
+ itemsPreFiltered ? null : userId,
1253
+ // Pass null to trigger early return (empty string would wait 3s)
1254
+ itemsPreFiltered ? void 0 : stableScope.organisationId,
1255
+ // Pass undefined to skip timeout
1256
+ itemsPreFiltered ? void 0 : stableScope.eventId,
1257
+ // Skip if pre-filtered
1258
+ itemsPreFiltered ? void 0 : stableScope.appId
1259
+ // Skip if pre-filtered
1222
1260
  );
1223
1261
  const previousFilteredItemsRef = React12.useRef([]);
1224
1262
  const filteredItems = React12.useMemo(() => {
1225
- if (filterByPermissions) {
1226
- const isOrgContextReady = orgContextReady && selectedOrganisation?.id;
1227
- const isEventContextReady = eventLoadingRaw === void 0 ? true : !eventLoading;
1228
- const hasValidContext = isOrgContextReady && isEventContextReady;
1229
- const shouldWaitForScope = scopeLoading || !hasValidContext;
1230
- const shouldRetryAfterError = scopeError && hasValidContext && !scopeLoading;
1231
- if (!authContext || !rbacContext || shouldWaitForScope && !shouldRetryAfterError) {
1232
- return [];
1263
+ if (itemsPreFiltered && items && items.length > 0) {
1264
+ const visibleItems = (items || []).filter((item) => !item.meta?.hidden);
1265
+ previousFilteredItemsRef.current = visibleItems;
1266
+ return visibleItems;
1267
+ }
1268
+ const isOrgContextReady = orgContextReady && selectedOrganisation?.id;
1269
+ const isEventContextReady = eventLoadingRaw === void 0 ? true : !eventLoading;
1270
+ const hasValidContext = isOrgContextReady && isEventContextReady;
1271
+ const shouldWaitForScope = scopeLoading || !hasValidContext;
1272
+ const shouldRetryAfterError = scopeError && hasValidContext && !scopeLoading;
1273
+ if (items && items.length > 0 && selectedOrganisation?.id) {
1274
+ const visibleItems = (items || []).filter((item) => !item.meta?.hidden);
1275
+ previousFilteredItemsRef.current = visibleItems;
1276
+ return visibleItems;
1277
+ }
1278
+ if (!authContext || !rbacContext || shouldWaitForScope && !shouldRetryAfterError) {
1279
+ return [];
1280
+ }
1281
+ if (permissionsLoading) {
1282
+ if (previousFilteredItemsRef.current.length > 0) {
1283
+ return previousFilteredItemsRef.current;
1233
1284
  }
1234
- if (permissionsLoading) {
1235
- if (previousFilteredItemsRef.current.length > 0) {
1236
- return previousFilteredItemsRef.current;
1237
- }
1238
- return [];
1285
+ if (items && items.length > 0 && stableScope.organisationId) {
1286
+ return (items || []).filter((item) => !item.meta?.hidden);
1239
1287
  }
1240
- if (permissionsError || !permissionMap || Object.keys(permissionMap).length === 0) {
1241
- logger.warn("NavigationMenu", "Permission map is empty or has error - showing no items for security", {
1242
- permissionsError: permissionsError?.message,
1243
- permissionMapSize: permissionMap ? Object.keys(permissionMap).length : 0
1288
+ return [];
1289
+ }
1290
+ if (permissionsError) {
1291
+ logger.warn("NavigationMenu", "Permission check error - showing no items for security", {
1292
+ permissionsError: permissionsError?.message
1293
+ });
1294
+ return [];
1295
+ }
1296
+ if (!permissionMap || Object.keys(permissionMap).length === 0) {
1297
+ if (stableScope.organisationId && items && items.length > 0) {
1298
+ return (items || []).filter((item) => !item.meta?.hidden);
1299
+ }
1300
+ if (stableScope.organisationId) {
1301
+ logger.warn("NavigationMenu", "Permission map is empty and no items provided - showing nothing", {
1302
+ permissionMapSize: 0,
1303
+ organisationId: stableScope.organisationId,
1304
+ eventId: stableScope.eventId,
1305
+ appId: stableScope.appId
1244
1306
  });
1245
- return [];
1246
1307
  }
1247
- } else {
1248
- return (items || []).filter((item) => !item.meta?.hidden);
1308
+ return [];
1249
1309
  }
1250
1310
  const getPageIdFromHref = (href) => {
1251
1311
  if (!href) return null;
@@ -1346,7 +1406,8 @@ var NavigationMenu = React12.forwardRef(({
1346
1406
  return filtered;
1347
1407
  }, [
1348
1408
  items,
1349
- filterByPermissions,
1409
+ itemsPreFiltered,
1410
+ // Add itemsPreFiltered to dependencies
1350
1411
  authContext,
1351
1412
  rbacContext,
1352
1413
  permissionMap,
@@ -1364,20 +1425,6 @@ var NavigationMenu = React12.forwardRef(({
1364
1425
  orgContextReady,
1365
1426
  selectedOrganisation?.id
1366
1427
  ]);
1367
- React12.useEffect(() => {
1368
- if (auditLog && authContext) {
1369
- const currentItem = items?.find((item) => item.href === currentPath || item.id === "navigation-menu");
1370
- logger.debug("NavigationMenu", "Navigation access attempt:", {
1371
- itemId: currentItem?.id || "navigation-menu",
1372
- label: currentItem?.label || "Navigation Menu",
1373
- href: currentPath,
1374
- permissions: currentItem?.permissions || null,
1375
- roles: currentItem?.roles || null,
1376
- accessLevel: currentItem?.accessLevel || null,
1377
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1378
- });
1379
- }
1380
- }, [auditLog, authContext, currentPath, items]);
1381
1428
  const handleHierarchicalKeyDown = (event, item) => {
1382
1429
  switch (event.key) {
1383
1430
  case "Enter":
@@ -1426,8 +1473,16 @@ var NavigationMenu = React12.forwardRef(({
1426
1473
  return;
1427
1474
  }
1428
1475
  const isItemVisible = filteredItems.some((filtered) => filtered.id === item.id);
1476
+ if (!isItemVisible) {
1477
+ logger.warn("NavigationMenu", "Navigation attempt to filtered item blocked", {
1478
+ itemId: item.id,
1479
+ label: item.label,
1480
+ href: item.href
1481
+ });
1482
+ return;
1483
+ }
1429
1484
  let hasPermission = true;
1430
- if (item.permissions && item.permissions.length > 0 && rbacContext && hasAnyPermission) {
1485
+ if (item.permissions && item.permissions.length > 0 && rbacContext && hasAnyPermission && permissionMap && Object.keys(permissionMap).length > 0) {
1431
1486
  const permissions = item.permissions.filter((p) => typeof p === "string").map((p) => p);
1432
1487
  if (permissions.length > 0) {
1433
1488
  hasPermission = hasAnyPermission(permissions);
@@ -1454,9 +1509,12 @@ var NavigationMenu = React12.forwardRef(({
1454
1509
  });
1455
1510
  }
1456
1511
  }
1512
+ if (!hasPermission && (!permissionMap || Object.keys(permissionMap).length === 0) && isItemVisible) {
1513
+ hasPermission = true;
1514
+ }
1457
1515
  if (!hasPermission) {
1458
1516
  if (onNavigationAccessDenied) {
1459
- onNavigationAccessDenied(item.id, "Insufficient permissions");
1517
+ onNavigationAccessDenied(item);
1460
1518
  }
1461
1519
  if (strictMode) {
1462
1520
  logger.error("NavigationMenu", "STRICT MODE VIOLATION: User attempted to access protected navigation item without permission", {
@@ -1469,7 +1527,7 @@ var NavigationMenu = React12.forwardRef(({
1469
1527
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
1470
1528
  });
1471
1529
  if (onStrictModeViolation) {
1472
- onStrictModeViolation(item.id, "Insufficient permissions");
1530
+ onStrictModeViolation(item, "Insufficient permissions");
1473
1531
  }
1474
1532
  }
1475
1533
  return;
@@ -1481,7 +1539,6 @@ var NavigationMenu = React12.forwardRef(({
1481
1539
  }
1482
1540
  };
1483
1541
  const isActiveItem = (item) => {
1484
- if (item.isActive !== void 0) return item.isActive;
1485
1542
  if (currentPath === item.href) return true;
1486
1543
  if (item.children && item.children.length > 0) {
1487
1544
  return item.children.some((child) => isActiveItem(child));
@@ -1498,8 +1555,8 @@ var NavigationMenu = React12.forwardRef(({
1498
1555
  const hasChildren = item.children && item.children.length > 0;
1499
1556
  const isExpanded = expandedItems.has(item.id);
1500
1557
  const itemIsActive = isActiveItem(item);
1501
- return /* @__PURE__ */ jsx14("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs7("div", { children: [
1502
- /* @__PURE__ */ jsxs7(
1558
+ return /* @__PURE__ */ jsx14("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs8("div", { children: [
1559
+ /* @__PURE__ */ jsxs8(
1503
1560
  "button",
1504
1561
  {
1505
1562
  onClick: () => toggleExpanded(item.id),
@@ -1540,7 +1597,7 @@ var NavigationMenu = React12.forwardRef(({
1540
1597
  ) });
1541
1598
  };
1542
1599
  if (mode === "dropdown") {
1543
- return /* @__PURE__ */ jsxs7(
1600
+ return /* @__PURE__ */ jsxs8(
1544
1601
  Select,
1545
1602
  {
1546
1603
  onValueChange: handleNavigationSelect,
@@ -1589,7 +1646,7 @@ NavigationMenu.displayName = "NavigationMenu";
1589
1646
 
1590
1647
  // src/components/Header/Header.tsx
1591
1648
  import { Link } from "react-router-dom";
1592
- import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
1649
+ import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
1593
1650
  function Header({
1594
1651
  logoUrl,
1595
1652
  logoAlt = "Logo",
@@ -1610,7 +1667,7 @@ function Header({
1610
1667
  return /* @__PURE__ */ jsx15("header", { className: cn(
1611
1668
  "w-full border-b border-main-200 h-16 shadow-sm bg-main-100 ",
1612
1669
  className
1613
- ), 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: [
1670
+ ), role: "banner", children: /* @__PURE__ */ jsxs9("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: [
1614
1671
  logo ? logoHref ? /* @__PURE__ */ jsx15(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: logo }) : logo : logoUrl ? logoHref ? /* @__PURE__ */ jsx15(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx15(
1615
1672
  "img",
1616
1673
  {
@@ -1647,7 +1704,8 @@ function Header({
1647
1704
  currentPath,
1648
1705
  onNavigate,
1649
1706
  buttonText: "Menu",
1650
- className: "w-48"
1707
+ className: "w-48",
1708
+ itemsPreFiltered: true
1651
1709
  }
1652
1710
  ),
1653
1711
  showEventSelector ? /* @__PURE__ */ jsx15(
@@ -1673,7 +1731,7 @@ function Header({
1673
1731
 
1674
1732
  // src/components/Footer/Footer.tsx
1675
1733
  import React13 from "react";
1676
- import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
1734
+ import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
1677
1735
  var FooterComponent = ({
1678
1736
  companyName = "Solvera Solutions Pty Ltd",
1679
1737
  year = (/* @__PURE__ */ new Date()).getFullYear(),
@@ -1684,7 +1742,7 @@ var FooterComponent = ({
1684
1742
  children
1685
1743
  }) => {
1686
1744
  const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
1687
- return /* @__PURE__ */ jsx16("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: [
1745
+ return /* @__PURE__ */ jsx16("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs10("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
1688
1746
  logo && /* @__PURE__ */ jsx16("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
1689
1747
  children && /* @__PURE__ */ jsx16(Fragment3, { children }),
1690
1748
  /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: copyrightText }),
@@ -1696,12 +1754,9 @@ var Footer = React13.memo(FooterComponent);
1696
1754
  Footer.displayName = "Footer";
1697
1755
 
1698
1756
  // src/components/PaceAppLayout/PaceAppLayout.tsx
1699
- init_UnifiedAuthProvider2();
1700
- init_useOrganisations();
1701
1757
  import { useState as useState5, useEffect as useEffect3, useMemo as useMemo5 } from "react";
1702
1758
  import { Outlet, useNavigate, useLocation } from "react-router-dom";
1703
- init_logger();
1704
- import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
1759
+ import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
1705
1760
  var EMPTY_PAGE_ID_MAPPING = {};
1706
1761
  var EMPTY_ROUTE_PERMISSIONS = {};
1707
1762
  function PaceAppLayout({
@@ -1718,7 +1773,6 @@ function PaceAppLayout({
1718
1773
  defaultPermission = "read",
1719
1774
  routePermissions = EMPTY_ROUTE_PERMISSIONS,
1720
1775
  permissionFallback,
1721
- filterNavigationByPermissions = false,
1722
1776
  pageIdMapping = EMPTY_PAGE_ID_MAPPING,
1723
1777
  // NEW: Phase 1 - Enhanced Security Features
1724
1778
  strictMode = true,
@@ -1734,7 +1788,7 @@ function PaceAppLayout({
1734
1788
  onRouteAccessDenied,
1735
1789
  onRouteStrictModeViolation
1736
1790
  }) {
1737
- const { user, signOut, updatePassword, supabase } = useUnifiedAuth();
1791
+ const { user, signOut, updatePassword, supabase, appId: contextAppId } = useUnifiedAuth();
1738
1792
  const { selectedOrganisation } = useOrganisations();
1739
1793
  const navigate = useNavigate();
1740
1794
  const location = useLocation();
@@ -1750,17 +1804,24 @@ function PaceAppLayout({
1750
1804
  selectedOrganisationId: selectedOrganisation?.id || null,
1751
1805
  selectedEventId: selectedEvent?.event_id || null
1752
1806
  });
1807
+ const resolvedAppId = contextAppId || resolvedScope?.appId;
1753
1808
  const scope = useMemo5(() => {
1754
- if (!resolvedScope?.organisationId) {
1809
+ if (resolvedScope?.organisationId) {
1810
+ return resolvedScope;
1811
+ }
1812
+ if (selectedOrganisation?.id) {
1755
1813
  return {
1756
- organisationId: selectedOrganisation?.id || "",
1814
+ organisationId: selectedOrganisation.id,
1757
1815
  eventId: selectedEvent?.event_id || void 0,
1758
- // Preserve appId from resolvedScope if it exists, even if organisationId is missing
1759
- appId: resolvedScope?.appId || void 0
1816
+ appId: resolvedAppId || resolvedScope?.appId || void 0
1760
1817
  };
1761
1818
  }
1762
- return resolvedScope;
1763
- }, [resolvedScope, selectedOrganisation?.id, selectedEvent?.event_id]);
1819
+ return {
1820
+ organisationId: selectedOrganisation?.id || "",
1821
+ eventId: selectedEvent?.event_id || void 0,
1822
+ appId: resolvedAppId || resolvedScope?.appId || void 0
1823
+ };
1824
+ }, [resolvedScope, selectedOrganisation?.id, selectedEvent?.event_id, resolvedAppId]);
1764
1825
  const defaultNavItems = useMemo5(() => [
1765
1826
  { id: "home", label: "Home", href: "/", icon: "Home" },
1766
1827
  { id: "dashboard", label: "Dashboard", href: "/dashboard", icon: "LayoutDashboard" },
@@ -1845,10 +1906,6 @@ function PaceAppLayout({
1845
1906
  }, [enforcePermissions, can, isCheckingPermission, isCheckingSuperAdmin, isSuperAdminUser, currentPageId, currentRoutePermission, user?.id, strictMode, auditLog, onPageAccessDenied, onStrictModeViolation]);
1846
1907
  const [filteredMenuItems, setFilteredMenuItems] = useState5(baseMenuItems);
1847
1908
  useEffect3(() => {
1848
- if (!filterNavigationByPermissions) {
1849
- setFilteredMenuItems(baseMenuItems);
1850
- return;
1851
- }
1852
1909
  let isMounted = true;
1853
1910
  const filterItems = async () => {
1854
1911
  if (!user?.id) {
@@ -1858,23 +1915,18 @@ function PaceAppLayout({
1858
1915
  return;
1859
1916
  }
1860
1917
  const currentScope = scope;
1861
- if (scopeLoading || !currentScope.appId) {
1862
- if (!scopeLoading && !currentScope.appId) {
1863
- logger.error("PaceAppLayout", "appId not resolved in scope - navigation filtering disabled for security", {
1864
- scope: currentScope,
1865
- resolvedScope,
1866
- selectedOrganisationId: selectedOrganisation?.id,
1867
- selectedEventId: selectedEvent?.event_id,
1868
- appName
1869
- });
1870
- }
1918
+ const hasAppId = currentScope.appId || resolvedAppId;
1919
+ const hasOrganisationContext = currentScope.organisationId;
1920
+ const hasUser = !!user?.id;
1921
+ if (hasUser && hasOrganisationContext) {
1922
+ } else if (!hasUser || !hasOrganisationContext) {
1871
1923
  if (isMounted) {
1872
1924
  setFilteredMenuItems([]);
1873
1925
  }
1874
1926
  return;
1875
1927
  }
1876
1928
  try {
1877
- const { isSuperAdmin: isSuperAdmin2 } = await import("./api-45XYYO2A.js");
1929
+ const { isSuperAdmin: isSuperAdmin2 } = await import("./api-ROMBCNKU.js");
1878
1930
  const isSuper = await isSuperAdmin2(user.id);
1879
1931
  if (isSuper) {
1880
1932
  if (isMounted) {
@@ -1895,23 +1947,16 @@ function PaceAppLayout({
1895
1947
  return;
1896
1948
  }
1897
1949
  try {
1898
- const { getPermissionMap } = await import("./api-45XYYO2A.js");
1899
- logger.debug("PaceAppLayout", "Filtering navigation with scope", {
1950
+ const { getPermissionMap } = await import("./api-ROMBCNKU.js");
1951
+ const permissionScope = {
1900
1952
  organisationId: currentScope.organisationId,
1901
1953
  eventId: currentScope.eventId,
1902
- appId: currentScope.appId,
1903
- hasOrganisationId: !!currentScope.organisationId,
1904
- hasEventId: !!currentScope.eventId,
1905
- hasAppId: !!currentScope.appId
1906
- });
1954
+ appId: currentScope.appId || resolvedAppId || void 0
1955
+ // Use appId if available, but proceed without it
1956
+ };
1907
1957
  const permissionMap = await getPermissionMap({
1908
1958
  userId: user.id,
1909
- scope: currentScope
1910
- });
1911
- logger.debug("PaceAppLayout", "Permission map received", {
1912
- permissionCount: Object.keys(permissionMap).length,
1913
- permissions: Object.keys(permissionMap),
1914
- hasWildcard: permissionMap["*"] === true
1959
+ scope: permissionScope
1915
1960
  });
1916
1961
  const filtered = baseMenuItems.map((item) => {
1917
1962
  if (!item.href) return { item, hasAccess: true };
@@ -1919,15 +1964,6 @@ function PaceAppLayout({
1919
1964
  const permission = routePermissions[item.href] || defaultPermission;
1920
1965
  const fullPermission = permission.includes(":") ? permission : pageId ? `${permission}:page.${pageId}` : permission;
1921
1966
  const hasAccess = permissionMap["*"] === true || permissionMap[fullPermission] === true;
1922
- logger.debug("PaceAppLayout", "Checking navigation item permission", {
1923
- itemId: item.id,
1924
- href: item.href,
1925
- pageId,
1926
- permission,
1927
- fullPermission,
1928
- hasAccess,
1929
- permissionInMap: permissionMap[fullPermission]
1930
- });
1931
1967
  return { item, hasAccess };
1932
1968
  });
1933
1969
  if (!isMounted) return;
@@ -1944,7 +1980,7 @@ function PaceAppLayout({
1944
1980
  return () => {
1945
1981
  isMounted = false;
1946
1982
  };
1947
- }, [baseMenuItems, filterNavigationByPermissions, pageIdMapping, routePermissions, defaultPermission, can, user?.id, scope, scopeLoading]);
1983
+ }, [baseMenuItems, pageIdMapping, routePermissions, defaultPermission, can, user?.id, scope, scopeLoading, contextAppId, resolvedScope?.appId]);
1948
1984
  useEffect3(() => {
1949
1985
  if (!roleBasedRouting || routeConfig.length === 0) return;
1950
1986
  let isMounted = true;
@@ -1967,7 +2003,7 @@ function PaceAppLayout({
1967
2003
  let hasAccess = true;
1968
2004
  if (currentRoute.pageId && currentRoute.permissions && currentRoute.permissions.length > 0) {
1969
2005
  try {
1970
- const { isPermittedCached } = await import("./api-45XYYO2A.js");
2006
+ const { isPermittedCached } = await import("./api-ROMBCNKU.js");
1971
2007
  const hasPagePermission = await isPermittedCached({
1972
2008
  userId: user?.id || "",
1973
2009
  scope,
@@ -1983,7 +2019,7 @@ function PaceAppLayout({
1983
2019
  }
1984
2020
  }
1985
2021
  if (hasAccess && currentRoute.roles && currentRoute.roles.length > 0 && user?.id) {
1986
- const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-B37ATQHE.js");
2022
+ const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-7F6T4B6K.js");
1987
2023
  hasAccess = true;
1988
2024
  }
1989
2025
  if (!isMounted) return;
@@ -2016,21 +2052,27 @@ function PaceAppLayout({
2016
2052
  const handleSignOut = async () => {
2017
2053
  await signOut();
2018
2054
  };
2019
- const handleChangePassword = async (newPassword) => {
2055
+ const handleChangePassword = async (newPassword, confirmPassword) => {
2020
2056
  const result = await updatePassword(newPassword);
2021
2057
  if (result?.error) {
2022
2058
  logger.error("PaceAppLayout", "Failed to change password", { error: result.error.message });
2059
+ return {
2060
+ error: {
2061
+ message: result.error.message,
2062
+ code: result.error.name || "PASSWORD_UPDATE_ERROR"
2063
+ }
2064
+ };
2023
2065
  }
2024
- return result || { error: null };
2066
+ return {};
2025
2067
  };
2026
2068
  if (enforcePermissions && (isCheckingSuperAdmin || isCheckingPermission)) {
2027
- return /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
2069
+ return /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs11("div", { className: "text-center", children: [
2028
2070
  /* @__PURE__ */ jsx17("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-sec-900 mx-auto mb-4" }),
2029
2071
  /* @__PURE__ */ jsx17("p", { className: "text-sec-600", children: "Checking permissions..." })
2030
2072
  ] }) });
2031
2073
  }
2032
2074
  if (enforcePermissions && permissionError && !isSuperAdminUser) {
2033
- return /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
2075
+ return /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs11("div", { className: "text-center", children: [
2034
2076
  /* @__PURE__ */ jsx17("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Permission Error" }),
2035
2077
  /* @__PURE__ */ jsx17("p", { className: "text-sec-600 mb-4", children: permissionError.message }),
2036
2078
  /* @__PURE__ */ jsx17(Button, { onClick: () => navigate("/"), children: "Go Home" })
@@ -2043,10 +2085,10 @@ function PaceAppLayout({
2043
2085
  if (permissionFallback) {
2044
2086
  return /* @__PURE__ */ jsx17(Fragment4, { children: permissionFallback });
2045
2087
  }
2046
- return /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
2088
+ return /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs11("div", { className: "text-center", children: [
2047
2089
  /* @__PURE__ */ jsx17("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Access Denied" }),
2048
2090
  /* @__PURE__ */ jsx17("p", { className: "text-sec-600 mb-4", children: "You don't have permission to access this page." }),
2049
- /* @__PURE__ */ jsxs10("div", { className: "flex gap-2 justify-center", children: [
2091
+ /* @__PURE__ */ jsxs11("div", { className: "flex gap-2 justify-center", children: [
2050
2092
  /* @__PURE__ */ jsx17(Button, { onClick: () => navigate("/"), children: "Go Home" }),
2051
2093
  /* @__PURE__ */ jsx17(
2052
2094
  Button,
@@ -2062,7 +2104,7 @@ function PaceAppLayout({
2062
2104
  ] })
2063
2105
  ] }) });
2064
2106
  }
2065
- return /* @__PURE__ */ jsxs10(Fragment4, { children: [
2107
+ return /* @__PURE__ */ jsxs11(Fragment4, { children: [
2066
2108
  /* @__PURE__ */ jsx17(
2067
2109
  Header,
2068
2110
  {
@@ -2095,9 +2137,7 @@ function PaceAppLayout({
2095
2137
  // src/components/PaceLoginPage/PaceLoginPage.tsx
2096
2138
  import { useEffect as useEffect4, useState as useState6, useContext } from "react";
2097
2139
  import { useNavigate as useNavigate2, useLocation as useLocation2 } from "react-router-dom";
2098
- init_EventServiceProvider();
2099
- init_logger();
2100
- import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
2140
+ import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
2101
2141
  var PaceLoginPage = ({
2102
2142
  appName = "Pace",
2103
2143
  onSuccessRedirectPath = "/user-dashboard",
@@ -2228,7 +2268,7 @@ var PaceLoginPage = ({
2228
2268
  setIsSigningIn(false);
2229
2269
  }
2230
2270
  };
2231
- 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: [
2271
+ return /* @__PURE__ */ jsxs12("main", { className: "min-h-screen grid mx-auto w-fit content-center justify-items-center gap-y-8", "aria-label": `${appName} Login Page`, children: [
2232
2272
  /* @__PURE__ */ jsx18(
2233
2273
  "img",
2234
2274
  {
@@ -2259,49 +2299,33 @@ var PaceLoginPage = ({
2259
2299
  };
2260
2300
 
2261
2301
  // src/components/SessionRestorationLoader/SessionRestorationLoader.tsx
2262
- import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
2302
+ import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
2263
2303
  var SessionRestorationLoader = ({
2264
- message = "Restoring session..."
2304
+ message = "Restoring session...",
2305
+ className
2265
2306
  }) => {
2266
- return /* @__PURE__ */ jsxs12(
2307
+ return /* @__PURE__ */ jsxs13(
2267
2308
  "div",
2268
2309
  {
2269
- style: {
2270
- display: "flex",
2271
- flexDirection: "column",
2272
- alignItems: "center",
2273
- justifyContent: "center",
2274
- height: "100vh",
2275
- width: "100%",
2276
- gap: "1rem",
2277
- textAlign: "center",
2278
- padding: "1rem",
2279
- background: "var(--background, transparent)"
2280
- },
2310
+ className: cn(
2311
+ "flex flex-col items-center justify-center h-screen w-full gap-4 text-center p-4 bg-background",
2312
+ className
2313
+ ),
2314
+ role: "status",
2315
+ "aria-live": "polite",
2316
+ "aria-label": message,
2281
2317
  children: [
2282
2318
  /* @__PURE__ */ jsx19(LoadingSpinner, { size: "lg" }),
2283
- /* @__PURE__ */ jsx19(
2284
- "div",
2285
- {
2286
- style: {
2287
- fontSize: "0.95rem",
2288
- color: "var(--muted-foreground, #6b7280)"
2289
- },
2290
- children: message
2291
- }
2292
- )
2319
+ /* @__PURE__ */ jsx19("div", { className: "text-sm text-sec-600", children: message })
2293
2320
  ]
2294
2321
  }
2295
2322
  );
2296
2323
  };
2297
2324
 
2298
2325
  // src/components/ProtectedRoute/ProtectedRoute.tsx
2299
- init_UnifiedAuthProvider();
2300
- init_useSessionRestoration();
2301
2326
  import { useMemo as useMemo6 } from "react";
2302
2327
  import { Navigate, Outlet as Outlet2 } from "react-router-dom";
2303
- init_logger();
2304
- import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
2328
+ import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
2305
2329
  function ProtectedRoute({
2306
2330
  requireEvent = true,
2307
2331
  allowSuperAdminBypass = false,
@@ -2342,7 +2366,7 @@ function ProtectedRoute({
2342
2366
  return /* @__PURE__ */ jsx20(Outlet2, {});
2343
2367
  }
2344
2368
  if (!events || events.length === 0) {
2345
- return noEventsFallback || /* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh", padding: "2rem" }, children: /* @__PURE__ */ jsxs13(Alert, { variant: "destructive", className: "max-w-md", children: [
2369
+ return noEventsFallback || /* @__PURE__ */ jsx20("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh", padding: "2rem" }, children: /* @__PURE__ */ jsxs14(Alert, { variant: "destructive", className: "max-w-md", children: [
2346
2370
  /* @__PURE__ */ jsx20(AlertTitle, { children: "No Events Available" }),
2347
2371
  /* @__PURE__ */ jsx20(AlertDescription, { children: "You don't have access to any events. Please contact your administrator if you believe this is an error." })
2348
2372
  ] }) });
@@ -2354,159 +2378,10 @@ function ProtectedRoute({
2354
2378
  return /* @__PURE__ */ jsx20(Outlet2, {});
2355
2379
  }
2356
2380
 
2357
- // src/components/ErrorBoundary/ErrorBoundary.tsx
2358
- import { Component } from "react";
2359
- init_logger();
2360
- import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
2361
- var ErrorBoundary = class extends Component {
2362
- constructor(props) {
2363
- super(props);
2364
- this.retryTimeoutId = null;
2365
- this.reportError = (errorId, componentName) => {
2366
- if (import.meta.env.MODE === "production") {
2367
- logger.warn("ErrorBoundary", "Error reporting would be triggered in production:", { errorId, componentName });
2368
- }
2369
- };
2370
- this.handleRetry = () => {
2371
- const { maxRetries = 3 } = this.props;
2372
- const { retryCount } = this.state;
2373
- if (retryCount < maxRetries) {
2374
- logger.debug("ErrorBoundary", `Retrying component render (attempt ${retryCount + 1}/${maxRetries})`);
2375
- this.setState((prevState) => ({
2376
- hasError: false,
2377
- error: void 0,
2378
- errorInfo: void 0,
2379
- errorId: void 0,
2380
- retryCount: prevState.retryCount + 1
2381
- }));
2382
- }
2383
- };
2384
- this.state = {
2385
- hasError: false,
2386
- retryCount: 0
2387
- };
2388
- }
2389
- static getDerivedStateFromError(error) {
2390
- const errorId = `error_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
2391
- return {
2392
- hasError: true,
2393
- error,
2394
- errorId
2395
- };
2396
- }
2397
- componentDidCatch(error, errorInfo) {
2398
- const { componentName = "Unknown Component", onError, enableReporting = true } = this.props;
2399
- const errorId = this.state.errorId;
2400
- this.setState({ errorInfo });
2401
- logger.error("ErrorBoundary", `[${componentName}] Caught error ${errorId}:`, error, errorInfo);
2402
- performanceBudgetMonitor.measure("ERROR_BOUNDARY_TRIGGER", 1, {
2403
- componentName,
2404
- errorId,
2405
- errorMessage: error.message,
2406
- stack: error.stack?.substring(0, 200)
2407
- // Truncated stack trace
2408
- });
2409
- if (enableReporting) {
2410
- this.reportError(errorId, componentName);
2411
- }
2412
- if (onError) {
2413
- onError(error, errorInfo, errorId);
2414
- }
2415
- }
2416
- componentWillUnmount() {
2417
- if (this.retryTimeoutId) {
2418
- clearTimeout(this.retryTimeoutId);
2419
- }
2420
- }
2421
- render() {
2422
- if (this.state.hasError) {
2423
- const {
2424
- componentName = "Component",
2425
- fallback,
2426
- enableRetry = true,
2427
- maxRetries = 3
2428
- } = this.props;
2429
- const { retryCount, errorId } = this.state;
2430
- if (fallback) {
2431
- return fallback;
2432
- }
2433
- return /* @__PURE__ */ jsx21(
2434
- "div",
2435
- {
2436
- role: "alert",
2437
- className: "p-6 bg-destructive/10 border border-destructive/20 rounded-lg",
2438
- "data-error-boundary": errorId,
2439
- children: /* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-3", children: [
2440
- /* @__PURE__ */ jsx21("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx21("svg", { className: "w-5 h-5 text-destructive", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx21("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" }) }) }),
2441
- /* @__PURE__ */ jsxs14("div", { className: "flex-1 min-w-0", children: [
2442
- /* @__PURE__ */ jsxs14("h3", { className: "text-destructive", children: [
2443
- "Error in ",
2444
- componentName
2445
- ] }),
2446
- /* @__PURE__ */ jsx21("p", { className: "text-destructive/80", children: this.state.error?.message || "An unexpected error occurred." }),
2447
- enableRetry && retryCount < maxRetries && /* @__PURE__ */ jsxs14("div", { className: "flex gap-3 mb-4", children: [
2448
- /* @__PURE__ */ jsxs14(
2449
- "button",
2450
- {
2451
- onClick: this.handleRetry,
2452
- className: "px-4 py-2 bg-destructive text-destructive-foreground rounded-md hover:bg-destructive/90 transition-colors text-sm font-medium",
2453
- children: [
2454
- "Retry (",
2455
- retryCount + 1,
2456
- "/",
2457
- maxRetries,
2458
- ")"
2459
- ]
2460
- }
2461
- ),
2462
- /* @__PURE__ */ jsx21(
2463
- "button",
2464
- {
2465
- onClick: () => window.location.reload(),
2466
- className: "px-4 py-2 bg-sec-600 text-main-50 rounded-md hover:bg-sec-700 transition-colors text-sm font-medium",
2467
- children: "Reload Page"
2468
- }
2469
- )
2470
- ] }),
2471
- retryCount >= maxRetries && /* @__PURE__ */ jsxs14("div", { className: "mb-4 p-3 bg-acc-50 border border-acc-200 rounded-md", children: [
2472
- /* @__PURE__ */ jsx21("p", { className: "text-acc-800", children: "Maximum retry attempts reached. Please reload the page or contact support." }),
2473
- /* @__PURE__ */ jsx21(
2474
- "button",
2475
- {
2476
- onClick: () => window.location.reload(),
2477
- className: "mt-2 px-3 py-1 bg-acc-600 text-main-50 rounded text-sm hover:bg-acc-700",
2478
- children: "Reload Page"
2479
- }
2480
- )
2481
- ] }),
2482
- import.meta.env.MODE === "development" && this.state.error && /* @__PURE__ */ jsxs14("details", { className: "text-sm text-destructive/70", children: [
2483
- /* @__PURE__ */ jsx21("summary", { className: "cursor-pointer font-medium mb-2", children: "Error Details (Development)" }),
2484
- /* @__PURE__ */ jsxs14("div", { className: "bg-destructive/5 p-3 rounded border", children: [
2485
- /* @__PURE__ */ jsxs14("p", { className: "font-mono", children: [
2486
- "Error ID: ",
2487
- errorId
2488
- ] }),
2489
- /* @__PURE__ */ jsxs14("pre", { className: "whitespace-pre-wrap text-xs overflow-auto max-h-32", children: [
2490
- this.state.error.toString(),
2491
- this.state.errorInfo?.componentStack
2492
- ] })
2493
- ] })
2494
- ] })
2495
- ] })
2496
- ] })
2497
- }
2498
- );
2499
- }
2500
- return this.props.children;
2501
- }
2502
- };
2503
-
2504
2381
  // src/components/OrganisationSelector/OrganisationSelector.tsx
2505
2382
  import { useState as useState7, useCallback as useCallback4 } from "react";
2506
- init_OrganisationProvider();
2507
- init_logger();
2508
2383
  import { RefreshCw as RefreshCw2, AlertCircle as AlertCircle2, Building2, Shield } from "lucide-react";
2509
- import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
2384
+ import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
2510
2385
  function OrganisationSelector({
2511
2386
  placeholder = "Select organisation",
2512
2387
  className,
@@ -2571,14 +2446,14 @@ function OrganisationSelector({
2571
2446
  }, [refreshOrganisations]);
2572
2447
  if (orgLoading) {
2573
2448
  return /* @__PURE__ */ jsxs15("div", { className: `flex items-center gap-2 ${className}`, children: [
2574
- /* @__PURE__ */ jsx22(LoadingSpinner, { size: "sm" }),
2575
- /* @__PURE__ */ jsx22("span", { className: "text-sm text-muted-foreground", children: compact ? "Loading..." : "Loading organisations..." })
2449
+ /* @__PURE__ */ jsx21(LoadingSpinner, { size: "sm" }),
2450
+ /* @__PURE__ */ jsx21("span", { className: "text-sm text-muted-foreground", children: compact ? "Loading..." : "Loading organisations..." })
2576
2451
  ] });
2577
2452
  }
2578
2453
  if (orgError) {
2579
2454
  return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
2580
2455
  /* @__PURE__ */ jsxs15(Alert, { variant: "destructive", children: [
2581
- /* @__PURE__ */ jsx22(AlertCircle2, { className: "h-4 w-4" }),
2456
+ /* @__PURE__ */ jsx21(AlertCircle2, { className: "h-4 w-4" }),
2582
2457
  /* @__PURE__ */ jsxs15(AlertDescription, { children: [
2583
2458
  "Failed to load organisations: ",
2584
2459
  orgError.message
@@ -2593,7 +2468,7 @@ function OrganisationSelector({
2593
2468
  disabled: isLoading,
2594
2469
  className: "w-full",
2595
2470
  children: [
2596
- /* @__PURE__ */ jsx22(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
2471
+ /* @__PURE__ */ jsx21(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
2597
2472
  "Retry"
2598
2473
  ]
2599
2474
  }
@@ -2604,8 +2479,8 @@ function OrganisationSelector({
2604
2479
  if (showNoOrganisationsMessage) {
2605
2480
  return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
2606
2481
  /* @__PURE__ */ jsxs15(Alert, { children: [
2607
- /* @__PURE__ */ jsx22(Building2, { className: "h-4 w-4" }),
2608
- /* @__PURE__ */ jsx22(AlertDescription, { children: "No organisations available. Please contact your administrator to be added to an organisation." })
2482
+ /* @__PURE__ */ jsx21(Building2, { className: "h-4 w-4" }),
2483
+ /* @__PURE__ */ jsx21(AlertDescription, { children: "No organisations available. Please contact your administrator to be added to an organisation." })
2609
2484
  ] }),
2610
2485
  showRetryButton && /* @__PURE__ */ jsxs15(
2611
2486
  Button,
@@ -2616,7 +2491,7 @@ function OrganisationSelector({
2616
2491
  disabled: isLoading,
2617
2492
  className: "w-full",
2618
2493
  children: [
2619
- /* @__PURE__ */ jsx22(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
2494
+ /* @__PURE__ */ jsx21(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
2620
2495
  "Check Again"
2621
2496
  ]
2622
2497
  }
@@ -2626,8 +2501,8 @@ function OrganisationSelector({
2626
2501
  return null;
2627
2502
  }
2628
2503
  const switchErrorDisplay = switchError && /* @__PURE__ */ jsxs15(Alert, { variant: "destructive", className: "mt-2", children: [
2629
- /* @__PURE__ */ jsx22(AlertCircle2, { className: "h-4 w-4" }),
2630
- /* @__PURE__ */ jsx22(AlertDescription, { children: switchError })
2504
+ /* @__PURE__ */ jsx21(AlertCircle2, { className: "h-4 w-4" }),
2505
+ /* @__PURE__ */ jsx21(AlertDescription, { children: switchError })
2631
2506
  ] });
2632
2507
  return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
2633
2508
  /* @__PURE__ */ jsxs15(
@@ -2637,14 +2512,14 @@ function OrganisationSelector({
2637
2512
  onValueChange: handleOrganisationChange,
2638
2513
  disabled: disabled || isLoading || !selectedOrganisation,
2639
2514
  children: [
2640
- /* @__PURE__ */ jsx22(SelectTrigger, { className: `${isLoading ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
2641
- isLoading ? /* @__PURE__ */ jsx22(LoadingSpinner, { size: "sm" }) : /* @__PURE__ */ jsx22(Building2, { className: "h-4 w-4 text-muted-foreground" }),
2642
- /* @__PURE__ */ jsx22(SelectValue, { placeholder })
2515
+ /* @__PURE__ */ jsx21(SelectTrigger, { className: `${isLoading ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
2516
+ isLoading ? /* @__PURE__ */ jsx21(LoadingSpinner, { size: "sm" }) : /* @__PURE__ */ jsx21(Building2, { className: "h-4 w-4 text-muted-foreground" }),
2517
+ /* @__PURE__ */ jsx21(SelectValue, { placeholder })
2643
2518
  ] }) }),
2644
- /* @__PURE__ */ jsx22(SelectContent, { children: organisations.map((org) => {
2519
+ /* @__PURE__ */ jsx21(SelectContent, { children: organisations.map((org) => {
2645
2520
  const userRole = getUserRole(org.id);
2646
2521
  const hasAccess = validateOrganisationAccess(org.id);
2647
- return /* @__PURE__ */ jsx22(
2522
+ return /* @__PURE__ */ jsx21(
2648
2523
  SelectItem,
2649
2524
  {
2650
2525
  value: org.id,
@@ -2652,15 +2527,15 @@ function OrganisationSelector({
2652
2527
  className: !hasAccess ? "opacity-50" : "",
2653
2528
  children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between w-full", children: [
2654
2529
  /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
2655
- /* @__PURE__ */ jsx22(Building2, { className: "h-4 w-4" }),
2530
+ /* @__PURE__ */ jsx21(Building2, { className: "h-4 w-4" }),
2656
2531
  /* @__PURE__ */ jsxs15("div", { className: "flex flex-col", children: [
2657
- /* @__PURE__ */ jsx22("span", { className: "font-medium", children: org.display_name }),
2658
- !compact && org.description && /* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground truncate max-w-40", children: org.description })
2532
+ /* @__PURE__ */ jsx21("span", { className: "font-medium", children: org.display_name }),
2533
+ !compact && org.description && /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground truncate max-w-40", children: org.description })
2659
2534
  ] })
2660
2535
  ] }),
2661
2536
  showRole && /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1 ml-4", children: [
2662
- /* @__PURE__ */ jsx22(Shield, { className: "h-3 w-3 text-muted-foreground" }),
2663
- /* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground capitalize", children: userRole?.replace("_", " ") || "No Role" })
2537
+ /* @__PURE__ */ jsx21(Shield, { className: "h-3 w-3 text-muted-foreground" }),
2538
+ /* @__PURE__ */ jsx21("span", { className: "text-xs text-muted-foreground capitalize", children: userRole?.replace("_", " ") || "No Role" })
2664
2539
  ] })
2665
2540
  ] })
2666
2541
  },
@@ -2675,8 +2550,7 @@ function OrganisationSelector({
2675
2550
  }
2676
2551
 
2677
2552
  // src/hooks/useFileReference.ts
2678
- import { useState as useState8, useCallback as useCallback5, useEffect as useEffect5, useRef as useRef2, useMemo as useMemo7 } from "react";
2679
- init_logger();
2553
+ import { useState as useState8, useCallback as useCallback5, useEffect as useEffect5, useRef as useRef3, useMemo as useMemo7 } from "react";
2680
2554
  var log = createLogger("useFileReference");
2681
2555
  function useFileReference(supabase) {
2682
2556
  const [isLoading, setIsLoading] = useState8(false);
@@ -2848,7 +2722,7 @@ function useFileReferenceForRecord(supabase, table_name, record_id, organisation
2848
2722
  const [fileReference, setFileReference] = useState8(null);
2849
2723
  const [fileReferences, setFileReferences] = useState8([]);
2850
2724
  const [fileCount, setFileCount] = useState8(0);
2851
- const urlRefreshIntervalRef = useRef2(null);
2725
+ const urlRefreshIntervalRef = useRef3(null);
2852
2726
  const loadFileReference = useCallback5(async () => {
2853
2727
  const reference = await getFileReference(table_name, record_id, organisation_id);
2854
2728
  setFileReference(reference);
@@ -3014,8 +2888,8 @@ function useFilesByCategory(supabase, table_name, record_id, category, organisat
3014
2888
  }
3015
2889
 
3016
2890
  // src/components/FileUpload/FileUpload.tsx
3017
- import { useState as useState9, useCallback as useCallback6, useRef as useRef3, useEffect as useEffect6, useMemo as useMemo8 } from "react";
3018
- import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
2891
+ import { useState as useState9, useCallback as useCallback6, useRef as useRef4, useEffect as useEffect6, useMemo as useMemo8 } from "react";
2892
+ import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
3019
2893
  function FileUpload({
3020
2894
  supabase,
3021
2895
  table_name,
@@ -3042,7 +2916,7 @@ function FileUpload({
3042
2916
  const [resolvedAppId, setResolvedAppId] = useState9(app_id || null);
3043
2917
  const [isResolvingAppId, setIsResolvingAppId] = useState9(!app_id);
3044
2918
  const [appIdError, setAppIdError] = useState9(null);
3045
- const fileInputRef = useRef3(null);
2919
+ const fileInputRef = useRef4(null);
3046
2920
  const { uploadFile, isLoading, error } = useFileReference(supabase);
3047
2921
  useEffect6(() => {
3048
2922
  if (app_id) {
@@ -3208,7 +3082,7 @@ function FileUpload({
3208
3082
  table_name,
3209
3083
  record_id,
3210
3084
  organisation_id,
3211
- app_id: resolvedAppId,
3085
+ app_id: resolvedAppId ? assertAppId(resolvedAppId) : assertAppId(""),
3212
3086
  category,
3213
3087
  is_public: isPublic
3214
3088
  }, file);
@@ -3341,14 +3215,24 @@ function FileUpload({
3341
3215
  /* @__PURE__ */ jsxs16(
3342
3216
  "div",
3343
3217
  {
3218
+ role: "button",
3219
+ tabIndex: isDisabled ? -1 : 0,
3220
+ "aria-label": "File upload area",
3221
+ "aria-disabled": isDisabled,
3344
3222
  className: `relative border-2 border-dashed rounded-lg p-6 text-center transition-colors ${dragClasses} ${disabledClasses}`,
3345
3223
  onDragOver: handleDragOver,
3346
3224
  onDragLeave: handleDragLeave,
3347
3225
  onDrop: handleDrop,
3348
3226
  onClick: !isDisabled ? handleClick : void 0,
3227
+ onKeyDown: !isDisabled ? (e) => {
3228
+ if (e.key === "Enter" || e.key === " ") {
3229
+ e.preventDefault();
3230
+ handleClick();
3231
+ }
3232
+ } : void 0,
3349
3233
  children: [
3350
3234
  children || /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
3351
- /* @__PURE__ */ jsx23(
3235
+ /* @__PURE__ */ jsx22(
3352
3236
  "input",
3353
3237
  {
3354
3238
  ref: fileInputRef,
@@ -3361,8 +3245,8 @@ function FileUpload({
3361
3245
  "data-testid": "file-input"
3362
3246
  }
3363
3247
  ),
3364
- /* @__PURE__ */ jsx23("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs16(Fragment5, { children: [
3365
- /* @__PURE__ */ jsx23("span", { className: "font-medium", children: "Click to upload" }),
3248
+ /* @__PURE__ */ jsx22("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs16(Fragment5, { children: [
3249
+ /* @__PURE__ */ jsx22("span", { className: "font-medium", children: "Click to upload" }),
3366
3250
  " ",
3367
3251
  "or drag and drop"
3368
3252
  ] }) }),
@@ -3372,11 +3256,20 @@ function FileUpload({
3372
3256
  !isResolvingAppId && multiple && " \u2022 Multiple files allowed"
3373
3257
  ] })
3374
3258
  ] }),
3375
- isUploading && !showProgress && /* @__PURE__ */ jsx23("div", { className: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center", children: /* @__PURE__ */ jsx23("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) })
3259
+ isUploading && !showProgress && /* @__PURE__ */ jsx22(
3260
+ "div",
3261
+ {
3262
+ className: "absolute inset-0 bg-white bg-opacity-75 flex items-center justify-center",
3263
+ role: "status",
3264
+ "aria-live": "polite",
3265
+ "aria-label": "Uploading file",
3266
+ children: /* @__PURE__ */ jsx22("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500", "aria-hidden": "true" })
3267
+ }
3268
+ )
3376
3269
  ]
3377
3270
  }
3378
3271
  ),
3379
- showProgress && uploadStates.size > 0 && /* @__PURE__ */ jsx23("div", { className: "space-y-2", children: Array.from(uploadStates.entries()).map(([fileId, uploadState]) => {
3272
+ showProgress && uploadStates.size > 0 && /* @__PURE__ */ jsx22("div", { className: "space-y-2", children: Array.from(uploadStates.entries()).map(([fileId, uploadState]) => {
3380
3273
  const { file, progress, preview, result } = uploadState;
3381
3274
  const isError = progress.status === "error";
3382
3275
  const isCompleted = progress.status === "completed";
@@ -3386,23 +3279,23 @@ function FileUpload({
3386
3279
  {
3387
3280
  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"}`,
3388
3281
  children: [
3389
- /* @__PURE__ */ jsx23("div", { className: "flex-shrink-0", children: preview ? /* @__PURE__ */ jsx23(
3282
+ /* @__PURE__ */ jsx22("div", { className: "flex-shrink-0", children: preview ? /* @__PURE__ */ jsx22(
3390
3283
  "img",
3391
3284
  {
3392
3285
  src: preview,
3393
3286
  alt: file.name,
3394
3287
  className: "w-12 h-12 object-cover rounded"
3395
3288
  }
3396
- ) : /* @__PURE__ */ jsx23("div", { className: "w-12 h-12 flex items-center justify-center bg-sec-200 rounded", children: /* @__PURE__ */ jsx23("span", { className: "text-2xl", children: "\u{1F4C4}" }) }) }),
3289
+ ) : /* @__PURE__ */ jsx22("div", { className: "w-12 h-12 flex items-center justify-center bg-sec-200 rounded", children: /* @__PURE__ */ jsx22("span", { className: "text-2xl", children: "\u{1F4C4}" }) }) }),
3397
3290
  /* @__PURE__ */ jsxs16("div", { className: "flex-1 min-w-0", children: [
3398
- /* @__PURE__ */ jsx23("div", { className: "font-medium text-sec-900 truncate", children: file.name }),
3291
+ /* @__PURE__ */ jsx22("div", { className: "font-medium text-sec-900 truncate", children: file.name }),
3399
3292
  /* @__PURE__ */ jsxs16("div", { className: "text-sm text-sec-500", children: [
3400
3293
  formatFileSize(file.size),
3401
3294
  isCompleted && result && " \u2022 Uploaded",
3402
3295
  isError && progress.error && ` \u2022 ${progress.error}`
3403
3296
  ] }),
3404
3297
  showProgress && (isUploading2 || isError) && /* @__PURE__ */ jsxs16("div", { className: "mt-2", children: [
3405
- /* @__PURE__ */ jsx23("div", { className: "w-full bg-sec-200 rounded-full h-2", children: /* @__PURE__ */ jsx23(
3298
+ /* @__PURE__ */ jsx22("div", { className: "w-full bg-sec-200 rounded-full h-2", children: /* @__PURE__ */ jsx22(
3406
3299
  "div",
3407
3300
  {
3408
3301
  className: `h-2 rounded-full transition-all duration-300 ${isError ? "bg-acc-500" : "bg-main-500"}`,
@@ -3419,33 +3312,56 @@ function FileUpload({
3419
3312
  ] })
3420
3313
  ] }),
3421
3314
  /* @__PURE__ */ jsxs16("div", { className: "flex-shrink-0", children: [
3422
- isCompleted && /* @__PURE__ */ jsx23("span", { className: "text-success-500 text-xl", children: "\u2713" }),
3423
- isError && /* @__PURE__ */ jsx23("span", { className: "text-acc-500 text-xl", children: "\u2715" }),
3424
- isUploading2 && /* @__PURE__ */ jsx23("div", { className: "animate-spin rounded-full h-5 w-5 border-b-2 border-main-500" })
3315
+ isCompleted && /* @__PURE__ */ jsx22("span", { className: "text-success-500 text-xl", children: "\u2713" }),
3316
+ isError && /* @__PURE__ */ jsx22("span", { className: "text-acc-500 text-xl", children: "\u2715" }),
3317
+ isUploading2 && /* @__PURE__ */ jsx22(
3318
+ "div",
3319
+ {
3320
+ className: "animate-spin rounded-full h-5 w-5 border-b-2 border-main-500",
3321
+ role: "status",
3322
+ "aria-label": "Uploading",
3323
+ "aria-hidden": "true"
3324
+ }
3325
+ )
3425
3326
  ] })
3426
3327
  ]
3427
3328
  },
3428
3329
  fileId
3429
3330
  );
3430
3331
  }) }),
3431
- appIdError && /* @__PURE__ */ jsx23("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: appIdError }),
3432
- error && /* @__PURE__ */ jsx23("div", { className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600", children: error })
3332
+ appIdError && /* @__PURE__ */ jsx22(
3333
+ "div",
3334
+ {
3335
+ className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600",
3336
+ role: "alert",
3337
+ "aria-live": "assertive",
3338
+ children: appIdError
3339
+ }
3340
+ ),
3341
+ error && /* @__PURE__ */ jsx22(
3342
+ "div",
3343
+ {
3344
+ className: "p-3 bg-acc-50 border border-acc-200 rounded-lg text-sm text-acc-600",
3345
+ role: "alert",
3346
+ "aria-live": "assertive",
3347
+ children: error
3348
+ }
3349
+ )
3433
3350
  ] });
3434
3351
  }
3435
3352
 
3436
3353
  // src/components/FileDisplay/FileDisplay.tsx
3437
- import { useState as useState11, useEffect as useEffect8, useRef as useRef5, useContext as useContext2, useMemo as useMemo9 } from "react";
3354
+ import { useState as useState11, useEffect as useEffect8, useRef as useRef6, useContext as useContext2, useMemo as useMemo9 } from "react";
3438
3355
 
3439
3356
  // src/hooks/useFileUrl.ts
3440
- import { useState as useState10, useEffect as useEffect7, useCallback as useCallback7, useRef as useRef4 } from "react";
3441
- init_logger();
3357
+ import { useState as useState10, useEffect as useEffect7, useCallback as useCallback7, useRef as useRef5 } from "react";
3442
3358
  var log2 = createLogger("useFileUrl");
3443
3359
  function useFileUrl(fileReference, options) {
3444
3360
  const { organisation_id, supabase, autoLoad = true } = options;
3445
3361
  const [url, setUrl] = useState10(null);
3446
3362
  const [isLoading, setIsLoading] = useState10(false);
3447
3363
  const [error, setError] = useState10(null);
3448
- const fileReferenceIdRef = useRef4(null);
3364
+ const fileReferenceIdRef = useRef5(null);
3449
3365
  const loadUrl = useCallback7(async () => {
3450
3366
  if (!fileReference) {
3451
3367
  setUrl(null);
@@ -3509,9 +3425,7 @@ function useFileUrl(fileReference, options) {
3509
3425
  }
3510
3426
 
3511
3427
  // src/components/FileDisplay/FileDisplay.tsx
3512
- init_UnifiedAuthProvider();
3513
- init_logger();
3514
- import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
3428
+ import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
3515
3429
  var fallbackSizeClasses = {
3516
3430
  xs: "h-4 w-4 text-xs",
3517
3431
  sm: "h-6 w-6 text-sm",
@@ -3553,7 +3467,7 @@ function FileDisplayContent({
3553
3467
  const [imageError, setImageError] = useState11(false);
3554
3468
  const [internalFileUrls, setInternalFileUrls] = useState11(new Map(fileUrls));
3555
3469
  const [deleteDialogOpen, setDeleteDialogOpen] = useState11(false);
3556
- const fileReferencesRef = useRef5([]);
3470
+ const fileReferencesRef = useRef6([]);
3557
3471
  const computedFallbackText = useMemo9(() => {
3558
3472
  if (fallbackText) return fallbackText;
3559
3473
  const fileName = fileReference?.file_metadata?.fileName;
@@ -3618,21 +3532,22 @@ function FileDisplayContent({
3618
3532
  };
3619
3533
  if (error) {
3620
3534
  if (ErrorComponent) {
3621
- return /* @__PURE__ */ jsx24(ErrorComponent, { error, retry: clearError });
3535
+ return /* @__PURE__ */ jsx23(ErrorComponent, { error, retry: clearError });
3622
3536
  }
3623
3537
  if (showFallback) {
3624
- return /* @__PURE__ */ jsx24("div", { className: fallbackClasses, title: "File unavailable", children: computedFallbackText });
3538
+ return /* @__PURE__ */ jsx23("div", { className: fallbackClasses, title: "File unavailable", children: computedFallbackText });
3625
3539
  }
3626
3540
  return /* @__PURE__ */ jsxs17("div", { className: `p-4 bg-acc-50 border border-acc-200 rounded-lg ${className}`, children: [
3627
3541
  /* @__PURE__ */ jsxs17("div", { className: "text-acc-600", children: [
3628
3542
  "Error loading file: ",
3629
3543
  error instanceof Error ? error.message : String(error)
3630
3544
  ] }),
3631
- clearError && /* @__PURE__ */ jsx24(
3545
+ clearError && /* @__PURE__ */ jsx23(
3632
3546
  "button",
3633
3547
  {
3634
3548
  onClick: clearError,
3635
3549
  className: "mt-2 text-sm text-acc-700 hover:text-acc-800 underline",
3550
+ "aria-label": "Retry loading file",
3636
3551
  children: "Try again"
3637
3552
  }
3638
3553
  )
@@ -3658,20 +3573,20 @@ function FileDisplayContent({
3658
3573
  }
3659
3574
  if (isLoading) {
3660
3575
  if (LoadingComponent) {
3661
- return /* @__PURE__ */ jsx24(LoadingComponent, {});
3576
+ return /* @__PURE__ */ jsx23(LoadingComponent, {});
3662
3577
  }
3663
- return /* @__PURE__ */ jsx24("div", { className: `flex items-center justify-center p-4 ${className}`, children: /* @__PURE__ */ jsx24("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) });
3578
+ return /* @__PURE__ */ jsx23("div", { className: `flex items-center justify-center p-4 ${className}`, children: /* @__PURE__ */ jsx23("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) });
3664
3579
  }
3665
3580
  if ((category || displayOnly) && fileReference) {
3666
3581
  const isImage = fileReference.file_metadata.fileType?.startsWith("image/");
3667
3582
  if (displayOnly && isImage && !showDelete) {
3668
3583
  if (imageError && showFallback) {
3669
- return /* @__PURE__ */ jsx24("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
3584
+ return /* @__PURE__ */ jsx23("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
3670
3585
  }
3671
3586
  if (!fileUrl) {
3672
- return /* @__PURE__ */ jsx24("div", { className: `bg-sec-100 rounded animate-pulse ${className || "max-w-full h-48"}`, children: /* @__PURE__ */ jsx24("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ jsx24("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) }) });
3587
+ return /* @__PURE__ */ jsx23("div", { className: `bg-sec-100 rounded animate-pulse ${className || "max-w-full h-48"}`, children: /* @__PURE__ */ jsx23("div", { className: "w-full h-full flex items-center justify-center", children: /* @__PURE__ */ jsx23("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-main-500" }) }) });
3673
3588
  }
3674
- return /* @__PURE__ */ jsx24(
3589
+ return /* @__PURE__ */ jsx23(
3675
3590
  "img",
3676
3591
  {
3677
3592
  src: fileUrl,
@@ -3682,11 +3597,11 @@ function FileDisplayContent({
3682
3597
  );
3683
3598
  }
3684
3599
  if (displayOnly && showFallback && (!fileUrl || imageError || !isImage)) {
3685
- return /* @__PURE__ */ jsx24("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
3600
+ return /* @__PURE__ */ jsx23("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
3686
3601
  }
3687
3602
  return /* @__PURE__ */ jsxs17("div", { className: `space-y-2 ${className}`, children: [
3688
3603
  isImage && fileUrl && !imageError ? /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
3689
- /* @__PURE__ */ jsx24(
3604
+ /* @__PURE__ */ jsx23(
3690
3605
  "img",
3691
3606
  {
3692
3607
  src: fileUrl,
@@ -3696,7 +3611,7 @@ function FileDisplayContent({
3696
3611
  }
3697
3612
  ),
3698
3613
  showDelete && /* @__PURE__ */ jsxs17(Fragment6, { children: [
3699
- /* @__PURE__ */ jsx24(
3614
+ /* @__PURE__ */ jsx23(
3700
3615
  "button",
3701
3616
  {
3702
3617
  onClick: handleDeleteClick,
@@ -3706,29 +3621,29 @@ function FileDisplayContent({
3706
3621
  children: "\xD7"
3707
3622
  }
3708
3623
  ),
3709
- /* @__PURE__ */ jsx24(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs17(DialogContent, { size: "sm", children: [
3710
- /* @__PURE__ */ jsx24(DialogHeader, { children: /* @__PURE__ */ jsx24(DialogTitle, { children: "Confirm Delete" }) }),
3711
- /* @__PURE__ */ jsx24(DialogBody, { children: /* @__PURE__ */ jsx24("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
3624
+ /* @__PURE__ */ jsx23(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs17(DialogContent, { size: "sm", children: [
3625
+ /* @__PURE__ */ jsx23(DialogHeader, { children: /* @__PURE__ */ jsx23(DialogTitle, { children: "Confirm Delete" }) }),
3626
+ /* @__PURE__ */ jsx23(DialogBody, { children: /* @__PURE__ */ jsx23("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
3712
3627
  /* @__PURE__ */ jsxs17(DialogFooter, { children: [
3713
- /* @__PURE__ */ jsx24(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
3714
- /* @__PURE__ */ jsx24(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
3628
+ /* @__PURE__ */ jsx23(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
3629
+ /* @__PURE__ */ jsx23(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
3715
3630
  ] })
3716
3631
  ] }) })
3717
3632
  ] })
3718
3633
  ] }) : isImage && imageError && showFallback ? (
3719
3634
  // Show fallback when image fails to load and fallback is enabled
3720
- /* @__PURE__ */ jsx24("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText })
3635
+ /* @__PURE__ */ jsx23("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText })
3721
3636
  ) : /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
3722
- /* @__PURE__ */ jsx24("span", { className: "text-2xl", children: getFileIcon(fileReference.file_metadata.fileType || "") }),
3637
+ /* @__PURE__ */ jsx23("span", { className: "text-2xl", children: getFileIcon(fileReference.file_metadata.fileType || "") }),
3723
3638
  /* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
3724
- /* @__PURE__ */ jsx24("div", { className: "font-medium text-sec-900 truncate", children: fileReference.file_metadata.fileName || "Unknown file" }),
3639
+ /* @__PURE__ */ jsx23("div", { className: "font-medium text-sec-900 truncate", children: fileReference.file_metadata.fileName || "Unknown file" }),
3725
3640
  /* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
3726
3641
  fileReference.file_metadata.fileSize && formatFileSize(fileReference.file_metadata.fileSize),
3727
3642
  fileReference.file_metadata.fileType && ` \u2022 ${fileReference.file_metadata.fileType}`
3728
3643
  ] })
3729
3644
  ] }),
3730
3645
  showDelete && /* @__PURE__ */ jsxs17(Fragment6, { children: [
3731
- /* @__PURE__ */ jsx24(
3646
+ /* @__PURE__ */ jsx23(
3732
3647
  "button",
3733
3648
  {
3734
3649
  onClick: handleDeleteClick,
@@ -3738,12 +3653,12 @@ function FileDisplayContent({
3738
3653
  children: "\xD7"
3739
3654
  }
3740
3655
  ),
3741
- /* @__PURE__ */ jsx24(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs17(DialogContent, { size: "sm", children: [
3742
- /* @__PURE__ */ jsx24(DialogHeader, { children: /* @__PURE__ */ jsx24(DialogTitle, { children: "Confirm Delete" }) }),
3743
- /* @__PURE__ */ jsx24(DialogBody, { children: /* @__PURE__ */ jsx24("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
3656
+ /* @__PURE__ */ jsx23(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs17(DialogContent, { size: "sm", children: [
3657
+ /* @__PURE__ */ jsx23(DialogHeader, { children: /* @__PURE__ */ jsx23(DialogTitle, { children: "Confirm Delete" }) }),
3658
+ /* @__PURE__ */ jsx23(DialogBody, { children: /* @__PURE__ */ jsx23("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
3744
3659
  /* @__PURE__ */ jsxs17(DialogFooter, { children: [
3745
- /* @__PURE__ */ jsx24(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
3746
- /* @__PURE__ */ jsx24(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
3660
+ /* @__PURE__ */ jsx23(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
3661
+ /* @__PURE__ */ jsx23(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
3747
3662
  ] })
3748
3663
  ] }) })
3749
3664
  ] })
@@ -3757,7 +3672,7 @@ function FileDisplayContent({
3757
3672
  const fileUrl2 = internalFileUrls.get(fileRef.id) || null;
3758
3673
  const canDownload = !isImage && fileUrl2;
3759
3674
  return /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
3760
- isImage && fileUrl2 ? /* @__PURE__ */ jsx24(
3675
+ isImage && fileUrl2 ? /* @__PURE__ */ jsx23(
3761
3676
  "img",
3762
3677
  {
3763
3678
  src: fileUrl2,
@@ -3765,9 +3680,9 @@ function FileDisplayContent({
3765
3680
  className: "w-12 h-12 object-cover rounded",
3766
3681
  onError: handleImageError
3767
3682
  }
3768
- ) : /* @__PURE__ */ jsx24("span", { className: "text-2xl", children: getFileIcon(fileRef.file_metadata.fileType || "") }),
3683
+ ) : /* @__PURE__ */ jsx23("span", { className: "text-2xl", children: getFileIcon(fileRef.file_metadata.fileType || "") }),
3769
3684
  /* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
3770
- /* @__PURE__ */ jsx24("div", { className: "font-medium text-sec-900 truncate", children: fileRef.file_metadata.fileName || "Unknown file" }),
3685
+ /* @__PURE__ */ jsx23("div", { className: "font-medium text-sec-900 truncate", children: fileRef.file_metadata.fileName || "Unknown file" }),
3771
3686
  /* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
3772
3687
  fileRef.file_metadata.fileSize && formatFileSize(fileRef.file_metadata.fileSize),
3773
3688
  fileRef.file_metadata.fileType && ` \u2022 ${fileRef.file_metadata.fileType}`,
@@ -3775,7 +3690,7 @@ function FileDisplayContent({
3775
3690
  ] })
3776
3691
  ] }),
3777
3692
  /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-2", children: [
3778
- canDownload && /* @__PURE__ */ jsx24(
3693
+ canDownload && /* @__PURE__ */ jsx23(
3779
3694
  "a",
3780
3695
  {
3781
3696
  href: fileRef.file_path,
@@ -3785,7 +3700,7 @@ function FileDisplayContent({
3785
3700
  children: "\u2193"
3786
3701
  }
3787
3702
  ),
3788
- showDelete && onDelete && /* @__PURE__ */ jsx24(
3703
+ showDelete && onDelete && /* @__PURE__ */ jsx23(
3789
3704
  "button",
3790
3705
  {
3791
3706
  onClick: handleDeleteClick,
@@ -3821,7 +3736,7 @@ function FileDisplayPublic({
3821
3736
  const supabase = publicPageContext?.supabase ?? null;
3822
3737
  if (!supabase) {
3823
3738
  if (showFallback) {
3824
- return /* @__PURE__ */ jsx24(
3739
+ return /* @__PURE__ */ jsx23(
3825
3740
  FileDisplayContent,
3826
3741
  {
3827
3742
  isLoading: false,
@@ -3847,7 +3762,7 @@ function FileDisplayPublic({
3847
3762
  }
3848
3763
  );
3849
3764
  }
3850
- return /* @__PURE__ */ jsx24("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in public context" });
3765
+ return /* @__PURE__ */ jsx23("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in public context" });
3851
3766
  }
3852
3767
  const {
3853
3768
  fileUrl,
@@ -3891,7 +3806,7 @@ function FileDisplayPublic({
3891
3806
  finalFileCount = 1;
3892
3807
  finalFileUrl = fileUrls.get(targetFile.id) || null;
3893
3808
  }
3894
- return /* @__PURE__ */ jsx24(
3809
+ return /* @__PURE__ */ jsx23(
3895
3810
  FileDisplayContent,
3896
3811
  {
3897
3812
  isLoading,
@@ -3935,7 +3850,7 @@ function FileDisplayAuthenticated({
3935
3850
  }) {
3936
3851
  const { supabase } = useUnifiedAuth();
3937
3852
  if (!supabase) {
3938
- return /* @__PURE__ */ jsx24("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in authenticated context" });
3853
+ return /* @__PURE__ */ jsx23("div", { className: `text-sec-500 text-center p-4 ${className}`, children: "Supabase client not available in authenticated context" });
3939
3854
  }
3940
3855
  const {
3941
3856
  fileUrl,
@@ -3993,7 +3908,7 @@ function FileDisplayAuthenticated({
3993
3908
  finalError = error || displayOnlyFileUrlHook.error;
3994
3909
  }
3995
3910
  }
3996
- return /* @__PURE__ */ jsx24(
3911
+ return /* @__PURE__ */ jsx23(
3997
3912
  FileDisplayContent,
3998
3913
  {
3999
3914
  isLoading: finalIsLoading,
@@ -4038,7 +3953,7 @@ function FileDisplay({
4038
3953
  }) {
4039
3954
  const isPublicPage = useIsPublicPage();
4040
3955
  if (isPublicPage) {
4041
- return /* @__PURE__ */ jsx24(
3956
+ return /* @__PURE__ */ jsx23(
4042
3957
  FileDisplayPublic,
4043
3958
  {
4044
3959
  table_name,
@@ -4058,7 +3973,7 @@ function FileDisplay({
4058
3973
  }
4059
3974
  );
4060
3975
  }
4061
- return /* @__PURE__ */ jsx24(
3976
+ return /* @__PURE__ */ jsx23(
4062
3977
  FileDisplayAuthenticated,
4063
3978
  {
4064
3979
  table_name,
@@ -4080,9 +3995,9 @@ function FileDisplay({
4080
3995
  }
4081
3996
 
4082
3997
  // src/components/Table/Table.tsx
4083
- import * as React21 from "react";
4084
- import { jsx as jsx25 } from "react/jsx-runtime";
4085
- var Table = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
3998
+ import * as React20 from "react";
3999
+ import { jsx as jsx24 } from "react/jsx-runtime";
4000
+ var Table = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4086
4001
  "table",
4087
4002
  {
4088
4003
  ref,
@@ -4091,9 +4006,9 @@ var Table = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
4091
4006
  }
4092
4007
  ));
4093
4008
  Table.displayName = "Table";
4094
- var TableHeader = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
4009
+ var TableHeader = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
4095
4010
  TableHeader.displayName = "TableHeader";
4096
- var TableBody = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
4011
+ var TableBody = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4097
4012
  "tbody",
4098
4013
  {
4099
4014
  ref,
@@ -4102,7 +4017,7 @@ var TableBody = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE_
4102
4017
  }
4103
4018
  ));
4104
4019
  TableBody.displayName = "TableBody";
4105
- var TableFooter = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
4020
+ var TableFooter = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4106
4021
  "tfoot",
4107
4022
  {
4108
4023
  ref,
@@ -4114,7 +4029,7 @@ var TableFooter = React21.forwardRef(({ className, ...props }, ref) => /* @__PUR
4114
4029
  }
4115
4030
  ));
4116
4031
  TableFooter.displayName = "TableFooter";
4117
- var TableRow = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
4032
+ var TableRow = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4118
4033
  "tr",
4119
4034
  {
4120
4035
  ref,
@@ -4126,7 +4041,7 @@ var TableRow = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__
4126
4041
  }
4127
4042
  ));
4128
4043
  TableRow.displayName = "TableRow";
4129
- var TableHead = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
4044
+ var TableHead = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4130
4045
  "th",
4131
4046
  {
4132
4047
  ref,
@@ -4138,7 +4053,7 @@ var TableHead = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE_
4138
4053
  }
4139
4054
  ));
4140
4055
  TableHead.displayName = "TableHead";
4141
- var TableCell = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
4056
+ var TableCell = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4142
4057
  "td",
4143
4058
  {
4144
4059
  ref,
@@ -4147,7 +4062,7 @@ var TableCell = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE_
4147
4062
  }
4148
4063
  ));
4149
4064
  TableCell.displayName = "TableCell";
4150
- var TableCaption = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx25(
4065
+ var TableCaption = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
4151
4066
  "caption",
4152
4067
  {
4153
4068
  ref,
@@ -4157,8 +4072,8 @@ var TableCaption = React21.forwardRef(({ className, ...props }, ref) => /* @__PU
4157
4072
  ));
4158
4073
  TableCaption.displayName = "TableCaption";
4159
4074
 
4160
- // src/components/PublicLayout/PublicPageHeader.tsx
4161
- import { Fragment as Fragment7, jsx as jsx26, jsxs as jsxs18 } from "react/jsx-runtime";
4075
+ // src/components/PublicLayout/PublicPageLayout.tsx
4076
+ import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
4162
4077
  function PublicPageHeader({
4163
4078
  event,
4164
4079
  eventCode,
@@ -4172,10 +4087,10 @@ function PublicPageHeader({
4172
4087
  }) {
4173
4088
  const { appName } = useAppConfig();
4174
4089
  return /* @__PURE__ */ jsxs18("header", { className: cn(
4175
- "w-full px-[max(0rem,calc((100vw-var(--app-width))/2-0.5rem))] grid grid-cols-[auto_1fr_auto] place-items-center gap-2",
4090
+ "w-full px-[max(0rem,calc((100vw-var(--app-width))/2-0.5rem))] grid grid-cols-[auto_1fr_auto] place-items-center gap-2",
4176
4091
  className
4177
4092
  ), children: [
4178
- showAppLogo && appName && /* @__PURE__ */ jsx26(
4093
+ showAppLogo && appName && /* @__PURE__ */ jsx25(
4179
4094
  "img",
4180
4095
  {
4181
4096
  className: "ml-4 max-w-36 object-contain row-span-2",
@@ -4184,8 +4099,8 @@ function PublicPageHeader({
4184
4099
  }
4185
4100
  ),
4186
4101
  event && /* @__PURE__ */ jsxs18(Fragment7, { children: [
4187
- /* @__PURE__ */ jsx26("h1", { children: event.event_name }),
4188
- showEventLogo && event && /* @__PURE__ */ jsx26(Fragment7, { children: customEventLogo || /* @__PURE__ */ jsx26(Fragment7, { children: /* @__PURE__ */ jsx26(
4102
+ /* @__PURE__ */ jsx25("h1", { children: event.event_name }),
4103
+ showEventLogo && event && /* @__PURE__ */ jsx25(Fragment7, { children: customEventLogo || /* @__PURE__ */ jsx25(
4189
4104
  FileDisplay,
4190
4105
  {
4191
4106
  table_name: "event",
@@ -4201,19 +4116,16 @@ function PublicPageHeader({
4201
4116
  return event.event_name.split(/[\s\-_]+/).map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
4202
4117
  }
4203
4118
  }
4204
- ) }) }),
4205
- event.event_venue && /* @__PURE__ */ jsx26("h4", { children: event.event_venue })
4119
+ ) }),
4120
+ event.event_venue && /* @__PURE__ */ jsx25("h4", { children: event.event_venue })
4206
4121
  ] }),
4207
4122
  title && /* @__PURE__ */ jsxs18(Fragment7, { children: [
4208
- /* @__PURE__ */ jsx26("h1", { children: title }),
4209
- description && /* @__PURE__ */ jsx26("p", { className: "text-lg text-sec-600 max-w-3xl mx-auto", children: description })
4123
+ /* @__PURE__ */ jsx25("h1", { children: title }),
4124
+ description && /* @__PURE__ */ jsx25("p", { className: "text-lg text-sec-600 max-w-3xl mx-auto", children: description })
4210
4125
  ] }),
4211
- children && /* @__PURE__ */ jsx26(Fragment7, { children })
4126
+ children && /* @__PURE__ */ jsx25(Fragment7, { children })
4212
4127
  ] });
4213
4128
  }
4214
-
4215
- // src/components/PublicLayout/PublicPageFooter.tsx
4216
- import { Fragment as Fragment8, jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
4217
4129
  function PublicPageFooter({
4218
4130
  event,
4219
4131
  companyName = "Solvera Solutions Pty Ltd",
@@ -4225,114 +4137,13 @@ function PublicPageFooter({
4225
4137
  children
4226
4138
  }) {
4227
4139
  const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
4228
- return /* @__PURE__ */ jsx27("footer", { className: cn("mt-8 py-6 flex justify-center", className), children: /* @__PURE__ */ jsxs19("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
4229
- logo && /* @__PURE__ */ jsx27("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
4230
- children && /* @__PURE__ */ jsx27(Fragment8, { children }),
4231
- /* @__PURE__ */ jsx27("span", { className: "text-muted-foreground", children: copyrightText }),
4232
- links && links.length > 0 && /* @__PURE__ */ jsx27("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx27("li", { children: /* @__PURE__ */ jsx27("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
4233
- ] }) });
4234
- }
4235
-
4236
- // src/components/PublicLayout/PublicLoadingSpinner.tsx
4237
- import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
4238
- var sizeClasses = {
4239
- sm: "h-4 w-4",
4240
- md: "h-8 w-8",
4241
- lg: "h-12 w-12",
4242
- xl: "h-16 w-16"
4243
- };
4244
- function PublicLoadingSpinner({
4245
- message = "Loading...",
4246
- size = "md",
4247
- className = "",
4248
- showLogo = true,
4249
- customMessage,
4250
- centered = true
4251
- }) {
4252
- const sizeClass = sizeClasses[size];
4253
- const displayMessage = customMessage || message;
4254
- const content = /* @__PURE__ */ jsxs20("div", { className: cn("flex flex-col items-center", className), children: [
4255
- showLogo && /* @__PURE__ */ jsx28("div", { className: "mb-4", children: /* @__PURE__ */ jsx28(
4256
- "img",
4257
- {
4258
- className: "h-8 w-auto",
4259
- src: "/pace_logo_wide.svg",
4260
- alt: "PACE Core"
4261
- }
4262
- ) }),
4263
- /* @__PURE__ */ jsxs20("div", { className: "relative", children: [
4264
- /* @__PURE__ */ jsx28(
4265
- "div",
4266
- {
4267
- className: cn(
4268
- sizeClass,
4269
- "border-2 border-sec-200 border-t-main-600 rounded-full animate-spin"
4270
- ),
4271
- role: "status",
4272
- "aria-label": "Loading"
4273
- }
4274
- ),
4275
- /* @__PURE__ */ jsx28("span", { className: "sr-only", children: displayMessage })
4276
- ] }),
4277
- displayMessage && /* @__PURE__ */ jsx28("p", { className: "mt-4 text-sm text-sec-600 text-center", children: displayMessage })
4278
- ] });
4279
- if (centered) {
4280
- return /* @__PURE__ */ jsx28("div", { className: "min-h-screen bg-background flex items-center justify-center", children: /* @__PURE__ */ jsx28("div", { className: "max-w-md mx-auto px-4", children: content }) });
4281
- }
4282
- return content;
4283
- }
4284
- function PublicLoadingSpinnerFullPage({
4285
- message = "Loading event details...",
4286
- eventName,
4287
- className = ""
4288
- }) {
4289
- return /* @__PURE__ */ jsx28("div", { className: cn(
4290
- "min-h-screen bg-background flex items-center justify-center",
4291
- className
4292
- ), children: /* @__PURE__ */ jsxs20("div", { className: "max-w-md mx-auto text-center px-4", children: [
4293
- /* @__PURE__ */ jsx28("div", { className: "mb-8", children: /* @__PURE__ */ jsx28(
4294
- "img",
4295
- {
4296
- className: "h-12 w-auto mx-auto",
4297
- src: "/pace_logo_wide.svg",
4298
- alt: "PACE Core"
4299
- }
4300
- ) }),
4301
- eventName && /* @__PURE__ */ jsx28("h1", { className: "text-2xl font-bold text-sec-900 mb-4", children: eventName }),
4302
- /* @__PURE__ */ jsx28("div", { className: "relative mb-6", children: /* @__PURE__ */ jsx28(
4303
- "div",
4304
- {
4305
- className: "h-12 w-12 border-4 border-sec-200 border-t-main-600 rounded-full animate-spin mx-auto",
4306
- role: "status",
4307
- "aria-label": "Loading"
4308
- }
4309
- ) }),
4310
- /* @__PURE__ */ jsx28("p", { className: "text-lg text-sec-600", children: message }),
4311
- /* @__PURE__ */ jsxs20("div", { className: "mt-4 flex justify-center space-x-1", children: [
4312
- /* @__PURE__ */ jsx28("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
4313
- /* @__PURE__ */ jsx28("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
4314
- /* @__PURE__ */ jsx28("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
4315
- ] })
4140
+ return /* @__PURE__ */ jsx25("footer", { className: cn("mt-8 py-6 flex justify-center", className), children: /* @__PURE__ */ jsxs18("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
4141
+ logo && /* @__PURE__ */ jsx25("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
4142
+ children && /* @__PURE__ */ jsx25(Fragment7, { children }),
4143
+ /* @__PURE__ */ jsx25("span", { className: "text-muted-foreground", children: copyrightText }),
4144
+ 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)) })
4316
4145
  ] }) });
4317
4146
  }
4318
- function PublicLoadingSkeleton({
4319
- lines = 3,
4320
- className = ""
4321
- }) {
4322
- return /* @__PURE__ */ jsx28("div", { className: cn("animate-pulse", className), children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx28(
4323
- "div",
4324
- {
4325
- className: cn(
4326
- "h-4 bg-sec-200 rounded mb-2",
4327
- index === lines - 1 ? "w-3/4" : "w-full"
4328
- )
4329
- },
4330
- index
4331
- )) });
4332
- }
4333
-
4334
- // src/components/PublicLayout/PublicPageLayout.tsx
4335
- import { Fragment as Fragment9, jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
4336
4147
  function PublicPageLayout({
4337
4148
  eventCode,
4338
4149
  children,
@@ -4343,7 +4154,7 @@ function PublicPageLayout({
4343
4154
  showFooter = true,
4344
4155
  className = "",
4345
4156
  errorFallback: ErrorFallback,
4346
- loadingFallback: LoadingFallback = PublicLoadingSpinner,
4157
+ loadingFallback: LoadingFallback,
4347
4158
  customHeader,
4348
4159
  customFooter,
4349
4160
  showValidationErrors = true,
@@ -4353,213 +4164,49 @@ function PublicPageLayout({
4353
4164
  const handleRefetch = refetch || (async () => {
4354
4165
  });
4355
4166
  if (isLoading) {
4356
- if (LoadingFallback === PublicLoadingSpinner) {
4357
- return /* @__PURE__ */ jsx29(
4358
- PublicLoadingSpinner,
4359
- {
4360
- className: "items-center justify-center",
4361
- message: loadingMessage
4362
- }
4363
- );
4167
+ if (LoadingFallback) {
4168
+ return /* @__PURE__ */ jsx25(LoadingFallback, {});
4364
4169
  }
4365
- return /* @__PURE__ */ jsx29(LoadingFallback, {});
4170
+ return /* @__PURE__ */ jsx25("div", { className: "min-h-screen bg-background flex items-center justify-center", children: /* @__PURE__ */ jsxs18("div", { className: "max-w-md mx-auto text-center px-4", children: [
4171
+ /* @__PURE__ */ jsx25(LoadingSpinner, { size: "lg", className: "mx-auto mb-4" }),
4172
+ loadingMessage && /* @__PURE__ */ jsx25("p", { className: "text-sec-600", children: loadingMessage })
4173
+ ] }) });
4366
4174
  }
4367
4175
  if (error && showValidationErrors) {
4368
4176
  if (ErrorFallback) {
4369
- return /* @__PURE__ */ jsx29(ErrorFallback, { error, retry: handleRefetch });
4177
+ return /* @__PURE__ */ jsx25(ErrorFallback, { error, retry: handleRefetch });
4370
4178
  }
4371
- return /* @__PURE__ */ jsxs21("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
4372
- /* @__PURE__ */ jsx29("h1", { children: "Event Not Found" }),
4373
- /* @__PURE__ */ jsxs21("p", { children: [
4179
+ return /* @__PURE__ */ jsxs18("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
4180
+ /* @__PURE__ */ jsx25("h1", { children: "Event Not Found" }),
4181
+ /* @__PURE__ */ jsxs18("p", { children: [
4374
4182
  'The event code "',
4375
4183
  eventCode,
4376
4184
  '" is invalid or the event is not available for public viewing.'
4377
4185
  ] }),
4378
- /* @__PURE__ */ jsx29(Button, { onClick: handleRefetch, children: "Try Again" })
4186
+ /* @__PURE__ */ jsx25(Button, { onClick: handleRefetch, children: "Try Again" })
4379
4187
  ] });
4380
4188
  }
4381
4189
  if (!event && showValidationErrors) {
4382
- return /* @__PURE__ */ jsxs21("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
4383
- /* @__PURE__ */ jsx29("h1", { children: "Event Not Available" }),
4384
- /* @__PURE__ */ jsx29("p", { children: "This event is not available for public viewing." }),
4385
- handleRefetch && /* @__PURE__ */ jsx29(Button, { onClick: handleRefetch, children: "Try Again" })
4190
+ return /* @__PURE__ */ jsxs18("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
4191
+ /* @__PURE__ */ jsx25("h1", { children: "Event Not Available" }),
4192
+ /* @__PURE__ */ jsx25("p", { children: "This event is not available for public viewing." }),
4193
+ handleRefetch && /* @__PURE__ */ jsx25(Button, { onClick: handleRefetch, children: "Try Again" })
4386
4194
  ] });
4387
4195
  }
4388
- return /* @__PURE__ */ jsx29(PublicErrorBoundary, { children: /* @__PURE__ */ jsxs21(Fragment9, { children: [
4389
- customHeader || /* @__PURE__ */ jsx29(
4196
+ return /* @__PURE__ */ jsx25(ErrorBoundary, { componentName: "PublicPageLayout", children: /* @__PURE__ */ jsxs18(Fragment7, { children: [
4197
+ customHeader || /* @__PURE__ */ jsx25(
4390
4198
  PublicPageHeader,
4391
4199
  {
4392
4200
  event: event || void 0,
4393
4201
  eventCode
4394
4202
  }
4395
4203
  ),
4396
- /* @__PURE__ */ jsx29("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children }),
4397
- showFooter && event && (customFooter || /* @__PURE__ */ jsx29(PublicPageFooter, { event }))
4204
+ /* @__PURE__ */ jsx25("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children }),
4205
+ showFooter && event && (customFooter || /* @__PURE__ */ jsx25(PublicPageFooter, { event }))
4398
4206
  ] }) });
4399
4207
  }
4400
- function usePublicPageContext2() {
4401
- return {
4402
- eventCode: null,
4403
- eventId: null,
4404
- event: null,
4405
- isLoading: false,
4406
- error: null,
4407
- refetch: async () => {
4408
- },
4409
- isPublicPage: true
4410
- };
4411
- }
4412
-
4413
- // src/components/PublicLayout/PublicPageContextChecker.tsx
4414
- import { useEffect as useEffect9 } from "react";
4415
- init_logger();
4416
- import { jsx as jsx30, jsxs as jsxs22 } from "react/jsx-runtime";
4417
- function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
4418
- const isDebugEnabled = import.meta.env.MODE === "development" && import.meta.env.VITE_ENABLE_DEBUG_LOGS === "true" || import.meta.env.MODE === "test" || import.meta.env.VITEST === true || typeof process !== "undefined" && false;
4419
- if (!isDebugEnabled || !enabled) {
4420
- return null;
4421
- }
4422
- useEffect9(() => {
4423
- logger.debug("PublicPageContextChecker", `\u{1F6A8} [${label}] PUBLIC PAGE CONTEXT CHECK`);
4424
- try {
4425
- const { isAuthenticated } = (init_UnifiedAuthProvider2(), __toCommonJS(UnifiedAuthProvider_exports)).useUnifiedAuth();
4426
- logger.error("PublicPageContextChecker", `\u274C [${label}] AUTHENTICATION CONTEXT DETECTED!`);
4427
- logger.error("PublicPageContextChecker", `\u274C [${label}] isAuthenticated:`, isAuthenticated);
4428
- logger.error("PublicPageContextChecker", `\u274C [${label}] This public page is inside UnifiedAuthProvider - THIS IS WRONG!`);
4429
- logger.error("PublicPageContextChecker", `\u274C [${label}] SOLUTION: Move public routes outside of authentication providers`);
4430
- } catch (error) {
4431
- logger.debug("PublicPageContextChecker", `\u2705 [${label}] No authentication context detected (GOOD!)`);
4432
- }
4433
- try {
4434
- const { selectedOrganisation } = (init_OrganisationProvider(), __toCommonJS(OrganisationProvider_exports)).useOrganisations();
4435
- logger.error("PublicPageContextChecker", `\u274C [${label}] ORGANISATION CONTEXT DETECTED!`);
4436
- logger.error("PublicPageContextChecker", `\u274C [${label}] selectedOrganisation:`, selectedOrganisation);
4437
- logger.error("PublicPageContextChecker", `\u274C [${label}] This public page is inside OrganisationProvider - THIS IS WRONG!`);
4438
- logger.error("PublicPageContextChecker", `\u274C [${label}] SOLUTION: Move public routes outside of authentication providers`);
4439
- } catch (error) {
4440
- logger.debug("PublicPageContextChecker", `\u2705 [${label}] No organisation context detected (GOOD!)`);
4441
- }
4442
- try {
4443
- const { events } = (init_EventProvider(), __toCommonJS(EventProvider_exports)).useEvents();
4444
- logger.error("PublicPageContextChecker", `\u274C [${label}] EVENT CONTEXT DETECTED!`);
4445
- logger.error("PublicPageContextChecker", `\u274C [${label}] events:`, events);
4446
- logger.error("PublicPageContextChecker", `\u274C [${label}] This public page is inside EventProvider - THIS IS WRONG!`);
4447
- logger.error("PublicPageContextChecker", `\u274C [${label}] SOLUTION: Move public routes outside of authentication providers`);
4448
- } catch (error) {
4449
- logger.debug("PublicPageContextChecker", `\u2705 [${label}] No event context detected (GOOD!)`);
4450
- }
4451
- try {
4452
- const { isPublicPage } = usePublicPageContext();
4453
- if (isPublicPage) {
4454
- logger.debug("PublicPageContextChecker", `\u2705 [${label}] Public page context detected (GOOD!)`);
4455
- } else {
4456
- logger.warn("PublicPageContextChecker", `\u26A0\uFE0F [${label}] Not in PublicPageProvider context`);
4457
- logger.warn("PublicPageContextChecker", `\u26A0\uFE0F [${label}] SOLUTION: Wrap your public page in <PublicPageProvider>`);
4458
- }
4459
- } catch (error) {
4460
- logger.warn("PublicPageContextChecker", `\u26A0\uFE0F [${label}] Not in PublicPageProvider context`);
4461
- logger.warn("PublicPageContextChecker", `\u26A0\uFE0F [${label}] SOLUTION: Wrap your public page in <PublicPageProvider>`);
4462
- }
4463
- logger.debug("PublicPageContextChecker", `\u{1F4D6} [${label}] IMMEDIATE ACTION REQUIRED`);
4464
- logger.debug("PublicPageContextChecker", `If you see any \u274C errors above, your public page is inside authentication context.`);
4465
- logger.debug("PublicPageContextChecker", `This will cause infinite loading loops and authentication errors.`);
4466
- logger.debug("PublicPageContextChecker", `\u{1F527} SOLUTION: Check your main App.tsx file`);
4467
- logger.debug("PublicPageContextChecker", `Make sure public routes are completely separate from authentication providers`);
4468
- logger.debug("PublicPageContextChecker", `Follow the architecture in: packages/core/docs/public-pages-guide.md`);
4469
- }, [enabled, label]);
4470
- return /* @__PURE__ */ jsxs22("div", { style: {
4471
- position: "fixed",
4472
- top: 0,
4473
- left: 0,
4474
- background: "rgba(220, 38, 38, 0.95)",
4475
- color: "white",
4476
- padding: "12px",
4477
- fontSize: "12px",
4478
- zIndex: 9999,
4479
- fontFamily: "monospace",
4480
- maxWidth: "400px",
4481
- borderRadius: "0 0 8px 0",
4482
- border: "2px solid #dc2626"
4483
- }, children: [
4484
- /* @__PURE__ */ jsx30("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F6A8} PUBLIC PAGE CONTEXT CHECK" }),
4485
- /* @__PURE__ */ jsx30("div", { children: "Check console for authentication context analysis" }),
4486
- /* @__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!" })
4487
- ] });
4488
- }
4489
-
4490
- // src/components/PublicLayout/EventLogo.tsx
4491
- import React23 from "react";
4492
- import { jsx as jsx31 } from "react/jsx-runtime";
4493
- function defaultGenerateFallbackText2(eventName) {
4494
- if (!eventName) return "EV";
4495
- return eventName.split(" ").map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
4496
- }
4497
- function EventLogo({
4498
- eventId,
4499
- eventName,
4500
- organisationId,
4501
- size = "md",
4502
- className = "",
4503
- showFallback = true,
4504
- generateFallbackText = defaultGenerateFallbackText2,
4505
- validateImage = true,
4506
- // Deprecated but kept for backward compatibility
4507
- loadingComponent: LoadingComponent,
4508
- errorComponent: ErrorComponent
4509
- }) {
4510
- const adaptedGenerateFallbackText = React23.useCallback(
4511
- (fileName) => {
4512
- return generateFallbackText(eventName || fileName || "");
4513
- },
4514
- [eventName, generateFallbackText]
4515
- );
4516
- const adaptedErrorComponent = ErrorComponent ? React23.useCallback(
4517
- ({ error }) => {
4518
- const errorObj = error instanceof Error ? error : new Error(String(error || "Unknown error"));
4519
- return /* @__PURE__ */ jsx31(ErrorComponent, { error: errorObj });
4520
- },
4521
- [ErrorComponent]
4522
- ) : void 0;
4523
- return /* @__PURE__ */ jsx31(
4524
- FileDisplay,
4525
- {
4526
- table_name: "event",
4527
- record_id: eventId,
4528
- organisation_id: organisationId,
4529
- category: "event_logos" /* EVENT_LOGOS */,
4530
- displayOnly: true,
4531
- showFallback,
4532
- fallbackSize: size,
4533
- className,
4534
- generateFallbackText: adaptedGenerateFallbackText,
4535
- loadingComponent: LoadingComponent,
4536
- errorComponent: adaptedErrorComponent
4537
- }
4538
- );
4539
- }
4540
- function EventLogoCompact(props) {
4541
- return /* @__PURE__ */ jsx31(
4542
- EventLogo,
4543
- {
4544
- ...props,
4545
- size: "sm",
4546
- className: `${props.className || ""} rounded-sm`
4547
- }
4548
- );
4549
- }
4550
- function EventLogoLarge(props) {
4551
- return /* @__PURE__ */ jsx31(
4552
- EventLogo,
4553
- {
4554
- ...props,
4555
- size: "xl",
4556
- className: `${props.className || ""} rounded-lg`
4557
- }
4558
- );
4559
- }
4560
4208
 
4561
4209
  export {
4562
- init_EventProvider,
4563
4210
  Label,
4564
4211
  Textarea,
4565
4212
  Avatar,
@@ -4581,6 +4228,7 @@ export {
4581
4228
  ToastDescription,
4582
4229
  Toaster,
4583
4230
  Form,
4231
+ FormField,
4584
4232
  LoginForm,
4585
4233
  EventSelector,
4586
4234
  PasswordChangeForm,
@@ -4592,7 +4240,6 @@ export {
4592
4240
  PaceLoginPage,
4593
4241
  SessionRestorationLoader,
4594
4242
  ProtectedRoute,
4595
- ErrorBoundary,
4596
4243
  OrganisationSelector,
4597
4244
  useFileReference,
4598
4245
  useFileReferenceForRecord,
@@ -4610,14 +4257,6 @@ export {
4610
4257
  TableCaption,
4611
4258
  PublicPageHeader,
4612
4259
  PublicPageFooter,
4613
- PublicLoadingSpinner,
4614
- PublicLoadingSpinnerFullPage,
4615
- PublicLoadingSkeleton,
4616
- PublicPageLayout,
4617
- usePublicPageContext2 as usePublicPageContext,
4618
- PublicPageContextChecker,
4619
- EventLogo,
4620
- EventLogoCompact,
4621
- EventLogoLarge
4260
+ PublicPageLayout
4622
4261
  };
4623
- //# sourceMappingURL=chunk-D7LCGMVS.js.map
4262
+ //# sourceMappingURL=chunk-QETLRQI6.js.map