@nivaro/react 0.3.46 → 0.3.47

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 (57) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +248 -16
  4. package/dist/index.js +679 -659
  5. package/dist/shared/components/CollectionBrowserView.js +813 -826
  6. package/dist/shared/components/ErrorNotice.js +169 -0
  7. package/dist/shared/components/ErrorSurface.js +23 -17
  8. package/dist/shared/components/ListLoadError.js +8 -29
  9. package/dist/shared/components/LoadErrorNote.js +38 -21
  10. package/dist/shared/components/QueryErrorState.js +8 -11
  11. package/dist/shared/components/ReportView.js +1320 -1291
  12. package/dist/shared/components/chat/ChannelArchive.js +60 -60
  13. package/dist/shared/components/chat/ChannelExtras.js +74 -74
  14. package/dist/shared/components/chat/ChatPanel.js +368 -367
  15. package/dist/shared/components/command-center/PeekPanel.js +33 -32
  16. package/dist/shared/components/command-center/panels/BoardSettings.js +41 -40
  17. package/dist/shared/components/command-center/panels/PeoplePanel.js +32 -31
  18. package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
  19. package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
  20. package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
  21. package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
  22. package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
  23. package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
  24. package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
  25. package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
  26. package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
  27. package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
  28. package/dist/shared/components/import/ImportFromFileButton.js +61 -60
  29. package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
  30. package/dist/shared/components/imports/NewImportDialog.js +29 -28
  31. package/dist/shared/components/imports/RunDetailSheet.js +63 -63
  32. package/dist/shared/components/item-edit/FieldRow.js +329 -329
  33. package/dist/shared/components/item-edit/InlineTableField.js +898 -898
  34. package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
  35. package/dist/shared/components/item-edit/PlanGrid.js +220 -221
  36. package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
  37. package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
  38. package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
  39. package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
  40. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
  41. package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
  42. package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
  43. package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
  44. package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
  45. package/dist/shared/components/panels/SlaClock.js +35 -36
  46. package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
  47. package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
  48. package/dist/shared/components/profile/AgentsPanel.js +73 -72
  49. package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
  50. package/dist/shared/components/support/SupportRequestDialog.js +85 -81
  51. package/dist/shared/components/support/SupportView.js +94 -87
  52. package/dist/shared/lib/autofill-poll.js +21 -18
  53. package/dist/shared/lib/error-actions.js +85 -0
  54. package/dist/shared/lib/error-message.js +223 -82
  55. package/dist/shared/lib/error-toast.js +71 -13
  56. package/dist/shared/lib/safe-error.js +136 -38
  57. package/package.json +1 -1
@@ -1,33 +1,34 @@
1
1
  import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
- import { useQueryClient as Ve, useQueries as ft, useQuery as oe, useMutation as yt } from "@tanstack/react-query";
2
+ import { useQueryClient as Ve, useQueries as xt, useQuery as re, useMutation as yt } from "@tanstack/react-query";
3
3
  import { Info as bt, Loader2 as gt, Sparkles as vt, Lock as wt, SlidersHorizontal as kt, History as _t, BellRing as Nt, Bell as Ft, Sigma as Ct } from "lucide-react";
4
- import { memo as Lt, useState as we, useRef as R, useId as St, useEffect as ae, useCallback as Ke } from "react";
5
- import { toast as U } from "sonner";
4
+ import { memo as Lt, useState as ve, useRef as R, useId as St, useEffect as le, useCallback as Ke } from "react";
5
+ import { toast as oe } from "sonner";
6
6
  import { useParentDraft as Rt, useNivaroClient as ie } from "../../context.js";
7
- import { showsAiButton as $t, AUTOFILL_CHECK_KEY as qt, readAiFill as Tt } from "../../lib/ai-fill.js";
8
- import { get as H, del as At, post as ve } from "../../lib/commands.js";
9
- import { titleCase as ee, cn as D } from "../../lib/utils.js";
7
+ import { showsAiButton as $t, AUTOFILL_CHECK_KEY as qt, readAiFill as At } from "../../lib/ai-fill.js";
8
+ import { get as K, del as Tt, post as ge } from "../../lib/commands.js";
9
+ import { toastError as Et } from "../../lib/error-toast.js";
10
+ import { titleCase as Z, cn as j } from "../../lib/utils.js";
10
11
  import { GlossaryLabel as Ue } from "../ai/GlossaryText.js";
11
- import { useFieldSource as Et, FieldSourceInfo as Pt } from "../ConfigReadBack.js";
12
- import { Label as jt } from "../ui/label.js";
13
- import { TooltipProvider as te, Tooltip as ne, TooltipTrigger as re, TooltipContent as le } from "../ui/tooltip.js";
14
- import { useAddendumFields as Dt } from "./AddendumFieldContext.js";
15
- import { AutoIdPreviewField as Bt } from "./AutoIdPreviewField.js";
12
+ import { useFieldSource as Pt, FieldSourceInfo as jt } from "../ConfigReadBack.js";
13
+ import { Label as Dt } from "../ui/label.js";
14
+ import { TooltipProvider as I, Tooltip as ee, TooltipTrigger as te, TooltipContent as ne } from "../ui/tooltip.js";
15
+ import { useAddendumFields as Bt } from "./AddendumFieldContext.js";
16
+ import { AutoIdPreviewField as Ot } from "./AutoIdPreviewField.js";
16
17
  import { FOCUSABLE as He } from "./entry/entry-keys.js";
17
- import { useFieldAffordances as Ot, useFieldContextMenu as Mt, usePresenceSoftLock as Kt, LockReasonBadge as Ut, PresenceSoftLockStrip as Ht, RemoteChangeGhost as Wt } from "./FieldAffordances.js";
18
- import { FieldCommentButton as Vt } from "./FieldComments.js";
19
- import { FieldRenderer as zt } from "./FieldRenderer.js";
20
- import { FormHelpVideoButton as Gt } from "./FormHelpVideoButton.js";
21
- import { getCascadeFilters as Qt, SYSTEM_FIELDS as Yt, parseJson as Jt, buildCascadeFilter as Xt, CascadeEffectController as Zt } from "./helpers.js";
22
- import { isDerivedForRecord as It } from "./live-rollups.js";
23
- import { useM2MStaging as en } from "./M2MStagingContext.js";
24
- import { personalDefaultSlotFor as tn, PersonalDefaultSlot as nn } from "./PersonalDefaultControl.js";
25
- import { PersonalDefaultHint as rn } from "./PersonalDefaultPill.js";
26
- import { isDisplayFormulaRow as We, usePlacementTextContext as ln, placementFieldText as on, fieldCounterConfig as an, fieldIsRecommended as sn, RecommendedMarker as cn, RepeatLastButton as dn, DisplayFormulaValue as un, FieldCounter as mn } from "./placement-behaviour.js";
27
- import { keepIfEqual as pn, jsonEqual as hn } from "./render-stability.js";
18
+ import { useFieldAffordances as Mt, useFieldContextMenu as Kt, usePresenceSoftLock as Ut, LockReasonBadge as Ht, PresenceSoftLockStrip as Wt, RemoteChangeGhost as Vt } from "./FieldAffordances.js";
19
+ import { FieldCommentButton as zt } from "./FieldComments.js";
20
+ import { FieldRenderer as Gt } from "./FieldRenderer.js";
21
+ import { FormHelpVideoButton as Qt } from "./FormHelpVideoButton.js";
22
+ import { getCascadeFilters as Yt, SYSTEM_FIELDS as Jt, parseJson as Xt, buildCascadeFilter as Zt, CascadeEffectController as It } from "./helpers.js";
23
+ import { isDerivedForRecord as en } from "./live-rollups.js";
24
+ import { useM2MStaging as tn } from "./M2MStagingContext.js";
25
+ import { personalDefaultSlotFor as nn, PersonalDefaultSlot as rn } from "./PersonalDefaultControl.js";
26
+ import { PersonalDefaultHint as ln } from "./PersonalDefaultPill.js";
27
+ import { isDisplayFormulaRow as We, usePlacementTextContext as on, placementFieldText as an, fieldCounterConfig as sn, fieldIsRecommended as cn, RecommendedMarker as dn, RepeatLastButton as un, DisplayFormulaValue as mn, FieldCounter as pn } from "./placement-behaviour.js";
28
+ import { keepIfEqual as hn, jsonEqual as fn } from "./render-stability.js";
28
29
  import { usePersonalDefaultsApi as xn } from "./usePersonalDefaults.js";
29
- import { resolveOptionFilterTokens as fn } from "../../lib/option-filter-tokens.js";
30
- const yn = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger", "number"]), bn = /* @__PURE__ */ new Set(["string", "text", "richtext", "textarea", "markdown", "json", "csv"]), gn = /* @__PURE__ */ new Set([
30
+ import { resolveOptionFilterTokens as yn } from "../../lib/option-filter-tokens.js";
31
+ const bn = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger", "number"]), gn = /* @__PURE__ */ new Set(["string", "text", "richtext", "textarea", "markdown", "json", "csv"]), vn = /* @__PURE__ */ new Set([
31
32
  "input",
32
33
  "textarea",
33
34
  "wysiwyg",
@@ -35,7 +36,7 @@ const yn = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
35
36
  "input-rich-text-html",
36
37
  "rich_text",
37
38
  "extension-editorjs"
38
- ]), vn = /* @__PURE__ */ new Set([
39
+ ]), wn = /* @__PURE__ */ new Set([
39
40
  "relation-m2o",
40
41
  "relation-m2m",
41
42
  "select-multiple-m2m",
@@ -46,66 +47,66 @@ const yn = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
46
47
  "file",
47
48
  "files",
48
49
  "image"
49
- ]), wn = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
50
- function kn(c) {
50
+ ]), kn = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
51
+ function _n(c) {
51
52
  const e = c.interface ?? "";
52
- return vn.has(e) || e.startsWith("relation-") || e.endsWith("-m2o") || e.endsWith("-m2m") ? !1 : !!(bn.has(c.type ?? "") || gn.has(e) || !e && c.type && !yn.has(c.type));
53
+ return wn.has(e) || e.startsWith("relation-") || e.endsWith("-m2o") || e.endsWith("-m2m") ? !1 : !!(gn.has(c.type ?? "") || vn.has(e) || !e && c.type && !bn.has(c.type));
53
54
  }
54
- function _n(c, e, m, p) {
55
- const f = ie();
56
- return oe({
55
+ function Nn(c, e, m, p) {
56
+ const x = ie();
57
+ return re({
57
58
  queryKey: ["field-lineage", c, e, m],
58
- queryFn: () => f.request(
59
- H(`/lineage/${c}/${encodeURIComponent(e)}/${m}`)
60
- ).then((i) => i.data),
59
+ queryFn: () => x.request(
60
+ K(`/lineage/${c}/${encodeURIComponent(e)}/${m}`)
61
+ ).then((a) => a.data),
61
62
  enabled: p,
62
63
  staleTime: 3e4
63
64
  });
64
65
  }
65
- function rr(c, e = "rows") {
66
- var l, N, b;
66
+ function or(c, e = "rows") {
67
+ var l, _, b;
67
68
  if (c && (c.kind === "write" || c.kind === "read") && c.formula) {
68
69
  const u = (y) => typeof y == "number" ? y.toLocaleString(void 0, { maximumFractionDigits: 2 }) : y == null || y === "" ? "∅" : String(y);
69
70
  return `= ${c.formula.replace(/item\.([A-Za-z_][A-Za-z0-9_]*)/g, (y, o) => {
70
- var x;
71
- return u((x = c.inputs) == null ? void 0 : x[o]);
71
+ var f;
72
+ return u((f = c.inputs) == null ? void 0 : f[o]);
72
73
  }).replace(/\s*-\s*/g, " − ").replace(/\s*\*\s*/g, " × ").replace(/\s*\/\s*/g, " ÷ ")}`;
73
74
  }
74
75
  if (!c || c.kind !== "rollup") return null;
75
- const m = (c.sources ?? []).reduce((u, a) => u + a.rows.length, 0), p = (c.sources ?? []).reduce((u, a) => {
76
+ const m = (c.sources ?? []).reduce((u, i) => u + i.rows.length, 0), p = (c.sources ?? []).reduce((u, i) => {
76
77
  var y;
77
- return u + (((y = a.excluded) == null ? void 0 : y.length) ?? 0);
78
- }, 0), f = (b = (N = (l = (c.sources ?? []).find((u) => {
79
- var a;
80
- return (a = u.excluded) == null ? void 0 : a.length;
81
- })) == null ? void 0 : l.excluded) == null ? void 0 : N[0]) == null ? void 0 : b.reason, i = [`= ${m} ${m === 1 ? e.replace(/s$/, "") : e}`];
82
- return p && i.push(
83
- `${p} excluded${f ? ` (${f.replace(/^does not match: /, "")})` : ""}`
84
- ), i.join(" · ");
78
+ return u + (((y = i.excluded) == null ? void 0 : y.length) ?? 0);
79
+ }, 0), x = (b = (_ = (l = (c.sources ?? []).find((u) => {
80
+ var i;
81
+ return (i = u.excluded) == null ? void 0 : i.length;
82
+ })) == null ? void 0 : l.excluded) == null ? void 0 : _[0]) == null ? void 0 : b.reason, a = [`= ${m} ${m === 1 ? e.replace(/s$/, "") : e}`];
83
+ return p && a.push(
84
+ `${p} excluded${x ? ` (${x.replace(/^does not match: /, "")})` : ""}`
85
+ ), a.join(" · ");
85
86
  }
86
- function Nn({
87
+ function Fn({
87
88
  collection: c,
88
89
  itemId: e,
89
90
  field: m
90
91
  }) {
91
- const [p, f] = we(!1), i = R(null), { data: l, isLoading: N } = _n(c, e, m, p);
92
- ae(() => {
92
+ const [p, x] = ve(!1), a = R(null), { data: l, isLoading: _ } = Nn(c, e, m, p);
93
+ le(() => {
93
94
  if (!p) return;
94
- const a = (y) => {
95
+ const i = (y) => {
95
96
  var o;
96
- (o = i.current) != null && o.contains(y.target) || f(!1);
97
+ (o = a.current) != null && o.contains(y.target) || x(!1);
97
98
  };
98
- return window.addEventListener("mousedown", a), () => window.removeEventListener("mousedown", a);
99
+ return window.addEventListener("mousedown", i), () => window.removeEventListener("mousedown", i);
99
100
  }, [p]);
100
- const b = (a) => a == null ? "—" : Number(a).toLocaleString(void 0, { maximumFractionDigits: 2 }), u = (l == null ? void 0 : l.stored_value) != null ? Number(l.stored_value) : null;
101
- return /* @__PURE__ */ d("div", { ref: i, className: "relative inline-flex", children: [
101
+ const b = (i) => i == null ? "—" : Number(i).toLocaleString(void 0, { maximumFractionDigits: 2 }), u = (l == null ? void 0 : l.stored_value) != null ? Number(l.stored_value) : null;
102
+ return /* @__PURE__ */ d("div", { ref: a, className: "relative inline-flex", children: [
102
103
  /* @__PURE__ */ n(
103
104
  "button",
104
105
  {
105
106
  type: "button",
106
- onClick: () => f((a) => !a),
107
+ onClick: () => x((i) => !i),
107
108
  title: "Where does this number come from?",
108
- className: D(
109
+ className: j(
109
110
  "inline-flex items-center rounded p-0.5 transition-opacity",
110
111
  p ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
111
112
  ),
@@ -115,76 +116,76 @@ function Nn({
115
116
  ),
116
117
  p && /* @__PURE__ */ d("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-[340px] w-[360px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
117
118
  /* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Where this number comes from" }),
118
- N && /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }),
119
+ _ && /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }),
119
120
  (l == null ? void 0 : l.kind) === "write" && /* @__PURE__ */ d("div", { className: "space-y-1 px-1 py-1", children: [
120
121
  /* @__PURE__ */ n("p", { className: "font-mono text-[11px] text-slate-600 dark:text-slate-300", children: l.formula }),
121
- Object.entries(l.inputs ?? {}).map(([a, y]) => /* @__PURE__ */ d("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
122
- /* @__PURE__ */ n("span", { className: "font-mono", children: a }),
122
+ Object.entries(l.inputs ?? {}).map(([i, y]) => /* @__PURE__ */ d("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
123
+ /* @__PURE__ */ n("span", { className: "font-mono", children: i }),
123
124
  " = ",
124
125
  b(y)
125
- ] }, a)),
126
+ ] }, i)),
126
127
  /* @__PURE__ */ d("p", { className: "pt-1 text-[11.5px] font-medium text-slate-700 dark:text-slate-200", children: [
127
128
  "= ",
128
129
  b(l.stored_value)
129
130
  ] })
130
131
  ] }),
131
- (l == null ? void 0 : l.kind) === "rollup" && (l.sources ?? []).map((a, y) => {
132
+ (l == null ? void 0 : l.kind) === "rollup" && (l.sources ?? []).map((i, y) => {
132
133
  var o;
133
134
  return /* @__PURE__ */ d("div", { className: "mb-1.5", children: [
134
135
  /* @__PURE__ */ d("p", { className: "px-1 text-[10.5px] text-slate-400", children: [
135
- (a.aggregate ?? "sum").toUpperCase(),
136
- a.value_field ? ` of ${a.value_field}` : "",
136
+ (i.aggregate ?? "sum").toUpperCase(),
137
+ i.value_field ? ` of ${i.value_field}` : "",
137
138
  " across ",
138
- a.collection,
139
- a.filtered ? " (filtered)" : ""
139
+ i.collection,
140
+ i.filtered ? " (filtered)" : ""
140
141
  ] }),
141
- a.error && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-amber-600 dark:text-amber-400", children: a.error }),
142
- a.note && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-slate-400", children: a.note }),
143
- a.rows.length > 0 && /* @__PURE__ */ n("div", { className: "mt-0.5 space-y-px", children: a.rows.map((x) => /* @__PURE__ */ d(
142
+ i.error && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-amber-600 dark:text-amber-400", children: i.error }),
143
+ i.note && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-slate-400", children: i.note }),
144
+ i.rows.length > 0 && /* @__PURE__ */ n("div", { className: "mt-0.5 space-y-px", children: i.rows.map((f) => /* @__PURE__ */ d(
144
145
  "div",
145
146
  {
146
147
  className: "flex items-baseline gap-2 rounded px-1 py-0.5 text-[11.5px] hover:bg-slate-50 dark:hover:bg-muted",
147
148
  children: [
148
- /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-slate-600 dark:text-slate-300", children: x.label }),
149
- /* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums text-slate-800 dark:text-slate-100", children: b(x.value) }),
149
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-slate-600 dark:text-slate-300", children: f.label }),
150
+ /* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums text-slate-800 dark:text-slate-100", children: b(f.value) }),
150
151
  /* @__PURE__ */ n(
151
152
  "span",
152
153
  {
153
154
  className: "w-[88px] shrink-0 truncate text-right text-[10px] text-slate-400",
154
- "data-tip": x.updated_at ? `${x.updated_by ?? "unknown"} · ${new Date(x.updated_at).toLocaleString()}` : void 0,
155
- children: x.updated_by ?? ""
155
+ "data-tip": f.updated_at ? `${f.updated_by ?? "unknown"} · ${new Date(f.updated_at).toLocaleString()}` : void 0,
156
+ children: f.updated_by ?? ""
156
157
  }
157
158
  )
158
159
  ]
159
160
  },
160
- x.id
161
+ f.id
161
162
  )) }),
162
- a.truncated && /* @__PURE__ */ n("p", { className: "px-1 pt-0.5 text-[10.5px] text-amber-600 dark:text-amber-400", children: "Showing the first 200 rows — the subtotal covers only these." }),
163
- a.subtotal != null && /* @__PURE__ */ d("p", { className: "border-t border-slate-100 px-1 pt-1 text-right text-[11.5px] font-medium text-slate-700 dark:border-border dark:text-slate-200", children: [
163
+ i.truncated && /* @__PURE__ */ n("p", { className: "px-1 pt-0.5 text-[10.5px] text-amber-600 dark:text-amber-400", children: "Showing the first 200 rows — the subtotal covers only these." }),
164
+ i.subtotal != null && /* @__PURE__ */ d("p", { className: "border-t border-slate-100 px-1 pt-1 text-right text-[11.5px] font-medium text-slate-700 dark:border-border dark:text-slate-200", children: [
164
165
  "subtotal ",
165
- b(a.subtotal)
166
+ b(i.subtotal)
166
167
  ] }),
167
- (((o = a.excluded) == null ? void 0 : o.length) ?? 0) > 0 && /* @__PURE__ */ d("div", { className: "mt-1 rounded bg-slate-50 px-1 py-1 dark:bg-muted/40", children: [
168
+ (((o = i.excluded) == null ? void 0 : o.length) ?? 0) > 0 && /* @__PURE__ */ d("div", { className: "mt-1 rounded bg-slate-50 px-1 py-1 dark:bg-muted/40", children: [
168
169
  /* @__PURE__ */ d("p", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: [
169
- a.excluded.length,
170
+ i.excluded.length,
170
171
  " excluded —",
171
172
  " ",
172
- a.excluded[0].reason.replace(/^does not match: /, "")
173
+ i.excluded[0].reason.replace(/^does not match: /, "")
173
174
  ] }),
174
- a.excluded.slice(0, 8).map((x) => /* @__PURE__ */ d(
175
+ i.excluded.slice(0, 8).map((f) => /* @__PURE__ */ d(
175
176
  "div",
176
177
  {
177
178
  className: "flex items-baseline gap-2 px-0.5 text-[11px] text-slate-400",
178
179
  children: [
179
- /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate line-through decoration-slate-300", children: x.label }),
180
- /* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums", children: b(x.value) })
180
+ /* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate line-through decoration-slate-300", children: f.label }),
181
+ /* @__PURE__ */ n("span", { className: "shrink-0 font-mono tabular-nums", children: b(f.value) })
181
182
  ]
182
183
  },
183
- x.id
184
+ f.id
184
185
  )),
185
- a.excluded.length > 8 && /* @__PURE__ */ d("p", { className: "px-0.5 text-[10.5px] text-slate-400", children: [
186
+ i.excluded.length > 8 && /* @__PURE__ */ d("p", { className: "px-0.5 text-[10.5px] text-slate-400", children: [
186
187
  "+",
187
- a.excluded.length - 8,
188
+ i.excluded.length - 8,
188
189
  " more"
189
190
  ] })
190
191
  ] })
@@ -194,43 +195,43 @@ function Nn({
194
195
  "stored ",
195
196
  b(u),
196
197
  (() => {
197
- const a = (l.sources ?? []).reduce((o, x) => o + (x.subtotal ?? 0), 0);
198
- return (l.sources ?? []).some((o) => o.truncated) ? null : Math.abs(a - u) < 0.01 ? /* @__PURE__ */ n("span", { className: "ml-1 text-emerald-600 dark:text-emerald-400", children: "✓ matches" }) : /* @__PURE__ */ n("span", { className: "ml-1 text-amber-600 dark:text-amber-400", children: "✕ differs from contributions" });
198
+ const i = (l.sources ?? []).reduce((o, f) => o + (f.subtotal ?? 0), 0);
199
+ return (l.sources ?? []).some((o) => o.truncated) ? null : Math.abs(i - u) < 0.01 ? /* @__PURE__ */ n("span", { className: "ml-1 text-emerald-600 dark:text-emerald-400", children: "✓ matches" }) : /* @__PURE__ */ n("span", { className: "ml-1 text-amber-600 dark:text-amber-400", children: "✕ differs from contributions" });
199
200
  })()
200
201
  ] })
201
202
  ] })
202
203
  ] });
203
204
  }
204
- function Fn({
205
+ function Cn({
205
206
  collection: c,
206
207
  itemId: e,
207
208
  field: m,
208
209
  formatValue: p,
209
- onRestore: f
210
+ onRestore: x
210
211
  }) {
211
- const i = ie(), [l, N] = we(!1), b = R(null), { data: u, isLoading: a } = oe({
212
+ const a = ie(), [l, _] = ve(!1), b = R(null), { data: u, isLoading: i } = re({
212
213
  queryKey: ["field-value-history", c, e, m],
213
- queryFn: () => i.request(H(`/field-history/${c}/${encodeURIComponent(e)}/${m}`)).then((o) => o.data ?? []),
214
+ queryFn: () => a.request(K(`/field-history/${c}/${encodeURIComponent(e)}/${m}`)).then((o) => o.data ?? []),
214
215
  enabled: l,
215
216
  staleTime: 6e4
216
217
  });
217
- ae(() => {
218
+ le(() => {
218
219
  if (!l) return;
219
- const o = (x) => {
220
- var W;
221
- (W = b.current) != null && W.contains(x.target) || N(!1);
220
+ const o = (f) => {
221
+ var U;
222
+ (U = b.current) != null && U.contains(f.target) || _(!1);
222
223
  };
223
224
  return window.addEventListener("mousedown", o), () => window.removeEventListener("mousedown", o);
224
225
  }, [l]);
225
- const y = (o, x) => x || (o == null || o === "" ? "—" : p ? p(o) : typeof o == "boolean" || o === "true" || o === "false" ? o === !0 || o === "true" ? "Yes" : "No" : typeof o == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(o) ? new Date(o).toLocaleString() : typeof o == "object" ? JSON.stringify(o).slice(0, 60) : String(o).slice(0, 80));
226
+ const y = (o, f) => f || (o == null || o === "" ? "—" : p ? p(o) : typeof o == "boolean" || o === "true" || o === "false" ? o === !0 || o === "true" ? "Yes" : "No" : typeof o == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(o) ? new Date(o).toLocaleString() : typeof o == "object" ? JSON.stringify(o).slice(0, 60) : String(o).slice(0, 80));
226
227
  return /* @__PURE__ */ d("div", { ref: b, className: "relative inline-flex", children: [
227
228
  /* @__PURE__ */ n(
228
229
  "button",
229
230
  {
230
231
  type: "button",
231
- onClick: () => N((o) => !o),
232
+ onClick: () => _((o) => !o),
232
233
  title: "Value history",
233
- className: D(
234
+ className: j(
234
235
  "inline-flex items-center rounded p-0.5 transition-opacity",
235
236
  l ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
236
237
  ),
@@ -240,19 +241,19 @@ function Fn({
240
241
  ),
241
242
  l && /* @__PURE__ */ d("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-64 w-[300px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
242
243
  /* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Value history" }),
243
- a ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }) : (u ?? []).length === 0 ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "No recorded changes for this field." }) : /* @__PURE__ */ n("div", { className: "space-y-1", children: (u ?? []).map((o, x) => /* @__PURE__ */ d(
244
+ i ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }) : (u ?? []).length === 0 ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "No recorded changes for this field." }) : /* @__PURE__ */ n("div", { className: "space-y-1", children: (u ?? []).map((o, f) => /* @__PURE__ */ d(
244
245
  "div",
245
246
  {
246
247
  className: "rounded px-1 py-1 text-[11.5px] leading-snug hover:bg-slate-50 dark:hover:bg-muted",
247
248
  children: [
248
249
  /* @__PURE__ */ d("span", { className: "flex items-baseline justify-between gap-2", children: [
249
250
  /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: y(o.value, o.display) }),
250
- f && x > 0 && /* @__PURE__ */ n(
251
+ x && f > 0 && /* @__PURE__ */ n(
251
252
  "button",
252
253
  {
253
254
  type: "button",
254
255
  onClick: () => {
255
- f(o.value ?? null), N(!1);
256
+ x(o.value ?? null), _(!1);
256
257
  },
257
258
  className: "shrink-0 rounded border border-slate-200 px-1.5 py-px text-[10px] text-slate-500 hover:border-nvr-cyan/60 hover:text-nvr-navy dark:border-border dark:hover:text-nvr-cyan",
258
259
  children: "Restore"
@@ -278,39 +279,39 @@ function Fn({
278
279
  ] })
279
280
  ]
280
281
  },
281
- x
282
+ f
282
283
  )) })
283
284
  ] })
284
285
  ] });
285
286
  }
286
- function Cn({
287
+ function Ln({
287
288
  collection: c,
288
289
  itemId: e,
289
290
  field: m
290
291
  }) {
291
- const p = ie(), f = Ve(), { data: i } = oe({
292
+ const p = ie(), x = Ve(), { data: a } = re({
292
293
  queryKey: ["field-watch-config"],
293
- queryFn: () => p.request(H("/field-watches/config")).then((a) => a.data).catch(() => ({ enabled: !1 })),
294
+ queryFn: () => p.request(K("/field-watches/config")).then((i) => i.data).catch(() => ({ enabled: !1 })),
294
295
  staleTime: 5 * 6e4
295
- }), l = ["field-watch-self", c, e], { data: N = [] } = oe({
296
+ }), l = ["field-watch-self", c, e], { data: _ = [] } = re({
296
297
  queryKey: l,
297
- queryFn: () => p.request(H("/field-watches/self", { collection: c, item_id: e })).then((a) => a.data ?? []).catch(() => []),
298
- enabled: !!(i != null && i.enabled),
298
+ queryFn: () => p.request(K("/field-watches/self", { collection: c, item_id: e })).then((i) => i.data ?? []).catch(() => []),
299
+ enabled: !!(a != null && a.enabled),
299
300
  staleTime: 6e4
300
- }), b = N.includes(m), u = yt({
301
+ }), b = _.includes(m), u = yt({
301
302
  mutationFn: () => b ? p.request(
302
- At(
303
+ Tt(
303
304
  `/field-watches/self?collection=${encodeURIComponent(c)}&field=${encodeURIComponent(m)}&item_id=${encodeURIComponent(e)}`
304
305
  )
305
- ) : p.request(ve("/field-watches/self", { collection: c, field: m, item_id: e })),
306
+ ) : p.request(ge("/field-watches/self", { collection: c, field: m, item_id: e })),
306
307
  onSuccess: () => {
307
- f.invalidateQueries({ queryKey: l }), U.success(
308
+ x.invalidateQueries({ queryKey: l }), oe.success(
308
309
  b ? "No longer watching this field" : "Watching — you will be notified when it changes"
309
310
  );
310
311
  },
311
- onError: () => U.error("Could not update the watch")
312
+ onError: () => oe.error("Could not update the watch")
312
313
  });
313
- return i != null && i.enabled ? /* @__PURE__ */ n(
314
+ return a != null && a.enabled ? /* @__PURE__ */ n(
314
315
  "button",
315
316
  {
316
317
  type: "button",
@@ -322,84 +323,84 @@ function Cn({
322
323
  }
323
324
  ) : null;
324
325
  }
325
- function Ln(c) {
326
+ function Sn(c) {
326
327
  return c ? c.querySelector(
327
328
  'input:not([type=hidden]), textarea, [role="combobox"], [contenteditable="true"]'
328
329
  ) ?? c.querySelector("button") : null;
329
330
  }
330
- const lr = Lt(function({
331
+ const ir = Lt(function({
331
332
  field: e,
332
333
  draft: m,
333
334
  onChange: p,
334
- relations: f,
335
- collection: i,
335
+ relations: x,
336
+ collection: a,
336
337
  itemId: l,
337
- error: N,
338
+ error: _,
338
339
  visible: b,
339
340
  locked: u,
340
- layoutAiEnabled: a,
341
+ layoutAiEnabled: i,
341
342
  renderField: y,
342
343
  onCountChange: o,
343
- swapButton: x,
344
- swapContent: W,
344
+ swapButton: f,
345
+ swapContent: U,
345
346
  forceVisible: ze,
346
- autoFillTick: se
347
+ autoFillTick: ae
347
348
  }) {
348
- var Be, Oe, Me;
349
- const V = wn.has(e.interface ?? ""), C = Rt(), g = en(), ke = Ve(), ce = ie(), [_e, z] = we(!1), s = Ot(), Ne = Et(e.field), G = R(null), Q = St(), de = R(null), Fe = R(!1);
350
- ae(() => {
351
- const t = Fe.current ? Ln(de.current) : null;
349
+ var De, Be, Oe;
350
+ const H = kn.has(e.interface ?? ""), F = Rt(), g = tn(), we = Ve(), se = ie(), [ke, W] = ve(!1), s = Mt(), _e = Pt(e.field), V = R(null), z = St(), ce = R(null), Ne = R(!1);
351
+ le(() => {
352
+ const t = Ne.current ? Sn(ce.current) : null;
352
353
  if (!t || t.hasAttribute("aria-label")) return;
353
- t.id || (t.id = `${Q}-control`);
354
- const r = t.tagName === "BUTTON" ? `${Q} ${t.id}` : Q;
354
+ t.id || (t.id = `${z}-control`);
355
+ const r = t.tagName === "BUTTON" ? `${z} ${t.id}` : z;
355
356
  t.getAttribute("aria-labelledby") !== r && t.setAttribute("aria-labelledby", r);
356
357
  });
357
- const Ce = u && !V, Le = R(null);
358
- ae(() => {
359
- const t = Le.current;
358
+ const Fe = u && !H, Ce = R(null);
359
+ le(() => {
360
+ const t = Ce.current;
360
361
  if (!t) return;
361
- if (!Ce) {
362
+ if (!Fe) {
362
363
  t.removeAttribute("inert");
363
364
  return;
364
365
  }
365
366
  const r = typeof document < "u" ? document.activeElement : null;
366
367
  r instanceof HTMLElement && t.contains(r) && r.blur(), t.setAttribute("inert", "");
367
- }, [Ce, se]);
368
- const Y = e.field, Se = Ke(
368
+ }, [Fe, ae]);
369
+ const G = e.field, Le = Ke(
369
370
  (t) => {
370
- u || p(Y, t);
371
+ u || p(G, t);
371
372
  },
372
- [u, p, Y]
373
+ [u, p, G]
373
374
  ), Ge = Ke(
374
- (t) => o == null ? void 0 : o(Y, t),
375
- [o, Y]
376
- ), Qe = R(void 0), Re = R(void 0), $e = R(void 0), qe = !u && !e.readonly && !e.computed_formula && !(e.hidden && !e.layout_assigned) && !We(e), {
375
+ (t) => o == null ? void 0 : o(G, t),
376
+ [o, G]
377
+ ), Qe = R(void 0), Se = R(void 0), Re = R(void 0), $e = !u && !e.readonly && !e.computed_formula && !(e.hidden && !e.layout_assigned) && !We(e), {
377
378
  onContextMenu: Ye,
378
379
  onKeyDown: Je,
379
380
  menu: Xe,
380
381
  confirmSaveFrom: Ze,
381
- openedBy: ue
382
- } = Mt({
383
- wrapperRef: G,
382
+ openedBy: de
383
+ } = Kt({
384
+ wrapperRef: V,
384
385
  field: e,
385
386
  value: m[e.field],
386
- relations: f,
387
- collection: i,
387
+ relations: x,
388
+ collection: a,
388
389
  itemId: l,
389
390
  openRelated: s == null ? void 0 : s.openRelated,
390
- editable: qe
391
- }), E = Kt(G), Ie = ln(), Te = s == null ? void 0 : s.remoteChanges[e.field], B = s == null ? void 0 : s.lockReasons[e.field], q = s == null ? void 0 : s.applyToLines[e.field], L = xn(), et = (L == null ? void 0 : L.applied(e.field)) ?? !1, Ae = (L == null ? void 0 : L.hintFor(e.field)) ?? null, me = tn(L, e.field, qe), pe = () => {
391
+ editable: $e
392
+ }), T = Ut(V), Ie = on(), qe = s == null ? void 0 : s.remoteChanges[e.field], D = s == null ? void 0 : s.lockReasons[e.field], q = s == null ? void 0 : s.applyToLines[e.field], C = xn(), et = (C == null ? void 0 : C.applied(e.field)) ?? !1, Ae = (C == null ? void 0 : C.hintFor(e.field)) ?? null, ue = nn(C, e.field, $e), me = () => {
392
393
  var t, r;
393
- return ((t = de.current) == null ? void 0 : t.querySelector(He)) ?? ((r = G.current) == null ? void 0 : r.querySelector(He));
394
- }, J = $t(e._overrides, a, kn(e)), he = !!(s != null && s.fromAutofill) && !!e._overrides && e._overrides[qt] === !0;
394
+ return ((t = ce.current) == null ? void 0 : t.querySelector(He)) ?? ((r = V.current) == null ? void 0 : r.querySelector(He));
395
+ }, Q = $t(e._overrides, i, _n(e)), pe = !!(s != null && s.fromAutofill) && !!e._overrides && e._overrides[qt] === !0;
395
396
  async function tt() {
396
397
  var t;
397
- if (J.perField) return nt();
398
- z(!0);
398
+ if (Q.perField) return nt();
399
+ W(!0);
399
400
  try {
400
- const r = await ce.request(
401
- ve("/ai/generate", {
402
- collection: i,
401
+ const r = await se.request(
402
+ ge("/ai/generate", {
403
+ collection: a,
403
404
  item_id: l !== "new" ? l : void 0,
404
405
  field: e.field
405
406
  })
@@ -407,47 +408,46 @@ const lr = Lt(function({
407
408
  ((t = r.data) == null ? void 0 : t.value) != null && p(e.field, r.data.value);
408
409
  } catch {
409
410
  } finally {
410
- z(!1);
411
+ W(!1);
411
412
  }
412
413
  }
413
414
  async function nt() {
414
- var r, h, k, j, A, F;
415
+ var r, h, w, P;
415
416
  const t = {};
416
- for (const v of ((r = Tt(e._overrides)) == null ? void 0 : r.tokens) ?? []) v in m && (t[v] = m[v]);
417
- z(!0);
417
+ for (const k of ((r = At(e._overrides)) == null ? void 0 : r.tokens) ?? []) k in m && (t[k] = m[k]);
418
+ W(!0);
418
419
  try {
419
- const v = await ce.request(
420
- ve("/ai/field-fill", {
421
- collection: i,
420
+ const k = await se.request(
421
+ ge("/ai/field-fill", {
422
+ collection: a,
422
423
  layout_id: (s == null ? void 0 : s.layoutId) ?? null,
423
424
  field: e.field,
424
425
  item_id: l && l !== "new" ? l : null,
425
426
  values: t
426
427
  })
427
- ), _ = (h = v.data) == null ? void 0 : h.value;
428
- typeof _ == "string" && _ !== "" ? p(e.field, _) : U.info("The AI had nothing to write here"), (j = (k = v.data) == null ? void 0 : k.missing) != null && j.length && U.info(`Filled without ${v.data.missing.join(", ")} (empty or not visible to you)`);
429
- } catch (v) {
430
- const _ = v;
431
- U.error(((F = (A = _ == null ? void 0 : _.response) == null ? void 0 : A.data) == null ? void 0 : F.error) ?? (_ == null ? void 0 : _.message) ?? "AI fill failed");
428
+ ), N = (h = k.data) == null ? void 0 : h.value;
429
+ typeof N == "string" && N !== "" ? p(e.field, N) : oe.info("The AI had nothing to write here"), (P = (w = k.data) == null ? void 0 : w.missing) != null && P.length && oe.info(`Filled without ${k.data.missing.join(", ")} (empty or not visible to you)`);
430
+ } catch (k) {
431
+ Et(k, "AI fill failed", { action: "Fill with AI" });
432
432
  } finally {
433
- z(!1);
433
+ W(!1);
434
434
  }
435
435
  }
436
- const P = Qt(e.dependency_config), Ee = P.flatMap((t) => {
437
- const r = f.find(
438
- (k) => k.one_collection === i && k.one_field === t.parent_field
436
+ const E = Yt(e.dependency_config), Te = E.flatMap((t) => {
437
+ const r = x.find(
438
+ (w) => w.one_collection === a && w.one_field === t.parent_field
439
439
  );
440
440
  if (!r) return [];
441
441
  if (r.junction_field) return [{ rule: t, rel: r }];
442
- const h = f.find(
443
- (k) => k.many_collection === r.many_collection && k.id !== r.id
442
+ const h = x.find(
443
+ (w) => w.many_collection === r.many_collection && w.id !== r.id
444
444
  );
445
445
  return h != null && h.many_field ? [{ rule: t, rel: { ...r, junction_field: h.many_field } }] : [];
446
- }), rt = ft({
447
- queries: Ee.map(({ rel: t }) => ({
446
+ }), rt = xt({
447
+ queries: Te.map(({ rel: t }) => ({
448
448
  queryKey: ["m2m-items", t.many_collection, t.many_field, l],
449
- queryFn: () => ce.request(
450
- H(`/items/${t.many_collection}`, {
449
+ queryFn: () => se.request(
450
+ K(`/items/${t.many_collection}`, {
451
451
  filter: JSON.stringify({ [t.many_field]: { _eq: l } }),
452
452
  limit: 200,
453
453
  fields: `id,${t.junction_field}`
@@ -457,41 +457,41 @@ const lr = Lt(function({
457
457
  staleTime: 3e4
458
458
  }))
459
459
  }), lt = Object.fromEntries(
460
- Ee.map(({ rule: t, rel: r }, h) => {
461
- var A;
462
- const k = r.one_field ?? `${r.many_collection}.${r.junction_field}`, j = (g == null ? void 0 : g.getStagedUnlinks(k)) ?? /* @__PURE__ */ new Set();
460
+ Te.map(({ rule: t, rel: r }, h) => {
461
+ var k;
462
+ const w = r.one_field ?? `${r.many_collection}.${r.junction_field}`, P = (g == null ? void 0 : g.getStagedUnlinks(w)) ?? /* @__PURE__ */ new Set();
463
463
  return [
464
464
  t.parent_field,
465
- (((A = rt[h]) == null ? void 0 : A.data) ?? []).filter((F) => !j.has(F.id)).map((F) => F[r.junction_field])
465
+ (((k = rt[h]) == null ? void 0 : k.data) ?? []).filter((N) => !P.has(N.id)).map((N) => N[r.junction_field])
466
466
  ];
467
467
  })
468
- ), X = Dt()[e.field] ?? [];
469
- if (!ze && (!b || !e.layout_assigned && (e.hidden || Yt.has(e.field))))
468
+ ), Y = Bt()[e.field] ?? [];
469
+ if (!ze && (!b || !e.layout_assigned && (e.hidden || Jt.has(e.field))))
470
470
  return null;
471
- const xe = m[e.field] ?? null, Z = on(e, Ie), S = Z.label ?? ee(e.field);
472
- Fe.current = S !== "";
473
- const T = We(e), Pe = T ? null : an(e), ot = !T && !u && !e.readonly && ((Be = e._overrides) == null ? void 0 : Be.repeat_last) === !0, at = It(e, m), it = (Me = (Oe = Jt(e.options)) == null ? void 0 : Oe.auto_id) == null ? void 0 : Me.pattern, w = (() => {
474
- const t = f.find(
475
- (h) => h.one_collection === i && h.one_field === e.field
471
+ const he = m[e.field] ?? null, J = an(e, Ie), L = J.label ?? Z(e.field);
472
+ Ne.current = L !== "";
473
+ const A = We(e), Ee = A ? null : sn(e), ot = !A && !u && !e.readonly && ((De = e._overrides) == null ? void 0 : De.repeat_last) === !0, it = en(e, m), at = (Oe = (Be = Xt(e.options)) == null ? void 0 : Be.auto_id) == null ? void 0 : Oe.pattern, v = (() => {
474
+ const t = x.find(
475
+ (h) => h.one_collection === a && h.one_field === e.field
476
476
  );
477
477
  if (!t) return null;
478
478
  if (t.junction_field) return t;
479
- const r = f.find(
479
+ const r = x.find(
480
480
  (h) => h.many_collection === t.many_collection && h.id !== t.id
481
481
  );
482
482
  return r ? { ...t, junction_field: r.many_field } : null;
483
- })(), fe = w ? null : f.find((t) => t.many_collection === i && t.many_field === e.field) ?? null, ye = w ? f.find(
484
- (t) => t.many_collection === w.many_collection && t.many_field === w.junction_field && t.id !== w.id
485
- ) ?? null : null, O = w ? w.one_field ?? `${w.many_collection}.${w.junction_field}` : null, je = O ? (g == null ? void 0 : g.getStagedLinks(O)) ?? [] : [], st = w ? (ke.getQueryData([
483
+ })(), fe = v ? null : x.find((t) => t.many_collection === a && t.many_field === e.field) ?? null, xe = v ? x.find(
484
+ (t) => t.many_collection === v.many_collection && t.many_field === v.junction_field && t.id !== v.id
485
+ ) ?? null : null, B = v ? v.one_field ?? `${v.many_collection}.${v.junction_field}` : null, Pe = B ? (g == null ? void 0 : g.getStagedLinks(B)) ?? [] : [], st = v ? (we.getQueryData([
486
486
  "m2m-items",
487
- w.many_collection,
488
- w.many_field,
487
+ v.many_collection,
488
+ v.many_field,
489
489
  l
490
- ]) ?? []).map((t) => t[w.junction_field]) : [], ct = w ? je[0] ?? st[0] ?? null : xe, dt = (ye == null ? void 0 : ye.one_collection) ?? (fe == null ? void 0 : fe.one_collection) ?? void 0, I = (t) => {
490
+ ]) ?? []).map((t) => t[v.junction_field]) : [], ct = v ? Pe[0] ?? st[0] ?? null : he, dt = (xe == null ? void 0 : xe.one_collection) ?? (fe == null ? void 0 : fe.one_collection) ?? void 0, X = (t) => {
491
491
  var r;
492
- return ((C == null ? void 0 : C.collection) === i ? (r = C == null ? void 0 : C.fieldLabels) == null ? void 0 : r[t] : void 0) ?? ee(String(t));
493
- }, $ = Xt({
494
- rules: P,
492
+ return ((F == null ? void 0 : F.collection) === a ? (r = F == null ? void 0 : F.fieldLabels) == null ? void 0 : r[t] : void 0) ?? Z(String(t));
493
+ }, $ = Zt({
494
+ rules: E,
495
495
  // A parent whose value THIS field's own pick derived must not narrow this
496
496
  // field's options — otherwise picking a region locks the region picker
497
497
  // into the zone the pick itself filled, and cross-zone changes read as
@@ -502,43 +502,43 @@ const lr = Lt(function({
502
502
  },
503
503
  parentValue: (t) => {
504
504
  if (m[t] != null) return m[t];
505
- const r = f.find((v) => v.one_collection === i && v.one_field === t);
505
+ const r = x.find((S) => S.one_collection === a && S.one_field === t);
506
506
  if (!r) return null;
507
507
  let h = r;
508
508
  if (!h.junction_field) {
509
- const v = f.find(
510
- (_) => _.many_collection === r.many_collection && _.id !== r.id
509
+ const S = x.find(
510
+ (Me) => Me.many_collection === r.many_collection && Me.id !== r.id
511
511
  );
512
- if (v != null && v.many_field) h = { ...r, junction_field: v.many_field };
512
+ if (S != null && S.many_field) h = { ...r, junction_field: S.many_field };
513
513
  else return null;
514
514
  }
515
- const k = h.one_field ?? `${h.many_collection}.${h.junction_field}`, j = (g == null ? void 0 : g.getStagedLinks(k)) ?? [], A = lt[t] ?? [], F = [...new Set([...j, ...A].map((v) => String(v)))];
516
- return F.length === 0 ? null : F.length === 1 ? F[0] : F;
515
+ const w = h.one_field ?? `${h.many_collection}.${h.junction_field}`, P = (g == null ? void 0 : g.getStagedLinks(w)) ?? [], k = lt[t] ?? [], N = [...new Set([...P, ...k].map((S) => String(S)))];
516
+ return N.length === 0 ? null : N.length === 1 ? N[0] : N;
517
517
  },
518
518
  parentOptionFilter: (t) => {
519
519
  var h;
520
- const r = (C == null ? void 0 : C.collection) === i ? (h = C.fieldOptionFilters) == null ? void 0 : h[t] : void 0;
521
- return r ? fn(r, m, l) : void 0;
520
+ const r = (F == null ? void 0 : F.collection) === a ? (h = F.fieldOptionFilters) == null ? void 0 : h[t] : void 0;
521
+ return r ? yn(r, m, l) : void 0;
522
522
  }
523
- }), M = $.filter ? pn(Qe, $.filter, hn) : $.filter, K = $.satisfiedParents.map(I), be = $.satisfiedParents, ut = $.unsatisfiedParents.length ? I($.unsatisfiedParents[0]) : null, ge = $.missingRequiredParents, De = ge.length ? I(ge[0]) : null;
523
+ }), O = $.filter ? hn(Qe, $.filter, fn) : $.filter, M = $.satisfiedParents.map(X), ye = $.satisfiedParents, ut = $.unsatisfiedParents.length ? X($.unsatisfiedParents[0]) : null, be = $.missingRequiredParents, je = be.length ? X(be[0]) : null;
524
524
  function mt() {
525
- const t = $e.current;
525
+ const t = Re.current;
526
526
  if (t && t.src === e) return t.value;
527
527
  const r = { ...e, readonly: !0 };
528
- return $e.current = { src: e, value: r }, r;
528
+ return Re.current = { src: e, value: r }, r;
529
529
  }
530
530
  function pt() {
531
- const t = JSON.stringify([K, be]), r = Re.current;
531
+ const t = JSON.stringify([M, ye]), r = Se.current;
532
532
  if (r && r.sig === t && r.onChange === p) return r.value;
533
533
  const h = {
534
- labels: K,
535
- keys: be,
536
- onClear: (k) => p(k, null)
534
+ labels: M,
535
+ keys: ye,
536
+ onClear: (w) => p(w, null)
537
537
  };
538
- return Re.current = { sig: t, onChange: p, value: h }, h;
538
+ return Se.current = { sig: t, onChange: p, value: h }, h;
539
539
  }
540
540
  function ht() {
541
- for (const t of be) {
541
+ for (const t of ye) {
542
542
  const r = document.querySelector(`[data-field="${t}"]`);
543
543
  r && (r.scrollIntoView({ behavior: "smooth", block: "center" }), r.style.transition = "box-shadow 0.15s ease", r.style.boxShadow = "0 0 0 2px rgb(var(--nvr-cyan-rgb, 0 206 255)), 0 0 0 5px rgb(var(--nvr-cyan-rgb, 0 206 255) / 0.25)", r.style.borderRadius = "12px", setTimeout(() => {
544
544
  r.style.boxShadow = "none", setTimeout(() => {
@@ -547,16 +547,16 @@ const lr = Lt(function({
547
547
  }, 900));
548
548
  }
549
549
  }
550
- const xt = () => {
551
- if (w && O) {
552
- for (const r of je) g == null || g.unstageLink(O, r);
553
- const t = ke.getQueryData([
550
+ const ft = () => {
551
+ if (v && B) {
552
+ for (const r of Pe) g == null || g.unstageLink(B, r);
553
+ const t = we.getQueryData([
554
554
  "m2m-items",
555
- w.many_collection,
556
- w.many_field,
555
+ v.many_collection,
556
+ v.many_field,
557
557
  l
558
558
  ]) ?? [];
559
- for (const r of t) g == null || g.stageUnlink(O, r.id);
559
+ for (const r of t) g == null || g.stageUnlink(B, r.id);
560
560
  } else
561
561
  p(e.field, null);
562
562
  };
@@ -565,85 +565,85 @@ const lr = Lt(function({
565
565
  /* @__PURE__ */ d(
566
566
  "div",
567
567
  {
568
- ref: G,
568
+ ref: V,
569
569
  "data-field": e.field,
570
- "data-field-collection": i,
570
+ "data-field-collection": a,
571
571
  "data-field-interface": e.interface ?? void 0,
572
- "data-autofill-check": he ? "" : void 0,
573
- className: D(
572
+ "data-autofill-check": pe ? "" : void 0,
573
+ className: j(
574
574
  "group/fieldrow space-y-1.5",
575
- he && "rounded-md bg-amber-50/60 p-1.5 ring-1 ring-amber-300 dark:bg-amber-500/10 dark:ring-amber-500/40"
575
+ pe && "rounded-md bg-amber-50/60 p-1.5 ring-1 ring-amber-300 dark:bg-amber-500/10 dark:ring-amber-500/40"
576
576
  ),
577
577
  onContextMenu: Ye,
578
578
  onKeyDown: Je,
579
- onFocusCapture: E.onFocusCapture,
579
+ onFocusCapture: T.onFocusCapture,
580
580
  children: [
581
581
  Xe,
582
- P.length > 0 && /* @__PURE__ */ n(
583
- Zt,
582
+ E.length > 0 && /* @__PURE__ */ n(
583
+ It,
584
584
  {
585
- cascadeRules: P,
586
- cascadeFilter: M,
585
+ cascadeRules: E,
586
+ cascadeFilter: O,
587
587
  currentValue: ct,
588
588
  relatedCollection: dt,
589
- missingRequiredParents: ge,
590
- onClear: xt
589
+ missingRequiredParents: be,
590
+ onClear: ft
591
591
  }
592
592
  ),
593
- (S !== "" || X.length > 0) && /* @__PURE__ */ d(
593
+ (L !== "" || Y.length > 0) && /* @__PURE__ */ d(
594
594
  "div",
595
595
  {
596
596
  className: "flex flex-wrap items-center gap-1.5 min-h-[1.5rem]",
597
- "data-pd-row": me ? "" : void 0,
597
+ "data-pd-row": ue ? "" : void 0,
598
598
  children: [
599
- S !== "" && /* @__PURE__ */ d(jt, { id: Q, "data-field-label": !0, className: "text-sm font-medium", children: [
600
- /* @__PURE__ */ n(Ue, { text: S, collection: i }),
599
+ L !== "" && /* @__PURE__ */ d(Dt, { id: z, "data-field-label": !0, className: "text-sm font-medium", children: [
600
+ /* @__PURE__ */ n(Ue, { text: L, collection: a }),
601
601
  e.required && /* @__PURE__ */ n("span", { className: "ml-0.5 text-destructive", children: "*" }),
602
- sn(e) && /* @__PURE__ */ n(cn, {})
602
+ cn(e) && /* @__PURE__ */ n(dn, {})
603
603
  ] }),
604
- Z.note && /* @__PURE__ */ n(te, { delayDuration: 100, children: /* @__PURE__ */ d(ne, { children: [
605
- /* @__PURE__ */ n(re, { asChild: !0, children: /* @__PURE__ */ n(bt, { className: "h-3.5 w-3.5 shrink-0 cursor-help text-slate-400 hover:text-slate-600" }) }),
606
- /* @__PURE__ */ n(le, { side: "top", className: "max-w-[240px] text-[12px]", children: (s == null ? void 0 : s.glossaryHelp) === !1 ? Z.note : /* @__PURE__ */ n(Ue, { text: Z.note, collection: i }) })
604
+ J.note && /* @__PURE__ */ n(I, { delayDuration: 100, children: /* @__PURE__ */ d(ee, { children: [
605
+ /* @__PURE__ */ n(te, { asChild: !0, children: /* @__PURE__ */ n(bt, { className: "h-3.5 w-3.5 shrink-0 cursor-help text-slate-400 hover:text-slate-600" }) }),
606
+ /* @__PURE__ */ n(ne, { side: "top", className: "max-w-[240px] text-[12px]", children: (s == null ? void 0 : s.glossaryHelp) === !1 ? J.note : /* @__PURE__ */ n(Ue, { text: J.note, collection: a }) })
607
607
  ] }) }),
608
- Ne && /* @__PURE__ */ n(Pt, { source: Ne, label: S }),
609
- !T && l && l !== "new" && /* @__PURE__ */ n(
610
- Fn,
608
+ _e && /* @__PURE__ */ n(jt, { source: _e, label: L }),
609
+ !A && l && l !== "new" && /* @__PURE__ */ n(
610
+ Cn,
611
611
  {
612
- collection: i,
612
+ collection: a,
613
613
  itemId: l,
614
614
  field: e.field,
615
615
  onRestore: e.readonly ? void 0 : (t) => p(e.field, t)
616
616
  }
617
617
  ),
618
- !T && l && l !== "new" && /* @__PURE__ */ n(Cn, { collection: i, itemId: l, field: e.field }),
619
- !T && l && l !== "new" && /* @__PURE__ */ n(Vt, { field: e.field, label: S || ee(e.field) }),
620
- l && l !== "new" && at && /* @__PURE__ */ n(Nn, { collection: i, itemId: l, field: e.field }),
618
+ !A && l && l !== "new" && /* @__PURE__ */ n(Ln, { collection: a, itemId: l, field: e.field }),
619
+ !A && l && l !== "new" && /* @__PURE__ */ n(zt, { field: e.field, label: L || Z(e.field) }),
620
+ l && l !== "new" && it && /* @__PURE__ */ n(Fn, { collection: a, itemId: l, field: e.field }),
621
621
  ot && /* @__PURE__ */ n(
622
- dn,
622
+ un,
623
623
  {
624
- collection: i,
624
+ collection: a,
625
625
  itemId: l,
626
626
  field: e.field,
627
- label: S || ee(e.field),
627
+ label: L || Z(e.field),
628
628
  onFill: (t) => p(e.field, t)
629
629
  }
630
630
  ),
631
- !T && J.show && !(J.perField && (u || e.readonly)) && /* @__PURE__ */ d(
631
+ !A && Q.show && !(Q.perField && (u || e.readonly)) && /* @__PURE__ */ d(
632
632
  "button",
633
633
  {
634
634
  type: "button",
635
635
  onClick: tt,
636
- disabled: _e,
637
- "data-ai-fill": J.perField ? e.field : void 0,
636
+ disabled: ke,
637
+ "data-ai-fill": Q.perField ? e.field : void 0,
638
638
  className: "inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[10px] font-medium text-nvr-cyan hover:bg-nvr-cyan/10 disabled:opacity-50 transition-colors",
639
639
  title: "Generate with AI",
640
640
  children: [
641
- _e ? /* @__PURE__ */ n(gt, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(vt, { className: "h-3 w-3" }),
641
+ ke ? /* @__PURE__ */ n(gt, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(vt, { className: "h-3 w-3" }),
642
642
  "AI"
643
643
  ]
644
644
  }
645
645
  ),
646
- he && /* @__PURE__ */ n(
646
+ pe && /* @__PURE__ */ n(
647
647
  "span",
648
648
  {
649
649
  "data-tip": "People often change what the AI read from the document here — check it",
@@ -651,7 +651,7 @@ const lr = Lt(function({
651
651
  children: "Check this"
652
652
  }
653
653
  ),
654
- x,
654
+ f,
655
655
  q && !u && !e.readonly && /* @__PURE__ */ d(
656
656
  "button",
657
657
  {
@@ -667,18 +667,18 @@ const lr = Lt(function({
667
667
  ]
668
668
  }
669
669
  ),
670
- X.length > 0 && /* @__PURE__ */ n(te, { delayDuration: 100, children: /* @__PURE__ */ d(ne, { children: [
671
- /* @__PURE__ */ n(re, { asChild: !0, children: /* @__PURE__ */ d("span", { className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20 cursor-default", children: [
670
+ Y.length > 0 && /* @__PURE__ */ n(I, { delayDuration: 100, children: /* @__PURE__ */ d(ee, { children: [
671
+ /* @__PURE__ */ n(te, { asChild: !0, children: /* @__PURE__ */ d("span", { className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20 cursor-default", children: [
672
672
  /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
673
673
  "addendum"
674
674
  ] }) }),
675
- /* @__PURE__ */ d(le, { side: "top", className: "max-w-[220px] text-[12px]", children: [
675
+ /* @__PURE__ */ d(ne, { side: "top", className: "max-w-[220px] text-[12px]", children: [
676
676
  /* @__PURE__ */ d("p", { className: "font-medium mb-1", children: [
677
677
  "In active addendum",
678
- X.length > 1 ? "s" : "",
678
+ Y.length > 1 ? "s" : "",
679
679
  ":"
680
680
  ] }),
681
- X.map((t) => /* @__PURE__ */ d("p", { className: "text-slate-400", children: [
681
+ Y.map((t) => /* @__PURE__ */ d("p", { className: "text-slate-400", children: [
682
682
  t.title,
683
683
  " ",
684
684
  /* @__PURE__ */ d("span", { className: "capitalize", children: [
@@ -690,65 +690,65 @@ const lr = Lt(function({
690
690
  ] })
691
691
  ] }) }),
692
692
  /* @__PURE__ */ n(
693
- Gt,
693
+ Qt,
694
694
  {
695
- collection: i,
695
+ collection: a,
696
696
  kind: "field",
697
697
  name: e.field,
698
- label: S
698
+ label: L
699
699
  }
700
700
  ),
701
- (u || e.readonly) && B ? /* @__PURE__ */ n(Ut, { reason: B, onHover: s == null ? void 0 : s.onLockHover }) : u ? /* @__PURE__ */ n(te, { delayDuration: 200, children: /* @__PURE__ */ d(ne, { children: [
702
- /* @__PURE__ */ n(re, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(wt, { className: "h-3 w-3" }) }) }),
703
- /* @__PURE__ */ n(le, { side: "top", className: "text-[12px]", children: "This field is locked" })
701
+ (u || e.readonly) && D ? /* @__PURE__ */ n(Ht, { reason: D, onHover: s == null ? void 0 : s.onLockHover }) : u ? /* @__PURE__ */ n(I, { delayDuration: 200, children: /* @__PURE__ */ d(ee, { children: [
702
+ /* @__PURE__ */ n(te, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(wt, { className: "h-3 w-3" }) }) }),
703
+ /* @__PURE__ */ n(ne, { side: "top", className: "text-[12px]", children: "This field is locked" })
704
704
  ] }) }) : null,
705
- P.length > 0 && (() => {
706
- const t = !!M && Object.keys(M).length > 0 && K.length > 0, r = P.map(
707
- (h) => I(String(h.parent_field))
705
+ E.length > 0 && (() => {
706
+ const t = !!O && Object.keys(O).length > 0 && M.length > 0, r = E.map(
707
+ (h) => X(String(h.parent_field))
708
708
  );
709
- return /* @__PURE__ */ n(te, { delayDuration: 100, children: /* @__PURE__ */ d(ne, { children: [
710
- /* @__PURE__ */ n(re, { asChild: !0, children: /* @__PURE__ */ n(
709
+ return /* @__PURE__ */ n(I, { delayDuration: 100, children: /* @__PURE__ */ d(ee, { children: [
710
+ /* @__PURE__ */ n(te, { asChild: !0, children: /* @__PURE__ */ n(
711
711
  "button",
712
712
  {
713
713
  type: "button",
714
- "aria-label": `Show the fields that narrow ${S || "this list"}`,
714
+ "aria-label": `Show the fields that narrow ${L || "this list"}`,
715
715
  onClick: ht,
716
- className: D(
716
+ className: j(
717
717
  "inline-flex items-center transition-colors",
718
718
  t ? "text-nvr-cyan hover:text-nvr-cyan" : "text-slate-300 hover:text-nvr-cyan dark:text-slate-600 dark:hover:text-nvr-cyan"
719
719
  ),
720
720
  children: /* @__PURE__ */ n(kt, { className: "h-3 w-3" })
721
721
  }
722
722
  ) }),
723
- /* @__PURE__ */ n(le, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${K.join(", ")} — click to highlight` : `Options filter by ${r.join(", ")} once set` })
723
+ /* @__PURE__ */ n(ne, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${M.join(", ")} — click to highlight` : `Options filter by ${r.join(", ")} once set` })
724
724
  ] }) });
725
725
  })(),
726
- me && // Right-anchored: the personal-default control flush with the field's right edge
726
+ ue && // Right-anchored: the personal-default control flush with the field's right edge
727
727
  // (it carries Make / Update / Clear itself — no ⋯ button; right-click and
728
728
  // Shift+F10 still open the field menu). The slot keeps one box whatever it shows,
729
729
  // so nothing to its left moves.
730
730
  /* @__PURE__ */ n("span", { className: "ml-auto inline-flex shrink-0 items-center gap-1", children: /* @__PURE__ */ n(
731
- nn,
731
+ rn,
732
732
  {
733
733
  field: e.field,
734
- label: S,
735
- state: me,
736
- confirmOpen: ue === "make" || ue === "update" ? ue : null,
734
+ label: L,
735
+ state: ue,
736
+ confirmOpen: de === "make" || de === "update" ? de : null,
737
737
  onConfirm: (t, r) => (
738
738
  // After a save the button becomes "Your default": focus goes to the field.
739
- Ze(t, pe, r)
739
+ Ze(t, me, r)
740
740
  ),
741
741
  onUndo: () => {
742
- L == null || L.undo(e.field), requestAnimationFrame(() => {
742
+ C == null || C.undo(e.field), requestAnimationFrame(() => {
743
743
  var t;
744
- return (t = pe()) == null ? void 0 : t.focus();
744
+ return (t = me()) == null ? void 0 : t.focus();
745
745
  });
746
746
  },
747
747
  onCleared: () => (
748
748
  // The Clear button is gone (and not a tab stop): focus goes to the field.
749
749
  requestAnimationFrame(() => {
750
750
  var t;
751
- return (t = pe()) == null ? void 0 : t.focus();
751
+ return (t = me()) == null ? void 0 : t.focus();
752
752
  })
753
753
  )
754
754
  }
@@ -756,83 +756,83 @@ const lr = Lt(function({
756
756
  ]
757
757
  }
758
758
  ),
759
- E.editor && !u && /* @__PURE__ */ n(
760
- Ht,
759
+ T.editor && !u && /* @__PURE__ */ n(
760
+ Wt,
761
761
  {
762
- editor: E.editor,
763
- confirming: E.confirming,
764
- onConfirm: E.confirm,
765
- onCancel: E.cancel
762
+ editor: T.editor,
763
+ confirming: T.confirming,
764
+ onConfirm: T.confirm,
765
+ onCancel: T.cancel
766
766
  }
767
767
  ),
768
- W ?? /* @__PURE__ */ n(
768
+ U ?? /* @__PURE__ */ n(
769
769
  "div",
770
770
  {
771
- ref: de,
772
- className: D(u && !V && "cursor-not-allowed"),
773
- "data-tip": (u || e.readonly) && B ? B : void 0,
774
- onPointerEnter: (u || e.readonly) && B ? s == null ? void 0 : s.onLockHover : void 0,
771
+ ref: ce,
772
+ className: j(u && !H && "cursor-not-allowed"),
773
+ "data-tip": (u || e.readonly) && D ? D : void 0,
774
+ onPointerEnter: (u || e.readonly) && D ? s == null ? void 0 : s.onLockHover : void 0,
775
775
  children: /* @__PURE__ */ n(
776
776
  "div",
777
777
  {
778
- ref: Le,
779
- className: D(
778
+ ref: Ce,
779
+ className: j(
780
780
  // A locked FILE field stays interactive: its chips keep the
781
781
  // download link and preview click (the component itself hides
782
782
  // upload/replace/remove when readonly) — blocking pointer events
783
783
  // made attachments unopenable on every locked form (addendum
784
784
  // view, terminal states).
785
- u && !V && "pointer-events-none opacity-60",
785
+ u && !H && "pointer-events-none opacity-60",
786
786
  // The ring lands with a 2px shake so the eye finds the field;
787
787
  // the animation runs once when the class is added.
788
- N && "nvr-shake ring-1 ring-red-400 rounded-md",
789
- se && "nvr-autofill-glow"
788
+ _ && "nvr-shake ring-1 ring-red-400 rounded-md",
789
+ ae && "nvr-autofill-glow"
790
790
  ),
791
- children: T ? /* @__PURE__ */ n(un, { field: e, values: m }) : it ? /* @__PURE__ */ n(
792
- Bt,
791
+ children: A ? /* @__PURE__ */ n(mn, { field: e, values: m }) : at ? /* @__PURE__ */ n(
792
+ Ot,
793
793
  {
794
- collection: i,
794
+ collection: a,
795
795
  field: e,
796
796
  draft: m,
797
797
  itemId: l
798
798
  }
799
799
  ) : y ? y({
800
800
  field: e,
801
- value: xe,
802
- onChange: Se,
801
+ value: he,
802
+ onChange: Le,
803
803
  disabled: u,
804
- collection: i,
804
+ collection: a,
805
805
  itemId: l,
806
- relations: f,
807
- cascadeFilter: M,
806
+ relations: x,
807
+ cascadeFilter: O,
808
808
  unsatisfiedParentLabel: ut,
809
- requiredParentLabel: De
809
+ requiredParentLabel: je
810
810
  }) : /* @__PURE__ */ n(
811
- zt,
811
+ Gt,
812
812
  {
813
- field: u && V ? mt() : e,
814
- value: xe,
815
- onChange: Se,
816
- relations: f,
817
- collection: i,
813
+ field: u && H ? mt() : e,
814
+ value: he,
815
+ onChange: Le,
816
+ relations: x,
817
+ collection: a,
818
818
  itemId: l,
819
- cascadeFilter: M,
820
- requiredParentLabel: De,
821
- narrowedBy: K.length > 0 ? pt() : void 0,
819
+ cascadeFilter: O,
820
+ requiredParentLabel: je,
821
+ narrowedBy: M.length > 0 ? pt() : void 0,
822
822
  onCountChange: o ? Ge : void 0
823
823
  }
824
824
  )
825
825
  },
826
- se ?? 0
826
+ ae ?? 0
827
827
  )
828
828
  }
829
829
  ),
830
- Pe && /* @__PURE__ */ n(mn, { value: m[e.field], config: Pe }),
831
- Ae && !et && /* @__PURE__ */ n(rn, { field: e.field, text: Ae }),
832
- Te && /* @__PURE__ */ n(
833
- Wt,
830
+ Ee && /* @__PURE__ */ n(pn, { value: m[e.field], config: Ee }),
831
+ Ae && !et && /* @__PURE__ */ n(ln, { field: e.field, text: Ae }),
832
+ qe && /* @__PURE__ */ n(
833
+ Vt,
834
834
  {
835
- change: Te,
835
+ change: qe,
836
836
  onDismiss: () => s == null ? void 0 : s.dismissRemoteChange(e.field),
837
837
  onTakeTheirs: s != null && s.takeRemoteChange ? () => {
838
838
  var t;
@@ -846,7 +846,7 @@ const lr = Lt(function({
846
846
  );
847
847
  });
848
848
  export {
849
- lr as FieldRow,
850
- rr as lineageSummary,
851
- _n as useFieldLineage
849
+ ir as FieldRow,
850
+ or as lineageSummary,
851
+ Nn as useFieldLineage
852
852
  };