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