@nivaro/react 0.3.77 → 0.3.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  import { jsxs as c, jsx as a, Fragment as Qe } from "react/jsx-runtime";
2
2
  import { useQueryClient as La, useMutation as Nt, useQuery as ne, useQueries as wa } from "@tanstack/react-query";
3
- import { FileDiff as mi, RotateCw as kr, Network as fi, Map as bi, Sparkles as yr, X as wr, Rows3 as bs, ListChecks as hi, Rows2 as gi, ChevronDown as Yn, Wand2 as hs, FileText as gs, Bell as xi, BellOff as vi, Loader2 as ki, Check as yi, Search as Ks, Pin as wi } from "lucide-react";
3
+ import { FileDiff as mi, RotateCw as kr, Network as fi, Map as bi, Sparkles as yr, X as wr, Rows3 as hs, ListChecks as hi, Rows2 as gi, ChevronDown as Yn, Wand2 as gs, FileText as xs, Bell as xi, BellOff as vi, Loader2 as ki, Check as yi, Search as js, Pin as wi } from "lucide-react";
4
4
  import _i, { useState as _, useRef as fe, useEffect as me, useMemo as be, useLayoutEffect as Ni } from "react";
5
- import { createPortal as js } from "react-dom";
5
+ import { createPortal as Bs } from "react-dom";
6
6
  import { toast as ye } from "sonner";
7
- import { useNivaroClient as St, useItemNavigation as Bs, useOverlayState as Si, useItemEditAuth as Ca, useApiFetchConfig as Ci } from "../context.js";
8
- import { useDebounced as xs } from "../hooks/useDebounced.js";
7
+ import { useNivaroClient as St, useItemNavigation as Us, useOverlayState as Si, useItemEditAuth as Ca, useApiFetchConfig as Ci } from "../context.js";
8
+ import { useDebounced as vs } from "../hooks/useDebounced.js";
9
9
  import { useElapsedLoading as $i } from "../hooks/useElapsedLoading.js";
10
10
  import { useSlowReason as qi } from "../hooks/useSlowReason.js";
11
11
  import { rowActionSentence as Ti } from "../lib/bulk-copy.js";
@@ -18,21 +18,21 @@ import { parseDateFilter as $a, dateFilterBounds as ji, describeDateFilter as Bi
18
18
  import { rowDeleteOffered as Qi } from "../lib/delete-offer.js";
19
19
  import { errorSentence as Wi } from "../lib/error-message.js";
20
20
  import { errorToastOptions as Na, toastError as Vi } from "../lib/error-toast.js";
21
- import { extractExpressionTokens as Hi, evaluateNumeric as vs } from "../lib/expression.js";
21
+ import { extractExpressionTokens as Hi, evaluateNumeric as ks } from "../lib/expression.js";
22
22
  import { clauseFromCondition as _r, clauseFromControlValue as Yi, filterSentence as Ji } from "../lib/filter-sentence.js";
23
23
  import { deliverLive as Gi, releaseLiveOwner as Xi } from "../lib/focus-mode.js";
24
- import { formatValue as Vn, formatMultiValue as ks, countFromResolved as Zi } from "../lib/format-value.js";
24
+ import { formatValue as Vn, formatMultiValue as ys, countFromResolved as Zi } from "../lib/format-value.js";
25
25
  import { createCursorBook as ed, pageRequest as td, noteNextCursor as nd, isCursorRefusal as ad, stopCursors as rd } from "../lib/keyset-pager.js";
26
26
  import { normalizeInlineEdit as ld, inlineM2oTarget as sd, inlineChoices as od, inlineEditFor as id, nextInlineKey as dd } from "../lib/list-inline-edit.js";
27
27
  import { sanitizeCbvLinkState as cd, readListLinkFromLocation as ud, dropListLinkParam as pd } from "../lib/list-link.js";
28
- import { rememberedListPage as md, pageWhileSettling as ys, rememberListPage as fd, restoreWindowOutcome as bd } from "../lib/list-page-memory.js";
28
+ import { rememberedListPage as md, pageWhileSettling as ws, rememberListPage as fd, restoreWindowOutcome as bd } from "../lib/list-page-memory.js";
29
29
  import { expandCoalesced as hd, LIVE_ASPECTS as _n } from "../lib/live.js";
30
30
  import { useRowChanges as gd, useRowLocks as xd, lockLabel as vd, viewerMatches as kd, conditionFields as yd, mayAffectMatch as wd, writerOf as _d } from "../lib/live-list.js";
31
31
  import { loadErrorStatus as Nd, listLoadErrorText as Sd } from "../lib/load-error.js";
32
- import { OPEN_IN_TABS_CAP as Cd, openInTabs as $d, openInTabsMessage as ws } from "../lib/open-in-tabs.js";
32
+ import { OPEN_IN_TABS_CAP as Cd, openInTabs as $d, openInTabsMessage as _s } from "../lib/open-in-tabs.js";
33
33
  import { isOwnWrite as qd } from "../lib/own-writes.js";
34
34
  import { useIdleNextPage as Td, intentProps as Ld, prefetchRecord as Fd } from "../lib/prefetch.js";
35
- import { useRowPresence as Rd, rowPresenceKey as _s } from "../lib/presence-hooks.js";
35
+ import { useRowPresence as Rd, rowPresenceKey as Ns } from "../lib/presence-hooks.js";
36
36
  import { cascadeFilter as Ed, fetchCascadeRelations as Dd } from "../lib/quick-filter-cascade.js";
37
37
  import { useOptionalRealtime as Pd } from "../lib/realtime.js";
38
38
  import { rowMenuRef as Tr, recordRefLabel as Md, friendlyIdOf as Nr, copyWhenReady as Od, shareableRecordId as Ad, friendlyIdFieldOf as Id } from "../lib/record-ref.js";
@@ -42,7 +42,7 @@ import { logSearch as Bd, logSearchOpen as Ud } from "../lib/search-log.js";
42
42
  import { shapeForField as zd } from "../lib/skeleton-shapes.js";
43
43
  import { knownTotalFrom as Qd } from "../lib/slow-reason.js";
44
44
  import { nextSortValue as Wd } from "../lib/sort-cycle.js";
45
- import { useMyScopes as Vd, matchScopeDimension as Ns, effectiveScopeSeedIds as Hd, translateScopeValues as Yd } from "../lib/use-my-scopes.js";
45
+ import { useMyScopes as Vd, matchScopeDimension as Ss, effectiveScopeSeedIds as Hd, translateScopeValues as Yd } from "../lib/use-my-scopes.js";
46
46
  import { useNewItemLayouts as Jd } from "../lib/use-new-item-layouts.js";
47
47
  import { loadUserCard as Gd, userCardQuery as Xd } from "../lib/user-cards.js";
48
48
  import { cn as Gt, humanHours as Zd, formatDateTime as ec } from "../lib/utils.js";
@@ -60,27 +60,27 @@ import { readExportRows as vc, stableSort as kc, m2oLabelPaths as yc, resolveAll
60
60
  import { FormulaColumnAdder as Cc } from "./cbv/FormulaColumnAdder.js";
61
61
  import { useHierarchyScope as $c, HierarchyScopePicker as qc } from "./cbv/HierarchyScope.js";
62
62
  import { tabStopRowKey as Tc, rowFocusTarget as Lc } from "./cbv/row-focus.js";
63
- import { splitRiskFilter as Ss, riskFilterEntry as Fc } from "./cbv/saved-view-risk.js";
64
- import { isFilterRefusal as Rc, unknownFieldsOf as Cs, dropUnknownField as Ec } from "./cbv/unknown-fields.js";
63
+ import { splitRiskFilter as Cs, riskFilterEntry as Fc } from "./cbv/saved-view-risk.js";
64
+ import { isFilterRefusal as Rc, unknownFieldsOf as $s, dropUnknownField as Ec } from "./cbv/unknown-fields.js";
65
65
  import { ViewDefaultMenu as Dc } from "./cbv/ViewDefaultMenu.js";
66
66
  import { useRecordRoomTypes as Pc, canOpenChatRoom as Mc, discussRecord as Oc } from "./chat/chat-core.js";
67
67
  import { FilterControl as Ac } from "./DataTable.js";
68
68
  import { FocusModeToggle as Ic } from "./FocusModeToggle.js";
69
- import { FULFILMENT_FILTER_OPTIONS as $s, FulfilmentPill as Kc, fulfilmentFigures as jc } from "./FulfilmentPill.js";
69
+ import { FULFILMENT_FILTER_OPTIONS as qs, FulfilmentPill as Kc, fulfilmentFigures as jc } from "./FulfilmentPill.js";
70
70
  import { HScrollProxy as Bc } from "./HScrollProxy.js";
71
71
  import { useDocumentAutofillConfig as Uc, startDocumentExtraction as zc } from "./import/DocumentAutofillButton.js";
72
- import { INTEGRATIONS_FILTER_OPTIONS as qs, IntegrationDots as Qc } from "./integrations/IntegrationDots.js";
72
+ import { INTEGRATIONS_FILTER_OPTIONS as Ts, IntegrationDots as Qc } from "./integrations/IntegrationDots.js";
73
73
  import { useQuickPickerSteps as Wc, QuickPickerDialog as Vc } from "./item-edit/QuickPickerDialog.js";
74
74
  import { usePickerExclusion as Hc } from "./item-edit/RecordGrantTools.js";
75
- import { invalidateRecordQueries as Ts } from "./item-edit/RecordLiveSync.js";
75
+ import { invalidateRecordQueries as Ls } from "./item-edit/RecordLiveSync.js";
76
76
  import { relatedMissing as Yc } from "./item-edit/related-missing.js";
77
- import { UserRosterCluster as Ls, UserChip as Fs } from "./item-edit/UserChip.js";
77
+ import { UserRosterCluster as Fs, UserChip as Rs } from "./item-edit/UserChip.js";
78
78
  import { LiveRowMark as Jc } from "./LiveRowMark.js";
79
79
  import { CopyListLinkButton as Gc } from "./list/CopyListLinkButton.js";
80
80
  import { useInlineEdit as Xc, InlineEditCell as Zc } from "./list/InlineEdit.js";
81
81
  import { MapView as eu } from "./MapView.js";
82
82
  import { usePickerExcludedRows as tu, PICKER_EXCLUDED_ROW_CLASS as nu, PICKER_EXCLUDED_TITLE as au } from "./PickerExcludedRows.js";
83
- import { ConfirmButton as Us } from "./profile/primitives.js";
83
+ import { ConfirmButton as Lr } from "./profile/primitives.js";
84
84
  import { RealtimeStaleMark as ru } from "./RealtimeStatusBanner.js";
85
85
  import { RecordDrilldownSheet as lu } from "./RecordDrilldownSheet.js";
86
86
  import { RowHighlightLegend as su } from "./RowHighlightLegend.js";
@@ -88,8 +88,8 @@ import { RowPresence as ou } from "./RowPresence.js";
88
88
  import { TableSkeletonRows as iu } from "./Skeletons.js";
89
89
  import { SlowNoticeView as du } from "./SlowNotice.js";
90
90
  import { TipLayer as cu } from "./TipLayer.js";
91
- import { UnseenDot as Rs } from "./UnseenDot.js";
92
- import { SimpleSelectXs as Nn, SimpleSelect as Es } from "./ui/SimpleSelect.js";
91
+ import { UnseenDot as Es } from "./UnseenDot.js";
92
+ import { SimpleSelectXs as Nn, SimpleSelect as Ds } from "./ui/SimpleSelect.js";
93
93
  import { RevisionsPanel as uu } from "./panels/RevisionsPanel.js";
94
94
  import { itemActionChoiceStep as pu, ItemActionChoiceList as mu } from "./panels/ItemActionChoices.js";
95
95
  function Sn(n, i, h) {
@@ -107,10 +107,10 @@ function Hn(n) {
107
107
  if (!n) return "id";
108
108
  const i = new Set(n.fields.map((d) => d.field)), h = [...(n.display_template ?? "").matchAll(/\{\{(\w+)/g)].map((d) => d[1]);
109
109
  for (const d of h) if (i.has(d)) return d;
110
- for (const d of Fr) if (i.has(d)) return d;
110
+ for (const d of Rr) if (i.has(d)) return d;
111
111
  return "id";
112
112
  }
113
- const Ds = (n) => typeof n == "string" ? n : n.key, Ps = {
113
+ const Ps = (n) => typeof n == "string" ? n : n.key, Ms = {
114
114
  red: "text-red-600 dark:text-red-400 font-semibold",
115
115
  amber: "text-amber-600 dark:text-amber-400 font-semibold",
116
116
  green: "text-emerald-600 dark:text-emerald-400 font-semibold",
@@ -157,15 +157,15 @@ const fu = [
157
157
  { label: "Relative time", cfg: { type: "datetime", template: "relative" } },
158
158
  { label: "Yes / No", cfg: { type: "boolean", true_label: "Yes", false_label: "No" } },
159
159
  { label: "Count (related)", cfg: { type: "count" } }
160
- ], je = (n) => n.replace(/_/g, " ").replace(/\b\w/g, (i) => i.toUpperCase()), Fr = ["name", "title", "label", "display_name", "subject", "email", "slug"];
161
- function Lr(n, i) {
162
- if (!n) return ["id", i, ...Fr].join(",");
160
+ ], je = (n) => n.replace(/_/g, " ").replace(/\b\w/g, (i) => i.toUpperCase()), Rr = ["name", "title", "label", "display_name", "subject", "email", "slug"];
161
+ function Fr(n, i) {
162
+ if (!n) return ["id", i, ...Rr].join(",");
163
163
  const h = [...n.matchAll(/\{\{([\w.]+)\}\}/g)].map((d) => d[1]);
164
164
  return h.some((d) => d.includes(".")) ? null : [.../* @__PURE__ */ new Set(["id", i, ...h])].join(",");
165
165
  }
166
166
  function qa(n, i) {
167
167
  if (!n) {
168
- for (const h of Fr) {
168
+ for (const h of Rr) {
169
169
  const d = i[h];
170
170
  if (d != null && d !== "") return String(d);
171
171
  }
@@ -176,7 +176,7 @@ function qa(n, i) {
176
176
  return y == null ? "" : String(y);
177
177
  });
178
178
  }
179
- function Rr(n, i, h) {
179
+ function Er(n, i, h) {
180
180
  return n.find(
181
181
  (d) => d.many_collection === i && d.many_field === h && // Loose: a relation list may omit junction_field rather than send null
182
182
  // (record compare showed a raw "124133", army 11 staging check).
@@ -194,7 +194,7 @@ function bu(n) {
194
194
  const N = Math.floor(y / 24);
195
195
  return N < 7 ? `${N}d ago` : i.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
196
196
  }
197
- const bt = (n) => n.toLocaleString("en-US"), zs = /* @__PURE__ */ new Set(["nivaro_users", "directus_users"]), qt = (n) => n.startsWith("directus_") || n.startsWith("nivaro_"), Sr = /* @__PURE__ */ new Map();
197
+ const bt = (n) => n.toLocaleString("en-US"), zs = /* @__PURE__ */ new Set(["nivaro_users", "directus_users"]), Tt = (n) => n.startsWith("directus_") || n.startsWith("nivaro_"), Sr = /* @__PURE__ */ new Map();
198
198
  function Qs(n, i, h) {
199
199
  let d = Sr.get(i);
200
200
  d || (d = { ids: /* @__PURE__ */ new Set(), waiters: [], promise: null }, Sr.set(i, d));
@@ -257,17 +257,17 @@ function gu({ summary: n }) {
257
257
  }
258
258
  );
259
259
  }
260
- function Er({ relatedCollection: n, id: i }) {
260
+ function Dr({ relatedCollection: n, id: i }) {
261
261
  const h = St(), d = zs.has(n), y = i != null && i !== "", { data: N } = ne({
262
262
  queryKey: ["cbv-collection-meta", n],
263
263
  queryFn: () => h.request(X(`/collections/${n}`)).then((T) => T.data),
264
264
  staleTime: 10 * 6e4,
265
- enabled: !qt(n),
265
+ enabled: !Tt(n),
266
266
  retry: !1
267
267
  }), { data: $, isLoading: q } = ne({
268
268
  queryKey: ["cbv-relation-item", n, String(i)],
269
269
  queryFn: () => d ? h.request(X(`/users/${i}`)).then((T) => T.data) : Qs(h, n, String(i)),
270
- enabled: y && (d || !qt(n)),
270
+ enabled: y && (d || !Tt(n)),
271
271
  staleTime: 30 * 6e4,
272
272
  retry: !1
273
273
  });
@@ -445,7 +445,7 @@ function ku({
445
445
  }, [$e, rt]), mt = (g) => {
446
446
  const R = g.to_state ? ge.get(g.to_state) : null;
447
447
  return (R == null ? void 0 : R.label) ?? g.label;
448
- }, Tt = (g) => {
448
+ }, Lt = (g) => {
449
449
  const R = g.to_state ? ge.get(g.to_state) : null;
450
450
  return (R == null ? void 0 : R.color) ?? g.color ?? "#94a3b8";
451
451
  }, [f, H] = _(null), [te, de] = _("");
@@ -475,7 +475,7 @@ function ku({
475
475
  }
476
476
  (G !== P.x || pe !== P.y) && M({ x: G, y: pe });
477
477
  }, [m, P, f, $e.length]);
478
- const Lt = Nt({
478
+ const Ft = Nt({
479
479
  mutationFn: ({ transitionId: g, comment: R }) => u.request(
480
480
  he(`/pipelines/instance/${n}/${i}/transition`, {
481
481
  transition_id: g,
@@ -485,7 +485,7 @@ function ku({
485
485
  onSuccess: (g, R) => {
486
486
  E(!1);
487
487
  const G = $e.find((pe) => pe.id === R.transitionId);
488
- ye.success(G ? `${F.name} moved to ${mt(G)}` : `${F.name} moved`), Sa(w, n), Ts(w, n, [i]), S == null || S();
488
+ ye.success(G ? `${F.name} moved to ${mt(G)}` : `${F.name} moved`), Sa(w, n), Ls(w, n, [i]), S == null || S();
489
489
  },
490
490
  onError: (g) => ye.error(
491
491
  Xt(g, "Transition failed"),
@@ -509,13 +509,13 @@ function ku({
509
509
  ye.info(`${F.name}: ${tn ?? "nothing to change"}`);
510
510
  return;
511
511
  }
512
- ye.success(`${g.label} — done on ${F.name}`), Sa(w, n), Ts(w, n, [i]), S == null || S();
512
+ ye.success(`${g.label} — done on ${F.name}`), Sa(w, n), Ls(w, n, [i]), S == null || S();
513
513
  },
514
514
  onError: (g) => {
515
515
  const R = g.response;
516
516
  ye.error((R == null ? void 0 : R.error) ?? Xt(g, "Action failed"), Na(g));
517
517
  }
518
- }), Ft = Nt({
518
+ }), Rt = Nt({
519
519
  mutationFn: ({ op: g, note: R, pick: G }) => fc(u, n, i, g, R, G).then((pe) => ({ op: g, outcome: pe })),
520
520
  onSuccess: ({ op: g, outcome: R }) => {
521
521
  E(!1);
@@ -566,7 +566,7 @@ function ku({
566
566
  ]
567
567
  }
568
568
  ),
569
- m && js(
569
+ m && Bs(
570
570
  /* @__PURE__ */ a(
571
571
  "div",
572
572
  {
@@ -623,7 +623,7 @@ function ku({
623
623
  {
624
624
  "aria-hidden": !0,
625
625
  className: "h-1.5 w-1.5 shrink-0 rounded-full",
626
- style: { backgroundColor: Tt(g) }
626
+ style: { backgroundColor: Lt(g) }
627
627
  }
628
628
  ),
629
629
  mt(g)
@@ -657,13 +657,13 @@ function ku({
657
657
  "button",
658
658
  {
659
659
  type: "button",
660
- disabled: f.push ? Ft.isPending || Kt || f.push.kind === "push" && !!((pn = (Zn = f.push.action.confirm) == null ? void 0 : Zn.input) != null && pn.required) && te.trim().length === 0 : f.action ? dn.isPending || f.action.require_reason && te.trim().length === 0 : !f.picked || Lt.isPending || ((mn = $e.find((g) => g.id === f.picked)) == null ? void 0 : mn.comment_mode) === "required" && te.trim().length === 0,
660
+ disabled: f.push ? Rt.isPending || Kt || f.push.kind === "push" && !!((pn = (Zn = f.push.action.confirm) == null ? void 0 : Zn.input) != null && pn.required) && te.trim().length === 0 : f.action ? dn.isPending || f.action.require_reason && te.trim().length === 0 : !f.picked || Ft.isPending || ((mn = $e.find((g) => g.id === f.picked)) == null ? void 0 : mn.comment_mode) === "required" && te.trim().length === 0,
661
661
  onClick: () => {
662
- f.push ? Ft.mutate({ op: f.push, note: te, pick: gt }) : f.action ? dn.mutate({ action: f.action, comment: te }) : f.picked && Lt.mutate({ transitionId: f.picked, comment: te });
662
+ f.push ? Rt.mutate({ op: f.push, note: te, pick: gt }) : f.action ? dn.mutate({ action: f.action, comment: te }) : f.picked && Ft.mutate({ transitionId: f.picked, comment: te });
663
663
  },
664
664
  "data-row-action-confirm": !0,
665
665
  className: `h-7 flex-1 rounded-md text-[12px] font-semibold text-white disabled:opacity-40 ${((Ln = f.action) == null ? void 0 : Ln.variant) === "danger" ? "bg-red-600" : "bg-nvr-cyan"}`,
666
- children: Lt.isPending || dn.isPending || Ft.isPending ? "Applying…" : ((Fn = f.push) == null ? void 0 : Fn.kind) === "push" ? ((Rn = f.push.action.confirm) == null ? void 0 : Rn.confirm_label) ?? "Send" : f.push ? "Retry" : "Confirm"
666
+ children: Ft.isPending || dn.isPending || Rt.isPending ? "Applying…" : ((Fn = f.push) == null ? void 0 : Fn.kind) === "push" ? ((Rn = f.push.action.confirm) == null ? void 0 : Rn.confirm_label) ?? "Send" : f.push ? "Retry" : "Confirm"
667
667
  }
668
668
  ),
669
669
  /* @__PURE__ */ a(
@@ -866,16 +866,16 @@ function ku({
866
866
  function Cr(n) {
867
867
  return n === "id" || /(^|_)id$/i.test(n) || /(^|_)uuid$/i.test(n);
868
868
  }
869
- function Ms({
869
+ function Os({
870
870
  collection: n,
871
871
  field: i,
872
872
  fieldType: h,
873
873
  value: d,
874
874
  relations: y
875
875
  }) {
876
- const N = Rr(y, n, i);
876
+ const N = Er(y, n, i);
877
877
  if (N != null && N.one_collection)
878
- return /* @__PURE__ */ a(Er, { relatedCollection: N.one_collection, id: d });
878
+ return /* @__PURE__ */ a(Dr, { relatedCollection: N.one_collection, id: d });
879
879
  if (d == null) return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
880
880
  if (h === "boolean")
881
881
  return /* @__PURE__ */ a(
@@ -1040,7 +1040,7 @@ function yu({
1040
1040
  }), u = Hn(I), w = (I == null ? void 0 : I.display_template) ?? null, { data: Q = [], isLoading: F } = ne({
1041
1041
  queryKey: ["cbv-filter-options", n, u, w ?? "", T, V],
1042
1042
  queryFn: () => {
1043
- const L = Lr(w, u), ae = !!y && y.length > 0, oe = {
1043
+ const L = Fr(w, u), ae = !!y && y.length > 0, oe = {
1044
1044
  limit: T ? 60 : ae ? 500 : 100,
1045
1045
  sort: T || ae ? u : "-id",
1046
1046
  ...L ? { fields: L } : {}
@@ -1058,7 +1058,7 @@ function yu({
1058
1058
  }), m = h.filter((L) => !Q.some((ae) => String(ae.value) === String(L))), E = m.map(String).join(","), { data: P = [] } = ne({
1059
1059
  queryKey: ["cbv-filter-selected-labels", n, u, w ?? "", E],
1060
1060
  queryFn: () => {
1061
- const L = Lr(w, u);
1061
+ const L = Fr(w, u);
1062
1062
  return N.request(
1063
1063
  X(`/items/${n}`, {
1064
1064
  limit: m.length,
@@ -1355,7 +1355,7 @@ function Hs(n) {
1355
1355
  }
1356
1356
  return n === "year" ? { from: `${i.getFullYear()}-01-01`, to: d } : null;
1357
1357
  }
1358
- function Os(n) {
1358
+ function As(n) {
1359
1359
  var h;
1360
1360
  const i = [];
1361
1361
  for (const d of n) {
@@ -1389,7 +1389,7 @@ function Os(n) {
1389
1389
  }
1390
1390
  return i;
1391
1391
  }
1392
- const As = [
1392
+ const Is = [
1393
1393
  { label: "Contains", value: "_contains" },
1394
1394
  { label: "Doesn't contain", value: "_ncontains" },
1395
1395
  { label: "Equals", value: "_eq" },
@@ -1414,8 +1414,8 @@ const As = [
1414
1414
  { label: "Is empty", value: "_null" },
1415
1415
  { label: "Is not empty", value: "_nnull" }
1416
1416
  ], Cu = {
1417
- string: As,
1418
- text: As,
1417
+ string: Is,
1418
+ text: Is,
1419
1419
  integer: $r,
1420
1420
  decimal: $r,
1421
1421
  float: $r,
@@ -1446,7 +1446,7 @@ function ot(n, i, h) {
1446
1446
  (d) => d.many_collection === i && d.many_field === h && d.one_collection
1447
1447
  );
1448
1448
  }
1449
- function Dr({
1449
+ function Pr({
1450
1450
  relatedCollection: n,
1451
1451
  depth: i,
1452
1452
  path: h,
@@ -1491,7 +1491,7 @@ function Dr({
1491
1491
  }
1492
1492
  ),
1493
1493
  Q && F && /* @__PURE__ */ a(
1494
- Dr,
1494
+ Pr,
1495
1495
  {
1496
1496
  relatedCollection: Q,
1497
1497
  depth: i + 1,
@@ -1540,7 +1540,7 @@ function Ys({
1540
1540
  T = (K == null ? void 0 : K.one_collection) ?? null;
1541
1541
  }
1542
1542
  return T ? /* @__PURE__ */ a(
1543
- Dr,
1543
+ Pr,
1544
1544
  {
1545
1545
  relatedCollection: T,
1546
1546
  depth: i,
@@ -1552,7 +1552,7 @@ function Ys({
1552
1552
  }
1553
1553
  ) : /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + i}rem` }, children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
1554
1554
  }
1555
- function Is(n, i, h) {
1555
+ function Ks(n, i, h) {
1556
1556
  if (i) return "relation";
1557
1557
  const d = n.type ?? "string";
1558
1558
  return d === "integer" || d === "decimal" || d === "float" ? "number" : d === "datetime" || d === "timestamp" ? "date" : d;
@@ -1577,11 +1577,11 @@ function qu({
1577
1577
  for (const E of S.fields) {
1578
1578
  if (E.hidden) continue;
1579
1579
  const P = ot(S.relations, n, E.field);
1580
- P != null && P.one_collection && !qt(P.one_collection) && m.add(P.one_collection);
1580
+ P != null && P.one_collection && !Tt(P.one_collection) && m.add(P.one_collection);
1581
1581
  const M = Sn(S.relations, n, E.field);
1582
1582
  if (M) {
1583
1583
  const L = ka(S.relations, M) ?? M.relation.many_collection;
1584
- L && !qt(L) && m.add(L);
1584
+ L && !Tt(L) && m.add(L);
1585
1585
  }
1586
1586
  }
1587
1587
  return [...m].slice(0, 12);
@@ -1606,7 +1606,7 @@ function qu({
1606
1606
  for (const m of S.fields) {
1607
1607
  if (m.hidden) continue;
1608
1608
  const E = je(m.field), P = ot(S.relations, n, m.field), M = Sn(S.relations, n, m.field), L = [...i, m.field], ae = [...h, E];
1609
- if (P != null && P.one_collection && !qt(P.one_collection))
1609
+ if (P != null && P.one_collection && !Tt(P.one_collection))
1610
1610
  u(E) && w.push({
1611
1611
  key: m.field,
1612
1612
  label: E,
@@ -1636,7 +1636,7 @@ function qu({
1636
1636
  } else u(E) && w.push({
1637
1637
  key: m.field,
1638
1638
  label: E,
1639
- hint: Is(m, void 0),
1639
+ hint: Ks(m, void 0),
1640
1640
  leaf: { path: L, pathLabels: ae, fieldType: m.type ?? "string" }
1641
1641
  });
1642
1642
  }
@@ -1645,7 +1645,7 @@ function qu({
1645
1645
  for (const m of S.fields) {
1646
1646
  if (m.hidden) continue;
1647
1647
  const E = ot(S.relations, n, m.field);
1648
- if (!(E != null && E.one_collection) || qt(E.one_collection)) continue;
1648
+ if (!(E != null && E.one_collection) || Tt(E.one_collection)) continue;
1649
1649
  const P = V.get(E.one_collection);
1650
1650
  if (!P) continue;
1651
1651
  const M = je(m.field);
@@ -1658,7 +1658,7 @@ function qu({
1658
1658
  key: `${m.field}.${L.field}`,
1659
1659
  label: ae,
1660
1660
  breadcrumb: M,
1661
- hint: Is(L, oe ?? void 0),
1661
+ hint: Ks(L, oe ?? void 0),
1662
1662
  leaf: {
1663
1663
  path: [...i, m.field, L.field],
1664
1664
  pathLabels: [...h, M, ae],
@@ -1721,7 +1721,7 @@ function Tu({
1721
1721
  }), S = Hn(q), T = (q == null ? void 0 : q.display_template) ?? null, { data: K = [], isLoading: V } = ne({
1722
1722
  queryKey: ["cbv-filter-options", n, S, T ?? ""],
1723
1723
  queryFn: () => {
1724
- const w = Lr(T, S);
1724
+ const w = Fr(T, S);
1725
1725
  return y.request(
1726
1726
  X(`/items/${n}`, {
1727
1727
  limit: 500,
@@ -1889,7 +1889,7 @@ function Fu({
1889
1889
  /* @__PURE__ */ c("div", { className: "flex min-w-0 max-w-[24rem] flex-1 items-center gap-2", children: [
1890
1890
  /* @__PURE__ */ c("div", { className: "relative min-w-0 flex-1", children: [
1891
1891
  /* @__PURE__ */ a(
1892
- Ks,
1892
+ js,
1893
1893
  {
1894
1894
  "aria-hidden": !0,
1895
1895
  className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400"
@@ -2253,7 +2253,7 @@ function Ru({
2253
2253
  }
2254
2254
  ),
2255
2255
  T && (q == null ? void 0 : q.one_collection) && /* @__PURE__ */ a(
2256
- Dr,
2256
+ Pr,
2257
2257
  {
2258
2258
  relatedCollection: q.one_collection,
2259
2259
  depth: 1,
@@ -2369,7 +2369,7 @@ function Du({
2369
2369
  onClear: q,
2370
2370
  onSuccess: S
2371
2371
  }) {
2372
- const T = Ca(), K = St(), V = La(), I = Bs(), [u, w] = _("actions"), Q = oc([n], $), { data: F = [] } = ne({
2372
+ const T = Ca(), K = St(), V = La(), I = Us(), [u, w] = _("actions"), Q = oc([n], $), { data: F = [] } = ne({
2373
2373
  queryKey: ["bulk-recipes", n],
2374
2374
  queryFn: () => K.request(X("/bulk-recipes", { collection: n })).then((f) => f.data ?? []).catch(() => []),
2375
2375
  staleTime: 6e4
@@ -2463,7 +2463,7 @@ function Du({
2463
2463
  } finally {
2464
2464
  Ei(H), ge(!1);
2465
2465
  }
2466
- }, Tt = (f, H) => void mt(async (te) => {
2466
+ }, Lt = (f, H) => void mt(async (te) => {
2467
2467
  const de = await K.request(
2468
2468
  he(`/items/${n}/bulk-update?progress=${te}`, {
2469
2469
  ids: i,
@@ -2520,7 +2520,7 @@ function Du({
2520
2520
  }
2521
2521
  ),
2522
2522
  f.mine && /* @__PURE__ */ a(
2523
- Us,
2523
+ Lr,
2524
2524
  {
2525
2525
  title: `Delete recipe ${f.name}`,
2526
2526
  confirmLabel: "Delete?",
@@ -2545,7 +2545,7 @@ function Du({
2545
2545
  const f = $d(
2546
2546
  i.map((H) => I.urlFor({ collection: n, itemId: String(H) }))
2547
2547
  );
2548
- f.blocked > 0 || f.capped > 0 ? ye.warning(ws(f)) : ye.success(ws(f));
2548
+ f.blocked > 0 || f.capped > 0 ? ye.warning(_s(f)) : ye.success(_s(f));
2549
2549
  },
2550
2550
  "data-bulk-open-tabs": !0,
2551
2551
  title: `Open the selected records in new tabs (up to ${Cd})`,
@@ -2591,7 +2591,7 @@ function Du({
2591
2591
  collection: n,
2592
2592
  selectedIds: i,
2593
2593
  disabled: ee,
2594
- onApply: Tt,
2594
+ onApply: Lt,
2595
2595
  onSaveRecipe: (f, H) => {
2596
2596
  M(""), E({ action_type: "update", config: { field: f, value: H } });
2597
2597
  },
@@ -2668,7 +2668,7 @@ function Du({
2668
2668
  },
2669
2669
  children: [
2670
2670
  /* @__PURE__ */ a(
2671
- Es,
2671
+ Ds,
2672
2672
  {
2673
2673
  value: oe,
2674
2674
  onChange: (f) => {
@@ -2683,7 +2683,7 @@ function Du({
2683
2683
  }
2684
2684
  ),
2685
2685
  _e && Ie && /* @__PURE__ */ a(
2686
- Es,
2686
+ Ds,
2687
2687
  {
2688
2688
  value: J,
2689
2689
  onChange: $e,
@@ -2870,31 +2870,31 @@ function _0({
2870
2870
  showCreate: V = !0,
2871
2871
  className: I
2872
2872
  }) {
2873
- var Zl, es, ts, ns, as, rs, ls, ss, os, is, ds;
2874
- const u = St(), w = La(), { open: Q, urlFor: F } = Bs(), [m] = _(
2873
+ var es, ts, ns, as, rs, ls, ss, os, is, ds, cs;
2874
+ const u = St(), w = La(), { open: Q, urlFor: F } = Us(), [m] = _(
2875
2875
  () => cd(ud(`cbv:${n}`))
2876
2876
  ), [E] = _(
2877
- () => m ? Ss(m.f ?? []) : null
2877
+ () => m ? Cs(m.f ?? []) : null
2878
2878
  ), [P] = _(
2879
2879
  () => m ? null : md(`cbv:${n}`)
2880
2880
  ), [M, L] = _((m == null ? void 0 : m.p) ?? P ?? 1), ae = fe(P);
2881
2881
  me(() => {
2882
- const e = ys(ae.current, M);
2882
+ const e = ws(ae.current, M);
2883
2883
  if (e !== M) {
2884
2884
  L(e);
2885
2885
  return;
2886
2886
  }
2887
2887
  fd(`cbv:${n}`, M);
2888
2888
  }, [n, M]);
2889
- const oe = fe(ed()), [Ce, Ae] = _(m ? m.q ?? "" : N), Z = xs(Ce.trim(), 350), [Be, _e] = _(
2889
+ const oe = fe(ed()), [Ce, Ae] = _(m ? m.q ?? "" : N), Z = vs(Ce.trim(), 350), [Be, _e] = _(
2890
2890
  E ? E.filters : $ ?? []
2891
- ), [J, $e] = _(m ? m.s ?? "" : d ?? ""), [it, at] = _(h ?? null), [Ie, Pe] = _({}), [We, k] = _({}), [ie, ee] = _(null), [ge, rt] = _({}), [Xe, mt] = _({}), [Tt, f] = _({}), [H, te] = _({}), [de, re] = _(null), [qe, ht] = _(!1), It = fe(null), [Cn, lt] = _(
2891
+ ), [J, $e] = _(m ? m.s ?? "" : d ?? ""), [it, at] = _(h ?? null), [Ie, Pe] = _({}), [We, k] = _({}), [ie, ee] = _(null), [ge, rt] = _({}), [Xe, mt] = _({}), [Lt, f] = _({}), [H, te] = _({}), [de, re] = _(null), [qe, ht] = _(!1), It = fe(null), [Cn, lt] = _(
2892
2892
  () => (m == null ? void 0 : m.qf) ?? {}
2893
2893
  ), [gt, Kt] = _(
2894
2894
  () => (m == null ? void 0 : m.qf) ?? {}
2895
- ), [Lt, dn] = _(
2895
+ ), [Ft, dn] = _(
2896
2896
  m ? m.lc ?? [] : q ?? []
2897
- ), { scopes: Ft, ready: $n } = Vd(), [Ye, jt] = _(!1), [qn, Jn] = _(/* @__PURE__ */ new Set()), [Ve, zt] = _(
2897
+ ), { scopes: Rt, ready: $n } = Vd(), [Ye, jt] = _(!1), [qn, Jn] = _(/* @__PURE__ */ new Set()), [Ve, zt] = _(
2898
2898
  () => (m == null ? void 0 : m.cf) ?? {}
2899
2899
  ), xt = Si("drill.browser"), st = xt.value, [Tn, cn] = _(null), [un, Zt] = _(!1), [en, Gn] = _(() => {
2900
2900
  try {
@@ -2939,11 +2939,11 @@ function _0({
2939
2939
  }
2940
2940
  }), Js = () => {
2941
2941
  tn(null), Ke("");
2942
- }, Pr = fe(!1);
2942
+ }, Mr = fe(!1);
2943
2943
  me(() => {
2944
- !T || Pr.current || (Pr.current = !0, G(!0), Ke(T), Qt.mutate(T));
2944
+ !T || Mr.current || (Mr.current = !0, G(!0), Ke(T), Qt.mutate(T));
2945
2945
  }, [T]);
2946
- const [ce, Wt] = _(null), [En, Mr] = _(() => (m == null ? void 0 : m.ex) ?? []);
2946
+ const [ce, Wt] = _(null), [En, Or] = _(() => (m == null ? void 0 : m.ex) ?? []);
2947
2947
  me(() => {
2948
2948
  if (!ce) return;
2949
2949
  const e = () => Wt(null);
@@ -2953,23 +2953,23 @@ function _0({
2953
2953
  }, [ce]);
2954
2954
  const [nn, an] = _([]);
2955
2955
  Li();
2956
- const [Vt, Dn] = _(null), [Gs, Ra] = _(!1), [rn, Ea] = _(""), [Da, Or] = _(!1), [Xs, Ar] = _(!1), [Pa, fn] = _(!1), Ir = fe(null);
2956
+ const [Vt, Dn] = _(null), [Gs, Ra] = _(!1), [rn, Ea] = _(""), [Da, Ar] = _(!1), [Xs, Ir] = _(!1), [Pa, fn] = _(!1), Kr = fe(null);
2957
2957
  me(() => {
2958
2958
  if (!Pa) return;
2959
2959
  const e = (t) => {
2960
2960
  var r;
2961
- (r = Ir.current) != null && r.contains(t.target) || fn(!1);
2961
+ (r = Kr.current) != null && r.contains(t.target) || fn(!1);
2962
2962
  };
2963
2963
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
2964
2964
  }, [Pa]);
2965
- const Kr = fe(null), jr = fe(null), Br = !m && ((q == null ? void 0 : q.length) ?? 0) > 0, Ma = fe(!!m || Br), { isAdmin: Rt } = Ca(), Ur = fe(n);
2965
+ const jr = fe(null), Br = fe(null), Ur = !m && ((q == null ? void 0 : q.length) ?? 0) > 0, Ma = fe(!!m || Ur), { isAdmin: Ct } = Ca(), zr = fe(n);
2966
2966
  me(() => {
2967
- Ur.current !== n && (Ur.current = n, L(1), Ae(N), _e([]), $e(d ?? ""), at(h ?? null), Pe({}), k({}), rt({}), mt({}), an([]), Dn(null), lt({}), Kt({}), zt({}), dn([]), st != null && st.length && xt.back(st.length), cn(null), Ma.current = !1);
2967
+ zr.current !== n && (zr.current = n, L(1), Ae(N), _e([]), $e(d ?? ""), at(h ?? null), Pe({}), k({}), rt({}), mt({}), an([]), Dn(null), lt({}), Kt({}), zt({}), dn([]), st != null && st.length && xt.back(st.length), cn(null), Ma.current = !1);
2968
2968
  }, [n]), me(() => {
2969
2969
  if (!un) return;
2970
2970
  const e = (t) => {
2971
2971
  var r;
2972
- (r = Kr.current) != null && r.contains(t.target) || Zt(!1);
2972
+ (r = jr.current) != null && r.contains(t.target) || Zt(!1);
2973
2973
  };
2974
2974
  return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
2975
2975
  }, [un]), me(() => {
@@ -2985,34 +2985,34 @@ function _0({
2985
2985
  queryFn: () => u.request(X(`/collections/${n}`)).then((e) => e.data),
2986
2986
  staleTime: 10 * 6e4,
2987
2987
  retry: !1
2988
- }), Et = be(() => ((A == null ? void 0 : A.fields) ?? []).filter((e) => !e.hidden), [A]), De = (A == null ? void 0 : A.browser_config) ?? {}, Fe = (Zl = De.fulfilment) != null && Zl.shipped_field && ((es = De.fulfilment) != null && es.requested_field) ? De.fulfilment : null, zr = fe(!!m);
2988
+ }), Et = be(() => ((A == null ? void 0 : A.fields) ?? []).filter((e) => !e.hidden), [A]), De = (A == null ? void 0 : A.browser_config) ?? {}, Fe = (es = De.fulfilment) != null && es.shipped_field && ((ts = De.fulfilment) != null && ts.requested_field) ? De.fulfilment : null, Qr = fe(!!m);
2989
2989
  me(() => {
2990
- zr.current || !A || (zr.current = !0, !d && !J && De.default_sort && $e(De.default_sort));
2990
+ Qr.current || !A || (Qr.current = !0, !d && !J && De.default_sort && $e(De.default_sort));
2991
2991
  }, [A]);
2992
- const Dt = De.checkbox_selection !== !1, Qr = De.show_actions !== !1, [vt, Zs] = _(!1), eo = () => {
2992
+ const Dt = De.checkbox_selection !== !1, Wr = De.show_actions !== !1, [vt, Zs] = _(!1), eo = () => {
2993
2993
  vt && an([]), Zs(!vt);
2994
- }, ea = V && De.allow_create !== !1, Wr = typeof De.create_label == "string" && De.create_label.trim().slice(0, 40) || "New item", ta = Jd(ea && !(A != null && A.singleton) ? n : null), [Oa, Pn] = _(!1), [Aa, na] = _(null), { steps: Ia } = Wc(
2994
+ }, ea = V && De.allow_create !== !1, Vr = typeof De.create_label == "string" && De.create_label.trim().slice(0, 40) || "New item", ta = Jd(ea && !(A != null && A.singleton) ? n : null), [Oa, Pn] = _(!1), [Aa, na] = _(null), { steps: Ia } = Wc(
2995
2995
  ea && !(A != null && A.singleton) ? n : null,
2996
2996
  null
2997
- ), Vr = (e) => {
2997
+ ), Hr = (e) => {
2998
2998
  e ? Q({ collection: n, itemId: "new", layoutSlug: e }) : on("new");
2999
- }, Mn = Uc(ea && !(A != null && A.singleton) ? n : null), to = Ci(), Hr = fe(null), [no, ao] = _(null), [Yr, Jr] = _(!1), Gr = (e) => {
2999
+ }, Mn = Uc(ea && !(A != null && A.singleton) ? n : null), to = Ci(), Yr = fe(null), [no, ao] = _(null), [Jr, Gr] = _(!1), Xr = (e) => {
3000
3000
  var t;
3001
- ao(e), (t = Hr.current) == null || t.click();
3001
+ ao(e), (t = Yr.current) == null || t.click();
3002
3002
  }, ro = async (e) => {
3003
3003
  const t = Array.from(e.target.files ?? []);
3004
3004
  if (e.target.value = "", !!t.length) {
3005
- Jr(!0);
3005
+ Gr(!0);
3006
3006
  try {
3007
3007
  const r = await zc(to, t, n);
3008
3008
  Q({ collection: n, itemId: "new", layoutSlug: no, query: { autofill: r } });
3009
3009
  } catch (r) {
3010
3010
  Vi(r, "The document could not be read", { action: "New from document" });
3011
3011
  } finally {
3012
- Jr(!1);
3012
+ Gr(!1);
3013
3013
  }
3014
3014
  }
3015
- }, lo = (e) => Array.isArray(e == null ? void 0 : e.quick_picker) ? e.quick_picker.filter((t) => typeof t == "string") : [], Ka = fe(null), Xr = fe(null);
3015
+ }, lo = (e) => Array.isArray(e == null ? void 0 : e.quick_picker) ? e.quick_picker.filter((t) => typeof t == "string") : [], Ka = fe(null), Zr = fe(null);
3016
3016
  me(() => {
3017
3017
  if (!Oa) return;
3018
3018
  const e = (t) => {
@@ -3024,15 +3024,15 @@ function _0({
3024
3024
  const Je = m != null && m.ps ? m.ps : De.page_size && De.page_size > 0 ? Math.min(De.page_size, 200) : y, Pt = i.length > 0 ? i : De.quick_filters ?? [];
3025
3025
  me(() => {
3026
3026
  if (Ye || !$n || i.length === 0 && !A) return;
3027
- const e = Ft, t = Object.values((e == null ? void 0 : e.defaults) ?? {}).some((r) => r.length > 0) || Object.values((e == null ? void 0 : e.restricted) ?? {}).some((r) => r.length > 0);
3028
- if (!e || Pt.length === 0 || !t || m || Br) {
3027
+ const e = Rt, t = Object.values((e == null ? void 0 : e.defaults) ?? {}).some((r) => r.length > 0) || Object.values((e == null ? void 0 : e.restricted) ?? {}).some((r) => r.length > 0);
3028
+ if (!e || Pt.length === 0 || !t || m || Ur) {
3029
3029
  jt(!0);
3030
3030
  return;
3031
3031
  }
3032
3032
  (async () => {
3033
3033
  const r = {};
3034
3034
  for (const l of Pt) {
3035
- const s = Ns(e, { key: l.key, collection: l.collection });
3035
+ const s = Ss(e, { key: l.key, collection: l.collection });
3036
3036
  if (!s) continue;
3037
3037
  const o = Hd(e, s.name);
3038
3038
  if (o.length === 0) continue;
@@ -3053,35 +3053,35 @@ function _0({
3053
3053
  }
3054
3054
  jt(!0);
3055
3055
  })();
3056
- }, [Ye, $n, Ft, A, Pt]);
3057
- const Zr = (e) => {
3058
- const t = Ns(Ft, { key: e.key, collection: e.collection }), r = t ? (Ft == null ? void 0 : Ft.restricted[t.name]) ?? [] : [];
3056
+ }, [Ye, $n, Rt, A, Pt]);
3057
+ const el = (e) => {
3058
+ const t = Ss(Rt, { key: e.key, collection: e.collection }), r = t ? (Rt == null ? void 0 : Rt.restricted[t.name]) ?? [] : [];
3059
3059
  return r.length > 0 ? r : void 0;
3060
- }, kt = be(() => new Map(Et.map((e) => [e.field, e])), [Et]), Ge = (A == null ? void 0 : A.relations) ?? [], el = be(() => ld(De.inline_edit), [De.inline_edit]), { data: so } = ne({
3060
+ }, kt = be(() => new Map(Et.map((e) => [e.field, e])), [Et]), Ge = (A == null ? void 0 : A.relations) ?? [], tl = be(() => ld(De.inline_edit), [De.inline_edit]), { data: so } = ne({
3061
3061
  queryKey: ["my-permissions"],
3062
3062
  queryFn: () => u.request(X("/security/my/permissions")).then((e) => e.data),
3063
- enabled: el.enabled && !Rt,
3063
+ enabled: tl.enabled && !Ct,
3064
3064
  staleTime: 5 * 6e4
3065
- }), oo = Rt || xu(so, n), tl = be(
3065
+ }), oo = Ct || xu(so, n), nl = be(
3066
3066
  () => new Map(((A == null ? void 0 : A.fields) ?? []).map((e) => [e.field, e])),
3067
3067
  [A]
3068
- ), nl = Xc(), al = (e) => (
3068
+ ), al = Xc(), rl = (e) => (
3069
3069
  // Ask-the-table answers are a one-off overlay, not the list's own rows.
3070
3070
  le ? null : id({
3071
- config: el,
3071
+ config: tl,
3072
3072
  key: e,
3073
- field: tl.get(e),
3073
+ field: nl.get(e),
3074
3074
  collection: n,
3075
3075
  relations: Ge,
3076
3076
  mayUpdate: oo
3077
3077
  })
3078
3078
  ), io = (e, t, r, l, s) => {
3079
3079
  const o = e.id, b = s === 0 ? null : dd(
3080
- xe.filter((x) => !!al(x)),
3080
+ xe.filter((x) => !!rl(x)),
3081
3081
  t,
3082
3082
  s
3083
3083
  );
3084
- nl.commit({
3084
+ al.commit({
3085
3085
  cellKey: `${String(o)}|${t}`,
3086
3086
  collection: n,
3087
3087
  id: o,
@@ -3106,13 +3106,13 @@ function _0({
3106
3106
  onSaved: () => void w.invalidateQueries({ queryKey: ["cbv-items", n] })
3107
3107
  });
3108
3108
  }, co = (e, t, r, l) => {
3109
- const s = r ? null : al(t);
3109
+ const s = r ? null : rl(t);
3110
3110
  if (!s) return l;
3111
- const o = tl.get(t);
3111
+ const o = nl.get(t);
3112
3112
  return /* @__PURE__ */ a(
3113
3113
  Zc,
3114
3114
  {
3115
- controller: nl,
3115
+ controller: al,
3116
3116
  cellKey: `${String(e.id)}|${t}`,
3117
3117
  kind: s,
3118
3118
  value: e[t],
@@ -3128,21 +3128,21 @@ function _0({
3128
3128
  ), [it, Et, kt, We]), [ja, aa] = _(null), On = be(
3129
3129
  () => ja ?? (xe[0] ? { [xe[0]]: "left" } : {}),
3130
3130
  [ja, xe]
3131
- ), Ct = (e) => On[e], uo = (e) => {
3131
+ ), $t = (e) => On[e], uo = (e) => {
3132
3132
  const t = { ...On }, r = t[e];
3133
3133
  r ? r === "left" ? t[e] = "right" : delete t[e] : t[e] = "left", aa(t);
3134
- }, Ze = (e) => Ie[e] ?? (e.startsWith("__f:") ? We[e] ?? "Formula" : e.includes(".") ? e.split(".").map(je).join(" › ") : e === "id" ? "ID" : je(e)), rl = (e, t) => {
3134
+ }, Ze = (e) => Ie[e] ?? (e.startsWith("__f:") ? We[e] ?? "Formula" : e.includes(".") ? e.split(".").map(je).join(" › ") : e === "id" ? "ID" : je(e)), ll = (e, t) => {
3135
3135
  var l, s, o;
3136
3136
  const r = t.includes(".") ? (o = (s = (l = Te == null ? void 0 : Te.rows) == null ? void 0 : l[String(e.id)]) == null ? void 0 : s[t]) == null ? void 0 : o.value : e[t];
3137
3137
  return typeof r == "string" && /^-?\d+(\.\d+)?$/.test(r.trim()) ? Number(r) : r;
3138
3138
  }, po = (e, t) => {
3139
3139
  const r = We[t];
3140
- return r ? vs(r, (l) => rl(e, l)) : null;
3140
+ return r ? ks(r, (l) => ll(e, l)) : null;
3141
3141
  }, mo = (e, t) => {
3142
3142
  const r = We[t];
3143
3143
  if (r)
3144
3144
  return r.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (l, s) => {
3145
- const o = rl(e, s);
3145
+ const o = ll(e, s);
3146
3146
  return o == null || o === "" ? "—" : String(o);
3147
3147
  });
3148
3148
  }, Ht = be(
@@ -3155,7 +3155,7 @@ function _0({
3155
3155
  ...new Set(Ht.map((e) => e.info.relation.many_collection ?? "").filter(Boolean))
3156
3156
  ],
3157
3157
  [Ht]
3158
- ), ll = wa({
3158
+ ), sl = wa({
3159
3159
  queries: Ba.map((e) => ({
3160
3160
  queryKey: ["cbv-collection-meta", e],
3161
3161
  queryFn: () => u.request(X(`/collections/${e}`)).then((t) => t.data),
@@ -3166,9 +3166,9 @@ function _0({
3166
3166
  const e = /* @__PURE__ */ new Map();
3167
3167
  return Ba.forEach((t, r) => {
3168
3168
  var l;
3169
- return e.set(t, (l = ll[r]) == null ? void 0 : l.data);
3169
+ return e.set(t, (l = sl[r]) == null ? void 0 : l.data);
3170
3170
  }), e;
3171
- }, [Ba, ll]), Ua = be(
3171
+ }, [Ba, sl]), Ua = be(
3172
3172
  () => [
3173
3173
  ...new Set(
3174
3174
  Ht.filter((e) => e.info.kind === "m2m").map((e) => {
@@ -3180,20 +3180,20 @@ function _0({
3180
3180
  )
3181
3181
  ],
3182
3182
  [Ht, ln]
3183
- ), sl = wa({
3183
+ ), ol = wa({
3184
3184
  queries: Ua.map((e) => ({
3185
3185
  queryKey: ["cbv-collection-meta", e],
3186
3186
  queryFn: () => u.request(X(`/collections/${e}`)).then((t) => t.data),
3187
3187
  staleTime: 10 * 6e4,
3188
3188
  retry: !1
3189
3189
  }))
3190
- }), ol = be(() => {
3190
+ }), il = be(() => {
3191
3191
  const e = /* @__PURE__ */ new Map();
3192
3192
  return Ua.forEach((t, r) => {
3193
3193
  var l;
3194
- return e.set(t, (l = sl[r]) == null ? void 0 : l.data);
3194
+ return e.set(t, (l = ol[r]) == null ? void 0 : l.data);
3195
3195
  }), e;
3196
- }, [Ua, sl]), He = be(() => {
3196
+ }, [Ua, ol]), He = be(() => {
3197
3197
  const e = {};
3198
3198
  for (const t of Ht) {
3199
3199
  const r = t.info.relation.many_collection ?? "";
@@ -3203,11 +3203,11 @@ function _0({
3203
3203
  const l = ln.get(r), s = l == null ? void 0 : l.relations.find(
3204
3204
  (b) => b.many_collection === r && b.many_field === t.info.relation.junction_field
3205
3205
  ), o = (s == null ? void 0 : s.one_collection) ?? "";
3206
- e[t.field] = `${t.field}.${Hn(o ? ol.get(o) : void 0)}`;
3206
+ e[t.field] = `${t.field}.${Hn(o ? il.get(o) : void 0)}`;
3207
3207
  }
3208
3208
  }
3209
3209
  return e;
3210
- }, [Ht, ln, ol]), il = be(() => {
3210
+ }, [Ht, ln, il]), dl = be(() => {
3211
3211
  const e = {};
3212
3212
  for (const t of Ht)
3213
3213
  if (t.info.kind === "o2m")
@@ -3219,9 +3219,9 @@ function _0({
3219
3219
  s != null && s.one_collection && (e[t.field] = { kind: "m2m", target: s.one_collection });
3220
3220
  }
3221
3221
  return e;
3222
- }, [Ht, ln]), za = xs(Ve, 350), [bn, fo] = _((m == null ? void 0 : m.a) === !0), [dl, bo] = _(null), An = $c(n, dl), [$t, cl] = _(null), { data: In } = gc(n), [Mt, ra] = _(() => (E == null ? void 0 : E.riskIds) ?? []), Ne = be(() => {
3222
+ }, [Ht, ln]), za = vs(Ve, 350), [bn, fo] = _((m == null ? void 0 : m.a) === !0), [cl, bo] = _(null), An = $c(n, cl), [qt, ul] = _(null), { data: In } = gc(n), [Mt, ra] = _(() => (E == null ? void 0 : E.riskIds) ?? []), Ne = be(() => {
3223
3223
  var t;
3224
- const e = Os(Be);
3224
+ const e = As(Be);
3225
3225
  for (const r of Pt) {
3226
3226
  const l = gt[r.key] ?? [];
3227
3227
  l.length !== 0 && ((t = r.or_paths) != null && t.length ? e.push({
@@ -3262,7 +3262,7 @@ function _0({
3262
3262
  b && (b.from && e.push({ path: [r], op: "_gte", value: b.from }), b.to && e.push({ path: [r], op: "_lte", value: `${b.to}T23:59:59` }));
3263
3263
  }
3264
3264
  }
3265
- for (const r of Lt) e.push({ path: r.path, op: r.op, value: r.value });
3265
+ for (const r of Ft) e.push({ path: r.path, op: r.op, value: r.value });
3266
3266
  for (const r of En)
3267
3267
  e.push({
3268
3268
  or: [
@@ -3278,7 +3278,7 @@ function _0({
3278
3278
  Pt,
3279
3279
  gt,
3280
3280
  za,
3281
- Lt,
3281
+ Ft,
3282
3282
  En,
3283
3283
  bn,
3284
3284
  An.condition,
@@ -3288,11 +3288,11 @@ function _0({
3288
3288
  if (!t || !r) return null;
3289
3289
  const l = e.find((s) => ["name", "title", "label", "short_name"].includes(s.toLowerCase())) ?? null;
3290
3290
  return { latField: t, lngField: r, labelField: l };
3291
- }, [A]), [la, ul] = _(!1), [pl, ho] = _(!1), ml = fe(Ne);
3291
+ }, [A]), [la, pl] = _(!1), [ml, ho] = _(!1), fl = fe(Ne);
3292
3292
  me(() => {
3293
- ml.current !== Ne && (ml.current = Ne, L(ys(ae.current, 1)));
3293
+ fl.current !== Ne && (fl.current = Ne, L(ws(ae.current, 1)));
3294
3294
  }, [Ne]);
3295
- const Kn = Object.keys(Xe).filter((e) => !e.includes(".") && !e.startsWith("__")).sort().join(","), fl = (e) => [
3295
+ const Kn = Object.keys(Xe).filter((e) => !e.includes(".") && !e.startsWith("__")).sort().join(","), bl = (e) => [
3296
3296
  "cbv-items",
3297
3297
  n,
3298
3298
  Z,
@@ -3301,7 +3301,7 @@ function _0({
3301
3301
  ue ? 500 : Je,
3302
3302
  Ne,
3303
3303
  Kn
3304
- ], bl = async (e) => {
3304
+ ], hl = async (e) => {
3305
3305
  const t = {
3306
3306
  limit: ue ? 500 : Je,
3307
3307
  ...Z ? { search: Z } : {},
@@ -3344,20 +3344,20 @@ function _0({
3344
3344
  refetch: Wa,
3345
3345
  error: et
3346
3346
  } = ne({
3347
- queryKey: fl(M),
3348
- queryFn: () => bl(M),
3347
+ queryKey: bl(M),
3348
+ queryFn: () => hl(M),
3349
3349
  enabled: !!n && Ye,
3350
3350
  placeholderData: (e) => e,
3351
3351
  // #2490 — a collection whose live record events are off polls instead (visible tabs only).
3352
3352
  refetchInterval: De.live_events === "off" ? 3e4 : !1,
3353
3353
  retry: !1
3354
- }), hl = fe(() => {
3354
+ }), gl = fe(() => {
3355
3355
  });
3356
3356
  Td({
3357
3357
  qc: w,
3358
3358
  enabled: !!n && Ye && !ue && !Z && !yt && !!ve && M * Je < (ve.total ?? 0),
3359
- queryKey: fl(M + 1),
3360
- queryFn: () => bl(M + 1).then((e) => (hl.current(e.data ?? []), e))
3359
+ queryKey: bl(M + 1),
3360
+ queryFn: () => hl(M + 1).then((e) => (gl.current(e.data ?? []), e))
3361
3361
  }), me(() => {
3362
3362
  const e = bd({
3363
3363
  pending: ae.current,
@@ -3376,10 +3376,10 @@ function _0({
3376
3376
  const Se = le ? le.rows : (ve == null ? void 0 : ve.data) ?? [], Me = le ? le.total : (ve == null ? void 0 : ve.total) ?? 0, sn = !le && !!ve && (ve.total_timed_out === !0 || ve.total == null), Va = !le && (ve == null ? void 0 : ve.total_approx) === !0, Ha = ve == null ? void 0 : ve.aggregates, oa = sn ? M + (Se.length >= Je ? 1 : 0) : Math.max(1, Math.ceil(Me / Je)), jn = Pt.filter(
3377
3377
  (e) => {
3378
3378
  var t;
3379
- return qn.has(e.key) && (((t = gt[e.key]) == null ? void 0 : t.length) ?? 0) > 0 && !Zr(e);
3379
+ return qn.has(e.key) && (((t = gt[e.key]) == null ? void 0 : t.length) ?? 0) > 0 && !el(e);
3380
3380
  }
3381
- ), gl = jn.map((e) => e.key).join(","), Ya = be(() => {
3382
- if (!gl || !Ne) return Ne;
3381
+ ), xl = jn.map((e) => e.key).join(","), Ya = be(() => {
3382
+ if (!xl || !Ne) return Ne;
3383
3383
  const e = new Set(
3384
3384
  jn.map((r) => {
3385
3385
  var s;
@@ -3392,7 +3392,7 @@ function _0({
3392
3392
  (r) => !e.has(JSON.stringify(r))
3393
3393
  );
3394
3394
  return t.length > 0 ? JSON.stringify(t) : void 0;
3395
- }, [gl, Ne, gt]), { data: ia } = ne({
3395
+ }, [xl, Ne, gt]), { data: ia } = ne({
3396
3396
  queryKey: ["cbv-default-hidden", n, Z, Ya],
3397
3397
  enabled: !!n && !le && !!ve && !yt && Me === 0 && jn.length > 0,
3398
3398
  staleTime: 3e4,
@@ -3413,9 +3413,9 @@ function _0({
3413
3413
  return l;
3414
3414
  };
3415
3415
  lt(t), Kt(t), L(1);
3416
- }, xl = fe(Date.now()), da = fe(null);
3416
+ }, vl = fe(Date.now()), da = fe(null);
3417
3417
  me(() => {
3418
- xl.current = Date.now();
3418
+ vl.current = Date.now();
3419
3419
  }, [n, Z]), me(() => {
3420
3420
  var t, r;
3421
3421
  if (!n || Z.length < 2 || !ve || yt || le) return;
@@ -3427,7 +3427,7 @@ function _0({
3427
3427
  collection: n,
3428
3428
  query: Z,
3429
3429
  result_count: ve.total ?? ((r = ve.data) == null ? void 0 : r.length) ?? 0,
3430
- duration_ms: Date.now() - xl.current
3430
+ duration_ms: Date.now() - vl.current
3431
3431
  })
3432
3432
  });
3433
3433
  }, [u, n, Z, ve, yt, le]), tc(
@@ -3447,19 +3447,19 @@ function _0({
3447
3447
  }
3448
3448
  } : null
3449
3449
  );
3450
- const vo = nc(), vl = $i(yt), Ja = qi({
3450
+ const vo = nc(), kl = $i(yt), Ja = qi({
3451
3451
  pending: yt,
3452
3452
  request: n ? { method: "GET", url: `/items/${n}` } : null,
3453
3453
  noun: ((A == null ? void 0 : A.display_name) ?? n ?? "").replace(/_/g, " ").toLowerCase() || null,
3454
3454
  // Only a total this person has already been shown (never a raw table count).
3455
3455
  knownRows: yt ? Qd(w.getQueriesData({ queryKey: ["cbv-items", n] })) : null
3456
- }), Ga = Pd(), { userId: Bn } = Ca(), kl = (e) => Rt || !!Bn && String(e.user ?? "").toUpperCase() === String(Bn).toUpperCase(), Ot = gd(), Xa = fe(/* @__PURE__ */ new Set());
3456
+ }), Ga = Pd(), { userId: Bn } = Ca(), yl = (e) => Ct || !!Bn && String(e.user ?? "").toUpperCase() === String(Bn).toUpperCase(), Ot = gd(), Xa = fe(/* @__PURE__ */ new Set());
3457
3457
  Xa.current = new Set(Se.map((e) => String(e.id)));
3458
3458
  const ko = be(
3459
3459
  () => Se.slice(0, 100).map((e) => ({ collection: n, item: String(e.id) })),
3460
3460
  [Se, n]
3461
- ), yl = Rd(ko), wl = fe([]);
3462
- wl.current = [
3461
+ ), wl = Rd(ko), _l = fe([]);
3462
+ _l.current = [
3463
3463
  "cbv-items",
3464
3464
  n,
3465
3465
  Z,
@@ -3469,13 +3469,13 @@ function _0({
3469
3469
  Ne,
3470
3470
  Kn
3471
3471
  ];
3472
- const _l = fe({
3472
+ const Nl = fe({
3473
3473
  conditions: Ne,
3474
3474
  search: Z,
3475
3475
  page: M,
3476
3476
  grouped: !!ue
3477
3477
  });
3478
- _l.current = {
3478
+ Nl.current = {
3479
3479
  conditions: Ne,
3480
3480
  search: Z,
3481
3481
  page: M,
@@ -3494,7 +3494,7 @@ function _0({
3494
3494
  t.clear();
3495
3495
  }, 300));
3496
3496
  }, s = (D) => w.setQueryData(
3497
- wl.current,
3497
+ _l.current,
3498
3498
  (z) => z && { ...z, ...D(z) }
3499
3499
  );
3500
3500
  let o = [], b = null, x = null, v = !1;
@@ -3535,7 +3535,7 @@ function _0({
3535
3535
  })), Ot.forget(At);
3536
3536
  }
3537
3537
  if (z.size === 0) return;
3538
- const ut = _l.current;
3538
+ const ut = Nl.current;
3539
3539
  let Jt;
3540
3540
  try {
3541
3541
  Jt = await kd(
@@ -3635,7 +3635,7 @@ function _0({
3635
3635
  }), Ue = Se.map((e) => String(e.id)).join(","), Co = be(
3636
3636
  () => Se.map((e) => ({ collection: n, id: e.id })),
3637
3637
  [Se, n]
3638
- ), $o = tu(Co, Rt), nr = !!(A != null && A.addendums_enabled), { data: ar } = ne({
3638
+ ), $o = tu(Co, Ct), nr = !!(A != null && A.addendums_enabled), { data: ar } = ne({
3639
3639
  queryKey: ["cbv-addendum-summary", n, Ue],
3640
3640
  queryFn: () => u.request(
3641
3641
  he("/addendums/summary", { collection: n, ids: Ue.split(",") })
@@ -3644,7 +3644,7 @@ function _0({
3644
3644
  placeholderData: (e) => e,
3645
3645
  staleTime: 3e4,
3646
3646
  retry: !1
3647
- }), { data: Nl = !1 } = ne({
3647
+ }), { data: Sl = !1 } = ne({
3648
3648
  queryKey: ["cbv-tasks-used", n],
3649
3649
  queryFn: () => u.request(X("/tasks", { collection: n, limit: 1 })).then((e) => (e.data ?? []).length > 0).catch(() => !1),
3650
3650
  enabled: !!n && !n.startsWith("nivaro_"),
@@ -3655,7 +3655,7 @@ function _0({
3655
3655
  queryFn: () => u.request(
3656
3656
  he("/tasks/counts", { collection: n, ids: Ue.split(",") })
3657
3657
  ).then((e) => e.data ?? {}),
3658
- enabled: !!n && Nl && Ue.length > 0,
3658
+ enabled: !!n && Sl && Ue.length > 0,
3659
3659
  placeholderData: (e) => e,
3660
3660
  staleTime: 3e4,
3661
3661
  retry: !1
@@ -3673,12 +3673,12 @@ function _0({
3673
3673
  queryFn: () => u.request(X("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
3674
3674
  staleTime: 6e4,
3675
3675
  retry: !1
3676
- }), Sl = qo.includes(n), { data: sr } = ne({
3676
+ }), Cl = qo.includes(n), { data: sr } = ne({
3677
3677
  queryKey: ["cbv-integrations-summary", n, Ue],
3678
3678
  queryFn: () => u.request(
3679
3679
  he("/integration-obligations/summary", { collection: n, ids: Ue.split(",") })
3680
3680
  ).then((e) => e.data ?? {}).catch(() => ({})),
3681
- enabled: !!n && Sl && Ue.length > 0,
3681
+ enabled: !!n && Cl && Ue.length > 0,
3682
3682
  placeholderData: (e) => e,
3683
3683
  staleTime: 3e4,
3684
3684
  retry: !1
@@ -3691,9 +3691,9 @@ function _0({
3691
3691
  placeholderData: (e) => e,
3692
3692
  staleTime: 3e4,
3693
3693
  retry: !1
3694
- }), ua = (ts = Re == null ? void 0 : Re.binding) == null ? void 0 : ts.template, { data: wt } = ne({
3695
- queryKey: ["cbv-pipeline-template", ua, Rt ? "full" : "outline"],
3696
- queryFn: () => u.request(X(Rt ? `/pipelines/${ua}` : `/pipelines/${ua}/outline`)).then((e) => e.data),
3694
+ }), ua = (ns = Re == null ? void 0 : Re.binding) == null ? void 0 : ns.template, { data: wt } = ne({
3695
+ queryKey: ["cbv-pipeline-template", ua, Ct ? "full" : "outline"],
3696
+ queryFn: () => u.request(X(Ct ? `/pipelines/${ua}` : `/pipelines/${ua}/outline`)).then((e) => e.data),
3697
3697
  enabled: !!ua,
3698
3698
  retry: !1
3699
3699
  }), To = !!(Re != null && Re.binding), { data: or } = ne({
@@ -3706,26 +3706,26 @@ function _0({
3706
3706
  enabled: To && Ue.length > 0,
3707
3707
  staleTime: 6e4,
3708
3708
  retry: !1
3709
- }), Cl = be(
3709
+ }), $l = be(
3710
3710
  () => xe.filter((e) => e.includes(".")),
3711
3711
  [xe]
3712
- ), $l = be(
3712
+ ), ql = be(
3713
3713
  () => xe.filter((e) => e.startsWith("__f:")).flatMap((e) => Hi(We[e] ?? "")).filter((e) => e.includes(".")),
3714
3714
  [xe, We]
3715
3715
  ), Un = be(
3716
- () => [.../* @__PURE__ */ new Set([...Cl, ...Object.values(He), ...$l])].slice(
3716
+ () => [.../* @__PURE__ */ new Set([...$l, ...Object.values(He), ...ql])].slice(
3717
3717
  0,
3718
3718
  20
3719
3719
  ),
3720
- [Cl, He, $l]
3721
- ), ql = Se.map((e) => String(e.id)).join(","), Tl = (e) => u.request(
3720
+ [$l, He, ql]
3721
+ ), Tl = Se.map((e) => String(e.id)).join(","), Ll = (e) => u.request(
3722
3722
  X(`/items/${n}/resolve-paths`, {
3723
3723
  ids: e,
3724
3724
  paths: Un.join(",")
3725
3725
  })
3726
3726
  ).then((t) => t.data ?? { rows: {}, targets: {} }), { data: Te } = ne({
3727
- queryKey: ["cbv-resolved", n, ql, Un.join(",")],
3728
- queryFn: () => Tl(ql),
3727
+ queryKey: ["cbv-resolved", n, Tl, Un.join(",")],
3728
+ queryFn: () => Ll(Tl),
3729
3729
  enabled: Se.length > 0 && Un.length > 0,
3730
3730
  staleTime: 3e4,
3731
3731
  retry: !1
@@ -3735,7 +3735,7 @@ function _0({
3735
3735
  if (!r) return null;
3736
3736
  const l = (b = (o = (s = Te == null ? void 0 : Te.rows) == null ? void 0 : s[String(e)]) == null ? void 0 : o[r]) == null ? void 0 : b.value;
3737
3737
  return l == null || l === "" ? "—" : l;
3738
- }, Ll = (e) => {
3738
+ }, Fl = (e) => {
3739
3739
  var r;
3740
3740
  const t = e.includes(".") ? e : He[e];
3741
3741
  return t ? ((r = Te == null ? void 0 : Te.targets) == null ? void 0 : r[t]) ?? null : null;
@@ -3744,9 +3744,9 @@ function _0({
3744
3744
  const r = t.includes(".") ? t : He[t];
3745
3745
  if (!r) return null;
3746
3746
  const l = (o = Te == null ? void 0 : Te.targets) == null ? void 0 : o[r], s = ((v = (x = (b = Te == null ? void 0 : Te.rows) == null ? void 0 : b[String(e)]) == null ? void 0 : x[r]) == null ? void 0 : v.ids) ?? [];
3747
- return !l || qt(l) || s.length === 0 ? null : { target: l, id: String(s[0]) };
3747
+ return !l || Tt(l) || s.length === 0 ? null : { target: l, id: String(s[0]) };
3748
3748
  }, Bt = (e) => e.includes(".") || e in He;
3749
- hl.current = (e) => Ii({
3749
+ gl.current = (e) => Ii({
3750
3750
  qc: w,
3751
3751
  collection: n,
3752
3752
  rows: e,
@@ -3754,7 +3754,7 @@ function _0({
3754
3754
  relations: Ge,
3755
3755
  resolveList: Un,
3756
3756
  isResolvedCol: Bt,
3757
- fetchResolved: Tl,
3757
+ fetchResolved: Ll,
3758
3758
  fetchRelation: (t, r) => Qs(u, t, r),
3759
3759
  userCardQuery: (t) => Xd(u, t)
3760
3760
  });
@@ -3762,8 +3762,8 @@ function _0({
3762
3762
  if (e.includes(".")) return { kind: "text", path: e.split(".") };
3763
3763
  const t = ot(Ge, n, e);
3764
3764
  if (t != null && t.one_collection)
3765
- return qt(t.one_collection) && t.one_collection !== "nivaro_users" ? null : { kind: "in", target: t.one_collection };
3766
- const r = il[e];
3765
+ return Tt(t.one_collection) && t.one_collection !== "nivaro_users" ? null : { kind: "in", target: t.one_collection };
3766
+ const r = dl[e];
3767
3767
  if (r) {
3768
3768
  if (r.kind === "m2m") return { kind: "in", target: r.target };
3769
3769
  const s = He[e];
@@ -3836,7 +3836,7 @@ function _0({
3836
3836
  const v = t.includes(".") || t in He ? _t(s, t) : String(r[t] ?? "");
3837
3837
  v && v !== "—" && (b = { id: x, path: o.path, op: "_ncontains", value: v, label: v, field: t });
3838
3838
  }
3839
- b && Mr((v) => [...v, b]);
3839
+ b && Or((v) => [...v, b]);
3840
3840
  }, Do = (e) => {
3841
3841
  var l, s, o;
3842
3842
  const t = gn(e);
@@ -3945,9 +3945,9 @@ function _0({
3945
3945
  const x = t.includes(".") ? t : He[t], v = r != null && x ? (b = (o = (s = Te == null ? void 0 : Te.rows) == null ? void 0 : s[String(r)]) == null ? void 0 : o[x]) == null ? void 0 : b.ids : void 0, U = Zi(e === "—" ? "" : e, v);
3946
3946
  return String(U);
3947
3947
  }
3948
- return l && e && e !== "—" ? ks(e, l) : e;
3949
- }, Fl = (e) => {
3950
- const t = Ll(e);
3948
+ return l && e && e !== "—" ? ys(e, l) : e;
3949
+ }, Rl = (e) => {
3950
+ const t = Fl(e);
3951
3951
  return !!t && (t === "nivaro_files" || /_files$/.test(t));
3952
3952
  }, { data: dt = [] } = ne({
3953
3953
  queryKey: ["cbv-views", n],
@@ -3955,7 +3955,7 @@ function _0({
3955
3955
  staleTime: 3e4
3956
3956
  }), vn = () => w.invalidateQueries({ queryKey: ["cbv-views", n] }), Oo = wa({
3957
3957
  queries: dt.slice(0, 12).map((e) => {
3958
- const t = Os(e.filters ?? []);
3958
+ const t = As(e.filters ?? []);
3959
3959
  return {
3960
3960
  queryKey: ["cbv-view-count", n, e.id, JSON.stringify(t)],
3961
3961
  queryFn: () => u.request(
@@ -3975,16 +3975,16 @@ function _0({
3975
3975
  var r;
3976
3976
  dr.set(e.id, ((r = Oo[t]) == null ? void 0 : r.data) ?? null);
3977
3977
  });
3978
- const [Rl, Ao] = _(() => /* @__PURE__ */ new Set()), pa = (e) => {
3978
+ const [El, Ao] = _(() => /* @__PURE__ */ new Set()), pa = (e) => {
3979
3979
  var r, l;
3980
3980
  Dn(e.id);
3981
- const t = Ss(e.filters ?? []);
3981
+ const t = Cs(e.filters ?? []);
3982
3982
  if (_e(t.filters), ra(t.riskIds), $e(e.sort ?? ""), (r = e.columns) != null && r.length) {
3983
3983
  const s = new Set(
3984
- e.columns.filter((p) => typeof p != "string" && p.admin_only).map(Ds)
3984
+ e.columns.filter((p) => typeof p != "string" && p.admin_only).map(Ps)
3985
3985
  );
3986
3986
  Ao(s);
3987
- const o = e.columns.map(Ds).filter((p) => Rt || !s.has(p)), b = {};
3987
+ const o = e.columns.map(Ps).filter((p) => Ct || !s.has(p)), b = {};
3988
3988
  for (const p of e.columns)
3989
3989
  typeof p != "string" && p.formula && p.key.startsWith("__f:") && (b[p.key] = p.formula);
3990
3990
  k(b);
@@ -3999,7 +3999,7 @@ function _0({
3999
3999
  } else
4000
4000
  aa(null);
4001
4001
  L(1);
4002
- }, El = () => {
4002
+ }, Dl = () => {
4003
4003
  const e = dt.find((t) => t.role_default) ?? dt.find((t) => t.is_default);
4004
4004
  if (e) {
4005
4005
  pa(e);
@@ -4012,8 +4012,8 @@ function _0({
4012
4012
  sort: J,
4013
4013
  columns: [
4014
4014
  ...xe.map((e, t) => {
4015
- const r = Ie[e], l = ge[e], s = On[e] ?? (t === 0 && ja !== null ? "none" : void 0), o = H[e], b = Tt[e], x = Xe[e], v = We[e];
4016
- return !r && !l && !s && !(o != null && o.length) && !b && !x && !v && !Rl.has(e) ? e : {
4015
+ const r = Ie[e], l = ge[e], s = On[e] ?? (t === 0 && ja !== null ? "none" : void 0), o = H[e], b = Lt[e], x = Xe[e], v = We[e];
4016
+ return !r && !l && !s && !(o != null && o.length) && !b && !x && !v && !El.has(e) ? e : {
4017
4017
  key: e,
4018
4018
  ...v ? { formula: v } : {},
4019
4019
  ...r ? { label: r } : {},
@@ -4022,7 +4022,7 @@ function _0({
4022
4022
  ...o != null && o.length ? { tint: o } : {},
4023
4023
  ...b ? { width: b } : {},
4024
4024
  ...x ? { agg: x } : {},
4025
- ...Rl.has(e) ? { admin_only: !0 } : {}
4025
+ ...El.has(e) ? { admin_only: !0 } : {}
4026
4026
  };
4027
4027
  }),
4028
4028
  // Synthetic columns (State/Owners/Actions) persist pins as pin-only
@@ -4046,13 +4046,13 @@ function _0({
4046
4046
  const e = dt.find((t) => t.role_default) ?? dt.find((t) => t.is_default);
4047
4047
  e && Vt == null && (pa(e), P && L(P));
4048
4048
  }, [dt, Et]);
4049
- const { data: Dl = [] } = ne({
4049
+ const { data: Pl = [] } = ne({
4050
4050
  queryKey: ["cbv-export-presets", n],
4051
4051
  queryFn: () => u.request(
4052
4052
  X("/export-presets", { collection: n })
4053
4053
  ).then((e) => e.data ?? []),
4054
4054
  staleTime: 6e4
4055
- }), [ma, Pl] = _(""), Ml = async () => {
4055
+ }), [ma, Ml] = _(""), Ol = async () => {
4056
4056
  ma.trim() && (await u.request(
4057
4057
  he("/export-presets", {
4058
4058
  collection: n,
@@ -4063,7 +4063,7 @@ function _0({
4063
4063
  },
4064
4064
  is_shared: !0
4065
4065
  })
4066
- ), Pl(""), w.invalidateQueries({ queryKey: ["cbv-export-presets", n] }));
4066
+ ), Ml(""), w.invalidateQueries({ queryKey: ["cbv-export-presets", n] }));
4067
4067
  }, Io = (e) => {
4068
4068
  const t = new URLSearchParams();
4069
4069
  Z && t.set("search", Z), Ne && t.set("conditions", Ne), J && t.set("sort", J), window.open(`/api/export-presets/${e}/run?${t.toString()}`, "_blank");
@@ -4075,10 +4075,10 @@ function _0({
4075
4075
  ...J ? { sort: J } : {}
4076
4076
  })
4077
4077
  ).then(() => ye.info(`Exporting “${t}” in the background — follow it in the Jobs tray`)).catch((r) => ye.error(Xt(r, "Could not start the export")));
4078
- }, Ol = fe(!1);
4078
+ }, Al = fe(!1);
4079
4079
  me(() => {
4080
4080
  var e;
4081
- Ol.current || !m || Et.length === 0 || (Ol.current = !0, (e = m.c) != null && e.length && (pa({
4081
+ Al.current || !m || Et.length === 0 || (Al.current = !0, (e = m.c) != null && e.length && (pa({
4082
4082
  id: -1,
4083
4083
  filters: m.f ?? [],
4084
4084
  sort: m.s ?? null,
@@ -4096,7 +4096,7 @@ function _0({
4096
4096
  c: e.columns,
4097
4097
  qf: gt,
4098
4098
  cf: Ve,
4099
- lc: Lt,
4099
+ lc: Ft,
4100
4100
  ex: En,
4101
4101
  ...ue ? { g: ue } : {},
4102
4102
  ps: Je,
@@ -4110,11 +4110,11 @@ function _0({
4110
4110
  onSuccess: (e) => {
4111
4111
  Ra(!1), Ea(""), Dn(e.data.id), vn();
4112
4112
  }
4113
- }), [cr, Al] = _(null), Ut = Nt({
4113
+ }), [cr, Il] = _(null), Ut = Nt({
4114
4114
  mutationFn: (e) => u.request(va(`/saved-views/${e}`, zn())),
4115
4115
  onSuccess: (e, t) => {
4116
4116
  var l;
4117
- vn(), Al(t), setTimeout(() => Al((s) => s === t ? null : s), 2e3);
4117
+ vn(), Il(t), setTimeout(() => Il((s) => s === t ? null : s), 2e3);
4118
4118
  const r = (l = dt.find((s) => s.id === t)) == null ? void 0 : l.name;
4119
4119
  ye.success(r ? `Saved "${r}" with the current columns and filters` : "View saved");
4120
4120
  },
@@ -4126,7 +4126,7 @@ function _0({
4126
4126
  mutationFn: ({ id: e, role: t }) => u.request(va(`/saved-views/${e}`, { default_for_role: t })),
4127
4127
  onSuccess: vn,
4128
4128
  onError: (e) => ye.error(`Could not set the role default: ${e.message}`)
4129
- }), Il = Nt({
4129
+ }), Kl = Nt({
4130
4130
  mutationFn: () => {
4131
4131
  const e = dt.find((t) => t.is_default);
4132
4132
  return e ? u.request(va(`/saved-views/${e.id}`, { ...zn(), is_default: !0 })) : u.request(
@@ -4136,7 +4136,7 @@ function _0({
4136
4136
  onSuccess: () => {
4137
4137
  Zt(!1), vn();
4138
4138
  }
4139
- }), Kl = Nt({
4139
+ }), jl = Nt({
4140
4140
  mutationFn: (e) => u.request(_a(`/items/${n}/${e}`)),
4141
4141
  onSuccess: () => {
4142
4142
  ye.success("Moved to the trash"), w.invalidateQueries({ queryKey: ["cbv-items", n] });
@@ -4149,7 +4149,7 @@ function _0({
4149
4149
  }), zo = Nt({
4150
4150
  mutationFn: (e) => u.request(_a(`/saved-views/${e}`)),
4151
4151
  onSuccess: (e, t) => {
4152
- Vt === t && El(), vn();
4152
+ Vt === t && Dl(), vn();
4153
4153
  }
4154
4154
  }), { data: Qo = [] } = ne({
4155
4155
  queryKey: ["cbv-view-subs"],
@@ -4164,7 +4164,7 @@ function _0({
4164
4164
  }), Vo = async () => {
4165
4165
  var e, t;
4166
4166
  if (!Da) {
4167
- Or(!0);
4167
+ Ar(!0);
4168
4168
  try {
4169
4169
  const { rows: r, truncated: l } = await vc(
4170
4170
  (C, B) => u.request(
@@ -4185,7 +4185,7 @@ function _0({
4185
4185
  b.push(C);
4186
4186
  continue;
4187
4187
  }
4188
- if (qt(B)) continue;
4188
+ if (Tt(B)) continue;
4189
4189
  const we = await w.fetchQuery({
4190
4190
  queryKey: ["cbv-collection-meta", B],
4191
4191
  queryFn: () => u.request(X(`/collections/${B}`)).then((Ee) => Ee.data),
@@ -4224,22 +4224,22 @@ function _0({
4224
4224
  const B = C == null ? "" : String(typeof C == "object" ? JSON.stringify(C) : C);
4225
4225
  return /[",\n]/.test(B) ? `"${B.replace(/"/g, '""')}"` : B;
4226
4226
  }, Y = (C, B) => {
4227
- var us, ps;
4227
+ var ps, ms;
4228
4228
  const we = ge[B];
4229
4229
  if (B.startsWith("__f:")) {
4230
- const ga = We[B], wn = ga ? vs(ga, (vr) => {
4231
- var ms, fs;
4232
- const xa = vr.includes(".") ? (fs = (ms = v[String(C.id)]) == null ? void 0 : ms[vr]) == null ? void 0 : fs.value : C[vr];
4230
+ const ga = We[B], wn = ga ? ks(ga, (vr) => {
4231
+ var fs, bs;
4232
+ const xa = vr.includes(".") ? (bs = (fs = v[String(C.id)]) == null ? void 0 : fs[vr]) == null ? void 0 : bs.value : C[vr];
4233
4233
  return typeof xa == "string" && /^-?\d+(\.\d+)?$/.test(xa.trim()) ? Number(xa) : xa;
4234
4234
  }) : null;
4235
4235
  return wn == null ? "" : Math.round(wn * 100) / 100;
4236
4236
  }
4237
4237
  if (B.includes(".") || B in He) {
4238
- const ga = B.includes(".") ? B : He[B], wn = ((ps = (us = v[String(C.id)]) == null ? void 0 : us[ga]) == null ? void 0 : ps.value) ?? "";
4239
- return we && wn ? ks(wn, we) : wn;
4238
+ const ga = B.includes(".") ? B : He[B], wn = ((ms = (ps = v[String(C.id)]) == null ? void 0 : ps[ga]) == null ? void 0 : ms.value) ?? "";
4239
+ return we && wn ? ys(wn, we) : wn;
4240
4240
  }
4241
- const Ee = C[B], cs = Le.get(B);
4242
- return cs && Ee != null && Ee !== "" ? Nc(cs, v[String(C.id)]) || Ee : D.has(B) && Ee != null && Ee !== "" ? j.get(String(Ee).toUpperCase()) ?? Ee : Ee != null && Ee !== "" && ((we == null ? void 0 : we.type) === "number" || ir(B)) ? Di(Ee) : Ee != null && Ee !== "" && ((we == null ? void 0 : we.type) === "datetime" || Mo(B)) ? Pi(Ee) : B === "id" ? Nr(A, C) ?? Ee : we && Ee != null ? Vn(String(Ee), we) : Ee;
4241
+ const Ee = C[B], us = Le.get(B);
4242
+ return us && Ee != null && Ee !== "" ? Nc(us, v[String(C.id)]) || Ee : D.has(B) && Ee != null && Ee !== "" ? j.get(String(Ee).toUpperCase()) ?? Ee : Ee != null && Ee !== "" && ((we == null ? void 0 : we.type) === "number" || ir(B)) ? Di(Ee) : Ee != null && Ee !== "" && ((we == null ? void 0 : we.type) === "datetime" || Mo(B)) ? Pi(Ee) : B === "id" ? Nr(A, C) ?? Ee : we && Ee != null ? Vn(String(Ee), we) : Ee;
4243
4243
  }, p = Yt.filter((C) => C.kind !== "actions"), ft = new Set(
4244
4244
  p.filter((C) => C.kind !== "data" && C.kind !== "formula").map((C) => C.kind)
4245
4245
  ), tt = r.map((C) => String(C.id)), At = await Mi(tt, ft, {
@@ -4300,7 +4300,7 @@ function _0({
4300
4300
  } catch (r) {
4301
4301
  ye.error(Xt(r, "Export failed"));
4302
4302
  } finally {
4303
- Or(!1);
4303
+ Ar(!1);
4304
4304
  }
4305
4305
  }
4306
4306
  }, Ho = (e) => {
@@ -4349,11 +4349,11 @@ function _0({
4349
4349
  collection: n,
4350
4350
  item: e === "new" ? null : e
4351
4351
  }), S ? S(e) : Q({ collection: n, itemId: String(e) });
4352
- }, jl = (e) => {
4352
+ }, Bl = (e) => {
4353
4353
  const t = ot(Ge, n, e), r = (l) => {
4354
4354
  $e(Wd(J, l, De.default_sort ?? "")), L(1);
4355
4355
  };
4356
- if (t != null && t.one_collection && !qt(t.one_collection)) {
4356
+ if (t != null && t.one_collection && !Tt(t.one_collection)) {
4357
4357
  const l = t.one_collection;
4358
4358
  w.fetchQuery({
4359
4359
  queryKey: ["collection-meta", l],
@@ -4371,8 +4371,8 @@ function _0({
4371
4371
  r(e);
4372
4372
  }, ur = Se.length > 0 && Se.every((e) => nn.includes(e.id)), Jo = () => an(
4373
4373
  ur ? nn.filter((e) => !Se.some((t) => t.id === e)) : [.../* @__PURE__ */ new Set([...nn, ...Se.map((e) => e.id)])]
4374
- ), Go = (e) => an((t) => t.includes(e) ? t.filter((r) => r !== e) : [...t, e]), ha = 2e3, [Bl, Ul] = _(!1), Xo = async () => {
4375
- Ul(!0);
4374
+ ), Go = (e) => an((t) => t.includes(e) ? t.filter((r) => r !== e) : [...t, e]), ha = 2e3, [Ul, zl] = _(!1), Xo = async () => {
4375
+ zl(!0);
4376
4376
  try {
4377
4377
  const e = await u.request(
4378
4378
  X(`/items/${n}`, {
@@ -4384,9 +4384,9 @@ function _0({
4384
4384
  );
4385
4385
  an(e.data.map((t) => t.id));
4386
4386
  } finally {
4387
- Ul(!1);
4387
+ zl(!1);
4388
4388
  }
4389
- }, Zo = Me === 0 && !sn ? 0 : (M - 1) * Je + 1, ei = sn ? (M - 1) * Je + Se.length : Math.min(M * Je, Me), Qn = !!(Re != null && Re.instances), zl = (Dt ? 1 : 0) + (Qn ? 2 : 0) + (Qr ? 1 : 0), pr = [
4389
+ }, Zo = Me === 0 && !sn ? 0 : (M - 1) * Je + 1, ei = sn ? (M - 1) * Je + Se.length : Math.min(M * Je, Me), Qn = !!(Re != null && Re.instances), Ql = (Dt ? 1 : 0) + (Qn ? 2 : 0) + (Wr ? 1 : 0), pr = [
4390
4390
  ...xe.map(
4391
4391
  (e) => e.startsWith("__f:") ? { key: e, kind: "formula" } : { key: e, kind: "data" }
4392
4392
  ),
@@ -4400,20 +4400,20 @@ function _0({
4400
4400
  ] : [],
4401
4401
  ...nr ? [{ key: "__addendums__", kind: "addendums" }] : [],
4402
4402
  ...Fe ? [{ key: "__fulfilment__", kind: "fulfilment" }] : [],
4403
- ...Sl ? [{ key: "__integrations__", kind: "integrations" }] : [],
4404
- ...Nl ? [{ key: "__tasks__", kind: "tasks" }] : [],
4405
- ...Qr ? [{ key: "__actions__", kind: "actions" }] : []
4403
+ ...Cl ? [{ key: "__integrations__", kind: "integrations" }] : [],
4404
+ ...Sl ? [{ key: "__tasks__", kind: "tasks" }] : [],
4405
+ ...Wr ? [{ key: "__actions__", kind: "actions" }] : []
4406
4406
  ], Yt = [
4407
- ...pr.filter((e) => Ct(e.key) === "left"),
4408
- ...pr.filter((e) => !Ct(e.key)),
4409
- ...pr.filter((e) => Ct(e.key) === "right")
4407
+ ...pr.filter((e) => $t(e.key) === "left"),
4408
+ ...pr.filter((e) => !$t(e.key)),
4409
+ ...pr.filter((e) => $t(e.key) === "right")
4410
4410
  ], ti = Yt.map((e) => {
4411
4411
  if (e.kind === "data") {
4412
4412
  const t = kt.get(e.key.split(".")[0]);
4413
4413
  return { key: e.key, shape: zd(t == null ? void 0 : t.type, t == null ? void 0 : t.interface) };
4414
4414
  }
4415
4415
  return { key: e.key, shape: Pu[e.kind] ?? "short" };
4416
- }), Ql = [
4416
+ }), Wl = [
4417
4417
  ...Qn ? [{ key: "__state__", label: "State" }] : [],
4418
4418
  ...xe.filter((e) => Bt(e) || !ot(Ge, n, e)).map((e) => ({ key: e, label: Ze(e) }))
4419
4419
  ], ni = (e) => {
@@ -4427,7 +4427,7 @@ function _0({
4427
4427
  if (Bt(ue)) return _t(t, ue) || "(empty)";
4428
4428
  const r = e[ue];
4429
4429
  return r == null || r === "" ? "(empty)" : typeof r == "boolean" ? r ? "Yes" : "No" : xn(String(r), ue) || String(r);
4430
- }, Wl = (() => {
4430
+ }, Vl = (() => {
4431
4431
  if (!ue) return Se.map((l) => ({ kind: "row", row: l }));
4432
4432
  const e = /* @__PURE__ */ new Map();
4433
4433
  for (const l of Se) {
@@ -4440,7 +4440,7 @@ function _0({
4440
4440
  if (r.push({ kind: "header", gkey: l, label: l, count: s.length }), !Fn.has(l)) for (const o of s) r.push({ kind: "row", row: o });
4441
4441
  }
4442
4442
  return r;
4443
- })(), [ai, ri] = _(null), li = Tc(Wl, ai), mr = Yt.filter((e) => Ct(e.key) === "left").map((e) => e.key), Vl = Yt.filter((e) => Ct(e.key) === "right").map((e) => e.key), fr = fe(/* @__PURE__ */ new Map()), [Wn, si] = _({});
4443
+ })(), [ai, ri] = _(null), li = Tc(Vl, ai), mr = Yt.filter((e) => $t(e.key) === "left").map((e) => e.key), Hl = Yt.filter((e) => $t(e.key) === "right").map((e) => e.key), fr = fe(/* @__PURE__ */ new Map()), [Wn, si] = _({});
4444
4444
  Ni(() => {
4445
4445
  const e = {};
4446
4446
  for (const [r, l] of fr.current)
@@ -4452,8 +4452,8 @@ function _0({
4452
4452
  return;
4453
4453
  }
4454
4454
  });
4455
- const oi = 52, Hl = (e) => {
4456
- if (Ct(e) === "left") {
4455
+ const oi = 52, Yl = (e) => {
4456
+ if ($t(e) === "left") {
4457
4457
  let l = Dt ? Wn.__checkbox__ ?? oi : 0;
4458
4458
  for (const s of mr) {
4459
4459
  if (s === e) break;
@@ -4462,23 +4462,23 @@ function _0({
4462
4462
  return Math.floor(l);
4463
4463
  }
4464
4464
  let r = 0;
4465
- for (const l of [...Vl].reverse()) {
4465
+ for (const l of [...Hl].reverse()) {
4466
4466
  if (l === e) break;
4467
4467
  r += Wn[l] ?? 0;
4468
4468
  }
4469
4469
  return Math.floor(r);
4470
4470
  }, ct = (e, t, r) => {
4471
- const l = Ct(e);
4471
+ const l = $t(e);
4472
4472
  if (!l) return "";
4473
- const s = l === "left" && mr[mr.length - 1] === e ? "border-r border-slate-200 dark:border-slate-700" : l === "right" && Vl[0] === e ? "border-l border-slate-200 dark:border-slate-700" : "";
4473
+ const s = l === "left" && mr[mr.length - 1] === e ? "border-r border-slate-200 dark:border-slate-700" : l === "right" && Hl[0] === e ? "border-l border-slate-200 dark:border-slate-700" : "";
4474
4474
  return `sticky ${t} ${r} ${s}`;
4475
4475
  }, Oe = (e) => {
4476
- const t = Ct(e);
4476
+ const t = $t(e);
4477
4477
  if (t)
4478
- return t === "left" ? { left: Hl(e) } : { right: Hl(e) };
4478
+ return t === "left" ? { left: Yl(e) } : { right: Yl(e) };
4479
4479
  }, br = (e) => (t) => {
4480
4480
  t ? fr.current.set(e, t) : fr.current.delete(e);
4481
- }, Yl = {
4481
+ }, Jl = {
4482
4482
  left: "Pinned left — click to pin right",
4483
4483
  right: "Pinned right — click to unpin",
4484
4484
  none: "Pin column left"
@@ -4507,7 +4507,7 @@ function _0({
4507
4507
  "span",
4508
4508
  {
4509
4509
  onPointerDown: (t) => {
4510
- t.preventDefault(), t.stopPropagation(), hr.current = { key: e, startX: t.clientX, startW: Tt[e] ?? 140 }, document.body.style.cursor = "col-resize";
4510
+ t.preventDefault(), t.stopPropagation(), hr.current = { key: e, startX: t.clientX, startW: Lt[e] ?? 140 }, document.body.style.cursor = "col-resize";
4511
4511
  },
4512
4512
  onDoubleClick: (t) => {
4513
4513
  t.stopPropagation(), ii(e);
@@ -4516,8 +4516,8 @@ function _0({
4516
4516
  title: "Drag to resize · double-click to fit content",
4517
4517
  className: "absolute right-0 top-0 h-full w-1.5 cursor-col-resize opacity-0 transition-opacity hover:bg-nvr-cyan/40 hover:opacity-100 group-hover/hcell:opacity-60"
4518
4518
  }
4519
- ), Jl = (e) => Tt[e] ? { width: Tt[e], minWidth: Tt[e], maxWidth: Tt[e] } : void 0, Gl = (e) => {
4520
- const t = Ct(e);
4519
+ ), Gl = (e) => Lt[e] ? { width: Lt[e], minWidth: Lt[e], maxWidth: Lt[e] } : void 0, Xl = (e) => {
4520
+ const t = $t(e);
4521
4521
  return /* @__PURE__ */ a(
4522
4522
  "button",
4523
4523
  {
@@ -4525,8 +4525,8 @@ function _0({
4525
4525
  onClick: (r) => {
4526
4526
  r.stopPropagation(), uo(e);
4527
4527
  },
4528
- title: Yl[t ?? "none"],
4529
- "aria-label": Yl[t ?? "none"],
4528
+ title: Jl[t ?? "none"],
4529
+ "aria-label": Jl[t ?? "none"],
4530
4530
  className: `ml-1 inline-flex align-middle transition-opacity ${t ? "text-[#00a5cc] opacity-100" : "text-slate-300 opacity-0 group-hover/hcell:opacity-100 dark:text-slate-600"}`,
4531
4531
  children: /* @__PURE__ */ a(
4532
4532
  wi,
@@ -4545,10 +4545,10 @@ function _0({
4545
4545
  enabled: !!n && Ye && !le && ci,
4546
4546
  staleTime: 5 * 6e4,
4547
4547
  retry: !1
4548
- }), Xl = fe(!1), [, pi] = _(0);
4548
+ }), Zl = fe(!1), [, pi] = _(0);
4549
4549
  me(
4550
4550
  () => w.getQueryCache().subscribe((e) => {
4551
- if (!Xl.current || e.type !== "updated" || e.action.type !== "success") return;
4551
+ if (!Zl.current || e.type !== "updated" || e.action.type !== "success") return;
4552
4552
  const t = String(e.query.queryKey[0] ?? "");
4553
4553
  (t === "cbv-quick-options" || t === "cbv-filter-options" || t === "cbv-filter-selected-labels") && pi((r) => r + 1);
4554
4554
  }),
@@ -4596,7 +4596,7 @@ function _0({
4596
4596
  if (!v) continue;
4597
4597
  const U = x === "__state__" ? "State" : x === "__fulfilment__" ? (Fe == null ? void 0 : Fe.label) ?? "Shipped" : x === "__integrations__" ? "Integrations" : x === "__aging__" ? "Time in state" : Ze(x), j = ge[x], Le = (j == null ? void 0 : j.type) === "number" && j.prefix === "$";
4598
4598
  if (v.kind === "in" && v.value.length) {
4599
- const D = Rr(Ge, n, x), z = (D == null ? void 0 : D.one_collection) ?? null, Y = il[x], p = z ?? ((Y == null ? void 0 : Y.kind) === "m2m" ? Y.target : null);
4599
+ const D = Er(Ge, n, x), z = (D == null ? void 0 : D.one_collection) ?? null, Y = dl[x], p = z ?? ((Y == null ? void 0 : Y.kind) === "m2m" ? Y.target : null);
4600
4600
  r.push(
4601
4601
  p ? t(
4602
4602
  U,
@@ -4616,10 +4616,10 @@ function _0({
4616
4616
  )
4617
4617
  });
4618
4618
  else if (v.kind === "fulfilment" && Fe) {
4619
- const D = (s = $s.find((z) => z.value === v.value)) == null ? void 0 : s.label;
4619
+ const D = (s = qs.find((z) => z.value === v.value)) == null ? void 0 : s.label;
4620
4620
  D && r.push({ kind: "phrase", text: D.toLowerCase() });
4621
4621
  } else if (v.kind === "integrations") {
4622
- const D = (o = qs.find((z) => z.value === v.value)) == null ? void 0 : o.label;
4622
+ const D = (o = Ts.find((z) => z.value === v.value)) == null ? void 0 : o.label;
4623
4623
  D && r.push({ kind: "is", field: U, values: [D.toLowerCase()] });
4624
4624
  } else if (v.kind === "tasks")
4625
4625
  r.push({
@@ -4652,7 +4652,7 @@ function _0({
4652
4652
  z && r.push(z);
4653
4653
  }
4654
4654
  }
4655
- for (const x of Lt) {
4655
+ for (const x of Ft) {
4656
4656
  const v = x.label;
4657
4657
  v && r.push({ kind: "phrase", text: v });
4658
4658
  }
@@ -4665,7 +4665,7 @@ function _0({
4665
4665
  }).filter((v) => !!v);
4666
4666
  x.length > 0 && r.push({ kind: "phrase", text: `flagged ${x.join(" or ")}` });
4667
4667
  }
4668
- return Xl.current = e, Ji({
4668
+ return Zl.current = e, Ji({
4669
4669
  noun: (A == null ? void 0 : A.display_name) || je(n),
4670
4670
  viewName: ((b = dt.find((x) => x.id === Vt)) == null ? void 0 : b.name) ?? null,
4671
4671
  search: Z,
@@ -4742,7 +4742,7 @@ function _0({
4742
4742
  ` }),
4743
4743
  /* @__PURE__ */ a(cu, {}),
4744
4744
  /* @__PURE__ */ a(bc, {}),
4745
- ce && js(
4745
+ ce && Bs(
4746
4746
  /* @__PURE__ */ c(
4747
4747
  "div",
4748
4748
  {
@@ -4783,7 +4783,7 @@ function _0({
4783
4783
  ]
4784
4784
  }
4785
4785
  ),
4786
- (ce.key === "__state__" || Ql.some((e) => e.key === ce.key)) && ue !== ce.key && /* @__PURE__ */ c(
4786
+ (ce.key === "__state__" || Wl.some((e) => e.key === ce.key)) && ue !== ce.key && /* @__PURE__ */ c(
4787
4787
  "button",
4788
4788
  {
4789
4789
  type: "button",
@@ -4858,11 +4858,11 @@ function _0({
4858
4858
  e.label
4859
4859
  )),
4860
4860
  /* @__PURE__ */ a(
4861
- Us,
4861
+ Lr,
4862
4862
  {
4863
4863
  confirmLabel: "Delete this record? It moves to Trash for 30 days.",
4864
4864
  onConfirm: () => {
4865
- Kl.mutate(ce.row.id), Wt(null);
4865
+ jl.mutate(ce.row.id), Wt(null);
4866
4866
  },
4867
4867
  className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20",
4868
4868
  armedClassName: "whitespace-normal bg-red-50 font-semibold dark:bg-red-900/20",
@@ -4963,7 +4963,7 @@ function _0({
4963
4963
  }
4964
4964
  ),
4965
4965
  /* @__PURE__ */ a(Gc, { listKey: `cbv:${n}`, getState: jo }),
4966
- Rt && De.copy_as !== !1 && /* @__PURE__ */ a(
4966
+ Ct && De.copy_as !== !1 && /* @__PURE__ */ a(
4967
4967
  hc,
4968
4968
  {
4969
4969
  collection: n,
@@ -4981,7 +4981,7 @@ function _0({
4981
4981
  qc,
4982
4982
  {
4983
4983
  parent: An.parent,
4984
- value: dl,
4984
+ value: cl,
4985
4985
  onChange: (e) => {
4986
4986
  bo(e), L(1);
4987
4987
  }
@@ -4995,12 +4995,12 @@ function _0({
4995
4995
  {
4996
4996
  type: "button",
4997
4997
  onClick: () => {
4998
- ul(!1), cl((t) => t === e.key ? null : e.key);
4998
+ pl(!1), ul((t) => t === e.key ? null : e.key);
4999
4999
  },
5000
- "aria-pressed": $t === e.key,
5000
+ "aria-pressed": qt === e.key,
5001
5001
  "data-cbv-view-toggle": e.key,
5002
- title: $t === e.key ? "Back to the table" : `Show as ${e.label.toLowerCase()}`,
5003
- className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${$t === e.key ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400"}`,
5002
+ title: qt === e.key ? "Back to the table" : `Show as ${e.label.toLowerCase()}`,
5003
+ className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${qt === e.key ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400"}`,
5004
5004
  children: [
5005
5005
  e.icon,
5006
5006
  e.label
@@ -5013,7 +5013,7 @@ function _0({
5013
5013
  {
5014
5014
  type: "button",
5015
5015
  onClick: () => {
5016
- cl(null), ul((e) => !e);
5016
+ ul(null), pl((e) => !e);
5017
5017
  },
5018
5018
  title: la ? "Back to the table" : "Show these records on a map",
5019
5019
  className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${la ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400"}`,
@@ -5077,7 +5077,7 @@ function _0({
5077
5077
  "button",
5078
5078
  {
5079
5079
  type: "button",
5080
- onClick: () => Mr((t) => t.filter((r) => r.id !== e.id)),
5080
+ onClick: () => Or((t) => t.filter((r) => r.id !== e.id)),
5081
5081
  "aria-label": "Remove exclusion",
5082
5082
  className: "rounded-full p-0.5 hover:bg-red-100 dark:hover:bg-red-500/20",
5083
5083
  children: /* @__PURE__ */ a(wr, { className: "h-3 w-3" })
@@ -5116,7 +5116,7 @@ function _0({
5116
5116
  onClick: () => mn((e) => !e),
5117
5117
  className: `flex h-8 items-center gap-1 rounded-md border px-2.5 text-[12px] font-medium ${ue ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400"}`,
5118
5118
  children: [
5119
- /* @__PURE__ */ a(bs, { className: "h-3.5 w-3.5" }),
5119
+ /* @__PURE__ */ a(hs, { className: "h-3.5 w-3.5" }),
5120
5120
  ue ? `Group: ${ue === "__state__" ? "State" : Ze(ue)}` : "Group"
5121
5121
  ]
5122
5122
  }
@@ -5131,7 +5131,7 @@ function _0({
5131
5131
  children: "No grouping"
5132
5132
  }
5133
5133
  ),
5134
- Ql.map((e) => /* @__PURE__ */ a(
5134
+ Wl.map((e) => /* @__PURE__ */ a(
5135
5135
  "button",
5136
5136
  {
5137
5137
  type: "button",
@@ -5166,10 +5166,10 @@ function _0({
5166
5166
  "aria-label": "Row density",
5167
5167
  title: en === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
5168
5168
  className: "flex h-8 w-8 items-center justify-center rounded-md border border-slate-200 text-slate-500 hover:bg-slate-100 hover:text-slate-700 dark:border-slate-700 dark:text-slate-400 dark:hover:bg-slate-800",
5169
- children: en === "compact" ? /* @__PURE__ */ a(bs, { className: "h-4 w-4" }) : /* @__PURE__ */ a(gi, { className: "h-4 w-4" })
5169
+ children: en === "compact" ? /* @__PURE__ */ a(hs, { className: "h-4 w-4" }) : /* @__PURE__ */ a(gi, { className: "h-4 w-4" })
5170
5170
  }
5171
5171
  ),
5172
- /* @__PURE__ */ c("div", { className: "relative", ref: Kr, children: [
5172
+ /* @__PURE__ */ c("div", { className: "relative", ref: jr, children: [
5173
5173
  /* @__PURE__ */ a(
5174
5174
  "button",
5175
5175
  {
@@ -5497,12 +5497,12 @@ function _0({
5497
5497
  ]
5498
5498
  }
5499
5499
  ),
5500
- Rt && /* @__PURE__ */ c(
5500
+ Ct && /* @__PURE__ */ c(
5501
5501
  "button",
5502
5502
  {
5503
5503
  type: "button",
5504
- onClick: () => Il.mutate(),
5505
- disabled: Il.isPending,
5504
+ onClick: () => Kl.mutate(),
5505
+ disabled: Kl.isPending,
5506
5506
  title: "Save the current columns/filters/sort as the collection default view",
5507
5507
  className: "inline-flex items-center gap-1 text-[11.5px] text-slate-500 hover:text-[#00a5cc] disabled:opacity-40 dark:text-slate-400",
5508
5508
  children: [
@@ -5515,7 +5515,7 @@ function _0({
5515
5515
  ] })
5516
5516
  ] })
5517
5517
  ] }),
5518
- /* @__PURE__ */ c("div", { className: "relative", ref: Ir, children: [
5518
+ /* @__PURE__ */ c("div", { className: "relative", ref: Kr, children: [
5519
5519
  /* @__PURE__ */ a(
5520
5520
  "button",
5521
5521
  {
@@ -5554,15 +5554,15 @@ function _0({
5554
5554
  `);
5555
5555
  (l = navigator.clipboard) == null || l.writeText(`${t}
5556
5556
  ${r}`).then(() => {
5557
- Ar(!0), setTimeout(() => Ar(!1), 2e3);
5557
+ Ir(!0), setTimeout(() => Ir(!1), 2e3);
5558
5558
  });
5559
5559
  },
5560
5560
  className: "block w-full rounded-md px-2.5 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
5561
5561
  children: Xs ? "Copied ✓" : "Copy table to clipboard"
5562
5562
  }
5563
5563
  ),
5564
- Dl.length > 0 && /* @__PURE__ */ a("p", { className: "border-t border-slate-100 px-2.5 pb-0.5 pt-1.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400 dark:border-border/60", children: "Presets (server, current filters apply)" }),
5565
- Dl.map((e) => {
5564
+ Pl.length > 0 && /* @__PURE__ */ a("p", { className: "border-t border-slate-100 px-2.5 pb-0.5 pt-1.5 text-[10px] font-semibold uppercase tracking-wide text-slate-400 dark:border-border/60", children: "Presets (server, current filters apply)" }),
5565
+ Pl.map((e) => {
5566
5566
  var t;
5567
5567
  return /* @__PURE__ */ c("div", { className: "flex items-center", children: [
5568
5568
  /* @__PURE__ */ c(
@@ -5599,9 +5599,9 @@ ${r}`).then(() => {
5599
5599
  "input",
5600
5600
  {
5601
5601
  value: ma,
5602
- onChange: (e) => Pl(e.target.value),
5602
+ onChange: (e) => Ml(e.target.value),
5603
5603
  onKeyDown: (e) => {
5604
- e.key === "Enter" && Ml();
5604
+ e.key === "Enter" && Ol();
5605
5605
  },
5606
5606
  placeholder: "Save columns as preset…",
5607
5607
  className: "h-6 min-w-0 flex-1 rounded border border-slate-200 bg-background px-1.5 text-[11.5px] dark:border-border"
@@ -5612,7 +5612,7 @@ ${r}`).then(() => {
5612
5612
  {
5613
5613
  type: "button",
5614
5614
  disabled: !ma.trim(),
5615
- onClick: () => void Ml(),
5615
+ onClick: () => void Ol(),
5616
5616
  className: "h-6 shrink-0 rounded bg-nvr-cyan px-2 text-[11px] font-semibold text-white disabled:opacity-40",
5617
5617
  children: "Save"
5618
5618
  }
@@ -5629,7 +5629,7 @@ ${r}`).then(() => {
5629
5629
  className: "flex h-8 items-center gap-1 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-semibold text-white hover:brightness-105",
5630
5630
  children: [
5631
5631
  "+ ",
5632
- Wr,
5632
+ Vr,
5633
5633
  /* @__PURE__ */ a(Yn, { className: "h-3.5 w-3.5" })
5634
5634
  ]
5635
5635
  }
@@ -5639,7 +5639,7 @@ ${r}`).then(() => {
5639
5639
  {
5640
5640
  key: "default",
5641
5641
  slug: null,
5642
- label: ((ns = ta.active) == null ? void 0 : ns.create_label) ?? ((as = ta.active) == null ? void 0 : as.name) ?? "Default layout",
5642
+ label: ((as = ta.active) == null ? void 0 : as.create_label) ?? ((rs = ta.active) == null ? void 0 : rs.name) ?? "Default layout",
5643
5643
  isDefault: !0,
5644
5644
  steps: Ia
5645
5645
  },
@@ -5660,7 +5660,7 @@ ${r}`).then(() => {
5660
5660
  {
5661
5661
  type: "button",
5662
5662
  onClick: () => {
5663
- Pn(!1), Vr(e.slug);
5663
+ Pn(!1), Hr(e.slug);
5664
5664
  },
5665
5665
  className: "flex min-w-0 flex-1 items-center px-2 py-1.5 text-left text-[12px] text-slate-700 dark:text-slate-200",
5666
5666
  children: [
@@ -5680,7 +5680,7 @@ ${r}`).then(() => {
5680
5680
  },
5681
5681
  className: "mr-1 flex h-6 shrink-0 items-center gap-1 rounded px-1.5 text-[11px] font-medium text-slate-400 hover:bg-nvr-cyan/10 hover:text-nvr-navy dark:hover:text-nvr-cyan",
5682
5682
  children: [
5683
- /* @__PURE__ */ a(hs, { className: "h-3 w-3" }),
5683
+ /* @__PURE__ */ a(gs, { className: "h-3 w-3" }),
5684
5684
  "Quick pick"
5685
5685
  ]
5686
5686
  }
@@ -5689,21 +5689,21 @@ ${r}`).then(() => {
5689
5689
  },
5690
5690
  e.key
5691
5691
  )),
5692
- ((rs = Mn.data) == null ? void 0 : rs.enabled) && /* @__PURE__ */ c(Qe, { children: [
5692
+ ((ls = Mn.data) == null ? void 0 : ls.enabled) && /* @__PURE__ */ c(Qe, { children: [
5693
5693
  /* @__PURE__ */ a("div", { className: "my-1 border-t border-slate-100 dark:border-border" }),
5694
5694
  /* @__PURE__ */ c(
5695
5695
  "button",
5696
5696
  {
5697
5697
  type: "button",
5698
5698
  "data-cbv-new-from-document": !0,
5699
- disabled: Yr,
5699
+ disabled: Jr,
5700
5700
  onClick: () => {
5701
- Pn(!1), Gr(null);
5701
+ Pn(!1), Xr(null);
5702
5702
  },
5703
5703
  className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-100 disabled:opacity-60 dark:text-slate-200 dark:hover:bg-muted",
5704
5704
  title: "Upload a SOW, quote or spreadsheet — the new record opens with what it says proposed",
5705
5705
  children: [
5706
- /* @__PURE__ */ a(gs, { className: "h-3.5 w-3.5 text-slate-400" }),
5706
+ /* @__PURE__ */ a(xs, { className: "h-3.5 w-3.5 text-slate-400" }),
5707
5707
  "New from document…"
5708
5708
  ]
5709
5709
  }
@@ -5715,15 +5715,15 @@ ${r}`).then(() => {
5715
5715
  "button",
5716
5716
  {
5717
5717
  type: "button",
5718
- ref: Xr,
5719
- onClick: () => Vr(null),
5718
+ ref: Zr,
5719
+ onClick: () => Hr(null),
5720
5720
  className: Gt(
5721
5721
  "h-8 bg-nvr-cyan px-3 text-[12.5px] font-semibold text-white hover:brightness-105",
5722
- Ia.length > 0 || (ls = Mn.data) != null && ls.enabled ? "rounded-l-md" : "rounded-md"
5722
+ Ia.length > 0 || (ss = Mn.data) != null && ss.enabled ? "rounded-l-md" : "rounded-md"
5723
5723
  ),
5724
5724
  children: [
5725
5725
  "+ ",
5726
- Wr
5726
+ Vr
5727
5727
  ]
5728
5728
  }
5729
5729
  ),
@@ -5737,31 +5737,31 @@ ${r}`).then(() => {
5737
5737
  onClick: () => na({ slug: null }),
5738
5738
  className: Gt(
5739
5739
  "flex h-8 items-center border-l border-white/30 bg-nvr-cyan px-2 text-white hover:brightness-105",
5740
- !((ss = Mn.data) != null && ss.enabled) && "rounded-r-md"
5740
+ !((os = Mn.data) != null && os.enabled) && "rounded-r-md"
5741
5741
  ),
5742
- children: /* @__PURE__ */ a(hs, { className: "h-3.5 w-3.5" })
5742
+ children: /* @__PURE__ */ a(gs, { className: "h-3.5 w-3.5" })
5743
5743
  }
5744
5744
  ),
5745
- ((os = Mn.data) == null ? void 0 : os.enabled) && /* @__PURE__ */ a(
5745
+ ((is = Mn.data) == null ? void 0 : is.enabled) && /* @__PURE__ */ a(
5746
5746
  "button",
5747
5747
  {
5748
5748
  type: "button",
5749
5749
  "data-cbv-new-from-document": !0,
5750
- disabled: Yr,
5750
+ disabled: Jr,
5751
5751
  title: "New from document — upload a SOW, quote or spreadsheet and review what it proposes",
5752
5752
  "aria-label": "New from document",
5753
- onClick: () => Gr(null),
5753
+ onClick: () => Xr(null),
5754
5754
  className: "flex h-8 items-center rounded-r-md border-l border-white/30 bg-nvr-cyan px-2 text-white hover:brightness-105 disabled:opacity-60",
5755
- children: /* @__PURE__ */ a(gs, { className: "h-3.5 w-3.5" })
5755
+ children: /* @__PURE__ */ a(xs, { className: "h-3.5 w-3.5" })
5756
5756
  }
5757
5757
  )
5758
5758
  ] })),
5759
5759
  /* @__PURE__ */ a(
5760
5760
  "input",
5761
5761
  {
5762
- ref: Hr,
5762
+ ref: Yr,
5763
5763
  type: "file",
5764
- accept: (((is = Mn.data) == null ? void 0 : is.accept) ?? []).join(","),
5764
+ accept: (((ds = Mn.data) == null ? void 0 : ds.accept) ?? []).join(","),
5765
5765
  multiple: !0,
5766
5766
  className: "hidden",
5767
5767
  onChange: ro,
@@ -5779,15 +5779,15 @@ ${r}`).then(() => {
5779
5779
  e || na(null);
5780
5780
  },
5781
5781
  noun: (A == null ? void 0 : A.singular) ?? "record",
5782
- anchorEl: Ka.current ?? Xr.current,
5782
+ anchorEl: Ka.current ?? Zr.current,
5783
5783
  onDone: (e) => {
5784
5784
  na(null), Q({ collection: n, itemId: "new", layoutSlug: Aa.slug, prefill: e });
5785
5785
  }
5786
5786
  }
5787
5787
  ),
5788
- Lt.length > 0 && /* @__PURE__ */ c("div", { className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-nvr-cyan/[0.03] px-4 py-1.5 dark:border-slate-800", children: [
5788
+ Ft.length > 0 && /* @__PURE__ */ c("div", { className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-nvr-cyan/[0.03] px-4 py-1.5 dark:border-slate-800", children: [
5789
5789
  /* @__PURE__ */ a("span", { className: "text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Showing:" }),
5790
- Lt.map((e, t) => /* @__PURE__ */ a(
5790
+ Ft.map((e, t) => /* @__PURE__ */ a(
5791
5791
  "span",
5792
5792
  {
5793
5793
  className: "rounded border border-nvr-cyan/40 bg-nvr-cyan/[0.08] px-1.5 py-px text-[11px] text-slate-800 dark:text-slate-100",
@@ -5810,7 +5810,7 @@ ${r}`).then(() => {
5810
5810
  Nu,
5811
5811
  {
5812
5812
  def: e,
5813
- allowedIds: Zr(e),
5813
+ allowedIds: el(e),
5814
5814
  scopeDefault: qn.has(e.key),
5815
5815
  narrowBy: Pt.filter((t) => t.key !== e.key && t.collection).map((t) => ({
5816
5816
  collection: t.collection,
@@ -5859,7 +5859,7 @@ ${r}`).then(() => {
5859
5859
  "button",
5860
5860
  {
5861
5861
  type: "button",
5862
- onClick: El,
5862
+ onClick: Dl,
5863
5863
  className: `inline-flex h-6 items-center rounded-full border px-2.5 text-[12px] transition-colors ${Vt == null ? "border-nvr-cyan/40 bg-nvr-cyan/10 text-slate-900 dark:text-white" : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300"}`,
5864
5864
  children: "Default"
5865
5865
  }
@@ -5922,7 +5922,7 @@ ${r}`).then(() => {
5922
5922
  children: ba(e.id) ? /* @__PURE__ */ a(xi, { className: "h-3 w-3", fill: "currentColor" }) : /* @__PURE__ */ a(vi, { className: "h-3 w-3" })
5923
5923
  }
5924
5924
  ),
5925
- kl(e) && /* @__PURE__ */ a(
5925
+ yl(e) && /* @__PURE__ */ a(
5926
5926
  "button",
5927
5927
  {
5928
5928
  type: "button",
@@ -5942,7 +5942,7 @@ ${r}`).then(() => {
5942
5942
  ) : "↺"
5943
5943
  }
5944
5944
  ),
5945
- Rt && /* @__PURE__ */ a(
5945
+ Ct && /* @__PURE__ */ a(
5946
5946
  Dc,
5947
5947
  {
5948
5948
  name: e.name,
@@ -5952,14 +5952,15 @@ ${r}`).then(() => {
5952
5952
  onRoleDefault: (t) => Uo.mutate({ id: e.id, role: t })
5953
5953
  }
5954
5954
  ),
5955
- kl(e) && /* @__PURE__ */ a(
5956
- "button",
5955
+ yl(e) && (Ct || !(e.is_default || e.default_for_role)) && /* @__PURE__ */ a(
5956
+ Lr,
5957
5957
  {
5958
- type: "button",
5959
- onClick: () => zo.mutate(e.id),
5960
- title: "Delete view",
5961
- "aria-label": `Delete ${e.name}`,
5958
+ title: `Delete view ${e.name}`,
5959
+ confirmLabel: "Delete?",
5960
+ confirmTitle: e.is_default || e.default_for_role ? `Delete "${e.name}"? Everyone who uses it as their default loses it` : `Delete the view "${e.name}"?`,
5961
+ onConfirm: () => zo.mutate(e.id),
5962
5962
  className: "hover:text-red-500",
5963
+ armedClassName: "rounded bg-red-600 px-1.5 text-[11px] font-semibold text-white dark:text-white",
5963
5964
  children: "✕"
5964
5965
  }
5965
5966
  )
@@ -6023,15 +6024,15 @@ ${r}`).then(() => {
6023
6024
  "button",
6024
6025
  {
6025
6026
  type: "button",
6026
- disabled: pl,
6027
+ disabled: ml,
6027
6028
  onClick: () => void u.request(he("/access-requests", { collection: n })).then(() => ho(!0)).catch(() => {
6028
6029
  }),
6029
6030
  className: "h-7 shrink-0 rounded-md border border-red-300 px-2.5 text-[12px] font-medium hover:bg-red-100 disabled:opacity-60 dark:border-red-500/40 dark:hover:bg-red-900/20",
6030
6031
  "data-request-access": !0,
6031
- children: pl ? "Requested — an admin was notified" : "Request access"
6032
+ children: ml ? "Requested — an admin was notified" : "Request access"
6032
6033
  }
6033
6034
  ),
6034
- Cs(et).map((e) => /* @__PURE__ */ c(
6035
+ $s(et).map((e) => /* @__PURE__ */ c(
6035
6036
  "button",
6036
6037
  {
6037
6038
  type: "button",
@@ -6049,7 +6050,7 @@ ${r}`).then(() => {
6049
6050
  },
6050
6051
  e
6051
6052
  )),
6052
- (et == null ? void 0 : et.status) !== 403 && Cs(et).length === 0 && /* @__PURE__ */ a(
6053
+ (et == null ? void 0 : et.status) !== 403 && $s(et).length === 0 && /* @__PURE__ */ a(
6053
6054
  "button",
6054
6055
  {
6055
6056
  type: "button",
@@ -6060,7 +6061,7 @@ ${r}`).then(() => {
6060
6061
  }
6061
6062
  )
6062
6063
  ] }),
6063
- $t === "tree" && In ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900", children: /* @__PURE__ */ a(
6064
+ qt === "tree" && In ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900", children: /* @__PURE__ */ a(
6064
6065
  xc,
6065
6066
  {
6066
6067
  collection: n,
@@ -6072,7 +6073,7 @@ ${r}`).then(() => {
6072
6073
  prefill: { [In.parent_field]: e }
6073
6074
  }) : void 0
6074
6075
  }
6075
- ) }) }) : $t && (K != null && K.some((e) => e.key === $t)) ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", "data-cbv-extra-view": $t, children: (ds = K.find((e) => e.key === $t)) == null ? void 0 : ds.render() }) : null,
6076
+ ) }) }) : qt && (K != null && K.some((e) => e.key === qt)) ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", "data-cbv-extra-view": qt, children: (cs = K.find((e) => e.key === qt)) == null ? void 0 : cs.render() }) : null,
6076
6077
  la && hn ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ a(
6077
6078
  eu,
6078
6079
  {
@@ -6088,7 +6089,7 @@ ${r}`).then(() => {
6088
6089
  /* @__PURE__ */ c(
6089
6090
  "div",
6090
6091
  {
6091
- className: la && hn || $t === "tree" && In || $t && (K != null && K.some((e) => e.key === $t)) ? "hidden" : "flex min-h-0 flex-1 flex-col p-4 pt-3",
6092
+ className: la && hn || qt === "tree" && In || qt && (K != null && K.some((e) => e.key === qt)) ? "hidden" : "flex min-h-0 flex-1 flex-col p-4 pt-3",
6092
6093
  children: [
6093
6094
  xr && /* @__PURE__ */ a(
6094
6095
  "p",
@@ -6109,13 +6110,13 @@ ${r}`).then(() => {
6109
6110
  yt && !sa && /* @__PURE__ */ a("div", { className: "cbv-progress pointer-events-none absolute inset-x-0 top-0 z-[6] h-[3px] overflow-hidden" }),
6110
6111
  yt && !sa && Qa && /* @__PURE__ */ a(Qe, { children: /* @__PURE__ */ a("div", { className: "cbv-overlay nvr-fade-in pointer-events-none absolute inset-0 z-[5] flex items-start justify-center bg-white/40 pt-24 dark:bg-slate-950/35", children: /* @__PURE__ */ c("span", { className: "nvr-pop-in flex items-center gap-2 rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[12px] font-medium text-slate-600 shadow-lg dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300", children: [
6111
6112
  /* @__PURE__ */ a(kr, { "aria-hidden": !0, className: "h-3.5 w-3.5 animate-spin text-[#00a5cc]" }),
6112
- vl != null ? `${Ja.text ?? "Still working"} — ${vl}s` : "Loading…"
6113
+ kl != null ? `${Ja.text ?? "Still working"} — ${kl}s` : "Loading…"
6113
6114
  ] }) }) }),
6114
6115
  sa && Ja.slow && /* @__PURE__ */ a("div", { className: "pointer-events-none absolute inset-x-0 top-12 z-[6] flex justify-center px-4", children: /* @__PURE__ */ a(du, { reason: Ja, variant: "pill" }) }),
6115
6116
  /* @__PURE__ */ a(
6116
6117
  "div",
6117
6118
  {
6118
- ref: jr,
6119
+ ref: Br,
6119
6120
  "data-cbv-scroll": !0,
6120
6121
  className: "min-h-0 flex-1 overflow-y-auto overflow-x-hidden",
6121
6122
  children: xe.length === 0 ? /* @__PURE__ */ c("div", { className: "p-0", children: [
@@ -6150,7 +6151,7 @@ ${r}`).then(() => {
6150
6151
  ref: br("__checkbox__"),
6151
6152
  className: "sticky left-0 top-0 z-[4] h-8 w-11 bg-slate-50 py-0 pl-1.5 pr-3 dark:bg-slate-800",
6152
6153
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-1", children: [
6153
- /* @__PURE__ */ a(Rs, { change: null }),
6154
+ /* @__PURE__ */ a(Es, { change: null }),
6154
6155
  vt && /* @__PURE__ */ a(
6155
6156
  "input",
6156
6157
  {
@@ -6164,7 +6165,7 @@ ${r}`).then(() => {
6164
6165
  }
6165
6166
  ),
6166
6167
  Yt.map((e) => {
6167
- const t = e.key, r = !!Ct(t), l = `group/hcell sticky top-0 h-8 select-none whitespace-nowrap bg-slate-50 px-3 py-0 text-[10px] font-bold uppercase tracking-wider text-slate-500 dark:bg-slate-800 dark:text-slate-400 ${r ? "z-[4]" : "z-[2]"}`, s = ct(t, "", "");
6168
+ const t = e.key, r = !!$t(t), l = `group/hcell sticky top-0 h-8 select-none whitespace-nowrap bg-slate-50 px-3 py-0 text-[10px] font-bold uppercase tracking-wider text-slate-500 dark:bg-slate-800 dark:text-slate-400 ${r ? "z-[4]" : "z-[2]"}`, s = ct(t, "", "");
6168
6169
  if (e.kind !== "data") {
6169
6170
  const D = e.kind === "state" ? "State" : e.kind === "entered" ? "Last State Change" : e.kind === "aging" ? "Aging" : e.kind === "owners" ? "Owners" : e.kind === "addendums" ? "Addendums" : e.kind === "fulfilment" ? Fe != null && Fe.label ? `${Fe.label} shipped` : "Shipped" : e.kind === "integrations" ? "Integrations" : e.kind === "tasks" ? "Tasks" : e.kind === "formula" ? Ze(t) : "";
6170
6171
  return /* @__PURE__ */ c(
@@ -6175,7 +6176,7 @@ ${r}`).then(() => {
6175
6176
  className: `${l} text-left ${e.kind === "actions" ? "w-20 px-2" : ""} ${s}`,
6176
6177
  children: [
6177
6178
  D,
6178
- Gl(t)
6179
+ Xl(t)
6179
6180
  ]
6180
6181
  },
6181
6182
  t
@@ -6186,14 +6187,14 @@ ${r}`).then(() => {
6186
6187
  "th",
6187
6188
  {
6188
6189
  ref: r ? br(t) : void 0,
6189
- style: { ...Jl(t), ...Oe(t) },
6190
+ style: { ...Gl(t), ...Oe(t) },
6190
6191
  onClick: () => {
6191
- x || jl(t);
6192
+ x || Bl(t);
6192
6193
  },
6193
6194
  "aria-sort": x ? void 0 : v ? U ? "descending" : "ascending" : "none",
6194
6195
  tabIndex: x ? void 0 : 0,
6195
6196
  onKeyDown: (D) => {
6196
- x || D.target !== D.currentTarget || (D.key === "Enter" || D.key === " ") && (D.preventDefault(), jl(t));
6197
+ x || D.target !== D.currentTarget || (D.key === "Enter" || D.key === " ") && (D.preventDefault(), Bl(t));
6197
6198
  },
6198
6199
  className: `${l} relative ${ir(t) ? "text-right" : "text-left"} ${x ? "" : "cursor-pointer hover:text-slate-600 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan"} ${s}`,
6199
6200
  children: [
@@ -6215,7 +6216,7 @@ ${r}`).then(() => {
6215
6216
  children: v ? U ? "▼" : "▲" : "⇅"
6216
6217
  }
6217
6218
  ),
6218
- Gl(t),
6219
+ Xl(t),
6219
6220
  di(t)
6220
6221
  ]
6221
6222
  },
@@ -6227,7 +6228,7 @@ ${r}`).then(() => {
6227
6228
  Dt && /* @__PURE__ */ a("th", { className: "sticky left-0 top-8 z-[4] w-11 bg-slate-50 py-1 pl-1.5 pr-3 dark:bg-slate-800" }),
6228
6229
  Yt.map((e) => {
6229
6230
  var s;
6230
- const t = e.key, l = `sticky top-8 bg-slate-50 px-2 py-1 text-left font-normal dark:bg-slate-800 ${!!Ct(t) ? "z-[4]" : "z-[2]"} ${ct(t, "", "")}`;
6231
+ const t = e.key, l = `sticky top-8 bg-slate-50 px-2 py-1 text-left font-normal dark:bg-slate-800 ${!!$t(t) ? "z-[4]" : "z-[2]"} ${ct(t, "", "")}`;
6231
6232
  if (e.kind === "state")
6232
6233
  return /* @__PURE__ */ a("th", { style: Oe(t), className: l, children: /* @__PURE__ */ a(
6233
6234
  Fa,
@@ -6254,7 +6255,7 @@ ${r}`).then(() => {
6254
6255
  value: (o == null ? void 0 : o.kind) === "fulfilment" ? o.value : "",
6255
6256
  options: [
6256
6257
  { value: "", label: "All" },
6257
- ...$s.filter(
6258
+ ...qs.filter(
6258
6259
  (b) => b.value !== "complete" || !!(Fe != null && Fe.remaining_field)
6259
6260
  )
6260
6261
  ],
@@ -6315,7 +6316,7 @@ ${r}`).then(() => {
6315
6316
  value: b,
6316
6317
  options: [
6317
6318
  { value: "", label: "All" },
6318
- ...qs
6319
+ ...Ts
6319
6320
  ],
6320
6321
  onChange: (x) => ze(
6321
6322
  "__integrations__",
@@ -6381,14 +6382,14 @@ ${r}`).then(() => {
6381
6382
  rowClassName: "h-8",
6382
6383
  cellClassName: "px-3 py-1.5",
6383
6384
  leadingCells: Dt ? 1 : 0,
6384
- cellStyle: (e) => ({ ...Jl(e), ...Oe(e) }),
6385
+ cellStyle: (e) => ({ ...Gl(e), ...Oe(e) }),
6385
6386
  barClassName: "cbv-shimmer"
6386
6387
  }
6387
6388
  )
6388
6389
  ) : Se.length === 0 ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
6389
6390
  "td",
6390
6391
  {
6391
- colSpan: xe.length + zl,
6392
+ colSpan: xe.length + Ql,
6392
6393
  className: "nvr-fade-in py-16",
6393
6394
  children: (() => {
6394
6395
  const e = Be.length === 0 && Object.keys(Ve).length === 0 && !Object.values(gt).some((r) => r.length > 0) && !Z, t = A == null ? void 0 : A.empty_state;
@@ -6411,7 +6412,7 @@ ${r}`).then(() => {
6411
6412
  }
6412
6413
  return et != null ? null : /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-2 text-center", children: [
6413
6414
  /* @__PURE__ */ a("span", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-slate-100 dark:bg-slate-800", children: /* @__PURE__ */ a(
6414
- Ks,
6415
+ js,
6415
6416
  {
6416
6417
  "aria-hidden": !0,
6417
6418
  className: "h-4.5 w-4.5 h-5 w-5 text-slate-400"
@@ -6459,7 +6460,7 @@ ${r}`).then(() => {
6459
6460
  ] });
6460
6461
  })()
6461
6462
  }
6462
- ) }) : Wl.map((e, t) => {
6463
+ ) }) : Vl.map((e, t) => {
6463
6464
  var z;
6464
6465
  const r = { animationDelay: `${Math.min(t, 14) * 16}ms` };
6465
6466
  if (e.kind === "header")
@@ -6476,7 +6477,7 @@ ${r}`).then(() => {
6476
6477
  "td",
6477
6478
  {
6478
6479
  className: "px-3 py-1.5",
6479
- colSpan: xe.length + zl,
6480
+ colSpan: xe.length + Ql,
6480
6481
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-slate-200", children: [
6481
6482
  /* @__PURE__ */ a(
6482
6483
  Yn,
@@ -6517,13 +6518,13 @@ ${r}`).then(() => {
6517
6518
  isNew: Ot.isNew(String(s)),
6518
6519
  dataAttr: "data-cbv-live-mark"
6519
6520
  }
6520
- ) : yl[_s(n, String(s))] ? /* @__PURE__ */ a(
6521
+ ) : wl[Ns(n, String(s))] ? /* @__PURE__ */ a(
6521
6522
  ou,
6522
6523
  {
6523
- viewers: yl[_s(n, String(s))],
6524
+ viewers: wl[Ns(n, String(s))],
6524
6525
  dataAttr: "data-cbv-presence"
6525
6526
  }
6526
- ) : /* @__PURE__ */ a(Rs, { change: v, dataAttr: "data-cbv-unseen" }),
6527
+ ) : /* @__PURE__ */ a(Es, { change: v, dataAttr: "data-cbv-unseen" }),
6527
6528
  /* @__PURE__ */ a(uc, { rowId: s }),
6528
6529
  vt && /* @__PURE__ */ a(
6529
6530
  "input",
@@ -6622,7 +6623,7 @@ ${r}`).then(() => {
6622
6623
  className: `whitespace-nowrap px-3 py-1 ${ct(p, "z-[1]", D)}`,
6623
6624
  onClick: (O) => O.stopPropagation(),
6624
6625
  children: /* @__PURE__ */ a(
6625
- Ls,
6626
+ Fs,
6626
6627
  {
6627
6628
  users: (or == null ? void 0 : or[String(s)]) ?? [],
6628
6629
  showSingleName: !1
@@ -6729,7 +6730,7 @@ ${r}`).then(() => {
6729
6730
  onPeek: () => xt.push([{ collection: n, itemId: String(s) }]),
6730
6731
  onAudit: () => cn(String(s)),
6731
6732
  urlFor: F,
6732
- onDeleted: () => Kl.mutate(s),
6733
+ onDeleted: () => jl.mutate(s),
6733
6734
  row: l,
6734
6735
  bulkEnabledKeys: De.bulk_actions ?? null,
6735
6736
  disabled: vt
@@ -6757,16 +6758,16 @@ ${r}`).then(() => {
6757
6758
  l,
6758
6759
  p,
6759
6760
  !!U && !U.is_mine,
6760
- Bt(p) ? Ll(p) === "nivaro_users" ? (() => {
6761
+ Bt(p) ? Fl(p) === "nivaro_users" ? (() => {
6761
6762
  var se, C, B;
6762
6763
  const O = p.includes(".") ? p : He[p], nt = ((B = (C = (se = Te == null ? void 0 : Te.rows) == null ? void 0 : se[String(s)]) == null ? void 0 : C[O]) == null ? void 0 : B.ids) ?? [], W = _t(s, p) ?? "";
6763
6764
  if (nt.length === 0 || !W || W === "—")
6764
6765
  return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
6765
6766
  if (nt.length === 1)
6766
- return /* @__PURE__ */ a("span", { onClick: (we) => we.stopPropagation(), children: /* @__PURE__ */ a(Fs, { userId: String(nt[0]), size: "compact" }) });
6767
+ return /* @__PURE__ */ a("span", { onClick: (we) => we.stopPropagation(), children: /* @__PURE__ */ a(Rs, { userId: String(nt[0]), size: "compact" }) });
6767
6768
  const ke = W.split(", ");
6768
6769
  return /* @__PURE__ */ a(
6769
- Ls,
6770
+ Fs,
6770
6771
  {
6771
6772
  users: nt.map((we, Ee) => ({
6772
6773
  id: String(we),
@@ -6787,7 +6788,7 @@ ${r}`).then(() => {
6787
6788
  "data-tip": _t(s, p) ?? void 0,
6788
6789
  className: "block max-w-[260px] truncate text-left text-[12px] font-medium text-slate-700 underline decoration-slate-300 underline-offset-2 transition-colors hover:text-[#0284c7] hover:decoration-[#0284c7] dark:text-slate-200 dark:decoration-slate-600 dark:hover:text-[#38bdf8]",
6789
6790
  children: [
6790
- ((Jt = ge[p]) == null ? void 0 : Jt.type) === "count" && Fl(p) ? "📎 " : "",
6791
+ ((Jt = ge[p]) == null ? void 0 : Jt.type) === "count" && Rl(p) ? "📎 " : "",
6791
6792
  xn(_t(s, p) ?? "", p, s)
6792
6793
  ]
6793
6794
  }
@@ -6796,9 +6797,9 @@ ${r}`).then(() => {
6796
6797
  {
6797
6798
  className: "block max-w-[260px] truncate text-[12px] text-slate-700 dark:text-slate-200",
6798
6799
  "data-tip": _t(s, p) ?? void 0,
6799
- children: _t(s, p) != null ? `${((kn = ge[p]) == null ? void 0 : kn.type) === "count" && Fl(p) ? "📎 " : ""}${xn(_t(s, p) ?? "", p, s)}` : /* @__PURE__ */ a("span", { className: "inline-block h-3.5 w-16 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
6800
+ children: _t(s, p) != null ? `${((kn = ge[p]) == null ? void 0 : kn.type) === "count" && Rl(p) ? "📎 " : ""}${xn(_t(s, p) ?? "", p, s)}` : /* @__PURE__ */ a("span", { className: "inline-block h-3.5 w-16 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
6800
6801
  }
6801
- ) : (tt == null ? void 0 : tt.one_collection) === "nivaro_users" && l[p] != null ? /* @__PURE__ */ a("span", { onClick: (O) => O.stopPropagation(), children: /* @__PURE__ */ a(Fs, { userId: String(l[p]), size: "compact" }) }) : tt != null && tt.one_collection && l[p] != null && !qt(tt.one_collection) ? /* @__PURE__ */ a(
6802
+ ) : (tt == null ? void 0 : tt.one_collection) === "nivaro_users" && l[p] != null ? /* @__PURE__ */ a("span", { onClick: (O) => O.stopPropagation(), children: /* @__PURE__ */ a(Rs, { userId: String(l[p]), size: "compact" }) }) : tt != null && tt.one_collection && l[p] != null && !Tt(tt.one_collection) ? /* @__PURE__ */ a(
6802
6803
  "button",
6803
6804
  {
6804
6805
  type: "button",
@@ -6812,7 +6813,7 @@ ${r}`).then(() => {
6812
6813
  },
6813
6814
  className: "text-left text-[12px] font-medium text-slate-700 underline decoration-slate-300 underline-offset-2 transition-colors hover:text-[#0284c7] hover:decoration-[#0284c7] dark:text-slate-200 dark:decoration-slate-600 dark:hover:text-[#38bdf8]",
6814
6815
  children: /* @__PURE__ */ a(
6815
- Er,
6816
+ Dr,
6816
6817
  {
6817
6818
  relatedCollection: tt.one_collection,
6818
6819
  id: l[p]
@@ -6835,7 +6836,7 @@ ${r}`).then(() => {
6835
6836
  {
6836
6837
  className: Gt(
6837
6838
  "text-[12px] tabular-nums text-slate-700 dark:text-slate-200",
6838
- ya(l[p], H[p]) && Ps[ya(l[p], H[p])]
6839
+ ya(l[p], H[p]) && Ms[ya(l[p], H[p])]
6839
6840
  ),
6840
6841
  children: Vn(String(l[p]), ge[p])
6841
6842
  }
@@ -6844,10 +6845,10 @@ ${r}`).then(() => {
6844
6845
  {
6845
6846
  className: Gt(
6846
6847
  "text-[12px]",
6847
- Ps[ya(l[p], H[p])]
6848
+ Ms[ya(l[p], H[p])]
6848
6849
  ),
6849
6850
  children: /* @__PURE__ */ a(
6850
- Ms,
6851
+ Os,
6851
6852
  {
6852
6853
  collection: n,
6853
6854
  field: p,
@@ -6858,7 +6859,7 @@ ${r}`).then(() => {
6858
6859
  )
6859
6860
  }
6860
6861
  ) : /* @__PURE__ */ a(
6861
- Ms,
6862
+ Os,
6862
6863
  {
6863
6864
  collection: n,
6864
6865
  field: p,
@@ -6898,7 +6899,7 @@ ${r}`).then(() => {
6898
6899
  )
6899
6900
  }
6900
6901
  ),
6901
- /* @__PURE__ */ a(Bc, { scrollerRef: jr }),
6902
+ /* @__PURE__ */ a(Bc, { scrollerRef: Br }),
6902
6903
  /* @__PURE__ */ a(
6903
6904
  su,
6904
6905
  {
@@ -7034,10 +7035,10 @@ ${r}`).then(() => {
7034
7035
  "button",
7035
7036
  {
7036
7037
  type: "button",
7037
- disabled: Bl,
7038
+ disabled: Ul,
7038
7039
  onClick: () => void Xo(),
7039
7040
  className: "font-semibold text-nvr-navy underline decoration-dotted hover:text-nvr-cyan dark:text-nvr-cyan",
7040
- children: Bl ? "Selecting…" : Me > ha ? `Select the first ${ha.toLocaleString()} of ${Me.toLocaleString()} matching` : `Select all ${Me.toLocaleString()} matching rows`
7041
+ children: Ul ? "Selecting…" : Me > ha ? `Select the first ${ha.toLocaleString()} of ${Me.toLocaleString()} matching` : `Select all ${Me.toLocaleString()} matching rows`
7041
7042
  }
7042
7043
  )
7043
7044
  ] }),
@@ -7060,14 +7061,14 @@ ${r}`).then(() => {
7060
7061
  );
7061
7062
  }
7062
7063
  function Mu(n, i, h, d, y) {
7063
- const N = Rr(i, n, h);
7064
- return N != null && N.one_collection ? /* @__PURE__ */ a(Er, { relatedCollection: N.one_collection, id: d }) : Ki(d, y);
7064
+ const N = Er(i, n, h);
7065
+ return N != null && N.one_collection ? /* @__PURE__ */ a(Dr, { relatedCollection: N.one_collection, id: d }) : Ki(d, y);
7065
7066
  }
7066
7067
  export {
7067
7068
  _0 as CollectionBrowserView,
7068
7069
  Fa as MultiPick,
7069
7070
  ku as RowActionsMenu,
7070
- Ps as TINT_TEXT,
7071
+ Ms as TINT_TEXT,
7071
7072
  Mu as compareCell,
7072
7073
  Sa as invalidateCbvRowQueries,
7073
7074
  vu as roleMayDelete,