@plumile/backoffice-react 0.1.84 → 0.1.87

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 (69) hide show
  1. package/README.md +113 -77
  2. package/lib/esm/{AcceptInvitationScreen-5-0EtE15.js → AcceptInvitationScreen-dnOvRx4Z.js} +2 -2
  3. package/lib/esm/{AcceptInvitationScreen-5-0EtE15.js.map → AcceptInvitationScreen-dnOvRx4Z.js.map} +1 -1
  4. package/lib/esm/{BackofficeAcceptInvitationPage-FPbn31YK.js → BackofficeAcceptInvitationPage-CGht2ka0.js} +3 -9
  5. package/lib/esm/{BackofficeAcceptInvitationPage-FPbn31YK.js.map → BackofficeAcceptInvitationPage-CGht2ka0.js.map} +1 -1
  6. package/lib/esm/{BackofficeDashboardPage-C7lIVeA1.js → BackofficeDashboardPage-h1OWb_rV.js} +31 -32
  7. package/lib/esm/BackofficeDashboardPage-h1OWb_rV.js.map +1 -0
  8. package/lib/esm/BackofficeEntityDetailPage-CIyGKwVP.js +1044 -0
  9. package/lib/esm/BackofficeEntityDetailPage-CIyGKwVP.js.map +1 -0
  10. package/lib/esm/BackofficeEntityListPage-DmZozSNk.js +402 -0
  11. package/lib/esm/BackofficeEntityListPage-DmZozSNk.js.map +1 -0
  12. package/lib/esm/{BackofficeLayoutPage-Da4y2B0i.js → BackofficeLayoutPage-DtFDn_nU.js} +2 -2
  13. package/lib/esm/BackofficeLayoutPage-DtFDn_nU.js.map +1 -0
  14. package/lib/esm/{BackofficeLoginPage-Dc61SyMV.js → BackofficeLoginPage-BvOPqbKO.js} +3 -8
  15. package/lib/esm/{BackofficeLoginPage-Dc61SyMV.js.map → BackofficeLoginPage-BvOPqbKO.js.map} +1 -1
  16. package/lib/esm/{BackofficePasswordResetCompletePage-CvoHqhBS.js → BackofficePasswordResetCompletePage-ZLhghfhC.js} +1 -2
  17. package/lib/esm/{BackofficePasswordResetCompletePage-CvoHqhBS.js.map → BackofficePasswordResetCompletePage-ZLhghfhC.js.map} +1 -1
  18. package/lib/esm/{BackofficePasswordResetRequestPage-DDNcCf3_.js → BackofficePasswordResetRequestPage-BLNHQD79.js} +1 -3
  19. package/lib/esm/{BackofficePasswordResetRequestPage-DDNcCf3_.js.map → BackofficePasswordResetRequestPage-BLNHQD79.js.map} +1 -1
  20. package/lib/esm/{BackofficeRightPageLayout-F8ipegrl.js → BackofficeRightPageLayout-DZQvIHnj.js} +2 -2
  21. package/lib/esm/{BackofficeRightPageLayout-F8ipegrl.js.map → BackofficeRightPageLayout-DZQvIHnj.js.map} +1 -1
  22. package/lib/esm/EntityIdPickerDialog-DbTnDU4v.js.map +1 -1
  23. package/lib/esm/backoffice-react.js +164 -167
  24. package/lib/esm/backoffice-react.js.map +1 -1
  25. package/lib/esm/{environment-BJeJTbIN.js → environment-BXoBq_6e.js} +72 -73
  26. package/lib/esm/environment-BXoBq_6e.js.map +1 -0
  27. package/lib/esm/{synchronizeAuthStatusQuery-Dr6AEFhi.js → synchronizeAuthStatusQuery-By_lNCnP.js} +2 -2
  28. package/lib/esm/{synchronizeAuthStatusQuery-Dr6AEFhi.js.map → synchronizeAuthStatusQuery-By_lNCnP.js.map} +1 -1
  29. package/lib/esm/{useAuth-CjdysxLB.js → useAuth-OVPPa9bO.js} +2 -2
  30. package/lib/esm/useAuth-OVPPa9bO.js.map +1 -0
  31. package/lib/esm/{useBackofficeAuth-BshabGXc.js → useBackofficeAuth-BvEoEqnB.js} +2 -2
  32. package/lib/esm/{useBackofficeAuth-BshabGXc.js.map → useBackofficeAuth-BvEoEqnB.js.map} +1 -1
  33. package/lib/types/hooks/useBackofficeSidebarPins.d.ts +4 -0
  34. package/lib/types/hooks/useBackofficeSidebarPins.d.ts.map +1 -1
  35. package/lib/types/i18n/createI18nInstance.d.ts +8 -0
  36. package/lib/types/i18n/createI18nInstance.d.ts.map +1 -1
  37. package/lib/types/i18n/mergeResourceLanguages.d.ts +4 -0
  38. package/lib/types/i18n/mergeResourceLanguages.d.ts.map +1 -1
  39. package/lib/types/modules/base64.d.ts.map +1 -1
  40. package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
  41. package/lib/types/pages/BackofficeDashboardPage.helpers.d.ts +9 -0
  42. package/lib/types/pages/BackofficeDashboardPage.helpers.d.ts.map +1 -0
  43. package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
  44. package/lib/types/pages/BackofficeEntityDetailPage.helpers.d.ts +14 -0
  45. package/lib/types/pages/BackofficeEntityDetailPage.helpers.d.ts.map +1 -0
  46. package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts +150 -0
  47. package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -0
  48. package/lib/types/pages/BackofficeEntityListPage.d.ts.map +1 -1
  49. package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts +29 -0
  50. package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts.map +1 -0
  51. package/lib/types/provider/entityRegistry.d.ts +5 -0
  52. package/lib/types/provider/entityRegistry.d.ts.map +1 -1
  53. package/lib/types/provider/useBackofficeEntityLoader.d.ts +5 -0
  54. package/lib/types/provider/useBackofficeEntityLoader.d.ts.map +1 -1
  55. package/lib/types/relay/envHelpers.d.ts +6 -0
  56. package/lib/types/relay/envHelpers.d.ts.map +1 -1
  57. package/lib/types/relay/environment.d.ts +26 -0
  58. package/lib/types/relay/environment.d.ts.map +1 -1
  59. package/lib/types/router/createBackofficeRoutes.d.ts +12 -1
  60. package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
  61. package/package.json +16 -16
  62. package/lib/esm/BackofficeDashboardPage-C7lIVeA1.js.map +0 -1
  63. package/lib/esm/BackofficeEntityDetailPage-BljQmWsw.js +0 -991
  64. package/lib/esm/BackofficeEntityDetailPage-BljQmWsw.js.map +0 -1
  65. package/lib/esm/BackofficeEntityListPage-BneDsGo-.js +0 -385
  66. package/lib/esm/BackofficeEntityListPage-BneDsGo-.js.map +0 -1
  67. package/lib/esm/BackofficeLayoutPage-Da4y2B0i.js.map +0 -1
  68. package/lib/esm/environment-BJeJTbIN.js.map +0 -1
  69. package/lib/esm/useAuth-CjdysxLB.js.map +0 -1
@@ -0,0 +1,1044 @@
1
+ import { t as e } from "./useRelayEnvironment-vQ86aW-n.js";
2
+ import { n as t } from "./BackofficeConfigContext-R0t1owTI.js";
3
+ import { n, t as r } from "./useBackofficeReactTranslation-WfXU8kCf.js";
4
+ import { n as i } from "./EntityIdPickerDialog-DbTnDU4v.js";
5
+ import { a, n as o, r as s, t as c } from "./BackofficeDetailPayload-iVx66o_6.js";
6
+ import { i as l } from "./mutationResult-CcQMY13J.js";
7
+ import { t as u } from "./pageResolution-hAQA5C6S.js";
8
+ import { n as d, t as f } from "./BackofficeRightPageLayout-DZQvIHnj.js";
9
+ import { n as p, t as m } from "./toastViewAction-BGTS7vqm.js";
10
+ import { n as h } from "./buildBreadcrumbs-CqF9Nh6x.js";
11
+ import { n as g } from "./BackofficeEntityDetailLayoutContext-C_tBqkVq.js";
12
+ import { i as _, n as ee, r as v, t as y } from "./LazyBackofficeEntityActionFormDialog-BE3wVfU6.js";
13
+ import { Fragment as b, Suspense as x, createElement as S, useCallback as C, useContext as w, useMemo as T, useState as E } from "react";
14
+ import { useTranslation as D } from "react-i18next";
15
+ import { HttpRedirect as O, Link as k, RoutingContext as A } from "@plumile/router";
16
+ import { BackofficeKeyValueList as j, BackofficePageHeader as te, BackofficeRelationsMenu as ne, BackofficeTableSkeleton as M, BackofficeTabs as re, Button as N, ChatCheckSvg as ie, DataTable as ae, DetailPageTemplate as oe, FormattedDate as se, HighlightCode as ce, KeyOffSvg as P, KeySvg as le, LazyBackofficeJsonViewer as ue, LazyMarkdownRenderer as F, LinkButton as de, LockOpenSvg as fe, LockSvg as I, RobotCheckSvg as L, RobotXSvg as R, RocketOffSvg as z, RocketSvg as B, SettingsCheckSvg as V, SettingsXSvg as H, ShieldLockSvg as U, ShieldOffSvg as W, Tag as G, XBadgeSvg as pe, cx as me, useToast as he } from "@plumile/ui";
17
+ import * as ge from "react-relay";
18
+ import { commitMutation as _e, useFragment as K, usePreloadedQuery as ve } from "react-relay";
19
+ import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
20
+ import { BACKOFFICE_DATE_TIME_OPTIONS as ye, BACKOFFICE_LIST_REFETCH_POLICY as be, BACKOFFICE_RELATED_TAB_PAGE_SIZE as xe } from "@plumile/backoffice-core/constants.js";
21
+ import { buildBackofficeFallbackListHref as Se, buildBackofficeListHref as Ce, buildBackofficeListLink as we } from "@plumile/backoffice-core/state/buildListHref.js";
22
+ import { setWhereValue as Te } from "@plumile/backoffice-core/filters/where.js";
23
+ //#region src/components/backoffice/scaffolds/BackofficeEntityDetailScaffold.tsx
24
+ var Ee = ({ node: e, render: t, notFound: n }) => {
25
+ let { t: i } = r(), a = n ?? i("detail.notFound");
26
+ return e == null ? /* @__PURE__ */ J(q, { children: a }) : t(e) ?? /* @__PURE__ */ J(q, { children: a });
27
+ }, De = "txvbqb9ip txvbqbcp txvbqbao7", Oe = "_1lzrtns0 txvbqb9ip txvbqbcp", ke = "_1lzrtns1", Ae = ({ tone: e, icon: t, label: n }) => {
28
+ let r = t != null, i = null;
29
+ return r && (i = /* @__PURE__ */ J("span", {
30
+ className: Oe,
31
+ children: t
32
+ })), /* @__PURE__ */ J(G, {
33
+ tone: e,
34
+ children: /* @__PURE__ */ Y("span", {
35
+ className: De,
36
+ children: [i, /* @__PURE__ */ J("span", {
37
+ className: ke,
38
+ children: n
39
+ })]
40
+ })
41
+ });
42
+ }, je = "txvbqb9jg txvbqbcp txvbqbao7 txvbqbajy", Me = "txvbqb9jg txvbqbcp txvbqbany", Ne = ({ tag: e, value: t }) => /* @__PURE__ */ Y("span", {
43
+ className: je,
44
+ children: [e != null && /* @__PURE__ */ J(G, {
45
+ tone: e.tone,
46
+ children: e.label
47
+ }), /* @__PURE__ */ J("span", {
48
+ className: Me,
49
+ children: t
50
+ })]
51
+ }), Pe = "txvbqb9ip txvbqbai7 txvbqbaop", Fe = "txvbqb9ip txvbqbai7 txvbqbao7 txvbqblb7 txvbqb1ry", Ie = "txvbqb1cp txvbqb1qg txvbqbwp txvbqbv45", Le = "txvbqb9ip txvbqbai7 txvbqbany", Re = "txvbqbal7 txvbqb8y txvbqbva3", ze = "txvbqbamp", Be = "txvbqb8y", Ve = ({ title: e, description: t, items: n }) => {
52
+ let { t: i } = r();
53
+ return n.length === 0 ? null : /* @__PURE__ */ J(s, {
54
+ title: e,
55
+ description: t,
56
+ children: /* @__PURE__ */ J("div", {
57
+ className: Pe,
58
+ children: n.map((e, t) => {
59
+ let n = i("common.notAvailable");
60
+ return e.details != null && (n = o(e.details)), /* @__PURE__ */ Y("div", {
61
+ className: me(Fe, Ie),
62
+ children: [/* @__PURE__ */ Y("div", {
63
+ className: Le,
64
+ children: [/* @__PURE__ */ J("span", {
65
+ className: Re,
66
+ children: e.code
67
+ }), /* @__PURE__ */ J("span", {
68
+ className: ze,
69
+ children: e.message
70
+ })]
71
+ }), /* @__PURE__ */ J("div", {
72
+ className: Be,
73
+ children: /* @__PURE__ */ J(F, { content: n })
74
+ })]
75
+ }, `${e.code}-${t}`);
76
+ })
77
+ })
78
+ });
79
+ }, { useLazyLoadQuery: He, usePaginationFragment: Ue } = ge, We = ({ title: e, config: t, entities: n, whereKey: i, value: a, path: o }) => {
80
+ let { t: s } = D(), { t: c } = r();
81
+ if (t.list.kind === "records") return null;
82
+ let l = t.list, u = t.listDefaults ?? l.defaultState ?? {
83
+ where: null,
84
+ sort: null
85
+ }, [f, p] = E({
86
+ where: u.where,
87
+ sort: u.sort ?? null
88
+ }), m = T(() => a == null || a.trim() === "" ? null : Te(f.where, i, a, o), [
89
+ o,
90
+ f.where,
91
+ a,
92
+ i
93
+ ]), h = m ?? f.where, g = f.sort ?? u.sort, y = T(() => ({
94
+ where: h,
95
+ sort: g,
96
+ count: xe,
97
+ cursor: null
98
+ }), [h, g]), b = T(() => l.buildVariables == null ? y : l.buildVariables(y), [l, y]), x = He(l.query, b, { fetchPolicy: "store-or-network" }), { data: S, loadNext: w, hasNext: O, isLoadingNext: k, refetch: A } = Ue(l.fragment, x), j = l.getConnection(S), te = T(() => j.edges.map((e) => l.toRow(e.node)), [j.edges, l]), ne = T(() => d(l.columns, {
99
+ tApp: s,
100
+ t: c,
101
+ resolveEntityHref: (e, t) => {
102
+ let r = n[e];
103
+ return r == null ? null : r.routes.detail(t);
104
+ }
105
+ }), [
106
+ n,
107
+ l.columns,
108
+ c,
109
+ s
110
+ ]), M = C((e) => l.getRowId(e), [l]), { onRefresh: re } = v({
111
+ refetch: A,
112
+ variables: y,
113
+ defaults: T(() => ({
114
+ where: m ?? u.where,
115
+ sort: u.sort,
116
+ count: xe,
117
+ cursor: null
118
+ }), [
119
+ u.sort,
120
+ u.where,
121
+ m
122
+ ]),
123
+ fetchPolicy: be,
124
+ buildVariables: l.buildVariables
125
+ }), N = _({
126
+ hasNext: O,
127
+ isLoadingNext: k,
128
+ loadNext: w,
129
+ count: xe
130
+ });
131
+ return /* @__PURE__ */ J(ee, {
132
+ config: t,
133
+ state: f,
134
+ pushState: (e) => {
135
+ p(e);
136
+ },
137
+ header: { title: e },
138
+ rows: te,
139
+ columns: ne,
140
+ getRowId: M,
141
+ hasNextPage: O,
142
+ isLoadingMore: k,
143
+ onLoadMore: N,
144
+ onRefresh: re,
145
+ totalCount: j.totalCount ?? null,
146
+ variant: "embedded"
147
+ });
148
+ }, Ge = ({ title: e, targetId: n, whereKey: r, value: a, path: o }) => {
149
+ let { entities: s } = t(), c = i(T(() => [n], [n]));
150
+ if (c.status === "loading") return /* @__PURE__ */ J(M, { rows: 6 });
151
+ if (c.status === "error") return null;
152
+ let l = c.modules[n]?.config;
153
+ return l == null ? null : /* @__PURE__ */ J(We, {
154
+ title: e,
155
+ config: l,
156
+ entities: s,
157
+ whereKey: r,
158
+ value: a,
159
+ path: o
160
+ });
161
+ }, Ke = ({ title: e, target: t, whereKey: r, value: i, path: a }) => /* @__PURE__ */ J(n, {
162
+ fallback: () => /* @__PURE__ */ J(M, { rows: 6 }),
163
+ children: /* @__PURE__ */ J(x, {
164
+ fallback: /* @__PURE__ */ J(M, { rows: 6 }),
165
+ children: /* @__PURE__ */ J(Ge, {
166
+ title: e,
167
+ targetId: t,
168
+ whereKey: r,
169
+ value: i,
170
+ path: a
171
+ })
172
+ })
173
+ }), qe = "txvbqb9ip txvbqbcp txvbqbao7 txvbqbajy", Je = "txvbqb9ip txvbqbai7 txvbqbaog", Ye = "txvbqb9ip txvbqbcp txvbqbao7 txvbqbajy", Xe = "txvbqb9ip txvbqbai7 txvbqbao7";
174
+ //#endregion
175
+ //#region src/i18n/useBackofficeFormats.ts
176
+ function Ze() {
177
+ let { t: e } = r();
178
+ function t(t) {
179
+ return e("format.number", { value: t });
180
+ }
181
+ function n(t) {
182
+ return e("format.currency", { value: t });
183
+ }
184
+ function i(t) {
185
+ return e("format.percent", { value: t });
186
+ }
187
+ return {
188
+ formatNumber: t,
189
+ formatCurrency: n,
190
+ formatPercent: i
191
+ };
192
+ }
193
+ //#endregion
194
+ //#region src/pages/detail/buildTabsItems.ts
195
+ var Qe = (e) => e.pages.map((t) => ({
196
+ id: t.id,
197
+ label: t.label(e.tApp),
198
+ to: e.detailPageHref(e.id, t.id)
199
+ })), X = (e, t) => e(t), $e = (e) => typeof e == "object" && !!e && !Array.isArray(e), et = (e) => {
200
+ if (!$e(e)) return null;
201
+ for (let t of Object.values(e)) if ($e(t) && ("status" in t || "result" in t)) return t;
202
+ return null;
203
+ }, tt = (e) => e.kind === "route", nt = (e) => e.kind === "mutation", rt = (e) => e.kind === "formMutation", Z = (e, t) => typeof e == "function" ? e(t) : e ?? null, it = (e) => {
204
+ if (e == null) return null;
205
+ let t = e.trim();
206
+ return t === "" ? null : t;
207
+ }, Q = (e) => e == null ? !0 : typeof e == "string" ? e.trim() === "" : !1, $ = (e, t) => typeof e == "function" ? e(t) : e, at = (e, t, n) => {
208
+ switch (e) {
209
+ case "yesNo": return t ? {
210
+ tone: "success",
211
+ label: n("common.boolean.yes")
212
+ } : {
213
+ tone: "neutral",
214
+ label: n("common.boolean.no")
215
+ };
216
+ case "capability": return t ? {
217
+ tone: "success",
218
+ label: n("flags.capability.allowed"),
219
+ iconName: "shield-lock"
220
+ } : {
221
+ tone: "neutral",
222
+ label: n("flags.capability.denied"),
223
+ iconName: "shield-off"
224
+ };
225
+ case "enabled": return t ? {
226
+ tone: "success",
227
+ label: n("flags.enabled.enabled"),
228
+ iconName: "settings-check"
229
+ } : {
230
+ tone: "neutral",
231
+ label: n("flags.enabled.disabled"),
232
+ iconName: "settings-x"
233
+ };
234
+ case "failure": return t ? {
235
+ tone: "danger",
236
+ label: n("flags.failure.failed"),
237
+ iconName: "x-badge"
238
+ } : {
239
+ tone: "success",
240
+ label: n("flags.failure.ok"),
241
+ iconName: "chat-check"
242
+ };
243
+ case "encrypted": return t ? {
244
+ tone: "info",
245
+ label: n("flags.encrypted.encrypted"),
246
+ iconName: "key"
247
+ } : {
248
+ tone: "neutral",
249
+ label: n("flags.encrypted.notEncrypted"),
250
+ iconName: "key-off"
251
+ };
252
+ case "locked": return t ? {
253
+ tone: "warning",
254
+ label: n("flags.locked.locked"),
255
+ iconName: "lock"
256
+ } : {
257
+ tone: "success",
258
+ label: n("flags.locked.unlocked"),
259
+ iconName: "lock-open"
260
+ };
261
+ case "default": return t ? {
262
+ tone: "info",
263
+ label: n("flags.default.default")
264
+ } : {
265
+ tone: "neutral",
266
+ label: n("flags.default.notDefault")
267
+ };
268
+ case "agentManaged": return t ? {
269
+ tone: "info",
270
+ label: n("flags.agentManaged.agentManaged"),
271
+ iconName: "robot-check"
272
+ } : {
273
+ tone: "neutral",
274
+ label: n("flags.agentManaged.userManaged"),
275
+ iconName: "robot-x"
276
+ };
277
+ case "deployedProduction": return t ? {
278
+ tone: "success",
279
+ label: n("flags.deployedProduction.deployed"),
280
+ iconName: "rocket"
281
+ } : {
282
+ tone: "neutral",
283
+ label: n("flags.deployedProduction.notDeployed"),
284
+ iconName: "rocket-off"
285
+ };
286
+ case "forced": return t ? {
287
+ tone: "warning",
288
+ label: n("flags.forced.forced")
289
+ } : {
290
+ tone: "neutral",
291
+ label: n("flags.forced.normal")
292
+ };
293
+ default: throw Error(`Unsupported flag variant: ${String(e)}`);
294
+ }
295
+ }, ot = (e, t) => {
296
+ let { tApp: n, t: r, resolveEntityHref: i, renderLink: a } = t, o = r("common.notAvailable");
297
+ if (e.type === "text") {
298
+ let t = Z(e.value, n);
299
+ return Q(t) ? o : t;
300
+ }
301
+ if (e.type === "entityRef") {
302
+ let { id: t } = e;
303
+ if (t == null || t.trim() === "") return o;
304
+ let r = Z(e.label, n), s = r != null && String(r).trim() !== "" ? r : null;
305
+ if (s == null) return o;
306
+ let c = i?.(e.entity, t) ?? null;
307
+ return c == null ? s : a(c, s);
308
+ }
309
+ let { href: s } = e;
310
+ if (s == null || s.trim() === "") return o;
311
+ let c = Z(e.label, n);
312
+ return Q(c) ? o : a(s, c);
313
+ }, st = (e, t, n) => {
314
+ let { tApp: r, t: i, resolveEntityHref: a, renderDate: o, renderLink: s } = n, c = i("common.notAvailable");
315
+ if (e.type === "dateTime") return o(e.value(t), c);
316
+ if (e.type === "entityRef") {
317
+ let n = e.id(t);
318
+ if (n == null || n.trim() === "") return c;
319
+ let i = Z(e.value?.(t), r), o = i != null && String(i).trim() !== "" ? i : null;
320
+ if (o == null) return c;
321
+ let l = a?.(e.entity, n) ?? null;
322
+ return l == null ? o : s(l, o);
323
+ }
324
+ if (e.type === "link") {
325
+ let n = e.href(t), i = Z(e.value(t), r);
326
+ return n == null || n.trim() === "" || Q(i) ? c : s(n, i);
327
+ }
328
+ let l = Z(e.value(t), r);
329
+ return Q(l) ? c : l;
330
+ }, ct = (e, t, n, r) => {
331
+ if (e.type === "badgeRow") {
332
+ let i = e.items(t).map((e) => {
333
+ let t = Z(e.label, n), r = t == null ? "" : String(t);
334
+ return {
335
+ ...e,
336
+ label: r
337
+ };
338
+ });
339
+ return i.length === 0 ? void 0 : r.renderBadgeRow(i);
340
+ }
341
+ let i = Z(e.value(t), n), a = i == null ? "" : String(i);
342
+ if (a.trim() === "") return;
343
+ let o = $(e.tone, t);
344
+ return r.renderTag(o, a);
345
+ }, lt = (e, t, n) => {
346
+ let { tApp: r, t: i, resolveEntityHref: a, formatNumber: o, formatCurrency: s, formatPercent: c, relationEntityListRoutes: l, resolveRelationItem: u, setWhereValue: d, renderTag: f, renderBadgeRow: p, renderDate: m, renderFlagTag: h, renderLink: g, renderTaggedValue: _, wrapCustomNode: ee } = n, v = [], y = [], b = [], x = i("common.notAvailable");
347
+ return e.forEach((e, n) => {
348
+ let S = `${e.type}-${n}`;
349
+ switch (e.type) {
350
+ case "text": {
351
+ let n = Z(e.value(t), r);
352
+ v.push({
353
+ id: S,
354
+ label: X(e.label, r),
355
+ size: e.size,
356
+ value: n,
357
+ copyValue: e.copyValue?.(t) ?? void 0,
358
+ fullWidth: e.fullWidth
359
+ });
360
+ break;
361
+ }
362
+ case "badge": {
363
+ let n = Z(e.value(t), r), i = n == null ? "" : String(n), a = $(e.tone, t);
364
+ v.push({
365
+ id: S,
366
+ label: X(e.label, r),
367
+ size: e.size,
368
+ value: i.trim() === "" ? null : f(a, i)
369
+ });
370
+ break;
371
+ }
372
+ case "badgeRow": {
373
+ let n = e.items(t).map((e) => {
374
+ let t = Z(e.label, r), n = t == null ? "" : String(t);
375
+ return {
376
+ ...e,
377
+ label: n
378
+ };
379
+ });
380
+ v.push({
381
+ id: S,
382
+ label: X(e.label, r),
383
+ size: e.size,
384
+ value: n.length > 0 ? p(n) : null,
385
+ fullWidth: e.fullWidth
386
+ });
387
+ break;
388
+ }
389
+ case "dateTime":
390
+ v.push({
391
+ id: S,
392
+ label: X(e.label, r),
393
+ size: e.size,
394
+ value: m(e.value(t), x)
395
+ });
396
+ break;
397
+ case "number": {
398
+ let n = e.value(t), i = null;
399
+ n != null && (i = e.format === "currency" ? s(n) : e.format === "percent" ? c(n) : o(n)), v.push({
400
+ id: S,
401
+ label: X(e.label, r),
402
+ size: e.size,
403
+ value: i
404
+ });
405
+ break;
406
+ }
407
+ case "flag": {
408
+ let n = e.value(t);
409
+ v.push({
410
+ id: S,
411
+ label: X(e.label, r),
412
+ size: e.size,
413
+ value: n == null ? null : h(at(e.variant, n, i))
414
+ });
415
+ break;
416
+ }
417
+ case "entityRef": {
418
+ let n = e.id(t), i = null;
419
+ if (n != null && n.trim() !== "") {
420
+ let r = e.value?.(t), o = r != null && r.trim() !== "" ? r : null, s = a?.(e.entity, n) ?? null;
421
+ o != null && (i = s == null ? o : g(s, o));
422
+ }
423
+ v.push({
424
+ id: S,
425
+ label: X(e.label, r),
426
+ size: e.size,
427
+ value: i ?? x
428
+ });
429
+ break;
430
+ }
431
+ case "link": {
432
+ let n = e.href(t), i = e.value(t);
433
+ v.push({
434
+ id: S,
435
+ label: X(e.label, r),
436
+ size: e.size,
437
+ value: n != null && n.trim() !== "" && !Q(i) ? g(n, i) : null
438
+ });
439
+ break;
440
+ }
441
+ case "taggedValue": {
442
+ let n = e.tag(t), o = ot(e.value(t), {
443
+ tApp: r,
444
+ t: i,
445
+ resolveEntityHref: a,
446
+ renderLink: g
447
+ }), s = n == null ? null : {
448
+ ...n,
449
+ label: (() => {
450
+ let e = Z(n.label, r);
451
+ return e == null ? "" : String(e);
452
+ })()
453
+ };
454
+ v.push({
455
+ id: S,
456
+ label: X(e.label, r),
457
+ size: e.size,
458
+ value: s != null || o != null ? _(s, o) : null,
459
+ fullWidth: e.fullWidth
460
+ });
461
+ break;
462
+ }
463
+ case "relation": {
464
+ let n = it(e.value(t));
465
+ if (n == null) break;
466
+ let i = l[e.entity];
467
+ if (i == null) break;
468
+ let a = d(null, e.whereKey, n, e.path);
469
+ if (a == null) break;
470
+ y.push(u({
471
+ id: S,
472
+ label: X(e.label, r),
473
+ count: e.count?.(t) ?? null,
474
+ entityId: e.entity,
475
+ filterId: e.filterId,
476
+ listRoute: i,
477
+ path: e.path,
478
+ value: n,
479
+ where: a,
480
+ whereKey: e.whereKey
481
+ }));
482
+ break;
483
+ }
484
+ case "custom": {
485
+ let n = e.render(t);
486
+ if (n == null) break;
487
+ if (e.label != null) {
488
+ v.push({
489
+ id: S,
490
+ label: X(e.label, r),
491
+ size: e.size,
492
+ value: n,
493
+ fullWidth: e.fullWidth
494
+ });
495
+ break;
496
+ }
497
+ b.push(ee(S, n));
498
+ break;
499
+ }
500
+ default: break;
501
+ }
502
+ }), {
503
+ items: v,
504
+ relationItems: y,
505
+ customNodes: b
506
+ };
507
+ }, ut = (e, t, n) => {
508
+ let { tApp: r, t: i, resolveEntityHref: a, renderLink: o, renderDate: s, renderTag: c, renderBadgeRow: l } = n, u = e.titleValue?.(t, r) ?? X(e.title, r), d = u.trim() === "" ? X(e.title, r) : u, f;
509
+ if (e.subtitleItems != null && e.subtitleItems.length > 0) {
510
+ let { subtitleItems: n } = e, s = e.subtitleSeparator ?? " / ", c = [];
511
+ n.forEach((e, l) => {
512
+ c.push(S("span", { key: e.id }, ot(e.value(t), {
513
+ tApp: r,
514
+ t: i,
515
+ resolveEntityHref: a,
516
+ renderLink: o
517
+ }))), l < n.length - 1 && c.push(S("span", { key: `${e.id}-sep` }, s));
518
+ }), f = S("span", null, ...c);
519
+ } else {
520
+ let n = e.subtitleValue?.(t, r) ?? (e.subtitle == null ? null : X(e.subtitle, r));
521
+ f = n != null && n.trim() !== "" ? n : void 0;
522
+ }
523
+ let p = [];
524
+ e.badges?.forEach((e, n) => {
525
+ let i = X(e.label, r), a = Z(e.value(t), r), o = a == null ? "" : String(a);
526
+ o.trim() !== "" && (p.push(c($(e.tone, t), `${i}: ${o}`)), typeof p[p.length - 1] == "object" && (p[p.length - 1] = S(b, { key: `${i}-${n}` }, p[p.length - 1])));
527
+ });
528
+ let m = e.status == null ? void 0 : ct(e.status, t, r, {
529
+ renderBadgeRow: l,
530
+ renderTag: c
531
+ }), h = e.meta?.map((e, n) => {
532
+ let c = X(e.label, r);
533
+ return {
534
+ id: `${c}-${n}`,
535
+ label: c,
536
+ value: st(e, t, {
537
+ tApp: r,
538
+ t: i,
539
+ resolveEntityHref: a,
540
+ renderDate: s,
541
+ renderLink: o
542
+ })
543
+ };
544
+ });
545
+ return {
546
+ title: d,
547
+ subtitle: f,
548
+ badges: p.length > 0 ? S(b, null, ...p) : void 0,
549
+ status: m,
550
+ items: h
551
+ };
552
+ }, dt = (e, t, n) => {
553
+ let { tApp: r, t: i, keyPrefix: a } = n;
554
+ return e == null || e.length === 0 ? [] : e.map((e, o) => {
555
+ let s = a == null ? `${e.kind}-${o}` : `${a}-${e.kind}-${o}`;
556
+ if (e.kind === "custom") {
557
+ let i = e.render(t);
558
+ return i == null ? null : e.label == null ? n.wrapCustomNode(s, i) : n.renderCustomSection(s, X(e.label, r), i);
559
+ }
560
+ let c = X(e.label, r), l = e.description == null ? void 0 : X(e.description, r);
561
+ if (e.kind === "relationList") return n.renderRelationList({
562
+ key: s,
563
+ title: c,
564
+ target: e.target,
565
+ whereKey: e.whereKey,
566
+ value: e.value(t),
567
+ path: e.path
568
+ });
569
+ if (e.kind === "table") return n.renderTable({
570
+ key: s,
571
+ title: c,
572
+ description: l,
573
+ columns: n.resolveTableColumns(e.columns),
574
+ rows: e.rows(t)
575
+ });
576
+ if (e.kind === "json") return n.renderJson({
577
+ key: s,
578
+ title: c,
579
+ description: l,
580
+ value: e.value(t)
581
+ });
582
+ if (e.kind === "code") return n.renderCode({
583
+ key: s,
584
+ title: c,
585
+ description: l,
586
+ value: e.value(t),
587
+ outputLabel: i("tools.output")
588
+ });
589
+ if (e.kind === "payload") return n.renderPayload({
590
+ key: s,
591
+ title: c,
592
+ description: l,
593
+ content: e.value(t),
594
+ format: e.format
595
+ });
596
+ if (e.kind === "errorList") return n.renderErrorList({
597
+ key: s,
598
+ title: c,
599
+ description: l,
600
+ items: e.errors(t)
601
+ });
602
+ let u = e.items.map((e, n) => {
603
+ let a = X(e.label, r), o = Z(e.value(t), r);
604
+ return {
605
+ id: `${a}-${n}`,
606
+ label: a,
607
+ value: o ?? i("common.notAvailable")
608
+ };
609
+ });
610
+ return n.renderKeyValueListSection({
611
+ key: s,
612
+ title: c,
613
+ description: l,
614
+ items: u
615
+ });
616
+ });
617
+ }, ft = (e) => {
618
+ switch (e) {
619
+ case "shield-lock": return /* @__PURE__ */ J(U, {
620
+ width: 14,
621
+ height: 14,
622
+ "aria-hidden": "true"
623
+ });
624
+ case "shield-off": return /* @__PURE__ */ J(W, {
625
+ width: 14,
626
+ height: 14,
627
+ "aria-hidden": "true"
628
+ });
629
+ case "settings-check": return /* @__PURE__ */ J(V, {
630
+ width: 14,
631
+ height: 14,
632
+ "aria-hidden": "true"
633
+ });
634
+ case "settings-x": return /* @__PURE__ */ J(H, {
635
+ width: 14,
636
+ height: 14,
637
+ "aria-hidden": "true"
638
+ });
639
+ case "x-badge": return /* @__PURE__ */ J(pe, {
640
+ width: 14,
641
+ height: 14,
642
+ "aria-hidden": "true"
643
+ });
644
+ case "chat-check": return /* @__PURE__ */ J(ie, {
645
+ width: 14,
646
+ height: 14,
647
+ "aria-hidden": "true"
648
+ });
649
+ case "key": return /* @__PURE__ */ J(le, {
650
+ width: 14,
651
+ height: 14,
652
+ "aria-hidden": "true"
653
+ });
654
+ case "key-off": return /* @__PURE__ */ J(P, {
655
+ width: 14,
656
+ height: 14,
657
+ "aria-hidden": "true"
658
+ });
659
+ case "lock": return /* @__PURE__ */ J(I, {
660
+ width: 14,
661
+ height: 14,
662
+ "aria-hidden": "true"
663
+ });
664
+ case "lock-open": return /* @__PURE__ */ J(fe, {
665
+ width: 14,
666
+ height: 14,
667
+ "aria-hidden": "true"
668
+ });
669
+ case "robot-check": return /* @__PURE__ */ J(L, {
670
+ width: 14,
671
+ height: 14,
672
+ "aria-hidden": "true"
673
+ });
674
+ case "robot-x": return /* @__PURE__ */ J(R, {
675
+ width: 14,
676
+ height: 14,
677
+ "aria-hidden": "true"
678
+ });
679
+ case "rocket": return /* @__PURE__ */ J(B, {
680
+ width: 14,
681
+ height: 14,
682
+ "aria-hidden": "true"
683
+ });
684
+ case "rocket-off": return /* @__PURE__ */ J(z, {
685
+ width: 14,
686
+ height: 14,
687
+ "aria-hidden": "true"
688
+ });
689
+ default: throw Error(`Unsupported flag icon: ${String(e)}`);
690
+ }
691
+ }, pt = ({ config: n, prepared: i }) => {
692
+ let { t: o } = D(), { t: _ } = r(), { formatNumber: ee, formatCurrency: v, formatPercent: b } = Ze(), { entities: x, entityRegistry: S } = t(), { layoutView: C } = g(), M = w(A), ie = e(), P = he(), [le, F] = E({}), [fe, I] = E(null), L = u({
693
+ mainPage: n.pages.mainPage,
694
+ subPages: n.pages.subPages,
695
+ activePagePath: i.pagePath,
696
+ node: C
697
+ }), R = L.activePage ?? n.pages.mainPage, z = L.pages.length > 0 ? L.pages : [n.pages.mainPage], B = (e, t) => {
698
+ F((n) => n[e] === t ? n : {
699
+ ...n,
700
+ [e]: t
701
+ });
702
+ }, { page: V } = n, H = ve(V.query, i.pageQuery), U = V.resolveNode(H, {
703
+ id: i.id,
704
+ detailId: i.detailId
705
+ });
706
+ if (U == null) throw new O(n.routes.list);
707
+ let W = K(V.fragment, U), pe = T(() => Object.fromEntries(V.content.flatMap((e) => e.kind === "section" ? e.fields.flatMap((e) => e.type === "relation" ? [e.entity] : []) : []).flatMap((e) => {
708
+ let t = x[e];
709
+ return t?.hasList === !0 ? [[e, t.routes.list]] : [];
710
+ })), [x, V.content]);
711
+ return /* @__PURE__ */ J(Ee, {
712
+ node: W,
713
+ render: (e) => {
714
+ let t = V.toView(e), r = Qe({
715
+ pages: z,
716
+ id: i.id,
717
+ tApp: o,
718
+ detailPageHref: n.routes.detailPage
719
+ }), u = (e, t) => {
720
+ let n = x[e];
721
+ return n == null ? null : n.routes.detail(t);
722
+ }, g = ({ id: e, label: t, count: n, entityId: r, filterId: i, listRoute: a, path: o, value: s, where: c, whereKey: l }) => {
723
+ let u = S.getLoadedListEntity(r);
724
+ return {
725
+ id: e,
726
+ label: t,
727
+ count: n,
728
+ href: u == null ? Se(a, c, [{
729
+ id: i ?? (o == null ? l : `${l}.${o.join(".")}`),
730
+ value: s
731
+ }]) : Ce(u.config, { where: c }),
732
+ onClick: async (e) => {
733
+ if (M == null || e.defaultPrevented || e.button !== 0 || e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
734
+ e.preventDefault();
735
+ let t = we((await S.loadListEntity(r)).config, { where: c });
736
+ M.history.push({
737
+ pathname: t.pathname,
738
+ search: t.search === "" ? "" : `?${t.search}`,
739
+ hash: ""
740
+ });
741
+ }
742
+ };
743
+ }, w = ut(n.header, C, {
744
+ tApp: o,
745
+ t: _,
746
+ resolveEntityHref: u,
747
+ renderLink: (e, t) => /* @__PURE__ */ J(k, {
748
+ to: e,
749
+ children: t
750
+ }),
751
+ renderDate: (e, t) => /* @__PURE__ */ J(se, {
752
+ value: e,
753
+ options: ye,
754
+ fallback: t
755
+ }),
756
+ renderTag: (e, t) => /* @__PURE__ */ J(G, {
757
+ tone: e,
758
+ children: t
759
+ }),
760
+ renderBadgeRow: (e) => /* @__PURE__ */ J(a, { items: e })
761
+ }), T = h({
762
+ config: n,
763
+ tApp: o,
764
+ entityId: i.id,
765
+ layoutView: C,
766
+ pageLabel: R.label(o)
767
+ }), E = V.actions ?? [], D = [];
768
+ if (E.length > 0) {
769
+ let e = E.filter((e) => e.isVisible == null ? !0 : e.isVisible(t));
770
+ e.length > 0 && (D = e.map((e) => {
771
+ let n = X(e.label, o), r = e.ariaLabel == null ? n : X(e.ariaLabel, o), i = e.variant ?? "secondary", a = e.size ?? "small", s = le[e.id] ?? !1, c = s || e.isDisabled?.(t) === !0;
772
+ return tt(e) ? /* @__PURE__ */ J(de, {
773
+ to: e.to(t),
774
+ variant: i,
775
+ size: a,
776
+ isDisabled: c,
777
+ "aria-label": r,
778
+ children: n
779
+ }, e.id) : rt(e) ? /* @__PURE__ */ J(N, {
780
+ type: "button",
781
+ variant: i,
782
+ size: a,
783
+ isLoading: !1,
784
+ disabled: c,
785
+ onClick: () => {
786
+ I(e.id);
787
+ },
788
+ "aria-label": r,
789
+ children: n
790
+ }, e.id) : nt(e) ? /* @__PURE__ */ J(N, {
791
+ type: "button",
792
+ variant: i,
793
+ size: a,
794
+ isLoading: s,
795
+ disabled: c,
796
+ onClick: () => {
797
+ if (s) return;
798
+ let n = e.getVariables(t);
799
+ B(e.id, !0), _e(ie, {
800
+ mutation: e.mutation,
801
+ variables: n,
802
+ updater: (n) => {
803
+ e.updater?.(n, t);
804
+ },
805
+ onCompleted: (n) => {
806
+ B(e.id, !1);
807
+ let r = et(n);
808
+ if (r != null) {
809
+ let n = _("actions.form.errors.invalidPayload");
810
+ e.toasts?.error?.message == null ? e.toasts?.error?.title != null && (n = X(e.toasts.error.title, o)) : n = X(e.toasts.error.message, o);
811
+ let i = l(r, {
812
+ defaultErrorMessage: n,
813
+ mapReason: (n) => {
814
+ let r = e.mapErrorReason?.(n, t);
815
+ return r == null ? null : typeof r == "function" ? X(r, o) : String(r);
816
+ }
817
+ });
818
+ if (!i.ok) {
819
+ let n = Error(i.message);
820
+ if (e.onError?.(n, t), e.toasts?.error != null) {
821
+ let t = m(e.toasts.error, o);
822
+ P.error(t.title, t.message);
823
+ }
824
+ return;
825
+ }
826
+ }
827
+ if (e.onCompleted?.(n, t), e.toasts?.success != null) {
828
+ let r = m(e.toasts.success, o), i = p({
829
+ toast: e.toasts.success,
830
+ response: n,
831
+ node: t,
832
+ tApp: o,
833
+ entities: x,
834
+ defaultLabel: _("actions.view"),
835
+ navigateTo: (e) => {
836
+ M?.history.push({ pathname: e });
837
+ }
838
+ });
839
+ P.push({
840
+ kind: "info",
841
+ title: r.title,
842
+ message: r.message,
843
+ actions: i
844
+ });
845
+ }
846
+ },
847
+ onError: (n) => {
848
+ if (B(e.id, !1), e.onError?.(n, t), e.toasts?.error != null) {
849
+ let t = m(e.toasts.error, o);
850
+ P.error(t.title, t.message);
851
+ }
852
+ }
853
+ });
854
+ },
855
+ "aria-label": r,
856
+ children: n
857
+ }, e.id) : null;
858
+ }));
859
+ }
860
+ let O = E.find((e) => e.id === fe), { content: A } = V, F = [], L = [], H = [];
861
+ A.forEach((e, n) => {
862
+ let r = (e.placement ?? "primary") === "secondary" ? L : F;
863
+ if (e.kind === "section") {
864
+ let i = X(e.title, o), c = e.description == null ? void 0 : X(e.description, o), { items: l, relationItems: d, customNodes: f } = lt(e.fields, t, {
865
+ tApp: o,
866
+ t: _,
867
+ resolveEntityHref: u,
868
+ formatNumber: ee,
869
+ formatCurrency: v,
870
+ formatPercent: b,
871
+ relationEntityListRoutes: pe,
872
+ resolveRelationItem: g,
873
+ setWhereValue: Te,
874
+ renderTag: (e, t) => /* @__PURE__ */ J(G, {
875
+ tone: e,
876
+ children: t
877
+ }),
878
+ renderBadgeRow: (e) => /* @__PURE__ */ J(a, { items: e }),
879
+ renderDate: (e, t) => /* @__PURE__ */ J(se, {
880
+ value: e,
881
+ options: ye,
882
+ fallback: t
883
+ }),
884
+ renderFlagTag: (e) => /* @__PURE__ */ J(Ae, {
885
+ tone: e.tone,
886
+ icon: e.iconName == null ? void 0 : ft(e.iconName),
887
+ label: e.label
888
+ }),
889
+ renderLink: (e, t) => /* @__PURE__ */ J(k, {
890
+ to: e,
891
+ children: t
892
+ }),
893
+ renderTaggedValue: (e, t) => /* @__PURE__ */ J(Ne, {
894
+ tag: e,
895
+ value: t
896
+ }),
897
+ wrapCustomNode: (e, t) => /* @__PURE__ */ J("div", { children: t }, e)
898
+ });
899
+ if (d.forEach((e) => {
900
+ H.some((t) => t.id === e.id) || H.push(e);
901
+ }), !(l.length > 0 || f.length > 0)) return;
902
+ r.push(/* @__PURE__ */ J(s, {
903
+ title: i,
904
+ description: c,
905
+ items: l.length > 0 ? l : void 0,
906
+ children: f
907
+ }, `${i}-${n}`));
908
+ return;
909
+ }
910
+ let i = dt([e], t, {
911
+ tApp: o,
912
+ t: _,
913
+ resolveEntityHref: u,
914
+ keyPrefix: String(n),
915
+ renderCustomSection: (e, t, n) => /* @__PURE__ */ J(s, {
916
+ title: t,
917
+ children: n
918
+ }, e),
919
+ wrapCustomNode: (e, t) => /* @__PURE__ */ J("div", { children: t }, e),
920
+ renderRelationList: ({ key: e, title: t, target: n, whereKey: r, value: i, path: a }) => /* @__PURE__ */ J(Ke, {
921
+ title: t,
922
+ target: n,
923
+ whereKey: r,
924
+ value: i ?? null,
925
+ path: a
926
+ }, e),
927
+ resolveTableColumns: (e) => d(e, {
928
+ tApp: o,
929
+ t: _,
930
+ resolveEntityHref: u
931
+ }),
932
+ renderTable: ({ key: e, title: t, description: n, columns: r, rows: i }) => /* @__PURE__ */ J(s, {
933
+ title: t,
934
+ description: n,
935
+ children: /* @__PURE__ */ J(ae, {
936
+ columns: r,
937
+ rows: i,
938
+ getRowId: (e, t) => {
939
+ if (typeof e == "object" && e) {
940
+ let t = e.id;
941
+ if (typeof t == "string" && t.trim() !== "") return t;
942
+ }
943
+ return String(t);
944
+ }
945
+ })
946
+ }, e),
947
+ renderJson: ({ key: e, title: t, description: n, value: r }) => /* @__PURE__ */ J(s, {
948
+ title: t,
949
+ description: n,
950
+ children: /* @__PURE__ */ J(ue, {
951
+ value: r,
952
+ title: t
953
+ })
954
+ }, e),
955
+ renderCode: ({ key: e, title: t, description: n, value: r, outputLabel: i }) => /* @__PURE__ */ J(s, {
956
+ title: t,
957
+ description: n,
958
+ children: /* @__PURE__ */ J(ce, {
959
+ badgeLabel: i,
960
+ copyCode: r,
961
+ fallbackCodeText: r
962
+ })
963
+ }, e),
964
+ renderPayload: ({ key: e, title: t, description: n, content: r, format: i }) => /* @__PURE__ */ J(c, {
965
+ title: t,
966
+ description: n,
967
+ content: r,
968
+ format: i
969
+ }, e),
970
+ renderErrorList: ({ key: e, title: t, description: n, items: r }) => /* @__PURE__ */ J(Ve, {
971
+ title: t,
972
+ description: n,
973
+ items: r
974
+ }, e),
975
+ renderKeyValueListSection: ({ key: e, title: t, description: n, items: r }) => /* @__PURE__ */ J(s, {
976
+ title: t,
977
+ description: n,
978
+ children: /* @__PURE__ */ J(j, { items: r })
979
+ }, e)
980
+ })[0];
981
+ i != null && r.push(i);
982
+ });
983
+ let U = H.length > 0 ? /* @__PURE__ */ J(ne, {
984
+ label: _("relations.menu.label"),
985
+ items: H
986
+ }) : null, W = D.length > 0 || U != null ? /* @__PURE__ */ Y("div", {
987
+ className: qe,
988
+ children: [D, U]
989
+ }) : void 0, me = w.status != null || w.badges != null ? /* @__PURE__ */ Y("div", {
990
+ className: Ye,
991
+ children: [w.status, w.badges]
992
+ }) : void 0, he = w.items != null && w.items.length > 0 ? /* @__PURE__ */ J("div", {
993
+ className: Xe,
994
+ children: /* @__PURE__ */ J(j, { items: w.items })
995
+ }) : null, ge = L.length > 0, K = null;
996
+ return z.length > 1 && (K = /* @__PURE__ */ J(re, {
997
+ items: r,
998
+ activeId: R.id,
999
+ onChange: () => {}
1000
+ })), /* @__PURE__ */ Y(f, {
1001
+ breadcrumb: T,
1002
+ children: [/* @__PURE__ */ J(oe, {
1003
+ headerNode: /* @__PURE__ */ Y("div", {
1004
+ className: Je,
1005
+ children: [/* @__PURE__ */ J(te, {
1006
+ title: w.title,
1007
+ subtitle: w.subtitle,
1008
+ actions: W,
1009
+ meta: me
1010
+ }), he]
1011
+ }),
1012
+ tabsNode: K,
1013
+ sidePanel: ge ? /* @__PURE__ */ J(q, { children: L }) : void 0,
1014
+ sidePanelVariant: "plain",
1015
+ children: /* @__PURE__ */ J(q, { children: F })
1016
+ }), O != null && rt(O) && /* @__PURE__ */ J(y, {
1017
+ isOpen: !0,
1018
+ action: O,
1019
+ node: t,
1020
+ onClose: () => {
1021
+ I(null);
1022
+ }
1023
+ })]
1024
+ });
1025
+ }
1026
+ });
1027
+ }, mt = ({ config: e, prepared: t }) => {
1028
+ let { layoutView: n } = g(), r = u({
1029
+ mainPage: e.pages.mainPage,
1030
+ subPages: e.pages.subPages,
1031
+ activePagePath: t.pagePath,
1032
+ node: n
1033
+ });
1034
+ if (!r.hasVisiblePages || r.activePage == null) throw new O(e.routes.list);
1035
+ if (r.activePage.id !== t.pageId) throw new O(e.routes.detailPage(t.id, r.activePage.id));
1036
+ return /* @__PURE__ */ J(pt, {
1037
+ config: t.pageConfig,
1038
+ prepared: t
1039
+ });
1040
+ };
1041
+ //#endregion
1042
+ export { mt as BackofficeEntityDetailPage, mt as default };
1043
+
1044
+ //# sourceMappingURL=BackofficeEntityDetailPage-CIyGKwVP.js.map