@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,44 +1,56 @@
1
- import { jsx as r, jsxs as d } from "react/jsx-runtime";
2
- import { useState as g } from "react";
3
- import { createPortal as v } from "react-dom";
4
- import { htmlToText as w } from "../../lib/sanitize-html.js";
5
- import { titleCase as N } from "../../lib/utils.js";
6
- import { lineConflictKey as b } from "./line-midair.js";
7
- function C({
8
- collision: a,
9
- fieldLabel: i,
10
- onCancel: c,
11
- onResolve: m,
12
- title: u = "Someone else changed this record",
13
- intro: f = "These fields were saved by someone else while you were editing. Pick which value wins for each — everything else you changed saves normally.",
14
- cancelLabel: p = "Cancel save"
1
+ import { jsx as r, jsxs as a, Fragment as j } from "react/jsx-runtime";
2
+ import { useState as $ } from "react";
3
+ import { createPortal as D } from "react-dom";
4
+ import { htmlToText as P } from "../../lib/sanitize-html.js";
5
+ import { titleCase as I } from "../../lib/utils.js";
6
+ import { collisionNumberText as _, differingTails as O } from "./collision-format.js";
7
+ import { classifyLineConflicts as z, mergeReady as A, mergedLinePreview as K, previewFields as B, mergeTheirsKeys as E } from "./line-merge.js";
8
+ import { lineConflictKey as M } from "./line-midair.js";
9
+ function H({
10
+ collision: s,
11
+ fieldLabel: m,
12
+ onCancel: b,
13
+ onResolve: i,
14
+ title: y = "Someone else changed this record",
15
+ intro: v = "These fields were saved by someone else while you were editing. Pick which value wins for each — everything else you changed saves normally.",
16
+ cancelLabel: N = "Cancel save",
17
+ formatValue: g = _,
18
+ topSlot: S,
19
+ replaceBody: C
15
20
  }) {
16
- const [t, o] = g(
17
- () => new Set(a.conflicts.map((e) => e.field))
18
- ), [n, y] = g(null), x = (e) => {
19
- if (e == null || e === "") return "—";
20
- if (typeof e == "object") return JSON.stringify(e).slice(0, 120);
21
- const l = String(e), s = /<[a-z][^>]*>/i.test(l) ? w(l) : l;
22
- return s.trim() ? s.slice(0, 200) : "—";
23
- }, k = /* @__PURE__ */ r(
21
+ const [k, w] = $(
22
+ () => new Set(s.conflicts.map((t) => t.field))
23
+ ), [o, n] = $(null), f = (t, l) => {
24
+ if (l == null || l === "") return "—";
25
+ const c = g(t, l);
26
+ if (c != null) return c;
27
+ if (typeof l == "object") return JSON.stringify(l).slice(0, 120);
28
+ const u = String(l), x = /<[a-z][^>]*>/i.test(u) ? P(u) : u;
29
+ return x.trim() ? x.slice(0, 200) : "—";
30
+ }, d = (t, l, c) => {
31
+ const u = f(t, l), x = f(t, c);
32
+ if (u === "—" || x === "—") return { t: u, m: x };
33
+ const e = O(u, x);
34
+ return { t: e.a, m: e.b };
35
+ }, p = /* @__PURE__ */ r(
24
36
  "span",
25
37
  {
26
38
  hidden: !0,
27
- ref: (e) => {
28
- e && !n && y(e.closest('[role="dialog"]') ?? document.body);
39
+ ref: (t) => {
40
+ t && !o && n(t.closest('[role="dialog"]') ?? document.body);
29
41
  }
30
42
  }
31
43
  );
32
- return n ? v(
33
- /* @__PURE__ */ d(
44
+ return o ? D(
45
+ /* @__PURE__ */ a(
34
46
  "div",
35
47
  {
36
48
  role: "dialog",
37
49
  "aria-modal": "true",
38
50
  "aria-labelledby": "nvr-midair-title",
39
51
  className: "pointer-events-auto fixed inset-0 z-[130] flex items-center justify-center",
40
- onKeyDown: (e) => {
41
- e.key === "Escape" && (e.stopPropagation(), c());
52
+ onKeyDown: (t) => {
53
+ t.key === "Escape" && (t.stopPropagation(), b());
42
54
  },
43
55
  children: [
44
56
  /* @__PURE__ */ r(
@@ -48,128 +60,343 @@ function C({
48
60
  "aria-label": "Close",
49
61
  tabIndex: -1,
50
62
  className: "absolute inset-0 cursor-default bg-black/40",
51
- onClick: c
63
+ onClick: b
52
64
  }
53
65
  ),
54
- /* @__PURE__ */ d("div", { className: "relative w-[560px] max-w-[94vw] rounded-lg border border-slate-200 bg-white p-5 shadow-xl dark:border-border dark:bg-card", children: [
66
+ /* @__PURE__ */ a("div", { className: "relative w-[560px] max-w-[94vw] rounded-lg border border-slate-200 bg-white p-5 shadow-xl dark:border-border dark:bg-card", children: [
55
67
  /* @__PURE__ */ r(
56
68
  "p",
57
69
  {
58
70
  id: "nvr-midair-title",
59
71
  className: "text-[14px] font-semibold text-slate-900 dark:text-foreground",
60
- children: u
72
+ children: y
61
73
  }
62
74
  ),
63
- /* @__PURE__ */ r("p", { className: "mt-1 text-[12.5px] text-slate-500 dark:text-muted-foreground", children: f }),
64
- /* @__PURE__ */ r("div", { className: "mt-3 max-h-[320px] space-y-2 overflow-y-auto", children: a.conflicts.map((e) => {
65
- const l = t.has(e.field);
66
- return /* @__PURE__ */ d(
67
- "div",
68
- {
69
- className: "rounded-md border border-slate-200 p-2.5 dark:border-border",
70
- children: [
71
- /* @__PURE__ */ r("p", { className: "text-[12.5px] font-medium text-slate-800 dark:text-foreground", children: i(e.field) }),
72
- /* @__PURE__ */ d("div", { className: "mt-1.5 grid grid-cols-2 gap-2", children: [
73
- /* @__PURE__ */ d(
74
- "button",
75
+ /* @__PURE__ */ r("p", { className: "mt-1 text-[12.5px] text-slate-500 dark:text-muted-foreground", children: v }),
76
+ S,
77
+ C ?? /* @__PURE__ */ a(j, { children: [
78
+ /* @__PURE__ */ r("div", { className: "mt-3 max-h-[320px] space-y-2 overflow-y-auto", children: s.conflicts.map((t, l) => {
79
+ const c = k.has(t.field), u = d(t.field, t.current_value, s.mine[t.field]), x = `nvr-midair-field-${l}`;
80
+ return /* @__PURE__ */ a(
81
+ "div",
82
+ {
83
+ className: "rounded-md border border-slate-200 p-2.5 dark:border-border",
84
+ children: [
85
+ /* @__PURE__ */ r(
86
+ "p",
75
87
  {
76
- type: "button",
77
- onClick: () => o((s) => /* @__PURE__ */ new Set([...s, e.field])),
78
- className: l ? "rounded-md border-2 border-nvr-cyan/60 bg-nvr-cyan/5 px-2.5 py-1.5 text-left" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
79
- children: [
80
- /* @__PURE__ */ r("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Theirs (current)" }),
81
- /* @__PURE__ */ r("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: x(e.current_value) })
82
- ]
88
+ id: x,
89
+ className: "text-[12.5px] font-medium text-slate-800 dark:text-foreground",
90
+ children: m(t.field)
83
91
  }
84
92
  ),
85
- /* @__PURE__ */ d(
86
- "button",
93
+ /* @__PURE__ */ a(
94
+ "fieldset",
87
95
  {
88
- type: "button",
89
- onClick: () => o((s) => {
90
- const h = new Set(s);
91
- return h.delete(e.field), h;
92
- }),
93
- className: l ? "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border" : "rounded-md border-2 border-amber-400/70 bg-amber-50 px-2.5 py-1.5 text-left dark:bg-amber-400/10",
96
+ "aria-labelledby": x,
97
+ className: "m-0 mt-1.5 grid min-w-0 grid-cols-2 gap-2 border-0 p-0",
94
98
  children: [
95
- /* @__PURE__ */ r("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Mine (overwrite)" }),
96
- /* @__PURE__ */ r("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: x(a.mine[e.field]) })
99
+ /* @__PURE__ */ a(
100
+ "button",
101
+ {
102
+ type: "button",
103
+ "aria-pressed": c,
104
+ onClick: () => w((e) => /* @__PURE__ */ new Set([...e, t.field])),
105
+ className: c ? "rounded-md border-2 border-nvr-cyan/60 bg-nvr-cyan/5 px-2.5 py-1.5 text-left" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
106
+ children: [
107
+ /* @__PURE__ */ r("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Theirs (current)" }),
108
+ /* @__PURE__ */ r("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: u.t })
109
+ ]
110
+ }
111
+ ),
112
+ /* @__PURE__ */ a(
113
+ "button",
114
+ {
115
+ type: "button",
116
+ "aria-pressed": !c,
117
+ onClick: () => w((e) => {
118
+ const h = new Set(e);
119
+ return h.delete(t.field), h;
120
+ }),
121
+ className: c ? "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border" : "rounded-md border-2 border-amber-400/70 bg-amber-50 px-2.5 py-1.5 text-left dark:bg-amber-400/10",
122
+ children: [
123
+ /* @__PURE__ */ r("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-400", children: "Mine (overwrite)" }),
124
+ /* @__PURE__ */ r("p", { className: "mt-0.5 break-words text-[12px] text-slate-700 dark:text-foreground", children: u.m })
125
+ ]
126
+ }
127
+ )
97
128
  ]
98
129
  }
99
130
  )
100
- ] })
101
- ]
102
- },
103
- e.field
104
- );
105
- }) }),
106
- /* @__PURE__ */ d("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
107
- /* @__PURE__ */ r(
108
- "button",
109
- {
110
- type: "button",
111
- onClick: c,
112
- className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] text-slate-600 dark:border-border dark:text-muted-foreground",
113
- children: p
114
- }
115
- ),
116
- /* @__PURE__ */ r(
117
- "button",
118
- {
119
- type: "button",
120
- onClick: () => m(t),
121
- className: "h-8 rounded-md bg-nvr-cyan px-4 text-[12.5px] font-medium text-white",
122
- children: "Apply & save"
123
- }
124
- )
131
+ ]
132
+ },
133
+ t.field
134
+ );
135
+ }) }),
136
+ /* @__PURE__ */ a("div", { className: "mt-4 flex items-center justify-end gap-2", children: [
137
+ /* @__PURE__ */ r(
138
+ "button",
139
+ {
140
+ type: "button",
141
+ onClick: b,
142
+ className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] text-slate-600 dark:border-border dark:text-muted-foreground",
143
+ children: N
144
+ }
145
+ ),
146
+ /* @__PURE__ */ r(
147
+ "button",
148
+ {
149
+ type: "button",
150
+ onClick: () => i(k),
151
+ className: "h-8 rounded-md bg-nvr-cyan px-4 text-[12.5px] font-medium text-white",
152
+ children: "Apply & save"
153
+ }
154
+ )
155
+ ] })
125
156
  ] })
126
157
  ] })
127
158
  ]
128
159
  }
129
160
  ),
130
- n
131
- ) : k;
161
+ o
162
+ ) : p;
132
163
  }
133
- function _({
134
- lines: a,
135
- fieldLabel: i,
136
- onCancel: c,
137
- onResolve: m,
138
- intro: u = "These values were saved by someone else after you changed them. Pick which value wins for each — the rest of your changes are saved.",
139
- cancelLabel: f = "Decide later"
164
+ function Y({
165
+ lines: s,
166
+ fieldLabel: m,
167
+ onCancel: b,
168
+ onResolve: i,
169
+ intro: y = "These values were saved by someone else after you changed them. Pick which value wins for each — the rest of your changes are saved.",
170
+ cancelLabel: v = "Decide later",
171
+ formatValue: N = _,
172
+ hideField: g
140
173
  }) {
141
- const p = (t) => (i == null ? void 0 : i(t)) || N(t.replace(/_/g, " "));
174
+ const [S, C] = $("pick"), k = (o) => (m == null ? void 0 : m(o)) || I(o.replace(/_/g, " ")), w = (o) => {
175
+ for (const n of s)
176
+ for (const f of n.conflicts) if (M(n, f.field) === o) return f.field;
177
+ return o;
178
+ };
142
179
  return /* @__PURE__ */ r(
143
- C,
180
+ H,
144
181
  {
145
- title: a.length === 1 ? `Someone else changed ${a[0].label}` : `Someone else changed ${a.length} lines`,
146
- intro: u,
147
- cancelLabel: f,
182
+ title: s.length === 1 ? `Someone else changed ${s[0].label}` : `Someone else changed ${s.length} lines`,
183
+ intro: y,
184
+ cancelLabel: v,
148
185
  collision: {
149
- conflicts: a.flatMap(
150
- (t) => t.conflicts.map((o) => ({
151
- field: b(t, o.field),
152
- current_value: o.current_value
186
+ conflicts: s.flatMap(
187
+ (o) => o.conflicts.map((n) => ({
188
+ field: M(o, n.field),
189
+ current_value: n.current_value
153
190
  }))
154
191
  ),
155
192
  mine: Object.fromEntries(
156
- a.flatMap(
157
- (t) => t.conflicts.map((o) => [b(t, o.field), t.mine[o.field]])
193
+ s.flatMap(
194
+ (o) => o.conflicts.map((n) => [M(o, n.field), o.mine[n.field]])
158
195
  )
159
196
  )
160
197
  },
161
- fieldLabel: (t) => {
162
- for (const o of a)
163
- for (const n of o.conflicts)
164
- if (b(o, n.field) === t) return `${o.label} · ${p(n.field)}`;
165
- return t;
198
+ formatValue: (o, n) => N(w(o), n),
199
+ fieldLabel: (o) => {
200
+ for (const n of s)
201
+ for (const f of n.conflicts)
202
+ if (M(n, f.field) === o) return `${n.label} · ${k(f.field)}`;
203
+ return o;
166
204
  },
167
- onCancel: c,
168
- onResolve: m
205
+ onCancel: b,
206
+ onResolve: i,
207
+ topSlot: /* @__PURE__ */ r(J, { mode: S, onMode: C }),
208
+ replaceBody: S === "merge" ? /* @__PURE__ */ r(
209
+ R,
210
+ {
211
+ lines: s,
212
+ label: k,
213
+ formatValue: N,
214
+ hideField: g,
215
+ cancelLabel: v,
216
+ onCancel: b,
217
+ onResolve: i
218
+ }
219
+ ) : void 0
169
220
  }
170
221
  );
171
222
  }
223
+ function J({
224
+ mode: s,
225
+ onMode: m
226
+ }) {
227
+ const b = (i, y) => /* @__PURE__ */ r(
228
+ "button",
229
+ {
230
+ type: "button",
231
+ "aria-pressed": s === i,
232
+ "data-resolve-mode": i,
233
+ onClick: () => m(i),
234
+ className: s === i ? "h-7 rounded-md bg-white px-3 text-[12px] font-medium text-slate-900 shadow-sm dark:bg-card dark:text-foreground" : "h-7 rounded-md px-3 text-[12px] text-slate-500 hover:text-slate-800 dark:text-muted-foreground dark:hover:text-foreground",
235
+ children: y
236
+ }
237
+ );
238
+ return /* @__PURE__ */ a("fieldset", { className: "m-0 mt-3 inline-flex min-w-0 gap-1 rounded-lg border-0 bg-slate-100 p-1 dark:bg-muted", children: [
239
+ /* @__PURE__ */ r("legend", { className: "sr-only", children: "How to settle it" }),
240
+ b("pick", "Theirs or mine"),
241
+ b("merge", "Merge")
242
+ ] });
243
+ }
244
+ function R({
245
+ lines: s,
246
+ label: m,
247
+ formatValue: b,
248
+ hideField: i,
249
+ cancelLabel: y,
250
+ onCancel: v,
251
+ onResolve: N
252
+ }) {
253
+ const [g, S] = $(() => /* @__PURE__ */ new Map()), C = s.map((d) => ({ line: d, fields: z(d) })), k = C.flatMap((d) => d.fields), w = k.filter((d) => d.kind === "conflict" && !g.has(d.key)).length, o = A(k, g), n = (d, p) => {
254
+ if (p == null || p === "") return "—";
255
+ const t = b(d, p);
256
+ if (t != null) return t;
257
+ if (typeof p == "object") return "—";
258
+ const l = String(p), c = /<[a-z][^>]*>/i.test(l) ? P(l) : l;
259
+ return c.trim() ? c.slice(0, 120) : "—";
260
+ }, f = (d, p) => S((t) => new Map(t).set(d, p));
261
+ return /* @__PURE__ */ a(j, { children: [
262
+ /* @__PURE__ */ r("div", { className: "mt-3 max-h-[360px] space-y-3 overflow-y-auto", "data-merge-view": "", children: C.map(({ line: d, fields: p }) => {
263
+ const t = new Set(d.conflicts.map((e) => e.field)), l = new Set((d.derived ?? []).map((e) => e.field)), c = Object.keys(d.edit ?? {}).filter(
264
+ (e) => !t.has(e) && !l.has(e) && e !== "id" && !e.startsWith("_") && !(i != null && i(d, e))
265
+ ), u = K(d, g), x = B(d, (e) => !!(i != null && i(d, e)));
266
+ return /* @__PURE__ */ a(
267
+ "div",
268
+ {
269
+ className: "rounded-md border border-slate-200 p-2.5 dark:border-border",
270
+ children: [
271
+ /* @__PURE__ */ r("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-foreground", children: d.label }),
272
+ /* @__PURE__ */ a("ul", { className: "mt-1 space-y-0.5 text-[12px] text-slate-600 dark:text-muted-foreground", children: [
273
+ c.map((e) => {
274
+ var h;
275
+ return /* @__PURE__ */ a("li", { children: [
276
+ m(e),
277
+ ": yours (",
278
+ n(e, (h = d.edit) == null ? void 0 : h[e]),
279
+ ") — only you changed it"
280
+ ] }, `m:${e}`);
281
+ }),
282
+ p.filter((e) => e.kind === "same").map((e) => /* @__PURE__ */ a("li", { children: [
283
+ m(e.field),
284
+ ": you both set ",
285
+ n(e.field, e.theirs)
286
+ ] }, `s:${e.key}`)),
287
+ p.filter((e) => e.kind === "derived").map((e) => /* @__PURE__ */ a("li", { children: [
288
+ m(e.field),
289
+ ": worked out again from the merged values"
290
+ ] }, `d:${e.key}`)),
291
+ /* @__PURE__ */ r("li", { children: "Anything else they changed stays as they saved it." })
292
+ ] }),
293
+ p.filter((e) => e.kind === "conflict").map((e) => {
294
+ const h = g.get(e.key), T = `nvr-merge-${d.rowId}-${e.field}`;
295
+ return /* @__PURE__ */ a("div", { className: "mt-2", children: [
296
+ /* @__PURE__ */ a(
297
+ "p",
298
+ {
299
+ id: T,
300
+ className: "text-[12px] font-medium text-amber-700 dark:text-amber-300",
301
+ children: [
302
+ m(e.field),
303
+ " — you both changed it. Pick one:"
304
+ ]
305
+ }
306
+ ),
307
+ /* @__PURE__ */ a(
308
+ "fieldset",
309
+ {
310
+ "aria-labelledby": T,
311
+ className: "m-0 mt-1 grid min-w-0 grid-cols-2 gap-2 border-0 p-0",
312
+ children: [
313
+ /* @__PURE__ */ a(
314
+ "button",
315
+ {
316
+ type: "button",
317
+ "aria-pressed": h === "theirs",
318
+ "data-merge-pick": "theirs",
319
+ onClick: () => f(e.key, "theirs"),
320
+ className: h === "theirs" ? "rounded-md border-2 border-nvr-cyan/60 bg-nvr-cyan/5 px-2.5 py-1.5 text-left" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
321
+ children: [
322
+ /* @__PURE__ */ r("span", { className: "block text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "Theirs" }),
323
+ /* @__PURE__ */ r("span", { className: "mt-0.5 block text-[12px] text-slate-700 dark:text-foreground", children: n(e.field, e.theirs) })
324
+ ]
325
+ }
326
+ ),
327
+ /* @__PURE__ */ a(
328
+ "button",
329
+ {
330
+ type: "button",
331
+ "aria-pressed": h === "mine",
332
+ "data-merge-pick": "mine",
333
+ onClick: () => f(e.key, "mine"),
334
+ className: h === "mine" ? "rounded-md border-2 border-amber-400/70 bg-amber-50 px-2.5 py-1.5 text-left dark:bg-amber-400/10" : "rounded-md border border-slate-200 px-2.5 py-1.5 text-left hover:border-slate-300 dark:border-border",
335
+ children: [
336
+ /* @__PURE__ */ r("span", { className: "block text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "Mine" }),
337
+ /* @__PURE__ */ r("span", { className: "mt-0.5 block text-[12px] text-slate-700 dark:text-foreground", children: n(e.field, e.mine) })
338
+ ]
339
+ }
340
+ )
341
+ ]
342
+ }
343
+ )
344
+ ] }, e.key);
345
+ }),
346
+ x.length > 0 && /* @__PURE__ */ a(
347
+ "div",
348
+ {
349
+ className: "mt-2 rounded-md bg-slate-50 px-2.5 py-1.5 dark:bg-muted/40",
350
+ "data-merge-preview": "",
351
+ children: [
352
+ /* @__PURE__ */ r("p", { className: "text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "After the merge" }),
353
+ /* @__PURE__ */ r("p", { className: "mt-0.5 text-[12px] text-slate-700 dark:text-foreground", children: x.map((e) => `${m(e)} ${n(e, u[e])}`).join(" · ") })
354
+ ]
355
+ }
356
+ )
357
+ ]
358
+ },
359
+ `${d.key}:${d.rowId}`
360
+ );
361
+ }) }),
362
+ /* @__PURE__ */ a("div", { className: "mt-4 flex flex-wrap items-center justify-end gap-2", children: [
363
+ !o && /* @__PURE__ */ a(
364
+ "p",
365
+ {
366
+ className: "mr-auto text-[12px] text-slate-500 dark:text-muted-foreground",
367
+ role: "status",
368
+ children: [
369
+ "Pick a value for ",
370
+ w,
371
+ " ",
372
+ w === 1 ? "field" : "fields",
373
+ " to save."
374
+ ]
375
+ }
376
+ ),
377
+ /* @__PURE__ */ r(
378
+ "button",
379
+ {
380
+ type: "button",
381
+ onClick: v,
382
+ className: "h-8 rounded-md border border-slate-200 px-3 text-[12.5px] text-slate-600 dark:border-border dark:text-muted-foreground",
383
+ children: y
384
+ }
385
+ ),
386
+ /* @__PURE__ */ r(
387
+ "button",
388
+ {
389
+ type: "button",
390
+ disabled: !o,
391
+ onClick: () => N(E(k, g)),
392
+ className: "h-8 rounded-md bg-nvr-cyan px-4 text-[12.5px] font-medium text-white disabled:cursor-not-allowed disabled:opacity-50",
393
+ children: "Save merged"
394
+ }
395
+ )
396
+ ] })
397
+ ] });
398
+ }
172
399
  export {
173
- _ as LineCollisionDialog,
174
- C as MidairCollisionDialog
400
+ Y as LineCollisionDialog,
401
+ H as MidairCollisionDialog
175
402
  };