@jmruthers/pace-core 0.5.135 → 0.5.137
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.
- package/dist/{DataTable-A36PJG6N.js → DataTable-6M4L6BI2.js} +26 -13
- package/dist/{DataTable-C7GaRZye.d.ts → DataTable-CWAZZcXC.d.ts} +1 -1
- package/dist/{PublicLoadingSpinner-CUAnTvcg.d.ts → EventLogo-rFL_kRjk.d.ts} +123 -135
- package/dist/{UnifiedAuthProvider-BVKmQd9u.d.ts → UnifiedAuthProvider-DJxGTftH.d.ts} +1 -1
- package/dist/{UnifiedAuthProvider-CQDZRJIS.js → UnifiedAuthProvider-XIQQ7LVU.js} +5 -5
- package/dist/{api-TNIBJWLM.js → api-45XYYO2A.js} +4 -3
- package/dist/{audit-T36HM7IM.js → audit-64X3VJXB.js} +3 -2
- package/dist/{chunk-F64FFPOZ.js → chunk-22WKWKRX.js} +26 -20
- package/dist/chunk-22WKWKRX.js.map +1 -0
- package/dist/{chunk-VZ5OR6HD.js → chunk-4C7EXCAR.js} +62 -150
- package/dist/chunk-4C7EXCAR.js.map +1 -0
- package/dist/{chunk-PYUXFQJ3.js → chunk-56XJ3TU6.js} +2 -2
- package/dist/chunk-56XJ3TU6.js.map +1 -0
- package/dist/{chunk-CTJRBUX2.js → chunk-6LAAY47Q.js} +2 -2
- package/dist/{chunk-UJI6WSMD.js → chunk-7QCC6MCP.js} +90 -3
- package/dist/chunk-7QCC6MCP.js.map +1 -0
- package/dist/{chunk-66C4BSAY.js → chunk-ANBQRTPX.js} +9 -2
- package/dist/chunk-ANBQRTPX.js.map +1 -0
- package/dist/{chunk-CQZU6TFE.js → chunk-BCIBECNB.js} +100 -62
- package/dist/chunk-BCIBECNB.js.map +1 -0
- package/dist/{chunk-GKHF54DI.js → chunk-BESYRHQM.js} +10 -4
- package/dist/chunk-BESYRHQM.js.map +1 -0
- package/dist/chunk-BJPBT3CU.js +21 -0
- package/dist/chunk-BJPBT3CU.js.map +1 -0
- package/dist/{chunk-BYXRHAIF.js → chunk-BLCXZEYF.js} +23 -14
- package/dist/chunk-BLCXZEYF.js.map +1 -0
- package/dist/{chunk-WP5I5GLN.js → chunk-BVYWGZVV.js} +112 -97
- package/dist/chunk-BVYWGZVV.js.map +1 -0
- package/dist/{chunk-GEVIB2UB.js → chunk-ERISIBYU.js} +14 -5
- package/dist/chunk-ERISIBYU.js.map +1 -0
- package/dist/{chunk-O3NWNXDY.js → chunk-FMUCXFII.js} +2 -2
- package/dist/chunk-FMUCXFII.js.map +1 -0
- package/dist/{chunk-GVDR7WNV.js → chunk-HAWZXGR2.js} +334 -614
- package/dist/chunk-HAWZXGR2.js.map +1 -0
- package/dist/{chunk-ZV77RZMU.js → chunk-INQLMHPF.js} +2 -2
- package/dist/chunk-JISYG63F.js +70 -0
- package/dist/chunk-JISYG63F.js.map +1 -0
- package/dist/{chunk-HMNOSGVA.js → chunk-KYRHUBIU.js} +576 -767
- package/dist/chunk-KYRHUBIU.js.map +1 -0
- package/dist/{chunk-M6DDYFUD.js → chunk-LS353YLY.js} +19 -16
- package/dist/chunk-LS353YLY.js.map +1 -0
- package/dist/{chunk-TGIY2AR2.js → chunk-MA6EPSGZ.js} +4 -3
- package/dist/{chunk-TGIY2AR2.js.map → chunk-MA6EPSGZ.js.map} +1 -1
- package/dist/chunk-OWAG3GSU.js +58 -0
- package/dist/chunk-OWAG3GSU.js.map +1 -0
- package/dist/{chunk-JCQZ6LA7.js → chunk-Q5QRDWKI.js} +9 -3
- package/dist/chunk-Q5QRDWKI.js.map +1 -0
- package/dist/chunk-S5OFRT4M.js +94 -0
- package/dist/chunk-S5OFRT4M.js.map +1 -0
- package/dist/{chunk-3DBFLLLU.js → chunk-SBVILCCA.js} +14 -9
- package/dist/chunk-SBVILCCA.js.map +1 -0
- package/dist/{chunk-ZYZCRSBD.js → chunk-T6JN6LH6.js} +16 -11
- package/dist/chunk-T6JN6LH6.js.map +1 -0
- package/dist/chunk-XDNLUEXI.js +138 -0
- package/dist/chunk-XDNLUEXI.js.map +1 -0
- package/dist/{chunk-3CG5L6RN.js → chunk-YCWDTTUK.js} +90 -75
- package/dist/chunk-YCWDTTUK.js.map +1 -0
- package/dist/{chunk-5F3NDPJV.js → chunk-ZZ2SS7NI.js} +10 -5
- package/dist/chunk-ZZ2SS7NI.js.map +1 -0
- package/dist/components.d.ts +7 -287
- package/dist/components.js +27 -157
- package/dist/components.js.map +1 -1
- package/dist/{file-reference-C9isKNPn.d.ts → file-reference-C6Gkn77H.d.ts} +1 -1
- package/dist/{formatting-DFcCxUEk.d.ts → formatting-CvUXy2mF.d.ts} +1 -1
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +21 -16
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +101 -9
- package/dist/index.js +44 -31
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +4 -4
- package/dist/rbac/index.js +12 -12
- package/dist/schema-DTDZQe2u.d.ts +28 -0
- package/dist/styles/index.js +2 -1
- package/dist/theming/runtime.d.ts +2 -19
- package/dist/theming/runtime.js +2 -1
- package/dist/{types-D5rqZQXk.d.ts → types-Dfz9dmVH.d.ts} +12 -1
- package/dist/types.d.ts +153 -4
- package/dist/types.js +51 -16
- package/dist/types.js.map +1 -1
- package/dist/{useInactivityTracker-MRUU55XI.js → useInactivityTracker-TO6ZOF35.js} +3 -2
- package/dist/{usePublicRouteParams-Dyt1tzI9.d.ts → usePublicRouteParams-B7PabvuH.d.ts} +1 -1
- package/dist/utils.d.ts +221 -173
- package/dist/utils.js +185 -225
- package/dist/utils.js.map +1 -1
- package/dist/validation.d.ts +24 -115
- package/dist/validation.js +19 -474
- package/dist/validation.js.map +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +6 -6
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +6 -6
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +7 -7
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +4 -4
- package/docs/api/interfaces/BadgeProps.md +27 -0
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +29 -4
- package/docs/api/interfaces/DataAccessRecord.md +9 -9
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +18 -18
- package/docs/api/interfaces/DataTableColumn.md +61 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
- package/docs/api/interfaces/EmptyStateConfig.md +5 -5
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +14 -14
- package/docs/api/interfaces/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +152 -0
- package/docs/api/interfaces/ExportColumn.md +1 -1
- package/docs/api/interfaces/ExportOptions.md +8 -8
- package/docs/api/interfaces/FileDisplayProps.md +15 -15
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +10 -10
- package/docs/api/interfaces/NavigationContextType.md +9 -9
- package/docs/api/interfaces/NavigationGuardProps.md +10 -10
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +7 -7
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +27 -27
- package/docs/api/interfaces/PaceLoginPageProps.md +4 -4
- package/docs/api/interfaces/PageAccessRecord.md +8 -8
- package/docs/api/interfaces/PagePermissionContextType.md +8 -8
- package/docs/api/interfaces/PagePermissionGuardProps.md +11 -11
- package/docs/api/interfaces/PagePermissionProviderProps.md +7 -7
- package/docs/api/interfaces/PaletteData.md +4 -4
- package/docs/api/interfaces/PermissionEnforcerProps.md +11 -11
- package/docs/api/interfaces/ProtectedRouteProps.md +6 -6
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +8 -8
- package/docs/api/interfaces/RoleBasedRouterProps.md +10 -10
- package/docs/api/interfaces/RoleManagementResult.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +10 -10
- package/docs/api/interfaces/RouteConfig.md +10 -10
- package/docs/api/interfaces/SecureDataContextType.md +9 -9
- package/docs/api/interfaces/SecureDataProviderProps.md +8 -8
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +21 -0
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +53 -53
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +13 -13
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +9 -9
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +8 -8
- package/docs/api/interfaces/UsePublicEventOptions.md +3 -3
- package/docs/api/interfaces/UsePublicEventReturn.md +5 -5
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +4 -4
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +9 -9
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +4 -4
- package/docs/api/interfaces/UseResolvedScopeReturn.md +4 -4
- package/docs/api/interfaces/UserEventAccess.md +11 -11
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +591 -220
- package/docs/api-reference/components.md +106 -26
- package/docs/architecture/README.md +0 -3
- package/docs/implementation-guides/data-tables.md +277 -13
- package/docs/implementation-guides/forms.md +1 -16
- package/docs/implementation-guides/permission-enforcement.md +8 -2
- package/docs/styles/README.md +0 -2
- package/examples/README.md +30 -14
- package/examples/STRUCTURE.md +125 -0
- package/examples/components 2/DataTable/HierarchicalActionsExample.tsx +421 -0
- package/examples/components 2/DataTable/HierarchicalExample.tsx +475 -0
- package/examples/components 2/DataTable/InitialPageSizeExample.tsx +177 -0
- package/examples/components 2/DataTable/PerformanceExample.tsx +506 -0
- package/examples/components 2/DataTable/index.ts +13 -0
- package/examples/components 2/Dialog/BasicHtmlTest.tsx +55 -0
- package/examples/components 2/Dialog/DebugHtmlExample.tsx +68 -0
- package/examples/components 2/Dialog/HtmlDialogExample.tsx +202 -0
- package/examples/components 2/Dialog/ScrollableDialogExample.tsx +290 -0
- package/examples/components 2/Dialog/SimpleHtmlTest.tsx +61 -0
- package/examples/components 2/Dialog/SmartDialogExample.tsx +322 -0
- package/examples/components 2/Dialog/index.ts +15 -0
- package/examples/components 2/index.ts +11 -0
- package/examples/features/index.ts +12 -0
- package/{src/examples → examples/features/public-pages}/CorrectPublicPageImplementation.tsx +14 -17
- package/{src/examples → examples/features/public-pages}/PublicEventPage.tsx +14 -27
- package/{src/examples → examples/features/public-pages}/PublicPageApp.tsx +15 -28
- package/{src/examples → examples/features/public-pages}/PublicPageUsageExample.tsx +8 -10
- package/examples/features/public-pages/index.ts +14 -0
- package/examples/features/rbac/CompleteRBACExample.tsx +324 -0
- package/examples/features/rbac/EventBasedApp.tsx +239 -0
- package/examples/features/rbac/PermissionExample.tsx +151 -0
- package/examples/features/rbac/index.ts +13 -0
- package/examples/index.ts +11 -3
- package/package.json +30 -19
- package/src/__tests__/TEST_STANDARD.md +92 -0
- package/src/components/Alert/Alert.tsx +1 -1
- package/src/components/Avatar/Avatar.tsx +1 -1
- package/src/components/Badge/Badge.test.tsx +314 -0
- package/src/components/Badge/Badge.tsx +304 -0
- package/src/components/Badge/index.ts +3 -0
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/DataTable/DataTable.test.tsx +1 -1
- package/src/components/DataTable/DataTable.tsx +1 -30
- package/src/components/DataTable/__tests__/DataTable.grouping-aggregation.test.tsx +562 -0
- package/src/components/DataTable/__tests__/DataTableCore.test-setup.ts +217 -0
- package/src/components/DataTable/__tests__/styles.test.ts +3 -3
- package/src/components/DataTable/components/ActionButtons.tsx +0 -15
- package/src/components/DataTable/components/ColumnFilter.tsx +8 -4
- package/src/components/DataTable/components/DataTableBody.tsx +461 -0
- package/src/components/DataTable/components/DataTableCore.tsx +4 -185
- package/src/components/DataTable/components/DataTableErrorBoundary.tsx +1 -1
- package/src/components/DataTable/components/DataTableModals.tsx +1 -27
- package/src/components/DataTable/components/DraggableColumnHeader.tsx +144 -0
- package/src/components/DataTable/components/EditableRow.tsx +1 -1
- package/src/components/DataTable/components/FilterRow.tsx +9 -3
- package/src/components/DataTable/components/ImportModal.tsx +2 -14
- package/src/components/DataTable/components/PaginationControls.tsx +2 -1
- package/src/components/DataTable/components/UnifiedTableBody.tsx +109 -82
- package/src/components/DataTable/components/VirtualizedDataTable.tsx +513 -0
- package/src/components/DataTable/components/__tests__/AccessDeniedPage.test.tsx +14 -68
- package/src/components/DataTable/components/__tests__/ActionButtons.test.tsx +1 -1
- package/src/components/DataTable/components/__tests__/ColumnFilter.test.tsx +62 -0
- package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.test.tsx +1 -1
- package/src/components/DataTable/components/__tests__/DataTableModals.test.tsx +1 -1
- package/src/components/DataTable/components/__tests__/FilterRow.test.tsx +43 -0
- package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +1 -1
- package/src/components/DataTable/core/ActionManager.ts +235 -0
- package/src/components/DataTable/core/ColumnManager.ts +205 -0
- package/src/components/DataTable/core/DataManager.ts +188 -0
- package/src/components/DataTable/core/DataTableContext.tsx +181 -0
- package/src/components/DataTable/core/LocalDataAdapter.ts +273 -0
- package/src/components/DataTable/core/PluginRegistry.ts +229 -0
- package/src/components/DataTable/core/StateManager.ts +311 -0
- package/src/components/DataTable/core/interfaces.ts +338 -0
- package/src/components/DataTable/examples/GroupingAggregationExample.tsx +273 -0
- package/src/components/DataTable/examples/HierarchicalActionsExample.tsx +1 -1
- package/src/components/DataTable/examples/__tests__/HierarchicalActionsExample.test.tsx +1 -1
- package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +1 -1
- package/src/components/DataTable/hooks/useColumnVisibilityPersistence.ts +1 -1
- package/src/components/DataTable/hooks/useDataTablePermissions.ts +2 -23
- package/src/components/DataTable/index.ts +4 -0
- package/src/components/DataTable/styles.ts +28 -7
- package/src/components/DataTable/types.ts +13 -0
- package/src/components/DataTable/utils/__tests__/columnUtils.test.ts +94 -0
- package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +1 -1
- package/src/components/DataTable/utils/aggregationUtils.ts +161 -0
- package/src/components/DataTable/utils/columnUtils.ts +40 -0
- package/src/components/DataTable/utils/debugTools.ts +609 -0
- package/src/components/DataTable/utils/exportUtils.ts +1 -1
- package/src/components/DataTable/utils/flexibleImport.ts +1 -11
- package/src/components/DataTable/utils/index.ts +2 -0
- package/src/components/DataTable/utils/paginationUtils.ts +1 -1
- package/src/components/Dialog/Dialog.tsx +2 -2
- package/src/components/Dialog/utils/__tests__/safeHtml.unit.test.ts +8 -1
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +35 -7
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +5 -4
- package/src/components/EventSelector/EventSelector.tsx +3 -2
- package/src/components/FileDisplay/FileDisplay.tsx +2 -36
- package/src/components/FileUpload/FileUpload.test.tsx +2 -2
- package/src/components/FileUpload/FileUpload.tsx +2 -2
- package/src/components/Footer/Footer.test.tsx +1 -1
- package/src/components/Footer/Footer.tsx +1 -1
- package/src/components/Form/Form.test.tsx +5 -510
- package/src/components/Form/Form.tsx +1 -1
- package/src/components/Form/FormField.tsx +1 -1
- package/src/components/Form/index.ts +0 -12
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Input/Input.tsx +1 -1
- package/src/components/Label/Label.tsx +1 -1
- package/src/components/LoginForm/LoginForm.test.tsx +1 -1
- package/src/components/LoginForm/LoginForm.tsx +1 -1
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +19 -3
- package/src/components/NavigationMenu/NavigationMenu.tsx +9 -8
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +4 -3
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +14 -12
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +0 -16
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.performance.test.tsx +76 -10
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +0 -1
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +0 -9
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +35 -3
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +14 -13
- package/src/components/PasswordReset/PasswordChangeForm.tsx +1 -1
- package/src/components/PasswordReset/index.ts +0 -2
- package/src/components/Progress/Progress.tsx +1 -1
- package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +35 -8
- package/src/components/ProtectedRoute/ProtectedRoute.tsx +3 -2
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +1 -1
- package/src/components/PublicLayout/PublicLoadingSpinner.tsx +1 -1
- package/src/components/PublicLayout/PublicPageContextChecker.tsx +44 -43
- package/src/components/PublicLayout/PublicPageFooter.tsx +1 -1
- package/src/components/PublicLayout/PublicPageHeader.tsx +1 -15
- package/src/components/PublicLayout/PublicPageProvider.tsx +3 -2
- package/src/components/PublicLayout/__tests__/PublicPageContextChecker.test.tsx +2 -0
- package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +1 -1
- package/src/components/PublicLayout/index.ts +4 -2
- package/src/components/Select/Select.test.tsx +1 -1
- package/src/components/Select/Select.tsx +21 -9
- package/src/components/{SessionRestorationLoader.tsx → SessionRestorationLoader/SessionRestorationLoader.tsx} +3 -2
- package/src/components/SessionRestorationLoader/index.ts +3 -0
- package/src/components/Switch/Switch.tsx +1 -1
- package/src/components/Table/Table.tsx +1 -1
- package/src/components/Table/__tests__/Table.test.tsx +1 -1
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/index.ts +7 -10
- package/src/hooks/__tests__/hooks.integration.test.tsx +37 -22
- package/src/hooks/__tests__/useComponentPerformance.unit.test.tsx +33 -17
- package/src/hooks/__tests__/useDataTablePerformance.unit.test.ts +28 -3
- package/src/hooks/__tests__/useFileDisplay.unit.test.ts +36 -9
- package/src/hooks/__tests__/useFileUrl.unit.test.ts +83 -85
- package/src/hooks/__tests__/useInactivityTracker.unit.test.ts +26 -2
- package/src/hooks/__tests__/usePerformanceMonitor.unit.test.ts +19 -6
- package/src/hooks/__tests__/usePermissionCache.simple.test.ts +17 -4
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +17 -4
- package/src/hooks/__tests__/usePublicEvent.simple.test.ts +26 -6
- package/src/hooks/__tests__/usePublicFileDisplay.test.ts +16 -6
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +3 -3
- package/src/hooks/__tests__/useSessionRestoration.unit.test.tsx +17 -3
- package/src/hooks/public/usePublicEvent.ts +7 -6
- package/src/hooks/public/usePublicEventLogo.ts +7 -4
- package/src/hooks/public/usePublicFileDisplay.ts +6 -150
- package/src/hooks/useComponentPerformance.ts +4 -1
- package/src/hooks/useDataTablePerformance.ts +4 -3
- package/src/hooks/useEventTheme.test.ts +18 -5
- package/src/hooks/useEventTheme.ts +4 -1
- package/src/hooks/useEvents.ts +2 -0
- package/src/hooks/useFileDisplay.ts +9 -8
- package/src/hooks/useFileReference.ts +4 -1
- package/src/hooks/useFileUrl.ts +4 -1
- package/src/hooks/useInactivityTracker.ts +5 -4
- package/src/hooks/useOrganisationSecurity.test.ts +33 -12
- package/src/hooks/useOrganisationSecurity.ts +8 -7
- package/src/hooks/usePerformanceMonitor.ts +6 -3
- package/src/hooks/usePermissionCache.ts +13 -6
- package/src/hooks/useSecureDataAccess.test.ts +2 -2
- package/src/hooks/useSecureDataAccess.ts +9 -8
- package/src/hooks/useSessionRestoration.ts +4 -1
- package/src/hooks/useStorage.ts +4 -1
- package/src/index.ts +20 -7
- package/src/providers/services/AuthServiceProvider.tsx +3 -2
- package/src/providers/services/EventServiceProvider.tsx +2 -1
- package/src/providers/services/InactivityServiceProvider.tsx +2 -1
- package/src/providers/services/OrganisationServiceProvider.tsx +2 -1
- package/src/providers/services/UnifiedAuthProvider.tsx +4 -3
- package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +22 -2
- package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +24 -2
- package/src/rbac/__tests__/cache-invalidation.test.ts +20 -6
- package/src/rbac/api.ts +5 -2
- package/src/rbac/audit-enhanced.ts +6 -6
- package/src/rbac/audit.test.ts +60 -38
- package/src/rbac/audit.ts +8 -8
- package/src/rbac/cache-invalidation.ts +7 -4
- package/src/rbac/components/EnhancedNavigationMenu.tsx +11 -5
- package/src/rbac/components/NavigationGuard.tsx +7 -3
- package/src/rbac/components/NavigationProvider.tsx +6 -3
- package/src/rbac/components/PagePermissionGuard.tsx +28 -16
- package/src/rbac/components/PagePermissionProvider.tsx +4 -1
- package/src/rbac/components/PermissionEnforcer.tsx +9 -3
- package/src/rbac/components/RoleBasedRouter.tsx +3 -1
- package/src/rbac/components/SecureDataProvider.tsx +7 -3
- package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +87 -61
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +83 -33
- package/src/rbac/components/__tests__/NavigationProvider.test.tsx +36 -13
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +2 -2
- package/src/rbac/components/__tests__/PagePermissionProvider.test.tsx +22 -8
- package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +19 -6
- package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +43 -17
- package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +42 -17
- package/src/rbac/engine.ts +15 -7
- package/src/rbac/hooks/usePermissions.ts +7 -3
- package/src/rbac/hooks/useResolvedScope.test.ts +2 -2
- package/src/rbac/hooks/useResolvedScope.ts +10 -7
- package/src/rbac/permissions.ts +5 -2
- package/src/rbac/security.test.ts +27 -16
- package/src/rbac/security.ts +5 -4
- package/src/services/AuthService.ts +22 -21
- package/src/services/EventService.ts +12 -12
- package/src/services/InactivityService.ts +5 -4
- package/src/services/OrganisationService.ts +26 -25
- package/src/services/__tests__/AuthService.test.ts +51 -19
- package/src/services/__tests__/EventService.test.ts +37 -5
- package/src/services/__tests__/InactivityService.test.ts +38 -4
- package/src/services/__tests__/OrganisationService.test.ts +3 -8
- package/src/services/base/BaseService.ts +3 -1
- package/src/styles/core.css +3 -0
- package/src/theming/__tests__/runtime.test.ts +21 -12
- package/src/theming/parseEventColours.ts +5 -19
- package/src/theming/runtime.ts +8 -4
- package/src/types/validation.ts +2 -29
- package/src/utils/__tests__/appConfig.unit.test.ts +1 -1
- package/src/utils/__tests__/audit.unit.test.ts +1 -1
- package/src/utils/__tests__/auth-utils.unit.test.ts +1 -1
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +19 -19
- package/src/utils/__tests__/cn.unit.test.ts +1 -1
- package/src/utils/__tests__/debugLogger.test.ts +1 -1
- package/src/utils/__tests__/deviceFingerprint.unit.test.ts +1 -1
- package/src/utils/__tests__/dynamicUtils.unit.test.ts +1 -1
- package/src/utils/__tests__/formatting.unit.test.ts +1 -1
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +1 -1
- package/src/utils/__tests__/logger.unit.test.ts +1 -1
- package/src/utils/__tests__/organisationContext.unit.test.ts +1 -1
- package/src/utils/__tests__/performanceBenchmark.test.ts +1 -1
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +1 -1
- package/src/utils/__tests__/permissionTypes.unit.test.ts +1 -1
- package/src/utils/__tests__/permissionUtils.unit.test.ts +1 -1
- package/src/utils/__tests__/sanitization.unit.test.ts +1 -1
- package/src/utils/__tests__/schemaUtils.unit.test.ts +1 -1
- package/src/utils/__tests__/secureDataAccess.unit.test.ts +1 -1
- package/src/utils/__tests__/secureErrors.unit.test.ts +33 -15
- package/src/utils/__tests__/secureStorage.unit.test.ts +1 -1
- package/src/utils/__tests__/security.unit.test.ts +40 -18
- package/src/utils/__tests__/securityMonitor.unit.test.ts +1 -1
- package/src/utils/__tests__/sessionTracking.unit.test.ts +40 -29
- package/src/utils/__tests__/validationUtils.unit.test.ts +19 -6
- package/src/utils/app/appConfig.ts +47 -0
- package/src/utils/app/appIdResolver.test.ts +497 -0
- package/src/utils/app/appIdResolver.ts +133 -0
- package/src/utils/app/appNameResolver.simple.test.ts +212 -0
- package/src/utils/app/appNameResolver.test.ts +121 -0
- package/src/utils/app/appNameResolver.ts +195 -0
- package/src/utils/audit/audit.ts +127 -0
- package/src/utils/context/organisationContext.test.ts +322 -0
- package/src/utils/context/organisationContext.ts +156 -0
- package/src/utils/context/sessionTracking.ts +125 -0
- package/src/utils/core/cn.ts +7 -0
- package/src/utils/core/debugLogger.ts +67 -0
- package/src/utils/core/logger.ts +181 -0
- package/src/utils/device/deviceFingerprint.ts +215 -0
- package/src/utils/dynamic/dynamicUtils.ts +105 -0
- package/src/utils/dynamic/lazyLoad.tsx +44 -0
- package/src/utils/file-reference/__tests__/file-reference.test.ts +788 -0
- package/src/utils/file-reference/index.ts +501 -0
- package/src/utils/formatting/formatDate.test.ts +237 -0
- package/src/utils/formatting/formatting.ts +133 -0
- package/src/utils/index.ts +39 -54
- package/src/utils/performance/bundleAnalysis.ts +129 -0
- package/src/utils/performance/performanceBenchmark.ts +64 -0
- package/src/utils/performance/performanceBudgets.ts +110 -0
- package/src/utils/permissions/permissionTypes.ts +37 -0
- package/src/utils/permissions/permissionUtils.test.ts +393 -0
- package/src/utils/permissions/permissionUtils.ts +34 -0
- package/src/utils/security/auth-utils.ts +96 -0
- package/src/utils/security/secureDataAccess.test.ts +711 -0
- package/src/utils/security/secureDataAccess.ts +377 -0
- package/src/utils/security/secureErrors.ts +82 -0
- package/src/utils/security/secureStorage.ts +244 -0
- package/src/utils/security/security.ts +159 -0
- package/src/utils/security/securityMonitor.ts +45 -0
- package/src/utils/storage/__tests__/helpers.unit.test.ts +1 -4
- package/src/utils/storage/helpers.ts +15 -8
- package/src/utils/validation/__tests__/htmlSanitization.unit.test.ts +598 -0
- package/src/{validation → utils/validation}/csrf.ts +1 -1
- package/src/utils/validation/htmlSanitization.ts +184 -0
- package/src/utils/validation/index.ts +79 -0
- package/src/utils/validation/sanitization.ts +333 -0
- package/src/{validation/schemaUtils.ts → utils/validation/schema.ts} +11 -6
- package/src/{validation → utils/validation}/sqlInjectionProtection.ts +2 -0
- package/src/utils/validation/validation.ts +111 -0
- package/src/utils/validation/validationUtils.ts +123 -0
- package/src/validation/index.ts +3 -34
- package/dist/chunk-24MKLB7U.js +0 -81
- package/dist/chunk-24MKLB7U.js.map +0 -1
- package/dist/chunk-3CG5L6RN.js.map +0 -1
- package/dist/chunk-3DBFLLLU.js.map +0 -1
- package/dist/chunk-5F3NDPJV.js.map +0 -1
- package/dist/chunk-66C4BSAY.js.map +0 -1
- package/dist/chunk-BDZUMRBD.js +0 -87
- package/dist/chunk-BDZUMRBD.js.map +0 -1
- package/dist/chunk-BYXRHAIF.js.map +0 -1
- package/dist/chunk-CDQ3PX7L.js +0 -18
- package/dist/chunk-CDQ3PX7L.js.map +0 -1
- package/dist/chunk-CQZU6TFE.js.map +0 -1
- package/dist/chunk-F64FFPOZ.js.map +0 -1
- package/dist/chunk-GEVIB2UB.js.map +0 -1
- package/dist/chunk-GKHF54DI.js.map +0 -1
- package/dist/chunk-GVDR7WNV.js.map +0 -1
- package/dist/chunk-HMNOSGVA.js.map +0 -1
- package/dist/chunk-JCQZ6LA7.js.map +0 -1
- package/dist/chunk-M6DDYFUD.js.map +0 -1
- package/dist/chunk-O3NWNXDY.js.map +0 -1
- package/dist/chunk-PYUXFQJ3.js.map +0 -1
- package/dist/chunk-UJI6WSMD.js.map +0 -1
- package/dist/chunk-VZ5OR6HD.js.map +0 -1
- package/dist/chunk-WP5I5GLN.js.map +0 -1
- package/dist/chunk-ZYZCRSBD.js.map +0 -1
- package/dist/validation-DnhrNMju.d.ts +0 -159
- package/src/components/PublicLayout/__tests__/PublicPageDebugger.test.tsx +0 -185
- package/src/validation/__tests__/common.unit.test.ts +0 -101
- package/src/validation/__tests__/csrf.unit.test.ts +0 -365
- package/src/validation/__tests__/passwordSchema.unit.test.ts +0 -203
- package/src/validation/__tests__/sanitization.unit.test.ts +0 -250
- package/src/validation/__tests__/schemaUtils.unit.test.ts +0 -451
- package/src/validation/__tests__/sqlInjectionProtection.unit.test.ts +0 -462
- package/src/validation/__tests__/user.unit.test.ts +0 -440
- package/src/validation/sanitization.ts +0 -96
- /package/dist/{DataTable-A36PJG6N.js.map → DataTable-6M4L6BI2.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-CQDZRJIS.js.map → UnifiedAuthProvider-XIQQ7LVU.js.map} +0 -0
- /package/dist/{api-TNIBJWLM.js.map → api-45XYYO2A.js.map} +0 -0
- /package/dist/{audit-T36HM7IM.js.map → audit-64X3VJXB.js.map} +0 -0
- /package/dist/{chunk-CTJRBUX2.js.map → chunk-6LAAY47Q.js.map} +0 -0
- /package/dist/{chunk-ZV77RZMU.js.map → chunk-INQLMHPF.js.map} +0 -0
- /package/dist/{useInactivityTracker-MRUU55XI.js.map → useInactivityTracker-TO6ZOF35.js.map} +0 -0
- /package/src/{validation → utils/validation}/common.ts +0 -0
- /package/src/{validation → utils/validation}/passwordSchema.ts +0 -0
- /package/src/{validation → utils/validation}/user.ts +0 -0
|
@@ -25,16 +25,16 @@ import {
|
|
|
25
25
|
SelectSeparator,
|
|
26
26
|
SelectTrigger,
|
|
27
27
|
SelectValue
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-HAWZXGR2.js";
|
|
29
29
|
import {
|
|
30
30
|
useCan,
|
|
31
31
|
usePermissions,
|
|
32
32
|
useRBAC,
|
|
33
33
|
useResolvedScope
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-BLCXZEYF.js";
|
|
35
35
|
import {
|
|
36
36
|
isSuperAdmin
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-BVYWGZVV.js";
|
|
38
38
|
import {
|
|
39
39
|
OrganisationProvider_exports,
|
|
40
40
|
PublicErrorBoundary,
|
|
@@ -50,19 +50,19 @@ import {
|
|
|
50
50
|
useIsPublicPage,
|
|
51
51
|
usePublicFileDisplay,
|
|
52
52
|
usePublicPageContext
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-4C7EXCAR.js";
|
|
54
54
|
import {
|
|
55
55
|
useToast
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-BESYRHQM.js";
|
|
57
57
|
import {
|
|
58
58
|
init_useOrganisations,
|
|
59
59
|
useEvents,
|
|
60
60
|
useOrganisations
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-MA6EPSGZ.js";
|
|
62
62
|
import {
|
|
63
63
|
UnifiedAuthProvider_exports,
|
|
64
64
|
init_UnifiedAuthProvider as init_UnifiedAuthProvider2
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-6LAAY47Q.js";
|
|
66
66
|
import {
|
|
67
67
|
EventServiceContext,
|
|
68
68
|
EventServiceProvider,
|
|
@@ -72,26 +72,31 @@ import {
|
|
|
72
72
|
useEventService,
|
|
73
73
|
useSessionRestoration,
|
|
74
74
|
useUnifiedAuth
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-YCWDTTUK.js";
|
|
76
76
|
import {
|
|
77
|
-
LoadingSpinner
|
|
78
|
-
|
|
77
|
+
LoadingSpinner,
|
|
78
|
+
getAppId
|
|
79
|
+
} from "./chunk-S5OFRT4M.js";
|
|
79
80
|
import {
|
|
80
81
|
getCurrentAppName
|
|
81
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-Q5QRDWKI.js";
|
|
82
83
|
import {
|
|
83
84
|
performanceBudgetMonitor
|
|
84
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-FMUCXFII.js";
|
|
85
86
|
import {
|
|
86
87
|
cn
|
|
87
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-56XJ3TU6.js";
|
|
88
89
|
import {
|
|
89
90
|
clearPalette
|
|
90
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-ERISIBYU.js";
|
|
92
|
+
import {
|
|
93
|
+
createLogger,
|
|
94
|
+
init_logger,
|
|
95
|
+
logger
|
|
96
|
+
} from "./chunk-XDNLUEXI.js";
|
|
91
97
|
import {
|
|
92
98
|
__esm,
|
|
93
99
|
__export,
|
|
94
|
-
__require,
|
|
95
100
|
__toCommonJS
|
|
96
101
|
} from "./chunk-PLDDJCW6.js";
|
|
97
102
|
|
|
@@ -212,11 +217,108 @@ var AvatarFallback = React2.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
212
217
|
));
|
|
213
218
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
214
219
|
|
|
215
|
-
// src/components/
|
|
220
|
+
// src/components/Badge/Badge.tsx
|
|
216
221
|
import * as React3 from "react";
|
|
217
|
-
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
218
222
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
219
|
-
var
|
|
223
|
+
var shadeConfig = {
|
|
224
|
+
muted: {
|
|
225
|
+
bg: 200,
|
|
226
|
+
text: 600,
|
|
227
|
+
border: 400,
|
|
228
|
+
outlineText: 600,
|
|
229
|
+
outlineBg: 100
|
|
230
|
+
},
|
|
231
|
+
normal: {
|
|
232
|
+
bg: 500,
|
|
233
|
+
text: 50,
|
|
234
|
+
border: 700,
|
|
235
|
+
outlineText: 700,
|
|
236
|
+
outlineBg: 200
|
|
237
|
+
},
|
|
238
|
+
strong: {
|
|
239
|
+
bg: 700,
|
|
240
|
+
text: 50,
|
|
241
|
+
border: 800,
|
|
242
|
+
outlineText: 900,
|
|
243
|
+
outlineBg: 400
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
var colors = ["main", "sec", "acc"];
|
|
247
|
+
var styles = ["solid", "outline", "soft"];
|
|
248
|
+
function buildVariantClasses(style, color, shade) {
|
|
249
|
+
const cfg = shadeConfig[shade];
|
|
250
|
+
const parts = [];
|
|
251
|
+
if (style === "solid") {
|
|
252
|
+
parts.push(`bg-${color}-${cfg.bg}`, `text-${color}-${cfg.text}`);
|
|
253
|
+
} else if (style === "outline") {
|
|
254
|
+
parts.push("outline outline-1 -outline-offset-1", `outline-${color}-${cfg.border}`, `bg-${color}-${cfg.outlineBg}`, `text-${color}-${cfg.outlineText}`);
|
|
255
|
+
} else if (style === "soft") {
|
|
256
|
+
parts.push(
|
|
257
|
+
`bg-${color}-${cfg.bg}`,
|
|
258
|
+
"shadow-badge-soft",
|
|
259
|
+
`shadow-${color}-${cfg.bg}`,
|
|
260
|
+
`text-${color}-${cfg.text}`,
|
|
261
|
+
"my-1",
|
|
262
|
+
"mx-1",
|
|
263
|
+
"py-0",
|
|
264
|
+
"px-2"
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
return parts.join(" ");
|
|
268
|
+
}
|
|
269
|
+
function generateVariantClasses() {
|
|
270
|
+
const variantClasses = {};
|
|
271
|
+
for (const style of styles) {
|
|
272
|
+
for (const color of colors) {
|
|
273
|
+
for (const shade of Object.keys(shadeConfig)) {
|
|
274
|
+
const variant = `${style}-${color}-${shade}`;
|
|
275
|
+
variantClasses[variant] = buildVariantClasses(style, color, shade);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return variantClasses;
|
|
280
|
+
}
|
|
281
|
+
var variantClassesMap = generateVariantClasses();
|
|
282
|
+
function getBadgeClasses(variant = "solid-main-normal") {
|
|
283
|
+
const baseClasses = "inline-flex text-balance items-center rounded-2xl px-3 py-1 text-xs font-medium transition-colors box-border";
|
|
284
|
+
return `${baseClasses} ${variantClassesMap[variant]}`;
|
|
285
|
+
}
|
|
286
|
+
var Badge = React3.forwardRef(
|
|
287
|
+
({ className, variant = "solid-main-normal", ...props }, ref) => {
|
|
288
|
+
const isSoftVariant = variant.startsWith("soft-");
|
|
289
|
+
if (isSoftVariant) {
|
|
290
|
+
const variantClasses = getBadgeClasses(variant);
|
|
291
|
+
const shadowColorMatch = variantClasses.match(/\bshadow-(\w+)-(\d+)\b/);
|
|
292
|
+
const shadowColorClass = shadowColorMatch ? shadowColorMatch[0] : "";
|
|
293
|
+
const classesWithoutShadows = variantClasses.replace(/\bshadow-badge-soft\b/g, "").replace(/\bshadow-\w+-\d+\b/g, "").replace(/\s+/g, " ").trim();
|
|
294
|
+
const mergedClasses = cn(classesWithoutShadows, className);
|
|
295
|
+
const finalClasses = `${mergedClasses} shadow-badge-soft ${shadowColorClass}`.trim();
|
|
296
|
+
return /* @__PURE__ */ jsx3(
|
|
297
|
+
"span",
|
|
298
|
+
{
|
|
299
|
+
ref,
|
|
300
|
+
className: finalClasses,
|
|
301
|
+
...props
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
return /* @__PURE__ */ jsx3(
|
|
306
|
+
"span",
|
|
307
|
+
{
|
|
308
|
+
ref,
|
|
309
|
+
className: cn(getBadgeClasses(variant), className),
|
|
310
|
+
...props
|
|
311
|
+
}
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
);
|
|
315
|
+
Badge.displayName = "Badge";
|
|
316
|
+
|
|
317
|
+
// src/components/Switch/Switch.tsx
|
|
318
|
+
import * as React4 from "react";
|
|
319
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
320
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
321
|
+
var Switch = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
220
322
|
SwitchPrimitive.Root,
|
|
221
323
|
{
|
|
222
324
|
className: cn(
|
|
@@ -238,7 +340,7 @@ var Switch = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
238
340
|
),
|
|
239
341
|
...props,
|
|
240
342
|
ref,
|
|
241
|
-
children: /* @__PURE__ */
|
|
343
|
+
children: /* @__PURE__ */ jsx4(
|
|
242
344
|
SwitchPrimitive.Thumb,
|
|
243
345
|
{
|
|
244
346
|
className: cn(
|
|
@@ -259,12 +361,12 @@ var Switch = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
259
361
|
Switch.displayName = SwitchPrimitive.Root.displayName;
|
|
260
362
|
|
|
261
363
|
// src/components/Toast/Toast.tsx
|
|
262
|
-
import * as
|
|
364
|
+
import * as React5 from "react";
|
|
263
365
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
|
264
366
|
import { X } from "lucide-react";
|
|
265
|
-
import { jsx as
|
|
367
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
266
368
|
var ToastProvider = ToastPrimitives.Provider;
|
|
267
|
-
var ToastViewport =
|
|
369
|
+
var ToastViewport = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
268
370
|
ToastPrimitives.Viewport,
|
|
269
371
|
{
|
|
270
372
|
ref,
|
|
@@ -277,8 +379,8 @@ var ToastViewport = React4.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
277
379
|
}
|
|
278
380
|
));
|
|
279
381
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
280
|
-
var Toast =
|
|
281
|
-
return /* @__PURE__ */
|
|
382
|
+
var Toast = React5.forwardRef(({ className, ...props }, ref) => {
|
|
383
|
+
return /* @__PURE__ */ jsx5(
|
|
282
384
|
ToastPrimitives.Root,
|
|
283
385
|
{
|
|
284
386
|
ref,
|
|
@@ -292,7 +394,7 @@ var Toast = React4.forwardRef(({ className, ...props }, ref) => {
|
|
|
292
394
|
);
|
|
293
395
|
});
|
|
294
396
|
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
295
|
-
var ToastAction =
|
|
397
|
+
var ToastAction = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
296
398
|
ToastPrimitives.Action,
|
|
297
399
|
{
|
|
298
400
|
ref,
|
|
@@ -305,7 +407,7 @@ var ToastAction = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
305
407
|
}
|
|
306
408
|
));
|
|
307
409
|
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
308
|
-
var ToastClose =
|
|
410
|
+
var ToastClose = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
309
411
|
ToastPrimitives.Close,
|
|
310
412
|
{
|
|
311
413
|
ref,
|
|
@@ -316,11 +418,11 @@ var ToastClose = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
316
418
|
),
|
|
317
419
|
"toast-close": "",
|
|
318
420
|
...props,
|
|
319
|
-
children: /* @__PURE__ */
|
|
421
|
+
children: /* @__PURE__ */ jsx5(X, { className: "h-4 w-4" })
|
|
320
422
|
}
|
|
321
423
|
));
|
|
322
424
|
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
323
|
-
var ToastTitle =
|
|
425
|
+
var ToastTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
324
426
|
ToastPrimitives.Title,
|
|
325
427
|
{
|
|
326
428
|
ref,
|
|
@@ -330,7 +432,7 @@ var ToastTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
330
432
|
}
|
|
331
433
|
));
|
|
332
434
|
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
333
|
-
var ToastDescription =
|
|
435
|
+
var ToastDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
334
436
|
ToastPrimitives.Description,
|
|
335
437
|
{
|
|
336
438
|
ref,
|
|
@@ -343,14 +445,14 @@ ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
|
343
445
|
function Toaster() {
|
|
344
446
|
const { toasts } = useToast();
|
|
345
447
|
return /* @__PURE__ */ jsxs2(ToastProvider, { "data-testid": "toast-provider", children: [
|
|
346
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ jsx5(ToastViewport, {}),
|
|
347
449
|
toasts.map((toast) => {
|
|
348
450
|
const { id, title, description, action, dismiss, duration, ...toastProps } = toast;
|
|
349
451
|
return /* @__PURE__ */ jsxs2(Toast, { ...toastProps, duration, children: [
|
|
350
|
-
title && /* @__PURE__ */
|
|
351
|
-
description && /* @__PURE__ */
|
|
452
|
+
title && /* @__PURE__ */ jsx5(ToastTitle, { children: title }),
|
|
453
|
+
description && /* @__PURE__ */ jsx5(ToastDescription, { children: description }),
|
|
352
454
|
action && action,
|
|
353
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ jsx5(ToastClose, { onClick: dismiss })
|
|
354
456
|
] }, id);
|
|
355
457
|
})
|
|
356
458
|
] });
|
|
@@ -359,7 +461,7 @@ function Toaster() {
|
|
|
359
461
|
// src/components/Form/Form.tsx
|
|
360
462
|
import { useForm, FormProvider } from "react-hook-form";
|
|
361
463
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
362
|
-
import { jsx as
|
|
464
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
363
465
|
function Form({
|
|
364
466
|
schema,
|
|
365
467
|
defaultValues,
|
|
@@ -375,13 +477,13 @@ function Form({
|
|
|
375
477
|
mode
|
|
376
478
|
});
|
|
377
479
|
const handleSubmit = methods.handleSubmit(onSubmit, onError);
|
|
378
|
-
return /* @__PURE__ */
|
|
480
|
+
return /* @__PURE__ */ jsx6(FormProvider, { ...methods, children: /* @__PURE__ */ jsx6("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: typeof children === "function" ? children(methods) : children }) });
|
|
379
481
|
}
|
|
380
482
|
|
|
381
483
|
// src/components/LoginForm/LoginForm.tsx
|
|
382
|
-
import
|
|
383
|
-
import { jsx as
|
|
384
|
-
var LoginForm =
|
|
484
|
+
import React6, { useState, useCallback, useMemo } from "react";
|
|
485
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
486
|
+
var LoginForm = React6.memo(({
|
|
385
487
|
onSignIn,
|
|
386
488
|
onSuccess,
|
|
387
489
|
onError,
|
|
@@ -422,15 +524,15 @@ var LoginForm = React5.memo(({
|
|
|
422
524
|
}, [onSignUp]);
|
|
423
525
|
const displayTitle = useMemo(() => title || (appName ? `Sign in to ${appName}` : "Sign In"), [title, appName]);
|
|
424
526
|
const displaySubtitle = useMemo(() => subtitle || "Enter your credentials to continue.", [subtitle]);
|
|
425
|
-
return /* @__PURE__ */
|
|
527
|
+
return /* @__PURE__ */ jsx7(Card, { className: cn("w-full max-w-md mx-auto", className), children: /* @__PURE__ */ jsxs3("form", { onSubmit: handleSubmit, "data-testid": "login-form", children: [
|
|
426
528
|
/* @__PURE__ */ jsxs3(CardHeader, { className: "space-y-1", children: [
|
|
427
|
-
/* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ jsx7(CardTitle, { className: "text-2xl text-center", children: displayTitle }),
|
|
530
|
+
/* @__PURE__ */ jsx7(CardDescription, { className: "text-center", children: displaySubtitle })
|
|
429
531
|
] }),
|
|
430
532
|
/* @__PURE__ */ jsxs3(CardContent, { className: "space-y-4", children: [
|
|
431
|
-
error && /* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
533
|
+
error && /* @__PURE__ */ jsx7(Alert, { variant: "destructive", children: /* @__PURE__ */ jsx7(AlertDescription, { children: error }) }),
|
|
534
|
+
/* @__PURE__ */ jsx7(Label, { htmlFor: "email", children: "Email" }),
|
|
535
|
+
/* @__PURE__ */ jsx7(
|
|
434
536
|
Input,
|
|
435
537
|
{
|
|
436
538
|
id: "email",
|
|
@@ -442,8 +544,8 @@ var LoginForm = React5.memo(({
|
|
|
442
544
|
disabled: isLoading
|
|
443
545
|
}
|
|
444
546
|
),
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ jsx7(Label, { htmlFor: "password", children: "Password" }),
|
|
548
|
+
/* @__PURE__ */ jsx7(
|
|
447
549
|
Input,
|
|
448
550
|
{
|
|
449
551
|
id: "password",
|
|
@@ -457,7 +559,7 @@ var LoginForm = React5.memo(({
|
|
|
457
559
|
)
|
|
458
560
|
] }),
|
|
459
561
|
/* @__PURE__ */ jsxs3(CardFooter, { className: "flex flex-col space-y-4", children: [
|
|
460
|
-
/* @__PURE__ */
|
|
562
|
+
/* @__PURE__ */ jsx7(
|
|
461
563
|
Button,
|
|
462
564
|
{
|
|
463
565
|
type: "submit",
|
|
@@ -466,7 +568,7 @@ var LoginForm = React5.memo(({
|
|
|
466
568
|
children: isLoading ? "Signing in..." : "Sign In"
|
|
467
569
|
}
|
|
468
570
|
),
|
|
469
|
-
showSignUp && (onSignUp ? /* @__PURE__ */
|
|
571
|
+
showSignUp && (onSignUp ? /* @__PURE__ */ jsx7("div", { className: "text-sm text-center text-muted-foreground", children: /* @__PURE__ */ jsx7(
|
|
470
572
|
"button",
|
|
471
573
|
{
|
|
472
574
|
type: "button",
|
|
@@ -477,7 +579,7 @@ var LoginForm = React5.memo(({
|
|
|
477
579
|
) }) : /* @__PURE__ */ jsxs3("p", { className: "text-center text-muted-foreground", children: [
|
|
478
580
|
"Don't have an account?",
|
|
479
581
|
" ",
|
|
480
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ jsx7("a", { href: "/signup", className: "text-primary hover:underline", children: "Sign up" })
|
|
481
583
|
] }))
|
|
482
584
|
] })
|
|
483
585
|
] }) });
|
|
@@ -485,8 +587,9 @@ var LoginForm = React5.memo(({
|
|
|
485
587
|
|
|
486
588
|
// src/components/EventSelector/EventSelector.tsx
|
|
487
589
|
import { RefreshCw, AlertCircle, Lock, Calendar, Star } from "lucide-react";
|
|
590
|
+
init_logger();
|
|
488
591
|
import { useEffect, useMemo as useMemo2 } from "react";
|
|
489
|
-
import { jsx as
|
|
592
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
490
593
|
function EventSelector({
|
|
491
594
|
placeholder = "Select an event",
|
|
492
595
|
className,
|
|
@@ -504,7 +607,7 @@ function EventSelector({
|
|
|
504
607
|
setSelectedEvent,
|
|
505
608
|
refreshEvents
|
|
506
609
|
} = useEvents();
|
|
507
|
-
|
|
610
|
+
logger.debug("EventSelector", "Component render:", {
|
|
508
611
|
eventsCount: events.length,
|
|
509
612
|
events: events.map((e) => ({ id: e.event_id, name: e.event_name })),
|
|
510
613
|
selectedEvent: selectedEvent ? { id: selectedEvent.event_id, name: selectedEvent.event_name } : null,
|
|
@@ -582,15 +685,15 @@ function EventSelector({
|
|
|
582
685
|
}, [events, selectedEvent, setSelectedEvent, onEventChange, isLoading]);
|
|
583
686
|
if (isLoading) {
|
|
584
687
|
return /* @__PURE__ */ jsxs4("div", { className: `flex items-center gap-2 ${className}`, children: [
|
|
585
|
-
/* @__PURE__ */
|
|
586
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ jsx8(LoadingSpinner, { size: "sm" }),
|
|
689
|
+
/* @__PURE__ */ jsx8("span", { className: "text-sm text-muted-foreground", children: "Loading events..." })
|
|
587
690
|
] });
|
|
588
691
|
}
|
|
589
692
|
if (error) {
|
|
590
|
-
return /* @__PURE__ */
|
|
591
|
-
/* @__PURE__ */
|
|
693
|
+
return /* @__PURE__ */ jsx8("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "destructive", children: [
|
|
694
|
+
/* @__PURE__ */ jsx8(Lock, { className: "h-4 w-4" }),
|
|
592
695
|
/* @__PURE__ */ jsxs4(AlertDescription, { className: "flex items-center justify-between", children: [
|
|
593
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ jsx8("span", { children: error.message }),
|
|
594
697
|
showRetryButton && /* @__PURE__ */ jsxs4(
|
|
595
698
|
Button,
|
|
596
699
|
{
|
|
@@ -599,7 +702,7 @@ function EventSelector({
|
|
|
599
702
|
onClick: handleRetry,
|
|
600
703
|
className: "ml-2",
|
|
601
704
|
children: [
|
|
602
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ jsx8(RefreshCw, { className: "h-3 w-3 mr-1" }),
|
|
603
706
|
"Retry"
|
|
604
707
|
]
|
|
605
708
|
}
|
|
@@ -609,10 +712,10 @@ function EventSelector({
|
|
|
609
712
|
}
|
|
610
713
|
if (events.length === 0) {
|
|
611
714
|
if (showNoEventsMessage) {
|
|
612
|
-
return /* @__PURE__ */
|
|
613
|
-
/* @__PURE__ */
|
|
715
|
+
return /* @__PURE__ */ jsx8("div", { className, children: /* @__PURE__ */ jsxs4(Alert, { variant: "inline", children: [
|
|
716
|
+
/* @__PURE__ */ jsx8(AlertCircle, { className: "h-4 w-4 text-acc-700" }),
|
|
614
717
|
/* @__PURE__ */ jsxs4(AlertDescription, { className: "flex items-center justify-between", children: [
|
|
615
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ jsx8("span", { children: "No events available." }),
|
|
616
719
|
showRetryButton && /* @__PURE__ */ jsxs4(
|
|
617
720
|
Button,
|
|
618
721
|
{
|
|
@@ -621,7 +724,7 @@ function EventSelector({
|
|
|
621
724
|
onClick: handleRetry,
|
|
622
725
|
className: "ml-2",
|
|
623
726
|
children: [
|
|
624
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ jsx8(RefreshCw, { className: "h-3 w-3 mr-1" }),
|
|
625
728
|
"Refresh"
|
|
626
729
|
]
|
|
627
730
|
}
|
|
@@ -638,34 +741,34 @@ function EventSelector({
|
|
|
638
741
|
onValueChange: handleValueChange,
|
|
639
742
|
className,
|
|
640
743
|
children: [
|
|
641
|
-
/* @__PURE__ */
|
|
642
|
-
/* @__PURE__ */
|
|
643
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ jsx8(SelectTrigger, { className: "text-left", variant: "outline", children: /* @__PURE__ */ jsx8(SelectValue, { placeholder, children: selectedEvent && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
745
|
+
/* @__PURE__ */ jsx8(Calendar, { className: "h-4 w-4 flex-shrink-0" }),
|
|
746
|
+
/* @__PURE__ */ jsx8("span", { className: "truncate", children: selectedEvent.event_name || selectedEvent.name }),
|
|
644
747
|
selectedEvent.event_date && /* @__PURE__ */ jsxs4("span", { className: "text-xs text-muted-foreground flex-shrink-0", children: [
|
|
645
748
|
"(",
|
|
646
749
|
formatEventDate(selectedEvent.event_date),
|
|
647
750
|
")"
|
|
648
751
|
] })
|
|
649
752
|
] }) }) }),
|
|
650
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ jsx8(SelectContent, { children: sortedEvents.map((event) => {
|
|
651
754
|
const isNext = isNextEvent(event);
|
|
652
755
|
const isSelected = selectedEvent && (selectedEvent.event_id === event.event_id || selectedEvent.id === event.id);
|
|
653
|
-
return /* @__PURE__ */
|
|
756
|
+
return /* @__PURE__ */ jsx8(
|
|
654
757
|
SelectItem,
|
|
655
758
|
{
|
|
656
759
|
value: event.event_id || event.id,
|
|
657
760
|
className: "flex items-center justify-between",
|
|
658
761
|
children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 w-full", children: [
|
|
659
|
-
showNextEventIndicator && isNext && /* @__PURE__ */
|
|
762
|
+
showNextEventIndicator && isNext && /* @__PURE__ */ jsx8(Star, { className: "h-3 w-3 text-acc-500" }),
|
|
660
763
|
/* @__PURE__ */ jsxs4("div", { className: "flex-1", children: [
|
|
661
764
|
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
-
isSelected && /* @__PURE__ */
|
|
765
|
+
/* @__PURE__ */ jsx8("span", { className: isSelected ? "font-semibold" : "", children: event.event_name || event.name }),
|
|
766
|
+
isSelected && /* @__PURE__ */ jsx8("span", { className: "text-xs bg-primary text-primary-foreground px-1 rounded", children: "Current" })
|
|
664
767
|
] }),
|
|
665
768
|
showEventDetails && event.event_date && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
/* @__PURE__ */
|
|
668
|
-
showNextEventIndicator && isNext && /* @__PURE__ */
|
|
769
|
+
/* @__PURE__ */ jsx8(Calendar, { className: "h-3 w-3" }),
|
|
770
|
+
/* @__PURE__ */ jsx8("span", { children: formatEventDate(event.event_date) }),
|
|
771
|
+
showNextEventIndicator && isNext && /* @__PURE__ */ jsx8("span", { className: "text-acc-600 font-medium", children: "(Next)" })
|
|
669
772
|
] }),
|
|
670
773
|
showEventDetails && event.event_venue && /* @__PURE__ */ jsxs4("div", { className: "text-xs text-muted-foreground", children: [
|
|
671
774
|
"\u{1F4CD} ",
|
|
@@ -684,7 +787,7 @@ function EventSelector({
|
|
|
684
787
|
|
|
685
788
|
// src/components/PasswordReset/PasswordChangeForm.tsx
|
|
686
789
|
import { useState as useState2 } from "react";
|
|
687
|
-
import { jsx as
|
|
790
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
688
791
|
function PasswordChangeForm({ onSubmit, className }) {
|
|
689
792
|
const [newPassword, setNewPassword] = useState2("");
|
|
690
793
|
const [confirmPassword, setConfirmPassword] = useState2("");
|
|
@@ -714,10 +817,10 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
714
817
|
}
|
|
715
818
|
};
|
|
716
819
|
return /* @__PURE__ */ jsxs5("form", { onSubmit: handleSubmit, className: cn("space-y-4", className), children: [
|
|
717
|
-
error && /* @__PURE__ */
|
|
820
|
+
error && /* @__PURE__ */ jsx9("div", { role: "alert", children: error }),
|
|
718
821
|
/* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ jsx9(Label, { htmlFor: "new-password", children: "New Password" }),
|
|
823
|
+
/* @__PURE__ */ jsx9(
|
|
721
824
|
Input,
|
|
722
825
|
{
|
|
723
826
|
id: "new-password",
|
|
@@ -730,8 +833,8 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
730
833
|
)
|
|
731
834
|
] }),
|
|
732
835
|
/* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
733
|
-
/* @__PURE__ */
|
|
734
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ jsx9(Label, { htmlFor: "confirm-password", children: "Confirm Password" }),
|
|
837
|
+
/* @__PURE__ */ jsx9(
|
|
735
838
|
Input,
|
|
736
839
|
{
|
|
737
840
|
id: "confirm-password",
|
|
@@ -743,7 +846,7 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
743
846
|
}
|
|
744
847
|
)
|
|
745
848
|
] }),
|
|
746
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ jsx9(
|
|
747
850
|
Button,
|
|
748
851
|
{
|
|
749
852
|
type: "submit",
|
|
@@ -756,10 +859,10 @@ function PasswordChangeForm({ onSubmit, className }) {
|
|
|
756
859
|
}
|
|
757
860
|
|
|
758
861
|
// src/components/UserMenu/UserMenu.tsx
|
|
759
|
-
import
|
|
862
|
+
import React8, { useCallback as useCallback2, useMemo as useMemo3, useState as useState3 } from "react";
|
|
760
863
|
import { ChevronDown, LogOut, KeyRound } from "lucide-react";
|
|
761
|
-
import { jsx as
|
|
762
|
-
var UserMenu =
|
|
864
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
865
|
+
var UserMenu = React8.memo(function UserMenu2({
|
|
763
866
|
user,
|
|
764
867
|
onSignOut,
|
|
765
868
|
onChangePassword,
|
|
@@ -784,34 +887,34 @@ var UserMenu = React7.memo(function UserMenu2({
|
|
|
784
887
|
}
|
|
785
888
|
return /* @__PURE__ */ jsxs6(Dialog, { open: isPasswordDialogOpen, onOpenChange: setPasswordDialogOpen, children: [
|
|
786
889
|
/* @__PURE__ */ jsxs6(Select, { className, children: [
|
|
787
|
-
/* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ jsx10(SelectTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(Button, { variant: "outline", className: "flex items-center gap-2", "aria-label": userInfo.displayName, children: [
|
|
788
891
|
showAvatar && /* @__PURE__ */ jsxs6(Avatar, { className: "size-7", children: [
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
892
|
+
/* @__PURE__ */ jsx10(AvatarImage, { src: userInfo.avatarUrl, alt: userInfo.displayName }),
|
|
893
|
+
/* @__PURE__ */ jsx10(AvatarFallback, { children: userInfo.initial })
|
|
791
894
|
] }),
|
|
792
|
-
/* @__PURE__ */
|
|
793
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ jsx10("span", { children: userInfo.displayName }),
|
|
896
|
+
/* @__PURE__ */ jsx10(ChevronDown, { className: "h-4 w-4" })
|
|
794
897
|
] }) }),
|
|
795
898
|
/* @__PURE__ */ jsxs6(SelectContent, { children: [
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ jsx10(SelectLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col space-y-1", children: [
|
|
900
|
+
/* @__PURE__ */ jsx10("p", { className: "font-medium", children: userInfo.displayName }),
|
|
901
|
+
/* @__PURE__ */ jsx10("p", { className: "text-muted-foreground", children: userInfo.email })
|
|
799
902
|
] }) }),
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
802
|
-
/* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ jsx10(SelectSeparator, {}),
|
|
904
|
+
/* @__PURE__ */ jsx10(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs6(SelectItem, { value: "change-password", children: [
|
|
905
|
+
/* @__PURE__ */ jsx10(KeyRound, { className: "mr-2 h-4 w-4" }),
|
|
906
|
+
/* @__PURE__ */ jsx10("span", { children: "Change Password" })
|
|
804
907
|
] }) }),
|
|
805
908
|
/* @__PURE__ */ jsxs6(SelectItem, { value: "sign-out", onClick: handleSignOut, children: [
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
/* @__PURE__ */
|
|
909
|
+
/* @__PURE__ */ jsx10(LogOut, { className: "mr-2 h-4 w-4" }),
|
|
910
|
+
/* @__PURE__ */ jsx10("span", { children: "Sign out" })
|
|
808
911
|
] })
|
|
809
912
|
] })
|
|
810
913
|
] }),
|
|
811
|
-
/* @__PURE__ */
|
|
914
|
+
/* @__PURE__ */ jsx10(DialogOverlay, {}),
|
|
812
915
|
/* @__PURE__ */ jsxs6(DialogContent, { className, children: [
|
|
813
|
-
/* @__PURE__ */
|
|
814
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ jsx10(DialogHeader, { children: /* @__PURE__ */ jsx10(DialogTitle, { children: "Change Password" }) }),
|
|
917
|
+
/* @__PURE__ */ jsx10(
|
|
815
918
|
PasswordChangeForm,
|
|
816
919
|
{
|
|
817
920
|
onSubmit: async ({ newPassword, confirmPassword }) => {
|
|
@@ -829,7 +932,7 @@ var UserMenu = React7.memo(function UserMenu2({
|
|
|
829
932
|
] })
|
|
830
933
|
] });
|
|
831
934
|
});
|
|
832
|
-
var UserMenuLoading =
|
|
935
|
+
var UserMenuLoading = React8.memo(function UserMenuLoading2() {
|
|
833
936
|
return /* @__PURE__ */ jsxs6("div", { className: "relative inline-block text-left", children: [
|
|
834
937
|
/* @__PURE__ */ jsxs6(
|
|
835
938
|
"button",
|
|
@@ -838,23 +941,24 @@ var UserMenuLoading = React7.memo(function UserMenuLoading2() {
|
|
|
838
941
|
disabled: true,
|
|
839
942
|
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",
|
|
840
943
|
children: [
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
/* @__PURE__ */
|
|
843
|
-
/* @__PURE__ */
|
|
944
|
+
/* @__PURE__ */ jsx10("div", { className: "w-6 h-6 rounded-full bg-muted animate-pulse" }),
|
|
945
|
+
/* @__PURE__ */ jsx10("span", { className: "truncate max-w-[150px]", children: "Loading..." }),
|
|
946
|
+
/* @__PURE__ */ jsx10(ChevronDown, { className: "w-4 h-4 text-muted-foreground" })
|
|
844
947
|
]
|
|
845
948
|
}
|
|
846
949
|
),
|
|
847
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ jsx10("div", { role: "status", "aria-label": "Loading user menu", "aria-live": "polite", className: "w-6 h-6 rounded-full bg-muted animate-pulse" })
|
|
848
951
|
] });
|
|
849
952
|
});
|
|
850
953
|
UserMenu.Loading = UserMenuLoading;
|
|
851
954
|
|
|
852
955
|
// src/components/NavigationMenu/NavigationMenu.tsx
|
|
853
|
-
import * as
|
|
956
|
+
import * as React9 from "react";
|
|
854
957
|
import { ChevronDown as ChevronDown2 } from "lucide-react";
|
|
855
958
|
init_UnifiedAuthProvider2();
|
|
856
|
-
|
|
857
|
-
|
|
959
|
+
init_logger();
|
|
960
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
961
|
+
var NavigationMenu = React9.forwardRef(({
|
|
858
962
|
items,
|
|
859
963
|
mode = "dropdown",
|
|
860
964
|
currentPath,
|
|
@@ -872,19 +976,19 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
872
976
|
filterByPermissions = true,
|
|
873
977
|
...props
|
|
874
978
|
}, ref) => {
|
|
875
|
-
const [expandedItems, setExpandedItems] =
|
|
876
|
-
const buttonRef =
|
|
979
|
+
const [expandedItems, setExpandedItems] = React9.useState(/* @__PURE__ */ new Set());
|
|
980
|
+
const buttonRef = React9.useRef(null);
|
|
877
981
|
let authContext = null;
|
|
878
982
|
try {
|
|
879
983
|
authContext = useUnifiedAuth();
|
|
880
984
|
} catch (error) {
|
|
881
|
-
|
|
985
|
+
logger.warn("NavigationMenu", "useUnifiedAuth not available, running in unauthenticated mode");
|
|
882
986
|
}
|
|
883
987
|
let rbacContext = null;
|
|
884
988
|
try {
|
|
885
989
|
rbacContext = useRBAC();
|
|
886
990
|
} catch (error) {
|
|
887
|
-
|
|
991
|
+
logger.warn("NavigationMenu", "useRBAC not available, permission filtering disabled");
|
|
888
992
|
}
|
|
889
993
|
const { supabase } = authContext || {};
|
|
890
994
|
const { selectedOrganisation } = authContext || {};
|
|
@@ -894,7 +998,7 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
894
998
|
selectedOrganisationId: selectedOrganisation?.id || null,
|
|
895
999
|
selectedEventId: selectedEvent?.event_id || null
|
|
896
1000
|
});
|
|
897
|
-
const stableScopeRef =
|
|
1001
|
+
const stableScopeRef = React9.useRef({
|
|
898
1002
|
organisationId: "",
|
|
899
1003
|
eventId: void 0,
|
|
900
1004
|
appId: void 0
|
|
@@ -925,8 +1029,8 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
925
1029
|
userId,
|
|
926
1030
|
stableScope
|
|
927
1031
|
);
|
|
928
|
-
const previousFilteredItemsRef =
|
|
929
|
-
const filteredItems =
|
|
1032
|
+
const previousFilteredItemsRef = React9.useRef([]);
|
|
1033
|
+
const filteredItems = React9.useMemo(() => {
|
|
930
1034
|
if (filterByPermissions) {
|
|
931
1035
|
if (!authContext || !rbacContext || scopeLoading || !resolvedScope?.organisationId) {
|
|
932
1036
|
return [];
|
|
@@ -938,7 +1042,7 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
938
1042
|
return [];
|
|
939
1043
|
}
|
|
940
1044
|
if (permissionsError || !permissionMap || Object.keys(permissionMap).length === 0) {
|
|
941
|
-
|
|
1045
|
+
logger.warn("NavigationMenu", "Permission map is empty or has error - showing no items for security", {
|
|
942
1046
|
permissionsError: permissionsError?.message,
|
|
943
1047
|
permissionMapSize: permissionMap ? Object.keys(permissionMap).length : 0
|
|
944
1048
|
});
|
|
@@ -1017,7 +1121,7 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
1017
1121
|
const finalHasPermission = isSuperAdmin2 || hasPagePermission;
|
|
1018
1122
|
if (!finalHasPermission) {
|
|
1019
1123
|
if (auditLog) {
|
|
1020
|
-
|
|
1124
|
+
logger.debug("NavigationMenu", `Filtering out navigation item "${item.label}" - no page permission:`, {
|
|
1021
1125
|
itemId: item.id,
|
|
1022
1126
|
href: item.href,
|
|
1023
1127
|
pageId,
|
|
@@ -1065,9 +1169,9 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
1065
1169
|
resolvedScope,
|
|
1066
1170
|
auditLog
|
|
1067
1171
|
]);
|
|
1068
|
-
|
|
1172
|
+
React9.useEffect(() => {
|
|
1069
1173
|
if (auditLog && authContext) {
|
|
1070
|
-
|
|
1174
|
+
logger.debug("NavigationMenu", "Navigation access attempt:", {
|
|
1071
1175
|
itemId: "navigation-menu",
|
|
1072
1176
|
label: "Navigation Menu",
|
|
1073
1177
|
href: currentPath,
|
|
@@ -1108,7 +1212,7 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
1108
1212
|
};
|
|
1109
1213
|
const handleItemClick = (item) => {
|
|
1110
1214
|
if (auditLog) {
|
|
1111
|
-
|
|
1215
|
+
logger.debug("NavigationMenu", "Navigation access attempt:", {
|
|
1112
1216
|
itemId: item.id,
|
|
1113
1217
|
label: item.label,
|
|
1114
1218
|
href: item.href,
|
|
@@ -1160,7 +1264,7 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
1160
1264
|
onNavigationAccessDenied(item.id, "Insufficient permissions");
|
|
1161
1265
|
}
|
|
1162
1266
|
if (strictMode) {
|
|
1163
|
-
|
|
1267
|
+
logger.error("NavigationMenu", "STRICT MODE VIOLATION: User attempted to access protected navigation item without permission", {
|
|
1164
1268
|
itemId: item.id,
|
|
1165
1269
|
label: item.label,
|
|
1166
1270
|
href: item.href,
|
|
@@ -1199,7 +1303,7 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
1199
1303
|
const hasChildren = item.children && item.children.length > 0;
|
|
1200
1304
|
const isExpanded = expandedItems.has(item.id);
|
|
1201
1305
|
const itemIsActive = isActiveItem(item);
|
|
1202
|
-
return /* @__PURE__ */
|
|
1306
|
+
return /* @__PURE__ */ jsx11("li", { role: "none", children: hasChildren ? /* @__PURE__ */ jsxs7("div", { children: [
|
|
1203
1307
|
/* @__PURE__ */ jsxs7(
|
|
1204
1308
|
"button",
|
|
1205
1309
|
{
|
|
@@ -1209,21 +1313,21 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
1209
1313
|
"aria-controls": `submenu-${item.id}`,
|
|
1210
1314
|
"aria-current": itemIsActive ? "page" : void 0,
|
|
1211
1315
|
children: [
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
/* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ jsx11("span", { children: item.label }),
|
|
1317
|
+
/* @__PURE__ */ jsx11(ChevronDown2, { "aria-hidden": "true" })
|
|
1214
1318
|
]
|
|
1215
1319
|
}
|
|
1216
1320
|
),
|
|
1217
|
-
isExpanded && item.children && /* @__PURE__ */
|
|
1321
|
+
isExpanded && item.children && /* @__PURE__ */ jsx11(
|
|
1218
1322
|
"ul",
|
|
1219
1323
|
{
|
|
1220
1324
|
id: `submenu-${item.id}`,
|
|
1221
1325
|
role: "menu",
|
|
1222
1326
|
"aria-label": `${item.label} submenu`,
|
|
1223
|
-
children: item.children.map((child) => /* @__PURE__ */
|
|
1327
|
+
children: item.children.map((child) => /* @__PURE__ */ jsx11(React9.Fragment, { children: renderHierarchicalItem(child, level + 1) }, child.id))
|
|
1224
1328
|
}
|
|
1225
1329
|
)
|
|
1226
|
-
] }) : /* @__PURE__ */
|
|
1330
|
+
] }) : /* @__PURE__ */ jsx11(
|
|
1227
1331
|
"a",
|
|
1228
1332
|
{
|
|
1229
1333
|
href: item.href || "#",
|
|
@@ -1248,19 +1352,19 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
1248
1352
|
className,
|
|
1249
1353
|
"data-testid": "navigation-menu-root",
|
|
1250
1354
|
children: [
|
|
1251
|
-
/* @__PURE__ */
|
|
1355
|
+
/* @__PURE__ */ jsx11(
|
|
1252
1356
|
SelectTrigger,
|
|
1253
1357
|
{
|
|
1254
1358
|
ref: buttonRef,
|
|
1255
1359
|
disabled,
|
|
1256
1360
|
"aria-label": buttonText,
|
|
1257
1361
|
"data-testid": "navigation-menu-trigger",
|
|
1258
|
-
children: /* @__PURE__ */
|
|
1362
|
+
children: /* @__PURE__ */ jsx11(SelectValue, { placeholder: buttonText })
|
|
1259
1363
|
}
|
|
1260
1364
|
),
|
|
1261
|
-
/* @__PURE__ */
|
|
1365
|
+
/* @__PURE__ */ jsx11(SelectContent, { children: filteredItems.map((item) => {
|
|
1262
1366
|
const isActive = isActiveItem(item);
|
|
1263
|
-
return /* @__PURE__ */
|
|
1367
|
+
return /* @__PURE__ */ jsx11(
|
|
1264
1368
|
SelectItem,
|
|
1265
1369
|
{
|
|
1266
1370
|
value: item.id,
|
|
@@ -1275,14 +1379,14 @@ var NavigationMenu = React8.forwardRef(({
|
|
|
1275
1379
|
}
|
|
1276
1380
|
);
|
|
1277
1381
|
}
|
|
1278
|
-
return /* @__PURE__ */
|
|
1382
|
+
return /* @__PURE__ */ jsx11(
|
|
1279
1383
|
"nav",
|
|
1280
1384
|
{
|
|
1281
1385
|
ref,
|
|
1282
1386
|
className,
|
|
1283
1387
|
"aria-label": navigationLabel,
|
|
1284
1388
|
...props,
|
|
1285
|
-
children: /* @__PURE__ */
|
|
1389
|
+
children: /* @__PURE__ */ jsx11("ul", { role: "menubar", children: filteredItems.map((item) => /* @__PURE__ */ jsx11(React9.Fragment, { children: renderHierarchicalItem(item, 0) }, item.id)) })
|
|
1286
1390
|
}
|
|
1287
1391
|
);
|
|
1288
1392
|
});
|
|
@@ -1290,7 +1394,7 @@ NavigationMenu.displayName = "NavigationMenu";
|
|
|
1290
1394
|
|
|
1291
1395
|
// src/components/Header/Header.tsx
|
|
1292
1396
|
import { Link } from "react-router-dom";
|
|
1293
|
-
import { jsx as
|
|
1397
|
+
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1294
1398
|
function Header({
|
|
1295
1399
|
logoUrl,
|
|
1296
1400
|
logoAlt = "Logo",
|
|
@@ -1308,32 +1412,32 @@ function Header({
|
|
|
1308
1412
|
onNavigate,
|
|
1309
1413
|
logoHref
|
|
1310
1414
|
}) {
|
|
1311
|
-
return /* @__PURE__ */
|
|
1415
|
+
return /* @__PURE__ */ jsx12("header", { className: cn(
|
|
1312
1416
|
"w-full border-b border-main-200 h-16 shadow-sm bg-main-100 ",
|
|
1313
1417
|
className
|
|
1314
1418
|
), role: "banner", children: /* @__PURE__ */ jsxs8("nav", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto grid grid-cols-[auto_auto_1fr_auto] gap-4 h-full items-center", children: [
|
|
1315
|
-
logo ? logoHref ? /* @__PURE__ */
|
|
1419
|
+
logo ? logoHref ? /* @__PURE__ */ jsx12(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: logo }) : logo : logoUrl ? logoHref ? /* @__PURE__ */ jsx12(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx12(
|
|
1316
1420
|
"img",
|
|
1317
1421
|
{
|
|
1318
1422
|
src: logoUrl,
|
|
1319
1423
|
alt: logoAlt || "Logo",
|
|
1320
1424
|
className: "h-[2.15rem] w-auto max-w-[200px] object-contain rounded-md shadow-md bg-transparent"
|
|
1321
1425
|
}
|
|
1322
|
-
) }) : /* @__PURE__ */
|
|
1426
|
+
) }) : /* @__PURE__ */ jsx12(
|
|
1323
1427
|
"img",
|
|
1324
1428
|
{
|
|
1325
1429
|
src: logoUrl,
|
|
1326
1430
|
alt: logoAlt || "Logo",
|
|
1327
1431
|
className: "h-[2.15rem] w-auto max-w-[200px] object-contain rounded-md shadow-md bg-transparent"
|
|
1328
1432
|
}
|
|
1329
|
-
) : logoHref ? /* @__PURE__ */
|
|
1433
|
+
) : logoHref ? /* @__PURE__ */ jsx12(Link, { to: logoHref, className: "cursor-pointer hover:opacity-80 transition-opacity", children: /* @__PURE__ */ jsx12(
|
|
1330
1434
|
"img",
|
|
1331
1435
|
{
|
|
1332
1436
|
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",
|
|
1333
1437
|
alt: logoAlt || "Logo",
|
|
1334
1438
|
className: "h-8 w-8 shadow-md"
|
|
1335
1439
|
}
|
|
1336
|
-
) }) : /* @__PURE__ */
|
|
1440
|
+
) }) : /* @__PURE__ */ jsx12(
|
|
1337
1441
|
"img",
|
|
1338
1442
|
{
|
|
1339
1443
|
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",
|
|
@@ -1341,7 +1445,7 @@ function Header({
|
|
|
1341
1445
|
className: "h-8 w-8 shadow-md"
|
|
1342
1446
|
}
|
|
1343
1447
|
),
|
|
1344
|
-
navItems && navItems.length > 0 && /* @__PURE__ */
|
|
1448
|
+
navItems && navItems.length > 0 && /* @__PURE__ */ jsx12(
|
|
1345
1449
|
NavigationMenu,
|
|
1346
1450
|
{
|
|
1347
1451
|
items: navItems,
|
|
@@ -1351,16 +1455,16 @@ function Header({
|
|
|
1351
1455
|
className: "w-48"
|
|
1352
1456
|
}
|
|
1353
1457
|
),
|
|
1354
|
-
showEventSelector ? /* @__PURE__ */
|
|
1458
|
+
showEventSelector ? /* @__PURE__ */ jsx12(
|
|
1355
1459
|
EventSelector,
|
|
1356
1460
|
{
|
|
1357
1461
|
placeholder: "Select event",
|
|
1358
1462
|
className: "justify-self-end w-96",
|
|
1359
1463
|
"data-testid": "event-selector"
|
|
1360
1464
|
}
|
|
1361
|
-
) : /* @__PURE__ */
|
|
1465
|
+
) : /* @__PURE__ */ jsx12("del", { className: "justify-self-end invisible", children: "Event Selector N/A" }),
|
|
1362
1466
|
actions,
|
|
1363
|
-
showUserMenu && (userMenu ? userMenu : /* @__PURE__ */
|
|
1467
|
+
showUserMenu && (userMenu ? userMenu : /* @__PURE__ */ jsx12(
|
|
1364
1468
|
UserMenu,
|
|
1365
1469
|
{
|
|
1366
1470
|
user: user || null,
|
|
@@ -1373,8 +1477,8 @@ function Header({
|
|
|
1373
1477
|
}
|
|
1374
1478
|
|
|
1375
1479
|
// src/components/Footer/Footer.tsx
|
|
1376
|
-
import
|
|
1377
|
-
import { Fragment as Fragment3, jsx as
|
|
1480
|
+
import React10 from "react";
|
|
1481
|
+
import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1378
1482
|
var FooterComponent = ({
|
|
1379
1483
|
companyName = "Solvera Solutions Pty Ltd",
|
|
1380
1484
|
year = (/* @__PURE__ */ new Date()).getFullYear(),
|
|
@@ -1385,15 +1489,15 @@ var FooterComponent = ({
|
|
|
1385
1489
|
children
|
|
1386
1490
|
}) => {
|
|
1387
1491
|
const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
|
|
1388
|
-
return /* @__PURE__ */
|
|
1389
|
-
logo && /* @__PURE__ */
|
|
1390
|
-
children && /* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
links && links.length > 0 && /* @__PURE__ */
|
|
1492
|
+
return /* @__PURE__ */ jsx13("footer", { className: cn("mt-8 py-6 flex justify-center border-t border-border bg-main-100", className), children: /* @__PURE__ */ jsxs9("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
|
|
1493
|
+
logo && /* @__PURE__ */ jsx13("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
|
|
1494
|
+
children && /* @__PURE__ */ jsx13(Fragment3, { children }),
|
|
1495
|
+
/* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: copyrightText }),
|
|
1496
|
+
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)) })
|
|
1393
1497
|
] }) });
|
|
1394
1498
|
};
|
|
1395
1499
|
FooterComponent.displayName = "Footer";
|
|
1396
|
-
var Footer =
|
|
1500
|
+
var Footer = React10.memo(FooterComponent);
|
|
1397
1501
|
Footer.displayName = "Footer";
|
|
1398
1502
|
|
|
1399
1503
|
// src/components/PaceAppLayout/PaceAppLayout.tsx
|
|
@@ -1401,7 +1505,8 @@ init_UnifiedAuthProvider2();
|
|
|
1401
1505
|
init_useOrganisations();
|
|
1402
1506
|
import { useState as useState5, useEffect as useEffect3, useMemo as useMemo5 } from "react";
|
|
1403
1507
|
import { Outlet, useNavigate, useLocation } from "react-router-dom";
|
|
1404
|
-
|
|
1508
|
+
init_logger();
|
|
1509
|
+
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1405
1510
|
var EMPTY_PAGE_ID_MAPPING = {};
|
|
1406
1511
|
var EMPTY_ROUTE_PERMISSIONS = {};
|
|
1407
1512
|
function PaceAppLayout({
|
|
@@ -1501,7 +1606,7 @@ function PaceAppLayout({
|
|
|
1501
1606
|
const superAdminStatus = await isSuperAdmin(user.id);
|
|
1502
1607
|
setIsSuperAdminUser(superAdminStatus);
|
|
1503
1608
|
} catch (error) {
|
|
1504
|
-
|
|
1609
|
+
logger.error("PaceAppLayout", "Error checking super admin status", { userId: user?.id, error });
|
|
1505
1610
|
setIsSuperAdminUser(false);
|
|
1506
1611
|
} finally {
|
|
1507
1612
|
setIsCheckingSuperAdmin(false);
|
|
@@ -1527,7 +1632,7 @@ function PaceAppLayout({
|
|
|
1527
1632
|
return;
|
|
1528
1633
|
}
|
|
1529
1634
|
if (strictMode && !isSuperAdminUser && !can) {
|
|
1530
|
-
|
|
1635
|
+
logger.error("PaceAppLayout", "STRICT MODE VIOLATION: User attempted to access protected page without permission", {
|
|
1531
1636
|
pageName: currentPageId,
|
|
1532
1637
|
operation: currentRoutePermission,
|
|
1533
1638
|
userId: user?.id,
|
|
@@ -1562,7 +1667,7 @@ function PaceAppLayout({
|
|
|
1562
1667
|
appId: user.user_metadata?.appId || user.app_metadata?.appId
|
|
1563
1668
|
};
|
|
1564
1669
|
try {
|
|
1565
|
-
const { isSuperAdmin: isSuperAdmin2 } = await import("./api-
|
|
1670
|
+
const { isSuperAdmin: isSuperAdmin2 } = await import("./api-45XYYO2A.js");
|
|
1566
1671
|
const isSuper = await isSuperAdmin2(user.id);
|
|
1567
1672
|
if (isSuper) {
|
|
1568
1673
|
if (isMounted) {
|
|
@@ -1583,7 +1688,7 @@ function PaceAppLayout({
|
|
|
1583
1688
|
return;
|
|
1584
1689
|
}
|
|
1585
1690
|
try {
|
|
1586
|
-
const { getPermissionMap } = await import("./api-
|
|
1691
|
+
const { getPermissionMap } = await import("./api-45XYYO2A.js");
|
|
1587
1692
|
const permissionMap = await getPermissionMap({
|
|
1588
1693
|
userId: user.id,
|
|
1589
1694
|
scope: scope2
|
|
@@ -1600,7 +1705,7 @@ function PaceAppLayout({
|
|
|
1600
1705
|
const accessibleItems = filtered.filter(({ hasAccess }) => hasAccess).map(({ item }) => item);
|
|
1601
1706
|
setFilteredMenuItems(accessibleItems);
|
|
1602
1707
|
} catch (error) {
|
|
1603
|
-
|
|
1708
|
+
logger.error("PaceAppLayout", "Failed to load permission map for navigation filtering", { userId: user?.id, error });
|
|
1604
1709
|
if (isMounted) {
|
|
1605
1710
|
setFilteredMenuItems(baseMenuItems);
|
|
1606
1711
|
}
|
|
@@ -1619,7 +1724,7 @@ function PaceAppLayout({
|
|
|
1619
1724
|
const currentRoute = routeConfig.find((route) => route.path === currentPath);
|
|
1620
1725
|
if (!currentRoute) {
|
|
1621
1726
|
if (strictMode) {
|
|
1622
|
-
|
|
1727
|
+
logger.error("PaceAppLayout", "STRICT MODE VIOLATION: Route not found in configuration", {
|
|
1623
1728
|
route: currentPath,
|
|
1624
1729
|
userId: user?.id,
|
|
1625
1730
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1633,7 +1738,7 @@ function PaceAppLayout({
|
|
|
1633
1738
|
let hasAccess = true;
|
|
1634
1739
|
if (currentRoute.pageId && currentRoute.permissions && currentRoute.permissions.length > 0) {
|
|
1635
1740
|
try {
|
|
1636
|
-
const { isPermittedCached } = await import("./api-
|
|
1741
|
+
const { isPermittedCached } = await import("./api-45XYYO2A.js");
|
|
1637
1742
|
const hasPagePermission = await isPermittedCached({
|
|
1638
1743
|
userId: user?.id || "",
|
|
1639
1744
|
scope,
|
|
@@ -1643,13 +1748,13 @@ function PaceAppLayout({
|
|
|
1643
1748
|
if (!isMounted) return;
|
|
1644
1749
|
hasAccess = hasPagePermission;
|
|
1645
1750
|
} catch (error) {
|
|
1646
|
-
|
|
1751
|
+
logger.error("PaceAppLayout", "Failed to check page permission", { route: currentPath, pageId: currentRoute.pageId, error });
|
|
1647
1752
|
if (!isMounted) return;
|
|
1648
1753
|
hasAccess = false;
|
|
1649
1754
|
}
|
|
1650
1755
|
}
|
|
1651
1756
|
if (hasAccess && currentRoute.roles && currentRoute.roles.length > 0 && user?.id) {
|
|
1652
|
-
const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-
|
|
1757
|
+
const { useUnifiedAuth: useUnifiedAuth2 } = await import("./UnifiedAuthProvider-XIQQ7LVU.js");
|
|
1653
1758
|
hasAccess = true;
|
|
1654
1759
|
}
|
|
1655
1760
|
if (!isMounted) return;
|
|
@@ -1658,7 +1763,7 @@ function PaceAppLayout({
|
|
|
1658
1763
|
onRouteAccessDenied(currentPath, "Insufficient permissions");
|
|
1659
1764
|
}
|
|
1660
1765
|
if (strictMode) {
|
|
1661
|
-
|
|
1766
|
+
logger.error("PaceAppLayout", "STRICT MODE VIOLATION: User attempted to access protected route without permission", {
|
|
1662
1767
|
route: currentPath,
|
|
1663
1768
|
userId: user?.id,
|
|
1664
1769
|
permissions: currentRoute.permissions,
|
|
@@ -1685,36 +1790,36 @@ function PaceAppLayout({
|
|
|
1685
1790
|
const handleChangePassword = async (newPassword) => {
|
|
1686
1791
|
const result = await updatePassword(newPassword);
|
|
1687
1792
|
if (result?.error) {
|
|
1688
|
-
|
|
1793
|
+
logger.error("PaceAppLayout", "Failed to change password", { error: result.error.message });
|
|
1689
1794
|
}
|
|
1690
1795
|
return result || { error: null };
|
|
1691
1796
|
};
|
|
1692
|
-
if (enforcePermissions && (isCheckingSuperAdmin || isCheckingPermission)
|
|
1693
|
-
return /* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */
|
|
1797
|
+
if (enforcePermissions && (isCheckingSuperAdmin || isCheckingPermission)) {
|
|
1798
|
+
return /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
|
|
1799
|
+
/* @__PURE__ */ jsx14("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-sec-900 mx-auto mb-4" }),
|
|
1800
|
+
/* @__PURE__ */ jsx14("p", { className: "text-sec-600", children: "Checking permissions..." })
|
|
1696
1801
|
] }) });
|
|
1697
1802
|
}
|
|
1698
|
-
if (enforcePermissions && permissionError && !
|
|
1699
|
-
return /* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1701
|
-
/* @__PURE__ */
|
|
1702
|
-
/* @__PURE__ */
|
|
1803
|
+
if (enforcePermissions && permissionError && !isSuperAdminUser) {
|
|
1804
|
+
return /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
|
|
1805
|
+
/* @__PURE__ */ jsx14("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Permission Error" }),
|
|
1806
|
+
/* @__PURE__ */ jsx14("p", { className: "text-sec-600 mb-4", children: permissionError.message }),
|
|
1807
|
+
/* @__PURE__ */ jsx14(Button, { onClick: () => navigate("/"), children: "Go Home" })
|
|
1703
1808
|
] }) });
|
|
1704
1809
|
}
|
|
1705
1810
|
if (enforcePermissions && hasPermission === false && !isCheckingSuperAdmin && !isSuperAdminUser) {
|
|
1706
1811
|
if (enforcePagePermissions && pagePermissionFallback) {
|
|
1707
|
-
return /* @__PURE__ */
|
|
1812
|
+
return /* @__PURE__ */ jsx14(Fragment4, { children: pagePermissionFallback });
|
|
1708
1813
|
}
|
|
1709
1814
|
if (permissionFallback) {
|
|
1710
|
-
return /* @__PURE__ */
|
|
1815
|
+
return /* @__PURE__ */ jsx14(Fragment4, { children: permissionFallback });
|
|
1711
1816
|
}
|
|
1712
|
-
return /* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
/* @__PURE__ */
|
|
1817
|
+
return /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsxs10("div", { className: "text-center", children: [
|
|
1818
|
+
/* @__PURE__ */ jsx14("h2", { className: "text-xl font-semibold text-acc-600 mb-2", children: "Access Denied" }),
|
|
1819
|
+
/* @__PURE__ */ jsx14("p", { className: "text-sec-600 mb-4", children: "You don't have permission to access this page." }),
|
|
1715
1820
|
/* @__PURE__ */ jsxs10("div", { className: "flex gap-2 justify-center", children: [
|
|
1716
|
-
/* @__PURE__ */
|
|
1717
|
-
/* @__PURE__ */
|
|
1821
|
+
/* @__PURE__ */ jsx14(Button, { onClick: () => navigate("/"), children: "Go Home" }),
|
|
1822
|
+
/* @__PURE__ */ jsx14(
|
|
1718
1823
|
Button,
|
|
1719
1824
|
{
|
|
1720
1825
|
variant: "outline",
|
|
@@ -1729,7 +1834,7 @@ function PaceAppLayout({
|
|
|
1729
1834
|
] }) });
|
|
1730
1835
|
}
|
|
1731
1836
|
return /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
1732
|
-
/* @__PURE__ */
|
|
1837
|
+
/* @__PURE__ */ jsx14(
|
|
1733
1838
|
Header,
|
|
1734
1839
|
{
|
|
1735
1840
|
logo: customLogo || void 0,
|
|
@@ -1753,8 +1858,8 @@ function PaceAppLayout({
|
|
|
1753
1858
|
className: headerClassName || "sticky top-0 z-[40] w-full"
|
|
1754
1859
|
}
|
|
1755
1860
|
),
|
|
1756
|
-
/* @__PURE__ */
|
|
1757
|
-
/* @__PURE__ */
|
|
1861
|
+
/* @__PURE__ */ jsx14("main", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: /* @__PURE__ */ jsx14(Outlet, {}) }),
|
|
1862
|
+
/* @__PURE__ */ jsx14(Footer, {})
|
|
1758
1863
|
] });
|
|
1759
1864
|
}
|
|
1760
1865
|
|
|
@@ -1762,10 +1867,11 @@ function PaceAppLayout({
|
|
|
1762
1867
|
import { useEffect as useEffect4, useState as useState6, useContext } from "react";
|
|
1763
1868
|
import { useNavigate as useNavigate2, useLocation as useLocation2 } from "react-router-dom";
|
|
1764
1869
|
init_EventServiceProvider();
|
|
1765
|
-
|
|
1870
|
+
init_logger();
|
|
1871
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1766
1872
|
var PaceLoginPage = ({
|
|
1767
1873
|
appName = "Pace",
|
|
1768
|
-
onSuccessRedirectPath = "/",
|
|
1874
|
+
onSuccessRedirectPath = "/user-dashboard",
|
|
1769
1875
|
requireAppAccess = false
|
|
1770
1876
|
}) => {
|
|
1771
1877
|
const { signIn, isAuthenticated, isLoading, authError, user, supabase } = useUnifiedAuth();
|
|
@@ -1793,7 +1899,7 @@ var PaceLoginPage = ({
|
|
|
1793
1899
|
await eventService.restorePersistedEvent();
|
|
1794
1900
|
}
|
|
1795
1901
|
} catch (error) {
|
|
1796
|
-
|
|
1902
|
+
logger.debug("PaceLoginPage", "Could not restore persisted event (service may not be ready):", error);
|
|
1797
1903
|
}
|
|
1798
1904
|
};
|
|
1799
1905
|
const timeoutId = setTimeout(() => {
|
|
@@ -1810,31 +1916,31 @@ var PaceLoginPage = ({
|
|
|
1810
1916
|
setAccessError(null);
|
|
1811
1917
|
try {
|
|
1812
1918
|
const userId = user.id;
|
|
1813
|
-
|
|
1919
|
+
logger.debug("PaceLoginPage", "Checking app access using RBAC:", { appName, userId });
|
|
1814
1920
|
const superAdminCheck = await isSuperAdmin(userId);
|
|
1815
1921
|
if (superAdminCheck) {
|
|
1816
|
-
|
|
1922
|
+
logger.debug("PaceLoginPage", "User is super admin, granting access");
|
|
1817
1923
|
setIsCheckingAccess(false);
|
|
1818
1924
|
navigate(onSuccessRedirectPath, { replace: true });
|
|
1819
1925
|
return;
|
|
1820
1926
|
}
|
|
1821
1927
|
const { data: appData, error: appError } = await supabase.from("rbac_apps").select("id, name, is_active").eq("name", appName).eq("is_active", true).single();
|
|
1822
1928
|
if (appError || !appData) {
|
|
1823
|
-
|
|
1929
|
+
logger.error("PaceLoginPage", "App not found:", { appName, error: appError });
|
|
1824
1930
|
setAccessError(`Application "${appName}" is not configured. Please contact your administrator.`);
|
|
1825
1931
|
setIsCheckingAccess(false);
|
|
1826
1932
|
return;
|
|
1827
1933
|
}
|
|
1828
1934
|
const { data: pagesData, error: pagesError } = await supabase.from("rbac_app_pages").select("id, page_name").eq("app_id", appData.id);
|
|
1829
1935
|
if (pagesError || !pagesData || pagesData.length === 0) {
|
|
1830
|
-
|
|
1936
|
+
logger.debug("PaceLoginPage", "No pages configured for app:", appName);
|
|
1831
1937
|
setAccessError(`You do not have permission to access ${appName}. This application is currently unavailable. Please contact your administrator if you believe you should have access.`);
|
|
1832
1938
|
setIsCheckingAccess(false);
|
|
1833
1939
|
return;
|
|
1834
1940
|
}
|
|
1835
1941
|
const { data: orgData } = await supabase.from("rbac_organisation_roles").select("organisation_id").eq("user_id", userId).eq("status", "active").is("revoked_at", null).limit(1).single();
|
|
1836
1942
|
if (!orgData) {
|
|
1837
|
-
|
|
1943
|
+
logger.debug("PaceLoginPage", "User has no organisation access");
|
|
1838
1944
|
setAccessError(`You do not have permission to access ${appName}. You are not assigned to any organisation. Please contact your administrator.`);
|
|
1839
1945
|
setIsCheckingAccess(false);
|
|
1840
1946
|
return;
|
|
@@ -1851,23 +1957,23 @@ var PaceLoginPage = ({
|
|
|
1851
1957
|
p_page_id: page.page_name
|
|
1852
1958
|
// Page name to resolve to UUID
|
|
1853
1959
|
});
|
|
1854
|
-
|
|
1960
|
+
logger.debug("PaceLoginPage", "Permission check for page:", { pageName: page.page_name, hasPermission, error: permError });
|
|
1855
1961
|
if (!permError && hasPermission === true) {
|
|
1856
1962
|
hasAnyAccess = true;
|
|
1857
1963
|
break;
|
|
1858
1964
|
}
|
|
1859
1965
|
}
|
|
1860
1966
|
if (hasAnyAccess) {
|
|
1861
|
-
|
|
1967
|
+
logger.debug("PaceLoginPage", "User has access to app");
|
|
1862
1968
|
setIsCheckingAccess(false);
|
|
1863
1969
|
navigate(onSuccessRedirectPath, { replace: true });
|
|
1864
1970
|
return;
|
|
1865
1971
|
}
|
|
1866
|
-
|
|
1972
|
+
logger.debug("PaceLoginPage", "Access denied - no permissions");
|
|
1867
1973
|
setAccessError(`You do not have permission to access ${appName}. This application is restricted to authorized users only. Please contact your administrator if you believe you should have access.`);
|
|
1868
1974
|
setIsCheckingAccess(false);
|
|
1869
1975
|
} catch (error) {
|
|
1870
|
-
|
|
1976
|
+
logger.error("PaceLoginPage", "Error checking app access:", error);
|
|
1871
1977
|
setAccessError("An error occurred while checking your permissions. Please try again or contact support.");
|
|
1872
1978
|
setIsCheckingAccess(false);
|
|
1873
1979
|
}
|
|
@@ -1886,7 +1992,7 @@ var PaceLoginPage = ({
|
|
|
1886
1992
|
try {
|
|
1887
1993
|
navigate(onSuccessRedirectPath, { replace: true });
|
|
1888
1994
|
} catch (navError) {
|
|
1889
|
-
|
|
1995
|
+
logger.error("PaceLoginPage", "Navigation error after sign-in:", navError);
|
|
1890
1996
|
}
|
|
1891
1997
|
}
|
|
1892
1998
|
} finally {
|
|
@@ -1894,7 +2000,7 @@ var PaceLoginPage = ({
|
|
|
1894
2000
|
}
|
|
1895
2001
|
};
|
|
1896
2002
|
return /* @__PURE__ */ jsxs11("main", { className: "min-h-screen grid mx-auto w-fit content-center justify-items-center gap-y-8", "aria-label": `${appName} Login Page`, children: [
|
|
1897
|
-
/* @__PURE__ */
|
|
2003
|
+
/* @__PURE__ */ jsx15(
|
|
1898
2004
|
"img",
|
|
1899
2005
|
{
|
|
1900
2006
|
src: `/${appName.toLowerCase()}_logo_square.svg`,
|
|
@@ -1902,7 +2008,7 @@ var PaceLoginPage = ({
|
|
|
1902
2008
|
className: "h-48"
|
|
1903
2009
|
}
|
|
1904
2010
|
),
|
|
1905
|
-
/* @__PURE__ */
|
|
2011
|
+
/* @__PURE__ */ jsx15(
|
|
1906
2012
|
LoginForm,
|
|
1907
2013
|
{
|
|
1908
2014
|
className: "w-md",
|
|
@@ -1910,21 +2016,21 @@ var PaceLoginPage = ({
|
|
|
1910
2016
|
appName,
|
|
1911
2017
|
isLoading: isSigningIn,
|
|
1912
2018
|
onError: (error) => {
|
|
1913
|
-
|
|
2019
|
+
logger.error("PaceLoginPage", "Login error:", error);
|
|
1914
2020
|
}
|
|
1915
2021
|
}
|
|
1916
2022
|
),
|
|
1917
2023
|
(() => {
|
|
1918
2024
|
const benign = !!(authError && (authError.name === "AuthSessionMissingError" || /Auth session missing/i.test(authError.message)));
|
|
1919
|
-
return authError && !benign ? /* @__PURE__ */
|
|
2025
|
+
return authError && !benign ? /* @__PURE__ */ jsx15("em", { className: "mt-4 text-destructive text-center", children: authError.message }) : null;
|
|
1920
2026
|
})(),
|
|
1921
|
-
accessError && /* @__PURE__ */
|
|
1922
|
-
isCheckingAccess && /* @__PURE__ */
|
|
2027
|
+
accessError && /* @__PURE__ */ jsx15("em", { className: "mt-4 text-destructive text-center", children: accessError }),
|
|
2028
|
+
isCheckingAccess && /* @__PURE__ */ jsx15("em", { className: "mt-4 text-muted-foreground text-center", children: "Checking permissions..." })
|
|
1923
2029
|
] });
|
|
1924
2030
|
};
|
|
1925
2031
|
|
|
1926
|
-
// src/components/SessionRestorationLoader.tsx
|
|
1927
|
-
import { jsx as
|
|
2032
|
+
// src/components/SessionRestorationLoader/SessionRestorationLoader.tsx
|
|
2033
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1928
2034
|
var SessionRestorationLoader = ({
|
|
1929
2035
|
message = "Restoring session..."
|
|
1930
2036
|
}) => {
|
|
@@ -1944,8 +2050,8 @@ var SessionRestorationLoader = ({
|
|
|
1944
2050
|
background: "var(--background, transparent)"
|
|
1945
2051
|
},
|
|
1946
2052
|
children: [
|
|
1947
|
-
/* @__PURE__ */
|
|
1948
|
-
/* @__PURE__ */
|
|
2053
|
+
/* @__PURE__ */ jsx16(LoadingSpinner, { size: "lg" }),
|
|
2054
|
+
/* @__PURE__ */ jsx16(
|
|
1949
2055
|
"div",
|
|
1950
2056
|
{
|
|
1951
2057
|
style: {
|
|
@@ -1965,7 +2071,8 @@ init_UnifiedAuthProvider();
|
|
|
1965
2071
|
init_useSessionRestoration();
|
|
1966
2072
|
import { useMemo as useMemo6 } from "react";
|
|
1967
2073
|
import { Navigate, Outlet as Outlet2 } from "react-router-dom";
|
|
1968
|
-
|
|
2074
|
+
init_logger();
|
|
2075
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1969
2076
|
function ProtectedRoute({
|
|
1970
2077
|
requireEvent = true,
|
|
1971
2078
|
allowSuperAdminBypass = false,
|
|
@@ -1985,56 +2092,57 @@ function ProtectedRoute({
|
|
|
1985
2092
|
sessionRestoration.hasTimedOut
|
|
1986
2093
|
]);
|
|
1987
2094
|
if (isRestoringSession) {
|
|
1988
|
-
return /* @__PURE__ */
|
|
2095
|
+
return /* @__PURE__ */ jsx17(SessionRestorationLoader, {});
|
|
1989
2096
|
}
|
|
1990
2097
|
if (requireEvent && eventLoading) {
|
|
1991
|
-
return /* @__PURE__ */
|
|
2098
|
+
return /* @__PURE__ */ jsx17(Outlet2, {});
|
|
1992
2099
|
}
|
|
1993
2100
|
if (authLoading && !sessionRestoration.hasTimedOut) {
|
|
1994
|
-
return loadingFallback || /* @__PURE__ */
|
|
2101
|
+
return loadingFallback || /* @__PURE__ */ jsx17("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx17(LoadingSpinner, {}) });
|
|
1995
2102
|
}
|
|
1996
2103
|
if (!isAuthenticated) {
|
|
1997
2104
|
if (sessionRestoration.hasTimedOut || sessionRestoration.restorationError) {
|
|
1998
|
-
|
|
2105
|
+
logger.warn("ProtectedRoute", "Session restoration failed, redirecting to login", {
|
|
1999
2106
|
timedOut: sessionRestoration.hasTimedOut,
|
|
2000
2107
|
error: sessionRestoration.restorationError?.message
|
|
2001
2108
|
});
|
|
2002
2109
|
}
|
|
2003
|
-
return /* @__PURE__ */
|
|
2110
|
+
return /* @__PURE__ */ jsx17(Navigate, { to: loginPath, replace: true });
|
|
2004
2111
|
}
|
|
2005
2112
|
if (!requireEvent) {
|
|
2006
|
-
return /* @__PURE__ */
|
|
2113
|
+
return /* @__PURE__ */ jsx17(Outlet2, {});
|
|
2007
2114
|
}
|
|
2008
2115
|
if (!events || events.length === 0) {
|
|
2009
|
-
return noEventsFallback || /* @__PURE__ */
|
|
2010
|
-
/* @__PURE__ */
|
|
2011
|
-
/* @__PURE__ */
|
|
2116
|
+
return noEventsFallback || /* @__PURE__ */ jsx17("div", { style: { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "100vh", padding: "2rem" }, children: /* @__PURE__ */ jsxs13(Alert, { variant: "destructive", className: "max-w-md", children: [
|
|
2117
|
+
/* @__PURE__ */ jsx17(AlertTitle, { children: "No Events Available" }),
|
|
2118
|
+
/* @__PURE__ */ jsx17(AlertDescription, { children: "You don't have access to any events. Please contact your administrator if you believe this is an error." })
|
|
2012
2119
|
] }) });
|
|
2013
2120
|
}
|
|
2014
2121
|
if (!selectedEvent) {
|
|
2015
|
-
|
|
2016
|
-
return /* @__PURE__ */
|
|
2122
|
+
logger.debug("ProtectedRoute", "Events available but none selected - allowing render so selector is visible");
|
|
2123
|
+
return /* @__PURE__ */ jsx17(Outlet2, {});
|
|
2017
2124
|
}
|
|
2018
|
-
return /* @__PURE__ */
|
|
2125
|
+
return /* @__PURE__ */ jsx17(Outlet2, {});
|
|
2019
2126
|
}
|
|
2020
2127
|
|
|
2021
2128
|
// src/components/ErrorBoundary/ErrorBoundary.tsx
|
|
2022
2129
|
import { Component } from "react";
|
|
2023
|
-
|
|
2130
|
+
init_logger();
|
|
2131
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2024
2132
|
var ErrorBoundary = class extends Component {
|
|
2025
2133
|
constructor(props) {
|
|
2026
2134
|
super(props);
|
|
2027
2135
|
this.retryTimeoutId = null;
|
|
2028
2136
|
this.reportError = (errorId, componentName) => {
|
|
2029
2137
|
if (import.meta.env.MODE === "production") {
|
|
2030
|
-
|
|
2138
|
+
logger.warn("ErrorBoundary", "Error reporting would be triggered in production:", { errorId, componentName });
|
|
2031
2139
|
}
|
|
2032
2140
|
};
|
|
2033
2141
|
this.handleRetry = () => {
|
|
2034
2142
|
const { maxRetries = 3 } = this.props;
|
|
2035
2143
|
const { retryCount } = this.state;
|
|
2036
2144
|
if (retryCount < maxRetries) {
|
|
2037
|
-
|
|
2145
|
+
logger.debug("ErrorBoundary", `Retrying component render (attempt ${retryCount + 1}/${maxRetries})`);
|
|
2038
2146
|
this.setState((prevState) => ({
|
|
2039
2147
|
hasError: false,
|
|
2040
2148
|
error: void 0,
|
|
@@ -2061,7 +2169,7 @@ var ErrorBoundary = class extends Component {
|
|
|
2061
2169
|
const { componentName = "Unknown Component", onError, enableReporting = true } = this.props;
|
|
2062
2170
|
const errorId = this.state.errorId;
|
|
2063
2171
|
this.setState({ errorInfo });
|
|
2064
|
-
|
|
2172
|
+
logger.error("ErrorBoundary", `[${componentName}] Caught error ${errorId}:`, error, errorInfo);
|
|
2065
2173
|
performanceBudgetMonitor.measure("ERROR_BOUNDARY_TRIGGER", 1, {
|
|
2066
2174
|
componentName,
|
|
2067
2175
|
errorId,
|
|
@@ -2093,20 +2201,20 @@ var ErrorBoundary = class extends Component {
|
|
|
2093
2201
|
if (fallback) {
|
|
2094
2202
|
return fallback;
|
|
2095
2203
|
}
|
|
2096
|
-
return /* @__PURE__ */
|
|
2204
|
+
return /* @__PURE__ */ jsx18(
|
|
2097
2205
|
"div",
|
|
2098
2206
|
{
|
|
2099
2207
|
role: "alert",
|
|
2100
2208
|
className: "p-6 bg-destructive/10 border border-destructive/20 rounded-lg",
|
|
2101
2209
|
"data-error-boundary": errorId,
|
|
2102
2210
|
children: /* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-3", children: [
|
|
2103
|
-
/* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ jsx18("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx18("svg", { className: "w-5 h-5 text-destructive", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx18("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }) }),
|
|
2104
2212
|
/* @__PURE__ */ jsxs14("div", { className: "flex-1 min-w-0", children: [
|
|
2105
2213
|
/* @__PURE__ */ jsxs14("h3", { className: "text-destructive", children: [
|
|
2106
2214
|
"Error in ",
|
|
2107
2215
|
componentName
|
|
2108
2216
|
] }),
|
|
2109
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsx18("p", { className: "text-destructive/80", children: this.state.error?.message || "An unexpected error occurred." }),
|
|
2110
2218
|
enableRetry && retryCount < maxRetries && /* @__PURE__ */ jsxs14("div", { className: "flex gap-3 mb-4", children: [
|
|
2111
2219
|
/* @__PURE__ */ jsxs14(
|
|
2112
2220
|
"button",
|
|
@@ -2122,7 +2230,7 @@ var ErrorBoundary = class extends Component {
|
|
|
2122
2230
|
]
|
|
2123
2231
|
}
|
|
2124
2232
|
),
|
|
2125
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ jsx18(
|
|
2126
2234
|
"button",
|
|
2127
2235
|
{
|
|
2128
2236
|
onClick: () => window.location.reload(),
|
|
@@ -2132,8 +2240,8 @@ var ErrorBoundary = class extends Component {
|
|
|
2132
2240
|
)
|
|
2133
2241
|
] }),
|
|
2134
2242
|
retryCount >= maxRetries && /* @__PURE__ */ jsxs14("div", { className: "mb-4 p-3 bg-acc-50 border border-acc-200 rounded-md", children: [
|
|
2135
|
-
/* @__PURE__ */
|
|
2136
|
-
/* @__PURE__ */
|
|
2243
|
+
/* @__PURE__ */ jsx18("p", { className: "text-acc-800", children: "Maximum retry attempts reached. Please reload the page or contact support." }),
|
|
2244
|
+
/* @__PURE__ */ jsx18(
|
|
2137
2245
|
"button",
|
|
2138
2246
|
{
|
|
2139
2247
|
onClick: () => window.location.reload(),
|
|
@@ -2143,7 +2251,7 @@ var ErrorBoundary = class extends Component {
|
|
|
2143
2251
|
)
|
|
2144
2252
|
] }),
|
|
2145
2253
|
import.meta.env.MODE === "development" && this.state.error && /* @__PURE__ */ jsxs14("details", { className: "text-sm text-destructive/70", children: [
|
|
2146
|
-
/* @__PURE__ */
|
|
2254
|
+
/* @__PURE__ */ jsx18("summary", { className: "cursor-pointer font-medium mb-2", children: "Error Details (Development)" }),
|
|
2147
2255
|
/* @__PURE__ */ jsxs14("div", { className: "bg-destructive/5 p-3 rounded border", children: [
|
|
2148
2256
|
/* @__PURE__ */ jsxs14("p", { className: "font-mono", children: [
|
|
2149
2257
|
"Error ID: ",
|
|
@@ -2167,8 +2275,9 @@ var ErrorBoundary = class extends Component {
|
|
|
2167
2275
|
// src/components/OrganisationSelector/OrganisationSelector.tsx
|
|
2168
2276
|
import { useState as useState7, useCallback as useCallback4 } from "react";
|
|
2169
2277
|
init_OrganisationProvider();
|
|
2278
|
+
init_logger();
|
|
2170
2279
|
import { RefreshCw as RefreshCw2, AlertCircle as AlertCircle2, Building2, Shield } from "lucide-react";
|
|
2171
|
-
import { jsx as
|
|
2280
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2172
2281
|
function OrganisationSelector({
|
|
2173
2282
|
placeholder = "Select organisation",
|
|
2174
2283
|
className,
|
|
@@ -2204,9 +2313,9 @@ function OrganisationSelector({
|
|
|
2204
2313
|
if (newOrganisation && onOrganisationChange) {
|
|
2205
2314
|
onOrganisationChange(newOrganisation);
|
|
2206
2315
|
}
|
|
2207
|
-
|
|
2316
|
+
logger.debug("OrganisationSelector", "Successfully switched to organisation:", orgId);
|
|
2208
2317
|
} catch (error) {
|
|
2209
|
-
|
|
2318
|
+
logger.error("OrganisationSelector", "Failed to switch organisation:", error);
|
|
2210
2319
|
setSwitchError(error instanceof Error ? error.message : "Failed to switch organisation");
|
|
2211
2320
|
} finally {
|
|
2212
2321
|
setIsLoading(false);
|
|
@@ -2225,7 +2334,7 @@ function OrganisationSelector({
|
|
|
2225
2334
|
try {
|
|
2226
2335
|
await refreshOrganisations();
|
|
2227
2336
|
} catch (error) {
|
|
2228
|
-
|
|
2337
|
+
logger.error("OrganisationSelector", "Failed to refresh organisations:", error);
|
|
2229
2338
|
setSwitchError("Failed to refresh organisations");
|
|
2230
2339
|
} finally {
|
|
2231
2340
|
setIsLoading(false);
|
|
@@ -2233,14 +2342,14 @@ function OrganisationSelector({
|
|
|
2233
2342
|
}, [refreshOrganisations]);
|
|
2234
2343
|
if (orgLoading) {
|
|
2235
2344
|
return /* @__PURE__ */ jsxs15("div", { className: `flex items-center gap-2 ${className}`, children: [
|
|
2236
|
-
/* @__PURE__ */
|
|
2237
|
-
/* @__PURE__ */
|
|
2345
|
+
/* @__PURE__ */ jsx19(LoadingSpinner, { size: "sm" }),
|
|
2346
|
+
/* @__PURE__ */ jsx19("span", { className: "text-sm text-muted-foreground", children: compact ? "Loading..." : "Loading organisations..." })
|
|
2238
2347
|
] });
|
|
2239
2348
|
}
|
|
2240
2349
|
if (orgError) {
|
|
2241
2350
|
return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
|
|
2242
2351
|
/* @__PURE__ */ jsxs15(Alert, { variant: "destructive", children: [
|
|
2243
|
-
/* @__PURE__ */
|
|
2352
|
+
/* @__PURE__ */ jsx19(AlertCircle2, { className: "h-4 w-4" }),
|
|
2244
2353
|
/* @__PURE__ */ jsxs15(AlertDescription, { children: [
|
|
2245
2354
|
"Failed to load organisations: ",
|
|
2246
2355
|
orgError.message
|
|
@@ -2255,7 +2364,7 @@ function OrganisationSelector({
|
|
|
2255
2364
|
disabled: isLoading,
|
|
2256
2365
|
className: "w-full",
|
|
2257
2366
|
children: [
|
|
2258
|
-
/* @__PURE__ */
|
|
2367
|
+
/* @__PURE__ */ jsx19(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
|
|
2259
2368
|
"Retry"
|
|
2260
2369
|
]
|
|
2261
2370
|
}
|
|
@@ -2266,8 +2375,8 @@ function OrganisationSelector({
|
|
|
2266
2375
|
if (showNoOrganisationsMessage) {
|
|
2267
2376
|
return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
|
|
2268
2377
|
/* @__PURE__ */ jsxs15(Alert, { children: [
|
|
2269
|
-
/* @__PURE__ */
|
|
2270
|
-
/* @__PURE__ */
|
|
2378
|
+
/* @__PURE__ */ jsx19(Building2, { className: "h-4 w-4" }),
|
|
2379
|
+
/* @__PURE__ */ jsx19(AlertDescription, { children: "No organisations available. Please contact your administrator to be added to an organisation." })
|
|
2271
2380
|
] }),
|
|
2272
2381
|
showRetryButton && /* @__PURE__ */ jsxs15(
|
|
2273
2382
|
Button,
|
|
@@ -2278,7 +2387,7 @@ function OrganisationSelector({
|
|
|
2278
2387
|
disabled: isLoading,
|
|
2279
2388
|
className: "w-full",
|
|
2280
2389
|
children: [
|
|
2281
|
-
/* @__PURE__ */
|
|
2390
|
+
/* @__PURE__ */ jsx19(RefreshCw2, { className: `h-4 w-4 mr-2 ${isLoading ? "animate-spin" : ""}` }),
|
|
2282
2391
|
"Check Again"
|
|
2283
2392
|
]
|
|
2284
2393
|
}
|
|
@@ -2288,8 +2397,8 @@ function OrganisationSelector({
|
|
|
2288
2397
|
return null;
|
|
2289
2398
|
}
|
|
2290
2399
|
const switchErrorDisplay = switchError && /* @__PURE__ */ jsxs15(Alert, { variant: "destructive", className: "mt-2", children: [
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
/* @__PURE__ */
|
|
2400
|
+
/* @__PURE__ */ jsx19(AlertCircle2, { className: "h-4 w-4" }),
|
|
2401
|
+
/* @__PURE__ */ jsx19(AlertDescription, { children: switchError })
|
|
2293
2402
|
] });
|
|
2294
2403
|
return /* @__PURE__ */ jsxs15("div", { className: `space-y-2 ${className}`, children: [
|
|
2295
2404
|
/* @__PURE__ */ jsxs15(
|
|
@@ -2299,14 +2408,14 @@ function OrganisationSelector({
|
|
|
2299
2408
|
onValueChange: handleOrganisationChange,
|
|
2300
2409
|
disabled: disabled || isLoading || !selectedOrganisation,
|
|
2301
2410
|
children: [
|
|
2302
|
-
/* @__PURE__ */
|
|
2303
|
-
isLoading ? /* @__PURE__ */
|
|
2304
|
-
/* @__PURE__ */
|
|
2411
|
+
/* @__PURE__ */ jsx19(SelectTrigger, { className: `${isLoading ? "opacity-50" : ""}`, children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
|
|
2412
|
+
isLoading ? /* @__PURE__ */ jsx19(LoadingSpinner, { size: "sm" }) : /* @__PURE__ */ jsx19(Building2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
2413
|
+
/* @__PURE__ */ jsx19(SelectValue, { placeholder })
|
|
2305
2414
|
] }) }),
|
|
2306
|
-
/* @__PURE__ */
|
|
2415
|
+
/* @__PURE__ */ jsx19(SelectContent, { children: organisations.map((org) => {
|
|
2307
2416
|
const userRole = getUserRole(org.id);
|
|
2308
2417
|
const hasAccess = validateOrganisationAccess(org.id);
|
|
2309
|
-
return /* @__PURE__ */
|
|
2418
|
+
return /* @__PURE__ */ jsx19(
|
|
2310
2419
|
SelectItem,
|
|
2311
2420
|
{
|
|
2312
2421
|
value: org.id,
|
|
@@ -2314,15 +2423,15 @@ function OrganisationSelector({
|
|
|
2314
2423
|
className: !hasAccess ? "opacity-50" : "",
|
|
2315
2424
|
children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between w-full", children: [
|
|
2316
2425
|
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
|
|
2317
|
-
/* @__PURE__ */
|
|
2426
|
+
/* @__PURE__ */ jsx19(Building2, { className: "h-4 w-4" }),
|
|
2318
2427
|
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col", children: [
|
|
2319
|
-
/* @__PURE__ */
|
|
2320
|
-
!compact && org.description && /* @__PURE__ */
|
|
2428
|
+
/* @__PURE__ */ jsx19("span", { className: "font-medium", children: org.display_name }),
|
|
2429
|
+
!compact && org.description && /* @__PURE__ */ jsx19("span", { className: "text-xs text-muted-foreground truncate max-w-40", children: org.description })
|
|
2321
2430
|
] })
|
|
2322
2431
|
] }),
|
|
2323
2432
|
showRole && /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1 ml-4", children: [
|
|
2324
|
-
/* @__PURE__ */
|
|
2325
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ jsx19(Shield, { className: "h-3 w-3 text-muted-foreground" }),
|
|
2434
|
+
/* @__PURE__ */ jsx19("span", { className: "text-xs text-muted-foreground capitalize", children: userRole?.replace("_", " ") || "No Role" })
|
|
2326
2435
|
] })
|
|
2327
2436
|
] })
|
|
2328
2437
|
},
|
|
@@ -2336,107 +2445,13 @@ function OrganisationSelector({
|
|
|
2336
2445
|
] });
|
|
2337
2446
|
}
|
|
2338
2447
|
|
|
2339
|
-
// src/components/PasswordReset/PasswordResetForm.tsx
|
|
2340
|
-
import { useState as useState8 } from "react";
|
|
2341
|
-
init_UnifiedAuthProvider2();
|
|
2342
|
-
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2343
|
-
function PasswordResetForm({
|
|
2344
|
-
onSuccess,
|
|
2345
|
-
onError,
|
|
2346
|
-
className
|
|
2347
|
-
}) {
|
|
2348
|
-
const { resetPassword } = useUnifiedAuth();
|
|
2349
|
-
const [email, setEmail] = useState8("");
|
|
2350
|
-
const [isLoading, setIsLoading] = useState8(false);
|
|
2351
|
-
const [isSuccess, setIsSuccess] = useState8(false);
|
|
2352
|
-
const [error, setError] = useState8(null);
|
|
2353
|
-
const handleSubmit = async (e) => {
|
|
2354
|
-
e.preventDefault();
|
|
2355
|
-
if (!email.trim()) {
|
|
2356
|
-
return;
|
|
2357
|
-
}
|
|
2358
|
-
setIsLoading(true);
|
|
2359
|
-
setError(null);
|
|
2360
|
-
try {
|
|
2361
|
-
const { error: resetError } = await resetPassword(email);
|
|
2362
|
-
if (resetError) {
|
|
2363
|
-
const errorObj = new Error(resetError.message || "Failed to send reset email");
|
|
2364
|
-
setError(errorObj.message);
|
|
2365
|
-
onError?.(errorObj);
|
|
2366
|
-
} else {
|
|
2367
|
-
setIsSuccess(true);
|
|
2368
|
-
onSuccess?.();
|
|
2369
|
-
}
|
|
2370
|
-
} catch (err) {
|
|
2371
|
-
const errorObj = err instanceof Error ? err : new Error("An unexpected error occurred");
|
|
2372
|
-
setError(errorObj.message);
|
|
2373
|
-
onError?.(errorObj);
|
|
2374
|
-
} finally {
|
|
2375
|
-
setIsLoading(false);
|
|
2376
|
-
}
|
|
2377
|
-
};
|
|
2378
|
-
const handleSendAnother = () => {
|
|
2379
|
-
setIsSuccess(false);
|
|
2380
|
-
setError(null);
|
|
2381
|
-
};
|
|
2382
|
-
if (isSuccess) {
|
|
2383
|
-
return /* @__PURE__ */ jsx19("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-4 text-center", children: [
|
|
2384
|
-
/* @__PURE__ */ jsx19("h2", { children: "Check your email" }),
|
|
2385
|
-
/* @__PURE__ */ jsxs16("p", { className: "text-sec-600", children: [
|
|
2386
|
-
"We have sent a password reset link to ",
|
|
2387
|
-
email
|
|
2388
|
-
] }),
|
|
2389
|
-
/* @__PURE__ */ jsx19(
|
|
2390
|
-
Button,
|
|
2391
|
-
{
|
|
2392
|
-
variant: "outline",
|
|
2393
|
-
onClick: handleSendAnother,
|
|
2394
|
-
className: "w-full",
|
|
2395
|
-
children: "Send another email"
|
|
2396
|
-
}
|
|
2397
|
-
)
|
|
2398
|
-
] }) });
|
|
2399
|
-
}
|
|
2400
|
-
return /* @__PURE__ */ jsx19("div", { className: cn("", className), role: "form", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-4", children: [
|
|
2401
|
-
/* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
|
|
2402
|
-
/* @__PURE__ */ jsx19("h2", { children: "Reset Password" }),
|
|
2403
|
-
/* @__PURE__ */ jsx19("p", { className: "text-sec-600", children: "Enter your email address and we'll send you a reset link." })
|
|
2404
|
-
] }),
|
|
2405
|
-
/* @__PURE__ */ jsxs16("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
|
|
2406
|
-
/* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
|
|
2407
|
-
/* @__PURE__ */ jsx19(Label, { htmlFor: "email", children: "Email Address" }),
|
|
2408
|
-
/* @__PURE__ */ jsx19(
|
|
2409
|
-
Input,
|
|
2410
|
-
{
|
|
2411
|
-
id: "email",
|
|
2412
|
-
type: "email",
|
|
2413
|
-
value: email,
|
|
2414
|
-
onChange: (e) => setEmail(e.target.value),
|
|
2415
|
-
placeholder: "Enter your email",
|
|
2416
|
-
required: true,
|
|
2417
|
-
disabled: isLoading
|
|
2418
|
-
}
|
|
2419
|
-
)
|
|
2420
|
-
] }),
|
|
2421
|
-
error && /* @__PURE__ */ jsx19("div", { className: "text-sm text-destructive", role: "alert", children: error }),
|
|
2422
|
-
/* @__PURE__ */ jsx19(
|
|
2423
|
-
Button,
|
|
2424
|
-
{
|
|
2425
|
-
type: "submit",
|
|
2426
|
-
className: "w-full",
|
|
2427
|
-
disabled: !email.trim() || isLoading,
|
|
2428
|
-
children: isLoading ? "Sending..." : "Send Reset Link"
|
|
2429
|
-
}
|
|
2430
|
-
)
|
|
2431
|
-
] })
|
|
2432
|
-
] }) });
|
|
2433
|
-
}
|
|
2434
|
-
|
|
2435
2448
|
// src/hooks/useFileReference.ts
|
|
2436
|
-
import { useState as
|
|
2449
|
+
import { useState as useState8, useCallback as useCallback5, useEffect as useEffect5, useRef as useRef2, useMemo as useMemo7 } from "react";
|
|
2450
|
+
init_logger();
|
|
2451
|
+
var log = createLogger("useFileReference");
|
|
2437
2452
|
function useFileReference(supabase) {
|
|
2438
|
-
const [isLoading, setIsLoading] =
|
|
2439
|
-
const [error, setError] =
|
|
2453
|
+
const [isLoading, setIsLoading] = useState8(false);
|
|
2454
|
+
const [error, setError] = useState8(null);
|
|
2440
2455
|
const service = useMemo7(() => createFileReferenceService(supabase), [supabase]);
|
|
2441
2456
|
const uploadFile = useCallback5(async (options, file) => {
|
|
2442
2457
|
setIsLoading(true);
|
|
@@ -2600,10 +2615,10 @@ function useFileReferenceForRecord(supabase, table_name, record_id, organisation
|
|
|
2600
2615
|
getFileCount,
|
|
2601
2616
|
clearError
|
|
2602
2617
|
} = useFileReference(supabase);
|
|
2603
|
-
const [fileUrl, setFileUrl] =
|
|
2604
|
-
const [fileReference, setFileReference] =
|
|
2605
|
-
const [fileReferences, setFileReferences] =
|
|
2606
|
-
const [fileCount, setFileCount] =
|
|
2618
|
+
const [fileUrl, setFileUrl] = useState8(null);
|
|
2619
|
+
const [fileReference, setFileReference] = useState8(null);
|
|
2620
|
+
const [fileReferences, setFileReferences] = useState8([]);
|
|
2621
|
+
const [fileCount, setFileCount] = useState8(0);
|
|
2607
2622
|
const urlRefreshIntervalRef = useRef2(null);
|
|
2608
2623
|
const loadFileReference = useCallback5(async () => {
|
|
2609
2624
|
const reference = await getFileReference(table_name, record_id, organisation_id);
|
|
@@ -2675,8 +2690,8 @@ function useFileReferenceById(supabase, fileReferenceId, organisationId) {
|
|
|
2675
2690
|
getFileReferenceById,
|
|
2676
2691
|
clearError
|
|
2677
2692
|
} = useFileReference(supabase);
|
|
2678
|
-
const [fileReference, setFileReference] =
|
|
2679
|
-
const [fileUrl, setFileUrl] =
|
|
2693
|
+
const [fileReference, setFileReference] = useState8(null);
|
|
2694
|
+
const [fileUrl, setFileUrl] = useState8(null);
|
|
2680
2695
|
const loadFileReference = useCallback5(async () => {
|
|
2681
2696
|
if (!fileReferenceId || !organisationId) {
|
|
2682
2697
|
setFileReference(null);
|
|
@@ -2722,8 +2737,8 @@ function useFilesByCategory(supabase, table_name, record_id, category, organisat
|
|
|
2722
2737
|
getFilesByCategory,
|
|
2723
2738
|
clearError
|
|
2724
2739
|
} = useFileReference(supabase);
|
|
2725
|
-
const [fileReferences, setFileReferences] =
|
|
2726
|
-
const [fileUrls, setFileUrls] =
|
|
2740
|
+
const [fileReferences, setFileReferences] = useState8([]);
|
|
2741
|
+
const [fileUrls, setFileUrls] = useState8(/* @__PURE__ */ new Map());
|
|
2727
2742
|
const loadFiles = useCallback5(async () => {
|
|
2728
2743
|
if (!category || !organisation_id) {
|
|
2729
2744
|
setFileReferences([]);
|
|
@@ -2750,7 +2765,7 @@ function useFilesByCategory(supabase, table_name, record_id, category, organisat
|
|
|
2750
2765
|
urlMap.set(fileRef.id, url);
|
|
2751
2766
|
}
|
|
2752
2767
|
} catch (err) {
|
|
2753
|
-
|
|
2768
|
+
log.error(`Failed to load URL for file ${fileRef.id}:`, err);
|
|
2754
2769
|
}
|
|
2755
2770
|
}
|
|
2756
2771
|
setFileUrls(urlMap);
|
|
@@ -2770,49 +2785,8 @@ function useFilesByCategory(supabase, table_name, record_id, category, organisat
|
|
|
2770
2785
|
}
|
|
2771
2786
|
|
|
2772
2787
|
// src/components/FileUpload/FileUpload.tsx
|
|
2773
|
-
import { useState as
|
|
2774
|
-
|
|
2775
|
-
// src/utils/appIdResolver.ts
|
|
2776
|
-
async function getAppId(supabase, appName) {
|
|
2777
|
-
try {
|
|
2778
|
-
const { data, error } = await supabase.from("rbac_apps").select("id").ilike("name", appName).eq("is_active", true).single();
|
|
2779
|
-
if (error) {
|
|
2780
|
-
console.error("Failed to resolve app ID for app name:", appName, error);
|
|
2781
|
-
return null;
|
|
2782
|
-
}
|
|
2783
|
-
return data?.id || null;
|
|
2784
|
-
} catch (error) {
|
|
2785
|
-
console.error("Error resolving app ID for app name:", appName, error);
|
|
2786
|
-
return null;
|
|
2787
|
-
}
|
|
2788
|
-
}
|
|
2789
|
-
var CachedAppIdResolver = class {
|
|
2790
|
-
constructor() {
|
|
2791
|
-
this.cache = /* @__PURE__ */ new Map();
|
|
2792
|
-
this.ttl = 5 * 60 * 1e3;
|
|
2793
|
-
}
|
|
2794
|
-
// 5 minutes
|
|
2795
|
-
async getAppId(supabase, appName) {
|
|
2796
|
-
const now = Date.now();
|
|
2797
|
-
const cached = this.cache.get(appName);
|
|
2798
|
-
if (cached && cached.expires > now) {
|
|
2799
|
-
return cached.id;
|
|
2800
|
-
}
|
|
2801
|
-
const id = await getAppId(supabase, appName);
|
|
2802
|
-
this.cache.set(appName, { id, expires: now + this.ttl });
|
|
2803
|
-
return id;
|
|
2804
|
-
}
|
|
2805
|
-
clearCache() {
|
|
2806
|
-
this.cache.clear();
|
|
2807
|
-
}
|
|
2808
|
-
clearCacheForApp(appName) {
|
|
2809
|
-
this.cache.delete(appName);
|
|
2810
|
-
}
|
|
2811
|
-
};
|
|
2812
|
-
var cachedAppIdResolver = new CachedAppIdResolver();
|
|
2813
|
-
|
|
2814
|
-
// src/components/FileUpload/FileUpload.tsx
|
|
2815
|
-
import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2788
|
+
import { useState as useState9, useCallback as useCallback6, useRef as useRef3, useEffect as useEffect6, useMemo as useMemo8 } from "react";
|
|
2789
|
+
import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2816
2790
|
function FileUpload({
|
|
2817
2791
|
supabase,
|
|
2818
2792
|
table_name,
|
|
@@ -2834,11 +2808,11 @@ function FileUpload({
|
|
|
2834
2808
|
onProgress,
|
|
2835
2809
|
children
|
|
2836
2810
|
}) {
|
|
2837
|
-
const [isDragging, setIsDragging] =
|
|
2838
|
-
const [uploadStates, setUploadStates] =
|
|
2839
|
-
const [resolvedAppId, setResolvedAppId] =
|
|
2840
|
-
const [isResolvingAppId, setIsResolvingAppId] =
|
|
2841
|
-
const [appIdError, setAppIdError] =
|
|
2811
|
+
const [isDragging, setIsDragging] = useState9(false);
|
|
2812
|
+
const [uploadStates, setUploadStates] = useState9(/* @__PURE__ */ new Map());
|
|
2813
|
+
const [resolvedAppId, setResolvedAppId] = useState9(app_id || null);
|
|
2814
|
+
const [isResolvingAppId, setIsResolvingAppId] = useState9(!app_id);
|
|
2815
|
+
const [appIdError, setAppIdError] = useState9(null);
|
|
2842
2816
|
const fileInputRef = useRef3(null);
|
|
2843
2817
|
const { uploadFile, isLoading, error } = useFileReference(supabase);
|
|
2844
2818
|
useEffect6(() => {
|
|
@@ -3134,8 +3108,8 @@ function FileUpload({
|
|
|
3134
3108
|
};
|
|
3135
3109
|
const dragClasses = isDragging ? "border-main-500 bg-main-50" : "border-sec-300 hover:border-sec-400";
|
|
3136
3110
|
const disabledClasses = isDisabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-sec-50";
|
|
3137
|
-
return /* @__PURE__ */
|
|
3138
|
-
/* @__PURE__ */
|
|
3111
|
+
return /* @__PURE__ */ jsxs16("div", { className: `space-y-4 ${className}`, children: [
|
|
3112
|
+
/* @__PURE__ */ jsxs16(
|
|
3139
3113
|
"div",
|
|
3140
3114
|
{
|
|
3141
3115
|
className: `relative border-2 border-dashed rounded-lg p-6 text-center transition-colors ${dragClasses} ${disabledClasses}`,
|
|
@@ -3144,7 +3118,7 @@ function FileUpload({
|
|
|
3144
3118
|
onDrop: handleDrop,
|
|
3145
3119
|
onClick: !isDisabled ? handleClick : void 0,
|
|
3146
3120
|
children: [
|
|
3147
|
-
children || /* @__PURE__ */
|
|
3121
|
+
children || /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
|
|
3148
3122
|
/* @__PURE__ */ jsx20(
|
|
3149
3123
|
"input",
|
|
3150
3124
|
{
|
|
@@ -3158,12 +3132,12 @@ function FileUpload({
|
|
|
3158
3132
|
"data-testid": "file-input"
|
|
3159
3133
|
}
|
|
3160
3134
|
),
|
|
3161
|
-
/* @__PURE__ */ jsx20("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */
|
|
3135
|
+
/* @__PURE__ */ jsx20("div", { className: "text-sec-600", children: isResolvingAppId ? "Resolving app configuration..." : isDragging ? "Drop files here..." : /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
3162
3136
|
/* @__PURE__ */ jsx20("span", { className: "font-medium", children: "Click to upload" }),
|
|
3163
3137
|
" ",
|
|
3164
3138
|
"or drag and drop"
|
|
3165
3139
|
] }) }),
|
|
3166
|
-
/* @__PURE__ */
|
|
3140
|
+
/* @__PURE__ */ jsxs16("div", { className: "text-sm text-sec-500", children: [
|
|
3167
3141
|
!isResolvingAppId && accept !== "*/*" && `Accepted formats: ${accept}`,
|
|
3168
3142
|
!isResolvingAppId && maxSize && ` \u2022 Max size: ${Math.round(maxSize / 1024 / 1024)}MB`,
|
|
3169
3143
|
!isResolvingAppId && multiple && " \u2022 Multiple files allowed"
|
|
@@ -3178,7 +3152,7 @@ function FileUpload({
|
|
|
3178
3152
|
const isError = progress.status === "error";
|
|
3179
3153
|
const isCompleted = progress.status === "completed";
|
|
3180
3154
|
const isUploading2 = progress.status === "uploading" || progress.status === "processing";
|
|
3181
|
-
return /* @__PURE__ */
|
|
3155
|
+
return /* @__PURE__ */ jsxs16(
|
|
3182
3156
|
"div",
|
|
3183
3157
|
{
|
|
3184
3158
|
className: `flex items-center space-x-3 p-3 rounded-lg border ${isError ? "bg-acc-50 border-acc-200" : isCompleted ? "bg-success-50 border-success-200" : "bg-sec-50 border-sec-200"}`,
|
|
@@ -3191,14 +3165,14 @@ function FileUpload({
|
|
|
3191
3165
|
className: "w-12 h-12 object-cover rounded"
|
|
3192
3166
|
}
|
|
3193
3167
|
) : /* @__PURE__ */ jsx20("div", { className: "w-12 h-12 flex items-center justify-center bg-sec-200 rounded", children: /* @__PURE__ */ jsx20("span", { className: "text-2xl", children: "\u{1F4C4}" }) }) }),
|
|
3194
|
-
/* @__PURE__ */
|
|
3168
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex-1 min-w-0", children: [
|
|
3195
3169
|
/* @__PURE__ */ jsx20("div", { className: "font-medium text-sec-900 truncate", children: file.name }),
|
|
3196
|
-
/* @__PURE__ */
|
|
3170
|
+
/* @__PURE__ */ jsxs16("div", { className: "text-sm text-sec-500", children: [
|
|
3197
3171
|
formatFileSize(file.size),
|
|
3198
3172
|
isCompleted && result && " \u2022 Uploaded",
|
|
3199
3173
|
isError && progress.error && ` \u2022 ${progress.error}`
|
|
3200
3174
|
] }),
|
|
3201
|
-
showProgress && (isUploading2 || isError) && /* @__PURE__ */
|
|
3175
|
+
showProgress && (isUploading2 || isError) && /* @__PURE__ */ jsxs16("div", { className: "mt-2", children: [
|
|
3202
3176
|
/* @__PURE__ */ jsx20("div", { className: "w-full bg-sec-200 rounded-full h-2", children: /* @__PURE__ */ jsx20(
|
|
3203
3177
|
"div",
|
|
3204
3178
|
{
|
|
@@ -3206,7 +3180,7 @@ function FileUpload({
|
|
|
3206
3180
|
style: { width: `${progress.percentage}%` }
|
|
3207
3181
|
}
|
|
3208
3182
|
) }),
|
|
3209
|
-
isUploading2 && /* @__PURE__ */
|
|
3183
|
+
isUploading2 && /* @__PURE__ */ jsxs16("div", { className: "text-xs text-sec-500 mt-1", children: [
|
|
3210
3184
|
progress.percentage,
|
|
3211
3185
|
"% \u2022 ",
|
|
3212
3186
|
formatFileSize(progress.loaded),
|
|
@@ -3215,7 +3189,7 @@ function FileUpload({
|
|
|
3215
3189
|
] })
|
|
3216
3190
|
] })
|
|
3217
3191
|
] }),
|
|
3218
|
-
/* @__PURE__ */
|
|
3192
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex-shrink-0", children: [
|
|
3219
3193
|
isCompleted && /* @__PURE__ */ jsx20("span", { className: "text-success-500 text-xl", children: "\u2713" }),
|
|
3220
3194
|
isError && /* @__PURE__ */ jsx20("span", { className: "text-acc-500 text-xl", children: "\u2715" }),
|
|
3221
3195
|
isUploading2 && /* @__PURE__ */ jsx20("div", { className: "animate-spin rounded-full h-5 w-5 border-b-2 border-main-500" })
|
|
@@ -3231,15 +3205,17 @@ function FileUpload({
|
|
|
3231
3205
|
}
|
|
3232
3206
|
|
|
3233
3207
|
// src/components/FileDisplay/FileDisplay.tsx
|
|
3234
|
-
import { useState as
|
|
3208
|
+
import { useState as useState11, useEffect as useEffect8, useRef as useRef5, useContext as useContext2, useMemo as useMemo9 } from "react";
|
|
3235
3209
|
|
|
3236
3210
|
// src/hooks/useFileUrl.ts
|
|
3237
|
-
import { useState as
|
|
3211
|
+
import { useState as useState10, useEffect as useEffect7, useCallback as useCallback7, useRef as useRef4 } from "react";
|
|
3212
|
+
init_logger();
|
|
3213
|
+
var log2 = createLogger("useFileUrl");
|
|
3238
3214
|
function useFileUrl(fileReference, options) {
|
|
3239
3215
|
const { organisation_id, supabase, autoLoad = true } = options;
|
|
3240
|
-
const [url, setUrl] =
|
|
3241
|
-
const [isLoading, setIsLoading] =
|
|
3242
|
-
const [error, setError] =
|
|
3216
|
+
const [url, setUrl] = useState10(null);
|
|
3217
|
+
const [isLoading, setIsLoading] = useState10(false);
|
|
3218
|
+
const [error, setError] = useState10(null);
|
|
3243
3219
|
const fileReferenceIdRef = useRef4(null);
|
|
3244
3220
|
const loadUrl = useCallback7(async () => {
|
|
3245
3221
|
if (!fileReference) {
|
|
@@ -3272,7 +3248,7 @@ function useFileUrl(fileReference, options) {
|
|
|
3272
3248
|
const error2 = err instanceof Error ? err : new Error("Failed to generate file URL");
|
|
3273
3249
|
setError(error2);
|
|
3274
3250
|
setUrl(null);
|
|
3275
|
-
|
|
3251
|
+
log2.error("Error generating URL:", error2);
|
|
3276
3252
|
} finally {
|
|
3277
3253
|
setIsLoading(false);
|
|
3278
3254
|
}
|
|
@@ -3305,7 +3281,8 @@ function useFileUrl(fileReference, options) {
|
|
|
3305
3281
|
|
|
3306
3282
|
// src/components/FileDisplay/FileDisplay.tsx
|
|
3307
3283
|
init_UnifiedAuthProvider();
|
|
3308
|
-
|
|
3284
|
+
init_logger();
|
|
3285
|
+
import { Fragment as Fragment6, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3309
3286
|
var fallbackSizeClasses = {
|
|
3310
3287
|
xs: "h-4 w-4 text-xs",
|
|
3311
3288
|
sm: "h-6 w-6 text-sm",
|
|
@@ -3344,9 +3321,9 @@ function FileDisplayContent({
|
|
|
3344
3321
|
fallbackText,
|
|
3345
3322
|
fallbackSize = "md"
|
|
3346
3323
|
}) {
|
|
3347
|
-
const [imageError, setImageError] =
|
|
3348
|
-
const [internalFileUrls, setInternalFileUrls] =
|
|
3349
|
-
const [deleteDialogOpen, setDeleteDialogOpen] =
|
|
3324
|
+
const [imageError, setImageError] = useState11(false);
|
|
3325
|
+
const [internalFileUrls, setInternalFileUrls] = useState11(new Map(fileUrls));
|
|
3326
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = useState11(false);
|
|
3350
3327
|
const fileReferencesRef = useRef5([]);
|
|
3351
3328
|
const computedFallbackText = useMemo9(() => {
|
|
3352
3329
|
if (fallbackText) return fallbackText;
|
|
@@ -3417,8 +3394,8 @@ function FileDisplayContent({
|
|
|
3417
3394
|
if (showFallback) {
|
|
3418
3395
|
return /* @__PURE__ */ jsx21("div", { className: fallbackClasses, title: "File unavailable", children: computedFallbackText });
|
|
3419
3396
|
}
|
|
3420
|
-
return /* @__PURE__ */
|
|
3421
|
-
/* @__PURE__ */
|
|
3397
|
+
return /* @__PURE__ */ jsxs17("div", { className: `p-4 bg-acc-50 border border-acc-200 rounded-lg ${className}`, children: [
|
|
3398
|
+
/* @__PURE__ */ jsxs17("div", { className: "text-acc-600", children: [
|
|
3422
3399
|
"Error loading file: ",
|
|
3423
3400
|
error instanceof Error ? error.message : String(error)
|
|
3424
3401
|
] }),
|
|
@@ -3434,18 +3411,18 @@ function FileDisplayContent({
|
|
|
3434
3411
|
}
|
|
3435
3412
|
if (fileCount === 0 && !isLoading) {
|
|
3436
3413
|
if (showFallback) {
|
|
3437
|
-
return /* @__PURE__ */
|
|
3414
|
+
return /* @__PURE__ */ jsxs17("div", { className: fallbackClasses, title: "No file", children: [
|
|
3438
3415
|
computedFallbackText,
|
|
3439
3416
|
children
|
|
3440
3417
|
] });
|
|
3441
3418
|
}
|
|
3442
|
-
return /* @__PURE__ */
|
|
3419
|
+
return /* @__PURE__ */ jsxs17("div", { className: `text-sec-500 text-center p-4 ${className}`, children: [
|
|
3443
3420
|
"No files found",
|
|
3444
3421
|
children
|
|
3445
3422
|
] });
|
|
3446
3423
|
}
|
|
3447
3424
|
if (isLoading && showFallback && fileCount === 0) {
|
|
3448
|
-
return /* @__PURE__ */
|
|
3425
|
+
return /* @__PURE__ */ jsxs17("div", { className: fallbackClasses, title: "Loading...", children: [
|
|
3449
3426
|
computedFallbackText,
|
|
3450
3427
|
children
|
|
3451
3428
|
] });
|
|
@@ -3478,8 +3455,8 @@ function FileDisplayContent({
|
|
|
3478
3455
|
if (displayOnly && showFallback && (!fileUrl || imageError || !isImage)) {
|
|
3479
3456
|
return /* @__PURE__ */ jsx21("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText });
|
|
3480
3457
|
}
|
|
3481
|
-
return /* @__PURE__ */
|
|
3482
|
-
isImage && fileUrl && !imageError ? /* @__PURE__ */
|
|
3458
|
+
return /* @__PURE__ */ jsxs17("div", { className: `space-y-2 ${className}`, children: [
|
|
3459
|
+
isImage && fileUrl && !imageError ? /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
|
|
3483
3460
|
/* @__PURE__ */ jsx21(
|
|
3484
3461
|
"img",
|
|
3485
3462
|
{
|
|
@@ -3489,7 +3466,7 @@ function FileDisplayContent({
|
|
|
3489
3466
|
onError: handleImageError
|
|
3490
3467
|
}
|
|
3491
3468
|
),
|
|
3492
|
-
showDelete && /* @__PURE__ */
|
|
3469
|
+
showDelete && /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
3493
3470
|
/* @__PURE__ */ jsx21(
|
|
3494
3471
|
"button",
|
|
3495
3472
|
{
|
|
@@ -3500,10 +3477,10 @@ function FileDisplayContent({
|
|
|
3500
3477
|
children: "\xD7"
|
|
3501
3478
|
}
|
|
3502
3479
|
),
|
|
3503
|
-
/* @__PURE__ */ jsx21(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */
|
|
3480
|
+
/* @__PURE__ */ jsx21(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs17(DialogContent, { size: "sm", children: [
|
|
3504
3481
|
/* @__PURE__ */ jsx21(DialogHeader, { children: /* @__PURE__ */ jsx21(DialogTitle, { children: "Confirm Delete" }) }),
|
|
3505
3482
|
/* @__PURE__ */ jsx21(DialogBody, { children: /* @__PURE__ */ jsx21("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
|
|
3506
|
-
/* @__PURE__ */
|
|
3483
|
+
/* @__PURE__ */ jsxs17(DialogFooter, { children: [
|
|
3507
3484
|
/* @__PURE__ */ jsx21(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
|
|
3508
3485
|
/* @__PURE__ */ jsx21(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
|
|
3509
3486
|
] })
|
|
@@ -3512,16 +3489,16 @@ function FileDisplayContent({
|
|
|
3512
3489
|
] }) : isImage && imageError && showFallback ? (
|
|
3513
3490
|
// Show fallback when image fails to load and fallback is enabled
|
|
3514
3491
|
/* @__PURE__ */ jsx21("div", { className: fallbackClasses, title: fileReference.file_metadata.fileName || "File", children: computedFallbackText })
|
|
3515
|
-
) : /* @__PURE__ */
|
|
3492
|
+
) : /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
|
|
3516
3493
|
/* @__PURE__ */ jsx21("span", { className: "text-2xl", children: getFileIcon(fileReference.file_metadata.fileType || "") }),
|
|
3517
|
-
/* @__PURE__ */
|
|
3494
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
|
|
3518
3495
|
/* @__PURE__ */ jsx21("div", { className: "font-medium text-sec-900 truncate", children: fileReference.file_metadata.fileName || "Unknown file" }),
|
|
3519
|
-
/* @__PURE__ */
|
|
3496
|
+
/* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
|
|
3520
3497
|
fileReference.file_metadata.fileSize && formatFileSize(fileReference.file_metadata.fileSize),
|
|
3521
3498
|
fileReference.file_metadata.fileType && ` \u2022 ${fileReference.file_metadata.fileType}`
|
|
3522
3499
|
] })
|
|
3523
3500
|
] }),
|
|
3524
|
-
showDelete && /* @__PURE__ */
|
|
3501
|
+
showDelete && /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
3525
3502
|
/* @__PURE__ */ jsx21(
|
|
3526
3503
|
"button",
|
|
3527
3504
|
{
|
|
@@ -3532,10 +3509,10 @@ function FileDisplayContent({
|
|
|
3532
3509
|
children: "\xD7"
|
|
3533
3510
|
}
|
|
3534
3511
|
),
|
|
3535
|
-
/* @__PURE__ */ jsx21(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */
|
|
3512
|
+
/* @__PURE__ */ jsx21(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxs17(DialogContent, { size: "sm", children: [
|
|
3536
3513
|
/* @__PURE__ */ jsx21(DialogHeader, { children: /* @__PURE__ */ jsx21(DialogTitle, { children: "Confirm Delete" }) }),
|
|
3537
3514
|
/* @__PURE__ */ jsx21(DialogBody, { children: /* @__PURE__ */ jsx21("p", { children: "Are you sure you want to delete this file? This action cannot be undone." }) }),
|
|
3538
|
-
/* @__PURE__ */
|
|
3515
|
+
/* @__PURE__ */ jsxs17(DialogFooter, { children: [
|
|
3539
3516
|
/* @__PURE__ */ jsx21(Button, { variant: "outline", onClick: () => setDeleteDialogOpen(false), children: "Cancel" }),
|
|
3540
3517
|
/* @__PURE__ */ jsx21(Button, { variant: "destructive", onClick: handleDeleteConfirm, children: "Delete" })
|
|
3541
3518
|
] })
|
|
@@ -3545,12 +3522,12 @@ function FileDisplayContent({
|
|
|
3545
3522
|
children
|
|
3546
3523
|
] });
|
|
3547
3524
|
}
|
|
3548
|
-
return /* @__PURE__ */
|
|
3525
|
+
return /* @__PURE__ */ jsxs17("div", { className: `space-y-2 ${className}`, children: [
|
|
3549
3526
|
fileReferences.map((fileRef) => {
|
|
3550
3527
|
const isImage = fileRef.file_metadata.fileType?.startsWith("image/");
|
|
3551
3528
|
const fileUrl2 = internalFileUrls.get(fileRef.id) || null;
|
|
3552
3529
|
const canDownload = !isImage && fileUrl2;
|
|
3553
|
-
return /* @__PURE__ */
|
|
3530
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-3 p-3 bg-sec-50 rounded-lg border border-sec-200", children: [
|
|
3554
3531
|
isImage && fileUrl2 ? /* @__PURE__ */ jsx21(
|
|
3555
3532
|
"img",
|
|
3556
3533
|
{
|
|
@@ -3560,15 +3537,15 @@ function FileDisplayContent({
|
|
|
3560
3537
|
onError: handleImageError
|
|
3561
3538
|
}
|
|
3562
3539
|
) : /* @__PURE__ */ jsx21("span", { className: "text-2xl", children: getFileIcon(fileRef.file_metadata.fileType || "") }),
|
|
3563
|
-
/* @__PURE__ */
|
|
3540
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex-1 min-w-0", children: [
|
|
3564
3541
|
/* @__PURE__ */ jsx21("div", { className: "font-medium text-sec-900 truncate", children: fileRef.file_metadata.fileName || "Unknown file" }),
|
|
3565
|
-
/* @__PURE__ */
|
|
3542
|
+
/* @__PURE__ */ jsxs17("div", { className: "text-sm text-sec-500", children: [
|
|
3566
3543
|
fileRef.file_metadata.fileSize && formatFileSize(fileRef.file_metadata.fileSize),
|
|
3567
3544
|
fileRef.file_metadata.fileType && ` \u2022 ${fileRef.file_metadata.fileType}`,
|
|
3568
3545
|
fileRef.file_metadata.category && ` \u2022 ${fileRef.file_metadata.category}`
|
|
3569
3546
|
] })
|
|
3570
3547
|
] }),
|
|
3571
|
-
/* @__PURE__ */
|
|
3548
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center space-x-2", children: [
|
|
3572
3549
|
canDownload && /* @__PURE__ */ jsx21(
|
|
3573
3550
|
"a",
|
|
3574
3551
|
{
|
|
@@ -3613,19 +3590,6 @@ function FileDisplayPublic({
|
|
|
3613
3590
|
}) {
|
|
3614
3591
|
const publicPageContext = useContext2(PublicPageContext);
|
|
3615
3592
|
const supabase = publicPageContext?.supabase ?? null;
|
|
3616
|
-
console.log("[FileDisplayPublic] Supabase Client Context:", {
|
|
3617
|
-
hasPublicPageContext: !!publicPageContext,
|
|
3618
|
-
hasSupabaseClient: !!supabase,
|
|
3619
|
-
supabaseUrl: publicPageContext?.environment?.supabaseUrl || "not available",
|
|
3620
|
-
hasAnonKey: !!publicPageContext?.environment?.supabaseKey,
|
|
3621
|
-
hasAuth: !!supabase?.auth,
|
|
3622
|
-
organisation_id,
|
|
3623
|
-
table_name,
|
|
3624
|
-
record_id,
|
|
3625
|
-
category,
|
|
3626
|
-
context: "public_page_anonymous_user",
|
|
3627
|
-
note: "Public pages use anonymous Supabase client (no user session)"
|
|
3628
|
-
});
|
|
3629
3593
|
if (!supabase) {
|
|
3630
3594
|
if (showFallback) {
|
|
3631
3595
|
return /* @__PURE__ */ jsx21(
|
|
@@ -3673,7 +3637,7 @@ function FileDisplayPublic({
|
|
|
3673
3637
|
{ supabase }
|
|
3674
3638
|
);
|
|
3675
3639
|
if (error) {
|
|
3676
|
-
|
|
3640
|
+
logger.error("FileDisplayPublic", "Error fetching file", {
|
|
3677
3641
|
table_name,
|
|
3678
3642
|
record_id,
|
|
3679
3643
|
organisation_id,
|
|
@@ -3682,23 +3646,6 @@ function FileDisplayPublic({
|
|
|
3682
3646
|
errorStack: error.stack
|
|
3683
3647
|
});
|
|
3684
3648
|
}
|
|
3685
|
-
if (fileUrl && !isLoading && !error) {
|
|
3686
|
-
console.log("[FileDisplayPublic] File loaded successfully:", {
|
|
3687
|
-
table_name,
|
|
3688
|
-
record_id,
|
|
3689
|
-
category,
|
|
3690
|
-
fileUrl: fileUrl.substring(0, 50) + "..."
|
|
3691
|
-
// Truncate URL for logging
|
|
3692
|
-
});
|
|
3693
|
-
}
|
|
3694
|
-
if (!isLoading && !error && !fileUrl && !fileReference) {
|
|
3695
|
-
console.log("[FileDisplayPublic] No file found (will show fallback if enabled):", {
|
|
3696
|
-
table_name,
|
|
3697
|
-
record_id,
|
|
3698
|
-
category,
|
|
3699
|
-
showFallback
|
|
3700
|
-
});
|
|
3701
|
-
}
|
|
3702
3649
|
const handleDelete = async () => {
|
|
3703
3650
|
};
|
|
3704
3651
|
let finalFileReference = fileReference;
|
|
@@ -3777,7 +3724,7 @@ function FileDisplayAuthenticated({
|
|
|
3777
3724
|
category,
|
|
3778
3725
|
{ supabase }
|
|
3779
3726
|
);
|
|
3780
|
-
const [displayOnlyFileReference, setDisplayOnlyFileReference] =
|
|
3727
|
+
const [displayOnlyFileReference, setDisplayOnlyFileReference] = useState11(null);
|
|
3781
3728
|
const displayOnlyFileUrlFromMap = displayOnlyFileReference ? fileUrls.get(displayOnlyFileReference.id) : null;
|
|
3782
3729
|
const displayOnlyFileUrlHook = useFileUrl(
|
|
3783
3730
|
displayOnlyFileReference && !displayOnlyFileUrlFromMap ? displayOnlyFileReference : null,
|
|
@@ -3982,7 +3929,7 @@ var TableCaption = React18.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
3982
3929
|
TableCaption.displayName = "TableCaption";
|
|
3983
3930
|
|
|
3984
3931
|
// src/components/PublicLayout/PublicPageHeader.tsx
|
|
3985
|
-
import { Fragment as Fragment7, jsx as jsx23, jsxs as
|
|
3932
|
+
import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3986
3933
|
function PublicPageHeader({
|
|
3987
3934
|
event,
|
|
3988
3935
|
eventCode,
|
|
@@ -3995,7 +3942,7 @@ function PublicPageHeader({
|
|
|
3995
3942
|
customEventLogo
|
|
3996
3943
|
}) {
|
|
3997
3944
|
const { appName } = useAppConfig();
|
|
3998
|
-
return /* @__PURE__ */
|
|
3945
|
+
return /* @__PURE__ */ jsxs18("header", { className: cn(
|
|
3999
3946
|
"w-full px-[max(0rem,calc((100vw-var(--app-width))/2-0.5rem))] grid grid-cols-[auto_1fr_auto] place-items-center gap-2",
|
|
4000
3947
|
className
|
|
4001
3948
|
), children: [
|
|
@@ -4007,43 +3954,28 @@ function PublicPageHeader({
|
|
|
4007
3954
|
alt: appName
|
|
4008
3955
|
}
|
|
4009
3956
|
),
|
|
4010
|
-
event && /* @__PURE__ */
|
|
3957
|
+
event && /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
4011
3958
|
/* @__PURE__ */ jsx23("h1", { children: event.event_name }),
|
|
4012
|
-
showEventLogo && event && /* @__PURE__ */ jsx23(Fragment7, { children: customEventLogo || /* @__PURE__ */
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
/* @__PURE__ */ jsx23(
|
|
4027
|
-
FileDisplay,
|
|
4028
|
-
{
|
|
4029
|
-
table_name: "event",
|
|
4030
|
-
record_id: event.event_id,
|
|
4031
|
-
organisation_id: event.organisation_id,
|
|
4032
|
-
category: "event_logos" /* EVENT_LOGOS */,
|
|
4033
|
-
displayOnly: true,
|
|
4034
|
-
showFallback: true,
|
|
4035
|
-
fallbackSize: "md",
|
|
4036
|
-
className: "mr-4 max-w-36 row-span-2",
|
|
4037
|
-
generateFallbackText: (fileName) => {
|
|
4038
|
-
if (!event.event_name) return "EV";
|
|
4039
|
-
return event.event_name.split(/[\s\-_]+/).map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
|
|
4040
|
-
}
|
|
3959
|
+
showEventLogo && event && /* @__PURE__ */ jsx23(Fragment7, { children: customEventLogo || /* @__PURE__ */ jsx23(Fragment7, { children: /* @__PURE__ */ jsx23(
|
|
3960
|
+
FileDisplay,
|
|
3961
|
+
{
|
|
3962
|
+
table_name: "event",
|
|
3963
|
+
record_id: event.event_id,
|
|
3964
|
+
organisation_id: event.organisation_id,
|
|
3965
|
+
category: "event_logos" /* EVENT_LOGOS */,
|
|
3966
|
+
displayOnly: true,
|
|
3967
|
+
showFallback: true,
|
|
3968
|
+
fallbackSize: "md",
|
|
3969
|
+
className: "mr-4 max-w-36 row-span-2",
|
|
3970
|
+
generateFallbackText: (fileName) => {
|
|
3971
|
+
if (!event.event_name) return "EV";
|
|
3972
|
+
return event.event_name.split(/[\s\-_]+/).map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
|
|
4041
3973
|
}
|
|
4042
|
-
|
|
4043
|
-
|
|
3974
|
+
}
|
|
3975
|
+
) }) }),
|
|
4044
3976
|
event.event_venue && /* @__PURE__ */ jsx23("h4", { children: event.event_venue })
|
|
4045
3977
|
] }),
|
|
4046
|
-
title && /* @__PURE__ */
|
|
3978
|
+
title && /* @__PURE__ */ jsxs18(Fragment7, { children: [
|
|
4047
3979
|
/* @__PURE__ */ jsx23("h1", { children: title }),
|
|
4048
3980
|
description && /* @__PURE__ */ jsx23("p", { className: "text-lg text-sec-600 max-w-3xl mx-auto", children: description })
|
|
4049
3981
|
] }),
|
|
@@ -4052,7 +3984,7 @@ function PublicPageHeader({
|
|
|
4052
3984
|
}
|
|
4053
3985
|
|
|
4054
3986
|
// src/components/PublicLayout/PublicPageFooter.tsx
|
|
4055
|
-
import { Fragment as Fragment8, jsx as jsx24, jsxs as
|
|
3987
|
+
import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4056
3988
|
function PublicPageFooter({
|
|
4057
3989
|
event,
|
|
4058
3990
|
companyName = "Solvera Solutions Pty Ltd",
|
|
@@ -4064,7 +3996,7 @@ function PublicPageFooter({
|
|
|
4064
3996
|
children
|
|
4065
3997
|
}) {
|
|
4066
3998
|
const copyrightText = copyright || `\xA9 Copyright 2022\u2013${year} all rights reserved, ${companyName}.`;
|
|
4067
|
-
return /* @__PURE__ */ jsx24("footer", { className: cn("mt-8 py-6 flex justify-center", className), children: /* @__PURE__ */
|
|
3999
|
+
return /* @__PURE__ */ jsx24("footer", { className: cn("mt-8 py-6 flex justify-center", className), children: /* @__PURE__ */ jsxs19("section", { className: "px-4 w-[min(var(--app-width),100%)] mx-auto text-center", children: [
|
|
4068
4000
|
logo && /* @__PURE__ */ jsx24("img", { src: logo, alt: "Logo", className: "h-8 w-auto" }),
|
|
4069
4001
|
children && /* @__PURE__ */ jsx24(Fragment8, { children }),
|
|
4070
4002
|
/* @__PURE__ */ jsx24("span", { className: "text-muted-foreground", children: copyrightText }),
|
|
@@ -4073,7 +4005,7 @@ function PublicPageFooter({
|
|
|
4073
4005
|
}
|
|
4074
4006
|
|
|
4075
4007
|
// src/components/PublicLayout/PublicLoadingSpinner.tsx
|
|
4076
|
-
import { jsx as jsx25, jsxs as
|
|
4008
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4077
4009
|
var sizeClasses = {
|
|
4078
4010
|
sm: "h-4 w-4",
|
|
4079
4011
|
md: "h-8 w-8",
|
|
@@ -4090,7 +4022,7 @@ function PublicLoadingSpinner({
|
|
|
4090
4022
|
}) {
|
|
4091
4023
|
const sizeClass = sizeClasses[size];
|
|
4092
4024
|
const displayMessage = customMessage || message;
|
|
4093
|
-
const content = /* @__PURE__ */
|
|
4025
|
+
const content = /* @__PURE__ */ jsxs20("div", { className: cn("flex flex-col items-center", className), children: [
|
|
4094
4026
|
showLogo && /* @__PURE__ */ jsx25("div", { className: "mb-4", children: /* @__PURE__ */ jsx25(
|
|
4095
4027
|
"img",
|
|
4096
4028
|
{
|
|
@@ -4099,7 +4031,7 @@ function PublicLoadingSpinner({
|
|
|
4099
4031
|
alt: "PACE Core"
|
|
4100
4032
|
}
|
|
4101
4033
|
) }),
|
|
4102
|
-
/* @__PURE__ */
|
|
4034
|
+
/* @__PURE__ */ jsxs20("div", { className: "relative", children: [
|
|
4103
4035
|
/* @__PURE__ */ jsx25(
|
|
4104
4036
|
"div",
|
|
4105
4037
|
{
|
|
@@ -4128,7 +4060,7 @@ function PublicLoadingSpinnerFullPage({
|
|
|
4128
4060
|
return /* @__PURE__ */ jsx25("div", { className: cn(
|
|
4129
4061
|
"min-h-screen bg-background flex items-center justify-center",
|
|
4130
4062
|
className
|
|
4131
|
-
), children: /* @__PURE__ */
|
|
4063
|
+
), children: /* @__PURE__ */ jsxs20("div", { className: "max-w-md mx-auto text-center px-4", children: [
|
|
4132
4064
|
/* @__PURE__ */ jsx25("div", { className: "mb-8", children: /* @__PURE__ */ jsx25(
|
|
4133
4065
|
"img",
|
|
4134
4066
|
{
|
|
@@ -4147,7 +4079,7 @@ function PublicLoadingSpinnerFullPage({
|
|
|
4147
4079
|
}
|
|
4148
4080
|
) }),
|
|
4149
4081
|
/* @__PURE__ */ jsx25("p", { className: "text-lg text-sec-600", children: message }),
|
|
4150
|
-
/* @__PURE__ */
|
|
4082
|
+
/* @__PURE__ */ jsxs20("div", { className: "mt-4 flex justify-center space-x-1", children: [
|
|
4151
4083
|
/* @__PURE__ */ jsx25("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
|
|
4152
4084
|
/* @__PURE__ */ jsx25("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
|
|
4153
4085
|
/* @__PURE__ */ jsx25("div", { className: "h-2 w-2 bg-main-600 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
|
|
@@ -4171,7 +4103,7 @@ function PublicLoadingSkeleton({
|
|
|
4171
4103
|
}
|
|
4172
4104
|
|
|
4173
4105
|
// src/components/PublicLayout/PublicPageLayout.tsx
|
|
4174
|
-
import { Fragment as Fragment9, jsx as jsx26, jsxs as
|
|
4106
|
+
import { Fragment as Fragment9, jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4175
4107
|
function PublicPageLayout({
|
|
4176
4108
|
eventCode,
|
|
4177
4109
|
children,
|
|
@@ -4207,9 +4139,9 @@ function PublicPageLayout({
|
|
|
4207
4139
|
if (ErrorFallback) {
|
|
4208
4140
|
return /* @__PURE__ */ jsx26(ErrorFallback, { error, retry: handleRefetch });
|
|
4209
4141
|
}
|
|
4210
|
-
return /* @__PURE__ */
|
|
4142
|
+
return /* @__PURE__ */ jsxs21("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
|
|
4211
4143
|
/* @__PURE__ */ jsx26("h1", { children: "Event Not Found" }),
|
|
4212
|
-
/* @__PURE__ */
|
|
4144
|
+
/* @__PURE__ */ jsxs21("p", { children: [
|
|
4213
4145
|
'The event code "',
|
|
4214
4146
|
eventCode,
|
|
4215
4147
|
'" is invalid or the event is not available for public viewing.'
|
|
@@ -4218,13 +4150,13 @@ function PublicPageLayout({
|
|
|
4218
4150
|
] });
|
|
4219
4151
|
}
|
|
4220
4152
|
if (!event && showValidationErrors) {
|
|
4221
|
-
return /* @__PURE__ */
|
|
4153
|
+
return /* @__PURE__ */ jsxs21("main", { className: "flex flex-col items-center justify-center px-4 w-[min(var(--app-width),100%)] mx-auto py-8", children: [
|
|
4222
4154
|
/* @__PURE__ */ jsx26("h1", { children: "Event Not Available" }),
|
|
4223
4155
|
/* @__PURE__ */ jsx26("p", { children: "This event is not available for public viewing." }),
|
|
4224
4156
|
handleRefetch && /* @__PURE__ */ jsx26(Button, { onClick: handleRefetch, children: "Try Again" })
|
|
4225
4157
|
] });
|
|
4226
4158
|
}
|
|
4227
|
-
return /* @__PURE__ */ jsx26(PublicErrorBoundary, { children: /* @__PURE__ */
|
|
4159
|
+
return /* @__PURE__ */ jsx26(PublicErrorBoundary, { children: /* @__PURE__ */ jsxs21(Fragment9, { children: [
|
|
4228
4160
|
customHeader || /* @__PURE__ */ jsx26(
|
|
4229
4161
|
PublicPageHeader,
|
|
4230
4162
|
{
|
|
@@ -4249,259 +4181,64 @@ function usePublicPageContext2() {
|
|
|
4249
4181
|
};
|
|
4250
4182
|
}
|
|
4251
4183
|
|
|
4252
|
-
// src/components/PublicLayout/PublicPageDebugger.tsx
|
|
4253
|
-
import { useEffect as useEffect9 } from "react";
|
|
4254
|
-
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4255
|
-
function PublicPageDebugger({ enabled = true, label = "PublicPage" }) {
|
|
4256
|
-
useEffect9(() => {
|
|
4257
|
-
if (!enabled) return;
|
|
4258
|
-
console.log(`[${label}] Component mounted`);
|
|
4259
|
-
try {
|
|
4260
|
-
const { isPublicPage } = usePublicPageContext();
|
|
4261
|
-
console.log(`[${label}] Public page context detected:`, isPublicPage);
|
|
4262
|
-
} catch (error) {
|
|
4263
|
-
console.warn(`[${label}] Not in PublicPageProvider context:`, error instanceof Error ? error.message : String(error));
|
|
4264
|
-
}
|
|
4265
|
-
try {
|
|
4266
|
-
const { isAuthenticated } = (init_UnifiedAuthProvider2(), __toCommonJS(UnifiedAuthProvider_exports)).useUnifiedAuth();
|
|
4267
|
-
console.warn(`[${label}] AUTHENTICATION CONTEXT DETECTED! This should not happen in public pages.`);
|
|
4268
|
-
console.warn(`[${label}] isAuthenticated:`, isAuthenticated);
|
|
4269
|
-
} catch (error) {
|
|
4270
|
-
console.log(`[${label}] No authentication context detected (good for public pages)`);
|
|
4271
|
-
}
|
|
4272
|
-
try {
|
|
4273
|
-
const { selectedOrganisation } = (init_OrganisationProvider(), __toCommonJS(OrganisationProvider_exports)).useOrganisations();
|
|
4274
|
-
console.warn(`[${label}] ORGANISATION CONTEXT DETECTED! This should not happen in public pages.`);
|
|
4275
|
-
console.warn(`[${label}] selectedOrganisation:`, selectedOrganisation);
|
|
4276
|
-
} catch (error) {
|
|
4277
|
-
console.log(`[${label}] No organisation context detected (good for public pages)`);
|
|
4278
|
-
}
|
|
4279
|
-
try {
|
|
4280
|
-
const { events } = (init_EventProvider(), __toCommonJS(EventProvider_exports)).useEvents();
|
|
4281
|
-
console.warn(`[${label}] EVENT CONTEXT DETECTED! This should not happen in public pages.`);
|
|
4282
|
-
console.warn(`[${label}] events:`, events);
|
|
4283
|
-
} catch (error) {
|
|
4284
|
-
console.log(`[${label}] No event context detected (good for public pages)`);
|
|
4285
|
-
}
|
|
4286
|
-
const supabaseUrl = import.meta.env?.VITE_SUPABASE_URL;
|
|
4287
|
-
const supabaseKey = import.meta.env?.VITE_SUPABASE_ANON_KEY;
|
|
4288
|
-
console.log(`[${label}] Environment variables:`, {
|
|
4289
|
-
supabaseUrl: supabaseUrl ? "Present" : "Missing",
|
|
4290
|
-
supabaseKey: supabaseKey ? "Present" : "Missing"
|
|
4291
|
-
});
|
|
4292
|
-
return () => {
|
|
4293
|
-
console.log(`[${label}] Component unmounted`);
|
|
4294
|
-
};
|
|
4295
|
-
}, [enabled, label]);
|
|
4296
|
-
if (!enabled) return null;
|
|
4297
|
-
return /* @__PURE__ */ jsxs23("div", { style: {
|
|
4298
|
-
position: "fixed",
|
|
4299
|
-
top: 0,
|
|
4300
|
-
right: 0,
|
|
4301
|
-
background: "rgba(0,0,0,0.8)",
|
|
4302
|
-
color: "white",
|
|
4303
|
-
padding: "8px",
|
|
4304
|
-
fontSize: "12px",
|
|
4305
|
-
zIndex: 9999,
|
|
4306
|
-
fontFamily: "monospace"
|
|
4307
|
-
}, children: [
|
|
4308
|
-
/* @__PURE__ */ jsx27("div", { children: "Public Page Debugger" }),
|
|
4309
|
-
/* @__PURE__ */ jsx27("div", { children: "Check console for context analysis" })
|
|
4310
|
-
] });
|
|
4311
|
-
}
|
|
4312
|
-
|
|
4313
|
-
// src/components/PublicLayout/PublicPageDiagnostic.tsx
|
|
4314
|
-
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
4315
|
-
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4316
|
-
function PublicPageDiagnostic({ enabled = true, label = "PublicPage" }) {
|
|
4317
|
-
const [diagnostics, setDiagnostics] = useState13({
|
|
4318
|
-
hasPublicPageContext: false,
|
|
4319
|
-
hasAuthContext: false,
|
|
4320
|
-
hasOrgContext: false,
|
|
4321
|
-
hasEventContext: false,
|
|
4322
|
-
hasEnvironmentVars: false,
|
|
4323
|
-
routeParams: null
|
|
4324
|
-
});
|
|
4325
|
-
useEffect10(() => {
|
|
4326
|
-
if (!enabled) return;
|
|
4327
|
-
const runDiagnostics = () => {
|
|
4328
|
-
const newDiagnostics = {
|
|
4329
|
-
hasPublicPageContext: false,
|
|
4330
|
-
hasAuthContext: false,
|
|
4331
|
-
hasOrgContext: false,
|
|
4332
|
-
hasEventContext: false,
|
|
4333
|
-
hasEnvironmentVars: false,
|
|
4334
|
-
routeParams: null
|
|
4335
|
-
};
|
|
4336
|
-
try {
|
|
4337
|
-
const { isPublicPage } = usePublicPageContext();
|
|
4338
|
-
newDiagnostics.hasPublicPageContext = isPublicPage === true;
|
|
4339
|
-
} catch (error) {
|
|
4340
|
-
newDiagnostics.hasPublicPageContext = false;
|
|
4341
|
-
}
|
|
4342
|
-
try {
|
|
4343
|
-
const { isAuthenticated } = (init_UnifiedAuthProvider2(), __toCommonJS(UnifiedAuthProvider_exports)).useUnifiedAuth();
|
|
4344
|
-
newDiagnostics.hasAuthContext = true;
|
|
4345
|
-
} catch (error) {
|
|
4346
|
-
newDiagnostics.hasAuthContext = false;
|
|
4347
|
-
}
|
|
4348
|
-
try {
|
|
4349
|
-
const { selectedOrganisation } = (init_OrganisationProvider(), __toCommonJS(OrganisationProvider_exports)).useOrganisations();
|
|
4350
|
-
newDiagnostics.hasOrgContext = true;
|
|
4351
|
-
} catch (error) {
|
|
4352
|
-
newDiagnostics.hasOrgContext = false;
|
|
4353
|
-
}
|
|
4354
|
-
try {
|
|
4355
|
-
const { events } = (init_EventProvider(), __toCommonJS(EventProvider_exports)).useEvents();
|
|
4356
|
-
newDiagnostics.hasEventContext = true;
|
|
4357
|
-
} catch (error) {
|
|
4358
|
-
newDiagnostics.hasEventContext = false;
|
|
4359
|
-
}
|
|
4360
|
-
const supabaseUrl = import.meta.env?.VITE_SUPABASE_URL;
|
|
4361
|
-
const supabaseKey = import.meta.env?.VITE_SUPABASE_ANON_KEY;
|
|
4362
|
-
newDiagnostics.hasEnvironmentVars = !!(supabaseUrl && supabaseKey);
|
|
4363
|
-
try {
|
|
4364
|
-
const { useParams } = __require("react-router-dom");
|
|
4365
|
-
const params = useParams();
|
|
4366
|
-
newDiagnostics.routeParams = params;
|
|
4367
|
-
} catch (error) {
|
|
4368
|
-
newDiagnostics.routeParams = null;
|
|
4369
|
-
}
|
|
4370
|
-
setDiagnostics(newDiagnostics);
|
|
4371
|
-
console.group(`\u{1F50D} [${label}] Public Page Diagnostics`);
|
|
4372
|
-
console.log("\u2705 Public Page Context:", newDiagnostics.hasPublicPageContext ? "PRESENT" : "MISSING");
|
|
4373
|
-
console.log("\u274C Auth Context:", newDiagnostics.hasAuthContext ? "PRESENT (BAD!)" : "ABSENT (GOOD!)");
|
|
4374
|
-
console.log("\u274C Org Context:", newDiagnostics.hasOrgContext ? "PRESENT (BAD!)" : "ABSENT (GOOD!)");
|
|
4375
|
-
console.log("\u274C Event Context:", newDiagnostics.hasEventContext ? "PRESENT (BAD!)" : "ABSENT (GOOD!)");
|
|
4376
|
-
console.log("\u2705 Environment Vars:", newDiagnostics.hasEnvironmentVars ? "PRESENT" : "MISSING");
|
|
4377
|
-
console.log("\u2705 Route Params:", newDiagnostics.routeParams);
|
|
4378
|
-
console.groupEnd();
|
|
4379
|
-
if (newDiagnostics.hasAuthContext || newDiagnostics.hasOrgContext || newDiagnostics.hasEventContext) {
|
|
4380
|
-
console.error(`\u{1F6A8} [${label}] PROBLEM DETECTED: Public page is inside authentication context!`);
|
|
4381
|
-
console.error("\u{1F527} SOLUTION: Move public routes outside of UnifiedAuthProvider, OrganisationProvider, and EventProvider");
|
|
4382
|
-
console.error("\u{1F4D6} See: packages/core/docs/emergency-public-pages-fix.md");
|
|
4383
|
-
} else if (!newDiagnostics.hasPublicPageContext) {
|
|
4384
|
-
console.warn(`\u26A0\uFE0F [${label}] WARNING: Not in PublicPageProvider context`);
|
|
4385
|
-
console.warn("\u{1F527} SOLUTION: Wrap your public page component in <PublicPageProvider>");
|
|
4386
|
-
} else if (!newDiagnostics.hasEnvironmentVars) {
|
|
4387
|
-
console.warn(`\u26A0\uFE0F [${label}] WARNING: Missing environment variables`);
|
|
4388
|
-
console.warn("\u{1F527} SOLUTION: Set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY in your environment");
|
|
4389
|
-
} else {
|
|
4390
|
-
console.log(`\u2705 [${label}] All diagnostics passed! Public page should work correctly.`);
|
|
4391
|
-
}
|
|
4392
|
-
};
|
|
4393
|
-
runDiagnostics();
|
|
4394
|
-
}, [enabled, label]);
|
|
4395
|
-
if (!enabled) return null;
|
|
4396
|
-
return /* @__PURE__ */ jsxs24("div", { style: {
|
|
4397
|
-
position: "fixed",
|
|
4398
|
-
top: 0,
|
|
4399
|
-
left: 0,
|
|
4400
|
-
background: "rgba(0,0,0,0.9)",
|
|
4401
|
-
color: "white",
|
|
4402
|
-
padding: "12px",
|
|
4403
|
-
fontSize: "11px",
|
|
4404
|
-
zIndex: 9999,
|
|
4405
|
-
fontFamily: "monospace",
|
|
4406
|
-
maxWidth: "300px",
|
|
4407
|
-
borderRadius: "0 0 8px 0"
|
|
4408
|
-
}, children: [
|
|
4409
|
-
/* @__PURE__ */ jsx28("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F50D} Public Page Diagnostics" }),
|
|
4410
|
-
/* @__PURE__ */ jsxs24("div", { children: [
|
|
4411
|
-
"Public Context: ",
|
|
4412
|
-
diagnostics.hasPublicPageContext ? "\u2705" : "\u274C"
|
|
4413
|
-
] }),
|
|
4414
|
-
/* @__PURE__ */ jsxs24("div", { children: [
|
|
4415
|
-
"Auth Context: ",
|
|
4416
|
-
diagnostics.hasAuthContext ? "\u274C BAD" : "\u2705 GOOD"
|
|
4417
|
-
] }),
|
|
4418
|
-
/* @__PURE__ */ jsxs24("div", { children: [
|
|
4419
|
-
"Org Context: ",
|
|
4420
|
-
diagnostics.hasOrgContext ? "\u274C BAD" : "\u2705 GOOD"
|
|
4421
|
-
] }),
|
|
4422
|
-
/* @__PURE__ */ jsxs24("div", { children: [
|
|
4423
|
-
"Event Context: ",
|
|
4424
|
-
diagnostics.hasEventContext ? "\u274C BAD" : "\u2705 GOOD"
|
|
4425
|
-
] }),
|
|
4426
|
-
/* @__PURE__ */ jsxs24("div", { children: [
|
|
4427
|
-
"Env Vars: ",
|
|
4428
|
-
diagnostics.hasEnvironmentVars ? "\u2705" : "\u274C"
|
|
4429
|
-
] }),
|
|
4430
|
-
/* @__PURE__ */ jsxs24("div", { children: [
|
|
4431
|
-
"Route Params: ",
|
|
4432
|
-
diagnostics.routeParams ? "\u2705" : "\u274C"
|
|
4433
|
-
] }),
|
|
4434
|
-
/* @__PURE__ */ jsx28("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.8 }, children: "Check console for detailed analysis" })
|
|
4435
|
-
] });
|
|
4436
|
-
}
|
|
4437
|
-
|
|
4438
4184
|
// src/components/PublicLayout/PublicPageContextChecker.tsx
|
|
4439
|
-
import { useEffect as
|
|
4440
|
-
|
|
4185
|
+
import { useEffect as useEffect9 } from "react";
|
|
4186
|
+
init_logger();
|
|
4187
|
+
import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4441
4188
|
function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4189
|
+
const isDebugEnabled = import.meta.env.MODE === "development" && import.meta.env.VITE_ENABLE_DEBUG_LOGS === "true" || import.meta.env.MODE === "test" || import.meta.env.VITEST === true || typeof process !== "undefined" && false;
|
|
4190
|
+
if (!isDebugEnabled || !enabled) {
|
|
4191
|
+
return null;
|
|
4192
|
+
}
|
|
4193
|
+
useEffect9(() => {
|
|
4194
|
+
logger.debug("PublicPageContextChecker", `\u{1F6A8} [${label}] PUBLIC PAGE CONTEXT CHECK`);
|
|
4445
4195
|
try {
|
|
4446
4196
|
const { isAuthenticated } = (init_UnifiedAuthProvider2(), __toCommonJS(UnifiedAuthProvider_exports)).useUnifiedAuth();
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4197
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] AUTHENTICATION CONTEXT DETECTED!`);
|
|
4198
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] isAuthenticated:`, isAuthenticated);
|
|
4199
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] This public page is inside UnifiedAuthProvider - THIS IS WRONG!`);
|
|
4200
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] SOLUTION: Move public routes outside of authentication providers`);
|
|
4451
4201
|
} catch (error) {
|
|
4452
|
-
|
|
4202
|
+
logger.debug("PublicPageContextChecker", `\u2705 [${label}] No authentication context detected (GOOD!)`);
|
|
4453
4203
|
}
|
|
4454
4204
|
try {
|
|
4455
4205
|
const { selectedOrganisation } = (init_OrganisationProvider(), __toCommonJS(OrganisationProvider_exports)).useOrganisations();
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4206
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] ORGANISATION CONTEXT DETECTED!`);
|
|
4207
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] selectedOrganisation:`, selectedOrganisation);
|
|
4208
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] This public page is inside OrganisationProvider - THIS IS WRONG!`);
|
|
4209
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] SOLUTION: Move public routes outside of authentication providers`);
|
|
4460
4210
|
} catch (error) {
|
|
4461
|
-
|
|
4211
|
+
logger.debug("PublicPageContextChecker", `\u2705 [${label}] No organisation context detected (GOOD!)`);
|
|
4462
4212
|
}
|
|
4463
4213
|
try {
|
|
4464
4214
|
const { events } = (init_EventProvider(), __toCommonJS(EventProvider_exports)).useEvents();
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4215
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] EVENT CONTEXT DETECTED!`);
|
|
4216
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] events:`, events);
|
|
4217
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] This public page is inside EventProvider - THIS IS WRONG!`);
|
|
4218
|
+
logger.error("PublicPageContextChecker", `\u274C [${label}] SOLUTION: Move public routes outside of authentication providers`);
|
|
4469
4219
|
} catch (error) {
|
|
4470
|
-
|
|
4220
|
+
logger.debug("PublicPageContextChecker", `\u2705 [${label}] No event context detected (GOOD!)`);
|
|
4471
4221
|
}
|
|
4472
4222
|
try {
|
|
4473
4223
|
const { isPublicPage } = usePublicPageContext();
|
|
4474
4224
|
if (isPublicPage) {
|
|
4475
|
-
|
|
4225
|
+
logger.debug("PublicPageContextChecker", `\u2705 [${label}] Public page context detected (GOOD!)`);
|
|
4476
4226
|
} else {
|
|
4477
|
-
|
|
4478
|
-
|
|
4227
|
+
logger.warn("PublicPageContextChecker", `\u26A0\uFE0F [${label}] Not in PublicPageProvider context`);
|
|
4228
|
+
logger.warn("PublicPageContextChecker", `\u26A0\uFE0F [${label}] SOLUTION: Wrap your public page in <PublicPageProvider>`);
|
|
4479
4229
|
}
|
|
4480
4230
|
} catch (error) {
|
|
4481
|
-
|
|
4482
|
-
|
|
4231
|
+
logger.warn("PublicPageContextChecker", `\u26A0\uFE0F [${label}] Not in PublicPageProvider context`);
|
|
4232
|
+
logger.warn("PublicPageContextChecker", `\u26A0\uFE0F [${label}] SOLUTION: Wrap your public page in <PublicPageProvider>`);
|
|
4483
4233
|
}
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
console.log(`1. Check your main App.tsx file`);
|
|
4491
|
-
console.log(`2. Make sure public routes are completely separate from authentication providers`);
|
|
4492
|
-
console.log(`3. Follow the architecture in: packages/core/docs/public-pages-guide.md`);
|
|
4493
|
-
console.log(``);
|
|
4494
|
-
console.log(`\u2705 CORRECT ARCHITECTURE:`);
|
|
4495
|
-
console.log(`<BrowserRouter>`);
|
|
4496
|
-
console.log(` <Routes>`);
|
|
4497
|
-
console.log(` <Route path="/events/*" element={<PublicPageApp />} />`);
|
|
4498
|
-
console.log(` <Route path="/*" element={<AuthenticatedApp />} />`);
|
|
4499
|
-
console.log(` </Routes>`);
|
|
4500
|
-
console.log(`</BrowserRouter>`);
|
|
4501
|
-
console.groupEnd();
|
|
4234
|
+
logger.debug("PublicPageContextChecker", `\u{1F4D6} [${label}] IMMEDIATE ACTION REQUIRED`);
|
|
4235
|
+
logger.debug("PublicPageContextChecker", `If you see any \u274C errors above, your public page is inside authentication context.`);
|
|
4236
|
+
logger.debug("PublicPageContextChecker", `This will cause infinite loading loops and authentication errors.`);
|
|
4237
|
+
logger.debug("PublicPageContextChecker", `\u{1F527} SOLUTION: Check your main App.tsx file`);
|
|
4238
|
+
logger.debug("PublicPageContextChecker", `Make sure public routes are completely separate from authentication providers`);
|
|
4239
|
+
logger.debug("PublicPageContextChecker", `Follow the architecture in: packages/core/docs/public-pages-guide.md`);
|
|
4502
4240
|
}, [enabled, label]);
|
|
4503
|
-
|
|
4504
|
-
return /* @__PURE__ */ jsxs25("div", { style: {
|
|
4241
|
+
return /* @__PURE__ */ jsxs22("div", { style: {
|
|
4505
4242
|
position: "fixed",
|
|
4506
4243
|
top: 0,
|
|
4507
4244
|
left: 0,
|
|
@@ -4515,18 +4252,90 @@ function PublicPageContextChecker({ enabled = true, label = "PublicPage" }) {
|
|
|
4515
4252
|
borderRadius: "0 0 8px 0",
|
|
4516
4253
|
border: "2px solid #dc2626"
|
|
4517
4254
|
}, children: [
|
|
4518
|
-
/* @__PURE__ */
|
|
4519
|
-
/* @__PURE__ */
|
|
4520
|
-
/* @__PURE__ */
|
|
4255
|
+
/* @__PURE__ */ jsx27("div", { style: { fontWeight: "bold", marginBottom: "8px" }, children: "\u{1F6A8} PUBLIC PAGE CONTEXT CHECK" }),
|
|
4256
|
+
/* @__PURE__ */ jsx27("div", { children: "Check console for authentication context analysis" }),
|
|
4257
|
+
/* @__PURE__ */ jsx27("div", { style: { marginTop: "8px", fontSize: "10px", opacity: 0.9 }, children: "If you see \u274C errors in console, your public page is inside auth context!" })
|
|
4521
4258
|
] });
|
|
4522
4259
|
}
|
|
4523
4260
|
|
|
4261
|
+
// src/components/PublicLayout/EventLogo.tsx
|
|
4262
|
+
import React20 from "react";
|
|
4263
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4264
|
+
function defaultGenerateFallbackText2(eventName) {
|
|
4265
|
+
if (!eventName) return "EV";
|
|
4266
|
+
return eventName.split(" ").map((word) => word.charAt(0).toUpperCase()).join("").substring(0, 3);
|
|
4267
|
+
}
|
|
4268
|
+
function EventLogo({
|
|
4269
|
+
eventId,
|
|
4270
|
+
eventName,
|
|
4271
|
+
organisationId,
|
|
4272
|
+
size = "md",
|
|
4273
|
+
className = "",
|
|
4274
|
+
showFallback = true,
|
|
4275
|
+
generateFallbackText = defaultGenerateFallbackText2,
|
|
4276
|
+
validateImage = true,
|
|
4277
|
+
// Deprecated but kept for backward compatibility
|
|
4278
|
+
loadingComponent: LoadingComponent,
|
|
4279
|
+
errorComponent: ErrorComponent
|
|
4280
|
+
}) {
|
|
4281
|
+
const adaptedGenerateFallbackText = React20.useCallback(
|
|
4282
|
+
(fileName) => {
|
|
4283
|
+
return generateFallbackText(eventName || fileName || "");
|
|
4284
|
+
},
|
|
4285
|
+
[eventName, generateFallbackText]
|
|
4286
|
+
);
|
|
4287
|
+
const adaptedErrorComponent = ErrorComponent ? React20.useCallback(
|
|
4288
|
+
({ error }) => {
|
|
4289
|
+
const errorObj = error instanceof Error ? error : new Error(String(error || "Unknown error"));
|
|
4290
|
+
return /* @__PURE__ */ jsx28(ErrorComponent, { error: errorObj });
|
|
4291
|
+
},
|
|
4292
|
+
[ErrorComponent]
|
|
4293
|
+
) : void 0;
|
|
4294
|
+
return /* @__PURE__ */ jsx28(
|
|
4295
|
+
FileDisplay,
|
|
4296
|
+
{
|
|
4297
|
+
table_name: "event",
|
|
4298
|
+
record_id: eventId,
|
|
4299
|
+
organisation_id: organisationId,
|
|
4300
|
+
category: "event_logos" /* EVENT_LOGOS */,
|
|
4301
|
+
displayOnly: true,
|
|
4302
|
+
showFallback,
|
|
4303
|
+
fallbackSize: size,
|
|
4304
|
+
className,
|
|
4305
|
+
generateFallbackText: adaptedGenerateFallbackText,
|
|
4306
|
+
loadingComponent: LoadingComponent,
|
|
4307
|
+
errorComponent: adaptedErrorComponent
|
|
4308
|
+
}
|
|
4309
|
+
);
|
|
4310
|
+
}
|
|
4311
|
+
function EventLogoCompact(props) {
|
|
4312
|
+
return /* @__PURE__ */ jsx28(
|
|
4313
|
+
EventLogo,
|
|
4314
|
+
{
|
|
4315
|
+
...props,
|
|
4316
|
+
size: "sm",
|
|
4317
|
+
className: `${props.className || ""} rounded-sm`
|
|
4318
|
+
}
|
|
4319
|
+
);
|
|
4320
|
+
}
|
|
4321
|
+
function EventLogoLarge(props) {
|
|
4322
|
+
return /* @__PURE__ */ jsx28(
|
|
4323
|
+
EventLogo,
|
|
4324
|
+
{
|
|
4325
|
+
...props,
|
|
4326
|
+
size: "xl",
|
|
4327
|
+
className: `${props.className || ""} rounded-lg`
|
|
4328
|
+
}
|
|
4329
|
+
);
|
|
4330
|
+
}
|
|
4331
|
+
|
|
4524
4332
|
export {
|
|
4525
4333
|
init_EventProvider,
|
|
4526
4334
|
Label,
|
|
4527
4335
|
Avatar,
|
|
4528
4336
|
AvatarImage,
|
|
4529
4337
|
AvatarFallback,
|
|
4338
|
+
Badge,
|
|
4530
4339
|
Switch,
|
|
4531
4340
|
ToastProvider,
|
|
4532
4341
|
ToastViewport,
|
|
@@ -4550,7 +4359,6 @@ export {
|
|
|
4550
4359
|
ProtectedRoute,
|
|
4551
4360
|
ErrorBoundary,
|
|
4552
4361
|
OrganisationSelector,
|
|
4553
|
-
PasswordResetForm,
|
|
4554
4362
|
useFileReference,
|
|
4555
4363
|
useFileReferenceForRecord,
|
|
4556
4364
|
useFileReferenceById,
|
|
@@ -4572,8 +4380,9 @@ export {
|
|
|
4572
4380
|
PublicLoadingSkeleton,
|
|
4573
4381
|
PublicPageLayout,
|
|
4574
4382
|
usePublicPageContext2 as usePublicPageContext,
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4383
|
+
PublicPageContextChecker,
|
|
4384
|
+
EventLogo,
|
|
4385
|
+
EventLogoCompact,
|
|
4386
|
+
EventLogoLarge
|
|
4578
4387
|
};
|
|
4579
|
-
//# sourceMappingURL=chunk-
|
|
4388
|
+
//# sourceMappingURL=chunk-KYRHUBIU.js.map
|