@nivaro/react 0.3.19 → 0.3.21

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.
@@ -1,79 +1,79 @@
1
- import { jsxs as d, Fragment as we, jsx as r } from "react/jsx-runtime";
2
- import { useSensors as Cl, useSensor as $l, PointerSensor as ql, DndContext as Fl, closestCenter as Tl } from "@dnd-kit/core";
3
- import { SortableContext as Rl, verticalListSortingStrategy as Al, arrayMove as Ol, useSortable as El } from "@dnd-kit/sortable";
4
- import { CSS as Ll } from "@dnd-kit/utilities";
5
- import { useQueryClient as Dl, useQuery as H, useMutation as ve, useQueries as Je } from "@tanstack/react-query";
6
- import { AlertTriangle as Pl, FileDiff as Kl, RefreshCw as Ml, Rows3 as aa, Flame as Ql, Sparkles as Bl, BarChart3 as jl, SlidersHorizontal as Ul, Rows4 as Il, Rows2 as Vl, Play as Gl, Plus as Wt, ChevronDown as la, Star as Wl, Pin as Hl, Loader2 as Jl, Check as Yl, Save as zl, Bell as Xl, Inbox as Zl, GripVertical as eo } from "lucide-react";
7
- import { useState as k, useRef as B, useEffect as j, useMemo as G } from "react";
8
- import { createPortal as oa } from "react-dom";
9
- import { toast as R } from "sonner";
10
- import { useNivaroClient as ba, useItemEditAuth as sa, useItemNavigation as to, useNavigation as no, useOverlayState as ro } from "../../context.js";
11
- import { useDebounced as ao } from "../../hooks/useDebounced.js";
12
- import { useElapsedLoading as lo } from "../../hooks/useElapsedLoading.js";
13
- import { useBulkProgressFeed as oo } from "../../lib/bulk-progress.js";
14
- import { get as E, post as ne, patch as ia, del as Rn, put as so } from "../../lib/commands.js";
15
- import { evaluateExpression as io } from "../../lib/expression.js";
16
- import { deliverLive as co, releaseLiveOwner as uo } from "../../lib/focus-mode.js";
17
- import { formatMultiValue as Ye, formatValue as mo } from "../../lib/format-value.js";
18
- import { createCursorBook as bo, pageRequest as po, noteNextCursor as ho } from "../../lib/keyset-pager.js";
19
- import { expandCoalesced as fo, LIVE_ASPECTS as xt } from "../../lib/live.js";
20
- import { useRowChanges as go, useRowLocksByCollection as xo, lockLabel as yo } from "../../lib/live-list.js";
21
- import { OPEN_IN_TABS_CAP as ko, openInTabs as vo, openInTabsMessage as ca } from "../../lib/open-in-tabs.js";
22
- import { isOwnWrite as wo } from "../../lib/own-writes.js";
23
- import { useRowPresence as _o, rowPresenceKey as No } from "../../lib/presence-hooks.js";
24
- import { buildGroups as So } from "../../lib/queue-grouping.js";
25
- import { useOptionalRealtime as Co } from "../../lib/realtime.js";
26
- import { rowHighlightTextClass as $o, rowHighlightClass as qo } from "../../lib/row-highlight.js";
27
- import { userErrorMessage as yt } from "../../lib/safe-error.js";
28
- import { useMyScopes as Fo, matchScopeDimension as To, effectiveScopeSeedIds as Ro } from "../../lib/use-my-scopes.js";
29
- import { useNewItemLayouts as Ao } from "../../lib/use-new-item-layouts.js";
30
- import { formatNumber as re, cn as C, titleCase as An, humanHours as Oo, formatRelative as Eo, formatDateTime as Lo, formatDate as Do } from "../../lib/utils.js";
31
- import { usePublishAskContext as Po, useAskRecordDrag as Ko } from "../ai/ask-context.js";
32
- import { useBuiltinGate as Mo, BulkActionButtons as Qo } from "../bulk/BulkActionButtons.js";
33
- import { BulkRowMark as Bo } from "../bulk/BulkRowMark.js";
34
- import { RowActionsMenu as jo } from "../CollectionBrowserView.js";
35
- import { DataTable as Uo } from "../DataTable.js";
36
- import { EmptyState as Io } from "../EmptyState.js";
37
- import { FocusModeToggle as Vo } from "../FocusModeToggle.js";
38
- import { FulfilmentPill as Go, FULFILMENT_FILTER_OPTIONS as Wo } from "../FulfilmentPill.js";
39
- import { ImportFromFileButton as Ho } from "../import/ImportFromFileButton.js";
40
- import { IntegrationDots as Jo, INTEGRATIONS_FILTER_OPTIONS as Yo } from "../integrations/IntegrationDots.js";
41
- import { IntegrationsFilterPill as zo } from "../integrations/IntegrationsFilterPill.js";
42
- import { readQueueReturn as Xo, writeQueueReturn as da } from "../item-edit/QueueReturnChip.js";
43
- import { ListLoadError as Zo } from "../ListLoadError.js";
44
- import { LiveRowMark as es } from "../LiveRowMark.js";
45
- import { RealtimeStaleMark as ts } from "../RealtimeStatusBanner.js";
46
- import { RecordDrilldownSheet as ns } from "../RecordDrilldownSheet.js";
47
- import { RowHighlightLegend as rs } from "../RowHighlightLegend.js";
48
- import { RowPresence as as } from "../RowPresence.js";
49
- import { TickerNumber as On } from "../TickerNumber.js";
50
- import { UnseenDot as ls } from "../UnseenDot.js";
51
- import { Badge as os } from "../ui/badge.js";
52
- import { Checkbox as En } from "../ui/checkbox.js";
53
- import { Command as ua, CommandInput as ss, CommandList as ma, CommandEmpty as is, CommandItem as kt } from "../ui/command.js";
54
- import { Label as cs } from "../ui/label.js";
55
- import { Popover as ze, PopoverTrigger as Xe, PopoverContent as Ze } from "../ui/popover.js";
56
- import { Skeleton as ds } from "../ui/skeleton.js";
57
- import { OwnerAvatars as us } from "./OwnerAvatars.js";
58
- import { QueueBulkBar as ms } from "./QueueBulkBar.js";
59
- import { QueueItemSheet as bs } from "./QueueItemSheet.js";
60
- import { QueueKanbanBoard as ps } from "./QueueKanbanBoard.js";
61
- import { QueueQuickFilters as hs } from "./QueueQuickFilters.js";
62
- import { QueueWorkloadView as fs } from "./QueueWorkloadView.js";
63
- import { useTransitionNote as gs, needsTransitionNote as xs } from "./transition-note.js";
64
- function ys({ summary: l }) {
1
+ import { jsxs as d, Fragment as _e, jsx as r } from "react/jsx-runtime";
2
+ import { useSensors as Fl, useSensor as Tl, PointerSensor as Rl, DndContext as Al, closestCenter as Ol } from "@dnd-kit/core";
3
+ import { SortableContext as El, verticalListSortingStrategy as Ll, arrayMove as Dl, useSortable as Pl } from "@dnd-kit/sortable";
4
+ import { CSS as Kl } from "@dnd-kit/utilities";
5
+ import { useQueryClient as Ml, useQuery as H, useMutation as we, useQueries as ze } from "@tanstack/react-query";
6
+ import { AlertTriangle as Bl, FileDiff as Ql, RefreshCw as jl, Rows3 as oa, Flame as Ul, Sparkles as Il, BarChart3 as Vl, SlidersHorizontal as Gl, ListChecks as Wl, Rows4 as Hl, Rows2 as Jl, Play as Yl, Plus as Jt, ChevronDown as sa, Star as zl, Pin as Xl, Loader2 as Zl, Check as eo, Save as to, Bell as no, Inbox as ro, GripVertical as ao } from "lucide-react";
7
+ import { useState as y, useRef as Q, useEffect as j, useMemo as G } from "react";
8
+ import { createPortal as ia } from "react-dom";
9
+ import { toast as A } from "sonner";
10
+ import { useNivaroClient as ha, useItemEditAuth as ca, useItemNavigation as lo, useNavigation as oo, useOverlayState as so } from "../../context.js";
11
+ import { useDebounced as io } from "../../hooks/useDebounced.js";
12
+ import { useElapsedLoading as co } from "../../hooks/useElapsedLoading.js";
13
+ import { useBulkProgressFeed as uo } from "../../lib/bulk-progress.js";
14
+ import { get as E, post as re, patch as da, del as An, put as mo } from "../../lib/commands.js";
15
+ import { evaluateExpression as bo } from "../../lib/expression.js";
16
+ import { deliverLive as po, releaseLiveOwner as ho } from "../../lib/focus-mode.js";
17
+ import { formatMultiValue as Xe, formatValue as fo } from "../../lib/format-value.js";
18
+ import { createCursorBook as go, pageRequest as xo, noteNextCursor as yo } from "../../lib/keyset-pager.js";
19
+ import { expandCoalesced as ko, LIVE_ASPECTS as kt } from "../../lib/live.js";
20
+ import { useRowChanges as vo, useRowLocksByCollection as wo, lockLabel as _o } from "../../lib/live-list.js";
21
+ import { OPEN_IN_TABS_CAP as No, openInTabs as So, openInTabsMessage as ua } from "../../lib/open-in-tabs.js";
22
+ import { isOwnWrite as Co } from "../../lib/own-writes.js";
23
+ import { useRowPresence as $o, rowPresenceKey as qo } from "../../lib/presence-hooks.js";
24
+ import { buildGroups as Fo } from "../../lib/queue-grouping.js";
25
+ import { useOptionalRealtime as To } from "../../lib/realtime.js";
26
+ import { rowHighlightTextClass as Ro, rowHighlightClass as Ao } from "../../lib/row-highlight.js";
27
+ import { userErrorMessage as vt } from "../../lib/safe-error.js";
28
+ import { useMyScopes as Oo, matchScopeDimension as Eo, effectiveScopeSeedIds as Lo } from "../../lib/use-my-scopes.js";
29
+ import { useNewItemLayouts as Do } from "../../lib/use-new-item-layouts.js";
30
+ import { formatNumber as ae, cn as $, titleCase as On, humanHours as Po, formatRelative as Ko, formatDateTime as Mo, formatDate as Bo } from "../../lib/utils.js";
31
+ import { usePublishAskContext as Qo, useAskRecordDrag as jo } from "../ai/ask-context.js";
32
+ import { useBuiltinGate as Uo, BulkActionButtons as Io } from "../bulk/BulkActionButtons.js";
33
+ import { BulkRowMark as Vo } from "../bulk/BulkRowMark.js";
34
+ import { RowActionsMenu as Go } from "../CollectionBrowserView.js";
35
+ import { DataTable as Wo } from "../DataTable.js";
36
+ import { EmptyState as Ho } from "../EmptyState.js";
37
+ import { FocusModeToggle as Jo } from "../FocusModeToggle.js";
38
+ import { FulfilmentPill as Yo, FULFILMENT_FILTER_OPTIONS as zo } from "../FulfilmentPill.js";
39
+ import { ImportFromFileButton as Xo } from "../import/ImportFromFileButton.js";
40
+ import { IntegrationDots as Zo, INTEGRATIONS_FILTER_OPTIONS as es } from "../integrations/IntegrationDots.js";
41
+ import { IntegrationsFilterPill as ts } from "../integrations/IntegrationsFilterPill.js";
42
+ import { readQueueReturn as ns, writeQueueReturn as ma } from "../item-edit/QueueReturnChip.js";
43
+ import { ListLoadError as rs } from "../ListLoadError.js";
44
+ import { LiveRowMark as as } from "../LiveRowMark.js";
45
+ import { RealtimeStaleMark as ls } from "../RealtimeStatusBanner.js";
46
+ import { RecordDrilldownSheet as os } from "../RecordDrilldownSheet.js";
47
+ import { RowHighlightLegend as ss } from "../RowHighlightLegend.js";
48
+ import { RowPresence as is } from "../RowPresence.js";
49
+ import { TickerNumber as En } from "../TickerNumber.js";
50
+ import { UnseenDot as cs } from "../UnseenDot.js";
51
+ import { Badge as ds } from "../ui/badge.js";
52
+ import { Checkbox as Ln } from "../ui/checkbox.js";
53
+ import { Command as ba, CommandInput as us, CommandList as pa, CommandEmpty as ms, CommandItem as wt } from "../ui/command.js";
54
+ import { Label as bs } from "../ui/label.js";
55
+ import { Popover as Ze, PopoverTrigger as et, PopoverContent as tt } from "../ui/popover.js";
56
+ import { Skeleton as ps } from "../ui/skeleton.js";
57
+ import { OwnerAvatars as hs } from "./OwnerAvatars.js";
58
+ import { QueueBulkBar as fs } from "./QueueBulkBar.js";
59
+ import { QueueItemSheet as gs } from "./QueueItemSheet.js";
60
+ import { QueueKanbanBoard as xs } from "./QueueKanbanBoard.js";
61
+ import { QueueQuickFilters as ys } from "./QueueQuickFilters.js";
62
+ import { QueueWorkloadView as ks } from "./QueueWorkloadView.js";
63
+ import { useTransitionNote as vs, needsTransitionNote as ws } from "./transition-note.js";
64
+ function _s({ summary: l }) {
65
65
  if (!l || l.count === 0)
66
66
  return /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
67
- const f = [l.last_from, l.last_to].filter(Boolean).join(" → "), $ = [
67
+ const f = [l.last_from, l.last_to].filter(Boolean).join(" → "), q = [
68
68
  f ? `Last: ${f}` : null,
69
- l.last_at ? Eo(l.last_at) : null,
69
+ l.last_at ? Ko(l.last_at) : null,
70
70
  l.last_reason ? `“${l.last_reason}”` : "no reason given"
71
71
  ].filter(Boolean).join(" · ");
72
72
  return /* @__PURE__ */ d(
73
73
  "span",
74
74
  {
75
75
  className: "inline-flex max-w-[260px] items-center gap-1.5 truncate rounded-full border border-rose-200 bg-rose-50 px-2 py-0.5 text-[11px] font-medium text-rose-700 dark:border-rose-900/40 dark:bg-rose-900/10 dark:text-rose-300",
76
- "data-tip": $,
76
+ "data-tip": q,
77
77
  "data-send-backs": l.count,
78
78
  children: [
79
79
  /* @__PURE__ */ d("span", { className: "tabular-nums", children: [
@@ -88,20 +88,20 @@ function ys({ summary: l }) {
88
88
  }
89
89
  );
90
90
  }
91
- const ks = 50, Ht = "nivaro_addendums", vs = [
91
+ const Ns = 50, Yt = "nivaro_addendums", Ss = [
92
92
  { value: "mine", label: "My Items" },
93
93
  { value: "unowned", label: "No Owners" },
94
94
  { value: "claimed", label: "Claimed by me" },
95
95
  { value: "all", label: "All Items" }
96
96
  ];
97
- function ws({ summary: l }) {
97
+ function Cs({ summary: l }) {
98
98
  if (!l || l.total === 0) return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
99
- const f = l.active > 0, $ = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", D = l.cost_impact, U = D != null && D !== 0 ? `${D > 0 ? "+" : "−"}$${Math.abs(D).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
99
+ const f = l.active > 0, q = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", D = l.cost_impact, U = D != null && D !== 0 ? `${D > 0 ? "+" : "−"}$${Math.abs(D).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
100
100
  return /* @__PURE__ */ d(
101
101
  "span",
102
102
  {
103
103
  title: l.latest_title ?? void 0,
104
- className: C(
104
+ className: $(
105
105
  "inline-flex max-w-[220px] items-center gap-1.5 truncate rounded-full border px-2 py-0.5 text-[11px] font-medium",
106
106
  f ? "border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-500/50 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-slate-300"
107
107
  ),
@@ -110,13 +110,13 @@ function ws({ summary: l }) {
110
110
  "span",
111
111
  {
112
112
  "aria-hidden": !0,
113
- className: C(
113
+ className: $(
114
114
  "h-1.5 w-1.5 shrink-0 rounded-full",
115
115
  f ? "bg-amber-500" : "bg-slate-400"
116
116
  )
117
117
  }
118
118
  ),
119
- f ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${$}` : `${l.total} ${$}`,
119
+ f ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${q}` : `${l.total} ${q}`,
120
120
  U && /* @__PURE__ */ d("span", { className: "tabular-nums opacity-80", children: [
121
121
  "· ",
122
122
  U
@@ -125,21 +125,21 @@ function ws({ summary: l }) {
125
125
  }
126
126
  );
127
127
  }
128
- function _s(l) {
129
- return Oo(l);
128
+ function $s(l) {
129
+ return Po(l);
130
130
  }
131
- function Ns({ status: l }) {
132
- 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
+ function qs({ status: l }) {
132
+ return l ? /* @__PURE__ */ r("span", { className: $("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: "—" });
133
133
  }
134
- function Ss({ points: l, inline: f = !1 }) {
134
+ function Fs({ points: l, inline: f = !1 }) {
135
135
  if (l.length < 2) return null;
136
- const $ = f ? 40 : 64, D = f ? 14 : 18, U = Math.max(...l), h = Math.min(...l), p = U - h || 1, v = $ / (l.length - 1), W = l.map(
137
- (pe, g) => `${g === 0 ? "M" : "L"}${(g * v).toFixed(1)},${(D - 2 - (pe - h) / p * (D - 4)).toFixed(1)}`
136
+ const q = f ? 40 : 64, D = f ? 14 : 18, U = Math.max(...l), h = Math.min(...l), p = U - h || 1, v = q / (l.length - 1), W = l.map(
137
+ (he, g) => `${g === 0 ? "M" : "L"}${(g * v).toFixed(1)},${(D - 2 - (he - h) / p * (D - 4)).toFixed(1)}`
138
138
  ).join(" ");
139
139
  return /* @__PURE__ */ r(
140
140
  "svg",
141
141
  {
142
- width: $,
142
+ width: q,
143
143
  height: D,
144
144
  className: f ? "opacity-40" : "mt-1.5 opacity-40",
145
145
  "aria-hidden": "true",
@@ -147,40 +147,40 @@ function Ss({ points: l, inline: f = !1 }) {
147
147
  }
148
148
  );
149
149
  }
150
- function vt({
150
+ function _t({
151
151
  label: l,
152
152
  count: f,
153
- filteredCount: $,
153
+ filteredCount: q,
154
154
  active: D,
155
155
  isLoading: U,
156
156
  tone: h,
157
157
  trend: p,
158
158
  delta: v,
159
159
  deltaBadIsUp: W,
160
- onClick: pe
160
+ onClick: he
161
161
  }) {
162
162
  return /* @__PURE__ */ r(
163
163
  "button",
164
164
  {
165
165
  type: "button",
166
- onClick: pe,
167
- className: C(
166
+ onClick: he,
167
+ className: $(
168
168
  "nvr-section-enter flex items-center gap-1.5 bg-white px-3 py-2 text-left transition-colors hover:bg-slate-50 dark:bg-card dark:hover:bg-card/80",
169
169
  D && "bg-nvr-cyan/5 ring-1 ring-inset ring-nvr-cyan dark:bg-nvr-cyan/10",
170
170
  !D && !U && f === 0 && "opacity-50"
171
171
  ),
172
- children: U ? /* @__PURE__ */ r(ds, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(we, { children: [
173
- /* @__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: [
174
- /* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ r(On, { value: $, format: re }) }),
172
+ children: U ? /* @__PURE__ */ r(ps, { className: "h-5 w-16 rounded" }) : /* @__PURE__ */ d(_e, { children: [
173
+ /* @__PURE__ */ r("span", { className: "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums text-slate-900 dark:text-foreground", children: q != null ? /* @__PURE__ */ d(_e, { children: [
174
+ /* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ r(En, { value: q, format: ae }) }),
175
175
  /* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-400", children: [
176
176
  "/ ",
177
- /* @__PURE__ */ r(On, { value: f, format: re })
177
+ /* @__PURE__ */ r(En, { value: f, format: ae })
178
178
  ] })
179
- ] }) : /* @__PURE__ */ r(On, { value: f, format: re }) }),
179
+ ] }) : /* @__PURE__ */ r(En, { value: f, format: ae }) }),
180
180
  /* @__PURE__ */ r(
181
181
  "span",
182
182
  {
183
- className: C(
183
+ className: $(
184
184
  "text-[11px] font-medium leading-none",
185
185
  h === "red" ? "text-red-500 dark:text-red-400" : h === "amber" ? "text-amber-600 dark:text-amber-400" : "text-slate-400 dark:text-muted-foreground"
186
186
  ),
@@ -190,25 +190,25 @@ function vt({
190
190
  v != null && v !== 0 && /* @__PURE__ */ d(
191
191
  "span",
192
192
  {
193
- className: C(
193
+ className: $(
194
194
  "text-[10px] font-medium leading-none",
195
195
  W ? v > 0 ? "text-red-500" : "text-emerald-600" : "text-slate-400"
196
196
  ),
197
197
  children: [
198
198
  v > 0 ? "↑" : "↓",
199
- re(Math.abs(v))
199
+ ae(Math.abs(v))
200
200
  ]
201
201
  }
202
202
  ),
203
- p && f > 0 && /* @__PURE__ */ r(Ss, { points: p, inline: !0 })
203
+ p && f > 0 && /* @__PURE__ */ r(Fs, { points: p, inline: !0 })
204
204
  ] })
205
205
  }
206
206
  );
207
207
  }
208
- function Cs({
208
+ function Ts({
209
209
  label: l,
210
210
  count: f,
211
- filteredCount: $,
211
+ filteredCount: q,
212
212
  color: D,
213
213
  active: U,
214
214
  onClick: h
@@ -218,7 +218,7 @@ function Cs({
218
218
  {
219
219
  type: "button",
220
220
  onClick: h,
221
- className: C(
221
+ className: $(
222
222
  "flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px] font-medium transition-colors",
223
223
  U ? "border-nvr-cyan bg-nvr-cyan/10 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 bg-white text-slate-600 hover:border-slate-300 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300"
224
224
  ),
@@ -231,32 +231,32 @@ function Cs({
231
231
  }
232
232
  ),
233
233
  l,
234
- /* @__PURE__ */ r("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: $ != null ? /* @__PURE__ */ d(we, { children: [
235
- /* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: re($) }),
234
+ /* @__PURE__ */ r("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: q != null ? /* @__PURE__ */ d(_e, { children: [
235
+ /* @__PURE__ */ r("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ae(q) }),
236
236
  /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
237
237
  " / ",
238
- re(f)
238
+ ae(f)
239
239
  ] })
240
- ] }) : re(f) })
240
+ ] }) : ae(f) })
241
241
  ]
242
242
  }
243
243
  );
244
244
  }
245
- function wt(l) {
246
- return l.split(".").map((f) => f.replace(/_/g, " ").replace(/\b\w/g, ($) => $.toUpperCase())).join(" → ");
245
+ function Nt(l) {
246
+ return l.split(".").map((f) => f.replace(/_/g, " ").replace(/\b\w/g, (q) => q.toUpperCase())).join(" → ");
247
247
  }
248
- function $s({
248
+ function Rs({
249
249
  id: l,
250
250
  label: f,
251
- checked: $,
251
+ checked: q,
252
252
  onCheckedChange: D
253
253
  }) {
254
- const { attributes: U, listeners: h, setNodeRef: p, transform: v, transition: W, isDragging: pe } = El({
254
+ const { attributes: U, listeners: h, setNodeRef: p, transform: v, transition: W, isDragging: he } = Pl({
255
255
  id: l
256
256
  }), g = {
257
- transform: Ll.Transform.toString(v),
257
+ transform: Kl.Transform.toString(v),
258
258
  transition: W,
259
- opacity: pe ? 0.4 : 1
259
+ opacity: he ? 0.4 : 1
260
260
  }, J = `col-toggle-${l}`;
261
261
  return /* @__PURE__ */ d("div", { ref: p, style: g, className: "flex items-center gap-2 text-[12px]", children: [
262
262
  /* @__PURE__ */ r(
@@ -265,42 +265,42 @@ function $s({
265
265
  ...U,
266
266
  ...h,
267
267
  className: "cursor-grab text-slate-300 hover:text-slate-500 dark:text-muted-foreground",
268
- children: /* @__PURE__ */ r(eo, { className: "h-3.5 w-3.5" })
268
+ children: /* @__PURE__ */ r(ao, { className: "h-3.5 w-3.5" })
269
269
  }
270
270
  ),
271
- /* @__PURE__ */ r(En, { id: J, checked: $, onCheckedChange: D }),
272
- /* @__PURE__ */ r(cs, { htmlFor: J, className: "cursor-pointer text-[12px] font-normal", children: f })
271
+ /* @__PURE__ */ r(Ln, { id: J, checked: q, onCheckedChange: D }),
272
+ /* @__PURE__ */ r(bs, { htmlFor: J, className: "cursor-pointer text-[12px] font-normal", children: f })
273
273
  ] });
274
274
  }
275
- function Bi({
275
+ function Vi({
276
276
  queueId: l,
277
277
  realtime: f,
278
- renderError: $,
278
+ renderError: q,
279
279
  hideCreateActions: D = !1,
280
280
  onAsk: U
281
281
  }) {
282
- var Br, jr, Ur, Ir, Vr, Gr, Wr, Hr, Jr, Yr, zr, Xr, Zr, ea, ta, na;
283
- const h = Dl(), p = ba(), { userId: v } = sa(), W = to(), { navigate: pe } = no(), [g, J] = k("all"), [_e, L] = k(1), Ln = B(bo()), [_t, pa] = k(() => {
282
+ var Ur, Ir, Vr, Gr, Wr, Hr, Jr, Yr, zr, Xr, Zr, ea, ta, na, ra, aa;
283
+ const h = Ml(), p = ha(), { userId: v } = ca(), W = lo(), { navigate: he } = oo(), [g, J] = y("all"), [Ne, L] = y(1), Dn = Q(go()), [St, fa] = y(() => {
284
284
  try {
285
285
  return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
286
286
  } catch {
287
287
  return "compact";
288
288
  }
289
- }), [A, Ee] = k("table"), [I, Le] = k(""), [w, K] = k({}), [Nt, Dn] = k(() => /* @__PURE__ */ new Set()), [N, et] = k(null), [he, Jt] = k(/* @__PURE__ */ new Set()), [tt, Yt] = k(null), [St, zt] = k(null), [Xt, Ct] = k(0), Ne = go(), Zt = Co(), en = B({}).current, Pn = B(/* @__PURE__ */ new Set()), [ha, fa] = k(0), [Kn, ga] = k(0), De = B(!1), $t = B([]), Mn = B(null), Qn = B(!1), Bn = B(0), tn = B("table");
290
- tn.current = A;
291
- const nn = 25, { data: s, error: qt } = H({
289
+ }), [S, Le] = y("table"), [I, De] = y(""), [w, K] = y({}), [Ct, Pn] = y(() => /* @__PURE__ */ new Set()), [N, nt] = y(null), [fe, zt] = y(/* @__PURE__ */ new Set()), [rt, Xt] = y(null), [$t, Zt] = y(null), [en, qt] = y(0), Se = vo(), tn = To(), nn = Q({}).current, Kn = Q(/* @__PURE__ */ new Set()), [ga, xa] = y(0), [Mn, ya] = y(0), Pe = Q(!1), Ft = Q([]), Bn = Q(null), Qn = Q(!1), jn = Q(0), rn = Q("table");
290
+ rn.current = S;
291
+ const an = 25, { data: s, error: Tt } = H({
292
292
  queryKey: ["queue-meta", l],
293
293
  queryFn: () => p.request(E(`/queues/${l}`)).then((e) => e.data),
294
294
  enabled: !!l
295
- }), { scopes: nt, ready: jn } = Fo(), Un = B(!1), [In, Vn] = k(!1), [Se, xa] = k({}), oe = B({});
295
+ }), { scopes: at, ready: Un } = Oo(), In = Q(!1), [Vn, Gn] = y(!1), [Ce, ka] = y({}), se = Q({});
296
296
  j(() => {
297
- if (Un.current || !jn || !s) return;
298
- Un.current = !0;
297
+ if (In.current || !Un || !s) return;
298
+ In.current = !0;
299
299
  const e = (s.extra_field_meta ?? []).filter(
300
300
  (t) => t.kind === "relation" && t.target_collection && t.display_field
301
301
  );
302
- if (e.length === 0 || !nt) {
303
- Vn(!0);
302
+ if (e.length === 0 || !at) {
303
+ Gn(!0);
304
304
  return;
305
305
  }
306
306
  (async () => {
@@ -319,67 +319,67 @@ function Bi({
319
319
  ];
320
320
  };
321
321
  for (const o of e) {
322
- const c = To(nt, { collection: o.target_collection });
322
+ const c = Eo(at, { collection: o.target_collection });
323
323
  if (!c) continue;
324
324
  const b = `extra.${o.path}`;
325
325
  try {
326
- const m = nt.restricted[c.name] ?? [];
326
+ const m = at.restricted[c.name] ?? [];
327
327
  if (m.length > 0) {
328
- const T = await a(o, m);
329
- T.length > 0 && (n[b.slice(6)] = T);
328
+ const R = await a(o, m);
329
+ R.length > 0 && (n[b.slice(6)] = R);
330
330
  }
331
- const O = Ro(nt, c.name);
331
+ const O = Lo(at, c.name);
332
332
  if (O.length === 0) continue;
333
- const F = w[b];
334
- if (F && (Array.isArray(F) ? F.length > 0 : F !== ""))
333
+ const T = w[b];
334
+ if (T && (Array.isArray(T) ? T.length > 0 : T !== ""))
335
335
  continue;
336
- const y = O.length ? await a(o, O) : [];
337
- y.length > 0 && (t[b] = y);
336
+ const k = O.length ? await a(o, O) : [];
337
+ k.length > 0 && (t[b] = k);
338
338
  } catch {
339
339
  }
340
340
  }
341
- Object.keys(n).length > 0 && xa(n), Object.keys(t).length > 0 && (oe.current = t, K((o) => ({ ...o, ...t }))), Vn(!0);
341
+ Object.keys(n).length > 0 && ka(n), Object.keys(t).length > 0 && (se.current = t, K((o) => ({ ...o, ...t }))), Gn(!0);
342
342
  })();
343
- }, [jn, nt, s]);
344
- const Pe = ((jr = (Br = s == null ? void 0 : s.sources) == null ? void 0 : Br.find((e) => e.type === "collection")) == null ? void 0 : jr.collection) ?? null, { data: Gn = [] } = H({
345
- queryKey: ["queue-browser-quick-filters", Pe],
346
- queryFn: () => p.request(E(`/collections/${Pe}`)).then((e) => {
343
+ }, [Un, at, s]);
344
+ const Ke = ((Ir = (Ur = s == null ? void 0 : s.sources) == null ? void 0 : Ur.find((e) => e.type === "collection")) == null ? void 0 : Ir.collection) ?? null, { data: Wn = [] } = H({
345
+ queryKey: ["queue-browser-quick-filters", Ke],
346
+ queryFn: () => p.request(E(`/collections/${Ke}`)).then((e) => {
347
347
  var t, n;
348
348
  return ((n = (t = e.data) == null ? void 0 : t.browser_config) == null ? void 0 : n.quick_filters) ?? [];
349
349
  }).catch(() => []),
350
- enabled: !!Pe,
350
+ enabled: !!Ke,
351
351
  staleTime: 3e5
352
- }), z = G(() => {
352
+ }), X = G(() => {
353
353
  const e = /* @__PURE__ */ new Set(), t = [];
354
354
  for (const n of (s == null ? void 0 : s.sources) ?? [])
355
355
  n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
356
356
  return t;
357
- }, [s == null ? void 0 : s.sources]), Ft = Ao(
358
- z.length === 1 ? z[0] : null
359
- ), rn = D === !0 || Array.isArray(D) && z.length > 0 && z.every((e) => D.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"], ya = (u == null ? void 0 : u.work_next) !== !1, an = (u == null ? void 0 : u.bulk_actions) !== !1, ln = Mo(
357
+ }, [s == null ? void 0 : s.sources]), Rt = Do(
358
+ X.length === 1 ? X[0] : null
359
+ ), ln = D === !0 || Array.isArray(D) && X.length > 0 && X.every((e) => D.includes(e)), ie = (s == null ? void 0 : s.claims_enabled) !== !1, u = s == null ? void 0 : s.display_config, $e = (u == null ? void 0 : u.views) ?? ["table", "kanban", "workload"], va = (u == null ? void 0 : u.work_next) !== !1, At = (u == null ? void 0 : u.bulk_actions) !== !1, on = Uo(
360
360
  [
361
361
  ...new Set(
362
362
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
363
363
  )
364
364
  ],
365
365
  (u == null ? void 0 : u.bulk_action_keys) ?? null
366
- ), q = (e, t) => {
366
+ ), F = (e, t) => {
367
367
  var n, a;
368
368
  return ((a = (n = s == null ? void 0 : s.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : a.trim()) || t;
369
- }, Wn = B(!1);
369
+ }, Hn = Q(!1);
370
370
  j(() => {
371
- !s || Wn.current || (Wn.current = !0, Le("-priority"));
371
+ !s || Hn.current || (Hn.current = !0, De("-priority"));
372
372
  }, [s]);
373
- const [ae, ka] = k(!1);
373
+ const [le, wa] = y(!1);
374
374
  j(() => {
375
- s != null && s.display_config && !Ce.includes(A) && Ee(Ce[0]);
376
- }, [s, A, Ce]), j(() => {
375
+ s != null && s.display_config && !$e.includes(S) && Le($e[0]);
376
+ }, [s, S, $e]), j(() => {
377
377
  if (!(s != null && s.sources)) return;
378
- const e = Zt ? (y, T) => Zt.subscribeCollections(y, T) : f == null ? void 0 : f.subscribe;
378
+ const e = tn ? (k, R) => tn.subscribeCollections(k, R) : f == null ? void 0 : f.subscribe;
379
379
  if (!e) return;
380
380
  const t = [
381
381
  ...new Set(
382
- s.sources.filter((y) => y.type === "collection" && y.collection).map((y) => y.collection)
382
+ s.sources.filter((k) => k.type === "collection" && k.collection).map((k) => k.collection)
383
383
  )
384
384
  ];
385
385
  if (t.length === 0) return;
@@ -387,42 +387,42 @@ function Bi({
387
387
  let a = null, o = null, c = null;
388
388
  const b = () => {
389
389
  c || (c = setTimeout(() => {
390
- c = null, ga((y) => y + 1);
390
+ c = null, ya((k) => k + 1);
391
391
  }, 1500));
392
392
  }, m = () => {
393
393
  o || (o = setTimeout(() => {
394
- if (o = null, Bn.current > 0 || Qn.current) {
395
- $t.current = [], Ct((y) => y + 1);
394
+ if (o = null, jn.current > 0 || Qn.current) {
395
+ Ft.current = [], qt((k) => k + 1);
396
396
  return;
397
397
  }
398
- De.current = !0, h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] });
398
+ Pe.current = !0, h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] });
399
399
  }, 900));
400
- }, O = (y) => {
401
- let T = !1, Q = 0, ke = !1;
402
- const Oe = y.flatMap(
403
- (_) => _ ? fo(_) : [_]
400
+ }, O = (k) => {
401
+ let R = !1, B = 0, ve = !1;
402
+ const Ee = k.flatMap(
403
+ (_) => _ ? ko(_) : [_]
404
404
  );
405
- for (const _ of Oe) {
406
- const be = _ == null ? void 0 : _.changed_fields, Gt = (_ == null ? void 0 : _.collection) != null ? `${_.collection}:${String(_.item)}` : null, ra = Gt != null && Pn.current.has(Gt);
407
- if (_ && !_.action && (be != null && be.length) && be.every((gt) => gt.startsWith("$"))) {
408
- 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) && fa((gt) => gt + 1), be.includes(xt.state) && (ke = !0, (ra || tn.current === "kanban") && (T = !0)), a || (a = setTimeout(() => {
405
+ for (const _ of Ee) {
406
+ const pe = _ == null ? void 0 : _.changed_fields, Ht = (_ == null ? void 0 : _.collection) != null ? `${_.collection}:${String(_.item)}` : null, la = Ht != null && Kn.current.has(Ht);
407
+ if (_ && !_.action && (pe != null && pe.length) && pe.every((yt) => yt.startsWith("$"))) {
408
+ pe.includes(kt.tasks) && n.add("queue-task-counts"), pe.includes(kt.integrations) && n.add("queue-integrations-summary"), pe.includes(kt.addendums) && n.add("queue-collection-addendums"), pe.includes(kt.lock) && xa((yt) => yt + 1), pe.includes(kt.state) && (ve = !0, (la || rn.current === "kanban") && (R = !0)), a || (a = setTimeout(() => {
409
409
  a = null;
410
- for (const gt of n) h.invalidateQueries({ queryKey: [gt] });
410
+ for (const yt of n) h.invalidateQueries({ queryKey: [yt] });
411
411
  n.clear();
412
412
  }, 300));
413
413
  continue;
414
414
  }
415
- ke = !0;
416
- const Sl = (_ == null ? void 0 : _.collection) != null && wo(_.collection, _.item);
417
- Gt && (ra || (_ == null ? void 0 : _.action) === "create" || tn.current === "kanban") ? (T = !0, Sl || $t.current.push({ key: Gt, by: null })) : Q += 1;
415
+ ve = !0;
416
+ const ql = (_ == null ? void 0 : _.collection) != null && Co(_.collection, _.item);
417
+ Ht && (la || (_ == null ? void 0 : _.action) === "create" || rn.current === "kanban") ? (R = !0, ql || Ft.current.push({ key: Ht, by: null })) : B += 1;
418
418
  }
419
- Q > 0 && Ct((_) => _ + Q), T && m(), ke && b();
420
- }, F = e(t, (y) => co(en, [y ?? {}], O));
419
+ B > 0 && qt((_) => _ + B), R && m(), ve && b();
420
+ }, T = e(t, (k) => po(nn, [k ?? {}], O));
421
421
  return () => {
422
- F(), uo(en), a && clearTimeout(a), o && clearTimeout(o), c && clearTimeout(c);
422
+ T(), ho(nn), a && clearTimeout(a), o && clearTimeout(o), c && clearTimeout(c);
423
423
  };
424
- }, [Zt, f, s == null ? void 0 : s.sources, h, l, v, en]);
425
- const Ke = ao(w, 350), va = JSON.stringify(Ke) === JSON.stringify(w), on = B(!1), $e = A === "table" && !!N, Hn = (() => {
424
+ }, [tn, f, s == null ? void 0 : s.sources, h, l, v, nn]);
425
+ const Me = io(w, 350), _a = JSON.stringify(Me) === JSON.stringify(w), sn = Q(!1), qe = S === "table" && !!N, Jn = (() => {
426
426
  const e = /* @__PURE__ */ new Set();
427
427
  for (const t of (s == null ? void 0 : s.extra_field_meta) ?? [])
428
428
  t.aggregate && t.aggregate !== "count" && e.add(t.path);
@@ -432,9 +432,9 @@ function Bi({
432
432
  t.type === "addendums" && e.add("cost_impact");
433
433
  }
434
434
  return [...e].slice(0, 12);
435
- })(), fe = (() => {
435
+ })(), ge = (() => {
436
436
  const e = {};
437
- for (const [t, n] of Object.entries(Ke))
437
+ for (const [t, n] of Object.entries(Me))
438
438
  if (n) {
439
439
  if (Array.isArray(n)) {
440
440
  n.length > 0 && (e[t] = n);
@@ -449,20 +449,20 @@ function Bi({
449
449
  }
450
450
  return e;
451
451
  })();
452
- function Me(e, t) {
452
+ function Be(e, t) {
453
453
  K((n) => ({ ...n, [e]: n[e] === t ? "" : t })), L(1);
454
454
  }
455
- function wa(e) {
455
+ function Na(e) {
456
456
  K((t) => {
457
457
  const n = t.state, a = Array.isArray(n) ? n : n ? [n] : [], o = a.includes(e) ? a.filter((c) => c !== e) : [...a, e];
458
458
  return { ...t, state: o };
459
459
  }), L(1);
460
460
  }
461
- const _a = Array.isArray(w.state) ? w.state : w.state ? [w.state] : [], Na = (e) => !e || Array.isArray(e) && e.length === 0;
462
- function Sa() {
463
- K({ ...oe.current }), J("all"), L(1);
461
+ const Sa = Array.isArray(w.state) ? w.state : w.state ? [w.state] : [], Ca = (e) => !e || Array.isArray(e) && e.length === 0;
462
+ function $a() {
463
+ K({ ...se.current }), J("all"), L(1);
464
464
  }
465
- const [rt, Ca] = k(() => {
465
+ const [lt, qa] = y(() => {
466
466
  try {
467
467
  return localStorage.getItem("nvr_queue_insights_open") === "1";
468
468
  } catch {
@@ -471,36 +471,36 @@ function Bi({
471
471
  });
472
472
  j(() => {
473
473
  try {
474
- localStorage.setItem("nvr_queue_insights_open", rt ? "1" : "0");
474
+ localStorage.setItem("nvr_queue_insights_open", lt ? "1" : "0");
475
475
  } catch {
476
476
  }
477
- }, [rt]);
478
- const { data: $a = [] } = H({
477
+ }, [lt]);
478
+ const { data: Fa = [] } = H({
479
479
  queryKey: ["queue-view-subs", l],
480
480
  queryFn: () => p.request(E("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
481
481
  staleTime: 3e4
482
- }), Tt = (e) => $a.find((t) => t.queue_view_id === e), qa = (e) => {
483
- const t = Tt(e);
484
- (t ? p.request(Rn(`/notification-subscriptions/${t.id}`)) : p.request(
485
- ne("/notification-subscriptions", {
482
+ }), Ot = (e) => Fa.find((t) => t.queue_view_id === e), Ta = (e) => {
483
+ const t = Ot(e);
484
+ (t ? p.request(An(`/notification-subscriptions/${t.id}`)) : p.request(
485
+ re("/notification-subscriptions", {
486
486
  queue_id: l,
487
487
  queue_view_id: e,
488
488
  digest_frequency: "instant"
489
489
  })
490
490
  )).then(() => {
491
- R.success(
491
+ A.success(
492
492
  t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
493
493
  ), h.invalidateQueries({ queryKey: ["queue-view-subs", l] });
494
- }).catch((a) => R.error(yt(a, "Failed")));
495
- }, [Jn, sn] = k(null), cn = [
494
+ }).catch((a) => A.error(vt(a, "Failed")));
495
+ }, [Yn, cn] = y(null), dn = [
496
496
  ...new Set(
497
497
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
498
498
  )
499
- ], { data: Fa = {} } = H({
500
- queryKey: ["queue-custom-actions", l, cn.join(",")],
499
+ ], { data: Ra = {} } = H({
500
+ queryKey: ["queue-custom-actions", l, dn.join(",")],
501
501
  queryFn: async () => {
502
502
  const e = {};
503
- for (const t of cn.slice(0, 6))
503
+ for (const t of dn.slice(0, 6))
504
504
  try {
505
505
  const n = await p.request(
506
506
  E("/custom-actions", { collection: t })
@@ -511,65 +511,65 @@ function Bi({
511
511
  }
512
512
  return e;
513
513
  },
514
- enabled: cn.length > 0,
514
+ enabled: dn.length > 0,
515
515
  staleTime: 6e4
516
- }), Ta = (e) => Fa[e] ?? [], Ra = (e, t) => {
517
- p.request(ne(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
518
- R.success(`${e.label} ran`), h.invalidateQueries({ queryKey: ["queue-items", l] });
516
+ }), Aa = (e) => Ra[e] ?? [], Oa = (e, t) => {
517
+ p.request(re(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
518
+ A.success(`${e.label} ran`), h.invalidateQueries({ queryKey: ["queue-items", l] });
519
519
  }).catch((n) => {
520
520
  const a = n.response;
521
- R.error((a == null ? void 0 : a.error) ?? yt(n, `${e.label} failed`));
521
+ A.error((a == null ? void 0 : a.error) ?? vt(n, `${e.label} failed`));
522
522
  });
523
- }, { data: dn = [] } = H({
523
+ }, { data: un = [] } = H({
524
524
  queryKey: ["queue-triage-labels", l],
525
525
  queryFn: () => p.request(E(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
526
526
  staleTime: 3e4
527
- }), Yn = (e, t) => {
527
+ }), zn = (e, t) => {
528
528
  p.request(
529
- ne(`/queues/${l}/triage-labels/toggle`, {
529
+ re(`/queues/${l}/triage-labels/toggle`, {
530
530
  collection: e.collection,
531
531
  item_id: e.item_id,
532
532
  label: t
533
533
  })
534
534
  ).then(() => {
535
535
  h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
536
- }).catch((n) => R.error(yt(n, "Label failed")));
536
+ }).catch((n) => A.error(vt(n, "Label failed")));
537
537
  }, {
538
538
  data: i,
539
- isLoading: zn,
540
- isFetching: Rt,
541
- isPlaceholderData: Aa,
542
- dataUpdatedAt: le,
543
- isError: Xn,
544
- error: Oa,
545
- refetch: Ea
539
+ isLoading: Xn,
540
+ isFetching: Et,
541
+ isPlaceholderData: Ea,
542
+ dataUpdatedAt: oe,
543
+ isError: Zn,
544
+ error: La,
545
+ refetch: Da
546
546
  } = H({
547
547
  queryKey: [
548
548
  "queue-items",
549
549
  l,
550
550
  g,
551
551
  I,
552
- Ke,
553
- A === "table" && !N ? _e : "all",
552
+ Me,
553
+ S === "table" && !N ? Ne : "all",
554
554
  N
555
555
  ],
556
556
  queryFn: async () => {
557
- const e = !$e && A === "table", t = JSON.stringify([l, g, I, fe, nn]), n = e ? po(Ln.current, t, _e, "").after : void 0, a = await p.request(
557
+ const e = !qe && S === "table", t = JSON.stringify([l, g, I, ge, an]), n = e ? xo(Dn.current, t, Ne, "").after : void 0, a = await p.request(
558
558
  E(`/queues/${l}/items`, {
559
559
  scope: g,
560
560
  // Last State Change is Aging read the other way round: the newest
561
561
  // move is the least aged.
562
562
  sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
563
- filters: JSON.stringify(fe),
563
+ filters: JSON.stringify(ge),
564
564
  // Table + group: headers only (rows load per group on expand, #741).
565
565
  // Kanban renders the full matching set, grouped client-side.
566
- ...$e ? {
566
+ ...qe ? {
567
567
  group_by: N,
568
- ...Hn.length ? { group_sums: Hn.join(",") } : {}
569
- } : A === "table" ? { page: _e, limit: nn, ...n ? { after: n } : {} } : {}
568
+ ...Jn.length ? { group_sums: Jn.join(",") } : {}
569
+ } : S === "table" ? { page: Ne, limit: an, ...n ? { after: n } : {} } : {}
570
570
  })
571
571
  );
572
- return n && ho(Ln.current, t, _e, a.next_cursor), a;
572
+ return n && yo(Dn.current, t, Ne, a.next_cursor), a;
573
573
  },
574
574
  // Wait for display_config AND scope seeding so the first fetch uses the
575
575
  // configured defaults and already carries the viewer's restricted filters.
@@ -578,33 +578,33 @@ function Bi({
578
578
  // first fetch went out WITHOUT the seeded scope and refired ~350ms later
579
579
  // with it (3.3s + 8.7s of work for one page). The first fetch now also
580
580
  // waits for the debounced copy to settle; later typing still debounces.
581
- enabled: !!l && ae && In && (on.current || va),
581
+ enabled: !!l && le && Vn && (sn.current || _a),
582
582
  // Keep the previous page rendered while a sort/filter/page change refetches —
583
583
  // swapping to skeletons collapsed the table height and jittered the page.
584
584
  placeholderData: (e) => e
585
585
  });
586
- i && !on.current && (on.current = !0);
587
- const Qe = Object.entries(oe.current).filter(
586
+ i && !sn.current && (sn.current = !0);
587
+ const Qe = Object.entries(se.current).filter(
588
588
  ([e, t]) => {
589
589
  var n;
590
- return !((n = Se[e.slice(6)]) != null && n.length) && JSON.stringify(fe[e] ?? null) === JSON.stringify(t);
590
+ return !((n = Ce[e.slice(6)]) != null && n.length) && JSON.stringify(ge[e] ?? null) === JSON.stringify(t);
591
591
  }
592
- ).map(([e]) => e), Zn = Qe.length > 0 && Object.keys(fe).every((e) => Qe.includes(e)), er = Object.fromEntries(
593
- Object.entries(fe).filter(([e]) => !Qe.includes(e))
594
- ), { data: La } = H({
595
- queryKey: ["queue-default-hidden", l, g, er],
596
- enabled: !!l && !!i && !Rt && i.total === 0 && ((Ur = i.empty) == null ? void 0 : Ur.reason) === "filters" && Qe.length > 0 && !Zn,
592
+ ).map(([e]) => e), er = Qe.length > 0 && Object.keys(ge).every((e) => Qe.includes(e)), tr = Object.fromEntries(
593
+ Object.entries(ge).filter(([e]) => !Qe.includes(e))
594
+ ), { data: Pa } = H({
595
+ queryKey: ["queue-default-hidden", l, g, tr],
596
+ enabled: !!l && !!i && !Et && i.total === 0 && ((Vr = i.empty) == null ? void 0 : Vr.reason) === "filters" && Qe.length > 0 && !er,
597
597
  staleTime: 3e4,
598
598
  retry: !1,
599
599
  queryFn: () => p.request(
600
600
  E(`/queues/${l}/items`, {
601
601
  scope: g,
602
- filters: JSON.stringify(er),
602
+ filters: JSON.stringify(tr),
603
603
  page: 1,
604
604
  limit: 1
605
605
  })
606
606
  ).then((e) => Number(e.total ?? 0))
607
- }), ie = Zn ? Math.max(0, (((Ir = i == null ? void 0 : i.stats) == null ? void 0 : Ir.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : La ?? 0, tr = (e) => Qe.map(e).join(" and "), nr = () => {
607
+ }), ce = er ? Math.max(0, (((Gr = i == null ? void 0 : i.stats) == null ? void 0 : Gr.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : Pa ?? 0, nr = (e) => Qe.map(e).join(" and "), rr = () => {
608
608
  K((e) => {
609
609
  const t = { ...e };
610
610
  for (const n of Qe) delete t[n];
@@ -612,24 +612,24 @@ function Bi({
612
612
  }), L(1);
613
613
  };
614
614
  j(() => {
615
- if (typeof window > "u" || !le) return;
615
+ if (typeof window > "u" || !oe) return;
616
616
  const e = window;
617
617
  e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
618
618
  const t = e.__nvrQueueTrace, n = {
619
619
  queue: l,
620
- at: le,
620
+ at: oe,
621
621
  scope: g,
622
622
  sort: I,
623
- filters: JSON.stringify(Ke),
624
- page: _e
623
+ filters: JSON.stringify(Me),
624
+ page: Ne
625
625
  }, a = t.find((o) => o.queue === l);
626
- 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 });
627
- }, [le]);
628
- const Be = zn && !i || !ae || !In && !i, rr = (Rt && !zn || Aa && Rt) && !De.current, Da = G(
629
- () => ($e ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
630
- [$e, i == null ? void 0 : i.data]
631
- ), Pa = _o(Da), At = gs(), ar = lo(Rt && !De.current);
632
- async function lr(e, t) {
626
+ t.push(n), t.length > 50 && t.shift(), a && a !== n && oe - Number(a.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: a, second: n });
627
+ }, [oe]);
628
+ const je = Xn && !i || !le || !Vn && !i, ar = (Et && !Xn || Ea && Et) && !Pe.current, Ka = G(
629
+ () => (qe ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((e) => ({ collection: e.collection, item: e.item_id })),
630
+ [qe, i == null ? void 0 : i.data]
631
+ ), Ma = $o(Ka), Lt = vs(), lr = co(Et && !Pe.current);
632
+ async function or(e, t) {
633
633
  var m;
634
634
  const a = (await p.request(E(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
635
635
  if (!a || a.states.length === 0)
@@ -641,62 +641,62 @@ function Bi({
641
641
  );
642
642
  if (!c) throw new Error("No transition available to move this item here");
643
643
  let b = null;
644
- if (xs(c) && (b = await At.ask(((m = c.label) == null ? void 0 : m.trim()) || "Move"), !b))
644
+ if (ws(c) && (b = await Lt.ask(((m = c.label) == null ? void 0 : m.trim()) || "Move"), !b))
645
645
  throw new Error("Not moved — this move needs a note");
646
646
  await p.request(
647
- ne(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
647
+ re(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
648
648
  transition_id: c.id,
649
649
  ...b ? { comment: b } : {}
650
650
  })
651
651
  );
652
652
  }
653
- const Ka = ve({
653
+ const Ba = we({
654
654
  mutationFn: async ({ item: e, targetState: t }) => {
655
- await lr(e, t);
655
+ await or(e, t);
656
656
  },
657
657
  onSuccess: () => {
658
658
  h.invalidateQueries({ queryKey: ["queue-items", l, g] });
659
659
  },
660
660
  onError: (e) => {
661
- R.error(yt(e, "Failed to move item")), h.invalidateQueries({ queryKey: ["queue-items", l, g] });
661
+ A.error(vt(e, "Failed to move item")), h.invalidateQueries({ queryKey: ["queue-items", l, g] });
662
662
  }
663
- }), qe = ve({
663
+ }), Fe = we({
664
664
  mutationFn: (e) => p.request(
665
- ne(`/queues/${l}/claim`, {
665
+ re(`/queues/${l}/claim`, {
666
666
  source_collection: e.collection,
667
667
  item_id: e.item_id
668
668
  })
669
669
  ),
670
670
  onSuccess: () => h.invalidateQueries({ queryKey: ["queue-items", l, g] }),
671
- onError: () => R.error("Failed to claim item")
672
- }), je = ve({
671
+ onError: () => A.error("Failed to claim item")
672
+ }), Ue = we({
673
673
  mutationFn: (e) => p.request(
674
- ne(`/queues/${l}/release`, {
674
+ re(`/queues/${l}/release`, {
675
675
  source_collection: e.collection,
676
676
  item_id: e.item_id
677
677
  })
678
678
  ),
679
679
  onSuccess: () => h.invalidateQueries({ queryKey: ["queue-items", l, g] }),
680
- onError: () => R.error("Failed to release item")
681
- }), { data: Ue } = H({
680
+ onError: () => A.error("Failed to release item")
681
+ }), { data: Ie } = H({
682
682
  queryKey: ["queue-column-prefs", l],
683
683
  queryFn: () => p.request(E(`/queues/${l}/column-prefs`)),
684
684
  enabled: !!l
685
- }), [un, Ot] = k(null), [Ie, mn] = k(null);
685
+ }), [mn, Dt] = y(null), [Ve, bn] = y(null);
686
686
  j(() => {
687
- Ue && mn(Ue.data.default_view_id);
688
- }, [Ue]);
689
- const [Ma, or] = k({}), ce = $e ? (i == null ? void 0 : i.groups) ?? null : null, Et = (ce ?? []).filter((e) => !he.has(e.key)).map((e) => e.key).flatMap(
690
- (e) => Array.from({ length: Ma[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
691
- ), bn = Je({
692
- queries: Et.map(({ key: e, page: t }) => ({
687
+ Ie && bn(Ie.data.default_view_id);
688
+ }, [Ie]);
689
+ const [Qa, sr] = y({}), de = qe ? (i == null ? void 0 : i.groups) ?? null : null, Pt = (de ?? []).filter((e) => !fe.has(e.key)).map((e) => e.key).flatMap(
690
+ (e) => Array.from({ length: Qa[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
691
+ ), pn = ze({
692
+ queries: Pt.map(({ key: e, page: t }) => ({
693
693
  queryKey: [
694
694
  "queue-items",
695
695
  l,
696
696
  "group-rows",
697
697
  g,
698
698
  I,
699
- Ke,
699
+ Me,
700
700
  N,
701
701
  e,
702
702
  t
@@ -705,115 +705,115 @@ function Bi({
705
705
  E(`/queues/${l}/items`, {
706
706
  scope: g,
707
707
  sort: I === "state_entered" ? "-aging_hours" : I === "-state_entered" ? "aging_hours" : I,
708
- filters: JSON.stringify(fe),
708
+ filters: JSON.stringify(ge),
709
709
  group_by: N,
710
710
  group_key: e,
711
711
  page: t,
712
- limit: ks
712
+ limit: Ns
713
713
  })
714
714
  ).then((n) => ({ key: e, rows: n.data })),
715
- enabled: !!i && $e,
715
+ enabled: !!i && qe,
716
716
  placeholderData: (n) => n
717
717
  }))
718
- }), Qa = bn.map((e) => e.dataUpdatedAt).join(","), pn = G(() => {
718
+ }), ja = pn.map((e) => e.dataUpdatedAt).join(","), hn = G(() => {
719
719
  const e = /* @__PURE__ */ new Map();
720
- return bn.forEach((t, n) => {
720
+ return pn.forEach((t, n) => {
721
721
  if (!t.data) return;
722
- const a = Et[n].key;
722
+ const a = Pt[n].key;
723
723
  e.set(a, [...e.get(a) ?? [], ...t.data.rows]);
724
724
  }), e;
725
- }, [Qa, Et.map((e) => `${e.key}\0${e.page}`).join("")]), Ba = new Set(
726
- bn.flatMap((e, t) => e.isFetching ? [Et[t].key] : [])
727
- ), S = ce ? [...pn.values()].flat() : (i == null ? void 0 : i.data) ?? [];
728
- Po(
725
+ }, [ja, Pt.map((e) => `${e.key}\0${e.page}`).join("")]), Ua = new Set(
726
+ pn.flatMap((e, t) => e.isFetching ? [Pt[t].key] : [])
727
+ ), C = de ? [...hn.values()].flat() : (i == null ? void 0 : i.data) ?? [];
728
+ Qo(
729
729
  l ? {
730
730
  queue: {
731
731
  id: l,
732
732
  label: s == null ? void 0 : s.name,
733
733
  scope: g,
734
- filters: JSON.stringify(fe),
735
- items: S.slice(0, 100).map((e) => ({ collection: e.collection, id: e.item_id }))
734
+ filters: JSON.stringify(ge),
735
+ items: C.slice(0, 100).map((e) => ({ collection: e.collection, id: e.item_id }))
736
736
  }
737
737
  } : null
738
738
  );
739
- const ja = Ko(), at = S.some((e) => e.fulfilment !== void 0), lt = S.some((e) => e.send_backs !== void 0), { data: Lt, dataUpdatedAt: Ua } = H({
740
- queryKey: ["queue-live-stats", l, g, Ke, Kn],
739
+ const Ia = jo(), ot = C.some((e) => e.fulfilment !== void 0), st = C.some((e) => e.send_backs !== void 0), { data: Kt, dataUpdatedAt: Va } = H({
740
+ queryKey: ["queue-live-stats", l, g, Me, Mn],
741
741
  queryFn: () => p.request(
742
742
  E(`/queues/${l}/items`, {
743
743
  scope: g,
744
- filters: JSON.stringify(fe),
744
+ filters: JSON.stringify(ge),
745
745
  page: 1,
746
746
  limit: 1
747
747
  })
748
748
  ),
749
- enabled: Kn > 0 && !!i,
749
+ enabled: Mn > 0 && !!i,
750
750
  staleTime: Number.POSITIVE_INFINITY,
751
751
  placeholderData: (e) => e,
752
752
  retry: !1
753
- }), hn = !!Lt && Ua > le, x = hn ? Lt.stats : i == null ? void 0 : i.stats, Y = hn ? Lt.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, sr = hn ? Lt.state_counts : i == null ? void 0 : i.state_counts;
754
- Pn.current = new Set(S.map((e) => `${e.collection}:${e.item_id}`));
755
- const Dt = xo(
756
- S.map((e) => ({ collection: e.collection, id: e.item_id })),
757
- ha
758
- ), ir = B(le), cr = B(0);
759
- !De.current && le !== cr.current && (ir.current = le), j(() => {
760
- const e = new Set(S.map((t) => `${t.collection}:${t.item_id}`));
761
- if (De.current) {
762
- De.current = !1, cr.current = le;
763
- const t = $t.current;
764
- $t.current = [];
765
- const n = Mn.current, a = /* @__PURE__ */ new Set();
753
+ }), fn = !!Kt && Va > oe, x = fn ? Kt.stats : i == null ? void 0 : i.stats, Y = fn ? Kt.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, ir = fn ? Kt.state_counts : i == null ? void 0 : i.state_counts;
754
+ Kn.current = new Set(C.map((e) => `${e.collection}:${e.item_id}`));
755
+ const Mt = wo(
756
+ C.map((e) => ({ collection: e.collection, id: e.item_id })),
757
+ ga
758
+ ), cr = Q(oe), dr = Q(0);
759
+ !Pe.current && oe !== dr.current && (cr.current = oe), j(() => {
760
+ const e = new Set(C.map((t) => `${t.collection}:${t.item_id}`));
761
+ if (Pe.current) {
762
+ Pe.current = !1, dr.current = oe;
763
+ const t = Ft.current;
764
+ Ft.current = [];
765
+ const n = Bn.current, a = /* @__PURE__ */ new Set();
766
766
  for (const o of t)
767
- !e.has(o.key) || a.has(o.key) || (a.add(o.key), Ne.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
767
+ !e.has(o.key) || a.has(o.key) || (a.add(o.key), Se.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
768
768
  if (n) {
769
769
  const o = [...e].filter((c) => !n.has(c) && !a.has(c));
770
- o.length > 0 && o.length <= 20 && Ne.note(o, null, "create");
770
+ o.length > 0 && o.length <= 20 && Se.note(o, null, "create");
771
771
  }
772
772
  }
773
- Mn.current = e;
774
- }, [le]), j(() => {
775
- Ct(0);
773
+ Bn.current = e;
774
+ }, [oe]), j(() => {
775
+ qt(0);
776
776
  }, [i]);
777
- function Ia() {
778
- h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] }), Ct(0);
777
+ function Ga() {
778
+ h.invalidateQueries({ queryKey: ["queue-items", l] }), h.invalidateQueries({ queryKey: ["queue-workload", l] }), qt(0);
779
779
  }
780
- const { data: de } = H({
780
+ const { data: ue } = H({
781
781
  queryKey: ["queue-trends", l],
782
782
  queryFn: () => p.request(E(`/queues/${l}/trends`, { days: 14 })),
783
783
  enabled: !!l,
784
784
  staleTime: 300 * 1e3
785
- }), { data: ue } = H({
785
+ }), { data: me } = H({
786
786
  queryKey: ["queue-trends", l, "mine"],
787
787
  queryFn: () => p.request(E(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
788
788
  enabled: !!l && g === "mine",
789
789
  staleTime: 300 * 1e3
790
790
  });
791
- function ot(e) {
792
- const n = (g === "all" ? de == null ? void 0 : de.data : g === "mine" ? ue == null ? void 0 : ue.data : void 0) ?? [];
791
+ function it(e) {
792
+ const n = (g === "all" ? ue == null ? void 0 : ue.data : g === "mine" ? me == null ? void 0 : me.data : void 0) ?? [];
793
793
  if (n.length === 0) return {};
794
794
  const a = n.map((c) => c[e]), o = n[n.length - 1];
795
795
  return { trend: a, delta: ((x == null ? void 0 : x[e]) ?? 0) - o[e] };
796
796
  }
797
- const me = G(() => {
798
- const t = (g === "all" ? de == null ? void 0 : de.data : g === "mine" ? ue == null ? void 0 : ue.data : void 0) ?? [];
797
+ const be = G(() => {
798
+ const t = (g === "all" ? ue == null ? void 0 : ue.data : g === "mine" ? me == null ? void 0 : me.data : void 0) ?? [];
799
799
  if (t.length < 3 || !x) return null;
800
800
  const n = t.map(
801
801
  (b) => g === "mine" ? b.owned ?? b.total : b.total
802
802
  ), a = n.slice(1).map((b, m) => b - n[m]), o = a.reduce((b, m) => b + m, 0) / a.length, c = x.total;
803
803
  return Math.abs(o) < 0.05 ? { dir: "flat", pace: o, days: null } : o < 0 ? { dir: "down", pace: o, days: Math.max(1, Math.ceil(c / -o)) } : { dir: "up", pace: o, days: null };
804
- }, [de == null ? void 0 : de.data, ue == null ? void 0 : ue.data, g, x]), st = G(
804
+ }, [ue == null ? void 0 : ue.data, me == null ? void 0 : me.data, g, x]), ct = G(
805
805
  () => [
806
806
  ...new Set(
807
807
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
808
808
  )
809
809
  ],
810
810
  [s == null ? void 0 : s.sources]
811
- ), { data: Va } = H({
811
+ ), { data: Wa } = H({
812
812
  queryKey: ["collections"],
813
813
  queryFn: () => p.request(E("/collections")).then((e) => e.data),
814
814
  staleTime: 300 * 1e3
815
- }), Ve = Je({
816
- queries: st.map((e) => ({
815
+ }), Ge = ze({
816
+ queries: ct.map((e) => ({
817
817
  queryKey: ["queue-collection-addendums", e],
818
818
  queryFn: () => p.request(
819
819
  E(`/collections/${e}`)
@@ -823,73 +823,73 @@ function Bi({
823
823
  }).catch(() => !1),
824
824
  staleTime: 300 * 1e3
825
825
  }))
826
- }).some((e) => e.data === !0), { data: fn = [] } = H({
826
+ }).some((e) => e.data === !0), { data: gn = [] } = H({
827
827
  queryKey: ["queue-integrations-collections"],
828
828
  queryFn: () => p.request(E("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
829
829
  staleTime: 300 * 1e3
830
- }), ge = st.some((e) => fn.includes(e)), gn = G(() => {
830
+ }), xe = ct.some((e) => gn.includes(e)), xn = G(() => {
831
831
  var t;
832
832
  const e = {};
833
- if (!ge) return e;
834
- for (const n of S) {
835
- if (!fn.includes(n.collection)) continue;
833
+ if (!xe) return e;
834
+ for (const n of C) {
835
+ if (!gn.includes(n.collection)) continue;
836
836
  const a = e[t = n.collection] ?? (e[t] = []);
837
837
  a.length < 500 && a.push(n.item_id);
838
838
  }
839
839
  return e;
840
- }, [S, fn, ge]), dr = Object.keys(gn), ur = Je({
841
- queries: dr.map((e) => ({
842
- queryKey: ["queue-integrations-summary", e, gn[e].join(",")],
840
+ }, [C, gn, xe]), ur = Object.keys(xn), mr = ze({
841
+ queries: ur.map((e) => ({
842
+ queryKey: ["queue-integrations-summary", e, xn[e].join(",")],
843
843
  queryFn: () => p.request(
844
- ne("/integration-obligations/summary", {
844
+ re("/integration-obligations/summary", {
845
845
  collection: e,
846
- ids: gn[e]
846
+ ids: xn[e]
847
847
  })
848
848
  ).then((t) => t.data ?? {}).catch(() => ({})),
849
849
  staleTime: 3e4
850
850
  }))
851
- }), Ga = ur.map((e) => e.dataUpdatedAt).join(","), Wa = G(() => {
851
+ }), Ha = mr.map((e) => e.dataUpdatedAt).join(","), Ja = G(() => {
852
852
  const e = {};
853
- return dr.forEach((t, n) => {
853
+ return ur.forEach((t, n) => {
854
854
  var o;
855
- const a = ((o = ur[n]) == null ? void 0 : o.data) ?? {};
855
+ const a = ((o = mr[n]) == null ? void 0 : o.data) ?? {};
856
856
  for (const [c, b] of Object.entries(a)) e[`${t}:${c}`] = b;
857
857
  }), e;
858
- }, [Ga]), xn = G(() => {
858
+ }, [Ha]), yn = G(() => {
859
859
  var t;
860
860
  const e = {};
861
- for (const n of S) {
861
+ for (const n of C) {
862
862
  if (!n.collection || n.collection === "tasks" || n.collection.startsWith("nivaro_"))
863
863
  continue;
864
864
  const a = e[t = n.collection] ?? (e[t] = []);
865
865
  a.length < 500 && a.push(n.item_id);
866
866
  }
867
867
  return e;
868
- }, [S]), yn = Object.keys(xn), mr = Je({
869
- queries: yn.map((e) => ({
870
- queryKey: ["queue-task-counts", e, xn[e].join(",")],
868
+ }, [C]), kn = Object.keys(yn), br = ze({
869
+ queries: kn.map((e) => ({
870
+ queryKey: ["queue-task-counts", e, yn[e].join(",")],
871
871
  queryFn: () => p.request(
872
- ne("/tasks/counts", { collection: e, ids: xn[e] })
872
+ re("/tasks/counts", { collection: e, ids: yn[e] })
873
873
  ).then((t) => t.data ?? {}).catch(() => ({})),
874
874
  staleTime: 3e4
875
875
  }))
876
- }), Ha = mr.map((e) => e.dataUpdatedAt).join(","), Ja = G(() => {
876
+ }), Ya = br.map((e) => e.dataUpdatedAt).join(","), za = G(() => {
877
877
  const e = {};
878
- return yn.forEach((t, n) => {
878
+ return kn.forEach((t, n) => {
879
879
  var a;
880
- for (const [o, c] of Object.entries(((a = mr[n]) == null ? void 0 : a.data) ?? {})) e[`${t}:${o}`] = c;
880
+ for (const [o, c] of Object.entries(((a = br[n]) == null ? void 0 : a.data) ?? {})) e[`${t}:${o}`] = c;
881
881
  }), e;
882
- }, [Ha]), br = yn.length > 0, pr = Je({
883
- queries: st.map((e) => ({
882
+ }, [Ya]), pr = kn.length > 0, hr = ze({
883
+ queries: ct.map((e) => ({
884
884
  queryKey: ["queue-collection-risk-rules", e],
885
885
  queryFn: () => p.request(
886
886
  E("/at-risk/rules/active", { collection: e })
887
887
  ).then((t) => t.data ?? []).catch(() => []),
888
888
  staleTime: 300 * 1e3
889
889
  }))
890
- }), Ya = pr.map((e) => e.dataUpdatedAt).join(","), hr = G(() => {
890
+ }), Xa = hr.map((e) => e.dataUpdatedAt).join(","), fr = G(() => {
891
891
  const e = /* @__PURE__ */ new Map();
892
- for (const t of pr)
892
+ for (const t of hr)
893
893
  for (const n of t.data ?? []) {
894
894
  const a = e.get(n.name);
895
895
  e.set(n.name, {
@@ -898,65 +898,65 @@ function Bi({
898
898
  });
899
899
  }
900
900
  return [...e.values()];
901
- }, [Ya]), fr = Je({
902
- queries: st.map((e) => ({
901
+ }, [Xa]), gr = ze({
902
+ queries: ct.map((e) => ({
903
903
  queryKey: ["queue-collection-states", e],
904
904
  queryFn: () => p.request(
905
905
  E(`/queues/collection-states/${e}`)
906
906
  ).then((t) => t.data),
907
907
  staleTime: 300 * 1e3
908
908
  }))
909
- }), gr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), xe = G(() => {
909
+ }), xr = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), ye = G(() => {
910
910
  const e = {};
911
- for (const t of fr)
911
+ for (const t of gr)
912
912
  (t.data ?? []).forEach((n, a) => {
913
913
  e[n.key] = { label: n.label, color: n.color, sort: a };
914
914
  });
915
915
  return e;
916
- }, [fr.map((e) => e.data)]), xr = x ? Object.entries(x.by_state).sort(
916
+ }, [gr.map((e) => e.data)]), yr = x ? Object.entries(x.by_state).sort(
917
917
  (e, t) => {
918
918
  var n, a;
919
- 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);
919
+ return (((n = ye[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((a = ye[t[0]]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER);
920
920
  }
921
- ) : [], yr = (e) => [...e].sort(
921
+ ) : [], kr = (e) => [...e].sort(
922
922
  (t, n) => {
923
923
  var a, o;
924
- 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);
924
+ return (((a = ye[t]) == null ? void 0 : a.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = ye[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
925
925
  }
926
- ), kn = G(() => {
926
+ ), vn = G(() => {
927
927
  const e = {};
928
- for (const [t, n] of Object.entries(xe)) e[t] = n.label;
928
+ for (const [t, n] of Object.entries(ye)) e[t] = n.label;
929
929
  return e;
930
- }, [xe]), Fe = (e) => e ? e === "none" ? "No State" : kn[e] ?? gr(e) : "—", it = (e) => {
931
- if (e === Ht) return "Addendums";
932
- const t = (Va ?? []).find((n) => n.collection === e);
933
- return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || gr(e);
934
- }, Z = G(() => N ? ce ? ce.map((e) => ({
930
+ }, [ye]), Te = (e) => e ? e === "none" ? "No State" : vn[e] ?? xr(e) : "—", dt = (e) => {
931
+ if (e === Yt) return "Addendums";
932
+ const t = (Wa ?? []).find((n) => n.collection === e);
933
+ return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || xr(e);
934
+ }, ee = G(() => N ? de ? de.map((e) => ({
935
935
  key: e.key,
936
- rows: pn.get(e.key) ?? [],
936
+ rows: hn.get(e.key) ?? [],
937
937
  breached: e.breached,
938
938
  atRisk: e.at_risk,
939
939
  count: e.count,
940
940
  sums: e.sums ?? {}
941
- })) : So(S, N).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [S, N, ce, pn]), vn = B(null);
941
+ })) : Fo(C, N).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [C, N, de, hn]), wn = Q(null);
942
942
  j(() => {
943
- if (!N || !Z) {
944
- vn.current = null;
943
+ if (!N || !ee) {
944
+ wn.current = null;
945
945
  return;
946
946
  }
947
- if ($e && !ce || vn.current === N) return;
948
- vn.current = N;
949
- const e = Z.reduce((t, n) => t + n.count, 0);
950
- Jt(e > 200 ? new Set(Z.map((t) => t.key)) : /* @__PURE__ */ new Set()), or({});
951
- }, [N, ce]);
952
- function za(e) {
953
- Jt((t) => {
947
+ if (qe && !de || wn.current === N) return;
948
+ wn.current = N;
949
+ const e = ee.reduce((t, n) => t + n.count, 0);
950
+ zt(e > 200 ? new Set(ee.map((t) => t.key)) : /* @__PURE__ */ new Set()), sr({});
951
+ }, [N, de]);
952
+ function Za(e) {
953
+ zt((t) => {
954
954
  const n = new Set(t);
955
955
  return n.has(e) ? n.delete(e) : n.add(e), n;
956
956
  });
957
957
  }
958
- const ee = G(() => Z ? Z.filter((e) => !he.has(e.key)).flatMap((e) => e.rows) : S, [Z, S, he]), P = (e) => `${e.collection}:${e.item_id}`, [ye, Te] = k(null), [Xa, wn] = k(!1), [Pt, Kt] = k(null), _n = (e) => {
959
- if (e.collection === Ht && e.url) {
958
+ const te = G(() => ee ? ee.filter((e) => !fe.has(e.key)).flatMap((e) => e.rows) : C, [ee, C, fe]), P = (e) => `${e.collection}:${e.item_id}`, [ke, Re] = y(null), [el, _n] = y(!1), [Bt, Qt] = y(null), Nn = (e) => {
959
+ if (e.collection === Yt && e.url) {
960
960
  const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
961
961
  if (t) {
962
962
  const n = {};
@@ -974,35 +974,35 @@ function Bi({
974
974
  itemId: e.item_id,
975
975
  layoutSlug: (u == null ? void 0 : u.item_layout) ?? null
976
976
  };
977
- }, ct = (e) => {
977
+ }, ut = (e) => {
978
978
  var t;
979
- s && da({
979
+ s && ma({
980
980
  queue_id: l,
981
981
  name: s.name,
982
982
  path: `${window.location.pathname}${window.location.search}`,
983
983
  at: Date.now(),
984
- scroll: ((t = Bt.current) == null ? void 0 : t.scrollTop) ?? 0,
985
- state: { scope: g, page: _e, sort: I, filters: w, group_by: N, view: A }
986
- }), W.open(_n(e));
987
- }, [M, dt] = k(
984
+ scroll: ((t = It.current) == null ? void 0 : t.scrollTop) ?? 0,
985
+ state: { scope: g, page: Ne, sort: I, filters: w, group_by: N, view: S }
986
+ }), W.open(Nn(e));
987
+ }, [M, mt] = y(
988
988
  null
989
989
  );
990
990
  j(() => {
991
991
  if (!M) return;
992
- const e = () => dt(null);
992
+ const e = () => mt(null);
993
993
  return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
994
994
  window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
995
995
  };
996
996
  }, [M]);
997
- const Mt = (e) => {
998
- Kt(P(e));
997
+ const jt = (e) => {
998
+ Qt(P(e));
999
999
  const t = (u == null ? void 0 : u.row_click) ?? "preview";
1000
- if (t === "full" || e.collection === Ht) {
1001
- ct(e);
1000
+ if (t === "full" || e.collection === Yt) {
1001
+ ut(e);
1002
1002
  return;
1003
1003
  }
1004
1004
  if (t === "layout") {
1005
- Or({
1005
+ Lr({
1006
1006
  collection: e.collection,
1007
1007
  itemId: e.item_id,
1008
1008
  rootLayoutSlug: (u == null ? void 0 : u.item_layout) ?? null,
@@ -1011,85 +1011,85 @@ function Bi({
1011
1011
  });
1012
1012
  return;
1013
1013
  }
1014
- Te(e);
1014
+ Re(e);
1015
1015
  };
1016
1016
  j(() => {
1017
- if (!ye) return;
1018
- const e = S.find((t) => P(t) === P(ye));
1019
- e && e !== ye && Te(e);
1020
- }, [S]);
1021
- const Za = (e) => !e.claimed_by || e.claimed_by.id === v;
1022
- function kr(e) {
1023
- const t = e ? ee.findIndex((a) => P(a) === P(e)) + 1 : 0, n = ee.slice(t).find(Za);
1017
+ if (!ke) return;
1018
+ const e = C.find((t) => P(t) === P(ke));
1019
+ e && e !== ke && Re(e);
1020
+ }, [C]);
1021
+ const tl = (e) => !e.claimed_by || e.claimed_by.id === v;
1022
+ function vr(e) {
1023
+ const t = e ? te.findIndex((a) => P(a) === P(e)) + 1 : 0, n = te.slice(t).find(tl);
1024
1024
  if (!n) {
1025
- wn(!1), Te(null), R.info("Nothing left to work on — queue clear!");
1025
+ _n(!1), Re(null), A.info("Nothing left to work on — queue clear!");
1026
1026
  return;
1027
1027
  }
1028
- if (Kt(P(n)), se && !n.claimed_by && qe.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
1029
- ct(n);
1028
+ if (Qt(P(n)), ie && !n.claimed_by && Fe.mutate(n), (u == null ? void 0 : u.row_click) === "full") {
1029
+ ut(n);
1030
1030
  return;
1031
1031
  }
1032
- wn(!0), Te(n);
1032
+ _n(!0), Re(n);
1033
1033
  }
1034
1034
  j(() => {
1035
- if (A !== "table") return;
1035
+ if (S !== "table") return;
1036
1036
  function e(t) {
1037
1037
  var o;
1038
1038
  const n = t.target;
1039
1039
  if (n && (n.tagName === "INPUT" || n.tagName === "TEXTAREA" || n.tagName === "SELECT" || n.isContentEditable))
1040
1040
  return;
1041
- const a = Pt ? ee.findIndex((c) => P(c) === Pt) : -1;
1041
+ const a = Bt ? te.findIndex((c) => P(c) === Bt) : -1;
1042
1042
  if (t.key === "j" || t.key === "ArrowDown") {
1043
1043
  t.preventDefault();
1044
- const c = ee[Math.min(a + 1, ee.length - 1)];
1045
- c && Kt(P(c));
1044
+ const c = te[Math.min(a + 1, te.length - 1)];
1045
+ c && Qt(P(c));
1046
1046
  } else if (t.key === "k" || t.key === "ArrowUp") {
1047
1047
  t.preventDefault();
1048
- const c = ee[Math.max(a - 1, 0)];
1049
- c && Kt(P(c));
1050
- } else if (t.key === "Enter" && a >= 0 && !ye)
1051
- t.preventDefault(), Mt(ee[a]);
1052
- else if (t.key === "c" && a >= 0 && se) {
1048
+ const c = te[Math.max(a - 1, 0)];
1049
+ c && Qt(P(c));
1050
+ } else if (t.key === "Enter" && a >= 0 && !ke)
1051
+ t.preventDefault(), jt(te[a]);
1052
+ else if (t.key === "c" && a >= 0 && ie) {
1053
1053
  t.preventDefault();
1054
- const c = ee[a];
1055
- ((o = c.claimed_by) == null ? void 0 : o.id) === v ? je.mutate(c) : qe.mutate(c);
1056
- } else t.key === "o" && a >= 0 && (t.preventDefault(), ct(ee[a]));
1054
+ const c = te[a];
1055
+ ((o = c.claimed_by) == null ? void 0 : o.id) === v ? Ue.mutate(c) : Fe.mutate(c);
1056
+ } else t.key === "o" && a >= 0 && (t.preventDefault(), ut(te[a]));
1057
1057
  }
1058
1058
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1059
- }, [A, ee, Pt, ye, v, qe, je, se]);
1059
+ }, [S, te, Bt, ke, v, Fe, Ue, ie]);
1060
1060
  const { data: V } = H({
1061
1061
  queryKey: ["queue-views", l],
1062
1062
  queryFn: () => p.request(E(`/queues/${l}/views`)),
1063
1063
  enabled: !!l
1064
- }), [ut, mt] = k(null), [el, Nn] = k(!1), [Sn, vr] = k(""), [wr, _r] = k(!1), [bt, Nr] = k(!1);
1065
- function Qt(e) {
1064
+ }), [bt, pt] = y(null), [nl, Sn] = y(!1), [Cn, wr] = y(""), [_r, Nr] = y(!1), [ht, Sr] = y(!1);
1065
+ function Ut(e) {
1066
1066
  const t = e.state ?? {};
1067
- J(t.scope ?? "all"), K({ ...oe.current, ...t.filters ?? {} }), Le(t.sort ?? ""), et(t.group_by ?? null), Ot(t.columns ?? null), zt(t.pins ?? null), t.view && Ee(Ce.includes(t.view) ? t.view : Ce[0]), L(1), mt(e.id);
1067
+ J(t.scope ?? "all"), K({ ...se.current, ...t.filters ?? {} }), De(t.sort ?? ""), nt(t.group_by ?? null), Dt(t.columns ?? null), Zt(t.pins ?? null), t.view && Le($e.includes(t.view) ? t.view : $e[0]), L(1), pt(e.id);
1068
1068
  }
1069
- function tl() {
1069
+ function rl() {
1070
1070
  var t, n;
1071
1071
  const e = V == null ? void 0 : V.data.find((a) => a.is_default);
1072
1072
  if (e) {
1073
- Qt(e);
1073
+ Ut(e);
1074
1074
  return;
1075
1075
  }
1076
- J(((t = s == null ? void 0 : s.display_config) == null ? void 0 : t.default_scope) ?? "all"), K({ ...oe.current }), Le(""), et(null), Ot(null), zt(null), (n = s == null ? void 0 : s.display_config) != null && n.default_view && Ee(s.display_config.default_view), L(1), mt(null);
1076
+ J(((t = s == null ? void 0 : s.display_config) == null ? void 0 : t.default_scope) ?? "all"), K({ ...se.current }), De(""), nt(null), Dt(null), Zt(null), (n = s == null ? void 0 : s.display_config) != null && n.default_view && Le(s.display_config.default_view), L(1), pt(null);
1077
1077
  }
1078
1078
  j(() => {
1079
- if (ae || !(s != null && s.display_config) || Ue === void 0 || V === void 0) return;
1080
- 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);
1081
- t ? Qt(t) : n ? Qt(n) : (Ee(s.display_config.default_view), J(s.display_config.default_scope)), ka(!0);
1082
- }, [s, Ue, V, ae]);
1083
- const Bt = B(null), jt = B(null);
1079
+ if (le || !(s != null && s.display_config) || Ie === void 0 || V === void 0) return;
1080
+ const e = Ie.data.default_view_id, t = e != null ? V.data.find((a) => a.id === e) : void 0, n = V.data.find((a) => a.is_default);
1081
+ t ? Ut(t) : n ? Ut(n) : (Le(s.display_config.default_view), J(s.display_config.default_scope)), wa(!0);
1082
+ }, [s, Ie, V, le]);
1083
+ const It = Q(null), Vt = Q(null);
1084
1084
  j(() => {
1085
- if (!ae) return;
1086
- const e = Xo();
1085
+ if (!le) return;
1086
+ const e = ns();
1087
1087
  if (!(e != null && e.restore) || e.queue_id !== l) return;
1088
- da({ ...e, restore: !1 });
1088
+ ma({ ...e, restore: !1 });
1089
1089
  const t = e.state ?? {};
1090
- t.scope && J(t.scope), t.filters && K({ ...oe.current, ...t.filters }), t.sort != null && Le(t.sort), et(t.group_by ?? null), t.view && Ee(t.view), t.page && L(t.page), jt.current = e.scroll ?? 0;
1091
- }, [ae, l]), j(() => {
1092
- if (!ae || typeof window > "u") return;
1090
+ t.scope && J(t.scope), t.filters && K({ ...se.current, ...t.filters }), t.sort != null && De(t.sort), nt(t.group_by ?? null), t.view && Le(t.view), t.page && L(t.page), Vt.current = e.scroll ?? 0;
1091
+ }, [le, l]), j(() => {
1092
+ if (!le || typeof window > "u") return;
1093
1093
  const e = new URLSearchParams(window.location.search), t = e.get("owner");
1094
1094
  if (!t) return;
1095
1095
  e.delete("owner");
@@ -1098,140 +1098,144 @@ function Bi({
1098
1098
  window.history.state,
1099
1099
  "",
1100
1100
  `${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
1101
- ), J("all"), K((a) => ({ ...a, owners: [t] })), mt(null), L(1);
1102
- }, [ae]), j(() => {
1103
- jt.current == null || S.length === 0 || !Bt.current || (Bt.current.scrollTop = jt.current, jt.current = null);
1104
- }, [S]);
1105
- const { isAdmin: Ut } = sa(), Sr = Ut || (s == null ? void 0 : s.owner) != null && s.owner === v, nl = ve({
1106
- mutationFn: ({ viewId: e, on: t }) => p.request(ia(`/queues/views/${e}`, { is_default: t })),
1101
+ ), J("all"), K((a) => ({ ...a, owners: [t] })), pt(null), L(1);
1102
+ }, [le]), j(() => {
1103
+ Vt.current == null || C.length === 0 || !It.current || (It.current.scrollTop = Vt.current, Vt.current = null);
1104
+ }, [C]);
1105
+ const { isAdmin: Gt } = ca(), Cr = Gt || (s == null ? void 0 : s.owner) != null && s.owner === v, al = we({
1106
+ mutationFn: ({ viewId: e, on: t }) => p.request(da(`/queues/views/${e}`, { is_default: t })),
1107
1107
  onSuccess: () => {
1108
- h.invalidateQueries({ queryKey: ["queue-views", l] }), R.success("Queue default view updated");
1108
+ h.invalidateQueries({ queryKey: ["queue-views", l] }), A.success("Queue default view updated");
1109
1109
  },
1110
- onError: () => R.error("Could not update the queue default view")
1111
- }), Cr = ve({
1110
+ onError: () => A.error("Could not update the queue default view")
1111
+ }), $r = we({
1112
1112
  mutationFn: () => p.request(
1113
- ne(`/queues/${l}/views`, {
1114
- name: Sn.trim(),
1115
- is_shared: wr || bt,
1116
- is_default: bt,
1113
+ re(`/queues/${l}/views`, {
1114
+ name: Cn.trim(),
1115
+ is_shared: _r || ht,
1116
+ is_default: ht,
1117
1117
  state: {
1118
1118
  scope: g,
1119
1119
  filters: w,
1120
1120
  sort: I,
1121
1121
  group_by: N,
1122
- view: A,
1123
- columns: un,
1124
- pins: St
1122
+ view: S,
1123
+ columns: mn,
1124
+ pins: $t
1125
1125
  }
1126
1126
  })
1127
1127
  ),
1128
1128
  onSuccess: (e) => {
1129
- Nn(!1), vr(""), _r(!1), Nr(!1), mt(e.data.id), h.invalidateQueries({ queryKey: ["queue-views", l] }), R.success("View saved");
1129
+ Sn(!1), wr(""), Nr(!1), Sr(!1), pt(e.data.id), h.invalidateQueries({ queryKey: ["queue-views", l] }), A.success("View saved");
1130
1130
  },
1131
- onError: () => R.error("Failed to save view")
1132
- }), [$r, qr] = k(null), Re = ve({
1131
+ onError: () => A.error("Failed to save view")
1132
+ }), [qr, Fr] = y(null), Ae = we({
1133
1133
  mutationFn: (e) => p.request(
1134
- ia(`/queues/views/${e.id}`, {
1134
+ da(`/queues/views/${e.id}`, {
1135
1135
  state: {
1136
1136
  scope: g,
1137
1137
  filters: w,
1138
1138
  sort: I,
1139
1139
  group_by: N,
1140
- view: A,
1141
- columns: un,
1142
- pins: St
1140
+ view: S,
1141
+ columns: mn,
1142
+ pins: $t
1143
1143
  }
1144
1144
  })
1145
1145
  ),
1146
1146
  onSuccess: (e, t) => {
1147
- h.invalidateQueries({ queryKey: ["queue-views", l] }), qr(t.id), setTimeout(() => qr((n) => n === t.id ? null : n), 2e3), R.success(`Saved "${t.name}" with the current filters, scope and sort`);
1147
+ h.invalidateQueries({ queryKey: ["queue-views", l] }), Fr(t.id), setTimeout(() => Fr((n) => n === t.id ? null : n), 2e3), A.success(`Saved "${t.name}" with the current filters, scope and sort`);
1148
1148
  },
1149
- onError: () => R.error("Failed to update view")
1150
- }), rl = ve({
1151
- mutationFn: (e) => p.request(Rn(`/queues/views/${e}`)),
1149
+ onError: () => A.error("Failed to update view")
1150
+ }), ll = we({
1151
+ mutationFn: (e) => p.request(An(`/queues/views/${e}`)),
1152
1152
  onSuccess: (e, t) => {
1153
- h.invalidateQueries({ queryKey: ["queue-views", l] }), mt(null), Ie === t && mn(null);
1153
+ h.invalidateQueries({ queryKey: ["queue-views", l] }), pt(null), Ve === t && bn(null);
1154
1154
  },
1155
- onError: () => R.error("Failed to delete view")
1156
- }), al = ve({
1157
- mutationFn: (e) => p.request(so(`/queues/${l}/default-view`, { view_id: e })),
1158
- onMutate: (e) => mn(e),
1155
+ onError: () => A.error("Failed to delete view")
1156
+ }), ol = we({
1157
+ mutationFn: (e) => p.request(mo(`/queues/${l}/default-view`, { view_id: e })),
1158
+ onMutate: (e) => bn(e),
1159
1159
  onSuccess: (e, t) => {
1160
- h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), R.success(
1160
+ h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), A.success(
1161
1161
  t === null ? "Reverted to the general default" : "Set as your default view"
1162
1162
  );
1163
1163
  },
1164
1164
  onError: () => {
1165
- h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), R.error("Failed to update default view");
1165
+ h.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), A.error("Failed to update default view");
1166
1166
  }
1167
- }), [Ae, It] = k([]);
1168
- oo(), Bn.current = Ae.length;
1169
- const [Fr, Tr] = k(!1);
1170
- async function Cn(e, t) {
1171
- const n = S.filter((b) => Ae.includes(P(b)));
1172
- Tr(!0), At.beginBatch();
1167
+ }), [Oe, We] = y([]), [z, Tr] = y(!1), sl = () => {
1168
+ z && We([]), Tr(!z);
1169
+ };
1170
+ j(() => {
1171
+ S !== "table" && z && (Tr(!1), We([]));
1172
+ }, [S, z]), uo(), jn.current = Oe.length;
1173
+ const [Rr, Ar] = y(!1);
1174
+ async function $n(e, t) {
1175
+ const n = C.filter((b) => Oe.includes(P(b)));
1176
+ Ar(!0), Lt.beginBatch();
1173
1177
  const a = await Promise.allSettled(n.map(t));
1174
- At.endBatch();
1178
+ Lt.endBatch();
1175
1179
  const o = a.filter((b) => b.status === "fulfilled").length, c = a.length - o;
1176
- Tr(!1), It([]), h.invalidateQueries({ queryKey: ["queue-items", l] }), c ? R.warning(`${e}: ${o} succeeded, ${c} failed`) : R.success(`${e}: ${o} succeeded`);
1180
+ Ar(!1), We([]), h.invalidateQueries({ queryKey: ["queue-items", l] }), c ? A.warning(`${e}: ${o} succeeded, ${c} failed`) : A.success(`${e}: ${o} succeeded`);
1177
1181
  }
1178
- const Ge = (e) => {
1182
+ const He = (e) => {
1179
1183
  var t;
1180
1184
  for (const n of (s == null ? void 0 : s.sources) ?? []) {
1181
1185
  const a = (t = n.column_formats) == null ? void 0 : t[e];
1182
1186
  if (a) return a;
1183
1187
  }
1184
1188
  return null;
1185
- }, ll = (e) => {
1186
- if (N === "state") return e === "No state" ? e : Fe(e);
1187
- if (N === "collection") return it(e);
1189
+ }, il = (e) => {
1190
+ if (N === "state") return e === "No state" ? e : Te(e);
1191
+ if (N === "collection") return dt(e);
1188
1192
  if (N != null && N.startsWith("extra.") && e !== "—") {
1189
- const t = Ge(N.slice(6));
1190
- if (t) return Ye(e, t);
1193
+ const t = He(N.slice(6));
1194
+ if (t) return Xe(e, t);
1191
1195
  }
1192
1196
  return e;
1193
- }, ol = Z == null ? void 0 : Z.map((e) => ({
1197
+ }, cl = ee == null ? void 0 : ee.map((e) => ({
1194
1198
  key: e.key,
1195
1199
  rows: e.rows,
1196
- header: /* @__PURE__ */ d(we, { children: [
1197
- /* @__PURE__ */ r("span", { children: ll(e.key) }),
1200
+ header: /* @__PURE__ */ d(_e, { children: [
1201
+ /* @__PURE__ */ r("span", { children: il(e.key) }),
1198
1202
  /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
1199
1203
  "(",
1200
- re(e.count),
1204
+ ae(e.count),
1201
1205
  ")"
1202
1206
  ] }),
1203
1207
  Object.entries(e.sums).map(([t, n]) => {
1204
- const a = Ge(t);
1208
+ const a = He(t);
1205
1209
  return /* @__PURE__ */ d(
1206
1210
  "span",
1207
1211
  {
1208
1212
  className: "font-normal tabular-nums text-slate-500 dark:text-slate-400",
1209
1213
  "data-queue-group-sum": t,
1210
1214
  children: [
1211
- q(`extra.${t}`, wt(t)),
1215
+ F(`extra.${t}`, Nt(t)),
1212
1216
  ":",
1213
1217
  " ",
1214
- a ? Ye(String(n), a) : re(n)
1218
+ a ? Xe(String(n), a) : ae(n)
1215
1219
  ]
1216
1220
  },
1217
1221
  t
1218
1222
  );
1219
1223
  }),
1220
- ce && !he.has(e.key) && Ba.has(e.key) && /* @__PURE__ */ r("span", { className: "font-normal text-slate-400", children: "loading…" }),
1221
- ce && !he.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
1224
+ de && !fe.has(e.key) && Ua.has(e.key) && /* @__PURE__ */ r("span", { className: "font-normal text-slate-400", children: "loading…" }),
1225
+ de && !fe.has(e.key) && e.rows.length > 0 && e.rows.length < e.count && /* @__PURE__ */ d(
1222
1226
  "button",
1223
1227
  {
1224
1228
  type: "button",
1225
1229
  "data-queue-group-more": e.key,
1226
1230
  onClick: (t) => {
1227
- t.stopPropagation(), or((n) => ({ ...n, [e.key]: (n[e.key] ?? 1) + 1 }));
1231
+ t.stopPropagation(), sr((n) => ({ ...n, [e.key]: (n[e.key] ?? 1) + 1 }));
1228
1232
  },
1229
1233
  className: "rounded px-1.5 py-0.5 text-[11px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 dark:text-nvr-cyan",
1230
1234
  children: [
1231
1235
  "Showing ",
1232
- re(e.rows.length),
1236
+ ae(e.rows.length),
1233
1237
  " of ",
1234
- re(e.count),
1238
+ ae(e.count),
1235
1239
  " · Show more"
1236
1240
  ]
1237
1241
  }
@@ -1245,36 +1249,36 @@ function Bi({
1245
1249
  " at risk"
1246
1250
  ] })
1247
1251
  ] })
1248
- })), $n = (((Vr = i == null ? void 0 : i.available_values.collection) == null ? void 0 : Vr.length) ?? 0) > 1, Rr = S.some((e) => !!e.unseen) || Dt.size > 0 || S.some((e) => Ne.isNew(P(e))), Ar = [
1249
- ...$n ? [
1252
+ })), qn = (((Wr = i == null ? void 0 : i.available_values.collection) == null ? void 0 : Wr.length) ?? 0) > 1, Or = C.some((e) => !!e.unseen) || Mt.size > 0 || C.some((e) => Se.isNew(P(e))), Er = [
1253
+ ...qn ? [
1250
1254
  {
1251
1255
  key: "collection",
1252
- header: q("collection", "Collection"),
1256
+ header: F("collection", "Collection"),
1253
1257
  sortable: !0,
1254
- render: (e) => /* @__PURE__ */ r(os, { variant: "outline", children: it(e.collection) })
1258
+ render: (e) => /* @__PURE__ */ r(ds, { variant: "outline", children: dt(e.collection) })
1255
1259
  }
1256
1260
  ] : [],
1257
1261
  {
1258
1262
  key: "label",
1259
- header: q("label", "Item"),
1263
+ header: F("label", "Item"),
1260
1264
  sortable: !0,
1261
1265
  // Room in the left padding for the hanging unseen mark (#643).
1262
- className: Rr ? "pl-[30px]" : void 0,
1263
- headerClassName: Rr ? "pl-[30px]" : void 0,
1266
+ className: Or ? "pl-[30px]" : void 0,
1267
+ headerClassName: Or ? "pl-[30px]" : void 0,
1264
1268
  render: (e) => (
1265
1269
  // Underlined because clicking opens the item. The row is clickable as
1266
1270
  // a whole, but nothing on it said so — an underline is the one
1267
1271
  // convention people already read as "this goes somewhere".
1268
1272
  /* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
1269
- Dt.get(P(e)) || Ne.isNew(P(e)) ? /* @__PURE__ */ r(
1270
- es,
1273
+ Mt.get(P(e)) || Se.isNew(P(e)) ? /* @__PURE__ */ r(
1274
+ as,
1271
1275
  {
1272
- lock: Dt.get(P(e)),
1273
- isNew: Ne.isNew(P(e)),
1276
+ lock: Mt.get(P(e)),
1277
+ isNew: Se.isNew(P(e)),
1274
1278
  dataAttr: "data-queue-live-mark",
1275
1279
  hang: !0
1276
1280
  }
1277
- ) : /* @__PURE__ */ r(ls, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1281
+ ) : /* @__PURE__ */ r(cs, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1278
1282
  /* @__PURE__ */ r(
1279
1283
  "span",
1280
1284
  {
@@ -1293,9 +1297,9 @@ function Bi({
1293
1297
  t
1294
1298
  )),
1295
1299
  /* @__PURE__ */ r(
1296
- as,
1300
+ is,
1297
1301
  {
1298
- viewers: Pa[No(e.collection, e.item_id)],
1302
+ viewers: Ma[qo(e.collection, e.item_id)],
1299
1303
  dataAttr: "data-queue-presence"
1300
1304
  }
1301
1305
  )
@@ -1304,7 +1308,7 @@ function Bi({
1304
1308
  },
1305
1309
  {
1306
1310
  key: "state",
1307
- header: q("state", "State"),
1311
+ header: F("state", "State"),
1308
1312
  sortable: !0,
1309
1313
  render: (e) => e.state ? /* @__PURE__ */ d(
1310
1314
  "span",
@@ -1314,9 +1318,9 @@ function Bi({
1314
1318
  backgroundColor: e.state_color ? `${e.state_color}1a` : void 0,
1315
1319
  color: e.state_color ?? void 0
1316
1320
  },
1317
- title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Fe(e.state)}` : Fe(e.state),
1321
+ title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Te(e.state)}` : Te(e.state),
1318
1322
  children: [
1319
- Fe(e.state),
1323
+ Te(e.state),
1320
1324
  e.via_addendum && /* @__PURE__ */ r("span", { className: "ml-1 rounded-sm bg-amber-500/15 px-1 text-[9px] font-bold uppercase tracking-wide text-amber-700 dark:text-amber-300", children: "Addendum" })
1321
1325
  ]
1322
1326
  }
@@ -1324,57 +1328,57 @@ function Bi({
1324
1328
  },
1325
1329
  {
1326
1330
  key: "owners",
1327
- header: q("owners", "Owners"),
1331
+ header: F("owners", "Owners"),
1328
1332
  sortable: !0,
1329
- render: (e) => /* @__PURE__ */ r(us, { owners: e.owners })
1333
+ render: (e) => /* @__PURE__ */ r(hs, { owners: e.owners })
1330
1334
  },
1331
1335
  {
1332
1336
  key: "aging_hours",
1333
- header: q("aging_hours", "Aging"),
1337
+ header: F("aging_hours", "Aging"),
1334
1338
  sortable: !0,
1335
- render: (e) => _s(e.aging_hours)
1339
+ render: (e) => $s(e.aging_hours)
1336
1340
  },
1337
1341
  {
1338
1342
  // When the record entered its current state — the same moment Aging
1339
1343
  // counts from (the pipeline history, not the legacy column).
1340
1344
  key: "state_entered",
1341
- header: q("state_entered", "Last State Change"),
1345
+ header: F("state_entered", "Last State Change"),
1342
1346
  sortable: !0,
1343
- render: (e) => e.state_entered_at ? mo(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
1347
+ render: (e) => e.state_entered_at ? fo(e.state_entered_at, { type: "datetime", template: "MM/DD/YYYY - h:mmA" }) : /* @__PURE__ */ r("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
1344
1348
  },
1345
1349
  {
1346
1350
  key: "sla_status",
1347
- header: q("sla_status", "SLA"),
1351
+ header: F("sla_status", "SLA"),
1348
1352
  sortable: !0,
1349
- render: (e) => /* @__PURE__ */ r(Ns, { status: e.sla_status })
1353
+ render: (e) => /* @__PURE__ */ r(qs, { status: e.sla_status })
1350
1354
  },
1351
1355
  {
1352
1356
  key: "at_risk",
1353
- header: q("at_risk", "Risk"),
1357
+ header: F("at_risk", "Risk"),
1354
1358
  sortable: !0,
1355
1359
  render: (e) => {
1356
1360
  var t;
1357
- return e.at_risk ? /* @__PURE__ */ d("span", { className: $o(e.at_risk_color ?? "red"), children: [
1361
+ return e.at_risk ? /* @__PURE__ */ d("span", { className: Ro(e.at_risk_color ?? "red"), children: [
1358
1362
  "⚑ ",
1359
1363
  ((t = e.at_risk_rule) == null ? void 0 : t.name) ?? "At risk"
1360
1364
  ] }) : e.predicted_risk ? /* @__PURE__ */ r("span", { className: "text-amber-500", title: e.predicted_note ?? void 0, children: "⚑ Predicted" }) : null;
1361
1365
  }
1362
1366
  },
1363
- ...Ve ? [
1367
+ ...Ge ? [
1364
1368
  {
1365
1369
  key: "addendums",
1366
- header: q("addendums", "Addendums"),
1370
+ header: F("addendums", "Addendums"),
1367
1371
  sortable: !1,
1368
- render: (e) => /* @__PURE__ */ r(ws, { summary: e.addendums })
1372
+ render: (e) => /* @__PURE__ */ r(Cs, { summary: e.addendums })
1369
1373
  }
1370
1374
  ] : [],
1371
- ...at ? [
1375
+ ...ot ? [
1372
1376
  {
1373
1377
  key: "fulfilment",
1374
- header: q("fulfilment", "Shipped"),
1378
+ header: F("fulfilment", "Shipped"),
1375
1379
  sortable: !0,
1376
1380
  render: (e) => /* @__PURE__ */ r(
1377
- Go,
1381
+ Yo,
1378
1382
  {
1379
1383
  collection: e.collection,
1380
1384
  itemId: e.item_id,
@@ -1383,21 +1387,21 @@ function Bi({
1383
1387
  )
1384
1388
  }
1385
1389
  ] : [],
1386
- ...ge ? [
1390
+ ...xe ? [
1387
1391
  {
1388
1392
  key: "integrations",
1389
- header: q("integrations", "Integrations"),
1393
+ header: F("integrations", "Integrations"),
1390
1394
  sortable: !1,
1391
- render: (e) => /* @__PURE__ */ r(Jo, { rows: Wa[`${e.collection}:${e.item_id}`] })
1395
+ render: (e) => /* @__PURE__ */ r(Zo, { rows: Ja[`${e.collection}:${e.item_id}`] })
1392
1396
  }
1393
1397
  ] : [],
1394
- ...br ? [
1398
+ ...pr ? [
1395
1399
  {
1396
1400
  key: "tasks",
1397
- header: q("tasks", "Tasks"),
1401
+ header: F("tasks", "Tasks"),
1398
1402
  sortable: !1,
1399
1403
  render: (e) => {
1400
- const t = Ja[`${e.collection}:${e.item_id}`];
1404
+ const t = za[`${e.collection}:${e.item_id}`];
1401
1405
  return !t || t.open === 0 ? /* @__PURE__ */ r("span", { className: "text-[11px] text-slate-400", children: "—" }) : /* @__PURE__ */ d(
1402
1406
  "span",
1403
1407
  {
@@ -1412,15 +1416,15 @@ function Bi({
1412
1416
  }
1413
1417
  }
1414
1418
  ] : [],
1415
- ...lt ? [
1419
+ ...st ? [
1416
1420
  {
1417
1421
  key: "send_backs",
1418
- header: q("send_backs", "Sent back"),
1422
+ header: F("send_backs", "Sent back"),
1419
1423
  sortable: !0,
1420
- render: (e) => /* @__PURE__ */ r(ys, { summary: e.send_backs })
1424
+ render: (e) => /* @__PURE__ */ r(_s, { summary: e.send_backs })
1421
1425
  }
1422
1426
  ] : []
1423
- ], sl = {
1427
+ ], dl = {
1424
1428
  key: "claim",
1425
1429
  header: "",
1426
1430
  render: (e) => e.claimed_by ? /* @__PURE__ */ r(
@@ -1428,7 +1432,7 @@ function Bi({
1428
1432
  {
1429
1433
  type: "button",
1430
1434
  onClick: (t) => {
1431
- t.stopPropagation(), je.mutate(e);
1435
+ t.stopPropagation(), Ue.mutate(e);
1432
1436
  },
1433
1437
  className: "text-[11px] text-slate-400 underline hover:text-slate-600",
1434
1438
  children: "Release"
@@ -1438,13 +1442,13 @@ function Bi({
1438
1442
  {
1439
1443
  type: "button",
1440
1444
  onClick: (t) => {
1441
- t.stopPropagation(), qe.mutate(e);
1445
+ t.stopPropagation(), Fe.mutate(e);
1442
1446
  },
1443
1447
  className: "text-[11px] font-medium text-nvr-navy underline dark:text-nvr-cyan",
1444
1448
  children: "Claim"
1445
1449
  }
1446
1450
  )
1447
- }, pt = (s == null ? void 0 : s.available_extra_fields) ?? [], ht = ro("drill.queue"), X = ht.value, Or = (e) => ht.push([e]), il = (e) => {
1451
+ }, ft = (s == null ? void 0 : s.available_extra_fields) ?? [], gt = so("drill.queue"), Z = gt.value, Lr = (e) => gt.push([e]), ul = (e) => {
1448
1452
  var t;
1449
1453
  for (const n of (s == null ? void 0 : s.sources) ?? []) {
1450
1454
  const a = (t = n.drilldown) == null ? void 0 : t[e];
@@ -1456,44 +1460,44 @@ function Bi({
1456
1460
  };
1457
1461
  }
1458
1462
  return { enabled: !0, layout_id: null, width: null };
1459
- }, cl = G(() => {
1463
+ }, ml = G(() => {
1460
1464
  const e = {};
1461
1465
  for (const t of (s == null ? void 0 : s.sources) ?? [])
1462
1466
  for (const [n, a] of Object.entries(t.column_formats ?? {}))
1463
1467
  n in e || (e[n] = a);
1464
1468
  return e;
1465
- }, [s == null ? void 0 : s.sources]), dl = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, ul = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1466
- function ml(e) {
1467
- if (dl.test(e)) return { text: e.split("@")[0], title: e };
1468
- if (ul.test(e)) {
1469
+ }, [s == null ? void 0 : s.sources]), bl = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, pl = /^\d{4}-\d{2}-\d{2}T\d{2}:/;
1470
+ function hl(e) {
1471
+ if (bl.test(e)) return { text: e.split("@")[0], title: e };
1472
+ if (pl.test(e)) {
1469
1473
  const t = new Date(e);
1470
1474
  if (!Number.isNaN(t.getTime()))
1471
1475
  return {
1472
- text: Do(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1473
- title: Lo(t)
1476
+ text: Bo(t, { month: "2-digit", day: "2-digit", year: "2-digit" }),
1477
+ title: Mo(t)
1474
1478
  };
1475
1479
  }
1476
1480
  return { text: e, title: e };
1477
1481
  }
1478
- const bl = pt.map((e) => ({
1482
+ const fl = ft.map((e) => ({
1479
1483
  key: `extra.${e}`,
1480
- header: q(`extra.${e}`, wt(e)),
1484
+ header: F(`extra.${e}`, Nt(e)),
1481
1485
  sortable: !0,
1482
1486
  render: (t) => {
1483
- var y, T;
1484
- const n = (y = t.extra) == null ? void 0 : y[e];
1487
+ var k, R;
1488
+ const n = (k = t.extra) == null ? void 0 : k[e];
1485
1489
  if (n == null || n === "") return /* @__PURE__ */ r("span", { className: "text-slate-300", children: "—" });
1486
- const a = Ge(e), o = a ? Ye(String(n), a) : String(n), { text: c, title: b } = ml(o), m = ((s == null ? void 0 : s.extra_field_meta) ?? []).find((Q) => Q.path === e), O = ((T = t.extra_ids) == null ? void 0 : T[e]) ?? [], F = il(e);
1487
- return (m == null ? void 0 : m.kind) === "relation" && m.target_collection && O.length > 0 && F.enabled && !m.aggregate ? /* @__PURE__ */ r(
1490
+ const a = He(e), o = a ? Xe(String(n), a) : String(n), { text: c, title: b } = hl(o), m = ((s == null ? void 0 : s.extra_field_meta) ?? []).find((B) => B.path === e), O = ((R = t.extra_ids) == null ? void 0 : R[e]) ?? [], T = ul(e);
1491
+ return (m == null ? void 0 : m.kind) === "relation" && m.target_collection && O.length > 0 && T.enabled && !m.aggregate ? /* @__PURE__ */ r(
1488
1492
  "button",
1489
1493
  {
1490
1494
  type: "button",
1491
- onClick: (Q) => {
1492
- Q.stopPropagation(), Or({
1495
+ onClick: (B) => {
1496
+ B.stopPropagation(), Lr({
1493
1497
  collection: m.target_collection,
1494
1498
  itemId: O[0],
1495
- layoutId: F.layout_id,
1496
- width: F.width,
1499
+ layoutId: T.layout_id,
1500
+ width: T.width,
1497
1501
  title: o
1498
1502
  });
1499
1503
  },
@@ -1505,8 +1509,8 @@ function Bi({
1505
1509
  "button",
1506
1510
  {
1507
1511
  type: "button",
1508
- onClick: (Q) => {
1509
- Q.stopPropagation(), sn({ row: t, path: e, value: o });
1512
+ onClick: (B) => {
1513
+ B.stopPropagation(), cn({ row: t, path: e, value: o });
1510
1514
  },
1511
1515
  title: "Show the rows behind this number",
1512
1516
  className: "block max-w-[200px] truncate text-left text-[12px] tabular-nums underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-nvr-navy hover:decoration-nvr-cyan dark:hover:text-nvr-cyan",
@@ -1514,55 +1518,55 @@ function Bi({
1514
1518
  }
1515
1519
  ) : /* @__PURE__ */ r("span", { className: "block max-w-[200px] truncate text-[12px]", title: b, children: c });
1516
1520
  }
1517
- })), Er = [
1518
- ...$n ? ["collection"] : [],
1521
+ })), Dr = [
1522
+ ...qn ? ["collection"] : [],
1519
1523
  "state",
1520
1524
  "owners",
1521
1525
  "aging_hours",
1522
1526
  "state_entered",
1523
1527
  "sla_status",
1524
1528
  "at_risk",
1525
- ...Ve ? ["addendums"] : [],
1526
- ...at ? ["fulfilment"] : [],
1527
- ...ge ? ["integrations"] : [],
1528
- ...lt ? ["send_backs"] : [],
1529
- ...br ? ["tasks"] : [],
1530
- ...pt.map((e) => `extra.${e}`)
1531
- ], pl = [
1532
- ...$n ? ["collection"] : [],
1529
+ ...Ge ? ["addendums"] : [],
1530
+ ...ot ? ["fulfilment"] : [],
1531
+ ...xe ? ["integrations"] : [],
1532
+ ...st ? ["send_backs"] : [],
1533
+ ...pr ? ["tasks"] : [],
1534
+ ...ft.map((e) => `extra.${e}`)
1535
+ ], gl = [
1536
+ ...qn ? ["collection"] : [],
1533
1537
  "state",
1534
1538
  "owners",
1535
- ...Ve ? ["addendums"] : [],
1536
- ...at ? ["fulfilment"] : [],
1537
- ...ge ? ["integrations"] : [],
1538
- ...lt ? ["send_backs"] : [],
1539
+ ...Ge ? ["addendums"] : [],
1540
+ ...ot ? ["fulfilment"] : [],
1541
+ ...xe ? ["integrations"] : [],
1542
+ ...st ? ["send_backs"] : [],
1539
1543
  "aging_hours",
1540
1544
  "sla_status",
1541
1545
  "at_risk",
1542
- ...pt.slice(0, 2).map((e) => `extra.${e}`)
1543
- ], hl = (u == null ? void 0 : u.default_columns) ?? null, qn = un ?? hl, te = new Set(qn ?? pl);
1544
- 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");
1545
- const fl = new Set(Ut ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1546
- for (const e of fl) te.delete(e);
1547
- const We = [
1548
- ...(qn ?? []).filter((e) => Er.includes(e)),
1549
- ...Er.filter((e) => !(qn ?? []).includes(e))
1550
- ], gl = Cl($l(ql, { activationConstraint: { distance: 4 } }));
1551
- function xl(e) {
1546
+ ...ft.slice(0, 2).map((e) => `extra.${e}`)
1547
+ ], xl = (u == null ? void 0 : u.default_columns) ?? null, Fn = mn ?? xl, ne = new Set(Fn ?? gl);
1548
+ Ge && !Ct.has("addendums") && ne.add("addendums"), ot && !Ct.has("fulfilment") && ne.add("fulfilment"), xe && !Ct.has("integrations") && ne.add("integrations"), st && !Ct.has("send_backs") && ne.add("send_backs");
1549
+ const yl = new Set(Gt ? [] : (u == null ? void 0 : u.admin_only_columns) ?? []);
1550
+ for (const e of yl) ne.delete(e);
1551
+ const Je = [
1552
+ ...(Fn ?? []).filter((e) => Dr.includes(e)),
1553
+ ...Dr.filter((e) => !(Fn ?? []).includes(e))
1554
+ ], kl = Fl(Tl(Rl, { activationConstraint: { distance: 4 } }));
1555
+ function vl(e) {
1552
1556
  const { active: t, over: n } = e;
1553
1557
  if (!n || t.id === n.id) return;
1554
- const a = We.indexOf(String(t.id)), o = We.indexOf(String(n.id));
1555
- a === -1 || o === -1 || Ot(
1556
- Ol(We, a, o).filter((c) => te.has(c))
1558
+ const a = Je.indexOf(String(t.id)), o = Je.indexOf(String(n.id));
1559
+ a === -1 || o === -1 || Dt(
1560
+ Dl(Je, a, o).filter((c) => ne.has(c))
1557
1561
  );
1558
1562
  }
1559
- const Lr = Ar.find((e) => e.key === "label"), yl = {
1560
- ...Lr,
1563
+ const Pr = Er.find((e) => e.key === "label"), wl = {
1564
+ ...Pr,
1561
1565
  render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
1562
- /* @__PURE__ */ r(Bo, { rowId: e.item_id }),
1563
- Lr.render(e, ...t)
1566
+ /* @__PURE__ */ r(Vo, { rowId: e.item_id }),
1567
+ Pr.render(e, ...t)
1564
1568
  ] })
1565
- }, kl = ((u == null ? void 0 : u.formula_columns) ?? []).map(
1569
+ }, _l = ((u == null ? void 0 : u.formula_columns) ?? []).map(
1566
1570
  (e) => ({
1567
1571
  key: `formula.${e.key}`,
1568
1572
  header: e.label,
@@ -1570,7 +1574,7 @@ function Bi({
1570
1574
  const n = {
1571
1575
  ...t,
1572
1576
  ...t.extra ? Object.fromEntries(Object.entries(t.extra).map(([c, b]) => [`extra.${c}`, b])) : {}
1573
- }, a = io(e.formula, (c) => {
1577
+ }, a = bo(e.formula, (c) => {
1574
1578
  const b = n[c] ?? (t.extra ? t.extra[c] : void 0), m = Number(b);
1575
1579
  return Number.isFinite(m) ? m : b ?? null;
1576
1580
  });
@@ -1579,45 +1583,46 @@ function Bi({
1579
1583
  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) });
1580
1584
  }
1581
1585
  })
1582
- ), Dr = [...Ar, ...bl, ...kl], vl = {
1586
+ ), Kr = [...Er, ...fl, ..._l], Nl = {
1583
1587
  key: "__actions__",
1584
1588
  header: "",
1585
- render: (e) => e.collection === "tasks" || e.collection === Ht ? null : /* @__PURE__ */ r("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ r(
1586
- jo,
1589
+ render: (e) => e.collection === "tasks" || e.collection === Yt ? null : /* @__PURE__ */ r("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ r(
1590
+ Go,
1587
1591
  {
1588
1592
  collection: e.collection,
1589
1593
  id: e.item_id,
1590
1594
  hasPipeline: e.state != null,
1591
- onOpen: () => ct(e),
1592
- onPeek: () => Te(e),
1595
+ onOpen: () => ut(e),
1596
+ onPeek: () => Re(e),
1593
1597
  urlFor: W.urlFor,
1594
1598
  onDeleted: () => {
1595
- p.request(Rn(`/items/${e.collection}/${e.item_id}`)).then(() => {
1596
- R.success("Moved to trash"), h.invalidateQueries({ queryKey: ["queue-items", l] });
1597
- }).catch((t) => R.error(yt(t, "Delete failed")));
1599
+ p.request(An(`/items/${e.collection}/${e.item_id}`)).then(() => {
1600
+ A.success("Moved to trash"), h.invalidateQueries({ queryKey: ["queue-items", l] });
1601
+ }).catch((t) => A.error(vt(t, "Delete failed")));
1598
1602
  },
1599
1603
  onAfterTransition: () => void h.invalidateQueries({ queryKey: ["queue-items", l] }),
1600
- bulkEnabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null
1604
+ bulkEnabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
1605
+ disabled: z
1601
1606
  }
1602
1607
  ) })
1603
- }, Vt = [
1604
- yl,
1605
- ...We.filter((e) => te.has(e)).map((e) => Dr.find((t) => t.key === e)).filter((e) => e !== void 0),
1606
- ...se ? [sl] : [],
1607
- vl
1608
- ], Pr = G(() => {
1608
+ }, Wt = [
1609
+ wl,
1610
+ ...Je.filter((e) => ne.has(e)).map((e) => Kr.find((t) => t.key === e)).filter((e) => e !== void 0),
1611
+ ...ie ? [dl] : [],
1612
+ Nl
1613
+ ], Mr = G(() => {
1609
1614
  var a;
1610
- const e = u == null ? void 0 : u.default_pins, t = St ?? (e && Object.keys(e).length > 0 ? e : { [((a = Vt[0]) == null ? void 0 : a.key) ?? "label"]: "left" }), n = new Set(Vt.map((o) => o.key));
1615
+ const e = u == null ? void 0 : u.default_pins, t = $t ?? (e && Object.keys(e).length > 0 ? e : { [((a = Wt[0]) == null ? void 0 : a.key) ?? "label"]: "left" }), n = new Set(Wt.map((o) => o.key));
1611
1616
  return Object.fromEntries(Object.entries(t).filter(([o]) => n.has(o)));
1612
- }, [St, u == null ? void 0 : u.default_pins, Vt.map((e) => e.key).join("|")]), Kr = [
1617
+ }, [$t, u == null ? void 0 : u.default_pins, Wt.map((e) => e.key).join("|")]), Br = [
1613
1618
  { value: "state", label: "State" },
1614
1619
  { value: "collection", label: "Collection" },
1615
1620
  { value: "sla_status", label: "SLA status" },
1616
1621
  { value: "at_risk", label: "At risk" },
1617
1622
  { value: "owners", label: "Owner" },
1618
1623
  { value: "aging", label: "Aging" },
1619
- ...pt.filter((e) => te.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: q(`extra.${e}`, wt(e)) }))
1620
- ], Mr = (e) => async (t) => {
1624
+ ...ft.filter((e) => ne.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: F(`extra.${e}`, Nt(e)) }))
1625
+ ], Qr = (e) => async (t) => {
1621
1626
  if (!e.target_collection || !e.display_field) return [];
1622
1627
  const n = {
1623
1628
  limit: 25,
@@ -1626,42 +1631,42 @@ function Bi({
1626
1631
  t.trim() && (n.filter = JSON.stringify({ [e.display_field]: { _contains: t.trim() } }));
1627
1632
  const o = (await p.request(
1628
1633
  E(`/items/${e.target_collection}`, n)
1629
- )).data ?? [], c = Ge(e.path), b = Se[e.path] ? new Set(Se[e.path]) : null, m = /* @__PURE__ */ new Set(), O = [];
1630
- for (const F of o) {
1631
- const y = F[e.display_field];
1632
- if (y == null || y === "") continue;
1633
- const T = String(y);
1634
- m.has(T) || b && !b.has(T) || (m.add(T), O.push({ label: c ? Ye(T, c) : T, value: T }));
1634
+ )).data ?? [], c = He(e.path), b = Ce[e.path] ? new Set(Ce[e.path]) : null, m = /* @__PURE__ */ new Set(), O = [];
1635
+ for (const T of o) {
1636
+ const k = T[e.display_field];
1637
+ if (k == null || k === "") continue;
1638
+ const R = String(k);
1639
+ m.has(R) || b && !b.has(R) || (m.add(R), O.push({ label: c ? Xe(R, c) : R, value: R }));
1635
1640
  }
1636
1641
  return O;
1637
- }, Fn = new Map(((s == null ? void 0 : s.extra_field_meta) ?? []).map((e) => [e.path, e])), He = [
1642
+ }, Tn = new Map(((s == null ? void 0 : s.extra_field_meta) ?? []).map((e) => [e.path, e])), Ye = [
1638
1643
  {
1639
1644
  key: "collection",
1640
- placeholder: q("collection", "Collection"),
1645
+ placeholder: F("collection", "Collection"),
1641
1646
  type: "combobox",
1642
1647
  multi: !0,
1643
1648
  options: ((i == null ? void 0 : i.available_values.collection) ?? []).map((e) => ({
1644
- label: it(e),
1649
+ label: dt(e),
1645
1650
  value: e
1646
1651
  }))
1647
1652
  },
1648
1653
  {
1649
1654
  key: "state",
1650
- placeholder: q("state", "State"),
1655
+ placeholder: F("state", "State"),
1651
1656
  type: "combobox",
1652
1657
  multi: !0,
1653
1658
  // Until the rows land, the pipeline's own states (no counts yet) rather
1654
1659
  // than an empty list.
1655
- options: yr(
1656
- i ? i.available_values.state ?? [] : Object.keys(xe)
1660
+ options: kr(
1661
+ i ? i.available_values.state ?? [] : Object.keys(ye)
1657
1662
  ).map((e) => {
1658
1663
  var t;
1659
1664
  return {
1660
- label: Fe(e),
1665
+ label: Te(e),
1661
1666
  value: e,
1662
1667
  // How many rows sit in it under the other active filters (the State
1663
1668
  // filter itself left out, or every other state would read 0).
1664
- count: sr ? sr[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
1669
+ count: ir ? ir[e] ?? 0 : (t = x == null ? void 0 : x.by_state) == null ? void 0 : t[e]
1665
1670
  };
1666
1671
  })
1667
1672
  },
@@ -1684,21 +1689,21 @@ function Bi({
1684
1689
  { label: "No", value: "no" }
1685
1690
  ]
1686
1691
  },
1687
- ...hr.length > 0 ? [
1692
+ ...fr.length > 0 ? [
1688
1693
  {
1689
1694
  key: "at_risk_rule",
1690
1695
  placeholder: "Highlight rule",
1691
1696
  type: "select",
1692
- options: hr
1697
+ options: fr
1693
1698
  }
1694
1699
  ] : [],
1695
1700
  {
1696
1701
  key: "aging_hours",
1697
- placeholder: q("aging_hours", "Aging (hours)"),
1702
+ placeholder: F("aging_hours", "Aging (hours)"),
1698
1703
  type: "range",
1699
1704
  range_unit: "h"
1700
1705
  },
1701
- ...Ve ? [
1706
+ ...Ge ? [
1702
1707
  {
1703
1708
  key: "addendums",
1704
1709
  placeholder: "Addendums",
@@ -1711,23 +1716,23 @@ function Bi({
1711
1716
  ] : [],
1712
1717
  // #630 — integration partners; the queue read model filters on it
1713
1718
  // (live path in memory, materialized cache in SQL).
1714
- ...ge ? [
1719
+ ...xe ? [
1715
1720
  {
1716
1721
  key: "integrations",
1717
- placeholder: q("integrations", "Integrations"),
1722
+ placeholder: F("integrations", "Integrations"),
1718
1723
  type: "select",
1719
- options: Yo.map((e) => ({ label: e.label, value: e.value }))
1724
+ options: es.map((e) => ({ label: e.label, value: e.value }))
1720
1725
  }
1721
1726
  ] : [],
1722
- ...at ? [
1727
+ ...ot ? [
1723
1728
  {
1724
1729
  key: "fulfilment",
1725
1730
  placeholder: "Shipped",
1726
1731
  type: "select",
1727
- options: Wo
1732
+ options: zo
1728
1733
  }
1729
1734
  ] : [],
1730
- ...lt ? [
1735
+ ...st ? [
1731
1736
  {
1732
1737
  key: "send_backs",
1733
1738
  placeholder: "Sent back",
@@ -1739,18 +1744,18 @@ function Bi({
1739
1744
  ]
1740
1745
  }
1741
1746
  ] : [],
1742
- ...dn.length > 0 ? [
1747
+ ...un.length > 0 ? [
1743
1748
  {
1744
1749
  key: "labels",
1745
1750
  placeholder: "Triage label",
1746
1751
  type: "combobox",
1747
1752
  multi: !0,
1748
- options: dn.map((e) => ({ label: e, value: e }))
1753
+ options: un.map((e) => ({ label: e, value: e }))
1749
1754
  }
1750
1755
  ] : [],
1751
1756
  {
1752
1757
  key: "label",
1753
- placeholder: q("label", "Item"),
1758
+ placeholder: F("label", "Item"),
1754
1759
  type: "combobox",
1755
1760
  multi: !0,
1756
1761
  loadOptions: async (e) => ((await p.request(
@@ -1759,7 +1764,7 @@ function Bi({
1759
1764
  },
1760
1765
  {
1761
1766
  key: "owners",
1762
- placeholder: q("owners", "Owners"),
1767
+ placeholder: F("owners", "Owners"),
1763
1768
  type: "combobox",
1764
1769
  multi: !0,
1765
1770
  options: ((i == null ? void 0 : i.available_values.owners) ?? []).map((e) => ({
@@ -1767,9 +1772,9 @@ function Bi({
1767
1772
  value: e.id
1768
1773
  }))
1769
1774
  },
1770
- ...pt.map((e) => {
1775
+ ...ft.map((e) => {
1771
1776
  var b, m;
1772
- const t = Fn.get(e), n = q(`extra.${e}`, wt(e)), a = { key: `extra.${e}`, placeholder: n }, o = Ge(e);
1777
+ const t = Tn.get(e), n = F(`extra.${e}`, Nt(e)), a = { key: `extra.${e}`, placeholder: n }, o = He(e);
1773
1778
  if ((o == null ? void 0 : o.type) === "datetime") return { ...a, type: "date" };
1774
1779
  if ((o == null ? void 0 : o.type) === "number") return { ...a, type: "number" };
1775
1780
  if ((o == null ? void 0 : o.type) === "boolean")
@@ -1786,83 +1791,83 @@ function Bi({
1786
1791
  ...a,
1787
1792
  type: "combobox",
1788
1793
  multi: !0,
1789
- options: c.map((O) => ({ label: o ? Ye(O, o) : O, value: O }))
1794
+ options: c.map((O) => ({ label: o ? Xe(O, o) : O, value: O }))
1790
1795
  } : (t == null ? void 0 : t.kind) === "relation" ? {
1791
1796
  ...a,
1792
1797
  type: "combobox",
1793
1798
  multi: !0,
1794
- restricted: !!((m = Se[e]) != null && m.length),
1795
- loadOptions: Mr(t)
1799
+ restricted: !!((m = Ce[e]) != null && m.length),
1800
+ loadOptions: Qr(t)
1796
1801
  } : { ...a, placeholder: `Search ${n}…`, type: "text" };
1797
1802
  })
1798
- ], Tn = He.filter(
1799
- (e) => te.has(e.key) || e.key === "label" || e.key === "owners"
1800
- ), Qr = (e) => {
1803
+ ], Rn = Ye.filter(
1804
+ (e) => ne.has(e.key) || e.key === "label" || e.key === "owners"
1805
+ ), jr = (e) => {
1801
1806
  var t;
1802
- return (((t = He.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
1803
- }, ft = new Set(Object.keys(oe.current)), wl = ((e) => {
1807
+ return (((t = Ye.find((n) => n.key === e)) == null ? void 0 : t.placeholder) ?? e).replace(/^Search\s+/, "").replace(/…$/, "");
1808
+ }, xt = new Set(Object.keys(se.current)), Sl = ((e) => {
1804
1809
  var n;
1805
1810
  if (e.some((a) => a.key === "state")) return e;
1806
- const t = He.find((a) => a.key === "state");
1811
+ const t = Ye.find((a) => a.key === "state");
1807
1812
  return !t || i && !((n = i.available_values.state) != null && n.length) ? e : [...e, t];
1808
1813
  })(
1809
1814
  (() => {
1810
1815
  var o;
1811
1816
  const e = (c) => {
1812
- var Q, ke, Oe;
1817
+ var B, ve, Ee;
1813
1818
  if (!c.key.startsWith("extra.")) return null;
1814
1819
  if (c.type === "combobox") return c;
1815
- const b = c.key.slice(6), m = Fn.get(b), O = ft.has(c.key);
1820
+ const b = c.key.slice(6), m = Tn.get(b), O = xt.has(c.key);
1816
1821
  if ((m == null ? void 0 : m.kind) !== "relation" && !O) return null;
1817
- const F = Ge(b), y = (Q = i == null ? void 0 : i.available_values.extra) == null ? void 0 : Q[b], T = c.placeholder.replace(/^Search (.*)…$/, "$1");
1818
- return y != null && y.length ? {
1822
+ const T = He(b), k = (B = i == null ? void 0 : i.available_values.extra) == null ? void 0 : B[b], R = c.placeholder.replace(/^Search (.*)…$/, "$1");
1823
+ return k != null && k.length ? {
1819
1824
  key: c.key,
1820
- placeholder: T,
1825
+ placeholder: R,
1821
1826
  type: "combobox",
1822
1827
  multi: !0,
1823
- restricted: !!((ke = Se[b]) != null && ke.length),
1824
- options: y.map((_) => ({
1825
- label: F && F.type !== "number" ? Ye(_, F) : _,
1828
+ restricted: !!((ve = Ce[b]) != null && ve.length),
1829
+ options: k.map((_) => ({
1830
+ label: T && T.type !== "number" ? Xe(_, T) : _,
1826
1831
  value: _
1827
1832
  }))
1828
1833
  } : (m == null ? void 0 : m.kind) === "relation" ? {
1829
1834
  key: c.key,
1830
- placeholder: T,
1835
+ placeholder: R,
1831
1836
  type: "combobox",
1832
1837
  multi: !0,
1833
- restricted: !!((Oe = Se[b]) != null && Oe.length),
1834
- loadOptions: Mr(m)
1838
+ restricted: !!((Ee = Ce[b]) != null && Ee.length),
1839
+ loadOptions: Qr(m)
1835
1840
  } : null;
1836
1841
  };
1837
- if (Gn.length > 0) {
1842
+ if (Wn.length > 0) {
1838
1843
  const c = [], b = /* @__PURE__ */ new Set();
1839
- for (const m of Gn) {
1844
+ for (const m of Wn) {
1840
1845
  const O = (m.path ?? []).join(".");
1841
- let F;
1846
+ let T;
1842
1847
  if (m.key === "state" || /(^|_)state$/.test(((o = m.path) == null ? void 0 : o[0]) ?? ""))
1843
- F = He.find((y) => y.key === "state");
1848
+ T = Ye.find((k) => k.key === "state");
1844
1849
  else {
1845
- const y = He.filter((Q) => {
1846
- var Oe;
1847
- if (!Q.key.startsWith("extra.") || b.has(Q.key)) return !1;
1848
- const ke = Q.key.slice(6);
1849
- return ((Oe = Fn.get(ke)) == null ? void 0 : Oe.target_collection) === m.collection;
1850
- }), T = y.find((Q) => Q.key.slice(6).startsWith(`${O}.`)) ?? y[0];
1851
- F = T ? e(T) : null;
1850
+ const k = Ye.filter((B) => {
1851
+ var Ee;
1852
+ if (!B.key.startsWith("extra.") || b.has(B.key)) return !1;
1853
+ const ve = B.key.slice(6);
1854
+ return ((Ee = Tn.get(ve)) == null ? void 0 : Ee.target_collection) === m.collection;
1855
+ }), R = k.find((B) => B.key.slice(6).startsWith(`${O}.`)) ?? k[0];
1856
+ T = R ? e(R) : null;
1852
1857
  }
1853
- !F || b.has(F.key) || (b.add(F.key), c.push(m.label ? { ...F, placeholder: m.label } : F));
1858
+ !T || b.has(T.key) || (b.add(T.key), c.push(m.label ? { ...T, placeholder: m.label } : T));
1854
1859
  }
1855
- for (const m of He.map(e))
1856
- m && !b.has(m.key) && (ft.has(m.key) || m.restricted) && c.push(m);
1860
+ for (const m of Ye.map(e))
1861
+ m && !b.has(m.key) && (xt.has(m.key) || m.restricted) && c.push(m);
1857
1862
  if (c.length > 0) return c;
1858
1863
  }
1859
- const t = Tn.map(e).filter((c) => c !== null), a = [
1860
- ...t.filter((c) => ft.has(c.key) || c.restricted),
1861
- ...t.filter((c) => !ft.has(c.key) && !c.restricted)
1864
+ const t = Rn.map(e).filter((c) => c !== null), a = [
1865
+ ...t.filter((c) => xt.has(c.key) || c.restricted),
1866
+ ...t.filter((c) => !xt.has(c.key) && !c.restricted)
1862
1867
  ].slice(0, 6);
1863
- return a.length > 0 ? a : Tn.filter((c) => c.key === "state" || c.key === "owners");
1868
+ return a.length > 0 ? a : Rn.filter((c) => c.key === "state" || c.key === "owners");
1864
1869
  })()
1865
- ), _l = (() => {
1870
+ ), Cl = (() => {
1866
1871
  if (!x) return null;
1867
1872
  const e = Y ?? x, t = [
1868
1873
  {
@@ -1871,7 +1876,7 @@ function Bi({
1871
1876
  label: "past SLA",
1872
1877
  tone: "text-red-600 dark:text-red-400",
1873
1878
  on: w.sla_status === "breached",
1874
- toggle: () => Me("sla_status", "breached")
1879
+ toggle: () => Be("sla_status", "breached")
1875
1880
  },
1876
1881
  {
1877
1882
  key: "warning",
@@ -1879,7 +1884,7 @@ function Bi({
1879
1884
  label: "SLA soon",
1880
1885
  tone: "text-amber-700 dark:text-amber-400",
1881
1886
  on: w.sla_status === "warning",
1882
- toggle: () => Me("sla_status", "warning")
1887
+ toggle: () => Be("sla_status", "warning")
1883
1888
  },
1884
1889
  {
1885
1890
  key: "at_risk",
@@ -1887,7 +1892,7 @@ function Bi({
1887
1892
  label: "at risk",
1888
1893
  tone: "text-red-600 dark:text-red-400",
1889
1894
  on: w.at_risk === "yes",
1890
- toggle: () => Me("at_risk", "yes")
1895
+ toggle: () => Be("at_risk", "yes")
1891
1896
  },
1892
1897
  {
1893
1898
  key: "unowned",
@@ -1912,13 +1917,13 @@ function Bi({
1912
1917
  type: "button",
1913
1918
  onClick: n.toggle,
1914
1919
  "aria-pressed": n.on,
1915
- className: C(
1920
+ className: $(
1916
1921
  "rounded px-1 tabular-nums hover:bg-slate-100 dark:hover:bg-slate-800",
1917
1922
  n.on && "bg-slate-100 dark:bg-slate-800"
1918
1923
  ),
1919
1924
  "data-queue-summary-item": n.key,
1920
1925
  children: [
1921
- /* @__PURE__ */ r("span", { className: C("font-semibold", n.tone), children: n.n.toLocaleString() }),
1926
+ /* @__PURE__ */ r("span", { className: $("font-semibold", n.tone), children: n.n.toLocaleString() }),
1922
1927
  " ",
1923
1928
  n.label
1924
1929
  ]
@@ -1934,17 +1939,17 @@ function Bi({
1934
1939
  }
1935
1940
  );
1936
1941
  })();
1937
- function Nl(e) {
1938
- const t = new Set(te);
1939
- t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && Dn((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && Dn((n) => {
1942
+ function $l(e) {
1943
+ const t = new Set(ne);
1944
+ t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && Pn((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && Pn((n) => {
1940
1945
  const a = new Set(n);
1941
1946
  return a.delete(e), a;
1942
- })), Ot([...t]);
1947
+ })), Dt([...t]);
1943
1948
  }
1944
- 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: [
1949
+ return Tt ? (q == null ? void 0 : q((Tt == null ? void 0 : Tt.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
1945
1950
  /* @__PURE__ */ d("div", { className: "shrink-0", children: [
1946
1951
  (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: [
1947
- /* @__PURE__ */ r(Pl, { className: "h-4 w-4 shrink-0" }),
1952
+ /* @__PURE__ */ r(Bl, { className: "h-4 w-4 shrink-0" }),
1948
1953
  /* @__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." })
1949
1954
  ] }),
1950
1955
  /* @__PURE__ */ d(
@@ -1953,7 +1958,7 @@ function Bi({
1953
1958
  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",
1954
1959
  "data-queue-toolbar": !0,
1955
1960
  children: [
1956
- ae ? /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: vs.filter((e) => se || e.value !== "claimed").map(
1961
+ le ? /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: Ss.filter((e) => ie || e.value !== "claimed").map(
1957
1962
  (e, t) => /* @__PURE__ */ r(
1958
1963
  "button",
1959
1964
  {
@@ -1961,7 +1966,7 @@ function Bi({
1961
1966
  onClick: () => {
1962
1967
  J(e.value), L(1);
1963
1968
  },
1964
- className: C(
1969
+ className: $(
1965
1970
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
1966
1971
  t > 0 && "border-l border-slate-200 dark:border-border",
1967
1972
  g === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
@@ -1971,21 +1976,21 @@ function Bi({
1971
1976
  e.value
1972
1977
  )
1973
1978
  ) }) : /* @__PURE__ */ r("div", { className: "h-8 w-64 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
1974
- ae ? Ce.length <= 1 ? null : (
1979
+ le ? $e.length <= 1 ? null : (
1975
1980
  // One allowed view means nothing to switch to — no button.
1976
1981
  /* @__PURE__ */ r("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
1977
1982
  { value: "table", label: "Table" },
1978
1983
  { value: "kanban", label: "Kanban" },
1979
1984
  { value: "workload", label: "Workload" }
1980
- ].filter((e) => Ce.includes(e.value)).map((e, t) => /* @__PURE__ */ r(
1985
+ ].filter((e) => $e.includes(e.value)).map((e, t) => /* @__PURE__ */ r(
1981
1986
  "button",
1982
1987
  {
1983
1988
  type: "button",
1984
- onClick: () => Ee(e.value),
1985
- className: C(
1989
+ onClick: () => Le(e.value),
1990
+ className: $(
1986
1991
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
1987
1992
  t > 0 && "border-l border-slate-200 dark:border-border",
1988
- A === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
1993
+ S === e.value ? "bg-nvr-cyan/10 text-slate-900 dark:text-white" : "bg-white text-slate-500 hover:text-slate-700 dark:bg-slate-900 dark:text-slate-400 dark:hover:text-slate-200"
1989
1994
  ),
1990
1995
  children: e.label
1991
1996
  },
@@ -2010,7 +2015,7 @@ function Bi({
2010
2015
  ]
2011
2016
  }
2012
2017
  ),
2013
- Ve && /* @__PURE__ */ d(
2018
+ Ge && /* @__PURE__ */ d(
2014
2019
  "button",
2015
2020
  {
2016
2021
  type: "button",
@@ -2022,15 +2027,15 @@ function Bi({
2022
2027
  }),
2023
2028
  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"}`,
2024
2029
  children: [
2025
- /* @__PURE__ */ r(Kl, { className: "h-3.5 w-3.5" }),
2030
+ /* @__PURE__ */ r(Ql, { className: "h-3.5 w-3.5" }),
2026
2031
  "Active addendums"
2027
2032
  ]
2028
2033
  }
2029
2034
  ),
2030
- ge && /* @__PURE__ */ r(
2031
- zo,
2035
+ xe && /* @__PURE__ */ r(
2036
+ ts,
2032
2037
  {
2033
- label: q("integrations", "Integrations"),
2038
+ label: F("integrations", "Integrations"),
2034
2039
  value: w.integrations,
2035
2040
  onChange: (e) => K((t) => {
2036
2041
  const n = { ...t };
@@ -2038,49 +2043,49 @@ function Bi({
2038
2043
  })
2039
2044
  }
2040
2045
  ),
2041
- /* @__PURE__ */ r(ts, { className: "h-8" }),
2042
- /* @__PURE__ */ r(Vo, {}),
2043
- Xt > 0 && /* @__PURE__ */ d(
2046
+ /* @__PURE__ */ r(ls, { className: "h-8" }),
2047
+ /* @__PURE__ */ r(Jo, {}),
2048
+ en > 0 && /* @__PURE__ */ d(
2044
2049
  "button",
2045
2050
  {
2046
2051
  type: "button",
2047
- onClick: Ia,
2052
+ onClick: Ga,
2048
2053
  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",
2049
2054
  children: [
2050
- /* @__PURE__ */ r(Ml, { className: "h-3 w-3" }),
2051
- Xt,
2055
+ /* @__PURE__ */ r(jl, { className: "h-3 w-3" }),
2056
+ en,
2052
2057
  " update",
2053
- Xt === 1 ? "" : "s",
2058
+ en === 1 ? "" : "s",
2054
2059
  " · Refresh"
2055
2060
  ]
2056
2061
  }
2057
2062
  ),
2058
2063
  /* @__PURE__ */ d("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
2059
- A === "table" && /* @__PURE__ */ d(ze, { children: [
2060
- /* @__PURE__ */ r(Xe, { asChild: !0, children: /* @__PURE__ */ d(
2064
+ S === "table" && /* @__PURE__ */ d(Ze, { children: [
2065
+ /* @__PURE__ */ r(et, { asChild: !0, children: /* @__PURE__ */ d(
2061
2066
  "button",
2062
2067
  {
2063
2068
  type: "button",
2064
- className: C(
2069
+ className: $(
2065
2070
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2066
2071
  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"
2067
2072
  ),
2068
2073
  children: [
2069
- /* @__PURE__ */ r(aa, { className: "h-3.5 w-3.5" }),
2070
- N ? `Group: ${((Gr = Kr.find((e) => e.value === N)) == null ? void 0 : Gr.label) ?? N}` : "Group"
2074
+ /* @__PURE__ */ r(oa, { className: "h-3.5 w-3.5" }),
2075
+ N ? `Group: ${((Hr = Br.find((e) => e.value === N)) == null ? void 0 : Hr.label) ?? N}` : "Group"
2071
2076
  ]
2072
2077
  }
2073
2078
  ) }),
2074
- /* @__PURE__ */ r(Ze, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(ua, { children: [
2075
- /* @__PURE__ */ r(ss, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2076
- /* @__PURE__ */ d(ma, { children: [
2077
- /* @__PURE__ */ r(is, { children: "No attribute found." }),
2078
- /* @__PURE__ */ r(kt, { value: "__none__", onSelect: () => et(null), children: "None" }),
2079
- Kr.map((e) => /* @__PURE__ */ r(
2080
- kt,
2079
+ /* @__PURE__ */ r(tt, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(ba, { children: [
2080
+ /* @__PURE__ */ r(us, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2081
+ /* @__PURE__ */ d(pa, { children: [
2082
+ /* @__PURE__ */ r(ms, { children: "No attribute found." }),
2083
+ /* @__PURE__ */ r(wt, { value: "__none__", onSelect: () => nt(null), children: "None" }),
2084
+ Br.map((e) => /* @__PURE__ */ r(
2085
+ wt,
2081
2086
  {
2082
2087
  value: e.label,
2083
- onSelect: () => et(e.value),
2088
+ onSelect: () => nt(e.value),
2084
2089
  children: e.label
2085
2090
  },
2086
2091
  e.value
@@ -2088,53 +2093,53 @@ function Bi({
2088
2093
  ] })
2089
2094
  ] }) })
2090
2095
  ] }),
2091
- A === "table" && /* @__PURE__ */ d(
2096
+ S === "table" && /* @__PURE__ */ d(
2092
2097
  "button",
2093
2098
  {
2094
2099
  type: "button",
2095
2100
  onClick: () => {
2096
- Le(I === "-priority" ? "" : "-priority"), L(1);
2101
+ De(I === "-priority" ? "" : "-priority"), L(1);
2097
2102
  },
2098
- className: C(
2103
+ className: $(
2099
2104
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2100
2105
  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"
2101
2106
  ),
2102
2107
  children: [
2103
- /* @__PURE__ */ r(Ql, { className: "h-3.5 w-3.5" }),
2108
+ /* @__PURE__ */ r(Ul, { className: "h-3.5 w-3.5" }),
2104
2109
  "Priority"
2105
2110
  ]
2106
2111
  }
2107
2112
  ),
2108
- A === "table" && N && Z && /* @__PURE__ */ r(
2113
+ S === "table" && N && ee && /* @__PURE__ */ r(
2109
2114
  "button",
2110
2115
  {
2111
2116
  type: "button",
2112
- onClick: () => Jt(
2113
- he.size > 0 ? /* @__PURE__ */ new Set() : new Set(Z.map((e) => e.key))
2117
+ onClick: () => zt(
2118
+ fe.size > 0 ? /* @__PURE__ */ new Set() : new Set(ee.map((e) => e.key))
2114
2119
  ),
2115
2120
  className: "flex h-8 items-center rounded-md px-2 text-[12px] text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200",
2116
- children: he.size > 0 ? "Expand all" : "Collapse all"
2121
+ children: fe.size > 0 ? "Expand all" : "Collapse all"
2117
2122
  }
2118
2123
  ),
2119
- A === "kanban" && /* @__PURE__ */ d(ze, { children: [
2120
- /* @__PURE__ */ r(Xe, { asChild: !0, children: /* @__PURE__ */ d(
2124
+ S === "kanban" && /* @__PURE__ */ d(Ze, { children: [
2125
+ /* @__PURE__ */ r(et, { asChild: !0, children: /* @__PURE__ */ d(
2121
2126
  "button",
2122
2127
  {
2123
2128
  type: "button",
2124
- className: C(
2129
+ className: $(
2125
2130
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2126
- 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"
2131
+ rt ? "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"
2127
2132
  ),
2128
2133
  children: [
2129
- /* @__PURE__ */ r(aa, { className: "h-3.5 w-3.5" }),
2130
- tt ? `Lanes: ${tt === "collection" ? "Collection" : "Owner"}` : "Lanes"
2134
+ /* @__PURE__ */ r(oa, { className: "h-3.5 w-3.5" }),
2135
+ rt ? `Lanes: ${rt === "collection" ? "Collection" : "Owner"}` : "Lanes"
2131
2136
  ]
2132
2137
  }
2133
2138
  ) }),
2134
- /* @__PURE__ */ r(Ze, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ r(ua, { children: /* @__PURE__ */ d(ma, { children: [
2135
- /* @__PURE__ */ r(kt, { value: "none", onSelect: () => Yt(null), children: "None" }),
2136
- /* @__PURE__ */ r(kt, { value: "collection", onSelect: () => Yt("collection"), children: "Collection" }),
2137
- /* @__PURE__ */ r(kt, { value: "owner", onSelect: () => Yt("owners"), children: "Owner" })
2139
+ /* @__PURE__ */ r(tt, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ r(ba, { children: /* @__PURE__ */ d(pa, { children: [
2140
+ /* @__PURE__ */ r(wt, { value: "none", onSelect: () => Xt(null), children: "None" }),
2141
+ /* @__PURE__ */ r(wt, { value: "collection", onSelect: () => Xt("collection"), children: "Collection" }),
2142
+ /* @__PURE__ */ r(wt, { value: "owner", onSelect: () => Xt("owners"), children: "Owner" })
2138
2143
  ] }) }) })
2139
2144
  ] }),
2140
2145
  U && s && /* @__PURE__ */ d(
@@ -2146,7 +2151,7 @@ function Bi({
2146
2151
  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",
2147
2152
  "data-queue-ask": !0,
2148
2153
  children: [
2149
- /* @__PURE__ */ r(Bl, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
2154
+ /* @__PURE__ */ r(Il, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
2150
2155
  "Ask about this queue"
2151
2156
  ]
2152
2157
  }
@@ -2155,52 +2160,52 @@ function Bi({
2155
2160
  "button",
2156
2161
  {
2157
2162
  type: "button",
2158
- onClick: () => Ca((e) => !e),
2159
- "aria-expanded": rt,
2163
+ onClick: () => qa((e) => !e),
2164
+ "aria-expanded": lt,
2160
2165
  title: "Trends, aging, pace and states",
2161
- className: C(
2166
+ className: $(
2162
2167
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2163
- rt ? "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"
2168
+ lt ? "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"
2164
2169
  ),
2165
2170
  "data-queue-insights-toggle": !0,
2166
2171
  children: [
2167
- /* @__PURE__ */ r(jl, { className: "h-3.5 w-3.5" }),
2172
+ /* @__PURE__ */ r(Vl, { className: "h-3.5 w-3.5" }),
2168
2173
  "Insights"
2169
2174
  ]
2170
2175
  }
2171
2176
  ),
2172
- A === "table" && /* @__PURE__ */ d(ze, { children: [
2173
- /* @__PURE__ */ r(Xe, { asChild: !0, children: /* @__PURE__ */ d(
2177
+ S === "table" && /* @__PURE__ */ d(Ze, { children: [
2178
+ /* @__PURE__ */ r(et, { asChild: !0, children: /* @__PURE__ */ d(
2174
2179
  "button",
2175
2180
  {
2176
2181
  type: "button",
2177
2182
  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",
2178
2183
  children: [
2179
- /* @__PURE__ */ r(Ul, { className: "h-3.5 w-3.5" }),
2184
+ /* @__PURE__ */ r(Gl, { className: "h-3.5 w-3.5" }),
2180
2185
  "Columns"
2181
2186
  ]
2182
2187
  }
2183
2188
  ) }),
2184
- /* @__PURE__ */ r(Ze, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ r(
2185
- Fl,
2189
+ /* @__PURE__ */ r(tt, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ r(
2190
+ Al,
2186
2191
  {
2187
- sensors: gl,
2188
- collisionDetection: Tl,
2189
- onDragEnd: xl,
2192
+ sensors: kl,
2193
+ collisionDetection: Ol,
2194
+ onDragEnd: vl,
2190
2195
  children: /* @__PURE__ */ r(
2191
- Rl,
2196
+ El,
2192
2197
  {
2193
- items: We,
2194
- strategy: Al,
2195
- children: /* @__PURE__ */ r("div", { className: "space-y-1.5", children: We.map((e) => {
2196
- const t = Dr.find((n) => n.key === e);
2198
+ items: Je,
2199
+ strategy: Ll,
2200
+ children: /* @__PURE__ */ r("div", { className: "space-y-1.5", children: Je.map((e) => {
2201
+ const t = Kr.find((n) => n.key === e);
2197
2202
  return /* @__PURE__ */ r(
2198
- $s,
2203
+ Rs,
2199
2204
  {
2200
2205
  id: e,
2201
2206
  label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
2202
- checked: te.has(e),
2203
- onCheckedChange: () => Nl(e)
2207
+ checked: ne.has(e),
2208
+ onCheckedChange: () => $l(e)
2204
2209
  },
2205
2210
  e
2206
2211
  );
@@ -2210,74 +2215,89 @@ function Bi({
2210
2215
  }
2211
2216
  ) })
2212
2217
  ] }),
2213
- A === "table" && /* @__PURE__ */ r(
2218
+ S === "table" && At && /* @__PURE__ */ d(
2219
+ "button",
2220
+ {
2221
+ type: "button",
2222
+ onClick: sl,
2223
+ "aria-pressed": z,
2224
+ "data-queue-bulk-mode": z ? "on" : "off",
2225
+ "data-tip": z ? "Leave bulk mode — clears the selection and turns row actions back on" : "Select rows to act on several at once",
2226
+ className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium shadow-sm ${z ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "border-slate-200 bg-white text-slate-500 hover:bg-slate-50 hover:text-slate-700 dark:border-border dark:bg-card dark:text-slate-400 dark:hover:bg-muted"}`,
2227
+ children: [
2228
+ /* @__PURE__ */ r(Wl, { className: "h-3.5 w-3.5" }),
2229
+ z ? "Done" : "Bulk select"
2230
+ ]
2231
+ }
2232
+ ),
2233
+ S === "table" && /* @__PURE__ */ r(
2214
2234
  "button",
2215
2235
  {
2216
2236
  type: "button",
2217
2237
  onClick: () => {
2218
- const e = _t === "compact" ? "comfortable" : "compact";
2219
- pa(e);
2238
+ const e = St === "compact" ? "comfortable" : "compact";
2239
+ fa(e);
2220
2240
  try {
2221
2241
  localStorage.setItem("nvr_table_density", e);
2222
2242
  } catch {
2223
2243
  }
2224
2244
  },
2225
2245
  "aria-label": "Row density",
2226
- title: _t === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
2246
+ title: St === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
2227
2247
  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",
2228
- children: _t === "compact" ? /* @__PURE__ */ r(Il, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(Vl, { className: "h-3.5 w-3.5" })
2248
+ children: St === "compact" ? /* @__PURE__ */ r(Hl, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(Jl, { className: "h-3.5 w-3.5" })
2229
2249
  }
2230
2250
  ),
2231
- A === "table" && ya && ee.length > 0 && /* @__PURE__ */ d(
2251
+ S === "table" && va && te.length > 0 && /* @__PURE__ */ d(
2232
2252
  "button",
2233
2253
  {
2234
2254
  type: "button",
2235
- onClick: () => kr(),
2255
+ onClick: () => vr(),
2236
2256
  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",
2237
2257
  children: [
2238
- /* @__PURE__ */ r(Gl, { className: "h-3 w-3 fill-current" }),
2258
+ /* @__PURE__ */ r(Yl, { className: "h-3 w-3 fill-current" }),
2239
2259
  "Work Next"
2240
2260
  ]
2241
2261
  }
2242
2262
  ),
2243
- !rn && z.length === 1 && (Ft ? /* @__PURE__ */ d(ze, { children: [
2244
- /* @__PURE__ */ r(Xe, { asChild: !0, children: /* @__PURE__ */ d(
2263
+ !ln && X.length === 1 && (Rt ? /* @__PURE__ */ d(Ze, { children: [
2264
+ /* @__PURE__ */ r(et, { asChild: !0, children: /* @__PURE__ */ d(
2245
2265
  "button",
2246
2266
  {
2247
2267
  type: "button",
2248
2268
  className: "flex h-8 items-center gap-1.5 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",
2249
2269
  children: [
2250
- /* @__PURE__ */ r(Wt, { className: "h-3.5 w-3.5" }),
2270
+ /* @__PURE__ */ r(Jt, { className: "h-3.5 w-3.5" }),
2251
2271
  "New ",
2252
- An(z[0]),
2253
- /* @__PURE__ */ r(la, { className: "h-3 w-3 opacity-60" })
2272
+ On(X[0]),
2273
+ /* @__PURE__ */ r(sa, { className: "h-3 w-3 opacity-60" })
2254
2274
  ]
2255
2275
  }
2256
2276
  ) }),
2257
- /* @__PURE__ */ d(Ze, { align: "end", className: "w-60 p-1", children: [
2277
+ /* @__PURE__ */ d(tt, { align: "end", className: "w-60 p-1", children: [
2258
2278
  /* @__PURE__ */ d(
2259
2279
  "button",
2260
2280
  {
2261
2281
  type: "button",
2262
2282
  onClick: () => W.open({
2263
- collection: z[0],
2283
+ collection: X[0],
2264
2284
  itemId: "new",
2265
2285
  // Same layout the queue opens existing records with.
2266
2286
  layoutSlug: (u == null ? void 0 : u.item_layout) ?? null
2267
2287
  }),
2268
2288
  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",
2269
2289
  children: [
2270
- ((Wr = Ft.active) == null ? void 0 : Wr.create_label) ?? ((Hr = Ft.active) == null ? void 0 : Hr.name) ?? "Default layout",
2290
+ ((Jr = Rt.active) == null ? void 0 : Jr.create_label) ?? ((Yr = Rt.active) == null ? void 0 : Yr.name) ?? "Default layout",
2271
2291
  /* @__PURE__ */ r("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
2272
2292
  ]
2273
2293
  }
2274
2294
  ),
2275
- Ft.options.map((e) => /* @__PURE__ */ r(
2295
+ Rt.options.map((e) => /* @__PURE__ */ r(
2276
2296
  "button",
2277
2297
  {
2278
2298
  type: "button",
2279
2299
  onClick: () => W.open({
2280
- collection: z[0],
2300
+ collection: X[0],
2281
2301
  itemId: "new",
2282
2302
  layoutSlug: e.slug
2283
2303
  }),
@@ -2292,7 +2312,7 @@ function Bi({
2292
2312
  {
2293
2313
  type: "button",
2294
2314
  onClick: () => W.open({
2295
- collection: z[0],
2315
+ collection: X[0],
2296
2316
  itemId: "new",
2297
2317
  // Open a new record on the same layout the queue opens
2298
2318
  // existing ones with, so creating and reviewing match.
@@ -2300,26 +2320,26 @@ function Bi({
2300
2320
  }),
2301
2321
  className: "flex h-8 items-center gap-1.5 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",
2302
2322
  children: [
2303
- /* @__PURE__ */ r(Wt, { className: "h-3.5 w-3.5" }),
2323
+ /* @__PURE__ */ r(Jt, { className: "h-3.5 w-3.5" }),
2304
2324
  "New ",
2305
- An(z[0])
2325
+ On(X[0])
2306
2326
  ]
2307
2327
  }
2308
2328
  )),
2309
- !rn && z.length > 1 && /* @__PURE__ */ d(ze, { children: [
2310
- /* @__PURE__ */ r(Xe, { asChild: !0, children: /* @__PURE__ */ d(
2329
+ !ln && X.length > 1 && /* @__PURE__ */ d(Ze, { children: [
2330
+ /* @__PURE__ */ r(et, { asChild: !0, children: /* @__PURE__ */ d(
2311
2331
  "button",
2312
2332
  {
2313
2333
  type: "button",
2314
2334
  className: "flex h-8 items-center gap-1.5 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",
2315
2335
  children: [
2316
- /* @__PURE__ */ r(Wt, { className: "h-3.5 w-3.5" }),
2336
+ /* @__PURE__ */ r(Jt, { className: "h-3.5 w-3.5" }),
2317
2337
  "New",
2318
- /* @__PURE__ */ r(la, { className: "h-3 w-3 opacity-60" })
2338
+ /* @__PURE__ */ r(sa, { className: "h-3 w-3 opacity-60" })
2319
2339
  ]
2320
2340
  }
2321
2341
  ) }),
2322
- /* @__PURE__ */ r(Ze, { align: "end", className: "w-56 p-1", children: z.map((e) => /* @__PURE__ */ d(
2342
+ /* @__PURE__ */ r(tt, { align: "end", className: "w-56 p-1", children: X.map((e) => /* @__PURE__ */ d(
2323
2343
  "button",
2324
2344
  {
2325
2345
  type: "button",
@@ -2330,18 +2350,18 @@ function Bi({
2330
2350
  }),
2331
2351
  className: "flex w-full items-center gap-2 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",
2332
2352
  children: [
2333
- /* @__PURE__ */ r(Wt, { className: "h-3 w-3 opacity-60" }),
2334
- An(e)
2353
+ /* @__PURE__ */ r(Jt, { className: "h-3 w-3 opacity-60" }),
2354
+ On(e)
2335
2355
  ]
2336
2356
  },
2337
2357
  e
2338
2358
  )) })
2339
2359
  ] }),
2340
- !rn && Pe && pe && /* @__PURE__ */ r(
2341
- Ho,
2360
+ !ln && Ke && he && /* @__PURE__ */ r(
2361
+ Xo,
2342
2362
  {
2343
- collection: Pe,
2344
- onParsed: (e, t) => pe(`/collections/${Pe}/new`, {
2363
+ collection: Ke,
2364
+ onParsed: (e, t) => he(`/collections/${Ke}/new`, {
2345
2365
  state: { importResult: e, importTemplateId: t.id }
2346
2366
  })
2347
2367
  }
@@ -2350,7 +2370,7 @@ function Bi({
2350
2370
  ]
2351
2371
  }
2352
2372
  ),
2353
- rt && /* @__PURE__ */ d(
2373
+ lt && /* @__PURE__ */ d(
2354
2374
  "div",
2355
2375
  {
2356
2376
  className: "flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-slate-100 bg-white px-4 py-2.5 dark:border-slate-800 dark:bg-slate-900",
@@ -2358,69 +2378,69 @@ function Bi({
2358
2378
  children: [
2359
2379
  /* @__PURE__ */ d("div", { className: "nvr-stagger-direct flex divide-x divide-slate-200 overflow-hidden rounded-lg border border-slate-200 bg-white dark:divide-border dark:border-border dark:bg-card", children: [
2360
2380
  /* @__PURE__ */ r(
2361
- vt,
2381
+ _t,
2362
2382
  {
2363
2383
  label: "Total",
2364
2384
  count: (x == null ? void 0 : x.total) ?? 0,
2365
2385
  filteredCount: Y ? Y.total : null,
2366
- active: Object.values(w).every(Na) && g === "all",
2367
- isLoading: Be,
2368
- ...ot("total"),
2369
- onClick: Sa
2386
+ active: Object.values(w).every(Ca) && g === "all",
2387
+ isLoading: je,
2388
+ ...it("total"),
2389
+ onClick: $a
2370
2390
  }
2371
2391
  ),
2372
2392
  /* @__PURE__ */ r(
2373
- vt,
2393
+ _t,
2374
2394
  {
2375
2395
  label: "Warning",
2376
2396
  count: (x == null ? void 0 : x.sla_warning) ?? 0,
2377
2397
  filteredCount: Y ? Y.sla_warning : null,
2378
2398
  tone: "amber",
2379
2399
  active: w.sla_status === "warning",
2380
- isLoading: Be,
2400
+ isLoading: je,
2381
2401
  deltaBadIsUp: !0,
2382
- ...ot("sla_warning"),
2383
- onClick: () => Me("sla_status", "warning")
2402
+ ...it("sla_warning"),
2403
+ onClick: () => Be("sla_status", "warning")
2384
2404
  }
2385
2405
  ),
2386
2406
  /* @__PURE__ */ r(
2387
- vt,
2407
+ _t,
2388
2408
  {
2389
2409
  label: "Breached",
2390
2410
  count: (x == null ? void 0 : x.sla_breached) ?? 0,
2391
2411
  filteredCount: Y ? Y.sla_breached : null,
2392
2412
  tone: "red",
2393
2413
  active: w.sla_status === "breached",
2394
- isLoading: Be,
2414
+ isLoading: je,
2395
2415
  deltaBadIsUp: !0,
2396
- ...ot("sla_breached"),
2397
- onClick: () => Me("sla_status", "breached")
2416
+ ...it("sla_breached"),
2417
+ onClick: () => Be("sla_status", "breached")
2398
2418
  }
2399
2419
  ),
2400
2420
  /* @__PURE__ */ r(
2401
- vt,
2421
+ _t,
2402
2422
  {
2403
2423
  label: "At Risk",
2404
2424
  count: (x == null ? void 0 : x.at_risk) ?? 0,
2405
2425
  filteredCount: Y ? Y.at_risk : null,
2406
2426
  tone: "red",
2407
2427
  active: w.at_risk === "yes",
2408
- isLoading: Be,
2428
+ isLoading: je,
2409
2429
  deltaBadIsUp: !0,
2410
- ...ot("at_risk"),
2411
- onClick: () => Me("at_risk", "yes")
2430
+ ...it("at_risk"),
2431
+ onClick: () => Be("at_risk", "yes")
2412
2432
  }
2413
2433
  ),
2414
2434
  /* @__PURE__ */ r(
2415
- vt,
2435
+ _t,
2416
2436
  {
2417
2437
  label: "Unowned",
2418
2438
  count: (x == null ? void 0 : x.unowned) ?? 0,
2419
2439
  filteredCount: Y ? Y.unowned : null,
2420
2440
  active: g === "unowned",
2421
- isLoading: Be,
2441
+ isLoading: je,
2422
2442
  deltaBadIsUp: !0,
2423
- ...ot("unowned"),
2443
+ ...it("unowned"),
2424
2444
  onClick: () => {
2425
2445
  J(g === "unowned" ? "all" : "unowned"), L(1);
2426
2446
  }
@@ -2442,7 +2462,7 @@ function Bi({
2442
2462
  aging_hours: a.aging_hours === t ? "" : t
2443
2463
  })), L(1);
2444
2464
  },
2445
- className: C(
2465
+ className: $(
2446
2466
  "rounded-md border px-2 py-1 tabular-nums transition-colors",
2447
2467
  w.aging_hours === t ? "border-nvr-cyan bg-nvr-cyan/10 font-medium text-[#0e7490] dark:text-[#67e8f9]" : "border-slate-200 text-slate-500 hover:bg-muted dark:border-border dark:text-muted-foreground",
2448
2468
  n === 0 && "opacity-45"
@@ -2455,38 +2475,38 @@ function Bi({
2455
2475
  },
2456
2476
  e
2457
2477
  )) }),
2458
- me && /* @__PURE__ */ r(
2478
+ be && /* @__PURE__ */ r(
2459
2479
  "span",
2460
2480
  {
2461
2481
  "data-queue-burndown": !0,
2462
- className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11.5px] font-medium ${me.dir === "down" ? "border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-400" : me.dir === "up" ? "border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-muted-foreground"}`,
2482
+ className: `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11.5px] font-medium ${be.dir === "down" ? "border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-400" : be.dir === "up" ? "border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-500 dark:border-border dark:bg-muted dark:text-muted-foreground"}`,
2463
2483
  "data-tip": "Average net change per day over the last 14 days of snapshots",
2464
- children: me.dir === "down" ? /* @__PURE__ */ d(we, { children: [
2484
+ children: be.dir === "down" ? /* @__PURE__ */ d(_e, { children: [
2465
2485
  "▼ ",
2466
- Math.abs(me.pace).toFixed(1),
2486
+ Math.abs(be.pace).toFixed(1),
2467
2487
  "/day — clears in ~",
2468
- me.days,
2488
+ be.days,
2469
2489
  " day",
2470
- me.days === 1 ? "" : "s",
2490
+ be.days === 1 ? "" : "s",
2471
2491
  " at this pace"
2472
- ] }) : me.dir === "up" ? /* @__PURE__ */ d(we, { children: [
2492
+ ] }) : be.dir === "up" ? /* @__PURE__ */ d(_e, { children: [
2473
2493
  "▲ Growing ",
2474
- me.pace.toFixed(1),
2494
+ be.pace.toFixed(1),
2475
2495
  "/day"
2476
- ] }) : /* @__PURE__ */ r(we, { children: "→ Holding steady" })
2496
+ ] }) : /* @__PURE__ */ r(_e, { children: "→ Holding steady" })
2477
2497
  }
2478
2498
  ),
2479
- xr.length > 0 && /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: xr.map(([e, t]) => {
2499
+ yr.length > 0 && /* @__PURE__ */ r("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: yr.map(([e, t]) => {
2480
2500
  var n;
2481
2501
  return /* @__PURE__ */ r(
2482
- Cs,
2502
+ Ts,
2483
2503
  {
2484
- label: Fe(e),
2504
+ label: Te(e),
2485
2505
  count: t,
2486
2506
  filteredCount: Y ? Y.by_state[e] ?? 0 : null,
2487
- color: ((n = xe[e]) == null ? void 0 : n.color) ?? null,
2488
- active: _a.includes(e),
2489
- onClick: () => wa(e)
2507
+ color: ((n = ye[e]) == null ? void 0 : n.color) ?? null,
2508
+ active: Sa.includes(e),
2509
+ onClick: () => Na(e)
2490
2510
  },
2491
2511
  e
2492
2512
  );
@@ -2494,19 +2514,19 @@ function Bi({
2494
2514
  ]
2495
2515
  }
2496
2516
  ),
2497
- A !== "workload" && /* @__PURE__ */ r(
2498
- hs,
2517
+ S !== "workload" && /* @__PURE__ */ r(
2518
+ ys,
2499
2519
  {
2500
- defs: wl,
2520
+ defs: Sl,
2501
2521
  values: w,
2502
- seededKeys: ft,
2522
+ seededKeys: xt,
2503
2523
  onApply: (e) => {
2504
2524
  K((t) => ({ ...t, ...e })), L(1);
2505
2525
  },
2506
2526
  onClear: () => {
2507
- K({ ...oe.current }), L(1);
2527
+ K({ ...se.current }), L(1);
2508
2528
  },
2509
- right: _l
2529
+ right: Cl
2510
2530
  }
2511
2531
  ),
2512
2532
  /* @__PURE__ */ d(
@@ -2515,25 +2535,25 @@ function Bi({
2515
2535
  className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-white px-4 py-1.5 dark:border-slate-800 dark:bg-slate-900",
2516
2536
  "data-queue-saved-views": !0,
2517
2537
  children: [
2518
- ((i == null ? void 0 : i.total) ?? 0) > 0 && ie > 0 && /* @__PURE__ */ d(
2538
+ ((i == null ? void 0 : i.total) ?? 0) > 0 && ce > 0 && /* @__PURE__ */ d(
2519
2539
  "span",
2520
2540
  {
2521
- "data-queue-default-hiding": ie,
2541
+ "data-queue-default-hiding": ce,
2522
2542
  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",
2523
2543
  children: [
2524
2544
  "Your default ",
2525
- tr(Qr),
2545
+ nr(jr),
2526
2546
  " filter is hiding",
2527
2547
  " ",
2528
- ie.toLocaleString("en-US"),
2548
+ ce.toLocaleString("en-US"),
2529
2549
  " item",
2530
- ie === 1 ? "" : "s",
2550
+ ce === 1 ? "" : "s",
2531
2551
  " ·",
2532
2552
  /* @__PURE__ */ r(
2533
2553
  "button",
2534
2554
  {
2535
2555
  type: "button",
2536
- onClick: nr,
2556
+ onClick: rr,
2537
2557
  className: "font-medium text-[#0284a8] underline-offset-2 hover:underline dark:text-nvr-cyan",
2538
2558
  children: "Show all"
2539
2559
  }
@@ -2580,11 +2600,11 @@ function Bi({
2580
2600
  "button",
2581
2601
  {
2582
2602
  type: "button",
2583
- onClick: tl,
2603
+ onClick: rl,
2584
2604
  title: "Revert to the queue default (filters, columns and sort cleared)",
2585
- className: C(
2605
+ className: $(
2586
2606
  "inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors",
2587
- ut == null ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2607
+ bt == null ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2588
2608
  ),
2589
2609
  children: "Default"
2590
2610
  }
@@ -2594,86 +2614,86 @@ function Bi({
2594
2614
  return /* @__PURE__ */ d(
2595
2615
  "span",
2596
2616
  {
2597
- className: C(
2617
+ className: $(
2598
2618
  "group inline-flex h-6 items-center gap-1 rounded-full border px-2.5 text-[12px] transition-colors",
2599
- ut === e.id ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2619
+ bt === e.id ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"
2600
2620
  ),
2601
2621
  children: [
2602
2622
  /* @__PURE__ */ r(
2603
2623
  "button",
2604
2624
  {
2605
2625
  type: "button",
2606
- title: Ie === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
2607
- onClick: () => al.mutate(Ie === e.id ? null : e.id),
2608
- className: C(
2626
+ title: Ve === e.id ? "Your default view — click to revert to the general default" : "Set as your default view",
2627
+ onClick: () => ol.mutate(Ve === e.id ? null : e.id),
2628
+ className: $(
2609
2629
  "shrink-0",
2610
- Ie === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
2630
+ Ve === e.id ? "text-amber-400" : "text-slate-300 hover:text-amber-400 dark:text-slate-600"
2611
2631
  ),
2612
2632
  children: /* @__PURE__ */ r(
2613
- Wl,
2633
+ zl,
2614
2634
  {
2615
- className: C("h-3 w-3", Ie === e.id && "fill-current"),
2616
- "aria-label": Ie === e.id ? "Default view" : "Set as default"
2635
+ className: $("h-3 w-3", Ve === e.id && "fill-current"),
2636
+ "aria-label": Ve === e.id ? "Default view" : "Set as default"
2617
2637
  }
2618
2638
  )
2619
2639
  }
2620
2640
  ),
2621
- /* @__PURE__ */ d("button", { type: "button", onClick: () => Qt(e), children: [
2641
+ /* @__PURE__ */ d("button", { type: "button", onClick: () => Ut(e), children: [
2622
2642
  e.name,
2623
2643
  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" })
2624
2644
  ] }),
2625
- Sr && /* @__PURE__ */ r(
2645
+ Cr && /* @__PURE__ */ r(
2626
2646
  "button",
2627
2647
  {
2628
2648
  type: "button",
2629
- onClick: () => nl.mutate({ viewId: e.id, on: !e.is_default }),
2649
+ onClick: () => al.mutate({ viewId: e.id, on: !e.is_default }),
2630
2650
  title: e.is_default ? "Queue default — click to unset" : "Set as the default view for everyone on this queue",
2631
- className: C(
2651
+ className: $(
2632
2652
  "shrink-0",
2633
2653
  e.is_default ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2634
2654
  ),
2635
2655
  "aria-label": e.is_default ? "Unset queue default" : "Set queue default",
2636
- children: /* @__PURE__ */ r(Hl, { className: C("h-3 w-3", e.is_default && "fill-current") })
2656
+ children: /* @__PURE__ */ r(Xl, { className: $("h-3 w-3", e.is_default && "fill-current") })
2637
2657
  }
2638
2658
  ),
2639
- (e.user === v || Ut) && ut === e.id && /* @__PURE__ */ r(
2659
+ (e.user === v || Gt) && bt === e.id && /* @__PURE__ */ r(
2640
2660
  "button",
2641
2661
  {
2642
2662
  type: "button",
2643
- onClick: () => Re.mutate(e),
2644
- disabled: Re.isPending,
2663
+ onClick: () => Ae.mutate(e),
2664
+ disabled: Ae.isPending,
2645
2665
  title: "Update this view with the current filters, scope and sort",
2646
2666
  className: "shrink-0 text-slate-400 hover:text-nvr-navy disabled:opacity-50 dark:hover:text-nvr-cyan",
2647
2667
  "aria-label": `Update view ${e.name}`,
2648
- "data-view-update-state": Re.isPending ? "saving" : $r === e.id ? "saved" : "idle",
2649
- children: Re.isPending && ((t = Re.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ r(Jl, { className: "h-3 w-3 animate-spin" }) : $r === e.id ? /* @__PURE__ */ r(
2650
- Yl,
2668
+ "data-view-update-state": Ae.isPending ? "saving" : qr === e.id ? "saved" : "idle",
2669
+ children: Ae.isPending && ((t = Ae.variables) == null ? void 0 : t.id) === e.id ? /* @__PURE__ */ r(Zl, { className: "h-3 w-3 animate-spin" }) : qr === e.id ? /* @__PURE__ */ r(
2670
+ eo,
2651
2671
  {
2652
2672
  className: "h-3 w-3 text-emerald-600 dark:text-emerald-400",
2653
2673
  strokeWidth: 3
2654
2674
  }
2655
- ) : /* @__PURE__ */ r(zl, { className: "h-3 w-3" })
2675
+ ) : /* @__PURE__ */ r(to, { className: "h-3 w-3" })
2656
2676
  }
2657
2677
  ),
2658
- ut === e.id && /* @__PURE__ */ r(
2678
+ bt === e.id && /* @__PURE__ */ r(
2659
2679
  "button",
2660
2680
  {
2661
2681
  type: "button",
2662
- onClick: () => qa(e.id),
2663
- 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)",
2664
- className: C(
2682
+ onClick: () => Ta(e.id),
2683
+ title: Ot(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
2684
+ className: $(
2665
2685
  "shrink-0",
2666
- Tt(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2686
+ Ot(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
2667
2687
  ),
2668
2688
  "aria-label": `Subscribe to view ${e.name}`,
2669
- children: /* @__PURE__ */ r(Xl, { className: C("h-3 w-3", Tt(e.id) && "fill-current") })
2689
+ children: /* @__PURE__ */ r(no, { className: $("h-3 w-3", Ot(e.id) && "fill-current") })
2670
2690
  }
2671
2691
  ),
2672
2692
  e.user === v && /* @__PURE__ */ r(
2673
2693
  "button",
2674
2694
  {
2675
2695
  type: "button",
2676
- onClick: () => rl.mutate(e.id),
2696
+ onClick: () => ll.mutate(e.id),
2677
2697
  className: "invisible text-slate-400 hover:text-red-500 group-hover:visible",
2678
2698
  "aria-label": `Delete view ${e.name}`,
2679
2699
  children: "×"
@@ -2684,8 +2704,8 @@ function Bi({
2684
2704
  e.id
2685
2705
  );
2686
2706
  }),
2687
- /* @__PURE__ */ d(ze, { open: el, onOpenChange: Nn, children: [
2688
- /* @__PURE__ */ r(Xe, { asChild: !0, children: /* @__PURE__ */ r(
2707
+ /* @__PURE__ */ d(Ze, { open: nl, onOpenChange: Sn, children: [
2708
+ /* @__PURE__ */ r(et, { asChild: !0, children: /* @__PURE__ */ r(
2689
2709
  "button",
2690
2710
  {
2691
2711
  type: "button",
@@ -2694,16 +2714,16 @@ function Bi({
2694
2714
  children: "☆ Save view"
2695
2715
  }
2696
2716
  ) }),
2697
- /* @__PURE__ */ d(Ze, { className: "w-[240px] p-3", align: "end", children: [
2717
+ /* @__PURE__ */ d(tt, { className: "w-[240px] p-3", align: "end", children: [
2698
2718
  (() => {
2699
- const e = V == null ? void 0 : V.data.find((t) => t.id === ut);
2700
- return !e || e.user !== v && !Ut ? null : /* @__PURE__ */ d(
2719
+ const e = V == null ? void 0 : V.data.find((t) => t.id === bt);
2720
+ return !e || e.user !== v && !Gt ? null : /* @__PURE__ */ d(
2701
2721
  "button",
2702
2722
  {
2703
2723
  type: "button",
2704
- disabled: Re.isPending,
2724
+ disabled: Ae.isPending,
2705
2725
  onClick: () => {
2706
- Re.mutate(e), Nn(!1);
2726
+ Ae.mutate(e), Sn(!1);
2707
2727
  },
2708
2728
  className: "mb-2 w-full rounded-md border border-nvr-cyan/40 bg-nvr-cyan/5 px-2 py-1.5 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/10 disabled:opacity-50 dark:text-nvr-cyan",
2709
2729
  children: [
@@ -2717,29 +2737,29 @@ function Bi({
2717
2737
  /* @__PURE__ */ r(
2718
2738
  "input",
2719
2739
  {
2720
- value: Sn,
2721
- onChange: (e) => vr(e.target.value),
2740
+ value: Cn,
2741
+ onChange: (e) => wr(e.target.value),
2722
2742
  placeholder: "View name",
2723
2743
  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"
2724
2744
  }
2725
2745
  ),
2726
2746
  /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2727
2747
  /* @__PURE__ */ r(
2728
- En,
2748
+ Ln,
2729
2749
  {
2730
- checked: wr || bt,
2731
- disabled: bt,
2732
- onCheckedChange: (e) => _r(e === !0)
2750
+ checked: _r || ht,
2751
+ disabled: ht,
2752
+ onCheckedChange: (e) => Nr(e === !0)
2733
2753
  }
2734
2754
  ),
2735
2755
  "Share with everyone"
2736
2756
  ] }),
2737
- Sr && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2757
+ Cr && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
2738
2758
  /* @__PURE__ */ r(
2739
- En,
2759
+ Ln,
2740
2760
  {
2741
- checked: bt,
2742
- onCheckedChange: (e) => Nr(e === !0)
2761
+ checked: ht,
2762
+ onCheckedChange: (e) => Sr(e === !0)
2743
2763
  }
2744
2764
  ),
2745
2765
  "Set as queue default (everyone starts here)"
@@ -2748,8 +2768,8 @@ function Bi({
2748
2768
  "button",
2749
2769
  {
2750
2770
  type: "button",
2751
- disabled: !Sn.trim() || Cr.isPending,
2752
- onClick: () => Cr.mutate(),
2771
+ disabled: !Cn.trim() || $r.isPending,
2772
+ onClick: () => $r.mutate(),
2753
2773
  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",
2754
2774
  children: "Save current view"
2755
2775
  }
@@ -2760,71 +2780,71 @@ function Bi({
2760
2780
  }
2761
2781
  )
2762
2782
  ] }),
2763
- /* @__PURE__ */ d("div", { ref: Bt, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
2764
- Xn && /* @__PURE__ */ r(Zo, { error: Oa, onRetry: () => void Ea(), className: "mb-3" }),
2765
- A === "table" ? /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
2783
+ /* @__PURE__ */ d("div", { ref: It, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
2784
+ Zn && /* @__PURE__ */ r(rs, { error: La, onRetry: () => void Da(), className: "mb-3" }),
2785
+ S === "table" ? /* @__PURE__ */ r(_e, { children: /* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
2766
2786
  "div",
2767
2787
  {
2768
- ref: Ne.rootRef,
2769
- className: C(
2788
+ ref: Se.rootRef,
2789
+ className: $(
2770
2790
  "relative min-w-0 flex-1 transition-opacity duration-200",
2771
- rr && "pointer-events-none opacity-60"
2791
+ ar && "pointer-events-none opacity-60"
2772
2792
  ),
2773
- "aria-busy": rr || void 0,
2793
+ "aria-busy": ar || void 0,
2774
2794
  children: [
2775
- ar != 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: [
2795
+ lr != 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: [
2776
2796
  "Still working — ",
2777
- ar,
2797
+ lr,
2778
2798
  "s"
2779
2799
  ] }),
2780
2800
  /* @__PURE__ */ r(
2781
- Uo,
2801
+ Wo,
2782
2802
  {
2783
2803
  fillHeight: !0,
2784
- enterKey: ir.current,
2785
- density: _t,
2804
+ enterKey: cr.current,
2805
+ density: St,
2786
2806
  minBodyHeight: 360,
2787
- columns: Vt,
2788
- rows: S,
2807
+ columns: Wt,
2808
+ rows: C,
2789
2809
  rowKey: (e) => `${e.collection}:${e.item_id}`,
2790
2810
  total: (i == null ? void 0 : i.total) ?? 0,
2791
- page: _e,
2792
- limit: nn,
2793
- isLoading: Be,
2811
+ page: Ne,
2812
+ limit: an,
2813
+ isLoading: je,
2794
2814
  onPageChange: L,
2795
- onRowClick: (e) => Mt(e),
2796
- rowDragProps: (e) => ja({ collection: e.collection, id: e.item_id }),
2815
+ onRowClick: (e) => jt(e),
2816
+ rowDragProps: (e) => Ia({ collection: e.collection, id: e.item_id }),
2797
2817
  onRowContextMenu: (e, t) => {
2798
- t.preventDefault(), dt({ x: t.clientX, y: t.clientY, row: e });
2818
+ t.preventDefault(), mt({ x: t.clientX, y: t.clientY, row: e });
2799
2819
  },
2800
2820
  rowTitle: (e) => {
2801
- const t = Dt.get(P(e));
2802
- return Ne.titleFor(P(e)) ?? (t && !t.is_mine ? yo(t) : void 0);
2821
+ const t = Mt.get(P(e));
2822
+ return Se.titleFor(P(e)) ?? (t && !t.is_mine ? _o(t) : void 0);
2803
2823
  },
2804
- rowClassName: (e) => Pt === P(e) ? (
2824
+ rowClassName: (e) => Bt === P(e) ? (
2805
2825
  // Pinned sticky cells use bg-inherit — the highlight must be
2806
2826
  // OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
2807
2827
  // scrolled content bleeds through the pinned columns. Same
2808
2828
  // pair DataTable uses for selected rows when pins are active.
2809
2829
  "bg-[#f2fdff] dark:bg-[#20303a]"
2810
- ) : e.at_risk ? qo(e.at_risk_color ?? "red") : void 0,
2811
- emptyMessage: Xn ? /* @__PURE__ */ r("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ r(
2812
- Io,
2830
+ ) : e.at_risk ? Ao(e.at_risk_color ?? "red") : void 0,
2831
+ emptyMessage: Zn ? /* @__PURE__ */ r("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ r(
2832
+ Ho,
2813
2833
  {
2814
- icon: Zl,
2815
- title: ((Jr = i == null ? void 0 : i.empty) == null ? void 0 : Jr.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((Yr = i == null ? void 0 : i.empty) == null ? void 0 : Yr.reason) === "scope_mine" ? "Nothing waiting on you" : ((zr = i == null ? void 0 : i.empty) == null ? void 0 : zr.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
2816
- detail: ((Xr = i == null ? void 0 : i.empty) == null ? void 0 : Xr.reason) === "filters" && ie > 0 ? `Your default ${tr(Qr)} 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." : ((ea = i == null ? void 0 : i.empty) == null ? void 0 : ea.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
2817
- action: ((ta = i == null ? void 0 : i.empty) == null ? void 0 : ta.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
2818
- ie > 0 && /* @__PURE__ */ d(
2834
+ icon: ro,
2835
+ title: ((zr = i == null ? void 0 : i.empty) == null ? void 0 : zr.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((Xr = i == null ? void 0 : i.empty) == null ? void 0 : Xr.reason) === "scope_mine" ? "Nothing waiting on you" : ((Zr = i == null ? void 0 : i.empty) == null ? void 0 : Zr.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
2836
+ detail: ((ea = i == null ? void 0 : i.empty) == null ? void 0 : ea.reason) === "filters" && ce > 0 ? `Your default ${nr(jr)} filter is hiding ${ce.toLocaleString("en-US")} item${ce === 1 ? "" : "s"} here.` : ((ta = i == null ? void 0 : i.empty) == null ? void 0 : ta.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." : ((na = i == null ? void 0 : i.empty) == null ? void 0 : na.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
2837
+ action: ((ra = i == null ? void 0 : i.empty) == null ? void 0 : ra.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
2838
+ ce > 0 && /* @__PURE__ */ d(
2819
2839
  "button",
2820
2840
  {
2821
2841
  type: "button",
2822
- onClick: nr,
2842
+ onClick: rr,
2823
2843
  className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[12px] font-semibold text-white hover:brightness-105",
2824
2844
  "data-queue-empty-defaults": !0,
2825
2845
  children: [
2826
2846
  "Show all ",
2827
- ie.toLocaleString("en-US")
2847
+ ce.toLocaleString("en-US")
2828
2848
  ]
2829
2849
  }
2830
2850
  ),
@@ -2835,8 +2855,8 @@ function Bi({
2835
2855
  onClick: () => {
2836
2856
  var t;
2837
2857
  const e = {};
2838
- for (const [n, a] of Object.entries(oe.current))
2839
- (t = Se[n.slice(6)]) != null && t.length && (e[n] = a);
2858
+ for (const [n, a] of Object.entries(se.current))
2859
+ (t = Ce[n.slice(6)]) != null && t.length && (e[n] = a);
2840
2860
  K(e), L(1);
2841
2861
  },
2842
2862
  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",
@@ -2861,33 +2881,33 @@ function Bi({
2861
2881
  ),
2862
2882
  sort: I,
2863
2883
  onSortChange: (e) => {
2864
- Le(e), L(1);
2884
+ De(e), L(1);
2865
2885
  },
2866
- filterDefs: Tn,
2886
+ filterDefs: Rn,
2867
2887
  filterValues: w,
2868
2888
  onFilterChange: (e, t) => {
2869
2889
  K((n) => ({ ...n, [e]: t })), L(1);
2870
2890
  },
2871
- rowGroups: ol ?? void 0,
2872
- collapsedGroups: he,
2873
- onToggleGroup: za,
2874
- selectedIds: an ? Ae : void 0,
2875
- onSelectionChange: an ? It : void 0,
2891
+ rowGroups: cl ?? void 0,
2892
+ collapsedGroups: fe,
2893
+ onToggleGroup: Za,
2894
+ selectedIds: At && z ? Oe : void 0,
2895
+ onSelectionChange: At && z ? We : void 0,
2876
2896
  hideFilterRow: !0,
2877
2897
  nowrapCells: !0,
2878
- columnPins: Pr,
2898
+ columnPins: Mr,
2879
2899
  onColumnPinChange: (e, t) => {
2880
- zt((n) => {
2881
- const a = { ...n ?? Pr };
2900
+ Zt((n) => {
2901
+ const a = { ...n ?? Mr };
2882
2902
  return t ? a[e] = t : delete a[e], a;
2883
2903
  });
2884
2904
  },
2885
2905
  columnFilterRow: !0,
2886
2906
  hScrollProxy: !0,
2887
2907
  footer: /* @__PURE__ */ r(
2888
- rs,
2908
+ ss,
2889
2909
  {
2890
- collections: st,
2910
+ collections: ct,
2891
2911
  selectedIds: String(w.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
2892
2912
  onToggle: (e) => {
2893
2913
  const t = e.ids.join(",");
@@ -2903,105 +2923,105 @@ function Bi({
2903
2923
  )
2904
2924
  ]
2905
2925
  }
2906
- ) }) }) : A === "kanban" ? /* @__PURE__ */ r(
2907
- ps,
2926
+ ) }) }) : S === "kanban" ? /* @__PURE__ */ r(
2927
+ xs,
2908
2928
  {
2909
- items: S,
2910
- onCardClick: (e) => Mt(e),
2911
- onDrop: (e, t) => Ka.mutate({ item: e, targetState: t }),
2912
- onClaim: (e) => qe.mutate(e),
2913
- onRelease: (e) => je.mutate(e),
2914
- swimlaneBy: tt,
2915
- stateLabels: kn,
2916
- laneLabel: tt === "collection" ? it : void 0,
2917
- claimsEnabled: se,
2929
+ items: C,
2930
+ onCardClick: (e) => jt(e),
2931
+ onDrop: (e, t) => Ba.mutate({ item: e, targetState: t }),
2932
+ onClaim: (e) => Fe.mutate(e),
2933
+ onRelease: (e) => Ue.mutate(e),
2934
+ swimlaneBy: rt,
2935
+ stateLabels: vn,
2936
+ laneLabel: rt === "collection" ? dt : void 0,
2937
+ claimsEnabled: ie,
2918
2938
  onDraggingChange: (e) => {
2919
2939
  Qn.current = e;
2920
2940
  }
2921
2941
  }
2922
- ) : /* @__PURE__ */ r(fs, { queueId: l })
2942
+ ) : /* @__PURE__ */ r(ks, { queueId: l })
2923
2943
  ] }),
2924
- an && /* @__PURE__ */ d(
2925
- ms,
2944
+ At && z && /* @__PURE__ */ d(
2945
+ fs,
2926
2946
  {
2927
- count: Ae.length,
2928
- claimsEnabled: se,
2929
- showClaim: ln("claim"),
2930
- showRelease: ln("release"),
2931
- showTransition: ln("transition"),
2932
- states: yr((i == null ? void 0 : i.available_values.state) ?? []).map((e) => ({
2947
+ count: Oe.length,
2948
+ claimsEnabled: ie,
2949
+ showClaim: on("claim"),
2950
+ showRelease: on("release"),
2951
+ showTransition: on("transition"),
2952
+ states: kr((i == null ? void 0 : i.available_values.state) ?? []).map((e) => ({
2933
2953
  value: e,
2934
- label: Fe(e)
2954
+ label: Te(e)
2935
2955
  })),
2936
- busy: Fr,
2937
- onClaim: () => Cn(
2956
+ busy: Rr,
2957
+ onClaim: () => $n(
2938
2958
  "Claim",
2939
2959
  (e) => p.request(
2940
- ne(`/queues/${l}/claim`, {
2960
+ re(`/queues/${l}/claim`, {
2941
2961
  source_collection: e.collection,
2942
2962
  item_id: e.item_id
2943
2963
  })
2944
2964
  )
2945
2965
  ),
2946
- onRelease: () => Cn(
2966
+ onRelease: () => $n(
2947
2967
  "Release",
2948
2968
  (e) => p.request(
2949
- ne(`/queues/${l}/release`, {
2969
+ re(`/queues/${l}/release`, {
2950
2970
  source_collection: e.collection,
2951
2971
  item_id: e.item_id
2952
2972
  })
2953
2973
  )
2954
2974
  ),
2955
- onTransition: (e) => Cn("Transition", (t) => lr(t, e)),
2956
- onClear: () => It([]),
2975
+ onTransition: (e) => $n("Transition", (t) => or(t, e)),
2976
+ onClear: () => We([]),
2957
2977
  children: [
2958
- Ae.length >= 2 && /* @__PURE__ */ r(
2978
+ Oe.length >= 2 && /* @__PURE__ */ r(
2959
2979
  "button",
2960
2980
  {
2961
2981
  type: "button",
2962
2982
  onClick: () => {
2963
- const e = vo(
2964
- S.filter((t) => Ae.includes(P(t)) && t.collection !== "tasks").map((t) => W.urlFor(_n(t)))
2983
+ const e = So(
2984
+ C.filter((t) => Oe.includes(P(t)) && t.collection !== "tasks").map((t) => W.urlFor(Nn(t)))
2965
2985
  );
2966
- e.blocked > 0 || e.capped > 0 ? R.warning(ca(e)) : R.success(ca(e));
2986
+ e.blocked > 0 || e.capped > 0 ? A.warning(ua(e)) : A.success(ua(e));
2967
2987
  },
2968
2988
  "data-bulk-open-tabs": !0,
2969
- title: `Open the selected records in new tabs (up to ${ko})`,
2989
+ title: `Open the selected records in new tabs (up to ${No})`,
2970
2990
  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",
2971
2991
  children: "Open in tabs"
2972
2992
  }
2973
2993
  ),
2974
2994
  /* @__PURE__ */ r(
2975
- Qo,
2995
+ Io,
2976
2996
  {
2977
- targets: S.filter((e) => Ae.includes(P(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
2997
+ targets: C.filter((e) => Oe.includes(P(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
2978
2998
  enabledKeys: (u == null ? void 0 : u.bulk_action_keys) ?? null,
2979
2999
  tone: "light",
2980
- disabled: Fr,
3000
+ disabled: Rr,
2981
3001
  onDone: (e) => {
2982
- e.failed === 0 && It([]), h.invalidateQueries({ queryKey: ["queue-items", l] });
3002
+ e.failed === 0 && We([]), h.invalidateQueries({ queryKey: ["queue-items", l] });
2983
3003
  }
2984
3004
  }
2985
3005
  )
2986
3006
  ]
2987
3007
  }
2988
3008
  ),
2989
- X != null && X.length ? /* @__PURE__ */ r(
2990
- ns,
3009
+ Z != null && Z.length ? /* @__PURE__ */ r(
3010
+ os,
2991
3011
  {
2992
- collection: X[0].collection,
2993
- itemId: X[0].itemId,
2994
- layoutId: X[0].layoutId,
2995
- rootLayoutSlug: X[0].rootLayoutSlug,
2996
- width: X[0].width,
2997
- title: X[0].title,
2998
- stack: X,
2999
- onPush: (e) => ht.push([...X, e]),
3000
- onPop: () => ht.back(),
3001
- onClose: () => ht.back(X.length)
3012
+ collection: Z[0].collection,
3013
+ itemId: Z[0].itemId,
3014
+ layoutId: Z[0].layoutId,
3015
+ rootLayoutSlug: Z[0].rootLayoutSlug,
3016
+ width: Z[0].width,
3017
+ title: Z[0].title,
3018
+ stack: Z,
3019
+ onPush: (e) => gt.push([...Z, e]),
3020
+ onPop: () => gt.back(),
3021
+ onClose: () => gt.back(Z.length)
3002
3022
  }
3003
3023
  ) : null,
3004
- M && oa(
3024
+ M && ia(
3005
3025
  /* @__PURE__ */ d(
3006
3026
  "div",
3007
3027
  {
@@ -3016,14 +3036,14 @@ function Bi({
3016
3036
  "data-queue-row-menu": !0,
3017
3037
  children: [
3018
3038
  [
3019
- { label: "Open", run: () => Mt(M.row) },
3039
+ { label: "Open", run: () => jt(M.row) },
3020
3040
  {
3021
3041
  label: "Open full record",
3022
- run: () => ct(M.row)
3042
+ run: () => ut(M.row)
3023
3043
  },
3024
- { label: "Peek", run: () => Te(M.row) },
3025
- ...se ? [
3026
- ((na = M.row.claimed_by) == null ? void 0 : na.id) === v ? { label: "Release claim", run: () => je.mutate(M.row) } : { label: "Claim", run: () => qe.mutate(M.row) }
3044
+ { label: "Peek", run: () => Re(M.row) },
3045
+ ...ie ? [
3046
+ ((aa = M.row.claimed_by) == null ? void 0 : aa.id) === v ? { label: "Release claim", run: () => Ue.mutate(M.row) } : { label: "Claim", run: () => Fe.mutate(M.row) }
3027
3047
  ] : [],
3028
3048
  {
3029
3049
  label: "Copy ID",
@@ -3037,21 +3057,21 @@ function Bi({
3037
3057
  run: () => {
3038
3058
  var e;
3039
3059
  return void ((e = navigator.clipboard) == null ? void 0 : e.writeText(
3040
- `${window.location.origin}${W.urlFor(_n(M.row))}`
3060
+ `${window.location.origin}${W.urlFor(Nn(M.row))}`
3041
3061
  ));
3042
3062
  }
3043
3063
  },
3044
3064
  // Custom actions (#125): the record's registered actions, right here.
3045
- ...Ta(M.row.collection).map((e) => ({
3065
+ ...Aa(M.row.collection).map((e) => ({
3046
3066
  label: e.label,
3047
- run: () => Ra(e, M.row)
3067
+ run: () => Oa(e, M.row)
3048
3068
  }))
3049
3069
  ].map((e) => /* @__PURE__ */ r(
3050
3070
  "button",
3051
3071
  {
3052
3072
  type: "button",
3053
3073
  onClick: () => {
3054
- e.run(), dt(null);
3074
+ e.run(), mt(null);
3055
3075
  },
3056
3076
  className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
3057
3077
  children: e.label
@@ -3060,14 +3080,14 @@ function Bi({
3060
3080
  )),
3061
3081
  M.row.collection !== "tasks" && /* @__PURE__ */ d("div", { className: "mt-1 border-t border-slate-100 pt-1 dark:border-border/60", children: [
3062
3082
  /* @__PURE__ */ r("p", { className: "px-3 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Triage labels" }),
3063
- dn.slice(0, 8).map((e) => {
3083
+ un.slice(0, 8).map((e) => {
3064
3084
  const t = (M.row.labels ?? []).includes(e);
3065
3085
  return /* @__PURE__ */ d(
3066
3086
  "button",
3067
3087
  {
3068
3088
  type: "button",
3069
3089
  onClick: () => {
3070
- Yn(M.row, e), dt(null);
3090
+ zn(M.row, e), mt(null);
3071
3091
  },
3072
3092
  className: "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
3073
3093
  children: [
@@ -3091,7 +3111,7 @@ function Bi({
3091
3111
  const n = e.target.elements.namedItem(
3092
3112
  "newlabel"
3093
3113
  ).value.trim();
3094
- n && (Yn(M.row, n), dt(null));
3114
+ n && (zn(M.row, n), mt(null));
3095
3115
  },
3096
3116
  className: "px-3 py-1",
3097
3117
  children: /* @__PURE__ */ r(
@@ -3112,50 +3132,50 @@ function Bi({
3112
3132
  ),
3113
3133
  document.body
3114
3134
  ),
3115
- Jn && oa(
3135
+ Yn && ia(
3116
3136
  /* @__PURE__ */ r(
3117
- qs,
3137
+ As,
3118
3138
  {
3119
3139
  queueId: l,
3120
- drill: Jn,
3121
- onClose: () => sn(null),
3140
+ drill: Yn,
3141
+ onClose: () => cn(null),
3122
3142
  onOpenRecord: (e, t) => {
3123
- sn(null), W.open({ collection: e, itemId: t, layoutSlug: null });
3143
+ cn(null), W.open({ collection: e, itemId: t, layoutSlug: null });
3124
3144
  }
3125
3145
  }
3126
3146
  ),
3127
3147
  document.body
3128
3148
  ),
3129
3149
  /* @__PURE__ */ r(
3130
- bs,
3150
+ gs,
3131
3151
  {
3132
- item: ye,
3133
- stateLabels: kn,
3134
- collectionLabel: it,
3135
- claimsEnabled: se,
3136
- columnFormats: cl,
3152
+ item: ke,
3153
+ stateLabels: vn,
3154
+ collectionLabel: dt,
3155
+ claimsEnabled: ie,
3156
+ columnFormats: ml,
3137
3157
  width: u == null ? void 0 : u.sheet_width,
3138
3158
  itemLayout: u == null ? void 0 : u.item_layout,
3139
3159
  onOpenChange: (e) => {
3140
- e || (Te(null), wn(!1));
3160
+ e || (Re(null), _n(!1));
3141
3161
  },
3142
- onClaim: (e) => qe.mutate(e),
3143
- onRelease: (e) => je.mutate(e),
3144
- workNextActive: Xa,
3145
- onNext: () => ye && kr(ye),
3162
+ onClaim: (e) => Fe.mutate(e),
3163
+ onRelease: (e) => Ue.mutate(e),
3164
+ workNextActive: el,
3165
+ onNext: () => ke && vr(ke),
3146
3166
  refetchItems: () => h.invalidateQueries({ queryKey: ["queue-items", l] })
3147
3167
  }
3148
3168
  ),
3149
- At.dialog
3169
+ Lt.dialog
3150
3170
  ] });
3151
3171
  }
3152
- function qs({
3172
+ function As({
3153
3173
  queueId: l,
3154
3174
  drill: f,
3155
- onClose: $,
3175
+ onClose: q,
3156
3176
  onOpenRecord: D
3157
3177
  }) {
3158
- const U = ba(), { data: h, isLoading: p } = H({
3178
+ const U = ha(), { data: h, isLoading: p } = H({
3159
3179
  queryKey: ["queue-agg-rows", l, f.row.collection, f.row.item_id, f.path],
3160
3180
  queryFn: () => U.request(
3161
3181
  E(`/queues/${l}/aggregate-rows`, {
@@ -3169,7 +3189,7 @@ function qs({
3169
3189
  "div",
3170
3190
  {
3171
3191
  className: "fixed inset-0 z-[130] flex items-center justify-center bg-black/30 p-6",
3172
- onClick: $,
3192
+ onClick: q,
3173
3193
  children: /* @__PURE__ */ d(
3174
3194
  "div",
3175
3195
  {
@@ -3180,7 +3200,7 @@ function qs({
3180
3200
  /* @__PURE__ */ d("div", { children: [
3181
3201
  /* @__PURE__ */ r("p", { className: "text-[13px] font-semibold", children: f.row.label }),
3182
3202
  /* @__PURE__ */ d("p", { className: "text-[11.5px] text-muted-foreground", children: [
3183
- wt(f.path),
3203
+ Nt(f.path),
3184
3204
  " = ",
3185
3205
  /* @__PURE__ */ r("span", { className: "tabular-nums", children: f.value }),
3186
3206
  " ",
@@ -3191,7 +3211,7 @@ function qs({
3191
3211
  "button",
3192
3212
  {
3193
3213
  type: "button",
3194
- onClick: $,
3214
+ onClick: q,
3195
3215
  className: "rounded-md px-2 py-1 text-[12px] text-slate-400 hover:bg-muted",
3196
3216
  children: "✕"
3197
3217
  }
@@ -3216,5 +3236,5 @@ function qs({
3216
3236
  );
3217
3237
  }
3218
3238
  export {
3219
- Bi as QueueWorklist
3239
+ Vi as QueueWorklist
3220
3240
  };