@cratis/stage.runtime 4.186.0 → 4.187.1

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.
package/dist/src/index.js CHANGED
@@ -1,23 +1,23 @@
1
1
  import "./app.css";
2
- import { createContext as e, createElement as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
3
- import { ColorScheme as c, DestinationKind as l, FormGenerationMode as u, FormWidthUnit as d, InteractionTriggerKind as f } from "@cratis/scene.model";
4
- import { ShellDiagnosticCode as p, ShellOrigin as m, createBindingResolver as h, resolveArgumentSource as g, resolveBehaviors as _, resolveStringsInElement as v, runBindings as y, validateBindingExpression as b } from "@cratis/scene.engine";
5
- import { CoreSliceDialog as x, CoreToolbarItem as S, InteractionScope as C, SceneElementView as w, SceneNavigationContextInternal as T, SliceCommandFieldsProvider as ee, SliceDialogView as E, SliceInvokerProvider as te, attachmentFor as D, coreComponents as ne, createBrowserDispatcher as re, createHashSceneHistory as O, sliceDialogParameters as ie, useInteractionScope as ae, useOptionalSceneNavigation as oe, useSceneNavigation as k, useSceneOutlets as se, useSceneTheme as ce } from "@cratis/scene.react";
6
- import { ApplicationHost as A, ColorScheme as j, ComponentName as M, LayoutThemeProvider as le, SlotName as N, blueprintPackageCatalog as ue, composeApplicationScreen as de, defaultBlueprintComponents as fe, defaultBlueprintName as pe, defaultBlueprintThemes as me, effectiveShellOf as he, externalComponent as P, galleryScreenTemplates as ge, layoutModes as _e, menuThemes as ve, navigationElement as ye, previewComponents as be, previewProfile as xe, useLayoutConfig as Se } from "@cratis/scene.blueprint.default";
2
+ import { createContext as e, createElement as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
3
+ import { ColorScheme as l, DestinationKind as u, FormGenerationMode as d, FormWidthUnit as f, InteractionTriggerKind as p } from "@cratis/scene.model";
4
+ import { ShellDiagnosticCode as m, ShellOrigin as h, createBindingResolver as g, resolveArgumentSource as _, resolveBehaviors as v, resolveStringsInElement as y, runBindings as b, validateBindingExpression as x } from "@cratis/scene.engine";
5
+ import { CoreSliceDialog as S, CoreToolbarItem as C, InteractionScope as ee, SceneElementView as w, SceneNavigationContextInternal as te, SliceCommandFieldsProvider as ne, SliceDialogView as re, SliceInvokerProvider as T, attachmentFor as ie, coreComponents as E, createBrowserDispatcher as ae, createHashSceneHistory as D, sliceDialogParameters as O, useInteractionScope as oe, useOptionalSceneNavigation as se, useSceneNavigation as ce, useSceneOutlets as le, useSceneTheme as k } from "@cratis/scene.react";
6
+ import { ApplicationHost as ue, ColorScheme as A, ComponentName as j, LayoutThemeProvider as de, SlotName as M, blueprintPackageCatalog as fe, composeApplicationScreen as pe, defaultBlueprintComponents as me, defaultBlueprintName as he, defaultBlueprintThemes as ge, effectiveShellOf as _e, externalComponent as N, galleryScreenTemplates as ve, layoutModes as ye, menuThemes as be, navigationElement as xe, previewComponents as Se, previewProfile as Ce, useLayoutConfig as we } from "@cratis/scene.blueprint.default";
7
7
  import "@cratis/scene.blueprint.default/styles.css";
8
- import { Globals as Ce } from "@cratis/arc";
9
- import { ServerSentEventQueryConnection as we } from "@cratis/arc/queries";
10
- import { Fragment as Te, jsx as F, jsxs as I } from "react/jsx-runtime";
11
- import { Button as L } from "primereact/button";
12
- import { PrimeDialog as Ee, PrimeMessage as De, primeReactComponents as Oe, primeReactPackageManifest as ke } from "@cratis/scene.primereact";
13
- import { ArcContext as Ae } from "@cratis/arc.react";
14
- import { Command as je } from "@cratis/arc/commands";
15
- import { resolveCommand as Me } from "@cratis/scene.components";
16
- import { CommandForm as Ne, asCommandFormField as Pe } from "@cratis/arc.react/commands";
17
- import { CalendarField as Fe, CheckboxField as Ie, DropdownField as Le, InputTextField as Re, NumberField as ze } from "@cratis/components/CommandForm";
18
- import Be from "@primeuix/themes/lara";
8
+ import { Globals as Te } from "@cratis/arc";
9
+ import { ServerSentEventQueryConnection as Ee } from "@cratis/arc/queries";
10
+ import { Fragment as De, jsx as P, jsxs as F } from "react/jsx-runtime";
11
+ import { Button as I } from "primereact/button";
12
+ import { PrimeDialog as Oe, PrimeMessage as ke, primeReactComponents as Ae, primeReactPackageManifest as je } from "@cratis/scene.primereact";
13
+ import { ArcContext as Me } from "@cratis/arc.react";
14
+ import { Command as Ne } from "@cratis/arc/commands";
15
+ import { resolveCommand as Pe } from "@cratis/scene.components";
16
+ import { CommandForm as Fe, asCommandFormField as Ie } from "@cratis/arc.react/commands";
17
+ import { CalendarField as Le, CheckboxField as Re, DropdownField as ze, InputTextField as Be, NumberField as Ve } from "@cratis/components/CommandForm";
18
+ import He from "@primeuix/themes/lara";
19
19
  //#region src/stageSource.ts
20
- function Ve(e) {
20
+ function Ue(e) {
21
21
  return {
22
22
  scene: async () => e.scene,
23
23
  routes: async () => e.routes,
@@ -25,23 +25,23 @@ function Ve(e) {
25
25
  strings: async (t) => e.strings[t] ?? {}
26
26
  };
27
27
  }
28
- var He = {
28
+ var We = {
29
29
  scene: "stage/scene",
30
30
  routes: "stage/routes",
31
31
  locales: "stage/locales",
32
32
  strings: (e) => `stage/strings/${encodeURIComponent(e)}`
33
- }, Ue = e(void 0);
34
- function We({ source: e, children: n }) {
35
- return t(Ue.Provider, { value: e }, n);
33
+ }, Ge = e(void 0);
34
+ function Ke({ source: e, children: n }) {
35
+ return t(Ge.Provider, { value: e }, n);
36
36
  }
37
- function Ge() {
38
- let e = r(Ue);
37
+ function L() {
38
+ let e = r(Ge);
39
39
  if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
40
40
  return e;
41
41
  }
42
- He.routes;
43
- function Ke() {
44
- let e = Ge(), [t, n] = s({
42
+ We.routes;
43
+ function qe() {
44
+ let e = L(), [t, n] = c({
45
45
  routes: void 0,
46
46
  ready: !1
47
47
  });
@@ -60,14 +60,14 @@ function Ke() {
60
60
  }), () => t.abort();
61
61
  }, [e]), t;
62
62
  }
63
- function qe(e) {
63
+ function Je(e) {
64
64
  if (R(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
65
65
  }
66
- var Je = "STAGE-SCENE-ACTION-001", Ye = "item.";
66
+ var Ye = "STAGE-SCENE-ACTION-001", Xe = "item.";
67
67
  function R(e) {
68
68
  return typeof e == "object" && !!e && !Array.isArray(e);
69
69
  }
70
- function Xe(e, t) {
70
+ function Ze(e, t) {
71
71
  let n = e;
72
72
  for (let e of t.split(".").filter(Boolean)) {
73
73
  if (!R(n)) return;
@@ -75,20 +75,20 @@ function Xe(e, t) {
75
75
  }
76
76
  return n;
77
77
  }
78
- function Ze(e) {
78
+ function Qe(e) {
79
79
  return e === null || [
80
80
  "string",
81
81
  "number",
82
82
  "boolean"
83
83
  ].includes(typeof e);
84
84
  }
85
- function Qe(e, t) {
85
+ function $e(e, t) {
86
86
  if (typeof e == "number") return t[e];
87
87
  if (typeof e == "string") return t.find((t) => t.toLowerCase() === e.toLowerCase());
88
88
  }
89
- function $e(e, t, n, r) {
89
+ function et(e, t, n, r) {
90
90
  if (r !== void 0 && (t === "Equal" || t === "NotEqual")) {
91
- let i = Qe(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
91
+ let i = $e(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
92
92
  return i === void 0 || a === void 0 ? !1 : t === "Equal" ? i === a : i !== a;
93
93
  }
94
94
  switch (t) {
@@ -103,46 +103,79 @@ function $e(e, t, n, r) {
103
103
  default: return;
104
104
  }
105
105
  }
106
- function et(e, t) {
106
+ function tt(e, t) {
107
107
  if (R(e)) {
108
108
  if (e.kind === "comparison") {
109
- let n = qe(e.left);
110
- if (typeof n != "string" || !n.startsWith(Ye) || typeof e.operator != "string" || !Ze(e.right)) return;
109
+ let n = Je(e.left);
110
+ if (typeof n != "string" || !n.startsWith(Xe) || typeof e.operator != "string" || !Qe(e.right)) return;
111
111
  let r = Array.isArray(e.enumeration) && e.enumeration.every((e) => typeof e == "string") ? e.enumeration : void 0;
112
- return $e(Xe(t, n.slice(5)), e.operator, e.right, r);
112
+ return et(Ze(t, n.slice(5)), e.operator, e.right, r);
113
113
  }
114
114
  if (e.kind === "logical") {
115
- let n = et(e.left, t), r = et(e.right, t);
115
+ let n = tt(e.left, t), r = tt(e.right, t);
116
116
  return n === void 0 || r === void 0 ? void 0 : e.operator === "And" ? n && r : e.operator === "Or" ? n || r : void 0;
117
117
  }
118
118
  }
119
119
  }
120
- function tt(e) {
121
- return e.every((e) => et(e, {}) !== void 0);
122
- }
123
- function nt(e, t) {
124
- if (tt(e)) return e.findIndex((e) => et(e, t) === !0);
120
+ function nt(e) {
121
+ return e.every((e) => tt(e, {}) !== void 0);
125
122
  }
126
123
  function rt(e, t) {
124
+ if (nt(e)) return e.findIndex((e) => tt(e, t) === !0);
125
+ }
126
+ function it(e, t) {
127
127
  if (!R(e) || !Array.isArray(e.alternatives) || !R(t)) return;
128
- let n = nt(e.alternatives, t);
128
+ let n = rt(e.alternatives, t);
129
129
  if (n !== void 0) {
130
130
  if (e.kind === "firstMatch" && typeof e.index == "number") return n === e.index;
131
131
  if (e.kind === "otherwise") return n === -1;
132
132
  }
133
133
  }
134
- function it(e, t) {
135
- if (e.startsWith(Ye) && R(t)) return Xe(t, e.slice(5));
134
+ function at(e, t) {
135
+ if (e.startsWith(Xe) && R(t)) return Ze(t, e.slice(5));
136
+ }
137
+ //#endregion
138
+ //#region src/stageSession.ts
139
+ var ot = "stage.session.";
140
+ function st(e) {
141
+ try {
142
+ return globalThis.localStorage?.getItem(`stage.session.${e}`) || void 0;
143
+ } catch {
144
+ return;
145
+ }
146
+ }
147
+ function ct(e) {
148
+ let t = st(e);
149
+ if (t) return t;
150
+ let n = globalThis.crypto.randomUUID();
151
+ try {
152
+ globalThis.localStorage?.setItem(`${ot}${e}`, n);
153
+ } catch {}
154
+ return n;
155
+ }
156
+ function lt() {
157
+ let e = {};
158
+ try {
159
+ let t = globalThis.localStorage;
160
+ for (let n = 0; t && n < t.length; n++) {
161
+ let r = t.key(n) ?? "";
162
+ if (!r.startsWith("stage.session.")) continue;
163
+ let i = r.slice(14), a = t.getItem(r);
164
+ i && a && (e[i.charAt(0).toLowerCase() + i.slice(1)] = a);
165
+ }
166
+ } catch {}
167
+ return e;
136
168
  }
137
169
  //#endregion
138
170
  //#region src/stageData.tsx
139
- var at = "stage.session.", ot = "cratis.stage.data-changed", st = e({
171
+ var ut = "cratis.stage.data-changed", dt = e({
140
172
  locale: "",
141
173
  locales: [],
142
174
  screen: "",
143
175
  routes: void 0,
144
176
  routesReady: !0,
145
177
  parameters: {},
178
+ session: {},
146
179
  queries: {},
147
180
  selected: void 0,
148
181
  selections: {},
@@ -151,6 +184,7 @@ var at = "stage.session.", ot = "cratis.stage.data-changed", st = e({
151
184
  setState: () => void 0,
152
185
  setComponentOutput: () => void 0,
153
186
  publishComponentOutputs: () => void 0,
187
+ withdrawComponentOutputs: () => void 0,
154
188
  queryResults: {},
155
189
  refreshQuery: () => void 0,
156
190
  refreshAfterCommand: () => void 0,
@@ -158,13 +192,13 @@ var at = "stage.session.", ot = "cratis.stage.data-changed", st = e({
158
192
  resolveArgument: () => void 0,
159
193
  registerQueryResult: () => void 0,
160
194
  refreshVersion: 0
161
- }), ct = [
195
+ }), ft = [
162
196
  500,
163
197
  1500,
164
198
  3e3
165
- ], lt = {};
166
- function ut({ routes: e, routesReady: t = !0, parameters: r = lt, locale: c, locales: l, screen: u, children: d }) {
167
- let [f, p] = s({}), [m, _] = s(0), [v, y] = s({}), [x, S] = s(), [C, w] = s({}), [T, ee] = s({}), [E, te] = s({}), [D, ne] = s({ version: 0 }), re = n((e, t) => {
199
+ ], pt = {};
200
+ function mt({ routes: e, routesReady: t = !0, parameters: r = pt, locale: a, locales: l, screen: u, children: d }) {
201
+ let [f, p] = c({}), [m, h] = c(0), [v, y] = c({}), [b, S] = c(), [C, ee] = c({}), [w, te] = c({}), [ne, re] = c({}), [T, ie] = c({ version: 0 }), E = o(() => bt(ne), [ne]), ae = n((e, t) => {
168
202
  p((n) => {
169
203
  if (!t) {
170
204
  let { [e]: t, ...r } = n;
@@ -175,128 +209,146 @@ function ut({ routes: e, routesReady: t = !0, parameters: r = lt, locale: c, loc
175
209
  [e]: t
176
210
  };
177
211
  });
178
- }, []), O = a(() => ({
179
- ...yt(),
180
- ...r
181
- }), [r, m]), ie = n((e, t) => {
212
+ }, []), D = r, O = o(() => lt(), [m]), oe = o(() => ({
213
+ name: u,
214
+ keys: {
215
+ ...O,
216
+ ...r
217
+ }
218
+ }), [
219
+ r,
220
+ u,
221
+ O
222
+ ]), se = n((e, t) => {
182
223
  y((n) => ({
183
224
  ...n,
184
225
  [e]: t
185
226
  })), S(t ? e : (t) => t === e ? void 0 : t);
186
- }, []), ae = n((e) => {
227
+ }, []), ce = n((e) => {
187
228
  y((t) => ({
188
229
  ...t,
189
230
  [e]: void 0
190
231
  })), S((t) => t === e ? void 0 : t);
191
- }, []), oe = n((e, t, n) => {
192
- ee((r) => {
232
+ }, []), le = n((e, t, n) => {
233
+ te((r) => {
193
234
  let i = H(r[e]) ? r[e] : {};
194
235
  return {
195
236
  ...r,
196
- [e]: ht(i, t.split(".").filter(Boolean), n)
237
+ [e]: yt(i, t.split(".").filter(Boolean), n)
197
238
  };
198
239
  });
199
- }, []), k = n((e) => ne((t) => ({
240
+ }, []), k = n((e) => ie((t) => ({
200
241
  query: e,
201
242
  version: t.version + 1
202
- })), []), se = o([]), ce = n(() => {
203
- _((e) => e + 1), k();
204
- for (let e of ct) se.current.push(setTimeout(() => k(), e));
243
+ })), []), ue = s([]), A = n(() => {
244
+ h((e) => e + 1), k();
245
+ for (let e of ft) ue.current.push(setTimeout(() => k(), e));
205
246
  }, [k]);
206
- i(() => () => se.current.forEach(clearTimeout), []), i(() => {
247
+ i(() => () => ue.current.forEach(clearTimeout), []), i(() => {
207
248
  let e = () => k(), t = (e) => k(e.detail?.query);
208
- return globalThis.addEventListener(ot, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
209
- globalThis.removeEventListener(ot, e), globalThis.removeEventListener("cratis.scene.refresh", t);
249
+ return globalThis.addEventListener(ut, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
250
+ globalThis.removeEventListener(ut, e), globalThis.removeEventListener("cratis.scene.refresh", t);
210
251
  };
211
252
  }, [k]);
212
- let A = x ? v[x] : void 0, j = n((e) => {
253
+ let j = b ? v[b] : void 0, de = n((e) => {
213
254
  if (e === void 0 || typeof e != "string" && e.path === "$guard") return;
214
- if (typeof e == "string") return gt(e, A, v, f, C, O, u, c, l);
215
- let t = ft(A, f, C, {
255
+ if (typeof e == "string") return xt(e, j, v, f, C, D, oe, a, l);
256
+ let t = gt(j, f, C, {
216
257
  ...E,
217
- ...T
258
+ ...w
218
259
  }, v);
219
- if (!e.kind && e.path.startsWith("component.")) return g(e.path, t);
220
- if (!e.kind) return gt(e.path, A, v, f, C, O, u, c, l);
221
- let n = b(e, t);
222
- return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), h(t)(e);
260
+ if (!e.kind && e.path.startsWith("component.")) return _(e.path, t);
261
+ if (!e.kind) return xt(e.path, j, v, f, C, D, oe, a, l);
262
+ let n = x(e, t);
263
+ return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), g(t)(e);
223
264
  }, [
224
- T,
225
- c,
265
+ w,
266
+ a,
226
267
  l,
227
268
  C,
228
- O,
269
+ D,
229
270
  E,
230
271
  f,
231
- u,
232
- A,
272
+ oe,
273
+ j,
233
274
  v
234
- ]), M = n((e) => e ? g(e, ft(A, f, C, {
275
+ ]), M = n((e) => e ? _(e, gt(j, f, C, {
235
276
  ...E,
236
- ...T
277
+ ...w
237
278
  }, v)) : void 0, [
238
- T,
279
+ w,
239
280
  C,
240
281
  E,
241
282
  f,
242
- A,
283
+ j,
243
284
  v
244
- ]), le = n((e) => te(e), []), N = a(() => ft(void 0, f, {}, {}, {}).queryResults, [f]), ue = a(() => ({
245
- locale: c,
285
+ ]), fe = n((e, t) => re((n) => ({
286
+ ...n,
287
+ [e]: t
288
+ })), []), pe = n((e) => re((t) => {
289
+ if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
290
+ let n = { ...t };
291
+ return delete n[e], n;
292
+ }), []), me = o(() => gt(void 0, f, {}, {}, {}).queryResults, [f]), he = o(() => ({
293
+ locale: a,
246
294
  locales: l,
247
295
  screen: u,
248
296
  routes: e,
249
297
  routesReady: t,
250
- parameters: O,
298
+ parameters: D,
299
+ session: O,
251
300
  queries: f,
252
- selected: A,
301
+ selected: j,
253
302
  selections: v,
254
- selectRow: ie,
255
- clearSelection: ae,
256
- setState: (e, t) => w((n) => ht(n, e.split(".").filter(Boolean), t)),
257
- setComponentOutput: oe,
258
- publishComponentOutputs: le,
259
- queryResults: N,
303
+ selectRow: se,
304
+ clearSelection: ce,
305
+ setState: (e, t) => ee((n) => yt(n, e.split(".").filter(Boolean), t)),
306
+ setComponentOutput: le,
307
+ publishComponentOutputs: fe,
308
+ withdrawComponentOutputs: pe,
309
+ queryResults: me,
260
310
  refreshQuery: k,
261
- refreshAfterCommand: ce,
262
- resolveBinding: j,
311
+ refreshAfterCommand: A,
312
+ resolveBinding: de,
263
313
  resolveArgument: M,
264
- registerQueryResult: re,
265
- refreshVersion: D.version,
266
- refreshQueryName: D.query
314
+ registerQueryResult: ae,
315
+ refreshVersion: T.version,
316
+ refreshQueryName: T.query
267
317
  }), [
268
- ae,
269
- c,
318
+ ce,
319
+ a,
270
320
  l,
271
321
  f,
272
- ce,
322
+ A,
273
323
  k,
274
- D.query,
275
- D.version,
276
- re,
277
- le,
278
- N,
324
+ T.query,
325
+ T.version,
326
+ ae,
327
+ fe,
328
+ pe,
329
+ me,
279
330
  M,
280
- j,
331
+ de,
281
332
  e,
282
333
  t,
334
+ D,
283
335
  O,
284
336
  u,
285
- ie,
286
- A,
337
+ se,
338
+ j,
287
339
  v,
288
- oe
340
+ le
289
341
  ]);
290
- return /* @__PURE__ */ F(st.Provider, {
291
- value: ue,
342
+ return /* @__PURE__ */ P(dt.Provider, {
343
+ value: he,
292
344
  children: d
293
345
  });
294
346
  }
295
- var z = () => r(st);
347
+ var z = () => r(dt);
296
348
  function B(e) {
297
- let { refreshQueryName: t, refreshVersion: r, registerQueryResult: a } = z(), c = e.publish !== !1, l = n((e, t) => {
298
- c && a(e, t);
299
- }, [c, a]), [u, d] = s([]), [f, p] = s(""), [m, h] = s(!1), [g, _] = s(0), v = o(0), y = o(!1), b = e.ready ?? !0, x = !!e.route && b, S = JSON.stringify(e.arguments ?? {});
349
+ let { refreshQueryName: t, refreshVersion: r, registerQueryResult: a } = z(), o = e.publish !== !1, l = n((e, t) => {
350
+ o && a(e, t);
351
+ }, [o, a]), [u, d] = c([]), [f, p] = c(""), [m, h] = c(!1), [g, _] = c(0), v = s(0), y = s(!1), b = e.ready ?? !0, x = !!e.route && b, S = JSON.stringify(e.arguments ?? {});
300
352
  return i(() => {
301
353
  if (!x || !e.route) {
302
354
  v.current += 1, d([]), p(""), h(!1), l(e.scope, void 0);
@@ -304,7 +356,7 @@ function B(e) {
304
356
  }
305
357
  let t = v.current + 1;
306
358
  v.current = t;
307
- let n = new AbortController(), r = JSON.parse(S), i = bt(e.route, r);
359
+ let n = new AbortController(), r = JSON.parse(S), i = wt(e.route, r);
308
360
  h(!0), p("");
309
361
  let a = () => {
310
362
  fetch(i, {
@@ -314,36 +366,36 @@ function B(e) {
314
366
  if (!e.ok) throw Error(`The query answered ${e.status}.`);
315
367
  return e.json();
316
368
  }).then((e) => {
317
- v.current !== t || n.signal.aborted || (d(Et(e)), p(""));
369
+ v.current !== t || n.signal.aborted || (d(At(e)), p(""));
318
370
  }).catch((e) => {
319
371
  v.current !== t || n.signal.aborted || (d([]), p(e instanceof Error ? e.message : String(e)));
320
372
  }).finally(() => {
321
373
  v.current === t && !n.signal.aborted && h(!1);
322
374
  });
323
375
  };
324
- if (Ct(e.route)) {
376
+ if (Dt(e.route)) {
325
377
  y.current = !0;
326
- let e = new we(new URL(wt(i), globalThis.location.href)), r = !1, o = () => {
378
+ let e = new Ee(new URL(Ot(i), globalThis.location.href)), r = !1, o = () => {
327
379
  r || v.current !== t || n.signal.aborted || (r = !0, y.current = !1, e.disconnect(), a());
328
- }, s = Ce.eventSourceFactory;
380
+ }, s = Te.eventSourceFactory;
329
381
  if (!s && typeof EventSource > "u") o();
330
382
  else {
331
383
  let r;
332
- Ce.eventSourceFactory = (e) => r = s ? s(e) : new EventSource(e);
384
+ Te.eventSourceFactory = (e) => r = s ? s(e) : new EventSource(e);
333
385
  try {
334
386
  e.connect((e) => {
335
387
  if (v.current !== t || n.signal.aborted) return;
336
- let r = Tt(e);
337
- r ? (d([]), p(r)) : (d(Et(e)), p("")), h(!1);
388
+ let r = kt(e);
389
+ r ? (d([]), p(r)) : (d(At(e)), p("")), h(!1);
338
390
  });
339
391
  } finally {
340
- Ce.eventSourceFactory = s;
392
+ Te.eventSourceFactory = s;
341
393
  }
342
394
  let i = r;
343
395
  if (i) {
344
396
  let e = i.onerror;
345
397
  i.onerror = function(t) {
346
- e?.call(this, t), i.readyState === St && o();
398
+ e?.call(this, t), i.readyState === Et && o();
347
399
  };
348
400
  } else o();
349
401
  }
@@ -403,29 +455,29 @@ function B(e) {
403
455
  }
404
456
  };
405
457
  }
406
- function dt() {
407
- globalThis.dispatchEvent(new CustomEvent(ot));
458
+ function ht() {
459
+ globalThis.dispatchEvent(new CustomEvent(ut));
408
460
  }
409
- function ft(e, t, n, r, i) {
461
+ function gt(e, t, n, r, i) {
410
462
  let a = Object.entries(t).sort(([, e], [, t]) => Number(e.list === !0) - Number(t.list === !0));
411
463
  return {
412
464
  dataContext: e,
413
465
  queryResults: Object.fromEntries(a.flatMap(([e, t]) => {
414
- let n = t.list ? t.rows : pt(t.rows);
466
+ let n = t.list ? t.rows : _t(t.rows);
415
467
  return [
416
468
  [e, n],
417
469
  ...t.name ? [[t.name, n]] : [],
418
470
  ...t.alias ? [[t.alias, n]] : []
419
471
  ];
420
472
  })),
421
- componentOutputs: mt(r, i),
473
+ componentOutputs: vt(r, i),
422
474
  state: n
423
475
  };
424
476
  }
425
- function pt(e) {
477
+ function _t(e) {
426
478
  return e.length === 1 ? e[0] : e;
427
479
  }
428
- function mt(e, t) {
480
+ function vt(e, t) {
429
481
  let n = { ...e };
430
482
  for (let [e, r] of Object.entries(t)) r && (n[e] = {
431
483
  ...r,
@@ -433,61 +485,56 @@ function mt(e, t) {
433
485
  });
434
486
  return n;
435
487
  }
436
- function ht(e, t, n) {
488
+ function yt(e, t, n) {
437
489
  let [r, ...i] = t;
438
490
  return r ? i.length === 0 ? {
439
491
  ...e,
440
492
  [r]: n
441
493
  } : {
442
494
  ...e,
443
- [r]: ht(H(e[r]) ? e[r] : {}, i, n)
495
+ [r]: yt(H(e[r]) ? e[r] : {}, i, n)
444
496
  } : e;
445
497
  }
446
- function gt(e, t, n, r, i, a, o, s, c) {
498
+ function bt(e) {
499
+ let t = {};
500
+ for (let n of Object.values(e)) for (let [e, r] of Object.entries(n)) t[e] = {
501
+ ...t[e],
502
+ ...r
503
+ };
504
+ return t;
505
+ }
506
+ function xt(e, t, n, r, i, a, o, s, c) {
447
507
  if (!e) return;
448
508
  let l = e.replace(/^\$\.?/, "").split(".").filter(Boolean);
449
- if (l.length !== 0) return l[0] === "screen" ? l.length === 1 ? { name: o } : V({ name: o }, l.slice(1)) : l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? vt(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? _t(l.slice(1).join("."), t, n) : l[0] === "state" ? V(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : V(t, l) ?? vt(r, void 0, l.join(".")) ?? V(i, l);
509
+ if (l.length !== 0) return l[0] === "screen" ? l.length === 1 ? { name: o.name } : V(o, l.slice(1)) : l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Ct(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? St(l.slice(1).join("."), t, n) : l[0] === "state" ? V(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : V(t, l) ?? Ct(r, void 0, l.join(".")) ?? V(i, l);
450
510
  }
451
- function _t(e, t, n) {
511
+ function St(e, t, n) {
452
512
  let r = e?.split(".").filter(Boolean) ?? [];
453
513
  return r.length > 0 && Object.hasOwn(n, r[0]) ? V(n[r[0]], r.slice(1)) : r.length === 0 ? t : V(t, r);
454
514
  }
455
- function vt(e, t, n) {
515
+ function Ct(e, t, n) {
456
516
  let r = Object.entries(e).filter(([e, n]) => t ? n.name === t || e === t : !n.list).map(([, e]) => e.rows);
457
517
  if (r.length === 0) return;
458
518
  let i = r.flat(), a = n?.split(".").filter(Boolean) ?? [];
459
519
  return a.length === 0 ? i : i.length === 1 ? V(i[0], a) : i.map((e) => V(e, a));
460
520
  }
461
- function yt() {
462
- let e = {};
463
- try {
464
- let t = globalThis.localStorage;
465
- for (let n = 0; t && n < t.length; n++) {
466
- let r = t.key(n) ?? "";
467
- if (!r.startsWith("stage.session.")) continue;
468
- let i = r.slice(14), a = t.getItem(r);
469
- i && a && (e[i.charAt(0).toLowerCase() + i.slice(1)] = a);
470
- }
471
- } catch {}
472
- return e;
473
- }
474
- function bt(e, t) {
521
+ function wt(e, t) {
475
522
  let [n, r = ""] = e.replace(/^\//, "").split("?"), i = new URLSearchParams(r);
476
523
  for (let [e, n] of Object.entries(t)) n != null && n !== "" && i.set(e, String(n));
477
524
  let a = i.toString();
478
525
  return a ? `${n}?${a}` : n;
479
526
  }
480
- var xt = "waitForFirstResult", St = 2;
481
- function Ct(e) {
482
- return new URLSearchParams(e.split("?")[1] ?? "").get(xt) === "true";
527
+ var Tt = "waitForFirstResult", Et = 2;
528
+ function Dt(e) {
529
+ return new URLSearchParams(e.split("?")[1] ?? "").get(Tt) === "true";
483
530
  }
484
- function wt(e) {
531
+ function Ot(e) {
485
532
  let [t, n = ""] = e.split("?"), r = new URLSearchParams(n);
486
- r.delete(xt);
533
+ r.delete(Tt);
487
534
  let i = r.toString();
488
535
  return i ? `${t}?${i}` : t;
489
536
  }
490
- function Tt(e) {
537
+ function kt(e) {
491
538
  if (!H(e)) return "";
492
539
  if (e.isAuthorized === !1) return "The query answered 403.";
493
540
  if (e.isValid === !1 || e.hasExceptions === !0) {
@@ -496,7 +543,7 @@ function Tt(e) {
496
543
  }
497
544
  return "";
498
545
  }
499
- function Et(e) {
546
+ function At(e) {
500
547
  let t = H(e) && "data" in e ? e.data : e;
501
548
  return Array.isArray(t) ? t.filter(H) : H(t) ? [t] : [];
502
549
  }
@@ -512,6 +559,12 @@ function H(e) {
512
559
  return typeof e == "object" && !!e && !Array.isArray(e);
513
560
  }
514
561
  //#endregion
562
+ //#region src/stageComponentOutputs.ts
563
+ function jt() {
564
+ let e = a(), { publishComponentOutputs: t, withdrawComponentOutputs: r } = z();
565
+ return i(() => () => r(e), [e, r]), n((n) => t(e, n), [t, e]);
566
+ }
567
+ //#endregion
515
568
  //#region src/commandExecutor.ts
516
569
  function U(e, t, n) {
517
570
  for (let r of [
@@ -520,14 +573,14 @@ function U(e, t, n) {
520
573
  e
521
574
  ]) {
522
575
  if (!r) continue;
523
- let t = Me(r);
524
- if (Dt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
576
+ let t = Pe(r);
577
+ if (Mt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
525
578
  }
526
579
  }
527
- function Dt(e) {
528
- return typeof e == "function" && e.prototype instanceof je;
580
+ function Mt(e) {
581
+ return typeof e == "function" && e.prototype instanceof Ne;
529
582
  }
530
- function Ot() {
583
+ function Nt() {
531
584
  let e = globalThis.document?.baseURI ?? globalThis.location?.href;
532
585
  if (!e) return "";
533
586
  try {
@@ -536,7 +589,7 @@ function Ot() {
536
589
  return "";
537
590
  }
538
591
  }
539
- async function kt(e, t, n) {
592
+ async function Pt(e, t, n) {
540
593
  let r = U(e);
541
594
  if (!r) return {
542
595
  isSuccess: !1,
@@ -544,11 +597,11 @@ async function kt(e, t, n) {
544
597
  messages: [`The modeled command “${e}” is not registered by this Stage.`]
545
598
  };
546
599
  let i = new r();
547
- i.setMicroservice(n.microservice), i.setApiBasePath(n.apiBasePath ?? Ot()), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
600
+ i.setMicroservice(n.microservice), i.setApiBasePath(n.apiBasePath || Nt()), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
548
601
  for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
549
- return At(e, await i.execute());
602
+ return Ft(e, await i.execute());
550
603
  }
551
- function At(e, t) {
604
+ function Ft(e, t) {
552
605
  let n = t.isSuccess && t.isAuthorized && t.isValid && !t.hasExceptions, r = t.isValid ? [] : t.validationResults.flatMap((e) => (e.members.length > 0 ? e.members : [""]).map((t) => ({
553
606
  member: t,
554
607
  message: e.message
@@ -564,52 +617,53 @@ function At(e, t) {
564
617
  messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
565
618
  };
566
619
  }
567
- function jt() {
568
- let e = r(Ae);
569
- return n((t, n) => kt(t, n, e), [e]);
620
+ function It() {
621
+ let e = r(Me);
622
+ return n((t, n) => Pt(t, n, e), [e]);
570
623
  }
571
624
  //#endregion
572
625
  //#region src/stageNavigation.ts
573
- function Mt(e, t = {}) {
626
+ function Lt(e, t = {}) {
574
627
  let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
575
628
  return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
576
629
  }
577
630
  function W(e, t = {}) {
578
631
  if (!globalThis.location) return;
579
- let n = Mt(e, t);
632
+ let n = Lt(e, t);
580
633
  globalThis.location.hash !== n && (globalThis.location.hash = n);
581
634
  }
582
- function Nt(e) {
635
+ function Rt(e) {
583
636
  return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && typeof e != "object").map(([e, t]) => [e, String(t)]));
584
637
  }
585
638
  //#endregion
586
639
  //#region src/stageFormSchema.ts
587
- var Pt = 8;
588
- function Ft(e) {
640
+ var zt = 8;
641
+ function Bt(e) {
589
642
  if (!e) return [];
590
643
  try {
591
- return It(JSON.parse(e), 0);
644
+ return Vt(JSON.parse(e), 0);
592
645
  } catch {
593
646
  return [];
594
647
  }
595
648
  }
596
- function It(e, t) {
597
- let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i = Wt(e.properties) ? e.properties : {};
598
- return Object.entries(i).map(([e, i]) => Lt(e, i, !n || r.has(e), t));
649
+ function Vt(e, t) {
650
+ let n = Object.prototype.hasOwnProperty.call(e, "required"), r = Array.isArray(e.required) ? new Set(e.required.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set(), i = Yt(e.properties) ? e.properties : {};
651
+ return Object.entries(i).map(([e, i]) => Ht(e, i, !n || r.has(e), t));
599
652
  }
600
- function Lt(e, t, n, r) {
653
+ function Ht(e, t, n, r) {
601
654
  return {
602
655
  name: e,
603
656
  identifier: t?.format === "uuid" && typeof t["x-concept"] == "string" ? t["x-concept"] : void 0,
657
+ ...t?.["x-identity"] === !0 ? { identity: !0 } : {},
604
658
  required: n,
605
- ...Rt(t, r)
659
+ ...Ut(t, r)
606
660
  };
607
661
  }
608
- function Rt(e, t) {
662
+ function Ut(e, t) {
609
663
  let n = e?.type;
610
664
  if (Array.isArray(n)) {
611
665
  let r = n.filter((e) => e !== "null");
612
- return r.length === 1 ? Rt({
666
+ return r.length === 1 ? Ut({
613
667
  ...e,
614
668
  type: r[0]
615
669
  }, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
@@ -620,8 +674,8 @@ function Rt(e, t) {
620
674
  type: "date",
621
675
  withTime: e.format === "date-time"
622
676
  };
623
- if (n === "array") return zt(e, t);
624
- if (n === "object") return Bt(e, t);
677
+ if (n === "array") return Wt(e, t);
678
+ if (n === "object") return Gt(e, t);
625
679
  if (n === void 0 || n === "string") {
626
680
  let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
627
681
  return t.length > 0 ? {
@@ -631,54 +685,54 @@ function Rt(e, t) {
631
685
  }
632
686
  return { unsupportedReason: `type ${String(n)}` };
633
687
  }
634
- function zt(e, t) {
688
+ function Wt(e, t) {
635
689
  let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
636
- if (t >= Pt || e?.items === void 0) return n;
637
- let r = Lt("", e.items, !0, t + 1);
690
+ if (t >= zt || e?.items === void 0) return n;
691
+ let r = Ht("", e.items, !0, t + 1);
638
692
  return r.unsupportedReason || r.item ? n : { item: r };
639
693
  }
640
- function Bt(e, t) {
694
+ function Gt(e, t) {
641
695
  let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
642
- if (t >= Pt || !Wt(e?.properties) || Object.keys(e.properties).length === 0) return n;
643
- let r = It(e, t + 1), i = r.find((e) => e.unsupportedReason);
696
+ if (t >= zt || !Yt(e?.properties) || Object.keys(e.properties).length === 0) return n;
697
+ let r = Vt(e, t + 1), i = r.find((e) => e.unsupportedReason);
644
698
  return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
645
699
  }
646
700
  function G(e) {
647
701
  let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase();
648
702
  return t.charAt(0).toUpperCase() + t.slice(1);
649
703
  }
650
- function Vt(e, t, n) {
704
+ function Kt(e, t, n) {
651
705
  if (t != null) {
652
- if (e.members && Wt(t)) for (let r of e.members) {
706
+ if (e.members && Yt(t)) for (let r of e.members) {
653
707
  let e = t[r.name], i = G(r.name);
654
- if (Ht(e)) {
708
+ if (qt(e)) {
655
709
  if (r.required) return `${n}: ${i} is required`;
656
710
  continue;
657
711
  }
658
- let a = Vt(r, e, `${n} ${i.toLowerCase()}`);
712
+ let a = Kt(r, e, `${n} ${i.toLowerCase()}`);
659
713
  if (a) return a;
660
714
  }
661
715
  if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
662
- let t = Ht(i) ? `${n} ${r + 1} is required` : Vt(e.item, i, `${n} ${r + 1}`);
716
+ let t = qt(i) ? `${n} ${r + 1} is required` : Kt(e.item, i, `${n} ${r + 1}`);
663
717
  if (t) return t;
664
718
  }
665
719
  }
666
720
  }
667
- function Ht(e) {
721
+ function qt(e) {
668
722
  return e == null || e === "";
669
723
  }
670
- function Ut(e, t) {
671
- return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members && Wt(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
724
+ function Jt(e, t) {
725
+ return t == null ? t : e.options ? typeof t == "number" ? e.options[t] ?? t : typeof t == "string" ? e.options.find((e) => e.toLowerCase() === t.toLowerCase()) ?? t : t : e.members && Yt(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
672
726
  let r = e.members?.find((e) => e.name === t);
673
- return [t, r ? Ut(r, n) : n];
674
- })) : e.item && Array.isArray(t) ? t.map((t) => Ut(e.item, t)) : t;
727
+ return [t, r ? Jt(r, n) : n];
728
+ })) : e.item && Array.isArray(t) ? t.map((t) => Jt(e.item, t)) : t;
675
729
  }
676
- function Wt(e) {
730
+ function Yt(e) {
677
731
  return typeof e == "object" && !!e && !Array.isArray(e);
678
732
  }
679
733
  //#endregion
680
734
  //#region src/StageValueFields.tsx
681
- var Gt = Pe((e) => /* @__PURE__ */ F(Kt, {
735
+ var Xt = Ie((e) => /* @__PURE__ */ P(Zt, {
682
736
  descriptor: e.descriptor,
683
737
  label: e.title ?? G(e.descriptor.name),
684
738
  value: e.value,
@@ -686,22 +740,22 @@ var Gt = Pe((e) => /* @__PURE__ */ F(Kt, {
686
740
  onBlur: e.onBlur,
687
741
  invalid: e.invalid
688
742
  }), { defaultValue: void 0 });
689
- function Kt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
690
- return e.members ? /* @__PURE__ */ F(qt, {
743
+ function Zt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
744
+ return e.members ? /* @__PURE__ */ P(Qt, {
691
745
  descriptor: e,
692
746
  label: t,
693
747
  value: n,
694
748
  onChange: r,
695
749
  onBlur: i,
696
750
  invalid: a
697
- }) : e.item ? /* @__PURE__ */ F(Jt, {
751
+ }) : e.item ? /* @__PURE__ */ P($t, {
698
752
  descriptor: e,
699
753
  label: t,
700
754
  value: n,
701
755
  onChange: r,
702
756
  onBlur: i,
703
757
  invalid: a
704
- }) : /* @__PURE__ */ F(Yt, {
758
+ }) : /* @__PURE__ */ P(en, {
705
759
  descriptor: e,
706
760
  label: t,
707
761
  value: n,
@@ -710,12 +764,12 @@ function Kt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
710
764
  invalid: a
711
765
  });
712
766
  }
713
- function qt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
714
- let o = Qt(n) ? n : {};
715
- return /* @__PURE__ */ I("fieldset", {
767
+ function Qt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
768
+ let o = rn(n) ? n : {};
769
+ return /* @__PURE__ */ F("fieldset", {
716
770
  className: "stage-record-field",
717
771
  "data-invalid": a ? "true" : void 0,
718
- children: [/* @__PURE__ */ F("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ F(Kt, {
772
+ children: [/* @__PURE__ */ P("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ P(Zt, {
719
773
  descriptor: e,
720
774
  label: G(e.name),
721
775
  value: o[e.name],
@@ -727,74 +781,74 @@ function qt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
727
781
  }, e.name))]
728
782
  });
729
783
  }
730
- function Jt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
784
+ function $t({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
731
785
  let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
732
- return /* @__PURE__ */ I("fieldset", {
786
+ return /* @__PURE__ */ F("fieldset", {
733
787
  className: "stage-list-field",
734
788
  "data-invalid": a ? "true" : void 0,
735
789
  children: [
736
- /* @__PURE__ */ F("legend", { children: t }),
737
- s.length === 0 && /* @__PURE__ */ F("p", {
790
+ /* @__PURE__ */ P("legend", { children: t }),
791
+ s.length === 0 && /* @__PURE__ */ P("p", {
738
792
  className: "stage-note",
739
793
  children: "Nothing added yet."
740
794
  }),
741
- s.map((e, n) => /* @__PURE__ */ I("div", {
795
+ s.map((e, n) => /* @__PURE__ */ F("div", {
742
796
  className: "stage-list-field__row",
743
- children: [/* @__PURE__ */ F(Kt, {
797
+ children: [/* @__PURE__ */ P(Zt, {
744
798
  descriptor: o,
745
799
  label: `${t} ${n + 1}`,
746
800
  value: e,
747
801
  onBlur: i,
748
802
  onChange: (e) => c(s.map((t, r) => r === n ? e : t))
749
- }), /* @__PURE__ */ F("button", {
803
+ }), /* @__PURE__ */ P("button", {
750
804
  type: "button",
751
805
  "aria-label": `Remove ${t} ${n + 1}`,
752
806
  onClick: () => c(s.filter((e, t) => t !== n)),
753
807
  children: "Remove"
754
808
  })]
755
809
  }, n)),
756
- /* @__PURE__ */ F("button", {
810
+ /* @__PURE__ */ P("button", {
757
811
  type: "button",
758
812
  "aria-label": `Add ${t}`,
759
- onClick: () => c([...s, Xt(o)]),
813
+ onClick: () => c([...s, tn(o)]),
760
814
  children: "Add"
761
815
  })
762
816
  ]
763
817
  });
764
818
  }
765
- function Yt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
819
+ function en({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
766
820
  let o = {
767
821
  "aria-invalid": a ? !0 : void 0,
768
822
  onBlur: i
769
823
  };
770
- if (e.options) return /* @__PURE__ */ I("label", {
824
+ if (e.options) return /* @__PURE__ */ F("label", {
771
825
  className: "stage-value-field",
772
- children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ I("select", {
826
+ children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ F("select", {
773
827
  ...o,
774
828
  value: typeof n == "string" ? n : "",
775
829
  onChange: (e) => r(e.target.value === "" ? void 0 : e.target.value),
776
- children: [/* @__PURE__ */ F("option", {
830
+ children: [/* @__PURE__ */ P("option", {
777
831
  value: "",
778
832
  children: ""
779
- }), e.options.map((e) => /* @__PURE__ */ F("option", {
833
+ }), e.options.map((e) => /* @__PURE__ */ P("option", {
780
834
  value: e,
781
835
  children: G(e)
782
836
  }, e))]
783
837
  })]
784
838
  });
785
839
  switch (e.type) {
786
- case "boolean": return /* @__PURE__ */ I("label", {
840
+ case "boolean": return /* @__PURE__ */ F("label", {
787
841
  className: "stage-value-field stage-value-field--check",
788
- children: [/* @__PURE__ */ F("input", {
842
+ children: [/* @__PURE__ */ P("input", {
789
843
  ...o,
790
844
  type: "checkbox",
791
845
  checked: n === !0,
792
846
  onChange: (e) => r(e.target.checked)
793
- }), /* @__PURE__ */ F("span", { children: t })]
847
+ }), /* @__PURE__ */ P("span", { children: t })]
794
848
  });
795
- case "number": return /* @__PURE__ */ I("label", {
849
+ case "number": return /* @__PURE__ */ F("label", {
796
850
  className: "stage-value-field",
797
- children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
851
+ children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ P("input", {
798
852
  ...o,
799
853
  type: "number",
800
854
  step: "any",
@@ -802,18 +856,18 @@ function Yt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
802
856
  onChange: (e) => r(e.target.value === "" ? void 0 : Number(e.target.value))
803
857
  })]
804
858
  });
805
- case "date": return /* @__PURE__ */ I("label", {
859
+ case "date": return /* @__PURE__ */ F("label", {
806
860
  className: "stage-value-field",
807
- children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
861
+ children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ P("input", {
808
862
  ...o,
809
863
  type: e.withTime ? "datetime-local" : "date",
810
864
  value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
811
- onChange: (t) => r(t.target.value === "" ? void 0 : Zt(t.target.value, e.withTime === !0))
865
+ onChange: (t) => r(t.target.value === "" ? void 0 : nn(t.target.value, e.withTime === !0))
812
866
  })]
813
867
  });
814
- default: return /* @__PURE__ */ I("label", {
868
+ default: return /* @__PURE__ */ F("label", {
815
869
  className: "stage-value-field",
816
- children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
870
+ children: [/* @__PURE__ */ P("span", { children: t }), /* @__PURE__ */ P("input", {
817
871
  ...o,
818
872
  type: "text",
819
873
  value: typeof n == "string" ? n : "",
@@ -822,114 +876,114 @@ function Yt({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
822
876
  });
823
877
  }
824
878
  }
825
- function Xt(e) {
879
+ function tn(e) {
826
880
  return e.members ? {} : void 0;
827
881
  }
828
- function Zt(e, t) {
882
+ function nn(e, t) {
829
883
  if (!t) return e;
830
884
  let n = new Date(e);
831
885
  return Number.isNaN(n.getTime()) ? e : n.toISOString();
832
886
  }
833
- function Qt(e) {
887
+ function rn(e) {
834
888
  return typeof e == "object" && !!e && !Array.isArray(e);
835
889
  }
836
890
  //#endregion
837
891
  //#region src/StageCommandForm.tsx
838
- var $t = e(void 0);
839
- function en({ element: e }) {
840
- let t = z(), n = r($t), i = a(() => nn(e), [e]), o = a(() => wn(e), [e]), c = typeof e.properties.schema == "string", l = a(() => i ? rn(i, o) : [], [i, o]), u = i ? U(i.command, q(e, "typeName"), q(e, "route")) : void 0, d = pn(e, l, t.resolveArgument), f = dn(e, o, t), p = JSON.stringify(f ?? null), m = a(() => f, [p]), h = a(() => ({
892
+ var an = e(void 0);
893
+ function on({ element: e }) {
894
+ let t = z(), n = r(an), i = o(() => cn(e), [e]), a = o(() => An(e), [e]), s = typeof e.properties.schema == "string", l = o(() => i ? ln(i, a) : [], [i, a]), u = i ? U(i.command, q(e, "typeName"), q(e, "route")) : void 0, d = yn(e, l, t.resolveArgument), f = _n(e, a, t), p = JSON.stringify(f ?? null), m = o(() => f, [p]), h = o(() => ({
841
895
  ...m,
842
- ...cn(l, o, t.parameters),
843
- ...sn(l, t.parameters)
896
+ ...pn(l, a, t.parameters),
897
+ ...fn(l, t.parameters)
844
898
  }), [
845
899
  m,
846
900
  l,
847
- o,
901
+ a,
848
902
  t.parameters
849
- ]), g = a(() => i ? an(i, l, o) : void 0, [
903
+ ]), g = o(() => i ? un(i, l, a) : void 0, [
850
904
  i,
851
905
  l,
852
- o
853
- ]), _ = a(() => i ? Sn(l, o) : [], [
906
+ a
907
+ ]), _ = o(() => i ? On(l, a) : [], [
854
908
  i,
855
909
  l,
856
- o
857
- ]), v = a(() => i ? Cn(i.layout, l) : [], [i, l]), [y, b] = s([]);
858
- return i ? !u && !t.routesReady ? /* @__PURE__ */ I("p", {
910
+ a
911
+ ]), v = o(() => i ? kn(i.layout, l) : [], [i, l]), [y, b] = c([]);
912
+ return i ? !u && !t.routesReady ? /* @__PURE__ */ F("p", {
859
913
  className: "stage-note",
860
914
  children: [
861
915
  "The modeled command “",
862
916
  i.command,
863
917
  "” is waiting for Stage routes."
864
918
  ]
865
- }) : u ? l.length === 0 && !c && e.properties.parameterless !== !0 ? /* @__PURE__ */ F(tn, {
919
+ }) : u ? l.length === 0 && !s && e.properties.parameterless !== !0 ? /* @__PURE__ */ P(sn, {
866
920
  form: i,
867
921
  messages: [`The modeled command “${i.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
868
- }) : _.length > 0 ? /* @__PURE__ */ F(tn, {
922
+ }) : _.length > 0 ? /* @__PURE__ */ P(sn, {
869
923
  form: i,
870
924
  messages: _
871
- }) : /* @__PURE__ */ F("section", {
925
+ }) : /* @__PURE__ */ P("section", {
872
926
  className: "stage-command-form",
873
927
  "data-command": i.command,
874
928
  "data-generation-mode": i.generationMode,
875
- children: /* @__PURE__ */ I(Ne, {
929
+ children: /* @__PURE__ */ F(Fe, {
876
930
  command: u,
877
931
  initialValues: h,
878
932
  currentValues: d,
879
933
  validateOn: "both",
880
934
  validateAllFieldsOnChange: !0,
881
- onFieldValidate: (e, t, n, r) => xn(l, o, t, r),
935
+ onFieldValidate: (e, t, n, r) => Dn(l, a, t, r),
882
936
  onValidationFailure: (e) => b(e.map((e) => e.message)),
883
937
  onException: (e) => b(e),
884
- onFailed: (e) => b(At(i.command, e).messages),
938
+ onFailed: (e) => b(Ft(i.command, e).messages),
885
939
  onSuccess: () => {
886
940
  b([]), t.refreshAfterCommand();
887
941
  let r = q(e, "navigateToScreen");
888
942
  r && W(r, {}), n?.();
889
943
  },
890
944
  children: [
891
- v.map((e) => /* @__PURE__ */ F("p", {
945
+ v.map((e) => /* @__PURE__ */ P("p", {
892
946
  role: "alert",
893
947
  className: "stage-form-error",
894
948
  children: e
895
949
  }, e)),
896
950
  g,
897
- y.map((e) => /* @__PURE__ */ F("p", {
951
+ y.map((e) => /* @__PURE__ */ P("p", {
898
952
  role: "alert",
899
953
  className: "stage-form-error",
900
954
  children: e
901
955
  }, e)),
902
- /* @__PURE__ */ I("button", {
956
+ /* @__PURE__ */ F("button", {
903
957
  type: "submit",
904
958
  children: ["Execute ", i.label]
905
959
  })
906
960
  ]
907
961
  }, p)
908
- }) : /* @__PURE__ */ I("p", {
962
+ }) : /* @__PURE__ */ F("p", {
909
963
  className: "stage-note",
910
964
  children: [
911
965
  "The modeled command “",
912
966
  i.command,
913
967
  "” is not registered by this Stage."
914
968
  ]
915
- }) : /* @__PURE__ */ F("p", {
969
+ }) : /* @__PURE__ */ P("p", {
916
970
  className: "stage-note",
917
971
  children: "This form is missing its command metadata."
918
972
  });
919
973
  }
920
- function tn({ form: e, messages: t }) {
921
- return /* @__PURE__ */ F("section", {
974
+ function sn({ form: e, messages: t }) {
975
+ return /* @__PURE__ */ P("section", {
922
976
  className: "stage-command-form",
923
977
  "data-command": e.command,
924
978
  "data-generation-mode": e.generationMode,
925
- children: t.map((e) => /* @__PURE__ */ F("p", {
979
+ children: t.map((e) => /* @__PURE__ */ P("p", {
926
980
  role: "alert",
927
981
  className: "stage-form-error",
928
982
  children: e
929
983
  }, e))
930
984
  });
931
985
  }
932
- function nn(e) {
986
+ function cn(e) {
933
987
  let t = q(e, "command");
934
988
  if (!t) return;
935
989
  let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(J) : [];
@@ -937,41 +991,41 @@ function nn(e) {
937
991
  command: t,
938
992
  label: q(e, "label", t),
939
993
  fields: n,
940
- generationMode: hn(e.properties.generationMode),
941
- layout: gn(e.properties.layout)
994
+ generationMode: xn(e.properties.generationMode),
995
+ layout: Sn(e.properties.layout)
942
996
  };
943
997
  }
944
- function rn(e, t) {
945
- return e.generationMode === u.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
998
+ function ln(e, t) {
999
+ return e.generationMode === d.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
946
1000
  name: e.name,
947
1001
  label: e.name
948
1002
  }));
949
1003
  }
950
- function an(e, t, n) {
951
- let r = e.layout, i = r ? _n(r, t) : [];
952
- if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => on(e, n));
953
- let a = new Map(t.map((e) => [e.name, e])), o = vn(r, i), s = {
954
- gridTemplateColumns: Array.from({ length: o }, (e, t) => yn(t + 1, r.columns)).join(" "),
1004
+ function un(e, t, n) {
1005
+ let r = e.layout, i = r ? Cn(r, t) : [];
1006
+ if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => dn(e, n));
1007
+ let a = new Map(t.map((e) => [e.name, e])), o = wn(r, i), s = {
1008
+ gridTemplateColumns: Array.from({ length: o }, (e, t) => Tn(t + 1, r.columns)).join(" "),
955
1009
  columnGap: K(r.columnGap),
956
1010
  rowGap: K(r.rowGap)
957
1011
  }, c = /* @__PURE__ */ new Set();
958
- return /* @__PURE__ */ I("div", {
1012
+ return /* @__PURE__ */ F("div", {
959
1013
  className: "stage-command-form__layout",
960
1014
  style: s,
961
1015
  children: [i.map((e) => {
962
1016
  let t = a.get(e.field);
963
- return t ? (c.add(t.name), on(t, n, e)) : null;
964
- }), t.filter((e) => !c.has(e.name)).map((e) => on(e, n))]
1017
+ return t ? (c.add(t.name), dn(t, n, e)) : null;
1018
+ }), t.filter((e) => !c.has(e.name)).map((e) => dn(e, n))]
965
1019
  });
966
1020
  }
967
- function on(e, t, n) {
1021
+ function dn(e, t, n) {
968
1022
  let r = e.sourceProperty ?? e.name, i = t.find((e) => e.name === r), a = e.label ?? e.name, o = (e) => e[r], s = i?.required ?? !0, c = (() => {
969
1023
  if (i?.options) {
970
1024
  let e = i.options.map((e) => ({
971
1025
  value: e,
972
1026
  label: G(e)
973
1027
  }));
974
- return /* @__PURE__ */ F(Le, {
1028
+ return /* @__PURE__ */ P(ze, {
975
1029
  value: o,
976
1030
  fieldName: r,
977
1031
  title: a,
@@ -981,7 +1035,7 @@ function on(e, t, n) {
981
1035
  optionLabel: "label"
982
1036
  });
983
1037
  }
984
- if (i?.members || i?.item) return /* @__PURE__ */ F(Gt, {
1038
+ if (i?.members || i?.item) return /* @__PURE__ */ P(Xt, {
985
1039
  value: o,
986
1040
  fieldName: r,
987
1041
  title: a,
@@ -989,34 +1043,34 @@ function on(e, t, n) {
989
1043
  descriptor: i
990
1044
  });
991
1045
  switch (i?.type ?? "text") {
992
- case "number": return /* @__PURE__ */ F(ze, {
1046
+ case "number": return /* @__PURE__ */ P(Ve, {
993
1047
  value: o,
994
1048
  fieldName: r,
995
1049
  title: a,
996
1050
  required: s
997
1051
  });
998
- case "boolean": return /* @__PURE__ */ F(Ie, {
1052
+ case "boolean": return /* @__PURE__ */ P(Re, {
999
1053
  value: o,
1000
1054
  fieldName: r,
1001
1055
  label: a,
1002
1056
  required: s
1003
1057
  });
1004
- case "date": return /* @__PURE__ */ F(Fe, {
1058
+ case "date": return /* @__PURE__ */ P(Le, {
1005
1059
  value: o,
1006
1060
  fieldName: r,
1007
1061
  title: a,
1008
1062
  required: s,
1009
1063
  showIcon: !0
1010
1064
  });
1011
- default: return /* @__PURE__ */ F(Re, {
1065
+ default: return /* @__PURE__ */ P(Be, {
1012
1066
  value: o,
1013
1067
  fieldName: r,
1014
1068
  title: a,
1015
1069
  required: s
1016
1070
  });
1017
1071
  }
1018
- })(), l = bn(n);
1019
- return /* @__PURE__ */ F("span", {
1072
+ })(), l = En(n);
1073
+ return /* @__PURE__ */ P("span", {
1020
1074
  className: "stage-command-form__field",
1021
1075
  "data-field": e.name,
1022
1076
  "data-row": n?.row,
@@ -1026,7 +1080,7 @@ function on(e, t, n) {
1026
1080
  children: c
1027
1081
  }, e.name);
1028
1082
  }
1029
- function sn(e, t) {
1083
+ function fn(e, t) {
1030
1084
  let n = {};
1031
1085
  for (let r of e) {
1032
1086
  let e = r.sourceProperty ?? r.name, i = t[e];
@@ -1034,28 +1088,27 @@ function sn(e, t) {
1034
1088
  }
1035
1089
  return n;
1036
1090
  }
1037
- function cn(e, t, n) {
1038
- let r = new Set(e.map((e) => e.sourceProperty ?? e.name)), i = {};
1039
- for (let e of t) e.identifier && e.required && !r.has(e.name) && (i[e.name] = n[e.name] || ln(e.identifier));
1040
- return i;
1041
- }
1042
- function ln(e) {
1043
- let t = `${at}${e}`;
1044
- try {
1045
- let e = globalThis.localStorage?.getItem(t);
1046
- if (e) return e;
1047
- let n = globalThis.crypto.randomUUID();
1048
- return globalThis.localStorage?.setItem(t, n), n;
1049
- } catch {
1050
- return globalThis.crypto.randomUUID();
1091
+ function pn(e, t, n) {
1092
+ let r = new Set(e.map((e) => e.sourceProperty ?? e.name)), i = t.some((e) => e.identity), a = {};
1093
+ for (let e of t) {
1094
+ if (!e.identifier || !e.required || r.has(e.name)) continue;
1095
+ let t = hn(e, n) ?? (e.identity || !i ? ct(e.identifier) : void 0);
1096
+ t !== void 0 && (a[e.name] = t);
1051
1097
  }
1098
+ return a;
1099
+ }
1100
+ function mn(e, t) {
1101
+ return !e.identifier || !e.required ? !1 : e.identity === !0 || hn(e, t) !== void 0;
1052
1102
  }
1053
- function un(e) {
1103
+ function hn(e, t) {
1104
+ if (e.identifier) return t[e.name] || st(e.identifier);
1105
+ }
1106
+ function gn(e) {
1054
1107
  let t = e.properties.populateSource;
1055
1108
  return J(t) ? t : void 0;
1056
1109
  }
1057
- function dn(e, t, n) {
1058
- let r = un(e), i = r?.queryName, o = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, fn(e, r?.path ?? e, t, n)]), s = Object.fromEntries(o.filter(([, e]) => e !== void 0 && e !== "")), c = !!i && n.routesReady && o.every(([, e]) => e !== void 0 && e !== ""), l = B({
1110
+ function _n(e, t, n) {
1111
+ let r = gn(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, vn(e, r?.path ?? e, t, n)]), s = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), c = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = B({
1059
1112
  scope: `populate:${q(e, "command")}`,
1060
1113
  name: i,
1061
1114
  route: i ? n.routes?.queries[i] : void 0,
@@ -1063,128 +1116,128 @@ function dn(e, t, n) {
1063
1116
  ready: c,
1064
1117
  publish: !1
1065
1118
  }), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] : J(u) ? u : void 0;
1066
- return a(() => {
1119
+ return o(() => {
1067
1120
  if (!d) return;
1068
1121
  let e = {};
1069
1122
  for (let n of t) {
1070
1123
  let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
1071
- t != null && (e[n.name] = Ut(n, t));
1124
+ t != null && (e[n.name] = Jt(n, t));
1072
1125
  }
1073
1126
  return Object.keys(e).length > 0 ? e : void 0;
1074
1127
  }, [d, t]);
1075
1128
  }
1076
- function fn(e, t, n, r) {
1129
+ function vn(e, t, n, r) {
1077
1130
  let i = r.parameters[t] ?? r.parameters[e];
1078
1131
  if (i) return i;
1079
1132
  let a = n.find((n) => n.name === t || n.name === e)?.identifier;
1080
- if (a) return ln(a);
1133
+ if (a) return ct(a);
1081
1134
  let o = r.resolveBinding({ path: t });
1082
1135
  return typeof o == "string" || typeof o == "number" ? o : void 0;
1083
1136
  }
1084
- function pn(e, t, n) {
1085
- let r = a(() => mn(e, t), [e, t]), i = r.map((e) => n(e.source)), o = JSON.stringify(i);
1086
- return a(() => {
1137
+ function yn(e, t, n) {
1138
+ let r = o(() => bn(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
1139
+ return o(() => {
1087
1140
  let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
1088
1141
  return Object.keys(e).length > 0 ? e : void 0;
1089
- }, [r, o]);
1142
+ }, [r, a]);
1090
1143
  }
1091
- function mn(e, t) {
1144
+ function bn(e, t) {
1092
1145
  let n = e.properties.arguments;
1093
1146
  if (!Array.isArray(n)) return [];
1094
1147
  let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
1095
1148
  return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
1096
1149
  }
1097
- function hn(e) {
1098
- return e === u.Manual ? u.Manual : u.Auto;
1150
+ function xn(e) {
1151
+ return e === d.Manual ? d.Manual : d.Auto;
1099
1152
  }
1100
- function gn(e) {
1153
+ function Sn(e) {
1101
1154
  if (!J(e)) return;
1102
1155
  let t = e;
1103
1156
  return {
1104
- columns: Array.isArray(t.columns) ? t.columns.filter(Tn) : [],
1105
- placements: Array.isArray(t.placements) ? t.placements.filter(En) : [],
1106
- columnGap: Dn(t.columnGap) ? t.columnGap : void 0,
1107
- rowGap: Dn(t.rowGap) ? t.rowGap : void 0
1157
+ columns: Array.isArray(t.columns) ? t.columns.filter(jn) : [],
1158
+ placements: Array.isArray(t.placements) ? t.placements.filter(Mn) : [],
1159
+ columnGap: Nn(t.columnGap) ? t.columnGap : void 0,
1160
+ rowGap: Nn(t.rowGap) ? t.rowGap : void 0
1108
1161
  };
1109
1162
  }
1110
- function _n(e, t) {
1163
+ function Cn(e, t) {
1111
1164
  let n = new Map(e.placements.map((e) => [e.field, e]));
1112
- for (let e of t) !n.has(e.name) && En(e.placement) && n.set(e.name, e.placement);
1165
+ for (let e of t) !n.has(e.name) && Mn(e.placement) && n.set(e.name, e.placement);
1113
1166
  return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
1114
1167
  }
1115
- function vn(e, t) {
1168
+ function wn(e, t) {
1116
1169
  return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
1117
1170
  }
1118
- function yn(e, t) {
1171
+ function Tn(e, t) {
1119
1172
  let n = t.find((t) => t.index === e), r = K(n?.width), i = K(n?.minWidth), a = K(n?.maxWidth);
1120
- return n?.width?.unit === d.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
1173
+ return n?.width?.unit === f.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
1121
1174
  }
1122
- function bn(e) {
1175
+ function En(e) {
1123
1176
  if (e) return {
1124
1177
  gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
1125
1178
  gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
1126
- width: e.width?.unit === d.Fraction ? void 0 : K(e.width)
1179
+ width: e.width?.unit === f.Fraction ? void 0 : K(e.width)
1127
1180
  };
1128
1181
  }
1129
1182
  function K(e) {
1130
1183
  if (e) switch (e.unit) {
1131
- case d.Fraction: return `${e.value ?? 1}fr`;
1132
- case d.Pixels: return `${e.value ?? 0}px`;
1133
- case d.Percent: return `${e.value ?? 100}%`;
1134
- case d.Auto: return "auto";
1184
+ case f.Fraction: return `${e.value ?? 1}fr`;
1185
+ case f.Pixels: return `${e.value ?? 0}px`;
1186
+ case f.Percent: return `${e.value ?? 100}%`;
1187
+ case f.Auto: return "auto";
1135
1188
  }
1136
1189
  }
1137
- function xn(e, t, n, r) {
1190
+ function Dn(e, t, n, r) {
1138
1191
  let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
1139
- if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? Vt(a, r, i?.label ?? n) : void 0;
1192
+ if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? Kt(a, r, i?.label ?? n) : void 0;
1140
1193
  }
1141
- function Sn(e, t) {
1194
+ function On(e, t) {
1142
1195
  let n = new Map(t.map((e) => [e.name, e]));
1143
1196
  return e.flatMap((e) => {
1144
1197
  let t = n.get(e.sourceProperty ?? e.name);
1145
1198
  return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
1146
1199
  });
1147
1200
  }
1148
- function Cn(e, t) {
1201
+ function kn(e, t) {
1149
1202
  if (!e) return [];
1150
- let n = _n(e, t).filter((e) => e.width?.unit === d.Fraction).map((e) => `The field “${e.field}” uses a fractional field width, which cannot be applied to an individual form control.`), r = e.columns.filter((e) => e.width?.unit === d.Fraction && !!e.maxWidth).map((e) => `Column ${e.index} combines a fractional width with maxWidth; Stage keeps the fractional track and ignores maxWidth for that column.`);
1203
+ let n = Cn(e, t).filter((e) => e.width?.unit === f.Fraction).map((e) => `The field “${e.field}” uses a fractional field width, which cannot be applied to an individual form control.`), r = e.columns.filter((e) => e.width?.unit === f.Fraction && !!e.maxWidth).map((e) => `Column ${e.index} combines a fractional width with maxWidth; Stage keeps the fractional track and ignores maxWidth for that column.`);
1151
1204
  return [...n, ...r];
1152
1205
  }
1153
- function wn(e) {
1154
- return Ft(q(e, "schema"));
1206
+ function An(e) {
1207
+ return Bt(q(e, "schema"));
1155
1208
  }
1156
1209
  function q(e, t, n = "") {
1157
1210
  let r = e.properties[t];
1158
1211
  return typeof r == "string" ? r : n;
1159
1212
  }
1160
- function Tn(e) {
1213
+ function jn(e) {
1161
1214
  return J(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
1162
1215
  }
1163
- function En(e) {
1216
+ function Mn(e) {
1164
1217
  return J(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
1165
1218
  }
1166
- function Dn(e) {
1167
- return J(e) && Object.values(d).includes(e.unit);
1219
+ function Nn(e) {
1220
+ return J(e) && Object.values(f).includes(e.unit);
1168
1221
  }
1169
1222
  function J(e) {
1170
1223
  return typeof e == "object" && !!e && !Array.isArray(e);
1171
1224
  }
1172
1225
  //#endregion
1173
1226
  //#region src/StageGuardedAction.tsx
1174
- function On(e) {
1227
+ function Pn(e) {
1175
1228
  return typeof e == "object" && !!e && !Array.isArray(e);
1176
1229
  }
1177
1230
  function Y(e, t) {
1178
1231
  let n = e.properties[t];
1179
1232
  return typeof n == "string" ? n : "";
1180
1233
  }
1181
- function kn(e) {
1234
+ function Fn(e) {
1182
1235
  return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
1183
1236
  }
1184
- function An(e) {
1185
- let t = z(), n = Y(e, "itemQuery"), r = (n ? t.routes?.queries[n] : void 0) ?? Y(e, "itemRoute"), i = On(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
1237
+ function In(e) {
1238
+ let t = z(), n = Y(e, "itemQuery"), r = (n ? t.routes?.queries[n] : void 0) ?? Y(e, "itemRoute"), i = Pn(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
1186
1239
  for (let [e, n] of Object.entries(i)) {
1187
- let r = On(n) ? t.resolveBinding(n) : n;
1240
+ let r = Pn(n) ? t.resolveBinding(n) : n;
1188
1241
  a[e] = r, (r == null || r === "") && (o = !1);
1189
1242
  }
1190
1243
  let s = B({
@@ -1200,23 +1253,23 @@ function An(e) {
1200
1253
  item: s.rows.length === 1 ? s.rows[0] : void 0
1201
1254
  };
1202
1255
  }
1203
- function jn(e, t) {
1204
- return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, it(qe(n) ?? "", t)]));
1256
+ function Ln(e, t) {
1257
+ return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, at(Je(n) ?? "", t)]));
1205
1258
  }
1206
- function Mn({ element: e, interactions: t }) {
1207
- let n = z(), r = An(e), i = jt(), [o, c] = s([]), [l, u] = s(!1), d = Y(e, "label"), f = a(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = On(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
1208
- if (!tt(m) || !h || !r.hasSource) {
1209
- let n = r.hasSource ? `${Je}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${Je}: “${d}” has no data subject to evaluate its guard against.`;
1210
- return /* @__PURE__ */ I("div", {
1259
+ function Rn({ element: e, interactions: t }) {
1260
+ let n = z(), r = In(e), i = It(), [a, s] = c([]), [l, u] = c(!1), d = Y(e, "label"), f = o(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = Pn(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
1261
+ if (!nt(m) || !h || !r.hasSource) {
1262
+ let n = r.hasSource ? `${Ye}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${Ye}: “${d}” has no data subject to evaluate its guard against.`;
1263
+ return /* @__PURE__ */ F("div", {
1211
1264
  className: "stage-guarded-action",
1212
1265
  "data-scene-id": e.id,
1213
- children: [/* @__PURE__ */ F(L, {
1266
+ children: [/* @__PURE__ */ P(I, {
1214
1267
  type: "button",
1215
1268
  disabled: !0,
1216
1269
  title: n,
1217
1270
  ...t,
1218
1271
  children: d
1219
- }), /* @__PURE__ */ F("p", {
1272
+ }), /* @__PURE__ */ P("p", {
1220
1273
  role: "alert",
1221
1274
  className: "stage-form-error",
1222
1275
  children: n
@@ -1224,64 +1277,64 @@ function Mn({ element: e, interactions: t }) {
1224
1277
  });
1225
1278
  }
1226
1279
  if (!r.item) return null;
1227
- let g = nt(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
1280
+ let g = rt(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
1228
1281
  if (!_?.command) return null;
1229
1282
  let v = _.command, y = U(v), b = r.item, x = async () => {
1230
1283
  if (!y) return;
1231
1284
  u(!0);
1232
- let t = await i(v, jn(_, b));
1233
- if (u(!1), c(t.messages), !t.isSuccess) return;
1285
+ let t = await i(v, Ln(_, b));
1286
+ if (u(!1), s(t.messages), !t.isSuccess) return;
1234
1287
  n.refreshAfterCommand();
1235
- let r = Y(e, "navigateToScreen"), a = Y(e, "navigateByParameter"), o = a ? it(`item.${a}`, b) : void 0;
1288
+ let r = Y(e, "navigateToScreen"), a = Y(e, "navigateByParameter"), o = a ? at(`item.${a}`, b) : void 0;
1236
1289
  r && W(r, a && o != null ? { [a]: String(o) } : {});
1237
1290
  };
1238
- return /* @__PURE__ */ I("div", {
1291
+ return /* @__PURE__ */ F("div", {
1239
1292
  className: "stage-guarded-action",
1240
1293
  "data-scene-id": e.id,
1241
1294
  "data-command": v,
1242
- children: [/* @__PURE__ */ F(L, {
1295
+ children: [/* @__PURE__ */ P(I, {
1243
1296
  ...t,
1244
1297
  type: "button",
1245
1298
  disabled: !y || l,
1246
1299
  title: y ? void 0 : "This command is not exposed as an API yet",
1247
1300
  onClick: () => void x(),
1248
1301
  children: d
1249
- }), o.map((e) => /* @__PURE__ */ F("p", {
1302
+ }), a.map((e) => /* @__PURE__ */ P("p", {
1250
1303
  role: "alert",
1251
1304
  className: "stage-form-error",
1252
1305
  children: e
1253
1306
  }, e))]
1254
1307
  });
1255
1308
  }
1256
- function Nn(e) {
1257
- let t = ae(), r = o(void 0), s = a(() => _(D(e.id, e.behaviors), f.DoubleClick), [e.behaviors, e.id]);
1309
+ function zn(e) {
1310
+ let t = oe(), r = s(void 0), a = o(() => v(ie(e.id, e.behaviors), p.DoubleClick), [e.behaviors, e.id]);
1258
1311
  i(() => () => clearTimeout(r.current), []);
1259
1312
  let c = n((e) => {
1260
1313
  if (clearTimeout(r.current), r.current = void 0, !t) return;
1261
- let n = (n) => n.path === "$guard" ? rt(n.value, e) : n.path?.startsWith("item.") ? it(n.path, e) : t.context.resolve(n);
1262
- y(s, t.dispatcher, {
1314
+ let n = (n) => n.path === "$guard" ? it(n.value, e) : n.path?.startsWith("item.") ? at(n.path, e) : t.context.resolve(n);
1315
+ b(a, t.dispatcher, {
1263
1316
  ...t.context,
1264
1317
  resolve: n
1265
1318
  }).then((e) => {
1266
1319
  e.findings.length > 0 && t.onFindings?.(e.findings);
1267
1320
  });
1268
- }, [s, t]);
1321
+ }, [a, t]);
1269
1322
  return {
1270
1323
  click: n((e, t) => {
1271
- if (s.length === 0) {
1324
+ if (a.length === 0) {
1272
1325
  t();
1273
1326
  return;
1274
1327
  }
1275
1328
  clearTimeout(r.current), r.current = setTimeout(() => {
1276
1329
  r.current = void 0, t();
1277
1330
  }, 250);
1278
- }, [s.length]),
1279
- doubleClick: s.length > 0 ? c : void 0
1331
+ }, [a.length]),
1332
+ doubleClick: a.length > 0 ? c : void 0
1280
1333
  };
1281
1334
  }
1282
1335
  //#endregion
1283
1336
  //#region src/stageComponents.tsx
1284
- var Pn = "Stage:commandForm";
1337
+ var Bn = "Stage:commandForm";
1285
1338
  function X(e, t, n = {}) {
1286
1339
  return {
1287
1340
  id: e,
@@ -1294,15 +1347,15 @@ function Z(e, t, n = "") {
1294
1347
  let r = e.properties[t];
1295
1348
  return typeof r == "string" ? r : n;
1296
1349
  }
1297
- function Fn(e, t) {
1350
+ function Vn(e, t) {
1298
1351
  let n = e.properties.queryArguments;
1299
- if (!zn(n)) return {
1352
+ if (!Gn(n)) return {
1300
1353
  values: {},
1301
1354
  ready: !0
1302
1355
  };
1303
1356
  let r = {}, i = !0;
1304
1357
  for (let [e, a] of Object.entries(n)) {
1305
- let n = Rn(a) ? t.resolveBinding(a) : a;
1358
+ let n = Wn(a) ? t.resolveBinding(a) : a;
1306
1359
  r[e] = n, (n == null || n === "") && (i = !1);
1307
1360
  }
1308
1361
  return {
@@ -1310,7 +1363,7 @@ function Fn(e, t) {
1310
1363
  ready: i
1311
1364
  };
1312
1365
  }
1313
- function In(e, t) {
1366
+ function Hn(e, t) {
1314
1367
  let n = (e.slots.columns ?? []).map((e) => {
1315
1368
  let t = e.properties;
1316
1369
  return {
@@ -1326,14 +1379,14 @@ function In(e, t) {
1326
1379
  function Q(e, t) {
1327
1380
  return e[t] ?? e.id ?? e.key;
1328
1381
  }
1329
- function Ln({ element: e, slots: t }) {
1330
- let n = z(), r = Z(e, "query", Z(e, "typeName", e.id)), o = (Z(e, "query") ? n.routes?.queries[Z(e, "query")] : void 0) ?? Z(e, "route"), s = a(() => Fn(e, n), [n, e]), { rows: c, error: l, loading: u } = B({
1382
+ function Un({ element: e, slots: t }) {
1383
+ let n = z(), r = Z(e, "query", Z(e, "typeName", e.id)), a = (Z(e, "query") ? n.routes?.queries[Z(e, "query")] : void 0) ?? Z(e, "route"), s = o(() => Vn(e, n), [n, e]), { rows: c, error: l, loading: u } = B({
1331
1384
  scope: e.id,
1332
1385
  name: r,
1333
- route: o || void 0,
1386
+ route: a || void 0,
1334
1387
  arguments: s.values,
1335
1388
  ready: s.ready
1336
- }), d = In(e, c), f = Z(e, "navigateOnRowClickToScreen"), p = Z(e, "navigateOnRowClickByParameter"), m = Z(e, "dataKey") || p || "id", h = n.selections[e.id], g = p ? n.parameters[p] : void 0, _ = Nn(e);
1389
+ }), d = Hn(e, c), f = Z(e, "navigateOnRowClickToScreen"), p = Z(e, "navigateOnRowClickByParameter"), m = Z(e, "dataKey") || p || "id", h = n.selections[e.id], g = p ? n.parameters[p] : void 0, _ = zn(e);
1337
1390
  i(() => {
1338
1391
  if (!h) return;
1339
1392
  let t = Q(h, m), r = t === void 0 ? void 0 : c.find((e) => Q(e, m) === t);
@@ -1379,25 +1432,25 @@ function Ln({ element: e, slots: t }) {
1379
1432
  }
1380
1433
  n.selectRow(e.id, t);
1381
1434
  };
1382
- return o ? /* @__PURE__ */ I("section", {
1435
+ return a ? /* @__PURE__ */ F("section", {
1383
1436
  className: "stage-table",
1384
1437
  "data-scene-id": e.id,
1385
1438
  children: [
1386
- u && /* @__PURE__ */ F(De, {
1439
+ u && /* @__PURE__ */ P(ke, {
1387
1440
  element: X(`${e.id}-loading`, {
1388
1441
  severity: "info",
1389
1442
  text: "Loading…"
1390
1443
  }),
1391
1444
  slots: {}
1392
1445
  }),
1393
- l && /* @__PURE__ */ F(De, {
1446
+ l && /* @__PURE__ */ P(ke, {
1394
1447
  element: X(`${e.id}-error`, {
1395
1448
  severity: "error",
1396
1449
  text: l
1397
1450
  }),
1398
1451
  slots: {}
1399
1452
  }),
1400
- h && /* @__PURE__ */ F(L, {
1453
+ h && /* @__PURE__ */ P(I, {
1401
1454
  type: "button",
1402
1455
  size: "small",
1403
1456
  onClick: () => {
@@ -1407,12 +1460,12 @@ function Ln({ element: e, slots: t }) {
1407
1460
  },
1408
1461
  children: "Clear selection"
1409
1462
  }),
1410
- /* @__PURE__ */ I("table", {
1463
+ /* @__PURE__ */ F("table", {
1411
1464
  "aria-label": Z(e, "label", Z(e, "typeName", "Results")),
1412
- children: [/* @__PURE__ */ F("thead", { children: /* @__PURE__ */ F("tr", { children: d.map((e) => /* @__PURE__ */ F("th", {
1465
+ children: [/* @__PURE__ */ P("thead", { children: /* @__PURE__ */ P("tr", { children: d.map((e) => /* @__PURE__ */ P("th", {
1413
1466
  scope: "col",
1414
1467
  children: e.label
1415
- }, e.property)) }) }), /* @__PURE__ */ I("tbody", { children: [c.map((e, t) => /* @__PURE__ */ F("tr", {
1468
+ }, e.property)) }) }), /* @__PURE__ */ F("tbody", { children: [c.map((e, t) => /* @__PURE__ */ P("tr", {
1416
1469
  "aria-selected": h === e,
1417
1470
  tabIndex: 0,
1418
1471
  onClick: () => _.click(e, () => v(e)),
@@ -1420,17 +1473,17 @@ function Ln({ element: e, slots: t }) {
1420
1473
  onKeyDown: (t) => {
1421
1474
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), v(e));
1422
1475
  },
1423
- children: d.map((t) => /* @__PURE__ */ F("td", { children: String(e[t.property] ?? "") }, t.property))
1424
- }, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */ F("tr", { children: /* @__PURE__ */ F("td", {
1476
+ children: d.map((t) => /* @__PURE__ */ P("td", { children: String(e[t.property] ?? "") }, t.property))
1477
+ }, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */ P("tr", { children: /* @__PURE__ */ P("td", {
1425
1478
  colSpan: Math.max(d.length, 1),
1426
1479
  children: "No records found"
1427
1480
  }) })] })]
1428
1481
  })
1429
1482
  ]
1430
- }) : /* @__PURE__ */ I("section", {
1483
+ }) : /* @__PURE__ */ F("section", {
1431
1484
  className: "stage-table",
1432
1485
  "data-scene-id": e.id,
1433
- children: [/* @__PURE__ */ I("p", {
1486
+ children: [/* @__PURE__ */ F("p", {
1434
1487
  className: "stage-note",
1435
1488
  children: [
1436
1489
  "No query is exposed for ",
@@ -1440,28 +1493,28 @@ function Ln({ element: e, slots: t }) {
1440
1493
  }), t.columns]
1441
1494
  });
1442
1495
  }
1443
- function Rn(e) {
1444
- return zn(e) && (typeof e.path == "string" || typeof e.kind == "string");
1496
+ function Wn(e) {
1497
+ return Gn(e) && (typeof e.path == "string" || typeof e.kind == "string");
1445
1498
  }
1446
- function zn(e) {
1499
+ function Gn(e) {
1447
1500
  return typeof e == "object" && !!e && !Array.isArray(e);
1448
1501
  }
1449
- function Bn({ element: e, interactions: t, slots: n }) {
1450
- return kn(e) ? /* @__PURE__ */ F(Mn, {
1502
+ function Kn({ element: e, interactions: t, slots: n }) {
1503
+ return Fn(e) ? /* @__PURE__ */ P(Rn, {
1451
1504
  element: e,
1452
1505
  interactions: t
1453
- }) : /* @__PURE__ */ F(Vn, {
1506
+ }) : /* @__PURE__ */ P(qn, {
1454
1507
  element: e,
1455
1508
  interactions: t,
1456
1509
  slots: n
1457
1510
  });
1458
1511
  }
1459
- function Vn({ element: e, interactions: t }) {
1512
+ function qn({ element: e, interactions: t }) {
1460
1513
  let n = Z(e, "label", Z(e, "command"));
1461
- return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ F(Hn, {
1514
+ return U(Z(e, "command"), Z(e, "typeName"), Z(e, "route")) ? /* @__PURE__ */ P(Jn, {
1462
1515
  element: e,
1463
1516
  label: n
1464
- }) : /* @__PURE__ */ F(L, {
1517
+ }) : /* @__PURE__ */ P(I, {
1465
1518
  type: "button",
1466
1519
  "data-scene-id": e.id,
1467
1520
  disabled: !0,
@@ -1470,15 +1523,15 @@ function Vn({ element: e, interactions: t }) {
1470
1523
  children: n
1471
1524
  });
1472
1525
  }
1473
- function Hn({ element: e, label: t }) {
1474
- let [r, i] = s(0), a = n(() => i((e) => e + 1), []), o = /* @__PURE__ */ F($t.Provider, {
1526
+ function Jn({ element: e, label: t }) {
1527
+ let [r, i] = c(0), a = n(() => i((e) => e + 1), []), o = /* @__PURE__ */ P(an.Provider, {
1475
1528
  value: a,
1476
- children: /* @__PURE__ */ F(en, { element: e })
1529
+ children: /* @__PURE__ */ P(on, { element: e })
1477
1530
  });
1478
- return /* @__PURE__ */ F("div", {
1531
+ return /* @__PURE__ */ P("div", {
1479
1532
  className: "stage-action",
1480
1533
  "data-scene-id": e.id,
1481
- children: /* @__PURE__ */ F(Ee, {
1534
+ children: /* @__PURE__ */ P(Oe, {
1482
1535
  element: X(e.id, {
1483
1536
  visible: !1,
1484
1537
  header: t,
@@ -1488,53 +1541,53 @@ function Hn({ element: e, label: t }) {
1488
1541
  }, r)
1489
1542
  });
1490
1543
  }
1491
- function Un(e) {
1492
- let t = e.element ?? X("slice-dialog", {}), r = oe(), { routes: i } = z(), o = ie(r?.currentDialogParameters), s = Z(t, "command") || o?.command || Z(t, "slice") || "", c = Z(t, "title") || o?.title || s, l = i?.commandSchemas?.[s], u = a(() => Ft(l ?? ""), [l]), d = n(() => r?.closeDialog(), [r]);
1493
- if (!l || !u.some((e) => e.options || e.members || e.item)) return e.element ? /* @__PURE__ */ F(x, {
1544
+ function Yn(e) {
1545
+ let t = e.element ?? X("slice-dialog", {}), r = se(), { routes: i, parameters: a } = z(), s = O(r?.currentDialogParameters), c = Z(t, "command") || s?.command || Z(t, "slice") || "", l = Z(t, "title") || s?.title || c, u = i?.commandSchemas?.[c], d = o(() => Bt(u ?? ""), [u]), f = n(() => r?.closeDialog(), [r]);
1546
+ if (!u || !d.some((e) => e.options || e.members || e.item)) return e.element ? /* @__PURE__ */ P(S, {
1494
1547
  element: e.element,
1495
1548
  slots: e.slots ?? {}
1496
- }) : /* @__PURE__ */ F(E, {});
1497
- let f = u.filter((e) => !(e.identifier && e.required)), p = X(`slice-dialog-${s}`, {
1498
- command: s,
1499
- label: c,
1500
- schema: l,
1501
- fields: f.map((e) => ({
1549
+ }) : /* @__PURE__ */ P(re, {});
1550
+ let p = d.filter((e) => !mn(e, a)), m = X(`slice-dialog-${c}`, {
1551
+ command: c,
1552
+ label: l,
1553
+ schema: u,
1554
+ fields: p.map((e) => ({
1502
1555
  name: e.name,
1503
1556
  label: G(e.name)
1504
1557
  })),
1505
1558
  generationMode: "manual"
1506
1559
  });
1507
- return /* @__PURE__ */ I("section", {
1560
+ return /* @__PURE__ */ F("section", {
1508
1561
  className: "scene-slice-dialog",
1509
- "data-scene-slice-dialog": Z(t, "slice") || o?.slice,
1510
- "data-scene-command": s,
1562
+ "data-scene-slice-dialog": Z(t, "slice") || s?.slice,
1563
+ "data-scene-command": c,
1511
1564
  children: [
1512
- /* @__PURE__ */ F("header", {
1565
+ /* @__PURE__ */ P("header", {
1513
1566
  className: "scene-slice-dialog-header",
1514
- children: /* @__PURE__ */ F("h2", {
1567
+ children: /* @__PURE__ */ P("h2", {
1515
1568
  className: "scene-slice-dialog-title",
1516
- children: c
1569
+ children: l
1517
1570
  })
1518
1571
  }),
1519
- /* @__PURE__ */ F($t.Provider, {
1520
- value: d,
1521
- children: /* @__PURE__ */ F(en, { element: p })
1572
+ /* @__PURE__ */ P(an.Provider, {
1573
+ value: f,
1574
+ children: /* @__PURE__ */ P(on, { element: m })
1522
1575
  }),
1523
- /* @__PURE__ */ F("footer", {
1576
+ /* @__PURE__ */ P("footer", {
1524
1577
  className: "scene-slice-dialog-footer",
1525
- children: /* @__PURE__ */ F("button", {
1578
+ children: /* @__PURE__ */ P("button", {
1526
1579
  type: "button",
1527
1580
  className: "scene-slice-dialog-cancel",
1528
- onClick: d,
1581
+ onClick: f,
1529
1582
  children: "Cancel"
1530
1583
  })
1531
1584
  })
1532
1585
  ]
1533
1586
  });
1534
1587
  }
1535
- function Wn(e) {
1588
+ function Xn(e) {
1536
1589
  let { element: t } = e;
1537
- if (Z(t, "kind").toLowerCase() !== "action" || Z(t, "slice") !== "") return /* @__PURE__ */ F(S, { ...e });
1590
+ if (Z(t, "kind").toLowerCase() !== "action" || Z(t, "slice") !== "") return /* @__PURE__ */ P(C, { ...e });
1538
1591
  let n = Z(t, "name", t.id), r = {
1539
1592
  ...t,
1540
1593
  componentName: "core:action",
@@ -1543,28 +1596,28 @@ function Wn(e) {
1543
1596
  label: Z(t, "label", n)
1544
1597
  }
1545
1598
  };
1546
- return /* @__PURE__ */ F("span", {
1599
+ return /* @__PURE__ */ P("span", {
1547
1600
  className: "stage-toolbar-action",
1548
1601
  "data-scene-toolbar-item": n,
1549
- children: /* @__PURE__ */ F(Bn, {
1602
+ children: /* @__PURE__ */ P(Kn, {
1550
1603
  element: r,
1551
1604
  interactions: e.interactions,
1552
1605
  slots: e.slots
1553
1606
  })
1554
1607
  });
1555
1608
  }
1556
- var Gn = {
1557
- ...ne,
1558
- "core:table": Ln,
1559
- "core:action": Bn,
1560
- "core:toolbarItem": Wn,
1561
- "core:sliceDialog": Un,
1562
- [Pn]: en
1609
+ var Zn = {
1610
+ ...E,
1611
+ "core:table": Un,
1612
+ "core:action": Kn,
1613
+ "core:toolbarItem": Xn,
1614
+ "core:sliceDialog": Yn,
1615
+ [Bn]: on
1563
1616
  };
1564
1617
  //#endregion
1565
1618
  //#region src/useStrings.ts
1566
- function Kn() {
1567
- let e = Ge(), [t, n] = s([]), [r, a] = s(""), [o, c] = s({});
1619
+ function Qn() {
1620
+ let e = L(), [t, n] = c([]), [r, a] = c(""), [o, s] = c({});
1568
1621
  return i(() => {
1569
1622
  let t = new AbortController();
1570
1623
  return e.locales(t.signal).then((e) => {
@@ -1573,7 +1626,7 @@ function Kn() {
1573
1626
  }, [e]), i(() => {
1574
1627
  if (!r) return;
1575
1628
  let t = new AbortController();
1576
- return e.strings(r, t.signal).then(c).catch(() => c({})), () => t.abort();
1629
+ return e.strings(r, t.signal).then(s).catch(() => s({})), () => t.abort();
1577
1630
  }, [r, e]), {
1578
1631
  locales: t,
1579
1632
  locale: r,
@@ -1581,11 +1634,11 @@ function Kn() {
1581
1634
  dictionary: o
1582
1635
  };
1583
1636
  }
1584
- var qn = /* @__PURE__ */ new Set(["core:table"]);
1585
- function Jn(e) {
1586
- return Yn(e, /* @__PURE__ */ new Map(), void 0);
1637
+ var $n = /* @__PURE__ */ new Set(["core:table"]);
1638
+ function er(e) {
1639
+ return tr(e, /* @__PURE__ */ new Map(), void 0);
1587
1640
  }
1588
- function Yn(e, t, n) {
1641
+ function tr(e, t, n) {
1589
1642
  let r = e;
1590
1643
  if (!r.slots) return e;
1591
1644
  let i = !1, a = {};
@@ -1594,7 +1647,7 @@ function Yn(e, t, n) {
1594
1647
  a[e] = o.map((e) => {
1595
1648
  let t = e, n = $(t, "typeName");
1596
1649
  t.componentName === "core:data" && n && (r.set(n, t), s = t);
1597
- let a = Yn(Zn(Xn(t, r), s), r, s);
1650
+ let a = tr(rr(nr(t, r), s), r, s);
1598
1651
  return a !== e && (i = !0), a;
1599
1652
  });
1600
1653
  }
@@ -1603,20 +1656,20 @@ function Yn(e, t, n) {
1603
1656
  slots: a
1604
1657
  } : e;
1605
1658
  }
1606
- function Xn(e, t) {
1607
- if (!qn.has(e.componentName)) return e;
1659
+ function nr(e, t) {
1660
+ if (!$n.has(e.componentName)) return e;
1608
1661
  let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
1609
1662
  if (!r || e.properties.queryArguments !== void 0) return e;
1610
1663
  let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
1611
- return o && (a.query = o), !$(e, "route") && $(r, "route") && (a.route = r.properties.route), i && (a.by = i, a.queryArguments = { [i]: { path: `parameters.${i}` } }), {
1664
+ return o && (a.query = o), !$(e, "route") && $(r, "route") && (a.route = r.properties.route), i && (a.by = i, a.queryArguments = { [i]: { path: `screen.keys.${i}` } }), {
1612
1665
  ...e,
1613
1666
  properties: a
1614
1667
  };
1615
1668
  }
1616
- function Zn(e, t) {
1669
+ function rr(e, t) {
1617
1670
  if (e.componentName !== "core:action" || !Array.isArray(e.properties?.alternatives) || !t || t.properties?.isCollection === !0 || e.properties.itemQuery !== void 0) return e;
1618
1671
  let n = { ...e.properties }, r = $(t, "query"), i = $(t, "by");
1619
- return r && (n.itemQuery = r), $(t, "route") && (n.itemRoute = t.properties.route), n.itemArguments = i ? { [i]: { path: `parameters.${i}` } } : {}, {
1672
+ return r && (n.itemQuery = r), $(t, "route") && (n.itemRoute = t.properties.route), n.itemArguments = i ? { [i]: { path: `screen.keys.${i}` } } : {}, {
1620
1673
  ...e,
1621
1674
  properties: n
1622
1675
  };
@@ -1627,7 +1680,7 @@ function $(e, t) {
1627
1680
  }
1628
1681
  //#endregion
1629
1682
  //#region src/stageQueryBindings.tsx
1630
- function Qn(e) {
1683
+ function ir(e) {
1631
1684
  let t = /* @__PURE__ */ new Set(), n = (e) => {
1632
1685
  if (Array.isArray(e)) {
1633
1686
  e.forEach(n);
@@ -1647,7 +1700,7 @@ function Qn(e) {
1647
1700
  };
1648
1701
  return r(e), [...t];
1649
1702
  }
1650
- function $n(e) {
1703
+ function ar(e) {
1651
1704
  let t = /* @__PURE__ */ new Map(), n = (e, t) => {
1652
1705
  let n = e.properties?.[t];
1653
1706
  return typeof n == "string" && n.length > 0 ? n : void 0;
@@ -1666,10 +1719,14 @@ function $n(e) {
1666
1719
  };
1667
1720
  return r(e), [...t.values()];
1668
1721
  }
1669
- function er({ source: e }) {
1670
- let { routes: t, routesReady: n, parameters: r } = z(), i = e.by ? r[e.by] : void 0, o = a(() => e.by ? i ? { [e.by]: i } : {} : { ...r }, [
1671
- i,
1722
+ function or({ source: e }) {
1723
+ let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = e.by ? r[e.by] || i[e.by] : void 0, s = o(() => e.by ? a ? { [e.by]: a } : {} : {
1724
+ ...i,
1725
+ ...r
1726
+ }, [
1727
+ a,
1672
1728
  r,
1729
+ i,
1673
1730
  e.by
1674
1731
  ]);
1675
1732
  return B({
@@ -1677,27 +1734,30 @@ function er({ source: e }) {
1677
1734
  name: e.query,
1678
1735
  alias: e.typeName,
1679
1736
  route: t?.queries[e.query] ?? e.route,
1680
- arguments: o,
1681
- ready: n && (!e.by || !!i),
1737
+ arguments: s,
1738
+ ready: n && (!e.by || !!a),
1682
1739
  list: !0
1683
1740
  }), null;
1684
1741
  }
1685
- function tr({ name: e }) {
1686
- let { routes: t, routesReady: n, parameters: r } = z(), i = a(() => ({ ...r }), [r]);
1742
+ function sr({ name: e }) {
1743
+ let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = o(() => ({
1744
+ ...i,
1745
+ ...r
1746
+ }), [r, i]);
1687
1747
  return B({
1688
1748
  scope: `binding:${e}`,
1689
1749
  name: e,
1690
1750
  route: t?.queries[e],
1691
- arguments: i,
1751
+ arguments: a,
1692
1752
  ready: n,
1693
1753
  list: !0
1694
1754
  }), null;
1695
1755
  }
1696
- function nr({ element: e }) {
1697
- let t = a(() => Qn(e), [e]), n = a(() => $n(e), [e]);
1698
- return /* @__PURE__ */ I(Te, { children: [t.map((e) => /* @__PURE__ */ F(tr, { name: e }, e)), n.map((e) => /* @__PURE__ */ F(er, { source: e }, e.typeName))] });
1756
+ function cr({ element: e }) {
1757
+ let t = o(() => ir(e), [e]), n = o(() => ar(e), [e]);
1758
+ return /* @__PURE__ */ F(De, { children: [t.map((e) => /* @__PURE__ */ P(sr, { name: e }, e)), n.map((e) => /* @__PURE__ */ P(or, { source: e }, e.typeName))] });
1699
1759
  }
1700
- function rr(e) {
1760
+ function lr(e) {
1701
1761
  let t = /* @__PURE__ */ new Set(), n = [];
1702
1762
  for (let r of e) for (let e of r.contributions ?? []) {
1703
1763
  if (e.contributionPointName !== "Navigation") continue;
@@ -1710,7 +1770,7 @@ function rr(e) {
1710
1770
  ]);
1711
1771
  if (t.has(s)) continue;
1712
1772
  t.add(s);
1713
- let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l = or(r.destination) ? r.destination : void 0;
1773
+ let c = e.order ?? (typeof r.order == "number" ? r.order : void 0), l = fr(r.destination) ? r.destination : void 0;
1714
1774
  n.push({
1715
1775
  label: i,
1716
1776
  targetScreen: a,
@@ -1718,7 +1778,7 @@ function rr(e) {
1718
1778
  order: c,
1719
1779
  ...typeof r.icon == "string" ? { icon: r.icon } : {},
1720
1780
  ...typeof r.presentation == "string" ? { presentation: r.presentation } : {},
1721
- ...l && sr(l) ? { destination: l } : {}
1781
+ ...l && pr(l) ? { destination: l } : {}
1722
1782
  });
1723
1783
  }
1724
1784
  return n.map((e, t) => ({
@@ -1726,7 +1786,7 @@ function rr(e) {
1726
1786
  index: t
1727
1787
  })).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
1728
1788
  }
1729
- function ir(e) {
1789
+ function ur(e) {
1730
1790
  let t = {
1731
1791
  label: "",
1732
1792
  children: []
@@ -1751,21 +1811,21 @@ function ir(e) {
1751
1811
  }
1752
1812
  return t.children;
1753
1813
  }
1754
- function ar(e, t) {
1814
+ function dr(e, t) {
1755
1815
  for (let n of e) {
1756
1816
  if (n.screen === t) return [n.label];
1757
- let e = ar(n.children, t);
1817
+ let e = dr(n.children, t);
1758
1818
  if (e.length > 0) return [n.label, ...e];
1759
1819
  }
1760
1820
  return [];
1761
1821
  }
1762
- function or(e) {
1822
+ function fr(e) {
1763
1823
  return typeof e == "object" && !!e && !Array.isArray(e);
1764
1824
  }
1765
- function sr(e) {
1825
+ function pr(e) {
1766
1826
  return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
1767
1827
  }
1768
- function cr(e, t, n) {
1828
+ function mr(e, t, n) {
1769
1829
  return e.filter((e) => !t.has(e.name)).map((e) => ({
1770
1830
  label: e.name,
1771
1831
  targetScreen: e.name,
@@ -1774,77 +1834,77 @@ function cr(e, t, n) {
1774
1834
  }
1775
1835
  //#endregion
1776
1836
  //#region src/blueprint.ts
1777
- var lr = "Stage:locale";
1778
- function ur(e) {
1779
- let t = xe(e), n = t.packages.filter((e) => e !== "PrimeReact");
1780
- return n.splice(Math.max(n.indexOf(pe), 0), 0, "PrimeReact"), {
1837
+ var hr = "Stage:locale";
1838
+ function gr(e) {
1839
+ let t = Ce(e), n = t.packages.filter((e) => e !== "PrimeReact");
1840
+ return n.splice(Math.max(n.indexOf(he), 0), 0, "PrimeReact"), {
1781
1841
  ...t,
1782
1842
  name: e?.length ? t.name : "Stage",
1783
1843
  packages: n
1784
1844
  };
1785
1845
  }
1786
- var dr = {
1787
- ...ue,
1788
- PrimeReact: ke.components
1846
+ var _r = {
1847
+ ...fe,
1848
+ PrimeReact: je.components
1789
1849
  };
1790
- function fr(e) {
1850
+ function vr(e) {
1791
1851
  return {
1792
- ...ne,
1793
- ...Oe,
1794
- ...fe,
1795
- ...be,
1852
+ ...E,
1853
+ ...Ae,
1854
+ ...me,
1855
+ ...Se,
1796
1856
  ...e
1797
1857
  };
1798
1858
  }
1799
- function pr(e) {
1859
+ function yr(e) {
1800
1860
  return e ? {
1801
1861
  ...e,
1802
- ...dr
1803
- } : dr;
1862
+ ..._r
1863
+ } : _r;
1804
1864
  }
1805
- var mr = "Stage:navigationTree";
1806
- function hr(e, t, n) {
1807
- return P(e, M.Logo, {
1865
+ var br = "Stage:navigationTree";
1866
+ function xr(e, t, n) {
1867
+ return N(e, j.Logo, {
1808
1868
  label: t,
1809
1869
  initials: t.slice(0, 1).toUpperCase() || "S",
1810
1870
  targetScreen: "",
1811
1871
  ...n ? { lightImageUrl: n } : {}
1812
1872
  });
1813
1873
  }
1814
- function gr(e, t, n, r, i, a = !1, o = !0) {
1815
- let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = rr(e), u = cr(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = ir([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => ye({
1874
+ function Sr(e, t, n, r, i, a = !1, o = !0) {
1875
+ let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = lr(e), u = mr(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = ur([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => xe({
1816
1876
  label: e.name,
1817
1877
  targetScreen: e.name,
1818
1878
  icon: "pi pi-table",
1819
1879
  group: "Screens",
1820
1880
  order: n
1821
- }, t)), p = ar(ir(l), t), m = e.find((e) => e.name === t)?.path?.length ? ar(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? P("menu-hierarchy", mr, {
1881
+ }, t)), p = dr(ur(l), t), m = e.find((e) => e.name === t)?.path?.length ? dr(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? N("menu-hierarchy", br, {
1822
1882
  nodes: d,
1823
1883
  activeScreen: t
1824
- }) : P("menu-screens", M.Menu, {
1884
+ }) : N("menu-screens", j.Menu, {
1825
1885
  title: "Screens",
1826
1886
  label: "Screens"
1827
1887
  }, { items: f }), _ = [];
1828
- n.length > 1 && _.push(P("topbar-locale", lr, {
1888
+ n.length > 1 && _.push(N("topbar-locale", hr, {
1829
1889
  locales: n,
1830
1890
  locale: r
1831
- })), _.push(P("topbar-theme", M.ThemeSwitcher, { label: "Theme" }));
1891
+ })), _.push(N("topbar-theme", j.ThemeSwitcher, { label: "Theme" }));
1832
1892
  let v = { regionNavigation: a };
1833
1893
  return {
1834
- [N.Topbar]: [P("topbar", M.Topbar, v, {
1835
- logo: [hr("topbar-logo", c, i?.image)],
1894
+ [M.Topbar]: [N("topbar", j.Topbar, v, {
1895
+ logo: [xr("topbar-logo", c, i?.image)],
1836
1896
  end: _
1837
1897
  })],
1838
- [N.Sidebar]: [P("sidebar", M.Sidebar, v, { logo: [hr("sidebar-logo", c, i?.image)] })],
1839
- ...a ? {} : { [N.Menu]: [g] },
1840
- [N.Breadcrumb]: [P("breadcrumb", M.Breadcrumb, {
1898
+ [M.Sidebar]: [N("sidebar", j.Sidebar, v, { logo: [xr("sidebar-logo", c, i?.image)] })],
1899
+ ...a ? {} : { [M.Menu]: [g] },
1900
+ [M.Breadcrumb]: [N("breadcrumb", j.Breadcrumb, {
1841
1901
  homeTargetScreen: s,
1842
1902
  items: (h.length > 0 ? h : [t]).map((e) => ({ label: e }))
1843
1903
  })],
1844
- ...o ? { [N.Footer]: [P("footer", M.Footer, { text: `${c} · rendered from your model` })] } : {},
1845
- [N.ConfigPanel]: [P(M.ConfigPanel, M.ConfigPanel, {
1904
+ ...o ? { [M.Footer]: [N("footer", j.Footer, { text: `${c} · rendered from your model` })] } : {},
1905
+ [M.ConfigPanel]: [N(j.ConfigPanel, j.ConfigPanel, {
1846
1906
  title: "Settings",
1847
- themes: me.map((e) => ({
1907
+ themes: ge.map((e) => ({
1848
1908
  name: e.name,
1849
1909
  label: e.name,
1850
1910
  isDark: e.isDark ?? !1
@@ -1852,65 +1912,65 @@ function gr(e, t, n, r, i, a = !1, o = !0) {
1852
1912
  })]
1853
1913
  };
1854
1914
  }
1855
- function _r(e) {
1915
+ function Cr(e) {
1856
1916
  return `#/${encodeURIComponent(e)}`;
1857
1917
  }
1858
1918
  //#endregion
1859
1919
  //#region src/StageChrome.tsx
1860
- var vr = e({
1920
+ var wr = e({
1861
1921
  locales: [],
1862
1922
  locale: "",
1863
1923
  setLocale: () => void 0,
1864
1924
  activity: ""
1865
1925
  });
1866
- function yr({ state: e, children: t }) {
1867
- return /* @__PURE__ */ F(vr.Provider, {
1926
+ function Tr({ state: e, children: t }) {
1927
+ return /* @__PURE__ */ P(wr.Provider, {
1868
1928
  value: e,
1869
1929
  children: t
1870
1930
  });
1871
1931
  }
1872
- var br = "Stage:activity";
1873
- function xr() {
1874
- let { locales: e, locale: t, setLocale: n } = r(vr);
1875
- return e.length < 2 ? null : /* @__PURE__ */ F("select", {
1932
+ var Er = "Stage:activity";
1933
+ function Dr() {
1934
+ let { locales: e, locale: t, setLocale: n } = r(wr);
1935
+ return e.length < 2 ? null : /* @__PURE__ */ P("select", {
1876
1936
  className: "stage-locale",
1877
1937
  "aria-label": "Locale",
1878
1938
  value: t,
1879
1939
  onChange: (e) => n(e.target.value),
1880
- children: e.map((e) => /* @__PURE__ */ F("option", {
1940
+ children: e.map((e) => /* @__PURE__ */ P("option", {
1881
1941
  value: e,
1882
1942
  children: e
1883
1943
  }, e))
1884
1944
  });
1885
1945
  }
1886
- function Sr({ element: e }) {
1946
+ function Or({ element: e }) {
1887
1947
  let t = e.properties ?? {};
1888
- return /* @__PURE__ */ F("nav", {
1948
+ return /* @__PURE__ */ P("nav", {
1889
1949
  className: "stage-navigation-tree",
1890
1950
  "aria-label": "Navigation",
1891
1951
  "data-scene-id": e.id,
1892
- children: /* @__PURE__ */ F(Cr, {
1952
+ children: /* @__PURE__ */ P(kr, {
1893
1953
  nodes: t.nodes ?? [],
1894
1954
  activeScreen: t.activeScreen
1895
1955
  })
1896
1956
  });
1897
1957
  }
1898
- function Cr({ nodes: e, activeScreen: t }) {
1899
- return /* @__PURE__ */ F("ul", {
1958
+ function kr({ nodes: e, activeScreen: t }) {
1959
+ return /* @__PURE__ */ P("ul", {
1900
1960
  role: "tree",
1901
- children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ I("li", {
1961
+ children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ F("li", {
1902
1962
  role: "treeitem",
1903
1963
  "aria-expanded": "true",
1904
- children: [/* @__PURE__ */ F("span", {
1964
+ children: [/* @__PURE__ */ P("span", {
1905
1965
  className: "stage-navigation-group",
1906
1966
  children: e.label
1907
- }), /* @__PURE__ */ F(Cr, {
1967
+ }), /* @__PURE__ */ P(kr, {
1908
1968
  nodes: e.children,
1909
1969
  activeScreen: t
1910
1970
  })]
1911
- }, e.label) : /* @__PURE__ */ F("li", {
1971
+ }, e.label) : /* @__PURE__ */ P("li", {
1912
1972
  role: "treeitem",
1913
- children: /* @__PURE__ */ F(wr, {
1973
+ children: /* @__PURE__ */ P(Ar, {
1914
1974
  node: e,
1915
1975
  screen: e.screen,
1916
1976
  activeScreen: t
@@ -1918,56 +1978,56 @@ function Cr({ nodes: e, activeScreen: t }) {
1918
1978
  }, `${e.screen}:${e.label}`))
1919
1979
  });
1920
1980
  }
1921
- function wr({ node: e, screen: t, activeScreen: n }) {
1922
- let i = r(T), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external" && o.route !== void 0, c = o && i && !s && sr(o) ? (e) => {
1981
+ function Ar({ node: e, screen: t, activeScreen: n }) {
1982
+ let i = r(te), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external" && o.route !== void 0, c = o && i && !s && pr(o) ? (e) => {
1923
1983
  e.preventDefault(), i.navigate(o);
1924
1984
  } : void 0;
1925
- return /* @__PURE__ */ I("a", {
1926
- href: s ? o.route : _r(t),
1985
+ return /* @__PURE__ */ F("a", {
1986
+ href: s ? o.route : Cr(t),
1927
1987
  rel: s ? "noreferrer" : void 0,
1928
1988
  "aria-current": t === n ? "page" : void 0,
1929
1989
  "aria-label": a === "icon" ? e.label : void 0,
1930
1990
  "data-presentation": e.presentation,
1931
1991
  "data-icon": e.icon,
1932
1992
  onClick: c,
1933
- children: [a !== "text" && e.icon && /* @__PURE__ */ F("span", {
1993
+ children: [a !== "text" && e.icon && /* @__PURE__ */ P("span", {
1934
1994
  className: "stage-navigation-icon",
1935
1995
  "aria-hidden": "true",
1936
1996
  "data-icon-name": e.icon
1937
1997
  }), a !== "icon" && e.label]
1938
1998
  });
1939
1999
  }
1940
- function Tr({ element: e }) {
1941
- let t = typeof e.properties.name == "string" ? e.properties.name : "", n = r(T), i = se(), a = z(), o = n?.outlets[t], s = o && i ? i.screens[o] : void 0, c = e.properties.closable === !0;
1942
- return /* @__PURE__ */ I("div", {
2000
+ function jr({ element: e }) {
2001
+ let t = typeof e.properties.name == "string" ? e.properties.name : "", n = r(te), i = le(), a = z(), o = n?.outlets[t], s = o && i ? i.screens[o] : void 0, c = e.properties.closable === !0;
2002
+ return /* @__PURE__ */ F("div", {
1943
2003
  "data-scene-outlet": t,
1944
2004
  "data-scene-outlet-screen": o,
1945
- children: [c && o && /* @__PURE__ */ F("div", {
2005
+ children: [c && o && /* @__PURE__ */ P("div", {
1946
2006
  className: "scene-outlet-bar",
1947
- children: /* @__PURE__ */ F("button", {
2007
+ children: /* @__PURE__ */ P("button", {
1948
2008
  type: "button",
1949
2009
  className: "scene-outlet-close",
1950
2010
  "aria-label": "Close",
1951
2011
  onClick: () => n?.closeOutlet(t),
1952
2012
  children: "Close"
1953
2013
  })
1954
- }), s && i && /* @__PURE__ */ F(w, {
2014
+ }), s && i && /* @__PURE__ */ P(w, {
1955
2015
  element: s,
1956
2016
  registry: i.registry,
1957
2017
  resolveBinding: a.resolveBinding
1958
2018
  })]
1959
2019
  });
1960
2020
  }
1961
- function Er() {
1962
- let { activity: e } = r(vr);
1963
- return e ? /* @__PURE__ */ F("p", {
2021
+ function Mr() {
2022
+ let { activity: e } = r(wr);
2023
+ return e ? /* @__PURE__ */ P("p", {
1964
2024
  className: "stage-activity",
1965
2025
  role: "status",
1966
2026
  children: e
1967
2027
  }) : null;
1968
2028
  }
1969
- function Dr() {
1970
- let e = ce(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
2029
+ function Nr() {
2030
+ let e = k(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
1971
2031
  return i(() => {
1972
2032
  let r = e?.isDark ? "dark" : "light";
1973
2033
  document.documentElement.setAttribute("data-scene-color-scheme", r), document.body.setAttribute("data-scene-color-scheme", r), document.body.style.backgroundColor = t ?? "", document.body.style.color = n ?? "";
@@ -1977,56 +2037,56 @@ function Dr() {
1977
2037
  n
1978
2038
  ]), null;
1979
2039
  }
1980
- var Or = {
1981
- [lr]: xr,
1982
- [mr]: Sr,
1983
- [br]: Er,
1984
- "core:outlet": Tr
1985
- }, kr = [
2040
+ var Pr = {
2041
+ [hr]: Dr,
2042
+ [br]: Or,
2043
+ [Er]: Mr,
2044
+ "core:outlet": jr
2045
+ }, Fr = [
1986
2046
  "navigationMode",
1987
2047
  "menuTheme",
1988
2048
  "showFooter"
1989
- ], Ar = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
1990
- function jr(e, t, n = !1) {
2049
+ ], Ir = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
2050
+ function Lr(e, t, n = !1) {
1991
2051
  let r = [], i = t.options ?? {}, a = {
1992
2052
  showFooter: !0,
1993
2053
  followsSystem: !1,
1994
2054
  problems: r
1995
2055
  };
1996
2056
  for (let [e, n] of Object.entries(i)) {
1997
- if (!kr.includes(e)) {
1998
- r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${kr.join(", ")}.`);
2057
+ if (!Fr.includes(e)) {
2058
+ r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${Fr.join(", ")}.`);
1999
2059
  continue;
2000
2060
  }
2001
2061
  if (e === "navigationMode") {
2002
- let e = _e.find((e) => e === n);
2003
- e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${_e.join(", ")}.`);
2062
+ let e = ye.find((e) => e === n);
2063
+ e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${ye.join(", ")}.`);
2004
2064
  } else if (e === "menuTheme") {
2005
- let e = ve.find((e) => e === n);
2006
- e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${ve.join(", ")}.`);
2065
+ let e = be.find((e) => e === n);
2066
+ e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${be.join(", ")}.`);
2007
2067
  } else typeof n == "boolean" ? a.showFooter = n : r.push(`Option 'showFooter' is '${String(n)}'; expected true or false.`);
2008
2068
  }
2009
2069
  let o = e?.appearance;
2010
2070
  if (o?.colorScheme !== void 0) {
2011
- a.followsSystem = o.colorScheme === c.System;
2012
- let e = a.followsSystem ? n : o.colorScheme === c.Dark;
2013
- a.colorScheme = e ? j.Dark : j.Light, a.themeName = me.find((t) => (t.isDark ?? !1) === e)?.name;
2071
+ a.followsSystem = o.colorScheme === l.System;
2072
+ let e = a.followsSystem ? n : o.colorScheme === l.Dark;
2073
+ a.colorScheme = e ? A.Dark : A.Light, a.themeName = ge.find((t) => (t.isDark ?? !1) === e)?.name;
2014
2074
  }
2015
- return o?.accent !== void 0 && (Ar.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
2075
+ return o?.accent !== void 0 && (Ir.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
2016
2076
  }
2017
- function Mr(e, t) {
2077
+ function Rr(e, t) {
2018
2078
  if (e?.root === void 0) return [];
2019
2079
  let n = /* @__PURE__ */ new Set([
2020
- p.RootTemplateUnknown,
2021
- p.RootTemplateVersionNotSatisfied,
2022
- p.RootTemplateNotApplicable,
2023
- p.RootTemplateMissingContentSlot,
2024
- p.RootTemplateCycle,
2025
- p.RootTemplateBlueprintNotInstalled
2080
+ m.RootTemplateUnknown,
2081
+ m.RootTemplateVersionNotSatisfied,
2082
+ m.RootTemplateNotApplicable,
2083
+ m.RootTemplateMissingContentSlot,
2084
+ m.RootTemplateCycle,
2085
+ m.RootTemplateBlueprintNotInstalled
2026
2086
  ]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
2027
- return r.length === 0 && t.origin !== m.Root && r.push(`The root template '${e.root.template.id}' did not resolve, so the application would not start in the shell it names.`), r;
2087
+ return r.length === 0 && t.origin !== h.Root && r.push(`The root template '${e.root.template.id}' did not resolve, so the application would not start in the shell it names.`), r;
2028
2088
  }
2029
- function Nr(e) {
2089
+ function zr(e) {
2030
2090
  let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
2031
2091
  0,
2032
2092
  2,
@@ -2034,7 +2094,7 @@ function Nr(e) {
2034
2094
  ].map((e) => parseInt(t.slice(e, e + 2), 16));
2035
2095
  return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
2036
2096
  }
2037
- function Pr(e, t) {
2097
+ function Br(e, t) {
2038
2098
  if (t === void 0) return e;
2039
2099
  let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
2040
2100
  0,
@@ -2046,41 +2106,41 @@ function Pr(e, t) {
2046
2106
  tokens: {
2047
2107
  ...e.tokens,
2048
2108
  "primary.color": t,
2049
- "primary.contrastColor": Nr(t),
2109
+ "primary.contrastColor": zr(t),
2050
2110
  "focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
2051
2111
  }
2052
2112
  }));
2053
2113
  }
2054
2114
  //#endregion
2055
2115
  //#region src/StageShellSettings.tsx
2056
- var Fr = "(prefers-color-scheme: dark)";
2057
- function Ir() {
2116
+ var Vr = "(prefers-color-scheme: dark)";
2117
+ function Hr() {
2058
2118
  return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
2059
2119
  }
2060
- function Lr({ settings: e, onSystemSchemeChange: t }) {
2061
- let n = o(Se());
2062
- n.current = Se();
2063
- let { mode: r, menuTheme: a, colorScheme: s, themeName: c } = e;
2120
+ function Ur({ settings: e, onSystemSchemeChange: t }) {
2121
+ let n = s(we());
2122
+ n.current = we();
2123
+ let { mode: r, menuTheme: a, colorScheme: o, themeName: c } = e;
2064
2124
  return i(() => {
2065
- let { setMode: e, setMenuTheme: t, setColorScheme: i, setThemeName: o } = n.current;
2066
- r !== void 0 && e(r), a !== void 0 && t(a), s !== void 0 && i(s), c !== void 0 && o(c);
2125
+ let { setMode: e, setMenuTheme: t, setColorScheme: i, setThemeName: s } = n.current;
2126
+ r !== void 0 && e(r), a !== void 0 && t(a), o !== void 0 && i(o), c !== void 0 && s(c);
2067
2127
  }, [
2068
2128
  r,
2069
2129
  a,
2070
- s,
2130
+ o,
2071
2131
  c
2072
2132
  ]), i(() => {
2073
2133
  if (!e.followsSystem || !globalThis.matchMedia || !t) return;
2074
- let n = globalThis.matchMedia(Fr), r = (e) => t(e.matches);
2134
+ let n = globalThis.matchMedia(Vr), r = (e) => t(e.matches);
2075
2135
  return n.addEventListener("change", r), () => n.removeEventListener("change", r);
2076
2136
  }, [e.followsSystem, t]), null;
2077
2137
  }
2078
2138
  //#endregion
2079
2139
  //#region src/stageNavigationModel.ts
2080
- function Rr(e) {
2140
+ function Wr(e) {
2081
2141
  return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
2082
2142
  }
2083
- function zr(e) {
2143
+ function Gr(e) {
2084
2144
  let t = /* @__PURE__ */ new Map();
2085
2145
  for (let n of e) {
2086
2146
  let e = (n.path ?? []).join(".");
@@ -2093,35 +2153,35 @@ function zr(e) {
2093
2153
  return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
2094
2154
  };
2095
2155
  }
2096
- function Br(e) {
2156
+ function Kr(e) {
2097
2157
  return (t) => e.find((e) => e.name === t)?.path?.[0];
2098
2158
  }
2099
- function Vr(e, t) {
2159
+ function qr(e, t) {
2100
2160
  return {
2101
2161
  structure: e.structure ?? { modules: [] },
2102
2162
  navigation: e.navigation ?? {
2103
2163
  application: { regions: [] },
2104
2164
  modules: []
2105
2165
  },
2106
- screenFor: zr(e.screens),
2107
- moduleOf: Br(e.screens),
2166
+ screenFor: Gr(e.screens),
2167
+ moduleOf: Kr(e.screens),
2108
2168
  ...t ? { isVisible: t } : {}
2109
2169
  };
2110
2170
  }
2111
2171
  //#endregion
2112
2172
  //#region src/stageSlices.ts
2113
- function Hr(e) {
2114
- return (t) => Ft(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
2173
+ function Jr(e) {
2174
+ return (t) => Bt(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
2115
2175
  name: e.name,
2116
2176
  type: e.type === "text" || e.type === void 0 ? "string" : e.type,
2117
- label: Ur(e.name),
2177
+ label: Yr(e.name),
2118
2178
  required: e.required
2119
2179
  }));
2120
2180
  }
2121
- function Ur(e) {
2181
+ function Yr(e) {
2122
2182
  return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
2123
2183
  }
2124
- function Wr(e, t, n) {
2184
+ function Xr(e, t, n) {
2125
2185
  return { invoke: async (r, i, a) => {
2126
2186
  let o = a ?? r.slice(r.lastIndexOf(".") + 1);
2127
2187
  if (!U(o)) return {
@@ -2142,15 +2202,15 @@ function Wr(e, t, n) {
2142
2202
  }
2143
2203
  //#endregion
2144
2204
  //#region src/App.tsx
2145
- function Gr(e = {}) {
2146
- return fr({
2205
+ function Zr(e = {}) {
2206
+ return vr({
2147
2207
  ...e,
2148
- ...Gn,
2149
- ...Or
2208
+ ...Zn,
2209
+ ...Pr
2150
2210
  });
2151
2211
  }
2152
- function Kr(e, t) {
2153
- return P(`form-${e}-${t.name}`, Pn, {
2212
+ function Qr(e, t) {
2213
+ return N(`form-${e}-${t.name}`, Bn, {
2154
2214
  command: t.forCommand,
2155
2215
  label: t.name,
2156
2216
  generationMode: t.generationMode,
@@ -2158,103 +2218,103 @@ function Kr(e, t) {
2158
2218
  fields: t.fields
2159
2219
  });
2160
2220
  }
2161
- function qr(e, t) {
2221
+ function $r(e, t) {
2162
2222
  let n = e.screens[0];
2163
- return he(e, n, {
2164
- profile: ur(e.uiProfiles),
2165
- blueprintTemplates: t?.length ? [...ge, ...t] : void 0
2223
+ return _e(e, n, {
2224
+ profile: gr(e.uiProfiles),
2225
+ blueprintTemplates: t?.length ? [...ve, ...t] : void 0
2166
2226
  });
2167
2227
  }
2168
- function Jr(e, t, n, r, i, a, o = !0) {
2169
- let s = Rr(e.navigation), c = e.navigation?.application.logo ? {
2228
+ function ei(e, t, n, r, i, a, o = !0) {
2229
+ let s = Wr(e.navigation), c = e.navigation?.application.logo ? {
2170
2230
  title: e.navigation.application.logo.title,
2171
2231
  image: e.navigation.application.logo.image || void 0
2172
2232
  } : void 0;
2173
2233
  return {
2174
- profile: ur(e.uiProfiles),
2175
- catalog: pr(r),
2176
- blueprintTemplates: a?.length ? [...ge, ...a] : void 0,
2177
- chrome: (r, i) => i === M.FullPageShell ? { [N.ConfigPanel]: gr(e.screens, r.name, t, n, c, s, o)[N.ConfigPanel] } : gr(e.screens, r.name, t, n, c, s, o),
2178
- form: Kr,
2179
- trailing: [P("activity", br)],
2234
+ profile: gr(e.uiProfiles),
2235
+ catalog: yr(r),
2236
+ blueprintTemplates: a?.length ? [...ve, ...a] : void 0,
2237
+ chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]: Sr(e.screens, r.name, t, n, c, s, o)[M.ConfigPanel] } : Sr(e.screens, r.name, t, n, c, s, o),
2238
+ form: Qr,
2239
+ trailing: [N("activity", Er)],
2180
2240
  decorate: (e) => {
2181
- let t = Jn(e);
2182
- return i ? v(t, i) : t;
2241
+ let t = er(e);
2242
+ return i ? y(t, i) : t;
2183
2243
  }
2184
2244
  };
2185
2245
  }
2186
- function Yr(e, t, n, r, i, a) {
2187
- return de(e, t, Jr(e, n, r, i, void 0, a)).element;
2246
+ function ti(e, t, n, r, i, a) {
2247
+ return pe(e, t, ei(e, n, r, i, void 0, a)).element;
2188
2248
  }
2189
- function Xr() {
2249
+ function ni() {
2190
2250
  try {
2191
2251
  return globalThis.localStorage ?? null;
2192
2252
  } catch {
2193
2253
  return null;
2194
2254
  }
2195
2255
  }
2196
- function Zr({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: o } = {}) {
2197
- let c = Ge(), l = a(() => Gr(e), [e]), [u, d] = s(), [f, p] = s(""), m = Ke(), h = Kn();
2256
+ function ri({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: a } = {}) {
2257
+ let s = L(), l = o(() => Zr(e), [e]), [u, d] = c(), [f, p] = c(""), m = qe(), h = Qn();
2198
2258
  return i(() => {
2199
2259
  let e = new AbortController();
2200
- return c.scene(e.signal).then((e) => d(r?.length ? {
2260
+ return s.scene(e.signal).then((e) => d(r?.length ? {
2201
2261
  ...e,
2202
2262
  dialogTemplates: [...e.dialogTemplates ?? [], ...r.filter((t) => !e.dialogTemplates?.some((e) => e.name === t.name))]
2203
2263
  } : e)).catch((t) => {
2204
2264
  e.signal.aborted || p(t instanceof Error ? t.message : String(t));
2205
2265
  }), () => e.abort();
2206
- }, [c, r]), f ? /* @__PURE__ */ I("main", {
2266
+ }, [s, r]), f ? /* @__PURE__ */ F("main", {
2207
2267
  className: "stage-message",
2208
- children: [/* @__PURE__ */ F("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ F("p", { children: f })]
2209
- }) : u ? /* @__PURE__ */ F(Qr, {
2268
+ children: [/* @__PURE__ */ P("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ P("p", { children: f })]
2269
+ }) : u ? /* @__PURE__ */ P(ii, {
2210
2270
  scene: u,
2211
2271
  registry: l,
2212
2272
  routeState: m,
2213
2273
  strings: h,
2214
2274
  packageCatalog: t,
2215
2275
  screenTemplates: n,
2216
- isVisible: o
2217
- }) : /* @__PURE__ */ F("main", {
2276
+ isVisible: a
2277
+ }) : /* @__PURE__ */ P("main", {
2218
2278
  className: "stage-message",
2219
- children: /* @__PURE__ */ F("h1", { children: "Preparing the Stage" })
2279
+ children: /* @__PURE__ */ P("h1", { children: "Preparing the Stage" })
2220
2280
  });
2221
2281
  }
2222
- function Qr({ scene: e, registry: t, routeState: r, strings: i, packageCatalog: o, screenTemplates: c, isVisible: l }) {
2223
- let u = a(() => O(), []), [d, f] = s(Ir), p = e.screens[0]?.name ?? "", m = a(() => ur(e.uiProfiles), [e]), h = a(() => p ? qr(e, c) : void 0, [
2282
+ function ii({ scene: e, registry: t, routeState: r, strings: i, packageCatalog: a, screenTemplates: s, isVisible: l }) {
2283
+ let u = o(() => D(), []), [d, f] = c(Hr), p = e.screens[0]?.name ?? "", m = o(() => gr(e.uiProfiles), [e]), h = o(() => p ? $r(e, s) : void 0, [
2224
2284
  e,
2225
- c,
2285
+ s,
2226
2286
  p
2227
- ]), g = a(() => h ? Mr(m, h) : [], [m, h]), _ = a(() => h ? jr(m, h, d) : void 0, [
2287
+ ]), g = o(() => h ? Rr(m, h) : [], [m, h]), _ = o(() => h ? Lr(m, h, d) : void 0, [
2228
2288
  m,
2229
2289
  h,
2230
2290
  d
2231
- ]), v = a(() => Pr(me, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = a(() => Jr(e, i.locales, i.locale, o, i.dictionary, c, y), [
2291
+ ]), v = o(() => Br(ge, _?.accent), [_?.accent]), y = _?.showFooter ?? !0, b = o(() => ei(e, i.locales, i.locale, a, i.dictionary, s, y), [
2232
2292
  e,
2233
2293
  i.locales,
2234
2294
  i.locale,
2235
2295
  i.dictionary,
2236
- o,
2237
- c,
2296
+ a,
2297
+ s,
2238
2298
  y
2239
- ]), x = n((e) => f(e), []), S = a(() => Vr(e, l), [e, l]), C = e;
2240
- return p ? g.length > 0 ? /* @__PURE__ */ I("main", {
2299
+ ]), x = n((e) => f(e), []), S = o(() => qr(e, l), [e, l]), C = e;
2300
+ return p ? g.length > 0 ? /* @__PURE__ */ F("main", {
2241
2301
  className: "stage-message",
2242
2302
  role: "alert",
2243
2303
  "data-stage-startup-problem": "root-template",
2244
2304
  children: [
2245
- /* @__PURE__ */ F("h1", { children: "Unable to start this Stage" }),
2246
- /* @__PURE__ */ F("p", { children: "The ui profile's root template cannot be the application's shell." }),
2247
- /* @__PURE__ */ F("ul", { children: g.map((e) => /* @__PURE__ */ F("li", { children: e }, e)) })
2305
+ /* @__PURE__ */ P("h1", { children: "Unable to start this Stage" }),
2306
+ /* @__PURE__ */ P("p", { children: "The ui profile's root template cannot be the application's shell." }),
2307
+ /* @__PURE__ */ P("ul", { children: g.map((e) => /* @__PURE__ */ P("li", { children: e }, e)) })
2248
2308
  ]
2249
- }) : /* @__PURE__ */ F(A, {
2309
+ }) : /* @__PURE__ */ P(ue, {
2250
2310
  application: C,
2251
2311
  composition: b,
2252
2312
  navigationModel: S,
2253
2313
  registry: t,
2254
2314
  initialScreen: p,
2255
2315
  history: u,
2256
- layoutConfigStorage: Xr(),
2257
- scope: (t, n) => /* @__PURE__ */ F($r, {
2316
+ layoutConfigStorage: ni(),
2317
+ scope: (t, n) => /* @__PURE__ */ P(ai, {
2258
2318
  scene: e,
2259
2319
  routeState: r,
2260
2320
  strings: i,
@@ -2264,26 +2324,26 @@ function Qr({ scene: e, registry: t, routeState: r, strings: i, packageCatalog:
2264
2324
  onSystemSchemeChange: x,
2265
2325
  children: n
2266
2326
  }),
2267
- renderScreen: (e, n) => /* @__PURE__ */ F(ti, {
2327
+ renderScreen: (e, n) => /* @__PURE__ */ P(si, {
2268
2328
  element: e,
2269
2329
  configuration: n,
2270
2330
  registry: t
2271
2331
  }),
2272
- renderDialog: () => /* @__PURE__ */ F(Un, {}),
2273
- renderDialogTemplate: (e, n, r) => /* @__PURE__ */ F(ni, {
2332
+ renderDialog: () => /* @__PURE__ */ P(Yn, {}),
2333
+ renderDialogTemplate: (e, n, r) => /* @__PURE__ */ P(ci, {
2274
2334
  template: e,
2275
2335
  content: n,
2276
2336
  registry: t,
2277
2337
  strings: i,
2278
2338
  close: () => r.closeDialog()
2279
2339
  })
2280
- }) : /* @__PURE__ */ I("main", {
2340
+ }) : /* @__PURE__ */ F("main", {
2281
2341
  className: "stage-message",
2282
- children: [/* @__PURE__ */ F("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ F("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
2342
+ children: [/* @__PURE__ */ P("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ P("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
2283
2343
  });
2284
2344
  }
2285
- function $r({ scene: e, routeState: t, strings: n, navigation: r, themes: a, shellSettings: o, onSystemSchemeChange: c, children: u }) {
2286
- let [d, f] = s(""), { navigate: p } = r;
2345
+ function ai({ scene: e, routeState: t, strings: n, navigation: r, themes: a, shellSettings: o, onSystemSchemeChange: s, children: l }) {
2346
+ let [d, f] = c(""), { navigate: p } = r;
2287
2347
  return i(() => f(""), [r.currentScreen, r.currentDialog]), i(() => {
2288
2348
  let e = (e) => {
2289
2349
  let t = e.detail;
@@ -2293,45 +2353,45 @@ function $r({ scene: e, routeState: t, strings: n, navigation: r, themes: a, she
2293
2353
  }, []), i(() => {
2294
2354
  let t = (t) => {
2295
2355
  let n = t.detail, r = n.destination ?? (n.dialog ? {
2296
- kind: l.Dialog,
2356
+ kind: u.Dialog,
2297
2357
  dialog: n.dialog
2298
2358
  } : n.targetScreen ? { screen: n.targetScreen } : void 0);
2299
2359
  r && (r.dialog === void 0 ? r.screen !== void 0 && !e.screens.some((e) => e.name === r.screen) ? f(`The modeled screen “${r.screen}” is not available.`) : p(r) : e.dialogTemplates?.some((e) => e.name === r.dialog) ? p(r) : f(`The modeled dialog “${r.dialog}” is not available in this Stage runtime.`));
2300
2360
  };
2301
2361
  return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
2302
- }, [p, e]), /* @__PURE__ */ I(le, {
2362
+ }, [p, e]), /* @__PURE__ */ F(de, {
2303
2363
  themes: a,
2304
2364
  children: [
2305
- o && /* @__PURE__ */ F(Lr, {
2365
+ o && /* @__PURE__ */ P(Ur, {
2306
2366
  settings: o,
2307
- onSystemSchemeChange: c
2367
+ onSystemSchemeChange: s
2308
2368
  }),
2309
- /* @__PURE__ */ F(Dr, {}),
2310
- /* @__PURE__ */ F(ut, {
2369
+ /* @__PURE__ */ P(Nr, {}),
2370
+ /* @__PURE__ */ P(mt, {
2311
2371
  routes: t.routes,
2312
2372
  routesReady: t.ready,
2313
2373
  parameters: r.currentParameters,
2314
2374
  locale: n.locale,
2315
2375
  locales: n.locales,
2316
2376
  screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
2317
- children: /* @__PURE__ */ F(ei, {
2377
+ children: /* @__PURE__ */ P(oi, {
2318
2378
  activity: d,
2319
2379
  routesReady: t.ready,
2320
2380
  scene: e,
2321
2381
  setActivity: f,
2322
2382
  strings: n,
2323
- children: u
2383
+ children: l
2324
2384
  })
2325
2385
  })
2326
2386
  ]
2327
2387
  });
2328
2388
  }
2329
- function ei({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: o }) {
2330
- let s = z(), c = k(), u = jt(), d = a(() => Wr(u, t, s.refreshAfterCommand), [
2331
- u,
2389
+ function oi({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
2390
+ let s = z(), c = ce(), l = It(), d = o(() => Xr(l, t, s.refreshAfterCommand), [
2391
+ l,
2332
2392
  t,
2333
2393
  s.refreshAfterCommand
2334
- ]), f = a(() => Hr(n.commandSchemas), [n.commandSchemas]), p = re({
2394
+ ]), f = o(() => Jr(n.commandSchemas), [n.commandSchemas]), p = ae({
2335
2395
  executeCommand: async (e, n) => {
2336
2396
  let i = U(e);
2337
2397
  if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
@@ -2342,7 +2402,7 @@ function ei({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
2342
2402
  isSuccess: !1,
2343
2403
  validationErrors: []
2344
2404
  };
2345
- let a = await u(e, n);
2405
+ let a = await l(e, n);
2346
2406
  return a.messages.length > 0 && r(a.messages.join(" ")), a.isSuccess && s.refreshAfterCommand(), {
2347
2407
  isSuccess: a.isSuccess,
2348
2408
  validationErrors: a.validationErrors,
@@ -2350,13 +2410,13 @@ function ei({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
2350
2410
  };
2351
2411
  },
2352
2412
  navigate: (e, t) => {
2353
- n.screens.some((t) => t.name === e) ? W(e, Nt(t)) : r(`The modeled screen “${e}” is not available.`);
2413
+ n.screens.some((t) => t.name === e) ? W(e, Rt(t)) : r(`The modeled screen “${e}” is not available.`);
2354
2414
  },
2355
2415
  navigateBack: () => globalThis.history?.back(),
2356
2416
  openDialog: async (e) => {
2357
2417
  let t = n.dialogTemplates?.find((t) => t.name === e);
2358
2418
  return t ? (c.navigate({
2359
- kind: l.Dialog,
2419
+ kind: u.Dialog,
2360
2420
  dialog: t.name
2361
2421
  }), { isConfirmed: !0 }) : (r(`The modeled dialog “${e}” is not available in this Stage runtime.`), { isConfirmed: !1 });
2362
2422
  },
@@ -2367,18 +2427,18 @@ function ei({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
2367
2427
  refreshQuery: async (e) => s.refreshQuery(e),
2368
2428
  raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
2369
2429
  });
2370
- return /* @__PURE__ */ F(yr, {
2430
+ return /* @__PURE__ */ P(Tr, {
2371
2431
  state: {
2372
2432
  locales: i.locales,
2373
2433
  locale: i.locale,
2374
2434
  setLocale: i.setLocale,
2375
2435
  activity: e
2376
2436
  },
2377
- children: /* @__PURE__ */ F(te, {
2437
+ children: /* @__PURE__ */ P(T, {
2378
2438
  invoker: d,
2379
- children: /* @__PURE__ */ F(ee, {
2439
+ children: /* @__PURE__ */ P(ne, {
2380
2440
  fieldsFor: f,
2381
- children: /* @__PURE__ */ F(C, {
2441
+ children: /* @__PURE__ */ P(ee, {
2382
2442
  dispatcher: p,
2383
2443
  context: {
2384
2444
  resolve: s.resolveBinding,
@@ -2386,56 +2446,56 @@ function ei({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
2386
2446
  },
2387
2447
  attachments: [],
2388
2448
  onFindings: (e) => r(e.map((e) => e.detail).join(" ")),
2389
- children: o
2449
+ children: a
2390
2450
  })
2391
2451
  })
2392
2452
  })
2393
2453
  });
2394
2454
  }
2395
- function ti({ element: e, configuration: t, registry: n }) {
2396
- let r = z();
2397
- return /* @__PURE__ */ I(Te, { children: [/* @__PURE__ */ F(nr, { element: e }), /* @__PURE__ */ F(w, {
2455
+ function si({ element: e, configuration: t, registry: n }) {
2456
+ let r = z(), i = jt();
2457
+ return /* @__PURE__ */ F(De, { children: [/* @__PURE__ */ P(cr, { element: e }), /* @__PURE__ */ P(w, {
2398
2458
  element: e,
2399
2459
  registry: n,
2400
2460
  resolveBinding: r.resolveBinding,
2401
2461
  queryResults: r.queryResults,
2402
- onComponentOutputsChanged: r.publishComponentOutputs,
2462
+ onComponentOutputsChanged: i,
2403
2463
  configuration: t
2404
2464
  })] });
2405
2465
  }
2406
- function ni({ template: e, content: t, registry: n, strings: r, close: a }) {
2407
- let o = z(), s = v(t, r.dictionary);
2466
+ function ci({ template: e, content: t, registry: n, strings: r, close: a }) {
2467
+ let o = z(), s = jt(), c = y(t, r.dictionary);
2408
2468
  return i(() => {
2409
2469
  let e = (e) => {
2410
2470
  e.key === "Escape" && a();
2411
2471
  };
2412
2472
  return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
2413
- }, [a]), /* @__PURE__ */ F("div", {
2473
+ }, [a]), /* @__PURE__ */ P("div", {
2414
2474
  className: "stage-dialog-backdrop",
2415
- children: /* @__PURE__ */ I("section", {
2475
+ children: /* @__PURE__ */ F("section", {
2416
2476
  role: "dialog",
2417
2477
  "aria-modal": "true",
2418
2478
  "aria-label": e.displayName ?? e.name,
2419
2479
  className: "stage-dialog",
2420
- children: [/* @__PURE__ */ F("button", {
2480
+ children: [/* @__PURE__ */ P("button", {
2421
2481
  type: "button",
2422
2482
  onClick: a,
2423
2483
  children: "Close"
2424
- }), /* @__PURE__ */ F(w, {
2425
- element: s,
2484
+ }), /* @__PURE__ */ P(w, {
2485
+ element: c,
2426
2486
  registry: n,
2427
2487
  resolveBinding: o.resolveBinding,
2428
2488
  queryResults: o.queryResults,
2429
- onComponentOutputsChanged: o.publishComponentOutputs
2489
+ onComponentOutputsChanged: s
2430
2490
  })]
2431
2491
  })
2432
2492
  });
2433
2493
  }
2434
2494
  //#endregion
2435
2495
  //#region src/stageTheme.ts
2436
- var ri = "[data-scene-color-scheme='dark']", ii = {
2437
- preset: Be,
2438
- options: { darkModeSelector: ri }
2496
+ var li = "[data-scene-color-scheme='dark']", ui = {
2497
+ preset: He,
2498
+ options: { darkModeSelector: li }
2439
2499
  };
2440
2500
  //#endregion
2441
- export { Zr as App, Zr as StageApplication, en as StageCommandForm, ut as StageDataProvider, Mn as StageGuardedAction, We as StageSourceProvider, Yr as composeStageScreen, Wr as createStageSliceInvoker, dt as dataChanged, kt as executeRegisteredCommand, U as registeredCommand, Hr as sliceFieldsFrom, Gr as stageApplicationRegistry, Jr as stageComposition, ri as stageDarkSelector, He as stageEndpoints, qr as stageShellOf, ii as stageTheme, Ve as staticStageSource, jt as useStageCommandExecutor, z as useStageData, B as useStageQuery, Ge as useStageSource };
2501
+ export { ri as App, ri as StageApplication, on as StageCommandForm, mt as StageDataProvider, Rn as StageGuardedAction, Ke as StageSourceProvider, ti as composeStageScreen, Xr as createStageSliceInvoker, ht as dataChanged, Pt as executeRegisteredCommand, U as registeredCommand, Jr as sliceFieldsFrom, Zr as stageApplicationRegistry, ei as stageComposition, li as stageDarkSelector, We as stageEndpoints, $r as stageShellOf, ui as stageTheme, Ue as staticStageSource, It as useStageCommandExecutor, z as useStageData, B as useStageQuery, L as useStageSource };