@jmruthers/pace-core 0.6.7 → 0.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/audit-tool/00-dependencies.cjs +215 -9
  3. package/audit-tool/audits/02-project-structure.cjs +41 -53
  4. package/audit-tool/audits/03-architecture.cjs +34 -6
  5. package/audit-tool/audits/06-security-rbac.cjs +10 -0
  6. package/audit-tool/audits/07-api-tech-stack.cjs +55 -1
  7. package/audit-tool/index.cjs +23 -19
  8. package/audit-tool/utils/report-utils.cjs +141 -2
  9. package/dist/{DataTable-7PMH7XN7.js → DataTable-SOAFXIWY.js} +5 -5
  10. package/dist/{PublicPageProvider-DlsCaR5v.d.ts → PublicPageProvider-CIGSujI2.d.ts} +14 -8
  11. package/dist/{UnifiedAuthProvider-ZT6TIGM7.js → UnifiedAuthProvider-7SNDOWYD.js} +2 -2
  12. package/dist/{api-Y4MQWOFW.js → api-7P7DI652.js} +1 -1
  13. package/dist/{chunk-L4XMVJKY.js → chunk-4DDCYDQ3.js} +8 -7
  14. package/dist/{chunk-JGWDVX64.js → chunk-5HNSDQWH.js} +125 -55
  15. package/dist/{chunk-ZKAWKYT4.js → chunk-5W2A3DRC.js} +2 -1
  16. package/dist/{chunk-IUBRCBSY.js → chunk-C7ZQ5O4C.js} +11 -5
  17. package/dist/{chunk-VBCS3DUA.js → chunk-EF2UGZWY.js} +3 -3
  18. package/dist/{chunk-BM4CQ5P3.js → chunk-GS5672WG.js} +6 -6
  19. package/dist/{chunk-Q7Q7V5NV.js → chunk-J2U36LHD.js} +72 -9
  20. package/dist/{chunk-ZFYPMX46.js → chunk-LX6U42O3.js} +1 -1
  21. package/dist/{chunk-5X4QLXRG.js → chunk-MPBLMWVR.js} +5 -3
  22. package/dist/{chunk-6F3IILHI.js → chunk-S6ZQKDY6.js} +1 -1
  23. package/dist/{chunk-FTCRZOG2.js → chunk-T5CVK4R3.js} +5 -5
  24. package/dist/{chunk-GHYHJTYV.js → chunk-Z2FNRKF3.js} +13 -13
  25. package/dist/components.d.ts +1 -1
  26. package/dist/components.js +12 -12
  27. package/dist/{database.generated-CcnC_DRc.d.ts → database.generated-DT8JTZiP.d.ts} +12 -12
  28. package/dist/eslint-rules/rules/04-code-quality.cjs +66 -10
  29. package/dist/eslint-rules/rules/06-security-rbac.cjs +8 -3
  30. package/dist/eslint-rules/rules/07-api-tech-stack.cjs +190 -68
  31. package/dist/{functions-DHebl8-F.d.ts → functions-lBy5L2ry.d.ts} +1 -1
  32. package/dist/hooks.d.ts +3 -3
  33. package/dist/hooks.js +7 -7
  34. package/dist/index.d.ts +6 -6
  35. package/dist/index.js +16 -16
  36. package/dist/providers.js +2 -2
  37. package/dist/rbac/index.d.ts +2 -2
  38. package/dist/rbac/index.js +6 -6
  39. package/dist/theming/runtime.d.ts +48 -1
  40. package/dist/theming/runtime.js +1 -1
  41. package/dist/{timezone-BZe_eUxx.d.ts → timezone-0AyangqX.d.ts} +1 -1
  42. package/dist/types.d.ts +3 -3
  43. package/dist/{usePublicRouteParams-MamNgwqe.d.ts → usePublicRouteParams-DQLrDqDb.d.ts} +1 -1
  44. package/dist/utils.d.ts +3 -3
  45. package/dist/utils.js +3 -3
  46. package/docs/api/modules.md +64 -15
  47. package/docs/api-reference/rpc-functions.md +3 -3
  48. package/docs/getting-started/dependencies.md +23 -0
  49. package/docs/implementation-guides/app-layout.md +1 -1
  50. package/docs/implementation-guides/data-tables.md +67 -1
  51. package/docs/standards/1-pace-core-compliance-standards.md +38 -1
  52. package/eslint-config-pace-core.cjs +30 -11
  53. package/package.json +45 -15
  54. package/scripts/eslint-audit.cjs +123 -0
  55. package/scripts/install-eslint-config.cjs +67 -2
  56. package/scripts/validate-dependencies.cjs +248 -0
  57. package/src/__tests__/helpers/__tests__/test-utils.test.tsx +20 -8
  58. package/src/__tests__/templates/accessibility.test.template.tsx +1 -0
  59. package/src/components/AddressField/AddressField.tsx +26 -1
  60. package/src/components/Alert/Alert.test.tsx +86 -22
  61. package/src/components/Alert/Alert.tsx +19 -11
  62. package/src/components/Badge/Badge.tsx +1 -1
  63. package/src/components/Checkbox/Checkbox.test.tsx +2 -1
  64. package/src/components/ContextSelector/ContextSelector.tsx +39 -41
  65. package/src/components/DataTable/DataTable.tsx +1 -19
  66. package/src/components/DataTable/__tests__/DataTable.select-label-display.test.tsx +483 -0
  67. package/src/components/DataTable/__tests__/DataTableCore.test.tsx +6 -10
  68. package/src/components/DataTable/__tests__/a11y.basic.test.tsx +18 -9
  69. package/src/components/DataTable/__tests__/pagination.modes.test.tsx +3 -2
  70. package/src/components/DataTable/components/EmptyState.tsx +1 -1
  71. package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.test.tsx +1 -1
  72. package/src/components/DataTable/components/__tests__/EmptyState.test.tsx +3 -3
  73. package/src/components/DataTable/components/__tests__/LoadingState.test.tsx +33 -29
  74. package/src/components/DataTable/hooks/__tests__/useTableColumns.test.ts +224 -0
  75. package/src/components/DataTable/hooks/useTableColumns.ts +23 -1
  76. package/src/components/DataTable/utils/__tests__/selectFieldUtils.test.ts +207 -0
  77. package/src/components/DataTable/utils/index.ts +1 -0
  78. package/src/components/DataTable/utils/selectFieldUtils.ts +134 -0
  79. package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.test.tsx +1 -2
  80. package/src/components/FileUpload/FileUpload.test.tsx +22 -31
  81. package/src/components/FileUpload/FileUpload.tsx +29 -0
  82. package/src/components/NavigationMenu/NavigationMenu.test.tsx +48 -12
  83. package/src/components/PaceAppLayout/PaceAppLayout.performance.test.tsx +9 -9
  84. package/src/components/PaceAppLayout/PaceAppLayout.security.test.tsx +30 -30
  85. package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +4 -4
  86. package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +7 -1
  87. package/src/components/UserMenu/UserMenu.tsx +3 -5
  88. package/src/hooks/__tests__/useDataTablePerformance.unit.test.ts +8 -5
  89. package/src/hooks/__tests__/useFileUrl.unit.test.ts +4 -0
  90. package/src/hooks/__tests__/useFocusTrap.unit.test.tsx +3 -3
  91. package/src/hooks/__tests__/useInactivityTracker.unit.test.ts +45 -8
  92. package/src/hooks/__tests__/usePerformanceMonitor.unit.test.ts +22 -2
  93. package/src/hooks/public/usePublicRouteParams.ts +8 -4
  94. package/src/hooks/useAddressAutocomplete.test.ts +18 -18
  95. package/src/hooks/useEventTheme.ts +5 -1
  96. package/src/hooks/useFileUrl.ts +52 -8
  97. package/src/hooks/useOrganisationSecurity.test.ts +2 -1
  98. package/src/providers/__tests__/ProviderLifecycle.test.tsx +1 -1
  99. package/src/rbac/__tests__/auth-rbac.e2e.test.tsx +15 -6
  100. package/src/rbac/__tests__/rbac-functions.test.ts +3 -3
  101. package/src/rbac/api.test.ts +104 -0
  102. package/src/rbac/engine.ts +1 -1
  103. package/src/rbac/hooks/useCan.test.ts +2 -2
  104. package/src/rbac/secureClient.ts +1 -1
  105. package/src/rbac/types/functions.ts +1 -1
  106. package/src/theming/__tests__/parseEventColours.test.ts +117 -8
  107. package/src/theming/parseEventColours.ts +56 -2
  108. package/src/types/database.generated.ts +9 -9
  109. package/src/types/supabase.ts +2 -3
  110. package/src/utils/__tests__/bundleAnalysis.unit.test.ts +9 -9
  111. package/src/utils/file-reference/__tests__/file-reference.test.ts +4 -0
  112. package/src/utils/formatting/formatDate.test.ts +3 -2
  113. package/src/utils/formatting/formatDateTime.test.ts +2 -2
  114. package/src/utils/google-places/googlePlacesUtils.test.ts +36 -24
  115. package/src/utils/storage/__tests__/helpers.unit.test.ts +19 -12
  116. package/src/utils/storage/helpers.test.ts +69 -3
  117. package/src/utils/supabase/createBaseClient.ts +25 -7
@@ -26,7 +26,8 @@ function parseAndNormalizeEventColours(input) {
26
26
  for (const key in p) {
27
27
  const value = p[key];
28
28
  if (value !== null && value !== void 0 && value !== "") {
29
- out[key] = value;
29
+ const normalizedKey = typeof key === "string" && key.startsWith("ev-") ? key.substring(3) : key;
30
+ out[normalizedKey] = value;
30
31
  }
31
32
  }
32
33
  return out;
@@ -283,12 +283,12 @@ var ALLOWED_FILE_PATTERNS = [
283
283
  /[\/\\]src[\/\\]supabase\.(tsx?|jsx?)(\?|:|\s|$)/i
284
284
  ];
285
285
  function isAllowedContext() {
286
- if (typeof process !== "undefined" && true) {
287
- return true;
288
- }
286
+ const isProduction = typeof process !== "undefined" && true || typeof import.meta !== "undefined" && import.meta.env?.MODE === "production" || typeof import.meta !== "undefined" && import.meta.env?.PROD === true;
289
287
  try {
290
288
  const stack = new Error().stack;
291
- if (!stack) return false;
289
+ if (!stack) {
290
+ return isProduction;
291
+ }
292
292
  const stackLines = stack.split("\n");
293
293
  for (const line of stackLines) {
294
294
  for (const pattern of ALLOWED_FILE_PATTERNS) {
@@ -297,9 +297,15 @@ function isAllowedContext() {
297
297
  }
298
298
  }
299
299
  }
300
+ const hasMinifiedFiles = stackLines.some(
301
+ (line) => /index-[a-zA-Z0-9]+\.js/i.test(line) || /assets\/index-[a-zA-Z0-9]+\.js/i.test(line)
302
+ );
303
+ if (hasMinifiedFiles || isProduction) {
304
+ return true;
305
+ }
300
306
  return false;
301
307
  } catch {
302
- return true;
308
+ return isProduction;
303
309
  }
304
310
  }
305
311
  function createBaseClient(supabaseUrl, supabaseKey) {
@@ -1,4 +1,4 @@
1
- import { UnifiedAuthContext, useUnifiedAuth, useOrganisations } from './chunk-FTCRZOG2.js';
1
+ import { UnifiedAuthContext, useUnifiedAuth, useOrganisations } from './chunk-T5CVK4R3.js';
2
2
  import { cn, performanceBudgetMonitor } from './chunk-7ILTDCL2.js';
3
3
  import { logger } from './chunk-TTRFSOKR.js';
4
4
  import * as React from 'react';
@@ -507,7 +507,7 @@ var useOrganisationSecurity = () => {
507
507
  const targetOrgId = orgId || selectedOrganisation?.id;
508
508
  if (!targetOrgId || !user) return false;
509
509
  try {
510
- const { isPermittedCached } = await import('./api-Y4MQWOFW.js');
510
+ const { isPermittedCached } = await import('./api-7P7DI652.js');
511
511
  const scope = {
512
512
  organisationId: targetOrgId,
513
513
  eventId: user.user_metadata?.eventId || user.app_metadata?.eventId,
@@ -530,7 +530,7 @@ var useOrganisationSecurity = () => {
530
530
  const targetOrgId = orgId || selectedOrganisation?.id;
531
531
  if (!targetOrgId || !user) return [];
532
532
  try {
533
- const { getPermissionMap } = await import('./api-Y4MQWOFW.js');
533
+ const { getPermissionMap } = await import('./api-7P7DI652.js');
534
534
  const scope = {
535
535
  organisationId: targetOrgId,
536
536
  eventId: user.user_metadata?.eventId || user.app_metadata?.eventId,
@@ -1,6 +1,6 @@
1
- import { useAppConfig, useOrganisationSecurity } from './chunk-VBCS3DUA.js';
2
- import { useEventService, useUnifiedAuth, useOrganisations } from './chunk-FTCRZOG2.js';
3
- import { OrganisationContextRequiredError, getRBACLogger, resolveAppContext, getPageScopeType, ContextValidator, getPermissionMap, getRoleContext, getAccessLevel, isPermittedCached, isPermitted, isSuperAdmin } from './chunk-ZFYPMX46.js';
1
+ import { useAppConfig, useOrganisationSecurity } from './chunk-EF2UGZWY.js';
2
+ import { useEventService, useUnifiedAuth, useOrganisations } from './chunk-T5CVK4R3.js';
3
+ import { OrganisationContextRequiredError, getRBACLogger, resolveAppContext, getPageScopeType, ContextValidator, getPermissionMap, getRoleContext, getAccessLevel, isPermittedCached, isPermitted, isSuperAdmin } from './chunk-LX6U42O3.js';
4
4
  import { getCurrentAppName } from './chunk-OJ4SKRSV.js';
5
5
  import { cn } from './chunk-7ILTDCL2.js';
6
6
  import { createLogger, logger } from './chunk-TTRFSOKR.js';
@@ -530,7 +530,7 @@ var _SecureSupabaseClient = class _SecureSupabaseClient {
530
530
  }
531
531
  const rpcContextWhitelist = {
532
532
  // RPCs that accept all three context parameters
533
- "rbac_roles_list": /* @__PURE__ */ new Set(["p_organisation_id", "p_event_id", "p_app_id"]),
533
+ "data_rbac_roles_list": /* @__PURE__ */ new Set(["p_organisation_id", "p_event_id", "p_app_id"]),
534
534
  // RPCs that accept only p_organisation_id (not p_app_id or p_event_id)
535
535
  "data_file_reference_by_category_list": /* @__PURE__ */ new Set(["p_organisation_id"])
536
536
  // Add more RPCs here as we discover them
@@ -881,7 +881,7 @@ function useAccessLevel(userId, scope) {
881
881
  try {
882
882
  setIsLoading(true);
883
883
  setError(null);
884
- const { isSuperAdmin: checkSuperAdmin } = await import('./api-Y4MQWOFW.js');
884
+ const { isSuperAdmin: checkSuperAdmin } = await import('./api-7P7DI652.js');
885
885
  const isSuperAdminUser = await checkSuperAdmin(userId);
886
886
  if (isSuperAdminUser) {
887
887
  setAccessLevel("super");
@@ -959,7 +959,7 @@ function useCan(userId, scope, permission, pageId, useCache = true, precomputedS
959
959
  const checkSuperAdmin = async () => {
960
960
  const startTime = Date.now();
961
961
  try {
962
- const { isSuperAdmin: checkSuperAdmin2 } = await import('./api-Y4MQWOFW.js');
962
+ const { isSuperAdmin: checkSuperAdmin2 } = await import('./api-7P7DI652.js');
963
963
  const timeoutWarning = setTimeout(() => {
964
964
  if (!cancelled) {
965
965
  console.warn("[useCan] Super admin check taking longer than 5 seconds", {
@@ -1,8 +1,8 @@
1
- import { Button, ButtonGroup, useResolvedScope, useCan } from './chunk-BM4CQ5P3.js';
1
+ import { Button, ButtonGroup, useResolvedScope, useCan } from './chunk-GS5672WG.js';
2
2
  import { useFocusTrap, useDataTablePerformance, toast } from './chunk-S7DKJPLT.js';
3
- import { Card, CardHeader, CardDescription, CardContent, CardFooter, CardTitle } from './chunk-VBCS3DUA.js';
4
- import { useUnifiedAuth } from './chunk-FTCRZOG2.js';
5
- import { isSuperAdmin } from './chunk-ZFYPMX46.js';
3
+ import { Card, CardHeader, CardDescription, CardContent, CardFooter, CardTitle } from './chunk-EF2UGZWY.js';
4
+ import { useUnifiedAuth } from './chunk-T5CVK4R3.js';
5
+ import { isSuperAdmin } from './chunk-LX6U42O3.js';
6
6
  import { renderSafeHtml, LoadingSpinner } from './chunk-A3W6LW53.js';
7
7
  import { cn } from './chunk-7ILTDCL2.js';
8
8
  import { createLogger } from './chunk-TTRFSOKR.js';
@@ -1153,17 +1153,17 @@ var getAlertClasses = (variant = "default") => {
1153
1153
  };
1154
1154
  return `${baseClasses} ${variantClasses[variant]}`;
1155
1155
  };
1156
- var Alert = React7.forwardRef(({ className, variant = "default", ...props }, ref) => {
1156
+ var Alert = React7.forwardRef(({ className, variant = "default", role = "alert", ...props }, ref) => {
1157
1157
  const contextValue = React7.useMemo(() => ({ variant }), [variant]);
1158
1158
  if (variant === "inline") {
1159
1159
  return /* @__PURE__ */ jsx(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(React7.Fragment, { ...props }) });
1160
1160
  }
1161
1161
  return /* @__PURE__ */ jsx(AlertContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
1162
- "aside",
1162
+ "p",
1163
1163
  {
1164
1164
  ref,
1165
1165
  className: cn(getAlertClasses(variant), className),
1166
- role: "alert",
1166
+ role,
1167
1167
  ...props
1168
1168
  }
1169
1169
  ) });
@@ -7142,6 +7142,62 @@ var ColumnFactory = class {
7142
7142
  }
7143
7143
  };
7144
7144
 
7145
+ // src/components/DataTable/utils/selectFieldUtils.ts
7146
+ function findSelectLabel(value, fieldOptions) {
7147
+ if (!fieldOptions || fieldOptions.length === 0) {
7148
+ return null;
7149
+ }
7150
+ if (value === null || value === void 0) {
7151
+ return null;
7152
+ }
7153
+ const normalizedValue = typeof value === "string" && !isNaN(Number(value)) && value.trim() !== "" ? Number(value) : value;
7154
+ for (const option of fieldOptions) {
7155
+ if ("type" in option && option.type === "separator") {
7156
+ continue;
7157
+ }
7158
+ if ("value" in option && !("type" in option)) {
7159
+ const optionValue = option.value;
7160
+ if (optionValue === normalizedValue) {
7161
+ return option.label;
7162
+ }
7163
+ if (typeof optionValue === "number" && typeof normalizedValue === "string") {
7164
+ const numValue = Number(normalizedValue);
7165
+ if (!isNaN(numValue) && optionValue === numValue) {
7166
+ return option.label;
7167
+ }
7168
+ }
7169
+ if (typeof optionValue === "string" && typeof normalizedValue === "number") {
7170
+ const numValue = Number(optionValue);
7171
+ if (!isNaN(numValue) && numValue === normalizedValue) {
7172
+ return option.label;
7173
+ }
7174
+ }
7175
+ }
7176
+ if ("type" in option && option.type === "group") {
7177
+ const groupOption = option;
7178
+ for (const item of groupOption.items) {
7179
+ const itemValue = item.value;
7180
+ if (itemValue === normalizedValue) {
7181
+ return item.label;
7182
+ }
7183
+ if (typeof itemValue === "number" && typeof normalizedValue === "string") {
7184
+ const numValue = Number(normalizedValue);
7185
+ if (!isNaN(numValue) && itemValue === numValue) {
7186
+ return item.label;
7187
+ }
7188
+ }
7189
+ if (typeof itemValue === "string" && typeof normalizedValue === "number") {
7190
+ const numValue = Number(itemValue);
7191
+ if (!isNaN(numValue) && numValue === normalizedValue) {
7192
+ return item.label;
7193
+ }
7194
+ }
7195
+ }
7196
+ }
7197
+ }
7198
+ return null;
7199
+ }
7200
+
7145
7201
  // src/components/DataTable/hooks/useTableColumns.ts
7146
7202
  function useTableColumns({
7147
7203
  columns,
@@ -7151,13 +7207,20 @@ function useTableColumns({
7151
7207
  }) {
7152
7208
  const enhancedColumns = useMemo(() => {
7153
7209
  const baseColumns = [...columns].map((column) => {
7210
+ const dataTableColumn = column;
7154
7211
  const baseColumn = {
7155
7212
  ...column,
7156
7213
  enableSorting: features.sorting && column.enableSorting !== false,
7157
7214
  enableColumnFilter: features.filtering && column.enableColumnFilter !== false,
7158
7215
  enableGrouping: features.grouping && column.enableGrouping !== false
7159
7216
  };
7160
- const dataTableColumn = column;
7217
+ if (dataTableColumn.fieldType === "select" && dataTableColumn.fieldOptions && dataTableColumn.fieldOptions.length > 0 && !baseColumn.cell) {
7218
+ baseColumn.cell = ({ getValue, row, column: col }) => {
7219
+ const value = getValue();
7220
+ const label = findSelectLabel(value, dataTableColumn.fieldOptions);
7221
+ return label !== null ? label : String(value ?? "");
7222
+ };
7223
+ }
7161
7224
  const isNumericColumn = column.meta?.type === "number" || dataTableColumn.fieldType === "number" || dataTableColumn.filterType === "number";
7162
7225
  const isDateColumn = column.meta?.type === "date" || dataTableColumn.fieldType === "date" || dataTableColumn.filterType === "date";
7163
7226
  if (isNumericColumn && !isDateColumn) {
@@ -8451,4 +8514,4 @@ function max(accessorKey) {
8451
8514
  };
8452
8515
  }
8453
8516
 
8454
- export { ActionButtons, Alert, AlertDescription, AlertTitle, BulkOperationsDropdown, Checkbox, ColumnFactory, ColumnVisibilityDropdown, DataTable, DataTableCore, DataTableErrorBoundary, DataTableModals, DataTableToolbar, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, EditableRow, EmptyState, EnhancedPaginationControls, GroupingDropdown, ImportModal, Input, Label, LoadingState, PaginationControls, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SortIndicator, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, UnifiedTableBody, announce, announceBulkOperation, announceFilterChange, announceLoadingState, announcePaginationChange, announceSearchResults, announceSelectionChange, announceSortChange, average, calculateAllDepths, calculateAllIndentation, calculateIndentation, calculateOptimalPageSize, cleanupLiveRegion, count, createHierarchicalStructure, defaultDataTableFeatures, deriveFormKey, exportToCSV, exportToCSVWithTableRows, filterSensitiveFields, generateCSVContent, getAriaSortState, getAriaSortValue, getCellRenderer, getColumnHeaderText, getHierarchicalSortConfig, getPageSizeOptions, getPaginationBinding, getRowDepth, getRowDescription, getRowIdSafe, getSortButtonLabel, groupHierarchicalData, hasValidRowId, initializeLiveRegion, isHierarchicalSortableColumn, isSensitiveField, max, min, normalizeDataTableFeatures, shouldShowColumnForRow, sortHierarchicalDataByStructure, sortHierarchicalDataWithSorting, sum, useSessionDraft, validateHierarchicalData, validatePaginationConfig };
8517
+ export { ActionButtons, Alert, AlertDescription, AlertTitle, BulkOperationsDropdown, Checkbox, ColumnFactory, ColumnVisibilityDropdown, DataTable, DataTableCore, DataTableErrorBoundary, DataTableModals, DataTableToolbar, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, EditableRow, EmptyState, EnhancedPaginationControls, GroupingDropdown, ImportModal, Input, Label, LoadingState, PaginationControls, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, SortIndicator, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, UnifiedTableBody, announce, announceBulkOperation, announceFilterChange, announceLoadingState, announcePaginationChange, announceSearchResults, announceSelectionChange, announceSortChange, average, calculateAllDepths, calculateAllIndentation, calculateIndentation, calculateOptimalPageSize, cleanupLiveRegion, count, createHierarchicalStructure, defaultDataTableFeatures, deriveFormKey, exportToCSV, exportToCSVWithTableRows, filterSensitiveFields, findSelectLabel, generateCSVContent, getAriaSortState, getAriaSortValue, getCellRenderer, getColumnHeaderText, getHierarchicalSortConfig, getPageSizeOptions, getPaginationBinding, getRowDepth, getRowDescription, getRowIdSafe, getSortButtonLabel, groupHierarchicalData, hasValidRowId, initializeLiveRegion, isHierarchicalSortableColumn, isSensitiveField, max, min, normalizeDataTableFeatures, shouldShowColumnForRow, sortHierarchicalDataByStructure, sortHierarchicalDataWithSorting, sum, useSessionDraft, validateHierarchicalData, validatePaginationConfig };
@@ -1349,7 +1349,7 @@ var RBACEngine = class {
1349
1349
  async resolveAppContext(input) {
1350
1350
  try {
1351
1351
  const { userId, appName } = input;
1352
- const { data, error } = await this.supabase.rpc("util_app_resolve", {
1352
+ const { data, error } = await this.supabase.rpc("data_app_resolve", {
1353
1353
  p_user_id: userId,
1354
1354
  p_app_name: appName
1355
1355
  });
@@ -1,5 +1,5 @@
1
- import { clearPalette, parseAndNormalizeEventColours, applyPalette } from './chunk-ZKAWKYT4.js';
2
- import { EventServiceContext } from './chunk-FTCRZOG2.js';
1
+ import { clearPalette, parseAndNormalizeEventColours, applyPalette } from './chunk-5W2A3DRC.js';
2
+ import { EventServiceContext } from './chunk-T5CVK4R3.js';
3
3
  import { assertAppId } from './chunk-4SXLQIZO.js';
4
4
  import { fetchPlaceDetails, createAddressFromPlaceResult, getAddressByPlaceId, fetchPlaceAutocomplete, setOrganisationContext } from './chunk-FYHN4DD5.js';
5
5
  import { createLogger, logger } from './chunk-TTRFSOKR.js';
@@ -1238,7 +1238,7 @@ var FileReferenceServiceImpl = class {
1238
1238
  const userIdForCheck = authenticatedUserId || options.userId;
1239
1239
  if (userIdForCheck) {
1240
1240
  try {
1241
- const { isSuperAdmin } = await import('./api-Y4MQWOFW.js');
1241
+ const { isSuperAdmin } = await import('./api-7P7DI652.js');
1242
1242
  isSuperAdminUser = await isSuperAdmin(userIdForCheck);
1243
1243
  if (isSuperAdminUser) {
1244
1244
  log3.debug("Super admin detected - bypassing permission checks", { userId: userIdForCheck });
@@ -2087,6 +2087,7 @@ function invalidateFileDisplayCache(table_name, record_id, organisation_id, cate
2087
2087
  authenticatedFileCache.delete(allCategoryKey);
2088
2088
  }
2089
2089
  }
2090
+ var log4 = createLogger("useEventTheme");
2090
2091
  function useEventTheme(event) {
2091
2092
  const location = useLocation();
2092
2093
  const eventServiceContext = useContext(EventServiceContext);
@@ -2111,6 +2112,7 @@ function useEventTheme(event) {
2111
2112
  try {
2112
2113
  applyPalette(normalized);
2113
2114
  } catch (error) {
2115
+ log4.error("Failed to apply event palette:", error);
2114
2116
  }
2115
2117
  return () => {
2116
2118
  };
@@ -1,4 +1,4 @@
1
- import { Button } from './chunk-BM4CQ5P3.js';
1
+ import { Button } from './chunk-GS5672WG.js';
2
2
  import { ShieldX } from 'lucide-react';
3
3
  import { jsx, jsxs } from 'react/jsx-runtime';
4
4
 
@@ -1,4 +1,4 @@
1
- import { isRBACInitialized, setupRBAC } from './chunk-ZFYPMX46.js';
1
+ import { isRBACInitialized, setupRBAC } from './chunk-LX6U42O3.js';
2
2
  import { assertOrganisationId, assertUserId } from './chunk-4SXLQIZO.js';
3
3
  import { secureStorage } from './chunk-HF6O3O37.js';
4
4
  import { createLogger, logger } from './chunk-TTRFSOKR.js';
@@ -1017,7 +1017,7 @@ var _OrganisationService = class _OrganisationService extends BaseService {
1017
1017
  let userIsSuperAdmin = false;
1018
1018
  if (this.user?.id) {
1019
1019
  try {
1020
- const { isSuperAdmin: checkSuperAdmin, isRBACInitialized: isRBACInitialized2, setupRBAC: setupRBAC2 } = await import('./api-Y4MQWOFW.js');
1020
+ const { isSuperAdmin: checkSuperAdmin, isRBACInitialized: isRBACInitialized2, setupRBAC: setupRBAC2 } = await import('./api-7P7DI652.js');
1021
1021
  if (!isRBACInitialized2() && this.supabaseClient) {
1022
1022
  setupRBAC2(this.supabaseClient);
1023
1023
  }
@@ -1276,7 +1276,7 @@ var _EventService = class _EventService extends BaseService {
1276
1276
  this.setSelectedEventId = setSelectedEventId;
1277
1277
  if (user?.id) {
1278
1278
  try {
1279
- const { isRBACInitialized: isRBACInitialized2, isSuperAdmin: checkSuperAdmin, setupRBAC: setupRBAC2 } = await import('./api-Y4MQWOFW.js');
1279
+ const { isRBACInitialized: isRBACInitialized2, isSuperAdmin: checkSuperAdmin, setupRBAC: setupRBAC2 } = await import('./api-7P7DI652.js');
1280
1280
  if (!isRBACInitialized2() && this.supabaseClient) {
1281
1281
  setupRBAC2(this.supabaseClient);
1282
1282
  }
@@ -1490,7 +1490,7 @@ var _EventService = class _EventService extends BaseService {
1490
1490
  let organisationIdForRpc = null;
1491
1491
  let userIsSuperAdmin = this.isSuperAdmin;
1492
1492
  try {
1493
- const { isRBACInitialized: isRBACInitialized2, isSuperAdmin: checkSuperAdmin, setupRBAC: setupRBAC2 } = await import('./api-Y4MQWOFW.js');
1493
+ const { isRBACInitialized: isRBACInitialized2, isSuperAdmin: checkSuperAdmin, setupRBAC: setupRBAC2 } = await import('./api-7P7DI652.js');
1494
1494
  if (!isRBACInitialized2() && this.supabaseClient) {
1495
1495
  setupRBAC2(this.supabaseClient);
1496
1496
  }
@@ -2386,7 +2386,7 @@ function UnifiedAuthContextProvider({
2386
2386
  resolvedUserIdRef.current = currentUserId;
2387
2387
  const userId = currentUserId;
2388
2388
  const appNameValue = appName;
2389
- import('./api-Y4MQWOFW.js').then(async ({ resolveAppContext, setupRBAC: setupRBAC2 }) => {
2389
+ import('./api-7P7DI652.js').then(async ({ resolveAppContext, setupRBAC: setupRBAC2 }) => {
2390
2390
  try {
2391
2391
  setupRBAC2(supabase);
2392
2392
  const result = await resolveAppContext({
@@ -1,7 +1,7 @@
1
- import { AccessDenied } from './chunk-6F3IILHI.js';
2
- import { useResolvedScope, scopeEqual, useCan, useMultiplePermissions } from './chunk-BM4CQ5P3.js';
3
- import { useUnifiedAuth } from './chunk-FTCRZOG2.js';
4
- import { getRBACLogger, getRBACConfig, RBACNotInitializedError } from './chunk-ZFYPMX46.js';
1
+ import { AccessDenied } from './chunk-S6ZQKDY6.js';
2
+ import { useResolvedScope, scopeEqual, useCan, useMultiplePermissions } from './chunk-GS5672WG.js';
3
+ import { useUnifiedAuth } from './chunk-T5CVK4R3.js';
4
+ import { getRBACLogger, getRBACConfig, RBACNotInitializedError } from './chunk-LX6U42O3.js';
5
5
  import { createLogger } from './chunk-TTRFSOKR.js';
6
6
  import React, { useRef, useMemo, useState, useEffect } from 'react';
7
7
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
@@ -14,7 +14,7 @@ var RPCFunction = /* @__PURE__ */ ((RPCFunction2) => {
14
14
  RPCFunction2["RBAC_PAGE_ACCESS_CHECK"] = "rbac_page_access_check";
15
15
  RPCFunction2["RBAC_ROLE_GRANT"] = "rbac_role_grant";
16
16
  RPCFunction2["RBAC_ROLE_REVOKE"] = "rbac_role_revoke";
17
- RPCFunction2["RBAC_ROLES_LIST"] = "rbac_roles_list";
17
+ RPCFunction2["RBAC_ROLES_LIST"] = "data_rbac_roles_list";
18
18
  RPCFunction2["RBAC_ROLE_VALIDATE"] = "rbac_role_validate";
19
19
  RPCFunction2["RBAC_SESSION_TRACK"] = "rbac_session_track";
20
20
  RPCFunction2["RBAC_AUDIT_LOG"] = "rbac_audit_log";
@@ -74,7 +74,7 @@ var PagePermissionGuardComponent = ({
74
74
  const checkSuperAdmin = async () => {
75
75
  const startTime = Date.now();
76
76
  try {
77
- const { isSuperAdmin: checkSuperAdmin2 } = await import('./api-Y4MQWOFW.js');
77
+ const { isSuperAdmin: checkSuperAdmin2 } = await import('./api-7P7DI652.js');
78
78
  const timeoutPromise = new Promise((_, reject) => {
79
79
  setTimeout(() => reject(new Error("Super admin check timeout")), 1e4);
80
80
  });
@@ -377,7 +377,7 @@ function withPermissionGuard(config, handler) {
377
377
  if (!userId || !organisationId) {
378
378
  throw new Error("User context required for permission check");
379
379
  }
380
- const { isPermitted: isPermitted2 } = await import('./api-Y4MQWOFW.js');
380
+ const { isPermitted: isPermitted2 } = await import('./api-7P7DI652.js');
381
381
  const hasPermission = await isPermitted2({
382
382
  userId,
383
383
  scope: { organisationId, eventId, appId },
@@ -400,7 +400,7 @@ function withAccessLevelGuard(minLevel, handler) {
400
400
  if (!userId || !organisationId) {
401
401
  throw new Error("User context required for access level check");
402
402
  }
403
- const { getAccessLevel: getAccessLevel2 } = await import('./api-Y4MQWOFW.js');
403
+ const { getAccessLevel: getAccessLevel2 } = await import('./api-7P7DI652.js');
404
404
  const accessLevel = await getAccessLevel2({
405
405
  userId,
406
406
  scope: { organisationId, eventId, appId }
@@ -425,7 +425,7 @@ function withRoleGuard(config, handler) {
425
425
  throw new Error("User context required for role check");
426
426
  }
427
427
  if (config.globalRoles && config.globalRoles.length > 0) {
428
- const { isSuperAdmin } = await import('./api-Y4MQWOFW.js');
428
+ const { isSuperAdmin } = await import('./api-7P7DI652.js');
429
429
  const isSuper = await isSuperAdmin(userId);
430
430
  if (isSuper) {
431
431
  if (organisationId) {
@@ -451,14 +451,14 @@ function withRoleGuard(config, handler) {
451
451
  }
452
452
  }
453
453
  if (config.organisationRoles && config.organisationRoles.length > 0) {
454
- const { isOrganisationAdmin } = await import('./api-Y4MQWOFW.js');
454
+ const { isOrganisationAdmin } = await import('./api-7P7DI652.js');
455
455
  const isOrgAdmin = await isOrganisationAdmin(userId, organisationId);
456
456
  if (!isOrgAdmin && config.requireAll !== false) {
457
457
  throw new Error(`Organisation admin role required`);
458
458
  }
459
459
  }
460
460
  if (config.eventAppRoles && config.eventAppRoles.length > 0 && eventId && appId) {
461
- const { isEventAdmin } = await import('./api-Y4MQWOFW.js');
461
+ const { isEventAdmin } = await import('./api-7P7DI652.js');
462
462
  const isEventAdminUser = await isEventAdmin(userId, { organisationId, eventId, appId });
463
463
  if (!isEventAdminUser && config.requireAll !== false) {
464
464
  throw new Error(`Event admin role required`);
@@ -498,7 +498,7 @@ function createRBACMiddleware(config) {
498
498
  );
499
499
  if (protectedRoute) {
500
500
  try {
501
- const { isPermitted: isPermitted2 } = await import('./api-Y4MQWOFW.js');
501
+ const { isPermitted: isPermitted2 } = await import('./api-7P7DI652.js');
502
502
  const hasPermission = await isPermitted2({
503
503
  userId,
504
504
  scope: { organisationId },
@@ -525,7 +525,7 @@ function createRBACExpressMiddleware(config) {
525
525
  return res.status(401).json({ error: "User context required" });
526
526
  }
527
527
  try {
528
- const { isPermitted: isPermitted2 } = await import('./api-Y4MQWOFW.js');
528
+ const { isPermitted: isPermitted2 } = await import('./api-7P7DI652.js');
529
529
  const hasPermission = await isPermitted2({
530
530
  userId,
531
531
  scope: { organisationId, eventId, appId },
@@ -1,5 +1,5 @@
1
1
  export { a as UnifiedAuthContextType, d as UnifiedAuthProvider, c as UnifiedAuthProviderProps, u as useUnifiedAuth } from './UnifiedAuthProvider-CKvHP1MK.js';
2
- export { A as AddressField, k as AddressFieldProps, l as AddressFieldRef, o as Alert, q as AlertDescription, p as AlertTitle, r as Avatar, s as AvatarProps, t as Badge, u as BadgeProps, v as BadgeVariant, B as Button, a as ButtonProps, am as Calendar, an as CalendarProps, C as Card, g as CardActions, i as CardActionsProps, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, w as Checkbox, aP as ContextSelector, aQ as ContextSelectorProps, M as Dialog, V as DialogBody, a4 as DialogBodyProps, Q as DialogClose, a1 as DialogCloseProps, R as DialogContent, $ as DialogContentProps, Y as DialogDescription, W as DialogFooter, a3 as DialogFooterProps, U as DialogHeader, a2 as DialogHeaderProps, N as DialogPortal, a0 as DialogPortalProps, Z as DialogProps, a5 as DialogSize, X as DialogTitle, O as DialogTrigger, _ as DialogTriggerProps, aS as ErrorBoundary, aU as ErrorBoundaryProps, aT as ErrorBoundaryProvider, aW as ErrorBoundaryProviderProps, aV as ErrorBoundaryState, b1 as FileDisplay, b2 as FileDisplayProps, a$ as FileUpload, b0 as FileUploadProps, aK as Footer, aL as FooterProps, aD as Form, aE as FormField, aG as FormFieldProps, aF as FormProps, aX as GlobalErrorHandler, aJ as Header, I as Input, j as InputProps, L as Label, m as LabelProps, aY as LoadingSpinner, aH as LoginForm, aI as LoginFormProps, aO as NavigationMenu, bk as PaceAppLayout, bj as PaceAppLayoutProps, bm as PaceLoginPage, bl as PaceLoginPageProps, P as Progress, y as ProgressProps, aM as ProtectedRoute, aN as ProtectedRouteProps, bc as PublicPageFooter, bi as PublicPageFooterProps, bb as PublicPageHeader, bh as PublicPageHeaderProps, ba as PublicPageLayout, bg as PublicPageLayoutProps, bd as PublicPageProvider, a6 as Select, aa as SelectContent, a7 as SelectGroup, ac as SelectItem, ab as SelectLabel, ad as SelectSeparator, a9 as SelectTrigger, a8 as SelectValue, aZ as SessionRestorationLoader, a_ as SessionRestorationLoaderProps, S as Switch, x as SwitchProps, z as Table, E as TableBody, F as TableCaption, G as TableCell, H as TableFooter, J as TableHead, D as TableHeader, K as TableRow, ae as Tabs, ah as TabsContent, al as TabsContentProps, af as TabsList, aj as TabsListProps, ai as TabsProps, ag as TabsTrigger, ak as TabsTriggerProps, T as Textarea, n as TextareaProps, ao as Toast, aq as ToastAction, aw as ToastActionElement, av as ToastClose, au as ToastDescription, ax as ToastProps, ar as ToastProvider, at as ToastTitle, as as ToastViewport, ap as Toaster, ay as Tooltip, aA as TooltipContent, aB as TooltipProvider, aC as TooltipRoot, az as TooltipTrigger, b9 as UseFileReferenceForRecordReturn, b7 as UseFileReferenceOptions, b8 as UseFileReferenceReturn, aR as UserMenu, b3 as useFileReference, b5 as useFileReferenceById, b4 as useFileReferenceForRecord, b6 as useFilesByCategory, bf as useIsPublicPage, be as usePublicPageContext } from './PublicPageProvider-DlsCaR5v.js';
2
+ export { A as AddressField, k as AddressFieldProps, l as AddressFieldRef, o as Alert, q as AlertDescription, p as AlertTitle, r as Avatar, s as AvatarProps, t as Badge, u as BadgeProps, v as BadgeVariant, B as Button, a as ButtonProps, am as Calendar, an as CalendarProps, C as Card, g as CardActions, i as CardActionsProps, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, w as Checkbox, aP as ContextSelector, aQ as ContextSelectorProps, M as Dialog, V as DialogBody, a4 as DialogBodyProps, Q as DialogClose, a1 as DialogCloseProps, R as DialogContent, $ as DialogContentProps, Y as DialogDescription, W as DialogFooter, a3 as DialogFooterProps, U as DialogHeader, a2 as DialogHeaderProps, N as DialogPortal, a0 as DialogPortalProps, Z as DialogProps, a5 as DialogSize, X as DialogTitle, O as DialogTrigger, _ as DialogTriggerProps, aS as ErrorBoundary, aU as ErrorBoundaryProps, aT as ErrorBoundaryProvider, aW as ErrorBoundaryProviderProps, aV as ErrorBoundaryState, b1 as FileDisplay, b2 as FileDisplayProps, a$ as FileUpload, b0 as FileUploadProps, aK as Footer, aL as FooterProps, aD as Form, aE as FormField, aG as FormFieldProps, aF as FormProps, aX as GlobalErrorHandler, aJ as Header, I as Input, j as InputProps, L as Label, m as LabelProps, aY as LoadingSpinner, aH as LoginForm, aI as LoginFormProps, aO as NavigationMenu, bk as PaceAppLayout, bj as PaceAppLayoutProps, bm as PaceLoginPage, bl as PaceLoginPageProps, P as Progress, y as ProgressProps, aM as ProtectedRoute, aN as ProtectedRouteProps, bc as PublicPageFooter, bi as PublicPageFooterProps, bb as PublicPageHeader, bh as PublicPageHeaderProps, ba as PublicPageLayout, bg as PublicPageLayoutProps, bd as PublicPageProvider, a6 as Select, aa as SelectContent, a7 as SelectGroup, ac as SelectItem, ab as SelectLabel, ad as SelectSeparator, a9 as SelectTrigger, a8 as SelectValue, aZ as SessionRestorationLoader, a_ as SessionRestorationLoaderProps, S as Switch, x as SwitchProps, z as Table, E as TableBody, F as TableCaption, G as TableCell, H as TableFooter, J as TableHead, D as TableHeader, K as TableRow, ae as Tabs, ah as TabsContent, al as TabsContentProps, af as TabsList, aj as TabsListProps, ai as TabsProps, ag as TabsTrigger, ak as TabsTriggerProps, T as Textarea, n as TextareaProps, ao as Toast, aq as ToastAction, aw as ToastActionElement, av as ToastClose, au as ToastDescription, ax as ToastProps, ar as ToastProvider, at as ToastTitle, as as ToastViewport, ap as Toaster, ay as Tooltip, aA as TooltipContent, aB as TooltipProvider, aC as TooltipRoot, az as TooltipTrigger, b9 as UseFileReferenceForRecordReturn, b7 as UseFileReferenceOptions, b8 as UseFileReferenceReturn, aR as UserMenu, b3 as useFileReference, b5 as useFileReferenceById, b4 as useFileReferenceForRecord, b6 as useFilesByCategory, bf as useIsPublicPage, be as usePublicPageContext } from './PublicPageProvider-CIGSujI2.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  export { u as useToast } from './useToast-AyaT-x7p.js';
5
5
  export { D as DataTable, a as DataTableProps } from './DataTable-DRUIgtUH.js';
@@ -1,17 +1,17 @@
1
- import { Calendar } from './chunk-JGWDVX64.js';
2
- export { AddressField, Avatar, Badge, Calendar, ContextSelector, FileDisplay, FileUpload, Footer, Form, FormField, Header, LoginForm, NavigationMenu, PaceAppLayout, PaceLoginPage, ProtectedRoute, PublicPageFooter, PublicPageHeader, PublicPageLayout, SessionRestorationLoader, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, UserMenu, useFileReference, useFileReferenceById, useFileReferenceForRecord, useFilesByCategory } from './chunk-JGWDVX64.js';
3
- import './chunk-6F3IILHI.js';
4
- import { Label, Input } from './chunk-Q7Q7V5NV.js';
5
- export { Alert, AlertDescription, AlertTitle, Checkbox, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './chunk-Q7Q7V5NV.js';
6
- import { Button } from './chunk-BM4CQ5P3.js';
7
- export { Button, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from './chunk-BM4CQ5P3.js';
8
- import './chunk-5X4QLXRG.js';
9
- import './chunk-ZKAWKYT4.js';
1
+ import { Calendar } from './chunk-5HNSDQWH.js';
2
+ export { AddressField, Avatar, Badge, Calendar, ContextSelector, FileDisplay, FileUpload, Footer, Form, FormField, Header, LoginForm, NavigationMenu, PaceAppLayout, PaceLoginPage, ProtectedRoute, PublicPageFooter, PublicPageHeader, PublicPageLayout, SessionRestorationLoader, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, UserMenu, useFileReference, useFileReferenceById, useFileReferenceForRecord, useFilesByCategory } from './chunk-5HNSDQWH.js';
3
+ import './chunk-S6ZQKDY6.js';
4
+ import { Label, Input } from './chunk-J2U36LHD.js';
5
+ export { Alert, AlertDescription, AlertTitle, Checkbox, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './chunk-J2U36LHD.js';
6
+ import { Button } from './chunk-GS5672WG.js';
7
+ export { Button, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger } from './chunk-GS5672WG.js';
8
+ import './chunk-MPBLMWVR.js';
9
+ import './chunk-5W2A3DRC.js';
10
10
  export { useToast } from './chunk-S7DKJPLT.js';
11
- export { Card, CardActions, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ErrorBoundary, ErrorBoundaryProvider, PublicPageProvider, useIsPublicPage, usePublicPageContext } from './chunk-VBCS3DUA.js';
11
+ export { Card, CardActions, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ErrorBoundary, ErrorBoundaryProvider, PublicPageProvider, useIsPublicPage, usePublicPageContext } from './chunk-EF2UGZWY.js';
12
12
  import './chunk-C7NSAPTL.js';
13
- export { UnifiedAuthProvider, useUnifiedAuth } from './chunk-FTCRZOG2.js';
14
- import './chunk-ZFYPMX46.js';
13
+ export { UnifiedAuthProvider, useUnifiedAuth } from './chunk-T5CVK4R3.js';
14
+ import './chunk-LX6U42O3.js';
15
15
  import './chunk-AHU7G2R5.js';
16
16
  export { FileCategory } from './chunk-6QYDGKQY.js';
17
17
  import './chunk-4SXLQIZO.js';
@@ -7726,6 +7726,18 @@ type Database = {
7726
7726
  Args: never;
7727
7727
  Returns: number;
7728
7728
  };
7729
+ data_app_resolve: {
7730
+ Args: {
7731
+ p_app_name: string;
7732
+ p_user_id?: string;
7733
+ };
7734
+ Returns: {
7735
+ app_id: string;
7736
+ app_name: string;
7737
+ has_access: boolean;
7738
+ is_active: boolean;
7739
+ }[];
7740
+ };
7729
7741
  data_cake_deliveries_list: {
7730
7742
  Args: {
7731
7743
  p_event_id: string;
@@ -9337,18 +9349,6 @@ type Database = {
9337
9349
  success: boolean;
9338
9350
  }[];
9339
9351
  };
9340
- util_app_resolve: {
9341
- Args: {
9342
- p_app_name: string;
9343
- p_user_id?: string;
9344
- };
9345
- Returns: {
9346
- app_id: string;
9347
- app_name: string;
9348
- has_access: boolean;
9349
- is_active: boolean;
9350
- }[];
9351
- };
9352
9352
  validate_base_question_options: {
9353
9353
  Args: {
9354
9354
  options: Json;
@@ -47,13 +47,20 @@ module.exports = {
47
47
  const functionName = node.id.name;
48
48
  if (!functionName) return;
49
49
 
50
- // Check for hooks (functions that use React hooks)
51
50
  const sourceCode = context.getSourceCode();
52
51
  const functionText = sourceCode.getText(node.body);
52
+
53
+ // Check if function returns JSX (is a component)
54
+ const returnsJSX = functionText.includes('return') && (functionText.includes('<') || functionText.includes('createElement'));
55
+
56
+ // Check for hooks (functions that use React hooks but are NOT components)
53
57
  const usesReactHooks = /use(State|Effect|Callback|Memo|Ref|Context|Reducer|LayoutEffect|ImperativeHandle|DebugValue)/.test(functionText);
54
58
 
55
- // Check if function is a hook (starts with 'use' or uses React hooks)
56
- if (usesReactHooks || functionName.startsWith('use')) {
59
+ // Only flag as hook if:
60
+ // 1. It uses React hooks AND doesn't return JSX (not a component)
61
+ // 2. OR it starts with 'use' but doesn't return JSX (likely a hook)
62
+ // Components that use hooks are NOT hooks themselves
63
+ if (usesReactHooks && !returnsJSX) {
57
64
  if (!functionName.startsWith('use')) {
58
65
  context.report({
59
66
  node: node.id,
@@ -69,13 +76,18 @@ module.exports = {
69
76
  }
70
77
  }
71
78
 
72
- // Check for providers (components that return JSX and have Provider in name or return Provider-like structure)
73
- const returnsJSX = functionText.includes('return') && (functionText.includes('<') || functionText.includes('createElement'));
74
- const hasProviderPattern = functionName.includes('Provider') ||
75
- functionText.includes('Provider') ||
76
- functionText.includes('Context.Provider');
79
+ // Check for providers (components that CREATE a Context.Provider, not just use/wrap one)
80
+ // A provider component must:
81
+ // 1. Use createContext (creates a context)
82
+ // 2. Return <ContextName.Provider> (provides the context)
83
+ // We don't flag components that just wrap other providers (like AppProviders wrapping QueryClientProvider)
84
+ const createsContext = /createContext\s*\(/.test(functionText);
85
+ const returnsContextProvider = /<[A-Z][a-zA-Z0-9]*\.Provider/.test(functionText) ||
86
+ /\.Provider\s*>/.test(functionText);
77
87
 
78
- if (returnsJSX && hasProviderPattern && !functionName.endsWith('Provider')) {
88
+ // Only flag if it actually creates a context AND returns a Context.Provider
89
+ // AND doesn't already end with 'Provider'
90
+ if (returnsJSX && createsContext && returnsContextProvider && !functionName.endsWith('Provider')) {
79
91
  context.report({
80
92
  node: node.id,
81
93
  messageId: 'providerNaming',
@@ -101,9 +113,14 @@ module.exports = {
101
113
  if (node.init.type === 'ArrowFunctionExpression' || node.init.type === 'FunctionExpression') {
102
114
  const sourceCode = context.getSourceCode();
103
115
  const functionText = sourceCode.getText(node.init);
116
+
117
+ // Check if it returns JSX (is a component)
118
+ const returnsJSX = functionText.includes('return') && (functionText.includes('<') || functionText.includes('createElement'));
104
119
  const usesReactHooks = /use(State|Effect|Callback|Memo|Ref|Context|Reducer|LayoutEffect|ImperativeHandle|DebugValue)/.test(functionText);
105
120
 
106
- if (usesReactHooks && !varName.startsWith('use')) {
121
+ // Only flag as hook if it uses React hooks but doesn't return JSX (not a component)
122
+ // Components that use hooks are NOT hooks themselves
123
+ if (usesReactHooks && !returnsJSX && !varName.startsWith('use')) {
107
124
  context.report({
108
125
  node: node.id,
109
126
  messageId: 'hookNaming',
@@ -159,6 +176,26 @@ module.exports = {
159
176
  const functionName = node.id.name;
160
177
  if (!functionName) return;
161
178
 
179
+ // Skip event handlers and utility functions (these are not components)
180
+ const isEventHandler = functionName.startsWith('handle') ||
181
+ functionName.startsWith('on') ||
182
+ functionName.startsWith('get') ||
183
+ functionName.startsWith('set') ||
184
+ functionName.startsWith('load') ||
185
+ functionName.startsWith('read') ||
186
+ functionName.startsWith('create') ||
187
+ functionName.startsWith('update') ||
188
+ functionName.startsWith('delete');
189
+
190
+ if (isEventHandler) return;
191
+
192
+ // Only check exported components (not internal functions)
193
+ const isExported = node.parent?.type === 'ExportNamedDeclaration' ||
194
+ node.parent?.type === 'ExportDefaultDeclaration' ||
195
+ (node.parent?.parent?.type === 'ExportNamedDeclaration');
196
+
197
+ if (!isExported) return;
198
+
162
199
  // Check if it's a component (returns JSX)
163
200
  const sourceCode = context.getSourceCode();
164
201
  const functionText = sourceCode.getText(node.body);
@@ -190,6 +227,25 @@ module.exports = {
190
227
  const varName = node.id.name;
191
228
  if (!varName) return;
192
229
 
230
+ // Skip event handlers and utility functions (these are not components)
231
+ const isEventHandler = varName.startsWith('handle') ||
232
+ varName.startsWith('on') ||
233
+ varName.startsWith('get') ||
234
+ varName.startsWith('set') ||
235
+ varName.startsWith('load') ||
236
+ varName.startsWith('read') ||
237
+ varName.startsWith('create') ||
238
+ varName.startsWith('update') ||
239
+ varName.startsWith('delete');
240
+
241
+ if (isEventHandler) return;
242
+
243
+ // Only check exported components (not internal functions)
244
+ const isExported = node.parent?.parent?.type === 'ExportNamedDeclaration' ||
245
+ node.parent?.parent?.type === 'ExportDefaultDeclaration';
246
+
247
+ if (!isExported) return;
248
+
193
249
  // Check for component variables (arrow functions that return JSX)
194
250
  if (node.init.type === 'ArrowFunctionExpression' || node.init.type === 'FunctionExpression') {
195
251
  const sourceCode = context.getSourceCode();