@nivaro/react 0.3.50 → 0.3.52

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 (29) hide show
  1. package/dist/hooks/useSessionRecorder.js +1 -1
  2. package/dist/index.d.ts +13 -3
  3. package/dist/shared/components/ItemEditForm.js +4801 -4666
  4. package/dist/shared/components/QueryTable.js +337 -324
  5. package/dist/shared/components/ReportView.js +105 -99
  6. package/dist/shared/components/alerts/AlertManagerView.js +327 -301
  7. package/dist/shared/components/item-edit/CatalogPickerField.js +1149 -1111
  8. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +58 -53
  9. package/dist/shared/components/item-edit/FieldRenderer.js +227 -223
  10. package/dist/shared/components/item-edit/FieldRow.js +287 -265
  11. package/dist/shared/components/item-edit/FilePickerField.js +315 -307
  12. package/dist/shared/components/item-edit/InlineTableField.js +491 -466
  13. package/dist/shared/components/item-edit/RecordHeaderActions.js +76 -75
  14. package/dist/shared/components/item-edit/RecordLiveSync.js +93 -91
  15. package/dist/shared/components/item-edit/RelationCombobox.js +62 -60
  16. package/dist/shared/components/item-edit/SummaryPanel.js +287 -277
  17. package/dist/shared/components/item-edit/UserChip.js +233 -200
  18. package/dist/shared/components/item-edit/header-midair.js +51 -0
  19. package/dist/shared/components/item-edit/line-midair.js +76 -70
  20. package/dist/shared/components/panels/CommentPanel.js +290 -284
  21. package/dist/shared/components/panels/ItemLockBanner.js +30 -30
  22. package/dist/shared/components/panels/PipelinePanel.js +956 -901
  23. package/dist/shared/components/panels/TaskPanel.js +71 -61
  24. package/dist/shared/components/panels/TransitionRequirementsDialog.js +569 -439
  25. package/dist/shared/components/panels/requirement-side-effects.js +40 -0
  26. package/dist/shared/components/queue/QueueWorklist.js +141 -130
  27. package/dist/shared/lib/draft-store.js +48 -34
  28. package/dist/shared/lib/query-stats.js +60 -60
  29. package/package.json +1 -1
@@ -1,231 +1,231 @@
1
- import { jsx as n, jsxs as y } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as p } from "react/jsx-runtime";
2
2
  import { useQuery as E } from "@tanstack/react-query";
3
- import { Check as me, Copy as ue, ChevronRight as fe, Loader2 as ye } from "lucide-react";
4
- import { useState as Q, useRef as pe, createContext as he, useContext as xe } from "react";
3
+ import { Check as ue, Copy as fe, ChevronRight as ye, Loader2 as pe } from "lucide-react";
4
+ import { useState as Q, useRef as he, createContext as xe, useContext as be } from "react";
5
5
  import { useNivaroClient as U } from "../../context.js";
6
6
  import { get as K } from "../../lib/commands.js";
7
- import { useRecordReader as be } from "../../lib/record-loader.js";
8
- import { cn as M, titleCase as z, toLocalDateString as ge } from "../../lib/utils.js";
9
- import { useChangePulse as _e } from "./GroupSection.js";
10
- import { SYSTEM_FIELDS as ke, SENTINEL_FIELDS as Ne, applyDisplayTemplate as ne, parseJson as Se, richTextToPlain as Z } from "./helpers.js";
11
- import { RelatedItemLabel as le } from "./RelationCombobox.js";
12
- const ae = he({});
13
- function we(e, t) {
7
+ import { useRecordReader as ge } from "../../lib/record-loader.js";
8
+ import { cn as M, titleCase as z, toLocalDateString as _e, choiceLabel as ke } from "../../lib/utils.js";
9
+ import { useChangePulse as Ne } from "./GroupSection.js";
10
+ import { SYSTEM_FIELDS as Se, SENTINEL_FIELDS as we, applyDisplayTemplate as ne, parseJson as le, richTextToPlain as Z } from "./helpers.js";
11
+ import { RelatedItemLabel as ae } from "./RelationCombobox.js";
12
+ const re = xe({});
13
+ function qe(e, t) {
14
14
  return t ? Object.entries(t).every(
15
- ([a, r]) => r !== null && typeof r == "object" || String(e[a] ?? "") === String(r ?? "")
15
+ ([n, a]) => a !== null && typeof a == "object" || String(e[n] ?? "") === String(a ?? "")
16
16
  ) : !0;
17
17
  }
18
- function qe({
18
+ function Te({
19
19
  relation: e,
20
20
  parentId: t,
21
- allRelations: a,
22
- staging: r,
23
- maxValues: g
21
+ allRelations: n,
22
+ staging: a,
23
+ maxValues: h
24
24
  }) {
25
- var x, w, J;
26
- const p = U(), d = e.many_field ?? "", u = e.junction_field ?? (() => {
27
- const l = a.find(
25
+ var b, w, J;
26
+ const y = U(), c = e.many_field ?? "", u = e.junction_field ?? (() => {
27
+ const r = n.find(
28
28
  ($) => $.many_collection === e.many_collection && $.id !== e.id
29
29
  );
30
- return (l == null ? void 0 : l.many_field) ?? "";
31
- })(), h = e.one_field ?? `${e.many_collection}.${u}`, _ = ((x = a.find(
32
- (l) => l.many_collection === e.many_collection && l.many_field === u && l.id !== e.id
33
- )) == null ? void 0 : x.one_collection) ?? null, { data: i } = E({
30
+ return (r == null ? void 0 : r.many_field) ?? "";
31
+ })(), x = e.one_field ?? `${e.many_collection}.${u}`, _ = ((b = n.find(
32
+ (r) => r.many_collection === e.many_collection && r.many_field === u && r.id !== e.id
33
+ )) == null ? void 0 : b.one_collection) ?? null, { data: k } = E({
34
34
  queryKey: ["summary-junction-relations", e.many_collection],
35
- queryFn: () => p.request(
35
+ queryFn: () => y.request(
36
36
  K(`/data-model/relations/for/${e.many_collection}`)
37
- ).then((l) => l.data ?? []).catch(() => []),
37
+ ).then((r) => r.data ?? []).catch(() => []),
38
38
  enabled: !_ && !!e.many_collection && !!u,
39
39
  staleTime: 10 * 6e4
40
- }), o = _ ?? ((w = i == null ? void 0 : i.find(
41
- (l) => l.many_collection === e.many_collection && l.many_field === u && !!l.one_collection
42
- )) == null ? void 0 : w.one_collection) ?? null, { data: c = [] } = E({
43
- queryKey: ["m2m-items", e.many_collection, d, t],
44
- queryFn: () => p.request(
40
+ }), s = _ ?? ((w = k == null ? void 0 : k.find(
41
+ (r) => r.many_collection === e.many_collection && r.many_field === u && !!r.one_collection
42
+ )) == null ? void 0 : w.one_collection) ?? null, { data: o = [] } = E({
43
+ queryKey: ["m2m-items", e.many_collection, c, t],
44
+ queryFn: () => y.request(
45
45
  K(`/items/${e.many_collection}`, {
46
- filter: JSON.stringify({ [d]: { _eq: t } }),
46
+ filter: JSON.stringify({ [c]: { _eq: t } }),
47
47
  limit: 200,
48
48
  fields: `id,${u}`
49
49
  })
50
- ).then((l) => l.data ?? []),
50
+ ).then((r) => r.data ?? []),
51
51
  staleTime: 3e4,
52
52
  enabled: !!t && t !== "new"
53
- }), b = o ? null : ((J = [...a, ...i ?? []].find(
54
- (l) => l.many_collection === e.many_collection && l.many_field === u && !!l.one_collection_field
55
- )) == null ? void 0 : J.one_collection_field) ?? null, { data: k = [] } = E({
56
- queryKey: ["summary-m2a-items", e.many_collection, d, t, b],
57
- queryFn: () => p.request(
53
+ }), d = s ? null : ((J = [...n, ...k ?? []].find(
54
+ (r) => r.many_collection === e.many_collection && r.many_field === u && !!r.one_collection_field
55
+ )) == null ? void 0 : J.one_collection_field) ?? null, { data: g = [] } = E({
56
+ queryKey: ["summary-m2a-items", e.many_collection, c, t, d],
57
+ queryFn: () => y.request(
58
58
  K(`/items/${e.many_collection}`, {
59
- filter: JSON.stringify({ [d]: { _eq: t } }),
59
+ filter: JSON.stringify({ [c]: { _eq: t } }),
60
60
  limit: 200,
61
- fields: `id,${u},${b}`
61
+ fields: `id,${u},${d}`
62
62
  })
63
- ).then((l) => l.data ?? []),
63
+ ).then((r) => r.data ?? []),
64
64
  staleTime: 3e4,
65
- enabled: !!b && !!t && t !== "new"
66
- }), D = o === "nivaro_files" || o === "directus_files", { data: N } = E({
67
- queryKey: ["col-meta", o],
68
- queryFn: () => p.request(K(`/collections/${o}`)).then((l) => l.data),
69
- enabled: !!o && !D,
65
+ enabled: !!d && !!t && t !== "new"
66
+ }), D = s === "nivaro_files" || s === "directus_files", { data: N } = E({
67
+ queryKey: ["col-meta", s],
68
+ queryFn: () => y.request(K(`/collections/${s}`)).then((r) => r.data),
69
+ enabled: !!s && !D,
70
70
  staleTime: 3e5
71
- }), C = (r == null ? void 0 : r.getStagedLinks(h)) ?? [], L = (r == null ? void 0 : r.getStagedUnlinks(h)) ?? /* @__PURE__ */ new Set(), R = c.filter((l) => !L.has(l.id)), S = [
71
+ }), C = (a == null ? void 0 : a.getStagedLinks(x)) ?? [], L = (a == null ? void 0 : a.getStagedUnlinks(x)) ?? /* @__PURE__ */ new Set(), R = o.filter((r) => !L.has(r.id)), S = [
72
72
  ...C,
73
- ...R.map((l) => l[u]).filter((l) => l != null)
73
+ ...R.map((r) => r[u]).filter((r) => r != null)
74
74
  ];
75
75
  if (S.length === 0)
76
- return /* @__PURE__ */ n("span", { className: "text-slate-400 dark:text-slate-500", children: "—" });
77
- if (o) {
76
+ return /* @__PURE__ */ l("span", { className: "text-slate-400 dark:text-slate-500", children: "—" });
77
+ if (s) {
78
78
  const $ = S.slice(0, 5), j = S.length - 5;
79
- return /* @__PURE__ */ y("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: [
80
- $.map((s, v) => /* @__PURE__ */ y("span", { children: [
79
+ return /* @__PURE__ */ p("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: [
80
+ $.map((i, v) => /* @__PURE__ */ p("span", { children: [
81
81
  v > 0 && ", ",
82
- /* @__PURE__ */ n(
83
- le,
82
+ /* @__PURE__ */ l(
83
+ ae,
84
84
  {
85
- collection: o,
86
- id: s,
85
+ collection: s,
86
+ id: i,
87
87
  displayTemplate: N == null ? void 0 : N.display_template
88
88
  }
89
89
  )
90
- ] }, String(s))),
91
- j > 0 && /* @__PURE__ */ y("span", { className: "text-slate-400 dark:text-slate-500", children: [
90
+ ] }, String(i))),
91
+ j > 0 && /* @__PURE__ */ p("span", { className: "text-slate-400 dark:text-slate-500", children: [
92
92
  " +",
93
93
  j,
94
94
  " more"
95
95
  ] })
96
96
  ] });
97
97
  }
98
- const m = b ? k.filter((l) => !L.has(l.id) && l[u] != null && l[b]).slice(0, 5) : [];
98
+ const m = d ? g.filter((r) => !L.has(r.id) && r[u] != null && r[d]).slice(0, 5) : [];
99
99
  if (m.length > 0 && C.length === 0) {
100
- const l = S.length - m.length;
101
- return /* @__PURE__ */ y("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: [
102
- m.map(($, j) => /* @__PURE__ */ y("span", { children: [
100
+ const r = S.length - m.length;
101
+ return /* @__PURE__ */ p("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: [
102
+ m.map(($, j) => /* @__PURE__ */ p("span", { children: [
103
103
  j > 0 && ", ",
104
- /* @__PURE__ */ n(
105
- se,
104
+ /* @__PURE__ */ l(
105
+ ie,
106
106
  {
107
- collection: Te(String($[b])),
107
+ collection: $e(String($[d])),
108
108
  id: $[u]
109
109
  }
110
110
  )
111
111
  ] }, String($.id))),
112
- l > 0 && /* @__PURE__ */ y("span", { className: "text-slate-400 dark:text-slate-500", children: [
112
+ r > 0 && /* @__PURE__ */ p("span", { className: "text-slate-400 dark:text-slate-500", children: [
113
113
  " +",
114
- l,
114
+ r,
115
115
  " more"
116
116
  ] })
117
117
  ] });
118
118
  }
119
- return /* @__PURE__ */ y("span", { className: "text-slate-700 dark:text-slate-200", children: [
119
+ return /* @__PURE__ */ p("span", { className: "text-slate-700 dark:text-slate-200", children: [
120
120
  S.length,
121
121
  " item",
122
122
  S.length !== 1 ? "s" : ""
123
123
  ] });
124
124
  }
125
- function Te(e) {
125
+ function $e(e) {
126
126
  return e === "directus_users" ? "nivaro_users" : e;
127
127
  }
128
- function re(e) {
128
+ function se(e) {
129
129
  const t = U();
130
130
  return E({
131
131
  queryKey: ["summary-display-template", e],
132
- queryFn: () => t.request(K(`/collections/${e}`)).then((a) => {
133
- var r;
134
- return ((r = a.data) == null ? void 0 : r.display_template) ?? null;
132
+ queryFn: () => t.request(K(`/collections/${e}`)).then((n) => {
133
+ var a;
134
+ return ((a = n.data) == null ? void 0 : a.display_template) ?? null;
135
135
  }).catch(() => null),
136
136
  enabled: !!e,
137
137
  staleTime: 10 * 6e4
138
138
  }).data;
139
139
  }
140
- function se({ collection: e, id: t }) {
141
- const a = re(e);
142
- return /* @__PURE__ */ n(le, { collection: e, id: t, displayTemplate: a ?? void 0 });
140
+ function ie({ collection: e, id: t }) {
141
+ const n = se(e);
142
+ return /* @__PURE__ */ l(ae, { collection: e, id: t, displayTemplate: n ?? void 0 });
143
143
  }
144
- const $e = ["name", "title", "label", "subject", "description", "line_number"], ve = ["amount", "total", "cost", "price", "quantity"], V = 4, X = 200;
145
- function Ce(e, t) {
144
+ const ve = ["name", "title", "label", "subject", "description", "line_number"], Ce = ["amount", "total", "cost", "price", "quantity"], V = 4, X = 200;
145
+ function je(e, t) {
146
146
  if (t) {
147
- const a = ne(t, e).replace(/\s*[·|\-–—/]\s*(?=[·|\-–—/]|$)/g, "").replace(/^\s*[·|\-–—/]\s*/, "").trim();
148
- if (a !== "") return a;
147
+ const n = ne(t, e).replace(/\s*[·|\-–—/]\s*(?=[·|\-–—/]|$)/g, "").replace(/^\s*[·|\-–—/]\s*/, "").trim();
148
+ if (n !== "") return n;
149
149
  }
150
- for (const a of $e) {
151
- const r = e[a];
152
- if (r != null && String(r).trim() !== "") return String(r).trim();
150
+ for (const n of ve) {
151
+ const a = e[n];
152
+ if (a != null && String(a).trim() !== "") return String(a).trim();
153
153
  }
154
154
  return `#${String(e.id ?? "")}`;
155
155
  }
156
- function ie({
156
+ function oe({
157
157
  relatedCollection: e,
158
158
  manyField: t,
159
- parentId: a,
160
- rowFilter: r,
161
- expanded: g
159
+ parentId: n,
160
+ rowFilter: a,
161
+ expanded: h
162
162
  }) {
163
163
  var R, S;
164
- const p = U(), d = xe(ae), u = r && Object.keys(r).length > 0 ? {
164
+ const y = U(), c = be(re), u = a && Object.keys(a).length > 0 ? {
165
165
  _and: [
166
- { [t]: { _eq: a } },
166
+ { [t]: { _eq: n } },
167
167
  Object.fromEntries(
168
- Object.entries(r).map(([m, x]) => [
168
+ Object.entries(a).map(([m, b]) => [
169
169
  m,
170
- x !== null && typeof x == "object" ? x : { _eq: x }
170
+ b !== null && typeof b == "object" ? b : { _eq: b }
171
171
  ])
172
172
  )
173
173
  ]
174
- } : { [t]: { _eq: a } }, { data: h, isLoading: _ } = E({
174
+ } : { [t]: { _eq: n } }, { data: x, isLoading: _ } = E({
175
175
  queryKey: [
176
176
  "o2m-rows",
177
177
  e,
178
178
  t,
179
- a,
180
- r ? JSON.stringify(r) : ""
179
+ n,
180
+ a ? JSON.stringify(a) : ""
181
181
  ],
182
- queryFn: () => p.request(
182
+ queryFn: () => y.request(
183
183
  K(`/items/${e}`, {
184
184
  filter: JSON.stringify(u),
185
185
  limit: X
186
186
  })
187
187
  ).then((m) => m.data ?? []),
188
- enabled: !!a && a !== "new",
188
+ enabled: !!n && n !== "new",
189
189
  staleTime: 3e4
190
- }), i = re(e), o = `${e}.${t}`, c = (R = d.deletes) == null ? void 0 : R.get(o), b = (((S = d.rows) == null ? void 0 : S.get(o)) ?? []).filter(
191
- (m) => we(m, r)
192
- ), k = [
193
- ...(h ?? []).filter((m) => !(c != null && c.has(String(m.id)))),
194
- ...b
190
+ }), k = se(e), s = `${e}.${t}`, o = (R = c.deletes) == null ? void 0 : R.get(s), d = (((S = c.rows) == null ? void 0 : S.get(s)) ?? []).filter(
191
+ (m) => qe(m, a)
192
+ ), g = [
193
+ ...(x ?? []).filter((m) => !(o != null && o.has(String(m.id)))),
194
+ ...d
195
195
  ];
196
- if (_ && b.length === 0)
197
- return /* @__PURE__ */ n(ye, { className: "h-3 w-3 animate-spin text-slate-400 dark:text-slate-500" });
198
- if (k.length === 0)
199
- return /* @__PURE__ */ n("span", { className: "italic text-[11px] text-slate-400 dark:text-slate-500", children: "None yet" });
200
- const D = ((h == null ? void 0 : h.length) ?? 0) >= X, N = ve.find(
201
- (m) => k.some(
202
- (x) => typeof x[m] == "number" || typeof x[m] == "string" && x[m] !== "" && !Number.isNaN(Number(x[m]))
196
+ if (_ && d.length === 0)
197
+ return /* @__PURE__ */ l(pe, { className: "h-3 w-3 animate-spin text-slate-400 dark:text-slate-500" });
198
+ if (g.length === 0)
199
+ return /* @__PURE__ */ l("span", { className: "italic text-[11px] text-slate-400 dark:text-slate-500", children: "None yet" });
200
+ const D = ((x == null ? void 0 : x.length) ?? 0) >= X, N = Ce.find(
201
+ (m) => g.some(
202
+ (b) => typeof b[m] == "number" || typeof b[m] == "string" && b[m] !== "" && !Number.isNaN(Number(b[m]))
203
203
  )
204
- ), C = N && !D ? k.reduce((m, x) => {
205
- const w = Number(x[N]);
204
+ ), C = N && !D ? g.reduce((m, b) => {
205
+ const w = Number(b[N]);
206
206
  return m + (Number.isFinite(w) ? w : 0);
207
207
  }, 0) : null, L = N ? N !== "quantity" : !1;
208
- return /* @__PURE__ */ y("span", { className: "block", children: [
209
- /* @__PURE__ */ y("span", { className: "flex items-baseline gap-2", children: [
210
- /* @__PURE__ */ y("span", { className: "text-slate-700 dark:text-slate-200", children: [
211
- D ? `${X}+` : k.length,
208
+ return /* @__PURE__ */ p("span", { className: "block", children: [
209
+ /* @__PURE__ */ p("span", { className: "flex items-baseline gap-2", children: [
210
+ /* @__PURE__ */ p("span", { className: "text-slate-700 dark:text-slate-200", children: [
211
+ D ? `${X}+` : g.length,
212
212
  " row",
213
- k.length !== 1 ? "s" : ""
213
+ g.length !== 1 ? "s" : ""
214
214
  ] }),
215
- C !== null && /* @__PURE__ */ n("span", { className: "tabular-nums text-[11px] text-slate-500 dark:text-slate-400", children: L ? C.toLocaleString(void 0, {
215
+ C !== null && /* @__PURE__ */ l("span", { className: "tabular-nums text-[11px] text-slate-500 dark:text-slate-400", children: L ? C.toLocaleString(void 0, {
216
216
  style: "currency",
217
217
  currency: "USD",
218
218
  maximumFractionDigits: C % 1 === 0 ? 0 : 2
219
219
  }) : C.toLocaleString() })
220
220
  ] }),
221
- /* @__PURE__ */ y("span", { className: "mt-1 block space-y-0.5", children: [
222
- (g ? k : k.slice(0, V)).map((m, x) => /* @__PURE__ */ y(
221
+ /* @__PURE__ */ p("span", { className: "mt-1 block space-y-0.5", children: [
222
+ (h ? g : g.slice(0, V)).map((m, b) => /* @__PURE__ */ p(
223
223
  "span",
224
224
  {
225
225
  className: "flex items-baseline justify-between gap-2 text-[11px] text-slate-500 dark:text-slate-400",
226
226
  children: [
227
- /* @__PURE__ */ n("span", { className: "truncate", children: Ce(m, i ?? null) }),
228
- N && m[N] !== null && m[N] !== void 0 && /* @__PURE__ */ n("span", { className: "shrink-0 tabular-nums", children: (() => {
227
+ /* @__PURE__ */ l("span", { className: "truncate", children: je(m, k ?? null) }),
228
+ N && m[N] !== null && m[N] !== void 0 && /* @__PURE__ */ l("span", { className: "shrink-0 tabular-nums", children: (() => {
229
229
  const w = Number(m[N]);
230
230
  return Number.isFinite(w) ? L ? w.toLocaleString(void 0, {
231
231
  style: "currency",
@@ -235,34 +235,34 @@ function ie({
235
235
  })() })
236
236
  ]
237
237
  },
238
- String(m.id ?? x)
238
+ String(m.id ?? b)
239
239
  )),
240
- !g && k.length > V && /* @__PURE__ */ y("span", { className: "block text-[11px] italic text-slate-400 dark:text-slate-500", children: [
240
+ !h && g.length > V && /* @__PURE__ */ p("span", { className: "block text-[11px] italic text-slate-400 dark:text-slate-500", children: [
241
241
  "+",
242
- D ? `${k.length - V}+` : k.length - V,
242
+ D ? `${g.length - V}+` : g.length - V,
243
243
  " more"
244
244
  ] })
245
245
  ] })
246
246
  ] });
247
247
  }
248
- function je(e) {
249
- const t = _e(e.val);
250
- return /* @__PURE__ */ n("span", { className: M("inline-block max-w-full rounded-sm", t && "nvr-value-pulse-bg"), children: /* @__PURE__ */ n(Le, { ...e }) });
248
+ function Le(e) {
249
+ const t = Ne(e.val);
250
+ return /* @__PURE__ */ l("span", { className: M("inline-block max-w-full rounded-sm", t && "nvr-value-pulse-bg"), children: /* @__PURE__ */ l(Oe, { ...e }) });
251
251
  }
252
- function Le({
252
+ function Oe({
253
253
  field: e,
254
254
  val: t,
255
- relations: a,
256
- collection: r,
257
- itemId: g,
258
- staging: p
255
+ relations: n,
256
+ collection: a,
257
+ itemId: h,
258
+ staging: y
259
259
  }) {
260
- const d = e.interface ?? "", u = /* @__PURE__ */ new Set(["select-multiple-m2m", "files-m2m", "files", "relation-grouped"]);
261
- if (!u.has(d) && g) {
262
- const i = a.find(
263
- (o) => !o.junction_field && (o.one_field === e.field || o.many_collection === e.field) && (o.one_collection === r || o.one_collection == null)
260
+ const c = e.interface ?? "", u = /* @__PURE__ */ new Set(["select-multiple-m2m", "files-m2m", "files", "relation-grouped"]);
261
+ if (!u.has(c) && h) {
262
+ const s = n.find(
263
+ (o) => !o.junction_field && (o.one_field === e.field || o.many_collection === e.field) && (o.one_collection === a || o.one_collection == null)
264
264
  );
265
- if (i != null && i.many_collection && i.many_field) {
265
+ if (s != null && s.many_collection && s.many_field) {
266
266
  const o = (() => {
267
267
  try {
268
268
  return typeof e.options == "string" ? JSON.parse(e.options) : e.options ?? {};
@@ -270,76 +270,85 @@ function Le({
270
270
  return {};
271
271
  }
272
272
  })();
273
- return /* @__PURE__ */ n(
274
- ie,
273
+ return /* @__PURE__ */ l(
274
+ oe,
275
275
  {
276
- relatedCollection: i.many_collection,
277
- manyField: i.many_field,
278
- parentId: g,
276
+ relatedCollection: s.many_collection,
277
+ manyField: s.many_field,
278
+ parentId: h,
279
279
  rowFilter: o.row_filter && typeof o.row_filter == "object" ? o.row_filter : void 0
280
280
  }
281
281
  );
282
282
  }
283
283
  }
284
- if (u.has(d) && g) {
285
- const i = a.find(
286
- (c) => c.one_collection === r && (c.one_field === e.field || c.junction_field != null && c.many_collection === e.field)
287
- ), o = i ? i.junction_field ? i : (() => {
288
- const c = a.find(
289
- (b) => b.many_collection === i.many_collection && b.id !== i.id
284
+ if (u.has(c) && h) {
285
+ const s = n.find(
286
+ (d) => d.one_collection === a && (d.one_field === e.field || d.junction_field != null && d.many_collection === e.field)
287
+ ), o = s ? s.junction_field ? s : (() => {
288
+ const d = n.find(
289
+ (g) => g.many_collection === s.many_collection && g.id !== s.id
290
290
  );
291
- return c ? { ...i, junction_field: c.many_field } : null;
291
+ return d ? { ...s, junction_field: d.many_field } : null;
292
292
  })() : null;
293
293
  if (o) {
294
- const c = Se(e.options);
295
- return /* @__PURE__ */ n(
296
- qe,
294
+ const d = le(e.options);
295
+ return /* @__PURE__ */ l(
296
+ Te,
297
297
  {
298
298
  relation: o,
299
- parentId: g,
300
- allRelations: a,
301
- staging: p,
302
- maxValues: c == null ? void 0 : c.max_values
299
+ parentId: h,
300
+ allRelations: n,
301
+ staging: y,
302
+ maxValues: d == null ? void 0 : d.max_values
303
303
  }
304
304
  );
305
305
  }
306
306
  }
307
- const h = t == null || t === "";
308
- if (h && e.type === "boolean")
309
- return /* @__PURE__ */ n("span", { className: "text-slate-700 dark:text-slate-200", children: "No" });
310
- if (h) return /* @__PURE__ */ n("span", { className: "text-slate-400 dark:text-slate-500", children: "—" });
311
- if (d === "extension-editorjs" || d === "input-rich-text-html" || d === "rich_text" || d === "wysiwyg" || typeof t == "string") {
312
- const i = Me(t, d);
313
- if (i !== null)
314
- return /* @__PURE__ */ n("span", { className: "truncate text-slate-700 dark:text-slate-200", title: i, children: i || "—" });
307
+ const x = t == null || t === "";
308
+ if (x && e.type === "boolean")
309
+ return /* @__PURE__ */ l("span", { className: "text-slate-700 dark:text-slate-200", children: "No" });
310
+ if (x) return /* @__PURE__ */ l("span", { className: "text-slate-400 dark:text-slate-500", children: "—" });
311
+ if (c === "extension-editorjs" || c === "input-rich-text-html" || c === "rich_text" || c === "wysiwyg" || typeof t == "string") {
312
+ const s = De(t, c);
313
+ if (s !== null)
314
+ return /* @__PURE__ */ l("span", { className: "truncate text-slate-700 dark:text-slate-200", title: s, children: s || "—" });
315
315
  }
316
316
  if (typeof t == "boolean")
317
- return /* @__PURE__ */ n("span", { className: "text-slate-700 dark:text-slate-200", children: t ? "Yes" : "No" });
318
- const _ = a.find(
319
- (i) => i.many_collection === r && i.many_field === e.field && !i.junction_field
317
+ return /* @__PURE__ */ l("span", { className: "text-slate-700 dark:text-slate-200", children: t ? "Yes" : "No" });
318
+ const _ = n.find(
319
+ (s) => s.many_collection === a && s.many_field === e.field && !s.junction_field
320
320
  );
321
321
  if (_ != null && _.one_collection)
322
- return /* @__PURE__ */ n(se, { collection: _.one_collection, id: t });
322
+ return /* @__PURE__ */ l(ie, { collection: _.one_collection, id: t });
323
323
  if (e.type === "datetime" || e.type === "date")
324
324
  try {
325
- return /* @__PURE__ */ n("span", { className: "text-slate-700 dark:text-slate-200", children: ge(t) });
325
+ return /* @__PURE__ */ l("span", { className: "text-slate-700 dark:text-slate-200", children: _e(t) });
326
326
  } catch {
327
327
  }
328
- return /* @__PURE__ */ n("span", { className: "truncate text-slate-700 dark:text-slate-200", children: String(t) });
328
+ const k = Me(e.options, t);
329
+ return /* @__PURE__ */ l("span", { className: "truncate text-slate-700 dark:text-slate-200", children: k ?? String(t) });
329
330
  }
330
- const Oe = /* @__PURE__ */ new Set([
331
+ function Me(e, t) {
332
+ var h;
333
+ if (t == null || typeof t == "object") return null;
334
+ const n = le(
335
+ e
336
+ ), a = (h = n == null ? void 0 : n.choices) == null ? void 0 : h.find((y) => y && String(y.value) === String(t));
337
+ return (a == null ? void 0 : a.text) != null ? ke(a.text) : null;
338
+ }
339
+ const Ee = /* @__PURE__ */ new Set([
331
340
  "extension-editorjs",
332
341
  "input-rich-text-html",
333
342
  "rich_text",
334
343
  "wysiwyg"
335
344
  ]);
336
- function Me(e, t) {
345
+ function De(e, t) {
337
346
  if (typeof e != "string") return null;
338
- if (Oe.has(t)) return Z(e);
339
- const a = e.trim();
340
- return a.startsWith("{") && /"blocks"\s*:/.test(a) ? Z(e) : null;
347
+ if (Ee.has(t)) return Z(e);
348
+ const n = e.trim();
349
+ return n.startsWith("{") && /"blocks"\s*:/.test(n) ? Z(e) : null;
341
350
  }
342
- function Ee(e) {
351
+ function Re(e) {
343
352
  if (e == null || e === "") return "—";
344
353
  if (typeof e == "boolean") return e ? "Yes" : "No";
345
354
  const t = String(e);
@@ -354,121 +363,121 @@ const ee = (e) => {
354
363
  if (e == null || e === "") return "empty";
355
364
  if (typeof e == "boolean") return e ? "Yes" : "No";
356
365
  if (typeof e == "object") {
357
- const a = e.id;
358
- return a != null ? `#${String(a)}` : Array.isArray(e) ? `${e.length} items` : "a value";
366
+ const n = e.id;
367
+ return n != null ? `#${String(n)}` : Array.isArray(e) ? `${e.length} items` : "a value";
359
368
  }
360
369
  const t = String(e).replace(/<[^>]+>/g, "").trim();
361
370
  return t.length > 48 ? `${t.slice(0, 48)}…` : t;
362
371
  };
363
372
  function te(e, t) {
364
- const a = U(), r = be(), g = !!e && t != null && t !== "", { data: p } = E({
373
+ const n = U(), a = ge(), h = !!e && t != null && t !== "", { data: y } = E({
365
374
  queryKey: ["cbv-collection-meta", e],
366
- queryFn: () => a.request(K(`/collections/${e}`)).then((h) => h.data),
367
- enabled: g,
375
+ queryFn: () => n.request(K(`/collections/${e}`)).then((x) => x.data),
376
+ enabled: h,
368
377
  staleTime: 10 * 6e4,
369
378
  retry: !1
370
- }), { data: d } = E({
379
+ }), { data: c } = E({
371
380
  queryKey: ["rrv-related", e, String(t)],
372
- queryFn: () => r(e, t).catch(() => null),
373
- enabled: g && !!p,
381
+ queryFn: () => a(e, t).catch(() => null),
382
+ enabled: h && !!y,
374
383
  staleTime: 6e4,
375
384
  retry: !1
376
385
  });
377
- if (!g) return null;
378
- if (!d) return `#${String(t)}`;
379
- const u = ne(p == null ? void 0 : p.display_template, d).trim();
386
+ if (!h) return null;
387
+ if (!c) return `#${String(t)}`;
388
+ const u = ne(y == null ? void 0 : y.display_template, c).trim();
380
389
  if (u) return u;
381
- for (const h of ["name", "title", "label", "number", "email"]) if (d[h]) return String(d[h]);
390
+ for (const x of ["name", "title", "label", "number", "email"]) if (c[x]) return String(c[x]);
382
391
  return `#${String(t)}`;
383
392
  }
384
- function De({
393
+ function Ae({
385
394
  field: e,
386
395
  from: t,
387
- to: a,
388
- detail: r,
389
- relations: g,
390
- collection: p,
391
- onRevert: d
396
+ to: n,
397
+ detail: a,
398
+ relations: h,
399
+ collection: y,
400
+ onRevert: c
392
401
  }) {
393
- var o;
394
- const u = ((o = g.find(
395
- (c) => c.many_collection === p && c.many_field === e.field && !!c.one_collection
396
- )) == null ? void 0 : o.one_collection) ?? null, h = te(u, t), _ = te(u, a), i = r ? `Unsaved — ${r}` : `Unsaved — was ${h ?? ee(t)} → now ${_ ?? ee(a)}`;
397
- return d ? (
402
+ var s;
403
+ const u = ((s = h.find(
404
+ (o) => o.many_collection === y && o.many_field === e.field && !!o.one_collection
405
+ )) == null ? void 0 : s.one_collection) ?? null, x = te(u, t), _ = te(u, n), k = a ? `Unsaved — ${a}` : `Unsaved — was ${x ?? ee(t)} → now ${_ ?? ee(n)}`;
406
+ return c ? (
398
407
  // biome-ignore lint/a11y/useSemanticElements: nested inside the row's <button> — a real <button> is invalid there
399
- /* @__PURE__ */ n(
408
+ /* @__PURE__ */ l(
400
409
  "span",
401
410
  {
402
411
  role: "button",
403
412
  tabIndex: 0,
404
413
  "data-summary-changed": !0,
405
- "data-tip": `${i} · click to revert`,
414
+ "data-tip": `${k} · click to revert`,
406
415
  "aria-label": "Revert this change",
407
- onClick: (c) => {
408
- c.stopPropagation(), d();
416
+ onClick: (o) => {
417
+ o.stopPropagation(), c();
409
418
  },
410
- onKeyDown: (c) => {
411
- (c.key === "Enter" || c.key === " ") && (c.preventDefault(), c.stopPropagation(), d());
419
+ onKeyDown: (o) => {
420
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), o.stopPropagation(), c());
412
421
  },
413
422
  className: "group/dot inline-flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center rounded-full hover:bg-amber-100 dark:hover:bg-amber-500/20",
414
- children: /* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 ring-2 ring-amber-100 group-hover/dot:ring-amber-200 dark:ring-amber-500/30" })
423
+ children: /* @__PURE__ */ l("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 ring-2 ring-amber-100 group-hover/dot:ring-amber-200 dark:ring-amber-500/30" })
415
424
  }
416
425
  )
417
- ) : /* @__PURE__ */ n(
426
+ ) : /* @__PURE__ */ l(
418
427
  "span",
419
428
  {
420
429
  "data-summary-changed": !0,
421
- "data-tip": i,
430
+ "data-tip": k,
422
431
  className: "h-1.5 w-1.5 shrink-0 rounded-full bg-amber-400 ring-2 ring-amber-100 dark:ring-amber-500/30"
423
432
  }
424
433
  );
425
434
  }
426
- function Xe({
435
+ function Ge({
427
436
  allSteps: e,
428
437
  groupedMap: t,
429
- ungroupedFields: a,
430
- sectionGroups: r,
431
- draft: g,
432
- relations: p,
433
- collection: d,
438
+ ungroupedFields: n,
439
+ sectionGroups: a,
440
+ draft: h,
441
+ relations: y,
442
+ collection: c,
434
443
  itemId: u,
435
- staging: h,
444
+ staging: x,
436
445
  errors: _,
437
- staleFields: i,
438
- aliasEmptiness: o,
439
- layoutFields: c,
440
- changedFields: b,
441
- onRevertChange: k,
446
+ staleFields: k,
447
+ aliasEmptiness: s,
448
+ layoutFields: o,
449
+ changedFields: d,
450
+ onRevertChange: g,
442
451
  onFieldClick: D,
443
452
  stagedO2MRows: N,
444
453
  stagedO2MDeletes: C
445
454
  }) {
446
- const [L, R] = Q(null), [S, m] = Q(null), x = pe(/* @__PURE__ */ new Map()), l = [
447
- ...!e.some((s) => s.key === "__general__") && a.length > 0 ? [{ key: "__general__", label: "General" }] : [],
455
+ const [L, R] = Q(null), [S, m] = Q(null), b = he(/* @__PURE__ */ new Map()), r = [
456
+ ...!e.some((i) => i.key === "__general__") && n.length > 0 ? [{ key: "__general__", label: "General" }] : [],
448
457
  ...e
449
- ].map((s) => {
450
- const v = (s.key === "__general__" ? [...a, ...r.flatMap((q) => t[q.key] ?? [])] : t[s.key] ?? []).filter((q) => !q.hidden && !ke.has(q.field) && !Ne.has(q.field));
451
- return { step: s, fields: v };
452
- }).filter((s) => s.fields.length > 0), $ = new Set(l.flatMap((s) => s.fields.map((v) => v.field))), j = u && u !== "new" ? p.filter(
453
- (s) => !s.junction_field && s.many_field && s.many_collection && (s.one_collection === d || s.one_collection == null) && s.one_field != null && !$.has(s.one_field) && // Off-layout aliases stay out — the sidebar summarizes THIS layout.
454
- (!c || c.has(s.one_field))
458
+ ].map((i) => {
459
+ const v = (i.key === "__general__" ? [...n, ...a.flatMap((q) => t[q.key] ?? [])] : t[i.key] ?? []).filter((q) => !q.hidden && !Se.has(q.field) && !we.has(q.field));
460
+ return { step: i, fields: v };
461
+ }).filter((i) => i.fields.length > 0), $ = new Set(r.flatMap((i) => i.fields.map((v) => v.field))), j = u && u !== "new" ? y.filter(
462
+ (i) => !i.junction_field && i.many_field && i.many_collection && (i.one_collection === c || i.one_collection == null) && i.one_field != null && !$.has(i.one_field) && // Off-layout aliases stay out — the sidebar summarizes THIS layout.
463
+ (!o || o.has(i.one_field))
455
464
  ) : [];
456
- return l.length === 0 && j.length === 0 ? null : /* @__PURE__ */ n(ae.Provider, { value: { rows: N, deletes: C }, children: /* @__PURE__ */ y("div", { className: "overflow-hidden bg-white dark:bg-card", children: [
457
- /* @__PURE__ */ n("div", { className: "bg-slate-200 border-b border-slate-300 px-4 py-2.5 dark:bg-white/[0.1] dark:border-border", children: /* @__PURE__ */ n("span", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: "Summary" }) }),
458
- l.map(({ step: s, fields: v }, q) => /* @__PURE__ */ y("div", { children: [
459
- /* @__PURE__ */ n(
465
+ return r.length === 0 && j.length === 0 ? null : /* @__PURE__ */ l(re.Provider, { value: { rows: N, deletes: C }, children: /* @__PURE__ */ p("div", { className: "overflow-hidden bg-white dark:bg-card", children: [
466
+ /* @__PURE__ */ l("div", { className: "bg-slate-200 border-b border-slate-300 px-4 py-2.5 dark:bg-white/[0.1] dark:border-border", children: /* @__PURE__ */ l("span", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: "Summary" }) }),
467
+ r.map(({ step: i, fields: v }, q) => /* @__PURE__ */ p("div", { children: [
468
+ /* @__PURE__ */ l(
460
469
  "div",
461
470
  {
462
471
  className: M(
463
472
  "bg-slate-100 px-4 py-2 border-b border-slate-200 dark:bg-white/[0.06] dark:border-border/80",
464
473
  q > 0 && "border-t border-slate-200 dark:border-border/80"
465
474
  ),
466
- children: /* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: s.label })
475
+ children: /* @__PURE__ */ l("span", { className: "text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: i.label })
467
476
  }
468
477
  ),
469
478
  v.map((f, P) => {
470
- const T = g[f.field], O = f.label ?? z(f.field), A = !!(_ != null && _[f.field]), F = o == null ? void 0 : o[f.field], oe = F !== void 0 ? F === !0 : T == null || typeof T == "string" && T.trim() === "" || Array.isArray(T) && T.length === 0, ce = F === null, H = !!f.required && oe && !A && !ce, I = (i == null ? void 0 : i.has(f.field)) ?? !1;
471
- return /* @__PURE__ */ y(
479
+ const T = h[f.field], O = f.label ?? z(f.field), A = !!(_ != null && _[f.field]), F = s == null ? void 0 : s[f.field], ce = F !== void 0 ? F === !0 : T == null || typeof T == "string" && T.trim() === "" || Array.isArray(T) && T.length === 0, de = F === null, H = !!f.required && ce && !A && !de, I = (k == null ? void 0 : k.has(f.field)) ?? !1;
480
+ return /* @__PURE__ */ p(
472
481
  "div",
473
482
  {
474
483
  className: M(
@@ -477,17 +486,17 @@ function Xe({
477
486
  A ? "bg-red-50 dark:bg-red-900/10" : H || I ? "bg-amber-50/70 dark:bg-amber-900/10" : ""
478
487
  ),
479
488
  children: [
480
- /* @__PURE__ */ y(
489
+ /* @__PURE__ */ p(
481
490
  "button",
482
491
  {
483
492
  type: "button",
484
- onClick: () => D(s.key, f.field),
493
+ onClick: () => D(i.key, f.field),
485
494
  className: M(
486
495
  "flex flex-1 flex-col px-4 py-2 text-left transition-colors duration-150 min-w-0",
487
496
  A ? "hover:bg-red-50 dark:hover:bg-red-900/15" : "hover:bg-slate-50 dark:hover:bg-white/[0.03]"
488
497
  ),
489
498
  children: [
490
- /* @__PURE__ */ y(
499
+ /* @__PURE__ */ p(
491
500
  "span",
492
501
  {
493
502
  className: M(
@@ -495,21 +504,21 @@ function Xe({
495
504
  A ? "text-red-500 dark:text-red-400" : H || I ? "text-amber-700 dark:text-amber-400" : "text-slate-400 dark:text-slate-500"
496
505
  ),
497
506
  children: [
498
- /* @__PURE__ */ n("span", { className: "truncate", children: O }),
499
- (b == null ? void 0 : b[f.field]) && /* @__PURE__ */ n(
500
- De,
507
+ /* @__PURE__ */ l("span", { className: "truncate", children: O }),
508
+ (d == null ? void 0 : d[f.field]) && /* @__PURE__ */ l(
509
+ Ae,
501
510
  {
502
511
  field: f,
503
- from: b[f.field].from,
504
- detail: b[f.field].detail,
512
+ from: d[f.field].from,
513
+ detail: d[f.field].detail,
505
514
  to: T,
506
- relations: p,
507
- collection: d,
508
- onRevert: k ? () => k(f.field) : void 0
515
+ relations: y,
516
+ collection: c,
517
+ onRevert: g ? () => g(f.field) : void 0
509
518
  }
510
519
  ),
511
- H && /* @__PURE__ */ n("span", { className: "shrink-0 rounded bg-amber-100 px-1 text-[9px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-900/30 dark:text-amber-400", children: "required" }),
512
- I && /* @__PURE__ */ n(
520
+ H && /* @__PURE__ */ l("span", { className: "shrink-0 rounded bg-amber-100 px-1 text-[9px] font-semibold uppercase tracking-wide text-amber-700 dark:bg-amber-900/30 dark:text-amber-400", children: "required" }),
521
+ I && /* @__PURE__ */ l(
513
522
  "span",
514
523
  {
515
524
  title: "This value is no longer one of the available options",
@@ -520,22 +529,22 @@ function Xe({
520
529
  ]
521
530
  }
522
531
  ),
523
- /* @__PURE__ */ n(
532
+ /* @__PURE__ */ l(
524
533
  "span",
525
534
  {
526
535
  ref: (W) => {
527
- x.current.set(f.field, W);
536
+ b.current.set(f.field, W);
528
537
  },
529
538
  className: "mt-0.5 w-full text-[12px] min-w-0 overflow-hidden",
530
- children: /* @__PURE__ */ n(
531
- je,
539
+ children: /* @__PURE__ */ l(
540
+ Le,
532
541
  {
533
542
  field: f,
534
543
  val: T,
535
- relations: p,
536
- collection: d,
544
+ relations: y,
545
+ collection: c,
537
546
  itemId: u,
538
- staging: h
547
+ staging: x
539
548
  }
540
549
  )
541
550
  }
@@ -543,7 +552,7 @@ function Xe({
543
552
  ]
544
553
  }
545
554
  ),
546
- /* @__PURE__ */ n(
555
+ /* @__PURE__ */ l(
547
556
  "button",
548
557
  {
549
558
  type: "button",
@@ -551,8 +560,8 @@ function Xe({
551
560
  onClick: (W) => {
552
561
  var Y, G;
553
562
  W.stopPropagation();
554
- const de = ((G = (Y = x.current.get(f.field)) == null ? void 0 : Y.textContent) == null ? void 0 : G.trim()) ?? Ee(T);
555
- navigator.clipboard.writeText(de).catch(() => {
563
+ const me = ((G = (Y = b.current.get(f.field)) == null ? void 0 : Y.textContent) == null ? void 0 : G.trim()) ?? Re(T);
564
+ navigator.clipboard.writeText(me).catch(() => {
556
565
  }), R(f.field), setTimeout(
557
566
  () => R((B) => B === f.field ? null : B),
558
567
  1500
@@ -562,7 +571,7 @@ function Xe({
562
571
  "flex items-center px-2 opacity-0 group-hover/row:opacity-100 transition-all duration-150",
563
572
  L === f.field ? "text-emerald-500" : "text-slate-400 hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300"
564
573
  ),
565
- children: L === f.field ? /* @__PURE__ */ n(me, { className: "h-3 w-3" }) : /* @__PURE__ */ n(ue, { className: "h-3 w-3" })
574
+ children: L === f.field ? /* @__PURE__ */ l(ue, { className: "h-3 w-3" }) : /* @__PURE__ */ l(fe, { className: "h-3 w-3" })
566
575
  }
567
576
  )
568
577
  ]
@@ -570,25 +579,25 @@ function Xe({
570
579
  f.field
571
580
  );
572
581
  })
573
- ] }, s.key)),
574
- j.length > 0 && /* @__PURE__ */ y("div", { children: [
575
- /* @__PURE__ */ n("div", { className: "bg-slate-100 px-4 py-2 border-y border-slate-200 dark:bg-white/[0.06] dark:border-border/80", children: /* @__PURE__ */ n("span", { className: "text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: "Related" }) }),
576
- j.map((s, v) => {
577
- const q = s.one_field ?? s.many_collection ?? "", f = S === q;
578
- return /* @__PURE__ */ n(
582
+ ] }, i.key)),
583
+ j.length > 0 && /* @__PURE__ */ p("div", { children: [
584
+ /* @__PURE__ */ l("div", { className: "bg-slate-100 px-4 py-2 border-y border-slate-200 dark:bg-white/[0.06] dark:border-border/80", children: /* @__PURE__ */ l("span", { className: "text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: "Related" }) }),
585
+ j.map((i, v) => {
586
+ const q = i.one_field ?? i.many_collection ?? "", f = S === q;
587
+ return /* @__PURE__ */ l(
579
588
  "div",
580
589
  {
581
590
  className: M(
582
591
  "flex items-stretch",
583
592
  v < j.length - 1 && "border-b border-slate-100 dark:border-border/60"
584
593
  ),
585
- children: /* @__PURE__ */ y(
594
+ children: /* @__PURE__ */ p(
586
595
  "button",
587
596
  {
588
597
  type: "button",
589
598
  onClick: () => {
590
599
  var A;
591
- const P = s.many_collection ?? "", T = /(^|_)(notes?|comments?)$/i.test(P), O = document.querySelector(`[data-o2m-collection="${P}"]`) ?? (T ? document.querySelector('[data-panel="notes"]') : null);
600
+ const P = i.many_collection ?? "", T = /(^|_)(notes?|comments?)$/i.test(P), O = document.querySelector(`[data-o2m-collection="${P}"]`) ?? (T ? document.querySelector('[data-panel="notes"]') : null);
592
601
  if (!O) {
593
602
  m((F) => F === q ? null : q);
594
603
  return;
@@ -605,9 +614,9 @@ function Xe({
605
614
  },
606
615
  className: "flex flex-1 flex-col px-4 py-2 min-w-0 text-left transition-colors hover:bg-nvr-cyan/5",
607
616
  children: [
608
- /* @__PURE__ */ y("span", { className: "flex items-center gap-1 text-[10px] font-medium truncate text-slate-400 dark:text-slate-500", children: [
609
- /* @__PURE__ */ n(
610
- fe,
617
+ /* @__PURE__ */ p("span", { className: "flex items-center gap-1 text-[10px] font-medium truncate text-slate-400 dark:text-slate-500", children: [
618
+ /* @__PURE__ */ l(
619
+ ye,
611
620
  {
612
621
  className: M(
613
622
  "h-3 w-3 shrink-0 transition-transform",
@@ -615,13 +624,13 @@ function Xe({
615
624
  )
616
625
  }
617
626
  ),
618
- z(s.one_field ?? s.many_collection ?? "")
627
+ z(i.one_field ?? i.many_collection ?? "")
619
628
  ] }),
620
- /* @__PURE__ */ n("span", { className: "mt-0.5 text-[12px]", children: /* @__PURE__ */ n(
621
- ie,
629
+ /* @__PURE__ */ l("span", { className: "mt-0.5 text-[12px]", children: /* @__PURE__ */ l(
630
+ oe,
622
631
  {
623
- relatedCollection: s.many_collection ?? "",
624
- manyField: s.many_field,
632
+ relatedCollection: i.many_collection ?? "",
633
+ manyField: i.many_field,
625
634
  parentId: u,
626
635
  expanded: f
627
636
  }
@@ -630,15 +639,16 @@ function Xe({
630
639
  }
631
640
  )
632
641
  },
633
- s.id ?? `${s.many_collection}.${s.many_field}`
642
+ i.id ?? `${i.many_collection}.${i.many_field}`
634
643
  );
635
644
  })
636
645
  ] })
637
646
  ] }) });
638
647
  }
639
648
  export {
640
- se as M2OSummaryValue,
641
- je as SummaryFieldValue,
642
- Xe as SummaryPanel,
643
- Me as summaryPlainText
649
+ ie as M2OSummaryValue,
650
+ Le as SummaryFieldValue,
651
+ Ge as SummaryPanel,
652
+ Me as summaryChoiceLabel,
653
+ De as summaryPlainText
644
654
  };