@nivaro/react 0.3.41 → 0.3.43

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