@plumile/backoffice-react 0.2.6 → 0.2.8

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 (30) hide show
  1. package/README.md +23 -0
  2. package/lib/esm/auth/backofficeAuthHeaders.js +2 -9
  3. package/lib/esm/auth/backofficeAuthHeaders.js.map +1 -1
  4. package/lib/esm/hooks/useAuthenticatedRouter.js +79 -0
  5. package/lib/esm/hooks/useAuthenticatedRouter.js.map +1 -0
  6. package/lib/esm/index.js +26 -24
  7. package/lib/esm/provider/BackofficeProvider.js +141 -140
  8. package/lib/esm/provider/BackofficeProvider.js.map +1 -1
  9. package/lib/esm/provider/BackofficeRouterBoundary.js +22 -0
  10. package/lib/esm/provider/BackofficeRouterBoundary.js.map +1 -0
  11. package/lib/esm/router/createBackofficeRoutes.js +188 -184
  12. package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
  13. package/lib/types/auth/backofficeAuthHeaders.d.ts +1 -1
  14. package/lib/types/auth/backofficeAuthHeaders.d.ts.map +1 -1
  15. package/lib/types/hooks/useAuthenticatedRouter.d.ts +18 -0
  16. package/lib/types/hooks/useAuthenticatedRouter.d.ts.map +1 -0
  17. package/lib/types/index.d.ts +2 -0
  18. package/lib/types/index.d.ts.map +1 -1
  19. package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
  20. package/lib/types/provider/BackofficeRouterBoundary.d.ts +9 -0
  21. package/lib/types/provider/BackofficeRouterBoundary.d.ts.map +1 -0
  22. package/lib/types/provider/types.d.ts +2 -1
  23. package/lib/types/provider/types.d.ts.map +1 -1
  24. package/lib/types/router/createBackofficeRoutes.d.ts +3 -2
  25. package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
  26. package/package.json +11 -11
  27. package/lib/esm/provider/useBackofficeAuthRouteGate.js +0 -39
  28. package/lib/esm/provider/useBackofficeAuthRouteGate.js.map +0 -1
  29. package/lib/types/provider/useBackofficeAuthRouteGate.d.ts +0 -2
  30. package/lib/types/provider/useBackofficeAuthRouteGate.d.ts.map +0 -1
@@ -1,47 +1,46 @@
1
1
  import { buildEntityGroupLookup as e, resolveSidebarGroups as t, resolveSidebarHubEntries as n } from "../components/backoffice/layout/sidebarUtils.js";
2
2
  import { validateBackofficeDashboardRegistrations as r } from "../provider/dashboardRegistrations.js";
3
- import { BackofficeEntityDetailManifestFallback as i } from "../pages/detail/BackofficeEntityDetailManifestFallback.js";
4
- import { useContext as a, useEffect as o } from "react";
5
- import { jsx as s } from "react/jsx-runtime";
6
- import * as c from "react-relay";
7
- import l from "@plumile/router/routing/RoutingContext.js";
8
- import { BACKOFFICE_LIST_DEFAULTS as ee } from "@plumile/backoffice-core/constants.js";
9
- import { getResourcePage as u } from "@plumile/router/ResourcePage.js";
3
+ import { BackofficeRouteFallback as i } from "../components/backoffice/routing/BackofficeRouteFallback.js";
4
+ import { BackofficeEntityDetailManifestFallback as a } from "../pages/detail/BackofficeEntityDetailManifestFallback.js";
5
+ import { jsx as o } from "react/jsx-runtime";
6
+ import * as s from "react-relay";
7
+ import { BACKOFFICE_LIST_DEFAULTS as c } from "@plumile/backoffice-core/constants.js";
8
+ import { getResourcePage as l } from "@plumile/router/ResourcePage.js";
9
+ import u from "@plumile/router/routing/RouteRedirect.js";
10
10
  import { r as d } from "@plumile/router/tools.js";
11
11
  //#region src/router/createBackofficeRoutes.tsx
12
- var { loadQuery: f, usePreloadedQuery: p } = c, m = u("BackofficeLayoutPage", async () => import("../pages/BackofficeLayoutPage.js")), h = u("BackofficeEntityListPage", async () => import("../pages/BackofficeEntityListPage.js")), g = u("BackofficeEntityListShellPage", async () => import("../pages/BackofficeEntityListShellPage.js")), _ = u("BackofficeEntityListDataPage", async () => import("../pages/BackofficeEntityListDataPage.js")), v = u("BackofficeEntityDetailPage", async () => import("../pages/BackofficeEntityDetailPage.js")), y = u("BackofficeEntityDetailFramePage", async () => import("../pages/BackofficeEntityDetailFramePage.js")), b = u("BackofficeEntityDetailLayoutPage", async () => import("../pages/BackofficeEntityDetailLayoutPage.js")), x = u("BackofficeEntityDetailPageConfigPage", async () => import("../pages/BackofficeEntityDetailPageConfigPage.js")), S = u("BackofficeEntityDetailShellPage", async () => import("../pages/BackofficeEntityDetailShellPage.js")), C = u("BackofficeEntityDetailUnknownPageRedirect", async () => import("../pages/BackofficeEntityDetailUnknownPageRedirect.js")), w = u("BackofficeDashboardPage", async () => import("../pages/BackofficeDashboardPage.js")), T = u("BackofficeDashboardShellPage", async () => import("../pages/BackofficeDashboardShellPage.js")), E = u("BackofficeToolShellPage", async () => import("../pages/BackofficeToolShellPage.js")), D = u("BackofficeHubPage", async () => import("../pages/BackofficeHubPage.js")), O = u("BackofficeLoginPage", async () => import("../pages/BackofficeLoginPage.js")), te = u("BackofficePasswordResetRequestPage", async () => import("../pages/BackofficePasswordResetRequestPage.js")), ne = u("BackofficePasswordResetCompletePage", async () => import("../pages/BackofficePasswordResetCompletePage.js")), re = u("BackofficeVerifyEmailPage", async () => import("../pages/BackofficeVerifyEmailPage.js")), k = u("BackofficeAcceptInvitationPage", async () => import("../pages/BackofficeAcceptInvitationPage.js")), A = ({ pathname: e }) => {
13
- let t = a(l);
14
- return o(() => {
15
- t?.history.set({ pathname: e });
16
- }, [e, t]), null;
17
- }, ie = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: r, activeGroupId: i }) => /* @__PURE__ */ s(t, {
12
+ var { loadQuery: f, usePreloadedQuery: p } = s, m = l("BackofficeLayoutPage", async () => import("../pages/BackofficeLayoutPage.js")), h = l("BackofficeEntityListPage", async () => import("../pages/BackofficeEntityListPage.js")), g = l("BackofficeEntityListShellPage", async () => import("../pages/BackofficeEntityListShellPage.js")), _ = l("BackofficeEntityListDataPage", async () => import("../pages/BackofficeEntityListDataPage.js")), v = l("BackofficeEntityDetailPage", async () => import("../pages/BackofficeEntityDetailPage.js")), y = l("BackofficeEntityDetailFramePage", async () => import("../pages/BackofficeEntityDetailFramePage.js")), b = l("BackofficeEntityDetailLayoutPage", async () => import("../pages/BackofficeEntityDetailLayoutPage.js")), x = l("BackofficeEntityDetailPageConfigPage", async () => import("../pages/BackofficeEntityDetailPageConfigPage.js")), S = l("BackofficeEntityDetailShellPage", async () => import("../pages/BackofficeEntityDetailShellPage.js")), ee = l("BackofficeEntityDetailUnknownPageRedirect", async () => import("../pages/BackofficeEntityDetailUnknownPageRedirect.js")), C = l("BackofficeDashboardPage", async () => import("../pages/BackofficeDashboardPage.js")), w = l("BackofficeDashboardShellPage", async () => import("../pages/BackofficeDashboardShellPage.js")), T = l("BackofficeToolShellPage", async () => import("../pages/BackofficeToolShellPage.js")), E = l("BackofficeHubPage", async () => import("../pages/BackofficeHubPage.js")), D = l("BackofficeLoginPage", async () => import("../pages/BackofficeLoginPage.js")), O = l("BackofficePasswordResetRequestPage", async () => import("../pages/BackofficePasswordResetRequestPage.js")), k = l("BackofficePasswordResetCompletePage", async () => import("../pages/BackofficePasswordResetCompletePage.js")), A = l("BackofficeVerifyEmailPage", async () => import("../pages/BackofficeVerifyEmailPage.js")), j = l("BackofficeAcceptInvitationPage", async () => import("../pages/BackofficeAcceptInvitationPage.js")), te = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: r, activeGroupId: i }) => /* @__PURE__ */ o(t, {
18
13
  permissionsQuery: r,
19
14
  prepared: n?.permissionsQuery ?? null,
20
15
  authStatus: null,
21
16
  activeGroupId: i,
22
17
  children: e
23
- }), j = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: r, activeGroupId: i, authStatusQuery: a, authStatusPrepared: o, loginRedirectPath: c }) => {
24
- let l = p(a, o);
25
- return l?.isLoggedIn === !0 ? /* @__PURE__ */ s(t, {
18
+ }), M = ({ children: e, Component: t, preparedLayout: n, permissionsQuery: r, activeGroupId: a, authStatusQuery: s, authStatusPrepared: c, loginRedirectPath: l, preparedSegment: d }) => {
19
+ let f = p(s, c);
20
+ return f?.isLoggedIn === !0 ? /* @__PURE__ */ o(t, {
26
21
  permissionsQuery: r,
27
22
  prepared: n?.permissionsQuery ?? null,
28
- authStatus: l,
29
- activeGroupId: i,
23
+ authStatus: f,
24
+ activeGroupId: a,
30
25
  children: e
31
- }) : /* @__PURE__ */ s(A, { pathname: c });
32
- }, M = (e) => {
26
+ }) : /* @__PURE__ */ o(u, {
27
+ pathname: l,
28
+ preparedSegment: d,
29
+ fallback: /* @__PURE__ */ o(i, {})
30
+ });
31
+ }, N = (e) => {
33
32
  let t = e.trim();
34
33
  return t === "" || t === "/" ? "" : t.replace(/^\/+|\/+$/g, "");
35
- }, N = (e) => {
34
+ }, P = (e) => {
36
35
  let t = e.trim();
37
36
  return t === "" ? "/" : `/${t}`.replace(/\/+/g, "/");
38
- }, P = (e, t) => {
37
+ }, F = (e, t) => {
39
38
  let n = t.replace(/^\/+|\/+$/g, "");
40
39
  return e === "" ? n : n === "" ? e : `${e}/${n}`;
41
- }, F = (e, t) => N(P(e, t)), I = (e) => e.trim().replace(/^\/+|\/+$/g, ""), L = (e, t) => {
42
- let n = N(e), r = t === "" ? "" : `/${t}`;
40
+ }, I = (e, t) => P(F(e, t)), L = (e) => e.trim().replace(/^\/+|\/+$/g, ""), R = (e, t) => {
41
+ let n = P(e), r = t === "" ? "" : `/${t}`;
43
42
  return r !== "" && n.startsWith(r) ? n.slice(r.length).replace(/^\/+/, "") : n.replace(/^\/+/, "");
44
- }, R = (e, t) => {
43
+ }, z = (e, t) => {
45
44
  if (e?.routes == null) return null;
46
45
  for (let n = e.routes.length - 1; n >= 0; --n) {
47
46
  let r = e.routes[n];
@@ -51,53 +50,53 @@ var { loadQuery: f, usePreloadedQuery: p } = c, m = u("BackofficeLayoutPage", as
51
50
  }
52
51
  }
53
52
  return null;
54
- }, z = (e, t) => {
55
- let n = I(t);
56
- return e.detailPages?.find((e) => I(e.pathSegment) === n) ?? null;
57
- }, B = (e, t) => z(e, t)?.id ?? t, V = d;
58
- function H(a) {
59
- let { basePath: o, entityManifest: c, entityRegistry: l, sidebar: u, auth: d, dashboard: p } = a, N = r(a.dashboards), I = M(o), z = P(I, "login"), H = P(I, "login/reset"), U = P(I, "login/reset/complete"), ae = P(I, "verify-email"), oe = P(I, "accept-invitation"), se = F(I, "login"), W = t(c, u), ce = n(W, u), le = e(W, u), G = /* @__PURE__ */ new Map();
53
+ }, B = (e, t) => {
54
+ let n = L(t);
55
+ return e.detailPages?.find((e) => L(e.pathSegment) === n) ?? null;
56
+ }, V = (e, t) => B(e, t)?.id ?? t, H = d;
57
+ function U(s) {
58
+ let { basePath: l, entityManifest: d, entityRegistry: p, sidebar: P, auth: L, dashboard: B } = s, U = r(s.dashboards), W = N(l), ne = F(W, "login"), re = F(W, "login/reset"), ie = F(W, "login/reset/complete"), ae = F(W, "verify-email"), oe = F(W, "accept-invitation"), se = I(W, "login"), G = t(d, P), ce = n(G, P), le = e(G, P), K = /* @__PURE__ */ new Map();
60
59
  le.forEach((e, t) => {
61
- G.set(t, e.groupId);
60
+ K.set(t, e.groupId);
62
61
  });
63
- let K = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), J = u?.permissionsQuery, ue = async ({ context: e }) => {
64
- let t = await d.session.load();
62
+ let q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap(), Y = P?.permissionsQuery, ue = async ({ context: e }) => {
63
+ let t = await L.session.load();
65
64
  return {
66
- permissionsQuery: J == null ? null : f(e.relayEnvironment, J, {}),
65
+ permissionsQuery: Y == null ? null : f(e.relayEnvironment, Y, {}),
67
66
  authStatusQuery: t.authStatusQuery == null ? null : f(e.relayEnvironment, t.authStatusQuery, {}, { fetchPolicy: "network-only" })
68
67
  };
69
- }, Y = async () => p == null ? null : {
68
+ }, X = async () => B == null ? null : {
70
69
  dashboardId: "dashboard",
71
- config: await p.load()
72
- }, X = () => p == null ? null : { dashboardId: "dashboard" }, Z = ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ s(t, { prepared: e }), Q = ({ children: e, prepared: t, Component: n }) => n == null ? null : /* @__PURE__ */ s(n, {
70
+ config: await B.load()
71
+ }, de = () => B == null ? null : { dashboardId: "dashboard" }, Z = ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e }), Q = ({ children: e, prepared: t, Component: n }) => n == null ? null : /* @__PURE__ */ o(n, {
73
72
  prepared: t,
74
73
  children: e
75
- }), de = V({
74
+ }), fe = H({
76
75
  path: "",
77
- resourcePage: T,
78
- prepare: X,
76
+ resourcePage: w,
77
+ prepare: de,
79
78
  render: Q,
80
- children: [V({
79
+ children: [H({
81
80
  path: "",
82
- resourcePage: w,
83
- prepare: Y,
81
+ resourcePage: C,
82
+ prepare: X,
84
83
  render: Z
85
84
  })]
86
- }), fe = V({
85
+ }), pe = H({
87
86
  path: "dashboard",
88
- resourcePage: T,
89
- prepare: X,
87
+ resourcePage: w,
88
+ prepare: de,
90
89
  render: Q,
91
- children: [V({
90
+ children: [H({
92
91
  path: "",
93
- resourcePage: w,
94
- prepare: Y,
92
+ resourcePage: C,
93
+ prepare: X,
95
94
  render: Z
96
95
  })]
97
- }), pe = N.map((e) => {
98
- let t = V({
96
+ }), me = U.map((e) => {
97
+ let t = H({
99
98
  path: "",
100
- resourcePage: w,
99
+ resourcePage: C,
101
100
  prepare: async () => {
102
101
  let t = await e.module.load();
103
102
  return {
@@ -108,9 +107,9 @@ function H(a) {
108
107
  },
109
108
  render: Z
110
109
  });
111
- return V({
110
+ return H({
112
111
  path: `dashboard/${e.id}`,
113
- resourcePage: T,
112
+ resourcePage: w,
114
113
  prepare: () => ({
115
114
  dashboardId: e.id,
116
115
  label: e.label
@@ -118,61 +117,61 @@ function H(a) {
118
117
  render: Q,
119
118
  children: [t]
120
119
  });
121
- }), me = Object.values(c).filter((e) => e.kind === "list-detail"), he = ce.map((e) => {
122
- let t = V({
123
- path: L(e.hub.href, I),
124
- resourcePage: D,
120
+ }), he = Object.values(d).filter((e) => e.kind === "list-detail"), ge = ce.map((e) => {
121
+ let t = H({
122
+ path: R(e.hub.href, W),
123
+ resourcePage: E,
125
124
  prepare: () => ({
126
125
  hubId: e.hub.id,
127
126
  hub: e.hub
128
127
  }),
129
- render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ s(t, { prepared: e })
128
+ render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e })
130
129
  });
131
- return e.groupId != null && q.set(t, e.groupId), t;
132
- }), ge = me.map((e) => {
133
- let t = e.routes.list, n = L(t, I), r = [], a = ({ match: t }) => {
134
- let n = String(t?.params.id ?? ""), r = typeof t?.params.pagePath == "string" ? t.params.pagePath : null, a = r == null ? e.defaultDetailPageId : B(e, r);
135
- return /* @__PURE__ */ s(i, {
130
+ return e.groupId != null && J.set(t, e.groupId), t;
131
+ }), _e = he.map((e) => {
132
+ let t = e.routes.list, n = R(t, W), r = [], s = ({ match: t }) => {
133
+ let n = String(t?.params.id ?? ""), r = typeof t?.params.pagePath == "string" ? t.params.pagePath : null, i = r == null ? e.defaultDetailPageId : V(e, r);
134
+ return /* @__PURE__ */ o(a, {
136
135
  entityManifest: e,
137
136
  id: n,
138
- pageId: a,
137
+ pageId: i,
139
138
  pagePath: r
140
139
  });
141
140
  };
142
141
  if (e.hasList) {
143
- let t = V({
142
+ let t = H({
144
143
  path: "",
145
144
  querySchema: e.listNavigation.querySchema,
146
145
  resourcePage: _,
147
146
  prepareSearchBehavior: "path",
148
147
  prepare: async ({ context: t, filters: n, query: r }) => {
149
- let { config: i } = await l.loadListEntity(e.id), { list: a } = i, { defaults: o } = e.listNavigation, s = {};
148
+ let { config: i } = await p.loadListEntity(e.id), { list: a } = i, { defaults: o } = e.listNavigation, s = {};
150
149
  typeof r.sort == "string" && (s.sort = r.sort);
151
- let c = n, u = e.listNavigation.decode({
152
- filters: c,
150
+ let l = n, u = e.listNavigation.decode({
151
+ filters: l,
153
152
  query: s
154
- }), { pageSize: d } = ee, p = {
153
+ }), { pageSize: d } = c, m = {
155
154
  where: u.where,
156
155
  sort: u.sort ?? o.sort,
157
156
  count: d,
158
157
  cursor: null
159
- }, m = a.buildQueryVariables(p), h = f(t.relayEnvironment, a.query, m);
158
+ }, h = a.buildQueryVariables(m), g = f(t.relayEnvironment, a.query, h);
160
159
  return {
161
160
  entityId: e.id,
162
161
  entityManifest: e,
163
162
  entityConfig: i,
164
- query: h
163
+ query: g
165
164
  };
166
165
  },
167
- render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ s(t, { prepared: e })
166
+ render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e })
168
167
  });
169
- K.set(t, e.id);
170
- let n = V({
168
+ q.set(t, e.id);
169
+ let n = H({
171
170
  path: "",
172
171
  resourcePage: h,
173
172
  prepareSearchBehavior: "path",
174
173
  prepare: async () => {
175
- let { config: t } = await l.loadListEntity(e.id);
174
+ let { config: t } = await p.loadListEntity(e.id);
176
175
  return {
177
176
  entityId: e.id,
178
177
  entityManifest: e,
@@ -182,7 +181,7 @@ function H(a) {
182
181
  render: ({ children: e, prepared: t, Component: n }) => {
183
182
  if (n == null) return null;
184
183
  let r = t;
185
- return /* @__PURE__ */ s(n, {
184
+ return /* @__PURE__ */ o(n, {
186
185
  entityManifest: r.entityManifest,
187
186
  config: r.entityConfig,
188
187
  prepared: r,
@@ -191,8 +190,8 @@ function H(a) {
191
190
  },
192
191
  children: [t]
193
192
  });
194
- K.set(n, e.id);
195
- let i = V({
193
+ q.set(n, e.id);
194
+ let i = H({
196
195
  path: "",
197
196
  resourcePage: g,
198
197
  prepareSearchBehavior: "path",
@@ -203,7 +202,7 @@ function H(a) {
203
202
  render: ({ children: e, prepared: t, Component: n }) => {
204
203
  if (n == null) return null;
205
204
  let r = t;
206
- return /* @__PURE__ */ s(n, {
205
+ return /* @__PURE__ */ o(n, {
207
206
  entityManifest: r.entityManifest,
208
207
  prepared: r,
209
208
  children: e
@@ -211,16 +210,16 @@ function H(a) {
211
210
  },
212
211
  children: [n]
213
212
  });
214
- K.set(i, e.id), r.push(i);
213
+ q.set(i, e.id), r.push(i);
215
214
  }
216
- let o = e.detailPages.map((t) => {
217
- let n = V({
215
+ let l = e.detailPages.map((t) => {
216
+ let n = H({
218
217
  path: "",
219
218
  resourcePage: v,
220
219
  suspenseBoundary: "segment",
221
- fallback: a,
220
+ fallback: s,
222
221
  prepare: async ({ context: n, variables: r }) => {
223
- let i = String(r.id ?? ""), a = await l.loadDetailPageEntity(e.id, t.id), o = a.config.page.buildVariables == null ? { variables: { id: i } } : a.config.page.buildVariables({ id: i }), s = f(n.relayEnvironment, a.config.page.query, o.variables);
222
+ let i = String(r.id ?? ""), a = await p.loadDetailPageEntity(e.id, t.id), o = a.config.page.buildVariables == null ? { variables: { id: i } } : a.config.page.buildVariables({ id: i }), s = f(n.relayEnvironment, a.config.page.query, o.variables);
224
223
  return {
225
224
  entityId: e.id,
226
225
  entityManifest: e,
@@ -232,16 +231,16 @@ function H(a) {
232
231
  pagePath: t.pathSegment
233
232
  };
234
233
  },
235
- render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ s(t, { prepared: e })
234
+ render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e })
236
235
  });
237
- K.set(n, e.id);
238
- let r = V({
236
+ q.set(n, e.id);
237
+ let r = H({
239
238
  path: t.pathSegment,
240
239
  resourcePage: x,
241
240
  suspenseBoundary: "segment",
242
- fallback: a,
241
+ fallback: s,
243
242
  prepare: async ({ variables: n }) => {
244
- let r = String(n.id ?? ""), [i, a] = await Promise.all([l.loadDetailPageEntity(e.id, t.id), l.loadDetailLayoutEntity(e.id)]);
243
+ let r = String(n.id ?? ""), [i, a] = await Promise.all([p.loadDetailPageEntity(e.id, t.id), p.loadDetailLayoutEntity(e.id)]);
245
244
  return {
246
245
  entityId: e.id,
247
246
  entityManifest: e,
@@ -255,7 +254,7 @@ function H(a) {
255
254
  render: ({ children: e, prepared: t, Component: n }) => {
256
255
  if (n == null) return null;
257
256
  let r = t;
258
- return /* @__PURE__ */ s(n, {
257
+ return /* @__PURE__ */ o(n, {
259
258
  config: r.entityConfig,
260
259
  prepared: r,
261
260
  children: e
@@ -263,14 +262,14 @@ function H(a) {
263
262
  },
264
263
  children: [n]
265
264
  });
266
- return K.set(r, e.id), r;
267
- }), c = V({
265
+ return q.set(r, e.id), r;
266
+ }), d = H({
268
267
  path: "",
269
268
  resourcePage: b,
270
269
  suspenseBoundary: "segment",
271
- fallback: a,
270
+ fallback: s,
272
271
  prepare: async ({ context: t, variables: n }) => {
273
- let { config: r } = await l.loadDetailLayoutEntity(e.id), i = String(n.id ?? ""), a = r.layoutPage.buildVariables == null ? { variables: { id: i } } : r.layoutPage.buildVariables({ id: i }), o = f(t.relayEnvironment, r.layoutPage.query, a.variables);
272
+ let { config: r } = await p.loadDetailLayoutEntity(e.id), i = String(n.id ?? ""), a = r.layoutPage.buildVariables == null ? { variables: { id: i } } : r.layoutPage.buildVariables({ id: i }), o = f(t.relayEnvironment, r.layoutPage.query, a.variables);
274
273
  return {
275
274
  entityId: e.id,
276
275
  entityManifest: e,
@@ -282,7 +281,7 @@ function H(a) {
282
281
  render: ({ children: e, prepared: t, Component: n }) => {
283
282
  if (n == null) return null;
284
283
  let r = t;
285
- return /* @__PURE__ */ s(n, {
284
+ return /* @__PURE__ */ o(n, {
286
285
  entityManifest: r.entityManifest,
287
286
  config: r.entityConfig,
288
287
  prepared: r,
@@ -290,25 +289,29 @@ function H(a) {
290
289
  });
291
290
  },
292
291
  children: [
293
- V({
292
+ H({
294
293
  path: "",
295
294
  prepare: ({ variables: t }) => {
296
295
  let n = String(t.id ?? "").trim();
297
296
  return { redirectTo: n === "" ? null : e.routes.detailPage(n, e.defaultDetailPageId) };
298
297
  },
299
- render: ({ prepared: e }) => {
300
- let t = e.redirectTo ?? null;
301
- return t == null ? null : /* @__PURE__ */ s(A, { pathname: t });
298
+ render: ({ prepared: e, preparedSegment: t }) => {
299
+ let n = e.redirectTo ?? null;
300
+ return n == null ? null : /* @__PURE__ */ o(u, {
301
+ pathname: n,
302
+ preparedSegment: t,
303
+ fallback: /* @__PURE__ */ o(i, {})
304
+ });
302
305
  }
303
306
  }),
304
- ...o,
305
- V({
307
+ ...l,
308
+ H({
306
309
  path: ":pagePath",
307
- resourcePage: C,
310
+ resourcePage: ee,
308
311
  suspenseBoundary: "segment",
309
- fallback: a,
312
+ fallback: s,
310
313
  prepare: async ({ variables: t }) => {
311
- let n = await l.loadDetailLayoutEntity(e.id), r = String(t.id ?? ""), i = String(t.pagePath ?? "");
314
+ let n = await p.loadDetailLayoutEntity(e.id), r = String(t.id ?? ""), i = String(t.pagePath ?? "");
312
315
  return {
313
316
  entityId: e.id,
314
317
  entityManifest: e,
@@ -320,7 +323,7 @@ function H(a) {
320
323
  render: ({ prepared: e, Component: t }) => {
321
324
  if (t == null) return null;
322
325
  let n = e;
323
- return /* @__PURE__ */ s(t, {
326
+ return /* @__PURE__ */ o(t, {
324
327
  entityManifest: n.entityManifest,
325
328
  config: n.entityConfig,
326
329
  prepared: n
@@ -329,14 +332,14 @@ function H(a) {
329
332
  })
330
333
  ]
331
334
  });
332
- K.set(c, e.id);
333
- let u = V({
335
+ q.set(d, e.id);
336
+ let m = H({
334
337
  path: "",
335
338
  resourcePage: S,
336
339
  suspenseBoundary: "segment",
337
- fallback: a,
340
+ fallback: s,
338
341
  prepare: ({ variables: t }) => {
339
- let n = String(t.id ?? ""), r = typeof t.pagePath == "string" ? t.pagePath : null, i = r == null ? e.defaultDetailPageId : B(e, r);
342
+ let n = String(t.id ?? ""), r = typeof t.pagePath == "string" ? t.pagePath : null, i = r == null ? e.defaultDetailPageId : V(e, r);
340
343
  return {
341
344
  entityId: e.id,
342
345
  entityManifest: e,
@@ -348,20 +351,20 @@ function H(a) {
348
351
  render: ({ children: e, prepared: t, Component: n }) => {
349
352
  if (n == null) return null;
350
353
  let r = t;
351
- return /* @__PURE__ */ s(n, {
354
+ return /* @__PURE__ */ o(n, {
352
355
  entityManifest: r.entityManifest,
353
356
  prepared: r,
354
357
  children: e
355
358
  });
356
359
  },
357
- children: [c]
360
+ children: [d]
358
361
  });
359
- K.set(u, e.id);
360
- let d = V({
362
+ q.set(m, e.id);
363
+ let C = H({
361
364
  path: ":id",
362
365
  resourcePage: y,
363
366
  suspenseBoundary: "segment",
364
- fallback: a,
367
+ fallback: s,
365
368
  prepare: ({ variables: t }) => {
366
369
  let n = String(t.id ?? "");
367
370
  return {
@@ -373,25 +376,25 @@ function H(a) {
373
376
  render: ({ children: e, prepared: t, Component: n }) => {
374
377
  if (n == null) return null;
375
378
  let r = t;
376
- return /* @__PURE__ */ s(n, {
379
+ return /* @__PURE__ */ o(n, {
377
380
  entityManifest: r.entityManifest,
378
381
  prepared: r,
379
382
  children: e
380
383
  });
381
384
  },
382
- children: [u]
385
+ children: [m]
383
386
  });
384
- return K.set(d, e.id), r.push(d), V({
387
+ return q.set(C, e.id), r.push(C), H({
385
388
  path: n,
386
389
  children: r,
387
390
  suspenseBoundary: "segment"
388
391
  });
389
- }), _e = Object.values(c).filter((e) => e.kind === "tool").map((e) => {
390
- let t = L(e.routes.list, I), n = V({
392
+ }), ve = Object.values(d).filter((e) => e.kind === "tool").map((e) => {
393
+ let t = R(e.routes.list, W), n = H({
391
394
  path: "",
392
- resourcePage: a.toolsOperationPage ?? null,
395
+ resourcePage: s.toolsOperationPage ?? null,
393
396
  prepare: async () => {
394
- let t = await l.loadToolEntity(e.id);
397
+ let t = await p.loadToolEntity(e.id);
395
398
  return {
396
399
  entityId: e.id,
397
400
  entityManifest: e,
@@ -401,17 +404,17 @@ function H(a) {
401
404
  render: ({ prepared: e, Component: t }) => {
402
405
  if (t == null) return null;
403
406
  let n = e;
404
- return /* @__PURE__ */ s(t, {
407
+ return /* @__PURE__ */ o(t, {
405
408
  entityManifest: n.entityManifest,
406
409
  operation: n.entityConfig.tool.operation,
407
410
  toolId: n.entityConfig.id
408
411
  });
409
412
  }
410
413
  });
411
- K.set(n, e.id);
412
- let r = V({
414
+ q.set(n, e.id);
415
+ let r = H({
413
416
  path: t,
414
- resourcePage: E,
417
+ resourcePage: T,
415
418
  prepare: () => ({
416
419
  entityId: e.id,
417
420
  entityManifest: e
@@ -419,7 +422,7 @@ function H(a) {
419
422
  render: ({ children: e, prepared: t, Component: n }) => {
420
423
  if (n == null) return null;
421
424
  let r = t;
422
- return /* @__PURE__ */ s(n, {
425
+ return /* @__PURE__ */ o(n, {
423
426
  entityManifest: r.entityManifest,
424
427
  prepared: r,
425
428
  children: e
@@ -427,90 +430,91 @@ function H(a) {
427
430
  },
428
431
  children: [n]
429
432
  });
430
- return K.set(r, e.id), r;
431
- }), ve = V({
432
- path: I,
433
+ return q.set(r, e.id), r;
434
+ }), ye = H({
435
+ path: W,
433
436
  resourcePage: m,
434
437
  prepareSearchBehavior: "path",
435
438
  suspenseBoundary: "segment",
436
439
  prepare: ue,
437
- render: ({ children: e, prepared: t, route: n, Component: r }) => {
440
+ render: ({ children: e, prepared: t, route: n, Component: r, preparedSegment: i }) => {
438
441
  if (r == null) return null;
439
- let i = t, a = R(n, K), o = a == null ? R(n, q) : G.get(a) ?? null, c = r, l = d.session.get()?.authStatusQuery ?? null;
440
- return l != null && i?.authStatusQuery != null ? /* @__PURE__ */ s(j, {
441
- Component: c,
442
- preparedLayout: i,
443
- permissionsQuery: u?.permissionsQuery,
444
- activeGroupId: o,
445
- authStatusQuery: l,
446
- authStatusPrepared: i.authStatusQuery,
442
+ let a = t, s = z(n, q), c = s == null ? z(n, J) : K.get(s) ?? null, l = r, u = L.session.get()?.authStatusQuery ?? null;
443
+ return u != null && a?.authStatusQuery != null ? /* @__PURE__ */ o(M, {
444
+ Component: l,
445
+ preparedLayout: a,
446
+ permissionsQuery: P?.permissionsQuery,
447
+ activeGroupId: c,
448
+ authStatusQuery: u,
449
+ authStatusPrepared: a.authStatusQuery,
447
450
  loginRedirectPath: se,
451
+ preparedSegment: i,
448
452
  children: e
449
- }) : /* @__PURE__ */ s(ie, {
450
- Component: c,
451
- preparedLayout: i,
452
- permissionsQuery: u?.permissionsQuery,
453
- activeGroupId: o,
453
+ }) : /* @__PURE__ */ o(te, {
454
+ Component: l,
455
+ preparedLayout: a,
456
+ permissionsQuery: P?.permissionsQuery,
457
+ activeGroupId: c,
454
458
  children: e
455
459
  });
456
460
  },
457
461
  children: [
458
- de,
459
- ...he,
462
+ fe,
460
463
  ...ge,
461
464
  ..._e,
462
- ...pe,
463
- fe
465
+ ...ve,
466
+ ...me,
467
+ pe
464
468
  ]
465
469
  }), $ = [
466
- V({
467
- path: z,
468
- resourcePage: O,
470
+ H({
471
+ path: ne,
472
+ resourcePage: D,
469
473
  prepare: async ({ context: e }) => {
470
- let t = await d.login.load();
474
+ let t = await L.login.load();
471
475
  return { query: f(e.relayEnvironment, t.loginQuery, {}) };
472
476
  },
473
- render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ s(t, { prepared: e })
477
+ render: ({ prepared: e, Component: t }) => t == null ? null : /* @__PURE__ */ o(t, { prepared: e })
474
478
  }),
475
- V({
476
- path: H,
477
- resourcePage: te,
478
- prepare: async () => (await d.passwordResetRequest.load(), null),
479
- render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ s(e, {})
479
+ H({
480
+ path: re,
481
+ resourcePage: O,
482
+ prepare: async () => (await L.passwordResetRequest.load(), null),
483
+ render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
480
484
  }),
481
- V({
482
- path: U,
483
- resourcePage: ne,
484
- prepare: async () => (await d.passwordResetComplete.load(), null),
485
- render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ s(e, {})
485
+ H({
486
+ path: ie,
487
+ resourcePage: k,
488
+ prepare: async () => (await L.passwordResetComplete.load(), null),
489
+ render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
486
490
  }),
487
- V({
491
+ H({
488
492
  path: ae,
489
- resourcePage: re,
490
- prepare: async () => (await d.verifyEmail.load(), null),
491
- render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ s(e, {})
493
+ resourcePage: A,
494
+ prepare: async () => (await L.verifyEmail.load(), null),
495
+ render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
492
496
  })
493
497
  ];
494
- return (d.hasAcceptInvitation === !0 || d.acceptInvitation != null) && $.push(V({
498
+ return (L.hasAcceptInvitation === !0 || L.acceptInvitation != null) && $.push(H({
495
499
  path: oe,
496
- resourcePage: k,
497
- prepare: async () => (await d.acceptInvitation?.load(), null),
498
- render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ s(e, {})
499
- })), $.push(ve), $;
500
+ resourcePage: j,
501
+ prepare: async () => (await L.acceptInvitation?.load(), null),
502
+ render: ({ Component: e }) => e == null ? null : /* @__PURE__ */ o(e, {})
503
+ })), $.push(ye), $;
500
504
  }
501
- var U = {
502
- normalizeBaseSegment: M,
503
- normalizePath: N,
504
- buildScopedPath: P,
505
- buildScopedAbsolutePath: F,
506
- buildRelativePath: L,
507
- resolveActiveEntityIdFromRoute: R,
508
- resolveDetailPageIdForPath: B,
509
- resolveDetailPageManifestByPath: z,
505
+ var W = {
506
+ normalizeBaseSegment: N,
507
+ normalizePath: P,
508
+ buildScopedPath: F,
509
+ buildScopedAbsolutePath: I,
510
+ buildRelativePath: R,
511
+ resolveActiveEntityIdFromRoute: z,
512
+ resolveDetailPageIdForPath: V,
513
+ resolveDetailPageManifestByPath: B,
510
514
  validateBackofficeDashboardRegistrations: r,
511
- BackofficeLayoutRouteWithAuthStatus: j
515
+ BackofficeLayoutRouteWithAuthStatus: M
512
516
  };
513
517
  //#endregion
514
- export { k as BackofficeAcceptInvitationPageResource, w as BackofficeDashboardPageResource, T as BackofficeDashboardShellPageResource, y as BackofficeEntityDetailFramePageResource, b as BackofficeEntityDetailLayoutPageResource, x as BackofficeEntityDetailPageConfigPageResource, v as BackofficeEntityDetailPageResource, S as BackofficeEntityDetailShellPageResource, C as BackofficeEntityDetailUnknownPageRedirectResource, _ as BackofficeEntityListDataPageResource, h as BackofficeEntityListPageResource, g as BackofficeEntityListShellPageResource, D as BackofficeHubPageResource, m as BackofficeLayoutPageResource, O as BackofficeLoginPageResource, ne as BackofficePasswordResetCompletePageResource, te as BackofficePasswordResetRequestPageResource, E as BackofficeToolShellPageResource, re as BackofficeVerifyEmailPageResource, U as __test, H as createBackofficeRoutes, H as default };
518
+ export { j as BackofficeAcceptInvitationPageResource, C as BackofficeDashboardPageResource, w as BackofficeDashboardShellPageResource, y as BackofficeEntityDetailFramePageResource, b as BackofficeEntityDetailLayoutPageResource, x as BackofficeEntityDetailPageConfigPageResource, v as BackofficeEntityDetailPageResource, S as BackofficeEntityDetailShellPageResource, ee as BackofficeEntityDetailUnknownPageRedirectResource, _ as BackofficeEntityListDataPageResource, h as BackofficeEntityListPageResource, g as BackofficeEntityListShellPageResource, E as BackofficeHubPageResource, m as BackofficeLayoutPageResource, D as BackofficeLoginPageResource, k as BackofficePasswordResetCompletePageResource, O as BackofficePasswordResetRequestPageResource, T as BackofficeToolShellPageResource, A as BackofficeVerifyEmailPageResource, W as __test, U as createBackofficeRoutes, U as default };
515
519
 
516
520
  //# sourceMappingURL=createBackofficeRoutes.js.map