@nivaro/react 0.3.113 → 0.3.115

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 (285) hide show
  1. package/dist/components/ScreenShareHost.js +24 -0
  2. package/dist/full.css +50 -2
  3. package/dist/hooks/useSessionRecorder.js +61 -60
  4. package/dist/index.d.ts +1727 -19
  5. package/dist/index.js +1091 -950
  6. package/dist/shared/components/ActivityEntry.js +209 -97
  7. package/dist/shared/components/AgentPresenceChip.js +51 -0
  8. package/dist/shared/components/AnnouncementBanner.js +56 -41
  9. package/dist/shared/components/AutolinkedText.js +98 -85
  10. package/dist/shared/components/BroadcastView.js +149 -141
  11. package/dist/shared/components/CacheStamp.js +78 -30
  12. package/dist/shared/components/CollectionBrowserView.js +4088 -3592
  13. package/dist/shared/components/ConfigChangeStrip.js +63 -0
  14. package/dist/shared/components/ConfigReachNote.js +107 -0
  15. package/dist/shared/components/ConformanceView.js +389 -319
  16. package/dist/shared/components/DataTable.js +544 -504
  17. package/dist/shared/components/DelegateCoverLine.js +164 -0
  18. package/dist/shared/components/EnvironmentNotice.js +56 -65
  19. package/dist/shared/components/FilePreviewLightbox.js +89 -43
  20. package/dist/shared/components/FindingFixedMark.js +23 -0
  21. package/dist/shared/components/GridPresenceLine.js +100 -0
  22. package/dist/shared/components/IdleReloadWatcher.js +82 -43
  23. package/dist/shared/components/InStep.js +46 -0
  24. package/dist/shared/components/ItemEditForm.js +5504 -4889
  25. package/dist/shared/components/LiveAnnouncer.js +62 -0
  26. package/dist/shared/components/LiveCount.js +54 -0
  27. package/dist/shared/components/LiveFigure.js +28 -0
  28. package/dist/shared/components/LiveListControls.js +114 -0
  29. package/dist/shared/components/LiveNewMatchesPill.js +25 -0
  30. package/dist/shared/components/LiveOffNote.js +44 -0
  31. package/dist/shared/components/LivePreferenceHost.js +42 -0
  32. package/dist/shared/components/LiveRowMark.js +25 -20
  33. package/dist/shared/components/LiveTraceView.js +257 -0
  34. package/dist/shared/components/MapView.js +30 -29
  35. package/dist/shared/components/MatrixEditor.js +497 -462
  36. package/dist/shared/components/MyWorkView.js +346 -272
  37. package/dist/shared/components/NotificationBell.js +215 -201
  38. package/dist/shared/components/PageRenderer.js +636 -599
  39. package/dist/shared/components/PresenceDot.js +21 -0
  40. package/dist/shared/components/ProfileView.js +656 -536
  41. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  42. package/dist/shared/components/RecentRecordsRail.js +51 -48
  43. package/dist/shared/components/RecordCompare.js +241 -150
  44. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  45. package/dist/shared/components/RecordGridEditor.js +350 -311
  46. package/dist/shared/components/RecordHoverCard.js +147 -0
  47. package/dist/shared/components/RecordPeekHost.js +111 -0
  48. package/dist/shared/components/RecordReadView.js +414 -412
  49. package/dist/shared/components/RelativeTime.js +16 -0
  50. package/dist/shared/components/ReportView.js +1396 -1304
  51. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  52. package/dist/shared/components/TabCountHost.js +10 -0
  53. package/dist/shared/components/TickerNumber.js +19 -18
  54. package/dist/shared/components/TipLayer.js +70 -58
  55. package/dist/shared/components/WidgetImageMenu.js +59 -0
  56. package/dist/shared/components/WidgetSlot.js +571 -524
  57. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  58. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  59. package/dist/shared/components/cbv/approval-changed.js +20 -0
  60. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  61. package/dist/shared/components/cbv/column-totals.js +75 -67
  62. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
  63. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  65. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  66. package/dist/shared/components/change-proposals/types.js +4 -0
  67. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  68. package/dist/shared/components/chat/Composer.js +276 -298
  69. package/dist/shared/components/chat/room-due.js +13 -0
  70. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  71. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  72. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  73. package/dist/shared/components/imports/ImportConsole.js +159 -155
  74. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  75. package/dist/shared/components/integrations/SendStatus.js +202 -0
  76. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  77. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  78. package/dist/shared/components/integrations/console/api.js +161 -117
  79. package/dist/shared/components/integrations/console/tone.js +15 -12
  80. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  81. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  82. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  83. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  84. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  85. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  86. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  87. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  88. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  89. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  90. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  91. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  92. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  93. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  94. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  95. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  96. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  97. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  98. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  99. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  100. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  101. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  102. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  103. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  104. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  105. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  106. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  107. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  108. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  109. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  110. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  111. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  112. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  113. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  114. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  115. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  116. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  117. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  118. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  119. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  120. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  121. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  122. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  123. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  124. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  125. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  126. package/dist/shared/components/item-edit/file-live.js +77 -0
  127. package/dist/shared/components/item-edit/file-processing.js +87 -0
  128. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  129. package/dist/shared/components/item-edit/live-related.js +23 -0
  130. package/dist/shared/components/item-edit/live-title.js +66 -0
  131. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  132. package/dist/shared/components/item-edit/removed-line.js +58 -0
  133. package/dist/shared/components/item-edit/render-stability.js +70 -59
  134. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  135. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  136. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  137. package/dist/shared/components/list/InlineEdit.js +504 -208
  138. package/dist/shared/components/list/ListViewers.js +81 -0
  139. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  140. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  141. package/dist/shared/components/merge/merge-values.js +110 -0
  142. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  143. package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
  144. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  145. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  146. package/dist/shared/components/notifications/bundles.js +21 -19
  147. package/dist/shared/components/notifications/resolved-line.js +25 -0
  148. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  149. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  150. package/dist/shared/components/panels/AlertBanners.js +132 -0
  151. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  152. package/dist/shared/components/panels/BranchLanes.js +82 -54
  153. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  154. package/dist/shared/components/panels/CommentImages.js +219 -0
  155. package/dist/shared/components/panels/CommentPanel.js +649 -530
  156. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  157. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  158. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  159. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  160. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  161. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  162. package/dist/shared/components/panels/SlaClock.js +130 -99
  163. package/dist/shared/components/panels/TaskPanel.js +308 -287
  164. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  165. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  166. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  167. package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
  168. package/dist/shared/components/profile/AgentNameField.js +141 -0
  169. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  170. package/dist/shared/components/profile/PersonAccess.js +398 -330
  171. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  172. package/dist/shared/components/profile/PersonProfile.js +81 -73
  173. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  174. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  175. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  176. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  177. package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
  178. package/dist/shared/components/queue/queue-totals.js +92 -0
  179. package/dist/shared/components/queue/worklist-helpers.js +18 -14
  180. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  181. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  182. package/dist/shared/components/support/ReportProblem.js +1 -0
  183. package/dist/shared/components/support/ScreenShare.js +554 -0
  184. package/dist/shared/components/support/SupportView.js +160 -129
  185. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  186. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  187. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  188. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  189. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  190. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  191. package/dist/shared/lib/activity-sentence.js +87 -75
  192. package/dist/shared/lib/agent-presence.js +46 -0
  193. package/dist/shared/lib/approval-progress.js +49 -0
  194. package/dist/shared/lib/attention-prefs.js +27 -0
  195. package/dist/shared/lib/cell-locks.js +56 -0
  196. package/dist/shared/lib/co-edit.js +166 -0
  197. package/dist/shared/lib/coedit-registry.js +44 -0
  198. package/dist/shared/lib/comment-awareness.js +124 -0
  199. package/dist/shared/lib/comment-images.js +45 -0
  200. package/dist/shared/lib/config-watch.js +94 -0
  201. package/dist/shared/lib/copy-rules.js +65 -0
  202. package/dist/shared/lib/count-step.js +30 -0
  203. package/dist/shared/lib/deadline-ticker.js +68 -0
  204. package/dist/shared/lib/derived-causes.js +115 -0
  205. package/dist/shared/lib/draft-store.js +114 -85
  206. package/dist/shared/lib/error-hints.js +1 -0
  207. package/dist/shared/lib/field-merge.js +126 -0
  208. package/dist/shared/lib/filter-sentence.js +10 -10
  209. package/dist/shared/lib/focus-mode.js +16 -12
  210. package/dist/shared/lib/grid-cursors.js +77 -0
  211. package/dist/shared/lib/grid-presence.js +182 -0
  212. package/dist/shared/lib/idle-reload.js +100 -73
  213. package/dist/shared/lib/in-step.js +45 -0
  214. package/dist/shared/lib/integration-chip.js +19 -18
  215. package/dist/shared/lib/line-locks.js +141 -0
  216. package/dist/shared/lib/line-split.js +41 -0
  217. package/dist/shared/lib/linked-changes.js +150 -0
  218. package/dist/shared/lib/list-link.js +56 -50
  219. package/dist/shared/lib/list-return.js +231 -0
  220. package/dist/shared/lib/list-viewers.js +52 -0
  221. package/dist/shared/lib/live-announcer.js +86 -0
  222. package/dist/shared/lib/live-counts.js +85 -0
  223. package/dist/shared/lib/live-data-changed.js +108 -0
  224. package/dist/shared/lib/live-deltas.js +81 -0
  225. package/dist/shared/lib/live-findings.js +113 -0
  226. package/dist/shared/lib/live-groups.js +122 -0
  227. package/dist/shared/lib/live-link-labels.js +162 -0
  228. package/dist/shared/lib/live-list-flow.js +334 -0
  229. package/dist/shared/lib/live-list.js +143 -129
  230. package/dist/shared/lib/live-moves.js +51 -0
  231. package/dist/shared/lib/live-ops.js +26 -26
  232. package/dist/shared/lib/live-pickers.js +7 -0
  233. package/dist/shared/lib/live-preference.js +184 -0
  234. package/dist/shared/lib/live-queries.js +226 -181
  235. package/dist/shared/lib/live-screen.js +333 -0
  236. package/dist/shared/lib/live-search.js +108 -0
  237. package/dist/shared/lib/live-seen.js +35 -0
  238. package/dist/shared/lib/live-views.js +100 -0
  239. package/dist/shared/lib/live.js +159 -133
  240. package/dist/shared/lib/missed-updates.js +198 -0
  241. package/dist/shared/lib/newer-file.js +56 -0
  242. package/dist/shared/lib/notification-sound.js +42 -20
  243. package/dist/shared/lib/own-writes.js +59 -41
  244. package/dist/shared/lib/picker-badges.js +94 -0
  245. package/dist/shared/lib/presence-signals.js +131 -84
  246. package/dist/shared/lib/realtime.js +49 -24
  247. package/dist/shared/lib/record-gaps.js +85 -0
  248. package/dist/shared/lib/record-outbox.js +369 -222
  249. package/dist/shared/lib/record-peek.js +75 -0
  250. package/dist/shared/lib/record-tabs.js +92 -72
  251. package/dist/shared/lib/relative-ticker.js +42 -0
  252. package/dist/shared/lib/request-gate.js +119 -119
  253. package/dist/shared/lib/rollup-recalc.js +107 -0
  254. package/dist/shared/lib/room-gaps.js +40 -36
  255. package/dist/shared/lib/rum.js +137 -87
  256. package/dist/shared/lib/save-progress.js +20 -0
  257. package/dist/shared/lib/scheduled-countdown.js +67 -0
  258. package/dist/shared/lib/screen-refresh.js +160 -0
  259. package/dist/shared/lib/screen-share.js +234 -0
  260. package/dist/shared/lib/seen-since.js +74 -0
  261. package/dist/shared/lib/selection-watch.js +205 -0
  262. package/dist/shared/lib/send-status.js +132 -0
  263. package/dist/shared/lib/send-view.js +23 -0
  264. package/dist/shared/lib/socket-liveness.js +155 -0
  265. package/dist/shared/lib/socket-realtime.js +168 -140
  266. package/dist/shared/lib/state-census.js +53 -0
  267. package/dist/shared/lib/summary-mode.js +61 -39
  268. package/dist/shared/lib/tab-attention.js +143 -32
  269. package/dist/shared/lib/table-density.js +64 -0
  270. package/dist/shared/lib/track-travel.js +40 -0
  271. package/dist/shared/lib/unseen-changes.js +68 -0
  272. package/dist/shared/lib/upload-file.js +33 -0
  273. package/dist/shared/lib/upload-presence.js +127 -0
  274. package/dist/shared/lib/urgent-chime.js +65 -0
  275. package/dist/shared/lib/use-online-users.js +32 -11
  276. package/dist/shared/lib/user-sync.js +155 -39
  277. package/dist/shared/lib/waiting-count.js +44 -0
  278. package/dist/shared/lib/watch-desktop.js +83 -0
  279. package/dist/shared/lib/watch-list.js +447 -0
  280. package/dist/shared/lib/widget-image-render.js +64 -0
  281. package/dist/shared/lib/widget-image.js +111 -0
  282. package/dist/shared/lib/worker-socket.js +130 -104
  283. package/dist/shared/lib/write-to-screen.js +133 -0
  284. package/package.json +1 -1
  285. package/styles.css +49 -1
@@ -1,81 +1,85 @@
1
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
- import { useQueryClient as le, useQuery as ce, useMutation as F } from "@tanstack/react-query";
3
- import { Check as me, Bot as ue } from "lucide-react";
4
- import { useState as C, useRef as W, useEffect as E, useMemo as pe } from "react";
5
- import { useApiFetchConfig as he, useItemNavigation as be, useNavigation as xe } from "../context.js";
6
- import { useLiveEvent as ge } from "../lib/live.js";
7
- import { useLiveOps as fe, useFreshIds as ke } from "../lib/live-ops.js";
8
- import { resolveNotificationTarget as Z, runNotificationTarget as ye } from "../lib/notification-target.js";
9
- import { usePrefetchIntent as we } from "../lib/prefetch.js";
10
- import { useOptionalRealtime as Ne } from "../lib/realtime.js";
11
- import { userErrorMessage as ve } from "../lib/safe-error.js";
12
- import { withinDay as G, slaChip as _e } from "../lib/sla-chip.js";
13
- import { cn as M } from "../lib/utils.js";
14
- import { AgentQuestionsCard as Ce } from "./AgentQuestionsCard.js";
15
- import { FirstWeekCard as $e } from "./ai/FirstWeekCard.js";
16
- import { TaskDoButton as Se } from "./ai/TaskDo.js";
17
- import { openChatRoom as Te, canOpenChatRoom as je } from "./chat/chat-core.js";
18
- import { useMyRecordRooms as Ae } from "./chat/chat-hooks.js";
19
- import { LearningPathCard as Me } from "./help-videos/viewer/LearningPathCard.js";
20
- import { RequiredVideosCard as Oe } from "./help-videos/viewer/RequiredVideosCard.js";
21
- import { SkeletonBar as Le, ListSkeleton as qe } from "./Skeletons.js";
22
- import { TickerNumber as Ie } from "./TickerNumber.js";
23
- import { UserAvatar as De } from "./UserAvatar.js";
24
- const Fe = 8e3, R = ["records", "tasks", "team", "waiting", "notifications"], X = {
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
+ import { useQueryClient as fe, useQuery as ke, useMutation as K } from "@tanstack/react-query";
3
+ import { Check as ye, Bot as we } from "lucide-react";
4
+ import { useState as $, useRef as B, useMemo as ne, useEffect as z } from "react";
5
+ import { useApiFetchConfig as Ne, useItemNavigation as ve, useNavigation as _e } from "../context.js";
6
+ import { useDeadlineNow as Ce, liveSlaReading as Se } from "../lib/deadline-ticker.js";
7
+ import { useLiveEvent as $e } from "../lib/live.js";
8
+ import { useLiveOps as Te, useFreshIds as je } from "../lib/live-ops.js";
9
+ import { resolveNotificationTarget as se, runNotificationTarget as Oe } from "../lib/notification-target.js";
10
+ import { usePrefetchIntent as Ie } from "../lib/prefetch.js";
11
+ import { useOptionalRealtime as Le } from "../lib/realtime.js";
12
+ import { usePeekOrOpen as Ae, peekable as de } from "../lib/record-peek.js";
13
+ import { userErrorMessage as Me } from "../lib/safe-error.js";
14
+ import { withinDay as oe, slaChip as De } from "../lib/sla-chip.js";
15
+ import { cn as D, formatRelative as qe } from "../lib/utils.js";
16
+ import { AgentQuestionsCard as Fe } from "./AgentQuestionsCard.js";
17
+ import { FirstWeekCard as Ue } from "./ai/FirstWeekCard.js";
18
+ import { TaskDoButton as We } from "./ai/TaskDo.js";
19
+ import { openChatRoom as Ee, canOpenChatRoom as Pe } from "./chat/chat-core.js";
20
+ import { useMyRecordRooms as Qe } from "./chat/chat-hooks.js";
21
+ import { useCoveringQuery as Ke, DelegateCoverLine as Be } from "./DelegateCoverLine.js";
22
+ import { LearningPathCard as ze } from "./help-videos/viewer/LearningPathCard.js";
23
+ import { RequiredVideosCard as He } from "./help-videos/viewer/RequiredVideosCard.js";
24
+ import { SkeletonBar as Je, ListSkeleton as Ve } from "./Skeletons.js";
25
+ import { TickerNumber as Ye } from "./TickerNumber.js";
26
+ import { UserAvatar as Ze } from "./UserAvatar.js";
27
+ const Re = 8e3, ie = ["records", "proposals", "tasks", "team", "waiting", "notifications"], le = /* @__PURE__ */ new Set(["records", "proposals"]), ce = {
25
28
  records: "Waiting on you",
29
+ proposals: "Changes to review",
26
30
  tasks: "My tasks",
27
31
  team: "Team tasks",
28
32
  waiting: "Waiting on others",
29
33
  notifications: "Notifications"
30
- }, We = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), O = (i) => !!i && String(i).slice(0, 10) < We(), Ee = {
34
+ }, Ge = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), q = (i) => !!i && String(i).slice(0, 10) < Ge(), Xe = {
31
35
  alert: "bg-red-500/10 text-red-600 dark:text-red-400",
32
36
  warn: "bg-amber-400/15 text-amber-700 dark:text-amber-400",
33
37
  neutral: "bg-slate-500/10 text-slate-600 dark:text-slate-400",
34
38
  ok: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"
35
39
  };
36
- function Ue({ sla: i }) {
37
- const u = _e(i);
38
- return u ? /* @__PURE__ */ e(
40
+ function et({ sla: i }) {
41
+ const p = Ce(!!(i != null && i.due_at)), c = i != null && i.due_at ? Se(i, p) : i, x = De(c);
42
+ return x ? /* @__PURE__ */ e(
39
43
  "span",
40
44
  {
41
- "data-sla-chip": u.tone,
42
- className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${Ee[u.tone]}`,
43
- children: u.label
45
+ "data-sla-chip": x.tone,
46
+ className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums transition-colors duration-500 ${Xe[x.tone]}`,
47
+ children: x.label
44
48
  }
45
49
  ) : null;
46
50
  }
47
- function Ke({ state: i, color: u }) {
51
+ function tt({ state: i, color: p }) {
48
52
  return i ? /* @__PURE__ */ e(
49
53
  "span",
50
54
  {
51
55
  className: "rounded-full px-2 py-0.5 text-[10.5px] font-medium",
52
56
  style: {
53
- backgroundColor: u ? `${u}22` : "rgba(100,116,139,.12)",
54
- color: u ?? void 0
57
+ backgroundColor: p ? `${p}22` : "rgba(100,116,139,.12)",
58
+ color: p ?? void 0
55
59
  },
56
60
  children: i.replace(/_/g, " ")
57
61
  }
58
62
  ) : null;
59
63
  }
60
- function Pe({ order: i, hidden: u }) {
64
+ function rt({ order: i, hidden: p }) {
61
65
  const c = i.filter(
62
- (m) => !u.includes(m) && (m === "records" || m === "tasks" || m === "notifications")
63
- ), w = (m, g) => /* @__PURE__ */ d(
66
+ (u) => !p.includes(u) && (u === "records" || u === "tasks" || u === "notifications")
67
+ ), x = (u, v) => /* @__PURE__ */ n(
64
68
  "section",
65
69
  {
66
70
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
67
71
  children: [
68
- /* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
69
- /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium text-slate-400 dark:text-slate-500", children: X[m] ?? m }),
70
- m === "records" && /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Records whose current step resolves you as an owner — most urgent first." })
72
+ /* @__PURE__ */ n("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
73
+ /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium text-slate-400 dark:text-slate-500", children: ce[u] ?? u }),
74
+ u === "records" && /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Records whose current step resolves you as an owner — most urgent first." })
71
75
  ] }),
72
76
  /* @__PURE__ */ e(
73
- qe,
77
+ Ve,
74
78
  {
75
79
  header: !1,
76
- rows: g,
80
+ rows: v,
77
81
  rowClassName: "h-[37px] px-4",
78
- columns: m === "records" ? [
82
+ columns: u === "records" ? [
79
83
  { key: "label", grow: 6 },
80
84
  { key: "where", width: 90, shape: "short" },
81
85
  { key: "state", width: 72, shape: "badge" },
@@ -88,30 +92,30 @@ function Pe({ order: i, hidden: u }) {
88
92
  )
89
93
  ]
90
94
  },
91
- m
95
+ u
92
96
  ), k = [];
93
- for (let m = 0; m < c.length; ) {
94
- if (c[m] === "records") {
95
- k.push(w("records", 5)), m++;
97
+ for (let u = 0; u < c.length; ) {
98
+ if (c[u] === "records") {
99
+ k.push(x("records", 5)), u++;
96
100
  continue;
97
101
  }
98
- const g = c.slice(m, m + 2).filter((f) => f !== "records");
102
+ const v = c.slice(u, u + 2).filter((y) => y !== "records");
99
103
  k.push(
100
- /* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: g.map((f) => w(f, 4)) }, g.join("+"))
101
- ), m += g.length;
104
+ /* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: v.map((y) => x(y, 4)) }, v.join("+"))
105
+ ), u += v.length;
102
106
  }
103
- return /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work-loading": !0, "aria-busy": "true", children: [
104
- /* @__PURE__ */ d("div", { className: "flex items-start justify-between", children: [
105
- /* @__PURE__ */ e("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: ["Waiting on you", "SLA breached", "Open tasks", "Unread notifications"].map((m) => /* @__PURE__ */ d(
107
+ return /* @__PURE__ */ n("div", { className: "space-y-5 p-6", "data-my-work-loading": !0, "aria-busy": "true", children: [
108
+ /* @__PURE__ */ n("div", { className: "flex items-start justify-between", children: [
109
+ /* @__PURE__ */ e("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: ["Waiting on you", "SLA breached", "Open tasks", "Unread notifications"].map((u) => /* @__PURE__ */ n(
106
110
  "div",
107
111
  {
108
112
  className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card",
109
113
  children: [
110
- /* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: m }),
111
- /* @__PURE__ */ e("p", { className: "mt-0.5 flex h-[27px] items-center", children: /* @__PURE__ */ e(Le, { width: 34, className: "h-[18px] rounded-md" }) })
114
+ /* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: u }),
115
+ /* @__PURE__ */ e("p", { className: "mt-0.5 flex h-[27px] items-center", children: /* @__PURE__ */ e(Je, { width: 34, className: "h-[18px] rounded-md" }) })
112
116
  ]
113
117
  },
114
- m
118
+ u
115
119
  )) }),
116
120
  /* @__PURE__ */ e("span", { className: "ml-3 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] text-slate-400 dark:border-border dark:text-slate-500", children: "Refresh" }),
117
121
  /* @__PURE__ */ e("span", { className: "ml-2 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] text-slate-400 dark:border-border dark:text-slate-500", children: "Customize" })
@@ -119,162 +123,171 @@ function Pe({ order: i, hidden: u }) {
119
123
  k
120
124
  ] });
121
125
  }
122
- function L({ label: i, value: u, tone: c }) {
123
- return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
126
+ function F({ label: i, value: p, tone: c }) {
127
+ return /* @__PURE__ */ n("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
124
128
  /* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: i }),
125
- /* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${c ?? ""}`, children: /* @__PURE__ */ e(Ie, { value: u }) })
129
+ /* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${c ?? ""}`, children: /* @__PURE__ */ e(Ye, { value: p }) })
126
130
  ] });
127
131
  }
128
- function pt({
132
+ function Ot({
129
133
  notificationRoutes: i,
130
- onOpenPath: u
134
+ onOpenPath: p
131
135
  } = {}) {
132
- const { apiBase: c, authHeaders: w, credentials: k } = he(), { open: m } = be(), g = xe(), f = le(), ee = we(), U = (r) => {
133
- var b, l;
134
- const s = ((b = i == null ? void 0 : i.support) == null ? void 0 : b.call(i, String(r))) ?? ((l = g.consoleUrl) == null ? void 0 : l.call(g, `/support?ticket=${r}`)) ?? `/support?ticket=${r}`;
135
- u ? u(s) : g.navigate(s);
136
- }, q = Ne(), [te, $] = C(!1), [x, re] = C(() => {
136
+ const { apiBase: c, authHeaders: x, credentials: k } = Ne(), { open: u } = ve(), v = Ae(), y = _e(), _ = fe(), H = Ie(), J = (r) => {
137
+ var h, m;
138
+ const s = ((h = i == null ? void 0 : i.support) == null ? void 0 : h.call(i, String(r))) ?? ((m = y.consoleUrl) == null ? void 0 : m.call(y, `/support?ticket=${r}`)) ?? `/support?ticket=${r}`;
139
+ p ? p(s) : y.navigate(s);
140
+ }, U = Le(), [me, O] = $(!1), [g, ue] = $(() => {
137
141
  try {
138
142
  const r = localStorage.getItem("nvr_mywork_sections");
139
143
  if (r) {
140
144
  const s = JSON.parse(r);
141
145
  if (Array.isArray(s == null ? void 0 : s.order) && Array.isArray(s == null ? void 0 : s.hidden)) {
142
- const b = R.map((l, p) => ({
143
- k: l,
144
- at: s.order.indexOf(l) >= 0 ? s.order.indexOf(l) : p - 0.5
145
- })).sort((l, p) => l.at - p.at).map((l) => l.k);
146
- return { order: b, hidden: s.hidden.filter((l) => b.includes(l)) };
146
+ const h = ie.map((m, b) => ({
147
+ k: m,
148
+ at: s.order.indexOf(m) >= 0 ? s.order.indexOf(m) : b - 0.5
149
+ })).sort((m, b) => m.at - b.at).map((m) => m.k);
150
+ return { order: h, hidden: s.hidden.filter((m) => h.includes(m)) };
147
151
  }
148
152
  }
149
153
  } catch {
150
154
  }
151
- return { order: [...R], hidden: [] };
152
- }), K = (r) => {
153
- re(r);
155
+ return { order: [...ie], hidden: [] };
156
+ }), V = (r) => {
157
+ ue(r);
154
158
  try {
155
159
  localStorage.setItem("nvr_mywork_sections", JSON.stringify(r));
156
160
  } catch {
157
161
  }
158
- }, [ae, de] = C(!1), P = W(0), [S, se] = C("all"), { data: a, isLoading: ne, refetch: Q, isFetching: B } = ce({
162
+ }, [pe, he] = $(!1), Y = B(0), [I, be] = $("all"), [W, Z] = $(null), { data: L } = Ke(), w = ne(() => {
163
+ const r = W ? L == null ? void 0 : L.find((s) => s.user_id === W) : null;
164
+ return r ? { userId: r.user_id, name: r.first_name || r.name, keys: new Set(r.keys) } : null;
165
+ }, [W, L]), { data: a, isLoading: xe, refetch: R, isFetching: G } = ke({
159
166
  queryKey: ["my-work"],
160
167
  queryFn: async () => {
161
- const r = await fetch(`${c}/my-work`, { headers: w, credentials: k });
168
+ const r = await fetch(`${c}/my-work`, { headers: x, credentials: k });
162
169
  if (!r.ok) throw new Error("my-work failed");
163
170
  return (await r.json()).data;
164
171
  },
165
172
  staleTime: 6e4
166
- }), z = W(0), N = W(null), H = () => {
173
+ }), X = B(0), T = B(null), ee = () => {
167
174
  const r = () => {
168
- N.current = null, z.current = Date.now(), $(!1), f.invalidateQueries({ queryKey: ["my-work"] });
169
- }, s = z.current + Fe - Date.now();
170
- N.current || (s <= 0 ? r() : N.current = setTimeout(r, s));
175
+ T.current = null, X.current = Date.now(), O(!1), _.invalidateQueries({ queryKey: ["my-work"] });
176
+ }, s = X.current + Re - Date.now();
177
+ T.current || (s <= 0 ? r() : T.current = setTimeout(r, s));
171
178
  };
172
- fe("my-work", H, { debounceMs: 1500 }), ge("notification:new", H, { debounceMs: 1500 }), E(
179
+ Te("my-work", ee, { debounceMs: 1500 }), $e("notification:new", ee, { debounceMs: 1500 }), z(
173
180
  () => () => {
174
- N.current && clearTimeout(N.current);
181
+ T.current && clearTimeout(T.current);
175
182
  },
176
183
  []
177
184
  );
178
- const J = ke([
185
+ const te = je([
179
186
  ...((a == null ? void 0 : a.owned) ?? []).map((r) => `o:${r.collection}:${r.item}`),
180
187
  ...((a == null ? void 0 : a.tasks) ?? []).map((r) => `t:${r.id}`),
181
188
  ...((a == null ? void 0 : a.team_tasks) ?? []).map((r) => `tt:${r.id}`),
182
189
  ...((a == null ? void 0 : a.requested) ?? []).map((r) => `r:${r.id}`),
183
- ...((a == null ? void 0 : a.notifications) ?? []).map((r) => `n:${r.id}`)
184
- ]), v = (r) => J.has(r) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", I = pe(() => {
190
+ ...((a == null ? void 0 : a.notifications) ?? []).map((r) => `n:${r.id}`),
191
+ ...((a == null ? void 0 : a.proposals) ?? []).map((r) => `p:${r.id}`)
192
+ ]), C = (r) => te.has(r) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", E = ne(() => {
185
193
  const r = /* @__PURE__ */ new Set();
186
194
  for (const s of (a == null ? void 0 : a.owned) ?? []) s.collection && r.add(s.collection);
187
195
  return [...r];
188
196
  }, [a]);
189
- E(() => {
190
- if (!(!q || I.length === 0))
191
- return q.subscribeCollections(I, () => {
197
+ z(() => {
198
+ if (!(!U || E.length === 0))
199
+ return U.subscribeCollections(E, () => {
192
200
  const r = Date.now();
193
- r - P.current < 3e4 || (P.current = r, $(!0));
201
+ r - Y.current < 3e4 || (Y.current = r, O(!0));
194
202
  });
195
- }, [q, I]);
196
- const V = F({
203
+ }, [U, E]);
204
+ const re = K({
197
205
  // A ticket closes through /support so its requester hears about it.
198
206
  mutationFn: (r) => fetch(`${c}/${r.kind === "support" ? "support/tickets" : "tasks"}/${r.id}`, {
199
207
  method: "PATCH",
200
- headers: { ...w, "content-type": "application/json" },
208
+ headers: { ...x, "content-type": "application/json" },
201
209
  credentials: k,
202
210
  body: JSON.stringify({ status: "done" })
203
211
  }),
204
- onSuccess: () => f.invalidateQueries({ queryKey: ["my-work"] })
205
- }), T = F({
212
+ onSuccess: () => _.invalidateQueries({ queryKey: ["my-work"] })
213
+ }), A = K({
206
214
  mutationFn: async ({ id: r, action: s }) => {
207
- const b = await fetch(`${c}/tasks/${r}/${s}`, {
215
+ const h = await fetch(`${c}/tasks/${r}/${s}`, {
208
216
  method: "POST",
209
- headers: { ...w, "content-type": "application/json" },
217
+ headers: { ...x, "content-type": "application/json" },
210
218
  credentials: k,
211
219
  body: "{}"
212
- }), l = await b.json().catch(() => ({}));
213
- if (!b.ok) throw new Error(l.error ?? "Failed");
220
+ }), m = await h.json().catch(() => ({}));
221
+ if (!h.ok) throw new Error(m.error ?? "Failed");
214
222
  return s;
215
223
  },
216
224
  onSuccess: (r) => {
217
- D(r === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), f.invalidateQueries({ queryKey: ["my-work"] });
225
+ P(r === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), _.invalidateQueries({ queryKey: ["my-work"] });
218
226
  },
219
- onError: (r) => D(ve(r, "Failed"))
220
- }), [j, D] = C(null);
221
- E(() => {
222
- if (!j) return;
223
- const r = setTimeout(() => D(null), 4e3);
227
+ onError: (r) => P(Me(r, "Failed"))
228
+ }), [M, P] = $(null);
229
+ z(() => {
230
+ if (!M) return;
231
+ const r = setTimeout(() => P(null), 4e3);
224
232
  return () => clearTimeout(r);
225
- }, [j]);
226
- const Y = F({
233
+ }, [M]);
234
+ const ae = K({
227
235
  mutationFn: (r) => fetch(`${c}/notifications/mark-read`, {
228
236
  method: "POST",
229
- headers: { ...w, "content-type": "application/json" },
237
+ headers: { ...x, "content-type": "application/json" },
230
238
  credentials: k,
231
239
  body: JSON.stringify({ ids: r })
232
240
  }),
233
241
  onSuccess: () => {
234
- f.invalidateQueries({ queryKey: ["my-work"] }), f.invalidateQueries({ queryKey: ["notifications"] });
242
+ _.invalidateQueries({ queryKey: ["my-work"] }), _.invalidateQueries({ queryKey: ["notifications"] });
243
+ }
244
+ }), S = (r, s, h, m) => {
245
+ if (r && s && de(r)) {
246
+ const l = (m ?? []).filter((d) => d.collection && d.item && de(d.collection)).map((d) => ({ collection: d.collection, itemId: String(d.item) }));
247
+ if (v({ collection: r, itemId: String(s) }, h, { list: l }) !== "navigate")
248
+ return;
235
249
  }
236
- }), _ = (r, s) => {
237
250
  const b = {
238
- record: (p, t) => (m({ collection: p, itemId: t }), null),
251
+ record: (l, d) => (u({ collection: l, itemId: d }), null),
239
252
  ...i
240
- }, l = Z(r, s, {
253
+ }, t = se(r, s, {
241
254
  ...b,
242
- record: (p, t) => {
243
- var h;
244
- return ((h = i == null ? void 0 : i.record) == null ? void 0 : h.call(i, p, t)) ?? null;
255
+ record: (l, d) => {
256
+ var f;
257
+ return ((f = i == null ? void 0 : i.record) == null ? void 0 : f.call(i, l, d)) ?? null;
245
258
  }
246
259
  });
247
- if (l) {
248
- ye(l, (p) => u == null ? void 0 : u(p));
260
+ if (t) {
261
+ Oe(t, (l) => p == null ? void 0 : p(l));
249
262
  return;
250
263
  }
251
- r && s && !/^nivaro_/i.test(r) && r !== "__chat__" && m({ collection: r, itemId: s });
252
- }, oe = (r, s) => r && s && !/^nivaro_/i.test(r) && r !== "__chat__" ? !0 : !!Z(r, s, {
264
+ r && s && !/^nivaro_/i.test(r) && r !== "__chat__" && u({ collection: r, itemId: s });
265
+ }, ge = (r, s) => r && s && !/^nivaro_/i.test(r) && r !== "__chat__" ? !0 : !!se(r, s, {
253
266
  record: () => null,
254
267
  ...i
255
268
  });
256
- return ne || !a ? /* @__PURE__ */ e(Pe, { order: x.order, hidden: x.hidden }) : /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work": !0, children: [
257
- /* @__PURE__ */ e($e, { onOpenPath: u }),
258
- /* @__PURE__ */ d("div", { className: "flex items-start justify-between", children: [
259
- /* @__PURE__ */ d("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: [
260
- /* @__PURE__ */ e(L, { label: "Waiting on you", value: a.counts.owned }),
269
+ return xe || !a ? /* @__PURE__ */ e(rt, { order: g.order, hidden: g.hidden }) : /* @__PURE__ */ n("div", { className: "space-y-5 p-6", "data-my-work": !0, children: [
270
+ /* @__PURE__ */ e(Ue, { onOpenPath: p }),
271
+ /* @__PURE__ */ n("div", { className: "flex items-start justify-between", children: [
272
+ /* @__PURE__ */ n("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: [
273
+ /* @__PURE__ */ e(F, { label: "Waiting on you", value: a.counts.owned }),
261
274
  /* @__PURE__ */ e(
262
- L,
275
+ F,
263
276
  {
264
277
  label: "SLA breached",
265
278
  value: a.counts.owned_breached,
266
279
  tone: a.counts.owned_breached > 0 ? "text-red-600 dark:text-red-400" : ""
267
280
  }
268
281
  ),
269
- /* @__PURE__ */ e(L, { label: "Open tasks", value: a.counts.tasks }),
270
- /* @__PURE__ */ e(L, { label: "Unread notifications", value: a.counts.notifications })
282
+ /* @__PURE__ */ e(F, { label: "Open tasks", value: a.counts.tasks }),
283
+ /* @__PURE__ */ e(F, { label: "Unread notifications", value: a.counts.notifications })
271
284
  ] }),
272
- te && /* @__PURE__ */ d(
285
+ me && /* @__PURE__ */ n(
273
286
  "button",
274
287
  {
275
288
  type: "button",
276
289
  onClick: () => {
277
- $(!1), Q();
290
+ O(!1), R();
278
291
  },
279
292
  className: "ml-3 inline-flex items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-3 py-1.5 text-[12px] font-medium text-[#0e7490] hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
280
293
  children: [
@@ -288,56 +301,56 @@ function pt({
288
301
  {
289
302
  type: "button",
290
303
  onClick: () => {
291
- $(!1), Q();
304
+ O(!1), R();
292
305
  },
293
- disabled: B,
306
+ disabled: G,
294
307
  className: "ml-3 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted disabled:opacity-50 dark:border-border",
295
- children: B ? "Refreshing…" : "Refresh"
308
+ children: G ? "Refreshing…" : "Refresh"
296
309
  }
297
310
  ),
298
- /* @__PURE__ */ d("div", { className: "relative ml-2", children: [
311
+ /* @__PURE__ */ n("div", { className: "relative ml-2", children: [
299
312
  /* @__PURE__ */ e(
300
313
  "button",
301
314
  {
302
315
  type: "button",
303
- onClick: () => de((r) => !r),
316
+ onClick: () => he((r) => !r),
304
317
  className: "rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted dark:border-border",
305
318
  children: "Customize"
306
319
  }
307
320
  ),
308
- ae && /* @__PURE__ */ d("div", { className: "absolute right-0 top-full z-20 mt-1 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
321
+ pe && /* @__PURE__ */ n("div", { className: "absolute right-0 top-full z-20 mt-1 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
309
322
  /* @__PURE__ */ e("p", { className: "px-1 pb-1.5 text-[11px] font-semibold text-slate-500", children: "Sections" }),
310
- x.order.map((r, s) => {
311
- const b = X[r] ?? r, l = x.hidden.includes(r), p = (t) => {
312
- const h = [...x.order], o = s + t;
313
- o < 0 || o >= h.length || ([h[s], h[o]] = [h[o], h[s]], K({ ...x, order: h }));
323
+ g.order.map((r, s) => {
324
+ const h = ce[r] ?? r, m = g.hidden.includes(r), b = (t) => {
325
+ const l = [...g.order], d = s + t;
326
+ d < 0 || d >= l.length || ([l[s], l[d]] = [l[d], l[s]], V({ ...g, order: l }));
314
327
  };
315
- return /* @__PURE__ */ d("div", { className: "flex items-center gap-1 rounded px-1 py-1 hover:bg-muted", children: [
328
+ return /* @__PURE__ */ n("div", { className: "flex items-center gap-1 rounded px-1 py-1 hover:bg-muted", children: [
316
329
  /* @__PURE__ */ e(
317
330
  "button",
318
331
  {
319
332
  type: "button",
320
- onClick: () => K({
321
- ...x,
322
- hidden: l ? x.hidden.filter((t) => t !== r) : [...x.hidden, r]
333
+ onClick: () => V({
334
+ ...g,
335
+ hidden: m ? g.hidden.filter((t) => t !== r) : [...g.hidden, r]
323
336
  }),
324
337
  className: "flex h-4 w-4 items-center justify-center rounded border border-slate-300 text-[10px] dark:border-border",
325
- title: l ? "Show section" : "Hide section",
326
- children: l ? "" : "✓"
338
+ title: m ? "Show section" : "Hide section",
339
+ children: m ? "" : "✓"
327
340
  }
328
341
  ),
329
342
  /* @__PURE__ */ e(
330
343
  "span",
331
344
  {
332
- className: `min-w-0 flex-1 truncate text-[12px] ${l ? "text-slate-400 line-through" : ""}`,
333
- children: b
345
+ className: `min-w-0 flex-1 truncate text-[12px] ${m ? "text-slate-400 line-through" : ""}`,
346
+ children: h
334
347
  }
335
348
  ),
336
349
  /* @__PURE__ */ e(
337
350
  "button",
338
351
  {
339
352
  type: "button",
340
- onClick: () => p(-1),
353
+ onClick: () => b(-1),
341
354
  disabled: s === 0,
342
355
  className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
343
356
  children: "↑"
@@ -347,8 +360,8 @@ function pt({
347
360
  "button",
348
361
  {
349
362
  type: "button",
350
- onClick: () => p(1),
351
- disabled: s === x.order.length - 1,
363
+ onClick: () => b(1),
364
+ disabled: s === g.order.length - 1,
352
365
  className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
353
366
  children: "↓"
354
367
  }
@@ -358,70 +371,94 @@ function pt({
358
371
  ] })
359
372
  ] })
360
373
  ] }),
361
- j && /* @__PURE__ */ e(
374
+ M && /* @__PURE__ */ e(
362
375
  "p",
363
376
  {
364
377
  className: "rounded-md border border-slate-200 bg-white px-3 py-2 text-[12px] dark:border-border dark:bg-card",
365
378
  role: "status",
366
379
  "data-my-work-task-note": !0,
367
- children: j
380
+ children: M
368
381
  }
369
382
  ),
370
- /* @__PURE__ */ e(Ce, { questions: a.questions ?? [] }),
371
- /* @__PURE__ */ e(Oe, { className: "mb-4" }),
372
- /* @__PURE__ */ e(Me, { className: "mb-4" }),
383
+ /* @__PURE__ */ e(Fe, { questions: a.questions ?? [] }),
384
+ /* @__PURE__ */ e(
385
+ Be,
386
+ {
387
+ showing: (w == null ? void 0 : w.userId) ?? null,
388
+ onShow: (r) => Z((s) => s === r.user_id ? null : r.user_id)
389
+ }
390
+ ),
391
+ /* @__PURE__ */ e(He, { className: "mb-4" }),
392
+ /* @__PURE__ */ e(ze, { className: "mb-4" }),
373
393
  (() => {
374
394
  const r = {
375
395
  records: () => {
376
- const t = a.owned.filter((n) => G(n.sla)).length, h = a.owned.filter((n) => {
377
- var y;
378
- return ((y = n.sla) == null ? void 0 : y.status) === "breached";
379
- }).length, o = S === "soon" ? a.owned.filter((n) => G(n.sla)) : S === "breached" ? a.owned.filter((n) => {
380
- var y;
381
- return ((y = n.sla) == null ? void 0 : y.status) === "breached";
382
- }) : a.owned, A = [
396
+ const t = a.owned.filter((o) => oe(o.sla)).length, l = a.owned.filter((o) => {
397
+ var N;
398
+ return ((N = o.sla) == null ? void 0 : N.status) === "breached";
399
+ }).length, d = I === "soon" ? a.owned.filter((o) => oe(o.sla)) : I === "breached" ? a.owned.filter((o) => {
400
+ var N;
401
+ return ((N = o.sla) == null ? void 0 : N.status) === "breached";
402
+ }) : a.owned, f = w ? d.filter((o) => w.keys.has(`${o.collection}:${o.item}`)) : d, j = [
383
403
  { key: "all", label: `All (${a.owned.length})` },
384
404
  { key: "soon", label: `Warning within 24h (${t})` },
385
- { key: "breached", label: `Breached (${h})` }
405
+ { key: "breached", label: `Breached (${l})` }
386
406
  ];
387
- return /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
388
- /* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
407
+ return /* @__PURE__ */ n("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
408
+ /* @__PURE__ */ n("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
389
409
  /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Waiting on you" }),
390
410
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Records whose current step resolves you as an owner — most urgent first." })
391
411
  ] }),
392
- a.owned.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1 border-b border-slate-100 px-4 py-2 dark:border-border/60", children: /* @__PURE__ */ e("div", { className: "flex items-center gap-1 rounded-lg bg-slate-100 p-1 dark:bg-muted", children: A.map((n) => /* @__PURE__ */ e(
393
- "button",
394
- {
395
- type: "button",
396
- "data-my-work-sla-filter": n.key,
397
- "aria-pressed": S === n.key,
398
- onClick: () => se(n.key),
399
- className: [
400
- "rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors duration-150",
401
- S === n.key ? "bg-white text-slate-900 shadow-sm dark:bg-card dark:text-foreground" : "text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200"
402
- ].join(" "),
403
- children: n.label
404
- },
405
- n.key
406
- )) }) }),
407
- o.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-6 text-center text-[12.5px] text-muted-foreground", children: a.owned.length === 0 ? "Nothing is waiting on you. Enjoy it." : "Nothing matches this filter." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: o.map((n) => {
408
- var y;
412
+ a.owned.length > 0 && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1 border-b border-slate-100 px-4 py-2 dark:border-border/60", children: [
413
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-1 rounded-lg bg-slate-100 p-1 dark:bg-muted", children: j.map((o) => /* @__PURE__ */ e(
414
+ "button",
415
+ {
416
+ type: "button",
417
+ "data-my-work-sla-filter": o.key,
418
+ "aria-pressed": I === o.key,
419
+ onClick: () => be(o.key),
420
+ className: [
421
+ "rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors duration-150",
422
+ I === o.key ? "bg-white text-slate-900 shadow-sm dark:bg-card dark:text-foreground" : "text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200"
423
+ ].join(" "),
424
+ children: o.label
425
+ },
426
+ o.key
427
+ )) }),
428
+ w && /* @__PURE__ */ n(
429
+ "button",
430
+ {
431
+ type: "button",
432
+ "data-my-work-cover-filter": !0,
433
+ onClick: () => Z(null),
434
+ "aria-label": `Show all records, not only ${w.name}'s`,
435
+ className: "ml-1 inline-flex items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-2.5 py-1 text-[11px] font-medium text-[#0e7490] hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
436
+ children: [
437
+ w.name,
438
+ "'s records",
439
+ /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-[12px] leading-none", children: "×" })
440
+ ]
441
+ }
442
+ )
443
+ ] }),
444
+ f.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-6 text-center text-[12.5px] text-muted-foreground", children: a.owned.length === 0 ? "Nothing is waiting on you. Enjoy it." : "Nothing matches this filter." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: f.map((o) => {
445
+ var N;
409
446
  return /* @__PURE__ */ e(
410
447
  "li",
411
448
  {
412
- className: v(`o:${n.collection}:${n.item}`),
413
- "data-my-work-fresh": J.has(`o:${n.collection}:${n.item}`) || void 0,
414
- children: /* @__PURE__ */ d(
449
+ className: C(`o:${o.collection}:${o.item}`),
450
+ "data-my-work-fresh": te.has(`o:${o.collection}:${o.item}`) || void 0,
451
+ children: /* @__PURE__ */ n(
415
452
  "button",
416
453
  {
417
454
  type: "button",
418
- onClick: () => _(n.collection, n.item),
419
- ...ee.record(n.collection, n.item),
455
+ onClick: (Q) => S(o.collection, o.item, Q, f),
456
+ ...H.record(o.collection, o.item),
420
457
  className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-muted",
421
458
  children: [
422
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children: n.label }),
423
- /* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children: n.collection.replace(/_/g, " ") }),
424
- ((y = n.flags) == null ? void 0 : y.some((ie) => /^on hold$/i.test(ie.name.trim()))) && /* @__PURE__ */ e(
459
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children: o.label }),
460
+ /* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children: o.collection.replace(/_/g, " ") }),
461
+ ((N = o.flags) == null ? void 0 : N.some((Q) => /^on hold$/i.test(Q.name.trim()))) && /* @__PURE__ */ e(
425
462
  "span",
426
463
  {
427
464
  "data-my-work-hold": !0,
@@ -429,54 +466,91 @@ function pt({
429
466
  children: "On hold"
430
467
  }
431
468
  ),
432
- /* @__PURE__ */ e(Ke, { state: n.state, color: n.state_color }),
433
- /* @__PURE__ */ e(Ue, { sla: n.sla })
469
+ /* @__PURE__ */ e(tt, { state: o.state, color: o.state_color }),
470
+ /* @__PURE__ */ e(et, { sla: o.sla })
434
471
  ]
435
472
  }
436
473
  )
437
474
  },
438
- `${n.collection}:${n.item}`
475
+ `${o.collection}:${o.item}`
439
476
  );
440
477
  }) })
441
478
  ] });
442
479
  },
443
- tasks: () => /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
480
+ // Idea 6 — only when something waits on this person's decision.
481
+ proposals: () => (a.proposals ?? []).length === 0 ? null : /* @__PURE__ */ n(
482
+ "section",
483
+ {
484
+ className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
485
+ "data-my-work-proposals": !0,
486
+ children: [
487
+ /* @__PURE__ */ n("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
488
+ /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Changes to review" }),
489
+ /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Proposed changes on locked records — open one to compare old and new and accept or decline it." })
490
+ ] }),
491
+ /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (a.proposals ?? []).map((t) => /* @__PURE__ */ e("li", { className: C(`p:${t.id}`), "data-my-work-proposal": t.id, children: /* @__PURE__ */ n(
492
+ "button",
493
+ {
494
+ type: "button",
495
+ onClick: () => S(t.collection, t.item),
496
+ ...H.record(t.collection, t.item),
497
+ className: "flex w-full items-start gap-2.5 px-4 py-2 text-left hover:bg-muted",
498
+ children: [
499
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
500
+ /* @__PURE__ */ n("span", { className: "flex flex-wrap items-baseline gap-x-2", children: [
501
+ /* @__PURE__ */ e("span", { className: "text-[12.5px] font-medium", children: t.item_label }),
502
+ /* @__PURE__ */ e("span", { className: "text-[11.5px] text-muted-foreground", children: t.fields.join(", ") })
503
+ ] }),
504
+ /* @__PURE__ */ n("span", { className: "mt-0.5 block truncate text-[11.5px] text-slate-500 dark:text-slate-400", children: [
505
+ t.created_by_name ?? "Someone",
506
+ ": ",
507
+ t.reason
508
+ ] })
509
+ ] }),
510
+ /* @__PURE__ */ e("span", { className: "shrink-0 pt-0.5 text-[11px] text-muted-foreground", children: qe(t.created_at) })
511
+ ]
512
+ }
513
+ ) }, t.id)) })
514
+ ]
515
+ }
516
+ ),
517
+ tasks: () => /* @__PURE__ */ n("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
444
518
  /* @__PURE__ */ e("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "My tasks" }) }),
445
- a.tasks.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "No open tasks." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.tasks.map((t) => /* @__PURE__ */ d(
519
+ a.tasks.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "No open tasks." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.tasks.map((t) => /* @__PURE__ */ n(
446
520
  "li",
447
521
  {
448
- className: M("flex items-center gap-2.5 px-4 py-2", v(`t:${t.id}`)),
522
+ className: D("flex items-center gap-2.5 px-4 py-2", C(`t:${t.id}`)),
449
523
  children: [
450
524
  /* @__PURE__ */ e(
451
525
  "button",
452
526
  {
453
527
  type: "button",
454
528
  title: "Mark done",
455
- onClick: () => V.mutate(t),
456
- disabled: V.isPending,
529
+ onClick: () => re.mutate(t),
530
+ disabled: re.isPending,
457
531
  className: "flex h-4 w-4 shrink-0 items-center justify-center rounded border border-slate-300 text-transparent hover:border-emerald-500 hover:text-emerald-500 dark:border-border",
458
532
  children: "✓"
459
533
  }
460
534
  ),
461
535
  t.priority === "urgent" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" }),
462
536
  t.kind === "support" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-slate-100 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-slate-600 dark:bg-white/10 dark:text-slate-300", children: "support" }),
463
- t.agent_assignee && /* @__PURE__ */ d(
537
+ t.agent_assignee && /* @__PURE__ */ n(
464
538
  "span",
465
539
  {
466
540
  className: "inline-flex shrink-0 items-center gap-1 rounded bg-nvr-cyan/10 px-1 py-px text-[10px] font-medium text-[#0e7490] dark:text-[#67e8f9]",
467
541
  "data-tip": `Handed to ${t.agent_name ?? "your agent"} — it picks this up through My Work`,
468
542
  "data-my-work-agent-task": t.id,
469
543
  children: [
470
- /* @__PURE__ */ e(ue, { className: "h-3 w-3", "aria-hidden": !0 }),
544
+ /* @__PURE__ */ e(we, { className: "h-3 w-3", "aria-hidden": !0 }),
471
545
  t.agent_name ?? "Agent"
472
546
  ]
473
547
  }
474
548
  ),
475
- /* @__PURE__ */ d(
549
+ /* @__PURE__ */ n(
476
550
  "button",
477
551
  {
478
552
  type: "button",
479
- onClick: () => t.kind === "support" ? U(t.id) : _(t.collection, t.item),
553
+ onClick: (l) => t.kind === "support" ? J(t.id) : S(t.collection, t.item, l),
480
554
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
481
555
  children: [
482
556
  t.title,
@@ -485,18 +559,18 @@ function pt({
485
559
  }
486
560
  ),
487
561
  /* @__PURE__ */ e(
488
- Se,
562
+ We,
489
563
  {
490
564
  task: t,
491
565
  isAssignee: !0,
492
566
  compact: !0,
493
- onTaskChanged: () => void f.invalidateQueries({ queryKey: ["my-work"] })
567
+ onTaskChanged: () => void _.invalidateQueries({ queryKey: ["my-work"] })
494
568
  }
495
569
  ),
496
570
  t.due_date && /* @__PURE__ */ e(
497
571
  "span",
498
572
  {
499
- className: `text-[11px] tabular-nums ${O(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
573
+ className: `text-[11px] tabular-nums ${q(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
500
574
  children: new Date(t.due_date).toLocaleDateString(void 0, { timeZone: "UTC" })
501
575
  }
502
576
  )
@@ -505,28 +579,28 @@ function pt({
505
579
  t.id
506
580
  )) })
507
581
  ] }),
508
- team: () => !a.on_a_team && !(a.team_tasks ?? []).length ? null : /* @__PURE__ */ d(
582
+ team: () => !a.on_a_team && !(a.team_tasks ?? []).length ? null : /* @__PURE__ */ n(
509
583
  "section",
510
584
  {
511
585
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
512
586
  "data-my-work-team": !0,
513
587
  children: [
514
- /* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
588
+ /* @__PURE__ */ n("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
515
589
  /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Team tasks" }),
516
590
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Waiting with a team you are on — pick one up to make it yours." })
517
591
  ] }),
518
- (a.team_tasks ?? []).length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "Nothing waiting with your teams." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (a.team_tasks ?? []).map((t) => /* @__PURE__ */ d(
592
+ (a.team_tasks ?? []).length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "Nothing waiting with your teams." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (a.team_tasks ?? []).map((t) => /* @__PURE__ */ n(
519
593
  "li",
520
594
  {
521
- className: M("flex items-center gap-2.5 px-4 py-2", v(`tt:${t.id}`)),
595
+ className: D("flex items-center gap-2.5 px-4 py-2", C(`tt:${t.id}`)),
522
596
  "data-my-work-team-task": t.id,
523
597
  children: [
524
598
  t.priority === "urgent" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" }),
525
- /* @__PURE__ */ d(
599
+ /* @__PURE__ */ n(
526
600
  "button",
527
601
  {
528
602
  type: "button",
529
- onClick: () => _(t.collection, t.item),
603
+ onClick: (l) => S(t.collection, t.item, l),
530
604
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
531
605
  children: [
532
606
  t.title,
@@ -537,7 +611,7 @@ function pt({
537
611
  t.due_date && /* @__PURE__ */ e(
538
612
  "span",
539
613
  {
540
- className: `text-[11px] tabular-nums ${O(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
614
+ className: `text-[11px] tabular-nums ${q(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
541
615
  children: new Date(t.due_date).toLocaleDateString(void 0, {
542
616
  timeZone: "UTC"
543
617
  })
@@ -547,8 +621,8 @@ function pt({
547
621
  "button",
548
622
  {
549
623
  type: "button",
550
- onClick: () => T.mutate({ id: t.id, action: "claim" }),
551
- disabled: T.isPending,
624
+ onClick: () => A.mutate({ id: t.id, action: "claim" }),
625
+ disabled: A.isPending,
552
626
  className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted dark:border-border",
553
627
  "data-my-work-claim": t.id,
554
628
  children: "Pick it up"
@@ -562,110 +636,110 @@ function pt({
562
636
  }
563
637
  ),
564
638
  waiting: () => {
565
- const t = a.requested ?? [], h = t.filter((o) => O(o.due_date)).length;
566
- return /* @__PURE__ */ d(
639
+ const t = a.requested ?? [], l = t.filter((d) => q(d.due_date)).length;
640
+ return /* @__PURE__ */ n(
567
641
  "section",
568
642
  {
569
643
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
570
644
  "data-my-work-waiting": !0,
571
645
  children: [
572
- /* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
573
- /* @__PURE__ */ d("h2", { className: "text-[13px] font-medium", children: [
646
+ /* @__PURE__ */ n("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
647
+ /* @__PURE__ */ n("h2", { className: "text-[13px] font-medium", children: [
574
648
  "Waiting on others",
575
- h > 0 && /* @__PURE__ */ d("span", { className: "ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10.5px] font-semibold text-red-600 dark:text-red-400", children: [
576
- h,
649
+ l > 0 && /* @__PURE__ */ n("span", { className: "ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10.5px] font-semibold text-red-600 dark:text-red-400", children: [
650
+ l,
577
651
  " overdue"
578
652
  ] })
579
653
  ] }),
580
654
  /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Tasks you asked someone else to do." })
581
655
  ] }),
582
- t.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You are not waiting on anyone." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: t.map((o) => {
583
- const A = O(o.due_date), n = !!o.nudged_at && Date.now() - new Date(o.nudged_at).getTime() < 20 * 36e5;
584
- return /* @__PURE__ */ d(
656
+ t.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You are not waiting on anyone." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: t.map((d) => {
657
+ const f = q(d.due_date), j = !!d.nudged_at && Date.now() - new Date(d.nudged_at).getTime() < 20 * 36e5;
658
+ return /* @__PURE__ */ n(
585
659
  "li",
586
660
  {
587
- className: M("flex items-center gap-2.5 px-4 py-2", v(`r:${o.id}`)),
588
- "data-my-work-requested": o.id,
661
+ className: D("flex items-center gap-2.5 px-4 py-2", C(`r:${d.id}`)),
662
+ "data-my-work-requested": d.id,
589
663
  children: [
590
- /* @__PURE__ */ d(
664
+ /* @__PURE__ */ n(
591
665
  "button",
592
666
  {
593
667
  type: "button",
594
- onClick: () => o.kind === "support" ? U(o.id) : _(o.collection, o.item),
668
+ onClick: (o) => d.kind === "support" ? J(d.id) : S(d.collection, d.item, o),
595
669
  className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
596
670
  children: [
597
- o.title,
671
+ d.title,
598
672
  /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: [
599
- o.assignee_name ?? (o.team_name ? `${o.team_name} team` : "Unassigned"),
600
- o.item_label
673
+ d.assignee_name ?? (d.team_name ? `${d.team_name} team` : "Unassigned"),
674
+ d.item_label
601
675
  ].filter(Boolean).join(" · ") })
602
676
  ]
603
677
  }
604
678
  ),
605
- o.due_date && /* @__PURE__ */ d(
679
+ d.due_date && /* @__PURE__ */ n(
606
680
  "span",
607
681
  {
608
- className: `text-[11px] tabular-nums ${A ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
682
+ className: `text-[11px] tabular-nums ${f ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
609
683
  children: [
610
- A ? "Overdue · " : "",
611
- new Date(o.due_date).toLocaleDateString(void 0, {
684
+ f ? "Overdue · " : "",
685
+ new Date(d.due_date).toLocaleDateString(void 0, {
612
686
  timeZone: "UTC"
613
687
  })
614
688
  ]
615
689
  }
616
690
  ),
617
- o.kind !== "support" && /* @__PURE__ */ e(
691
+ d.kind !== "support" && /* @__PURE__ */ e(
618
692
  "button",
619
693
  {
620
694
  type: "button",
621
- onClick: () => T.mutate({ id: o.id, action: "nudge" }),
622
- disabled: T.isPending || n,
623
- title: n ? "Already nudged today" : "Send a reminder",
695
+ onClick: () => A.mutate({ id: d.id, action: "nudge" }),
696
+ disabled: A.isPending || j,
697
+ title: j ? "Already nudged today" : "Send a reminder",
624
698
  className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted disabled:opacity-50 dark:border-border",
625
- "data-my-work-nudge": o.id,
626
- children: n ? "Nudged" : "Nudge"
699
+ "data-my-work-nudge": d.id,
700
+ children: j ? "Nudged" : "Nudge"
627
701
  }
628
702
  )
629
703
  ]
630
704
  },
631
- o.id
705
+ d.id
632
706
  );
633
707
  }) })
634
708
  ]
635
709
  }
636
710
  );
637
711
  },
638
- notifications: () => /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
639
- /* @__PURE__ */ d("div", { className: "flex items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
712
+ notifications: () => /* @__PURE__ */ n("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
713
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
640
714
  /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Unread notifications" }),
641
715
  a.notifications.length > 0 && /* @__PURE__ */ e(
642
716
  "button",
643
717
  {
644
718
  type: "button",
645
- onClick: () => Y.mutate(a.notifications.map((t) => t.id)),
719
+ onClick: () => ae.mutate(a.notifications.map((t) => t.id)),
646
720
  className: "text-[11px] text-[#00a5cc] hover:underline",
647
721
  children: "Mark all read"
648
722
  }
649
723
  )
650
724
  ] }),
651
- a.notifications.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You're all caught up." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.notifications.map((t) => /* @__PURE__ */ d(
725
+ a.notifications.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You're all caught up." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.notifications.map((t) => /* @__PURE__ */ n(
652
726
  "li",
653
727
  {
654
- className: M("flex items-start gap-2.5 px-4 py-2", v(`n:${t.id}`)),
728
+ className: D("flex items-start gap-2.5 px-4 py-2", C(`n:${t.id}`)),
655
729
  children: [
656
730
  /* @__PURE__ */ e(
657
- De,
731
+ Ze,
658
732
  {
659
733
  userId: t.sender,
660
734
  className: "mt-0.5 h-5 w-5",
661
735
  fallback: /* @__PURE__ */ e("span", { className: "mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-slate-100 text-[9px] font-semibold text-slate-500 dark:bg-muted" })
662
736
  }
663
737
  ),
664
- oe(t.collection, t.item) ? /* @__PURE__ */ d(
738
+ ge(t.collection, t.item) ? /* @__PURE__ */ n(
665
739
  "button",
666
740
  {
667
741
  type: "button",
668
- onClick: () => _(t.collection, t.item),
742
+ onClick: (l) => S(t.collection, t.item, l, a.notifications),
669
743
  className: "min-w-0 flex-1 cursor-pointer text-left hover:opacity-80",
670
744
  children: [
671
745
  /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children: t.subject }),
@@ -674,7 +748,7 @@ function pt({
674
748
  }
675
749
  ) : (
676
750
  // Nowhere to open: plain text, never a button that does nothing.
677
- /* @__PURE__ */ d("div", { className: "min-w-0 flex-1", "data-notification-plain": !0, children: [
751
+ /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", "data-notification-plain": !0, children: [
678
752
  /* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children: t.subject }),
679
753
  t.message && /* @__PURE__ */ e("p", { className: "truncate text-[11.5px] text-muted-foreground", children: t.message })
680
754
  ] })
@@ -685,9 +759,9 @@ function pt({
685
759
  type: "button",
686
760
  "aria-label": "Mark read",
687
761
  "data-tip": "Mark read",
688
- onClick: () => Y.mutate([t.id]),
762
+ onClick: () => ae.mutate([t.id]),
689
763
  className: "mt-0.5 shrink-0 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-700 dark:hover:bg-muted dark:hover:text-slate-200",
690
- children: /* @__PURE__ */ e(me, { className: "h-3 w-3" })
764
+ children: /* @__PURE__ */ e(ye, { className: "h-3 w-3" })
691
765
  }
692
766
  )
693
767
  ]
@@ -696,45 +770,45 @@ function pt({
696
770
  )) })
697
771
  ] })
698
772
  }, s = new Map(
699
- x.order.filter((t) => !x.hidden.includes(t) && r[t]).map((t) => [t, r[t]()]).filter(([, t]) => t != null)
700
- ), b = [...s.keys()], l = [];
701
- let p = 0;
702
- for (; p < b.length; ) {
703
- const t = b[p];
704
- if (t === "records")
705
- l.push(/* @__PURE__ */ e("div", { children: s.get(t) }, t)), p++;
773
+ g.order.filter((t) => !g.hidden.includes(t) && r[t]).map((t) => [t, r[t]()]).filter(([, t]) => t != null)
774
+ ), h = [...s.keys()], m = [];
775
+ let b = 0;
776
+ for (; b < h.length; ) {
777
+ const t = h[b];
778
+ if (le.has(t))
779
+ m.push(/* @__PURE__ */ e("div", { children: s.get(t) }, t)), b++;
706
780
  else {
707
- const h = [t];
708
- p + 1 < b.length && b[p + 1] !== "records" && h.push(b[p + 1]), l.push(
709
- /* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: h.map((o) => /* @__PURE__ */ e("div", { children: s.get(o) }, o)) }, h.join("+"))
710
- ), p += h.length;
781
+ const l = [t];
782
+ b + 1 < h.length && !le.has(h[b + 1]) && l.push(h[b + 1]), m.push(
783
+ /* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: l.map((d) => /* @__PURE__ */ e("div", { children: s.get(d) }, d)) }, l.join("+"))
784
+ ), b += l.length;
711
785
  }
712
786
  }
713
- return l;
787
+ return m;
714
788
  })(),
715
- /* @__PURE__ */ e(Qe, {})
789
+ /* @__PURE__ */ e(at, {})
716
790
  ] });
717
791
  }
718
- function Qe() {
719
- const i = je(), { rooms: u } = Ae(i);
720
- return !i || u.length === 0 ? null : /* @__PURE__ */ d(
792
+ function at() {
793
+ const i = Pe(), { rooms: p } = Qe(i);
794
+ return !i || p.length === 0 ? null : /* @__PURE__ */ n(
721
795
  "section",
722
796
  {
723
797
  className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
724
798
  "data-my-work-chat": !0,
725
799
  children: [
726
800
  /* @__PURE__ */ e("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Record conversations" }) }),
727
- /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: u.map((c) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
801
+ /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: p.map((c) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ n(
728
802
  "button",
729
803
  {
730
804
  type: "button",
731
- onClick: () => Te(c.room, c.label),
805
+ onClick: () => Ee(c.room, c.label),
732
806
  className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-muted/40",
733
807
  "data-my-work-chat-room": c.room,
734
808
  children: [
735
- /* @__PURE__ */ d("span", { className: "min-w-0 flex-1", children: [
809
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
736
810
  /* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium", children: c.label }),
737
- c.last_message && /* @__PURE__ */ d("span", { className: "block truncate text-[11.5px] text-muted-foreground", children: [
811
+ c.last_message && /* @__PURE__ */ n("span", { className: "block truncate text-[11.5px] text-muted-foreground", children: [
738
812
  c.last_message.sender_name ? `${c.last_message.sender_name}: ` : "",
739
813
  c.last_message.message.replace(/@\[([^\]]+)\]/g, "@$1")
740
814
  ] })
@@ -749,5 +823,5 @@ function Qe() {
749
823
  );
750
824
  }
751
825
  export {
752
- pt as MyWorkView
826
+ Ot as MyWorkView
753
827
  };