@nivaro/react 0.3.116 → 0.3.118

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 (142) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +140 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3855 -3785
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ReportView.js +1086 -1091
  27. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  28. package/dist/shared/components/TipLayer.js +65 -58
  29. package/dist/shared/components/WidgetImageMenu.js +83 -43
  30. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  31. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  32. package/dist/shared/components/cbv/column-totals.js +62 -57
  33. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  34. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  35. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  36. package/dist/shared/components/charts/category-axis.js +93 -0
  37. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  38. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  39. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  40. package/dist/shared/components/collections-directory/page-model.js +72 -67
  41. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  42. package/dist/shared/components/integrations/SendStatus.js +65 -59
  43. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  44. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  45. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  46. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  47. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  48. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  49. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  50. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  51. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  52. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  53. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  54. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  55. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  56. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  57. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  58. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  59. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  60. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  61. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  62. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  63. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  64. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  65. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  66. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  67. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  68. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  69. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  70. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  71. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  72. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  73. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  74. package/dist/shared/components/item-edit/UserChip.js +1 -1
  75. package/dist/shared/components/item-edit/file-live.js +69 -54
  76. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  77. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  78. package/dist/shared/components/item-edit/removed-line.js +31 -25
  79. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  80. package/dist/shared/components/list/ListViewers.js +46 -35
  81. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  82. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  83. package/dist/shared/components/panels/AlertBanners.js +82 -72
  84. package/dist/shared/components/panels/BranchLanes.js +22 -22
  85. package/dist/shared/components/panels/CommentImages.js +123 -102
  86. package/dist/shared/components/panels/CommentPanel.js +186 -185
  87. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  88. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  89. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  90. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  91. package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
  92. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  93. package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
  94. package/dist/shared/components/profile/AgentNameField.js +107 -81
  95. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  96. package/dist/shared/components/profile/PersonAccess.js +599 -495
  97. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  98. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  99. package/dist/shared/components/profile/primitives.js +1 -1
  100. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  101. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  102. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  103. package/dist/shared/components/support/AssignRules.js +1733 -0
  104. package/dist/shared/components/support/PersonPick.js +88 -0
  105. package/dist/shared/components/support/RequestList.js +790 -0
  106. package/dist/shared/components/support/ScreenShare.js +158 -152
  107. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  108. package/dist/shared/components/support/SupportView.js +140 -246
  109. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  110. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  111. package/dist/shared/components/support/assign-rules-text.js +171 -0
  112. package/dist/shared/components/support/support-list.js +125 -0
  113. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  114. package/dist/shared/components/ui/checkbox.js +6 -6
  115. package/dist/shared/components/ui/select.js +43 -39
  116. package/dist/shared/components/ui/sheet.js +9 -9
  117. package/dist/shared/components/ui/switch.js +12 -11
  118. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  119. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  120. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  121. package/dist/shared/lib/activity-sentence.js +103 -91
  122. package/dist/shared/lib/agent-presence.js +27 -21
  123. package/dist/shared/lib/approval-progress.js +2 -2
  124. package/dist/shared/lib/copy-rules.js +31 -24
  125. package/dist/shared/lib/derived-causes.js +113 -78
  126. package/dist/shared/lib/grid-cursors.js +26 -26
  127. package/dist/shared/lib/label-flash.js +27 -0
  128. package/dist/shared/lib/list-return.js +137 -125
  129. package/dist/shared/lib/live-deltas.js +40 -34
  130. package/dist/shared/lib/live-groups.js +56 -52
  131. package/dist/shared/lib/live-preference.js +64 -59
  132. package/dist/shared/lib/live-screen.js +223 -192
  133. package/dist/shared/lib/partner-failure.js +11 -11
  134. package/dist/shared/lib/rollup-recalc.js +68 -64
  135. package/dist/shared/lib/screen-refresh.js +74 -68
  136. package/dist/shared/lib/screen-share.js +108 -104
  137. package/dist/shared/lib/send-status.js +77 -61
  138. package/dist/shared/lib/text-diff-window.js +29 -0
  139. package/dist/shared/lib/use-query-entry.js +17 -0
  140. package/dist/shared/lib/watch-list.js +210 -209
  141. package/dist/shared/lib/widget-image-render.js +72 -49
  142. package/package.json +1 -1
@@ -1,258 +1,152 @@
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) {
18
- if (!l) return "";
19
- const i = Math.round((Date.now() - new Date(l).getTime()) / 6e4);
20
- if (i < 60) return `${Math.max(i, 1)}m ago`;
21
- const d = Math.round(i / 60);
22
- return d < 48 ? `${d}h ago` : `${Math.round(d / 24)}d ago`;
23
- }
24
- function Ke({
25
- initialTicketId: l,
26
- onTicketChange: i,
27
- className: d
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import { useQuery as C, useQueryClient as O, useMutation as A } from "@tanstack/react-query";
3
+ import { Plus as j } from "lucide-react";
4
+ import { useState as u, useRef as E, useEffect as w, useCallback as I } from "react";
5
+ import { useNivaroClient as F, useItemEditAuth as Q } from "../../context.js";
6
+ import { get as R, patch as z, post as B, del as G } from "../../lib/commands.js";
7
+ import { takeSupportDraft as P } from "../../lib/error-actions.js";
8
+ import { useLiveRefresh as H } from "../../lib/live-counts.js";
9
+ import { RelationCombobox as J } from "../item-edit/RelationCombobox.js";
10
+ import { LiveCount as U } from "../LiveCount.js";
11
+ import { SimpleSelect as X } from "../ui/SimpleSelect.js";
12
+ import { AssignRulesView as Y } from "./AssignRules.js";
13
+ import { RequestList as Z } from "./RequestList.js";
14
+ import { SupportAnalytics as ee } from "./SupportAnalytics.js";
15
+ import { SupportRequestDialog as te } from "./SupportRequestDialog.js";
16
+ import { TicketDetailSheet as re } from "./TicketDetailSheet.js";
17
+ function ve({
18
+ initialTicketId: o,
19
+ onTicketChange: m,
20
+ className: c
28
21
  }) {
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);
36
- }, [l]);
37
- const { data: o } = w({
22
+ const y = F(), h = Q(), x = !!(h != null && h.isAdmin), [n, i] = u("mine"), f = E(!1), g = (e) => {
23
+ f.current = !0, i(e);
24
+ }, [r, a] = u(o ?? null), [d, M] = u(
25
+ () => typeof window < "u" && /[?&]new=1\b/.test(window.location.search) ? P() : null
26
+ ), [T, D] = u(!!d);
27
+ w(() => {
28
+ o != null && a(o);
29
+ }, [o]);
30
+ const { data: s } = C({
38
31
  queryKey: ["support-summary"],
39
- queryFn: () => x.request(S("/support/summary")).then((e) => e.data)
40
- }), F = !!(o != null && o.desk);
41
- ne({
32
+ queryFn: () => y.request(R("/support/summary")).then((e) => e.data)
33
+ }), L = !!(s != null && s.desk);
34
+ H({
42
35
  topic: "support",
43
- keys: [["support-tickets"], ["support-summary"], ["support-ticket"]]
36
+ keys: [["support-tickets"], ["support-summary"], ["support-ticket"], ["support-workload"]]
44
37
  });
45
- const [$, V] = c(!1);
46
- B(() => {
47
- !$ && o && (o.desk && !g.current && p("desk"), V(!0));
48
- }, [o, $]);
49
- const _ = s === "desk" ? {
50
- scope: "desk",
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", _)),
63
- enabled: s !== "types" && s !== "analytics"
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 = [
75
- { key: "mine", label: "My requests", count: o == null ? void 0 : o.mine_open },
76
- ...F ? [{ key: "desk", label: "Desk", count: o == null ? void 0 : o.unassigned }] : [],
77
- ...F ? [{ key: "analytics", label: "Analytics" }] : [],
78
- ...q ? [{ key: "types", label: "Request types" }] : []
79
- ];
80
- return /* @__PURE__ */ n("div", { className: d, "data-support-view": !0, children: [
81
- /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
82
- /* @__PURE__ */ t("div", { className: "flex items-center gap-1", role: "tablist", children: I.map((e) => /* @__PURE__ */ n(
83
- "button",
38
+ const [_, V] = u(!1);
39
+ w(() => {
40
+ !_ && s && (s.desk && !f.current && i("desk"), V(!0));
41
+ }, [s, _]);
42
+ const N = (e) => {
43
+ a(e), m == null || m(e);
44
+ }, W = [
45
+ { key: "mine", label: "My requests", count: s == null ? void 0 : s.mine_open },
46
+ ...L ? [{ key: "desk", label: "Desk", count: s == null ? void 0 : s.unassigned }] : [],
47
+ ...L ? [{ key: "analytics", label: "Analytics" }] : [],
48
+ ...x ? [{ key: "types", label: "Request types" }] : [],
49
+ ...x ? [{ key: "rules", label: "Assignment rules" }] : []
50
+ ], S = E(null), [v, $] = u({ left: !1, right: !1 }), b = I(() => {
51
+ const e = S.current;
52
+ if (!e) return;
53
+ const p = e.scrollLeft > 2, k = e.scrollLeft + e.clientWidth < e.scrollWidth - 2;
54
+ $((q) => q.left === p && q.right === k ? q : { left: p, right: k });
55
+ }, []);
56
+ w(() => (b(), window.addEventListener("resize", b), () => window.removeEventListener("resize", b)), [b, W.length]), w(() => {
57
+ const e = S.current, p = e == null ? void 0 : e.querySelector(`[data-support-tab="${n}"]`);
58
+ if (!e || !p || e.scrollWidth <= e.clientWidth) return;
59
+ const k = p.offsetLeft - (e.clientWidth - p.offsetWidth) / 2;
60
+ e.scrollTo({ left: Math.max(0, k), behavior: "smooth" });
61
+ }, [n]);
62
+ const K = v.left || v.right ? (() => {
63
+ const e = `linear-gradient(to right, ${v.left ? "transparent" : "black"}, black 20px, black calc(100% - 28px), ${v.right ? "transparent" : "black"})`;
64
+ return { maskImage: e, WebkitMaskImage: e };
65
+ })() : void 0;
66
+ return /* @__PURE__ */ l("div", { className: c, "data-support-view": !0, children: [
67
+ /* @__PURE__ */ l("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
68
+ /* @__PURE__ */ t(
69
+ "div",
84
70
  {
85
- type: "button",
86
- role: "tab",
87
- "aria-selected": s === e.key,
88
- "data-support-tab": e.key,
89
- onClick: () => f(e.key),
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",
91
- children: [
92
- e.label,
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
94
- ]
95
- },
96
- e.key
97
- )) }),
98
- /* @__PURE__ */ n(
71
+ ref: S,
72
+ onScroll: b,
73
+ className: "relative -mx-1 flex min-w-0 max-w-full items-center gap-1 overflow-x-auto px-1 [scrollbar-width:none]",
74
+ style: K,
75
+ role: "tablist",
76
+ children: W.map((e) => /* @__PURE__ */ l(
77
+ "button",
78
+ {
79
+ type: "button",
80
+ role: "tab",
81
+ "aria-selected": n === e.key,
82
+ "data-support-tab": e.key,
83
+ onClick: () => g(e.key),
84
+ className: n === e.key ? "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md bg-nvr-cyan/10 px-3 text-[12.5px] font-medium text-nvr-navy dark:text-nvr-cyan" : "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-md px-3 text-[12.5px] text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-white/5",
85
+ children: [
86
+ e.label,
87
+ 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(U, { value: e.count }) }) : null
88
+ ]
89
+ },
90
+ e.key
91
+ ))
92
+ }
93
+ ),
94
+ /* @__PURE__ */ l(
99
95
  "button",
100
96
  {
101
97
  type: "button",
102
98
  "data-support-new": !0,
103
- onClick: () => R(!0),
99
+ onClick: () => D(!0),
104
100
  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",
105
101
  children: [
106
- /* @__PURE__ */ t(z, { className: "h-3.5 w-3.5" }),
102
+ /* @__PURE__ */ t(j, { className: "h-3.5 w-3.5" }),
107
103
  " Get help"
108
104
  ]
109
105
  }
110
106
  )
111
107
  ] }),
112
- s === "types" ? /* @__PURE__ */ t(ge, {}) : s === "analytics" ? /* @__PURE__ */ t(ue, {}) : /* @__PURE__ */ n(W, { children: [
113
- /* @__PURE__ */ n("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
114
- (s === "desk" ? [
115
- ["unassigned", "Not picked up"],
116
- ["me", "Mine"],
117
- ["open", "All open"],
118
- ["closed", "Closed"]
119
- ] : [
120
- ["open", "Open"],
121
- ["closed", "Closed"]
122
- ]).map(([e, N]) => {
123
- const L = s === "desk" ? h === e : y === e;
124
- return /* @__PURE__ */ t(
125
- "button",
126
- {
127
- type: "button",
128
- "data-support-filter": e,
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
133
- },
134
- e
135
- );
136
- }),
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: [
138
- /* @__PURE__ */ t(H, { className: "h-3.5 w-3.5 text-slate-400" }),
139
- /* @__PURE__ */ t(
140
- "input",
141
- {
142
- value: v,
143
- onChange: (e) => O(e.target.value),
144
- placeholder: "Search requests",
145
- "aria-label": "Search requests",
146
- className: "w-48 bg-transparent text-[12.5px] text-slate-900 outline-none dark:text-slate-100"
147
- }
148
- )
149
- ] })
150
- ] }),
151
- /* @__PURE__ */ t(
152
- "div",
153
- {
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
- ] })
206
- }
207
- ),
208
- u && u.total > u.data.length && /* @__PURE__ */ n("p", { className: "mt-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
209
- "Showing ",
210
- u.data.length,
211
- " of ",
212
- u.total,
213
- ". Search to narrow the list."
214
- ] })
215
- ] }),
108
+ n === "types" ? /* @__PURE__ */ t(ae, {}) : n === "rules" ? /* @__PURE__ */ t(Y, {}) : n === "analytics" ? /* @__PURE__ */ t(ee, {}) : /* @__PURE__ */ t(Z, { tab: n, openId: r, onOpen: (e) => N(e) }, n),
216
109
  /* @__PURE__ */ t(
217
- me,
110
+ te,
218
111
  {
219
- open: E,
112
+ open: T,
220
113
  onOpenChange: (e) => {
221
- R(e), e || j(null);
114
+ D(e), e || M(null);
222
115
  },
223
- initialTitle: m == null ? void 0 : m.title,
224
- initialDescription: m == null ? void 0 : m.description,
116
+ initialTitle: d == null ? void 0 : d.title,
117
+ initialDescription: d == null ? void 0 : d.description,
118
+ source: d ? "error" : void 0,
225
119
  onCreated: (e) => {
226
- f("mine"), D("open"), C(e.id);
120
+ g("mine"), N(e.id);
227
121
  }
228
122
  }
229
123
  ),
230
- /* @__PURE__ */ t(xe, { ticketId: a, onOpenChange: (e) => !e && C(null) })
124
+ /* @__PURE__ */ t(re, { ticketId: r, onOpenChange: (e) => !e && N(null) })
231
125
  ] });
232
126
  }
233
- function ge() {
234
- const l = T(), i = Y(), [d, x] = c(""), { data: b = [] } = w({
127
+ function ae() {
128
+ const o = F(), m = O(), [c, y] = u(""), { data: h = [] } = C({
235
129
  queryKey: ["support-categories", "all"],
236
- queryFn: () => l.request(S("/support/categories", { all: "1" })).then((a) => a.data ?? [])
237
- }), { data: q = [] } = w({
130
+ queryFn: () => o.request(R("/support/categories", { all: "1" })).then((r) => r.data ?? [])
131
+ }), { data: x = [] } = C({
238
132
  queryKey: ["support-teams"],
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() })),
133
+ queryFn: () => o.request(R("/user-groups")).then((r) => r.data ?? []).catch(() => [])
134
+ }), n = () => void m.invalidateQueries({ queryKey: ["support-categories"] }), i = A({
135
+ mutationFn: ({ id: r, body: a }) => o.request(z(`/support/categories/${r}`, a)),
136
+ onSuccess: n
137
+ }), f = A({
138
+ mutationFn: () => o.request(B("/support/categories", { name: c.trim() })),
245
139
  onSuccess: () => {
246
- x(""), s();
140
+ y(""), n();
247
141
  }
248
- }), f = A({
249
- mutationFn: (a) => l.request(re(`/support/categories/${a}`)),
250
- onSuccess: s
142
+ }), g = A({
143
+ mutationFn: (r) => o.request(G(`/support/categories/${r}`)),
144
+ onSuccess: n
251
145
  });
252
- return /* @__PURE__ */ n("div", { className: "mt-4 space-y-3", "data-support-types-editor": !0, children: [
146
+ return /* @__PURE__ */ l("div", { className: "mt-4 space-y-3", "data-support-types-editor": !0, children: [
253
147
  /* @__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." }),
254
- /* @__PURE__ */ t("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ n("table", { className: "w-full text-[12.5px]", children: [
255
- /* @__PURE__ */ t("thead", { className: "bg-slate-50 text-left text-[11px] uppercase tracking-wide text-slate-500 dark:bg-white/5 dark:text-muted-foreground", children: /* @__PURE__ */ n("tr", { children: [
148
+ /* @__PURE__ */ t("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ l("table", { className: "w-full text-[12.5px]", children: [
149
+ /* @__PURE__ */ t("thead", { className: "bg-slate-50 text-left text-[11px] uppercase tracking-wide text-slate-500 dark:bg-white/5 dark:text-muted-foreground", children: /* @__PURE__ */ l("tr", { children: [
256
150
  /* @__PURE__ */ t("th", { className: "px-3 py-2 font-medium", children: "Type" }),
257
151
  /* @__PURE__ */ t("th", { className: "px-3 py-2 font-medium", children: "For records in" }),
258
152
  /* @__PURE__ */ t("th", { className: "px-3 py-2 font-medium", children: "Team" }),
@@ -260,12 +154,12 @@ function ge() {
260
154
  /* @__PURE__ */ t("th", { className: "px-3 py-2 font-medium", children: "Active" }),
261
155
  /* @__PURE__ */ t("th", { className: "px-3 py-2" })
262
156
  ] }) }),
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: [
157
+ /* @__PURE__ */ t("tbody", { className: "divide-y divide-slate-100 dark:divide-border/60", children: h.map((r) => /* @__PURE__ */ l("tr", { "data-support-type-row": r.id, children: [
264
158
  /* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
265
159
  "input",
266
160
  {
267
- defaultValue: a.name,
268
- onBlur: (r) => r.target.value.trim() && r.target.value !== a.name && p.mutate({ id: a.id, body: { name: r.target.value } }),
161
+ defaultValue: r.name,
162
+ onBlur: (a) => a.target.value.trim() && a.target.value !== r.name && i.mutate({ id: r.id, body: { name: a.target.value } }),
269
163
  "aria-label": "Type name",
270
164
  className: "w-full bg-transparent font-medium text-slate-900 outline-none focus:underline dark:text-slate-100"
271
165
  }
@@ -273,31 +167,31 @@ function ge() {
273
167
  /* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
274
168
  "input",
275
169
  {
276
- defaultValue: a.collection ?? "",
170
+ defaultValue: r.collection ?? "",
277
171
  placeholder: "Anywhere",
278
- onBlur: (r) => (r.target.value || null) !== a.collection && p.mutate({ id: a.id, body: { collection: r.target.value || null } }),
172
+ onBlur: (a) => (a.target.value || null) !== r.collection && i.mutate({ id: r.id, body: { collection: a.target.value || null } }),
279
173
  "aria-label": "Collection",
280
174
  className: "w-full bg-transparent font-mono text-[12px] text-slate-700 outline-none dark:text-slate-300"
281
175
  }
282
176
  ) }),
283
177
  /* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
284
- pe,
178
+ X,
285
179
  {
286
- value: a.team_id != null ? String(a.team_id) : "",
287
- onChange: (r) => p.mutate({ id: a.id, body: { team_id: r ? Number(r) : null } }),
180
+ value: r.team_id != null ? String(r.team_id) : "",
181
+ onChange: (a) => i.mutate({ id: r.id, body: { team_id: a ? Number(a) : null } }),
288
182
  options: [
289
183
  { value: "", label: "Administrators" },
290
- ...q.map((r) => ({ value: String(r.id), label: r.name }))
184
+ ...x.map((a) => ({ value: String(a.id), label: a.name }))
291
185
  ],
292
186
  ariaLabel: "Team"
293
187
  }
294
188
  ) }),
295
189
  /* @__PURE__ */ t("td", { className: "px-3 py-2", children: /* @__PURE__ */ t(
296
- ie,
190
+ J,
297
191
  {
298
192
  collection: "nivaro_users",
299
- value: a.default_assignee,
300
- onChange: (r) => p.mutate({ id: a.id, body: { default_assignee: r ? String(r) : null } }),
193
+ value: r.default_assignee,
194
+ onChange: (a) => i.mutate({ id: r.id, body: { default_assignee: a ? String(a) : null } }),
301
195
  placeholder: "Nobody"
302
196
  }
303
197
  ) }),
@@ -305,8 +199,8 @@ function ge() {
305
199
  "input",
306
200
  {
307
201
  type: "checkbox",
308
- checked: a.is_active,
309
- onChange: (r) => p.mutate({ id: a.id, body: { is_active: r.target.checked } }),
202
+ checked: r.is_active,
203
+ onChange: (a) => i.mutate({ id: r.id, body: { is_active: a.target.checked } }),
310
204
  "aria-label": "Active"
311
205
  }
312
206
  ) }),
@@ -314,26 +208,26 @@ function ge() {
314
208
  "button",
315
209
  {
316
210
  type: "button",
317
- onClick: () => f.mutate(a.id),
211
+ onClick: () => g.mutate(r.id),
318
212
  className: "text-[11.5px] text-slate-400 hover:text-red-600",
319
213
  children: "Remove"
320
214
  }
321
215
  ) })
322
- ] }, a.id)) })
216
+ ] }, r.id)) })
323
217
  ] }) }),
324
- /* @__PURE__ */ n(
218
+ /* @__PURE__ */ l(
325
219
  "form",
326
220
  {
327
221
  className: "flex items-center gap-2",
328
- onSubmit: (a) => {
329
- a.preventDefault(), d.trim() && g.mutate();
222
+ onSubmit: (r) => {
223
+ r.preventDefault(), c.trim() && f.mutate();
330
224
  },
331
225
  children: [
332
226
  /* @__PURE__ */ t(
333
227
  "input",
334
228
  {
335
- value: d,
336
- onChange: (a) => x(a.target.value),
229
+ value: c,
230
+ onChange: (r) => y(r.target.value),
337
231
  placeholder: "New type, e.g. Vendor change",
338
232
  "aria-label": "New type name",
339
233
  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"
@@ -343,7 +237,7 @@ function ge() {
343
237
  "button",
344
238
  {
345
239
  type: "submit",
346
- disabled: !d.trim() || g.isPending,
240
+ disabled: !c.trim() || f.isPending,
347
241
  className: "h-8 rounded-md border border-nvr-cyan/60 bg-nvr-cyan/10 px-3 text-[12.5px] font-medium text-nvr-navy disabled:opacity-50 dark:text-nvr-cyan",
348
242
  children: "Add type"
349
243
  }
@@ -354,5 +248,5 @@ function ge() {
354
248
  ] });
355
249
  }
356
250
  export {
357
- Ke as SupportView
251
+ ve as SupportView
358
252
  };