@declarion/react 0.446.0 → 0.516.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 (43) hide show
  1. package/dist-lib/components/agents/AgentChatPanel.impl.js +349 -332
  2. package/dist-lib/components/detail-layout/DetailAuditStrip.js +1 -1
  3. package/dist-lib/components/detail-layout/EvidenceBlock.js +36 -24
  4. package/dist-lib/components/detail-layout/FieldRow.js +56 -60
  5. package/dist-lib/components/detail-layout/FieldsBlock.js +48 -47
  6. package/dist-lib/components/detail-layout/PropertiesBlock.js +42 -41
  7. package/dist-lib/components/detail-layout/labelLayout.js +35 -0
  8. package/dist-lib/components/fields/JsonField.js +128 -125
  9. package/dist-lib/components/fields/StringField.js +10 -25
  10. package/dist-lib/components/fields/StructureField.js +125 -167
  11. package/dist-lib/components/fields/ValueRows.js +114 -0
  12. package/dist-lib/components/fields/cells/factories/id.js +10 -0
  13. package/dist-lib/components/fields/cells/factories/nextRun.js +18 -27
  14. package/dist-lib/components/fields/cells/factories/refLink.js +15 -41
  15. package/dist-lib/components/fields/cells/registry.js +25 -23
  16. package/dist-lib/components/file-widgets/DocumentCard.js +142 -142
  17. package/dist-lib/components/file-widgets/helpers.js +32 -19
  18. package/dist-lib/components/file-widgets/host.js +4 -1
  19. package/dist-lib/components/list/PeekFieldCell.js +57 -55
  20. package/dist-lib/components/list/QuickPeek.js +109 -121
  21. package/dist-lib/components/pages/SmartDetailPage.impl.js +403 -400
  22. package/dist-lib/components/pages/SmartListPage.impl.js +260 -260
  23. package/dist-lib/components/pages/list/ListCardRow.js +101 -100
  24. package/dist-lib/components/pages/list/cardProjection.js +117 -112
  25. package/dist-lib/components/pages/list/useListQuery.js +1 -1
  26. package/dist-lib/components/pages/list/useListRowInteraction.js +68 -65
  27. package/dist-lib/components/primitives/IdBadge.js +27 -0
  28. package/dist-lib/components/primitives/RowField.js +11 -43
  29. package/dist-lib/components/shared/CopyButton.js +13 -18
  30. package/dist-lib/components/shared/RefChip.js +33 -0
  31. package/dist-lib/declarion-react.css +1 -1
  32. package/dist-lib/hooks/useAgentConversation.js +134 -110
  33. package/dist-lib/hooks/useCopy.js +18 -0
  34. package/dist-lib/index.d.ts +55 -20
  35. package/dist-lib/index.js +116 -111
  36. package/dist-lib/lib/realtime-reconcile.js +70 -59
  37. package/dist-lib/lib/reference.js +52 -34
  38. package/dist-lib/lib/short-id.js +12 -0
  39. package/dist-lib/testing.d.ts +1 -1
  40. package/dist-lib/types/schema.js +84 -80
  41. package/dist-lib/{useResponsiveMode-3hOLBkey.d.ts → useResponsiveMode-BObVfNyN.d.ts} +7 -2
  42. package/package.json +1 -1
  43. package/dist-lib/components/primitives/RecordIdBadge.js +0 -25
@@ -28,61 +28,61 @@ import { applyRowState as me, resolveActionLayoutForSlot as _ } from "../../lib/
28
28
  import { effectiveScreenForRecord as he, variantActionCodesForRecord as ge } from "../../lib/variants.js";
29
29
  import { dispatchAction as v } from "../../lib/action-dispatch.js";
30
30
  import { ResponsiveActionBar as y } from "../actions/ResponsiveActionBar.js";
31
- import { RefreshControl as _e } from "../shared/RefreshControl.js";
32
- import { DocumentsMenu as b } from "./DocumentsMenu.js";
33
- import { RecordPanels as ve } from "./RecordPanels.js";
34
- import { canManageDocumentTemplates as ye } from "../../lib/document-templates.js";
35
- import { useTabNavigate as x } from "../../hooks/useTabNavigate.js";
36
- import { useScreenBack as be } from "../../hooks/useScreenBack.js";
37
- import { useEmbed as xe } from "../../embed/EmbedContext.js";
38
- import { useEmbedNavigate as Se } from "../../embed/useEmbedNavigate.js";
39
- import { useReportEmbedDirty as S } from "../../embed/embed-dirty.js";
40
- import { useScreenIsLive as Ce } from "../../stores/realtime.js";
41
- import { entityAllowsCreateRoute as we, entityAllowsMutation as Te, extractPkValues as C, fieldDisplayName as Ee, getDisplayValue as De, getPrimaryKeyFields as Oe, isUserEditableField as ke, pkValuesFromId as Ae, pkValuesToId as je, resolveRefRecordLabel as w, rowAllowsMutation as Me, rowSetInTenant as Ne } from "../../types/schema.js";
42
- import { LayoutRenderer as Pe } from "../detail-layout/LayoutRenderer.js";
43
- import { ErrorSummary as Fe } from "../detail-layout/ErrorSummary.js";
44
- import { DetailHighlights as Ie, highlightedFieldCodes as Le } from "../detail-layout/DetailHighlights.js";
45
- import { DetailAuditStrip as Re } from "../detail-layout/DetailAuditStrip.js";
46
- import { StatusGroupsDisplay as ze } from "../shared/StatusGroupsDisplay.js";
47
- import { EvidenceBlock as Be } from "../detail-layout/EvidenceBlock.js";
48
- import { RecordHeader as Ve } from "../chrome/RecordHeader.js";
49
- import { PageShell as He } from "../chrome/PageShell.js";
50
- import { DynamicIcon as Ue } from "../shared/DynamicIcon.js";
51
- import { findInvalidEmailFields as We, findMissingRequiredFields as Ge, validatePendingChildren as Ke } from "../../lib/children-validation.js";
52
- import { takePeekDraft as qe } from "../list/peekDraftStore.js";
53
- import { coerceDisplayString as T } from "../../lib/display-value.js";
54
- import { FileDraftScope as E, useFileDraftScope as Je } from "../file-widgets/draft-scope.js";
55
- import { discardFile as Ye } from "../file-widgets/upload.js";
56
- import { buildFilesPayload as Xe, collectCommittedFileIds as Ze } from "../file-widgets/payload.js";
57
- import { getEntityFileField as Qe, getSchemaFieldValue as $e, serializeSchemaFieldValue as D } from "../file-widgets/host.js";
58
- import { resolveCard as et } from "./list/cardProjection.js";
59
- import { useText as tt } from "../../hooks/useText.js";
60
- import { useRowTenant as nt } from "../../hooks/useRowTenant.js";
61
- import { useUnsavedInput as rt } from "../../hooks/useUnsavedInput.js";
62
- import { showsOnNewRecord as it } from "../../lib/child-config.js";
63
- import { useCallback as O, useEffect as k, useMemo as A, useRef as j, useState as M } from "react";
64
- import { Fragment as at, jsx as N, jsxs as P } from "react/jsx-runtime";
65
- import { useLocation as ot, useParams as st, useSearchParams as ct } from "react-router";
31
+ import { RefreshControl as b } from "../shared/RefreshControl.js";
32
+ import { DocumentsMenu as x } from "./DocumentsMenu.js";
33
+ import { RecordPanels as _e } from "./RecordPanels.js";
34
+ import { canManageDocumentTemplates as ve } from "../../lib/document-templates.js";
35
+ import { useTabNavigate as S } from "../../hooks/useTabNavigate.js";
36
+ import { useScreenBack as ye } from "../../hooks/useScreenBack.js";
37
+ import { useEmbed as be } from "../../embed/EmbedContext.js";
38
+ import { useEmbedNavigate as xe } from "../../embed/useEmbedNavigate.js";
39
+ import { useReportEmbedDirty as C } from "../../embed/embed-dirty.js";
40
+ import { useScreenIsLive as Se } from "../../stores/realtime.js";
41
+ import { entityAllowsCreateRoute as Ce, entityAllowsEditForm as we, entityAllowsMutation as w, extractPkValues as Te, fieldDisplayName as Ee, getDisplayValue as De, getPrimaryKeyFields as Oe, isUserEditableField as ke, pkValuesFromId as Ae, pkValuesToId as je, resolveRefRecordLabel as T, rowAllowsMutation as E, rowSetInTenant as Me } from "../../types/schema.js";
42
+ import { LayoutRenderer as Ne } from "../detail-layout/LayoutRenderer.js";
43
+ import { ErrorSummary as Pe } from "../detail-layout/ErrorSummary.js";
44
+ import { DetailHighlights as Fe, highlightedFieldCodes as Ie } from "../detail-layout/DetailHighlights.js";
45
+ import { DetailAuditStrip as Le } from "../detail-layout/DetailAuditStrip.js";
46
+ import { StatusGroupsDisplay as Re } from "../shared/StatusGroupsDisplay.js";
47
+ import { EvidenceBlock as ze } from "../detail-layout/EvidenceBlock.js";
48
+ import { RecordHeader as Be } from "../chrome/RecordHeader.js";
49
+ import { PageShell as Ve } from "../chrome/PageShell.js";
50
+ import { DynamicIcon as He } from "../shared/DynamicIcon.js";
51
+ import { findInvalidEmailFields as Ue, findMissingRequiredFields as We, validatePendingChildren as Ge } from "../../lib/children-validation.js";
52
+ import { takePeekDraft as Ke } from "../list/peekDraftStore.js";
53
+ import { coerceDisplayString as D } from "../../lib/display-value.js";
54
+ import { FileDraftScope as O, useFileDraftScope as qe } from "../file-widgets/draft-scope.js";
55
+ import { discardFile as Je } from "../file-widgets/upload.js";
56
+ import { buildFilesPayload as Ye, collectCommittedFileIds as Xe } from "../file-widgets/payload.js";
57
+ import { getEntityFileField as Ze, getSchemaFieldValue as Qe, serializeSchemaFieldValue as k } from "../file-widgets/host.js";
58
+ import { resolveCard as $e } from "./list/cardProjection.js";
59
+ import { useText as et } from "../../hooks/useText.js";
60
+ import { useRowTenant as tt } from "../../hooks/useRowTenant.js";
61
+ import { useUnsavedInput as nt } from "../../hooks/useUnsavedInput.js";
62
+ import { showsOnNewRecord as rt } from "../../lib/child-config.js";
63
+ import { useCallback as A, useEffect as j, useMemo as M, useRef as N, useState as P } from "react";
64
+ import { Fragment as it, jsx as F, jsxs as I } from "react/jsx-runtime";
65
+ import { useLocation as at, useParams as ot, useSearchParams as st } from "react-router";
66
66
  // src/components/pages/SmartDetailPage.impl.tsx
67
- var lt = () => {}, ut = { expand: ["evidence"] };
68
- function F(e, t) {
67
+ var ct = () => {}, lt = { expand: ["evidence"] };
68
+ function L(e, t) {
69
69
  return e.length === t.length && JSON.stringify(e) === JSON.stringify(t);
70
70
  }
71
- function dt({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, pendingProperties: a, pendingChildren: o, childrenSnapshot: s }) {
72
- let c = {}, l = Xe({
71
+ function ut({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, pendingProperties: a, pendingChildren: o, childrenSnapshot: s }) {
72
+ let c = {}, l = Ye({
73
73
  entity: e,
74
74
  formData: t,
75
75
  record: n,
76
76
  isNew: r
77
- }), u = Ze(l);
77
+ }), u = Xe(l);
78
78
  if (r) for (let [n, r] of Object.entries(t)) {
79
79
  if (e.files?.has(n)) continue;
80
- let t = D(e, n, r);
80
+ let t = k(e, n, r);
81
81
  t !== "" && t != null && (c[n] = t);
82
82
  }
83
83
  else for (let [r, i] of Object.entries(t)) {
84
84
  if (e.files?.has(r)) continue;
85
- let t = n ? $e(e, n, r) : void 0, a = D(e, r, i), o = D(e, r, t);
85
+ let t = n ? Qe(e, n, r) : void 0, a = k(e, r, i), o = k(e, r, t);
86
86
  (a === "" ? null : a) !== (o === "" || o === void 0 ? null : o) && (c[r] = a);
87
87
  }
88
88
  if (Object.keys(l).length > 0 && (c.$files = l), Object.keys(i).length > 0 && (c.$statuses = Object.entries(i).map(([e, t]) => ({
@@ -98,7 +98,7 @@ function dt({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, p
98
98
  let { _key: t, _deleted: n, _dirty: r, ...i } = e;
99
99
  return i;
100
100
  }), a = s?.[t] ?? [];
101
- (r || !F(i, a)) && (e[t] = i);
101
+ (r || !L(i, a)) && (e[t] = i);
102
102
  }
103
103
  Object.keys(e).length > 0 && (c.$children = e);
104
104
  }
@@ -107,52 +107,52 @@ function dt({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, p
107
107
  committedFileIds: u
108
108
  };
109
109
  }
110
- function ft(e, t) {
110
+ function dt(e, t) {
111
111
  if (e) {
112
- let n = C(e, t), r = je(n);
112
+ let n = Te(e, t), r = je(n);
113
113
  if (r.replace(/^\|+|\|+$/g, "")) return r;
114
114
  }
115
- return t.id == null ? crypto.randomUUID() : T(t.id);
115
+ return t.id == null ? crypto.randomUUID() : D(t.id);
116
116
  }
117
- function pt({ screenCode: e }) {
118
- return /* @__PURE__ */ N(E, { children: /* @__PURE__ */ N(mt, { screenCode: e }) });
117
+ function ft({ screenCode: e }) {
118
+ return /* @__PURE__ */ F(O, { children: /* @__PURE__ */ F(pt, { screenCode: e }) });
119
119
  }
120
- function mt({ screenCode: i }) {
121
- let s = tt(), se = tt("errors"), { id: ue } = st(), g = Se(), [de, me] = ct(), { data: _ } = ee(), ge = d((e) => e.user), v = Je(), y = oe(), _e = _?.screens[i], b = _e?.entity ? _?.entities[_e.entity] : void 0, x = _e?.entity, w = Te(b, "create"), Ve = nt(b), Ue = (() => {
122
- if (!b || !b.singleton || !b.prefilter) return;
123
- let e = Oe(b);
120
+ function pt({ screenCode: i }) {
121
+ let s = et(), se = et("errors"), { id: ue } = ot(), g = xe(), [de, me] = st(), { data: _ } = ee(), ge = d((e) => e.user), v = qe(), y = oe(), b = _?.screens[i], x = b?.entity ? _?.entities[b.entity] : void 0, S = b?.entity, T = w(x, "create"), Be = tt(x), He = (() => {
122
+ if (!x || !x.singleton || !x.prefilter) return;
123
+ let e = Oe(x);
124
124
  if (e.length !== 1) return;
125
- let t = b.prefilter[e[0]];
125
+ let t = x.prefilter[e[0]];
126
126
  if (t === "$caller.user_id") return ge?.id;
127
127
  if (t === "$caller.tenant_id") return ge?.tenant?.id;
128
- })(), T = Ue !== void 0, E = T ? Ue : ue, D = !T && E === "new", F = A(() => {
129
- if (!E || D) return;
130
- if (!b) return E;
131
- let e = Oe(b);
132
- if (e.length === 1) return { [e[0]]: E };
133
- let t = Ae(E, e.length);
128
+ })(), D = He !== void 0, O = D ? He : ue, k = !D && O === "new", L = M(() => {
129
+ if (!O || k) return;
130
+ if (!x) return O;
131
+ let e = Oe(x);
132
+ if (e.length === 1) return { [e[0]]: O };
133
+ let t = Ae(O, e.length);
134
134
  if (!t) return;
135
135
  let n = {};
136
136
  for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
137
137
  return n;
138
138
  }, [
139
- E,
140
- D,
141
- b
142
- ]), pt = A(() => {
143
- if (F) return typeof F == "string" ? F : je(F);
144
- }, [F]), mt = p(x, F, ut), { data: I, isLoading: gt, error: vt } = mt, L = l(mt), xt = !D && L.error !== null && !(L.error instanceof ce && L.error.status === 404);
145
- e(!gt);
146
- let St = Ce(b?.realtime, x ?? ""), Ct = x ? St : !1;
147
- te(f(x, F, ut), !D);
148
- let wt = h(x ?? ""), Tt = ae(x ?? ""), Et = ie(x ?? ""), Dt = Object.keys(b?.status_groups ?? {}).length > 0, R = I?.data, z = Me(b, "update", R, Ve.tenantId), Ot = !!R && Te(b, "update") && !Ne(b, R, Ve.tenantId), kt = Me(b, "restore", R, Ve.tenantId), At = R?.$statuses, jt = R?.$properties, Mt = de.get("edit") === "true", [Nt, Pt] = M(D || Mt), [B, Ft] = M({}), [V, It] = M({}), [H, Lt] = M({}), [U, W] = M(void 0), [Rt, zt] = M(!1), [Bt, G] = M(void 0), [Vt, Ht] = M(!1), Ut = D ? w : z, K = Nt && Ut, Wt = xe();
149
- S(K && !D, Wt.enabled);
150
- let [Gt, Kt] = M(() => {
151
- let e = parseInt(_e?.sidebar_width || "380", 10);
139
+ O,
140
+ k,
141
+ x
142
+ ]), ft = M(() => {
143
+ if (L) return typeof L == "string" ? L : je(L);
144
+ }, [L]), pt = p(S, L, lt), { data: R, isLoading: ht, error: _t } = pt, bt = l(pt), xt = !k && bt.error !== null && !(bt.error instanceof ce && bt.error.status === 404);
145
+ e(!ht);
146
+ let St = Se(x?.realtime, S ?? ""), Ct = S ? St : !1;
147
+ te(f(S, L, lt), !k);
148
+ let wt = h(S ?? ""), Tt = ae(S ?? ""), Et = ie(S ?? ""), Dt = Object.keys(x?.status_groups ?? {}).length > 0, Ot = R?.data, z = E(x, "update", Ot, Be.tenantId), kt = !!Ot && w(x, "update") && !Me(x, Ot, Be.tenantId), At = E(x, "restore", Ot, Be.tenantId), jt = Ot?.$statuses, Mt = Ot?.$properties, Nt = de.get("edit") === "true", [Pt, Ft] = P(k || Nt), [B, It] = P({}), [V, Lt] = P({}), [H, Rt] = P({}), [U, W] = P(void 0), [zt, Bt] = P(!1), [Vt, G] = P(void 0), [Ht, Ut] = P(!1), Wt = k ? T : z && we(x), K = Pt && Wt, Gt = be();
149
+ C(K && !k, Gt.enabled);
150
+ let [Kt, qt] = P(() => {
151
+ let e = parseInt(b?.sidebar_width || "380", 10);
152
152
  return isNaN(e) ? 380 : e;
153
- }), qt = j(null), q = j(null), Jt = O((e) => {
153
+ }), Jt = N(null), q = N(null), Yt = A((e) => {
154
154
  e.preventDefault();
155
- let t = qt.current;
155
+ let t = Jt.current;
156
156
  if (!t) return;
157
157
  let n = t.offsetWidth;
158
158
  q.current = {
@@ -164,105 +164,105 @@ function mt({ screenCode: i }) {
164
164
  let n = q.current.startX - e.clientX, r = Math.max(280, Math.min(800, q.current.startW + n));
165
165
  t.style.width = `${r}px`;
166
166
  }, i = () => {
167
- q.current && t && Kt(parseInt(t.style.width, 10) || q.current.startW), q.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
167
+ q.current && t && qt(parseInt(t.style.width, 10) || q.current.startW), q.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
168
168
  };
169
169
  document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
170
- }, []), J = I?.data, Y = he(b, _e, J ?? {});
171
- k(() => {
170
+ }, []), J = R?.data, Y = he(x, b, J ?? {});
171
+ j(() => {
172
172
  let e = parseInt(Y?.sidebar_width || "380", 10);
173
- Kt(Number.isNaN(e) ? 380 : e);
173
+ qt(Number.isNaN(e) ? 380 : e);
174
174
  }, [Y?.sidebar_width]);
175
- let X = typeof J?.$row_version == "string" ? J.$row_version : void 0, Yt = J?.$refs, Xt = j(X);
176
- k(() => {
175
+ let X = typeof J?.$row_version == "string" ? J.$row_version : void 0, Xt = J?.$refs, Zt = N(X);
176
+ j(() => {
177
177
  if (!X) return;
178
- let e = Xt.current;
179
- Xt.current = X, e && e !== X && Nt && zt(!0);
180
- }, [Nt, X]);
181
- let Zt = !!b?.soft_delete && J != null && J[b.soft_delete] != null, Z = ot(), Qt = j(null);
182
- m({ scrollElementRef: Qt });
183
- let $t = !D && vt instanceof ce && vt.status === 404, en = D && !we(b), tn = j(null);
184
- k(() => {
185
- if (!$t) return;
178
+ let e = Zt.current;
179
+ Zt.current = X, e && e !== X && Pt && Bt(!0);
180
+ }, [Pt, X]);
181
+ let Qt = !!x?.soft_delete && J != null && J[x.soft_delete] != null, Z = at(), $t = N(null);
182
+ m({ scrollElementRef: $t });
183
+ let en = !k && _t instanceof ce && _t.status === 404, tn = k && !Ce(x), nn = N(null);
184
+ j(() => {
185
+ if (!en) return;
186
186
  let e = ne(Z);
187
- tn.current !== e && (tn.current = e, re.getState().kill(e));
188
- }, [$t, Z]);
189
- let { openTab: nn, updateTabTitle: rn, findTabByPathname: an } = pe(), on = b !== void 0, sn = s(Y?.display?.name) || s(b?.display.name), cn = Y?.display?.icon || b?.display.icon;
190
- k(() => {
191
- if (!on || T || Wt.enabled) return;
187
+ nn.current !== e && (nn.current = e, re.getState().kill(e));
188
+ }, [en, Z]);
189
+ let { openTab: rn, updateTabTitle: an, findTabByPathname: on } = pe(), sn = x !== void 0, cn = s(Y?.display?.name) || s(x?.display.name), ln = Y?.display?.icon || x?.display.icon;
190
+ j(() => {
191
+ if (!sn || D || Gt.enabled) return;
192
192
  let e = Z.pathname;
193
- nn({
193
+ rn({
194
194
  pathname: e,
195
195
  search: "",
196
- title: D ? s("record.new_title", "New {name}", { name: sn }) : sn,
197
- derivedTitle: !D,
198
- icon: cn,
196
+ title: k ? s("record.new_title", "New {name}", { name: cn }) : cn,
197
+ derivedTitle: !k,
198
+ icon: ln,
199
199
  closable: !0
200
200
  });
201
201
  }, [
202
202
  Z.pathname,
203
203
  s,
204
- sn,
205
204
  cn,
206
- on,
207
- nn,
205
+ ln,
206
+ sn,
207
+ rn,
208
+ k,
208
209
  D,
209
- T,
210
- Wt.enabled
211
- ]), k(() => {
212
- if (!J || !b || T || Wt.enabled) return;
213
- let e = an(Z.pathname);
210
+ Gt.enabled
211
+ ]), j(() => {
212
+ if (!J || !x || D || Gt.enabled) return;
213
+ let e = on(Z.pathname);
214
214
  if (e) {
215
- let t = sn, n = De(s, J, b), r = n && !String(n).startsWith("/") ? String(n) : t;
216
- rn(e.id, r, r === t);
215
+ let t = cn, n = De(s, J, x), r = n && !String(n).startsWith("/") ? String(n) : t;
216
+ an(e.id, r, r === t);
217
217
  }
218
218
  }, [
219
219
  J,
220
220
  s,
221
- b,
222
- sn,
221
+ x,
222
+ cn,
223
+ on,
223
224
  an,
224
- rn,
225
225
  Z.pathname,
226
- T,
227
- Wt.enabled
226
+ D,
227
+ Gt.enabled
228
228
  ]);
229
- let ln = A(() => {
230
- if (!b || !Ut) return /* @__PURE__ */ new Set();
229
+ let un = M(() => {
230
+ if (!x || !Wt) return /* @__PURE__ */ new Set();
231
231
  let e = /* @__PURE__ */ new Set();
232
- for (let [t, n] of b.fields) ke(n) && e.add(t);
233
- for (let [t] of b.files ?? []) e.add(t);
232
+ for (let [t, n] of x.fields) ke(n) && e.add(t);
233
+ for (let [t] of x.files ?? []) e.add(t);
234
234
  return e;
235
- }, [b, Ut]), un = j(null);
236
- k(() => {
237
- if (Mt && J && b && z && un.current !== Z.key) {
238
- if (un.current = Z.key, Nt || Pt(!0), Object.keys(B).length === 0) {
239
- let e = E ? qe(E) : null;
235
+ }, [x, Wt]), dn = N(null);
236
+ j(() => {
237
+ if (Nt && J && x && z && dn.current !== Z.key) {
238
+ if (dn.current = Z.key, Pt || Ft(!0), Object.keys(B).length === 0) {
239
+ let e = O ? Ke(O) : null;
240
240
  if (e) {
241
- let t = Xe({
242
- entity: b,
241
+ let t = Ye({
242
+ entity: x,
243
243
  formData: e,
244
244
  record: void 0,
245
245
  isNew: !0
246
246
  });
247
- Ze(t).forEach((e) => {
247
+ Xe(t).forEach((e) => {
248
248
  v.registerDraft({
249
249
  fileId: e,
250
- discard: () => Ye(e)
250
+ discard: () => Je(e)
251
251
  });
252
252
  });
253
253
  }
254
254
  let t = {};
255
- ln.forEach((n) => {
255
+ un.forEach((n) => {
256
256
  let r = e ? e[n] : void 0;
257
257
  if (r !== void 0) {
258
258
  t[n] = r;
259
259
  return;
260
260
  }
261
- let i = $e(b, J, n);
262
- t[n] = Qe(b, n) ? i ?? null : i ?? "";
263
- }), Ft(t);
261
+ let i = Qe(x, J, n);
262
+ t[n] = Ze(x, n) ? i ?? null : i ?? "";
263
+ }), It(t);
264
264
  }
265
- if (b.children !== void 0 && b.children.length > 0 && U === void 0) {
265
+ if (x.children !== void 0 && x.children.length > 0 && U === void 0) {
266
266
  let e = J.$children;
267
267
  if (e && Object.keys(e).length > 0) {
268
268
  let t = {};
@@ -270,7 +270,7 @@ function mt({ screenCode: i }) {
270
270
  let e = _?.entities[n];
271
271
  t[n] = r.map((t) => ({
272
272
  ...t,
273
- _key: ft(e, t)
273
+ _key: dt(e, t)
274
274
  }));
275
275
  }
276
276
  W(t), G(e);
@@ -282,157 +282,157 @@ function mt({ screenCode: i }) {
282
282
  }, { replace: !0 });
283
283
  }
284
284
  }, [
285
- Mt,
285
+ Nt,
286
286
  J,
287
- ln,
287
+ un,
288
288
  z,
289
- b,
289
+ x,
290
290
  U,
291
291
  _,
292
292
  Z.key,
293
293
  v,
294
- Nt,
294
+ Pt,
295
295
  B,
296
- E,
296
+ O,
297
297
  me
298
- ]), k(() => {
299
- D && w && b?.children && b.children.length !== 0 && (W((e) => e ?? {}), G((e) => e ?? {}));
298
+ ]), j(() => {
299
+ k && T && x?.children && x.children.length !== 0 && (W((e) => e ?? {}), G((e) => e ?? {}));
300
300
  }, [
301
- D,
302
- w,
303
- b?.children
301
+ k,
302
+ T,
303
+ x?.children
304
304
  ]);
305
- let dn = O(async () => {
306
- if (await v.flushAllDrafts(), D) {
305
+ let fn = A(async () => {
306
+ if (await v.flushAllDrafts(), k) {
307
307
  let e = Y?.route?.replace("/:id", "") ?? "/";
308
308
  g(e);
309
- } else Pt(!1), Ft({}), It({}), Lt({}), W(void 0), G(void 0), Ht(!1);
309
+ } else Ft(!1), It({}), Lt({}), Rt({}), W(void 0), G(void 0), Ut(!1);
310
310
  }, [
311
311
  v,
312
- D,
312
+ k,
313
313
  Y,
314
314
  g
315
- ]), fn = j(/* @__PURE__ */ new Set()), pn = O((e, n) => {
316
- Ft((r) => D ? t(b, r, e, n, fn.current) : {
315
+ ]), pn = N(/* @__PURE__ */ new Set()), mn = A((e, n) => {
316
+ It((r) => k ? t(x, r, e, n, pn.current) : {
317
317
  ...r,
318
318
  [e]: n
319
319
  });
320
- }, [D, b]), Q = A(() => {
320
+ }, [k, x]), Q = M(() => {
321
321
  if (!Y?.route) return "/";
322
322
  let e = Y.route.split("/");
323
323
  return e.pop(), e.join("/") || "/";
324
- }, [Y]), mn = A(() => !_?.screens || !Q || Q === "/" ? !1 : Object.values(_.screens).some((e) => e.route === Q), [_, Q]), hn = O(() => {
325
- if (!mn) {
324
+ }, [Y]), hn = M(() => !_?.screens || !Q || Q === "/" ? !1 : Object.values(_.screens).some((e) => e.route === Q), [_, Q]), gn = A(() => {
325
+ if (!hn) {
326
326
  g("/");
327
327
  return;
328
328
  }
329
- let e = an(Q)?.search ?? "";
329
+ let e = on(Q)?.search ?? "";
330
330
  g(e ? `${Q}?${e}` : Q);
331
331
  }, [
332
- mn,
332
+ hn,
333
333
  Q,
334
- an,
334
+ on,
335
335
  g
336
- ]), gn = be({ fallback: hn }), _n = !T && (gn.hasOriginBack || gn.allowFallbackBack && !!mn), vn = A(() => {
337
- if (!b) return {};
336
+ ]), _n = ye({ fallback: gn }), vn = !D && (_n.hasOriginBack || _n.allowFallbackBack && !!hn), yn = M(() => {
337
+ if (!x) return {};
338
338
  let e = {};
339
- for (let t of Ge(b, B, D)) ln.has(t) && (e[t] = s("record.field.required", "Required"));
340
- for (let t of We(b, B)) ln.has(t) && (e[t] = se("record.email_invalid", "This is not a valid email address."));
339
+ for (let t of We(x, B, k)) un.has(t) && (e[t] = s("record.field.required", "Required"));
340
+ for (let t of Ue(x, B)) un.has(t) && (e[t] = se("record.email_invalid", "This is not a valid email address."));
341
341
  return e;
342
342
  }, [
343
343
  s,
344
344
  se,
345
- b,
345
+ x,
346
346
  B,
347
- D,
348
- ln
349
- ]), yn = Object.keys(vn).length > 0, bn = A(() => b ? dt({
350
- entity: b,
347
+ k,
348
+ un
349
+ ]), bn = Object.keys(yn).length > 0, xn = M(() => x ? ut({
350
+ entity: x,
351
351
  formData: B,
352
352
  record: J,
353
- isNew: D,
353
+ isNew: k,
354
354
  pendingStatuses: V,
355
355
  pendingProperties: H,
356
356
  pendingChildren: U,
357
- childrenSnapshot: Bt
357
+ childrenSnapshot: Vt
358
358
  }) : {
359
359
  payload: {},
360
360
  committedFileIds: []
361
361
  }, [
362
- b,
362
+ x,
363
363
  B,
364
364
  J,
365
- D,
365
+ k,
366
366
  V,
367
367
  H,
368
368
  U,
369
- Bt
370
- ]), xn = Object.keys(bn.payload).length > 0, Sn = K && (D || xn);
371
- rt(Sn);
372
- let Cn = O(() => {
373
- if (!x || !b || D && !w || !D && !z || (Ht(!0), yn)) return;
374
- let e = { ...bn.payload }, { committedFileIds: t } = bn;
375
- if (!D && !xn) {
376
- Pt(!1), It({}), Lt({}), W(void 0), G(void 0), Ht(!1);
369
+ Vt
370
+ ]), Sn = Object.keys(xn.payload).length > 0, Cn = K && (k || Sn);
371
+ nt(Cn);
372
+ let wn = A(() => {
373
+ if (!S || !x || k && !T || !k && !z || (Ut(!0), bn)) return;
374
+ let e = { ...xn.payload }, { committedFileIds: t } = xn;
375
+ if (!k && !Sn) {
376
+ Ft(!1), Lt({}), Rt({}), W(void 0), G(void 0), Ut(!1);
377
377
  return;
378
378
  }
379
- !D && X && (e.$row_version = X);
379
+ !k && X && (e.$row_version = X);
380
380
  let n = () => {
381
- Pt(!1), zt(!1), Ht(!1), It({}), Lt({}), W(void 0), G(void 0);
381
+ Ft(!1), Bt(!1), Ut(!1), Lt({}), Rt({}), W(void 0), G(void 0);
382
382
  };
383
- D ? wt.mutate(e, { onSuccess: (e) => {
383
+ k ? wt.mutate(e, { onSuccess: (e) => {
384
384
  t.forEach((e) => v.markCommitted(e));
385
- let r = e.data, i = b ? C(b, r) : {}, a = je(i);
385
+ let r = e.data, i = x ? Te(x, r) : {}, a = je(i);
386
386
  g(a ? `${Q}/${encodeURIComponent(a)}` : Q, { replace: !0 }), n();
387
- } }) : F && Tt.mutate({
388
- pkValues: F,
387
+ } }) : L && Tt.mutate({
388
+ pkValues: L,
389
389
  data: e
390
390
  }, {
391
391
  onSuccess: () => {
392
392
  t.forEach((e) => v.markCommitted(e)), n();
393
393
  },
394
394
  onError: (e) => {
395
- e instanceof ce && e.code === "entity.stale_object" && zt(!0);
395
+ e instanceof ce && e.code === "entity.stale_object" && Bt(!0);
396
396
  }
397
397
  });
398
398
  }, [
399
399
  v,
400
- D,
401
- w,
400
+ k,
401
+ T,
402
402
  z,
403
- x,
404
- yn,
403
+ S,
405
404
  bn,
406
405
  xn,
406
+ Sn,
407
407
  wt,
408
408
  Tt,
409
- b,
409
+ x,
410
410
  g,
411
411
  Q,
412
412
  X,
413
- F
414
- ]), wn = O((e, t) => {
413
+ L
414
+ ]), Tn = A((e, t) => {
415
415
  W((n) => ({
416
416
  ...n ?? {},
417
417
  [e]: t
418
418
  }));
419
- }, []), Tn = O(() => {
420
- F && !D && kt && Et.mutate(F);
419
+ }, []), En = A(() => {
420
+ L && !k && At && Et.mutate(L);
421
421
  }, [
422
- F,
423
- D,
424
- kt,
422
+ L,
423
+ k,
424
+ At,
425
425
  Et
426
- ]), En = A(() => Ke(U, _), [U, _]), Dn = Object.keys(En).length > 0;
427
- if (!Y || !b) return null;
428
- if (!D && L.loading) return /* @__PURE__ */ N(le, {});
429
- if (xt && !I) return /* @__PURE__ */ P("div", {
426
+ ]), Dn = M(() => Ge(U, _), [U, _]), On = Object.keys(Dn).length > 0;
427
+ if (!Y || !x) return null;
428
+ if (!k && bt.loading) return /* @__PURE__ */ F(le, {});
429
+ if (xt && !R) return /* @__PURE__ */ I("div", {
430
430
  style: { padding: 24 },
431
- children: [_n && /* @__PURE__ */ N(o, {
432
- icon: /* @__PURE__ */ N(a.back, { size: 14 }),
433
- onClick: gn.goBack,
431
+ children: [vn && /* @__PURE__ */ F(o, {
432
+ icon: /* @__PURE__ */ F(a.back, { size: 14 }),
433
+ onClick: _n.goBack,
434
434
  title: s("record.back", "Back")
435
- }), /* @__PURE__ */ P("p", {
435
+ }), /* @__PURE__ */ I("p", {
436
436
  role: "alert",
437
437
  style: {
438
438
  color: "var(--danger)",
@@ -441,26 +441,26 @@ function mt({ screenCode: i }) {
441
441
  gap: 8
442
442
  },
443
443
  children: [
444
- u(se, L.error),
444
+ u(se, bt.error),
445
445
  " ",
446
- /* @__PURE__ */ N(c, { onRetry: L.retry })
446
+ /* @__PURE__ */ F(c, { onRetry: bt.retry })
447
447
  ]
448
448
  })]
449
449
  });
450
- if (en) return /* @__PURE__ */ P("div", {
450
+ if (tn) return /* @__PURE__ */ I("div", {
451
451
  style: { padding: 24 },
452
- children: [/* @__PURE__ */ P("div", {
452
+ children: [/* @__PURE__ */ I("div", {
453
453
  style: {
454
454
  display: "flex",
455
455
  alignItems: "center",
456
456
  gap: 8,
457
457
  marginBottom: 8
458
458
  },
459
- children: [_n && /* @__PURE__ */ N(o, {
460
- icon: /* @__PURE__ */ N(a.back, { size: 14 }),
461
- onClick: gn.goBack,
459
+ children: [vn && /* @__PURE__ */ F(o, {
460
+ icon: /* @__PURE__ */ F(a.back, { size: 14 }),
461
+ onClick: _n.goBack,
462
462
  title: s("record.back", "Back")
463
- }), /* @__PURE__ */ N("h1", {
463
+ }), /* @__PURE__ */ F("h1", {
464
464
  style: {
465
465
  margin: 0,
466
466
  fontSize: 18,
@@ -469,25 +469,25 @@ function mt({ screenCode: i }) {
469
469
  },
470
470
  children: s("record.create_closed.title", "Not Available")
471
471
  })]
472
- }), /* @__PURE__ */ N("p", {
472
+ }), /* @__PURE__ */ F("p", {
473
473
  style: { color: "var(--text-3)" },
474
474
  children: s("record.create_closed.body", "This record type is not created from a form.")
475
475
  })]
476
476
  });
477
- if (!D && !J || $t) return /* @__PURE__ */ P("div", {
477
+ if (!k && !J || en) return /* @__PURE__ */ I("div", {
478
478
  style: { padding: 24 },
479
- children: [/* @__PURE__ */ P("div", {
479
+ children: [/* @__PURE__ */ I("div", {
480
480
  style: {
481
481
  display: "flex",
482
482
  alignItems: "center",
483
483
  gap: 8,
484
484
  marginBottom: 8
485
485
  },
486
- children: [_n && /* @__PURE__ */ N(o, {
487
- icon: /* @__PURE__ */ N(a.back, { size: 14 }),
488
- onClick: gn.goBack,
486
+ children: [vn && /* @__PURE__ */ F(o, {
487
+ icon: /* @__PURE__ */ F(a.back, { size: 14 }),
488
+ onClick: _n.goBack,
489
489
  title: s("record.back", "Back")
490
- }), /* @__PURE__ */ N("h1", {
490
+ }), /* @__PURE__ */ F("h1", {
491
491
  style: {
492
492
  margin: 0,
493
493
  fontSize: 18,
@@ -496,30 +496,30 @@ function mt({ screenCode: i }) {
496
496
  },
497
497
  children: s("record.missing.title", "Not Found")
498
498
  })]
499
- }), /* @__PURE__ */ N("p", {
499
+ }), /* @__PURE__ */ F("p", {
500
500
  style: { color: "var(--text-3)" },
501
501
  children: se("entity.not_found", "This record does not exist.")
502
502
  })]
503
503
  });
504
- let On = b.display, kn = s(Y.display?.name) || s(On.name), An = De(s, J, b), jn = D ? s("record.new_title", "New {name}", { name: kn }) : An ? String(An) : kn, Mn = wt.isPending || Tt.isPending, Nn = Y.responsive?.[y.category]?.layout, Pn = Nn?.tabs ?? (y.isPhone ? "sections" : void 0), Fn = Nn?.header_card === !0 ? et({
505
- entity: b,
504
+ let kn = x.display, An = s(Y.display?.name) || s(kn.name), jn = De(s, J, x), Mn = k ? s("record.new_title", "New {name}", { name: An }) : jn ? String(jn) : An, Nn = wt.isPending || Tt.isPending, Pn = Y.responsive?.[y.category]?.layout, Fn = Pn?.tabs ?? (y.isPhone ? "sections" : void 0), In = Pn?.header_card === !0 ? $e({
505
+ entity: x,
506
506
  screen: Y
507
507
  }) : void 0, $ = {
508
508
  schema: _,
509
- entity: b,
510
- entityCode: x,
511
- recordId: pt ?? E ?? "",
509
+ entity: x,
510
+ entityCode: S,
511
+ recordId: ft ?? O ?? "",
512
512
  record: K ? {
513
513
  ...J ?? {},
514
514
  ...B
515
515
  } : J ?? {},
516
- isNew: D,
516
+ isNew: k,
517
517
  mode: K ? "edit" : "display",
518
- onFieldChange: K ? pn : void 0,
519
- refs: Yt,
520
- headerFields: !D && J ? Le(Y, b) : void 0,
518
+ onFieldChange: K ? mn : void 0,
519
+ refs: Xt,
520
+ headerFields: !k && J ? Ie(Y, x) : void 0,
521
521
  objectProperties: (() => {
522
- let e = jt ?? [];
522
+ let e = Mt ?? [];
523
523
  if (!K || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
524
524
  let t = e.map((e) => H[e.property_code] === void 0 ? e : {
525
525
  ...e,
@@ -533,13 +533,13 @@ function mt({ screenCode: i }) {
533
533
  });
534
534
  return t;
535
535
  })(),
536
- onSetProperty: D || !z ? void 0 : K ? (e, t) => Lt((n) => ({
536
+ onSetProperty: k || !z ? void 0 : K ? (e, t) => Rt((n) => ({
537
537
  ...n,
538
538
  [e]: t
539
539
  })) : void 0,
540
540
  isPropertyPending: !1,
541
541
  objectStatuses: (() => {
542
- let e = At ?? [];
542
+ let e = jt ?? [];
543
543
  if (!K || Object.keys(V).length === 0) return e.length > 0 ? e : void 0;
544
544
  let t = e.map((e) => V[e.group_code] === void 0 ? e : {
545
545
  ...e,
@@ -553,73 +553,73 @@ function mt({ screenCode: i }) {
553
553
  });
554
554
  return t;
555
555
  })(),
556
- onSetStatus: D || !z ? void 0 : K ? (e, t) => It((n) => ({
556
+ onSetStatus: k || !z ? void 0 : K ? (e, t) => Lt((n) => ({
557
557
  ...n,
558
558
  [e]: t
559
559
  })) : void 0,
560
560
  isStatusPending: !1,
561
561
  pendingChildren: K ? U : void 0,
562
- onChildrenChange: K ? wn : void 0,
563
- childValidationErrors: K ? En : void 0,
564
- fieldErrors: K && Vt ? vn : void 0,
565
- detailTabsPresentation: Pn,
566
- relatedRecordsPresentation: Nn?.related_records
567
- }, In = !!Y.sidebar && (D ? Y.sidebar.some((e) => it(e, b, _?.entities ?? {})) : Y.sidebar.length > 0), Ln = Nn?.sidebar === "hidden", Rn = In && !Ln && !y.isDesktop, zn = In && !Ln && y.isDesktop, Bn = !D && J ? /* @__PURE__ */ N(Ie, {
562
+ onChildrenChange: K ? Tn : void 0,
563
+ childValidationErrors: K ? Dn : void 0,
564
+ fieldErrors: K && Ht ? yn : void 0,
565
+ detailTabsPresentation: Fn,
566
+ relatedRecordsPresentation: Pn?.related_records
567
+ }, Ln = !!Y.sidebar && (k ? Y.sidebar.some((e) => rt(e, x, _?.entities ?? {})) : Y.sidebar.length > 0), Rn = Pn?.sidebar === "hidden", zn = Ln && !Rn && !y.isDesktop, Bn = Ln && !Rn && y.isDesktop, Vn = !k && J ? /* @__PURE__ */ F(Fe, {
568
568
  screen: Y,
569
- entity: b,
570
- entityCode: x,
569
+ entity: x,
570
+ entityCode: S,
571
571
  record: J,
572
- refs: Yt,
573
- objectStatuses: At,
572
+ refs: Xt,
573
+ objectStatuses: jt,
574
574
  schema: _
575
- }) : void 0, Vn = /* @__PURE__ */ N(_t, {
576
- title: jn,
575
+ }) : void 0, Hn = /* @__PURE__ */ F(gt, {
576
+ title: Mn,
577
577
  editing: K,
578
- isNew: D,
579
- isRecordDeleted: Zt,
580
- dirty: Sn,
581
- isSaving: Mn,
582
- hasChildErrors: Dn,
583
- hasFieldErrors: Vt && yn,
584
- canRestore: kt,
585
- entity: b,
578
+ isNew: k,
579
+ isRecordDeleted: Qt,
580
+ dirty: Cn,
581
+ isSaving: Nn,
582
+ hasChildErrors: On,
583
+ hasFieldErrors: Ht && bn,
584
+ canRestore: At,
585
+ entity: x,
586
586
  screen: Y,
587
587
  globalActions: _?.actions,
588
- entityCode: x,
588
+ entityCode: S,
589
589
  record: J,
590
- id: E,
590
+ id: O,
591
591
  listRoute: Q,
592
- listRouteExists: !!mn,
593
- highlights: Bn,
594
- showBack: _n,
595
- onBack: gn.goBack,
596
- onCancelEdit: dn,
597
- onSave: Cn,
598
- onRestore: Tn,
592
+ listRouteExists: !!hn,
593
+ highlights: Vn,
594
+ showBack: vn,
595
+ onBack: _n.goBack,
596
+ onCancelEdit: fn,
597
+ onSave: wn,
598
+ onRestore: En,
599
599
  isRestoring: Et.isPending,
600
600
  refreshControl: {
601
- refetch: mt.refetch,
602
- isLoading: mt.isLoading,
601
+ refetch: pt.refetch,
602
+ isLoading: pt.isLoading,
603
603
  isLive: Ct
604
604
  },
605
- isRealtimeEntity: b?.realtime === !0,
606
- canManageTemplates: ye(_)
607
- }), Hn = Zt && /* @__PURE__ */ N(yt, {
605
+ isRealtimeEntity: x?.realtime === !0,
606
+ canManageTemplates: ve(_)
607
+ }), Un = Qt && /* @__PURE__ */ F(vt, {
608
608
  tone: "danger",
609
- children: s("record.deleted_banner", "This record was deleted on {date}", { date: n(String(J[b.soft_delete]), {
609
+ children: s("record.deleted_banner", "This record was deleted on {date}", { date: n(String(J[x.soft_delete]), {
610
610
  zone: s.timeZone,
611
- declared: !!(b.fields.get(b.soft_delete)?.timezone || b.default_timezone)
611
+ declared: !!(x.fields.get(x.soft_delete)?.timezone || x.default_timezone)
612
612
  }) })
613
- }), Un = Rt && /* @__PURE__ */ N(yt, {
613
+ }), Wn = zt && /* @__PURE__ */ F(vt, {
614
614
  tone: "warn",
615
615
  children: s("record.changed_on_server", "This record changed on the server while you were viewing or editing it.")
616
- }), Wn = Ot && J ? bt(s, b, J, Yt) : void 0, Gn = Ot && /* @__PURE__ */ N(yt, {
616
+ }), Gn = kt && J ? yt(s, x, J, Xt) : void 0, Kn = kt && /* @__PURE__ */ F(vt, {
617
617
  tone: "info",
618
618
  testId: "record-other-tenant-banner",
619
- children: Wn ? s("record.other_tenant_banner_named", "This record is set in the tenant {tenant}. Change it from that tenant.", { tenant: Wn }) : s("record.other_tenant_banner", "This record is set in another tenant. Change it from that tenant.")
620
- }), Kn = K && Vt && yn && /* @__PURE__ */ N(Fe, {
621
- errors: Object.entries(vn).map(([e, t]) => {
622
- let n = b.fields.get(e);
619
+ children: Gn ? s("record.other_tenant_banner_named", "This record is set in the tenant {tenant}. Change it from that tenant.", { tenant: Gn }) : s("record.other_tenant_banner", "This record is set in another tenant. Change it from that tenant.")
620
+ }), qn = K && Ht && bn && /* @__PURE__ */ F(Pe, {
621
+ errors: Object.entries(yn).map(([e, t]) => {
622
+ let n = x.fields.get(e);
623
623
  return {
624
624
  name: e,
625
625
  label: n ? Ee(s, n, e, _?.entities) : e,
@@ -627,70 +627,73 @@ function mt({ screenCode: i }) {
627
627
  };
628
628
  }),
629
629
  onJump: (e) => {
630
- let t = document.getElementById(`${x}-${e}`);
630
+ let t = document.getElementById(`${S}-${e}`);
631
631
  t && (t.scrollIntoView({
632
632
  block: "center",
633
633
  behavior: "smooth"
634
634
  }), t.focus?.());
635
635
  }
636
- }), qn = Dt && !D && !(Y.items && Y.items.length > 0) && /* @__PURE__ */ N("div", {
636
+ }), Jn = Dt && !k && !(Y.items && Y.items.length > 0) && /* @__PURE__ */ F("div", {
637
637
  className: "mb-4",
638
- children: /* @__PURE__ */ N(ze, {
639
- statusGroups: b.status_groups ?? {},
638
+ children: /* @__PURE__ */ F(Re, {
639
+ statusGroups: x.status_groups ?? {},
640
640
  objectStatuses: $.objectStatuses,
641
- onSetStatus: z && K ? (e, t) => It((n) => ({
641
+ onSetStatus: z && K ? (e, t) => Lt((n) => ({
642
642
  ...n,
643
643
  [e]: t
644
- })) : lt,
644
+ })) : ct,
645
645
  isPending: !1,
646
646
  mode: K ? "edit" : "display"
647
647
  })
648
- }), Jn = b.evidence_covered && !D && J && /* @__PURE__ */ N("div", {
648
+ }), Yn = x.evidence_covered && !k && J && /* @__PURE__ */ F("div", {
649
649
  className: "mb-4",
650
- children: /* @__PURE__ */ N(Be, { evidence: J.$evidence })
651
- }), Yn = /* @__PURE__ */ P(at, { children: [
652
- Fn && (J || D) && /* @__PURE__ */ N(ht, {
653
- card: Fn,
654
- entity: b,
650
+ children: /* @__PURE__ */ F(ze, {
651
+ evidence: J.$evidence,
652
+ refs: Xt
653
+ })
654
+ }), Xn = /* @__PURE__ */ I(it, { children: [
655
+ In && (J || k) && /* @__PURE__ */ F(mt, {
656
+ card: In,
657
+ entity: x,
655
658
  record: $.record,
656
659
  objectStatuses: $.objectStatuses,
657
660
  objectProperties: $.objectProperties
658
661
  }),
659
- Y.items && Y.items.length > 0 && (J || D) && _ && /* @__PURE__ */ N(Pe, {
662
+ Y.items && Y.items.length > 0 && (J || k) && _ && /* @__PURE__ */ F(Ne, {
660
663
  nodes: Y.items,
661
664
  ctx: $
662
665
  }),
663
- !D && E && x && b.associations && Object.keys(b.associations).length > 0 && _ && /* @__PURE__ */ N(fe, {
664
- entityCode: x,
665
- recordId: pt ?? E ?? "",
666
- associations: b.associations,
666
+ !k && O && S && x.associations && Object.keys(x.associations).length > 0 && _ && /* @__PURE__ */ F(fe, {
667
+ entityCode: S,
668
+ recordId: ft ?? O ?? "",
669
+ associations: x.associations,
667
670
  schema: _
668
671
  }),
669
- !D && E && x && /* @__PURE__ */ N(ve, {
670
- entity: b,
671
- entityCode: x,
672
- objectId: pt ?? E,
672
+ !k && O && S && /* @__PURE__ */ F(_e, {
673
+ entity: x,
674
+ entityCode: S,
675
+ objectId: ft ?? O,
673
676
  schema: _
674
677
  }),
675
- !D && J && _ && /* @__PURE__ */ N(Re, {
678
+ !k && J && _ && /* @__PURE__ */ F(Le, {
676
679
  screen: Y,
677
- entity: b,
678
- entityCode: x,
680
+ entity: x,
681
+ entityCode: S,
679
682
  record: J,
680
- recordId: pt ?? E,
681
- refs: Yt,
683
+ recordId: ft ?? O,
684
+ refs: Xt,
682
685
  schema: _
683
686
  })
684
- ] }), Xn = /* @__PURE__ */ P(at, { children: [
685
- Vn,
686
- Un,
687
+ ] }), Zn = /* @__PURE__ */ I(it, { children: [
687
688
  Hn,
688
- Gn,
689
+ Wn,
690
+ Un,
689
691
  Kn,
690
692
  qn,
691
- Jn
693
+ Jn,
694
+ Yn
692
695
  ] });
693
- return zn ? /* @__PURE__ */ P("div", {
696
+ return Bn ? /* @__PURE__ */ I("div", {
694
697
  style: {
695
698
  height: "100%",
696
699
  display: "flex",
@@ -698,23 +701,23 @@ function mt({ screenCode: i }) {
698
701
  background: "var(--background)"
699
702
  },
700
703
  children: [
701
- /* @__PURE__ */ N("div", {
704
+ /* @__PURE__ */ F("div", {
702
705
  style: {
703
706
  flex: 1,
704
707
  minWidth: 0,
705
708
  height: "100%"
706
709
  },
707
- children: /* @__PURE__ */ N(He, {
708
- scrollRef: Qt,
709
- header: Xn,
710
- children: Yn
710
+ children: /* @__PURE__ */ F(Ve, {
711
+ scrollRef: $t,
712
+ header: Zn,
713
+ children: Xn
711
714
  })
712
715
  }),
713
- /* @__PURE__ */ N("div", {
716
+ /* @__PURE__ */ F("div", {
714
717
  className: "detail-resize-handle",
715
- onMouseDown: Jt,
718
+ onMouseDown: Yt,
716
719
  title: s("record.layout.drag_to_resize", "Drag to resize"),
717
- children: /* @__PURE__ */ N("div", { style: {
720
+ children: /* @__PURE__ */ F("div", { style: {
718
721
  position: "absolute",
719
722
  top: 0,
720
723
  bottom: 0,
@@ -724,23 +727,23 @@ function mt({ screenCode: i }) {
724
727
  background: "var(--border)"
725
728
  } })
726
729
  }),
727
- /* @__PURE__ */ N("div", {
728
- ref: qt,
730
+ /* @__PURE__ */ F("div", {
731
+ ref: Jt,
729
732
  style: {
730
733
  flexShrink: 0,
731
734
  height: "100%",
732
- width: `${Gt}px`
735
+ width: `${Kt}px`
733
736
  },
734
- children: (J || D) && _ && /* @__PURE__ */ N(Pe, {
737
+ children: (J || k) && _ && /* @__PURE__ */ F(Ne, {
735
738
  nodes: Y.sidebar,
736
739
  ctx: $
737
740
  })
738
741
  })
739
742
  ]
740
- }) : /* @__PURE__ */ P(He, {
741
- scrollRef: Qt,
742
- header: Xn,
743
- children: [Yn, Rn && (J || D) && _ && /* @__PURE__ */ N("div", {
743
+ }) : /* @__PURE__ */ I(Ve, {
744
+ scrollRef: $t,
745
+ header: Zn,
746
+ children: [Xn, zn && (J || k) && _ && /* @__PURE__ */ F("div", {
744
747
  "data-testid": "detail-sidebar-inline",
745
748
  style: {
746
749
  display: "flex",
@@ -748,25 +751,25 @@ function mt({ screenCode: i }) {
748
751
  gap: 16,
749
752
  minWidth: 0
750
753
  },
751
- children: /* @__PURE__ */ N(Pe, {
754
+ children: /* @__PURE__ */ F(Ne, {
752
755
  nodes: Y.sidebar,
753
756
  ctx: $
754
757
  })
755
758
  })]
756
759
  });
757
760
  }
758
- function ht({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
759
- let a = tt(), o = (e) => {
760
- let o = I(a, t, e, n, r, i);
761
- return o != null && T(o) !== "";
761
+ function mt({ card: e, entity: t, record: n, objectStatuses: r, objectProperties: i }) {
762
+ let a = et(), o = (e) => {
763
+ let o = R(a, t, e, n, r, i);
764
+ return o != null && D(o) !== "";
762
765
  }, s = (e) => {
763
- let o = I(a, t, e, n, r, i);
764
- return T(o) || /* @__PURE__ */ N("span", {
766
+ let o = R(a, t, e, n, r, i);
767
+ return D(o) || /* @__PURE__ */ F("span", {
765
768
  style: { color: "var(--text-3)" },
766
769
  children: "-"
767
770
  });
768
- }, c = e.titleUsesDisplay ? De(a, n, t) : e.titleField ? I(a, t, e.titleField, n, r, i) : void 0, l = T(c) || a(t.display?.name) || a("record.fallback_title", "Record"), u = e.badgeFields.filter((t) => !e.hideEmptyFields || o(t)), ee = e.bodyFields.filter((t) => !e.hideEmptyFields || o(t)), d = e.metaFields.filter((t) => !e.hideEmptyFields || o(t));
769
- return /* @__PURE__ */ P("section", {
771
+ }, c = e.titleUsesDisplay ? De(a, n, t) : e.titleField ? R(a, t, e.titleField, n, r, i) : void 0, l = D(c) || a(t.display?.name) || a("record.fallback_title", "Record"), u = e.badgeFields.filter((t) => !e.hideEmptyFields || o(t)), ee = e.bodyFields.filter((t) => !e.hideEmptyFields || o(t)), d = e.metaFields.filter((t) => !e.hideEmptyFields || o(t));
772
+ return /* @__PURE__ */ I("section", {
770
773
  "data-testid": "detail-header-card",
771
774
  style: {
772
775
  width: "100%",
@@ -779,9 +782,9 @@ function ht({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
779
782
  boxSizing: "border-box"
780
783
  },
781
784
  children: [
782
- /* @__PURE__ */ P("div", {
785
+ /* @__PURE__ */ I("div", {
783
786
  style: { minWidth: 0 },
784
- children: [/* @__PURE__ */ N("div", {
787
+ children: [/* @__PURE__ */ F("div", {
785
788
  style: {
786
789
  fontSize: 15,
787
790
  lineHeight: 1.25,
@@ -790,7 +793,7 @@ function ht({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
790
793
  overflowWrap: "anywhere"
791
794
  },
792
795
  children: l
793
- }), e.subtitleField && /* @__PURE__ */ N("div", {
796
+ }), e.subtitleField && /* @__PURE__ */ F("div", {
794
797
  style: {
795
798
  marginTop: 4,
796
799
  fontSize: 12.5,
@@ -801,14 +804,14 @@ function ht({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
801
804
  children: s(e.subtitleField)
802
805
  })]
803
806
  }),
804
- u.length > 0 && /* @__PURE__ */ N("div", {
807
+ u.length > 0 && /* @__PURE__ */ F("div", {
805
808
  style: {
806
809
  display: "flex",
807
810
  flexWrap: "wrap",
808
811
  gap: 6,
809
812
  marginTop: 10
810
813
  },
811
- children: u.map((e) => /* @__PURE__ */ N("span", {
814
+ children: u.map((e) => /* @__PURE__ */ F("span", {
812
815
  style: {
813
816
  minWidth: 0,
814
817
  maxWidth: "100%",
@@ -823,7 +826,7 @@ function ht({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
823
826
  children: s(e)
824
827
  }, e))
825
828
  }),
826
- ee.length > 0 && /* @__PURE__ */ N("dl", {
829
+ ee.length > 0 && /* @__PURE__ */ F("dl", {
827
830
  style: {
828
831
  display: "grid",
829
832
  gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
@@ -832,12 +835,12 @@ function ht({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
832
835
  fontSize: 12.5,
833
836
  lineHeight: 1.35
834
837
  },
835
- children: ee.map((e) => /* @__PURE__ */ P("div", {
838
+ children: ee.map((e) => /* @__PURE__ */ I("div", {
836
839
  style: { display: "contents" },
837
- children: [/* @__PURE__ */ N("dt", {
840
+ children: [/* @__PURE__ */ F("dt", {
838
841
  style: { color: "var(--text-3)" },
839
- children: gt(a, t, e)
840
- }), /* @__PURE__ */ N("dd", {
842
+ children: ht(a, t, e)
843
+ }), /* @__PURE__ */ F("dd", {
841
844
  style: {
842
845
  margin: 0,
843
846
  color: "var(--text-2)",
@@ -848,7 +851,7 @@ function ht({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
848
851
  })]
849
852
  }, e))
850
853
  }),
851
- d.length > 0 && /* @__PURE__ */ N("div", {
854
+ d.length > 0 && /* @__PURE__ */ F("div", {
852
855
  style: {
853
856
  display: "flex",
854
857
  flexWrap: "wrap",
@@ -857,13 +860,13 @@ function ht({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
857
860
  color: "var(--text-3)",
858
861
  fontSize: 11.5
859
862
  },
860
- children: d.map((e) => /* @__PURE__ */ P("span", {
863
+ children: d.map((e) => /* @__PURE__ */ I("span", {
861
864
  style: {
862
865
  minWidth: 0,
863
866
  overflowWrap: "anywhere"
864
867
  },
865
868
  children: [
866
- gt(a, t, e),
869
+ ht(a, t, e),
867
870
  ": ",
868
871
  s(e)
869
872
  ]
@@ -872,7 +875,7 @@ function ht({ card: e, entity: t, record: n, objectStatuses: r, objectProperties
872
875
  ]
873
876
  });
874
877
  }
875
- function I(e, t, n, r, i, a) {
878
+ function R(e, t, n, r, i, a) {
876
879
  if (n.startsWith("$status.")) {
877
880
  let t = n.slice(8), r = i?.find((e) => e.group_code === t);
878
881
  return e(r?.status_name) || r?.status_code;
@@ -881,16 +884,16 @@ function I(e, t, n, r, i, a) {
881
884
  let e = n.slice(10);
882
885
  return a?.find((t) => t.property_code === e)?.value;
883
886
  }
884
- return $e(t, r, n);
887
+ return Qe(t, r, n);
885
888
  }
886
- function gt(e, t, n) {
889
+ function ht(e, t, n) {
887
890
  if (n.startsWith("$status.")) return n.slice(8);
888
891
  if (n.startsWith("$property.")) return n.slice(10);
889
892
  let r = t.fields.get(n);
890
893
  return r ? Ee(e, r, n) : n;
891
894
  }
892
- function _t({ title: e, editing: t, isNew: n, isRecordDeleted: r, dirty: o, isSaving: c, hasChildErrors: l, hasFieldErrors: u, canRestore: ee, entity: d, screen: f, globalActions: p, entityCode: te, record: m, id: h, listRoute: ie, listRouteExists: ae, highlights: oe, showBack: ce, onBack: le, onCancelEdit: fe, onSave: pe, onRestore: he, isRestoring: ve, refreshControl: ye, isRealtimeEntity: be, canManageTemplates: xe }) {
893
- let S = tt(), Ce = tt("errors"), we = nt(d), { run: Te } = ue(), C = se("detail"), Ee = x(), De = Se(), Oe = _(f?.action_layout, d?.action_layout, d?.actions, p, "detail_toolbar"), ke = _(f?.action_layout, d?.action_layout, d?.actions, p, "detail"), Ae = me(S, ke, d?.actions, p, m ?? {}, [], we, ge(d, m ?? {})), je = me(S, Oe, d?.actions, p, m ?? {}, [], we, ge(d, m ?? {})), w = A(() => {
895
+ function gt({ title: e, editing: t, isNew: n, isRecordDeleted: r, dirty: o, isSaving: c, hasChildErrors: l, hasFieldErrors: u, canRestore: ee, entity: d, screen: f, globalActions: p, entityCode: te, record: m, id: h, listRoute: ie, listRouteExists: ae, highlights: oe, showBack: ce, onBack: le, onCancelEdit: fe, onSave: pe, onRestore: he, isRestoring: _e, refreshControl: ve, isRealtimeEntity: ye, canManageTemplates: be }) {
896
+ let C = et(), Se = et("errors"), Ce = tt(d), { run: we } = ue(), w = se("detail"), Te = S(), Ee = xe(), De = _(f?.action_layout, d?.action_layout, d?.actions, p, "detail_toolbar"), Oe = _(f?.action_layout, d?.action_layout, d?.actions, p, "detail"), ke = me(C, Oe, d?.actions, p, m ?? {}, [], Ce, ge(d, m ?? {})), Ae = me(C, De, d?.actions, p, m ?? {}, [], Ce, ge(d, m ?? {})), je = M(() => {
894
897
  if (!d) return;
895
898
  let e = h ? [h] : [];
896
899
  return {
@@ -900,8 +903,8 @@ function _t({ title: e, editing: t, isNew: n, isRecordDeleted: r, dirty: o, isSa
900
903
  screenRoute: f?.route ?? "",
901
904
  selectedRows: m ? [m] : [],
902
905
  selectedIds: e,
903
- t: S,
904
- tabNavigate: (e, t) => Ee(e, {
906
+ t: C,
907
+ tabNavigate: (e, t) => Te(e, {
905
908
  title: t?.title,
906
909
  icon: t?.icon,
907
910
  search: t?.search
@@ -915,34 +918,34 @@ function _t({ title: e, editing: t, isNew: n, isRecordDeleted: r, dirty: o, isSa
915
918
  f,
916
919
  h,
917
920
  m,
918
- S,
919
- Ee
920
- ]), Me = (e, t) => {
921
- let n = v(Ce, e, t, { row: m ?? void 0 });
921
+ C,
922
+ Te
923
+ ]), T = (e, t) => {
924
+ let n = v(Se, e, t, { row: m ?? void 0 });
922
925
  if (n === null) return;
923
926
  let r = h ? [h] : [], i = e === "__delete" && ae ? ie : null;
924
- return Te({
927
+ return we({
925
928
  action: t,
926
- title: S(t.display?.name) || e,
929
+ title: C(t.display?.name) || e,
927
930
  row: m ?? void 0,
928
931
  execute: (e) => de(n, g(e, r)),
929
932
  onSuccess: i ? () => {
930
- re.getState().kill(ne(location)), De(i, { replace: !0 });
933
+ re.getState().kill(ne(location)), Ee(i, { replace: !0 });
931
934
  } : void 0
932
935
  });
933
- }, Ne = C.isVisible("show_actions") && !n && h && Ae.length > 0 ? /* @__PURE__ */ N(y, {
934
- layout: Ae,
936
+ }, E = w.isVisible("show_actions") && !n && h && ke.length > 0 ? /* @__PURE__ */ F(y, {
937
+ layout: ke,
935
938
  row: m,
936
- onRun: Me,
939
+ onRun: T,
937
940
  kind: "detail",
938
941
  entityActions: d?.actions,
939
942
  globalActions: p,
940
943
  reservedRightWidth: 0,
941
- widgetContext: w
942
- }) : null, Pe = !n && h ? /* @__PURE__ */ N(_e, {
943
- liveObject: ye,
944
- realtime: be
945
- }) : null, Fe = C.isVisible("show_actions") && !n && h && je.length > 0 ? /* @__PURE__ */ P("div", {
944
+ widgetContext: je
945
+ }) : null, Me = !n && h ? /* @__PURE__ */ F(b, {
946
+ liveObject: ve,
947
+ realtime: ye
948
+ }) : null, Ne = w.isVisible("show_actions") && !n && h && Ae.length > 0 ? /* @__PURE__ */ I("div", {
946
949
  style: {
947
950
  display: "flex",
948
951
  justifyContent: "flex-end",
@@ -950,63 +953,63 @@ function _t({ title: e, editing: t, isNew: n, isRecordDeleted: r, dirty: o, isSa
950
953
  gap: 8,
951
954
  marginTop: 10
952
955
  },
953
- children: [Ne || !r && !t ? null : Pe, /* @__PURE__ */ N(y, {
954
- layout: je,
956
+ children: [E || !r && !t ? null : Me, /* @__PURE__ */ F(y, {
957
+ layout: Ae,
955
958
  row: m,
956
- onRun: Me,
959
+ onRun: T,
957
960
  kind: "detail",
958
961
  entityActions: d?.actions,
959
962
  globalActions: p,
960
963
  reservedRightWidth: 0,
961
- widgetContext: w,
962
- ariaLabel: Ne ? S("record.toolbar_actions", "Detail toolbar actions") : S("record.page_actions", "Page actions")
964
+ widgetContext: je,
965
+ ariaLabel: E ? C("record.toolbar_actions", "Detail toolbar actions") : C("record.page_actions", "Page actions")
963
966
  })]
964
- }) : null, Ie = C.isVisible("show_actions") && !n && h && te ? /* @__PURE__ */ N(b, {
967
+ }) : null, Pe = w.isVisible("show_actions") && !n && h && te ? /* @__PURE__ */ F(x, {
965
968
  entityCode: te,
966
969
  scope: "detail",
967
970
  objectIds: [h],
968
971
  capability: d?.documents,
969
- canManageTemplates: xe
970
- }) : null, Le = r ? ee ? /* @__PURE__ */ N(i, {
972
+ canManageTemplates: be
973
+ }) : null, Fe = r ? ee ? /* @__PURE__ */ F(i, {
971
974
  kind: "primary",
972
- icon: N(ve ? s : a.refresh, { size: 13 }),
975
+ icon: F(_e ? s : a.refresh, { size: 13 }),
973
976
  onClick: he,
974
- disabled: ve,
975
- children: ve ? S("record.restoring", "Restoring…") : S("record.restore", "Restore")
976
- }) : null : t ? /* @__PURE__ */ P(at, { children: [/* @__PURE__ */ N(i, {
977
- icon: /* @__PURE__ */ N(a.x, { size: 13 }),
977
+ disabled: _e,
978
+ children: _e ? C("record.restoring", "Restoring…") : C("record.restore", "Restore")
979
+ }) : null : t ? /* @__PURE__ */ I(it, { children: [/* @__PURE__ */ F(i, {
980
+ icon: /* @__PURE__ */ F(a.x, { size: 13 }),
978
981
  onClick: fe,
979
982
  disabled: c,
980
- children: S("dialog.cancel", "Cancel")
981
- }), /* @__PURE__ */ N(i, {
983
+ children: C("dialog.cancel", "Cancel")
984
+ }), /* @__PURE__ */ F(i, {
982
985
  kind: "primary",
983
- icon: N(c ? s : a.save, { size: 13 }),
986
+ icon: F(c ? s : a.save, { size: 13 }),
984
987
  onClick: pe,
985
988
  disabled: c || l || u,
986
- title: l ? S("record.save.fix_child_rows", "Fix errors in child rows") : u ? S("record.save.fix_fields", "Fix the highlighted fields") : void 0,
987
- children: c ? S("dialog.saving", "Saving…") : S("dialog.save", "Save")
988
- })] }) : !n && h ? Ne ? /* @__PURE__ */ P("span", {
989
+ title: l ? C("record.save.fix_child_rows", "Fix errors in child rows") : u ? C("record.save.fix_fields", "Fix the highlighted fields") : void 0,
990
+ children: c ? C("dialog.saving", "Saving…") : C("dialog.save", "Save")
991
+ })] }) : !n && h ? E ? /* @__PURE__ */ I("span", {
989
992
  style: { display: "contents" },
990
- children: [Ie, Ne]
991
- }) : Ie : null;
992
- return /* @__PURE__ */ P(at, { children: [/* @__PURE__ */ N(Ve, {
993
- icon: d?.display.icon ? /* @__PURE__ */ N(Ue, {
993
+ children: [Pe, E]
994
+ }) : Pe : null;
995
+ return /* @__PURE__ */ I(it, { children: [/* @__PURE__ */ F(Be, {
996
+ icon: d?.display.icon ? /* @__PURE__ */ F(He, {
994
997
  name: d.display.icon,
995
998
  size: 16
996
999
  }) : void 0,
997
1000
  title: e,
998
- description: S(f?.display?.description) || S(d?.display?.description),
1001
+ description: C(f?.display?.description) || C(d?.display?.description),
999
1002
  highlights: oe,
1000
- identityControls: !r && !t && !n ? Pe : null,
1003
+ identityControls: !r && !t && !n ? Me : null,
1001
1004
  mode: n ? "create" : t ? "edit" : "display",
1002
1005
  dirty: o,
1003
1006
  showBack: ce,
1004
1007
  onBack: le,
1005
- right: Le,
1006
- showTitle: C.isVisible("show_title")
1007
- }), Fe] });
1008
+ right: Fe,
1009
+ showTitle: w.isVisible("show_title")
1010
+ }), Ne] });
1008
1011
  }
1009
- var vt = {
1012
+ var _t = {
1010
1013
  danger: {
1011
1014
  border: "var(--danger)",
1012
1015
  background: "var(--danger-soft)",
@@ -1023,9 +1026,9 @@ var vt = {
1023
1026
  color: "var(--accent)"
1024
1027
  }
1025
1028
  };
1026
- function yt({ tone: e, testId: t, children: n }) {
1027
- let r = vt[e];
1028
- return /* @__PURE__ */ P("div", {
1029
+ function vt({ tone: e, testId: t, children: n }) {
1030
+ let r = _t[e];
1031
+ return /* @__PURE__ */ I("div", {
1029
1032
  "data-testid": t,
1030
1033
  style: {
1031
1034
  display: "flex",
@@ -1039,13 +1042,13 @@ function yt({ tone: e, testId: t, children: n }) {
1039
1042
  color: r.color,
1040
1043
  fontSize: 12.5
1041
1044
  },
1042
- children: [N(e === "info" ? a.info : a.warning, { size: 14 }), /* @__PURE__ */ N("span", { children: n })]
1045
+ children: [F(e === "info" ? a.info : a.warning, { size: 14 }), /* @__PURE__ */ F("span", { children: n })]
1043
1046
  });
1044
1047
  }
1045
- function bt(e, t, n, r) {
1048
+ function yt(e, t, n, r) {
1046
1049
  let i = t.tenant_key, a = i ? t.fields.get(i) : void 0;
1047
1050
  if (!i || !a?.ref?.entity) return;
1048
1051
  let o = r?.[a.ref.entity]?.[String(n[i])];
1049
- if (o) return w(e, o, a.display?.ref_display_field || "$display", "") || void 0;
1052
+ if (o) return T(e, o, a.display?.ref_display_field || "$display", "") || void 0;
1050
1053
  }
1051
- export { pt as SmartDetailPage };
1054
+ export { ft as SmartDetailPage };