@nivaro/react 0.3.15 → 0.3.17

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 (37) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +127 -6
  4. package/dist/index.js +736 -734
  5. package/dist/shared/components/CollectionBrowserView.js +2344 -2309
  6. package/dist/shared/components/ItemEditForm.js +3773 -3604
  7. package/dist/shared/components/RecordGridEditor.js +319 -282
  8. package/dist/shared/components/RecordReadView.js +202 -200
  9. package/dist/shared/components/cbv/unknown-fields.js +18 -8
  10. package/dist/shared/components/chat/ChatAnalyticsView.js +2 -2
  11. package/dist/shared/components/import/DocumentAutofillButton.js +148 -142
  12. package/dist/shared/components/item-edit/CatalogPickerField.js +264 -276
  13. package/dist/shared/components/item-edit/FieldRenderer.js +136 -133
  14. package/dist/shared/components/item-edit/FieldRow.js +198 -184
  15. package/dist/shared/components/item-edit/HeaderTools.js +107 -99
  16. package/dist/shared/components/item-edit/InlineTableField.js +138 -136
  17. package/dist/shared/components/item-edit/RecordLiveSync.js +1 -0
  18. package/dist/shared/components/item-edit/RelationCombobox.js +30 -23
  19. package/dist/shared/components/item-edit/SummaryPanel.js +334 -294
  20. package/dist/shared/components/item-edit/column-length.js +12 -0
  21. package/dist/shared/components/panels/AccessDeniedPanel.js +47 -37
  22. package/dist/shared/components/panels/ItemLockBanner.js +307 -285
  23. package/dist/shared/components/panels/PipelinePanel.js +486 -465
  24. package/dist/shared/components/panels/RevisionsPanel.js +210 -204
  25. package/dist/shared/components/pipeline/PipelineEditorView.js +1672 -1568
  26. package/dist/shared/components/profile/DelegationCard.js +178 -121
  27. package/dist/shared/components/profile/PersonActivity.js +152 -139
  28. package/dist/shared/components/queue/QueueWorklist.js +668 -659
  29. package/dist/shared/components/queue/transition-note.js +90 -0
  30. package/dist/shared/components/support/SupportRequestDialog.js +100 -89
  31. package/dist/shared/components/support/TicketDetailSheet.js +104 -91
  32. package/dist/shared/lib/autofill-runs.js +33 -26
  33. package/dist/shared/lib/draft-store.js +40 -24
  34. package/dist/shared/lib/live-queries.js +10 -9
  35. package/dist/shared/lib/request-gate.js +140 -127
  36. package/dist/shared/lib/restore-skipped.js +10 -0
  37. package/package.json +1 -1
@@ -1,28 +1,28 @@
1
1
  import { jsx as e, jsxs as n, Fragment as de } from "react/jsx-runtime";
2
- import { useQueryClient as Oe, useQuery as te, useMutation as he } from "@tanstack/react-query";
3
- import { ArrowRight as Be, Loader2 as se, Check as _e, GitBranch as $e, AlertTriangle as wt, ChevronDown as me, Users as st, Minus as Nt, UserPlus as vt, X as it, Zap as lt, Search as kt } from "lucide-react";
2
+ import { useQueryClient as Oe, useQuery as te, useMutation as xe } from "@tanstack/react-query";
3
+ import { ArrowRight as Fe, Loader2 as se, Check as Ce, GitBranch as Te, AlertTriangle as wt, ChevronDown as me, Users as st, Minus as vt, UserPlus as Nt, X as it, Zap as lt, Search as kt } from "lucide-react";
4
4
  import { useState as K, useRef as ne, useEffect as ue, useMemo as et, Suspense as ot, lazy as _t } from "react";
5
5
  import { toast as ee } from "sonner";
6
6
  import { useNivaroClient as fe, useItemEditAuth as Ct } from "../../context.js";
7
- import { get as ie, post as we, del as St } from "../../lib/commands.js";
7
+ import { get as ie, post as be, del as St } from "../../lib/commands.js";
8
8
  import { useRecordSignalWhile as dt, useRecordSignalPeers as $t, signalSentence as Tt } from "../../lib/presence-signals.js";
9
9
  import { RUN_TRANSITION_EVENT as Ne } from "../../lib/run-transition.js";
10
- import { userErrorMessage as Fe } from "../../lib/safe-error.js";
10
+ import { userErrorMessage as he } from "../../lib/safe-error.js";
11
11
  import { serverNow as qt } from "../../lib/server-clock.js";
12
- import { userCardQuery as At } from "../../lib/user-cards.js";
13
- import { cn as xe, formatRelative as ct, humanHours as Pt } from "../../lib/utils.js";
12
+ import { userCardQuery as Pt } from "../../lib/user-cards.js";
13
+ import { cn as ge, formatRelative as ct, humanHours as At } from "../../lib/utils.js";
14
14
  import { PushReadinessChip as Rt } from "../integrations/RecordIntegrationPreview.js";
15
15
  import { useHeaderFold as Dt } from "../item-edit/HeaderTools.js";
16
- import { invalidateRecordInsights as ve, invalidateRecordData as ke } from "../item-edit/RecordInsights.js";
17
- import { OwnerAvatars as Mt } from "../queue/OwnerAvatars.js";
18
- import { UserAvatar as jt } from "../UserAvatar.js";
16
+ import { invalidateRecordInsights as ke, invalidateRecordData as _e } from "../item-edit/RecordInsights.js";
17
+ import { OwnerAvatars as jt } from "../queue/OwnerAvatars.js";
18
+ import { UserAvatar as Mt } from "../UserAvatar.js";
19
19
  import { Button as Y } from "../ui/button.js";
20
- import { DropdownMenu as qe, DropdownMenuTrigger as Ae, DropdownMenuContent as Pe, DropdownMenuGroup as tt, DropdownMenuSeparator as nt, DropdownMenuItem as ge, DropdownMenuLabel as Lt } from "../ui/dropdown-menu.js";
20
+ import { DropdownMenu as Pe, DropdownMenuTrigger as Ae, DropdownMenuContent as Re, DropdownMenuGroup as tt, DropdownMenuSeparator as nt, DropdownMenuItem as we, DropdownMenuLabel as Bt } from "../ui/dropdown-menu.js";
21
21
  import { Popover as Ee, PopoverTrigger as Ie, PopoverContent as Ue } from "../ui/popover.js";
22
22
  import { Skeleton as le } from "../ui/skeleton.js";
23
- import { TooltipProvider as mt, Tooltip as Re, TooltipTrigger as De, TooltipContent as Me } from "../ui/tooltip.js";
24
- import { isAccessRefusal as ut, deniedToastAction as pt, WhyOwnersButton as Ot } from "./AccessInsights.js";
25
- import { BranchLanes as Bt } from "./BranchLanes.js";
23
+ import { TooltipProvider as mt, Tooltip as De, TooltipTrigger as je, TooltipContent as Me } from "../ui/tooltip.js";
24
+ import { isAccessRefusal as ut, deniedToastAction as pt, WhyOwnersButton as Lt } from "./AccessInsights.js";
25
+ import { BranchLanes as Ot } from "./BranchLanes.js";
26
26
  import { SlaClockLine as Ft } from "./SlaClock.js";
27
27
  const ft = _t(
28
28
  () => import("./TransitionRequirementsDialog.js").then((r) => ({
@@ -47,10 +47,10 @@ function Et(r) {
47
47
  }
48
48
  return null;
49
49
  }
50
- function ye(r) {
50
+ function ve(r) {
51
51
  return !(r.first_name || r.last_name || r.user_email);
52
52
  }
53
- function je(r) {
53
+ function Be(r) {
54
54
  const t = (r.comment ?? "").trim().toLowerCase();
55
55
  return r.origin === "import" || t.startsWith("import:") ? "Imported" : r.origin === "integration" ? "By an integration" : /-state-sync$/.test(t) || t.startsWith("legacy-") ? "Synced from another system" : t === "state-merge" || t === "instance-migration" ? "Moved by an admin script" : "Moved automatically";
56
56
  }
@@ -79,13 +79,13 @@ function Ut({ held: r }) {
79
79
  className: "space-y-2 border-b border-amber-100 bg-amber-50 px-5 py-3 dark:border-amber-500/20 dark:bg-amber-500/10",
80
80
  "data-pipeline-auto-held": !0,
81
81
  children: r.map((t) => {
82
- const u = t.transition_label ?? "An automatic move", i = rt[t.error_class ?? "unknown"] ?? rt.unknown;
82
+ const u = t.transition_label ?? "An automatic move", l = rt[t.error_class ?? "unknown"] ?? rt.unknown;
83
83
  return /* @__PURE__ */ n("div", { className: "text-[12px] text-amber-800 dark:text-amber-300", children: [
84
84
  /* @__PURE__ */ n("p", { className: "font-medium", children: [
85
85
  "Needs a person: ",
86
86
  u,
87
87
  " stopped retrying — ",
88
- i,
88
+ l,
89
89
  "."
90
90
  ] }),
91
91
  t.error && /* @__PURE__ */ e(
@@ -135,55 +135,55 @@ function oe({
135
135
  r
136
136
  );
137
137
  }
138
- function Te(r) {
138
+ function qe(r) {
139
139
  const t = Math.floor(r / 6e4);
140
- return t < 60 ? `${Math.max(1, t)}m` : Pt(r / 36e5);
140
+ return t < 60 ? `${Math.max(1, t)}m` : At(r / 36e5);
141
141
  }
142
142
  function Qt({
143
143
  history: r,
144
144
  completedAt: t
145
145
  }) {
146
146
  const u = [...r].sort(
147
- (f, v) => new Date(f.timestamp).getTime() - new Date(v.timestamp).getTime()
147
+ (f, N) => new Date(f.timestamp).getTime() - new Date(N.timestamp).getTime()
148
148
  );
149
149
  if (u.length === 0) return null;
150
- const i = t ? new Date(t).getTime() : Date.now(), T = u.map((f, v) => {
151
- const q = new Date(f.timestamp).getTime(), D = v + 1 < u.length ? new Date(u[v + 1].timestamp).getTime() : i;
150
+ const l = t ? new Date(t).getTime() : Date.now(), q = u.map((f, N) => {
151
+ const P = new Date(f.timestamp).getTime(), j = N + 1 < u.length ? new Date(u[N + 1].timestamp).getTime() : l;
152
152
  return {
153
153
  key: f.id,
154
154
  label: f.to_state_label,
155
155
  color: f.to_state_color,
156
- ms: Math.max(0, D - q),
157
- current: v === u.length - 1 && !t
156
+ ms: Math.max(0, j - P),
157
+ current: N === u.length - 1 && !t
158
158
  };
159
159
  }).filter((f) => f.ms > 0 || f.current);
160
- if (T.length < 2) return null;
161
- const p = T.reduce((f, v) => f + v.ms, 0);
160
+ if (q.length < 2) return null;
161
+ const p = q.reduce((f, N) => f + N.ms, 0);
162
162
  return p <= 0 ? null : /* @__PURE__ */ n("div", { "data-state-timeline": !0, children: [
163
163
  /* @__PURE__ */ n("div", { className: "mb-1 flex items-center justify-between", children: [
164
164
  /* @__PURE__ */ e("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400 dark:text-slate-500", children: "Time in step" }),
165
165
  /* @__PURE__ */ n("p", { className: "text-[10px] tabular-nums text-slate-400 dark:text-slate-500", children: [
166
- Te(p),
166
+ qe(p),
167
167
  " total",
168
168
  t ? "" : " · so far"
169
169
  ] })
170
170
  ] }),
171
- /* @__PURE__ */ e("div", { className: "flex h-4 w-full overflow-hidden rounded", children: T.map((f) => {
172
- const v = f.ms / p * 100;
171
+ /* @__PURE__ */ e("div", { className: "flex h-4 w-full overflow-hidden rounded", children: q.map((f) => {
172
+ const N = f.ms / p * 100;
173
173
  return /* @__PURE__ */ n(
174
174
  "div",
175
175
  {
176
- "data-tip": `${f.label} — ${Te(f.ms)}${f.current ? " (current)" : ""}`,
176
+ "data-tip": `${f.label} — ${qe(f.ms)}${f.current ? " (current)" : ""}`,
177
177
  className: "relative flex min-w-[8px] items-center overflow-hidden border-r border-white/60 last:border-r-0 dark:border-black/30",
178
178
  style: {
179
- width: `${v}%`,
179
+ width: `${N}%`,
180
180
  backgroundColor: f.color ? `${f.color}55` : "rgba(100,116,139,.25)"
181
181
  },
182
182
  children: [
183
- v >= 14 && /* @__PURE__ */ n("span", { className: "truncate px-1.5 text-[9.5px] font-medium leading-none text-slate-700 dark:text-slate-200", children: [
183
+ N >= 14 && /* @__PURE__ */ n("span", { className: "truncate px-1.5 text-[9.5px] font-medium leading-none text-slate-700 dark:text-slate-200", children: [
184
184
  f.label,
185
185
  " · ",
186
- Te(f.ms)
186
+ qe(f.ms)
187
187
  ] }),
188
188
  f.current && /* @__PURE__ */ e(
189
189
  "span",
@@ -203,47 +203,47 @@ function zt({
203
203
  states: r,
204
204
  allTransitions: t,
205
205
  availableTransitions: u,
206
- currentStateId: i,
207
- history: T,
206
+ currentStateId: l,
207
+ history: q,
208
208
  onPathIds: p,
209
209
  skippedStates: f
210
210
  }) {
211
211
  var S;
212
- const v = ne(null);
212
+ const N = ne(null);
213
213
  ue(() => {
214
- const s = v.current;
215
- if (!s || s.scrollWidth <= s.clientWidth) return;
216
- const w = s.querySelector("[data-track-current]");
214
+ const i = N.current;
215
+ if (!i || i.scrollWidth <= i.clientWidth) return;
216
+ const w = i.querySelector("[data-track-current]");
217
217
  if (!w) return;
218
- const a = s.getBoundingClientRect(), N = w.getBoundingClientRect();
219
- s.scrollLeft += N.left + N.width / 2 - (a.left + a.width / 2);
220
- }, [i]);
221
- const q = new Set(T.map((s) => s.to_state)), D = r.find((s) => s.is_initial);
222
- D && D.id !== i && q.add(D.id);
223
- const x = (S = T[0]) == null ? void 0 : S.from_state;
224
- x && x !== i && q.add(x);
218
+ const s = i.getBoundingClientRect(), v = w.getBoundingClientRect();
219
+ i.scrollLeft += v.left + v.width / 2 - (s.left + s.width / 2);
220
+ }, [l]);
221
+ const P = new Set(q.map((i) => i.to_state)), j = r.find((i) => i.is_initial);
222
+ j && j.id !== l && P.add(j.id);
223
+ const x = (S = q[0]) == null ? void 0 : S.from_state;
224
+ x && x !== l && P.add(x);
225
225
  const R = (() => {
226
226
  if (p)
227
- return r.filter((c) => p.has(c.id) || q.has(c.id) || c.id === i).filter((c) => {
227
+ return r.filter((c) => p.has(c.id) || P.has(c.id) || c.id === l).filter((c) => {
228
228
  const y = c.stage_visibility ?? "always";
229
- return y === "hide" ? !1 : y === "hide_unless_active" ? q.has(c.id) || c.id === i : !0;
229
+ return y === "hide" ? !1 : y === "hide_unless_active" ? P.has(c.id) || c.id === l : !0;
230
230
  }).sort((c, y) => c.sort - y.sort);
231
231
  if (t.length === 0) {
232
- const c = /* @__PURE__ */ new Set([...q]);
233
- return i && c.add(i), r.filter((y) => c.has(y.id)).sort((y, d) => y.sort - d.sort);
232
+ const c = /* @__PURE__ */ new Set([...P]);
233
+ return l && c.add(l), r.filter((y) => c.has(y.id)).sort((y, d) => y.sort - d.sort);
234
234
  }
235
- const s = new Set(
236
- T.filter((c) => c.from_state).map((c) => `${c.from_state}:${c.to_state}`)
237
- ), w = new Set(T.map((c) => c.from_state).filter(Boolean)), a = t.filter((c) => c.from_state !== null), N = /* @__PURE__ */ new Map();
238
- for (const c of a) {
235
+ const i = new Set(
236
+ q.filter((c) => c.from_state).map((c) => `${c.from_state}:${c.to_state}`)
237
+ ), w = new Set(q.map((c) => c.from_state).filter(Boolean)), s = t.filter((c) => c.from_state !== null), v = /* @__PURE__ */ new Map();
238
+ for (const c of s) {
239
239
  const y = c.from_state;
240
- if (w.has(y) && !s.has(`${y}:${c.to_state}`)) continue;
241
- const d = N.get(y) ?? [];
242
- d.push(c.to_state), N.set(y, d);
240
+ if (w.has(y) && !i.has(`${y}:${c.to_state}`)) continue;
241
+ const d = v.get(y) ?? [];
242
+ d.push(c.to_state), v.set(y, d);
243
243
  }
244
- if (i) {
245
- const c = a.filter((y) => y.from_state === i).map((y) => y.to_state);
246
- N.set(i, [
244
+ if (l) {
245
+ const c = s.filter((y) => y.from_state === l).map((y) => y.to_state);
246
+ v.set(l, [
247
247
  .../* @__PURE__ */ new Set([...u.map((y) => y.to_state), ...c])
248
248
  ]);
249
249
  }
@@ -252,69 +252,69 @@ function zt({
252
252
  const c = A.shift();
253
253
  if (!k.has(c)) {
254
254
  k.add(c);
255
- for (const y of N.get(c) ?? []) k.has(y) || A.push(y);
255
+ for (const y of v.get(c) ?? []) k.has(y) || A.push(y);
256
256
  }
257
257
  }
258
- const W = /* @__PURE__ */ new Set([...k, ...q]);
259
- return i && W.add(i), r.filter((c) => W.has(c.id)).filter((c) => {
258
+ const W = /* @__PURE__ */ new Set([...k, ...P]);
259
+ return l && W.add(l), r.filter((c) => W.has(c.id)).filter((c) => {
260
260
  const y = c.stage_visibility ?? "always";
261
- return y === "hide" ? !1 : y === "hide_unless_active" ? q.has(c.id) || c.id === i : !0;
261
+ return y === "hide" ? !1 : y === "hide_unless_active" ? P.has(c.id) || c.id === l : !0;
262
262
  }).sort((c, y) => c.sort - y.sort);
263
263
  })();
264
264
  if (R.length < 2) return null;
265
- const _ = new Map(R.map((s, w) => [s.id, w])), I = new Map(r.map((s) => [s.id, s.label]));
266
- function L(s, w) {
267
- const a = _.get(s);
268
- return a == null ? [] : [...T].filter((N) => {
269
- if (!N.from_state) return !1;
270
- const k = _.get(N.from_state), A = _.get(N.to_state);
271
- return k == null || A == null ? !1 : k === a && A > a || A === a && k > a;
272
- }).sort((N, k) => new Date(N.timestamp).getTime() - new Date(k.timestamp).getTime());
265
+ const C = new Map(R.map((i, w) => [i.id, w])), I = new Map(r.map((i) => [i.id, i.label]));
266
+ function L(i, w) {
267
+ const s = C.get(i);
268
+ return s == null ? [] : [...q].filter((v) => {
269
+ if (!v.from_state) return !1;
270
+ const k = C.get(v.from_state), A = C.get(v.to_state);
271
+ return k == null || A == null ? !1 : k === s && A > s || A === s && k > s;
272
+ }).sort((v, k) => new Date(v.timestamp).getTime() - new Date(k.timestamp).getTime());
273
273
  }
274
- function j(s) {
275
- var w, a, N, k;
276
- return ye(s) ? /* @__PURE__ */ e(lt, { className: "inline h-2.5 w-2.5", "aria-label": je(s) }) : ((((w = s.first_name) == null ? void 0 : w[0]) ?? "") + (((a = s.last_name) == null ? void 0 : a[0]) ?? "")).toUpperCase() || ((k = (N = s.user_email) == null ? void 0 : N[0]) == null ? void 0 : k.toUpperCase()) || "?";
274
+ function B(i) {
275
+ var w, s, v, k;
276
+ return ve(i) ? /* @__PURE__ */ e(lt, { className: "inline h-2.5 w-2.5", "aria-label": Be(i) }) : ((((w = i.first_name) == null ? void 0 : w[0]) ?? "") + (((s = i.last_name) == null ? void 0 : s[0]) ?? "")).toUpperCase() || ((k = (v = i.user_email) == null ? void 0 : v[0]) == null ? void 0 : k.toUpperCase()) || "?";
277
277
  }
278
- function M(s) {
279
- return ht([s.first_name, s.last_name].filter(Boolean).join(" ") || s.user_email, s);
278
+ function M(i) {
279
+ return ht([i.first_name, i.last_name].filter(Boolean).join(" ") || i.user_email, i);
280
280
  }
281
281
  const U = /* @__PURE__ */ new Map();
282
- for (const s of [...T].sort(
283
- (w, a) => new Date(w.timestamp).getTime() - new Date(a.timestamp).getTime()
282
+ for (const i of [...q].sort(
283
+ (w, s) => new Date(w.timestamp).getTime() - new Date(s.timestamp).getTime()
284
284
  )) {
285
- if (!s.from_state) continue;
286
- const w = _.get(s.from_state), a = _.get(s.to_state);
287
- if (!(w == null || a == null || a <= w + 1))
288
- for (let N = w + 1; N < a; N++) {
289
- const k = R[N].id;
290
- !q.has(k) && !U.has(k) && U.set(k, s);
285
+ if (!i.from_state) continue;
286
+ const w = C.get(i.from_state), s = C.get(i.to_state);
287
+ if (!(w == null || s == null || s <= w + 1))
288
+ for (let v = w + 1; v < s; v++) {
289
+ const k = R[v].id;
290
+ !P.has(k) && !U.has(k) && U.set(k, i);
291
291
  }
292
292
  }
293
- function b(s) {
294
- const w = I.get(s.from_state ?? "") ?? "the previous step", a = I.get(s.to_state) ?? "the next step", N = ye(s) ? "it moved automatically" : `${M(s)} moved it`;
295
- return `Passed over on ${new Date(s.timestamp).toLocaleString()} — ${N} straight from ${w} to ${a}`;
293
+ function b(i) {
294
+ const w = I.get(i.from_state ?? "") ?? "the previous step", s = I.get(i.to_state) ?? "the next step", v = ve(i) ? "it moved automatically" : `${M(i)} moved it`;
295
+ return `Passed over on ${new Date(i.timestamp).toLocaleString()} — ${v} straight from ${w} to ${s}`;
296
296
  }
297
- return /* @__PURE__ */ e(mt, { delayDuration: 200, children: /* @__PURE__ */ e("div", { ref: v, className: "overflow-x-auto pt-1.5 pb-1", "data-state-track": !0, children: /* @__PURE__ */ e("div", { className: "flex w-full items-start", children: R.map((s, w) => {
298
- const a = s.id === i, N = q.has(s.id), k = N && !a, A = !N && !a ? U.get(s.id) : void 0, W = !N && !a ? f == null ? void 0 : f.get(s.id) : void 0, c = A || W ? [...A ? [b(A)] : [], ...W ?? []] : void 0, y = c !== void 0, d = s.color ?? "#94a3b8", m = w === R.length - 1, g = m ? null : R[w + 1], C = g ? L(s.id, g.id) : [];
297
+ return /* @__PURE__ */ e(mt, { delayDuration: 200, children: /* @__PURE__ */ e("div", { ref: N, className: "overflow-x-auto pt-1.5 pb-1", "data-state-track": !0, children: /* @__PURE__ */ e("div", { className: "flex w-full items-start", children: R.map((i, w) => {
298
+ const s = i.id === l, v = P.has(i.id), k = v && !s, A = !v && !s ? U.get(i.id) : void 0, W = !v && !s ? f == null ? void 0 : f.get(i.id) : void 0, c = A || W ? [...A ? [b(A)] : [], ...W ?? []] : void 0, y = c !== void 0, d = i.color ?? "#94a3b8", m = w === R.length - 1, g = m ? null : R[w + 1], _ = g ? L(i.id, g.id) : [];
299
299
  return /* @__PURE__ */ n("div", { className: "flex flex-1 items-start", children: [
300
300
  /* @__PURE__ */ n("div", { className: "flex min-w-[76px] flex-1 flex-col items-center gap-1.5 px-1", children: [
301
301
  /* @__PURE__ */ e(
302
302
  "div",
303
303
  {
304
- "data-track-current": a || void 0,
305
- className: `flex h-7 w-7 shrink-0 items-center justify-center rounded-full ${a || k ? "nvr-fill-sweep" : ""}`,
306
- "data-tip": s.description || void 0,
304
+ "data-track-current": s || void 0,
305
+ className: `flex h-7 w-7 shrink-0 items-center justify-center rounded-full ${s || k ? "nvr-fill-sweep" : ""}`,
306
+ "data-tip": i.description || void 0,
307
307
  style: {
308
- backgroundColor: a || k ? d : y ? "transparent" : "#f1f5f9",
309
- border: a || k ? "none" : y ? "1.5px dashed #cbd5e1" : "1.5px solid #e2e8f0",
310
- boxShadow: a ? `0 0 0 3px white, 0 0 0 5px ${d}` : void 0
308
+ backgroundColor: s || k ? d : y ? "transparent" : "#f1f5f9",
309
+ border: s || k ? "none" : y ? "1.5px dashed #cbd5e1" : "1.5px solid #e2e8f0",
310
+ boxShadow: s ? `0 0 0 3px white, 0 0 0 5px ${d}` : void 0
311
311
  },
312
- children: k ? /* @__PURE__ */ e(_e, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : a ? /* @__PURE__ */ e("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : y ? /* @__PURE__ */ e(Nt, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ e("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
312
+ children: k ? /* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5 text-white", strokeWidth: 2.5 }) : s ? /* @__PURE__ */ e("div", { className: "h-2.5 w-2.5 rounded-full bg-white/80" }) : y ? /* @__PURE__ */ e(vt, { className: "h-3 w-3 text-slate-400", strokeWidth: 2.5 }) : /* @__PURE__ */ e("div", { className: "h-2 w-2 rounded-full bg-slate-300" })
313
313
  },
314
- a ? "cur" : k ? "done" : y ? "skip" : "todo"
314
+ s ? "cur" : k ? "done" : y ? "skip" : "todo"
315
315
  ),
316
- y ? /* @__PURE__ */ n(Re, { children: [
317
- /* @__PURE__ */ e(De, { asChild: !0, children: /* @__PURE__ */ e(
316
+ y ? /* @__PURE__ */ n(De, { children: [
317
+ /* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ e(
318
318
  "span",
319
319
  {
320
320
  className: "w-full cursor-help break-words text-center leading-snug",
@@ -326,7 +326,7 @@ function zt({
326
326
  textDecoration: "line-through",
327
327
  textDecorationColor: "#cbd5e1"
328
328
  },
329
- children: s.label
329
+ children: i.label
330
330
  }
331
331
  ) }),
332
332
  /* @__PURE__ */ n(Me, { className: "max-w-[260px]", children: [
@@ -339,11 +339,11 @@ function zt({
339
339
  className: "w-full break-words text-center leading-snug",
340
340
  style: {
341
341
  fontSize: "11px",
342
- color: a ? d : k ? "#475569" : "#94a3b8",
343
- fontWeight: a ? 600 : k ? 500 : 400,
342
+ color: s ? d : k ? "#475569" : "#94a3b8",
343
+ fontWeight: s ? 600 : k ? 500 : 400,
344
344
  wordBreak: "break-word"
345
345
  },
346
- children: s.label
346
+ children: i.label
347
347
  }
348
348
  )
349
349
  ] }),
@@ -372,34 +372,34 @@ function zt({
372
372
  )
373
373
  ] });
374
374
  })(),
375
- C.map((h) => {
376
- const P = h.from_state !== s.id, Q = Math.abs(
377
- (_.get(h.to_state) ?? 0) - (_.get(h.from_state ?? "") ?? 0)
375
+ _.map((h) => {
376
+ const $ = h.from_state !== i.id, Q = Math.abs(
377
+ (C.get(h.to_state) ?? 0) - (C.get(h.from_state ?? "") ?? 0)
378
378
  ) > 1 ? I.get(h.to_state) ?? "" : null;
379
- return /* @__PURE__ */ n(Re, { children: [
380
- /* @__PURE__ */ e(De, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex w-full cursor-default flex-col items-center gap-0.5", children: [
379
+ return /* @__PURE__ */ n(De, { children: [
380
+ /* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex w-full cursor-default flex-col items-center gap-0.5", children: [
381
381
  /* @__PURE__ */ n(
382
382
  "span",
383
383
  {
384
384
  className: "text-center font-mono text-[9px] font-semibold leading-none",
385
- style: { color: P ? "#d97706" : "#475569" },
385
+ style: { color: $ ? "#d97706" : "#475569" },
386
386
  children: [
387
- P && "↩ ",
388
- j(h)
387
+ $ && "↩ ",
388
+ B(h)
389
389
  ]
390
390
  }
391
391
  ),
392
392
  /* @__PURE__ */ e("span", { className: "text-[8.5px] leading-none text-slate-400", children: ct(h.timestamp) })
393
393
  ] }) }),
394
394
  /* @__PURE__ */ n(Me, { side: "top", className: "space-y-0.5 text-[12px]", children: [
395
- ye(h) ? /* @__PURE__ */ n(de, { children: [
395
+ ve(h) ? /* @__PURE__ */ n(de, { children: [
396
396
  /* @__PURE__ */ n("p", { className: "font-medium", children: [
397
- P ? "↩ Sent back · " : "",
398
- je(h)
397
+ $ ? "↩ Sent back · " : "",
398
+ Be(h)
399
399
  ] }),
400
400
  Le(h) && /* @__PURE__ */ e("p", { className: "max-w-[280px] text-muted-foreground", children: Le(h) })
401
401
  ] }) : /* @__PURE__ */ n("p", { className: "font-medium", children: [
402
- P ? "↩ Sent back by" : "Approved by",
402
+ $ ? "↩ Sent back by" : "Approved by",
403
403
  " ",
404
404
  M(h)
405
405
  ] }),
@@ -412,18 +412,18 @@ function zt({
412
412
  ] }, h.id);
413
413
  })
414
414
  ] })
415
- ] }, s.id);
415
+ ] }, i.id);
416
416
  }) }) }) });
417
417
  }
418
418
  function Kt({ history: r }) {
419
419
  return r.length === 0 ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400 italic", children: "No transitions yet." }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: r.map((t) => {
420
- const u = ye(t), i = u ? je(t) : ht([t.first_name, t.last_name].filter(Boolean).join(" ") || t.user_email, t), T = Et(t), p = t.comment && !u && !T ? t.comment : null, f = T ?? (u ? Le(t) : null);
420
+ const u = ve(t), l = u ? Be(t) : ht([t.first_name, t.last_name].filter(Boolean).join(" ") || t.user_email, t), q = Et(t), p = t.comment && !u && !q ? t.comment : null, f = q ?? (u ? Le(t) : null);
421
421
  return /* @__PURE__ */ n("div", { className: "flex items-start gap-2.5 text-[12px]", children: [
422
422
  /* @__PURE__ */ e("div", { className: "mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-slate-200" }),
423
423
  /* @__PURE__ */ n("div", { className: "flex-1 min-w-0", children: [
424
424
  /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
425
425
  t.from_state_label ? /* @__PURE__ */ e(oe, { label: t.from_state_label, color: t.from_state_color, small: !0 }) : /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400 italic", children: "started" }),
426
- /* @__PURE__ */ e(Be, { className: "h-3 w-3 shrink-0 text-slate-300" }),
426
+ /* @__PURE__ */ e(Fe, { className: "h-3 w-3 shrink-0 text-slate-300" }),
427
427
  /* @__PURE__ */ e(oe, { label: t.to_state_label, color: t.to_state_color, small: !0 })
428
428
  ] }),
429
429
  p && /* @__PURE__ */ n("p", { className: "mt-1 text-slate-500 italic", children: [
@@ -438,7 +438,7 @@ function Kt({ history: r }) {
438
438
  "data-history-on-behalf": t.on_behalf_of_name ? t.on_behalf_of ?? "" : void 0,
439
439
  children: [
440
440
  u && /* @__PURE__ */ e(lt, { className: "mr-1 inline h-3 w-3", "aria-hidden": !0 }),
441
- i,
441
+ l,
442
442
  f ? ` · ${f}` : "",
443
443
  " · ",
444
444
  ct(t.timestamp)
@@ -450,32 +450,32 @@ function Kt({ history: r }) {
450
450
  }) });
451
451
  }
452
452
  function Wt({ value: r, onChange: t }) {
453
- const u = fe(), [i, T] = K(!1), [p, f] = K(""), [v, q] = K(""), D = ne(null), x = ne(null);
453
+ const u = fe(), [l, q] = K(!1), [p, f] = K(""), [N, P] = K(""), j = ne(null), x = ne(null);
454
454
  ue(() => {
455
- i ? setTimeout(() => {
455
+ l ? setTimeout(() => {
456
456
  var b;
457
- return (b = D.current) == null ? void 0 : b.focus();
457
+ return (b = j.current) == null ? void 0 : b.focus();
458
458
  }, 50) : f("");
459
- }, [i]), ue(() => (x.current && clearTimeout(x.current), x.current = setTimeout(() => q(p), 250), () => {
459
+ }, [l]), ue(() => (x.current && clearTimeout(x.current), x.current = setTimeout(() => P(p), 250), () => {
460
460
  x.current && clearTimeout(x.current);
461
461
  }), [p]);
462
- const { data: R, isLoading: _ } = te({
463
- queryKey: ["users", "async-search", v],
462
+ const { data: R, isLoading: C } = te({
463
+ queryKey: ["users", "async-search", N],
464
464
  queryFn: () => u.request(
465
465
  ie("/users", {
466
466
  limit: 50,
467
467
  sort: "first_name",
468
- ...v ? { search: v } : {}
468
+ ...N ? { search: N } : {}
469
469
  })
470
470
  ).then((b) => b.data),
471
- enabled: i,
471
+ enabled: l,
472
472
  staleTime: 3e4
473
473
  }), { data: I } = te({
474
- ...At(u, r),
474
+ ...Pt(u, r),
475
475
  enabled: !!r,
476
476
  staleTime: 5 * 6e4
477
- }), L = R ?? [], j = I ?? L.find((b) => b.id === r) ?? null, M = j ? [j.first_name, j.last_name].filter(Boolean).join(" ").trim() || j.email : r ? "Selected person" : null, U = (b) => [b.first_name, b.last_name].filter(Boolean).join(" ").trim();
478
- return /* @__PURE__ */ n(Ee, { open: i, onOpenChange: T, children: [
477
+ }), L = R ?? [], B = I ?? L.find((b) => b.id === r) ?? null, M = B ? [B.first_name, B.last_name].filter(Boolean).join(" ").trim() || B.email : r ? "Selected person" : null, U = (b) => [b.first_name, b.last_name].filter(Boolean).join(" ").trim();
478
+ return /* @__PURE__ */ n(Ee, { open: l, onOpenChange: q, children: [
479
479
  /* @__PURE__ */ n("div", { className: "relative flex h-8 w-full", children: [
480
480
  /* @__PURE__ */ e(Ie, { asChild: !0, children: /* @__PURE__ */ n(
481
481
  "button",
@@ -506,7 +506,7 @@ function Wt({ value: r, onChange: t }) {
506
506
  /* @__PURE__ */ e(
507
507
  "input",
508
508
  {
509
- ref: D,
509
+ ref: j,
510
510
  value: p,
511
511
  onChange: (b) => f(b.target.value),
512
512
  placeholder: "Search users…",
@@ -514,27 +514,27 @@ function Wt({ value: r, onChange: t }) {
514
514
  }
515
515
  )
516
516
  ] }) }),
517
- /* @__PURE__ */ e("div", { className: "max-h-56 overflow-y-auto py-1", children: _ ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-3 py-2 text-[12px] text-slate-400", children: [
517
+ /* @__PURE__ */ e("div", { className: "max-h-56 overflow-y-auto py-1", children: C ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2 px-3 py-2 text-[12px] text-slate-400", children: [
518
518
  /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }),
519
519
  "Loading…"
520
520
  ] }) : L.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-[12px] text-slate-400", children: "No results" }) : L.map((b) => {
521
- const S = U(b), s = S ? `${S} (${b.email})` : b.email, w = b.id === r;
521
+ const S = U(b), i = S ? `${S} (${b.email})` : b.email, w = b.id === r;
522
522
  return /* @__PURE__ */ n(
523
523
  "button",
524
524
  {
525
525
  type: "button",
526
526
  onClick: () => {
527
- t(b.id), T(!1);
527
+ t(b.id), q(!1);
528
528
  },
529
529
  className: `flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] hover:bg-slate-50 ${w ? "font-medium text-slate-800" : "text-slate-600"}`,
530
530
  children: [
531
531
  /* @__PURE__ */ e(
532
- _e,
532
+ Ce,
533
533
  {
534
534
  className: `h-3.5 w-3.5 shrink-0 ${w ? "text-nvr-cyan" : "opacity-0"}`
535
535
  }
536
536
  ),
537
- s
537
+ i
538
538
  ]
539
539
  },
540
540
  b.id
@@ -547,188 +547,209 @@ function Ht({
547
547
  collection: r,
548
548
  item: t,
549
549
  states: u,
550
- currentStateId: i,
551
- returned: T = !1
550
+ currentStateId: l,
551
+ returned: q = !1
552
552
  }) {
553
553
  var O, re, F;
554
- const p = fe(), f = Oe(), { isAdmin: v } = Ct(), [q, D] = K(!1), [x, R] = K(""), [_, I] = K(""), [L, j] = K(!1), M = ["pipeline-instance-owners", r, t], U = ["pipeline-owners-can-add", r, t], b = () => p.request(
554
+ const p = fe(), f = Oe(), { isAdmin: N } = Ct(), [P, j] = K(!1), [x, R] = K(""), [C, I] = K(""), [L, B] = K(!1), M = ["pipeline-instance-owners", r, t], U = ["pipeline-owners-can-add", r, t], b = () => p.request(
555
555
  ie(`/pipelines/instance/${r}/${t}/owners`)
556
- ).then((l) => {
557
- var B;
558
- return f.setQueryData(U, ((B = l.meta) == null ? void 0 : B.can_add) ?? null), l;
559
- }), { data: S, isLoading: s } = te({
556
+ ).then((a) => {
557
+ var D;
558
+ return f.setQueryData(U, ((D = a.meta) == null ? void 0 : D.can_add) ?? null), a;
559
+ }), { data: S, isLoading: i } = te({
560
560
  queryKey: M,
561
- queryFn: () => b().then((l) => l.data)
561
+ queryFn: () => b().then((a) => a.data)
562
562
  }), { data: w } = te({
563
563
  queryKey: U,
564
- queryFn: () => b().then((l) => {
565
- var B;
566
- return ((B = l.meta) == null ? void 0 : B.can_add) ?? null;
564
+ queryFn: () => b().then((a) => {
565
+ var D;
566
+ return ((D = a.meta) == null ? void 0 : D.can_add) ?? null;
567
567
  }),
568
- enabled: !s,
568
+ enabled: !i,
569
569
  staleTime: 3e4
570
- }), a = typeof w == "boolean" ? w : v, { data: N, isLoading: k } = te({
570
+ }), s = typeof w == "boolean" ? w : N, { data: v, isLoading: k } = te({
571
571
  queryKey: ["pipeline-all-owners", r, t],
572
572
  queryFn: () => p.request(
573
573
  ie(`/pipelines/instance/${r}/${t}/owners/all`)
574
- ).then((l) => l.data ?? null),
575
- enabled: !!i,
574
+ ).then((a) => a.data ?? null),
575
+ enabled: !!l,
576
576
  staleTime: 3e4
577
- }), A = new Set((S ?? []).map((l) => l.user)), W = i ? (((O = N == null ? void 0 : N[i]) == null ? void 0 : O.owners) ?? []).filter((l) => !A.has(l.id)) : [], c = W.length + ((S == null ? void 0 : S.length) ?? 0), y = !!((re = u.find((l) => l.id === i)) != null && re.is_initial), d = !s && !k, { data: m } = te({
577
+ }), A = new Set((S ?? []).map((a) => a.user)), W = l ? (((O = v == null ? void 0 : v[l]) == null ? void 0 : O.owners) ?? []).filter((a) => !A.has(a.id)) : [], c = W.length + ((S == null ? void 0 : S.length) ?? 0), y = !!((re = u.find((a) => a.id === l)) != null && re.is_initial), d = !i && !k, { data: m } = te({
578
578
  queryKey: ["pipeline-record-creator", r, t],
579
579
  queryFn: () => p.request(
580
580
  ie(`/pipelines/instance/${r}/${t}/creator`)
581
- ).then((l) => l.data ?? null),
581
+ ).then((a) => a.data ?? null),
582
582
  enabled: y && d && c === 0,
583
583
  staleTime: 6e4
584
- }), g = y && c === 0 && (m != null && m.name) ? m : null, C = () => {
584
+ }), g = y && c === 0 && (m != null && m.name) ? m : null, _ = () => {
585
585
  f.invalidateQueries({ queryKey: M }), f.invalidateQueries({ queryKey: ["pipeline-instance", r, t] });
586
- }, h = he({
586
+ }, h = xe({
587
587
  mutationFn: () => p.request(
588
- we(`/pipelines/instance/${r}/${t}/owners`, {
588
+ be(`/pipelines/instance/${r}/${t}/owners`, {
589
589
  user: x,
590
- state: _ || void 0
590
+ state: C || void 0
591
591
  })
592
592
  ),
593
593
  onSuccess: () => {
594
- C(), R(""), I(""), D(!1), ee.success("Owner added");
594
+ _(), R(""), I(""), j(!1), ee.success("Owner added");
595
595
  },
596
596
  // The server's reason (a 403 says why), not a bare status phrase.
597
- onError: (l) => ee.error(Fe(l, "Failed to add owner"))
598
- }), P = he({
599
- mutationFn: (l) => p.request(St(`/pipelines/instance-owners/${l}`)),
600
- onSuccess: () => {
601
- C(), ee.success("Owner removed");
597
+ onError: (a) => ee.error(he(a, "Failed to add owner"))
598
+ }), $ = xe({
599
+ mutationFn: (a) => p.request(St(`/pipelines/instance-owners/${a.id}`)),
600
+ onSuccess: (a, D) => {
601
+ _();
602
+ const H = [D.first_name, D.last_name].filter(Boolean).join(" ") || D.email;
603
+ ee.success(`${H} removed as an owner`, {
604
+ action: {
605
+ label: "Undo",
606
+ onClick: () => void p.request(
607
+ be(`/pipelines/instance/${r}/${t}/owners`, {
608
+ user: D.user,
609
+ state: D.state || void 0
610
+ })
611
+ ).then(() => _()).catch((V) => ee.error(he(V, "Could not add the owner back")))
612
+ }
613
+ });
602
614
  },
603
- onError: () => ee.error("Failed to remove owner")
604
- }), Q = (l) => {
605
- var Z, X;
606
- const B = ((Z = l.first_name) == null ? void 0 : Z[0]) ?? "", J = ((X = l.last_name) == null ? void 0 : X[0]) ?? "";
607
- return (`${B}${J}`.trim() || l.email[0] || "?").toUpperCase();
608
- }, G = (l) => {
609
- var B;
610
- return l ? ((B = u.find((J) => J.id === l || J.key === l)) == null ? void 0 : B.label) ?? l : null;
615
+ onError: (a) => ee.error(he(a, "Failed to remove owner"))
616
+ }), Q = (a) => {
617
+ var V, Z;
618
+ const D = ((V = a.first_name) == null ? void 0 : V[0]) ?? "", H = ((Z = a.last_name) == null ? void 0 : Z[0]) ?? "";
619
+ return (`${D}${H}`.trim() || a.email[0] || "?").toUpperCase();
620
+ }, J = (a) => {
621
+ var D;
622
+ return a ? ((D = u.find((H) => H.id === a || H.key === a)) == null ? void 0 : D.label) ?? a : null;
611
623
  };
612
624
  return /* @__PURE__ */ n("div", { children: [
613
625
  /* @__PURE__ */ n("div", { className: "mb-3 flex items-center justify-between", children: [
614
626
  /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-400", children: [
615
627
  /* @__PURE__ */ e(st, { className: "h-3.5 w-3.5" }),
616
628
  "Owners",
617
- s || k ? /* @__PURE__ */ e("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : g ? null : /* @__PURE__ */ n("span", { className: "text-slate-300", children: [
629
+ i || k ? /* @__PURE__ */ e("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : g ? null : /* @__PURE__ */ n("span", { className: "text-slate-300", children: [
618
630
  "(",
619
631
  c,
620
632
  ")"
621
633
  ] })
622
634
  ] }),
623
635
  /* @__PURE__ */ n("span", { className: "flex items-center gap-3", children: [
624
- i && /* @__PURE__ */ e(Ot, { collection: r, itemId: String(t) }),
625
- !q && a && /* @__PURE__ */ n(
636
+ l && /* @__PURE__ */ e(Lt, { collection: r, itemId: String(t) }),
637
+ !P && s && /* @__PURE__ */ n(
626
638
  "button",
627
639
  {
628
640
  type: "button",
629
- onClick: () => D(!0),
641
+ onClick: () => j(!0),
630
642
  className: "flex items-center gap-1 text-[11px] text-slate-400 transition-colors hover:text-nvr-cyan",
631
643
  children: [
632
- /* @__PURE__ */ e(vt, { className: "h-3 w-3" }),
644
+ /* @__PURE__ */ e(Nt, { className: "h-3 w-3" }),
633
645
  "Add"
634
646
  ]
635
647
  }
636
648
  )
637
649
  ] })
638
650
  ] }),
639
- s || k ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2 py-1.5 text-[12px] text-slate-400", children: [
651
+ i || k ? /* @__PURE__ */ n("div", { className: "flex items-center gap-2 py-1.5 text-[12px] text-slate-400", children: [
640
652
  /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }),
641
653
  "Resolving owners…"
642
654
  ] }) : g ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
643
- T ? "Back with" : "With",
655
+ q ? "Back with" : "With",
644
656
  " ",
645
657
  /* @__PURE__ */ e("span", { className: "font-medium text-slate-700 dark:text-foreground", children: g.name })
646
658
  ] }) : c === 0 ? /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "No owners assigned." }) : /* @__PURE__ */ n("div", { className: "space-y-px", children: [
647
- W.map((l) => {
648
- var Z, X;
649
- const B = [l.first_name, l.last_name].filter(Boolean).join(" ") || l.email, J = (`${((Z = l.first_name) == null ? void 0 : Z[0]) ?? ""}${((X = l.last_name) == null ? void 0 : X[0]) ?? ""}`.trim() || l.email[0] || "?").toUpperCase();
659
+ W.map((a) => {
660
+ var V, Z;
661
+ const D = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email, H = (`${((V = a.first_name) == null ? void 0 : V[0]) ?? ""}${((Z = a.last_name) == null ? void 0 : Z[0]) ?? ""}`.trim() || a.email[0] || "?").toUpperCase();
650
662
  return /* @__PURE__ */ n(
651
663
  "div",
652
664
  {
653
665
  className: "-mx-2 flex items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-slate-50",
654
666
  children: [
655
667
  /* @__PURE__ */ e(
656
- jt,
668
+ Mt,
657
669
  {
658
- userId: l.id,
659
- alt: B,
670
+ userId: a.id,
671
+ alt: D,
660
672
  className: "h-6 w-6",
661
- fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 select-none items-center justify-center rounded-full bg-nvr-cyan/10 text-[10px] font-semibold text-nvr-navy/80", children: J })
673
+ fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 select-none items-center justify-center rounded-full bg-nvr-cyan/10 text-[10px] font-semibold text-nvr-navy/80", children: H })
662
674
  }
663
675
  ),
664
676
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
665
- /* @__PURE__ */ e("span", { className: "block truncate text-[12px] font-medium text-slate-700", children: B }),
666
- /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: l.email })
677
+ /* @__PURE__ */ e("span", { className: "block truncate text-[12px] font-medium text-slate-700", children: D }),
678
+ /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: a.email })
667
679
  ] }),
668
- /* @__PURE__ */ e("span", { className: "shrink-0 rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-navy/70 dark:text-nvr-cyan", children: "owner group" })
680
+ a.queue_only ? /* @__PURE__ */ e(
681
+ "span",
682
+ {
683
+ className: "shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] font-medium text-slate-500 dark:bg-slate-800 dark:text-slate-400",
684
+ "data-tip": "The record is in their queue, but only the step’s owners can move it",
685
+ children: "in their queue"
686
+ }
687
+ ) : /* @__PURE__ */ e("span", { className: "shrink-0 rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[10px] font-medium text-nvr-navy/70 dark:text-nvr-cyan", children: "owner group" })
669
688
  ]
670
689
  },
671
- `group-${l.id}`
690
+ `group-${a.id}`
672
691
  );
673
692
  }),
674
- (S ?? []).map((l) => /* @__PURE__ */ n(
693
+ (S ?? []).map((a) => /* @__PURE__ */ n(
675
694
  "div",
676
695
  {
677
696
  className: "group -mx-2 flex items-center gap-2.5 rounded-md px-2 py-1.5 transition-colors hover:bg-slate-50",
678
697
  children: [
679
- /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 select-none items-center justify-center rounded-full bg-nvr-cyan/10 text-[10px] font-semibold text-nvr-navy/80", children: Q(l) }),
698
+ /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 select-none items-center justify-center rounded-full bg-nvr-cyan/10 text-[10px] font-semibold text-nvr-navy/80", children: Q(a) }),
680
699
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
681
- /* @__PURE__ */ e("span", { className: "block truncate text-[12px] font-medium text-slate-700", children: [l.first_name, l.last_name].filter(Boolean).join(" ") || l.email }),
682
- /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: l.email })
700
+ /* @__PURE__ */ e("span", { className: "block truncate text-[12px] font-medium text-slate-700", children: [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email }),
701
+ /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: a.email })
683
702
  ] }),
684
703
  /* @__PURE__ */ e("span", { className: "shrink-0 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-500/10 dark:text-amber-400", children: "manual" }),
685
- /* @__PURE__ */ e("span", { className: "shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] text-slate-500", children: l.state ? G(l.state) : "all states" }),
704
+ /* @__PURE__ */ e("span", { className: "shrink-0 rounded-full bg-slate-100 px-1.5 py-0.5 text-[10px] text-slate-500", children: a.state ? J(a.state) : "all states" }),
686
705
  /* @__PURE__ */ e(
687
706
  "button",
688
707
  {
689
708
  type: "button",
690
- onClick: () => P.mutate(l.id),
691
- className: "shrink-0 rounded p-0.5 text-slate-300 opacity-0 transition-all hover:text-red-500 group-hover:opacity-100",
709
+ "aria-label": `Remove ${[a.first_name, a.last_name].filter(Boolean).join(" ") || a.email} as an owner`,
710
+ disabled: $.isPending,
711
+ onClick: () => $.mutate(a),
712
+ className: "shrink-0 rounded p-0.5 text-slate-300 opacity-0 transition-all hover:text-red-500 focus-visible:opacity-100 group-hover:opacity-100",
692
713
  children: /* @__PURE__ */ e(it, { className: "h-3 w-3" })
693
714
  }
694
715
  )
695
716
  ]
696
717
  },
697
- l.id
718
+ a.id
698
719
  ))
699
720
  ] }),
700
- q && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3", children: [
721
+ P && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2 rounded-lg border border-slate-200 bg-slate-50 dark:bg-slate-900/30 dark:border-border p-3", children: [
701
722
  /* @__PURE__ */ e("p", { className: "text-[11px] font-semibold text-slate-500", children: "Add owner" }),
702
723
  /* @__PURE__ */ e(Wt, { value: x, onChange: R }),
703
- v ? /* @__PURE__ */ n(Ee, { open: L, onOpenChange: j, children: [
724
+ N ? /* @__PURE__ */ n(Ee, { open: L, onOpenChange: B, children: [
704
725
  /* @__PURE__ */ e(Ie, { asChild: !0, children: /* @__PURE__ */ n(
705
726
  "button",
706
727
  {
707
728
  type: "button",
708
729
  className: "flex h-8 w-full items-center justify-between rounded-md border border-slate-200 bg-white px-2.5 text-left text-[13px] text-slate-700 transition-colors hover:border-slate-300 dark:border-border dark:bg-transparent dark:text-slate-300",
709
730
  children: [
710
- /* @__PURE__ */ e("span", { className: "truncate", children: _ ? ((F = u.find((l) => l.id === _)) == null ? void 0 : F.label) ?? _ : "All states" }),
731
+ /* @__PURE__ */ e("span", { className: "truncate", children: C ? ((F = u.find((a) => a.id === C)) == null ? void 0 : F.label) ?? C : "All states" }),
711
732
  /* @__PURE__ */ e(me, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
712
733
  ]
713
734
  }
714
735
  ) }),
715
- /* @__PURE__ */ e(Ue, { align: "start", sideOffset: 4, className: "w-52 p-1", children: ["", ...u.map((l) => l.id)].map((l) => {
716
- var Z;
717
- const B = l === "" ? "All states" : ((Z = u.find((X) => X.id === l)) == null ? void 0 : Z.label) ?? l;
736
+ /* @__PURE__ */ e(Ue, { align: "start", sideOffset: 4, className: "w-52 p-1", children: ["", ...u.map((a) => a.id)].map((a) => {
737
+ var V;
738
+ const D = a === "" ? "All states" : ((V = u.find((Z) => Z.id === a)) == null ? void 0 : V.label) ?? a;
718
739
  return /* @__PURE__ */ e(
719
740
  "button",
720
741
  {
721
742
  type: "button",
722
- className: xe(
743
+ className: ge(
723
744
  "flex w-full rounded px-2.5 py-1.5 text-left text-[13px] transition-colors hover:bg-slate-50 dark:hover:bg-white/5",
724
- _ === l && "font-medium text-slate-800 dark:text-slate-200"
745
+ C === a && "font-medium text-slate-800 dark:text-slate-200"
725
746
  ),
726
747
  onClick: () => {
727
- I(l), j(!1);
748
+ I(a), B(!1);
728
749
  },
729
- children: B
750
+ children: D
730
751
  },
731
- l
752
+ a
732
753
  );
733
754
  }) })
734
755
  ] }) : /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: "Hands off the current step." }),
@@ -741,7 +762,7 @@ function Ht({
741
762
  variant: "ghost",
742
763
  className: "h-7 text-[12px]",
743
764
  onClick: () => {
744
- D(!1), R(""), I("");
765
+ j(!1), R(""), I("");
745
766
  },
746
767
  children: "Cancel"
747
768
  }
@@ -770,18 +791,18 @@ function Vt({
770
791
  collection: r,
771
792
  item: t,
772
793
  states: u,
773
- currentStateId: i
794
+ currentStateId: l
774
795
  }) {
775
- const T = fe(), [p, f] = K(!1), { data: v, isLoading: q } = te({
796
+ const q = fe(), [p, f] = K(!1), { data: N, isLoading: P } = te({
776
797
  queryKey: ["pipeline-all-owners", r, t],
777
- queryFn: () => T.request(
798
+ queryFn: () => q.request(
778
799
  ie(`/pipelines/instance/${r}/${t}/owners/all`)
779
800
  ).then((x) => x.data ?? null),
780
801
  enabled: p,
781
802
  staleTime: 3e4
782
- }), D = [...u].filter((x) => {
803
+ }), j = [...u].filter((x) => {
783
804
  var R;
784
- return !v || ((R = v[x.id]) == null ? void 0 : R.on_path) !== !1;
805
+ return !N || ((R = N[x.id]) == null ? void 0 : R.on_path) !== !1;
785
806
  }).sort((x, R) => x.sort - R.sort);
786
807
  return /* @__PURE__ */ n(Ee, { open: p, onOpenChange: f, children: [
787
808
  /* @__PURE__ */ e(Ie, { asChild: !0, children: /* @__PURE__ */ e(
@@ -799,22 +820,22 @@ function Vt({
799
820
  /* @__PURE__ */ e("p", { className: "text-[12px] font-semibold text-slate-700", children: "Approval Chain" }),
800
821
  /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-400 mt-0.5", children: "Owners per pipeline state" })
801
822
  ] }),
802
- /* @__PURE__ */ e("div", { className: "max-h-[504px] overflow-y-auto", children: q ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((x) => /* @__PURE__ */ e(le, { className: "h-10 w-full" }, x)) }) : v ? /* @__PURE__ */ e("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: D.map((x) => {
803
- var U, b, S, s, w;
804
- const R = (((U = v[x.id]) == null ? void 0 : U.owners) ?? []).map((a) => ({
805
- id: a.id,
806
- name: [a.first_name, a.last_name].filter(Boolean).join(" ") || a.email
807
- })), _ = x.id === i, I = ((b = v[x.id]) == null ? void 0 : b.skipped) === !0 && !_, L = (((S = v[x.id]) == null ? void 0 : S.skip_reasons) ?? []).filter(Boolean), j = ((s = v[x.id]) == null ? void 0 : s.unavailable) ?? [], M = ((w = v[x.id]) == null ? void 0 : w.blocked) === !0 && !I;
823
+ /* @__PURE__ */ e("div", { className: "max-h-[504px] overflow-y-auto", children: P ? /* @__PURE__ */ e("div", { className: "space-y-px p-3", children: [1, 2, 3].map((x) => /* @__PURE__ */ e(le, { className: "h-10 w-full" }, x)) }) : N ? /* @__PURE__ */ e("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: j.map((x) => {
824
+ var U, b, S, i, w;
825
+ const R = (((U = N[x.id]) == null ? void 0 : U.owners) ?? []).map((s) => ({
826
+ id: s.id,
827
+ name: [s.first_name, s.last_name].filter(Boolean).join(" ") || s.email
828
+ })), C = x.id === l, I = ((b = N[x.id]) == null ? void 0 : b.skipped) === !0 && !C, L = (((S = N[x.id]) == null ? void 0 : S.skip_reasons) ?? []).filter(Boolean), B = ((i = N[x.id]) == null ? void 0 : i.unavailable) ?? [], M = ((w = N[x.id]) == null ? void 0 : w.blocked) === !0 && !I;
808
829
  return /* @__PURE__ */ n(
809
830
  "div",
810
831
  {
811
- className: xe(
832
+ className: ge(
812
833
  "flex items-center gap-3 px-4 py-2.5",
813
834
  // Hex-with-alpha rather than bg-nvr-cyan/N — the
814
835
  // nvr-cyan token is an opaque var() so Tailwind silently
815
836
  // drops opacity modifiers on it. Kept very light so the
816
837
  // tint doesn't clash with the state badge's own color.
817
- _ && "bg-nvr-cyan/[0.06] dark:bg-nvr-cyan/[0.11]",
838
+ C && "bg-nvr-cyan/[0.06] dark:bg-nvr-cyan/[0.11]",
818
839
  I && "opacity-60",
819
840
  M && "bg-red-50 dark:bg-red-500/10"
820
841
  ),
@@ -825,8 +846,8 @@ function Vt({
825
846
  // Radix tooltip with zero delay — native `title` waits on
826
847
  // the OS hover timer, and a truncated reason needs its
827
848
  // full text the moment the cursor lands on it.
828
- /* @__PURE__ */ e(mt, { delayDuration: 0, children: /* @__PURE__ */ n(Re, { children: [
829
- /* @__PURE__ */ e(De, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 cursor-default items-center gap-2", children: [
849
+ /* @__PURE__ */ e(mt, { delayDuration: 0, children: /* @__PURE__ */ n(De, { children: [
850
+ /* @__PURE__ */ e(je, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 cursor-default items-center gap-2", children: [
830
851
  /* @__PURE__ */ e("span", { className: "inline-flex shrink-0 items-center gap-1 rounded-full border border-dashed border-slate-300 px-2 py-0.5 text-[10.5px] font-medium text-slate-400 dark:border-slate-600 dark:text-slate-500", children: "Skipped" }),
831
852
  L.length > 0 && /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[11px] text-slate-400 dark:text-slate-500", children: L.join(" · ") })
832
853
  ] }) }),
@@ -838,30 +859,30 @@ function Vt({
838
859
  className: "max-w-[420px] space-y-0.5 text-[11.5px] leading-snug",
839
860
  children: [
840
861
  /* @__PURE__ */ e("p", { className: "text-slate-500 dark:text-slate-400", children: "The pipeline will pass through this state without stopping:" }),
841
- L.length > 0 ? L.map((a) => /* @__PURE__ */ e("p", { children: a }, a)) : /* @__PURE__ */ e("p", { children: "Skip criteria currently match" })
862
+ L.length > 0 ? L.map((s) => /* @__PURE__ */ e("p", { children: s }, s)) : /* @__PURE__ */ e("p", { children: "Skip criteria currently match" })
842
863
  ]
843
864
  }
844
865
  )
845
866
  ] }) })
846
867
  ) : /* @__PURE__ */ n(de, { children: [
847
- /* @__PURE__ */ e(Mt, { owners: R, max: 10, emptyLabel: "—" }),
848
- j.map((a) => /* @__PURE__ */ n(
868
+ /* @__PURE__ */ e(jt, { owners: R, max: 10, emptyLabel: "—" }),
869
+ B.map((s) => /* @__PURE__ */ n(
849
870
  "span",
850
871
  {
851
- "data-tip": `${a.name} is ${at[a.reason] ?? a.reason}${a.delegate ? ` — ${a.delegate.name} covers${a.delegate.expires_at ? ` until ${new Date(a.delegate.expires_at).toLocaleDateString()}` : ""}` : " and nobody is covering"}`,
852
- className: xe(
872
+ "data-tip": `${s.name} is ${at[s.reason] ?? s.reason}${s.delegate ? ` — ${s.delegate.name} covers${s.delegate.expires_at ? ` until ${new Date(s.delegate.expires_at).toLocaleDateString()}` : ""}` : " and nobody is covering"}`,
873
+ className: ge(
853
874
  "inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10.5px] font-medium",
854
- a.delegate ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200" : "border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300"
875
+ s.delegate ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200" : "border-red-200 bg-red-50 text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300"
855
876
  ),
856
877
  children: [
857
- a.name,
858
- a.delegate ? /* @__PURE__ */ n(de, { children: [
878
+ s.name,
879
+ s.delegate ? /* @__PURE__ */ n(de, { children: [
859
880
  " → ",
860
- a.delegate.name,
861
- a.delegate.expires_at && /* @__PURE__ */ n("span", { className: "opacity-70", children: [
881
+ s.delegate.name,
882
+ s.delegate.expires_at && /* @__PURE__ */ n("span", { className: "opacity-70", children: [
862
883
  ", until",
863
884
  " ",
864
- new Date(a.delegate.expires_at).toLocaleDateString(
885
+ new Date(s.delegate.expires_at).toLocaleDateString(
865
886
  void 0,
866
887
  {
867
888
  month: "short",
@@ -872,11 +893,11 @@ function Vt({
872
893
  ] }) : /* @__PURE__ */ n("span", { className: "opacity-80", children: [
873
894
  " ",
874
895
  "· ",
875
- at[a.reason] ?? a.reason
896
+ at[s.reason] ?? s.reason
876
897
  ] })
877
898
  ]
878
899
  },
879
- a.id
900
+ s.id
880
901
  )),
881
902
  M && /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1 rounded-full bg-red-600 px-2 py-0.5 text-[10.5px] font-semibold text-white", children: "No one can act here" })
882
903
  ] }) })
@@ -892,13 +913,13 @@ function _n({
892
913
  collection: r,
893
914
  item: t,
894
915
  defaultExpanded: u,
895
- title: i,
896
- showApprovalChain: T,
916
+ title: l,
917
+ showApprovalChain: q,
897
918
  hideActionsCollapsed: p,
898
919
  hideActionsExpanded: f,
899
- onBeforeTransition: v,
900
- addendumPending: q,
901
- addendumView: D,
920
+ onBeforeTransition: N,
921
+ addendumPending: P,
922
+ addendumView: j,
902
923
  asRole: x
903
924
  }) {
904
925
  return t === "new" ? null : /* @__PURE__ */ e(
@@ -907,27 +928,27 @@ function _n({
907
928
  collection: r,
908
929
  item: t,
909
930
  defaultExpanded: u,
910
- title: i,
911
- showApprovalChain: T,
931
+ title: l,
932
+ showApprovalChain: q,
912
933
  hideActionsCollapsed: p,
913
934
  hideActionsExpanded: f,
914
- onBeforeTransition: v,
915
- addendumPending: q,
916
- addendumView: D,
935
+ onBeforeTransition: N,
936
+ addendumPending: P,
937
+ addendumView: j,
917
938
  asRole: x
918
939
  },
919
940
  `${r}:${t}`
920
941
  );
921
942
  }
922
943
  function gt({ collection: r, item: t }) {
923
- const u = fe(), { data: i } = te({
944
+ const u = fe(), { data: l } = te({
924
945
  queryKey: ["approval-brief", r, String(t)],
925
946
  queryFn: () => u.request(ie(`/pipelines/instance/${r}/${t}/approval-brief`)).then((p) => p.data),
926
947
  staleTime: 3e4,
927
948
  retry: !1
928
949
  });
929
- if (!i) return null;
930
- const T = (p) => {
950
+ if (!l) return null;
951
+ const q = (p) => {
931
952
  if (p == null || p === "") return "—";
932
953
  const f = String(p);
933
954
  return f.length > 36 ? `${f.slice(0, 36)}…` : f;
@@ -937,34 +958,34 @@ function gt({ collection: r, item: t }) {
937
958
  /* @__PURE__ */ e("span", { className: "font-medium text-slate-700 dark:text-foreground", children: "Since entering this state" }),
938
959
  " ",
939
960
  "(",
940
- i.days_in_state,
961
+ l.days_in_state,
941
962
  "d ago):",
942
963
  " ",
943
- i.changed_total === 0 && i.comments === 0 && i.addendums.count === 0 ? /* @__PURE__ */ e("span", { children: "no changes to this record." }) : /* @__PURE__ */ n(de, { children: [
944
- i.changed_total > 0 && /* @__PURE__ */ n("span", { children: [
945
- i.changed_total,
964
+ l.changed_total === 0 && l.comments === 0 && l.addendums.count === 0 ? /* @__PURE__ */ e("span", { children: "no changes to this record." }) : /* @__PURE__ */ n(de, { children: [
965
+ l.changed_total > 0 && /* @__PURE__ */ n("span", { children: [
966
+ l.changed_total,
946
967
  " field",
947
- i.changed_total === 1 ? "" : "s",
968
+ l.changed_total === 1 ? "" : "s",
948
969
  " changed",
949
- i.edited_by.length > 0 ? ` by ${i.edited_by.join(", ")}` : ""
970
+ l.edited_by.length > 0 ? ` by ${l.edited_by.join(", ")}` : ""
950
971
  ] }),
951
- i.comments > 0 && /* @__PURE__ */ n("span", { children: [
952
- i.changed_total > 0 ? " · " : "",
953
- i.comments,
972
+ l.comments > 0 && /* @__PURE__ */ n("span", { children: [
973
+ l.changed_total > 0 ? " · " : "",
974
+ l.comments,
954
975
  " comment",
955
- i.comments === 1 ? "" : "s"
976
+ l.comments === 1 ? "" : "s"
956
977
  ] }),
957
- i.addendums.count > 0 && /* @__PURE__ */ n("span", { children: [
978
+ l.addendums.count > 0 && /* @__PURE__ */ n("span", { children: [
958
979
  " · ",
959
- i.addendums.count,
980
+ l.addendums.count,
960
981
  " addendum",
961
- i.addendums.count === 1 ? "" : "s",
962
- i.addendums.cost_impact !== 0 ? ` (${i.addendums.cost_impact > 0 ? "+" : ""}$${Math.abs(i.addendums.cost_impact).toLocaleString()})` : ""
982
+ l.addendums.count === 1 ? "" : "s",
983
+ l.addendums.cost_impact !== 0 ? ` (${l.addendums.cost_impact > 0 ? "+" : ""}$${Math.abs(l.addendums.cost_impact).toLocaleString()})` : ""
963
984
  ] })
964
985
  ] })
965
986
  ] }),
966
- i.field_changes.length > 0 && /* @__PURE__ */ n("div", { className: "mt-1 space-y-0.5", children: [
967
- i.field_changes.slice(0, 5).map((p) => /* @__PURE__ */ n(
987
+ l.field_changes.length > 0 && /* @__PURE__ */ n("div", { className: "mt-1 space-y-0.5", children: [
988
+ l.field_changes.slice(0, 5).map((p) => /* @__PURE__ */ n(
968
989
  "p",
969
990
  {
970
991
  className: "font-mono text-[10.5px] text-slate-500 dark:text-muted-foreground",
@@ -973,21 +994,21 @@ function gt({ collection: r, item: t }) {
973
994
  ":",
974
995
  " ",
975
996
  p.old !== void 0 && /* @__PURE__ */ n(de, { children: [
976
- /* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: T(p.old) }),
997
+ /* @__PURE__ */ e("span", { className: "text-red-600 line-through dark:text-red-400", children: q(p.old) }),
977
998
  " "
978
999
  ] }),
979
- /* @__PURE__ */ e("span", { className: "text-emerald-600 dark:text-emerald-400", children: T(p.new) })
1000
+ /* @__PURE__ */ e("span", { className: "text-emerald-600 dark:text-emerald-400", children: q(p.new) })
980
1001
  ]
981
1002
  },
982
1003
  p.field
983
1004
  )),
984
- i.field_changes.length > 5 && /* @__PURE__ */ n("p", { className: "text-[10.5px] text-slate-400", children: [
1005
+ l.field_changes.length > 5 && /* @__PURE__ */ n("p", { className: "text-[10.5px] text-slate-400", children: [
985
1006
  "+",
986
- i.field_changes.length - 5,
1007
+ l.field_changes.length - 5,
987
1008
  " more — see History for the full trail"
988
1009
  ] })
989
1010
  ] }),
990
- (i.lines ?? []).map((p) => /* @__PURE__ */ n(
1011
+ (l.lines ?? []).map((p) => /* @__PURE__ */ n(
991
1012
  "p",
992
1013
  {
993
1014
  "data-brief-line": p.label,
@@ -1012,45 +1033,45 @@ function Gt({
1012
1033
  collection: r,
1013
1034
  item: t,
1014
1035
  defaultExpanded: u,
1015
- title: i,
1016
- showApprovalChain: T,
1036
+ title: l,
1037
+ showApprovalChain: q,
1017
1038
  hideActionsCollapsed: p,
1018
1039
  hideActionsExpanded: f,
1019
- onBeforeTransition: v,
1020
- addendumPending: q,
1021
- addendumView: D,
1040
+ onBeforeTransition: N,
1041
+ addendumPending: P,
1042
+ addendumView: j,
1022
1043
  asRole: x
1023
1044
  }) {
1024
1045
  var We, He, Ve;
1025
- const R = fe(), _ = Oe(), [I, L] = K(""), [j, M] = K(null), [U, b] = K(!1), [S, s] = K(!1), [w, a] = K(null);
1026
- dt(r, t, "transition", !!j || !!w);
1027
- const N = $t(r, t, "transition"), k = ne(!1);
1046
+ const R = fe(), C = Oe(), [I, L] = K(""), [B, M] = K(null), [U, b] = K(!1), [S, i] = K(!1), [w, s] = K(null);
1047
+ dt(r, t, "transition", !!B || !!w);
1048
+ const v = $t(r, t, "transition"), k = ne(!1);
1028
1049
  ue(() => {
1029
- !k.current && u !== void 0 && (k.current = !0, s(u));
1050
+ !k.current && u !== void 0 && (k.current = !0, i(u));
1030
1051
  }, [u]);
1031
1052
  const A = ne(!1), W = (o) => {
1032
- A.current || (A.current = !0, G.mutate(o, {
1053
+ A.current || (A.current = !0, J.mutate(o, {
1033
1054
  onSettled: () => {
1034
1055
  A.current = !1;
1035
1056
  }
1036
1057
  }));
1037
1058
  }, c = async (o) => {
1038
1059
  if (A.current) return;
1039
- if (j === o) {
1060
+ if (B === o) {
1040
1061
  M(null);
1041
1062
  return;
1042
1063
  }
1043
- if (v) {
1064
+ if (N) {
1044
1065
  A.current = !0;
1045
1066
  let z = !1;
1046
1067
  try {
1047
- z = await v();
1068
+ z = await N();
1048
1069
  } finally {
1049
1070
  A.current = !1;
1050
1071
  }
1051
1072
  if (!z) return;
1052
1073
  }
1053
- const $ = (l ?? []).find((z) => z.id === o), E = String(($ == null ? void 0 : $.comment_mode) ?? "none");
1074
+ const T = (a ?? []).find((z) => z.id === o), E = String((T == null ? void 0 : T.comment_mode) ?? "none");
1054
1075
  if (E !== "optional" && E !== "required") {
1055
1076
  W({ transition_id: o });
1056
1077
  return;
@@ -1075,14 +1096,14 @@ function Gt({
1075
1096
  staleTime: 1e4
1076
1097
  });
1077
1098
  ue(
1078
- () => _.getQueryCache().subscribe((o) => {
1099
+ () => C.getQueryCache().subscribe((o) => {
1079
1100
  if (o.type !== "updated" || o.action.type !== "success") return;
1080
- const $ = o.query.queryKey;
1081
- Array.isArray($) && $[0] === "item" && $[1] === r && String($[2]) === t && _.invalidateQueries({ queryKey: ["pipeline-instance", r, t] });
1101
+ const T = o.query.queryKey;
1102
+ Array.isArray(T) && T[0] === "item" && T[1] === r && String(T[2]) === t && C.invalidateQueries({ queryKey: ["pipeline-instance", r, t] });
1082
1103
  }),
1083
- [_, r, t]
1104
+ [C, r, t]
1084
1105
  );
1085
- const { data: g, isLoading: C } = te({
1106
+ const { data: g, isLoading: _ } = te({
1086
1107
  queryKey: ["pipeline-all-owners", r, t],
1087
1108
  queryFn: () => R.request(
1088
1109
  ie(`/pipelines/instance/${r}/${t}/owners/all`)
@@ -1092,51 +1113,51 @@ function Gt({
1092
1113
  }), h = et(() => {
1093
1114
  if (!g) return null;
1094
1115
  const o = Object.entries(g);
1095
- return o.length === 0 || o.every(([, $]) => $.on_path === void 0) ? null : new Set(o.filter(([, $]) => $.on_path !== !1).map(([$]) => $));
1096
- }, [g]), P = et(() => {
1116
+ return o.length === 0 || o.every(([, T]) => T.on_path === void 0) ? null : new Set(o.filter(([, T]) => T.on_path !== !1).map(([T]) => T));
1117
+ }, [g]), $ = et(() => {
1097
1118
  if (!g) return null;
1098
1119
  const o = /* @__PURE__ */ new Map();
1099
- for (const [$, E] of Object.entries(g))
1100
- E.skipped && o.set($, E.skip_reasons ?? []);
1120
+ for (const [T, E] of Object.entries(g))
1121
+ E.skipped && o.set(T, E.skip_reasons ?? []);
1101
1122
  return o;
1102
- }, [g]), Q = he({
1103
- mutationFn: () => R.request(we(`/pipelines/instance/${r}/${t}/start`, {})),
1123
+ }, [g]), Q = xe({
1124
+ mutationFn: () => R.request(be(`/pipelines/instance/${r}/${t}/start`, {})),
1104
1125
  onSuccess: () => {
1105
- _.invalidateQueries({ queryKey: y }), ee.success("Pipeline started");
1126
+ C.invalidateQueries({ queryKey: y }), ee.success("Pipeline started");
1106
1127
  },
1107
1128
  onError: () => ee.error("Failed to start pipeline")
1108
- }), G = he({
1129
+ }), J = xe({
1109
1130
  mutationFn: ({
1110
1131
  transition_id: o,
1111
- comment: $,
1132
+ comment: T,
1112
1133
  reviewed: E
1113
1134
  }) => R.request(
1114
- we(`/pipelines/instance/${r}/${t}/transition`, {
1135
+ be(`/pipelines/instance/${r}/${t}/transition`, {
1115
1136
  transition_id: o,
1116
- comment: $,
1137
+ comment: T,
1117
1138
  ...E ? { reviewed: !0 } : {}
1118
1139
  })
1119
1140
  ),
1120
1141
  onSuccess: () => {
1121
- _.invalidateQueries({ queryKey: y }), r === "nivaro_addendums" && _.invalidateQueries({ queryKey: ["addendums"] }), ve(_, r, String(t)), ke(_, r, String(t)), L(""), M(null), a(null), ee.success("Transition executed");
1142
+ C.invalidateQueries({ queryKey: y }), r === "nivaro_addendums" && C.invalidateQueries({ queryKey: ["addendums"] }), ke(C, r, String(t)), _e(C, r, String(t)), L(""), M(null), s(null), ee.success("Transition executed");
1122
1143
  },
1123
- onError: (o, $) => {
1144
+ onError: (o, T) => {
1124
1145
  if (xt(o)) {
1125
- _.invalidateQueries({ queryKey: y });
1146
+ C.invalidateQueries({ queryKey: y });
1126
1147
  return;
1127
1148
  }
1128
1149
  const E = bt(o);
1129
1150
  if (E) {
1130
- a((H) => ({
1151
+ s((G) => ({
1131
1152
  payload: E,
1132
- transitionId: $.transition_id,
1133
- comment: $.comment,
1134
- revision: ((H == null ? void 0 : H.revision) ?? 0) + 1
1153
+ transitionId: T.transition_id,
1154
+ comment: T.comment,
1155
+ revision: ((G == null ? void 0 : G.revision) ?? 0) + 1
1135
1156
  }));
1136
1157
  return;
1137
1158
  }
1138
1159
  const z = o == null ? void 0 : o.response;
1139
- ee.error(Fe(o, "Failed to execute transition"), {
1160
+ ee.error(he(o, "Failed to execute transition"), {
1140
1161
  duration: 12e3,
1141
1162
  // #1867: a refusal carries "Why?" — the role, owner or access rule
1142
1163
  // that stopped it, and who can change it.
@@ -1145,25 +1166,25 @@ function Gt({
1145
1166
  collection: r,
1146
1167
  itemId: String(t),
1147
1168
  action: "transition",
1148
- transitionId: $.transition_id
1169
+ transitionId: T.transition_id
1149
1170
  })
1150
1171
  } : {}
1151
- }), a(null), M(null), ve(_, r, String(t)), ke(_, r, String(t)), (z == null ? void 0 : z.status) === 409 && _.invalidateQueries({ queryKey: y });
1172
+ }), s(null), M(null), ke(C, r, String(t)), _e(C, r, String(t)), (z == null ? void 0 : z.status) === 409 && C.invalidateQueries({ queryKey: y });
1152
1173
  }
1153
1174
  }), O = ne(c);
1154
1175
  O.current = c;
1155
1176
  const re = ne((d == null ? void 0 : d.available_transitions) ?? []);
1156
1177
  if (re.current = (d == null ? void 0 : d.available_transitions) ?? [], ue(() => {
1157
- const o = ($) => {
1158
- const E = $.detail;
1178
+ const o = (T) => {
1179
+ const E = T.detail;
1159
1180
  if (!E || E.claimed || E.collection !== r || String(E.item) !== String(t)) return;
1160
1181
  E.claimed = !0;
1161
- const z = String(E.transition_id).toUpperCase(), H = re.current.find((ce) => String(ce.id).toUpperCase() === z);
1162
- if (!H) {
1182
+ const z = String(E.transition_id).toUpperCase(), G = re.current.find((ce) => String(ce.id).toUpperCase() === z);
1183
+ if (!G) {
1163
1184
  ee.error("That step is not available from where the record is now");
1164
1185
  return;
1165
1186
  }
1166
- O.current(H.id);
1187
+ O.current(G.id);
1167
1188
  };
1168
1189
  return window.addEventListener(Ne, o), () => window.removeEventListener(Ne, o);
1169
1190
  }, [r, t]), m)
@@ -1174,28 +1195,28 @@ function Gt({
1174
1195
  /* @__PURE__ */ e(le, { className: "ml-auto h-3.5 w-3.5 rounded" })
1175
1196
  ] }) });
1176
1197
  if (!(d != null && d.binding)) return null;
1177
- const { instance: F, available_transitions: l, history: B, states: J } = d, Z = new Map((J ?? []).map((o) => [o.id, o])), X = (F == null ? void 0 : F.current_state_obj) ?? null, ae = j ? (l ?? []).find((o) => o.id === j) : null, Ce = ae ? Z.get(ae.to_state) : null, yt = F != null && F.completed_at && l ? l.filter(
1198
+ const { instance: F, available_transitions: a, history: D, states: H } = d, V = new Map((H ?? []).map((o) => [o.id, o])), Z = (F == null ? void 0 : F.current_state_obj) ?? null, ae = B ? (a ?? []).find((o) => o.id === B) : null, Se = ae ? V.get(ae.to_state) : null, yt = F != null && F.completed_at && a ? a.filter(
1178
1199
  (o) => o.from_state && String(o.from_state).toUpperCase() === String(F.current_state).toUpperCase()
1179
- ) : null, Se = F != null && F.completed_at ? yt ?? [] : l ?? [], Qe = Se.length > 0, ze = (o, $ = !1) => {
1200
+ ) : null, $e = F != null && F.completed_at ? yt ?? [] : a ?? [], Qe = $e.length > 0, ze = (o, T = !1) => {
1180
1201
  const E = /* @__PURE__ */ new Map();
1181
1202
  for (const z of o) {
1182
- const H = E.get(z.label) ?? [];
1183
- H.push(z), E.set(z.label, H);
1203
+ const G = E.get(z.label) ?? [];
1204
+ G.push(z), E.set(z.label, G);
1184
1205
  }
1185
- return Array.from(E.entries()).map(([z, H]) => {
1206
+ return Array.from(E.entries()).map(([z, G]) => {
1186
1207
  var Xe, Je;
1187
- const ce = ((Xe = H[0]) == null ? void 0 : Xe.color) ?? null, be = H.some((V) => V.id === j), Ge = (V) => ce ? V ? { backgroundColor: ce, borderColor: ce } : { borderColor: ce, color: ce } : void 0;
1188
- if (H.length === 1) {
1189
- const V = H[0], pe = G.isPending && ((Je = G.variables) == null ? void 0 : Je.transition_id) === V.id;
1208
+ const ce = ((Xe = G[0]) == null ? void 0 : Xe.color) ?? null, ye = G.some((X) => X.id === B), Ge = (X) => ce ? X ? { backgroundColor: ce, borderColor: ce } : { borderColor: ce, color: ce } : void 0;
1209
+ if (G.length === 1) {
1210
+ const X = G[0], pe = J.isPending && ((Je = J.variables) == null ? void 0 : Je.transition_id) === X.id;
1190
1211
  return /* @__PURE__ */ n(
1191
1212
  Y,
1192
1213
  {
1193
1214
  size: "sm",
1194
- variant: be ? "default" : "outline",
1195
- className: `${$ ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5`,
1196
- style: Ge(be),
1197
- disabled: G.isPending,
1198
- onClick: () => c(V.id),
1215
+ variant: ye ? "default" : "outline",
1216
+ className: `${T ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5`,
1217
+ style: Ge(ye),
1218
+ disabled: J.isPending,
1219
+ onClick: () => c(X.id),
1199
1220
  children: [
1200
1221
  pe && /* @__PURE__ */ e(se, { className: "h-3 w-3 animate-spin" }),
1201
1222
  z
@@ -1204,38 +1225,38 @@ function Gt({
1204
1225
  z
1205
1226
  );
1206
1227
  }
1207
- return /* @__PURE__ */ n(qe, { children: [
1228
+ return /* @__PURE__ */ n(Pe, { children: [
1208
1229
  /* @__PURE__ */ e(Ae, { asChild: !0, children: /* @__PURE__ */ n(
1209
1230
  Y,
1210
1231
  {
1211
1232
  size: "sm",
1212
- variant: be ? "default" : "outline",
1213
- className: `${$ ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5`,
1214
- style: Ge(be),
1215
- disabled: G.isPending,
1233
+ variant: ye ? "default" : "outline",
1234
+ className: `${T ? "h-7 text-[11px]" : "text-[12px]"} gap-1.5`,
1235
+ style: Ge(ye),
1236
+ disabled: J.isPending,
1216
1237
  children: [
1217
1238
  z,
1218
1239
  /* @__PURE__ */ e(me, { className: "h-3 w-3" })
1219
1240
  ]
1220
1241
  }
1221
1242
  ) }),
1222
- /* @__PURE__ */ e(Pe, { align: "start", children: [...H].sort(
1223
- (V, pe) => {
1243
+ /* @__PURE__ */ e(Re, { align: "start", children: [...G].sort(
1244
+ (X, pe) => {
1224
1245
  var Ze, Ye;
1225
- return (((Ze = Z.get(V.to_state)) == null ? void 0 : Ze.sort) ?? 999) - (((Ye = Z.get(pe.to_state)) == null ? void 0 : Ye.sort) ?? 999);
1246
+ return (((Ze = V.get(X.to_state)) == null ? void 0 : Ze.sort) ?? 999) - (((Ye = V.get(pe.to_state)) == null ? void 0 : Ye.sort) ?? 999);
1226
1247
  }
1227
- ).map((V) => {
1248
+ ).map((X) => {
1228
1249
  var pe;
1229
- return /* @__PURE__ */ n(ge, { onSelect: () => c(V.id), children: [
1230
- V.color && /* @__PURE__ */ e(
1250
+ return /* @__PURE__ */ n(we, { onSelect: () => c(X.id), children: [
1251
+ X.color && /* @__PURE__ */ e(
1231
1252
  "span",
1232
1253
  {
1233
1254
  className: "mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
1234
- style: { backgroundColor: V.color }
1255
+ style: { backgroundColor: X.color }
1235
1256
  }
1236
1257
  ),
1237
- ((pe = Z.get(V.to_state)) == null ? void 0 : pe.label) ?? V.to_state
1238
- ] }, V.id);
1258
+ ((pe = V.get(X.to_state)) == null ? void 0 : pe.label) ?? X.to_state
1259
+ ] }, X.id);
1239
1260
  }) })
1240
1261
  ] }, z);
1241
1262
  });
@@ -1243,10 +1264,10 @@ function Gt({
1243
1264
  /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: [
1244
1265
  /* @__PURE__ */ e("span", { className: "text-[11px] font-semibold text-slate-400", children: "Confirming" }),
1245
1266
  ae && /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-700", children: ae.label }),
1246
- X && Ce && /* @__PURE__ */ n("div", { className: "ml-auto flex items-center gap-1.5", children: [
1247
- /* @__PURE__ */ e(oe, { label: X.label, color: X.color, small: !0 }),
1248
- /* @__PURE__ */ e(Be, { className: "h-3 w-3 shrink-0 text-slate-300" }),
1249
- /* @__PURE__ */ e(oe, { label: Ce.label, color: Ce.color, small: !0 })
1267
+ Z && Se && /* @__PURE__ */ n("div", { className: "ml-auto flex items-center gap-1.5", children: [
1268
+ /* @__PURE__ */ e(oe, { label: Z.label, color: Z.color, small: !0 }),
1269
+ /* @__PURE__ */ e(Fe, { className: "h-3 w-3 shrink-0 text-slate-300" }),
1270
+ /* @__PURE__ */ e(oe, { label: Se.label, color: Se.color, small: !0 })
1250
1271
  ] })
1251
1272
  ] }),
1252
1273
  /* @__PURE__ */ e(gt, { collection: r, item: t }),
@@ -1278,14 +1299,14 @@ function Gt({
1278
1299
  type: "button",
1279
1300
  size: "sm",
1280
1301
  className: "h-7 gap-1.5 text-[12px]",
1281
- disabled: G.isPending || String((ae == null ? void 0 : ae.comment_mode) ?? "") === "required" && I.trim() === "",
1302
+ disabled: J.isPending || String((ae == null ? void 0 : ae.comment_mode) ?? "") === "required" && I.trim() === "",
1282
1303
  onClick: () => W({
1283
- transition_id: j,
1304
+ transition_id: B,
1284
1305
  comment: I.trim() || void 0
1285
1306
  }),
1286
- children: G.isPending ? /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ n(de, { children: [
1307
+ children: J.isPending ? /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ n(de, { children: [
1287
1308
  /* @__PURE__ */ e("span", { children: "Confirm" }),
1288
- /* @__PURE__ */ e(_e, { className: "h-3 w-3" })
1309
+ /* @__PURE__ */ e(Ce, { className: "h-3 w-3" })
1289
1310
  ] })
1290
1311
  }
1291
1312
  )
@@ -1295,22 +1316,22 @@ function Gt({
1295
1316
  /* @__PURE__ */ n(
1296
1317
  "div",
1297
1318
  {
1298
- className: `overflow-hidden rounded-xl border bg-white dark:bg-card ${D ? "border-amber-300 dark:border-amber-600/50" : "border-slate-200 dark:border-border"}`,
1319
+ className: `overflow-hidden rounded-xl border bg-white dark:bg-card ${j ? "border-amber-300 dark:border-amber-600/50" : "border-slate-200 dark:border-border"}`,
1299
1320
  children: [
1300
1321
  /* @__PURE__ */ n(
1301
1322
  "div",
1302
1323
  {
1303
1324
  role: "button",
1304
1325
  tabIndex: 0,
1305
- onClick: () => s((o) => !o),
1306
- onKeyDown: (o) => (o.key === "Enter" || o.key === " ") && s(($) => !$),
1326
+ onClick: () => i((o) => !o),
1327
+ onKeyDown: (o) => (o.key === "Enter" || o.key === " ") && i((T) => !T),
1307
1328
  className: "flex w-full cursor-pointer items-center gap-2.5 px-5 py-3.5 transition-colors hover:bg-slate-50/50 dark:hover:bg-white/[0.02]",
1308
1329
  children: [
1309
- /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
1310
- /* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: i || "Pipeline" }),
1330
+ /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
1331
+ /* @__PURE__ */ e("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: l || "Pipeline" }),
1311
1332
  /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
1312
- D && /* @__PURE__ */ e("span", { className: "flex items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 dark:border-amber-500/20 dark:bg-amber-500/10 dark:text-amber-400", children: "Addendum workflow" }),
1313
- X && /* @__PURE__ */ e(oe, { label: X.label, color: X.color }),
1333
+ j && /* @__PURE__ */ e("span", { className: "flex items-center gap-1 rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 dark:border-amber-500/20 dark:bg-amber-500/10 dark:text-amber-400", children: "Addendum workflow" }),
1334
+ Z && /* @__PURE__ */ e(oe, { label: Z.label, color: Z.color }),
1314
1335
  (((We = d == null ? void 0 : d.auto_held) == null ? void 0 : We.length) ?? 0) > 0 && /* @__PURE__ */ n(
1315
1336
  "span",
1316
1337
  {
@@ -1324,24 +1345,24 @@ function Gt({
1324
1345
  ]
1325
1346
  }
1326
1347
  ),
1327
- q && /* @__PURE__ */ n("span", { className: "flex items-center gap-1 rounded-full bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20", children: [
1348
+ P && /* @__PURE__ */ n("span", { className: "flex items-center gap-1 rounded-full bg-amber-50 px-2 py-0.5 text-[11px] font-medium text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20", children: [
1328
1349
  /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 animate-pulse shrink-0" }),
1329
1350
  "Addendum in review"
1330
1351
  ] }),
1331
- N.length > 0 && /* @__PURE__ */ n(
1352
+ v.length > 0 && /* @__PURE__ */ n(
1332
1353
  "span",
1333
1354
  {
1334
1355
  className: "flex items-center gap-1 rounded-full border border-sky-200 bg-sky-50 px-2 py-0.5 text-[11px] font-medium text-sky-700 dark:border-sky-500/20 dark:bg-sky-500/10 dark:text-sky-300",
1335
1356
  "data-pipeline-approving": !0,
1336
1357
  children: [
1337
1358
  /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-sky-400" }),
1338
- Tt(N, "approving")
1359
+ Tt(v, "approving")
1339
1360
  ]
1340
1361
  }
1341
1362
  )
1342
1363
  ] }),
1343
1364
  /* @__PURE__ */ n("div", { className: "ml-auto flex items-center gap-2", onClick: (o) => o.stopPropagation(), children: [
1344
- !S && Qe && !p && /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1.5", children: ze(Se, !0) }),
1365
+ !S && Qe && !p && /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-1.5", children: ze($e, !0) }),
1345
1366
  !S && !F && (d == null ? void 0 : d.binding) && /* @__PURE__ */ n(
1346
1367
  Y,
1347
1368
  {
@@ -1353,17 +1374,17 @@ function Gt({
1353
1374
  },
1354
1375
  disabled: Q.isPending,
1355
1376
  children: [
1356
- Q.isPending ? /* @__PURE__ */ e(se, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e($e, { className: "h-3 w-3" }),
1377
+ Q.isPending ? /* @__PURE__ */ e(se, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ e(Te, { className: "h-3 w-3" }),
1357
1378
  "Start"
1358
1379
  ]
1359
1380
  }
1360
1381
  ),
1361
- T && ((d == null ? void 0 : d.binding) || (d == null ? void 0 : d.instance)) && /* @__PURE__ */ e(
1382
+ q && ((d == null ? void 0 : d.binding) || (d == null ? void 0 : d.instance)) && /* @__PURE__ */ e(
1362
1383
  Vt,
1363
1384
  {
1364
1385
  collection: r,
1365
1386
  item: t,
1366
- states: J ?? [],
1387
+ states: H ?? [],
1367
1388
  currentStateId: ((He = d == null ? void 0 : d.instance) == null ? void 0 : He.current_state) ?? null
1368
1389
  }
1369
1390
  )
@@ -1371,7 +1392,7 @@ function Gt({
1371
1392
  /* @__PURE__ */ e(
1372
1393
  me,
1373
1394
  {
1374
- className: xe(
1395
+ className: ge(
1375
1396
  "h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150",
1376
1397
  S && "rotate-180"
1377
1398
  )
@@ -1380,16 +1401,16 @@ function Gt({
1380
1401
  ]
1381
1402
  }
1382
1403
  ),
1383
- !S && j && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: Ke }),
1404
+ !S && B && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 dark:border-border/60 px-4 py-3", children: Ke }),
1384
1405
  S && /* @__PURE__ */ n("div", { className: "border-t border-slate-100 dark:border-border/60", children: [
1385
1406
  /* @__PURE__ */ e(Ut, { held: (d == null ? void 0 : d.auto_held) ?? [] }),
1386
- q && /* @__PURE__ */ n("div", { className: "flex items-center gap-2 border-b border-amber-100 bg-amber-50 px-5 py-2.5 dark:border-amber-500/20 dark:bg-amber-500/10", children: [
1407
+ P && /* @__PURE__ */ n("div", { className: "flex items-center gap-2 border-b border-amber-100 bg-amber-50 px-5 py-2.5 dark:border-amber-500/20 dark:bg-amber-500/10", children: [
1387
1408
  /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
1388
1409
  /* @__PURE__ */ e("p", { className: "text-[12px] text-amber-700 dark:text-amber-400", children: "An addendum is in review — coordinate transitions carefully." })
1389
1410
  ] }),
1390
1411
  F ? /* @__PURE__ */ n("div", { className: "divide-y divide-slate-100 dark:divide-border/60", children: [
1391
- (J ?? []).length > 1 && /* @__PURE__ */ n("div", { className: "space-y-3 px-5 py-4", children: [
1392
- C ? (
1412
+ (H ?? []).length > 1 && /* @__PURE__ */ n("div", { className: "space-y-3 px-5 py-4", children: [
1413
+ _ ? (
1393
1414
  // Path pruning arrives with the owners query — rendering
1394
1415
  // the UNPRUNED track first meant every state briefly
1395
1416
  // showed, then snapped into formation. Hold a same-height
@@ -1404,20 +1425,20 @@ function Gt({
1404
1425
  ) : /* @__PURE__ */ e(
1405
1426
  zt,
1406
1427
  {
1407
- states: J,
1428
+ states: H,
1408
1429
  allTransitions: (d == null ? void 0 : d.all_transitions) ?? [],
1409
- availableTransitions: l ?? [],
1430
+ availableTransitions: a ?? [],
1410
1431
  currentStateId: F.current_state,
1411
- history: B ?? [],
1432
+ history: D ?? [],
1412
1433
  onPathIds: h,
1413
- skippedStates: P
1434
+ skippedStates: $
1414
1435
  }
1415
1436
  ),
1416
- (d == null ? void 0 : d.branches) && /* @__PURE__ */ e(Bt, { data: d.branches }),
1437
+ (d == null ? void 0 : d.branches) && /* @__PURE__ */ e(Ot, { data: d.branches }),
1417
1438
  /* @__PURE__ */ e(
1418
1439
  Qt,
1419
1440
  {
1420
- history: B ?? [],
1441
+ history: D ?? [],
1421
1442
  completedAt: F.completed_at
1422
1443
  }
1423
1444
  )
@@ -1429,20 +1450,20 @@ function Gt({
1429
1450
  {
1430
1451
  collection: r,
1431
1452
  item: t,
1432
- states: J ?? [],
1453
+ states: H ?? [],
1433
1454
  currentStateId: ((Ve = d == null ? void 0 : d.instance) == null ? void 0 : Ve.current_state) ?? null,
1434
1455
  returned: ((d == null ? void 0 : d.history) ?? []).some(
1435
1456
  (o) => {
1436
- var $;
1437
- return !!o.from_state && o.to_state === (($ = d == null ? void 0 : d.instance) == null ? void 0 : $.current_state);
1457
+ var T;
1458
+ return !!o.from_state && o.to_state === ((T = d == null ? void 0 : d.instance) == null ? void 0 : T.current_state);
1438
1459
  }
1439
1460
  )
1440
1461
  }
1441
1462
  )
1442
1463
  ] }),
1443
1464
  Qe && !f && /* @__PURE__ */ n("div", { className: "space-y-3 px-5 py-4", children: [
1444
- /* @__PURE__ */ e("div", { className: "flex flex-wrap justify-end gap-2", children: ze(Se) }),
1445
- j && Ke
1465
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap justify-end gap-2", children: ze($e) }),
1466
+ B && Ke
1446
1467
  ] }),
1447
1468
  /* @__PURE__ */ n("div", { className: "px-5 py-3", children: [
1448
1469
  /* @__PURE__ */ n(
@@ -1455,7 +1476,7 @@ function Gt({
1455
1476
  /* @__PURE__ */ e(
1456
1477
  me,
1457
1478
  {
1458
- className: xe(
1479
+ className: ge(
1459
1480
  "h-3.5 w-3.5 transition-transform duration-200",
1460
1481
  U && "rotate-180"
1461
1482
  )
@@ -1465,13 +1486,13 @@ function Gt({
1465
1486
  " ",
1466
1487
  /* @__PURE__ */ n("span", { className: "tabular-nums", children: [
1467
1488
  "(",
1468
- (B == null ? void 0 : B.length) ?? 0,
1489
+ (D == null ? void 0 : D.length) ?? 0,
1469
1490
  ")"
1470
1491
  ] })
1471
1492
  ]
1472
1493
  }
1473
1494
  ),
1474
- U && /* @__PURE__ */ e("div", { className: "mt-3", children: /* @__PURE__ */ e(Kt, { history: B ?? [] }) })
1495
+ U && /* @__PURE__ */ e("div", { className: "mt-3", children: /* @__PURE__ */ e(Kt, { history: D ?? [] }) })
1475
1496
  ] })
1476
1497
  ] }) : /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-4 px-5 py-4", children: [
1477
1498
  /* @__PURE__ */ e("p", { className: "text-[13px] text-slate-500", children: "Pipeline not started for this record." }),
@@ -1484,7 +1505,7 @@ function Gt({
1484
1505
  onClick: () => Q.mutate(),
1485
1506
  disabled: Q.isPending,
1486
1507
  children: [
1487
- Q.isPending ? /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e($e, { className: "h-3.5 w-3.5" }),
1508
+ Q.isPending ? /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5" }),
1488
1509
  "Start Pipeline"
1489
1510
  ]
1490
1511
  }
@@ -1502,15 +1523,15 @@ function Gt({
1502
1523
  onSubmitted: () => (
1503
1524
  // mutateAsync so the dialog can stay busy until the transition
1504
1525
  // settles; the mutation's own onError/onSuccess handle the outcome.
1505
- G.mutateAsync({
1526
+ J.mutateAsync({
1506
1527
  transition_id: w.transitionId,
1507
1528
  comment: w.comment,
1508
1529
  reviewed: !0
1509
1530
  }).catch(() => {
1510
1531
  })
1511
1532
  ),
1512
- executing: G.isPending,
1513
- onClose: () => a(null)
1533
+ executing: J.isPending,
1534
+ onClose: () => s(null)
1514
1535
  },
1515
1536
  w.revision
1516
1537
  ) })
@@ -1520,7 +1541,7 @@ function Cn({
1520
1541
  collection: r,
1521
1542
  item: t,
1522
1543
  onBeforeTransition: u,
1523
- wrap: i = !0
1544
+ wrap: l = !0
1524
1545
  }) {
1525
1546
  return t === "new" ? null : /* @__PURE__ */ e(
1526
1547
  Xt,
@@ -1528,7 +1549,7 @@ function Cn({
1528
1549
  collection: r,
1529
1550
  item: t,
1530
1551
  onBeforeTransition: u,
1531
- wrap: i
1552
+ wrap: l
1532
1553
  }
1533
1554
  );
1534
1555
  }
@@ -1536,11 +1557,11 @@ function Xt({
1536
1557
  collection: r,
1537
1558
  item: t,
1538
1559
  onBeforeTransition: u,
1539
- wrap: i = !0
1560
+ wrap: l = !0
1540
1561
  }) {
1541
- const T = fe(), p = Oe(), [f, v] = K(""), [q, D] = K(null), [x, R] = K(null);
1542
- dt(r, t, "transition", !!q || !!x);
1543
- const _ = ne(null), I = Dt(_, !i), L = ne(!1), j = (m) => {
1562
+ const q = fe(), p = Oe(), [f, N] = K(""), [P, j] = K(null), [x, R] = K(null);
1563
+ dt(r, t, "transition", !!P || !!x);
1564
+ const C = ne(null), I = Dt(C, !l), L = ne(!1), B = (m) => {
1544
1565
  L.current || (L.current = !0, S.mutate(m, {
1545
1566
  onSettled: () => {
1546
1567
  L.current = !1;
@@ -1548,8 +1569,8 @@ function Xt({
1548
1569
  }));
1549
1570
  }, M = async (m) => {
1550
1571
  if (L.current) return;
1551
- if (q === m) {
1552
- D(null);
1572
+ if (P === m) {
1573
+ j(null);
1553
1574
  return;
1554
1575
  }
1555
1576
  if (u) {
@@ -1562,15 +1583,15 @@ function Xt({
1562
1583
  }
1563
1584
  if (!h) return;
1564
1585
  }
1565
- const g = (a ?? []).find((h) => h.id === m), C = String((g == null ? void 0 : g.comment_mode) ?? "none");
1566
- if (C !== "optional" && C !== "required") {
1567
- j({ transition_id: m });
1586
+ const g = (s ?? []).find((h) => h.id === m), _ = String((g == null ? void 0 : g.comment_mode) ?? "none");
1587
+ if (_ !== "optional" && _ !== "required") {
1588
+ B({ transition_id: m });
1568
1589
  return;
1569
1590
  }
1570
- D(m);
1591
+ j(m);
1571
1592
  }, U = ["pipeline-instance", r, t], { data: b } = te({
1572
1593
  queryKey: U,
1573
- queryFn: () => T.request(
1594
+ queryFn: () => q.request(
1574
1595
  ie(`/pipelines/instance/${r}/${t}`)
1575
1596
  ).then(
1576
1597
  (m) => m.data ?? {
@@ -1583,91 +1604,91 @@ function Xt({
1583
1604
  }
1584
1605
  ),
1585
1606
  staleTime: 1e4
1586
- }), S = he({
1607
+ }), S = xe({
1587
1608
  mutationFn: ({
1588
1609
  transition_id: m,
1589
1610
  comment: g,
1590
- reviewed: C
1591
- }) => T.request(
1592
- we(`/pipelines/instance/${r}/${t}/transition`, {
1611
+ reviewed: _
1612
+ }) => q.request(
1613
+ be(`/pipelines/instance/${r}/${t}/transition`, {
1593
1614
  transition_id: m,
1594
1615
  comment: g,
1595
- ...C ? { reviewed: !0 } : {}
1616
+ ..._ ? { reviewed: !0 } : {}
1596
1617
  })
1597
1618
  ),
1598
1619
  onSuccess: () => {
1599
- p.invalidateQueries({ queryKey: U }), r === "nivaro_addendums" && p.invalidateQueries({ queryKey: ["addendums"] }), ve(p, r, String(t)), ke(p, r, String(t)), v(""), D(null), R(null), ee.success("Transition executed");
1620
+ p.invalidateQueries({ queryKey: U }), r === "nivaro_addendums" && p.invalidateQueries({ queryKey: ["addendums"] }), ke(p, r, String(t)), _e(p, r, String(t)), N(""), j(null), R(null), ee.success("Transition executed");
1600
1621
  },
1601
1622
  onError: (m, g) => {
1602
1623
  if (xt(m)) {
1603
1624
  p.invalidateQueries({ queryKey: U });
1604
1625
  return;
1605
1626
  }
1606
- const C = bt(m);
1607
- if (C) {
1608
- R((P) => ({
1609
- payload: C,
1627
+ const _ = bt(m);
1628
+ if (_) {
1629
+ R(($) => ({
1630
+ payload: _,
1610
1631
  transitionId: g.transition_id,
1611
1632
  comment: g.comment,
1612
- revision: ((P == null ? void 0 : P.revision) ?? 0) + 1
1633
+ revision: (($ == null ? void 0 : $.revision) ?? 0) + 1
1613
1634
  }));
1614
1635
  return;
1615
1636
  }
1616
1637
  const h = m == null ? void 0 : m.response;
1617
- ee.error(Fe(m, "Failed to execute transition"), {
1638
+ ee.error(he(m, "Failed to execute transition"), {
1618
1639
  duration: 12e3,
1619
1640
  // #1867: a refusal carries "Why?" — the role, owner or access rule
1620
1641
  // that stopped it, and who can change it.
1621
1642
  ...ut(m) ? {
1622
- action: pt(T, {
1643
+ action: pt(q, {
1623
1644
  collection: r,
1624
1645
  itemId: String(t),
1625
1646
  action: "transition",
1626
1647
  transitionId: g.transition_id
1627
1648
  })
1628
1649
  } : {}
1629
- }), R(null), D(null), ve(p, r, String(t)), ke(p, r, String(t)), (h == null ? void 0 : h.status) === 409 && p.invalidateQueries({ queryKey: U });
1650
+ }), R(null), j(null), ke(p, r, String(t)), _e(p, r, String(t)), (h == null ? void 0 : h.status) === 409 && p.invalidateQueries({ queryKey: U });
1630
1651
  }
1631
- }), s = ne(M);
1632
- s.current = M;
1652
+ }), i = ne(M);
1653
+ i.current = M;
1633
1654
  const w = ne((b == null ? void 0 : b.available_transitions) ?? []);
1634
1655
  if (w.current = (b == null ? void 0 : b.available_transitions) ?? [], ue(() => {
1635
1656
  const m = (g) => {
1636
- const C = g.detail;
1637
- if (!C || C.claimed || C.collection !== r || String(C.item) !== String(t)) return;
1638
- C.claimed = !0;
1639
- const h = String(C.transition_id).toUpperCase(), P = w.current.find((Q) => String(Q.id).toUpperCase() === h);
1640
- if (!P) {
1657
+ const _ = g.detail;
1658
+ if (!_ || _.claimed || _.collection !== r || String(_.item) !== String(t)) return;
1659
+ _.claimed = !0;
1660
+ const h = String(_.transition_id).toUpperCase(), $ = w.current.find((Q) => String(Q.id).toUpperCase() === h);
1661
+ if (!$) {
1641
1662
  ee.error("That step is not available from where the record is now");
1642
1663
  return;
1643
1664
  }
1644
- s.current(P.id);
1665
+ i.current($.id);
1645
1666
  };
1646
1667
  return window.addEventListener(Ne, m), () => window.removeEventListener(Ne, m);
1647
1668
  }, [r, t]), !(b != null && b.binding) || !(b != null && b.instance)) return null;
1648
- const a = (b.available_transitions ?? []).filter(
1669
+ const s = (b.available_transitions ?? []).filter(
1649
1670
  (m) => !b.instance.completed_at || m.from_state && String(m.from_state).toUpperCase() === String(b.instance.current_state).toUpperCase()
1650
1671
  );
1651
- if (a.length === 0) return null;
1652
- const N = new Map((b.states ?? []).map((m) => [m.id, m])), k = b.instance.current_state_obj ?? null, A = q ? a.find((m) => m.id === q) : null, W = A ? N.get(A.to_state) : null, c = /* @__PURE__ */ new Map();
1653
- for (const m of a) {
1672
+ if (s.length === 0) return null;
1673
+ const v = new Map((b.states ?? []).map((m) => [m.id, m])), k = b.instance.current_state_obj ?? null, A = P ? s.find((m) => m.id === P) : null, W = A ? v.get(A.to_state) : null, c = /* @__PURE__ */ new Map();
1674
+ for (const m of s) {
1654
1675
  const g = c.get(m.label) ?? [];
1655
1676
  g.push(m), c.set(m.label, g);
1656
1677
  }
1657
1678
  const y = (m) => [...m].sort(
1658
- (g, C) => {
1659
- var h, P;
1660
- return (((h = N.get(g.to_state)) == null ? void 0 : h.sort) ?? 999) - (((P = N.get(C.to_state)) == null ? void 0 : P.sort) ?? 999);
1679
+ (g, _) => {
1680
+ var h, $;
1681
+ return (((h = v.get(g.to_state)) == null ? void 0 : h.sort) ?? 999) - ((($ = v.get(_.to_state)) == null ? void 0 : $.sort) ?? 999);
1661
1682
  }
1662
1683
  ), d = (() => {
1663
- var C, h, P;
1664
- const m = (C = _.current) == null ? void 0 : C.getBoundingClientRect();
1684
+ var _, h, $;
1685
+ const m = (_ = C.current) == null ? void 0 : _.getBoundingClientRect();
1665
1686
  if (!m) return 600;
1666
- const g = (P = (h = _.current) == null ? void 0 : h.closest('[role="dialog"]')) == null ? void 0 : P.getBoundingClientRect();
1687
+ const g = ($ = (h = C.current) == null ? void 0 : h.closest('[role="dialog"]')) == null ? void 0 : $.getBoundingClientRect();
1667
1688
  return Math.max(260, Math.min(600, m.right - ((g == null ? void 0 : g.left) ?? 0) - 12));
1668
1689
  })();
1669
- return /* @__PURE__ */ n("div", { ref: _, className: "relative", children: [
1670
- I ? /* @__PURE__ */ n(qe, { children: [
1690
+ return /* @__PURE__ */ n("div", { ref: C, className: "relative", children: [
1691
+ I ? /* @__PURE__ */ n(Pe, { children: [
1671
1692
  /* @__PURE__ */ e(Ae, { asChild: !0, children: /* @__PURE__ */ n(
1672
1693
  Y,
1673
1694
  {
@@ -1683,10 +1704,10 @@ function Xt({
1683
1704
  ]
1684
1705
  }
1685
1706
  ) }),
1686
- /* @__PURE__ */ e(Pe, { align: "end", className: "min-w-[200px]", children: Array.from(c.entries()).map(
1687
- ([m, g], C, h) => g.length === 1 ? /* @__PURE__ */ n(tt, { children: [
1688
- C > 0 && h[C - 1][1].length > 1 && /* @__PURE__ */ e(nt, {}),
1689
- /* @__PURE__ */ n(ge, { onSelect: () => M(g[0].id), children: [
1707
+ /* @__PURE__ */ e(Re, { align: "end", className: "min-w-[200px]", children: Array.from(c.entries()).map(
1708
+ ([m, g], _, h) => g.length === 1 ? /* @__PURE__ */ n(tt, { children: [
1709
+ _ > 0 && h[_ - 1][1].length > 1 && /* @__PURE__ */ e(nt, {}),
1710
+ /* @__PURE__ */ n(we, { onSelect: () => M(g[0].id), children: [
1690
1711
  g[0].color && /* @__PURE__ */ e(
1691
1712
  "span",
1692
1713
  {
@@ -1697,38 +1718,38 @@ function Xt({
1697
1718
  m
1698
1719
  ] })
1699
1720
  ] }, m) : /* @__PURE__ */ n(tt, { children: [
1700
- C > 0 && /* @__PURE__ */ e(nt, {}),
1701
- /* @__PURE__ */ e(Lt, { className: "text-[11px] text-muted-foreground", children: m }),
1702
- y(g).map((P) => {
1721
+ _ > 0 && /* @__PURE__ */ e(nt, {}),
1722
+ /* @__PURE__ */ e(Bt, { className: "text-[11px] text-muted-foreground", children: m }),
1723
+ y(g).map(($) => {
1703
1724
  var Q;
1704
- return /* @__PURE__ */ n(ge, { onSelect: () => M(P.id), children: [
1705
- P.color && /* @__PURE__ */ e(
1725
+ return /* @__PURE__ */ n(we, { onSelect: () => M($.id), children: [
1726
+ $.color && /* @__PURE__ */ e(
1706
1727
  "span",
1707
1728
  {
1708
1729
  className: "mr-2 inline-block h-2 w-2 shrink-0 rounded-full",
1709
- style: { backgroundColor: P.color }
1730
+ style: { backgroundColor: $.color }
1710
1731
  }
1711
1732
  ),
1712
- ((Q = N.get(P.to_state)) == null ? void 0 : Q.label) ?? P.to_state
1713
- ] }, P.id);
1733
+ ((Q = v.get($.to_state)) == null ? void 0 : Q.label) ?? $.to_state
1734
+ ] }, $.id);
1714
1735
  })
1715
1736
  ] }, m)
1716
1737
  ) })
1717
1738
  ] }) : /* @__PURE__ */ e(
1718
1739
  "div",
1719
1740
  {
1720
- className: i ? "flex flex-wrap justify-end gap-2" : "flex shrink-0 items-center justify-end gap-2",
1741
+ className: l ? "flex flex-wrap justify-end gap-2" : "flex shrink-0 items-center justify-end gap-2",
1721
1742
  children: Array.from(c.entries()).map(([m, g]) => {
1722
- var Q, G;
1723
- const C = ((Q = g[0]) == null ? void 0 : Q.color) ?? null, h = g.some((O) => O.id === q), P = (O) => C ? O ? { backgroundColor: C, borderColor: C } : { borderColor: C, color: C } : void 0;
1743
+ var Q, J;
1744
+ const _ = ((Q = g[0]) == null ? void 0 : Q.color) ?? null, h = g.some((O) => O.id === P), $ = (O) => _ ? O ? { backgroundColor: _, borderColor: _ } : { borderColor: _, color: _ } : void 0;
1724
1745
  if (g.length === 1) {
1725
- const O = g[0], re = S.isPending && ((G = S.variables) == null ? void 0 : G.transition_id) === O.id, F = /* @__PURE__ */ n(
1746
+ const O = g[0], re = S.isPending && ((J = S.variables) == null ? void 0 : J.transition_id) === O.id, F = /* @__PURE__ */ n(
1726
1747
  Y,
1727
1748
  {
1728
1749
  size: "sm",
1729
1750
  variant: h ? "default" : "outline",
1730
1751
  className: "gap-1.5 text-[12px]",
1731
- style: P(h),
1752
+ style: $(h),
1732
1753
  disabled: S.isPending,
1733
1754
  onClick: () => M(O.id),
1734
1755
  children: [
@@ -1752,14 +1773,14 @@ function Xt({
1752
1773
  )
1753
1774
  ] }, m) : F;
1754
1775
  }
1755
- return /* @__PURE__ */ n(qe, { children: [
1776
+ return /* @__PURE__ */ n(Pe, { children: [
1756
1777
  /* @__PURE__ */ e(Ae, { asChild: !0, children: /* @__PURE__ */ n(
1757
1778
  Y,
1758
1779
  {
1759
1780
  size: "sm",
1760
1781
  variant: h ? "default" : "outline",
1761
1782
  className: "gap-1.5 text-[12px]",
1762
- style: P(h),
1783
+ style: $(h),
1763
1784
  disabled: S.isPending,
1764
1785
  children: [
1765
1786
  m,
@@ -1767,9 +1788,9 @@ function Xt({
1767
1788
  ]
1768
1789
  }
1769
1790
  ) }),
1770
- /* @__PURE__ */ e(Pe, { align: "start", children: y(g).map((O) => {
1791
+ /* @__PURE__ */ e(Re, { align: "start", children: y(g).map((O) => {
1771
1792
  var re;
1772
- return /* @__PURE__ */ n(ge, { onSelect: () => M(O.id), children: [
1793
+ return /* @__PURE__ */ n(we, { onSelect: () => M(O.id), children: [
1773
1794
  O.color && /* @__PURE__ */ e(
1774
1795
  "span",
1775
1796
  {
@@ -1777,14 +1798,14 @@ function Xt({
1777
1798
  style: { backgroundColor: O.color }
1778
1799
  }
1779
1800
  ),
1780
- ((re = N.get(O.to_state)) == null ? void 0 : re.label) ?? O.to_state
1801
+ ((re = v.get(O.to_state)) == null ? void 0 : re.label) ?? O.to_state
1781
1802
  ] }, O.id);
1782
1803
  }) })
1783
1804
  ] }, m);
1784
1805
  })
1785
1806
  }
1786
1807
  ),
1787
- q && /* @__PURE__ */ n(
1808
+ P && /* @__PURE__ */ n(
1788
1809
  "div",
1789
1810
  {
1790
1811
  className: "absolute right-0 top-full z-50 mt-1 space-y-3 rounded-lg border border-slate-200 bg-white shadow-lg dark:bg-card dark:border-border p-3.5",
@@ -1795,7 +1816,7 @@ function Xt({
1795
1816
  A && /* @__PURE__ */ e("span", { className: "text-[12px] font-medium text-slate-700", children: A.label }),
1796
1817
  k && W && /* @__PURE__ */ n("div", { className: "ml-auto flex items-center gap-1.5", children: [
1797
1818
  /* @__PURE__ */ e(oe, { label: k.label, color: k.color, small: !0 }),
1798
- /* @__PURE__ */ e(Be, { className: "h-3 w-3 shrink-0 text-slate-300" }),
1819
+ /* @__PURE__ */ e(Fe, { className: "h-3 w-3 shrink-0 text-slate-300" }),
1799
1820
  /* @__PURE__ */ e(oe, { label: W.label, color: W.color, small: !0 })
1800
1821
  ] })
1801
1822
  ] }),
@@ -1805,7 +1826,7 @@ function Xt({
1805
1826
  {
1806
1827
  type: "text",
1807
1828
  value: f,
1808
- onChange: (m) => v(m.target.value),
1829
+ onChange: (m) => N(m.target.value),
1809
1830
  placeholder: String((A == null ? void 0 : A.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
1810
1831
  className: "w-full rounded-md border border-slate-200 bg-white px-3 py-1.5 text-[13px] placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30"
1811
1832
  }
@@ -1818,7 +1839,7 @@ function Xt({
1818
1839
  size: "sm",
1819
1840
  variant: "ghost",
1820
1841
  className: "h-7 text-[12px]",
1821
- onClick: () => D(null),
1842
+ onClick: () => j(null),
1822
1843
  children: "Cancel"
1823
1844
  }
1824
1845
  ),
@@ -1829,13 +1850,13 @@ function Xt({
1829
1850
  size: "sm",
1830
1851
  className: "h-7 gap-1.5 text-[12px]",
1831
1852
  disabled: S.isPending || String((A == null ? void 0 : A.comment_mode) ?? "") === "required" && f.trim() === "",
1832
- onClick: () => j({
1833
- transition_id: q,
1853
+ onClick: () => B({
1854
+ transition_id: P,
1834
1855
  comment: f.trim() || void 0
1835
1856
  }),
1836
1857
  children: S.isPending ? /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ n(de, { children: [
1837
1858
  /* @__PURE__ */ e("span", { children: "Confirm" }),
1838
- /* @__PURE__ */ e(_e, { className: "h-3 w-3" })
1859
+ /* @__PURE__ */ e(Ce, { className: "h-3 w-3" })
1839
1860
  ] })
1840
1861
  }
1841
1862
  )