@nivaro/react 0.3.24 → 0.3.25

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