@nivaro/react 0.3.66 → 0.3.67

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 (27) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +8 -1
  4. package/dist/shared/components/ActivityEntry.js +28 -28
  5. package/dist/shared/components/CollectionBrowserView.js +584 -585
  6. package/dist/shared/components/ItemEditForm.js +1758 -1758
  7. package/dist/shared/components/RecordCompare.js +149 -129
  8. package/dist/shared/components/bulk/BulkCompareButton.js +16 -16
  9. package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
  10. package/dist/shared/components/integrations/console/EventsView.js +22 -24
  11. package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
  12. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
  13. package/dist/shared/components/integrations/console/tone.js +22 -21
  14. package/dist/shared/components/item-edit/FieldRow.js +193 -193
  15. package/dist/shared/components/item-edit/GroupSection.js +209 -209
  16. package/dist/shared/components/item-edit/RecordInsights.js +46 -45
  17. package/dist/shared/components/panels/BranchLanes.js +7 -7
  18. package/dist/shared/components/panels/CommentPanel.js +72 -72
  19. package/dist/shared/components/panels/PipelinePanel.js +261 -261
  20. package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
  21. package/dist/shared/components/panels/RevisionsPanel.js +220 -220
  22. package/dist/shared/components/panels/TaskPanel.js +75 -75
  23. package/dist/shared/components/queue/QueueWorklist.js +499 -498
  24. package/dist/shared/lib/compare-value.js +73 -0
  25. package/dist/shared/lib/format-value.js +19 -18
  26. package/dist/shared/lib/utils.js +59 -57
  27. package/package.json +1 -1
@@ -13,94 +13,95 @@ import { useBulkProgressFeed as $i, newBulkProgressId as qi, startBulkProgress a
13
13
  import { csvNumber as Fi, csvDateTime as Ri, readExportExtras as Ei, VIRTUAL_HEADERS as Di, virtualExportCell as Pi } from "../lib/cbv-export.js";
14
14
  import { warmPageLookups as Mi } from "../lib/cbv-page-warm.js";
15
15
  import { post as ye, get as G, patch as xa, del as ya } from "../lib/commands.js";
16
- import { parseDateFilter as Sa, dateFilterBounds as Oi, describeDateFilter as Ai, DATE_FILTER_OPS as Ii, formatDateFilter as Ki } from "../lib/date-filter.js";
17
- import { rowDeleteOffered as ji } from "../lib/delete-offer.js";
18
- import { errorSentence as Bi } from "../lib/error-message.js";
19
- import { errorToastOptions as wa, toastError as zi } from "../lib/error-toast.js";
20
- import { extractExpressionTokens as Qi, evaluateNumeric as gs } from "../lib/expression.js";
21
- import { clauseFromCondition as wr, clauseFromControlValue as Ui, filterSentence as Wi } from "../lib/filter-sentence.js";
22
- import { deliverLive as Vi, releaseLiveOwner as Hi } from "../lib/focus-mode.js";
23
- import { formatValue as Un, formatMultiValue as xs, countFromResolved as Yi } from "../lib/format-value.js";
24
- import { createCursorBook as Ji, pageRequest as Gi, noteNextCursor as Xi, isCursorRefusal as Zi, stopCursors as ed } from "../lib/keyset-pager.js";
25
- import { normalizeInlineEdit as td, inlineM2oTarget as nd, inlineChoices as ad, inlineEditFor as rd, nextInlineKey as ld } from "../lib/list-inline-edit.js";
26
- import { sanitizeCbvLinkState as sd, readListLinkFromLocation as od, dropListLinkParam as id } from "../lib/list-link.js";
27
- import { rememberedListPage as dd, pageWhileSettling as vs, rememberListPage as cd, restoreWindowOutcome as ud } from "../lib/list-page-memory.js";
28
- import { expandCoalesced as pd, LIVE_ASPECTS as wn } from "../lib/live.js";
29
- import { useRowChanges as md, useRowLocks as fd, lockLabel as bd, viewerMatches as hd, conditionFields as gd, mayAffectMatch as xd, writerOf as vd } from "../lib/live-list.js";
30
- import { loadErrorStatus as kd, listLoadErrorText as yd } from "../lib/load-error.js";
31
- import { OPEN_IN_TABS_CAP as wd, openInTabs as _d, openInTabsMessage as ks } from "../lib/open-in-tabs.js";
32
- import { isOwnWrite as Nd } from "../lib/own-writes.js";
33
- import { useIdleNextPage as Sd, intentProps as Cd, prefetchRecord as $d } from "../lib/prefetch.js";
34
- import { useRowPresence as qd, rowPresenceKey as ys } from "../lib/presence-hooks.js";
35
- import { cascadeFilter as Td, fetchCascadeRelations as Ld } from "../lib/quick-filter-cascade.js";
36
- import { useOptionalRealtime as Fd } from "../lib/realtime.js";
37
- import { rowMenuRef as qr, recordRefLabel as Rd, friendlyIdOf as _r, copyWhenReady as Ed, shareableRecordId as Dd, friendlyIdFieldOf as Pd } from "../lib/record-ref.js";
38
- import { rowHighlightDotClass as Md, rowHighlightClass as Od } from "../lib/row-highlight.js";
16
+ import { compareValueText as Oi } from "../lib/compare-value.js";
17
+ import { parseDateFilter as Sa, dateFilterBounds as Ai, describeDateFilter as Ii, DATE_FILTER_OPS as Ki, formatDateFilter as ji } from "../lib/date-filter.js";
18
+ import { rowDeleteOffered as Bi } from "../lib/delete-offer.js";
19
+ import { errorSentence as zi } from "../lib/error-message.js";
20
+ import { errorToastOptions as wa, toastError as Qi } from "../lib/error-toast.js";
21
+ import { extractExpressionTokens as Ui, evaluateNumeric as gs } from "../lib/expression.js";
22
+ import { clauseFromCondition as wr, clauseFromControlValue as Wi, filterSentence as Vi } from "../lib/filter-sentence.js";
23
+ import { deliverLive as Hi, releaseLiveOwner as Yi } from "../lib/focus-mode.js";
24
+ import { formatValue as Un, formatMultiValue as xs, countFromResolved as Ji } from "../lib/format-value.js";
25
+ import { createCursorBook as Gi, pageRequest as Xi, noteNextCursor as Zi, isCursorRefusal as ed, stopCursors as td } from "../lib/keyset-pager.js";
26
+ import { normalizeInlineEdit as nd, inlineM2oTarget as ad, inlineChoices as rd, inlineEditFor as ld, nextInlineKey as sd } from "../lib/list-inline-edit.js";
27
+ import { sanitizeCbvLinkState as od, readListLinkFromLocation as id, dropListLinkParam as dd } from "../lib/list-link.js";
28
+ import { rememberedListPage as cd, pageWhileSettling as vs, rememberListPage as ud, restoreWindowOutcome as pd } from "../lib/list-page-memory.js";
29
+ import { expandCoalesced as md, LIVE_ASPECTS as wn } from "../lib/live.js";
30
+ import { useRowChanges as fd, useRowLocks as bd, lockLabel as hd, viewerMatches as gd, conditionFields as xd, mayAffectMatch as vd, writerOf as kd } from "../lib/live-list.js";
31
+ import { loadErrorStatus as yd, listLoadErrorText as wd } from "../lib/load-error.js";
32
+ import { OPEN_IN_TABS_CAP as _d, openInTabs as Nd, openInTabsMessage as ks } from "../lib/open-in-tabs.js";
33
+ import { isOwnWrite as Sd } from "../lib/own-writes.js";
34
+ import { useIdleNextPage as Cd, intentProps as $d, prefetchRecord as qd } from "../lib/prefetch.js";
35
+ import { useRowPresence as Td, rowPresenceKey as ys } from "../lib/presence-hooks.js";
36
+ import { cascadeFilter as Ld, fetchCascadeRelations as Fd } from "../lib/quick-filter-cascade.js";
37
+ import { useOptionalRealtime as Rd } from "../lib/realtime.js";
38
+ import { rowMenuRef as qr, recordRefLabel as Ed, friendlyIdOf as _r, copyWhenReady as Dd, shareableRecordId as Pd, friendlyIdFieldOf as Md } from "../lib/record-ref.js";
39
+ import { rowHighlightDotClass as Od, rowHighlightClass as Ad } from "../lib/row-highlight.js";
39
40
  import { userErrorMessage as Vt } from "../lib/safe-error.js";
40
- import { logSearch as Ad, logSearchOpen as Id } from "../lib/search-log.js";
41
- import { shapeForField as Kd } from "../lib/skeleton-shapes.js";
42
- import { knownTotalFrom as jd } from "../lib/slow-reason.js";
43
- import { nextSortValue as Bd } from "../lib/sort-cycle.js";
44
- import { useMyScopes as zd, matchScopeDimension as ws, effectiveScopeSeedIds as Qd, translateScopeValues as Ud } from "../lib/use-my-scopes.js";
45
- import { useNewItemLayouts as Wd } from "../lib/use-new-item-layouts.js";
46
- import { loadUserCard as Vd, userCardQuery as Hd } from "../lib/user-cards.js";
47
- import { cn as Wt, humanHours as Yd } from "../lib/utils.js";
48
- import { usePublishAskContext as Jd, useAskRecordDrag as Gd } from "./ai/ask-context.js";
49
- import { useAvailableBulkActions as Xd, bulkActionEnabled as Zd, mergeBulkActions as ec, guardMatches as tc, useBuiltinGate as nc, BulkActionButtons as ac } from "./bulk/BulkActionButtons.js";
50
- import { BulkCompareButton as rc } from "./bulk/BulkCompareButton.js";
51
- import { BulkFieldUpdate as lc } from "./bulk/BulkFieldUpdate.js";
52
- import { BulkRowMark as sc } from "./bulk/BulkRowMark.js";
53
- import { MessageStakeholdersForm as oc } from "./bulk/MessageStakeholders.js";
54
- import { useRowPushActions as ic, runRowPush as dc } from "./bulk/RowPushActions.js";
55
- import { CellCopyLayer as cc } from "./CellCopyLayer.js";
56
- import { CopyAsButton as uc } from "./CopyAsButton.js";
57
- import { useTreeConfig as pc, CollectionTree as mc } from "./cbv/CollectionTree.js";
58
- import { readExportRows as fc, stableSort as bc, m2oLabelPaths as hc, resolveAllPaths as gc, userLabel as xc, m2oLabel as vc, localYmd as kc } from "./cbv/export-rows.js";
59
- import { FormulaColumnAdder as yc } from "./cbv/FormulaColumnAdder.js";
60
- import { useHierarchyScope as wc, HierarchyScopePicker as _c } from "./cbv/HierarchyScope.js";
61
- import { tabStopRowKey as Nc, rowFocusTarget as Sc } from "./cbv/row-focus.js";
62
- import { splitRiskFilter as _s, riskFilterEntry as Cc } from "./cbv/saved-view-risk.js";
63
- import { isFilterRefusal as $c, unknownFieldsOf as Ns, dropUnknownField as qc } from "./cbv/unknown-fields.js";
64
- import { ViewDefaultMenu as Tc } from "./cbv/ViewDefaultMenu.js";
65
- import { useRecordRoomTypes as Lc, canOpenChatRoom as Fc, discussRecord as Rc } from "./chat/chat-core.js";
66
- import { FilterControl as Ec } from "./DataTable.js";
67
- import { FocusModeToggle as Dc } from "./FocusModeToggle.js";
68
- import { FULFILMENT_FILTER_OPTIONS as Ss, FulfilmentPill as Pc, fulfilmentFigures as Mc } from "./FulfilmentPill.js";
69
- import { HScrollProxy as Oc } from "./HScrollProxy.js";
70
- import { useDocumentAutofillConfig as Ac, startDocumentExtraction as Ic } from "./import/DocumentAutofillButton.js";
71
- import { INTEGRATIONS_FILTER_OPTIONS as Cs, IntegrationDots as Kc } from "./integrations/IntegrationDots.js";
72
- import { useQuickPickerSteps as jc, QuickPickerDialog as Bc } from "./item-edit/QuickPickerDialog.js";
73
- import { usePickerExclusion as zc } from "./item-edit/RecordGrantTools.js";
41
+ import { logSearch as Id, logSearchOpen as Kd } from "../lib/search-log.js";
42
+ import { shapeForField as jd } from "../lib/skeleton-shapes.js";
43
+ import { knownTotalFrom as Bd } from "../lib/slow-reason.js";
44
+ import { nextSortValue as zd } from "../lib/sort-cycle.js";
45
+ import { useMyScopes as Qd, matchScopeDimension as ws, effectiveScopeSeedIds as Ud, translateScopeValues as Wd } from "../lib/use-my-scopes.js";
46
+ import { useNewItemLayouts as Vd } from "../lib/use-new-item-layouts.js";
47
+ import { loadUserCard as Hd, userCardQuery as Yd } from "../lib/user-cards.js";
48
+ import { cn as Wt, humanHours as Jd, formatDateTime as Gd } from "../lib/utils.js";
49
+ import { usePublishAskContext as Xd, useAskRecordDrag as Zd } from "./ai/ask-context.js";
50
+ import { useAvailableBulkActions as ec, bulkActionEnabled as tc, mergeBulkActions as nc, guardMatches as ac, useBuiltinGate as rc, BulkActionButtons as lc } from "./bulk/BulkActionButtons.js";
51
+ import { BulkCompareButton as sc } from "./bulk/BulkCompareButton.js";
52
+ import { BulkFieldUpdate as oc } from "./bulk/BulkFieldUpdate.js";
53
+ import { BulkRowMark as ic } from "./bulk/BulkRowMark.js";
54
+ import { MessageStakeholdersForm as dc } from "./bulk/MessageStakeholders.js";
55
+ import { useRowPushActions as cc, runRowPush as uc } from "./bulk/RowPushActions.js";
56
+ import { CellCopyLayer as pc } from "./CellCopyLayer.js";
57
+ import { CopyAsButton as mc } from "./CopyAsButton.js";
58
+ import { useTreeConfig as fc, CollectionTree as bc } from "./cbv/CollectionTree.js";
59
+ import { readExportRows as hc, stableSort as gc, m2oLabelPaths as xc, resolveAllPaths as vc, userLabel as kc, m2oLabel as yc, localYmd as wc } from "./cbv/export-rows.js";
60
+ import { FormulaColumnAdder as _c } from "./cbv/FormulaColumnAdder.js";
61
+ import { useHierarchyScope as Nc, HierarchyScopePicker as Sc } from "./cbv/HierarchyScope.js";
62
+ import { tabStopRowKey as Cc, rowFocusTarget as $c } from "./cbv/row-focus.js";
63
+ import { splitRiskFilter as _s, riskFilterEntry as qc } from "./cbv/saved-view-risk.js";
64
+ import { isFilterRefusal as Tc, unknownFieldsOf as Ns, dropUnknownField as Lc } from "./cbv/unknown-fields.js";
65
+ import { ViewDefaultMenu as Fc } from "./cbv/ViewDefaultMenu.js";
66
+ import { useRecordRoomTypes as Rc, canOpenChatRoom as Ec, discussRecord as Dc } from "./chat/chat-core.js";
67
+ import { FilterControl as Pc } from "./DataTable.js";
68
+ import { FocusModeToggle as Mc } from "./FocusModeToggle.js";
69
+ import { FULFILMENT_FILTER_OPTIONS as Ss, FulfilmentPill as Oc, fulfilmentFigures as Ac } from "./FulfilmentPill.js";
70
+ import { HScrollProxy as Ic } from "./HScrollProxy.js";
71
+ import { useDocumentAutofillConfig as Kc, startDocumentExtraction as jc } from "./import/DocumentAutofillButton.js";
72
+ import { INTEGRATIONS_FILTER_OPTIONS as Cs, IntegrationDots as Bc } from "./integrations/IntegrationDots.js";
73
+ import { useQuickPickerSteps as zc, QuickPickerDialog as Qc } from "./item-edit/QuickPickerDialog.js";
74
+ import { usePickerExclusion as Uc } from "./item-edit/RecordGrantTools.js";
74
75
  import { invalidateRecordQueries as $s } from "./item-edit/RecordLiveSync.js";
75
- import { relatedMissing as Qc } from "./item-edit/related-missing.js";
76
+ import { relatedMissing as Wc } from "./item-edit/related-missing.js";
76
77
  import { UserRosterCluster as qs, UserChip as Ts } from "./item-edit/UserChip.js";
77
- import { LiveRowMark as Uc } from "./LiveRowMark.js";
78
- import { CopyListLinkButton as Wc } from "./list/CopyListLinkButton.js";
79
- import { useInlineEdit as Vc, InlineEditCell as Hc } from "./list/InlineEdit.js";
80
- import { MapView as Yc } from "./MapView.js";
81
- import { usePickerExcludedRows as Jc, PICKER_EXCLUDED_ROW_CLASS as Gc, PICKER_EXCLUDED_TITLE as Xc } from "./PickerExcludedRows.js";
78
+ import { LiveRowMark as Vc } from "./LiveRowMark.js";
79
+ import { CopyListLinkButton as Hc } from "./list/CopyListLinkButton.js";
80
+ import { useInlineEdit as Yc, InlineEditCell as Jc } from "./list/InlineEdit.js";
81
+ import { MapView as Gc } from "./MapView.js";
82
+ import { usePickerExcludedRows as Xc, PICKER_EXCLUDED_ROW_CLASS as Zc, PICKER_EXCLUDED_TITLE as eu } from "./PickerExcludedRows.js";
82
83
  import { ConfirmButton as Ks } from "./profile/primitives.js";
83
- import { RealtimeStaleMark as Zc } from "./RealtimeStatusBanner.js";
84
- import { RecordDrilldownSheet as eu } from "./RecordDrilldownSheet.js";
85
- import { RowHighlightLegend as tu } from "./RowHighlightLegend.js";
86
- import { RowPresence as nu } from "./RowPresence.js";
87
- import { TableSkeletonRows as au } from "./Skeletons.js";
88
- import { SlowNoticeView as ru } from "./SlowNotice.js";
89
- import { TipLayer as lu } from "./TipLayer.js";
84
+ import { RealtimeStaleMark as tu } from "./RealtimeStatusBanner.js";
85
+ import { RecordDrilldownSheet as nu } from "./RecordDrilldownSheet.js";
86
+ import { RowHighlightLegend as au } from "./RowHighlightLegend.js";
87
+ import { RowPresence as ru } from "./RowPresence.js";
88
+ import { TableSkeletonRows as lu } from "./Skeletons.js";
89
+ import { SlowNoticeView as su } from "./SlowNotice.js";
90
+ import { TipLayer as ou } from "./TipLayer.js";
90
91
  import { UnseenDot as Ls } from "./UnseenDot.js";
91
- import { SimpleSelectXs as _n, SimpleSelect as su } from "./ui/SimpleSelect.js";
92
- import { RevisionsPanel as ou } from "./panels/RevisionsPanel.js";
93
- import { itemActionChoiceStep as iu, ItemActionChoiceList as du } from "./panels/ItemActionChoices.js";
94
- function Hn(n, d, h) {
95
- const i = n.find((v) => v.one_collection === d && v.one_field === h);
96
- if (i != null && i.many_collection)
97
- return { kind: i.junction_field ? "m2m" : "o2m", relation: i };
92
+ import { SimpleSelectXs as _n, SimpleSelect as iu } from "./ui/SimpleSelect.js";
93
+ import { RevisionsPanel as du } from "./panels/RevisionsPanel.js";
94
+ import { itemActionChoiceStep as cu, ItemActionChoiceList as uu } from "./panels/ItemActionChoices.js";
95
+ function Hn(n, i, h) {
96
+ const d = n.find((v) => v.one_collection === i && v.one_field === h);
97
+ if (d != null && d.many_collection)
98
+ return { kind: d.junction_field ? "m2m" : "o2m", relation: d };
98
99
  }
99
100
  function Wn(n) {
100
101
  if (!n) return "id";
101
- const d = new Set(n.fields.map((i) => i.field)), h = [...(n.display_template ?? "").matchAll(/\{\{(\w+)/g)].map((i) => i[1]);
102
- for (const i of h) if (d.has(i)) return i;
103
- for (const i of Lr) if (d.has(i)) return i;
102
+ const i = new Set(n.fields.map((d) => d.field)), h = [...(n.display_template ?? "").matchAll(/\{\{(\w+)/g)].map((d) => d[1]);
103
+ for (const d of h) if (i.has(d)) return d;
104
+ for (const d of Lr) if (i.has(d)) return d;
104
105
  return "id";
105
106
  }
106
107
  const Fs = (n) => typeof n == "string" ? n : n.key, Rs = {
@@ -109,17 +110,17 @@ const Fs = (n) => typeof n == "string" ? n : n.key, Rs = {
109
110
  green: "text-emerald-600 dark:text-emerald-400 font-semibold",
110
111
  blue: "text-sky-600 dark:text-sky-400 font-semibold"
111
112
  };
112
- function va(n, d) {
113
- if (!d || d.length === 0) return null;
114
- const h = n == null ? "" : String(n), i = Number(h);
115
- for (const v of d) {
116
- const _ = Number(v.value), $ = Number.isFinite(i) && Number.isFinite(_);
113
+ function va(n, i) {
114
+ if (!i || i.length === 0) return null;
115
+ const h = n == null ? "" : String(n), d = Number(h);
116
+ for (const v of i) {
117
+ const _ = Number(v.value), $ = Number.isFinite(d) && Number.isFinite(_);
117
118
  switch (v.op) {
118
119
  case "gt":
119
- if ($ && i > _) return v.color;
120
+ if ($ && d > _) return v.color;
120
121
  break;
121
122
  case "lt":
122
- if ($ && i < _) return v.color;
123
+ if ($ && d < _) return v.color;
123
124
  break;
124
125
  case "eq":
125
126
  if (h.toLowerCase() === String(v.value ?? "").toLowerCase()) return v.color;
@@ -140,7 +141,7 @@ function va(n, d) {
140
141
  }
141
142
  return null;
142
143
  }
143
- const cu = [
144
+ const pu = [
144
145
  { label: "None", cfg: null },
145
146
  { label: "Currency", cfg: { type: "number", decimals: 2, thousands: !0, prefix: "$" } },
146
147
  { label: "Number", cfg: { type: "number", thousands: !0 } },
@@ -150,55 +151,57 @@ const cu = [
150
151
  { label: "Relative time", cfg: { type: "datetime", template: "relative" } },
151
152
  { label: "Yes / No", cfg: { type: "boolean", true_label: "Yes", false_label: "No" } },
152
153
  { label: "Count (related)", cfg: { type: "count" } }
153
- ], Ae = (n) => n.replace(/_/g, " ").replace(/\b\w/g, (d) => d.toUpperCase()), Lr = ["name", "title", "label", "display_name", "subject", "email", "slug"];
154
- function Tr(n, d) {
155
- if (!n) return ["id", d, ...Lr].join(",");
156
- const h = [...n.matchAll(/\{\{([\w.]+)\}\}/g)].map((i) => i[1]);
157
- return h.some((i) => i.includes(".")) ? null : [.../* @__PURE__ */ new Set(["id", d, ...h])].join(",");
154
+ ], Ae = (n) => n.replace(/_/g, " ").replace(/\b\w/g, (i) => i.toUpperCase()), Lr = ["name", "title", "label", "display_name", "subject", "email", "slug"];
155
+ function Tr(n, i) {
156
+ if (!n) return ["id", i, ...Lr].join(",");
157
+ const h = [...n.matchAll(/\{\{([\w.]+)\}\}/g)].map((d) => d[1]);
158
+ return h.some((d) => d.includes(".")) ? null : [.../* @__PURE__ */ new Set(["id", i, ...h])].join(",");
158
159
  }
159
- function Ca(n, d) {
160
+ function Ca(n, i) {
160
161
  if (!n) {
161
162
  for (const h of Lr) {
162
- const i = d[h];
163
- if (i != null && i !== "") return String(i);
163
+ const d = i[h];
164
+ if (d != null && d !== "") return String(d);
164
165
  }
165
- return String(d.id ?? "");
166
+ return String(i.id ?? "");
166
167
  }
167
- return n.replace(/\{\{([\w.]+)\}\}/g, (h, i) => {
168
- const v = i.split(".").reduce((_, $) => _ == null ? void 0 : _[$], d);
168
+ return n.replace(/\{\{([\w.]+)\}\}/g, (h, d) => {
169
+ const v = d.split(".").reduce((_, $) => _ == null ? void 0 : _[$], i);
169
170
  return v == null ? "" : String(v);
170
171
  });
171
172
  }
172
- function Fr(n, d, h) {
173
+ function Fr(n, i, h) {
173
174
  return n.find(
174
- (i) => i.many_collection === d && i.many_field === h && i.junction_field === null && i.one_collection !== null
175
+ (d) => d.many_collection === i && d.many_field === h && // Loose: a relation list may omit junction_field rather than send null
176
+ // (record compare showed a raw "124133", army 11 staging check).
177
+ !d.junction_field && !!d.one_collection
175
178
  );
176
179
  }
177
- function uu(n) {
178
- const d = new Date(String(n));
179
- if (Number.isNaN(d.getTime())) return String(n);
180
- const h = Date.now() - d.getTime(), i = Math.floor(h / 6e4);
181
- if (i < 1) return "just now";
182
- if (i < 60) return `${i}m ago`;
183
- const v = Math.floor(i / 60);
180
+ function mu(n) {
181
+ const i = new Date(String(n));
182
+ if (Number.isNaN(i.getTime())) return String(n);
183
+ const h = Date.now() - i.getTime(), d = Math.floor(h / 6e4);
184
+ if (d < 1) return "just now";
185
+ if (d < 60) return `${d}m ago`;
186
+ const v = Math.floor(d / 60);
184
187
  if (v < 24) return `${v}h ago`;
185
188
  const _ = Math.floor(v / 24);
186
- return _ < 7 ? `${_}d ago` : d.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
189
+ return _ < 7 ? `${_}d ago` : i.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
187
190
  }
188
191
  const ct = (n) => n.toLocaleString("en-US"), js = /* @__PURE__ */ new Set(["nivaro_users", "directus_users"]), wt = (n) => n.startsWith("directus_") || n.startsWith("nivaro_"), Nr = /* @__PURE__ */ new Map();
189
- function Bs(n, d, h) {
190
- let i = Nr.get(d);
191
- i || (i = { ids: /* @__PURE__ */ new Set(), waiters: [], promise: null }, Nr.set(d, i));
192
- const v = i;
192
+ function Bs(n, i, h) {
193
+ let d = Nr.get(i);
194
+ d || (d = { ids: /* @__PURE__ */ new Set(), waiters: [], promise: null }, Nr.set(i, d));
195
+ const v = d;
193
196
  return v.ids.add(h), v.promise || (v.promise = new Promise((_) => {
194
197
  setTimeout(() => {
195
- Nr.delete(d);
198
+ Nr.delete(i);
196
199
  const $ = [...v.ids], T = [];
197
200
  for (let N = 0; N < $.length; N += 200) T.push($.slice(N, N + 200));
198
201
  Promise.all(
199
202
  T.map(
200
203
  (N) => n.request(
201
- G(`/items/${d}`, {
204
+ G(`/items/${i}`, {
202
205
  filter: JSON.stringify({ id: { _in: N } }),
203
206
  limit: N.length,
204
207
  fields: "*",
@@ -216,16 +219,16 @@ function Bs(n, d, h) {
216
219
  }, 0);
217
220
  })), v.promise.then((_) => _.get(h) ?? null);
218
221
  }
219
- const pu = {
222
+ const fu = {
220
223
  draft: "draft",
221
224
  submitted: "submitted",
222
225
  review: "in review",
223
226
  approved: "approved",
224
227
  rejected: "rejected"
225
228
  };
226
- function mu({ summary: n }) {
229
+ function bu({ summary: n }) {
227
230
  if (!n || n.total === 0) return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
228
- const d = n.latest, h = n.active > 0, i = d ? pu[d.status] ?? d.status : "", v = d == null ? void 0 : d.cost_impact, _ = v != null && v !== 0 ? `${v > 0 ? "+" : "−"}$${Math.abs(v).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null, $ = d ? `${d.title ?? "Addendum"} — ${i}${n.total > 1 ? ` (${n.total} total)` : ""}` : void 0;
231
+ const i = n.latest, h = n.active > 0, d = i ? fu[i.status] ?? i.status : "", v = i == null ? void 0 : i.cost_impact, _ = v != null && v !== 0 ? `${v > 0 ? "+" : "−"}$${Math.abs(v).toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}` : null, $ = i ? `${i.title ?? "Addendum"} — ${d}${n.total > 1 ? ` (${n.total} total)` : ""}` : void 0;
229
232
  return /* @__PURE__ */ c(
230
233
  "span",
231
234
  {
@@ -239,7 +242,7 @@ function mu({ summary: n }) {
239
242
  className: `h-1.5 w-1.5 shrink-0 rounded-full ${h ? "bg-amber-500" : "bg-slate-400"}`
240
243
  }
241
244
  ),
242
- h ? `${n.active} ${n.active === 1 ? "addendum" : "addendums"} ${i || "active"}` : `${n.total} ${i}`,
245
+ h ? `${n.active} ${n.active === 1 ? "addendum" : "addendums"} ${d || "active"}` : `${n.total} ${d}`,
243
246
  _ && /* @__PURE__ */ c("span", { className: "tabular-nums opacity-80", children: [
244
247
  "· ",
245
248
  _
@@ -248,17 +251,17 @@ function mu({ summary: n }) {
248
251
  }
249
252
  );
250
253
  }
251
- function Rr({ relatedCollection: n, id: d }) {
252
- const h = vt(), i = js.has(n), v = d != null && d !== "", { data: _ } = te({
254
+ function Rr({ relatedCollection: n, id: i }) {
255
+ const h = vt(), d = js.has(n), v = i != null && i !== "", { data: _ } = te({
253
256
  queryKey: ["cbv-collection-meta", n],
254
257
  queryFn: () => h.request(G(`/collections/${n}`)).then((C) => C.data),
255
258
  staleTime: 10 * 6e4,
256
259
  enabled: !wt(n),
257
260
  retry: !1
258
261
  }), { data: $, isLoading: T } = te({
259
- queryKey: ["cbv-relation-item", n, String(d)],
260
- queryFn: () => i ? h.request(G(`/users/${d}`)).then((C) => C.data) : Bs(h, n, String(d)),
261
- enabled: v && (i || !wt(n)),
262
+ queryKey: ["cbv-relation-item", n, String(i)],
263
+ queryFn: () => d ? h.request(G(`/users/${i}`)).then((C) => C.data) : Bs(h, n, String(i)),
264
+ enabled: v && (d || !wt(n)),
262
265
  staleTime: 30 * 6e4,
263
266
  retry: !1
264
267
  });
@@ -266,7 +269,7 @@ function Rr({ relatedCollection: n, id: d }) {
266
269
  if (T)
267
270
  return /* @__PURE__ */ a("span", { className: "inline-block h-3.5 w-24 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
268
271
  if (!$) {
269
- const C = Qc(null);
272
+ const C = Wc(null);
270
273
  return /* @__PURE__ */ a(
271
274
  "span",
272
275
  {
@@ -277,21 +280,21 @@ function Rr({ relatedCollection: n, id: d }) {
277
280
  }
278
281
  );
279
282
  }
280
- const N = i ? String(
283
+ const N = d ? String(
281
284
  [$.first_name, $.last_name].filter(Boolean).join(" ") || $.email || $.id || ""
282
285
  ) : Ca((_ == null ? void 0 : _.display_template) ?? null, $);
283
286
  return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: N });
284
287
  }
285
- function zs(n, d, h, i, v, _) {
286
- const $ = d.getQueryData(["cbv-collection-meta", h]);
287
- return Ed(
288
- Dd(n, h, $, i, v).then(
288
+ function zs(n, i, h, d, v, _) {
289
+ const $ = i.getQueryData(["cbv-collection-meta", h]);
290
+ return Dd(
291
+ Pd(n, h, $, d, v).then(
289
292
  (T) => window.location.origin + _({ collection: h, itemId: T })
290
293
  )
291
294
  ).catch(() => {
292
295
  });
293
296
  }
294
- function _a(n, d) {
297
+ function _a(n, i) {
295
298
  for (const h of [
296
299
  "cbv-items",
297
300
  "cbv-pipeline-instances",
@@ -301,23 +304,23 @@ function _a(n, d) {
301
304
  "cbv-resolved",
302
305
  "cbv-row-instance"
303
306
  ])
304
- n.invalidateQueries({ queryKey: [h, d] });
307
+ n.invalidateQueries({ queryKey: [h, i] });
305
308
  }
306
- function fu(n, d) {
309
+ function hu(n, i) {
307
310
  return n ? n.is_admin ? !0 : (n.collections ?? []).some(
308
- (h) => (h.collection === d || h.collection === "*") && (h.actions.includes("update") || h.actions.includes("*"))
311
+ (h) => (h.collection === i || h.collection === "*") && (h.actions.includes("update") || h.actions.includes("*"))
309
312
  ) : !1;
310
313
  }
311
- function bu(n, d) {
314
+ function gu(n, i) {
312
315
  return n ? n.is_admin ? !0 : (n.collections ?? []).some(
313
- (h) => (h.collection === d || h.collection === "*") && (h.actions.includes("delete") || h.actions.includes("*"))
316
+ (h) => (h.collection === i || h.collection === "*") && (h.actions.includes("delete") || h.actions.includes("*"))
314
317
  ) : !1;
315
318
  }
316
- function hu({
319
+ function xu({
317
320
  collection: n,
318
- id: d,
321
+ id: i,
319
322
  hasPipeline: h,
320
- onOpen: i,
323
+ onOpen: d,
321
324
  onPeek: v,
322
325
  onAudit: _,
323
326
  urlFor: $,
@@ -333,7 +336,7 @@ function hu({
333
336
  label: M,
334
337
  meta: k.getQueryData(["cbv-collection-meta", n]),
335
338
  row: C,
336
- id: d,
339
+ id: i,
337
340
  collection: n
338
341
  }), [m, E] = y(!1), [A, I] = y({ x: 0, y: 0 }), F = he(null), ee = he(null);
339
342
  me(() => {
@@ -344,10 +347,10 @@ function hu({
344
347
  queryFn: () => u.request(G("/security/my/permissions")).then((b) => b.data),
345
348
  enabled: m && !Y,
346
349
  staleTime: 5 * 6e4
347
- }), ce = zc(n, String(d), {
350
+ }), ce = Uc(n, String(i), {
348
351
  enabled: m && Y,
349
352
  onDone: () => E(!1)
350
- }), [Ie, X] = y(!1), qe = Lc(m), Ye = Fc() && !!(qe != null && qe.some((b) => b.collection === n));
353
+ }), [Ie, X] = y(!1), qe = Rc(m), Ye = Ec() && !!(qe != null && qe.some((b) => b.collection === n));
351
354
  me(() => {
352
355
  if (!m) return;
353
356
  const b = (J) => {
@@ -362,53 +365,53 @@ function hu({
362
365
  };
363
366
  }, [m]);
364
367
  const { data: Z } = te({
365
- queryKey: ["cbv-row-instance", n, String(d)],
366
- queryFn: () => u.request(G(`/pipelines/instance/${n}/${d}`)).then((b) => b.data).catch(() => null),
368
+ queryKey: ["cbv-row-instance", n, String(i)],
369
+ queryFn: () => u.request(G(`/pipelines/instance/${n}/${i}`)).then((b) => b.data).catch(() => null),
367
370
  enabled: m && h,
368
371
  staleTime: 15e3
369
372
  }), q = ke(
370
373
  () => ((Z == null ? void 0 : Z.available_transitions) ?? []).filter((b) => b.in_row_menu !== !1),
371
374
  [Z]
372
- ), { data: se } = Xd(m ? [n] : []), fe = ji({
375
+ ), { data: oe } = ec(m ? [n] : []), fe = Bi({
373
376
  isAdmin: Y,
374
- roleMayDelete: bu(de, n),
375
- builtinOpen: se ? (se[n] ?? []).some((b) => b.source === "builtin" && b.key === "delete") && Zd(B, n, "delete") : void 0,
377
+ roleMayDelete: gu(de, n),
378
+ builtinOpen: oe ? (oe[n] ?? []).some((b) => b.source === "builtin" && b.key === "delete") && tc(B, n, "delete") : void 0,
376
379
  hasPipeline: h,
377
380
  run: h ? Z === void 0 ? void 0 : Z : null
378
- }), oe = ke(
379
- () => m ? ec(se, [n], B).filter(
381
+ }), ae = ke(
382
+ () => m ? nc(oe, [n], B).filter(
380
383
  // Transition-kind registry actions (Cancel / Uncancel) are the pipeline
381
384
  // transitions already listed above — never the same move twice.
382
385
  (b) => b.kind !== "builtin" && b.kind !== "transition"
383
386
  ) : [],
384
- [m, se, n, B]
387
+ [m, oe, n, B]
385
388
  ), Me = ke(() => {
386
389
  const b = /* @__PURE__ */ new Set();
387
- for (const R of oe)
390
+ for (const R of ae)
388
391
  for (const J of R.guard ?? [])
389
392
  J && typeof J.field == "string" && !(C && J.field in C) && b.add(J.field);
390
393
  return [...b].sort();
391
- }, [oe, C]), { data: ie } = te({
392
- queryKey: ["row-action-guard", n, String(d), Me.join(",")],
394
+ }, [ae, C]), { data: ie } = te({
395
+ queryKey: ["row-action-guard", n, String(i), Me.join(",")],
393
396
  queryFn: () => u.request(
394
- G(`/items/${encodeURIComponent(n)}/${encodeURIComponent(String(d))}`, {
397
+ G(`/items/${encodeURIComponent(n)}/${encodeURIComponent(String(i))}`, {
395
398
  fields: Me.join(",")
396
399
  })
397
400
  ).then((b) => b.data ?? {}).catch(() => ({})),
398
401
  enabled: m && Me.length > 0,
399
402
  staleTime: 0
400
403
  }), w = ke(() => {
401
- if (Me.length > 0 && !ie) return oe.filter((R) => {
404
+ if (Me.length > 0 && !ie) return ae.filter((R) => {
402
405
  var J;
403
406
  return !((J = R.guard) != null && J.length);
404
407
  });
405
408
  const b = { ...ie ?? {}, ...C ?? {} };
406
- return oe.filter((R) => tc(R.guard, b) !== !1);
407
- }, [oe, Me, ie, C]), { pushActions: be, failedPartners: ae } = ic({
409
+ return ae.filter((R) => ac(R.guard, b) !== !1);
410
+ }, [ae, Me, ie, C]), { pushActions: be, failedPartners: re } = cc({
408
411
  collection: n,
409
- id: d,
412
+ id: i,
410
413
  open: m,
411
- bulkData: se,
414
+ bulkData: oe,
412
415
  bulkEnabledKeys: B
413
416
  }), Ce = ke(
414
417
  () => new Map(((Z == null ? void 0 : Z.states) ?? []).map((b) => [b.id, b])),
@@ -444,15 +447,15 @@ function hu({
444
447
  m || (et(null), Nn(""), X(!1));
445
448
  }, [m]);
446
449
  const Be = (($n = Q == null ? void 0 : Q.push) == null ? void 0 : $n.kind) === "push" && Q.push.action.choose ? Q.push.action : null, Yt = te({
447
- queryKey: ["item-action-choices", (Be == null ? void 0 : Be.id) ?? null, n, String(d)],
450
+ queryKey: ["item-action-choices", (Be == null ? void 0 : Be.id) ?? null, n, String(i)],
448
451
  queryFn: () => u.request(
449
- G(`/item-actions/${Be.id}/choices`, { collection: n, item: String(d) })
452
+ G(`/item-actions/${Be.id}/choices`, { collection: n, item: String(i) })
450
453
  ).then((b) => b.data ?? []),
451
454
  enabled: !!Be,
452
455
  staleTime: 0
453
456
  }), [At, sn] = y(null), Sn = (Be == null ? void 0 : Be.id) ?? null;
454
457
  me(() => sn(null), [Sn]);
455
- const nt = Yt.data ? iu(Yt.data) : null, pt = nt && !nt.ask ? nt.value : At, Ft = !!Be && (!nt || nt.ask && At == null);
458
+ const nt = Yt.data ? cu(Yt.data) : null, pt = nt && !nt.ask ? nt.value : At, Ft = !!Be && (!nt || nt.ask && At == null);
456
459
  ki.useLayoutEffect(() => {
457
460
  var Oe;
458
461
  if (!m) return;
@@ -468,7 +471,7 @@ function hu({
468
471
  }, [m, A, Q, q.length]);
469
472
  const _t = xt({
470
473
  mutationFn: ({ transitionId: b, comment: R }) => u.request(
471
- ye(`/pipelines/instance/${n}/${d}/transition`, {
474
+ ye(`/pipelines/instance/${n}/${i}/transition`, {
472
475
  transition_id: b,
473
476
  ...R != null && R.trim() ? { comment: R.trim() } : {}
474
477
  })
@@ -476,7 +479,7 @@ function hu({
476
479
  onSuccess: (b, R) => {
477
480
  E(!1);
478
481
  const J = q.find((pe) => pe.id === R.transitionId);
479
- we.success(J ? `${L.name} moved to ${Ht(J)}` : `${L.name} moved`), _a(k, n), $s(k, n, [d]), N == null || N();
482
+ we.success(J ? `${L.name} moved to ${Ht(J)}` : `${L.name} moved`), _a(k, n), $s(k, n, [i]), N == null || N();
480
483
  },
481
484
  onError: (b) => we.error(
482
485
  Vt(b, "Transition failed"),
@@ -484,7 +487,7 @@ function hu({
484
487
  )
485
488
  }), on = xt({
486
489
  mutationFn: async ({ action: b, comment: R }) => {
487
- const J = { collection: n, ids: [d], reason: (R == null ? void 0 : R.trim()) || null }, pe = b.source === "db" ? await u.request(ye("/bulk-actions/run", { ...J, key: b.key })) : await u.request(ye(`/bulk-actions/${b.key}/execute`, J));
490
+ const J = { collection: n, ids: [i], reason: (R == null ? void 0 : R.trim()) || null }, pe = b.source === "db" ? await u.request(ye("/bulk-actions/run", { ...J, key: b.key })) : await u.request(ye(`/bulk-actions/${b.key}/execute`, J));
488
491
  return { action: b, result: pe.data ?? {} };
489
492
  },
490
493
  onSuccess: ({ action: b, result: R }) => {
@@ -500,14 +503,14 @@ function hu({
500
503
  we.info(`${L.name}: ${Xt ?? "nothing to change"}`);
501
504
  return;
502
505
  }
503
- we.success(`${b.label} — done on ${L.name}`), _a(k, n), $s(k, n, [d]), N == null || N();
506
+ we.success(`${b.label} — done on ${L.name}`), _a(k, n), $s(k, n, [i]), N == null || N();
504
507
  },
505
508
  onError: (b) => {
506
509
  const R = b.response;
507
510
  we.error((R == null ? void 0 : R.error) ?? Vt(b, "Action failed"), wa(b));
508
511
  }
509
512
  }), Nt = xt({
510
- mutationFn: ({ op: b, note: R, pick: J }) => dc(u, n, d, b, R, J).then((pe) => ({ op: b, outcome: pe })),
513
+ mutationFn: ({ op: b, note: R, pick: J }) => uc(u, n, i, b, R, J).then((pe) => ({ op: b, outcome: pe })),
511
514
  onSuccess: ({ op: b, outcome: R }) => {
512
515
  E(!1);
513
516
  const J = b.kind === "push" ? b.action.label : "Retry";
@@ -594,7 +597,7 @@ function hu({
594
597
  }
595
598
  ),
596
599
  (Be == null ? void 0 : Be.choose) && (Yt.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." }) : Yt.isLoading ? /* @__PURE__ */ a("p", { className: "mb-1.5 px-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: "Loading…" }) : nt != null && nt.ask ? /* @__PURE__ */ a("div", { className: "mb-1.5 -mt-3 px-1", children: /* @__PURE__ */ a(
597
- du,
600
+ uu,
598
601
  {
599
602
  choose: Be.choose,
600
603
  options: Yt.data ?? [],
@@ -630,14 +633,14 @@ function hu({
630
633
  placeholder: ((mt = Q.push) == null ? void 0 : mt.kind) === "push" ? ((qn = (at = Q.push.action.confirm) == null ? void 0 : at.input) == null ? void 0 : qn.placeholder) ?? ((cn = (dn = Q.push.action.confirm) == null ? void 0 : dn.input) == null ? void 0 : cn.label) ?? "" : (Jt = Q.action) != null && Jt.require_reason || ((Gt = q.find((b) => b.id === Q.picked)) == null ? void 0 : Gt.comment_mode) === "required" ? "Reason (required — recorded on the record’s history)…" : "Reason (optional)…",
631
634
  rows: 2,
632
635
  "aria-label": ((Jn = Q.push) == null ? void 0 : Jn.kind) === "push" ? ((ue = (Gn = Q.push.action.confirm) == null ? void 0 : Gn.input) == null ? void 0 : ue.label) ?? "Note" : "Reason",
633
- "aria-describedby": Cn ? `row-reason-hint-${String(d)}` : void 0,
636
+ "aria-describedby": Cn ? `row-reason-hint-${String(i)}` : void 0,
634
637
  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"
635
638
  }
636
639
  ),
637
640
  Cn && /* @__PURE__ */ a(
638
641
  "p",
639
642
  {
640
- id: `row-reason-hint-${String(d)}`,
643
+ id: `row-reason-hint-${String(i)}`,
641
644
  className: "mt-1 px-1 text-[11px] text-slate-500 dark:text-slate-400",
642
645
  "data-row-reason-hint": !0,
643
646
  children: "Add a reason to continue."
@@ -669,16 +672,16 @@ function hu({
669
672
  ] })
670
673
  ] }) : /* @__PURE__ */ c(Ue, { children: [
671
674
  We("Open", () => {
672
- E(!1), i();
675
+ E(!1), d();
673
676
  }),
674
677
  We("Open in new tab", () => {
675
- E(!1), window.open($({ collection: n, itemId: String(d) }), "_blank");
678
+ E(!1), window.open($({ collection: n, itemId: String(i) }), "_blank");
676
679
  }),
677
680
  v && We("Peek details", () => {
678
681
  E(!1), v();
679
682
  }),
680
683
  Ye && We("Discuss in chat", () => {
681
- E(!1), Rc(u, n, String(d)).then((b) => {
684
+ E(!1), Dc(u, n, String(i)).then((b) => {
682
685
  b || we.error("This record has no chat room you can open");
683
686
  }).catch(() => we.error("Could not open the chat room"));
684
687
  }),
@@ -736,7 +739,7 @@ function hu({
736
739
  `${b.source}:${b.key}`
737
740
  ))
738
741
  ] }),
739
- (be.length > 0 || ae.length > 0) && /* @__PURE__ */ c(Ue, { children: [
742
+ (be.length > 0 || re.length > 0) && /* @__PURE__ */ c(Ue, { children: [
740
743
  Rt,
741
744
  /* @__PURE__ */ a("p", { className: "px-3 pb-0.5 pt-1 text-[9.5px] font-bold uppercase tracking-wider text-slate-400", children: "Integrations" }),
742
745
  be.map((b) => /* @__PURE__ */ a(
@@ -757,17 +760,17 @@ function hu({
757
760
  },
758
761
  b.id
759
762
  )),
760
- ae.length > 0 && /* @__PURE__ */ c(
763
+ re.length > 0 && /* @__PURE__ */ c(
761
764
  "button",
762
765
  {
763
766
  type: "button",
764
- "data-row-retry-push": ae.join(","),
765
- title: `Latest push failed: ${ae.join(", ")}`,
767
+ "data-row-retry-push": re.join(","),
768
+ title: `Latest push failed: ${re.join(", ")}`,
766
769
  onClick: () => et({
767
770
  label: "Retry last failed push",
768
771
  options: [],
769
772
  picked: null,
770
- push: { kind: "retry", partners: ae }
773
+ push: { kind: "retry", partners: re }
771
774
  }),
772
775
  className: "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[12px] text-red-700 hover:bg-red-50 dark:text-red-300 dark:hover:bg-red-950",
773
776
  children: [
@@ -789,7 +792,7 @@ function hu({
789
792
  E(!1), (b = navigator.clipboard) == null || b.writeText(L.copy ?? ""), we.success("ID copied");
790
793
  }),
791
794
  We("Copy link", () => {
792
- E(!1), zs(u, k, n, C, d, $), we.success("Link copied");
795
+ E(!1), zs(u, k, n, C, i, $), we.success("Link copied");
793
796
  }),
794
797
  Y && /* @__PURE__ */ c(Ue, { children: [
795
798
  Rt,
@@ -859,25 +862,25 @@ function Sr(n) {
859
862
  }
860
863
  function Es({
861
864
  collection: n,
862
- field: d,
865
+ field: i,
863
866
  fieldType: h,
864
- value: i,
867
+ value: d,
865
868
  relations: v
866
869
  }) {
867
- const _ = Fr(v, n, d);
870
+ const _ = Fr(v, n, i);
868
871
  if (_ != null && _.one_collection)
869
- return /* @__PURE__ */ a(Rr, { relatedCollection: _.one_collection, id: i });
870
- if (i == null) return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
872
+ return /* @__PURE__ */ a(Rr, { relatedCollection: _.one_collection, id: d });
873
+ if (d == null) return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
871
874
  if (h === "boolean")
872
875
  return /* @__PURE__ */ a(
873
876
  "span",
874
877
  {
875
- className: `inline-flex h-4 items-center rounded-full px-1.5 text-[10px] font-medium ${i ? "bg-emerald-100 text-emerald-700" : "bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400"}`,
876
- children: i ? "Yes" : "No"
878
+ className: `inline-flex h-4 items-center rounded-full px-1.5 text-[10px] font-medium ${d ? "bg-emerald-100 text-emerald-700" : "bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400"}`,
879
+ children: d ? "Yes" : "No"
877
880
  }
878
881
  );
879
882
  if (h === "timestamp" || h === "datetime" || h === "date") {
880
- const $ = String(i).match(/^(\d{4})-(\d{2})-(\d{2})(?:T00:00:00(?:\.000)?Z)?$/);
883
+ const $ = String(d).match(/^(\d{4})-(\d{2})-(\d{2})(?:T00:00:00(?:\.000)?Z)?$/);
881
884
  if ($) {
882
885
  const T = new Date(Number($[1]), Number($[2]) - 1, Number($[3])).toLocaleDateString(
883
886
  "en-US",
@@ -885,37 +888,37 @@ function Es({
885
888
  );
886
889
  return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children: T });
887
890
  }
888
- return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children: uu(i) });
891
+ return /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-400", children: mu(d) });
889
892
  }
890
- return typeof i == "string" ? /* @__PURE__ */ a(
893
+ return typeof d == "string" ? /* @__PURE__ */ a(
891
894
  "span",
892
895
  {
893
896
  className: Wt(
894
897
  "block max-w-[240px] truncate text-[12px] text-slate-700 dark:text-slate-200",
895
- Sr(d) && "font-mono",
898
+ Sr(i) && "font-mono",
896
899
  // An id cell opens the record. Underline it so that is legible
897
900
  // before you click rather than after.
898
- Sr(d) && "underline decoration-slate-300 decoration-dotted underline-offset-2 group-hover:decoration-nvr-cyan dark:decoration-slate-600"
901
+ Sr(i) && "underline decoration-slate-300 decoration-dotted underline-offset-2 group-hover:decoration-nvr-cyan dark:decoration-slate-600"
899
902
  ),
900
- "data-tip": i.length > 28 ? i : void 0,
901
- children: i
903
+ "data-tip": d.length > 28 ? d : void 0,
904
+ children: d
902
905
  }
903
- ) : typeof i == "object" ? /* @__PURE__ */ a("span", { className: "font-mono text-[12px] text-slate-400", children: JSON.stringify(i).slice(0, 40) }) : /* @__PURE__ */ a(
906
+ ) : typeof d == "object" ? /* @__PURE__ */ a("span", { className: "font-mono text-[12px] text-slate-400", children: JSON.stringify(d).slice(0, 40) }) : /* @__PURE__ */ a(
904
907
  "span",
905
908
  {
906
909
  className: Wt(
907
910
  "text-[12px] tabular-nums text-slate-700 dark:text-slate-200",
908
- Sr(d) && "font-mono"
911
+ Sr(i) && "font-mono"
909
912
  ),
910
- children: String(i)
913
+ children: String(d)
911
914
  }
912
915
  );
913
916
  }
914
917
  function Ta({
915
918
  label: n,
916
- options: d,
919
+ options: i,
917
920
  selected: h,
918
- onChange: i,
921
+ onChange: d,
919
922
  loading: v,
920
923
  block: _,
921
924
  onOpenChange: $,
@@ -942,7 +945,7 @@ function Ta({
942
945
  };
943
946
  return window.addEventListener("mousedown", A), () => window.removeEventListener("mousedown", A);
944
947
  }, [C]);
945
- const k = V && !N ? d.filter((A) => A.label.toLowerCase().includes(V.toLowerCase())) : d, Y = new Set(h.map(String)), L = ((E = d.find((A) => String(A.value) === String(h[0]))) == null ? void 0 : E.label) ?? String(h[0] ?? ""), m = h.length === 0 ? n : h.length === 1 ? L : `${L} +${h.length - 1}`;
948
+ const k = V && !N ? i.filter((A) => A.label.toLowerCase().includes(V.toLowerCase())) : i, Y = new Set(h.map(String)), L = ((E = i.find((A) => String(A.value) === String(h[0]))) == null ? void 0 : E.label) ?? String(h[0] ?? ""), m = h.length === 0 ? n : h.length === 1 ? L : `${L} +${h.length - 1}`;
946
949
  return /* @__PURE__ */ c("div", { ref: u, className: _ ? "relative w-full" : "relative", children: [
947
950
  /* @__PURE__ */ c(
948
951
  "button",
@@ -969,7 +972,7 @@ function Ta({
969
972
  role: "button",
970
973
  tabIndex: -1,
971
974
  onClick: (A) => {
972
- A.stopPropagation(), i([]);
975
+ A.stopPropagation(), d([]);
973
976
  },
974
977
  "aria-label": `Clear ${n}`,
975
978
  className: "text-slate-400 hover:text-slate-600",
@@ -1001,7 +1004,7 @@ function Ta({
1001
1004
  {
1002
1005
  type: "checkbox",
1003
1006
  checked: Y.has(String(A.value)),
1004
- onChange: () => i(
1007
+ onChange: () => d(
1005
1008
  Y.has(String(A.value)) ? h.filter((I) => String(I) !== String(A.value)) : [...h, A.value]
1006
1009
  )
1007
1010
  }
@@ -1015,11 +1018,11 @@ function Ta({
1015
1018
  ] })
1016
1019
  ] });
1017
1020
  }
1018
- function gu({
1021
+ function vu({
1019
1022
  target: n,
1020
- label: d,
1023
+ label: i,
1021
1024
  selected: h,
1022
- onChange: i,
1025
+ onChange: d,
1023
1026
  preferIds: v
1024
1027
  }) {
1025
1028
  const _ = vt(), [$, T] = y(!1), N = $ || h.length > 0, [C, B] = y(""), V = (v ?? []).map(String).sort().join(","), { data: M } = te({
@@ -1074,10 +1077,10 @@ function gu({
1074
1077
  Ta,
1075
1078
  {
1076
1079
  block: !0,
1077
- label: d ?? "All",
1080
+ label: i ?? "All",
1078
1081
  options: I,
1079
1082
  selected: h,
1080
- onChange: i,
1083
+ onChange: d,
1081
1084
  loading: L,
1082
1085
  onSearch: B,
1083
1086
  onOpenChange: (F) => {
@@ -1086,15 +1089,15 @@ function gu({
1086
1089
  }
1087
1090
  );
1088
1091
  }
1089
- function xu({
1092
+ function ku({
1090
1093
  collection: n,
1091
- field: d,
1094
+ field: i,
1092
1095
  selected: h,
1093
- onChange: i
1096
+ onChange: d
1094
1097
  }) {
1095
1098
  const v = vt(), [_, $] = y(!1), { data: T = [], isLoading: N } = te({
1096
- queryKey: ["cbv-distinct", n, d],
1097
- queryFn: () => v.request(G(`/items/${n}/distinct`, { field: d })).then((C) => C.data ?? []),
1099
+ queryKey: ["cbv-distinct", n, i],
1100
+ queryFn: () => v.request(G(`/items/${n}/distinct`, { field: i })).then((C) => C.data ?? []),
1098
1101
  staleTime: 5 * 6e4,
1099
1102
  enabled: _,
1100
1103
  retry: !1
@@ -1106,7 +1109,7 @@ function xu({
1106
1109
  label: "All",
1107
1110
  options: T.map((C) => ({ value: String(C), label: Ae(String(C)) })),
1108
1111
  selected: h,
1109
- onChange: i,
1112
+ onChange: d,
1110
1113
  loading: N,
1111
1114
  onOpenChange: (C) => {
1112
1115
  C && $(!0);
@@ -1114,16 +1117,16 @@ function xu({
1114
1117
  }
1115
1118
  );
1116
1119
  }
1117
- function vu({
1120
+ function yu({
1118
1121
  value: n,
1119
- onChange: d
1122
+ onChange: i
1120
1123
  }) {
1121
- const [h, i] = y(!1), [v, _] = y(""), [$, T] = y(""), N = he(null);
1124
+ const [h, d] = y(!1), [v, _] = y(""), [$, T] = y(""), N = he(null);
1122
1125
  me(() => {
1123
1126
  if (!h) return;
1124
1127
  const u = (k) => {
1125
1128
  var Y;
1126
- (Y = N.current) != null && Y.contains(k.target) || i(!1);
1129
+ (Y = N.current) != null && Y.contains(k.target) || d(!1);
1127
1130
  };
1128
1131
  return window.addEventListener("mousedown", u), () => window.removeEventListener("mousedown", u);
1129
1132
  }, [h]), me(() => {
@@ -1136,7 +1139,7 @@ function vu({
1136
1139
  var k;
1137
1140
  if (!n) return "All";
1138
1141
  const u = Sa(n);
1139
- return u ? Ai(u) : ((k = $a.find((Y) => Y.value === n)) == null ? void 0 : k.label) ?? n;
1142
+ return u ? Ii(u) : ((k = $a.find((Y) => Y.value === n)) == null ? void 0 : k.label) ?? n;
1140
1143
  })(), [B, V] = y("between");
1141
1144
  me(() => {
1142
1145
  var u;
@@ -1144,7 +1147,7 @@ function vu({
1144
1147
  }, [h, n]);
1145
1148
  const M = () => {
1146
1149
  const u = v || $;
1147
- u && (d(Ki({ op: B, from: u, to: $ || v || u })), i(!1));
1150
+ u && (i(ji({ op: B, from: u, to: $ || v || u })), d(!1));
1148
1151
  };
1149
1152
  return /* @__PURE__ */ c("div", { ref: N, className: "relative w-full", children: [
1150
1153
  /* @__PURE__ */ c(
@@ -1152,7 +1155,7 @@ function vu({
1152
1155
  {
1153
1156
  type: "button",
1154
1157
  onClick: (u) => {
1155
- u.stopPropagation(), i((k) => !k);
1158
+ u.stopPropagation(), d((k) => !k);
1156
1159
  },
1157
1160
  className: `inline-flex h-6 w-full min-w-[64px] items-center gap-1 rounded border px-1.5 text-[11px] font-normal normal-case tracking-normal ${n ? "border-nvr-cyan/40 bg-nvr-cyan/[0.08] text-slate-800 dark:text-slate-100" : "border-slate-200 bg-white text-slate-500 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-400"}`,
1158
1161
  children: [
@@ -1163,7 +1166,7 @@ function vu({
1163
1166
  role: "button",
1164
1167
  tabIndex: -1,
1165
1168
  onClick: (u) => {
1166
- u.stopPropagation(), d(null);
1169
+ u.stopPropagation(), i(null);
1167
1170
  },
1168
1171
  "aria-label": "Clear date filter",
1169
1172
  className: "text-slate-400 hover:text-slate-600",
@@ -1180,7 +1183,7 @@ function vu({
1180
1183
  {
1181
1184
  type: "button",
1182
1185
  onClick: () => {
1183
- d(u.value || null), i(!1);
1186
+ i(u.value || null), d(!1);
1184
1187
  },
1185
1188
  className: `block w-full rounded px-2 py-1 text-left text-[11.5px] font-normal normal-case tracking-normal ${n === u.value || !n && !u.value ? "bg-nvr-cyan/[0.08] font-medium text-slate-800 dark:text-slate-100" : "text-slate-600 hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-slate-800"}`,
1186
1189
  children: u.label
@@ -1189,7 +1192,7 @@ function vu({
1189
1192
  )) }),
1190
1193
  /* @__PURE__ */ c("div", { className: "border-t border-slate-100 p-2 dark:border-slate-800", children: [
1191
1194
  /* @__PURE__ */ a("p", { className: "pb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Date or range" }),
1192
- /* @__PURE__ */ a("div", { className: "grid grid-cols-3 gap-1 pb-1.5", children: Ii.map((u) => /* @__PURE__ */ a(
1195
+ /* @__PURE__ */ a("div", { className: "grid grid-cols-3 gap-1 pb-1.5", children: Ki.map((u) => /* @__PURE__ */ a(
1193
1196
  "button",
1194
1197
  {
1195
1198
  type: "button",
@@ -1239,11 +1242,11 @@ function vu({
1239
1242
  ] })
1240
1243
  ] });
1241
1244
  }
1242
- function ku({
1245
+ function wu({
1243
1246
  def: n,
1244
- selected: d,
1247
+ selected: i,
1245
1248
  onChange: h,
1246
- allowedIds: i,
1249
+ allowedIds: d,
1247
1250
  scopeDefault: v,
1248
1251
  narrowBy: _ = []
1249
1252
  }) {
@@ -1257,12 +1260,12 @@ function ku({
1257
1260
  n.label_field,
1258
1261
  n.sort ?? "",
1259
1262
  V,
1260
- d.map(String).sort().join(",")
1263
+ i.map(String).sort().join(",")
1261
1264
  ],
1262
1265
  queryFn: async () => {
1263
- const L = V !== "[]" ? Td(
1266
+ const L = V !== "[]" ? Ld(
1264
1267
  n.collection,
1265
- await Ld($, T, n.collection),
1268
+ await Fd($, T, n.collection),
1266
1269
  _
1267
1270
  ) : null, m = (F, ee) => $.request(
1268
1271
  G(`/items/${n.collection}`, {
@@ -1279,17 +1282,17 @@ function ku({
1279
1282
  label: String(ce[n.label_field] ?? ce[N] ?? ""),
1280
1283
  id: ce.id
1281
1284
  })).filter((ce) => ce.value != null && ce.label !== "")
1282
- ), E = await m(L, !0), A = new Set(E.map((F) => String(F.value))), I = d.filter((F) => !A.has(String(F)));
1285
+ ), E = await m(L, !0), A = new Set(E.map((F) => String(F.value))), I = i.filter((F) => !A.has(String(F)));
1283
1286
  return I.length === 0 ? E : [...E, ...await m({ [N]: { _in: I } }, !1)];
1284
1287
  },
1285
1288
  staleTime: 10 * 6e4,
1286
- enabled: C || d.length > 0,
1289
+ enabled: C || i.length > 0,
1287
1290
  retry: !1
1288
- }), k = i != null && i.length ? M.filter((L) => i.some((m) => String(m) === String(L.id))) : M, Y = i != null && i.length ? {
1291
+ }), k = d != null && d.length ? M.filter((L) => d.some((m) => String(m) === String(L.id))) : M, Y = d != null && d.length ? {
1289
1292
  label: "restricted",
1290
1293
  cls: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
1291
1294
  title: `Options limited to your restricted ${n.label} scope${v ? "; selection seeded from your defaults" : ""}`
1292
- } : v && d.length > 0 ? {
1295
+ } : v && i.length > 0 ? {
1293
1296
  label: "your default",
1294
1297
  cls: "bg-nvr-cyan/[0.12] text-[#0284a8] dark:text-nvr-cyan",
1295
1298
  title: `Pre-selected from your default ${n.label} filter (Profile → Default filters) — adjust freely`
@@ -1299,7 +1302,7 @@ function ku({
1299
1302
  {
1300
1303
  label: n.label,
1301
1304
  options: k,
1302
- selected: d,
1305
+ selected: i,
1303
1306
  onChange: h,
1304
1307
  loading: u,
1305
1308
  badge: Y,
@@ -1323,7 +1326,7 @@ const Qs = [
1323
1326
  { value: "30d", label: "30 days" },
1324
1327
  { value: "90d", label: "90 days" },
1325
1328
  { value: "year", label: "This year" }
1326
- ], yu = {
1329
+ ], _u = {
1327
1330
  _eq: "_neq",
1328
1331
  _neq: "_eq",
1329
1332
  _in: "_nin",
@@ -1338,47 +1341,47 @@ const Qs = [
1338
1341
  _lte: "_gt"
1339
1342
  };
1340
1343
  function Us(n) {
1341
- const d = /* @__PURE__ */ new Date(), h = (v) => v.toISOString().slice(0, 10), i = h(d);
1342
- if (n === "today") return { from: i, to: i };
1344
+ const i = /* @__PURE__ */ new Date(), h = (v) => v.toISOString().slice(0, 10), d = h(i);
1345
+ if (n === "today") return { from: d, to: d };
1343
1346
  if (n === "7d" || n === "30d" || n === "90d") {
1344
1347
  const v = Number(n.slice(0, -1));
1345
- return { from: h(new Date(d.getTime() - v * 864e5)), to: i };
1348
+ return { from: h(new Date(i.getTime() - v * 864e5)), to: d };
1346
1349
  }
1347
- return n === "year" ? { from: `${d.getFullYear()}-01-01`, to: i } : null;
1350
+ return n === "year" ? { from: `${i.getFullYear()}-01-01`, to: d } : null;
1348
1351
  }
1349
1352
  function Ds(n) {
1350
1353
  var h;
1351
- const d = [];
1352
- for (const i of n) {
1353
- const v = i.fieldType === "date" || i.fieldType === "datetime" || i.fieldType === "timestamp";
1354
- if (i.op === "_between") {
1355
- const [T, N] = String(i.value).split("..");
1356
- if (i.not) {
1354
+ const i = [];
1355
+ for (const d of n) {
1356
+ const v = d.fieldType === "date" || d.fieldType === "datetime" || d.fieldType === "timestamp";
1357
+ if (d.op === "_between") {
1358
+ const [T, N] = String(d.value).split("..");
1359
+ if (d.not) {
1357
1360
  const C = [];
1358
- T && C.push({ path: i.path, op: "_lt", value: T }), N && C.push({ path: i.path, op: "_gt", value: v ? `${N}T23:59:59` : N }), C.length && d.push({ or: C });
1361
+ T && C.push({ path: d.path, op: "_lt", value: T }), N && C.push({ path: d.path, op: "_gt", value: v ? `${N}T23:59:59` : N }), C.length && i.push({ or: C });
1359
1362
  continue;
1360
1363
  }
1361
- T && d.push({ path: i.path, op: "_gte", value: T }), N && d.push({ path: i.path, op: "_lte", value: v ? `${N}T23:59:59` : N });
1364
+ T && i.push({ path: d.path, op: "_gte", value: T }), N && i.push({ path: d.path, op: "_lte", value: v ? `${N}T23:59:59` : N });
1362
1365
  continue;
1363
1366
  }
1364
- if ((h = i.path[0]) != null && h.startsWith("$has_") || i.path[0] === "$missing_required" || i.path[0] === "$unseen") {
1365
- d.push({ path: i.path, op: "_eq", value: !i.not });
1367
+ if ((h = d.path[0]) != null && h.startsWith("$has_") || d.path[0] === "$missing_required" || d.path[0] === "$unseen") {
1368
+ i.push({ path: d.path, op: "_eq", value: !d.not });
1366
1369
  continue;
1367
1370
  }
1368
- if (i.op === "_preset") {
1369
- const T = Us(String(i.value));
1370
- T && (i.not ? d.push({
1371
+ if (d.op === "_preset") {
1372
+ const T = Us(String(d.value));
1373
+ T && (d.not ? i.push({
1371
1374
  or: [
1372
- { path: i.path, op: "_lt", value: T.from },
1373
- { path: i.path, op: "_gt", value: `${T.to}T23:59:59` }
1375
+ { path: d.path, op: "_lt", value: T.from },
1376
+ { path: d.path, op: "_gt", value: `${T.to}T23:59:59` }
1374
1377
  ]
1375
- }) : (d.push({ path: i.path, op: "_gte", value: T.from }), d.push({ path: i.path, op: "_lte", value: `${T.to}T23:59:59` })));
1378
+ }) : (i.push({ path: d.path, op: "_gte", value: T.from }), i.push({ path: d.path, op: "_lte", value: `${T.to}T23:59:59` })));
1376
1379
  continue;
1377
1380
  }
1378
- let _ = i.op.includes(":") ? i.op.split(":")[0] : i.op, $ = i.op.includes(":") ? i.op.split(":")[1] : i.value || null;
1379
- i.fieldType === "boolean" && ($ === "true" || $ === "false") && ($ = $ === "true"), i.not && (_ = yu[_] ?? _), d.push({ path: i.path, op: _, value: $ });
1381
+ let _ = d.op.includes(":") ? d.op.split(":")[0] : d.op, $ = d.op.includes(":") ? d.op.split(":")[1] : d.value || null;
1382
+ d.fieldType === "boolean" && ($ === "true" || $ === "false") && ($ = $ === "true"), d.not && (_ = _u[_] ?? _), i.push({ path: d.path, op: _, value: $ });
1380
1383
  }
1381
- return d;
1384
+ return i;
1382
1385
  }
1383
1386
  const Ps = [
1384
1387
  { label: "Contains", value: "_contains" },
@@ -1404,7 +1407,7 @@ const Ps = [
1404
1407
  { label: "After", value: "_gt" },
1405
1408
  { label: "Is empty", value: "_null" },
1406
1409
  { label: "Is not empty", value: "_nnull" }
1407
- ], wu = {
1410
+ ], Nu = {
1408
1411
  string: Ps,
1409
1412
  text: Ps,
1410
1413
  integer: Cr,
@@ -1425,23 +1428,23 @@ const Ps = [
1425
1428
  { label: "Is not empty", value: "_nnull" }
1426
1429
  ]
1427
1430
  };
1428
- function _u(n) {
1429
- for (const d of Object.values(wu)) {
1430
- const h = d.find((i) => i.value === n);
1431
+ function Su(n) {
1432
+ for (const i of Object.values(Nu)) {
1433
+ const h = i.find((d) => d.value === n);
1431
1434
  if (h) return h.label;
1432
1435
  }
1433
1436
  return n;
1434
1437
  }
1435
- function rt(n, d, h) {
1438
+ function rt(n, i, h) {
1436
1439
  return n.find(
1437
- (i) => i.many_collection === d && i.many_field === h && i.one_collection
1440
+ (d) => d.many_collection === i && d.many_field === h && d.one_collection
1438
1441
  );
1439
1442
  }
1440
1443
  function Er({
1441
1444
  relatedCollection: n,
1442
- depth: d,
1445
+ depth: i,
1443
1446
  path: h,
1444
- pathLabels: i,
1447
+ pathLabels: d,
1445
1448
  filterText: v,
1446
1449
  includeAliases: _ = !1,
1447
1450
  onPick: $
@@ -1453,8 +1456,8 @@ function Er({
1453
1456
  retry: !1
1454
1457
  }), [C, B] = y(/* @__PURE__ */ new Set());
1455
1458
  if (!N)
1456
- return /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + d}rem` }, children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
1457
- const V = d < 2;
1459
+ return /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + i}rem` }, children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
1460
+ const V = i < 2;
1458
1461
  return /* @__PURE__ */ a(Ue, { children: N.fields.filter((M) => !M.hidden && (!v || M.field.includes(v))).map((M) => {
1459
1462
  const u = V ? rt(N.relations, n, M.field) : void 0, k = V && _ ? Hn(N.relations, n, M.field) : void 0, Y = (u == null ? void 0 : u.one_collection) ?? null, L = C.has(M.field);
1460
1463
  return /* @__PURE__ */ c("div", { children: [
@@ -1468,12 +1471,12 @@ function Er({
1468
1471
  return E.has(M.field) ? E.delete(M.field) : E.add(M.field), E;
1469
1472
  }) : $(
1470
1473
  [...h, M.field],
1471
- [...i, Ae(M.field)],
1474
+ [...d, Ae(M.field)],
1472
1475
  M.type ?? "string"
1473
1476
  );
1474
1477
  },
1475
1478
  className: "flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
1476
- style: { paddingLeft: `${0.5 + d}rem` },
1479
+ style: { paddingLeft: `${0.5 + i}rem` },
1477
1480
  children: [
1478
1481
  Y || k ? L ? "▾ " : "▸ " : "",
1479
1482
  Ae(M.field),
@@ -1485,9 +1488,9 @@ function Er({
1485
1488
  Er,
1486
1489
  {
1487
1490
  relatedCollection: Y,
1488
- depth: d + 1,
1491
+ depth: i + 1,
1489
1492
  path: [...h, M.field],
1490
- pathLabels: [...i, Ae(M.field)],
1493
+ pathLabels: [...d, Ae(M.field)],
1491
1494
  filterText: "",
1492
1495
  includeAliases: _,
1493
1496
  onPick: $
@@ -1497,9 +1500,9 @@ function Er({
1497
1500
  Ws,
1498
1501
  {
1499
1502
  aliasInfo: k,
1500
- depth: d + 1,
1503
+ depth: i + 1,
1501
1504
  path: [...h, M.field],
1502
- pathLabels: [...i, Ae(M.field)],
1505
+ pathLabels: [...d, Ae(M.field)],
1503
1506
  includeAliases: _,
1504
1507
  onPick: $
1505
1508
  }
@@ -1509,9 +1512,9 @@ function Er({
1509
1512
  }
1510
1513
  function Ws({
1511
1514
  aliasInfo: n,
1512
- depth: d,
1515
+ depth: i,
1513
1516
  path: h,
1514
- pathLabels: i,
1517
+ pathLabels: d,
1515
1518
  includeAliases: v,
1516
1519
  onPick: _
1517
1520
  }) {
@@ -1534,25 +1537,25 @@ function Ws({
1534
1537
  Er,
1535
1538
  {
1536
1539
  relatedCollection: C,
1537
- depth: d,
1540
+ depth: i,
1538
1541
  path: h,
1539
- pathLabels: i,
1542
+ pathLabels: d,
1540
1543
  filterText: "",
1541
1544
  includeAliases: v,
1542
1545
  onPick: _
1543
1546
  }
1544
- ) : /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + d}rem` }, children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
1547
+ ) : /* @__PURE__ */ a("div", { className: "px-3 py-1.5", style: { paddingLeft: `${0.5 + i}rem` }, children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
1545
1548
  }
1546
- function Ms(n, d, h) {
1547
- if (d) return "relation";
1548
- const i = n.type ?? "string";
1549
- return i === "integer" || i === "decimal" || i === "float" ? "number" : i === "datetime" || i === "timestamp" ? "date" : i;
1549
+ function Ms(n, i, h) {
1550
+ if (i) return "relation";
1551
+ const d = n.type ?? "string";
1552
+ return d === "integer" || d === "decimal" || d === "float" ? "number" : d === "datetime" || d === "timestamp" ? "date" : d;
1550
1553
  }
1551
- function Nu({
1554
+ function Cu({
1552
1555
  collection: n,
1553
- path: d,
1556
+ path: i,
1554
1557
  pathLabels: h,
1555
- search: i,
1558
+ search: d,
1556
1559
  depth: v,
1557
1560
  onDrill: _,
1558
1561
  onPick: $
@@ -1582,7 +1585,7 @@ function Nu({
1582
1585
  queryFn: () => T.request(G(`/collections/${m}`)).then((E) => E.data),
1583
1586
  staleTime: 10 * 6e4,
1584
1587
  retry: !1,
1585
- enabled: !!i
1588
+ enabled: !!d
1586
1589
  }))
1587
1590
  }), V = ke(() => {
1588
1591
  const m = /* @__PURE__ */ new Map();
@@ -1593,10 +1596,10 @@ function Nu({
1593
1596
  }, [C, B]);
1594
1597
  if (!N)
1595
1598
  return /* @__PURE__ */ a("div", { className: "px-3 py-2", children: /* @__PURE__ */ a("span", { className: "inline-block h-3 w-24 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) });
1596
- const M = i.trim().toLowerCase(), u = (m) => !M || m.toLowerCase().includes(M) || m.toLowerCase().replace(/ /g, "_").includes(M), k = [];
1599
+ const M = d.trim().toLowerCase(), u = (m) => !M || m.toLowerCase().includes(M) || m.toLowerCase().replace(/ /g, "_").includes(M), k = [];
1597
1600
  for (const m of N.fields) {
1598
1601
  if (m.hidden) continue;
1599
- const E = Ae(m.field), A = rt(N.relations, n, m.field), I = Hn(N.relations, n, m.field), F = [...d, m.field], ee = [...h, E];
1602
+ const E = Ae(m.field), A = rt(N.relations, n, m.field), I = Hn(N.relations, n, m.field), F = [...i, m.field], ee = [...h, E];
1600
1603
  if (A != null && A.one_collection && !wt(A.one_collection))
1601
1604
  u(E) && k.push({
1602
1605
  key: m.field,
@@ -1646,7 +1649,7 @@ function Nu({
1646
1649
  breadcrumb: I,
1647
1650
  hint: Ms(F, de ?? void 0),
1648
1651
  leaf: {
1649
- path: [...d, m.field, F.field],
1652
+ path: [...i, m.field, F.field],
1650
1653
  pathLabels: [...h, I, ee],
1651
1654
  fieldType: de != null && de.one_collection ? "relation" : F.type ?? "string",
1652
1655
  relTarget: (de == null ? void 0 : de.one_collection) ?? void 0
@@ -1693,11 +1696,11 @@ function Nu({
1693
1696
  m.key
1694
1697
  )) });
1695
1698
  }
1696
- function Su({
1699
+ function $u({
1697
1700
  target: n,
1698
- selected: d,
1701
+ selected: i,
1699
1702
  labels: h,
1700
- onToggle: i
1703
+ onToggle: d
1701
1704
  }) {
1702
1705
  const v = vt(), [_, $] = y(""), { data: T } = te({
1703
1706
  queryKey: ["cbv-collection-meta", n],
@@ -1725,7 +1728,7 @@ function Su({
1725
1728
  staleTime: 10 * 6e4,
1726
1729
  enabled: !!T,
1727
1730
  retry: !1
1728
- }), M = new Set(d.map(String)), u = _ ? B.filter((k) => k.label.toLowerCase().includes(_.toLowerCase())) : B;
1731
+ }), M = new Set(i.map(String)), u = _ ? B.filter((k) => k.label.toLowerCase().includes(_.toLowerCase())) : B;
1729
1732
  return /* @__PURE__ */ c("div", { className: "flex max-h-64 flex-col", children: [
1730
1733
  /* @__PURE__ */ a(
1731
1734
  "input",
@@ -1747,7 +1750,7 @@ function Su({
1747
1750
  {
1748
1751
  type: "checkbox",
1749
1752
  checked: M.has(String(k.value)),
1750
- onChange: () => i(k.value, k.label)
1753
+ onChange: () => d(k.value, k.label)
1751
1754
  }
1752
1755
  ),
1753
1756
  /* @__PURE__ */ a("span", { className: "truncate", children: k.label })
@@ -1755,41 +1758,41 @@ function Su({
1755
1758
  },
1756
1759
  String(k.value)
1757
1760
  )) }),
1758
- d.length > 0 && /* @__PURE__ */ c("p", { className: "shrink-0 border-t border-slate-100 px-3 py-1 text-[11px] text-slate-400 dark:border-slate-800", children: [
1759
- d.length,
1761
+ i.length > 0 && /* @__PURE__ */ c("p", { className: "shrink-0 border-t border-slate-100 px-3 py-1 text-[11px] text-slate-400 dark:border-slate-800", children: [
1762
+ i.length,
1760
1763
  " selected ·",
1761
1764
  " ",
1762
- d.map((k) => h[String(k)] ?? k).slice(0, 3).join(", "),
1763
- d.length > 3 ? "…" : ""
1765
+ i.map((k) => h[String(k)] ?? k).slice(0, 3).join(", "),
1766
+ i.length > 3 ? "…" : ""
1764
1767
  ] })
1765
1768
  ] });
1766
1769
  }
1767
- function Cu(n) {
1768
- var h, i;
1769
- const d = n.pathLabels.join(" › ");
1770
+ function qu(n) {
1771
+ var h, d;
1772
+ const i = n.pathLabels.join(" › ");
1770
1773
  if (Array.isArray(n.value)) {
1771
1774
  const v = n.valueLabels ?? n.value.map(String);
1772
1775
  return {
1773
- field: d,
1776
+ field: i,
1774
1777
  op: "any of",
1775
1778
  value: v.length <= 2 ? v.join(", ") : `${v[0]} +${v.length - 1}`
1776
1779
  };
1777
1780
  }
1778
1781
  if (n.op === "_between") {
1779
1782
  const [v, _] = String(n.value).split("..");
1780
- return { field: d, op: "between", value: `${v} – ${_}` };
1783
+ return { field: i, op: "between", value: `${v} – ${_}` };
1781
1784
  }
1782
1785
  if (n.op === "_preset") {
1783
1786
  const v = ((h = $a.find((_) => _.value === n.value)) == null ? void 0 : h.label) ?? String(n.value);
1784
- return { field: d, op: "in the", value: `${v} (rolling)` };
1787
+ return { field: i, op: "in the", value: `${v} (rolling)` };
1785
1788
  }
1786
- return (i = n.path[0]) != null && i.startsWith("$has_") || n.path[0] === "$missing_required" ? { field: d, op: "", value: "" } : { field: d, op: _u(n.op).toLowerCase(), value: String(n.value ?? "") };
1789
+ return (d = n.path[0]) != null && d.startsWith("$has_") || n.path[0] === "$missing_required" ? { field: i, op: "", value: "" } : { field: i, op: Su(n.op).toLowerCase(), value: String(n.value ?? "") };
1787
1790
  }
1788
- function $u({
1791
+ function Tu({
1789
1792
  collection: n,
1790
- meta: d,
1793
+ meta: i,
1791
1794
  search: h,
1792
- onSearch: i,
1795
+ onSearch: d,
1793
1796
  filters: v,
1794
1797
  onFiltersChange: _
1795
1798
  }) {
@@ -1800,11 +1803,11 @@ function $u({
1800
1803
  }), [M, u] = y(null), [k, Y] = y("_contains"), [L, m] = y(""), [E, A] = y(""), [I, F] = y([]), [ee, de] = y({}), [ce, Ie] = y(null), X = he(null);
1801
1804
  me(() => {
1802
1805
  if (!$) return;
1803
- const w = (ae) => {
1806
+ const w = (re) => {
1804
1807
  var Ce;
1805
- (Ce = X.current) != null && Ce.contains(ae.target) || T(!1);
1806
- }, be = (ae) => {
1807
- ae.key === "Escape" && T(!1);
1808
+ (Ce = X.current) != null && Ce.contains(re.target) || T(!1);
1809
+ }, be = (re) => {
1810
+ re.key === "Escape" && T(!1);
1808
1811
  };
1809
1812
  return window.addEventListener("mousedown", w), window.addEventListener("keydown", be), () => {
1810
1813
  window.removeEventListener("mousedown", w), window.removeEventListener("keydown", be);
@@ -1824,7 +1827,7 @@ function $u({
1824
1827
  op: w,
1825
1828
  value: be
1826
1829
  });
1827
- }, se = () => {
1830
+ }, oe = () => {
1828
1831
  !M || I.length === 0 || Z({
1829
1832
  path: M.path,
1830
1833
  pathLabels: M.pathLabels,
@@ -1843,16 +1846,16 @@ function $u({
1843
1846
  relTarget: w.relTarget
1844
1847
  }), F(w.value);
1845
1848
  const be = {};
1846
- w.value.forEach((ae, Ce) => {
1849
+ w.value.forEach((re, Ce) => {
1847
1850
  var ut;
1848
- be[String(ae)] = ((ut = w.valueLabels) == null ? void 0 : ut[Ce]) ?? String(ae);
1851
+ be[String(re)] = ((ut = w.valueLabels) == null ? void 0 : ut[Ce]) ?? String(re);
1849
1852
  }), de(be);
1850
1853
  } else if (u({ path: w.path, pathLabels: w.pathLabels, fieldType: w.fieldType }), Y(w.op), w.op === "_between") {
1851
- const [be, ae] = String(w.value).split("..");
1852
- m(be ?? ""), A(ae ?? "");
1854
+ const [be, re] = String(w.value).split("..");
1855
+ m(be ?? ""), A(re ?? "");
1853
1856
  } else
1854
1857
  m(String(w.value ?? ""));
1855
- }, oe = (() => {
1858
+ }, ae = (() => {
1856
1859
  if (!M) return null;
1857
1860
  if (M.relTarget !== void 0) return "relation";
1858
1861
  const w = M.fieldType;
@@ -1885,7 +1888,7 @@ function $u({
1885
1888
  "input",
1886
1889
  {
1887
1890
  value: h,
1888
- onChange: (w) => i(w.target.value),
1891
+ onChange: (w) => d(w.target.value),
1889
1892
  placeholder: "Search…",
1890
1893
  "aria-label": `Search ${n}`,
1891
1894
  className: "h-8 w-full rounded-md border border-slate-200 bg-white pl-8 pr-3 text-[13px] outline-none focus:border-nvr-cyan/50 focus:ring-2 focus:ring-nvr-cyan/30 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100"
@@ -1939,7 +1942,7 @@ function $u({
1939
1942
  type: "button",
1940
1943
  onClick: () => {
1941
1944
  _([
1942
- ...v.filter((ae) => ae.path[0] !== w),
1945
+ ...v.filter((re) => re.path[0] !== w),
1943
1946
  {
1944
1947
  id: `${w}-${Date.now()}`,
1945
1948
  path: [w],
@@ -1959,15 +1962,15 @@ function $u({
1959
1962
  w
1960
1963
  )) }),
1961
1964
  /* @__PURE__ */ a(
1962
- Nu,
1965
+ Cu,
1963
1966
  {
1964
1967
  collection: B.collection,
1965
1968
  path: B.path,
1966
1969
  pathLabels: B.pathLabels,
1967
1970
  search: N,
1968
1971
  depth: B.path.length,
1969
- onDrill: (w, be, ae) => {
1970
- V({ collection: w, path: be, pathLabels: ae }), C("");
1972
+ onDrill: (w, be, re) => {
1973
+ V({ collection: w, path: be, pathLabels: re }), C("");
1971
1974
  },
1972
1975
  onPick: (w) => {
1973
1976
  u(w), Y(
@@ -1992,17 +1995,17 @@ function $u({
1992
1995
  ]
1993
1996
  }
1994
1997
  ),
1995
- oe === "relation" && M.relTarget ? /* @__PURE__ */ c("div", { className: "pt-2", children: [
1998
+ ae === "relation" && M.relTarget ? /* @__PURE__ */ c("div", { className: "pt-2", children: [
1996
1999
  /* @__PURE__ */ a(
1997
- Su,
2000
+ $u,
1998
2001
  {
1999
2002
  target: M.relTarget,
2000
2003
  selected: I,
2001
2004
  labels: ee,
2002
2005
  onToggle: (w, be) => {
2003
2006
  F(
2004
- (ae) => ae.map(String).includes(String(w)) ? ae.filter((Ce) => String(Ce) !== String(w)) : [...ae, w]
2005
- ), de((ae) => ({ ...ae, [String(w)]: be }));
2007
+ (re) => re.map(String).includes(String(w)) ? re.filter((Ce) => String(Ce) !== String(w)) : [...re, w]
2008
+ ), de((re) => ({ ...re, [String(w)]: be }));
2006
2009
  }
2007
2010
  }
2008
2011
  ),
@@ -2011,7 +2014,7 @@ function $u({
2011
2014
  {
2012
2015
  type: "button",
2013
2016
  disabled: I.length === 0,
2014
- onClick: se,
2017
+ onClick: oe,
2015
2018
  className: "h-8 w-full rounded-md bg-nvr-cyan text-[13px] font-medium text-white disabled:opacity-40",
2016
2019
  children: [
2017
2020
  "Apply",
@@ -2019,7 +2022,7 @@ function $u({
2019
2022
  ]
2020
2023
  }
2021
2024
  ) })
2022
- ] }) : oe === "boolean" ? /* @__PURE__ */ a("div", { className: "flex gap-1.5 p-3", children: [
2025
+ ] }) : ae === "boolean" ? /* @__PURE__ */ a("div", { className: "flex gap-1.5 p-3", children: [
2023
2026
  { label: "Yes", op: "_eq:true" },
2024
2027
  { label: "No", op: "_eq:false" },
2025
2028
  { label: "Empty", op: "_null" }
@@ -2035,7 +2038,7 @@ function $u({
2035
2038
  children: w.label
2036
2039
  },
2037
2040
  w.op
2038
- )) }) : oe === "date" ? /* @__PURE__ */ c("div", { className: "space-y-2 p-3", children: [
2041
+ )) }) : ae === "date" ? /* @__PURE__ */ c("div", { className: "space-y-2 p-3", children: [
2039
2042
  /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: $a.filter((w) => w.value).map((w) => /* @__PURE__ */ a(
2040
2043
  "button",
2041
2044
  {
@@ -2088,11 +2091,11 @@ function $u({
2088
2091
  {
2089
2092
  className: "space-y-2 p-3",
2090
2093
  onSubmit: (w) => {
2091
- w.preventDefault(), oe === "number" && k === "_between" ? L !== "" && E !== "" && q("_between", `${L}..${E}`) : L.trim() && q(k, L.trim());
2094
+ w.preventDefault(), ae === "number" && k === "_between" ? L !== "" && E !== "" && q("_between", `${L}..${E}`) : L.trim() && q(k, L.trim());
2092
2095
  },
2093
2096
  children: [
2094
2097
  /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-1", children: [
2095
- (oe === "number" ? [...Me, { value: "_between", label: "Between" }] : ie).map((w) => /* @__PURE__ */ a(
2098
+ (ae === "number" ? [...Me, { value: "_between", label: "Between" }] : ie).map((w) => /* @__PURE__ */ a(
2096
2099
  "button",
2097
2100
  {
2098
2101
  type: "button",
@@ -2126,14 +2129,14 @@ function $u({
2126
2129
  "input",
2127
2130
  {
2128
2131
  autoFocus: !0,
2129
- type: oe === "number" ? "number" : "text",
2132
+ type: ae === "number" ? "number" : "text",
2130
2133
  value: L,
2131
2134
  onChange: (w) => m(w.target.value),
2132
2135
  placeholder: "Value…",
2133
2136
  className: "h-8 min-w-0 flex-1 rounded-md border border-slate-200 bg-white px-2.5 text-[13px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
2134
2137
  }
2135
2138
  ),
2136
- oe === "number" && k === "_between" && /* @__PURE__ */ c(Ue, { children: [
2139
+ ae === "number" && k === "_between" && /* @__PURE__ */ c(Ue, { children: [
2137
2140
  /* @__PURE__ */ a("span", { className: "text-[11px] text-slate-400", children: "to" }),
2138
2141
  /* @__PURE__ */ a(
2139
2142
  "input",
@@ -2163,7 +2166,7 @@ function $u({
2163
2166
  ] })
2164
2167
  ] }),
2165
2168
  v.map((w) => {
2166
- const be = Cu(w);
2169
+ const be = qu(w);
2167
2170
  return /* @__PURE__ */ c(
2168
2171
  "span",
2169
2172
  {
@@ -2173,7 +2176,7 @@ function $u({
2173
2176
  "button",
2174
2177
  {
2175
2178
  type: "button",
2176
- onClick: () => _(v.map((ae) => ae.id === w.id ? { ...ae, not: !ae.not } : ae)),
2179
+ onClick: () => _(v.map((re) => re.id === w.id ? { ...re, not: !re.not } : re)),
2177
2180
  "data-tip": w.not ? "Negated — click to restore" : "Click to negate (NOT)",
2178
2181
  className: w.not ? "rounded bg-amber-100 px-1 text-[10.5px] font-bold text-amber-700 dark:bg-amber-400/15 dark:text-amber-400" : "rounded px-1 text-[10.5px] font-bold text-slate-300 hover:text-slate-500",
2179
2182
  children: "NOT"
@@ -2196,7 +2199,7 @@ function $u({
2196
2199
  "button",
2197
2200
  {
2198
2201
  type: "button",
2199
- onClick: () => _(v.filter((ae) => ae.id !== w.id)),
2202
+ onClick: () => _(v.filter((re) => re.id !== w.id)),
2200
2203
  "aria-label": "Remove filter",
2201
2204
  className: "text-slate-400 hover:text-red-500",
2202
2205
  children: "✕"
@@ -2210,16 +2213,16 @@ function $u({
2210
2213
  ] })
2211
2214
  );
2212
2215
  }
2213
- function qu({
2216
+ function Lu({
2214
2217
  collection: n,
2215
- meta: d,
2218
+ meta: i,
2216
2219
  onPick: h
2217
2220
  }) {
2218
- const [i, v] = y(/* @__PURE__ */ new Set()), _ = ($, T) => h($, T);
2219
- return /* @__PURE__ */ a("div", { className: "max-h-56 overflow-y-auto", children: d.fields.filter(($) => !$.hidden).map(($) => {
2220
- const T = rt(d.relations, n, $.field), N = Hn(d.relations, n, $.field);
2221
+ const [d, v] = y(/* @__PURE__ */ new Set()), _ = ($, T) => h($, T);
2222
+ return /* @__PURE__ */ a("div", { className: "max-h-56 overflow-y-auto", children: i.fields.filter(($) => !$.hidden).map(($) => {
2223
+ const T = rt(i.relations, n, $.field), N = Hn(i.relations, n, $.field);
2221
2224
  if (!(T != null && T.one_collection) && !N) return null;
2222
- const C = i.has($.field);
2225
+ const C = d.has($.field);
2223
2226
  return /* @__PURE__ */ c("div", { children: [
2224
2227
  /* @__PURE__ */ c(
2225
2228
  "button",
@@ -2264,13 +2267,13 @@ function qu({
2264
2267
  ] }, $.field);
2265
2268
  }) });
2266
2269
  }
2267
- function Tu({
2270
+ function Fu({
2268
2271
  collection: n,
2269
- ids: d,
2272
+ ids: i,
2270
2273
  onDone: h,
2271
- onCancel: i
2274
+ onCancel: d
2272
2275
  }) {
2273
- const v = vt(), [_, $] = y(d[0]), [T, N] = y(!1), [C, B] = y(null), [V, M] = y(null), u = d.find((L) => String(L) !== String(_));
2276
+ const v = vt(), [_, $] = y(i[0]), [T, N] = y(!1), [C, B] = y(null), [V, M] = y(null), u = i.find((L) => String(L) !== String(_));
2274
2277
  me(() => {
2275
2278
  M(null);
2276
2279
  let L = !0;
@@ -2308,7 +2311,7 @@ function Tu({
2308
2311
  };
2309
2312
  return /* @__PURE__ */ c("span", { className: "flex flex-wrap items-center gap-2", children: [
2310
2313
  /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300 dark:text-muted-foreground", children: "Keep" }),
2311
- d.map((L) => /* @__PURE__ */ a(
2314
+ i.map((L) => /* @__PURE__ */ a(
2312
2315
  "button",
2313
2316
  {
2314
2317
  type: "button",
@@ -2337,24 +2340,24 @@ function Tu({
2337
2340
  "button",
2338
2341
  {
2339
2342
  type: "button",
2340
- onClick: i,
2343
+ onClick: d,
2341
2344
  className: "h-8 px-2 text-[12.5px] text-slate-300 dark:text-muted-foreground hover:text-white dark:hover:text-foreground",
2342
2345
  children: "Cancel"
2343
2346
  }
2344
2347
  )
2345
2348
  ] });
2346
2349
  }
2347
- function Lu({
2350
+ function Ru({
2348
2351
  collection: n,
2349
- selectedIds: d,
2352
+ selectedIds: i,
2350
2353
  transitions: h,
2351
- fields: i,
2354
+ fields: d,
2352
2355
  relations: v,
2353
2356
  registryKeys: _,
2354
2357
  onClear: $,
2355
2358
  onSuccess: T
2356
2359
  }) {
2357
- const N = Na(), C = vt(), B = qa(), V = Is(), [M, u] = y("actions"), k = nc([n], _), { data: Y = [] } = te({
2360
+ const N = Na(), C = vt(), B = qa(), V = Is(), [M, u] = y("actions"), k = rc([n], _), { data: Y = [] } = te({
2358
2361
  queryKey: ["bulk-recipes", n],
2359
2362
  queryFn: () => C.request(G("/bulk-recipes", { collection: n })).then((q) => q.data ?? []).catch(() => []),
2360
2363
  staleTime: 6e4
@@ -2373,32 +2376,32 @@ function Lu({
2373
2376
  qe("Failed to save recipe");
2374
2377
  }
2375
2378
  }, F = (q) => {
2376
- var se, fe;
2377
- if (q.action_type === "update" && ((se = q.config) != null && se.field)) {
2378
- const oe = q.config;
2379
+ var oe, fe;
2380
+ if (q.action_type === "update" && ((oe = q.config) != null && oe.field)) {
2381
+ const ae = q.config;
2379
2382
  Ye(async (Me) => {
2380
2383
  const ie = await C.request(
2381
2384
  ye(`/items/${n}/bulk-update?progress=${Me}`, {
2382
- ids: d,
2383
- data: { [String(oe.field)]: oe.value ?? "" }
2385
+ ids: i,
2386
+ data: { [String(ae.field)]: ae.value ?? "" }
2384
2387
  })
2385
2388
  );
2386
2389
  return `${q.name}: updated ${ie.updated} items${ie.skipped ? ` · ${ie.skipped} already there` : ""}${ie.refused ? ` · ${ie.refused} locked on their form` : ""}`;
2387
2390
  });
2388
2391
  } else if (q.action_type === "transition" && ((fe = q.config) != null && fe.transition_label)) {
2389
- const oe = h.find((Me) => {
2392
+ const ae = h.find((Me) => {
2390
2393
  var ie;
2391
2394
  return Me.label === ((ie = q.config) == null ? void 0 : ie.transition_label);
2392
2395
  });
2393
- if (!oe) {
2396
+ if (!ae) {
2394
2397
  qe(`"${q.config.transition_label}" is not an available transition here`);
2395
2398
  return;
2396
2399
  }
2397
2400
  Ye(async (Me) => {
2398
2401
  const ie = await C.request(
2399
2402
  ye(`/items/${n}/bulk-transition?progress=${Me}`, {
2400
- ids: d,
2401
- transition_id: oe.id
2403
+ ids: i,
2404
+ transition_id: ae.id
2402
2405
  })
2403
2406
  );
2404
2407
  return ie.failed > 0 ? `${q.name}: ${ie.succeeded} done, ${ie.failed} failed` : `${q.name}: transitioned ${ie.succeeded} items`;
@@ -2406,28 +2409,28 @@ function Lu({
2406
2409
  }
2407
2410
  }, [ee, de] = y(""), [ce, Ie] = y(!1), [X, qe] = y(null), Ye = async (q) => {
2408
2411
  Ie(!0), qe(null);
2409
- const se = qi();
2410
- Ti(se, d);
2412
+ const oe = qi();
2413
+ Ti(oe, i);
2411
2414
  try {
2412
- const fe = await q(se);
2415
+ const fe = await q(oe);
2413
2416
  qe(fe), T(), $(), u("actions");
2414
2417
  } catch (fe) {
2415
- qe(Bi(fe, "Bulk action failed"));
2418
+ qe(zi(fe, "Bulk action failed"));
2416
2419
  } finally {
2417
- Li(se), Ie(!1);
2420
+ Li(oe), Ie(!1);
2418
2421
  }
2419
- }, Z = (q, se) => void Ye(async (fe) => {
2420
- const oe = await C.request(
2422
+ }, Z = (q, oe) => void Ye(async (fe) => {
2423
+ const ae = await C.request(
2421
2424
  ye(`/items/${n}/bulk-update?progress=${fe}`, {
2422
- ids: d,
2423
- data: { [q]: se ?? null },
2425
+ ids: i,
2426
+ data: { [q]: oe ?? null },
2424
2427
  by_form: !0
2425
2428
  })
2426
2429
  );
2427
2430
  return [
2428
- `Updated ${oe.updated} items`,
2429
- oe.skipped ? `${oe.skipped} already there` : "",
2430
- oe.refused ? `${oe.refused} refused — ${oe.refused_reason ?? "locked on its form"}` : ""
2431
+ `Updated ${ae.updated} items`,
2432
+ ae.skipped ? `${ae.skipped} already there` : "",
2433
+ ae.refused ? `${ae.refused} refused — ${ae.refused_reason ?? "locked on its form"}` : ""
2431
2434
  ].filter(Boolean).join(" · ");
2432
2435
  });
2433
2436
  return /* @__PURE__ */ c(
@@ -2447,16 +2450,16 @@ function Lu({
2447
2450
  }
2448
2451
  ),
2449
2452
  /* @__PURE__ */ c("span", { className: "text-[13px] font-medium text-nvr-cyan dark:text-nvr-cyan", children: [
2450
- d.length,
2453
+ i.length,
2451
2454
  " item",
2452
- d.length === 1 ? "" : "s",
2455
+ i.length === 1 ? "" : "s",
2453
2456
  " selected"
2454
2457
  ] }),
2455
2458
  X && /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300 dark:text-muted-foreground", children: X }),
2456
2459
  /* @__PURE__ */ a("span", { className: "flex-1" }),
2457
2460
  M === "actions" && /* @__PURE__ */ c("span", { className: "flex flex-wrap items-center gap-1.5", children: [
2458
2461
  k("recipes") && Y.map((q) => {
2459
- var se, fe, oe;
2462
+ var oe, fe, ae;
2460
2463
  return /* @__PURE__ */ c("span", { className: "group/recipe relative inline-flex", children: [
2461
2464
  /* @__PURE__ */ a(
2462
2465
  "button",
@@ -2467,7 +2470,7 @@ function Lu({
2467
2470
  return Me.label === ((ie = q.config) == null ? void 0 : ie.transition_label);
2468
2471
  }),
2469
2472
  onClick: () => F(q),
2470
- title: q.action_type === "update" ? `Set ${(se = q.config) == null ? void 0 : se.field} = ${(fe = q.config) == null ? void 0 : fe.value}` : `Transition: ${(oe = q.config) == null ? void 0 : oe.transition_label}`,
2473
+ title: q.action_type === "update" ? `Set ${(oe = q.config) == null ? void 0 : oe.field} = ${(fe = q.config) == null ? void 0 : fe.value}` : `Transition: ${(ae = q.config) == null ? void 0 : ae.transition_label}`,
2471
2474
  className: "h-8 rounded-md border border-nvr-cyan/[0.33] bg-nvr-cyan/[0.08] px-3 text-[12.5px] font-medium text-[#7fe7ff] hover:bg-nvr-cyan/[0.13] disabled:opacity-40",
2472
2475
  children: q.name
2473
2476
  }
@@ -2490,33 +2493,33 @@ function Lu({
2490
2493
  )
2491
2494
  ] }, q.id);
2492
2495
  }),
2493
- d.length >= 2 && /* @__PURE__ */ a(
2496
+ i.length >= 2 && /* @__PURE__ */ a(
2494
2497
  "button",
2495
2498
  {
2496
2499
  type: "button",
2497
2500
  onClick: () => {
2498
- const q = _d(
2499
- d.map((se) => V.urlFor({ collection: n, itemId: String(se) }))
2501
+ const q = Nd(
2502
+ i.map((oe) => V.urlFor({ collection: n, itemId: String(oe) }))
2500
2503
  );
2501
2504
  q.blocked > 0 || q.capped > 0 ? we.warning(ks(q)) : we.success(ks(q));
2502
2505
  },
2503
2506
  "data-bulk-open-tabs": !0,
2504
- title: `Open the selected records in new tabs (up to ${wd})`,
2507
+ title: `Open the selected records in new tabs (up to ${_d})`,
2505
2508
  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",
2506
2509
  children: "Open in tabs"
2507
2510
  }
2508
2511
  ),
2509
2512
  k("compare") && /* @__PURE__ */ a(
2510
- rc,
2513
+ sc,
2511
2514
  {
2512
- targets: d.map((q) => ({ collection: n, id: q })),
2513
- fields: i,
2515
+ targets: i.map((q) => ({ collection: n, id: q })),
2516
+ fields: d,
2514
2517
  relations: v,
2515
- renderValue: (q, se, fe) => Ru(n, q, se, fe),
2518
+ renderValue: (q, oe, fe, ae) => Du(n, q, oe, fe, ae),
2516
2519
  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"
2517
2520
  }
2518
2521
  ),
2519
- k("merge") && d.length === 2 && N.isAdmin && /* @__PURE__ */ a(
2522
+ k("merge") && i.length === 2 && N.isAdmin && /* @__PURE__ */ a(
2520
2523
  "button",
2521
2524
  {
2522
2525
  type: "button",
@@ -2527,9 +2530,9 @@ function Lu({
2527
2530
  }
2528
2531
  ),
2529
2532
  /* @__PURE__ */ a(
2530
- ac,
2533
+ lc,
2531
2534
  {
2532
- targets: d.map((q) => ({ collection: n, id: q })),
2535
+ targets: i.map((q) => ({ collection: n, id: q })),
2533
2536
  enabledKeys: _,
2534
2537
  tone: "dark",
2535
2538
  disabled: ce,
@@ -2539,14 +2542,14 @@ function Lu({
2539
2542
  }
2540
2543
  ),
2541
2544
  k("update-field") && /* @__PURE__ */ a(
2542
- lc,
2545
+ oc,
2543
2546
  {
2544
2547
  collection: n,
2545
- selectedIds: d,
2548
+ selectedIds: i,
2546
2549
  disabled: ce,
2547
2550
  onApply: Z,
2548
- onSaveRecipe: (q, se) => {
2549
- A(""), m({ action_type: "update", config: { field: q, value: se } });
2551
+ onSaveRecipe: (q, oe) => {
2552
+ A(""), m({ action_type: "update", config: { field: q, value: oe } });
2550
2553
  },
2551
2554
  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 disabled:opacity-40"
2552
2555
  }
@@ -2580,10 +2583,10 @@ function Lu({
2580
2583
  )
2581
2584
  ] }),
2582
2585
  M === "merge" && /* @__PURE__ */ a(
2583
- Tu,
2586
+ Fu,
2584
2587
  {
2585
2588
  collection: n,
2586
- ids: d.slice(0, 2),
2589
+ ids: i.slice(0, 2),
2587
2590
  onDone: (q) => {
2588
2591
  qe(q), T(), $(), u("actions");
2589
2592
  },
@@ -2591,10 +2594,10 @@ function Lu({
2591
2594
  }
2592
2595
  ),
2593
2596
  M === "message" && /* @__PURE__ */ a(
2594
- oc,
2597
+ dc,
2595
2598
  {
2596
2599
  collection: n,
2597
- selectedIds: d,
2600
+ selectedIds: i,
2598
2601
  onDone: (q) => {
2599
2602
  qe(q), u("actions");
2600
2603
  },
@@ -2606,10 +2609,10 @@ function Lu({
2606
2609
  {
2607
2610
  className: "flex items-center gap-1.5",
2608
2611
  onSubmit: (q) => {
2609
- q.preventDefault(), ee && Ye(async (se) => {
2612
+ q.preventDefault(), ee && Ye(async (oe) => {
2610
2613
  const fe = await C.request(
2611
- ye(`/items/${n}/bulk-transition?progress=${se}`, {
2612
- ids: d,
2614
+ ye(`/items/${n}/bulk-transition?progress=${oe}`, {
2615
+ ids: i,
2613
2616
  transition_id: ee
2614
2617
  })
2615
2618
  );
@@ -2618,7 +2621,7 @@ function Lu({
2618
2621
  },
2619
2622
  children: [
2620
2623
  /* @__PURE__ */ a(
2621
- su,
2624
+ iu,
2622
2625
  {
2623
2626
  value: ee,
2624
2627
  onChange: de,
@@ -2645,7 +2648,7 @@ function Lu({
2645
2648
  type: "button",
2646
2649
  disabled: !ee,
2647
2650
  onClick: () => {
2648
- const q = h.find((se) => se.id === ee);
2651
+ const q = h.find((oe) => oe.id === ee);
2649
2652
  q && (A(""), m({ action_type: "transition", config: { transition_label: q.label } }));
2650
2653
  },
2651
2654
  title: "Save this transition as a reusable recipe",
@@ -2708,9 +2711,9 @@ function Lu({
2708
2711
  M === "confirm-delete" && /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
2709
2712
  /* @__PURE__ */ c("span", { className: "text-[12.5px] text-slate-300 dark:text-muted-foreground", children: [
2710
2713
  "Delete ",
2711
- d.length,
2714
+ i.length,
2712
2715
  " item",
2713
- d.length === 1 ? "" : "s",
2716
+ i.length === 1 ? "" : "s",
2714
2717
  "? Deleted records move to Trash for 30 days."
2715
2718
  ] }),
2716
2719
  /* @__PURE__ */ a(
@@ -2719,7 +2722,7 @@ function Lu({
2719
2722
  type: "button",
2720
2723
  disabled: ce,
2721
2724
  onClick: () => void Ye(async (q) => `Deleted ${(await C.request(
2722
- ye(`/items/${n}/bulk-delete?progress=${q}`, { ids: d })
2725
+ ye(`/items/${n}/bulk-delete?progress=${q}`, { ids: i })
2723
2726
  )).deleted} items`),
2724
2727
  className: "h-8 rounded-md bg-red-600 px-3 text-[12.5px] font-medium hover:bg-red-700 disabled:opacity-50",
2725
2728
  children: ce ? "Deleting…" : "Delete"
@@ -2739,7 +2742,7 @@ function Lu({
2739
2742
  }
2740
2743
  );
2741
2744
  }
2742
- const Fu = {
2745
+ const Eu = {
2743
2746
  state: "badge",
2744
2747
  entered: "date",
2745
2748
  aging: "short",
@@ -2751,11 +2754,11 @@ const Fu = {
2751
2754
  tasks: "short",
2752
2755
  addendums: "short"
2753
2756
  };
2754
- function x0({
2757
+ function y0({
2755
2758
  collection: n,
2756
- quickFilters: d = [],
2759
+ quickFilters: i = [],
2757
2760
  initialColumns: h,
2758
- initialSort: i,
2761
+ initialSort: d,
2759
2762
  pageSize: v = 25,
2760
2763
  initialSearch: _ = "",
2761
2764
  initialFilters: $,
@@ -2768,11 +2771,11 @@ function x0({
2768
2771
  }) {
2769
2772
  var Gl, Xl, Zl, es, ts, ns, as, rs, ls, ss, os;
2770
2773
  const u = vt(), k = qa(), { open: Y, urlFor: L } = Is(), [m] = y(
2771
- () => sd(od(`cbv:${n}`))
2774
+ () => od(id(`cbv:${n}`))
2772
2775
  ), [E] = y(
2773
2776
  () => m ? _s(m.f ?? []) : null
2774
2777
  ), [A] = y(
2775
- () => m ? null : dd(`cbv:${n}`)
2778
+ () => m ? null : cd(`cbv:${n}`)
2776
2779
  ), [I, F] = y((m == null ? void 0 : m.p) ?? A ?? 1), ee = he(A);
2777
2780
  me(() => {
2778
2781
  const e = vs(ee.current, I);
@@ -2780,17 +2783,17 @@ function x0({
2780
2783
  F(e);
2781
2784
  return;
2782
2785
  }
2783
- cd(`cbv:${n}`, I);
2786
+ ud(`cbv:${n}`, I);
2784
2787
  }, [n, I]);
2785
- const de = he(Ji()), [ce, Ie] = y(m ? m.q ?? "" : _), X = hs(ce.trim(), 350), [qe, Ye] = y(
2788
+ const de = he(Gi()), [ce, Ie] = y(m ? m.q ?? "" : _), X = hs(ce.trim(), 350), [qe, Ye] = y(
2786
2789
  E ? E.filters : $ ?? []
2787
- ), [Z, q] = y(m ? m.s ?? "" : i ?? ""), [se, fe] = y(h ?? null), [oe, Me] = y({}), [ie, w] = y({}), [be, ae] = y(null), [Ce, ut] = y({}), [ln, Ht] = y({}), [Ot, Q] = y({}), [et, tt] = y({}), [Nn, Be] = y(null), [Yt, At] = y(!1), sn = he(null), [Sn, nt] = y(
2790
+ ), [Z, q] = y(m ? m.s ?? "" : d ?? ""), [oe, fe] = y(h ?? null), [ae, Me] = y({}), [ie, w] = y({}), [be, re] = y(null), [Ce, ut] = y({}), [ln, Ht] = y({}), [Ot, Q] = y({}), [et, tt] = y({}), [Nn, Be] = y(null), [Yt, At] = y(!1), sn = he(null), [Sn, nt] = y(
2788
2791
  () => (m == null ? void 0 : m.qf) ?? {}
2789
2792
  ), [pt, Ft] = y(
2790
2793
  () => (m == null ? void 0 : m.qf) ?? {}
2791
2794
  ), [_t, on] = y(
2792
2795
  m ? m.lc ?? [] : T ?? []
2793
- ), { scopes: Nt, ready: Cn } = zd(), [We, Rt] = y(!1), [$n, Yn] = y(/* @__PURE__ */ new Set()), [ze, It] = y(
2796
+ ), { scopes: Nt, ready: Cn } = Qd(), [We, Rt] = y(!1), [$n, Yn] = y(/* @__PURE__ */ new Set()), [ze, It] = y(
2794
2797
  () => (m == null ? void 0 : m.cf) ?? {}
2795
2798
  ), mt = wi("drill.browser"), at = mt.value, [qn, dn] = y(null), [cn, Jt] = y(!1), [Gt, Jn] = y(() => {
2796
2799
  try {
@@ -2839,14 +2842,14 @@ function x0({
2839
2842
  me(() => {
2840
2843
  !C || Dr.current || (Dr.current = !0, J(!0), Oe(C), Kt.mutate(C));
2841
2844
  }, [C]);
2842
- const [le, jt] = y(null), [Rn, Pr] = y(() => (m == null ? void 0 : m.ex) ?? []);
2845
+ const [se, jt] = y(null), [Rn, Pr] = y(() => (m == null ? void 0 : m.ex) ?? []);
2843
2846
  me(() => {
2844
- if (!le) return;
2847
+ if (!se) return;
2845
2848
  const e = () => jt(null);
2846
2849
  return window.addEventListener("mousedown", e), window.addEventListener("scroll", e, !0), window.addEventListener("keydown", e), () => {
2847
2850
  window.removeEventListener("mousedown", e), window.removeEventListener("scroll", e, !0), window.removeEventListener("keydown", e);
2848
2851
  };
2849
- }, [le]);
2852
+ }, [se]);
2850
2853
  const [Zt, en] = y([]);
2851
2854
  $i();
2852
2855
  const [Bt, En] = y(null), [Hs, La] = y(!1), [tn, Fa] = y(""), [Ra, Mr] = y(!1), [Ys, Or] = y(!1), [Ea, mn] = y(!1), Ar = he(null);
@@ -2860,7 +2863,7 @@ function x0({
2860
2863
  }, [Ea]);
2861
2864
  const Ir = he(null), Kr = he(null), jr = !m && ((T == null ? void 0 : T.length) ?? 0) > 0, Da = he(!!m || jr), { isAdmin: Et } = Na(), Br = he(n);
2862
2865
  me(() => {
2863
- Br.current !== n && (Br.current = n, F(1), Ie(_), Ye([]), q(i ?? ""), fe(h ?? null), Me({}), w({}), ut({}), Ht({}), en([]), En(null), nt({}), Ft({}), It({}), on([]), at != null && at.length && mt.back(at.length), dn(null), Da.current = !1);
2866
+ Br.current !== n && (Br.current = n, F(1), Ie(_), Ye([]), q(d ?? ""), fe(h ?? null), Me({}), w({}), ut({}), Ht({}), en([]), En(null), nt({}), Ft({}), It({}), on([]), at != null && at.length && mt.back(at.length), dn(null), Da.current = !1);
2864
2867
  }, [n]), me(() => {
2865
2868
  if (!cn) return;
2866
2869
  const e = (t) => {
@@ -2883,16 +2886,16 @@ function x0({
2883
2886
  retry: !1
2884
2887
  }), St = ke(() => ((O == null ? void 0 : O.fields) ?? []).filter((e) => !e.hidden), [O]), Ee = (O == null ? void 0 : O.browser_config) ?? {}, Le = (Gl = Ee.fulfilment) != null && Gl.shipped_field && ((Xl = Ee.fulfilment) != null && Xl.requested_field) ? Ee.fulfilment : null, zr = he(!!m);
2885
2888
  me(() => {
2886
- zr.current || !O || (zr.current = !0, !i && !Z && Ee.default_sort && q(Ee.default_sort));
2889
+ zr.current || !O || (zr.current = !0, !d && !Z && Ee.default_sort && q(Ee.default_sort));
2887
2890
  }, [O]);
2888
2891
  const Ct = Ee.checkbox_selection !== !1, Qr = Ee.show_actions !== !1, [ft, Js] = y(!1), Gs = () => {
2889
2892
  ft && en([]), Js(!ft);
2890
- }, Zn = V && Ee.allow_create !== !1, Ur = typeof Ee.create_label == "string" && Ee.create_label.trim().slice(0, 40) || "New item", ea = Wd(Zn && !(O != null && O.singleton) ? n : null), [Pa, Dn] = y(!1), [Ma, ta] = y(null), { steps: Oa } = jc(
2893
+ }, Zn = V && Ee.allow_create !== !1, Ur = typeof Ee.create_label == "string" && Ee.create_label.trim().slice(0, 40) || "New item", ea = Vd(Zn && !(O != null && O.singleton) ? n : null), [Pa, Dn] = y(!1), [Ma, ta] = y(null), { steps: Oa } = zc(
2891
2894
  Zn && !(O != null && O.singleton) ? n : null,
2892
2895
  null
2893
2896
  ), Wr = (e) => {
2894
2897
  e ? Y({ collection: n, itemId: "new", layoutSlug: e }) : rn("new");
2895
- }, Pn = Ac(Zn && !(O != null && O.singleton) ? n : null), Xs = _i(), Vr = he(null), [Zs, eo] = y(null), [Hr, Yr] = y(!1), Jr = (e) => {
2898
+ }, Pn = Kc(Zn && !(O != null && O.singleton) ? n : null), Xs = _i(), Vr = he(null), [Zs, eo] = y(null), [Hr, Yr] = y(!1), Jr = (e) => {
2896
2899
  var t;
2897
2900
  eo(e), (t = Vr.current) == null || t.click();
2898
2901
  }, to = async (e) => {
@@ -2900,10 +2903,10 @@ function x0({
2900
2903
  if (e.target.value = "", !!t.length) {
2901
2904
  Yr(!0);
2902
2905
  try {
2903
- const r = await Ic(Xs, t, n);
2906
+ const r = await jc(Xs, t, n);
2904
2907
  Y({ collection: n, itemId: "new", layoutSlug: Zs, query: { autofill: r } });
2905
2908
  } catch (r) {
2906
- zi(r, "The document could not be read", { action: "New from document" });
2909
+ Qi(r, "The document could not be read", { action: "New from document" });
2907
2910
  } finally {
2908
2911
  Yr(!1);
2909
2912
  }
@@ -2917,9 +2920,9 @@ function x0({
2917
2920
  };
2918
2921
  return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
2919
2922
  }, [Pa]);
2920
- const Ve = m != null && m.ps ? m.ps : Ee.page_size && Ee.page_size > 0 ? Math.min(Ee.page_size, 200) : v, $t = d.length > 0 ? d : Ee.quick_filters ?? [];
2923
+ const Ve = m != null && m.ps ? m.ps : Ee.page_size && Ee.page_size > 0 ? Math.min(Ee.page_size, 200) : v, $t = i.length > 0 ? i : Ee.quick_filters ?? [];
2921
2924
  me(() => {
2922
- if (We || !Cn || d.length === 0 && !O) return;
2925
+ if (We || !Cn || i.length === 0 && !O) return;
2923
2926
  const e = Nt, 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);
2924
2927
  if (!e || $t.length === 0 || !t || m || jr) {
2925
2928
  Rt(!0);
@@ -2930,9 +2933,9 @@ function x0({
2930
2933
  for (const l of $t) {
2931
2934
  const s = ws(e, { key: l.key, collection: l.collection });
2932
2935
  if (!s) continue;
2933
- const o = Qd(e, s.name);
2936
+ const o = Ud(e, s.name);
2934
2937
  if (o.length === 0) continue;
2935
- const f = await Ud(u, s, o, l.value_field).catch(
2938
+ const f = await Wd(u, s, o, l.value_field).catch(
2936
2939
  () => []
2937
2940
  );
2938
2941
  f.length > 0 && (r[l.key] = f);
@@ -2953,17 +2956,17 @@ function x0({
2953
2956
  const Xr = (e) => {
2954
2957
  const t = ws(Nt, { key: e.key, collection: e.collection }), r = t ? (Nt == null ? void 0 : Nt.restricted[t.name]) ?? [] : [];
2955
2958
  return r.length > 0 ? r : void 0;
2956
- }, bt = ke(() => new Map(St.map((e) => [e.field, e])), [St]), He = (O == null ? void 0 : O.relations) ?? [], Zr = ke(() => td(Ee.inline_edit), [Ee.inline_edit]), { data: ao } = te({
2959
+ }, bt = ke(() => new Map(St.map((e) => [e.field, e])), [St]), He = (O == null ? void 0 : O.relations) ?? [], Zr = ke(() => nd(Ee.inline_edit), [Ee.inline_edit]), { data: ao } = te({
2957
2960
  queryKey: ["my-permissions"],
2958
2961
  queryFn: () => u.request(G("/security/my/permissions")).then((e) => e.data),
2959
2962
  enabled: Zr.enabled && !Et,
2960
2963
  staleTime: 5 * 6e4
2961
- }), ro = Et || fu(ao, n), el = ke(
2964
+ }), ro = Et || hu(ao, n), el = ke(
2962
2965
  () => new Map(((O == null ? void 0 : O.fields) ?? []).map((e) => [e.field, e])),
2963
2966
  [O]
2964
- ), tl = Vc(), nl = (e) => (
2967
+ ), tl = Yc(), nl = (e) => (
2965
2968
  // Ask-the-table answers are a one-off overlay, not the list's own rows.
2966
- ne ? null : rd({
2969
+ ne ? null : ld({
2967
2970
  config: Zr,
2968
2971
  key: e,
2969
2972
  field: el.get(e),
@@ -2972,7 +2975,7 @@ function x0({
2972
2975
  mayUpdate: ro
2973
2976
  })
2974
2977
  ), lo = (e, t, r, l, s) => {
2975
- const o = e.id, f = s === 0 ? null : ld(
2978
+ const o = e.id, f = s === 0 ? null : sd(
2976
2979
  ge.filter((g) => !!nl(g)),
2977
2980
  t,
2978
2981
  s
@@ -3006,28 +3009,28 @@ function x0({
3006
3009
  if (!s) return l;
3007
3010
  const o = el.get(t);
3008
3011
  return /* @__PURE__ */ a(
3009
- Hc,
3012
+ Jc,
3010
3013
  {
3011
3014
  controller: tl,
3012
3015
  cellKey: `${String(e.id)}|${t}`,
3013
3016
  kind: s,
3014
3017
  value: e[t],
3015
3018
  label: Je(t),
3016
- choices: o ? ad(o) : void 0,
3017
- target: s === "m2o" ? nd(He, n, t) : null,
3019
+ choices: o ? rd(o) : void 0,
3020
+ target: s === "m2o" ? ad(He, n, t) : null,
3018
3021
  onCommit: (f, g) => lo(e, t, s, f, g),
3019
3022
  children: l
3020
3023
  }
3021
3024
  );
3022
- }, ge = ke(() => (se ?? St.slice(0, 7).map((t) => t.field)).filter(
3025
+ }, ge = ke(() => (oe ?? St.slice(0, 7).map((t) => t.field)).filter(
3023
3026
  (t) => t.includes(".") || bt.has(t) || t.startsWith("__f:") && !!ie[t]
3024
- ), [se, St, bt, ie]), [Ia, na] = y(null), Mn = ke(
3027
+ ), [oe, St, bt, ie]), [Ia, na] = y(null), Mn = ke(
3025
3028
  () => Ia ?? (ge[0] ? { [ge[0]]: "left" } : {}),
3026
3029
  [Ia, ge]
3027
3030
  ), kt = (e) => Mn[e], oo = (e) => {
3028
3031
  const t = { ...Mn }, r = t[e];
3029
3032
  r ? r === "left" ? t[e] = "right" : delete t[e] : t[e] = "left", na(t);
3030
- }, Je = (e) => oe[e] ?? (e.startsWith("__f:") ? ie[e] ?? "Formula" : e.includes(".") ? e.split(".").map(Ae).join(" › ") : e === "id" ? "ID" : Ae(e)), al = (e, t) => {
3033
+ }, Je = (e) => ae[e] ?? (e.startsWith("__f:") ? ie[e] ?? "Formula" : e.includes(".") ? e.split(".").map(Ae).join(" › ") : e === "id" ? "ID" : Ae(e)), al = (e, t) => {
3031
3034
  var l, s, o;
3032
3035
  const r = t.includes(".") ? (o = (s = (l = $e == null ? void 0 : $e.rows) == null ? void 0 : l[String(e.id)]) == null ? void 0 : s[t]) == null ? void 0 : o.value : e[t];
3033
3036
  return typeof r == "string" && /^-?\d+(\.\d+)?$/.test(r.trim()) ? Number(r) : r;
@@ -3115,7 +3118,7 @@ function x0({
3115
3118
  s != null && s.one_collection && (e[t.field] = { kind: "m2m", target: s.one_collection });
3116
3119
  }
3117
3120
  return e;
3118
- }, [zt, nn]), Ba = hs(ze, 350), [fn, uo] = y((m == null ? void 0 : m.a) === !0), [il, po] = y(null), On = wc(n, il), [yt, dl] = y(null), { data: An } = pc(n), [qt, aa] = y(() => (E == null ? void 0 : E.riskIds) ?? []), Ne = ke(() => {
3121
+ }, [zt, nn]), Ba = hs(ze, 350), [fn, uo] = y((m == null ? void 0 : m.a) === !0), [il, po] = y(null), On = Nc(n, il), [yt, dl] = y(null), { data: An } = fc(n), [qt, aa] = y(() => (E == null ? void 0 : E.riskIds) ?? []), Ne = ke(() => {
3119
3122
  var t;
3120
3123
  const e = Ds(qe);
3121
3124
  for (const r of $t) {
@@ -3154,7 +3157,7 @@ function x0({
3154
3157
  e.push({ path: [r], op: l.op, value: Number(l.value) });
3155
3158
  else if (l.kind === "bool") e.push({ path: [r], op: "_eq", value: l.value === "true" });
3156
3159
  else if (l.kind === "date" && l.value) {
3157
- const s = Sa(l.value), f = (s ? Oi(s) : null) ?? Us(l.value);
3160
+ const s = Sa(l.value), f = (s ? Ai(s) : null) ?? Us(l.value);
3158
3161
  f && (f.from && e.push({ path: [r], op: "_gte", value: f.from }), f.to && e.push({ path: [r], op: "_lte", value: `${f.to}T23:59:59` }));
3159
3162
  }
3160
3163
  }
@@ -3216,7 +3219,7 @@ function x0({
3216
3219
  Ve,
3217
3220
  Ne,
3218
3221
  In
3219
- ]), s = de.current, o = Gi(s, l, e, Z);
3222
+ ]), s = de.current, o = Xi(s, l, e, Z);
3220
3223
  if (o.after === void 0 && o.sort === Z) return r(e);
3221
3224
  try {
3222
3225
  const f = await u.request(
@@ -3226,10 +3229,10 @@ function x0({
3226
3229
  ...o.sort ? { sort: o.sort } : {}
3227
3230
  })
3228
3231
  );
3229
- return o.after !== void 0 && Xi(s, l, e, f.next_cursor), f;
3232
+ return o.after !== void 0 && Zi(s, l, e, f.next_cursor), f;
3230
3233
  } catch (f) {
3231
- if (!Zi(f)) throw f;
3232
- return ed(s, l), r(e);
3234
+ if (!ed(f)) throw f;
3235
+ return td(s, l), r(e);
3233
3236
  }
3234
3237
  }, {
3235
3238
  data: xe,
@@ -3249,13 +3252,13 @@ function x0({
3249
3252
  retry: !1
3250
3253
  }), bl = he(() => {
3251
3254
  });
3252
- Sd({
3255
+ Cd({
3253
3256
  qc: k,
3254
3257
  enabled: !!n && We && !ue && !X && !ht && !!xe && I * Ve < (xe.total ?? 0),
3255
3258
  queryKey: ml(I + 1),
3256
3259
  queryFn: () => fl(I + 1).then((e) => (bl.current(e.data ?? []), e))
3257
3260
  }), me(() => {
3258
- const e = ud({
3261
+ const e = pd({
3259
3262
  pending: ee.current,
3260
3263
  gateOpen: We,
3261
3264
  fetching: ht,
@@ -3318,7 +3321,7 @@ function x0({
3318
3321
  const e = `${n}\0${X}`;
3319
3322
  ((t = ia.current) == null ? void 0 : t.key) !== e && (ia.current = {
3320
3323
  key: e,
3321
- id: Ad(u, {
3324
+ id: Id(u, {
3322
3325
  surface: "collection",
3323
3326
  collection: n,
3324
3327
  query: X,
@@ -3326,7 +3329,7 @@ function x0({
3326
3329
  duration_ms: Date.now() - gl.current
3327
3330
  })
3328
3331
  });
3329
- }, [u, n, X, xe, ht, ne]), Jd(
3332
+ }, [u, n, X, xe, ht, ne]), Xd(
3330
3333
  n ? {
3331
3334
  list: {
3332
3335
  collection: n,
@@ -3343,18 +3346,18 @@ function x0({
3343
3346
  }
3344
3347
  } : null
3345
3348
  );
3346
- const ho = Gd(), xl = Ni(ht), Ha = Si({
3349
+ const ho = Zd(), xl = Ni(ht), Ha = Si({
3347
3350
  pending: ht,
3348
3351
  request: n ? { method: "GET", url: `/items/${n}` } : null,
3349
3352
  noun: ((O == null ? void 0 : O.display_name) ?? n ?? "").replace(/_/g, " ").toLowerCase() || null,
3350
3353
  // Only a total this person has already been shown (never a raw table count).
3351
- knownRows: ht ? jd(k.getQueriesData({ queryKey: ["cbv-items", n] })) : null
3352
- }), Ya = Fd(), { userId: Ja } = Na(), Tt = md(), Ga = he(/* @__PURE__ */ new Set());
3354
+ knownRows: ht ? Bd(k.getQueriesData({ queryKey: ["cbv-items", n] })) : null
3355
+ }), Ya = Rd(), { userId: Ja } = Na(), Tt = fd(), Ga = he(/* @__PURE__ */ new Set());
3353
3356
  Ga.current = new Set(Se.map((e) => String(e.id)));
3354
3357
  const go = ke(
3355
3358
  () => Se.slice(0, 100).map((e) => ({ collection: n, item: String(e.id) })),
3356
3359
  [Se, n]
3357
- ), vl = qd(go), kl = he([]);
3360
+ ), vl = Td(go), kl = he([]);
3358
3361
  kl.current = [
3359
3362
  "cbv-items",
3360
3363
  n,
@@ -3409,16 +3412,16 @@ function x0({
3409
3412
  H = !0;
3410
3413
  continue;
3411
3414
  }
3412
- const re = U.get(ve), S = (re == null ? void 0 : re.action) === "delete" || W.action === "delete" ? "delete" : (re == null ? void 0 : re.action) === "create" ? "create" : W.action, j = /* @__PURE__ */ new Set([...(re == null ? void 0 : re.changed_fields) ?? [], ...W.changed_fields ?? []]);
3415
+ const le = U.get(ve), S = (le == null ? void 0 : le.action) === "delete" || W.action === "delete" ? "delete" : (le == null ? void 0 : le.action) === "create" ? "create" : W.action, j = /* @__PURE__ */ new Set([...(le == null ? void 0 : le.changed_fields) ?? [], ...W.changed_fields ?? []]);
3413
3416
  U.set(ve, {
3414
3417
  ...W,
3415
3418
  action: S,
3416
- changed_fields: W.changed_fields || re != null && re.changed_fields ? [...j] : void 0
3419
+ changed_fields: W.changed_fields || le != null && le.changed_fields ? [...j] : void 0
3417
3420
  });
3418
3421
  }
3419
3422
  H && e();
3420
- const p = Ga.current, dt = (W) => Nd(n, W.item), Xe = (W) => {
3421
- const ve = vd(W);
3423
+ const p = Ga.current, dt = (W) => Sd(n, W.item), Xe = (W) => {
3424
+ const ve = kd(W);
3422
3425
  return ve && Ja && ve.toUpperCase() === Ja.toUpperCase() ? "self" : ve;
3423
3426
  }, Lt = [];
3424
3427
  for (const [W, ve] of U)
@@ -3426,7 +3429,7 @@ function x0({
3426
3429
  if (Lt.length > 0) {
3427
3430
  const W = new Set(Lt);
3428
3431
  s((ve) => ({
3429
- data: ve.data.filter((re) => !W.has(String(re.id))),
3432
+ data: ve.data.filter((le) => !W.has(String(le.id))),
3430
3433
  total: Math.max(0, ve.total - Lt.length)
3431
3434
  })), Tt.forget(Lt);
3432
3435
  }
@@ -3434,7 +3437,7 @@ function x0({
3434
3437
  const ot = yl.current;
3435
3438
  let Ut;
3436
3439
  try {
3437
- Ut = await hd(
3440
+ Ut = await gd(
3438
3441
  u,
3439
3442
  n,
3440
3443
  [...U.keys()],
@@ -3447,8 +3450,8 @@ function x0({
3447
3450
  e();
3448
3451
  continue;
3449
3452
  }
3450
- u.request(G(`/items/${n}/${W}`)).then((re) => {
3451
- const S = re == null ? void 0 : re.data;
3453
+ u.request(G(`/items/${n}/${W}`)).then((le) => {
3454
+ const S = le == null ? void 0 : le.data;
3452
3455
  S && (s((j) => ({
3453
3456
  ...j,
3454
3457
  data: j.data.map((_e) => String(_e.id) === W ? { ..._e, ...S } : _e)
@@ -3458,35 +3461,35 @@ function x0({
3458
3461
  return;
3459
3462
  }
3460
3463
  if (x) return;
3461
- const vn = gd(ot.conditions), kn = ot.page === 1 && !ot.grouped, it = /* @__PURE__ */ new Map(), P = [], Ze = [];
3464
+ const vn = xd(ot.conditions), kn = ot.page === 1 && !ot.grouped, it = /* @__PURE__ */ new Map(), P = [], Ze = [];
3462
3465
  for (const [W, ve] of U) {
3463
- const re = Ut.get(W);
3464
- p.has(W) ? re ? it.set(W, re) : P.push(W) : re && ((ve.action === "create" || !!ot.conditions && xd(ve, vn)) && kn ? Ze.push({ row: re, ev: ve }) : e());
3466
+ const le = Ut.get(W);
3467
+ p.has(W) ? le ? it.set(W, le) : P.push(W) : le && ((ve.action === "create" || !!ot.conditions && vd(ve, vn)) && kn ? Ze.push({ row: le, ev: ve }) : e());
3465
3468
  }
3466
3469
  if (it.size > 0 || P.length > 0 || Ze.length > 0) {
3467
3470
  const W = new Set(P);
3468
3471
  s((ve) => {
3469
- const re = ve.data.filter((S) => !W.has(String(S.id))).map((S) => {
3472
+ const le = ve.data.filter((S) => !W.has(String(S.id))).map((S) => {
3470
3473
  const j = it.get(String(S.id));
3471
3474
  return j ? { ...S, ...j } : S;
3472
3475
  });
3473
3476
  return {
3474
- data: [...Ze.map((S) => S.row), ...re],
3477
+ data: [...Ze.map((S) => S.row), ...le],
3475
3478
  total: Math.max(0, ve.total - P.length + Ze.length)
3476
3479
  };
3477
3480
  });
3478
3481
  }
3479
3482
  P.length > 0 && Tt.forget(P);
3480
3483
  for (const [W] of it) {
3481
- const ve = U.get(W), re = Xe(it.get(W));
3482
- ve && !dt(ve) && re !== "self" && Tt.note([W], re);
3484
+ const ve = U.get(W), le = Xe(it.get(W));
3485
+ ve && !dt(ve) && le !== "self" && Tt.note([W], le);
3483
3486
  }
3484
3487
  for (const { row: W, ev: ve } of Ze) {
3485
- const re = String(W.id);
3486
- Xe(W) !== "self" && Tt.note([re], Xe(W), "create");
3488
+ const le = String(W.id);
3489
+ Xe(W) !== "self" && Tt.note([le], Xe(W), "create");
3487
3490
  }
3488
3491
  }, K = (D) => {
3489
- for (const U of D.flatMap((H) => pd(H))) {
3492
+ for (const U of D.flatMap((H) => md(H))) {
3490
3493
  const H = U.changed_fields;
3491
3494
  if (!U.action && (H != null && H.length) && H.every((p) => p.startsWith("$"))) {
3492
3495
  (String(U.item) === "*" || Ga.current.has(String(U.item))) && l(H);
@@ -3497,13 +3500,13 @@ function x0({
3497
3500
  o.length > 0 && !f && (f = setTimeout(() => void z(), 300));
3498
3501
  }, Te = Ya.subscribeCollections(
3499
3502
  [n],
3500
- (D) => Vi(Xa, [D], K)
3503
+ (D) => Hi(Xa, [D], K)
3501
3504
  );
3502
3505
  return () => {
3503
- x = !0, Te(), Hi(Xa), r && clearTimeout(r), f && clearTimeout(f), g && clearTimeout(g);
3506
+ x = !0, Te(), Yi(Xa), r && clearTimeout(r), f && clearTimeout(f), g && clearTimeout(g);
3504
3507
  };
3505
3508
  }, [Ya, n, k, u, Ja, Tt, Xa]);
3506
- const ko = fd(
3509
+ const ko = bd(
3507
3510
  n,
3508
3511
  Se.map((e) => String(e.id)),
3509
3512
  xo
@@ -3531,7 +3534,7 @@ function x0({
3531
3534
  }), Ke = Se.map((e) => String(e.id)).join(","), _o = ke(
3532
3535
  () => Se.map((e) => ({ collection: n, id: e.id })),
3533
3536
  [Se, n]
3534
- ), No = Jc(_o, Et), tr = !!(O != null && O.addendums_enabled), { data: nr } = te({
3537
+ ), No = Xc(_o, Et), tr = !!(O != null && O.addendums_enabled), { data: nr } = te({
3535
3538
  queryKey: ["cbv-addendum-summary", n, Ke],
3536
3539
  queryFn: () => u.request(
3537
3540
  ye("/addendums/summary", { collection: n, ids: Ke.split(",") })
@@ -3606,7 +3609,7 @@ function x0({
3606
3609
  () => ge.filter((e) => e.includes(".")),
3607
3610
  [ge]
3608
3611
  ), Sl = ke(
3609
- () => ge.filter((e) => e.startsWith("__f:")).flatMap((e) => Qi(ie[e] ?? "")).filter((e) => e.includes(".")),
3612
+ () => ge.filter((e) => e.startsWith("__f:")).flatMap((e) => Ui(ie[e] ?? "")).filter((e) => e.includes(".")),
3610
3613
  [ge, ie]
3611
3614
  ), jn = ke(
3612
3615
  () => [.../* @__PURE__ */ new Set([...Nl, ...Object.values(Qe), ...Sl])].slice(
@@ -3652,7 +3655,7 @@ function x0({
3652
3655
  isResolvedCol: Pt,
3653
3656
  fetchResolved: $l,
3654
3657
  fetchRelation: (t, r) => Bs(u, t, r),
3655
- userCardQuery: (t) => Hd(u, t)
3658
+ userCardQuery: (t) => Yd(u, t)
3656
3659
  });
3657
3660
  const hn = (e) => {
3658
3661
  if (e.includes(".")) return { kind: "text", path: e.split(".") };
@@ -3746,7 +3749,7 @@ function x0({
3746
3749
  f.add(z);
3747
3750
  else x[e] != null && x[e] !== "" && typeof x[e] != "object" && f.add(x[e]);
3748
3751
  return /* @__PURE__ */ a(
3749
- gu,
3752
+ vu,
3750
3753
  {
3751
3754
  target: t.target,
3752
3755
  selected: (r == null ? void 0 : r.kind) === "in" ? r.value : [],
@@ -3757,7 +3760,7 @@ function x0({
3757
3760
  }
3758
3761
  if (t.kind === "enum")
3759
3762
  return /* @__PURE__ */ a(
3760
- xu,
3763
+ ku,
3761
3764
  {
3762
3765
  collection: n,
3763
3766
  field: e,
@@ -3817,7 +3820,7 @@ function x0({
3817
3820
  className: "w-full"
3818
3821
  }
3819
3822
  ) : t.kind === "date" ? /* @__PURE__ */ a(
3820
- vu,
3823
+ yu,
3821
3824
  {
3822
3825
  value: (r == null ? void 0 : r.kind) === "date" ? r.value : "",
3823
3826
  onChange: (f) => je(e, f ? { kind: "date", value: f } : null)
@@ -3838,7 +3841,7 @@ function x0({
3838
3841
  var s, o, f;
3839
3842
  const l = Ce[t];
3840
3843
  if ((l == null ? void 0 : l.type) === "count") {
3841
- const g = t.includes(".") ? t : Qe[t], x = r != null && g ? (f = (o = (s = $e == null ? void 0 : $e.rows) == null ? void 0 : s[String(r)]) == null ? void 0 : o[g]) == null ? void 0 : f.ids : void 0, z = Yi(e === "—" ? "" : e, x);
3844
+ const g = t.includes(".") ? t : Qe[t], x = r != null && g ? (f = (o = (s = $e == null ? void 0 : $e.rows) == null ? void 0 : s[String(r)]) == null ? void 0 : o[g]) == null ? void 0 : f.ids : void 0, z = Ji(e === "—" ? "" : e, x);
3842
3845
  return String(z);
3843
3846
  }
3844
3847
  return l && e && e !== "—" ? xs(e, l) : e;
@@ -3901,14 +3904,14 @@ function x0({
3901
3904
  ua(e);
3902
3905
  return;
3903
3906
  }
3904
- En(null), Ye([]), aa([]), q(i ?? ""), fe(h ?? null), Me({}), w({}), ut({}), Ht({}), na(null), F(1);
3907
+ En(null), Ye([]), aa([]), q(d ?? ""), fe(h ?? null), Me({}), w({}), ut({}), Ht({}), na(null), F(1);
3905
3908
  }, Bn = () => ({
3906
3909
  // The pressed highlight pills ride along as one `$at_risk` filter entry.
3907
- filters: [...qe, ...[Cc(qt, da)].filter((e) => e !== null)],
3910
+ filters: [...qe, ...[qc(qt, da)].filter((e) => e !== null)],
3908
3911
  sort: Z,
3909
3912
  columns: [
3910
3913
  ...ge.map((e, t) => {
3911
- const r = oe[e], l = Ce[e], s = Mn[e] ?? (t === 0 && Ia !== null ? "none" : void 0), o = et[e], f = Ot[e], g = ln[e], x = ie[e];
3914
+ const r = ae[e], l = Ce[e], s = Mn[e] ?? (t === 0 && Ia !== null ? "none" : void 0), o = et[e], f = Ot[e], g = ln[e], x = ie[e];
3912
3915
  return !r && !l && !s && !(o != null && o.length) && !f && !g && !x && !Ll.has(e) ? e : {
3913
3916
  key: e,
3914
3917
  ...x ? { formula: x } : {},
@@ -3981,7 +3984,7 @@ function x0({
3981
3984
  columns: m.c
3982
3985
  }), En(null), F(m.p ?? 1)));
3983
3986
  }, [St]), me(() => {
3984
- m && id();
3987
+ m && dd();
3985
3988
  }, []);
3986
3989
  const Ao = () => {
3987
3990
  const e = Bn();
@@ -4062,13 +4065,13 @@ function x0({
4062
4065
  if (!Ra) {
4063
4066
  Mr(!0);
4064
4067
  try {
4065
- const { rows: r, truncated: l } = await fc(
4068
+ const { rows: r, truncated: l } = await hc(
4066
4069
  (S, j) => u.request(
4067
4070
  G(`/items/${n}`, {
4068
4071
  limit: j,
4069
4072
  offset: S,
4070
4073
  ...X ? { search: X } : {},
4071
- sort: bc(Z),
4074
+ sort: gc(Z),
4072
4075
  ...Ne ? { conditions: Ne } : {}
4073
4076
  })
4074
4077
  )
@@ -4094,7 +4097,7 @@ function x0({
4094
4097
  labelField: Wn(_e)
4095
4098
  });
4096
4099
  }
4097
- const g = [.../* @__PURE__ */ new Set([...jn, ...o.flatMap(hc)])], x = await gc(
4100
+ const g = [.../* @__PURE__ */ new Set([...jn, ...o.flatMap(xc)])], x = await vc(
4098
4101
  r.map((S) => String(S.id)),
4099
4102
  g,
4100
4103
  (S, j) => u.request(
@@ -4113,7 +4116,7 @@ function x0({
4113
4116
  ].map(String), K = /* @__PURE__ */ new Map();
4114
4117
  await Promise.all(
4115
4118
  z.map(
4116
- (S) => Vd(u, S).then((j) => K.set(S.toUpperCase(), xc(j, S))).catch(() => K.set(S.toUpperCase(), S))
4119
+ (S) => Hd(u, S).then((j) => K.set(S.toUpperCase(), kc(j, S))).catch(() => K.set(S.toUpperCase(), S))
4117
4120
  )
4118
4121
  );
4119
4122
  const Te = new Map(o.map((S) => [S.column, S])), D = new Set(f), U = (S) => {
@@ -4135,7 +4138,7 @@ function x0({
4135
4138
  return _e && yn ? xs(yn, _e) : yn;
4136
4139
  }
4137
4140
  const Re = S[j], is = Te.get(j);
4138
- return is && Re != null && Re !== "" ? vc(is, x[String(S.id)]) || Re : D.has(j) && Re != null && Re !== "" ? K.get(String(Re).toUpperCase()) ?? Re : Re != null && Re !== "" && ((_e == null ? void 0 : _e.type) === "number" || or(j)) ? Fi(Re) : Re != null && Re !== "" && ((_e == null ? void 0 : _e.type) === "datetime" || Eo(j)) ? Ri(Re) : j === "id" ? _r(O, S) ?? Re : _e && Re != null ? Un(String(Re), _e) : Re;
4141
+ return is && Re != null && Re !== "" ? yc(is, x[String(S.id)]) || Re : D.has(j) && Re != null && Re !== "" ? K.get(String(Re).toUpperCase()) ?? Re : Re != null && Re !== "" && ((_e == null ? void 0 : _e.type) === "number" || or(j)) ? Fi(Re) : Re != null && Re !== "" && ((_e == null ? void 0 : _e.type) === "datetime" || Eo(j)) ? Ri(Re) : j === "id" ? _r(O, S) ?? Re : _e && Re != null ? Un(String(Re), _e) : Re;
4139
4142
  }, p = Qt.filter((S) => S.kind !== "actions"), dt = new Set(
4140
4143
  p.filter((S) => S.kind !== "data" && S.kind !== "formula").map((S) => S.kind)
4141
4144
  ), Xe = r.map((S) => String(S.id)), Lt = await Ei(Xe, dt, {
@@ -4157,7 +4160,7 @@ function x0({
4157
4160
  tasks: (S) => u.request(
4158
4161
  ye("/tasks/counts", { collection: n, ids: S })
4159
4162
  ).then((j) => j.data ?? {})
4160
- }), ot = Pd(O), Ut = ot ? s.includes(ot) || s.includes("id") ? [] : [{ header: Je(ot), cell: (S) => S[ot] }] : s.includes("id") ? [] : [{ header: "ID", cell: (S) => S.id }], vn = (S) => S.kind === "data" || S.kind === "formula" ? Je(S.key) : S.kind === "fulfilment" && (Le != null && Le.label) ? `${Le.label} shipped` : Di[S.kind], kn = Date.now(), it = [
4163
+ }), ot = Md(O), Ut = ot ? s.includes(ot) || s.includes("id") ? [] : [{ header: Je(ot), cell: (S) => S[ot] }] : s.includes("id") ? [] : [{ header: "ID", cell: (S) => S.id }], vn = (S) => S.kind === "data" || S.kind === "formula" ? Je(S.key) : S.kind === "fulfilment" && (Le != null && Le.label) ? `${Le.label} shipped` : Di[S.kind], kn = Date.now(), it = [
4161
4164
  [...Ut.map((S) => S.header), ...p.map(vn)].map(U).join(","),
4162
4165
  ...r.map(
4163
4166
  (S) => [
@@ -4189,8 +4192,8 @@ function x0({
4189
4192
  const P = new Blob([it.join(`
4190
4193
  `)], { type: "text/csv;charset=utf-8" }), Ze = URL.createObjectURL(P), W = document.createElement("a");
4191
4194
  W.href = Ze;
4192
- const ve = Ee.export_filename, re = ((t = lt.find((S) => S.id === Bt)) == null ? void 0 : t.name) ?? "all";
4193
- W.download = ve ? `${ve.replace(/\{\{\s*collection\s*\}\}/g, n).replace(/\{\{\s*view\s*\}\}/g, re).replace(/\{\{\s*date\s*\}\}/g, kc()).replace(/[^A-Za-z0-9 ._-]/g, "")}.csv` : `${n}.csv`, W.click(), setTimeout(() => URL.revokeObjectURL(Ze), 1e4), l && we.warning(`Exported the first ${r.length.toLocaleString()} rows`, {
4195
+ const ve = Ee.export_filename, le = ((t = lt.find((S) => S.id === Bt)) == null ? void 0 : t.name) ?? "all";
4196
+ W.download = ve ? `${ve.replace(/\{\{\s*collection\s*\}\}/g, n).replace(/\{\{\s*view\s*\}\}/g, le).replace(/\{\{\s*date\s*\}\}/g, wc()).replace(/[^A-Za-z0-9 ._-]/g, "")}.csv` : `${n}.csv`, W.click(), setTimeout(() => URL.revokeObjectURL(Ze), 1e4), l && we.warning(`Exported the first ${r.length.toLocaleString()} rows`, {
4194
4197
  description: `${De.toLocaleString()} match — narrow the filter to export the rest.`
4195
4198
  });
4196
4199
  } catch (r) {
@@ -4201,7 +4204,7 @@ function x0({
4201
4204
  }
4202
4205
  }, Uo = (e) => {
4203
4206
  const t = `record:${n}:${String(e)}`;
4204
- return Cd(t, () => $d(k, u, n, String(e), { group: t }));
4207
+ return $d(t, () => qd(k, u, n, String(e), { group: t }));
4205
4208
  }, Wo = (e) => {
4206
4209
  const t = Uo(e);
4207
4210
  return {
@@ -4234,20 +4237,20 @@ function x0({
4234
4237
  ...((f = r.currentTarget.parentElement) == null ? void 0 : f.querySelectorAll(
4235
4238
  ":scope > [data-row-open]"
4236
4239
  )) ?? []
4237
- ], s = Sc(l.length, l.indexOf(r.currentTarget), r.key), o = s === null ? null : l[s];
4240
+ ], s = $c(l.length, l.indexOf(r.currentTarget), r.key), o = s === null ? null : l[s];
4238
4241
  o && (o.focus(), (g = o.scrollIntoView) == null || g.call(o, { block: "nearest" }));
4239
4242
  }
4240
4243
  };
4241
4244
  }, rn = (e) => {
4242
4245
  var t;
4243
- ((t = ia.current) == null ? void 0 : t.key) === `${n}\0${X}` && Id(u, ia.current.id, {
4246
+ ((t = ia.current) == null ? void 0 : t.key) === `${n}\0${X}` && Kd(u, ia.current.id, {
4244
4247
  type: "record",
4245
4248
  collection: n,
4246
4249
  item: e === "new" ? null : e
4247
4250
  }), N ? N(e) : Y({ collection: n, itemId: String(e) });
4248
4251
  }, Il = (e) => {
4249
4252
  const t = rt(He, n, e), r = (l) => {
4250
- q(Bd(Z, l, Ee.default_sort ?? "")), F(1);
4253
+ q(zd(Z, l, Ee.default_sort ?? "")), F(1);
4251
4254
  };
4252
4255
  if (t != null && t.one_collection && !wt(t.one_collection)) {
4253
4256
  const l = t.one_collection;
@@ -4306,9 +4309,9 @@ function x0({
4306
4309
  ], Xo = Qt.map((e) => {
4307
4310
  if (e.kind === "data") {
4308
4311
  const t = bt.get(e.key.split(".")[0]);
4309
- return { key: e.key, shape: Kd(t == null ? void 0 : t.type, t == null ? void 0 : t.interface) };
4312
+ return { key: e.key, shape: jd(t == null ? void 0 : t.type, t == null ? void 0 : t.interface) };
4310
4313
  }
4311
- return { key: e.key, shape: Fu[e.kind] ?? "short" };
4314
+ return { key: e.key, shape: Eu[e.kind] ?? "short" };
4312
4315
  }), zl = [
4313
4316
  ...zn ? [{ key: "__state__", label: "State" }] : [],
4314
4317
  ...ge.filter((e) => Pt(e) || !rt(He, n, e)).map((e) => ({ key: e, label: Je(e) }))
@@ -4336,7 +4339,7 @@ function x0({
4336
4339
  if (r.push({ kind: "header", gkey: l, label: l, count: s.length }), !Ln.has(l)) for (const o of s) r.push({ kind: "row", row: o });
4337
4340
  }
4338
4341
  return r;
4339
- })(), [ei, ti] = y(null), ni = Nc(Ql, ei), pr = Qt.filter((e) => kt(e.key) === "left").map((e) => e.key), Ul = Qt.filter((e) => kt(e.key) === "right").map((e) => e.key), mr = he(/* @__PURE__ */ new Map()), [Qn, ai] = y({});
4342
+ })(), [ei, ti] = y(null), ni = Cc(Ql, ei), pr = Qt.filter((e) => kt(e.key) === "left").map((e) => e.key), Ul = Qt.filter((e) => kt(e.key) === "right").map((e) => e.key), mr = he(/* @__PURE__ */ new Map()), [Qn, ai] = y({});
4340
4343
  yi(() => {
4341
4344
  const e = {};
4342
4345
  for (const [r, l] of mr.current)
@@ -4523,7 +4526,7 @@ function x0({
4523
4526
  text: x.value === "none" ? "with no open tasks" : x.value === "overdue" ? "with overdue tasks" : "with open tasks"
4524
4527
  });
4525
4528
  else if (x.kind === "aging") {
4526
- const D = Ui({ field: z, type: "range", value: x.value, rangeUnit: "h" });
4529
+ const D = Wi({ field: z, type: "range", value: x.value, rangeUnit: "h" });
4527
4530
  D && r.push(D);
4528
4531
  } else if (x.kind === "text" && x.value.trim())
4529
4532
  r.push({ kind: "text", field: z, text: x.value });
@@ -4561,7 +4564,7 @@ function x0({
4561
4564
  }).filter((x) => !!x);
4562
4565
  g.length > 0 && r.push({ kind: "phrase", text: `flagged ${g.join(" or ")}` });
4563
4566
  }
4564
- return Jl.current = e, Wi({
4567
+ return Jl.current = e, Vi({
4565
4568
  noun: (O == null ? void 0 : O.display_name) || Ae(n),
4566
4569
  viewName: ((f = lt.find((g) => g.id === Bt)) == null ? void 0 : f.name) ?? null,
4567
4570
  search: X,
@@ -4636,83 +4639,83 @@ function x0({
4636
4639
  [data-cbv] .cbv-overlay { animation: none; opacity: 1; }
4637
4640
  }
4638
4641
  ` }),
4639
- /* @__PURE__ */ a(lu, {}),
4640
- /* @__PURE__ */ a(cc, {}),
4641
- le && As(
4642
+ /* @__PURE__ */ a(ou, {}),
4643
+ /* @__PURE__ */ a(pc, {}),
4644
+ se && As(
4642
4645
  /* @__PURE__ */ c(
4643
4646
  "div",
4644
4647
  {
4645
4648
  style: {
4646
4649
  position: "fixed",
4647
- left: Math.min(le.x, window.innerWidth - 236),
4648
- top: Math.min(le.y, window.innerHeight - 380),
4650
+ left: Math.min(se.x, window.innerWidth - 236),
4651
+ top: Math.min(se.y, window.innerHeight - 380),
4649
4652
  zIndex: 125
4650
4653
  },
4651
4654
  className: "nvr-pop-in w-56 overflow-hidden rounded-lg border border-slate-200 bg-white py-1 shadow-xl dark:border-slate-700 dark:bg-slate-900",
4652
4655
  onMouseDown: (e) => e.stopPropagation(),
4653
4656
  children: [
4654
- (le.key === "__state__" || hn(le.key)) && le.cellText && le.cellText !== "—" && /* @__PURE__ */ c(
4657
+ (se.key === "__state__" || hn(se.key)) && se.cellText && se.cellText !== "—" && /* @__PURE__ */ c(
4655
4658
  "button",
4656
4659
  {
4657
4660
  type: "button",
4658
4661
  onClick: () => {
4659
- qo(le), jt(null);
4662
+ qo(se), jt(null);
4660
4663
  },
4661
4664
  className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
4662
4665
  children: [
4663
4666
  "Filter: ",
4664
- /* @__PURE__ */ a("span", { className: "font-medium", children: le.cellText.slice(0, 40) })
4667
+ /* @__PURE__ */ a("span", { className: "font-medium", children: se.cellText.slice(0, 40) })
4665
4668
  ]
4666
4669
  }
4667
4670
  ),
4668
- To(le.key, le.row) && le.cellText && le.cellText !== "—" && /* @__PURE__ */ c(
4671
+ To(se.key, se.row) && se.cellText && se.cellText !== "—" && /* @__PURE__ */ c(
4669
4672
  "button",
4670
4673
  {
4671
4674
  type: "button",
4672
4675
  onClick: () => {
4673
- Lo(le), jt(null);
4676
+ Lo(se), jt(null);
4674
4677
  },
4675
4678
  className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
4676
4679
  children: [
4677
4680
  "Exclude: ",
4678
- /* @__PURE__ */ a("span", { className: "font-medium", children: le.cellText.slice(0, 40) })
4681
+ /* @__PURE__ */ a("span", { className: "font-medium", children: se.cellText.slice(0, 40) })
4679
4682
  ]
4680
4683
  }
4681
4684
  ),
4682
- (le.key === "__state__" || zl.some((e) => e.key === le.key)) && ue !== le.key && /* @__PURE__ */ c(
4685
+ (se.key === "__state__" || zl.some((e) => e.key === se.key)) && ue !== se.key && /* @__PURE__ */ c(
4683
4686
  "button",
4684
4687
  {
4685
4688
  type: "button",
4686
4689
  onClick: () => {
4687
- b(le.key), jt(null);
4690
+ b(se.key), jt(null);
4688
4691
  },
4689
4692
  className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-slate-700 hover:bg-slate-50 dark:text-slate-200 dark:hover:bg-slate-800",
4690
4693
  children: [
4691
4694
  "Group by ",
4692
- le.key === "__state__" ? "State" : Je(le.key)
4695
+ se.key === "__state__" ? "State" : Je(se.key)
4693
4696
  ]
4694
4697
  }
4695
4698
  ),
4696
- le.row.id != null && /* @__PURE__ */ c(Ue, { children: [
4699
+ se.row.id != null && /* @__PURE__ */ c(Ue, { children: [
4697
4700
  /* @__PURE__ */ a("div", { className: "my-1 border-t border-slate-100 dark:border-slate-700" }),
4698
4701
  [
4699
4702
  {
4700
4703
  label: "Open",
4701
- run: () => rn(le.row.id)
4704
+ run: () => rn(se.row.id)
4702
4705
  },
4703
4706
  {
4704
4707
  label: "Open in new tab",
4705
- run: () => window.open(L({ collection: n, itemId: String(le.row.id) }), "_blank")
4708
+ run: () => window.open(L({ collection: n, itemId: String(se.row.id) }), "_blank")
4706
4709
  },
4707
4710
  {
4708
4711
  label: "Peek",
4709
- run: () => mt.push([{ collection: n, itemId: String(le.row.id) }])
4712
+ run: () => mt.push([{ collection: n, itemId: String(se.row.id) }])
4710
4713
  },
4711
4714
  // The friendly id, never the row id (army 7 N7); none = nothing to copy.
4712
4715
  ...qr({
4713
4716
  meta: O,
4714
- row: le.row,
4715
- id: le.row.id
4717
+ row: se.row,
4718
+ id: se.row.id
4716
4719
  }).copy != null ? [
4717
4720
  {
4718
4721
  label: "Copy ID",
@@ -4721,8 +4724,8 @@ function x0({
4721
4724
  (e = navigator.clipboard) == null || e.writeText(
4722
4725
  qr({
4723
4726
  meta: O,
4724
- row: le.row,
4725
- id: le.row.id
4727
+ row: se.row,
4728
+ id: se.row.id
4726
4729
  }).copy ?? ""
4727
4730
  ), we.success("ID copied");
4728
4731
  }
@@ -4735,8 +4738,8 @@ function x0({
4735
4738
  u,
4736
4739
  k,
4737
4740
  n,
4738
- le.row,
4739
- String(le.row.id),
4741
+ se.row,
4742
+ String(se.row.id),
4740
4743
  L
4741
4744
  ), we.success("Link copied");
4742
4745
  }
@@ -4758,7 +4761,7 @@ function x0({
4758
4761
  {
4759
4762
  confirmLabel: "Delete this record? It moves to Trash for 30 days.",
4760
4763
  onConfirm: () => {
4761
- Al.mutate(le.row.id), jt(null);
4764
+ Al.mutate(se.row.id), jt(null);
4762
4765
  },
4763
4766
  className: "block w-full truncate px-3 py-1.5 text-left text-[12px] text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20",
4764
4767
  armedClassName: "whitespace-normal bg-red-50 font-semibold dark:bg-red-900/20",
@@ -4773,7 +4776,7 @@ function x0({
4773
4776
  ),
4774
4777
  /* @__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: [
4775
4778
  /* @__PURE__ */ a(
4776
- $u,
4779
+ Tu,
4777
4780
  {
4778
4781
  collection: n,
4779
4782
  meta: O,
@@ -4818,7 +4821,7 @@ function x0({
4818
4821
  /* @__PURE__ */ a(
4819
4822
  "span",
4820
4823
  {
4821
- className: `h-2 w-2 rounded-full ${Md(e.highlight_color ?? "red")}`
4824
+ className: `h-2 w-2 rounded-full ${Od(e.highlight_color ?? "red")}`
4822
4825
  }
4823
4826
  ),
4824
4827
  e.name
@@ -4827,8 +4830,8 @@ function x0({
4827
4830
  e.id
4828
4831
  );
4829
4832
  }),
4830
- /* @__PURE__ */ a(Zc, { className: "h-8" }),
4831
- /* @__PURE__ */ a(Dc, {}),
4833
+ /* @__PURE__ */ a(tu, { className: "h-8" }),
4834
+ /* @__PURE__ */ a(Mc, {}),
4832
4835
  Za > 0 && /* @__PURE__ */ c(
4833
4836
  "button",
4834
4837
  {
@@ -4858,9 +4861,9 @@ function x0({
4858
4861
  children: /* @__PURE__ */ a(vr, { className: `h-4 w-4 ${ht ? "animate-spin" : ""}` })
4859
4862
  }
4860
4863
  ),
4861
- /* @__PURE__ */ a(Wc, { listKey: `cbv:${n}`, getState: Ao }),
4864
+ /* @__PURE__ */ a(Hc, { listKey: `cbv:${n}`, getState: Ao }),
4862
4865
  Et && Ee.copy_as !== !1 && /* @__PURE__ */ a(
4863
- uc,
4866
+ mc,
4864
4867
  {
4865
4868
  collection: n,
4866
4869
  list: {
@@ -4874,7 +4877,7 @@ function x0({
4874
4877
  }
4875
4878
  ),
4876
4879
  On.parent && /* @__PURE__ */ a(
4877
- _c,
4880
+ Sc,
4878
4881
  {
4879
4882
  parent: On.parent,
4880
4883
  value: il,
@@ -5110,16 +5113,16 @@ function x0({
5110
5113
  "input",
5111
5114
  {
5112
5115
  autoFocus: !0,
5113
- value: oe[e] ?? "",
5116
+ value: ae[e] ?? "",
5114
5117
  placeholder: e.includes(".") ? e.split(".").map(Ae).join(" › ") : Ae(e),
5115
5118
  onChange: (l) => Me((s) => {
5116
5119
  const o = { ...s };
5117
5120
  return l.target.value ? o[e] = l.target.value : delete o[e], o;
5118
5121
  }),
5119
5122
  onKeyDown: (l) => {
5120
- (l.key === "Enter" || l.key === "Escape") && ae(null);
5123
+ (l.key === "Enter" || l.key === "Escape") && re(null);
5121
5124
  },
5122
- onBlur: () => ae(null),
5125
+ onBlur: () => re(null),
5123
5126
  className: "h-5 w-full min-w-0 flex-1 rounded border border-slate-200 bg-slate-50 px-1 text-[11.5px] outline-none focus:border-nvr-cyan/50 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-100"
5124
5127
  }
5125
5128
  ) : /* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: Je(e) }),
@@ -5127,7 +5130,7 @@ function x0({
5127
5130
  "button",
5128
5131
  {
5129
5132
  type: "button",
5130
- onClick: () => ae(e),
5133
+ onClick: () => re(e),
5131
5134
  title: "Rename column",
5132
5135
  "aria-label": `Rename ${e}`,
5133
5136
  className: "text-slate-300 opacity-0 hover:text-slate-500 group-hover:opacity-100",
@@ -5174,7 +5177,7 @@ function x0({
5174
5177
  }
5175
5178
  ),
5176
5179
  Nn === 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: [
5177
- /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: cu.map((l) => {
5180
+ /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: pu.map((l) => {
5178
5181
  const s = JSON.stringify(Ce[e] ?? null) === JSON.stringify(l.cfg);
5179
5182
  return /* @__PURE__ */ a(
5180
5183
  "button",
@@ -5325,7 +5328,7 @@ function x0({
5325
5328
  O && /* @__PURE__ */ c("div", { className: "mt-1 border-t border-slate-100 pt-1.5 dark:border-slate-800", children: [
5326
5329
  /* @__PURE__ */ a("p", { className: "px-1.5 pb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "+ Related column" }),
5327
5330
  /* @__PURE__ */ a(
5328
- qu,
5331
+ Lu,
5329
5332
  {
5330
5333
  collection: n,
5331
5334
  meta: O,
@@ -5339,7 +5342,7 @@ function x0({
5339
5342
  /* @__PURE__ */ c("div", { className: "mt-1 border-t border-slate-100 pt-1.5 dark:border-slate-800", children: [
5340
5343
  /* @__PURE__ */ a("p", { className: "px-1.5 pb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "+ Formula column" }),
5341
5344
  /* @__PURE__ */ a(
5342
- yc,
5345
+ _c,
5343
5346
  {
5344
5347
  fields: St.map((e) => e.field),
5345
5348
  onAdd: (e, t) => {
@@ -5666,7 +5669,7 @@ ${r}`).then(() => {
5666
5669
  )
5667
5670
  ] }),
5668
5671
  Ma && /* @__PURE__ */ a(
5669
- Bc,
5672
+ Qc,
5670
5673
  {
5671
5674
  collection: n,
5672
5675
  layoutSlug: Ma.slug,
@@ -5703,7 +5706,7 @@ ${r}`).then(() => {
5703
5706
  ] }),
5704
5707
  $t.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: [
5705
5708
  $t.map((e) => /* @__PURE__ */ a(
5706
- ku,
5709
+ wu,
5707
5710
  {
5708
5711
  def: e,
5709
5712
  allowedIds: Xr(e),
@@ -5839,7 +5842,7 @@ ${r}`).then(() => {
5839
5842
  }
5840
5843
  ),
5841
5844
  Et && /* @__PURE__ */ a(
5842
- Tc,
5845
+ Fc,
5843
5846
  {
5844
5847
  name: e.name,
5845
5848
  isDefault: !!e.is_default,
@@ -5914,8 +5917,8 @@ ${r}`).then(() => {
5914
5917
  )
5915
5918
  ] }),
5916
5919
  Ge != 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: [
5917
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: kd(Ge) === 503 ? yd(Ge) : Vt(Ge, "Failed to load records") }),
5918
- (Ge == null ? void 0 : Ge.status) === 403 && !$c(Ge) && /* @__PURE__ */ a(
5920
+ /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: yd(Ge) === 503 ? wd(Ge) : Vt(Ge, "Failed to load records") }),
5921
+ (Ge == null ? void 0 : Ge.status) === 403 && !Tc(Ge) && /* @__PURE__ */ a(
5919
5922
  "button",
5920
5923
  {
5921
5924
  type: "button",
@@ -5932,7 +5935,7 @@ ${r}`).then(() => {
5932
5935
  {
5933
5936
  type: "button",
5934
5937
  onClick: () => {
5935
- const t = qc(e, { filters: qe, sort: Z, colFilters: ze });
5938
+ const t = Lc(e, { filters: qe, sort: Z, colFilters: ze });
5936
5939
  Ye(t.filters), q(t.sort), It(t.colFilters), F(1);
5937
5940
  },
5938
5941
  title: `Remove the filter or sort on "${e}" — this list cannot filter on it`,
@@ -5957,7 +5960,7 @@ ${r}`).then(() => {
5957
5960
  )
5958
5961
  ] }),
5959
5962
  yt === "tree" && An ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-slate-700 dark:bg-slate-900", children: /* @__PURE__ */ a(
5960
- mc,
5963
+ bc,
5961
5964
  {
5962
5965
  collection: n,
5963
5966
  config: An,
@@ -5970,7 +5973,7 @@ ${r}`).then(() => {
5970
5973
  }
5971
5974
  ) }) }) : yt && (B != null && B.some((e) => e.key === yt)) ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", "data-cbv-extra-view": yt, children: (os = B.find((e) => e.key === yt)) == null ? void 0 : os.render() }) : null,
5972
5975
  ra && bn ? /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-4 pt-3", children: /* @__PURE__ */ a(
5973
- Yc,
5976
+ Gc,
5974
5977
  {
5975
5978
  collection: n,
5976
5979
  latField: bn.latField,
@@ -6007,7 +6010,7 @@ ${r}`).then(() => {
6007
6010
  /* @__PURE__ */ a(vr, { "aria-hidden": !0, className: "h-3.5 w-3.5 animate-spin text-[#00a5cc]" }),
6008
6011
  xl != null ? `${Ha.text ?? "Still working"} — ${xl}s` : "Loading…"
6009
6012
  ] }) }) }),
6010
- la && Ha.slow && /* @__PURE__ */ a("div", { className: "pointer-events-none absolute inset-x-0 top-12 z-[6] flex justify-center px-4", children: /* @__PURE__ */ a(ru, { reason: Ha, variant: "pill" }) }),
6013
+ la && Ha.slow && /* @__PURE__ */ a("div", { className: "pointer-events-none absolute inset-x-0 top-12 z-[6] flex justify-center px-4", children: /* @__PURE__ */ a(su, { reason: Ha, variant: "pill" }) }),
6011
6014
  /* @__PURE__ */ a(
6012
6015
  "div",
6013
6016
  {
@@ -6173,7 +6176,7 @@ ${r}`).then(() => {
6173
6176
  className: l,
6174
6177
  "data-aging-filter": !0,
6175
6178
  children: /* @__PURE__ */ a(
6176
- Ec,
6179
+ Pc,
6177
6180
  {
6178
6181
  layout: "cell",
6179
6182
  def: {
@@ -6270,7 +6273,7 @@ ${r}`).then(() => {
6270
6273
  // #3229 — one placeholder per real column, real row height (h-8, or the
6271
6274
  // table's comfortable h-11), real pins/widths: nothing moves on arrival.
6272
6275
  /* @__PURE__ */ a(
6273
- au,
6276
+ lu,
6274
6277
  {
6275
6278
  columns: Xo,
6276
6279
  rows: Math.min(Ve, 20),
@@ -6388,17 +6391,17 @@ ${r}`).then(() => {
6388
6391
  },
6389
6392
  `__group__${e.gkey}`
6390
6393
  );
6391
- const l = e.row, s = l.id, o = Zt.includes(s), f = (U = Fe == null ? void 0 : Fe.instances) == null ? void 0 : U[String(s)], g = wo[String(s)], x = rr == null ? void 0 : rr[String(s)], z = ko.get(String(s)) ?? null, K = No(n, s), Te = !o && g ? Od(g.color) : void 0, D = o ? "bg-[#e6fafe] dark:bg-[#0c2a33]" : Te ?? "bg-white group-hover:bg-[#f2fcff] dark:bg-slate-900 dark:group-hover:bg-[#0e2d3a]";
6394
+ const l = e.row, s = l.id, o = Zt.includes(s), f = (U = Fe == null ? void 0 : Fe.instances) == null ? void 0 : U[String(s)], g = wo[String(s)], x = rr == null ? void 0 : rr[String(s)], z = ko.get(String(s)) ?? null, K = No(n, s), Te = !o && g ? Ad(g.color) : void 0, D = o ? "bg-[#e6fafe] dark:bg-[#0c2a33]" : Te ?? "bg-white group-hover:bg-[#f2fcff] dark:bg-slate-900 dark:group-hover:bg-[#0e2d3a]";
6392
6395
  return /* @__PURE__ */ c(
6393
6396
  "tr",
6394
6397
  {
6395
6398
  ...ho({ collection: n, id: String(s) }),
6396
6399
  ...Wo(s),
6397
6400
  "data-row-key": String(s),
6398
- title: Tt.titleFor(String(s)) ?? (z && !z.is_mine ? bd(z) : void 0) ?? (g ? `At risk — ${g.rule}` : void 0) ?? (K ? Xc : void 0),
6401
+ title: Tt.titleFor(String(s)) ?? (z && !z.is_mine ? hd(z) : void 0) ?? (g ? `At risk — ${g.rule}` : void 0) ?? (K ? eu : void 0),
6399
6402
  "data-picker-excluded": K ? "" : void 0,
6400
6403
  style: r,
6401
- 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] ${o ? "bg-nvr-cyan/[0.08]" : Te ?? ""} ${K ? Gc : ""}`,
6404
+ 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] ${o ? "bg-nvr-cyan/[0.08]" : Te ?? ""} ${K ? Zc : ""}`,
6402
6405
  children: [
6403
6406
  Ct && /* @__PURE__ */ a(
6404
6407
  "td",
@@ -6407,27 +6410,27 @@ ${r}`).then(() => {
6407
6410
  onClick: (H) => H.stopPropagation(),
6408
6411
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-1", children: [
6409
6412
  z || Tt.isNew(String(s)) ? /* @__PURE__ */ a(
6410
- Uc,
6413
+ Vc,
6411
6414
  {
6412
6415
  lock: z,
6413
6416
  isNew: Tt.isNew(String(s)),
6414
6417
  dataAttr: "data-cbv-live-mark"
6415
6418
  }
6416
6419
  ) : vl[ys(n, String(s))] ? /* @__PURE__ */ a(
6417
- nu,
6420
+ ru,
6418
6421
  {
6419
6422
  viewers: vl[ys(n, String(s))],
6420
6423
  dataAttr: "data-cbv-presence"
6421
6424
  }
6422
6425
  ) : /* @__PURE__ */ a(Ls, { change: x, dataAttr: "data-cbv-unseen" }),
6423
- /* @__PURE__ */ a(sc, { rowId: s }),
6426
+ /* @__PURE__ */ a(ic, { rowId: s }),
6424
6427
  ft && /* @__PURE__ */ a(
6425
6428
  "input",
6426
6429
  {
6427
6430
  type: "checkbox",
6428
6431
  checked: o,
6429
6432
  onChange: () => Ho(s),
6430
- "aria-label": `Select ${Rd(O, l, s, n) || "this record"}`
6433
+ "aria-label": `Select ${Ed(O, l, s, n) || "this record"}`
6431
6434
  }
6432
6435
  )
6433
6436
  ] })
@@ -6503,9 +6506,9 @@ ${r}`).then(() => {
6503
6506
  "td",
6504
6507
  {
6505
6508
  style: Pe(p),
6506
- "data-tip": W != null && (P != null && P.entered_at) ? `In ${P.state_label ?? "this state"} since ${new Date(P.entered_at).toLocaleString()}` : void 0,
6509
+ "data-tip": W != null && (P != null && P.entered_at) ? `In ${P.state_label ?? "this state"} since ${Gd(P.entered_at)}` : void 0,
6507
6510
  className: `whitespace-nowrap px-3 py-1.5 text-[12px] tabular-nums text-slate-600 dark:text-slate-300 ${st(p, "z-[1]", D)}`,
6508
- children: W == null ? /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Yd(W)
6511
+ children: W == null ? /* @__PURE__ */ a("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Jd(W)
6509
6512
  },
6510
6513
  p
6511
6514
  );
@@ -6534,7 +6537,7 @@ ${r}`).then(() => {
6534
6537
  {
6535
6538
  style: Pe(p),
6536
6539
  className: `whitespace-nowrap px-3 py-1.5 ${st(p, "z-[1]", D)}`,
6537
- children: /* @__PURE__ */ a(mu, { summary: P })
6540
+ children: /* @__PURE__ */ a(bu, { summary: P })
6538
6541
  },
6539
6542
  p
6540
6543
  );
@@ -6547,11 +6550,11 @@ ${r}`).then(() => {
6547
6550
  className: `whitespace-nowrap px-3 py-1.5 ${st(p, "z-[1]", D)}`,
6548
6551
  onClick: (P) => P.stopPropagation(),
6549
6552
  children: /* @__PURE__ */ a(
6550
- Pc,
6553
+ Oc,
6551
6554
  {
6552
6555
  collection: n,
6553
6556
  itemId: String(s),
6554
- figures: Mc(
6557
+ figures: Ac(
6555
6558
  l[Le.shipped_field],
6556
6559
  l[Le.requested_field]
6557
6560
  ),
@@ -6567,7 +6570,7 @@ ${r}`).then(() => {
6567
6570
  {
6568
6571
  style: Pe(p),
6569
6572
  className: `whitespace-nowrap px-3 py-1.5 ${st(p, "z-[1]", D)}`,
6570
- children: /* @__PURE__ */ a(Kc, { rows: lr == null ? void 0 : lr[String(s)] })
6573
+ children: /* @__PURE__ */ a(Bc, { rows: lr == null ? void 0 : lr[String(s)] })
6571
6574
  },
6572
6575
  p
6573
6576
  );
@@ -6616,7 +6619,7 @@ ${r}`).then(() => {
6616
6619
  className: `w-20 whitespace-nowrap px-2 py-1 text-right ${st(p, "z-[1]", D)}`,
6617
6620
  onClick: (P) => P.stopPropagation(),
6618
6621
  children: /* @__PURE__ */ a(
6619
- hu,
6622
+ xu,
6620
6623
  {
6621
6624
  collection: n,
6622
6625
  id: s,
@@ -6654,8 +6657,8 @@ ${r}`).then(() => {
6654
6657
  p,
6655
6658
  !!z && !z.is_mine,
6656
6659
  Pt(p) ? ql(p) === "nivaro_users" ? (() => {
6657
- var re, S, j;
6658
- const P = p.includes(".") ? p : Qe[p], Ze = ((j = (S = (re = $e == null ? void 0 : $e.rows) == null ? void 0 : re[String(s)]) == null ? void 0 : S[P]) == null ? void 0 : j.ids) ?? [], W = gt(s, p) ?? "";
6660
+ var le, S, j;
6661
+ const P = p.includes(".") ? p : Qe[p], Ze = ((j = (S = (le = $e == null ? void 0 : $e.rows) == null ? void 0 : le[String(s)]) == null ? void 0 : S[P]) == null ? void 0 : j.ids) ?? [], W = gt(s, p) ?? "";
6659
6662
  if (Ze.length === 0 || !W || W === "—")
6660
6663
  return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300", children: "—" });
6661
6664
  if (Ze.length === 1)
@@ -6794,9 +6797,9 @@ ${r}`).then(() => {
6794
6797
  )
6795
6798
  }
6796
6799
  ),
6797
- /* @__PURE__ */ a(Oc, { scrollerRef: Kr }),
6800
+ /* @__PURE__ */ a(Ic, { scrollerRef: Kr }),
6798
6801
  /* @__PURE__ */ a(
6799
- tu,
6802
+ au,
6800
6803
  {
6801
6804
  collections: n ? [n] : [],
6802
6805
  selectedIds: qt,
@@ -6897,7 +6900,7 @@ ${r}`).then(() => {
6897
6900
  }
6898
6901
  ),
6899
6902
  at != null && at.length ? /* @__PURE__ */ a(
6900
- eu,
6903
+ nu,
6901
6904
  {
6902
6905
  collection: at[0].collection,
6903
6906
  itemId: at[0].itemId,
@@ -6909,7 +6912,7 @@ ${r}`).then(() => {
6909
6912
  }
6910
6913
  ) : null,
6911
6914
  qn && /* @__PURE__ */ a(
6912
- ou,
6915
+ du,
6913
6916
  {
6914
6917
  collection: n,
6915
6918
  item: qn,
@@ -6938,7 +6941,7 @@ ${r}`).then(() => {
6938
6941
  )
6939
6942
  ] }),
6940
6943
  Ct && ft && Zt.length > 0 && /* @__PURE__ */ a(
6941
- Lu,
6944
+ Ru,
6942
6945
  {
6943
6946
  collection: n,
6944
6947
  selectedIds: Zt,
@@ -6954,22 +6957,18 @@ ${r}`).then(() => {
6954
6957
  }
6955
6958
  );
6956
6959
  }
6957
- function Ru(n, d, h, i) {
6958
- const v = Fr(d, n, h);
6959
- if (v != null && v.one_collection) return /* @__PURE__ */ a(Rr, { relatedCollection: v.one_collection, id: i });
6960
- if (typeof i == "boolean") return i ? "Yes" : "No";
6961
- if (typeof i == "object") return JSON.stringify(i).slice(0, 80);
6962
- const _ = String(i);
6963
- return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(_) ? new Date(_).toLocaleString() : _.length > 160 ? `${_.slice(0, 160)}…` : _;
6960
+ function Du(n, i, h, d, v) {
6961
+ const _ = Fr(i, n, h);
6962
+ return _ != null && _.one_collection ? /* @__PURE__ */ a(Rr, { relatedCollection: _.one_collection, id: d }) : Oi(d, v);
6964
6963
  }
6965
6964
  export {
6966
- x0 as CollectionBrowserView,
6965
+ y0 as CollectionBrowserView,
6967
6966
  Ta as MultiPick,
6968
- hu as RowActionsMenu,
6967
+ xu as RowActionsMenu,
6969
6968
  Rs as TINT_TEXT,
6970
- Ru as compareCell,
6969
+ Du as compareCell,
6971
6970
  _a as invalidateCbvRowQueries,
6972
- bu as roleMayDelete,
6973
- fu as roleMayUpdate,
6971
+ gu as roleMayDelete,
6972
+ hu as roleMayUpdate,
6974
6973
  va as tintFor
6975
6974
  };