@jmruthers/pace-core 0.5.134 → 0.5.136

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 (522) hide show
  1. package/dist/{DataTable-C7GaRZye.d.ts → DataTable-CWAZZcXC.d.ts} +1 -1
  2. package/dist/{DataTable-A36PJG6N.js → DataTable-CYOHOX3O.js} +25 -13
  3. package/dist/{PublicLoadingSpinner-CUAnTvcg.d.ts → EventLogo-801uofbR.d.ts} +51 -135
  4. package/dist/UnifiedAuthProvider-5E5TUNMS.js +17 -0
  5. package/dist/{UnifiedAuthProvider-BVKmQd9u.d.ts → UnifiedAuthProvider-DJxGTftH.d.ts} +1 -1
  6. package/dist/{api-TNIBJWLM.js → api-45XYYO2A.js} +4 -3
  7. package/dist/{audit-T36HM7IM.js → audit-64X3VJXB.js} +3 -2
  8. package/dist/{chunk-CTJRBUX2.js → chunk-2TWNJ46Y.js} +2 -2
  9. package/dist/{chunk-UJI6WSMD.js → chunk-444EZN6N.js} +3 -3
  10. package/dist/chunk-444EZN6N.js.map +1 -0
  11. package/dist/{chunk-3CG5L6RN.js → chunk-4MT5BGGL.js} +90 -73
  12. package/dist/chunk-4MT5BGGL.js.map +1 -0
  13. package/dist/{chunk-PYUXFQJ3.js → chunk-56XJ3TU6.js} +2 -2
  14. package/dist/chunk-56XJ3TU6.js.map +1 -0
  15. package/dist/chunk-5DPZ5EAT.js +60 -0
  16. package/dist/chunk-5DPZ5EAT.js.map +1 -0
  17. package/dist/{chunk-66C4BSAY.js → chunk-ANBQRTPX.js} +9 -2
  18. package/dist/chunk-ANBQRTPX.js.map +1 -0
  19. package/dist/chunk-APIBCTL2.js +670 -0
  20. package/dist/chunk-APIBCTL2.js.map +1 -0
  21. package/dist/{chunk-GKHF54DI.js → chunk-BESYRHQM.js} +10 -4
  22. package/dist/chunk-BESYRHQM.js.map +1 -0
  23. package/dist/{chunk-WP5I5GLN.js → chunk-BVYWGZVV.js} +112 -97
  24. package/dist/chunk-BVYWGZVV.js.map +1 -0
  25. package/dist/{chunk-GEVIB2UB.js → chunk-ERISIBYU.js} +14 -5
  26. package/dist/chunk-ERISIBYU.js.map +1 -0
  27. package/dist/{chunk-CQZU6TFE.js → chunk-FHWWBIHA.js} +100 -62
  28. package/dist/chunk-FHWWBIHA.js.map +1 -0
  29. package/dist/{chunk-O3NWNXDY.js → chunk-FMUCXFII.js} +2 -2
  30. package/dist/chunk-FMUCXFII.js.map +1 -0
  31. package/dist/{chunk-GVDR7WNV.js → chunk-HJGGOMQ6.js} +194 -518
  32. package/dist/chunk-HJGGOMQ6.js.map +1 -0
  33. package/dist/{chunk-BDZUMRBD.js → chunk-K2WWTH7O.js} +13 -6
  34. package/dist/chunk-K2WWTH7O.js.map +1 -0
  35. package/dist/{chunk-BYXRHAIF.js → chunk-L6PGMCMD.js} +23 -14
  36. package/dist/chunk-L6PGMCMD.js.map +1 -0
  37. package/dist/chunk-LMC26NLJ.js +84 -0
  38. package/dist/chunk-LMC26NLJ.js.map +1 -0
  39. package/dist/{chunk-M6DDYFUD.js → chunk-LS353YLY.js} +19 -16
  40. package/dist/chunk-LS353YLY.js.map +1 -0
  41. package/dist/{chunk-ZYZCRSBD.js → chunk-LTV3XIJJ.js} +16 -11
  42. package/dist/chunk-LTV3XIJJ.js.map +1 -0
  43. package/dist/{chunk-HMNOSGVA.js → chunk-NOHEVYVX.js} +377 -666
  44. package/dist/chunk-NOHEVYVX.js.map +1 -0
  45. package/dist/{chunk-JCQZ6LA7.js → chunk-Q5QRDWKI.js} +9 -3
  46. package/dist/chunk-Q5QRDWKI.js.map +1 -0
  47. package/dist/chunk-S5OFRT4M.js +94 -0
  48. package/dist/chunk-S5OFRT4M.js.map +1 -0
  49. package/dist/{chunk-3DBFLLLU.js → chunk-SBVILCCA.js} +14 -9
  50. package/dist/chunk-SBVILCCA.js.map +1 -0
  51. package/dist/{chunk-TGIY2AR2.js → chunk-SL2YQDR6.js} +4 -3
  52. package/dist/{chunk-TGIY2AR2.js.map → chunk-SL2YQDR6.js.map} +1 -1
  53. package/dist/{chunk-VZ5OR6HD.js → chunk-TVYPTYOY.js} +55 -179
  54. package/dist/chunk-TVYPTYOY.js.map +1 -0
  55. package/dist/{chunk-ZV77RZMU.js → chunk-XARJS7CD.js} +2 -2
  56. package/dist/chunk-XDNLUEXI.js +138 -0
  57. package/dist/chunk-XDNLUEXI.js.map +1 -0
  58. package/dist/{chunk-F64FFPOZ.js → chunk-YLKIDTUK.js} +26 -20
  59. package/dist/chunk-YLKIDTUK.js.map +1 -0
  60. package/dist/{chunk-5F3NDPJV.js → chunk-ZZ2SS7NI.js} +10 -5
  61. package/dist/chunk-ZZ2SS7NI.js.map +1 -0
  62. package/dist/components.d.ts +7 -287
  63. package/dist/components.js +26 -157
  64. package/dist/components.js.map +1 -1
  65. package/dist/{file-reference-C9isKNPn.d.ts → file-reference-C6Gkn77H.d.ts} +1 -1
  66. package/dist/{formatting-DFcCxUEk.d.ts → formatting-CvUXy2mF.d.ts} +1 -1
  67. package/dist/hooks.d.ts +3 -3
  68. package/dist/hooks.js +22 -16
  69. package/dist/hooks.js.map +1 -1
  70. package/dist/index.d.ts +219 -9
  71. package/dist/index.js +49 -31
  72. package/dist/index.js.map +1 -1
  73. package/dist/providers.d.ts +1 -1
  74. package/dist/providers.js +5 -4
  75. package/dist/rbac/index.js +13 -12
  76. package/dist/styles/index.js +2 -1
  77. package/dist/theming/runtime.d.ts +2 -19
  78. package/dist/theming/runtime.js +2 -1
  79. package/dist/{types-D5rqZQXk.d.ts → types-Dfz9dmVH.d.ts} +12 -1
  80. package/dist/types.d.ts +2 -2
  81. package/dist/types.js +1 -1
  82. package/dist/{useInactivityTracker-MRUU55XI.js → useInactivityTracker-TO6ZOF35.js} +3 -2
  83. package/dist/{usePublicRouteParams-Dyt1tzI9.d.ts → usePublicRouteParams-B7PabvuH.d.ts} +1 -1
  84. package/dist/utils.d.ts +195 -232
  85. package/dist/utils.js +173 -331
  86. package/dist/utils.js.map +1 -1
  87. package/dist/{validation-DnhrNMju.d.ts → validation-8npbysjg.d.ts} +26 -8
  88. package/dist/validation.d.ts +261 -10
  89. package/dist/validation.js +82 -440
  90. package/dist/validation.js.map +1 -1
  91. package/docs/api/classes/ColumnFactory.md +1 -1
  92. package/docs/api/classes/ErrorBoundary.md +6 -6
  93. package/docs/api/classes/InvalidScopeError.md +1 -1
  94. package/docs/api/classes/MissingUserContextError.md +1 -1
  95. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  96. package/docs/api/classes/PermissionDeniedError.md +1 -1
  97. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  98. package/docs/api/classes/RBACAuditManager.md +6 -6
  99. package/docs/api/classes/RBACCache.md +1 -1
  100. package/docs/api/classes/RBACEngine.md +7 -7
  101. package/docs/api/classes/RBACError.md +1 -1
  102. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  103. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  104. package/docs/api/classes/StorageUtils.md +1 -1
  105. package/docs/api/enums/FileCategory.md +1 -1
  106. package/docs/api/interfaces/AggregateConfig.md +4 -4
  107. package/docs/api/interfaces/ButtonProps.md +1 -1
  108. package/docs/api/interfaces/CardProps.md +1 -1
  109. package/docs/api/interfaces/ColorPalette.md +1 -1
  110. package/docs/api/interfaces/ColorShade.md +29 -4
  111. package/docs/api/interfaces/DataAccessRecord.md +9 -9
  112. package/docs/api/interfaces/DataRecord.md +1 -1
  113. package/docs/api/interfaces/DataTableAction.md +18 -18
  114. package/docs/api/interfaces/DataTableColumn.md +61 -1
  115. package/docs/api/interfaces/DataTableProps.md +3 -3
  116. package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
  117. package/docs/api/interfaces/EmptyStateConfig.md +5 -5
  118. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +14 -14
  119. package/docs/api/interfaces/EventAppRoleData.md +1 -1
  120. package/docs/api/interfaces/EventLogoProps.md +152 -0
  121. package/docs/api/interfaces/ExportColumn.md +90 -0
  122. package/docs/api/interfaces/ExportOptions.md +126 -0
  123. package/docs/api/interfaces/FileDisplayProps.md +15 -15
  124. package/docs/api/interfaces/FileMetadata.md +1 -1
  125. package/docs/api/interfaces/FileReference.md +1 -1
  126. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  127. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  128. package/docs/api/interfaces/FileUploadProps.md +1 -1
  129. package/docs/api/interfaces/FooterProps.md +1 -1
  130. package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
  131. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  132. package/docs/api/interfaces/InputProps.md +1 -1
  133. package/docs/api/interfaces/LabelProps.md +1 -1
  134. package/docs/api/interfaces/LoginFormProps.md +1 -1
  135. package/docs/api/interfaces/NavigationAccessRecord.md +10 -10
  136. package/docs/api/interfaces/NavigationContextType.md +9 -9
  137. package/docs/api/interfaces/NavigationGuardProps.md +10 -10
  138. package/docs/api/interfaces/NavigationItem.md +1 -1
  139. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  140. package/docs/api/interfaces/NavigationProviderProps.md +7 -7
  141. package/docs/api/interfaces/Organisation.md +1 -1
  142. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  143. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  144. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  145. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  146. package/docs/api/interfaces/PaceAppLayoutProps.md +27 -27
  147. package/docs/api/interfaces/PaceLoginPageProps.md +4 -4
  148. package/docs/api/interfaces/PageAccessRecord.md +8 -8
  149. package/docs/api/interfaces/PagePermissionContextType.md +8 -8
  150. package/docs/api/interfaces/PagePermissionGuardProps.md +11 -11
  151. package/docs/api/interfaces/PagePermissionProviderProps.md +7 -7
  152. package/docs/api/interfaces/PaletteData.md +4 -4
  153. package/docs/api/interfaces/PermissionEnforcerProps.md +11 -11
  154. package/docs/api/interfaces/ProtectedRouteProps.md +6 -6
  155. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  156. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  157. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  158. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  159. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  160. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  161. package/docs/api/interfaces/RBACConfig.md +1 -1
  162. package/docs/api/interfaces/RBACLogger.md +1 -1
  163. package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
  164. package/docs/api/interfaces/RoleBasedRouterContextType.md +8 -8
  165. package/docs/api/interfaces/RoleBasedRouterProps.md +10 -10
  166. package/docs/api/interfaces/RoleManagementResult.md +1 -1
  167. package/docs/api/interfaces/RouteAccessRecord.md +10 -10
  168. package/docs/api/interfaces/RouteConfig.md +10 -10
  169. package/docs/api/interfaces/SecureDataContextType.md +9 -9
  170. package/docs/api/interfaces/SecureDataProviderProps.md +8 -8
  171. package/docs/api/interfaces/SessionRestorationLoaderProps.md +21 -0
  172. package/docs/api/interfaces/StorageConfig.md +1 -1
  173. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  174. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  175. package/docs/api/interfaces/StorageListOptions.md +1 -1
  176. package/docs/api/interfaces/StorageListResult.md +1 -1
  177. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  178. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  179. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  180. package/docs/api/interfaces/StyleImport.md +1 -1
  181. package/docs/api/interfaces/SwitchProps.md +1 -1
  182. package/docs/api/interfaces/ToastActionElement.md +1 -1
  183. package/docs/api/interfaces/ToastProps.md +1 -1
  184. package/docs/api/interfaces/UnifiedAuthContextType.md +53 -53
  185. package/docs/api/interfaces/UnifiedAuthProviderProps.md +13 -13
  186. package/docs/api/interfaces/UseInactivityTrackerOptions.md +9 -9
  187. package/docs/api/interfaces/UseInactivityTrackerReturn.md +8 -8
  188. package/docs/api/interfaces/UsePublicEventOptions.md +3 -3
  189. package/docs/api/interfaces/UsePublicEventReturn.md +5 -5
  190. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +4 -4
  191. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +9 -9
  192. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  193. package/docs/api/interfaces/UseResolvedScopeOptions.md +4 -4
  194. package/docs/api/interfaces/UseResolvedScopeReturn.md +4 -4
  195. package/docs/api/interfaces/UserEventAccess.md +11 -11
  196. package/docs/api/interfaces/UserMenuProps.md +1 -1
  197. package/docs/api/interfaces/UserProfile.md +1 -1
  198. package/docs/api/modules.md +648 -212
  199. package/docs/api-reference/components.md +106 -26
  200. package/docs/architecture/README.md +0 -2
  201. package/docs/implementation-guides/data-tables.md +277 -13
  202. package/docs/implementation-guides/forms.md +1 -16
  203. package/docs/implementation-guides/permission-enforcement.md +8 -2
  204. package/examples/README.md +30 -14
  205. package/examples/STRUCTURE.md +125 -0
  206. package/examples/components/DataTable/HierarchicalActionsExample.tsx +421 -0
  207. package/examples/components/DataTable/HierarchicalExample.tsx +475 -0
  208. package/examples/components/DataTable/InitialPageSizeExample.tsx +177 -0
  209. package/examples/components/DataTable/PerformanceExample.tsx +506 -0
  210. package/examples/components/DataTable/index.ts +13 -0
  211. package/examples/components/Dialog/BasicHtmlTest.tsx +55 -0
  212. package/examples/components/Dialog/DebugHtmlExample.tsx +68 -0
  213. package/examples/components/Dialog/HtmlDialogExample.tsx +202 -0
  214. package/examples/components/Dialog/ScrollableDialogExample.tsx +290 -0
  215. package/examples/components/Dialog/SimpleHtmlTest.tsx +61 -0
  216. package/examples/components/Dialog/SmartDialogExample.tsx +322 -0
  217. package/examples/components/Dialog/index.ts +15 -0
  218. package/examples/components/index.ts +11 -0
  219. package/examples/features/index.ts +12 -0
  220. package/examples/{public-pages → features/public-pages}/CorrectPublicPageImplementation.tsx +1 -1
  221. package/examples/{public-pages → features/public-pages}/PublicEventPage.tsx +1 -1
  222. package/examples/{public-pages → features/public-pages}/PublicPageApp.tsx +1 -1
  223. package/examples/{public-pages → features/public-pages}/PublicPageUsageExample.tsx +1 -1
  224. package/examples/index.ts +11 -3
  225. package/package.json +30 -10
  226. package/src/components/Alert/Alert.tsx +1 -1
  227. package/src/components/Avatar/Avatar.tsx +1 -1
  228. package/src/components/Button/Button.tsx +1 -1
  229. package/src/components/Card/Card.tsx +1 -1
  230. package/src/components/Checkbox/Checkbox.tsx +1 -1
  231. package/src/components/DataTable/DataTable.test.tsx +1 -1
  232. package/src/components/DataTable/DataTable.tsx +1 -30
  233. package/src/components/DataTable/__tests__/DataTable.grouping-aggregation.test.tsx +562 -0
  234. package/src/components/DataTable/__tests__/styles.test.ts +2 -2
  235. package/src/components/DataTable/components/ActionButtons.tsx +0 -15
  236. package/src/components/DataTable/components/DataTableCore.tsx +4 -185
  237. package/src/components/DataTable/components/DataTableErrorBoundary.tsx +1 -1
  238. package/src/components/DataTable/components/DataTableModals.tsx +1 -27
  239. package/src/components/DataTable/components/EditableRow.tsx +1 -1
  240. package/src/components/DataTable/components/ImportModal.tsx +2 -14
  241. package/src/components/DataTable/components/PaginationControls.tsx +1 -1
  242. package/src/components/DataTable/components/UnifiedTableBody.tsx +109 -82
  243. package/src/components/DataTable/components/__tests__/ActionButtons.test.tsx +1 -1
  244. package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.test.tsx +1 -1
  245. package/src/components/DataTable/components/__tests__/DataTableModals.test.tsx +1 -1
  246. package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +1 -1
  247. package/src/components/DataTable/examples/GroupingAggregationExample.tsx +273 -0
  248. package/src/components/DataTable/examples/HierarchicalActionsExample.tsx +1 -1
  249. package/src/components/DataTable/examples/__tests__/HierarchicalActionsExample.test.tsx +1 -1
  250. package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +1 -1
  251. package/src/components/DataTable/hooks/useColumnVisibilityPersistence.ts +1 -1
  252. package/src/components/DataTable/hooks/useDataTablePermissions.ts +2 -23
  253. package/src/components/DataTable/index.ts +4 -0
  254. package/src/components/DataTable/styles.ts +1 -1
  255. package/src/components/DataTable/types.ts +13 -0
  256. package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +1 -1
  257. package/src/components/DataTable/utils/aggregationUtils.ts +161 -0
  258. package/src/components/DataTable/utils/exportUtils.ts +1 -1
  259. package/src/components/DataTable/utils/flexibleImport.ts +1 -11
  260. package/src/components/DataTable/utils/index.ts +1 -0
  261. package/src/components/DataTable/utils/paginationUtils.ts +1 -1
  262. package/src/components/Dialog/Dialog.tsx +2 -2
  263. package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +35 -7
  264. package/src/components/ErrorBoundary/ErrorBoundary.tsx +5 -4
  265. package/src/components/EventSelector/EventSelector.tsx +3 -2
  266. package/src/components/FileDisplay/FileDisplay.tsx +2 -36
  267. package/src/components/FileUpload/FileUpload.test.tsx +2 -2
  268. package/src/components/FileUpload/FileUpload.tsx +2 -2
  269. package/src/components/Footer/Footer.tsx +1 -1
  270. package/src/components/Form/Form.test.tsx +4 -509
  271. package/src/components/Form/Form.tsx +1 -1
  272. package/src/components/Form/FormField.tsx +1 -1
  273. package/src/components/Form/index.ts +0 -12
  274. package/src/components/Header/Header.tsx +1 -1
  275. package/src/components/Input/Input.tsx +1 -1
  276. package/src/components/Label/Label.tsx +1 -1
  277. package/src/components/LoginForm/LoginForm.tsx +1 -1
  278. package/src/components/NavigationMenu/NavigationMenu.test.tsx +19 -3
  279. package/src/components/NavigationMenu/NavigationMenu.tsx +9 -8
  280. package/src/components/OrganisationSelector/OrganisationSelector.tsx +4 -3
  281. package/src/components/PaceAppLayout/PaceAppLayout.tsx +14 -12
  282. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +0 -16
  283. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +0 -1
  284. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +0 -9
  285. package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +35 -3
  286. package/src/components/PaceLoginPage/PaceLoginPage.tsx +13 -12
  287. package/src/components/PasswordReset/PasswordChangeForm.tsx +1 -1
  288. package/src/components/PasswordReset/index.ts +0 -2
  289. package/src/components/Progress/Progress.tsx +1 -1
  290. package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +35 -8
  291. package/src/components/ProtectedRoute/ProtectedRoute.tsx +3 -2
  292. package/src/components/PublicLayout/PublicErrorBoundary.tsx +1 -1
  293. package/src/components/PublicLayout/PublicLoadingSpinner.tsx +1 -1
  294. package/src/components/PublicLayout/PublicPageContextChecker.tsx +44 -43
  295. package/src/components/PublicLayout/PublicPageFooter.tsx +1 -1
  296. package/src/components/PublicLayout/PublicPageHeader.tsx +1 -15
  297. package/src/components/PublicLayout/PublicPageProvider.tsx +3 -2
  298. package/src/components/PublicLayout/__tests__/PublicPageContextChecker.test.tsx +2 -0
  299. package/src/components/PublicLayout/index.ts +4 -2
  300. package/src/components/Select/Select.tsx +1 -1
  301. package/src/components/{SessionRestorationLoader.tsx → SessionRestorationLoader/SessionRestorationLoader.tsx} +3 -2
  302. package/src/components/SessionRestorationLoader/index.ts +3 -0
  303. package/src/components/Switch/Switch.tsx +1 -1
  304. package/src/components/Table/Table.tsx +1 -1
  305. package/src/components/Toast/Toast.tsx +1 -1
  306. package/src/components/Tooltip/Tooltip.tsx +1 -1
  307. package/src/components/index.ts +4 -10
  308. package/src/hooks/__tests__/hooks.integration.test.tsx +37 -22
  309. package/src/hooks/__tests__/useComponentPerformance.unit.test.tsx +33 -17
  310. package/src/hooks/__tests__/useDataTablePerformance.unit.test.ts +28 -3
  311. package/src/hooks/__tests__/useFileDisplay.unit.test.ts +36 -9
  312. package/src/hooks/__tests__/useInactivityTracker.unit.test.ts +26 -2
  313. package/src/hooks/__tests__/usePerformanceMonitor.unit.test.ts +19 -6
  314. package/src/hooks/__tests__/usePermissionCache.simple.test.ts +17 -4
  315. package/src/hooks/__tests__/usePermissionCache.unit.test.ts +17 -4
  316. package/src/hooks/__tests__/usePublicEvent.simple.test.ts +26 -6
  317. package/src/hooks/__tests__/usePublicFileDisplay.test.ts +16 -6
  318. package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +3 -3
  319. package/src/hooks/__tests__/useSessionRestoration.unit.test.tsx +17 -3
  320. package/src/hooks/public/usePublicEvent.ts +7 -6
  321. package/src/hooks/public/usePublicEventLogo.ts +7 -4
  322. package/src/hooks/public/usePublicFileDisplay.ts +6 -150
  323. package/src/hooks/useComponentPerformance.ts +4 -1
  324. package/src/hooks/useDataTablePerformance.ts +4 -3
  325. package/src/hooks/useEventTheme.test.ts +18 -5
  326. package/src/hooks/useEventTheme.ts +4 -1
  327. package/src/hooks/useEvents.ts +2 -0
  328. package/src/hooks/useFileDisplay.ts +9 -8
  329. package/src/hooks/useFileReference.ts +4 -1
  330. package/src/hooks/useFileUrl.ts +4 -1
  331. package/src/hooks/useInactivityTracker.ts +5 -4
  332. package/src/hooks/useOrganisationSecurity.test.ts +33 -12
  333. package/src/hooks/useOrganisationSecurity.ts +8 -7
  334. package/src/hooks/usePerformanceMonitor.ts +6 -3
  335. package/src/hooks/usePermissionCache.ts +13 -6
  336. package/src/hooks/useSecureDataAccess.test.ts +2 -2
  337. package/src/hooks/useSecureDataAccess.ts +9 -8
  338. package/src/hooks/useSessionRestoration.ts +4 -1
  339. package/src/hooks/useStorage.ts +4 -1
  340. package/src/index.ts +25 -8
  341. package/src/providers/services/AuthServiceProvider.tsx +3 -2
  342. package/src/providers/services/EventServiceProvider.tsx +2 -1
  343. package/src/providers/services/InactivityServiceProvider.tsx +2 -1
  344. package/src/providers/services/OrganisationServiceProvider.tsx +2 -1
  345. package/src/providers/services/UnifiedAuthProvider.tsx +4 -3
  346. package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +22 -2
  347. package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +24 -2
  348. package/src/rbac/__tests__/cache-invalidation.test.ts +20 -6
  349. package/src/rbac/api.ts +5 -2
  350. package/src/rbac/audit-enhanced.ts +6 -6
  351. package/src/rbac/audit.test.ts +60 -38
  352. package/src/rbac/audit.ts +8 -8
  353. package/src/rbac/cache-invalidation.ts +7 -4
  354. package/src/rbac/components/EnhancedNavigationMenu.tsx +11 -5
  355. package/src/rbac/components/NavigationGuard.tsx +7 -3
  356. package/src/rbac/components/NavigationProvider.tsx +6 -3
  357. package/src/rbac/components/PagePermissionGuard.tsx +28 -16
  358. package/src/rbac/components/PagePermissionProvider.tsx +4 -1
  359. package/src/rbac/components/PermissionEnforcer.tsx +9 -3
  360. package/src/rbac/components/RoleBasedRouter.tsx +3 -1
  361. package/src/rbac/components/SecureDataProvider.tsx +7 -3
  362. package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +87 -61
  363. package/src/rbac/components/__tests__/NavigationGuard.test.tsx +83 -33
  364. package/src/rbac/components/__tests__/NavigationProvider.test.tsx +36 -13
  365. package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +2 -2
  366. package/src/rbac/components/__tests__/PagePermissionProvider.test.tsx +22 -8
  367. package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +19 -6
  368. package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +43 -17
  369. package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +42 -17
  370. package/src/rbac/engine.ts +15 -7
  371. package/src/rbac/hooks/usePermissions.ts +7 -3
  372. package/src/rbac/hooks/useResolvedScope.test.ts +2 -2
  373. package/src/rbac/hooks/useResolvedScope.ts +10 -7
  374. package/src/rbac/permissions.ts +5 -2
  375. package/src/rbac/security.test.ts +27 -16
  376. package/src/rbac/security.ts +5 -4
  377. package/src/services/AuthService.ts +22 -21
  378. package/src/services/EventService.ts +12 -12
  379. package/src/services/InactivityService.ts +5 -4
  380. package/src/services/OrganisationService.ts +26 -25
  381. package/src/services/__tests__/AuthService.test.ts +51 -19
  382. package/src/services/__tests__/EventService.test.ts +37 -5
  383. package/src/services/__tests__/InactivityService.test.ts +38 -4
  384. package/src/services/__tests__/OrganisationService.test.ts +3 -8
  385. package/src/services/base/BaseService.ts +3 -1
  386. package/src/theming/__tests__/runtime.test.ts +21 -12
  387. package/src/theming/parseEventColours.ts +5 -19
  388. package/src/theming/runtime.ts +8 -4
  389. package/src/types/validation.ts +2 -29
  390. package/src/utils/__tests__/appConfig.unit.test.ts +1 -1
  391. package/src/utils/__tests__/audit.unit.test.ts +1 -1
  392. package/src/utils/__tests__/auth-utils.unit.test.ts +1 -1
  393. package/src/utils/__tests__/bundleAnalysis.unit.test.ts +19 -19
  394. package/src/utils/__tests__/cn.unit.test.ts +1 -1
  395. package/src/utils/__tests__/debugLogger.test.ts +1 -1
  396. package/src/utils/__tests__/deviceFingerprint.unit.test.ts +1 -1
  397. package/src/utils/__tests__/dynamicUtils.unit.test.ts +1 -1
  398. package/src/utils/__tests__/formatting.unit.test.ts +1 -1
  399. package/src/utils/__tests__/lazyLoad.unit.test.tsx +1 -1
  400. package/src/utils/__tests__/logger.unit.test.ts +1 -1
  401. package/src/utils/__tests__/organisationContext.unit.test.ts +1 -1
  402. package/src/utils/__tests__/performanceBenchmark.test.ts +1 -1
  403. package/src/utils/__tests__/performanceBudgets.unit.test.ts +1 -1
  404. package/src/utils/__tests__/permissionTypes.unit.test.ts +1 -1
  405. package/src/utils/__tests__/permissionUtils.unit.test.ts +1 -1
  406. package/src/utils/__tests__/sanitization.unit.test.ts +1 -1
  407. package/src/utils/__tests__/schemaUtils.unit.test.ts +1 -1
  408. package/src/utils/__tests__/secureDataAccess.unit.test.ts +1 -1
  409. package/src/utils/__tests__/secureErrors.unit.test.ts +33 -15
  410. package/src/utils/__tests__/secureStorage.unit.test.ts +1 -1
  411. package/src/utils/__tests__/security.unit.test.ts +40 -18
  412. package/src/utils/__tests__/securityMonitor.unit.test.ts +1 -1
  413. package/src/utils/__tests__/sessionTracking.unit.test.ts +40 -29
  414. package/src/utils/__tests__/validationUtils.unit.test.ts +19 -6
  415. package/src/utils/{appIdResolver.test.ts → app/appIdResolver.test.ts} +28 -30
  416. package/src/utils/{appIdResolver.ts → app/appIdResolver.ts} +8 -5
  417. package/src/utils/{appNameResolver.test.ts → app/appNameResolver.test.ts} +1 -1
  418. package/src/utils/{appNameResolver.ts → app/appNameResolver.ts} +5 -1
  419. package/src/utils/{organisationContext.ts → context/organisationContext.ts} +6 -3
  420. package/src/utils/{sessionTracking.ts → context/sessionTracking.ts} +11 -12
  421. package/src/utils/{logger.ts → core/logger.ts} +4 -2
  422. package/src/utils/{deviceFingerprint.ts → device/deviceFingerprint.ts} +1 -1
  423. package/src/utils/{lazyLoad.tsx → dynamic/lazyLoad.tsx} +2 -2
  424. package/src/utils/{file-reference.test.ts → file-reference/__tests__/file-reference.test.ts} +5 -5
  425. package/src/utils/{file-reference.ts → file-reference/index.ts} +20 -38
  426. package/src/utils/index.ts +32 -54
  427. package/src/utils/{secureErrors.ts → security/secureErrors.ts} +6 -3
  428. package/src/utils/{security.ts → security/security.ts} +5 -2
  429. package/src/utils/storage/__tests__/helpers.unit.test.ts +1 -4
  430. package/src/utils/storage/helpers.ts +15 -8
  431. package/src/{components/Dialog/utils/__tests__/safeHtml.unit.test.ts → utils/validation/__tests__/htmlSanitization.unit.test.ts} +9 -15
  432. package/src/{validation → utils/validation}/csrf.ts +1 -1
  433. package/src/{components/Dialog/utils/safeHtml.ts → utils/validation/htmlSanitization.ts} +9 -10
  434. package/src/utils/validation/index.ts +79 -0
  435. package/src/utils/{sanitization.ts → validation/sanitization.ts} +71 -2
  436. package/src/{validation/schemaUtils.ts → utils/validation/schema.ts} +11 -6
  437. package/src/{validation → utils/validation}/sqlInjectionProtection.ts +2 -0
  438. package/src/utils/{validationUtils.ts → validation/validationUtils.ts} +4 -1
  439. package/src/validation/index.ts +3 -34
  440. package/dist/UnifiedAuthProvider-CQDZRJIS.js +0 -16
  441. package/dist/chunk-24MKLB7U.js +0 -81
  442. package/dist/chunk-24MKLB7U.js.map +0 -1
  443. package/dist/chunk-3CG5L6RN.js.map +0 -1
  444. package/dist/chunk-3DBFLLLU.js.map +0 -1
  445. package/dist/chunk-5F3NDPJV.js.map +0 -1
  446. package/dist/chunk-66C4BSAY.js.map +0 -1
  447. package/dist/chunk-BDZUMRBD.js.map +0 -1
  448. package/dist/chunk-BYXRHAIF.js.map +0 -1
  449. package/dist/chunk-CDQ3PX7L.js +0 -18
  450. package/dist/chunk-CDQ3PX7L.js.map +0 -1
  451. package/dist/chunk-CQZU6TFE.js.map +0 -1
  452. package/dist/chunk-F64FFPOZ.js.map +0 -1
  453. package/dist/chunk-GEVIB2UB.js.map +0 -1
  454. package/dist/chunk-GKHF54DI.js.map +0 -1
  455. package/dist/chunk-GVDR7WNV.js.map +0 -1
  456. package/dist/chunk-HMNOSGVA.js.map +0 -1
  457. package/dist/chunk-JCQZ6LA7.js.map +0 -1
  458. package/dist/chunk-M6DDYFUD.js.map +0 -1
  459. package/dist/chunk-O3NWNXDY.js.map +0 -1
  460. package/dist/chunk-PYUXFQJ3.js.map +0 -1
  461. package/dist/chunk-UJI6WSMD.js.map +0 -1
  462. package/dist/chunk-VZ5OR6HD.js.map +0 -1
  463. package/dist/chunk-WP5I5GLN.js.map +0 -1
  464. package/dist/chunk-ZYZCRSBD.js.map +0 -1
  465. package/src/components/Dialog/README.md +0 -804
  466. package/src/components/Form/FormErrorSummary.tsx +0 -113
  467. package/src/components/Form/FormFieldset.tsx +0 -127
  468. package/src/components/Form/FormLiveRegion.tsx +0 -198
  469. package/src/components/PasswordReset/PasswordResetForm.test.tsx +0 -597
  470. package/src/components/PasswordReset/PasswordResetForm.tsx +0 -201
  471. package/src/components/PublicLayout/PublicPageDebugger.tsx +0 -104
  472. package/src/components/PublicLayout/PublicPageDiagnostic.tsx +0 -162
  473. package/src/components/PublicLayout/__tests__/PublicPageDebugger.test.tsx +0 -185
  474. package/src/examples/CorrectPublicPageImplementation.tsx +0 -304
  475. package/src/examples/PublicEventPage.tsx +0 -287
  476. package/src/examples/PublicPageApp.tsx +0 -321
  477. package/src/examples/PublicPageUsageExample.tsx +0 -218
  478. package/src/utils/schemaUtils.ts +0 -37
  479. package/src/validation/__tests__/common.unit.test.ts +0 -101
  480. package/src/validation/__tests__/csrf.unit.test.ts +0 -365
  481. package/src/validation/__tests__/passwordSchema.unit.test.ts +0 -203
  482. package/src/validation/__tests__/sanitization.unit.test.ts +0 -250
  483. package/src/validation/__tests__/schemaUtils.unit.test.ts +0 -451
  484. package/src/validation/__tests__/sqlInjectionProtection.unit.test.ts +0 -462
  485. package/src/validation/__tests__/user.unit.test.ts +0 -440
  486. package/src/validation/sanitization.ts +0 -96
  487. /package/dist/{DataTable-A36PJG6N.js.map → DataTable-CYOHOX3O.js.map} +0 -0
  488. /package/dist/{UnifiedAuthProvider-CQDZRJIS.js.map → UnifiedAuthProvider-5E5TUNMS.js.map} +0 -0
  489. /package/dist/{api-TNIBJWLM.js.map → api-45XYYO2A.js.map} +0 -0
  490. /package/dist/{audit-T36HM7IM.js.map → audit-64X3VJXB.js.map} +0 -0
  491. /package/dist/{chunk-CTJRBUX2.js.map → chunk-2TWNJ46Y.js.map} +0 -0
  492. /package/dist/{chunk-ZV77RZMU.js.map → chunk-XARJS7CD.js.map} +0 -0
  493. /package/dist/{useInactivityTracker-MRUU55XI.js.map → useInactivityTracker-TO6ZOF35.js.map} +0 -0
  494. /package/examples/{public-pages → features/public-pages}/index.ts +0 -0
  495. /package/examples/{RBAC → features/rbac}/CompleteRBACExample.tsx +0 -0
  496. /package/examples/{RBAC → features/rbac}/EventBasedApp.tsx +0 -0
  497. /package/examples/{RBAC → features/rbac}/PermissionExample.tsx +0 -0
  498. /package/examples/{RBAC → features/rbac}/index.ts +0 -0
  499. /package/src/utils/{appConfig.ts → app/appConfig.ts} +0 -0
  500. /package/src/utils/{appNameResolver.simple.test.ts → app/appNameResolver.simple.test.ts} +0 -0
  501. /package/src/utils/{audit.ts → audit/audit.ts} +0 -0
  502. /package/src/utils/{organisationContext.test.ts → context/organisationContext.test.ts} +0 -0
  503. /package/src/utils/{cn.ts → core/cn.ts} +0 -0
  504. /package/src/utils/{debugLogger.ts → core/debugLogger.ts} +0 -0
  505. /package/src/utils/{dynamicUtils.ts → dynamic/dynamicUtils.ts} +0 -0
  506. /package/src/utils/{formatDate.test.ts → formatting/formatDate.test.ts} +0 -0
  507. /package/src/utils/{formatting.ts → formatting/formatting.ts} +0 -0
  508. /package/src/utils/{bundleAnalysis.ts → performance/bundleAnalysis.ts} +0 -0
  509. /package/src/utils/{performanceBenchmark.ts → performance/performanceBenchmark.ts} +0 -0
  510. /package/src/utils/{performanceBudgets.ts → performance/performanceBudgets.ts} +0 -0
  511. /package/src/utils/{permissionTypes.ts → permissions/permissionTypes.ts} +0 -0
  512. /package/src/utils/{permissionUtils.test.ts → permissions/permissionUtils.test.ts} +0 -0
  513. /package/src/utils/{permissionUtils.ts → permissions/permissionUtils.ts} +0 -0
  514. /package/src/utils/{auth-utils.ts → security/auth-utils.ts} +0 -0
  515. /package/src/utils/{secureDataAccess.test.ts → security/secureDataAccess.test.ts} +0 -0
  516. /package/src/utils/{secureDataAccess.ts → security/secureDataAccess.ts} +0 -0
  517. /package/src/utils/{secureStorage.ts → security/secureStorage.ts} +0 -0
  518. /package/src/utils/{securityMonitor.ts → security/securityMonitor.ts} +0 -0
  519. /package/src/{validation → utils/validation}/common.ts +0 -0
  520. /package/src/{validation → utils/validation}/passwordSchema.ts +0 -0
  521. /package/src/{validation → utils/validation}/user.ts +0 -0
  522. /package/src/utils/{validation.ts → validation/validation.ts} +0 -0
package/dist/utils.js CHANGED
@@ -7,45 +7,116 @@ import {
7
7
  formatPercent,
8
8
  getAppConfig,
9
9
  getCurrentAppId,
10
- getCurrentAppName,
11
10
  setAppConfig,
12
11
  useSessionTracking
13
- } from "./chunk-M6DDYFUD.js";
12
+ } from "./chunk-LS353YLY.js";
14
13
  import {
15
- LoadingSpinner
16
- } from "./chunk-CDQ3PX7L.js";
14
+ CachedAppIdResolver,
15
+ LoadingSpinner,
16
+ cachedAppIdResolver,
17
+ getAppId,
18
+ getAppIds
19
+ } from "./chunk-S5OFRT4M.js";
17
20
  import {
18
21
  getAppNameFromBuildTime,
19
22
  getAppNameFromEnvironment,
20
23
  getAppNameFromGlobal,
21
24
  getAppNameFromPackageJson,
25
+ getCurrentAppName,
22
26
  getCurrentAppNameWithFallback,
23
27
  setRBACAppName
24
- } from "./chunk-JCQZ6LA7.js";
28
+ } from "./chunk-Q5QRDWKI.js";
29
+ import {
30
+ buildSafeQueryParams,
31
+ calculatePasswordStrength,
32
+ csrfManager,
33
+ dateSchema,
34
+ deepMerge,
35
+ detectSQLInjection,
36
+ emailSchema,
37
+ emailSchema2,
38
+ escapeLikeQuery,
39
+ generateCSRFToken,
40
+ getCSRFToken,
41
+ isEmpty,
42
+ isObject,
43
+ isStrongPassword,
44
+ isValidDate,
45
+ isValidEmail,
46
+ isValidUrl,
47
+ isWithinRange,
48
+ limitOffsetSchema,
49
+ matchesPattern,
50
+ nameSchema,
51
+ nameSchema2,
52
+ orderBySchema,
53
+ passwordSchema,
54
+ passwordSchema2,
55
+ phoneSchema,
56
+ phoneSchema2,
57
+ sanitizeFilters,
58
+ sanitizeFormData,
59
+ sanitizeSearchQuery,
60
+ sanitizeUserInput,
61
+ sanitizeUserInput_deprecated,
62
+ searchQuerySchema,
63
+ sqlIdentifierSchema,
64
+ urlSchema,
65
+ urlSchema2,
66
+ userPreferencesSchema,
67
+ userSettingsSchema,
68
+ usernameSchema,
69
+ validateCSRFToken,
70
+ validateUserInput
71
+ } from "./chunk-APIBCTL2.js";
72
+ import {
73
+ renderSafeHtml,
74
+ sanitizeHtml,
75
+ validateHtml
76
+ } from "./chunk-5DPZ5EAT.js";
25
77
  import {
26
78
  useComponentPerformance
27
- } from "./chunk-66C4BSAY.js";
79
+ } from "./chunk-ANBQRTPX.js";
28
80
  import {
29
81
  PERFORMANCE_BUDGETS,
30
82
  performanceBudgetMonitor
31
- } from "./chunk-O3NWNXDY.js";
83
+ } from "./chunk-FMUCXFII.js";
32
84
  import {
33
85
  cn
34
- } from "./chunk-PYUXFQJ3.js";
86
+ } from "./chunk-56XJ3TU6.js";
35
87
  import {
36
88
  clearOrganisationContext,
37
89
  getOrganisationContext,
38
90
  init_organisationContext,
39
91
  isOrganisationContextAvailable,
40
92
  setOrganisationContext
41
- } from "./chunk-BDZUMRBD.js";
93
+ } from "./chunk-K2WWTH7O.js";
42
94
  import {
43
95
  init_secureStorage,
44
96
  secureStorage
45
- } from "./chunk-UJI6WSMD.js";
97
+ } from "./chunk-444EZN6N.js";
98
+ import {
99
+ changePasswordSchema,
100
+ combineSchemas,
101
+ contactFormSchema,
102
+ loginSchema,
103
+ passwordResetSchema,
104
+ pickSchema,
105
+ registrationSchema,
106
+ secureLoginSchema,
107
+ securePasswordSchema,
108
+ userProfileSchema
109
+ } from "./chunk-LMC26NLJ.js";
110
+ import {
111
+ LogLevel,
112
+ Logger,
113
+ createLogger,
114
+ init_logger,
115
+ logger
116
+ } from "./chunk-XDNLUEXI.js";
46
117
  import "./chunk-PLDDJCW6.js";
47
118
 
48
- // src/utils/debugLogger.ts
119
+ // src/utils/core/debugLogger.ts
49
120
  var DebugLogger = class {
50
121
  /**
51
122
  * Check if we're in development mode
@@ -95,261 +166,14 @@ var DebugLogger = class {
95
166
  }
96
167
  };
97
168
 
98
- // src/utils/validation.ts
99
- function isValidEmail(email) {
100
- const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
101
- return emailPattern.test(email);
102
- }
103
- function isEmpty(value) {
104
- return value === null || value === void 0 || value.trim() === "";
105
- }
106
- function isStrongPassword(password) {
107
- const passwordPattern = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/;
108
- return passwordPattern.test(password);
109
- }
110
- function isValidUrl(url) {
111
- try {
112
- new URL(url);
113
- return true;
114
- } catch {
115
- return false;
116
- }
117
- }
118
- function isValidDate(dateStr) {
119
- const date = new Date(dateStr);
120
- return !isNaN(date.getTime());
121
- }
122
- function isWithinRange(value, min, max) {
123
- return value >= min && value <= max;
124
- }
125
- function matchesPattern(value, pattern) {
126
- return pattern.test(value);
127
- }
128
- function deepMerge(target, source) {
129
- const output = { ...target };
130
- if (isObject(target) && isObject(source)) {
131
- Object.keys(source).forEach((key) => {
132
- if (isObject(source[key])) {
133
- if (!(key in target)) {
134
- Object.assign(output, { [key]: source[key] });
135
- } else {
136
- const targetKey = key;
137
- const targetValue = target[targetKey];
138
- if (isObject(targetValue)) {
139
- output[targetKey] = deepMerge(
140
- targetValue,
141
- source[key]
142
- );
143
- }
144
- }
145
- } else {
146
- Object.assign(output, { [key]: source[key] });
147
- }
148
- });
149
- }
150
- return output;
151
- }
152
- function isObject(item) {
153
- return item !== null && typeof item === "object" && !Array.isArray(item);
154
- }
155
-
156
- // src/utils/validationUtils.ts
157
- import { z as z2 } from "zod";
158
-
159
- // src/utils/sanitization.ts
160
- import { z } from "zod";
161
- var DEFAULT_OPTIONS = {
162
- allowHtml: false,
163
- allowedTags: [],
164
- maxLength: 1e3,
165
- trim: true,
166
- removeScripts: true,
167
- removeEvents: true
168
- };
169
- function sanitizeUserInput(input, options = {}) {
170
- if (typeof input !== "string") {
171
- return "";
172
- }
173
- const opts = { ...DEFAULT_OPTIONS, ...options };
174
- let sanitized = input;
175
- if (opts.trim) {
176
- sanitized = sanitized.trim();
177
- }
178
- if (opts.maxLength && sanitized.length > opts.maxLength) {
179
- sanitized = sanitized.substring(0, opts.maxLength);
180
- }
181
- if (!opts.allowHtml) {
182
- sanitized = sanitized.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;").replace(/\//g, "&#x2F;");
183
- } else if (opts.allowedTags && opts.allowedTags.length > 0) {
184
- const allowedTagsRegex = new RegExp(`<(?!/?(?:${opts.allowedTags.join("|")})s*/?>)[^>]+>`, "gi");
185
- sanitized = sanitized.replace(allowedTagsRegex, "");
186
- }
187
- if (opts.removeScripts) {
188
- sanitized = sanitized.replace(/<script[^>]*>.*?<\/script>/gi, "").replace(/javascript:/gi, "").replace(/vbscript:/gi, "").replace(/data:/gi, "");
189
- }
190
- if (opts.removeEvents) {
191
- sanitized = sanitized.replace(/on\w+\s*=/gi, "");
192
- }
193
- return sanitized;
194
- }
195
- function sanitizeEmail(email) {
196
- if (typeof email !== "string") {
197
- return "";
198
- }
199
- return email.trim().toLowerCase().replace(/[^\w@.-]/g, "");
200
- }
201
- function sanitizePhoneNumber(phone) {
202
- if (typeof phone !== "string") {
203
- return "";
204
- }
205
- return phone.replace(/[^\d+\-\s()]/g, "").trim();
206
- }
207
- function sanitizeUrl(url) {
208
- if (typeof url !== "string") {
209
- return "";
210
- }
211
- const sanitized = url.trim();
212
- if (!/^https?:\/\/|^ftp:\/\//i.test(sanitized)) {
213
- return "";
214
- }
215
- if (/javascript:|data:|vbscript:/i.test(sanitized)) {
216
- return "";
217
- }
218
- return sanitized;
219
- }
220
- function sanitizeFileName(fileName) {
221
- if (typeof fileName !== "string") {
222
- return "";
223
- }
224
- return fileName.trim().replace(/[<>:"/\\|?*]/g, "").replace(/\.\./g, "").substring(0, 255);
225
- }
226
- function sanitizeSqlInput(input) {
227
- if (typeof input !== "string") {
228
- return "";
229
- }
230
- return input.replace(/['";\\]/g, "").replace(/--.*$/gm, "").replace(/\/\*.*?\*\//g, "").trim();
231
- }
232
- function sanitizeFormData(data, schema, sanitizationRules) {
233
- try {
234
- if (sanitizationRules && typeof data === "object" && data !== null) {
235
- const sanitizedData = { ...data };
236
- Object.entries(sanitizationRules).forEach(([field, options]) => {
237
- if (typeof sanitizedData[field] === "string") {
238
- sanitizedData[field] = sanitizeUserInput(sanitizedData[field], options);
239
- }
240
- });
241
- data = sanitizedData;
242
- }
243
- const result = schema.parse(data);
244
- return { success: true, data: result };
245
- } catch (error) {
246
- if (error instanceof z.ZodError) {
247
- return {
248
- success: false,
249
- error: error.errors.map((e) => e.message).join(", ")
250
- };
251
- }
252
- return {
253
- success: false,
254
- error: "Validation failed"
255
- };
256
- }
257
- }
258
- var CSP_DIRECTIVES = {
259
- default: "default-src 'self'",
260
- script: "script-src 'self' 'unsafe-inline'",
261
- style: "style-src 'self' 'unsafe-inline'",
262
- img: "img-src 'self' data: https:",
263
- font: "font-src 'self'",
264
- connect: "connect-src 'self'",
265
- frame: "frame-src 'none'"
266
- };
267
- function generateCSPHeader(customDirectives) {
268
- const directives = { ...CSP_DIRECTIVES, ...customDirectives };
269
- return Object.values(directives).join("; ");
270
- }
271
- var RateLimiter = class {
272
- constructor(maxAttempts = 5, windowMs = 15 * 60 * 1e3) {
273
- this.maxAttempts = maxAttempts;
274
- this.windowMs = windowMs;
275
- this.attempts = /* @__PURE__ */ new Map();
276
- }
277
- isAllowed(identifier) {
278
- const now = Date.now();
279
- const record = this.attempts.get(identifier);
280
- if (!record || now > record.resetTime) {
281
- this.attempts.set(identifier, { count: 1, resetTime: now + this.windowMs });
282
- return true;
283
- }
284
- if (record.count >= this.maxAttempts) {
285
- return false;
286
- }
287
- record.count++;
288
- return true;
289
- }
290
- getRemainingAttempts(identifier) {
291
- const record = this.attempts.get(identifier);
292
- if (!record || Date.now() > record.resetTime) {
293
- return this.maxAttempts;
294
- }
295
- return Math.max(0, this.maxAttempts - record.count);
296
- }
297
- reset(identifier) {
298
- this.attempts.delete(identifier);
299
- }
300
- };
301
-
302
- // src/utils/validationUtils.ts
303
- function validateUserInput(schema, data, sanitizationRules) {
304
- return sanitizeFormData(data, schema, sanitizationRules);
305
- }
306
- function sanitizeUserInput_deprecated(input) {
307
- console.warn("sanitizeUserInput is deprecated. Use sanitizeUserInput from lib/sanitization instead.");
308
- return sanitizeUserInput(input);
309
- }
310
- var emailSchema = z2.string().transform((email) => email.toLowerCase().trim()).pipe(z2.string().min(1, "Email is required").email("Invalid email format").max(254, "Email too long"));
311
- var passwordSchema = z2.string().min(8, "Password must be at least 8 characters").max(128, "Password too long").regex(/[A-Z]/, "Password must contain at least one uppercase letter").regex(/[a-z]/, "Password must contain at least one lowercase letter").regex(/[0-9]/, "Password must contain at least one number").regex(/[^A-Za-z0-9]/, "Password must contain at least one special character");
312
- var usernameSchema = z2.string().transform((username) => username.toLowerCase().trim()).pipe(z2.string().min(3, "Username must be at least 3 characters").max(30, "Username too long").regex(/^[a-zA-Z0-9_-]+$/, "Username can only contain letters, numbers, hyphens, and underscores"));
313
- var nameSchema = z2.string().min(1, "Name is required").max(100, "Name too long").refine((name) => {
314
- const dangerousPatterns = [
315
- /<script/i,
316
- /<img/i,
317
- /on\w+\s*=/i,
318
- /javascript:/i,
319
- /data:/i,
320
- /vbscript:/i
321
- ];
322
- return !dangerousPatterns.some((pattern) => pattern.test(name));
323
- }, "Name contains invalid characters").transform((name) => sanitizeUserInput(name, {
324
- allowHtml: false,
325
- maxLength: 100,
326
- trim: true
327
- }));
328
- var phoneSchema = z2.string().min(10, "Phone number must be at least 10 digits").max(20, "Phone number too long").regex(/^[\+]?[0-9\s\-\(\)\.]+$/, "Invalid phone number format").refine((phone) => {
329
- const digitsOnly = phone.replace(/\D/g, "");
330
- return digitsOnly.length >= 10 && digitsOnly.length <= 15;
331
- }, "Phone number must be between 10 and 15 digits");
332
- var urlSchema = z2.string().min(1, "URL is required").max(2048, "URL too long").refine((url) => {
333
- try {
334
- const parsed = new URL(url);
335
- return ["http:", "https:"].includes(parsed.protocol);
336
- } catch {
337
- return false;
338
- }
339
- }, "Invalid URL format").refine((url) => {
340
- const dangerousPatterns = [
341
- /javascript:/i,
342
- /data:/i,
343
- /vbscript:/i,
344
- /file:/i,
345
- /mailto:/i
346
- ];
347
- return !dangerousPatterns.some((pattern) => pattern.test(url));
348
- }, "URL contains invalid protocol");
169
+ // src/utils/index.ts
170
+ init_logger();
349
171
 
350
- // src/utils/security.ts
172
+ // src/utils/security/security.ts
173
+ init_logger();
174
+ var log = createLogger("Security");
351
175
  function logSecurityEvent(event) {
352
- console.warn("[SECURITY EVENT]", {
176
+ log.warn("Security event:", {
353
177
  ...event,
354
178
  timestamp: event.timestamp.toISOString()
355
179
  });
@@ -377,6 +201,35 @@ function validateSecurityHeaders(headers) {
377
201
  return true;
378
202
  }
379
203
 
204
+ // src/utils/security/securityMonitor.ts
205
+ var SecurityMonitor = class {
206
+ constructor() {
207
+ this.events = [];
208
+ }
209
+ logEvent(event) {
210
+ const eventWithId = {
211
+ ...event,
212
+ id: Math.random().toString(36).substr(2, 9),
213
+ timestamp: Date.now()
214
+ };
215
+ this.events.push(eventWithId);
216
+ }
217
+ getEvents() {
218
+ return [...this.events];
219
+ }
220
+ clearEvents() {
221
+ this.events = [];
222
+ }
223
+ createAlert(alert) {
224
+ return {
225
+ ...alert,
226
+ id: Math.random().toString(36).substr(2, 9),
227
+ timestamp: /* @__PURE__ */ new Date()
228
+ };
229
+ }
230
+ };
231
+ var securityMonitor = new SecurityMonitor();
232
+
380
233
  // src/constants/performance.ts
381
234
  var PERFORMANCE_THRESHOLDS = {
382
235
  RENDER_TIME: 16,
@@ -393,7 +246,7 @@ var PERFORMANCE_THRESHOLDS = {
393
246
  // 250KB bundle size limit
394
247
  };
395
248
 
396
- // src/utils/performanceBenchmark.ts
249
+ // src/utils/performance/performanceBenchmark.ts
397
250
  function createPerformanceBenchmark(name) {
398
251
  const startTime = performance.now();
399
252
  const startMemory = performance.memory?.usedJSHeapSize || 0;
@@ -436,7 +289,7 @@ function measureRenderPerformance(componentName, renderFn) {
436
289
  return metrics;
437
290
  }
438
291
 
439
- // src/utils/bundleAnalysis.ts
292
+ // src/utils/performance/bundleAnalysis.ts
440
293
  var BundleAnalyzer = class {
441
294
  constructor() {
442
295
  this.enabled = import.meta.env.MODE === "development";
@@ -522,7 +375,7 @@ function trackDynamicImport(moduleName) {
522
375
  console.log("Dynamic import: " + moduleName + " - Good for code splitting!");
523
376
  }
524
377
 
525
- // src/utils/dynamicUtils.ts
378
+ // src/utils/dynamic/dynamicUtils.ts
526
379
  var loadLodash = async () => {
527
380
  const [debounceModule, throttleModule] = await Promise.all([
528
381
  import("lodash.debounce"),
@@ -579,7 +432,7 @@ var lazyChartUtils = createLazyUtility(loadChartUtils);
579
432
  var lazyFormUtils = createLazyUtility(loadFormUtils);
580
433
  var lazyCSVUtils = createLazyUtility(loadCSVUtils);
581
434
 
582
- // src/utils/lazyLoad.tsx
435
+ // src/utils/dynamic/lazyLoad.tsx
583
436
  import { Suspense, lazy } from "react";
584
437
  import { jsx } from "react/jsx-runtime";
585
438
  function createLazyComponent(importFn, componentName, options = {}) {
@@ -596,11 +449,11 @@ function createLazyComponent(importFn, componentName, options = {}) {
596
449
  return WrappedComponent;
597
450
  }
598
451
  var LazyDataTable = createLazyComponent(
599
- () => import("./DataTable-A36PJG6N.js").then((module) => ({ default: module.DataTable })),
452
+ () => import("./DataTable-CYOHOX3O.js").then((module) => ({ default: module.DataTable })),
600
453
  "DataTable"
601
454
  );
602
455
 
603
- // src/utils/permissionUtils.ts
456
+ // src/utils/permissions/permissionUtils.ts
604
457
  function transformPermissionMapToBoolean(permissions) {
605
458
  const result = {};
606
459
  Object.entries(permissions).forEach(([key, value]) => {
@@ -625,7 +478,7 @@ function hasAllPermissions(permissions, permissionList) {
625
478
  return permissionList.every((permission) => hasPermission(permissions, permission));
626
479
  }
627
480
 
628
- // src/utils/permissionTypes.ts
481
+ // src/utils/permissions/permissionTypes.ts
629
482
  var PermissionType = /* @__PURE__ */ ((PermissionType2) => {
630
483
  PermissionType2["READ"] = "read";
631
484
  PermissionType2["WRITE"] = "write";
@@ -651,52 +504,7 @@ function parsePermission(permission) {
651
504
  };
652
505
  }
653
506
 
654
- // src/utils/schemaUtils.ts
655
- import { z as z3 } from "zod";
656
- function pickSchema(schema, keys) {
657
- const shape = Object.entries(schema.shape).filter(([key]) => keys.includes(key)).reduce((acc, [key, value]) => {
658
- acc[key] = value;
659
- return acc;
660
- }, {});
661
- return z3.object(shape);
662
- }
663
- function combineSchemas(schemas) {
664
- return schemas.reduce(
665
- (merged, schema) => merged.merge(schema),
666
- z3.object({})
667
- );
668
- }
669
-
670
- // src/utils/securityMonitor.ts
671
- var SecurityMonitor = class {
672
- constructor() {
673
- this.events = [];
674
- }
675
- logEvent(event) {
676
- const eventWithId = {
677
- ...event,
678
- id: Math.random().toString(36).substr(2, 9),
679
- timestamp: Date.now()
680
- };
681
- this.events.push(eventWithId);
682
- }
683
- getEvents() {
684
- return [...this.events];
685
- }
686
- clearEvents() {
687
- this.events = [];
688
- }
689
- createAlert(alert) {
690
- return {
691
- ...alert,
692
- id: Math.random().toString(36).substr(2, 9),
693
- timestamp: /* @__PURE__ */ new Date()
694
- };
695
- }
696
- };
697
- var securityMonitor = new SecurityMonitor();
698
-
699
- // src/utils/audit.ts
507
+ // src/utils/audit/audit.ts
700
508
  var AuditLogger = class {
701
509
  constructor() {
702
510
  this.events = [];
@@ -777,7 +585,7 @@ function logAuditEvent(action, user, details) {
777
585
  });
778
586
  }
779
587
 
780
- // src/utils/deviceFingerprint.ts
588
+ // src/utils/device/deviceFingerprint.ts
781
589
  init_secureStorage();
782
590
  function generateDeviceFingerprint() {
783
591
  try {
@@ -908,37 +716,56 @@ function generateFallbackFingerprint() {
908
716
  // src/utils/index.ts
909
717
  init_organisationContext();
910
718
  export {
911
- CSP_DIRECTIVES,
719
+ CachedAppIdResolver,
912
720
  DebugLogger,
913
721
  LazyDataTable,
722
+ LogLevel,
723
+ Logger,
914
724
  PERFORMANCE_BUDGETS,
915
725
  PERFORMANCE_THRESHOLDS,
916
726
  PermissionType,
917
- RateLimiter,
918
727
  auditLog,
919
728
  auditLogger,
729
+ buildSafeQueryParams,
920
730
  bundleAnalyzer,
731
+ cachedAppIdResolver,
732
+ calculatePasswordStrength,
733
+ changePasswordSchema,
921
734
  clearOrganisationContext,
922
735
  cn,
923
736
  combineSchemas,
737
+ contactFormSchema,
924
738
  createLazyComponent,
925
739
  createLazyUtility,
740
+ createLogger,
926
741
  createPerformanceBenchmark,
742
+ csrfManager,
743
+ dateSchema,
927
744
  deepMerge,
928
- emailSchema,
745
+ detectSQLInjection,
746
+ emailSchema2 as emailSchema,
747
+ emailSchema as enhancedEmailSchema,
748
+ nameSchema as enhancedNameSchema,
749
+ passwordSchema as enhancedPasswordSchema,
750
+ phoneSchema as enhancedPhoneSchema,
751
+ urlSchema as enhancedUrlSchema,
752
+ escapeLikeQuery,
929
753
  formatCompactNumber,
930
754
  formatCurrency,
931
755
  formatDate,
932
756
  formatFileSize,
933
757
  formatNumber,
934
758
  formatPercent,
935
- generateCSPHeader,
759
+ generateCSRFToken,
936
760
  generateDeviceFingerprint,
937
761
  getAppConfig,
762
+ getAppId,
763
+ getAppIds,
938
764
  getAppNameFromBuildTime,
939
765
  getAppNameFromEnvironment,
940
766
  getAppNameFromGlobal,
941
767
  getAppNameFromPackageJson,
768
+ getCSRFToken,
942
769
  getCurrentAppId,
943
770
  getCurrentAppName,
944
771
  getCurrentAppNameWithFallback,
@@ -960,6 +787,7 @@ export {
960
787
  lazyDateUtils,
961
788
  lazyFormUtils,
962
789
  lazyLodash,
790
+ limitOffsetSchema,
963
791
  loadCSVUtils,
964
792
  loadChartUtils,
965
793
  loadDateUtils,
@@ -969,33 +797,47 @@ export {
969
797
  logAuthEvent,
970
798
  logPermissionEvent,
971
799
  logSecurityEvent2 as logSecurityEvent,
800
+ logger,
801
+ loginSchema,
972
802
  matchesPattern,
973
803
  measureRenderPerformance,
974
- nameSchema,
804
+ nameSchema2 as nameSchema,
805
+ orderBySchema,
975
806
  parsePermission,
976
- passwordSchema,
807
+ passwordResetSchema,
808
+ passwordSchema2 as passwordSchema,
977
809
  performanceBudgetMonitor,
978
- phoneSchema,
810
+ phoneSchema2 as phoneSchema,
979
811
  pickSchema,
980
- sanitizeEmail,
981
- sanitizeFileName,
812
+ registrationSchema,
813
+ renderSafeHtml,
814
+ sanitizeFilters,
982
815
  sanitizeFormData,
983
- sanitizePhoneNumber,
984
- sanitizeSqlInput,
985
- sanitizeUrl,
816
+ sanitizeHtml,
817
+ sanitizeHtml as sanitizeHtmlAdvanced,
818
+ sanitizeSearchQuery,
986
819
  sanitizeUserInput,
987
820
  sanitizeUserInput_deprecated,
821
+ searchQuerySchema,
822
+ secureLoginSchema,
823
+ securePasswordSchema,
988
824
  securityMonitor,
989
825
  setAppConfig,
990
826
  setOrganisationContext,
991
827
  setRBACAppName,
828
+ sqlIdentifierSchema,
992
829
  trackDynamicImport,
993
830
  transformPermissionMapToBoolean,
994
- urlSchema,
831
+ urlSchema2 as urlSchema,
995
832
  useComponentPerformance,
996
833
  useSessionTracking,
834
+ userPreferencesSchema,
835
+ userProfileSchema,
836
+ userSettingsSchema,
997
837
  usernameSchema,
838
+ validateCSRFToken,
998
839
  validateDeviceFingerprint,
840
+ validateHtml,
999
841
  validateImportPattern,
1000
842
  validateSecurityHeaders,
1001
843
  validateUserInput