@nivaro/react 0.3.12 → 0.3.14

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 (50) hide show
  1. package/dist/components/slots/pipeline/OwnersSection.js +79 -75
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +50 -2
  5. package/dist/index.js +601 -596
  6. package/dist/shared/components/CollectionBrowserView.js +2373 -2298
  7. package/dist/shared/components/DataTable.js +347 -335
  8. package/dist/shared/components/ItemEditForm.js +5278 -5149
  9. package/dist/shared/components/ListLoadError.js +33 -0
  10. package/dist/shared/components/PageRenderer.js +562 -529
  11. package/dist/shared/components/ProfileView.js +53 -51
  12. package/dist/shared/components/RecordReadView.js +119 -117
  13. package/dist/shared/components/ReportView.js +1268 -1241
  14. package/dist/shared/components/cbv/export-rows.js +69 -0
  15. package/dist/shared/components/cbv/saved-view-risk.js +35 -0
  16. package/dist/shared/components/cbv/unknown-fields.js +18 -0
  17. package/dist/shared/components/integrations/console/AlertsView.js +27 -25
  18. package/dist/shared/components/integrations/console/EventsView.js +244 -209
  19. package/dist/shared/components/item-edit/CatalogPickerField.js +946 -878
  20. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +84 -57
  21. package/dist/shared/components/item-edit/FieldAffordances.js +63 -61
  22. package/dist/shared/components/item-edit/FieldRow.js +195 -179
  23. package/dist/shared/components/item-edit/FilePickerField.js +257 -254
  24. package/dist/shared/components/item-edit/HeaderTools.js +139 -95
  25. package/dist/shared/components/item-edit/InlineTableField.js +2087 -2075
  26. package/dist/shared/components/item-edit/RecordLiveSync.js +196 -181
  27. package/dist/shared/components/item-edit/RowComments.js +1 -3
  28. package/dist/shared/components/item-edit/SummaryPanel.js +62 -62
  29. package/dist/shared/components/item-edit/UserChip.js +113 -113
  30. package/dist/shared/components/item-edit/file-download.js +18 -0
  31. package/dist/shared/components/item-edit/line-qty.js +67 -32
  32. package/dist/shared/components/item-edit/save-refusal.js +23 -0
  33. package/dist/shared/components/monitoring/TrafficMiniMap.js +9 -9
  34. package/dist/shared/components/panels/CommentPanel.js +30 -30
  35. package/dist/shared/components/panels/ItemLockBanner.js +207 -185
  36. package/dist/shared/components/panels/PipelinePanel.js +915 -786
  37. package/dist/shared/components/pipeline/PipelineEditorView.js +45 -25
  38. package/dist/shared/components/profile/DelegationCard.js +1 -1
  39. package/dist/shared/components/profile/session-actions.js +24 -24
  40. package/dist/shared/components/queue/QueueItemSheet.js +18 -18
  41. package/dist/shared/components/queue/QueueWorklist.js +517 -504
  42. package/dist/shared/components/ui/dropdown-menu.js +8 -7
  43. package/dist/shared/context.js +71 -66
  44. package/dist/shared/lib/draft-store.js +60 -33
  45. package/dist/shared/lib/leave-guard.js +38 -0
  46. package/dist/shared/lib/load-error.js +38 -17
  47. package/dist/shared/lib/summary-mode.js +25 -25
  48. package/dist/shared/lib/table-pins.js +23 -0
  49. package/dist/shared/lib/validation-rules.js +55 -51
  50. package/package.json +1 -1
@@ -1,70 +1,71 @@
1
1
  import { jsxs as d, Fragment as we, jsx as r } from "react/jsx-runtime";
2
- import { useSensors as wl, useSensor as _l, PointerSensor as Nl, DndContext as Sl, closestCenter as Cl } from "@dnd-kit/core";
3
- import { SortableContext as $l, verticalListSortingStrategy as ql, arrayMove as Fl, useSortable as Tl } from "@dnd-kit/sortable";
4
- import { CSS as Rl } from "@dnd-kit/utilities";
5
- import { useQueryClient as Al, useQuery as H, useMutation as ve, useQueries as Je } from "@tanstack/react-query";
6
- import { AlertTriangle as Ol, FileDiff as El, RefreshCw as Ll, Rows3 as na, Flame as Dl, Sparkles as Pl, BarChart3 as Kl, SlidersHorizontal as Ml, Rows4 as Ql, Rows2 as jl, Play as Bl, Plus as Gt, ChevronDown as ra, Star as Ul, Pin as Il, Loader2 as Vl, Check as Gl, Save as Wl, Bell as Hl, Inbox as Jl, GripVertical as Yl } from "lucide-react";
2
+ import { useSensors as Sl, useSensor as Cl, PointerSensor as $l, DndContext as ql, closestCenter as Fl } from "@dnd-kit/core";
3
+ import { SortableContext as Tl, verticalListSortingStrategy as Rl, arrayMove as Al, useSortable as Ol } from "@dnd-kit/sortable";
4
+ import { CSS as El } from "@dnd-kit/utilities";
5
+ import { useQueryClient as Ll, useQuery as H, useMutation as ve, useQueries as Je } from "@tanstack/react-query";
6
+ import { AlertTriangle as Dl, FileDiff as Pl, RefreshCw as Kl, Rows3 as ra, Flame as Ml, Sparkles as Ql, BarChart3 as jl, SlidersHorizontal as Bl, Rows4 as Ul, Rows2 as Il, Play as Vl, Plus as Gt, ChevronDown as aa, Star as Gl, Pin as Wl, Loader2 as Hl, Check as Jl, Save as Yl, Bell as zl, Inbox as Xl, GripVertical as Zl } from "lucide-react";
7
7
  import { useState as k, useRef as j, useEffect as B, useMemo as G } from "react";
8
- import { createPortal as aa } from "react-dom";
8
+ import { createPortal as la } from "react-dom";
9
9
  import { toast as R } from "sonner";
10
- import { useNivaroClient as ua, useItemEditAuth as la, useItemNavigation as zl, useNavigation as Xl, useOverlayState as Zl } from "../../context.js";
11
- import { useDebounced as eo } from "../../hooks/useDebounced.js";
12
- import { useElapsedLoading as to } from "../../hooks/useElapsedLoading.js";
13
- import { useBulkProgressFeed as no } from "../../lib/bulk-progress.js";
14
- import { get as O, post as ne, patch as oa, del as Tn, put as ro } from "../../lib/commands.js";
15
- import { evaluateExpression as ao } from "../../lib/expression.js";
16
- import { deliverLive as lo, releaseLiveOwner as oo } from "../../lib/focus-mode.js";
17
- import { formatMultiValue as Ye, formatValue as so } from "../../lib/format-value.js";
18
- import { createCursorBook as io, pageRequest as co, noteNextCursor as uo } from "../../lib/keyset-pager.js";
19
- import { expandCoalesced as mo, LIVE_ASPECTS as xt } from "../../lib/live.js";
20
- import { useRowChanges as bo, useRowLocksByCollection as po, lockLabel as ho } from "../../lib/live-list.js";
21
- import { OPEN_IN_TABS_CAP as fo, openInTabs as go, openInTabsMessage as sa } from "../../lib/open-in-tabs.js";
22
- import { isOwnWrite as xo } from "../../lib/own-writes.js";
23
- import { useRowPresence as yo, rowPresenceKey as ko } from "../../lib/presence-hooks.js";
24
- import { buildGroups as vo } from "../../lib/queue-grouping.js";
25
- import { useOptionalRealtime as wo } from "../../lib/realtime.js";
26
- import { rowHighlightTextClass as _o, rowHighlightClass as No } from "../../lib/row-highlight.js";
10
+ import { useNivaroClient as ma, useItemEditAuth as oa, useItemNavigation as eo, useNavigation as to, useOverlayState as no } from "../../context.js";
11
+ import { useDebounced as ro } from "../../hooks/useDebounced.js";
12
+ import { useElapsedLoading as ao } from "../../hooks/useElapsedLoading.js";
13
+ import { useBulkProgressFeed as lo } from "../../lib/bulk-progress.js";
14
+ import { get as O, post as ne, patch as sa, del as Tn, put as oo } from "../../lib/commands.js";
15
+ import { evaluateExpression as so } from "../../lib/expression.js";
16
+ import { deliverLive as io, releaseLiveOwner as co } from "../../lib/focus-mode.js";
17
+ import { formatMultiValue as Ye, formatValue as uo } from "../../lib/format-value.js";
18
+ import { createCursorBook as mo, pageRequest as bo, noteNextCursor as po } from "../../lib/keyset-pager.js";
19
+ import { expandCoalesced as ho, LIVE_ASPECTS as xt } from "../../lib/live.js";
20
+ import { useRowChanges as fo, useRowLocksByCollection as go, lockLabel as xo } from "../../lib/live-list.js";
21
+ import { OPEN_IN_TABS_CAP as yo, openInTabs as ko, openInTabsMessage as ia } from "../../lib/open-in-tabs.js";
22
+ import { isOwnWrite as vo } from "../../lib/own-writes.js";
23
+ import { useRowPresence as wo, rowPresenceKey as _o } from "../../lib/presence-hooks.js";
24
+ import { buildGroups as No } from "../../lib/queue-grouping.js";
25
+ import { useOptionalRealtime as So } from "../../lib/realtime.js";
26
+ import { rowHighlightTextClass as Co, rowHighlightClass as $o } from "../../lib/row-highlight.js";
27
27
  import { userErrorMessage as yt } from "../../lib/safe-error.js";
28
- import { useMyScopes as So, matchScopeDimension as Co, effectiveScopeSeedIds as $o } from "../../lib/use-my-scopes.js";
29
- import { useNewItemLayouts as qo } from "../../lib/use-new-item-layouts.js";
30
- import { formatNumber as re, cn as C, titleCase as Rn, humanHours as Fo, formatRelative as To, formatDateTime as Ro, formatDate as Ao } from "../../lib/utils.js";
31
- import { usePublishAskContext as Oo, useAskRecordDrag as Eo } from "../ai/ask-context.js";
32
- import { useBuiltinGate as Lo, BulkActionButtons as Do } from "../bulk/BulkActionButtons.js";
33
- import { BulkRowMark as Po } from "../bulk/BulkRowMark.js";
34
- import { RowActionsMenu as Ko } from "../CollectionBrowserView.js";
35
- import { DataTable as Mo } from "../DataTable.js";
36
- import { EmptyState as Qo } from "../EmptyState.js";
37
- import { FocusModeToggle as jo } from "../FocusModeToggle.js";
38
- import { FulfilmentPill as Bo, FULFILMENT_FILTER_OPTIONS as Uo } from "../FulfilmentPill.js";
39
- import { ImportFromFileButton as Io } from "../import/ImportFromFileButton.js";
40
- import { IntegrationDots as Vo, INTEGRATIONS_FILTER_OPTIONS as Go } from "../integrations/IntegrationDots.js";
41
- import { IntegrationsFilterPill as Wo } from "../integrations/IntegrationsFilterPill.js";
42
- import { readQueueReturn as Ho, writeQueueReturn as ia } from "../item-edit/QueueReturnChip.js";
43
- import { LiveRowMark as Jo } from "../LiveRowMark.js";
44
- import { RealtimeStaleMark as Yo } from "../RealtimeStatusBanner.js";
45
- import { RecordDrilldownSheet as zo } from "../RecordDrilldownSheet.js";
46
- import { RowHighlightLegend as Xo } from "../RowHighlightLegend.js";
47
- import { RowPresence as Zo } from "../RowPresence.js";
28
+ import { useMyScopes as qo, matchScopeDimension as Fo, effectiveScopeSeedIds as To } from "../../lib/use-my-scopes.js";
29
+ import { useNewItemLayouts as Ro } from "../../lib/use-new-item-layouts.js";
30
+ import { formatNumber as re, cn as C, titleCase as Rn, humanHours as Ao, formatRelative as Oo, formatDateTime as Eo, formatDate as Lo } from "../../lib/utils.js";
31
+ import { usePublishAskContext as Do, useAskRecordDrag as Po } from "../ai/ask-context.js";
32
+ import { useBuiltinGate as Ko, BulkActionButtons as Mo } from "../bulk/BulkActionButtons.js";
33
+ import { BulkRowMark as Qo } from "../bulk/BulkRowMark.js";
34
+ import { RowActionsMenu as jo } from "../CollectionBrowserView.js";
35
+ import { DataTable as Bo } from "../DataTable.js";
36
+ import { EmptyState as Uo } from "../EmptyState.js";
37
+ import { FocusModeToggle as Io } from "../FocusModeToggle.js";
38
+ import { FulfilmentPill as Vo, FULFILMENT_FILTER_OPTIONS as Go } from "../FulfilmentPill.js";
39
+ import { ImportFromFileButton as Wo } from "../import/ImportFromFileButton.js";
40
+ import { IntegrationDots as Ho, INTEGRATIONS_FILTER_OPTIONS as Jo } from "../integrations/IntegrationDots.js";
41
+ import { IntegrationsFilterPill as Yo } from "../integrations/IntegrationsFilterPill.js";
42
+ import { readQueueReturn as zo, writeQueueReturn as ca } from "../item-edit/QueueReturnChip.js";
43
+ import { LiveRowMark as Xo } from "../LiveRowMark.js";
44
+ import { RealtimeStaleMark as Zo } from "../RealtimeStatusBanner.js";
45
+ import { RecordDrilldownSheet as es } from "../RecordDrilldownSheet.js";
46
+ import { RowHighlightLegend as ts } from "../RowHighlightLegend.js";
47
+ import { RowPresence as ns } from "../RowPresence.js";
48
48
  import { TickerNumber as An } from "../TickerNumber.js";
49
- import { UnseenDot as es } from "../UnseenDot.js";
50
- import { Badge as ts } from "../ui/badge.js";
49
+ import { UnseenDot as rs } from "../UnseenDot.js";
50
+ import { Badge as as } from "../ui/badge.js";
51
51
  import { Checkbox as On } from "../ui/checkbox.js";
52
- import { Command as ca, CommandInput as ns, CommandList as da, CommandEmpty as rs, CommandItem as kt } from "../ui/command.js";
53
- import { Label as as } from "../ui/label.js";
52
+ import { Command as da, CommandInput as ls, CommandList as ua, CommandEmpty as os, CommandItem as kt } from "../ui/command.js";
53
+ import { Label as ss } from "../ui/label.js";
54
54
  import { Popover as ze, PopoverTrigger as Xe, PopoverContent as Ze } from "../ui/popover.js";
55
- import { Skeleton as ls } from "../ui/skeleton.js";
56
- import { OwnerAvatars as os } from "./OwnerAvatars.js";
57
- import { QueueBulkBar as ss } from "./QueueBulkBar.js";
58
- import { QueueItemSheet as is } from "./QueueItemSheet.js";
59
- import { QueueKanbanBoard as cs } from "./QueueKanbanBoard.js";
60
- import { QueueQuickFilters as ds } from "./QueueQuickFilters.js";
61
- import { QueueWorkloadView as us } from "./QueueWorkloadView.js";
62
- function ms({ summary: l }) {
55
+ import { Skeleton as is } from "../ui/skeleton.js";
56
+ import { OwnerAvatars as cs } from "./OwnerAvatars.js";
57
+ import { ListLoadError as ds } from "../ListLoadError.js";
58
+ import { QueueBulkBar as us } from "./QueueBulkBar.js";
59
+ import { QueueItemSheet as ms } from "./QueueItemSheet.js";
60
+ import { QueueKanbanBoard as bs } from "./QueueKanbanBoard.js";
61
+ import { QueueQuickFilters as ps } from "./QueueQuickFilters.js";
62
+ import { QueueWorkloadView as hs } from "./QueueWorkloadView.js";
63
+ function fs({ summary: l }) {
63
64
  if (!l || l.count === 0)
64
65
  return /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
65
66
  const f = [l.last_from, l.last_to].filter(Boolean).join(" → "), $ = [
66
67
  f ? `Last: ${f}` : null,
67
- l.last_at ? To(l.last_at) : null,
68
+ l.last_at ? Oo(l.last_at) : null,
68
69
  l.last_reason ? `“${l.last_reason}”` : "no reason given"
69
70
  ].filter(Boolean).join(" · ");
70
71
  return /* @__PURE__ */ d(
@@ -86,13 +87,13 @@ function ms({ summary: l }) {
86
87
  }
87
88
  );
88
89
  }
89
- const bs = 50, Wt = "nivaro_addendums", ps = [
90
+ const gs = 50, Wt = "nivaro_addendums", xs = [
90
91
  { value: "mine", label: "My Items" },
91
92
  { value: "unowned", label: "No Owners" },
92
93
  { value: "claimed", label: "Claimed by me" },
93
94
  { value: "all", label: "All Items" }
94
95
  ];
95
- function hs({ summary: l }) {
96
+ function ys({ summary: l }) {
96
97
  if (!l || l.total === 0) return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
97
98
  const f = l.active > 0, $ = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", L = l.cost_impact, U = L != null && L !== 0 ? `${L > 0 ? "+" : "−"}$${Math.abs(L).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
98
99
  return /* @__PURE__ */ d(
@@ -123,13 +124,13 @@ function hs({ summary: l }) {
123
124
  }
124
125
  );
125
126
  }
126
- function fs(l) {
127
- return Fo(l);
127
+ function ks(l) {
128
+ return Ao(l);
128
129
  }
129
- function gs({ status: l }) {
130
+ function vs({ status: l }) {
130
131
  return l ? /* @__PURE__ */ r("span", { className: C("rounded px-1.5 py-0.5 text-[11px] font-medium", l === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : l === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"), children: l }) : /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
131
132
  }
132
- function xs({ points: l, inline: f = !1 }) {
133
+ function ws({ points: l, inline: f = !1 }) {
133
134
  if (l.length < 2) return null;
134
135
  const $ = f ? 40 : 64, L = f ? 14 : 18, U = Math.max(...l), h = Math.min(...l), p = U - h || 1, v = $ / (l.length - 1), W = l.map(
135
136
  (pe, g) => `${g === 0 ? "M" : "L"}${(g * v).toFixed(1)},${(L - 2 - (pe - h) / p * (L - 4)).toFixed(1)}`
@@ -167,7 +168,7 @@ function vt({
167
168
  L && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
168
169
  !L && !U && f === 0 && "opacity-50"
169
170
  ),
170
- children: U ? /* @__PURE__ */ r(ls, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(we, { children: [
171
+ children: U ? /* @__PURE__ */ r(is, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(we, { children: [
171
172
  /* @__PURE__ */ r("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: $ != null ? /* @__PURE__ */ d(we, { children: [
172
173
  /* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ r(An, { value: $, format: re }) }),
173
174
  /* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-400", children: [
@@ -198,12 +199,12 @@ function vt({
198
199
  ]
199
200
  }
200
201
  ),
201
- p && f > 0 && /* @__PURE__ */ r(xs, { points: p, inline: !0 })
202
+ p && f > 0 && /* @__PURE__ */ r(ws, { points: p, inline: !0 })
202
203
  ] })
203
204
  }
204
205
  );
205
206
  }
206
- function ys({
207
+ function _s({
207
208
  label: l,
208
209
  count: f,
209
210
  filteredCount: $,
@@ -243,16 +244,16 @@ function ys({
243
244
  function wt(l) {
244
245
  return l.split(".").map((f) => f.replace(/_/g, " ").replace(/\b\w/g, ($) => $.toUpperCase())).join(" → ");
245
246
  }
246
- function ks({
247
+ function Ns({
247
248
  id: l,
248
249
  label: f,
249
250
  checked: $,
250
251
  onCheckedChange: L
251
252
  }) {
252
- const { attributes: U, listeners: h, setNodeRef: p, transform: v, transition: W, isDragging: pe } = Tl({
253
+ const { attributes: U, listeners: h, setNodeRef: p, transform: v, transition: W, isDragging: pe } = Ol({
253
254
  id: l
254
255
  }), g = {
255
- transform: Rl.Transform.toString(v),
256
+ transform: El.Transform.toString(v),
256
257
  transition: W,
257
258
  opacity: pe ? 0.4 : 1
258
259
  }, J = `col-toggle-${l}`;
@@ -263,34 +264,34 @@ function ks({
263
264
  ...U,
264
265
  ...h,
265
266
  className: "cursor-grab text-slate-300 hover:text-slate-500 dark:text-muted-foreground",
266
- children: /* @__PURE__ */ r(Yl, { className: "h-3.5 w-3.5" })
267
+ children: /* @__PURE__ */ r(Zl, { className: "h-3.5 w-3.5" })
267
268
  }
268
269
  ),
269
270
  /* @__PURE__ */ r(On, { id: J, checked: $, onCheckedChange: L }),
270
- /* @__PURE__ */ r(as, { htmlFor: J, className: "cursor-pointer text-[12px] font-normal", children: f })
271
+ /* @__PURE__ */ r(ss, { htmlFor: J, className: "cursor-pointer text-[12px] font-normal", children: f })
271
272
  ] });
272
273
  }
273
- function Ai({
274
+ function Pi({
274
275
  queueId: l,
275
276
  realtime: f,
276
277
  renderError: $,
277
278
  hideCreateActions: L = !1,
278
279
  onAsk: U
279
280
  }) {
280
- var Mr, Qr, jr, Br, Ur, Ir, Vr, Gr, Wr, Hr, Jr, Yr, zr, Xr, Zr, ea;
281
- const h = Al(), p = ua(), { userId: v } = la(), W = zl(), { navigate: pe } = Xl(), [g, J] = k("all"), [_e, E] = k(1), En = j(io()), [_t, ma] = k(() => {
281
+ var Qr, jr, Br, Ur, Ir, Vr, Gr, Wr, Hr, Jr, Yr, zr, Xr, Zr, ea, ta;
282
+ const h = Ll(), p = ma(), { userId: v } = oa(), W = eo(), { navigate: pe } = to(), [g, J] = k("all"), [_e, E] = k(1), En = j(mo()), [_t, ba] = k(() => {
282
283
  try {
283
284
  return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
284
285
  } catch {
285
286
  return "compact";
286
287
  }
287
- }), [A, Ee] = k("table"), [I, Le] = k(""), [w, P] = k({}), [Nt, Ln] = k(() => /* @__PURE__ */ new Set()), [N, et] = k(null), [he, Ht] = k(/* @__PURE__ */ new Set()), [tt, Jt] = k(null), [St, Yt] = k(null), [zt, Ct] = k(0), Ne = bo(), Xt = wo(), Zt = j({}).current, Dn = j(/* @__PURE__ */ new Set()), [ba, pa] = k(0), [Pn, ha] = k(0), De = j(!1), $t = j([]), Kn = j(null), Mn = j(!1), Qn = j(0), en = j("table");
288
+ }), [A, Ee] = k("table"), [I, Le] = k(""), [w, P] = k({}), [Nt, Ln] = k(() => /* @__PURE__ */ new Set()), [N, et] = k(null), [he, Ht] = k(/* @__PURE__ */ new Set()), [tt, Jt] = k(null), [St, Yt] = k(null), [zt, Ct] = k(0), Ne = fo(), Xt = So(), Zt = j({}).current, Dn = j(/* @__PURE__ */ new Set()), [pa, ha] = k(0), [Pn, fa] = k(0), De = j(!1), $t = j([]), Kn = j(null), Mn = j(!1), Qn = j(0), en = j("table");
288
289
  en.current = A;
289
290
  const tn = 25, { data: s, error: qt } = H({
290
291
  queryKey: ["queue-meta", l],
291
292
  queryFn: () => p.request(O(`/queues/${l}`)).then((e) => e.data),
292
293
  enabled: !!l
293
- }), { scopes: nt, ready: jn } = So(), Bn = j(!1), [Un, In] = k(!1), [Se, fa] = k({}), oe = j({});
294
+ }), { scopes: nt, ready: jn } = qo(), Bn = j(!1), [Un, In] = k(!1), [Se, ga] = k({}), oe = j({});
294
295
  B(() => {
295
296
  if (Bn.current || !jn || !s) return;
296
297
  Bn.current = !0;
@@ -317,7 +318,7 @@ function Ai({
317
318
  ];
318
319
  };
319
320
  for (const o of e) {
320
- const c = Co(nt, { collection: o.target_collection });
321
+ const c = Fo(nt, { collection: o.target_collection });
321
322
  if (!c) continue;
322
323
  const b = `extra.${o.path}`;
323
324
  try {
@@ -326,7 +327,7 @@ function Ai({
326
327
  const T = await a(o, m);
327
328
  T.length > 0 && (n[b.slice(6)] = T);
328
329
  }
329
- const M = $o(nt, c.name);
330
+ const M = To(nt, c.name);
330
331
  if (M.length === 0) continue;
331
332
  const F = w[b];
332
333
  if (F && (Array.isArray(F) ? F.length > 0 : F !== ""))
@@ -336,10 +337,10 @@ function Ai({
336
337
  } catch {
337
338
  }
338
339
  }
339
- Object.keys(n).length > 0 && fa(n), Object.keys(t).length > 0 && (oe.current = t, P((o) => ({ ...o, ...t }))), In(!0);
340
+ Object.keys(n).length > 0 && ga(n), Object.keys(t).length > 0 && (oe.current = t, P((o) => ({ ...o, ...t }))), In(!0);
340
341
  })();
341
342
  }, [jn, nt, s]);
342
- const Pe = ((Qr = (Mr = s == null ? void 0 : s.sources) == null ? void 0 : Mr.find((e) => e.type === "collection")) == null ? void 0 : Qr.collection) ?? null, { data: Vn = [] } = H({
343
+ const Pe = ((jr = (Qr = s == null ? void 0 : s.sources) == null ? void 0 : Qr.find((e) => e.type === "collection")) == null ? void 0 : jr.collection) ?? null, { data: Vn = [] } = H({
343
344
  queryKey: ["queue-browser-quick-filters", Pe],
344
345
  queryFn: () => p.request(O(`/collections/${Pe}`)).then((e) => {
345
346
  var t, n;
@@ -352,9 +353,9 @@ function Ai({
352
353
  for (const n of (s == null ? void 0 : s.sources) ?? [])
353
354
  n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
354
355
  return t;
355
- }, [s == null ? void 0 : s.sources]), Ft = qo(
356
+ }, [s == null ? void 0 : s.sources]), Ft = Ro(
356
357
  z.length === 1 ? z[0] : null
357
- ), nn = L === !0 || Array.isArray(L) && z.length > 0 && z.every((e) => L.includes(e)), se = (s == null ? void 0 : s.claims_enabled) !== !1, u = s == null ? void 0 : s.display_config, Ce = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], ga = (u == null ? void 0 : u.work_next) !== !1, rn = (u == null ? void 0 : u.bulk_actions) !== !1, an = Lo(
358
+ ), nn = L === !0 || Array.isArray(L) && z.length > 0 && z.every((e) => L.includes(e)), se = (s == null ? void 0 : s.claims_enabled) !== !1, u = s == null ? void 0 : s.display_config, Ce = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], xa = (u == null ? void 0 : u.work_next) !== !1, rn = (u == null ? void 0 : u.bulk_actions) !== !1, an = Ko(
358
359
  [
359
360
  ...new Set(
360
361
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
@@ -368,7 +369,7 @@ function Ai({
368
369
  B(() => {
369
370
  !s || Gn.current || (Gn.current = !0, Le("-priority"));
370
371
  }, [s]);
371
- const [ae, xa] = k(!1);
372
+ const [ae, ya] = k(!1);
372
373
  B(() => {
373
374
  s != null && s.display_config && !Ce.includes(A) && Ee(Ce[0]);
374
375
  }, [s, A, Ce]), B(() => {
@@ -385,7 +386,7 @@ function Ai({
385
386
  let a = null, o = null, c = null;
386
387
  const b = () => {
387
388
  c || (c = setTimeout(() => {
388
- c = null, ha((y) => y + 1);
389
+ c = null, fa((y) => y + 1);
389
390
  }, 1500));
390
391
  }, m = () => {
391
392
  o || (o = setTimeout(() => {
@@ -398,12 +399,12 @@ function Ai({
398
399
  }, M = (y) => {
399
400
  let T = !1, Q = 0, ke = !1;
400
401
  const Oe = y.flatMap(
401
- (_) => _ ? mo(_) : [_]
402
+ (_) => _ ? ho(_) : [_]
402
403
  );
403
404
  for (const _ of Oe) {
404
- const be = _ == null ? void 0 : _.changed_fields, Vt = (_ == null ? void 0 : _.collection) != null ? `${_.collection}:${String(_.item)}` : null, ta = Vt != null && Dn.current.has(Vt);
405
+ const be = _ == null ? void 0 : _.changed_fields, Vt = (_ == null ? void 0 : _.collection) != null ? `${_.collection}:${String(_.item)}` : null, na = Vt != null && Dn.current.has(Vt);
405
406
  if (_ && !_.action && (be != null && be.length) && be.every((gt) => gt.startsWith("$"))) {
406
- be.includes(xt.tasks) && n.add("queue-task-counts"), be.includes(xt.integrations) && n.add("queue-integrations-summary"), be.includes(xt.addendums) && n.add("queue-collection-addendums"), be.includes(xt.lock) && pa((gt) => gt + 1), be.includes(xt.state) && (ke = !0, (ta || en.current === "kanban") && (T = !0)), a || (a = setTimeout(() => {
407
+ be.includes(xt.tasks) && n.add("queue-task-counts"), be.includes(xt.integrations) && n.add("queue-integrations-summary"), be.includes(xt.addendums) && n.add("queue-collection-addendums"), be.includes(xt.lock) && ha((gt) => gt + 1), be.includes(xt.state) && (ke = !0, (na || en.current === "kanban") && (T = !0)), a || (a = setTimeout(() => {
407
408
  a = null;
408
409
  for (const gt of n) h.invalidateQueries({ queryKey: [gt] });
409
410
  n.clear();
@@ -411,16 +412,16 @@ function Ai({
411
412
  continue;
412
413
  }
413
414
  ke = !0;
414
- const vl = (_ == null ? void 0 : _.collection) != null && xo(_.collection, _.item);
415
- Vt && (ta || (_ == null ? void 0 : _.action) === "create" || en.current === "kanban") ? (T = !0, vl || $t.current.push({ key: Vt, by: null })) : Q += 1;
415
+ const Nl = (_ == null ? void 0 : _.collection) != null && vo(_.collection, _.item);
416
+ Vt && (na || (_ == null ? void 0 : _.action) === "create" || en.current === "kanban") ? (T = !0, Nl || $t.current.push({ key: Vt, by: null })) : Q += 1;
416
417
  }
417
418
  Q > 0 && Ct((_) => _ + Q), T && m(), ke && b();
418
- }, F = e(t, (y) => lo(Zt, [y ?? {}], M));
419
+ }, F = e(t, (y) => io(Zt, [y ?? {}], M));
419
420
  return () => {
420
- F(), oo(Zt), a && clearTimeout(a), o && clearTimeout(o), c && clearTimeout(c);
421
+ F(), co(Zt), a && clearTimeout(a), o && clearTimeout(o), c && clearTimeout(c);
421
422
  };
422
423
  }, [Xt, f, s == null ? void 0 : s.sources, h, l, v, Zt]);
423
- const Ke = eo(w, 350), ya = JSON.stringify(Ke) === JSON.stringify(w), ln = j(!1), $e = A === "table" && !!N, Wn = (() => {
424
+ const Ke = ro(w, 350), ka = JSON.stringify(Ke) === JSON.stringify(w), ln = j(!1), $e = A === "table" && !!N, Wn = (() => {
424
425
  const e = /* @__PURE__ */ new Set();
425
426
  for (const t of (s == null ? void 0 : s.extra_field_meta) ?? [])
426
427
  t.aggregate && t.aggregate !== "count" && e.add(t.path);
@@ -450,17 +451,17 @@ function Ai({
450
451
  function Me(e, t) {
451
452
  P((n) => ({ ...n, [e]: n[e] === t ? "" : t })), E(1);
452
453
  }
453
- function ka(e) {
454
+ function va(e) {
454
455
  P((t) => {
455
456
  const n = t.state, a = Array.isArray(n) ? n : n ? [n] : [], o = a.includes(e) ? a.filter((c) => c !== e) : [...a, e];
456
457
  return { ...t, state: o };
457
458
  }), E(1);
458
459
  }
459
- const va = Array.isArray(w.state) ? w.state : w.state ? [w.state] : [], wa = (e) => !e || Array.isArray(e) && e.length === 0;
460
- function _a() {
460
+ const wa = Array.isArray(w.state) ? w.state : w.state ? [w.state] : [], _a = (e) => !e || Array.isArray(e) && e.length === 0;
461
+ function Na() {
461
462
  P({ ...oe.current }), J("all"), E(1);
462
463
  }
463
- const [rt, Na] = k(() => {
464
+ const [rt, Sa] = k(() => {
464
465
  try {
465
466
  return localStorage.getItem("nvr_queue_insights_open") === "1";
466
467
  } catch {
@@ -473,11 +474,11 @@ function Ai({
473
474
  } catch {
474
475
  }
475
476
  }, [rt]);
476
- const { data: Sa = [] } = H({
477
+ const { data: Ca = [] } = H({
477
478
  queryKey: ["queue-view-subs", l],
478
479
  queryFn: () => p.request(O("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
479
480
  staleTime: 3e4
480
- }), Tt = (e) => Sa.find((t) => t.queue_view_id === e), Ca = (e) => {
481
+ }), Tt = (e) => Ca.find((t) => t.queue_view_id === e), $a = (e) => {
481
482
  const t = Tt(e);
482
483
  (t ? p.request(Tn(`/notification-subscriptions/${t.id}`)) : p.request(
483
484
  ne("/notification-subscriptions", {
@@ -494,7 +495,7 @@ function Ai({
494
495
  ...new Set(
495
496
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
496
497
  )
497
- ], { data: $a = {} } = H({
498
+ ], { data: qa = {} } = H({
498
499
  queryKey: ["queue-custom-actions", l, sn.join(",")],
499
500
  queryFn: async () => {
500
501
  const e = {};
@@ -511,7 +512,7 @@ function Ai({
511
512
  },
512
513
  enabled: sn.length > 0,
513
514
  staleTime: 6e4
514
- }), qa = (e) => $a[e] ?? [], Fa = (e, t) => {
515
+ }), Fa = (e) => qa[e] ?? [], Ta = (e, t) => {
515
516
  p.request(ne(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
516
517
  R.success(`${e.label} ran`), h.invalidateQueries({ queryKey: ["queue-items", l] });
517
518
  }).catch((n) => {
@@ -532,7 +533,16 @@ function Ai({
532
533
  ).then(() => {
533
534
  h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
534
535
  }).catch((n) => R.error(yt(n, "Label failed")));
535
- }, { data: i, isLoading: Yn, isFetching: Rt, isPlaceholderData: Ta, dataUpdatedAt: le } = H({
536
+ }, {
537
+ data: i,
538
+ isLoading: Yn,
539
+ isFetching: Rt,
540
+ isPlaceholderData: Ra,
541
+ dataUpdatedAt: le,
542
+ isError: zn,
543
+ error: Aa,
544
+ refetch: Oa
545
+ } = H({
536
546
  queryKey: [
537
547
  "queue-items",
538
548
  l,
@@ -543,7 +553,7 @@ function Ai({
543
553
  N
544
554
  ],
545
555
  queryFn: async () => {
546
- const e = !$e && A === "table", t = JSON.stringify([l, g, I, fe, tn]), n = e ? co(En.current, t, _e, "").after : void 0, a = await p.request(
556
+ const e = !$e && A === "table", t = JSON.stringify([l, g, I, fe, tn]), n = e ? bo(En.current, t, _e, "").after : void 0, a = await p.request(
547
557
  O(`/queues/${l}/items`, {
548
558
  scope: g,
549
559
  // Last State Change is Aging read the other way round: the newest
@@ -558,7 +568,7 @@ function Ai({
558
568
  } : A === "table" ? { page: _e, limit: tn, ...n ? { after: n } : {} } : {}
559
569
  })
560
570
  );
561
- return n && uo(En.current, t, _e, a.next_cursor), a;
571
+ return n && po(En.current, t, _e, a.next_cursor), a;
562
572
  },
563
573
  // Wait for display_config AND scope seeding so the first fetch uses the
564
574
  // configured defaults and already carries the viewer's restricted filters.
@@ -567,7 +577,7 @@ function Ai({
567
577
  // first fetch went out WITHOUT the seeded scope and refired ~350ms later
568
578
  // with it (3.3s + 8.7s of work for one page). The first fetch now also
569
579
  // waits for the debounced copy to settle; later typing still debounces.
570
- enabled: !!l && ae && Un && (ln.current || ya),
580
+ enabled: !!l && ae && Un && (ln.current || ka),
571
581
  // Keep the previous page rendered while a sort/filter/page change refetches —
572
582
  // swapping to skeletons collapsed the table height and jittered the page.
573
583
  placeholderData: (e) => e
@@ -578,22 +588,22 @@ function Ai({
578
588
  var n;
579
589
  return !((n = Se[e.slice(6)]) != null && n.length) && JSON.stringify(fe[e] ?? null) === JSON.stringify(t);
580
590
  }
581
- ).map(([e]) => e), zn = Qe.length > 0 && Object.keys(fe).every((e) => Qe.includes(e)), Xn = Object.fromEntries(
591
+ ).map(([e]) => e), Xn = Qe.length > 0 && Object.keys(fe).every((e) => Qe.includes(e)), Zn = Object.fromEntries(
582
592
  Object.entries(fe).filter(([e]) => !Qe.includes(e))
583
- ), { data: Ra } = H({
584
- queryKey: ["queue-default-hidden", l, g, Xn],
585
- enabled: !!l && !!i && !Rt && i.total === 0 && ((jr = i.empty) == null ? void 0 : jr.reason) === "filters" && Qe.length > 0 && !zn,
593
+ ), { data: Ea } = H({
594
+ queryKey: ["queue-default-hidden", l, g, Zn],
595
+ enabled: !!l && !!i && !Rt && i.total === 0 && ((Br = i.empty) == null ? void 0 : Br.reason) === "filters" && Qe.length > 0 && !Xn,
586
596
  staleTime: 3e4,
587
597
  retry: !1,
588
598
  queryFn: () => p.request(
589
599
  O(`/queues/${l}/items`, {
590
600
  scope: g,
591
- filters: JSON.stringify(Xn),
601
+ filters: JSON.stringify(Zn),
592
602
  page: 1,
593
603
  limit: 1
594
604
  })
595
605
  ).then((e) => Number(e.total ?? 0))
596
- }), ie = zn ? Math.max(0, (((Br = i == null ? void 0 : i.stats) == null ? void 0 : Br.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : Ra ?? 0, Zn = (e) => Qe.map(e).join(" and "), er = () => {
606
+ }), ie = Xn ? Math.max(0, (((Ur = i == null ? void 0 : i.stats) == null ? void 0 : Ur.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : Ea ?? 0, er = (e) => Qe.map(e).join(" and "), tr = () => {
597
607
  P((e) => {
598
608
  const t = { ...e };
599
609
  for (const n of Qe) delete t[n];
@@ -614,11 +624,11 @@ function Ai({
614
624
  }, a = t.find((o) => o.queue === l);
615
625
  t.push(n), t.length > 50 && t.shift(), a && a !== n && le - Number(a.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: a, second: n });
616
626
  }, [le]);
617
- const je = Yn && !i || !ae || !Un && !i, tr = (Rt && !Yn || Ta && Rt) && !De.current, Aa = G(
627
+ const je = Yn && !i || !ae || !Un && !i, nr = (Rt && !Yn || Ra && Rt) && !De.current, La = G(
618
628
  () => ($e ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
619
629
  [$e, i == null ? void 0 : i.data]
620
- ), Oa = yo(Aa), nr = to(Rt && !De.current);
621
- async function rr(e, t) {
630
+ ), Da = wo(La), rr = ao(Rt && !De.current);
631
+ async function ar(e, t) {
622
632
  const a = (await p.request(O(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
623
633
  if (!a || a.states.length === 0)
624
634
  throw new Error("This item has no workflow instance");
@@ -634,9 +644,9 @@ function Ai({
634
644
  })
635
645
  );
636
646
  }
637
- const Ea = ve({
647
+ const Pa = ve({
638
648
  mutationFn: async ({ item: e, targetState: t }) => {
639
- await rr(e, t);
649
+ await ar(e, t);
640
650
  },
641
651
  onSuccess: () => {
642
652
  h.invalidateQueries({ queryKey: ["queue-items", l, g] });
@@ -670,8 +680,8 @@ function Ai({
670
680
  B(() => {
671
681
  Ue && un(Ue.data.default_view_id);
672
682
  }, [Ue]);
673
- const [La, ar] = k({}), ce = $e ? (i == null ? void 0 : i.groups) ?? null : null, Ot = (ce ?? []).filter((e) => !he.has(e.key)).map((e) => e.key).flatMap(
674
- (e) => Array.from({ length: La[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
683
+ const [Ka, lr] = k({}), ce = $e ? (i == null ? void 0 : i.groups) ?? null : null, Ot = (ce ?? []).filter((e) => !he.has(e.key)).map((e) => e.key).flatMap(
684
+ (e) => Array.from({ length: Ka[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
675
685
  ), mn = Je({
676
686
  queries: Ot.map(({ key: e, page: t }) => ({
677
687
  queryKey: [
@@ -693,23 +703,23 @@ function Ai({
693
703
  group_by: N,
694
704
  group_key: e,
695
705
  page: t,
696
- limit: bs
706
+ limit: gs
697
707
  })
698
708
  ).then((n) => ({ key: e, rows: n.data })),
699
709
  enabled: !!i && $e,
700
710
  placeholderData: (n) => n
701
711
  }))
702
- }), Da = mn.map((e) => e.dataUpdatedAt).join(","), bn = G(() => {
712
+ }), Ma = mn.map((e) => e.dataUpdatedAt).join(","), bn = G(() => {
703
713
  const e = /* @__PURE__ */ new Map();
704
714
  return mn.forEach((t, n) => {
705
715
  if (!t.data) return;
706
716
  const a = Ot[n].key;
707
717
  e.set(a, [...e.get(a) ?? [], ...t.data.rows]);
708
718
  }), e;
709
- }, [Da, Ot.map((e) => `${e.key}\0${e.page}`).join("")]), Pa = new Set(
719
+ }, [Ma, Ot.map((e) => `${e.key}\0${e.page}`).join("")]), Qa = new Set(
710
720
  mn.flatMap((e, t) => e.isFetching ? [Ot[t].key] : [])
711
721
  ), S = ce ? [...bn.values()].flat() : (i == null ? void 0 : i.data) ?? [];
712
- Oo(
722
+ Do(
713
723
  l ? {
714
724
  queue: {
715
725
  id: l,
@@ -720,7 +730,7 @@ function Ai({
720
730
  }
721
731
  } : null
722
732
  );
723
- const Ka = Eo(), at = S.some((e) => e.fulfilment !== void 0), lt = S.some((e) => e.send_backs !== void 0), { data: Et, dataUpdatedAt: Ma } = H({
733
+ const ja = Po(), at = S.some((e) => e.fulfilment !== void 0), lt = S.some((e) => e.send_backs !== void 0), { data: Et, dataUpdatedAt: Ba } = H({
724
734
  queryKey: ["queue-live-stats", l, g, Ke, Pn],
725
735
  queryFn: () => p.request(
726
736
  O(`/queues/${l}/items`, {
@@ -734,16 +744,16 @@ function Ai({
734
744
  staleTime: Number.POSITIVE_INFINITY,
735
745
  placeholderData: (e) => e,
736
746
  retry: !1
737
- }), pn = !!Et && Ma > le, x = pn ? Et.stats : i == null ? void 0 : i.stats, Y = pn ? Et.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, lr = pn ? Et.state_counts : i == null ? void 0 : i.state_counts;
747
+ }), pn = !!Et && Ba > le, x = pn ? Et.stats : i == null ? void 0 : i.stats, Y = pn ? Et.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, or = pn ? Et.state_counts : i == null ? void 0 : i.state_counts;
738
748
  Dn.current = new Set(S.map((e) => `${e.collection}:${e.item_id}`));
739
- const Lt = po(
749
+ const Lt = go(
740
750
  S.map((e) => ({ collection: e.collection, id: e.item_id })),
741
- ba
742
- ), or = j(le), sr = j(0);
743
- !De.current && le !== sr.current && (or.current = le), B(() => {
751
+ pa
752
+ ), sr = j(le), ir = j(0);
753
+ !De.current && le !== ir.current && (sr.current = le), B(() => {
744
754
  const e = new Set(S.map((t) => `${t.collection}:${t.item_id}`));
745
755
  if (De.current) {
746
- De.current = !1, sr.current = le;
756
+ De.current = !1, ir.current = le;
747
757
  const t = $t.current;
748
758
  $t.current = [];
749
759
  const n = Kn.current, a = /* @__PURE__ */ new Set();
@@ -758,7 +768,7 @@ function Ai({
758
768
  }, [le]), B(() => {
759
769
  Ct(0);
760
770
  }, [i]);
761
- function Qa() {
771
+ function Ua() {
762
772
  h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] }), Ct(0);
763
773
  }
764
774
  const { data: de } = H({
@@ -792,7 +802,7 @@ function Ai({
792
802
  )
793
803
  ],
794
804
  [s == null ? void 0 : s.sources]
795
- ), { data: ja } = H({
805
+ ), { data: Ia } = H({
796
806
  queryKey: ["collections"],
797
807
  queryFn: () => p.request(O("/collections")).then((e) => e.data),
798
808
  staleTime: 300 * 1e3
@@ -821,8 +831,8 @@ function Ai({
821
831
  a.length < 500 && a.push(n.item_id);
822
832
  }
823
833
  return e;
824
- }, [S, hn, ge]), ir = Object.keys(fn), cr = Je({
825
- queries: ir.map((e) => ({
834
+ }, [S, hn, ge]), cr = Object.keys(fn), dr = Je({
835
+ queries: cr.map((e) => ({
826
836
  queryKey: ["queue-integrations-summary", e, fn[e].join(",")],
827
837
  queryFn: () => p.request(
828
838
  ne("/integration-obligations/summary", {
@@ -832,14 +842,14 @@ function Ai({
832
842
  ).then((t) => t.data ?? {}).catch(() => ({})),
833
843
  staleTime: 3e4
834
844
  }))
835
- }), Ba = cr.map((e) => e.dataUpdatedAt).join(","), Ua = G(() => {
845
+ }), Va = dr.map((e) => e.dataUpdatedAt).join(","), Ga = G(() => {
836
846
  const e = {};
837
- return ir.forEach((t, n) => {
847
+ return cr.forEach((t, n) => {
838
848
  var o;
839
- const a = ((o = cr[n]) == null ? void 0 : o.data) ?? {};
849
+ const a = ((o = dr[n]) == null ? void 0 : o.data) ?? {};
840
850
  for (const [c, b] of Object.entries(a)) e[`${t}:${c}`] = b;
841
851
  }), e;
842
- }, [Ba]), gn = G(() => {
852
+ }, [Va]), gn = G(() => {
843
853
  var t;
844
854
  const e = {};
845
855
  for (const n of S) {
@@ -849,7 +859,7 @@ function Ai({
849
859
  a.length < 500 && a.push(n.item_id);
850
860
  }
851
861
  return e;
852
- }, [S]), xn = Object.keys(gn), dr = Je({
862
+ }, [S]), xn = Object.keys(gn), ur = Je({
853
863
  queries: xn.map((e) => ({
854
864
  queryKey: ["queue-task-counts", e, gn[e].join(",")],
855
865
  queryFn: () => p.request(
@@ -857,13 +867,13 @@ function Ai({
857
867
  ).then((t) => t.data ?? {}).catch(() => ({})),
858
868
  staleTime: 3e4
859
869
  }))
860
- }), Ia = dr.map((e) => e.dataUpdatedAt).join(","), Va = G(() => {
870
+ }), Wa = ur.map((e) => e.dataUpdatedAt).join(","), Ha = G(() => {
861
871
  const e = {};
862
872
  return xn.forEach((t, n) => {
863
873
  var a;
864
- for (const [o, c] of Object.entries(((a = dr[n]) == null ? void 0 : a.data) ?? {})) e[`${t}:${o}`] = c;
874
+ for (const [o, c] of Object.entries(((a = ur[n]) == null ? void 0 : a.data) ?? {})) e[`${t}:${o}`] = c;
865
875
  }), e;
866
- }, [Ia]), ur = xn.length > 0, mr = Je({
876
+ }, [Wa]), mr = xn.length > 0, br = Je({
867
877
  queries: st.map((e) => ({
868
878
  queryKey: ["queue-collection-risk-rules", e],
869
879
  queryFn: () => p.request(
@@ -871,9 +881,9 @@ function Ai({
871
881
  ).then((t) => t.data ?? []).catch(() => []),
872
882
  staleTime: 300 * 1e3
873
883
  }))
874
- }), Ga = mr.map((e) => e.dataUpdatedAt).join(","), br = G(() => {
884
+ }), Ja = br.map((e) => e.dataUpdatedAt).join(","), pr = G(() => {
875
885
  const e = /* @__PURE__ */ new Map();
876
- for (const t of mr)
886
+ for (const t of br)
877
887
  for (const n of t.data ?? []) {
878
888
  const a = e.get(n.name);
879
889
  e.set(n.name, {
@@ -882,7 +892,7 @@ function Ai({
882
892
  });
883
893
  }
884
894
  return [...e.values()];
885
- }, [Ga]), pr = Je({
895
+ }, [Ja]), hr = Je({
886
896
  queries: st.map((e) => ({
887
897
  queryKey: ["queue-collection-states", e],
888
898
  queryFn: () => p.request(
@@ -890,19 +900,19 @@ function Ai({
890
900
  ).then((t) => t.data),
891
901
  staleTime: 300 * 1e3
892
902
  }))
893
- }), hr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), xe = G(() => {
903
+ }), fr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), xe = G(() => {
894
904
  const e = {};
895
- for (const t of pr)
905
+ for (const t of hr)
896
906
  (t.data ?? []).forEach((n, a) => {
897
907
  e[n.key] = { label: n.label, color: n.color, sort: a };
898
908
  });
899
909
  return e;
900
- }, [pr.map((e) => e.data)]), fr = x ? Object.entries(x.by_state).sort(
910
+ }, [hr.map((e) => e.data)]), gr = x ? Object.entries(x.by_state).sort(
901
911
  (e, t) => {
902
912
  var n, a;
903
913
  return (((n = xe[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((a = xe[t[0]]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER);
904
914
  }
905
- ) : [], gr = (e) => [...e].sort(
915
+ ) : [], xr = (e) => [...e].sort(
906
916
  (t, n) => {
907
917
  var a, o;
908
918
  return (((a = xe[t]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = xe[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
@@ -911,10 +921,10 @@ function Ai({
911
921
  const e = {};
912
922
  for (const [t, n] of Object.entries(xe)) e[t] = n.label;
913
923
  return e;
914
- }, [xe]), Fe = (e) => e ? e === "none" ? "No State" : yn[e] ?? hr(e) : "—", it = (e) => {
924
+ }, [xe]), Fe = (e) => e ? e === "none" ? "No State" : yn[e] ?? fr(e) : "—", it = (e) => {
915
925
  if (e === Wt) return "Addendums";
916
- const t = (ja ?? []).find((n) => n.collection === e);
917
- return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || hr(e);
926
+ const t = (Ia ?? []).find((n) => n.collection === e);
927
+ return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || fr(e);
918
928
  }, Z = G(() => N ? ce ? ce.map((e) => ({
919
929
  key: e.key,
920
930
  rows: bn.get(e.key) ?? [],
@@ -922,7 +932,7 @@ function Ai({
922
932
  atRisk: e.at_risk,
923
933
  count: e.count,
924
934
  sums: e.sums ?? {}
925
- })) : vo(S, N).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [S, N, ce, bn]), kn = j(null);
935
+ })) : No(S, N).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [S, N, ce, bn]), kn = j(null);
926
936
  B(() => {
927
937
  if (!N || !Z) {
928
938
  kn.current = null;
@@ -931,15 +941,15 @@ function Ai({
931
941
  if ($e && !ce || kn.current === N) return;
932
942
  kn.current = N;
933
943
  const e = Z.reduce((t, n) => t + n.count, 0);
934
- Ht(e > 200 ? new Set(Z.map((t) => t.key)) : /* @__PURE__ */ new Set()), ar({});
944
+ Ht(e > 200 ? new Set(Z.map((t) => t.key)) : /* @__PURE__ */ new Set()), lr({});
935
945
  }, [N, ce]);
936
- function Wa(e) {
946
+ function Ya(e) {
937
947
  Ht((t) => {
938
948
  const n = new Set(t);
939
949
  return n.has(e) ? n.delete(e) : n.add(e), n;
940
950
  });
941
951
  }
942
- const ee = G(() => Z ? Z.filter((e) => !he.has(e.key)).flatMap((e) => e.rows) : S, [Z, S, he]), D = (e) => `${e.collection}:${e.item_id}`, [ye, Te] = k(null), [Ha, vn] = k(!1), [Dt, Pt] = k(null), wn = (e) => {
952
+ const ee = G(() => Z ? Z.filter((e) => !he.has(e.key)).flatMap((e) => e.rows) : S, [Z, S, he]), D = (e) => `${e.collection}:${e.item_id}`, [ye, Te] = k(null), [za, vn] = k(!1), [Dt, Pt] = k(null), wn = (e) => {
943
953
  if (e.collection === Wt && e.url) {
944
954
  const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
945
955
  if (t) {
@@ -960,7 +970,7 @@ function Ai({
960
970
  };
961
971
  }, ct = (e) => {
962
972
  var t;
963
- s && ia({
973
+ s && ca({
964
974
  queue_id: l,
965
975
  name: s.name,
966
976
  path: `${window.location.pathname}${window.location.search}`,
@@ -986,7 +996,7 @@ function Ai({
986
996
  return;
987
997
  }
988
998
  if (t === "layout") {
989
- Rr({
999
+ Ar({
990
1000
  collection: e.collection,
991
1001
  itemId: e.item_id,
992
1002
  rootLayoutSlug: (u == null ? void 0 : u.item_layout) ?? null,
@@ -1002,9 +1012,9 @@ function Ai({
1002
1012
  const e = S.find((t) => D(t) === D(ye));
1003
1013
  e && e !== ye && Te(e);
1004
1014
  }, [S]);
1005
- const Ja = (e) => !e.claimed_by || e.claimed_by.id === v;
1006
- function xr(e) {
1007
- const t = e ? ee.findIndex((a) => D(a) === D(e)) + 1 : 0, n = ee.slice(t).find(Ja);
1015
+ const Xa = (e) => !e.claimed_by || e.claimed_by.id === v;
1016
+ function yr(e) {
1017
+ const t = e ? ee.findIndex((a) => D(a) === D(e)) + 1 : 0, n = ee.slice(t).find(Xa);
1008
1018
  if (!n) {
1009
1019
  vn(!1), Te(null), R.info("Nothing left to work on — queue clear!");
1010
1020
  return;
@@ -1045,12 +1055,12 @@ function Ai({
1045
1055
  queryKey: ["queue-views", l],
1046
1056
  queryFn: () => p.request(O(`/queues/${l}/views`)),
1047
1057
  enabled: !!l
1048
- }), [ut, mt] = k(null), [Ya, _n] = k(!1), [Nn, yr] = k(""), [kr, vr] = k(!1), [bt, wr] = k(!1);
1058
+ }), [ut, mt] = k(null), [Za, _n] = k(!1), [Nn, kr] = k(""), [vr, wr] = k(!1), [bt, _r] = k(!1);
1049
1059
  function Mt(e) {
1050
1060
  const t = e.state ?? {};
1051
1061
  J(t.scope ?? "all"), P({ ...oe.current, ...t.filters ?? {} }), Le(t.sort ?? ""), et(t.group_by ?? null), At(t.columns ?? null), Yt(t.pins ?? null), t.view && Ee(Ce.includes(t.view) ? t.view : Ce[0]), E(1), mt(e.id);
1052
1062
  }
1053
- function za() {
1063
+ function el() {
1054
1064
  var t, n;
1055
1065
  const e = V == null ? void 0 : V.data.find((a) => a.is_default);
1056
1066
  if (e) {
@@ -1062,14 +1072,14 @@ function Ai({
1062
1072
  B(() => {
1063
1073
  if (ae || !(s != null && s.display_config) || Ue === void 0 || V === void 0) return;
1064
1074
  const e = Ue.data.default_view_id, t = e != null ? V.data.find((a) => a.id === e) : void 0, n = V.data.find((a) => a.is_default);
1065
- t ? Mt(t) : n ? Mt(n) : (Ee(s.display_config.default_view), J(s.display_config.default_scope)), xa(!0);
1075
+ t ? Mt(t) : n ? Mt(n) : (Ee(s.display_config.default_view), J(s.display_config.default_scope)), ya(!0);
1066
1076
  }, [s, Ue, V, ae]);
1067
1077
  const Qt = j(null), jt = j(null);
1068
1078
  B(() => {
1069
1079
  if (!ae) return;
1070
- const e = Ho();
1080
+ const e = zo();
1071
1081
  if (!(e != null && e.restore) || e.queue_id !== l) return;
1072
- ia({ ...e, restore: !1 });
1082
+ ca({ ...e, restore: !1 });
1073
1083
  const t = e.state ?? {};
1074
1084
  t.scope && J(t.scope), t.filters && P({ ...oe.current, ...t.filters }), t.sort != null && Le(t.sort), et(t.group_by ?? null), t.view && Ee(t.view), t.page && E(t.page), jt.current = e.scroll ?? 0;
1075
1085
  }, [ae, l]), B(() => {
@@ -1086,17 +1096,17 @@ function Ai({
1086
1096
  }, [ae]), B(() => {
1087
1097
  jt.current == null || S.length === 0 || !Qt.current || (Qt.current.scrollTop = jt.current, jt.current = null);
1088
1098
  }, [S]);
1089
- const { isAdmin: Bt } = la(), _r = Bt || (s == null ? void 0 : s.owner) != null && s.owner === v, Xa = ve({
1090
- mutationFn: ({ viewId: e, on: t }) => p.request(oa(`/queues/views/${e}`, { is_default: t })),
1099
+ const { isAdmin: Bt } = oa(), Nr = Bt || (s == null ? void 0 : s.owner) != null && s.owner === v, tl = ve({
1100
+ mutationFn: ({ viewId: e, on: t }) => p.request(sa(`/queues/views/${e}`, { is_default: t })),
1091
1101
  onSuccess: () => {
1092
1102
  h.invalidateQueries({ queryKey: ["queue-views", l] }), R.success("Queue default view updated");
1093
1103
  },
1094
1104
  onError: () => R.error("Could not update the queue default view")
1095
- }), Nr = ve({
1105
+ }), Sr = ve({
1096
1106
  mutationFn: () => p.request(
1097
1107
  ne(`/queues/${l}/views`, {
1098
1108
  name: Nn.trim(),
1099
- is_shared: kr || bt,
1109
+ is_shared: vr || bt,
1100
1110
  is_default: bt,
1101
1111
  state: {
1102
1112
  scope: g,
@@ -1110,12 +1120,12 @@ function Ai({
1110
1120
  })
1111
1121
  ),
1112
1122
  onSuccess: (e) => {
1113
- _n(!1), yr(""), vr(!1), wr(!1), mt(e.data.id), h.invalidateQueries({ queryKey: ["queue-views", l] }), R.success("View saved");
1123
+ _n(!1), kr(""), wr(!1), _r(!1), mt(e.data.id), h.invalidateQueries({ queryKey: ["queue-views", l] }), R.success("View saved");
1114
1124
  },
1115
1125
  onError: () => R.error("Failed to save view")
1116
- }), [Sr, Cr] = k(null), Re = ve({
1126
+ }), [Cr, $r] = k(null), Re = ve({
1117
1127
  mutationFn: (e) => p.request(
1118
- oa(`/queues/views/${e.id}`, {
1128
+ sa(`/queues/views/${e.id}`, {
1119
1129
  state: {
1120
1130
  scope: g,
1121
1131
  filters: w,
@@ -1128,17 +1138,17 @@ function Ai({
1128
1138
  })
1129
1139
  ),
1130
1140
  onSuccess: (e, t) => {
1131
- h.invalidateQueries({ queryKey: ["queue-views", l] }), Cr(t.id), setTimeout(() => Cr((n) => n === t.id ? null : n), 2e3), R.success(`Saved "${t.name}" with the current filters, scope and sort`);
1141
+ h.invalidateQueries({ queryKey: ["queue-views", l] }), $r(t.id), setTimeout(() => $r((n) => n === t.id ? null : n), 2e3), R.success(`Saved "${t.name}" with the current filters, scope and sort`);
1132
1142
  },
1133
1143
  onError: () => R.error("Failed to update view")
1134
- }), Za = ve({
1144
+ }), nl = ve({
1135
1145
  mutationFn: (e) => p.request(Tn(`/queues/views/${e}`)),
1136
1146
  onSuccess: (e, t) => {
1137
1147
  h.invalidateQueries({ queryKey: ["queue-views", l] }), mt(null), Ie === t && un(null);
1138
1148
  },
1139
1149
  onError: () => R.error("Failed to delete view")
1140
- }), el = ve({
1141
- mutationFn: (e) => p.request(ro(`/queues/${l}/default-view`, { view_id: e })),
1150
+ }), rl = ve({
1151
+ mutationFn: (e) => p.request(oo(`/queues/${l}/default-view`, { view_id: e })),
1142
1152
  onMutate: (e) => un(e),
1143
1153
  onSuccess: (e, t) => {
1144
1154
  h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), R.success(
@@ -1149,13 +1159,13 @@ function Ai({
1149
1159
  h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), R.error("Failed to update default view");
1150
1160
  }
1151
1161
  }), [Ae, Ut] = k([]);
1152
- no(), Qn.current = Ae.length;
1153
- const [$r, qr] = k(!1);
1162
+ lo(), Qn.current = Ae.length;
1163
+ const [qr, Fr] = k(!1);
1154
1164
  async function Sn(e, t) {
1155
1165
  const n = S.filter((b) => Ae.includes(D(b)));
1156
- qr(!0);
1166
+ Fr(!0);
1157
1167
  const a = await Promise.allSettled(n.map(t)), o = a.filter((b) => b.status === "fulfilled").length, c = a.length - o;
1158
- qr(!1), Ut([]), h.invalidateQueries({ queryKey: ["queue-items", l] }), c ? R.warning(`${e}: ${o} succeeded, ${c} failed`) : R.success(`${e}: ${o} succeeded`);
1168
+ Fr(!1), Ut([]), h.invalidateQueries({ queryKey: ["queue-items", l] }), c ? R.warning(`${e}: ${o} succeeded, ${c} failed`) : R.success(`${e}: ${o} succeeded`);
1159
1169
  }
1160
1170
  const Ge = (e) => {
1161
1171
  var t;
@@ -1164,7 +1174,7 @@ function Ai({
1164
1174
  if (a) return a;
1165
1175
  }
1166
1176
  return null;
1167
- }, tl = (e) => {
1177
+ }, al = (e) => {
1168
1178
  if (N === "state") return e === "No state" ? e : Fe(e);
1169
1179
  if (N === "collection") return it(e);
1170
1180
  if (N != null && N.startsWith("extra.") && e !== "—") {
@@ -1172,11 +1182,11 @@ function Ai({
1172
1182
  if (t) return Ye(e, t);
1173
1183
  }
1174
1184
  return e;
1175
- }, nl = Z == null ? void 0 : Z.map((e) => ({
1185
+ }, ll = Z == null ? void 0 : Z.map((e) => ({
1176
1186
  key: e.key,
1177
1187
  rows: e.rows,
1178
1188
  header: /* @__PURE__ */ d(we, { children: [
1179
- /* @__PURE__ */ r("span", { children: tl(e.key) }),
1189
+ /* @__PURE__ */ r("span", { children: al(e.key) }),
1180
1190
  /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
1181
1191
  "(",
1182
1192
  re(e.count),
@@ -1199,14 +1209,14 @@ function Ai({
1199
1209
  t
1200
1210
  );
1201
1211
  }),
1202
- ce && !he.has(e.key) && Pa.has(e.key) && /* @__PURE__ */ r("span", { className: "font-normal text-slate-400", children: "loading…" }),
1212
+ ce && !he.has(e.key) && Qa.has(e.key) && /* @__PURE__ */ r("span", { className: "font-normal text-slate-400", children: "loading…" }),
1203
1213
  ce && !he.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
1204
1214
  "button",
1205
1215
  {
1206
1216
  type: "button",
1207
1217
  "data-queue-group-more": e.key,
1208
1218
  onClick: (t) => {
1209
- t.stopPropagation(), ar((n) => ({ ...n, [e.key]: (n[e.key] ?? 1) + 1 }));
1219
+ t.stopPropagation(), lr((n) => ({ ...n, [e.key]: (n[e.key] ?? 1) + 1 }));
1210
1220
  },
1211
1221
  className: "rounded px-1.5 py-0.5 text-[11px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 dark:text-nvr-cyan",
1212
1222
  children: [
@@ -1227,13 +1237,13 @@ function Ai({
1227
1237
  " at risk"
1228
1238
  ] })
1229
1239
  ] })
1230
- })), Cn = (((Ur = i == null ? void 0 : i.available_values.collection) == null ? void 0 : Ur.length) ?? 0) > 1, Fr = S.some((e) => !!e.unseen) || Lt.size > 0 || S.some((e) => Ne.isNew(D(e))), Tr = [
1240
+ })), Cn = (((Ir = i == null ? void 0 : i.available_values.collection) == null ? void 0 : Ir.length) ?? 0) > 1, Tr = S.some((e) => !!e.unseen) || Lt.size > 0 || S.some((e) => Ne.isNew(D(e))), Rr = [
1231
1241
  ...Cn ? [
1232
1242
  {
1233
1243
  key: "collection",
1234
1244
  header: q("collection", "Collection"),
1235
1245
  sortable: !0,
1236
- render: (e) => /* @__PURE__ */ r(ts, { variant: "outline", children: it(e.collection) })
1246
+ render: (e) => /* @__PURE__ */ r(as, { variant: "outline", children: it(e.collection) })
1237
1247
  }
1238
1248
  ] : [],
1239
1249
  {
@@ -1241,22 +1251,22 @@ function Ai({
1241
1251
  header: q("label", "Item"),
1242
1252
  sortable: !0,
1243
1253
  // Room in the left padding for the hanging unseen mark (#643).
1244
- className: Fr ? "pl-[30px]" : void 0,
1245
- headerClassName: Fr ? "pl-[30px]" : void 0,
1254
+ className: Tr ? "pl-[30px]" : void 0,
1255
+ headerClassName: Tr ? "pl-[30px]" : void 0,
1246
1256
  render: (e) => (
1247
1257
  // Underlined because clicking opens the item. The row is clickable as
1248
1258
  // a whole, but nothing on it said so — an underline is the one
1249
1259
  // convention people already read as "this goes somewhere".
1250
1260
  /* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
1251
1261
  Lt.get(D(e)) || Ne.isNew(D(e)) ? /* @__PURE__ */ r(
1252
- Jo,
1262
+ Xo,
1253
1263
  {
1254
1264
  lock: Lt.get(D(e)),
1255
1265
  isNew: Ne.isNew(D(e)),
1256
1266
  dataAttr: "data-queue-live-mark",
1257
1267
  hang: !0
1258
1268
  }
1259
- ) : /* @__PURE__ */ r(es, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1269
+ ) : /* @__PURE__ */ r(rs, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1260
1270
  /* @__PURE__ */ r(
1261
1271
  "span",
1262
1272
  {
@@ -1275,9 +1285,9 @@ function Ai({
1275
1285
  t
1276
1286
  )),
1277
1287
  /* @__PURE__ */ r(
1278
- Zo,
1288
+ ns,
1279
1289
  {
1280
- viewers: Oa[ko(e.collection, e.item_id)],
1290
+ viewers: Da[_o(e.collection, e.item_id)],
1281
1291
  dataAttr: "data-queue-presence"
1282
1292
  }
1283
1293
  )
@@ -1308,13 +1318,13 @@ function Ai({
1308
1318
  key: "owners",
1309
1319
  header: q("owners", "Owners"),
1310
1320
  sortable: !0,
1311
- render: (e) => /* @__PURE__ */ r(os, { owners: e.owners })
1321
+ render: (e) => /* @__PURE__ */ r(cs, { owners: e.owners })
1312
1322
  },
1313
1323
  {
1314
1324
  key: "aging_hours",
1315
1325
  header: q("aging_hours", "Aging"),
1316
1326
  sortable: !0,
1317
- render: (e) => fs(e.aging_hours)
1327
+ render: (e) => ks(e.aging_hours)
1318
1328
  },
1319
1329
  {
1320
1330
  // When the record entered its current state — the same moment Aging
@@ -1322,13 +1332,13 @@ function Ai({
1322
1332
  key: "state_entered",
1323
1333
  header: q("state_entered", "Last State Change"),
1324
1334
  sortable: !0,
1325
- render: (e) => e.state_entered_at ? so(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
1335
+ render: (e) => e.state_entered_at ? uo(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
1326
1336
  },
1327
1337
  {
1328
1338
  key: "sla_status",
1329
1339
  header: q("sla_status", "SLA"),
1330
1340
  sortable: !0,
1331
- render: (e) => /* @__PURE__ */ r(gs, { status: e.sla_status })
1341
+ render: (e) => /* @__PURE__ */ r(vs, { status: e.sla_status })
1332
1342
  },
1333
1343
  {
1334
1344
  key: "at_risk",
@@ -1336,7 +1346,7 @@ function Ai({
1336
1346
  sortable: !0,
1337
1347
  render: (e) => {
1338
1348
  var t;
1339
- return e.at_risk ? /* @__PURE__ */ d("span", { className: _o(e.at_risk_color ?? "red"), children: [
1349
+ return e.at_risk ? /* @__PURE__ */ d("span", { className: Co(e.at_risk_color ?? "red"), children: [
1340
1350
  "⚑ ",
1341
1351
  ((t = e.at_risk_rule) == null ? void 0 : t.name) ?? "At risk"
1342
1352
  ] }) : e.predicted_risk ? /* @__PURE__ */ r("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
@@ -1347,7 +1357,7 @@ function Ai({
1347
1357
  key: "addendums",
1348
1358
  header: q("addendums", "Addendums"),
1349
1359
  sortable: !1,
1350
- render: (e) => /* @__PURE__ */ r(hs, { summary: e.addendums })
1360
+ render: (e) => /* @__PURE__ */ r(ys, { summary: e.addendums })
1351
1361
  }
1352
1362
  ] : [],
1353
1363
  ...at ? [
@@ -1356,7 +1366,7 @@ function Ai({
1356
1366
  header: q("fulfilment", "Shipped"),
1357
1367
  sortable: !0,
1358
1368
  render: (e) => /* @__PURE__ */ r(
1359
- Bo,
1369
+ Vo,
1360
1370
  {
1361
1371
  collection: e.collection,
1362
1372
  itemId: e.item_id,
@@ -1370,16 +1380,16 @@ function Ai({
1370
1380
  key: "integrations",
1371
1381
  header: q("integrations", "Integrations"),
1372
1382
  sortable: !1,
1373
- render: (e) => /* @__PURE__ */ r(Vo, { rows: Ua[`${e.collection}:${e.item_id}`] })
1383
+ render: (e) => /* @__PURE__ */ r(Ho, { rows: Ga[`${e.collection}:${e.item_id}`] })
1374
1384
  }
1375
1385
  ] : [],
1376
- ...ur ? [
1386
+ ...mr ? [
1377
1387
  {
1378
1388
  key: "tasks",
1379
1389
  header: q("tasks", "Tasks"),
1380
1390
  sortable: !1,
1381
1391
  render: (e) => {
1382
- const t = Va[`${e.collection}:${e.item_id}`];
1392
+ const t = Ha[`${e.collection}:${e.item_id}`];
1383
1393
  return !t || t.open === 0 ? /* @__PURE__ */ r("span", { className: "text-[11px] text-slate-400", children: "—" }) : /* @__PURE__ */ d(
1384
1394
  "span",
1385
1395
  {
@@ -1399,10 +1409,10 @@ function Ai({
1399
1409
  key: "send_backs",
1400
1410
  header: q("send_backs", "Sent back"),
1401
1411
  sortable: !0,
1402
- render: (e) => /* @__PURE__ */ r(ms, { summary: e.send_backs })
1412
+ render: (e) => /* @__PURE__ */ r(fs, { summary: e.send_backs })
1403
1413
  }
1404
1414
  ] : []
1405
- ], rl = {
1415
+ ], ol = {
1406
1416
  key: "claim",
1407
1417
  header: "",
1408
1418
  render: (e) => e.claimed_by ? /* @__PURE__ */ r(
@@ -1426,7 +1436,7 @@ function Ai({
1426
1436
  children: "Claim"
1427
1437
  }
1428
1438
  )
1429
- }, pt = (s == null ? void 0 : s.available_extra_fields) ?? [], ht = Zl("drill.queue"), X = ht.value, Rr = (e) => ht.push([e]), al = (e) => {
1439
+ }, pt = (s == null ? void 0 : s.available_extra_fields) ?? [], ht = no("drill.queue"), X = ht.value, Ar = (e) => ht.push([e]), sl = (e) => {
1430
1440
  var t;
1431
1441
  for (const n of (s == null ? void 0 : s.sources) ?? []) {
1432
1442
  const a = (t = n.drilldown) == null ? void 0 : t[e];
@@ -1438,26 +1448,26 @@ function Ai({
1438
1448
  };
1439
1449
  }
1440
1450
  return { enabled: !0, layout_id: null, width: null };
1441
- }, ll = G(() => {
1451
+ }, il = G(() => {
1442
1452
  const e = {};
1443
1453
  for (const t of (s == null ? void 0 : s.sources) ?? [])
1444
1454
  for (const [n, a] of Object.entries(t.column_formats ?? {}))
1445
1455
  n in e || (e[n] = a);
1446
1456
  return e;
1447
- }, [s == null ? void 0 : s.sources]), ol = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, sl = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1448
- function il(e) {
1449
- if (ol.test(e)) return { text: e.split("@")[0], title: e };
1450
- if (sl.test(e)) {
1457
+ }, [s == null ? void 0 : s.sources]), cl = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, dl = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1458
+ function ul(e) {
1459
+ if (cl.test(e)) return { text: e.split("@")[0], title: e };
1460
+ if (dl.test(e)) {
1451
1461
  const t = new Date(e);
1452
1462
  if (!Number.isNaN(t.getTime()))
1453
1463
  return {
1454
- text: Ao(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1455
- title: Ro(t)
1464
+ text: Lo(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1465
+ title: Eo(t)
1456
1466
  };
1457
1467
  }
1458
1468
  return { text: e, title: e };
1459
1469
  }
1460
- const cl = pt.map((e) => ({
1470
+ const ml = pt.map((e) => ({
1461
1471
  key: `extra.${e}`,
1462
1472
  header: q(`extra.${e}`, wt(e)),
1463
1473
  sortable: !0,
@@ -1465,13 +1475,13 @@ function Ai({
1465
1475
  var y, T;
1466
1476
  const n = (y = t.extra) == null ? void 0 : y[e];
1467
1477
  if (n == null || n === "") return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
1468
- const a = Ge(e), o = a ? Ye(String(n), a) : String(n), { text: c, title: b } = il(o), m = ((s == null ? void 0 : s.extra_field_meta) ?? []).find((Q) => Q.path === e), M = ((T = t.extra_ids) == null ? void 0 : T[e]) ?? [], F = al(e);
1478
+ const a = Ge(e), o = a ? Ye(String(n), a) : String(n), { text: c, title: b } = ul(o), m = ((s == null ? void 0 : s.extra_field_meta) ?? []).find((Q) => Q.path === e), M = ((T = t.extra_ids) == null ? void 0 : T[e]) ?? [], F = sl(e);
1469
1479
  return (m == null ? void 0 : m.kind) === "relation" && m.target_collection && M.length > 0 && F.enabled && !m.aggregate ? /* @__PURE__ */ r(
1470
1480
  "button",
1471
1481
  {
1472
1482
  type: "button",
1473
1483
  onClick: (Q) => {
1474
- Q.stopPropagation(), Rr({
1484
+ Q.stopPropagation(), Ar({
1475
1485
  collection: m.target_collection,
1476
1486
  itemId: M[0],
1477
1487
  layoutId: F.layout_id,
@@ -1496,7 +1506,7 @@ function Ai({
1496
1506
  }
1497
1507
  ) : /* @__PURE__ */ r("span", { className: "block max-w-[200px] truncate text-[12px]", title: b, children: c });
1498
1508
  }
1499
- })), Ar = [
1509
+ })), Or = [
1500
1510
  ...Cn ? ["collection"] : [],
1501
1511
  "state",
1502
1512
  "owners",
@@ -1508,9 +1518,9 @@ function Ai({
1508
1518
  ...at ? ["fulfilment"] : [],
1509
1519
  ...ge ? ["integrations"] : [],
1510
1520
  ...lt ? ["send_backs"] : [],
1511
- ...ur ? ["tasks"] : [],
1521
+ ...mr ? ["tasks"] : [],
1512
1522
  ...pt.map((e) => `extra.${e}`)
1513
- ], dl = [
1523
+ ], bl = [
1514
1524
  ...Cn ? ["collection"] : [],
1515
1525
  "state",
1516
1526
  "owners",
@@ -1522,29 +1532,29 @@ function Ai({
1522
1532
  "sla_status",
1523
1533
  "at_risk",
1524
1534
  ...pt.slice(0, 2).map((e) => `extra.${e}`)
1525
- ], ul = (u == null ? void 0 : u.default_columns) ?? null, $n = dn ?? ul, te = new Set($n ?? dl);
1535
+ ], pl = (u == null ? void 0 : u.default_columns) ?? null, $n = dn ?? pl, te = new Set($n ?? bl);
1526
1536
  Ve && !Nt.has("addendums") && te.add("addendums"), at && !Nt.has("fulfilment") && te.add("fulfilment"), ge && !Nt.has("integrations") && te.add("integrations"), lt && !Nt.has("send_backs") && te.add("send_backs");
1527
- const ml = new Set(Bt ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1528
- for (const e of ml) te.delete(e);
1537
+ const hl = new Set(Bt ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1538
+ for (const e of hl) te.delete(e);
1529
1539
  const We = [
1530
- ...($n ?? []).filter((e) => Ar.includes(e)),
1531
- ...Ar.filter((e) => !($n ?? []).includes(e))
1532
- ], bl = wl(_l(Nl, { activationConstraint: { distance: 4 } }));
1533
- function pl(e) {
1540
+ ...($n ?? []).filter((e) => Or.includes(e)),
1541
+ ...Or.filter((e) => !($n ?? []).includes(e))
1542
+ ], fl = Sl(Cl($l, { activationConstraint: { distance: 4 } }));
1543
+ function gl(e) {
1534
1544
  const { active: t, over: n } = e;
1535
1545
  if (!n || t.id === n.id) return;
1536
1546
  const a = We.indexOf(String(t.id)), o = We.indexOf(String(n.id));
1537
1547
  a === -1 || o === -1 || At(
1538
- Fl(We, a, o).filter((c) => te.has(c))
1548
+ Al(We, a, o).filter((c) => te.has(c))
1539
1549
  );
1540
1550
  }
1541
- const Or = Tr.find((e) => e.key === "label"), hl = {
1542
- ...Or,
1551
+ const Er = Rr.find((e) => e.key === "label"), xl = {
1552
+ ...Er,
1543
1553
  render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
1544
- /* @__PURE__ */ r(Po, { rowId: e.item_id }),
1545
- Or.render(e, ...t)
1554
+ /* @__PURE__ */ r(Qo, { rowId: e.item_id }),
1555
+ Er.render(e, ...t)
1546
1556
  ] })
1547
- }, fl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
1557
+ }, yl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
1548
1558
  (e) => ({
1549
1559
  key: `formula.${e.key}`,
1550
1560
  header: e.label,
@@ -1552,7 +1562,7 @@ function Ai({
1552
1562
  const n = {
1553
1563
  ...t,
1554
1564
  ...t.extra ? Object.fromEntries(Object.entries(t.extra).map(([c, b]) => [`extra.${c}`, b])) : {}
1555
- }, a = ao(e.formula, (c) => {
1565
+ }, a = so(e.formula, (c) => {
1556
1566
  const b = n[c] ?? (t.extra ? t.extra[c] : void 0), m = Number(b);
1557
1567
  return Number.isFinite(m) ? m : b ?? null;
1558
1568
  });
@@ -1561,11 +1571,11 @@ function Ai({
1561
1571
  return Number.isFinite(o) ? /* @__PURE__ */ r("span", { className: "tabular-nums", children: e.format === "currency" ? o.toLocaleString(void 0, { style: "currency", currency: "USD" }) : o.toLocaleString() }) : /* @__PURE__ */ r("span", { children: String(a) });
1562
1572
  }
1563
1573
  })
1564
- ), Er = [...Tr, ...cl, ...fl], gl = {
1574
+ ), Lr = [...Rr, ...ml, ...yl], kl = {
1565
1575
  key: "__actions__",
1566
1576
  header: "",
1567
1577
  render: (e) => e.collection === "tasks" || e.collection === Wt ? null : /* @__PURE__ */ r("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ r(
1568
- Ko,
1578
+ jo,
1569
1579
  {
1570
1580
  collection: e.collection,
1571
1581
  id: e.item_id,
@@ -1583,15 +1593,15 @@ function Ai({
1583
1593
  }
1584
1594
  ) })
1585
1595
  }, It = [
1586
- hl,
1587
- ...We.filter((e) => te.has(e)).map((e) => Er.find((t) => t.key === e)).filter((e) => e !== void 0),
1588
- ...se ? [rl] : [],
1589
- gl
1590
- ], Lr = G(() => {
1596
+ xl,
1597
+ ...We.filter((e) => te.has(e)).map((e) => Lr.find((t) => t.key === e)).filter((e) => e !== void 0),
1598
+ ...se ? [ol] : [],
1599
+ kl
1600
+ ], Dr = G(() => {
1591
1601
  var a;
1592
1602
  const e = u == null ? void 0 : u.default_pins, t = St ?? (e && Object.keys(e).length > 0 ? e : { [((a = It[0]) == null ? void 0 : a.key) ?? "label"]: "left" }), n = new Set(It.map((o) => o.key));
1593
1603
  return Object.fromEntries(Object.entries(t).filter(([o]) => n.has(o)));
1594
- }, [St, u == null ? void 0 : u.default_pins, It.map((e) => e.key).join("|")]), Dr = [
1604
+ }, [St, u == null ? void 0 : u.default_pins, It.map((e) => e.key).join("|")]), Pr = [
1595
1605
  { value: "state", label: "State" },
1596
1606
  { value: "collection", label: "Collection" },
1597
1607
  { value: "sla_status", label: "SLA status" },
@@ -1599,7 +1609,7 @@ function Ai({
1599
1609
  { value: "owners", label: "Owner" },
1600
1610
  { value: "aging", label: "Aging" },
1601
1611
  ...pt.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: q(`extra.${e}`, wt(e)) }))
1602
- ], Pr = (e) => async (t) => {
1612
+ ], Kr = (e) => async (t) => {
1603
1613
  if (!e.target_collection || !e.display_field) return [];
1604
1614
  const n = {
1605
1615
  limit: 25,
@@ -1634,7 +1644,7 @@ function Ai({
1634
1644
  multi: !0,
1635
1645
  // Until the rows land, the pipeline's own states (no counts yet) rather
1636
1646
  // than an empty list.
1637
- options: gr(
1647
+ options: xr(
1638
1648
  i ? i.available_values.state ?? [] : Object.keys(xe)
1639
1649
  ).map((e) => {
1640
1650
  var t;
@@ -1643,7 +1653,7 @@ function Ai({
1643
1653
  value: e,
1644
1654
  // How many rows sit in it under the other active filters (the State
1645
1655
  // filter itself left out, or every other state would read 0).
1646
- count: lr ? lr[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
1656
+ count: or ? or[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
1647
1657
  };
1648
1658
  })
1649
1659
  },
@@ -1666,12 +1676,12 @@ function Ai({
1666
1676
  { label: "No", value: "no" }
1667
1677
  ]
1668
1678
  },
1669
- ...br.length > 0 ? [
1679
+ ...pr.length > 0 ? [
1670
1680
  {
1671
1681
  key: "at_risk_rule",
1672
1682
  placeholder: "Highlight rule",
1673
1683
  type: "select",
1674
- options: br
1684
+ options: pr
1675
1685
  }
1676
1686
  ] : [],
1677
1687
  {
@@ -1698,7 +1708,7 @@ function Ai({
1698
1708
  key: "integrations",
1699
1709
  placeholder: q("integrations", "Integrations"),
1700
1710
  type: "select",
1701
- options: Go.map((e) => ({ label: e.label, value: e.value }))
1711
+ options: Jo.map((e) => ({ label: e.label, value: e.value }))
1702
1712
  }
1703
1713
  ] : [],
1704
1714
  ...at ? [
@@ -1706,7 +1716,7 @@ function Ai({
1706
1716
  key: "fulfilment",
1707
1717
  placeholder: "Shipped",
1708
1718
  type: "select",
1709
- options: Uo
1719
+ options: Go
1710
1720
  }
1711
1721
  ] : [],
1712
1722
  ...lt ? [
@@ -1774,15 +1784,15 @@ function Ai({
1774
1784
  type: "combobox",
1775
1785
  multi: !0,
1776
1786
  restricted: !!((m = Se[e]) != null && m.length),
1777
- loadOptions: Pr(t)
1787
+ loadOptions: Kr(t)
1778
1788
  } : { ...a, placeholder: `Search ${n}…`, type: "text" };
1779
1789
  })
1780
1790
  ], Fn = He.filter(
1781
1791
  (e) => te.has(e.key) || e.key === "label" || e.key === "owners"
1782
- ), Kr = (e) => {
1792
+ ), Mr = (e) => {
1783
1793
  var t;
1784
1794
  return (((t = He.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
1785
- }, ft = new Set(Object.keys(oe.current)), xl = ((e) => {
1795
+ }, ft = new Set(Object.keys(oe.current)), vl = ((e) => {
1786
1796
  var n;
1787
1797
  if (e.some((a) => a.key === "state")) return e;
1788
1798
  const t = He.find((a) => a.key === "state");
@@ -1813,7 +1823,7 @@ function Ai({
1813
1823
  type: "combobox",
1814
1824
  multi: !0,
1815
1825
  restricted: !!((Oe = Se[b]) != null && Oe.length),
1816
- loadOptions: Pr(m)
1826
+ loadOptions: Kr(m)
1817
1827
  } : null;
1818
1828
  };
1819
1829
  if (Vn.length > 0) {
@@ -1844,7 +1854,7 @@ function Ai({
1844
1854
  ].slice(0, 6);
1845
1855
  return a.length > 0 ? a : Fn.filter((c) => c.key === "state" || c.key === "owners");
1846
1856
  })()
1847
- ), yl = (() => {
1857
+ ), wl = (() => {
1848
1858
  if (!x) return null;
1849
1859
  const e = Y ?? x, t = [
1850
1860
  {
@@ -1916,7 +1926,7 @@ function Ai({
1916
1926
  }
1917
1927
  );
1918
1928
  })();
1919
- function kl(e) {
1929
+ function _l(e) {
1920
1930
  const t = new Set(te);
1921
1931
  t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && Ln((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && Ln((n) => {
1922
1932
  const a = new Set(n);
@@ -1926,7 +1936,7 @@ function Ai({
1926
1936
  return qt ? ($ == null ? void 0 : $((qt == null ? void 0 : qt.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
1927
1937
  /* @__PURE__ */ d("div", { className: "shrink-0", children: [
1928
1938
  (i == null ? void 0 : i.truncated) && /* @__PURE__ */ d("div", { className: "mx-4 mt-3 flex items-center gap-2 rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-[12px] text-amber-800 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300", children: [
1929
- /* @__PURE__ */ r(Ol, { className: "h-4 w-4 shrink-0" }),
1939
+ /* @__PURE__ */ r(Dl, { className: "h-4 w-4 shrink-0" }),
1930
1940
  /* @__PURE__ */ r("span", { children: "This view hit the row safety limit — the table below may not include every matching item, but the totals above are exact. Narrow the filters (or clear the priority sort on a large queue) to browse everything." })
1931
1941
  ] }),
1932
1942
  /* @__PURE__ */ d(
@@ -1935,7 +1945,7 @@ function Ai({
1935
1945
  className: "flex flex-wrap items-center gap-2 border-b border-slate-200 bg-white px-4 py-2.5 dark:border-slate-700 dark:bg-slate-900",
1936
1946
  "data-queue-toolbar": !0,
1937
1947
  children: [
1938
- ae ? /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: ps.filter((e) => se || e.value !== "claimed").map(
1948
+ ae ? /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: xs.filter((e) => se || e.value !== "claimed").map(
1939
1949
  (e, t) => /* @__PURE__ */ r(
1940
1950
  "button",
1941
1951
  {
@@ -2004,13 +2014,13 @@ function Ai({
2004
2014
  }),
2005
2015
  className: `flex h-8 items-center gap-1.5 rounded-full border px-2.5 text-[12px] font-medium transition-colors ${w.addendums === "active" ? "border-amber-400 bg-amber-50 text-amber-800 dark:border-amber-500/60 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-300"}`,
2006
2016
  children: [
2007
- /* @__PURE__ */ r(El, { className: "h-3.5 w-3.5" }),
2017
+ /* @__PURE__ */ r(Pl, { className: "h-3.5 w-3.5" }),
2008
2018
  "Active addendums"
2009
2019
  ]
2010
2020
  }
2011
2021
  ),
2012
2022
  ge && /* @__PURE__ */ r(
2013
- Wo,
2023
+ Yo,
2014
2024
  {
2015
2025
  label: q("integrations", "Integrations"),
2016
2026
  value: w.integrations,
@@ -2020,16 +2030,16 @@ function Ai({
2020
2030
  })
2021
2031
  }
2022
2032
  ),
2023
- /* @__PURE__ */ r(Yo, { className: "h-8" }),
2024
- /* @__PURE__ */ r(jo, {}),
2033
+ /* @__PURE__ */ r(Zo, { className: "h-8" }),
2034
+ /* @__PURE__ */ r(Io, {}),
2025
2035
  zt > 0 && /* @__PURE__ */ d(
2026
2036
  "button",
2027
2037
  {
2028
2038
  type: "button",
2029
- onClick: Qa,
2039
+ onClick: Ua,
2030
2040
  className: "nvr-pop-in flex h-8 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-2.5 text-[12px] font-medium transition-colors text-nvr-navy hover:bg-nvr-cyan/20 dark:text-nvr-cyan",
2031
2041
  children: [
2032
- /* @__PURE__ */ r(Ll, { className: "h-3 w-3" }),
2042
+ /* @__PURE__ */ r(Kl, { className: "h-3 w-3" }),
2033
2043
  zt,
2034
2044
  " update",
2035
2045
  zt === 1 ? "" : "s",
@@ -2048,17 +2058,17 @@ function Ai({
2048
2058
  N ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2049
2059
  ),
2050
2060
  children: [
2051
- /* @__PURE__ */ r(na, { className: "h-3.5 w-3.5" }),
2052
- N ? `Group: ${((Ir = Dr.find((e) => e.value === N)) == null ? void 0 : Ir.label) ?? N}` : "Group"
2061
+ /* @__PURE__ */ r(ra, { className: "h-3.5 w-3.5" }),
2062
+ N ? `Group: ${((Vr = Pr.find((e) => e.value === N)) == null ? void 0 : Vr.label) ?? N}` : "Group"
2053
2063
  ]
2054
2064
  }
2055
2065
  ) }),
2056
- /* @__PURE__ */ r(Ze, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(ca, { children: [
2057
- /* @__PURE__ */ r(ns, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2058
- /* @__PURE__ */ d(da, { children: [
2059
- /* @__PURE__ */ r(rs, { children: "No attribute found." }),
2066
+ /* @__PURE__ */ r(Ze, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(da, { children: [
2067
+ /* @__PURE__ */ r(ls, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2068
+ /* @__PURE__ */ d(ua, { children: [
2069
+ /* @__PURE__ */ r(os, { children: "No attribute found." }),
2060
2070
  /* @__PURE__ */ r(kt, { value: "__none__", onSelect: () => et(null), children: "None" }),
2061
- Dr.map((e) => /* @__PURE__ */ r(
2071
+ Pr.map((e) => /* @__PURE__ */ r(
2062
2072
  kt,
2063
2073
  {
2064
2074
  value: e.label,
@@ -2082,7 +2092,7 @@ function Ai({
2082
2092
  I === "-priority" ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2083
2093
  ),
2084
2094
  children: [
2085
- /* @__PURE__ */ r(Dl, { className: "h-3.5 w-3.5" }),
2095
+ /* @__PURE__ */ r(Ml, { className: "h-3.5 w-3.5" }),
2086
2096
  "Priority"
2087
2097
  ]
2088
2098
  }
@@ -2108,12 +2118,12 @@ function Ai({
2108
2118
  tt ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
2109
2119
  ),
2110
2120
  children: [
2111
- /* @__PURE__ */ r(na, { className: "h-3.5 w-3.5" }),
2121
+ /* @__PURE__ */ r(ra, { className: "h-3.5 w-3.5" }),
2112
2122
  tt ? `Lanes: ${tt === "collection" ? "Collection" : "Owner"}` : "Lanes"
2113
2123
  ]
2114
2124
  }
2115
2125
  ) }),
2116
- /* @__PURE__ */ r(Ze, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ r(ca, { children: /* @__PURE__ */ d(da, { children: [
2126
+ /* @__PURE__ */ r(Ze, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ r(da, { children: /* @__PURE__ */ d(ua, { children: [
2117
2127
  /* @__PURE__ */ r(kt, { value: "none", onSelect: () => Jt(null), children: "None" }),
2118
2128
  /* @__PURE__ */ r(kt, { value: "collection", onSelect: () => Jt("collection"), children: "Collection" }),
2119
2129
  /* @__PURE__ */ r(kt, { value: "owner", onSelect: () => Jt("owners"), children: "Owner" })
@@ -2128,7 +2138,7 @@ function Ai({
2128
2138
  className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
2129
2139
  "data-queue-ask": !0,
2130
2140
  children: [
2131
- /* @__PURE__ */ r(Pl, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
2141
+ /* @__PURE__ */ r(Ql, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
2132
2142
  "Ask about this queue"
2133
2143
  ]
2134
2144
  }
@@ -2137,7 +2147,7 @@ function Ai({
2137
2147
  "button",
2138
2148
  {
2139
2149
  type: "button",
2140
- onClick: () => Na((e) => !e),
2150
+ onClick: () => Sa((e) => !e),
2141
2151
  "aria-expanded": rt,
2142
2152
  title: "Trends, aging, pace and states",
2143
2153
  className: C(
@@ -2146,7 +2156,7 @@ function Ai({
2146
2156
  ),
2147
2157
  "data-queue-insights-toggle": !0,
2148
2158
  children: [
2149
- /* @__PURE__ */ r(Kl, { className: "h-3.5 w-3.5" }),
2159
+ /* @__PURE__ */ r(jl, { className: "h-3.5 w-3.5" }),
2150
2160
  "Insights"
2151
2161
  ]
2152
2162
  }
@@ -2158,31 +2168,31 @@ function Ai({
2158
2168
  type: "button",
2159
2169
  className: "flex h-8 items-center gap-1 rounded-md border border-slate-200 px-2.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
2160
2170
  children: [
2161
- /* @__PURE__ */ r(Ml, { className: "h-3.5 w-3.5" }),
2171
+ /* @__PURE__ */ r(Bl, { className: "h-3.5 w-3.5" }),
2162
2172
  "Columns"
2163
2173
  ]
2164
2174
  }
2165
2175
  ) }),
2166
2176
  /* @__PURE__ */ r(Ze, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ r(
2167
- Sl,
2177
+ ql,
2168
2178
  {
2169
- sensors: bl,
2170
- collisionDetection: Cl,
2171
- onDragEnd: pl,
2179
+ sensors: fl,
2180
+ collisionDetection: Fl,
2181
+ onDragEnd: gl,
2172
2182
  children: /* @__PURE__ */ r(
2173
- $l,
2183
+ Tl,
2174
2184
  {
2175
2185
  items: We,
2176
- strategy: ql,
2186
+ strategy: Rl,
2177
2187
  children: /* @__PURE__ */ r("div", { className: "space-y-1.5", children: We.map((e) => {
2178
- const t = Er.find((n) => n.key === e);
2188
+ const t = Lr.find((n) => n.key === e);
2179
2189
  return /* @__PURE__ */ r(
2180
- ks,
2190
+ Ns,
2181
2191
  {
2182
2192
  id: e,
2183
2193
  label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
2184
2194
  checked: te.has(e),
2185
- onCheckedChange: () => kl(e)
2195
+ onCheckedChange: () => _l(e)
2186
2196
  },
2187
2197
  e
2188
2198
  );
@@ -2198,7 +2208,7 @@ function Ai({
2198
2208
  type: "button",
2199
2209
  onClick: () => {
2200
2210
  const e = _t === "compact" ? "comfortable" : "compact";
2201
- ma(e);
2211
+ ba(e);
2202
2212
  try {
2203
2213
  localStorage.setItem("nvr_table_density", e);
2204
2214
  } catch {
@@ -2207,17 +2217,17 @@ function Ai({
2207
2217
  "aria-label": "Row density",
2208
2218
  title: _t === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
2209
2219
  className: "flex h-8 w-8 items-center justify-center rounded-md border border-slate-200 bg-white text-slate-500 shadow-sm hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted",
2210
- children: _t === "compact" ? /* @__PURE__ */ r(Ql, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(jl, { className: "h-3.5 w-3.5" })
2220
+ children: _t === "compact" ? /* @__PURE__ */ r(Ul, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(Il, { className: "h-3.5 w-3.5" })
2211
2221
  }
2212
2222
  ),
2213
- A === "table" && ga && ee.length > 0 && /* @__PURE__ */ d(
2223
+ A === "table" && xa && ee.length > 0 && /* @__PURE__ */ d(
2214
2224
  "button",
2215
2225
  {
2216
2226
  type: "button",
2217
- onClick: () => xr(),
2227
+ onClick: () => yr(),
2218
2228
  className: "flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white hover:brightness-110",
2219
2229
  children: [
2220
- /* @__PURE__ */ r(Bl, { className: "h-3 w-3 fill-current" }),
2230
+ /* @__PURE__ */ r(Vl, { className: "h-3 w-3 fill-current" }),
2221
2231
  "Work Next"
2222
2232
  ]
2223
2233
  }
@@ -2232,7 +2242,7 @@ function Ai({
2232
2242
  /* @__PURE__ */ r(Gt, { className: "h-3.5 w-3.5" }),
2233
2243
  "New ",
2234
2244
  Rn(z[0]),
2235
- /* @__PURE__ */ r(ra, { className: "h-3 w-3 opacity-60" })
2245
+ /* @__PURE__ */ r(aa, { className: "h-3 w-3 opacity-60" })
2236
2246
  ]
2237
2247
  }
2238
2248
  ) }),
@@ -2249,7 +2259,7 @@ function Ai({
2249
2259
  }),
2250
2260
  className: "flex w-full items-center rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-muted",
2251
2261
  children: [
2252
- ((Vr = Ft.active) == null ? void 0 : Vr.create_label) ?? ((Gr = Ft.active) == null ? void 0 : Gr.name) ?? "Default layout",
2262
+ ((Gr = Ft.active) == null ? void 0 : Gr.create_label) ?? ((Wr = Ft.active) == null ? void 0 : Wr.name) ?? "Default layout",
2253
2263
  /* @__PURE__ */ r("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
2254
2264
  ]
2255
2265
  }
@@ -2297,7 +2307,7 @@ function Ai({
2297
2307
  children: [
2298
2308
  /* @__PURE__ */ r(Gt, { className: "h-3.5 w-3.5" }),
2299
2309
  "New",
2300
- /* @__PURE__ */ r(ra, { className: "h-3 w-3 opacity-60" })
2310
+ /* @__PURE__ */ r(aa, { className: "h-3 w-3 opacity-60" })
2301
2311
  ]
2302
2312
  }
2303
2313
  ) }),
@@ -2320,7 +2330,7 @@ function Ai({
2320
2330
  )) })
2321
2331
  ] }),
2322
2332
  !nn && Pe && pe && /* @__PURE__ */ r(
2323
- Io,
2333
+ Wo,
2324
2334
  {
2325
2335
  collection: Pe,
2326
2336
  onParsed: (e, t) => pe(`/collections/${Pe}/new`, {
@@ -2345,10 +2355,10 @@ function Ai({
2345
2355
  label: "Total",
2346
2356
  count: (x == null ? void 0 : x.total) ?? 0,
2347
2357
  filteredCount: Y ? Y.total : null,
2348
- active: Object.values(w).every(wa) && g === "all",
2358
+ active: Object.values(w).every(_a) && g === "all",
2349
2359
  isLoading: je,
2350
2360
  ...ot("total"),
2351
- onClick: _a
2361
+ onClick: Na
2352
2362
  }
2353
2363
  ),
2354
2364
  /* @__PURE__ */ r(
@@ -2458,17 +2468,17 @@ function Ai({
2458
2468
  ] }) : /* @__PURE__ */ r(we, { children: "→ Holding steady" })
2459
2469
  }
2460
2470
  ),
2461
- fr.length > 0 && /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: fr.map(([e, t]) => {
2471
+ gr.length > 0 && /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: gr.map(([e, t]) => {
2462
2472
  var n;
2463
2473
  return /* @__PURE__ */ r(
2464
- ys,
2474
+ _s,
2465
2475
  {
2466
2476
  label: Fe(e),
2467
2477
  count: t,
2468
2478
  filteredCount: Y ? Y.by_state[e] ?? 0 : null,
2469
2479
  color: ((n = xe[e]) == null ? void 0 : n.color) ?? null,
2470
- active: va.includes(e),
2471
- onClick: () => ka(e)
2480
+ active: wa.includes(e),
2481
+ onClick: () => va(e)
2472
2482
  },
2473
2483
  e
2474
2484
  );
@@ -2477,9 +2487,9 @@ function Ai({
2477
2487
  }
2478
2488
  ),
2479
2489
  A !== "workload" && /* @__PURE__ */ r(
2480
- ds,
2490
+ ps,
2481
2491
  {
2482
- defs: xl,
2492
+ defs: vl,
2483
2493
  values: w,
2484
2494
  seededKeys: ft,
2485
2495
  onApply: (e) => {
@@ -2488,7 +2498,7 @@ function Ai({
2488
2498
  onClear: () => {
2489
2499
  P({ ...oe.current }), E(1);
2490
2500
  },
2491
- right: yl
2501
+ right: wl
2492
2502
  }
2493
2503
  ),
2494
2504
  /* @__PURE__ */ d(
@@ -2504,7 +2514,7 @@ function Ai({
2504
2514
  className: "inline-flex h-6 items-center gap-1 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.06] px-2.5 text-[12px] text-slate-700 dark:text-slate-200",
2505
2515
  children: [
2506
2516
  "Your default ",
2507
- Zn(Kr),
2517
+ er(Mr),
2508
2518
  " filter is hiding",
2509
2519
  " ",
2510
2520
  ie.toLocaleString("en-US"),
@@ -2515,7 +2525,7 @@ function Ai({
2515
2525
  "button",
2516
2526
  {
2517
2527
  type: "button",
2518
- onClick: er,
2528
+ onClick: tr,
2519
2529
  className: "font-medium text-[#0284a8] underline-offset-2 hover:underline dark:text-nvr-cyan",
2520
2530
  children: "Show all"
2521
2531
  }
@@ -2562,7 +2572,7 @@ function Ai({
2562
2572
  "button",
2563
2573
  {
2564
2574
  type: "button",
2565
- onClick: za,
2575
+ onClick: el,
2566
2576
  title: "Revert to the queue default (filters, columns and sort cleared)",
2567
2577
  className: C(
2568
2578
  "inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
@@ -2586,13 +2596,13 @@ function Ai({
2586
2596
  {
2587
2597
  type: "button",
2588
2598
  title: Ie === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
2589
- onClick: () => el.mutate(Ie === e.id ? null : e.id),
2599
+ onClick: () => rl.mutate(Ie === e.id ? null : e.id),
2590
2600
  className: C(
2591
2601
  "shrink-0",
2592
2602
  Ie === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
2593
2603
  ),
2594
2604
  children: /* @__PURE__ */ r(
2595
- Ul,
2605
+ Gl,
2596
2606
  {
2597
2607
  className: C("h-3 w-3", Ie === e.id && "fill-current"),
2598
2608
  "aria-label": Ie === e.id ? "Default view" : "Set as default"
@@ -2604,18 +2614,18 @@ function Ai({
2604
2614
  e.name,
2605
2615
  e.is_default ? /* @__PURE__ */ r("span", { className: "ml-1 text-nvr-navy/60 dark:text-nvr-cyan/70", children: "· default" }) : e.is_shared && /* @__PURE__ */ r("span", { className: "ml-1 text-slate-400", children: "· shared" })
2606
2616
  ] }),
2607
- _r && /* @__PURE__ */ r(
2617
+ Nr && /* @__PURE__ */ r(
2608
2618
  "button",
2609
2619
  {
2610
2620
  type: "button",
2611
- onClick: () => Xa.mutate({ viewId: e.id, on: !e.is_default }),
2621
+ onClick: () => tl.mutate({ viewId: e.id, on: !e.is_default }),
2612
2622
  title: e.is_default ? "Queue default — click to unset" : "Set as the default view for everyone on this queue",
2613
2623
  className: C(
2614
2624
  "shrink-0",
2615
2625
  e.is_default ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2616
2626
  ),
2617
2627
  "aria-label": e.is_default ? "Unset queue default" : "Set queue default",
2618
- children: /* @__PURE__ */ r(Il, { className: C("h-3 w-3", e.is_default && "fill-current") })
2628
+ children: /* @__PURE__ */ r(Wl, { className: C("h-3 w-3", e.is_default && "fill-current") })
2619
2629
  }
2620
2630
  ),
2621
2631
  (e.user === v || Bt) && ut === e.id && /* @__PURE__ */ r(
@@ -2627,35 +2637,35 @@ function Ai({
2627
2637
  title: "Update this view with the current filters, scope and sort",
2628
2638
  className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
2629
2639
  "aria-label": `Update view ${e.name}`,
2630
- "data-view-update-state": Re.isPending ? "saving" : Sr === e.id ? "saved" : "idle",
2631
- children: Re.isPending && ((t = Re.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ r(Vl, { className: "h-3 w-3 animate-spin" }) : Sr === e.id ? /* @__PURE__ */ r(
2632
- Gl,
2640
+ "data-view-update-state": Re.isPending ? "saving" : Cr === e.id ? "saved" : "idle",
2641
+ children: Re.isPending && ((t = Re.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ r(Hl, { className: "h-3 w-3 animate-spin" }) : Cr === e.id ? /* @__PURE__ */ r(
2642
+ Jl,
2633
2643
  {
2634
2644
  className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
2635
2645
  strokeWidth: 3
2636
2646
  }
2637
- ) : /* @__PURE__ */ r(Wl, { className: "h-3 w-3" })
2647
+ ) : /* @__PURE__ */ r(Yl, { className: "h-3 w-3" })
2638
2648
  }
2639
2649
  ),
2640
2650
  ut === e.id && /* @__PURE__ */ r(
2641
2651
  "button",
2642
2652
  {
2643
2653
  type: "button",
2644
- onClick: () => Ca(e.id),
2654
+ onClick: () => $a(e.id),
2645
2655
  title: Tt(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
2646
2656
  className: C(
2647
2657
  "shrink-0",
2648
2658
  Tt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2649
2659
  ),
2650
2660
  "aria-label": `Subscribe to view ${e.name}`,
2651
- children: /* @__PURE__ */ r(Hl, { className: C("h-3 w-3", Tt(e.id) && "fill-current") })
2661
+ children: /* @__PURE__ */ r(zl, { className: C("h-3 w-3", Tt(e.id) && "fill-current") })
2652
2662
  }
2653
2663
  ),
2654
2664
  e.user === v && /* @__PURE__ */ r(
2655
2665
  "button",
2656
2666
  {
2657
2667
  type: "button",
2658
- onClick: () => Za.mutate(e.id),
2668
+ onClick: () => nl.mutate(e.id),
2659
2669
  className: "invisible text-slate-400 hover:text-red-500 group-hover:visible",
2660
2670
  "aria-label": `Delete view ${e.name}`,
2661
2671
  children: "×"
@@ -2666,7 +2676,7 @@ function Ai({
2666
2676
  e.id
2667
2677
  );
2668
2678
  }),
2669
- /* @__PURE__ */ d(ze, { open: Ya, onOpenChange: _n, children: [
2679
+ /* @__PURE__ */ d(ze, { open: Za, onOpenChange: _n, children: [
2670
2680
  /* @__PURE__ */ r(Xe, { asChild: !0, children: /* @__PURE__ */ r(
2671
2681
  "button",
2672
2682
  {
@@ -2700,7 +2710,7 @@ function Ai({
2700
2710
  "input",
2701
2711
  {
2702
2712
  value: Nn,
2703
- onChange: (e) => yr(e.target.value),
2713
+ onChange: (e) => kr(e.target.value),
2704
2714
  placeholder: "View name",
2705
2715
  className: "mb-2 w-full rounded-md border border-slate-200 px-2 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
2706
2716
  }
@@ -2709,19 +2719,19 @@ function Ai({
2709
2719
  /* @__PURE__ */ r(
2710
2720
  On,
2711
2721
  {
2712
- checked: kr || bt,
2722
+ checked: vr || bt,
2713
2723
  disabled: bt,
2714
- onCheckedChange: (e) => vr(e === !0)
2724
+ onCheckedChange: (e) => wr(e === !0)
2715
2725
  }
2716
2726
  ),
2717
2727
  "Share with everyone"
2718
2728
  ] }),
2719
- _r && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2729
+ Nr && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2720
2730
  /* @__PURE__ */ r(
2721
2731
  On,
2722
2732
  {
2723
2733
  checked: bt,
2724
- onCheckedChange: (e) => wr(e === !0)
2734
+ onCheckedChange: (e) => _r(e === !0)
2725
2735
  }
2726
2736
  ),
2727
2737
  "Set as queue default (everyone starts here)"
@@ -2730,8 +2740,8 @@ function Ai({
2730
2740
  "button",
2731
2741
  {
2732
2742
  type: "button",
2733
- disabled: !Nn.trim() || Nr.isPending,
2734
- onClick: () => Nr.mutate(),
2743
+ disabled: !Nn.trim() || Sr.isPending,
2744
+ onClick: () => Sr.mutate(),
2735
2745
  className: "w-full rounded-md bg-nvr-cyan px-2 py-1.5 text-[12px] font-semibold text-white hover:bg-nvr-cyan/90 disabled:opacity-50",
2736
2746
  children: "Save current view"
2737
2747
  }
@@ -2742,177 +2752,180 @@ function Ai({
2742
2752
  }
2743
2753
  )
2744
2754
  ] }),
2745
- /* @__PURE__ */ r("div", { ref: Qt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: A === "table" ? /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
2746
- "div",
2747
- {
2748
- ref: Ne.rootRef,
2749
- className: C(
2750
- "relative min-w-0 flex-1 transition-opacity duration-200",
2751
- tr && "pointer-events-none opacity-60"
2752
- ),
2753
- "aria-busy": tr || void 0,
2754
- children: [
2755
- nr != null && /* @__PURE__ */ d("span", { className: "nvr-slide-up-centered absolute left-1/2 top-6 z-[6] -translate-x-1/2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-border dark:bg-card dark:text-slate-300", children: [
2756
- "Still working — ",
2757
- nr,
2758
- "s"
2759
- ] }),
2760
- /* @__PURE__ */ r(
2761
- Mo,
2762
- {
2763
- fillHeight: !0,
2764
- enterKey: or.current,
2765
- density: _t,
2766
- minBodyHeight: 360,
2767
- columns: It,
2768
- rows: S,
2769
- rowKey: (e) => `${e.collection}:${e.item_id}`,
2770
- total: (i == null ? void 0 : i.total) ?? 0,
2771
- page: _e,
2772
- limit: tn,
2773
- isLoading: je,
2774
- onPageChange: E,
2775
- onRowClick: (e) => Kt(e),
2776
- rowDragProps: (e) => Ka({ collection: e.collection, id: e.item_id }),
2777
- onRowContextMenu: (e, t) => {
2778
- t.preventDefault(), dt({ x: t.clientX, y: t.clientY, row: e });
2779
- },
2780
- rowTitle: (e) => {
2781
- const t = Lt.get(D(e));
2782
- return Ne.titleFor(D(e)) ?? (t && !t.is_mine ? ho(t) : void 0);
2783
- },
2784
- rowClassName: (e) => Dt === D(e) ? (
2785
- // Pinned sticky cells use bg-inherit — the highlight must be
2786
- // OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
2787
- // scrolled content bleeds through the pinned columns. Same
2788
- // pair DataTable uses for selected rows when pins are active.
2789
- "bg-[#f2fdff] dark:bg-[#20303a]"
2790
- ) : e.at_risk ? No(e.at_risk_color ?? "red") : void 0,
2791
- emptyMessage: /* @__PURE__ */ r(
2792
- Qo,
2793
- {
2794
- icon: Jl,
2795
- title: ((Wr = i == null ? void 0 : i.empty) == null ? void 0 : Wr.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((Hr = i == null ? void 0 : i.empty) == null ? void 0 : Hr.reason) === "scope_mine" ? "Nothing waiting on you" : ((Jr = i == null ? void 0 : i.empty) == null ? void 0 : Jr.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
2796
- detail: ((Yr = i == null ? void 0 : i.empty) == null ? void 0 : Yr.reason) === "filters" && ie > 0 ? `Your default ${Zn(Kr)} filter is hiding ${ie.toLocaleString("en-US")} item${ie === 1 ? "" : "s"} here.` : ((zr = i == null ? void 0 : i.empty) == null ? void 0 : zr.reason) === "filters" ? g !== "all" ? "Your filters and the current tab leave nothing to show. Widen a filter or look across all items." : "Widen or clear a filter to see more of the queue." : ((Xr = i == null ? void 0 : i.empty) == null ? void 0 : Xr.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
2797
- action: ((Zr = i == null ? void 0 : i.empty) == null ? void 0 : Zr.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
2798
- ie > 0 && /* @__PURE__ */ d(
2799
- "button",
2800
- {
2801
- type: "button",
2802
- onClick: er,
2803
- className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[12px] font-semibold text-white hover:brightness-105",
2804
- "data-queue-empty-defaults": !0,
2805
- children: [
2806
- "Show all ",
2807
- ie.toLocaleString("en-US")
2808
- ]
2809
- }
2810
- ),
2811
- /* @__PURE__ */ r(
2812
- "button",
2813
- {
2814
- type: "button",
2815
- onClick: () => {
2816
- var t;
2817
- const e = {};
2818
- for (const [n, a] of Object.entries(oe.current))
2819
- (t = Se[n.slice(6)]) != null && t.length && (e[n] = a);
2820
- P(e), E(1);
2821
- },
2822
- className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2823
- "data-queue-empty-clear": !0,
2824
- children: "Clear filters"
2825
- }
2826
- ),
2827
- g !== "all" && /* @__PURE__ */ r(
2828
- "button",
2829
- {
2830
- type: "button",
2831
- onClick: () => {
2832
- J("all"), E(1);
2833
- },
2834
- className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2835
- "data-queue-empty-all": !0,
2836
- children: "Show all items"
2837
- }
2838
- )
2839
- ] }) : void 0
2840
- }
2841
- ),
2842
- sort: I,
2843
- onSortChange: (e) => {
2844
- Le(e), E(1);
2845
- },
2846
- filterDefs: Fn,
2847
- filterValues: w,
2848
- onFilterChange: (e, t) => {
2849
- P((n) => ({ ...n, [e]: t })), E(1);
2850
- },
2851
- rowGroups: nl ?? void 0,
2852
- collapsedGroups: he,
2853
- onToggleGroup: Wa,
2854
- selectedIds: rn ? Ae : void 0,
2855
- onSelectionChange: rn ? Ut : void 0,
2856
- hideFilterRow: !0,
2857
- nowrapCells: !0,
2858
- columnPins: Lr,
2859
- onColumnPinChange: (e, t) => {
2860
- Yt((n) => {
2861
- const a = { ...n ?? Lr };
2862
- return t ? a[e] = t : delete a[e], a;
2863
- });
2864
- },
2865
- columnFilterRow: !0,
2866
- hScrollProxy: !0,
2867
- footer: /* @__PURE__ */ r(
2868
- Xo,
2869
- {
2870
- collections: st,
2871
- selectedIds: String(w.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
2872
- onToggle: (e) => {
2873
- const t = e.ids.join(",");
2874
- P((n) => ({
2875
- ...n,
2876
- at_risk_rule: n.at_risk_rule === t ? "" : t
2877
- })), E(1);
2878
- },
2879
- className: "shrink-0 border-t border-slate-100 bg-white px-3 py-1.5 dark:border-slate-800 dark:bg-slate-900"
2880
- }
2881
- )
2882
- }
2883
- )
2884
- ]
2885
- }
2886
- ) }) }) : A === "kanban" ? /* @__PURE__ */ r(
2887
- cs,
2888
- {
2889
- items: S,
2890
- onCardClick: (e) => Kt(e),
2891
- onDrop: (e, t) => Ea.mutate({ item: e, targetState: t }),
2892
- onClaim: (e) => qe.mutate(e),
2893
- onRelease: (e) => Be.mutate(e),
2894
- swimlaneBy: tt,
2895
- stateLabels: yn,
2896
- laneLabel: tt === "collection" ? it : void 0,
2897
- claimsEnabled: se,
2898
- onDraggingChange: (e) => {
2899
- Mn.current = e;
2755
+ /* @__PURE__ */ d("div", { ref: Qt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
2756
+ zn && /* @__PURE__ */ r(ds, { error: Aa, onRetry: () => void Oa(), className: "mb-3" }),
2757
+ A === "table" ? /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
2758
+ "div",
2759
+ {
2760
+ ref: Ne.rootRef,
2761
+ className: C(
2762
+ "relative min-w-0 flex-1 transition-opacity duration-200",
2763
+ nr && "pointer-events-none opacity-60"
2764
+ ),
2765
+ "aria-busy": nr || void 0,
2766
+ children: [
2767
+ rr != null && /* @__PURE__ */ d("span", { className: "nvr-slide-up-centered absolute left-1/2 top-6 z-[6] -translate-x-1/2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-border dark:bg-card dark:text-slate-300", children: [
2768
+ "Still working — ",
2769
+ rr,
2770
+ "s"
2771
+ ] }),
2772
+ /* @__PURE__ */ r(
2773
+ Bo,
2774
+ {
2775
+ fillHeight: !0,
2776
+ enterKey: sr.current,
2777
+ density: _t,
2778
+ minBodyHeight: 360,
2779
+ columns: It,
2780
+ rows: S,
2781
+ rowKey: (e) => `${e.collection}:${e.item_id}`,
2782
+ total: (i == null ? void 0 : i.total) ?? 0,
2783
+ page: _e,
2784
+ limit: tn,
2785
+ isLoading: je,
2786
+ onPageChange: E,
2787
+ onRowClick: (e) => Kt(e),
2788
+ rowDragProps: (e) => ja({ collection: e.collection, id: e.item_id }),
2789
+ onRowContextMenu: (e, t) => {
2790
+ t.preventDefault(), dt({ x: t.clientX, y: t.clientY, row: e });
2791
+ },
2792
+ rowTitle: (e) => {
2793
+ const t = Lt.get(D(e));
2794
+ return Ne.titleFor(D(e)) ?? (t && !t.is_mine ? xo(t) : void 0);
2795
+ },
2796
+ rowClassName: (e) => Dt === D(e) ? (
2797
+ // Pinned sticky cells use bg-inherit — the highlight must be
2798
+ // OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
2799
+ // scrolled content bleeds through the pinned columns. Same
2800
+ // pair DataTable uses for selected rows when pins are active.
2801
+ "bg-[#f2fdff] dark:bg-[#20303a]"
2802
+ ) : e.at_risk ? $o(e.at_risk_color ?? "red") : void 0,
2803
+ emptyMessage: zn ? /* @__PURE__ */ r("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ r(
2804
+ Uo,
2805
+ {
2806
+ icon: Xl,
2807
+ title: ((Hr = i == null ? void 0 : i.empty) == null ? void 0 : Hr.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((Jr = i == null ? void 0 : i.empty) == null ? void 0 : Jr.reason) === "scope_mine" ? "Nothing waiting on you" : ((Yr = i == null ? void 0 : i.empty) == null ? void 0 : Yr.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
2808
+ detail: ((zr = i == null ? void 0 : i.empty) == null ? void 0 : zr.reason) === "filters" && ie > 0 ? `Your default ${er(Mr)} filter is hiding ${ie.toLocaleString("en-US")} item${ie === 1 ? "" : "s"} here.` : ((Xr = i == null ? void 0 : i.empty) == null ? void 0 : Xr.reason) === "filters" ? g !== "all" ? "Your filters and the current tab leave nothing to show. Widen a filter or look across all items." : "Widen or clear a filter to see more of the queue." : ((Zr = i == null ? void 0 : i.empty) == null ? void 0 : Zr.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
2809
+ action: ((ea = i == null ? void 0 : i.empty) == null ? void 0 : ea.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
2810
+ ie > 0 && /* @__PURE__ */ d(
2811
+ "button",
2812
+ {
2813
+ type: "button",
2814
+ onClick: tr,
2815
+ className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[12px] font-semibold text-white hover:brightness-105",
2816
+ "data-queue-empty-defaults": !0,
2817
+ children: [
2818
+ "Show all ",
2819
+ ie.toLocaleString("en-US")
2820
+ ]
2821
+ }
2822
+ ),
2823
+ /* @__PURE__ */ r(
2824
+ "button",
2825
+ {
2826
+ type: "button",
2827
+ onClick: () => {
2828
+ var t;
2829
+ const e = {};
2830
+ for (const [n, a] of Object.entries(oe.current))
2831
+ (t = Se[n.slice(6)]) != null && t.length && (e[n] = a);
2832
+ P(e), E(1);
2833
+ },
2834
+ className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2835
+ "data-queue-empty-clear": !0,
2836
+ children: "Clear filters"
2837
+ }
2838
+ ),
2839
+ g !== "all" && /* @__PURE__ */ r(
2840
+ "button",
2841
+ {
2842
+ type: "button",
2843
+ onClick: () => {
2844
+ J("all"), E(1);
2845
+ },
2846
+ className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800",
2847
+ "data-queue-empty-all": !0,
2848
+ children: "Show all items"
2849
+ }
2850
+ )
2851
+ ] }) : void 0
2852
+ }
2853
+ ),
2854
+ sort: I,
2855
+ onSortChange: (e) => {
2856
+ Le(e), E(1);
2857
+ },
2858
+ filterDefs: Fn,
2859
+ filterValues: w,
2860
+ onFilterChange: (e, t) => {
2861
+ P((n) => ({ ...n, [e]: t })), E(1);
2862
+ },
2863
+ rowGroups: ll ?? void 0,
2864
+ collapsedGroups: he,
2865
+ onToggleGroup: Ya,
2866
+ selectedIds: rn ? Ae : void 0,
2867
+ onSelectionChange: rn ? Ut : void 0,
2868
+ hideFilterRow: !0,
2869
+ nowrapCells: !0,
2870
+ columnPins: Dr,
2871
+ onColumnPinChange: (e, t) => {
2872
+ Yt((n) => {
2873
+ const a = { ...n ?? Dr };
2874
+ return t ? a[e] = t : delete a[e], a;
2875
+ });
2876
+ },
2877
+ columnFilterRow: !0,
2878
+ hScrollProxy: !0,
2879
+ footer: /* @__PURE__ */ r(
2880
+ ts,
2881
+ {
2882
+ collections: st,
2883
+ selectedIds: String(w.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
2884
+ onToggle: (e) => {
2885
+ const t = e.ids.join(",");
2886
+ P((n) => ({
2887
+ ...n,
2888
+ at_risk_rule: n.at_risk_rule === t ? "" : t
2889
+ })), E(1);
2890
+ },
2891
+ className: "shrink-0 border-t border-slate-100 bg-white px-3 py-1.5 dark:border-slate-800 dark:bg-slate-900"
2892
+ }
2893
+ )
2894
+ }
2895
+ )
2896
+ ]
2900
2897
  }
2901
- }
2902
- ) : /* @__PURE__ */ r(us, { queueId: l }) }),
2898
+ ) }) }) : A === "kanban" ? /* @__PURE__ */ r(
2899
+ bs,
2900
+ {
2901
+ items: S,
2902
+ onCardClick: (e) => Kt(e),
2903
+ onDrop: (e, t) => Pa.mutate({ item: e, targetState: t }),
2904
+ onClaim: (e) => qe.mutate(e),
2905
+ onRelease: (e) => Be.mutate(e),
2906
+ swimlaneBy: tt,
2907
+ stateLabels: yn,
2908
+ laneLabel: tt === "collection" ? it : void 0,
2909
+ claimsEnabled: se,
2910
+ onDraggingChange: (e) => {
2911
+ Mn.current = e;
2912
+ }
2913
+ }
2914
+ ) : /* @__PURE__ */ r(hs, { queueId: l })
2915
+ ] }),
2903
2916
  rn && /* @__PURE__ */ d(
2904
- ss,
2917
+ us,
2905
2918
  {
2906
2919
  count: Ae.length,
2907
2920
  claimsEnabled: se,
2908
2921
  showClaim: an("claim"),
2909
2922
  showRelease: an("release"),
2910
2923
  showTransition: an("transition"),
2911
- states: gr((i == null ? void 0 : i.available_values.state) ?? []).map((e) => ({
2924
+ states: xr((i == null ? void 0 : i.available_values.state) ?? []).map((e) => ({
2912
2925
  value: e,
2913
2926
  label: Fe(e)
2914
2927
  })),
2915
- busy: $r,
2928
+ busy: qr,
2916
2929
  onClaim: () => Sn(
2917
2930
  "Claim",
2918
2931
  (e) => p.request(
@@ -2931,7 +2944,7 @@ function Ai({
2931
2944
  })
2932
2945
  )
2933
2946
  ),
2934
- onTransition: (e) => Sn("Transition", (t) => rr(t, e)),
2947
+ onTransition: (e) => Sn("Transition", (t) => ar(t, e)),
2935
2948
  onClear: () => Ut([]),
2936
2949
  children: [
2937
2950
  Ae.length >= 2 && /* @__PURE__ */ r(
@@ -2939,24 +2952,24 @@ function Ai({
2939
2952
  {
2940
2953
  type: "button",
2941
2954
  onClick: () => {
2942
- const e = go(
2955
+ const e = ko(
2943
2956
  S.filter((t) => Ae.includes(D(t)) && t.collection !== "tasks").map((t) => W.urlFor(wn(t)))
2944
2957
  );
2945
- e.blocked > 0 || e.capped > 0 ? R.warning(sa(e)) : R.success(sa(e));
2958
+ e.blocked > 0 || e.capped > 0 ? R.warning(ia(e)) : R.success(ia(e));
2946
2959
  },
2947
2960
  "data-bulk-open-tabs": !0,
2948
- title: `Open the selected records in new tabs (up to ${fo})`,
2961
+ title: `Open the selected records in new tabs (up to ${yo})`,
2949
2962
  className: "h-8 rounded-md border border-white/20 px-3 text-[12.5px] font-medium hover:bg-white/10 dark:border-border dark:hover:bg-muted",
2950
2963
  children: "Open in tabs"
2951
2964
  }
2952
2965
  ),
2953
2966
  /* @__PURE__ */ r(
2954
- Do,
2967
+ Mo,
2955
2968
  {
2956
2969
  targets: S.filter((e) => Ae.includes(D(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
2957
2970
  enabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
2958
2971
  tone: "light",
2959
- disabled: $r,
2972
+ disabled: qr,
2960
2973
  onDone: (e) => {
2961
2974
  e.failed === 0 && Ut([]), h.invalidateQueries({ queryKey: ["queue-items", l] });
2962
2975
  }
@@ -2966,7 +2979,7 @@ function Ai({
2966
2979
  }
2967
2980
  ),
2968
2981
  X != null && X.length ? /* @__PURE__ */ r(
2969
- zo,
2982
+ es,
2970
2983
  {
2971
2984
  collection: X[0].collection,
2972
2985
  itemId: X[0].itemId,
@@ -2980,7 +2993,7 @@ function Ai({
2980
2993
  onClose: () => ht.back(X.length)
2981
2994
  }
2982
2995
  ) : null,
2983
- K && aa(
2996
+ K && la(
2984
2997
  /* @__PURE__ */ d(
2985
2998
  "div",
2986
2999
  {
@@ -3002,7 +3015,7 @@ function Ai({
3002
3015
  },
3003
3016
  { label: "Peek", run: () => Te(K.row) },
3004
3017
  ...se ? [
3005
- ((ea = K.row.claimed_by) == null ? void 0 : ea.id) === v ? { label: "Release claim", run: () => Be.mutate(K.row) } : { label: "Claim", run: () => qe.mutate(K.row) }
3018
+ ((ta = K.row.claimed_by) == null ? void 0 : ta.id) === v ? { label: "Release claim", run: () => Be.mutate(K.row) } : { label: "Claim", run: () => qe.mutate(K.row) }
3006
3019
  ] : [],
3007
3020
  {
3008
3021
  label: "Copy ID",
@@ -3021,9 +3034,9 @@ function Ai({
3021
3034
  }
3022
3035
  },
3023
3036
  // Custom actions (#125): the record's registered actions, right here.
3024
- ...qa(K.row.collection).map((e) => ({
3037
+ ...Fa(K.row.collection).map((e) => ({
3025
3038
  label: e.label,
3026
- run: () => Fa(e, K.row)
3039
+ run: () => Ta(e, K.row)
3027
3040
  }))
3028
3041
  ].map((e) => /* @__PURE__ */ r(
3029
3042
  "button",
@@ -3091,9 +3104,9 @@ function Ai({
3091
3104
  ),
3092
3105
  document.body
3093
3106
  ),
3094
- Hn && aa(
3107
+ Hn && la(
3095
3108
  /* @__PURE__ */ r(
3096
- vs,
3109
+ Ss,
3097
3110
  {
3098
3111
  queueId: l,
3099
3112
  drill: Hn,
@@ -3106,13 +3119,13 @@ function Ai({
3106
3119
  document.body
3107
3120
  ),
3108
3121
  /* @__PURE__ */ r(
3109
- is,
3122
+ ms,
3110
3123
  {
3111
3124
  item: ye,
3112
3125
  stateLabels: yn,
3113
3126
  collectionLabel: it,
3114
3127
  claimsEnabled: se,
3115
- columnFormats: ll,
3128
+ columnFormats: il,
3116
3129
  width: u == null ? void 0 : u.sheet_width,
3117
3130
  itemLayout: u == null ? void 0 : u.item_layout,
3118
3131
  onOpenChange: (e) => {
@@ -3120,20 +3133,20 @@ function Ai({
3120
3133
  },
3121
3134
  onClaim: (e) => qe.mutate(e),
3122
3135
  onRelease: (e) => Be.mutate(e),
3123
- workNextActive: Ha,
3124
- onNext: () => ye && xr(ye),
3136
+ workNextActive: za,
3137
+ onNext: () => ye && yr(ye),
3125
3138
  refetchItems: () => h.invalidateQueries({ queryKey: ["queue-items", l] })
3126
3139
  }
3127
3140
  )
3128
3141
  ] });
3129
3142
  }
3130
- function vs({
3143
+ function Ss({
3131
3144
  queueId: l,
3132
3145
  drill: f,
3133
3146
  onClose: $,
3134
3147
  onOpenRecord: L
3135
3148
  }) {
3136
- const U = ua(), { data: h, isLoading: p } = H({
3149
+ const U = ma(), { data: h, isLoading: p } = H({
3137
3150
  queryKey: ["queue-agg-rows", l, f.row.collection, f.row.item_id, f.path],
3138
3151
  queryFn: () => U.request(
3139
3152
  O(`/queues/${l}/aggregate-rows`, {
@@ -3194,5 +3207,5 @@ function vs({
3194
3207
  );
3195
3208
  }
3196
3209
  export {
3197
- Ai as QueueWorklist
3210
+ Pi as QueueWorklist
3198
3211
  };