@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,80 +1,96 @@
1
- import { jsxs as n, jsx as t, Fragment as P } from "react/jsx-runtime";
2
- import { useQueryClient as R, useQuery as v, useMutation as _ } from "@tanstack/react-query";
3
- import { Plus as I, Search as U, LifeBuoy as W } from "lucide-react";
4
- import { useState as c, useRef as Y, useEffect as $ } from "react";
5
- import { useNivaroClient as Q, useItemEditAuth as z } from "../../context.js";
6
- import { get as k, patch as H, post as J, del as X } from "../../lib/commands.js";
7
- import { takeSupportDraft as Z } from "../../lib/error-actions.js";
8
- import { useLiveOps as ee } from "../../lib/live-ops.js";
9
- import { RelationCombobox as te } from "../item-edit/RelationCombobox.js";
10
- import { SimpleSelect as ae } from "../ui/SimpleSelect.js";
11
- import { SupportAnalytics as re } from "./SupportAnalytics.js";
12
- import { SupportRequestDialog as se } from "./SupportRequestDialog.js";
13
- import { StatusPill as ne, TicketDetailSheet as le } from "./TicketDetailSheet.js";
14
- function oe(l) {
1
+ import { jsxs as n, jsx as t, Fragment as W } from "react/jsx-runtime";
2
+ import { useQuery as w, useQueryClient as Y, useMutation as A } from "@tanstack/react-query";
3
+ import { Plus as z, Search as H, LifeBuoy as J } from "lucide-react";
4
+ import { useState as c, useRef as X, useEffect as B, useCallback as Z } from "react";
5
+ import { useNivaroClient as T, useItemEditAuth as ee } from "../../context.js";
6
+ import { get as S, patch as te, post as ae, del as re } from "../../lib/commands.js";
7
+ import { takeSupportDraft as se } from "../../lib/error-actions.js";
8
+ import { useLiveRefresh as ne } from "../../lib/live-counts.js";
9
+ import { useSettledRows as le, useLiveFade as oe } from "../../lib/live-screen.js";
10
+ import { useBackgroundArm as de } from "../../lib/live-views.js";
11
+ import { RelationCombobox as ie } from "../item-edit/RelationCombobox.js";
12
+ import { LiveCount as ce } from "../LiveCount.js";
13
+ import { SimpleSelect as pe } from "../ui/SimpleSelect.js";
14
+ import { SupportAnalytics as ue } from "./SupportAnalytics.js";
15
+ import { SupportRequestDialog as me } from "./SupportRequestDialog.js";
16
+ import { StatusPill as he, TicketDetailSheet as xe } from "./TicketDetailSheet.js";
17
+ function be(l) {
15
18
  if (!l) return "";
16
19
  const i = Math.round((Date.now() - new Date(l).getTime()) / 6e4);
17
20
  if (i < 60) return `${Math.max(i, 1)}m ago`;
18
21
  const d = Math.round(i / 60);
19
22
  return d < 48 ? `${d}h ago` : `${Math.round(d / 24)}d ago`;
20
23
  }
21
- function Ne({
24
+ function Ke({
22
25
  initialTicketId: l,
23
26
  onTicketChange: i,
24
27
  className: d
25
28
  }) {
26
- const m = Q(), h = R(), x = z(), b = !!(x != null && x.isAdmin), [s, g] = c("mine"), f = Y(!1), a = (e) => {
27
- f.current = !0, g(e);
28
- }, [r, C] = c(l ?? null), [p, O] = c(
29
- () => typeof window < "u" && /[?&]new=1\b/.test(window.location.search) ? Z() : null
30
- ), [T, A] = c(!!p), [N, D] = c("open"), [y, j] = c("unassigned"), [w, B] = c("");
31
- $(() => {
32
- l != null && C(l);
29
+ const x = T(), b = ee(), q = !!(b != null && b.isAdmin), [s, p] = c("mine"), g = X(!1), f = (e) => {
30
+ g.current = !0, p(e);
31
+ }, [a, r] = c(l ?? null), [m, j] = c(
32
+ () => typeof window < "u" && /[?&]new=1\b/.test(window.location.search) ? se() : null
33
+ ), [E, R] = c(!!m), [y, D] = c("open"), [h, G] = c("unassigned"), [v, O] = c("");
34
+ B(() => {
35
+ l != null && r(l);
33
36
  }, [l]);
34
- const { data: o } = v({
37
+ const { data: o } = w({
35
38
  queryKey: ["support-summary"],
36
- queryFn: () => m.request(k("/support/summary")).then((e) => e.data)
39
+ queryFn: () => x.request(S("/support/summary")).then((e) => e.data)
37
40
  }), F = !!(o != null && o.desk);
38
- ee("support", () => {
39
- h.invalidateQueries({ queryKey: ["support-tickets"] }), h.invalidateQueries({ queryKey: ["support-summary"] }), h.invalidateQueries({ queryKey: ["support-ticket"] });
41
+ ne({
42
+ topic: "support",
43
+ keys: [["support-tickets"], ["support-summary"], ["support-ticket"]]
40
44
  });
41
- const [K, E] = c(!1);
42
- $(() => {
43
- !K && o && (o.desk && !f.current && g("desk"), E(!0));
44
- }, [o, K]);
45
- const q = s === "desk" ? {
45
+ const [$, V] = c(!1);
46
+ B(() => {
47
+ !$ && o && (o.desk && !g.current && p("desk"), V(!0));
48
+ }, [o, $]);
49
+ const _ = s === "desk" ? {
46
50
  scope: "desk",
47
- status: y === "closed" ? "closed" : "open",
48
- ...y === "unassigned" ? { assignee: "unassigned" } : {},
49
- ...y === "me" ? { assignee: "me" } : {}
50
- } : { scope: "mine", status: N };
51
- w.trim() && (q.q = w.trim());
52
- const { data: u, isLoading: G } = v({
53
- queryKey: ["support-tickets", q],
54
- queryFn: () => m.request(k("/support/tickets", q)),
51
+ status: h === "closed" ? "closed" : "open",
52
+ ...h === "unassigned" ? { assignee: "unassigned" } : {},
53
+ ...h === "me" ? { assignee: "me" } : {}
54
+ } : { scope: "mine", status: y };
55
+ v.trim() && (_.q = v.trim());
56
+ const {
57
+ data: u,
58
+ isLoading: P,
59
+ dataUpdatedAt: Q
60
+ } = w({
61
+ queryKey: ["support-tickets", _],
62
+ queryFn: () => x.request(S("/support/tickets", _)),
55
63
  enabled: s !== "types" && s !== "analytics"
56
- }), S = (e) => {
57
- C(e), i == null || i(e);
58
- }, L = [
64
+ }), M = `${s}|${h}|${y}|${v.trim()}`, k = le(u == null ? void 0 : u.data, (e) => String(e.id), {
65
+ resetKey: M,
66
+ enabled: s !== "types" && s !== "analytics"
67
+ }), K = oe(de(Q, M)), U = Z(
68
+ (e) => {
69
+ k.containerRef(e), K(e);
70
+ },
71
+ [k.containerRef, K]
72
+ ), C = (e) => {
73
+ r(e), i == null || i(e);
74
+ }, I = [
59
75
  { key: "mine", label: "My requests", count: o == null ? void 0 : o.mine_open },
60
76
  ...F ? [{ key: "desk", label: "Desk", count: o == null ? void 0 : o.unassigned }] : [],
61
77
  ...F ? [{ key: "analytics", label: "Analytics" }] : [],
62
- ...b ? [{ key: "types", label: "Request types" }] : []
78
+ ...q ? [{ key: "types", label: "Request types" }] : []
63
79
  ];
64
80
  return /* @__PURE__ */ n("div", { className: d, "data-support-view": !0, children: [
65
81
  /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
66
- /* @__PURE__ */ t("div", { className: "flex items-center gap-1", role: "tablist", children: L.map((e) => /* @__PURE__ */ n(
82
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-1", role: "tablist", children: I.map((e) => /* @__PURE__ */ n(
67
83
  "button",
68
84
  {
69
85
  type: "button",
70
86
  role: "tab",
71
87
  "aria-selected": s === e.key,
72
88
  "data-support-tab": e.key,
73
- onClick: () => a(e.key),
89
+ onClick: () => f(e.key),
74
90
  className: s === e.key ? "inline-flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan/10 px-3 text-[12.5px] font-medium text-nvr-navy dark:text-nvr-cyan" : "inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-[12.5px] text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-white/5",
75
91
  children: [
76
92
  e.label,
77
- e.count ? /* @__PURE__ */ t("span", { className: "rounded-full bg-slate-200 px-1.5 text-[10.5px] font-semibold tabular-nums text-slate-700 dark:bg-white/10 dark:text-slate-200", children: e.count }) : null
93
+ e.count ? /* @__PURE__ */ t("span", { className: "rounded-full bg-slate-200 px-1.5 text-[10.5px] font-semibold tabular-nums text-slate-700 dark:bg-white/10 dark:text-slate-200", children: /* @__PURE__ */ t(ce, { value: e.count }) }) : null
78
94
  ]
79
95
  },
80
96
  e.key
@@ -84,16 +100,16 @@ function Ne({
84
100
  {
85
101
  type: "button",
86
102
  "data-support-new": !0,
87
- onClick: () => A(!0),
103
+ onClick: () => R(!0),
88
104
  className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-nvr-cyan/60 bg-nvr-cyan/10 px-3 text-[12.5px] font-medium text-nvr-navy hover:bg-nvr-cyan/15 dark:text-nvr-cyan",
89
105
  children: [
90
- /* @__PURE__ */ t(I, { className: "h-3.5 w-3.5" }),
106
+ /* @__PURE__ */ t(z, { className: "h-3.5 w-3.5" }),
91
107
  " Get help"
92
108
  ]
93
109
  }
94
110
  )
95
111
  ] }),
96
- s === "types" ? /* @__PURE__ */ t(de, {}) : s === "analytics" ? /* @__PURE__ */ t(re, {}) : /* @__PURE__ */ n(P, { children: [
112
+ s === "types" ? /* @__PURE__ */ t(ge, {}) : s === "analytics" ? /* @__PURE__ */ t(ue, {}) : /* @__PURE__ */ n(W, { children: [
97
113
  /* @__PURE__ */ n("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
98
114
  (s === "desk" ? [
99
115
  ["unassigned", "Not picked up"],
@@ -103,28 +119,28 @@ function Ne({
103
119
  ] : [
104
120
  ["open", "Open"],
105
121
  ["closed", "Closed"]
106
- ]).map(([e, V]) => {
107
- const M = s === "desk" ? y === e : N === e;
122
+ ]).map(([e, N]) => {
123
+ const L = s === "desk" ? h === e : y === e;
108
124
  return /* @__PURE__ */ t(
109
125
  "button",
110
126
  {
111
127
  type: "button",
112
128
  "data-support-filter": e,
113
- "aria-pressed": M,
114
- onClick: () => s === "desk" ? j(e) : D(e),
115
- className: M ? "h-7 rounded-full border border-nvr-cyan/60 bg-nvr-cyan/10 px-2.5 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan" : "h-7 rounded-full border border-slate-200 px-2.5 text-[12px] text-slate-600 hover:border-slate-300 dark:border-border dark:text-slate-300",
116
- children: V
129
+ "aria-pressed": L,
130
+ onClick: () => s === "desk" ? G(e) : D(e),
131
+ className: L ? "h-7 rounded-full border border-nvr-cyan/60 bg-nvr-cyan/10 px-2.5 text-[12px] font-medium text-nvr-navy dark:text-nvr-cyan" : "h-7 rounded-full border border-slate-200 px-2.5 text-[12px] text-slate-600 hover:border-slate-300 dark:border-border dark:text-slate-300",
132
+ children: N
117
133
  },
118
134
  e
119
135
  );
120
136
  }),
121
137
  /* @__PURE__ */ n("label", { className: "ml-auto flex h-8 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2 dark:border-border dark:bg-background", children: [
122
- /* @__PURE__ */ t(U, { className: "h-3.5 w-3.5 text-slate-400" }),
138
+ /* @__PURE__ */ t(H, { className: "h-3.5 w-3.5 text-slate-400" }),
123
139
  /* @__PURE__ */ t(
124
140
  "input",
125
141
  {
126
- value: w,
127
- onChange: (e) => B(e.target.value),
142
+ value: v,
143
+ onChange: (e) => O(e.target.value),
128
144
  placeholder: "Search requests",
129
145
  "aria-label": "Search requests",
130
146
  className: "w-48 bg-transparent text-[12.5px] text-slate-900 outline-none dark:text-slate-100"
@@ -132,48 +148,63 @@ function Ne({
132
148
  )
133
149
  ] })
134
150
  ] }),
135
- /* @__PURE__ */ t("div", { className: "mt-3 overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: G ? /* @__PURE__ */ t("div", { className: "space-y-2 p-4", children: [0, 1, 2].map((e) => /* @__PURE__ */ t(
151
+ /* @__PURE__ */ t(
136
152
  "div",
137
153
  {
138
- className: "h-10 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]"
139
- },
140
- e
141
- )) }) : u != null && u.data.length ? /* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", "data-support-list": !0, children: u.data.map((e) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n(
142
- "button",
143
- {
144
- type: "button",
145
- "data-support-row": e.id,
146
- onClick: () => S(e.id),
147
- className: "grid w-full grid-cols-[1fr_auto] items-start gap-3 px-4 py-2.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",
148
- children: [
149
- /* @__PURE__ */ n("span", { className: "min-w-0", children: [
150
- /* @__PURE__ */ n("span", { className: "flex items-center gap-2", children: [
151
- /* @__PURE__ */ n("span", { className: "font-mono text-[11px] text-slate-400", children: [
152
- "#",
153
- e.id
154
- ] }),
155
- /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-slate-900 dark:text-slate-100", children: e.title }),
156
- e.priority === "urgent" && /* @__PURE__ */ t("span", { className: "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" })
157
- ] }),
158
- /* @__PURE__ */ t("span", { className: "mt-0.5 block truncate text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
159
- e.record_label ?? "General Support",
160
- e.category_name,
161
- s === "desk" ? e.requester_name : null,
162
- e.assignee_name ? `with ${e.assignee_name}` : null,
163
- e.replies ? `${e.replies} repl${e.replies === 1 ? "y" : "ies"}` : null
164
- ].filter(Boolean).join(" · ") })
165
- ] }),
166
- /* @__PURE__ */ n("span", { className: "flex flex-col items-end gap-1", children: [
167
- /* @__PURE__ */ t(ne, { status: e.status, label: e.status_label }),
168
- /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: oe(e.updated_at ?? e.created_at) })
169
- ] })
170
- ]
154
+ ref: U,
155
+ className: "mt-3 overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
156
+ children: P ? /* @__PURE__ */ t("div", { className: "space-y-2 p-4", children: [0, 1, 2].map((e) => /* @__PURE__ */ t(
157
+ "div",
158
+ {
159
+ className: "h-10 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]"
160
+ },
161
+ e
162
+ )) }) : k.rows.length ? /* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", "data-support-list": !0, children: k.rows.map(({ row: e, state: N }) => /* @__PURE__ */ t(
163
+ "li",
164
+ {
165
+ "data-departed": N === "departed" || void 0,
166
+ className: N === "departed" ? "opacity-50" : void 0,
167
+ children: /* @__PURE__ */ n(
168
+ "button",
169
+ {
170
+ type: "button",
171
+ "data-support-row": e.id,
172
+ onClick: () => C(e.id),
173
+ className: "grid w-full grid-cols-[1fr_auto] items-start gap-3 px-4 py-2.5 text-left hover:bg-slate-50 dark:hover:bg-white/5",
174
+ children: [
175
+ /* @__PURE__ */ n("span", { className: "min-w-0", children: [
176
+ /* @__PURE__ */ n("span", { className: "flex items-center gap-2", children: [
177
+ /* @__PURE__ */ n("span", { className: "font-mono text-[11px] text-slate-400", children: [
178
+ "#",
179
+ e.id
180
+ ] }),
181
+ /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-slate-900 dark:text-slate-100", children: e.title }),
182
+ e.priority === "urgent" && /* @__PURE__ */ t("span", { className: "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" })
183
+ ] }),
184
+ /* @__PURE__ */ t("span", { className: "mt-0.5 block truncate text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
185
+ e.record_label ?? "General Support",
186
+ e.category_name,
187
+ s === "desk" ? e.requester_name : null,
188
+ e.assignee_name ? `with ${e.assignee_name}` : null,
189
+ e.replies ? `${e.replies} repl${e.replies === 1 ? "y" : "ies"}` : null
190
+ ].filter(Boolean).join(" · ") })
191
+ ] }),
192
+ /* @__PURE__ */ n("span", { className: "flex flex-col items-end gap-1", children: [
193
+ /* @__PURE__ */ t(he, { status: e.status, label: e.status_label }),
194
+ /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400", children: be(e.updated_at ?? e.created_at) })
195
+ ] })
196
+ ]
197
+ }
198
+ )
199
+ },
200
+ e.id
201
+ )) }) : /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-2 px-6 py-12 text-center", children: [
202
+ /* @__PURE__ */ t(J, { className: "h-6 w-6 text-slate-300" }),
203
+ /* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-700 dark:text-slate-200", children: s === "desk" ? h === "unassigned" ? "Every request has been picked up." : "Nothing here." : y === "open" ? "You have no open requests." : "No closed requests yet." }),
204
+ s === "mine" && /* @__PURE__ */ t("p", { className: "max-w-sm text-[12px] text-slate-500 dark:text-muted-foreground", children: "Use Get help for anything general, or Request help on a record (beside Save) to ask for a change to that record." })
205
+ ] })
171
206
  }
172
- ) }, e.id)) }) : /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-2 px-6 py-12 text-center", children: [
173
- /* @__PURE__ */ t(W, { className: "h-6 w-6 text-slate-300" }),
174
- /* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-700 dark:text-slate-200", children: s === "desk" ? y === "unassigned" ? "Every request has been picked up." : "Nothing here." : N === "open" ? "You have no open requests." : "No closed requests yet." }),
175
- s === "mine" && /* @__PURE__ */ t("p", { className: "max-w-sm text-[12px] text-slate-500 dark:text-muted-foreground", children: "Use Get help for anything general, or Request help on a record (beside Save) to ask for a change to that record." })
176
- ] }) }),
207
+ ),
177
208
  u && u.total > u.data.length && /* @__PURE__ */ n("p", { className: "mt-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
178
209
  "Showing ",
179
210
  u.data.length,
@@ -183,40 +214,40 @@ function Ne({
183
214
  ] })
184
215
  ] }),
185
216
  /* @__PURE__ */ t(
186
- se,
217
+ me,
187
218
  {
188
- open: T,
219
+ open: E,
189
220
  onOpenChange: (e) => {
190
- A(e), e || O(null);
221
+ R(e), e || j(null);
191
222
  },
192
- initialTitle: p == null ? void 0 : p.title,
193
- initialDescription: p == null ? void 0 : p.description,
223
+ initialTitle: m == null ? void 0 : m.title,
224
+ initialDescription: m == null ? void 0 : m.description,
194
225
  onCreated: (e) => {
195
- a("mine"), D("open"), S(e.id);
226
+ f("mine"), D("open"), C(e.id);
196
227
  }
197
228
  }
198
229
  ),
199
- /* @__PURE__ */ t(le, { ticketId: r, onOpenChange: (e) => !e && S(null) })
230
+ /* @__PURE__ */ t(xe, { ticketId: a, onOpenChange: (e) => !e && C(null) })
200
231
  ] });
201
232
  }
202
- function de() {
203
- const l = Q(), i = R(), [d, m] = c(""), { data: h = [] } = v({
233
+ function ge() {
234
+ const l = T(), i = Y(), [d, x] = c(""), { data: b = [] } = w({
204
235
  queryKey: ["support-categories", "all"],
205
- queryFn: () => l.request(k("/support/categories", { all: "1" })).then((a) => a.data ?? [])
206
- }), { data: x = [] } = v({
236
+ queryFn: () => l.request(S("/support/categories", { all: "1" })).then((a) => a.data ?? [])
237
+ }), { data: q = [] } = w({
207
238
  queryKey: ["support-teams"],
208
- queryFn: () => l.request(k("/user-groups")).then((a) => a.data ?? []).catch(() => [])
209
- }), b = () => void i.invalidateQueries({ queryKey: ["support-categories"] }), s = _({
210
- mutationFn: ({ id: a, body: r }) => l.request(H(`/support/categories/${a}`, r)),
211
- onSuccess: b
212
- }), g = _({
213
- mutationFn: () => l.request(J("/support/categories", { name: d.trim() })),
239
+ queryFn: () => l.request(S("/user-groups")).then((a) => a.data ?? []).catch(() => [])
240
+ }), s = () => void i.invalidateQueries({ queryKey: ["support-categories"] }), p = A({
241
+ mutationFn: ({ id: a, body: r }) => l.request(te(`/support/categories/${a}`, r)),
242
+ onSuccess: s
243
+ }), g = A({
244
+ mutationFn: () => l.request(ae("/support/categories", { name: d.trim() })),
214
245
  onSuccess: () => {
215
- m(""), b();
246
+ x(""), s();
216
247
  }
217
- }), f = _({
218
- mutationFn: (a) => l.request(X(`/support/categories/${a}`)),
219
- onSuccess: b
248
+ }), f = A({
249
+ mutationFn: (a) => l.request(re(`/support/categories/${a}`)),
250
+ onSuccess: s
220
251
  });
221
252
  return /* @__PURE__ */ n("div", { className: "mt-4 space-y-3", "data-support-types-editor": !0, children: [
222
253
  /* @__PURE__ */ t("p", { className: "max-w-2xl text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "The kinds of request people pick from. A type tied to a collection is offered on those records only; without one it is offered everywhere, including General Support. With no team a request goes to every administrator; a default assignee skips the desk entirely." }),
@@ -229,12 +260,12 @@ function de() {
229
260
  /* @__PURE__ */ t("th", { className: "px-3 py-2 font-medium", children: "Active" }),
230
261
  /* @__PURE__ */ t("th", { className: "px-3 py-2" })
231
262
  ] }) }),
232
- /* @__PURE__ */ t("tbody", { className: "divide-y divide-slate-100 dark:divide-border/60", children: h.map((a) => /* @__PURE__ */ n("tr", { "data-support-type-row": a.id, children: [
263
+ /* @__PURE__ */ t("tbody", { className: "divide-y divide-slate-100 dark:divide-border/60", children: b.map((a) => /* @__PURE__ */ n("tr", { "data-support-type-row": a.id, children: [
233
264
  /* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
234
265
  "input",
235
266
  {
236
267
  defaultValue: a.name,
237
- onBlur: (r) => r.target.value.trim() && r.target.value !== a.name && s.mutate({ id: a.id, body: { name: r.target.value } }),
268
+ onBlur: (r) => r.target.value.trim() && r.target.value !== a.name && p.mutate({ id: a.id, body: { name: r.target.value } }),
238
269
  "aria-label": "Type name",
239
270
  className: "w-full bg-transparent font-medium text-slate-900 outline-none focus:underline dark:text-slate-100"
240
271
  }
@@ -244,29 +275,29 @@ function de() {
244
275
  {
245
276
  defaultValue: a.collection ?? "",
246
277
  placeholder: "Anywhere",
247
- onBlur: (r) => (r.target.value || null) !== a.collection && s.mutate({ id: a.id, body: { collection: r.target.value || null } }),
278
+ onBlur: (r) => (r.target.value || null) !== a.collection && p.mutate({ id: a.id, body: { collection: r.target.value || null } }),
248
279
  "aria-label": "Collection",
249
280
  className: "w-full bg-transparent font-mono text-[12px] text-slate-700 outline-none dark:text-slate-300"
250
281
  }
251
282
  ) }),
252
283
  /* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
253
- ae,
284
+ pe,
254
285
  {
255
286
  value: a.team_id != null ? String(a.team_id) : "",
256
- onChange: (r) => s.mutate({ id: a.id, body: { team_id: r ? Number(r) : null } }),
287
+ onChange: (r) => p.mutate({ id: a.id, body: { team_id: r ? Number(r) : null } }),
257
288
  options: [
258
289
  { value: "", label: "Administrators" },
259
- ...x.map((r) => ({ value: String(r.id), label: r.name }))
290
+ ...q.map((r) => ({ value: String(r.id), label: r.name }))
260
291
  ],
261
292
  ariaLabel: "Team"
262
293
  }
263
294
  ) }),
264
295
  /* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
265
- te,
296
+ ie,
266
297
  {
267
298
  collection: "nivaro_users",
268
299
  value: a.default_assignee,
269
- onChange: (r) => s.mutate({ id: a.id, body: { default_assignee: r ? String(r) : null } }),
300
+ onChange: (r) => p.mutate({ id: a.id, body: { default_assignee: r ? String(r) : null } }),
270
301
  placeholder: "Nobody"
271
302
  }
272
303
  ) }),
@@ -275,7 +306,7 @@ function de() {
275
306
  {
276
307
  type: "checkbox",
277
308
  checked: a.is_active,
278
- onChange: (r) => s.mutate({ id: a.id, body: { is_active: r.target.checked } }),
309
+ onChange: (r) => p.mutate({ id: a.id, body: { is_active: r.target.checked } }),
279
310
  "aria-label": "Active"
280
311
  }
281
312
  ) }),
@@ -302,7 +333,7 @@ function de() {
302
333
  "input",
303
334
  {
304
335
  value: d,
305
- onChange: (a) => m(a.target.value),
336
+ onChange: (a) => x(a.target.value),
306
337
  placeholder: "New type, e.g. Vendor change",
307
338
  "aria-label": "New type name",
308
339
  className: "h-8 w-72 rounded-md border border-slate-200 bg-white px-3 text-[12.5px] outline-none focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-100"
@@ -323,5 +354,5 @@ function de() {
323
354
  ] });
324
355
  }
325
356
  export {
326
- Ne as SupportView
357
+ Ke as SupportView
327
358
  };