@burdenoff/microfe-notification 2026.1124.1 → 2026.1125.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/AdminNotificationRoutes.js +59 -51
  2. package/dist/AdminNotificationRoutes.js.map +1 -1
  3. package/dist/NotificationRoutes.js +76 -68
  4. package/dist/NotificationRoutes.js.map +1 -1
  5. package/dist/UserNotificationRoutes.js +39 -31
  6. package/dist/UserNotificationRoutes.js.map +1 -1
  7. package/dist/components/NotificationListFooter.js +1 -1
  8. package/dist/components/NotificationListFooter.js.map +1 -1
  9. package/dist/components/loadingSystem.d.ts +64 -0
  10. package/dist/components/loadingSystem.js +34 -0
  11. package/dist/components/loadingSystem.js.map +1 -0
  12. package/dist/navigation-v2/AdminPageV2.js +23 -16
  13. package/dist/navigation-v2/AdminPageV2.js.map +1 -1
  14. package/dist/navigation-v2/NotificationArchivedV2.js +100 -93
  15. package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
  16. package/dist/navigation-v2/NotificationInboxV2.js +130 -123
  17. package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
  18. package/dist/navigation-v2/NotificationSettingsV2.js +91 -84
  19. package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -1
  20. package/dist/navigation-v2/NotificationsV2Landing.js +31 -23
  21. package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -1
  22. package/dist/pages/CreateNotificationPage.js +442 -432
  23. package/dist/pages/CreateNotificationPage.js.map +1 -1
  24. package/dist/pages/NotificationCenterPage.js +91 -84
  25. package/dist/pages/NotificationCenterPage.js.map +1 -1
  26. package/dist/pages/NotificationHistoryAdminPage.js +226 -219
  27. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  28. package/dist/pages/NotificationHistoryPage.js +69 -62
  29. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  30. package/dist/pages/NotificationLandingPage.js +42 -34
  31. package/dist/pages/NotificationLandingPage.js.map +1 -1
  32. package/dist/pages/NotificationPreferencesPage.js +80 -70
  33. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  34. package/dist/pages/NotificationTemplatesPage.js +192 -181
  35. package/dist/pages/NotificationTemplatesPage.js.map +1 -1
  36. package/dist/pages/NotificationTopicsPage.js +124 -117
  37. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  38. package/dist/pages/TemplateEditorPage.js +248 -233
  39. package/dist/pages/TemplateEditorPage.js.map +1 -1
  40. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationArchivedV2.js","names":["HISTORY_FILTER","ALL","toDateInput","value","NotificationArchivedV2","tr","useTr","permissionsLoading","usePermissions","useNotification","useNotificationTopics","useNotifications","view","setView","useState","moreFiltersOpen","setMoreFiltersOpen","useRememberedOpen","visible","useMemo","notifications","inArchivedView","notification","moreFiltersActive","notificationFilter","hasActiveFilters","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","chips","topicOptions","topics","topic","BackToNotifications","DropdownMenu","DropdownMenuTrigger","Button","MoreHorizontal","DropdownMenuContent","DropdownMenuItem","exportNotificationsAsCsv","Download","SearchField","updateFilter","ViewChips","MoreFiltersButton","NativeSelect","Input","NotificationCard","archiveNotification","recordAction","unarchiveNotification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/navigation-v2/NotificationArchivedV2.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Download, MoreHorizontal } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n IllustratedEmptyState,\n Input,\n NativeSelect,\n useRememberedOpen,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { inArchivedView, type ArchivedView } from './inboxFilters';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { BackToNotifications } from './BackToNotifications';\nimport { MoreFiltersButton, SearchField, ViewChips } from './FilterControls';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\nconst ALL = 'ALL';\n\nfunction toDateInput(value: Date | null): string {\n return value ? value.toISOString().split('T')[0] : '';\n}\n\n/**\n * Archived, Navigation v2 (BOFF-11872; today's personal Notification\n * History). Same query as the classic page (every channel, archived or\n * not); the \"Archived\" chip, on by default, shows what you archived and\n * \"Everything\" shows the full history. Restore on each archived row, search\n * at level 1, topic and dates under \"More filters\", and \"Download as\n * spreadsheet\" in \"⋯\".\n */\nexport function NotificationArchivedV2() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const { topics } = useNotificationTopics({ isActive: true });\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\n notificationFilter,\n updateFilter,\n archiveNotification,\n unarchiveNotification,\n recordAction,\n } = useNotifications({ baseFilter: HISTORY_FILTER });\n const [view, setView] = useState<ArchivedView>('archived');\n const [moreFiltersOpen, setMoreFiltersOpen] = useRememberedOpen(\n 'notifications.archived.moreFilters',\n false\n );\n\n const visible = useMemo(\n () => notifications.filter((notification) => inArchivedView(notification, view)),\n [notifications, view]\n );\n\n const moreFiltersActive = Boolean(\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\n );\n const hasActiveFilters = Boolean(notificationFilter.search) || moreFiltersActive;\n\n if (permissionsLoading) {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n const chips: Array<{ id: ArchivedView; label: string }> = [\n { id: 'archived', label: tr('notifications.v2.archived', 'Archived') },\n { id: 'everything', label: tr('notifications.v2.everything', 'Everything') },\n ];\n const topicOptions = [\n { value: ALL, label: tr('notifications.allTopics', 'All Topics') },\n ...topics.map((topic) => ({ value: topic.id, label: topic.name })),\n ];\n\n return (\n <div className=\"mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6\">\n <BackToNotifications />\n <header\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div>\n <h1 className=\"text-xl font-semibold text-text-primary sm:text-2xl\">\n {tr('notifications.v2.archivedTitle', 'Archived')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'notifications.v2.archivedSubtitle',\n 'Notifications you archived. Restore one to put it back in your inbox.'\n )}\n </p>\n </div>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label={tr('notifications.v2.moreActions', 'More actions')}\n data-testid=\"notifications-archived-overflow\"\n >\n <MoreHorizontal size={18} aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem\n data-tour=\"notification-history-export\"\n disabled={notifications.length === 0}\n onSelect={() => exportNotificationsAsCsv(tr, notifications)}\n >\n <Download size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.downloadSpreadsheet', 'Download as spreadsheet')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </header>\n\n <section aria-label={tr('notifications.v2.filters', 'Filters')} className=\"space-y-3\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center\">\n <SearchField\n label={tr('notifications.searchByTitleOrContent', 'Search by title or content...')}\n value={notificationFilter.search}\n onChange={(search) => updateFilter({ search })}\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <ViewChips\n chips={chips}\n value={view}\n onChange={setView}\n testIdPrefix=\"notifications-archived-view\"\n />\n <MoreFiltersButton\n open={moreFiltersOpen}\n active={moreFiltersActive}\n controls=\"notifications-archived-more-filters\"\n onToggle={() => setMoreFiltersOpen(!moreFiltersOpen)}\n />\n </div>\n </div>\n <div\n id=\"notifications-archived-more-filters\"\n hidden={!moreFiltersOpen}\n className=\"grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-3\"\n >\n <NativeSelect\n aria-label={tr('notifications.v2.topicFilter', 'Topic')}\n options={topicOptions}\n value={notificationFilter.topicId || ALL}\n onValueChange={(value) => updateFilter({ topicId: value === ALL ? undefined : value })}\n />\n <Input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={toDateInput(notificationFilter.dateRange.start)}\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n start: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n />\n <Input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={toDateInput(notificationFilter.dateRange.end)}\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n end: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n />\n </div>\n </section>\n\n <div className=\"space-y-2\">\n {visible.length > 0 ? (\n visible.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={notification.archivedAt ? undefined : archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n navigationV2\n showTopic={moreFiltersOpen}\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => unarchiveNotification(notification.id)}\n >\n {tr('notifications.restore', 'Restore')}\n </Button>\n </div>\n )}\n </div>\n ))\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : view === 'archived'\n ? tr('notifications.v2.archivedEmptyTitle', 'Nothing archived')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : view === 'archived'\n ? tr(\n 'notifications.v2.archivedEmptyDescription',\n 'Archive a notification from your inbox and it moves here.'\n )\n : tr(\n 'notifications.historyEmptyDescription',\n 'Notifications you receive will be archived here so you can always find them again.'\n )\n }\n kind={\n notificationFilter.search ? 'no-results' : hasActiveFilters ? 'filtered' : 'first-use'\n }\n />\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={visible.length}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe,GAC3DC,IAAM;AAEZ,SAASC,EAAY,GAA4B;CAC/C,OAAOC,IAAQA,EAAM,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK;AACrD;AAUA,SAAgBC,IAAyB;CACvC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,OAAuBC,EAAe,GAClE,EAAE,mBAAgBC,EAAgB,GAClC,EAAE,cAAWC,EAAsB,EAAE,UAAU,GAAK,CAAC,GACrD,EACJ,kBACA,YACA,kBACA,aACA,uBACA,iBACA,wBACA,0BACA,oBACEC,EAAiB,EAAE,YAAYX,EAAe,CAAC,GAC7C,CAACY,GAAMC,KAAWC,EAAuB,UAAU,GACnD,CAACC,GAAiBC,KAAsBC,EAC5C,sCACA,EACF,GAEMC,IAAUC,QACRC,EAAc,QAAQ,MAAiBC,EAAeC,GAAcV,CAAI,CAAC,GAC/E,CAACQ,G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,GAAD;IACW;IACM;IACf,YAAYC;IACZ,YAAYpC,EAAQ;GACrB,CAAA;EACE;;AAET"}
1
+ {"version":3,"file":"NotificationArchivedV2.js","names":["HISTORY_FILTER","ALL","toDateInput","value","NotificationArchivedV2","tr","useTr","permissionsLoading","usePermissions","useNotification","useNotificationTopics","useNotifications","view","setView","useState","moreFiltersOpen","setMoreFiltersOpen","useRememberedOpen","visible","useMemo","notifications","inArchivedView","notification","moreFiltersActive","notificationFilter","hasActiveFilters","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","chips","topicOptions","topics","topic","BackToNotifications","DropdownMenu","DropdownMenuTrigger","Button","MoreHorizontal","DropdownMenuContent","DropdownMenuItem","exportNotificationsAsCsv","Download","SearchField","updateFilter","ViewChips","MoreFiltersButton","NativeSelect","Input","NotificationCard","archiveNotification","recordAction","unarchiveNotification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/navigation-v2/NotificationArchivedV2.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Download, MoreHorizontal } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n IllustratedEmptyState,\n Input,\n NativeSelect,\n useRememberedOpen,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { inArchivedView, type ArchivedView } from './inboxFilters';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { BackToNotifications } from './BackToNotifications';\nimport { MoreFiltersButton, SearchField, ViewChips } from './FilterControls';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\nconst ALL = 'ALL';\n\nfunction toDateInput(value: Date | null): string {\n return value ? value.toISOString().split('T')[0] : '';\n}\n\n/**\n * Archived, Navigation v2 (BOFF-11872; today's personal Notification\n * History). Same query as the classic page (every channel, archived or\n * not); the \"Archived\" chip, on by default, shows what you archived and\n * \"Everything\" shows the full history. Restore on each archived row, search\n * at level 1, topic and dates under \"More filters\", and \"Download as\n * spreadsheet\" in \"⋯\".\n */\nexport function NotificationArchivedV2() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const { topics } = useNotificationTopics({ isActive: true });\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\n notificationFilter,\n updateFilter,\n archiveNotification,\n unarchiveNotification,\n recordAction,\n } = useNotifications({ baseFilter: HISTORY_FILTER });\n const [view, setView] = useState<ArchivedView>('archived');\n const [moreFiltersOpen, setMoreFiltersOpen] = useRememberedOpen(\n 'notifications.archived.moreFilters',\n false\n );\n\n const visible = useMemo(\n () => notifications.filter((notification) => inArchivedView(notification, view)),\n [notifications, view]\n );\n\n const moreFiltersActive = Boolean(\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\n );\n const hasActiveFilters = Boolean(notificationFilter.search) || moreFiltersActive;\n\n if (permissionsLoading) {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n const chips: Array<{ id: ArchivedView; label: string }> = [\n { id: 'archived', label: tr('notifications.v2.archived', 'Archived') },\n { id: 'everything', label: tr('notifications.v2.everything', 'Everything') },\n ];\n const topicOptions = [\n { value: ALL, label: tr('notifications.allTopics', 'All Topics') },\n ...topics.map((topic) => ({ value: topic.id, label: topic.name })),\n ];\n\n return (\n <div className=\"mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6\">\n <BackToNotifications />\n <header\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div>\n <h1 className=\"text-xl font-semibold text-text-primary sm:text-2xl\">\n {tr('notifications.v2.archivedTitle', 'Archived')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'notifications.v2.archivedSubtitle',\n 'Notifications you archived. Restore one to put it back in your inbox.'\n )}\n </p>\n </div>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label={tr('notifications.v2.moreActions', 'More actions')}\n data-testid=\"notifications-archived-overflow\"\n >\n <MoreHorizontal size={18} aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem\n data-tour=\"notification-history-export\"\n disabled={notifications.length === 0}\n onSelect={() => exportNotificationsAsCsv(tr, notifications)}\n >\n <Download size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.downloadSpreadsheet', 'Download as spreadsheet')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </header>\n\n <section aria-label={tr('notifications.v2.filters', 'Filters')} className=\"space-y-3\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center\">\n <SearchField\n label={tr('notifications.searchByTitleOrContent', 'Search by title or content...')}\n value={notificationFilter.search}\n onChange={(search) => updateFilter({ search })}\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <ViewChips\n chips={chips}\n value={view}\n onChange={setView}\n testIdPrefix=\"notifications-archived-view\"\n />\n <MoreFiltersButton\n open={moreFiltersOpen}\n active={moreFiltersActive}\n controls=\"notifications-archived-more-filters\"\n onToggle={() => setMoreFiltersOpen(!moreFiltersOpen)}\n />\n </div>\n </div>\n <div\n id=\"notifications-archived-more-filters\"\n hidden={!moreFiltersOpen}\n className=\"grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-3\"\n >\n <NativeSelect\n aria-label={tr('notifications.v2.topicFilter', 'Topic')}\n options={topicOptions}\n value={notificationFilter.topicId || ALL}\n onValueChange={(value) => updateFilter({ topicId: value === ALL ? undefined : value })}\n />\n <Input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={toDateInput(notificationFilter.dateRange.start)}\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n start: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n />\n <Input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={toDateInput(notificationFilter.dateRange.end)}\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n end: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n />\n </div>\n </section>\n\n <div className=\"space-y-2\">\n {visible.length > 0 ? (\n visible.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={notification.archivedAt ? undefined : archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n navigationV2\n showTopic={moreFiltersOpen}\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => unarchiveNotification(notification.id)}\n >\n {tr('notifications.restore', 'Restore')}\n </Button>\n </div>\n )}\n </div>\n ))\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : view === 'archived'\n ? tr('notifications.v2.archivedEmptyTitle', 'Nothing archived')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : view === 'archived'\n ? tr(\n 'notifications.v2.archivedEmptyDescription',\n 'Archive a notification from your inbox and it moves here.'\n )\n : tr(\n 'notifications.historyEmptyDescription',\n 'Notifications you receive will be archived here so you can always find them again.'\n )\n }\n kind={\n notificationFilter.search ? 'no-results' : hasActiveFilters ? 'filtered' : 'first-use'\n }\n />\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={visible.length}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0BA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe,GAC3DC,IAAM;AAEZ,SAASC,EAAY,GAA4B;CAC/C,OAAOC,IAAQA,EAAM,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK;AACrD;AAUA,SAAgBC,IAAyB;CACvC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBC,EAAgB,GAClC,EAAE,cAAWC,EAAsB,EAAE,UAAU,GAAK,CAAC,GACrD,EACJ,kBACA,YACA,kBACA,aACA,uBACA,iBACA,wBACA,0BACA,oBACEC,EAAiB,EAAE,YAAYX,EAAe,CAAC,GAC7C,CAACY,GAAMC,KAAWC,EAAuB,UAAU,GACnD,CAACC,GAAiBC,KAAsBC,EAC5C,sCACA,EACF,GAEMC,IAAUC,QACRC,EAAc,QAAQ,MAAiBC,EAAeC,GAAcV,CAAI,CAAC,GAC/E,CAACQ,GAAeR,CAAI,CACtB,GAEMW,IAAoB,GACxBC,EAAmB,WACnBA,EAAmB,UAAU,SAC7BA,EAAmB,UAAU,MAEzBC,IAAmB,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M;IACf,YAAYC;IACZ,YAAYtC,EAAQ;GACrB,CAAA;EACE;;AAET"}
@@ -2,52 +2,59 @@ import { NotificationCard as e } from "../components/NotificationCard.js";
2
2
  import { useNotifications as t } from "../hooks/useNotifications.js";
3
3
  import { NotificationListFooter as n } from "../components/NotificationListFooter.js";
4
4
  import { useNotificationTopics as r } from "../hooks/useNotificationTopics.js";
5
- import { NOTIFICATION_PERMISSIONS as i } from "../constants/permissions.js";
5
+ import { NOTIFICATION_PERMISSIONS as ee } from "../constants/permissions.js";
6
6
  import "../hooks/index.js";
7
- import { useNotification as a } from "../providers/NotificationProvider.js";
8
- import { useTr as o } from "../shared/hooks/useTr.js";
9
- import { needsAction as ee } from "./inboxFilters.js";
7
+ import { useNotification as i } from "../providers/NotificationProvider.js";
8
+ import { useTr as a } from "../shared/hooks/useTr.js";
9
+ import { needsAction as o } from "./inboxFilters.js";
10
10
  import { filterNotifications as s, groupNotificationsByDate as c } from "../utils/index.js";
11
11
  import { AdminToolsMenu as l } from "./AdminToolsMenu.js";
12
12
  import { MoreFiltersButton as u, SearchField as d, ViewChips as f } from "./FilterControls.js";
13
13
  import { useNotificationPaths as p } from "./paths.js";
14
- import { useMemo as m, useState as h } from "react";
15
- import { usePermissions as g } from "@burdenoff/fe-libs/shared/providers/shell";
16
- import { Archive as _, CheckCheck as v, Settings as y } from "lucide-react";
17
- import { Link as b } from "react-router";
18
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
19
- import { PushOptInToggle as C } from "@burdenoff/fe-libs/chrome";
20
- import { Button as w, IllustratedEmptyState as T, NativeSelect as E, useRememberedOpen as te } from "@burdenoff/fe-libs/ui";
14
+ import { CompactMarkOr as m, SectionLoaderOr as h } from "../components/loadingSystem.js";
15
+ import { useMemo as g, useState as _ } from "react";
16
+ import { usePermissions as v } from "@burdenoff/fe-libs/shared/providers/shell";
17
+ import { Archive as y, CheckCheck as b, Settings as x } from "lucide-react";
18
+ import { Link as S } from "react-router";
19
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
20
+ import { PushOptInToggle as T } from "@burdenoff/fe-libs/chrome";
21
+ import { Button as E, IllustratedEmptyState as te, NativeSelect as D, useRememberedOpen as O } from "@burdenoff/fe-libs/ui";
21
22
  // src/navigation-v2/NotificationInboxV2.tsx
22
- var D = {
23
+ var k = {
23
24
  archived: !1,
24
25
  channel: "IN_APP"
25
- }, O = { channel: "IN_APP" }, k = "ALL";
26
- function A() {
27
- let l = o(), _ = p(), { hasPermission: v, isLoading: y } = g(), { currentUser: A } = a(), { notifications: M, hasMore: N, isLoadingMore: P, loadMore: F, unreadCount: I, notificationFilter: L, markAsRead: R, markAllAsRead: z, archiveNotification: B, recordAction: V, updateFilter: H, resetFilter: ne } = t({
28
- baseFilter: D,
29
- unreadFilter: O
30
- }), { topics: U } = r({ isActive: !0 }), [W, G] = h(!1), [K, q] = te("notifications.inbox.moreFilters", !1), J = W ? "action" : L.isRead === !1 ? "unread" : L.isRead === null ? "all" : null, Y = m(() => {
31
- let e = s(M, L);
32
- return W ? e.filter(ee) : e;
26
+ }, A = { channel: "IN_APP" }, j = "ALL";
27
+ function M() {
28
+ let l = a(), y = p(), { hasPermission: b, isLoading: x } = v(), { currentUser: M } = i(), { notifications: P, hasMore: F, isLoadingMore: I, loadMore: L, unreadCount: R, notificationFilter: z, markAsRead: B, markAllAsRead: V, archiveNotification: H, recordAction: ne, updateFilter: U, resetFilter: W } = t({
29
+ baseFilter: k,
30
+ unreadFilter: A
31
+ }), { topics: G } = r({ isActive: !0 }), [K, q] = _(!1), [J, Y] = O("notifications.inbox.moreFilters", !1), X = K ? "action" : z.isRead === !1 ? "unread" : z.isRead === null ? "all" : null, Z = g(() => {
32
+ let e = s(P, z);
33
+ return K ? e.filter(o) : e;
33
34
  }, [
34
- M,
35
- L,
36
- W
37
- ]), X = m(() => c(Y, l), [Y, l]), Z = L.type !== k || L.priority !== k || !!L.topicId || L.isRead === !0, re = !!L.search || Z || J !== "all", ie = (e) => {
38
- G(e === "action"), H({ isRead: e !== "unread" && null });
39
- }, Q = () => {
40
- G(!1), ne();
35
+ P,
36
+ z,
37
+ K
38
+ ]), re = g(() => c(Z, l), [Z, l]), Q = z.type !== j || z.priority !== j || !!z.topicId || z.isRead === !0, ie = !!z.search || Q || X !== "all", ae = (e) => {
39
+ q(e === "action"), U({ isRead: e !== "unread" && null });
40
+ }, $ = () => {
41
+ q(!1), W();
41
42
  };
42
- if (y) return /* @__PURE__ */ x("div", {
43
- className: "flex h-64 items-center justify-center",
44
- children: /* @__PURE__ */ x("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
43
+ if (x) return /* @__PURE__ */ C(h, {
44
+ minHeight: "16rem",
45
+ today: /* @__PURE__ */ C("div", {
46
+ className: "flex h-64 items-center justify-center",
47
+ children: /* @__PURE__ */ C(m, {
48
+ className: "h-8 w-8",
49
+ today: /* @__PURE__ */ C("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
50
+ })
51
+ })
45
52
  });
46
- if (!v(i.NOTIFICATION_LIST) && !A?.id) return /* @__PURE__ */ x("div", {
53
+ if (!b(ee.NOTIFICATION_LIST) && !M?.id) return /* @__PURE__ */ C("div", {
47
54
  className: "p-8 text-center text-text-secondary",
48
55
  children: l("notifications.noPermissionView", "You don't have permission to view notifications.")
49
56
  });
50
- let ae = [
57
+ let oe = [
51
58
  {
52
59
  id: "all",
53
60
  label: l("notifications.filterAll", "All")
@@ -60,9 +67,9 @@ function A() {
60
67
  id: "action",
61
68
  label: l("notifications.v2.needsAction", "Needs action")
62
69
  }
63
- ], oe = [
70
+ ], se = [
64
71
  {
65
- value: k,
72
+ value: j,
66
73
  label: l("notifications.allTypes", "All Types")
67
74
  },
68
75
  {
@@ -81,9 +88,9 @@ function A() {
81
88
  value: "MARKETING",
82
89
  label: l("notifications.typeMarketing", "Marketing")
83
90
  }
84
- ], $ = [
91
+ ], ce = [
85
92
  {
86
- value: k,
93
+ value: j,
87
94
  label: l("notifications.allPriorities", "All Priorities")
88
95
  },
89
96
  {
@@ -102,13 +109,13 @@ function A() {
102
109
  value: "LOW",
103
110
  label: l("notifications.priorityLow", "Low")
104
111
  }
105
- ], se = [{
106
- value: k,
112
+ ], le = [{
113
+ value: j,
107
114
  label: l("notifications.allTopics", "All Topics")
108
- }, ...U.map((e) => ({
115
+ }, ...G.map((e) => ({
109
116
  value: e.id,
110
117
  label: e.name
111
- }))], ce = [
118
+ }))], ue = [
112
119
  {
113
120
  value: "ALL",
114
121
  label: l("notifications.filterAll", "All")
@@ -121,197 +128,197 @@ function A() {
121
128
  value: "READ",
122
129
  label: l("notifications.filterRead", "Read")
123
130
  }
124
- ], le = L.isRead === null ? "ALL" : L.isRead ? "READ" : "UNREAD";
125
- return /* @__PURE__ */ S("div", {
131
+ ], de = z.isRead === null ? "ALL" : z.isRead ? "READ" : "UNREAD";
132
+ return /* @__PURE__ */ w("div", {
126
133
  className: "mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6",
127
134
  children: [
128
- /* @__PURE__ */ x(j, {
129
- unreadCount: I,
130
- onMarkAllAsRead: z
135
+ /* @__PURE__ */ C(N, {
136
+ unreadCount: R,
137
+ onMarkAllAsRead: V
131
138
  }),
132
- /* @__PURE__ */ x(C, {}),
133
- /* @__PURE__ */ S("section", {
139
+ /* @__PURE__ */ C(T, {}),
140
+ /* @__PURE__ */ w("section", {
134
141
  "data-tour": "notification-center-filters",
135
142
  "aria-label": l("notifications.v2.filters", "Filters"),
136
143
  className: "space-y-3",
137
144
  children: [
138
- /* @__PURE__ */ S("div", {
145
+ /* @__PURE__ */ w("div", {
139
146
  className: "flex flex-col gap-3 sm:flex-row sm:items-center",
140
- children: [/* @__PURE__ */ x(d, {
147
+ children: [/* @__PURE__ */ C(d, {
141
148
  label: l("notifications.searchPlaceholder", "Search notifications..."),
142
- value: L.search,
143
- onChange: (e) => H({ search: e }),
149
+ value: z.search,
150
+ onChange: (e) => U({ search: e }),
144
151
  tour: "notification-center-search"
145
- }), /* @__PURE__ */ S("div", {
152
+ }), /* @__PURE__ */ w("div", {
146
153
  className: "flex flex-wrap items-center gap-2",
147
- children: [/* @__PURE__ */ x(f, {
148
- chips: ae,
149
- value: J,
150
- onChange: ie,
154
+ children: [/* @__PURE__ */ C(f, {
155
+ chips: oe,
156
+ value: X,
157
+ onChange: ae,
151
158
  testIdPrefix: "notifications-view"
152
- }), /* @__PURE__ */ x(u, {
153
- open: K,
154
- active: Z,
159
+ }), /* @__PURE__ */ C(u, {
160
+ open: J,
161
+ active: Q,
155
162
  controls: "notifications-more-filters",
156
- onToggle: () => q(!K)
163
+ onToggle: () => Y(!J)
157
164
  })]
158
165
  })]
159
166
  }),
160
- /* @__PURE__ */ S("div", {
167
+ /* @__PURE__ */ w("div", {
161
168
  id: "notifications-more-filters",
162
- hidden: !K,
169
+ hidden: !J,
163
170
  className: "grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-2 lg:grid-cols-4",
164
171
  children: [
165
- /* @__PURE__ */ x(E, {
172
+ /* @__PURE__ */ C(D, {
166
173
  "aria-label": l("notifications.v2.typeFilter", "Type"),
167
- options: oe,
168
- value: L.type,
169
- onValueChange: (e) => H({ type: e })
174
+ options: se,
175
+ value: z.type,
176
+ onValueChange: (e) => U({ type: e })
170
177
  }),
171
- /* @__PURE__ */ x(E, {
178
+ /* @__PURE__ */ C(D, {
172
179
  "aria-label": l("notifications.v2.priorityFilter", "Priority"),
173
- options: $,
174
- value: L.priority,
175
- onValueChange: (e) => H({ priority: e })
180
+ options: ce,
181
+ value: z.priority,
182
+ onValueChange: (e) => U({ priority: e })
176
183
  }),
177
- /* @__PURE__ */ x(E, {
184
+ /* @__PURE__ */ C(D, {
178
185
  "aria-label": l("notifications.v2.topicFilter", "Topic"),
179
- options: se,
180
- value: L.topicId || k,
181
- onValueChange: (e) => H({ topicId: e === k ? void 0 : e })
186
+ options: le,
187
+ value: z.topicId || j,
188
+ onValueChange: (e) => U({ topicId: e === j ? void 0 : e })
182
189
  }),
183
- /* @__PURE__ */ x(E, {
190
+ /* @__PURE__ */ C(D, {
184
191
  "aria-label": l("notifications.v2.readFilter", "Read state"),
185
- options: ce,
186
- value: le,
192
+ options: ue,
193
+ value: de,
187
194
  onValueChange: (e) => {
188
- G(!1), H({ isRead: e === "ALL" ? null : e === "READ" });
195
+ q(!1), U({ isRead: e === "ALL" ? null : e === "READ" });
189
196
  }
190
197
  })
191
198
  ]
192
199
  }),
193
- re && /* @__PURE__ */ x("button", {
200
+ ie && /* @__PURE__ */ C("button", {
194
201
  type: "button",
195
- onClick: Q,
202
+ onClick: $,
196
203
  className: "text-sm text-text-tertiary transition-colors hover:text-text-primary",
197
204
  children: l("notifications.v2.clearFilters", "Clear filters")
198
205
  })
199
206
  ]
200
207
  }),
201
- /* @__PURE__ */ x("div", {
208
+ /* @__PURE__ */ C("div", {
202
209
  "data-tour": "notification-center-list",
203
210
  className: "space-y-6",
204
- children: Y.length > 0 ? Object.entries(X).map(([t, n]) => /* @__PURE__ */ S("section", {
211
+ children: Z.length > 0 ? Object.entries(re).map(([t, n]) => /* @__PURE__ */ w("section", {
205
212
  "aria-label": t,
206
- children: [/* @__PURE__ */ x("h2", {
213
+ children: [/* @__PURE__ */ C("h2", {
207
214
  className: "mb-3 text-sm font-semibold text-text-tertiary",
208
215
  children: t
209
- }), /* @__PURE__ */ x("div", {
216
+ }), /* @__PURE__ */ C("div", {
210
217
  className: "space-y-2",
211
- children: n.map((t) => /* @__PURE__ */ x(e, {
218
+ children: n.map((t) => /* @__PURE__ */ C(e, {
212
219
  notification: t,
213
- onMarkAsRead: R,
214
- onArchive: B,
215
- onAction: V,
220
+ onMarkAsRead: B,
221
+ onArchive: H,
222
+ onAction: ne,
216
223
  analyticsSource: "center",
217
224
  navigationV2: !0,
218
- showTopic: K
225
+ showTopic: J
219
226
  }, t.id))
220
227
  })]
221
- }, t)) : /* @__PURE__ */ x(T, {
222
- illustration: M.length === 0 ? "empty-notifications" : "empty-search",
223
- title: M.length === 0 ? l("notifications.v2.emptyTitle", "You're all caught up") : l("notifications.noNotificationsFound", "No notifications found"),
224
- description: M.length === 0 ? l("notifications.v2.emptyDescription", "Nothing here yet. We'll let you know when something needs you.") : l("notifications.adjustFilters", "Try adjusting your filters to see more notifications."),
225
- action: M.length === 0 ? /* @__PURE__ */ x(w, {
228
+ }, t)) : /* @__PURE__ */ C(te, {
229
+ illustration: P.length === 0 ? "empty-notifications" : "empty-search",
230
+ title: P.length === 0 ? l("notifications.v2.emptyTitle", "You're all caught up") : l("notifications.noNotificationsFound", "No notifications found"),
231
+ description: P.length === 0 ? l("notifications.v2.emptyDescription", "Nothing here yet. We'll let you know when something needs you.") : l("notifications.adjustFilters", "Try adjusting your filters to see more notifications."),
232
+ action: P.length === 0 ? /* @__PURE__ */ C(E, {
226
233
  asChild: !0,
227
234
  variant: "outline",
228
- children: /* @__PURE__ */ x(b, {
229
- to: _.preferences,
235
+ children: /* @__PURE__ */ C(S, {
236
+ to: y.preferences,
230
237
  children: l("notifications.v2.chooseHow", "Choose how we reach you")
231
238
  })
232
- }) : /* @__PURE__ */ x(w, {
239
+ }) : /* @__PURE__ */ C(E, {
233
240
  type: "button",
234
241
  variant: "outline",
235
- onClick: Q,
242
+ onClick: $,
236
243
  children: l("notifications.v2.clearFilters", "Clear filters")
237
244
  }),
238
- kind: L.search ? "no-results" : Z ? "filtered" : "all-done"
245
+ kind: z.search ? "no-results" : Q ? "filtered" : "all-done"
239
246
  })
240
247
  }),
241
- /* @__PURE__ */ x(n, {
242
- hasMore: N,
243
- isLoadingMore: P,
244
- onLoadMore: F,
245
- shownCount: Y.length
248
+ /* @__PURE__ */ C(n, {
249
+ hasMore: F,
250
+ isLoadingMore: I,
251
+ onLoadMore: L,
252
+ shownCount: Z.length
246
253
  })
247
254
  ]
248
255
  });
249
256
  }
250
- function j({ unreadCount: e, onMarkAllAsRead: t }) {
251
- let n = o(), r = p();
252
- return /* @__PURE__ */ S("header", {
257
+ function N({ unreadCount: e, onMarkAllAsRead: t }) {
258
+ let n = a(), r = p();
259
+ return /* @__PURE__ */ w("header", {
253
260
  "data-tour": "notification-center-header",
254
261
  className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
255
- children: [/* @__PURE__ */ S("div", {
262
+ children: [/* @__PURE__ */ w("div", {
256
263
  className: "min-w-0",
257
- children: [/* @__PURE__ */ S("h1", {
264
+ children: [/* @__PURE__ */ w("h1", {
258
265
  className: "flex flex-wrap items-center gap-2 text-xl font-semibold text-text-primary sm:text-2xl",
259
- children: [n("notifications.v2.title", "Notifications"), e > 0 && /* @__PURE__ */ S("span", {
266
+ children: [n("notifications.v2.title", "Notifications"), e > 0 && /* @__PURE__ */ w("span", {
260
267
  "data-tour": "notification-center-unread-count",
261
268
  className: "inline-flex items-center gap-1.5 rounded-full bg-accent-primary/10 px-2.5 py-0.5 text-sm font-medium text-accent-primary",
262
- children: [/* @__PURE__ */ x("span", {
269
+ children: [/* @__PURE__ */ C("span", {
263
270
  className: "inline-block h-2 w-2 rounded-full bg-accent-primary",
264
271
  "aria-hidden": "true"
265
272
  }), n("notifications.v2.unreadCount", "{{count}} unread", { count: e })]
266
273
  })]
267
- }), /* @__PURE__ */ x("p", {
274
+ }), /* @__PURE__ */ C("p", {
268
275
  className: "mt-1 text-sm text-text-secondary",
269
276
  children: n("notifications.v2.subtitle", "Everything the platform told you, in one place.")
270
277
  })]
271
- }), /* @__PURE__ */ S("div", {
278
+ }), /* @__PURE__ */ w("div", {
272
279
  className: "flex flex-wrap items-center gap-2",
273
280
  children: [
274
- e > 0 && /* @__PURE__ */ S(w, {
281
+ e > 0 && /* @__PURE__ */ w(E, {
275
282
  "data-tour": "notification-center-mark-all-read",
276
283
  variant: "outline",
277
284
  onClick: t,
278
285
  className: "gap-2",
279
- children: [/* @__PURE__ */ x(v, {
286
+ children: [/* @__PURE__ */ C(b, {
280
287
  size: 16,
281
288
  "aria-hidden": "true"
282
289
  }), n("notifications.v2.markAllAsRead", "Mark all as read")]
283
290
  }),
284
- /* @__PURE__ */ x(w, {
291
+ /* @__PURE__ */ C(E, {
285
292
  asChild: !0,
286
293
  variant: "outline",
287
294
  className: "gap-2",
288
- children: /* @__PURE__ */ S(b, {
295
+ children: /* @__PURE__ */ w(S, {
289
296
  to: r.preferences,
290
297
  "data-testid": "notifications-settings-link",
291
- children: [/* @__PURE__ */ x(y, {
298
+ children: [/* @__PURE__ */ C(x, {
292
299
  size: 16,
293
300
  "aria-hidden": "true"
294
301
  }), n("notifications.v2.settings", "Notification settings")]
295
302
  })
296
303
  }),
297
- /* @__PURE__ */ x(w, {
304
+ /* @__PURE__ */ C(E, {
298
305
  asChild: !0,
299
306
  variant: "ghost",
300
307
  className: "gap-2",
301
- children: /* @__PURE__ */ S(b, {
308
+ children: /* @__PURE__ */ w(S, {
302
309
  to: r.archived,
303
310
  "data-testid": "notifications-archived-link",
304
- children: [/* @__PURE__ */ x(_, {
311
+ children: [/* @__PURE__ */ C(y, {
305
312
  size: 16,
306
313
  "aria-hidden": "true"
307
314
  }), n("notifications.v2.archived", "Archived")]
308
315
  })
309
316
  }),
310
- /* @__PURE__ */ x(l, {})
317
+ /* @__PURE__ */ C(l, {})
311
318
  ]
312
319
  })]
313
320
  });
314
321
  }
315
- export { A as NotificationInboxV2 };
322
+ export { M as NotificationInboxV2 };
316
323
 
317
324
  //# sourceMappingURL=NotificationInboxV2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationInboxV2.js","names":["CENTER_FILTER","CENTER_UNREAD_FILTER","ALL","NotificationInboxV2","tr","useTr","paths","useNotificationPaths","permissionsLoading","usePermissions","useNotification","useNotifications","useNotificationTopics","onlyNeedsAction","setOnlyNeedsAction","useState","moreFiltersOpen","setMoreFiltersOpen","useRememberedOpen","view","notificationFilter","visible","useMemo","filtered","filterNotifications","notifications","needsAction","grouped","groupNotificationsByDate","moreFiltersActive","anyFilterActive","chooseView","next","updateFilter","clearFilters","resetFilter","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","chips","typeOptions","priorityOptions","topicOptions","topics","topic","readOptions","readValue","InboxHeader","markAllAsRead","PushOptInToggle","SearchField","ViewChips","MoreFiltersButton","NativeSelect","value","group","items","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState","Button","Link","NotificationListFooter","loadMore","unreadCount","onMarkAllAsRead","CheckCheck","Settings","Archive","AdminToolsMenu"],"sources":["../../src/navigation-v2/NotificationInboxV2.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Archive, CheckCheck, Settings } from 'lucide-react';\nimport { Link } from 'react-router';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n IllustratedEmptyState,\n NativeSelect,\n useRememberedOpen,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { needsAction, type InboxView } from './inboxFilters';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { AdminToolsMenu } from './AdminToolsMenu';\nimport { MoreFiltersButton, SearchField, ViewChips } from './FilterControls';\nimport { useNotificationPaths } from './paths';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst ALL = 'ALL';\n\n/**\n * Notifications, Navigation v2 (BOFF-11872, mockup 41). Level 1: the title\n * with the unread count, \"Mark all as read\", \"Notification settings\",\n * \"Archived\", search and the All · Unread · Needs action chips. Level 2: the\n * admin tools under \"More\", and Type, Priority, Topic and the full read state\n * under \"More filters\" (remembered per profile). Same queries as the classic\n * Notification Center.\n */\nexport function NotificationInboxV2() {\n const tr = useTr();\n const paths = useNotificationPaths();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\n unreadCount,\n notificationFilter,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n updateFilter,\n resetFilter,\n } = useNotifications({ baseFilter: CENTER_FILTER, unreadFilter: CENTER_UNREAD_FILTER });\n const { topics } = useNotificationTopics({ isActive: true });\n const [onlyNeedsAction, setOnlyNeedsAction] = useState(false);\n const [moreFiltersOpen, setMoreFiltersOpen] = useRememberedOpen(\n 'notifications.inbox.moreFilters',\n false\n );\n\n const view: InboxView | null = onlyNeedsAction\n ? 'action'\n : notificationFilter.isRead === false\n ? 'unread'\n : notificationFilter.isRead === null\n ? 'all'\n : null;\n\n const visible = useMemo(() => {\n const filtered = filterNotifications(notifications, notificationFilter);\n return onlyNeedsAction ? filtered.filter(needsAction) : filtered;\n }, [notifications, notificationFilter, onlyNeedsAction]);\n const grouped = useMemo(() => groupNotificationsByDate(visible, tr), [visible, tr]);\n\n const moreFiltersActive =\n notificationFilter.type !== ALL ||\n notificationFilter.priority !== ALL ||\n Boolean(notificationFilter.topicId) ||\n notificationFilter.isRead === true;\n const anyFilterActive = Boolean(notificationFilter.search) || moreFiltersActive || view !== 'all';\n\n const chooseView = (next: InboxView) => {\n setOnlyNeedsAction(next === 'action');\n updateFilter({ isRead: next === 'unread' ? false : null });\n };\n\n const clearFilters = () => {\n setOnlyNeedsAction(false);\n resetFilter();\n };\n\n if (permissionsLoading) {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n // The permission-fallback state (NOTIF-CTR-15), unchanged.\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr('notifications.noPermissionView', \"You don't have permission to view notifications.\")}\n </div>\n );\n }\n\n const chips: Array<{ id: InboxView; label: string }> = [\n { id: 'all', label: tr('notifications.filterAll', 'All') },\n { id: 'unread', label: tr('notifications.filterUnread', 'Unread') },\n { id: 'action', label: tr('notifications.v2.needsAction', 'Needs action') },\n ];\n\n const typeOptions = [\n { value: ALL, label: tr('notifications.allTypes', 'All Types') },\n { value: 'SYSTEM', label: tr('notifications.typeSystem', 'System') },\n { value: 'ALERT', label: tr('notifications.typeAlert', 'Alert') },\n { value: 'TRANSACTIONAL', label: tr('notifications.typeTransactional', 'Transactional') },\n { value: 'MARKETING', label: tr('notifications.typeMarketing', 'Marketing') },\n ];\n const priorityOptions = [\n { value: ALL, label: tr('notifications.allPriorities', 'All Priorities') },\n { value: 'URGENT', label: tr('notifications.priorityUrgent', 'Urgent') },\n { value: 'HIGH', label: tr('notifications.priorityHigh', 'High') },\n { value: 'NORMAL', label: tr('notifications.priorityNormal', 'Normal') },\n { value: 'LOW', label: tr('notifications.priorityLow', 'Low') },\n ];\n const topicOptions = [\n { value: ALL, label: tr('notifications.allTopics', 'All Topics') },\n ...topics.map((topic) => ({ value: topic.id, label: topic.name })),\n ];\n const readOptions = [\n { value: 'ALL', label: tr('notifications.filterAll', 'All') },\n { value: 'UNREAD', label: tr('notifications.filterUnread', 'Unread') },\n { value: 'READ', label: tr('notifications.filterRead', 'Read') },\n ];\n const readValue =\n notificationFilter.isRead === null ? 'ALL' : notificationFilter.isRead ? 'READ' : 'UNREAD';\n\n return (\n <div className=\"mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6\">\n <InboxHeader unreadCount={unreadCount} onMarkAllAsRead={markAllAsRead} />\n\n <PushOptInToggle />\n\n <section\n data-tour=\"notification-center-filters\"\n aria-label={tr('notifications.v2.filters', 'Filters')}\n className=\"space-y-3\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center\">\n <SearchField\n label={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(search) => updateFilter({ search })}\n tour=\"notification-center-search\"\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <ViewChips\n chips={chips}\n value={view}\n onChange={chooseView}\n testIdPrefix=\"notifications-view\"\n />\n <MoreFiltersButton\n open={moreFiltersOpen}\n active={moreFiltersActive}\n controls=\"notifications-more-filters\"\n onToggle={() => setMoreFiltersOpen(!moreFiltersOpen)}\n />\n </div>\n </div>\n\n <div\n id=\"notifications-more-filters\"\n hidden={!moreFiltersOpen}\n className=\"grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-2 lg:grid-cols-4\"\n >\n <NativeSelect\n aria-label={tr('notifications.v2.typeFilter', 'Type')}\n options={typeOptions}\n value={notificationFilter.type}\n // The options above are exactly ALL plus the NotificationType values.\n onValueChange={(value) => updateFilter({ type: value as NotificationType | 'ALL' })}\n />\n <NativeSelect\n aria-label={tr('notifications.v2.priorityFilter', 'Priority')}\n options={priorityOptions}\n value={notificationFilter.priority}\n // The options above are exactly ALL plus the NotificationPriority values.\n onValueChange={(value) =>\n updateFilter({ priority: value as NotificationPriority | 'ALL' })\n }\n />\n <NativeSelect\n aria-label={tr('notifications.v2.topicFilter', 'Topic')}\n options={topicOptions}\n value={notificationFilter.topicId || ALL}\n onValueChange={(value) => updateFilter({ topicId: value === ALL ? undefined : value })}\n />\n <NativeSelect\n aria-label={tr('notifications.v2.readFilter', 'Read state')}\n options={readOptions}\n value={readValue}\n onValueChange={(value) => {\n setOnlyNeedsAction(false);\n updateFilter({ isRead: value === 'ALL' ? null : value === 'READ' });\n }}\n />\n </div>\n\n {anyFilterActive && (\n <button\n type=\"button\"\n onClick={clearFilters}\n className=\"text-sm text-text-tertiary transition-colors hover:text-text-primary\"\n >\n {tr('notifications.v2.clearFilters', 'Clear filters')}\n </button>\n )}\n </section>\n\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {visible.length > 0 ? (\n Object.entries(grouped).map(([group, items]) => (\n <section key={group} aria-label={group}>\n <h2 className=\"mb-3 text-sm font-semibold text-text-tertiary\">{group}</h2>\n <div className=\"space-y-2\">\n {items.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n navigationV2\n showTopic={moreFiltersOpen}\n />\n ))}\n </div>\n </section>\n ))\n ) : (\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={\n notifications.length === 0\n ? tr('notifications.v2.emptyTitle', \"You're all caught up\")\n : tr('notifications.noNotificationsFound', 'No notifications found')\n }\n description={\n notifications.length === 0\n ? tr(\n 'notifications.v2.emptyDescription',\n \"Nothing here yet. We'll let you know when something needs you.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n action={\n notifications.length === 0 ? (\n <Button asChild variant=\"outline\">\n <Link to={paths.preferences}>\n {tr('notifications.v2.chooseHow', 'Choose how we reach you')}\n </Link>\n </Button>\n ) : (\n <Button type=\"button\" variant=\"outline\" onClick={clearFilters}>\n {tr('notifications.v2.clearFilters', 'Clear filters')}\n </Button>\n )\n }\n // The server applies the search and the filters, so an empty list says nothing about\n // whether there are notifications: the kind follows the filters. An empty inbox, or an\n // empty Unread / Needs action view, means everything is handled.\n kind={\n notificationFilter.search ? 'no-results' : moreFiltersActive ? 'filtered' : 'all-done'\n }\n />\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={visible.length}\n />\n </div>\n );\n}\n\n/** The inbox header: title with the unread count and the level-1 actions. */\nfunction InboxHeader({\n unreadCount,\n onMarkAllAsRead,\n}: {\n unreadCount: number;\n onMarkAllAsRead: () => void;\n}) {\n const tr = useTr();\n const paths = useNotificationPaths();\n return (\n <header\n data-tour=\"notification-center-header\"\n className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div className=\"min-w-0\">\n <h1 className=\"flex flex-wrap items-center gap-2 text-xl font-semibold text-text-primary sm:text-2xl\">\n {tr('notifications.v2.title', 'Notifications')}\n {unreadCount > 0 && (\n <span\n data-tour=\"notification-center-unread-count\"\n className=\"inline-flex items-center gap-1.5 rounded-full bg-accent-primary/10 px-2.5 py-0.5 text-sm font-medium text-accent-primary\"\n >\n <span\n className=\"inline-block h-2 w-2 rounded-full bg-accent-primary\"\n aria-hidden=\"true\"\n />\n {tr('notifications.v2.unreadCount', '{{count}} unread', { count: unreadCount })}\n </span>\n )}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr('notifications.v2.subtitle', 'Everything the platform told you, in one place.')}\n </p>\n </div>\n <div className=\"flex flex-wrap items-center gap-2\">\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={onMarkAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.markAllAsRead', 'Mark all as read')}\n </Button>\n )}\n <Button asChild variant=\"outline\" className=\"gap-2\">\n <Link to={paths.preferences} data-testid=\"notifications-settings-link\">\n <Settings size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.settings', 'Notification settings')}\n </Link>\n </Button>\n <Button asChild variant=\"ghost\" className=\"gap-2\">\n <Link to={paths.archived} data-testid=\"notifications-archived-link\">\n <Archive size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.archived', 'Archived')}\n </Link>\n </Button>\n <AdminToolsMenu />\n </div>\n </header>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBA,IAAMA,IAAgB;CAAE,UAAU;CAAO,SAAS;AAAkB,GAC9DC,IAAuB,EAAE,SAAS,SAAS,GAC3CC,IAAM;AAUZ,SAAgBC,IAAsB;CACpC,IAAMC,IAAKC,EAAM,GACXC,IAAQC,EAAqB,GAC7B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,GACvClE,EAAG,6BAA6B,uBAAuB,CACpD;;IACA,CAAA;IACR,kBAAC2D,GAAD;KAAQ,SAAA;KAAQ,SAAQ;KAAQ,WAAU;KACxC,UAAA,kBAACC,GAAD;MAAM,IAAI1D,EAAM;MAAU,eAAY;MAAtC,UAAA,CACE,kBAACiE,GAAD;OAAS,MAAM;OAAI,eAAY;MAAQ,CAAA,GACtCnE,EAAG,6BAA6B,UAAU,CACvC;;IACA,CAAA;IACR,kBAACoE,GAAD,CAAiB,CAAA;GACd;EACC,CAAA,CAAA;;AAEZ"}
1
+ {"version":3,"file":"NotificationInboxV2.js","names":["CENTER_FILTER","CENTER_UNREAD_FILTER","ALL","NotificationInboxV2","tr","useTr","paths","useNotificationPaths","permissionsLoading","usePermissions","useNotification","useNotifications","useNotificationTopics","onlyNeedsAction","setOnlyNeedsAction","useState","moreFiltersOpen","setMoreFiltersOpen","useRememberedOpen","view","notificationFilter","visible","useMemo","filtered","filterNotifications","notifications","needsAction","grouped","groupNotificationsByDate","moreFiltersActive","anyFilterActive","chooseView","next","updateFilter","clearFilters","resetFilter","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","chips","typeOptions","priorityOptions","topicOptions","topics","topic","readOptions","readValue","InboxHeader","markAllAsRead","PushOptInToggle","SearchField","ViewChips","MoreFiltersButton","NativeSelect","value","group","items","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState","Button","Link","NotificationListFooter","loadMore","unreadCount","onMarkAllAsRead","CheckCheck","Settings","Archive","AdminToolsMenu"],"sources":["../../src/navigation-v2/NotificationInboxV2.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Archive, CheckCheck, Settings } from 'lucide-react';\nimport { Link } from 'react-router';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n IllustratedEmptyState,\n NativeSelect,\n useRememberedOpen,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { needsAction, type InboxView } from './inboxFilters';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { AdminToolsMenu } from './AdminToolsMenu';\nimport { MoreFiltersButton, SearchField, ViewChips } from './FilterControls';\nimport { useNotificationPaths } from './paths';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst CENTER_FILTER = { archived: false, channel: 'IN_APP' as const };\nconst CENTER_UNREAD_FILTER = { channel: 'IN_APP' };\nconst ALL = 'ALL';\n\n/**\n * Notifications, Navigation v2 (BOFF-11872, mockup 41). Level 1: the title\n * with the unread count, \"Mark all as read\", \"Notification settings\",\n * \"Archived\", search and the All · Unread · Needs action chips. Level 2: the\n * admin tools under \"More\", and Type, Priority, Topic and the full read state\n * under \"More filters\" (remembered per profile). Same queries as the classic\n * Notification Center.\n */\nexport function NotificationInboxV2() {\n const tr = useTr();\n const paths = useNotificationPaths();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\n unreadCount,\n notificationFilter,\n markAsRead,\n markAllAsRead,\n archiveNotification,\n recordAction,\n updateFilter,\n resetFilter,\n } = useNotifications({ baseFilter: CENTER_FILTER, unreadFilter: CENTER_UNREAD_FILTER });\n const { topics } = useNotificationTopics({ isActive: true });\n const [onlyNeedsAction, setOnlyNeedsAction] = useState(false);\n const [moreFiltersOpen, setMoreFiltersOpen] = useRememberedOpen(\n 'notifications.inbox.moreFilters',\n false\n );\n\n const view: InboxView | null = onlyNeedsAction\n ? 'action'\n : notificationFilter.isRead === false\n ? 'unread'\n : notificationFilter.isRead === null\n ? 'all'\n : null;\n\n const visible = useMemo(() => {\n const filtered = filterNotifications(notifications, notificationFilter);\n return onlyNeedsAction ? filtered.filter(needsAction) : filtered;\n }, [notifications, notificationFilter, onlyNeedsAction]);\n const grouped = useMemo(() => groupNotificationsByDate(visible, tr), [visible, tr]);\n\n const moreFiltersActive =\n notificationFilter.type !== ALL ||\n notificationFilter.priority !== ALL ||\n Boolean(notificationFilter.topicId) ||\n notificationFilter.isRead === true;\n const anyFilterActive = Boolean(notificationFilter.search) || moreFiltersActive || view !== 'all';\n\n const chooseView = (next: InboxView) => {\n setOnlyNeedsAction(next === 'action');\n updateFilter({ isRead: next === 'unread' ? false : null });\n };\n\n const clearFilters = () => {\n setOnlyNeedsAction(false);\n resetFilter();\n };\n\n if (permissionsLoading) {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n }\n\n // The permission-fallback state (NOTIF-CTR-15), unchanged.\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr('notifications.noPermissionView', \"You don't have permission to view notifications.\")}\n </div>\n );\n }\n\n const chips: Array<{ id: InboxView; label: string }> = [\n { id: 'all', label: tr('notifications.filterAll', 'All') },\n { id: 'unread', label: tr('notifications.filterUnread', 'Unread') },\n { id: 'action', label: tr('notifications.v2.needsAction', 'Needs action') },\n ];\n\n const typeOptions = [\n { value: ALL, label: tr('notifications.allTypes', 'All Types') },\n { value: 'SYSTEM', label: tr('notifications.typeSystem', 'System') },\n { value: 'ALERT', label: tr('notifications.typeAlert', 'Alert') },\n { value: 'TRANSACTIONAL', label: tr('notifications.typeTransactional', 'Transactional') },\n { value: 'MARKETING', label: tr('notifications.typeMarketing', 'Marketing') },\n ];\n const priorityOptions = [\n { value: ALL, label: tr('notifications.allPriorities', 'All Priorities') },\n { value: 'URGENT', label: tr('notifications.priorityUrgent', 'Urgent') },\n { value: 'HIGH', label: tr('notifications.priorityHigh', 'High') },\n { value: 'NORMAL', label: tr('notifications.priorityNormal', 'Normal') },\n { value: 'LOW', label: tr('notifications.priorityLow', 'Low') },\n ];\n const topicOptions = [\n { value: ALL, label: tr('notifications.allTopics', 'All Topics') },\n ...topics.map((topic) => ({ value: topic.id, label: topic.name })),\n ];\n const readOptions = [\n { value: 'ALL', label: tr('notifications.filterAll', 'All') },\n { value: 'UNREAD', label: tr('notifications.filterUnread', 'Unread') },\n { value: 'READ', label: tr('notifications.filterRead', 'Read') },\n ];\n const readValue =\n notificationFilter.isRead === null ? 'ALL' : notificationFilter.isRead ? 'READ' : 'UNREAD';\n\n return (\n <div className=\"mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6\">\n <InboxHeader unreadCount={unreadCount} onMarkAllAsRead={markAllAsRead} />\n\n <PushOptInToggle />\n\n <section\n data-tour=\"notification-center-filters\"\n aria-label={tr('notifications.v2.filters', 'Filters')}\n className=\"space-y-3\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center\">\n <SearchField\n label={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(search) => updateFilter({ search })}\n tour=\"notification-center-search\"\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <ViewChips\n chips={chips}\n value={view}\n onChange={chooseView}\n testIdPrefix=\"notifications-view\"\n />\n <MoreFiltersButton\n open={moreFiltersOpen}\n active={moreFiltersActive}\n controls=\"notifications-more-filters\"\n onToggle={() => setMoreFiltersOpen(!moreFiltersOpen)}\n />\n </div>\n </div>\n\n <div\n id=\"notifications-more-filters\"\n hidden={!moreFiltersOpen}\n className=\"grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-2 lg:grid-cols-4\"\n >\n <NativeSelect\n aria-label={tr('notifications.v2.typeFilter', 'Type')}\n options={typeOptions}\n value={notificationFilter.type}\n // The options above are exactly ALL plus the NotificationType values.\n onValueChange={(value) => updateFilter({ type: value as NotificationType | 'ALL' })}\n />\n <NativeSelect\n aria-label={tr('notifications.v2.priorityFilter', 'Priority')}\n options={priorityOptions}\n value={notificationFilter.priority}\n // The options above are exactly ALL plus the NotificationPriority values.\n onValueChange={(value) =>\n updateFilter({ priority: value as NotificationPriority | 'ALL' })\n }\n />\n <NativeSelect\n aria-label={tr('notifications.v2.topicFilter', 'Topic')}\n options={topicOptions}\n value={notificationFilter.topicId || ALL}\n onValueChange={(value) => updateFilter({ topicId: value === ALL ? undefined : value })}\n />\n <NativeSelect\n aria-label={tr('notifications.v2.readFilter', 'Read state')}\n options={readOptions}\n value={readValue}\n onValueChange={(value) => {\n setOnlyNeedsAction(false);\n updateFilter({ isRead: value === 'ALL' ? null : value === 'READ' });\n }}\n />\n </div>\n\n {anyFilterActive && (\n <button\n type=\"button\"\n onClick={clearFilters}\n className=\"text-sm text-text-tertiary transition-colors hover:text-text-primary\"\n >\n {tr('notifications.v2.clearFilters', 'Clear filters')}\n </button>\n )}\n </section>\n\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {visible.length > 0 ? (\n Object.entries(grouped).map(([group, items]) => (\n <section key={group} aria-label={group}>\n <h2 className=\"mb-3 text-sm font-semibold text-text-tertiary\">{group}</h2>\n <div className=\"space-y-2\">\n {items.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n navigationV2\n showTopic={moreFiltersOpen}\n />\n ))}\n </div>\n </section>\n ))\n ) : (\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={\n notifications.length === 0\n ? tr('notifications.v2.emptyTitle', \"You're all caught up\")\n : tr('notifications.noNotificationsFound', 'No notifications found')\n }\n description={\n notifications.length === 0\n ? tr(\n 'notifications.v2.emptyDescription',\n \"Nothing here yet. We'll let you know when something needs you.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n action={\n notifications.length === 0 ? (\n <Button asChild variant=\"outline\">\n <Link to={paths.preferences}>\n {tr('notifications.v2.chooseHow', 'Choose how we reach you')}\n </Link>\n </Button>\n ) : (\n <Button type=\"button\" variant=\"outline\" onClick={clearFilters}>\n {tr('notifications.v2.clearFilters', 'Clear filters')}\n </Button>\n )\n }\n // The server applies the search and the filters, so an empty list says nothing about\n // whether there are notifications: the kind follows the filters. An empty inbox, or an\n // empty Unread / Needs action view, means everything is handled.\n kind={\n notificationFilter.search ? 'no-results' : moreFiltersActive ? 'filtered' : 'all-done'\n }\n />\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={visible.length}\n />\n </div>\n );\n}\n\n/** The inbox header: title with the unread count and the level-1 actions. */\nfunction InboxHeader({\n unreadCount,\n onMarkAllAsRead,\n}: {\n unreadCount: number;\n onMarkAllAsRead: () => void;\n}) {\n const tr = useTr();\n const paths = useNotificationPaths();\n return (\n <header\n data-tour=\"notification-center-header\"\n className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div className=\"min-w-0\">\n <h1 className=\"flex flex-wrap items-center gap-2 text-xl font-semibold text-text-primary sm:text-2xl\">\n {tr('notifications.v2.title', 'Notifications')}\n {unreadCount > 0 && (\n <span\n data-tour=\"notification-center-unread-count\"\n className=\"inline-flex items-center gap-1.5 rounded-full bg-accent-primary/10 px-2.5 py-0.5 text-sm font-medium text-accent-primary\"\n >\n <span\n className=\"inline-block h-2 w-2 rounded-full bg-accent-primary\"\n aria-hidden=\"true\"\n />\n {tr('notifications.v2.unreadCount', '{{count}} unread', { count: unreadCount })}\n </span>\n )}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr('notifications.v2.subtitle', 'Everything the platform told you, in one place.')}\n </p>\n </div>\n <div className=\"flex flex-wrap items-center gap-2\">\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={onMarkAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.markAllAsRead', 'Mark all as read')}\n </Button>\n )}\n <Button asChild variant=\"outline\" className=\"gap-2\">\n <Link to={paths.preferences} data-testid=\"notifications-settings-link\">\n <Settings size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.settings', 'Notification settings')}\n </Link>\n </Button>\n <Button asChild variant=\"ghost\" className=\"gap-2\">\n <Link to={paths.archived} data-testid=\"notifications-archived-link\">\n <Archive size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.archived', 'Archived')}\n </Link>\n </Button>\n <AdminToolsMenu />\n </div>\n </header>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAMA,IAAgB;CAAE,UAAU;CAAO,SAAS;AAAkB,GAC9DC,IAAuB,EAAE,SAAS,SAAS,GAC3CC,IAAM;AAUZ,SAAgBC,IAAsB;CACpC,IAAMC,IAAKC,EAAM,GACXC,IAAQC,EAAqB,GAC7B,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBC,EAAgB,GAClC,EACJ,kBACA,YACA,kBACA,aACA,gBACA,uBACA,eACA,kBACA,wBACA,kBACA,iBACA,mBACEC,EAAiB;EAAE,YAAYX;EAAe,cAAcC;CAAqB,CAAC,GAChF,EAAE,cAAWW,EAAsB,EAAE,UAAU,GAAK,CAAC,GACrD,CAACC,GAAiBC,KAAsBC,EAAS,EAAK,GACtD,CAACC,GAAiBC,KAAsBC,EAC5C,mCACA,EACF,GAEMC,IAAyBN,IAC3B,WACAO,EAAmB,WAAW,KAC5B,WACAA,EAAmB,W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