@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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +140 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3855 -3785
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4220 -4175
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ReportView.js +1086 -1091
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/cbv/column-totals.js +62 -57
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/charts/category-axis.js +93 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +54 -53
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +94 -85
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/use-query-entry.js +17 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -0,0 +1,790 @@
|
|
|
1
|
+
import { jsxs as n, Fragment as Se, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as qe, useQuery as O, useMutation as _e } from "@tanstack/react-query";
|
|
3
|
+
import { UserRound as Pe, Search as $e, X as ue, SlidersHorizontal as Le, LifeBuoy as Re, ArrowUp as Te, ArrowDown as Ae, AlertTriangle as Fe } from "lucide-react";
|
|
4
|
+
import { useState as v, useEffect as Ee, useMemo as re, useCallback as Me } from "react";
|
|
5
|
+
import { useNivaroClient as Ue } from "../../context.js";
|
|
6
|
+
import { get as D, post as Be } from "../../lib/commands.js";
|
|
7
|
+
import { toastError as Ie } from "../../lib/error-toast.js";
|
|
8
|
+
import { useSettledRows as ze, useLiveFade as Oe } from "../../lib/live-screen.js";
|
|
9
|
+
import { useBackgroundArm as De } from "../../lib/live-views.js";
|
|
10
|
+
import { useBelowMd as Ge } from "../../lib/use-below-md.js";
|
|
11
|
+
import { cn as g } from "../../lib/utils.js";
|
|
12
|
+
import { ErrorNotice as Ke } from "../ErrorNotice.js";
|
|
13
|
+
import { ConfirmButton as se } from "../profile/primitives.js";
|
|
14
|
+
import { DropdownMenu as ne, DropdownMenuTrigger as le, DropdownMenuContent as ie, DropdownMenuItem as oe } from "../ui/dropdown-menu.js";
|
|
15
|
+
import { SimpleSelect as R } from "../ui/SimpleSelect.js";
|
|
16
|
+
import { PersonPick as pe, PersonDisc as K, PickCaret as F, PICK_TRIGGER as de } from "./PersonPick.js";
|
|
17
|
+
import { readFilters as je, listParams as We, bulkResultLine as Qe, activeFilterCount as Ye, STATUS_FILTERS as He, PRIORITY_FILTERS as Je, SORTS as Xe, writeFilters as Ve, defaultFilters as Ze, shortAgo as me, exactTime as G } from "./support-list.js";
|
|
18
|
+
import { StatusPill as ge } from "./TicketDetailSheet.js";
|
|
19
|
+
const _ = 50, et = /* @__PURE__ */ new Set(["done", "cancelled"]);
|
|
20
|
+
function ce() {
|
|
21
|
+
try {
|
|
22
|
+
return typeof window > "u" ? null : window.localStorage;
|
|
23
|
+
} catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const T = "h-8 w-auto max-w-[12rem] gap-1.5 rounded-md border-slate-200 bg-white px-2.5 text-[12.5px] text-slate-700 dark:border-border dark:bg-background dark:text-slate-200";
|
|
28
|
+
function Ct({
|
|
29
|
+
tab: a,
|
|
30
|
+
openId: s,
|
|
31
|
+
onOpen: c
|
|
32
|
+
}) {
|
|
33
|
+
var te, ae;
|
|
34
|
+
const l = Ue(), u = qe(), o = Ge(), i = a === "desk", [r, b] = v(() => je(a, ce())), [f, E] = v(""), [C, P] = v(1), [j, ke] = v(!1), [h, S] = v(() => /* @__PURE__ */ new Set()), [W, Q] = v(null), y = (t) => {
|
|
35
|
+
b((d) => {
|
|
36
|
+
const p = { ...d, ...t };
|
|
37
|
+
return Ve(a, p, ce()), p;
|
|
38
|
+
}), P(1);
|
|
39
|
+
}, M = { ...We(a, r, f), page: String(C), limit: String(_) }, U = JSON.stringify(M), k = O({
|
|
40
|
+
queryKey: ["support-tickets", M],
|
|
41
|
+
queryFn: () => l.request(D("/support/tickets", M))
|
|
42
|
+
}), { data: m } = O({
|
|
43
|
+
queryKey: ["support-workload"],
|
|
44
|
+
queryFn: () => l.request(D("/support/workload")).then((t) => t.data),
|
|
45
|
+
enabled: i
|
|
46
|
+
}), { data: ye = [] } = O({
|
|
47
|
+
queryKey: ["support-categories", "any"],
|
|
48
|
+
queryFn: () => l.request(D("/support/categories", { any: "1" })).then((t) => t.data ?? [])
|
|
49
|
+
});
|
|
50
|
+
Ee(() => {
|
|
51
|
+
S(/* @__PURE__ */ new Set()), Q(null);
|
|
52
|
+
}, [U]);
|
|
53
|
+
const Ne = re(() => [...h].map(String), [h]), $ = ze((te = k.data) == null ? void 0 : te.data, (t) => String(t.id), {
|
|
54
|
+
resetKey: U,
|
|
55
|
+
held: Ne
|
|
56
|
+
}), Y = Oe(De(k.dataUpdatedAt, U)), we = Me(
|
|
57
|
+
(t) => {
|
|
58
|
+
$.containerRef(t), Y(t);
|
|
59
|
+
},
|
|
60
|
+
[$.containerRef, Y]
|
|
61
|
+
), H = re(() => {
|
|
62
|
+
const t = new Map(((m == null ? void 0 : m.assignees) ?? []).map((d) => [d.id, d.open]));
|
|
63
|
+
return ((m == null ? void 0 : m.workers) ?? []).map((d) => ({
|
|
64
|
+
value: d.id,
|
|
65
|
+
label: d.name,
|
|
66
|
+
person: !0,
|
|
67
|
+
hint: t.get(d.id) ? `${t.get(d.id)} open` : void 0
|
|
68
|
+
}));
|
|
69
|
+
}, [m]), J = (t) => {
|
|
70
|
+
var d, p;
|
|
71
|
+
return t === "me" ? "Me" : t === "unassigned" ? "Unassigned" : ((d = m == null ? void 0 : m.workers.find((x) => x.id === t)) == null ? void 0 : d.name) ?? ((p = m == null ? void 0 : m.assignees.find((x) => x.id === t)) == null ? void 0 : p.name) ?? "Someone";
|
|
72
|
+
}, X = _e({
|
|
73
|
+
mutationFn: ({
|
|
74
|
+
ids: t,
|
|
75
|
+
body: d
|
|
76
|
+
}) => l.request(Be("/support/tickets/bulk", { ids: t, ...d })).then((p) => p.data),
|
|
77
|
+
onSuccess: (t, d) => {
|
|
78
|
+
Q(Qe(d.action, t));
|
|
79
|
+
const p = t.results.filter((x) => x.outcome !== "refused").map((x) => String(x.id));
|
|
80
|
+
$.release(p), S(/* @__PURE__ */ new Set());
|
|
81
|
+
for (const x of [
|
|
82
|
+
"support-tickets",
|
|
83
|
+
"support-summary",
|
|
84
|
+
"support-workload",
|
|
85
|
+
"support-ticket"
|
|
86
|
+
])
|
|
87
|
+
u.invalidateQueries({ queryKey: [x] });
|
|
88
|
+
},
|
|
89
|
+
onError: (t) => Ie(t, "Could not change those requests")
|
|
90
|
+
}), ve = (t) => {
|
|
91
|
+
const d = [...h];
|
|
92
|
+
if (!d.length) return;
|
|
93
|
+
const p = t.kind === "status" ? { status: t.status } : t.kind === "assign" ? { assignee: t.assignee } : { priority: t.priority };
|
|
94
|
+
X.mutate({ ids: d, body: p, action: t });
|
|
95
|
+
}, L = $.rows, B = L.filter((t) => t.state !== "departed").map((t) => t.row.id), I = B.length > 0 && B.every((t) => h.has(t)), V = (t) => S((d) => {
|
|
96
|
+
const p = new Set(d);
|
|
97
|
+
return p.has(t) ? p.delete(t) : p.add(t), p;
|
|
98
|
+
}), Ce = () => S(I ? /* @__PURE__ */ new Set() : new Set(B)), w = Ye(a, r), z = () => {
|
|
99
|
+
const t = Ze(a);
|
|
100
|
+
y({
|
|
101
|
+
status: t.status,
|
|
102
|
+
assignee: t.assignee,
|
|
103
|
+
category: t.category,
|
|
104
|
+
priority: t.priority
|
|
105
|
+
}), E("");
|
|
106
|
+
}, q = (t) => y({ sort: t }), N = ((ae = k.data) == null ? void 0 : ae.total) ?? 0, Z = Math.max(1, Math.ceil(N / _)), ee = /* @__PURE__ */ n(Se, { children: [
|
|
107
|
+
/* @__PURE__ */ e(
|
|
108
|
+
R,
|
|
109
|
+
{
|
|
110
|
+
value: r.status,
|
|
111
|
+
onChange: (t) => y({ status: t }),
|
|
112
|
+
options: He,
|
|
113
|
+
ariaLabel: "Status",
|
|
114
|
+
className: g(T, o && "w-full max-w-none"),
|
|
115
|
+
triggerProps: { "data-support-filter": "status" }
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
i && /* @__PURE__ */ e(
|
|
119
|
+
pe,
|
|
120
|
+
{
|
|
121
|
+
value: r.assignee,
|
|
122
|
+
ariaLabel: "Assignee",
|
|
123
|
+
fixed: [
|
|
124
|
+
{ value: "", label: "Anyone" },
|
|
125
|
+
{ value: "me", label: "Me" },
|
|
126
|
+
{ value: "unassigned", label: "Unassigned" }
|
|
127
|
+
],
|
|
128
|
+
people: H,
|
|
129
|
+
onPick: (t) => y({ assignee: t }),
|
|
130
|
+
trigger: /* @__PURE__ */ n(
|
|
131
|
+
"button",
|
|
132
|
+
{
|
|
133
|
+
type: "button",
|
|
134
|
+
"data-support-filter": "assignee",
|
|
135
|
+
className: g(de, o && "w-full max-w-none"),
|
|
136
|
+
children: [
|
|
137
|
+
r.assignee && r.assignee !== "unassigned" && r.assignee !== "me" ? /* @__PURE__ */ e(
|
|
138
|
+
K,
|
|
139
|
+
{
|
|
140
|
+
id: r.assignee,
|
|
141
|
+
name: J(r.assignee),
|
|
142
|
+
size: 16
|
|
143
|
+
}
|
|
144
|
+
) : /* @__PURE__ */ e(Pe, { className: "h-3.5 w-3.5 shrink-0 opacity-60" }),
|
|
145
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-left", children: r.assignee ? J(r.assignee) : "Anyone" }),
|
|
146
|
+
/* @__PURE__ */ e(F, {})
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
/* @__PURE__ */ e(
|
|
153
|
+
R,
|
|
154
|
+
{
|
|
155
|
+
value: r.category,
|
|
156
|
+
onChange: (t) => y({ category: t }),
|
|
157
|
+
options: [
|
|
158
|
+
{ value: "", label: "Any type" },
|
|
159
|
+
...ye.map((t) => ({ value: String(t.id), label: t.name }))
|
|
160
|
+
],
|
|
161
|
+
ariaLabel: "Type",
|
|
162
|
+
className: g(T, o && "w-full max-w-none"),
|
|
163
|
+
triggerProps: { "data-support-filter": "type" }
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ e(
|
|
167
|
+
R,
|
|
168
|
+
{
|
|
169
|
+
value: r.priority,
|
|
170
|
+
onChange: (t) => y({ priority: t }),
|
|
171
|
+
options: Je,
|
|
172
|
+
ariaLabel: "Priority",
|
|
173
|
+
className: g(T, o && "w-full max-w-none"),
|
|
174
|
+
triggerProps: { "data-support-filter": "priority" }
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
] });
|
|
178
|
+
return /* @__PURE__ */ n("div", { "data-support-list-view": a, children: [
|
|
179
|
+
/* @__PURE__ */ n("div", { className: "mt-4 flex flex-wrap items-center gap-2", children: [
|
|
180
|
+
/* @__PURE__ */ n(
|
|
181
|
+
"label",
|
|
182
|
+
{
|
|
183
|
+
className: g(
|
|
184
|
+
"flex h-8 min-w-0 flex-1 items-center gap-1.5 rounded-md border border-slate-200 bg-white px-2 focus-within:border-nvr-cyan sm:max-w-[16rem] dark:border-border dark:bg-background",
|
|
185
|
+
o && "basis-full"
|
|
186
|
+
),
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ e($e, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
189
|
+
/* @__PURE__ */ e(
|
|
190
|
+
"input",
|
|
191
|
+
{
|
|
192
|
+
value: f,
|
|
193
|
+
onChange: (t) => {
|
|
194
|
+
E(t.target.value), P(1);
|
|
195
|
+
},
|
|
196
|
+
placeholder: "Search requests or #id",
|
|
197
|
+
"aria-label": "Search requests",
|
|
198
|
+
className: "min-w-0 flex-1 bg-transparent text-[12.5px] text-slate-900 outline-none placeholder:text-slate-400 dark:text-slate-100"
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
f && /* @__PURE__ */ e(
|
|
202
|
+
"button",
|
|
203
|
+
{
|
|
204
|
+
type: "button",
|
|
205
|
+
onClick: () => E(""),
|
|
206
|
+
"aria-label": "Clear search",
|
|
207
|
+
className: "rounded p-0.5 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200",
|
|
208
|
+
children: /* @__PURE__ */ e(ue, { className: "h-3 w-3" })
|
|
209
|
+
}
|
|
210
|
+
)
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
),
|
|
214
|
+
o ? /* @__PURE__ */ n(
|
|
215
|
+
"button",
|
|
216
|
+
{
|
|
217
|
+
type: "button",
|
|
218
|
+
"data-support-filters-toggle": !0,
|
|
219
|
+
"aria-expanded": j,
|
|
220
|
+
onClick: () => ke((t) => !t),
|
|
221
|
+
className: g(
|
|
222
|
+
de,
|
|
223
|
+
w > 0 && "border-nvr-cyan/60 text-nvr-navy dark:text-nvr-cyan"
|
|
224
|
+
),
|
|
225
|
+
children: [
|
|
226
|
+
/* @__PURE__ */ e(Le, { className: "h-3.5 w-3.5" }),
|
|
227
|
+
"Filters",
|
|
228
|
+
w > 0 && /* @__PURE__ */ e("span", { className: "rounded-full bg-nvr-cyan/15 px-1.5 text-[10.5px] font-semibold tabular-nums", children: w })
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
) : ee,
|
|
232
|
+
!o && w + (f ? 1 : 0) > 0 && /* @__PURE__ */ e(
|
|
233
|
+
"button",
|
|
234
|
+
{
|
|
235
|
+
type: "button",
|
|
236
|
+
"data-support-clear": !0,
|
|
237
|
+
onClick: z,
|
|
238
|
+
className: "h-8 px-1 text-[12px] text-slate-500 underline-offset-2 hover:text-slate-800 hover:underline dark:text-muted-foreground dark:hover:text-slate-100",
|
|
239
|
+
children: "Clear filters"
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
/* @__PURE__ */ n("div", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
243
|
+
/* @__PURE__ */ e("span", { className: "hidden text-[12px] text-slate-500 sm:inline dark:text-muted-foreground", children: "Sort" }),
|
|
244
|
+
/* @__PURE__ */ e(
|
|
245
|
+
R,
|
|
246
|
+
{
|
|
247
|
+
value: r.sort,
|
|
248
|
+
onChange: (t) => q(t),
|
|
249
|
+
options: Xe,
|
|
250
|
+
ariaLabel: "Sort",
|
|
251
|
+
className: T,
|
|
252
|
+
triggerProps: { "data-support-sort": r.sort }
|
|
253
|
+
}
|
|
254
|
+
)
|
|
255
|
+
] })
|
|
256
|
+
] }),
|
|
257
|
+
o && j && /* @__PURE__ */ n(
|
|
258
|
+
"div",
|
|
259
|
+
{
|
|
260
|
+
className: "mt-2 grid grid-cols-1 gap-2 rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card",
|
|
261
|
+
"data-support-filters-panel": !0,
|
|
262
|
+
children: [
|
|
263
|
+
ee,
|
|
264
|
+
w > 0 && /* @__PURE__ */ e(
|
|
265
|
+
"button",
|
|
266
|
+
{
|
|
267
|
+
type: "button",
|
|
268
|
+
onClick: z,
|
|
269
|
+
className: "justify-self-start text-[12px] text-slate-500 underline underline-offset-2 dark:text-muted-foreground",
|
|
270
|
+
children: "Clear filters"
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
),
|
|
276
|
+
i && m && /* @__PURE__ */ e(
|
|
277
|
+
rt,
|
|
278
|
+
{
|
|
279
|
+
workload: m,
|
|
280
|
+
active: r.assignee,
|
|
281
|
+
onPick: (t) => y({ assignee: r.assignee === t ? "" : t })
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
/* @__PURE__ */ e(
|
|
285
|
+
"div",
|
|
286
|
+
{
|
|
287
|
+
ref: we,
|
|
288
|
+
className: "mt-3 overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
289
|
+
children: k.isLoading ? /* @__PURE__ */ e("div", { className: "space-y-2 p-4", "aria-busy": !0, children: [0, 1, 2, 3].map((t) => /* @__PURE__ */ e("div", { className: "h-9 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))]" }, t)) }) : k.isError && !k.data ? /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
290
|
+
Ke,
|
|
291
|
+
{
|
|
292
|
+
error: k.error,
|
|
293
|
+
what: "the requests",
|
|
294
|
+
onRetry: () => void k.refetch()
|
|
295
|
+
}
|
|
296
|
+
) }) : L.length ? o ? /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", "data-support-list": !0, children: L.map(({ row: t, state: d }) => /* @__PURE__ */ e(
|
|
297
|
+
at,
|
|
298
|
+
{
|
|
299
|
+
t,
|
|
300
|
+
desk: i,
|
|
301
|
+
departed: d === "departed",
|
|
302
|
+
open: s === t.id,
|
|
303
|
+
selected: h.has(t.id),
|
|
304
|
+
onToggle: () => V(t.id),
|
|
305
|
+
onOpen: () => c(t.id)
|
|
306
|
+
},
|
|
307
|
+
t.id
|
|
308
|
+
)) }) : /* @__PURE__ */ n("table", { className: "w-full table-fixed text-[12.5px]", "data-support-list": !0, children: [
|
|
309
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b border-slate-200 bg-slate-50 text-left text-[11.5px] text-slate-500 dark:border-border dark:bg-white/[0.03] dark:text-muted-foreground", children: [
|
|
310
|
+
i && /* @__PURE__ */ e("th", { className: "w-9 py-2 pl-3 pr-0", children: /* @__PURE__ */ e(
|
|
311
|
+
"input",
|
|
312
|
+
{
|
|
313
|
+
type: "checkbox",
|
|
314
|
+
checked: I,
|
|
315
|
+
onChange: Ce,
|
|
316
|
+
"aria-label": I ? "Clear selection" : "Select every request on this page",
|
|
317
|
+
className: "h-3.5 w-3.5 cursor-pointer align-middle accent-nvr-navy dark:accent-nvr-cyan"
|
|
318
|
+
}
|
|
319
|
+
) }),
|
|
320
|
+
/* @__PURE__ */ e(
|
|
321
|
+
A,
|
|
322
|
+
{
|
|
323
|
+
className: "w-16",
|
|
324
|
+
label: "#",
|
|
325
|
+
active: r.sort === "newest" || r.sort === "oldest",
|
|
326
|
+
dir: r.sort === "oldest" ? "asc" : "desc",
|
|
327
|
+
onClick: () => q(r.sort === "newest" ? "oldest" : "newest"),
|
|
328
|
+
tip: "Sort by when it was raised"
|
|
329
|
+
}
|
|
330
|
+
),
|
|
331
|
+
/* @__PURE__ */ e("th", { className: "px-3 py-2 font-medium", children: "Request" }),
|
|
332
|
+
i && /* @__PURE__ */ e("th", { className: "hidden w-[15%] px-3 py-2 font-medium lg:table-cell", children: "Requester" }),
|
|
333
|
+
/* @__PURE__ */ e("th", { className: "w-[17%] px-3 py-2 font-medium", children: i ? "Assignee" : "With" }),
|
|
334
|
+
/* @__PURE__ */ e("th", { className: "w-28 px-3 py-2 font-medium", children: "Status" }),
|
|
335
|
+
/* @__PURE__ */ e(
|
|
336
|
+
A,
|
|
337
|
+
{
|
|
338
|
+
className: "w-24",
|
|
339
|
+
label: "Priority",
|
|
340
|
+
active: r.sort === "priority",
|
|
341
|
+
dir: "desc",
|
|
342
|
+
onClick: () => q("priority"),
|
|
343
|
+
tip: "Urgent first"
|
|
344
|
+
}
|
|
345
|
+
),
|
|
346
|
+
i ? /* @__PURE__ */ e(
|
|
347
|
+
A,
|
|
348
|
+
{
|
|
349
|
+
className: "w-24 pr-4 text-right",
|
|
350
|
+
label: "Waiting",
|
|
351
|
+
active: r.sort === "attention",
|
|
352
|
+
dir: "desc",
|
|
353
|
+
onClick: () => q("attention"),
|
|
354
|
+
tip: "Needs attention: urgent, then unassigned, then longest waiting",
|
|
355
|
+
right: !0
|
|
356
|
+
}
|
|
357
|
+
) : /* @__PURE__ */ e(
|
|
358
|
+
A,
|
|
359
|
+
{
|
|
360
|
+
className: "w-24 pr-4 text-right",
|
|
361
|
+
label: "Updated",
|
|
362
|
+
active: r.sort === "updated",
|
|
363
|
+
dir: "desc",
|
|
364
|
+
onClick: () => q("updated"),
|
|
365
|
+
tip: "Latest activity first",
|
|
366
|
+
right: !0
|
|
367
|
+
}
|
|
368
|
+
)
|
|
369
|
+
] }) }),
|
|
370
|
+
/* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-100 dark:divide-border/60", children: L.map(({ row: t, state: d }) => /* @__PURE__ */ e(
|
|
371
|
+
tt,
|
|
372
|
+
{
|
|
373
|
+
t,
|
|
374
|
+
desk: i,
|
|
375
|
+
departed: d === "departed",
|
|
376
|
+
open: s === t.id,
|
|
377
|
+
selected: h.has(t.id),
|
|
378
|
+
onToggle: () => V(t.id),
|
|
379
|
+
onOpen: () => c(t.id)
|
|
380
|
+
},
|
|
381
|
+
t.id
|
|
382
|
+
)) })
|
|
383
|
+
] }) : /* @__PURE__ */ e(
|
|
384
|
+
nt,
|
|
385
|
+
{
|
|
386
|
+
tab: a,
|
|
387
|
+
filtered: w > 0 || !!f.trim(),
|
|
388
|
+
unassignedOnly: r.assignee === "unassigned",
|
|
389
|
+
closed: ["closed", "done", "cancelled"].includes(r.status),
|
|
390
|
+
onClear: z
|
|
391
|
+
}
|
|
392
|
+
)
|
|
393
|
+
}
|
|
394
|
+
),
|
|
395
|
+
N > 0 && /* @__PURE__ */ n("div", { className: "mt-2 flex items-center gap-3 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
396
|
+
/* @__PURE__ */ e("span", { className: "tabular-nums", children: N <= _ ? `${N} request${N === 1 ? "" : "s"}` : `${(C - 1) * _ + 1}–${Math.min(C * _, N)} of ${N}` }),
|
|
397
|
+
Z > 1 && /* @__PURE__ */ n("span", { className: "flex items-center gap-1", children: [
|
|
398
|
+
/* @__PURE__ */ e(
|
|
399
|
+
"button",
|
|
400
|
+
{
|
|
401
|
+
type: "button",
|
|
402
|
+
disabled: C <= 1,
|
|
403
|
+
onClick: () => P((t) => t - 1),
|
|
404
|
+
className: "rounded px-1.5 py-0.5 hover:bg-slate-100 disabled:opacity-40 dark:hover:bg-white/5",
|
|
405
|
+
children: "Previous"
|
|
406
|
+
}
|
|
407
|
+
),
|
|
408
|
+
/* @__PURE__ */ e(
|
|
409
|
+
"button",
|
|
410
|
+
{
|
|
411
|
+
type: "button",
|
|
412
|
+
disabled: C >= Z,
|
|
413
|
+
onClick: () => P((t) => t + 1),
|
|
414
|
+
className: "rounded px-1.5 py-0.5 hover:bg-slate-100 disabled:opacity-40 dark:hover:bg-white/5",
|
|
415
|
+
children: "Next"
|
|
416
|
+
}
|
|
417
|
+
)
|
|
418
|
+
] }),
|
|
419
|
+
W && !h.size && /* @__PURE__ */ e(
|
|
420
|
+
"span",
|
|
421
|
+
{
|
|
422
|
+
className: "text-slate-700 dark:text-slate-200",
|
|
423
|
+
"data-support-bulk-result": !0,
|
|
424
|
+
role: "status",
|
|
425
|
+
children: W
|
|
426
|
+
}
|
|
427
|
+
)
|
|
428
|
+
] }),
|
|
429
|
+
i && h.size > 0 && /* @__PURE__ */ e(
|
|
430
|
+
st,
|
|
431
|
+
{
|
|
432
|
+
count: h.size,
|
|
433
|
+
busy: X.isPending,
|
|
434
|
+
people: H,
|
|
435
|
+
onRun: ve,
|
|
436
|
+
onClear: () => S(/* @__PURE__ */ new Set())
|
|
437
|
+
}
|
|
438
|
+
)
|
|
439
|
+
] });
|
|
440
|
+
}
|
|
441
|
+
function A({
|
|
442
|
+
label: a,
|
|
443
|
+
active: s,
|
|
444
|
+
dir: c,
|
|
445
|
+
onClick: l,
|
|
446
|
+
tip: u,
|
|
447
|
+
className: o,
|
|
448
|
+
right: i
|
|
449
|
+
}) {
|
|
450
|
+
const r = c === "asc" ? Te : Ae;
|
|
451
|
+
return /* @__PURE__ */ e(
|
|
452
|
+
"th",
|
|
453
|
+
{
|
|
454
|
+
className: g("px-3 py-2 font-medium", o),
|
|
455
|
+
"aria-sort": s ? c === "asc" ? "ascending" : "descending" : "none",
|
|
456
|
+
children: /* @__PURE__ */ n(
|
|
457
|
+
"button",
|
|
458
|
+
{
|
|
459
|
+
type: "button",
|
|
460
|
+
onClick: l,
|
|
461
|
+
"data-tip": u,
|
|
462
|
+
className: g(
|
|
463
|
+
"inline-flex items-center gap-1 rounded hover:text-slate-900 dark:hover:text-slate-100",
|
|
464
|
+
i && "flex-row-reverse",
|
|
465
|
+
s && "text-slate-900 dark:text-slate-100"
|
|
466
|
+
),
|
|
467
|
+
children: [
|
|
468
|
+
a,
|
|
469
|
+
/* @__PURE__ */ e(r, { className: g("h-3 w-3", s ? "opacity-80" : "opacity-0") })
|
|
470
|
+
]
|
|
471
|
+
}
|
|
472
|
+
)
|
|
473
|
+
}
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
function he({ t: a, desk: s }) {
|
|
477
|
+
const c = et.has(a.status), l = c ? a.completed_at ?? a.updated_at ?? a.created_at : s ? a.waiting_since ?? a.created_at : a.updated_at ?? a.created_at, u = c ? `Closed ${G(l)}` : s ? `Waiting since ${G(l)}` : `Updated ${G(l)}`;
|
|
478
|
+
return /* @__PURE__ */ n(
|
|
479
|
+
"time",
|
|
480
|
+
{
|
|
481
|
+
dateTime: l ?? void 0,
|
|
482
|
+
"data-tip": u,
|
|
483
|
+
className: "relative tabular-nums text-slate-500 dark:text-muted-foreground",
|
|
484
|
+
children: [
|
|
485
|
+
me(l),
|
|
486
|
+
/* @__PURE__ */ n("span", { className: "sr-only", children: [
|
|
487
|
+
" (",
|
|
488
|
+
u,
|
|
489
|
+
")"
|
|
490
|
+
] })
|
|
491
|
+
]
|
|
492
|
+
}
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
function xe({ p: a }) {
|
|
496
|
+
return a === "urgent" ? /* @__PURE__ */ n("span", { className: "inline-flex items-center gap-1 font-medium text-red-600 dark:text-red-400", children: [
|
|
497
|
+
/* @__PURE__ */ e(Fe, { className: "h-3 w-3" }),
|
|
498
|
+
" Urgent"
|
|
499
|
+
] }) : /* @__PURE__ */ e("span", { className: "text-slate-500 capitalize dark:text-muted-foreground", children: a });
|
|
500
|
+
}
|
|
501
|
+
function be({ t: a }) {
|
|
502
|
+
return a.assignee ? /* @__PURE__ */ n("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
503
|
+
/* @__PURE__ */ e(K, { id: a.assignee, name: a.assignee_name }),
|
|
504
|
+
/* @__PURE__ */ e("span", { className: "truncate text-slate-700 dark:text-slate-200", children: a.assignee_name ?? "Someone" })
|
|
505
|
+
] }) : /* @__PURE__ */ e("span", { className: "inline-flex items-center rounded-full border border-dashed border-slate-300 px-2 py-px text-[11.5px] text-slate-500 dark:border-slate-600 dark:text-muted-foreground", children: "Unassigned" });
|
|
506
|
+
}
|
|
507
|
+
function fe(a, s) {
|
|
508
|
+
return [
|
|
509
|
+
a.record_label ?? "General Support",
|
|
510
|
+
a.category_name,
|
|
511
|
+
s ? a.requester_name : null,
|
|
512
|
+
a.replies ? `${a.replies} repl${a.replies === 1 ? "y" : "ies"}` : null
|
|
513
|
+
].filter(Boolean).join(" · ");
|
|
514
|
+
}
|
|
515
|
+
function tt({ t: a, desk: s, departed: c, open: l, selected: u, onToggle: o, onOpen: i }) {
|
|
516
|
+
return /* @__PURE__ */ n(
|
|
517
|
+
"tr",
|
|
518
|
+
{
|
|
519
|
+
"data-support-row": a.id,
|
|
520
|
+
"data-departed": c || void 0,
|
|
521
|
+
onClick: i,
|
|
522
|
+
className: g(
|
|
523
|
+
"cursor-pointer align-middle",
|
|
524
|
+
u ? "bg-[#dcf3fa] dark:bg-[#0f2a33]" : l ? "bg-slate-50 dark:bg-white/[0.04]" : "hover:bg-slate-50 dark:hover:bg-white/[0.03]",
|
|
525
|
+
c && "opacity-50"
|
|
526
|
+
),
|
|
527
|
+
children: [
|
|
528
|
+
s && // biome-ignore lint/a11y/useKeyWithClickEvents: only stops the row's open; the checkbox is the keyboard control
|
|
529
|
+
/* @__PURE__ */ e("td", { className: "py-2 pl-3 pr-0", onClick: (r) => r.stopPropagation(), children: /* @__PURE__ */ e(
|
|
530
|
+
"input",
|
|
531
|
+
{
|
|
532
|
+
type: "checkbox",
|
|
533
|
+
checked: u,
|
|
534
|
+
onChange: o,
|
|
535
|
+
disabled: c,
|
|
536
|
+
"aria-label": `Select request ${a.id}`,
|
|
537
|
+
className: "h-3.5 w-3.5 cursor-pointer align-middle accent-nvr-navy dark:accent-nvr-cyan"
|
|
538
|
+
}
|
|
539
|
+
) }),
|
|
540
|
+
/* @__PURE__ */ e("td", { className: "px-3 py-2 font-mono text-[11.5px] tabular-nums text-slate-400", children: a.id }),
|
|
541
|
+
/* @__PURE__ */ e("td", { className: "min-w-0 px-3 py-2", children: /* @__PURE__ */ n(
|
|
542
|
+
"button",
|
|
543
|
+
{
|
|
544
|
+
type: "button",
|
|
545
|
+
onClick: (r) => {
|
|
546
|
+
r.stopPropagation(), i();
|
|
547
|
+
},
|
|
548
|
+
className: "block w-full min-w-0 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan rounded",
|
|
549
|
+
children: [
|
|
550
|
+
/* @__PURE__ */ e("span", { className: "block truncate text-[13px] font-medium text-slate-900 dark:text-slate-100", children: a.title }),
|
|
551
|
+
/* @__PURE__ */ e("span", { className: "mt-0.5 block truncate text-[11.5px] text-slate-500 dark:text-muted-foreground", children: fe(a, !1) })
|
|
552
|
+
]
|
|
553
|
+
}
|
|
554
|
+
) }),
|
|
555
|
+
s && /* @__PURE__ */ e("td", { className: "hidden truncate px-3 py-2 text-slate-700 lg:table-cell dark:text-slate-200", children: a.requester_name ?? "—" }),
|
|
556
|
+
/* @__PURE__ */ e("td", { className: "px-3 py-2", children: /* @__PURE__ */ e(be, { t: a }) }),
|
|
557
|
+
/* @__PURE__ */ e("td", { className: "px-3 py-2", children: /* @__PURE__ */ e(ge, { status: a.status, label: a.status_label }) }),
|
|
558
|
+
/* @__PURE__ */ e("td", { className: "px-3 py-2", children: /* @__PURE__ */ e(xe, { p: a.priority }) }),
|
|
559
|
+
/* @__PURE__ */ e("td", { className: "py-2 pl-3 pr-4 text-right", children: /* @__PURE__ */ e(he, { t: a, desk: s }) })
|
|
560
|
+
]
|
|
561
|
+
}
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
function at({ t: a, desk: s, departed: c, open: l, selected: u, onToggle: o, onOpen: i }) {
|
|
565
|
+
return /* @__PURE__ */ n(
|
|
566
|
+
"li",
|
|
567
|
+
{
|
|
568
|
+
"data-support-row": a.id,
|
|
569
|
+
"data-departed": c || void 0,
|
|
570
|
+
className: g(
|
|
571
|
+
"flex gap-3 px-3 py-3",
|
|
572
|
+
u ? "bg-[#dcf3fa] dark:bg-[#0f2a33]" : l && "bg-slate-50 dark:bg-white/[0.04]",
|
|
573
|
+
c && "opacity-50"
|
|
574
|
+
),
|
|
575
|
+
children: [
|
|
576
|
+
s && /* @__PURE__ */ e(
|
|
577
|
+
"input",
|
|
578
|
+
{
|
|
579
|
+
type: "checkbox",
|
|
580
|
+
checked: u,
|
|
581
|
+
onChange: o,
|
|
582
|
+
disabled: c,
|
|
583
|
+
"aria-label": `Select request ${a.id}`,
|
|
584
|
+
className: "mt-0.5 h-4 w-4 shrink-0 accent-nvr-navy dark:accent-nvr-cyan"
|
|
585
|
+
}
|
|
586
|
+
),
|
|
587
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: i, className: "min-w-0 flex-1 text-left", children: [
|
|
588
|
+
/* @__PURE__ */ n("span", { className: "flex items-center gap-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
589
|
+
/* @__PURE__ */ n("span", { className: "font-mono tabular-nums", children: [
|
|
590
|
+
"#",
|
|
591
|
+
a.id
|
|
592
|
+
] }),
|
|
593
|
+
a.priority === "urgent" && /* @__PURE__ */ e(xe, { p: "urgent" }),
|
|
594
|
+
/* @__PURE__ */ n("span", { className: "ml-auto flex items-center gap-2", children: [
|
|
595
|
+
/* @__PURE__ */ e(he, { t: a, desk: s }),
|
|
596
|
+
/* @__PURE__ */ e(ge, { status: a.status, label: a.status_label })
|
|
597
|
+
] })
|
|
598
|
+
] }),
|
|
599
|
+
/* @__PURE__ */ e("span", { className: "mt-1 line-clamp-2 block text-[13.5px] font-medium text-slate-900 dark:text-slate-100", children: a.title }),
|
|
600
|
+
/* @__PURE__ */ e("span", { className: "mt-0.5 block truncate text-[12px] text-slate-500 dark:text-muted-foreground", children: fe(a, s) }),
|
|
601
|
+
/* @__PURE__ */ e("span", { className: "mt-1.5 block text-[12px]", children: /* @__PURE__ */ e(be, { t: a }) })
|
|
602
|
+
] })
|
|
603
|
+
]
|
|
604
|
+
}
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
function rt({
|
|
608
|
+
workload: a,
|
|
609
|
+
active: s,
|
|
610
|
+
onPick: c
|
|
611
|
+
}) {
|
|
612
|
+
const l = (r) => g(
|
|
613
|
+
"inline-flex h-7 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border pl-1 pr-2.5 text-[12px] transition-colors",
|
|
614
|
+
r ? "border-nvr-cyan/70 bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-700 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-200 dark:hover:border-slate-500"
|
|
615
|
+
), u = (r) => /* @__PURE__ */ e("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-slate-100", children: r }), o = (r, b, f) => [
|
|
616
|
+
`${r} open`,
|
|
617
|
+
b ? `${b} urgent` : null,
|
|
618
|
+
f ? `longest waiting ${me(f)}` : null
|
|
619
|
+
].filter(Boolean).join(" · "), i = a.unassigned;
|
|
620
|
+
return !i.open && !a.assignees.length ? null : /* @__PURE__ */ n(
|
|
621
|
+
"div",
|
|
622
|
+
{
|
|
623
|
+
className: "mt-3 flex items-center gap-1.5 overflow-x-auto pb-0.5 [scrollbar-width:thin]",
|
|
624
|
+
"data-support-workload": !0,
|
|
625
|
+
children: [
|
|
626
|
+
/* @__PURE__ */ e("span", { className: "mr-1 shrink-0 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Who has what" }),
|
|
627
|
+
/* @__PURE__ */ n(
|
|
628
|
+
"button",
|
|
629
|
+
{
|
|
630
|
+
type: "button",
|
|
631
|
+
"data-support-workload-chip": "unassigned",
|
|
632
|
+
"aria-pressed": s === "unassigned",
|
|
633
|
+
"data-tip": o(i.open, i.urgent, i.oldest_waiting),
|
|
634
|
+
onClick: () => c("unassigned"),
|
|
635
|
+
className: g(l(s === "unassigned"), "pl-2.5"),
|
|
636
|
+
children: [
|
|
637
|
+
"Unassigned ",
|
|
638
|
+
u(i.open),
|
|
639
|
+
i.urgent > 0 && /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 rounded-full bg-red-500", "aria-hidden": !0 })
|
|
640
|
+
]
|
|
641
|
+
}
|
|
642
|
+
),
|
|
643
|
+
a.assignees.map((r) => /* @__PURE__ */ n(
|
|
644
|
+
"button",
|
|
645
|
+
{
|
|
646
|
+
type: "button",
|
|
647
|
+
"data-support-workload-chip": r.id,
|
|
648
|
+
"aria-pressed": s === r.id,
|
|
649
|
+
"data-tip": `${r.name}: ${o(r.open, r.urgent, r.oldest_waiting)}${r.active ? "" : " · no longer active"}`,
|
|
650
|
+
onClick: () => c(r.id),
|
|
651
|
+
className: g(l(s === r.id), !r.active && "opacity-70"),
|
|
652
|
+
children: [
|
|
653
|
+
/* @__PURE__ */ e(K, { id: r.id, name: r.name, size: 20 }),
|
|
654
|
+
/* @__PURE__ */ e("span", { className: "max-w-[9rem] truncate", children: r.name }),
|
|
655
|
+
u(r.open),
|
|
656
|
+
r.urgent > 0 && /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 rounded-full bg-red-500", "aria-hidden": !0 })
|
|
657
|
+
]
|
|
658
|
+
},
|
|
659
|
+
r.id
|
|
660
|
+
))
|
|
661
|
+
]
|
|
662
|
+
}
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
function st({
|
|
666
|
+
count: a,
|
|
667
|
+
busy: s,
|
|
668
|
+
people: c,
|
|
669
|
+
onRun: l,
|
|
670
|
+
onClear: u
|
|
671
|
+
}) {
|
|
672
|
+
const o = "inline-flex h-8 items-center gap-1.5 rounded-md px-2.5 text-[12.5px] font-medium text-slate-700 hover:bg-slate-100 disabled:opacity-50 dark:text-slate-200 dark:hover:bg-white/10", i = "!bg-red-600 !text-white hover:!bg-red-700 dark:!bg-red-600 dark:hover:!bg-red-700";
|
|
673
|
+
return (
|
|
674
|
+
// The page colour under and around the bar. Sticky stops above the host's bottom padding
|
|
675
|
+
// (24 px in admin): -bottom-6 lets the backdrop reach the edge, so rows never show below it.
|
|
676
|
+
/* @__PURE__ */ e("div", { className: "sticky -bottom-6 z-10 -mx-1 mt-3 bg-slate-50 px-1 pb-9 pt-2 dark:bg-background", children: /* @__PURE__ */ n(
|
|
677
|
+
"div",
|
|
678
|
+
{
|
|
679
|
+
"data-support-bulk-bar": !0,
|
|
680
|
+
className: "flex flex-wrap items-center gap-1 rounded-lg border border-slate-200 bg-white px-2 py-1.5 shadow-[0_-2px_12px_rgba(15,23,42,0.08)] dark:border-border dark:bg-card dark:shadow-[0_-2px_12px_rgba(0,0,0,0.4)]",
|
|
681
|
+
children: [
|
|
682
|
+
/* @__PURE__ */ n("span", { className: "flex items-center pl-2 pr-1 text-[12.5px] font-semibold tabular-nums text-slate-900 dark:text-slate-100", children: [
|
|
683
|
+
a,
|
|
684
|
+
" selected",
|
|
685
|
+
/* @__PURE__ */ e(
|
|
686
|
+
"button",
|
|
687
|
+
{
|
|
688
|
+
type: "button",
|
|
689
|
+
onClick: u,
|
|
690
|
+
"data-tip": "Clear selection",
|
|
691
|
+
"aria-label": "Clear selection",
|
|
692
|
+
className: "ml-1 inline-flex h-6 w-6 items-center justify-center rounded text-slate-500 hover:bg-slate-100 hover:text-slate-800 dark:text-muted-foreground dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
693
|
+
children: /* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5" })
|
|
694
|
+
}
|
|
695
|
+
)
|
|
696
|
+
] }),
|
|
697
|
+
/* @__PURE__ */ e("span", { className: "mx-1 h-5 w-px bg-slate-200 dark:bg-border", "aria-hidden": !0 }),
|
|
698
|
+
/* @__PURE__ */ e(
|
|
699
|
+
se,
|
|
700
|
+
{
|
|
701
|
+
onConfirm: () => l({ kind: "status", status: "done" }),
|
|
702
|
+
disabled: s,
|
|
703
|
+
className: o,
|
|
704
|
+
armedClassName: i,
|
|
705
|
+
confirmLabel: `Close ${a}?`,
|
|
706
|
+
title: "Close as done",
|
|
707
|
+
children: "Close"
|
|
708
|
+
}
|
|
709
|
+
),
|
|
710
|
+
/* @__PURE__ */ e(
|
|
711
|
+
se,
|
|
712
|
+
{
|
|
713
|
+
onConfirm: () => l({ kind: "status", status: "cancelled" }),
|
|
714
|
+
disabled: s,
|
|
715
|
+
className: o,
|
|
716
|
+
armedClassName: i,
|
|
717
|
+
confirmLabel: `Cancel ${a}?`,
|
|
718
|
+
title: "Cancel these requests",
|
|
719
|
+
children: "Cancel requests"
|
|
720
|
+
}
|
|
721
|
+
),
|
|
722
|
+
/* @__PURE__ */ e(
|
|
723
|
+
pe,
|
|
724
|
+
{
|
|
725
|
+
value: "",
|
|
726
|
+
ariaLabel: "Assign to",
|
|
727
|
+
align: "start",
|
|
728
|
+
fixed: [
|
|
729
|
+
{ value: "me", label: "Me" },
|
|
730
|
+
{ value: "unassigned", label: "Nobody (back to the desk)" }
|
|
731
|
+
],
|
|
732
|
+
people: c,
|
|
733
|
+
onPick: (r, b) => l(
|
|
734
|
+
r === "unassigned" ? { kind: "assign", assignee: null, name: "" } : { kind: "assign", assignee: r, name: r === "me" ? "you" : b }
|
|
735
|
+
),
|
|
736
|
+
trigger: /* @__PURE__ */ n("button", { type: "button", disabled: s, className: o, "data-support-bulk-assign": !0, children: [
|
|
737
|
+
"Assign to… ",
|
|
738
|
+
/* @__PURE__ */ e(F, {})
|
|
739
|
+
] })
|
|
740
|
+
}
|
|
741
|
+
),
|
|
742
|
+
/* @__PURE__ */ n(ne, { children: [
|
|
743
|
+
/* @__PURE__ */ e(le, { asChild: !0, children: /* @__PURE__ */ n("button", { type: "button", disabled: s, className: o, children: [
|
|
744
|
+
"Status ",
|
|
745
|
+
/* @__PURE__ */ e(F, {})
|
|
746
|
+
] }) }),
|
|
747
|
+
/* @__PURE__ */ e(ie, { align: "start", className: "text-[12.5px]", children: [
|
|
748
|
+
["open", "Open"],
|
|
749
|
+
["in_progress", "In progress"],
|
|
750
|
+
["done", "Done"],
|
|
751
|
+
["cancelled", "Cancelled"]
|
|
752
|
+
].map(([r, b]) => /* @__PURE__ */ e(oe, { onSelect: () => l({ kind: "status", status: r }), children: b }, r)) })
|
|
753
|
+
] }),
|
|
754
|
+
/* @__PURE__ */ n(ne, { children: [
|
|
755
|
+
/* @__PURE__ */ e(le, { asChild: !0, children: /* @__PURE__ */ n("button", { type: "button", disabled: s, className: o, children: [
|
|
756
|
+
"Priority ",
|
|
757
|
+
/* @__PURE__ */ e(F, {})
|
|
758
|
+
] }) }),
|
|
759
|
+
/* @__PURE__ */ e(ie, { align: "start", className: "text-[12.5px]", children: ["urgent", "normal", "low"].map((r) => /* @__PURE__ */ e(oe, { onSelect: () => l({ kind: "priority", priority: r }), children: /* @__PURE__ */ e("span", { className: "capitalize", children: r }) }, r)) })
|
|
760
|
+
] })
|
|
761
|
+
]
|
|
762
|
+
}
|
|
763
|
+
) })
|
|
764
|
+
);
|
|
765
|
+
}
|
|
766
|
+
function nt({
|
|
767
|
+
tab: a,
|
|
768
|
+
filtered: s,
|
|
769
|
+
unassignedOnly: c,
|
|
770
|
+
closed: l,
|
|
771
|
+
onClear: u
|
|
772
|
+
}) {
|
|
773
|
+
return /* @__PURE__ */ n("div", { className: "flex flex-col items-center gap-2 px-6 py-12 text-center", "data-support-empty": !0, children: [
|
|
774
|
+
/* @__PURE__ */ e(Re, { className: "h-6 w-6 text-slate-300 dark:text-slate-600" }),
|
|
775
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-700 dark:text-slate-200", children: a === "desk" ? c ? "Every request has been picked up." : s ? "No requests match these filters." : l ? "Nothing closed yet." : "No open requests. The desk is clear." : s ? "None of your requests match." : l ? "No closed requests yet." : "You have no open requests." }),
|
|
776
|
+
a === "mine" && !s && /* @__PURE__ */ e("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." }),
|
|
777
|
+
s && /* @__PURE__ */ e(
|
|
778
|
+
"button",
|
|
779
|
+
{
|
|
780
|
+
type: "button",
|
|
781
|
+
onClick: u,
|
|
782
|
+
className: "text-[12px] font-medium text-nvr-navy underline underline-offset-2 dark:text-nvr-cyan",
|
|
783
|
+
children: "Clear filters"
|
|
784
|
+
}
|
|
785
|
+
)
|
|
786
|
+
] });
|
|
787
|
+
}
|
|
788
|
+
export {
|
|
789
|
+
Ct as RequestList
|
|
790
|
+
};
|