@burdenoff/microfe-notification 2026.1125.1 → 2026.1129.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 (161) hide show
  1. package/dist/NotificationRoutes.d.ts +10 -0
  2. package/dist/NotificationRoutes.js +76 -71
  3. package/dist/NotificationRoutes.js.map +1 -1
  4. package/dist/components/NotificationPanel.js +0 -1
  5. package/dist/components/NotificationPanel.js.map +1 -1
  6. package/dist/generated/global-operations.d.ts +58 -3
  7. package/dist/generated/global-operations.js +31 -23
  8. package/dist/generated/global-operations.js.map +1 -1
  9. package/dist/generated/global-types.d.ts +10933 -581
  10. package/dist/graphql/global-client.js +34 -34
  11. package/dist/hooks/useNotificationAnalytics.d.ts +1 -1
  12. package/dist/hooks/useNotificationAnalytics.js.map +1 -1
  13. package/dist/hooks/useNotifications.d.ts +7 -0
  14. package/dist/hooks/useNotifications.js +1 -1
  15. package/dist/hooks/useNotifications.js.map +1 -1
  16. package/dist/index.js +9 -11
  17. package/dist/navigation-v2/NotificationArchivedV2.js +7 -8
  18. package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
  19. package/dist/navigation-v2/NotificationInboxV2.js +8 -9
  20. package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
  21. package/dist/navigation-v2/NotificationSettingsV2.js +0 -1
  22. package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -1
  23. package/dist/pages/NotificationCenterPage.js +5 -6
  24. package/dist/pages/NotificationCenterPage.js.map +1 -1
  25. package/dist/pages/NotificationHistoryAdminPage.js +9 -10
  26. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  27. package/dist/pages/NotificationHistoryPage.js +5 -6
  28. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  29. package/dist/pages/NotificationPreferencesPage.js +0 -1
  30. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  31. package/dist/pages/NotificationTopicsPage.js +0 -1
  32. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  33. package/dist/translations/en.d.ts +80 -0
  34. package/dist/types/index.d.ts +2 -1
  35. package/dist/v2/ArchivedRedirect.d.ts +1 -0
  36. package/dist/v2/ArchivedRedirect.js +14 -0
  37. package/dist/v2/ArchivedRedirect.js.map +1 -0
  38. package/dist/v2/InboxPage.d.ts +1 -0
  39. package/dist/v2/InboxPage.js +191 -0
  40. package/dist/v2/InboxPage.js.map +1 -0
  41. package/dist/v2/InboxRows.d.ts +10 -0
  42. package/dist/v2/InboxRows.js +101 -0
  43. package/dist/v2/InboxRows.js.map +1 -0
  44. package/dist/v2/KindIcon.d.ts +4 -0
  45. package/dist/v2/KindIcon.js +33 -0
  46. package/dist/v2/KindIcon.js.map +1 -0
  47. package/dist/v2/NotificationDetailPanel.d.ts +7 -0
  48. package/dist/v2/NotificationDetailPanel.js +200 -0
  49. package/dist/v2/NotificationDetailPanel.js.map +1 -0
  50. package/dist/v2/PreferencesPage.d.ts +1 -0
  51. package/dist/v2/PreferencesPage.js +139 -0
  52. package/dist/v2/PreferencesPage.js.map +1 -0
  53. package/dist/v2/__tests__/routeShapes.d.ts +13 -0
  54. package/dist/v2/model/days.d.ts +9 -0
  55. package/dist/v2/model/days.js +25 -0
  56. package/dist/v2/model/days.js.map +1 -0
  57. package/dist/v2/model/events.d.ts +17 -0
  58. package/dist/v2/model/events.js +72 -0
  59. package/dist/v2/model/events.js.map +1 -0
  60. package/dist/v2/model/icons.d.ts +6 -0
  61. package/dist/v2/model/icons.js +19 -0
  62. package/dist/v2/model/icons.js.map +1 -0
  63. package/dist/v2/model/inbox.d.ts +15 -0
  64. package/dist/v2/model/inbox.js +22 -0
  65. package/dist/v2/model/inbox.js.map +1 -0
  66. package/dist/v2/model/thing.d.ts +16 -0
  67. package/dist/v2/model/thing.js +41 -0
  68. package/dist/v2/model/thing.js.map +1 -0
  69. package/dist/v2/model/tr.d.ts +2 -0
  70. package/dist/v2/useNotificationDetail.d.ts +19 -0
  71. package/dist/v2/useNotificationDetail.js +65 -0
  72. package/dist/v2/useNotificationDetail.js.map +1 -0
  73. package/package.json +5 -2
  74. package/dist/components/index.js +0 -4
  75. package/dist/hooks/index.js +0 -8
  76. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +0 -23
  77. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +0 -1
  78. package/dist/node_modules/@apollo/client/errors/utils.js +0 -15
  79. package/dist/node_modules/@apollo/client/errors/utils.js.map +0 -1
  80. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +0 -51
  81. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +0 -1
  82. package/dist/node_modules/@apollo/client/link/subscriptions/index.js +0 -40
  83. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +0 -1
  84. package/dist/node_modules/@apollo/client/link/utils/createOperation.js +0 -33
  85. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +0 -1
  86. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -5
  87. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +0 -1
  88. package/dist/node_modules/@apollo/client/utilities/graphql/print.js +0 -15
  89. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +0 -1
  90. package/dist/node_modules/@apollo/client/utilities/internal/caches.js +0 -18
  91. package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +0 -1
  92. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +0 -20
  93. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +0 -1
  94. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +0 -16
  95. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +0 -1
  96. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +0 -8
  97. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +0 -1
  98. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +0 -8
  99. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +0 -1
  100. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +0 -7
  101. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +0 -1
  102. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +0 -8
  103. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +0 -1
  104. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +0 -9
  105. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +0 -1
  106. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +0 -7
  107. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +0 -1
  108. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +0 -9
  109. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +0 -1
  110. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +0 -22
  111. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +0 -1
  112. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +0 -9
  113. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +0 -1
  114. package/dist/node_modules/@apollo/client/utilities/invariant/index.js +0 -56
  115. package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +0 -1
  116. package/dist/node_modules/@apollo/client/version.js +0 -5
  117. package/dist/node_modules/@apollo/client/version.js.map +0 -1
  118. package/dist/node_modules/@wry/caches/lib/weak.js +0 -66
  119. package/dist/node_modules/@wry/caches/lib/weak.js.map +0 -1
  120. package/dist/node_modules/@wry/trie/lib/index.js +0 -52
  121. package/dist/node_modules/@wry/trie/lib/index.js.map +0 -1
  122. package/dist/node_modules/graphql-ws/dist/client.js +0 -279
  123. package/dist/node_modules/graphql-ws/dist/client.js.map +0 -1
  124. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +0 -61
  125. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +0 -1
  126. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +0 -20
  127. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +0 -1
  128. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +0 -77
  129. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +0 -1
  130. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +0 -116
  131. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +0 -1
  132. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +0 -96
  133. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +0 -1
  134. package/dist/node_modules/rxjs/dist/esm5/internal/config.js +0 -11
  135. package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +0 -1
  136. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +0 -8
  137. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +0 -1
  138. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +0 -15
  139. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +0 -1
  140. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +0 -7
  141. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +0 -1
  142. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +0 -12
  143. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +0 -1
  144. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -10
  145. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +0 -1
  146. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +0 -10
  147. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +0 -1
  148. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +0 -21
  149. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +0 -1
  150. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -7
  151. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +0 -1
  152. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -7
  153. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +0 -1
  154. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -5
  155. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +0 -1
  156. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +0 -12
  157. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +0 -1
  158. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +0 -13
  159. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +0 -1
  160. package/dist/node_modules/tslib/tslib.es6.js +0 -51
  161. package/dist/node_modules/tslib/tslib.es6.js.map +0 -1
@@ -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","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,eAC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uBAAuB,CACpD;;IACA,CAAA;IACR,kBAAC6D,GAAD;KAAQ,SAAA;KAAQ,SAAQ;KAAQ,WAAU;KACxC,UAAA,kBAACC,GAAD;MAAM,IAAI5D,EAAM;MAAU,eAAY;MAAtC,UAAA,CACE,kBAACmE,GAAD;OAAS,MAAM;OAAI,eAAY;MAAQ,CAAA,GACtCrE,EAAG,6BAA6B,UAAU,CACvC;;IACA,CAAA;IACR,kBAACsE,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,GAAsB,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,WAAW,OAC5B,QACA,MAEFC,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AA,CAAA;;AAEZ"}
@@ -1,6 +1,5 @@
1
1
  import { NOTIFICATION_PERMISSIONS as e } from "../constants/permissions.js";
2
2
  import { useNotificationTopics as t } from "../hooks/useNotificationTopics.js";
3
- import "../hooks/index.js";
4
3
  import { preferenceKey as n, usePreferenceToggles as r } from "../hooks/usePreferenceToggles.js";
5
4
  import { useNotification as i } from "../providers/NotificationProvider.js";
6
5
  import { useTr as a } from "../shared/hooks/useTr.js";
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationSettingsV2.js","names":["SwitchRow","tr","useTr","id","useId","testId","title","description","saving","checked","Switch","onToggle","onUseDefault","DropdownMenu","DropdownMenuTrigger","Button","MoreHorizontal","DropdownMenuContent","DropdownMenuItem","feedback","Section","NotificationSettingsV2","permissionsLoading","usePermissions","useNotification","topicsLoading","topicsForbidden","useNotificationTopics","usePreferenceToggles","search","setSearch","useState","filteredTopics","useMemo","query","topics","topic","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","row","key","preferenceKey","target","existing","preferencesByKey","enabled","options","savingKey","saveFeedback","togglePreference","resetPreference","showTopics","BackToNotifications","EVERYDAY_CHANNELS","channel","OptionalFields","MORE_CHANNELS","TYPES","type","Search","Input","event"],"sources":["../../src/navigation-v2/NotificationSettingsV2.tsx"],"sourcesContent":["import { useId, useMemo, useState } from 'react';\nimport { MoreHorizontal, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n Input,\n OptionalFields,\n Switch,\n} from '@burdenoff/fe-libs/ui';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotificationTopics } from '../hooks';\nimport {\n preferenceKey,\n usePreferenceToggles,\n type PreferenceFeedback,\n type PreferenceTarget,\n} from '../hooks/usePreferenceToggles';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { BackToNotifications } from './BackToNotifications';\nimport { EVERYDAY_CHANNELS, MORE_CHANNELS, TYPES } from './settingsOptions';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\ninterface SwitchRowProps {\n title: string;\n description?: string;\n checked: boolean;\n saving: boolean;\n feedback: PreferenceFeedback | null;\n onToggle: () => void;\n /** Present when the person changed this one: \"Use default\" removes their choice. */\n onUseDefault?: () => void;\n testId?: string;\n}\n\nfunction SwitchRow({\n title,\n description,\n checked,\n saving,\n feedback,\n onToggle,\n onUseDefault,\n testId,\n}: SwitchRowProps) {\n const tr = useTr();\n const id = useId();\n return (\n <div className=\"py-3\" data-testid={testId}>\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <label htmlFor={id} className=\"text-sm font-medium text-text-primary\">\n {title}\n </label>\n {description && <p className=\"text-sm text-text-secondary\">{description}</p>}\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n <span className=\"w-8 text-right text-sm text-text-secondary\" aria-hidden=\"true\">\n {saving\n ? '…'\n : checked\n ? tr('notifications.v2.on', 'On')\n : tr('notifications.v2.off', 'Off')}\n </span>\n <Switch id={id} checked={checked} disabled={saving} onCheckedChange={onToggle} />\n {onUseDefault && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={tr('notifications.v2.rowActions', 'More for {{name}}', {\n name: title,\n })}\n >\n <MoreHorizontal size={16} aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem disabled={saving} onSelect={onUseDefault}>\n {tr('notifications.v2.useDefault', 'Use default')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n <div className=\"min-h-5\" aria-live=\"polite\">\n {feedback && (\n <p\n className={`text-xs ${feedback.type === 'success' ? 'text-status-success-text' : 'text-status-error-text'}`}\n >\n {feedback.message}\n </p>\n )}\n </div>\n </div>\n );\n}\n\nfunction Section({\n title,\n description,\n children,\n testId,\n}: {\n title?: string;\n description?: string;\n children: React.ReactNode;\n testId?: string;\n}) {\n return (\n <section\n data-tour={testId}\n className=\"rounded-lg border border-border-seam bg-bg-surface px-4 py-2\"\n >\n {title && <h2 className=\"pt-2 text-base font-semibold text-text-primary\">{title}</h2>}\n {description && <p className=\"text-sm text-text-secondary\">{description}</p>}\n <div className=\"divide-y divide-border-seam\">{children}</div>\n </section>\n );\n}\n\n/**\n * Notification settings, Navigation v2 (BOFF-11872, mockup 48): \"how to reach\n * you\" first. \"Pause all notifications\" and the In-app, Email and Push\n * switches lead; SMS, WhatsApp, Slack and the type toggles sit under one\n * \"More options\"; the opt-in topics show only when there are any. \"Reset\" is\n * \"Use default\" in each row's \"⋯\". Every switch makes the same calls as the\n * classic Preferences page.\n */\nexport function NotificationSettingsV2() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n topics,\n isLoading: topicsLoading,\n isForbidden: topicsForbidden,\n } = useNotificationTopics({ type: 'MARKETING', isActive: true });\n const { preferencesByKey, savingKey, saveFeedback, togglePreference, resetPreference } =\n usePreferenceToggles();\n const [search, setSearch] = useState('');\n\n const filteredTopics = useMemo(() => {\n const query = search.trim().toLowerCase();\n if (!query) return topics;\n return topics.filter(\n (topic) =>\n topic.name.toLowerCase().includes(query) ||\n topic.slug.toLowerCase().includes(query) ||\n topic.description?.toLowerCase().includes(query)\n );\n }, [search, topics]);\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.noPermissionPreferences',\n \"You don't have permission to manage notification preferences.\"\n )}\n </div>\n );\n }\n\n const row = (\n target: PreferenceTarget,\n title: string,\n options: { description?: string; inverted?: boolean } = {}\n ) => {\n const key = preferenceKey(target);\n const existing = preferencesByKey.get(key);\n const enabled = existing?.enabled ?? true;\n return (\n <SwitchRow\n key={key}\n testId={`notification-setting-${key}`}\n title={title}\n description={options.description}\n // \"Pause all\" reads the other way round: on means delivery is off.\n checked={options.inverted ? !enabled : enabled}\n saving={savingKey === key}\n feedback={saveFeedback?.key === key ? saveFeedback : null}\n onToggle={() => void togglePreference(target)}\n onUseDefault={existing ? () => void resetPreference(key) : undefined}\n />\n );\n };\n\n const showTopics = !topicsLoading && !topicsForbidden && topics.length > 0;\n\n return (\n <div\n data-tour=\"notification-preferences-page\"\n className=\"mx-auto w-full max-w-3xl space-y-4 p-3 sm:space-y-5 sm:p-6\"\n >\n <BackToNotifications />\n <header>\n <h1 className=\"text-xl font-semibold text-text-primary sm:text-2xl\">\n {tr('notifications.v2.settingsTitle', 'Notification settings')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr('notifications.v2.settingsSubtitle', 'How and when we reach you.')}\n </p>\n </header>\n\n <Section testId=\"notification-preferences-global\">\n {row({ scope: 'GLOBAL' }, tr('notifications.v2.pauseAll', 'Pause all notifications'), {\n description: tr(\n 'notifications.v2.pauseAllDescription',\n 'Stop every notification on every channel until you turn this off.'\n ),\n inverted: true,\n })}\n </Section>\n\n <Section\n testId=\"notification-preferences-channels\"\n title={tr('notifications.v2.howToReachYou', 'How to reach you')}\n >\n {EVERYDAY_CHANNELS.map((channel) =>\n row({ scope: 'CHANNEL', channel: channel.value }, tr(channel.labelKey, channel.label))\n )}\n </Section>\n\n <OptionalFields storageKey=\"notifications.settings.more\">\n <div className=\"space-y-4\">\n <Section title={tr('notifications.v2.moreChannels', 'Other ways to reach you')}>\n {MORE_CHANNELS.map((channel) =>\n row({ scope: 'CHANNEL', channel: channel.value }, tr(channel.labelKey, channel.label))\n )}\n </Section>\n <Section\n testId=\"notification-preferences-types\"\n title={tr('notifications.v2.whatWeSend', 'What we send you')}\n >\n {TYPES.map((type) =>\n row({ scope: 'TYPE', type: type.value }, tr(type.labelKey, type.label))\n )}\n </Section>\n </div>\n </OptionalFields>\n\n {showTopics && (\n <Section\n testId=\"notification-preferences-topics\"\n title={tr('notifications.v2.optInTopics', 'Updates you can opt into')}\n >\n {topics.length > 5 && (\n <div className=\"relative py-3\">\n <Search\n size={16}\n className=\"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-text-tertiary\"\n aria-hidden=\"true\"\n />\n <Input\n type=\"search\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n aria-label={tr('notifications.searchTopics', 'Search topics...')}\n placeholder={tr('notifications.searchTopics', 'Search topics...')}\n className=\"pl-9\"\n />\n </div>\n )}\n {filteredTopics.length === 0 ? (\n <p className=\"py-3 text-sm text-text-secondary\">\n {tr('notifications.noTopicsFound', 'No topics match your search')}\n </p>\n ) : (\n filteredTopics.map((topic) =>\n row({ scope: 'TOPIC', topicId: topic.id }, topic.name, {\n description: topic.description || undefined,\n })\n )\n )}\n </Section>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAuCA,SAASA,EAAU,EACjB,UACA,gBACA,YACA,WACA,aACA,aACA,iBACA,aACiB;CACjB,IAAMC,IAAKC,EAAM,GACXC,IAAKC,EAAM;CACjB,OACE,kBAAC,OAAD;EAAK,WAAU;EAAO,eAAaC;EAAnC,UAAA,CACE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,SAAD;KAAO,SAASF;KAAI,WAAU;KAC3B,UAAAG;IACI,CAAA,GACNC,KAAe,kBAAC,KAAD;KAAG,WAAU;KAA+B,UAAAA;IAAe,CAAA,CACxE;GACL,CAA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AE,OAAO;OAAQ,MAAMmB,EAAK;MAAM,GAAG5D,EAAG4D,EAAK,UAAUA,EAAK,KAAK,CAAC,CACxE;KACO,CAAA,CACN;;GACS,CAAA;GAEfP,KACC,kBAAClC,GAAD;IACE,QAAO;IACP,OAAOnB,EAAG,gCAAgC,0BAA0B;IAFtE,UAAA,CAIGkC,EAAO,SAAS,KACf,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,kBAAC2B,GAAD;MACE,MAAM;MACN,WAAU;MACV,eAAY;KACb,CAAA,GACD,kBAACC,GAAD;MACE,MAAK;MACL,OAAOlC;MACP,WAAW,MAAUC,EAAUkC,EAAM,OAAO,KAAK;MACjD,cAAY/D,EAAG,8BAA8B,kBAAkB;MAC/D,aAAaA,EAAG,8BAA8B,kBAAkB;MAChE,WAAU;KACX,CAAA,CACE;IAEN,CAAA,GAAA+B,EAAe,WAAW,IACzB,kBAAC,KAAD;KAAG,WAAU;KACV,UAAA/B,EAAG,+BAA+B,6BAA6B;IAC/D,CAAA,IAEH+B,EAAe,KAAK,MAClBU,EAAI;KAAE,OAAO;KAAS,SAASN,EAAM;IAAG,GAAGA,EAAM,MAAM,EACrD,aAAaA,EAAM,eAAe,KAAA,EACpC,CAAC,CACH,CAEK;;EAER;;AAET"}
1
+ {"version":3,"file":"NotificationSettingsV2.js","names":["SwitchRow","tr","useTr","id","useId","testId","title","description","saving","checked","Switch","onToggle","onUseDefault","DropdownMenu","DropdownMenuTrigger","Button","MoreHorizontal","DropdownMenuContent","DropdownMenuItem","feedback","Section","NotificationSettingsV2","permissionsLoading","usePermissions","useNotification","topicsLoading","topicsForbidden","useNotificationTopics","usePreferenceToggles","search","setSearch","useState","filteredTopics","useMemo","query","topics","topic","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","row","key","preferenceKey","target","existing","preferencesByKey","enabled","options","savingKey","saveFeedback","togglePreference","resetPreference","showTopics","BackToNotifications","EVERYDAY_CHANNELS","channel","OptionalFields","MORE_CHANNELS","TYPES","type","Search","Input","event"],"sources":["../../src/navigation-v2/NotificationSettingsV2.tsx"],"sourcesContent":["import { useId, useMemo, useState } from 'react';\nimport { MoreHorizontal, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n Input,\n OptionalFields,\n Switch,\n} from '@burdenoff/fe-libs/ui';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotificationTopics } from '../hooks';\nimport {\n preferenceKey,\n usePreferenceToggles,\n type PreferenceFeedback,\n type PreferenceTarget,\n} from '../hooks/usePreferenceToggles';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { BackToNotifications } from './BackToNotifications';\nimport { EVERYDAY_CHANNELS, MORE_CHANNELS, TYPES } from './settingsOptions';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\ninterface SwitchRowProps {\n title: string;\n description?: string;\n checked: boolean;\n saving: boolean;\n feedback: PreferenceFeedback | null;\n onToggle: () => void;\n /** Present when the person changed this one: \"Use default\" removes their choice. */\n onUseDefault?: () => void;\n testId?: string;\n}\n\nfunction SwitchRow({\n title,\n description,\n checked,\n saving,\n feedback,\n onToggle,\n onUseDefault,\n testId,\n}: SwitchRowProps) {\n const tr = useTr();\n const id = useId();\n return (\n <div className=\"py-3\" data-testid={testId}>\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"min-w-0\">\n <label htmlFor={id} className=\"text-sm font-medium text-text-primary\">\n {title}\n </label>\n {description && <p className=\"text-sm text-text-secondary\">{description}</p>}\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n <span className=\"w-8 text-right text-sm text-text-secondary\" aria-hidden=\"true\">\n {saving\n ? '…'\n : checked\n ? tr('notifications.v2.on', 'On')\n : tr('notifications.v2.off', 'Off')}\n </span>\n <Switch id={id} checked={checked} disabled={saving} onCheckedChange={onToggle} />\n {onUseDefault && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={tr('notifications.v2.rowActions', 'More for {{name}}', {\n name: title,\n })}\n >\n <MoreHorizontal size={16} aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem disabled={saving} onSelect={onUseDefault}>\n {tr('notifications.v2.useDefault', 'Use default')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n <div className=\"min-h-5\" aria-live=\"polite\">\n {feedback && (\n <p\n className={`text-xs ${feedback.type === 'success' ? 'text-status-success-text' : 'text-status-error-text'}`}\n >\n {feedback.message}\n </p>\n )}\n </div>\n </div>\n );\n}\n\nfunction Section({\n title,\n description,\n children,\n testId,\n}: {\n title?: string;\n description?: string;\n children: React.ReactNode;\n testId?: string;\n}) {\n return (\n <section\n data-tour={testId}\n className=\"rounded-lg border border-border-seam bg-bg-surface px-4 py-2\"\n >\n {title && <h2 className=\"pt-2 text-base font-semibold text-text-primary\">{title}</h2>}\n {description && <p className=\"text-sm text-text-secondary\">{description}</p>}\n <div className=\"divide-y divide-border-seam\">{children}</div>\n </section>\n );\n}\n\n/**\n * Notification settings, Navigation v2 (BOFF-11872, mockup 48): \"how to reach\n * you\" first. \"Pause all notifications\" and the In-app, Email and Push\n * switches lead; SMS, WhatsApp, Slack and the type toggles sit under one\n * \"More options\"; the opt-in topics show only when there are any. \"Reset\" is\n * \"Use default\" in each row's \"⋯\". Every switch makes the same calls as the\n * classic Preferences page.\n */\nexport function NotificationSettingsV2() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n topics,\n isLoading: topicsLoading,\n isForbidden: topicsForbidden,\n } = useNotificationTopics({ type: 'MARKETING', isActive: true });\n const { preferencesByKey, savingKey, saveFeedback, togglePreference, resetPreference } =\n usePreferenceToggles();\n const [search, setSearch] = useState('');\n\n const filteredTopics = useMemo(() => {\n const query = search.trim().toLowerCase();\n if (!query) return topics;\n return topics.filter(\n (topic) =>\n topic.name.toLowerCase().includes(query) ||\n topic.slug.toLowerCase().includes(query) ||\n topic.description?.toLowerCase().includes(query)\n );\n }, [search, topics]);\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.noPermissionPreferences',\n \"You don't have permission to manage notification preferences.\"\n )}\n </div>\n );\n }\n\n const row = (\n target: PreferenceTarget,\n title: string,\n options: { description?: string; inverted?: boolean } = {}\n ) => {\n const key = preferenceKey(target);\n const existing = preferencesByKey.get(key);\n const enabled = existing?.enabled ?? true;\n return (\n <SwitchRow\n key={key}\n testId={`notification-setting-${key}`}\n title={title}\n description={options.description}\n // \"Pause all\" reads the other way round: on means delivery is off.\n checked={options.inverted ? !enabled : enabled}\n saving={savingKey === key}\n feedback={saveFeedback?.key === key ? saveFeedback : null}\n onToggle={() => void togglePreference(target)}\n onUseDefault={existing ? () => void resetPreference(key) : undefined}\n />\n );\n };\n\n const showTopics = !topicsLoading && !topicsForbidden && topics.length > 0;\n\n return (\n <div\n data-tour=\"notification-preferences-page\"\n className=\"mx-auto w-full max-w-3xl space-y-4 p-3 sm:space-y-5 sm:p-6\"\n >\n <BackToNotifications />\n <header>\n <h1 className=\"text-xl font-semibold text-text-primary sm:text-2xl\">\n {tr('notifications.v2.settingsTitle', 'Notification settings')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr('notifications.v2.settingsSubtitle', 'How and when we reach you.')}\n </p>\n </header>\n\n <Section testId=\"notification-preferences-global\">\n {row({ scope: 'GLOBAL' }, tr('notifications.v2.pauseAll', 'Pause all notifications'), {\n description: tr(\n 'notifications.v2.pauseAllDescription',\n 'Stop every notification on every channel until you turn this off.'\n ),\n inverted: true,\n })}\n </Section>\n\n <Section\n testId=\"notification-preferences-channels\"\n title={tr('notifications.v2.howToReachYou', 'How to reach you')}\n >\n {EVERYDAY_CHANNELS.map((channel) =>\n row({ scope: 'CHANNEL', channel: channel.value }, tr(channel.labelKey, channel.label))\n )}\n </Section>\n\n <OptionalFields storageKey=\"notifications.settings.more\">\n <div className=\"space-y-4\">\n <Section title={tr('notifications.v2.moreChannels', 'Other ways to reach you')}>\n {MORE_CHANNELS.map((channel) =>\n row({ scope: 'CHANNEL', channel: channel.value }, tr(channel.labelKey, channel.label))\n )}\n </Section>\n <Section\n testId=\"notification-preferences-types\"\n title={tr('notifications.v2.whatWeSend', 'What we send you')}\n >\n {TYPES.map((type) =>\n row({ scope: 'TYPE', type: type.value }, tr(type.labelKey, type.label))\n )}\n </Section>\n </div>\n </OptionalFields>\n\n {showTopics && (\n <Section\n testId=\"notification-preferences-topics\"\n title={tr('notifications.v2.optInTopics', 'Updates you can opt into')}\n >\n {topics.length > 5 && (\n <div className=\"relative py-3\">\n <Search\n size={16}\n className=\"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-text-tertiary\"\n aria-hidden=\"true\"\n />\n <Input\n type=\"search\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n aria-label={tr('notifications.searchTopics', 'Search topics...')}\n placeholder={tr('notifications.searchTopics', 'Search topics...')}\n className=\"pl-9\"\n />\n </div>\n )}\n {filteredTopics.length === 0 ? (\n <p className=\"py-3 text-sm text-text-secondary\">\n {tr('notifications.noTopicsFound', 'No topics match your search')}\n </p>\n ) : (\n filteredTopics.map((topic) =>\n row({ scope: 'TOPIC', topicId: topic.id }, topic.name, {\n description: topic.description || undefined,\n })\n )\n )}\n </Section>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAuCA,SAASA,EAAU,EACjB,UACA,gBACA,YACA,WACA,aACA,aACA,iBACA,aACiB;CACjB,IAAMC,IAAKC,EAAM,GACXC,IAAKC,EAAM;CACjB,OACE,kBAAC,OAAD;EAAK,WAAU;EAAO,eAAaC;EAAnC,UAAA,CACE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,kBAAC,SAAD;KAAO,SAASF;KAAI,WAAU;KAC3B,UAAAG;IACI,CAAA,GACNC,KAAe,kBAAC,KAAD;KAAG,WAAU;KAA+B,UAAAA;IAAe,CAAA,CACxE;GACL,CAAA,GAAA,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,QAAD;MAAM,WAAU;MAA6C,eAAY;MACtE,UAAAC,IACG,MACAC,IACER,EAAG,uBAAuB,IAAI,IAC9BA,EAAG,wBAAwB,KAAK;KAClC,CAAA;KACN,kBAACS,GAAD;MAAY;MAAa;MAAS,UAAUF;MAAQ,iBAAiBG;KAAW,CAAA;KAC/EC,KACC,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;MAAqB,SAAA;MACnB,UAAA,kBAACC,GAAD;OACE,SAAQ;OACR,MAAK;OACL,cAAYd,EAAG,+BAA+B,qBAAqB,EACjE,MAAMK,EACR,CAAC;OAED,UAAA,kBAACU,GAAD;QAAgB,MAAM;QAAI,eAAY;OAAQ,CAAA;MACxC,CAAA;KACW,CAAA,GACrB,kBAACC,GAAD;MAAqB,OAAM;MACzB,UAAA,kBAACC,GAAD;OAAkB,UAAUV;OAAQ,UAAUI;OAC3C,UAAAX,EAAG,+BAA+B,aAAa;MAChC,CAAA;KACC,CAAA,CACT,EAAA,CAAA;IAEb;GACF,CAAA,CAAA;EACL,CAAA,GAAA,kBAAC,OAAD;GAAK,WA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EAAM,eAAe,KAAA,EACpC,CAAC,CACH,CAEK;;EAER;;AAET"}
@@ -1,7 +1,6 @@
1
- import "../hooks/index.js";
2
1
  import { useNotifications as e } from "../hooks/useNotifications.js";
3
- import { NotificationCard as t } from "../components/NotificationCard.js";
4
- import { useNotificationTopics as n } from "../hooks/useNotificationTopics.js";
2
+ import { useNotificationTopics as t } from "../hooks/useNotificationTopics.js";
3
+ import { NotificationCard as n } from "../components/NotificationCard.js";
5
4
  import { NotificationListFooter as r } from "../components/NotificationListFooter.js";
6
5
  import { filterNotifications as i, groupNotificationsByDate as a } from "../utils/index.js";
7
6
  import { NOTIFICATION_PERMISSIONS as o } from "../constants/permissions.js";
@@ -70,7 +69,7 @@ function P() {
70
69
  let l = c(), { hasPermission: N, isLoading: P } = p(), { currentUser: F } = s(), { notifications: I, hasMore: L, isLoadingMore: R, loadMore: z, unreadCount: B, notificationFilter: V, markAsRead: H, markAllAsRead: U, archiveNotification: W, recordAction: G, updateFilter: K, resetFilter: q } = e({
71
70
  baseFilter: k,
72
71
  unreadFilter: A
73
- }), { topics: J } = n({ isActive: !0 }), Y = f(() => i(I, V), [I, V]), X = f(() => a(Y, l), [Y, l]);
72
+ }), { topics: J } = t({ isActive: !0 }), Y = f(() => i(I, V), [I, V]), X = f(() => a(Y, l), [Y, l]);
74
73
  return P ? /* @__PURE__ */ v(d, {
75
74
  minHeight: "16rem",
76
75
  today: /* @__PURE__ */ v("div", {
@@ -205,14 +204,14 @@ function P() {
205
204
  /* @__PURE__ */ v("div", {
206
205
  "data-tour": "notification-center-list",
207
206
  className: "space-y-6",
208
- children: Y.length > 0 ? Object.entries(X).map(([e, n]) => /* @__PURE__ */ y("div", {
207
+ children: Y.length > 0 ? Object.entries(X).map(([e, t]) => /* @__PURE__ */ y("div", {
209
208
  className: "animate-in fade-in slide-in-from-bottom-2 duration-200",
210
209
  children: [/* @__PURE__ */ v("h2", {
211
210
  className: "text-sm font-semibold text-tertiary mb-3",
212
211
  children: e
213
212
  }), /* @__PURE__ */ v("div", {
214
213
  className: "space-y-2",
215
- children: n.map((e) => /* @__PURE__ */ v(t, {
214
+ children: t.map((e) => /* @__PURE__ */ v(n, {
216
215
  notification: e,
217
216
  onMarkAsRead: H,
218
217
  onArchive: W,
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationCenterPage.js","names":["_Fragment","CENTER_FILTER","CENTER_UNREAD_FILTER","TYPE_OPTIONS","PRIORITY_OPTIONS","NotificationCenterPage","useNotification","jsx","navigationV2","NotificationInboxV2","ClassicNotificationCenterPage","tr","useTr","permissionsLoading","usePermissions","useNotifications","useNotificationTopics","filteredNotifications","useMemo","filterNotifications","notifications","notificationFilter","groupedNotifications","groupNotificationsByDate","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","BellRing","AuroraBackground","EmphasisPanel","GradientText","unreadCount","Fragment","Button","markAllAsRead","CheckCheck","PushOptInToggle","GlassCard","Search","updateFilter","ThemedSelect","option","topics","topic","resetFilter","group","groupNotifications","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, CheckCheck, BellRing } from 'lucide-react';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n AuroraBackground,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { NotificationInboxV2 } from '../navigation-v2/NotificationInboxV2';\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 TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alert' },\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\nconst PRIORITY_OPTIONS: Array<{ value: NotificationPriority; labelKey: string; label: string }> = [\n { value: 'URGENT', labelKey: 'notifications.priorityUrgent', label: 'Urgent' },\n { value: 'HIGH', labelKey: 'notifications.priorityHigh', label: 'High' },\n { value: 'NORMAL', labelKey: 'notifications.priorityNormal', label: 'Normal' },\n { value: 'LOW', labelKey: 'notifications.priorityLow', label: 'Low' },\n];\n\n/**\n * Notification Center Page\n *\n * Main page for viewing and managing in-app notifications. Under FluidGrids'\n * Navigation v2 (BOFF-11872) it is the inbox layout instead; every other app\n * keeps the classic page.\n */\nexport function NotificationCenterPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationInboxV2 /> : <ClassicNotificationCenterPage />;\n}\n\nfunction ClassicNotificationCenterPage() {\n const tr = useTr();\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\n // Filter and group notifications\n const filteredNotifications = useMemo(\n () => filterNotifications(notifications, notificationFilter),\n [notifications, notificationFilter]\n );\n const groupedNotifications = useMemo(\n () => groupNotificationsByDate(filteredNotifications, tr),\n [filteredNotifications, tr]\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 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 return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.centerPurpose',\n 'Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.'\n )}\n </PagePurpose>\n\n {/* Header — the page's single emphasis zone (unread summary + the one CTA).\n Wrapped in a relative overflow-hidden container so the AuroraBackground\n can sit behind it (at -z-10) without ever moving content. This is the\n MFE's single aurora hero. */}\n <div className=\"relative overflow-hidden rounded-2xl\">\n <AuroraBackground intensity=\"subtle\" />\n <EmphasisPanel\n data-tour=\"notification-center-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n <GradientText>{tr('notifications.centerTitle', 'Notification Center')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {unreadCount > 0 ? (\n <>\n {tr('notifications.youHave', 'You have')}{' '}\n <span\n className=\"inline-flex items-center gap-1.5 font-semibold text-primary\"\n data-tour=\"notification-center-unread-count\"\n >\n <span className=\"inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse\" />\n {unreadCount}\n </span>{' '}\n {tr(\n unreadCount === 1\n ? 'notifications.unreadNotification'\n : 'notifications.unreadNotifications',\n unreadCount === 1 ? 'unread notification' : 'unread notifications'\n )}\n </>\n ) : (\n tr('notifications.allCaughtUp', 'All caught up!')\n )}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={markAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} />\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </Button>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Push opt-in — renders nothing when the surface has no push support\n (web without a service worker, or a shell that never registered a\n controller), so no wrapper card here to avoid an empty box in that\n case. Placed here too since this page, not just the bell dropdown,\n can be the first notification surface a user reaches. */}\n <PushOptInToggle />\n\n {/* Filters */}\n <GlassCard\n treatment=\"plain\"\n data-tour=\"notification-center-filters\"\n className=\"flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-4\"\n >\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n data-tour=\"notification-center-search\"\n type=\"text\"\n placeholder={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n {/* Type filter */}\n <ThemedSelect\n value={notificationFilter.type}\n onChange={(e) => updateFilter({ type: e.target.value as NotificationType | 'ALL' })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allTypes', 'All Types')}</option>\n {TYPE_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </ThemedSelect>\n\n {/* Priority filter */}\n <ThemedSelect\n value={notificationFilter.priority}\n onChange={(e) =>\n updateFilter({ priority: e.target.value as NotificationPriority | 'ALL' })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allPriorities', 'All Priorities')}</option>\n {PRIORITY_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </ThemedSelect>\n\n <ThemedSelect\n value={notificationFilter.topicId || ''}\n onChange={(e) => updateFilter({ topicId: e.target.value || undefined })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </ThemedSelect>\n\n {/* Read/Unread filter */}\n <ThemedSelect\n value={\n notificationFilter.isRead === null\n ? 'ALL'\n : notificationFilter.isRead\n ? 'READ'\n : 'UNREAD'\n }\n onChange={(e) =>\n updateFilter({\n isRead: e.target.value === 'ALL' ? null : e.target.value === 'READ',\n })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.filterAll', 'All')}</option>\n <option value=\"UNREAD\">{tr('notifications.filterUnread', 'Unread')}</option>\n <option value=\"READ\">{tr('notifications.filterRead', 'Read')}</option>\n </ThemedSelect>\n\n {/* Reset filters */}\n {(notificationFilter.search ||\n notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n Boolean(notificationFilter.topicId)) && (\n <button\n onClick={resetFilter}\n className=\"px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150\"\n >\n {tr('notifications.resetFilters', 'Reset')}\n </button>\n )}\n </GlassCard>\n\n {/* Notifications list */}\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {filteredNotifications.length > 0 ? (\n Object.entries(groupedNotifications).map(([group, groupNotifications]) => (\n <div key={group} className=\"animate-in fade-in slide-in-from-bottom-2 duration-200\">\n <h2 className=\"text-sm font-semibold text-tertiary mb-3\">{group}</h2>\n <div className=\"space-y-2\">\n {groupNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={\n notifications.length === 0\n ? tr(\n 'notifications.noNotificationsYet',\n \"You don't have any notifications yet. We'll notify you when something important happens.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n // The server applies the search and the filters, so the kind follows them, not the\n // length of what came back.\n kind={\n notificationFilter.search\n ? 'no-results'\n : notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n notificationFilter.topicId\n ? 'filtered'\n : 'first-use'\n }\n />\n </div>\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n is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U;MACZ,UAAAC,EAAmB,KAAK,MACvB,kBAACC,GAAD;OAEgB;OACd,cAAcC;OACd,WAAWC;OACX,UAAUC;OACV,iBAAgB;MACjB,GANMC,EAAa,EAMnB,CACF;KACE,CAAA,CACF;IAdK,GAAAN,CAcL,CACN,IAED,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACO,GAAD;MACE,cAAcnC,EAAc,WAAW,IAAI,wBAAwB;MACnE,OAAOT,EAAG,sCAAsC,wBAAwB;MACxE,aACES,EAAc,WAAW,IACrBT,EACE,oCACA,0FACF,IACAA,EACE,+BACA,uDACF;MAIN,MACEU,EAAmB,SACf,eACAA,EAAmB,SAAS,SAC1BA,EAAmB,aAAa,SAChCA,EAAmB,WAAW,QAC9BA,EAAmB,UACnB,aACA;KAET,CAAA;IACE,CAAA;GAEJ,CAAA;GAEL,kBAACmC,GAAD;IACW;IACM;IACf,YAAYC;IACZ,YAAYxC,EAAsB;GACnC,CAAA;EACE;;AAET"}
1
+ {"version":3,"file":"NotificationCenterPage.js","names":["_Fragment","CENTER_FILTER","CENTER_UNREAD_FILTER","TYPE_OPTIONS","PRIORITY_OPTIONS","NotificationCenterPage","useNotification","jsx","navigationV2","NotificationInboxV2","ClassicNotificationCenterPage","tr","useTr","permissionsLoading","usePermissions","useNotifications","useNotificationTopics","filteredNotifications","useMemo","filterNotifications","notifications","notificationFilter","groupedNotifications","groupNotificationsByDate","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","BellRing","AuroraBackground","EmphasisPanel","GradientText","unreadCount","Fragment","Button","markAllAsRead","CheckCheck","PushOptInToggle","GlassCard","Search","updateFilter","ThemedSelect","option","topics","topic","resetFilter","group","groupNotifications","NotificationCard","markAsRead","archiveNotification","recordAction","notification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/pages/NotificationCenterPage.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { Search, CheckCheck, BellRing } from 'lucide-react';\nimport { PushOptInToggle } from '@burdenoff/fe-libs/chrome';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n AuroraBackground,\n Button,\n EmphasisPanel,\n GlassCard,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { filterNotifications, groupNotificationsByDate } from '../utils';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationPriority, NotificationType } from '../types';\nimport { NotificationInboxV2 } from '../navigation-v2/NotificationInboxV2';\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 TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alert' },\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\nconst PRIORITY_OPTIONS: Array<{ value: NotificationPriority; labelKey: string; label: string }> = [\n { value: 'URGENT', labelKey: 'notifications.priorityUrgent', label: 'Urgent' },\n { value: 'HIGH', labelKey: 'notifications.priorityHigh', label: 'High' },\n { value: 'NORMAL', labelKey: 'notifications.priorityNormal', label: 'Normal' },\n { value: 'LOW', labelKey: 'notifications.priorityLow', label: 'Low' },\n];\n\n/**\n * Notification Center Page\n *\n * Main page for viewing and managing in-app notifications. Under FluidGrids'\n * Navigation v2 (BOFF-11872) it is the inbox layout instead; every other app\n * keeps the classic page.\n */\nexport function NotificationCenterPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationInboxV2 /> : <ClassicNotificationCenterPage />;\n}\n\nfunction ClassicNotificationCenterPage() {\n const tr = useTr();\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\n // Filter and group notifications\n const filteredNotifications = useMemo(\n () => filterNotifications(notifications, notificationFilter),\n [notifications, notificationFilter]\n );\n const groupedNotifications = useMemo(\n () => groupNotificationsByDate(filteredNotifications, tr),\n [filteredNotifications, tr]\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 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 return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.centerPurpose',\n 'Your in-app inbox. Everything the platform needs you to see — task assignments, mentions, alerts and system updates — lands here. Filter by type, priority or topic, mark items as read, and archive what you no longer need.'\n )}\n </PagePurpose>\n\n {/* Header — the page's single emphasis zone (unread summary + the one CTA).\n Wrapped in a relative overflow-hidden container so the AuroraBackground\n can sit behind it (at -z-10) without ever moving content. This is the\n MFE's single aurora hero. */}\n <div className=\"relative overflow-hidden rounded-2xl\">\n <AuroraBackground intensity=\"subtle\" />\n <EmphasisPanel\n data-tour=\"notification-center-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n <GradientText>{tr('notifications.centerTitle', 'Notification Center')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {unreadCount > 0 ? (\n <>\n {tr('notifications.youHave', 'You have')}{' '}\n <span\n className=\"inline-flex items-center gap-1.5 font-semibold text-primary\"\n data-tour=\"notification-center-unread-count\"\n >\n <span className=\"inline-block h-2 w-2 rounded-full bg-accent-primary motion-safe:animate-vc-glow-pulse\" />\n {unreadCount}\n </span>{' '}\n {tr(\n unreadCount === 1\n ? 'notifications.unreadNotification'\n : 'notifications.unreadNotifications',\n unreadCount === 1 ? 'unread notification' : 'unread notifications'\n )}\n </>\n ) : (\n tr('notifications.allCaughtUp', 'All caught up!')\n )}\n </p>\n </div>\n\n {unreadCount > 0 && (\n <Button\n data-tour=\"notification-center-mark-all-read\"\n variant=\"outline\"\n onClick={markAllAsRead}\n className=\"gap-2\"\n >\n <CheckCheck size={16} />\n {tr('notifications.markAllAsRead', 'Mark All as Read')}\n </Button>\n )}\n </EmphasisPanel>\n </div>\n\n {/* Push opt-in — renders nothing when the surface has no push support\n (web without a service worker, or a shell that never registered a\n controller), so no wrapper card here to avoid an empty box in that\n case. Placed here too since this page, not just the bell dropdown,\n can be the first notification surface a user reaches. */}\n <PushOptInToggle />\n\n {/* Filters */}\n <GlassCard\n treatment=\"plain\"\n data-tour=\"notification-center-filters\"\n className=\"flex flex-col gap-3 border-border-seam p-3 sm:flex-row sm:flex-wrap sm:items-center sm:gap-4 sm:p-4\"\n >\n {/* Search */}\n <div className=\"relative flex-1\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n data-tour=\"notification-center-search\"\n type=\"text\"\n placeholder={tr('notifications.searchPlaceholder', 'Search notifications...')}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n {/* Type filter */}\n <ThemedSelect\n value={notificationFilter.type}\n onChange={(e) => updateFilter({ type: e.target.value as NotificationType | 'ALL' })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allTypes', 'All Types')}</option>\n {TYPE_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </ThemedSelect>\n\n {/* Priority filter */}\n <ThemedSelect\n value={notificationFilter.priority}\n onChange={(e) =>\n updateFilter({ priority: e.target.value as NotificationPriority | 'ALL' })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.allPriorities', 'All Priorities')}</option>\n {PRIORITY_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </ThemedSelect>\n\n <ThemedSelect\n value={notificationFilter.topicId || ''}\n onChange={(e) => updateFilter({ topicId: e.target.value || undefined })}\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </ThemedSelect>\n\n {/* Read/Unread filter */}\n <ThemedSelect\n value={\n notificationFilter.isRead === null\n ? 'ALL'\n : notificationFilter.isRead\n ? 'READ'\n : 'UNREAD'\n }\n onChange={(e) =>\n updateFilter({\n isRead: e.target.value === 'ALL' ? null : e.target.value === 'READ',\n })\n }\n className=\"px-3 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"ALL\">{tr('notifications.filterAll', 'All')}</option>\n <option value=\"UNREAD\">{tr('notifications.filterUnread', 'Unread')}</option>\n <option value=\"READ\">{tr('notifications.filterRead', 'Read')}</option>\n </ThemedSelect>\n\n {/* Reset filters */}\n {(notificationFilter.search ||\n notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n Boolean(notificationFilter.topicId)) && (\n <button\n onClick={resetFilter}\n className=\"px-3 py-2 text-sm text-tertiary hover:text-primary transition-colors duration-150\"\n >\n {tr('notifications.resetFilters', 'Reset')}\n </button>\n )}\n </GlassCard>\n\n {/* Notifications list */}\n <div data-tour=\"notification-center-list\" className=\"space-y-6\">\n {filteredNotifications.length > 0 ? (\n Object.entries(groupedNotifications).map(([group, groupNotifications]) => (\n <div key={group} className=\"animate-in fade-in slide-in-from-bottom-2 duration-200\">\n <h2 className=\"text-sm font-semibold text-tertiary mb-3\">{group}</h2>\n <div className=\"space-y-2\">\n {groupNotifications.map((notification) => (\n <NotificationCard\n key={notification.id}\n notification={notification}\n onMarkAsRead={markAsRead}\n onArchive={archiveNotification}\n onAction={recordAction}\n analyticsSource=\"center\"\n />\n ))}\n </div>\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={notifications.length === 0 ? 'empty-notifications' : 'empty-search'}\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={\n notifications.length === 0\n ? tr(\n 'notifications.noNotificationsYet',\n \"You don't have any notifications yet. We'll notify you when something important happens.\"\n )\n : tr(\n 'notifications.adjustFilters',\n 'Try adjusting your filters to see more notifications.'\n )\n }\n // The server applies the search and the filters, so the kind follows them, not the\n // length of what came back.\n kind={\n notificationFilter.search\n ? 'no-results'\n : notificationFilter.type !== 'ALL' ||\n notificationFilter.priority !== 'ALL' ||\n notificationFilter.isRead !== null ||\n notificationFilter.topicId\n ? 'filtered'\n : 'first-use'\n }\n />\n </div>\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={filteredNotifications.length}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyBA,IAAMC,IAAgB;CAAE,UAAU;CAAO,SAAS;AAAkB,GAC9DC,IAAuB,EAAE,SAAS,SAAS,GAC3CC,IAAoF;CACxF;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;CAAS;CACzE;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;CAAQ;CACtE;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;CAAgB;CAC9F;EAAE,OAAO;EAAa,UAAU;EAA+B,OAAO;CAAY;AACpF,GACMC,IAA4F;CAChG;EAAE,OAAO;EAAU,UAAU;EAAgC,OAAO;CAAS;CAC7E;EAAE,OAAO;EAAQ,UAAU;EAA8B,OAAO;CAAO;CACvE;EAAE,OAAO;EAAU,UAAU;EAAgC,OAAO;CAAS;CAC7E;EAAE,OAAO;EAAO,UAAU;EAA6B,OAAO;CAAM;AACtE;AASA,SAAgBC,IAAyB;CACvC,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA0BC,GAA3B,CAAsB,CAAoC;AAClF;AAEA,SAASA,IAAgC;CACvC,IAAMC,IAAKC,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EAAmB,SAAS,SAC5BA,EAAmB,aAAa,SAChCA,EAAmB,WAAW,QAC9B,EAAQA,EAAmB,YAC3B,kBAAC,UAAD;MACE,SAAS0B;MACT,WAAU;MAET,UAAApC,EAAG,8BAA8B,OAAO;KACnC,CAAA;IAED;;GAGX,kBAAC,OAAD;IAAK,aAAU;IAA2B,WAAU;IACjD,UAAAM,EAAsB,SAAS,IAC9B,OAAO,QAAQK,CAAoB,CAAC,CAAC,KAAK,CAAC0B,GAAOC,OAChD,kBAAC,OAAD;KAAiB,WAAU;KAA3B,UAAA,CACE,kBAAC,MAAD;MAAI,WAAU;MAA4C,UAAAD;KAAU,CAAA,GACpE,kBAAC,OAAD;MAAK,WAAU;MACZ,UAAAC,EAAmB,KAAK,MACvB,kBAACC,GAAD;OAEgB;OACd,cAAcC;OACd,WAAWC;OACX,UAAUC;OACV,iBAAgB;MACjB,GANMC,EAAa,EAMnB,CACF;KACE,CAAA,CACF;IAdK,GAAAN,CAcL,CACN,IAED,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACO,GAAD;MACE,cAAcnC,EAAc,WAAW,IAAI,wBAAwB;MACnE,OAAOT,EAAG,sCAAsC,wBAAwB;MACxE,aACES,EAAc,WAAW,IACrBT,EACE,oCACA,0FACF,IACAA,EACE,+BACA,uDACF;MAIN,MACEU,EAAmB,SACf,eACAA,EAAmB,SAAS,SAC1BA,EAAmB,aAAa,SAChCA,EAAmB,WAAW,QAC9BA,EAAmB,UACnB,aACA;KAET,CAAA;IACE,CAAA;GAEJ,CAAA;GAEL,kBAACmC,GAAD;IACW;IACM;IACf,YAAYC;IACZ,YAAYxC,EAAsB;GACnC,CAAA;EACE;;AAET"}
@@ -1,7 +1,6 @@
1
- import { useNotificationAdmin as e } from "../hooks/useNotificationAdmin.js";
2
- import { useNotificationTopics as t } from "../hooks/useNotificationTopics.js";
3
- import { NotificationCard as n } from "../components/NotificationCard.js";
4
- import "../hooks/index.js";
1
+ import { NotificationCard as e } from "../components/NotificationCard.js";
2
+ import { useNotificationAdmin as t } from "../hooks/useNotificationAdmin.js";
3
+ import { useNotificationTopics as n } from "../hooks/useNotificationTopics.js";
5
4
  import { NOTIFICATION_PERMISSIONS as r } from "../constants/permissions.js";
6
5
  import { useTr as i } from "../shared/hooks/useTr.js";
7
6
  import { exportNotificationsAsCsv as a } from "../utils/notificationHistoryExport.js";
@@ -16,7 +15,7 @@ function T(e) {
16
15
  return e ? new Date(e).toLocaleString() : "—";
17
16
  }
18
17
  function E() {
19
- let E = i(), { hasPermission: D, isLoading: O } = l(), { topics: k } = t(), { filters: A, setFilters: j, notifications: M, scheduledNotifications: N, selectedNotification: P, events: F, isLoading: I, loadNotification: L, archiveNotification: R, unarchiveNotification: z, cancelScheduledNotification: B, rescheduleNotification: V, clearSelection: H } = e(), [U, W] = c("");
18
+ let E = i(), { hasPermission: D, isLoading: O } = l(), { topics: k } = n(), { filters: A, setFilters: j, notifications: M, scheduledNotifications: N, selectedNotification: P, events: F, isLoading: I, loadNotification: L, archiveNotification: R, unarchiveNotification: z, cancelScheduledNotification: B, rescheduleNotification: V, clearSelection: H } = t(), [U, W] = c("");
20
19
  return O ? /* @__PURE__ */ h(s, {
21
20
  minHeight: "16rem",
22
21
  today: /* @__PURE__ */ h("div", {
@@ -270,17 +269,17 @@ function E() {
270
269
  title: E("notifications.noNotificationsFound", "No notifications found"),
271
270
  description: E("notifications.adjustSearchOrDateRange", "Try adjusting your filters"),
272
271
  kind: "filtered"
273
- }) : M.map((e) => /* @__PURE__ */ h("button", {
272
+ }) : M.map((t) => /* @__PURE__ */ h("button", {
274
273
  type: "button",
275
- onClick: () => L(e.id),
274
+ onClick: () => L(t.id),
276
275
  className: "block w-full text-left",
277
- children: /* @__PURE__ */ h(n, {
278
- notification: e,
276
+ children: /* @__PURE__ */ h(e, {
277
+ notification: t,
279
278
  compact: !0,
280
279
  showArchivedState: !0,
281
280
  analyticsSource: "admin_history"
282
281
  })
283
- }, e.id))
282
+ }, t.id))
284
283
  })]
285
284
  }), /* @__PURE__ */ g("section", {
286
285
  className: "rounded-lg border border-border-seam bg-gloss-card p-4",