@declarion/react 0.38.5 → 0.39.0

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 (45) hide show
  1. package/dist-lib/{DraggableChildrenTable-DvJO6-m0.js → DraggableChildrenTable-DziCVhq6.js} +1 -1
  2. package/dist-lib/{Grid-D2ArPFCz.js → Grid-BTX2tkCT.js} +2 -2
  3. package/dist-lib/{LayoutRenderer-C8DQ61Vo.js → LayoutRenderer-CwMERoPJ.js} +387 -285
  4. package/dist-lib/{MarkdownRenderer-CSuODN70.js → MarkdownRenderer-dHOTEhUa.js} +1 -1
  5. package/dist-lib/{RefreshControl-CHvOUn0o.js → RefreshControl--UAgflh7.js} +291 -209
  6. package/dist-lib/{SmartDetailPage.impl-Cl306lX3.js → SmartDetailPage.impl-Bj7MtHxi.js} +473 -414
  7. package/dist-lib/{SmartRecordListPage.impl-j8bhyL4e.js → SmartRecordListPage.impl-CZXzVhPC.js} +164 -164
  8. package/dist-lib/api/params.d.ts +12 -11
  9. package/dist-lib/components/columns/ColumnPicker.d.ts +11 -1
  10. package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +6 -0
  11. package/dist-lib/components/detail-layout/useManualColumnResize.d.ts +25 -0
  12. package/dist-lib/components/list/QuickPeek.d.ts +11 -2
  13. package/dist-lib/components/pages/list/{ListBulkBar.d.ts → ListFloatbar.d.ts} +3 -3
  14. package/dist-lib/components/pages/list/RowActionsCell.d.ts +8 -10
  15. package/dist-lib/components/pages/list/RowContextMenu.d.ts +29 -0
  16. package/dist-lib/components/pages/list/SaveViewDialog.d.ts +5 -1
  17. package/dist-lib/components/pages/list/cardProjection.d.ts +1 -1
  18. package/dist-lib/components/pages/list/column-sizing.d.ts +15 -0
  19. package/dist-lib/components/pages/list/columns.d.ts +3 -0
  20. package/dist-lib/components/pages/list/useHeaderReorder.d.ts +26 -0
  21. package/dist-lib/components/pages/list/useRowMenu.d.ts +47 -0
  22. package/dist-lib/components/pages/profile/Profile.d.ts +3 -0
  23. package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +2 -0
  24. package/dist-lib/components/params/ParamsBlock.d.ts +25 -0
  25. package/dist-lib/components/params/param-editors.d.ts +28 -0
  26. package/dist-lib/components/primitives/Dropdown.d.ts +10 -1
  27. package/dist-lib/components/shared/ActionDialog.d.ts +2 -2
  28. package/dist-lib/components/shared/ResponsiveActionBar.d.ts +45 -23
  29. package/dist-lib/declarion-react.css +1 -1
  30. package/dist-lib/hooks/useParams.d.ts +45 -1
  31. package/dist-lib/index.d.ts +0 -2
  32. package/dist-lib/index.js +3036 -2167
  33. package/dist-lib/lib/actions.d.ts +17 -3
  34. package/dist-lib/lib/evidence-verdict.d.ts +11 -0
  35. package/dist-lib/lib/rowClickGesture.d.ts +14 -0
  36. package/dist-lib/{registry-C3hbFTDQ.js → registry-DXNFRlbB.js} +780 -560
  37. package/dist-lib/stores/list-layout.d.ts +86 -0
  38. package/dist-lib/testing.js +1 -1
  39. package/dist-lib/types/api.d.ts +29 -1
  40. package/dist-lib/types/schema.d.ts +12 -0
  41. package/dist-lib/{useCurrentScreen-DD3KdlMj.js → useCurrentScreen-BA2lb-d7.js} +35 -23
  42. package/dist-lib/{useProperties-CliP5qvg.js → useProperties-Br2DeOQh.js} +81 -81
  43. package/dist-lib/{value-CNy3_xCA.js → value-C91loRXp.js} +1 -1
  44. package/package.json +1 -1
  45. package/dist-lib/components/list/RowMenu.d.ts +0 -23
@@ -1,20 +1,20 @@
1
1
  import { s as e, t } from "./DynamicIcon-DeRpAaXm.js";
2
- import { $ as n, B as r, Gn as i, I as a, Kn as o, L as s, Nn as c, S as l, W as u, Wn as d, Xt as f, Z as p, _t as m, an as h, b as g, bn as _, cn as v, fn as y, g as b, gt as ee, h as te, i as x, ln as ne, lt as S, mn as C, nt as w, on as re, ot as T, sn as ie, un as E, ut as D, v as O, z as k, zn as ae } from "./useCurrentScreen-DD3KdlMj.js";
3
- import { L as oe, N as se, P as ce, S as le, f as A, h as j, i as ue, l as de, o as fe, t as M, u as N, v as pe, w as me } from "./RefreshControl-CHvOUn0o.js";
4
- import { $ as he, D as ge, G as _e, H as ve, K as ye, L as P, M as be, O as xe, Q as Se, St as Ce, U as we, W as Te, X as Ee, Z as De, _ as Oe, a as ke, dt as Ae, et as je, ft as Me, i as Ne, nt as Pe, q as Fe, s as Ie, tt as Le, vt as Re, w as ze, z as Be } from "./registry-C3hbFTDQ.js";
5
- import { n as Ve, r as He, t as Ue } from "./dataTableStyles-vwD1mVOP.js";
6
- import { n as We, t as Ge } from "./LayoutRenderer-C8DQ61Vo.js";
7
- import { Fragment as Ke, useCallback as F, useEffect as I, useMemo as L, useRef as qe, useState as R } from "react";
8
- import { useLocation as Je, useParams as Ye, useSearchParams as Xe } from "react-router-dom";
9
- import { useQuery as Ze, useQueryClient as Qe } from "@tanstack/react-query";
10
- import { Fragment as $e, jsx as z, jsxs as B } from "react/jsx-runtime";
2
+ import { $ as n, B as r, Gn as i, I as a, Kn as o, L as s, Nn as c, S as l, W as u, Wn as d, Xt as f, Z as p, _t as m, an as h, b as g, bn as _, cn as v, fn as y, g as b, gt as ee, h as te, i as x, ln as ne, lt as S, mn as C, nt as w, on as re, ot as T, sn as ie, un as E, ut as D, v as O, z as k, zn as ae } from "./useCurrentScreen-BA2lb-d7.js";
3
+ import { E as oe, L as se, R as ce, V as le, _ as A, b as ue, c as de, d as fe, f as j, m as M, n as N, o as pe, r as P, t as me, w as he } from "./RefreshControl--UAgflh7.js";
4
+ import { D as ge, G as _e, J as ve, K as ye, O as be, Ot as xe, P as Se, V as Ce, W as we, Y as Te, _ as Ee, _t as De, a as Oe, at as ke, ct as Ae, i as je, it as Me, nt as Ne, ot as Pe, q as Fe, rt as Ie, s as Le, st as Re, vt as ze, w as Be, wt as Ve, z as He } from "./registry-DXNFRlbB.js";
5
+ import { n as Ue, r as We, t as Ge } from "./dataTableStyles-vwD1mVOP.js";
6
+ import { n as Ke, t as qe } from "./LayoutRenderer-CwMERoPJ.js";
7
+ import { Fragment as Je, useCallback as F, useEffect as Ye, useMemo as I, useRef as Xe, useState as L } from "react";
8
+ import { useLocation as Ze, useParams as Qe, useSearchParams as $e } from "react-router-dom";
9
+ import { useQuery as et, useQueryClient as tt } from "@tanstack/react-query";
10
+ import { Fragment as nt, jsx as R, jsxs as z } from "react/jsx-runtime";
11
11
  //#region src/components/shared/AssociationTabs.tsx
12
- function et({ entityCode: e, recordId: n, associations: r, schema: i }) {
13
- let a = L(() => Object.entries(r), [r]), [o, s] = R(0);
12
+ function rt({ entityCode: e, recordId: n, associations: r, schema: i }) {
13
+ let a = I(() => Object.entries(r), [r]), [o, s] = L(0);
14
14
  if (a.length === 0) return null;
15
15
  let [c, l] = a[o];
16
- return /* @__PURE__ */ z(Ce, {
17
- title: /* @__PURE__ */ z("div", {
16
+ return /* @__PURE__ */ R(xe, {
17
+ title: /* @__PURE__ */ R("div", {
18
18
  style: {
19
19
  display: "flex",
20
20
  alignItems: "center",
@@ -25,7 +25,7 @@ function et({ entityCode: e, recordId: n, associations: r, schema: i }) {
25
25
  },
26
26
  children: a.map(([e, n], r) => {
27
27
  let i = r === o;
28
- return /* @__PURE__ */ B("button", {
28
+ return /* @__PURE__ */ z("button", {
29
29
  onClick: (e) => {
30
30
  e.stopPropagation(), s(r);
31
31
  },
@@ -43,7 +43,7 @@ function et({ entityCode: e, recordId: n, associations: r, schema: i }) {
43
43
  cursor: "pointer",
44
44
  fontWeight: i ? 600 : 500
45
45
  },
46
- children: [n.display?.icon && /* @__PURE__ */ z(t, {
46
+ children: [n.display?.icon && /* @__PURE__ */ R(t, {
47
47
  name: n.display.icon,
48
48
  size: 13
49
49
  }), E(n.display?.name) || e]
@@ -52,7 +52,7 @@ function et({ entityCode: e, recordId: n, associations: r, schema: i }) {
52
52
  }),
53
53
  collapsible: !1,
54
54
  padding: "0",
55
- children: /* @__PURE__ */ z(tt, {
55
+ children: /* @__PURE__ */ R(it, {
56
56
  entityCode: e,
57
57
  recordId: n,
58
58
  assocKey: c,
@@ -61,15 +61,15 @@ function et({ entityCode: e, recordId: n, associations: r, schema: i }) {
61
61
  })
62
62
  });
63
63
  }
64
- function tt({ entityCode: t, recordId: n, assocKey: r, association: i, schema: a }) {
65
- let s = Ae(), c = te(), l = `${t}.${r}`, { data: u, isLoading: d } = Ze({
64
+ function it({ entityCode: t, recordId: n, assocKey: r, association: i, schema: a }) {
65
+ let s = De(), c = te(), l = `${t}.${r}`, { data: u, isLoading: d } = et({
66
66
  queryKey: [
67
67
  "association",
68
68
  l,
69
69
  n
70
70
  ],
71
71
  queryFn: () => D(l, [n])
72
- }), f = u?.target_entity ?? i.target, p = a.entities[f], m = L(() => u?.ids ?? [], [u?.ids]), h = L(() => p?.fields.names().find((e) => p.fields.get(e)?.primary) ?? "id", [p]), g = L(() => m.slice(0, 50), [m]), { data: _, isLoading: v } = Ze({
72
+ }), f = u?.target_entity ?? i.target, p = a.entities[f], m = I(() => u?.ids ?? [], [u?.ids]), h = I(() => p?.fields.names().find((e) => p.fields.get(e)?.primary) ?? "id", [p]), g = I(() => m.slice(0, 50), [m]), { data: _, isLoading: v } = et({
73
73
  queryKey: [
74
74
  "association-records",
75
75
  f,
@@ -84,11 +84,11 @@ function tt({ entityCode: t, recordId: n, assocKey: r, association: i, schema: a
84
84
  }]
85
85
  }),
86
86
  enabled: g.length > 0 && !!p
87
- }), y = _?.data ?? [], ee = _?.$refs, x = L(() => p ? p.fields.names().filter((e) => {
87
+ }), y = _?.data ?? [], ee = _?.$refs, x = I(() => p ? p.fields.names().filter((e) => {
88
88
  let t = p.fields.get(e);
89
89
  return t && !t.primary && !t.auto && t.display?.is_listable !== !1;
90
90
  }).slice(0, 6) : [], [p]), ne = () => {
91
- let e = P(a, f);
91
+ let e = He(a, f);
92
92
  if (!e) return;
93
93
  let t = E(i.display?.name) || r, n = new URLSearchParams();
94
94
  n.set("filters", JSON.stringify([{
@@ -105,31 +105,31 @@ function tt({ entityCode: t, recordId: n, assocKey: r, association: i, schema: a
105
105
  color: "var(--text-3)",
106
106
  padding: "14px 16px"
107
107
  };
108
- if (d || v) return /* @__PURE__ */ z("div", {
108
+ if (d || v) return /* @__PURE__ */ R("div", {
109
109
  style: C,
110
110
  children: "Loading…"
111
111
  });
112
- if (!p) return /* @__PURE__ */ z("div", {
112
+ if (!p) return /* @__PURE__ */ R("div", {
113
113
  style: C,
114
114
  children: "Entity not found."
115
115
  });
116
- if (m.length === 0) return /* @__PURE__ */ z("div", {
116
+ if (m.length === 0) return /* @__PURE__ */ R("div", {
117
117
  style: C,
118
118
  children: "No related records."
119
119
  });
120
- let w = P(a, f);
121
- return /* @__PURE__ */ B("div", {
120
+ let w = He(a, f);
121
+ return /* @__PURE__ */ z("div", {
122
122
  style: { padding: "8px 0" },
123
123
  children: [
124
- /* @__PURE__ */ B("table", {
125
- style: He,
126
- children: [/* @__PURE__ */ z("thead", { children: /* @__PURE__ */ z("tr", { children: x.map((e) => /* @__PURE__ */ z("th", {
127
- style: Ve,
124
+ /* @__PURE__ */ z("table", {
125
+ style: We,
126
+ children: [/* @__PURE__ */ R("thead", { children: /* @__PURE__ */ R("tr", { children: x.map((e) => /* @__PURE__ */ R("th", {
127
+ style: Ue,
128
128
  children: ie(p.fields.get(e), e, a.entities)
129
- }, e)) }) }), /* @__PURE__ */ z("tbody", { children: y.map((e, t) => /* @__PURE__ */ z("tr", { children: x.map((t) => {
129
+ }, e)) }) }), /* @__PURE__ */ R("tbody", { children: y.map((e, t) => /* @__PURE__ */ R("tr", { children: x.map((t) => {
130
130
  let n = p.fields.get(t);
131
- return n ? /* @__PURE__ */ z("td", {
132
- style: Ue,
131
+ return n ? /* @__PURE__ */ R("td", {
132
+ style: Ge,
133
133
  children: b({
134
134
  field: n,
135
135
  fieldName: t,
@@ -139,16 +139,16 @@ function tt({ entityCode: t, recordId: n, assocKey: r, association: i, schema: a
139
139
  refs: ee,
140
140
  locale: c
141
141
  })
142
- }, t) : /* @__PURE__ */ z("td", {}, t);
142
+ }, t) : /* @__PURE__ */ R("td", {}, t);
143
143
  }) }, t)) })]
144
144
  }),
145
- w && u && u.count > y.length && /* @__PURE__ */ z("div", {
145
+ w && u && u.count > y.length && /* @__PURE__ */ R("div", {
146
146
  style: {
147
147
  padding: "10px 16px",
148
148
  textAlign: "center"
149
149
  },
150
- children: /* @__PURE__ */ B(o, {
151
- icon: /* @__PURE__ */ z(e.external, { size: 12 }),
150
+ children: /* @__PURE__ */ z(o, {
151
+ icon: /* @__PURE__ */ R(e.external, { size: 12 }),
152
152
  onClick: ne,
153
153
  children: [
154
154
  "View all ",
@@ -157,14 +157,14 @@ function tt({ entityCode: t, recordId: n, assocKey: r, association: i, schema: a
157
157
  ]
158
158
  })
159
159
  }),
160
- w && y.length > 0 && u && u.count <= y.length && /* @__PURE__ */ z("div", {
160
+ w && y.length > 0 && u && u.count <= y.length && /* @__PURE__ */ R("div", {
161
161
  style: {
162
162
  padding: "10px 16px",
163
163
  textAlign: "center"
164
164
  },
165
- children: /* @__PURE__ */ z(o, {
165
+ children: /* @__PURE__ */ R(o, {
166
166
  kind: "ghost",
167
- icon: /* @__PURE__ */ z(e.external, { size: 12 }),
167
+ icon: /* @__PURE__ */ R(e.external, { size: 12 }),
168
168
  onClick: ne,
169
169
  children: "Open in list view"
170
170
  })
@@ -174,14 +174,14 @@ function tt({ entityCode: t, recordId: n, assocKey: r, association: i, schema: a
174
174
  }
175
175
  //#endregion
176
176
  //#region src/components/pages/RecordDocumentsPanel.tsx
177
- var nt = 4e3;
178
- function rt(e) {
179
- return e?.some((e) => e.status === "pending") ? nt : !1;
177
+ var B = 4e3;
178
+ function at(e) {
179
+ return e?.some((e) => e.status === "pending") ? B : !1;
180
180
  }
181
- function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
182
- let { data: a, isLoading: o, error: s } = Ze({
181
+ function ot({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates: i }) {
182
+ let { data: a, isLoading: o, error: s } = et({
183
183
  queryKey: [
184
- j,
184
+ A,
185
185
  t,
186
186
  n
187
187
  ],
@@ -190,31 +190,31 @@ function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
190
190
  object_id: n
191
191
  })).result?.documents ?? [],
192
192
  enabled: !!(t && n) && (!!r || !!i),
193
- refetchInterval: (e) => rt(e.state.data)
193
+ refetchInterval: (e) => at(e.state.data)
194
194
  }), c = (a?.length ?? 0) > 0;
195
- return !r && !c ? null : /* @__PURE__ */ B(Ce, {
196
- title: /* @__PURE__ */ z(V, {}),
195
+ return !r && !c ? null : /* @__PURE__ */ z(xe, {
196
+ title: /* @__PURE__ */ R(V, {}),
197
197
  collapsible: !1,
198
198
  padding: "0",
199
199
  children: [
200
- o && /* @__PURE__ */ z(H, {
201
- icon: /* @__PURE__ */ z(e.loader, { size: 14 }),
200
+ o && /* @__PURE__ */ R(H, {
201
+ icon: /* @__PURE__ */ R(e.loader, { size: 14 }),
202
202
  text: "Loading documents..."
203
203
  }),
204
- s && /* @__PURE__ */ z(H, {
205
- icon: /* @__PURE__ */ z(e.warning, { size: 14 }),
204
+ s && /* @__PURE__ */ R(H, {
205
+ icon: /* @__PURE__ */ R(e.warning, { size: 14 }),
206
206
  text: s instanceof Error ? s.message : String(s)
207
207
  }),
208
- !o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */ z(H, {
209
- icon: /* @__PURE__ */ z(e.file, { size: 14 }),
208
+ !o && !s && (a?.length ?? 0) === 0 && /* @__PURE__ */ R(H, {
209
+ icon: /* @__PURE__ */ R(e.file, { size: 14 }),
210
210
  text: "No generated documents"
211
211
  }),
212
- !o && !s && a && a.length > 0 && /* @__PURE__ */ z("div", {
212
+ !o && !s && a && a.length > 0 && /* @__PURE__ */ R("div", {
213
213
  style: {
214
214
  display: "flex",
215
215
  flexDirection: "column"
216
216
  },
217
- children: a.map((e) => /* @__PURE__ */ z(at, {
217
+ children: a.map((e) => /* @__PURE__ */ R(st, {
218
218
  entityCode: t,
219
219
  objectId: n,
220
220
  doc: e
@@ -224,7 +224,7 @@ function it({ entityCode: t, objectId: n, canGenerateOne: r, canManageTemplates:
224
224
  });
225
225
  }
226
226
  function V() {
227
- return /* @__PURE__ */ B("div", {
227
+ return /* @__PURE__ */ z("div", {
228
228
  style: {
229
229
  display: "flex",
230
230
  alignItems: "center",
@@ -235,11 +235,11 @@ function V() {
235
235
  fontWeight: 600,
236
236
  color: "var(--text)"
237
237
  },
238
- children: [/* @__PURE__ */ z(e.file, { size: 13 }), "Documents"]
238
+ children: [/* @__PURE__ */ R(e.file, { size: 13 }), "Documents"]
239
239
  });
240
240
  }
241
- function at({ entityCode: t, objectId: n, doc: i }) {
242
- let a = Qe(), [s, c] = R(!1), [l, u] = R(!1), [d, f] = R(!1), [p, m] = R(!1), [h, g] = R(null), _ = E(i.title) || i.filename || i.template_code, v = i.status === "ready" && i.download_url && !p;
241
+ function st({ entityCode: t, objectId: n, doc: i }) {
242
+ let a = tt(), [s, c] = L(!1), [l, u] = L(!1), [d, f] = L(!1), [p, m] = L(!1), [h, g] = L(null), _ = E(i.title) || i.filename || i.template_code, v = i.status === "ready" && i.download_url && !p;
243
243
  async function y() {
244
244
  c(!0), g(null);
245
245
  try {
@@ -275,7 +275,7 @@ function at({ entityCode: t, objectId: n, doc: i }) {
275
275
  template_source: i.template_source,
276
276
  output_format: i.output_format
277
277
  }), await a.invalidateQueries({ queryKey: [
278
- j,
278
+ A,
279
279
  t,
280
280
  n
281
281
  ] });
@@ -285,7 +285,7 @@ function at({ entityCode: t, objectId: n, doc: i }) {
285
285
  f(!1);
286
286
  }
287
287
  }
288
- return /* @__PURE__ */ B("div", {
288
+ return /* @__PURE__ */ z("div", {
289
289
  style: {
290
290
  display: "grid",
291
291
  gridTemplateColumns: "minmax(0, 1fr) auto",
@@ -294,10 +294,10 @@ function at({ entityCode: t, objectId: n, doc: i }) {
294
294
  padding: "11px 14px",
295
295
  borderTop: "1px solid var(--divider)"
296
296
  },
297
- children: [/* @__PURE__ */ B("div", {
297
+ children: [/* @__PURE__ */ z("div", {
298
298
  style: { minWidth: 0 },
299
299
  children: [
300
- /* @__PURE__ */ z("div", {
300
+ /* @__PURE__ */ R("div", {
301
301
  style: {
302
302
  fontSize: 13,
303
303
  fontWeight: 600,
@@ -308,7 +308,7 @@ function at({ entityCode: t, objectId: n, doc: i }) {
308
308
  },
309
309
  children: _
310
310
  }),
311
- /* @__PURE__ */ B("div", {
311
+ /* @__PURE__ */ z("div", {
312
312
  style: {
313
313
  marginTop: 3,
314
314
  display: "flex",
@@ -318,12 +318,12 @@ function at({ entityCode: t, objectId: n, doc: i }) {
318
318
  fontSize: 11.5
319
319
  },
320
320
  children: [
321
- /* @__PURE__ */ z("span", { children: i.output_format.toUpperCase() }),
322
- /* @__PURE__ */ z("span", { children: p ? "artifact unavailable" : i.status }),
323
- /* @__PURE__ */ z("span", { children: i.ready_at || i.created_at })
321
+ /* @__PURE__ */ R("span", { children: i.output_format.toUpperCase() }),
322
+ /* @__PURE__ */ R("span", { children: p ? "artifact unavailable" : i.status }),
323
+ /* @__PURE__ */ R("span", { children: i.ready_at || i.created_at })
324
324
  ]
325
325
  }),
326
- i.status === "failed" && i.error_text && /* @__PURE__ */ z("div", {
326
+ i.status === "failed" && i.error_text && /* @__PURE__ */ R("div", {
327
327
  style: {
328
328
  marginTop: 5,
329
329
  color: "var(--danger)",
@@ -331,7 +331,7 @@ function at({ entityCode: t, objectId: n, doc: i }) {
331
331
  },
332
332
  children: i.error_text
333
333
  }),
334
- h && /* @__PURE__ */ z("div", {
334
+ h && /* @__PURE__ */ R("div", {
335
335
  style: {
336
336
  marginTop: 5,
337
337
  color: "var(--danger)",
@@ -340,34 +340,34 @@ function at({ entityCode: t, objectId: n, doc: i }) {
340
340
  children: h
341
341
  })
342
342
  ]
343
- }), v ? /* @__PURE__ */ B("div", {
343
+ }), v ? /* @__PURE__ */ z("div", {
344
344
  style: {
345
345
  display: "flex",
346
346
  gap: 6
347
347
  },
348
- children: [/* @__PURE__ */ z(o, {
348
+ children: [/* @__PURE__ */ R(o, {
349
349
  kind: "ghost",
350
350
  size: "sm",
351
- icon: z(s ? e.loader : e.file, { size: 12 }),
351
+ icon: R(s ? e.loader : e.file, { size: 12 }),
352
352
  onClick: y,
353
353
  disabled: s,
354
354
  children: "PDF"
355
- }), /* @__PURE__ */ z(o, {
355
+ }), /* @__PURE__ */ R(o, {
356
356
  kind: "default",
357
357
  size: "sm",
358
- icon: z(l ? e.loader : e.download, { size: 12 }),
358
+ icon: R(l ? e.loader : e.download, { size: 12 }),
359
359
  onClick: b,
360
360
  disabled: l,
361
361
  children: "Download"
362
362
  })]
363
- }) : p ? /* @__PURE__ */ z(o, {
363
+ }) : p ? /* @__PURE__ */ R(o, {
364
364
  kind: "ghost",
365
365
  size: "sm",
366
- icon: z(d ? e.loader : e.file, { size: 12 }),
366
+ icon: R(d ? e.loader : e.file, { size: 12 }),
367
367
  onClick: ee,
368
368
  disabled: d,
369
369
  children: "Regenerate"
370
- }) : /* @__PURE__ */ z(o, {
370
+ }) : /* @__PURE__ */ R(o, {
371
371
  kind: "ghost",
372
372
  size: "sm",
373
373
  disabled: !0,
@@ -376,7 +376,7 @@ function at({ entityCode: t, objectId: n, doc: i }) {
376
376
  });
377
377
  }
378
378
  function H({ icon: e, text: t }) {
379
- return /* @__PURE__ */ B("div", {
379
+ return /* @__PURE__ */ z("div", {
380
380
  style: {
381
381
  display: "flex",
382
382
  alignItems: "center",
@@ -390,10 +390,10 @@ function H({ icon: e, text: t }) {
390
390
  }
391
391
  //#endregion
392
392
  //#region src/components/detail-layout/ErrorSummary.tsx
393
- function ot({ errors: t, onJump: n }) {
393
+ function ct({ errors: t, onJump: n }) {
394
394
  if (t.length === 0) return null;
395
395
  let r = t.length !== 1;
396
- return /* @__PURE__ */ B("div", {
396
+ return /* @__PURE__ */ z("div", {
397
397
  role: "alert",
398
398
  style: {
399
399
  display: "flex",
@@ -405,19 +405,19 @@ function ot({ errors: t, onJump: n }) {
405
405
  border: "1px solid var(--danger-border)",
406
406
  color: "var(--text)"
407
407
  },
408
- children: [/* @__PURE__ */ z("span", {
408
+ children: [/* @__PURE__ */ R("span", {
409
409
  style: {
410
410
  color: "var(--danger)",
411
411
  marginTop: 1,
412
412
  display: "flex"
413
413
  },
414
- children: /* @__PURE__ */ z(e.warning, { size: 14 })
415
- }), /* @__PURE__ */ B("div", {
414
+ children: /* @__PURE__ */ R(e.warning, { size: 14 })
415
+ }), /* @__PURE__ */ z("div", {
416
416
  style: {
417
417
  flex: 1,
418
418
  minWidth: 0
419
419
  },
420
- children: [/* @__PURE__ */ B("div", {
420
+ children: [/* @__PURE__ */ z("div", {
421
421
  style: {
422
422
  fontSize: 12.5,
423
423
  fontWeight: 600,
@@ -429,7 +429,7 @@ function ot({ errors: t, onJump: n }) {
429
429
  r ? "fields need" : "field needs",
430
430
  " attention"
431
431
  ]
432
- }), /* @__PURE__ */ z("ul", {
432
+ }), /* @__PURE__ */ R("ul", {
433
433
  style: {
434
434
  margin: 0,
435
435
  padding: 0,
@@ -438,7 +438,7 @@ function ot({ errors: t, onJump: n }) {
438
438
  flexDirection: "column",
439
439
  gap: 2
440
440
  },
441
- children: t.map((e) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ B("button", {
441
+ children: t.map((e) => /* @__PURE__ */ R("li", { children: /* @__PURE__ */ z("button", {
442
442
  type: "button",
443
443
  onClick: n ? () => n(e.name) : void 0,
444
444
  style: {
@@ -451,21 +451,21 @@ function ot({ errors: t, onJump: n }) {
451
451
  fontFamily: "inherit"
452
452
  },
453
453
  children: [
454
- /* @__PURE__ */ z("span", {
454
+ /* @__PURE__ */ R("span", {
455
455
  style: {
456
456
  color: "var(--danger)",
457
457
  marginRight: 6
458
458
  },
459
459
  children: "•"
460
460
  }),
461
- /* @__PURE__ */ z("span", {
461
+ /* @__PURE__ */ R("span", {
462
462
  style: {
463
463
  fontWeight: 500,
464
464
  color: "var(--text-2)"
465
465
  },
466
466
  children: e.label
467
467
  }),
468
- /* @__PURE__ */ B("span", {
468
+ /* @__PURE__ */ z("span", {
469
469
  style: { color: "var(--text-3)" },
470
470
  children: [" - ", e.message]
471
471
  })
@@ -477,8 +477,8 @@ function ot({ errors: t, onJump: n }) {
477
477
  }
478
478
  //#endregion
479
479
  //#region src/components/shared/HighlightsStrip.tsx
480
- function st({ items: e }) {
481
- return e.length === 0 ? null : /* @__PURE__ */ z("div", {
480
+ function lt({ items: e }) {
481
+ return e.length === 0 ? null : /* @__PURE__ */ R("div", {
482
482
  style: {
483
483
  display: "flex",
484
484
  alignItems: "center",
@@ -486,25 +486,25 @@ function st({ items: e }) {
486
486
  gap: "6px 0",
487
487
  fontSize: 12
488
488
  },
489
- children: e.map((e, t) => /* @__PURE__ */ B(Ke, { children: [t > 0 && /* @__PURE__ */ z("span", { style: {
489
+ children: e.map((e, t) => /* @__PURE__ */ z(Je, { children: [t > 0 && /* @__PURE__ */ R("span", { style: {
490
490
  width: 1,
491
491
  height: 12,
492
492
  background: "var(--divider)",
493
493
  marginInline: 12
494
- } }), /* @__PURE__ */ B("span", {
494
+ } }), /* @__PURE__ */ z("span", {
495
495
  style: {
496
496
  display: "inline-flex",
497
497
  alignItems: "center",
498
498
  gap: 6,
499
499
  lineHeight: 1.3
500
500
  },
501
- children: [/* @__PURE__ */ z("span", {
501
+ children: [/* @__PURE__ */ R("span", {
502
502
  style: {
503
503
  color: "var(--text-3)",
504
504
  fontSize: 11.5
505
505
  },
506
506
  children: e.label
507
- }), /* @__PURE__ */ z("span", {
507
+ }), /* @__PURE__ */ R("span", {
508
508
  style: { color: "var(--text)" },
509
509
  children: e.value
510
510
  })]
@@ -513,7 +513,7 @@ function st({ items: e }) {
513
513
  }
514
514
  //#endregion
515
515
  //#region src/components/detail-layout/DetailHighlights.tsx
516
- function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o, locale: s }) {
516
+ function ut({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectStatuses: a, schema: o, locale: s }) {
517
517
  let c = e.highlights;
518
518
  if (!c || c.length === 0) return null;
519
519
  let l = [];
@@ -523,11 +523,11 @@ function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
523
523
  let t = a?.find((t) => t.group_code === e), n = t ? c.statuses.find((e) => e.code === t.status_code) : void 0;
524
524
  l.push({
525
525
  label: E(c.name),
526
- value: n ? /* @__PURE__ */ z(d, {
526
+ value: n ? /* @__PURE__ */ R(d, {
527
527
  tone: n.color ?? "slate",
528
528
  size: "xs",
529
529
  children: E(n.name)
530
- }) : /* @__PURE__ */ z("span", {
530
+ }) : /* @__PURE__ */ R("span", {
531
531
  style: { color: "var(--text-4)" },
532
532
  children: "—"
533
533
  })
@@ -535,7 +535,7 @@ function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
535
535
  continue;
536
536
  }
537
537
  if (t.fields.get(e) || t.files?.get(e)) {
538
- let a = je({
538
+ let a = Pe({
539
539
  entity: t,
540
540
  entityCode: n,
541
541
  fieldName: e,
@@ -548,22 +548,22 @@ function ct({ screen: e, entity: t, entityCode: n, record: r, refs: i, objectSta
548
548
  locale: s
549
549
  });
550
550
  l.push({
551
- label: Le(t, e, o.entities),
551
+ label: Re(t, e, o.entities),
552
552
  value: a
553
553
  });
554
554
  continue;
555
555
  }
556
556
  }
557
- return l.length === 0 ? null : /* @__PURE__ */ z(st, { items: l });
557
+ return l.length === 0 ? null : /* @__PURE__ */ R(lt, { items: l });
558
558
  }
559
559
  //#endregion
560
560
  //#region src/components/shared/AuditMetaStrip.tsx
561
561
  function U(e) {
562
562
  return e.by != null || e.at != null;
563
563
  }
564
- function lt({ lines: e }) {
564
+ function W({ lines: e }) {
565
565
  let t = e.filter(U);
566
- return t.length === 0 ? null : /* @__PURE__ */ z("div", {
566
+ return t.length === 0 ? null : /* @__PURE__ */ R("div", {
567
567
  style: {
568
568
  display: "flex",
569
569
  flexWrap: "wrap",
@@ -575,18 +575,18 @@ function lt({ lines: e }) {
575
575
  fontSize: 11.5,
576
576
  color: "var(--text-3)"
577
577
  },
578
- children: t.map((e, t) => /* @__PURE__ */ z(W, { line: e }, t))
578
+ children: t.map((e, t) => /* @__PURE__ */ R(dt, { line: e }, t))
579
579
  });
580
580
  }
581
- function W({ line: e }) {
582
- return /* @__PURE__ */ B("div", {
581
+ function dt({ line: e }) {
582
+ return /* @__PURE__ */ z("div", {
583
583
  style: {
584
584
  display: "flex",
585
585
  alignItems: "center",
586
586
  gap: 8,
587
587
  minWidth: 0
588
588
  },
589
- children: [/* @__PURE__ */ z("span", {
589
+ children: [/* @__PURE__ */ R("span", {
590
590
  style: {
591
591
  fontSize: 11,
592
592
  fontWeight: 600,
@@ -594,7 +594,7 @@ function W({ line: e }) {
594
594
  flexShrink: 0
595
595
  },
596
596
  children: e.label
597
- }), /* @__PURE__ */ B("span", {
597
+ }), /* @__PURE__ */ z("span", {
598
598
  style: {
599
599
  display: "inline-flex",
600
600
  alignItems: "center",
@@ -602,15 +602,15 @@ function W({ line: e }) {
602
602
  minWidth: 0
603
603
  },
604
604
  children: [
605
- e.by != null && /* @__PURE__ */ z("span", {
605
+ e.by != null && /* @__PURE__ */ R("span", {
606
606
  style: { color: "var(--text-2)" },
607
607
  children: e.by
608
608
  }),
609
- e.by != null && e.at != null && /* @__PURE__ */ z("span", {
609
+ e.by != null && e.at != null && /* @__PURE__ */ R("span", {
610
610
  style: { color: "var(--text-4)" },
611
611
  children: "·"
612
612
  }),
613
- e.at != null && /* @__PURE__ */ z("span", {
613
+ e.at != null && /* @__PURE__ */ R("span", {
614
614
  className: "num",
615
615
  children: e.at
616
616
  })
@@ -620,13 +620,13 @@ function W({ line: e }) {
620
620
  }
621
621
  //#endregion
622
622
  //#region src/components/detail-layout/DetailAuditStrip.tsx
623
- function ut({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a, locale: o }) {
623
+ function ft({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a, locale: o }) {
624
624
  let s = e.audit;
625
625
  if (s?.enabled === !1) return null;
626
626
  let c = (e) => {
627
627
  if (!e || !t.fields.get(e)) return;
628
628
  let s = r[e];
629
- if (!(s == null || s === "")) return je({
629
+ if (!(s == null || s === "")) return Pe({
630
630
  entity: t,
631
631
  entityCode: n,
632
632
  fieldName: e,
@@ -639,7 +639,7 @@ function ut({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
639
639
  locale: o
640
640
  });
641
641
  };
642
- return /* @__PURE__ */ z(lt, { lines: s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
642
+ return /* @__PURE__ */ R(W, { lines: s?.lines && s.lines.length > 0 ? s.lines.map((e) => ({
643
643
  label: E(e.label),
644
644
  at: c(e.at),
645
645
  by: c(e.by)
@@ -654,10 +654,64 @@ function ut({ screen: e, entity: t, entityCode: n, record: r, refs: i, schema: a
654
654
  }] });
655
655
  }
656
656
  //#endregion
657
+ //#region src/components/detail-layout/EvidenceBlock.tsx
658
+ function pt(e) {
659
+ if (!e) return;
660
+ let t = new Date(e);
661
+ if (!Number.isNaN(t.getTime())) return t.toLocaleString();
662
+ }
663
+ function mt({ evidence: e }) {
664
+ let t = e?.verdict ?? "unverified", n = pt(e?.verified_at), r = [];
665
+ return n && r.push(`Verified ${n}`), e?.seq && r.push(`chain #${e.seq}`), e?.checkpoint_number && r.push(`checkpoint ${e.checkpoint_number}`), e?.generation && r.push(`generation ${e.generation}`), /* @__PURE__ */ z("div", {
666
+ style: {
667
+ display: "flex",
668
+ flexDirection: "column",
669
+ gap: 6
670
+ },
671
+ children: [/* @__PURE__ */ z("div", {
672
+ style: {
673
+ display: "flex",
674
+ alignItems: "center",
675
+ gap: 10,
676
+ flexWrap: "wrap"
677
+ },
678
+ children: [
679
+ /* @__PURE__ */ R("span", {
680
+ style: {
681
+ fontSize: 12,
682
+ fontWeight: 600,
683
+ color: "var(--muted-foreground)"
684
+ },
685
+ children: "Evidence"
686
+ }),
687
+ /* @__PURE__ */ R(d, {
688
+ tone: P(t),
689
+ size: "sm",
690
+ dot: !0,
691
+ children: N(t)
692
+ }),
693
+ r.length > 0 && /* @__PURE__ */ R("span", {
694
+ style: {
695
+ fontSize: 12,
696
+ color: "var(--muted-foreground)"
697
+ },
698
+ children: r.join(" · ")
699
+ })
700
+ ]
701
+ }), e?.reason && /* @__PURE__ */ R("span", {
702
+ style: {
703
+ fontSize: 12,
704
+ color: "var(--destructive)"
705
+ },
706
+ children: e.reason
707
+ })]
708
+ });
709
+ }
710
+ //#endregion
657
711
  //#region src/components/shared/RecordHeader.tsx
658
- function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, highlights: s, mode: c, dirty: l = !1, showBack: u = !1, onBack: f, right: p, identityControls: m, showTitle: h = !0 }) {
712
+ function ht({ icon: t, avatarName: n, title: r, recordId: a, description: o, highlights: s, mode: c, dirty: l = !1, showBack: u = !1, onBack: f, right: p, identityControls: m, showTitle: h = !0 }) {
659
713
  let g = ae(), _ = g.category === "phone" || g.width <= 520;
660
- return /* @__PURE__ */ B("div", {
714
+ return /* @__PURE__ */ z("div", {
661
715
  style: {
662
716
  display: "flex",
663
717
  alignItems: "flex-start",
@@ -666,27 +720,27 @@ function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, high
666
720
  minWidth: 0
667
721
  },
668
722
  children: [
669
- h && u && /* @__PURE__ */ z("div", {
723
+ h && u && /* @__PURE__ */ R("div", {
670
724
  style: {
671
725
  paddingTop: 4,
672
726
  flexShrink: 0
673
727
  },
674
- children: /* @__PURE__ */ z(i, {
728
+ children: /* @__PURE__ */ R(i, {
675
729
  size: 26,
676
- icon: /* @__PURE__ */ z(e.back, { size: 14 }),
730
+ icon: /* @__PURE__ */ R(e.back, { size: 14 }),
677
731
  title: "Back",
678
732
  onClick: f
679
733
  })
680
734
  }),
681
- h && (n || t) && /* @__PURE__ */ z("div", {
735
+ h && (n || t) && /* @__PURE__ */ R("div", {
682
736
  style: {
683
737
  flexShrink: 0,
684
738
  paddingTop: 2
685
739
  },
686
- children: n ? /* @__PURE__ */ z(oe, {
740
+ children: n ? /* @__PURE__ */ R(le, {
687
741
  name: n,
688
742
  size: 32
689
- }) : /* @__PURE__ */ z("span", {
743
+ }) : /* @__PURE__ */ R("span", {
690
744
  style: {
691
745
  width: 32,
692
746
  height: 32,
@@ -700,12 +754,12 @@ function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, high
700
754
  children: t
701
755
  })
702
756
  }),
703
- h && /* @__PURE__ */ B("div", {
757
+ h && /* @__PURE__ */ z("div", {
704
758
  style: {
705
759
  flex: "1 1 0",
706
760
  minWidth: 0
707
761
  },
708
- children: [/* @__PURE__ */ B("div", {
762
+ children: [/* @__PURE__ */ z("div", {
709
763
  style: {
710
764
  display: "flex",
711
765
  alignItems: "center",
@@ -713,7 +767,7 @@ function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, high
713
767
  flexWrap: "wrap"
714
768
  },
715
769
  children: [
716
- /* @__PURE__ */ z("h1", {
770
+ /* @__PURE__ */ R("h1", {
717
771
  style: {
718
772
  margin: 0,
719
773
  fontSize: "var(--page-title-size, var(--page-title-size-detail))",
@@ -730,13 +784,13 @@ function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, high
730
784
  },
731
785
  children: r
732
786
  }),
733
- a && /* @__PURE__ */ z(se, { value: a }),
734
- o && /* @__PURE__ */ z(ce, {
787
+ a && /* @__PURE__ */ R(se, { value: a }),
788
+ o && /* @__PURE__ */ R(ce, {
735
789
  label: o,
736
790
  "data-testid": "detail-description-info"
737
791
  }),
738
792
  m,
739
- c === "edit" && l && /* @__PURE__ */ B("span", {
793
+ c === "edit" && l && /* @__PURE__ */ z("span", {
740
794
  style: {
741
795
  display: "inline-flex",
742
796
  alignItems: "center",
@@ -744,26 +798,26 @@ function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, high
744
798
  fontSize: 11,
745
799
  color: "var(--warn)"
746
800
  },
747
- children: [/* @__PURE__ */ z("span", { style: {
801
+ children: [/* @__PURE__ */ R("span", { style: {
748
802
  width: 6,
749
803
  height: 6,
750
804
  borderRadius: 999,
751
805
  background: "var(--warn)"
752
806
  } }), "Unsaved"]
753
807
  }),
754
- c === "create" && /* @__PURE__ */ z(d, {
808
+ c === "create" && /* @__PURE__ */ R(d, {
755
809
  tone: "violet",
756
810
  size: "xs",
757
811
  dot: !0,
758
812
  children: "New record"
759
813
  })
760
814
  ]
761
- }), s && c === "display" && /* @__PURE__ */ z("div", {
815
+ }), s && c === "display" && /* @__PURE__ */ R("div", {
762
816
  style: { marginTop: 8 },
763
817
  children: s
764
818
  })]
765
819
  }),
766
- p && /* @__PURE__ */ z("div", {
820
+ p && /* @__PURE__ */ R("div", {
767
821
  role: "toolbar",
768
822
  "aria-label": "Page actions",
769
823
  style: {
@@ -782,7 +836,7 @@ function G({ icon: t, avatarName: n, title: r, recordId: a, description: o, high
782
836
  }
783
837
  //#endregion
784
838
  //#region src/lib/children-validation.ts
785
- function dt(e, t, n) {
839
+ function gt(e, t, n) {
786
840
  let r = [];
787
841
  for (let [i, a] of e.fields) {
788
842
  if (!a.required || a.auto || n && a.primary || e.tenant_key && i === e.tenant_key || a.default !== void 0 && a.default !== null) continue;
@@ -791,17 +845,17 @@ function dt(e, t, n) {
791
845
  }
792
846
  return r;
793
847
  }
794
- var ft = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
795
- function pt(e, t) {
848
+ var G = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
849
+ function _t(e, t) {
796
850
  let n = [];
797
851
  for (let [r, i] of e.fields) {
798
852
  if (i.type !== "email") continue;
799
853
  let e = t[r];
800
- typeof e == "string" && e !== "" && !ft.test(e) && n.push(r);
854
+ typeof e == "string" && e !== "" && !G.test(e) && n.push(r);
801
855
  }
802
856
  return n;
803
857
  }
804
- function mt(e, t) {
858
+ function vt(e, t) {
805
859
  let n = /* @__PURE__ */ new Set();
806
860
  for (let r of Object.values(t.entities)) if (r.children) {
807
861
  for (let t of r.children) if (t.entity === e && t.foreign_key) {
@@ -811,13 +865,13 @@ function mt(e, t) {
811
865
  }
812
866
  return n;
813
867
  }
814
- function ht(e, t) {
868
+ function yt(e, t) {
815
869
  if (!e || !t) return {};
816
870
  let n = {};
817
871
  for (let [r, i] of Object.entries(e)) {
818
872
  let e = t.entities[r];
819
873
  if (!e) continue;
820
- let a = mt(r, t), o = [];
874
+ let a = vt(r, t), o = [];
821
875
  for (let [t, n] of e.fields) e.tenant_key && t === e.tenant_key || n.required && !n.auto && !n.primary && !a.has(t) && o.push(t);
822
876
  if (o.length !== 0) for (let e of i) {
823
877
  if (e._deleted) continue;
@@ -833,29 +887,29 @@ function ht(e, t) {
833
887
  }
834
888
  //#endregion
835
889
  //#region src/components/pages/SmartDetailPage.impl.tsx
836
- var gt = () => {};
837
- function _t(e, t) {
890
+ var bt = () => {};
891
+ function xt(e, t) {
838
892
  return e.length === t.length && JSON.stringify(e) === JSON.stringify(t);
839
893
  }
840
- function vt(e, t) {
894
+ function St(e, t) {
841
895
  if (e) {
842
896
  let n = C(re(e, t));
843
897
  if (n.replace(/^\|+|\|+$/g, "")) return n;
844
898
  }
845
899
  return t.id == null ? crypto.randomUUID() : _(t.id);
846
900
  }
847
- function yt({ screenCode: e }) {
848
- return /* @__PURE__ */ z(O, { children: /* @__PURE__ */ z(K, { screenCode: e }) });
901
+ function Ct({ screenCode: e }) {
902
+ return /* @__PURE__ */ R(O, { children: /* @__PURE__ */ R(wt, { screenCode: e }) });
849
903
  }
850
- function K({ screenCode: t }) {
851
- let { id: r } = Ye(), o = u(), [c, d] = Xe(), { data: _ } = ee(), b = m((e) => e.user), x = g(), S = ae(), w = _?.screens[t], T = w?.entity ? _?.entities[w.entity] : void 0, D = w?.entity, O = h(T, "create"), k = h(T, "update"), oe = h(T, "delete"), se = h(T, "restore"), ce = (() => {
904
+ function wt({ screenCode: t }) {
905
+ let { id: r } = Qe(), o = u(), [c, d] = $e(), { data: _ } = ee(), b = m((e) => e.user), x = g(), S = ae(), w = _?.screens[t], T = w?.entity ? _?.entities[w.entity] : void 0, D = w?.entity, O = h(T, "create"), k = h(T, "update"), se = h(T, "delete"), ce = h(T, "restore"), le = (() => {
852
906
  if (!T || !T.singleton || !T.prefilter) return;
853
907
  let e = ne(T);
854
908
  if (e.length !== 1) return;
855
909
  let t = T.prefilter[e[0]];
856
910
  if (t === "$caller.user_id") return b?.id;
857
911
  if (t === "$caller.tenant_id") return b?.tenant?.id;
858
- })(), A = ce !== void 0, j = A ? ce : r, M = !A && j === "new", N = L(() => {
912
+ })(), A = le !== void 0, j = A ? le : r, M = !A && j === "new", N = I(() => {
859
913
  if (!j || M) return;
860
914
  if (!T) return j;
861
915
  let e = ne(T);
@@ -869,18 +923,18 @@ function K({ screenCode: t }) {
869
923
  j,
870
924
  M,
871
925
  T
872
- ]), ge = L(() => {
926
+ ]), P = I(() => {
873
927
  if (N) return typeof N == "string" ? N : C(N);
874
- }, [N]), P = ke(D, N), { data: be, isLoading: xe, error: Ce } = P, Ae = Fe((e) => e.degradedEntities), je = D ? ye(T?.realtime, Ae, D) : !1;
875
- pe(Ne(D, N), !M);
876
- let Le = ve(D ?? ""), Be = _e(D ?? ""), Ve = we(D ?? ""), He = Te(D ?? ""), Ue = Object.keys(T?.status_groups ?? {}).length > 0, Ke = be?.data, Ze = Ke?.$statuses, Qe = Ke?.$properties, tt = c.get("edit") === "true", [nt, rt] = R(M || tt), [V, at] = R({}), [H, st] = R({}), [U, lt] = R({}), [W, G] = R(void 0), [ft, mt] = R(!1), [yt, K] = R(void 0), [xt, St] = R({ show: !1 }), [wt, Tt] = R(!1), Et = M ? O : k, q = nt && Et, Dt = n();
877
- p(q && !M, Dt.enabled);
878
- let [Ot, kt] = R(() => {
928
+ }, [N]), me = Oe(D, N), { data: ge, isLoading: be, error: xe } = me, Se = Te((e) => e.degradedEntities), Ce = D ? ve(T?.realtime, Se, D) : !1;
929
+ ue(je(D, N), !M);
930
+ let De = we(D ?? ""), Pe = Fe(D ?? ""), Re = _e(D ?? ""), He = ye(D ?? ""), Ue = Object.keys(T?.status_groups ?? {}).length > 0, We = ge?.data, Ge = We?.$statuses, Je = We?.$properties, et = c.get("edit") === "true", [tt, it] = L(M || et), [B, at] = L({}), [V, st] = L({}), [H, lt] = L({}), [U, W] = L(void 0), [dt, pt] = L(!1), [ht, G] = L(void 0), [vt, Ct] = L({ show: !1 }), [wt, K] = L(!1), Et = M ? O : k, q = tt && Et, Ot = n();
931
+ p(q && !M, Ot.enabled);
932
+ let [kt, At] = L(() => {
879
933
  let e = parseInt(w?.sidebar_width || "380", 10);
880
934
  return isNaN(e) ? 380 : e;
881
- }), At = qe(null), J = qe(null), jt = F((e) => {
935
+ }), jt = Xe(null), J = Xe(null), Mt = F((e) => {
882
936
  e.preventDefault();
883
- let t = At.current;
937
+ let t = jt.current;
884
938
  if (!t) return;
885
939
  let n = t.offsetWidth;
886
940
  J.current = {
@@ -892,28 +946,28 @@ function K({ screenCode: t }) {
892
946
  let n = J.current.startX - e.clientX, r = Math.max(280, Math.min(800, J.current.startW + n));
893
947
  t.style.width = `${r}px`;
894
948
  }, i = () => {
895
- J.current && t && kt(parseInt(t.style.width, 10) || J.current.startW), J.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
949
+ J.current && t && At(parseInt(t.style.width, 10) || J.current.startW), J.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
896
950
  };
897
951
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
898
- }, []), Y = be?.data, X = typeof Y?.$row_version == "string" ? Y.$row_version : void 0, Mt = Y?.$refs, Nt = qe(X);
899
- I(() => {
952
+ }, []), Y = ge?.data, X = typeof Y?.$row_version == "string" ? Y.$row_version : void 0, Nt = Y?.$refs, Pt = Xe(X);
953
+ Ye(() => {
900
954
  if (!X) return;
901
- let e = Nt.current;
902
- Nt.current = X, e && e !== X && nt && mt(!0);
903
- }, [nt, X]);
904
- let Pt = !!T?.soft_delete, Ft = Pt && Y != null && Y[T.soft_delete] != null, Z = Je(), It = qe(null);
905
- fe({ scrollElementRef: It });
906
- let Lt = !M && Ce instanceof f && Ce.status === 404, Rt = qe(null);
907
- I(() => {
908
- if (!Lt) return;
909
- let e = le(Z);
910
- Rt.current !== e && (Rt.current = e, me.getState().kill(e));
911
- }, [Lt, Z]);
912
- let { openTab: zt, updateTabTitle: Bt, findTabByPathname: Vt } = Re();
913
- I(() => {
914
- if (!T || A || Dt.enabled) return;
955
+ let e = Pt.current;
956
+ Pt.current = X, e && e !== X && tt && pt(!0);
957
+ }, [tt, X]);
958
+ let Ft = !!T?.soft_delete, It = Ft && Y != null && Y[T.soft_delete] != null, Z = Ze(), Lt = Xe(null);
959
+ de({ scrollElementRef: Lt });
960
+ let Rt = !M && xe instanceof f && xe.status === 404, zt = Xe(null);
961
+ Ye(() => {
962
+ if (!Rt) return;
963
+ let e = he(Z);
964
+ zt.current !== e && (zt.current = e, oe.getState().kill(e));
965
+ }, [Rt, Z]);
966
+ let { openTab: Bt, updateTabTitle: Vt, findTabByPathname: Ht } = Ve();
967
+ Ye(() => {
968
+ if (!T || A || Ot.enabled) return;
915
969
  let e = Z.pathname, t = E(w?.display?.name) || E(T.display.name), n = w?.display?.icon || T.display.icon;
916
- Vt(e) || zt({
970
+ Ht(e) || Bt({
917
971
  pathname: e,
918
972
  search: "",
919
973
  title: M ? `New ${t}` : t,
@@ -928,13 +982,13 @@ function K({ screenCode: t }) {
928
982
  T?.display.icon,
929
983
  M,
930
984
  A,
931
- Dt.enabled
932
- ]), I(() => {
933
- if (!Y || !T || A || Dt.enabled) return;
934
- let e = Vt(Z.pathname);
985
+ Ot.enabled
986
+ ]), Ye(() => {
987
+ if (!Y || !T || A || Ot.enabled) return;
988
+ let e = Ht(Z.pathname);
935
989
  if (e) {
936
990
  let t = E(w?.display?.name) || E(T.display.name), n = v(Y, T), r = n && !String(n).startsWith("/") ? String(n) : t;
937
- Bt(e.id, r);
991
+ Vt(e.id, r);
938
992
  }
939
993
  }, [
940
994
  Y,
@@ -942,20 +996,20 @@ function K({ screenCode: t }) {
942
996
  T?.display.display_field,
943
997
  Z.pathname,
944
998
  A,
945
- Dt.enabled
999
+ Ot.enabled
946
1000
  ]);
947
- let Ht = L(() => {
1001
+ let Ut = I(() => {
948
1002
  if (!T || !Et) return /* @__PURE__ */ new Set();
949
1003
  let e = /* @__PURE__ */ new Set();
950
1004
  for (let [t, n] of T.fields) !n.auto && !n.primary && e.add(t);
951
1005
  for (let [t] of T.files ?? []) e.add(t);
952
1006
  return e;
953
1007
  }, [T, Et]);
954
- I(() => {
955
- if (!(!tt || !Y || !T || !k)) {
956
- if (nt || rt(!0), Object.keys(V).length === 0) {
957
- let e = j ? ue(j) : null;
958
- e && De(Ee({
1008
+ Ye(() => {
1009
+ if (!(!et || !Y || !T || !k)) {
1010
+ if (tt || it(!0), Object.keys(B).length === 0) {
1011
+ let e = j ? pe(j) : null;
1012
+ e && Ie(Ne({
959
1013
  entity: T,
960
1014
  formData: e,
961
1015
  record: void 0,
@@ -967,17 +1021,17 @@ function K({ screenCode: t }) {
967
1021
  });
968
1022
  });
969
1023
  let t = {};
970
- Ht.forEach((n) => {
1024
+ Ut.forEach((n) => {
971
1025
  let r = e ? e[n] : void 0;
972
1026
  if (r !== void 0) {
973
1027
  t[n] = r;
974
1028
  return;
975
1029
  }
976
- let i = he(T, Y, n);
977
- t[n] = Se(T, n) ? i ?? null : i ?? "";
1030
+ let i = ke(T, Y, n);
1031
+ t[n] = Me(T, n) ? i ?? null : i ?? "";
978
1032
  }), at(t);
979
1033
  }
980
- if (T.children !== void 0 && T.children.length > 0 && W === void 0) {
1034
+ if (T.children !== void 0 && T.children.length > 0 && U === void 0) {
981
1035
  let e = Y.$children;
982
1036
  if (e && Object.keys(e).length > 0) {
983
1037
  let t = {};
@@ -985,11 +1039,11 @@ function K({ screenCode: t }) {
985
1039
  let e = _?.entities[n];
986
1040
  t[n] = r.map((t) => ({
987
1041
  ...t,
988
- _key: vt(e, t)
1042
+ _key: St(e, t)
989
1043
  }));
990
1044
  }
991
- G(t), K(e);
992
- } else G({}), K({});
1045
+ W(t), G(e);
1046
+ } else W({}), G({});
993
1047
  }
994
1048
  d((e) => {
995
1049
  let t = new URLSearchParams(e);
@@ -997,112 +1051,112 @@ function K({ screenCode: t }) {
997
1051
  }, { replace: !0 });
998
1052
  }
999
1053
  }, [
1000
- tt,
1054
+ et,
1001
1055
  Y,
1002
- Ht,
1056
+ Ut,
1003
1057
  k,
1004
1058
  T,
1005
- W,
1059
+ U,
1006
1060
  _
1007
- ]), I(() => {
1008
- !M || !O || !T?.children || T.children.length === 0 || W === void 0 && (G({}), K({}));
1061
+ ]), Ye(() => {
1062
+ !M || !O || !T?.children || T.children.length === 0 || U === void 0 && (W({}), G({}));
1009
1063
  }, [
1010
1064
  M,
1011
1065
  O,
1012
1066
  T?.children
1013
1067
  ]);
1014
- let Ut = F(async () => {
1068
+ let Wt = F(async () => {
1015
1069
  if (await x.flushAllDrafts(), M) {
1016
1070
  let e = w?.route?.replace("/:id", "") ?? "/";
1017
1071
  o(e);
1018
- } else rt(!1), at({}), st({}), lt({}), G(void 0), K(void 0), Tt(!1);
1072
+ } else it(!1), at({}), st({}), lt({}), W(void 0), G(void 0), K(!1);
1019
1073
  }, [
1020
1074
  x,
1021
1075
  M,
1022
1076
  w,
1023
1077
  o
1024
- ]), Wt = F((e, t) => {
1078
+ ]), Gt = F((e, t) => {
1025
1079
  at((n) => ({
1026
1080
  ...n,
1027
1081
  [e]: t
1028
1082
  }));
1029
- }, []), Q = L(() => {
1083
+ }, []), Q = I(() => {
1030
1084
  if (!w?.route) return "/";
1031
1085
  let e = w.route.split("/");
1032
1086
  return e.pop(), e.join("/") || "/";
1033
- }, [w]), Gt = L(() => !_?.screens || !Q || Q === "/" ? !1 : Object.values(_.screens).some((e) => e.route === Q), [_, Q]), Kt = Oe({ fallback: F(() => {
1034
- if (!Gt) {
1087
+ }, [w]), Kt = I(() => !_?.screens || !Q || Q === "/" ? !1 : Object.values(_.screens).some((e) => e.route === Q), [_, Q]), qt = Ee({ fallback: F(() => {
1088
+ if (!Kt) {
1035
1089
  o("/");
1036
1090
  return;
1037
1091
  }
1038
- let e = Vt(Q)?.search ?? "";
1092
+ let e = Ht(Q)?.search ?? "";
1039
1093
  o(e ? `${Q}?${e}` : Q);
1040
1094
  }, [
1041
- Gt,
1095
+ Kt,
1042
1096
  Q,
1043
- Vt,
1097
+ Ht,
1044
1098
  o
1045
- ]) }), qt = !A && (Kt.hasOriginBack || Kt.allowFallbackBack && !!Gt), Jt = te(), Yt = L(() => {
1099
+ ]) }), Jt = !A && (qt.hasOriginBack || qt.allowFallbackBack && !!Kt), Yt = te(), Xt = I(() => {
1046
1100
  if (!T) return {};
1047
1101
  let e = {};
1048
- for (let t of dt(T, V, M)) Ht.has(t) && (e[t] = "Required");
1049
- for (let t of pt(T, V)) Ht.has(t) && (e[t] = "Invalid email address");
1102
+ for (let t of gt(T, B, M)) Ut.has(t) && (e[t] = "Required");
1103
+ for (let t of _t(T, B)) Ut.has(t) && (e[t] = "Invalid email address");
1050
1104
  return e;
1051
1105
  }, [
1052
1106
  T,
1053
- V,
1107
+ B,
1054
1108
  M,
1055
- Ht
1056
- ]), Xt = Object.keys(Yt).length > 0, Zt = F(() => {
1057
- if (!D || !T || M && !O || !M && !k || (Tt(!0), Xt)) return;
1058
- let e = {}, t = Ee({
1109
+ Ut
1110
+ ]), Zt = Object.keys(Xt).length > 0, Qt = F(() => {
1111
+ if (!D || !T || M && !O || !M && !k || (K(!0), Zt)) return;
1112
+ let e = {}, t = Ne({
1059
1113
  entity: T,
1060
- formData: V,
1114
+ formData: B,
1061
1115
  record: Y,
1062
1116
  isNew: M
1063
- }), n = De(t);
1064
- if (M) for (let [t, n] of Object.entries(V)) {
1117
+ }), n = Ie(t);
1118
+ if (M) for (let [t, n] of Object.entries(B)) {
1065
1119
  if (T.files?.has(t)) continue;
1066
- let r = Pe(T, t, n);
1120
+ let r = Ae(T, t, n);
1067
1121
  r !== "" && r != null && (e[t] = r);
1068
1122
  }
1069
1123
  else {
1070
- for (let [t, n] of Object.entries(V)) {
1124
+ for (let [t, n] of Object.entries(B)) {
1071
1125
  if (T.files?.has(t)) continue;
1072
- let r = Y ? he(T, Y, t) : void 0, i = Pe(T, t, n), a = Pe(T, t, r);
1126
+ let r = Y ? ke(T, Y, t) : void 0, i = Ae(T, t, n), a = Ae(T, t, r);
1073
1127
  (i === "" ? null : i) !== (a === "" || a === void 0 ? null : a) && (e[t] = i);
1074
1128
  }
1075
1129
  X && (e.$row_version = X);
1076
1130
  }
1077
- if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(H).length > 0 && (e.$statuses = Object.entries(H).map(([e, t]) => ({
1131
+ if (Object.keys(t).length > 0 && (e.$files = t), Object.keys(V).length > 0 && (e.$statuses = Object.entries(V).map(([e, t]) => ({
1078
1132
  status_group_code: e,
1079
1133
  status_code: t
1080
- }))), Object.keys(U).length > 0 && (e.$properties = Object.entries(U).map(([e, t]) => ({
1134
+ }))), Object.keys(H).length > 0 && (e.$properties = Object.entries(H).map(([e, t]) => ({
1081
1135
  property_code: e,
1082
1136
  value: t
1083
- }))), W) {
1137
+ }))), U) {
1084
1138
  let t = {};
1085
- for (let [e, n] of Object.entries(W)) {
1139
+ for (let [e, n] of Object.entries(U)) {
1086
1140
  let r = n.filter((e) => !e._deleted).map((e) => {
1087
1141
  let { _key: t, _deleted: n, _dirty: r, ...i } = e;
1088
1142
  return i;
1089
- }), i = yt?.[e] ?? [];
1090
- (M || !_t(r, i)) && (t[e] = r);
1143
+ }), i = ht?.[e] ?? [];
1144
+ (M || !xt(r, i)) && (t[e] = r);
1091
1145
  }
1092
1146
  Object.keys(t).length > 0 && (e.$children = t);
1093
1147
  }
1094
1148
  if (!M && Object.keys(e).length === 0) {
1095
- rt(!1), st({}), lt({}), G(void 0), K(void 0), Tt(!1);
1149
+ it(!1), st({}), lt({}), W(void 0), G(void 0), K(!1);
1096
1150
  return;
1097
1151
  }
1098
1152
  let r = () => {
1099
- rt(!1), mt(!1), Tt(!1), st({}), lt({}), G(void 0), K(void 0);
1153
+ it(!1), pt(!1), K(!1), st({}), lt({}), W(void 0), G(void 0);
1100
1154
  };
1101
- M ? Le.mutate(e, { onSuccess: (e) => {
1155
+ M ? De.mutate(e, { onSuccess: (e) => {
1102
1156
  n.forEach((e) => x.markCommitted(e));
1103
1157
  let t = e.data, i = C(T ? re(T, t) : {});
1104
1158
  o(i ? `${Q}/${encodeURIComponent(i)}` : Q, { replace: !0 }), r();
1105
- } }) : N && Be.mutate({
1159
+ } }) : N && Pe.mutate({
1106
1160
  pkValues: N,
1107
1161
  data: e
1108
1162
  }, {
@@ -1110,7 +1164,7 @@ function K({ screenCode: t }) {
1110
1164
  n.forEach((e) => x.markCommitted(e)), r();
1111
1165
  },
1112
1166
  onError: (e) => {
1113
- e instanceof f && e.code === "STALE_OBJECT" && mt(!0);
1167
+ e instanceof f && e.code === "STALE_OBJECT" && pt(!0);
1114
1168
  }
1115
1169
  });
1116
1170
  }, [
@@ -1119,61 +1173,61 @@ function K({ screenCode: t }) {
1119
1173
  O,
1120
1174
  k,
1121
1175
  D,
1176
+ B,
1177
+ Zt,
1122
1178
  V,
1123
- Xt,
1124
1179
  H,
1125
1180
  U,
1126
- W,
1127
- yt,
1128
- Le,
1129
- Be,
1181
+ ht,
1182
+ De,
1183
+ Pe,
1130
1184
  T,
1131
1185
  o,
1132
1186
  Q,
1133
1187
  Y,
1134
1188
  X,
1135
1189
  N
1136
- ]), Qt = F((e, t) => {
1137
- G((n) => ({
1190
+ ]), $t = F((e, t) => {
1191
+ W((n) => ({
1138
1192
  ...n ?? {},
1139
1193
  [e]: t
1140
1194
  }));
1141
- }, []), $t = F(() => {
1142
- !N || M || !oe || Ve.mutate(N, { onSuccess: () => {
1143
- me.getState().kill(le(Z)), o(Q, { replace: !0 });
1195
+ }, []), en = F(() => {
1196
+ !N || M || !se || Re.mutate(N, { onSuccess: () => {
1197
+ oe.getState().kill(he(Z)), o(Q, { replace: !0 });
1144
1198
  } });
1145
1199
  }, [
1146
1200
  N,
1147
1201
  M,
1148
- oe,
1149
- Ve,
1202
+ se,
1203
+ Re,
1150
1204
  o,
1151
1205
  Q,
1152
1206
  Z
1153
- ]), en = F(() => {
1154
- !N || M || !se || He.mutate(N);
1207
+ ]), tn = F(() => {
1208
+ !N || M || !ce || He.mutate(N);
1155
1209
  }, [
1156
1210
  N,
1157
1211
  M,
1158
- se,
1212
+ ce,
1159
1213
  He
1160
- ]), tn = L(() => ht(W, _), [W, _]), nn = Object.keys(tn).length > 0;
1214
+ ]), nn = I(() => yt(U, _), [U, _]), rn = Object.keys(nn).length > 0;
1161
1215
  if (!w || !T) return null;
1162
- if (!M && xe) return /* @__PURE__ */ z(ze, {});
1163
- if (!M && !Y || Lt) return /* @__PURE__ */ B("div", {
1216
+ if (!M && be) return /* @__PURE__ */ R(Be, {});
1217
+ if (!M && !Y || Rt) return /* @__PURE__ */ z("div", {
1164
1218
  style: { padding: 24 },
1165
- children: [/* @__PURE__ */ B("div", {
1219
+ children: [/* @__PURE__ */ z("div", {
1166
1220
  style: {
1167
1221
  display: "flex",
1168
1222
  alignItems: "center",
1169
1223
  gap: 8,
1170
1224
  marginBottom: 8
1171
1225
  },
1172
- children: [qt && /* @__PURE__ */ z(i, {
1173
- icon: /* @__PURE__ */ z(e.back, { size: 14 }),
1174
- onClick: Kt.goBack,
1226
+ children: [Jt && /* @__PURE__ */ R(i, {
1227
+ icon: /* @__PURE__ */ R(e.back, { size: 14 }),
1228
+ onClick: qt.goBack,
1175
1229
  title: "Back"
1176
- }), /* @__PURE__ */ z("h1", {
1230
+ }), /* @__PURE__ */ R("h1", {
1177
1231
  style: {
1178
1232
  margin: 0,
1179
1233
  fontSize: 18,
@@ -1182,35 +1236,35 @@ function K({ screenCode: t }) {
1182
1236
  },
1183
1237
  children: "Not Found"
1184
1238
  })]
1185
- }), /* @__PURE__ */ z("p", {
1239
+ }), /* @__PURE__ */ R("p", {
1186
1240
  style: { color: "var(--text-3)" },
1187
1241
  children: "Record not found."
1188
1242
  })]
1189
1243
  });
1190
- let rn = T.display, an = E(w.display?.name) || E(rn.name), on = v(Y, T), sn = M ? `New ${an}` : on ? String(on) : an, cn = Le.isPending || Be.isPending, ln = w.responsive?.[S.category]?.layout, un = ln?.tabs ?? (S.isPhone ? "sections" : void 0), dn = ln?.header_card === !0 ? Ie({
1244
+ let an = T.display, on = E(w.display?.name) || E(an.name), sn = v(Y, T), cn = M ? `New ${on}` : sn ? String(sn) : on, ln = De.isPending || Pe.isPending, un = w.responsive?.[S.category]?.layout, dn = un?.tabs ?? (S.isPhone ? "sections" : void 0), fn = un?.header_card === !0 ? Le({
1191
1245
  entity: T,
1192
1246
  screen: w
1193
1247
  }) : void 0, $ = {
1194
1248
  schema: _,
1195
1249
  entity: T,
1196
1250
  entityCode: D,
1197
- recordId: ge ?? j ?? "",
1251
+ recordId: P ?? j ?? "",
1198
1252
  record: q ? {
1199
1253
  ...Y ?? {},
1200
- ...V
1254
+ ...B
1201
1255
  } : Y ?? {},
1202
1256
  isNew: M,
1203
1257
  mode: q ? "edit" : "display",
1204
- onFieldChange: q ? Wt : void 0,
1205
- refs: Mt,
1258
+ onFieldChange: q ? Gt : void 0,
1259
+ refs: Nt,
1206
1260
  objectProperties: (() => {
1207
- let e = Qe ?? [];
1208
- if (!q || Object.keys(U).length === 0) return e.length > 0 ? e : void 0;
1209
- let t = e.map((e) => U[e.property_code] === void 0 ? e : {
1261
+ let e = Je ?? [];
1262
+ if (!q || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
1263
+ let t = e.map((e) => H[e.property_code] === void 0 ? e : {
1210
1264
  ...e,
1211
- value: U[e.property_code]
1265
+ value: H[e.property_code]
1212
1266
  });
1213
- for (let [n, r] of Object.entries(U)) e.some((e) => e.property_code === n) || t.push({
1267
+ for (let [n, r] of Object.entries(H)) e.some((e) => e.property_code === n) || t.push({
1214
1268
  property_code: n,
1215
1269
  name: {},
1216
1270
  type: "string",
@@ -1224,13 +1278,13 @@ function K({ screenCode: t }) {
1224
1278
  })) : void 0,
1225
1279
  isPropertyPending: !1,
1226
1280
  objectStatuses: (() => {
1227
- let e = Ze ?? [];
1228
- if (!q || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
1229
- let t = e.map((e) => H[e.group_code] === void 0 ? e : {
1281
+ let e = Ge ?? [];
1282
+ if (!q || Object.keys(V).length === 0) return e.length > 0 ? e : void 0;
1283
+ let t = e.map((e) => V[e.group_code] === void 0 ? e : {
1230
1284
  ...e,
1231
- status_code: H[e.group_code]
1285
+ status_code: V[e.group_code]
1232
1286
  });
1233
- for (let [n, r] of Object.entries(H)) e.some((e) => e.group_code === n) || t.push({
1287
+ for (let [n, r] of Object.entries(V)) e.some((e) => e.group_code === n) || t.push({
1234
1288
  group_code: n,
1235
1289
  status_code: r,
1236
1290
  status_name: {},
@@ -1243,32 +1297,32 @@ function K({ screenCode: t }) {
1243
1297
  [e]: t
1244
1298
  })) : void 0,
1245
1299
  isStatusPending: !1,
1246
- pendingChildren: q ? W : void 0,
1247
- onChildrenChange: q ? Qt : void 0,
1248
- childValidationErrors: q ? tn : void 0,
1249
- fieldErrors: q && wt ? Yt : void 0,
1250
- detailTabsPresentation: un,
1251
- relatedRecordsPresentation: ln?.related_records
1252
- }, fn = !!w.sidebar && w.sidebar.length > 0, pn = ln?.sidebar === "hidden", mn = fn && !pn && !S.isDesktop, hn = fn && !pn && S.isDesktop, gn = !M && Y ? /* @__PURE__ */ z(ct, {
1300
+ pendingChildren: q ? U : void 0,
1301
+ onChildrenChange: q ? $t : void 0,
1302
+ childValidationErrors: q ? nn : void 0,
1303
+ fieldErrors: q && wt ? Xt : void 0,
1304
+ detailTabsPresentation: dn,
1305
+ relatedRecordsPresentation: un?.related_records
1306
+ }, pn = !!w.sidebar && w.sidebar.length > 0, mn = un?.sidebar === "hidden", hn = pn && !mn && !S.isDesktop, gn = pn && !mn && S.isDesktop, _n = !M && Y ? /* @__PURE__ */ R(ut, {
1253
1307
  screen: w,
1254
1308
  entity: T,
1255
1309
  entityCode: D,
1256
1310
  record: Y,
1257
- refs: Mt,
1258
- objectStatuses: Ze,
1311
+ refs: Nt,
1312
+ objectStatuses: Ge,
1259
1313
  schema: _,
1260
- locale: Jt
1261
- }) : void 0, _n = /* @__PURE__ */ z(Ct, {
1262
- title: sn,
1314
+ locale: Yt
1315
+ }) : void 0, vn = /* @__PURE__ */ R(Dt, {
1316
+ title: cn,
1263
1317
  recordId: j,
1264
1318
  editing: q,
1265
1319
  isNew: M,
1266
- isRecordDeleted: Ft,
1267
- dirty: nt,
1268
- isSaving: cn,
1269
- hasChildErrors: nn,
1270
- hasFieldErrors: wt && Xt,
1271
- canRestore: se,
1320
+ isRecordDeleted: It,
1321
+ dirty: tt,
1322
+ isSaving: ln,
1323
+ hasChildErrors: rn,
1324
+ hasFieldErrors: wt && Zt,
1325
+ canRestore: ce,
1272
1326
  entity: T,
1273
1327
  screen: w,
1274
1328
  globalActions: _?.actions,
@@ -1276,23 +1330,23 @@ function K({ screenCode: t }) {
1276
1330
  record: Y,
1277
1331
  id: j,
1278
1332
  listRoute: Q,
1279
- listRouteExists: !!Gt,
1280
- highlights: gn,
1281
- showBack: qt,
1282
- onBack: Kt.goBack,
1283
- onCancelEdit: Ut,
1284
- onSave: Zt,
1285
- onRestore: en,
1333
+ listRouteExists: !!Kt,
1334
+ highlights: _n,
1335
+ showBack: Jt,
1336
+ onBack: qt.goBack,
1337
+ onCancelEdit: Wt,
1338
+ onSave: Qt,
1339
+ onRestore: tn,
1286
1340
  isRestoring: He.isPending,
1287
1341
  refreshControl: {
1288
- refetch: P.refetch,
1289
- isFetching: P.isFetching,
1290
- isLoading: P.isLoading,
1291
- isLive: je
1342
+ refetch: me.refetch,
1343
+ isFetching: me.isFetching,
1344
+ isLoading: me.isLoading,
1345
+ isLive: Ce
1292
1346
  },
1293
1347
  isRealtimeEntity: T?.realtime === !0,
1294
- canManageTemplates: de(_)
1295
- }), vn = Ft && /* @__PURE__ */ B("div", {
1348
+ canManageTemplates: fe(_)
1349
+ }), yn = It && /* @__PURE__ */ z("div", {
1296
1350
  style: {
1297
1351
  display: "flex",
1298
1352
  alignItems: "center",
@@ -1305,8 +1359,8 @@ function K({ screenCode: t }) {
1305
1359
  color: "var(--danger)",
1306
1360
  fontSize: 12.5
1307
1361
  },
1308
- children: [/* @__PURE__ */ z(e.warning, { size: 14 }), /* @__PURE__ */ B("span", { children: ["This record was deleted on ", a(String(Y[T.soft_delete]))] })]
1309
- }), yn = ft && /* @__PURE__ */ B("div", {
1362
+ children: [/* @__PURE__ */ R(e.warning, { size: 14 }), /* @__PURE__ */ z("span", { children: ["This record was deleted on ", a(String(Y[T.soft_delete]))] })]
1363
+ }), bn = dt && /* @__PURE__ */ z("div", {
1310
1364
  style: {
1311
1365
  display: "flex",
1312
1366
  alignItems: "center",
@@ -1319,9 +1373,9 @@ function K({ screenCode: t }) {
1319
1373
  color: "var(--warn)",
1320
1374
  fontSize: 12.5
1321
1375
  },
1322
- children: [/* @__PURE__ */ z(e.warning, { size: 14 }), /* @__PURE__ */ z("span", { children: "This record changed on the server while you were viewing or editing it." })]
1323
- }), bn = q && wt && Xt && /* @__PURE__ */ z(ot, {
1324
- errors: Object.entries(Yt).map(([e, t]) => {
1376
+ children: [/* @__PURE__ */ R(e.warning, { size: 14 }), /* @__PURE__ */ R("span", { children: "This record changed on the server while you were viewing or editing it." })]
1377
+ }), xn = q && wt && Zt && /* @__PURE__ */ R(ct, {
1378
+ errors: Object.entries(Xt).map(([e, t]) => {
1325
1379
  let n = T.fields.get(e);
1326
1380
  return {
1327
1381
  name: e,
@@ -1336,61 +1390,64 @@ function K({ screenCode: t }) {
1336
1390
  behavior: "smooth"
1337
1391
  }), t.focus?.());
1338
1392
  }
1339
- }), xn = Ue && !M && !(w.items && w.items.length > 0) && /* @__PURE__ */ z("div", {
1393
+ }), Sn = Ue && !M && !(w.items && w.items.length > 0) && /* @__PURE__ */ R("div", {
1340
1394
  className: "mb-4",
1341
- children: /* @__PURE__ */ z(We, {
1395
+ children: /* @__PURE__ */ R(Ke, {
1342
1396
  statusGroups: T.status_groups ?? {},
1343
1397
  objectStatuses: $.objectStatuses,
1344
1398
  onSetStatus: k && q ? (e, t) => st((n) => ({
1345
1399
  ...n,
1346
1400
  [e]: t
1347
- })) : gt,
1401
+ })) : bt,
1348
1402
  isPending: !1,
1349
1403
  mode: q ? "edit" : "display"
1350
1404
  })
1351
- }), Sn = /* @__PURE__ */ B($e, { children: [
1352
- dn && (Y || M) && /* @__PURE__ */ z(bt, {
1353
- card: dn,
1405
+ }), Cn = T.evidence_covered && !M && Y && /* @__PURE__ */ R("div", {
1406
+ className: "mb-4",
1407
+ children: /* @__PURE__ */ R(mt, { evidence: Y.$evidence })
1408
+ }), wn = /* @__PURE__ */ z(nt, { children: [
1409
+ fn && (Y || M) && /* @__PURE__ */ R(Tt, {
1410
+ card: fn,
1354
1411
  entity: T,
1355
1412
  record: $.record,
1356
1413
  objectStatuses: $.objectStatuses,
1357
1414
  objectProperties: $.objectProperties
1358
1415
  }),
1359
- w.items && w.items.length > 0 && (Y || M) && _ && /* @__PURE__ */ z(Ge, {
1416
+ w.items && w.items.length > 0 && (Y || M) && _ && /* @__PURE__ */ R(qe, {
1360
1417
  nodes: w.items,
1361
1418
  ctx: $
1362
1419
  }),
1363
- !M && j && D && T.associations && Object.keys(T.associations).length > 0 && _ && /* @__PURE__ */ z(et, {
1420
+ !M && j && D && T.associations && Object.keys(T.associations).length > 0 && _ && /* @__PURE__ */ R(rt, {
1364
1421
  entityCode: D,
1365
- recordId: ge ?? j ?? "",
1422
+ recordId: P ?? j ?? "",
1366
1423
  associations: T.associations,
1367
1424
  schema: _
1368
1425
  }),
1369
- !M && j && D && /* @__PURE__ */ z(it, {
1426
+ !M && j && D && /* @__PURE__ */ R(ot, {
1370
1427
  entityCode: D,
1371
- objectId: ge ?? j,
1428
+ objectId: P ?? j,
1372
1429
  canGenerateOne: !!T?.documents?.generate_one,
1373
- canManageTemplates: de(_)
1430
+ canManageTemplates: fe(_)
1374
1431
  }),
1375
- !M && Y && _ && /* @__PURE__ */ z(ut, {
1432
+ !M && Y && _ && /* @__PURE__ */ R(ft, {
1376
1433
  screen: w,
1377
1434
  entity: T,
1378
1435
  entityCode: D,
1379
1436
  record: Y,
1380
- refs: Mt,
1437
+ refs: Nt,
1381
1438
  schema: _,
1382
- locale: Jt
1439
+ locale: Yt
1383
1440
  })
1384
- ] }), Cn = /* @__PURE__ */ z(Me, {
1385
- open: xt.show,
1386
- onOpenChange: (e) => !e && St({ show: !1 }),
1387
- title: `Delete ${an}`,
1388
- description: xt.confirmation ? xt.confirmation : Pt ? `Are you sure you want to delete this ${an.toLowerCase()}? It can be restored later by an admin.` : `Are you sure you want to delete this ${an.toLowerCase()}? This action cannot be undone.`,
1441
+ ] }), Tn = /* @__PURE__ */ R(ze, {
1442
+ open: vt.show,
1443
+ onOpenChange: (e) => !e && Ct({ show: !1 }),
1444
+ title: `Delete ${on}`,
1445
+ description: vt.confirmation ? vt.confirmation : Ft ? `Are you sure you want to delete this ${on.toLowerCase()}? It can be restored later by an admin.` : `Are you sure you want to delete this ${on.toLowerCase()}? This action cannot be undone.`,
1389
1446
  confirmLabel: "Delete",
1390
- onConfirm: $t,
1447
+ onConfirm: en,
1391
1448
  destructive: !0
1392
1449
  });
1393
- if (hn) return /* @__PURE__ */ B("div", {
1450
+ if (gn) return /* @__PURE__ */ z("div", {
1394
1451
  style: {
1395
1452
  height: "100%",
1396
1453
  display: "flex",
@@ -1398,7 +1455,7 @@ function K({ screenCode: t }) {
1398
1455
  background: "var(--background)"
1399
1456
  },
1400
1457
  children: [
1401
- /* @__PURE__ */ B("div", {
1458
+ /* @__PURE__ */ z("div", {
1402
1459
  style: {
1403
1460
  flex: 1,
1404
1461
  minWidth: 0,
@@ -1406,20 +1463,21 @@ function K({ screenCode: t }) {
1406
1463
  flexDirection: "column",
1407
1464
  height: "100%"
1408
1465
  },
1409
- children: [/* @__PURE__ */ B("div", {
1466
+ children: [/* @__PURE__ */ z("div", {
1410
1467
  style: {
1411
1468
  flexShrink: 0,
1412
1469
  padding: "14px 20px 8px"
1413
1470
  },
1414
1471
  children: [
1415
- _n,
1416
- yn,
1417
1472
  vn,
1418
1473
  bn,
1419
- xn
1474
+ yn,
1475
+ xn,
1476
+ Sn,
1477
+ Cn
1420
1478
  ]
1421
- }), /* @__PURE__ */ z("div", {
1422
- ref: It,
1479
+ }), /* @__PURE__ */ R("div", {
1480
+ ref: Lt,
1423
1481
  style: {
1424
1482
  flex: 1,
1425
1483
  minHeight: 0,
@@ -1429,14 +1487,14 @@ function K({ screenCode: t }) {
1429
1487
  flexDirection: "column",
1430
1488
  gap: 16
1431
1489
  },
1432
- children: Sn
1490
+ children: wn
1433
1491
  })]
1434
1492
  }),
1435
- /* @__PURE__ */ z("div", {
1493
+ /* @__PURE__ */ R("div", {
1436
1494
  className: "detail-resize-handle",
1437
- onMouseDown: jt,
1495
+ onMouseDown: Mt,
1438
1496
  title: "Drag to resize",
1439
- children: /* @__PURE__ */ z("div", { style: {
1497
+ children: /* @__PURE__ */ R("div", { style: {
1440
1498
  position: "absolute",
1441
1499
  top: 0,
1442
1500
  bottom: 0,
@@ -1446,23 +1504,23 @@ function K({ screenCode: t }) {
1446
1504
  background: "var(--border)"
1447
1505
  } })
1448
1506
  }),
1449
- /* @__PURE__ */ z("div", {
1450
- ref: At,
1507
+ /* @__PURE__ */ R("div", {
1508
+ ref: jt,
1451
1509
  style: {
1452
1510
  flexShrink: 0,
1453
1511
  height: "100%",
1454
- width: `${Ot}px`
1512
+ width: `${kt}px`
1455
1513
  },
1456
- children: (Y || M) && _ && /* @__PURE__ */ z(Ge, {
1514
+ children: (Y || M) && _ && /* @__PURE__ */ R(qe, {
1457
1515
  nodes: w.sidebar,
1458
1516
  ctx: $
1459
1517
  })
1460
1518
  }),
1461
- Cn
1519
+ Tn
1462
1520
  ]
1463
1521
  });
1464
- let wn = S.isPhone ? 12 : 24;
1465
- return /* @__PURE__ */ B("div", {
1522
+ let En = S.isPhone ? 12 : 24;
1523
+ return /* @__PURE__ */ z("div", {
1466
1524
  style: {
1467
1525
  height: "100%",
1468
1526
  display: "flex",
@@ -1471,33 +1529,34 @@ function K({ screenCode: t }) {
1471
1529
  background: "var(--background)"
1472
1530
  },
1473
1531
  children: [
1474
- /* @__PURE__ */ B("div", {
1532
+ /* @__PURE__ */ z("div", {
1475
1533
  style: {
1476
1534
  flexShrink: 0,
1477
1535
  padding: S.isPhone ? "14px 12px 8px" : "24px 24px 8px"
1478
1536
  },
1479
1537
  children: [
1480
- _n,
1481
- yn,
1482
1538
  vn,
1483
1539
  bn,
1484
- xn
1540
+ yn,
1541
+ xn,
1542
+ Sn,
1543
+ Cn
1485
1544
  ]
1486
1545
  }),
1487
- /* @__PURE__ */ B("div", {
1488
- ref: It,
1546
+ /* @__PURE__ */ z("div", {
1547
+ ref: Lt,
1489
1548
  style: {
1490
1549
  flex: 1,
1491
1550
  minHeight: 0,
1492
1551
  overflowY: "auto",
1493
- padding: `4px ${wn}px calc(24px + var(--safe-area-bottom, 0px))`,
1552
+ padding: `4px ${En}px calc(24px + var(--safe-area-bottom, 0px))`,
1494
1553
  display: "flex",
1495
1554
  flexDirection: "column",
1496
1555
  gap: 16,
1497
1556
  minWidth: 0,
1498
1557
  WebkitOverflowScrolling: "touch"
1499
1558
  },
1500
- children: [Sn, mn && (Y || M) && _ && /* @__PURE__ */ z("div", {
1559
+ children: [wn, hn && (Y || M) && _ && /* @__PURE__ */ R("div", {
1501
1560
  "data-testid": "detail-sidebar-inline",
1502
1561
  style: {
1503
1562
  display: "flex",
@@ -1505,25 +1564,25 @@ function K({ screenCode: t }) {
1505
1564
  gap: 16,
1506
1565
  minWidth: 0
1507
1566
  },
1508
- children: /* @__PURE__ */ z(Ge, {
1567
+ children: /* @__PURE__ */ R(qe, {
1509
1568
  nodes: w.sidebar,
1510
1569
  ctx: $
1511
1570
  })
1512
1571
  })]
1513
1572
  }),
1514
- Cn
1573
+ Tn
1515
1574
  ]
1516
1575
  });
1517
1576
  }
1518
- function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
1577
+ function Tt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
1519
1578
  let a = (e) => {
1520
- let a = xt(t, e, n, r, i);
1579
+ let a = K(t, e, n, r, i);
1521
1580
  return a != null && _(a) !== "";
1522
- }, o = (e) => _(xt(t, e, n, r, i)) || /* @__PURE__ */ z("span", {
1581
+ }, o = (e) => _(K(t, e, n, r, i)) || /* @__PURE__ */ R("span", {
1523
1582
  style: { color: "var(--text-3)" },
1524
1583
  children: "-"
1525
- }), s = _(e.titleUsesDisplay ? v(n, t) : e.titleField ? xt(t, e.titleField, n, r, i) : void 0) || E(t.display?.name) || "Record", c = e.badgeFields.filter((t) => !e.hideEmptyFields || a(t)), l = e.bodyFields.filter((t) => !e.hideEmptyFields || a(t)), u = e.metaFields.filter((t) => !e.hideEmptyFields || a(t));
1526
- return /* @__PURE__ */ B("section", {
1584
+ }), s = _(e.titleUsesDisplay ? v(n, t) : e.titleField ? K(t, e.titleField, n, r, i) : void 0) || E(t.display?.name) || "Record", c = e.badgeFields.filter((t) => !e.hideEmptyFields || a(t)), l = e.bodyFields.filter((t) => !e.hideEmptyFields || a(t)), u = e.metaFields.filter((t) => !e.hideEmptyFields || a(t));
1585
+ return /* @__PURE__ */ z("section", {
1527
1586
  "data-testid": "detail-header-card",
1528
1587
  style: {
1529
1588
  width: "100%",
@@ -1536,9 +1595,9 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1536
1595
  boxSizing: "border-box"
1537
1596
  },
1538
1597
  children: [
1539
- /* @__PURE__ */ B("div", {
1598
+ /* @__PURE__ */ z("div", {
1540
1599
  style: { minWidth: 0 },
1541
- children: [/* @__PURE__ */ z("div", {
1600
+ children: [/* @__PURE__ */ R("div", {
1542
1601
  style: {
1543
1602
  fontSize: 15,
1544
1603
  lineHeight: 1.25,
@@ -1547,7 +1606,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1547
1606
  overflowWrap: "anywhere"
1548
1607
  },
1549
1608
  children: s
1550
- }), e.subtitleField && /* @__PURE__ */ z("div", {
1609
+ }), e.subtitleField && /* @__PURE__ */ R("div", {
1551
1610
  style: {
1552
1611
  marginTop: 4,
1553
1612
  fontSize: 12.5,
@@ -1558,14 +1617,14 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1558
1617
  children: o(e.subtitleField)
1559
1618
  })]
1560
1619
  }),
1561
- c.length > 0 && /* @__PURE__ */ z("div", {
1620
+ c.length > 0 && /* @__PURE__ */ R("div", {
1562
1621
  style: {
1563
1622
  display: "flex",
1564
1623
  flexWrap: "wrap",
1565
1624
  gap: 6,
1566
1625
  marginTop: 10
1567
1626
  },
1568
- children: c.map((e) => /* @__PURE__ */ z("span", {
1627
+ children: c.map((e) => /* @__PURE__ */ R("span", {
1569
1628
  style: {
1570
1629
  minWidth: 0,
1571
1630
  maxWidth: "100%",
@@ -1580,7 +1639,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1580
1639
  children: o(e)
1581
1640
  }, e))
1582
1641
  }),
1583
- l.length > 0 && /* @__PURE__ */ z("dl", {
1642
+ l.length > 0 && /* @__PURE__ */ R("dl", {
1584
1643
  style: {
1585
1644
  display: "grid",
1586
1645
  gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
@@ -1589,12 +1648,12 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1589
1648
  fontSize: 12.5,
1590
1649
  lineHeight: 1.35
1591
1650
  },
1592
- children: l.map((e) => /* @__PURE__ */ B("div", {
1651
+ children: l.map((e) => /* @__PURE__ */ z("div", {
1593
1652
  style: { display: "contents" },
1594
- children: [/* @__PURE__ */ z("dt", {
1653
+ children: [/* @__PURE__ */ R("dt", {
1595
1654
  style: { color: "var(--text-3)" },
1596
- children: St(t, e)
1597
- }), /* @__PURE__ */ z("dd", {
1655
+ children: Et(t, e)
1656
+ }), /* @__PURE__ */ R("dd", {
1598
1657
  style: {
1599
1658
  margin: 0,
1600
1659
  color: "var(--text-2)",
@@ -1605,7 +1664,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1605
1664
  })]
1606
1665
  }, e))
1607
1666
  }),
1608
- u.length > 0 && /* @__PURE__ */ z("div", {
1667
+ u.length > 0 && /* @__PURE__ */ R("div", {
1609
1668
  style: {
1610
1669
  display: "flex",
1611
1670
  flexWrap: "wrap",
@@ -1614,13 +1673,13 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1614
1673
  color: "var(--text-3)",
1615
1674
  fontSize: 11.5
1616
1675
  },
1617
- children: u.map((e) => /* @__PURE__ */ B("span", {
1676
+ children: u.map((e) => /* @__PURE__ */ z("span", {
1618
1677
  style: {
1619
1678
  minWidth: 0,
1620
1679
  overflowWrap: "anywhere"
1621
1680
  },
1622
1681
  children: [
1623
- St(t, e),
1682
+ Et(t, e),
1624
1683
  ": ",
1625
1684
  o(e)
1626
1685
  ]
@@ -1629,7 +1688,7 @@ function bt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
1629
1688
  ]
1630
1689
  });
1631
1690
  }
1632
- function xt(e, t, n, r, i) {
1691
+ function K(e, t, n, r, i) {
1633
1692
  if (t.startsWith("$status.")) {
1634
1693
  let e = t.slice(8), n = r?.find((t) => t.group_code === e);
1635
1694
  return E(n?.status_name) || n?.status_code;
@@ -1638,16 +1697,16 @@ function xt(e, t, n, r, i) {
1638
1697
  let e = t.slice(10);
1639
1698
  return i?.find((t) => t.property_code === e)?.value;
1640
1699
  }
1641
- return he(e, n, t);
1700
+ return ke(e, n, t);
1642
1701
  }
1643
- function St(e, t) {
1702
+ function Et(e, t) {
1644
1703
  if (t.startsWith("$status.")) return t.slice(8);
1645
1704
  if (t.startsWith("$property.")) return t.slice(10);
1646
1705
  let n = e.fields.get(t);
1647
1706
  return n ? ie(n, t) : t;
1648
1707
  }
1649
- function Ct({ title: n, recordId: r, editing: i, isNew: a, isRecordDeleted: s, dirty: l, isSaving: d, hasChildErrors: f, hasFieldErrors: p, canRestore: m, entity: h, screen: g, globalActions: _, entityCode: v, record: y, id: b, listRoute: ee, listRouteExists: ne, highlights: S, showBack: C, onBack: re, onCancelEdit: ie, onSave: D, onRestore: O, isRestoring: k, refreshControl: ae, isRealtimeEntity: oe, canManageTemplates: se }) {
1650
- let { run: ce } = x(), j = A("detail"), ue = Ae(), de = u(), fe = te(), pe = Be(g?.action_layout, h?.action_layout, h?.actions, _, "detail_toolbar"), he = be(Be(g?.action_layout, h?.action_layout, h?.actions, _, "detail"), h?.actions, _, y ?? {}, []), _e = be(pe, h?.actions, _, y ?? {}, []), ve = L(() => {
1708
+ function Dt({ title: n, recordId: r, editing: i, isNew: a, isRecordDeleted: s, dirty: l, isSaving: d, hasChildErrors: f, hasFieldErrors: p, canRestore: m, entity: h, screen: g, globalActions: _, entityCode: v, record: y, id: b, listRoute: ee, listRouteExists: ne, highlights: S, showBack: C, onBack: re, onCancelEdit: ie, onSave: D, onRestore: O, isRestoring: k, refreshControl: ae, isRealtimeEntity: se, canManageTemplates: ce }) {
1709
+ let { run: le } = x(), A = M("detail"), ue = De(), de = u(), fe = te(), N = Ce(g?.action_layout, h?.action_layout, h?.actions, _, "detail_toolbar"), pe = Se(Ce(g?.action_layout, h?.action_layout, h?.actions, _, "detail"), h?.actions, _, y ?? {}, []), P = Se(N, h?.actions, _, y ?? {}, []), _e = I(() => {
1651
1710
  if (!h) return;
1652
1711
  let e = b ? [b] : [];
1653
1712
  return {
@@ -1673,33 +1732,33 @@ function Ct({ title: n, recordId: r, editing: i, isNew: a, isRecordDeleted: s, d
1673
1732
  y,
1674
1733
  fe,
1675
1734
  ue
1676
- ]), ye = (e, t) => {
1735
+ ]), ve = (e, t) => {
1677
1736
  let n = ge(e, t, { row: y ?? void 0 });
1678
1737
  if (n === null) return;
1679
1738
  let r = b ? [b] : [], i = e === "__delete" && ne ? ee : null;
1680
- return ce({
1739
+ return le({
1681
1740
  action: t,
1682
1741
  title: E(t.display?.name) || e,
1683
1742
  row: y ?? void 0,
1684
1743
  execute: (e) => T(n, w(e, r)),
1685
1744
  onSuccess: i ? () => {
1686
- me.getState().kill(le(location)), de(i, { replace: !0 });
1745
+ oe.getState().kill(he(location)), de(i, { replace: !0 });
1687
1746
  } : void 0
1688
1747
  });
1689
- }, P = j.isVisible("show_actions") && !a && b && he.length > 0 ? /* @__PURE__ */ z(xe, {
1690
- layout: he,
1748
+ }, ye = A.isVisible("show_actions") && !a && b && pe.length > 0 ? /* @__PURE__ */ R(be, {
1749
+ layout: pe,
1691
1750
  row: y,
1692
- onRun: ye,
1751
+ onRun: ve,
1693
1752
  kind: "detail",
1694
1753
  entityActions: h?.actions,
1695
1754
  globalActions: _,
1696
1755
  reservedRightWidth: 0,
1697
- widgetContext: ve,
1756
+ widgetContext: _e,
1698
1757
  constrain: !1
1699
- }) : null, Se = !a && b ? /* @__PURE__ */ z(M, {
1758
+ }) : null, xe = !a && b ? /* @__PURE__ */ R(me, {
1700
1759
  liveObject: ae,
1701
- realtime: oe
1702
- }) : null, Ce = j.isVisible("show_actions") && !a && b && _e.length > 0 ? /* @__PURE__ */ B("div", {
1760
+ realtime: se
1761
+ }) : null, we = A.isVisible("show_actions") && !a && b && P.length > 0 ? /* @__PURE__ */ z("div", {
1703
1762
  style: {
1704
1763
  display: "flex",
1705
1764
  justifyContent: "flex-end",
@@ -1707,47 +1766,47 @@ function Ct({ title: n, recordId: r, editing: i, isNew: a, isRecordDeleted: s, d
1707
1766
  gap: 8,
1708
1767
  marginTop: 10
1709
1768
  },
1710
- children: [P ? null : Se, /* @__PURE__ */ z(xe, {
1711
- layout: _e,
1769
+ children: [ye ? null : xe, /* @__PURE__ */ R(be, {
1770
+ layout: P,
1712
1771
  row: y,
1713
- onRun: ye,
1772
+ onRun: ve,
1714
1773
  kind: "detail",
1715
1774
  entityActions: h?.actions,
1716
1775
  globalActions: _,
1717
1776
  reservedRightWidth: 0,
1718
- widgetContext: ve,
1719
- ariaLabel: P ? "Detail toolbar actions" : "Page actions"
1777
+ widgetContext: _e,
1778
+ ariaLabel: ye ? "Detail toolbar actions" : "Page actions"
1720
1779
  })]
1721
- }) : null, we = j.isVisible("show_actions") && !a && b && v ? /* @__PURE__ */ z(N, {
1780
+ }) : null, Te = A.isVisible("show_actions") && !a && b && v ? /* @__PURE__ */ R(j, {
1722
1781
  entityCode: v,
1723
1782
  scope: "detail",
1724
1783
  objectIds: [b],
1725
1784
  capability: h?.documents,
1726
- canManageTemplates: se
1727
- }) : null, Te = s ? m ? /* @__PURE__ */ z(o, {
1785
+ canManageTemplates: ce
1786
+ }) : null, Ee = s ? m ? /* @__PURE__ */ R(o, {
1728
1787
  kind: "primary",
1729
- icon: z(k ? c : e.refresh, { size: 13 }),
1788
+ icon: R(k ? c : e.refresh, { size: 13 }),
1730
1789
  onClick: O,
1731
1790
  disabled: k,
1732
1791
  children: k ? "Restoring…" : "Restore"
1733
- }) : null : i ? /* @__PURE__ */ B($e, { children: [/* @__PURE__ */ z(o, {
1734
- icon: /* @__PURE__ */ z(e.x, { size: 13 }),
1792
+ }) : null : i ? /* @__PURE__ */ z(nt, { children: [/* @__PURE__ */ R(o, {
1793
+ icon: /* @__PURE__ */ R(e.x, { size: 13 }),
1735
1794
  onClick: ie,
1736
1795
  disabled: d,
1737
1796
  children: "Cancel"
1738
- }), /* @__PURE__ */ z(o, {
1797
+ }), /* @__PURE__ */ R(o, {
1739
1798
  kind: "primary",
1740
- icon: z(d ? c : e.save, { size: 13 }),
1799
+ icon: R(d ? c : e.save, { size: 13 }),
1741
1800
  onClick: D,
1742
1801
  disabled: d || f || p,
1743
1802
  title: f ? "Fix errors in child rows" : p ? "Fix the highlighted fields" : void 0,
1744
1803
  children: d ? "Saving…" : "Save"
1745
- })] }) : !a && b ? P ? /* @__PURE__ */ B("span", {
1804
+ })] }) : !a && b ? ye ? /* @__PURE__ */ z("span", {
1746
1805
  style: { display: "contents" },
1747
- children: [we, P]
1748
- }) : we : null;
1749
- return /* @__PURE__ */ B($e, { children: [/* @__PURE__ */ z(G, {
1750
- icon: h?.display.icon ? /* @__PURE__ */ z(t, {
1806
+ children: [Te, ye]
1807
+ }) : Te : null;
1808
+ return /* @__PURE__ */ z(nt, { children: [/* @__PURE__ */ R(ht, {
1809
+ icon: h?.display.icon ? /* @__PURE__ */ R(t, {
1751
1810
  name: h.display.icon,
1752
1811
  size: 16
1753
1812
  }) : void 0,
@@ -1755,14 +1814,14 @@ function Ct({ title: n, recordId: r, editing: i, isNew: a, isRecordDeleted: s, d
1755
1814
  description: E(g?.display?.description) || E(h?.display?.description),
1756
1815
  recordId: r,
1757
1816
  highlights: S,
1758
- identityControls: !s && !i && !a ? Se : null,
1817
+ identityControls: !s && !i && !a ? xe : null,
1759
1818
  mode: a ? "create" : i ? "edit" : "display",
1760
1819
  dirty: l,
1761
1820
  showBack: C,
1762
1821
  onBack: re,
1763
- right: Te,
1764
- showTitle: j.isVisible("show_title")
1765
- }), Ce] });
1822
+ right: Ee,
1823
+ showTitle: A.isVisible("show_title")
1824
+ }), we] });
1766
1825
  }
1767
1826
  //#endregion
1768
- export { yt as SmartDetailPage };
1827
+ export { Ct as SmartDetailPage };