@burdenoff/microfe-govcitizenhub 2026.1113.1 → 2026.1117.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ import { Navigate as h, Route as g, Routes as _, useLocation as v } from "react-
16
16
  import { jsx as y, jsxs as b } from "react/jsx-runtime";
17
17
  import { Spinner as x } from "@burdenoff/fe-libs/ui";
18
18
  // src/govcitizenhub/GovCitizenHubRoutes.tsx
19
- var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ default: e.ServicesPage }))), C = p(() => import("./pages/services/ServiceDetailPage.js").then((e) => ({ default: e.ServiceDetailPage }))), w = p(() => import("./pages/applications/ApplicationsPage.js").then((e) => ({ default: e.ApplicationsPage }))), T = p(() => import("./pages/applications/ApplicationDetailPage.js").then((e) => ({ default: e.ApplicationDetailPage }))), E = p(() => import("./pages/applications/NewApplicationPage.js").then((e) => ({ default: e.NewApplicationPage }))), D = p(() => import("./pages/agencies/AgenciesPage.js").then((e) => ({ default: e.AgenciesPage }))), O = p(() => import("./pages/documents/DocumentsPage.js").then((e) => ({ default: e.DocumentsPage }))), k = p(() => import("./pages/wallet/WalletPage.js").then((e) => ({ default: e.WalletPage }))), A = p(() => import("./pages/payments/PaymentsPage.js").then((e) => ({ default: e.PaymentsPage }))), j = p(() => import("./pages/permits/PermitsPage.js").then((e) => ({ default: e.PermitsPage }))), M = p(() => import("./pages/permits/VerifyPermitPage.js").then((e) => ({ default: e.VerifyPermitPage }))), N = p(() => import("./pages/grievances/GrievancesPage.js").then((e) => ({ default: e.GrievancesPage }))), P = p(() => import("./pages/grievances/GrievanceDetailPage.js").then((e) => ({ default: e.GrievanceDetailPage }))), F = p(() => import("./pages/intelligence/JurisdictionDirectoryPage.js").then((e) => ({ default: e.JurisdictionDirectoryPage }))), I = p(() => import("./pages/intelligence/AdminLevelsPage.js").then((e) => ({ default: e.AdminLevelsPage }))), L = p(() => import("./pages/intelligence/IndicatorCatalogPage.js").then((e) => ({ default: e.IndicatorCatalogPage }))), R = p(() => import("./pages/intelligence/JurisdictionProfilePage.js").then((e) => ({ default: e.JurisdictionProfilePage }))), z = p(() => import("./pages/intelligence/GovernancePage.js").then((e) => ({ default: e.GovernancePage }))), B = p(() => import("./pages/intelligence/BudgetPage.js").then((e) => ({ default: e.BudgetPage }))), V = p(() => import("./pages/intelligence/ProjectsPage.js").then((e) => ({ default: e.ProjectsPage }))), H = p(() => import("./pages/intelligence/IndicatorsPage.js").then((e) => ({ default: e.IndicatorsPage }))), U = p(() => import("./pages/intelligence/BenchmarkPage.js").then((e) => ({ default: e.BenchmarkPage }))), W = p(() => import("./pages/intelligence/ServicePerformancePage.js").then((e) => ({ default: e.ServicePerformancePage }))), G = p(() => import("./pages/intelligence/PublicAssetsPage.js").then((e) => ({ default: e.PublicAssetsPage }))), K = p(() => import("./pages/intelligence/ElectionsPage.js").then((e) => ({ default: e.ElectionsPage }))), q = p(() => import("./pages/intelligence/ConsultationsPage.js").then((e) => ({ default: e.ConsultationsPage }))), J = p(() => import("./pages/intelligence/OpenDataPage.js").then((e) => ({ default: e.OpenDataPage }))), Y = p(() => import("./pages/intelligence/TimelinePage.js").then((e) => ({ default: e.TimelinePage }))), X = p(() => import("./pages/intelligence/CorrectionsPage.js").then((e) => ({ default: e.CorrectionsPage }))), Z = () => /* @__PURE__ */ y("div", {
19
+ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ default: e.ServicesPage }))), C = p(() => import("./pages/services/ServiceDetailPage.js").then((e) => ({ default: e.ServiceDetailPage }))), w = p(() => import("./pages/applications/ApplicationsPage.js").then((e) => ({ default: e.ApplicationsPage }))), T = p(() => import("./pages/applications/ApplicationDetailPage.js").then((e) => ({ default: e.ApplicationDetailPage }))), ee = p(() => import("./pages/applications/NewApplicationPage.js").then((e) => ({ default: e.NewApplicationPage }))), E = p(() => import("./pages/agencies/AgenciesPage.js").then((e) => ({ default: e.AgenciesPage }))), D = p(() => import("./pages/documents/DocumentsPage.js").then((e) => ({ default: e.DocumentsPage }))), O = p(() => import("./pages/wallet/WalletPage.js").then((e) => ({ default: e.WalletPage }))), k = p(() => import("./pages/payments/PaymentsPage.js").then((e) => ({ default: e.PaymentsPage }))), A = p(() => import("./pages/permits/PermitsPage.js").then((e) => ({ default: e.PermitsPage }))), j = p(() => import("./pages/permits/VerifyPermitPage.js").then((e) => ({ default: e.VerifyPermitPage }))), M = p(() => import("./pages/access-control/AccessControlPage.js").then((e) => ({ default: e.AccessControlPage }))), N = p(() => import("./pages/grievances/GrievancesPage.js").then((e) => ({ default: e.GrievancesPage }))), P = p(() => import("./pages/grievances/GrievanceDetailPage.js").then((e) => ({ default: e.GrievanceDetailPage }))), F = p(() => import("./pages/intelligence/JurisdictionDirectoryPage.js").then((e) => ({ default: e.JurisdictionDirectoryPage }))), I = p(() => import("./pages/intelligence/AdminLevelsPage.js").then((e) => ({ default: e.AdminLevelsPage }))), L = p(() => import("./pages/intelligence/IndicatorCatalogPage.js").then((e) => ({ default: e.IndicatorCatalogPage }))), R = p(() => import("./pages/intelligence/JurisdictionProfilePage.js").then((e) => ({ default: e.JurisdictionProfilePage }))), z = p(() => import("./pages/intelligence/GovernancePage.js").then((e) => ({ default: e.GovernancePage }))), B = p(() => import("./pages/intelligence/BudgetPage.js").then((e) => ({ default: e.BudgetPage }))), V = p(() => import("./pages/intelligence/ProjectsPage.js").then((e) => ({ default: e.ProjectsPage }))), H = p(() => import("./pages/intelligence/IndicatorsPage.js").then((e) => ({ default: e.IndicatorsPage }))), U = p(() => import("./pages/intelligence/BenchmarkPage.js").then((e) => ({ default: e.BenchmarkPage }))), W = p(() => import("./pages/intelligence/ServicePerformancePage.js").then((e) => ({ default: e.ServicePerformancePage }))), G = p(() => import("./pages/intelligence/PublicAssetsPage.js").then((e) => ({ default: e.PublicAssetsPage }))), K = p(() => import("./pages/intelligence/ElectionsPage.js").then((e) => ({ default: e.ElectionsPage }))), q = p(() => import("./pages/intelligence/ConsultationsPage.js").then((e) => ({ default: e.ConsultationsPage }))), J = p(() => import("./pages/intelligence/OpenDataPage.js").then((e) => ({ default: e.OpenDataPage }))), Y = p(() => import("./pages/intelligence/TimelinePage.js").then((e) => ({ default: e.TimelinePage }))), X = p(() => import("./pages/intelligence/CorrectionsPage.js").then((e) => ({ default: e.CorrectionsPage }))), Z = () => /* @__PURE__ */ y("div", {
20
20
  className: "flex min-h-[400px] items-center justify-center",
21
21
  children: /* @__PURE__ */ y(x, { size: "lg" })
22
22
  }), Q = () => {
@@ -40,7 +40,7 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
40
40
  },
41
41
  replace: !0
42
42
  });
43
- }, ee = () => {
43
+ }, te = () => {
44
44
  let { basePath: t, isStandalone: r } = e(), c = v(), p = t === "/" ? "" : (t ?? "").replace(/\/$/, "");
45
45
  return p && !r && !(c.pathname === p || c.pathname.startsWith(p + "/")) ? null : /* @__PURE__ */ y("div", {
46
46
  className: "flex min-h-full flex-col",
@@ -75,7 +75,7 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
75
75
  element: /* @__PURE__ */ y(m, {
76
76
  flag: "govcitizenhub.mobile.enabled",
77
77
  defaultValue: !0,
78
- children: /* @__PURE__ */ y(n, { children: /* @__PURE__ */ y(M, {}) })
78
+ children: /* @__PURE__ */ y(n, { children: /* @__PURE__ */ y(j, {}) })
79
79
  })
80
80
  }),
81
81
  /* @__PURE__ */ y(g, {
@@ -123,7 +123,7 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
123
123
  element: /* @__PURE__ */ y(m, {
124
124
  flag: "govcitizenhub.applications.enabled",
125
125
  defaultValue: !0,
126
- children: /* @__PURE__ */ y(E, {})
126
+ children: /* @__PURE__ */ y(ee, {})
127
127
  })
128
128
  }),
129
129
  /* @__PURE__ */ y(g, {
@@ -139,7 +139,7 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
139
139
  element: /* @__PURE__ */ y(m, {
140
140
  flag: "govcitizenhub.documents.enabled",
141
141
  defaultValue: !0,
142
- children: /* @__PURE__ */ y(O, {})
142
+ children: /* @__PURE__ */ y(D, {})
143
143
  })
144
144
  }),
145
145
  /* @__PURE__ */ y(g, {
@@ -147,7 +147,7 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
147
147
  element: /* @__PURE__ */ y(m, {
148
148
  flag: "govcitizenhub.wallet.enabled",
149
149
  defaultValue: !0,
150
- children: /* @__PURE__ */ y(k, {})
150
+ children: /* @__PURE__ */ y(O, {})
151
151
  })
152
152
  }),
153
153
  /* @__PURE__ */ y(g, {
@@ -171,7 +171,7 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
171
171
  element: /* @__PURE__ */ y(m, {
172
172
  flag: "govcitizenhub.permits.enabled",
173
173
  defaultValue: !0,
174
- children: /* @__PURE__ */ y(M, {})
174
+ children: /* @__PURE__ */ y(j, {})
175
175
  })
176
176
  })
177
177
  ]
@@ -184,6 +184,10 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
184
184
  index: !0,
185
185
  element: /* @__PURE__ */ y(s, {})
186
186
  }),
187
+ /* @__PURE__ */ y(g, {
188
+ path: "access-control",
189
+ element: /* @__PURE__ */ y(M, {})
190
+ }),
187
191
  /* @__PURE__ */ y(g, {
188
192
  path: "queue",
189
193
  element: /* @__PURE__ */ y(m, {
@@ -213,7 +217,7 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
213
217
  element: /* @__PURE__ */ y(m, {
214
218
  flag: "govcitizenhub.agencies.enabled",
215
219
  defaultValue: !0,
216
- children: /* @__PURE__ */ y(D, {})
220
+ children: /* @__PURE__ */ y(E, {})
217
221
  })
218
222
  }),
219
223
  /* @__PURE__ */ y(g, {
@@ -221,7 +225,7 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
221
225
  element: /* @__PURE__ */ y(m, {
222
226
  flag: "govcitizenhub.documents.enabled",
223
227
  defaultValue: !0,
224
- children: /* @__PURE__ */ y(O, {})
228
+ children: /* @__PURE__ */ y(D, {})
225
229
  })
226
230
  }),
227
231
  /* @__PURE__ */ y(g, {
@@ -229,7 +233,7 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
229
233
  element: /* @__PURE__ */ y(m, {
230
234
  flag: "govcitizenhub.payments.enabled",
231
235
  defaultValue: !0,
232
- children: /* @__PURE__ */ y(A, {})
236
+ children: /* @__PURE__ */ y(k, {})
233
237
  })
234
238
  }),
235
239
  /* @__PURE__ */ y(g, {
@@ -237,7 +241,7 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
237
241
  element: /* @__PURE__ */ y(m, {
238
242
  flag: "govcitizenhub.permits.enabled",
239
243
  defaultValue: !0,
240
- children: /* @__PURE__ */ y(j, {})
244
+ children: /* @__PURE__ */ y(A, {})
241
245
  })
242
246
  }),
243
247
  /* @__PURE__ */ y(g, {
@@ -245,7 +249,7 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
245
249
  element: /* @__PURE__ */ y(m, {
246
250
  flag: "govcitizenhub.permits.enabled",
247
251
  defaultValue: !0,
248
- children: /* @__PURE__ */ y(M, {})
252
+ children: /* @__PURE__ */ y(j, {})
249
253
  })
250
254
  }),
251
255
  /* @__PURE__ */ y(g, {
@@ -433,6 +437,6 @@ var S = p(() => import("./pages/services/ServicesPage.js").then((e) => ({ defaul
433
437
  })
434
438
  });
435
439
  };
436
- export { ee as GovCitizenHubRoutes };
440
+ export { te as GovCitizenHubRoutes };
437
441
 
438
442
  //# sourceMappingURL=GovCitizenHubRoutes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GovCitizenHubRoutes.js","names":["ServicesPage","lazy","m","ServiceDetailPage","ApplicationsPage","ApplicationDetailPage","NewApplicationPage","AgenciesPage","DocumentsPage","WalletPage","PaymentsPage","PermitsPage","VerifyPermitPage","GrievancesPage","GrievanceDetailPage","JurisdictionDirectoryPage","AdminLevelsPage","IndicatorCatalogPage","JurisdictionProfilePage","GovernancePage","BudgetPage","ProjectsPage","IndicatorsPage","BenchmarkPage","ServicePerformancePage","PublicAssetsPage","ElectionsPage","ConsultationsPage","OpenDataPage","TimelinePage","CorrectionsPage","PageLoader","Spinner","HomeRoute","isMobile","useIsMobileViewport","useOfficerAccess","useGovCitizenHub","location","useLocation","isLoading","canOfficer","Navigate","getPath","CitizenHomePage","OfficerRedirect","to","GovCitizenHubRoutes","normalizedBasePath","basePath","isStandalone","Suspense","Routes","Route","CitizenOnlyLayout","FeatureGate","MobileLayout","MobileHomePage","MobileRequestsPage","MobileProfilePage","CitizenLayout","OfficerLayout","DashboardPage"],"sources":["../../src/govcitizenhub/GovCitizenHubRoutes.tsx"],"sourcesContent":["/**\n * GovCitizenHub Routes\n * @module govcitizenhub\n *\n * Domain routes. The dashboard is eager-loaded (primary landing); all other\n * pages are lazy-loaded. Every route maps to a real `gov*` backend capability.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { FeatureGate } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useGovCitizenHub } from './context/GovCitizenHubContext';\nimport { useIsMobileViewport } from './hooks/useIsMobileViewport';\nimport { MobileLayout } from './components/mobile';\nimport { CitizenLayout, CitizenOnlyLayout, OfficerLayout, useOfficerAccess } from './surface';\n\nimport { DashboardPage } from './pages/DashboardPage';\nimport { CitizenHomePage } from './pages/CitizenHomePage';\nimport { MobileHomePage } from './pages/mobile/MobileHomePage';\nimport { MobileRequestsPage } from './pages/mobile/MobileRequestsPage';\nimport { MobileProfilePage } from './pages/mobile/MobileProfilePage';\n\nconst ServicesPage = lazy(() =>\n import('./pages/services/ServicesPage').then((m) => ({ default: m.ServicesPage }))\n);\nconst ServiceDetailPage = lazy(() =>\n import('./pages/services/ServiceDetailPage').then((m) => ({ default: m.ServiceDetailPage }))\n);\nconst ApplicationsPage = lazy(() =>\n import('./pages/applications/ApplicationsPage').then((m) => ({ default: m.ApplicationsPage }))\n);\nconst ApplicationDetailPage = lazy(() =>\n import('./pages/applications/ApplicationDetailPage').then((m) => ({\n default: m.ApplicationDetailPage,\n }))\n);\nconst NewApplicationPage = lazy(() =>\n import('./pages/applications/NewApplicationPage').then((m) => ({ default: m.NewApplicationPage }))\n);\nconst AgenciesPage = lazy(() =>\n import('./pages/agencies/AgenciesPage').then((m) => ({ default: m.AgenciesPage }))\n);\nconst DocumentsPage = lazy(() =>\n import('./pages/documents/DocumentsPage').then((m) => ({ default: m.DocumentsPage }))\n);\nconst WalletPage = lazy(() =>\n import('./pages/wallet/WalletPage').then((m) => ({ default: m.WalletPage }))\n);\nconst PaymentsPage = lazy(() =>\n import('./pages/payments/PaymentsPage').then((m) => ({ default: m.PaymentsPage }))\n);\nconst PermitsPage = lazy(() =>\n import('./pages/permits/PermitsPage').then((m) => ({ default: m.PermitsPage }))\n);\nconst VerifyPermitPage = lazy(() =>\n import('./pages/permits/VerifyPermitPage').then((m) => ({ default: m.VerifyPermitPage }))\n);\nconst GrievancesPage = lazy(() =>\n import('./pages/grievances/GrievancesPage').then((m) => ({ default: m.GrievancesPage }))\n);\nconst GrievanceDetailPage = lazy(() =>\n import('./pages/grievances/GrievanceDetailPage').then((m) => ({ default: m.GrievanceDetailPage }))\n);\n\n// Community Intelligence (BOFF-5666) — jurisdiction directory, admin catalogs\n// and the thirteen jurisdiction profile tabs.\nconst JurisdictionDirectoryPage = lazy(() =>\n import('./pages/intelligence/JurisdictionDirectoryPage').then((m) => ({\n default: m.JurisdictionDirectoryPage,\n }))\n);\nconst AdminLevelsPage = lazy(() =>\n import('./pages/intelligence/AdminLevelsPage').then((m) => ({ default: m.AdminLevelsPage }))\n);\nconst IndicatorCatalogPage = lazy(() =>\n import('./pages/intelligence/IndicatorCatalogPage').then((m) => ({\n default: m.IndicatorCatalogPage,\n }))\n);\nconst JurisdictionProfilePage = lazy(() =>\n import('./pages/intelligence/JurisdictionProfilePage').then((m) => ({\n default: m.JurisdictionProfilePage,\n }))\n);\nconst GovernancePage = lazy(() =>\n import('./pages/intelligence/GovernancePage').then((m) => ({ default: m.GovernancePage }))\n);\nconst BudgetPage = lazy(() =>\n import('./pages/intelligence/BudgetPage').then((m) => ({ default: m.BudgetPage }))\n);\nconst ProjectsPage = lazy(() =>\n import('./pages/intelligence/ProjectsPage').then((m) => ({ default: m.ProjectsPage }))\n);\nconst IndicatorsPage = lazy(() =>\n import('./pages/intelligence/IndicatorsPage').then((m) => ({ default: m.IndicatorsPage }))\n);\nconst BenchmarkPage = lazy(() =>\n import('./pages/intelligence/BenchmarkPage').then((m) => ({ default: m.BenchmarkPage }))\n);\nconst ServicePerformancePage = lazy(() =>\n import('./pages/intelligence/ServicePerformancePage').then((m) => ({\n default: m.ServicePerformancePage,\n }))\n);\nconst PublicAssetsPage = lazy(() =>\n import('./pages/intelligence/PublicAssetsPage').then((m) => ({ default: m.PublicAssetsPage }))\n);\nconst ElectionsPage = lazy(() =>\n import('./pages/intelligence/ElectionsPage').then((m) => ({ default: m.ElectionsPage }))\n);\nconst ConsultationsPage = lazy(() =>\n import('./pages/intelligence/ConsultationsPage').then((m) => ({ default: m.ConsultationsPage }))\n);\nconst OpenDataPage = lazy(() =>\n import('./pages/intelligence/OpenDataPage').then((m) => ({ default: m.OpenDataPage }))\n);\nconst TimelinePage = lazy(() =>\n import('./pages/intelligence/TimelinePage').then((m) => ({ default: m.TimelinePage }))\n);\nconst CorrectionsPage = lazy(() =>\n import('./pages/intelligence/CorrectionsPage').then((m) => ({ default: m.CorrectionsPage }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\n/**\n * Index-route landing (BOFF-4088). Narrow viewports — mobile web and every\n * Capacitor build, which report the same narrow viewport as a phone browser —\n * land on the citizen mobile home tab instead of the officer-shaped desktop\n * dashboard. `replace` keeps the redirect out of browser history.\n */\nconst HomeRoute: FC = () => {\n const isMobile = useIsMobileViewport();\n const { isLoading, canOfficer } = useOfficerAccess();\n const { getPath } = useGovCitizenHub();\n const location = useLocation();\n if (isLoading) return <PageLoader />;\n // Officers always start in the Officer console; citizens start on their own\n // home (the mobile tab bar on a phone). The two never share a landing page.\n if (canOfficer) {\n return <Navigate to={{ pathname: getPath('officer'), search: location.search }} replace />;\n }\n if (isMobile) return <Navigate to=\"m\" replace />;\n return <CitizenHomePage />;\n};\n\nconst OfficerRedirect: FC<{ to: string }> = ({ to }) => {\n const { getPath } = useGovCitizenHub();\n const location = useLocation();\n return <Navigate to={{ pathname: getPath(`officer/${to}`), search: location.search }} replace />;\n};\n\nexport const GovCitizenHubRoutes: FC = () => {\n const { basePath, isStandalone } = useGovCitizenHub();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<HomeRoute />} />\n\n <Route element={<CitizenOnlyLayout />}>\n <Route\n path=\"m\"\n element={\n <FeatureGate flag=\"govcitizenhub.mobile.enabled\" defaultValue={true}>\n <MobileLayout>\n <MobileHomePage />\n </MobileLayout>\n </FeatureGate>\n }\n />\n <Route\n path=\"m/requests\"\n element={\n <FeatureGate flag=\"govcitizenhub.mobile.enabled\" defaultValue={true}>\n <MobileLayout>\n <MobileRequestsPage />\n </MobileLayout>\n </FeatureGate>\n }\n />\n <Route\n path=\"m/scan\"\n element={\n <FeatureGate flag=\"govcitizenhub.mobile.enabled\" defaultValue={true}>\n <MobileLayout>\n <VerifyPermitPage />\n </MobileLayout>\n </FeatureGate>\n }\n />\n <Route\n path=\"m/profile\"\n element={\n <FeatureGate flag=\"govcitizenhub.mobile.enabled\" defaultValue={true}>\n <MobileLayout>\n <MobileProfilePage />\n </MobileLayout>\n </FeatureGate>\n }\n />\n </Route>\n\n {/*\n Citizen portal — apply, track, upload and report. Reads only the caller's\n own records (`govMy*`); officer controls never render here.\n */}\n <Route element={<CitizenLayout />}>\n <Route\n path=\"services\"\n element={\n <FeatureGate flag=\"govcitizenhub.services.enabled\" defaultValue={true}>\n <ServicesPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"services/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.services.enabled\" defaultValue={true}>\n <ServiceDetailPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"applications\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <div className=\"mx-auto w-full max-w-3xl\">\n <MobileRequestsPage />\n </div>\n </FeatureGate>\n }\n />\n <Route\n path=\"applications/new\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <NewApplicationPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"applications/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <ApplicationDetailPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"documents\"\n element={\n <FeatureGate flag=\"govcitizenhub.documents.enabled\" defaultValue={true}>\n <DocumentsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"wallet\"\n element={\n <FeatureGate flag=\"govcitizenhub.wallet.enabled\" defaultValue={true}>\n <WalletPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"grievances\"\n element={\n <FeatureGate flag=\"govcitizenhub.grievances.enabled\" defaultValue={true}>\n <GrievancesPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"grievances/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.grievances.enabled\" defaultValue={true}>\n <GrievanceDetailPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"permits/verify\"\n element={\n <FeatureGate flag=\"govcitizenhub.permits.enabled\" defaultValue={true}>\n <VerifyPermitPage />\n </FeatureGate>\n }\n />\n </Route>\n\n {/*\n Officer console — casework, issuance, fees, grievance triage and the\n agency directory. OfficerLayout is the guard: without a staff permission\n it renders a permission-denied page instead of any of these routes.\n */}\n <Route path=\"officer\" element={<OfficerLayout />}>\n <Route index element={<DashboardPage />} />\n <Route\n path=\"queue\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <ApplicationsPage key=\"queue\" myQueue />\n </FeatureGate>\n }\n />\n <Route\n path=\"applications\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <ApplicationsPage key=\"all\" />\n </FeatureGate>\n }\n />\n <Route\n path=\"applications/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <ApplicationDetailPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"agencies\"\n element={\n <FeatureGate flag=\"govcitizenhub.agencies.enabled\" defaultValue={true}>\n <AgenciesPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"documents\"\n element={\n <FeatureGate flag=\"govcitizenhub.documents.enabled\" defaultValue={true}>\n <DocumentsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"payments\"\n element={\n <FeatureGate flag=\"govcitizenhub.payments.enabled\" defaultValue={true}>\n <PaymentsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"permits\"\n element={\n <FeatureGate flag=\"govcitizenhub.permits.enabled\" defaultValue={true}>\n <PermitsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"permits/verify\"\n element={\n <FeatureGate flag=\"govcitizenhub.permits.enabled\" defaultValue={true}>\n <VerifyPermitPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"grievances\"\n element={\n <FeatureGate flag=\"govcitizenhub.grievances.enabled\" defaultValue={true}>\n <GrievancesPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"grievances/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.grievances.enabled\" defaultValue={true}>\n <GrievanceDetailPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"services\"\n element={\n <FeatureGate flag=\"govcitizenhub.services.enabled\" defaultValue={true}>\n <ServicesPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"services/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.services.enabled\" defaultValue={true}>\n <ServiceDetailPage />\n </FeatureGate>\n }\n />\n </Route>\n\n {/* Bookmarks from before the split: officer-only pages now live under officer/. */}\n <Route path=\"agencies\" element={<OfficerRedirect to=\"agencies\" />} />\n <Route path=\"payments\" element={<OfficerRedirect to=\"payments\" />} />\n <Route path=\"permits\" element={<OfficerRedirect to=\"permits\" />} />\n\n {/*\n Community Intelligence. The two `intelligence/admin/*` catalog routes\n are declared BEFORE `intelligence/:jurisdictionId` so \"admin\" can\n never be matched as a jurisdiction id.\n */}\n <Route\n path=\"intelligence\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <JurisdictionDirectoryPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/admin/levels\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <AdminLevelsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/admin/indicators\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <IndicatorCatalogPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <JurisdictionProfilePage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/governance\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <GovernancePage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/budget\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <BudgetPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/projects\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <ProjectsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/indicators\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <IndicatorsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/benchmark\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <BenchmarkPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/services\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <ServicePerformancePage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/assets\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <PublicAssetsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/elections\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <ElectionsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/consultations\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <ConsultationsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/open-data\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <OpenDataPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/timeline\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <TimelinePage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/corrections\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <CorrectionsPage />\n </FeatureGate>\n }\n />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,IAAMA,IAAeC,QACnB,OAAO,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,aAAa,EAAE,CACnF,GACMC,IAAoBF,QACxB,OAAO,wCAAqC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,kBAAkB,EAAE,CAC7F,GACME,IAAmBH,QACvB,OAAO,2CAAwC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,iBAAiB,EAAE,CAC/F,GACMG,IAAwBJ,QAC5B,OAAO,gDAA6C,CAAC,MAAM,OAAO,EAChE,SAASC,EAAE,sBACb,EAAE,CACJ,GACMI,IAAqBL,QACzB,OAAO,6CAA0C,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,mBAAmB,EAAE,CACnG,GACMK,IAAeN,QACnB,OAAO,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,aAAa,EAAE,CACnF,GACMM,IAAgBP,QACpB,OAAO,qCAAkC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,cAAc,EAAE,CACtF,GACMO,IAAaR,QACjB,OAAO,+BAA4B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,WAAW,EAAE,CAC7E,GACMQ,IAAeT,QACnB,OAAO,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,aAAa,EAAE,CACnF,GACMS,IAAcV,QAClB,OAAO,iCAA8B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,YAAY,EAAE,CAChF,GACMU,IAAmBX,QACvB,OAAO,sCAAmC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,iBAAiB,EAAE,CAC1F,GACMW,IAAiBZ,QACrB,OAAO,uCAAoC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE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E,kBAACE,GAAD;MAAa,MAAK;MAAqC,cAAc;MACnE,UAAA,kBAAC/B,GAAD,CAAyB,CAAA;KACd,CAAA;IAEhB,CAAA;IACD,kBAAC6B,GAAD;KACE,MAAK;KACL,SACE,kBAACE,GAAD;MAAa,MAAK;MAAqC,cAAc;MACnE,UAAA,kBAAC9B,GAAD,CAAmB,CAAA;KACR,CAAA;IAEhB,CAAA;IACD,kBAAC4B,GAAD;KACE,MAAK;KACL,SACE,kBAACE,GAAD;MAAa,MAAK;MAAqC,cAAc;MACnE,UAAA,kBAAC7B,GAAD,CAAgB,CAAA;KACL,CAAA;IAEhB,CAAA;IACD,kBAAC2B,GAAD;KACE,MAAK;KACL,SACE,kBAACE,GAAD;MAAa,MAAK;MAAqC,cAAc;MACnE,UAAA,kBAAC5B,GAAD,CAAoB,CAAA;KACT,CAAA;IAEhB,CAAA;IACD,kBAAC0B,GAAD;KACE,MAAK;KACL,SACE,kBAACE,GAAD;MAAa,MAAK;MAAqC,cAAc;MACnE,UAAA,kBAAC3B,GAAD,CAAe,CAAA;KACJ,CAAA;IAEhB,CAAA;IACD,kBAACyB,GAAD;KACE,MAAK;KACL,SACE,kBAACE,GAAD;MAAa,MAAK;MAAqC,cAAc;MACnE,UAAA,kBAAC1B,GAAD,CAAe,CAAA;KACJ,CAAA;IAEhB,CAAA;IACD,kBAACwB,GAAD;KACE,MAAK;KACL,SACE,kBAACE,GAAD;MAAa,MAAK;MAAqC,cAAc;MACnE,UAAA,kBAACzB,GAAD,CAAkB,CAAA;KACP,CAAA;IAEhB,CAAA;IAED,kBAACuB,GAAD;KAAO,MAAK;KAAI,SAAS,kBAACX,GAAD;MAAU,IAAG;MAAG,SAAA;KAAS,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA;CACP,CAAA;AAET"}
1
+ {"version":3,"file":"GovCitizenHubRoutes.js","names":["ServicesPage","lazy","m","ServiceDetailPage","ApplicationsPage","ApplicationDetailPage","NewApplicationPage","AgenciesPage","DocumentsPage","WalletPage","PaymentsPage","PermitsPage","VerifyPermitPage","AccessControlPage","GrievancesPage","GrievanceDetailPage","JurisdictionDirectoryPage","AdminLevelsPage","IndicatorCatalogPage","JurisdictionProfilePage","GovernancePage","BudgetPage","ProjectsPage","IndicatorsPage","BenchmarkPage","ServicePerformancePage","PublicAssetsPage","ElectionsPage","ConsultationsPage","OpenDataPage","TimelinePage","CorrectionsPage","PageLoader","Spinner","HomeRoute","isMobile","useIsMobileViewport","useOfficerAccess","useGovCitizenHub","location","useLocation","isLoading","canOfficer","Navigate","getPath","CitizenHomePage","OfficerRedirect","to","GovCitizenHubRoutes","normalizedBasePath","basePath","isStandalone","Suspense","Routes","Route","CitizenOnlyLayout","FeatureGate","MobileLayout","MobileHomePage","MobileRequestsPage","MobileProfilePage","CitizenLayout","OfficerLayout","DashboardPage"],"sources":["../../src/govcitizenhub/GovCitizenHubRoutes.tsx"],"sourcesContent":["/**\n * GovCitizenHub Routes\n * @module govcitizenhub\n *\n * Domain routes. The dashboard is eager-loaded (primary landing); all other\n * pages are lazy-loaded. Every route maps to a real `gov*` backend capability.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { FeatureGate } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useGovCitizenHub } from './context/GovCitizenHubContext';\nimport { useIsMobileViewport } from './hooks/useIsMobileViewport';\nimport { MobileLayout } from './components/mobile';\nimport { CitizenLayout, CitizenOnlyLayout, OfficerLayout, useOfficerAccess } from './surface';\n\nimport { DashboardPage } from './pages/DashboardPage';\nimport { CitizenHomePage } from './pages/CitizenHomePage';\nimport { MobileHomePage } from './pages/mobile/MobileHomePage';\nimport { MobileRequestsPage } from './pages/mobile/MobileRequestsPage';\nimport { MobileProfilePage } from './pages/mobile/MobileProfilePage';\n\nconst ServicesPage = lazy(() =>\n import('./pages/services/ServicesPage').then((m) => ({ default: m.ServicesPage }))\n);\nconst ServiceDetailPage = lazy(() =>\n import('./pages/services/ServiceDetailPage').then((m) => ({ default: m.ServiceDetailPage }))\n);\nconst ApplicationsPage = lazy(() =>\n import('./pages/applications/ApplicationsPage').then((m) => ({ default: m.ApplicationsPage }))\n);\nconst ApplicationDetailPage = lazy(() =>\n import('./pages/applications/ApplicationDetailPage').then((m) => ({\n default: m.ApplicationDetailPage,\n }))\n);\nconst NewApplicationPage = lazy(() =>\n import('./pages/applications/NewApplicationPage').then((m) => ({ default: m.NewApplicationPage }))\n);\nconst AgenciesPage = lazy(() =>\n import('./pages/agencies/AgenciesPage').then((m) => ({ default: m.AgenciesPage }))\n);\nconst DocumentsPage = lazy(() =>\n import('./pages/documents/DocumentsPage').then((m) => ({ default: m.DocumentsPage }))\n);\nconst WalletPage = lazy(() =>\n import('./pages/wallet/WalletPage').then((m) => ({ default: m.WalletPage }))\n);\nconst PaymentsPage = lazy(() =>\n import('./pages/payments/PaymentsPage').then((m) => ({ default: m.PaymentsPage }))\n);\nconst PermitsPage = lazy(() =>\n import('./pages/permits/PermitsPage').then((m) => ({ default: m.PermitsPage }))\n);\nconst VerifyPermitPage = lazy(() =>\n import('./pages/permits/VerifyPermitPage').then((m) => ({ default: m.VerifyPermitPage }))\n);\nconst AccessControlPage = lazy(() =>\n import('./pages/access-control/AccessControlPage').then((m) => ({ default: m.AccessControlPage }))\n);\nconst GrievancesPage = lazy(() =>\n import('./pages/grievances/GrievancesPage').then((m) => ({ default: m.GrievancesPage }))\n);\nconst GrievanceDetailPage = lazy(() =>\n import('./pages/grievances/GrievanceDetailPage').then((m) => ({ default: m.GrievanceDetailPage }))\n);\n\n// Community Intelligence (BOFF-5666) — jurisdiction directory, admin catalogs\n// and the thirteen jurisdiction profile tabs.\nconst JurisdictionDirectoryPage = lazy(() =>\n import('./pages/intelligence/JurisdictionDirectoryPage').then((m) => ({\n default: m.JurisdictionDirectoryPage,\n }))\n);\nconst AdminLevelsPage = lazy(() =>\n import('./pages/intelligence/AdminLevelsPage').then((m) => ({ default: m.AdminLevelsPage }))\n);\nconst IndicatorCatalogPage = lazy(() =>\n import('./pages/intelligence/IndicatorCatalogPage').then((m) => ({\n default: m.IndicatorCatalogPage,\n }))\n);\nconst JurisdictionProfilePage = lazy(() =>\n import('./pages/intelligence/JurisdictionProfilePage').then((m) => ({\n default: m.JurisdictionProfilePage,\n }))\n);\nconst GovernancePage = lazy(() =>\n import('./pages/intelligence/GovernancePage').then((m) => ({ default: m.GovernancePage }))\n);\nconst BudgetPage = lazy(() =>\n import('./pages/intelligence/BudgetPage').then((m) => ({ default: m.BudgetPage }))\n);\nconst ProjectsPage = lazy(() =>\n import('./pages/intelligence/ProjectsPage').then((m) => ({ default: m.ProjectsPage }))\n);\nconst IndicatorsPage = lazy(() =>\n import('./pages/intelligence/IndicatorsPage').then((m) => ({ default: m.IndicatorsPage }))\n);\nconst BenchmarkPage = lazy(() =>\n import('./pages/intelligence/BenchmarkPage').then((m) => ({ default: m.BenchmarkPage }))\n);\nconst ServicePerformancePage = lazy(() =>\n import('./pages/intelligence/ServicePerformancePage').then((m) => ({\n default: m.ServicePerformancePage,\n }))\n);\nconst PublicAssetsPage = lazy(() =>\n import('./pages/intelligence/PublicAssetsPage').then((m) => ({ default: m.PublicAssetsPage }))\n);\nconst ElectionsPage = lazy(() =>\n import('./pages/intelligence/ElectionsPage').then((m) => ({ default: m.ElectionsPage }))\n);\nconst ConsultationsPage = lazy(() =>\n import('./pages/intelligence/ConsultationsPage').then((m) => ({ default: m.ConsultationsPage }))\n);\nconst OpenDataPage = lazy(() =>\n import('./pages/intelligence/OpenDataPage').then((m) => ({ default: m.OpenDataPage }))\n);\nconst TimelinePage = lazy(() =>\n import('./pages/intelligence/TimelinePage').then((m) => ({ default: m.TimelinePage }))\n);\nconst CorrectionsPage = lazy(() =>\n import('./pages/intelligence/CorrectionsPage').then((m) => ({ default: m.CorrectionsPage }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\n/**\n * Index-route landing (BOFF-4088). Narrow viewports — mobile web and every\n * Capacitor build, which report the same narrow viewport as a phone browser —\n * land on the citizen mobile home tab instead of the officer-shaped desktop\n * dashboard. `replace` keeps the redirect out of browser history.\n */\nconst HomeRoute: FC = () => {\n const isMobile = useIsMobileViewport();\n const { isLoading, canOfficer } = useOfficerAccess();\n const { getPath } = useGovCitizenHub();\n const location = useLocation();\n if (isLoading) return <PageLoader />;\n // Officers always start in the Officer console; citizens start on their own\n // home (the mobile tab bar on a phone). The two never share a landing page.\n if (canOfficer) {\n return <Navigate to={{ pathname: getPath('officer'), search: location.search }} replace />;\n }\n if (isMobile) return <Navigate to=\"m\" replace />;\n return <CitizenHomePage />;\n};\n\nconst OfficerRedirect: FC<{ to: string }> = ({ to }) => {\n const { getPath } = useGovCitizenHub();\n const location = useLocation();\n return <Navigate to={{ pathname: getPath(`officer/${to}`), search: location.search }} replace />;\n};\n\nexport const GovCitizenHubRoutes: FC = () => {\n const { basePath, isStandalone } = useGovCitizenHub();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<HomeRoute />} />\n\n <Route element={<CitizenOnlyLayout />}>\n <Route\n path=\"m\"\n element={\n <FeatureGate flag=\"govcitizenhub.mobile.enabled\" defaultValue={true}>\n <MobileLayout>\n <MobileHomePage />\n </MobileLayout>\n </FeatureGate>\n }\n />\n <Route\n path=\"m/requests\"\n element={\n <FeatureGate flag=\"govcitizenhub.mobile.enabled\" defaultValue={true}>\n <MobileLayout>\n <MobileRequestsPage />\n </MobileLayout>\n </FeatureGate>\n }\n />\n <Route\n path=\"m/scan\"\n element={\n <FeatureGate flag=\"govcitizenhub.mobile.enabled\" defaultValue={true}>\n <MobileLayout>\n <VerifyPermitPage />\n </MobileLayout>\n </FeatureGate>\n }\n />\n <Route\n path=\"m/profile\"\n element={\n <FeatureGate flag=\"govcitizenhub.mobile.enabled\" defaultValue={true}>\n <MobileLayout>\n <MobileProfilePage />\n </MobileLayout>\n </FeatureGate>\n }\n />\n </Route>\n\n {/*\n Citizen portal — apply, track, upload and report. Reads only the caller's\n own records (`govMy*`); officer controls never render here.\n */}\n <Route element={<CitizenLayout />}>\n <Route\n path=\"services\"\n element={\n <FeatureGate flag=\"govcitizenhub.services.enabled\" defaultValue={true}>\n <ServicesPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"services/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.services.enabled\" defaultValue={true}>\n <ServiceDetailPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"applications\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <div className=\"mx-auto w-full max-w-3xl\">\n <MobileRequestsPage />\n </div>\n </FeatureGate>\n }\n />\n <Route\n path=\"applications/new\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <NewApplicationPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"applications/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <ApplicationDetailPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"documents\"\n element={\n <FeatureGate flag=\"govcitizenhub.documents.enabled\" defaultValue={true}>\n <DocumentsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"wallet\"\n element={\n <FeatureGate flag=\"govcitizenhub.wallet.enabled\" defaultValue={true}>\n <WalletPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"grievances\"\n element={\n <FeatureGate flag=\"govcitizenhub.grievances.enabled\" defaultValue={true}>\n <GrievancesPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"grievances/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.grievances.enabled\" defaultValue={true}>\n <GrievanceDetailPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"permits/verify\"\n element={\n <FeatureGate flag=\"govcitizenhub.permits.enabled\" defaultValue={true}>\n <VerifyPermitPage />\n </FeatureGate>\n }\n />\n </Route>\n\n {/*\n Officer console — casework, issuance, fees, grievance triage and the\n agency directory. OfficerLayout is the guard: without a staff permission\n it renders a permission-denied page instead of any of these routes.\n */}\n <Route path=\"officer\" element={<OfficerLayout />}>\n <Route index element={<DashboardPage />} />\n <Route path=\"access-control\" element={<AccessControlPage />} />\n <Route\n path=\"queue\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <ApplicationsPage key=\"queue\" myQueue />\n </FeatureGate>\n }\n />\n <Route\n path=\"applications\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <ApplicationsPage key=\"all\" />\n </FeatureGate>\n }\n />\n <Route\n path=\"applications/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.applications.enabled\" defaultValue={true}>\n <ApplicationDetailPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"agencies\"\n element={\n <FeatureGate flag=\"govcitizenhub.agencies.enabled\" defaultValue={true}>\n <AgenciesPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"documents\"\n element={\n <FeatureGate flag=\"govcitizenhub.documents.enabled\" defaultValue={true}>\n <DocumentsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"payments\"\n element={\n <FeatureGate flag=\"govcitizenhub.payments.enabled\" defaultValue={true}>\n <PaymentsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"permits\"\n element={\n <FeatureGate flag=\"govcitizenhub.permits.enabled\" defaultValue={true}>\n <PermitsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"permits/verify\"\n element={\n <FeatureGate flag=\"govcitizenhub.permits.enabled\" defaultValue={true}>\n <VerifyPermitPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"grievances\"\n element={\n <FeatureGate flag=\"govcitizenhub.grievances.enabled\" defaultValue={true}>\n <GrievancesPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"grievances/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.grievances.enabled\" defaultValue={true}>\n <GrievanceDetailPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"services\"\n element={\n <FeatureGate flag=\"govcitizenhub.services.enabled\" defaultValue={true}>\n <ServicesPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"services/:id\"\n element={\n <FeatureGate flag=\"govcitizenhub.services.enabled\" defaultValue={true}>\n <ServiceDetailPage />\n </FeatureGate>\n }\n />\n </Route>\n\n {/* Bookmarks from before the split: officer-only pages now live under officer/. */}\n <Route path=\"agencies\" element={<OfficerRedirect to=\"agencies\" />} />\n <Route path=\"payments\" element={<OfficerRedirect to=\"payments\" />} />\n <Route path=\"permits\" element={<OfficerRedirect to=\"permits\" />} />\n\n {/*\n Community Intelligence. The two `intelligence/admin/*` catalog routes\n are declared BEFORE `intelligence/:jurisdictionId` so \"admin\" can\n never be matched as a jurisdiction id.\n */}\n <Route\n path=\"intelligence\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <JurisdictionDirectoryPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/admin/levels\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <AdminLevelsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/admin/indicators\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <IndicatorCatalogPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <JurisdictionProfilePage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/governance\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <GovernancePage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/budget\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <BudgetPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/projects\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <ProjectsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/indicators\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <IndicatorsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/benchmark\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <BenchmarkPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/services\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <ServicePerformancePage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/assets\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <PublicAssetsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/elections\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <ElectionsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/consultations\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <ConsultationsPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/open-data\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <OpenDataPage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/timeline\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <TimelinePage />\n </FeatureGate>\n }\n />\n <Route\n path=\"intelligence/:jurisdictionId/corrections\"\n element={\n <FeatureGate flag=\"govcitizenhub.intelligence.enabled\" defaultValue={true}>\n <CorrectionsPage />\n </FeatureGate>\n }\n />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,IAAMA,IAAeC,QACnB,OAAO,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,aAAa,EAAE,CACnF,GACMC,IAAoBF,QACxB,OAAO,wCAAqC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,kBAAkB,EAAE,CAC7F,GACME,IAAmBH,QACvB,OAAO,2CAAwC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,iBAAiB,EAAE,CAC/F,GACMG,IAAwBJ,QAC5B,OAAO,gDAA6C,CAAC,MAAM,OAAO,EAChE,SAASC,EAAE,sBACb,EAAE,CACJ,GACMI,KAAqBL,QACzB,OAAO,6CAA0C,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,mBAAmB,EAAE,CACnG,GACMK,IAAeN,QACnB,OAAO,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,aAAa,EAAE,CACnF,GACMM,IAAgBP,QACpB,OAAO,qCAAkC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,cAAc,EAAE,CACtF,GACMO,IAAaR,QACjB,OAAO,+BAA4B,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,WAAW,EAAE,CAC7E,GACMQ,IAAeT,QACnB,OAAO,mCAAgC,CAAC,MAAM,OAAO,EAAE,SAASC,EAAE,aAAa,EAAE,CACnF,GACMS,IAAcV,QAClB,OAAO,iCAA8B,CAAC,MAAM,OAAO,EAAE,SAASC,EA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kBAACE,GAAD;MAAa,MAAK;MAAqC,cAAc;MACnE,UAAA,kBAACzB,GAAD,CAAkB,CAAA;KACP,CAAA;IAEhB,CAAA;IAED,kBAACuB,GAAD;KAAO,MAAK;KAAI,SAAS,kBAACX,GAAD;MAAU,IAAG;MAAG,SAAA;KAAS,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA;CACP,CAAA;AAET"}
@@ -8,3 +8,4 @@ export * from './useCursorPager';
8
8
  export * from './useFiles';
9
9
  export * from './useGovCitizenHubAnalytics';
10
10
  export * from './useIsMobileViewport';
11
+ export * from './useAccessControlApi';
@@ -4,4 +4,5 @@ import { useCursorPager as At } from "./useCursorPager.js";
4
4
  import { FILE_FOLDERS as jt, uploadFileToFiles as Mt, useFileUrl as Nt } from "./useFiles.js";
5
5
  import { useGovCitizenHubAnalytics as Pt } from "./useGovCitizenHubAnalytics.js";
6
6
  import { useIsMobileViewport as Ft } from "./useIsMobileViewport.js";
7
- export { jt as FILE_FOLDERS, e as govQuery, t as page, Mt as uploadFileToFiles, At as useCursorPager, Nt as useFileUrl, n as useGovAddCaseNote, r as useGovAddDocument, i as useGovAddMyDocumentFromWallet, a as useGovAddMyWalletDocument, Z as useGovAdminLevelPresets, Q as useGovAdminLevels, o as useGovAgencies, s as useGovAgency, c as useGovApplication, l as useGovApplicationSlaSummary, u as useGovApplications, d as useGovApplicationsByService, f as useGovArchiveAgency, p as useGovAttachPermitFile, $ as useGovBudget, ee as useGovBudgetExecution, te as useGovBudgets, m as useGovCaseworkWorkload, Pt as useGovCitizenHubAnalytics, ne as useGovCloseConsultation, re as useGovConsultationResults, ie as useGovConsultations, ae as useGovCreateAdminLevel, h as useGovCreateAgency, g as useGovCreateApplication, oe as useGovCreateBudget, se as useGovCreateConsultation, ce as useGovCreateDataset, le as useGovCreateElection, ue as useGovCreateIndicator, de as useGovCreateJurisdiction, fe as useGovCreateJurisdictionEvent, pe as useGovCreateOfficial, me as useGovCreateOfficialCommitment, _ as useGovCreatePayment, he as useGovCreateProject, ge as useGovCreateProjectMilestone, _e as useGovCreatePublicAsset, v as useGovCreateService, y as useGovDashboardSummary, ve as useGovDataChangeProposals, ye as useGovDataset, be as useGovDatasets, xe as useGovDeleteAdminLevel, Se as useGovDeleteBudgetLine, Ce as useGovDeleteConsultation, we as useGovDeleteDataset, Te as useGovDeleteElection, Ee as useGovDeleteIndicator, De as useGovDeleteIndicatorValue, Oe as useGovDeleteJurisdictionEvent, b as useGovDeleteMyWalletDocument, ke as useGovDeleteOfficial, Ae as useGovDeleteOfficialCommitment, je as useGovDeleteProjectMilestone, Me as useGovDeletePublicAsset, Ne as useGovElection, Pe as useGovElections, Fe as useGovFollowJurisdiction, x as useGovGrievance, S as useGovGrievances, Ie as useGovIndicatorSeries, Le as useGovIndicatorValues, Re as useGovIndicators, C as useGovIssuePermit, ze as useGovJurisdictionBenchmark, Be as useGovJurisdictionEvents, Ve as useGovJurisdictionGrievanceInsights, He as useGovJurisdictionOverview, Ue as useGovJurisdictionServicePerformance, We as useGovJurisdictionTree, Ge as useGovJurisdictions, w as useGovMarkPaymentPaid, T as useGovMyApplications, Ke as useGovMyConsultationResponse, qe as useGovMyDataChangeProposals, Je as useGovMyFollowedJurisdictions, E as useGovMyGrievances, D as useGovMyWalletDocuments, Ye as useGovOfficial, Xe as useGovOfficials, Ze as useGovOpenConsultation, O as useGovPayments, k as useGovPermitPdf, A as useGovPermits, Qe as useGovProject, $e as useGovProjects, et as useGovPublicAssetSummary, tt as useGovPublicAssets, nt as useGovPublishBudget, rt as useGovPublishConsultationResults, it as useGovPublishDataset, at as useGovRecordDatasetDownload, ot as useGovRecordElectionResults, st as useGovRecordIndicatorValue, j as useGovRefundPayment, M as useGovReplyToMyApplication, N as useGovReportGrievance, ct as useGovReviewDataChangeProposal, P as useGovReviewDocument, F as useGovRevokePermit, I as useGovRunSlaEscalationSweep, lt as useGovSeedAdminLevels, ut as useGovSeedIndicatorCatalog, L as useGovService, R as useGovServices, z as useGovSlaSummaryByDesk, B as useGovSlaSummaryByRegion, V as useGovSubmitApplication, dt as useGovSubmitConsultationResponse, ft as useGovSubmitDataChangeProposal, H as useGovTransitionApplication, U as useGovTransitionGrievance, W as useGovTransitionService, pt as useGovUnfollowJurisdiction, mt as useGovUpdateAdminLevel, G as useGovUpdateAgency, K as useGovUpdateApplication, ht as useGovUpdateBudget, gt as useGovUpdateConsultation, _t as useGovUpdateDataset, vt as useGovUpdateElection, q as useGovUpdateGrievance, yt as useGovUpdateIndicator, bt as useGovUpdateIndicatorValue, xt as useGovUpdateJurisdictionEvent, J as useGovUpdateMyWalletDocument, St as useGovUpdateOfficial, Ct as useGovUpdateOfficialCommitment, wt as useGovUpdateProject, Tt as useGovUpdateProjectMilestone, Et as useGovUpdateProjectStatus, Dt as useGovUpdatePublicAsset, Y as useGovUpdateService, Ot as useGovUpsertBudgetLines, X as useGovVerifyPermit, kt as useGovWithdrawDataChangeProposal, Ft as useIsMobileViewport };
7
+ import { useGovAuditTrail as It, useGovRoles as Lt } from "./useAccessControlApi.js";
8
+ export { jt as FILE_FOLDERS, e as govQuery, t as page, Mt as uploadFileToFiles, At as useCursorPager, Nt as useFileUrl, n as useGovAddCaseNote, r as useGovAddDocument, i as useGovAddMyDocumentFromWallet, a as useGovAddMyWalletDocument, Z as useGovAdminLevelPresets, Q as useGovAdminLevels, o as useGovAgencies, s as useGovAgency, c as useGovApplication, l as useGovApplicationSlaSummary, u as useGovApplications, d as useGovApplicationsByService, f as useGovArchiveAgency, p as useGovAttachPermitFile, It as useGovAuditTrail, $ as useGovBudget, ee as useGovBudgetExecution, te as useGovBudgets, m as useGovCaseworkWorkload, Pt as useGovCitizenHubAnalytics, ne as useGovCloseConsultation, re as useGovConsultationResults, ie as useGovConsultations, ae as useGovCreateAdminLevel, h as useGovCreateAgency, g as useGovCreateApplication, oe as useGovCreateBudget, se as useGovCreateConsultation, ce as useGovCreateDataset, le as useGovCreateElection, ue as useGovCreateIndicator, de as useGovCreateJurisdiction, fe as useGovCreateJurisdictionEvent, pe as useGovCreateOfficial, me as useGovCreateOfficialCommitment, _ as useGovCreatePayment, he as useGovCreateProject, ge as useGovCreateProjectMilestone, _e as useGovCreatePublicAsset, v as useGovCreateService, y as useGovDashboardSummary, ve as useGovDataChangeProposals, ye as useGovDataset, be as useGovDatasets, xe as useGovDeleteAdminLevel, Se as useGovDeleteBudgetLine, Ce as useGovDeleteConsultation, we as useGovDeleteDataset, Te as useGovDeleteElection, Ee as useGovDeleteIndicator, De as useGovDeleteIndicatorValue, Oe as useGovDeleteJurisdictionEvent, b as useGovDeleteMyWalletDocument, ke as useGovDeleteOfficial, Ae as useGovDeleteOfficialCommitment, je as useGovDeleteProjectMilestone, Me as useGovDeletePublicAsset, Ne as useGovElection, Pe as useGovElections, Fe as useGovFollowJurisdiction, x as useGovGrievance, S as useGovGrievances, Ie as useGovIndicatorSeries, Le as useGovIndicatorValues, Re as useGovIndicators, C as useGovIssuePermit, ze as useGovJurisdictionBenchmark, Be as useGovJurisdictionEvents, Ve as useGovJurisdictionGrievanceInsights, He as useGovJurisdictionOverview, Ue as useGovJurisdictionServicePerformance, We as useGovJurisdictionTree, Ge as useGovJurisdictions, w as useGovMarkPaymentPaid, T as useGovMyApplications, Ke as useGovMyConsultationResponse, qe as useGovMyDataChangeProposals, Je as useGovMyFollowedJurisdictions, E as useGovMyGrievances, D as useGovMyWalletDocuments, Ye as useGovOfficial, Xe as useGovOfficials, Ze as useGovOpenConsultation, O as useGovPayments, k as useGovPermitPdf, A as useGovPermits, Qe as useGovProject, $e as useGovProjects, et as useGovPublicAssetSummary, tt as useGovPublicAssets, nt as useGovPublishBudget, rt as useGovPublishConsultationResults, it as useGovPublishDataset, at as useGovRecordDatasetDownload, ot as useGovRecordElectionResults, st as useGovRecordIndicatorValue, j as useGovRefundPayment, M as useGovReplyToMyApplication, N as useGovReportGrievance, ct as useGovReviewDataChangeProposal, P as useGovReviewDocument, F as useGovRevokePermit, Lt as useGovRoles, I as useGovRunSlaEscalationSweep, lt as useGovSeedAdminLevels, ut as useGovSeedIndicatorCatalog, L as useGovService, R as useGovServices, z as useGovSlaSummaryByDesk, B as useGovSlaSummaryByRegion, V as useGovSubmitApplication, dt as useGovSubmitConsultationResponse, ft as useGovSubmitDataChangeProposal, H as useGovTransitionApplication, U as useGovTransitionGrievance, W as useGovTransitionService, pt as useGovUnfollowJurisdiction, mt as useGovUpdateAdminLevel, G as useGovUpdateAgency, K as useGovUpdateApplication, ht as useGovUpdateBudget, gt as useGovUpdateConsultation, _t as useGovUpdateDataset, vt as useGovUpdateElection, q as useGovUpdateGrievance, yt as useGovUpdateIndicator, bt as useGovUpdateIndicatorValue, xt as useGovUpdateJurisdictionEvent, J as useGovUpdateMyWalletDocument, St as useGovUpdateOfficial, Ct as useGovUpdateOfficialCommitment, wt as useGovUpdateProject, Tt as useGovUpdateProjectMilestone, Et as useGovUpdateProjectStatus, Dt as useGovUpdatePublicAsset, Y as useGovUpdateService, Ot as useGovUpsertBudgetLines, X as useGovVerifyPermit, kt as useGovWithdrawDataChangeProposal, Ft as useIsMobileViewport };
@@ -0,0 +1,14 @@
1
+ import { AuditFilterInput, AuditRow } from '../lib/access-control';
2
+ export interface GovRole {
3
+ id: string;
4
+ name: string;
5
+ description: string | null;
6
+ priority: number;
7
+ productSlug: string | null;
8
+ defaultPermissions: Array<{
9
+ resourceType: string;
10
+ level: string;
11
+ }>;
12
+ }
13
+ export declare const useGovRoles: () => import('@tanstack/react-query').UseQueryResult<GovRole[], Error>;
14
+ export declare const useGovAuditTrail: (filter: Omit<AuditFilterInput, "workspaceId">) => import('@tanstack/react-query').UseQueryResult<AuditRow[], Error>;
@@ -0,0 +1,39 @@
1
+ import { useGovCitizenHub as e } from "../context/GovCitizenHubContext.js";
2
+ import "../context/index.js";
3
+ import { buildAuditFilters as t, mergeAuditRows as n } from "../lib/access-control.js";
4
+ import { govQuery as r } from "./useGovApi.js";
5
+ import { useQuery as i } from "@tanstack/react-query";
6
+ // src/govcitizenhub/hooks/useAccessControlApi.ts
7
+ var a = "\n query GovAccessRoles($scopeId: String!) {\n rolesPage(\n scopeId: $scopeId\n filter: { product: \"govcitizenhub\", includePlatformRoles: false }\n pagination: { limit: 100 }\n ) {\n items {\n id\n name\n description\n priority\n productSlug\n defaultPermissions {\n resourceType\n level\n }\n }\n }\n }\n", o = () => {
8
+ let { workspaceId: t, apiGatewayUrl: n } = e();
9
+ return i({
10
+ queryKey: [
11
+ "govcitizenhub",
12
+ "access-roles",
13
+ t
14
+ ],
15
+ enabled: !!t,
16
+ queryFn: async () => [...(await r(a, { scopeId: t }, n)).rolesPage.items].sort((e, t) => t.priority - e.priority)
17
+ });
18
+ }, s = "id userId action resourceType resourceId description timestamp", c = (e) => `query GovAuditTrail(${Array.from({ length: e }, (e, t) => `$f${t}: ActivityLogFilter`).join(", ")}) {\n${Array.from({ length: e }, (e, t) => `a${t}: getActivities(filter: $f${t}) { ${s} }`).join("\n")}\n}`, l = (a) => {
19
+ let { workspaceId: o, apiGatewayUrl: s } = e();
20
+ return i({
21
+ queryKey: [
22
+ "govcitizenhub",
23
+ "audit-trail",
24
+ o,
25
+ a
26
+ ],
27
+ enabled: !!o,
28
+ queryFn: async () => {
29
+ let e = t({
30
+ ...a,
31
+ workspaceId: o ?? ""
32
+ }), i = Object.fromEntries(e.map((e, t) => [`f${t}`, e])), l = await r(c(e.length), i, s);
33
+ return n(e.map((e, t) => l[`a${t}`] ?? []), a.limit);
34
+ }
35
+ });
36
+ };
37
+ export { l as useGovAuditTrail, o as useGovRoles };
38
+
39
+ //# sourceMappingURL=useAccessControlApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAccessControlApi.js","names":["ROLES_QUERY","useGovRoles","useGovCitizenHub","useQuery","workspaceId","govQuery","apiGatewayUrl","b","a","ACTIVITY_FIELDS","buildAuditQuery","count","i","useGovAuditTrail","filter","filters","buildAuditFilters","variables","f","data","mergeAuditRows"],"sources":["../../../src/govcitizenhub/hooks/useAccessControlApi.ts"],"sourcesContent":["/**\n * Access control API hooks (BOFF-4059) — platform RBAC roles and platform\n * Activity log, both read through the workspace gateway.\n */\n\nimport { useQuery } from '@tanstack/react-query';\n\nimport { useGovCitizenHub } from '../context';\nimport {\n buildAuditFilters,\n mergeAuditRows,\n type AuditFilterInput,\n type AuditRow,\n} from '../lib/access-control';\nimport { govQuery } from './useGovApi';\n\nexport interface GovRole {\n id: string;\n name: string;\n description: string | null;\n priority: number;\n productSlug: string | null;\n defaultPermissions: Array<{ resourceType: string; level: string }>;\n}\n\nconst ROLES_QUERY = /* GraphQL */ `\n query GovAccessRoles($scopeId: String!) {\n rolesPage(\n scopeId: $scopeId\n filter: { product: \"govcitizenhub\", includePlatformRoles: false }\n pagination: { limit: 100 }\n ) {\n items {\n id\n name\n description\n priority\n productSlug\n defaultPermissions {\n resourceType\n level\n }\n }\n }\n }\n`;\n\nexport const useGovRoles = () => {\n const { workspaceId, apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: ['govcitizenhub', 'access-roles', workspaceId],\n enabled: !!workspaceId,\n queryFn: async () => {\n const data = await govQuery<{ rolesPage: { items: GovRole[] } }>(\n ROLES_QUERY,\n { scopeId: workspaceId },\n apiGatewayUrl\n );\n return [...data.rolesPage.items].sort((a, b) => b.priority - a.priority);\n },\n });\n};\n\nconst ACTIVITY_FIELDS = 'id userId action resourceType resourceId description timestamp';\n\n/** One aliased `getActivities` per resource type, sent as a single request. */\nconst buildAuditQuery = (count: number): string => {\n const vars = Array.from({ length: count }, (_, i) => `$f${i}: ActivityLogFilter`).join(', ');\n const fields = Array.from(\n { length: count },\n (_, i) => `a${i}: getActivities(filter: $f${i}) { ${ACTIVITY_FIELDS} }`\n ).join('\\n');\n return `query GovAuditTrail(${vars}) {\\n${fields}\\n}`;\n};\n\nexport const useGovAuditTrail = (filter: Omit<AuditFilterInput, 'workspaceId'>) => {\n const { workspaceId, apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: ['govcitizenhub', 'audit-trail', workspaceId, filter],\n enabled: !!workspaceId,\n queryFn: async (): Promise<AuditRow[]> => {\n const filters = buildAuditFilters({ ...filter, workspaceId: workspaceId ?? '' });\n const variables = Object.fromEntries(filters.map((f, i) => [`f${i}`, f]));\n const data = await govQuery<Record<string, AuditRow[]>>(\n buildAuditQuery(filters.length),\n variables,\n apiGatewayUrl\n );\n return mergeAuditRows(\n filters.map((_, i) => data[`a${i}`] ?? []),\n filter.limit\n );\n },\n });\n};\n"],"mappings":";;;;;;AAyBA,IAAMA,IAA4B,8ZAsBrBC,UAAoB;CAC/B,IAAM,EAAE,gBAAa,qBAAkBC,EAAiB;CACxD,OAAOC,EAAS;EACd,UAAU;GAAC;GAAiB;GAAgBC;EAAW;EACvD,SAAS,CAAC,CAACA;EACX,SAAS,YAMA,CAAC,IAAG,MALQC,EACjBL,GACA,EAAE,SAASI,EAAY,GACvBE,CACF,EAAA,CACgB,UAAU,KAAK,CAAC,CAAC,MAAM,GAAG,MAAMC,EAAE,WAAWC,EAAE,QAAQ;CAE3E,CAAC;AACH,GAEMC,IAAkB,kEAGlBC,KAAmB,MAMhB,uBALM,MAAM,KAAK,EAAE,QAAQC,EAAM,IAAI,GAAG,MAAM,KAAKC,EAAE,oBAAoB,CAAC,CAAC,KAAK,IAKzD,EAAK,OAJpB,MAAM,KACnB,EAAE,QAAQD,EAAM,IACf,GAAG,MAAM,IAAIC,EAAE,4BAA4BA,EAAE,MAAMH,EAAgB,GACtE,CAAC,CAAC,KAAK,IACmC,EAAO,MAGtCI,KAAoB,MAAkD;CACjF,IAAM,EAAE,gBAAa,qBAAkBX,EAAiB;CACxD,OAAOC,EAAS;EACd,UAAU;GAAC;GAAiB;GAAeC;GAAaU;EAAM;EAC9D,SAAS,CAAC,CAACV;EACX,SAAS,YAAiC;GACxC,IAAMW,IAAUC,EAAkB;IAAE,GAAGF;IAAQ,aAAaV,KAAe;GAAG,CAAC,GACzEa,IAAY,OAAO,YAAYF,EAAQ,KAAK,GAAG,MAAM,CAAC,IAAIH,KAAKM,CAAC,CAAC,CAAC,GAClEC,IAAO,MAAMd,EACjBK,EAAgBK,EAAQ,MAAM,GAC9BE,GACAX,CACF;GACA,OAAOc,EACLL,EAAQ,KAAK,GAAG,MAAMI,EAAK,IAAIP,QAAQ,CAAC,CAAC,GACzCE,EAAO,KACT;EACF;CACF,CAAC;AACH"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Access control — pure helpers for the Roles and Audit tabs (BOFF-4059).
3
+ *
4
+ * Roles come from the platform RBAC API and the audit trail from the platform
5
+ * Activity API; nothing here is a second source of truth. These helpers only
6
+ * turn that data into readable labels, a scoped query and a CSV export.
7
+ */
8
+ /** Resource types the GovCitizenHub svc records activity under (see audit-helpers.ts). */
9
+ export declare const GOV_AUDIT_RESOURCE_TYPES: readonly ["govcitizenhub-agency", "govcitizenhub-application", "govcitizenhub-case-note", "govcitizenhub-document", "govcitizenhub-grievance", "govcitizenhub-payment", "govcitizenhub-permit", "govcitizenhub-routing-rule", "govcitizenhub-service", "govcitizenhub"];
10
+ export declare const GOV_AUDIT_ACTIONS: readonly ["create", "update", "delete", "read"];
11
+ /** Readable name for a resource type; unknown ones are humanised, never dropped. */
12
+ export declare function resourceLabel(resourceType: string): string;
13
+ export declare const levelLabel: (level: string) => string;
14
+ export interface AuditFilterInput {
15
+ workspaceId: string;
16
+ actorId?: string;
17
+ action?: string;
18
+ /** One resource type, or empty for every GovCitizenHub resource. */
19
+ resourceType?: string;
20
+ /** `YYYY-MM-DD` day bounds, inclusive. */
21
+ from?: string;
22
+ to?: string;
23
+ limit: number;
24
+ }
25
+ export interface ActivityLogFilter {
26
+ workspaceId: string;
27
+ resourceType: string;
28
+ userId?: string;
29
+ action?: string;
30
+ startDate?: string;
31
+ endDate?: string;
32
+ limit: number;
33
+ }
34
+ /** One Activity filter per resource type, so the trail never leaks other products' activity. */
35
+ export declare function buildAuditFilters(input: AuditFilterInput): ActivityLogFilter[];
36
+ export interface AuditRow {
37
+ id: string;
38
+ userId: string;
39
+ action: string;
40
+ resourceType: string | null;
41
+ resourceId: string | null;
42
+ description: string | null;
43
+ timestamp: string;
44
+ }
45
+ /** Merge the per-resource result sets newest-first and keep the first `limit`. */
46
+ export declare function mergeAuditRows(groups: AuditRow[][], limit: number): AuditRow[];
47
+ export declare function auditRowsToCsv(rows: AuditRow[]): string;
@@ -0,0 +1,91 @@
1
+ // src/govcitizenhub/lib/access-control.ts
2
+ var e = [
3
+ "govcitizenhub-agency",
4
+ "govcitizenhub-application",
5
+ "govcitizenhub-case-note",
6
+ "govcitizenhub-document",
7
+ "govcitizenhub-grievance",
8
+ "govcitizenhub-payment",
9
+ "govcitizenhub-permit",
10
+ "govcitizenhub-routing-rule",
11
+ "govcitizenhub-service",
12
+ "govcitizenhub"
13
+ ], t = [
14
+ "create",
15
+ "update",
16
+ "delete",
17
+ "read"
18
+ ], n = {
19
+ "govcitizenhub-agency": "Agencies",
20
+ "govcitizenhub-application": "Applications",
21
+ "govcitizenhub-case-note": "Case notes",
22
+ "govcitizenhub-document": "Supporting documents",
23
+ "govcitizenhub-grievance": "Grievances",
24
+ "govcitizenhub-payment": "Fee payments",
25
+ "govcitizenhub-permit": "Permits and certificates",
26
+ "govcitizenhub-routing-rule": "Routing rules",
27
+ "govcitizenhub-service": "Service catalog",
28
+ "govcitizenhub-adminlevel": "Administrative levels",
29
+ "govcitizenhub-asset": "Public assets",
30
+ "govcitizenhub-budget": "Budgets",
31
+ "govcitizenhub-consultation": "Consultations",
32
+ "govcitizenhub-dataset": "Open datasets",
33
+ "govcitizenhub-election": "Elections",
34
+ "govcitizenhub-event": "Civic events",
35
+ "govcitizenhub-indicator": "Indicators",
36
+ "govcitizenhub-jurisdiction": "Jurisdictions",
37
+ "govcitizenhub-official": "Officials",
38
+ "govcitizenhub-project": "Capital projects",
39
+ "govcitizenhub-proposal": "Citizen corrections",
40
+ govcitizenhub: "Other"
41
+ }, r = {
42
+ ADMIN: "Full control",
43
+ EDITOR: "Create and edit",
44
+ VIEWER: "View"
45
+ };
46
+ function i(e) {
47
+ let t = n[e];
48
+ if (t) return t;
49
+ let r = e.replace(/^govcitizenhub-/, "").replace(/-/g, " ");
50
+ return r.charAt(0).toUpperCase() + r.slice(1);
51
+ }
52
+ var a = (e) => r[e] ?? e;
53
+ function o(t) {
54
+ return (t.resourceType ? [t.resourceType] : [...e]).map((e) => ({
55
+ workspaceId: t.workspaceId,
56
+ resourceType: e,
57
+ limit: t.limit,
58
+ ...t.actorId ? { userId: t.actorId } : {},
59
+ ...t.action ? { action: t.action } : {},
60
+ ...t.from ? { startDate: `${t.from}T00:00:00.000Z` } : {},
61
+ ...t.to ? { endDate: `${t.to}T23:59:59.999Z` } : {}
62
+ }));
63
+ }
64
+ function s(e, t) {
65
+ return e.flat().sort((e, t) => Date.parse(t.timestamp) - Date.parse(e.timestamp)).slice(0, t);
66
+ }
67
+ var c = (e) => {
68
+ let t = e ?? "", n = /^[=+\-@\t\r]/.test(t) ? `'${t}` : t;
69
+ return /[",\n\r]/.test(n) ? `"${n.replace(/"/g, "\"\"")}"` : n;
70
+ };
71
+ function l(e) {
72
+ let t = [
73
+ "Time",
74
+ "Actor",
75
+ "Action",
76
+ "Resource",
77
+ "Resource id",
78
+ "Description"
79
+ ], n = e.map((e) => [
80
+ e.timestamp,
81
+ e.userId,
82
+ e.action,
83
+ e.resourceType ? i(e.resourceType) : "",
84
+ e.resourceId,
85
+ e.description
86
+ ].map(c).join(","));
87
+ return [t.join(","), ...n].join("\n");
88
+ }
89
+ export { t as GOV_AUDIT_ACTIONS, e as GOV_AUDIT_RESOURCE_TYPES, l as auditRowsToCsv, o as buildAuditFilters, a as levelLabel, s as mergeAuditRows, i as resourceLabel };
90
+
91
+ //# sourceMappingURL=access-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-control.js","names":["GOV_AUDIT_RESOURCE_TYPES","GOV_AUDIT_ACTIONS","RESOURCE_LABELS","LEVEL_LABELS","resourceLabel","known","resourceType","bare","levelLabel","level","buildAuditFilters","input","mergeAuditRows","groups","b","a","limit","csvCell","text","value","safe","auditRowsToCsv","header","lines","rows","row"],"sources":["../../../src/govcitizenhub/lib/access-control.ts"],"sourcesContent":["/**\n * Access control — pure helpers for the Roles and Audit tabs (BOFF-4059).\n *\n * Roles come from the platform RBAC API and the audit trail from the platform\n * Activity API; nothing here is a second source of truth. These helpers only\n * turn that data into readable labels, a scoped query and a CSV export.\n */\n\n/** Resource types the GovCitizenHub svc records activity under (see audit-helpers.ts). */\nexport const GOV_AUDIT_RESOURCE_TYPES = [\n 'govcitizenhub-agency',\n 'govcitizenhub-application',\n 'govcitizenhub-case-note',\n 'govcitizenhub-document',\n 'govcitizenhub-grievance',\n 'govcitizenhub-payment',\n 'govcitizenhub-permit',\n 'govcitizenhub-routing-rule',\n 'govcitizenhub-service',\n 'govcitizenhub',\n] as const;\n\nexport const GOV_AUDIT_ACTIONS = ['create', 'update', 'delete', 'read'] as const;\n\nconst RESOURCE_LABELS: Record<string, string> = {\n 'govcitizenhub-agency': 'Agencies',\n 'govcitizenhub-application': 'Applications',\n 'govcitizenhub-case-note': 'Case notes',\n 'govcitizenhub-document': 'Supporting documents',\n 'govcitizenhub-grievance': 'Grievances',\n 'govcitizenhub-payment': 'Fee payments',\n 'govcitizenhub-permit': 'Permits and certificates',\n 'govcitizenhub-routing-rule': 'Routing rules',\n 'govcitizenhub-service': 'Service catalog',\n 'govcitizenhub-adminlevel': 'Administrative levels',\n 'govcitizenhub-asset': 'Public assets',\n 'govcitizenhub-budget': 'Budgets',\n 'govcitizenhub-consultation': 'Consultations',\n 'govcitizenhub-dataset': 'Open datasets',\n 'govcitizenhub-election': 'Elections',\n 'govcitizenhub-event': 'Civic events',\n 'govcitizenhub-indicator': 'Indicators',\n 'govcitizenhub-jurisdiction': 'Jurisdictions',\n 'govcitizenhub-official': 'Officials',\n 'govcitizenhub-project': 'Capital projects',\n 'govcitizenhub-proposal': 'Citizen corrections',\n govcitizenhub: 'Other',\n};\n\nconst LEVEL_LABELS: Record<string, string> = {\n ADMIN: 'Full control',\n EDITOR: 'Create and edit',\n VIEWER: 'View',\n};\n\n/** Readable name for a resource type; unknown ones are humanised, never dropped. */\nexport function resourceLabel(resourceType: string): string {\n const known = RESOURCE_LABELS[resourceType];\n if (known) return known;\n const bare = resourceType.replace(/^govcitizenhub-/, '').replace(/-/g, ' ');\n return bare.charAt(0).toUpperCase() + bare.slice(1);\n}\n\nexport const levelLabel = (level: string): string => LEVEL_LABELS[level] ?? level;\n\nexport interface AuditFilterInput {\n workspaceId: string;\n actorId?: string;\n action?: string;\n /** One resource type, or empty for every GovCitizenHub resource. */\n resourceType?: string;\n /** `YYYY-MM-DD` day bounds, inclusive. */\n from?: string;\n to?: string;\n limit: number;\n}\n\nexport interface ActivityLogFilter {\n workspaceId: string;\n resourceType: string;\n userId?: string;\n action?: string;\n startDate?: string;\n endDate?: string;\n limit: number;\n}\n\n/** One Activity filter per resource type, so the trail never leaks other products' activity. */\nexport function buildAuditFilters(input: AuditFilterInput): ActivityLogFilter[] {\n const types = input.resourceType ? [input.resourceType] : [...GOV_AUDIT_RESOURCE_TYPES];\n return types.map((resourceType) => ({\n workspaceId: input.workspaceId,\n resourceType,\n limit: input.limit,\n ...(input.actorId ? { userId: input.actorId } : {}),\n ...(input.action ? { action: input.action } : {}),\n ...(input.from ? { startDate: `${input.from}T00:00:00.000Z` } : {}),\n ...(input.to ? { endDate: `${input.to}T23:59:59.999Z` } : {}),\n }));\n}\n\nexport interface AuditRow {\n id: string;\n userId: string;\n action: string;\n resourceType: string | null;\n resourceId: string | null;\n description: string | null;\n timestamp: string;\n}\n\n/** Merge the per-resource result sets newest-first and keep the first `limit`. */\nexport function mergeAuditRows(groups: AuditRow[][], limit: number): AuditRow[] {\n return groups\n .flat()\n .sort((a, b) => Date.parse(b.timestamp) - Date.parse(a.timestamp))\n .slice(0, limit);\n}\n\nconst csvCell = (value: string | null): string => {\n const text = value ?? '';\n // Prefix formula-leading characters so a spreadsheet never evaluates cell content.\n const safe = /^[=+\\-@\\t\\r]/.test(text) ? `'${text}` : text;\n return /[\",\\n\\r]/.test(safe) ? `\"${safe.replace(/\"/g, '\"\"')}\"` : safe;\n};\n\nexport function auditRowsToCsv(rows: AuditRow[]): string {\n const header = ['Time', 'Actor', 'Action', 'Resource', 'Resource id', 'Description'];\n const lines = rows.map((row) =>\n [\n row.timestamp,\n row.userId,\n row.action,\n row.resourceType ? resourceLabel(row.resourceType) : '',\n row.resourceId,\n row.description,\n ]\n .map(csvCell)\n .join(',')\n );\n return [header.join(','), ...lines].join('\\n');\n}\n"],"mappings":";AASA,IAAaA,IAA2B;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GAEaC,IAAoB;CAAC;CAAU;CAAU;CAAU;AAAM,GAEhEC,IAA0C;CAC9C,wBAAwB;CACxB,6BAA6B;CAC7B,2BAA2B;CAC3B,0BAA0B;CAC1B,2BAA2B;CAC3B,yBAAyB;CACzB,wBAAwB;CACxB,8BAA8B;CAC9B,yBAAyB;CACzB,4BAA4B;CAC5B,uBAAuB;CACvB,wBAAwB;CACxB,8BAA8B;CAC9B,yBAAyB;CACzB,0BAA0B;CAC1B,uBAAuB;CACvB,2BAA2B;CAC3B,8BAA8B;CAC9B,0BAA0B;CAC1B,yBAAyB;CACzB,0BAA0B;CAC1B,eAAe;AACjB,GAEMC,IAAuC;CAC3C,OAAO;CACP,QAAQ;CACR,QAAQ;AACV;AAGA,SAAgBC,EAAc,GAA8B;CAC1D,IAAMC,IAAQH,EAAgBI;CAC9B,IAAID,GAAO,OAAOA;CAClB,IAAME,IAAOD,EAAa,QAAQ,mBAAmB,EAAE,CAAC,CAAC,QAAQ,MAAM,GAAG;CAC1E,OAAOC,EAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAK,MAAM,CAAC;AACpD;AAEA,IAAaC,KAAc,MAA0BL,EAAaM,MAAUA;AAyB5E,SAAgBC,EAAkB,GAA8C;CAE9E,QADcC,EAAM,e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rator (or a platform super admin) manages access. */
3
+ export declare const ACCESS_ROLE_NAME = "GovCitizenHub Program Administrator";
4
+ export declare const AccessControlPage: FC;
@@ -0,0 +1,221 @@
1
+ import { PageLayout as e } from "../../components/PageLayout.js";
2
+ import { FilterTabs as t } from "../../components/FilterTabs.js";
3
+ import { EmptyState as n } from "../../components/EmptyState.js";
4
+ import { ErrorView as r, LoadingView as i } from "../../components/StateViews.js";
5
+ import { useGovAuditTrail as a, useGovRoles as o } from "../../hooks/useAccessControlApi.js";
6
+ import "../../hooks/index.js";
7
+ import { GOV_AUDIT_ACTIONS as s, GOV_AUDIT_RESOURCE_TYPES as c, auditRowsToCsv as l, levelLabel as u, resourceLabel as d } from "../../lib/access-control.js";
8
+ import { useTr as f } from "../../../shared/hooks/useTr.js";
9
+ import { useMemo as p, useState as m } from "react";
10
+ import { Download as h } from "lucide-react";
11
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
12
+ import { Button as y, GlassCard as b, Input as x } from "@burdenoff/fe-libs/ui";
13
+ import { useSafePermissions as S } from "@burdenoff/fe-libs/shared/providers/shell";
14
+ // src/govcitizenhub/pages/access-control/AccessControlPage.tsx
15
+ var C = 50, w = "GovCitizenHub Program Administrator", T = "rounded-button border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary", E = () => {
16
+ let e = f(), { data: t, isLoading: a, error: s, refetch: c } = o();
17
+ return a ? /* @__PURE__ */ _(i, {}) : s ? /* @__PURE__ */ _(r, {
18
+ message: s.message,
19
+ onRetry: () => void c()
20
+ }) : t?.length ? /* @__PURE__ */ _("div", {
21
+ className: "grid gap-4 md:grid-cols-2",
22
+ children: t.map((e) => /* @__PURE__ */ v(b, {
23
+ className: "p-4",
24
+ children: [
25
+ /* @__PURE__ */ _("h3", {
26
+ className: "text-base font-semibold text-text-primary",
27
+ children: e.name.replace(/^GovCitizenHub /, "")
28
+ }),
29
+ e.description && /* @__PURE__ */ _("p", {
30
+ className: "mt-1 text-sm text-text-secondary",
31
+ children: e.description
32
+ }),
33
+ /* @__PURE__ */ _("ul", {
34
+ className: "mt-3 space-y-1 text-sm",
35
+ children: e.defaultPermissions.map((e) => /* @__PURE__ */ v("li", {
36
+ className: "flex justify-between gap-2",
37
+ children: [/* @__PURE__ */ _("span", {
38
+ className: "text-text-primary",
39
+ children: d(e.resourceType)
40
+ }), /* @__PURE__ */ _("span", {
41
+ className: "text-text-secondary",
42
+ children: u(e.level)
43
+ })]
44
+ }, e.resourceType))
45
+ })
46
+ ]
47
+ }, e.id))
48
+ }) : /* @__PURE__ */ _(n, { title: e("govcitizenhub.access.noRoles", "No roles found") });
49
+ }, D = (e, t) => {
50
+ let n = URL.createObjectURL(new Blob([t], { type: "text/csv;charset=utf-8" })), r = document.createElement("a");
51
+ r.href = n, r.download = e, r.click(), URL.revokeObjectURL(n);
52
+ }, O = () => {
53
+ let e = f(), [t, o] = m(""), [u, b] = m(""), [S, w] = m(""), [E, O] = m(""), [k, A] = m(""), [j, M] = m(1), N = p(() => ({
54
+ actorId: t.trim() || void 0,
55
+ action: u || void 0,
56
+ resourceType: S || void 0,
57
+ from: E || void 0,
58
+ to: k || void 0,
59
+ limit: C * j
60
+ }), [
61
+ t,
62
+ u,
63
+ S,
64
+ E,
65
+ k,
66
+ j
67
+ ]), { data: P, isLoading: F, error: I, refetch: L } = a(N);
68
+ return /* @__PURE__ */ v("div", {
69
+ className: "space-y-4",
70
+ children: [/* @__PURE__ */ v("div", {
71
+ className: "flex flex-wrap items-end gap-3",
72
+ children: [
73
+ /* @__PURE__ */ _(x, {
74
+ "aria-label": e("govcitizenhub.access.actor", "Actor id"),
75
+ placeholder: e("govcitizenhub.access.actor", "Actor id"),
76
+ value: t,
77
+ onChange: (e) => {
78
+ o(e.target.value), M(1);
79
+ },
80
+ className: "w-56"
81
+ }),
82
+ /* @__PURE__ */ v("select", {
83
+ "aria-label": "Action",
84
+ className: T,
85
+ value: u,
86
+ onChange: (e) => {
87
+ b(e.target.value), M(1);
88
+ },
89
+ children: [/* @__PURE__ */ _("option", {
90
+ value: "",
91
+ children: e("govcitizenhub.access.anyAction", "Any action")
92
+ }), s.map((e) => /* @__PURE__ */ _("option", {
93
+ value: e,
94
+ children: e
95
+ }, e))]
96
+ }),
97
+ /* @__PURE__ */ v("select", {
98
+ "aria-label": "Resource",
99
+ className: T,
100
+ value: S,
101
+ onChange: (e) => {
102
+ w(e.target.value), M(1);
103
+ },
104
+ children: [/* @__PURE__ */ _("option", {
105
+ value: "",
106
+ children: e("govcitizenhub.access.anyResource", "Any resource")
107
+ }), c.map((e) => /* @__PURE__ */ _("option", {
108
+ value: e,
109
+ children: d(e)
110
+ }, e))]
111
+ }),
112
+ /* @__PURE__ */ _(x, {
113
+ type: "date",
114
+ "aria-label": "From",
115
+ value: E,
116
+ onChange: (e) => {
117
+ O(e.target.value), M(1);
118
+ },
119
+ className: "w-40"
120
+ }),
121
+ /* @__PURE__ */ _(x, {
122
+ type: "date",
123
+ "aria-label": "To",
124
+ value: k,
125
+ onChange: (e) => {
126
+ A(e.target.value), M(1);
127
+ },
128
+ className: "w-40"
129
+ }),
130
+ /* @__PURE__ */ v(y, {
131
+ variant: "outline",
132
+ disabled: !P?.length,
133
+ onClick: () => D("govcitizenhub-audit.csv", l(P ?? [])),
134
+ children: [/* @__PURE__ */ _(h, {
135
+ className: "mr-2 size-4",
136
+ "aria-hidden": "true"
137
+ }), e("govcitizenhub.access.export", "Export CSV")]
138
+ })
139
+ ]
140
+ }), F ? /* @__PURE__ */ _(i, {}) : I ? /* @__PURE__ */ _(r, {
141
+ message: I.message,
142
+ onRetry: () => void L()
143
+ }) : P?.length ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
144
+ className: "overflow-x-auto rounded-xl border border-border-seam",
145
+ children: /* @__PURE__ */ v("table", {
146
+ className: "w-full text-left text-sm",
147
+ children: [/* @__PURE__ */ _("thead", {
148
+ className: "bg-bg-surface text-text-secondary",
149
+ children: /* @__PURE__ */ _("tr", { children: [
150
+ "Time",
151
+ "Actor",
152
+ "Action",
153
+ "Resource",
154
+ "Details"
155
+ ].map((e) => /* @__PURE__ */ _("th", {
156
+ scope: "col",
157
+ className: "px-3 py-2 font-medium",
158
+ children: e
159
+ }, e)) })
160
+ }), /* @__PURE__ */ _("tbody", { children: P.map((e) => /* @__PURE__ */ v("tr", {
161
+ className: "border-t border-border-seam text-text-primary",
162
+ children: [
163
+ /* @__PURE__ */ _("td", {
164
+ className: "whitespace-nowrap px-3 py-2",
165
+ children: new Date(e.timestamp).toLocaleString()
166
+ }),
167
+ /* @__PURE__ */ _("td", {
168
+ className: "px-3 py-2 font-mono text-xs",
169
+ children: e.userId
170
+ }),
171
+ /* @__PURE__ */ _("td", {
172
+ className: "px-3 py-2",
173
+ children: e.action
174
+ }),
175
+ /* @__PURE__ */ _("td", {
176
+ className: "px-3 py-2",
177
+ children: e.resourceType ? d(e.resourceType) : "—"
178
+ }),
179
+ /* @__PURE__ */ _("td", {
180
+ className: "px-3 py-2 text-text-secondary",
181
+ children: e.description
182
+ })
183
+ ]
184
+ }, e.id)) })]
185
+ })
186
+ }), P.length >= C * j && /* @__PURE__ */ _(y, {
187
+ variant: "outline",
188
+ onClick: () => M((e) => e + 1),
189
+ children: e("govcitizenhub.access.loadMore", "Load more")
190
+ })] }) : /* @__PURE__ */ _(n, { title: e("govcitizenhub.access.noAudit", "No activity matches these filters") })]
191
+ });
192
+ }, k = () => {
193
+ let n = f(), [r, i] = m("roles"), a = S()?.hasAnyRole(["GovCitizenHub Program Administrator"]) ?? !1, o = [{
194
+ value: "roles",
195
+ label: n("govcitizenhub.access.roles", "Roles and permissions")
196
+ }, {
197
+ value: "audit",
198
+ label: n("govcitizenhub.access.audit", "Audit trail")
199
+ }];
200
+ return a ? /* @__PURE__ */ v(e, {
201
+ title: n("govcitizenhub.access.title", "Access control"),
202
+ description: n("govcitizenhub.access.description", "Who can do what in GovCitizenHub, and a record of what they did. Assign roles in the platform RBAC dashboard."),
203
+ children: [/* @__PURE__ */ _(t, {
204
+ options: o,
205
+ value: r,
206
+ onChange: i,
207
+ variant: "underline",
208
+ className: "mb-4"
209
+ }), _(r === "roles" ? E : O, {})]
210
+ }) : /* @__PURE__ */ _(e, {
211
+ title: n("govcitizenhub.access.title", "Access control"),
212
+ children: /* @__PURE__ */ _("div", {
213
+ role: "alert",
214
+ className: "rounded-xl border border-border-seam bg-bg-surface p-6 text-sm text-text-secondary",
215
+ children: n("govcitizenhub.access.denied", "Only a Program Administrator can manage access and review the audit trail.")
216
+ })
217
+ });
218
+ };
219
+ export { w as ACCESS_ROLE_NAME, k as AccessControlPage };
220
+
221
+ //# sourceMappingURL=AccessControlPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessControlPage.js","names":["_Fragment","Fragment$1","PAGE_SIZE","ACCESS_ROLE_NAME","selectClass","RolesTab","tr","useTr","useGovRoles","isLoading","LoadingView","error","ErrorView","refetch","data","GlassCard","role","resourceLabel","p","levelLabel","EmptyState","download","url","text","link","name","AuditTab","actorId","setActorId","useState","action","setAction","resourceType","setResourceType","from","setFrom","to","setTo","pages","setPages","filter","useMemo","useGovAuditTrail","Input","GOV_AUDIT_ACTIONS","a","GOV_AUDIT_RESOURCE_TYPES","r","Button","auditRowsToCsv","Download","h","row","AccessControlPage","tab","setTab","allowed","useSafePermissions","tabs","PageLayout","FilterTabs","jsx"],"sources":["../../../../src/govcitizenhub/pages/access-control/AccessControlPage.tsx"],"sourcesContent":["/**\n * AccessControlPage — GovCitizenHub roles and audit trail in one place (BOFF-4059, mock 17).\n *\n * Roles tab: the managed GovCitizenHub roles from the platform RBAC API, with\n * readable resource labels. Assigning people and editing roles stays in the\n * platform RBAC dashboard (single source of truth).\n * Audit tab: the platform Activity log scoped to GovCitizenHub resources.\n */\n\nimport { useMemo, useState, type FC } from 'react';\nimport { Download } from 'lucide-react';\nimport { Button, GlassCard, Input } from '@burdenoff/fe-libs/ui';\nimport { useSafePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport { PageLayout } from '../../components/PageLayout';\nimport { FilterTabs, type FilterOption } from '../../components/FilterTabs';\nimport { EmptyState } from '../../components/EmptyState';\nimport { ErrorView, LoadingView } from '../../components/StateViews';\nimport { useGovAuditTrail, useGovRoles } from '../../hooks';\nimport {\n GOV_AUDIT_ACTIONS,\n GOV_AUDIT_RESOURCE_TYPES,\n auditRowsToCsv,\n levelLabel,\n resourceLabel,\n} from '../../lib/access-control';\nimport { useTr } from '../../../shared/hooks/useTr';\n\ntype Tab = 'roles' | 'audit';\nconst PAGE_SIZE = 50;\n\n/** Only the Program Administrator (or a platform super admin) manages access. */\nexport const ACCESS_ROLE_NAME = 'GovCitizenHub Program Administrator';\n\nconst selectClass =\n 'rounded-button border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-primary';\n\nconst RolesTab: FC = () => {\n const tr = useTr();\n const { data, isLoading, error, refetch } = useGovRoles();\n if (isLoading) return <LoadingView />;\n if (error) return <ErrorView message={error.message} onRetry={() => void refetch()} />;\n if (!data?.length)\n return <EmptyState title={tr('govcitizenhub.access.noRoles', 'No roles found')} />;\n return (\n <div className=\"grid gap-4 md:grid-cols-2\">\n {data.map((role) => (\n <GlassCard key={role.id} className=\"p-4\">\n <h3 className=\"text-base font-semibold text-text-primary\">\n {role.name.replace(/^GovCitizenHub /, '')}\n </h3>\n {role.description && (\n <p className=\"mt-1 text-sm text-text-secondary\">{role.description}</p>\n )}\n <ul className=\"mt-3 space-y-1 text-sm\">\n {role.defaultPermissions.map((p) => (\n <li key={p.resourceType} className=\"flex justify-between gap-2\">\n <span className=\"text-text-primary\">{resourceLabel(p.resourceType)}</span>\n <span className=\"text-text-secondary\">{levelLabel(p.level)}</span>\n </li>\n ))}\n </ul>\n </GlassCard>\n ))}\n </div>\n );\n};\n\nconst download = (name: string, text: string): void => {\n const url = URL.createObjectURL(new Blob([text], { type: 'text/csv;charset=utf-8' }));\n const link = document.createElement('a');\n link.href = url;\n link.download = name;\n link.click();\n URL.revokeObjectURL(url);\n};\n\nconst AuditTab: FC = () => {\n const tr = useTr();\n const [actorId, setActorId] = useState('');\n const [action, setAction] = useState('');\n const [resourceType, setResourceType] = useState('');\n const [from, setFrom] = useState('');\n const [to, setTo] = useState('');\n const [pages, setPages] = useState(1);\n\n const filter = useMemo(\n () => ({\n actorId: actorId.trim() || undefined,\n action: action || undefined,\n resourceType: resourceType || undefined,\n from: from || undefined,\n to: to || undefined,\n limit: PAGE_SIZE * pages,\n }),\n [actorId, action, resourceType, from, to, pages]\n );\n const { data, isLoading, error, refetch } = useGovAuditTrail(filter);\n return (\n <div className=\"space-y-4\">\n <div className=\"flex flex-wrap items-end gap-3\">\n <Input\n aria-label={tr('govcitizenhub.access.actor', 'Actor id')}\n placeholder={tr('govcitizenhub.access.actor', 'Actor id')}\n value={actorId}\n onChange={(e) => {\n setActorId(e.target.value);\n setPages(1);\n }}\n className=\"w-56\"\n />\n <select\n aria-label=\"Action\"\n className={selectClass}\n value={action}\n onChange={(e) => {\n setAction(e.target.value);\n setPages(1);\n }}\n >\n <option value=\"\">{tr('govcitizenhub.access.anyAction', 'Any action')}</option>\n {GOV_AUDIT_ACTIONS.map((a) => (\n <option key={a} value={a}>\n {a}\n </option>\n ))}\n </select>\n <select\n aria-label=\"Resource\"\n className={selectClass}\n value={resourceType}\n onChange={(e) => {\n setResourceType(e.target.value);\n setPages(1);\n }}\n >\n <option value=\"\">{tr('govcitizenhub.access.anyResource', 'Any resource')}</option>\n {GOV_AUDIT_RESOURCE_TYPES.map((r) => (\n <option key={r} value={r}>\n {resourceLabel(r)}\n </option>\n ))}\n </select>\n <Input\n type=\"date\"\n aria-label=\"From\"\n value={from}\n onChange={(e) => {\n setFrom(e.target.value);\n setPages(1);\n }}\n className=\"w-40\"\n />\n <Input\n type=\"date\"\n aria-label=\"To\"\n value={to}\n onChange={(e) => {\n setTo(e.target.value);\n setPages(1);\n }}\n className=\"w-40\"\n />\n <Button\n variant=\"outline\"\n disabled={!data?.length}\n onClick={() => download('govcitizenhub-audit.csv', auditRowsToCsv(data ?? []))}\n >\n <Download className=\"mr-2 size-4\" aria-hidden=\"true\" />\n {tr('govcitizenhub.access.export', 'Export CSV')}\n </Button>\n </div>\n\n {isLoading ? (\n <LoadingView />\n ) : error ? (\n <ErrorView message={error.message} onRetry={() => void refetch()} />\n ) : !data?.length ? (\n <EmptyState\n title={tr('govcitizenhub.access.noAudit', 'No activity matches these filters')}\n />\n ) : (\n <>\n <div className=\"overflow-x-auto rounded-xl border border-border-seam\">\n <table className=\"w-full text-left text-sm\">\n <thead className=\"bg-bg-surface text-text-secondary\">\n <tr>\n {['Time', 'Actor', 'Action', 'Resource', 'Details'].map((h) => (\n <th key={h} scope=\"col\" className=\"px-3 py-2 font-medium\">\n {h}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {data.map((row) => (\n <tr key={row.id} className=\"border-t border-border-seam text-text-primary\">\n <td className=\"whitespace-nowrap px-3 py-2\">\n {new Date(row.timestamp).toLocaleString()}\n </td>\n <td className=\"px-3 py-2 font-mono text-xs\">{row.userId}</td>\n <td className=\"px-3 py-2\">{row.action}</td>\n <td className=\"px-3 py-2\">\n {row.resourceType ? resourceLabel(row.resourceType) : '—'}\n </td>\n <td className=\"px-3 py-2 text-text-secondary\">{row.description}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n {data.length >= PAGE_SIZE * pages && (\n <Button variant=\"outline\" onClick={() => setPages((p) => p + 1)}>\n {tr('govcitizenhub.access.loadMore', 'Load more')}\n </Button>\n )}\n </>\n )}\n </div>\n );\n};\n\nexport const AccessControlPage: FC = () => {\n const tr = useTr();\n const [tab, setTab] = useState<Tab>('roles');\n const perms = useSafePermissions();\n const allowed = perms?.hasAnyRole([ACCESS_ROLE_NAME]) ?? false;\n const tabs: FilterOption<Tab>[] = [\n { value: 'roles', label: tr('govcitizenhub.access.roles', 'Roles and permissions') },\n { value: 'audit', label: tr('govcitizenhub.access.audit', 'Audit trail') },\n ];\n\n if (!allowed) {\n return (\n <PageLayout title={tr('govcitizenhub.access.title', 'Access control')}>\n <div\n role=\"alert\"\n className=\"rounded-xl border border-border-seam bg-bg-surface p-6 text-sm text-text-secondary\"\n >\n {tr(\n 'govcitizenhub.access.denied',\n 'Only a Program Administrator can manage access and review the audit trail.'\n )}\n </div>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title={tr('govcitizenhub.access.title', 'Access control')}\n description={tr(\n 'govcitizenhub.access.description',\n 'Who can do what in GovCitizenHub, and a record of what they did. Assign roles in the platform RBAC dashboard.'\n )}\n >\n <FilterTabs\n options={tabs}\n value={tab}\n onChange={setTab}\n variant=\"underline\"\n className=\"mb-4\"\n />\n {tab === 'roles' ? <RolesTab /> : <AuditTab />}\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AA6BA,IAAME,IAAY,IAGLC,IAAmB,uCAE1BC,IACJ,8FAEIC,UAAqB;CACzB,IAAMC,IAAKC,EAAM,GACX,EAAE,SAAM,cAAW,UAAO,eAAYC,EAAY;CAKxD,OAJIC,IAAkB,kBAACC,GAAD,CAAc,CAAA,IAChCC,IAAc,kBAACC,GAAD;EAAW,SAASD,EAAM;EAAS,eAAe,KAAKE,EAAQ;CAAI,CAAA,IAChFC,GAAM,SAGT,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAAA,EAAK,KAAK,MACT,kBAACC,GAAD;GAAyB,WAAU;GAAnC,UAAA;IACE,kBAAC,MAAD;KAAI,WAAU;KACX,UAAAC,EAAK,KAAK,QAAQ,mBAAmB,EAAE;IACtC,CAAA;IACHA,EAAK,eACJ,kBAAC,KAAD;KAAG,WAAU;KAAoC,UAAAA,EAAK;IAAe,CAAA;IAEvE,kBAAC,MAAD;KAAI,WAAU;KACX,UAAAA,EAAK,mBAAmB,KAAK,MAC5B,kBAAC,MAAD;MAAyB,WAAU;MAAnC,UAAA,CACE,kBAAC,QAAD;OAAM,WAAU;OAAqB,UAAAC,EAAcC,EAAE,YAAY;MAAQ,CAAA,GACzE,kBAAC,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iC,WAAW;EAC1C,CAAA,CAEV,EAAA,CAAA,IAtCF,kBAACc,GAAD,EACE,OAAOd,EAAG,gCAAgC,mCAAmC,EAC9E,CAAA,CAsCA;;AAET,GAEa+C,UAA8B;CACzC,IAAM/C,IAAKC,EAAM,GACX,CAAC+C,GAAKC,KAAU1B,EAAc,OAAO,GAErC2B,IADQC,EACE,CAAA,EAAO,WAAW,CAAA,qCAAiB,CAAC,KAAK,IACnDC,IAA4B,CAChC;EAAE,OAAO;EAAS,OAAOpD,EAAG,8BAA8B,uBAAuB;CAAE,GACnF;EAAE,OAAO;EAAS,OAAOA,EAAG,8BAA8B,aAAa;CAAE,CAC3E;CAkBA,OAhBKkD,IAiBH,kBAACG,GAAD;EACE,OAAOrD,EAAG,8BAA8B,gBAAgB;EACxD,aAAaA,EACX,oCACA,+GACF;EALF,UAAA,CAOE,kBAACsD,GAAD;GACE,SAASF;GACT,OAAOJ;GACP,UAAUC;GACV,SAAQ;GACR,WAAU;EACX,CAAA,GACkBM,EAAlBP,MAAQ,UAAWjD,IAAeqB,GAAhB,CAAW,CAAe,CACnC;C,KA9BV,kBAACiC,GAAD;EAAY,OAAOrD,EAAG,8BAA8B,gBAAgB;EAClE,UAAA,kBAAC,OAAD;GACE,MAAK;GACL,WAAU;GAET,UAAAA,EACC,+BACA,4EACF;EACG,CAAA;CACK,CAAA;AAsBlB"}
@@ -17,7 +17,7 @@ export declare const useSurface: () => GovSurface;
17
17
  * civic-record roles — is a citizen. Kept in step with the app shell's
18
18
  * `govAccount.ts`.
19
19
  */
20
- export declare const OFFICER_ROLE_NAMES: readonly ["GovCitizenHub Program Administrator", "GovCitizenHub Operations Lead", "GovCitizenHub Service Owner", "GovCitizenHub Case Officer", "GovCitizenHub Citizen Services Desk", "GovCitizenHub Catalog Viewer"];
20
+ export declare const OFFICER_ROLE_NAMES: readonly ["GovCitizenHub Program Administrator", "GovCitizenHub Operations Lead", "GovCitizenHub Service Owner", "GovCitizenHub Case Officer", "GovCitizenHub Verifier", "GovCitizenHub Citizen Services Desk", "GovCitizenHub Catalog Viewer"];
21
21
  export interface OfficerAccess {
22
22
  isLoading: boolean;
23
23
  /** True when the caller holds an officer role (or is a platform super admin). */
@@ -5,6 +5,7 @@ var n = e("citizen"), r = n.Provider, i = () => t(n), a = [
5
5
  "GovCitizenHub Operations Lead",
6
6
  "GovCitizenHub Service Owner",
7
7
  "GovCitizenHub Case Officer",
8
+ "GovCitizenHub Verifier",
8
9
  "GovCitizenHub Citizen Services Desk",
9
10
  "GovCitizenHub Catalog Viewer"
10
11
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"SurfaceContext.js","names":["SurfaceContext","createContext","SurfaceProvider","useSurface","useContext","OFFICER_ROLE_NAMES","deriveOfficerAccess","perms","canOfficer"],"sources":["../../../src/govcitizenhub/surface/SurfaceContext.tsx"],"sourcesContent":["/**\n * Surface (citizen portal vs officer console) — BOFF-4093.\n *\n * The surface is a navigation context, never an authorization decision: it is\n * carried in the URL (`officer/*`), and every officer capability is still\n * enforced by the gateway `@rbac` layer. `useOfficerAccess` only decides whether\n * the console is worth offering, from the caller's effective permissions.\n */\n\nimport { createContext, useContext } from 'react';\n\nexport type GovSurface = 'citizen' | 'officer';\n\nconst SurfaceContext = createContext<GovSurface>('citizen');\n\nexport const SurfaceProvider = SurfaceContext.Provider;\n\n/** Which surface the current page is rendered in. Defaults to the citizen portal. */\nexport const useSurface = (): GovSurface => useContext(SurfaceContext);\n\n/**\n * Officer roles of the managed GovCitizenHub catalog (wspace-rbac-svc,\n * role-catalog/products/govcitizenhub.ts). The RBAC API exposes role NAMES to\n * members. Everyone else — including a brand-new signup and, for now, the\n * civic-record roles — is a citizen. Kept in step with the app shell's\n * `govAccount.ts`.\n */\nexport const OFFICER_ROLE_NAMES = [\n 'GovCitizenHub Program Administrator',\n 'GovCitizenHub Operations Lead',\n 'GovCitizenHub Service Owner',\n 'GovCitizenHub Case Officer',\n 'GovCitizenHub Citizen Services Desk',\n 'GovCitizenHub Catalog Viewer',\n] as const;\n\nexport interface OfficerAccess {\n isLoading: boolean;\n /** True when the caller holds an officer role (or is a platform super admin). */\n canOfficer: boolean;\n /** The permission query failed: the account type is unknown, so show neither surface. */\n hasError: boolean;\n}\n\ninterface RoleSource {\n isLoading: boolean;\n error?: Error | null;\n hasAnyRole: (roleNames: string[]) => boolean;\n}\n\n/** Pure rule behind {@link useOfficerAccess}; `null` = no PermissionProvider mounted. */\nexport function deriveOfficerAccess(perms: RoleSource | null): OfficerAccess {\n // No PermissionProvider (standalone/dev mount) means no roles: a citizen,\n // matching the app shell. Never officer — the officer console fails closed.\n if (!perms) return { isLoading: false, canOfficer: false, hasError: false };\n const canOfficer = perms.hasAnyRole([...OFFICER_ROLE_NAMES]);\n return {\n isLoading: perms.isLoading,\n canOfficer,\n // A failed query yields an empty role list; do not misread that as \"citizen\".\n hasError: !canOfficer && !!perms.error,\n };\n}\n"],"mappings":";;AAaA,IAAMA,IAAiBC,EAA0B,SAAS,GAE7CC,IAAkBF,EAAe,UAGjCG,UAA+BC,EAAWJ,CAAc,GASxDK,IAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;AACF;AAiBA,SAAgBC,EAAoB,GAAyC;CAG3E,IAAI,CAACC,GAAO,OAAO;EAAE,WAAW;EAAO,YAAY;EAAO,UAAU;CAAM;CAC1E,IAAMC,IAAaD,EAAM,WAAW,CAAC,GAAGF,CAAkB,CAAC;CAC3D,OAAO;EACL,WAAWE,EAAM;EACjB;EAEA,UAAU,CAACC,KAAc,CAAC,CAACD,EAAM;CACnC;AACF"}
1
+ {"version":3,"file":"SurfaceContext.js","names":["SurfaceContext","createContext","SurfaceProvider","useSurface","useContext","OFFICER_ROLE_NAMES","deriveOfficerAccess","perms","canOfficer"],"sources":["../../../src/govcitizenhub/surface/SurfaceContext.tsx"],"sourcesContent":["/**\n * Surface (citizen portal vs officer console) — BOFF-4093.\n *\n * The surface is a navigation context, never an authorization decision: it is\n * carried in the URL (`officer/*`), and every officer capability is still\n * enforced by the gateway `@rbac` layer. `useOfficerAccess` only decides whether\n * the console is worth offering, from the caller's effective permissions.\n */\n\nimport { createContext, useContext } from 'react';\n\nexport type GovSurface = 'citizen' | 'officer';\n\nconst SurfaceContext = createContext<GovSurface>('citizen');\n\nexport const SurfaceProvider = SurfaceContext.Provider;\n\n/** Which surface the current page is rendered in. Defaults to the citizen portal. */\nexport const useSurface = (): GovSurface => useContext(SurfaceContext);\n\n/**\n * Officer roles of the managed GovCitizenHub catalog (wspace-rbac-svc,\n * role-catalog/products/govcitizenhub.ts). The RBAC API exposes role NAMES to\n * members. Everyone else — including a brand-new signup and, for now, the\n * civic-record roles — is a citizen. Kept in step with the app shell's\n * `govAccount.ts`.\n */\nexport const OFFICER_ROLE_NAMES = [\n 'GovCitizenHub Program Administrator',\n 'GovCitizenHub Operations Lead',\n 'GovCitizenHub Service Owner',\n 'GovCitizenHub Case Officer',\n 'GovCitizenHub Verifier',\n 'GovCitizenHub Citizen Services Desk',\n 'GovCitizenHub Catalog Viewer',\n] as const;\n\nexport interface OfficerAccess {\n isLoading: boolean;\n /** True when the caller holds an officer role (or is a platform super admin). */\n canOfficer: boolean;\n /** The permission query failed: the account type is unknown, so show neither surface. */\n hasError: boolean;\n}\n\ninterface RoleSource {\n isLoading: boolean;\n error?: Error | null;\n hasAnyRole: (roleNames: string[]) => boolean;\n}\n\n/** Pure rule behind {@link useOfficerAccess}; `null` = no PermissionProvider mounted. */\nexport function deriveOfficerAccess(perms: RoleSource | null): OfficerAccess {\n // No PermissionProvider (standalone/dev mount) means no roles: a citizen,\n // matching the app shell. Never officer — the officer console fails closed.\n if (!perms) return { isLoading: false, canOfficer: false, hasError: false };\n const canOfficer = perms.hasAnyRole([...OFFICER_ROLE_NAMES]);\n return {\n isLoading: perms.isLoading,\n canOfficer,\n // A failed query yields an empty role list; do not misread that as \"citizen\".\n hasError: !canOfficer && !!perms.error,\n };\n}\n"],"mappings":";;AAaA,IAAMA,IAAiBC,EAA0B,SAAS,GAE7CC,IAAkBF,EAAe,UAGjCG,UAA+BC,EAAWJ,CAAc,GASxDK,IAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAiBA,SAAgBC,EAAoB,GAAyC;CAG3E,IAAI,CAACC,GAAO,OAAO;EAAE,WAAW;EAAO,YAAY;EAAO,UAAU;CAAM;CAC1E,IAAMC,IAAaD,EAAM,WAAW,CAAC,GAAGF,CAAkB,CAAC;CAC3D,OAAO;EACL,WAAWE,EAAM;EACjB;EAEA,UAAU,CAACC,KAAc,CAAC,CAACD,EAAM;CACnC;AACF"}
@@ -17,6 +17,7 @@ var n = [
17
17
  ["permits", "GOVCITIZENHUB_PERMIT"],
18
18
  ["grievances", "GOVCITIZENHUB_GRIEVANCE"],
19
19
  ["queue", "GOVCITIZENHUB_APPLICATION"],
20
+ ["access-control", "GOVCITIZENHUB_ACCESS_CONTROL"],
20
21
  ["intelligence", "GOVCITIZENHUB_JURISDICTION"]
21
22
  ], i = [
22
23
  ["", "GOVCITIZENHUB_JURISDICTION"],
@@ -1 +1 @@
1
- {"version":3,"file":"pageContext.js","names":["UUID_SEGMENT","detailPattern","collection","DETAIL_ROUTES","LIST_ROUTES","JURISDICTION_TAB_ROUTES","JURISDICTION_PATTERN","ACTION_ROUTES","gatherPageContext","url","currentPage","entity","resolveGovCitizenHubConversationContext","matchPath","pathname","pattern","normalizePath","OFFICER_PREFIX","params","search","normalized","isOfficer","context","resolveWithinProduct","suffix","entityType","path","jurisdictionMatch","tabSegment","tab","segment","match","activeTab"],"sources":["../../src/utils/pageContext.ts"],"sourcesContent":["/**\n * Page context gathering for the GovCitizenHub assistant transport.\n *\n * Captures the user's current browser context to be sent alongside every\n * assistant prompt so the api-calls agent can reason about the active screen.\n *\n * BOFF-3734 hardening:\n * - Detail-route patterns are anchored to a UUID id shape. Previously they\n * used `([^/]+)`, so `/govcitizenhub/permits/verify` reported entityType\n * `GOVCITIZENHUB_PERMIT` with entityId `\"verify\"` and\n * `/govcitizenhub/applications/new` reported entityId `\"new\"` — the agent\n * then tried to resolve those literals as entity ids.\n * - Detail patterns for routes that do not exist (agencies/:id, documents/:id,\n * payments/:id, permits/:id) have been removed; see ROUTE_DECISIONS below.\n * - List and dashboard routes now contribute an entityType (with no entityId)\n * so the agent knows which collection is on screen.\n * - `userAgent` and `timestamp` are no longer forwarded: the agent's\n * ALLOWED_CONTEXT_KEYS drops them, and forwarding a browser fingerprint on\n * a product that handles citizen PII is unnecessary exposure.\n *\n * PII rule for this file: nothing derived from application form data, uploaded\n * document contents/filenames, grievance descriptions or citizen identity may\n * ever enter the returned payload. Only the route shape, resource ids that are\n * already in the URL, and the coarse `tab` query parameter are captured.\n */\n\nimport type { PageContext } from '#src/types/assistant';\n\ninterface ConversationContextShape {\n entityType?: string;\n entityId?: string;\n activeTab?: string;\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Backend ids are Prisma `@default(uuid())` (see\n * `wspace-govcitizenhub-svc/prisma/schema/*.prisma`), so a detail route only\n * matches when the trailing segment is a real UUID. This is what keeps the\n * reserved literals `new` and `verify` from being read as entity ids.\n */\nconst UUID_SEGMENT = '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';\n\nfunction detailPattern(collection: string): RegExp {\n return new RegExp(`^/govcitizenhub/${collection}/(${UUID_SEGMENT})$`);\n}\n\n/**\n * Detail routes that actually exist in `GovCitizenHubRoutes.tsx`.\n * Keep in lockstep with the `path=\"<collection>/:id\"` routes declared there —\n * `pageContext.test.ts` fails the build if they drift.\n */\nconst DETAIL_ROUTES: ReadonlyArray<readonly [string, string]> = [\n ['services', 'GOVCITIZENHUB_SERVICE'],\n ['applications', 'GOVCITIZENHUB_APPLICATION'],\n ['grievances', 'GOVCITIZENHUB_GRIEVANCE'],\n];\n\n/**\n * List routes that exist but have no detail route. They contribute an\n * entityType so the agent knows which collection is on screen, and never an\n * entityId.\n *\n * ROUTE_DECISIONS — the previous table also carried detail patterns for\n * `agencies/:id`, `documents/:id`, `payments/:id` and `permits/:id`. No such\n * routes are declared, so those four regexes could never fire. They were\n * removed rather than left as dead code; if a detail route is added later,\n * move the collection into DETAIL_ROUTES and the route-parity test will pass\n * again.\n */\nconst LIST_ROUTES: ReadonlyArray<readonly [string, string]> = [\n ['services', 'GOVCITIZENHUB_SERVICE'],\n ['applications', 'GOVCITIZENHUB_APPLICATION'],\n ['agencies', 'GOVCITIZENHUB_AGENCY'],\n ['documents', 'GOVCITIZENHUB_DOCUMENT'],\n // Citizen document wallet (BOFF-5796) — reusable citizen-owned documents.\n ['wallet', 'GOVCITIZENHUB_WALLET_DOCUMENT'],\n ['payments', 'GOVCITIZENHUB_PAYMENT'],\n ['permits', 'GOVCITIZENHUB_PERMIT'],\n ['grievances', 'GOVCITIZENHUB_GRIEVANCE'],\n // Officer \"My queue\" (BOFF-4093): the applications list opened on the caller's\n // own assignments, at `officer/queue`.\n ['queue', 'GOVCITIZENHUB_APPLICATION'],\n // Community Intelligence (BOFF-5666) — the jurisdiction directory.\n ['intelligence', 'GOVCITIZENHUB_JURISDICTION'],\n];\n\n/**\n * Community Intelligence jurisdiction profile tabs. Every one of these routes\n * is `/govcitizenhub/intelligence/<jurisdiction uuid>[/<tab>]`, so they all\n * carry the same entityId (the jurisdiction) and differ only in which surface\n * is on screen — reported both as a distinct entityType and as `activeTab`.\n *\n * The empty tab segment is the profile root; it shares the directory's\n * `GOVCITIZENHUB_JURISDICTION` type exactly as the other list/detail pairs do.\n */\nconst JURISDICTION_TAB_ROUTES: ReadonlyArray<readonly [string, string]> = [\n ['', 'GOVCITIZENHUB_JURISDICTION'],\n ['governance', 'GOVCITIZENHUB_JURISDICTION_GOVERNANCE'],\n ['budget', 'GOVCITIZENHUB_JURISDICTION_BUDGET'],\n ['projects', 'GOVCITIZENHUB_JURISDICTION_PROJECTS'],\n ['indicators', 'GOVCITIZENHUB_JURISDICTION_INDICATORS'],\n ['benchmark', 'GOVCITIZENHUB_JURISDICTION_BENCHMARK'],\n ['services', 'GOVCITIZENHUB_JURISDICTION_SERVICE_PERFORMANCE'],\n ['assets', 'GOVCITIZENHUB_JURISDICTION_ASSETS'],\n ['elections', 'GOVCITIZENHUB_JURISDICTION_ELECTIONS'],\n ['consultations', 'GOVCITIZENHUB_JURISDICTION_CONSULTATIONS'],\n ['open-data', 'GOVCITIZENHUB_JURISDICTION_OPEN_DATA'],\n ['timeline', 'GOVCITIZENHUB_JURISDICTION_TIMELINE'],\n ['corrections', 'GOVCITIZENHUB_JURISDICTION_CORRECTIONS'],\n];\n\n/**\n * Anchored to the UUID id shape for the same reason as `detailPattern`: the\n * admin catalog routes (`intelligence/admin/levels`, `.../indicators`) sit at\n * the same depth as a jurisdiction profile tab, and \"admin\" must never be\n * reported as a jurisdiction id.\n */\nconst JURISDICTION_PATTERN = new RegExp(\n `^/govcitizenhub/intelligence/(${UUID_SEGMENT})(?:/([a-z-]+))?$`\n);\n\n/**\n * Routes under a collection that are actions rather than entities. They must\n * never yield an entityId, and they get their own entityType so the agent can\n * tell \"composing a new application\" from \"browsing applications\".\n */\nconst ACTION_ROUTES: ReadonlyArray<readonly [string, string]> = [\n ['applications/new', 'GOVCITIZENHUB_APPLICATION_DRAFT'],\n ['permits/verify', 'GOVCITIZENHUB_PERMIT_VERIFICATION'],\n // Citizen mobile surface (BOFF-4088) — same four destinations as the\n // BottomTabNav. `m/scan` renders the identical VerifyPermitPage as\n // `permits/verify` above, so it reports the same entityType.\n ['m', 'GOVCITIZENHUB_MOBILE_HOME'],\n ['m/requests', 'GOVCITIZENHUB_MOBILE_REQUESTS'],\n ['m/scan', 'GOVCITIZENHUB_PERMIT_VERIFICATION'],\n ['m/profile', 'GOVCITIZENHUB_MOBILE_PROFILE'],\n // Community Intelligence admin catalogs — workspace-wide reference data, not\n // a jurisdiction, so they carry no entityId.\n ['intelligence/admin/levels', 'GOVCITIZENHUB_ADMIN_LEVEL'],\n ['intelligence/admin/indicators', 'GOVCITIZENHUB_INDICATOR'],\n];\n\nexport function gatherPageContext(): PageContext {\n const url = window.location.href;\n const pathSegments = window.location.pathname.split('/').filter(Boolean);\n const currentPage = pathSegments.slice(0, 3).join('/') || 'home';\n const entity = resolveGovCitizenHubConversationContext(\n window.location.pathname,\n window.location.search\n );\n\n return {\n currentUrl: url,\n currentPage,\n entityType: entity.entityType,\n entityId: entity.entityId,\n activeTab: entity.activeTab,\n platform: 'govcitizenhub',\n version: import.meta.env.VITE_APP_VERSION ?? '2026.709.1',\n viewportSize: `${window.innerWidth}x${window.innerHeight}`,\n };\n}\n\nfunction matchPath(pattern: RegExp, pathname: string): RegExpMatchArray | null {\n return pathname.match(pattern);\n}\n\nfunction normalizePath(pathname: string): string {\n return pathname.length > 1 && pathname.endsWith('/') ? pathname.slice(0, -1) : pathname;\n}\n\n/**\n * Officer console routes (BOFF-4093) live under `/govcitizenhub/officer/...` and\n * render the same screens as their citizen-portal counterparts, so the surface\n * prefix is stripped and the remainder resolves exactly as before. The surface is\n * reported separately so the agent can tell an officer's casework view from a\n * citizen's view of the same record.\n */\nconst OFFICER_PREFIX = /^\\/govcitizenhub\\/officer(?=\\/|$)/;\n\nexport function resolveGovCitizenHubConversationContext(\n pathname: string,\n search: string\n): ConversationContextShape {\n const params = new URLSearchParams(search);\n const normalized = normalizePath(pathname);\n const isOfficer = OFFICER_PREFIX.test(normalized);\n const path = isOfficer ? normalized.replace(OFFICER_PREFIX, '/govcitizenhub') : normalized;\n const context = resolveWithinProduct(path, params);\n return isOfficer\n ? { ...context, metadata: { ...context.metadata, surface: 'officer' } }\n : context;\n}\n\nfunction resolveWithinProduct(path: string, params: URLSearchParams): ConversationContextShape {\n // Action routes are matched before detail routes so a reserved literal can\n // never be mistaken for an id even if the id shape were relaxed later.\n for (const [suffix, entityType] of ACTION_ROUTES) {\n if (path === `/govcitizenhub/${suffix}`) {\n return { entityType, metadata: { route: suffix } };\n }\n }\n\n // Jurisdiction profile tabs are matched before the generic detail routes so\n // the tab segment is read as a surface, never as a nested entity id.\n const jurisdictionMatch = matchPath(JURISDICTION_PATTERN, path);\n if (jurisdictionMatch) {\n const tabSegment = jurisdictionMatch[2] ?? '';\n const tab = JURISDICTION_TAB_ROUTES.find(([segment]) => segment === tabSegment);\n if (tab) {\n return {\n entityType: tab[1],\n entityId: jurisdictionMatch[1],\n activeTab: tabSegment || undefined,\n metadata: { collection: 'intelligence' },\n };\n }\n }\n\n for (const [collection, entityType] of DETAIL_ROUTES) {\n const match = matchPath(detailPattern(collection), path);\n if (match) {\n return {\n entityType,\n entityId: match[1],\n metadata: { collection },\n };\n }\n }\n\n for (const [collection, entityType] of LIST_ROUTES) {\n if (path === `/govcitizenhub/${collection}`) {\n return {\n entityType,\n activeTab: params.get('tab') ?? undefined,\n metadata: { collection, view: 'list' },\n };\n }\n }\n\n if (path === '/govcitizenhub' || path === '/govcitizenhub/') {\n return {\n entityType: 'GOVCITIZENHUB_DASHBOARD',\n metadata: { view: 'dashboard' },\n };\n }\n\n const activeTab = params.get('tab') ?? undefined;\n return {\n activeTab,\n metadata: activeTab ? { activeTab } : {},\n };\n}\n\n/** Exported for the route-parity test in `pageContext.test.ts`. */\nexport const __routeTables = {\n DETAIL_ROUTES,\n LIST_ROUTES,\n ACTION_ROUTES,\n JURISDICTION_TAB_ROUTES,\n};\n"],"mappings":";AAyCA,IAAMA,IAAe;AAErB,SAASC,EAAc,GAA4B;CACjD,OAAW,OAAO,mBAAmBC,EAAW,IAAIF,EAAa,GAAG;AACtE;AAOA,IAAMG,IAA0D;CAC9D,CAAC,YAAY,uBAAuB;CACpC,CAAC,gBAAgB,2BAA2B;CAC5C,CAAC,cAAc,yBAAyB;AAC1C,GAcMC,IAAwD;CAC5D,CAAC,YAAY,uBAAuB;CACpC,CAAC,gBAAgB,2BAA2B;CAC5C,CAAC,YAAY,sBAAsB;CACnC,CAAC,aAAa,wBAAwB;CAEtC,CAAC,UAAU,+BAA+B;CAC1C,CAAC,YAAY,uBAAuB;CACpC,CAAC,WAAW,sBAAsB;C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EAChC,UAAU;GAAE;GAAY,MAAM;EAAO;CACvC;CAIJ,IAAIQ,MAAS,oBAAoBA,MAAS,mBACxC,OAAO;EACL,YAAY;EACZ,UAAU,EAAE,MAAM,YAAY;CAChC;CAGF,IAAMM,IAAYd,EAAO,IAAI,KAAK,KAAK,KAAA;CACvC,OAAO;EACL;EACA,UAAUc,IAAY,EAAE,aAAU,IAAI,CAAC;CACzC;AACF"}
1
+ {"version":3,"file":"pageContext.js","names":["UUID_SEGMENT","detailPattern","collection","DETAIL_ROUTES","LIST_ROUTES","JURISDICTION_TAB_ROUTES","JURISDICTION_PATTERN","ACTION_ROUTES","gatherPageContext","url","currentPage","entity","resolveGovCitizenHubConversationContext","matchPath","pathname","pattern","normalizePath","OFFICER_PREFIX","params","search","normalized","isOfficer","context","resolveWithinProduct","suffix","entityType","path","jurisdictionMatch","tabSegment","tab","segment","match","activeTab"],"sources":["../../src/utils/pageContext.ts"],"sourcesContent":["/**\n * Page context gathering for the GovCitizenHub assistant transport.\n *\n * Captures the user's current browser context to be sent alongside every\n * assistant prompt so the api-calls agent can reason about the active screen.\n *\n * BOFF-3734 hardening:\n * - Detail-route patterns are anchored to a UUID id shape. Previously they\n * used `([^/]+)`, so `/govcitizenhub/permits/verify` reported entityType\n * `GOVCITIZENHUB_PERMIT` with entityId `\"verify\"` and\n * `/govcitizenhub/applications/new` reported entityId `\"new\"` — the agent\n * then tried to resolve those literals as entity ids.\n * - Detail patterns for routes that do not exist (agencies/:id, documents/:id,\n * payments/:id, permits/:id) have been removed; see ROUTE_DECISIONS below.\n * - List and dashboard routes now contribute an entityType (with no entityId)\n * so the agent knows which collection is on screen.\n * - `userAgent` and `timestamp` are no longer forwarded: the agent's\n * ALLOWED_CONTEXT_KEYS drops them, and forwarding a browser fingerprint on\n * a product that handles citizen PII is unnecessary exposure.\n *\n * PII rule for this file: nothing derived from application form data, uploaded\n * document contents/filenames, grievance descriptions or citizen identity may\n * ever enter the returned payload. Only the route shape, resource ids that are\n * already in the URL, and the coarse `tab` query parameter are captured.\n */\n\nimport type { PageContext } from '#src/types/assistant';\n\ninterface ConversationContextShape {\n entityType?: string;\n entityId?: string;\n activeTab?: string;\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Backend ids are Prisma `@default(uuid())` (see\n * `wspace-govcitizenhub-svc/prisma/schema/*.prisma`), so a detail route only\n * matches when the trailing segment is a real UUID. This is what keeps the\n * reserved literals `new` and `verify` from being read as entity ids.\n */\nconst UUID_SEGMENT = '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';\n\nfunction detailPattern(collection: string): RegExp {\n return new RegExp(`^/govcitizenhub/${collection}/(${UUID_SEGMENT})$`);\n}\n\n/**\n * Detail routes that actually exist in `GovCitizenHubRoutes.tsx`.\n * Keep in lockstep with the `path=\"<collection>/:id\"` routes declared there —\n * `pageContext.test.ts` fails the build if they drift.\n */\nconst DETAIL_ROUTES: ReadonlyArray<readonly [string, string]> = [\n ['services', 'GOVCITIZENHUB_SERVICE'],\n ['applications', 'GOVCITIZENHUB_APPLICATION'],\n ['grievances', 'GOVCITIZENHUB_GRIEVANCE'],\n];\n\n/**\n * List routes that exist but have no detail route. They contribute an\n * entityType so the agent knows which collection is on screen, and never an\n * entityId.\n *\n * ROUTE_DECISIONS — the previous table also carried detail patterns for\n * `agencies/:id`, `documents/:id`, `payments/:id` and `permits/:id`. No such\n * routes are declared, so those four regexes could never fire. They were\n * removed rather than left as dead code; if a detail route is added later,\n * move the collection into DETAIL_ROUTES and the route-parity test will pass\n * again.\n */\nconst LIST_ROUTES: ReadonlyArray<readonly [string, string]> = [\n ['services', 'GOVCITIZENHUB_SERVICE'],\n ['applications', 'GOVCITIZENHUB_APPLICATION'],\n ['agencies', 'GOVCITIZENHUB_AGENCY'],\n ['documents', 'GOVCITIZENHUB_DOCUMENT'],\n // Citizen document wallet (BOFF-5796) — reusable citizen-owned documents.\n ['wallet', 'GOVCITIZENHUB_WALLET_DOCUMENT'],\n ['payments', 'GOVCITIZENHUB_PAYMENT'],\n ['permits', 'GOVCITIZENHUB_PERMIT'],\n ['grievances', 'GOVCITIZENHUB_GRIEVANCE'],\n // Officer \"My queue\" (BOFF-4093): the applications list opened on the caller's\n // own assignments, at `officer/queue`.\n ['queue', 'GOVCITIZENHUB_APPLICATION'],\n // Officer Access control (BOFF-4059): GovCitizenHub roles and the audit trail,\n // at `officer/access-control`.\n ['access-control', 'GOVCITIZENHUB_ACCESS_CONTROL'],\n // Community Intelligence (BOFF-5666) — the jurisdiction directory.\n ['intelligence', 'GOVCITIZENHUB_JURISDICTION'],\n];\n\n/**\n * Community Intelligence jurisdiction profile tabs. Every one of these routes\n * is `/govcitizenhub/intelligence/<jurisdiction uuid>[/<tab>]`, so they all\n * carry the same entityId (the jurisdiction) and differ only in which surface\n * is on screen — reported both as a distinct entityType and as `activeTab`.\n *\n * The empty tab segment is the profile root; it shares the directory's\n * `GOVCITIZENHUB_JURISDICTION` type exactly as the other list/detail pairs do.\n */\nconst JURISDICTION_TAB_ROUTES: ReadonlyArray<readonly [string, string]> = [\n ['', 'GOVCITIZENHUB_JURISDICTION'],\n ['governance', 'GOVCITIZENHUB_JURISDICTION_GOVERNANCE'],\n ['budget', 'GOVCITIZENHUB_JURISDICTION_BUDGET'],\n ['projects', 'GOVCITIZENHUB_JURISDICTION_PROJECTS'],\n ['indicators', 'GOVCITIZENHUB_JURISDICTION_INDICATORS'],\n ['benchmark', 'GOVCITIZENHUB_JURISDICTION_BENCHMARK'],\n ['services', 'GOVCITIZENHUB_JURISDICTION_SERVICE_PERFORMANCE'],\n ['assets', 'GOVCITIZENHUB_JURISDICTION_ASSETS'],\n ['elections', 'GOVCITIZENHUB_JURISDICTION_ELECTIONS'],\n ['consultations', 'GOVCITIZENHUB_JURISDICTION_CONSULTATIONS'],\n ['open-data', 'GOVCITIZENHUB_JURISDICTION_OPEN_DATA'],\n ['timeline', 'GOVCITIZENHUB_JURISDICTION_TIMELINE'],\n ['corrections', 'GOVCITIZENHUB_JURISDICTION_CORRECTIONS'],\n];\n\n/**\n * Anchored to the UUID id shape for the same reason as `detailPattern`: the\n * admin catalog routes (`intelligence/admin/levels`, `.../indicators`) sit at\n * the same depth as a jurisdiction profile tab, and \"admin\" must never be\n * reported as a jurisdiction id.\n */\nconst JURISDICTION_PATTERN = new RegExp(\n `^/govcitizenhub/intelligence/(${UUID_SEGMENT})(?:/([a-z-]+))?$`\n);\n\n/**\n * Routes under a collection that are actions rather than entities. They must\n * never yield an entityId, and they get their own entityType so the agent can\n * tell \"composing a new application\" from \"browsing applications\".\n */\nconst ACTION_ROUTES: ReadonlyArray<readonly [string, string]> = [\n ['applications/new', 'GOVCITIZENHUB_APPLICATION_DRAFT'],\n ['permits/verify', 'GOVCITIZENHUB_PERMIT_VERIFICATION'],\n // Citizen mobile surface (BOFF-4088) — same four destinations as the\n // BottomTabNav. `m/scan` renders the identical VerifyPermitPage as\n // `permits/verify` above, so it reports the same entityType.\n ['m', 'GOVCITIZENHUB_MOBILE_HOME'],\n ['m/requests', 'GOVCITIZENHUB_MOBILE_REQUESTS'],\n ['m/scan', 'GOVCITIZENHUB_PERMIT_VERIFICATION'],\n ['m/profile', 'GOVCITIZENHUB_MOBILE_PROFILE'],\n // Community Intelligence admin catalogs — workspace-wide reference data, not\n // a jurisdiction, so they carry no entityId.\n ['intelligence/admin/levels', 'GOVCITIZENHUB_ADMIN_LEVEL'],\n ['intelligence/admin/indicators', 'GOVCITIZENHUB_INDICATOR'],\n];\n\nexport function gatherPageContext(): PageContext {\n const url = window.location.href;\n const pathSegments = window.location.pathname.split('/').filter(Boolean);\n const currentPage = pathSegments.slice(0, 3).join('/') || 'home';\n const entity = resolveGovCitizenHubConversationContext(\n window.location.pathname,\n window.location.search\n );\n\n return {\n currentUrl: url,\n currentPage,\n entityType: entity.entityType,\n entityId: entity.entityId,\n activeTab: entity.activeTab,\n platform: 'govcitizenhub',\n version: import.meta.env.VITE_APP_VERSION ?? '2026.709.1',\n viewportSize: `${window.innerWidth}x${window.innerHeight}`,\n };\n}\n\nfunction matchPath(pattern: RegExp, pathname: string): RegExpMatchArray | null {\n return pathname.match(pattern);\n}\n\nfunction normalizePath(pathname: string): string {\n return pathname.length > 1 && pathname.endsWith('/') ? pathname.slice(0, -1) : pathname;\n}\n\n/**\n * Officer console routes (BOFF-4093) live under `/govcitizenhub/officer/...` and\n * render the same screens as their citizen-portal counterparts, so the surface\n * prefix is stripped and the remainder resolves exactly as before. The surface is\n * reported separately so the agent can tell an officer's casework view from a\n * citizen's view of the same record.\n */\nconst OFFICER_PREFIX = /^\\/govcitizenhub\\/officer(?=\\/|$)/;\n\nexport function resolveGovCitizenHubConversationContext(\n pathname: string,\n search: string\n): ConversationContextShape {\n const params = new URLSearchParams(search);\n const normalized = normalizePath(pathname);\n const isOfficer = OFFICER_PREFIX.test(normalized);\n const path = isOfficer ? normalized.replace(OFFICER_PREFIX, '/govcitizenhub') : normalized;\n const context = resolveWithinProduct(path, params);\n return isOfficer\n ? { ...context, metadata: { ...context.metadata, surface: 'officer' } }\n : context;\n}\n\nfunction resolveWithinProduct(path: string, params: URLSearchParams): ConversationContextShape {\n // Action routes are matched before detail routes so a reserved literal can\n // never be mistaken for an id even if the id shape were relaxed later.\n for (const [suffix, entityType] of ACTION_ROUTES) {\n if (path === `/govcitizenhub/${suffix}`) {\n return { entityType, metadata: { route: suffix } };\n }\n }\n\n // Jurisdiction profile tabs are matched before the generic detail routes so\n // the tab segment is read as a surface, never as a nested entity id.\n const jurisdictionMatch = matchPath(JURISDICTION_PATTERN, path);\n if (jurisdictionMatch) {\n const tabSegment = jurisdictionMatch[2] ?? '';\n const tab = JURISDICTION_TAB_ROUTES.find(([segment]) => segment === tabSegment);\n if (tab) {\n return {\n entityType: tab[1],\n entityId: jurisdictionMatch[1],\n activeTab: tabSegment || undefined,\n metadata: { collection: 'intelligence' },\n };\n }\n }\n\n for (const [collection, entityType] of DETAIL_ROUTES) {\n const match = matchPath(detailPattern(collection), path);\n if (match) {\n return {\n entityType,\n entityId: match[1],\n metadata: { collection },\n };\n }\n }\n\n for (const [collection, entityType] of LIST_ROUTES) {\n if (path === `/govcitizenhub/${collection}`) {\n return {\n entityType,\n activeTab: params.get('tab') ?? undefined,\n metadata: { collection, view: 'list' },\n };\n }\n }\n\n if (path === '/govcitizenhub' || path === '/govcitizenhub/') {\n return {\n entityType: 'GOVCITIZENHUB_DASHBOARD',\n metadata: { view: 'dashboard' },\n };\n }\n\n const activeTab = params.get('tab') ?? undefined;\n return {\n activeTab,\n metadata: activeTab ? { activeTab } : {},\n };\n}\n\n/** Exported for the route-parity test in `pageContext.test.ts`. */\nexport const __routeTables = {\n DETAIL_ROUTES,\n LIST_ROUTES,\n ACTION_ROUTES,\n JURISDICTION_TAB_ROUTES,\n};\n"],"mappings":";AAyCA,IAAMA,IAAe;AAErB,SAASC,EAAc,GAA4B;CACjD,OAAW,OAAO,mBAAmBC,EAAW,IAAIF,EAAa,GAAG;AACtE;AAOA,IAAMG,IAA0D;CAC9D,CAAC,YAAY,uBAAuB;CACpC,CAAC,gBAAgB,2BAA2B;CAC5C,CAAC,cAAc,yBAAyB;AAC1C,GAcMC,IAAwD;CAC5D,CAAC,YAAY,uBAAuB;CACpC,CAAC,gBAAgB,2BAA2B;CAC5C,CAAC,YAAY,sBAAsB;CACnC,CAAC,aAAa,wBAAwB;CAEtC,CAAC,UAAU,+BAA+B;CAC1C,CAAC,YAAY,uBAAuB;CACpC,CAAC,WAAW,sBAAsB;CAClC,CAAC,cAAc,yBAAyB;CAGxC,CAAC,SAAS,2BAA2B;CAGrC,CAAC,kBAAkB,8BAA8B;CAEjD,CAAC,gBAAgB,4BAA4B;AAC/C,GAWMC,IAAoE;CACxE,CAAC,IAAI,4BAA4B;CACjC,CAAC,cAAc,uCAAuC;CACtD,CAAC,UAAU,mCAAmC;CAC9C,CAAC,YAAY,qCAAqC;CAClD,CAAC,cAAc,uCAAuC;CACtD,CAAC,aAA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C;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-govcitizenhub",
3
- "version": "2026.1113.1",
3
+ "version": "2026.1117.1",
4
4
  "description": "Burdenoff GovCitizenHub Microfrontend",
5
5
  "type": "module",
6
6
  "files": [
@@ -67,13 +67,13 @@
67
67
  },
68
68
  "devDependencies": {
69
69
  "@burdenoff/toolchain": "2026.1107.14",
70
- "@graphql-codegen/add": "^7.1.1",
71
- "@graphql-codegen/cli": "^7.4.6",
72
- "@graphql-codegen/import-types-preset": "^4.0.1",
73
- "@graphql-codegen/schema-ast": "^6.1.1",
74
- "@graphql-codegen/typescript": "^6.1.2",
75
- "@graphql-codegen/typescript-operations": "^6.2.0",
76
- "@graphql-codegen/typescript-react-apollo": "^5.0.0",
70
+ "@graphql-codegen/add": "^8.0.0",
71
+ "@graphql-codegen/cli": "^8.0.0",
72
+ "@graphql-codegen/import-types-preset": "^5.0.0",
73
+ "@graphql-codegen/schema-ast": "^7.0.0",
74
+ "@graphql-codegen/typescript": "^7.0.1",
75
+ "@graphql-codegen/typescript-operations": "^7.0.1",
76
+ "@graphql-codegen/typescript-react-apollo": "^6.0.1",
77
77
  "@storybook/addon-essentials": "^8.6.19",
78
78
  "@storybook/addon-interactions": "^8.6.19",
79
79
  "@storybook/react": "^8.6.19",
@@ -121,7 +121,10 @@
121
121
  "yaml": ">=2.8.3",
122
122
  "picomatch": ">=2.3.2",
123
123
  "immutable": ">=3.8.3",
124
- "minimatch": ">=3.1.3"
124
+ "minimatch": ">=3.1.3",
125
+ "glob@^10.0.0": "14.0.4",
126
+ "uuid@^8.0.0": "11.1.1",
127
+ "uuid@^9.0.0": "11.1.1"
125
128
  },
126
129
  "packageManager": "bun@1.4.4",
127
130
  "engines": {