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