@nivaro/react 0.3.64 → 0.3.65

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 (64) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +49 -4
  4. package/dist/shared/components/CollectionBrowserView.js +3029 -2947
  5. package/dist/shared/components/ConformanceView.js +235 -221
  6. package/dist/shared/components/DataTable.js +478 -459
  7. package/dist/shared/components/ItemEditForm.js +4469 -4266
  8. package/dist/shared/components/PageRenderer.js +146 -138
  9. package/dist/shared/components/RecordDrilldownSheet.js +73 -65
  10. package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
  11. package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
  12. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
  13. package/dist/shared/components/bulk/bulk-field-options.js +29 -23
  14. package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
  15. package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
  16. package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
  17. package/dist/shared/components/integrations/SendCurrentData.js +126 -0
  18. package/dist/shared/components/item-edit/CatalogPickerField.js +1530 -1437
  19. package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
  20. package/dist/shared/components/item-edit/FieldRow.js +413 -403
  21. package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
  22. package/dist/shared/components/item-edit/M2MCombobox.js +172 -168
  23. package/dist/shared/components/item-edit/MidairCollisionDialog.js +341 -114
  24. package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
  25. package/dist/shared/components/item-edit/PlanGrid.js +783 -724
  26. package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
  27. package/dist/shared/components/item-edit/RecordInsights.js +113 -111
  28. package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
  29. package/dist/shared/components/item-edit/RelationCombobox.js +332 -314
  30. package/dist/shared/components/item-edit/cascade-clear-notice.js +52 -0
  31. package/dist/shared/components/item-edit/collision-format.js +37 -0
  32. package/dist/shared/components/item-edit/field-a11y.js +25 -0
  33. package/dist/shared/components/item-edit/line-merge.js +58 -0
  34. package/dist/shared/components/item-edit/line-midair.js +94 -87
  35. package/dist/shared/components/item-edit/move-guard.js +17 -0
  36. package/dist/shared/components/item-edit/picker-search.js +22 -15
  37. package/dist/shared/components/item-edit/rail-width.js +8 -0
  38. package/dist/shared/components/monitoring/InactiveUserLinksView.js +126 -124
  39. package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
  40. package/dist/shared/components/panels/CommentPanel.js +142 -136
  41. package/dist/shared/components/panels/ItemLockBanner.js +246 -240
  42. package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
  43. package/dist/shared/components/panels/RevisionsPanel.js +106 -102
  44. package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
  45. package/dist/shared/components/panels/SlaClock.js +90 -68
  46. package/dist/shared/components/queue/QueueItemSheet.js +94 -87
  47. package/dist/shared/components/queue/QueueWorklist.js +1502 -1354
  48. package/dist/shared/components/queue/worklist-csv.js +75 -0
  49. package/dist/shared/components/queue/worklist-helpers.js +20 -0
  50. package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
  51. package/dist/shared/lib/bulk-copy.js +17 -0
  52. package/dist/shared/lib/cbv-export.js +122 -0
  53. package/dist/shared/lib/delete-offer.js +13 -0
  54. package/dist/shared/lib/error-hints.js +1 -0
  55. package/dist/shared/lib/leave-guard.js +41 -26
  56. package/dist/shared/lib/list-link.js +72 -56
  57. package/dist/shared/lib/live-queries.js +32 -30
  58. package/dist/shared/lib/moved-notice.js +25 -0
  59. package/dist/shared/lib/notification-target.js +56 -54
  60. package/dist/shared/lib/obligation-banner.js +11 -8
  61. package/dist/shared/lib/obligation-reason-text.js +6 -6
  62. package/dist/shared/lib/sort-cycle.js +6 -0
  63. package/dist/shared/lib/summary-mode.js +59 -41
  64. package/package.json +1 -1
@@ -1,22 +1,23 @@
1
1
  import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import { useQueryClient as E, useQuery as F } from "@tanstack/react-query";
3
- import { useState as f, useRef as W, useEffect as O, useMemo as Y } from "react";
4
- import { useNivaroClient as B, useItemNavigation as V, useNavigation as j } from "../context.js";
5
- import { get as M, post as A, put as G } from "../lib/commands.js";
6
- import { useLiveWatchRoom as H, useLiveEvent as J } from "../lib/live.js";
7
- import { userErrorMessage as X } from "../lib/safe-error.js";
8
- import { cn as N } from "../lib/utils.js";
9
- import { PickList as Q } from "./imports/ServiceConfigBuilder.js";
10
- import { TipLayer as Z } from "./TipLayer.js";
11
- function P({ p: t }) {
12
- const a = t.total ? Math.min(100, Math.round(t.checked / t.total * 100)) : null;
13
- return /* @__PURE__ */ n("div", { className: "flex items-center gap-3 text-[11.5px]", "data-conformance-sweep": t.run, children: [
14
- /* @__PURE__ */ e("span", { className: "w-[180px] shrink-0 truncate font-medium text-slate-700 dark:text-foreground", children: t.collection }),
2
+ import { useQueryClient as I, useQuery as T } from "@tanstack/react-query";
3
+ import { useState as f, useRef as V, useEffect as G, useMemo as j } from "react";
4
+ import { useNivaroClient as B, useItemNavigation as H, useNavigation as O } from "../context.js";
5
+ import { get as M, post as A, put as J } from "../lib/commands.js";
6
+ import { useLiveWatchRoom as X, useLiveEvent as Z } from "../lib/live.js";
7
+ import { userErrorMessage as P } from "../lib/safe-error.js";
8
+ import { cn as N, titleCase as ee } from "../lib/utils.js";
9
+ import { PickList as U } from "./imports/ServiceConfigBuilder.js";
10
+ import { useOverviewFields as te } from "./layout-editor/overview/overview-api.js";
11
+ import { TipLayer as re } from "./TipLayer.js";
12
+ function ae({ p: r }) {
13
+ const a = r.total ? Math.min(100, Math.round(r.checked / r.total * 100)) : null;
14
+ return /* @__PURE__ */ n("div", { className: "flex items-center gap-3 text-[11.5px]", "data-conformance-sweep": r.run, children: [
15
+ /* @__PURE__ */ e("span", { className: "w-[180px] shrink-0 truncate font-medium text-slate-700 dark:text-foreground", children: r.collection }),
15
16
  /* @__PURE__ */ e(
16
17
  "span",
17
18
  {
18
19
  role: "progressbar",
19
- "aria-label": `${t.collection} sweep`,
20
+ "aria-label": `${r.collection} sweep`,
20
21
  "aria-valuemin": 0,
21
22
  "aria-valuemax": 100,
22
23
  "aria-valuenow": a ?? void 0,
@@ -34,33 +35,33 @@ function P({ p: t }) {
34
35
  }
35
36
  ),
36
37
  /* @__PURE__ */ n("span", { className: "tabular-nums text-slate-500 dark:text-muted-foreground", children: [
37
- t.checked.toLocaleString(),
38
- t.total ? ` of ${t.total.toLocaleString()}` : "",
38
+ r.checked.toLocaleString(),
39
+ r.total ? ` of ${r.total.toLocaleString()}` : "",
39
40
  " checked · ",
40
- t.violations.toLocaleString(),
41
+ r.violations.toLocaleString(),
41
42
  " ",
42
43
  "issue",
43
- t.violations === 1 ? "" : "s",
44
+ r.violations === 1 ? "" : "s",
44
45
  " so far"
45
46
  ] })
46
47
  ] });
47
48
  }
48
- function ee(t) {
49
- if (!t) return "";
50
- const a = Date.now() - new Date(t).getTime(), s = Math.round(a / 6e4);
49
+ function ne(r) {
50
+ if (!r) return "";
51
+ const a = Date.now() - new Date(r).getTime(), s = Math.round(a / 6e4);
51
52
  if (s < 1) return "just now";
52
53
  if (s < 60) return `${s}m ago`;
53
54
  const p = Math.round(s / 60);
54
- return p < 24 ? `${p}h ago` : new Date(t).toLocaleDateString();
55
+ return p < 24 ? `${p}h ago` : new Date(r).toLocaleDateString();
55
56
  }
56
- function te(t) {
57
- if (!t.started_at || !t.finished_at) return "";
57
+ function le(r) {
58
+ if (!r.started_at || !r.finished_at) return "";
58
59
  const a = Math.round(
59
- (new Date(t.finished_at).getTime() - new Date(t.started_at).getTime()) / 1e3
60
+ (new Date(r.finished_at).getTime() - new Date(r.started_at).getTime()) / 1e3
60
61
  );
61
62
  return a < 60 ? `${a}s` : `${Math.floor(a / 60)}m ${a % 60}s`;
62
63
  }
63
- const T = {
64
+ const F = {
64
65
  required: {
65
66
  label: "Required empty",
66
67
  cls: "bg-red-500/10 text-red-700 dark:text-red-400"
@@ -97,33 +98,40 @@ const T = {
97
98
  label: "Not an option the picker offers",
98
99
  cls: "bg-purple-500/10 text-purple-700 dark:text-purple-400"
99
100
  }
100
- }, K = (t) => t.replace(/[-_]+/g, " ").replace(/^\w/, (a) => a.toUpperCase());
101
- function re({ findingId: t }) {
102
- const a = B(), [s, p] = f(!1), [x, i] = f(""), [o, c] = f(!1), [b, g] = f(null), w = F({
101
+ };
102
+ function z(r) {
103
+ return String(r ?? "").trim() || "Record with no number";
104
+ }
105
+ function K(r, a) {
106
+ return r[a] || ee(a);
107
+ }
108
+ const E = (r) => r.replace(/[-_]+/g, " ").replace(/^\w/, (a) => a.toUpperCase());
109
+ function oe({ findingId: r }) {
110
+ const a = B(), [s, p] = f(!1), [x, d] = f(""), [o, i] = f(!1), [g, v] = f(null), w = T({
103
111
  queryKey: ["conformance-assign-users", x],
104
112
  queryFn: () => a.request(M(`/users?search=${encodeURIComponent(x)}&limit=8`)).then((u) => u.data),
105
113
  enabled: s && x.trim().length >= 2,
106
114
  staleTime: 3e4
107
- }), v = async (u) => {
108
- c(!0);
115
+ }), y = async (u) => {
116
+ i(!0);
109
117
  try {
110
118
  await a.request(
111
- A(`/config-conformance/findings/${t}/assign`, { user_id: u.id })
112
- ), g([u.first_name, u.last_name].filter(Boolean).join(" ") || u.email), p(!1);
119
+ A(`/config-conformance/findings/${r}/assign`, { user_id: u.id })
120
+ ), v([u.first_name, u.last_name].filter(Boolean).join(" ") || u.email), p(!1);
113
121
  } finally {
114
- c(!1);
122
+ i(!1);
115
123
  }
116
124
  };
117
- return b ? /* @__PURE__ */ n("span", { className: "text-[11px] text-emerald-700 dark:text-emerald-400", "data-finding-assigned": !0, children: [
125
+ return g ? /* @__PURE__ */ n("span", { className: "text-[11px] text-emerald-700 dark:text-emerald-400", "data-finding-assigned": !0, children: [
118
126
  "→ ",
119
- b
127
+ g
120
128
  ] }) : /* @__PURE__ */ n("span", { className: "relative inline-block", children: [
121
129
  /* @__PURE__ */ e(
122
130
  "button",
123
131
  {
124
132
  type: "button",
125
133
  onClick: () => p((u) => !u),
126
- "data-finding-assign": t,
134
+ "data-finding-assign": r,
127
135
  className: "rounded-md border border-slate-200 px-2 py-0.5 text-[11px] text-slate-600 hover:border-slate-300 hover:text-slate-800 dark:border-border dark:text-muted-foreground",
128
136
  title: "Assign this finding to someone as a task on the record",
129
137
  children: "Assign…"
@@ -140,7 +148,7 @@ function re({ findingId: t }) {
140
148
  {
141
149
  autoFocus: !0,
142
150
  value: x,
143
- onChange: (u) => i(u.target.value),
151
+ onChange: (u) => d(u.target.value),
144
152
  placeholder: "Type a name…",
145
153
  className: "h-7 w-full rounded-md border border-slate-200 bg-white px-2 text-[12px] dark:border-border dark:bg-background"
146
154
  }
@@ -151,7 +159,7 @@ function re({ findingId: t }) {
151
159
  {
152
160
  type: "button",
153
161
  disabled: o,
154
- onClick: () => void v(u),
162
+ onClick: () => void y(u),
155
163
  className: "w-full rounded px-2 py-1 text-left text-[12px] hover:bg-muted disabled:opacity-50",
156
164
  children: [
157
165
  [u.first_name, u.last_name].filter(Boolean).join(" ") || u.email,
@@ -166,104 +174,104 @@ function re({ findingId: t }) {
166
174
  )
167
175
  ] });
168
176
  }
169
- function ge({ className: t }) {
170
- const a = B(), s = E(), p = V(), x = j(), [i, o] = f(""), [c, b] = f(null), [g, w] = f(!1), [v, u] = f(null), [d, q] = f("5000"), L = H("conformance"), [r, h] = f({}), m = W(null);
171
- O(
177
+ function we({ className: r }) {
178
+ const a = B(), s = I(), p = H(), x = O(), [d, o] = f(""), [i, g] = f(null), [v, w] = f(!1), [y, u] = f(null), [C, q] = f("5000"), c = X("conformance"), [$, R] = f({}), t = V(null);
179
+ G(
172
180
  () => () => {
173
- m.current && clearTimeout(m.current);
181
+ t.current && clearTimeout(t.current);
174
182
  },
175
183
  []
176
- ), J(
184
+ ), Z(
177
185
  "conformance:progress",
178
186
  (l) => {
179
- h((R) => {
180
- const D = { ...R };
187
+ R((L) => {
188
+ const D = { ...L };
181
189
  return l.status === "running" ? D[l.run] = l : delete D[l.run], D;
182
190
  });
183
191
  const _ = () => {
184
192
  s.invalidateQueries({ queryKey: ["conformance-runs"] }), s.invalidateQueries({ queryKey: ["conformance-run", l.run] }), l.status !== "running" && s.invalidateQueries({ queryKey: ["conformance-collections"] });
185
193
  };
186
- l.status !== "running" ? (m.current && clearTimeout(m.current), m.current = null, _()) : m.current || (m.current = setTimeout(() => {
187
- m.current = null, _();
194
+ l.status !== "running" ? (t.current && clearTimeout(t.current), t.current = null, _()) : t.current || (t.current = setTimeout(() => {
195
+ t.current = null, _();
188
196
  }, 1500));
189
197
  },
190
198
  { includeOwn: !0 }
191
199
  );
192
- const { data: $ = [], isLoading: C } = F(
200
+ const { data: m = [], isLoading: h } = T(
193
201
  {
194
202
  queryKey: ["conformance-collections"],
195
203
  queryFn: () => a.request(M("/config-conformance/collections")).then((l) => l.data ?? []),
196
204
  staleTime: 5 * 6e4
197
205
  }
198
- ), { data: k = [], isFetched: U } = F({
199
- queryKey: ["conformance-runs", i],
206
+ ), { data: b = [], isFetched: W } = T({
207
+ queryKey: ["conformance-runs", d],
200
208
  queryFn: () => a.request(
201
- M(`/config-conformance/runs${i ? `?collection=${i}` : ""}`)
209
+ M(`/config-conformance/runs${d ? `?collection=${d}` : ""}`)
202
210
  ).then((l) => l.data ?? []),
203
211
  refetchInterval: (l) => {
204
212
  var _;
205
- return (_ = l.state.data) != null && _.some((R) => R.status === "running") ? L ? 2e4 : 3e3 : !1;
213
+ return (_ = l.state.data) != null && _.some((L) => L.status === "running") ? c ? 2e4 : 3e3 : !1;
206
214
  }
207
- }), I = Object.values(r).filter((l) => {
208
- const _ = k.find((R) => R.id === l.run);
215
+ }), Q = Object.values($).filter((l) => {
216
+ const _ = b.find((L) => L.id === l.run);
209
217
  return !_ || _.status === "running";
210
- }), S = (c != null ? k.find((l) => l.id === c) : void 0) ?? k[0], y = $.find((l) => l.collection === i), z = async () => {
211
- if (i) {
218
+ }), S = (i != null ? b.find((l) => l.id === i) : void 0) ?? b[0], k = m.find((l) => l.collection === d), Y = async () => {
219
+ if (d) {
212
220
  w(!0), u(null);
213
221
  try {
214
222
  const l = await a.request(
215
- A(`/config-conformance/${i}/run`, {
216
- limit: d === "0" ? 0 : Number(d) || 5e3
223
+ A(`/config-conformance/${d}/run`, {
224
+ limit: C === "0" ? 0 : Number(C) || 5e3
217
225
  })
218
226
  );
219
- b(l.data.id), s.invalidateQueries({ queryKey: ["conformance-runs"] });
227
+ g(l.data.id), s.invalidateQueries({ queryKey: ["conformance-runs"] });
220
228
  } catch (l) {
221
- u(X(l, "Could not start the run"));
229
+ u(P(l, "Could not start the run"));
222
230
  } finally {
223
231
  w(!1);
224
232
  }
225
233
  }
226
234
  };
227
- return /* @__PURE__ */ n("div", { className: N("flex min-h-0 flex-1 flex-col gap-4 p-6", t), "data-conformance": !0, children: [
228
- /* @__PURE__ */ e(Z, {}),
235
+ return /* @__PURE__ */ n("div", { className: N("flex min-h-0 flex-1 flex-col gap-4 p-6", r), "data-conformance": !0, children: [
236
+ /* @__PURE__ */ e(re, {}),
229
237
  /* @__PURE__ */ n("div", { className: "flex flex-wrap items-end gap-3", children: [
230
238
  /* @__PURE__ */ n("div", { className: "w-[300px]", children: [
231
239
  /* @__PURE__ */ e("p", { className: "mb-1 text-[11.5px] font-medium text-slate-700 dark:text-foreground", children: "Collection" }),
232
240
  /* @__PURE__ */ e(
233
- Q,
241
+ U,
234
242
  {
235
- value: i,
243
+ value: d,
236
244
  onChange: (l) => {
237
- o(l), b(null);
245
+ o(l), g(null);
238
246
  },
239
- options: $.map((l) => ({
247
+ options: m.map((l) => ({
240
248
  value: l.collection,
241
249
  label: l.display_name || l.collection
242
250
  })),
243
- placeholder: C ? "Loading…" : "Choose a collection…",
251
+ placeholder: h ? "Loading…" : "Choose a collection…",
244
252
  className: "h-8"
245
253
  }
246
254
  )
247
255
  ] }),
248
- y && /* @__PURE__ */ n("p", { className: "pb-1.5 text-[11.5px] text-slate-400", children: [
249
- y.required,
256
+ k && /* @__PURE__ */ n("p", { className: "pb-1.5 text-[11.5px] text-slate-400", children: [
257
+ k.required,
250
258
  " required · ",
251
- y.validation,
259
+ k.validation,
252
260
  " validation · ",
253
- y.cascade,
261
+ k.cascade,
254
262
  " ",
255
263
  "cascade check",
256
- y.cascade === 1 ? "" : "s",
257
- (y.row_rules ?? 0) > 0 && ` · ${y.row_rules} grid${y.row_rules === 1 ? "" : "s"} with row rules`,
258
- (y.row_lints ?? 0) > 0 && ` · ${y.row_lints} grid${y.row_lints === 1 ? "" : "s"} with row lints`,
259
- y.skipped > 0 && ` · ${y.skipped} not evaluable`
264
+ k.cascade === 1 ? "" : "s",
265
+ (k.row_rules ?? 0) > 0 && ` · ${k.row_rules} grid${k.row_rules === 1 ? "" : "s"} with row rules`,
266
+ (k.row_lints ?? 0) > 0 && ` · ${k.row_lints} grid${k.row_lints === 1 ? "" : "s"} with row lints`,
267
+ k.skipped > 0 && ` · ${k.skipped} not evaluable`
260
268
  ] }),
261
269
  /* @__PURE__ */ n("div", { className: "w-[170px]", children: [
262
270
  /* @__PURE__ */ e("p", { className: "mb-1 text-[11.5px] font-medium text-slate-700 dark:text-foreground", children: "Sample size" }),
263
271
  /* @__PURE__ */ e(
264
- Q,
272
+ U,
265
273
  {
266
- value: d,
274
+ value: C,
267
275
  onChange: q,
268
276
  options: [
269
277
  { value: "1000", label: "1,000 newest" },
@@ -282,53 +290,53 @@ function ge({ className: t }) {
282
290
  "button",
283
291
  {
284
292
  type: "button",
285
- disabled: !i || g || k.some((l) => l.status === "running"),
286
- onClick: () => void z(),
293
+ disabled: !d || v || b.some((l) => l.status === "running"),
294
+ onClick: () => void Y(),
287
295
  className: "h-8 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-medium text-white disabled:opacity-50",
288
- children: g ? "Starting…" : "Run checks"
296
+ children: v ? "Starting…" : "Run checks"
289
297
  }
290
298
  ),
291
- i && /* @__PURE__ */ e(ae, { collection: i }),
292
- k.filter((l) => l.status === "completed").length >= 2 && /* @__PURE__ */ e(ne, { runs: k }),
293
- v && /* @__PURE__ */ e("p", { className: "pb-1.5 text-[12px] text-red-600 dark:text-red-400", children: v })
299
+ d && /* @__PURE__ */ e(se, { collection: d }),
300
+ b.filter((l) => l.status === "completed").length >= 2 && /* @__PURE__ */ e(de, { runs: b }),
301
+ y && /* @__PURE__ */ e("p", { className: "pb-1.5 text-[12px] text-red-600 dark:text-red-400", children: y })
294
302
  ] }),
295
- I.length > 0 && /* @__PURE__ */ n(
303
+ Q.length > 0 && /* @__PURE__ */ n(
296
304
  "div",
297
305
  {
298
306
  className: "flex flex-col gap-2 rounded-lg border border-slate-200 bg-white px-4 py-3 dark:border-border dark:bg-card",
299
307
  "data-conformance-sweeps": !0,
300
308
  children: [
301
309
  /* @__PURE__ */ e("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Sweeps in progress" }),
302
- I.map((l) => /* @__PURE__ */ e(P, { p: l }, l.run))
310
+ Q.map((l) => /* @__PURE__ */ e(ae, { p: l }, l.run))
303
311
  ]
304
312
  }
305
313
  ),
306
- k.length > 0 && /* @__PURE__ */ e(le, { runs: k, activeId: (S == null ? void 0 : S.id) ?? null, onSelect: b }),
314
+ b.length > 0 && /* @__PURE__ */ e(ie, { runs: b, activeId: (S == null ? void 0 : S.id) ?? null, onSelect: g }),
307
315
  S && /* @__PURE__ */ e(
308
- oe,
316
+ ce,
309
317
  {
310
318
  run: S,
311
- liveProgress: r[S.id] ?? null,
312
- live: L,
319
+ liveProgress: $[S.id] ?? null,
320
+ live: c,
313
321
  onOpenItem: (l, _) => {
314
322
  if (_) {
315
- const R = p.urlFor({ collection: S.collection, itemId: l });
323
+ const L = p.urlFor({ collection: S.collection, itemId: l });
316
324
  x.navigate(
317
- `${R}${R.includes("?") ? "&" : "?"}focus=${encodeURIComponent(_)}`
325
+ `${L}${L.includes("?") ? "&" : "?"}focus=${encodeURIComponent(_)}`
318
326
  );
319
327
  } else
320
328
  p.open({ collection: S.collection, itemId: l });
321
329
  }
322
330
  }
323
331
  ),
324
- !S && !C && U && /* @__PURE__ */ n("div", { className: "max-w-[560px] rounded-lg border border-slate-200 bg-white p-5 dark:border-border dark:bg-card", children: [
332
+ !S && !h && W && /* @__PURE__ */ n("div", { className: "max-w-[560px] rounded-lg border border-slate-200 bg-white p-5 dark:border-border dark:bg-card", children: [
325
333
  /* @__PURE__ */ e("p", { className: "text-[13px] font-medium text-slate-800 dark:text-foreground", children: "Which records would fail their own form?" }),
326
334
  /* @__PURE__ */ e("p", { className: "mt-1.5 text-[12.5px] leading-relaxed text-slate-500 dark:text-muted-foreground", children: "Field rules accumulate while data drifts underneath them — imports, integrations, and parent-link changes leave records whose values a person could never save today (“this value is not an available option”). Pick a collection and run its checks: required fields, validation rules, cascade availability, and inline-grid row rules (a labor line still priced at $40, a line whose task no longer matches its category), evaluated against the newest records." })
327
335
  ] })
328
336
  ] });
329
337
  }
330
- function ae({ collection: t }) {
331
- const a = B(), s = E(), { data: p, isError: x } = F({
338
+ function se({ collection: r }) {
339
+ const a = B(), s = I(), { data: p, isError: x } = T({
332
340
  queryKey: ["conformance-schedules"],
333
341
  queryFn: () => a.request(
334
342
  M("/config-conformance/schedules")
@@ -337,25 +345,25 @@ function ae({ collection: t }) {
337
345
  staleTime: 6e4
338
346
  });
339
347
  if (x || !p) return null;
340
- const i = p.some((o) => o.collection === t && o.is_active);
348
+ const d = p.some((o) => o.collection === r && o.is_active);
341
349
  return /* @__PURE__ */ n("label", { className: "flex shrink-0 cursor-pointer items-center gap-1.5 whitespace-nowrap pb-1.5 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
342
350
  /* @__PURE__ */ e(
343
351
  "button",
344
352
  {
345
353
  type: "button",
346
354
  role: "switch",
347
- "aria-checked": i,
348
- onClick: () => void a.request(G(`/config-conformance/schedules/${t}`, { is_active: !i })).then(() => s.invalidateQueries({ queryKey: ["conformance-schedules"] })),
355
+ "aria-checked": d,
356
+ onClick: () => void a.request(J(`/config-conformance/schedules/${r}`, { is_active: !d })).then(() => s.invalidateQueries({ queryKey: ["conformance-schedules"] })),
349
357
  className: N(
350
358
  "relative h-4 w-7 shrink-0 rounded-full transition-colors",
351
- i ? "bg-nvr-cyan" : "bg-slate-300 dark:bg-border"
359
+ d ? "bg-nvr-cyan" : "bg-slate-300 dark:bg-border"
352
360
  ),
353
361
  children: /* @__PURE__ */ e(
354
362
  "span",
355
363
  {
356
364
  className: N(
357
365
  "absolute left-0 top-0.5 h-3 w-3 rounded-full bg-white transition-transform",
358
- i ? "translate-x-3.5" : "translate-x-0.5"
366
+ d ? "translate-x-3.5" : "translate-x-0.5"
359
367
  )
360
368
  }
361
369
  )
@@ -364,11 +372,11 @@ function ae({ collection: t }) {
364
372
  "Nightly sweep"
365
373
  ] });
366
374
  }
367
- function ne({ runs: t }) {
368
- const a = t.filter((c) => c.status === "completed").slice(0, 12).reverse();
375
+ function de({ runs: r }) {
376
+ const a = r.filter((i) => i.status === "completed").slice(0, 12).reverse();
369
377
  if (a.length < 2) return null;
370
- const s = Math.max(...a.map((c) => c.violation_count), 1), p = 90, x = 22, i = a.map(
371
- (c, b) => `${b / (a.length - 1) * (p - 4) + 2},${x - 3 - c.violation_count / s * (x - 6)}`
378
+ const s = Math.max(...a.map((i) => i.violation_count), 1), p = 90, x = 22, d = a.map(
379
+ (i, g) => `${g / (a.length - 1) * (p - 4) + 2},${x - 3 - i.violation_count / s * (x - 6)}`
372
380
  ).join(" "), o = a[a.length - 1].violation_count <= a[0].violation_count;
373
381
  return /* @__PURE__ */ e(
374
382
  "span",
@@ -378,7 +386,7 @@ function ne({ runs: t }) {
378
386
  children: /* @__PURE__ */ e("svg", { width: p, height: x, className: "overflow-visible", children: /* @__PURE__ */ e(
379
387
  "polyline",
380
388
  {
381
- points: i,
389
+ points: d,
382
390
  fill: "none",
383
391
  strokeWidth: "1.5",
384
392
  className: o ? "stroke-emerald-500" : "stroke-amber-500"
@@ -387,12 +395,12 @@ function ne({ runs: t }) {
387
395
  }
388
396
  );
389
397
  }
390
- function le({
391
- runs: t,
398
+ function ie({
399
+ runs: r,
392
400
  activeId: a,
393
401
  onSelect: s
394
402
  }) {
395
- const [p, x] = f(!1), i = p ? t : t.slice(0, 5);
403
+ const [p, x] = f(!1), d = p ? r : r.slice(0, 5);
396
404
  return /* @__PURE__ */ n("div", { className: "overflow-hidden rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
397
405
  /* @__PURE__ */ n("table", { className: "w-full border-collapse text-[12px] tabular-nums", children: [
398
406
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { className: "border-b border-slate-100 text-left text-[10.5px] uppercase tracking-wide text-slate-400 dark:border-border", children: [
@@ -404,7 +412,7 @@ function le({
404
412
  /* @__PURE__ */ e("th", { className: "px-2 py-1.5 font-medium", children: "Started" }),
405
413
  /* @__PURE__ */ e("th", { className: "px-3 py-1.5 font-medium", children: "By" })
406
414
  ] }) }),
407
- /* @__PURE__ */ e("tbody", { children: i.map((o) => /* @__PURE__ */ n(
415
+ /* @__PURE__ */ e("tbody", { children: d.map((o) => /* @__PURE__ */ n(
408
416
  "tr",
409
417
  {
410
418
  onClick: () => s(o.id),
@@ -427,141 +435,145 @@ function le({
427
435
  o.violation_count === 1 ? "" : "s"
428
436
  ] }) }),
429
437
  /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: o.checked_records.toLocaleString() }),
430
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: te(o) }),
438
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500 dark:text-muted-foreground", children: le(o) }),
431
439
  /* @__PURE__ */ e(
432
440
  "td",
433
441
  {
434
442
  className: "px-2 py-1.5 text-slate-500 dark:text-muted-foreground",
435
443
  "data-tip": o.started_at ? new Date(o.started_at).toLocaleString() : void 0,
436
- children: ee(o.started_at)
444
+ children: ne(o.started_at)
437
445
  }
438
446
  ),
439
- /* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: o.triggered_by_name ?? "—" })
447
+ /* @__PURE__ */ e("td", { className: "px-3 py-1.5 text-slate-500 dark:text-muted-foreground", children: o.triggered_by_name ?? "Scheduled" })
440
448
  ]
441
449
  },
442
450
  o.id
443
451
  )) })
444
452
  ] }),
445
- t.length > 5 && /* @__PURE__ */ e(
453
+ r.length > 5 && /* @__PURE__ */ e(
446
454
  "button",
447
455
  {
448
456
  type: "button",
449
457
  onClick: () => x((o) => !o),
450
458
  className: "w-full border-t border-slate-100 py-1.5 text-[11px] text-slate-400 transition-colors hover:text-slate-600 dark:border-border dark:hover:text-muted-foreground",
451
- children: p ? "Show fewer" : `Show all ${t.length} runs`
459
+ children: p ? "Show fewer" : `Show all ${r.length} runs`
452
460
  }
453
461
  )
454
462
  ] });
455
463
  }
456
- function oe({
457
- run: t,
464
+ function ce({
465
+ run: r,
458
466
  onOpenItem: a,
459
467
  liveProgress: s,
460
468
  live: p
461
469
  }) {
462
- const x = B(), [i, o] = f(1), [c, b] = f(""), [g, w] = f(""), [v, u] = f(!1), { data: d } = F({
463
- queryKey: ["conformance-run", t.id, i, c, g, v],
470
+ const x = B(), [d, o] = f(1), [i, g] = f(""), [v, w] = f(""), [y, u] = f(!1), { data: C } = te(r.collection), q = j(() => {
471
+ const t = {};
472
+ for (const m of C ?? []) m.label && (t[m.field] = m.label);
473
+ return t;
474
+ }, [C]), { data: c } = T({
475
+ queryKey: ["conformance-run", r.id, d, i, v, y],
464
476
  queryFn: () => x.request(
465
477
  M(
466
- `/config-conformance/runs/${t.id}?page=${i}&limit=50${c ? `&rule=${c}` : ""}${g ? `&field=${g}` : ""}${v ? "&group=record" : ""}`
478
+ `/config-conformance/runs/${r.id}?page=${d}&limit=50${i ? `&rule=${i}` : ""}${v ? `&field=${v}` : ""}${y ? "&group=record" : ""}`
467
479
  )
468
- ).then((r) => r.data),
469
- refetchInterval: t.status === "running" ? p ? 2e4 : 3e3 : !1
470
- }), q = Math.max(1, Math.ceil(((d == null ? void 0 : d.total) ?? 0) / 50)), L = Y(
480
+ ).then((t) => t.data),
481
+ refetchInterval: r.status === "running" ? p ? 2e4 : 3e3 : !1
482
+ }), $ = Math.max(1, Math.ceil(((c == null ? void 0 : c.total) ?? 0) / 50)), R = j(
471
483
  () => ({
472
- rules: (d == null ? void 0 : d.by_rule) ?? [],
473
- fields: ((d == null ? void 0 : d.by_field) ?? []).slice(0, 12)
484
+ rules: (c == null ? void 0 : c.by_rule) ?? [],
485
+ fields: ((c == null ? void 0 : c.by_field) ?? []).slice(0, 12)
474
486
  }),
475
- [d]
487
+ [c]
476
488
  );
477
489
  return /* @__PURE__ */ n("div", { className: "flex min-h-0 flex-1 flex-col rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
478
490
  /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-3 border-b border-slate-100 px-4 py-2.5 dark:border-border", children: [
479
491
  /* @__PURE__ */ n("span", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: [
480
492
  "Run #",
481
- t.id
493
+ r.id
482
494
  ] }),
483
- t.status === "running" && /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5 text-[11.5px] text-nvr-cyan-dark dark:text-nvr-cyan", children: [
495
+ r.status === "running" && /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5 text-[11.5px] text-nvr-cyan-dark dark:text-nvr-cyan", children: [
484
496
  /* @__PURE__ */ e("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
485
497
  "running — ",
486
- Math.max(t.checked_records, (s == null ? void 0 : s.checked) ?? 0).toLocaleString(),
498
+ Math.max(r.checked_records, (s == null ? void 0 : s.checked) ?? 0).toLocaleString(),
487
499
  s != null && s.total ? ` of ${s.total.toLocaleString()}` : "",
488
500
  " checked so far"
489
501
  ] }),
490
- t.status === "completed" && /* @__PURE__ */ n("span", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
491
- t.checked_records.toLocaleString(),
502
+ r.status === "completed" && /* @__PURE__ */ n("span", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
503
+ r.checked_records.toLocaleString(),
492
504
  " record",
493
- t.checked_records === 1 ? "" : "s",
505
+ r.checked_records === 1 ? "" : "s",
494
506
  " ",
495
507
  "checked · ",
496
- t.violation_count.toLocaleString(),
508
+ r.violation_count.toLocaleString(),
497
509
  " issue",
498
- t.violation_count === 1 ? "" : "s",
499
- t.truncated && " · sample truncated — newest records first"
510
+ r.violation_count === 1 ? "" : "s",
511
+ r.truncated && " · sample truncated — newest records first"
500
512
  ] }),
501
- t.status === "error" && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-red-600 dark:text-red-400", children: t.error }),
513
+ r.status === "error" && /* @__PURE__ */ e("span", { className: "text-[11.5px] text-red-600 dark:text-red-400", children: r.error }),
502
514
  /* @__PURE__ */ e("span", { className: "flex-1" }),
503
515
  /* @__PURE__ */ e("span", { className: "flex rounded-md border border-slate-200 p-0.5 dark:border-border", children: [
504
516
  { value: !1, label: "All issues" },
505
517
  { value: !0, label: "By record" }
506
- ].map((r) => /* @__PURE__ */ e(
518
+ ].map((t) => /* @__PURE__ */ e(
507
519
  "button",
508
520
  {
509
521
  type: "button",
510
522
  onClick: () => {
511
- u(r.value), o(1);
523
+ u(t.value), o(1);
512
524
  },
513
525
  className: N(
514
526
  "rounded px-2 py-0.5 text-[11px] font-medium transition-colors",
515
- v === r.value ? "bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "text-slate-400 hover:text-slate-600 dark:hover:text-muted-foreground"
527
+ y === t.value ? "bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "text-slate-400 hover:text-slate-600 dark:hover:text-muted-foreground"
516
528
  ),
517
- children: r.label
529
+ children: t.label
518
530
  },
519
- r.label
531
+ t.label
520
532
  )) }),
521
- L.rules.map((r) => {
522
- var h, m;
533
+ R.rules.map((t) => {
534
+ var m, h;
523
535
  return /* @__PURE__ */ n(
524
536
  "button",
525
537
  {
526
538
  type: "button",
527
539
  onClick: () => {
528
- b(($) => $ === r.rule ? "" : r.rule), o(1);
540
+ g((b) => b === t.rule ? "" : t.rule), o(1);
529
541
  },
530
542
  className: N(
531
543
  "rounded-full px-2 py-0.5 text-[11px] font-medium transition-opacity",
532
- ((h = T[r.rule]) == null ? void 0 : h.cls) ?? "bg-slate-500/10 text-slate-600",
533
- c && c !== r.rule && "opacity-40"
544
+ ((m = F[t.rule]) == null ? void 0 : m.cls) ?? "bg-slate-500/10 text-slate-600",
545
+ i && i !== t.rule && "opacity-40"
534
546
  ),
535
547
  children: [
536
- ((m = T[r.rule]) == null ? void 0 : m.label) ?? K(r.rule),
548
+ ((h = F[t.rule]) == null ? void 0 : h.label) ?? E(t.rule),
537
549
  " ",
538
- Number(r.c).toLocaleString()
550
+ Number(t.c).toLocaleString()
539
551
  ]
540
552
  },
541
- r.rule
553
+ t.rule
542
554
  );
543
555
  })
544
556
  ] }),
545
- L.fields.length > 1 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5 border-b border-slate-100 px-4 py-2 dark:border-border", children: L.fields.map((r) => /* @__PURE__ */ n(
557
+ R.fields.length > 1 && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5 border-b border-slate-100 px-4 py-2 dark:border-border", children: R.fields.map((t) => /* @__PURE__ */ n(
546
558
  "button",
547
559
  {
548
560
  type: "button",
549
561
  onClick: () => {
550
- w((h) => h === r.field ? "" : r.field), o(1);
562
+ w((m) => m === t.field ? "" : t.field), o(1);
551
563
  },
552
564
  className: N(
553
- "rounded border px-1.5 py-0.5 font-mono text-[10.5px] transition-colors",
554
- g === r.field ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "border-slate-200 text-slate-500 dark:border-border dark:text-muted-foreground"
565
+ "rounded border px-1.5 py-0.5 text-[11px] transition-colors",
566
+ v === t.field ? "border-nvr-cyan/50 bg-nvr-cyan/10 text-slate-800 dark:text-foreground" : "border-slate-200 text-slate-500 dark:border-border dark:text-muted-foreground"
555
567
  ),
556
568
  children: [
557
- r.field,
569
+ K(q, t.field),
558
570
  " · ",
559
- Number(r.c).toLocaleString()
571
+ Number(t.c).toLocaleString()
560
572
  ]
561
573
  },
562
- r.field
574
+ t.field
563
575
  )) }),
564
- c && g && [
576
+ i && v && [
565
577
  "cascade",
566
578
  "option-filter",
567
579
  "validation",
@@ -569,10 +581,10 @@ function oe({
569
581
  "row-rule",
570
582
  "required",
571
583
  "row-input"
572
- ].includes(c) && /* @__PURE__ */ e(se, { run: t, rule: c, field: g, total: (d == null ? void 0 : d.total) ?? 0 }),
584
+ ].includes(i) && /* @__PURE__ */ e(ue, { run: r, rule: i, field: v, total: (c == null ? void 0 : c.total) ?? 0 }),
573
585
  /* @__PURE__ */ n("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
574
- d !== void 0 && ((d == null ? void 0 : d.findings) ?? []).length === 0 && t.status === "completed" && /* @__PURE__ */ e("p", { className: "px-4 py-6 text-[12.5px] text-emerald-600 dark:text-emerald-400", children: c || g ? "No findings match the filters." : "Every checked record satisfies its field configuration." }),
575
- v ? /* @__PURE__ */ e("div", { children: ((d == null ? void 0 : d.findings) ?? []).map((r) => /* @__PURE__ */ n(
586
+ c !== void 0 && ((c == null ? void 0 : c.findings) ?? []).length === 0 && r.status === "completed" && /* @__PURE__ */ e("p", { className: "px-4 py-6 text-[12.5px] text-emerald-600 dark:text-emerald-400", children: i || v ? "No findings match the filters." : "Every checked record satisfies its field configuration." }),
587
+ y ? /* @__PURE__ */ e("div", { children: ((c == null ? void 0 : c.findings) ?? []).map((t) => /* @__PURE__ */ n(
576
588
  "div",
577
589
  {
578
590
  className: "border-b border-slate-100 px-4 py-2 dark:border-border/60",
@@ -582,28 +594,28 @@ function oe({
582
594
  "button",
583
595
  {
584
596
  type: "button",
585
- onClick: () => a(r.item_id),
597
+ onClick: () => a(t.item_id),
586
598
  className: "text-[12.5px] font-medium text-nvr-cyan underline decoration-dotted underline-offset-2",
587
- children: r.item_label || `#${r.item_id}`
599
+ children: z(t.item_label)
588
600
  }
589
601
  ),
590
602
  /* @__PURE__ */ n("span", { className: "rounded-full bg-slate-100 px-1.5 py-0.5 text-[10.5px] font-medium text-slate-600 dark:bg-background dark:text-muted-foreground", children: [
591
- r.count,
603
+ t.count,
592
604
  " issue",
593
- r.count === 1 ? "" : "s"
605
+ t.count === 1 ? "" : "s"
594
606
  ] })
595
607
  ] }),
596
- /* @__PURE__ */ e("div", { className: "mt-1 space-y-0.5", children: r.findings.map((h) => {
597
- var m, $;
608
+ /* @__PURE__ */ e("div", { className: "mt-1 space-y-0.5", children: t.findings.map((m) => {
609
+ var h, b;
598
610
  return /* @__PURE__ */ n("div", { className: "flex items-baseline gap-2 text-[12px]", children: [
599
611
  /* @__PURE__ */ e(
600
612
  "button",
601
613
  {
602
614
  type: "button",
603
- onClick: () => a(r.item_id, h.field),
615
+ onClick: () => a(t.item_id, m.field),
604
616
  "data-tip": "Open the record at this field",
605
- className: "w-[150px] shrink-0 text-left font-mono text-[11px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-nvr-cyan dark:text-muted-foreground",
606
- children: h.field
617
+ className: "w-[150px] shrink-0 text-left text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-nvr-cyan dark:text-muted-foreground",
618
+ children: K(q, m.field)
607
619
  }
608
620
  ),
609
621
  /* @__PURE__ */ e(
@@ -611,19 +623,19 @@ function oe({
611
623
  {
612
624
  className: N(
613
625
  "shrink-0 rounded-full px-2 py-0.5 text-[10.5px] font-medium",
614
- ((m = T[h.rule]) == null ? void 0 : m.cls) ?? "bg-slate-500/10 text-slate-600"
626
+ ((h = F[m.rule]) == null ? void 0 : h.cls) ?? "bg-slate-500/10 text-slate-600"
615
627
  ),
616
- children: (($ = T[h.rule]) == null ? void 0 : $.label) ?? K(h.rule)
628
+ children: ((b = F[m.rule]) == null ? void 0 : b.label) ?? E(m.rule)
617
629
  }
618
630
  ),
619
- /* @__PURE__ */ e("span", { className: "min-w-0 text-slate-600 dark:text-muted-foreground", children: h.message })
620
- ] }, h.id);
631
+ /* @__PURE__ */ e("span", { className: "min-w-0 text-slate-600 dark:text-muted-foreground", children: m.message })
632
+ ] }, m.id);
621
633
  }) })
622
634
  ]
623
635
  },
624
- r.item_id
625
- )) }) : /* @__PURE__ */ e("table", { className: "w-full border-collapse text-[12px] tabular-nums", children: /* @__PURE__ */ e("tbody", { children: ((d == null ? void 0 : d.findings) ?? []).map((r) => {
626
- var h, m;
636
+ t.item_id
637
+ )) }) : /* @__PURE__ */ e("table", { className: "w-full border-collapse text-[12px] tabular-nums", children: /* @__PURE__ */ e("tbody", { children: ((c == null ? void 0 : c.findings) ?? []).map((t) => {
638
+ var m, h;
627
639
  return /* @__PURE__ */ n(
628
640
  "tr",
629
641
  {
@@ -633,19 +645,19 @@ function oe({
633
645
  "button",
634
646
  {
635
647
  type: "button",
636
- onClick: () => a(r.item_id),
648
+ onClick: () => a(t.item_id),
637
649
  className: "text-left text-nvr-cyan underline decoration-dotted underline-offset-2",
638
- children: r.item_label || `#${r.item_id}`
650
+ children: z(t.item_label)
639
651
  }
640
652
  ) }),
641
653
  /* @__PURE__ */ e("td", { className: "w-[160px] px-2 py-1.5", children: /* @__PURE__ */ e(
642
654
  "button",
643
655
  {
644
656
  type: "button",
645
- onClick: () => a(r.item_id, r.field),
657
+ onClick: () => a(t.item_id, t.field),
646
658
  "data-tip": "Open the record at this field",
647
- className: "font-mono text-[11px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-nvr-cyan dark:text-muted-foreground",
648
- children: r.field
659
+ className: "text-[11.5px] text-slate-500 underline decoration-dotted underline-offset-2 hover:text-nvr-cyan dark:text-muted-foreground",
660
+ children: K(q, t.field)
649
661
  }
650
662
  ) }),
651
663
  /* @__PURE__ */ e("td", { className: "w-[150px] px-2 py-1.5", children: /* @__PURE__ */ e(
@@ -653,42 +665,42 @@ function oe({
653
665
  {
654
666
  className: N(
655
667
  "rounded-full px-2 py-0.5 text-[10.5px] font-medium",
656
- ((h = T[r.rule]) == null ? void 0 : h.cls) ?? "bg-slate-500/10 text-slate-600"
668
+ ((m = F[t.rule]) == null ? void 0 : m.cls) ?? "bg-slate-500/10 text-slate-600"
657
669
  ),
658
- children: ((m = T[r.rule]) == null ? void 0 : m.label) ?? K(r.rule)
670
+ children: ((h = F[t.rule]) == null ? void 0 : h.label) ?? E(t.rule)
659
671
  }
660
672
  ) }),
661
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-slate-600 dark:text-muted-foreground", children: r.message }),
662
- /* @__PURE__ */ e("td", { className: "w-[120px] px-2 py-1.5 text-right", children: /* @__PURE__ */ e(re, { findingId: r.id }) })
673
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-slate-600 dark:text-muted-foreground", children: t.message }),
674
+ /* @__PURE__ */ e("td", { className: "w-[120px] px-2 py-1.5 text-right", children: /* @__PURE__ */ e(oe, { findingId: t.id }) })
663
675
  ]
664
676
  },
665
- r.id
677
+ t.id
666
678
  );
667
679
  }) }) })
668
680
  ] }),
669
- q > 1 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-t border-slate-100 px-4 py-2 text-[11.5px] text-slate-500 dark:border-border dark:text-muted-foreground", children: [
681
+ $ > 1 && /* @__PURE__ */ n("div", { className: "flex items-center justify-between border-t border-slate-100 px-4 py-2 text-[11.5px] text-slate-500 dark:border-border dark:text-muted-foreground", children: [
670
682
  /* @__PURE__ */ e(
671
683
  "button",
672
684
  {
673
685
  type: "button",
674
- disabled: i <= 1,
675
- onClick: () => o((r) => r - 1),
686
+ disabled: d <= 1,
687
+ onClick: () => o((t) => t - 1),
676
688
  className: "disabled:opacity-40",
677
689
  children: "← Previous"
678
690
  }
679
691
  ),
680
692
  /* @__PURE__ */ n("span", { children: [
681
693
  "Page ",
682
- i,
694
+ d,
683
695
  " of ",
684
- q
696
+ $
685
697
  ] }),
686
698
  /* @__PURE__ */ e(
687
699
  "button",
688
700
  {
689
701
  type: "button",
690
- disabled: i >= q,
691
- onClick: () => o((r) => r + 1),
702
+ disabled: d >= $,
703
+ onClick: () => o((t) => t + 1),
692
704
  className: "disabled:opacity-40",
693
705
  children: "Next →"
694
706
  }
@@ -696,26 +708,26 @@ function oe({
696
708
  ] })
697
709
  ] });
698
710
  }
699
- function se({
700
- run: t,
711
+ function ue({
712
+ run: r,
701
713
  rule: a,
702
714
  field: s,
703
715
  total: p
704
716
  }) {
705
- const x = B(), i = E(), o = j(), [c, b] = f(null), [g, w] = f(!1), [v, u] = f(null), [d, q] = f(!1);
706
- if (p === 0 && !v) return null;
707
- const L = () => {
717
+ const x = B(), d = I(), o = O(), [i, g] = f(null), [v, w] = f(!1), [y, u] = f(null), [C, q] = f(!1);
718
+ if (p === 0 && !y) return null;
719
+ const c = () => {
708
720
  q(!0), x.request(
709
- A(`/config-conformance/runs/${t.id}/plan`, { field: s, rule: a })
710
- ).then((m) => o.navigate(`/ai-plans?plan=${encodeURIComponent(m.data.plan_id)}`)).catch((m) => u(m.message)).finally(() => q(!1));
711
- }, r = a === "row-rule" ? "rederive" : ["cascade", "option-filter", "validation", "display"].includes(a) ? "clear" : null, h = (m) => {
712
- w(!0), x.request(A(`/config-conformance/runs/${t.id}/remediate`, { action: m, field: s, rule: a })).then(($) => {
713
- const C = $.data, k = C.failed ? ` — ${C.failed} failed` : "";
721
+ A(`/config-conformance/runs/${r.id}/plan`, { field: s, rule: a })
722
+ ).then((t) => o.navigate(`/ai-plans?plan=${encodeURIComponent(t.data.plan_id)}`)).catch((t) => u(t.message)).finally(() => q(!1));
723
+ }, $ = a === "row-rule" ? "rederive" : ["cascade", "option-filter", "validation", "display"].includes(a) ? "clear" : null, R = (t) => {
724
+ w(!0), x.request(A(`/config-conformance/runs/${r.id}/remediate`, { action: t, field: s, rule: a })).then((m) => {
725
+ const h = m.data, b = h.failed ? ` — ${h.failed} failed` : "";
714
726
  u(
715
- m === "apply-high" ? `Applied confident fixes on ${C.applied ?? 0} record(s); ${C.skipped ?? 0} need a person${k}. Re-run the checks to confirm.` : m === "rederive" ? `Re-derived ${C.lines ?? 0} line(s) across ${C.records ?? 0} record(s)${k}. Re-run the checks to confirm.` : `Cleared on ${C.cleared ?? 0} record(s)${k}. Re-run the checks to confirm.`
716
- ), i.invalidateQueries({ queryKey: ["conformance-run", t.id] });
717
- }).catch(($) => u($.message)).finally(() => {
718
- w(!1), b(null);
727
+ t === "apply-high" ? `Applied confident fixes on ${h.applied ?? 0} record(s); ${h.skipped ?? 0} need a person${b}. Re-run the checks to confirm.` : t === "rederive" ? `Re-derived ${h.lines ?? 0} line(s) across ${h.records ?? 0} record(s)${b}. Re-run the checks to confirm.` : `Cleared on ${h.cleared ?? 0} record(s)${b}. Re-run the checks to confirm.`
728
+ ), d.invalidateQueries({ queryKey: ["conformance-run", r.id] });
729
+ }).catch((m) => u(m.message)).finally(() => {
730
+ w(!1), g(null);
719
731
  });
720
732
  };
721
733
  return /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2.5 border-b border-slate-100 bg-slate-50/60 px-4 py-2 dark:border-border dark:bg-background/40", children: [
@@ -724,25 +736,25 @@ function se({
724
736
  /* @__PURE__ */ e("span", { className: "font-mono", children: s }),
725
737
  " across the affected records — each write is revisioned and attributed to you."
726
738
  ] }),
727
- v ? /* @__PURE__ */ e("span", { className: "text-[11.5px] font-medium text-emerald-600 dark:text-emerald-400", children: v }) : c ? /* @__PURE__ */ n("span", { className: "flex items-center gap-2", children: [
739
+ y ? /* @__PURE__ */ e("span", { className: "text-[11.5px] font-medium text-emerald-600 dark:text-emerald-400", children: y }) : i ? /* @__PURE__ */ n("span", { className: "flex items-center gap-2", children: [
728
740
  /* @__PURE__ */ e(
729
741
  "button",
730
742
  {
731
743
  type: "button",
732
- disabled: g,
733
- onClick: () => h(c),
744
+ disabled: v,
745
+ onClick: () => R(i),
734
746
  className: N(
735
747
  "h-6 rounded-md px-2.5 text-[11.5px] font-medium text-white disabled:opacity-50",
736
- c === "clear" ? "bg-red-600" : c === "rederive" ? "bg-orange-600" : "bg-emerald-600"
748
+ i === "clear" ? "bg-red-600" : i === "rederive" ? "bg-orange-600" : "bg-emerald-600"
737
749
  ),
738
- children: g ? "Working…" : c === "apply-high" ? `Yes, apply confident fixes on ${p.toLocaleString()} record(s)` : c === "rederive" ? `Yes, re-run rules on ${p.toLocaleString()} record(s)` : `Yes, clear ${p.toLocaleString()} value(s)`
750
+ children: v ? "Working…" : i === "apply-high" ? `Yes, apply confident fixes on ${p.toLocaleString()} record(s)` : i === "rederive" ? `Yes, re-run rules on ${p.toLocaleString()} record(s)` : `Yes, clear ${p.toLocaleString()} value(s)`
739
751
  }
740
752
  ),
741
753
  /* @__PURE__ */ e(
742
754
  "button",
743
755
  {
744
756
  type: "button",
745
- onClick: () => b(null),
757
+ onClick: () => g(null),
746
758
  className: "text-[11.5px] text-slate-400 hover:text-slate-600",
747
759
  children: "Cancel"
748
760
  }
@@ -752,7 +764,7 @@ function se({
752
764
  "button",
753
765
  {
754
766
  type: "button",
755
- onClick: () => b("apply-high"),
767
+ onClick: () => g("apply-high"),
756
768
  title: "For each record, apply the top proposal only when its confidence is high (an only option, a rule-derived value); everything else is left for a person.",
757
769
  className: "h-6 rounded-md border border-emerald-300 px-2.5 text-[11.5px] font-medium text-emerald-700 hover:bg-emerald-50 dark:border-emerald-500/40 dark:text-emerald-400 dark:hover:bg-emerald-500/10",
758
770
  children: "Apply confident fixes…"
@@ -762,28 +774,30 @@ function se({
762
774
  "button",
763
775
  {
764
776
  type: "button",
765
- disabled: d,
766
- onClick: L,
777
+ disabled: C,
778
+ onClick: c,
767
779
  "data-tip": "Build the same confident fixes as a plan: review every record’s old → new value, then approve, schedule or discard it.",
768
780
  className: "h-6 rounded-md border border-slate-200 px-2.5 text-[11.5px] font-medium text-slate-600 hover:border-nvr-cyan hover:text-nvr-cyan disabled:opacity-50 dark:border-border dark:text-muted-foreground",
769
- children: d ? "Building plan…" : "Fix as a plan…"
781
+ children: C ? "Building plan…" : "Fix as a plan…"
770
782
  }
771
783
  ),
772
- r && /* @__PURE__ */ e(
784
+ $ && /* @__PURE__ */ e(
773
785
  "button",
774
786
  {
775
787
  type: "button",
776
- onClick: () => b(r),
788
+ onClick: () => g($),
777
789
  className: N(
778
790
  "h-6 rounded-md border border-slate-200 px-2.5 text-[11.5px] font-medium text-slate-600 dark:border-border dark:text-muted-foreground",
779
- r === "rederive" ? "hover:border-orange-300 hover:text-orange-600" : "hover:border-red-300 hover:text-red-600"
791
+ $ === "rederive" ? "hover:border-orange-300 hover:text-orange-600" : "hover:border-red-300 hover:text-red-600"
780
792
  ),
781
- children: r === "rederive" ? "Re-run rules…" : "Clear values…"
793
+ children: $ === "rederive" ? "Re-run rules…" : "Clear values…"
782
794
  }
783
795
  )
784
796
  ] })
785
797
  ] });
786
798
  }
787
799
  export {
788
- ge as ConformanceView
800
+ we as ConformanceView,
801
+ K as findingFieldLabel,
802
+ z as findingRecordName
789
803
  };