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