@jmruthers/pace-core 0.2.7 → 0.4.1

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 (982) hide show
  1. package/CHANGELOG.md +1 -26
  2. package/README.md +229 -231
  3. package/dist/{DataTable-EEUDXPE5.js → DataTable-2LB6HI6V.js} +17 -10
  4. package/dist/{DataTable-C1AEm9Cx.d.ts → DataTable-BDBqkU-i.d.ts} +51 -23
  5. package/dist/{PublicLoadingSpinner-DztrzuJr.d.ts → Table-CIm9IWqk.d.ts} +122 -635
  6. package/dist/UnifiedAuthProvider-V7y63NjT.d.ts +88 -0
  7. package/dist/{api-ETQ6YJ3C.js → api-AIJ3IJX3.js} +4 -6
  8. package/dist/{appConfig-BVGyuvI7.d.ts → appConfig-fB1pP_v3.d.ts} +1 -1
  9. package/dist/{audit-BUW3LMJB.js → audit-PD5L5ZSC.js} +3 -3
  10. package/dist/{chunk-ETEJVKYK.js → chunk-4MCJAK7J.js} +4927 -504
  11. package/dist/chunk-4MCJAK7J.js.map +1 -0
  12. package/dist/{chunk-CDQ3PX7L.js → chunk-4ZTIEYU2.js} +1 -1
  13. package/dist/chunk-4ZTIEYU2.js.map +1 -0
  14. package/dist/{chunk-PLDDJCW6.js → chunk-DC5AMYBS.js} +5 -15
  15. package/dist/{chunk-HEMJ4SUJ.js → chunk-H4PZ4B3Y.js} +27 -124
  16. package/dist/chunk-H4PZ4B3Y.js.map +1 -0
  17. package/dist/{chunk-HNDFPXUU.js → chunk-IOX76PSM.js} +28 -270
  18. package/dist/chunk-IOX76PSM.js.map +1 -0
  19. package/dist/{chunk-TIVL4UQ7.js → chunk-JUUNUW3O.js} +5 -14
  20. package/dist/chunk-JUUNUW3O.js.map +1 -0
  21. package/dist/chunk-KK6WIDK6.js +63 -0
  22. package/dist/chunk-KK6WIDK6.js.map +1 -0
  23. package/dist/chunk-U7DY5T33.js +11 -0
  24. package/dist/chunk-U7DY5T33.js.map +1 -0
  25. package/dist/{chunk-SS3E6QLB.js → chunk-WHLSWC6W.js} +61 -16
  26. package/dist/chunk-WHLSWC6W.js.map +1 -0
  27. package/dist/chunk-XI7QFSSC.js +790 -0
  28. package/dist/chunk-XI7QFSSC.js.map +1 -0
  29. package/dist/chunk-XIJMMBDD.js +73 -0
  30. package/dist/chunk-XIJMMBDD.js.map +1 -0
  31. package/dist/{chunk-7BNPOCLL.js → chunk-YNU5QJ4S.js} +5 -22
  32. package/dist/chunk-YNU5QJ4S.js.map +1 -0
  33. package/dist/chunk-YWYCNGWH.js +2070 -0
  34. package/dist/chunk-YWYCNGWH.js.map +1 -0
  35. package/dist/chunk-ZJ3UKPIW.js +952 -0
  36. package/dist/chunk-ZJ3UKPIW.js.map +1 -0
  37. package/dist/components.d.ts +10 -906
  38. package/dist/components.js +77 -3255
  39. package/dist/components.js.map +1 -1
  40. package/dist/{database-C3Szpi5J.d.ts → database-CAMsquLm.d.ts} +11 -28
  41. package/dist/hooks.d.ts +6 -7
  42. package/dist/hooks.js +11 -35
  43. package/dist/hooks.js.map +1 -1
  44. package/dist/index.d.ts +111 -245
  45. package/dist/index.js +178 -187
  46. package/dist/index.js.map +1 -1
  47. package/dist/{organisation-CO3Sh3_D.d.ts → organisation-DLNNQhPB.d.ts} +1 -1
  48. package/dist/providers.d.ts +4 -4
  49. package/dist/providers.js +5 -19
  50. package/dist/rbac/index.d.ts +5 -61
  51. package/dist/rbac/index.js +93 -256
  52. package/dist/rbac/index.js.map +1 -1
  53. package/dist/{types-DiRQsGJs.d.ts → types-Bavn44NW.d.ts} +36 -71
  54. package/dist/types.d.ts +5 -5
  55. package/dist/types.js +2 -7
  56. package/dist/types.js.map +1 -1
  57. package/dist/{unified-CM7T0aTK.d.ts → unified-BtRpPbmp.d.ts} +2 -1
  58. package/dist/useAppConfig-CZNJJsT_.d.ts +148 -0
  59. package/dist/utils.d.ts +60 -83
  60. package/dist/utils.js +55633 -277
  61. package/dist/utils.js.map +1 -1
  62. package/dist/validation.d.ts +1 -1
  63. package/dist/validation.js +1 -1
  64. package/docs/README.md +32 -46
  65. package/docs/api/README.md +229 -231
  66. package/docs/api/classes/ErrorBoundary.md +1 -1
  67. package/docs/api/interfaces/AggregateConfig.md +4 -4
  68. package/docs/api/interfaces/ButtonProps.md +2 -2
  69. package/docs/api/interfaces/CardProps.md +2 -2
  70. package/docs/api/interfaces/ColorPalette.md +1 -1
  71. package/docs/api/interfaces/ColorShade.md +1 -1
  72. package/docs/api/interfaces/DataTableAction.md +7 -85
  73. package/docs/api/interfaces/DataTableColumn.md +12 -131
  74. package/docs/api/interfaces/DataTableProps.md +274 -64
  75. package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
  76. package/docs/api/interfaces/EmptyStateConfig.md +5 -5
  77. package/docs/api/interfaces/EventContextType.md +7 -7
  78. package/docs/api/interfaces/EventProviderProps.md +2 -2
  79. package/docs/api/interfaces/FooterProps.md +1 -1
  80. package/docs/api/interfaces/InputProps.md +2 -2
  81. package/docs/api/interfaces/LabelProps.md +1 -1
  82. package/docs/api/interfaces/LoginFormProps.md +1 -1
  83. package/docs/api/interfaces/NavigationItem.md +1 -1
  84. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  85. package/docs/api/interfaces/Organisation.md +1 -1
  86. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  87. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  88. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  89. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  90. package/docs/api/interfaces/PaceAppLayoutProps.md +26 -26
  91. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  92. package/docs/api/interfaces/PaletteData.md +1 -1
  93. package/docs/api/interfaces/StyleImport.md +2 -2
  94. package/docs/api/interfaces/ToastActionElement.md +1 -1
  95. package/docs/api/interfaces/ToastProps.md +1 -1
  96. package/docs/api/interfaces/UnifiedAuthContextType.md +46 -447
  97. package/docs/api/interfaces/UnifiedAuthProviderProps.md +9 -95
  98. package/docs/api/interfaces/UserEventAccess.md +14 -14
  99. package/docs/api/interfaces/UserMenuProps.md +6 -6
  100. package/docs/api/interfaces/UserProfile.md +1 -1
  101. package/docs/api/modules.md +773 -1631
  102. package/docs/api-reference/components.md +43 -761
  103. package/docs/api-reference/hooks.md +0 -126
  104. package/docs/api-reference/providers.md +65 -141
  105. package/docs/api-reference/types.md +36 -66
  106. package/docs/api-reference/utilities.md +1 -1
  107. package/docs/architecture/README.md +2 -1
  108. package/docs/consuming-app-example.md +96 -42
  109. package/docs/core-concepts/events.md +3 -3
  110. package/docs/core-concepts/organisations.md +1 -0
  111. package/docs/core-concepts/rbac-system.md +10 -23
  112. package/docs/documentation-style-checklist.md +2 -8
  113. package/docs/getting-started/examples/README.md +1 -15
  114. package/docs/getting-started/examples/basic-auth-app.md +119 -444
  115. package/docs/getting-started/examples/full-featured-app.md +6 -6
  116. package/docs/getting-started/installation.md +52 -231
  117. package/docs/getting-started/quick-start.md +24 -121
  118. package/docs/implementation-guides/app-layout.md +108 -133
  119. package/docs/implementation-guides/data-tables.md +29 -1011
  120. package/docs/implementation-guides/forms.md +3 -3
  121. package/docs/implementation-guides/large-datasets.md +2 -2
  122. package/docs/implementation-guides/navigation.md +1 -1
  123. package/docs/implementation-guides/permission-enforcement.md +4 -4
  124. package/docs/migration/README.md +8 -18
  125. package/docs/migration/rbac-migration.md +0 -50
  126. package/docs/migration-guide.md +104 -51
  127. package/docs/performance/README.md +4 -1
  128. package/docs/quick-reference.md +36 -53
  129. package/docs/rbac/README.md +69 -136
  130. package/docs/rbac/api-reference.md +8 -39
  131. package/docs/rbac/examples.md +66 -237
  132. package/docs/rbac/getting-started.md +16 -131
  133. package/docs/rbac/quick-start.md +323 -499
  134. package/docs/rbac/troubleshooting.md +262 -240
  135. package/docs/security/README.md +1 -50
  136. package/docs/styles/README.md +117 -143
  137. package/docs/testing/README.md +10 -6
  138. package/docs/troubleshooting/common-issues.md +14 -604
  139. package/docs/usage.md +90 -28
  140. package/docs/visual-testing.md +7 -0
  141. package/package.json +24 -43
  142. package/dist/UnifiedAuthProvider-w66zSCUf.d.ts +0 -160
  143. package/dist/appNameResolver-7GHF5ED2.js +0 -22
  144. package/dist/chunk-2V3Y6YBC.js +0 -114
  145. package/dist/chunk-2V3Y6YBC.js.map +0 -1
  146. package/dist/chunk-7BNPOCLL.js.map +0 -1
  147. package/dist/chunk-BEZRLNK3.js +0 -1744
  148. package/dist/chunk-BEZRLNK3.js.map +0 -1
  149. package/dist/chunk-C5G2A4PO.js +0 -1349
  150. package/dist/chunk-C5G2A4PO.js.map +0 -1
  151. package/dist/chunk-CDQ3PX7L.js.map +0 -1
  152. package/dist/chunk-ETEJVKYK.js.map +0 -1
  153. package/dist/chunk-EWKPTNPO.js +0 -5139
  154. package/dist/chunk-EWKPTNPO.js.map +0 -1
  155. package/dist/chunk-HEMJ4SUJ.js.map +0 -1
  156. package/dist/chunk-HNDFPXUU.js.map +0 -1
  157. package/dist/chunk-MZBUOP4P.js +0 -119
  158. package/dist/chunk-MZBUOP4P.js.map +0 -1
  159. package/dist/chunk-N2EUGZRW.js +0 -98
  160. package/dist/chunk-N2EUGZRW.js.map +0 -1
  161. package/dist/chunk-NQ4TOOO6.js +0 -20
  162. package/dist/chunk-NQ4TOOO6.js.map +0 -1
  163. package/dist/chunk-OHXGNT3K.js +0 -21
  164. package/dist/chunk-OHXGNT3K.js.map +0 -1
  165. package/dist/chunk-PLDDJCW6.js.map +0 -1
  166. package/dist/chunk-RRUYHORU.js +0 -3431
  167. package/dist/chunk-RRUYHORU.js.map +0 -1
  168. package/dist/chunk-SS3E6QLB.js.map +0 -1
  169. package/dist/chunk-TIVL4UQ7.js.map +0 -1
  170. package/dist/chunk-VYG4AXYW.js +0 -388
  171. package/dist/chunk-VYG4AXYW.js.map +0 -1
  172. package/dist/chunk-YDJW5XTN.js +0 -84
  173. package/dist/chunk-YDJW5XTN.js.map +0 -1
  174. package/dist/styles/core.css +0 -422
  175. package/dist/styles/fonts/georama-italic.woff2 +0 -0
  176. package/dist/styles/fonts/georama.woff2 +0 -0
  177. package/dist/styles/fonts/open-sans-italic.woff2 +0 -0
  178. package/dist/styles/fonts/open-sans.woff2 +0 -0
  179. package/dist/styles/fonts/reddit-mono.woff2 +0 -0
  180. package/dist/styles/index.d.ts +0 -36
  181. package/dist/styles/index.js +0 -24
  182. package/dist/styles/index.js.map +0 -1
  183. package/dist/theming/runtime.d.ts +0 -73
  184. package/dist/theming/runtime.js +0 -16
  185. package/dist/theming/runtime.js.map +0 -1
  186. package/dist/usePublicRouteParams-B6i0KtXW.d.ts +0 -477
  187. package/docs/INDEX.md +0 -192
  188. package/docs/api/classes/PublicErrorBoundary.md +0 -132
  189. package/docs/api/interfaces/EventLogoProps.md +0 -152
  190. package/docs/api/interfaces/FileSizeLimits.md +0 -7
  191. package/docs/api/interfaces/FileUploadProps.md +0 -154
  192. package/docs/api/interfaces/InactivityWarningModalProps.md +0 -115
  193. package/docs/api/interfaces/PublicErrorBoundaryProps.md +0 -94
  194. package/docs/api/interfaces/PublicErrorBoundaryState.md +0 -68
  195. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +0 -86
  196. package/docs/api/interfaces/PublicPageFooterProps.md +0 -112
  197. package/docs/api/interfaces/PublicPageHeaderProps.md +0 -138
  198. package/docs/api/interfaces/PublicPageLayoutProps.md +0 -138
  199. package/docs/api/interfaces/StorageConfig.md +0 -41
  200. package/docs/api/interfaces/StorageFileInfo.md +0 -74
  201. package/docs/api/interfaces/StorageFileMetadata.md +0 -140
  202. package/docs/api/interfaces/StorageListOptions.md +0 -86
  203. package/docs/api/interfaces/StorageListResult.md +0 -41
  204. package/docs/api/interfaces/StorageUploadOptions.md +0 -88
  205. package/docs/api/interfaces/StorageUploadResult.md +0 -63
  206. package/docs/api/interfaces/StorageUrlOptions.md +0 -47
  207. package/docs/api/interfaces/UseInactivityTrackerOptions.md +0 -136
  208. package/docs/api/interfaces/UseInactivityTrackerReturn.md +0 -123
  209. package/docs/api/interfaces/UsePublicEventLogoOptions.md +0 -87
  210. package/docs/api/interfaces/UsePublicEventLogoReturn.md +0 -81
  211. package/docs/api/interfaces/UsePublicEventOptions.md +0 -34
  212. package/docs/api/interfaces/UsePublicEventReturn.md +0 -68
  213. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +0 -94
  214. package/docs/best-practices/README.md +0 -400
  215. package/docs/consuming-app-vite-config.md +0 -233
  216. package/docs/examples/navigation-menu-auth-fix.md +0 -344
  217. package/docs/implementation-guides/hierarchical-datatable.md +0 -850
  218. package/docs/implementation-guides/public-pages.md +0 -752
  219. package/docs/migration/quick-migration-guide.md +0 -320
  220. package/docs/migration/v0.4.15-tailwind-scanning.md +0 -272
  221. package/docs/migration/v0.4.16-css-first-approach.md +0 -306
  222. package/docs/migration/v0.4.17-source-path-fix.md +0 -229
  223. package/docs/print-components/README.md +0 -258
  224. package/docs/print-components/api-reference.md +0 -636
  225. package/docs/print-components/examples/README.md +0 -204
  226. package/docs/print-components/examples/basic-report.tsx +0 -92
  227. package/docs/print-components/examples/card-catalog.tsx +0 -149
  228. package/docs/print-components/examples/cover-page-report.tsx +0 -163
  229. package/docs/print-components/quick-start.md +0 -363
  230. package/docs/troubleshooting/README.md +0 -497
  231. package/docs/troubleshooting/styling-issues.md +0 -219
  232. package/docs/troubleshooting/tailwind-content-scanning.md +0 -213
  233. package/src/__mocks__/lucide-react.ts +0 -181
  234. package/src/__tests__/README.md +0 -404
  235. package/src/__tests__/debug-provider.unit.test.tsx +0 -67
  236. package/src/__tests__/e2e/workflows.test.tsx +0 -373
  237. package/src/__tests__/hybridPermissions.unit.test.tsx +0 -474
  238. package/src/__tests__/index.integration.test.ts +0 -491
  239. package/src/__tests__/mocks/MockAuthProvider-standalone.tsx +0 -47
  240. package/src/__tests__/mocks/MockAuthProvider.tsx +0 -63
  241. package/src/__tests__/mocks/enhancedSupabaseMock.ts +0 -252
  242. package/src/__tests__/mocks/index.test.ts +0 -23
  243. package/src/__tests__/mocks/index.ts +0 -16
  244. package/src/__tests__/mocks/mockAuth.ts +0 -155
  245. package/src/__tests__/mocks/mockSupabase.ts +0 -83
  246. package/src/__tests__/mocks/mockSupabaseClient.ts +0 -63
  247. package/src/__tests__/mocks/providers.tsx +0 -22
  248. package/src/__tests__/patterns/__tests__/testPatterns.test.ts +0 -394
  249. package/src/__tests__/patterns/testPatterns.ts +0 -124
  250. package/src/__tests__/performance/componentPerformance.performance.test.ts +0 -27
  251. package/src/__tests__/performance/index.ts +0 -24
  252. package/src/__tests__/performance/performanceValidation.performance.test.ts +0 -15
  253. package/src/__tests__/security/security.unit.test.tsx +0 -7
  254. package/src/__tests__/security/securityValidation.security.test.tsx +0 -153
  255. package/src/__tests__/setup.ts +0 -259
  256. package/src/__tests__/setupTests.d.ts +0 -1
  257. package/src/__tests__/shared/componentTestUtils.tsx +0 -475
  258. package/src/__tests__/shared/errorHandlingTestUtils.ts +0 -107
  259. package/src/__tests__/shared/index.ts +0 -81
  260. package/src/__tests__/shared/integrationTestUtils.tsx +0 -375
  261. package/src/__tests__/shared/performanceTestUtils.tsx +0 -476
  262. package/src/__tests__/shared/testUtils.optimized.tsx +0 -685
  263. package/src/__tests__/simple.test.tsx +0 -20
  264. package/src/__tests__/templates/accessibility.test.template.tsx +0 -279
  265. package/src/__tests__/templates/component.test.template.tsx +0 -122
  266. package/src/__tests__/templates/integration.test.template.tsx +0 -199
  267. package/src/__tests__/test-utils/dataFactories.ts +0 -60
  268. package/src/__tests__/test-utils/index.ts +0 -6
  269. package/src/__tests__/typeSafety.unit.test.ts +0 -65
  270. package/src/__tests__/unifiedAuth.unit.test.tsx +0 -151
  271. package/src/__tests__/utils/accessibilityHelpers.ts +0 -254
  272. package/src/__tests__/utils/assertions.ts +0 -50
  273. package/src/__tests__/utils/deterministicHelpers.ts +0 -31
  274. package/src/__tests__/utils/edgeCaseConfig.test.ts +0 -75
  275. package/src/__tests__/utils/edgeCaseConfig.ts +0 -98
  276. package/src/__tests__/utils/mockHelpers.ts +0 -149
  277. package/src/__tests__/utils/mockLoader.ts +0 -101
  278. package/src/__tests__/utils/performanceHelpers.ts +0 -55
  279. package/src/__tests__/utils/performanceTestHelpers.ts +0 -68
  280. package/src/__tests__/utils/testDataFactories.ts +0 -28
  281. package/src/__tests__/utils/testIsolation.ts +0 -67
  282. package/src/__tests__/utils/visualTestHelpers.ts +0 -20
  283. package/src/__tests__/visual/__snapshots__/componentSnapshots.visual.test.tsx.snap +0 -68
  284. package/src/__tests__/visual/__snapshots__/componentVisuals.visual.test.tsx.snap +0 -14
  285. package/src/__tests__/visual/__snapshots__/visualRegression.test.tsx.snap +0 -217
  286. package/src/__tests__/visual/__snapshots__/visualRegression.visual.test.tsx.snap +0 -24
  287. package/src/__tests__/visual/componentSnapshots.visual.test.tsx +0 -33
  288. package/src/__tests__/visual/componentVisuals.visual.test.tsx +0 -12
  289. package/src/__tests__/visual/visualRegression.visual.test.tsx +0 -20
  290. package/src/components/Alert/Alert.tsx +0 -134
  291. package/src/components/Alert/__tests__/Alert.unit.test.tsx +0 -381
  292. package/src/components/Alert/index.ts +0 -2
  293. package/src/components/Avatar/Avatar.tsx +0 -84
  294. package/src/components/Avatar/__tests__/Avatar.unit.test.tsx +0 -232
  295. package/src/components/Avatar/index.ts +0 -2
  296. package/src/components/Button/Button.tsx +0 -270
  297. package/src/components/Button/__tests__/Button.accessibility.test.tsx +0 -131
  298. package/src/components/Button/__tests__/Button.comprehensive.test.tsx +0 -721
  299. package/src/components/Button/__tests__/Button.unit.test.tsx +0 -189
  300. package/src/components/Button/__tests__/EventSelector.integration.test.tsx +0 -285
  301. package/src/components/Button/index.ts +0 -2
  302. package/src/components/Card/Card.tsx +0 -271
  303. package/src/components/Card/__tests__/Card.accessibility.test.tsx +0 -394
  304. package/src/components/Card/__tests__/Card.comprehensive.test.tsx +0 -599
  305. package/src/components/Card/__tests__/Card.integration.test.tsx +0 -673
  306. package/src/components/Card/__tests__/Card.performance.test.tsx +0 -546
  307. package/src/components/Card/__tests__/Card.unit.test.tsx +0 -330
  308. package/src/components/Card/__tests__/Card.visual.test.tsx +0 -599
  309. package/src/components/Card/__tests__/README.md +0 -211
  310. package/src/components/Card/index.ts +0 -1
  311. package/src/components/Checkbox/Checkbox.tsx +0 -75
  312. package/src/components/Checkbox/__mocks__/Checkbox.tsx +0 -2
  313. package/src/components/Checkbox/__tests__/Checkbox.unit.test.tsx +0 -520
  314. package/src/components/Checkbox/index.ts +0 -2
  315. package/src/components/DataTable/DataTable.tsx +0 -438
  316. package/src/components/DataTable/__tests__/DataTable.errorHandling.test.tsx +0 -251
  317. package/src/components/DataTable/__tests__/DataTable.hierarchical.test.tsx +0 -680
  318. package/src/components/DataTable/__tests__/DataTable.infinite-loop.test.tsx +0 -323
  319. package/src/components/DataTable/__tests__/DataTable.integration.test.tsx +0 -716
  320. package/src/components/DataTable/__tests__/DataTable.performance.test.tsx +0 -589
  321. package/src/components/DataTable/__tests__/DataTable.permissions.test.tsx +0 -316
  322. package/src/components/DataTable/__tests__/DataTable.regressionFixes.test.tsx +0 -546
  323. package/src/components/DataTable/__tests__/DataTable.selection.controlled.test.tsx +0 -386
  324. package/src/components/DataTable/__tests__/DataTable.selection.test.tsx +0 -338
  325. package/src/components/DataTable/__tests__/DataTable.sorting.test.tsx +0 -321
  326. package/src/components/DataTable/__tests__/DataTable.userWorkflows.test.tsx +0 -320
  327. package/src/components/DataTable/__tests__/DataTable.workflowValidation.test.tsx +0 -583
  328. package/src/components/DataTable/__tests__/DataTable.workflows.test.tsx +0 -711
  329. package/src/components/DataTable/__tests__/README.md +0 -145
  330. package/src/components/DataTable/__tests__/mocks/MockRBACProvider.tsx +0 -66
  331. package/src/components/DataTable/__tests__/performance-regression.test.tsx +0 -777
  332. package/src/components/DataTable/__tests__/performance.test.tsx +0 -365
  333. package/src/components/DataTable/__tests__/test-utils/dataFactories.ts +0 -103
  334. package/src/components/DataTable/__tests__/test-utils/sharedTestUtils.tsx +0 -381
  335. package/src/components/DataTable/__tests__/test-utils.ts +0 -94
  336. package/src/components/DataTable/components/ActionButtons.tsx +0 -177
  337. package/src/components/DataTable/components/BulkOperationsDropdown.tsx +0 -160
  338. package/src/components/DataTable/components/ColumnFilter.tsx +0 -114
  339. package/src/components/DataTable/components/ColumnVisibilityDropdown.tsx +0 -100
  340. package/src/components/DataTable/components/DataTableBody.tsx +0 -461
  341. package/src/components/DataTable/components/DataTableCore.tsx +0 -941
  342. package/src/components/DataTable/components/DataTableErrorBoundary.tsx +0 -214
  343. package/src/components/DataTable/components/DataTableModals.tsx +0 -87
  344. package/src/components/DataTable/components/DataTableToolbar.tsx +0 -250
  345. package/src/components/DataTable/components/DraggableColumnHeader.tsx +0 -144
  346. package/src/components/DataTable/components/EditableRow.tsx +0 -159
  347. package/src/components/DataTable/components/EmptyState.tsx +0 -64
  348. package/src/components/DataTable/components/ExpandButton.tsx +0 -113
  349. package/src/components/DataTable/components/FilterRow.tsx +0 -100
  350. package/src/components/DataTable/components/GroupHeader.tsx +0 -42
  351. package/src/components/DataTable/components/GroupingDropdown.tsx +0 -96
  352. package/src/components/DataTable/components/ImportModal.tsx +0 -345
  353. package/src/components/DataTable/components/LoadingState.tsx +0 -12
  354. package/src/components/DataTable/components/PaginationControls.tsx +0 -332
  355. package/src/components/DataTable/components/UnifiedTableBody.tsx +0 -713
  356. package/src/components/DataTable/components/ViewRowModal.tsx +0 -68
  357. package/src/components/DataTable/components/VirtualizedDataTable.tsx +0 -513
  358. package/src/components/DataTable/components/__tests__/ActionButtons.unit.test.tsx +0 -150
  359. package/src/components/DataTable/components/__tests__/BulkOperationsDropdown.test.tsx +0 -224
  360. package/src/components/DataTable/components/__tests__/ColumnVisibilityDropdown.unit.test.tsx +0 -244
  361. package/src/components/DataTable/components/__tests__/DataTable.accessibility.test.tsx +0 -629
  362. package/src/components/DataTable/components/__tests__/DataTable.integration.test.tsx +0 -470
  363. package/src/components/DataTable/components/__tests__/DataTable.performance.test.tsx +0 -160
  364. package/src/components/DataTable/components/__tests__/DataTable.real.test.tsx +0 -251
  365. package/src/components/DataTable/components/__tests__/DataTable.security.test.tsx +0 -171
  366. package/src/components/DataTable/components/__tests__/DataTable.unit.test.tsx +0 -290
  367. package/src/components/DataTable/components/__tests__/DataTableBody.unit.test.tsx +0 -147
  368. package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.unit.test.tsx +0 -182
  369. package/src/components/DataTable/components/__tests__/DataTableModals.unit.test.tsx +0 -123
  370. package/src/components/DataTable/components/__tests__/EditableRow.unit.test.tsx +0 -660
  371. package/src/components/DataTable/components/__tests__/EmptyState.unit.test.tsx +0 -256
  372. package/src/components/DataTable/components/__tests__/ExpandButton.test.tsx +0 -498
  373. package/src/components/DataTable/components/__tests__/FilterRow.unit.test.tsx +0 -112
  374. package/src/components/DataTable/components/__tests__/FilteringToggle.unit.test.tsx +0 -133
  375. package/src/components/DataTable/components/__tests__/GroupHeader.unit.test.tsx +0 -172
  376. package/src/components/DataTable/components/__tests__/GroupingDropdown.unit.test.tsx +0 -222
  377. package/src/components/DataTable/components/__tests__/ImportModal.unit.test.tsx +0 -780
  378. package/src/components/DataTable/components/__tests__/LoadingState.unit.test.tsx +0 -65
  379. package/src/components/DataTable/components/__tests__/PaginationControls.unit.test.tsx +0 -634
  380. package/src/components/DataTable/components/__tests__/StateComponents.unit.test.tsx +0 -48
  381. package/src/components/DataTable/components/__tests__/UnifiedTableBody.hierarchical.test.tsx +0 -541
  382. package/src/components/DataTable/components/__tests__/ViewRowModal.unit.test.tsx +0 -228
  383. package/src/components/DataTable/components/__tests__/VirtualizedDataTable.unit.test.tsx +0 -568
  384. package/src/components/DataTable/components/index.ts +0 -16
  385. package/src/components/DataTable/context/DataTableContext.tsx +0 -97
  386. package/src/components/DataTable/core/ActionManager.ts +0 -235
  387. package/src/components/DataTable/core/ColumnFactory.ts +0 -268
  388. package/src/components/DataTable/core/ColumnManager.ts +0 -205
  389. package/src/components/DataTable/core/DataManager.ts +0 -188
  390. package/src/components/DataTable/core/DataTableContext.tsx +0 -181
  391. package/src/components/DataTable/core/LocalDataAdapter.ts +0 -264
  392. package/src/components/DataTable/core/PluginRegistry.ts +0 -229
  393. package/src/components/DataTable/core/StateManager.ts +0 -311
  394. package/src/components/DataTable/core/__tests__/ActionManager.unit.test.ts +0 -405
  395. package/src/components/DataTable/core/__tests__/ArchitectureIntegration.unit.test.tsx +0 -445
  396. package/src/components/DataTable/core/__tests__/ColumnFactory.unit.test.ts +0 -288
  397. package/src/components/DataTable/core/__tests__/ColumnManager.unit.test.ts +0 -623
  398. package/src/components/DataTable/core/__tests__/DataManager.unit.test.ts +0 -431
  399. package/src/components/DataTable/core/__tests__/DataTableContext.unit.test.tsx +0 -433
  400. package/src/components/DataTable/core/__tests__/LocalDataAdapter.unit.test.ts +0 -422
  401. package/src/components/DataTable/core/__tests__/PluginRegistry.unit.test.tsx +0 -207
  402. package/src/components/DataTable/core/__tests__/StateManager.unit.test.ts +0 -278
  403. package/src/components/DataTable/core/index.ts +0 -8
  404. package/src/components/DataTable/core/interfaces.ts +0 -338
  405. package/src/components/DataTable/examples/HierarchicalActionsExample.tsx +0 -418
  406. package/src/components/DataTable/examples/HierarchicalExample.tsx +0 -472
  407. package/src/components/DataTable/examples/InitialPageSizeExample.tsx +0 -173
  408. package/src/components/DataTable/examples/PerformanceExample.tsx +0 -502
  409. package/src/components/DataTable/examples/__tests__/PerformanceExample.unit.test.tsx +0 -281
  410. package/src/components/DataTable/hooks/__tests__/useColumnOrderPersistence.unit.test.ts +0 -407
  411. package/src/components/DataTable/hooks/__tests__/useColumnReordering.unit.test.ts +0 -679
  412. package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +0 -95
  413. package/src/components/DataTable/hooks/useColumnReordering.ts +0 -110
  414. package/src/components/DataTable/hooks/useDataTableState.ts +0 -325
  415. package/src/components/DataTable/hooks/useHierarchicalState.ts +0 -174
  416. package/src/components/DataTable/index.ts +0 -68
  417. package/src/components/DataTable/styles.ts +0 -171
  418. package/src/components/DataTable/types.ts +0 -473
  419. package/src/components/DataTable/utils/__tests__/debugTools.unit.test.ts +0 -267
  420. package/src/components/DataTable/utils/__tests__/errorHandling.unit.test.ts +0 -467
  421. package/src/components/DataTable/utils/__tests__/exportUtils.unit.test.ts +0 -380
  422. package/src/components/DataTable/utils/__tests__/flexibleImport.unit.test.ts +0 -233
  423. package/src/components/DataTable/utils/__tests__/performanceUtils.unit.test.ts +0 -414
  424. package/src/components/DataTable/utils/debugTools.ts +0 -583
  425. package/src/components/DataTable/utils/errorHandling.ts +0 -494
  426. package/src/components/DataTable/utils/exportUtils.ts +0 -126
  427. package/src/components/DataTable/utils/flexibleImport.ts +0 -510
  428. package/src/components/DataTable/utils/hierarchicalSorting.ts +0 -151
  429. package/src/components/DataTable/utils/hierarchicalUtils.ts +0 -218
  430. package/src/components/DataTable/utils/index.ts +0 -1
  431. package/src/components/DataTable/utils/performanceUtils.ts +0 -351
  432. package/src/components/Dialog/Dialog.tsx +0 -782
  433. package/src/components/Dialog/README.md +0 -804
  434. package/src/components/Dialog/__tests__/Dialog.accessibility.test.tsx +0 -521
  435. package/src/components/Dialog/__tests__/Dialog.auto-size.example.tsx +0 -157
  436. package/src/components/Dialog/__tests__/Dialog.enhanced.test.tsx +0 -538
  437. package/src/components/Dialog/__tests__/Dialog.unit.test.tsx +0 -1373
  438. package/src/components/Dialog/examples/BasicHtmlTest.tsx +0 -55
  439. package/src/components/Dialog/examples/DebugHtmlExample.tsx +0 -68
  440. package/src/components/Dialog/examples/HtmlDialogExample.tsx +0 -202
  441. package/src/components/Dialog/examples/SimpleHtmlTest.tsx +0 -61
  442. package/src/components/Dialog/examples/SmartDialogExample.tsx +0 -322
  443. package/src/components/Dialog/examples/__tests__/SmartDialogExample.unit.test.tsx +0 -151
  444. package/src/components/Dialog/index.ts +0 -12
  445. package/src/components/Dialog/utils/__tests__/safeHtml.unit.test.ts +0 -611
  446. package/src/components/Dialog/utils/safeHtml.ts +0 -185
  447. package/src/components/ErrorBoundary/ErrorBoundary.tsx +0 -312
  448. package/src/components/ErrorBoundary/__tests__/ErrorBoundary.accessibility.test.tsx +0 -517
  449. package/src/components/ErrorBoundary/__tests__/ErrorBoundary.integration.test.tsx +0 -572
  450. package/src/components/ErrorBoundary/__tests__/ErrorBoundary.unit.test.tsx +0 -579
  451. package/src/components/ErrorBoundary/index.ts +0 -8
  452. package/src/components/EventSelector/EventSelector.tsx +0 -360
  453. package/src/components/EventSelector/__tests__/EventSelector.test.tsx +0 -528
  454. package/src/components/EventSelector/index.ts +0 -3
  455. package/src/components/EventSelector/types.ts +0 -79
  456. package/src/components/FileUpload/FileUpload.example.tsx +0 -218
  457. package/src/components/FileUpload/FileUpload.tsx +0 -237
  458. package/src/components/FileUpload/__tests__/FileUpload.integration.test.tsx +0 -992
  459. package/src/components/FileUpload/__tests__/FileUpload.real.test.tsx +0 -927
  460. package/src/components/FileUpload/__tests__/FileUpload.test.tsx +0 -855
  461. package/src/components/FileUpload/__tests__/FileUpload.unit.test.tsx +0 -1311
  462. package/src/components/FileUpload/__tests__/FileUpload.unmocked.test.tsx +0 -937
  463. package/src/components/FileUpload/index.ts +0 -6
  464. package/src/components/Footer/Footer.tsx +0 -197
  465. package/src/components/Footer/__tests__/Footer.accessibility.test.tsx +0 -359
  466. package/src/components/Footer/__tests__/Footer.integration.test.tsx +0 -353
  467. package/src/components/Footer/__tests__/Footer.performance.test.tsx +0 -309
  468. package/src/components/Footer/__tests__/Footer.unit.test.tsx +0 -309
  469. package/src/components/Footer/__tests__/Footer.visual.test.tsx +0 -335
  470. package/src/components/Footer/index.ts +0 -17
  471. package/src/components/Form/Form.tsx +0 -166
  472. package/src/components/Form/FormErrorSummary.tsx +0 -113
  473. package/src/components/Form/FormField.tsx +0 -249
  474. package/src/components/Form/FormFieldset.tsx +0 -127
  475. package/src/components/Form/FormLiveRegion.tsx +0 -198
  476. package/src/components/Form/__tests__/Form.accessibility.test.tsx +0 -820
  477. package/src/components/Form/__tests__/Form.unit.test.tsx +0 -305
  478. package/src/components/Form/__tests__/FormErrorSummary.unit.test.tsx +0 -285
  479. package/src/components/Form/__tests__/FormFieldset.unit.test.tsx +0 -241
  480. package/src/components/Form/index.ts +0 -26
  481. package/src/components/Header/Header.tsx +0 -301
  482. package/src/components/Header/__tests__/Header.accessibility.test.tsx +0 -382
  483. package/src/components/Header/__tests__/Header.comprehensive.test.tsx +0 -509
  484. package/src/components/Header/__tests__/Header.unit.test.tsx +0 -335
  485. package/src/components/Header/index.ts +0 -4
  486. package/src/components/InactivityWarningModal/InactivityWarningModal.test.tsx +0 -196
  487. package/src/components/InactivityWarningModal/InactivityWarningModal.tsx +0 -164
  488. package/src/components/InactivityWarningModal/__tests__/InactivityWarningModal.unit.test.tsx +0 -224
  489. package/src/components/InactivityWarningModal/index.ts +0 -9
  490. package/src/components/Input/Input.tsx +0 -201
  491. package/src/components/Input/__mocks__/Input.tsx +0 -2
  492. package/src/components/Input/__tests__/Input.accessibility.test.tsx +0 -632
  493. package/src/components/Input/__tests__/Input.unit.test.tsx +0 -1121
  494. package/src/components/Input/index.ts +0 -9
  495. package/src/components/Label/Label.tsx +0 -186
  496. package/src/components/Label/__tests__/Label.accessibility.test.tsx +0 -239
  497. package/src/components/Label/__tests__/Label.unit.test.tsx +0 -331
  498. package/src/components/Label/index.ts +0 -2
  499. package/src/components/LoadingSpinner/LoadingSpinner.tsx +0 -98
  500. package/src/components/LoadingSpinner/__tests__/LoadingSpinner.accessibility.test.tsx +0 -116
  501. package/src/components/LoadingSpinner/__tests__/LoadingSpinner.unit.test.tsx +0 -144
  502. package/src/components/LoadingSpinner/index.ts +0 -3
  503. package/src/components/LoginForm/LoginForm.tsx +0 -273
  504. package/src/components/LoginForm/__tests__/LoginForm.accessibility.test.tsx +0 -201
  505. package/src/components/LoginForm/__tests__/LoginForm.unit.test.tsx +0 -119
  506. package/src/components/LoginForm/index.ts +0 -3
  507. package/src/components/NavigationMenu/NavigationMenu.tsx +0 -698
  508. package/src/components/NavigationMenu/__tests__/NavigationMenu.accessibility.test.tsx +0 -378
  509. package/src/components/NavigationMenu/__tests__/NavigationMenu.enhanced.test.tsx +0 -768
  510. package/src/components/NavigationMenu/__tests__/NavigationMenu.integration.test.tsx +0 -576
  511. package/src/components/NavigationMenu/__tests__/NavigationMenu.performance.test.tsx +0 -585
  512. package/src/components/NavigationMenu/__tests__/NavigationMenu.real.component.test.tsx +0 -783
  513. package/src/components/NavigationMenu/__tests__/NavigationMenu.security.enhanced.test.tsx +0 -810
  514. package/src/components/NavigationMenu/__tests__/NavigationMenu.security.test.tsx +0 -494
  515. package/src/components/NavigationMenu/__tests__/NavigationMenu.unit.test.tsx +0 -331
  516. package/src/components/NavigationMenu/__tests__/NavigationMenu.userWorkflows.test.tsx +0 -347
  517. package/src/components/NavigationMenu/__tests__/NavigationMenu.workflows.test.tsx +0 -584
  518. package/src/components/NavigationMenu/index.ts +0 -10
  519. package/src/components/NavigationMenu/types.ts +0 -85
  520. package/src/components/OrganisationSelector/OrganisationSelector.tsx +0 -304
  521. package/src/components/OrganisationSelector/__tests__/OrganisationSelector.unit.test.tsx +0 -664
  522. package/src/components/OrganisationSelector/index.ts +0 -9
  523. package/src/components/PaceAppLayout/PaceAppLayout.tsx +0 -699
  524. package/src/components/PaceAppLayout/README.md +0 -278
  525. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.accessibility.test.tsx +0 -288
  526. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +0 -893
  527. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.performance.test.tsx +0 -629
  528. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +0 -782
  529. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +0 -904
  530. package/src/components/PaceAppLayout/index.ts +0 -1
  531. package/src/components/PaceLoginPage/PaceLoginPage.tsx +0 -221
  532. package/src/components/PaceLoginPage/__tests__/PaceLoginPage.accessibility.test.tsx +0 -463
  533. package/src/components/PaceLoginPage/__tests__/PaceLoginPage.integration.test.tsx +0 -586
  534. package/src/components/PaceLoginPage/__tests__/PaceLoginPage.unit.test.tsx +0 -533
  535. package/src/components/PaceLoginPage/index.ts +0 -1
  536. package/src/components/PasswordReset/PasswordChangeForm.tsx +0 -186
  537. package/src/components/PasswordReset/PasswordResetForm.tsx +0 -201
  538. package/src/components/PasswordReset/__tests__/PasswordChangeForm.accessibility.test.tsx +0 -408
  539. package/src/components/PasswordReset/__tests__/PasswordChangeForm.unit.test.tsx +0 -561
  540. package/src/components/PasswordReset/__tests__/PasswordReset.integration.test.tsx +0 -304
  541. package/src/components/PasswordReset/__tests__/PasswordResetForm.accessibility.test.tsx +0 -20
  542. package/src/components/PasswordReset/__tests__/PasswordResetForm.unit.test.tsx +0 -523
  543. package/src/components/PasswordReset/__tests__/__mocks__/UnifiedAuthProvider.ts +0 -29
  544. package/src/components/PasswordReset/index.ts +0 -4
  545. package/src/components/Print/__tests__/Print.comprehensive.test.tsx +0 -331
  546. package/src/components/PrintButton/PrintButton.tsx +0 -321
  547. package/src/components/PrintButton/PrintButtonGroup.tsx +0 -84
  548. package/src/components/PrintButton/PrintToolbar.tsx +0 -94
  549. package/src/components/PrintButton/__tests__/PrintButton.unit.test.tsx +0 -429
  550. package/src/components/PrintButton/__tests__/PrintButtonGroup.unit.test.tsx +0 -277
  551. package/src/components/PrintButton/__tests__/PrintToolbar.unit.test.tsx +0 -264
  552. package/src/components/PrintButton/examples/PrintButtonShowcase.tsx +0 -438
  553. package/src/components/PrintButton/index.ts +0 -33
  554. package/src/components/PrintButton/types.ts +0 -173
  555. package/src/components/PrintCard/PrintCard.tsx +0 -154
  556. package/src/components/PrintCard/PrintCardContent.tsx +0 -57
  557. package/src/components/PrintCard/PrintCardFooter.tsx +0 -60
  558. package/src/components/PrintCard/PrintCardGrid.tsx +0 -91
  559. package/src/components/PrintCard/PrintCardHeader.tsx +0 -78
  560. package/src/components/PrintCard/PrintCardImage.tsx +0 -81
  561. package/src/components/PrintCard/__tests__/PrintCard.unit.test.tsx +0 -233
  562. package/src/components/PrintCard/__tests__/PrintCardContent.test.tsx +0 -284
  563. package/src/components/PrintCard/__tests__/PrintCardGrid.unit.test.tsx +0 -214
  564. package/src/components/PrintCard/__tests__/PrintCardImage.unit.test.tsx +0 -264
  565. package/src/components/PrintCard/examples/PrintCardShowcase.tsx +0 -239
  566. package/src/components/PrintCard/index.ts +0 -34
  567. package/src/components/PrintCard/types.ts +0 -171
  568. package/src/components/PrintDataTable/PrintDataTable.tsx +0 -215
  569. package/src/components/PrintDataTable/PrintTableGroup.tsx +0 -90
  570. package/src/components/PrintDataTable/PrintTableRow.tsx +0 -76
  571. package/src/components/PrintDataTable/__tests__/PrintDataTable.unit.test.tsx +0 -361
  572. package/src/components/PrintDataTable/__tests__/PrintTableGroup.unit.test.tsx +0 -314
  573. package/src/components/PrintDataTable/__tests__/PrintTableRow.unit.test.tsx +0 -362
  574. package/src/components/PrintDataTable/index.ts +0 -25
  575. package/src/components/PrintDataTable/types.ts +0 -67
  576. package/src/components/PrintFooter/PrintFooter.tsx +0 -183
  577. package/src/components/PrintFooter/PrintFooterContent.tsx +0 -71
  578. package/src/components/PrintFooter/PrintFooterInfo.tsx +0 -86
  579. package/src/components/PrintFooter/PrintPageNumber.tsx +0 -90
  580. package/src/components/PrintFooter/__tests__/PrintFooter.unit.test.tsx +0 -500
  581. package/src/components/PrintFooter/__tests__/PrintFooterContent.unit.test.tsx +0 -321
  582. package/src/components/PrintFooter/__tests__/PrintFooterInfo.unit.test.tsx +0 -335
  583. package/src/components/PrintFooter/__tests__/PrintPageNumber.unit.test.tsx +0 -340
  584. package/src/components/PrintFooter/examples/PrintFooterShowcase.tsx +0 -390
  585. package/src/components/PrintFooter/index.ts +0 -30
  586. package/src/components/PrintFooter/types.ts +0 -149
  587. package/src/components/PrintGrid/PrintGrid.tsx +0 -180
  588. package/src/components/PrintGrid/PrintGridBreakpoint.tsx +0 -109
  589. package/src/components/PrintGrid/PrintGridContainer.tsx +0 -128
  590. package/src/components/PrintGrid/PrintGridItem.tsx +0 -220
  591. package/src/components/PrintGrid/__tests__/PrintGrid.unit.test.tsx +0 -340
  592. package/src/components/PrintGrid/__tests__/PrintGridBreakpoint.unit.test.tsx +0 -261
  593. package/src/components/PrintGrid/__tests__/PrintGridContainer.unit.test.tsx +0 -338
  594. package/src/components/PrintGrid/__tests__/PrintGridItem.unit.test.tsx +0 -338
  595. package/src/components/PrintGrid/examples/PrintGridShowcase.tsx +0 -359
  596. package/src/components/PrintGrid/index.ts +0 -31
  597. package/src/components/PrintGrid/types.ts +0 -159
  598. package/src/components/PrintHeader/PrintCoverHeader.tsx +0 -230
  599. package/src/components/PrintHeader/PrintHeader.tsx +0 -150
  600. package/src/components/PrintHeader/__tests__/PrintCoverHeader.unit.test.tsx +0 -309
  601. package/src/components/PrintHeader/__tests__/PrintHeader.unit.test.tsx +0 -202
  602. package/src/components/PrintHeader/index.ts +0 -17
  603. package/src/components/PrintHeader/types.ts +0 -42
  604. package/src/components/PrintLayout/PrintLayout.tsx +0 -122
  605. package/src/components/PrintLayout/PrintLayoutContext.tsx +0 -66
  606. package/src/components/PrintLayout/PrintPageBreak.tsx +0 -52
  607. package/src/components/PrintLayout/__tests__/PrintLayout.unit.test.tsx +0 -238
  608. package/src/components/PrintLayout/examples/PrintShowcase.tsx +0 -230
  609. package/src/components/PrintLayout/index.ts +0 -19
  610. package/src/components/PrintLayout/types.ts +0 -37
  611. package/src/components/PrintPageBreak/PrintPageBreak.tsx +0 -120
  612. package/src/components/PrintPageBreak/PrintPageBreakGroup.tsx +0 -90
  613. package/src/components/PrintPageBreak/PrintPageBreakIndicator.tsx +0 -112
  614. package/src/components/PrintPageBreak/__tests__/PrintPageBreak.unit.test.tsx +0 -263
  615. package/src/components/PrintPageBreak/__tests__/PrintPageBreakGroup.unit.test.tsx +0 -239
  616. package/src/components/PrintPageBreak/__tests__/PrintPageBreakIndicator.unit.test.tsx +0 -235
  617. package/src/components/PrintPageBreak/examples/PrintPageBreakShowcase.tsx +0 -279
  618. package/src/components/PrintPageBreak/index.ts +0 -23
  619. package/src/components/PrintPageBreak/types.ts +0 -94
  620. package/src/components/PrintSection/PrintColumn.tsx +0 -104
  621. package/src/components/PrintSection/PrintDivider.tsx +0 -101
  622. package/src/components/PrintSection/PrintSection.tsx +0 -129
  623. package/src/components/PrintSection/PrintSectionContent.tsx +0 -75
  624. package/src/components/PrintSection/PrintSectionHeader.tsx +0 -97
  625. package/src/components/PrintSection/__tests__/PrintColumn.unit.test.tsx +0 -385
  626. package/src/components/PrintSection/__tests__/PrintDivider.unit.test.tsx +0 -373
  627. package/src/components/PrintSection/__tests__/PrintSection.unit.test.tsx +0 -390
  628. package/src/components/PrintSection/__tests__/PrintSectionContent.unit.test.tsx +0 -321
  629. package/src/components/PrintSection/__tests__/PrintSectionHeader.unit.test.tsx +0 -334
  630. package/src/components/PrintSection/examples/PrintSectionShowcase.tsx +0 -258
  631. package/src/components/PrintSection/index.ts +0 -33
  632. package/src/components/PrintSection/types.ts +0 -155
  633. package/src/components/PrintText/PrintText.tsx +0 -116
  634. package/src/components/PrintText/__tests__/PrintText.unit.test.tsx +0 -351
  635. package/src/components/PrintText/index.ts +0 -16
  636. package/src/components/PrintText/types.ts +0 -24
  637. package/src/components/Progress/Progress.tsx +0 -116
  638. package/src/components/Progress/__tests__/Progress.accessibility.test.tsx +0 -240
  639. package/src/components/Progress/__tests__/Progress.unit.test.tsx +0 -242
  640. package/src/components/Progress/index.ts +0 -3
  641. package/src/components/PublicLayout/EventLogo.tsx +0 -287
  642. package/src/components/PublicLayout/PublicErrorBoundary.tsx +0 -279
  643. package/src/components/PublicLayout/PublicLoadingSpinner.tsx +0 -208
  644. package/src/components/PublicLayout/PublicPageContextChecker.tsx +0 -130
  645. package/src/components/PublicLayout/PublicPageDebugger.tsx +0 -104
  646. package/src/components/PublicLayout/PublicPageDiagnostic.tsx +0 -162
  647. package/src/components/PublicLayout/PublicPageFooter.tsx +0 -124
  648. package/src/components/PublicLayout/PublicPageHeader.tsx +0 -178
  649. package/src/components/PublicLayout/PublicPageLayout.tsx +0 -232
  650. package/src/components/PublicLayout/PublicPageProvider.tsx +0 -137
  651. package/src/components/PublicLayout/__tests__/EventLogo.test.tsx +0 -761
  652. package/src/components/PublicLayout/__tests__/PublicErrorBoundary.simplified.test.tsx +0 -228
  653. package/src/components/PublicLayout/__tests__/PublicErrorBoundary.test.tsx +0 -228
  654. package/src/components/PublicLayout/__tests__/PublicLoadingSpinner.test.tsx +0 -459
  655. package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +0 -362
  656. package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +0 -522
  657. package/src/components/PublicLayout/__tests__/PublicPageLayout.test.tsx +0 -599
  658. package/src/components/PublicLayout/__tests__/PublicPageProvider.test.tsx +0 -513
  659. package/src/components/PublicLayout/index.ts +0 -51
  660. package/src/components/RBAC/PagePermissionGuard.tsx +0 -287
  661. package/src/components/RBAC/RBACGuard.tsx +0 -143
  662. package/src/components/RBAC/RBACProvider.tsx +0 -186
  663. package/src/components/RBAC/RoleBasedContent.tsx +0 -129
  664. package/src/components/RBAC/__tests__/PagePermissionGuard.unit.test.tsx +0 -683
  665. package/src/components/RBAC/__tests__/RBAC.integration.test.tsx +0 -573
  666. package/src/components/RBAC/__tests__/RBACGuard.unit.test.tsx +0 -467
  667. package/src/components/RBAC/__tests__/RBACProvider.accessibility.test.tsx +0 -475
  668. package/src/components/RBAC/__tests__/RBACProvider.advanced.test.tsx +0 -569
  669. package/src/components/RBAC/__tests__/RBACProvider.integration.test.tsx +0 -352
  670. package/src/components/RBAC/__tests__/RBACProvider.unit.test.tsx +0 -128
  671. package/src/components/RBAC/__tests__/RoleBasedContent.unit.test.tsx +0 -657
  672. package/src/components/RBAC/index.ts +0 -23
  673. package/src/components/Select/Select.tsx +0 -660
  674. package/src/components/Select/__tests__/SearchableSelect.unit.test.tsx +0 -437
  675. package/src/components/Select/__tests__/Select.accessibility.test.tsx +0 -1202
  676. package/src/components/Select/__tests__/Select.actual.test.tsx +0 -774
  677. package/src/components/Select/__tests__/Select.comprehensive.test.tsx +0 -837
  678. package/src/components/Select/__tests__/Select.enhanced.test.tsx +0 -1101
  679. package/src/components/Select/__tests__/Select.integration.test.tsx +0 -772
  680. package/src/components/Select/__tests__/Select.performance.test.tsx +0 -695
  681. package/src/components/Select/__tests__/Select.real-world.test.tsx +0 -1046
  682. package/src/components/Select/__tests__/Select.search-algorithms.test.tsx +0 -968
  683. package/src/components/Select/__tests__/Select.unit.test.tsx +0 -647
  684. package/src/components/Select/__tests__/Select.utils.test.tsx +0 -890
  685. package/src/components/Select/index.ts +0 -1
  686. package/src/components/SuperAdminGuard.tsx +0 -116
  687. package/src/components/Table/Table.tsx +0 -222
  688. package/src/components/Table/__tests__/Table.accessibility.test.tsx +0 -233
  689. package/src/components/Table/__tests__/Table.unit.test.tsx +0 -235
  690. package/src/components/Table/index.ts +0 -11
  691. package/src/components/Toast/Toast.tsx +0 -339
  692. package/src/components/Toast/__tests__/Toast.accessibility.test.tsx +0 -238
  693. package/src/components/Toast/__tests__/Toast.integration.test.tsx +0 -699
  694. package/src/components/Toast/__tests__/Toast.unit.test.tsx +0 -750
  695. package/src/components/Toast/index.ts +0 -14
  696. package/src/components/Tooltip/Tooltip.tsx +0 -167
  697. package/src/components/Tooltip/__tests__/Tooltip.accessibility.test.tsx +0 -121
  698. package/src/components/Tooltip/__tests__/Tooltip.unit.test.tsx +0 -185
  699. package/src/components/Tooltip/index.ts +0 -7
  700. package/src/components/UserMenu/UserMenu.tsx +0 -243
  701. package/src/components/UserMenu/__tests__/UserMenu.accessibility.test.tsx +0 -139
  702. package/src/components/UserMenu/__tests__/UserMenu.integration.test.tsx +0 -188
  703. package/src/components/UserMenu/__tests__/UserMenu.unit.test.tsx +0 -458
  704. package/src/components/UserMenu/index.ts +0 -3
  705. package/src/components/__tests__/EdgeCaseTesting.enhanced.test.tsx +0 -524
  706. package/src/components/__tests__/ErrorTesting.enhanced.test.tsx +0 -455
  707. package/src/components/__tests__/SuperAdminGuard.test.tsx +0 -456
  708. package/src/components/__tests__/SuperAdminGuard.unit.test.tsx +0 -456
  709. package/src/components/examples/PermissionExample.tsx +0 -150
  710. package/src/components/examples/__tests__/PermissionExample.unit.test.tsx +0 -360
  711. package/src/components/index.ts +0 -434
  712. package/src/components.ts +0 -19
  713. package/src/constants/performance.ts +0 -14
  714. package/src/examples/CorrectPublicPageImplementation.tsx +0 -301
  715. package/src/examples/PublicEventPage.tsx +0 -274
  716. package/src/examples/PublicPageApp.tsx +0 -308
  717. package/src/examples/PublicPageUsageExample.tsx +0 -216
  718. package/src/hooks/__tests__/hooks.integration.test.tsx +0 -575
  719. package/src/hooks/__tests__/useApiFetch.unit.test.ts +0 -115
  720. package/src/hooks/__tests__/useComponentPerformance.unit.test.tsx +0 -133
  721. package/src/hooks/__tests__/useDebounce.unit.test.ts +0 -82
  722. package/src/hooks/__tests__/useFocusTrap.unit.test.tsx +0 -293
  723. package/src/hooks/__tests__/useInactivityTracker.unit.test.ts +0 -385
  724. package/src/hooks/__tests__/useOrganisationPermissions.unit.test.tsx +0 -286
  725. package/src/hooks/__tests__/useOrganisationSecurity.unit.test.tsx +0 -838
  726. package/src/hooks/__tests__/usePermissionCache.unit.test.ts +0 -627
  727. package/src/hooks/__tests__/useRBAC.unit.test.ts +0 -911
  728. package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +0 -537
  729. package/src/hooks/__tests__/useToast.unit.test.tsx +0 -62
  730. package/src/hooks/__tests__/useZodForm.unit.test.tsx +0 -37
  731. package/src/hooks/index.ts +0 -56
  732. package/src/hooks/public/__tests__/usePublicEvent.test.tsx +0 -397
  733. package/src/hooks/public/__tests__/usePublicEventLogo.test.tsx +0 -690
  734. package/src/hooks/public/__tests__/usePublicRouteParams.test.tsx +0 -449
  735. package/src/hooks/public/index.ts +0 -34
  736. package/src/hooks/public/usePublicEvent.ts +0 -261
  737. package/src/hooks/public/usePublicEventLogo.ts +0 -285
  738. package/src/hooks/public/usePublicRouteParams.ts +0 -259
  739. package/src/hooks/useAppConfig.ts +0 -94
  740. package/src/hooks/useComponentPerformance.ts +0 -39
  741. package/src/hooks/useDataTablePerformance.ts +0 -387
  742. package/src/hooks/useDataTableState.ts +0 -110
  743. package/src/hooks/useDebounce.ts +0 -18
  744. package/src/hooks/useFocusManagement.ts +0 -161
  745. package/src/hooks/useFocusTrap.ts +0 -155
  746. package/src/hooks/useInactivityTracker.ts +0 -372
  747. package/src/hooks/useIsMobile.ts +0 -42
  748. package/src/hooks/useKeyboardShortcuts.ts +0 -237
  749. package/src/hooks/useOrganisationPermissions.ts +0 -208
  750. package/src/hooks/useOrganisationSecurity.ts +0 -262
  751. package/src/hooks/usePerformanceMonitor.ts +0 -128
  752. package/src/hooks/usePermissionCache.ts +0 -455
  753. package/src/hooks/useRBAC.ts +0 -262
  754. package/src/hooks/useSecureDataAccess.ts +0 -586
  755. package/src/hooks/useStorage.ts +0 -274
  756. package/src/hooks/useToast.ts +0 -242
  757. package/src/hooks/useZodForm.ts +0 -28
  758. package/src/index.ts +0 -200
  759. package/src/providers/AuthProvider.tsx +0 -369
  760. package/src/providers/EventProvider.tsx +0 -324
  761. package/src/providers/InactivityProvider.tsx +0 -238
  762. package/src/providers/OrganisationProvider.tsx +0 -588
  763. package/src/providers/RBACProvider.tsx +0 -634
  764. package/src/providers/UnifiedAuthProvider.tsx +0 -327
  765. package/src/providers/__tests__/EventProvider.unit.test.tsx +0 -768
  766. package/src/providers/__tests__/OrganisationProvider.basic.test.tsx +0 -116
  767. package/src/providers/__tests__/OrganisationProvider.unit.test.tsx +0 -1312
  768. package/src/providers/__tests__/UnifiedAuthProvider.inactivity.test.tsx +0 -601
  769. package/src/providers/__tests__/UnifiedAuthProvider.unit.test.tsx +0 -683
  770. package/src/providers/__tests__/index.unit.test.ts +0 -78
  771. package/src/providers/index.ts +0 -15
  772. package/src/rbac/README.md +0 -885
  773. package/src/rbac/__tests__/PagePermissionGuard.test.tsx +0 -673
  774. package/src/rbac/__tests__/README.md +0 -170
  775. package/src/rbac/__tests__/RoleBasedRouter.test.tsx +0 -709
  776. package/src/rbac/__tests__/TestContext.tsx +0 -72
  777. package/src/rbac/__tests__/__mocks__/cache.ts +0 -144
  778. package/src/rbac/__tests__/__mocks__/supabase.ts +0 -152
  779. package/src/rbac/__tests__/adapters-hooks-comprehensive.test.tsx +0 -782
  780. package/src/rbac/__tests__/adapters-hooks.test.tsx +0 -561
  781. package/src/rbac/__tests__/adapters.comprehensive.test.tsx +0 -963
  782. package/src/rbac/__tests__/adapters.test.tsx +0 -444
  783. package/src/rbac/__tests__/api.test.ts +0 -620
  784. package/src/rbac/__tests__/audit-observability-comprehensive.test.ts +0 -792
  785. package/src/rbac/__tests__/audit-observability.test.ts +0 -549
  786. package/src/rbac/__tests__/audit.test.ts +0 -616
  787. package/src/rbac/__tests__/build-contract-compliance-simple.test.ts +0 -230
  788. package/src/rbac/__tests__/cache-invalidation-comprehensive.test.ts +0 -889
  789. package/src/rbac/__tests__/cache-invalidation.test.ts +0 -457
  790. package/src/rbac/__tests__/cache.test.ts +0 -458
  791. package/src/rbac/__tests__/components-navigation-guard.enhanced.test.tsx +0 -859
  792. package/src/rbac/__tests__/components-navigation-guard.test.tsx +0 -895
  793. package/src/rbac/__tests__/components-navigation-provider.test.tsx +0 -692
  794. package/src/rbac/__tests__/components-page-permission-guard.test.tsx +0 -673
  795. package/src/rbac/__tests__/components-page-permission-provider.test.tsx +0 -614
  796. package/src/rbac/__tests__/components-permission-enforcer.enhanced.fixed.test.tsx +0 -836
  797. package/src/rbac/__tests__/components-permission-enforcer.enhanced.test.tsx +0 -837
  798. package/src/rbac/__tests__/components-permission-enforcer.test.tsx +0 -825
  799. package/src/rbac/__tests__/components-role-based-router.test.tsx +0 -709
  800. package/src/rbac/__tests__/components-secure-data-provider.test.tsx +0 -607
  801. package/src/rbac/__tests__/config.test.ts +0 -583
  802. package/src/rbac/__tests__/core-logic-unit.test.ts +0 -190
  803. package/src/rbac/__tests__/core-permission-logic-comprehensive.test.ts +0 -1467
  804. package/src/rbac/__tests__/core-permission-logic-fixed.test.ts +0 -151
  805. package/src/rbac/__tests__/core-permission-logic-simple.test.ts +0 -968
  806. package/src/rbac/__tests__/core-permission-logic.test.ts +0 -966
  807. package/src/rbac/__tests__/edge-cases-comprehensive.test.ts +0 -988
  808. package/src/rbac/__tests__/edge-cases.test.ts +0 -654
  809. package/src/rbac/__tests__/engine.test.ts +0 -361
  810. package/src/rbac/__tests__/engine.unit.test.ts +0 -361
  811. package/src/rbac/__tests__/hooks.enhanced.test.tsx +0 -979
  812. package/src/rbac/__tests__/hooks.fixed.test.tsx +0 -475
  813. package/src/rbac/__tests__/hooks.test.tsx +0 -385
  814. package/src/rbac/__tests__/index.test.ts +0 -269
  815. package/src/rbac/__tests__/integration.enhanced.test.tsx +0 -824
  816. package/src/rbac/__tests__/page-permission-guard-super-admin.test.tsx +0 -261
  817. package/src/rbac/__tests__/performance.enhanced.test.tsx +0 -724
  818. package/src/rbac/__tests__/permissions.test.ts +0 -383
  819. package/src/rbac/__tests__/requires-event.test.ts +0 -330
  820. package/src/rbac/__tests__/scope-isolation-comprehensive.test.ts +0 -1349
  821. package/src/rbac/__tests__/scope-isolation.test.ts +0 -755
  822. package/src/rbac/__tests__/secure-client-rls-comprehensive.test.ts +0 -592
  823. package/src/rbac/__tests__/secure-client-rls.test.ts +0 -377
  824. package/src/rbac/__tests__/security.test.ts +0 -296
  825. package/src/rbac/__tests__/setup.ts +0 -228
  826. package/src/rbac/__tests__/test-utils-enhanced.tsx +0 -400
  827. package/src/rbac/__tests__/types.test.ts +0 -685
  828. package/src/rbac/adapters.tsx +0 -726
  829. package/src/rbac/api.ts +0 -339
  830. package/src/rbac/audit-enhanced.ts +0 -339
  831. package/src/rbac/audit.ts +0 -338
  832. package/src/rbac/cache.ts +0 -215
  833. package/src/rbac/components/EnhancedNavigationMenu.tsx +0 -294
  834. package/src/rbac/components/NavigationGuard.tsx +0 -294
  835. package/src/rbac/components/NavigationProvider.tsx +0 -314
  836. package/src/rbac/components/PagePermissionGuard.tsx +0 -430
  837. package/src/rbac/components/PagePermissionProvider.tsx +0 -274
  838. package/src/rbac/components/PermissionEnforcer.tsx +0 -307
  839. package/src/rbac/components/RoleBasedRouter.tsx +0 -425
  840. package/src/rbac/components/SecureDataProvider.tsx +0 -319
  841. package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +0 -631
  842. package/src/rbac/components/__tests__/NavigationProvider.test.tsx +0 -667
  843. package/src/rbac/components/__tests__/PagePermissionProvider.test.tsx +0 -647
  844. package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +0 -496
  845. package/src/rbac/components/index.ts +0 -64
  846. package/src/rbac/config.ts +0 -133
  847. package/src/rbac/docs/event-based-apps.md +0 -285
  848. package/src/rbac/engine.ts +0 -1026
  849. package/src/rbac/eslint-rules.js +0 -285
  850. package/src/rbac/examples/CompleteRBACExample.tsx +0 -323
  851. package/src/rbac/examples/EventBasedApp.tsx +0 -238
  852. package/src/rbac/hooks.ts +0 -570
  853. package/src/rbac/index.ts +0 -114
  854. package/src/rbac/permissions.ts +0 -293
  855. package/src/rbac/secureClient.ts +0 -244
  856. package/src/rbac/security.ts +0 -346
  857. package/src/rbac/testing/__tests__/index.test.tsx +0 -342
  858. package/src/rbac/testing/index.tsx +0 -340
  859. package/src/rbac/types.ts +0 -343
  860. package/src/rbac/utils/__tests__/eventContext.test.ts +0 -428
  861. package/src/rbac/utils/__tests__/eventContext.unit.test.ts +0 -428
  862. package/src/rbac/utils/eventContext.ts +0 -83
  863. package/src/styles/__tests__/styles.unit.test.ts +0 -164
  864. package/src/styles/core.css +0 -422
  865. package/src/styles/index.ts +0 -51
  866. package/src/test-dom-cleanup.test.tsx +0 -38
  867. package/src/theming/__tests__/README.md +0 -335
  868. package/src/theming/__tests__/runtime.accessibility.test.ts +0 -474
  869. package/src/theming/__tests__/runtime.error.test.ts +0 -616
  870. package/src/theming/__tests__/runtime.integration.test.ts +0 -376
  871. package/src/theming/__tests__/runtime.performance.test.ts +0 -411
  872. package/src/theming/__tests__/runtime.unit.test.ts +0 -470
  873. package/src/theming/runtime.ts +0 -187
  874. package/src/types/__tests__/database.unit.test.ts +0 -489
  875. package/src/types/__tests__/guards.unit.test.ts +0 -146
  876. package/src/types/__tests__/index.unit.test.ts +0 -77
  877. package/src/types/__tests__/organisation.unit.test.ts +0 -713
  878. package/src/types/__tests__/rbac.unit.test.ts +0 -621
  879. package/src/types/__tests__/security.unit.test.ts +0 -347
  880. package/src/types/__tests__/supabase.unit.test.ts +0 -658
  881. package/src/types/__tests__/theme.unit.test.ts +0 -218
  882. package/src/types/__tests__/unified.unit.test.ts +0 -537
  883. package/src/types/__tests__/validation.unit.test.ts +0 -616
  884. package/src/types/database.ts +0 -472
  885. package/src/types/guards.ts +0 -30
  886. package/src/types/index.ts +0 -25
  887. package/src/types/organisation.ts +0 -184
  888. package/src/types/security.ts +0 -70
  889. package/src/types/supabase.ts +0 -166
  890. package/src/types/theme.ts +0 -6
  891. package/src/types/unified.ts +0 -262
  892. package/src/types/validation.ts +0 -164
  893. package/src/types/vitest-globals.d.ts +0 -43
  894. package/src/utils/__mocks__/supabaseMock.ts +0 -75
  895. package/src/utils/__mocks__/supabaseMock.tsx +0 -198
  896. package/src/utils/__tests__/appConfig.unit.test.ts +0 -55
  897. package/src/utils/__tests__/appNameResolver.unit.test.ts +0 -137
  898. package/src/utils/__tests__/audit.unit.test.ts +0 -69
  899. package/src/utils/__tests__/auth-utils.unit.test.ts +0 -70
  900. package/src/utils/__tests__/bundleAnalysis.unit.test.ts +0 -317
  901. package/src/utils/__tests__/cn.unit.test.ts +0 -34
  902. package/src/utils/__tests__/deviceFingerprint.unit.test.ts +0 -480
  903. package/src/utils/__tests__/dynamicUtils.unit.test.ts +0 -322
  904. package/src/utils/__tests__/formatDate.unit.test.ts +0 -109
  905. package/src/utils/__tests__/formatting.unit.test.ts +0 -66
  906. package/src/utils/__tests__/index.unit.test.ts +0 -251
  907. package/src/utils/__tests__/lazyLoad.unit.test.tsx +0 -304
  908. package/src/utils/__tests__/organisationContext.unit.test.ts +0 -192
  909. package/src/utils/__tests__/performanceBudgets.unit.test.ts +0 -259
  910. package/src/utils/__tests__/permissionTypes.unit.test.ts +0 -250
  911. package/src/utils/__tests__/permissionUtils.unit.test.ts +0 -362
  912. package/src/utils/__tests__/sanitization.unit.test.ts +0 -346
  913. package/src/utils/__tests__/schemaUtils.unit.test.ts +0 -441
  914. package/src/utils/__tests__/secureDataAccess.unit.test.ts +0 -334
  915. package/src/utils/__tests__/secureErrors.unit.test.ts +0 -377
  916. package/src/utils/__tests__/secureStorage.unit.test.ts +0 -293
  917. package/src/utils/__tests__/security.unit.test.ts +0 -127
  918. package/src/utils/__tests__/securityMonitor.unit.test.ts +0 -280
  919. package/src/utils/__tests__/sessionTracking.unit.test.ts +0 -370
  920. package/src/utils/__tests__/validation.unit.test.ts +0 -84
  921. package/src/utils/__tests__/validationUtils.unit.test.ts +0 -571
  922. package/src/utils/appConfig.ts +0 -47
  923. package/src/utils/appIdResolver.ts +0 -130
  924. package/src/utils/appNameResolver.ts +0 -190
  925. package/src/utils/audit.ts +0 -127
  926. package/src/utils/auth-utils.ts +0 -96
  927. package/src/utils/bundleAnalysis.ts +0 -129
  928. package/src/utils/cn.ts +0 -7
  929. package/src/utils/debugLogger.ts +0 -46
  930. package/src/utils/deviceFingerprint.ts +0 -215
  931. package/src/utils/dynamicUtils.ts +0 -105
  932. package/src/utils/formatting.ts +0 -77
  933. package/src/utils/index.ts +0 -145
  934. package/src/utils/lazyLoad.tsx +0 -44
  935. package/src/utils/organisationContext.ts +0 -135
  936. package/src/utils/performanceBenchmark.ts +0 -64
  937. package/src/utils/performanceBudgets.ts +0 -111
  938. package/src/utils/permissionTypes.ts +0 -37
  939. package/src/utils/permissionUtils.ts +0 -31
  940. package/src/utils/print/PrintDataProcessor.ts +0 -390
  941. package/src/utils/print/__tests__/PrintDataProcessor.unit.test.ts +0 -219
  942. package/src/utils/print/__tests__/usePrintOptimization.unit.test.tsx +0 -353
  943. package/src/utils/print/examples/PrintUtilitiesShowcase.tsx +0 -397
  944. package/src/utils/print/index.ts +0 -29
  945. package/src/utils/print/types.ts +0 -196
  946. package/src/utils/print/usePrintOptimization.ts +0 -272
  947. package/src/utils/sanitization.ts +0 -264
  948. package/src/utils/schemaUtils.ts +0 -37
  949. package/src/utils/secureDataAccess.ts +0 -361
  950. package/src/utils/secureErrors.ts +0 -79
  951. package/src/utils/secureStorage.ts +0 -244
  952. package/src/utils/security.ts +0 -156
  953. package/src/utils/securityMonitor.ts +0 -45
  954. package/src/utils/sessionTracking.ts +0 -170
  955. package/src/utils/storage/README.md +0 -348
  956. package/src/utils/storage/__tests__/config.unit.test.ts +0 -206
  957. package/src/utils/storage/__tests__/helpers.unit.test.ts +0 -648
  958. package/src/utils/storage/__tests__/index.unit.test.ts +0 -167
  959. package/src/utils/storage/__tests__/types.unit.test.ts +0 -441
  960. package/src/utils/storage/config.ts +0 -100
  961. package/src/utils/storage/helpers.ts +0 -359
  962. package/src/utils/storage/index.ts +0 -36
  963. package/src/utils/storage/types.ts +0 -90
  964. package/src/utils/validation.ts +0 -111
  965. package/src/utils/validationUtils.ts +0 -120
  966. package/src/validation/__tests__/common.unit.test.ts +0 -101
  967. package/src/validation/__tests__/csrf.unit.test.ts +0 -302
  968. package/src/validation/__tests__/passwordSchema.unit.test.ts +0 -98
  969. package/src/validation/__tests__/sqlInjectionProtection.unit.test.ts +0 -466
  970. package/src/validation/common.ts +0 -53
  971. package/src/validation/csrf.ts +0 -214
  972. package/src/validation/index.ts +0 -43
  973. package/src/validation/passwordSchema.ts +0 -125
  974. package/src/validation/sanitization.ts +0 -96
  975. package/src/validation/schemaUtils.ts +0 -42
  976. package/src/validation/sqlInjectionProtection.ts +0 -242
  977. package/src/validation/user.ts +0 -34
  978. package/dist/{DataTable-EEUDXPE5.js.map → DataTable-2LB6HI6V.js.map} +0 -0
  979. package/dist/{api-ETQ6YJ3C.js.map → api-AIJ3IJX3.js.map} +0 -0
  980. package/dist/{appNameResolver-7GHF5ED2.js.map → audit-PD5L5ZSC.js.map} +0 -0
  981. package/dist/{audit-BUW3LMJB.js.map → chunk-DC5AMYBS.js.map} +0 -0
  982. package/dist/{validation-PM_iOaTI.d.ts → validation-D2-NNCCE.d.ts} +6 -6
@@ -1,3431 +0,0 @@
1
- import {
2
- Alert,
3
- AlertDescription,
4
- Input,
5
- Select,
6
- SelectContent,
7
- SelectItem,
8
- SelectLabel,
9
- SelectSeparator,
10
- SelectTrigger,
11
- SelectValue
12
- } from "./chunk-EWKPTNPO.js";
13
- import {
14
- isPermitted
15
- } from "./chunk-C5G2A4PO.js";
16
- import {
17
- EventProvider_exports,
18
- init_EventProvider,
19
- useEvents
20
- } from "./chunk-HEMJ4SUJ.js";
21
- import {
22
- PublicErrorBoundary,
23
- useAppConfig,
24
- usePublicEventLogo,
25
- usePublicPageContext
26
- } from "./chunk-VYG4AXYW.js";
27
- import {
28
- OrganisationProvider_exports,
29
- UnifiedAuthProvider_exports,
30
- init_OrganisationProvider,
31
- init_UnifiedAuthProvider,
32
- useOrganisations,
33
- useUnifiedAuth
34
- } from "./chunk-BEZRLNK3.js";
35
- import {
36
- Button,
37
- Dialog,
38
- DialogContent,
39
- DialogHeader,
40
- DialogOverlay,
41
- DialogTitle,
42
- DialogTrigger,
43
- init_Button
44
- } from "./chunk-ETEJVKYK.js";
45
- import {
46
- LoadingSpinner
47
- } from "./chunk-CDQ3PX7L.js";
48
- import {
49
- performanceBudgetMonitor
50
- } from "./chunk-74C6SNEC.js";
51
- import {
52
- cn,
53
- init_cn
54
- } from "./chunk-OHXGNT3K.js";
55
- import {
56
- __require,
57
- __toCommonJS
58
- } from "./chunk-PLDDJCW6.js";
59
-
60
- // src/components/Card/Card.tsx
61
- init_cn();
62
- import * as React from "react";
63
- import { jsx } from "react/jsx-runtime";
64
- function getCardClasses(variant = "default", size = "default") {
65
- const baseClasses = "rounded-lg border bg-card text-card-foreground shadow-sm";
66
- const variantClasses = {
67
- default: "shadow-xl",
68
- outline: "border-2",
69
- ghost: "border-0 shadow-none"
70
- };
71
- const sizeClasses3 = {
72
- default: "",
73
- sm: "text-sm",
74
- lg: "text-lg"
75
- };
76
- return `${baseClasses} ${variantClasses[variant]} ${sizeClasses3[size]}`;
77
- }
78
- var Card = React.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx(
79
- "article",
80
- {
81
- ref,
82
- className: cn(
83
- "grid grid-rows-[auto_1fr_auto] min-w-0 overflow-visible",
84
- getCardClasses(variant, size),
85
- className
86
- ),
87
- ...props
88
- }
89
- ));
90
- Card.displayName = "Card";
91
- var CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
92
- "header",
93
- {
94
- ref,
95
- className: cn("flex flex-col space-y-1.5 p-6 min-w-0 w-full", className),
96
- ...props
97
- }
98
- ));
99
- CardHeader.displayName = "CardHeader";
100
- var CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
101
- "h3",
102
- {
103
- ref,
104
- className: cn(
105
- "text-2xl font-semibold leading-none tracking-tight",
106
- className
107
- ),
108
- ...props
109
- }
110
- ));
111
- CardTitle.displayName = "CardTitle";
112
- var CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
113
- "p",
114
- {
115
- ref,
116
- className: cn(className),
117
- ...props
118
- }
119
- ));
120
- CardDescription.displayName = "CardDescription";
121
- var CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
122
- "main",
123
- {
124
- ref,
125
- className: cn("p-6 pt-0 min-w-0 w-full", className),
126
- ...props
127
- }
128
- ));
129
- CardContent.displayName = "CardContent";
130
- var CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
131
- "footer",
132
- {
133
- ref,
134
- className: cn("flex items-center p-6 pt-0 min-w-0 w-full", className),
135
- ...props
136
- }
137
- ));
138
- CardFooter.displayName = "CardFooter";
139
- var CardActions = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
140
- "nav",
141
- {
142
- ref,
143
- className: cn("flex gap-2", className),
144
- role: "group",
145
- "aria-label": "Card actions",
146
- ...props
147
- }
148
- ));
149
- CardActions.displayName = "CardActions";
150
- var HoverCard = React.forwardRef(({ children, className, ...props }, ref) => {
151
- return /* @__PURE__ */ jsx(
152
- "section",
153
- {
154
- ref,
155
- className: cn("relative inline-block", className),
156
- ...props,
157
- children
158
- }
159
- );
160
- });
161
- HoverCard.displayName = "HoverCard";
162
- var HoverCardTrigger = React.forwardRef(({ className, asChild, children, ...props }, ref) => {
163
- if (asChild) {
164
- return /* @__PURE__ */ jsx("span", { className: cn("cursor-pointer", className), children });
165
- }
166
- return /* @__PURE__ */ jsx(
167
- "button",
168
- {
169
- ref,
170
- type: "button",
171
- className: cn(
172
- "cursor-pointer bg-transparent border-0 p-0 m-0 font-inherit color-inherit text-left",
173
- className
174
- ),
175
- ...props,
176
- children
177
- }
178
- );
179
- });
180
- HoverCardTrigger.displayName = "HoverCardTrigger";
181
- var HoverCardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
182
- "aside",
183
- {
184
- ref,
185
- className: cn(
186
- "absolute z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-4 text-popover-foreground shadow-md",
187
- className
188
- ),
189
- role: "tooltip",
190
- ...props
191
- }
192
- ));
193
- HoverCardContent.displayName = "HoverCardContent";
194
-
195
- // src/components/Label/Label.tsx
196
- init_cn();
197
- import * as React2 from "react";
198
- import * as LabelPrimitive from "@radix-ui/react-label";
199
- import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
200
- var getLabelClasses = () => {
201
- return "font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70";
202
- };
203
- var Label = React2.forwardRef(({
204
- className,
205
- required = false,
206
- requiredIndicator,
207
- hideRequiredIndicator = false,
208
- helperText,
209
- helperTextClassName,
210
- error,
211
- errorClassName,
212
- children,
213
- htmlFor,
214
- ...props
215
- }, ref) => {
216
- const hasError = !!error;
217
- const showHelperText = helperText && !hasError;
218
- return /* @__PURE__ */ jsxs(Fragment, { children: [
219
- /* @__PURE__ */ jsxs(
220
- LabelPrimitive.Root,
221
- {
222
- ref,
223
- className: cn(
224
- getLabelClasses(),
225
- hasError && "text-destructive",
226
- className
227
- ),
228
- htmlFor,
229
- ...props,
230
- children: [
231
- children,
232
- required && /* @__PURE__ */ jsx2(
233
- "label",
234
- {
235
- "aria-label": "required",
236
- className: cn(
237
- "text-destructive ml-1",
238
- hideRequiredIndicator && "sr-only"
239
- ),
240
- children: requiredIndicator || "*"
241
- }
242
- )
243
- ]
244
- }
245
- ),
246
- showHelperText && /* @__PURE__ */ jsx2("p", { className: cn("text-muted-foreground", helperTextClassName), children: helperText }),
247
- hasError && /* @__PURE__ */ jsx2(
248
- "p",
249
- {
250
- role: "alert",
251
- "aria-live": "polite",
252
- className: cn("text-destructive", errorClassName),
253
- children: error
254
- }
255
- )
256
- ] });
257
- });
258
- Label.displayName = LabelPrimitive.Root.displayName;
259
-
260
- // src/components/Avatar/Avatar.tsx
261
- init_cn();
262
- import * as React3 from "react";
263
- import * as AvatarPrimitive from "@radix-ui/react-avatar";
264
- import { jsx as jsx3 } from "react/jsx-runtime";
265
- var Avatar = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
266
- AvatarPrimitive.Root,
267
- {
268
- ref,
269
- className: cn(
270
- "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
271
- className
272
- ),
273
- ...props
274
- }
275
- ));
276
- Avatar.displayName = AvatarPrimitive.Root.displayName;
277
- var AvatarImage = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
278
- AvatarPrimitive.Image,
279
- {
280
- ref,
281
- className: cn("object-cover", className),
282
- ...props
283
- }
284
- ));
285
- AvatarImage.displayName = AvatarPrimitive.Image.displayName;
286
- var AvatarFallback = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
287
- AvatarPrimitive.Fallback,
288
- {
289
- ref,
290
- className: cn(
291
- "flex h-full w-full items-center justify-center rounded-full text-sec-50 bg-sec-500",
292
- className
293
- ),
294
- ...props
295
- }
296
- ));
297
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
298
-
299
- // src/components/Progress/Progress.tsx
300
- init_cn();
301
- import * as React4 from "react";
302
- import * as ProgressPrimitive from "@radix-ui/react-progress";
303
- import { jsx as jsx4 } from "react/jsx-runtime";
304
- var Progress = React4.forwardRef(({ className, value, max = 100, ...props }, ref) => /* @__PURE__ */ jsx4(
305
- ProgressPrimitive.Root,
306
- {
307
- ref,
308
- className: cn(
309
- "relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
310
- className
311
- ),
312
- ...props,
313
- value,
314
- max,
315
- "aria-valuenow": value,
316
- "aria-valuemax": max,
317
- "aria-valuemin": 0,
318
- children: /* @__PURE__ */ jsx4(
319
- ProgressPrimitive.Indicator,
320
- {
321
- className: "h-full w-full flex-1 bg-primary transition-all",
322
- style: { transform: `translateX(-${100 - (value || 0)}%)` }
323
- }
324
- )
325
- }
326
- ));
327
- Progress.displayName = ProgressPrimitive.Root.displayName;
328
-
329
- // src/components/Toast/Toast.tsx
330
- init_cn();
331
- import * as React5 from "react";
332
- import * as ToastPrimitives from "@radix-ui/react-toast";
333
- import { X } from "lucide-react";
334
- import { jsx as jsx5 } from "react/jsx-runtime";
335
- var ToastProvider = ToastPrimitives.Provider;
336
- var ToastViewport = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
337
- ToastPrimitives.Viewport,
338
- {
339
- ref,
340
- "data-testid": "toast-viewport",
341
- className: cn(
342
- "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
343
- className
344
- ),
345
- ...props
346
- }
347
- ));
348
- ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
349
- var Toast = React5.forwardRef(({ className, ...props }, ref) => {
350
- return /* @__PURE__ */ jsx5(
351
- ToastPrimitives.Root,
352
- {
353
- ref,
354
- "data-testid": "toast-root",
355
- className: cn(
356
- "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
357
- className
358
- ),
359
- ...props
360
- }
361
- );
362
- });
363
- Toast.displayName = ToastPrimitives.Root.displayName;
364
- var ToastAction = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
365
- ToastPrimitives.Action,
366
- {
367
- ref,
368
- "data-testid": "toast-action",
369
- className: cn(
370
- "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",
371
- className
372
- ),
373
- ...props
374
- }
375
- ));
376
- ToastAction.displayName = ToastPrimitives.Action.displayName;
377
- var ToastClose = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
378
- ToastPrimitives.Close,
379
- {
380
- ref,
381
- "data-testid": "toast-close",
382
- className: cn(
383
- "absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-acc-300 group-[.destructive]:hover:text-acc-50 group-[.destructive]:focus:ring-acc-400 group-[.destructive]:focus:ring-offset-acc-600",
384
- className
385
- ),
386
- "toast-close": "",
387
- ...props,
388
- children: /* @__PURE__ */ jsx5(X, { className: "h-4 w-4" })
389
- }
390
- ));
391
- ToastClose.displayName = ToastPrimitives.Close.displayName;
392
- var ToastTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
393
- ToastPrimitives.Title,
394
- {
395
- ref,
396
- "data-testid": "toast-title",
397
- className: cn("text-sm font-semibold", className),
398
- ...props
399
- }
400
- ));
401
- ToastTitle.displayName = ToastPrimitives.Title.displayName;
402
- var ToastDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
403
- ToastPrimitives.Description,
404
- {
405
- ref,
406
- "data-testid": "toast-description",
407
- className: cn("text-sm opacity-90", className),
408
- ...props
409
- }
410
- ));
411
- ToastDescription.displayName = ToastPrimitives.Description.displayName;
412
- function useToast() {
413
- return {
414
- toast: (props) => {
415
- console.log("Toast:", props);
416
- },
417
- dismiss: () => {
418
- console.log("Toast dismissed");
419
- }
420
- };
421
- }
422
- function Toaster() {
423
- return /* @__PURE__ */ jsx5(ToastProvider, { "data-testid": "toast-provider", children: /* @__PURE__ */ jsx5(ToastViewport, {}) });
424
- }
425
-
426
- // src/components/Form/Form.tsx
427
- init_cn();
428
- import { useForm, FormProvider } from "react-hook-form";
429
- import { zodResolver } from "@hookform/resolvers/zod";
430
- import { jsx as jsx6 } from "react/jsx-runtime";
431
- function Form({
432
- schema,
433
- defaultValues,
434
- onSubmit,
435
- onError,
436
- mode = "onSubmit",
437
- children,
438
- className
439
- }) {
440
- const methods = useForm({
441
- resolver: schema ? zodResolver(schema) : void 0,
442
- defaultValues,
443
- mode
444
- });
445
- const handleSubmit = methods.handleSubmit(onSubmit, onError);
446
- return /* @__PURE__ */ jsx6(FormProvider, { ...methods, children: /* @__PURE__ */ jsx6("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: typeof children === "function" ? children(methods) : children }) });
447
- }
448
-
449
- // src/components/LoginForm/LoginForm.tsx
450
- init_Button();
451
- import React6, { useState, useCallback, useMemo } from "react";
452
- init_cn();
453
- import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
454
- var LoginForm = React6.memo(({
455
- onSignIn,
456
- onSuccess,
457
- onError,
458
- isLoading = false,
459
- appName,
460
- title,
461
- subtitle,
462
- showSignUp = false,
463
- onSignUp,
464
- className
465
- }) => {
466
- const [formData, setFormData] = useState({ email: "", password: "" });
467
- const [error, setError] = useState(null);
468
- const isFormValid = useMemo(() => {
469
- return formData.email.length > 0 && formData.password.length > 0;
470
- }, [formData.email, formData.password]);
471
- const handleEmailChange = useCallback((e) => {
472
- setFormData((prev) => ({ ...prev, email: e.target.value }));
473
- }, []);
474
- const handlePasswordChange = useCallback((e) => {
475
- setFormData((prev) => ({ ...prev, password: e.target.value }));
476
- }, []);
477
- const handleSubmit = useCallback(async (e) => {
478
- e.preventDefault();
479
- setError(null);
480
- if (!isFormValid || isLoading) return;
481
- try {
482
- await onSignIn(formData);
483
- onSuccess?.();
484
- } catch (err) {
485
- const errorMessage = err instanceof Error ? err.message : "Sign in failed";
486
- setError(errorMessage);
487
- onError?.(err instanceof Error ? err : new Error(errorMessage));
488
- }
489
- }, [formData, isFormValid, isLoading, onSignIn, onSuccess, onError]);
490
- const handleSignUpClick = useCallback(() => {
491
- onSignUp?.();
492
- }, [onSignUp]);
493
- const displayTitle = useMemo(() => title || (appName ? `Sign in to ${appName}` : "Sign In"), [title, appName]);
494
- const displaySubtitle = useMemo(() => subtitle || "Enter your credentials to continue.", [subtitle]);
495
- return /* @__PURE__ */ jsx7(Card, { className: cn("w-full max-w-md mx-auto", className), children: /* @__PURE__ */ jsxs2("form", { onSubmit: handleSubmit, "data-testid": "login-form", children: [
496
- /* @__PURE__ */ jsxs2(CardHeader, { className: "space-y-1", children: [
497
- /* @__PURE__ */ jsx7(CardTitle, { className: "text-2xl text-center", children: displayTitle }),
498
- /* @__PURE__ */ jsx7(CardDescription, { className: "text-center", children: displaySubtitle })
499
- ] }),
500
- /* @__PURE__ */ jsxs2(CardContent, { className: "space-y-4", children: [
501
- error && /* @__PURE__ */ jsx7(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx7(AlertDescription, { children: error }) }),
502
- /* @__PURE__ */ jsx7(Label, { htmlFor: "email", children: "Email" }),
503
- /* @__PURE__ */ jsx7(
504
- Input,
505
- {
506
- id: "email",
507
- type: "email",
508
- placeholder: "Enter your email",
509
- value: formData.email,
510
- onChange: handleEmailChange,
511
- required: true,
512
- disabled: isLoading
513
- }
514
- ),
515
- /* @__PURE__ */ jsx7(Label, { htmlFor: "password", children: "Password" }),
516
- /* @__PURE__ */ jsx7(
517
- Input,
518
- {
519
- id: "password",
520
- type: "password",
521
- placeholder: "Enter your password",
522
- value: formData.password,
523
- onChange: handlePasswordChange,
524
- required: true,
525
- disabled: isLoading
526
- }
527
- )
528
- ] }),
529
- /* @__PURE__ */ jsxs2(CardFooter, { className: "flex flex-col space-y-4", children: [
530
- /* @__PURE__ */ jsx7(
531
- Button,
532
- {
533
- type: "submit",
534
- className: "w-full",
535
- disabled: isLoading || !isFormValid,
536
- children: isLoading ? "Signing in..." : "Sign In"
537
- }
538
- ),
539
- showSignUp && (onSignUp ? /* @__PURE__ */ jsx7("div", { className: "text-sm text-center text-muted-foreground", children: /* @__PURE__ */ jsx7(
540
- "button",
541
- {
542
- type: "button",
543
- onClick: handleSignUpClick,
544
- className: "text-primary hover:underline",
545
- children: "Don't have an account? Sign up"
546
- }
547
- ) }) : /* @__PURE__ */ jsxs2("p", { className: "text-center text-muted-foreground", children: [
548
- "Don't have an account?",
549
- " ",
550
- /* @__PURE__ */ jsx7("a", { href: "/signup", className: "text-primary hover:underline", children: "Sign up" })
551
- ] }))
552
- ] })
553
- ] }) });
554
- });
555
-
556
- // src/components/EventSelector/EventSelector.tsx
557
- init_Button();
558
- init_EventProvider();
559
- import { RefreshCw, AlertCircle, Lock, Calendar, Star } from "lucide-react";
560
- import { useEffect, useMemo as useMemo2 } from "react";
561
- import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
562
- function EventSelector({
563
- placeholder = "Select an event",
564
- className,
565
- onEventChange,
566
- showNoEventsMessage = true,
567
- showRetryButton = true,
568
- showEventDetails = true,
569
- showNextEventIndicator = true
570
- }) {
571
- const {
572
- events,
573
- selectedEvent,
574
- isLoading,
575
- error,
576
- setSelectedEvent,
577
- refreshEvents
578
- } = useEvents();
579
- const handleValueChange = (eventId) => {
580
- const event = events.find((e) => (e.event_id || e.id) === eventId);
581
- if (event) {
582
- setSelectedEvent(event);
583
- if (onEventChange) {
584
- onEventChange(event);
585
- }
586
- }
587
- };
588
- const handleRetry = () => {
589
- refreshEvents();
590
- };
591
- const isNextEvent = (event) => {
592
- if (!event.event_date) return false;
593
- const now = /* @__PURE__ */ new Date();
594
- const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
595
- const eventDate = new Date(event.event_date);
596
- return eventDate >= today;
597
- };
598
- const formatEventDate = (dateString) => {
599
- const date = new Date(dateString);
600
- const today = /* @__PURE__ */ new Date();
601
- const tomorrow = new Date(today);
602
- tomorrow.setDate(tomorrow.getDate() + 1);
603
- const normalizeDate = (d) => {
604
- const normalized = new Date(d);
605
- normalized.setHours(0, 0, 0, 0);
606
- return normalized;
607
- };
608
- const normalizedDate = normalizeDate(date);
609
- const normalizedToday = normalizeDate(today);
610
- const normalizedTomorrow = normalizeDate(tomorrow);
611
- if (normalizedDate.getTime() === normalizedToday.getTime()) {
612
- return "Today";
613
- } else if (normalizedDate.getTime() === normalizedTomorrow.getTime()) {
614
- return "Tomorrow";
615
- } else {
616
- return date.toLocaleDateString();
617
- }
618
- };
619
- const sortedEvents = useMemo2(() => {
620
- const getTime = (e) => e.event_date ? new Date(e.event_date).getTime() : Number.NEGATIVE_INFINITY;
621
- return [...events].sort((a, b) => getTime(b) - getTime(a));
622
- }, [events]);
623
- useEffect(() => {
624
- if (!selectedEvent && events.length > 0) {
625
- const today = /* @__PURE__ */ new Date();
626
- const startOfToday = new Date(today.getFullYear(), today.getMonth(), today.getDate()).getTime();
627
- const next = [...events].filter((e) => e.event_date && new Date(e.event_date).getTime() >= startOfToday).sort((a, b) => new Date(a.event_date).getTime() - new Date(b.event_date).getTime())[0];
628
- if (next) {
629
- setSelectedEvent(next);
630
- if (onEventChange) onEventChange(next);
631
- }
632
- }
633
- }, [events, selectedEvent, setSelectedEvent, onEventChange]);
634
- if (isLoading) {
635
- return /* @__PURE__ */ jsxs3("div", { className: `flex items-center gap-2 ${className}`, children: [
636
- /* @__PURE__ */ jsx8(LoadingSpinner, { size: "sm" }),
637
- /* @__PURE__ */ jsx8("span", { className: "text-sm text-muted-foreground", children: "Loading events..." })
638
- ] });
639
- }
640
- if (error) {
641
- return /* @__PURE__ */ jsx8("div", { className, children: /* @__PURE__ */ jsxs3(Alert, { variant: "destructive", children: [
642
- /* @__PURE__ */ jsx8(Lock, { className: "h-4 w-4" }),
643
- /* @__PURE__ */ jsxs3(AlertDescription, { className: "flex items-center justify-between", children: [
644
- /* @__PURE__ */ jsx8("span", { children: error.message }),
645
- showRetryButton && /* @__PURE__ */ jsxs3(
646
- Button,
647
- {
648
- variant: "outline",
649
- size: "sm",
650
- onClick: handleRetry,
651
- className: "ml-2",
652
- children: [
653
- /* @__PURE__ */ jsx8(RefreshCw, { className: "h-3 w-3 mr-1" }),
654
- "Retry"
655
- ]
656
- }
657
- )
658
- ] })
659
- ] }) });
660
- }
661
- if (events.length === 0) {
662
- if (showNoEventsMessage) {
663
- return /* @__PURE__ */ jsx8("div", { className, children: /* @__PURE__ */ jsxs3(Alert, { variant: "inline", children: [
664
- /* @__PURE__ */ jsx8(AlertCircle, { className: "h-4 w-4 text-acc-700" }),
665
- /* @__PURE__ */ jsxs3(AlertDescription, { className: "flex items-center justify-between", children: [
666
- /* @__PURE__ */ jsx8("span", { children: "No events available." }),
667
- showRetryButton && /* @__PURE__ */ jsxs3(
668
- Button,
669
- {
670
- variant: "outline",
671
- size: "sm",
672
- onClick: handleRetry,
673
- className: "ml-2",
674
- children: [
675
- /* @__PURE__ */ jsx8(RefreshCw, { className: "h-3 w-3 mr-1" }),
676
- "Refresh"
677
- ]
678
- }
679
- )
680
- ] })
681
- ] }) });
682
- }
683
- return null;
684
- }
685
- return /* @__PURE__ */ jsxs3(
686
- Select,
687
- {
688
- value: selectedEvent ? selectedEvent.event_id || selectedEvent.id : "",
689
- onValueChange: handleValueChange,
690
- className,
691
- children: [
692
- /* @__PURE__ */ jsx8(SelectTrigger, { className: "text-left", variant: "outline", children: /* @__PURE__ */ jsx8(SelectValue, { placeholder, children: selectedEvent && /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
693
- /* @__PURE__ */ jsx8(Calendar, { className: "h-4 w-4 flex-shrink-0" }),
694
- /* @__PURE__ */ jsx8("span", { className: "truncate", children: selectedEvent.event_name || selectedEvent.name }),
695
- selectedEvent.event_date && /* @__PURE__ */ jsxs3("span", { className: "text-xs text-muted-foreground flex-shrink-0", children: [
696
- "(",
697
- formatEventDate(selectedEvent.event_date),
698
- ")"
699
- ] })
700
- ] }) }) }),
701
- /* @__PURE__ */ jsx8(SelectContent, { children: sortedEvents.map((event) => {
702
- const isNext = isNextEvent(event);
703
- const isSelected = selectedEvent && (selectedEvent.event_id === event.event_id || selectedEvent.id === event.id);
704
- return /* @__PURE__ */ jsx8(
705
- SelectItem,
706
- {
707
- value: event.event_id || event.id,
708
- className: "flex items-center justify-between",
709
- children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 w-full", children: [
710
- showNextEventIndicator && isNext && /* @__PURE__ */ jsx8(Star, { className: "h-3 w-3 text-acc-500" }),
711
- /* @__PURE__ */ jsxs3("div", { className: "flex-1", children: [
712
- /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2", children: [
713
- /* @__PURE__ */ jsx8("span", { className: isSelected ? "font-semibold" : "", children: event.event_name || event.name }),
714
- isSelected && /* @__PURE__ */ jsx8("span", { className: "text-xs bg-primary text-primary-foreground px-1 rounded", children: "Current" })
715
- ] }),
716
- showEventDetails && event.event_date && /* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
717
- /* @__PURE__ */ jsx8(Calendar, { className: "h-3 w-3" }),
718
- /* @__PURE__ */ jsx8("span", { children: formatEventDate(event.event_date) }),
719
- showNextEventIndicator && isNext && /* @__PURE__ */ jsx8("span", { className: "text-acc-600 font-medium", children: "(Next)" })
720
- ] }),
721
- showEventDetails && event.event_venue && /* @__PURE__ */ jsxs3("div", { className: "text-xs text-muted-foreground", children: [
722
- "\u{1F4CD} ",
723
- event.event_venue
724
- ] })
725
- ] })
726
- ] })
727
- },
728
- event.event_id || event.id
729
- );
730
- }) })
731
- ]
732
- }
733
- );
734
- }
735
-
736
- // src/components/PasswordReset/PasswordChangeForm.tsx
737
- init_Button();
738
- import { useState as useState2 } from "react";
739
- init_cn();
740
- import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
741
- function PasswordChangeForm({ onSubmit, className }) {
742
- const [newPassword, setNewPassword] = useState2("");
743
- const [confirmPassword, setConfirmPassword] = useState2("");
744
- const [error, setError] = useState2(null);
745
- const [isSubmitting, setIsSubmitting] = useState2(false);
746
- const handleSubmit = async (e) => {
747
- e.preventDefault();
748
- setError(null);
749
- if (newPassword.length < 8) {
750
- setError("Password must be at least 8 characters.");
751
- return;
752
- }
753
- if (newPassword !== confirmPassword) {
754
- setError("Passwords do not match.");
755
- return;
756
- }
757
- setIsSubmitting(true);
758
- try {
759
- const result = await onSubmit({ newPassword, confirmPassword });
760
- if (result && result.error) {
761
- setError(result.error.message || "Failed to change password.");
762
- }
763
- } catch (err) {
764
- setError(err?.message || "An unexpected error occurred.");
765
- } finally {
766
- setIsSubmitting(false);
767
- }
768
- };
769
- return /* @__PURE__ */ jsxs4("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: [
770
- error && /* @__PURE__ */ jsx9("div", { role: "alert", children: error }),
771
- /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
772
- /* @__PURE__ */ jsx9(Label, { htmlFor: "new-password", children: "New Password" }),
773
- /* @__PURE__ */ jsx9(
774
- Input,
775
- {
776
- id: "new-password",
777
- type: "password",
778
- value: newPassword,
779
- onChange: (e) => setNewPassword(e.target.value),
780
- required: true,
781
- disabled: isSubmitting
782
- }
783
- )
784
- ] }),
785
- /* @__PURE__ */ jsxs4("div", { className: "space-y-2", children: [
786
- /* @__PURE__ */ jsx9(Label, { htmlFor: "confirm-password", children: "Confirm Password" }),
787
- /* @__PURE__ */ jsx9(
788
- Input,
789
- {
790
- id: "confirm-password",
791
- type: "password",
792
- value: confirmPassword,
793
- onChange: (e) => setConfirmPassword(e.target.value),
794
- required: true,
795
- disabled: isSubmitting
796
- }
797
- )
798
- ] }),
799
- /* @__PURE__ */ jsx9(
800
- Button,
801
- {
802
- type: "submit",
803
- className: "w-full",
804
- disabled: isSubmitting || !newPassword || !confirmPassword,
805
- children: isSubmitting ? "Changing..." : "Change Password"
806
- }
807
- )
808
- ] });
809
- }
810
-
811
- // src/components/Button/index.ts
812
- init_Button();
813
-
814
- // src/components/UserMenu/UserMenu.tsx
815
- import React8, { useCallback as useCallback2, useMemo as useMemo3, useState as useState3 } from "react";
816
- import { ChevronDown, LogOut, KeyRound } from "lucide-react";
817
- import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
818
- var UserMenu = React8.memo(function UserMenu2({
819
- user,
820
- onSignOut,
821
- onChangePassword,
822
- className,
823
- showAvatar = true
824
- }) {
825
- const [isPasswordDialogOpen, setPasswordDialogOpen] = useState3(false);
826
- const userInfo = useMemo3(() => {
827
- if (!user) return null;
828
- return {
829
- email: user.email,
830
- displayName: user.user_metadata?.display_name || user.user_metadata?.full_name || user.email?.split("@")[0],
831
- avatarUrl: user.user_metadata?.avatar_url,
832
- initial: (user.user_metadata?.display_name || user.user_metadata?.full_name || user.email || "U").charAt(0).toUpperCase()
833
- };
834
- }, [user]);
835
- const handleSignOut = useCallback2(async () => {
836
- if (onSignOut) await onSignOut();
837
- }, [onSignOut]);
838
- if (!user || !userInfo) {
839
- return null;
840
- }
841
- return /* @__PURE__ */ jsxs5(Dialog, { open: isPasswordDialogOpen, onOpenChange: setPasswordDialogOpen, children: [
842
- /* @__PURE__ */ jsxs5(Select, { className, children: [
843
- /* @__PURE__ */ jsx10(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs5(Button, { variant: "outline", className: "flex items-center gap-2", "aria-label": userInfo.displayName, children: [
844
- showAvatar && /* @__PURE__ */ jsxs5(Avatar, { className: "h-8 w-8", children: [
845
- /* @__PURE__ */ jsx10(AvatarImage, { src: userInfo.avatarUrl, alt: userInfo.displayName }),
846
- /* @__PURE__ */ jsx10(AvatarFallback, { children: userInfo.initial })
847
- ] }),
848
- /* @__PURE__ */ jsx10("span", { className: "hidden sm:inline-block", children: userInfo.displayName }),
849
- /* @__PURE__ */ jsx10(ChevronDown, { className: "h-4 w-4" })
850
- ] }) }),
851
- /* @__PURE__ */ jsxs5(SelectContent, { children: [
852
- /* @__PURE__ */ jsx10(SelectLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs5("div", { className: "flex flex-col space-y-1", children: [
853
- /* @__PURE__ */ jsx10("p", { className: "font-medium", children: userInfo.displayName }),
854
- /* @__PURE__ */ jsx10("p", { className: "text-muted-foreground", children: userInfo.email })
855
- ] }) }),
856
- /* @__PURE__ */ jsx10(SelectSeparator, {}),
857
- /* @__PURE__ */ jsx10(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs5(SelectItem, { value: "change-password", children: [
858
- /* @__PURE__ */ jsx10(KeyRound, { className: "mr-2 h-4 w-4" }),
859
- /* @__PURE__ */ jsx10("span", { children: "Change Password" })
860
- ] }) }),
861
- /* @__PURE__ */ jsxs5(SelectItem, { value: "sign-out", onClick: handleSignOut, children: [
862
- /* @__PURE__ */ jsx10(LogOut, { className: "mr-2 h-4 w-4" }),
863
- /* @__PURE__ */ jsx10("span", { children: "Sign out" })
864
- ] })
865
- ] })
866
- ] }),
867
- /* @__PURE__ */ jsx10(DialogOverlay, {}),
868
- /* @__PURE__ */ jsxs5(DialogContent, { className, children: [
869
- /* @__PURE__ */ jsx10(DialogHeader, { children: /* @__PURE__ */ jsx10(DialogTitle, { children: "Change Password" }) }),
870
- /* @__PURE__ */ jsx10(
871
- PasswordChangeForm,
872
- {
873
- onSubmit: async ({ newPassword, confirmPassword }) => {
874
- if (onChangePassword) {
875
- const { error } = await onChangePassword(newPassword, confirmPassword);
876
- if (!error) {
877
- setPasswordDialogOpen(false);
878
- }
879
- return { error };
880
- }
881
- return {};
882
- }
883
- }
884
- )
885
- ] })
886
- ] });
887
- });
888
- var UserMenuLoading = React8.memo(function UserMenuLoading2() {
889
- return /* @__PURE__ */ jsxs5("div", { className: "relative inline-block text-left", children: [
890
- /* @__PURE__ */ jsxs5(
891
- "button",
892
- {
893
- type: "button",
894
- disabled: true,
895
- className: "flex items-center space-x-2 px-3 py-2 text-sm font-medium text-muted-foreground bg-muted border border-input rounded-md",
896
- children: [
897
- /* @__PURE__ */ jsx10("div", { className: "w-6 h-6 rounded-full bg-muted animate-pulse" }),
898
- /* @__PURE__ */ jsx10("span", { className: "truncate max-w-[150px]", children: "Loading..." }),
899
- /* @__PURE__ */ jsx10(ChevronDown, { className: "w-4 h-4 text-muted-foreground" })
900
- ]
901
- }
902
- ),
903
- /* @__PURE__ */ jsx10("div", { role: "status", "aria-label": "Loading user menu", "aria-live": "polite", className: "w-6 h-6 rounded-full bg-muted animate-pulse" })
904
- ] });
905
- });
906
- UserMenu.Loading = UserMenuLoading;
907
-
908
- // src/components/NavigationMenu/NavigationMenu.tsx
909
- import * as React9 from "react";
910
- import { ChevronDown as ChevronDown2 } from "lucide-react";
911
- init_UnifiedAuthProvider();
912
- import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
913
- var NavigationMenu = React9.forwardRef(({
914
- items,
915
- mode = "dropdown",
916
- currentPath,
917
- onNavigate,
918
- className,
919
- disabled = false,
920
- buttonText = "Menu",
921
- showIcons = true,
922
- navigationLabel = "Main navigation",
923
- // NEW: Phase 2 - Enhanced Security Features
924
- strictMode = true,
925
- auditLog = true,
926
- onNavigationAccessDenied,
927
- onStrictModeViolation,
928
- filterByPermissions = true,
929
- ...props
930
- }, ref) => {
931
- const [expandedItems, setExpandedItems] = React9.useState(/* @__PURE__ */ new Set());
932
- const buttonRef = React9.useRef(null);
933
- let authContext = null;
934
- try {
935
- authContext = useUnifiedAuth();
936
- } catch (error) {
937
- console.warn("[NavigationMenu] useUnifiedAuth not available, running in unauthenticated mode");
938
- }
939
- const filteredItems = React9.useMemo(() => {
940
- if (!filterByPermissions || !authContext) return items || [];
941
- return (items || []).filter((item) => {
942
- if (item.meta?.hidden) return false;
943
- if (item.permissions && item.permissions.length > 0) {
944
- const hasPermission = item.permissions.some((permission) => {
945
- if (typeof permission !== "string") return true;
946
- return authContext.hasPermission(permission);
947
- });
948
- if (!hasPermission) return false;
949
- }
950
- if (item.roles && item.roles.length > 0) {
951
- const hasRole = item.roles.some((role) => {
952
- if (typeof role !== "string") return true;
953
- return authContext.hasRole(role);
954
- });
955
- if (!hasRole) return false;
956
- }
957
- if (item.accessLevel) {
958
- if (typeof item.accessLevel === "string") {
959
- const accessLevel = item.accessLevel;
960
- const hasAccessLevel = authContext.hasAccessLevel(accessLevel);
961
- if (!hasAccessLevel) return false;
962
- }
963
- }
964
- return true;
965
- });
966
- }, [items, filterByPermissions, authContext]);
967
- React9.useEffect(() => {
968
- if (auditLog && authContext) {
969
- console.log("[NavigationMenu] Navigation access attempt:", {
970
- itemId: "navigation-menu",
971
- label: "Navigation Menu",
972
- href: currentPath,
973
- permissions: authContext.permissions,
974
- roles: authContext.roles,
975
- accessLevel: authContext.accessLevel,
976
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
977
- });
978
- }
979
- }, [auditLog, authContext, currentPath]);
980
- const handleHierarchicalKeyDown = (event, item) => {
981
- switch (event.key) {
982
- case "Enter":
983
- case " ":
984
- event.preventDefault();
985
- if (item.children && item.children.length > 0) {
986
- toggleExpanded(item.id);
987
- } else if (item.href) {
988
- onNavigate?.(item);
989
- }
990
- break;
991
- case "Escape":
992
- if (expandedItems.has(item.id)) {
993
- toggleExpanded(item.id);
994
- }
995
- break;
996
- }
997
- };
998
- const toggleExpanded = (itemId) => {
999
- const newExpanded = new Set(expandedItems);
1000
- if (newExpanded.has(itemId)) {
1001
- newExpanded.delete(itemId);
1002
- } else {
1003
- newExpanded.add(itemId);
1004
- }
1005
- setExpandedItems(newExpanded);
1006
- };
1007
- const handleItemClick = (item) => {
1008
- if (auditLog) {
1009
- console.log(`[NavigationMenu] Navigation access attempt:`, {
1010
- itemId: item.id,
1011
- label: item.label,
1012
- href: item.href,
1013
- permissions: item.permissions,
1014
- roles: item.roles,
1015
- accessLevel: item.accessLevel,
1016
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1017
- });
1018
- }
1019
- const hasPermission = true;
1020
- if (!hasPermission) {
1021
- if (onNavigationAccessDenied) {
1022
- onNavigationAccessDenied(item.id, "Insufficient permissions");
1023
- }
1024
- if (strictMode) {
1025
- console.error(`[NavigationMenu] STRICT MODE VIOLATION: User attempted to access protected navigation item without permission`, {
1026
- itemId: item.id,
1027
- label: item.label,
1028
- href: item.href,
1029
- permissions: item.permissions,
1030
- roles: item.roles,
1031
- accessLevel: item.accessLevel,
1032
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1033
- });
1034
- if (onStrictModeViolation) {
1035
- onStrictModeViolation(item.id, "Insufficient permissions");
1036
- }
1037
- }
1038
- return;
1039
- }
1040
- if (onNavigate) {
1041
- onNavigate(item);
1042
- } else if (item.href) {
1043
- window.location.href = item.href;
1044
- }
1045
- };
1046
- const isActiveItem = (item) => {
1047
- if (item.isActive !== void 0) return item.isActive;
1048
- if (currentPath === item.href) return true;
1049
- if (item.children && item.children.length > 0) {
1050
- return item.children.some((child) => isActiveItem(child));
1051
- }
1052
- return false;
1053
- };
1054
- const handleNavigationSelect = (itemId) => {
1055
- const item = filteredItems.find((i) => i.id === itemId);
1056
- if (item) {
1057
- handleItemClick(item);
1058
- }
1059
- };
1060
- const renderHierarchicalItem = (item, level = 0) => {
1061
- const hasChildren = item.children && item.children.length > 0;
1062
- const isExpanded = expandedItems.has(item.id);
1063
- const itemIsActive = isActiveItem(item);
1064
- return /* @__PURE__ */ jsx11("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs6("div", { children: [
1065
- /* @__PURE__ */ jsxs6(
1066
- "button",
1067
- {
1068
- onClick: () => toggleExpanded(item.id),
1069
- onKeyDown: (e) => handleHierarchicalKeyDown(e, item),
1070
- "aria-expanded": isExpanded,
1071
- "aria-controls": `submenu-${item.id}`,
1072
- "aria-current": itemIsActive ? "page" : void 0,
1073
- children: [
1074
- /* @__PURE__ */ jsx11("span", { children: item.label }),
1075
- /* @__PURE__ */ jsx11(ChevronDown2, { "aria-hidden": "true" })
1076
- ]
1077
- }
1078
- ),
1079
- isExpanded && item.children && /* @__PURE__ */ jsx11(
1080
- "ul",
1081
- {
1082
- id: `submenu-${item.id}`,
1083
- role: "menu",
1084
- "aria-label": `${item.label} submenu`,
1085
- children: item.children.map((child) => /* @__PURE__ */ jsx11(React9.Fragment, { children: renderHierarchicalItem(child, level + 1) }, child.id))
1086
- }
1087
- )
1088
- ] }) : /* @__PURE__ */ jsx11(
1089
- "a",
1090
- {
1091
- href: item.href || "#",
1092
- onClick: (e) => {
1093
- if (onNavigate && item.href) {
1094
- e.preventDefault();
1095
- onNavigate(item);
1096
- }
1097
- },
1098
- onKeyDown: (e) => handleHierarchicalKeyDown(e, item),
1099
- role: "menuitem",
1100
- "aria-current": itemIsActive ? "page" : void 0,
1101
- children: item.label
1102
- }
1103
- ) });
1104
- };
1105
- if (mode === "dropdown") {
1106
- return /* @__PURE__ */ jsxs6(
1107
- Select,
1108
- {
1109
- onValueChange: handleNavigationSelect,
1110
- className,
1111
- "data-testid": "navigation-menu-root",
1112
- children: [
1113
- /* @__PURE__ */ jsx11(
1114
- SelectTrigger,
1115
- {
1116
- ref: buttonRef,
1117
- disabled,
1118
- "aria-label": buttonText,
1119
- "data-testid": "navigation-menu-trigger",
1120
- children: /* @__PURE__ */ jsx11(SelectValue, { placeholder: buttonText })
1121
- }
1122
- ),
1123
- /* @__PURE__ */ jsx11(SelectContent, { children: filteredItems.map((item) => {
1124
- const isActive = isActiveItem(item);
1125
- return /* @__PURE__ */ jsx11(
1126
- SelectItem,
1127
- {
1128
- value: item.id,
1129
- disabled: !item.href,
1130
- "data-testid": `navigation-menu-item-${item.id}`,
1131
- children: item.label
1132
- },
1133
- item.id
1134
- );
1135
- }) })
1136
- ]
1137
- }
1138
- );
1139
- }
1140
- return /* @__PURE__ */ jsx11(
1141
- "nav",
1142
- {
1143
- ref,
1144
- className,
1145
- "aria-label": navigationLabel,
1146
- ...props,
1147
- children: /* @__PURE__ */ jsx11("ul", { role: "menubar", children: filteredItems.map((item) => /* @__PURE__ */ jsx11(React9.Fragment, { children: renderHierarchicalItem(item, 0) }, item.id)) })
1148
- }
1149
- );
1150
- });
1151
- NavigationMenu.displayName = "NavigationMenu";
1152
-
1153
- // src/components/Header/Header.tsx
1154
- init_cn();
1155
- import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
1156
- function Header({
1157
- logoUrl,
1158
- logoAlt = "Logo",
1159
- logo,
1160
- navItems = [],
1161
- user,
1162
- onSignOut,
1163
- onChangePassword,
1164
- actions,
1165
- userMenu,
1166
- className,
1167
- showEventSelector = true,
1168
- showUserMenu = true,
1169
- currentPath,
1170
- onNavigate
1171
- }) {
1172
- return /* @__PURE__ */ jsx12("header", { className: cn(
1173
- "w-full border-b border-main-200 h-16 shadow-sm bg-main-100 ",
1174
- className
1175
- ), role: "banner", children: /* @__PURE__ */ jsxs7("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: [
1176
- logo ? logo : logoUrl ? /* @__PURE__ */ jsx12(
1177
- "img",
1178
- {
1179
- src: logoUrl,
1180
- alt: logoAlt || "Logo",
1181
- className: "h-[2.15rem] w-auto max-w-[200px] object-contain rounded-md shadow-md bg-transparent"
1182
- }
1183
- ) : /* @__PURE__ */ jsx12(
1184
- "img",
1185
- {
1186
- src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' fill='%23000'/%3E%3Ctext x='16' y='20' text-anchor='middle' fill='white' font-family='Arial' font-size='14' font-weight='bold'%3EL%3C/text%3E%3C/svg%3E",
1187
- alt: logoAlt || "Logo",
1188
- className: "h-8 w-8 shadow-md"
1189
- }
1190
- ),
1191
- navItems && navItems.length > 0 && /* @__PURE__ */ jsx12(
1192
- NavigationMenu,
1193
- {
1194
- items: navItems,
1195
- currentPath,
1196
- onNavigate,
1197
- buttonText: "Menu",
1198
- className: "w-48"
1199
- }
1200
- ),
1201
- showEventSelector && /* @__PURE__ */ jsx12(
1202
- EventSelector,
1203
- {
1204
- placeholder: "Select event",
1205
- className: "justify-self-end hidden sm:block w-96",
1206
- "data-testid": "event-selector"
1207
- }
1208
- ),
1209
- actions,
1210
- showUserMenu && (userMenu ? userMenu : /* @__PURE__ */ jsx12(
1211
- UserMenu,
1212
- {
1213
- user: user || null,
1214
- onSignOut,
1215
- onChangePassword,
1216
- className: "w-70"
1217
- }
1218
- ))
1219
- ] }) });
1220
- }
1221
-
1222
- // src/components/Footer/Footer.tsx
1223
- init_cn();
1224
- import React10 from "react";
1225
- import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
1226
- var FooterComponent = ({
1227
- companyName = "Solvera Solutions Pty Ltd",
1228
- year = (/* @__PURE__ */ new Date()).getFullYear(),
1229
- links,
1230
- className = "",
1231
- logo,
1232
- copyright,
1233
- children
1234
- }) => {
1235
- const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
1236
- return /* @__PURE__ */ jsx13("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs8("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
1237
- logo && /* @__PURE__ */ jsx13("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
1238
- children && /* @__PURE__ */ jsx13(Fragment3, { children }),
1239
- /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: copyrightText }),
1240
- links && links.length > 0 && /* @__PURE__ */ jsx13("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsx13("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
1241
- ] }) });
1242
- };
1243
- FooterComponent.displayName = "Footer";
1244
- var Footer = React10.memo(FooterComponent);
1245
- Footer.displayName = "Footer";
1246
-
1247
- // src/components/PaceAppLayout/PaceAppLayout.tsx
1248
- init_UnifiedAuthProvider();
1249
- import { useState as useState5, useEffect as useEffect3, useMemo as useMemo5, useCallback as useCallback3 } from "react";
1250
- import { Outlet, useNavigate, useLocation } from "react-router-dom";
1251
- import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
1252
- var EMPTY_PAGE_ID_MAPPING = {};
1253
- var EMPTY_ROUTE_PERMISSIONS = {};
1254
- function PaceAppLayout({
1255
- appName,
1256
- navItems,
1257
- showEventSelector,
1258
- headerActions,
1259
- customLogo,
1260
- customUserMenu,
1261
- headerClassName,
1262
- showUserMenu = true,
1263
- enforcePermissions = false,
1264
- defaultPermission = "read",
1265
- routePermissions = EMPTY_ROUTE_PERMISSIONS,
1266
- permissionFallback,
1267
- filterNavigationByPermissions = false,
1268
- pageIdMapping = EMPTY_PAGE_ID_MAPPING,
1269
- // NEW: Phase 1 - Enhanced Security Features
1270
- strictMode = true,
1271
- enforcePagePermissions = false,
1272
- pagePermissionFallback,
1273
- auditLog = true,
1274
- onPageAccessDenied,
1275
- onStrictModeViolation,
1276
- // NEW: Phase 2 - Enhanced Routing Features
1277
- roleBasedRouting = false,
1278
- routeConfig = [],
1279
- fallbackRoute = "/unauthorized",
1280
- onRouteAccessDenied,
1281
- onRouteStrictModeViolation
1282
- }) {
1283
- const { user, signOut, updatePassword } = useUnifiedAuth();
1284
- const navigate = useNavigate();
1285
- const location = useLocation();
1286
- const checkPermission = useCallback3(async (permission, pageId) => {
1287
- try {
1288
- if (!user?.id) return false;
1289
- const scope = {
1290
- organisationId: user.user_metadata?.organisationId || user.app_metadata?.organisationId,
1291
- eventId: user.user_metadata?.eventId || user.app_metadata?.eventId,
1292
- appId: user.user_metadata?.appId || user.app_metadata?.appId
1293
- };
1294
- const { isSuperAdmin } = await import("./api-ETQ6YJ3C.js");
1295
- const isSuper = await isSuperAdmin(user.id);
1296
- if (isSuper) {
1297
- return true;
1298
- }
1299
- if (!scope.organisationId) {
1300
- console.warn("No organisation context available for permission check, denying access");
1301
- return false;
1302
- }
1303
- return await isPermitted({
1304
- userId: user.id,
1305
- scope,
1306
- permission,
1307
- pageId
1308
- });
1309
- } catch (error) {
1310
- console.error("Permission check failed:", error);
1311
- throw error;
1312
- }
1313
- }, [user?.id]);
1314
- const [hasPermission, setHasPermission] = useState5(null);
1315
- const [isCheckingPermission, setIsCheckingPermission] = useState5(false);
1316
- const [permissionError, setPermissionError] = useState5(null);
1317
- const defaultNavItems = useMemo5(() => [
1318
- { id: "home", label: "Home", href: "/", icon: "Home" },
1319
- { id: "dashboard", label: "Dashboard", href: "/dashboard", icon: "LayoutDashboard" },
1320
- { id: "settings", label: "Settings", href: "/settings", icon: "Settings" },
1321
- { id: "ui-showcase", label: "UI Showcase", href: "/ui-showcase", icon: "Component" },
1322
- { id: "data-table-showcase", label: "DataTable Showcase", href: "/data-table-showcase", icon: "Table" }
1323
- ], []);
1324
- const baseMenuItems = useMemo5(() => navItems || defaultNavItems, [navItems]);
1325
- const currentRoutePermission = useMemo5(() => {
1326
- const currentPath = location.pathname;
1327
- return routePermissions[currentPath] || defaultPermission;
1328
- }, [location.pathname, routePermissions, defaultPermission]);
1329
- const currentPageId = useMemo5(() => {
1330
- const currentPath = location.pathname;
1331
- return pageIdMapping[currentPath] || currentPath.slice(1) || "home";
1332
- }, [location.pathname, pageIdMapping]);
1333
- useEffect3(() => {
1334
- if (!enforcePermissions) {
1335
- setHasPermission(true);
1336
- return;
1337
- }
1338
- let isMounted = true;
1339
- const checkRoutePermission = async () => {
1340
- if (!isMounted) return;
1341
- setIsCheckingPermission(true);
1342
- setPermissionError(null);
1343
- try {
1344
- const hasAccess = await checkPermission(currentRoutePermission, currentPageId);
1345
- if (!isMounted) return;
1346
- setHasPermission(hasAccess);
1347
- if (auditLog) {
1348
- console.log(`[PaceAppLayout] Page access attempt:`, {
1349
- pageName: currentPageId,
1350
- operation: currentRoutePermission,
1351
- userId: user?.id,
1352
- allowed: hasAccess,
1353
- strictMode,
1354
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1355
- });
1356
- }
1357
- if (strictMode && !hasAccess) {
1358
- console.error(`[PaceAppLayout] STRICT MODE VIOLATION: User attempted to access protected page without permission`, {
1359
- pageName: currentPageId,
1360
- operation: currentRoutePermission,
1361
- userId: user?.id,
1362
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1363
- });
1364
- if (onStrictModeViolation) {
1365
- onStrictModeViolation(currentPageId, currentRoutePermission);
1366
- }
1367
- }
1368
- if (!hasAccess && onPageAccessDenied) {
1369
- onPageAccessDenied(currentPageId, currentRoutePermission);
1370
- }
1371
- } catch (error) {
1372
- if (!isMounted) return;
1373
- console.error(`[PaceAppLayout] Permission check failed for ${currentPageId}:`, error);
1374
- setPermissionError(error instanceof Error ? error : new Error("Permission check failed"));
1375
- setHasPermission(false);
1376
- } finally {
1377
- if (isMounted) {
1378
- setIsCheckingPermission(false);
1379
- }
1380
- }
1381
- };
1382
- checkRoutePermission();
1383
- return () => {
1384
- isMounted = false;
1385
- };
1386
- }, [enforcePermissions, currentRoutePermission, currentPageId, strictMode, user?.id]);
1387
- const [filteredMenuItems, setFilteredMenuItems] = useState5(baseMenuItems);
1388
- useEffect3(() => {
1389
- if (!filterNavigationByPermissions || !enforcePermissions) {
1390
- setFilteredMenuItems(baseMenuItems);
1391
- return;
1392
- }
1393
- let isMounted = true;
1394
- const filterItems = async () => {
1395
- const filtered = await Promise.all(
1396
- baseMenuItems.map(async (item) => {
1397
- if (!item.href) return { item, hasAccess: true };
1398
- const pageId = pageIdMapping[item.href] || item.href.slice(1) || "home";
1399
- const permission = routePermissions[item.href] || defaultPermission;
1400
- try {
1401
- const hasAccess = await checkPermission(permission, pageId);
1402
- return { item, hasAccess };
1403
- } catch {
1404
- return { item, hasAccess: false };
1405
- }
1406
- })
1407
- );
1408
- if (!isMounted) return;
1409
- const accessibleItems = filtered.filter(({ hasAccess }) => hasAccess).map(({ item }) => item);
1410
- setFilteredMenuItems(accessibleItems);
1411
- };
1412
- filterItems();
1413
- return () => {
1414
- isMounted = false;
1415
- };
1416
- }, [baseMenuItems, filterNavigationByPermissions, enforcePermissions, pageIdMapping, routePermissions, defaultPermission]);
1417
- useEffect3(() => {
1418
- if (!roleBasedRouting || routeConfig.length === 0) return;
1419
- const currentPath = location.pathname;
1420
- const currentRoute = routeConfig.find((route) => route.path === currentPath);
1421
- if (!currentRoute) {
1422
- if (strictMode) {
1423
- console.error(`[PaceAppLayout] STRICT MODE VIOLATION: Route not found in configuration`, {
1424
- route: currentPath,
1425
- userId: user?.id,
1426
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1427
- });
1428
- if (onRouteStrictModeViolation) {
1429
- onRouteStrictModeViolation(currentPath, "Route not found in configuration");
1430
- }
1431
- }
1432
- return;
1433
- }
1434
- const hasAccess = true;
1435
- if (!hasAccess) {
1436
- if (onRouteAccessDenied) {
1437
- onRouteAccessDenied(currentPath, "Insufficient permissions");
1438
- }
1439
- if (strictMode) {
1440
- console.error(`[PaceAppLayout] STRICT MODE VIOLATION: User attempted to access protected route without permission`, {
1441
- route: currentPath,
1442
- userId: user?.id,
1443
- permissions: currentRoute.permissions,
1444
- roles: currentRoute.roles,
1445
- accessLevel: currentRoute.accessLevel,
1446
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1447
- });
1448
- if (onRouteStrictModeViolation) {
1449
- onRouteStrictModeViolation(currentPath, "Insufficient permissions");
1450
- }
1451
- }
1452
- navigate(fallbackRoute, { replace: true });
1453
- }
1454
- if (auditLog) {
1455
- console.log(`[PaceAppLayout] Route access attempt:`, {
1456
- route: currentPath,
1457
- userId: user?.id,
1458
- allowed: hasAccess,
1459
- permissions: currentRoute.permissions,
1460
- roles: currentRoute.roles,
1461
- accessLevel: currentRoute.accessLevel,
1462
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1463
- });
1464
- }
1465
- }, [roleBasedRouting, routeConfig, location.pathname, strictMode, user?.id, fallbackRoute]);
1466
- const handleSignOut = async () => {
1467
- await signOut();
1468
- };
1469
- const handleChangePassword = async (newPassword) => {
1470
- const result = await updatePassword(newPassword);
1471
- if (result?.error) {
1472
- console.error("Failed to change password:", result.error.message);
1473
- }
1474
- return result || { error: null };
1475
- };
1476
- if (enforcePermissions && isCheckingPermission) {
1477
- return /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs9("div", { className: "text-center", children: [
1478
- /* @__PURE__ */ jsx14("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-sec-900 mx-auto mb-4" }),
1479
- /* @__PURE__ */ jsx14("p", { className: "text-sec-600", children: "Checking permissions..." })
1480
- ] }) });
1481
- }
1482
- if (enforcePermissions && permissionError) {
1483
- return /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs9("div", { className: "text-center", children: [
1484
- /* @__PURE__ */ jsx14("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Permission Error" }),
1485
- /* @__PURE__ */ jsx14("p", { className: "text-sec-600 mb-4", children: permissionError.message }),
1486
- /* @__PURE__ */ jsx14(Button, { onClick: () => navigate("/"), children: "Go Home" })
1487
- ] }) });
1488
- }
1489
- if (enforcePermissions && hasPermission === false) {
1490
- if (enforcePagePermissions && pagePermissionFallback) {
1491
- return /* @__PURE__ */ jsx14(Fragment4, { children: pagePermissionFallback });
1492
- }
1493
- if (permissionFallback) {
1494
- return /* @__PURE__ */ jsx14(Fragment4, { children: permissionFallback });
1495
- }
1496
- return /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs9("div", { className: "text-center", children: [
1497
- /* @__PURE__ */ jsx14("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Access Denied" }),
1498
- /* @__PURE__ */ jsx14("p", { className: "text-sec-600 mb-4", children: "You don't have permission to access this page." }),
1499
- /* @__PURE__ */ jsx14(Button, { onClick: () => navigate("/"), children: "Go Home" })
1500
- ] }) });
1501
- }
1502
- return /* @__PURE__ */ jsxs9(Fragment4, { children: [
1503
- /* @__PURE__ */ jsx14(
1504
- Header,
1505
- {
1506
- logo: customLogo || void 0,
1507
- logoUrl: !customLogo ? `/${appName.toLowerCase()}_logo_wide.svg` : void 0,
1508
- logoAlt: `${appName} Logo`,
1509
- navItems: filteredMenuItems,
1510
- actions: headerActions,
1511
- userMenu: customUserMenu,
1512
- user,
1513
- onSignOut: handleSignOut,
1514
- onChangePassword: handleChangePassword,
1515
- currentPath: window.location.pathname,
1516
- onNavigate: (item) => {
1517
- if (item.href) {
1518
- navigate(item.href);
1519
- }
1520
- },
1521
- showEventSelector,
1522
- showUserMenu,
1523
- className: headerClassName || "sticky top-0 z-[40] w-full"
1524
- }
1525
- ),
1526
- /* @__PURE__ */ jsx14("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: /* @__PURE__ */ jsx14(Outlet, {}) }),
1527
- /* @__PURE__ */ jsx14(Footer, {})
1528
- ] });
1529
- }
1530
-
1531
- // src/components/PaceLoginPage/PaceLoginPage.tsx
1532
- import { useEffect as useEffect4, useState as useState6 } from "react";
1533
- import { useNavigate as useNavigate2 } from "react-router-dom";
1534
- import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
1535
- var PaceLoginPage = ({
1536
- appName = "Pace",
1537
- onSuccessRedirectPath = "/"
1538
- }) => {
1539
- const { signIn, isAuthenticated, isLoading, authError, hasRole } = useUnifiedAuth();
1540
- const navigate = useNavigate2();
1541
- const [isSigningIn, setIsSigningIn] = useState6(false);
1542
- useEffect4(() => {
1543
- if (isAuthenticated && !isLoading && hasRole("super_admin")) {
1544
- try {
1545
- navigate(onSuccessRedirectPath, { replace: true });
1546
- } catch (error) {
1547
- console.error("Navigation error:", error);
1548
- }
1549
- }
1550
- }, [isAuthenticated, isLoading, navigate, onSuccessRedirectPath, hasRole]);
1551
- const handleSubmit = async (data) => {
1552
- setIsSigningIn(true);
1553
- try {
1554
- const { error } = await signIn(data.email, data.password);
1555
- if (!error) {
1556
- try {
1557
- navigate(onSuccessRedirectPath, { replace: true });
1558
- } catch (navError) {
1559
- console.error("Navigation error after sign-in:", navError);
1560
- }
1561
- }
1562
- } finally {
1563
- setIsSigningIn(false);
1564
- }
1565
- };
1566
- return /* @__PURE__ */ jsxs10("main", { className: "min-h-screen grid mx-auto w-fit content-center justify-items-center gap-y-8", "aria-label": `${appName} Login Page`, children: [
1567
- /* @__PURE__ */ jsx15(
1568
- "img",
1569
- {
1570
- src: `/${appName.toLowerCase()}_logo_square.svg`,
1571
- alt: `${appName} logo`,
1572
- className: "h-48"
1573
- }
1574
- ),
1575
- /* @__PURE__ */ jsx15(
1576
- LoginForm,
1577
- {
1578
- className: "w-md",
1579
- onSignIn: handleSubmit,
1580
- appName,
1581
- isLoading: isSigningIn,
1582
- onError: (error) => {
1583
- console.error("Login error:", error);
1584
- }
1585
- }
1586
- ),
1587
- authError && /* @__PURE__ */ jsx15("em", { className: "mt-4 text-destructive text-center", children: authError.message })
1588
- ] });
1589
- };
1590
-
1591
- // src/components/ErrorBoundary/ErrorBoundary.tsx
1592
- import { Component } from "react";
1593
- import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
1594
- var ErrorBoundary = class extends Component {
1595
- constructor(props) {
1596
- super(props);
1597
- this.retryTimeoutId = null;
1598
- this.reportError = (errorId, componentName) => {
1599
- if (true) {
1600
- console.warn("Error reporting would be triggered in production:", { errorId, componentName });
1601
- }
1602
- };
1603
- this.handleRetry = () => {
1604
- const { maxRetries = 3 } = this.props;
1605
- const { retryCount } = this.state;
1606
- if (retryCount < maxRetries) {
1607
- console.log(`Retrying component render (attempt ${retryCount + 1}/${maxRetries})`);
1608
- this.setState((prevState) => ({
1609
- hasError: false,
1610
- error: void 0,
1611
- errorInfo: void 0,
1612
- errorId: void 0,
1613
- retryCount: prevState.retryCount + 1
1614
- }));
1615
- }
1616
- };
1617
- this.state = {
1618
- hasError: false,
1619
- retryCount: 0
1620
- };
1621
- }
1622
- static getDerivedStateFromError(error) {
1623
- const errorId = `error_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
1624
- return {
1625
- hasError: true,
1626
- error,
1627
- errorId
1628
- };
1629
- }
1630
- componentDidCatch(error, errorInfo) {
1631
- const { componentName = "Unknown Component", onError, enableReporting = true } = this.props;
1632
- const errorId = this.state.errorId;
1633
- this.setState({ errorInfo });
1634
- console.error(`ErrorBoundary [${componentName}] caught error ${errorId}:`, error, errorInfo);
1635
- performanceBudgetMonitor.measure("ERROR_BOUNDARY_TRIGGER", 1, {
1636
- componentName,
1637
- errorId,
1638
- errorMessage: error.message,
1639
- stack: error.stack?.substring(0, 200)
1640
- // Truncated stack trace
1641
- });
1642
- if (enableReporting) {
1643
- this.reportError(errorId, componentName);
1644
- }
1645
- if (onError) {
1646
- onError(error, errorInfo, errorId);
1647
- }
1648
- }
1649
- componentWillUnmount() {
1650
- if (this.retryTimeoutId) {
1651
- clearTimeout(this.retryTimeoutId);
1652
- }
1653
- }
1654
- render() {
1655
- if (this.state.hasError) {
1656
- const {
1657
- componentName = "Component",
1658
- fallback,
1659
- enableRetry = true,
1660
- maxRetries = 3
1661
- } = this.props;
1662
- const { retryCount, errorId } = this.state;
1663
- if (fallback) {
1664
- return fallback;
1665
- }
1666
- return /* @__PURE__ */ jsx16(
1667
- "div",
1668
- {
1669
- role: "alert",
1670
- className: "p-6 bg-destructive/10 border border-destructive/20 rounded-lg",
1671
- "data-error-boundary": errorId,
1672
- children: /* @__PURE__ */ jsxs11("div", { className: "flex items-start gap-3", children: [
1673
- /* @__PURE__ */ jsx16("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx16("svg", { className: "w-5 h-5 text-destructive", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx16("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" }) }) }),
1674
- /* @__PURE__ */ jsxs11("div", { className: "flex-1 min-w-0", children: [
1675
- /* @__PURE__ */ jsxs11("h3", { className: "text-destructive", children: [
1676
- "Error in ",
1677
- componentName
1678
- ] }),
1679
- /* @__PURE__ */ jsx16("p", { className: "text-destructive/80", children: this.state.error?.message || "An unexpected error occurred." }),
1680
- enableRetry && retryCount < maxRetries && /* @__PURE__ */ jsxs11("div", { className: "flex gap-3 mb-4", children: [
1681
- /* @__PURE__ */ jsxs11(
1682
- "button",
1683
- {
1684
- onClick: this.handleRetry,
1685
- className: "px-4 py-2 bg-destructive text-destructive-foreground rounded-md hover:bg-destructive/90 transition-colors text-sm font-medium",
1686
- children: [
1687
- "Retry (",
1688
- retryCount + 1,
1689
- "/",
1690
- maxRetries,
1691
- ")"
1692
- ]
1693
- }
1694
- ),
1695
- /* @__PURE__ */ jsx16(
1696
- "button",
1697
- {
1698
- onClick: () => window.location.reload(),
1699
- className: "px-4 py-2 bg-sec-600 text-main-50 rounded-md hover:bg-sec-700 transition-colors text-sm font-medium",
1700
- children: "Reload Page"
1701
- }
1702
- )
1703
- ] }),
1704
- retryCount >= maxRetries && /* @__PURE__ */ jsxs11("div", { className: "mb-4 p-3 bg-acc-50 border border-acc-200 rounded-md", children: [
1705
- /* @__PURE__ */ jsx16("p", { className: "text-acc-800", children: "Maximum retry attempts reached. Please reload the page or contact support." }),
1706
- /* @__PURE__ */ jsx16(
1707
- "button",
1708
- {
1709
- onClick: () => window.location.reload(),
1710
- className: "mt-2 px-3 py-1 bg-acc-600 text-main-50 rounded text-sm hover:bg-acc-700",
1711
- children: "Reload Page"
1712
- }
1713
- )
1714
- ] }),
1715
- false
1716
- ] })
1717
- ] })
1718
- }
1719
- );
1720
- }
1721
- return this.props.children;
1722
- }
1723
- };
1724
-
1725
- // src/components/OrganisationSelector/OrganisationSelector.tsx
1726
- import { useState as useState7, useCallback as useCallback4 } from "react";
1727
- init_Button();
1728
- init_OrganisationProvider();
1729
- import { RefreshCw as RefreshCw2, AlertCircle as AlertCircle2, Building2, Shield } from "lucide-react";
1730
- import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
1731
- function OrganisationSelector({
1732
- placeholder = "Select organisation",
1733
- className,
1734
- onOrganisationChange,
1735
- showNoOrganisationsMessage = true,
1736
- showRetryButton = true,
1737
- showRole = false,
1738
- compact = false,
1739
- disabled = false
1740
- }) {
1741
- const [isLoading, setIsLoading] = useState7(false);
1742
- const [switchError, setSwitchError] = useState7(null);
1743
- const {
1744
- organisations,
1745
- selectedOrganisation,
1746
- isLoading: orgLoading,
1747
- error: orgError,
1748
- switchOrganisation,
1749
- getUserRole,
1750
- validateOrganisationAccess,
1751
- refreshOrganisations
1752
- } = useOrganisations();
1753
- const handleOrganisationChange = useCallback4(async (orgId) => {
1754
- if (disabled || isLoading) return;
1755
- setSwitchError(null);
1756
- setIsLoading(true);
1757
- try {
1758
- if (!validateOrganisationAccess(orgId)) {
1759
- throw new Error("You do not have access to this organisation");
1760
- }
1761
- await switchOrganisation(orgId);
1762
- const newOrganisation = organisations.find((org) => org.id === orgId);
1763
- if (newOrganisation && onOrganisationChange) {
1764
- onOrganisationChange(newOrganisation);
1765
- }
1766
- console.log("[OrganisationSelector] Successfully switched to organisation:", orgId);
1767
- } catch (error) {
1768
- console.error("[OrganisationSelector] Failed to switch organisation:", error);
1769
- setSwitchError(error instanceof Error ? error.message : "Failed to switch organisation");
1770
- } finally {
1771
- setIsLoading(false);
1772
- }
1773
- }, [
1774
- disabled,
1775
- isLoading,
1776
- validateOrganisationAccess,
1777
- switchOrganisation,
1778
- organisations,
1779
- onOrganisationChange
1780
- ]);
1781
- const handleRetry = useCallback4(async () => {
1782
- setIsLoading(true);
1783
- setSwitchError(null);
1784
- try {
1785
- await refreshOrganisations();
1786
- } catch (error) {
1787
- console.error("[OrganisationSelector] Failed to refresh organisations:", error);
1788
- setSwitchError("Failed to refresh organisations");
1789
- } finally {
1790
- setIsLoading(false);
1791
- }
1792
- }, [refreshOrganisations]);
1793
- if (orgLoading) {
1794
- return /* @__PURE__ */ jsxs12("div", { className: `flex items-center gap-2 ${className}`, children: [
1795
- /* @__PURE__ */ jsx17(LoadingSpinner, { size: "sm" }),
1796
- /* @__PURE__ */ jsx17("span", { className: "text-sm text-muted-foreground", children: compact ? "Loading..." : "Loading organisations..." })
1797
- ] });
1798
- }
1799
- if (orgError) {
1800
- return /* @__PURE__ */ jsxs12("div", { className: `space-y-2 ${className}`, children: [
1801
- /* @__PURE__ */ jsxs12(Alert, { variant: "destructive", children: [
1802
- /* @__PURE__ */ jsx17(AlertCircle2, { className: "h-4 w-4" }),
1803
- /* @__PURE__ */ jsxs12(AlertDescription, { children: [
1804
- "Failed to load organisations: ",
1805
- orgError.message
1806
- ] })
1807
- ] }),
1808
- showRetryButton && /* @__PURE__ */ jsxs12(
1809
- Button,
1810
- {
1811
- variant: "outline",
1812
- size: "sm",
1813
- onClick: handleRetry,
1814
- disabled: isLoading,
1815
- className: "w-full",
1816
- children: [
1817
- /* @__PURE__ */ jsx17(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
1818
- "Retry"
1819
- ]
1820
- }
1821
- )
1822
- ] });
1823
- }
1824
- if (organisations.length === 0) {
1825
- if (showNoOrganisationsMessage) {
1826
- return /* @__PURE__ */ jsxs12("div", { className: `space-y-2 ${className}`, children: [
1827
- /* @__PURE__ */ jsxs12(Alert, { children: [
1828
- /* @__PURE__ */ jsx17(Building2, { className: "h-4 w-4" }),
1829
- /* @__PURE__ */ jsx17(AlertDescription, { children: "No organisations available. Please contact your administrator to be added to an organisation." })
1830
- ] }),
1831
- showRetryButton && /* @__PURE__ */ jsxs12(
1832
- Button,
1833
- {
1834
- variant: "outline",
1835
- size: "sm",
1836
- onClick: handleRetry,
1837
- disabled: isLoading,
1838
- className: "w-full",
1839
- children: [
1840
- /* @__PURE__ */ jsx17(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
1841
- "Check Again"
1842
- ]
1843
- }
1844
- )
1845
- ] });
1846
- }
1847
- return null;
1848
- }
1849
- const switchErrorDisplay = switchError && /* @__PURE__ */ jsxs12(Alert, { variant: "destructive", className: "mt-2", children: [
1850
- /* @__PURE__ */ jsx17(AlertCircle2, { className: "h-4 w-4" }),
1851
- /* @__PURE__ */ jsx17(AlertDescription, { children: switchError })
1852
- ] });
1853
- return /* @__PURE__ */ jsxs12("div", { className: `space-y-2 ${className}`, children: [
1854
- /* @__PURE__ */ jsxs12(
1855
- Select,
1856
- {
1857
- value: selectedOrganisation.id,
1858
- onValueChange: handleOrganisationChange,
1859
- disabled: disabled || isLoading,
1860
- children: [
1861
- /* @__PURE__ */ jsx17(SelectTrigger, { className: `${isLoading ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
1862
- isLoading ? /* @__PURE__ */ jsx17(LoadingSpinner, { size: "sm" }) : /* @__PURE__ */ jsx17(Building2, { className: "h-4 w-4 text-muted-foreground" }),
1863
- /* @__PURE__ */ jsx17(SelectValue, { placeholder })
1864
- ] }) }),
1865
- /* @__PURE__ */ jsx17(SelectContent, { children: organisations.map((org) => {
1866
- const userRole = getUserRole(org.id);
1867
- const hasAccess = validateOrganisationAccess(org.id);
1868
- return /* @__PURE__ */ jsx17(
1869
- SelectItem,
1870
- {
1871
- value: org.id,
1872
- disabled: !hasAccess,
1873
- className: !hasAccess ? "opacity-50" : "",
1874
- children: /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between w-full", children: [
1875
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
1876
- /* @__PURE__ */ jsx17(Building2, { className: "h-4 w-4" }),
1877
- /* @__PURE__ */ jsxs12("div", { className: "flex flex-col", children: [
1878
- /* @__PURE__ */ jsx17("span", { className: "font-medium", children: org.display_name }),
1879
- !compact && org.description && /* @__PURE__ */ jsx17("span", { className: "text-xs text-muted-foreground truncate max-w-40", children: org.description })
1880
- ] })
1881
- ] }),
1882
- showRole && /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1 ml-4", children: [
1883
- /* @__PURE__ */ jsx17(Shield, { className: "h-3 w-3 text-muted-foreground" }),
1884
- /* @__PURE__ */ jsx17("span", { className: "text-xs text-muted-foreground capitalize", children: userRole.replace("_", " ") })
1885
- ] })
1886
- ] })
1887
- },
1888
- org.id
1889
- );
1890
- }) })
1891
- ]
1892
- }
1893
- ),
1894
- switchErrorDisplay
1895
- ] });
1896
- }
1897
-
1898
- // src/components/PasswordReset/PasswordResetForm.tsx
1899
- init_Button();
1900
- import { useState as useState8 } from "react";
1901
- init_cn();
1902
- init_UnifiedAuthProvider();
1903
- import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
1904
- function PasswordResetForm({
1905
- onSuccess,
1906
- onError,
1907
- className
1908
- }) {
1909
- const { resetPassword } = useUnifiedAuth();
1910
- const [email, setEmail] = useState8("");
1911
- const [isLoading, setIsLoading] = useState8(false);
1912
- const [isSuccess, setIsSuccess] = useState8(false);
1913
- const [error, setError] = useState8(null);
1914
- const handleSubmit = async (e) => {
1915
- e.preventDefault();
1916
- if (!email.trim()) {
1917
- return;
1918
- }
1919
- setIsLoading(true);
1920
- setError(null);
1921
- try {
1922
- const { error: resetError } = await resetPassword(email);
1923
- if (resetError) {
1924
- const errorObj = new Error(resetError.message || "Failed to send reset email");
1925
- setError(errorObj.message);
1926
- onError?.(errorObj);
1927
- } else {
1928
- setIsSuccess(true);
1929
- onSuccess?.();
1930
- }
1931
- } catch (err) {
1932
- const errorObj = err instanceof Error ? err : new Error("An unexpected error occurred");
1933
- setError(errorObj.message);
1934
- onError?.(errorObj);
1935
- } finally {
1936
- setIsLoading(false);
1937
- }
1938
- };
1939
- const handleSendAnother = () => {
1940
- setIsSuccess(false);
1941
- setError(null);
1942
- };
1943
- if (isSuccess) {
1944
- return /* @__PURE__ */ jsx18("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs13("div", { className: "space-y-4 text-center", children: [
1945
- /* @__PURE__ */ jsx18("h2", { children: "Check your email" }),
1946
- /* @__PURE__ */ jsxs13("p", { className: "text-sec-600", children: [
1947
- "We have sent a password reset link to ",
1948
- email
1949
- ] }),
1950
- /* @__PURE__ */ jsx18(
1951
- Button,
1952
- {
1953
- variant: "outline",
1954
- onClick: handleSendAnother,
1955
- className: "w-full",
1956
- children: "Send another email"
1957
- }
1958
- )
1959
- ] }) });
1960
- }
1961
- return /* @__PURE__ */ jsx18("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs13("div", { className: "space-y-4", children: [
1962
- /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
1963
- /* @__PURE__ */ jsx18("h2", { children: "Reset Password" }),
1964
- /* @__PURE__ */ jsx18("p", { className: "text-sec-600", children: "Enter your email address and we'll send you a reset link." })
1965
- ] }),
1966
- /* @__PURE__ */ jsxs13("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
1967
- /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
1968
- /* @__PURE__ */ jsx18(Label, { htmlFor: "email", children: "Email Address" }),
1969
- /* @__PURE__ */ jsx18(
1970
- Input,
1971
- {
1972
- id: "email",
1973
- type: "email",
1974
- value: email,
1975
- onChange: (e) => setEmail(e.target.value),
1976
- placeholder: "Enter your email",
1977
- required: true,
1978
- disabled: isLoading
1979
- }
1980
- )
1981
- ] }),
1982
- error && /* @__PURE__ */ jsx18("div", { className: "text-sm text-destructive", role: "alert", children: error }),
1983
- /* @__PURE__ */ jsx18(
1984
- Button,
1985
- {
1986
- type: "submit",
1987
- className: "w-full",
1988
- disabled: !email.trim() || isLoading,
1989
- children: isLoading ? "Sending..." : "Send Reset Link"
1990
- }
1991
- )
1992
- ] })
1993
- ] }) });
1994
- }
1995
-
1996
- // src/utils/storage/config.ts
1997
- var FILE_SIZE_LIMITS = {
1998
- // Images
1999
- "image/jpeg": 5 * 1024 * 1024,
2000
- // 5MB
2001
- "image/png": 5 * 1024 * 1024,
2002
- // 5MB
2003
- "image/gif": 10 * 1024 * 1024,
2004
- // 10MB (for animations)
2005
- "image/webp": 5 * 1024 * 1024,
2006
- // 5MB
2007
- "image/svg+xml": 1 * 1024 * 1024,
2008
- // 1MB (vector graphics)
2009
- // Documents
2010
- "application/pdf": 50 * 1024 * 1024,
2011
- // 50MB
2012
- "application/msword": 25 * 1024 * 1024,
2013
- // 25MB
2014
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document": 25 * 1024 * 1024,
2015
- // 25MB
2016
- "application/vnd.ms-excel": 25 * 1024 * 1024,
2017
- // 25MB
2018
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": 25 * 1024 * 1024,
2019
- // 25MB
2020
- // Archives
2021
- "application/zip": 100 * 1024 * 1024,
2022
- // 100MB
2023
- "application/x-rar-compressed": 100 * 1024 * 1024,
2024
- // 100MB
2025
- // Text files
2026
- "text/plain": 1 * 1024 * 1024,
2027
- // 1MB
2028
- "text/csv": 10 * 1024 * 1024,
2029
- // 10MB
2030
- "application/json": 10 * 1024 * 1024
2031
- // 10MB
2032
- };
2033
- var DEFAULT_FILE_SIZE_LIMIT = 10 * 1024 * 1024;
2034
- var APP_PATH_MAPPING = {
2035
- "PACE": "event_logos",
2036
- "TRAC": "trac_accommodation",
2037
- // Default category for TRAC files
2038
- "MEDI": "documents",
2039
- "CAKE": "documents"
2040
- };
2041
- var STORAGE_CONFIG = {
2042
- bucketName: "files",
2043
- fileSizeLimits: FILE_SIZE_LIMITS,
2044
- defaultFileSizeLimit: DEFAULT_FILE_SIZE_LIMIT
2045
- };
2046
- function getFileSizeLimit(mimeType) {
2047
- return STORAGE_CONFIG.fileSizeLimits[mimeType] || STORAGE_CONFIG.defaultFileSizeLimit;
2048
- }
2049
- function validateFileSize(file) {
2050
- const limit = getFileSizeLimit(file.type);
2051
- if (file.size > limit) {
2052
- const limitMB = Math.round(limit / (1024 * 1024));
2053
- const fileMB = Math.round(file.size / (1024 * 1024));
2054
- return {
2055
- isValid: false,
2056
- error: `File size (${fileMB}MB) exceeds limit (${limitMB}MB) for ${file.type}`
2057
- };
2058
- }
2059
- return { isValid: true };
2060
- }
2061
- function formatFileSize(bytes) {
2062
- if (bytes === 0) return "0 Bytes";
2063
- if (bytes < 0) return `${bytes} Bytes`;
2064
- const k = 1024;
2065
- const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
2066
- const i = Math.floor(Math.log(bytes) / Math.log(k));
2067
- const sizeIndex = Math.min(Math.max(i, 0), sizes.length - 1);
2068
- return parseFloat((bytes / Math.pow(k, sizeIndex)).toFixed(2)) + " " + sizes[sizeIndex];
2069
- }
2070
-
2071
- // src/utils/storage/helpers.ts
2072
- function generateFilePath(options, fileName) {
2073
- const { appName, orgId, isPublic = false, customPath } = options;
2074
- if (isPublic) {
2075
- if (customPath) {
2076
- return `public/${customPath}/${fileName}`;
2077
- }
2078
- return `public/assets/${appName}/${fileName}`;
2079
- }
2080
- const categoryMap = {
2081
- "accommodation": "trac_accommodation",
2082
- "activity": "trac_activity",
2083
- "transport": "trac_transport",
2084
- "journal": "trac_journal",
2085
- "logos": "event_logos",
2086
- "documents": "files"
2087
- };
2088
- if (customPath) {
2089
- const mappedCategory = categoryMap[customPath] || customPath;
2090
- return `apps/${appName}/${orgId}/${mappedCategory}/${fileName}`;
2091
- }
2092
- return `apps/${appName}/${orgId}/files/${fileName}`;
2093
- }
2094
- function generateUniqueFileName(originalName) {
2095
- const timestamp = Date.now();
2096
- const uuid = crypto.randomUUID();
2097
- const extension = originalName.split(".").pop() || "";
2098
- const baseName = originalName.replace(/\.[^/.]+$/, "");
2099
- return `${timestamp}-${uuid}-${baseName}.${extension}`;
2100
- }
2101
- async function extractFileMetadata(file, options, uploadedBy) {
2102
- const metadata = {
2103
- mimeType: file.type,
2104
- size: file.size,
2105
- orgId: options.orgId,
2106
- appName: options.appName,
2107
- uploadedBy,
2108
- uploadedAt: (/* @__PURE__ */ new Date()).toISOString(),
2109
- tags: options.tags || [],
2110
- isPublic: options.isPublic || false,
2111
- customMetadata: options.metadata || {}
2112
- };
2113
- if (file.type.startsWith("image/")) {
2114
- try {
2115
- const dimensions = await getImageDimensions(file);
2116
- metadata.width = dimensions.width;
2117
- metadata.height = dimensions.height;
2118
- } catch (error) {
2119
- console.warn("Could not extract image dimensions:", error);
2120
- }
2121
- }
2122
- try {
2123
- metadata.hash = await generateFileHash(file);
2124
- } catch (error) {
2125
- console.warn("Could not generate file hash:", error);
2126
- }
2127
- return metadata;
2128
- }
2129
- async function getImageDimensions(file) {
2130
- return new Promise((resolve, reject) => {
2131
- const img = new Image();
2132
- const url = URL.createObjectURL(file);
2133
- img.onload = () => {
2134
- URL.revokeObjectURL(url);
2135
- resolve({ width: img.width, height: img.height });
2136
- };
2137
- img.onerror = () => {
2138
- URL.revokeObjectURL(url);
2139
- reject(new Error("Could not load image"));
2140
- };
2141
- img.src = url;
2142
- });
2143
- }
2144
- async function generateFileHash(file) {
2145
- const buffer = await file.arrayBuffer();
2146
- const hashBuffer = await crypto.subtle.digest("SHA-256", buffer);
2147
- const hashArray = Array.from(new Uint8Array(hashBuffer));
2148
- const hashHex = hashArray.map((b) => b.toString(16).padStart(2, "0")).join("");
2149
- return `sha256:${hashHex}`;
2150
- }
2151
- async function uploadFile(supabase, file, options) {
2152
- try {
2153
- const sizeValidation = validateFileSize(file);
2154
- if (!sizeValidation.isValid) {
2155
- return {
2156
- success: false,
2157
- error: sizeValidation.error
2158
- };
2159
- }
2160
- const uniqueFileName = generateUniqueFileName(file.name);
2161
- const filePath = generateFilePath(options, uniqueFileName);
2162
- const metadata = await extractFileMetadata(file, options, "current-user");
2163
- const { data, error } = await supabase.storage.from(STORAGE_CONFIG.bucketName).upload(filePath, file, {
2164
- cacheControl: "3600",
2165
- upsert: false,
2166
- contentType: file.type
2167
- });
2168
- if (error) {
2169
- return {
2170
- success: false,
2171
- error: `Upload failed: ${error.message}`
2172
- };
2173
- }
2174
- let publicUrl;
2175
- if (options.isPublic) {
2176
- const { data: urlData } = supabase.storage.from(STORAGE_CONFIG.bucketName).getPublicUrl(filePath);
2177
- publicUrl = urlData.publicUrl;
2178
- }
2179
- return {
2180
- success: true,
2181
- path: filePath,
2182
- publicUrl,
2183
- metadata
2184
- };
2185
- } catch (error) {
2186
- return {
2187
- success: false,
2188
- error: `Upload failed: ${error instanceof Error ? error.message : "Unknown error"}`
2189
- };
2190
- }
2191
- }
2192
- function getPublicUrl(supabase, path) {
2193
- const { data } = supabase.storage.from(STORAGE_CONFIG.bucketName).getPublicUrl(path);
2194
- return data.publicUrl;
2195
- }
2196
- async function getSignedUrl(supabase, path, options) {
2197
- try {
2198
- const { data, error } = await supabase.storage.from(STORAGE_CONFIG.bucketName).createSignedUrl(path, options.expiresIn || 3600);
2199
- if (error) {
2200
- console.error("Failed to create signed URL:", error);
2201
- return null;
2202
- }
2203
- return {
2204
- url: data.signedUrl,
2205
- expiresAt: new Date(Date.now() + (options.expiresIn || 3600) * 1e3).toISOString()
2206
- };
2207
- } catch (error) {
2208
- console.error("Failed to create signed URL:", error);
2209
- return null;
2210
- }
2211
- }
2212
- async function deleteFile(supabase, path) {
2213
- try {
2214
- const { error } = await supabase.storage.from(STORAGE_CONFIG.bucketName).remove([path]);
2215
- if (error) {
2216
- return {
2217
- success: false,
2218
- error: `Delete failed: ${error.message}`
2219
- };
2220
- }
2221
- return { success: true };
2222
- } catch (error) {
2223
- return {
2224
- success: false,
2225
- error: `Delete failed: ${error instanceof Error ? error.message : "Unknown error"}`
2226
- };
2227
- }
2228
- }
2229
- async function listFiles(supabase, options) {
2230
- try {
2231
- const pathPrefix = `apps/${options.appName}/${options.orgId}/`;
2232
- const searchPath = options.pathPrefix ? `${pathPrefix}${options.pathPrefix}` : pathPrefix;
2233
- const { data, error } = await supabase.storage.from(STORAGE_CONFIG.bucketName).list(searchPath, {
2234
- limit: options.limit || 100,
2235
- offset: options.offset || 0,
2236
- sortBy: { column: "created_at", order: "desc" }
2237
- });
2238
- if (error) {
2239
- console.error("Failed to list files:", error);
2240
- return { files: [], totalCount: 0, hasMore: false };
2241
- }
2242
- const files = (data || []).map((item) => ({
2243
- name: item.name,
2244
- path: `${searchPath}${item.name}`,
2245
- size: item.metadata?.size || 0,
2246
- mimeType: item.metadata?.mimetype || "application/octet-stream",
2247
- lastModified: item.updated_at || item.created_at || (/* @__PURE__ */ new Date()).toISOString(),
2248
- metadata: {
2249
- mimeType: item.metadata?.mimetype || "application/octet-stream",
2250
- size: item.metadata?.size || 0,
2251
- orgId: options.orgId,
2252
- appName: options.appName,
2253
- uploadedBy: "unknown",
2254
- uploadedAt: item.created_at || (/* @__PURE__ */ new Date()).toISOString(),
2255
- isPublic: false
2256
- }
2257
- }));
2258
- return {
2259
- files,
2260
- totalCount: files.length,
2261
- hasMore: files.length >= (options.limit || 100)
2262
- };
2263
- } catch (error) {
2264
- console.error("Failed to list files:", error);
2265
- return { files: [], totalCount: 0, hasMore: false };
2266
- }
2267
- }
2268
- async function archiveFile(supabase, path, options) {
2269
- try {
2270
- const archivedPath = path.replace(`apps/${options.appName}/${options.orgId}/`, `archived/${options.appName}/${options.orgId}/`);
2271
- const { error: copyError } = await supabase.storage.from(STORAGE_CONFIG.bucketName).copy(path, archivedPath);
2272
- if (copyError) {
2273
- return {
2274
- success: false,
2275
- error: `Archive failed: ${copyError.message}`
2276
- };
2277
- }
2278
- const deleteResult = await deleteFile(supabase, path);
2279
- if (!deleteResult.success) {
2280
- return deleteResult;
2281
- }
2282
- return { success: true };
2283
- } catch (error) {
2284
- return {
2285
- success: false,
2286
- error: `Archive failed: ${error instanceof Error ? error.message : "Unknown error"}`
2287
- };
2288
- }
2289
- }
2290
-
2291
- // src/hooks/useStorage.ts
2292
- import { useState as useState9, useCallback as useCallback5 } from "react";
2293
- function useStorage({ supabase, appName, orgId }) {
2294
- const [isUploading, setIsUploading] = useState9(false);
2295
- const [uploadError, setUploadError] = useState9(null);
2296
- const [isListing, setIsListing] = useState9(false);
2297
- const [listError, setListError] = useState9(null);
2298
- const [files, setFiles] = useState9([]);
2299
- const handleUploadFile = useCallback5(async (file, options = {}) => {
2300
- setIsUploading(true);
2301
- setUploadError(null);
2302
- try {
2303
- const uploadOptions = {
2304
- appName,
2305
- orgId,
2306
- isPublic: false,
2307
- ...options
2308
- };
2309
- const result = await uploadFile(supabase, file, uploadOptions);
2310
- if (result.success) {
2311
- await refreshFiles();
2312
- } else {
2313
- setUploadError(result.error || "Upload failed");
2314
- }
2315
- return result;
2316
- } catch (error) {
2317
- const errorMessage = error instanceof Error ? error.message : "Upload failed";
2318
- setUploadError(errorMessage);
2319
- return {
2320
- success: false,
2321
- error: errorMessage
2322
- };
2323
- } finally {
2324
- setIsUploading(false);
2325
- }
2326
- }, [supabase, appName, orgId]);
2327
- const handleGetPublicUrl = useCallback5((path) => {
2328
- return getPublicUrl(supabase, path);
2329
- }, [supabase]);
2330
- const handleGetSignedUrl = useCallback5(async (path, expiresIn) => {
2331
- try {
2332
- const result = await getSignedUrl(supabase, path, {
2333
- appName,
2334
- orgId,
2335
- expiresIn
2336
- });
2337
- return result?.url || null;
2338
- } catch (error) {
2339
- console.error("Failed to get signed URL:", error);
2340
- return null;
2341
- }
2342
- }, [supabase, appName, orgId]);
2343
- const handleDeleteFile = useCallback5(async (path) => {
2344
- try {
2345
- const result = await deleteFile(supabase, path);
2346
- if (result.success) {
2347
- await refreshFiles();
2348
- }
2349
- return result;
2350
- } catch (error) {
2351
- return {
2352
- success: false,
2353
- error: error instanceof Error ? error.message : "Delete failed"
2354
- };
2355
- }
2356
- }, [supabase]);
2357
- const handleArchiveFile = useCallback5(async (path) => {
2358
- try {
2359
- const result = await archiveFile(supabase, path, { appName, orgId });
2360
- if (result.success) {
2361
- await refreshFiles();
2362
- }
2363
- return result;
2364
- } catch (error) {
2365
- return {
2366
- success: false,
2367
- error: error instanceof Error ? error.message : "Archive failed"
2368
- };
2369
- }
2370
- }, [supabase, appName, orgId]);
2371
- const handleListFiles = useCallback5(async (options = {}) => {
2372
- setIsListing(true);
2373
- setListError(null);
2374
- try {
2375
- const listOptions = {
2376
- appName,
2377
- orgId,
2378
- ...options
2379
- };
2380
- const result = await listFiles(supabase, listOptions);
2381
- setFiles(result.files);
2382
- return result;
2383
- } catch (error) {
2384
- const errorMessage = error instanceof Error ? error.message : "List failed";
2385
- setListError(errorMessage);
2386
- return { files: [], totalCount: 0, hasMore: false };
2387
- } finally {
2388
- setIsListing(false);
2389
- }
2390
- }, [supabase, appName, orgId]);
2391
- const refreshFiles = useCallback5(async () => {
2392
- await handleListFiles();
2393
- }, [handleListFiles]);
2394
- return {
2395
- // Upload
2396
- uploadFile: handleUploadFile,
2397
- isUploading,
2398
- uploadError,
2399
- // URLs
2400
- getPublicUrl: handleGetPublicUrl,
2401
- getSignedUrl: handleGetSignedUrl,
2402
- getFileUrl: handleGetPublicUrl,
2403
- // Alias for getPublicUrl
2404
- // File management
2405
- deleteFile: handleDeleteFile,
2406
- archiveFile: handleArchiveFile,
2407
- // Listing
2408
- listFiles: handleListFiles,
2409
- isListing,
2410
- listError,
2411
- isLoading: isListing,
2412
- // Alias for isListing
2413
- error: listError,
2414
- // Alias for listError
2415
- // State
2416
- files,
2417
- refreshFiles
2418
- };
2419
- }
2420
- function useFileUpload({ supabase, appName, orgId }) {
2421
- const [uploadProgress, setUploadProgress] = useState9(0);
2422
- const [isUploading, setIsUploading] = useState9(false);
2423
- const [uploadError, setUploadError] = useState9(null);
2424
- const uploadWithProgress = useCallback5(async (file, options = {}) => {
2425
- setIsUploading(true);
2426
- setUploadProgress(0);
2427
- setUploadError(null);
2428
- try {
2429
- const progressInterval = setInterval(() => {
2430
- setUploadProgress((prev) => Math.min(prev + 10, 90));
2431
- }, 100);
2432
- const uploadOptions = {
2433
- appName,
2434
- orgId,
2435
- isPublic: false,
2436
- ...options
2437
- };
2438
- const result = await uploadFile(supabase, file, uploadOptions);
2439
- clearInterval(progressInterval);
2440
- setUploadProgress(100);
2441
- if (!result.success) {
2442
- setUploadError(result.error || "Upload failed");
2443
- }
2444
- return result;
2445
- } catch (error) {
2446
- const errorMessage = error instanceof Error ? error.message : "Upload failed";
2447
- setUploadError(errorMessage);
2448
- return {
2449
- success: false,
2450
- error: errorMessage
2451
- };
2452
- } finally {
2453
- setIsUploading(false);
2454
- setTimeout(() => setUploadProgress(0), 1e3);
2455
- }
2456
- }, [supabase, appName, orgId]);
2457
- return {
2458
- uploadWithProgress,
2459
- uploadProgress,
2460
- isUploading,
2461
- uploadError
2462
- };
2463
- }
2464
-
2465
- // src/components/FileUpload/FileUpload.tsx
2466
- import { useCallback as useCallback6, useState as useState10 } from "react";
2467
- init_Button();
2468
- import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
2469
- function FileUpload({
2470
- supabase,
2471
- appName,
2472
- orgId,
2473
- onUploadComplete,
2474
- onUploadStart,
2475
- accept = "*/*",
2476
- maxSize,
2477
- multiple = false,
2478
- disabled = false,
2479
- className = "",
2480
- children
2481
- }) {
2482
- const [dragActive, setDragActive] = useState10(false);
2483
- const [selectedFiles, setSelectedFiles] = useState10([]);
2484
- const [validationErrors, setValidationErrors] = useState10([]);
2485
- const { uploadWithProgress, uploadProgress, isUploading, uploadError } = useFileUpload({
2486
- supabase,
2487
- appName,
2488
- orgId
2489
- });
2490
- const validateFiles = useCallback6((files) => {
2491
- const errors = [];
2492
- files.forEach((file, index) => {
2493
- const sizeValidation = validateFileSize(file);
2494
- if (!sizeValidation.isValid) {
2495
- errors.push(`File ${index + 1}: ${sizeValidation.error}`);
2496
- }
2497
- if (maxSize && file.size > maxSize) {
2498
- const fileMB = Math.round(file.size / (1024 * 1024));
2499
- const maxMB = Math.round(maxSize / (1024 * 1024));
2500
- errors.push(`File ${index + 1}: Size (${fileMB}MB) exceeds limit (${maxMB}MB)`);
2501
- }
2502
- });
2503
- return errors;
2504
- }, [maxSize]);
2505
- const handleFileSelect = useCallback6((files) => {
2506
- if (!files) return;
2507
- const fileArray = Array.from(files);
2508
- const errors = validateFiles(fileArray);
2509
- setValidationErrors(errors);
2510
- setSelectedFiles(fileArray);
2511
- }, [validateFiles]);
2512
- const handleDrag = useCallback6((e) => {
2513
- e.preventDefault();
2514
- e.stopPropagation();
2515
- if (e.type === "dragenter" || e.type === "dragover") {
2516
- setDragActive(true);
2517
- } else if (e.type === "dragleave") {
2518
- setDragActive(false);
2519
- }
2520
- }, []);
2521
- const handleDrop = useCallback6((e) => {
2522
- e.preventDefault();
2523
- e.stopPropagation();
2524
- setDragActive(false);
2525
- if (disabled) return;
2526
- const files = e.dataTransfer.files;
2527
- handleFileSelect(files);
2528
- }, [disabled, handleFileSelect]);
2529
- const handleFileInputChange = useCallback6((e) => {
2530
- handleFileSelect(e.target.files);
2531
- }, [handleFileSelect]);
2532
- const handleUpload = useCallback6(async () => {
2533
- if (selectedFiles.length === 0 || validationErrors.length > 0) return;
2534
- onUploadStart?.();
2535
- for (const file of selectedFiles) {
2536
- const result = await uploadWithProgress(file);
2537
- onUploadComplete?.(result);
2538
- }
2539
- setSelectedFiles([]);
2540
- setValidationErrors([]);
2541
- }, [selectedFiles, validationErrors, uploadWithProgress, onUploadComplete, onUploadStart]);
2542
- const handleClear = useCallback6(() => {
2543
- setSelectedFiles([]);
2544
- setValidationErrors([]);
2545
- }, []);
2546
- const canUpload = selectedFiles.length > 0 && validationErrors.length === 0 && !isUploading && !disabled;
2547
- return /* @__PURE__ */ jsxs14("div", { className: `file-upload ${className}`, children: [
2548
- /* @__PURE__ */ jsxs14(
2549
- "div",
2550
- {
2551
- className: `file-upload__dropzone ${dragActive ? "file-upload__dropzone--active" : ""} ${disabled ? "file-upload__dropzone--disabled" : ""}`,
2552
- onDragEnter: handleDrag,
2553
- onDragLeave: handleDrag,
2554
- onDragOver: handleDrag,
2555
- onDrop: handleDrop,
2556
- children: [
2557
- /* @__PURE__ */ jsx19(
2558
- "input",
2559
- {
2560
- type: "file",
2561
- accept,
2562
- multiple,
2563
- onChange: handleFileInputChange,
2564
- disabled,
2565
- className: "file-upload__input"
2566
- }
2567
- ),
2568
- children || /* @__PURE__ */ jsxs14("div", { className: "file-upload__content", children: [
2569
- /* @__PURE__ */ jsx19("p", { className: "file-upload__text", children: dragActive ? "Drop files here" : "Drag and drop files here or click to select" }),
2570
- /* @__PURE__ */ jsx19(
2571
- Button,
2572
- {
2573
- type: "button",
2574
- variant: "outline",
2575
- disabled,
2576
- onClick: () => document.querySelector(".file-upload__input")?.click(),
2577
- children: "Select Files"
2578
- }
2579
- )
2580
- ] })
2581
- ]
2582
- }
2583
- ),
2584
- selectedFiles.length > 0 && /* @__PURE__ */ jsxs14("div", { className: "file-upload__files", children: [
2585
- /* @__PURE__ */ jsx19("h4", { className: "file-upload__files-title", children: "Selected Files:" }),
2586
- /* @__PURE__ */ jsx19("ul", { className: "file-upload__files-list", children: selectedFiles.map((file, index) => /* @__PURE__ */ jsxs14("li", { className: "file-upload__file-item", children: [
2587
- /* @__PURE__ */ jsx19("span", { className: "file-upload__file-name", children: file.name }),
2588
- /* @__PURE__ */ jsx19("span", { className: "file-upload__file-size", children: formatFileSize(file.size) })
2589
- ] }, index)) })
2590
- ] }),
2591
- validationErrors.length > 0 && /* @__PURE__ */ jsx19(Alert, { variant: "destructive", className: "file-upload__errors", children: /* @__PURE__ */ jsx19("ul", { children: validationErrors.map((error, index) => /* @__PURE__ */ jsx19("li", { children: error }, index)) }) }),
2592
- isUploading && /* @__PURE__ */ jsxs14("div", { className: "file-upload__progress", children: [
2593
- /* @__PURE__ */ jsx19(Progress, { value: uploadProgress, max: 100 }),
2594
- /* @__PURE__ */ jsxs14("p", { className: "file-upload__progress-text", children: [
2595
- "Uploading... ",
2596
- uploadProgress,
2597
- "%"
2598
- ] })
2599
- ] }),
2600
- uploadError && /* @__PURE__ */ jsx19(Alert, { variant: "destructive", className: "file-upload__error", children: uploadError }),
2601
- selectedFiles.length > 0 && /* @__PURE__ */ jsxs14("div", { className: "file-upload__actions", children: [
2602
- /* @__PURE__ */ jsx19(
2603
- Button,
2604
- {
2605
- onClick: handleUpload,
2606
- disabled: !canUpload,
2607
- className: "file-upload__upload-btn",
2608
- children: isUploading ? "Uploading..." : `Upload ${selectedFiles.length} file${selectedFiles.length > 1 ? "s" : ""}`
2609
- }
2610
- ),
2611
- /* @__PURE__ */ jsx19(
2612
- Button,
2613
- {
2614
- variant: "outline",
2615
- onClick: handleClear,
2616
- disabled: isUploading,
2617
- className: "file-upload__clear-btn",
2618
- children: "Clear"
2619
- }
2620
- )
2621
- ] })
2622
- ] });
2623
- }
2624
-
2625
- // src/components/Table/Table.tsx
2626
- init_cn();
2627
- import * as React17 from "react";
2628
- import { jsx as jsx20 } from "react/jsx-runtime";
2629
- var Table = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
2630
- "table",
2631
- {
2632
- ref,
2633
- className: cn("w-full caption-bottom text-sm", className),
2634
- ...props
2635
- }
2636
- ));
2637
- Table.displayName = "Table";
2638
- var TableHeader = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
2639
- TableHeader.displayName = "TableHeader";
2640
- var TableBody = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
2641
- "tbody",
2642
- {
2643
- ref,
2644
- className: cn("[&_tr:last-child]:border-0", className),
2645
- ...props
2646
- }
2647
- ));
2648
- TableBody.displayName = "TableBody";
2649
- var TableFooter = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
2650
- "tfoot",
2651
- {
2652
- ref,
2653
- className: cn(
2654
- "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
2655
- className
2656
- ),
2657
- ...props
2658
- }
2659
- ));
2660
- TableFooter.displayName = "TableFooter";
2661
- var TableRow = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
2662
- "tr",
2663
- {
2664
- ref,
2665
- className: cn(
2666
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
2667
- className
2668
- ),
2669
- ...props
2670
- }
2671
- ));
2672
- TableRow.displayName = "TableRow";
2673
- var TableHead = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
2674
- "th",
2675
- {
2676
- ref,
2677
- className: cn(
2678
- "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
2679
- className
2680
- ),
2681
- ...props
2682
- }
2683
- ));
2684
- TableHead.displayName = "TableHead";
2685
- var TableCell = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
2686
- "td",
2687
- {
2688
- ref,
2689
- className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className),
2690
- ...props
2691
- }
2692
- ));
2693
- TableCell.displayName = "TableCell";
2694
- var TableCaption = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
2695
- "caption",
2696
- {
2697
- ref,
2698
- className: cn("mt-4 text-sm text-muted-foreground", className),
2699
- ...props
2700
- }
2701
- ));
2702
- TableCaption.displayName = "TableCaption";
2703
-
2704
- // src/components/PublicLayout/EventLogo.tsx
2705
- import { useMemo as useMemo6 } from "react";
2706
- import { jsx as jsx21 } from "react/jsx-runtime";
2707
- var sizeClasses = {
2708
- xs: "h-4 w-4 text-xs",
2709
- sm: "h-6 w-6 text-sm",
2710
- md: "h-8 w-8 text-base",
2711
- lg: "h-12 w-12 text-lg",
2712
- xl: "h-16 w-16 text-xl",
2713
- "2xl": "h-20 w-20 text-2xl"
2714
- };
2715
- function defaultGenerateFallbackText(eventName) {
2716
- if (!eventName) return "EV";
2717
- return eventName.split(" ").map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
2718
- }
2719
- function EventLogo({
2720
- eventId,
2721
- eventName,
2722
- organisationId,
2723
- size = "md",
2724
- className = "",
2725
- showFallback = true,
2726
- generateFallbackText = defaultGenerateFallbackText,
2727
- validateImage = true,
2728
- loadingComponent: LoadingComponent,
2729
- errorComponent: ErrorComponent
2730
- }) {
2731
- let isPublicPage = false;
2732
- try {
2733
- const { isPublicPage: publicContext } = usePublicPageContext();
2734
- isPublicPage = publicContext === true;
2735
- } catch {
2736
- isPublicPage = false;
2737
- }
2738
- const shouldAvoidAuthContext = useMemo6(() => {
2739
- if (isPublicPage) return true;
2740
- try {
2741
- (init_UnifiedAuthProvider(), __toCommonJS(UnifiedAuthProvider_exports)).useUnifiedAuth();
2742
- return false;
2743
- } catch {
2744
- return true;
2745
- }
2746
- }, [isPublicPage]);
2747
- const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
2748
- const hasValidOrganisationId = organisationId && uuidRegex.test(organisationId);
2749
- const { supabase } = usePublicPageContext();
2750
- if (!supabase) {
2751
- return /* @__PURE__ */ jsx21("div", { className: `${sizeClasses[size]} ${className}`.trim(), title: `${eventName} logo (Supabase not configured)`, children: eventName ? defaultGenerateFallbackText(eventName) : "EV" });
2752
- }
2753
- const {
2754
- logoUrl,
2755
- fallbackText,
2756
- isLoading,
2757
- error
2758
- } = usePublicEventLogo(
2759
- eventId,
2760
- eventName,
2761
- organisationId,
2762
- // Always pass organisationId, let the hook handle validation
2763
- {
2764
- validateImage,
2765
- generateFallbackText,
2766
- supabase
2767
- }
2768
- );
2769
- const sizeClass = useMemo6(() => sizeClasses[size], [size]);
2770
- const combinedClasses = useMemo6(() => {
2771
- const baseClasses = "flex items-center justify-center bg-gray-100 text-gray-600 font-semibold rounded";
2772
- return `${baseClasses} ${sizeClass} ${className}`.trim();
2773
- }, [sizeClass, className]);
2774
- if (!hasValidOrganisationId && !isLoading && !logoUrl && showFallback) {
2775
- return /* @__PURE__ */ jsx21("div", { className: combinedClasses, title: `${eventName} logo (invalid organisation ID)`, children: fallbackText });
2776
- }
2777
- if (isLoading) {
2778
- if (LoadingComponent) {
2779
- return /* @__PURE__ */ jsx21(LoadingComponent, {});
2780
- }
2781
- return /* @__PURE__ */ jsx21("div", { className: `${combinedClasses} animate-pulse`, children: /* @__PURE__ */ jsx21("div", { className: "w-3/4 h-3/4 bg-gray-300 rounded" }) });
2782
- }
2783
- if (error) {
2784
- if (ErrorComponent) {
2785
- return /* @__PURE__ */ jsx21(ErrorComponent, { error });
2786
- }
2787
- if (showFallback) {
2788
- return /* @__PURE__ */ jsx21("div", { className: combinedClasses, title: `${eventName} (logo unavailable)`, children: fallbackText });
2789
- }
2790
- return null;
2791
- }
2792
- if (!logoUrl) {
2793
- if (showFallback) {
2794
- return /* @__PURE__ */ jsx21("div", { className: combinedClasses, title: `${eventName} logo`, children: fallbackText });
2795
- }
2796
- return null;
2797
- }
2798
- return /* @__PURE__ */ jsx21(
2799
- "img",
2800
- {
2801
- src: logoUrl,
2802
- alt: `${eventName} logo`,
2803
- className: `${sizeClass} ${className}`.trim(),
2804
- onError: (e) => {
2805
- const target = e.target;
2806
- target.style.display = "none";
2807
- const fallback = document.createElement("div");
2808
- fallback.className = combinedClasses;
2809
- fallback.textContent = fallbackText;
2810
- fallback.title = `${eventName} logo`;
2811
- target.parentNode?.insertBefore(fallback, target.nextSibling);
2812
- }
2813
- }
2814
- );
2815
- }
2816
- function EventLogoCompact(props) {
2817
- return /* @__PURE__ */ jsx21(
2818
- EventLogo,
2819
- {
2820
- ...props,
2821
- size: "sm",
2822
- className: `${props.className || ""} rounded-sm`
2823
- }
2824
- );
2825
- }
2826
- function EventLogoLarge(props) {
2827
- return /* @__PURE__ */ jsx21(
2828
- EventLogo,
2829
- {
2830
- ...props,
2831
- size: "xl",
2832
- className: `${props.className || ""} rounded-lg`
2833
- }
2834
- );
2835
- }
2836
-
2837
- // src/components/PublicLayout/PublicPageHeader.tsx
2838
- import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
2839
- function PublicPageHeader({
2840
- event,
2841
- eventCode,
2842
- title,
2843
- description,
2844
- showEventLogo = true,
2845
- showAppLogo = true,
2846
- className = "",
2847
- children,
2848
- customAppLogo,
2849
- customEventLogo
2850
- }) {
2851
- const { appName } = useAppConfig();
2852
- const headerClasses = `bg-white border-b border-gray-200 ${className}`.trim();
2853
- return /* @__PURE__ */ jsx22("header", { className: headerClasses, children: /* @__PURE__ */ jsxs15("div", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto", children: [
2854
- /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between py-4", children: [
2855
- showAppLogo && /* @__PURE__ */ jsx22("div", { className: "flex-shrink-0", children: customAppLogo || /* @__PURE__ */ jsxs15("div", { className: "flex items-center", children: [
2856
- /* @__PURE__ */ jsx22(
2857
- "img",
2858
- {
2859
- className: "h-8 w-auto",
2860
- src: `/${appName.toLowerCase()}_logo_wide.svg`,
2861
- alt: appName
2862
- }
2863
- ),
2864
- /* @__PURE__ */ jsx22("span", { className: "ml-2 text-lg font-semibold text-gray-900", children: appName })
2865
- ] }) }),
2866
- showEventLogo && /* @__PURE__ */ jsx22("div", { className: "flex-shrink-0", children: customEventLogo || /* @__PURE__ */ jsx22(
2867
- EventLogo,
2868
- {
2869
- eventId: event.event_id,
2870
- eventName: event.event_name,
2871
- organisationId: event.organisation_id,
2872
- size: "md",
2873
- className: "h-12 w-12"
2874
- }
2875
- ) })
2876
- ] }),
2877
- /* @__PURE__ */ jsx22("div", { className: "pb-4", children: /* @__PURE__ */ jsxs15("div", { className: "text-center", children: [
2878
- /* @__PURE__ */ jsx22("h1", { className: "text-3xl font-bold text-gray-900 mb-2", children: event.event_name }),
2879
- event.event_venue && /* @__PURE__ */ jsx22("p", { className: "text-md text-gray-500 mb-4", children: event.event_venue }),
2880
- title && /* @__PURE__ */ jsxs15("div", { className: "mt-6", children: [
2881
- /* @__PURE__ */ jsx22("h2", { className: "text-2xl font-semibold text-gray-800 mb-2", children: title }),
2882
- description && /* @__PURE__ */ jsx22("p", { className: "text-lg text-gray-600 max-w-3xl mx-auto", children: description })
2883
- ] }),
2884
- children && /* @__PURE__ */ jsx22("div", { className: "mt-4", children })
2885
- ] }) })
2886
- ] }) });
2887
- }
2888
-
2889
- // src/components/PublicLayout/PublicPageFooter.tsx
2890
- init_cn();
2891
- import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
2892
- function PublicPageFooter({
2893
- event,
2894
- companyName = "Solvera Solutions Pty Ltd",
2895
- year = (/* @__PURE__ */ new Date()).getFullYear(),
2896
- links,
2897
- className = "",
2898
- logo,
2899
- copyright,
2900
- children
2901
- }) {
2902
- const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
2903
- return /* @__PURE__ */ jsx23("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs16("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
2904
- logo && /* @__PURE__ */ jsx23("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
2905
- children && /* @__PURE__ */ jsx23(Fragment5, { children }),
2906
- /* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: copyrightText }),
2907
- links && links.length > 0 && /* @__PURE__ */ jsx23("ul", { className: "flex gap-4 mt-2 md:mt-0", children: links.map((link, index) => /* @__PURE__ */ jsx23("li", { children: /* @__PURE__ */ jsx23("a", { href: link.href, className: "text-muted-foreground hover:text-foreground", children: link.label }) }, index)) })
2908
- ] }) });
2909
- }
2910
-
2911
- // src/components/PublicLayout/PublicLoadingSpinner.tsx
2912
- import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
2913
- var sizeClasses2 = {
2914
- sm: "h-4 w-4",
2915
- md: "h-8 w-8",
2916
- lg: "h-12 w-12",
2917
- xl: "h-16 w-16"
2918
- };
2919
- function PublicLoadingSpinner({
2920
- message = "Loading...",
2921
- size = "md",
2922
- className = "",
2923
- showLogo = true,
2924
- customMessage,
2925
- centered = true
2926
- }) {
2927
- const sizeClass = sizeClasses2[size];
2928
- const displayMessage = customMessage || message;
2929
- const content = /* @__PURE__ */ jsxs17("div", { className: `flex flex-col items-center ${className}`, children: [
2930
- showLogo && /* @__PURE__ */ jsx24("div", { className: "mb-4", children: /* @__PURE__ */ jsx24(
2931
- "img",
2932
- {
2933
- className: "h-8 w-auto",
2934
- src: "/pace_logo_wide.svg",
2935
- alt: "PACE Core"
2936
- }
2937
- ) }),
2938
- /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
2939
- /* @__PURE__ */ jsx24(
2940
- "div",
2941
- {
2942
- className: `${sizeClass} border-2 border-gray-200 border-t-blue-600 rounded-full animate-spin`,
2943
- role: "status",
2944
- "aria-label": "Loading"
2945
- }
2946
- ),
2947
- /* @__PURE__ */ jsx24("span", { className: "sr-only", children: displayMessage })
2948
- ] }),
2949
- displayMessage && /* @__PURE__ */ jsx24("p", { className: "mt-4 text-sm text-gray-600 text-center", children: displayMessage })
2950
- ] });
2951
- if (centered) {
2952
- return /* @__PURE__ */ jsx24("div", { className: "min-h-screen bg-white flex items-center justify-center", children: /* @__PURE__ */ jsx24("div", { className: "max-w-md mx-auto px-4", children: content }) });
2953
- }
2954
- return content;
2955
- }
2956
- function PublicLoadingSpinnerFullPage({
2957
- message = "Loading event details...",
2958
- eventName,
2959
- className = ""
2960
- }) {
2961
- return /* @__PURE__ */ jsx24("div", { className: `min-h-screen bg-white flex items-center justify-center ${className}`, children: /* @__PURE__ */ jsxs17("div", { className: "max-w-md mx-auto text-center px-4", children: [
2962
- /* @__PURE__ */ jsx24("div", { className: "mb-8", children: /* @__PURE__ */ jsx24(
2963
- "img",
2964
- {
2965
- className: "h-12 w-auto mx-auto",
2966
- src: "/pace_logo_wide.svg",
2967
- alt: "PACE Core"
2968
- }
2969
- ) }),
2970
- eventName && /* @__PURE__ */ jsx24("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: eventName }),
2971
- /* @__PURE__ */ jsx24("div", { className: "relative mb-6", children: /* @__PURE__ */ jsx24(
2972
- "div",
2973
- {
2974
- className: "h-12 w-12 border-4 border-gray-200 border-t-blue-600 rounded-full animate-spin mx-auto",
2975
- role: "status",
2976
- "aria-label": "Loading"
2977
- }
2978
- ) }),
2979
- /* @__PURE__ */ jsx24("p", { className: "text-lg text-gray-600", children: message }),
2980
- /* @__PURE__ */ jsxs17("div", { className: "mt-4 flex justify-center space-x-1", children: [
2981
- /* @__PURE__ */ jsx24("div", { className: "h-2 w-2 bg-blue-600 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
2982
- /* @__PURE__ */ jsx24("div", { className: "h-2 w-2 bg-blue-600 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
2983
- /* @__PURE__ */ jsx24("div", { className: "h-2 w-2 bg-blue-600 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
2984
- ] })
2985
- ] }) });
2986
- }
2987
- function PublicLoadingSkeleton({
2988
- lines = 3,
2989
- className = ""
2990
- }) {
2991
- return /* @__PURE__ */ jsx24("div", { className: `animate-pulse ${className}`, children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx24(
2992
- "div",
2993
- {
2994
- className: `h-4 bg-gray-200 rounded mb-2 ${index === lines - 1 ? "w-3/4" : "w-full"}`
2995
- },
2996
- index
2997
- )) });
2998
- }
2999
-
3000
- // src/components/PublicLayout/PublicPageLayout.tsx
3001
- import { useMemo as useMemo7 } from "react";
3002
- import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
3003
- function PublicPageLayout({
3004
- eventCode,
3005
- children,
3006
- event = null,
3007
- showFooter = true,
3008
- className = "",
3009
- errorFallback: ErrorFallback,
3010
- loadingFallback: LoadingFallback = PublicLoadingSpinner,
3011
- customHeader,
3012
- customFooter,
3013
- showValidationErrors = true
3014
- }) {
3015
- const isLoading = false;
3016
- const error = null;
3017
- const refetch = async () => {
3018
- };
3019
- const layoutClasses = useMemo7(() => {
3020
- const baseClasses = "min-h-screen bg-white flex flex-col";
3021
- return `${baseClasses} ${className}`.trim();
3022
- }, [className]);
3023
- if (isLoading) {
3024
- return /* @__PURE__ */ jsx25("div", { className: layoutClasses, children: /* @__PURE__ */ jsx25("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsx25(LoadingFallback, {}) }) });
3025
- }
3026
- if (error && showValidationErrors) {
3027
- return /* @__PURE__ */ jsx25("div", { className: layoutClasses, children: /* @__PURE__ */ jsx25("div", { className: "flex-1 flex items-center justify-center", children: ErrorFallback ? /* @__PURE__ */ jsx25(ErrorFallback, { error, retry: refetch }) : /* @__PURE__ */ jsxs18("div", { className: "text-center p-8", children: [
3028
- /* @__PURE__ */ jsx25("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: "Event Not Found" }),
3029
- /* @__PURE__ */ jsxs18("p", { className: "text-gray-600 mb-6", children: [
3030
- 'The event code "',
3031
- eventCode,
3032
- '" is invalid or the event is not available for public viewing.'
3033
- ] }),
3034
- /* @__PURE__ */ jsx25(
3035
- "button",
3036
- {
3037
- onClick: refetch,
3038
- className: "px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors",
3039
- children: "Try Again"
3040
- }
3041
- )
3042
- ] }) }) });
3043
- }
3044
- if (!event) {
3045
- return /* @__PURE__ */ jsx25("div", { className: layoutClasses, children: /* @__PURE__ */ jsx25("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsxs18("div", { className: "text-center p-8", children: [
3046
- /* @__PURE__ */ jsx25("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: "Event Not Available" }),
3047
- /* @__PURE__ */ jsx25("p", { className: "text-gray-600 mb-6", children: "This event is not available for public viewing." }),
3048
- /* @__PURE__ */ jsx25(
3049
- "button",
3050
- {
3051
- onClick: refetch,
3052
- className: "px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors",
3053
- children: "Try Again"
3054
- }
3055
- )
3056
- ] }) }) });
3057
- }
3058
- return /* @__PURE__ */ jsx25(PublicErrorBoundary, { children: /* @__PURE__ */ jsxs18("div", { className: layoutClasses, children: [
3059
- customHeader || /* @__PURE__ */ jsx25(
3060
- PublicPageHeader,
3061
- {
3062
- event,
3063
- eventCode
3064
- }
3065
- ),
3066
- /* @__PURE__ */ jsx25("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children }),
3067
- showFooter && (customFooter || /* @__PURE__ */ jsx25(PublicPageFooter, { event }))
3068
- ] }) });
3069
- }
3070
- function usePublicPageContext2() {
3071
- return {
3072
- eventCode: null,
3073
- eventId: null,
3074
- event: null,
3075
- isLoading: false,
3076
- error: null,
3077
- refetch: async () => {
3078
- },
3079
- isPublicPage: true
3080
- };
3081
- }
3082
-
3083
- // src/components/PublicLayout/PublicPageDebugger.tsx
3084
- import { useEffect as useEffect5 } from "react";
3085
- import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
3086
- function PublicPageDebugger({ enabled = true, label = "PublicPage" }) {
3087
- useEffect5(() => {
3088
- if (!enabled) return;
3089
- console.log(`[${label}] Component mounted`);
3090
- try {
3091
- const { isPublicPage } = usePublicPageContext();
3092
- console.log(`[${label}] Public page context detected:`, isPublicPage);
3093
- } catch (error) {
3094
- console.warn(`[${label}] Not in PublicPageProvider context:`, error instanceof Error ? error.message : String(error));
3095
- }
3096
- try {
3097
- const { isAuthenticated } = (init_UnifiedAuthProvider(), __toCommonJS(UnifiedAuthProvider_exports)).useUnifiedAuth();
3098
- console.warn(`[${label}] AUTHENTICATION CONTEXT DETECTED! This should not happen in public pages.`);
3099
- console.warn(`[${label}] isAuthenticated:`, isAuthenticated);
3100
- } catch (error) {
3101
- console.log(`[${label}] No authentication context detected (good for public pages)`);
3102
- }
3103
- try {
3104
- const { selectedOrganisation } = (init_OrganisationProvider(), __toCommonJS(OrganisationProvider_exports)).useOrganisations();
3105
- console.warn(`[${label}] ORGANISATION CONTEXT DETECTED! This should not happen in public pages.`);
3106
- console.warn(`[${label}] selectedOrganisation:`, selectedOrganisation);
3107
- } catch (error) {
3108
- console.log(`[${label}] No organisation context detected (good for public pages)`);
3109
- }
3110
- try {
3111
- const { events } = (init_EventProvider(), __toCommonJS(EventProvider_exports)).useEvents();
3112
- console.warn(`[${label}] EVENT CONTEXT DETECTED! This should not happen in public pages.`);
3113
- console.warn(`[${label}] events:`, events);
3114
- } catch (error) {
3115
- console.log(`[${label}] No event context detected (good for public pages)`);
3116
- }
3117
- const supabaseUrl = import.meta.env?.VITE_SUPABASE_URL || process.env.VITE_SUPABASE_URL;
3118
- const supabaseKey = import.meta.env?.VITE_SUPABASE_ANON_KEY || process.env.VITE_SUPABASE_ANON_KEY;
3119
- console.log(`[${label}] Environment variables:`, {
3120
- supabaseUrl: supabaseUrl ? "Present" : "Missing",
3121
- supabaseKey: supabaseKey ? "Present" : "Missing"
3122
- });
3123
- return () => {
3124
- console.log(`[${label}] Component unmounted`);
3125
- };
3126
- }, [enabled, label]);
3127
- if (!enabled) return null;
3128
- return /* @__PURE__ */ jsxs19("div", { style: {
3129
- position: "fixed",
3130
- top: 0,
3131
- right: 0,
3132
- background: "rgba(0,0,0,0.8)",
3133
- color: "white",
3134
- padding: "8px",
3135
- fontSize: "12px",
3136
- zIndex: 9999,
3137
- fontFamily: "monospace"
3138
- }, children: [
3139
- /* @__PURE__ */ jsx26("div", { children: "Public Page Debugger" }),
3140
- /* @__PURE__ */ jsx26("div", { children: "Check console for context analysis" })
3141
- ] });
3142
- }
3143
-
3144
- // src/components/PublicLayout/PublicPageDiagnostic.tsx
3145
- import { useEffect as useEffect6, useState as useState11 } from "react";
3146
- import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
3147
- function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
3148
- const [diagnostics, setDiagnostics] = useState11({
3149
- hasPublicPageContext: false,
3150
- hasAuthContext: false,
3151
- hasOrgContext: false,
3152
- hasEventContext: false,
3153
- hasEnvironmentVars: false,
3154
- routeParams: null
3155
- });
3156
- useEffect6(() => {
3157
- if (!enabled) return;
3158
- const runDiagnostics = () => {
3159
- const newDiagnostics = {
3160
- hasPublicPageContext: false,
3161
- hasAuthContext: false,
3162
- hasOrgContext: false,
3163
- hasEventContext: false,
3164
- hasEnvironmentVars: false,
3165
- routeParams: null
3166
- };
3167
- try {
3168
- const { isPublicPage } = usePublicPageContext();
3169
- newDiagnostics.hasPublicPageContext = isPublicPage === true;
3170
- } catch (error) {
3171
- newDiagnostics.hasPublicPageContext = false;
3172
- }
3173
- try {
3174
- const { isAuthenticated } = (init_UnifiedAuthProvider(), __toCommonJS(UnifiedAuthProvider_exports)).useUnifiedAuth();
3175
- newDiagnostics.hasAuthContext = true;
3176
- } catch (error) {
3177
- newDiagnostics.hasAuthContext = false;
3178
- }
3179
- try {
3180
- const { selectedOrganisation } = (init_OrganisationProvider(), __toCommonJS(OrganisationProvider_exports)).useOrganisations();
3181
- newDiagnostics.hasOrgContext = true;
3182
- } catch (error) {
3183
- newDiagnostics.hasOrgContext = false;
3184
- }
3185
- try {
3186
- const { events } = (init_EventProvider(), __toCommonJS(EventProvider_exports)).useEvents();
3187
- newDiagnostics.hasEventContext = true;
3188
- } catch (error) {
3189
- newDiagnostics.hasEventContext = false;
3190
- }
3191
- const supabaseUrl = import.meta.env?.VITE_SUPABASE_URL || process.env.VITE_SUPABASE_URL;
3192
- const supabaseKey = import.meta.env?.VITE_SUPABASE_ANON_KEY || process.env.VITE_SUPABASE_ANON_KEY;
3193
- newDiagnostics.hasEnvironmentVars = !!(supabaseUrl && supabaseKey);
3194
- try {
3195
- const { useParams } = __require("react-router-dom");
3196
- const params = useParams();
3197
- newDiagnostics.routeParams = params;
3198
- } catch (error) {
3199
- newDiagnostics.routeParams = null;
3200
- }
3201
- setDiagnostics(newDiagnostics);
3202
- console.group(`\u{1F50D} [${label}] Public Page Diagnostics`);
3203
- console.log("\u2705 Public Page Context:", newDiagnostics.hasPublicPageContext ? "PRESENT" : "MISSING");
3204
- console.log("\u274C Auth Context:", newDiagnostics.hasAuthContext ? "PRESENT (BAD!)" : "ABSENT (GOOD!)");
3205
- console.log("\u274C Org Context:", newDiagnostics.hasOrgContext ? "PRESENT (BAD!)" : "ABSENT (GOOD!)");
3206
- console.log("\u274C Event Context:", newDiagnostics.hasEventContext ? "PRESENT (BAD!)" : "ABSENT (GOOD!)");
3207
- console.log("\u2705 Environment Vars:", newDiagnostics.hasEnvironmentVars ? "PRESENT" : "MISSING");
3208
- console.log("\u2705 Route Params:", newDiagnostics.routeParams);
3209
- console.groupEnd();
3210
- if (newDiagnostics.hasAuthContext || newDiagnostics.hasOrgContext || newDiagnostics.hasEventContext) {
3211
- console.error(`\u{1F6A8} [${label}] PROBLEM DETECTED: Public page is inside authentication context!`);
3212
- console.error("\u{1F527} SOLUTION: Move public routes outside of UnifiedAuthProvider, OrganisationProvider, and EventProvider");
3213
- console.error("\u{1F4D6} See: packages/core/docs/emergency-public-pages-fix.md");
3214
- } else if (!newDiagnostics.hasPublicPageContext) {
3215
- console.warn(`\u26A0\uFE0F [${label}] WARNING: Not in PublicPageProvider context`);
3216
- console.warn("\u{1F527} SOLUTION: Wrap your public page component in <PublicPageProvider>");
3217
- } else if (!newDiagnostics.hasEnvironmentVars) {
3218
- console.warn(`\u26A0\uFE0F [${label}] WARNING: Missing environment variables`);
3219
- console.warn("\u{1F527} SOLUTION: Set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY in your environment");
3220
- } else {
3221
- console.log(`\u2705 [${label}] All diagnostics passed! Public page should work correctly.`);
3222
- }
3223
- };
3224
- runDiagnostics();
3225
- }, [enabled, label]);
3226
- if (!enabled) return null;
3227
- return /* @__PURE__ */ jsxs20("div", { style: {
3228
- position: "fixed",
3229
- top: 0,
3230
- left: 0,
3231
- background: "rgba(0,0,0,0.9)",
3232
- color: "white",
3233
- padding: "12px",
3234
- fontSize: "11px",
3235
- zIndex: 9999,
3236
- fontFamily: "monospace",
3237
- maxWidth: "300px",
3238
- borderRadius: "0 0 8px 0"
3239
- }, children: [
3240
- /* @__PURE__ */ jsx27("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F50D} Public Page Diagnostics" }),
3241
- /* @__PURE__ */ jsxs20("div", { children: [
3242
- "Public Context: ",
3243
- diagnostics.hasPublicPageContext ? "\u2705" : "\u274C"
3244
- ] }),
3245
- /* @__PURE__ */ jsxs20("div", { children: [
3246
- "Auth Context: ",
3247
- diagnostics.hasAuthContext ? "\u274C BAD" : "\u2705 GOOD"
3248
- ] }),
3249
- /* @__PURE__ */ jsxs20("div", { children: [
3250
- "Org Context: ",
3251
- diagnostics.hasOrgContext ? "\u274C BAD" : "\u2705 GOOD"
3252
- ] }),
3253
- /* @__PURE__ */ jsxs20("div", { children: [
3254
- "Event Context: ",
3255
- diagnostics.hasEventContext ? "\u274C BAD" : "\u2705 GOOD"
3256
- ] }),
3257
- /* @__PURE__ */ jsxs20("div", { children: [
3258
- "Env Vars: ",
3259
- diagnostics.hasEnvironmentVars ? "\u2705" : "\u274C"
3260
- ] }),
3261
- /* @__PURE__ */ jsxs20("div", { children: [
3262
- "Route Params: ",
3263
- diagnostics.routeParams ? "\u2705" : "\u274C"
3264
- ] }),
3265
- /* @__PURE__ */ jsx27("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.8 }, children: "Check console for detailed analysis" })
3266
- ] });
3267
- }
3268
-
3269
- // src/components/PublicLayout/PublicPageContextChecker.tsx
3270
- import { useEffect as useEffect7 } from "react";
3271
- import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
3272
- function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
3273
- useEffect7(() => {
3274
- if (!enabled) return;
3275
- console.group(`\u{1F6A8} [${label}] PUBLIC PAGE CONTEXT CHECK`);
3276
- try {
3277
- const { isAuthenticated } = (init_UnifiedAuthProvider(), __toCommonJS(UnifiedAuthProvider_exports)).useUnifiedAuth();
3278
- console.error(`\u274C [${label}] AUTHENTICATION CONTEXT DETECTED!`);
3279
- console.error(`\u274C [${label}] isAuthenticated:`, isAuthenticated);
3280
- console.error(`\u274C [${label}] This public page is inside UnifiedAuthProvider - THIS IS WRONG!`);
3281
- console.error(`\u274C [${label}] SOLUTION: Move public routes outside of authentication providers`);
3282
- } catch (error) {
3283
- console.log(`\u2705 [${label}] No authentication context detected (GOOD!)`);
3284
- }
3285
- try {
3286
- const { selectedOrganisation } = (init_OrganisationProvider(), __toCommonJS(OrganisationProvider_exports)).useOrganisations();
3287
- console.error(`\u274C [${label}] ORGANISATION CONTEXT DETECTED!`);
3288
- console.error(`\u274C [${label}] selectedOrganisation:`, selectedOrganisation);
3289
- console.error(`\u274C [${label}] This public page is inside OrganisationProvider - THIS IS WRONG!`);
3290
- console.error(`\u274C [${label}] SOLUTION: Move public routes outside of authentication providers`);
3291
- } catch (error) {
3292
- console.log(`\u2705 [${label}] No organisation context detected (GOOD!)`);
3293
- }
3294
- try {
3295
- const { events } = (init_EventProvider(), __toCommonJS(EventProvider_exports)).useEvents();
3296
- console.error(`\u274C [${label}] EVENT CONTEXT DETECTED!`);
3297
- console.error(`\u274C [${label}] events:`, events);
3298
- console.error(`\u274C [${label}] This public page is inside EventProvider - THIS IS WRONG!`);
3299
- console.error(`\u274C [${label}] SOLUTION: Move public routes outside of authentication providers`);
3300
- } catch (error) {
3301
- console.log(`\u2705 [${label}] No event context detected (GOOD!)`);
3302
- }
3303
- try {
3304
- const { isPublicPage } = usePublicPageContext();
3305
- if (isPublicPage) {
3306
- console.log(`\u2705 [${label}] Public page context detected (GOOD!)`);
3307
- } else {
3308
- console.warn(`\u26A0\uFE0F [${label}] Not in PublicPageProvider context`);
3309
- console.warn(`\u26A0\uFE0F [${label}] SOLUTION: Wrap your public page in <PublicPageProvider>`);
3310
- }
3311
- } catch (error) {
3312
- console.warn(`\u26A0\uFE0F [${label}] Not in PublicPageProvider context`);
3313
- console.warn(`\u26A0\uFE0F [${label}] SOLUTION: Wrap your public page in <PublicPageProvider>`);
3314
- }
3315
- console.groupEnd();
3316
- console.group(`\u{1F4D6} [${label}] IMMEDIATE ACTION REQUIRED`);
3317
- console.log(`If you see any \u274C errors above, your public page is inside authentication context.`);
3318
- console.log(`This will cause infinite loading loops and authentication errors.`);
3319
- console.log(``);
3320
- console.log(`\u{1F527} SOLUTION:`);
3321
- console.log(`1. Check your main App.tsx file`);
3322
- console.log(`2. Make sure public routes are completely separate from authentication providers`);
3323
- console.log(`3. Follow the architecture in: packages/core/docs/public-pages-guide.md`);
3324
- console.log(``);
3325
- console.log(`\u2705 CORRECT ARCHITECTURE:`);
3326
- console.log(`<BrowserRouter>`);
3327
- console.log(` <Routes>`);
3328
- console.log(` <Route path="/events/*" element={<PublicPageApp />} />`);
3329
- console.log(` <Route path="/*" element={<AuthenticatedApp />} />`);
3330
- console.log(` </Routes>`);
3331
- console.log(`</BrowserRouter>`);
3332
- console.groupEnd();
3333
- }, [enabled, label]);
3334
- if (!enabled) return null;
3335
- return /* @__PURE__ */ jsxs21("div", { style: {
3336
- position: "fixed",
3337
- top: 0,
3338
- left: 0,
3339
- background: "rgba(220, 38, 38, 0.95)",
3340
- color: "white",
3341
- padding: "12px",
3342
- fontSize: "12px",
3343
- zIndex: 9999,
3344
- fontFamily: "monospace",
3345
- maxWidth: "400px",
3346
- borderRadius: "0 0 8px 0",
3347
- border: "2px solid #dc2626"
3348
- }, children: [
3349
- /* @__PURE__ */ jsx28("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F6A8} PUBLIC PAGE CONTEXT CHECK" }),
3350
- /* @__PURE__ */ jsx28("div", { children: "Check console for authentication context analysis" }),
3351
- /* @__PURE__ */ jsx28("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.9 }, children: "If you see \u274C errors in console, your public page is inside auth context!" })
3352
- ] });
3353
- }
3354
-
3355
- export {
3356
- Card,
3357
- CardHeader,
3358
- CardTitle,
3359
- CardDescription,
3360
- CardContent,
3361
- CardFooter,
3362
- CardActions,
3363
- Label,
3364
- Avatar,
3365
- AvatarImage,
3366
- AvatarFallback,
3367
- Progress,
3368
- ToastProvider,
3369
- ToastViewport,
3370
- Toast,
3371
- ToastAction,
3372
- ToastClose,
3373
- ToastTitle,
3374
- ToastDescription,
3375
- useToast,
3376
- Toaster,
3377
- Form,
3378
- LoginForm,
3379
- EventSelector,
3380
- PasswordChangeForm,
3381
- UserMenu,
3382
- NavigationMenu,
3383
- Header,
3384
- Footer,
3385
- PaceAppLayout,
3386
- PaceLoginPage,
3387
- ErrorBoundary,
3388
- OrganisationSelector,
3389
- PasswordResetForm,
3390
- FILE_SIZE_LIMITS,
3391
- DEFAULT_FILE_SIZE_LIMIT,
3392
- APP_PATH_MAPPING,
3393
- STORAGE_CONFIG,
3394
- getFileSizeLimit,
3395
- validateFileSize,
3396
- formatFileSize,
3397
- generateFilePath,
3398
- generateUniqueFileName,
3399
- extractFileMetadata,
3400
- uploadFile,
3401
- getPublicUrl,
3402
- getSignedUrl,
3403
- deleteFile,
3404
- listFiles,
3405
- archiveFile,
3406
- useStorage,
3407
- useFileUpload,
3408
- FileUpload,
3409
- Table,
3410
- TableHeader,
3411
- TableBody,
3412
- TableFooter,
3413
- TableRow,
3414
- TableHead,
3415
- TableCell,
3416
- TableCaption,
3417
- EventLogo,
3418
- EventLogoCompact,
3419
- EventLogoLarge,
3420
- PublicPageHeader,
3421
- PublicPageFooter,
3422
- PublicLoadingSpinner,
3423
- PublicLoadingSpinnerFullPage,
3424
- PublicLoadingSkeleton,
3425
- PublicPageLayout,
3426
- usePublicPageContext2 as usePublicPageContext,
3427
- PublicPageDebugger,
3428
- PublicPageDiagnostic,
3429
- PublicPageContextChecker
3430
- };
3431
- //# sourceMappingURL=chunk-RRUYHORU.js.map