@nivaro/react 0.3.117 → 0.3.118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +136 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3757 -3695
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  27. package/dist/shared/components/TipLayer.js +65 -58
  28. package/dist/shared/components/WidgetImageMenu.js +83 -43
  29. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  31. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  32. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  33. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  34. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  35. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  37. package/dist/shared/components/collections-directory/page-model.js +72 -67
  38. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  39. package/dist/shared/components/integrations/SendStatus.js +65 -59
  40. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  41. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  42. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  43. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  44. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  45. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  46. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  47. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  48. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  49. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  50. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  51. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  52. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  53. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  54. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  55. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  56. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  57. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  58. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  59. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  60. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  61. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  62. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  63. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  64. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  65. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  66. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  67. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  68. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  69. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  70. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  71. package/dist/shared/components/item-edit/UserChip.js +1 -1
  72. package/dist/shared/components/item-edit/file-live.js +69 -54
  73. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  74. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  75. package/dist/shared/components/item-edit/removed-line.js +31 -25
  76. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  77. package/dist/shared/components/list/ListViewers.js +46 -35
  78. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  79. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  80. package/dist/shared/components/panels/AlertBanners.js +82 -72
  81. package/dist/shared/components/panels/BranchLanes.js +22 -22
  82. package/dist/shared/components/panels/CommentImages.js +123 -102
  83. package/dist/shared/components/panels/CommentPanel.js +186 -185
  84. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  85. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  86. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  87. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  88. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  89. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  90. package/dist/shared/components/profile/AgentNameField.js +107 -81
  91. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  92. package/dist/shared/components/profile/PersonAccess.js +599 -495
  93. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  94. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  95. package/dist/shared/components/profile/primitives.js +1 -1
  96. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  97. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  98. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  99. package/dist/shared/components/support/AssignRules.js +1733 -0
  100. package/dist/shared/components/support/PersonPick.js +88 -0
  101. package/dist/shared/components/support/RequestList.js +790 -0
  102. package/dist/shared/components/support/ScreenShare.js +158 -152
  103. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  104. package/dist/shared/components/support/SupportView.js +140 -246
  105. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  106. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  107. package/dist/shared/components/support/assign-rules-text.js +171 -0
  108. package/dist/shared/components/support/support-list.js +125 -0
  109. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  110. package/dist/shared/components/ui/checkbox.js +6 -6
  111. package/dist/shared/components/ui/select.js +43 -39
  112. package/dist/shared/components/ui/sheet.js +9 -9
  113. package/dist/shared/components/ui/switch.js +12 -11
  114. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  115. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  116. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  117. package/dist/shared/lib/activity-sentence.js +103 -91
  118. package/dist/shared/lib/agent-presence.js +27 -21
  119. package/dist/shared/lib/approval-progress.js +2 -2
  120. package/dist/shared/lib/copy-rules.js +31 -24
  121. package/dist/shared/lib/derived-causes.js +113 -78
  122. package/dist/shared/lib/grid-cursors.js +26 -26
  123. package/dist/shared/lib/label-flash.js +27 -0
  124. package/dist/shared/lib/list-return.js +137 -125
  125. package/dist/shared/lib/live-deltas.js +40 -34
  126. package/dist/shared/lib/live-groups.js +56 -52
  127. package/dist/shared/lib/live-preference.js +64 -59
  128. package/dist/shared/lib/live-screen.js +223 -192
  129. package/dist/shared/lib/partner-failure.js +11 -11
  130. package/dist/shared/lib/rollup-recalc.js +68 -64
  131. package/dist/shared/lib/screen-refresh.js +74 -68
  132. package/dist/shared/lib/screen-share.js +108 -104
  133. package/dist/shared/lib/send-status.js +77 -61
  134. package/dist/shared/lib/text-diff-window.js +29 -0
  135. package/dist/shared/lib/watch-list.js +210 -209
  136. package/dist/shared/lib/widget-image-render.js +72 -49
  137. package/package.json +1 -1
@@ -3,23 +3,23 @@ import { useSensors as Hs, useSensor as Js, PointerSensor as Ys, DndContext as z
3
3
  import { SortableContext as Zs, verticalListSortingStrategy as ei, arrayMove as ti, useSortable as ni } from "@dnd-kit/sortable";
4
4
  import { CSS as ri } from "@dnd-kit/utilities";
5
5
  import { useQueryClient as ai, useQuery as ne, useMutation as Qe, useQueries as nt } from "@tanstack/react-query";
6
- import { AlertTriangle as oi, RefreshCw as li, Plus as An, ChevronDown as Vo, FileDiff as si, Group as ii, Check as qr, Flame as ci, Rows3 as di, Sparkles as ui, Loader2 as Go, Download as mi, BarChart3 as pi, SlidersHorizontal as fi, ListChecks as bi, Rows4 as hi, Rows2 as yi, Play as gi, Star as xi, Pin as ki, Save as vi, Bell as wi, Inbox as _i, GripVertical as Ni } from "lucide-react";
7
- import { useState as _, useRef as O, useMemo as W, useEffect as K } from "react";
6
+ import { AlertTriangle as oi, RefreshCw as li, Plus as qn, ChevronDown as Vo, FileDiff as si, Group as ii, Check as qr, Flame as ci, Rows3 as di, Sparkles as ui, Loader2 as Go, Download as mi, BarChart3 as pi, SlidersHorizontal as fi, ListChecks as bi, Rows4 as hi, Rows2 as yi, Play as gi, Star as xi, Pin as ki, Save as vi, Bell as wi, Inbox as _i, GripVertical as Ni } from "lucide-react";
7
+ import { useState as N, useRef as O, useMemo as W, useEffect as P } from "react";
8
8
  import { createPortal as Wo } from "react-dom";
9
- import { toast as P } from "sonner";
9
+ import { toast as K } from "sonner";
10
10
  import { useNivaroClient as dl, useItemEditAuth as Io, useItemNavigation as Si, useNavigation as Ci, useOverlayState as $i } from "../../context.js";
11
- import { useDebounced as Ti } from "../../hooks/useDebounced.js";
12
- import { useElapsedLoading as Ri } from "../../hooks/useElapsedLoading.js";
11
+ import { useDebounced as Ri } from "../../hooks/useDebounced.js";
12
+ import { useElapsedLoading as Ti } from "../../hooks/useElapsedLoading.js";
13
13
  import { useSlowReason as Li } from "../../hooks/useSlowReason.js";
14
14
  import { useBulkProgressFeed as Oi } from "../../lib/bulk-progress.js";
15
15
  import { get as D, post as ge, patch as Ho, del as Er, put as Fi } from "../../lib/commands.js";
16
16
  import { useDeadlineNow as Ai, liveDeadlineStatus as qi, dueInText as Ei } from "../../lib/deadline-ticker.js";
17
- import { deepenForLightSurface as Ki } from "../../lib/display-prefs.js";
18
- import { evaluateExpression as Pi } from "../../lib/expression.js";
17
+ import { deepenForLightSurface as Pi } from "../../lib/display-prefs.js";
18
+ import { evaluateExpression as Ki } from "../../lib/expression.js";
19
19
  import { clauseFromControlValue as Di, filterSentence as Mi } from "../../lib/filter-sentence.js";
20
20
  import { releaseLiveOwner as Bi, deliverLive as ji } from "../../lib/focus-mode.js";
21
21
  import { formatMultiValue as rt } from "../../lib/format-value.js";
22
- import { QUEUE_IN_STEP_COLUMN as Kr, queueServerSort as Pr } from "../../lib/in-step.js";
22
+ import { QUEUE_IN_STEP_COLUMN as Pr, queueServerSort as Kr } from "../../lib/in-step.js";
23
23
  import { createCursorBook as Qi, pageRequest as Ui, noteNextCursor as Vi } from "../../lib/keyset-pager.js";
24
24
  import { normalizeInlineEdit as Gi, inlineM2oTarget as Wi, inlineChoices as Ii, inlineEditFor as Hi, nextInlineKey as Ji } from "../../lib/list-inline-edit.js";
25
25
  import { sanitizeQueueLinkState as Yi, readListLinkFromLocation as zi, dropListLinkParam as Xi, encodeListLink as Zi, replaceListLinkParam as ec } from "../../lib/list-link.js";
@@ -33,15 +33,15 @@ import { listTrailDetail as wc, setTrailDetail as _c } from "../../lib/nav-trail
33
33
  import { OPEN_IN_TABS_CAP as Nc, openInTabs as Sc, openInTabsMessage as Xo } from "../../lib/open-in-tabs.js";
34
34
  import { isOwnWrite as Cc } from "../../lib/own-writes.js";
35
35
  import { usePrefetchIntent as $c } from "../../lib/prefetch.js";
36
- import { useRowPresence as Tc, rowPresenceKey as Zo } from "../../lib/presence-hooks.js";
37
- import { queryKeys as Rc } from "../../lib/query-keys.js";
36
+ import { useRowPresence as Rc, rowPresenceKey as Zo } from "../../lib/presence-hooks.js";
37
+ import { queryKeys as Tc } from "../../lib/query-keys.js";
38
38
  import { buildGroups as Lc } from "../../lib/queue-grouping.js";
39
39
  import { cascadeFilter as Oc, fetchCascadeRelations as Fc } from "../../lib/quick-filter-cascade.js";
40
40
  import { useOptionalRealtime as Ac } from "../../lib/realtime.js";
41
41
  import { copyIdText as el } from "../../lib/record-ref.js";
42
42
  import { rowHighlightTextClass as qc, rowHighlightClass as Ec } from "../../lib/row-highlight.js";
43
- import { userErrorMessage as St } from "../../lib/safe-error.js";
44
- import { useSelectionPicks as Kc, splitSelKey as Dr, useSelectionLiveMarks as Pc, useSelectionChanges as Dc, useSelectedRowMemory as Mc, selectionSums as Bc } from "../../lib/selection-watch.js";
43
+ import { userErrorMessage as Ct } from "../../lib/safe-error.js";
44
+ import { useSelectionPicks as Pc, splitSelKey as Dr, useSelectionLiveMarks as Kc, useSelectionChanges as Dc, useSelectedRowMemory as Mc, selectionSums as Bc } from "../../lib/selection-watch.js";
45
45
  import { listViewInput as jc } from "../../lib/send-view.js";
46
46
  import { useTableDensity as Qc } from "../../lib/table-density.js";
47
47
  import { useMyScopes as Uc, matchScopeDimension as Vc } from "../../lib/use-my-scopes.js";
@@ -69,83 +69,83 @@ import { readQueueReturn as _d, queueReturnApplies as Nd, writeQueueReturn as ol
69
69
  import { ListLoadError as Sd } from "../ListLoadError.js";
70
70
  import { LiveCount as Br } from "../LiveCount.js";
71
71
  import { LivePauseButton as Cd, LiveBurstPill as $d } from "../LiveListControls.js";
72
- import { LiveRowMark as Td } from "../LiveRowMark.js";
73
- import { CopyListLinkButton as Rd } from "../list/CopyListLinkButton.js";
74
- import { useInlineEdit as Ld, InlineEditCell as Od } from "../list/InlineEdit.js";
72
+ import { LiveRowMark as Rd, MovingRowChip as Td } from "../LiveRowMark.js";
73
+ import { CopyListLinkButton as Ld } from "../list/CopyListLinkButton.js";
74
+ import { useInlineEdit as Od, InlineEditCell as Fd } from "../list/InlineEdit.js";
75
75
  import { ListViewers as ll } from "../list/ListViewers.js";
76
- import { OverflowRail as Fd } from "../OverflowRail.js";
77
- import { usePickerExcludedRows as Ad, PICKER_EXCLUDED_ROW_CLASS as qd, PICKER_EXCLUDED_TITLE as Ed } from "../PickerExcludedRows.js";
76
+ import { OverflowRail as Ad } from "../OverflowRail.js";
77
+ import { usePickerExcludedRows as qd, PICKER_EXCLUDED_ROW_CLASS as Ed, PICKER_EXCLUDED_TITLE as Pd } from "../PickerExcludedRows.js";
78
78
  import { RealtimeStaleMark as Kd } from "../RealtimeStatusBanner.js";
79
- import { RecordDrilldownSheet as Pd } from "../RecordDrilldownSheet.js";
80
- import { RowHighlightLegend as Dd } from "../RowHighlightLegend.js";
81
- import { RowPresence as Md } from "../RowPresence.js";
82
- import { SendViewButton as Bd } from "../send-view/SendViewButton.js";
83
- import { UnseenDot as jd } from "../UnseenDot.js";
84
- import { Badge as Qd } from "../ui/badge.js";
79
+ import { RecordDrilldownSheet as Dd } from "../RecordDrilldownSheet.js";
80
+ import { RowHighlightLegend as Md } from "../RowHighlightLegend.js";
81
+ import { RowPresence as Bd } from "../RowPresence.js";
82
+ import { SendViewButton as jd } from "../send-view/SendViewButton.js";
83
+ import { UnseenDot as Qd } from "../UnseenDot.js";
84
+ import { Badge as Ud } from "../ui/badge.js";
85
85
  import { Checkbox as Ur } from "../ui/checkbox.js";
86
- import { Command as sl, CommandInput as Ud, CommandList as il, CommandEmpty as Vd, CommandItem as on } from "../ui/command.js";
87
- import { Label as Gd } from "../ui/label.js";
88
- import { Popover as Ct, PopoverTrigger as $t, PopoverContent as Tt } from "../ui/popover.js";
86
+ import { Command as sl, CommandInput as Vd, CommandList as il, CommandEmpty as Gd, CommandItem as sn } from "../ui/command.js";
87
+ import { Label as Wd } from "../ui/label.js";
88
+ import { Popover as $t, PopoverTrigger as Rt, PopoverContent as Tt } from "../ui/popover.js";
89
89
  import { Skeleton as ul } from "../ui/skeleton.js";
90
- import { dedupeChooserKeys as Wd } from "./column-chooser.js";
91
- import { groupSumPathsFor as Id } from "./group-sums.js";
92
- import { offscreenPill as Hd, statsOutrunRows as Jd, stateAspectEffect as Yd } from "./live-state-aspect.js";
93
- import { OwnerAvatars as zd } from "./OwnerAvatars.js";
94
- import { pathHeader as Xd } from "./path-label.js";
95
- import { QueueBulkBar as Zd } from "./QueueBulkBar.js";
96
- import { QueueBulkMove as eu } from "./QueueBulkMove.js";
97
- import { QueueItemSheet as tu } from "./QueueItemSheet.js";
98
- import { QueueKanbanBoard as nu } from "./QueueKanbanBoard.js";
99
- import { QueueQuickFilters as ru } from "./QueueQuickFilters.js";
100
- import { QueueTeamStrip as au } from "./QueueTeamStrip.js";
101
- import { QueueWorkloadView as ou } from "./QueueWorkloadView.js";
102
- import { queueTotalColumns as lu, queueTotalPaths as su, queueTotalValue as iu, formulaTotalFormat as cu, queueTotalTip as du, queueTotalsEligibleKey as jr, queueTotalsStoreKey as qn, queueTotalsSupport as uu } from "./queue-totals.js";
103
- import { useTransitionNote as mu, needsTransitionNote as pu } from "./transition-note.js";
104
- import { worklistCsv as fu, worklistCsvName as bu } from "./worklist-csv.js";
105
- import { extraChoiceText as ln, formulaColumnKeys as hu, atRiskBreakdown as cl, queuePinKeepRank as yu, worklistKeyTarget as gu } from "./worklist-helpers.js";
106
- function xu({ summary: o }) {
107
- if (!o || o.count === 0)
90
+ import { dedupeChooserKeys as Id } from "./column-chooser.js";
91
+ import { groupSumPathsFor as Hd } from "./group-sums.js";
92
+ import { offscreenPill as Jd, statsOutrunRows as Yd, stateAspectEffect as zd } from "./live-state-aspect.js";
93
+ import { OwnerAvatars as Xd } from "./OwnerAvatars.js";
94
+ import { pathHeader as Zd } from "./path-label.js";
95
+ import { QueueBulkBar as eu } from "./QueueBulkBar.js";
96
+ import { QueueBulkMove as tu } from "./QueueBulkMove.js";
97
+ import { QueueItemSheet as nu } from "./QueueItemSheet.js";
98
+ import { QueueKanbanBoard as ru } from "./QueueKanbanBoard.js";
99
+ import { QueueQuickFilters as au } from "./QueueQuickFilters.js";
100
+ import { QueueTeamStrip as ou } from "./QueueTeamStrip.js";
101
+ import { QueueWorkloadView as lu } from "./QueueWorkloadView.js";
102
+ import { queueTotalColumns as su, queueTotalPaths as iu, queueTotalValue as cu, formulaTotalFormat as du, queueTotalTip as uu, queueTotalsEligibleKey as jr, queueTotalsStoreKey as En, queueTotalsSupport as mu } from "./queue-totals.js";
103
+ import { useTransitionNote as pu, needsTransitionNote as fu } from "./transition-note.js";
104
+ import { worklistCsv as bu, worklistCsvName as hu } from "./worklist-csv.js";
105
+ import { extraChoiceText as cn, formulaColumnKeys as yu, atRiskBreakdown as cl, queuePinKeepRank as gu, worklistKeyTarget as xu } from "./worklist-helpers.js";
106
+ function ku({ summary: l }) {
107
+ if (!l || l.count === 0)
108
108
  return /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-muted-foreground", children: "—" });
109
- const N = [o.last_from, o.last_to].filter(Boolean).join(" → "), q = [
110
- N ? `Last: ${N}` : null,
111
- o.last_at ? Ic(o.last_at) : null,
112
- o.last_reason ? `“${o.last_reason}”` : "no reason given"
109
+ const S = [l.last_from, l.last_to].filter(Boolean).join(" → "), q = [
110
+ S ? `Last: ${S}` : null,
111
+ l.last_at ? Ic(l.last_at) : null,
112
+ l.last_reason ? `“${l.last_reason}”` : "no reason given"
113
113
  ].filter(Boolean).join(" · ");
114
114
  return /* @__PURE__ */ d(
115
115
  "span",
116
116
  {
117
117
  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",
118
118
  "data-tip": q,
119
- "data-send-backs": o.count,
119
+ "data-send-backs": l.count,
120
120
  children: [
121
121
  /* @__PURE__ */ d("span", { className: "tabular-nums", children: [
122
122
  "↩ ",
123
- o.count
123
+ l.count
124
124
  ] }),
125
- o.last_reason && /* @__PURE__ */ d("span", { className: "truncate font-normal opacity-80", children: [
125
+ l.last_reason && /* @__PURE__ */ d("span", { className: "truncate font-normal opacity-80", children: [
126
126
  "· ",
127
- o.last_reason
127
+ l.last_reason
128
128
  ] })
129
129
  ]
130
130
  }
131
131
  );
132
132
  }
133
- const ku = 50, vu = [], sn = "nivaro_addendums", Qr = [
133
+ const vu = 50, wu = [], Lt = "nivaro_addendums", Qr = [
134
134
  { value: "mine", label: "My Items" },
135
135
  { value: "unowned", label: "No Owners" },
136
136
  { value: "claimed", label: "Claimed by me" },
137
137
  { value: "all", label: "All Items" }
138
138
  ];
139
- function wu({ summary: o }) {
140
- if (!o || o.total === 0) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
141
- const N = o.active > 0, q = o.latest_status === "review" ? "in review" : o.latest_status ?? "active", M = o.cost_impact, H = M != null && M !== 0 ? `${M > 0 ? "+" : "−"}$${Math.abs(M).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
139
+ function _u({ summary: l }) {
140
+ if (!l || l.total === 0) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
141
+ const S = l.active > 0, q = l.latest_status === "review" ? "in review" : l.latest_status ?? "active", M = l.cost_impact, H = M != null && M !== 0 ? `${M > 0 ? "+" : "−"}$${Math.abs(M).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null;
142
142
  return /* @__PURE__ */ d(
143
143
  "span",
144
144
  {
145
- title: o.latest_title ?? void 0,
145
+ title: l.latest_title ?? void 0,
146
146
  className: F(
147
147
  "inline-flex max-w-[220px] items-center gap-1.5 truncate rounded-full border px-2 py-0.5 text-[11px] font-medium",
148
- N ? "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"
148
+ S ? "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"
149
149
  ),
150
150
  children: [
151
151
  /* @__PURE__ */ a(
@@ -154,11 +154,11 @@ function wu({ summary: o }) {
154
154
  "aria-hidden": !0,
155
155
  className: F(
156
156
  "h-1.5 w-1.5 shrink-0 rounded-full",
157
- N ? "bg-amber-500" : "bg-slate-400"
157
+ S ? "bg-amber-500" : "bg-slate-400"
158
158
  )
159
159
  }
160
160
  ),
161
- N ? `${o.active} ${o.active === 1 ? "addendum" : "addendums"} ${q}` : `${o.total} ${q}`,
161
+ S ? `${l.active} ${l.active === 1 ? "addendum" : "addendums"} ${q}` : `${l.total} ${q}`,
162
162
  H && /* @__PURE__ */ d("span", { className: "tabular-nums opacity-80", children: [
163
163
  "· ",
164
164
  H
@@ -167,15 +167,15 @@ function wu({ summary: o }) {
167
167
  }
168
168
  );
169
169
  }
170
- function _u(o) {
171
- return Wc(o);
170
+ function Nu(l) {
171
+ return Wc(l);
172
172
  }
173
- function Nu({
174
- status: o,
175
- warningAt: N,
173
+ function Su({
174
+ status: l,
175
+ warningAt: S,
176
176
  dueAt: q
177
177
  }) {
178
- const M = { warning_at: N ?? null, due_at: q ?? null }, H = !!o && !!q, B = Ai(H), y = H ? qi(M, B) : null, f = y ? y === "on_track" ? "ok" : y : o;
178
+ const M = { warning_at: S ?? null, due_at: q ?? null }, H = !!l && !!q, B = Ai(H), y = H ? qi(M, B) : null, f = y ? y === "on_track" ? "ok" : y : l;
179
179
  if (!f) return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
180
180
  const z = H ? Ei(M, B) : null, Q = f === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : f === "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";
181
181
  return /* @__PURE__ */ a(
@@ -191,9 +191,9 @@ function Nu({
191
191
  }
192
192
  );
193
193
  }
194
- function Su({ points: o, inline: N = !1 }) {
195
- if (o.length < 2) return null;
196
- const q = N ? 40 : 64, M = N ? 14 : 18, H = Math.max(...o), B = Math.min(...o), y = H - B || 1, f = q / (o.length - 1), z = o.map(
194
+ function Cu({ points: l, inline: S = !1 }) {
195
+ if (l.length < 2) return null;
196
+ const q = S ? 40 : 64, M = S ? 14 : 18, H = Math.max(...l), B = Math.min(...l), y = H - B || 1, f = q / (l.length - 1), z = l.map(
197
197
  (Q, $e) => `${$e === 0 ? "M" : "L"}${($e * f).toFixed(1)},${(M - 2 - (Q - B) / y * (M - 4)).toFixed(1)}`
198
198
  ).join(" ");
199
199
  return /* @__PURE__ */ a(
@@ -201,15 +201,15 @@ function Su({ points: o, inline: N = !1 }) {
201
201
  {
202
202
  width: q,
203
203
  height: M,
204
- className: N ? "opacity-40" : "mt-1.5 opacity-40",
204
+ className: S ? "opacity-40" : "mt-1.5 opacity-40",
205
205
  "aria-hidden": "true",
206
206
  children: /* @__PURE__ */ a("path", { d: z, fill: "none", stroke: "currentColor", strokeWidth: "1.5" })
207
207
  }
208
208
  );
209
209
  }
210
- function cn({
211
- label: o,
212
- count: N,
210
+ function dn({
211
+ label: l,
212
+ count: S,
213
213
  filteredCount: q,
214
214
  active: M,
215
215
  isLoading: H,
@@ -227,7 +227,7 @@ function cn({
227
227
  onClick: $e,
228
228
  "aria-pressed": M,
229
229
  "aria-label": [
230
- q != null ? `${ae(q)} of ${ae(N)} ${o}` : `${ae(N)} ${o}`,
230
+ q != null ? `${ae(q)} of ${ae(S)} ${l}` : `${ae(S)} ${l}`,
231
231
  Q || null,
232
232
  f != null && f !== 0 ? `${f > 0 ? "up" : "down"} ${ae(Math.abs(f))} since the last daily count` : null
233
233
  ].filter(Boolean).join(", "),
@@ -243,15 +243,15 @@ function cn({
243
243
  {
244
244
  className: F(
245
245
  "flex items-baseline gap-1 text-[15px] font-semibold leading-none tabular-nums",
246
- N === 0 && !M ? "text-slate-500 dark:text-slate-400" : "text-slate-900 dark:text-foreground"
246
+ S === 0 && !M ? "text-slate-500 dark:text-slate-400" : "text-slate-900 dark:text-foreground"
247
247
  ),
248
248
  children: q != null ? /* @__PURE__ */ d(Ce, { children: [
249
249
  /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: /* @__PURE__ */ a(Br, { value: q, format: (b) => ae(Number(b)) }) }),
250
250
  /* @__PURE__ */ d("span", { className: "text-[11px] font-medium text-slate-500 dark:text-slate-400", children: [
251
251
  "/ ",
252
- /* @__PURE__ */ a(Br, { value: N, format: (b) => ae(Number(b)) })
252
+ /* @__PURE__ */ a(Br, { value: S, format: (b) => ae(Number(b)) })
253
253
  ] })
254
- ] }) : /* @__PURE__ */ a(Br, { value: N, format: (b) => ae(Number(b)) })
254
+ ] }) : /* @__PURE__ */ a(Br, { value: S, format: (b) => ae(Number(b)) })
255
255
  }
256
256
  ),
257
257
  /* @__PURE__ */ a(
@@ -261,7 +261,7 @@ function cn({
261
261
  "whitespace-nowrap text-[11px] font-medium leading-none",
262
262
  B === "red" ? "text-red-700 dark:text-red-400" : B === "amber" ? "text-amber-800 dark:text-amber-400" : "text-slate-500 dark:text-muted-foreground"
263
263
  ),
264
- children: o
264
+ children: l
265
265
  }
266
266
  ),
267
267
  Q && /* @__PURE__ */ a(
@@ -285,14 +285,14 @@ function cn({
285
285
  ]
286
286
  }
287
287
  ),
288
- y && N > 0 && /* @__PURE__ */ a(Su, { points: y, inline: !0 })
288
+ y && S > 0 && /* @__PURE__ */ a(Cu, { points: y, inline: !0 })
289
289
  ] })
290
290
  }
291
291
  );
292
292
  }
293
- function Cu({
294
- label: o,
295
- count: N,
293
+ function $u({
294
+ label: l,
295
+ count: S,
296
296
  filteredCount: q,
297
297
  color: M,
298
298
  active: H,
@@ -315,32 +315,32 @@ function Cu({
315
315
  style: { backgroundColor: M ?? "#94a3b8" }
316
316
  }
317
317
  ),
318
- o,
318
+ l,
319
319
  /* @__PURE__ */ a("span", { className: "font-semibold tabular-nums text-slate-900 dark:text-foreground", children: q != null ? /* @__PURE__ */ d(Ce, { children: [
320
320
  /* @__PURE__ */ a("span", { className: "text-nvr-navy dark:text-nvr-cyan", children: ae(q) }),
321
321
  /* @__PURE__ */ d("span", { className: "font-normal text-slate-400", children: [
322
322
  " / ",
323
- ae(N)
323
+ ae(S)
324
324
  ] })
325
- ] }) : ae(N) })
325
+ ] }) : ae(S) })
326
326
  ]
327
327
  }
328
328
  );
329
329
  }
330
- const Ue = Xd;
331
- function $u({
332
- id: o,
333
- label: N,
330
+ const Ue = Zd;
331
+ function Ru({
332
+ id: l,
333
+ label: S,
334
334
  checked: q,
335
335
  onCheckedChange: M
336
336
  }) {
337
337
  const { attributes: H, listeners: B, setNodeRef: y, transform: f, transition: z, isDragging: Q } = ni({
338
- id: o
338
+ id: l
339
339
  }), $e = {
340
340
  transform: ri.Transform.toString(f),
341
341
  transition: z,
342
342
  opacity: Q ? 0.4 : 1
343
- }, b = `col-toggle-${o}`;
343
+ }, b = `col-toggle-${l}`;
344
344
  return /* @__PURE__ */ d("div", { ref: y, style: $e, className: "flex items-center gap-2 text-[12px]", children: [
345
345
  /* @__PURE__ */ a(
346
346
  "span",
@@ -352,83 +352,83 @@ function $u({
352
352
  }
353
353
  ),
354
354
  /* @__PURE__ */ a(Ur, { id: b, checked: q, onCheckedChange: M }),
355
- /* @__PURE__ */ a(Gd, { htmlFor: b, className: "cursor-pointer text-[12px] font-normal", children: N })
355
+ /* @__PURE__ */ a(Wd, { htmlFor: b, className: "cursor-pointer text-[12px] font-normal", children: S })
356
356
  ] });
357
357
  }
358
- function Lp({
359
- queueId: o,
360
- realtime: N,
358
+ function Op({
359
+ queueId: l,
360
+ realtime: S,
361
361
  renderError: q,
362
362
  hideCreateActions: M = !1,
363
363
  viewersInHeader: H = !1,
364
364
  onAsk: B
365
365
  }) {
366
- var No, So, Co, $o, To, Ro, Lo, Oo, Fo, Ao, qo, Eo, Ko, Po, Do, Mo, Bo, jo, Qo, Uo;
367
- const y = ai(), f = dl(), { userId: z } = Io(), Q = Si(), { navigate: $e } = Ci(), [b, de] = _("all"), [ue, j] = _(1), Vr = O(Qi()), [Rt, ml] = Qc(), [$, ot] = _("table"), [U, lt] = _(""), [x, V] = _({}), [Lt, Gr] = _(() => /* @__PURE__ */ new Set()), [T, Ot] = _(null), [xe, En] = _(/* @__PURE__ */ new Set()), [Ft, Kn] = _(null), [st, Pn] = _(null), [Wr, dn] = _({}), [Ir, Dn] = _(
368
- () => nl(qn(o), jr)
369
- ), Hr = O(o);
370
- Hr.current !== o && (Hr.current = o, Dn(nl(qn(o), jr)), dn({}));
366
+ var No, So, Co, $o, Ro, To, Lo, Oo, Fo, Ao, qo, Eo, Po, Ko, Do, Mo, Bo, jo, Qo, Uo;
367
+ const y = ai(), f = dl(), { userId: z } = Io(), Q = Si(), { navigate: $e } = Ci(), [b, me] = N("all"), [se, j] = N(1), Vr = O(Qi()), [Ot, ml] = Qc(), [C, ot] = N("table"), [U, lt] = N(""), [x, V] = N({}), [Ft, Gr] = N(() => /* @__PURE__ */ new Set()), [R, At] = N(null), [xe, Pn] = N(/* @__PURE__ */ new Set()), [qt, Kn] = N(null), [st, Dn] = N(null), [Wr, un] = N({}), [Ir, Mn] = N(
368
+ () => nl(En(l), jr)
369
+ ), Hr = O(l);
370
+ Hr.current !== l && (Hr.current = l, Mn(nl(En(l), jr)), un({}));
371
371
  const it = W(
372
372
  () => cd(Wr, Ir),
373
373
  [Wr, Ir]
374
- ), pl = (e, t) => Dn((n) => {
374
+ ), pl = (e, t) => Mn((n) => {
375
375
  const r = md(n, e, t);
376
- return rl(qn(o), r), r;
377
- }), [Mn, un] = _(0), Bn = O(0), be = fc(), ct = Ac(), jn = O({}).current, Jr = O(/* @__PURE__ */ new Set()), [Yr, fl] = _(0), [zr, bl] = _(0), he = O(!1), At = O(null), qt = O([]), Xr = O(null), Qn = O(!1), Un = O(0), Vn = O("table");
378
- Vn.current = $;
379
- const Gn = O(!1);
380
- Gn.current = $ === "table" && !!T;
381
- const Et = hc(), Kt = O(Et);
382
- Kt.current = Et;
383
- const mn = O(null), Pe = yc(o ? `queue:${o}` : null, (e) => {
384
- if (!vc(e) && mn.current) return mn.current(e);
385
- Ra();
386
- }), Wn = Pe.gate, In = 25, { data: s, error: pn } = ne({
387
- queryKey: ["queue-meta", o],
388
- queryFn: () => f.request(D(`/queues/${o}`)).then((e) => e.data),
389
- enabled: !!o
390
- }), { scopes: fn, ready: Zr } = Uc(), ea = O(!1), [ta, na] = _(!1), [Te, hl] = _({}), ke = O({});
391
- K(() => {
376
+ return rl(En(l), r), r;
377
+ }), [Bn, mn] = N(0), jn = O(0), be = fc(), ct = Ac(), Qn = O({}).current, Jr = O(/* @__PURE__ */ new Set()), [Yr, fl] = N(0), [zr, bl] = N(0), he = O(!1), Et = O(null), Pt = O([]), Xr = O(null), Un = O(!1), Vn = O(0), Gn = O("table");
378
+ Gn.current = C;
379
+ const Wn = O(!1);
380
+ Wn.current = C === "table" && !!R;
381
+ const Kt = hc(), Dt = O(Kt);
382
+ Dt.current = Kt;
383
+ const pn = O(null), Ke = yc(l ? `queue:${l}` : null, (e) => {
384
+ if (!vc(e) && pn.current) return pn.current(e);
385
+ Ta();
386
+ }), In = Ke.gate, fn = 25, { data: s, error: bn } = ne({
387
+ queryKey: ["queue-meta", l],
388
+ queryFn: () => f.request(D(`/queues/${l}`)).then((e) => e.data),
389
+ enabled: !!l
390
+ }), { scopes: hn, ready: Zr } = Uc(), ea = O(!1), [ta, na] = N(!1), [Re, hl] = N({}), ke = O({});
391
+ P(() => {
392
392
  if (ea.current || !Zr || !s) return;
393
393
  ea.current = !0;
394
394
  const e = (s.extra_field_meta ?? []).filter(
395
395
  (t) => t.kind === "relation" && t.target_collection && t.display_field
396
396
  );
397
- if (e.length === 0 || !fn) {
397
+ if (e.length === 0 || !hn) {
398
398
  na(!0);
399
399
  return;
400
400
  }
401
401
  (async () => {
402
- const t = {}, n = {}, r = async (l, i) => {
402
+ const t = {}, n = {}, r = async (o, c) => {
403
403
  const u = await f.request(
404
- D(`/items/${l.target_collection}`, {
405
- filter: JSON.stringify({ id: { _in: i } }),
406
- fields: `id,${l.display_field}`,
404
+ D(`/items/${o.target_collection}`, {
405
+ filter: JSON.stringify({ id: { _in: c } }),
406
+ fields: `id,${o.display_field}`,
407
407
  limit: "200"
408
408
  })
409
409
  );
410
410
  return [
411
411
  ...new Set(
412
- (u.data ?? []).map((m) => String(m[l.display_field] ?? "")).filter(Boolean)
412
+ (u.data ?? []).map((m) => String(m[o.display_field] ?? "")).filter(Boolean)
413
413
  )
414
414
  ];
415
415
  };
416
- for (const l of e) {
417
- const i = Vc(fn, { collection: l.target_collection });
418
- if (!i) continue;
419
- const u = `extra.${l.path}`;
416
+ for (const o of e) {
417
+ const c = Vc(hn, { collection: o.target_collection });
418
+ if (!c) continue;
419
+ const u = `extra.${o.path}`;
420
420
  try {
421
- const m = fn.restricted[i.name] ?? [];
421
+ const m = hn.restricted[c.name] ?? [];
422
422
  if (m.length > 0) {
423
- const h = await r(l, m);
423
+ const h = await r(o, m);
424
424
  h.length > 0 && (n[u.slice(6)] = h);
425
425
  }
426
426
  } catch {
427
427
  }
428
428
  }
429
- Object.keys(n).length > 0 && hl(n), Object.keys(t).length > 0 && (ke.current = t, V((l) => ({ ...l, ...t }))), na(!0);
429
+ Object.keys(n).length > 0 && hl(n), Object.keys(t).length > 0 && (ke.current = t, V((o) => ({ ...o, ...t }))), na(!0);
430
430
  })();
431
- }, [Zr, fn, s]);
431
+ }, [Zr, hn, s]);
432
432
  const dt = ((So = (No = s == null ? void 0 : s.sources) == null ? void 0 : No.find((e) => e.type === "collection")) == null ? void 0 : So.collection) ?? null, { data: ra = [] } = ne({
433
433
  queryKey: ["queue-browser-quick-filters", dt],
434
434
  queryFn: () => f.request(D(`/collections/${dt}`)).then((e) => {
@@ -437,14 +437,14 @@ function Lp({
437
437
  }).catch(() => []),
438
438
  enabled: !!dt,
439
439
  staleTime: 3e5
440
- }), me = W(() => {
440
+ }), pe = W(() => {
441
441
  const e = /* @__PURE__ */ new Set(), t = [];
442
442
  for (const n of (s == null ? void 0 : s.sources) ?? [])
443
443
  n.type !== "collection" || !n.collection || e.has(n.collection) || (e.add(n.collection), t.push(n.collection));
444
444
  return t;
445
- }, [s == null ? void 0 : s.sources]), bn = Gc(
446
- me.length === 1 ? me[0] : null
447
- ), Hn = M === !0 || Array.isArray(M) && me.length > 0 && me.every((e) => M.includes(e)), Re = (s == null ? void 0 : s.claims_enabled) !== !1, p = s == null ? void 0 : s.display_config, Ve = (p == null ? void 0 : p.views) ?? ["table", "kanban", "workload"], yl = (p == null ? void 0 : p.work_next) !== !1, hn = (p == null ? void 0 : p.bulk_actions) !== !1, Ge = zc(
445
+ }, [s == null ? void 0 : s.sources]), yn = Gc(
446
+ pe.length === 1 ? pe[0] : null
447
+ ), Hn = M === !0 || Array.isArray(M) && pe.length > 0 && pe.every((e) => M.includes(e)), Te = (s == null ? void 0 : s.claims_enabled) !== !1, p = s == null ? void 0 : s.display_config, Ve = (p == null ? void 0 : p.views) ?? ["table", "kanban", "workload"], yl = (p == null ? void 0 : p.work_next) !== !1, gn = (p == null ? void 0 : p.bulk_actions) !== !1, Ge = zc(
448
448
  [
449
449
  ...new Set(
450
450
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
@@ -455,60 +455,60 @@ function Lp({
455
455
  var n, r;
456
456
  return ((r = (n = s == null ? void 0 : s.column_aliases) == null ? void 0 : n[e]) == null ? void 0 : r.trim()) || t;
457
457
  }, aa = O(!1);
458
- K(() => {
458
+ P(() => {
459
459
  !s || aa.current || (aa.current = !0, lt("-priority"));
460
460
  }, [s]);
461
- const [G, gl] = _(!1);
462
- K(() => {
463
- s != null && s.display_config && !Ve.includes($) && ot(Ve[0]);
464
- }, [s, $, Ve]), K(() => {
461
+ const [G, gl] = N(!1);
462
+ P(() => {
463
+ s != null && s.display_config && !Ve.includes(C) && ot(Ve[0]);
464
+ }, [s, C, Ve]), P(() => {
465
465
  if (!(s != null && s.sources)) return;
466
- const e = ct ? (C, v) => ct.subscribeCollections(C, v) : N == null ? void 0 : N.subscribe;
466
+ const e = ct ? ($, w) => ct.subscribeCollections($, w) : S == null ? void 0 : S.subscribe;
467
467
  if (!e) return;
468
468
  const t = [
469
469
  ...new Set(
470
- s.sources.filter((C) => C.type === "collection" && C.collection).map((C) => C.collection)
470
+ s.sources.filter(($) => $.type === "collection" && $.collection).map(($) => $.collection)
471
471
  )
472
472
  ];
473
473
  if (t.length === 0) return;
474
474
  const n = /* @__PURE__ */ new Set();
475
- let r = null, l = null, i = null;
475
+ let r = null, o = null, c = null;
476
476
  const u = () => {
477
- i || (i = setTimeout(() => {
478
- i = null, bl((C) => C + 1);
477
+ c || (c = setTimeout(() => {
478
+ c = null, bl(($) => $ + 1);
479
479
  }, 2500));
480
480
  }, m = () => {
481
- l || (l = setTimeout(() => {
482
- if (l = null, Un.current > 0 || Qn.current) {
483
- qt.current = [], un((C) => C + 1);
481
+ o || (o = setTimeout(() => {
482
+ if (o = null, Vn.current > 0 || Un.current) {
483
+ Pt.current = [], mn(($) => $ + 1);
484
484
  return;
485
485
  }
486
- he.current = !0, y.invalidateQueries({ queryKey: ["queue-items", o] }), y.invalidateQueries({ queryKey: ["queue-workload", o] });
486
+ he.current = !0, y.invalidateQueries({ queryKey: ["queue-items", l] }), y.invalidateQueries({ queryKey: ["queue-workload", l] });
487
487
  }, 900));
488
488
  };
489
- At.current = m;
490
- const h = (C) => {
491
- let v = !1, Z = 0, ie = !1;
492
- const Se = C.flatMap(
493
- (w) => w ? dc(w) : [w]
494
- ), ce = (w) => {
489
+ Et.current = m;
490
+ const h = ($) => {
491
+ let w = !1, Z = 0, de = !1;
492
+ const Se = $.flatMap(
493
+ (_) => _ ? dc(_) : [_]
494
+ ), ue = (_) => {
495
495
  var le;
496
- return !!w && !w.action && !!((le = w.changed_fields) != null && le.length) && w.changed_fields.every((Nt) => Nt.startsWith("$"));
497
- }, te = Se.filter((w) => w && !ce(w)).map((w) => ({
498
- ...w,
499
- item: String((w == null ? void 0 : w.item) ?? "*") === "*" ? "*" : `${w == null ? void 0 : w.collection}:${String(w == null ? void 0 : w.item)}`
500
- })), Fn = te.length > 0 && Kt.current.tracker.push(te);
501
- Fn && Kt.current.publish();
502
- for (const w of Se) {
503
- const le = w == null ? void 0 : w.changed_fields, Nt = (w == null ? void 0 : w.collection) != null ? `${w.collection}:${String(w.item)}` : null, Ar = Nt != null && Jr.current.has(Nt);
504
- if (Fn && !ce(w)) continue;
505
- if (w && !w.action && (le != null && le.length) && le.every((je) => je.startsWith("$"))) {
506
- if (le.includes(at.tasks) && n.add("queue-task-counts"), le.includes(at.integrations) && n.add("queue-integrations-summary"), le.includes(at.addendums) && n.add("queue-collection-addendums"), le.includes(at.lock) && fl((je) => je + 1), le.includes(at.sla) && (ie = !0), le.includes(at.owners) && Ar && (v = !0), le.includes(at.state)) {
507
- const je = Yd(
496
+ return !!_ && !_.action && !!((le = _.changed_fields) != null && le.length) && _.changed_fields.every((St) => St.startsWith("$"));
497
+ }, te = Se.filter((_) => _ && !ue(_)).map((_) => ({
498
+ ..._,
499
+ item: String((_ == null ? void 0 : _.item) ?? "*") === "*" ? "*" : `${_ == null ? void 0 : _.collection}:${String(_ == null ? void 0 : _.item)}`
500
+ })), An = te.length > 0 && Dt.current.tracker.push(te);
501
+ An && Dt.current.publish();
502
+ for (const _ of Se) {
503
+ const le = _ == null ? void 0 : _.changed_fields, St = (_ == null ? void 0 : _.collection) != null ? `${_.collection}:${String(_.item)}` : null, Ar = St != null && Jr.current.has(St);
504
+ if (An && !ue(_)) continue;
505
+ if (_ && !_.action && (le != null && le.length) && le.every((je) => je.startsWith("$"))) {
506
+ if (le.includes(at.tasks) && n.add("queue-task-counts"), le.includes(at.integrations) && n.add("queue-integrations-summary"), le.includes(at.addendums) && n.add("queue-collection-addendums"), le.includes(at.lock) && fl((je) => je + 1), le.includes(at.sla) && (de = !0), le.includes(at.owners) && Ar && (w = !0), le.includes(at.state)) {
507
+ const je = zd(
508
508
  Ar,
509
- Vn.current === "kanban" || Gn.current
509
+ Gn.current === "kanban" || Wn.current
510
510
  );
511
- ie = !0, je.refresh && (v = !0), Z += je.pill;
511
+ de = !0, je.refresh && (w = !0), Z += je.pill;
512
512
  }
513
513
  r || (r = setTimeout(() => {
514
514
  r = null;
@@ -517,28 +517,28 @@ function Lp({
517
517
  }, 300));
518
518
  continue;
519
519
  }
520
- ie = !0;
521
- const Is = (w == null ? void 0 : w.collection) != null && Cc(w.collection, w.item);
522
- Nt && (Ar || (w == null ? void 0 : w.action) === "create" || Vn.current === "kanban" || Gn.current) ? (v = !0, Is || qt.current.push({ key: Nt, by: null })) : Z += 1;
520
+ de = !0;
521
+ const Is = (_ == null ? void 0 : _.collection) != null && Cc(_.collection, _.item);
522
+ St && (Ar || (_ == null ? void 0 : _.action) === "create" || Gn.current === "kanban" || Wn.current) ? (w = !0, Is || Pt.current.push({ key: St, by: null })) : Z += 1;
523
523
  }
524
- Z > 0 && (Bn.current += Z), v && m(), ie && u();
525
- }, R = (C) => ji(jn, C, h);
526
- mn.current = R;
527
- const k = e(t, (C) => Wn([C ?? {}], R));
524
+ Z > 0 && (jn.current += Z), w && m(), de && u();
525
+ }, T = ($) => ji(Qn, $, h);
526
+ pn.current = T;
527
+ const v = e(t, ($) => In([$ ?? {}], T));
528
528
  return () => {
529
- At.current = null, k(), mn.current = null, Bi(jn), r && clearTimeout(r), l && clearTimeout(l), i && clearTimeout(i);
529
+ Et.current = null, v(), pn.current = null, Bi(Qn), r && clearTimeout(r), o && clearTimeout(o), c && clearTimeout(c);
530
530
  };
531
- }, [ct, N, s == null ? void 0 : s.sources, y, o, z, jn, Wn]), cc(
531
+ }, [ct, S, s == null ? void 0 : s.sources, y, l, z, Qn, In]), cc(
532
532
  "owners:changed",
533
533
  (e) => {
534
534
  var t;
535
535
  (s != null && s.materialized ? !(e != null && e.queues) : e != null && e.queues) || Array.isArray(e == null ? void 0 : e.collections) && !((s == null ? void 0 : s.sources) ?? []).some(
536
536
  (r) => r.type === "collection" && e.collections.includes(r.collection)
537
- ) || (t = At.current) == null || t.call(At);
537
+ ) || (t = Et.current) == null || t.call(Et);
538
538
  },
539
539
  { debounceMs: 600 }
540
540
  );
541
- const ve = Ti(x, 350), xl = JSON.stringify(ve) === JSON.stringify(x), Jn = O(!1), pe = $ === "table" && !!T, oa = Id(s), kl = W(
541
+ const ve = Ri(x, 350), xl = JSON.stringify(ve) === JSON.stringify(x), Jn = O(!1), ie = C === "table" && !!R, oa = Hd(s), kl = W(
542
542
  () => {
543
543
  var e;
544
544
  return {
@@ -552,7 +552,7 @@ function Lp({
552
552
  };
553
553
  },
554
554
  [s]
555
- ), Pt = (e) => uu(e, kl), ut = lu(it, Pt), la = $ === "table" && !pe && ut.length > 0, Dt = la ? su(ut, Pt) : [], Le = (() => {
555
+ ), Mt = (e) => mu(e, kl), ut = su(it, Mt), la = C === "table" && !ie && ut.length > 0, Bt = la ? iu(ut, Mt) : [], Le = (() => {
556
556
  const e = {};
557
557
  for (const [t, n] of Object.entries(ve))
558
558
  if (n) {
@@ -561,8 +561,8 @@ function Lp({
561
561
  continue;
562
562
  }
563
563
  if (t === "aging_hours") {
564
- const [r, l] = n.split(":"), i = {};
565
- r && (i.min = Number(r)), l && (i.max = Number(l)), (i.min !== void 0 || i.max !== void 0) && (e[t] = i);
564
+ const [r, o] = n.split(":"), c = {};
565
+ r && (c.min = Number(r)), o && (c.max = Number(o)), (c.min !== void 0 || c.max !== void 0) && (e[t] = c);
566
566
  continue;
567
567
  }
568
568
  e[t] = n;
@@ -574,50 +574,50 @@ function Lp({
574
574
  }
575
575
  function vl(e) {
576
576
  V((t) => {
577
- const n = t.state, r = Array.isArray(n) ? n : n ? [n] : [], l = r.includes(e) ? r.filter((i) => i !== e) : [...r, e];
578
- return { ...t, state: l };
577
+ const n = t.state, r = Array.isArray(n) ? n : n ? [n] : [], o = r.includes(e) ? r.filter((c) => c !== e) : [...r, e];
578
+ return { ...t, state: o };
579
579
  }), j(1);
580
580
  }
581
581
  const wl = Array.isArray(x.state) ? x.state : x.state ? [x.state] : [], _l = (e) => !e || Array.isArray(e) && e.length === 0;
582
582
  function Nl() {
583
- V({ ...ke.current }), de("all"), j(1);
583
+ V({ ...ke.current }), me("all"), j(1);
584
584
  }
585
- const [We, Sl] = _(() => {
585
+ const [We, Sl] = N(() => {
586
586
  try {
587
587
  return localStorage.getItem("nvr_queue_insights_open") === "1";
588
588
  } catch {
589
589
  return !1;
590
590
  }
591
591
  });
592
- K(() => {
592
+ P(() => {
593
593
  try {
594
594
  localStorage.setItem("nvr_queue_insights_open", We ? "1" : "0");
595
595
  } catch {
596
596
  }
597
597
  }, [We]);
598
598
  const { data: Cl = [] } = ne({
599
- queryKey: ["queue-view-subs", o],
600
- queryFn: () => f.request(D("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === o)).catch(() => []),
599
+ queryKey: ["queue-view-subs", l],
600
+ queryFn: () => f.request(D("/notification-subscriptions")).then((e) => (e.data ?? []).filter((t) => t.queue_id === l)).catch(() => []),
601
601
  staleTime: 3e4
602
- }), yn = (e) => Cl.find((t) => t.queue_view_id === e), $l = (e) => {
603
- const t = yn(e);
602
+ }), xn = (e) => Cl.find((t) => t.queue_view_id === e), $l = (e) => {
603
+ const t = xn(e);
604
604
  (t ? f.request(Er(`/notification-subscriptions/${t.id}`)) : f.request(
605
605
  ge("/notification-subscriptions", {
606
- queue_id: o,
606
+ queue_id: l,
607
607
  queue_view_id: e,
608
608
  digest_frequency: "instant"
609
609
  })
610
610
  )).then(() => {
611
- P.success(
611
+ K.success(
612
612
  t ? "Unsubscribed" : "Subscribed — new arrivals in this view notify you"
613
- ), y.invalidateQueries({ queryKey: ["queue-view-subs", o] });
614
- }).catch((r) => P.error(St(r, "Failed")));
615
- }, [sa, Yn] = _(null), zn = [
613
+ ), y.invalidateQueries({ queryKey: ["queue-view-subs", l] });
614
+ }).catch((r) => K.error(Ct(r, "Failed")));
615
+ }, [sa, Yn] = N(null), zn = [
616
616
  ...new Set(
617
617
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
618
618
  )
619
- ], { data: Tl = {} } = ne({
620
- queryKey: ["queue-custom-actions", o, zn.join(",")],
619
+ ], { data: Rl = {} } = ne({
620
+ queryKey: ["queue-custom-actions", l, zn.join(",")],
621
621
  queryFn: async () => {
622
622
  const e = {};
623
623
  for (const t of zn.slice(0, 6))
@@ -633,67 +633,67 @@ function Lp({
633
633
  },
634
634
  enabled: zn.length > 0,
635
635
  staleTime: 6e4
636
- }), Rl = (e) => Tl[e] ?? [], Ll = (e, t) => {
636
+ }), Tl = (e) => Rl[e] ?? [], Ll = (e, t) => {
637
637
  f.request(ge(`/custom-actions/${e.id}/execute`, { item: t.item_id })).then(() => {
638
- P.success(`${e.label} ran`), y.invalidateQueries({ queryKey: ["queue-items", o] });
638
+ K.success(`${e.label} ran`), y.invalidateQueries({ queryKey: ["queue-items", l] });
639
639
  }).catch((n) => {
640
640
  const r = n.response;
641
- P.error((r == null ? void 0 : r.error) ?? St(n, `${e.label} failed`));
641
+ K.error((r == null ? void 0 : r.error) ?? Ct(n, `${e.label} failed`));
642
642
  });
643
643
  }, { data: Xn = [] } = ne({
644
- queryKey: ["queue-triage-labels", o],
645
- queryFn: () => f.request(D(`/queues/${o}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
644
+ queryKey: ["queue-triage-labels", l],
645
+ queryFn: () => f.request(D(`/queues/${l}/triage-labels`)).then((e) => e.data ?? []).catch(() => []),
646
646
  staleTime: 3e4
647
647
  }), ia = (e, t) => {
648
648
  f.request(
649
- ge(`/queues/${o}/triage-labels/toggle`, {
649
+ ge(`/queues/${l}/triage-labels/toggle`, {
650
650
  collection: e.collection,
651
651
  item_id: e.item_id,
652
652
  label: t
653
653
  })
654
654
  ).then(() => {
655
- y.invalidateQueries({ queryKey: ["queue-items", o] }), y.invalidateQueries({ queryKey: ["queue-triage-labels", o] });
656
- }).catch((n) => P.error(St(n, "Label failed")));
657
- }, [Ol] = _(() => rc(`queue:${o}`)), [Fl, Al] = _(
655
+ y.invalidateQueries({ queryKey: ["queue-items", l] }), y.invalidateQueries({ queryKey: ["queue-triage-labels", l] });
656
+ }).catch((n) => K.error(Ct(n, "Label failed")));
657
+ }, [Ol] = N(() => rc(`queue:${l}`)), [Fl, Al] = N(
658
658
  () => Yo(Ol) !== "fresh"
659
659
  ), {
660
- data: c,
660
+ data: i,
661
661
  isLoading: ca,
662
- isFetching: Mt,
662
+ isFetching: jt,
663
663
  isPlaceholderData: Zn,
664
- dataUpdatedAt: se,
664
+ dataUpdatedAt: ce,
665
665
  isError: da,
666
666
  error: ql,
667
667
  refetch: El
668
668
  } = ne({
669
669
  queryKey: [
670
670
  "queue-items",
671
- o,
671
+ l,
672
672
  b,
673
673
  U,
674
674
  ve,
675
- $ === "table" && !T ? ue : "all",
676
- T,
677
- Dt.join(",")
675
+ C === "table" && !R ? se : "all",
676
+ R,
677
+ Bt.join(",")
678
678
  ],
679
679
  queryFn: async () => {
680
- const e = !pe && $ === "table", t = JSON.stringify([o, b, U, Le, In]), n = e ? Ui(Vr.current, t, ue, "").after : void 0, r = await f.request(
681
- D(`/queues/${o}/items`, {
680
+ const e = !ie && C === "table", t = JSON.stringify([l, b, U, Le, fn]), n = e ? Ui(Vr.current, t, se, "").after : void 0, r = await f.request(
681
+ D(`/queues/${l}/items`, {
682
682
  scope: b,
683
683
  // Last State Change is Aging read the other way round: the newest
684
684
  // move is the least aged.
685
- sort: Pr(U),
685
+ sort: Kr(U),
686
686
  filters: JSON.stringify(Le),
687
687
  // Table + group: headers only (rows load per group on expand, #741).
688
688
  // Kanban renders the full matching set, grouped client-side.
689
- ...pe ? {
690
- group_by: T,
689
+ ...ie ? {
690
+ group_by: R,
691
691
  ...oa.length ? { group_sums: oa.join(",") } : {}
692
- } : $ === "table" ? { page: ue, limit: In, ...n ? { after: n } : {} } : {},
693
- ...Dt.length ? { totals: Dt.join(",") } : {}
692
+ } : C === "table" ? { page: se, limit: fn, ...n ? { after: n } : {} } : {},
693
+ ...Bt.length ? { totals: Bt.join(",") } : {}
694
694
  })
695
695
  );
696
- return n && Vi(Vr.current, t, ue, r.next_cursor), r;
696
+ return n && Vi(Vr.current, t, se, r.next_cursor), r;
697
697
  },
698
698
  // Wait for display_config AND scope seeding so the first fetch uses the
699
699
  // configured defaults and already carries the viewer's restricted filters.
@@ -702,64 +702,64 @@ function Lp({
702
702
  // first fetch went out WITHOUT the seeded scope and refired ~350ms later
703
703
  // with it (3.3s + 8.7s of work for one page). The first fetch now also
704
704
  // waits for the debounced copy to settle; later typing still debounces.
705
- enabled: !!o && G && ta && (Jn.current || xl),
705
+ enabled: !!l && G && ta && (Jn.current || xl),
706
706
  // Keep the previous page rendered while a sort/filter/page change refetches —
707
707
  // swapping to skeletons collapsed the table height and jittered the page.
708
708
  placeholderData: (e) => e,
709
709
  gcTime: 20 * 6e4,
710
710
  ...Fl ? { staleTime: Number.POSITIVE_INFINITY } : {}
711
711
  });
712
- c && !Jn.current && (Jn.current = !0);
712
+ i && !Jn.current && (Jn.current = !0);
713
713
  const pt = Object.entries(ke.current).filter(
714
714
  ([e, t]) => {
715
715
  var n;
716
- return !((n = Te[e.slice(6)]) != null && n.length) && JSON.stringify(Le[e] ?? null) === JSON.stringify(t);
716
+ return !((n = Re[e.slice(6)]) != null && n.length) && JSON.stringify(Le[e] ?? null) === JSON.stringify(t);
717
717
  }
718
718
  ).map(([e]) => e), ua = pt.length > 0 && Object.keys(Le).every((e) => pt.includes(e)), ma = Object.fromEntries(
719
719
  Object.entries(Le).filter(([e]) => !pt.includes(e))
720
- ), { data: Kl } = ne({
721
- queryKey: ["queue-default-hidden", o, b, ma],
722
- enabled: !!o && !!c && !Mt && c.total === 0 && ((Co = c.empty) == null ? void 0 : Co.reason) === "filters" && pt.length > 0 && !ua,
720
+ ), { data: Pl } = ne({
721
+ queryKey: ["queue-default-hidden", l, b, ma],
722
+ enabled: !!l && !!i && !jt && i.total === 0 && ((Co = i.empty) == null ? void 0 : Co.reason) === "filters" && pt.length > 0 && !ua,
723
723
  staleTime: 3e4,
724
724
  retry: !1,
725
725
  queryFn: () => f.request(
726
- D(`/queues/${o}/items`, {
726
+ D(`/queues/${l}/items`, {
727
727
  scope: b,
728
728
  filters: JSON.stringify(ma),
729
729
  page: 1,
730
730
  limit: 1
731
731
  })
732
732
  ).then((e) => Number(e.total ?? 0))
733
- }), Oe = ua ? Math.max(0, ((($o = c == null ? void 0 : c.stats) == null ? void 0 : $o.total) ?? 0) - ((c == null ? void 0 : c.total) ?? 0)) : Kl ?? 0, pa = (e) => pt.map(e).join(" and "), fa = () => {
733
+ }), Oe = ua ? Math.max(0, ((($o = i == null ? void 0 : i.stats) == null ? void 0 : $o.total) ?? 0) - ((i == null ? void 0 : i.total) ?? 0)) : Pl ?? 0, pa = (e) => pt.map(e).join(" and "), fa = () => {
734
734
  V((e) => {
735
735
  const t = { ...e };
736
736
  for (const n of pt) delete t[n];
737
737
  return t;
738
738
  }), j(1);
739
739
  };
740
- K(() => {
741
- if (typeof window > "u" || !se) return;
740
+ P(() => {
741
+ if (typeof window > "u" || !ce) return;
742
742
  const e = window;
743
743
  e.__nvrQueueTrace || (e.__nvrQueueTrace = []);
744
744
  const t = e.__nvrQueueTrace, n = {
745
- queue: o,
746
- at: se,
745
+ queue: l,
746
+ at: ce,
747
747
  scope: b,
748
748
  sort: U,
749
749
  filters: JSON.stringify(ve),
750
- page: ue
751
- }, r = t.find((l) => l.queue === o);
752
- t.push(n), t.length > 50 && t.shift(), r && r !== n && se - Number(r.at) < 2e3 && t.filter((l) => l.queue === o).length === 2 && console.warn("[queue] duplicate first fetch", { first: r, second: n });
753
- }, [se]);
754
- const ft = ca && !c || !G || !ta && !c, ba = (Mt && !ca || Zn && Mt) && !he.current, [ee, De] = _([]), [X, ha] = _(!1), Pl = W(() => {
755
- const e = (pe ? [] : (c == null ? void 0 : c.data) ?? []).slice(0, 100).map((r) => `${r.collection}:${r.item_id}`), t = new Set(e), n = X ? ee.filter((r) => !t.has(r)).slice(0, 100) : [];
750
+ page: se
751
+ }, r = t.find((o) => o.queue === l);
752
+ t.push(n), t.length > 50 && t.shift(), r && r !== n && ce - Number(r.at) < 2e3 && t.filter((o) => o.queue === l).length === 2 && console.warn("[queue] duplicate first fetch", { first: r, second: n });
753
+ }, [ce]);
754
+ const ft = ca && !i || !G || !ta && !i, ba = (jt && !ca || Zn && jt) && !he.current, [ee, De] = N([]), [X, ha] = N(!1), Kl = W(() => {
755
+ const e = (ie ? [] : (i == null ? void 0 : i.data) ?? []).slice(0, 100).map((r) => `${r.collection}:${r.item_id}`), t = new Set(e), n = X ? ee.filter((r) => !t.has(r)).slice(0, 100) : [];
756
756
  return [...e, ...n].map((r) => {
757
- const l = r.indexOf(":");
758
- return { collection: r.slice(0, l), item: r.slice(l + 1) };
757
+ const o = r.indexOf(":");
758
+ return { collection: r.slice(0, o), item: r.slice(o + 1) };
759
759
  });
760
- }, [pe, c == null ? void 0 : c.data, X, ee]), ya = Tc(Pl), gn = mu(), ga = Ri(Mt && !he.current), Dl = Li({
761
- pending: Mt && !he.current,
762
- request: o != null ? { method: "GET", url: `/queues/${o}/items` } : null,
760
+ }, [ie, i == null ? void 0 : i.data, X, ee]), ya = Rc(Kl), kn = pu(), ga = Ti(jt && !he.current), Dl = Li({
761
+ pending: jt && !he.current,
762
+ request: l != null ? { method: "GET", url: `/queues/${l}/items` } : null,
763
763
  noun: "items"
764
764
  }), Ml = $c();
765
765
  async function xa(e, t) {
@@ -767,18 +767,18 @@ function Lp({
767
767
  const r = (await f.request(D(`/pipelines/instance/${e.collection}/${e.item_id}`))).data;
768
768
  if (!r || r.states.length === 0)
769
769
  throw new Error("This item has no workflow instance");
770
- const l = r.states.find((h) => h.key === t);
771
- if (!l) throw new Error("Target state not found");
772
- const i = r.available_transitions.find(
773
- (h) => h.to_state === l.id
770
+ const o = r.states.find((h) => h.key === t);
771
+ if (!o) throw new Error("Target state not found");
772
+ const c = r.available_transitions.find(
773
+ (h) => h.to_state === o.id
774
774
  );
775
- if (!i) throw new Error("No transition available to move this item here");
775
+ if (!c) throw new Error("No transition available to move this item here");
776
776
  let u = null;
777
- if (pu(i) && (u = await gn.ask(((m = i.label) == null ? void 0 : m.trim()) || "Move"), !u))
777
+ if (fu(c) && (u = await kn.ask(((m = c.label) == null ? void 0 : m.trim()) || "Move"), !u))
778
778
  throw new Error("Not moved — this move needs a note");
779
779
  await f.request(
780
780
  ge(`/pipelines/instance/${e.collection}/${e.item_id}/transition`, {
781
- transition_id: i.id,
781
+ transition_id: c.id,
782
782
  ...u ? { comment: u } : {}
783
783
  })
784
784
  );
@@ -788,82 +788,82 @@ function Lp({
788
788
  await xa(e, t);
789
789
  },
790
790
  onSuccess: () => {
791
- y.invalidateQueries({ queryKey: ["queue-items", o, b] });
791
+ y.invalidateQueries({ queryKey: ["queue-items", l, b] });
792
792
  },
793
793
  onError: (e) => {
794
- P.error(St(e, "Failed to move item")), y.invalidateQueries({ queryKey: ["queue-items", o, b] });
794
+ K.error(Ct(e, "Failed to move item")), y.invalidateQueries({ queryKey: ["queue-items", l, b] });
795
795
  }
796
796
  }), Ie = Qe({
797
797
  mutationFn: (e) => f.request(
798
- ge(`/queues/${o}/claim`, {
798
+ ge(`/queues/${l}/claim`, {
799
799
  source_collection: e.collection,
800
800
  item_id: e.item_id
801
801
  })
802
802
  ),
803
- onSuccess: () => y.invalidateQueries({ queryKey: ["queue-items", o, b] }),
804
- onError: () => P.error("Failed to claim item")
803
+ onSuccess: () => y.invalidateQueries({ queryKey: ["queue-items", l, b] }),
804
+ onError: () => K.error("Failed to claim item")
805
805
  }), bt = Qe({
806
806
  mutationFn: (e) => f.request(
807
- ge(`/queues/${o}/release`, {
807
+ ge(`/queues/${l}/release`, {
808
808
  source_collection: e.collection,
809
809
  item_id: e.item_id
810
810
  })
811
811
  ),
812
- onSuccess: () => y.invalidateQueries({ queryKey: ["queue-items", o, b] }),
813
- onError: () => P.error("Failed to release item")
812
+ onSuccess: () => y.invalidateQueries({ queryKey: ["queue-items", l, b] }),
813
+ onError: () => K.error("Failed to release item")
814
814
  }), { data: ht } = ne({
815
- queryKey: ["queue-column-prefs", o],
816
- queryFn: () => f.request(D(`/queues/${o}/column-prefs`)),
817
- enabled: !!o
818
- }), [Bt, xn] = _(null), [yt, er] = _(null);
819
- K(() => {
815
+ queryKey: ["queue-column-prefs", l],
816
+ queryFn: () => f.request(D(`/queues/${l}/column-prefs`)),
817
+ enabled: !!l
818
+ }), [Qt, vn] = N(null), [yt, er] = N(null);
819
+ P(() => {
820
820
  ht && er(ht.data.default_view_id);
821
821
  }, [ht]);
822
- const [ka, va] = _({}), Fe = pe ? (c == null ? void 0 : c.groups) ?? null : null, kn = (Fe ?? []).filter((e) => !xe.has(e.key)).map((e) => e.key).flatMap(
822
+ const [ka, va] = N({}), Fe = ie ? (i == null ? void 0 : i.groups) ?? null : null, wn = (Fe ?? []).filter((e) => !xe.has(e.key)).map((e) => e.key).flatMap(
823
823
  (e) => Array.from({ length: ka[e] ?? 1 }, (t, n) => ({ key: e, page: n + 1 }))
824
- ), vn = nt({
825
- queries: kn.map(({ key: e, page: t }) => ({
824
+ ), _n = nt({
825
+ queries: wn.map(({ key: e, page: t }) => ({
826
826
  queryKey: [
827
827
  "queue-items",
828
- o,
828
+ l,
829
829
  "group-rows",
830
830
  b,
831
831
  U,
832
832
  ve,
833
- T,
833
+ R,
834
834
  e,
835
835
  t
836
836
  ],
837
837
  queryFn: () => f.request(
838
- D(`/queues/${o}/items`, {
838
+ D(`/queues/${l}/items`, {
839
839
  scope: b,
840
- sort: Pr(U),
840
+ sort: Kr(U),
841
841
  filters: JSON.stringify(Le),
842
- group_by: T,
842
+ group_by: R,
843
843
  group_key: e,
844
844
  page: t,
845
- limit: ku
845
+ limit: vu
846
846
  })
847
847
  ).then((n) => ({ key: e, rows: n.data })),
848
- enabled: !!c && pe,
848
+ enabled: !!i && ie,
849
849
  placeholderData: (n) => n
850
850
  }))
851
- }), jl = vn.some((e) => e.isFetching), tr = O("");
852
- (!jl || !tr.current) && (tr.current = vn.map((e) => e.dataUpdatedAt).join(","));
851
+ }), jl = _n.some((e) => e.isFetching), tr = O("");
852
+ (!jl || !tr.current) && (tr.current = _n.map((e) => e.dataUpdatedAt).join(","));
853
853
  const Ql = tr.current, nr = W(() => {
854
854
  const e = /* @__PURE__ */ new Map();
855
- return vn.forEach((t, n) => {
855
+ return _n.forEach((t, n) => {
856
856
  if (!t.data) return;
857
- const r = kn[n].key;
857
+ const r = wn[n].key;
858
858
  e.set(r, [...e.get(r) ?? [], ...t.data.rows]);
859
859
  }), e;
860
- }, [Ql, kn.map((e) => `${e.key}\0${e.page}`).join("")]), Ul = new Set(
861
- vn.flatMap((e, t) => e.isFetching ? [kn[t].key] : [])
862
- ), L = Fe ? [...nr.values()].flat() : (c == null ? void 0 : c.data) ?? [];
860
+ }, [Ql, wn.map((e) => `${e.key}\0${e.page}`).join("")]), Ul = new Set(
861
+ _n.flatMap((e, t) => e.isFetching ? [wn[t].key] : [])
862
+ ), L = Fe ? [...nr.values()].flat() : (i == null ? void 0 : i.data) ?? [];
863
863
  Jc(
864
- o ? {
864
+ l ? {
865
865
  queue: {
866
- id: o,
866
+ id: l,
867
867
  label: s == null ? void 0 : s.name,
868
868
  scope: b,
869
869
  filters: JSON.stringify(Le),
@@ -871,51 +871,51 @@ function Lp({
871
871
  }
872
872
  } : null
873
873
  );
874
- const Vl = Yc(), jt = L.some((e) => e.fulfilment !== void 0), Qt = L.some((e) => e.send_backs !== void 0), { data: re, dataUpdatedAt: wa } = ne({
875
- queryKey: ["queue-live-stats", o, b, ve, zr],
874
+ const Vl = Yc(), Ut = L.some((e) => e.fulfilment !== void 0), Vt = L.some((e) => e.send_backs !== void 0), { data: re, dataUpdatedAt: wa } = ne({
875
+ queryKey: ["queue-live-stats", l, b, ve, zr],
876
876
  // The totals row ticks with the tiles (#13): the same read totals the whole result as the
877
877
  // viewer (it reads every row for the stats already), coalesced by the stats tick.
878
878
  queryFn: () => f.request(
879
- D(`/queues/${o}/items`, {
879
+ D(`/queues/${l}/items`, {
880
880
  scope: b,
881
881
  filters: JSON.stringify(Le),
882
882
  page: 1,
883
883
  limit: 1,
884
- ...Dt.length ? { totals: Dt.join(",") } : {}
884
+ ...Bt.length ? { totals: Bt.join(",") } : {}
885
885
  })
886
886
  ),
887
- enabled: zr > 0 && !!c,
887
+ enabled: zr > 0 && !!i,
888
888
  staleTime: Number.POSITIVE_INFINITY,
889
889
  placeholderData: (e) => e,
890
890
  retry: !1
891
- }), Ut = !!re && wa > se, g = Ut ? re.stats : c == null ? void 0 : c.stats, J = Ut ? re.filtered_stats ?? null : (c == null ? void 0 : c.filtered_stats) ?? null, _a = Ut ? re.state_counts : c == null ? void 0 : c.state_counts;
892
- K(() => {
893
- if (!Ut) return;
894
- const e = Un.current > 0 || Qn.current, t = Hd({
895
- pending: Bn.current,
891
+ }), Gt = !!re && wa > ce, g = Gt ? re.stats : i == null ? void 0 : i.stats, J = Gt ? re.filtered_stats ?? null : (i == null ? void 0 : i.filtered_stats) ?? null, _a = Gt ? re.state_counts : i == null ? void 0 : i.state_counts;
892
+ P(() => {
893
+ if (!Gt) return;
894
+ const e = Vn.current > 0 || Un.current, t = Jd({
895
+ pending: jn.current,
896
896
  liveTotal: re.total,
897
- rowsTotal: c == null ? void 0 : c.total,
897
+ rowsTotal: i == null ? void 0 : i.total,
898
898
  // Only a table re-reads its rows quietly; the other views keep the pill.
899
- busy: e || $ !== "table"
899
+ busy: e || C !== "table"
900
900
  });
901
- Bn.current = 0, t > 0 && un((r) => r + t), Jd({
901
+ jn.current = 0, t > 0 && mn((r) => r + t), Yd({
902
902
  liveTotal: re.total,
903
- rowsTotal: c == null ? void 0 : c.total,
903
+ rowsTotal: i == null ? void 0 : i.total,
904
904
  // Grouped tables too (army 8 b08-N6): their headers count the whole set, and
905
905
  // nothing else re-read them — "37 of 38" with the strip at 38 for minutes.
906
- table: $ === "table",
906
+ table: C === "table",
907
907
  busy: e
908
908
  }) && (he.current = !0, y.invalidateQueries({
909
- queryKey: pe ? ["queue-items", o] : ["queue-items", o, b]
909
+ queryKey: ie ? ["queue-items", l] : ["queue-items", l, b]
910
910
  }).finally(() => {
911
911
  he.current = !1;
912
912
  }));
913
913
  }, [wa]);
914
- const rr = (To = J ?? g) == null ? void 0 : To.aging, Na = O(void 0);
914
+ const rr = (Ro = J ?? g) == null ? void 0 : Ro.aging, Na = O(void 0);
915
915
  !x.aging_hours && rr && (Na.current = rr);
916
- const Vt = x.aging_hours ? Na.current ?? (g == null ? void 0 : g.aging) : rr ?? (g == null ? void 0 : g.aging);
916
+ const Wt = x.aging_hours ? Na.current ?? (g == null ? void 0 : g.aging) : rr ?? (g == null ? void 0 : g.aging);
917
917
  Jr.current = new Set(L.map((e) => `${e.collection}:${e.item_id}`));
918
- const Gt = zo(
918
+ const It = zo(
919
919
  L.map((e) => ({ collection: e.collection, id: e.item_id })),
920
920
  Yr
921
921
  ), Sa = gc(
@@ -923,70 +923,70 @@ function Lp({
923
923
  (e) => `${e.collection}:${e.item_id}`,
924
924
  be.rootRef,
925
925
  {
926
- enabled: $ === "table" && !pe,
927
- resetKey: JSON.stringify([o, b, ue, U, ve])
926
+ enabled: C === "table" && !ie,
927
+ resetKey: JSON.stringify([l, b, se, U, ve])
928
928
  }
929
- ), Ca = O(se), $a = O(0);
930
- !he.current && se !== $a.current && (Ca.current = se), K(() => {
929
+ ), Ca = O(ce), $a = O(0);
930
+ !he.current && ce !== $a.current && (Ca.current = ce), P(() => {
931
931
  const e = new Set(L.map((t) => `${t.collection}:${t.item_id}`));
932
932
  if (he.current) {
933
- he.current = !1, $a.current = se;
934
- const t = qt.current;
935
- qt.current = [];
933
+ he.current = !1, $a.current = ce;
934
+ const t = Pt.current;
935
+ Pt.current = [];
936
936
  const n = Xr.current, r = /* @__PURE__ */ new Set();
937
- for (const l of t)
938
- !e.has(l.key) || r.has(l.key) || (r.add(l.key), be.note([l.key], l.by, n && !n.has(l.key) ? "create" : "update"));
937
+ for (const o of t)
938
+ !e.has(o.key) || r.has(o.key) || (r.add(o.key), be.note([o.key], o.by, n && !n.has(o.key) ? "create" : "update"));
939
939
  if (n) {
940
- const l = [...e].filter((i) => !n.has(i) && !r.has(i));
941
- l.length > 0 && l.length <= 20 && be.note(l, null, "create");
940
+ const o = [...e].filter((c) => !n.has(c) && !r.has(c));
941
+ o.length > 0 && o.length <= 20 && be.note(o, null, "create");
942
942
  }
943
943
  }
944
944
  Xr.current = e;
945
- }, [se]);
946
- const ar = O(null), Wt = [
945
+ }, [ce]);
946
+ const ar = O(null), Ht = [
947
947
  ...new Set(
948
948
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
949
949
  )
950
950
  ].join(",");
951
- K(() => {
952
- if (!Wt) return;
953
- const e = ac(`queue:${o}`);
954
- return e && !ar.current && (ar.current = e), oc(ct, `queue:${o}`, Wt.split(","));
955
- }, [ct, o, Wt]), K(() => {
956
- un(0), Kt.current.clear();
957
- }, [se]);
958
- function Ta() {
959
- y.invalidateQueries({ queryKey: ["queue-items", o] }), y.invalidateQueries({ queryKey: ["queue-workload", o] }), un(0);
960
- }
951
+ P(() => {
952
+ if (!Ht) return;
953
+ const e = ac(`queue:${l}`);
954
+ return e && !ar.current && (ar.current = e), oc(ct, `queue:${l}`, Ht.split(","));
955
+ }, [ct, l, Ht]), P(() => {
956
+ mn(0), Dt.current.clear();
957
+ }, [ce]);
961
958
  function Ra() {
962
- Kt.current.clear(), Pe.dropHeld(), Ta();
959
+ y.invalidateQueries({ queryKey: ["queue-items", l] }), y.invalidateQueries({ queryKey: ["queue-workload", l] }), mn(0);
960
+ }
961
+ function Ta() {
962
+ Dt.current.clear(), Ke.dropHeld(), Ra();
963
963
  }
964
964
  const { data: Ae } = ne({
965
- queryKey: ["queue-trends", o],
966
- queryFn: () => f.request(D(`/queues/${o}/trends`, { days: 14 })),
967
- enabled: !!o,
965
+ queryKey: ["queue-trends", l],
966
+ queryFn: () => f.request(D(`/queues/${l}/trends`, { days: 14 })),
967
+ enabled: !!l,
968
968
  staleTime: 300 * 1e3
969
969
  }), { data: qe } = ne({
970
- queryKey: ["queue-trends", o, "mine"],
971
- queryFn: () => f.request(D(`/queues/${o}/trends`, { days: 14, scope: "mine" })),
972
- enabled: !!o && b === "mine",
970
+ queryKey: ["queue-trends", l, "mine"],
971
+ queryFn: () => f.request(D(`/queues/${l}/trends`, { days: 14, scope: "mine" })),
972
+ enabled: !!l && b === "mine",
973
973
  staleTime: 300 * 1e3
974
974
  });
975
- function It(e) {
975
+ function Jt(e) {
976
976
  const n = (b === "all" ? Ae == null ? void 0 : Ae.data : b === "mine" ? qe == null ? void 0 : qe.data : void 0) ?? [];
977
977
  if (n.length === 0) return {};
978
978
  if (J) return {};
979
- const r = n.map((i) => i[e]), l = n[n.length - 1];
980
- return { trend: r, delta: ((g == null ? void 0 : g[e]) ?? 0) - l[e] };
979
+ const r = n.map((c) => c[e]), o = n[n.length - 1];
980
+ return { trend: r, delta: ((g == null ? void 0 : g[e]) ?? 0) - o[e] };
981
981
  }
982
982
  const Ee = W(() => {
983
983
  const t = (b === "all" ? Ae == null ? void 0 : Ae.data : b === "mine" ? qe == null ? void 0 : qe.data : void 0) ?? [];
984
984
  if (t.length < 3 || !g || J) return null;
985
985
  const n = t.map(
986
986
  (u) => b === "mine" ? u.owned ?? u.total : u.total
987
- ), r = n.slice(1).map((u, m) => u - n[m]), l = r.reduce((u, m) => u + m, 0) / r.length, i = g.total;
988
- return Math.abs(l) < 0.05 ? { dir: "flat", pace: l, days: null } : l < 0 ? { dir: "down", pace: l, days: Math.max(1, Math.ceil(i / -l)) } : { dir: "up", pace: l, days: null };
989
- }, [Ae == null ? void 0 : Ae.data, qe == null ? void 0 : qe.data, b, g, J]), Ht = W(
987
+ ), r = n.slice(1).map((u, m) => u - n[m]), o = r.reduce((u, m) => u + m, 0) / r.length, c = g.total;
988
+ 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 };
989
+ }, [Ae == null ? void 0 : Ae.data, qe == null ? void 0 : qe.data, b, g, J]), Yt = W(
990
990
  () => [
991
991
  ...new Set(
992
992
  ((s == null ? void 0 : s.sources) ?? []).filter((e) => e.type === "collection" && e.collection).map((e) => e.collection)
@@ -994,11 +994,11 @@ function Lp({
994
994
  ],
995
995
  [s == null ? void 0 : s.sources]
996
996
  ), { data: Gl } = ne({
997
- queryKey: Rc.collections(),
997
+ queryKey: Tc.collections(),
998
998
  queryFn: () => f.request(D("/collections")).then((e) => e.data),
999
999
  staleTime: 300 * 1e3
1000
1000
  }), gt = nt({
1001
- queries: Ht.map((e) => ({
1001
+ queries: Yt.map((e) => ({
1002
1002
  queryKey: ["queue-collection-addendums", e],
1003
1003
  queryFn: () => f.request(
1004
1004
  D(`/collections/${e}`)
@@ -1012,7 +1012,7 @@ function Lp({
1012
1012
  queryKey: ["queue-integrations-collections"],
1013
1013
  queryFn: () => f.request(D("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
1014
1014
  staleTime: 300 * 1e3
1015
- }), Me = Ht.some((e) => or.includes(e)), lr = W(() => {
1015
+ }), Me = Yt.some((e) => or.includes(e)), lr = W(() => {
1016
1016
  var t;
1017
1017
  const e = {};
1018
1018
  if (!Me) return e;
@@ -1036,9 +1036,9 @@ function Lp({
1036
1036
  }), Wl = Oa.map((e) => e.dataUpdatedAt).join(","), Il = W(() => {
1037
1037
  const e = {};
1038
1038
  return La.forEach((t, n) => {
1039
- var l;
1040
- const r = ((l = Oa[n]) == null ? void 0 : l.data) ?? {};
1041
- for (const [i, u] of Object.entries(r)) e[`${t}:${i}`] = u;
1039
+ var o;
1040
+ const r = ((o = Oa[n]) == null ? void 0 : o.data) ?? {};
1041
+ for (const [c, u] of Object.entries(r)) e[`${t}:${c}`] = u;
1042
1042
  }), e;
1043
1043
  }, [Wl]), sr = W(() => {
1044
1044
  var t;
@@ -1062,10 +1062,10 @@ function Lp({
1062
1062
  const e = {};
1063
1063
  return ir.forEach((t, n) => {
1064
1064
  var r;
1065
- for (const [l, i] of Object.entries(((r = Fa[n]) == null ? void 0 : r.data) ?? {})) e[`${t}:${l}`] = i;
1065
+ for (const [o, c] of Object.entries(((r = Fa[n]) == null ? void 0 : r.data) ?? {})) e[`${t}:${o}`] = c;
1066
1066
  }), e;
1067
1067
  }, [Hl]), Aa = ir.length > 0, qa = nt({
1068
- queries: Ht.map((e) => ({
1068
+ queries: Yt.map((e) => ({
1069
1069
  queryKey: ["queue-collection-risk-rules", e],
1070
1070
  queryFn: () => f.request(
1071
1071
  D("/at-risk/rules/active", { collection: e })
@@ -1083,69 +1083,69 @@ function Lp({
1083
1083
  });
1084
1084
  }
1085
1085
  return [...e.values()];
1086
- }, [Yl]), Ka = nt({
1087
- queries: Ht.map((e) => ({
1086
+ }, [Yl]), Pa = nt({
1087
+ queries: Yt.map((e) => ({
1088
1088
  queryKey: ["queue-collection-states", e],
1089
1089
  queryFn: () => f.request(
1090
1090
  D(`/queues/collection-states/${e}`)
1091
1091
  ).then((t) => t.data),
1092
1092
  staleTime: 300 * 1e3
1093
1093
  }))
1094
- }), Pa = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), Be = W(() => {
1094
+ }), Ka = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), Be = W(() => {
1095
1095
  const e = {};
1096
- for (const t of Ka)
1096
+ for (const t of Pa)
1097
1097
  (t.data ?? []).forEach((n, r) => {
1098
1098
  e[n.key] = { label: n.label, color: n.color, sort: r };
1099
1099
  });
1100
1100
  return e;
1101
- }, [Ka.map((e) => e.data)]), Da = g ? Object.entries(g.by_state).sort(
1101
+ }, [Pa.map((e) => e.data)]), Da = g ? Object.entries(g.by_state).sort(
1102
1102
  (e, t) => {
1103
1103
  var n, r;
1104
1104
  return (((n = Be[e[0]]) == null ? void 0 : n.sort) ?? Number.MAX_SAFE_INTEGER) - (((r = Be[t[0]]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER);
1105
1105
  }
1106
1106
  ) : [], Ma = (e) => [...e].sort(
1107
1107
  (t, n) => {
1108
- var r, l;
1109
- return (((r = Be[t]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER) - (((l = Be[n]) == null ? void 0 : l.sort) ?? Number.MAX_SAFE_INTEGER);
1108
+ var r, o;
1109
+ return (((r = Be[t]) == null ? void 0 : r.sort) ?? Number.MAX_SAFE_INTEGER) - (((o = Be[n]) == null ? void 0 : o.sort) ?? Number.MAX_SAFE_INTEGER);
1110
1110
  }
1111
1111
  ), cr = W(() => {
1112
1112
  const e = {};
1113
1113
  for (const [t, n] of Object.entries(Be)) e[t] = n.label;
1114
1114
  return e;
1115
- }, [Be]), Ke = (e) => e ? e === "none" ? "No State" : cr[e] ?? Pa(e) : "—", He = (e) => {
1116
- if (e === sn) return "Addendums";
1115
+ }, [Be]), Pe = (e) => e ? e === "none" ? "No State" : cr[e] ?? Ka(e) : "—", He = (e) => {
1116
+ if (e === Lt) return "Addendums";
1117
1117
  const t = (Gl ?? []).find((n) => n.collection === e);
1118
- return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || Pa(e);
1119
- }, we = W(() => T ? Fe ? Fe.map((e) => ({
1118
+ return (t == null ? void 0 : t.display_name) || (t == null ? void 0 : t.plural) || Ka(e);
1119
+ }, we = W(() => R ? Fe ? Fe.map((e) => ({
1120
1120
  key: e.key,
1121
1121
  rows: nr.get(e.key) ?? [],
1122
1122
  breached: e.breached,
1123
1123
  atRisk: e.at_risk,
1124
1124
  count: e.count,
1125
1125
  sums: e.sums ?? {}
1126
- })) : Lc(L, T).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [L, T, Fe, nr]), dr = O(null);
1127
- K(() => {
1128
- if (!T || !we) {
1126
+ })) : Lc(L, R).map((e) => ({ ...e, count: e.rows.length, sums: {} })) : null, [L, R, Fe, nr]), dr = O(null);
1127
+ P(() => {
1128
+ if (!R || !we) {
1129
1129
  dr.current = null;
1130
1130
  return;
1131
1131
  }
1132
- if (pe && !Fe || dr.current === T) return;
1133
- dr.current = T;
1132
+ if (ie && !Fe || dr.current === R) return;
1133
+ dr.current = R;
1134
1134
  const e = we.reduce((t, n) => t + n.count, 0);
1135
- En(e > 200 ? new Set(we.map((t) => t.key)) : /* @__PURE__ */ new Set()), va({});
1136
- }, [T, Fe]);
1135
+ Pn(e > 200 ? new Set(we.map((t) => t.key)) : /* @__PURE__ */ new Set()), va({});
1136
+ }, [R, Fe]);
1137
1137
  function zl(e) {
1138
- En((t) => {
1138
+ Pn((t) => {
1139
1139
  const n = new Set(t);
1140
1140
  return n.has(e) ? n.delete(e) : n.add(e), n;
1141
1141
  });
1142
1142
  }
1143
- const _e = W(() => we ? we.filter((e) => !xe.has(e.key)).flatMap((e) => e.rows) : L, [we, L, xe]), S = (e) => `${e.collection}:${e.item_id}`, [Je, Ye] = _(null), [Xl, ur] = _(!1), [Jt, Yt] = _(null), mr = O(null), pr = (e) => {
1144
- if (e.collection === sn && e.url) {
1143
+ const _e = W(() => we ? we.filter((e) => !xe.has(e.key)).flatMap((e) => e.rows) : L, [we, L, xe]), k = (e) => `${e.collection}:${e.item_id}`, [Je, Ye] = N(null), [Xl, ur] = N(!1), [zt, Xt] = N(null), mr = O(null), pr = (e) => {
1144
+ if (e.collection === Lt && e.url) {
1145
1145
  const t = e.url.match(/^\/collections\/([^/?]+)\/([^/?]+)(?:\?(.*))?$/);
1146
1146
  if (t) {
1147
1147
  const n = {};
1148
- for (const [r, l] of new URLSearchParams(t[3] ?? "")) n[r] = l;
1148
+ for (const [r, o] of new URLSearchParams(t[3] ?? "")) n[r] = o;
1149
1149
  return {
1150
1150
  collection: decodeURIComponent(t[1]),
1151
1151
  itemId: decodeURIComponent(t[2]),
@@ -1161,21 +1161,28 @@ function Lp({
1161
1161
  };
1162
1162
  }, Ba = (e) => {
1163
1163
  var t;
1164
- s && (e && ic({
1165
- list: `queue:${o}`,
1166
- label: s.name,
1167
- rows: L.filter((n) => n.collection !== sn).map((n) => ({ collection: n.collection, id: String(n.item_id) })),
1168
- opened: e,
1169
- entry: Jo()
1170
- }), ol({
1171
- queue_id: o,
1172
- name: s.name,
1173
- path: `${window.location.pathname}${window.location.search}`,
1174
- at: Date.now(),
1175
- scroll: ((t = _n.current) == null ? void 0 : t.scrollTop) ?? 0,
1176
- state: { scope: b, page: ue, sort: U, filters: x, group_by: T, view: $ },
1177
- entry: Jo()
1178
- }));
1164
+ if (s) {
1165
+ if (e) {
1166
+ const n = C === "table" && !ie, r = !L.some((o) => o.collection === Lt);
1167
+ ic({
1168
+ list: `queue:${l}`,
1169
+ label: s.name,
1170
+ rows: L.filter((o) => o.collection !== Lt).map((o) => ({ collection: o.collection, id: String(o.item_id) })),
1171
+ opened: e,
1172
+ entry: Jo(),
1173
+ ...n && r && typeof (i == null ? void 0 : i.total) == "number" ? { total: i.total, offset: (se - 1) * fn } : {}
1174
+ });
1175
+ }
1176
+ ol({
1177
+ queue_id: l,
1178
+ name: s.name,
1179
+ path: `${window.location.pathname}${window.location.search}`,
1180
+ at: Date.now(),
1181
+ scroll: ((t = Sn.current) == null ? void 0 : t.scrollTop) ?? 0,
1182
+ state: { scope: b, page: se, sort: U, filters: x, group_by: R, view: C },
1183
+ entry: Jo()
1184
+ });
1185
+ }
1179
1186
  }, xt = (e) => {
1180
1187
  Ba({ collection: e.collection, id: String(e.item_id) }), Q.open(pr(e));
1181
1188
  }, Zl = (e) => {
@@ -1186,20 +1193,20 @@ function Lp({
1186
1193
  itemId: e.itemId,
1187
1194
  layoutSlug: n ? (p == null ? void 0 : p.item_layout) ?? null : null
1188
1195
  });
1189
- }, [I, zt] = _(
1196
+ }, [I, Zt] = N(
1190
1197
  null
1191
1198
  );
1192
- K(() => {
1199
+ P(() => {
1193
1200
  if (!I) return;
1194
- const e = () => zt(null);
1201
+ const e = () => Zt(null);
1195
1202
  return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), () => {
1196
1203
  window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0);
1197
1204
  };
1198
1205
  }, [I]);
1199
1206
  const fr = (e) => {
1200
- Yt(S(e));
1207
+ Xt(k(e));
1201
1208
  const t = (p == null ? void 0 : p.row_click) ?? "preview";
1202
- if (t === "full" || e.collection === sn) {
1209
+ if (t === "full" || e.collection === Lt) {
1203
1210
  xt(e);
1204
1211
  return;
1205
1212
  }
@@ -1215,64 +1222,64 @@ function Lp({
1215
1222
  }
1216
1223
  Ye(e);
1217
1224
  };
1218
- K(() => {
1225
+ P(() => {
1219
1226
  if (!Je) return;
1220
- const e = L.find((t) => S(t) === S(Je));
1227
+ const e = L.find((t) => k(t) === k(Je));
1221
1228
  e && e !== Je && Ye(e);
1222
1229
  }, [L]);
1223
1230
  const es = (e) => !e.claimed_by || e.claimed_by.id === z;
1224
1231
  function ja(e) {
1225
- const t = e ? _e.findIndex((r) => S(r) === S(e)) + 1 : 0, n = _e.slice(t).find(es);
1232
+ const t = e ? _e.findIndex((r) => k(r) === k(e)) + 1 : 0, n = _e.slice(t).find(es);
1226
1233
  if (!n) {
1227
- ur(!1), Ye(null), P.info("Nothing left to work on — queue clear!");
1234
+ ur(!1), Ye(null), K.info("Nothing left to work on — queue clear!");
1228
1235
  return;
1229
1236
  }
1230
- if (Yt(S(n)), Re && !n.claimed_by && Ie.mutate(n), (p == null ? void 0 : p.row_click) === "full") {
1237
+ if (Xt(k(n)), Te && !n.claimed_by && Ie.mutate(n), (p == null ? void 0 : p.row_click) === "full") {
1231
1238
  xt(n);
1232
1239
  return;
1233
1240
  }
1234
1241
  ur(!0), Ye(n);
1235
1242
  }
1236
- K(() => {
1237
- if ($ !== "table") return;
1243
+ P(() => {
1244
+ if (C !== "table") return;
1238
1245
  function e(t) {
1239
- var l;
1240
- if (t.metaKey || t.ctrlKey || t.altKey || !gu(t.target)) return;
1241
- const n = Jt ? _e.findIndex((i) => S(i) === Jt) : -1, r = (i) => {
1242
- Yt(S(i));
1243
- const u = S(i), m = [...document.querySelectorAll("tr[data-row-key]")].find(
1246
+ var o;
1247
+ if (t.metaKey || t.ctrlKey || t.altKey || !xu(t.target)) return;
1248
+ const n = zt ? _e.findIndex((c) => k(c) === zt) : -1, r = (c) => {
1249
+ Xt(k(c));
1250
+ const u = k(c), m = [...document.querySelectorAll("tr[data-row-key]")].find(
1244
1251
  (h) => h.getAttribute("data-row-key") === u
1245
1252
  );
1246
1253
  m == null || m.focus();
1247
1254
  };
1248
1255
  if (t.key === "j" || t.key === "ArrowDown") {
1249
1256
  t.preventDefault();
1250
- const i = _e[Math.min(n + 1, _e.length - 1)];
1251
- i && r(i);
1257
+ const c = _e[Math.min(n + 1, _e.length - 1)];
1258
+ c && r(c);
1252
1259
  } else if (t.key === "k" || t.key === "ArrowUp") {
1253
1260
  t.preventDefault();
1254
- const i = _e[Math.max(n - 1, 0)];
1255
- i && r(i);
1256
- } else if (t.key === "c" && n >= 0 && Re) {
1261
+ const c = _e[Math.max(n - 1, 0)];
1262
+ c && r(c);
1263
+ } else if (t.key === "c" && n >= 0 && Te) {
1257
1264
  t.preventDefault();
1258
- const i = _e[n];
1259
- ((l = i.claimed_by) == null ? void 0 : l.id) === z ? bt.mutate(i) : Ie.mutate(i);
1265
+ const c = _e[n];
1266
+ ((o = c.claimed_by) == null ? void 0 : o.id) === z ? bt.mutate(c) : Ie.mutate(c);
1260
1267
  } else t.key === "o" && n >= 0 && (t.preventDefault(), xt(_e[n]));
1261
1268
  }
1262
1269
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1263
- }, [$, _e, Jt, Je, z, Ie, bt, Re]);
1270
+ }, [C, _e, zt, Je, z, Ie, bt, Te]);
1264
1271
  const { data: E } = ne({
1265
- queryKey: ["queue-views", o],
1266
- queryFn: () => f.request(D(`/queues/${o}/views`)),
1267
- enabled: !!o
1268
- }), [fe, ze] = _(null), [ts, br] = _(!1), [wn, Qa] = _(""), [Ua, Va] = _(!1), [kt, Ga] = _(!1);
1269
- function Xt(e) {
1272
+ queryKey: ["queue-views", l],
1273
+ queryFn: () => f.request(D(`/queues/${l}/views`)),
1274
+ enabled: !!l
1275
+ }), [fe, ze] = N(null), [ts, br] = N(!1), [Nn, Qa] = N(""), [Ua, Va] = N(!1), [kt, Ga] = N(!1);
1276
+ function en(e) {
1270
1277
  var n;
1271
1278
  const t = e.state ?? {};
1272
- e.is_default ? (de(((n = s == null ? void 0 : s.display_config) == null ? void 0 : n.default_scope) ?? "all"), V({ ...ke.current })) : (de(t.scope ?? "all"), V({ ...ke.current, ...t.filters ?? {} })), lt(t.sort ?? ""), Ot(t.group_by ?? null), xn(t.columns ?? null), Pn(t.pins ?? null), dn(
1279
+ e.is_default ? (me(((n = s == null ? void 0 : s.display_config) == null ? void 0 : n.default_scope) ?? "all"), V({ ...ke.current })) : (me(t.scope ?? "all"), V({ ...ke.current, ...t.filters ?? {} })), lt(t.sort ?? ""), At(t.group_by ?? null), vn(t.columns ?? null), Dn(t.pins ?? null), un(
1273
1280
  Object.fromEntries(
1274
1281
  Object.entries(t.totals ?? {}).filter(
1275
- ([r, l]) => jr(r) && ud(l)
1282
+ ([r, o]) => jr(r) && ud(o)
1276
1283
  )
1277
1284
  )
1278
1285
  ), t.view && ot(Ve.includes(t.view) ? t.view : Ve[0]), j(1), ze(e.id);
@@ -1281,62 +1288,62 @@ function Lp({
1281
1288
  var t, n;
1282
1289
  const e = E == null ? void 0 : E.data.find((r) => r.is_default);
1283
1290
  if (e) {
1284
- Xt(e);
1291
+ en(e);
1285
1292
  return;
1286
1293
  }
1287
- de(((t = s == null ? void 0 : s.display_config) == null ? void 0 : t.default_scope) ?? "all"), V({ ...ke.current }), lt(""), Ot(null), xn(null), Pn(null), dn({}), (n = s == null ? void 0 : s.display_config) != null && n.default_view && ot(s.display_config.default_view), j(1), ze(null);
1294
+ me(((t = s == null ? void 0 : s.display_config) == null ? void 0 : t.default_scope) ?? "all"), V({ ...ke.current }), lt(""), At(null), vn(null), Dn(null), un({}), (n = s == null ? void 0 : s.display_config) != null && n.default_view && ot(s.display_config.default_view), j(1), ze(null);
1288
1295
  }
1289
- K(() => {
1296
+ P(() => {
1290
1297
  if (G || !(s != null && s.display_config) || ht === void 0 || E === void 0) return;
1291
1298
  const e = ht.data.default_view_id, t = e != null ? E.data.find((r) => r.id === e) : void 0, n = E.data.find((r) => r.is_default);
1292
- t ? Xt(t) : n ? Xt(n) : (ot(s.display_config.default_view), de(s.display_config.default_scope)), gl(!0);
1299
+ t ? en(t) : n ? en(n) : (ot(s.display_config.default_view), me(s.display_config.default_scope)), gl(!0);
1293
1300
  }, [s, ht, E, G]);
1294
- const _n = O(null), Nn = O(null);
1295
- K(() => {
1301
+ const Sn = O(null), Cn = O(null);
1302
+ P(() => {
1296
1303
  if (!G) return;
1297
1304
  const e = _d();
1298
- if (!e || !Nd(e, o, nc(), tc())) return;
1305
+ if (!e || !Nd(e, l, nc(), tc())) return;
1299
1306
  ol({ ...e, restore: !1 });
1300
1307
  const t = e.state ?? {};
1301
- t.scope && de(t.scope), t.filters && V({ ...ke.current, ...t.filters }), t.sort != null && lt(t.sort), Ot(t.group_by ?? null), t.view && ot(t.view), t.page && j(t.page), Nn.current = e.scroll ?? 0;
1302
- const n = lc(`queue:${o}`);
1308
+ t.scope && me(t.scope), t.filters && V({ ...ke.current, ...t.filters }), t.sort != null && lt(t.sort), At(t.group_by ?? null), t.view && ot(t.view), t.page && j(t.page), Cn.current = e.scroll ?? 0;
1309
+ const n = lc(`queue:${l}`);
1303
1310
  if (n) {
1304
1311
  const r = `${n.collection}:${n.id}`;
1305
- Yt(r), mr.current = r;
1312
+ Xt(r), mr.current = r;
1306
1313
  }
1307
- Y && Y.length > 0 && wt.back(Y.length);
1308
- }, [G, o]);
1309
- const Wa = O(!1), [Ia, rs] = _(0);
1310
- K(() => {
1311
- if (Wa.current || !G || !Wt) return;
1314
+ Y && Y.length > 0 && _t.back(Y.length);
1315
+ }, [G, l]);
1316
+ const Wa = O(!1), [Ia, rs] = N(0);
1317
+ P(() => {
1318
+ if (Wa.current || !G || !Ht) return;
1312
1319
  if (Ia === 0) {
1313
1320
  rs(1);
1314
1321
  return;
1315
1322
  }
1316
- if (!c || Zn) return;
1323
+ if (!i || Zn) return;
1317
1324
  Wa.current = !0;
1318
- const e = ar.current, n = !!e && se > 0 && se <= e.leftAt ? Yo(e) : "fresh";
1319
- n === "replay" && e && Pe.paused ? Wn(e.events.filter((l) => !l.own), () => {
1320
- }) : (n === "replay" || n === "refetch") && (qt.current = ((e == null ? void 0 : e.events) ?? []).filter((l) => !l.own).map((l) => ({ key: `${l.collection}:${String(l.item)}`, by: null })), he.current = !0, y.invalidateQueries({
1321
- queryKey: pe ? ["queue-items", o] : ["queue-items", o, b]
1325
+ const e = ar.current, n = !!e && ce > 0 && ce <= e.leftAt ? Yo(e) : "fresh";
1326
+ n === "replay" && e && Ke.paused ? In(e.events.filter((o) => !o.own), () => {
1327
+ }) : (n === "replay" || n === "refetch") && (Pt.current = ((e == null ? void 0 : e.events) ?? []).filter((o) => !o.own).map((o) => ({ key: `${o.collection}:${String(o.item)}`, by: null })), he.current = !0, y.invalidateQueries({
1328
+ queryKey: ie ? ["queue-items", l] : ["queue-items", l, b]
1322
1329
  }).finally(() => {
1323
1330
  he.current = !1;
1324
1331
  })), Al(!1);
1325
1332
  const r = mr.current;
1326
1333
  mr.current = null, r && setTimeout(() => sc(be.rootRef.current, r), 260);
1327
- }, [c, Zn, G, Wt, Ia]), K(() => {
1328
- var i;
1334
+ }, [i, Zn, G, Ht, Ia]), P(() => {
1335
+ var c;
1329
1336
  if (!G || typeof window > "u") return;
1330
- const e = new URLSearchParams(window.location.search), t = e.get("scope"), n = ((i = e.get("state")) == null ? void 0 : i.trim()) || null, r = t === "all" || t === "mine";
1337
+ const e = new URLSearchParams(window.location.search), t = e.get("scope"), n = ((c = e.get("state")) == null ? void 0 : c.trim()) || null, r = t === "all" || t === "mine";
1331
1338
  if (!r && !n) return;
1332
1339
  e.delete("scope"), e.delete("state");
1333
- const l = e.toString();
1340
+ const o = e.toString();
1334
1341
  window.history.replaceState(
1335
1342
  window.history.state,
1336
1343
  "",
1337
- `${window.location.pathname}${l ? `?${l}` : ""}${window.location.hash}`
1338
- ), r && de(t), n && V((u) => ({ ...u, state: [n] })), j(1);
1339
- }, [G]), K(() => {
1344
+ `${window.location.pathname}${o ? `?${o}` : ""}${window.location.hash}`
1345
+ ), r && me(t), n && V((u) => ({ ...u, state: [n] })), j(1);
1346
+ }, [G]), P(() => {
1340
1347
  if (!G || typeof window > "u") return;
1341
1348
  const e = new URLSearchParams(window.location.search), t = e.get("owner");
1342
1349
  if (!t) return;
@@ -1346,139 +1353,139 @@ function Lp({
1346
1353
  window.history.state,
1347
1354
  "",
1348
1355
  `${window.location.pathname}${n ? `?${n}` : ""}${window.location.hash}`
1349
- ), de("all"), V((r) => ({ ...r, owners: [t] })), ze(null), j(1);
1356
+ ), me("all"), V((r) => ({ ...r, owners: [t] })), ze(null), j(1);
1350
1357
  }, [G]);
1351
1358
  const hr = O(null);
1352
- K(() => {
1359
+ P(() => {
1353
1360
  if (!G) return;
1354
- const e = Yi(zi(`queue:${o}`));
1355
- e && (Xi(), Xt({
1361
+ const e = Yi(zi(`queue:${l}`));
1362
+ e && (Xi(), en({
1356
1363
  id: -1,
1357
1364
  // Saved views type filters loosely as strings; multi-selects ride as arrays there too.
1358
1365
  state: e
1359
1366
  }), ze(null), e.page && j(e.page), e.view_id && (hr.current = e.view_id));
1360
- }, [G]), K(() => {
1367
+ }, [G]), P(() => {
1361
1368
  const e = hr.current;
1362
1369
  e == null || !(E != null && E.data) || (hr.current = null, E.data.some((t) => t.id === e) && ze(e));
1363
1370
  }, [E, G]);
1364
1371
  const Ha = () => {
1365
1372
  var r;
1366
- const e = [], t = (r = Qr.find((l) => l.value === b)) == null ? void 0 : r.label;
1373
+ const e = [], t = (r = Qr.find((o) => o.value === b)) == null ? void 0 : r.label;
1367
1374
  t && e.push(t);
1368
1375
  const n = Object.values(x).filter(
1369
- (l) => Array.isArray(l) ? l.length > 0 : l !== "" && l != null
1376
+ (o) => Array.isArray(o) ? o.length > 0 : o !== "" && o != null
1370
1377
  ).length;
1371
1378
  return n > 0 && e.push(`${n} filter${n === 1 ? "" : "s"}`), e.length ? e.join(", ") : null;
1372
1379
  }, yr = () => ({
1373
1380
  scope: b,
1374
1381
  filters: x,
1375
1382
  sort: U,
1376
- group_by: T,
1377
- view: $,
1378
- columns: Bt,
1383
+ group_by: R,
1384
+ view: C,
1385
+ columns: Qt,
1379
1386
  pins: st,
1380
- ...ut.length ? { totals: rn() } : {},
1381
- ...ue > 1 ? { page: ue } : {},
1387
+ ...ut.length ? { totals: on() } : {},
1388
+ ...se > 1 ? { page: se } : {},
1382
1389
  ...fe != null && fe > 0 ? { view_id: fe } : {}
1383
1390
  });
1384
- K(() => {
1385
- Nn.current == null || L.length === 0 || !_n.current || (_n.current.scrollTop = Nn.current, Nn.current = null);
1391
+ P(() => {
1392
+ Cn.current == null || L.length === 0 || !Sn.current || (Sn.current.scrollTop = Cn.current, Cn.current = null);
1386
1393
  }, [L]);
1387
1394
  const { isAdmin: Xe } = Io(), as = L.map((e) => `${e.collection}|${e.item_id}`).join(","), os = W(
1388
1395
  () => L.map((e) => ({ collection: e.collection, id: e.item_id })),
1389
1396
  [as]
1390
- ), Ja = Ad(os, Xe), ls = (e) => Jt === S(e) ? (
1397
+ ), Ja = qd(os, Xe), ls = (e) => zt === k(e) ? (
1391
1398
  // Pinned sticky cells use bg-inherit — the highlight must be
1392
1399
  // OPAQUE (nvr-cyan/5-over-white equivalents) or horizontally
1393
1400
  // scrolled content bleeds through the pinned columns. Same
1394
1401
  // pair DataTable uses for selected rows when pins are active.
1395
1402
  "bg-[#f2fdff] dark:bg-[#20303a]"
1396
- ) : e.at_risk ? Ec(e.at_risk_color ?? "red") : void 0, Zt = Xe || (s == null ? void 0 : s.owner) != null && s.owner === z, ss = Qe({
1403
+ ) : e.at_risk ? Ec(e.at_risk_color ?? "red") : void 0, tn = Xe || (s == null ? void 0 : s.owner) != null && s.owner === z, ss = Qe({
1397
1404
  mutationFn: ({ viewId: e, on: t }) => f.request(Ho(`/queues/views/${e}`, { is_default: t })),
1398
1405
  onSuccess: () => {
1399
- y.invalidateQueries({ queryKey: ["queue-views", o] }), P.success("Queue default view updated");
1406
+ y.invalidateQueries({ queryKey: ["queue-views", l] }), K.success("Queue default view updated");
1400
1407
  },
1401
- onError: () => P.error("Could not update the queue default view")
1402
- }), Sn = Qe({
1408
+ onError: () => K.error("Could not update the queue default view")
1409
+ }), $n = Qe({
1403
1410
  mutationFn: () => f.request(
1404
- ge(`/queues/${o}/views`, {
1405
- name: wn.trim(),
1406
- is_shared: Zt && (Ua || kt),
1411
+ ge(`/queues/${l}/views`, {
1412
+ name: Nn.trim(),
1413
+ is_shared: tn && (Ua || kt),
1407
1414
  is_default: kt,
1408
1415
  state: {
1409
1416
  scope: b,
1410
1417
  filters: x,
1411
1418
  sort: U,
1412
- group_by: T,
1413
- view: $,
1414
- columns: Bt,
1419
+ group_by: R,
1420
+ view: C,
1421
+ columns: Qt,
1415
1422
  pins: st,
1416
- totals: rn()
1423
+ totals: on()
1417
1424
  }
1418
1425
  })
1419
1426
  ),
1420
1427
  onSuccess: (e) => {
1421
- xo(rn()), br(!1), Qa(""), Va(!1), Ga(!1), ze(e.data.id), y.invalidateQueries({ queryKey: ["queue-views", o] }), P.success("View saved");
1428
+ xo(on()), br(!1), Qa(""), Va(!1), Ga(!1), ze(e.data.id), y.invalidateQueries({ queryKey: ["queue-views", l] }), K.success("View saved");
1422
1429
  },
1423
- onError: () => P.error("Failed to save view")
1424
- }), [Ya, za] = _(null), Ze = Qe({
1430
+ onError: () => K.error("Failed to save view")
1431
+ }), [Ya, za] = N(null), Ze = Qe({
1425
1432
  mutationFn: (e) => f.request(
1426
1433
  Ho(`/queues/views/${e.id}`, {
1427
1434
  state: {
1428
1435
  // The queue default stores layout only (the server drops these too).
1429
1436
  ...e.is_default ? {} : { scope: b, filters: x },
1430
1437
  sort: U,
1431
- group_by: T,
1432
- view: $,
1433
- columns: Bt,
1438
+ group_by: R,
1439
+ view: C,
1440
+ columns: Qt,
1434
1441
  pins: st,
1435
- totals: rn()
1442
+ totals: on()
1436
1443
  }
1437
1444
  })
1438
1445
  ),
1439
1446
  onSuccess: (e, t) => {
1440
- t.id === fe && xo(rn()), y.invalidateQueries({ queryKey: ["queue-views", o] }), za(t.id), setTimeout(() => za((n) => n === t.id ? null : n), 2e3), P.success(
1447
+ t.id === fe && xo(on()), y.invalidateQueries({ queryKey: ["queue-views", l] }), za(t.id), setTimeout(() => za((n) => n === t.id ? null : n), 2e3), K.success(
1441
1448
  t.is_default ? `Saved "${t.name}" with the current columns, sort and totals. Filters stay each person's own.` : `Saved "${t.name}" with the current filters, scope and sort`
1442
1449
  );
1443
1450
  },
1444
- onError: () => P.error("Failed to update view")
1445
- }), [gr, Cn] = _(null);
1446
- K(() => {
1451
+ onError: () => K.error("Failed to update view")
1452
+ }), [gr, Rn] = N(null);
1453
+ P(() => {
1447
1454
  if (gr == null) return;
1448
- const e = setTimeout(() => Cn(null), 5e3);
1455
+ const e = setTimeout(() => Rn(null), 5e3);
1449
1456
  return () => clearTimeout(e);
1450
1457
  }, [gr]);
1451
1458
  const Xa = Qe({
1452
1459
  mutationFn: (e) => f.request(Er(`/queues/views/${e}`)),
1453
1460
  onSuccess: (e, t) => {
1454
- Cn(null), y.invalidateQueries({ queryKey: ["queue-views", o] }), ze(null), yt === t && er(null);
1461
+ Rn(null), y.invalidateQueries({ queryKey: ["queue-views", l] }), ze(null), yt === t && er(null);
1455
1462
  },
1456
- onError: () => P.error("Failed to delete view")
1463
+ onError: () => K.error("Failed to delete view")
1457
1464
  }), is = Qe({
1458
- mutationFn: (e) => f.request(Fi(`/queues/${o}/default-view`, { view_id: e })),
1465
+ mutationFn: (e) => f.request(Fi(`/queues/${l}/default-view`, { view_id: e })),
1459
1466
  onMutate: (e) => er(e),
1460
1467
  onSuccess: (e, t) => {
1461
- y.invalidateQueries({ queryKey: ["queue-column-prefs", o] }), P.success(
1468
+ y.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), K.success(
1462
1469
  t === null ? "Reverted to the general default" : "Set as your default view"
1463
1470
  );
1464
1471
  },
1465
1472
  onError: () => {
1466
- y.invalidateQueries({ queryKey: ["queue-column-prefs", o] }), P.error("Failed to update default view");
1473
+ y.invalidateQueries({ queryKey: ["queue-column-prefs", l] }), K.error("Failed to update default view");
1467
1474
  }
1468
1475
  }), cs = () => {
1469
1476
  X && De([]), ha(!X);
1470
1477
  };
1471
- K(() => {
1472
- $ !== "table" && X && (ha(!1), De([]));
1473
- }, [$, X]), Oi(), Un.current = ee.length;
1474
- const [vt, Za] = _(!1);
1478
+ P(() => {
1479
+ C !== "table" && X && (ha(!1), De([]));
1480
+ }, [C, X]), Oi(), Vn.current = ee.length;
1481
+ const [vt, Za] = N(!1);
1475
1482
  async function xr(e, t) {
1476
- const n = L.filter((u) => ee.includes(S(u)));
1477
- Za(!0), gn.beginBatch();
1483
+ const n = L.filter((u) => ee.includes(k(u)));
1484
+ Za(!0), kn.beginBatch();
1478
1485
  const r = await Promise.allSettled(n.map(t));
1479
- gn.endBatch();
1480
- const l = r.filter((u) => u.status === "fulfilled").length, i = r.length - l;
1481
- Za(!1), De([]), y.invalidateQueries({ queryKey: ["queue-items", o] }), i ? P.warning(`${e}: ${l} succeeded, ${i} failed`) : P.success(`${e}: ${l} succeeded`);
1486
+ kn.endBatch();
1487
+ const o = r.filter((u) => u.status === "fulfilled").length, c = r.length - o;
1488
+ Za(!1), De([]), y.invalidateQueries({ queryKey: ["queue-items", l] }), c ? K.warning(`${e}: ${o} succeeded, ${c} failed`) : K.success(`${e}: ${o} succeeded`);
1482
1489
  }
1483
1490
  const ye = (e) => {
1484
1491
  var t;
@@ -1487,27 +1494,27 @@ function Lp({
1487
1494
  if (r) return r;
1488
1495
  }
1489
1496
  return null;
1490
- }, Ne = X ? ee : vu, $n = Kc(Ne), ds = W(
1497
+ }, Ne = X ? ee : wu, Tn = Pc(Ne), ds = W(
1491
1498
  () => [...new Set(Ne.map((e) => Dr(e).collection))],
1492
1499
  [Ne]
1493
- ), kr = Pc(ds, $n.picks), [vr, eo] = _(!1);
1500
+ ), kr = Kc(ds, Tn.picks), [vr, eo] = N(!1);
1494
1501
  vr && Ne.length === 0 && eo(!1);
1495
1502
  const us = W(
1496
1503
  () => vr ? Ne : Ne.filter((e) => kr.marked.has(e)),
1497
1504
  [vr, Ne, kr.marked]
1498
- ), ms = Dc(us, $n.picks).rows.filter((e) => $n.picks.has(e.key)), ps = zo(
1505
+ ), ms = Dc(us, Tn.picks).rows.filter((e) => Tn.picks.has(e.key)), ps = zo(
1499
1506
  Ne.map((e) => {
1500
1507
  const { collection: t, id: n } = Dr(e);
1501
1508
  return { collection: t, id: n };
1502
1509
  }),
1503
1510
  Yr
1504
1511
  ), fs = Ne.map((e) => {
1505
- const { collection: t, id: n } = Dr(e), r = ya[Zo(t, n)], l = ps.get(e);
1512
+ const { collection: t, id: n } = Dr(e), r = ya[Zo(t, n)], o = ps.get(e);
1506
1513
  return {
1507
1514
  key: e,
1508
1515
  viewerIds: (r == null ? void 0 : r.ids) ?? [],
1509
1516
  viewerCount: (r == null ? void 0 : r.count) ?? 0,
1510
- lockName: l && !l.is_mine ? l.locked_by_name ?? "someone" : null
1517
+ lockName: o && !o.is_mine ? o.locked_by_name ?? "someone" : null
1511
1518
  };
1512
1519
  }).filter((e) => e.viewerCount > 0 || !!e.lockName), bs = Mc(
1513
1520
  L,
@@ -1516,7 +1523,7 @@ function Lp({
1516
1523
  ), hs = ut.filter(
1517
1524
  (e) => {
1518
1525
  var t;
1519
- return it[e] === "sum" && ((t = Pt(e)) == null ? void 0 : t.kind) === "server" && e.startsWith("extra.");
1526
+ return it[e] === "sum" && ((t = Mt(e)) == null ? void 0 : t.kind) === "server" && e.startsWith("extra.");
1520
1527
  }
1521
1528
  ), to = Bc(
1522
1529
  bs,
@@ -1526,28 +1533,28 @@ function Lp({
1526
1533
  return (n = e.extra) == null ? void 0 : n[t.slice(6)];
1527
1534
  }
1528
1535
  ), no = (e) => {
1529
- if (T === "state") return e === "No state" ? e : Ke(e);
1530
- if (T === "collection") return He(e);
1531
- if (T != null && T.startsWith("extra.") && e !== "—") {
1532
- const t = T.slice(6), n = ye(t);
1533
- return n ? rt(e, n) : ln(
1536
+ if (R === "state") return e === "No state" ? e : Pe(e);
1537
+ if (R === "collection") return He(e);
1538
+ if (R != null && R.startsWith("extra.") && e !== "—") {
1539
+ const t = R.slice(6), n = ye(t);
1540
+ return n ? rt(e, n) : cn(
1534
1541
  ((s == null ? void 0 : s.extra_field_meta) ?? []).find((r) => r.path === t),
1535
1542
  e
1536
1543
  );
1537
1544
  }
1538
1545
  return e;
1539
- }, en = uc(
1546
+ }, nn = uc(
1540
1547
  (we ?? []).map((e) => ({ ...e, rows: xe.has(e.key) ? [] : e.rows })),
1541
- S,
1548
+ k,
1542
1549
  be.rootRef,
1543
1550
  {
1544
- enabled: $ === "table" && !!T,
1551
+ enabled: C === "table" && !!R,
1545
1552
  resetKey: JSON.stringify([
1546
- o,
1553
+ l,
1547
1554
  b,
1548
1555
  U,
1549
1556
  ve,
1550
- T,
1557
+ R,
1551
1558
  [...xe],
1552
1559
  ka
1553
1560
  ])
@@ -1555,16 +1562,16 @@ function Lp({
1555
1562
  );
1556
1563
  mc(
1557
1564
  be.rootRef,
1558
- en.groups.map((e) => `§${e.key}${e.rows.map(S).join("")}`).join(""),
1565
+ nn.groups.map((e) => `§${e.key}${e.rows.map(k).join("")}`).join(""),
1559
1566
  {
1560
- enabled: $ === "table" && !!T,
1561
- resetKey: JSON.stringify([o, b, U, ve, T])
1567
+ enabled: C === "table" && !!R,
1568
+ resetKey: JSON.stringify([l, b, U, ve, R])
1562
1569
  }
1563
1570
  );
1564
- const Tn = (e) => Sa.isGone(e) || en.isGone(e), Rn = (e) => {
1565
- const t = en.movingTo(e);
1571
+ const Ln = (e) => Sa.isGone(e) || nn.isGone(e), wt = (e) => {
1572
+ const t = nn.movingTo(e);
1566
1573
  return t == null ? null : no(t);
1567
- }, ys = new Map(en.groups.map((e) => [e.key, e.rows])), wr = we ? en.groups.map(
1574
+ }, ys = new Map(nn.groups.map((e) => [e.key, e.rows])), wr = we ? nn.groups.map(
1568
1575
  (e) => e.group ?? { key: e.key, rows: [], breached: 0, atRisk: 0, count: 0, sums: {} }
1569
1576
  ) : null, gs = wr == null ? void 0 : wr.map((e) => ({
1570
1577
  key: e.key,
@@ -1621,13 +1628,13 @@ function Lp({
1621
1628
  " at risk"
1622
1629
  ] })
1623
1630
  ] })
1624
- })), _r = (((Ro = c == null ? void 0 : c.available_values.collection) == null ? void 0 : Ro.length) ?? 0) > 1, ro = L.some((e) => !!e.unseen) || Gt.size > 0 || L.some((e) => be.isNew(S(e))), ao = [
1631
+ })), _r = (((To = i == null ? void 0 : i.available_values.collection) == null ? void 0 : To.length) ?? 0) > 1, ro = L.some((e) => !!e.unseen) || It.size > 0 || L.some((e) => be.isNew(k(e))), ao = [
1625
1632
  ..._r ? [
1626
1633
  {
1627
1634
  key: "collection",
1628
1635
  header: A("collection", "Collection"),
1629
1636
  sortable: !0,
1630
- render: (e) => /* @__PURE__ */ a(Qd, { variant: "outline", children: He(e.collection) })
1637
+ render: (e) => /* @__PURE__ */ a(Ud, { variant: "outline", children: He(e.collection) })
1631
1638
  }
1632
1639
  ] : [],
1633
1640
  {
@@ -1642,17 +1649,17 @@ function Lp({
1642
1649
  // a whole, but nothing on it said so — an underline is the one
1643
1650
  // convention people already read as "this goes somewhere".
1644
1651
  /* @__PURE__ */ d("span", { className: "flex items-center gap-1.5", children: [
1645
- Gt.get(S(e)) || be.isNew(S(e)) || Tn(S(e)) || Rn(S(e)) != null ? /* @__PURE__ */ a(
1646
- Td,
1652
+ It.get(k(e)) || be.isNew(k(e)) || Ln(k(e)) || wt(k(e)) != null ? /* @__PURE__ */ a(
1653
+ Rd,
1647
1654
  {
1648
- lock: Gt.get(S(e)),
1649
- isNew: be.isNew(S(e)),
1650
- gone: Tn(S(e)),
1651
- movingTo: Rn(S(e)),
1655
+ lock: It.get(k(e)),
1656
+ isNew: be.isNew(k(e)),
1657
+ gone: Ln(k(e)),
1658
+ movingTo: wt(k(e)),
1652
1659
  dataAttr: "data-queue-live-mark",
1653
1660
  hang: !0
1654
1661
  }
1655
- ) : /* @__PURE__ */ a(jd, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1662
+ ) : /* @__PURE__ */ a(Qd, { change: e.unseen, dataAttr: "data-queue-unseen", hang: !0 }),
1656
1663
  /* @__PURE__ */ a(
1657
1664
  "span",
1658
1665
  {
@@ -1661,6 +1668,7 @@ function Lp({
1661
1668
  children: e.label
1662
1669
  }
1663
1670
  ),
1671
+ wt(k(e)) != null && /* @__PURE__ */ a(Td, { to: wt(k(e)) }),
1664
1672
  (e.labels ?? []).slice(0, 3).map((t) => /* @__PURE__ */ a(
1665
1673
  "span",
1666
1674
  {
@@ -1671,7 +1679,7 @@ function Lp({
1671
1679
  t
1672
1680
  )),
1673
1681
  /* @__PURE__ */ a(
1674
- Md,
1682
+ Bd,
1675
1683
  {
1676
1684
  viewers: ya[Zo(e.collection, e.item_id)],
1677
1685
  dataAttr: "data-queue-presence"
@@ -1693,12 +1701,12 @@ function Lp({
1693
1701
  ),
1694
1702
  style: e.state_color ? {
1695
1703
  backgroundColor: `${e.state_color}1a`,
1696
- "--nvr-state-ink": Ki(e.state_color),
1704
+ "--nvr-state-ink": Pi(e.state_color),
1697
1705
  "--nvr-state-ink-dark": e.state_color
1698
1706
  } : void 0,
1699
- title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Ke(e.state)}` : Ke(e.state),
1707
+ title: e.via_addendum ? `Addendum "${e.via_addendum.title ?? ""}" — ${Pe(e.state)}` : Pe(e.state),
1700
1708
  children: [
1701
- Ke(e.state),
1709
+ Pe(e.state),
1702
1710
  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" })
1703
1711
  ]
1704
1712
  }
@@ -1708,27 +1716,29 @@ function Lp({
1708
1716
  key: "owners",
1709
1717
  header: A("owners", "Owners"),
1710
1718
  sortable: !0,
1711
- render: (e) => /* @__PURE__ */ a(zd, { owners: e.owners })
1719
+ render: (e) => /* @__PURE__ */ a(Xd, { owners: e.owners })
1712
1720
  },
1713
1721
  {
1714
1722
  key: "aging_hours",
1715
1723
  header: A("aging_hours", "Aging"),
1716
1724
  sortable: !0,
1717
- render: (e) => _u(e.aging_hours)
1725
+ render: (e) => Nu(e.aging_hours)
1718
1726
  },
1719
1727
  {
1720
1728
  // rt8 — the step and how long it has been there, ticking on the page clock; sorts on
1721
1729
  // the server as Aging. Off unless the viewer adds it.
1722
- key: Kr,
1723
- header: A(Kr, "In step"),
1730
+ key: Pr,
1731
+ header: A(Pr, "In step"),
1724
1732
  sortable: !0,
1725
- render: (e) => /* @__PURE__ */ a(
1733
+ // A bounded box: the table sizes columns to their content, so without a max width the
1734
+ // step name ran on under the pinned State column instead of ending in "…".
1735
+ render: (e) => /* @__PURE__ */ a("div", { className: "min-w-0 max-w-[240px]", children: /* @__PURE__ */ a(
1726
1736
  gd,
1727
1737
  {
1728
- stepLabel: e.state ? Ke(e.state) : null,
1738
+ stepLabel: e.state ? Pe(e.state) : null,
1729
1739
  enteredAt: e.state_entered_at
1730
1740
  }
1731
- )
1741
+ ) })
1732
1742
  },
1733
1743
  {
1734
1744
  // When the record entered its current state — the same moment Aging
@@ -1742,7 +1752,7 @@ function Lp({
1742
1752
  key: "sla_status",
1743
1753
  header: A("sla_status", "SLA"),
1744
1754
  sortable: !0,
1745
- render: (e) => /* @__PURE__ */ a(Nu, { status: e.sla_status, warningAt: e.sla_warning_at, dueAt: e.sla_due_at })
1755
+ render: (e) => /* @__PURE__ */ a(Su, { status: e.sla_status, warningAt: e.sla_warning_at, dueAt: e.sla_due_at })
1746
1756
  },
1747
1757
  {
1748
1758
  key: "at_risk",
@@ -1761,10 +1771,10 @@ function Lp({
1761
1771
  key: "addendums",
1762
1772
  header: A("addendums", "Addendums"),
1763
1773
  sortable: !1,
1764
- render: (e) => /* @__PURE__ */ a(wu, { summary: e.addendums })
1774
+ render: (e) => /* @__PURE__ */ a(_u, { summary: e.addendums })
1765
1775
  }
1766
1776
  ] : [],
1767
- ...jt ? [
1777
+ ...Ut ? [
1768
1778
  {
1769
1779
  key: "fulfilment",
1770
1780
  header: A("fulfilment", "Shipped"),
@@ -1808,12 +1818,12 @@ function Lp({
1808
1818
  }
1809
1819
  }
1810
1820
  ] : [],
1811
- ...Qt ? [
1821
+ ...Vt ? [
1812
1822
  {
1813
1823
  key: "send_backs",
1814
1824
  header: A("send_backs", "Sent back"),
1815
1825
  sortable: !0,
1816
- render: (e) => /* @__PURE__ */ a(xu, { summary: e.send_backs })
1826
+ render: (e) => /* @__PURE__ */ a(ku, { summary: e.send_backs })
1817
1827
  }
1818
1828
  ] : []
1819
1829
  ], xs = {
@@ -1840,27 +1850,27 @@ function Lp({
1840
1850
  children: "Claim"
1841
1851
  }
1842
1852
  )
1843
- }, tn = (s == null ? void 0 : s.available_extra_fields) ?? [], wt = $i("drill.queue"), Y = wt.value, oo = (e) => wt.push([e]), Nr = O(null);
1844
- K(() => {
1853
+ }, rn = (s == null ? void 0 : s.available_extra_fields) ?? [], _t = $i("drill.queue"), Y = _t.value, oo = (e) => _t.push([e]), Nr = O(null);
1854
+ P(() => {
1845
1855
  var r;
1846
- if (!G || !o) return;
1847
- const e = `queue:${o}`, t = yr(), n = Zi(e, t);
1848
- if (((r = Nr.current) == null ? void 0 : r.queue) !== o) {
1849
- Nr.current = { queue: o, enc: n };
1856
+ if (!G || !l) return;
1857
+ const e = `queue:${l}`, t = yr(), n = Zi(e, t);
1858
+ if (((r = Nr.current) == null ? void 0 : r.queue) !== l) {
1859
+ Nr.current = { queue: l, enc: n };
1850
1860
  return;
1851
1861
  }
1852
1862
  ec(e, n === Nr.current.enc ? null : t);
1853
1863
  }, [
1854
1864
  G,
1855
- o,
1865
+ l,
1856
1866
  b,
1857
1867
  x,
1858
1868
  U,
1859
- T,
1860
- $,
1861
- Bt,
1869
+ R,
1870
+ C,
1871
+ Qt,
1862
1872
  st,
1863
- ue,
1873
+ se,
1864
1874
  fe,
1865
1875
  Y
1866
1876
  ]);
@@ -1869,11 +1879,11 @@ function Lp({
1869
1879
  filters: Object.values(x).filter(
1870
1880
  (e) => Array.isArray(e) ? e.length > 0 : String(e ?? "").trim() !== ""
1871
1881
  ).length,
1872
- page: ue
1882
+ page: se
1873
1883
  });
1874
- K(() => {
1875
- G && o && _c(lo);
1876
- }, [G, o, lo]);
1884
+ P(() => {
1885
+ G && l && _c(lo);
1886
+ }, [G, l, lo]);
1877
1887
  const vs = (e) => {
1878
1888
  var t;
1879
1889
  for (const n of (s == null ? void 0 : s.sources) ?? []) {
@@ -1922,7 +1932,7 @@ function Lp({
1922
1932
  var r;
1923
1933
  const n = (r = Cs[t]) == null ? void 0 : r.data;
1924
1934
  n && Cr.set(e, {
1925
- fields: new Map((n.fields ?? []).map((l) => [l.field, l])),
1935
+ fields: new Map((n.fields ?? []).map((o) => [o.field, o])),
1926
1936
  relations: n.relations ?? []
1927
1937
  });
1928
1938
  });
@@ -1931,11 +1941,11 @@ function Lp({
1931
1941
  queryFn: () => f.request(D("/security/my/permissions")).then((e) => e.data),
1932
1942
  enabled: Sr.enabled && !Xe,
1933
1943
  staleTime: 5 * 6e4
1934
- }), io = Ld(), co = (e, t) => {
1944
+ }), io = Od(), co = (e, t) => {
1935
1945
  if (t.includes(".")) return null;
1936
1946
  const n = Cr.get(e.collection);
1937
1947
  if (!n) return null;
1938
- const r = Gt.get(S(e));
1948
+ const r = It.get(k(e));
1939
1949
  return r && !r.is_mine ? null : Hi({
1940
1950
  config: Sr,
1941
1951
  key: t,
@@ -1945,81 +1955,81 @@ function Lp({
1945
1955
  mayUpdate: Xe || sd($s, e.collection)
1946
1956
  });
1947
1957
  }, uo = (e, t, n) => {
1948
- var r, l, i;
1949
- return n === "m2o" ? ((l = (r = e.extra_ids) == null ? void 0 : r[t]) == null ? void 0 : l[0]) ?? null : ((i = e.extra) == null ? void 0 : i[t]) ?? null;
1950
- }, Ts = (e, t, n, r, l) => {
1951
- const i = (k) => `${S(e)}|${k}`, u = [...oe].filter((k) => k.startsWith("extra.")).map((k) => k.slice(6)).filter((k) => !!co(e, k)), m = l === 0 ? null : Ji(u, t, l), h = (k) => k.collection === e.collection && k.item_id === e.item_id, R = (k) => h(k) ? n === "m2o" ? {
1952
- ...k,
1953
- extra_ids: { ...k.extra_ids ?? {}, [t]: r == null ? [] : [String(r)] }
1954
- } : { ...k, extra: { ...k.extra ?? {}, [t]: r } } : k;
1958
+ var r, o, c;
1959
+ return n === "m2o" ? ((o = (r = e.extra_ids) == null ? void 0 : r[t]) == null ? void 0 : o[0]) ?? null : ((c = e.extra) == null ? void 0 : c[t]) ?? null;
1960
+ }, Rs = (e, t, n, r, o) => {
1961
+ const c = (v) => `${k(e)}|${v}`, u = [...oe].filter((v) => v.startsWith("extra.")).map((v) => v.slice(6)).filter((v) => !!co(e, v)), m = o === 0 ? null : Ji(u, t, o), h = (v) => v.collection === e.collection && v.item_id === e.item_id, T = (v) => h(v) ? n === "m2o" ? {
1962
+ ...v,
1963
+ extra_ids: { ...v.extra_ids ?? {}, [t]: r == null ? [] : [String(r)] }
1964
+ } : { ...v, extra: { ...v.extra ?? {}, [t]: r } } : v;
1955
1965
  io.commit({
1956
- cellKey: i(t),
1966
+ cellKey: c(t),
1957
1967
  collection: e.collection,
1958
1968
  id: e.item_id,
1959
1969
  field: t,
1960
1970
  kind: n,
1961
1971
  before: uo(e, t, n),
1962
1972
  value: r,
1963
- next: m ? i(m) : null,
1973
+ next: m ? c(m) : null,
1964
1974
  optimistic: () => {
1965
- const k = y.getQueriesData({ queryKey: ["queue-items", o] });
1966
- return y.setQueriesData({ queryKey: ["queue-items", o] }, (C) => {
1967
- const v = C;
1968
- return Array.isArray(v == null ? void 0 : v.data) ? { ...v, data: v.data.map(R) } : Array.isArray(v == null ? void 0 : v.rows) ? { ...v, rows: v.rows.map(R) } : C;
1975
+ const v = y.getQueriesData({ queryKey: ["queue-items", l] });
1976
+ return y.setQueriesData({ queryKey: ["queue-items", l] }, ($) => {
1977
+ const w = $;
1978
+ return Array.isArray(w == null ? void 0 : w.data) ? { ...w, data: w.data.map(T) } : Array.isArray(w == null ? void 0 : w.rows) ? { ...w, rows: w.rows.map(T) } : $;
1969
1979
  }), () => {
1970
- for (const [C, v] of k) y.setQueryData(C, v);
1980
+ for (const [$, w] of v) y.setQueryData($, w);
1971
1981
  };
1972
1982
  },
1973
1983
  // Labels, rollups and the row's place in the queue follow the server.
1974
- onSaved: () => void y.invalidateQueries({ queryKey: ["queue-items", o] })
1984
+ onSaved: () => void y.invalidateQueries({ queryKey: ["queue-items", l] })
1975
1985
  });
1976
- }, Rs = (e, t, n) => {
1986
+ }, Ts = (e, t, n) => {
1977
1987
  const r = co(e, t);
1978
1988
  if (!r) return n;
1979
- const l = Cr.get(e.collection), i = l == null ? void 0 : l.fields.get(t);
1989
+ const o = Cr.get(e.collection), c = o == null ? void 0 : o.fields.get(t);
1980
1990
  return /* @__PURE__ */ a(
1981
- Od,
1991
+ Fd,
1982
1992
  {
1983
1993
  controller: io,
1984
- cellKey: `${S(e)}|${t}`,
1994
+ cellKey: `${k(e)}|${t}`,
1985
1995
  kind: r,
1986
1996
  value: uo(e, t, r),
1987
1997
  label: A(`extra.${t}`, Ue(t)),
1988
- choices: i ? Ii(i) : void 0,
1989
- target: r === "m2o" && l ? Wi(l.relations, e.collection, t) : null,
1998
+ choices: c ? Ii(c) : void 0,
1999
+ target: r === "m2o" && o ? Wi(o.relations, e.collection, t) : null,
1990
2000
  collection: e.collection,
1991
2001
  itemId: e.item_id,
1992
2002
  field: t,
1993
- onCommit: (u, m) => Ts(e, t, r, u, m),
2003
+ onCommit: (u, m) => Rs(e, t, r, u, m),
1994
2004
  children: n
1995
2005
  }
1996
2006
  );
1997
- }, Ls = tn.map((e) => ({
2007
+ }, Ls = rn.map((e) => ({
1998
2008
  key: `extra.${e}`,
1999
2009
  header: A(`extra.${e}`, Ue(e)),
2000
2010
  sortable: !0,
2001
- render: (t) => Rs(t, e, Os(t, e))
2011
+ render: (t) => Ts(t, e, Os(t, e))
2002
2012
  }));
2003
2013
  function Os(e, t) {
2004
2014
  var n, r;
2005
2015
  {
2006
- const l = (n = e.extra) == null ? void 0 : n[t];
2007
- if (l == null || l === "") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
2008
- const i = ye(t), u = ((s == null ? void 0 : s.extra_field_meta) ?? []).find((v) => v.path === t), m = i ? rt(String(l), i) : ln(u, String(l)), { text: h, title: R } = Ss(m), k = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], C = vs(t);
2009
- return (u == null ? void 0 : u.kind) === "relation" && u.target_collection && k.length > 0 && C.enabled && !u.aggregate ? /* @__PURE__ */ a(
2016
+ const o = (n = e.extra) == null ? void 0 : n[t];
2017
+ if (o == null || o === "") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
2018
+ const c = ye(t), u = ((s == null ? void 0 : s.extra_field_meta) ?? []).find((w) => w.path === t), m = c ? rt(String(o), c) : cn(u, String(o)), { text: h, title: T } = Ss(m), v = ((r = e.extra_ids) == null ? void 0 : r[t]) ?? [], $ = vs(t);
2019
+ return (u == null ? void 0 : u.kind) === "relation" && u.target_collection && v.length > 0 && $.enabled && !u.aggregate ? /* @__PURE__ */ a(
2010
2020
  "button",
2011
2021
  {
2012
2022
  type: "button",
2013
- onClick: (v) => {
2014
- v.stopPropagation(), oo({
2023
+ onClick: (w) => {
2024
+ w.stopPropagation(), oo({
2015
2025
  collection: u.target_collection,
2016
- itemId: k[0],
2017
- layoutId: C.layout_id,
2018
- width: C.width,
2026
+ itemId: v[0],
2027
+ layoutId: $.layout_id,
2028
+ width: $.width,
2019
2029
  title: m
2020
2030
  });
2021
2031
  },
2022
- title: R,
2032
+ title: T,
2023
2033
  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",
2024
2034
  children: h
2025
2035
  }
@@ -2027,31 +2037,31 @@ function Lp({
2027
2037
  "button",
2028
2038
  {
2029
2039
  type: "button",
2030
- onClick: (v) => {
2031
- v.stopPropagation(), Yn({ row: e, path: t, value: m });
2040
+ onClick: (w) => {
2041
+ w.stopPropagation(), Yn({ row: e, path: t, value: m });
2032
2042
  },
2033
2043
  title: "Show the rows behind this number",
2034
2044
  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",
2035
2045
  children: h
2036
2046
  }
2037
- ) : /* @__PURE__ */ a("span", { className: "block max-w-[200px] truncate text-[12px]", title: R, children: h });
2047
+ ) : /* @__PURE__ */ a("span", { className: "block max-w-[200px] truncate text-[12px]", title: T, children: h });
2038
2048
  }
2039
2049
  }
2040
- const mo = hu(p == null ? void 0 : p.formula_columns), po = [
2050
+ const mo = yu(p == null ? void 0 : p.formula_columns), po = [
2041
2051
  ..._r ? ["collection"] : [],
2042
2052
  "state",
2043
2053
  "owners",
2044
2054
  "aging_hours",
2045
2055
  "state_entered",
2046
- Kr,
2056
+ Pr,
2047
2057
  "sla_status",
2048
2058
  "at_risk",
2049
2059
  ...gt ? ["addendums"] : [],
2050
- ...jt ? ["fulfilment"] : [],
2060
+ ...Ut ? ["fulfilment"] : [],
2051
2061
  ...Me ? ["integrations"] : [],
2052
- ...Qt ? ["send_backs"] : [],
2062
+ ...Vt ? ["send_backs"] : [],
2053
2063
  ...Aa ? ["tasks"] : [],
2054
- ...tn.map((e) => `extra.${e}`),
2064
+ ...rn.map((e) => `extra.${e}`),
2055
2065
  // Formula columns (#133) were built but never offered here, so no one could show them
2056
2066
  // (found 2026-11-14 with the queue totals row).
2057
2067
  ...mo
@@ -2060,31 +2070,31 @@ function Lp({
2060
2070
  "state",
2061
2071
  "owners",
2062
2072
  ...gt ? ["addendums"] : [],
2063
- ...jt ? ["fulfilment"] : [],
2073
+ ...Ut ? ["fulfilment"] : [],
2064
2074
  ...Me ? ["integrations"] : [],
2065
- ...Qt ? ["send_backs"] : [],
2075
+ ...Vt ? ["send_backs"] : [],
2066
2076
  "aging_hours",
2067
2077
  "sla_status",
2068
2078
  "at_risk",
2069
- ...tn.slice(0, 2).map((e) => `extra.${e}`)
2070
- ], As = (p == null ? void 0 : p.default_columns) ?? null, $r = Bt ?? As, oe = new Set($r ?? Fs);
2071
- gt && !Lt.has("addendums") && oe.add("addendums"), jt && !Lt.has("fulfilment") && oe.add("fulfilment"), Me && !Lt.has("integrations") && oe.add("integrations"), Qt && !Lt.has("send_backs") && oe.add("send_backs");
2072
- for (const e of mo) Lt.has(e) || oe.add(e);
2079
+ ...rn.slice(0, 2).map((e) => `extra.${e}`)
2080
+ ], As = (p == null ? void 0 : p.default_columns) ?? null, $r = Qt ?? As, oe = new Set($r ?? Fs);
2081
+ gt && !Ft.has("addendums") && oe.add("addendums"), Ut && !Ft.has("fulfilment") && oe.add("fulfilment"), Me && !Ft.has("integrations") && oe.add("integrations"), Vt && !Ft.has("send_backs") && oe.add("send_backs");
2082
+ for (const e of mo) Ft.has(e) || oe.add(e);
2073
2083
  const qs = new Set(Xe ? [] : (p == null ? void 0 : p.admin_only_columns) ?? []);
2074
2084
  for (const e of qs) oe.delete(e);
2075
- const nn = [
2085
+ const an = [
2076
2086
  ...($r ?? []).filter((e) => po.includes(e)),
2077
2087
  ...po.filter((e) => !($r ?? []).includes(e))
2078
2088
  ], Es = Hs(Js(Ys, { activationConstraint: { distance: 4 } }));
2079
- function Ks(e) {
2089
+ function Ps(e) {
2080
2090
  const { active: t, over: n } = e;
2081
2091
  if (!n || t.id === n.id) return;
2082
- const r = nn.indexOf(String(t.id)), l = nn.indexOf(String(n.id));
2083
- r === -1 || l === -1 || xn(
2084
- ti(nn, r, l).filter((i) => oe.has(i))
2092
+ const r = an.indexOf(String(t.id)), o = an.indexOf(String(n.id));
2093
+ r === -1 || o === -1 || vn(
2094
+ ti(an, r, o).filter((c) => oe.has(c))
2085
2095
  );
2086
2096
  }
2087
- const fo = ao.find((e) => e.key === "label"), Ps = {
2097
+ const fo = ao.find((e) => e.key === "label"), Ks = {
2088
2098
  ...fo,
2089
2099
  render: (e, ...t) => /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-center gap-1.5", children: [
2090
2100
  /* @__PURE__ */ a(td, { rowId: e.item_id }),
@@ -2097,28 +2107,28 @@ function Lp({
2097
2107
  render: (t) => {
2098
2108
  const n = {
2099
2109
  ...t,
2100
- ...t.extra ? Object.fromEntries(Object.entries(t.extra).map(([i, u]) => [`extra.${i}`, u])) : {}
2101
- }, r = Pi(e.formula, (i) => {
2102
- const u = n[i] ?? (t.extra ? t.extra[i] : void 0), m = Number(u);
2110
+ ...t.extra ? Object.fromEntries(Object.entries(t.extra).map(([c, u]) => [`extra.${c}`, u])) : {}
2111
+ }, r = Ki(e.formula, (c) => {
2112
+ const u = n[c] ?? (t.extra ? t.extra[c] : void 0), m = Number(u);
2103
2113
  return Number.isFinite(m) ? m : u ?? null;
2104
2114
  });
2105
2115
  if (r == null || typeof r == "boolean") return /* @__PURE__ */ a("span", { className: "text-slate-300", children: "—" });
2106
- const l = Number(r);
2107
- return Number.isFinite(l) ? /* @__PURE__ */ a("span", { className: "tabular-nums", children: e.format === "currency" ? l.toLocaleString(void 0, { style: "currency", currency: "USD" }) : l.toLocaleString() }) : /* @__PURE__ */ a("span", { children: String(r) });
2116
+ const o = Number(r);
2117
+ 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) });
2108
2118
  }
2109
2119
  })
2110
- ), Tr = [...ao, ...Ls, ...Ds], bo = Wd(
2111
- nn,
2120
+ ), Rr = [...ao, ...Ls, ...Ds], bo = Id(
2121
+ an,
2112
2122
  (e) => {
2113
2123
  var n;
2114
- const t = (n = Tr.find((r) => r.key === e)) == null ? void 0 : n.header;
2124
+ const t = (n = Rr.find((r) => r.key === e)) == null ? void 0 : n.header;
2115
2125
  return typeof t == "string" ? t : e;
2116
2126
  },
2117
2127
  oe
2118
2128
  ), Ms = {
2119
2129
  key: "__actions__",
2120
2130
  header: "",
2121
- render: (e) => e.collection === "tasks" || e.collection === sn ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
2131
+ render: (e) => e.collection === "tasks" || e.collection === Lt ? null : /* @__PURE__ */ a("span", { onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ a(
2122
2132
  ld,
2123
2133
  {
2124
2134
  collection: e.collection,
@@ -2130,22 +2140,22 @@ function Lp({
2130
2140
  urlFor: Q.urlFor,
2131
2141
  onDeleted: () => {
2132
2142
  f.request(Er(`/items/${e.collection}/${e.item_id}`)).then(() => {
2133
- P.success("Moved to trash"), y.invalidateQueries({ queryKey: ["queue-items", o] });
2134
- }).catch((t) => P.error(St(t, "Delete failed")));
2143
+ K.success("Moved to trash"), y.invalidateQueries({ queryKey: ["queue-items", l] });
2144
+ }).catch((t) => K.error(Ct(t, "Delete failed")));
2135
2145
  },
2136
- onAfterTransition: () => void y.invalidateQueries({ queryKey: ["queue-items", o] }),
2146
+ onAfterTransition: () => void y.invalidateQueries({ queryKey: ["queue-items", l] }),
2137
2147
  bulkEnabledKeys: (p == null ? void 0 : p.bulk_action_keys) ?? null,
2138
2148
  disabled: X
2139
2149
  }
2140
2150
  ) })
2141
- }, Rr = (e) => typeof e.header == "string" ? e.header : e.key, ho = (e) => e.map((t, n) => {
2151
+ }, Tr = (e) => typeof e.header == "string" ? e.header : e.key, ho = (e) => e.map((t, n) => {
2142
2152
  const r = A(`extra.${t.field}`, Ue(t.field));
2143
2153
  return `${n === 0 ? t.sign < 0 ? "− " : "" : t.sign < 0 ? " − " : " + "}${r}`;
2144
2154
  }).join(""), Bs = (e) => {
2145
- if ($ !== "table" || pe) return e;
2146
- const t = Pt(e.key);
2155
+ if (C !== "table" || ie) return e;
2156
+ const t = Mt(e.key);
2147
2157
  if (!t) return e;
2148
- const n = (l) => pl(e.key, l), r = t.kind === "none" ? { fn: null, onChange: n, unavailable: t.why } : t.kind === "derived" ? {
2158
+ const n = (o) => pl(e.key, o), r = t.kind === "none" ? { fn: null, onChange: n, unavailable: t.why } : t.kind === "derived" ? {
2149
2159
  fn: it[e.key] === "sum" ? "sum" : null,
2150
2160
  onChange: n,
2151
2161
  only: ["sum"],
@@ -2153,37 +2163,37 @@ function Lp({
2153
2163
  } : { fn: it[e.key] ?? null, onChange: n };
2154
2164
  return {
2155
2165
  ...e,
2156
- headerMenu: /* @__PURE__ */ a(id, { label: Rr(e), selectedCount: 0, totals: r })
2166
+ headerMenu: /* @__PURE__ */ a(id, { label: Tr(e), selectedCount: 0, totals: r })
2157
2167
  };
2158
2168
  }, et = [
2159
- Ps,
2160
- ...nn.filter((e) => oe.has(e)).map((e) => Tr.find((t) => t.key === e)).filter((e) => e !== void 0).map(Bs),
2161
- ...Re ? [xs] : [],
2169
+ Ks,
2170
+ ...an.filter((e) => oe.has(e)).map((e) => Rr.find((t) => t.key === e)).filter((e) => e !== void 0).map(Bs),
2171
+ ...Te ? [xs] : [],
2162
2172
  Ms
2163
- ], yo = Ut && !!(re != null && re.totals), Ln = yo ? { ...c == null ? void 0 : c.totals, ...re == null ? void 0 : re.totals } : c == null ? void 0 : c.totals, go = yo ? (re == null ? void 0 : re.totals_partial) === !0 : (c == null ? void 0 : c.totals_partial) === !0, js = (() => {
2173
+ ], yo = Gt && !!(re != null && re.totals), On = yo ? { ...i == null ? void 0 : i.totals, ...re == null ? void 0 : re.totals } : i == null ? void 0 : i.totals, go = yo ? (re == null ? void 0 : re.totals_partial) === !0 : (i == null ? void 0 : i.totals_partial) === !0, js = (() => {
2164
2174
  var n;
2165
2175
  if (!la) return;
2166
2176
  const e = {};
2167
2177
  let t = !1;
2168
2178
  for (const r of et) {
2169
2179
  if (!ut.includes(r.key)) continue;
2170
- const l = Pt(r.key), i = it[r.key];
2171
- if (!l || l.kind === "none" || !i) continue;
2180
+ const o = Mt(r.key), c = it[r.key];
2181
+ if (!o || o.kind === "none" || !c) continue;
2172
2182
  t = !0;
2173
- const u = iu(Ln, l, i), m = r.key.startsWith("formula.") ? ((p == null ? void 0 : p.formula_columns) ?? []).find((Z) => `formula.${Z.key}` === r.key) : null, h = m ? cu(m.format) : ye(r.key.slice(6)), R = (Z) => al(Z, i, (h == null ? void 0 : h.type) === "number" ? h : null), k = { sum: "Sum", avg: "Avg", min: "Min", max: "Max", count: "Count" }[i], C = u === void 0, v = C ? void 0 : du({
2174
- fn: i,
2175
- label: Rr(r),
2176
- rows: (c == null ? void 0 : c.total) ?? null,
2177
- byCollection: l.kind === "server" ? (n = Ln == null ? void 0 : Ln[l.path]) == null ? void 0 : n.by_collection : void 0,
2183
+ const u = cu(On, o, c), m = r.key.startsWith("formula.") ? ((p == null ? void 0 : p.formula_columns) ?? []).find((Z) => `formula.${Z.key}` === r.key) : null, h = m ? du(m.format) : ye(r.key.slice(6)), T = (Z) => al(Z, c, (h == null ? void 0 : h.type) === "number" ? h : null), v = { sum: "Sum", avg: "Avg", min: "Min", max: "Max", count: "Count" }[c], $ = u === void 0, w = $ ? void 0 : uu({
2184
+ fn: c,
2185
+ label: Tr(r),
2186
+ rows: (i == null ? void 0 : i.total) ?? null,
2187
+ byCollection: o.kind === "server" ? (n = On == null ? void 0 : On[o.path]) == null ? void 0 : n.by_collection : void 0,
2178
2188
  collectionLabel: He,
2179
- format: R,
2189
+ format: T,
2180
2190
  partial: go,
2181
- derivedText: l.kind === "derived" ? ho(l.terms) : void 0
2191
+ derivedText: o.kind === "derived" ? ho(o.terms) : void 0
2182
2192
  });
2183
- e[r.key] = /* @__PURE__ */ d("span", { className: "inline-flex items-baseline gap-1.5", "data-tip": v, "data-queue-total": i, children: [
2184
- /* @__PURE__ */ a("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400 dark:text-slate-500", children: k }),
2185
- C ? /* @__PURE__ */ a(ul, { className: "inline-block h-3 w-12 align-middle" }) : /* @__PURE__ */ d("span", { className: "text-slate-700 dark:text-slate-200", children: [
2186
- u == null ? "—" : R(u),
2193
+ e[r.key] = /* @__PURE__ */ d("span", { className: "inline-flex items-baseline gap-1.5", "data-tip": w, "data-queue-total": c, children: [
2194
+ /* @__PURE__ */ a("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400 dark:text-slate-500", children: v }),
2195
+ $ ? /* @__PURE__ */ a(ul, { className: "inline-block h-3 w-12 align-middle" }) : /* @__PURE__ */ d("span", { className: "text-slate-700 dark:text-slate-200", children: [
2196
+ u == null ? "—" : T(u),
2187
2197
  go ? "*" : ""
2188
2198
  ] })
2189
2199
  ] });
@@ -2193,53 +2203,53 @@ function Lp({
2193
2203
  cells: e,
2194
2204
  label: /* @__PURE__ */ a("span", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400 dark:text-slate-500", children: "Σ totals" })
2195
2205
  };
2196
- })(), rn = () => Object.fromEntries(ut.map((e) => [e, it[e]])), xo = (e) => {
2197
- dn(e), Dn((t) => {
2206
+ })(), on = () => Object.fromEntries(ut.map((e) => [e, it[e]])), xo = (e) => {
2207
+ un(e), Mn((t) => {
2198
2208
  const n = dd(t, e);
2199
- return rl(qn(o), n), n;
2209
+ return rl(En(l), n), n;
2200
2210
  });
2201
- }, [_t, ko] = _(!1);
2211
+ }, [Nt, ko] = N(!1);
2202
2212
  async function Qs() {
2203
- if (!(!s || _t)) {
2213
+ if (!(!s || Nt)) {
2204
2214
  ko(!0);
2205
2215
  try {
2206
2216
  const t = [];
2207
2217
  for (let m = 1; t.length < 1e4; m++) {
2208
2218
  const h = await f.request(
2209
- D(`/queues/${o}/items`, {
2219
+ D(`/queues/${l}/items`, {
2210
2220
  scope: b,
2211
- sort: Pr(U),
2221
+ sort: Kr(U),
2212
2222
  filters: JSON.stringify(Le),
2213
2223
  page: m,
2214
2224
  limit: 100
2215
2225
  })
2216
- ), R = h.data ?? [];
2217
- if (t.push(...R), R.length < 100 || t.length >= (h.total ?? 0)) break;
2226
+ ), T = h.data ?? [];
2227
+ if (t.push(...T), T.length < 100 || t.length >= (h.total ?? 0)) break;
2218
2228
  }
2219
- const n = (m) => (s.extra_field_meta ?? []).find((h) => h.path === m), r = fu(
2229
+ const n = (m) => (s.extra_field_meta ?? []).find((h) => h.path === m), r = bu(
2220
2230
  t.slice(0, 1e4),
2221
2231
  et.map((m) => ({
2222
2232
  key: m.key,
2223
2233
  header: typeof m.header == "string" ? m.header : m.key === "label" ? "Item" : ""
2224
2234
  })),
2225
2235
  {
2226
- stateLabel: Ke,
2236
+ stateLabel: Pe,
2227
2237
  collectionLabel: He,
2228
2238
  extraText: (m, h) => {
2229
- const R = ye(m);
2230
- return R && R.type !== "number" ? rt(h, R) : ln(n(m), h);
2239
+ const T = ye(m);
2240
+ return T && T.type !== "number" ? rt(h, T) : cn(n(m), h);
2231
2241
  },
2232
2242
  extraIsNumber: (m) => {
2233
2243
  var h;
2234
2244
  return ((h = ye(m)) == null ? void 0 : h.type) === "number";
2235
2245
  }
2236
2246
  }
2237
- ), l = new Blob([r], { type: "text/csv;charset=utf-8" }), i = URL.createObjectURL(l), u = document.createElement("a");
2238
- u.href = i, u.download = bu(s.name), document.body.appendChild(u), u.click(), u.remove(), setTimeout(() => URL.revokeObjectURL(i), 1e3), P.success(
2247
+ ), o = new Blob([r], { type: "text/csv;charset=utf-8" }), c = URL.createObjectURL(o), u = document.createElement("a");
2248
+ u.href = c, u.download = hu(s.name), document.body.appendChild(u), u.click(), u.remove(), setTimeout(() => URL.revokeObjectURL(c), 1e3), K.success(
2239
2249
  t.length >= 1e4 ? `Exported the first ${1e4.toLocaleString("en-US")} rows` : `Exported ${t.length.toLocaleString("en-US")} ${t.length === 1 ? "row" : "rows"}`
2240
2250
  );
2241
2251
  } catch (e) {
2242
- P.error(St(e, "Could not export this worklist"));
2252
+ K.error(Ct(e, "Could not export this worklist"));
2243
2253
  } finally {
2244
2254
  ko(!1);
2245
2255
  }
@@ -2247,8 +2257,8 @@ function Lp({
2247
2257
  }
2248
2258
  const vo = W(() => {
2249
2259
  var r;
2250
- const e = p == null ? void 0 : p.default_pins, t = st ?? (e && Object.keys(e).length > 0 ? e : { [((r = et[0]) == null ? void 0 : r.key) ?? "label"]: "left" }), n = new Set(et.map((l) => l.key));
2251
- return Object.fromEntries(Object.entries(t).filter(([l]) => n.has(l)));
2260
+ const e = p == null ? void 0 : p.default_pins, t = st ?? (e && Object.keys(e).length > 0 ? e : { [((r = et[0]) == null ? void 0 : r.key) ?? "label"]: "left" }), n = new Set(et.map((o) => o.key));
2261
+ return Object.fromEntries(Object.entries(t).filter(([o]) => n.has(o)));
2252
2262
  }, [st, p == null ? void 0 : p.default_pins, et.map((e) => e.key).join("|")]), wo = [
2253
2263
  { value: "state", label: "State" },
2254
2264
  { value: "collection", label: "Collection" },
@@ -2256,7 +2266,7 @@ function Lp({
2256
2266
  { value: "at_risk", label: "At risk" },
2257
2267
  { value: "owners", label: "Owner" },
2258
2268
  { value: "aging", label: "Aging" },
2259
- ...tn.filter((e) => oe.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: A(`extra.${e}`, Ue(e)) }))
2269
+ ...rn.filter((e) => oe.has(`extra.${e}`)).map((e) => ({ value: `extra.${e}`, label: A(`extra.${e}`, Ue(e)) }))
2260
2270
  ], _o = (e) => async (t, n) => {
2261
2271
  if (!e.target_collection || !e.display_field) return [];
2262
2272
  const r = {
@@ -2264,13 +2274,13 @@ function Lp({
2264
2274
  sort: e.display_field,
2265
2275
  // Records hidden from pickers (a retired zone) are not offered.
2266
2276
  picker: "1"
2267
- }, l = (n == null ? void 0 : n.narrowBy) ?? [], i = [];
2268
- for (const [Se, ce] of Object.entries(Te)) {
2269
- if (Se === e.path || ce.length === 0) continue;
2270
- const te = On.get(Se);
2271
- !(te != null && te.target_collection) || !te.display_field || l.some((Fn) => Fn.collection === te.target_collection) || i.push({ collection: te.target_collection, field: te.display_field, values: ce });
2277
+ }, o = (n == null ? void 0 : n.narrowBy) ?? [], c = [];
2278
+ for (const [Se, ue] of Object.entries(Re)) {
2279
+ if (Se === e.path || ue.length === 0) continue;
2280
+ const te = Fn.get(Se);
2281
+ !(te != null && te.target_collection) || !te.display_field || o.some((An) => An.collection === te.target_collection) || c.push({ collection: te.target_collection, field: te.display_field, values: ue });
2272
2282
  }
2273
- const u = [...l, ...i], m = u.length ? Oc(
2283
+ const u = [...o, ...c], m = u.length ? Oc(
2274
2284
  e.target_collection,
2275
2285
  await Fc(f, y, e.target_collection),
2276
2286
  u
@@ -2279,23 +2289,23 @@ function Lp({
2279
2289
  ...m ? [m] : []
2280
2290
  ];
2281
2291
  h.length > 0 && (r.filter = JSON.stringify(h.length === 1 ? h[0] : { _and: h }));
2282
- const k = (await f.request(
2292
+ const v = (await f.request(
2283
2293
  D(`/items/${e.target_collection}`, r)
2284
- )).data ?? [], C = ye(e.path), v = Te[e.path] ? new Set(Te[e.path]) : null, Z = /* @__PURE__ */ new Set(), ie = [];
2285
- for (const Se of k) {
2286
- const ce = Se[e.display_field];
2287
- if (ce == null || ce === "") continue;
2288
- const te = String(ce);
2289
- Z.has(te) || v && !v.has(te) || (Z.add(te), ie.push({ label: C ? rt(te, C) : te, value: te }));
2294
+ )).data ?? [], $ = ye(e.path), w = Re[e.path] ? new Set(Re[e.path]) : null, Z = /* @__PURE__ */ new Set(), de = [];
2295
+ for (const Se of v) {
2296
+ const ue = Se[e.display_field];
2297
+ if (ue == null || ue === "") continue;
2298
+ const te = String(ue);
2299
+ Z.has(te) || w && !w.has(te) || (Z.add(te), de.push({ label: $ ? rt(te, $) : te, value: te }));
2290
2300
  }
2291
- return ie;
2292
- }, On = new Map(((s == null ? void 0 : s.extra_field_meta) ?? []).map((e) => [e.path, e])), tt = [
2301
+ return de;
2302
+ }, Fn = new Map(((s == null ? void 0 : s.extra_field_meta) ?? []).map((e) => [e.path, e])), tt = [
2293
2303
  {
2294
2304
  key: "collection",
2295
2305
  placeholder: A("collection", "Collection"),
2296
2306
  type: "combobox",
2297
2307
  multi: !0,
2298
- options: ((c == null ? void 0 : c.available_values.collection) ?? []).map((e) => ({
2308
+ options: ((i == null ? void 0 : i.available_values.collection) ?? []).map((e) => ({
2299
2309
  label: He(e),
2300
2310
  value: e
2301
2311
  }))
@@ -2308,11 +2318,11 @@ function Lp({
2308
2318
  // Until the rows land, the pipeline's own states (no counts yet) rather
2309
2319
  // than an empty list.
2310
2320
  options: Ma(
2311
- c ? c.available_values.state ?? [] : Object.keys(Be)
2321
+ i ? i.available_values.state ?? [] : Object.keys(Be)
2312
2322
  ).map((e) => {
2313
2323
  var t;
2314
2324
  return {
2315
- label: Ke(e),
2325
+ label: Pe(e),
2316
2326
  value: e,
2317
2327
  // How many rows sit in it under the other active filters (the State
2318
2328
  // filter itself left out, or every other state would read 0).
@@ -2374,7 +2384,7 @@ function Lp({
2374
2384
  options: vd.map((e) => ({ label: e.label, value: e.value }))
2375
2385
  }
2376
2386
  ] : [],
2377
- ...jt ? [
2387
+ ...Ut ? [
2378
2388
  {
2379
2389
  key: "fulfilment",
2380
2390
  placeholder: "Shipped",
@@ -2382,7 +2392,7 @@ function Lp({
2382
2392
  options: yd
2383
2393
  }
2384
2394
  ] : [],
2385
- ...Qt ? [
2395
+ ...Vt ? [
2386
2396
  {
2387
2397
  key: "send_backs",
2388
2398
  placeholder: "Sent back",
@@ -2409,7 +2419,7 @@ function Lp({
2409
2419
  type: "combobox",
2410
2420
  multi: !0,
2411
2421
  loadOptions: async (e) => ((await f.request(
2412
- D(`/queues/${o}/label-suggest`, e.trim() ? { q: e.trim() } : {})
2422
+ D(`/queues/${l}/label-suggest`, e.trim() ? { q: e.trim() } : {})
2413
2423
  )).data ?? []).map((n) => ({ label: n, value: n }))
2414
2424
  },
2415
2425
  {
@@ -2417,43 +2427,43 @@ function Lp({
2417
2427
  placeholder: A("owners", "Owners"),
2418
2428
  type: "combobox",
2419
2429
  multi: !0,
2420
- options: ((c == null ? void 0 : c.available_values.owners) ?? []).map((e) => ({
2430
+ options: ((i == null ? void 0 : i.available_values.owners) ?? []).map((e) => ({
2421
2431
  // "Nisha Uprety (suspended)" / "Redacted Redacted (former user) · 2" (army 11 Q1-3).
2422
2432
  label: e.label ?? e.name,
2423
2433
  value: e.id
2424
2434
  }))
2425
2435
  },
2426
- ...tn.map((e) => {
2436
+ ...rn.map((e) => {
2427
2437
  var u, m, h;
2428
- const t = On.get(e), n = A(`extra.${e}`, Ue(e)), r = { key: `extra.${e}`, placeholder: n }, l = ye(e);
2429
- if ((l == null ? void 0 : l.type) === "datetime") return { ...r, type: "date" };
2430
- if ((l == null ? void 0 : l.type) === "number") return { ...r, type: "number" };
2431
- if ((l == null ? void 0 : l.type) === "boolean")
2438
+ const t = Fn.get(e), n = A(`extra.${e}`, Ue(e)), r = { key: `extra.${e}`, placeholder: n }, o = ye(e);
2439
+ if ((o == null ? void 0 : o.type) === "datetime") return { ...r, type: "date" };
2440
+ if ((o == null ? void 0 : o.type) === "number") return { ...r, type: "number" };
2441
+ if ((o == null ? void 0 : o.type) === "boolean")
2432
2442
  return {
2433
2443
  ...r,
2434
2444
  type: "select",
2435
2445
  options: [
2436
- { label: l.true_label ?? "Yes", value: "bool:true" },
2437
- { label: l.false_label ?? "No", value: "bool:false" }
2446
+ { label: o.true_label ?? "Yes", value: "bool:true" },
2447
+ { label: o.false_label ?? "No", value: "bool:false" }
2438
2448
  ]
2439
2449
  };
2440
- const i = (u = c == null ? void 0 : c.available_values.extra) == null ? void 0 : u[e];
2441
- return i != null && i.length ? {
2450
+ const c = (u = i == null ? void 0 : i.available_values.extra) == null ? void 0 : u[e];
2451
+ return c != null && c.length ? {
2442
2452
  ...r,
2443
2453
  type: "combobox",
2444
2454
  multi: !0,
2445
2455
  // The "your access" mark follows the person's restriction on every tab,
2446
2456
  // not only on an empty one (army 11 Q2-1).
2447
- restricted: !!((m = Te[e]) != null && m.length),
2448
- options: i.map((R) => ({
2449
- label: l ? rt(R, l) : ln(t, R),
2450
- value: R
2457
+ restricted: !!((m = Re[e]) != null && m.length),
2458
+ options: c.map((T) => ({
2459
+ label: o ? rt(T, o) : cn(t, T),
2460
+ value: T
2451
2461
  }))
2452
2462
  } : (t == null ? void 0 : t.kind) === "relation" ? {
2453
2463
  ...r,
2454
2464
  type: "combobox",
2455
2465
  multi: !0,
2456
- restricted: !!((h = Te[e]) != null && h.length),
2466
+ restricted: !!((h = Re[e]) != null && h.length),
2457
2467
  loadOptions: _o(t)
2458
2468
  } : { ...r, placeholder: `Search ${n}…`, type: "text" };
2459
2469
  })
@@ -2465,93 +2475,93 @@ function Lp({
2465
2475
  }, Fr = (() => {
2466
2476
  var n, r;
2467
2477
  const e = [];
2468
- for (const [l, i] of Object.entries(ve)) {
2469
- if (!i || Array.isArray(i) && i.length === 0) continue;
2470
- const u = tt.find((k) => k.key === l), m = l.startsWith("extra.") ? l.slice(6) : null, h = m ? ye(m) : null, R = Di({
2471
- field: Or(l),
2478
+ for (const [o, c] of Object.entries(ve)) {
2479
+ if (!c || Array.isArray(c) && c.length === 0) continue;
2480
+ const u = tt.find((v) => v.key === o), m = o.startsWith("extra.") ? o.slice(6) : null, h = m ? ye(m) : null, T = Di({
2481
+ field: Or(o),
2472
2482
  type: (u == null ? void 0 : u.type) ?? "select",
2473
- value: i,
2474
- optionLabel: (k) => {
2475
- var C, v;
2476
- return (v = (C = u == null ? void 0 : u.options) == null ? void 0 : C.find((Z) => Z.value === k)) == null ? void 0 : v.label;
2483
+ value: c,
2484
+ optionLabel: (v) => {
2485
+ var $, w;
2486
+ return (w = ($ = u == null ? void 0 : u.options) == null ? void 0 : $.find((Z) => Z.value === v)) == null ? void 0 : w.label;
2477
2487
  },
2478
2488
  currency: (h == null ? void 0 : h.type) === "number" && h.prefix === "$",
2479
2489
  rangeUnit: u == null ? void 0 : u.range_unit
2480
2490
  });
2481
- R && e.push(R);
2491
+ T && e.push(T);
2482
2492
  }
2483
- const t = c == null ? void 0 : c.total;
2493
+ const t = i == null ? void 0 : i.total;
2484
2494
  return Mi({
2485
2495
  noun: "items",
2486
2496
  scope: b === "mine" ? "you own" : b === "unowned" ? "with no owners" : b === "claimed" ? "you claimed" : null,
2487
- viewName: ((r = (n = E == null ? void 0 : E.data) == null ? void 0 : n.find((l) => l.id === fe)) == null ? void 0 : r.name) ?? null,
2497
+ viewName: ((r = (n = E == null ? void 0 : E.data) == null ? void 0 : n.find((o) => o.id === fe)) == null ? void 0 : r.name) ?? null,
2488
2498
  clauses: e,
2489
2499
  shown: typeof t == "number" ? t : null,
2490
2500
  of: (g == null ? void 0 : g.total) ?? null
2491
2501
  });
2492
- })(), an = new Set(Object.keys(ke.current)), Us = ((e) => {
2502
+ })(), ln = new Set(Object.keys(ke.current)), Us = ((e) => {
2493
2503
  var n;
2494
2504
  if (e.some((r) => r.key === "state")) return e;
2495
2505
  const t = tt.find((r) => r.key === "state");
2496
- return !t || c && !((n = c.available_values.state) != null && n.length) ? e : [...e, t];
2506
+ return !t || i && !((n = i.available_values.state) != null && n.length) ? e : [...e, t];
2497
2507
  })(
2498
2508
  (() => {
2499
- var l;
2500
- const e = (i) => {
2501
- var Z, ie, Se;
2502
- if (!i.key.startsWith("extra.")) return null;
2503
- if (i.type === "combobox") return i;
2504
- const u = i.key.slice(6), m = On.get(u), h = an.has(i.key);
2509
+ var o;
2510
+ const e = (c) => {
2511
+ var Z, de, Se;
2512
+ if (!c.key.startsWith("extra.")) return null;
2513
+ if (c.type === "combobox") return c;
2514
+ const u = c.key.slice(6), m = Fn.get(u), h = ln.has(c.key);
2505
2515
  if ((m == null ? void 0 : m.kind) !== "relation" && !h) return null;
2506
- const R = ye(u), k = (Z = c == null ? void 0 : c.available_values.extra) == null ? void 0 : Z[u], C = i.placeholder.replace(/^Search (.*)…$/, "$1"), v = (m == null ? void 0 : m.kind) === "relation" && m.target_collection && m.display_field ? { collection: m.target_collection, field: m.display_field } : void 0;
2507
- return k != null && k.length ? {
2508
- key: i.key,
2509
- placeholder: C,
2516
+ const T = ye(u), v = (Z = i == null ? void 0 : i.available_values.extra) == null ? void 0 : Z[u], $ = c.placeholder.replace(/^Search (.*)…$/, "$1"), w = (m == null ? void 0 : m.kind) === "relation" && m.target_collection && m.display_field ? { collection: m.target_collection, field: m.display_field } : void 0;
2517
+ return v != null && v.length ? {
2518
+ key: c.key,
2519
+ placeholder: $,
2510
2520
  type: "combobox",
2511
2521
  multi: !0,
2512
- cascade: v,
2513
- restricted: !!((ie = Te[u]) != null && ie.length),
2514
- options: k.map((ce) => ({
2515
- label: R && R.type !== "number" ? rt(ce, R) : ln(m, ce),
2516
- value: ce
2522
+ cascade: w,
2523
+ restricted: !!((de = Re[u]) != null && de.length),
2524
+ options: v.map((ue) => ({
2525
+ label: T && T.type !== "number" ? rt(ue, T) : cn(m, ue),
2526
+ value: ue
2517
2527
  }))
2518
2528
  } : (m == null ? void 0 : m.kind) === "relation" ? {
2519
- key: i.key,
2520
- placeholder: C,
2529
+ key: c.key,
2530
+ placeholder: $,
2521
2531
  type: "combobox",
2522
2532
  multi: !0,
2523
- cascade: v,
2524
- restricted: !!((Se = Te[u]) != null && Se.length),
2533
+ cascade: w,
2534
+ restricted: !!((Se = Re[u]) != null && Se.length),
2525
2535
  loadOptions: _o(m)
2526
2536
  } : null;
2527
2537
  };
2528
2538
  if (ra.length > 0) {
2529
- const i = [], u = /* @__PURE__ */ new Set();
2539
+ const c = [], u = /* @__PURE__ */ new Set();
2530
2540
  for (const m of ra) {
2531
2541
  const h = (m.path ?? []).join(".");
2532
- let R;
2533
- if (m.key === "state" || /(^|_)state$/.test(((l = m.path) == null ? void 0 : l[0]) ?? ""))
2534
- R = tt.find((k) => k.key === "state");
2542
+ let T;
2543
+ if (m.key === "state" || /(^|_)state$/.test(((o = m.path) == null ? void 0 : o[0]) ?? ""))
2544
+ T = tt.find((v) => v.key === "state");
2535
2545
  else {
2536
- const k = tt.filter((v) => {
2537
- var ie;
2538
- if (!v.key.startsWith("extra.") || u.has(v.key)) return !1;
2539
- const Z = v.key.slice(6);
2540
- return ((ie = On.get(Z)) == null ? void 0 : ie.target_collection) === m.collection;
2541
- }), C = k.find((v) => v.key.slice(6).startsWith(`${h}.`)) ?? k[0];
2542
- R = C ? e(C) : null;
2546
+ const v = tt.filter((w) => {
2547
+ var de;
2548
+ if (!w.key.startsWith("extra.") || u.has(w.key)) return !1;
2549
+ const Z = w.key.slice(6);
2550
+ return ((de = Fn.get(Z)) == null ? void 0 : de.target_collection) === m.collection;
2551
+ }), $ = v.find((w) => w.key.slice(6).startsWith(`${h}.`)) ?? v[0];
2552
+ T = $ ? e($) : null;
2543
2553
  }
2544
- !R || u.has(R.key) || (u.add(R.key), i.push(m.label ? { ...R, placeholder: m.label } : R));
2554
+ !T || u.has(T.key) || (u.add(T.key), c.push(m.label ? { ...T, placeholder: m.label } : T));
2545
2555
  }
2546
2556
  for (const m of tt.map(e))
2547
- m && !u.has(m.key) && (an.has(m.key) || m.restricted) && i.push(m);
2548
- if (i.length > 0) return i;
2557
+ m && !u.has(m.key) && (ln.has(m.key) || m.restricted) && c.push(m);
2558
+ if (c.length > 0) return c;
2549
2559
  }
2550
- const t = Lr.map(e).filter((i) => i !== null), r = [
2551
- ...t.filter((i) => an.has(i.key) || i.restricted),
2552
- ...t.filter((i) => !an.has(i.key) && !i.restricted)
2560
+ const t = Lr.map(e).filter((c) => c !== null), r = [
2561
+ ...t.filter((c) => ln.has(c.key) || c.restricted),
2562
+ ...t.filter((c) => !ln.has(c.key) && !c.restricted)
2553
2563
  ].slice(0, 6);
2554
- return r.length > 0 ? r : Lr.filter((i) => i.key === "state" || i.key === "owners");
2564
+ return r.length > 0 ? r : Lr.filter((c) => c.key === "state" || c.key === "owners");
2555
2565
  })()
2556
2566
  ), Vs = (g == null ? void 0 : g.sla_tracked) !== 0 || x.sla_status === "warning" || x.sla_status === "breached", Gs = (() => {
2557
2567
  if (!g) return null;
@@ -2587,7 +2597,7 @@ function Lp({
2587
2597
  tone: "text-slate-600 dark:text-slate-300",
2588
2598
  on: b === "unowned",
2589
2599
  toggle: () => {
2590
- de(b === "unowned" ? "all" : "unowned"), j(1);
2600
+ me(b === "unowned" ? "all" : "unowned"), j(1);
2591
2601
  }
2592
2602
  }
2593
2603
  ].filter((n) => n.n > 0 || n.on);
@@ -2617,9 +2627,9 @@ function Lp({
2617
2627
  n.key
2618
2628
  )),
2619
2629
  /* @__PURE__ */ d("span", { className: "tabular-nums", "data-queue-summary-total": !0, children: [
2620
- ((c == null ? void 0 : c.total) ?? e.total).toLocaleString(),
2630
+ ((i == null ? void 0 : i.total) ?? e.total).toLocaleString(),
2621
2631
  " item",
2622
- ((c == null ? void 0 : c.total) ?? e.total) === 1 ? "" : "s"
2632
+ ((i == null ? void 0 : i.total) ?? e.total) === 1 ? "" : "s"
2623
2633
  ] })
2624
2634
  ]
2625
2635
  }
@@ -2630,11 +2640,11 @@ function Lp({
2630
2640
  t.has(e) ? (t.delete(e), (e === "addendums" || e === "integrations") && Gr((n) => new Set(n).add(e))) : (t.add(e), (e === "addendums" || e === "integrations") && Gr((n) => {
2631
2641
  const r = new Set(n);
2632
2642
  return r.delete(e), r;
2633
- })), xn([...t]);
2643
+ })), vn([...t]);
2634
2644
  }
2635
- return pn ? (q == null ? void 0 : q((pn == null ? void 0 : pn.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
2645
+ return bn ? (q == null ? void 0 : q((bn == null ? void 0 : bn.status) ?? 500)) ?? null : /* @__PURE__ */ d("div", { className: "flex flex-1 min-h-0 flex-col", children: [
2636
2646
  /* @__PURE__ */ d("div", { className: "shrink-0", children: [
2637
- (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: [
2647
+ (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: [
2638
2648
  /* @__PURE__ */ a(oi, { className: "h-4 w-4 shrink-0" }),
2639
2649
  /* @__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." })
2640
2650
  ] }),
@@ -2644,13 +2654,13 @@ function Lp({
2644
2654
  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",
2645
2655
  "data-queue-toolbar": !0,
2646
2656
  children: [
2647
- G ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: Qr.filter((e) => Re || e.value !== "claimed").map(
2657
+ G ? /* @__PURE__ */ a("div", { className: "flex overflow-hidden rounded-md border border-slate-200 dark:border-border", children: Qr.filter((e) => Te || e.value !== "claimed").map(
2648
2658
  (e, t) => /* @__PURE__ */ a(
2649
2659
  "button",
2650
2660
  {
2651
2661
  type: "button",
2652
2662
  onClick: () => {
2653
- de(e.value), j(1);
2663
+ me(e.value), j(1);
2654
2664
  },
2655
2665
  className: F(
2656
2666
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
@@ -2676,7 +2686,7 @@ function Lp({
2676
2686
  className: F(
2677
2687
  "flex h-8 items-center px-3 text-[12px] font-medium transition-colors",
2678
2688
  t > 0 && "border-l border-slate-200 dark:border-border",
2679
- $ === 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"
2689
+ 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"
2680
2690
  ),
2681
2691
  children: e.label
2682
2692
  },
@@ -2684,27 +2694,27 @@ function Lp({
2684
2694
  )) })
2685
2695
  ) : /* @__PURE__ */ a("div", { className: "h-8 w-40 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
2686
2696
  /* @__PURE__ */ a(Kd, { className: "h-8" }),
2687
- Mn > 0 && !Et.label && /* @__PURE__ */ d(
2697
+ Bn > 0 && !Kt.label && /* @__PURE__ */ d(
2688
2698
  "button",
2689
2699
  {
2690
2700
  type: "button",
2691
- onClick: Ta,
2701
+ onClick: Ra,
2692
2702
  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",
2693
2703
  children: [
2694
2704
  /* @__PURE__ */ a(li, { className: "h-3 w-3" }),
2695
- Mn,
2705
+ Bn,
2696
2706
  " update",
2697
- Mn === 1 ? "" : "s",
2707
+ Bn === 1 ? "" : "s",
2698
2708
  " · Refresh"
2699
2709
  ]
2700
2710
  }
2701
2711
  ),
2702
2712
  /* @__PURE__ */ a(
2703
- Fd,
2713
+ Ad,
2704
2714
  {
2705
2715
  leadMinWidth: "siblings",
2706
2716
  moreLabel: "More queue actions",
2707
- lead: !H && $ === "workload" ? /* @__PURE__ */ a(ll, { kind: "queue", id: o }) : void 0,
2717
+ lead: !H && C === "workload" ? /* @__PURE__ */ a(ll, { kind: "queue", id: l }) : void 0,
2708
2718
  items: [
2709
2719
  {
2710
2720
  key: "unseen",
@@ -2775,63 +2785,63 @@ function Lp({
2775
2785
  }
2776
2786
  ] : [],
2777
2787
  { key: "focus", priority: 30, label: "Focus mode", node: /* @__PURE__ */ a(bd, {}) },
2778
- ...(ct || N) && o ? [
2788
+ ...(ct || S) && l ? [
2779
2789
  {
2780
2790
  key: "live-pause",
2781
- priority: Pe.paused ? 90 : 45,
2782
- active: Pe.paused,
2791
+ priority: Ke.paused ? 90 : 45,
2792
+ active: Ke.paused,
2783
2793
  node: /* @__PURE__ */ a(
2784
2794
  Cd,
2785
2795
  {
2786
- paused: Pe.paused,
2787
- held: Pe.held,
2788
- onToggle: Pe.toggle
2796
+ paused: Ke.paused,
2797
+ held: Ke.held,
2798
+ onToggle: Ke.toggle
2789
2799
  }
2790
2800
  )
2791
2801
  }
2792
2802
  ] : [],
2793
- ...$ === "table" ? [
2803
+ ...C === "table" ? [
2794
2804
  {
2795
2805
  key: "group",
2796
- priority: T ? 80 : 52,
2797
- active: !!T,
2798
- node: /* @__PURE__ */ d(Ct, { children: [
2799
- /* @__PURE__ */ a($t, { asChild: !0, children: /* @__PURE__ */ d(
2806
+ priority: R ? 80 : 52,
2807
+ active: !!R,
2808
+ node: /* @__PURE__ */ d($t, { children: [
2809
+ /* @__PURE__ */ a(Rt, { asChild: !0, children: /* @__PURE__ */ d(
2800
2810
  "button",
2801
2811
  {
2802
2812
  type: "button",
2803
2813
  className: F(
2804
2814
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2805
- T ? "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"
2815
+ R ? "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"
2806
2816
  ),
2807
2817
  children: [
2808
2818
  /* @__PURE__ */ a(ii, { className: "h-3.5 w-3.5" }),
2809
- T ? `Group: ${((Ao = wo.find((e) => e.value === T)) == null ? void 0 : Ao.label) ?? T}` : "Group"
2819
+ R ? `Group: ${((Ao = wo.find((e) => e.value === R)) == null ? void 0 : Ao.label) ?? R}` : "Group"
2810
2820
  ]
2811
2821
  }
2812
2822
  ) }),
2813
2823
  /* @__PURE__ */ a(Tt, { className: "w-[200px] p-0", align: "start", children: /* @__PURE__ */ d(sl, { children: [
2814
- /* @__PURE__ */ a(Ud, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2824
+ /* @__PURE__ */ a(Vd, { placeholder: "Group by…", className: "h-8 text-[12px]" }),
2815
2825
  /* @__PURE__ */ d(il, { children: [
2816
- /* @__PURE__ */ a(Vd, { children: "No attribute found." }),
2817
- /* @__PURE__ */ d(on, { value: "__none__", onSelect: () => Ot(null), children: [
2826
+ /* @__PURE__ */ a(Gd, { children: "No attribute found." }),
2827
+ /* @__PURE__ */ d(sn, { value: "__none__", onSelect: () => At(null), children: [
2818
2828
  /* @__PURE__ */ a(
2819
2829
  qr,
2820
2830
  {
2821
2831
  "aria-hidden": !0,
2822
2832
  className: F(
2823
2833
  "h-3.5 w-3.5 shrink-0 text-[#007a99] dark:text-nvr-cyan",
2824
- T && "invisible"
2834
+ R && "invisible"
2825
2835
  )
2826
2836
  }
2827
2837
  ),
2828
2838
  "No grouping"
2829
2839
  ] }),
2830
2840
  wo.map((e) => /* @__PURE__ */ d(
2831
- on,
2841
+ sn,
2832
2842
  {
2833
2843
  value: e.label,
2834
- onSelect: () => Ot(e.value),
2844
+ onSelect: () => At(e.value),
2835
2845
  children: [
2836
2846
  /* @__PURE__ */ a(
2837
2847
  qr,
@@ -2839,7 +2849,7 @@ function Lp({
2839
2849
  "aria-hidden": !0,
2840
2850
  className: F(
2841
2851
  "h-3.5 w-3.5 shrink-0 text-[#007a99] dark:text-nvr-cyan",
2842
- T !== e.value && "invisible"
2852
+ R !== e.value && "invisible"
2843
2853
  )
2844
2854
  }
2845
2855
  ),
@@ -2853,7 +2863,7 @@ function Lp({
2853
2863
  ] })
2854
2864
  }
2855
2865
  ] : [],
2856
- ...$ === "table" ? [
2866
+ ...C === "table" ? [
2857
2867
  {
2858
2868
  key: "priority",
2859
2869
  priority: U === "-priority" ? 80 : 50,
@@ -2878,7 +2888,7 @@ function Lp({
2878
2888
  )
2879
2889
  }
2880
2890
  ] : [],
2881
- ...$ === "table" && T && we ? [
2891
+ ...C === "table" && R && we ? [
2882
2892
  {
2883
2893
  key: "expand",
2884
2894
  priority: 40,
@@ -2886,7 +2896,7 @@ function Lp({
2886
2896
  "button",
2887
2897
  {
2888
2898
  type: "button",
2889
- onClick: () => En(
2899
+ onClick: () => Pn(
2890
2900
  xe.size > 0 ? /* @__PURE__ */ new Set() : new Set(we.map((e) => e.key))
2891
2901
  ),
2892
2902
  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",
@@ -2895,36 +2905,36 @@ function Lp({
2895
2905
  )
2896
2906
  }
2897
2907
  ] : [],
2898
- ...$ === "kanban" ? [
2908
+ ...C === "kanban" ? [
2899
2909
  {
2900
2910
  key: "lanes",
2901
2911
  priority: 60,
2902
- node: /* @__PURE__ */ d(Ct, { children: [
2903
- /* @__PURE__ */ a($t, { asChild: !0, children: /* @__PURE__ */ d(
2912
+ node: /* @__PURE__ */ d($t, { children: [
2913
+ /* @__PURE__ */ a(Rt, { asChild: !0, children: /* @__PURE__ */ d(
2904
2914
  "button",
2905
2915
  {
2906
2916
  type: "button",
2907
2917
  className: F(
2908
2918
  "flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium",
2909
- Ft ? "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"
2919
+ qt ? "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"
2910
2920
  ),
2911
2921
  children: [
2912
2922
  /* @__PURE__ */ a(di, { className: "h-3.5 w-3.5" }),
2913
- Ft ? `Lanes: ${Ft === "collection" ? "Collection" : "Owner"}` : "Lanes"
2923
+ qt ? `Lanes: ${qt === "collection" ? "Collection" : "Owner"}` : "Lanes"
2914
2924
  ]
2915
2925
  }
2916
2926
  ) }),
2917
2927
  /* @__PURE__ */ a(Tt, { className: "w-[180px] p-0", align: "start", children: /* @__PURE__ */ a(sl, { children: /* @__PURE__ */ d(il, { children: [
2918
- /* @__PURE__ */ a(on, { value: "none", onSelect: () => Kn(null), children: "None" }),
2928
+ /* @__PURE__ */ a(sn, { value: "none", onSelect: () => Kn(null), children: "None" }),
2919
2929
  /* @__PURE__ */ a(
2920
- on,
2930
+ sn,
2921
2931
  {
2922
2932
  value: "collection",
2923
2933
  onSelect: () => Kn("collection"),
2924
2934
  children: "Collection"
2925
2935
  }
2926
2936
  ),
2927
- /* @__PURE__ */ a(on, { value: "owner", onSelect: () => Kn("owners"), children: "Owner" })
2937
+ /* @__PURE__ */ a(sn, { value: "owner", onSelect: () => Kn("owners"), children: "Owner" })
2928
2938
  ] }) }) })
2929
2939
  ] })
2930
2940
  }
@@ -2953,19 +2963,19 @@ function Lp({
2953
2963
  key: "copy-link",
2954
2964
  priority: 25,
2955
2965
  label: "Copy link",
2956
- node: /* @__PURE__ */ a(Rd, { listKey: `queue:${o}`, getState: yr })
2966
+ node: /* @__PURE__ */ a(Ld, { listKey: `queue:${l}`, getState: yr })
2957
2967
  },
2958
2968
  {
2959
2969
  key: "send-view",
2960
2970
  priority: 20,
2961
2971
  label: "Send this view",
2962
2972
  node: /* @__PURE__ */ a(
2963
- Bd,
2973
+ jd,
2964
2974
  {
2965
2975
  getView: () => jc(
2966
2976
  "queue",
2967
- o,
2968
- `queue:${o}`,
2977
+ l,
2978
+ `queue:${l}`,
2969
2979
  yr(),
2970
2980
  Ha()
2971
2981
  ),
@@ -2976,24 +2986,24 @@ function Lp({
2976
2986
  }
2977
2987
  )
2978
2988
  },
2979
- ...$ === "table" ? [
2989
+ ...C === "table" ? [
2980
2990
  {
2981
2991
  key: "export",
2982
2992
  priority: 65,
2983
- active: _t,
2993
+ active: Nt,
2984
2994
  node: /* @__PURE__ */ d(
2985
2995
  "button",
2986
2996
  {
2987
2997
  type: "button",
2988
2998
  onClick: () => void Qs(),
2989
- disabled: _t || !c || (c.total ?? 0) === 0,
2999
+ disabled: Nt || !i || (i.total ?? 0) === 0,
2990
3000
  "data-tip": "Download the rows on this tab, with these filters and columns, as a spreadsheet (CSV)",
2991
- "aria-label": _t ? "Exporting to CSV" : "Export to CSV",
2992
- "aria-busy": _t || void 0,
3001
+ "aria-label": Nt ? "Exporting to CSV" : "Export to CSV",
3002
+ "aria-busy": Nt || void 0,
2993
3003
  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 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800",
2994
3004
  "data-queue-export": !0,
2995
3005
  children: [
2996
- _t ? /* @__PURE__ */ a(Go, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ a(mi, { className: "h-3.5 w-3.5" }),
3006
+ Nt ? /* @__PURE__ */ a(Go, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ a(mi, { className: "h-3.5 w-3.5" }),
2997
3007
  "Export"
2998
3008
  ]
2999
3009
  }
@@ -3023,12 +3033,12 @@ function Lp({
3023
3033
  }
3024
3034
  )
3025
3035
  },
3026
- ...$ === "table" ? [
3036
+ ...C === "table" ? [
3027
3037
  {
3028
3038
  key: "columns",
3029
3039
  priority: 62,
3030
- node: /* @__PURE__ */ d(Ct, { children: [
3031
- /* @__PURE__ */ a($t, { asChild: !0, children: /* @__PURE__ */ d(
3040
+ node: /* @__PURE__ */ d($t, { children: [
3041
+ /* @__PURE__ */ a(Rt, { asChild: !0, children: /* @__PURE__ */ d(
3032
3042
  "button",
3033
3043
  {
3034
3044
  type: "button",
@@ -3039,38 +3049,47 @@ function Lp({
3039
3049
  ]
3040
3050
  }
3041
3051
  ) }),
3042
- /* @__PURE__ */ a(Tt, { className: "w-[220px] p-2", align: "end", children: /* @__PURE__ */ a(
3043
- zs,
3052
+ /* @__PURE__ */ a(
3053
+ Tt,
3044
3054
  {
3045
- sensors: Es,
3046
- collisionDetection: Xs,
3047
- onDragEnd: Ks,
3055
+ className: "max-h-[var(--radix-popover-content-available-height)] w-[min(240px,calc(100vw-2rem))] overflow-y-auto overscroll-contain p-2",
3056
+ align: "end",
3057
+ collisionPadding: 16,
3058
+ "data-queue-columns-chooser": "",
3048
3059
  children: /* @__PURE__ */ a(
3049
- Zs,
3060
+ zs,
3050
3061
  {
3051
- items: bo,
3052
- strategy: ei,
3053
- children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: bo.map((e) => {
3054
- const t = Tr.find((n) => n.key === e);
3055
- return /* @__PURE__ */ a(
3056
- $u,
3057
- {
3058
- id: e,
3059
- label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
3060
- checked: oe.has(e),
3061
- onCheckedChange: () => Ws(e)
3062
- },
3063
- e
3064
- );
3065
- }) })
3062
+ sensors: Es,
3063
+ collisionDetection: Xs,
3064
+ onDragEnd: Ps,
3065
+ children: /* @__PURE__ */ a(
3066
+ Zs,
3067
+ {
3068
+ items: bo,
3069
+ strategy: ei,
3070
+ children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: bo.map((e) => {
3071
+ const t = Rr.find((n) => n.key === e);
3072
+ return /* @__PURE__ */ a(
3073
+ Ru,
3074
+ {
3075
+ id: e,
3076
+ label: typeof (t == null ? void 0 : t.header) == "string" ? t.header : e,
3077
+ checked: oe.has(e),
3078
+ onCheckedChange: () => Ws(e)
3079
+ },
3080
+ e
3081
+ );
3082
+ }) })
3083
+ }
3084
+ )
3066
3085
  }
3067
3086
  )
3068
3087
  }
3069
- ) })
3088
+ )
3070
3089
  ] })
3071
3090
  }
3072
3091
  ] : [],
3073
- ...$ === "table" && hn ? [
3092
+ ...C === "table" && gn ? [
3074
3093
  {
3075
3094
  key: "bulk",
3076
3095
  priority: X ? 95 : 58,
@@ -3092,27 +3111,27 @@ function Lp({
3092
3111
  )
3093
3112
  }
3094
3113
  ] : [],
3095
- ...$ === "table" ? [
3114
+ ...C === "table" ? [
3096
3115
  {
3097
3116
  key: "density",
3098
3117
  priority: 22,
3099
- label: Rt === "compact" ? "Comfortable rows" : "Compact rows",
3118
+ label: Ot === "compact" ? "Comfortable rows" : "Compact rows",
3100
3119
  node: /* @__PURE__ */ a(
3101
3120
  "button",
3102
3121
  {
3103
3122
  type: "button",
3104
3123
  onClick: () => {
3105
- ml(Rt === "compact" ? "comfortable" : "compact");
3124
+ ml(Ot === "compact" ? "comfortable" : "compact");
3106
3125
  },
3107
3126
  "aria-label": "Row density",
3108
- title: Rt === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
3127
+ title: Ot === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
3109
3128
  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",
3110
- children: Rt === "compact" ? /* @__PURE__ */ a(hi, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(yi, { className: "h-3.5 w-3.5" })
3129
+ children: Ot === "compact" ? /* @__PURE__ */ a(hi, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(yi, { className: "h-3.5 w-3.5" })
3111
3130
  }
3112
3131
  )
3113
3132
  }
3114
3133
  ] : [],
3115
- ...$ === "table" && yl && _e.length > 0 ? [
3134
+ ...C === "table" && yl && _e.length > 0 ? [
3116
3135
  {
3117
3136
  key: "work-next",
3118
3137
  priority: 70,
@@ -3132,16 +3151,16 @@ function Lp({
3132
3151
  ] : []
3133
3152
  ],
3134
3153
  trail: /* @__PURE__ */ d(Ce, { children: [
3135
- !Hn && me.length === 1 && (bn ? /* @__PURE__ */ d(Ct, { children: [
3136
- /* @__PURE__ */ a($t, { asChild: !0, children: /* @__PURE__ */ d(
3154
+ !Hn && pe.length === 1 && (yn ? /* @__PURE__ */ d($t, { children: [
3155
+ /* @__PURE__ */ a(Rt, { asChild: !0, children: /* @__PURE__ */ d(
3137
3156
  "button",
3138
3157
  {
3139
3158
  type: "button",
3140
3159
  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",
3141
3160
  children: [
3142
- /* @__PURE__ */ a(An, { className: "h-3.5 w-3.5" }),
3161
+ /* @__PURE__ */ a(qn, { className: "h-3.5 w-3.5" }),
3143
3162
  "New ",
3144
- Mr(me[0]),
3163
+ Mr(pe[0]),
3145
3164
  /* @__PURE__ */ a(Vo, { className: "h-3 w-3 opacity-60" })
3146
3165
  ]
3147
3166
  }
@@ -3152,24 +3171,24 @@ function Lp({
3152
3171
  {
3153
3172
  type: "button",
3154
3173
  onClick: () => Q.open({
3155
- collection: me[0],
3174
+ collection: pe[0],
3156
3175
  itemId: "new",
3157
3176
  // Same layout the queue opens existing records with.
3158
3177
  layoutSlug: (p == null ? void 0 : p.item_layout) ?? null
3159
3178
  }),
3160
3179
  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",
3161
3180
  children: [
3162
- ((qo = bn.active) == null ? void 0 : qo.create_label) ?? ((Eo = bn.active) == null ? void 0 : Eo.name) ?? "Default layout",
3181
+ ((qo = yn.active) == null ? void 0 : qo.create_label) ?? ((Eo = yn.active) == null ? void 0 : Eo.name) ?? "Default layout",
3163
3182
  /* @__PURE__ */ a("span", { className: "ml-auto pl-3 text-[10px] text-slate-400 dark:text-slate-500", children: "default" })
3164
3183
  ]
3165
3184
  }
3166
3185
  ),
3167
- bn.options.map((e) => /* @__PURE__ */ a(
3186
+ yn.options.map((e) => /* @__PURE__ */ a(
3168
3187
  "button",
3169
3188
  {
3170
3189
  type: "button",
3171
3190
  onClick: () => Q.open({
3172
- collection: me[0],
3191
+ collection: pe[0],
3173
3192
  itemId: "new",
3174
3193
  layoutSlug: e.slug
3175
3194
  }),
@@ -3184,7 +3203,7 @@ function Lp({
3184
3203
  {
3185
3204
  type: "button",
3186
3205
  onClick: () => Q.open({
3187
- collection: me[0],
3206
+ collection: pe[0],
3188
3207
  itemId: "new",
3189
3208
  // Open a new record on the same layout the queue opens
3190
3209
  // existing ones with, so creating and reviewing match.
@@ -3192,26 +3211,26 @@ function Lp({
3192
3211
  }),
3193
3212
  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",
3194
3213
  children: [
3195
- /* @__PURE__ */ a(An, { className: "h-3.5 w-3.5" }),
3214
+ /* @__PURE__ */ a(qn, { className: "h-3.5 w-3.5" }),
3196
3215
  "New ",
3197
- Mr(me[0])
3216
+ Mr(pe[0])
3198
3217
  ]
3199
3218
  }
3200
3219
  )),
3201
- !Hn && me.length > 1 && /* @__PURE__ */ d(Ct, { children: [
3202
- /* @__PURE__ */ a($t, { asChild: !0, children: /* @__PURE__ */ d(
3220
+ !Hn && pe.length > 1 && /* @__PURE__ */ d($t, { children: [
3221
+ /* @__PURE__ */ a(Rt, { asChild: !0, children: /* @__PURE__ */ d(
3203
3222
  "button",
3204
3223
  {
3205
3224
  type: "button",
3206
3225
  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",
3207
3226
  children: [
3208
- /* @__PURE__ */ a(An, { className: "h-3.5 w-3.5" }),
3227
+ /* @__PURE__ */ a(qn, { className: "h-3.5 w-3.5" }),
3209
3228
  "New",
3210
3229
  /* @__PURE__ */ a(Vo, { className: "h-3 w-3 opacity-60" })
3211
3230
  ]
3212
3231
  }
3213
3232
  ) }),
3214
- /* @__PURE__ */ a(Tt, { align: "end", className: "w-56 p-1", children: me.map((e) => /* @__PURE__ */ d(
3233
+ /* @__PURE__ */ a(Tt, { align: "end", className: "w-56 p-1", children: pe.map((e) => /* @__PURE__ */ d(
3215
3234
  "button",
3216
3235
  {
3217
3236
  type: "button",
@@ -3222,7 +3241,7 @@ function Lp({
3222
3241
  }),
3223
3242
  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",
3224
3243
  children: [
3225
- /* @__PURE__ */ a(An, { className: "h-3 w-3 opacity-60" }),
3244
+ /* @__PURE__ */ a(qn, { className: "h-3 w-3 opacity-60" }),
3226
3245
  Mr(e)
3227
3246
  ]
3228
3247
  },
@@ -3252,20 +3271,20 @@ function Lp({
3252
3271
  children: [
3253
3272
  /* @__PURE__ */ d("div", { className: "nvr-stagger-direct flex max-w-full flex-wrap gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: [
3254
3273
  /* @__PURE__ */ a(
3255
- cn,
3274
+ dn,
3256
3275
  {
3257
3276
  label: "Total",
3258
3277
  count: (g == null ? void 0 : g.total) ?? 0,
3259
3278
  filteredCount: J ? J.total : null,
3260
3279
  active: Object.values(x).every(_l) && b === "all",
3261
3280
  isLoading: ft,
3262
- ...It("total"),
3281
+ ...Jt("total"),
3263
3282
  onClick: Nl
3264
3283
  }
3265
3284
  ),
3266
3285
  Vs && /* @__PURE__ */ d(Ce, { children: [
3267
3286
  /* @__PURE__ */ a(
3268
- cn,
3287
+ dn,
3269
3288
  {
3270
3289
  label: "Warning",
3271
3290
  count: (g == null ? void 0 : g.sla_warning) ?? 0,
@@ -3274,12 +3293,12 @@ function Lp({
3274
3293
  active: x.sla_status === "warning",
3275
3294
  isLoading: ft,
3276
3295
  deltaBadIsUp: !0,
3277
- ...It("sla_warning"),
3296
+ ...Jt("sla_warning"),
3278
3297
  onClick: () => mt("sla_status", "warning")
3279
3298
  }
3280
3299
  ),
3281
3300
  /* @__PURE__ */ a(
3282
- cn,
3301
+ dn,
3283
3302
  {
3284
3303
  label: "Breached",
3285
3304
  count: (g == null ? void 0 : g.sla_breached) ?? 0,
@@ -3288,13 +3307,13 @@ function Lp({
3288
3307
  active: x.sla_status === "breached",
3289
3308
  isLoading: ft,
3290
3309
  deltaBadIsUp: !0,
3291
- ...It("sla_breached"),
3310
+ ...Jt("sla_breached"),
3292
3311
  onClick: () => mt("sla_status", "breached")
3293
3312
  }
3294
3313
  )
3295
3314
  ] }),
3296
3315
  /* @__PURE__ */ a(
3297
- cn,
3316
+ dn,
3298
3317
  {
3299
3318
  label: "At Risk",
3300
3319
  breakdown: J ? cl(J.at_risk_by_rule) : cl(g == null ? void 0 : g.at_risk_by_rule),
@@ -3304,12 +3323,12 @@ function Lp({
3304
3323
  active: x.at_risk === "yes",
3305
3324
  isLoading: ft,
3306
3325
  deltaBadIsUp: !0,
3307
- ...It("at_risk"),
3326
+ ...Jt("at_risk"),
3308
3327
  onClick: () => mt("at_risk", "yes")
3309
3328
  }
3310
3329
  ),
3311
3330
  /* @__PURE__ */ a(
3312
- cn,
3331
+ dn,
3313
3332
  {
3314
3333
  label: "Unowned",
3315
3334
  count: (g == null ? void 0 : g.unowned) ?? 0,
@@ -3317,18 +3336,18 @@ function Lp({
3317
3336
  active: b === "unowned",
3318
3337
  isLoading: ft,
3319
3338
  deltaBadIsUp: !0,
3320
- ...It("unowned"),
3339
+ ...Jt("unowned"),
3321
3340
  onClick: () => {
3322
- de(b === "unowned" ? "all" : "unowned"), j(1);
3341
+ me(b === "unowned" ? "all" : "unowned"), j(1);
3323
3342
  }
3324
3343
  }
3325
3344
  )
3326
3345
  ] }),
3327
- Vt && g && g.total > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-[11px]", "data-tip": "Time in current state", children: [
3328
- ["0-1d", "0:24", Vt.d1],
3329
- ["1-3d", "24:72", Vt.d3],
3330
- ["3-7d", "72:168", Vt.d7],
3331
- ["7d+", "168:", Vt.over]
3346
+ Wt && g && g.total > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-[11px]", "data-tip": "Time in current state", children: [
3347
+ ["0-1d", "0:24", Wt.d1],
3348
+ ["1-3d", "24:72", Wt.d3],
3349
+ ["3-7d", "72:168", Wt.d7],
3350
+ ["7d+", "168:", Wt.over]
3332
3351
  ].map(([e, t, n]) => /* @__PURE__ */ d(
3333
3352
  "button",
3334
3353
  {
@@ -3376,9 +3395,9 @@ function Lp({
3376
3395
  Da.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: Da.map(([e, t]) => {
3377
3396
  var n;
3378
3397
  return /* @__PURE__ */ a(
3379
- Cu,
3398
+ $u,
3380
3399
  {
3381
- label: Ke(e),
3400
+ label: Pe(e),
3382
3401
  count: t,
3383
3402
  filteredCount: J ? J.by_state[e] ?? 0 : null,
3384
3403
  color: ((n = Be[e]) == null ? void 0 : n.color) ?? null,
@@ -3391,19 +3410,19 @@ function Lp({
3391
3410
  ]
3392
3411
  }
3393
3412
  ),
3394
- $ !== "workload" && /* @__PURE__ */ a(
3395
- au,
3413
+ C !== "workload" && /* @__PURE__ */ a(
3414
+ ou,
3396
3415
  {
3397
- queueId: o,
3398
- right: H ? void 0 : /* @__PURE__ */ a(ll, { kind: "queue", id: o, variant: "header" })
3416
+ queueId: l,
3417
+ right: H ? void 0 : /* @__PURE__ */ a(ll, { kind: "queue", id: l, variant: "header" })
3399
3418
  }
3400
3419
  ),
3401
- $ !== "workload" && /* @__PURE__ */ a(
3402
- ru,
3420
+ C !== "workload" && /* @__PURE__ */ a(
3421
+ au,
3403
3422
  {
3404
3423
  defs: Us,
3405
3424
  values: x,
3406
- seededKeys: an,
3425
+ seededKeys: ln,
3407
3426
  onApply: (e) => {
3408
3427
  V((t) => ({ ...t, ...e })), j(1);
3409
3428
  },
@@ -3419,7 +3438,7 @@ function Lp({
3419
3438
  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",
3420
3439
  "data-queue-saved-views": !0,
3421
3440
  children: [
3422
- ((c == null ? void 0 : c.total) ?? 0) > 0 && Oe > 0 && /* @__PURE__ */ d(
3441
+ ((i == null ? void 0 : i.total) ?? 0) > 0 && Oe > 0 && /* @__PURE__ */ d(
3423
3442
  "span",
3424
3443
  {
3425
3444
  "data-queue-default-hiding": Oe,
@@ -3456,7 +3475,7 @@ function Lp({
3456
3475
  x.owners.map(
3457
3476
  (e) => {
3458
3477
  var t, n;
3459
- return ((n = (t = c == null ? void 0 : c.available_values.owners) == null ? void 0 : t.find(
3478
+ return ((n = (t = i == null ? void 0 : i.available_values.owners) == null ? void 0 : t.find(
3460
3479
  (r) => String(r.id).toUpperCase() === String(e).toUpperCase()
3461
3480
  )) == null ? void 0 : n.name) ?? "someone";
3462
3481
  }
@@ -3522,11 +3541,11 @@ function Lp({
3522
3541
  )
3523
3542
  }
3524
3543
  ),
3525
- /* @__PURE__ */ d("button", { type: "button", onClick: () => Xt(e), children: [
3544
+ /* @__PURE__ */ d("button", { type: "button", onClick: () => en(e), children: [
3526
3545
  e.name,
3527
3546
  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" })
3528
3547
  ] }),
3529
- Zt && /* @__PURE__ */ a(
3548
+ tn && /* @__PURE__ */ a(
3530
3549
  "button",
3531
3550
  {
3532
3551
  type: "button",
@@ -3564,13 +3583,13 @@ function Lp({
3564
3583
  {
3565
3584
  type: "button",
3566
3585
  onClick: () => $l(e.id),
3567
- title: yn(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
3586
+ title: xn(e.id) ? "Subscribed to new arrivals in this view — click to unsubscribe" : "Notify me when items enter this view (checked every 5 min)",
3568
3587
  className: F(
3569
3588
  "shrink-0",
3570
- yn(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
3589
+ xn(e.id) ? "text-nvr-cyan" : "invisible text-slate-300 hover:text-nvr-cyan group-hover:visible dark:text-slate-600"
3571
3590
  ),
3572
3591
  "aria-label": `Subscribe to view ${e.name}`,
3573
- children: /* @__PURE__ */ a(wi, { className: F("h-3 w-3", yn(e.id) && "fill-current") })
3592
+ children: /* @__PURE__ */ a(wi, { className: F("h-3 w-3", xn(e.id) && "fill-current") })
3574
3593
  }
3575
3594
  ),
3576
3595
  e.user === z && (gr === e.id ? /* @__PURE__ */ d(
@@ -3595,7 +3614,7 @@ function Lp({
3595
3614
  "button",
3596
3615
  {
3597
3616
  type: "button",
3598
- onClick: () => Cn(null),
3617
+ onClick: () => Rn(null),
3599
3618
  className: "text-slate-500 hover:underline dark:text-slate-400",
3600
3619
  "aria-label": `Keep view ${e.name}`,
3601
3620
  children: "No"
@@ -3607,7 +3626,7 @@ function Lp({
3607
3626
  "button",
3608
3627
  {
3609
3628
  type: "button",
3610
- onClick: () => Cn(e.id),
3629
+ onClick: () => Rn(e.id),
3611
3630
  className: "invisible text-slate-400 hover:text-red-500 group-hover:visible",
3612
3631
  "aria-label": `Delete view ${e.name}`,
3613
3632
  children: "×"
@@ -3618,8 +3637,8 @@ function Lp({
3618
3637
  e.id
3619
3638
  );
3620
3639
  }),
3621
- /* @__PURE__ */ d(Ct, { open: ts, onOpenChange: br, children: [
3622
- /* @__PURE__ */ a($t, { asChild: !0, children: /* @__PURE__ */ a(
3640
+ /* @__PURE__ */ d($t, { open: ts, onOpenChange: br, children: [
3641
+ /* @__PURE__ */ a(Rt, { asChild: !0, children: /* @__PURE__ */ a(
3623
3642
  "button",
3624
3643
  {
3625
3644
  type: "button",
@@ -3651,17 +3670,17 @@ function Lp({
3651
3670
  /* @__PURE__ */ a(
3652
3671
  "input",
3653
3672
  {
3654
- value: wn,
3673
+ value: Nn,
3655
3674
  onChange: (e) => Qa(e.target.value),
3656
3675
  onKeyDown: (e) => {
3657
- e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), wn.trim() && !Sn.isPending && Sn.mutate());
3676
+ e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), Nn.trim() && !$n.isPending && $n.mutate());
3658
3677
  },
3659
3678
  placeholder: "View name",
3660
3679
  "aria-label": "View name",
3661
3680
  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"
3662
3681
  }
3663
3682
  ),
3664
- Zt && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
3683
+ tn && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
3665
3684
  /* @__PURE__ */ a(
3666
3685
  Ur,
3667
3686
  {
@@ -3672,7 +3691,7 @@ function Lp({
3672
3691
  ),
3673
3692
  "Share with everyone"
3674
3693
  ] }),
3675
- Zt && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
3694
+ tn && /* @__PURE__ */ d("label", { className: "mb-2 flex items-center gap-2 text-[12px] text-slate-600 dark:text-slate-300", children: [
3676
3695
  /* @__PURE__ */ a(
3677
3696
  Ur,
3678
3697
  {
@@ -3682,13 +3701,13 @@ function Lp({
3682
3701
  ),
3683
3702
  "Set as queue default (everyone starts here)"
3684
3703
  ] }),
3685
- Zt && kt && /* @__PURE__ */ a("p", { className: "-mt-1 mb-2 pl-6 text-[11px] text-slate-500 dark:text-slate-400", children: "Saves columns, sort and totals. Filters stay each person's own." }),
3704
+ tn && kt && /* @__PURE__ */ a("p", { className: "-mt-1 mb-2 pl-6 text-[11px] text-slate-500 dark:text-slate-400", children: "Saves columns, sort and totals. Filters stay each person's own." }),
3686
3705
  /* @__PURE__ */ a(
3687
3706
  "button",
3688
3707
  {
3689
3708
  type: "button",
3690
- disabled: !wn.trim() || Sn.isPending,
3691
- onClick: () => Sn.mutate(),
3709
+ disabled: !Nn.trim() || $n.isPending,
3710
+ onClick: () => $n.mutate(),
3692
3711
  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",
3693
3712
  children: "Save current view"
3694
3713
  }
@@ -3699,7 +3718,7 @@ function Lp({
3699
3718
  }
3700
3719
  )
3701
3720
  ] }),
3702
- /* @__PURE__ */ d("div", { ref: _n, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
3721
+ /* @__PURE__ */ d("div", { ref: Sn, className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-4 pb-4 pt-3", children: [
3703
3722
  da && /* @__PURE__ */ a(Sd, { error: ql, onRetry: () => void El(), className: "mb-3" }),
3704
3723
  Fr && /* @__PURE__ */ a(
3705
3724
  "p",
@@ -3711,7 +3730,7 @@ function Lp({
3711
3730
  children: Fr
3712
3731
  }
3713
3732
  ),
3714
- $ === "table" ? /* @__PURE__ */ a(Ce, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
3733
+ C === "table" ? /* @__PURE__ */ a(Ce, { children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1", children: /* @__PURE__ */ d(
3715
3734
  "div",
3716
3735
  {
3717
3736
  ref: be.rootRef,
@@ -3721,11 +3740,11 @@ function Lp({
3721
3740
  ),
3722
3741
  "aria-busy": ba || void 0,
3723
3742
  children: [
3724
- Et.label && /* @__PURE__ */ a(
3743
+ Kt.label && /* @__PURE__ */ a(
3725
3744
  $d,
3726
3745
  {
3727
- label: Et.label,
3728
- onShow: Ra,
3746
+ label: Kt.label,
3747
+ onShow: Ta,
3729
3748
  className: "bottom-28"
3730
3749
  }
3731
3750
  ),
@@ -3740,43 +3759,43 @@ function Lp({
3740
3759
  {
3741
3760
  fillHeight: !0,
3742
3761
  enterKey: Ca.current,
3743
- density: Rt,
3762
+ density: Ot,
3744
3763
  minBodyHeight: 360,
3745
3764
  columns: et,
3746
3765
  rows: Sa.rows,
3747
3766
  rowKey: (e) => `${e.collection}:${e.item_id}`,
3748
- total: (c == null ? void 0 : c.total) ?? 0,
3749
- page: ue,
3750
- limit: In,
3767
+ total: (i == null ? void 0 : i.total) ?? 0,
3768
+ page: se,
3769
+ limit: fn,
3751
3770
  isLoading: ft,
3752
3771
  onPageChange: j,
3753
3772
  onRowClick: (e) => fr(e),
3754
- onRowFocus: (e) => Yt(S(e)),
3755
- activeRowKey: Jt,
3773
+ onRowFocus: (e) => Xt(k(e)),
3774
+ activeRowKey: zt,
3756
3775
  rowAriaLabel: (e) => e.label || void 0,
3757
3776
  rowDragProps: (e) => ({
3758
3777
  ...Vl({ collection: e.collection, id: e.item_id }),
3759
3778
  ...Ml.record(e.collection, e.item_id)
3760
3779
  }),
3761
3780
  onRowContextMenu: (e, t) => {
3762
- t.preventDefault(), zt({ x: t.clientX, y: t.clientY, row: e });
3781
+ t.preventDefault(), Zt({ x: t.clientX, y: t.clientY, row: e });
3763
3782
  },
3764
3783
  rowTitle: (e) => {
3765
- const t = Gt.get(S(e));
3766
- return (Tn(S(e)) ? kc : void 0) ?? (Rn(S(e)) != null ? pc(Rn(S(e))) : void 0) ?? be.titleFor(S(e)) ?? (t && !t.is_mine ? bc(t) : void 0) ?? (Ja(e.collection, e.item_id) ? Ed : void 0);
3784
+ const t = It.get(k(e));
3785
+ return (Ln(k(e)) ? kc : void 0) ?? (wt(k(e)) != null ? pc(wt(k(e))) : void 0) ?? be.titleFor(k(e)) ?? (t && !t.is_mine ? bc(t) : void 0) ?? (Ja(e.collection, e.item_id) ? Pd : void 0);
3767
3786
  },
3768
3787
  rowClassName: (e) => F(
3769
3788
  ls(e),
3770
- Ja(e.collection, e.item_id) && qd,
3771
- Tn(S(e)) && xc
3789
+ Ja(e.collection, e.item_id) && Ed,
3790
+ Ln(k(e)) && xc
3772
3791
  ),
3773
3792
  emptyMessage: da ? /* @__PURE__ */ a("span", { className: "sr-only", children: "The list did not load." }) : /* @__PURE__ */ a(
3774
3793
  fd,
3775
3794
  {
3776
3795
  icon: _i,
3777
- title: ((Ko = c == null ? void 0 : c.empty) == null ? void 0 : Ko.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((Po = c == null ? void 0 : c.empty) == null ? void 0 : Po.reason) === "scope_mine" ? "Nothing waiting on you" : ((Do = c == null ? void 0 : c.empty) == null ? void 0 : Do.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
3778
- detail: ((Mo = c == null ? void 0 : c.empty) == null ? void 0 : Mo.reason) === "filters" && Oe > 0 ? `Your default ${pa(Or)} filter is hiding ${Oe.toLocaleString("en-US")} item${Oe === 1 ? "" : "s"} here.` : ((Bo = c == null ? void 0 : c.empty) == null ? void 0 : Bo.reason) === "filters" ? b !== "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." : ((jo = c == null ? void 0 : c.empty) == null ? void 0 : jo.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
3779
- action: ((Qo = c == null ? void 0 : c.empty) == null ? void 0 : Qo.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
3796
+ title: ((Po = i == null ? void 0 : i.empty) == null ? void 0 : Po.reason) === "not_permitted" ? "You cannot read this queue’s records" : ((Ko = i == null ? void 0 : i.empty) == null ? void 0 : Ko.reason) === "scope_mine" ? "Nothing waiting on you" : ((Do = i == null ? void 0 : i.empty) == null ? void 0 : Do.reason) === "filters" ? "No records match these filters" : "Nothing in this queue",
3797
+ detail: ((Mo = i == null ? void 0 : i.empty) == null ? void 0 : Mo.reason) === "filters" && Oe > 0 ? `Your default ${pa(Or)} filter is hiding ${Oe.toLocaleString("en-US")} item${Oe === 1 ? "" : "s"} here.` : ((Bo = i == null ? void 0 : i.empty) == null ? void 0 : Bo.reason) === "filters" ? b !== "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." : ((jo = i == null ? void 0 : i.empty) == null ? void 0 : jo.message) ?? "Records land here when they match the queue sources — a state change or new record can appear at any moment.",
3798
+ action: ((Qo = i == null ? void 0 : i.empty) == null ? void 0 : Qo.reason) === "filters" ? /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-2", children: [
3780
3799
  Oe > 0 && /* @__PURE__ */ d(
3781
3800
  "button",
3782
3801
  {
@@ -3798,7 +3817,7 @@ function Lp({
3798
3817
  var t;
3799
3818
  const e = {};
3800
3819
  for (const [n, r] of Object.entries(ke.current))
3801
- (t = Te[n.slice(6)]) != null && t.length && (e[n] = r);
3820
+ (t = Re[n.slice(6)]) != null && t.length && (e[n] = r);
3802
3821
  V(e), j(1);
3803
3822
  },
3804
3823
  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",
@@ -3811,7 +3830,7 @@ function Lp({
3811
3830
  {
3812
3831
  type: "button",
3813
3832
  onClick: () => {
3814
- de("all"), j(1);
3833
+ me("all"), j(1);
3815
3834
  },
3816
3835
  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",
3817
3836
  "data-queue-empty-all": !0,
@@ -3833,15 +3852,15 @@ function Lp({
3833
3852
  rowGroups: gs ?? void 0,
3834
3853
  collapsedGroups: xe,
3835
3854
  onToggleGroup: zl,
3836
- selectedIds: hn && X ? ee : void 0,
3837
- onSelectionChange: hn && X ? De : void 0,
3855
+ selectedIds: gn && X ? ee : void 0,
3856
+ onSelectionChange: gn && X ? De : void 0,
3838
3857
  hideFilterRow: !0,
3839
3858
  nowrapCells: !0,
3840
3859
  columnPins: vo,
3841
- pinKeepRank: yu,
3860
+ pinKeepRank: gu,
3842
3861
  pinRightShare: 0.45,
3843
3862
  onColumnPinChange: (e, t) => {
3844
- Pn((n) => {
3863
+ Dn((n) => {
3845
3864
  const r = { ...n ?? vo };
3846
3865
  return t ? r[e] = t : delete r[e], r;
3847
3866
  });
@@ -3850,9 +3869,9 @@ function Lp({
3850
3869
  hScrollProxy: !0,
3851
3870
  totalsRow: js,
3852
3871
  footer: /* @__PURE__ */ a(
3853
- Dd,
3872
+ Md,
3854
3873
  {
3855
- collections: Ht,
3874
+ collections: Yt,
3856
3875
  selectedIds: String(x.at_risk_rule ?? "").split(",").map((e) => Number(e)).filter((e) => Number.isFinite(e) && e > 0),
3857
3876
  onToggle: (e) => {
3858
3877
  const t = e.ids.join(",");
@@ -3868,41 +3887,41 @@ function Lp({
3868
3887
  )
3869
3888
  ]
3870
3889
  }
3871
- ) }) }) : $ === "kanban" ? /* @__PURE__ */ a(
3872
- nu,
3890
+ ) }) }) : C === "kanban" ? /* @__PURE__ */ a(
3891
+ ru,
3873
3892
  {
3874
3893
  items: L,
3875
3894
  onCardClick: (e) => fr(e),
3876
3895
  onDrop: (e, t) => Bl.mutate({ item: e, targetState: t }),
3877
3896
  onClaim: (e) => Ie.mutate(e),
3878
3897
  onRelease: (e) => bt.mutate(e),
3879
- swimlaneBy: Ft,
3898
+ swimlaneBy: qt,
3880
3899
  stateLabels: cr,
3881
- laneLabel: Ft === "collection" ? He : void 0,
3882
- claimsEnabled: Re,
3900
+ laneLabel: qt === "collection" ? He : void 0,
3901
+ claimsEnabled: Te,
3883
3902
  onDraggingChange: (e) => {
3884
- Qn.current = e;
3903
+ Un.current = e;
3885
3904
  }
3886
3905
  }
3887
- ) : /* @__PURE__ */ a(ou, { queueId: o })
3906
+ ) : /* @__PURE__ */ a(lu, { queueId: l })
3888
3907
  ] }),
3889
- hn && X && /* @__PURE__ */ d(
3890
- Zd,
3908
+ gn && X && /* @__PURE__ */ d(
3909
+ eu,
3891
3910
  {
3892
3911
  count: ee.length,
3893
- claimsEnabled: Re,
3912
+ claimsEnabled: Te,
3894
3913
  showClaim: Ge("claim"),
3895
3914
  showRelease: Ge("release"),
3896
3915
  showTransition: Ge("transition"),
3897
- states: Ma((c == null ? void 0 : c.available_values.state) ?? []).map((e) => ({
3916
+ states: Ma((i == null ? void 0 : i.available_values.state) ?? []).map((e) => ({
3898
3917
  value: e,
3899
- label: Ke(e)
3918
+ label: Pe(e)
3900
3919
  })),
3901
3920
  busy: vt,
3902
3921
  onClaim: () => xr(
3903
3922
  "Claim",
3904
3923
  (e) => f.request(
3905
- ge(`/queues/${o}/claim`, {
3924
+ ge(`/queues/${l}/claim`, {
3906
3925
  source_collection: e.collection,
3907
3926
  item_id: e.item_id
3908
3927
  })
@@ -3911,7 +3930,7 @@ function Lp({
3911
3930
  onRelease: () => xr(
3912
3931
  "Release",
3913
3932
  (e) => f.request(
3914
- ge(`/queues/${o}/release`, {
3933
+ ge(`/queues/${l}/release`, {
3915
3934
  source_collection: e.collection,
3916
3935
  item_id: e.item_id
3917
3936
  })
@@ -3930,7 +3949,7 @@ function Lp({
3930
3949
  noun: "row",
3931
3950
  labelOf: (e) => {
3932
3951
  const t = et.find((n) => n.key === e);
3933
- return t ? Rr(t) : e;
3952
+ return t ? Tr(t) : e;
3934
3953
  },
3935
3954
  format: (e, t) => {
3936
3955
  const n = ye(e.slice(6));
@@ -3948,11 +3967,11 @@ function Lp({
3948
3967
  changed: ms,
3949
3968
  labelOf: (e) => {
3950
3969
  var t;
3951
- return ((t = L.find((n) => S(n) === e)) == null ? void 0 : t.label) ?? null;
3970
+ return ((t = L.find((n) => k(n) === e)) == null ? void 0 : t.label) ?? null;
3952
3971
  },
3953
3972
  onSkip: (e) => De((t) => t.filter((n) => !e.includes(n))),
3954
3973
  onAcknowledgeChanged: (e) => {
3955
- $n.restamp(e), kr.clear(e);
3974
+ Tn.restamp(e), kr.clear(e);
3956
3975
  },
3957
3976
  onOpenRecord: ({ collection: e, id: t }) => window.open(Q.urlFor({ collection: e, itemId: t }), "_blank", "noopener")
3958
3977
  }
@@ -3964,9 +3983,9 @@ function Lp({
3964
3983
  type: "button",
3965
3984
  onClick: () => {
3966
3985
  const e = Sc(
3967
- L.filter((t) => ee.includes(S(t)) && t.collection !== "tasks").map((t) => Q.urlFor(pr(t)))
3986
+ L.filter((t) => ee.includes(k(t)) && t.collection !== "tasks").map((t) => Q.urlFor(pr(t)))
3968
3987
  );
3969
- e.blocked > 0 || e.capped > 0 ? P.warning(Xo(e)) : P.success(Xo(e));
3988
+ e.blocked > 0 || e.capped > 0 ? K.warning(Xo(e)) : K.success(Xo(e));
3970
3989
  },
3971
3990
  "data-bulk-open-tabs": !0,
3972
3991
  title: `Open the selected records in new tabs (up to ${Nc})`,
@@ -3976,16 +3995,16 @@ function Lp({
3976
3995
  ),
3977
3996
  Ge("transition") && (() => {
3978
3997
  const e = L.filter(
3979
- (n) => ee.includes(S(n)) && n.collection !== "tasks"
3998
+ (n) => ee.includes(k(n)) && n.collection !== "tasks"
3980
3999
  ), t = [...new Set(e.map((n) => n.collection))];
3981
4000
  return e.length > 0 ? /* @__PURE__ */ a(
3982
- eu,
4001
+ tu,
3983
4002
  {
3984
4003
  collection: t.length === 1 ? t[0] : null,
3985
4004
  ids: e.map((n) => n.item_id),
3986
4005
  disabled: vt,
3987
4006
  onDone: () => {
3988
- De([]), y.invalidateQueries({ queryKey: ["queue-items", o] });
4007
+ De([]), y.invalidateQueries({ queryKey: ["queue-items", l] });
3989
4008
  }
3990
4009
  }
3991
4010
  ) : null;
@@ -3993,32 +4012,32 @@ function Lp({
3993
4012
  /* @__PURE__ */ a(
3994
4013
  Xc,
3995
4014
  {
3996
- targets: L.filter((e) => ee.includes(S(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
4015
+ targets: L.filter((e) => ee.includes(k(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id, label: e.label })),
3997
4016
  enabledKeys: (p == null ? void 0 : p.bulk_action_keys) ?? null,
3998
4017
  tone: "light",
3999
4018
  disabled: vt,
4000
4019
  onDone: (e) => {
4001
- e.failed === 0 && De([]), y.invalidateQueries({ queryKey: ["queue-items", o] });
4020
+ e.failed === 0 && De([]), y.invalidateQueries({ queryKey: ["queue-items", l] });
4002
4021
  }
4003
4022
  }
4004
4023
  ),
4005
4024
  Ge("update-field") && /* @__PURE__ */ a(
4006
4025
  ed,
4007
4026
  {
4008
- targets: L.filter((e) => ee.includes(S(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
4027
+ targets: L.filter((e) => ee.includes(k(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
4009
4028
  disabled: vt,
4010
- onDone: () => void y.invalidateQueries({ queryKey: ["queue-items", o] }),
4029
+ onDone: () => void y.invalidateQueries({ queryKey: ["queue-items", l] }),
4011
4030
  className: "rounded-md px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:bg-slate-100 disabled:opacity-50 dark:text-slate-300 dark:hover:bg-muted"
4012
4031
  }
4013
4032
  ),
4014
4033
  Ge("compare") && /* @__PURE__ */ a(
4015
4034
  Zc,
4016
4035
  {
4017
- targets: L.filter((e) => ee.includes(S(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
4036
+ targets: L.filter((e) => ee.includes(k(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
4018
4037
  renderValue: (e, t, n, r) => {
4019
- var l;
4038
+ var o;
4020
4039
  return od(
4021
- ((l = L.find((i) => ee.includes(S(i)))) == null ? void 0 : l.collection) ?? "",
4040
+ ((o = L.find((c) => ee.includes(k(c)))) == null ? void 0 : o.collection) ?? "",
4022
4041
  e,
4023
4042
  t,
4024
4043
  n,
@@ -4032,7 +4051,7 @@ function Lp({
4032
4051
  Ge("message") && /* @__PURE__ */ a(
4033
4052
  ad,
4034
4053
  {
4035
- targets: L.filter((e) => ee.includes(S(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
4054
+ targets: L.filter((e) => ee.includes(k(e)) && e.collection !== "tasks").map((e) => ({ collection: e.collection, id: e.item_id })),
4036
4055
  disabled: vt,
4037
4056
  className: "rounded-md px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:bg-slate-100 disabled:opacity-50 dark:text-slate-300 dark:hover:bg-muted"
4038
4057
  }
@@ -4041,7 +4060,7 @@ function Lp({
4041
4060
  }
4042
4061
  ),
4043
4062
  Y != null && Y.length ? /* @__PURE__ */ a(
4044
- Pd,
4063
+ Dd,
4045
4064
  {
4046
4065
  collection: Y[0].collection,
4047
4066
  itemId: Y[0].itemId,
@@ -4050,9 +4069,9 @@ function Lp({
4050
4069
  width: Y[0].width,
4051
4070
  title: Y[0].title,
4052
4071
  stack: Y,
4053
- onPush: (e) => wt.push([...Y, e]),
4054
- onPop: () => wt.back(),
4055
- onClose: () => wt.back(Y.length),
4072
+ onPush: (e) => _t.push([...Y, e]),
4073
+ onPop: () => _t.back(),
4074
+ onClose: () => _t.back(Y.length),
4056
4075
  onOpenRecord: Zl
4057
4076
  }
4058
4077
  ) : null,
@@ -4077,7 +4096,7 @@ function Lp({
4077
4096
  run: () => xt(I.row)
4078
4097
  },
4079
4098
  { label: "Peek", run: () => Ye(I.row) },
4080
- ...Re ? [
4099
+ ...Te ? [
4081
4100
  ((Uo = I.row.claimed_by) == null ? void 0 : Uo.id) === z ? { label: "Release claim", run: () => bt.mutate(I.row) } : { label: "Claim", run: () => Ie.mutate(I.row) }
4082
4101
  ] : [],
4083
4102
  // The friendly id (PW26-76166), never the row id (army 6 M52);
@@ -4101,7 +4120,7 @@ function Lp({
4101
4120
  }
4102
4121
  },
4103
4122
  // Custom actions (#125): the record's registered actions, right here.
4104
- ...Rl(I.row.collection).map((e) => ({
4123
+ ...Tl(I.row.collection).map((e) => ({
4105
4124
  label: e.label,
4106
4125
  run: () => Ll(e, I.row)
4107
4126
  }))
@@ -4110,7 +4129,7 @@ function Lp({
4110
4129
  {
4111
4130
  type: "button",
4112
4131
  onClick: () => {
4113
- e.run(), zt(null);
4132
+ e.run(), Zt(null);
4114
4133
  },
4115
4134
  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",
4116
4135
  children: e.label
@@ -4126,7 +4145,7 @@ function Lp({
4126
4145
  {
4127
4146
  type: "button",
4128
4147
  onClick: () => {
4129
- ia(I.row, e), zt(null);
4148
+ ia(I.row, e), Zt(null);
4130
4149
  },
4131
4150
  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",
4132
4151
  children: [
@@ -4150,7 +4169,7 @@ function Lp({
4150
4169
  const n = e.target.elements.namedItem(
4151
4170
  "newlabel"
4152
4171
  ).value.trim();
4153
- n && (ia(I.row, n), zt(null));
4172
+ n && (ia(I.row, n), Zt(null));
4154
4173
  },
4155
4174
  className: "px-3 py-1",
4156
4175
  children: /* @__PURE__ */ a(
@@ -4175,7 +4194,7 @@ function Lp({
4175
4194
  /* @__PURE__ */ a(
4176
4195
  Tu,
4177
4196
  {
4178
- queueId: o,
4197
+ queueId: l,
4179
4198
  drill: sa,
4180
4199
  onClose: () => Yn(null),
4181
4200
  onOpenRecord: (e, t) => {
@@ -4186,12 +4205,12 @@ function Lp({
4186
4205
  document.body
4187
4206
  ),
4188
4207
  /* @__PURE__ */ a(
4189
- tu,
4208
+ nu,
4190
4209
  {
4191
4210
  item: Je,
4192
4211
  stateLabels: cr,
4193
4212
  collectionLabel: He,
4194
- claimsEnabled: Re,
4213
+ claimsEnabled: Te,
4195
4214
  columnFormats: ws,
4196
4215
  fieldLabel: (e) => A(`extra.${e}`, Ue(e)),
4197
4216
  width: p == null ? void 0 : p.sheet_width,
@@ -4204,25 +4223,25 @@ function Lp({
4204
4223
  onRelease: (e) => bt.mutate(e),
4205
4224
  workNextActive: Xl,
4206
4225
  onNext: () => Je && ja(Je),
4207
- refetchItems: () => y.invalidateQueries({ queryKey: ["queue-items", o] })
4226
+ refetchItems: () => y.invalidateQueries({ queryKey: ["queue-items", l] })
4208
4227
  }
4209
4228
  ),
4210
- gn.dialog
4229
+ kn.dialog
4211
4230
  ] });
4212
4231
  }
4213
4232
  function Tu({
4214
- queueId: o,
4215
- drill: N,
4233
+ queueId: l,
4234
+ drill: S,
4216
4235
  onClose: q,
4217
4236
  onOpenRecord: M
4218
4237
  }) {
4219
4238
  const H = dl(), { data: B, isLoading: y } = ne({
4220
- queryKey: ["queue-agg-rows", o, N.row.collection, N.row.item_id, N.path],
4239
+ queryKey: ["queue-agg-rows", l, S.row.collection, S.row.item_id, S.path],
4221
4240
  queryFn: () => H.request(
4222
- D(`/queues/${o}/aggregate-rows`, {
4223
- collection: N.row.collection,
4224
- item_id: N.row.item_id,
4225
- path: N.path
4241
+ D(`/queues/${l}/aggregate-rows`, {
4242
+ collection: S.row.collection,
4243
+ item_id: S.row.item_id,
4244
+ path: S.path
4226
4245
  })
4227
4246
  ).then((f) => f.data)
4228
4247
  });
@@ -4239,11 +4258,11 @@ function Tu({
4239
4258
  children: [
4240
4259
  /* @__PURE__ */ d("div", { className: "mb-2 flex items-start justify-between gap-3", children: [
4241
4260
  /* @__PURE__ */ d("div", { children: [
4242
- /* @__PURE__ */ a("p", { className: "text-[13px] font-semibold", children: N.row.label }),
4261
+ /* @__PURE__ */ a("p", { className: "text-[13px] font-semibold", children: S.row.label }),
4243
4262
  /* @__PURE__ */ d("p", { className: "text-[11.5px] text-muted-foreground", children: [
4244
- Ue(N.path),
4263
+ Ue(S.path),
4245
4264
  " = ",
4246
- /* @__PURE__ */ a("span", { className: "tabular-nums", children: N.value }),
4265
+ /* @__PURE__ */ a("span", { className: "tabular-nums", children: S.value }),
4247
4266
  " ",
4248
4267
  "— the rows behind this number"
4249
4268
  ] })
@@ -4277,5 +4296,5 @@ function Tu({
4277
4296
  );
4278
4297
  }
4279
4298
  export {
4280
- Lp as QueueWorklist
4299
+ Op as QueueWorklist
4281
4300
  };