@nivaro/react 0.3.98 → 0.3.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useFormSchema.js +82 -85
  3. package/dist/hooks/useSessionRecorder.js +206 -175
  4. package/dist/index.d.ts +38 -13
  5. package/dist/index.js +182 -180
  6. package/dist/lib/commands.js +15 -11
  7. package/dist/shared/components/CollectionBrowserView.js +516 -503
  8. package/dist/shared/components/ItemEditForm.js +3021 -3019
  9. package/dist/shared/components/JobsTray.js +20 -16
  10. package/dist/shared/components/MyWorkView.js +133 -126
  11. package/dist/shared/components/NotificationBell.js +314 -288
  12. package/dist/shared/components/RecordCompare.js +38 -40
  13. package/dist/shared/components/RecordReadView.js +119 -119
  14. package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
  15. package/dist/shared/components/item-edit/InlineGridField.js +45 -45
  16. package/dist/shared/components/item-edit/InlineTableField.js +750 -749
  17. package/dist/shared/components/item-edit/QuickPickerDialog.js +44 -44
  18. package/dist/shared/components/item-edit/RawEditSheet.js +122 -114
  19. package/dist/shared/components/item-edit/RelationCombobox.js +454 -378
  20. package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
  21. package/dist/shared/components/item-edit/related-missing.js +75 -19
  22. package/dist/shared/components/notifications/NotificationCenterView.js +249 -226
  23. package/dist/shared/components/panels/AccessDeniedPanel.js +31 -28
  24. package/dist/shared/components/panels/BackgroundMove.js +175 -0
  25. package/dist/shared/components/panels/MoveAdvisory.js +204 -0
  26. package/dist/shared/components/panels/PipelinePanel.js +1450 -1219
  27. package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
  28. package/dist/shared/lib/commands.js +18 -14
  29. package/dist/shared/lib/error-hints.js +1 -1
  30. package/dist/shared/lib/job-failure-text.js +12 -0
  31. package/dist/shared/lib/move-failure.js +9 -0
  32. package/dist/shared/lib/obligation-banner.js +15 -14
  33. package/dist/shared/lib/partner-failure.js +71 -0
  34. package/dist/shared/lib/prefetch.js +73 -73
  35. package/dist/shared/lib/replay-checkout.js +18 -13
  36. package/dist/shared/lib/replay-context.js +90 -77
  37. package/dist/shared/lib/replay-idle.js +21 -0
  38. package/dist/shared/lib/replay-socket.js +21 -17
  39. package/dist/shared/lib/rum.js +56 -51
  40. package/dist/shared/lib/safe-error.js +17 -13
  41. package/dist/shared/lib/stale-chunk.js +69 -26
  42. package/dist/shared/lib/system-collections.js +20 -0
  43. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { jsxs as c, jsx as a, Fragment as Qe } from "react/jsx-runtime";
2
2
  import { useQueryClient as Fa, useMutation as Nt, useQuery as ne, useQueries as _a } from "@tanstack/react-query";
3
- import { FileDiff as xi, RotateCw as yr, Network as vi, Map as ki, Sparkles as wr, X as _r, Rows3 as xl, ListChecks as yi, Rows2 as wi, ChevronDown as Jn, Wand2 as vl, FileText as kl, Bell as _i, BellOff as Ni, Loader2 as yl, Check as Si, Search as Ql, ChevronsLeft as Ci, ChevronsRight as $i, Pin as qi } from "lucide-react";
3
+ import { FileDiff as xi, RotateCw as yr, Network as vi, Map as ki, Sparkles as wr, X as _r, Rows3 as xl, ListChecks as yi, Rows2 as wi, ChevronDown as Gn, Wand2 as vl, FileText as kl, Bell as _i, BellOff as Ni, Loader2 as yl, Check as Si, Search as Ql, ChevronsLeft as Ci, ChevronsRight as $i, Pin as qi } from "lucide-react";
4
4
  import Ti, { useState as _, useRef as fe, useEffect as pe, useMemo as be, useLayoutEffect as Li } from "react";
5
5
  import { createPortal as Wl } from "react-dom";
6
6
  import { toast as ge } from "sonner";
@@ -12,7 +12,7 @@ import { rowActionSentence as Pi } from "../lib/bulk-copy.js";
12
12
  import { useBulkProgressFeed as Mi, newBulkProgressId as Oi, startBulkProgress as Ai, endBulkProgress as Ii } from "../lib/bulk-progress.js";
13
13
  import { csvNumber as Ki, csvDateTime as ji, readExportExtras as Bi, VIRTUAL_HEADERS as Ui, virtualExportCell as zi } from "../lib/cbv-export.js";
14
14
  import { warmPageLookups as Qi } from "../lib/cbv-page-warm.js";
15
- import { post as he, get as J, patch as ka, del as Na } from "../lib/commands.js";
15
+ import { post as he, get as G, patch as ka, del as Na } from "../lib/commands.js";
16
16
  import { compareValueText as Wi } from "../lib/compare-value.js";
17
17
  import { parseDateFilter as qa, dateFilterBounds as Vi, describeDateFilter as Hi, DATE_FILTER_OPS as Yi, formatDateFilter as Ji } from "../lib/date-filter.js";
18
18
  import { rowDeleteOffered as Gi } from "../lib/delete-offer.js";
@@ -21,7 +21,7 @@ import { errorToastOptions as Sa, toastError as _l } from "../lib/error-toast.js
21
21
  import { extractExpressionTokens as Zi, evaluateNumeric as Nl } from "../lib/expression.js";
22
22
  import { clauseFromCondition as Nr, clauseFromControlValue as ed, filterSentence as td } from "../lib/filter-sentence.js";
23
23
  import { deliverLive as nd, releaseLiveOwner as ad } from "../lib/focus-mode.js";
24
- import { formatValue as Hn, formatMultiValue as Sl, countFromResolved as rd } from "../lib/format-value.js";
24
+ import { formatValue as Yn, formatMultiValue as Sl, countFromResolved as rd } from "../lib/format-value.js";
25
25
  import { createCursorBook as sd, pageRequest as ld, noteNextCursor as od, isCursorRefusal as id, stopCursors as dd } from "../lib/keyset-pager.js";
26
26
  import { normalizeInlineEdit as cd, inlineM2oTarget as ud, inlineChoices as pd, inlineEditFor as md, nextInlineKey as fd } from "../lib/list-inline-edit.js";
27
27
  import { sanitizeCbvLinkState as bd, readListLinkFromLocation as hd, dropListLinkParam as gd } from "../lib/list-link.js";
@@ -58,42 +58,43 @@ import { CopyAsButton as yc } from "./CopyAsButton.js";
58
58
  import { useTreeConfig as wc, CollectionTree as _c } from "./cbv/CollectionTree.js";
59
59
  import { readExportRows as Nc, stableSort as Sc, m2oLabelPaths as Cc, resolveAllPaths as $c, userLabel as qc, m2oLabel as Tc, localYmd as Lc } from "./cbv/export-rows.js";
60
60
  import { FormulaColumnAdder as Fc } from "./cbv/FormulaColumnAdder.js";
61
- import { useHierarchyScope as Rc, HierarchyScopePicker as Ec } from "./cbv/HierarchyScope.js";
62
- import { tabStopRowKey as Dc, rowFocusTarget as Pc } from "./cbv/row-focus.js";
63
- import { splitRiskFilter as Ll, riskFilterEntry as Mc } from "./cbv/saved-view-risk.js";
64
- import { isFilterRefusal as Oc, unknownFieldsOf as Fl, dropUnknownField as Ac } from "./cbv/unknown-fields.js";
65
- import { ViewDefaultMenu as Ic } from "./cbv/ViewDefaultMenu.js";
66
- import { exactCountParams as Kc, lastPageFromCount as jc } from "./cbv-pager.js";
67
- import { relationFilterRequests as Bc, mergeFilterOptions as Uc } from "./cbv-relation-filter.js";
68
- import { useRecordRoomTypes as zc, canOpenChatRoom as Qc, discussRecord as Wc } from "./chat/chat-core.js";
69
- import { FilterControl as Vc } from "./DataTable.js";
70
- import { FocusModeToggle as Hc } from "./FocusModeToggle.js";
71
- import { FULFILMENT_FILTER_OPTIONS as Rl, FulfilmentPill as Yc, fulfilmentFigures as Jc } from "./FulfilmentPill.js";
72
- import { HScrollProxy as Gc } from "./HScrollProxy.js";
73
- import { useDocumentAutofillConfig as Xc, startDocumentExtraction as Zc } from "./import/DocumentAutofillButton.js";
74
- import { INTEGRATIONS_FILTER_OPTIONS as El, IntegrationDots as eu } from "./integrations/IntegrationDots.js";
75
- import { useQuickPickerSteps as tu, QuickPickerDialog as nu } from "./item-edit/QuickPickerDialog.js";
76
- import { usePickerExclusion as au } from "./item-edit/RecordGrantTools.js";
61
+ import { FoundElsewhere as Rc } from "./cbv/FoundElsewhere.js";
62
+ import { useHierarchyScope as Ec, HierarchyScopePicker as Dc } from "./cbv/HierarchyScope.js";
63
+ import { tabStopRowKey as Pc, rowFocusTarget as Mc } from "./cbv/row-focus.js";
64
+ import { splitRiskFilter as Ll, riskFilterEntry as Oc } from "./cbv/saved-view-risk.js";
65
+ import { isFilterRefusal as Ac, unknownFieldsOf as Fl, dropUnknownField as Ic } from "./cbv/unknown-fields.js";
66
+ import { ViewDefaultMenu as Kc } from "./cbv/ViewDefaultMenu.js";
67
+ import { exactCountParams as jc, lastPageFromCount as Bc } from "./cbv-pager.js";
68
+ import { relationFilterRequests as Uc, mergeFilterOptions as zc } from "./cbv-relation-filter.js";
69
+ import { useRecordRoomTypes as Qc, canOpenChatRoom as Wc, discussRecord as Vc } from "./chat/chat-core.js";
70
+ import { FilterControl as Hc } from "./DataTable.js";
71
+ import { FocusModeToggle as Yc } from "./FocusModeToggle.js";
72
+ import { FULFILMENT_FILTER_OPTIONS as Rl, FulfilmentPill as Jc, fulfilmentFigures as Gc } from "./FulfilmentPill.js";
73
+ import { HScrollProxy as Xc } from "./HScrollProxy.js";
74
+ import { useDocumentAutofillConfig as Zc, startDocumentExtraction as eu } from "./import/DocumentAutofillButton.js";
75
+ import { INTEGRATIONS_FILTER_OPTIONS as El, IntegrationDots as tu } from "./integrations/IntegrationDots.js";
76
+ import { useQuickPickerSteps as nu, QuickPickerDialog as au } from "./item-edit/QuickPickerDialog.js";
77
+ import { usePickerExclusion as ru } from "./item-edit/RecordGrantTools.js";
77
78
  import { invalidateRecordQueries as Dl } from "./item-edit/RecordLiveSync.js";
78
- import { relatedMissing as ru } from "./item-edit/related-missing.js";
79
+ import { relatedMissing as su } from "./item-edit/related-missing.js";
79
80
  import { UserRosterCluster as Pl, UserChip as Ml } from "./item-edit/UserChip.js";
80
- import { LiveRowMark as su } from "./LiveRowMark.js";
81
- import { CopyListLinkButton as lu } from "./list/CopyListLinkButton.js";
82
- import { useInlineEdit as ou, InlineEditCell as iu } from "./list/InlineEdit.js";
83
- import { MapView as du } from "./MapView.js";
84
- import { usePickerExcludedRows as cu, PICKER_EXCLUDED_ROW_CLASS as uu, PICKER_EXCLUDED_TITLE as pu } from "./PickerExcludedRows.js";
81
+ import { LiveRowMark as lu } from "./LiveRowMark.js";
82
+ import { CopyListLinkButton as ou } from "./list/CopyListLinkButton.js";
83
+ import { useInlineEdit as iu, InlineEditCell as du } from "./list/InlineEdit.js";
84
+ import { MapView as cu } from "./MapView.js";
85
+ import { usePickerExcludedRows as uu, PICKER_EXCLUDED_ROW_CLASS as pu, PICKER_EXCLUDED_TITLE as mu } from "./PickerExcludedRows.js";
85
86
  import { ConfirmButton as Fr } from "./profile/primitives.js";
86
- import { RealtimeStaleMark as mu } from "./RealtimeStatusBanner.js";
87
- import { RecordDrilldownSheet as fu } from "./RecordDrilldownSheet.js";
88
- import { RowHighlightLegend as bu } from "./RowHighlightLegend.js";
89
- import { RowPresence as hu } from "./RowPresence.js";
90
- import { TableSkeletonRows as gu } from "./Skeletons.js";
91
- import { SlowNoticeView as xu } from "./SlowNotice.js";
92
- import { TipLayer as vu } from "./TipLayer.js";
87
+ import { RealtimeStaleMark as fu } from "./RealtimeStatusBanner.js";
88
+ import { RecordDrilldownSheet as bu } from "./RecordDrilldownSheet.js";
89
+ import { RowHighlightLegend as hu } from "./RowHighlightLegend.js";
90
+ import { RowPresence as gu } from "./RowPresence.js";
91
+ import { TableSkeletonRows as xu } from "./Skeletons.js";
92
+ import { SlowNoticeView as vu } from "./SlowNotice.js";
93
+ import { TipLayer as ku } from "./TipLayer.js";
93
94
  import { UnseenDot as Ol } from "./UnseenDot.js";
94
95
  import { SimpleSelectXs as Nn, SimpleSelect as Al } from "./ui/SimpleSelect.js";
95
- import { RevisionsPanel as ku } from "./panels/RevisionsPanel.js";
96
- import { itemActionChoiceStep as yu, ItemActionChoiceList as wu } from "./panels/ItemActionChoices.js";
96
+ import { RevisionsPanel as yu } from "./panels/RevisionsPanel.js";
97
+ import { itemActionChoiceStep as wu, ItemActionChoiceList as _u } from "./panels/ItemActionChoices.js";
97
98
  function Sn(n, o, h) {
98
99
  const d = n.find((w) => w.one_collection === o && w.one_field === h);
99
100
  if (d != null && d.many_collection)
@@ -105,7 +106,7 @@ function ya(n, o) {
105
106
  const h = o.relation.many_collection, d = o.relation.junction_field;
106
107
  return !h || !d ? null : ((w = n.find((S) => S.many_collection === h && S.many_field === d)) == null ? void 0 : w.one_collection) ?? null;
107
108
  }
108
- function Yn(n) {
109
+ function Jn(n) {
109
110
  if (!n) return "id";
110
111
  const o = new Set(n.fields.map((d) => d.field)), h = [...(n.display_template ?? "").matchAll(/\{\{(\w+)/g)].map((d) => d[1]);
111
112
  for (const d of h) if (o.has(d)) return d;
@@ -149,7 +150,7 @@ function wa(n, o) {
149
150
  }
150
151
  return null;
151
152
  }
152
- const _u = [
153
+ const Nu = [
153
154
  { label: "None", cfg: null },
154
155
  { label: "Currency", cfg: { type: "number", decimals: 2, thousands: !0, prefix: "$" } },
155
156
  { label: "Number", cfg: { type: "number", thousands: !0 } },
@@ -185,7 +186,7 @@ function Er(n, o, h) {
185
186
  !d.junction_field && !!d.one_collection
186
187
  );
187
188
  }
188
- function Nu(n) {
189
+ function Su(n) {
189
190
  const o = new Date(String(n));
190
191
  if (Number.isNaN(o.getTime())) return String(n);
191
192
  const h = Date.now() - o.getTime(), d = Math.floor(h / 6e4);
@@ -196,7 +197,7 @@ function Nu(n) {
196
197
  const S = Math.floor(w / 24);
197
198
  return S < 7 ? `${S}d ago` : o.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
198
199
  }
199
- const bt = (n) => n.toLocaleString("en-US"), Yl = /* @__PURE__ */ new Set(["nivaro_users", "directus_users"]), Tt = (n) => n.startsWith("directus_") || n.startsWith("nivaro_"), Cr = /* @__PURE__ */ new Map();
200
+ const ht = (n) => n.toLocaleString("en-US"), Yl = /* @__PURE__ */ new Set(["nivaro_users", "directus_users"]), Tt = (n) => n.startsWith("directus_") || n.startsWith("nivaro_"), Cr = /* @__PURE__ */ new Map();
200
201
  function Jl(n, o, h) {
201
202
  let d = Cr.get(o);
202
203
  d || (d = { ids: /* @__PURE__ */ new Set(), waiters: [], promise: null }, Cr.set(o, d));
@@ -209,7 +210,7 @@ function Jl(n, o, h) {
209
210
  Promise.all(
210
211
  q.map(
211
212
  (N) => n.request(
212
- J(`/items/${o}`, {
213
+ G(`/items/${o}`, {
213
214
  filter: JSON.stringify({ id: { _in: N } }),
214
215
  limit: N.length,
215
216
  fields: "*",
@@ -227,17 +228,17 @@ function Jl(n, o, h) {
227
228
  }, 0);
228
229
  })), w.promise.then((S) => S.get(h) ?? null);
229
230
  }
230
- const Su = {
231
+ const Cu = {
231
232
  draft: "draft",
232
233
  submitted: "submitted",
233
234
  review: "in review",
234
235
  approved: "approved",
235
236
  rejected: "rejected"
236
237
  };
237
- function Cu({ summary: n }) {
238
+ function $u({ summary: n }) {
238
239
  var N;
239
240
  if (!n || n.total === 0) return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
240
- const o = n.latest, h = n.active > 0, d = !!(o != null && o.workflow_state) && !["approved", "rejected", "reverted"].includes(o.status), w = o ? d ? ((N = o.workflow_state) == null ? void 0 : N.label) ?? "" : Su[o.status] ?? o.status : "", S = o == null ? void 0 : o.cost_impact, $ = S != null && S !== 0 ? `${S > 0 ? "+" : "−"}$${Math.abs(S).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null, q = o ? `${o.title ?? "Addendum"} — ${w}${n.total > 1 ? ` (${n.total} total)` : ""}` : void 0;
241
+ const o = n.latest, h = n.active > 0, d = !!(o != null && o.workflow_state) && !["approved", "rejected", "reverted"].includes(o.status), w = o ? d ? ((N = o.workflow_state) == null ? void 0 : N.label) ?? "" : Cu[o.status] ?? o.status : "", S = o == null ? void 0 : o.cost_impact, $ = S != null && S !== 0 ? `${S > 0 ? "+" : "−"}$${Math.abs(S).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null, q = o ? `${o.title ?? "Addendum"} — ${w}${n.total > 1 ? ` (${n.total} total)` : ""}` : void 0;
241
242
  return /* @__PURE__ */ c(
242
243
  "span",
243
244
  {
@@ -263,13 +264,13 @@ function Cu({ summary: n }) {
263
264
  function Dr({ relatedCollection: n, id: o }) {
264
265
  const h = St(), d = Yl.has(n), w = o != null && o !== "", { data: S } = ne({
265
266
  queryKey: ["cbv-collection-meta", n],
266
- queryFn: () => h.request(J(`/collections/${n}`)).then((L) => L.data),
267
+ queryFn: () => h.request(G(`/collections/${n}`)).then((L) => L.data),
267
268
  staleTime: 10 * 6e4,
268
269
  enabled: !Tt(n),
269
270
  retry: !1
270
271
  }), { data: $, isLoading: q } = ne({
271
272
  queryKey: ["cbv-relation-item", n, String(o)],
272
- queryFn: () => d ? h.request(J(`/users/${o}`)).then((L) => L.data) : Jl(h, n, String(o)),
273
+ queryFn: () => d ? h.request(G(`/users/${o}`)).then((L) => L.data) : Jl(h, n, String(o)),
273
274
  enabled: w && (d || !Tt(n)),
274
275
  staleTime: 30 * 6e4,
275
276
  retry: !1
@@ -278,7 +279,7 @@ function Dr({ relatedCollection: n, id: o }) {
278
279
  if (q)
279
280
  return /* @__PURE__ */ a("span", { className: "inline-block h-3.5 w-24 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
280
281
  if (!$) {
281
- const L = ru(null);
282
+ const L = su(null);
282
283
  return /* @__PURE__ */ a(
283
284
  "span",
284
285
  {
@@ -315,17 +316,17 @@ function Ca(n, o) {
315
316
  ])
316
317
  n.invalidateQueries({ queryKey: [h, o] });
317
318
  }
318
- function $u(n, o) {
319
+ function qu(n, o) {
319
320
  return n ? n.is_admin ? !0 : (n.collections ?? []).some(
320
321
  (h) => (h.collection === o || h.collection === "*") && (h.actions.includes("update") || h.actions.includes("*"))
321
322
  ) : !1;
322
323
  }
323
- function qu(n, o) {
324
+ function Tu(n, o) {
324
325
  return n ? n.is_admin ? !0 : (n.collections ?? []).some(
325
326
  (h) => (h.collection === o || h.collection === "*") && (h.actions.includes("delete") || h.actions.includes("*"))
326
327
  ) : !1;
327
328
  }
328
- function Tu({
329
+ function Lu({
329
330
  collection: n,
330
331
  id: o,
331
332
  hasPipeline: h,
@@ -340,7 +341,7 @@ function Tu({
340
341
  disabled: V = !1,
341
342
  label: I
342
343
  }) {
343
- var qn, Gn, Ve, Qt, xt, lt, Tn, cn, un, en, tn, Xn, Zn, ce, ea, pn, mn, Ln, Fn, Rn;
344
+ var qn, Xn, Ve, Qt, vt, lt, Tn, cn, un, en, tn, Zn, ea, ce, ta, pn, mn, Ln, Fn, Rn;
344
345
  const u = St(), y = Fa(), { isAdmin: Q } = $a(), F = Lr({
345
346
  label: I,
346
347
  meta: y.getQueryData(["cbv-collection-meta", n]),
@@ -353,19 +354,19 @@ function Tu({
353
354
  }, [V]);
354
355
  const { data: me } = ne({
355
356
  queryKey: ["my-permissions"],
356
- queryFn: () => u.request(J("/security/my/permissions")).then((g) => g.data),
357
+ queryFn: () => u.request(G("/security/my/permissions")).then((g) => g.data),
357
358
  enabled: m && !Q,
358
359
  staleTime: 5 * 6e4
359
- }), we = au(n, String(o), {
360
+ }), we = ru(n, String(o), {
360
361
  enabled: m && Q,
361
362
  onDone: () => E(!1)
362
- }), [Ae, G] = _(!1), Be = zc(m), Se = Qc() && !!(Be != null && Be.some((g) => g.collection === n));
363
+ }), [Ae, Y] = _(!1), Be = Qc(m), Se = Wc() && !!(Be != null && Be.some((g) => g.collection === n));
363
364
  pe(() => {
364
365
  if (!m) return;
365
366
  const g = (Z) => {
366
- var Ke, re;
367
+ var Ke, ae;
367
368
  const ue = Z.target;
368
- !((Ke = de.current) != null && Ke.contains(ue)) && !((re = T.current) != null && re.contains(ue)) && E(!1);
369
+ !((Ke = de.current) != null && Ke.contains(ue)) && !((ae = T.current) != null && ae.contains(ue)) && E(!1);
369
370
  }, R = (Z) => {
370
371
  Z.key === "Escape" && E(!1);
371
372
  };
@@ -375,7 +376,7 @@ function Tu({
375
376
  }, [m]);
376
377
  const { data: X } = ne({
377
378
  queryKey: ["cbv-row-instance", n, String(o)],
378
- queryFn: () => u.request(J(`/pipelines/instance/${n}/${o}`)).then((g) => g.data).catch(() => null),
379
+ queryFn: () => u.request(G(`/pipelines/instance/${n}/${o}`)).then((g) => g.data).catch(() => null),
379
380
  enabled: m && h,
380
381
  staleTime: 15e3
381
382
  }), $e = be(
@@ -383,7 +384,7 @@ function Tu({
383
384
  [X]
384
385
  ), { data: it } = ic(m ? [n] : []), at = Gi({
385
386
  isAdmin: Q,
386
- roleMayDelete: qu(me, n),
387
+ roleMayDelete: Tu(me, n),
387
388
  builtinOpen: it ? (it[n] ?? []).some((g) => g.source === "builtin" && g.key === "delete") && dc(K, n, "delete") : void 0,
388
389
  hasPipeline: h,
389
390
  run: h ? X === void 0 ? void 0 : X : null
@@ -394,29 +395,29 @@ function Tu({
394
395
  (g) => g.kind !== "builtin" && g.kind !== "transition"
395
396
  ) : [],
396
397
  [m, it, n, K]
397
- ), Pe = be(() => {
398
+ ), Me = be(() => {
398
399
  const g = /* @__PURE__ */ new Set();
399
400
  for (const R of Ie)
400
401
  for (const Z of R.guard ?? [])
401
402
  Z && typeof Z.field == "string" && !(L && Z.field in L) && g.add(Z.field);
402
403
  return [...g].sort();
403
404
  }, [Ie, L]), { data: We } = ne({
404
- queryKey: ["row-action-guard", n, String(o), Pe.join(",")],
405
+ queryKey: ["row-action-guard", n, String(o), Me.join(",")],
405
406
  queryFn: () => u.request(
406
- J(`/items/${encodeURIComponent(n)}/${encodeURIComponent(String(o))}`, {
407
- fields: Pe.join(",")
407
+ G(`/items/${encodeURIComponent(n)}/${encodeURIComponent(String(o))}`, {
408
+ fields: Me.join(",")
408
409
  })
409
410
  ).then((g) => g.data ?? {}).catch(() => ({})),
410
- enabled: m && Pe.length > 0,
411
+ enabled: m && Me.length > 0,
411
412
  staleTime: 0
412
413
  }), k = be(() => {
413
- if (Pe.length > 0 && !We) return Ie.filter((R) => {
414
+ if (Me.length > 0 && !We) return Ie.filter((R) => {
414
415
  var Z;
415
416
  return !((Z = R.guard) != null && Z.length);
416
417
  });
417
418
  const g = { ...We ?? {}, ...L ?? {} };
418
419
  return Ie.filter((R) => uc(R.guard, g) !== !1);
419
- }, [Ie, Pe, We, L]), { pushActions: le, failedPartners: ee } = xc({
420
+ }, [Ie, Me, We, L]), { pushActions: le, failedPartners: ee } = xc({
420
421
  collection: n,
421
422
  id: o,
422
423
  open: m,
@@ -436,13 +437,13 @@ function Tu({
436
437
  if (g.has(Ke))
437
438
  g.get(Ke).push(ue);
438
439
  else {
439
- const re = [ue];
440
- g.set(Ke, re), R.push({ key: `g:${Ke}`, label: Ke, options: re });
440
+ const ae = [ue];
441
+ g.set(Ke, ae), R.push({ key: `g:${Ke}`, label: Ke, options: ae });
441
442
  }
442
443
  }
443
444
  for (const ue of R)
444
445
  ue.options.length > 1 && ue.options.sort(
445
- (Ke, re) => (rt.get(Ke.to_state ?? "") ?? 999) - (rt.get(re.to_state ?? "") ?? 999)
446
+ (Ke, ae) => (rt.get(Ke.to_state ?? "") ?? 999) - (rt.get(ae.to_state ?? "") ?? 999)
446
447
  );
447
448
  return R;
448
449
  }, [$e, rt]), mt = (g) => {
@@ -453,18 +454,18 @@ function Tu({
453
454
  return (R == null ? void 0 : R.color) ?? g.color ?? "#94a3b8";
454
455
  }, [f, H] = _(null), [te, oe] = _("");
455
456
  pe(() => {
456
- m || (H(null), oe(""), G(!1));
457
+ m || (H(null), oe(""), Y(!1));
457
458
  }, [m]);
458
- const ae = ((qn = f == null ? void 0 : f.push) == null ? void 0 : qn.kind) === "push" && f.push.action.choose ? f.push.action : null, qe = ne({
459
- queryKey: ["item-action-choices", (ae == null ? void 0 : ae.id) ?? null, n, String(o)],
459
+ const re = ((qn = f == null ? void 0 : f.push) == null ? void 0 : qn.kind) === "push" && f.push.action.choose ? f.push.action : null, qe = ne({
460
+ queryKey: ["item-action-choices", (re == null ? void 0 : re.id) ?? null, n, String(o)],
460
461
  queryFn: () => u.request(
461
- J(`/item-actions/${ae.id}/choices`, { collection: n, item: String(o) })
462
+ G(`/item-actions/${re.id}/choices`, { collection: n, item: String(o) })
462
463
  ).then((g) => g.data ?? []),
463
- enabled: !!ae,
464
+ enabled: !!re,
464
465
  staleTime: 0
465
- }), [ht, It] = _(null), Cn = (ae == null ? void 0 : ae.id) ?? null;
466
+ }), [gt, It] = _(null), Cn = (re == null ? void 0 : re.id) ?? null;
466
467
  pe(() => It(null), [Cn]);
467
- const st = qe.data ? yu(qe.data) : null, gt = st && !st.ask ? st.value : ht, Kt = !!ae && (!st || st.ask && ht == null);
468
+ const st = qe.data ? wu(qe.data) : null, xt = st && !st.ask ? st.value : gt, Kt = !!re && (!st || st.ask && gt == null);
468
469
  Ti.useLayoutEffect(() => {
469
470
  var Ke;
470
471
  if (!m) return;
@@ -473,7 +474,7 @@ function Tu({
473
474
  const R = g.getBoundingClientRect();
474
475
  let { x: Z, y: ue } = P;
475
476
  if (R.right > window.innerWidth - 8 && (Z = Math.max(8, window.innerWidth - R.width - 8)), R.bottom > window.innerHeight - 8) {
476
- const re = (Ke = T.current) == null ? void 0 : Ke.getBoundingClientRect(), nn = ((re == null ? void 0 : re.top) ?? ue) - R.height - 4;
477
+ const ae = (Ke = T.current) == null ? void 0 : Ke.getBoundingClientRect(), nn = ((ae == null ? void 0 : ae.top) ?? ue) - R.height - 4;
477
478
  ue = nn >= 8 ? nn : Math.max(8, window.innerHeight - R.height - 8);
478
479
  }
479
480
  (Z !== P.x || ue !== P.y) && M({ x: Z, y: ue });
@@ -500,7 +501,7 @@ function Tu({
500
501
  return { action: g, result: ue.data ?? {} };
501
502
  },
502
503
  onSuccess: ({ action: g, result: R }) => {
503
- var Z, ue, Ke, re;
504
+ var Z, ue, Ke, ae;
504
505
  if (E(!1), R.failed) {
505
506
  ge.error(`${g.label} failed on ${F.name}`, {
506
507
  description: (ue = (Z = R.errors) == null ? void 0 : Z[0]) == null ? void 0 : ue.error
@@ -508,7 +509,7 @@ function Tu({
508
509
  return;
509
510
  }
510
511
  if (!R.succeeded && R.skipped) {
511
- const nn = (re = (Ke = R.outcomes) == null ? void 0 : Ke.find((Wt) => Wt.outcome === "skip")) == null ? void 0 : re.reason;
512
+ const nn = (ae = (Ke = R.outcomes) == null ? void 0 : Ke.find((Wt) => Wt.outcome === "skip")) == null ? void 0 : ae.reason;
512
513
  ge.info(`${F.name}: ${nn ?? "nothing to change"}`);
513
514
  return;
514
515
  }
@@ -539,7 +540,7 @@ function Tu({
539
540
  const R = g.response;
540
541
  ge.error((R == null ? void 0 : R.error) ?? Zt(g, "Push failed"), Sa(g));
541
542
  }
542
- }), $n = !!f && !f.push && te.trim().length === 0 && (f.action ? f.action.require_reason : ((Gn = $e.find((g) => g.id === f.picked)) == null ? void 0 : Gn.comment_mode) === "required"), Je = (g, R, Z = !1) => /* @__PURE__ */ a(
543
+ }), $n = !!f && !f.push && te.trim().length === 0 && (f.action ? f.action.require_reason : ((Xn = $e.find((g) => g.id === f.picked)) == null ? void 0 : Xn.comment_mode) === "required"), Je = (g, R, Z = !1) => /* @__PURE__ */ a(
543
544
  "button",
544
545
  {
545
546
  type: "button",
@@ -565,7 +566,7 @@ function Tu({
565
566
  className: "inline-flex h-6 items-center gap-1 rounded border border-slate-200 bg-white px-2 text-[11px] font-medium text-slate-600 hover:border-slate-300 hover:text-slate-800 disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:border-slate-200 disabled:hover:text-slate-600 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300 dark:hover:text-slate-100 dark:disabled:hover:border-slate-700 dark:disabled:hover:text-slate-300",
566
567
  children: [
567
568
  "Actions",
568
- /* @__PURE__ */ a(Jn, { "aria-hidden": !0, className: "h-3 w-3 text-slate-400" })
569
+ /* @__PURE__ */ a(Gn, { "aria-hidden": !0, className: "h-3 w-3 text-slate-400" })
569
570
  ]
570
571
  }
571
572
  ),
@@ -605,12 +606,12 @@ function Tu({
605
606
  children: f.push.kind === "push" ? ((Ve = f.push.action.confirm) == null ? void 0 : Ve.body) ?? `Sends this record to the partner now — a real request, the same one the record’s ${f.push.action.label} button sends.` : `Re-sends the stored request to ${f.push.partners.join(", ")}.`
606
607
  }
607
608
  ),
608
- (ae == null ? void 0 : ae.choose) && (qe.isError ? /* @__PURE__ */ a("p", { className: "mb-1.5 px-1 text-[11.5px] text-red-600 dark:text-red-400", children: "Could not load the options." }) : qe.isLoading ? /* @__PURE__ */ a("p", { className: "mb-1.5 px-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: "Loading…" }) : st != null && st.ask ? /* @__PURE__ */ a("div", { className: "mb-1.5 -mt-3 px-1", children: /* @__PURE__ */ a(
609
- wu,
609
+ (re == null ? void 0 : re.choose) && (qe.isError ? /* @__PURE__ */ a("p", { className: "mb-1.5 px-1 text-[11.5px] text-red-600 dark:text-red-400", children: "Could not load the options." }) : qe.isLoading ? /* @__PURE__ */ a("p", { className: "mb-1.5 px-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: "Loading…" }) : st != null && st.ask ? /* @__PURE__ */ a("div", { className: "mb-1.5 -mt-3 px-1", children: /* @__PURE__ */ a(
610
+ _u,
610
611
  {
611
- choose: ae.choose,
612
+ choose: re.choose,
612
613
  options: qe.data ?? [],
613
- value: ht,
614
+ value: gt,
614
615
  onChange: It
615
616
  }
616
617
  ) }) : null),
@@ -639,9 +640,9 @@ function Tu({
639
640
  {
640
641
  value: te,
641
642
  onChange: (g) => oe(g.target.value),
642
- placeholder: ((xt = f.push) == null ? void 0 : xt.kind) === "push" ? ((Tn = (lt = f.push.action.confirm) == null ? void 0 : lt.input) == null ? void 0 : Tn.placeholder) ?? ((un = (cn = f.push.action.confirm) == null ? void 0 : cn.input) == null ? void 0 : un.label) ?? "" : (en = f.action) != null && en.require_reason || ((tn = $e.find((g) => g.id === f.picked)) == null ? void 0 : tn.comment_mode) === "required" ? "Reason (required — recorded on the record’s history)…" : "Reason (optional)…",
643
+ placeholder: ((vt = f.push) == null ? void 0 : vt.kind) === "push" ? ((Tn = (lt = f.push.action.confirm) == null ? void 0 : lt.input) == null ? void 0 : Tn.placeholder) ?? ((un = (cn = f.push.action.confirm) == null ? void 0 : cn.input) == null ? void 0 : un.label) ?? "" : (en = f.action) != null && en.require_reason || ((tn = $e.find((g) => g.id === f.picked)) == null ? void 0 : tn.comment_mode) === "required" ? "Reason (required — recorded on the record’s history)…" : "Reason (optional)…",
643
644
  rows: 2,
644
- "aria-label": ((Xn = f.push) == null ? void 0 : Xn.kind) === "push" ? ((ce = (Zn = f.push.action.confirm) == null ? void 0 : Zn.input) == null ? void 0 : ce.label) ?? "Note" : "Reason",
645
+ "aria-label": ((Zn = f.push) == null ? void 0 : Zn.kind) === "push" ? ((ce = (ea = f.push.action.confirm) == null ? void 0 : ea.input) == null ? void 0 : ce.label) ?? "Note" : "Reason",
645
646
  "aria-describedby": $n ? `row-reason-hint-${String(o)}` : void 0,
646
647
  className: "w-full resize-none rounded-md border border-slate-200 bg-white px-2 py-1.5 text-[12px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
647
648
  }
@@ -660,9 +661,9 @@ function Tu({
660
661
  "button",
661
662
  {
662
663
  type: "button",
663
- disabled: f.push ? Rt.isPending || Kt || f.push.kind === "push" && !!((pn = (ea = f.push.action.confirm) == null ? void 0 : ea.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,
664
+ disabled: f.push ? Rt.isPending || Kt || f.push.kind === "push" && !!((pn = (ta = f.push.action.confirm) == null ? void 0 : ta.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,
664
665
  onClick: () => {
665
- 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 });
666
+ f.push ? Rt.mutate({ op: f.push, note: te, pick: xt }) : f.action ? dn.mutate({ action: f.action, comment: te }) : f.picked && Ft.mutate({ transitionId: f.picked, comment: te });
666
667
  },
667
668
  "data-row-action-confirm": !0,
668
669
  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"}`,
@@ -690,7 +691,7 @@ function Tu({
690
691
  E(!1), w();
691
692
  }),
692
693
  Se && Je("Discuss in chat", () => {
693
- E(!1), Wc(u, n, String(o)).then((g) => {
694
+ E(!1), Vc(u, n, String(o)).then((g) => {
694
695
  g || ge.error("This record has no chat room you can open");
695
696
  }).catch(() => ge.error("Could not open the chat room"));
696
697
  }),
@@ -851,13 +852,13 @@ function Tu({
851
852
  "button",
852
853
  {
853
854
  type: "button",
854
- onClick: () => G(!1),
855
+ onClick: () => Y(!1),
855
856
  className: "h-7 rounded-md border border-slate-200 px-2.5 text-[12px] text-slate-500 dark:border-slate-700 dark:text-slate-400",
856
857
  children: "Cancel"
857
858
  }
858
859
  )
859
860
  ] })
860
- ] }) : Je("Delete", () => G(!0), !0)
861
+ ] }) : Je("Delete", () => Y(!0), !0)
861
862
  ] })
862
863
  ] })
863
864
  }
@@ -897,7 +898,7 @@ function jl({
897
898
  );
898
899
  return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children: q });
899
900
  }
900
- return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children: Nu(d) });
901
+ return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children: Su(d) });
901
902
  }
902
903
  return typeof d == "string" ? /* @__PURE__ */ a(
903
904
  "span",
@@ -988,7 +989,7 @@ function Ra({
988
989
  children: "✕"
989
990
  }
990
991
  ),
991
- /* @__PURE__ */ a(Jn, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-slate-400" })
992
+ /* @__PURE__ */ a(Gn, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-slate-400" })
992
993
  ]
993
994
  }
994
995
  ),
@@ -1027,7 +1028,7 @@ function Ra({
1027
1028
  ] })
1028
1029
  ] });
1029
1030
  }
1030
- function Lu({
1031
+ function Fu({
1031
1032
  target: n,
1032
1033
  label: o,
1033
1034
  selected: h,
@@ -1036,16 +1037,16 @@ function Lu({
1036
1037
  }) {
1037
1038
  const S = St(), [$, q] = _(!1), N = $ || h.length > 0, [L, K] = _(""), V = (w ?? []).map(String).sort().join(","), { data: I } = ne({
1038
1039
  queryKey: ["cbv-collection-meta", n],
1039
- queryFn: () => S.request(J(`/collections/${n}`)).then((T) => T.data),
1040
+ queryFn: () => S.request(G(`/collections/${n}`)).then((T) => T.data),
1040
1041
  staleTime: 10 * 6e4,
1041
1042
  enabled: N,
1042
1043
  retry: !1
1043
- }), u = Yn(I), y = (I == null ? void 0 : I.display_template) ?? null, { data: Q = [], isLoading: F } = ne({
1044
+ }), u = Jn(I), y = (I == null ? void 0 : I.display_template) ?? null, { data: Q = [], isLoading: F } = ne({
1044
1045
  // Own key shape (an array of {value,label}) — 'cbv-filter-options' held the
1045
1046
  // page-only list; a new name keeps an old cached entry from answering.
1046
1047
  queryKey: ["cbv-filter-options-all", n, u, y ?? "", L, V],
1047
1048
  queryFn: async () => {
1048
- const T = Bc({
1049
+ const T = Uc({
1049
1050
  search: L,
1050
1051
  preferIds: w,
1051
1052
  labelField: u,
@@ -1055,10 +1056,10 @@ function Lu({
1055
1056
  label: (y ? Ta(y, Ae) : "") || String(Ae[u] ?? Ae.id ?? "")
1056
1057
  })), me = await Promise.all(
1057
1058
  T.map(
1058
- (we) => S.request(J(`/items/${n}`, we)).then((Ae) => de(Ae.data ?? []))
1059
+ (we) => S.request(G(`/items/${n}`, we)).then((Ae) => de(Ae.data ?? []))
1059
1060
  )
1060
1061
  );
1061
- return Uc(me);
1062
+ return zc(me);
1062
1063
  },
1063
1064
  staleTime: 10 * 6e4,
1064
1065
  enabled: N && !!I,
@@ -1068,7 +1069,7 @@ function Lu({
1068
1069
  queryFn: () => {
1069
1070
  const T = Rr(y, u);
1070
1071
  return S.request(
1071
- J(`/items/${n}`, {
1072
+ G(`/items/${n}`, {
1072
1073
  limit: m.length,
1073
1074
  filter: JSON.stringify({ id: { _in: m } }),
1074
1075
  ...T ? { fields: T } : {}
@@ -1103,7 +1104,7 @@ function Lu({
1103
1104
  }
1104
1105
  );
1105
1106
  }
1106
- function Fu({
1107
+ function Ru({
1107
1108
  collection: n,
1108
1109
  field: o,
1109
1110
  selected: h,
@@ -1111,7 +1112,7 @@ function Fu({
1111
1112
  }) {
1112
1113
  const w = St(), [S, $] = _(!1), { data: q = [], isLoading: N } = ne({
1113
1114
  queryKey: ["cbv-distinct", n, o],
1114
- queryFn: () => w.request(J(`/items/${n}/distinct`, { field: o })).then((L) => L.data ?? []),
1115
+ queryFn: () => w.request(G(`/items/${n}/distinct`, { field: o })).then((L) => L.data ?? []),
1115
1116
  staleTime: 5 * 6e4,
1116
1117
  enabled: S,
1117
1118
  retry: !1
@@ -1131,7 +1132,7 @@ function Fu({
1131
1132
  }
1132
1133
  );
1133
1134
  }
1134
- function Ru({
1135
+ function Eu({
1135
1136
  value: n,
1136
1137
  onChange: o
1137
1138
  }) {
@@ -1187,7 +1188,7 @@ function Ru({
1187
1188
  children: "✕"
1188
1189
  }
1189
1190
  ),
1190
- /* @__PURE__ */ a(Jn, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-slate-400" })
1191
+ /* @__PURE__ */ a(Gn, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-slate-400" })
1191
1192
  ]
1192
1193
  }
1193
1194
  ),
@@ -1256,7 +1257,7 @@ function Ru({
1256
1257
  ] })
1257
1258
  ] });
1258
1259
  }
1259
- function Eu({
1260
+ function Du({
1260
1261
  def: n,
1261
1262
  selected: o,
1262
1263
  onChange: h,
@@ -1282,7 +1283,7 @@ function Eu({
1282
1283
  await Id($, q, n.collection),
1283
1284
  S
1284
1285
  ) : null, m = (T, de) => $.request(
1285
- J(`/items/${n.collection}`, {
1286
+ G(`/items/${n.collection}`, {
1286
1287
  limit: 1e3,
1287
1288
  // Records hidden from pickers (a retired zone) are not offered.
1288
1289
  ...de ? { picker: "1" } : {},
@@ -1340,7 +1341,7 @@ const Xl = [
1340
1341
  { value: "30d", label: "30 days" },
1341
1342
  { value: "90d", label: "90 days" },
1342
1343
  { value: "year", label: "This year" }
1343
- ], Du = {
1344
+ ], Pu = {
1344
1345
  _eq: "_neq",
1345
1346
  _neq: "_eq",
1346
1347
  _in: "_nin",
@@ -1393,7 +1394,7 @@ function Bl(n) {
1393
1394
  continue;
1394
1395
  }
1395
1396
  let S = d.op.includes(":") ? d.op.split(":")[0] : d.op, $ = d.op.includes(":") ? d.op.split(":")[1] : d.value || null;
1396
- d.fieldType === "boolean" && ($ === "true" || $ === "false") && ($ = $ === "true"), d.not && (S = Du[S] ?? S), o.push({ path: d.path, op: S, value: $ });
1397
+ d.fieldType === "boolean" && ($ === "true" || $ === "false") && ($ = $ === "true"), d.not && (S = Pu[S] ?? S), o.push({ path: d.path, op: S, value: $ });
1397
1398
  }
1398
1399
  return o;
1399
1400
  }
@@ -1421,7 +1422,7 @@ const Ul = [
1421
1422
  { label: "After", value: "_gt" },
1422
1423
  { label: "Is empty", value: "_null" },
1423
1424
  { label: "Is not empty", value: "_nnull" }
1424
- ], Pu = {
1425
+ ], Mu = {
1425
1426
  string: Ul,
1426
1427
  text: Ul,
1427
1428
  integer: qr,
@@ -1442,8 +1443,8 @@ const Ul = [
1442
1443
  { label: "Is not empty", value: "_nnull" }
1443
1444
  ]
1444
1445
  };
1445
- function Mu(n) {
1446
- for (const o of Object.values(Pu)) {
1446
+ function Ou(n) {
1447
+ for (const o of Object.values(Mu)) {
1447
1448
  const h = o.find((d) => d.value === n);
1448
1449
  if (h) return h.label;
1449
1450
  }
@@ -1465,7 +1466,7 @@ function Pr({
1465
1466
  }) {
1466
1467
  const q = St(), { data: N } = ne({
1467
1468
  queryKey: ["cbv-collection-meta", n],
1468
- queryFn: () => q.request(J(`/collections/${n}`)).then((I) => I.data),
1469
+ queryFn: () => q.request(G(`/collections/${n}`)).then((I) => I.data),
1469
1470
  staleTime: 10 * 6e4,
1470
1471
  retry: !1
1471
1472
  }), [L, K] = _(/* @__PURE__ */ new Set());
@@ -1534,7 +1535,7 @@ function eo({
1534
1535
  }) {
1535
1536
  const $ = St(), q = n.relation.many_collection ?? "", { data: N } = ne({
1536
1537
  queryKey: ["cbv-collection-meta", q],
1537
- queryFn: () => $.request(J(`/collections/${q}`)).then((K) => K.data),
1538
+ queryFn: () => $.request(G(`/collections/${q}`)).then((K) => K.data),
1538
1539
  staleTime: 10 * 6e4,
1539
1540
  enabled: n.kind === "m2m" && !!q,
1540
1541
  retry: !1
@@ -1565,7 +1566,7 @@ function zl(n, o, h) {
1565
1566
  const d = n.type ?? "string";
1566
1567
  return d === "integer" || d === "decimal" || d === "float" ? "number" : d === "datetime" || d === "timestamp" ? "date" : d;
1567
1568
  }
1568
- function Ou({
1569
+ function Au({
1569
1570
  collection: n,
1570
1571
  path: o,
1571
1572
  pathLabels: h,
@@ -1576,7 +1577,7 @@ function Ou({
1576
1577
  }) {
1577
1578
  const q = St(), { data: N } = ne({
1578
1579
  queryKey: ["cbv-collection-meta", n],
1579
- queryFn: () => q.request(J(`/collections/${n}`)).then((m) => m.data),
1580
+ queryFn: () => q.request(G(`/collections/${n}`)).then((m) => m.data),
1580
1581
  staleTime: 10 * 6e4,
1581
1582
  retry: !1
1582
1583
  }), L = be(() => {
@@ -1596,7 +1597,7 @@ function Ou({
1596
1597
  }, [N, n]), K = _a({
1597
1598
  queries: L.map((m) => ({
1598
1599
  queryKey: ["cbv-collection-meta", m],
1599
- queryFn: () => q.request(J(`/collections/${m}`)).then((E) => E.data),
1600
+ queryFn: () => q.request(G(`/collections/${m}`)).then((E) => E.data),
1600
1601
  staleTime: 10 * 6e4,
1601
1602
  retry: !1,
1602
1603
  enabled: !!d
@@ -1715,7 +1716,7 @@ function Ou({
1715
1716
  m.key
1716
1717
  )) });
1717
1718
  }
1718
- function Au({
1719
+ function Iu({
1719
1720
  target: n,
1720
1721
  selected: o,
1721
1722
  labels: h,
@@ -1723,15 +1724,15 @@ function Au({
1723
1724
  }) {
1724
1725
  const w = St(), [S, $] = _(""), { data: q } = ne({
1725
1726
  queryKey: ["cbv-collection-meta", n],
1726
- queryFn: () => w.request(J(`/collections/${n}`)).then((y) => y.data),
1727
+ queryFn: () => w.request(G(`/collections/${n}`)).then((y) => y.data),
1727
1728
  staleTime: 10 * 6e4,
1728
1729
  retry: !1
1729
- }), N = Yn(q), L = (q == null ? void 0 : q.display_template) ?? null, { data: K = [], isLoading: V } = ne({
1730
+ }), N = Jn(q), L = (q == null ? void 0 : q.display_template) ?? null, { data: K = [], isLoading: V } = ne({
1730
1731
  queryKey: ["cbv-filter-options", n, N, L ?? ""],
1731
1732
  queryFn: () => {
1732
1733
  const y = Rr(L, N);
1733
1734
  return w.request(
1734
- J(`/items/${n}`, {
1735
+ G(`/items/${n}`, {
1735
1736
  limit: 500,
1736
1737
  sort: N,
1737
1738
  picker: "1",
@@ -1786,7 +1787,7 @@ function Au({
1786
1787
  ] })
1787
1788
  ] });
1788
1789
  }
1789
- function Iu(n) {
1790
+ function Ku(n) {
1790
1791
  var h, d;
1791
1792
  const o = n.pathLabels.join(" › ");
1792
1793
  if (Array.isArray(n.value)) {
@@ -1805,9 +1806,9 @@ function Iu(n) {
1805
1806
  const w = ((h = La.find((S) => S.value === n.value)) == null ? void 0 : h.label) ?? String(n.value);
1806
1807
  return { field: o, op: "in the", value: `${w} (rolling)` };
1807
1808
  }
1808
- return (d = n.path[0]) != null && d.startsWith("$has_") || n.path[0] === "$missing_required" ? { field: o, op: "", value: "" } : { field: o, op: Mu(n.op).toLowerCase(), value: String(n.value ?? "") };
1809
+ return (d = n.path[0]) != null && d.startsWith("$has_") || n.path[0] === "$missing_required" ? { field: o, op: "", value: "" } : { field: o, op: Ou(n.op).toLowerCase(), value: String(n.value ?? "") };
1809
1810
  }
1810
- function Ku({
1811
+ function ju({
1811
1812
  collection: n,
1812
1813
  meta: o,
1813
1814
  search: h,
@@ -1819,12 +1820,12 @@ function Ku({
1819
1820
  collection: n,
1820
1821
  path: [],
1821
1822
  pathLabels: []
1822
- }), [I, u] = _(null), [y, Q] = _("_contains"), [F, m] = _(""), [E, P] = _(""), [M, T] = _([]), [de, me] = _({}), [we, Ae] = _(null), G = fe(null);
1823
+ }), [I, u] = _(null), [y, Q] = _("_contains"), [F, m] = _(""), [E, P] = _(""), [M, T] = _([]), [de, me] = _({}), [we, Ae] = _(null), Y = fe(null);
1823
1824
  pe(() => {
1824
1825
  if (!$) return;
1825
1826
  const k = (ee) => {
1826
1827
  var xe;
1827
- (xe = G.current) != null && xe.contains(ee.target) || q(!1);
1828
+ (xe = Y.current) != null && xe.contains(ee.target) || q(!1);
1828
1829
  }, le = (ee) => {
1829
1830
  ee.key === "Escape" && q(!1);
1830
1831
  };
@@ -1879,7 +1880,7 @@ function Ku({
1879
1880
  if (I.relTarget !== void 0) return "relation";
1880
1881
  const k = I.fieldType;
1881
1882
  return k === "integer" || k === "decimal" || k === "float" ? "number" : k === "date" || k === "datetime" || k === "timestamp" ? "date" : k === "boolean" ? "boolean" : "string";
1882
- })(), Pe = Xl, We = [
1883
+ })(), Me = Xl, We = [
1883
1884
  { value: "_contains", label: "Contains" },
1884
1885
  { value: "_ncontains", label: "Doesn't contain" },
1885
1886
  { value: "_eq", label: "Equals" },
@@ -1914,7 +1915,7 @@ function Ku({
1914
1915
  }
1915
1916
  )
1916
1917
  ] }),
1917
- /* @__PURE__ */ c("div", { className: "relative shrink-0", ref: G, children: [
1918
+ /* @__PURE__ */ c("div", { className: "relative shrink-0", ref: Y, children: [
1918
1919
  /* @__PURE__ */ a(
1919
1920
  "button",
1920
1921
  {
@@ -1981,7 +1982,7 @@ function Ku({
1981
1982
  k
1982
1983
  )) }),
1983
1984
  /* @__PURE__ */ a(
1984
- Ou,
1985
+ Au,
1985
1986
  {
1986
1987
  collection: K.collection,
1987
1988
  path: K.path,
@@ -2016,7 +2017,7 @@ function Ku({
2016
2017
  ),
2017
2018
  Ie === "relation" && I.relTarget ? /* @__PURE__ */ c("div", { className: "pt-2", children: [
2018
2019
  /* @__PURE__ */ a(
2019
- Au,
2020
+ Iu,
2020
2021
  {
2021
2022
  target: I.relTarget,
2022
2023
  selected: M,
@@ -2114,7 +2115,7 @@ function Ku({
2114
2115
  },
2115
2116
  children: [
2116
2117
  /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-1", children: [
2117
- (Ie === "number" ? [...Pe, { value: "_between", label: "Between" }] : We).map((k) => /* @__PURE__ */ a(
2118
+ (Ie === "number" ? [...Me, { value: "_between", label: "Between" }] : We).map((k) => /* @__PURE__ */ a(
2118
2119
  "button",
2119
2120
  {
2120
2121
  type: "button",
@@ -2185,7 +2186,7 @@ function Ku({
2185
2186
  ] })
2186
2187
  ] }),
2187
2188
  w.map((k) => {
2188
- const le = Iu(k);
2189
+ const le = Ku(k);
2189
2190
  return /* @__PURE__ */ c(
2190
2191
  "span",
2191
2192
  {
@@ -2232,7 +2233,7 @@ function Ku({
2232
2233
  ] })
2233
2234
  );
2234
2235
  }
2235
- function ju({
2236
+ function Bu({
2236
2237
  collection: n,
2237
2238
  meta: o,
2238
2239
  onPick: h
@@ -2286,7 +2287,7 @@ function ju({
2286
2287
  ] }, $.field);
2287
2288
  }) });
2288
2289
  }
2289
- function Bu({
2290
+ function Uu({
2290
2291
  collection: n,
2291
2292
  ids: o,
2292
2293
  onDone: h,
@@ -2366,7 +2367,7 @@ function Bu({
2366
2367
  )
2367
2368
  ] });
2368
2369
  }
2369
- function Uu({
2370
+ function zu({
2370
2371
  collection: n,
2371
2372
  selectedIds: o,
2372
2373
  transitions: h,
@@ -2379,7 +2380,7 @@ function Uu({
2379
2380
  }) {
2380
2381
  const L = $a(), K = St(), V = Fa(), I = Vl(), [u, y] = _("actions"), Q = pc([n], $), { data: F = [] } = ne({
2381
2382
  queryKey: ["bulk-recipes", n],
2382
- queryFn: () => K.request(J("/bulk-recipes", { collection: n })).then((f) => f.data ?? []).catch(() => []),
2383
+ queryFn: () => K.request(G("/bulk-recipes", { collection: n })).then((f) => f.data ?? []).catch(() => []),
2383
2384
  staleTime: 6e4
2384
2385
  }), [m, E] = _(null), [P, M] = _(""), T = async () => {
2385
2386
  if (!(!m || !P.trim()))
@@ -2399,9 +2400,9 @@ function Uu({
2399
2400
  var H, te;
2400
2401
  if (f.action_type === "update" && ((H = f.config) != null && H.field)) {
2401
2402
  const oe = f.config;
2402
- mt(async (ae) => {
2403
+ mt(async (re) => {
2403
2404
  const qe = await K.request(
2404
- he(`/items/${n}/bulk-update?progress=${ae}`, {
2405
+ he(`/items/${n}/bulk-update?progress=${re}`, {
2405
2406
  ids: o,
2406
2407
  data: { [String(oe.field)]: oe.value ?? "" }
2407
2408
  })
@@ -2409,54 +2410,54 @@ function Uu({
2409
2410
  return `${f.name}: updated ${qe.updated} items${qe.skipped ? ` · ${qe.skipped} already there` : ""}${qe.refused ? ` · ${qe.refused} locked on their form` : ""}`;
2410
2411
  });
2411
2412
  } else if (f.action_type === "transition" && ((te = f.config) != null && te.transition_label)) {
2412
- if (!h.find((ae) => {
2413
+ if (!h.find((re) => {
2413
2414
  var qe;
2414
- return ae.label === ((qe = f.config) == null ? void 0 : qe.transition_label);
2415
+ return re.label === ((qe = f.config) == null ? void 0 : qe.transition_label);
2415
2416
  })) {
2416
2417
  Xe(`"${f.config.transition_label}" is not an available transition here`);
2417
2418
  return;
2418
2419
  }
2419
- mt(async (ae) => {
2420
+ mt(async (re) => {
2420
2421
  const qe = await K.request(
2421
- he(`/items/${n}/bulk-transition?progress=${ae}`, {
2422
+ he(`/items/${n}/bulk-transition?progress=${re}`, {
2422
2423
  ids: o,
2423
- transition_ids: h.filter((ht) => {
2424
+ transition_ids: h.filter((gt) => {
2424
2425
  var It;
2425
- return ht.label === ((It = f.config) == null ? void 0 : It.transition_label);
2426
- }).map((ht) => ht.id)
2426
+ return gt.label === ((It = f.config) == null ? void 0 : It.transition_label);
2427
+ }).map((gt) => gt.id)
2427
2428
  })
2428
2429
  );
2429
2430
  return qe.failed > 0 ? `${f.name}: ${qe.succeeded} done, ${qe.failed} failed` : `${f.name}: transitioned ${qe.succeeded} items`;
2430
2431
  });
2431
2432
  }
2432
- }, [me, we] = _(""), [Ae, G] = _(""), Be = be(() => {
2433
+ }, [me, we] = _(""), [Ae, Y] = _(""), Be = be(() => {
2433
2434
  var H;
2434
2435
  const f = /* @__PURE__ */ new Map();
2435
2436
  for (const te of h) {
2436
- const oe = ((H = te.label) == null ? void 0 : H.trim()) || "Move", ae = f.get(oe) ?? {
2437
+ const oe = ((H = te.label) == null ? void 0 : H.trim()) || "Move", re = f.get(oe) ?? {
2437
2438
  label: oe,
2438
2439
  ids: [],
2439
2440
  noteRequired: !1,
2440
2441
  targets: /* @__PURE__ */ new Map()
2441
2442
  };
2442
- ae.ids.push(te.id), te.comment_mode === "required" && (ae.noteRequired = !0);
2443
+ re.ids.push(te.id), te.comment_mode === "required" && (re.noteRequired = !0);
2443
2444
  const qe = String(te.to_state ?? "");
2444
- ae.targets.set(qe, [...ae.targets.get(qe) ?? [], te.id]), f.set(oe, ae);
2445
+ re.targets.set(qe, [...re.targets.get(qe) ?? [], te.id]), f.set(oe, re);
2445
2446
  }
2446
2447
  return [...f.values()];
2447
2448
  }, [h]), Se = Be.find((f) => f.label === me) ?? null, [X, $e] = _(""), it = (f) => d.find((H) => String(H.id).toUpperCase() === f.toUpperCase()), at = Se ? [...Se.targets.keys()].filter(Boolean).sort((f, H) => {
2448
2449
  var te, oe;
2449
2450
  return Number(((te = it(f)) == null ? void 0 : te.sort) ?? 0) - Number(((oe = it(H)) == null ? void 0 : oe.sort) ?? 0);
2450
- }) : [], Ie = at.length > 1, Pe = Se ? Ie ? X ? Se.targets.get(X) ?? [] : [] : Se.ids : [], We = Pe.length ? `${Pe.join(",")}|${o.join(",")}` : "", { data: k, isFetching: le } = ne({
2451
+ }) : [], Ie = at.length > 1, Me = Se ? Ie ? X ? Se.targets.get(X) ?? [] : [] : Se.ids : [], We = Me.length ? `${Me.join(",")}|${o.join(",")}` : "", { data: k, isFetching: le } = ne({
2451
2452
  queryKey: ["bulk-transition-preview", n, We],
2452
2453
  queryFn: () => K.request(
2453
2454
  he(`/items/${n}/bulk-transition?dry_run=1`, {
2454
2455
  ids: o,
2455
- transition_ids: Pe,
2456
+ transition_ids: Me,
2456
2457
  comment: "(preview)"
2457
2458
  })
2458
2459
  ),
2459
- enabled: u === "transition" && Pe.length > 0,
2460
+ enabled: u === "transition" && Me.length > 0,
2460
2461
  staleTime: 15e3,
2461
2462
  retry: !1
2462
2463
  }), [ee, xe] = _(!1), [rt, Xe] = _(null), mt = async (f) => {
@@ -2517,9 +2518,9 @@ function Uu({
2517
2518
  "button",
2518
2519
  {
2519
2520
  type: "button",
2520
- disabled: ee || f.action_type === "transition" && !h.some((ae) => {
2521
+ disabled: ee || f.action_type === "transition" && !h.some((re) => {
2521
2522
  var qe;
2522
- return ae.label === ((qe = f.config) == null ? void 0 : qe.transition_label);
2523
+ return re.label === ((qe = f.config) == null ? void 0 : qe.transition_label);
2523
2524
  }),
2524
2525
  onClick: () => de(f),
2525
2526
  title: f.action_type === "update" ? `Set ${(H = f.config) == null ? void 0 : H.field} = ${(te = f.config) == null ? void 0 : te.value}` : `Transition: ${(oe = f.config) == null ? void 0 : oe.transition_label}`,
@@ -2567,7 +2568,7 @@ function Uu({
2567
2568
  targets: o.map((f) => ({ collection: n, id: f })),
2568
2569
  fields: w,
2569
2570
  relations: S,
2570
- renderValue: (f, H, te, oe) => Qu(n, f, H, te, oe),
2571
+ renderValue: (f, H, te, oe) => Wu(n, f, H, te, oe),
2571
2572
  className: "h-8 rounded-md border border-white/20 dark:border-border px-3 text-[12.5px] font-medium hover:bg-white/10 dark:hover:bg-muted"
2572
2573
  }
2573
2574
  ),
@@ -2635,7 +2636,7 @@ function Uu({
2635
2636
  )
2636
2637
  ] }),
2637
2638
  u === "merge" && /* @__PURE__ */ a(
2638
- Bu,
2639
+ Uu,
2639
2640
  {
2640
2641
  collection: n,
2641
2642
  ids: o.slice(0, 2),
@@ -2661,17 +2662,17 @@ function Uu({
2661
2662
  {
2662
2663
  className: "flex items-center gap-1.5",
2663
2664
  onSubmit: (f) => {
2664
- if (f.preventDefault(), !Se || Pe.length === 0 || Se.noteRequired && !Ae.trim()) return;
2665
+ if (f.preventDefault(), !Se || Me.length === 0 || Se.noteRequired && !Ae.trim()) return;
2665
2666
  const H = Ae.trim();
2666
2667
  mt(async (te) => {
2667
2668
  const oe = await K.request(
2668
2669
  he(`/items/${n}/bulk-transition?progress=${te}`, {
2669
2670
  ids: o,
2670
- transition_ids: Pe,
2671
+ transition_ids: Me,
2671
2672
  ...H ? { comment: H } : {}
2672
2673
  })
2673
2674
  );
2674
- return G(""), oe.failed > 0 ? `${Se.label}: ${oe.succeeded} done, ${oe.failed} not moved — ${(oe.errors ?? []).slice(0, 3).map((ae) => `${ae.label ?? `#${ae.item}`}: ${ae.error}`).join("; ")}` : `${Se.label}: ${oe.succeeded} done`;
2675
+ return Y(""), oe.failed > 0 ? `${Se.label}: ${oe.succeeded} done, ${oe.failed} not moved — ${(oe.errors ?? []).slice(0, 3).map((re) => `${re.label ?? `#${re.item}`}: ${re.error}`).join("; ")}` : `${Se.label}: ${oe.succeeded} done`;
2675
2676
  });
2676
2677
  },
2677
2678
  children: [
@@ -2713,7 +2714,7 @@ function Uu({
2713
2714
  "input",
2714
2715
  {
2715
2716
  value: Ae,
2716
- onChange: (f) => G(f.target.value),
2717
+ onChange: (f) => Y(f.target.value),
2717
2718
  placeholder: Se.noteRequired ? "Note for every record (required)" : "Note for every record (optional)",
2718
2719
  "aria-label": "Note for every selected record",
2719
2720
  maxLength: 2e3,
@@ -2724,12 +2725,12 @@ function Uu({
2724
2725
  "button",
2725
2726
  {
2726
2727
  type: "submit",
2727
- disabled: ee || !Se || Pe.length === 0 || k != null && k.succeeded === 0 || Se.noteRequired && !Ae.trim(),
2728
+ disabled: ee || !Se || Me.length === 0 || k != null && k.succeeded === 0 || Se.noteRequired && !Ae.trim(),
2728
2729
  className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-semibold text-[#0f1e2d] disabled:opacity-50",
2729
2730
  children: k && !le ? `Run (${k.succeeded})` : "Run"
2730
2731
  }
2731
2732
  ),
2732
- Pe.length > 0 && /* @__PURE__ */ a(
2733
+ Me.length > 0 && /* @__PURE__ */ a(
2733
2734
  "span",
2734
2735
  {
2735
2736
  role: "status",
@@ -2851,7 +2852,7 @@ function Uu({
2851
2852
  }
2852
2853
  );
2853
2854
  }
2854
- const zu = {
2855
+ const Qu = {
2855
2856
  state: "badge",
2856
2857
  entered: "date",
2857
2858
  aging: "short",
@@ -2863,7 +2864,7 @@ const zu = {
2863
2864
  tasks: "short",
2864
2865
  addendums: "short"
2865
2866
  };
2866
- function D0({
2867
+ function M0({
2867
2868
  collection: n,
2868
2869
  quickFilters: o = [],
2869
2870
  initialColumns: h,
@@ -2894,30 +2895,30 @@ function D0({
2894
2895
  }
2895
2896
  vd(`cbv:${n}`, M);
2896
2897
  }, [n, M]);
2897
- const me = fe(sd()), [we, Ae] = _(m ? m.q ?? "" : S), G = wl(we.trim(), 350), [Be, Se] = _(
2898
+ const me = fe(sd()), [we, Ae] = _(m ? m.q ?? "" : S), Y = wl(we.trim(), 350), [Be, Se] = _(
2898
2899
  E ? E.filters : $ ?? []
2899
- ), [X, $e] = _(m ? m.s ?? "" : d ?? ""), [it, at] = _(h ?? null), [Ie, Pe] = _({}), [We, k] = _({}), [le, ee] = _(null), [xe, rt] = _({}), [Xe, mt] = _({}), [Lt, f] = _({}), [H, te] = _({}), [oe, ae] = _(null), [qe, ht] = _(!1), It = fe(null), [Cn, st] = _(
2900
+ ), [X, $e] = _(m ? m.s ?? "" : d ?? ""), [it, at] = _(h ?? null), [Ie, Me] = _({}), [We, k] = _({}), [le, ee] = _(null), [xe, rt] = _({}), [Xe, mt] = _({}), [Lt, f] = _({}), [H, te] = _({}), [oe, re] = _(null), [qe, gt] = _(!1), It = fe(null), [Cn, st] = _(
2900
2901
  () => (m == null ? void 0 : m.qf) ?? {}
2901
- ), [gt, Kt] = _(
2902
+ ), [xt, Kt] = _(
2902
2903
  () => (m == null ? void 0 : m.qf) ?? {}
2903
2904
  ), [Ft, dn] = _(
2904
2905
  m ? m.lc ?? [] : q ?? []
2905
- ), { scopes: Rt, ready: $n } = Xd(), [Je, jt] = _(!1), [qn, Gn] = _(/* @__PURE__ */ new Set()), [Ve, Qt] = _(
2906
+ ), { scopes: Rt, ready: $n } = Xd(), [Je, jt] = _(!1), [qn, Xn] = _(/* @__PURE__ */ new Set()), [Ve, Qt] = _(
2906
2907
  () => (m == null ? void 0 : m.cf) ?? {}
2907
- ), xt = Fi("drill.browser"), lt = xt.value, [Tn, cn] = _(null), [un, en] = _(!1), [tn, Xn] = _(() => {
2908
+ ), vt = Fi("drill.browser"), lt = vt.value, [Tn, cn] = _(null), [un, en] = _(!1), [tn, Zn] = _(() => {
2908
2909
  try {
2909
2910
  return localStorage.getItem("nvr_table_density") === "comfortable" ? "comfortable" : "compact";
2910
2911
  } catch {
2911
2912
  return "compact";
2912
2913
  }
2913
- }), Zn = () => {
2914
+ }), ea = () => {
2914
2915
  const e = tn === "compact" ? "comfortable" : "compact";
2915
- Xn(e);
2916
+ Zn(e);
2916
2917
  try {
2917
2918
  localStorage.setItem("nvr_table_density", e);
2918
2919
  } catch {
2919
2920
  }
2920
- }, [ce, ea] = _(() => {
2921
+ }, [ce, ta] = _(() => {
2921
2922
  if (m) return m.g ?? null;
2922
2923
  try {
2923
2924
  return localStorage.getItem(`nvr_cbv_group_${n}`) || null;
@@ -2925,12 +2926,12 @@ function D0({
2925
2926
  return null;
2926
2927
  }
2927
2928
  }), [pn, mn] = _(!1), Ln = fe(null), [Fn, Rn] = _(/* @__PURE__ */ new Set()), g = (e) => {
2928
- ea(e), Rn(/* @__PURE__ */ new Set()), mn(!1), T(1);
2929
+ ta(e), Rn(/* @__PURE__ */ new Set()), mn(!1), T(1);
2929
2930
  try {
2930
2931
  e ? localStorage.setItem(`nvr_cbv_group_${n}`, e) : localStorage.removeItem(`nvr_cbv_group_${n}`);
2931
2932
  } catch {
2932
2933
  }
2933
- }, [R, Z] = _(!1), [ue, Ke] = _(""), [re, nn] = _(null), Wt = Nt({
2934
+ }, [R, Z] = _(!1), [ue, Ke] = _(""), [ae, nn] = _(null), Wt = Nt({
2934
2935
  mutationFn: (e) => u.request(he("/ai/query", { collection: n, prompt: e, limit: 200 })),
2935
2936
  onSuccess: (e) => {
2936
2937
  var t;
@@ -2972,7 +2973,7 @@ function D0({
2972
2973
  }, [Ma]);
2973
2974
  const jr = fe(null), Br = fe(null), Ur = !m && ((q == null ? void 0 : q.length) ?? 0) > 0, Oa = fe(!!m || Ur), { isAdmin: Ct } = $a(), zr = fe(n);
2974
2975
  pe(() => {
2975
- zr.current !== n && (zr.current = n, T(1), Ae(S), Se([]), $e(d ?? ""), at(h ?? null), Pe({}), k({}), rt({}), mt({}), rn([]), Dn(null), st({}), Kt({}), Qt({}), dn([]), lt != null && lt.length && xt.back(lt.length), cn(null), Oa.current = !1);
2976
+ zr.current !== n && (zr.current = n, T(1), Ae(S), Se([]), $e(d ?? ""), at(h ?? null), Me({}), k({}), rt({}), mt({}), rn([]), Dn(null), st({}), Kt({}), Qt({}), dn([]), lt != null && lt.length && vt.back(lt.length), cn(null), Oa.current = !1);
2976
2977
  }, [n]), pe(() => {
2977
2978
  if (!un) return;
2978
2979
  const e = (t) => {
@@ -2990,21 +2991,21 @@ function D0({
2990
2991
  }, [pn]);
2991
2992
  const { data: A } = ne({
2992
2993
  queryKey: ["cbv-collection-meta", n],
2993
- queryFn: () => u.request(J(`/collections/${n}`)).then((e) => e.data),
2994
+ queryFn: () => u.request(G(`/collections/${n}`)).then((e) => e.data),
2994
2995
  staleTime: 10 * 6e4,
2995
2996
  retry: !1
2996
- }), Et = be(() => ((A == null ? void 0 : A.fields) ?? []).filter((e) => !e.hidden), [A]), De = (A == null ? void 0 : A.browser_config) ?? {}, Fe = (nl = De.fulfilment) != null && nl.shipped_field && ((al = De.fulfilment) != null && al.requested_field) ? De.fulfilment : null, Qr = fe(!!m);
2997
+ }), Et = be(() => ((A == null ? void 0 : A.fields) ?? []).filter((e) => !e.hidden), [A]), Pe = (A == null ? void 0 : A.browser_config) ?? {}, Fe = (nl = Pe.fulfilment) != null && nl.shipped_field && ((al = Pe.fulfilment) != null && al.requested_field) ? Pe.fulfilment : null, Qr = fe(!!m);
2997
2998
  pe(() => {
2998
- Qr.current || !A || (Qr.current = !0, !d && !X && De.default_sort && $e(De.default_sort));
2999
+ Qr.current || !A || (Qr.current = !0, !d && !X && Pe.default_sort && $e(Pe.default_sort));
2999
3000
  }, [A]);
3000
- const Dt = De.checkbox_selection !== !1, Wr = De.show_actions !== !1, [vt, ro] = _(!1), so = () => {
3001
- vt && rn([]), ro(!vt);
3002
- }, ta = V && De.allow_create !== !1, Vr = typeof De.create_label == "string" && De.create_label.trim().slice(0, 40) || "New item", na = tc(ta && !(A != null && A.singleton) ? n : null), [Aa, Pn] = _(!1), [Ia, aa] = _(null), { steps: Ka } = tu(
3003
- ta && !(A != null && A.singleton) ? n : null,
3001
+ const Dt = Pe.checkbox_selection !== !1, Wr = Pe.show_actions !== !1, [kt, ro] = _(!1), so = () => {
3002
+ kt && rn([]), ro(!kt);
3003
+ }, na = V && Pe.allow_create !== !1, Vr = typeof Pe.create_label == "string" && Pe.create_label.trim().slice(0, 40) || "New item", aa = tc(na && !(A != null && A.singleton) ? n : null), [Aa, Pn] = _(!1), [Ia, ra] = _(null), { steps: Ka } = nu(
3004
+ na && !(A != null && A.singleton) ? n : null,
3004
3005
  null
3005
3006
  ), Hr = (e) => {
3006
3007
  e ? Q({ collection: n, itemId: "new", layoutSlug: e }) : on("new");
3007
- }, Mn = Xc(ta && !(A != null && A.singleton) ? n : null), lo = Ri(), Yr = fe(null), [oo, io] = _(null), [Jr, Gr] = _(!1), Xr = (e) => {
3008
+ }, Mn = Zc(na && !(A != null && A.singleton) ? n : null), lo = Ri(), Yr = fe(null), [oo, io] = _(null), [Jr, Gr] = _(!1), Xr = (e) => {
3008
3009
  var t;
3009
3010
  io(e), (t = Yr.current) == null || t.click();
3010
3011
  }, co = async (e) => {
@@ -3012,7 +3013,7 @@ function D0({
3012
3013
  if (e.target.value = "", !!t.length) {
3013
3014
  Gr(!0);
3014
3015
  try {
3015
- const r = await Zc(lo, t, n);
3016
+ const r = await eu(lo, t, n);
3016
3017
  Q({ collection: n, itemId: "new", layoutSlug: oo, query: { autofill: r } });
3017
3018
  } catch (r) {
3018
3019
  _l(r, "The document could not be read", { action: "New from document" });
@@ -3029,7 +3030,7 @@ function D0({
3029
3030
  };
3030
3031
  return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
3031
3032
  }, [Aa]);
3032
- const He = m != null && m.ps ? m.ps : De.page_size && De.page_size > 0 ? Math.min(De.page_size, 200) : w, Pt = o.length > 0 ? o : De.quick_filters ?? [];
3033
+ const He = m != null && m.ps ? m.ps : Pe.page_size && Pe.page_size > 0 ? Math.min(Pe.page_size, 200) : w, Pt = o.length > 0 ? o : Pe.quick_filters ?? [];
3033
3034
  pe(() => {
3034
3035
  if (Je || !$n || o.length === 0 && !A) return;
3035
3036
  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);
@@ -3057,7 +3058,7 @@ function D0({
3057
3058
  (((b = i[x]) == null ? void 0 : b.length) ?? 0) > 0 || (i[x] = v);
3058
3059
  return i;
3059
3060
  };
3060
- st(s), Kt(s), Gn(new Set(Object.keys(r)));
3061
+ st(s), Kt(s), Xn(new Set(Object.keys(r)));
3061
3062
  }
3062
3063
  jt(!0);
3063
3064
  })();
@@ -3065,17 +3066,17 @@ function D0({
3065
3066
  const es = (e) => {
3066
3067
  const t = Tl(Rt, { key: e.key, collection: e.collection }), r = t ? (Rt == null ? void 0 : Rt.restricted[t.name]) ?? [] : [];
3067
3068
  return r.length > 0 ? r : void 0;
3068
- }, kt = be(() => new Map(Et.map((e) => [e.field, e])), [Et]), Ge = (A == null ? void 0 : A.relations) ?? [], ts = be(() => cd(De.inline_edit), [De.inline_edit]), { data: po } = ne({
3069
+ }, yt = be(() => new Map(Et.map((e) => [e.field, e])), [Et]), Ge = (A == null ? void 0 : A.relations) ?? [], ts = be(() => cd(Pe.inline_edit), [Pe.inline_edit]), { data: po } = ne({
3069
3070
  queryKey: ["my-permissions"],
3070
- queryFn: () => u.request(J("/security/my/permissions")).then((e) => e.data),
3071
+ queryFn: () => u.request(G("/security/my/permissions")).then((e) => e.data),
3071
3072
  enabled: ts.enabled && !Ct,
3072
3073
  staleTime: 5 * 6e4
3073
- }), mo = Ct || $u(po, n), ns = be(
3074
+ }), mo = Ct || qu(po, n), ns = be(
3074
3075
  () => new Map(((A == null ? void 0 : A.fields) ?? []).map((e) => [e.field, e])),
3075
3076
  [A]
3076
- ), as = ou(), rs = (e) => (
3077
+ ), as = iu(), rs = (e) => (
3077
3078
  // Ask-the-table answers are a one-off overlay, not the list's own rows.
3078
- re ? null : md({
3079
+ ae ? null : md({
3079
3080
  config: ts,
3080
3081
  key: e,
3081
3082
  field: ns.get(e),
@@ -3118,7 +3119,7 @@ function D0({
3118
3119
  if (!l) return s;
3119
3120
  const i = ns.get(t);
3120
3121
  return /* @__PURE__ */ a(
3121
- iu,
3122
+ du,
3122
3123
  {
3123
3124
  controller: as,
3124
3125
  cellKey: `${String(e.id)}|${t}`,
@@ -3132,13 +3133,13 @@ function D0({
3132
3133
  }
3133
3134
  );
3134
3135
  }, ve = be(() => (it ?? Et.slice(0, 7).map((t) => t.field)).filter(
3135
- (t) => t.includes(".") || kt.has(t) || t.startsWith("__f:") && !!We[t]
3136
- ), [it, Et, kt, We]), [Ba, ra] = _(null), On = be(
3136
+ (t) => t.includes(".") || yt.has(t) || t.startsWith("__f:") && !!We[t]
3137
+ ), [it, Et, yt, We]), [Ba, sa] = _(null), On = be(
3137
3138
  () => Ba ?? (ve[0] ? { [ve[0]]: "left" } : {}),
3138
3139
  [Ba, ve]
3139
3140
  ), $t = (e) => On[e], ho = (e) => {
3140
3141
  const t = { ...On }, r = t[e];
3141
- r ? r === "left" ? t[e] = "right" : delete t[e] : t[e] = "left", ra(t);
3142
+ r ? r === "left" ? t[e] = "right" : delete t[e] : t[e] = "left", sa(t);
3142
3143
  }, Ze = (e) => Ie[e] ?? (e.startsWith("__f:") ? We[e] ?? "Formula" : e.includes(".") ? e.split(".").map(je).join(" › ") : e === "id" ? "ID" : je(e)), ss = (e, t) => {
3143
3144
  var s, l, i;
3144
3145
  const r = t.includes(".") ? (i = (l = (s = Te == null ? void 0 : Te.rows) == null ? void 0 : s[String(e.id)]) == null ? void 0 : l[t]) == null ? void 0 : i.value : e[t];
@@ -3157,7 +3158,7 @@ function D0({
3157
3158
  () => ve.filter((e) => !e.includes(".")).map((e) => ({ field: e, info: Sn(Ge, n, e) })).filter(
3158
3159
  (e) => !!e.info
3159
3160
  ),
3160
- [ve, kt, Ge, n]
3161
+ [ve, yt, Ge, n]
3161
3162
  ), Ua = be(
3162
3163
  () => [
3163
3164
  ...new Set(Yt.map((e) => e.info.relation.many_collection ?? "").filter(Boolean))
@@ -3166,7 +3167,7 @@ function D0({
3166
3167
  ), ls = _a({
3167
3168
  queries: Ua.map((e) => ({
3168
3169
  queryKey: ["cbv-collection-meta", e],
3169
- queryFn: () => u.request(J(`/collections/${e}`)).then((t) => t.data),
3170
+ queryFn: () => u.request(G(`/collections/${e}`)).then((t) => t.data),
3170
3171
  staleTime: 10 * 6e4,
3171
3172
  retry: !1
3172
3173
  }))
@@ -3191,7 +3192,7 @@ function D0({
3191
3192
  ), os = _a({
3192
3193
  queries: za.map((e) => ({
3193
3194
  queryKey: ["cbv-collection-meta", e],
3194
- queryFn: () => u.request(J(`/collections/${e}`)).then((t) => t.data),
3195
+ queryFn: () => u.request(G(`/collections/${e}`)).then((t) => t.data),
3195
3196
  staleTime: 10 * 6e4,
3196
3197
  retry: !1
3197
3198
  }))
@@ -3206,12 +3207,12 @@ function D0({
3206
3207
  for (const t of Yt) {
3207
3208
  const r = t.info.relation.many_collection ?? "";
3208
3209
  if (t.info.kind === "o2m")
3209
- e[t.field] = `${t.field}.${Yn(ln.get(r))}`;
3210
+ e[t.field] = `${t.field}.${Jn(ln.get(r))}`;
3210
3211
  else {
3211
3212
  const s = ln.get(r), l = s == null ? void 0 : s.relations.find(
3212
3213
  (b) => b.many_collection === r && b.many_field === t.info.relation.junction_field
3213
3214
  ), i = (l == null ? void 0 : l.one_collection) ?? "";
3214
- e[t.field] = `${t.field}.${Yn(i ? is.get(i) : void 0)}`;
3215
+ e[t.field] = `${t.field}.${Jn(i ? is.get(i) : void 0)}`;
3215
3216
  }
3216
3217
  }
3217
3218
  return e;
@@ -3227,11 +3228,11 @@ function D0({
3227
3228
  l != null && l.one_collection && (e[t.field] = { kind: "m2m", target: l.one_collection });
3228
3229
  }
3229
3230
  return e;
3230
- }, [Yt, ln]), Qa = wl(Ve, 350), [bn, vo] = _((m == null ? void 0 : m.a) === !0), [cs, ko] = _(null), An = Rc(n, cs), [qt, us] = _(null), { data: In } = wc(n), [Mt, sa] = _(() => (E == null ? void 0 : E.riskIds) ?? []), _e = be(() => {
3231
+ }, [Yt, ln]), Qa = wl(Ve, 350), [bn, vo] = _((m == null ? void 0 : m.a) === !0), [cs, ko] = _(null), An = Ec(n, cs), [qt, us] = _(null), { data: In } = wc(n), [Mt, la] = _(() => (E == null ? void 0 : E.riskIds) ?? []), _e = be(() => {
3231
3232
  var t;
3232
3233
  const e = Bl(Be);
3233
3234
  for (const r of Pt) {
3234
- const s = gt[r.key] ?? [];
3235
+ const s = xt[r.key] ?? [];
3235
3236
  s.length !== 0 && ((t = r.or_paths) != null && t.length ? e.push({
3236
3237
  or: r.or_paths.map((l) => ({ path: l, op: "_in", value: s }))
3237
3238
  }) : e.push({ path: r.path, op: "_in", value: s }));
@@ -3284,7 +3285,7 @@ function D0({
3284
3285
  }, [
3285
3286
  Be,
3286
3287
  Pt,
3287
- gt,
3288
+ xt,
3288
3289
  Qa,
3289
3290
  Ft,
3290
3291
  En,
@@ -3296,14 +3297,14 @@ function D0({
3296
3297
  if (!t || !r) return null;
3297
3298
  const s = e.find((l) => ["name", "title", "label", "short_name"].includes(l.toLowerCase())) ?? null;
3298
3299
  return { latField: t, lngField: r, labelField: s };
3299
- }, [A]), [la, ps] = _(!1), [ms, yo] = _(!1), fs = fe(_e);
3300
+ }, [A]), [oa, ps] = _(!1), [ms, yo] = _(!1), fs = fe(_e);
3300
3301
  pe(() => {
3301
3302
  fs.current !== _e && (fs.current = _e, T(Cl(de.current, 1)));
3302
3303
  }, [_e]);
3303
3304
  const Kn = Object.keys(Xe).filter((e) => !e.includes(".") && !e.startsWith("__")).sort().join(","), bs = (e) => [
3304
3305
  "cbv-items",
3305
3306
  n,
3306
- G,
3307
+ Y,
3307
3308
  X,
3308
3309
  ce ? "grouped" : e,
3309
3310
  ce ? 500 : He,
@@ -3312,18 +3313,18 @@ function D0({
3312
3313
  ], hs = async (e) => {
3313
3314
  const t = {
3314
3315
  limit: ce ? 500 : He,
3315
- ...G ? { search: G } : {},
3316
+ ...Y ? { search: Y } : {},
3316
3317
  ..._e ? { conditions: _e } : {},
3317
3318
  ...Kn ? { agg: Kn } : {},
3318
3319
  // #2443 — the total may be a few seconds old (shown as "about"); rows are always fresh.
3319
3320
  count: "approx"
3320
3321
  }, r = (b) => u.request(
3321
- J(`/items/${n}`, { ...t, page: b, ...X ? { sort: X } : {} })
3322
+ G(`/items/${n}`, { ...t, page: b, ...X ? { sort: X } : {} })
3322
3323
  );
3323
3324
  if (ce) return r(1);
3324
3325
  const s = JSON.stringify([
3325
3326
  n,
3326
- G,
3327
+ Y,
3327
3328
  X,
3328
3329
  He,
3329
3330
  _e,
@@ -3332,7 +3333,7 @@ function D0({
3332
3333
  if (i.after === void 0 && i.sort === X) return r(e);
3333
3334
  try {
3334
3335
  const b = await u.request(
3335
- J(`/items/${n}`, {
3336
+ G(`/items/${n}`, {
3336
3337
  ...t,
3337
3338
  ...i.after !== void 0 ? { after: i.after } : { page: e },
3338
3339
  ...i.sort ? { sort: i.sort } : {}
@@ -3345,8 +3346,8 @@ function D0({
3345
3346
  }
3346
3347
  }, {
3347
3348
  data: ke,
3348
- isLoading: oa,
3349
- isFetching: yt,
3349
+ isLoading: ia,
3350
+ isFetching: ft,
3350
3351
  isPlaceholderData: Wa,
3351
3352
  dataUpdatedAt: wo,
3352
3353
  refetch: Va,
@@ -3357,20 +3358,20 @@ function D0({
3357
3358
  enabled: !!n && Je,
3358
3359
  placeholderData: (e) => e,
3359
3360
  // #2490 — a collection whose live record events are off polls instead (visible tabs only).
3360
- refetchInterval: De.live_events === "off" ? 3e4 : !1,
3361
+ refetchInterval: Pe.live_events === "off" ? 3e4 : !1,
3361
3362
  retry: !1
3362
3363
  }), gs = fe(() => {
3363
3364
  });
3364
3365
  Dd({
3365
3366
  qc: y,
3366
- enabled: !!n && Je && !ce && !G && !yt && !!ke && M * He < (ke.total ?? 0),
3367
+ enabled: !!n && Je && !ce && !Y && !ft && !!ke && M * He < (ke.total ?? 0),
3367
3368
  queryKey: bs(M + 1),
3368
3369
  queryFn: () => hs(M + 1).then((e) => (gs.current(e.data ?? []), e))
3369
3370
  }), pe(() => {
3370
3371
  const e = kd({
3371
3372
  pending: de.current,
3372
3373
  gateOpen: Je,
3373
- fetching: yt,
3374
+ fetching: ft,
3374
3375
  failed: !!et,
3375
3376
  placeholder: Wa,
3376
3377
  loaded: !!ke,
@@ -3380,20 +3381,20 @@ function D0({
3380
3381
  page: M
3381
3382
  });
3382
3383
  e && (de.current = null, e.page != null && T(e.page));
3383
- }, [Je, ke, yt, Wa, M, He, et]);
3384
- const Ce = re ? re.rows : (ke == null ? void 0 : ke.data) ?? [], Me = re ? re.total : (ke == null ? void 0 : ke.total) ?? 0, Bt = !re && !!ke && (ke.total_timed_out === !0 || ke.total == null), jn = !re && (ke == null ? void 0 : ke.total_approx) === !0, Ha = ke == null ? void 0 : ke.aggregates, ia = Bt ? M + (Ce.length >= He ? 1 : 0) : Math.max(1, Math.ceil(Me / He)), [Ya, xs] = _(!1), vs = async () => {
3384
+ }, [Je, ke, ft, Wa, M, He, et]);
3385
+ const Ce = ae ? ae.rows : (ke == null ? void 0 : ke.data) ?? [], Re = ae ? ae.total : (ke == null ? void 0 : ke.total) ?? 0, Bt = !ae && !!ke && (ke.total_timed_out === !0 || ke.total == null), jn = !ae && (ke == null ? void 0 : ke.total_approx) === !0, Ha = ke == null ? void 0 : ke.aggregates, da = Bt ? M + (Ce.length >= He ? 1 : 0) : Math.max(1, Math.ceil(Re / He)), [Ya, xs] = _(!1), vs = async () => {
3385
3386
  if (!jn && !Bt) {
3386
- T(ia);
3387
+ T(da);
3387
3388
  return;
3388
3389
  }
3389
3390
  xs(!0);
3390
3391
  try {
3391
3392
  const e = await u.request(
3392
- J(
3393
+ G(
3393
3394
  `/items/${n}`,
3394
- Kc({ search: G, conditions: _e })
3395
+ jc({ search: Y, conditions: _e })
3395
3396
  )
3396
- ), t = jc(e, He);
3397
+ ), t = Bc(e, He);
3397
3398
  if (t == null) {
3398
3399
  ge("This list is too big to count right now", {
3399
3400
  description: "Use Next to keep going, or narrow the list with a filter."
@@ -3409,14 +3410,14 @@ function D0({
3409
3410
  }, Bn = Pt.filter(
3410
3411
  (e) => {
3411
3412
  var t;
3412
- return qn.has(e.key) && (((t = gt[e.key]) == null ? void 0 : t.length) ?? 0) > 0 && !es(e);
3413
+ return qn.has(e.key) && (((t = xt[e.key]) == null ? void 0 : t.length) ?? 0) > 0 && !es(e);
3413
3414
  }
3414
3415
  ), ks = Bn.map((e) => e.key).join(","), Ja = be(() => {
3415
3416
  if (!ks || !_e) return _e;
3416
3417
  const e = new Set(
3417
3418
  Bn.map((r) => {
3418
3419
  var l;
3419
- const s = gt[r.key] ?? [];
3420
+ const s = xt[r.key] ?? [];
3420
3421
  return JSON.stringify(
3421
3422
  (l = r.or_paths) != null && l.length ? { or: r.or_paths.map((i) => ({ path: i, op: "_in", value: s })) } : { path: r.path, op: "_in", value: s }
3422
3423
  );
@@ -3425,17 +3426,17 @@ function D0({
3425
3426
  (r) => !e.has(JSON.stringify(r))
3426
3427
  );
3427
3428
  return t.length > 0 ? JSON.stringify(t) : void 0;
3428
- }, [ks, _e, gt]), { data: da } = ne({
3429
- queryKey: ["cbv-default-hidden", n, G, Ja],
3430
- enabled: !!n && !re && !!ke && !yt && Me === 0 && Bn.length > 0,
3429
+ }, [ks, _e, xt]), { data: Un } = ne({
3430
+ queryKey: ["cbv-default-hidden", n, Y, Ja],
3431
+ enabled: !!n && !ae && !!ke && !ft && Re === 0 && Bn.length > 0,
3431
3432
  staleTime: 3e4,
3432
3433
  retry: !1,
3433
3434
  queryFn: () => u.request(
3434
- J(`/items/${n}`, {
3435
+ G(`/items/${n}`, {
3435
3436
  limit: 1,
3436
3437
  fields: "id",
3437
3438
  count: "approx",
3438
- ...G ? { search: G } : {},
3439
+ ...Y ? { search: Y } : {},
3439
3440
  ...Ja ? { conditions: Ja } : {}
3440
3441
  })
3441
3442
  ).then((e) => Number(e.total ?? 0))
@@ -3449,21 +3450,21 @@ function D0({
3449
3450
  }, ys = fe(Date.now()), ca = fe(null);
3450
3451
  pe(() => {
3451
3452
  ys.current = Date.now();
3452
- }, [n, G]), pe(() => {
3453
+ }, [n, Y]), pe(() => {
3453
3454
  var t, r;
3454
- if (!n || G.length < 2 || !ke || yt || re) return;
3455
- const e = `${n}\0${G}`;
3455
+ if (!n || Y.length < 2 || !ke || ft || ae) return;
3456
+ const e = `${n}\0${Y}`;
3456
3457
  ((t = ca.current) == null ? void 0 : t.key) !== e && (ca.current = {
3457
3458
  key: e,
3458
3459
  id: Vd(u, {
3459
3460
  surface: "collection",
3460
3461
  collection: n,
3461
- query: G,
3462
+ query: Y,
3462
3463
  result_count: ke.total ?? ((r = ke.data) == null ? void 0 : r.length) ?? 0,
3463
3464
  duration_ms: Date.now() - ys.current
3464
3465
  })
3465
3466
  });
3466
- }, [u, n, G, ke, yt, re]), lc(
3467
+ }, [u, n, Y, ke, ft, ae]), lc(
3467
3468
  n ? {
3468
3469
  list: {
3469
3470
  collection: n,
@@ -3475,18 +3476,18 @@ function D0({
3475
3476
  value: e.value,
3476
3477
  ...e.not ? { not: !0 } : {}
3477
3478
  })),
3478
- search: G || null,
3479
- total: Me
3479
+ search: Y || null,
3480
+ total: Re
3480
3481
  }
3481
3482
  } : null
3482
3483
  );
3483
- const No = oc(), ws = Ei(yt), Ga = Di({
3484
- pending: yt,
3484
+ const No = oc(), ws = Ei(ft), Ga = Di({
3485
+ pending: ft,
3485
3486
  request: n ? { method: "GET", url: `/items/${n}` } : null,
3486
3487
  noun: ((A == null ? void 0 : A.display_name) ?? n ?? "").replace(/_/g, " ").toLowerCase() || null,
3487
3488
  // Only a total this person has already been shown (never a raw table count).
3488
- knownRows: yt ? Jd(y.getQueriesData({ queryKey: ["cbv-items", n] })) : null
3489
- }), Xa = Kd(), { userId: Un } = $a(), _s = (e) => Ct || !!Un && String(e.user ?? "").toUpperCase() === String(Un).toUpperCase(), Ot = wd(), Za = fe(/* @__PURE__ */ new Set());
3489
+ knownRows: ft ? Jd(y.getQueriesData({ queryKey: ["cbv-items", n] })) : null
3490
+ }), Xa = Kd(), { userId: zn } = $a(), _s = (e) => Ct || !!zn && String(e.user ?? "").toUpperCase() === String(zn).toUpperCase(), Ot = wd(), Za = fe(/* @__PURE__ */ new Set());
3490
3491
  Za.current = new Set(Ce.map((e) => String(e.id)));
3491
3492
  const So = be(
3492
3493
  () => Ce.slice(0, 100).map((e) => ({ collection: n, item: String(e.id) })),
@@ -3495,7 +3496,7 @@ function D0({
3495
3496
  Ss.current = [
3496
3497
  "cbv-items",
3497
3498
  n,
3498
- G,
3499
+ Y,
3499
3500
  X,
3500
3501
  ce ? "grouped" : M,
3501
3502
  ce ? 500 : He,
@@ -3504,13 +3505,13 @@ function D0({
3504
3505
  ];
3505
3506
  const Cs = fe({
3506
3507
  conditions: _e,
3507
- search: G,
3508
+ search: Y,
3508
3509
  page: M,
3509
3510
  grouped: !!ce
3510
3511
  });
3511
3512
  Cs.current = {
3512
3513
  conditions: _e,
3513
- search: G,
3514
+ search: Y,
3514
3515
  page: M,
3515
3516
  grouped: !!ce
3516
3517
  };
@@ -3520,10 +3521,10 @@ function D0({
3520
3521
  const e = (D = 1) => nr((z) => z + D), t = /* @__PURE__ */ new Map();
3521
3522
  let r = null;
3522
3523
  const s = (D) => {
3523
- const z = (Y) => t.set(JSON.stringify(Y), Y);
3524
- D.includes(_n.tasks) && z(["cbv-task-counts", n]), D.includes(_n.addendums) && z(["cbv-addendum-summary", n]), D.includes(_n.integrations) && z(["cbv-integrations-summary", n]), D.includes(_n.comments) && z(["row-comment-counts", n]), D.includes(_n.state) && (z(["cbv-pipeline-instances", n]), z(["cbv-owners", n]), z(["cbv-view-count", n])), D.includes(_n.lock) && $o((Y) => Y + 1), !r && (r = setTimeout(() => {
3524
+ const z = (J) => t.set(JSON.stringify(J), J);
3525
+ D.includes(_n.tasks) && z(["cbv-task-counts", n]), D.includes(_n.addendums) && z(["cbv-addendum-summary", n]), D.includes(_n.integrations) && z(["cbv-integrations-summary", n]), D.includes(_n.comments) && z(["row-comment-counts", n]), D.includes(_n.state) && (z(["cbv-pipeline-instances", n]), z(["cbv-owners", n]), z(["cbv-view-count", n])), D.includes(_n.lock) && $o((J) => J + 1), !r && (r = setTimeout(() => {
3525
3526
  r = null;
3526
- for (const Y of t.values()) y.invalidateQueries({ queryKey: Y });
3527
+ for (const J of t.values()) y.invalidateQueries({ queryKey: J });
3527
3528
  t.clear();
3528
3529
  }, 300));
3529
3530
  }, l = (D) => y.setQueryData(
@@ -3539,11 +3540,11 @@ function D0({
3539
3540
  x = null, y.invalidateQueries({ queryKey: ["cbv-view-count", n] });
3540
3541
  }, 1500));
3541
3542
  const z = /* @__PURE__ */ new Map();
3542
- let Y = !1;
3543
+ let J = !1;
3543
3544
  for (const W of D) {
3544
3545
  const ye = String(W.item);
3545
3546
  if (ye === "*") {
3546
- Y = !0;
3547
+ J = !0;
3547
3548
  continue;
3548
3549
  }
3549
3550
  const se = z.get(ye), C = (se == null ? void 0 : se.action) === "delete" || W.action === "delete" ? "delete" : (se == null ? void 0 : se.action) === "create" ? "create" : W.action, B = /* @__PURE__ */ new Set([...(se == null ? void 0 : se.changed_fields) ?? [], ...W.changed_fields ?? []]);
@@ -3553,10 +3554,10 @@ function D0({
3553
3554
  changed_fields: W.changed_fields || se != null && se.changed_fields ? [...B] : void 0
3554
3555
  });
3555
3556
  }
3556
- Y && e();
3557
- const p = Za.current, ft = (W) => Ed(n, W.item), tt = (W) => {
3557
+ J && e();
3558
+ const p = Za.current, bt = (W) => Ed(n, W.item), tt = (W) => {
3558
3559
  const ye = qd(W);
3559
- return ye && Un && ye.toUpperCase() === Un.toUpperCase() ? "self" : ye;
3560
+ return ye && zn && ye.toUpperCase() === zn.toUpperCase() ? "self" : ye;
3560
3561
  }, At = [];
3561
3562
  for (const [W, ye] of z)
3562
3563
  ye.action === "delete" && (p.has(W) ? At.push(W) : e(), z.delete(W));
@@ -3584,12 +3585,12 @@ function D0({
3584
3585
  e();
3585
3586
  continue;
3586
3587
  }
3587
- u.request(J(`/items/${n}/${W}`)).then((se) => {
3588
+ u.request(G(`/items/${n}/${W}`)).then((se) => {
3588
3589
  const C = se == null ? void 0 : se.data;
3589
3590
  C && (l((B) => ({
3590
3591
  ...B,
3591
3592
  data: B.data.map((Ne) => String(Ne.id) === W ? { ...Ne, ...C } : Ne)
3592
- })), ft(ye) || Ot.note([W], tt(C)));
3593
+ })), bt(ye) || Ot.note([W], tt(C)));
3593
3594
  }).catch(() => e());
3594
3595
  }
3595
3596
  return;
@@ -3616,17 +3617,17 @@ function D0({
3616
3617
  O.length > 0 && Ot.forget(O);
3617
3618
  for (const [W] of pt) {
3618
3619
  const ye = z.get(W), se = tt(pt.get(W));
3619
- ye && !ft(ye) && se !== "self" && Ot.note([W], se);
3620
+ ye && !bt(ye) && se !== "self" && Ot.note([W], se);
3620
3621
  }
3621
3622
  for (const { row: W, ev: ye } of nt) {
3622
3623
  const se = String(W.id);
3623
3624
  tt(W) !== "self" && Ot.note([se], tt(W), "create");
3624
3625
  }
3625
3626
  }, j = (D) => {
3626
- for (const z of D.flatMap((Y) => yd(Y))) {
3627
- const Y = z.changed_fields;
3628
- if (!z.action && (Y != null && Y.length) && Y.every((p) => p.startsWith("$"))) {
3629
- (String(z.item) === "*" || Za.current.has(String(z.item))) && s(Y);
3627
+ for (const z of D.flatMap((J) => yd(J))) {
3628
+ const J = z.changed_fields;
3629
+ if (!z.action && (J != null && J.length) && J.every((p) => p.startsWith("$"))) {
3630
+ (String(z.item) === "*" || Za.current.has(String(z.item))) && s(J);
3630
3631
  continue;
3631
3632
  }
3632
3633
  i.push(z);
@@ -3639,7 +3640,7 @@ function D0({
3639
3640
  return () => {
3640
3641
  v = !0, Le(), ad(er), r && clearTimeout(r), b && clearTimeout(b), x && clearTimeout(x);
3641
3642
  };
3642
- }, [Xa, n, y, u, Un, Ot, er]);
3643
+ }, [Xa, n, y, u, zn, Ot, er]);
3643
3644
  const qo = _d(
3644
3645
  n,
3645
3646
  Ce.map((e) => String(e.id)),
@@ -3647,7 +3648,7 @@ function D0({
3647
3648
  ), { data: ua = [] } = ne({
3648
3649
  queryKey: ["cbv-risk-rules", n],
3649
3650
  queryFn: () => u.request(
3650
- J("/at-risk/rules/active", { collection: n })
3651
+ G("/at-risk/rules/active", { collection: n })
3651
3652
  ).then((e) => e.data ?? []).catch(() => []),
3652
3653
  enabled: !!n,
3653
3654
  staleTime: 6e4,
@@ -3668,7 +3669,7 @@ function D0({
3668
3669
  }), Ue = Ce.map((e) => String(e.id)).join(","), Fo = be(
3669
3670
  () => Ce.map((e) => ({ collection: n, id: e.id })),
3670
3671
  [Ce, n]
3671
- ), Ro = cu(Fo, Ct), ar = !!(A != null && A.addendums_enabled), { data: rr } = ne({
3672
+ ), Ro = uu(Fo, Ct), ar = !!(A != null && A.addendums_enabled), { data: rr } = ne({
3672
3673
  queryKey: ["cbv-addendum-summary", n, Ue],
3673
3674
  queryFn: () => u.request(
3674
3675
  he("/addendums/summary", { collection: n, ids: Ue.split(",") })
@@ -3679,7 +3680,7 @@ function D0({
3679
3680
  retry: !1
3680
3681
  }), { data: $s = !1 } = ne({
3681
3682
  queryKey: ["cbv-tasks-used", n],
3682
- queryFn: () => u.request(J("/tasks", { collection: n, limit: 1 })).then((e) => (e.data ?? []).length > 0).catch(() => !1),
3683
+ queryFn: () => u.request(G("/tasks", { collection: n, limit: 1 })).then((e) => (e.data ?? []).length > 0).catch(() => !1),
3683
3684
  enabled: !!n && !n.startsWith("nivaro_"),
3684
3685
  staleTime: 5 * 6e4,
3685
3686
  retry: !1
@@ -3703,7 +3704,7 @@ function D0({
3703
3704
  retry: !1
3704
3705
  }), { data: Eo = [] } = ne({
3705
3706
  queryKey: ["cbv-integrations-collections"],
3706
- queryFn: () => u.request(J("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
3707
+ queryFn: () => u.request(G("/integration-obligations/collections")).then((e) => e.data ?? []).catch(() => []),
3707
3708
  staleTime: 6e4,
3708
3709
  retry: !1
3709
3710
  }), qs = Eo.includes(n), { data: or } = ne({
@@ -3715,21 +3716,21 @@ function D0({
3715
3716
  placeholderData: (e) => e,
3716
3717
  staleTime: 3e4,
3717
3718
  retry: !1
3718
- }), { data: Re } = ne({
3719
+ }), { data: Ee } = ne({
3719
3720
  queryKey: ["cbv-pipeline-instances", n, Ue],
3720
3721
  queryFn: () => u.request(
3721
- J(`/pipelines/instances/${n}`, Ue ? { ids: Ue } : void 0)
3722
+ G(`/pipelines/instances/${n}`, Ue ? { ids: Ue } : void 0)
3722
3723
  ).then((e) => e.data),
3723
3724
  enabled: !!n && Ue.length > 0,
3724
3725
  placeholderData: (e) => e,
3725
3726
  staleTime: 3e4,
3726
3727
  retry: !1
3727
- }), pa = (rl = Re == null ? void 0 : Re.binding) == null ? void 0 : rl.template, { data: wt } = ne({
3728
+ }), pa = (rl = Ee == null ? void 0 : Ee.binding) == null ? void 0 : rl.template, { data: wt } = ne({
3728
3729
  queryKey: ["cbv-pipeline-template", pa, Ct ? "full" : "outline"],
3729
- queryFn: () => u.request(J(Ct ? `/pipelines/${pa}` : `/pipelines/${pa}/outline`)).then((e) => e.data),
3730
+ queryFn: () => u.request(G(Ct ? `/pipelines/${pa}` : `/pipelines/${pa}/outline`)).then((e) => e.data),
3730
3731
  enabled: !!pa,
3731
3732
  retry: !1
3732
- }), Do = !!(Re != null && Re.binding), { data: ir } = ne({
3733
+ }), Do = !!(Ee != null && Ee.binding), { data: ir } = ne({
3733
3734
  queryKey: ["cbv-owners", n, Ue],
3734
3735
  queryFn: () => u.request(
3735
3736
  he(`/pipelines/instance/${n}/owners/batch`, {
@@ -3745,21 +3746,21 @@ function D0({
3745
3746
  ), Ls = be(
3746
3747
  () => ve.filter((e) => e.startsWith("__f:")).flatMap((e) => Zi(We[e] ?? "")).filter((e) => e.includes(".")),
3747
3748
  [ve, We]
3748
- ), zn = be(
3749
+ ), Qn = be(
3749
3750
  () => [.../* @__PURE__ */ new Set([...Ts, ...Object.values(Ye), ...Ls])].slice(
3750
3751
  0,
3751
3752
  20
3752
3753
  ),
3753
3754
  [Ts, Ye, Ls]
3754
3755
  ), Fs = Ce.map((e) => String(e.id)).join(","), Rs = (e) => u.request(
3755
- J(`/items/${n}/resolve-paths`, {
3756
+ G(`/items/${n}/resolve-paths`, {
3756
3757
  ids: e,
3757
- paths: zn.join(",")
3758
+ paths: Qn.join(",")
3758
3759
  })
3759
3760
  ).then((t) => t.data ?? { rows: {}, targets: {} }), { data: Te } = ne({
3760
- queryKey: ["cbv-resolved", n, Fs, zn.join(",")],
3761
+ queryKey: ["cbv-resolved", n, Fs, Qn.join(",")],
3761
3762
  queryFn: () => Rs(Fs),
3762
- enabled: Ce.length > 0 && zn.length > 0,
3763
+ enabled: Ce.length > 0 && Qn.length > 0,
3763
3764
  staleTime: 3e4,
3764
3765
  retry: !1
3765
3766
  }), _t = (e, t) => {
@@ -3785,7 +3786,7 @@ function D0({
3785
3786
  rows: e,
3786
3787
  columns: ve,
3787
3788
  relations: Ge,
3788
- resolveList: zn,
3789
+ resolveList: Qn,
3789
3790
  isResolvedCol: Ut,
3790
3791
  fetchResolved: Rs,
3791
3792
  fetchRelation: (t, r) => Jl(u, t, r),
@@ -3802,7 +3803,7 @@ function D0({
3802
3803
  const l = Ye[e];
3803
3804
  return l ? { kind: "text", path: l.split(".") } : null;
3804
3805
  }
3805
- const s = kt.get(e);
3806
+ const s = yt.get(e);
3806
3807
  return s ? s.computed_formula && !s.computed_store ? s.sql_filterable ? s.sql_kind === "number" ? { kind: "num" } : { kind: "text", path: [e] } : null : s.type === "integer" || s.type === "decimal" || s.type === "float" ? { kind: "num" } : s.type === "boolean" ? { kind: "bool" } : s.type === "date" || s.type === "datetime" || s.type === "timestamp" ? { kind: "date" } : s.interface === "select-dropdown" ? { kind: "enum" } : s.type === "string" || s.type === "text" ? { kind: "text", path: [e] } : null : null;
3807
3808
  }, ze = (e, t) => Qt((r) => {
3808
3809
  const s = { ...r };
@@ -3811,7 +3812,7 @@ function D0({
3811
3812
  var b, x, v, U;
3812
3813
  const { key: t, row: r, cellText: s } = e, l = r.id;
3813
3814
  if (t === "__state__") {
3814
- const j = (b = Re == null ? void 0 : Re.instances) == null ? void 0 : b[String(l)];
3815
+ const j = (b = Ee == null ? void 0 : Ee.instances) == null ? void 0 : b[String(l)];
3815
3816
  if (!(j != null && j.state_key)) return;
3816
3817
  const Le = Ve.__state__, D = (Le == null ? void 0 : Le.kind) === "state" ? Le.value : [];
3817
3818
  ze("__state__", { kind: "state", value: [.../* @__PURE__ */ new Set([...D, j.state_key])] });
@@ -3883,7 +3884,7 @@ function D0({
3883
3884
  b.add(U);
3884
3885
  else v[e] != null && v[e] !== "" && typeof v[e] != "object" && b.add(v[e]);
3885
3886
  return /* @__PURE__ */ a(
3886
- Lu,
3887
+ Fu,
3887
3888
  {
3888
3889
  target: t.target,
3889
3890
  selected: (r == null ? void 0 : r.kind) === "in" ? r.value : [],
@@ -3894,7 +3895,7 @@ function D0({
3894
3895
  }
3895
3896
  if (t.kind === "enum")
3896
3897
  return /* @__PURE__ */ a(
3897
- Fu,
3898
+ Ru,
3898
3899
  {
3899
3900
  collection: n,
3900
3901
  field: e,
@@ -3954,7 +3955,7 @@ function D0({
3954
3955
  className: "w-full"
3955
3956
  }
3956
3957
  ) : t.kind === "date" ? /* @__PURE__ */ a(
3957
- Ru,
3958
+ Eu,
3958
3959
  {
3959
3960
  value: (r == null ? void 0 : r.kind) === "date" ? r.value : "",
3960
3961
  onChange: (b) => ze(e, b ? { kind: "date", value: b } : null)
@@ -3964,12 +3965,12 @@ function D0({
3964
3965
  var r, s;
3965
3966
  if (((r = xe[e]) == null ? void 0 : r.type) === "number") return !0;
3966
3967
  if (e.includes(".") || e in Ye || ot(Ge, n, e)) return !1;
3967
- const t = (s = kt.get(e)) == null ? void 0 : s.type;
3968
+ const t = (s = yt.get(e)) == null ? void 0 : s.type;
3968
3969
  return t === "integer" || t === "decimal" || t === "float";
3969
3970
  }, jo = (e) => {
3970
3971
  var r;
3971
3972
  if (e.includes(".") || e in Ye) return !1;
3972
- const t = String(((r = kt.get(e)) == null ? void 0 : r.type) ?? "").toLowerCase();
3973
+ const t = String(((r = yt.get(e)) == null ? void 0 : r.type) ?? "").toLowerCase();
3973
3974
  return t === "timestamp" || t === "datetime" || t === "date";
3974
3975
  }, xn = (e, t, r) => {
3975
3976
  var l, i, b;
@@ -3984,7 +3985,7 @@ function D0({
3984
3985
  return !!t && (t === "nivaro_files" || /_files$/.test(t));
3985
3986
  }, { data: dt = [] } = ne({
3986
3987
  queryKey: ["cbv-views", n],
3987
- queryFn: () => u.request(J("/saved-views", { collection: n })).then((e) => e.data ?? []),
3988
+ queryFn: () => u.request(G("/saved-views", { collection: n })).then((e) => e.data ?? []),
3988
3989
  staleTime: 3e4
3989
3990
  }), vn = () => y.invalidateQueries({ queryKey: ["cbv-views", n] }), Bo = _a({
3990
3991
  queries: dt.slice(0, 12).map((e) => {
@@ -3992,7 +3993,7 @@ function D0({
3992
3993
  return {
3993
3994
  queryKey: ["cbv-view-count", n, e.id, JSON.stringify(t)],
3994
3995
  queryFn: () => u.request(
3995
- J(`/items/${n}`, {
3996
+ G(`/items/${n}`, {
3996
3997
  limit: 1,
3997
3998
  ...t.length > 0 ? { conditions: JSON.stringify(t) } : {}
3998
3999
  })
@@ -4012,7 +4013,7 @@ function D0({
4012
4013
  var r, s;
4013
4014
  Dn(e.id);
4014
4015
  const t = Ll(e.filters ?? []);
4015
- if (Se(t.filters), sa(t.riskIds), $e(e.sort ?? ""), (r = e.columns) != null && r.length) {
4016
+ if (Se(t.filters), la(t.riskIds), $e(e.sort ?? ""), (r = e.columns) != null && r.length) {
4016
4017
  const l = new Set(
4017
4018
  e.columns.filter((p) => typeof p != "string" && p.admin_only).map(Il)
4018
4019
  );
@@ -4021,16 +4022,16 @@ function D0({
4021
4022
  for (const p of e.columns)
4022
4023
  typeof p != "string" && p.formula && p.key.startsWith("__f:") && (b[p.key] = p.formula);
4023
4024
  k(b);
4024
- const x = i.filter((p) => p.includes(".") || kt.has(p) || !!b[p]);
4025
+ const x = i.filter((p) => p.includes(".") || yt.has(p) || !!b[p]);
4025
4026
  x.length > 0 && at(x);
4026
4027
  const v = {}, U = {}, j = {};
4027
4028
  let Le = !1;
4028
- const D = {}, z = {}, Y = {};
4029
+ const D = {}, z = {}, J = {};
4029
4030
  for (const p of e.columns)
4030
- typeof p != "string" && p.label && (v[p.key] = p.label), typeof p != "string" && p.format && (U[p.key] = p.format), typeof p != "string" && p.pin && (Le = !0, p.pin !== "none" && (j[p.key] = p.pin)), typeof p != "string" && ((s = p.tint) != null && s.length) && (D[p.key] = p.tint), typeof p != "string" && p.width && (z[p.key] = p.width), typeof p != "string" && p.agg && (Y[p.key] = p.agg);
4031
- mt(Y), Pe(v), rt(U), te(D), f(z), ra(Le ? j : null);
4031
+ typeof p != "string" && p.label && (v[p.key] = p.label), typeof p != "string" && p.format && (U[p.key] = p.format), typeof p != "string" && p.pin && (Le = !0, p.pin !== "none" && (j[p.key] = p.pin)), typeof p != "string" && ((s = p.tint) != null && s.length) && (D[p.key] = p.tint), typeof p != "string" && p.width && (z[p.key] = p.width), typeof p != "string" && p.agg && (J[p.key] = p.agg);
4032
+ mt(J), Me(v), rt(U), te(D), f(z), sa(Le ? j : null);
4032
4033
  } else
4033
- ra(null);
4034
+ sa(null);
4034
4035
  T(1);
4035
4036
  }, Ms = () => {
4036
4037
  const e = dt.find((t) => t.role_default) ?? dt.find((t) => t.is_default);
@@ -4038,10 +4039,10 @@ function D0({
4038
4039
  ma(e);
4039
4040
  return;
4040
4041
  }
4041
- Dn(null), Se([]), sa([]), $e(d ?? ""), at(h ?? null), Pe({}), k({}), rt({}), mt({}), ra(null), T(1);
4042
- }, Qn = () => ({
4042
+ Dn(null), Se([]), la([]), $e(d ?? ""), at(h ?? null), Me({}), k({}), rt({}), mt({}), sa(null), T(1);
4043
+ }, Wn = () => ({
4043
4044
  // The pressed highlight pills ride along as one `$at_risk` filter entry.
4044
- filters: [...Be, ...[Mc(Mt, ua)].filter((e) => e !== null)],
4045
+ filters: [...Be, ...[Oc(Mt, ua)].filter((e) => e !== null)],
4045
4046
  sort: X,
4046
4047
  columns: [
4047
4048
  ...ve.map((e, t) => {
@@ -4082,7 +4083,7 @@ function D0({
4082
4083
  const { data: Os = [] } = ne({
4083
4084
  queryKey: ["cbv-export-presets", n],
4084
4085
  queryFn: () => u.request(
4085
- J("/export-presets", { collection: n })
4086
+ G("/export-presets", { collection: n })
4086
4087
  ).then((e) => e.data ?? []),
4087
4088
  staleTime: 6e4
4088
4089
  }), [fa, As] = _(""), Is = async () => {
@@ -4099,11 +4100,11 @@ function D0({
4099
4100
  ), As(""), y.invalidateQueries({ queryKey: ["cbv-export-presets", n] }));
4100
4101
  }, zo = (e) => {
4101
4102
  const t = new URLSearchParams();
4102
- G && t.set("search", G), _e && t.set("conditions", _e), X && t.set("sort", X), window.open(`/api/export-presets/${e}/run?${t.toString()}`, "_blank");
4103
+ Y && t.set("search", Y), _e && t.set("conditions", _e), X && t.set("sort", X), window.open(`/api/export-presets/${e}/run?${t.toString()}`, "_blank");
4103
4104
  }, Qo = (e, t) => {
4104
4105
  u.request(
4105
4106
  he(`/export-presets/${e}/run-async`, {
4106
- ...G ? { search: G } : {},
4107
+ ...Y ? { search: Y } : {},
4107
4108
  ..._e ? { conditions: _e } : {},
4108
4109
  ...X ? { sort: X } : {}
4109
4110
  })
@@ -4121,13 +4122,13 @@ function D0({
4121
4122
  m && gd();
4122
4123
  }, []);
4123
4124
  const Wo = () => {
4124
- const e = Qn();
4125
+ const e = Wn();
4125
4126
  return {
4126
- q: G,
4127
+ q: Y,
4127
4128
  f: e.filters,
4128
4129
  s: X,
4129
4130
  c: e.columns,
4130
- qf: gt,
4131
+ qf: xt,
4131
4132
  cf: Ve,
4132
4133
  lc: Ft,
4133
4134
  ex: En,
@@ -4138,13 +4139,13 @@ function D0({
4138
4139
  };
4139
4140
  }, ba = Nt({
4140
4141
  mutationFn: () => u.request(
4141
- he("/saved-views", { collection: n, name: sn.trim(), ...Qn() })
4142
+ he("/saved-views", { collection: n, name: sn.trim(), ...Wn() })
4142
4143
  ),
4143
4144
  onSuccess: (e) => {
4144
4145
  Ea(!1), Da(""), Dn(e.data.id), vn();
4145
4146
  }
4146
4147
  }), [ur, js] = _(null), zt = Nt({
4147
- mutationFn: (e) => u.request(ka(`/saved-views/${e}`, Qn())),
4148
+ mutationFn: (e) => u.request(ka(`/saved-views/${e}`, Wn())),
4148
4149
  onSuccess: (e, t) => {
4149
4150
  var s;
4150
4151
  vn(), js(t), setTimeout(() => js((l) => l === t ? null : l), 2e3);
@@ -4162,8 +4163,8 @@ function D0({
4162
4163
  }), Bs = Nt({
4163
4164
  mutationFn: () => {
4164
4165
  const e = dt.find((t) => t.is_default);
4165
- return e ? u.request(ka(`/saved-views/${e.id}`, { ...Qn(), is_default: !0 })) : u.request(
4166
- he("/saved-views", { collection: n, name: "Default", is_default: !0, ...Qn() })
4166
+ return e ? u.request(ka(`/saved-views/${e.id}`, { ...Wn(), is_default: !0 })) : u.request(
4167
+ he("/saved-views", { collection: n, name: "Default", is_default: !0, ...Wn() })
4167
4168
  );
4168
4169
  },
4169
4170
  onSuccess: () => {
@@ -4186,7 +4187,7 @@ function D0({
4186
4187
  }
4187
4188
  }), { data: Jo = [] } = ne({
4188
4189
  queryKey: ["cbv-view-subs"],
4189
- queryFn: () => u.request(J("/view-subscriptions")).then((e) => e.data ?? []).catch(() => []),
4190
+ queryFn: () => u.request(G("/view-subscriptions")).then((e) => e.data ?? []).catch(() => []),
4190
4191
  staleTime: 6e4
4191
4192
  }), ha = (e) => Jo.find((t) => t.view_id === e), Go = Nt({
4192
4193
  mutationFn: async (e) => {
@@ -4201,10 +4202,10 @@ function D0({
4201
4202
  try {
4202
4203
  const { rows: r, truncated: s } = await Nc(
4203
4204
  (C, B) => u.request(
4204
- J(`/items/${n}`, {
4205
+ G(`/items/${n}`, {
4205
4206
  limit: B,
4206
4207
  offset: C,
4207
- ...G ? { search: G } : {},
4208
+ ...Y ? { search: Y } : {},
4208
4209
  sort: Sc(X),
4209
4210
  ..._e ? { conditions: _e } : {}
4210
4211
  })
@@ -4221,27 +4222,27 @@ function D0({
4221
4222
  if (Tt(B)) continue;
4222
4223
  const Ne = await y.fetchQuery({
4223
4224
  queryKey: ["cbv-collection-meta", B],
4224
- queryFn: () => u.request(J(`/collections/${B}`)).then((Ee) => Ee.data),
4225
+ queryFn: () => u.request(G(`/collections/${B}`)).then((De) => De.data),
4225
4226
  staleTime: 10 * 6e4
4226
4227
  }).catch(() => {
4227
4228
  });
4228
4229
  i.push({
4229
4230
  column: C,
4230
4231
  template: (Ne == null ? void 0 : Ne.display_template) ?? null,
4231
- labelField: Yn(Ne)
4232
+ labelField: Jn(Ne)
4232
4233
  });
4233
4234
  }
4234
- const x = [.../* @__PURE__ */ new Set([...zn, ...i.flatMap(Cc)])], v = await $c(
4235
+ const x = [.../* @__PURE__ */ new Set([...Qn, ...i.flatMap(Cc)])], v = await $c(
4235
4236
  r.map((C) => String(C.id)),
4236
4237
  x,
4237
4238
  (C, B) => u.request(
4238
- J(`/items/${n}/resolve-paths`, {
4239
+ G(`/items/${n}/resolve-paths`, {
4239
4240
  ids: C.join(","),
4240
4241
  paths: B.join(",")
4241
4242
  })
4242
4243
  ).then((Ne) => {
4243
- var Ee;
4244
- return ((Ee = Ne.data) == null ? void 0 : Ee.rows) ?? {};
4244
+ var De;
4245
+ return ((De = Ne.data) == null ? void 0 : De.rows) ?? {};
4245
4246
  })
4246
4247
  ), U = [
4247
4248
  ...new Set(
@@ -4256,7 +4257,7 @@ function D0({
4256
4257
  const Le = new Map(i.map((C) => [C.column, C])), D = new Set(b), z = (C) => {
4257
4258
  const B = C == null ? "" : String(typeof C == "object" ? JSON.stringify(C) : C);
4258
4259
  return /[",\n]/.test(B) ? `"${B.replace(/"/g, '""')}"` : B;
4259
- }, Y = (C, B) => {
4260
+ }, J = (C, B) => {
4260
4261
  var fl, bl;
4261
4262
  const Ne = xe[B];
4262
4263
  if (B.startsWith("__f:")) {
@@ -4271,13 +4272,13 @@ function D0({
4271
4272
  const xa = B.includes(".") ? B : Ye[B], wn = ((bl = (fl = v[String(C.id)]) == null ? void 0 : fl[xa]) == null ? void 0 : bl.value) ?? "";
4272
4273
  return Ne && wn ? Sl(wn, Ne) : wn;
4273
4274
  }
4274
- const Ee = C[B], ml = Le.get(B);
4275
- return ml && Ee != null && Ee !== "" ? Tc(ml, v[String(C.id)]) || Ee : D.has(B) && Ee != null && Ee !== "" ? j.get(String(Ee).toUpperCase()) ?? Ee : Ee != null && Ee !== "" && ((Ne == null ? void 0 : Ne.type) === "number" || dr(B)) ? Ki(Ee) : Ee != null && Ee !== "" && ((Ne == null ? void 0 : Ne.type) === "datetime" || jo(B)) ? ji(Ee) : B === "id" ? Sr(A, C) ?? Ee : Ne && Ee != null ? Hn(String(Ee), Ne) : Ee;
4276
- }, p = Jt.filter((C) => C.kind !== "actions"), ft = new Set(
4275
+ const De = C[B], ml = Le.get(B);
4276
+ return ml && De != null && De !== "" ? Tc(ml, v[String(C.id)]) || De : D.has(B) && De != null && De !== "" ? j.get(String(De).toUpperCase()) ?? De : De != null && De !== "" && ((Ne == null ? void 0 : Ne.type) === "number" || dr(B)) ? Ki(De) : De != null && De !== "" && ((Ne == null ? void 0 : Ne.type) === "datetime" || jo(B)) ? ji(De) : B === "id" ? Sr(A, C) ?? De : Ne && De != null ? Yn(String(De), Ne) : De;
4277
+ }, p = Jt.filter((C) => C.kind !== "actions"), bt = new Set(
4277
4278
  p.filter((C) => C.kind !== "data" && C.kind !== "formula").map((C) => C.kind)
4278
- ), tt = r.map((C) => String(C.id)), At = await Bi(tt, ft, {
4279
+ ), tt = r.map((C) => String(C.id)), At = await Bi(tt, bt, {
4279
4280
  instances: (C) => u.request(
4280
- J(`/pipelines/instances/${n}`, { ids: C.join(",") })
4281
+ G(`/pipelines/instances/${n}`, { ids: C.join(",") })
4281
4282
  ).then((B) => {
4282
4283
  var Ne;
4283
4284
  return ((Ne = B.data) == null ? void 0 : Ne.instances) ?? {};
@@ -4300,7 +4301,7 @@ function D0({
4300
4301
  (C) => [
4301
4302
  ...Gt.map((B) => B.cell(C)),
4302
4303
  ...p.map(
4303
- (B) => B.kind === "data" || B.kind === "formula" ? Y(C, B.key) : zi(B.kind, String(C.id), At, C, {
4304
+ (B) => B.kind === "data" || B.kind === "formula" ? J(C, B.key) : zi(B.kind, String(C.id), At, C, {
4304
4305
  now: yn,
4305
4306
  fulfilment: Fe
4306
4307
  })
@@ -4310,7 +4311,7 @@ function D0({
4310
4311
  ];
4311
4312
  s && (pt.push(""), pt.push(
4312
4313
  z(
4313
- `First ${r.length.toLocaleString()} of ${Me.toLocaleString()} rows — narrow the filter to export the rest`
4314
+ `First ${r.length.toLocaleString()} of ${Re.toLocaleString()} rows — narrow the filter to export the rest`
4314
4315
  )
4315
4316
  )), A != null && A.export_watermark && (pt.push(""), pt.push(
4316
4317
  z(`Exported ${(/* @__PURE__ */ new Date()).toISOString()} · ${r.length} rows · ${n} · Nivaro`)
@@ -4326,9 +4327,9 @@ function D0({
4326
4327
  const O = new Blob([pt.join(`
4327
4328
  `)], { type: "text/csv;charset=utf-8" }), nt = URL.createObjectURL(O), W = document.createElement("a");
4328
4329
  W.href = nt;
4329
- const ye = De.export_filename, se = ((t = dt.find((C) => C.id === Ht)) == null ? void 0 : t.name) ?? "all";
4330
+ const ye = Pe.export_filename, se = ((t = dt.find((C) => C.id === Ht)) == null ? void 0 : t.name) ?? "all";
4330
4331
  W.download = ye ? `${ye.replace(/\{\{\s*collection\s*\}\}/g, n).replace(/\{\{\s*view\s*\}\}/g, se).replace(/\{\{\s*date\s*\}\}/g, Lc()).replace(/[^A-Za-z0-9 ._-]/g, "")}.csv` : `${n}.csv`, W.click(), setTimeout(() => URL.revokeObjectURL(nt), 1e4), s && ge.warning(`Exported the first ${r.length.toLocaleString()} rows`, {
4331
- description: `${Me.toLocaleString()} match — narrow the filter to export the rest.`
4332
+ description: `${Re.toLocaleString()} match — narrow the filter to export the rest.`
4332
4333
  });
4333
4334
  } catch (r) {
4334
4335
  ge.error(Zt(r, "Export failed"));
@@ -4371,26 +4372,26 @@ function D0({
4371
4372
  ...((b = r.currentTarget.parentElement) == null ? void 0 : b.querySelectorAll(
4372
4373
  ":scope > [data-row-open]"
4373
4374
  )) ?? []
4374
- ], l = Pc(s.length, s.indexOf(r.currentTarget), r.key), i = l === null ? null : s[l];
4375
+ ], l = Mc(s.length, s.indexOf(r.currentTarget), r.key), i = l === null ? null : s[l];
4375
4376
  i && (i.focus(), (x = i.scrollIntoView) == null || x.call(i, { block: "nearest" }));
4376
4377
  }
4377
4378
  };
4378
4379
  }, on = (e) => {
4379
4380
  var t;
4380
- ((t = ca.current) == null ? void 0 : t.key) === `${n}\0${G}` && Hd(u, ca.current.id, {
4381
+ ((t = ca.current) == null ? void 0 : t.key) === `${n}\0${Y}` && Hd(u, ca.current.id, {
4381
4382
  type: "record",
4382
4383
  collection: n,
4383
4384
  item: e === "new" ? null : e
4384
4385
  }), N ? N(e) : Q({ collection: n, itemId: String(e) });
4385
4386
  }, zs = (e) => {
4386
4387
  const t = ot(Ge, n, e), r = (s) => {
4387
- $e(Gd(X, s, De.default_sort ?? "")), T(1);
4388
+ $e(Gd(X, s, Pe.default_sort ?? "")), T(1);
4388
4389
  };
4389
4390
  if (t != null && t.one_collection && !Tt(t.one_collection)) {
4390
4391
  const s = t.one_collection;
4391
4392
  y.fetchQuery({
4392
4393
  queryKey: ["collection-meta", s],
4393
- queryFn: () => u.request(J(`/collections/${s}`)).then((l) => l.data),
4394
+ queryFn: () => u.request(G(`/collections/${s}`)).then((l) => l.data),
4394
4395
  staleTime: 6e4
4395
4396
  }).then((l) => {
4396
4397
  var U;
@@ -4408,10 +4409,10 @@ function D0({
4408
4409
  Ws(!0);
4409
4410
  try {
4410
4411
  const e = await u.request(
4411
- J(`/items/${n}`, {
4412
+ G(`/items/${n}`, {
4412
4413
  limit: ga,
4413
4414
  fields: "id",
4414
- ...G ? { search: G } : {},
4415
+ ...Y ? { search: Y } : {},
4415
4416
  ..._e ? { conditions: _e } : {}
4416
4417
  })
4417
4418
  );
@@ -4419,11 +4420,11 @@ function D0({
4419
4420
  } finally {
4420
4421
  Ws(!1);
4421
4422
  }
4422
- }, ri = Me === 0 && !Bt ? 0 : (M - 1) * He + 1, si = Bt ? (M - 1) * He + Ce.length : Math.min(M * He, Me), Wn = !!(Re != null && Re.instances), Vs = (Dt ? 1 : 0) + (Wn ? 2 : 0) + (Wr ? 1 : 0), mr = [
4423
+ }, ri = Re === 0 && !Bt ? 0 : (M - 1) * He + 1, si = Bt ? (M - 1) * He + Ce.length : Math.min(M * He, Re), Vn = !!(Ee != null && Ee.instances), Vs = (Dt ? 1 : 0) + (Vn ? 2 : 0) + (Wr ? 1 : 0), mr = [
4423
4424
  ...ve.map(
4424
4425
  (e) => e.startsWith("__f:") ? { key: e, kind: "formula" } : { key: e, kind: "data" }
4425
4426
  ),
4426
- ...Wn ? [
4427
+ ...Vn ? [
4427
4428
  { key: "__state__", kind: "state" },
4428
4429
  // When the record entered its current state, and how long it has
4429
4430
  // sat there (the queue's Last State Change and Aging).
@@ -4442,19 +4443,19 @@ function D0({
4442
4443
  ...mr.filter((e) => $t(e.key) === "right")
4443
4444
  ], li = Jt.map((e) => {
4444
4445
  if (e.kind === "data") {
4445
- const t = kt.get(e.key.split(".")[0]);
4446
+ const t = yt.get(e.key.split(".")[0]);
4446
4447
  return { key: e.key, shape: Yd(t == null ? void 0 : t.type, t == null ? void 0 : t.interface) };
4447
4448
  }
4448
- return { key: e.key, shape: zu[e.kind] ?? "short" };
4449
+ return { key: e.key, shape: Qu[e.kind] ?? "short" };
4449
4450
  }), Hs = [
4450
- ...Wn ? [{ key: "__state__", label: "State" }] : [],
4451
+ ...Vn ? [{ key: "__state__", label: "State" }] : [],
4451
4452
  ...ve.filter((e) => Ut(e) || !ot(Ge, n, e)).map((e) => ({ key: e, label: Ze(e) }))
4452
4453
  ], oi = (e) => {
4453
4454
  var s;
4454
4455
  if (!ce) return "";
4455
4456
  const t = e.id;
4456
4457
  if (ce === "__state__") {
4457
- const l = (s = Re == null ? void 0 : Re.instances) == null ? void 0 : s[String(t)];
4458
+ const l = (s = Ee == null ? void 0 : Ee.instances) == null ? void 0 : s[String(t)];
4458
4459
  return (l == null ? void 0 : l.state_label) ?? (l == null ? void 0 : l.state_key) ?? "(no state)";
4459
4460
  }
4460
4461
  if (Ut(ce)) return _t(t, ce) || "(empty)";
@@ -4473,31 +4474,31 @@ function D0({
4473
4474
  if (r.push({ kind: "header", gkey: s, label: s, count: l.length }), !Fn.has(s)) for (const i of l) r.push({ kind: "row", row: i });
4474
4475
  }
4475
4476
  return r;
4476
- })(), [ii, di] = _(null), ci = Dc(Ys, ii), fr = Jt.filter((e) => $t(e.key) === "left").map((e) => e.key), Js = Jt.filter((e) => $t(e.key) === "right").map((e) => e.key), br = fe(/* @__PURE__ */ new Map()), [Vn, ui] = _({});
4477
+ })(), [ii, di] = _(null), ci = Pc(Ys, ii), fr = Jt.filter((e) => $t(e.key) === "left").map((e) => e.key), Js = Jt.filter((e) => $t(e.key) === "right").map((e) => e.key), br = fe(/* @__PURE__ */ new Map()), [Hn, ui] = _({});
4477
4478
  Li(() => {
4478
4479
  const e = {};
4479
4480
  for (const [r, s] of br.current)
4480
4481
  s != null && s.isConnected && (e[r] = s.getBoundingClientRect().width);
4481
- const t = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(Vn)]);
4482
+ const t = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(Hn)]);
4482
4483
  for (const r of t)
4483
- if (Math.abs((e[r] ?? -1) - (Vn[r] ?? -1)) > 0.5) {
4484
+ if (Math.abs((e[r] ?? -1) - (Hn[r] ?? -1)) > 0.5) {
4484
4485
  ui(e);
4485
4486
  return;
4486
4487
  }
4487
4488
  });
4488
4489
  const pi = 52, Gs = (e) => {
4489
4490
  if ($t(e) === "left") {
4490
- let s = Dt ? Vn.__checkbox__ ?? pi : 0;
4491
+ let s = Dt ? Hn.__checkbox__ ?? pi : 0;
4491
4492
  for (const l of fr) {
4492
4493
  if (l === e) break;
4493
- s += Vn[l] ?? 0;
4494
+ s += Hn[l] ?? 0;
4494
4495
  }
4495
4496
  return Math.floor(s);
4496
4497
  }
4497
4498
  let r = 0;
4498
4499
  for (const s of [...Js].reverse()) {
4499
4500
  if (s === e) break;
4500
- r += Vn[s] ?? 0;
4501
+ r += Hn[s] ?? 0;
4501
4502
  }
4502
4503
  return Math.floor(r);
4503
4504
  }, ct = (e, t, r) => {
@@ -4570,12 +4571,12 @@ function D0({
4570
4571
  )
4571
4572
  }
4572
4573
  );
4573
- }, bi = !!(G || _e || Ht != null), { data: hi } = ne({
4574
+ }, bi = !!(Y || _e || Ht != null), { data: hi } = ne({
4574
4575
  queryKey: ["cbv-grand-total", n],
4575
4576
  queryFn: () => u.request(
4576
- J(`/items/${n}`, { limit: 1, fields: "id", count: "approx" })
4577
+ G(`/items/${n}`, { limit: 1, fields: "id", count: "approx" })
4577
4578
  ).then((e) => typeof e.total == "number" ? e.total : null),
4578
- enabled: !!n && Je && !re && bi,
4579
+ enabled: !!n && Je && !ae && bi,
4579
4580
  staleTime: 5 * 6e4,
4580
4581
  retry: !1
4581
4582
  }), tl = fe(!1), [, gi] = _(0);
@@ -4597,7 +4598,7 @@ function D0({
4597
4598
  }
4598
4599
  }, vr = (() => {
4599
4600
  var s, l, i, b;
4600
- if (re) return null;
4601
+ if (ae) return null;
4601
4602
  let e = !1;
4602
4603
  const t = (x, v, U, j = !1) => {
4603
4604
  const Le = v.map(U);
@@ -4620,7 +4621,7 @@ function D0({
4620
4621
  j && r.push(j);
4621
4622
  }
4622
4623
  for (const x of Pt) {
4623
- const v = gt[x.key] ?? [];
4624
+ const v = xt[x.key] ?? [];
4624
4625
  if (v.length === 0) continue;
4625
4626
  const U = ["cbv-quick-options", x.collection, x.value_field ?? "id", x.label_field];
4626
4627
  r.push(t(x.label, v, (j) => xr(U, j)));
@@ -4629,13 +4630,13 @@ function D0({
4629
4630
  if (!v) continue;
4630
4631
  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 = xe[x], Le = (j == null ? void 0 : j.type) === "number" && j.prefix === "$";
4631
4632
  if (v.kind === "in" && v.value.length) {
4632
- const D = Er(Ge, n, x), z = (D == null ? void 0 : D.one_collection) ?? null, Y = ds[x], p = z ?? ((Y == null ? void 0 : Y.kind) === "m2m" ? Y.target : null);
4633
+ const D = Er(Ge, n, x), z = (D == null ? void 0 : D.one_collection) ?? null, J = ds[x], p = z ?? ((J == null ? void 0 : J.kind) === "m2m" ? J.target : null);
4633
4634
  r.push(
4634
4635
  p ? t(
4635
4636
  U,
4636
4637
  v.value,
4637
- (ft) => xr(["cbv-filter-options", p], ft) ?? xr(["cbv-filter-selected-labels", p], ft)
4638
- ) : { kind: "is", field: U, values: v.value.map((ft) => je(String(ft))) }
4638
+ (bt) => xr(["cbv-filter-options", p], bt) ?? xr(["cbv-filter-selected-labels", p], bt)
4639
+ ) : { kind: "is", field: U, values: v.value.map((bt) => je(String(bt))) }
4639
4640
  );
4640
4641
  } else if (v.kind === "state" && v.value.length)
4641
4642
  r.push({
@@ -4643,8 +4644,8 @@ function D0({
4643
4644
  field: U,
4644
4645
  values: v.value.map(
4645
4646
  (D) => {
4646
- var z, Y;
4647
- return ((Y = (z = wt == null ? void 0 : wt.states) == null ? void 0 : z.find((p) => p.key === D)) == null ? void 0 : Y.label) ?? je(D);
4647
+ var z, J;
4648
+ return ((J = (z = wt == null ? void 0 : wt.states) == null ? void 0 : z.find((p) => p.key === D)) == null ? void 0 : J.label) ?? je(D);
4648
4649
  }
4649
4650
  )
4650
4651
  });
@@ -4701,9 +4702,9 @@ function D0({
4701
4702
  return tl.current = e, td({
4702
4703
  noun: (A == null ? void 0 : A.display_name) || je(n),
4703
4704
  viewName: ((b = dt.find((x) => x.id === Ht)) == null ? void 0 : b.name) ?? null,
4704
- search: G,
4705
+ search: Y,
4705
4706
  clauses: r,
4706
- shown: Bt ? null : Me,
4707
+ shown: Bt ? null : Re,
4707
4708
  of: hi ?? null,
4708
4709
  approx: jn
4709
4710
  });
@@ -4773,7 +4774,7 @@ function D0({
4773
4774
  [data-cbv] .cbv-overlay { animation: none; opacity: 1; }
4774
4775
  }
4775
4776
  ` }),
4776
- /* @__PURE__ */ a(vu, {}),
4777
+ /* @__PURE__ */ a(ku, {}),
4777
4778
  /* @__PURE__ */ a(kc, {}),
4778
4779
  ie && Wl(
4779
4780
  /* @__PURE__ */ c(
@@ -4843,7 +4844,7 @@ function D0({
4843
4844
  },
4844
4845
  {
4845
4846
  label: "Peek",
4846
- run: () => xt.push([{ collection: n, itemId: String(ie.row.id) }])
4847
+ run: () => vt.push([{ collection: n, itemId: String(ie.row.id) }])
4847
4848
  },
4848
4849
  // The friendly id, never the row id (army 7 N7); none = nothing to copy.
4849
4850
  ...Lr({
@@ -4910,7 +4911,7 @@ function D0({
4910
4911
  ),
4911
4912
  /* @__PURE__ */ c("div", { className: "flex shrink-0 flex-wrap items-center gap-2 border-b border-slate-200 bg-white px-4 py-2.5 dark:border-slate-700 dark:bg-slate-900", children: [
4912
4913
  /* @__PURE__ */ a(
4913
- Ku,
4914
+ ju,
4914
4915
  {
4915
4916
  collection: n,
4916
4917
  meta: A,
@@ -4945,7 +4946,7 @@ function D0({
4945
4946
  {
4946
4947
  type: "button",
4947
4948
  onClick: () => {
4948
- sa((r) => t ? r.filter((s) => s !== e.id) : [...r, e.id]), T(1);
4949
+ la((r) => t ? r.filter((s) => s !== e.id) : [...r, e.id]), T(1);
4949
4950
  },
4950
4951
  "aria-pressed": t,
4951
4952
  "data-cbv-risk-pill": e.id,
@@ -4964,8 +4965,8 @@ function D0({
4964
4965
  e.id
4965
4966
  );
4966
4967
  }),
4967
- /* @__PURE__ */ a(mu, { className: "h-8" }),
4968
- /* @__PURE__ */ a(Hc, {}),
4968
+ /* @__PURE__ */ a(fu, { className: "h-8" }),
4969
+ /* @__PURE__ */ a(Yc, {}),
4969
4970
  tr > 0 && /* @__PURE__ */ c(
4970
4971
  "button",
4971
4972
  {
@@ -4992,17 +4993,17 @@ function D0({
4992
4993
  "aria-label": "Refresh",
4993
4994
  title: "Refresh",
4994
4995
  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",
4995
- children: /* @__PURE__ */ a(yr, { className: `h-4 w-4 ${yt ? "animate-spin" : ""}` })
4996
+ children: /* @__PURE__ */ a(yr, { className: `h-4 w-4 ${ft ? "animate-spin" : ""}` })
4996
4997
  }
4997
4998
  ),
4998
- /* @__PURE__ */ a(lu, { listKey: `cbv:${n}`, getState: Wo }),
4999
- Ct && De.copy_as !== !1 && /* @__PURE__ */ a(
4999
+ /* @__PURE__ */ a(ou, { listKey: `cbv:${n}`, getState: Wo }),
5000
+ Ct && Pe.copy_as !== !1 && /* @__PURE__ */ a(
5000
5001
  yc,
5001
5002
  {
5002
5003
  collection: n,
5003
5004
  list: {
5004
5005
  conditions: _e,
5005
- search: G || void 0,
5006
+ search: Y || void 0,
5006
5007
  sort: X || void 0,
5007
5008
  limit: He,
5008
5009
  page: M
@@ -5011,7 +5012,7 @@ function D0({
5011
5012
  }
5012
5013
  ),
5013
5014
  An.parent && /* @__PURE__ */ a(
5014
- Ec,
5015
+ Dc,
5015
5016
  {
5016
5017
  parent: An.parent,
5017
5018
  value: cs,
@@ -5048,8 +5049,8 @@ function D0({
5048
5049
  onClick: () => {
5049
5050
  us(null), ps((e) => !e);
5050
5051
  },
5051
- title: la ? "Back to the table" : "Show these records on a map",
5052
- 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"}`,
5052
+ title: oa ? "Back to the table" : "Show these records on a map",
5053
+ className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${oa ? "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"}`,
5053
5054
  "data-cbv-map-toggle": !0,
5054
5055
  children: [
5055
5056
  /* @__PURE__ */ a(ki, { className: "h-3.5 w-3.5" }),
@@ -5063,7 +5064,7 @@ function D0({
5063
5064
  type: "button",
5064
5065
  onClick: () => Z((e) => !e),
5065
5066
  title: "Ask the table a question",
5066
- className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${R || re ? "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"}`,
5067
+ className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${R || ae ? "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"}`,
5067
5068
  children: [
5068
5069
  /* @__PURE__ */ a(wr, { className: "h-3.5 w-3.5" }),
5069
5070
  "Ask"
@@ -5120,15 +5121,15 @@ function D0({
5120
5121
  },
5121
5122
  e.id
5122
5123
  )),
5123
- re && /* @__PURE__ */ c("span", { className: "order-last inline-flex max-w-full items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] py-1 pl-2.5 pr-1.5 text-[12px] text-[#007a99] dark:text-nvr-cyan", children: [
5124
+ ae && /* @__PURE__ */ c("span", { className: "order-last inline-flex max-w-full items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/[0.08] py-1 pl-2.5 pr-1.5 text-[12px] text-[#007a99] dark:text-nvr-cyan", children: [
5124
5125
  /* @__PURE__ */ a(wr, { className: "h-3 w-3 shrink-0" }),
5125
5126
  /* @__PURE__ */ c("span", { className: "min-w-0 truncate", children: [
5126
- re.interpreted || "AI result",
5127
+ ae.interpreted || "AI result",
5127
5128
  " · ",
5128
- bt(re.total),
5129
+ ht(ae.total),
5129
5130
  " match",
5130
- re.total === 1 ? "" : "es",
5131
- re.total > re.rows.length ? ` (showing first ${re.rows.length})` : ""
5131
+ ae.total === 1 ? "" : "es",
5132
+ ae.total > ae.rows.length ? ` (showing first ${ae.rows.length})` : ""
5132
5133
  ] }),
5133
5134
  /* @__PURE__ */ a(
5134
5135
  "button",
@@ -5181,13 +5182,13 @@ function D0({
5181
5182
  {
5182
5183
  type: "button",
5183
5184
  onClick: so,
5184
- "aria-pressed": vt,
5185
- "data-cbv-bulk-mode": vt ? "on" : "off",
5186
- "data-tip": vt ? "Leave bulk mode — clears the selection and turns row actions back on" : "Select rows to act on several at once",
5187
- className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${vt ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "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"}`,
5185
+ "aria-pressed": kt,
5186
+ "data-cbv-bulk-mode": kt ? "on" : "off",
5187
+ "data-tip": kt ? "Leave bulk mode — clears the selection and turns row actions back on" : "Select rows to act on several at once",
5188
+ className: `flex h-8 items-center gap-1.5 rounded-md border px-2.5 text-[12px] font-medium ${kt ? "border-nvr-cyan bg-nvr-cyan/10 text-slate-800 dark:text-slate-100" : "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"}`,
5188
5189
  children: [
5189
5190
  /* @__PURE__ */ a(yi, { className: "h-3.5 w-3.5" }),
5190
- vt ? "Done" : "Bulk select"
5191
+ kt ? "Done" : "Bulk select"
5191
5192
  ]
5192
5193
  }
5193
5194
  ),
@@ -5195,7 +5196,7 @@ function D0({
5195
5196
  "button",
5196
5197
  {
5197
5198
  type: "button",
5198
- onClick: Zn,
5199
+ onClick: ea,
5199
5200
  "aria-label": "Row density",
5200
5201
  title: tn === "compact" ? "Switch to comfortable rows" : "Switch to compact rows",
5201
5202
  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",
@@ -5249,7 +5250,7 @@ function D0({
5249
5250
  autoFocus: !0,
5250
5251
  value: Ie[e] ?? "",
5251
5252
  placeholder: e.includes(".") ? e.split(".").map(je).join(" › ") : je(e),
5252
- onChange: (s) => Pe((l) => {
5253
+ onChange: (s) => Me((l) => {
5253
5254
  const i = { ...l };
5254
5255
  return s.target.value ? i[e] = s.target.value : delete i[e], i;
5255
5256
  }),
@@ -5275,7 +5276,7 @@ function D0({
5275
5276
  "button",
5276
5277
  {
5277
5278
  type: "button",
5278
- onClick: () => ae(oe === e ? null : e),
5279
+ onClick: () => re(oe === e ? null : e),
5279
5280
  title: "Format column",
5280
5281
  "aria-label": `Format ${e}`,
5281
5282
  className: xe[e] ? "text-[11px] font-bold text-[#00a5cc]" : "text-[11px] text-slate-300 opacity-0 hover:text-slate-500 group-hover:opacity-100",
@@ -5311,7 +5312,7 @@ function D0({
5311
5312
  }
5312
5313
  ),
5313
5314
  oe === e && /* @__PURE__ */ c("div", { className: "mb-1 ml-5 mr-1 rounded-md border border-slate-100 bg-slate-50 p-1.5 dark:border-slate-800 dark:bg-slate-800/60", children: [
5314
- /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: _u.map((s) => {
5315
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: Nu.map((s) => {
5315
5316
  const l = JSON.stringify(xe[e] ?? null) === JSON.stringify(s.cfg);
5316
5317
  return /* @__PURE__ */ a(
5317
5318
  "button",
@@ -5321,7 +5322,7 @@ function D0({
5321
5322
  rt((i) => {
5322
5323
  const b = { ...i };
5323
5324
  return s.cfg ? b[e] = s.cfg : delete b[e], b;
5324
- }), ae(null);
5325
+ }), re(null);
5325
5326
  },
5326
5327
  className: `rounded border px-1.5 py-0.5 text-[10.5px] ${l ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] text-slate-800 dark:text-slate-100" : "border-slate-200 bg-white text-slate-500 hover:text-slate-700 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-400"}`,
5327
5328
  children: s.label
@@ -5340,9 +5341,9 @@ function D0({
5340
5341
  l && rt((i) => ({
5341
5342
  ...i,
5342
5343
  [e]: { type: "datetime", template: l }
5343
- })), ae(null);
5344
+ })), re(null);
5344
5345
  }
5345
- s.key === "Escape" && ae(null);
5346
+ s.key === "Escape" && re(null);
5346
5347
  },
5347
5348
  className: "mt-1 h-5 w-full rounded border border-slate-200 bg-white px-1 text-[10.5px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100"
5348
5349
  }
@@ -5462,7 +5463,7 @@ function D0({
5462
5463
  A && /* @__PURE__ */ c("div", { className: "mt-1 border-t border-slate-100 pt-1.5 dark:border-slate-800", children: [
5463
5464
  /* @__PURE__ */ a("p", { className: "px-1.5 pb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "+ Related column" }),
5464
5465
  /* @__PURE__ */ a(
5465
- ju,
5466
+ Bu,
5466
5467
  {
5467
5468
  collection: n,
5468
5469
  meta: A,
@@ -5483,7 +5484,7 @@ function D0({
5483
5484
  let r = 1;
5484
5485
  for (; We[`__f:${r}`]; ) r++;
5485
5486
  const s = `__f:${r}`;
5486
- k((l) => ({ ...l, [s]: t })), Pe((l) => ({ ...l, [s]: e })), at([...ve, s]);
5487
+ k((l) => ({ ...l, [s]: t })), Me((l) => ({ ...l, [s]: e })), at([...ve, s]);
5487
5488
  }
5488
5489
  }
5489
5490
  )
@@ -5500,7 +5501,7 @@ function D0({
5500
5501
  placeholder: "Preset name…",
5501
5502
  onChange: (e) => Da(e.target.value),
5502
5503
  onKeyDown: (e) => {
5503
- e.key === "Enter" && sn.trim() && (ba.mutate(), ht(!1)), e.key === "Escape" && ht(!1);
5504
+ e.key === "Enter" && sn.trim() && (ba.mutate(), gt(!1)), e.key === "Escape" && gt(!1);
5504
5505
  },
5505
5506
  className: "h-6 w-full min-w-0 flex-1 rounded border border-slate-200 bg-slate-50 px-1.5 text-[11.5px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
5506
5507
  }
@@ -5511,7 +5512,7 @@ function D0({
5511
5512
  type: "button",
5512
5513
  disabled: !sn.trim() || ba.isPending,
5513
5514
  onClick: () => {
5514
- ba.mutate(), ht(!1);
5515
+ ba.mutate(), gt(!1);
5515
5516
  },
5516
5517
  className: "text-[11.5px] font-medium text-[#00a5cc] disabled:opacity-40",
5517
5518
  children: "Save"
@@ -5522,7 +5523,7 @@ function D0({
5522
5523
  "button",
5523
5524
  {
5524
5525
  type: "button",
5525
- onClick: () => ht(!0),
5526
+ onClick: () => gt(!0),
5526
5527
  className: "inline-flex items-center gap-1 text-[11.5px] text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200",
5527
5528
  children: [
5528
5529
  /* @__PURE__ */ a("span", { "aria-hidden": !0, children: "🖫" }),
@@ -5653,7 +5654,7 @@ ${r}`).then(() => {
5653
5654
  ] })
5654
5655
  ] })
5655
5656
  ] }),
5656
- ta && !(A != null && A.singleton) && (na ? /* @__PURE__ */ c("div", { className: "relative", "data-cbv-newitem-menu": !0, ref: ja, children: [
5657
+ na && !(A != null && A.singleton) && (aa ? /* @__PURE__ */ c("div", { className: "relative", "data-cbv-newitem-menu": !0, ref: ja, children: [
5657
5658
  /* @__PURE__ */ c(
5658
5659
  "button",
5659
5660
  {
@@ -5663,7 +5664,7 @@ ${r}`).then(() => {
5663
5664
  children: [
5664
5665
  "+ ",
5665
5666
  Vr,
5666
- /* @__PURE__ */ a(Jn, { className: "h-3.5 w-3.5" })
5667
+ /* @__PURE__ */ a(Gn, { className: "h-3.5 w-3.5" })
5667
5668
  ]
5668
5669
  }
5669
5670
  ),
@@ -5672,11 +5673,11 @@ ${r}`).then(() => {
5672
5673
  {
5673
5674
  key: "default",
5674
5675
  slug: null,
5675
- label: ((sl = na.active) == null ? void 0 : sl.create_label) ?? ((ll = na.active) == null ? void 0 : ll.name) ?? "Default layout",
5676
+ label: ((sl = aa.active) == null ? void 0 : sl.create_label) ?? ((ll = aa.active) == null ? void 0 : ll.name) ?? "Default layout",
5676
5677
  isDefault: !0,
5677
5678
  steps: Ka
5678
5679
  },
5679
- ...na.options.map((e) => ({
5680
+ ...aa.options.map((e) => ({
5680
5681
  key: String(e.id),
5681
5682
  slug: e.slug,
5682
5683
  label: e.create_label ?? e.name,
@@ -5709,7 +5710,7 @@ ${r}`).then(() => {
5709
5710
  "data-cbv-quick-pick": e.slug ?? "default",
5710
5711
  title: "Quick pick — choose the related fields step by step, then open the form prefilled",
5711
5712
  onClick: () => {
5712
- Pn(!1), aa({ slug: e.slug });
5713
+ Pn(!1), ra({ slug: e.slug });
5713
5714
  },
5714
5715
  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",
5715
5716
  children: [
@@ -5767,7 +5768,7 @@ ${r}`).then(() => {
5767
5768
  "data-cbv-quick-pick": "default",
5768
5769
  title: "Quick pick — choose the related fields step by step, then open the form prefilled",
5769
5770
  "aria-label": "Quick pick",
5770
- onClick: () => aa({ slug: null }),
5771
+ onClick: () => ra({ slug: null }),
5771
5772
  className: Xt(
5772
5773
  "flex h-8 items-center border-l border-white/30 bg-nvr-cyan px-2 text-white hover:brightness-105",
5773
5774
  !((dl = Mn.data) != null && dl.enabled) && "rounded-r-md"
@@ -5803,18 +5804,18 @@ ${r}`).then(() => {
5803
5804
  )
5804
5805
  ] }),
5805
5806
  Ia && /* @__PURE__ */ a(
5806
- nu,
5807
+ au,
5807
5808
  {
5808
5809
  collection: n,
5809
5810
  layoutSlug: Ia.slug,
5810
5811
  open: !0,
5811
5812
  onOpenChange: (e) => {
5812
- e || aa(null);
5813
+ e || ra(null);
5813
5814
  },
5814
5815
  noun: (A == null ? void 0 : A.singular) ?? "record",
5815
5816
  anchorEl: ja.current ?? Zr.current,
5816
5817
  onDone: (e) => {
5817
- aa(null), Q({ collection: n, itemId: "new", layoutSlug: Ia.slug, prefill: e });
5818
+ ra(null), Q({ collection: n, itemId: "new", layoutSlug: Ia.slug, prefill: e });
5818
5819
  }
5819
5820
  }
5820
5821
  ),
@@ -5840,7 +5841,7 @@ ${r}`).then(() => {
5840
5841
  ] }),
5841
5842
  Pt.length > 0 && /* @__PURE__ */ c("div", { className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-white px-4 py-1.5 dark:border-slate-800 dark:bg-slate-900", children: [
5842
5843
  Pt.map((e) => /* @__PURE__ */ a(
5843
- Eu,
5844
+ Du,
5844
5845
  {
5845
5846
  def: e,
5846
5847
  allowedIds: es(e),
@@ -5853,7 +5854,7 @@ ${r}`).then(() => {
5853
5854
  selected: Cn[e.key] ?? [],
5854
5855
  onChange: (t) => {
5855
5856
  var r;
5856
- st((s) => ({ ...s, [e.key]: t })), t.length === 0 && (((r = gt[e.key]) == null ? void 0 : r.length) ?? 0) > 0 && (Kt((s) => ({ ...s, [e.key]: [] })), T(1));
5857
+ st((s) => ({ ...s, [e.key]: t })), t.length === 0 && (((r = xt[e.key]) == null ? void 0 : r.length) ?? 0) > 0 && (Kt((s) => ({ ...s, [e.key]: [] })), T(1));
5857
5858
  }
5858
5859
  },
5859
5860
  e.key
@@ -5882,9 +5883,9 @@ ${r}`).then(() => {
5882
5883
  ),
5883
5884
  /* @__PURE__ */ a("span", { className: "ml-auto text-[11px] text-slate-400", children: Bt ? "count unavailable" : /* @__PURE__ */ c(Qe, { children: [
5884
5885
  jn ? "about " : "",
5885
- bt(Me),
5886
+ ht(Re),
5886
5887
  " item",
5887
- Me === 1 ? "" : "s"
5888
+ Re === 1 ? "" : "s"
5888
5889
  ] }) })
5889
5890
  ] }),
5890
5891
  /* @__PURE__ */ c("div", { className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-white px-4 py-1.5 dark:border-slate-800 dark:bg-slate-900", children: [
@@ -5976,7 +5977,7 @@ ${r}`).then(() => {
5976
5977
  }
5977
5978
  ),
5978
5979
  Ct && /* @__PURE__ */ a(
5979
- Ic,
5980
+ Kc,
5980
5981
  {
5981
5982
  name: e.name,
5982
5983
  isDefault: !!e.is_default,
@@ -6053,7 +6054,7 @@ ${r}`).then(() => {
6053
6054
  ] }),
6054
6055
  et != null && /* @__PURE__ */ c("div", { className: "mx-4 mt-3 flex flex-wrap items-center gap-3 rounded-md border border-red-200 bg-red-50 px-4 py-2.5 text-[13px] text-red-700 dark:border-red-900/40 dark:bg-red-900/10 dark:text-red-400", children: [
6055
6056
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: Td(et) === 503 ? Ld(et) : Zt(et, "Failed to load records") }),
6056
- (et == null ? void 0 : et.status) === 403 && !Oc(et) && /* @__PURE__ */ a(
6057
+ (et == null ? void 0 : et.status) === 403 && !Ac(et) && /* @__PURE__ */ a(
6057
6058
  "button",
6058
6059
  {
6059
6060
  type: "button",
@@ -6070,7 +6071,7 @@ ${r}`).then(() => {
6070
6071
  {
6071
6072
  type: "button",
6072
6073
  onClick: () => {
6073
- const t = Ac(e, { filters: Be, sort: X, colFilters: Ve });
6074
+ const t = Ic(e, { filters: Be, sort: X, colFilters: Ve });
6074
6075
  Se(t.filters), $e(t.sort), Qt(t.colFilters), T(1);
6075
6076
  },
6076
6077
  title: `Remove the filter or sort on "${e}" — this list cannot filter on it`,
@@ -6100,29 +6101,29 @@ ${r}`).then(() => {
6100
6101
  collection: n,
6101
6102
  config: In,
6102
6103
  onOpen: (e) => on(e),
6103
- onAddChild: V && De.allow_create !== !1 ? (e) => Q({
6104
+ onAddChild: V && Pe.allow_create !== !1 ? (e) => Q({
6104
6105
  collection: n,
6105
6106
  itemId: "new",
6106
6107
  prefill: { [In.parent_field]: e }
6107
6108
  }) : void 0
6108
6109
  }
6109
6110
  ) }) }) : 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: (pl = K.find((e) => e.key === qt)) == null ? void 0 : pl.render() }) : null,
6110
- la && hn ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ a(
6111
- du,
6111
+ oa && hn ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ a(
6112
+ cu,
6112
6113
  {
6113
6114
  collection: n,
6114
6115
  latField: hn.latField,
6115
6116
  lngField: hn.lngField,
6116
6117
  labelField: hn.labelField,
6117
6118
  conditions: _e ?? null,
6118
- search: G,
6119
+ search: Y,
6119
6120
  onOpen: (e) => on(e)
6120
6121
  }
6121
6122
  ) }) : null,
6122
6123
  /* @__PURE__ */ c(
6123
6124
  "div",
6124
6125
  {
6125
- 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",
6126
+ className: oa && 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",
6126
6127
  children: [
6127
6128
  vr && /* @__PURE__ */ a(
6128
6129
  "p",
@@ -6140,12 +6141,12 @@ ${r}`).then(() => {
6140
6141
  ref: Ot.rootRef,
6141
6142
  className: "nvr-fade-in relative 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",
6142
6143
  children: [
6143
- yt && !oa && /* @__PURE__ */ a("div", { className: "cbv-progress pointer-events-none absolute inset-x-0 top-0 z-[6] h-[3px] overflow-hidden" }),
6144
- yt && !oa && Wa && /* @__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: [
6144
+ ft && !ia && /* @__PURE__ */ a("div", { className: "cbv-progress pointer-events-none absolute inset-x-0 top-0 z-[6] h-[3px] overflow-hidden" }),
6145
+ ft && !ia && Wa && /* @__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: [
6145
6146
  /* @__PURE__ */ a(yr, { "aria-hidden": !0, className: "h-3.5 w-3.5 animate-spin text-[#00a5cc]" }),
6146
6147
  ws != null ? `${Ga.text ?? "Still working"} — ${ws}s` : "Loading…"
6147
6148
  ] }) }) }),
6148
- oa && Ga.slow && /* @__PURE__ */ a("div", { className: "pointer-events-none absolute inset-x-0 top-12 z-[6] flex justify-center px-4", children: /* @__PURE__ */ a(xu, { reason: Ga, variant: "pill" }) }),
6149
+ ia && Ga.slow && /* @__PURE__ */ a("div", { className: "pointer-events-none absolute inset-x-0 top-12 z-[6] flex justify-center px-4", children: /* @__PURE__ */ a(vu, { reason: Ga, variant: "pill" }) }),
6149
6150
  /* @__PURE__ */ a(
6150
6151
  "div",
6151
6152
  {
@@ -6185,7 +6186,7 @@ ${r}`).then(() => {
6185
6186
  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",
6186
6187
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-1", children: [
6187
6188
  /* @__PURE__ */ a(Ol, { change: null }),
6188
- vt && /* @__PURE__ */ a(
6189
+ kt && /* @__PURE__ */ a(
6189
6190
  "input",
6190
6191
  {
6191
6192
  type: "checkbox",
@@ -6215,7 +6216,7 @@ ${r}`).then(() => {
6215
6216
  t
6216
6217
  );
6217
6218
  }
6218
- const i = kt.get(t), b = !!(i != null && i.computed_formula && !i.computed_store && !i.sql_filterable), x = Ut(t) || b, v = !x && (X === t || X === `-${t}` || X.replace(/^-/, "").startsWith(`${t}.`)), U = X.startsWith("-") && v, j = kt.get(t), Le = Ze(t);
6219
+ const i = yt.get(t), b = !!(i != null && i.computed_formula && !i.computed_store && !i.sql_filterable), x = Ut(t) || b, v = !x && (X === t || X === `-${t}` || X.replace(/^-/, "").startsWith(`${t}.`)), U = X.startsWith("-") && v, j = yt.get(t), Le = Ze(t);
6219
6220
  return /* @__PURE__ */ c(
6220
6221
  "th",
6221
6222
  {
@@ -6257,7 +6258,7 @@ ${r}`).then(() => {
6257
6258
  );
6258
6259
  })
6259
6260
  ] }),
6260
- (Ko || Wn) && /* @__PURE__ */ c("tr", { className: "border-b border-slate-200 dark:border-slate-700", children: [
6261
+ (Ko || Vn) && /* @__PURE__ */ c("tr", { className: "border-b border-slate-200 dark:border-slate-700", children: [
6261
6262
  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" }),
6262
6263
  Jt.map((e) => {
6263
6264
  var l;
@@ -6311,7 +6312,7 @@ ${r}`).then(() => {
6311
6312
  className: s,
6312
6313
  "data-aging-filter": !0,
6313
6314
  children: /* @__PURE__ */ a(
6314
- Vc,
6315
+ Hc,
6315
6316
  {
6316
6317
  layout: "cell",
6317
6318
  def: {
@@ -6404,11 +6405,11 @@ ${r}`).then(() => {
6404
6405
  })
6405
6406
  ] })
6406
6407
  ] }),
6407
- /* @__PURE__ */ a("tbody", { className: "text-[12px] tabular-nums", children: oa ? (
6408
+ /* @__PURE__ */ a("tbody", { className: "text-[12px] tabular-nums", children: ia ? (
6408
6409
  // #3229 — one placeholder per real column, real row height (h-8, or the
6409
6410
  // table's comfortable h-11), real pins/widths: nothing moves on arrival.
6410
6411
  /* @__PURE__ */ a(
6411
- gu,
6412
+ xu,
6412
6413
  {
6413
6414
  columns: li,
6414
6415
  rows: Math.min(He, 20),
@@ -6425,25 +6426,27 @@ ${r}`).then(() => {
6425
6426
  colSpan: ve.length + Vs,
6426
6427
  className: "nvr-fade-in py-16",
6427
6428
  children: (() => {
6428
- const e = Be.length === 0 && Object.keys(Ve).length === 0 && !Object.values(gt).some((r) => r.length > 0) && !G, t = A == null ? void 0 : A.empty_state;
6429
+ const e = Be.length === 0 && Object.keys(Ve).length === 0 && !Object.values(xt).some((s) => s.length > 0) && !Y, t = A == null ? void 0 : A.empty_state;
6429
6430
  if (e && t && (t.title || t.message)) {
6430
- const r = t.cta_url ?? "", s = r.startsWith("/"), l = /^https?:\/\//.test(r);
6431
+ const s = t.cta_url ?? "", l = s.startsWith("/"), i = /^https?:\/\//.test(s);
6431
6432
  return /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-2 text-center", children: [
6432
6433
  /* @__PURE__ */ a("p", { className: "text-[14px] font-semibold text-slate-700 dark:text-slate-200", children: t.title || "Nothing here yet" }),
6433
6434
  t.message && /* @__PURE__ */ a("p", { className: "max-w-[52ch] text-[12.5px] leading-relaxed text-slate-500 dark:text-muted-foreground", children: t.message }),
6434
- t.cta_label && (s || l) && /* @__PURE__ */ a(
6435
+ t.cta_label && (l || i) && /* @__PURE__ */ a(
6435
6436
  "a",
6436
6437
  {
6437
- href: r,
6438
- target: s ? void 0 : "_blank",
6439
- rel: s ? void 0 : "noreferrer",
6438
+ href: s,
6439
+ target: l ? void 0 : "_blank",
6440
+ rel: l ? void 0 : "noreferrer",
6440
6441
  className: "mt-1 inline-flex h-8 items-center rounded-md bg-nvr-cyan px-3.5 text-[12.5px] font-semibold text-white",
6441
6442
  children: t.cta_label
6442
6443
  }
6443
6444
  )
6444
6445
  ] });
6445
6446
  }
6446
- return et != null ? null : /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-2 text-center", children: [
6447
+ if (et != null) return null;
6448
+ const r = Re === 0 && !ae && !!Y;
6449
+ return /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-2 text-center", children: [
6447
6450
  /* @__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(
6448
6451
  Ql,
6449
6452
  {
@@ -6452,19 +6455,19 @@ ${r}`).then(() => {
6452
6455
  }
6453
6456
  ) }),
6454
6457
  /* @__PURE__ */ a("p", { className: "text-[13.5px] font-medium text-slate-600 dark:text-slate-300", children: "No records match" }),
6455
- Me === 0 && (da ?? 0) > 0 ? /* @__PURE__ */ c(
6458
+ Re === 0 && (Un ?? 0) > 0 && /* @__PURE__ */ c(
6456
6459
  "p",
6457
6460
  {
6458
6461
  className: "max-w-[52ch] text-[12px] text-slate-600 dark:text-slate-300",
6459
- "data-cbv-default-hiding": da,
6462
+ "data-cbv-default-hiding": Un,
6460
6463
  children: [
6461
6464
  "Your default",
6462
6465
  " ",
6463
- Bn.map((r) => r.label).join(" and "),
6466
+ Bn.map((s) => s.label).join(" and "),
6464
6467
  " filter is hiding ",
6465
- bt(da ?? 0),
6468
+ ht(Un ?? 0),
6466
6469
  " record",
6467
- da === 1 ? "" : "s",
6470
+ Un === 1 ? "" : "s",
6468
6471
  " ·",
6469
6472
  " ",
6470
6473
  /* @__PURE__ */ a(
@@ -6478,8 +6481,18 @@ ${r}`).then(() => {
6478
6481
  )
6479
6482
  ]
6480
6483
  }
6481
- ) : /* @__PURE__ */ a("p", { className: "text-[12px] text-slate-400", children: "Try adjusting your search or filters." }),
6482
- (Be.length > 0 || Object.keys(Ve).length > 0 || Object.values(gt).some((r) => r.length > 0) || G) && /* @__PURE__ */ a(
6484
+ ),
6485
+ /* @__PURE__ */ a(
6486
+ Rc,
6487
+ {
6488
+ term: Y,
6489
+ collection: n,
6490
+ show: r,
6491
+ ask: r && !ft,
6492
+ fallback: Re === 0 && (Un ?? 0) > 0 ? null : /* @__PURE__ */ a("p", { className: "text-[12px] text-slate-400", children: "Try adjusting your search or filters." })
6493
+ }
6494
+ ),
6495
+ (Be.length > 0 || Object.keys(Ve).length > 0 || Object.values(xt).some((s) => s.length > 0) || Y) && /* @__PURE__ */ a(
6483
6496
  "button",
6484
6497
  {
6485
6498
  type: "button",
@@ -6500,8 +6513,8 @@ ${r}`).then(() => {
6500
6513
  return /* @__PURE__ */ a(
6501
6514
  "tr",
6502
6515
  {
6503
- onClick: () => Rn((Y) => {
6504
- const p = new Set(Y);
6516
+ onClick: () => Rn((J) => {
6517
+ const p = new Set(J);
6505
6518
  return p.has(e.gkey) ? p.delete(e.gkey) : p.add(e.gkey), p;
6506
6519
  }),
6507
6520
  style: r,
@@ -6513,7 +6526,7 @@ ${r}`).then(() => {
6513
6526
  colSpan: ve.length + Vs,
6514
6527
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-1.5 text-[12px] font-medium text-slate-600 dark:text-slate-200", children: [
6515
6528
  /* @__PURE__ */ a(
6516
- Jn,
6529
+ Gn,
6517
6530
  {
6518
6531
  className: `h-3.5 w-3.5 text-slate-400 transition-transform duration-200 ${Fn.has(e.gkey) ? "-rotate-90" : ""}`
6519
6532
  }
@@ -6526,40 +6539,40 @@ ${r}`).then(() => {
6526
6539
  },
6527
6540
  `__group__${e.gkey}`
6528
6541
  );
6529
- const s = e.row, l = s.id, i = an.includes(l), b = (z = Re == null ? void 0 : Re.instances) == null ? void 0 : z[String(l)], x = Lo[String(l)], v = lr == null ? void 0 : lr[String(l)], U = qo.get(String(l)) ?? null, j = Ro(n, l), Le = !i && x ? Wd(x.color) : void 0, D = i ? "bg-[#e6fafe] dark:bg-[#0c2a33]" : Le ?? "bg-white group-hover:bg-[#f2fcff] dark:bg-slate-900 dark:group-hover:bg-[#0e2d3a]";
6542
+ const s = e.row, l = s.id, i = an.includes(l), b = (z = Ee == null ? void 0 : Ee.instances) == null ? void 0 : z[String(l)], x = Lo[String(l)], v = lr == null ? void 0 : lr[String(l)], U = qo.get(String(l)) ?? null, j = Ro(n, l), Le = !i && x ? Wd(x.color) : void 0, D = i ? "bg-[#e6fafe] dark:bg-[#0c2a33]" : Le ?? "bg-white group-hover:bg-[#f2fcff] dark:bg-slate-900 dark:group-hover:bg-[#0e2d3a]";
6530
6543
  return /* @__PURE__ */ c(
6531
6544
  "tr",
6532
6545
  {
6533
6546
  ...No({ collection: n, id: String(l) }),
6534
6547
  ...ei(l),
6535
6548
  "data-row-key": String(l),
6536
- title: Ot.titleFor(String(l)) ?? (U && !U.is_mine ? Nd(U) : void 0) ?? (x ? `At risk — ${x.rule}` : void 0) ?? (j ? pu : void 0),
6549
+ title: Ot.titleFor(String(l)) ?? (U && !U.is_mine ? Nd(U) : void 0) ?? (x ? `At risk — ${x.rule}` : void 0) ?? (j ? mu : void 0),
6537
6550
  "data-picker-excluded": j ? "" : void 0,
6538
6551
  style: r,
6539
- className: `nvr-row-enter group h-8 cursor-pointer border-b border-slate-100 transition-colors duration-150 hover:bg-nvr-cyan/[0.04] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan dark:border-slate-800 dark:hover:bg-nvr-cyan/[0.08] ${i ? "bg-nvr-cyan/[0.08]" : Le ?? ""} ${j ? uu : ""}`,
6552
+ className: `nvr-row-enter group h-8 cursor-pointer border-b border-slate-100 transition-colors duration-150 hover:bg-nvr-cyan/[0.04] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan dark:border-slate-800 dark:hover:bg-nvr-cyan/[0.08] ${i ? "bg-nvr-cyan/[0.08]" : Le ?? ""} ${j ? pu : ""}`,
6540
6553
  children: [
6541
6554
  Dt && /* @__PURE__ */ a(
6542
6555
  "td",
6543
6556
  {
6544
6557
  className: `sticky left-0 z-[1] w-11 py-1.5 pl-1.5 pr-3 ${D}`,
6545
- onClick: (Y) => Y.stopPropagation(),
6558
+ onClick: (J) => J.stopPropagation(),
6546
6559
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-1", children: [
6547
6560
  U || Ot.isNew(String(l)) ? /* @__PURE__ */ a(
6548
- su,
6561
+ lu,
6549
6562
  {
6550
6563
  lock: U,
6551
6564
  isNew: Ot.isNew(String(l)),
6552
6565
  dataAttr: "data-cbv-live-mark"
6553
6566
  }
6554
6567
  ) : Ns[ql(n, String(l))] ? /* @__PURE__ */ a(
6555
- hu,
6568
+ gu,
6556
6569
  {
6557
6570
  viewers: Ns[ql(n, String(l))],
6558
6571
  dataAttr: "data-cbv-presence"
6559
6572
  }
6560
6573
  ) : /* @__PURE__ */ a(Ol, { change: v, dataAttr: "data-cbv-unseen" }),
6561
6574
  /* @__PURE__ */ a(hc, { rowId: l }),
6562
- vt && /* @__PURE__ */ a(
6575
+ kt && /* @__PURE__ */ a(
6563
6576
  "input",
6564
6577
  {
6565
6578
  type: "checkbox",
@@ -6571,10 +6584,10 @@ ${r}`).then(() => {
6571
6584
  ] })
6572
6585
  }
6573
6586
  ),
6574
- Jt.map((Y) => {
6587
+ Jt.map((J) => {
6575
6588
  var At, ut, Gt, kn, yn, pt;
6576
- const p = Y.key;
6577
- if (Y.kind === "state")
6589
+ const p = J.key;
6590
+ if (J.kind === "state")
6578
6591
  return /* @__PURE__ */ a(
6579
6592
  "td",
6580
6593
  {
@@ -6620,14 +6633,14 @@ ${r}`).then(() => {
6620
6633
  },
6621
6634
  p
6622
6635
  );
6623
- if (Y.kind === "entered") {
6624
- const O = (At = Re == null ? void 0 : Re.instances) == null ? void 0 : At[String(l)];
6636
+ if (J.kind === "entered") {
6637
+ const O = (At = Ee == null ? void 0 : Ee.instances) == null ? void 0 : At[String(l)];
6625
6638
  return /* @__PURE__ */ a(
6626
6639
  "td",
6627
6640
  {
6628
6641
  style: Oe(p),
6629
6642
  className: `whitespace-nowrap px-3 py-1.5 text-[12px] tabular-nums text-slate-600 dark:text-slate-300 ${ct(p, "z-[1]", D)}`,
6630
- children: O != null && O.entered_at ? Hn(O.entered_at, {
6643
+ children: O != null && O.entered_at ? Yn(O.entered_at, {
6631
6644
  type: "datetime",
6632
6645
  template: "MM/DD/YYYY - h:mmA"
6633
6646
  }) : /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" })
@@ -6635,8 +6648,8 @@ ${r}`).then(() => {
6635
6648
  p
6636
6649
  );
6637
6650
  }
6638
- if (Y.kind === "aging") {
6639
- const O = (ut = Re == null ? void 0 : Re.instances) == null ? void 0 : ut[String(l)], nt = O != null && O.entered_at ? new Date(O.entered_at).getTime() : NaN, W = O != null && O.completed_at || !Number.isFinite(nt) ? null : (Date.now() - nt) / 36e5;
6651
+ if (J.kind === "aging") {
6652
+ const O = (ut = Ee == null ? void 0 : Ee.instances) == null ? void 0 : ut[String(l)], nt = O != null && O.entered_at ? new Date(O.entered_at).getTime() : NaN, W = O != null && O.completed_at || !Number.isFinite(nt) ? null : (Date.now() - nt) / 36e5;
6640
6653
  return /* @__PURE__ */ a(
6641
6654
  "td",
6642
6655
  {
@@ -6648,7 +6661,7 @@ ${r}`).then(() => {
6648
6661
  p
6649
6662
  );
6650
6663
  }
6651
- if (Y.kind === "owners")
6664
+ if (J.kind === "owners")
6652
6665
  return /* @__PURE__ */ a(
6653
6666
  "td",
6654
6667
  {
@@ -6665,19 +6678,19 @@ ${r}`).then(() => {
6665
6678
  },
6666
6679
  p
6667
6680
  );
6668
- if (Y.kind === "addendums") {
6681
+ if (J.kind === "addendums") {
6669
6682
  const O = rr == null ? void 0 : rr[String(l)];
6670
6683
  return /* @__PURE__ */ a(
6671
6684
  "td",
6672
6685
  {
6673
6686
  style: Oe(p),
6674
6687
  className: `whitespace-nowrap px-3 py-1.5 ${ct(p, "z-[1]", D)}`,
6675
- children: /* @__PURE__ */ a(Cu, { summary: O })
6688
+ children: /* @__PURE__ */ a($u, { summary: O })
6676
6689
  },
6677
6690
  p
6678
6691
  );
6679
6692
  }
6680
- if (Y.kind === "fulfilment" && Fe)
6693
+ if (J.kind === "fulfilment" && Fe)
6681
6694
  return /* @__PURE__ */ a(
6682
6695
  "td",
6683
6696
  {
@@ -6685,11 +6698,11 @@ ${r}`).then(() => {
6685
6698
  className: `whitespace-nowrap px-3 py-1.5 ${ct(p, "z-[1]", D)}`,
6686
6699
  onClick: (O) => O.stopPropagation(),
6687
6700
  children: /* @__PURE__ */ a(
6688
- Yc,
6701
+ Jc,
6689
6702
  {
6690
6703
  collection: n,
6691
6704
  itemId: String(l),
6692
- figures: Jc(
6705
+ figures: Gc(
6693
6706
  s[Fe.shipped_field],
6694
6707
  s[Fe.requested_field]
6695
6708
  ),
@@ -6699,17 +6712,17 @@ ${r}`).then(() => {
6699
6712
  },
6700
6713
  p
6701
6714
  );
6702
- if (Y.kind === "integrations")
6715
+ if (J.kind === "integrations")
6703
6716
  return /* @__PURE__ */ a(
6704
6717
  "td",
6705
6718
  {
6706
6719
  style: Oe(p),
6707
6720
  className: `whitespace-nowrap px-3 py-1.5 ${ct(p, "z-[1]", D)}`,
6708
- children: /* @__PURE__ */ a(eu, { rows: or == null ? void 0 : or[String(l)] })
6721
+ children: /* @__PURE__ */ a(tu, { rows: or == null ? void 0 : or[String(l)] })
6709
6722
  },
6710
6723
  p
6711
6724
  );
6712
- if (Y.kind === "tasks") {
6725
+ if (J.kind === "tasks") {
6713
6726
  const O = sr == null ? void 0 : sr[String(l)];
6714
6727
  return /* @__PURE__ */ a(
6715
6728
  "td",
@@ -6732,7 +6745,7 @@ ${r}`).then(() => {
6732
6745
  p
6733
6746
  );
6734
6747
  }
6735
- if (Y.kind === "formula") {
6748
+ if (J.kind === "formula") {
6736
6749
  const O = go(s, p);
6737
6750
  return /* @__PURE__ */ a(
6738
6751
  "td",
@@ -6741,12 +6754,12 @@ ${r}`).then(() => {
6741
6754
  "data-cbv-formula-cell": p,
6742
6755
  "data-tip": xo(s, p),
6743
6756
  className: `whitespace-nowrap px-3 py-1.5 text-right tabular-nums text-slate-700 dark:text-slate-200 ${ct(p, "z-[1]", D)}`,
6744
- children: O == null ? /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : xe[p] ? Hn(String(O), xe[p]) : bt(Math.round(O * 100) / 100)
6757
+ children: O == null ? /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : xe[p] ? Yn(String(O), xe[p]) : ht(Math.round(O * 100) / 100)
6745
6758
  },
6746
6759
  p
6747
6760
  );
6748
6761
  }
6749
- if (Y.kind === "actions")
6762
+ if (J.kind === "actions")
6750
6763
  return /* @__PURE__ */ a(
6751
6764
  "td",
6752
6765
  {
@@ -6754,25 +6767,25 @@ ${r}`).then(() => {
6754
6767
  className: `w-20 whitespace-nowrap px-2 py-1 text-right ${ct(p, "z-[1]", D)}`,
6755
6768
  onClick: (O) => O.stopPropagation(),
6756
6769
  children: /* @__PURE__ */ a(
6757
- Tu,
6770
+ Lu,
6758
6771
  {
6759
6772
  collection: n,
6760
6773
  id: l,
6761
- hasPipeline: Wn,
6774
+ hasPipeline: Vn,
6762
6775
  onOpen: () => on(l),
6763
- onPeek: () => xt.push([{ collection: n, itemId: String(l) }]),
6776
+ onPeek: () => vt.push([{ collection: n, itemId: String(l) }]),
6764
6777
  onAudit: () => cn(String(l)),
6765
6778
  urlFor: F,
6766
6779
  onDeleted: () => Us.mutate(l),
6767
6780
  row: s,
6768
- bulkEnabledKeys: De.bulk_actions ?? null,
6769
- disabled: vt
6781
+ bulkEnabledKeys: Pe.bulk_actions ?? null,
6782
+ disabled: kt
6770
6783
  }
6771
6784
  )
6772
6785
  },
6773
6786
  p
6774
6787
  );
6775
- const ft = Ut(p) ? Po(l, p) : null, tt = Ut(p) ? null : ot(Ge, n, p);
6788
+ const bt = Ut(p) ? Po(l, p) : null, tt = Ut(p) ? null : ot(Ge, n, p);
6776
6789
  return /* @__PURE__ */ a(
6777
6790
  "td",
6778
6791
  {
@@ -6802,20 +6815,20 @@ ${r}`).then(() => {
6802
6815
  return /* @__PURE__ */ a(
6803
6816
  Pl,
6804
6817
  {
6805
- users: nt.map((Ne, Ee) => ({
6818
+ users: nt.map((Ne, De) => ({
6806
6819
  id: String(Ne),
6807
- name: ye[Ee] ?? String(Ne)
6820
+ name: ye[De] ?? String(Ne)
6808
6821
  })),
6809
6822
  showSingleName: !1
6810
6823
  }
6811
6824
  );
6812
- })() : ft && _t(l, p) !== "—" ? /* @__PURE__ */ c(
6825
+ })() : bt && _t(l, p) !== "—" ? /* @__PURE__ */ c(
6813
6826
  "button",
6814
6827
  {
6815
6828
  type: "button",
6816
6829
  onClick: (O) => {
6817
- O.stopPropagation(), xt.push([
6818
- { collection: ft.target, itemId: ft.id }
6830
+ O.stopPropagation(), vt.push([
6831
+ { collection: bt.target, itemId: bt.id }
6819
6832
  ]);
6820
6833
  },
6821
6834
  "data-tip": _t(l, p) ?? void 0,
@@ -6837,7 +6850,7 @@ ${r}`).then(() => {
6837
6850
  {
6838
6851
  type: "button",
6839
6852
  onClick: (O) => {
6840
- O.stopPropagation(), xt.push([
6853
+ O.stopPropagation(), vt.push([
6841
6854
  {
6842
6855
  collection: tt.one_collection,
6843
6856
  itemId: String(s[p])
@@ -6871,7 +6884,7 @@ ${r}`).then(() => {
6871
6884
  "text-[12px] tabular-nums text-slate-700 dark:text-slate-200",
6872
6885
  wa(s[p], H[p]) && Kl[wa(s[p], H[p])]
6873
6886
  ),
6874
- children: Hn(String(s[p]), xe[p])
6887
+ children: Yn(String(s[p]), xe[p])
6875
6888
  }
6876
6889
  ) : wa(s[p], H[p]) ? /* @__PURE__ */ a(
6877
6890
  "span",
@@ -6885,7 +6898,7 @@ ${r}`).then(() => {
6885
6898
  {
6886
6899
  collection: n,
6887
6900
  field: p,
6888
- fieldType: ((yn = kt.get(p)) == null ? void 0 : yn.type) ?? null,
6901
+ fieldType: ((yn = yt.get(p)) == null ? void 0 : yn.type) ?? null,
6889
6902
  value: s[p],
6890
6903
  relations: Ge
6891
6904
  }
@@ -6896,7 +6909,7 @@ ${r}`).then(() => {
6896
6909
  {
6897
6910
  collection: n,
6898
6911
  field: p,
6899
- fieldType: ((pt = kt.get(p)) == null ? void 0 : pt.type) ?? null,
6912
+ fieldType: ((pt = yt.get(p)) == null ? void 0 : pt.type) ?? null,
6900
6913
  value: s[p],
6901
6914
  relations: Ge
6902
6915
  }
@@ -6920,8 +6933,8 @@ ${r}`).then(() => {
6920
6933
  {
6921
6934
  className: `whitespace-nowrap px-3 py-1.5 ${ct(r, "z-[3]", "bg-slate-50 dark:bg-slate-800")}`,
6922
6935
  style: Oe(r),
6923
- "data-tip": s != null ? `Sum of ${Ze(r)} across all ${bt(Me)} matching records` : void 0,
6924
- children: s != null ? /* @__PURE__ */ a("span", { className: "text-slate-700 dark:text-slate-200", children: xe[r] ? Hn(String(s), xe[r]) : bt(Math.round(s * 100) / 100) }) : t === 0 ? /* @__PURE__ */ a("span", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Σ totals" }) : null
6936
+ "data-tip": s != null ? `Sum of ${Ze(r)} across all ${ht(Re)} matching records` : void 0,
6937
+ children: s != null ? /* @__PURE__ */ a("span", { className: "text-slate-700 dark:text-slate-200", children: xe[r] ? Yn(String(s), xe[r]) : ht(Math.round(s * 100) / 100) }) : t === 0 ? /* @__PURE__ */ a("span", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Σ totals" }) : null
6925
6938
  },
6926
6939
  r
6927
6940
  );
@@ -6932,28 +6945,28 @@ ${r}`).then(() => {
6932
6945
  )
6933
6946
  }
6934
6947
  ),
6935
- /* @__PURE__ */ a(Gc, { scrollerRef: Br }),
6948
+ /* @__PURE__ */ a(Xc, { scrollerRef: Br }),
6936
6949
  /* @__PURE__ */ a(
6937
- bu,
6950
+ hu,
6938
6951
  {
6939
6952
  collections: n ? [n] : [],
6940
6953
  selectedIds: Mt,
6941
6954
  onToggle: (e) => {
6942
- sa(
6955
+ la(
6943
6956
  (t) => e.ids.some((r) => t.includes(r)) ? t.filter((r) => !e.ids.includes(r)) : [...t, ...e.ids]
6944
6957
  ), T(1);
6945
6958
  },
6946
6959
  className: "shrink-0 border-t border-slate-100 bg-white px-3 py-1.5 dark:border-slate-800 dark:bg-slate-900"
6947
6960
  }
6948
6961
  ),
6949
- ce && Me > 500 && /* @__PURE__ */ c("p", { className: "shrink-0 border-t border-slate-100 bg-white px-3 py-2 text-[12px] text-slate-500 dark:border-slate-800 dark:bg-slate-900", children: [
6962
+ ce && Re > 500 && /* @__PURE__ */ c("p", { className: "shrink-0 border-t border-slate-100 bg-white px-3 py-2 text-[12px] text-slate-500 dark:border-slate-800 dark:bg-slate-900", children: [
6950
6963
  "Grouping the first ",
6951
- bt(500),
6964
+ ht(500),
6952
6965
  " of ",
6953
- bt(Me),
6966
+ ht(Re),
6954
6967
  " records — narrow the filters to group everything."
6955
6968
  ] }),
6956
- !ce && !re && (Bt ? M > 1 || Ce.length >= He : Me > He) && /* @__PURE__ */ c(
6969
+ !ce && !ae && (Bt ? M > 1 || Ce.length >= He : Re > He) && /* @__PURE__ */ c(
6957
6970
  "div",
6958
6971
  {
6959
6972
  className: "flex shrink-0 items-center justify-between border-t border-slate-100 bg-white py-2 pl-3 dark:border-slate-800 dark:bg-slate-900",
@@ -6961,9 +6974,9 @@ ${r}`).then(() => {
6961
6974
  children: [
6962
6975
  /* @__PURE__ */ c("p", { className: "text-[12px] tabular-nums text-slate-500 dark:text-slate-400", children: [
6963
6976
  /* @__PURE__ */ c("span", { className: "font-semibold text-slate-700 dark:text-slate-200", children: [
6964
- bt(ri),
6977
+ ht(ri),
6965
6978
  "–",
6966
- bt(si)
6979
+ ht(si)
6967
6980
  ] }),
6968
6981
  " ",
6969
6982
  "of",
@@ -6979,7 +6992,7 @@ ${r}`).then(() => {
6979
6992
  ),
6980
6993
  " "
6981
6994
  ] }),
6982
- Bt ? /* @__PURE__ */ a("span", { "data-tip": "The count took too long. The rows on screen are complete.", children: "many" }) : /* @__PURE__ */ a("span", { className: "nvr-value-pulse-bg rounded-sm", children: bt(Me) }, Me),
6995
+ Bt ? /* @__PURE__ */ a("span", { "data-tip": "The count took too long. The rows on screen are complete.", children: "many" }) : /* @__PURE__ */ a("span", { className: "nvr-value-pulse-bg rounded-sm", children: ht(Re) }, Re),
6983
6996
  " ",
6984
6997
  "records"
6985
6998
  ] }),
@@ -7010,15 +7023,15 @@ ${r}`).then(() => {
7010
7023
  }
7011
7024
  ),
7012
7025
  /* @__PURE__ */ c("span", { className: "min-w-[64px] text-center text-[12px] tabular-nums text-slate-500", children: [
7013
- bt(M),
7026
+ ht(M),
7014
7027
  " / ",
7015
- bt(ia)
7028
+ ht(da)
7016
7029
  ] }),
7017
7030
  /* @__PURE__ */ a(
7018
7031
  "button",
7019
7032
  {
7020
7033
  type: "button",
7021
- disabled: M >= ia,
7034
+ disabled: M >= da,
7022
7035
  onClick: () => T((e) => e + 1),
7023
7036
  className: "h-7 rounded px-2.5 text-[12px] text-slate-600 hover:bg-slate-100 disabled:opacity-30 dark:text-slate-300 dark:hover:bg-slate-800",
7024
7037
  children: "Next →"
@@ -7028,7 +7041,7 @@ ${r}`).then(() => {
7028
7041
  "button",
7029
7042
  {
7030
7043
  type: "button",
7031
- disabled: M >= ia || Ya,
7044
+ disabled: M >= da || Ya,
7032
7045
  onClick: () => void vs(),
7033
7046
  "aria-label": "Last page",
7034
7047
  "aria-busy": Ya || void 0,
@@ -7051,19 +7064,19 @@ ${r}`).then(() => {
7051
7064
  }
7052
7065
  ),
7053
7066
  lt != null && lt.length ? /* @__PURE__ */ a(
7054
- fu,
7067
+ bu,
7055
7068
  {
7056
7069
  collection: lt[0].collection,
7057
7070
  itemId: lt[0].itemId,
7058
7071
  width: "85%",
7059
7072
  stack: lt,
7060
- onPush: (e) => xt.push([...lt, e]),
7061
- onPop: () => xt.back(),
7062
- onClose: () => xt.back(lt.length)
7073
+ onPush: (e) => vt.push([...lt, e]),
7074
+ onPop: () => vt.back(),
7075
+ onClose: () => vt.back(lt.length)
7063
7076
  }
7064
7077
  ) : null,
7065
7078
  Tn && /* @__PURE__ */ a(
7066
- ku,
7079
+ yu,
7067
7080
  {
7068
7081
  collection: n,
7069
7082
  item: Tn,
@@ -7073,7 +7086,7 @@ ${r}`).then(() => {
7073
7086
  }
7074
7087
  }
7075
7088
  ),
7076
- Dt && vt && pr && !ce && Me > Ce.length && an.length < Math.min(Me, ga) && /* @__PURE__ */ c("div", { className: "nvr-slide-up-centered fixed bottom-16 left-1/2 z-40 -translate-x-1/2 rounded-full border border-slate-200 bg-white px-4 py-2 text-[12.5px] shadow-lg dark:border-border dark:bg-card", children: [
7089
+ Dt && kt && pr && !ce && Re > Ce.length && an.length < Math.min(Re, ga) && /* @__PURE__ */ c("div", { className: "nvr-slide-up-centered fixed bottom-16 left-1/2 z-40 -translate-x-1/2 rounded-full border border-slate-200 bg-white px-4 py-2 text-[12.5px] shadow-lg dark:border-border dark:bg-card", children: [
7077
7090
  /* @__PURE__ */ c("span", { className: "text-slate-600 dark:text-muted-foreground", children: [
7078
7091
  "All ",
7079
7092
  Ce.length,
@@ -7087,12 +7100,12 @@ ${r}`).then(() => {
7087
7100
  disabled: Qs,
7088
7101
  onClick: () => void ai(),
7089
7102
  className: "font-semibold text-nvr-navy underline decoration-dotted hover:text-nvr-cyan dark:text-nvr-cyan",
7090
- children: Qs ? "Selecting…" : Me > ga ? `Select the first ${ga.toLocaleString()} of ${Me.toLocaleString()} matching` : `Select all ${Me.toLocaleString()} matching rows`
7103
+ children: Qs ? "Selecting…" : Re > ga ? `Select the first ${ga.toLocaleString()} of ${Re.toLocaleString()} matching` : `Select all ${Re.toLocaleString()} matching rows`
7091
7104
  }
7092
7105
  )
7093
7106
  ] }),
7094
- Dt && vt && an.length > 0 && /* @__PURE__ */ a(
7095
- Uu,
7107
+ Dt && kt && an.length > 0 && /* @__PURE__ */ a(
7108
+ zu,
7096
7109
  {
7097
7110
  collection: n,
7098
7111
  selectedIds: an,
@@ -7100,7 +7113,7 @@ ${r}`).then(() => {
7100
7113
  states: (wt == null ? void 0 : wt.states) ?? [],
7101
7114
  fields: (A == null ? void 0 : A.fields) ?? [],
7102
7115
  relations: (A == null ? void 0 : A.relations) ?? [],
7103
- registryKeys: De.bulk_actions ?? null,
7116
+ registryKeys: Pe.bulk_actions ?? null,
7104
7117
  onClear: () => rn([]),
7105
7118
  onSuccess: () => Ca(y, n)
7106
7119
  }
@@ -7109,18 +7122,18 @@ ${r}`).then(() => {
7109
7122
  }
7110
7123
  );
7111
7124
  }
7112
- function Qu(n, o, h, d, w) {
7125
+ function Wu(n, o, h, d, w) {
7113
7126
  const S = Er(o, n, h);
7114
7127
  return S != null && S.one_collection ? /* @__PURE__ */ a(Dr, { relatedCollection: S.one_collection, id: d }) : Wi(d, w);
7115
7128
  }
7116
7129
  export {
7117
- D0 as CollectionBrowserView,
7130
+ M0 as CollectionBrowserView,
7118
7131
  Ra as MultiPick,
7119
- Tu as RowActionsMenu,
7132
+ Lu as RowActionsMenu,
7120
7133
  Kl as TINT_TEXT,
7121
- Qu as compareCell,
7134
+ Wu as compareCell,
7122
7135
  Ca as invalidateCbvRowQueries,
7123
- qu as roleMayDelete,
7124
- $u as roleMayUpdate,
7136
+ Tu as roleMayDelete,
7137
+ qu as roleMayUpdate,
7125
7138
  wa as tintFor
7126
7139
  };