@nivaro/react 0.3.123 → 0.3.125

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.
@@ -19,7 +19,7 @@ import { useRecordSignalWhile as wn, useRecordSignalPeers as Tr, signalSentence
19
19
  import { RUN_TRANSITION_EVENT as bt } from "../../lib/run-transition.js";
20
20
  import { userErrorMessage as je } from "../../lib/safe-error.js";
21
21
  import { serverNow as qr } from "../../lib/server-clock.js";
22
- import { useTrackTravel as Rr, travelPlan as Pr } from "../../lib/track-travel.js";
22
+ import { useTrackTravel as Pr, travelPlan as Rr } from "../../lib/track-travel.js";
23
23
  import { useStartsOpen as Ar } from "../../lib/use-starts-open.js";
24
24
  import { cn as ne, titleCase as Fr, toLocalDateString as Or, formatDateTime as Ct, humanHours as Dr } from "../../lib/utils.js";
25
25
  import { StepForLine as Er } from "../InStep.js";
@@ -32,14 +32,14 @@ import { OwnerAvatars as Ir } from "../queue/OwnerAvatars.js";
32
32
  import { RelativeTime as Bt } from "../RelativeTime.js";
33
33
  import { UserAvatar as jr } from "../UserAvatar.js";
34
34
  import { Button as fe } from "../ui/button.js";
35
- import { DropdownMenu as qt, DropdownMenuTrigger as Rt, DropdownMenuContent as Pt, DropdownMenuGroup as Zt, DropdownMenuSeparator as At, DropdownMenuItem as dt, DropdownMenuLabel as Wr } from "../ui/dropdown-menu.js";
35
+ import { DropdownMenu as qt, DropdownMenuTrigger as Pt, DropdownMenuContent as Rt, DropdownMenuGroup as Zt, DropdownMenuSeparator as At, DropdownMenuItem as dt, DropdownMenuLabel as Wr } from "../ui/dropdown-menu.js";
36
36
  import { Popover as kn, PopoverTrigger as _n, PopoverContent as Nn } from "../ui/popover.js";
37
37
  import { Skeleton as Ue } from "../ui/skeleton.js";
38
38
  import { TooltipProvider as Sn, Tooltip as ct, TooltipTrigger as mt, TooltipContent as ut } from "../ui/tooltip.js";
39
39
  import { ViewAsPersonButton as $t } from "../ViewAsPersonButton.js";
40
40
  import { isAccessRefusal as Cn, deniedToastAction as $n, WhyOwnersButton as Kr } from "./AccessInsights.js";
41
41
  import { AsyncUserPicker as Qr } from "./AsyncUserPicker.js";
42
- import { runningMovePoll as Tn, useRunEnded as Mn, startedInBackground as qn, pendingOptIn as Rn, sameMoveId as Ft, runningMoveTip as zr, unansweredHoldTip as Pn, RunningMoveNotice as Hr, MoveProblemNotice as Vr } from "./BackgroundMove.js";
42
+ import { runningMovePoll as Tn, useRunEnded as Mn, startedInBackground as qn, pendingOptIn as Pn, sameMoveId as Ft, runningMoveTip as zr, unansweredHoldTip as Rn, RunningMoveNotice as Hr, MoveProblemNotice as Vr } from "./BackgroundMove.js";
43
43
  import { withBlockedMoves as An, BlockedMenuMark as pt, blockedMenuItemProps as ft, isBlockedMove as Fn, BlockedMoveButton as On, blockedGroupTip as Dn } from "./BlockedMove.js";
44
44
  import { BranchLanes as Gr } from "./BranchLanes.js";
45
45
  import { landingState as Xr, landingSkipGroups as Yr, joinLabels as en } from "./landing-state.js";
@@ -158,8 +158,8 @@ function Hn(e) {
158
158
  }
159
159
  function Vn(e, t) {
160
160
  var v, b, y;
161
- const r = wt(e), a = e == null ? void 0 : e.response, i = ((v = a == null ? void 0 : a.fix) == null ? void 0 : v.action) ?? ((y = (b = a == null ? void 0 : a.data) == null ? void 0 : b.fix) == null ? void 0 : y.action), u = typeof i == "string" && i.trim() || (r ? Jr[r] : void 0);
162
- return !r || !u ? null : { code: r, actionKey: u, transitionId: t.transition_id, comment: t.comment };
161
+ const r = wt(e), a = e == null ? void 0 : e.response, i = ((v = a == null ? void 0 : a.fix) == null ? void 0 : v.action) ?? ((y = (b = a == null ? void 0 : a.data) == null ? void 0 : b.fix) == null ? void 0 : y.action), m = typeof i == "string" && i.trim() || (r ? Jr[r] : void 0);
162
+ return !r || !m ? null : { code: r, actionKey: m, transitionId: t.transition_id, comment: t.comment };
163
163
  }
164
164
  const fa = 600;
165
165
  function Gn(e) {
@@ -167,12 +167,12 @@ function Gn(e) {
167
167
  Ee(() => (i.current = !0, () => {
168
168
  i.current = !1;
169
169
  }), []);
170
- const u = he(e);
171
- u.current = e;
170
+ const m = he(e);
171
+ m.current = e;
172
172
  const v = fn(async () => {
173
173
  a(!0);
174
174
  try {
175
- await t.refetchQueries({ queryKey: [...u.current], type: "active" });
175
+ await t.refetchQueries({ queryKey: [...m.current], type: "active" });
176
176
  } catch {
177
177
  }
178
178
  await new Promise((b) => setTimeout(b, fa)), i.current && a(!1);
@@ -233,12 +233,12 @@ function Xn(e, t) {
233
233
  r.current || (r.current = new ha());
234
234
  const a = r.current, i = he(t);
235
235
  i.current !== t && (i.current = t, a.reset());
236
- const [, u] = J(0), v = e ? e.join(",") : null;
236
+ const [, m] = J(0), v = e ? e.join(",") : null;
237
237
  return gt(() => {
238
238
  e && a.observe(e, Date.now());
239
239
  }, [a, v]), Ee(() => {
240
240
  if (!a.hasTimed(Date.now())) return;
241
- const b = setTimeout(() => u((y) => y + 1), ze + 20);
241
+ const b = setTimeout(() => m((y) => y + 1), ze + 20);
242
242
  return () => clearTimeout(b);
243
243
  }, [a, v]), {
244
244
  dimmed: (b) => a.timed(b, Date.now()),
@@ -269,13 +269,13 @@ function ba(e) {
269
269
  return t === 0 ? "today" : t === 1 ? "1 day ago" : `${t} days ago`;
270
270
  }
271
271
  function xa(e, t, r = 40) {
272
- const a = (T) => T == null || T === "" ? "" : String(T), i = a(e), u = a(t), v = (T) => T === "" ? "(empty)" : T;
273
- if (e === void 0) return { old: null, new: Tt(v(u), 0, r) };
274
- if (i.length <= r && u.length <= r) return { old: v(i), new: v(u) };
272
+ const a = (T) => T == null || T === "" ? "" : String(T), i = a(e), m = a(t), v = (T) => T === "" ? "(empty)" : T;
273
+ if (e === void 0) return { old: null, new: Tt(v(m), 0, r) };
274
+ if (i.length <= r && m.length <= r) return { old: v(i), new: v(m) };
275
275
  let b = 0;
276
- for (; b < i.length && b < u.length && i[b] === u[b]; ) b++;
276
+ for (; b < i.length && b < m.length && i[b] === m[b]; ) b++;
277
277
  const y = b > r / 2 ? b - Math.floor(r / 3) : 0;
278
- return { old: Tt(v(i), y, r), new: Tt(v(u), y, r) };
278
+ return { old: Tt(v(i), y, r), new: Tt(v(m), y, r) };
279
279
  }
280
280
  function Tt(e, t, r) {
281
281
  const a = Math.min(t, Math.max(0, e.length - r)), i = e.slice(a, a + r);
@@ -293,7 +293,7 @@ function Zn(e, t) {
293
293
  staleTime: 0,
294
294
  retry: !1
295
295
  }),
296
- new Promise((u) => setTimeout(() => u(null), va))
296
+ new Promise((m) => setTimeout(() => m(null), va))
297
297
  ]);
298
298
  return ga(i == null ? void 0 : i.lines);
299
299
  } catch {
@@ -320,8 +320,8 @@ function er({ lines: e }) {
320
320
  function it(e, t, r) {
321
321
  if (!r) return !1;
322
322
  const a = t.find(
323
- (u) => String(u.id).toUpperCase() === String(r).toUpperCase()
324
- ), i = t.find((u) => String(u.id).toUpperCase() === String(e.to_state).toUpperCase());
323
+ (m) => String(m.id).toUpperCase() === String(r).toUpperCase()
324
+ ), i = t.find((m) => String(m.id).toUpperCase() === String(e.to_state).toUpperCase());
325
325
  return !!a && !!i && i.sort < a.sort;
326
326
  }
327
327
  function Ut(e, t, r) {
@@ -329,7 +329,7 @@ function Ut(e, t, r) {
329
329
  if (!e) return !1;
330
330
  if ((((i = e.order_partners) == null ? void 0 : i.length) ?? 0) > 0) return !0;
331
331
  if (it(e, t, r)) return !1;
332
- const a = t.find((u) => String(u.id).toUpperCase() === String(e.to_state).toUpperCase());
332
+ const a = t.find((m) => String(m.id).toUpperCase() === String(e.to_state).toUpperCase());
333
333
  return !!(a != null && a.is_terminal) && !/(^|_)cancel/i.test(String(a.key ?? ""));
334
334
  }
335
335
  const sn = {
@@ -365,7 +365,7 @@ function tr({
365
365
  item: t,
366
366
  tx: r
367
367
  }) {
368
- const a = We(), i = (r == null ? void 0 : r.order_partners) ?? [], { data: u } = $e({
368
+ const a = We(), i = (r == null ? void 0 : r.order_partners) ?? [], { data: m } = $e({
369
369
  queryKey: ["push-preflight", e, t, "t", (r == null ? void 0 : r.id) ?? ""],
370
370
  queryFn: () => a.request(
371
371
  Fe(`/integration-preview/${e}/${encodeURIComponent(t)}/preflight`, {
@@ -376,7 +376,7 @@ function tr({
376
376
  staleTime: 2e4
377
377
  });
378
378
  if (i.length === 0) return null;
379
- const v = u != null && u.pushes ? u.pushes.filter((y) => y.status === "would_push" && i.includes(y.api_name)).map((y) => on(y.api_name)) : null, b = [...new Set(v ?? i.map(on))];
379
+ const v = m != null && m.pushes ? m.pushes.filter((y) => y.status === "would_push" && i.includes(y.api_name)).map((y) => on(y.api_name)) : null, b = [...new Set(v ?? i.map(on))];
380
380
  return /* @__PURE__ */ s(
381
381
  "p",
382
382
  {
@@ -399,17 +399,17 @@ function nr(e) {
399
399
  }
400
400
  function rr(e, t, r, a) {
401
401
  if (!a || a.size === 0) return e;
402
- const i = new Set([...a.keys()].map((u) => String(u).toUpperCase()));
402
+ const i = new Set([...a.keys()].map((m) => String(m).toUpperCase()));
403
403
  return e.filter(
404
- (u) => !(!u.to_previous && i.has(String(u.to_state).toUpperCase()) && it(u, t, r))
404
+ (m) => !(!m.to_previous && i.has(String(m.to_state).toUpperCase()) && it(m, t, r))
405
405
  );
406
406
  }
407
407
  function ar(e, t, r) {
408
- var y, T, h, R, N, _;
408
+ var y, T, h, P, N, _;
409
409
  const a = [...(e == null ? void 0 : e.available_transitions) ?? [], ...(e == null ? void 0 : e.all_transitions) ?? []].find(
410
410
  (S) => S.id === t
411
- ), i = r == null ? void 0 : r.data, u = ((y = i == null ? void 0 : i.new_state) == null ? void 0 : y.id) ?? ((T = i == null ? void 0 : i.instance) == null ? void 0 : T.current_state) ?? null, v = ((h = i == null ? void 0 : i.new_state) == null ? void 0 : h.label) ?? (a ? (N = (R = e == null ? void 0 : e.states) == null ? void 0 : R.find((S) => S.id === a.to_state)) == null ? void 0 : N.label : void 0) ?? null, b = ((_ = e == null ? void 0 : e.instance) == null ? void 0 : _.current_state) ?? null;
412
- return b && u && String(b) === String(u) ? "Nothing moved" : a != null && a.label && v ? `${a.label} — now ${v}` : v ? `Moved to ${v}` : a != null && a.label ? `${a.label} done` : "Transition executed";
411
+ ), i = r == null ? void 0 : r.data, m = ((y = i == null ? void 0 : i.new_state) == null ? void 0 : y.id) ?? ((T = i == null ? void 0 : i.instance) == null ? void 0 : T.current_state) ?? null, v = ((h = i == null ? void 0 : i.new_state) == null ? void 0 : h.label) ?? (a ? (N = (P = e == null ? void 0 : e.states) == null ? void 0 : P.find((S) => S.id === a.to_state)) == null ? void 0 : N.label : void 0) ?? null, b = ((_ = e == null ? void 0 : e.instance) == null ? void 0 : _.current_state) ?? null;
412
+ return b && m && String(b) === String(m) ? "Nothing moved" : a != null && a.label && v ? `${a.label} — now ${v}` : v ? `Moved to ${v}` : a != null && a.label ? `${a.label} done` : "Transition executed";
413
413
  }
414
414
  const ya = 1200;
415
415
  function sr(e) {
@@ -443,10 +443,10 @@ function ka(e, t, r) {
443
443
  (y, T) => new Date(T.timestamp).getTime() - new Date(y.timestamp).getTime()
444
444
  )[0];
445
445
  if (!(i != null && i.from_state) || String(i.to_state).toUpperCase() !== String(t).toUpperCase() || !((b = i.comment) != null && b.trim()) || i.origin && i.origin !== "person") return null;
446
- const u = a.get(String(i.from_state).toUpperCase()), v = a.get(String(i.to_state).toUpperCase());
447
- return u == null || v == null || v >= u ? null : i;
446
+ const m = a.get(String(i.from_state).toUpperCase()), v = a.get(String(i.to_state).toUpperCase());
447
+ return m == null || v == null || v >= m ? null : i;
448
448
  }
449
- function Pe({ className: e }) {
449
+ function Re({ className: e }) {
450
450
  return /* @__PURE__ */ n(
451
451
  dn,
452
452
  {
@@ -477,7 +477,7 @@ function Dt({
477
477
  "data-move-blocked-note": a.code,
478
478
  className: "flex max-w-[280px] items-start gap-2 px-2 py-1.5 text-[11px] leading-snug text-slate-600 dark:text-slate-300",
479
479
  children: [
480
- /* @__PURE__ */ n(Pe, { className: "mt-0.5" }),
480
+ /* @__PURE__ */ n(Re, { className: "mt-0.5" }),
481
481
  /* @__PURE__ */ s("span", { className: "min-w-0", children: [
482
482
  a.message,
483
483
  r.length > 1 && /* @__PURE__ */ s("span", { className: "mt-0.5 block text-amber-800/80 dark:text-amber-300/80", children: [
@@ -528,11 +528,11 @@ function lr({
528
528
  offer: r,
529
529
  onFixed: a,
530
530
  onDismiss: i,
531
- className: u,
531
+ className: m,
532
532
  style: v
533
533
  }) {
534
- const [b, y] = J(""), { action: T, isLoading: h, run: R } = Zr(e, t, r.actionKey), N = Je({
535
- mutationFn: () => R(b),
534
+ const [b, y] = J(""), { action: T, isLoading: h, run: P } = Zr(e, t, r.actionKey), N = Je({
535
+ mutationFn: () => P(b),
536
536
  onSuccess: () => {
537
537
  ee.success(`${(T == null ? void 0 : T.label) ?? "Done"} — trying again`), a();
538
538
  },
@@ -545,7 +545,7 @@ function lr({
545
545
  {
546
546
  className: ne(
547
547
  "space-y-2 rounded-lg border border-amber-200 bg-amber-50 p-3 dark:border-amber-500/30 dark:bg-amber-950",
548
- u
548
+ m
549
549
  ),
550
550
  style: v,
551
551
  "data-refusal-fix": r.code,
@@ -601,8 +601,8 @@ function lr({
601
601
  function Na(e) {
602
602
  const t = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
603
603
  if (!t) return !0;
604
- const r = Number.parseInt(t[1], 16), [a, i, u] = [r >> 16 & 255, r >> 8 & 255, r & 255];
605
- return Math.max(a, i, u) - Math.min(a, i, u) < 48;
604
+ const r = Number.parseInt(t[1], 16), [a, i, m] = [r >> 16 & 255, r >> 8 & 255, r & 255];
605
+ return Math.max(a, i, m) - Math.min(a, i, m) < 48;
606
606
  }
607
607
  function Ie({
608
608
  label: e,
@@ -647,23 +647,23 @@ function Sa({
647
647
  a ?? "",
648
648
  dr(e, t),
649
649
  !!r && !!a && e.length > 1
650
- ), u = [...e].sort(
651
- (h, R) => new Date(h.timestamp).getTime() - new Date(R.timestamp).getTime()
650
+ ), m = [...e].sort(
651
+ (h, P) => new Date(h.timestamp).getTime() - new Date(P.timestamp).getTime()
652
652
  );
653
- if (u.length === 0) return null;
654
- const v = t ? new Date(t).getTime() : Date.now(), b = u.map((h, R) => {
655
- const N = new Date(h.timestamp).getTime(), _ = R + 1 < u.length ? new Date(u[R + 1].timestamp).getTime() : v;
653
+ if (m.length === 0) return null;
654
+ const v = t ? new Date(t).getTime() : Date.now(), b = m.map((h, P) => {
655
+ const N = new Date(h.timestamp).getTime(), _ = P + 1 < m.length ? new Date(m[P + 1].timestamp).getTime() : v;
656
656
  return {
657
657
  key: h.id,
658
658
  label: h.to_state_label,
659
659
  color: h.to_state_color,
660
660
  ms: Math.max(0, _ - N),
661
- current: R === u.length - 1 && !t,
661
+ current: P === m.length - 1 && !t,
662
662
  timing: (i == null ? void 0 : i.get(Number(h.id))) ?? null
663
663
  };
664
664
  }).filter((h) => h.ms > 0 || h.current);
665
665
  if (b.length < 2) return null;
666
- const y = b.reduce((h, R) => h + R.ms, 0);
666
+ const y = b.reduce((h, P) => h + P.ms, 0);
667
667
  if (y <= 0) return null;
668
668
  const T = b.some((h) => h.timing);
669
669
  return /* @__PURE__ */ s("div", { "data-state-timeline": !0, "data-step-timing": T ? "split" : void 0, children: [
@@ -679,7 +679,7 @@ function Sa({
679
679
  ] })
680
680
  ] }),
681
681
  /* @__PURE__ */ n("div", { className: "flex h-4 w-full overflow-hidden rounded", children: b.map((h) => {
682
- const R = h.ms / y * 100, N = h.timing, _ = N ? N.waiting_ms + N.working_ms : 0, S = N && _ > 0 ? N.waiting_ms / _ * 100 : 0, q = [
682
+ const P = h.ms / y * 100, N = h.timing, _ = N ? N.waiting_ms + N.working_ms : 0, S = N && _ > 0 ? N.waiting_ms / _ * 100 : 0, q = [
683
683
  `${h.label} — ${Mt(h.ms)}${h.current ? " (current)" : ""}`,
684
684
  N ? Un(N) : null,
685
685
  N ? In(N) : null
@@ -691,7 +691,7 @@ function Sa({
691
691
  "data-step-visit": h.key,
692
692
  className: "relative flex min-w-[8px] items-center overflow-hidden border-r border-white/60 last:border-r-0 dark:border-black/30",
693
693
  style: {
694
- width: `${R}%`,
694
+ width: `${P}%`,
695
695
  backgroundColor: N ? void 0 : h.color ? `${h.color}55` : "rgba(100,116,139,.25)"
696
696
  },
697
697
  children: [
@@ -713,7 +713,7 @@ function Sa({
713
713
  }
714
714
  )
715
715
  ] }),
716
- R >= 14 && /* @__PURE__ */ s("span", { className: "relative truncate px-1.5 text-[9.5px] font-medium leading-none text-slate-700 dark:text-slate-200", children: [
716
+ P >= 14 && /* @__PURE__ */ s("span", { className: "relative truncate px-1.5 text-[9.5px] font-medium leading-none text-slate-700 dark:text-slate-200", children: [
717
717
  h.label,
718
718
  " · ",
719
719
  Mt(h.ms)
@@ -741,7 +741,7 @@ function Ca({
741
741
  availableTransitions: r,
742
742
  currentStateId: a,
743
743
  history: i,
744
- onPathIds: u,
744
+ onPathIds: m,
745
745
  skippedStates: v,
746
746
  travel: b,
747
747
  onShowHistory: y
@@ -758,7 +758,7 @@ function Ca({
758
758
  const C = p.getBoundingClientRect();
759
759
  p.scrollLeft += g.getBoundingClientRect().left - C.left - 2;
760
760
  }, [a]);
761
- const [h, R] = J({
761
+ const [h, P] = J({
762
762
  left: !1,
763
763
  right: !1
764
764
  });
@@ -767,7 +767,7 @@ function Ca({
767
767
  if (!p) return;
768
768
  const $ = () => {
769
769
  const g = p.scrollLeft > 2, C = p.scrollLeft + p.clientWidth < p.scrollWidth - 2;
770
- R((K) => K.left === g && K.right === C ? K : { left: g, right: C });
770
+ P((K) => K.left === g && K.right === C ? K : { left: g, right: C });
771
771
  };
772
772
  $(), p.addEventListener("scroll", $, { passive: !0 });
773
773
  const w = typeof ResizeObserver < "u" ? new ResizeObserver($) : null;
@@ -780,28 +780,28 @@ function Ca({
780
780
  const S = (G = i[0]) == null ? void 0 : G.from_state;
781
781
  S && S !== a && N.add(S);
782
782
  const q = (() => {
783
- if (u)
784
- return e.filter((o) => u.has(o.id) || N.has(o.id) || o.id === a).filter((o) => {
785
- const P = o.stage_visibility ?? "always";
786
- return P === "hide" ? !1 : P === "hide_unless_active" ? N.has(o.id) || o.id === a : !0;
787
- }).sort((o, P) => o.sort - P.sort);
783
+ if (m)
784
+ return e.filter((o) => m.has(o.id) || N.has(o.id) || o.id === a).filter((o) => {
785
+ const R = o.stage_visibility ?? "always";
786
+ return R === "hide" ? !1 : R === "hide_unless_active" ? N.has(o.id) || o.id === a : !0;
787
+ }).sort((o, R) => o.sort - R.sort);
788
788
  if (t.length === 0) {
789
789
  const o = /* @__PURE__ */ new Set([...N]);
790
- return a && o.add(a), e.filter((P) => o.has(P.id)).sort((P, L) => P.sort - L.sort);
790
+ return a && o.add(a), e.filter((R) => o.has(R.id)).sort((R, L) => R.sort - L.sort);
791
791
  }
792
792
  const p = new Set(
793
793
  i.filter((o) => o.from_state).map((o) => `${o.from_state}:${o.to_state}`)
794
794
  ), $ = new Set(i.map((o) => o.from_state).filter(Boolean)), w = t.filter((o) => o.from_state !== null), g = /* @__PURE__ */ new Map();
795
795
  for (const o of w) {
796
- const P = o.from_state;
797
- if ($.has(P) && !p.has(`${P}:${o.to_state}`)) continue;
798
- const L = g.get(P) ?? [];
799
- L.push(o.to_state), g.set(P, L);
796
+ const R = o.from_state;
797
+ if ($.has(R) && !p.has(`${R}:${o.to_state}`)) continue;
798
+ const L = g.get(R) ?? [];
799
+ L.push(o.to_state), g.set(R, L);
800
800
  }
801
801
  if (a) {
802
- const o = w.filter((P) => P.from_state === a).map((P) => P.to_state);
802
+ const o = w.filter((R) => R.from_state === a).map((R) => R.to_state);
803
803
  g.set(a, [
804
- .../* @__PURE__ */ new Set([...r.map((P) => P.to_state), ...o])
804
+ .../* @__PURE__ */ new Set([...r.map((R) => R.to_state), ...o])
805
805
  ]);
806
806
  }
807
807
  const C = /* @__PURE__ */ new Set(), K = e.filter((o) => o.is_initial).map((o) => o.id);
@@ -809,17 +809,17 @@ function Ca({
809
809
  const o = K.shift();
810
810
  if (!C.has(o)) {
811
811
  C.add(o);
812
- for (const P of g.get(o) ?? []) C.has(P) || K.push(P);
812
+ for (const R of g.get(o) ?? []) C.has(R) || K.push(R);
813
813
  }
814
814
  }
815
815
  const be = /* @__PURE__ */ new Set([...C, ...N]);
816
816
  return a && be.add(a), e.filter((o) => be.has(o.id)).filter((o) => {
817
- const P = o.stage_visibility ?? "always";
818
- return P === "hide" ? !1 : P === "hide_unless_active" ? N.has(o.id) || o.id === a : !0;
819
- }).sort((o, P) => o.sort - P.sort);
817
+ const R = o.stage_visibility ?? "always";
818
+ return R === "hide" ? !1 : R === "hide_unless_active" ? N.has(o.id) || o.id === a : !0;
819
+ }).sort((o, R) => o.sort - R.sort);
820
820
  })();
821
821
  if (q.length < 2) return null;
822
- const V = q.findIndex((p) => p.id === a), B = Pr(
822
+ const V = q.findIndex((p) => p.id === a), B = Rr(
823
823
  q.map((p) => p.id),
824
824
  b ?? null
825
825
  ), re = new Map(q.map((p, $) => [p.id, $])), ie = new Map(e.map((p) => [p.id, p.label]));
@@ -872,7 +872,7 @@ function Ca({
872
872
  className: "flex w-full items-start px-2",
873
873
  style: { minWidth: `${q.length * 116 - 40 + 16}px` },
874
874
  children: q.map((p, $) => {
875
- const w = p.id === a, g = N.has(p.id), C = g && !w && (V < 0 || $ < V), K = g && !w && !C, be = !g && !w ? ge.get(p.id) : void 0, o = !g && !w ? v == null ? void 0 : v.get(p.id) : void 0, P = be || o ? [...be ? [_e(be)] : [], ...o ?? []] : void 0, L = P !== void 0, Me = p.color ?? "#94a3b8", te = $ === q.length - 1, Ce = te ? null : q[$ + 1], ce = Ce ? de(p.id, Ce.id) : [];
875
+ const w = p.id === a, g = N.has(p.id), C = g && !w && (V < 0 || $ < V), K = g && !w && !C, be = !g && !w ? ge.get(p.id) : void 0, o = !g && !w ? v == null ? void 0 : v.get(p.id) : void 0, R = be || o ? [...be ? [_e(be)] : [], ...o ?? []] : void 0, L = R !== void 0, Me = p.color ?? "#94a3b8", te = $ === q.length - 1, Ce = te ? null : q[$ + 1], ce = Ce ? de(p.id, Ce.id) : [];
876
876
  return /* @__PURE__ */ s("div", { className: "flex flex-1 items-start", "data-track-step": !0, children: [
877
877
  /* @__PURE__ */ s("div", { className: "flex min-w-[76px] flex-1 flex-col items-center gap-1.5 px-1", children: [
878
878
  /* @__PURE__ */ n(
@@ -925,7 +925,7 @@ function Ca({
925
925
  ) }),
926
926
  /* @__PURE__ */ s(ut, { className: "max-w-[260px]", children: [
927
927
  /* @__PURE__ */ n("p", { className: "text-[11px] font-medium", children: "Skipped for this record" }),
928
- P.length > 0 ? /* @__PURE__ */ n("ul", { className: "mt-1 space-y-0.5 text-[11px] opacity-90", children: P.map((D) => /* @__PURE__ */ n("li", { children: D }, D)) }) : /* @__PURE__ */ n("p", { className: "mt-1 text-[11px] opacity-90", children: "Its skip conditions are met." })
928
+ R.length > 0 ? /* @__PURE__ */ n("ul", { className: "mt-1 space-y-0.5 text-[11px] opacity-90", children: R.map((D) => /* @__PURE__ */ n("li", { children: D }, D)) }) : /* @__PURE__ */ n("p", { className: "mt-1 text-[11px] opacity-90", children: "Its skip conditions are met." })
929
929
  ] })
930
930
  ] }) : /* @__PURE__ */ n(
931
931
  "span",
@@ -1084,16 +1084,16 @@ function $a({
1084
1084
  dr(e, a),
1085
1085
  !!t && !!r && e.length > 0
1086
1086
  );
1087
- return e.length === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 italic", children: "No transitions yet." }) : /* @__PURE__ */ n("div", { className: "space-y-3", children: e.map((u) => {
1087
+ return e.length === 0 ? /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 italic", children: "No transitions yet." }) : /* @__PURE__ */ n("div", { className: "space-y-3", children: e.map((m) => {
1088
1088
  var N;
1089
- const v = at(u), b = v ? ht(u) : Lt([u.first_name, u.last_name].filter(Boolean).join(" ") || u.user_email, u), y = ma(u), T = u.comment && !v && !y ? u.comment : null, h = y ?? (v ? Ot(u) : null), R = (i == null ? void 0 : i.get(Number(u.id))) ?? null;
1089
+ const v = at(m), b = v ? ht(m) : Lt([m.first_name, m.last_name].filter(Boolean).join(" ") || m.user_email, m), y = ma(m), T = m.comment && !v && !y ? m.comment : null, h = y ?? (v ? Ot(m) : null), P = (i == null ? void 0 : i.get(Number(m.id))) ?? null;
1090
1090
  return /* @__PURE__ */ s("div", { className: "flex items-start gap-2.5 text-[12px]", children: [
1091
1091
  /* @__PURE__ */ n("div", { className: "mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-slate-200" }),
1092
1092
  /* @__PURE__ */ s("div", { className: "flex-1 min-w-0", children: [
1093
1093
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5 flex-wrap", children: [
1094
- u.from_state_label ? /* @__PURE__ */ n(Ie, { label: u.from_state_label, color: u.from_state_color, small: !0 }) : /* @__PURE__ */ n("span", { className: "text-[11px] text-slate-400 italic", children: "started" }),
1094
+ m.from_state_label ? /* @__PURE__ */ n(Ie, { label: m.from_state_label, color: m.from_state_color, small: !0 }) : /* @__PURE__ */ n("span", { className: "text-[11px] text-slate-400 italic", children: "started" }),
1095
1095
  /* @__PURE__ */ n(Et, { className: "h-3 w-3 shrink-0 text-slate-300" }),
1096
- /* @__PURE__ */ n(Ie, { label: u.to_state_label, color: u.to_state_color, small: !0 })
1096
+ /* @__PURE__ */ n(Ie, { label: m.to_state_label, color: m.to_state_color, small: !0 })
1097
1097
  ] }),
1098
1098
  T && /* @__PURE__ */ s("p", { className: "mt-1 text-slate-500 italic", children: [
1099
1099
  '"',
@@ -1104,34 +1104,34 @@ function $a({
1104
1104
  "p",
1105
1105
  {
1106
1106
  className: "mt-0.5 text-slate-400",
1107
- "data-history-on-behalf": u.on_behalf_of_name ? u.on_behalf_of ?? "" : void 0,
1108
- "data-history-acting-admin": ((N = u.acting_admin) == null ? void 0 : N.id) || void 0,
1107
+ "data-history-on-behalf": m.on_behalf_of_name ? m.on_behalf_of ?? "" : void 0,
1108
+ "data-history-acting-admin": ((N = m.acting_admin) == null ? void 0 : N.id) || void 0,
1109
1109
  children: [
1110
1110
  v && /* @__PURE__ */ n(un, { className: "mr-1 inline h-3 w-3", "aria-hidden": !0 }),
1111
1111
  b,
1112
1112
  h ? ` · ${h}` : "",
1113
1113
  " · ",
1114
- /* @__PURE__ */ n(Bt, { value: u.timestamp })
1114
+ /* @__PURE__ */ n(Bt, { value: m.timestamp })
1115
1115
  ]
1116
1116
  }
1117
1117
  ),
1118
- R && /* @__PURE__ */ s(
1118
+ P && /* @__PURE__ */ s(
1119
1119
  "p",
1120
1120
  {
1121
1121
  className: "mt-0.5 flex items-center gap-1 text-[11px] text-slate-500 dark:text-slate-400",
1122
- "data-history-timing": u.id,
1123
- "data-tip": In(R) ?? void 0,
1122
+ "data-history-timing": m.id,
1123
+ "data-tip": In(P) ?? void 0,
1124
1124
  children: [
1125
1125
  /* @__PURE__ */ n(wr, { className: "h-3 w-3 shrink-0 text-slate-400", "aria-hidden": !0 }),
1126
1126
  "In ",
1127
- u.to_state_label,
1127
+ m.to_state_label,
1128
1128
  ": ",
1129
- Un(R)
1129
+ Un(P)
1130
1130
  ]
1131
1131
  }
1132
1132
  )
1133
1133
  ] })
1134
- ] }, u.id);
1134
+ ] }, m.id);
1135
1135
  }) });
1136
1136
  }
1137
1137
  function ln({
@@ -1174,10 +1174,10 @@ function Ta({
1174
1174
  states: r,
1175
1175
  currentStateId: a,
1176
1176
  returned: i = !1,
1177
- standInReason: u = null
1177
+ standInReason: m = null
1178
1178
  }) {
1179
1179
  var l, Ke, Ne, xe, qe;
1180
- const v = We(), b = Ze(), { isAdmin: y, userId: T } = hn(), [h, R] = J(!1), [N, _] = J(""), [S, q] = J(""), [V, B] = J(!1), re = ["pipeline-instance-owners", e, t], ie = ["pipeline-owners-can-add", e, t], de = () => v.request(
1180
+ const v = We(), b = Ze(), { isAdmin: y, userId: T } = hn(), [h, P] = J(!1), [N, _] = J(""), [S, q] = J(""), [V, B] = J(!1), re = ["pipeline-instance-owners", e, t], ie = ["pipeline-owners-can-add", e, t], de = () => v.request(
1181
1181
  Fe(`/pipelines/instance/${e}/${t}/owners`)
1182
1182
  ).then((c) => {
1183
1183
  var j;
@@ -1212,12 +1212,12 @@ function Ta({
1212
1212
  ).then((c) => c.data ?? null),
1213
1213
  enabled: K && be && C === 0,
1214
1214
  staleTime: 6e4
1215
- }), P = K && C === 0 && (o != null && o.name) ? o : null, L = r.find((c) => c.id === a), Me = (Z ?? []).some(
1215
+ }), R = K && C === 0 && (o != null && o.name) ? o : null, L = r.find((c) => c.id === a), Me = (Z ?? []).some(
1216
1216
  (c) => !c.state || c.state === a || c.state === (L == null ? void 0 : L.key)
1217
- ), te = !!L && w.length > 0 && w.every((c) => c.queue_only) && !Me, Ce = u && u.state.id.toUpperCase() === String(a).toUpperCase() ? u : null, ce = da(Ce), D = !!T && [
1217
+ ), te = !!L && w.length > 0 && w.every((c) => c.queue_only) && !Me, Ce = m && m.state.id.toUpperCase() === String(a).toUpperCase() ? m : null, ce = da(Ce), D = !!T && [
1218
1218
  ...a ? (((xe = G == null ? void 0 : G[a]) == null ? void 0 : xe.owners) ?? []).map((c) => c.id) : [],
1219
1219
  ...(Z ?? []).filter((c) => !c.state || c.state === a || c.state === (L == null ? void 0 : L.key)).map((c) => c.user)
1220
- ].some((c) => String(c).toUpperCase() === T.toUpperCase()), Q = !!a && be && C > 0 && !P && !(L != null && L.is_terminal) && !D, oe = () => {
1220
+ ].some((c) => String(c).toUpperCase() === T.toUpperCase()), Q = !!a && be && C > 0 && !R && !(L != null && L.is_terminal) && !D, oe = () => {
1221
1221
  b.invalidateQueries({ queryKey: re }), b.invalidateQueries({ queryKey: ["pipeline-instance", e, t] });
1222
1222
  }, me = Je({
1223
1223
  mutationFn: () => v.request(
@@ -1227,7 +1227,7 @@ function Ta({
1227
1227
  })
1228
1228
  ),
1229
1229
  onSuccess: () => {
1230
- oe(), _(""), q(""), R(!1), ee.success("Owner added");
1230
+ oe(), _(""), q(""), P(!1), ee.success("Owner added");
1231
1231
  },
1232
1232
  // The server's reason (a 403 says why), not a bare status phrase.
1233
1233
  onError: (c) => ee.error(je(c, "Failed to add owner"))
@@ -1262,7 +1262,7 @@ function Ta({
1262
1262
  /* @__PURE__ */ s("span", { className: "flex items-center gap-1.5 text-[11px] font-medium text-slate-400", children: [
1263
1263
  /* @__PURE__ */ n(mn, { className: "h-3.5 w-3.5" }),
1264
1264
  "Owners",
1265
- I || p ? /* @__PURE__ */ n("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : P ? null : /* @__PURE__ */ s("span", { className: "text-slate-300", children: [
1265
+ I || p ? /* @__PURE__ */ n("span", { className: "inline-block h-3 w-4 animate-pulse rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : R ? null : /* @__PURE__ */ s("span", { className: "text-slate-300", children: [
1266
1266
  "(",
1267
1267
  C,
1268
1268
  ")"
@@ -1274,7 +1274,7 @@ function Ta({
1274
1274
  "button",
1275
1275
  {
1276
1276
  type: "button",
1277
- onClick: () => R(!0),
1277
+ onClick: () => P(!0),
1278
1278
  className: "flex items-center gap-1 text-[11px] text-slate-400 transition-colors hover:text-nvr-cyan",
1279
1279
  children: [
1280
1280
  /* @__PURE__ */ n(xr, { className: "h-3 w-3" }),
@@ -1287,22 +1287,22 @@ function Ta({
1287
1287
  I || p ? /* @__PURE__ */ s("div", { className: "flex items-center gap-2 py-1.5 text-[12px] text-slate-400", children: [
1288
1288
  /* @__PURE__ */ n(Ae, { className: "h-3.5 w-3.5 animate-spin" }),
1289
1289
  "Resolving owners…"
1290
- ] }) : P ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
1290
+ ] }) : R ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: [
1291
1291
  i ? "Back with" : "With",
1292
1292
  " ",
1293
- /* @__PURE__ */ n(yn, { userId: P.id, children: /* @__PURE__ */ n(
1293
+ /* @__PURE__ */ n(yn, { userId: R.id, children: /* @__PURE__ */ n(
1294
1294
  "button",
1295
1295
  {
1296
1296
  type: "button",
1297
- "aria-label": `${P.name} — profile`,
1297
+ "aria-label": `${R.name} — profile`,
1298
1298
  className: "rounded font-medium text-slate-700 underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:text-foreground",
1299
- children: P.name
1299
+ children: R.name
1300
1300
  }
1301
1301
  ) }),
1302
1302
  /* @__PURE__ */ n(
1303
1303
  $t,
1304
1304
  {
1305
- person: { id: String(P.id), name: P.name ?? "" },
1305
+ person: { id: String(R.id), name: R.name ?? "" },
1306
1306
  className: "ml-1 inline-flex align-middle"
1307
1307
  }
1308
1308
  )
@@ -1476,7 +1476,7 @@ function Ta({
1476
1476
  variant: "ghost",
1477
1477
  className: "h-7 text-[12px]",
1478
1478
  onClick: () => {
1479
- R(!1), _(""), q("");
1479
+ P(!1), _(""), q("");
1480
1480
  },
1481
1481
  children: "Cancel"
1482
1482
  }
@@ -1498,8 +1498,8 @@ function Ta({
1498
1498
  }
1499
1499
  function cr(e, t, r, a) {
1500
1500
  if (!e || !(r != null && r.length)) return null;
1501
- const u = new Map(r.map((y) => [String(y.id).toUpperCase(), y])).get(String(e.to_state).toUpperCase()), v = Number(t == null ? void 0 : t.sort);
1502
- if (!u || !Number.isFinite(v) || !(Number(u.sort) > v)) return null;
1501
+ const m = new Map(r.map((y) => [String(y.id).toUpperCase(), y])).get(String(e.to_state).toUpperCase()), v = Number(t == null ? void 0 : t.sort);
1502
+ if (!m || !Number.isFinite(v) || !(Number(m.sort) > v)) return null;
1503
1503
  const b = Xr(String(e.to_state), r, a);
1504
1504
  return b && b.skipped.length > 0 ? b : null;
1505
1505
  }
@@ -1559,13 +1559,13 @@ function Ma({
1559
1559
  currentStateId: a,
1560
1560
  history: i
1561
1561
  }) {
1562
- const u = We(), v = Ze(), [b, y] = J(!1), T = he(a);
1562
+ const m = We(), v = Ze(), [b, y] = J(!1), T = he(a);
1563
1563
  Ee(() => {
1564
1564
  T.current !== a && (T.current = a, v.invalidateQueries({ queryKey: ["pipeline-all-owners", e, t] }));
1565
1565
  }, [a, e, t, v]);
1566
- const { data: h, isLoading: R, dataUpdatedAt: N } = $e({
1566
+ const { data: h, isLoading: P, dataUpdatedAt: N } = $e({
1567
1567
  queryKey: ["pipeline-all-owners", e, t],
1568
- queryFn: () => u.request(
1568
+ queryFn: () => m.request(
1569
1569
  Fe(`/pipelines/instance/${e}/${t}/owners/all`)
1570
1570
  ).then((q) => q.data ?? null),
1571
1571
  enabled: b,
@@ -1597,7 +1597,7 @@ function Ma({
1597
1597
  /* @__PURE__ */ n("p", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-100", children: "Approval Chain" }),
1598
1598
  /* @__PURE__ */ n("p", { className: "text-[11px] text-slate-500 mt-0.5 dark:text-slate-400", children: "Owners per pipeline state" })
1599
1599
  ] }),
1600
- /* @__PURE__ */ n("div", { className: "max-h-[min(504px,calc(var(--radix-popover-content-available-height,504px)-64px))] overflow-y-auto overscroll-contain", children: R ? /* @__PURE__ */ n("div", { className: "space-y-px p-3", children: [1, 2, 3].map((q) => /* @__PURE__ */ n(Ue, { className: "h-10 w-full" }, q)) }) : h ? /* @__PURE__ */ n("div", { ref: S, className: "divide-y divide-slate-100 dark:divide-border/60", children: _.map((q) => {
1600
+ /* @__PURE__ */ n("div", { className: "max-h-[min(504px,calc(var(--radix-popover-content-available-height,504px)-64px))] overflow-y-auto overscroll-contain", children: P ? /* @__PURE__ */ n("div", { className: "space-y-px p-3", children: [1, 2, 3].map((q) => /* @__PURE__ */ n(Ue, { className: "h-10 w-full" }, q)) }) : h ? /* @__PURE__ */ n("div", { ref: S, className: "divide-y divide-slate-100 dark:divide-border/60", children: _.map((q) => {
1601
1601
  var ge, _e, G, p, $, w;
1602
1602
  const V = (((ge = h[q.id]) == null ? void 0 : ge.owners) ?? []).map((g) => ({
1603
1603
  id: g.id,
@@ -1724,13 +1724,13 @@ function Ms({
1724
1724
  defaultExpanded: r,
1725
1725
  title: a,
1726
1726
  showApprovalChain: i,
1727
- hideActionsCollapsed: u,
1727
+ hideActionsCollapsed: m,
1728
1728
  hideActionsExpanded: v,
1729
1729
  onBeforeTransition: b,
1730
1730
  addendumPending: y,
1731
1731
  addendumView: T,
1732
1732
  asRole: h,
1733
- asUser: R
1733
+ asUser: P
1734
1734
  }) {
1735
1735
  return t === "new" ? null : /* @__PURE__ */ n(
1736
1736
  qa,
@@ -1740,13 +1740,13 @@ function Ms({
1740
1740
  defaultExpanded: r,
1741
1741
  title: a,
1742
1742
  showApprovalChain: i,
1743
- hideActionsCollapsed: u,
1743
+ hideActionsCollapsed: m,
1744
1744
  hideActionsExpanded: v,
1745
1745
  onBeforeTransition: b,
1746
1746
  addendumPending: y,
1747
1747
  addendumView: T,
1748
1748
  asRole: h,
1749
- asUser: R
1749
+ asUser: P
1750
1750
  },
1751
1751
  `${e}:${t}`
1752
1752
  );
@@ -1763,10 +1763,10 @@ function ur({
1763
1763
  retry: !1
1764
1764
  });
1765
1765
  if (!i) return /* @__PURE__ */ n(tn, { collection: e, item: t });
1766
- const u = i.field_changes.map((_) => {
1766
+ const m = i.field_changes.map((_) => {
1767
1767
  const S = (V) => V == null || V === "" ? V : oa(String(V), _), q = xa(_.old === void 0 ? void 0 : S(_.old), S(_.new));
1768
1768
  return { f: _, pair: q, noop: q.old !== null && q.old === q.new };
1769
- }), v = u.filter((_) => !_.noop), b = u.filter((_) => _.noop && !_.f.auto).length, y = u.length - v.length, T = Math.max(0, i.changed_total - y), h = Math.max(0, (i.changed_by_people ?? i.changed_total) - b), R = new Set((r ?? []).map(an)), N = (i.lines ?? []).filter((_) => !R.has(an(_)));
1769
+ }), v = m.filter((_) => !_.noop), b = m.filter((_) => _.noop && !_.f.auto).length, y = m.length - v.length, T = Math.max(0, i.changed_total - y), h = Math.max(0, (i.changed_by_people ?? i.changed_total) - b), P = new Set((r ?? []).map(an)), N = (i.lines ?? []).filter((_) => !P.has(an(_)));
1770
1770
  return /* @__PURE__ */ s(Te, { children: [
1771
1771
  /* @__PURE__ */ n(tn, { collection: e, item: t }),
1772
1772
  /* @__PURE__ */ s("div", { className: "rounded-md border border-slate-200 bg-white px-3 py-2 text-[11.5px] dark:border-border dark:bg-card", children: [
@@ -1859,19 +1859,19 @@ function qa({
1859
1859
  defaultExpanded: r,
1860
1860
  title: a,
1861
1861
  showApprovalChain: i,
1862
- hideActionsCollapsed: u,
1862
+ hideActionsCollapsed: m,
1863
1863
  hideActionsExpanded: v,
1864
1864
  onBeforeTransition: b,
1865
1865
  addendumPending: y,
1866
1866
  addendumView: T,
1867
1867
  asRole: h,
1868
- asUser: R
1868
+ asUser: P
1869
1869
  }) {
1870
1870
  var Ht, Vt, Gt, Xt;
1871
- const N = !!h || !!R, _ = We(), S = Ze(), { isAdmin: q } = hn(), [V, B] = J(0), re = he(null);
1871
+ const N = !!h || !!P, _ = We(), S = Ze(), { isAdmin: q } = hn(), [V, B] = J(0), re = he(null);
1872
1872
  Ee(() => {
1873
1873
  if (!q) return;
1874
- const m = (A) => {
1874
+ const u = (A) => {
1875
1875
  const F = A.detail;
1876
1876
  !F || F.claimed || F.collection !== e || String(F.item) !== String(t) || (F.claimed = !0, $(!0), B((U) => U + 1), setTimeout(
1877
1877
  () => {
@@ -1881,12 +1881,12 @@ function qa({
1881
1881
  80
1882
1882
  ));
1883
1883
  };
1884
- return window.addEventListener(Jt, m), () => window.removeEventListener(Jt, m);
1884
+ return window.addEventListener(Jt, u), () => window.removeEventListener(Jt, u);
1885
1885
  }, [q, e, t]);
1886
- const [ie, de] = J(""), [Z, I] = J(null), [ge, _e] = J(!1), G = he(null), [p, $] = Ar(r, !1), [w, g] = J(null), [C, K] = J(null), [be, o] = J(null), [P, L] = J([]), Me = Zn(e, String(t)), [te, Ce] = J([]), ce = jn(e, String(t));
1886
+ const [ie, de] = J(""), [Z, I] = J(null), [ge, _e] = J(!1), G = he(null), [p, $] = Ar(r, !1), [w, g] = J(null), [C, K] = J(null), [be, o] = J(null), [R, L] = J([]), Me = Zn(e, String(t)), [te, Ce] = J([]), ce = jn(e, String(t));
1887
1887
  wn(e, t, "transition", !!Z || !!w), bn(e, t, { hold: !!Z || !!w });
1888
- const D = Tr(e, t, "transition"), Q = he(!1), oe = (m) => {
1889
- Q.current || N || (Q.current = !0, K(null), X.mutate(m, {
1888
+ const D = Tr(e, t, "transition"), Q = he(!1), oe = (u) => {
1889
+ Q.current || N || (Q.current = !0, K(null), X.mutate(u, {
1890
1890
  onSettled: (A, F) => {
1891
1891
  if (F) {
1892
1892
  Q.current = !1;
@@ -1897,7 +1897,7 @@ function qa({
1897
1897
  });
1898
1898
  }
1899
1899
  }));
1900
- }, me = async (m, A) => {
1900
+ }, me = async (u, A) => {
1901
1901
  var ye, pe;
1902
1902
  if (Q.current) return;
1903
1903
  if (N) {
@@ -1907,12 +1907,12 @@ function qa({
1907
1907
  return;
1908
1908
  }
1909
1909
  if (l != null && l.running_move) return;
1910
- if (Z === m) {
1910
+ if (Z === u) {
1911
1911
  I(null);
1912
1912
  return;
1913
1913
  }
1914
- if (!(A != null && A.cleared) && ((l == null ? void 0 : l.available_transitions) ?? []).some((ae) => ae.id === m && ae.advisory)) {
1915
- I(null), K(null), o(m), S.invalidateQueries({ queryKey: ["pipeline-instance", e, t] });
1914
+ if (!(A != null && A.cleared) && ((l == null ? void 0 : l.available_transitions) ?? []).some((ae) => ae.id === u && ae.advisory)) {
1915
+ I(null), K(null), o(u), S.invalidateQueries({ queryKey: ["pipeline-instance", e, t] });
1916
1916
  return;
1917
1917
  }
1918
1918
  if (o(null), b) {
@@ -1934,11 +1934,11 @@ function qa({
1934
1934
  Q.current = !1;
1935
1935
  }
1936
1936
  if (Ce(ae), ae.length > 0) {
1937
- L([]), I(m);
1937
+ L([]), I(u);
1938
1938
  return;
1939
1939
  }
1940
1940
  }
1941
- const F = (O ?? []).find((ae) => ae.id === m), U = String((F == null ? void 0 : F.comment_mode) ?? "none"), H = Ut(F, (l == null ? void 0 : l.states) ?? [], (ye = l == null ? void 0 : l.instance) == null ? void 0 : ye.current_state);
1941
+ const F = (O ?? []).find((ae) => ae.id === u), U = String((F == null ? void 0 : F.comment_mode) ?? "none"), H = Ut(F, (l == null ? void 0 : l.states) ?? [], (ye = l == null ? void 0 : l.instance) == null ? void 0 : ye.current_state);
1942
1942
  if (U !== "optional" && U !== "required") {
1943
1943
  if (F && !it(F, (l == null ? void 0 : l.states) ?? [], (pe = l == null ? void 0 : l.instance) == null ? void 0 : pe.current_state)) {
1944
1944
  Q.current = !0;
@@ -1949,26 +1949,26 @@ function qa({
1949
1949
  Q.current = !1;
1950
1950
  }
1951
1951
  if (ae.length > 0 || H) {
1952
- L(ae), I(m);
1952
+ L(ae), I(u);
1953
1953
  return;
1954
1954
  }
1955
1955
  }
1956
1956
  if (H) {
1957
- L([]), I(m);
1957
+ L([]), I(u);
1958
1958
  return;
1959
1959
  }
1960
- oe({ transition_id: m });
1960
+ oe({ transition_id: u });
1961
1961
  return;
1962
1962
  }
1963
- L([]), I(m);
1964
- }, z = R ? ["pipeline-instance", e, t, "as-user", R] : h ? ["pipeline-instance", e, t, h] : ["pipeline-instance", e, t], { settling: ke, settle: ue } = Gn(z), { data: l, isLoading: Ke } = $e({
1963
+ L([]), I(u);
1964
+ }, z = P ? ["pipeline-instance", e, t, "as-user", P] : h ? ["pipeline-instance", e, t, h] : ["pipeline-instance", e, t], { settling: ke, settle: ue } = Gn(z), { data: l, isLoading: Ke } = $e({
1965
1965
  queryKey: z,
1966
1966
  queryFn: () => _.request(
1967
1967
  Fe(
1968
- `/pipelines/instance/${e}/${t}${R ? `?as_user=${encodeURIComponent(R)}` : h ? `?as_role=${encodeURIComponent(h)}` : ""}`
1968
+ `/pipelines/instance/${e}/${t}${P ? `?as_user=${encodeURIComponent(P)}` : h ? `?as_role=${encodeURIComponent(h)}` : ""}`
1969
1969
  )
1970
1970
  ).then(
1971
- (m) => m.data ?? {
1971
+ (u) => u.data ?? {
1972
1972
  instance: null,
1973
1973
  states: [],
1974
1974
  available_transitions: [],
@@ -1978,19 +1978,19 @@ function qa({
1978
1978
  }
1979
1979
  ),
1980
1980
  staleTime: 1e4,
1981
- refetchInterval: (m) => Tn(m.state.data)
1981
+ refetchInterval: (u) => Tn(u.state.data)
1982
1982
  });
1983
1983
  Mn(!!(l != null && l.running_move), () => {
1984
1984
  Xe(S, e, String(t)), Ye(S, e, String(t)), xt(S, e, String(t));
1985
1985
  });
1986
1986
  const Ne = Xn(
1987
- l ? (l.available_transitions ?? []).map((m) => String(m.id)) : null,
1987
+ l ? (l.available_transitions ?? []).map((u) => String(u.id)) : null,
1988
1988
  `${e}:${t}`
1989
1989
  );
1990
1990
  Ee(
1991
- () => S.getQueryCache().subscribe((m) => {
1992
- if (m.type !== "updated" || m.action.type !== "success") return;
1993
- const A = m.query.queryKey;
1991
+ () => S.getQueryCache().subscribe((u) => {
1992
+ if (u.type !== "updated" || u.action.type !== "success") return;
1993
+ const A = u.query.queryKey;
1994
1994
  Array.isArray(A) && A[0] === "item" && A[1] === e && String(A[2]) === t && S.invalidateQueries({ queryKey: ["pipeline-instance", e, t] });
1995
1995
  }),
1996
1996
  [S, e, t]
@@ -1999,21 +1999,21 @@ function qa({
1999
1999
  queryKey: ["pipeline-all-owners", e, t],
2000
2000
  queryFn: () => _.request(
2001
2001
  Fe(`/pipelines/instance/${e}/${t}/owners/all`)
2002
- ).then((m) => m.data ?? null),
2002
+ ).then((u) => u.data ?? null),
2003
2003
  // Also when a send back is on offer: its target may be a chain step this record skipped.
2004
2004
  // And while a move is being confirmed: the panel names where it really lands.
2005
2005
  enabled: (p || nr(l) || !!Z) && !!(l != null && l.instance),
2006
2006
  staleTime: 3e4
2007
2007
  }), c = gt(() => {
2008
2008
  if (!xe) return null;
2009
- const m = Object.entries(xe);
2010
- return m.length === 0 || m.every(([, A]) => A.on_path === void 0) ? null : new Set(m.filter(([, A]) => A.on_path !== !1).map(([A]) => A));
2009
+ const u = Object.entries(xe);
2010
+ return u.length === 0 || u.every(([, A]) => A.on_path === void 0) ? null : new Set(u.filter(([, A]) => A.on_path !== !1).map(([A]) => A));
2011
2011
  }, [xe]), j = gt(() => {
2012
2012
  if (!xe) return null;
2013
- const m = /* @__PURE__ */ new Map();
2013
+ const u = /* @__PURE__ */ new Map();
2014
2014
  for (const [A, F] of Object.entries(xe))
2015
- F.skipped && m.set(A, F.skip_reasons ?? []);
2016
- return m;
2015
+ F.skipped && u.set(A, F.skip_reasons ?? []);
2016
+ return u;
2017
2017
  }, [xe]), le = Je({
2018
2018
  mutationFn: () => _.request(st(`/pipelines/instance/${e}/${t}/start`, {})),
2019
2019
  onSuccess: () => {
@@ -2022,58 +2022,58 @@ function qa({
2022
2022
  onError: () => ee.error("Failed to start pipeline")
2023
2023
  }), X = Je({
2024
2024
  mutationFn: ({
2025
- transition_id: m,
2025
+ transition_id: u,
2026
2026
  comment: A,
2027
2027
  reviewed: F,
2028
2028
  lock_ack: U
2029
2029
  }) => N ? Promise.reject(new Error("Moves are not made from a preview")) : _.request(
2030
2030
  st(`/pipelines/instance/${e}/${t}/transition`, {
2031
- transition_id: m,
2031
+ transition_id: u,
2032
2032
  comment: A,
2033
2033
  ...F ? { reviewed: !0 } : {},
2034
2034
  ...U ? { lock_ack: !0 } : {},
2035
- ...Rn(l == null ? void 0 : l.available_transitions, m)
2035
+ ...Pn(l == null ? void 0 : l.available_transitions, u)
2036
2036
  })
2037
2037
  ),
2038
- onMutate: (m) => {
2038
+ onMutate: (u) => {
2039
2039
  var A;
2040
2040
  return {
2041
2041
  slow: sr(
2042
2042
  (A = [...(l == null ? void 0 : l.available_transitions) ?? [], ...(l == null ? void 0 : l.all_transitions) ?? []].find(
2043
- (F) => F.id === m.transition_id
2043
+ (F) => F.id === u.transition_id
2044
2044
  )) == null ? void 0 : A.label
2045
2045
  )
2046
2046
  };
2047
2047
  },
2048
- onSuccess: (m, A, F) => {
2048
+ onSuccess: (u, A, F) => {
2049
2049
  S.invalidateQueries({ queryKey: z }), e === "nivaro_addendums" && S.invalidateQueries({ queryKey: ["addendums"] }), Xe(S, e, String(t)), Ye(S, e, String(t)), xt(S, e, String(t)), K(null), de(""), I(null), g(null);
2050
- const U = qn(m);
2050
+ const U = qn(u);
2051
2051
  U ? ee.info(
2052
2052
  `${U.transition_label ?? "The move"} started. You will be told if it does not go through.`,
2053
2053
  F == null ? void 0 : F.slow.done()
2054
- ) : ee.success(ar(l, A.transition_id, m), F == null ? void 0 : F.slow.done());
2054
+ ) : ee.success(ar(l, A.transition_id, u), F == null ? void 0 : F.slow.done());
2055
2055
  },
2056
- onError: (m, A, F) => {
2056
+ onError: (u, A, F) => {
2057
2057
  var ae, Le;
2058
- if (F == null || F.slow.fail(), Qn(m)) {
2058
+ if (F == null || F.slow.fail(), Qn(u)) {
2059
2059
  S.invalidateQueries({ queryKey: z });
2060
2060
  return;
2061
2061
  }
2062
- if (wt(m) === "TRANSITION_RUNNING") {
2063
- S.invalidateQueries({ queryKey: z }), I(null), g(null), ee.info(je(m, "This move is already running on this record."));
2062
+ if (wt(u) === "TRANSITION_RUNNING") {
2063
+ S.invalidateQueries({ queryKey: z }), I(null), g(null), ee.info(je(u, "This move is already running on this record."));
2064
2064
  return;
2065
2065
  }
2066
- const U = Hn(m);
2066
+ const U = Hn(u);
2067
2067
  if (U) {
2068
2068
  I(null);
2069
- const Re = ((ae = [...(l == null ? void 0 : l.available_transitions) ?? [], ...(l == null ? void 0 : l.all_transitions) ?? []].find(
2069
+ const Pe = ((ae = [...(l == null ? void 0 : l.available_transitions) ?? [], ...(l == null ? void 0 : l.all_transitions) ?? []].find(
2070
2070
  (lt) => lt.id === A.transition_id
2071
2071
  )) == null ? void 0 : ae.label) ?? "Move";
2072
2072
  ee.warning(U.message, {
2073
2073
  id: `nvr-locked-move:${e}:${String(t)}`,
2074
2074
  duration: 2e4,
2075
2075
  action: {
2076
- label: `${Re} anyway`,
2076
+ label: `${Pe} anyway`,
2077
2077
  onClick: () => oe({ ...A, lock_ack: !0 })
2078
2078
  },
2079
2079
  cancel: { label: "Wait", onClick: () => {
@@ -2081,36 +2081,36 @@ function qa({
2081
2081
  });
2082
2082
  return;
2083
2083
  }
2084
- const H = zn(m);
2084
+ const H = zn(u);
2085
2085
  if (H) {
2086
- g((Re) => ({
2086
+ g((Pe) => ({
2087
2087
  payload: H,
2088
2088
  transitionId: A.transition_id,
2089
2089
  comment: A.comment,
2090
- revision: ((Re == null ? void 0 : Re.revision) ?? 0) + 1
2090
+ revision: ((Pe == null ? void 0 : Pe.revision) ?? 0) + 1
2091
2091
  }));
2092
2092
  return;
2093
2093
  }
2094
- const ye = m == null ? void 0 : m.response;
2095
- K(Vn(m, A));
2094
+ const ye = u == null ? void 0 : u.response;
2095
+ K(Vn(u, A));
2096
2096
  const pe = xn(
2097
- m,
2097
+ u,
2098
2098
  (Le = [...(l == null ? void 0 : l.available_transitions) ?? [], ...(l == null ? void 0 : l.all_transitions) ?? []].find(
2099
- (Re) => Re.id === A.transition_id
2099
+ (Pe) => Pe.id === A.transition_id
2100
2100
  )) == null ? void 0 : Le.label
2101
2101
  );
2102
- ee.error((pe == null ? void 0 : pe.title) ?? je(m, "Failed to execute transition"), {
2102
+ ee.error((pe == null ? void 0 : pe.title) ?? je(u, "Failed to execute transition"), {
2103
2103
  duration: 12e3,
2104
2104
  // What to do next + Copy details (lib/error-toast.ts); "Why?" below wins the action slot.
2105
2105
  // A partner's refusal copies what the toast said and the other system's answer as
2106
2106
  // stored, never the generic reading of a 422.
2107
- ...gn(pe ? vn(m, pe) : m, {
2107
+ ...gn(pe ? vn(u, pe) : u, {
2108
2108
  action: "Transition"
2109
2109
  }),
2110
2110
  ...pe ? { description: pe.description } : {},
2111
2111
  // #1867: a refusal carries "Why?" — the role, owner or access rule
2112
2112
  // that stopped it, and who can change it.
2113
- ...Cn(m) ? {
2113
+ ...Cn(u) ? {
2114
2114
  action: $n(_, {
2115
2115
  collection: e,
2116
2116
  itemId: String(t),
@@ -2124,7 +2124,7 @@ function qa({
2124
2124
  d.current = me;
2125
2125
  const f = he((l == null ? void 0 : l.available_transitions) ?? []);
2126
2126
  f.current = (l == null ? void 0 : l.available_transitions) ?? [], Ee(() => {
2127
- const m = (A) => {
2127
+ const u = (A) => {
2128
2128
  const F = A.detail;
2129
2129
  if (!F || F.claimed || N || F.collection !== e || String(F.item) !== String(t)) return;
2130
2130
  F.claimed = !0;
@@ -2135,9 +2135,9 @@ function qa({
2135
2135
  }
2136
2136
  d.current(H.id);
2137
2137
  };
2138
- return window.addEventListener(bt, m), () => window.removeEventListener(bt, m);
2138
+ return window.addEventListener(bt, u), () => window.removeEventListener(bt, u);
2139
2139
  }, [e, t, N]);
2140
- const M = Rr(e, t, ((Ht = l == null ? void 0 : l.instance) == null ? void 0 : Ht.current_state) ?? null);
2140
+ const M = Pr(e, t, ((Ht = l == null ? void 0 : l.instance) == null ? void 0 : Ht.current_state) ?? null);
2141
2141
  if (Ke)
2142
2142
  return /* @__PURE__ */ n("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ s("div", { className: "flex w-full items-center gap-2.5 px-5 py-3.5", children: [
2143
2143
  /* @__PURE__ */ n(Ue, { className: "h-3.5 w-3.5 shrink-0 rounded" }),
@@ -2146,22 +2146,22 @@ function qa({
2146
2146
  /* @__PURE__ */ n(Ue, { className: "ml-auto h-3.5 w-3.5 rounded" })
2147
2147
  ] }) });
2148
2148
  if (!(l != null && l.binding)) return null;
2149
- const { instance: x, available_transitions: O, history: se, states: Y } = l, W = new Map((Y ?? []).map((m) => [m.id, m])), ve = (x == null ? void 0 : x.current_state_obj) ?? null, k = Z ? (O ?? []).find((m) => m.id === Z) : null, we = k ? W.get(k.to_state) : null, Be = cr(k, ve, Y, xe), et = (Be == null ? void 0 : Be.state) ?? we, tt = x != null && x.completed_at && O ? O.filter(
2150
- (m) => m.from_state && String(m.from_state).toUpperCase() === String(x.current_state).toUpperCase()
2149
+ const { instance: x, available_transitions: O, history: se, states: Y } = l, W = new Map((Y ?? []).map((u) => [u.id, u])), ve = (x == null ? void 0 : x.current_state_obj) ?? null, k = Z ? (O ?? []).find((u) => u.id === Z) : null, we = k ? W.get(k.to_state) : null, Be = cr(k, ve, Y, xe), et = (Be == null ? void 0 : Be.state) ?? we, tt = x != null && x.completed_at && O ? O.filter(
2150
+ (u) => u.from_state && String(u.from_state).toUpperCase() === String(x.current_state).toUpperCase()
2151
2151
  ) : null, ot = x != null && x.completed_at ? tt ?? [] : rr(
2152
2152
  O ?? [],
2153
2153
  Y ?? [],
2154
2154
  x == null ? void 0 : x.current_state,
2155
2155
  j
2156
- ), yt = An(ot, l.blocked_transitions), kt = yt.length > 0, It = En(ot), nt = be ? ot.find((m) => m.id === be) : null, Oe = (l == null ? void 0 : l.running_move) ?? null, De = Oe ? null : (l == null ? void 0 : l.last_move_problem) ?? null, jt = De ? ot.find((m) => Ft(m.id, De.transition_id)) : null, Wt = (m, A = !1) => {
2156
+ ), yt = An(ot, l.blocked_transitions), kt = yt.length > 0, It = En(ot), nt = be ? ot.find((u) => u.id === be) : null, Oe = (l == null ? void 0 : l.running_move) ?? null, De = Oe ? null : (l == null ? void 0 : l.last_move_problem) ?? null, jt = De ? ot.find((u) => Ft(u.id, De.transition_id)) : null, Wt = (u, A = !1) => {
2157
2157
  const F = /* @__PURE__ */ new Map();
2158
- for (const U of m) {
2158
+ for (const U of u) {
2159
2159
  const H = F.get(U.label) ?? [];
2160
2160
  H.push(U), F.set(U.label, H);
2161
2161
  }
2162
2162
  return Array.from(F.entries()).map(([U, H]) => {
2163
- var Re, lt, Yt;
2164
- const ye = ((Re = H[0]) == null ? void 0 : Re.color) ?? null, pe = H.some((E) => E.id === Z), ae = (E) => ye ? E ? { backgroundColor: ye, borderColor: ye } : { borderColor: ye, color: ye } : void 0, Le = [...H].sort(
2163
+ var Pe, lt, Yt;
2164
+ const ye = ((Pe = H[0]) == null ? void 0 : Pe.color) ?? null, pe = H.some((E) => E.id === Z), ae = (E) => ye ? E ? { backgroundColor: ye, borderColor: ye } : { borderColor: ye, color: ye } : void 0, Le = [...H].sort(
2165
2165
  (E, Se) => {
2166
2166
  var Qe, rt;
2167
2167
  return (((Qe = W.get(E.to_state)) == null ? void 0 : Qe.sort) ?? 999) - (((rt = W.get(Se.to_state)) == null ? void 0 : rt.sort) ?? 999);
@@ -2185,7 +2185,7 @@ function qa({
2185
2185
  U
2186
2186
  );
2187
2187
  if (H.length === 1) {
2188
- const E = H[0], Se = X.isPending && ((Yt = X.variables) == null ? void 0 : Yt.transition_id) === E.id || Ft(Oe == null ? void 0 : Oe.transition_id, E.id), Qe = Pn(De, E.id), rt = /* @__PURE__ */ s(
2188
+ const E = H[0], Se = X.isPending && ((Yt = X.variables) == null ? void 0 : Yt.transition_id) === E.id || Ft(Oe == null ? void 0 : Oe.transition_id, E.id), Qe = Rn(De, E.id), rt = /* @__PURE__ */ s(
2189
2189
  fe,
2190
2190
  {
2191
2191
  size: "sm",
@@ -2205,7 +2205,7 @@ function qa({
2205
2205
  Ne.press(E.id) && me(E.id);
2206
2206
  },
2207
2207
  children: [
2208
- Se ? /* @__PURE__ */ n(Ae, { className: "h-3 w-3 animate-spin" }) : E.advisory && /* @__PURE__ */ n(Pe, {}),
2208
+ Se ? /* @__PURE__ */ n(Ae, { className: "h-3 w-3 animate-spin" }) : E.advisory && /* @__PURE__ */ n(Re, {}),
2209
2209
  U
2210
2210
  ]
2211
2211
  },
@@ -2214,7 +2214,7 @@ function qa({
2214
2214
  return Qe ? /* @__PURE__ */ n("span", { className: "inline-flex", "data-tip": Qe, "data-move-held": !0, children: rt }, U) : rt;
2215
2215
  }
2216
2216
  return /* @__PURE__ */ s(qt, { children: [
2217
- /* @__PURE__ */ n(Rt, { asChild: !0, children: /* @__PURE__ */ s(
2217
+ /* @__PURE__ */ n(Pt, { asChild: !0, children: /* @__PURE__ */ s(
2218
2218
  fe,
2219
2219
  {
2220
2220
  size: "sm",
@@ -2223,13 +2223,13 @@ function qa({
2223
2223
  style: ae(pe),
2224
2224
  disabled: X.isPending || ke || !!Oe,
2225
2225
  children: [
2226
- H.every((E) => E.advisory) && /* @__PURE__ */ n(Pe, {}),
2226
+ H.every((E) => E.advisory) && /* @__PURE__ */ n(Re, {}),
2227
2227
  U,
2228
2228
  /* @__PURE__ */ n(Ge, { className: "h-3 w-3" })
2229
2229
  ]
2230
2230
  }
2231
2231
  ) }),
2232
- /* @__PURE__ */ s(Pt, { align: "start", children: [
2232
+ /* @__PURE__ */ s(Rt, { align: "start", children: [
2233
2233
  Le.map((E) => {
2234
2234
  var Se;
2235
2235
  return /* @__PURE__ */ s(
@@ -2250,7 +2250,7 @@ function qa({
2250
2250
  }
2251
2251
  ),
2252
2252
  ((Se = W.get(E.to_state)) == null ? void 0 : Se.label) ?? E.to_state,
2253
- E.advisory && /* @__PURE__ */ n(Pe, { className: "ml-auto" }),
2253
+ E.advisory && /* @__PURE__ */ n(Re, { className: "ml-auto" }),
2254
2254
  E.blocked && /* @__PURE__ */ n(pt, {})
2255
2255
  ]
2256
2256
  },
@@ -2279,7 +2279,7 @@ function qa({
2279
2279
  onDismiss: () => K(null),
2280
2280
  onFixed: () => oe({ transition_id: C.transitionId, comment: C.comment })
2281
2281
  }
2282
- ) : null, pr = p && !v && !!x && kt, Kt = (m) => {
2282
+ ) : null, pr = p && !v && !!x && kt, Kt = (u) => {
2283
2283
  var A;
2284
2284
  return /* @__PURE__ */ s(Te, { children: [
2285
2285
  It.map(({ advisory: F, moves: U }) => /* @__PURE__ */ n(
@@ -2294,7 +2294,7 @@ function qa({
2294
2294
  confirms: or(nt, Y ?? [], x == null ? void 0 : x.current_state)
2295
2295
  } : null,
2296
2296
  stops: It.length > 1 ? [...new Set(U.map((H) => H.label))] : void 0,
2297
- className: m ? "rounded-lg border border-amber-200/80 px-3 dark:border-amber-500/20" : void 0,
2297
+ className: u ? "rounded-lg border border-amber-200/80 px-3 dark:border-amber-500/20" : void 0,
2298
2298
  onDismiss: () => o(null),
2299
2299
  onFixed: (H) => {
2300
2300
  o(null), S.invalidateQueries({ queryKey: z }), H && me(H.id, { cleared: !0 });
@@ -2306,7 +2306,7 @@ function qa({
2306
2306
  Hr,
2307
2307
  {
2308
2308
  run: Oe,
2309
- className: m ? "rounded-lg border border-sky-200/80 px-3 dark:border-sky-500/20" : void 0
2309
+ className: u ? "rounded-lg border border-sky-200/80 px-3 dark:border-sky-500/20" : void 0
2310
2310
  }
2311
2311
  ),
2312
2312
  De && /* @__PURE__ */ n(
@@ -2315,7 +2315,7 @@ function qa({
2315
2315
  problem: De,
2316
2316
  retryDisabled: X.isPending || ke,
2317
2317
  onRetry: jt ? () => void me(jt.id) : void 0,
2318
- className: m ? "rounded-lg border border-amber-200/80 px-3 dark:border-amber-500/20" : void 0
2318
+ className: u ? "rounded-lg border border-amber-200/80 px-3 dark:border-amber-500/20" : void 0
2319
2319
  }
2320
2320
  ),
2321
2321
  x && /* @__PURE__ */ n(
@@ -2324,7 +2324,7 @@ function qa({
2324
2324
  collection: e,
2325
2325
  item: t,
2326
2326
  skipIds: ((A = De == null ? void 0 : De.unanswered) == null ? void 0 : A.submission_id) != null ? [De.unanswered.submission_id] : void 0,
2327
- className: m ? "rounded-lg border px-3" : void 0
2327
+ className: u ? "rounded-lg border px-3" : void 0
2328
2328
  }
2329
2329
  )
2330
2330
  ] });
@@ -2340,15 +2340,15 @@ function qa({
2340
2340
  ] }),
2341
2341
  /* @__PURE__ */ n(mr, { landing: Be }),
2342
2342
  /* @__PURE__ */ n(tr, { collection: e, item: String(t), tx: k }),
2343
- /* @__PURE__ */ n(ur, { collection: e, item: t, omitLines: P }),
2344
- /* @__PURE__ */ n(er, { lines: P }),
2343
+ /* @__PURE__ */ n(ur, { collection: e, item: t, omitLines: R }),
2344
+ /* @__PURE__ */ n(er, { lines: R }),
2345
2345
  /* @__PURE__ */ n(Wn, { changes: te }),
2346
2346
  /* @__PURE__ */ n(
2347
2347
  "input",
2348
2348
  {
2349
2349
  type: "text",
2350
2350
  value: ie,
2351
- onChange: (m) => de(m.target.value),
2351
+ onChange: (u) => de(u.target.value),
2352
2352
  placeholder: String((k == null ? void 0 : k.comment_mode) ?? "") === "required" ? "Add a note (required)" : "Add a comment (optional)",
2353
2353
  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"
2354
2354
  }
@@ -2379,7 +2379,7 @@ function qa({
2379
2379
  comment: ie.trim() || void 0
2380
2380
  }),
2381
2381
  children: X.isPending ? /* @__PURE__ */ n(Ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ s(Te, { children: [
2382
- /* @__PURE__ */ n("span", { children: te.length > 0 ? "Continue" : P.length > 0 && k ? `${k.label} anyway` : "Confirm" }),
2382
+ /* @__PURE__ */ n("span", { children: te.length > 0 ? "Continue" : R.length > 0 && k ? `${k.label} anyway` : "Confirm" }),
2383
2383
  /* @__PURE__ */ n(vt, { className: "h-3 w-3" })
2384
2384
  ] })
2385
2385
  }
@@ -2395,10 +2395,7 @@ function qa({
2395
2395
  /* @__PURE__ */ s(
2396
2396
  "div",
2397
2397
  {
2398
- role: "button",
2399
- tabIndex: 0,
2400
- onClick: () => $((m) => !m),
2401
- onKeyDown: (m) => (m.key === "Enter" || m.key === " ") && $((A) => !A),
2398
+ onClick: () => $((u) => !u),
2402
2399
  className: "flex w-full cursor-pointer items-center gap-2.5 px-5 py-3.5 transition-colors hover:bg-slate-50/50 max-sm:flex-wrap max-sm:gap-y-2 dark:hover:bg-white/[0.02]",
2403
2400
  children: [
2404
2401
  /* @__PURE__ */ n(St, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
@@ -2425,7 +2422,7 @@ function qa({
2425
2422
  "span",
2426
2423
  {
2427
2424
  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",
2428
- "data-tip": ((l == null ? void 0 : l.auto_held) ?? []).map((m) => `${m.transition_label ?? "Automatic move"}: ${m.error ?? "refused"}`).join(`
2425
+ "data-tip": ((l == null ? void 0 : l.auto_held) ?? []).map((u) => `${u.transition_label ?? "Automatic move"}: ${u.error ?? "refused"}`).join(`
2429
2426
  `),
2430
2427
  "data-pipeline-auto-held-pill": !0,
2431
2428
  children: [
@@ -2450,16 +2447,16 @@ function qa({
2450
2447
  }
2451
2448
  )
2452
2449
  ] }),
2453
- /* @__PURE__ */ s("div", { className: "ml-auto flex items-center gap-2", onClick: (m) => m.stopPropagation(), children: [
2454
- !p && kt && !u && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: Wt(yt, !0) }),
2450
+ /* @__PURE__ */ s("div", { className: "ml-auto flex items-center gap-2", onClick: (u) => u.stopPropagation(), children: [
2451
+ !p && kt && !m && /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-1.5", children: Wt(yt, !0) }),
2455
2452
  !p && !x && (l == null ? void 0 : l.binding) && /* @__PURE__ */ s(
2456
2453
  fe,
2457
2454
  {
2458
2455
  size: "sm",
2459
2456
  variant: "outline",
2460
2457
  className: "h-7 gap-1.5 text-[11px]",
2461
- onClick: (m) => {
2462
- m.stopPropagation(), le.mutate();
2458
+ onClick: (u) => {
2459
+ u.stopPropagation(), le.mutate();
2463
2460
  },
2464
2461
  disabled: le.isPending,
2465
2462
  children: [
@@ -2480,11 +2477,23 @@ function qa({
2480
2477
  )
2481
2478
  ] }),
2482
2479
  /* @__PURE__ */ n(
2483
- Ge,
2480
+ "button",
2484
2481
  {
2485
- className: ne(
2486
- "h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150 max-sm:ml-auto",
2487
- p && "rotate-180"
2482
+ type: "button",
2483
+ "aria-expanded": p,
2484
+ "aria-label": `${p ? "Collapse" : "Expand"} ${a || "Pipeline"}`,
2485
+ onClick: (u) => {
2486
+ u.stopPropagation(), $((A) => !A);
2487
+ },
2488
+ className: "shrink-0 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan max-sm:ml-auto",
2489
+ children: /* @__PURE__ */ n(
2490
+ Ge,
2491
+ {
2492
+ className: ne(
2493
+ "block h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150",
2494
+ p && "rotate-180"
2495
+ )
2496
+ }
2488
2497
  )
2489
2498
  }
2490
2499
  )
@@ -2509,10 +2518,10 @@ function qa({
2509
2518
  // showed, then snapped into formation. Hold a same-height
2510
2519
  // placeholder until the real shape is known.
2511
2520
  /* @__PURE__ */ s("div", { className: "flex h-[52px] items-center gap-2", children: [
2512
- [0, 1, 2, 3, 4].map((m) => /* @__PURE__ */ s("span", { className: "flex items-center gap-2", children: [
2521
+ [0, 1, 2, 3, 4].map((u) => /* @__PURE__ */ s("span", { className: "flex items-center gap-2", children: [
2513
2522
  /* @__PURE__ */ n(Ue, { className: "h-7 w-7 rounded-full" }),
2514
- m < 4 && /* @__PURE__ */ n(Ue, { className: "h-0.5 w-10" })
2515
- ] }, m)),
2523
+ u < 4 && /* @__PURE__ */ n(Ue, { className: "h-0.5 w-10" })
2524
+ ] }, u)),
2516
2525
  /* @__PURE__ */ n(Ue, { className: "ml-2 h-3 w-24" })
2517
2526
  ] })
2518
2527
  ) : /* @__PURE__ */ n(
@@ -2529,8 +2538,8 @@ function qa({
2529
2538
  onShowHistory: () => {
2530
2539
  _e(!0), requestAnimationFrame(
2531
2540
  () => {
2532
- var m;
2533
- return (m = G.current) == null ? void 0 : m.scrollIntoView({
2541
+ var u;
2542
+ return (u = G.current) == null ? void 0 : u.scrollIntoView({
2534
2543
  block: "nearest",
2535
2544
  behavior: "smooth"
2536
2545
  });
@@ -2561,9 +2570,9 @@ function qa({
2561
2570
  states: Y ?? [],
2562
2571
  currentStateId: ((Xt = l == null ? void 0 : l.instance) == null ? void 0 : Xt.current_state) ?? null,
2563
2572
  returned: ((l == null ? void 0 : l.history) ?? []).some(
2564
- (m) => {
2573
+ (u) => {
2565
2574
  var A;
2566
- return !!m.from_state && m.to_state === ((A = l == null ? void 0 : l.instance) == null ? void 0 : A.current_state);
2575
+ return !!u.from_state && u.to_state === ((A = l == null ? void 0 : l.instance) == null ? void 0 : A.current_state);
2567
2576
  }
2568
2577
  ),
2569
2578
  standInReason: (l == null ? void 0 : l.stand_in_reason) ?? null
@@ -2582,7 +2591,7 @@ function qa({
2582
2591
  {
2583
2592
  type: "button",
2584
2593
  className: "flex items-center gap-1.5 text-[12px] text-slate-400 transition-colors hover:text-slate-600",
2585
- onClick: () => _e((m) => !m),
2594
+ onClick: () => _e((u) => !u),
2586
2595
  children: [
2587
2596
  /* @__PURE__ */ n(
2588
2597
  Ge,
@@ -2678,30 +2687,30 @@ function qs({
2678
2687
  onBeforeTransition: r,
2679
2688
  wrap: a = !0,
2680
2689
  asRole: i,
2681
- asUser: u
2690
+ asUser: m
2682
2691
  }) {
2683
2692
  return t === "new" ? null : /* @__PURE__ */ n(
2684
- Ra,
2693
+ Pa,
2685
2694
  {
2686
2695
  collection: e,
2687
2696
  item: t,
2688
2697
  onBeforeTransition: r,
2689
2698
  wrap: a,
2690
2699
  asRole: i,
2691
- asUser: u
2700
+ asUser: m
2692
2701
  }
2693
2702
  );
2694
2703
  }
2695
- function Ra({
2704
+ function Pa({
2696
2705
  collection: e,
2697
2706
  item: t,
2698
2707
  onBeforeTransition: r,
2699
2708
  wrap: a = !0,
2700
2709
  asRole: i,
2701
- asUser: u
2710
+ asUser: m
2702
2711
  }) {
2703
- const v = !!i || !!u, b = We(), y = Ze(), [T, h] = J(""), [R, N] = J(null), [_, S] = J(null), [q, V] = J(null), [B, re] = J(null), [ie, de] = J([]), Z = Zn(e, String(t)), [I, ge] = J([]), _e = jn(e, String(t));
2704
- wn(e, t, "transition", !!R || !!_), bn(e, t, { hold: !!R || !!_ });
2712
+ const v = !!i || !!m, b = We(), y = Ze(), [T, h] = J(""), [P, N] = J(null), [_, S] = J(null), [q, V] = J(null), [B, re] = J(null), [ie, de] = J([]), Z = Zn(e, String(t)), [I, ge] = J([]), _e = jn(e, String(t));
2713
+ wn(e, t, "transition", !!P || !!_), bn(e, t, { hold: !!P || !!_ });
2705
2714
  const G = he(null), p = Ur(G, !a), $ = he(!1), w = (d) => {
2706
2715
  $.current || v || ($.current = !0, V(null), te.mutate(d, {
2707
2716
  onSettled: (f, M) => {
@@ -2724,7 +2733,7 @@ function Ra({
2724
2733
  return;
2725
2734
  }
2726
2735
  if (o != null && o.running_move) return;
2727
- if (R === d) {
2736
+ if (P === d) {
2728
2737
  N(null);
2729
2738
  return;
2730
2739
  }
@@ -2778,11 +2787,11 @@ function Ra({
2778
2787
  return;
2779
2788
  }
2780
2789
  de([]), N(d);
2781
- }, C = u ? ["pipeline-instance", e, t, "as-user", u] : i ? ["pipeline-instance", e, t, i] : ["pipeline-instance", e, t], { settling: K, settle: be } = Gn(C), { data: o } = $e({
2790
+ }, C = m ? ["pipeline-instance", e, t, "as-user", m] : i ? ["pipeline-instance", e, t, i] : ["pipeline-instance", e, t], { settling: K, settle: be } = Gn(C), { data: o } = $e({
2782
2791
  queryKey: C,
2783
2792
  queryFn: () => b.request(
2784
2793
  Fe(
2785
- `/pipelines/instance/${e}/${t}${u ? `?as_user=${encodeURIComponent(u)}` : i ? `?as_role=${encodeURIComponent(i)}` : ""}`
2794
+ `/pipelines/instance/${e}/${t}${m ? `?as_user=${encodeURIComponent(m)}` : i ? `?as_role=${encodeURIComponent(i)}` : ""}`
2786
2795
  )
2787
2796
  ).then(
2788
2797
  (d) => d.data ?? {
@@ -2800,7 +2809,7 @@ function Ra({
2800
2809
  Mn(!!(o != null && o.running_move), () => {
2801
2810
  Xe(y, e, String(t)), Ye(y, e, String(t)), xt(y, e, String(t));
2802
2811
  });
2803
- const P = Xn(
2812
+ const R = Xn(
2804
2813
  o ? (o.available_transitions ?? []).map((d) => String(d.id)) : null,
2805
2814
  `${e}:${t}`
2806
2815
  ), { data: L } = $e({
@@ -2809,7 +2818,7 @@ function Ra({
2809
2818
  Fe(`/pipelines/instance/${e}/${t}/owners/all`)
2810
2819
  ).then((d) => d.data ?? null),
2811
2820
  // Also while a move is being confirmed: the panel names where it really lands.
2812
- enabled: nr(o) || !!R,
2821
+ enabled: nr(o) || !!P,
2813
2822
  staleTime: 3e4
2814
2823
  }), Me = gt(() => {
2815
2824
  if (!L) return null;
@@ -2829,7 +2838,7 @@ function Ra({
2829
2838
  comment: f,
2830
2839
  ...M ? { reviewed: !0 } : {},
2831
2840
  ...x ? { lock_ack: !0 } : {},
2832
- ...Rn(o == null ? void 0 : o.available_transitions, d)
2841
+ ...Pn(o == null ? void 0 : o.available_transitions, d)
2833
2842
  })
2834
2843
  ),
2835
2844
  onMutate: (d) => {
@@ -2943,7 +2952,7 @@ function Ra({
2943
2952
  o.instance.completed_at ? null : Me
2944
2953
  ), Q = An(D, o.blocked_transitions);
2945
2954
  if (Q.length === 0) return null;
2946
- const oe = new Map((o.states ?? []).map((d) => [d.id, d])), me = o.instance.current_state_obj ?? null, z = R ? D.find((d) => d.id === R) : null, ke = B ? D.find((d) => d.id === B) : null, ue = o.running_move ?? null, l = ue ? zr(ue) : void 0, Ke = z ? oe.get(z.to_state) : null, Ne = cr(z, me, o.states ?? [], L), xe = (Ne == null ? void 0 : Ne.state) ?? Ke, qe = /* @__PURE__ */ new Map();
2955
+ const oe = new Map((o.states ?? []).map((d) => [d.id, d])), me = o.instance.current_state_obj ?? null, z = P ? D.find((d) => d.id === P) : null, ke = B ? D.find((d) => d.id === B) : null, ue = o.running_move ?? null, l = ue ? zr(ue) : void 0, Ke = z ? oe.get(z.to_state) : null, Ne = cr(z, me, o.states ?? [], L), xe = (Ne == null ? void 0 : Ne.state) ?? Ke, qe = /* @__PURE__ */ new Map();
2947
2956
  for (const d of Q) {
2948
2957
  const f = qe.get(d.label) ?? [];
2949
2958
  f.push(d), qe.set(d.label, f);
@@ -2969,7 +2978,7 @@ function Ra({
2969
2978
  })();
2970
2979
  return /* @__PURE__ */ s("div", { ref: G, className: "relative", "data-tip": l, children: [
2971
2980
  p ? /* @__PURE__ */ s(qt, { children: [
2972
- /* @__PURE__ */ n(Rt, { asChild: !0, children: /* @__PURE__ */ s(
2981
+ /* @__PURE__ */ n(Pt, { asChild: !0, children: /* @__PURE__ */ s(
2973
2982
  fe,
2974
2983
  {
2975
2984
  size: "sm",
@@ -2978,13 +2987,13 @@ function Ra({
2978
2987
  disabled: te.isPending || K || !!ue,
2979
2988
  "data-transitions-folded": !0,
2980
2989
  children: [
2981
- te.isPending || ue ? /* @__PURE__ */ n(Ae, { className: "h-3 w-3 animate-spin" }) : D.length > 0 && D.every((d) => d.advisory) && /* @__PURE__ */ n(Pe, {}),
2990
+ te.isPending || ue ? /* @__PURE__ */ n(Ae, { className: "h-3 w-3 animate-spin" }) : D.length > 0 && D.every((d) => d.advisory) && /* @__PURE__ */ n(Re, {}),
2982
2991
  "Actions",
2983
2992
  /* @__PURE__ */ n(Ge, { className: "h-3 w-3" })
2984
2993
  ]
2985
2994
  }
2986
2995
  ) }),
2987
- /* @__PURE__ */ s(Pt, { align: "end", className: "min-w-[200px]", children: [
2996
+ /* @__PURE__ */ s(Rt, { align: "end", className: "min-w-[200px]", children: [
2988
2997
  Array.from(qe.entries()).map(
2989
2998
  ([d, f], M, x) => f.length === 1 ? /* @__PURE__ */ s(Zt, { children: [
2990
2999
  M > 0 && x[M - 1][1].length > 1 && /* @__PURE__ */ n(At, {}),
@@ -3006,7 +3015,7 @@ function Ra({
3006
3015
  }
3007
3016
  ),
3008
3017
  d,
3009
- f[0].advisory && /* @__PURE__ */ n(Pe, { className: "ml-auto" }),
3018
+ f[0].advisory && /* @__PURE__ */ n(Re, { className: "ml-auto" }),
3010
3019
  f[0].blocked && /* @__PURE__ */ n(pt, {})
3011
3020
  ]
3012
3021
  }
@@ -3032,7 +3041,7 @@ function Ra({
3032
3041
  }
3033
3042
  ),
3034
3043
  j(O),
3035
- O.advisory && /* @__PURE__ */ n(Pe, { className: "ml-auto" }),
3044
+ O.advisory && /* @__PURE__ */ n(Re, { className: "ml-auto" }),
3036
3045
  O.blocked && /* @__PURE__ */ n(pt, {})
3037
3046
  ]
3038
3047
  },
@@ -3060,7 +3069,7 @@ function Ra({
3060
3069
  const M = f.some((k) => {
3061
3070
  var we;
3062
3071
  return (((we = k.order_partners) == null ? void 0 : we.length) ?? 0) > 0;
3063
- }), x = M ? null : ((Y = f[0]) == null ? void 0 : Y.color) ?? null, O = f.some((k) => k.id === R), se = (k) => x ? k ? { backgroundColor: x, borderColor: x } : { borderColor: x, color: x } : void 0;
3072
+ }), x = M ? null : ((Y = f[0]) == null ? void 0 : Y.color) ?? null, O = f.some((k) => k.id === P), se = (k) => x ? k ? { backgroundColor: x, borderColor: x } : { borderColor: x, color: x } : void 0;
3064
3073
  if (f.every(Fn)) {
3065
3074
  const k = c(f);
3066
3075
  return /* @__PURE__ */ n(
@@ -3074,7 +3083,7 @@ function Ra({
3074
3083
  );
3075
3084
  }
3076
3085
  if (f.length === 1) {
3077
- const k = f[0], we = Ft(ue == null ? void 0 : ue.transition_id, k.id), Be = Pn(ue ? null : o.last_move_problem, k.id), et = te.isPending && ((ve = te.variables) == null ? void 0 : ve.transition_id) === k.id || we, tt = /* @__PURE__ */ s(
3086
+ const k = f[0], we = Ft(ue == null ? void 0 : ue.transition_id, k.id), Be = Rn(ue ? null : o.last_move_problem, k.id), et = te.isPending && ((ve = te.variables) == null ? void 0 : ve.transition_id) === k.id || we, tt = /* @__PURE__ */ s(
3078
3087
  fe,
3079
3088
  {
3080
3089
  size: "sm",
@@ -3086,15 +3095,15 @@ function Ra({
3086
3095
  style: k.advisory ? void 0 : se(O),
3087
3096
  disabled: te.isPending || K || !!ue || !!Be,
3088
3097
  "data-move-running": we || void 0,
3089
- "aria-disabled": P.dimmed(k.id) || void 0,
3090
- "data-fresh": P.dimmed(k.id) || void 0,
3091
- ...P.bind(k.id),
3098
+ "aria-disabled": R.dimmed(k.id) || void 0,
3099
+ "data-fresh": R.dimmed(k.id) || void 0,
3100
+ ...R.bind(k.id),
3092
3101
  ...He(k),
3093
3102
  onClick: () => {
3094
- P.press(k.id) && g(k.id);
3103
+ R.press(k.id) && g(k.id);
3095
3104
  },
3096
3105
  children: [
3097
- et ? /* @__PURE__ */ n(Ae, { className: "h-3 w-3 animate-spin" }) : k.advisory ? /* @__PURE__ */ n(Pe, {}) : M && /* @__PURE__ */ n(cn, { className: "h-3 w-3", "aria-hidden": !0 }),
3106
+ et ? /* @__PURE__ */ n(Ae, { className: "h-3 w-3 animate-spin" }) : k.advisory ? /* @__PURE__ */ n(Re, {}) : M && /* @__PURE__ */ n(cn, { className: "h-3 w-3", "aria-hidden": !0 }),
3098
3107
  d
3099
3108
  ]
3100
3109
  },
@@ -3115,7 +3124,7 @@ function Ra({
3115
3124
  ] }, d) : tt;
3116
3125
  }
3117
3126
  return /* @__PURE__ */ s(qt, { children: [
3118
- /* @__PURE__ */ n(Rt, { asChild: !0, children: /* @__PURE__ */ s(
3127
+ /* @__PURE__ */ n(Pt, { asChild: !0, children: /* @__PURE__ */ s(
3119
3128
  fe,
3120
3129
  {
3121
3130
  size: "sm",
@@ -3124,13 +3133,13 @@ function Ra({
3124
3133
  style: se(O),
3125
3134
  disabled: te.isPending || K || !!ue,
3126
3135
  children: [
3127
- f.every((k) => k.advisory) && /* @__PURE__ */ n(Pe, {}),
3136
+ f.every((k) => k.advisory) && /* @__PURE__ */ n(Re, {}),
3128
3137
  d,
3129
3138
  /* @__PURE__ */ n(Ge, { className: "h-3 w-3" })
3130
3139
  ]
3131
3140
  }
3132
3141
  ) }),
3133
- /* @__PURE__ */ s(Pt, { align: "start", children: [
3142
+ /* @__PURE__ */ s(Rt, { align: "start", children: [
3134
3143
  c(f).map((k) => /* @__PURE__ */ s(
3135
3144
  dt,
3136
3145
  {
@@ -3149,7 +3158,7 @@ function Ra({
3149
3158
  }
3150
3159
  ),
3151
3160
  j(k),
3152
- k.advisory && /* @__PURE__ */ n(Pe, { className: "ml-auto" }),
3161
+ k.advisory && /* @__PURE__ */ n(Re, { className: "ml-auto" }),
3153
3162
  k.blocked && /* @__PURE__ */ n(pt, {})
3154
3163
  ]
3155
3164
  },
@@ -3170,7 +3179,7 @@ function Ra({
3170
3179
  })
3171
3180
  }
3172
3181
  ),
3173
- R && /* @__PURE__ */ s(
3182
+ P && /* @__PURE__ */ s(
3174
3183
  "div",
3175
3184
  {
3176
3185
  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",
@@ -3222,7 +3231,7 @@ function Ra({
3222
3231
  className: "h-7 gap-1.5 text-[12px]",
3223
3232
  disabled: te.isPending || !!ue || String((z == null ? void 0 : z.comment_mode) ?? "") === "required" && T.trim() === "",
3224
3233
  onClick: () => w({
3225
- transition_id: R,
3234
+ transition_id: P,
3226
3235
  comment: T.trim() || void 0
3227
3236
  }),
3228
3237
  children: te.isPending ? /* @__PURE__ */ n(Ae, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ s(Te, { children: [
@@ -3235,7 +3244,7 @@ function Ra({
3235
3244
  ]
3236
3245
  }
3237
3246
  ),
3238
- (ke == null ? void 0 : ke.advisory) && !R && /* @__PURE__ */ n(
3247
+ (ke == null ? void 0 : ke.advisory) && !P && /* @__PURE__ */ n(
3239
3248
  Bn,
3240
3249
  {
3241
3250
  floating: !0,
@@ -3255,7 +3264,7 @@ function Ra({
3255
3264
  }
3256
3265
  }
3257
3266
  ),
3258
- q && !R && /* @__PURE__ */ n(
3267
+ q && !P && /* @__PURE__ */ n(
3259
3268
  lr,
3260
3269
  {
3261
3270
  collection: e,