@cratis/stage.runtime 4.208.0 → 4.210.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/index.js CHANGED
@@ -2,31 +2,31 @@ import "./app.css";
2
2
  import { t as e } from "../stageDarkSelector-DAwb43-P.js";
3
3
  import { createContext as t, createElement as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l } from "react";
4
4
  import { ColorScheme as u, DestinationKind as d, FormGenerationMode as f, FormWidthUnit as p, InteractionTriggerKind as m, LogoKind as h, PackageKind as g, componentIconLibrary as _ } from "@cratis/scene.model";
5
- import { ShellDiagnosticCode as v, ShellOrigin as y, createBindingResolver as b, hostProfilePackages as x, resolveArgumentSource as S, resolveBehaviors as C, resolveStringsInElement as w, resolveStringsValue as ee, runBindings as T, validateBindingExpression as te } from "@cratis/scene.engine";
6
- import { CoreSliceDialog as ne, CoreToolbarItem as E, IconAdapterProvider as re, InteractionScope as ie, SceneElementView as ae, SceneNavigationContextInternal as D, SliceCommandFieldsProvider as oe, SliceDialogView as se, SliceInvokerProvider as ce, attachmentFor as le, componentRegistryKey as ue, coreComponents as O, createBrowserDispatcher as de, createBrowserSceneHistory as fe, createHashSceneHistory as k, createIconAdapterRegistry as pe, sliceDialogParameters as me, useInteractionScope as he, useOptionalSceneNavigation as ge, useSceneNavigation as _e, useSceneOutlets as ve, useSceneTheme as ye } from "@cratis/scene.react";
7
- import { ApplicationHost as be, ColorScheme as A, ComponentName as j, KanbanBoard as xe, LayoutThemeProvider as Se, SlotName as M, blueprintPackageCatalog as Ce, composeApplicationScreen as we, defaultBlueprintComponents as Te, defaultBlueprintName as Ee, defaultBlueprintThemes as N, effectiveShellOf as De, externalComponent as P, galleryScreenTemplates as Oe, layoutModes as ke, menuThemes as Ae, navigationElement as je, previewComponents as Me, previewProfile as Ne, useLayoutConfig as Pe } from "@cratis/scene.blueprint.default";
5
+ import { ShellDiagnosticCode as v, ShellOrigin as y, createBindingResolver as b, hostProfilePackages as x, resolveArgumentSource as S, resolveBehaviors as C, resolveStringsInElement as w, resolveStringsValue as T, runBindings as E, validateBindingExpression as ee } from "@cratis/scene.engine";
6
+ import { CoreSliceDialog as D, CoreToolbarItem as O, IconAdapterProvider as te, InteractionScope as ne, SceneElementView as k, SceneNavigationContextInternal as A, SliceCommandFieldsProvider as re, SliceDialogView as ie, SliceInvokerProvider as ae, attachmentFor as oe, componentRegistryKey as j, coreComponents as se, createBrowserDispatcher as ce, createBrowserSceneHistory as le, createHashSceneHistory as M, createIconAdapterRegistry as ue, sliceDialogParameters as de, useInteractionScope as fe, useOptionalSceneNavigation as pe, useSceneNavigation as me, useSceneOutlets as he, useSceneTheme as ge } from "@cratis/scene.react";
7
+ import { ApplicationHost as _e, ColorScheme as N, ComponentName as P, KanbanBoard as ve, LayoutThemeProvider as ye, SlotName as F, blueprintPackageCatalog as be, composeApplicationScreen as xe, defaultBlueprintComponents as Se, defaultBlueprintName as Ce, defaultBlueprintThemes as I, effectiveShellOf as we, externalComponent as L, galleryScreenTemplates as Te, layoutModes as Ee, menuThemes as De, navigationElement as Oe, previewComponents as ke, previewProfile as Ae, useLayoutConfig as je } from "@cratis/scene.blueprint.default";
8
8
  import "@cratis/components/tokens";
9
9
  import "@cratis/components/CommandForm/styles";
10
10
  import "@cratis/components/Dropdown/styles";
11
11
  import "@cratis/components/Common/styles";
12
12
  import "@cratis/components/Display/styles";
13
13
  import "@cratis/scene.blueprint.default/styles.css";
14
- import { ArcContext as Fe } from "@cratis/arc.react";
15
- import { ObservableQueryFor as Ie, Paging as Le, QueryFor as Re } from "@cratis/arc/queries";
16
- import { resolveCommand as ze, resolveExactQuery as Be } from "@cratis/scene.components";
17
- import { Fragment as Ve, jsx as F, jsxs as I } from "react/jsx-runtime";
18
- import { Button as L } from "@cratis/components/Common";
19
- import { Dialog as He } from "@cratis/components/Dialogs";
20
- import { Message as Ue } from "@cratis/components/Display";
21
- import { createPortal as We } from "react-dom";
22
- import { DateOnly as Ge, Guid as Ke } from "@cratis/fundamentals";
23
- import { Command as qe } from "@cratis/arc/commands";
24
- import { CommandForm as Je, asCommandFormField as Ye, withCommandFormFieldBinding as Xe } from "@cratis/arc.react/commands";
25
- import { CalendarField as Ze, CheckboxField as Qe, DropdownField as $e, InputTextField as et, NumberField as tt } from "@cratis/components/CommandForm";
26
- import { cratisComponents as nt, cratisComponentsPackageManifest as rt } from "@cratis/scene.components/runtime";
27
- import { dynamicIconImports as it } from "lucide-react/dynamic";
14
+ import { ArcContext as Me } from "@cratis/arc.react";
15
+ import { ObservableQueryFor as Ne, Paging as Pe, QueryFor as Fe } from "@cratis/arc/queries";
16
+ import { resolveCommand as Ie, resolveExactQuery as Le } from "@cratis/scene.components";
17
+ import { Fragment as Re, jsx as R, jsxs as z } from "react/jsx-runtime";
18
+ import { Button as B } from "@cratis/components/Common";
19
+ import { Dialog as ze } from "@cratis/components/Dialogs";
20
+ import { Message as Be } from "@cratis/components/Display";
21
+ import { createPortal as Ve } from "react-dom";
22
+ import { DateOnly as He, Guid as Ue } from "@cratis/fundamentals";
23
+ import { Command as We } from "@cratis/arc/commands";
24
+ import { CommandForm as Ge, asCommandFormField as Ke, withCommandFormFieldBinding as qe } from "@cratis/arc.react/commands";
25
+ import { CalendarField as Je, CheckboxField as Ye, DropdownField as Xe, InputTextField as Ze, NumberField as Qe } from "@cratis/components/CommandForm";
26
+ import { cratisComponents as $e, cratisComponentsPackageManifest as et } from "@cratis/scene.components/runtime";
27
+ import { dynamicIconImports as tt } from "lucide-react/dynamic";
28
28
  // src/stageSource.ts
29
- function at(e) {
29
+ function nt(e) {
30
30
  return {
31
31
  scene: async () => e.scene,
32
32
  routes: async () => e.routes,
@@ -34,23 +34,23 @@ function at(e) {
34
34
  strings: async (t) => e.strings[t] ?? {}
35
35
  };
36
36
  }
37
- var ot = {
37
+ var rt = {
38
38
  scene: "stage/scene",
39
39
  routes: "stage/routes",
40
40
  locales: "stage/locales",
41
41
  strings: (e) => `stage/strings/${encodeURIComponent(e)}`
42
- }, st = t(void 0);
43
- function ct({ source: e, children: t }) {
44
- return n(st.Provider, { value: e }, t);
42
+ }, it = t(void 0);
43
+ function at({ source: e, children: t }) {
44
+ return n(it.Provider, { value: e }, t);
45
45
  }
46
- function lt() {
47
- let e = i(st);
46
+ function ot() {
47
+ let e = i(it);
48
48
  if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
49
49
  return e;
50
50
  }
51
- ot.routes;
52
- function ut() {
53
- let e = lt(), [t, n] = l({
51
+ rt.routes;
52
+ function st() {
53
+ let e = ot(), [t, n] = l({
54
54
  routes: void 0,
55
55
  ready: !1
56
56
  });
@@ -70,24 +70,24 @@ function ut() {
70
70
  }, [e]), t;
71
71
  }
72
72
  // src/applyQueryChangeSet.ts
73
- function dt(e) {
73
+ function ct(e) {
74
74
  return typeof e == "object" && e && "id" in e ? e.id : void 0;
75
75
  }
76
- function ft(e) {
76
+ function lt(e) {
77
77
  if (typeof e != "object" || !e) return e;
78
78
  let t = e.toString();
79
79
  return t === "[object Object]" ? JSON.stringify(e) : t;
80
80
  }
81
- function pt(e, t) {
82
- return e === t ? !0 : e == null || t == null ? !1 : typeof e == "object" && "equals" in e && typeof e.equals == "function" ? e.equals(t) : typeof t == "object" && "equals" in t && typeof t.equals == "function" ? t.equals(e) : ft(e) === ft(t);
81
+ function ut(e, t) {
82
+ return e === t ? !0 : e == null || t == null ? !1 : typeof e == "object" && "equals" in e && typeof e.equals == "function" ? e.equals(t) : typeof t == "object" && "equals" in t && typeof t.equals == "function" ? t.equals(e) : lt(e) === lt(t);
83
83
  }
84
- function mt(e, t) {
85
- if (t.removed.length > 0 ? dt(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => pt(dt(e), dt(t)))).map((e) => t.replaced.find((t) => pt(dt(t), dt(e))) ?? e), ...t.added];
84
+ function dt(e, t) {
85
+ if (t.removed.length > 0 ? ct(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => ut(ct(e), ct(t)))).map((e) => t.replaced.find((t) => ut(ct(t), ct(e))) ?? e), ...t.added];
86
86
  let n = new Set(t.removed.map((e) => JSON.stringify(e)));
87
87
  return [...e.filter((e) => !n.has(JSON.stringify(e))), ...t.added];
88
88
  }
89
89
  // src/hostedBasePath.ts
90
- function ht() {
90
+ function ft() {
91
91
  let e = globalThis.document?.baseURI ?? globalThis.location?.href;
92
92
  if (!e) return "";
93
93
  try {
@@ -96,61 +96,61 @@ function ht() {
96
96
  return "";
97
97
  }
98
98
  }
99
- function gt(e) {
100
- return e || ht();
99
+ function pt(e) {
100
+ return e || ft();
101
101
  }
102
102
  // src/queryExecutor.ts
103
- var _t;
104
- function vt(e) {
105
- _t = e;
103
+ var mt;
104
+ function ht(e) {
105
+ mt = e;
106
106
  }
107
- function yt(e, t) {
108
- let n = Be(e);
109
- return n === "ambiguous" && t && (n = Be(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), bt(n) ? n : t ? _t?.(t) : void 0;
107
+ function gt(e, t) {
108
+ let n = Le(e);
109
+ return n === "ambiguous" && t && (n = Le(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), _t(n) ? n : t ? mt?.(t) : void 0;
110
110
  }
111
- function bt(e) {
112
- return typeof e == "function" && (e.prototype instanceof Re || e.prototype instanceof Ie);
111
+ function _t(e) {
112
+ return typeof e == "function" && (e.prototype instanceof Fe || e.prototype instanceof Ne);
113
113
  }
114
- function xt(e, t) {
115
- e.setMicroservice(t.microservice), e.setApiBasePath(gt(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = Le.noPaging;
114
+ function vt(e, t) {
115
+ e.setMicroservice(t.microservice), e.setApiBasePath(pt(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = Pe.noPaging;
116
116
  }
117
- function St(e, t, n) {
117
+ function yt(e, t, n) {
118
118
  let r = new e();
119
- return xt(r, n), r.perform(t);
119
+ return vt(r, n), r.perform(t);
120
120
  }
121
- function Ct(e, t, n, r) {
121
+ function bt(e, t, n, r) {
122
122
  let i = new e();
123
- if (i instanceof Ie) return xt(i, n), i.subscribe(r, t);
123
+ if (i instanceof Ne) return vt(i, n), i.subscribe(r, t);
124
124
  }
125
- function wt(e) {
126
- if (R(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
125
+ function xt(e) {
126
+ if (V(e)) return typeof e.subject == "string" ? e.subject : typeof e.path == "string" ? e.path : void 0;
127
127
  }
128
- var Tt = "STAGE-SCENE-ACTION-001", Et = "item.";
129
- function R(e) {
128
+ var St = "STAGE-SCENE-ACTION-001", Ct = "item.";
129
+ function V(e) {
130
130
  return typeof e == "object" && !!e && !Array.isArray(e);
131
131
  }
132
- function Dt(e, t) {
132
+ function wt(e, t) {
133
133
  let n = e;
134
134
  for (let e of t.split(".").filter(Boolean)) {
135
- if (!R(n)) return;
135
+ if (!V(n)) return;
136
136
  n = n[e];
137
137
  }
138
138
  return n;
139
139
  }
140
- function Ot(e) {
140
+ function Tt(e) {
141
141
  return e === null || [
142
142
  "string",
143
143
  "number",
144
144
  "boolean"
145
145
  ].includes(typeof e);
146
146
  }
147
- function kt(e, t) {
147
+ function Et(e, t) {
148
148
  if (typeof e == "number") return t[e];
149
149
  if (typeof e == "string") return t.find((t) => t.toLowerCase() === e.toLowerCase());
150
150
  }
151
- function At(e, t, n, r) {
151
+ function Dt(e, t, n, r) {
152
152
  if (r !== void 0 && (t === "Equal" || t === "NotEqual")) {
153
- let i = kt(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
153
+ let i = Et(e, r), a = typeof n == "string" ? r.find((e) => e.toLowerCase() === n.toLowerCase()) : void 0;
154
154
  return i === void 0 || a === void 0 ? !1 : t === "Equal" ? i === a : i !== a;
155
155
  }
156
156
  switch (t) {
@@ -165,56 +165,56 @@ function At(e, t, n, r) {
165
165
  default: return;
166
166
  }
167
167
  }
168
- function jt(e, t) {
169
- if (R(e)) {
168
+ function Ot(e, t) {
169
+ if (V(e)) {
170
170
  if (e.kind === "comparison") {
171
- let n = wt(e.left);
172
- if (typeof n != "string" || !n.startsWith(Et) || typeof e.operator != "string" || !Ot(e.right)) return;
171
+ let n = xt(e.left);
172
+ if (typeof n != "string" || !n.startsWith(Ct) || typeof e.operator != "string" || !Tt(e.right)) return;
173
173
  let r = Array.isArray(e.enumeration) && e.enumeration.every((e) => typeof e == "string") ? e.enumeration : void 0;
174
- return At(Dt(t, n.slice(5)), e.operator, e.right, r);
174
+ return Dt(wt(t, n.slice(5)), e.operator, e.right, r);
175
175
  }
176
176
  if (e.kind === "logical") {
177
- let n = jt(e.left, t), r = jt(e.right, t);
177
+ let n = Ot(e.left, t), r = Ot(e.right, t);
178
178
  return n === void 0 || r === void 0 ? void 0 : e.operator === "And" ? n && r : e.operator === "Or" ? n || r : void 0;
179
179
  }
180
180
  }
181
181
  }
182
- function Mt(e) {
183
- return e.every((e) => jt(e, {}) !== void 0);
182
+ function kt(e) {
183
+ return e.every((e) => Ot(e, {}) !== void 0);
184
184
  }
185
- function Nt(e, t) {
186
- if (Mt(e)) return e.findIndex((e) => jt(e, t) === !0);
185
+ function At(e, t) {
186
+ if (kt(e)) return e.findIndex((e) => Ot(e, t) === !0);
187
187
  }
188
- function Pt(e, t) {
189
- if (!R(e) || !Array.isArray(e.alternatives) || !R(t)) return;
190
- let n = Nt(e.alternatives, t);
188
+ function jt(e, t) {
189
+ if (!V(e) || !Array.isArray(e.alternatives) || !V(t)) return;
190
+ let n = At(e.alternatives, t);
191
191
  if (n !== void 0) {
192
192
  if (e.kind === "firstMatch" && typeof e.index == "number") return n === e.index;
193
193
  if (e.kind === "otherwise") return n === -1;
194
194
  }
195
195
  }
196
- function Ft(e, t) {
197
- if (e.startsWith(Et) && R(t)) return Dt(t, e.slice(5));
196
+ function Mt(e, t) {
197
+ if (e.startsWith(Ct) && V(t)) return wt(t, e.slice(5));
198
198
  }
199
199
  // src/stageSession.ts
200
- var It = "stage.session.";
201
- function Lt(e) {
200
+ var Nt = "stage.session.";
201
+ function Pt(e) {
202
202
  try {
203
203
  return globalThis.localStorage?.getItem(`stage.session.${e}`) || void 0;
204
204
  } catch {
205
205
  return;
206
206
  }
207
207
  }
208
- function Rt(e) {
209
- let t = Lt(e);
208
+ function Ft(e) {
209
+ let t = Pt(e);
210
210
  if (t) return t;
211
211
  let n = globalThis.crypto.randomUUID();
212
212
  try {
213
- globalThis.localStorage?.setItem(`${It}${e}`, n);
213
+ globalThis.localStorage?.setItem(`${Nt}${e}`, n);
214
214
  } catch {}
215
215
  return n;
216
216
  }
217
- function zt() {
217
+ function It() {
218
218
  let e = {};
219
219
  try {
220
220
  let t = globalThis.localStorage;
@@ -228,7 +228,7 @@ function zt() {
228
228
  return e;
229
229
  }
230
230
  // src/stageData.tsx
231
- var Bt = "cratis.stage.data-changed", Vt = t({
231
+ var Lt = "cratis.stage.data-changed", Rt = t(() => () => void 0), zt = t({
232
232
  locale: "",
233
233
  locales: [],
234
234
  screen: "",
@@ -248,18 +248,22 @@ var Bt = "cratis.stage.data-changed", Vt = t({
248
248
  queryResults: {},
249
249
  refreshQuery: () => void 0,
250
250
  refreshAfterCommand: () => void 0,
251
+ settling: !1,
251
252
  resolveBinding: () => void 0,
252
253
  resolveArgument: () => void 0,
253
254
  registerQueryResult: () => void 0,
254
255
  refreshVersion: 0
255
- }), Ht = [
256
+ }), Bt = [
256
257
  500,
257
258
  1500,
258
- 3e3
259
- ], Ut = {};
260
- function Wt({ routes: e, routesReady: t = !0, parameters: n = Ut, locale: i, locales: o, screen: u, children: d }) {
261
- let [f, p] = l({}), [m, h] = l(0), [g, _] = l({}), [v, y] = l(), [x, C] = l({}), [w, ee] = l({}), [T, ne] = l({}), [E, re] = l({ version: 0 }), ie = s(() => Xt(T), [T]), ae = r((e, t) => {
262
- p((n) => {
259
+ 3e3,
260
+ 6e3,
261
+ 1e4,
262
+ 15e3
263
+ ], Vt = {};
264
+ function Ht({ routes: e, routesReady: t = !0, parameters: n = Vt, locale: i, locales: o, screen: c, children: u }) {
265
+ let [d, f] = l({}), [p, m] = l(0), [h, g] = l({}), [_, v] = l(), [y, x] = l({}), [C, w] = l({}), [T, E] = l({}), [D, O] = l({ version: 0 }), te = s(() => Qt(T), [T]), ne = r((e, t) => {
266
+ f((n) => {
263
267
  if (!t) {
264
268
  let { [e]: t, ...r } = n;
265
269
  return r;
@@ -269,253 +273,290 @@ function Wt({ routes: e, routesReady: t = !0, parameters: n = Ut, locale: i, loc
269
273
  [e]: t
270
274
  };
271
275
  });
272
- }, []), D = n, oe = s(() => zt(), [m]), se = s(() => ({
273
- name: u,
276
+ }, []), k = n, A = s(() => It(), [p]), re = s(() => ({
277
+ name: c,
274
278
  keys: {
275
- ...oe,
279
+ ...A,
276
280
  ...n
277
281
  }
278
282
  }), [
279
283
  n,
280
- u,
281
- oe
282
- ]), ce = r((e, t) => {
283
- _((n) => ({
284
+ c,
285
+ A
286
+ ]), ie = r((e, t) => {
287
+ g((n) => ({
284
288
  ...n,
285
289
  [e]: t
286
- })), y(t ? e : (t) => t === e ? void 0 : t);
287
- }, []), le = r((e) => {
288
- _((t) => ({
290
+ })), v(t ? e : (t) => t === e ? void 0 : t);
291
+ }, []), ae = r((e) => {
292
+ g((t) => ({
289
293
  ...t,
290
294
  [e]: void 0
291
- })), y((t) => t === e ? void 0 : t);
292
- }, []), ue = r((e, t, n) => {
293
- ee((r) => {
294
- let i = H(r[e]) ? r[e] : {};
295
+ })), v((t) => t === e ? void 0 : t);
296
+ }, []), oe = r((e, t, n) => {
297
+ w((r) => {
298
+ let i = G(r[e]) ? r[e] : {};
295
299
  return {
296
300
  ...r,
297
- [e]: Yt(i, t.split(".").filter(Boolean), n)
301
+ [e]: Zt(i, t.split(".").filter(Boolean), n)
298
302
  };
299
303
  });
300
- }, []), O = r((e) => re((t) => ({
304
+ }, []), j = r((e) => O((t) => ({
301
305
  query: e,
302
306
  version: t.version + 1
303
- })), []), de = c([]), fe = r(() => {
304
- h((e) => e + 1), O();
305
- for (let e of Ht) de.current.push(setTimeout(() => O(), e));
306
- }, [O]);
307
- a(() => () => de.current.forEach(clearTimeout), []), a(() => {
308
- let e = () => O(), t = (e) => O(e.detail?.query);
309
- return globalThis.addEventListener(Bt, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
310
- globalThis.removeEventListener(Bt, e), globalThis.removeEventListener("cratis.scene.refresh", t);
307
+ })), []), { settling: se, refreshAfterCommand: ce, registerAwaitingQuery: le } = Ut(j, m);
308
+ a(() => {
309
+ let e = () => j(), t = (e) => j(e.detail?.query);
310
+ return globalThis.addEventListener(Lt, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
311
+ globalThis.removeEventListener(Lt, e), globalThis.removeEventListener("cratis.scene.refresh", t);
311
312
  };
312
- }, [O]);
313
- let k = v ? g[v] : void 0, pe = r((e) => {
313
+ }, [j]);
314
+ let M = _ ? h[_] : void 0, ue = r((e) => {
314
315
  if (e === void 0 || typeof e != "string" && e.path === "$guard") return;
315
- if (typeof e == "string") return Zt(e, k, g, f, x, D, se, i, o);
316
- let t = Kt(k, f, x, {
317
- ...ie,
318
- ...w
319
- }, g);
316
+ if (typeof e == "string") return $t(e, M, h, d, y, k, re, i, o);
317
+ let t = Jt(M, d, y, {
318
+ ...te,
319
+ ...C
320
+ }, h);
320
321
  if (!e.kind && e.path.startsWith("component.")) return S(e.path, t);
321
- if (!e.kind) return Zt(e.path, k, g, f, x, D, se, i, o);
322
- let n = te(e, t);
322
+ if (!e.kind) return $t(e.path, M, h, d, y, k, re, i, o);
323
+ let n = ee(e, t);
323
324
  return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), b(t)(e);
324
325
  }, [
325
- w,
326
+ C,
326
327
  i,
327
328
  o,
328
- x,
329
- D,
330
- ie,
331
- f,
332
- se,
333
- k,
334
- g
335
- ]), me = r((e) => e ? S(e, Kt(k, f, x, {
336
- ...ie,
337
- ...w
338
- }, g)) : void 0, [
339
- w,
340
- x,
341
- ie,
342
- f,
329
+ y,
343
330
  k,
344
- g
345
- ]), he = r((e, t) => ne((n) => ({
331
+ te,
332
+ d,
333
+ re,
334
+ M,
335
+ h
336
+ ]), de = r((e) => e ? S(e, Jt(M, d, y, {
337
+ ...te,
338
+ ...C
339
+ }, h)) : void 0, [
340
+ C,
341
+ y,
342
+ te,
343
+ d,
344
+ M,
345
+ h
346
+ ]), fe = r((e, t) => E((n) => ({
346
347
  ...n,
347
348
  [e]: t
348
- })), []), ge = r((e) => ne((t) => {
349
+ })), []), pe = r((e) => E((t) => {
349
350
  if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
350
351
  let n = { ...t };
351
352
  return delete n[e], n;
352
- }), []), _e = s(() => Kt(void 0, f, {}, {}, {}).queryResults, [f]), ve = s(() => ({
353
+ }), []), me = s(() => Jt(void 0, d, {}, {}, {}).queryResults, [d]), he = s(() => ({
353
354
  locale: i,
354
355
  locales: o,
355
- screen: u,
356
+ screen: c,
356
357
  routes: e,
357
358
  routesReady: t,
358
- parameters: D,
359
- session: oe,
360
- queries: f,
361
- selected: k,
362
- selections: g,
363
- selectRow: ce,
364
- clearSelection: le,
365
- setState: (e, t) => C((n) => Yt(n, e.split(".").filter(Boolean), t)),
366
- setComponentOutput: ue,
367
- publishComponentOutputs: he,
368
- withdrawComponentOutputs: ge,
369
- queryResults: _e,
370
- refreshQuery: O,
371
- refreshAfterCommand: fe,
372
- resolveBinding: pe,
373
- resolveArgument: me,
374
- registerQueryResult: ae,
375
- refreshVersion: E.version,
376
- refreshQueryName: E.query
359
+ parameters: k,
360
+ session: A,
361
+ queries: d,
362
+ selected: M,
363
+ selections: h,
364
+ selectRow: ie,
365
+ clearSelection: ae,
366
+ setState: (e, t) => x((n) => Zt(n, e.split(".").filter(Boolean), t)),
367
+ setComponentOutput: oe,
368
+ publishComponentOutputs: fe,
369
+ withdrawComponentOutputs: pe,
370
+ queryResults: me,
371
+ refreshQuery: j,
372
+ refreshAfterCommand: ce,
373
+ settling: se,
374
+ resolveBinding: ue,
375
+ resolveArgument: de,
376
+ registerQueryResult: ne,
377
+ refreshVersion: D.version,
378
+ refreshQueryName: D.query
377
379
  }), [
378
- le,
380
+ ae,
379
381
  i,
380
382
  o,
381
- f,
383
+ d,
384
+ ce,
385
+ se,
386
+ j,
387
+ D.query,
388
+ D.version,
389
+ ne,
382
390
  fe,
383
- O,
384
- E.query,
385
- E.version,
386
- ae,
387
- he,
388
- ge,
389
- _e,
390
- me,
391
391
  pe,
392
+ me,
393
+ de,
394
+ ue,
392
395
  e,
393
396
  t,
394
- D,
395
- oe,
396
- u,
397
- ce,
398
397
  k,
399
- g,
400
- ue
398
+ A,
399
+ c,
400
+ ie,
401
+ M,
402
+ h,
403
+ oe
401
404
  ]);
402
- return /* @__PURE__ */ F(Vt.Provider, {
403
- value: ve,
404
- children: d
405
+ return /* @__PURE__ */ R(zt.Provider, {
406
+ value: he,
407
+ children: /* @__PURE__ */ R(Rt.Provider, {
408
+ value: le,
409
+ children: u
410
+ })
405
411
  });
406
412
  }
407
- var z = () => i(Vt);
408
- function B(e) {
409
- let { refreshQueryName: t, refreshVersion: n, registerQueryResult: o } = z(), s = i(Fe), u = e.publish !== !1, d = r((e, t) => {
410
- u && o(e, t);
411
- }, [u, o]), [f, p] = l([]), [m, h] = l(""), [g, _] = l(!1), [v, y] = l(0), b = c(0), x = c(!1), S = e.ready ?? !0, C = !!e.name && S, w = JSON.stringify(e.arguments ?? {});
413
+ function Ut(e, t) {
414
+ let n = c([]), i = c(0), o = c(0), s = c(/* @__PURE__ */ new Set()), [u, d] = l(!1), f = r(() => (o.current += 1, () => {
415
+ --o.current, o.current === 0 && s.current.forEach((e) => e());
416
+ }), []), p = r(() => {
417
+ t((e) => e + 1), e(), i.current += 1, d(!0), n.current.push(...Wt(e, s.current, () => {
418
+ --i.current, i.current === 0 && d(!1);
419
+ }, () => o.current > 0));
420
+ }, [e, t]);
421
+ return a(() => () => n.current.forEach(clearTimeout), []), {
422
+ settling: u,
423
+ refreshAfterCommand: p,
424
+ registerAwaitingQuery: f
425
+ };
426
+ }
427
+ function Wt(e, t, n, r) {
428
+ let i = [], a = () => {
429
+ i.forEach(clearTimeout), t.delete(a), n();
430
+ }, o = Bt[Bt.length - 1];
431
+ for (let n of Bt) i.push(setTimeout(() => {
432
+ e(), n === 3e3 && (t.add(a), r() || a()), n === o && a();
433
+ }, n));
434
+ return i;
435
+ }
436
+ var H = () => i(zt);
437
+ function U(e) {
438
+ let { refreshQueryName: t, refreshVersion: n, registerQueryResult: o, settling: s } = H(), u = i(Me), d = e.publish !== !1, f = r((e, t) => {
439
+ d && o(e, t);
440
+ }, [d, o]), p = e.ready ?? !0, m = !!e.name && p, [h, g] = l([]), [_, v] = l(""), [y, b] = l(m), [x, S] = l(0), C = c(0), w = c(!1), T = JSON.stringify(e.arguments ?? {});
412
441
  return a(() => {
413
- if (!C) {
414
- b.current += 1, p([]), h(""), _(!1), d(e.scope, void 0);
442
+ if (!m) {
443
+ C.current += 1, g([]), v(""), b(!1), f(e.scope, void 0);
415
444
  return;
416
445
  }
417
- let t = b.current + 1;
418
- b.current = t;
419
- let n = new AbortController(), r = JSON.parse(w), i = yt(e.name ?? "", e.route);
420
- _(!0), h("");
446
+ let t = C.current + 1;
447
+ C.current = t;
448
+ let n = new AbortController(), r = JSON.parse(T), i = gt(e.name ?? "", e.route);
449
+ b(!0), v("");
421
450
  let a = (e) => {
422
- b.current !== t || n.signal.aborted || (x.current = !1, p([]), h(e instanceof Error ? e.message : String(e)), _(!1));
423
- }, o = [], c = (e) => {
424
- if (b.current !== t || n.signal.aborted) return;
425
- let r = en(e);
426
- r ? a(Error(r)) : e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ? mt(o, e.changeSet) : e.data, p(tn(o)), h(""), _(!1));
451
+ C.current !== t || n.signal.aborted || (w.current = !1, g([]), v(e instanceof Error ? e.message : String(e)), b(!1));
452
+ }, o = [], s = (e) => {
453
+ if (C.current !== t || n.signal.aborted) return;
454
+ let r = nn(e);
455
+ r ? a(Error(r)) : e.isReady !== !1 && (o = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(o) ? dt(o, e.changeSet) : e.data, g(rn(o)), v(""), b(!1));
427
456
  };
428
457
  if (!i) return a(/* @__PURE__ */ Error(`The modeled query “${e.name}” is not registered by this Stage.`)), () => n.abort();
429
- let l = i.prototype instanceof Ie, u = () => Promise.resolve().then(() => St(i, l ? {
458
+ let c = i.prototype instanceof Ne, l = () => Promise.resolve().then(() => yt(i, c ? {
430
459
  ...r,
431
460
  waitForFirstResult: !0
432
- } : r, s)).then(c).catch(a);
433
- if (!l) return u(), () => n.abort();
434
- x.current = !0;
435
- let f, m = globalThis.setTimeout(() => {
436
- b.current !== t || n.signal.aborted || (x.current = !1, f?.unsubscribe(), f = void 0, u());
461
+ } : r, u)).then(s).catch(a);
462
+ if (!c) return l(), () => n.abort();
463
+ w.current = !0;
464
+ let d, p = globalThis.setTimeout(() => {
465
+ C.current !== t || n.signal.aborted || (w.current = !1, d?.unsubscribe(), d = void 0, l());
437
466
  }, 15e3);
438
467
  try {
439
- f = Ct(i, r, s, (e) => {
440
- e.isReady !== !1 && globalThis.clearTimeout(m), c(e);
468
+ d = bt(i, r, u, (e) => {
469
+ e.isReady !== !1 && globalThis.clearTimeout(p), s(e);
441
470
  });
442
471
  } catch {
443
- globalThis.clearTimeout(m), x.current = !1, u();
472
+ globalThis.clearTimeout(p), w.current = !1, l();
444
473
  }
445
474
  return () => {
446
- n.abort(), globalThis.clearTimeout(m), x.current = !1, f?.unsubscribe();
475
+ n.abort(), globalThis.clearTimeout(p), w.current = !1, d?.unsubscribe();
447
476
  };
448
477
  }, [
449
- C,
450
- s,
451
- w,
452
- v,
453
- d,
478
+ m,
479
+ u,
480
+ T,
481
+ x,
482
+ f,
454
483
  e.name,
455
484
  e.route,
456
485
  e.scope
457
486
  ]), a(() => {
458
- n !== 0 && (t && t !== e.name && t !== e.scope || x.current || y((e) => e + 1));
487
+ n !== 0 && (t && t !== e.name && t !== e.scope || w.current || S((e) => e + 1));
459
488
  }, [
460
489
  t,
461
490
  n,
462
491
  e.name,
463
492
  e.scope
464
493
  ]), a(() => {
465
- C ? d(e.scope, {
494
+ m ? f(e.scope, {
466
495
  name: e.name,
467
496
  list: e.list,
468
497
  alias: e.alias,
469
498
  route: e.route ?? "",
470
- rows: f,
471
- loading: g,
472
- error: m,
473
- arguments: JSON.parse(w)
474
- }) : d(e.scope, void 0);
499
+ rows: h,
500
+ loading: y,
501
+ error: _,
502
+ arguments: JSON.parse(T)
503
+ }) : f(e.scope, void 0);
475
504
  }, [
476
- C,
477
- w,
478
505
  m,
479
- g,
480
- d,
506
+ T,
507
+ _,
508
+ y,
509
+ f,
481
510
  e.alias,
482
511
  e.list,
483
512
  e.name,
484
513
  e.route,
485
514
  e.scope,
486
- f
515
+ h
487
516
  ]), {
488
- rows: f,
489
- loading: g,
490
- error: m,
517
+ rows: h,
518
+ loading: y,
519
+ awaitingCommand: Gt(m, h, _, s),
520
+ error: _,
491
521
  refresh: () => {
492
- x.current || y((e) => e + 1);
522
+ w.current || S((e) => e + 1);
493
523
  }
494
524
  };
495
525
  }
496
- function Gt() {
497
- globalThis.dispatchEvent(new CustomEvent(Bt));
526
+ function Gt(e, t, n, r) {
527
+ let o = c(!1);
528
+ t.length > 0 && (o.current = !0);
529
+ let s = i(Rt), l = Kt(e, t, n, r) && !o.current;
530
+ return a(() => {
531
+ if (l) return s();
532
+ }, [l, s]), l;
533
+ }
534
+ function Kt(e, t, n, r) {
535
+ return !(!e || !r || n || t.length !== 0);
536
+ }
537
+ function qt() {
538
+ globalThis.dispatchEvent(new CustomEvent(Lt));
498
539
  }
499
- function Kt(e, t, n, r, i) {
540
+ function Jt(e, t, n, r, i) {
500
541
  let a = Object.entries(t).sort(([, e], [, t]) => Number(e.list === !0) - Number(t.list === !0));
501
542
  return {
502
543
  dataContext: e,
503
544
  queryResults: Object.fromEntries(a.flatMap(([e, t]) => {
504
- let n = t.list ? t.rows : qt(t.rows);
545
+ let n = t.list ? t.rows : Yt(t.rows);
505
546
  return [
506
547
  [e, n],
507
548
  ...t.name ? [[t.name, n]] : [],
508
549
  ...t.alias ? [[t.alias, n]] : []
509
550
  ];
510
551
  })),
511
- componentOutputs: Jt(r, i),
552
+ componentOutputs: Xt(r, i),
512
553
  state: n
513
554
  };
514
555
  }
515
- function qt(e) {
556
+ function Yt(e) {
516
557
  return e.length === 1 ? e[0] : e;
517
558
  }
518
- function Jt(e, t) {
559
+ function Xt(e, t) {
519
560
  let n = { ...e };
520
561
  for (let [e, r] of Object.entries(t)) r && (n[e] = {
521
562
  ...r,
@@ -523,17 +564,17 @@ function Jt(e, t) {
523
564
  });
524
565
  return n;
525
566
  }
526
- function Yt(e, t, n) {
567
+ function Zt(e, t, n) {
527
568
  let [r, ...i] = t;
528
569
  return r ? i.length === 0 ? {
529
570
  ...e,
530
571
  [r]: n
531
572
  } : {
532
573
  ...e,
533
- [r]: Yt(H(e[r]) ? e[r] : {}, i, n)
574
+ [r]: Zt(G(e[r]) ? e[r] : {}, i, n)
534
575
  } : e;
535
576
  }
536
- function Xt(e) {
577
+ function Qt(e) {
537
578
  let t = {};
538
579
  for (let n of Object.values(e)) for (let [e, r] of Object.entries(n)) t[e] = {
539
580
  ...t[e],
@@ -541,30 +582,30 @@ function Xt(e) {
541
582
  };
542
583
  return t;
543
584
  }
544
- function Zt(e, t, n, r, i, a, o, s, c) {
585
+ function $t(e, t, n, r, i, a, o, s, c) {
545
586
  if (!e) return;
546
587
  let l = e.replace(/^\$\.?/, "").split(".").filter(Boolean);
547
588
  if (l.length !== 0) {
548
589
  if (l[0] === "screen") {
549
590
  if (l.length === 1) return { name: o.name };
550
- let e = V(o, l.slice(1));
551
- return e === void 0 && l[1] === "keys" && l.length === 3 ? V(t, [l[2]]) : e;
591
+ let e = W(o, l.slice(1));
592
+ return e === void 0 && l[1] === "keys" && l.length === 3 ? W(t, [l[2]]) : e;
552
593
  }
553
- return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? $t(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? Qt(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) ?? $t(r, void 0, l.join(".")) ?? V(i, l);
594
+ return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? tn(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? en(l.slice(1).join("."), t, n) : l[0] === "state" ? W(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : W(t, l) ?? tn(r, void 0, l.join(".")) ?? W(i, l);
554
595
  }
555
596
  }
556
- function Qt(e, t, n) {
597
+ function en(e, t, n) {
557
598
  let r = e?.split(".").filter(Boolean) ?? [];
558
- return r.length > 0 && Object.hasOwn(n, r[0]) ? V(n[r[0]], r.slice(1)) : r.length === 0 ? t : V(t, r);
599
+ return r.length > 0 && Object.hasOwn(n, r[0]) ? W(n[r[0]], r.slice(1)) : r.length === 0 ? t : W(t, r);
559
600
  }
560
- function $t(e, t, n) {
601
+ function tn(e, t, n) {
561
602
  let r = Object.entries(e).filter(([e, n]) => t ? n.name === t || e === t : !n.list).map(([, e]) => e.rows);
562
603
  if (r.length === 0) return;
563
604
  let i = r.flat(), a = n?.split(".").filter(Boolean) ?? [];
564
- return a.length === 0 ? i : i.length === 1 ? V(i[0], a) : i.map((e) => V(e, a));
605
+ return a.length === 0 ? i : i.length === 1 ? W(i[0], a) : i.map((e) => W(e, a));
565
606
  }
566
- function en(e) {
567
- if (!H(e)) return "";
607
+ function nn(e) {
608
+ if (!G(e)) return "";
568
609
  if (e.isAuthorized === !1) return "The query answered 403.";
569
610
  if (e.isValid === !1 || e.hasExceptions === !0 || e.isSuccess === !1) {
570
611
  let t = Array.isArray(e.exceptionMessages) ? e.exceptionMessages.filter((e) => typeof e == "string") : [];
@@ -572,53 +613,53 @@ function en(e) {
572
613
  }
573
614
  return "";
574
615
  }
575
- function tn(e) {
576
- return Array.isArray(e) ? e.filter(H) : H(e) ? [e] : [];
616
+ function rn(e) {
617
+ return Array.isArray(e) ? e.filter(G) : G(e) ? [e] : [];
577
618
  }
578
- function V(e, t) {
619
+ function W(e, t) {
579
620
  let n = e;
580
621
  for (let e of t) {
581
- if (!H(n)) return;
622
+ if (!G(n)) return;
582
623
  n = n[e];
583
624
  }
584
625
  return n;
585
626
  }
586
- function H(e) {
627
+ function G(e) {
587
628
  return typeof e == "object" && !!e && !Array.isArray(e);
588
629
  }
589
630
  // src/stageComponentOutputs.ts
590
- function nn() {
591
- let e = o(), { publishComponentOutputs: t, withdrawComponentOutputs: n } = z();
631
+ function an() {
632
+ let e = o(), { publishComponentOutputs: t, withdrawComponentOutputs: n } = H();
592
633
  return a(() => () => n(e), [e, n]), r((n) => t(e, n), [t, e]);
593
634
  }
594
635
  // src/stageFormSchema.ts
595
- var rn = 8;
596
- function U(e) {
636
+ var on = 8;
637
+ function K(e) {
597
638
  if (!e) return [];
598
639
  try {
599
- return an(JSON.parse(e), 0);
640
+ return sn(JSON.parse(e), 0);
600
641
  } catch {
601
642
  return [];
602
643
  }
603
644
  }
604
- function an(e, t) {
605
- 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 = pn(e.properties) ? e.properties : {};
606
- return Object.entries(i).map(([e, i]) => on(e, i, !n || r.has(e), t));
645
+ function sn(e, t) {
646
+ 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 = hn(e.properties) ? e.properties : {};
647
+ return Object.entries(i).map(([e, i]) => cn(e, i, !n || r.has(e), t));
607
648
  }
608
- function on(e, t, n, r) {
649
+ function cn(e, t, n, r) {
609
650
  return {
610
651
  name: e,
611
652
  identifier: t?.format === "uuid" && typeof t["x-concept"] == "string" ? t["x-concept"] : void 0,
612
653
  ...t?.["x-identity"] === !0 ? { identity: !0 } : {},
613
654
  required: n,
614
- ...sn(t, r)
655
+ ...ln(t, r)
615
656
  };
616
657
  }
617
- function sn(e, t) {
658
+ function ln(e, t) {
618
659
  let n = e?.type;
619
660
  if (Array.isArray(n)) {
620
661
  let r = n.filter((e) => e !== "null");
621
- return r.length === 1 ? sn({
662
+ return r.length === 1 ? ln({
622
663
  ...e,
623
664
  type: r[0]
624
665
  }, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
@@ -629,8 +670,8 @@ function sn(e, t) {
629
670
  type: "date",
630
671
  withTime: e.format === "date-time"
631
672
  };
632
- if (n === "array") return cn(e, t);
633
- if (n === "object") return ln(e, t);
673
+ if (n === "array") return un(e, t);
674
+ if (n === "object") return dn(e, t);
634
675
  if (n === void 0 || n === "string") {
635
676
  let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
636
677
  return t.length > 0 ? {
@@ -640,79 +681,79 @@ function sn(e, t) {
640
681
  }
641
682
  return { unsupportedReason: `type ${String(n)}` };
642
683
  }
643
- function cn(e, t) {
684
+ function un(e, t) {
644
685
  let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
645
- if (t >= rn || e?.items === void 0) return n;
646
- let r = on("", e.items, !0, t + 1);
686
+ if (t >= on || e?.items === void 0) return n;
687
+ let r = cn("", e.items, !0, t + 1);
647
688
  return r.unsupportedReason || r.item ? n : { item: r };
648
689
  }
649
- function ln(e, t) {
690
+ function dn(e, t) {
650
691
  let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
651
- if (t >= rn || !pn(e?.properties) || Object.keys(e.properties).length === 0) return n;
652
- let r = an(e, t + 1), i = r.find((e) => e.unsupportedReason);
692
+ if (t >= on || !hn(e?.properties) || Object.keys(e.properties).length === 0) return n;
693
+ let r = sn(e, t + 1), i = r.find((e) => e.unsupportedReason);
653
694
  return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
654
695
  }
655
- function W(e) {
696
+ function q(e) {
656
697
  let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase();
657
698
  return t.charAt(0).toUpperCase() + t.slice(1);
658
699
  }
659
- function un(e, t, n) {
700
+ function fn(e, t, n) {
660
701
  if (t != null) {
661
- if (e.members && pn(t)) for (let r of e.members) {
662
- let e = t[r.name], i = W(r.name);
663
- if (dn(e)) {
702
+ if (e.members && hn(t)) for (let r of e.members) {
703
+ let e = t[r.name], i = q(r.name);
704
+ if (pn(e)) {
664
705
  if (r.required) return `${n}: ${i} is required`;
665
706
  continue;
666
707
  }
667
- let a = un(r, e, `${n} ${i.toLowerCase()}`);
708
+ let a = fn(r, e, `${n} ${i.toLowerCase()}`);
668
709
  if (a) return a;
669
710
  }
670
711
  if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
671
- let t = dn(i) ? `${n} ${r + 1} is required` : un(e.item, i, `${n} ${r + 1}`);
712
+ let t = pn(i) ? `${n} ${r + 1} is required` : fn(e.item, i, `${n} ${r + 1}`);
672
713
  if (t) return t;
673
714
  }
674
715
  }
675
716
  }
676
- function dn(e) {
717
+ function pn(e) {
677
718
  return e == null || e === "";
678
719
  }
679
- function fn(e, t) {
680
- 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 && pn(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
720
+ function mn(e, t) {
721
+ 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 && hn(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
681
722
  let r = e.members?.find((e) => e.name === t);
682
- return [t, r ? fn(r, n) : n];
683
- })) : e.item && Array.isArray(t) ? t.map((t) => fn(e.item, t)) : t;
723
+ return [t, r ? mn(r, n) : n];
724
+ })) : e.item && Array.isArray(t) ? t.map((t) => mn(e.item, t)) : t;
684
725
  }
685
- function pn(e) {
726
+ function hn(e) {
686
727
  return typeof e == "object" && !!e && !Array.isArray(e);
687
728
  }
688
729
  // src/stageActionSubject.ts
689
- var mn = /^item\.(.+)$/, hn = [
730
+ var gn = /^item\.(.+)$/, _n = [
690
731
  void 0,
691
732
  null,
692
733
  ""
693
734
  ];
694
- function gn(e) {
735
+ function vn(e) {
695
736
  let t = e.properties.actionSubject;
696
737
  return t === "item" || t === "screen" ? t : void 0;
697
738
  }
698
- function _n(e, t) {
739
+ function yn(e, t) {
699
740
  return e === "item" && t.length === 1 ? t[0] : void 0;
700
741
  }
701
- function vn(e, t) {
742
+ function bn(e, t) {
702
743
  return e === "item" && !t;
703
744
  }
704
- function yn(e, t) {
705
- let n = gn(e), r = e.properties.subjectValues;
745
+ function xn(e, t) {
746
+ let n = vn(e), r = e.properties.subjectValues;
706
747
  return {
707
748
  ...n === "screen" ? {
708
749
  selectableRows: [],
709
750
  selectedRows: []
710
751
  } : t,
711
752
  rowAction: e.properties.rowAction === !0 || n === "item",
712
- subjectValues: On(r) ? r : {}
753
+ subjectValues: An(r) ? r : {}
713
754
  };
714
755
  }
715
- function bn(e, t) {
756
+ function Sn(e, t) {
716
757
  return {
717
758
  ...t === "screen" ? {} : { rowAction: !0 },
718
759
  ...t === void 0 ? {} : {
@@ -721,12 +762,12 @@ function bn(e, t) {
721
762
  }
722
763
  };
723
764
  }
724
- function xn(e, t) {
725
- let n = Object.entries(Tn(e)).map(([e, n]) => [e, Dn(t, n)]);
726
- return Object.fromEntries(n.filter(([, e]) => !hn.includes(e)));
765
+ function Cn(e, t) {
766
+ let n = Object.entries(Dn(e)).map(([e, n]) => [e, kn(t, n)]);
767
+ return Object.fromEntries(n.filter(([, e]) => !_n.includes(e)));
727
768
  }
728
- function Sn(e, t, n) {
729
- let r = new Set(Object.keys(Tn(e))), i = t.filter((e) => e.identifier !== void 0 && e.required && Object.hasOwn(n, e.name)).map((e) => e.name), a = /* @__PURE__ */ new Set([...r, ...i]), o = Cn(e, t).filter((e) => !a.has(wn(e))), s = t.length > 0 || Array.isArray(e.properties.fields) ? {
769
+ function wn(e, t, n) {
770
+ let r = new Set(Object.keys(Dn(e))), i = t.filter((e) => e.identifier !== void 0 && e.required && Object.hasOwn(n, e.name)).map((e) => e.name), a = /* @__PURE__ */ new Set([...r, ...i]), o = Tn(e, t).filter((e) => !a.has(En(e))), s = t.length > 0 || Array.isArray(e.properties.fields) ? {
730
771
  fields: o,
731
772
  generationMode: "manual"
732
773
  } : {}, c = Object.fromEntries(i.map((e) => [e, n[e]]));
@@ -737,68 +778,68 @@ function Sn(e, t, n) {
737
778
  rowAction: !0,
738
779
  subjectValues: {
739
780
  ...c,
740
- ...xn(e, n)
781
+ ...Cn(e, n)
741
782
  },
742
783
  ...s
743
784
  }
744
785
  };
745
786
  }
746
- function Cn(e, t) {
787
+ function Tn(e, t) {
747
788
  let n = e.properties.fields;
748
789
  return Array.isArray(n) ? n : t.map((e) => ({
749
790
  name: e.name,
750
- label: W(e.name)
791
+ label: q(e.name)
751
792
  }));
752
793
  }
753
- function wn(e) {
794
+ function En(e) {
754
795
  let t = e.sourceProperty || e.name;
755
796
  return typeof t == "string" ? t : "";
756
797
  }
757
- function Tn(e) {
758
- let t = e.properties.subjectInputs, n = (On(t) ? Object.entries(t) : []).map(([e, t]) => [e, En(t)]);
798
+ function Dn(e) {
799
+ let t = e.properties.subjectInputs, n = (An(t) ? Object.entries(t) : []).map(([e, t]) => [e, On(t)]);
759
800
  return Object.fromEntries(n.filter((e) => e[1] !== void 0));
760
801
  }
761
- function En(e) {
762
- let t = On(e) ? e.subject : void 0;
763
- return typeof t == "string" ? mn.exec(t)?.[1] : void 0;
802
+ function On(e) {
803
+ let t = An(e) ? e.subject : void 0;
804
+ return typeof t == "string" ? gn.exec(t)?.[1] : void 0;
764
805
  }
765
- function Dn(e, t) {
766
- return t.split(".").reduce((e, t) => On(e) ? e[t] : void 0, e);
806
+ function kn(e, t) {
807
+ return t.split(".").reduce((e, t) => An(e) ? e[t] : void 0, e);
767
808
  }
768
- function On(e) {
809
+ function An(e) {
769
810
  return typeof e == "object" && !!e && !Array.isArray(e);
770
811
  }
771
812
  // src/commandExecutor.ts
772
- function G(e, t, n) {
813
+ function J(e, t, n) {
773
814
  for (let r of [
774
815
  t,
775
816
  n?.replace(/^\//, ""),
776
817
  e
777
818
  ]) {
778
819
  if (!r) continue;
779
- let t = ze(r);
780
- if (kn(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
820
+ let t = Ie(r);
821
+ if (jn(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
781
822
  }
782
823
  }
783
- function kn(e) {
784
- return typeof e == "function" && e.prototype instanceof qe;
824
+ function jn(e) {
825
+ return typeof e == "function" && e.prototype instanceof We;
785
826
  }
786
- function An(e, t) {
787
- return e.setApiBasePath(gt(t)), e;
827
+ function Mn(e, t) {
828
+ return e.setApiBasePath(pt(t)), e;
788
829
  }
789
- async function jn(e, t, n) {
790
- let r = G(e);
830
+ async function Nn(e, t, n) {
831
+ let r = J(e);
791
832
  if (!r) return {
792
833
  isSuccess: !1,
793
834
  validationErrors: [],
794
835
  messages: [`The modeled command “${e}” is not registered by this Stage.`]
795
836
  };
796
837
  let i = new r();
797
- i.setMicroservice(n.microservice), i.setApiBasePath(gt(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
838
+ i.setMicroservice(n.microservice), i.setApiBasePath(pt(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
798
839
  for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
799
- return Mn(e, await i.execute());
840
+ return Pn(e, await i.execute());
800
841
  }
801
- function Mn(e, t) {
842
+ function Pn(e, t) {
802
843
  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) => ({
803
844
  member: t,
804
845
  message: e.message
@@ -814,62 +855,62 @@ function Mn(e, t) {
814
855
  messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
815
856
  };
816
857
  }
817
- function Nn() {
818
- let e = i(Fe);
819
- return r((t, n) => jn(t, n, e), [e]);
858
+ function Fn() {
859
+ let e = i(Me);
860
+ return r((t, n) => Nn(t, n, e), [e]);
820
861
  }
821
862
  // src/stageNavigation.ts
822
- function Pn(e, t = {}) {
863
+ function In(e, t = {}) {
823
864
  let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
824
865
  return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
825
866
  }
826
- function K(e, t = {}) {
867
+ function Y(e, t = {}) {
827
868
  if (!globalThis.location) return;
828
- if (Fn === "path") {
829
- let n = Ln(e, t);
869
+ if (Ln === "path") {
870
+ let n = zn(e, t);
830
871
  if (`${globalThis.location.pathname}${globalThis.location.search}` === n) return;
831
872
  globalThis.history.pushState(null, "", n), globalThis.dispatchEvent(new PopStateEvent("popstate"));
832
873
  return;
833
874
  }
834
- let n = Pn(e, t);
875
+ let n = In(e, t);
835
876
  globalThis.location.hash !== n && (globalThis.location.hash = n);
836
877
  }
837
- var Fn = "hash";
838
- function In(e) {
839
- Fn = e;
878
+ var Ln = "hash";
879
+ function Rn(e) {
880
+ Ln = e;
840
881
  }
841
- function Ln(e, t = {}) {
882
+ function zn(e, t = {}) {
842
883
  let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
843
884
  return n ? `/${encodeURIComponent(e)}?${n}` : `/${encodeURIComponent(e)}`;
844
885
  }
845
- function Rn(e) {
846
- return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Ke)).map(([e, t]) => [e, String(t)]));
886
+ function Bn(e) {
887
+ return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Ue)).map(([e, t]) => [e, String(t)]));
847
888
  }
848
889
  // src/StageValueFields.tsx
849
- var zn = Ye((e) => /* @__PURE__ */ F(Bn, {
890
+ var Vn = Ke((e) => /* @__PURE__ */ R(Hn, {
850
891
  descriptor: e.descriptor,
851
- label: e.title ?? W(e.descriptor.name),
892
+ label: e.title ?? q(e.descriptor.name),
852
893
  value: e.value,
853
894
  onChange: e.onChange,
854
895
  onBlur: e.onBlur,
855
896
  invalid: e.invalid
856
897
  }), { defaultValue: void 0 });
857
- function Bn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
858
- return e.members ? /* @__PURE__ */ F(Vn, {
898
+ function Hn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
899
+ return e.members ? /* @__PURE__ */ R(Un, {
859
900
  descriptor: e,
860
901
  label: t,
861
902
  value: n,
862
903
  onChange: r,
863
904
  onBlur: i,
864
905
  invalid: a
865
- }) : e.item ? /* @__PURE__ */ F(Hn, {
906
+ }) : e.item ? /* @__PURE__ */ R(Wn, {
866
907
  descriptor: e,
867
908
  label: t,
868
909
  value: n,
869
910
  onChange: r,
870
911
  onBlur: i,
871
912
  invalid: a
872
- }) : /* @__PURE__ */ F(Un, {
913
+ }) : /* @__PURE__ */ R(Gn, {
873
914
  descriptor: e,
874
915
  label: t,
875
916
  value: n,
@@ -878,14 +919,14 @@ function Bn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
878
919
  invalid: a
879
920
  });
880
921
  }
881
- function Vn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
882
- let o = Kn(n) ? n : {};
883
- return /* @__PURE__ */ I("fieldset", {
922
+ function Un({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
923
+ let o = Jn(n) ? n : {};
924
+ return /* @__PURE__ */ z("fieldset", {
884
925
  className: "stage-record-field",
885
926
  "data-invalid": a ? "true" : void 0,
886
- children: [/* @__PURE__ */ F("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ F(Bn, {
927
+ children: [/* @__PURE__ */ R("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ R(Hn, {
887
928
  descriptor: e,
888
- label: W(e.name),
929
+ label: q(e.name),
889
930
  value: o[e.name],
890
931
  onBlur: i,
891
932
  onChange: (t) => r({
@@ -895,74 +936,74 @@ function Vn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
895
936
  }, e.name))]
896
937
  });
897
938
  }
898
- function Hn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
939
+ function Wn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
899
940
  let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
900
- return /* @__PURE__ */ I("fieldset", {
941
+ return /* @__PURE__ */ z("fieldset", {
901
942
  className: "stage-list-field",
902
943
  "data-invalid": a ? "true" : void 0,
903
944
  children: [
904
- /* @__PURE__ */ F("legend", { children: t }),
905
- s.length === 0 && /* @__PURE__ */ F("p", {
945
+ /* @__PURE__ */ R("legend", { children: t }),
946
+ s.length === 0 && /* @__PURE__ */ R("p", {
906
947
  className: "stage-note",
907
948
  children: "Nothing added yet."
908
949
  }),
909
- s.map((e, n) => /* @__PURE__ */ I("div", {
950
+ s.map((e, n) => /* @__PURE__ */ z("div", {
910
951
  className: "stage-list-field__row",
911
- children: [/* @__PURE__ */ F(Bn, {
952
+ children: [/* @__PURE__ */ R(Hn, {
912
953
  descriptor: o,
913
954
  label: `${t} ${n + 1}`,
914
955
  value: e,
915
956
  onBlur: i,
916
957
  onChange: (e) => c(s.map((t, r) => r === n ? e : t))
917
- }), /* @__PURE__ */ F("button", {
958
+ }), /* @__PURE__ */ R("button", {
918
959
  type: "button",
919
960
  "aria-label": `Remove ${t} ${n + 1}`,
920
961
  onClick: () => c(s.filter((e, t) => t !== n)),
921
962
  children: "Remove"
922
963
  })]
923
964
  }, n)),
924
- /* @__PURE__ */ F("button", {
965
+ /* @__PURE__ */ R("button", {
925
966
  type: "button",
926
967
  "aria-label": `Add ${t}`,
927
- onClick: () => c([...s, Wn(o)]),
968
+ onClick: () => c([...s, Kn(o)]),
928
969
  children: "Add"
929
970
  })
930
971
  ]
931
972
  });
932
973
  }
933
- function Un({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
974
+ function Gn({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
934
975
  let o = {
935
976
  "aria-invalid": a ? !0 : void 0,
936
977
  onBlur: i
937
978
  };
938
- if (e.options) return /* @__PURE__ */ I("label", {
979
+ if (e.options) return /* @__PURE__ */ z("label", {
939
980
  className: "stage-value-field",
940
- children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ I("select", {
981
+ children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ z("select", {
941
982
  ...o,
942
983
  value: typeof n == "string" ? n : "",
943
984
  onChange: (e) => r(e.target.value === "" ? void 0 : e.target.value),
944
- children: [/* @__PURE__ */ F("option", {
985
+ children: [/* @__PURE__ */ R("option", {
945
986
  value: "",
946
987
  children: ""
947
- }), e.options.map((e) => /* @__PURE__ */ F("option", {
988
+ }), e.options.map((e) => /* @__PURE__ */ R("option", {
948
989
  value: e,
949
- children: W(e)
990
+ children: q(e)
950
991
  }, e))]
951
992
  })]
952
993
  });
953
994
  switch (e.type) {
954
- case "boolean": return /* @__PURE__ */ I("label", {
995
+ case "boolean": return /* @__PURE__ */ z("label", {
955
996
  className: "stage-value-field stage-value-field--check",
956
- children: [/* @__PURE__ */ F("input", {
997
+ children: [/* @__PURE__ */ R("input", {
957
998
  ...o,
958
999
  type: "checkbox",
959
1000
  checked: n === !0,
960
1001
  onChange: (e) => r(e.target.checked)
961
- }), /* @__PURE__ */ F("span", { children: t })]
1002
+ }), /* @__PURE__ */ R("span", { children: t })]
962
1003
  });
963
- case "number": return /* @__PURE__ */ I("label", {
1004
+ case "number": return /* @__PURE__ */ z("label", {
964
1005
  className: "stage-value-field",
965
- children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
1006
+ children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ R("input", {
966
1007
  ...o,
967
1008
  type: "number",
968
1009
  step: "any",
@@ -970,18 +1011,18 @@ function Un({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
970
1011
  onChange: (e) => r(e.target.value === "" ? void 0 : Number(e.target.value))
971
1012
  })]
972
1013
  });
973
- case "date": return /* @__PURE__ */ I("label", {
1014
+ case "date": return /* @__PURE__ */ z("label", {
974
1015
  className: "stage-value-field",
975
- children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
1016
+ children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ R("input", {
976
1017
  ...o,
977
1018
  type: e.withTime ? "datetime-local" : "date",
978
1019
  value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
979
- onChange: (t) => r(t.target.value === "" ? void 0 : Gn(t.target.value, e.withTime === !0))
1020
+ onChange: (t) => r(t.target.value === "" ? void 0 : qn(t.target.value, e.withTime === !0))
980
1021
  })]
981
1022
  });
982
- default: return /* @__PURE__ */ I("label", {
1023
+ default: return /* @__PURE__ */ z("label", {
983
1024
  className: "stage-value-field",
984
- children: [/* @__PURE__ */ F("span", { children: t }), /* @__PURE__ */ F("input", {
1025
+ children: [/* @__PURE__ */ R("span", { children: t }), /* @__PURE__ */ R("input", {
985
1026
  ...o,
986
1027
  type: "text",
987
1028
  value: typeof n == "string" ? n : "",
@@ -990,19 +1031,19 @@ function Un({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
990
1031
  });
991
1032
  }
992
1033
  }
993
- function Wn(e) {
1034
+ function Kn(e) {
994
1035
  return e.members ? {} : void 0;
995
1036
  }
996
- function Gn(e, t) {
1037
+ function qn(e, t) {
997
1038
  if (!t) return e;
998
1039
  let n = new Date(e);
999
1040
  return Number.isNaN(n.getTime()) ? e : n.toISOString();
1000
1041
  }
1001
- function Kn(e) {
1042
+ function Jn(e) {
1002
1043
  return typeof e == "object" && !!e && !Array.isArray(e);
1003
1044
  }
1004
1045
  // src/stageScreenTables.tsx
1005
- function qn(e) {
1046
+ function Yn(e) {
1006
1047
  let t = /* @__PURE__ */ new Set(), n = (e) => {
1007
1048
  let r = e;
1008
1049
  if (r.componentName !== "core:outlet") {
@@ -1012,27 +1053,27 @@ function qn(e) {
1012
1053
  };
1013
1054
  return n(e), [...t];
1014
1055
  }
1015
- var Jn = t(void 0);
1016
- function Yn({ element: e, children: t }) {
1017
- let n = s(() => new Set(qn(e)), [e]);
1018
- return /* @__PURE__ */ F(Jn.Provider, {
1056
+ var Xn = t(void 0);
1057
+ function Zn({ element: e, children: t }) {
1058
+ let n = s(() => new Set(Yn(e)), [e]);
1059
+ return /* @__PURE__ */ R(Xn.Provider, {
1019
1060
  value: n,
1020
1061
  children: t
1021
1062
  });
1022
1063
  }
1023
- function Xn({ children: e }) {
1024
- return /* @__PURE__ */ F(Jn.Provider, {
1064
+ function Qn({ children: e }) {
1065
+ return /* @__PURE__ */ R(Xn.Provider, {
1025
1066
  value: void 0,
1026
1067
  children: e
1027
1068
  });
1028
1069
  }
1029
- function q() {
1030
- let e = i(Jn), { queries: t, selections: n } = z();
1070
+ function $n() {
1071
+ let e = i(Xn), { queries: t, selections: n } = H();
1031
1072
  return s(() => {
1032
1073
  let r = e ? Object.fromEntries(Object.entries(t).filter(([t]) => e.has(t))) : t, i = e ? Object.fromEntries(Object.entries(n).filter(([t]) => e.has(t))) : n;
1033
1074
  return {
1034
- selectableRows: hr(r),
1035
- selectedRows: gr(i, r)
1075
+ selectableRows: vr(r),
1076
+ selectedRows: yr(i, r)
1036
1077
  };
1037
1078
  }, [
1038
1079
  t,
@@ -1041,13 +1082,13 @@ function q() {
1041
1082
  ]);
1042
1083
  }
1043
1084
  // src/StageCommandForm.tsx
1044
- var Zn = t(void 0), Qn = t(null);
1045
- function $n({ element: e }) {
1046
- let t = z(), n = i(Fe), r = i(Zn), a = i(Qn), o = c(null), u = s(() => tr(e), [e]), d = s(() => Nr(e), [e]), f = typeof e.properties.schema == "string", p = s(() => u ? nr(u, d) : [], [u, d]), m = u ? G(u.command, Y(e, "typeName"), Y(e, "route")) : void 0, h = Y(e, "submitLabel") || "Submit", g = xr(e, p, t.resolveArgument), _ = yr(e, d, t), v = JSON.stringify(_ ?? null), y = s(() => _, [v]), { selectableRows: b, selectedRows: x, rowAction: S, subjectValues: C } = yn(e, q()), w = s(() => ({
1085
+ var er = t(void 0), tr = t(null);
1086
+ function nr({ element: e }) {
1087
+ let t = H(), n = i(Me), r = i(er), a = i(tr), o = c(null), u = s(() => ir(e), [e]), d = s(() => Lr(e), [e]), f = typeof e.properties.schema == "string", p = s(() => u ? ar(u, d) : [], [u, d]), m = u ? J(u.command, X(e, "typeName"), X(e, "route")) : void 0, h = X(e, "submitLabel") || "Submit", g = wr(e, p, t.resolveArgument), _ = Sr(e, d, t), v = JSON.stringify(_ ?? null), y = s(() => _, [v]), { selectableRows: b, selectedRows: x, rowAction: S, subjectValues: C } = xn(e, $n()), w = s(() => ({
1047
1088
  ...y,
1048
- ...cr(p, d, t.parameters, x, b, S),
1089
+ ...dr(p, d, t.parameters, x, b, S),
1049
1090
  ...C,
1050
- ...sr(p, t.parameters)
1091
+ ...ur(p, t.parameters)
1051
1092
  }), [
1052
1093
  y,
1053
1094
  p,
@@ -1057,140 +1098,140 @@ function $n({ element: e }) {
1057
1098
  b,
1058
1099
  S,
1059
1100
  C
1060
- ]), ee = s(() => u ? rr(u, p, d) : void 0, [
1101
+ ]), T = s(() => u ? or(u, p, d) : void 0, [
1061
1102
  u,
1062
1103
  p,
1063
1104
  d
1064
- ]), T = s(() => u ? jr(p, d) : [], [
1105
+ ]), E = s(() => u ? Fr(p, d) : [], [
1065
1106
  u,
1066
1107
  p,
1067
1108
  d
1068
- ]), te = s(() => u ? Mr(u.layout, p) : [], [u, p]), [ne, E] = l([]);
1069
- return u ? !m && !t.routesReady ? /* @__PURE__ */ I("p", {
1109
+ ]), ee = s(() => u ? Ir(u.layout, p) : [], [u, p]), [D, O] = l([]);
1110
+ return u ? !m && !t.routesReady ? /* @__PURE__ */ z("p", {
1070
1111
  className: "stage-note",
1071
1112
  children: [
1072
1113
  "The modeled command “",
1073
1114
  u.command,
1074
1115
  "” is waiting for Stage routes."
1075
1116
  ]
1076
- }) : m ? p.length === 0 && !f && e.properties.parameterless !== !0 ? /* @__PURE__ */ F(er, {
1117
+ }) : m ? p.length === 0 && !f && e.properties.parameterless !== !0 ? /* @__PURE__ */ R(rr, {
1077
1118
  form: u,
1078
1119
  messages: [`The modeled command “${u.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
1079
- }) : T.length > 0 ? /* @__PURE__ */ F(er, {
1120
+ }) : E.length > 0 ? /* @__PURE__ */ R(rr, {
1080
1121
  form: u,
1081
- messages: T
1082
- }) : /* @__PURE__ */ F("section", {
1122
+ messages: E
1123
+ }) : /* @__PURE__ */ R("section", {
1083
1124
  ref: o,
1084
1125
  className: "stage-command-form",
1085
1126
  "data-command": u.command,
1086
1127
  "data-generation-mode": u.generationMode,
1087
- children: /* @__PURE__ */ I(Je, {
1128
+ children: /* @__PURE__ */ z(Ge, {
1088
1129
  command: m,
1089
1130
  initialValues: w,
1090
1131
  currentValues: g,
1091
1132
  validateOn: "both",
1092
1133
  validateAllFieldsOnChange: !0,
1093
- onBeforeExecute: (e) => An(e, n.apiBasePath),
1094
- onFieldValidate: (e, t, n, r) => Ar(p, d, t, r),
1095
- onValidationFailure: (e) => E(kr(p, e)),
1096
- onException: (e) => E(e),
1097
- onFailed: (e) => E(Mn(u.command, e).messages),
1134
+ onBeforeExecute: (e) => Mn(e, n.apiBasePath),
1135
+ onFieldValidate: (e, t, n, r) => Pr(p, d, t, r),
1136
+ onValidationFailure: (e) => O(Nr(p, e)),
1137
+ onException: (e) => O(e),
1138
+ onFailed: (e) => O(Pn(u.command, e).messages),
1098
1139
  onSuccess: () => {
1099
- E([]), t.refreshAfterCommand();
1100
- let n = Y(e, "navigateToScreen");
1101
- n && K(n, {}), r?.();
1140
+ O([]), t.refreshAfterCommand();
1141
+ let n = X(e, "navigateToScreen");
1142
+ n && Y(n, {}), r?.();
1102
1143
  },
1103
1144
  children: [
1104
- te.map((e) => /* @__PURE__ */ F("p", {
1145
+ ee.map((e) => /* @__PURE__ */ R("p", {
1105
1146
  role: "alert",
1106
1147
  className: "stage-form-error",
1107
1148
  children: e
1108
1149
  }, e)),
1109
- ee,
1110
- ne.map((e) => /* @__PURE__ */ F("p", {
1150
+ T,
1151
+ D.map((e) => /* @__PURE__ */ R("p", {
1111
1152
  role: "alert",
1112
1153
  className: "stage-form-error",
1113
1154
  children: e
1114
1155
  }, e)),
1115
- a ? We(/* @__PURE__ */ F("button", {
1156
+ a ? Ve(/* @__PURE__ */ R("button", {
1116
1157
  type: "button",
1117
1158
  className: "scene-slice-dialog-submit",
1118
1159
  onClick: () => o.current?.querySelector("form")?.requestSubmit(),
1119
1160
  children: h
1120
- }), a) : /* @__PURE__ */ F("button", {
1161
+ }), a) : /* @__PURE__ */ R("button", {
1121
1162
  type: "submit",
1122
1163
  className: "stage-command-form__submit",
1123
1164
  children: h
1124
1165
  })
1125
1166
  ]
1126
1167
  }, v)
1127
- }) : /* @__PURE__ */ I("p", {
1168
+ }) : /* @__PURE__ */ z("p", {
1128
1169
  className: "stage-note",
1129
1170
  children: [
1130
1171
  "The modeled command “",
1131
1172
  u.command,
1132
1173
  "” is not registered by this Stage."
1133
1174
  ]
1134
- }) : /* @__PURE__ */ F("p", {
1175
+ }) : /* @__PURE__ */ R("p", {
1135
1176
  className: "stage-note",
1136
1177
  children: "This form is missing its command metadata."
1137
1178
  });
1138
1179
  }
1139
- function er({ form: e, messages: t }) {
1140
- return /* @__PURE__ */ F("section", {
1180
+ function rr({ form: e, messages: t }) {
1181
+ return /* @__PURE__ */ R("section", {
1141
1182
  className: "stage-command-form",
1142
1183
  "data-command": e.command,
1143
1184
  "data-generation-mode": e.generationMode,
1144
- children: t.map((e) => /* @__PURE__ */ F("p", {
1185
+ children: t.map((e) => /* @__PURE__ */ R("p", {
1145
1186
  role: "alert",
1146
1187
  className: "stage-form-error",
1147
1188
  children: e
1148
1189
  }, e))
1149
1190
  });
1150
1191
  }
1151
- function tr(e) {
1152
- let t = Y(e, "command");
1192
+ function ir(e) {
1193
+ let t = X(e, "command");
1153
1194
  if (!t) return;
1154
- let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(X) : [];
1195
+ let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(Z) : [];
1155
1196
  return {
1156
1197
  command: t,
1157
- label: Y(e, "label", t),
1198
+ label: X(e, "label", t),
1158
1199
  fields: n,
1159
- generationMode: Cr(e.properties.generationMode),
1160
- layout: wr(e.properties.layout)
1200
+ generationMode: Er(e.properties.generationMode),
1201
+ layout: Dr(e.properties.layout)
1161
1202
  };
1162
1203
  }
1163
- function nr(e, t) {
1204
+ function ar(e, t) {
1164
1205
  return e.generationMode === f.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
1165
1206
  name: e.name,
1166
- label: W(e.name)
1207
+ label: q(e.name)
1167
1208
  }));
1168
1209
  }
1169
- function rr(e, t, n) {
1170
- let r = e.layout, i = r ? Tr(r, t) : [];
1171
- if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => ir(e, n));
1172
- let a = new Map(t.map((e) => [e.name, e])), o = Er(r, i), s = {
1173
- gridTemplateColumns: Array.from({ length: o }, (e, t) => Dr(t + 1, r.columns)).join(" "),
1174
- columnGap: J(r.columnGap),
1175
- rowGap: J(r.rowGap)
1210
+ function or(e, t, n) {
1211
+ let r = e.layout, i = r ? Or(r, t) : [];
1212
+ if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => sr(e, n));
1213
+ let a = new Map(t.map((e) => [e.name, e])), o = kr(r, i), s = {
1214
+ gridTemplateColumns: Array.from({ length: o }, (e, t) => Ar(t + 1, r.columns)).join(" "),
1215
+ columnGap: Mr(r.columnGap),
1216
+ rowGap: Mr(r.rowGap)
1176
1217
  }, c = /* @__PURE__ */ new Set();
1177
- return /* @__PURE__ */ I("div", {
1218
+ return /* @__PURE__ */ z("div", {
1178
1219
  className: "stage-command-form__layout",
1179
1220
  style: s,
1180
1221
  children: [i.map((e) => {
1181
1222
  let t = a.get(e.field);
1182
- return t ? (c.add(t.name), ir(t, n, e)) : null;
1183
- }), t.filter((e) => !c.has(e.name)).map((e) => ir(e, n))]
1223
+ return t ? (c.add(t.name), sr(t, n, e)) : null;
1224
+ }), t.filter((e) => !c.has(e.name)).map((e) => sr(e, n))]
1184
1225
  });
1185
1226
  }
1186
- function ir(e, t, n) {
1227
+ function sr(e, t, n) {
1187
1228
  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 = (() => {
1188
1229
  if (i?.options) {
1189
1230
  let e = i.options.map((e) => ({
1190
1231
  value: e,
1191
- label: W(e)
1232
+ label: q(e)
1192
1233
  }));
1193
- return /* @__PURE__ */ F($e, {
1234
+ return /* @__PURE__ */ R(Xe, {
1194
1235
  value: o,
1195
1236
  fieldName: r,
1196
1237
  title: a,
@@ -1200,7 +1241,7 @@ function ir(e, t, n) {
1200
1241
  optionLabel: "label"
1201
1242
  });
1202
1243
  }
1203
- if (i?.members || i?.item) return /* @__PURE__ */ F(zn, {
1244
+ if (i?.members || i?.item) return /* @__PURE__ */ R(Vn, {
1204
1245
  value: o,
1205
1246
  fieldName: r,
1206
1247
  title: a,
@@ -1208,19 +1249,19 @@ function ir(e, t, n) {
1208
1249
  descriptor: i
1209
1250
  });
1210
1251
  switch (i?.type ?? "text") {
1211
- case "number": return /* @__PURE__ */ F(tt, {
1252
+ case "number": return /* @__PURE__ */ R(Qe, {
1212
1253
  value: o,
1213
1254
  fieldName: r,
1214
1255
  title: a,
1215
1256
  required: s
1216
1257
  });
1217
- case "boolean": return /* @__PURE__ */ F(Qe, {
1258
+ case "boolean": return /* @__PURE__ */ R(Ye, {
1218
1259
  value: o,
1219
1260
  fieldName: r,
1220
1261
  label: a,
1221
1262
  required: s
1222
1263
  });
1223
- case "date": return /* @__PURE__ */ F(ar, {
1264
+ case "date": return /* @__PURE__ */ R(cr, {
1224
1265
  value: o,
1225
1266
  fieldName: r,
1226
1267
  title: a,
@@ -1228,15 +1269,15 @@ function ir(e, t, n) {
1228
1269
  showIcon: !0,
1229
1270
  showTime: i?.withTime
1230
1271
  });
1231
- default: return /* @__PURE__ */ F(et, {
1272
+ default: return /* @__PURE__ */ R(Ze, {
1232
1273
  value: o,
1233
1274
  fieldName: r,
1234
1275
  title: a,
1235
1276
  required: s
1236
1277
  });
1237
1278
  }
1238
- })(), l = Or(n);
1239
- return /* @__PURE__ */ F("span", {
1279
+ })(), l = jr(n);
1280
+ return /* @__PURE__ */ R("span", {
1240
1281
  className: "stage-command-form__field",
1241
1282
  "data-field": e.name,
1242
1283
  "data-row": n?.row,
@@ -1246,21 +1287,21 @@ function ir(e, t, n) {
1246
1287
  children: c
1247
1288
  }, e.name);
1248
1289
  }
1249
- var ar = Xe((e) => /* @__PURE__ */ F(Ze, {
1290
+ var cr = qe((e) => /* @__PURE__ */ R(Je, {
1250
1291
  ...e,
1251
- currentValue: e.showTime ? e.currentValue : or(e.currentValue),
1252
- onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? Ge.fromDate(t) : t)
1292
+ currentValue: e.showTime ? e.currentValue : lr(e.currentValue),
1293
+ onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? He.fromDate(t) : t)
1253
1294
  }));
1254
- function or(e) {
1255
- if (e instanceof Ge) return e.toDate();
1295
+ function lr(e) {
1296
+ if (e instanceof He) return e.toDate();
1256
1297
  if (typeof e != "string") return e;
1257
1298
  try {
1258
- return Ge.parse(e).toDate();
1299
+ return He.parse(e).toDate();
1259
1300
  } catch {
1260
1301
  return null;
1261
1302
  }
1262
1303
  }
1263
- function sr(e, t) {
1304
+ function ur(e, t) {
1264
1305
  let n = {};
1265
1306
  for (let r of e) {
1266
1307
  let e = r.sourceProperty ?? r.name, i = t[e];
@@ -1268,35 +1309,35 @@ function sr(e, t) {
1268
1309
  }
1269
1310
  return n;
1270
1311
  }
1271
- function cr(e, t, n, r = [], i = [], a = !1) {
1312
+ function dr(e, t, n, r = [], i = [], a = !1) {
1272
1313
  let o = new Set(e.map((e) => e.sourceProperty ?? e.name)), s = t.some((e) => e.identity), c = {};
1273
1314
  for (let e of t) {
1274
1315
  if (!e.identifier || !e.required || o.has(e.name)) continue;
1275
- if (a && fr(e, i)) {
1276
- let t = n[e.name] || dr(e, r);
1316
+ if (a && hr(e, i)) {
1317
+ let t = n[e.name] || mr(e, r);
1277
1318
  t && (c[e.name] = t);
1278
1319
  continue;
1279
1320
  }
1280
- let t = n[e.name] || dr(e, r) || Lt(e.identifier) || (e.identity || !s && !fr(e, i) ? Rt(e.identifier) : void 0);
1321
+ let t = n[e.name] || mr(e, r) || Pt(e.identifier) || (e.identity || !s && !hr(e, i) ? Ft(e.identifier) : void 0);
1281
1322
  t !== void 0 && (c[e.name] = t);
1282
1323
  }
1283
1324
  return c;
1284
1325
  }
1285
- function lr(e, t) {
1286
- return !e.identifier || !e.required ? !1 : e.identity === !0 || ur(e, t) !== void 0;
1326
+ function fr(e, t) {
1327
+ return !e.identifier || !e.required ? !1 : e.identity === !0 || pr(e, t) !== void 0;
1287
1328
  }
1288
- function ur(e, t) {
1289
- if (e.identifier) return t[e.name] || Lt(e.identifier);
1329
+ function pr(e, t) {
1330
+ if (e.identifier) return t[e.name] || Pt(e.identifier);
1290
1331
  }
1291
- function dr(e, t) {
1332
+ function mr(e, t) {
1292
1333
  if (!e.identifier) return;
1293
1334
  let n = new Set(t.map((t) => t[e.name]).filter((e) => typeof e == "string" && e !== ""));
1294
1335
  return n.size === 1 ? [...n][0] : void 0;
1295
1336
  }
1296
- function fr(e, t) {
1337
+ function hr(e, t) {
1297
1338
  return t.some((t) => Object.hasOwn(t, e.name));
1298
1339
  }
1299
- function pr(e, t) {
1340
+ function gr(e, t) {
1300
1341
  let n = e.id;
1301
1342
  if (typeof n != "string" || n === "") return e;
1302
1343
  let r = `${t.alias ?? ""} ${t.name ?? ""}`.match(/[A-Z][a-z0-9]+/g) ?? [], i = Object.fromEntries(r.map((e) => `${e.charAt(0).toLowerCase()}${e.slice(1)}Id`).filter((t) => !Object.hasOwn(e, t)).map((e) => [e, n]));
@@ -1305,96 +1346,96 @@ function pr(e, t) {
1305
1346
  ...e
1306
1347
  };
1307
1348
  }
1308
- function mr(e) {
1309
- return Object.values(e).flatMap((e) => e.rows.map((t) => [t, pr(t, e)]));
1349
+ function _r(e) {
1350
+ return Object.values(e).flatMap((e) => e.rows.map((t) => [t, gr(t, e)]));
1310
1351
  }
1311
- function hr(e) {
1312
- return mr(e).map(([, e]) => e);
1352
+ function vr(e) {
1353
+ return _r(e).map(([, e]) => e);
1313
1354
  }
1314
- function gr(e, t) {
1315
- let n = new Map(mr(t));
1355
+ function yr(e, t) {
1356
+ let n = new Map(_r(t));
1316
1357
  return Object.values(e).filter((e) => e !== void 0).map((e) => n.get(e) ?? e);
1317
1358
  }
1318
- function _r(e, t, n, r) {
1319
- return e.filter((e) => e.identifier && e.required && fr(e, r)).filter((e) => !t[e.name] && dr(e, n) === void 0).map((e) => e.name);
1359
+ function br(e, t, n, r) {
1360
+ return e.filter((e) => e.identifier && e.required && hr(e, r)).filter((e) => !t[e.name] && mr(e, n) === void 0).map((e) => e.name);
1320
1361
  }
1321
- function vr(e) {
1362
+ function xr(e) {
1322
1363
  let t = e.properties.populateSource;
1323
- return X(t) ? t : void 0;
1364
+ return Z(t) ? t : void 0;
1324
1365
  }
1325
- function yr(e, t, n) {
1326
- let r = vr(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, br(e, r?.path ?? e, t, n)]), o = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), c = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = B({
1327
- scope: `populate:${Y(e, "command")}`,
1366
+ function Sr(e, t, n) {
1367
+ let r = xr(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, Cr(e, r?.path ?? e, t, n)]), o = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), c = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), l = U({
1368
+ scope: `populate:${X(e, "command")}`,
1328
1369
  name: i,
1329
1370
  route: i ? n.routes?.queries?.[i] : void 0,
1330
1371
  arguments: o,
1331
1372
  ready: c,
1332
1373
  publish: !1
1333
- }), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] : X(u) ? u : void 0;
1374
+ }), u = r?.itemBinding ? n.resolveBinding(r.itemBinding) ?? n.selected : void 0, d = i ? l.rows[0] : Z(u) ? u : void 0;
1334
1375
  return s(() => {
1335
1376
  if (!d) return;
1336
1377
  let e = {};
1337
1378
  for (let n of t) {
1338
1379
  let t = d[n.name] ?? d[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
1339
- t != null && (e[n.name] = fn(n, t));
1380
+ t != null && (e[n.name] = mn(n, t));
1340
1381
  }
1341
1382
  return Object.keys(e).length > 0 ? e : void 0;
1342
1383
  }, [d, t]);
1343
1384
  }
1344
- function br(e, t, n, r) {
1385
+ function Cr(e, t, n, r) {
1345
1386
  let i = r.parameters[t] ?? r.parameters[e];
1346
1387
  if (i) return i;
1347
1388
  let a = n.find((n) => n.name === t || n.name === e)?.identifier;
1348
- if (a) return Rt(a);
1389
+ if (a) return Ft(a);
1349
1390
  let o = r.resolveBinding({ path: t });
1350
1391
  return typeof o == "string" || typeof o == "number" ? o : void 0;
1351
1392
  }
1352
- function xr(e, t, n) {
1353
- let r = s(() => Sr(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
1393
+ function wr(e, t, n) {
1394
+ let r = s(() => Tr(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
1354
1395
  return s(() => {
1355
1396
  let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
1356
1397
  return Object.keys(e).length > 0 ? e : void 0;
1357
1398
  }, [r, a]);
1358
1399
  }
1359
- function Sr(e, t) {
1400
+ function Tr(e, t) {
1360
1401
  let n = e.properties.arguments;
1361
1402
  if (!Array.isArray(n)) return [];
1362
1403
  let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
1363
1404
  return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
1364
1405
  }
1365
- function Cr(e) {
1406
+ function Er(e) {
1366
1407
  return e === f.Manual ? f.Manual : f.Auto;
1367
1408
  }
1368
- function wr(e) {
1369
- if (!X(e)) return;
1409
+ function Dr(e) {
1410
+ if (!Z(e)) return;
1370
1411
  let t = e;
1371
1412
  return {
1372
- columns: Array.isArray(t.columns) ? t.columns.filter(Pr) : [],
1373
- placements: Array.isArray(t.placements) ? t.placements.filter(Fr) : [],
1374
- columnGap: Ir(t.columnGap) ? t.columnGap : void 0,
1375
- rowGap: Ir(t.rowGap) ? t.rowGap : void 0
1413
+ columns: Array.isArray(t.columns) ? t.columns.filter(Rr) : [],
1414
+ placements: Array.isArray(t.placements) ? t.placements.filter(zr) : [],
1415
+ columnGap: Br(t.columnGap) ? t.columnGap : void 0,
1416
+ rowGap: Br(t.rowGap) ? t.rowGap : void 0
1376
1417
  };
1377
1418
  }
1378
- function Tr(e, t) {
1419
+ function Or(e, t) {
1379
1420
  let n = new Map(e.placements.map((e) => [e.field, e]));
1380
- for (let e of t) !n.has(e.name) && Fr(e.placement) && n.set(e.name, e.placement);
1421
+ for (let e of t) !n.has(e.name) && zr(e.placement) && n.set(e.name, e.placement);
1381
1422
  return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
1382
1423
  }
1383
- function Er(e, t) {
1424
+ function kr(e, t) {
1384
1425
  return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
1385
1426
  }
1386
- function Dr(e, t) {
1387
- let n = t.find((t) => t.index === e), r = J(n?.width), i = J(n?.minWidth), a = J(n?.maxWidth);
1427
+ function Ar(e, t) {
1428
+ let n = t.find((t) => t.index === e), r = Mr(n?.width), i = Mr(n?.minWidth), a = Mr(n?.maxWidth);
1388
1429
  return n?.width?.unit === p.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
1389
1430
  }
1390
- function Or(e) {
1431
+ function jr(e) {
1391
1432
  if (e) return {
1392
1433
  gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
1393
1434
  gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
1394
- width: e.width?.unit === p.Fraction ? void 0 : J(e.width)
1435
+ width: e.width?.unit === p.Fraction ? void 0 : Mr(e.width)
1395
1436
  };
1396
1437
  }
1397
- function J(e) {
1438
+ function Mr(e) {
1398
1439
  if (e) switch (e.unit) {
1399
1440
  case p.Fraction: return `${e.value ?? 1}fr`;
1400
1441
  case p.Pixels: return `${e.value ?? 0}px`;
@@ -1402,63 +1443,63 @@ function J(e) {
1402
1443
  case p.Auto: return "auto";
1403
1444
  }
1404
1445
  }
1405
- function kr(e, t) {
1446
+ function Nr(e, t) {
1406
1447
  let n = (e, t) => !!e.members?.some((e) => e === t || e.startsWith(`${t}.`)), r = new Set(e.map((e) => t.find((t) => n(t, e.sourceProperty ?? e.name))).filter((e) => e !== void 0));
1407
1448
  return [...new Set(t.filter((e) => !r.has(e)).map((e) => e.message))];
1408
1449
  }
1409
- function Ar(e, t, n, r) {
1450
+ function Pr(e, t, n, r) {
1410
1451
  let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
1411
- if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? un(a, r, i?.label ?? n) : void 0;
1452
+ if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? fn(a, r, i?.label ?? n) : void 0;
1412
1453
  }
1413
- function jr(e, t) {
1454
+ function Fr(e, t) {
1414
1455
  let n = new Map(t.map((e) => [e.name, e]));
1415
1456
  return e.flatMap((e) => {
1416
1457
  let t = n.get(e.sourceProperty ?? e.name);
1417
1458
  return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
1418
1459
  });
1419
1460
  }
1420
- function Mr(e, t) {
1461
+ function Ir(e, t) {
1421
1462
  if (!e) return [];
1422
- let n = Tr(e, t).filter((e) => e.width?.unit === p.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 === p.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.`);
1463
+ let n = Or(e, t).filter((e) => e.width?.unit === p.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 === p.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.`);
1423
1464
  return [...n, ...r];
1424
1465
  }
1425
- function Nr(e) {
1426
- return U(Y(e, "schema"));
1466
+ function Lr(e) {
1467
+ return K(X(e, "schema"));
1427
1468
  }
1428
- function Y(e, t, n = "") {
1469
+ function X(e, t, n = "") {
1429
1470
  let r = e.properties[t];
1430
1471
  return typeof r == "string" ? r : n;
1431
1472
  }
1432
- function Pr(e) {
1433
- return X(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
1473
+ function Rr(e) {
1474
+ return Z(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
1434
1475
  }
1435
- function Fr(e) {
1436
- return X(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
1476
+ function zr(e) {
1477
+ return Z(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
1437
1478
  }
1438
- function Ir(e) {
1439
- return X(e) && Object.values(p).includes(e.unit);
1479
+ function Br(e) {
1480
+ return Z(e) && Object.values(p).includes(e.unit);
1440
1481
  }
1441
- function X(e) {
1482
+ function Z(e) {
1442
1483
  return typeof e == "object" && !!e && !Array.isArray(e);
1443
1484
  }
1444
1485
  // src/StageGuardedAction.tsx
1445
- function Lr(e) {
1486
+ function Vr(e) {
1446
1487
  return typeof e == "object" && !!e && !Array.isArray(e);
1447
1488
  }
1448
- function Rr(e, t) {
1489
+ function Hr(e, t) {
1449
1490
  let n = e.properties[t];
1450
1491
  return typeof n == "string" ? n : "";
1451
1492
  }
1452
- function zr(e) {
1493
+ function Ur(e) {
1453
1494
  return e.componentName === "core:action" && (Array.isArray(e.properties.alternatives) || e.properties.otherwise !== void 0);
1454
1495
  }
1455
- function Br(e) {
1456
- let t = z(), n = Rr(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? Rr(e, "itemRoute"), i = Lr(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
1496
+ function Wr(e) {
1497
+ let t = H(), n = Hr(e, "itemQuery"), r = (n ? t.routes?.queries?.[n] : void 0) ?? Hr(e, "itemRoute"), i = Vr(e.properties.itemArguments) ? e.properties.itemArguments : {}, a = {}, o = !0;
1457
1498
  for (let [e, n] of Object.entries(i)) {
1458
- let r = Lr(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
1499
+ let r = Vr(n) && (typeof n.path == "string" || typeof n.kind == "string") ? t.resolveBinding(n) : n;
1459
1500
  a[e] = r, (r == null || r === "") && (o = !1);
1460
1501
  }
1461
- let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l = B({
1502
+ let s = e.properties.itemSelection === !0, c = Object.values(t.selections).filter((e) => e !== void 0), l = U({
1462
1503
  scope: `${e.id}:item`,
1463
1504
  name: n || void 0,
1464
1505
  route: r || void 0,
@@ -1474,23 +1515,23 @@ function Br(e) {
1474
1515
  item: l.rows.length === 1 ? l.rows[0] : void 0
1475
1516
  };
1476
1517
  }
1477
- function Vr(e, t) {
1478
- return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, Ft(wt(n) ?? "", t)]));
1518
+ function Gr(e, t) {
1519
+ return Object.fromEntries(Object.entries(e.arguments ?? {}).map(([e, n]) => [e, Mt(xt(n) ?? "", t)]));
1479
1520
  }
1480
- function Hr({ element: e, interactions: t }) {
1481
- let n = z(), r = Br(e), i = Nn(), [a, o] = l([]), [c, u] = l(!1), d = Rr(e, "label"), f = s(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = Lr(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
1482
- if (!Mt(m) || !h || !r.hasSource) {
1483
- let n = r.hasSource ? `${Tt}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${Tt}: “${d}” has no data subject to evaluate its guard against.`;
1484
- return /* @__PURE__ */ I("div", {
1521
+ function Kr({ element: e, interactions: t }) {
1522
+ let n = H(), r = Wr(e), i = Fn(), [a, o] = l([]), [c, u] = l(!1), d = Hr(e, "label"), f = s(() => Array.isArray(e.properties.alternatives) ? e.properties.alternatives : [], [e]), p = Vr(e.properties.otherwise) ? e.properties.otherwise : void 0, m = f.map((e) => e.condition), h = !p || p.outcome === "Hidden" || p.outcome === "Execute" && !!p.command;
1523
+ if (!kt(m) || !h || !r.hasSource) {
1524
+ let n = r.hasSource ? `${St}: “${d}” has a guard this Stage cannot evaluate, so it stays unavailable.` : `${St}: “${d}” has no data subject to evaluate its guard against.`;
1525
+ return /* @__PURE__ */ z("div", {
1485
1526
  className: "stage-guarded-action",
1486
1527
  "data-scene-id": e.id,
1487
- children: [/* @__PURE__ */ F(L, {
1528
+ children: [/* @__PURE__ */ R(B, {
1488
1529
  type: "button",
1489
1530
  disabled: !0,
1490
1531
  title: n,
1491
1532
  ...t,
1492
1533
  children: d
1493
- }), /* @__PURE__ */ F("p", {
1534
+ }), /* @__PURE__ */ R("p", {
1494
1535
  role: "alert",
1495
1536
  className: "stage-form-error",
1496
1537
  children: n
@@ -1498,42 +1539,42 @@ function Hr({ element: e, interactions: t }) {
1498
1539
  });
1499
1540
  }
1500
1541
  if (!r.item) return null;
1501
- let g = Nt(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
1542
+ let g = At(m, r.item), _ = g !== void 0 && g >= 0 ? f[g] : p?.outcome === "Execute" ? p : void 0;
1502
1543
  if (!_?.command) return null;
1503
- let v = _.command, y = G(v), b = r.item, x = async () => {
1544
+ let v = _.command, y = J(v), b = r.item, x = async () => {
1504
1545
  if (!y) return;
1505
1546
  u(!0);
1506
- let t = await i(v, Vr(_, b));
1547
+ let t = await i(v, Gr(_, b));
1507
1548
  if (u(!1), o(t.messages), !t.isSuccess) return;
1508
1549
  n.refreshAfterCommand();
1509
- let r = Rr(e, "navigateToScreen"), a = Rr(e, "navigateByParameter"), s = a ? Ft(`item.${a}`, b) : void 0;
1510
- r && K(r, a && s != null ? { [a]: String(s) } : {});
1550
+ let r = Hr(e, "navigateToScreen"), a = Hr(e, "navigateByParameter"), s = a ? Mt(`item.${a}`, b) : void 0;
1551
+ r && Y(r, a && s != null ? { [a]: String(s) } : {});
1511
1552
  };
1512
- return /* @__PURE__ */ I("div", {
1553
+ return /* @__PURE__ */ z("div", {
1513
1554
  className: "stage-guarded-action",
1514
1555
  "data-scene-id": e.id,
1515
1556
  "data-command": v,
1516
- children: [/* @__PURE__ */ F(L, {
1557
+ children: [/* @__PURE__ */ R(B, {
1517
1558
  ...t,
1518
1559
  type: "button",
1519
1560
  disabled: !y || c,
1520
1561
  title: y ? void 0 : "This command is not exposed as an API yet",
1521
1562
  onClick: () => void x(),
1522
1563
  children: d
1523
- }), a.map((e) => /* @__PURE__ */ F("p", {
1564
+ }), a.map((e) => /* @__PURE__ */ R("p", {
1524
1565
  role: "alert",
1525
1566
  className: "stage-form-error",
1526
1567
  children: e
1527
1568
  }, e))]
1528
1569
  });
1529
1570
  }
1530
- function Ur(e) {
1531
- let t = he(), n = c(void 0), i = s(() => C(le(e.id, e.behaviors), m.DoubleClick), [e.behaviors, e.id]);
1571
+ function qr(e) {
1572
+ let t = fe(), n = c(void 0), i = s(() => C(oe(e.id, e.behaviors), m.DoubleClick), [e.behaviors, e.id]);
1532
1573
  a(() => () => clearTimeout(n.current), []);
1533
1574
  let o = r((e) => {
1534
1575
  if (clearTimeout(n.current), n.current = void 0, !t) return;
1535
- let r = (n) => n.path === "$guard" ? Pt(n.value, e) : n.path?.startsWith("item.") ? Ft(n.path, e) : t.context.resolve(n);
1536
- T(i, t.dispatcher, {
1576
+ let r = (n) => n.path === "$guard" ? jt(n.value, e) : n.path?.startsWith("item.") ? Mt(n.path, e) : t.context.resolve(n);
1577
+ E(i, t.dispatcher, {
1537
1578
  ...t.context,
1538
1579
  resolve: r
1539
1580
  }).then((e) => {
@@ -1550,12 +1591,12 @@ function Ur(e) {
1550
1591
  };
1551
1592
  }
1552
1593
  // src/stageDialogScreens.ts
1553
- var Wr = "Stage:confirmDialog", Gr = "ConfirmDialog";
1554
- function Kr(e, t) {
1594
+ var Jr = "Stage:confirmDialog", Yr = "ConfirmDialog";
1595
+ function Xr(e, t) {
1555
1596
  let n = new Set(t.map((e) => e.name));
1556
1597
  return e.map((t) => {
1557
- if (t.screenTemplate !== Gr || n.has(Gr)) return t;
1558
- let r = qr(t), i = e.find((e) => e.name !== t.name)?.name, a = P(`confirm-dialog-${t.name}`, Wr, {
1598
+ if (t.screenTemplate !== Yr || n.has(Yr)) return t;
1599
+ let r = Zr(t), i = e.find((e) => e.name !== t.name)?.name, a = L(`confirm-dialog-${t.name}`, Jr, {
1559
1600
  title: t.name,
1560
1601
  decisions: r,
1561
1602
  home: i
@@ -1568,99 +1609,99 @@ function Kr(e, t) {
1568
1609
  };
1569
1610
  });
1570
1611
  }
1571
- function qr(e) {
1612
+ function Zr(e) {
1572
1613
  let t = [];
1573
- for (let n of Jr(Object.values(e.slotContent).flat())) {
1574
- let r = Yr(n.properties.command);
1614
+ for (let n of Qr(Object.values(e.slotContent).flat())) {
1615
+ let r = $r(n.properties.command);
1575
1616
  r && !t.some((e) => e.command === r) && t.push({
1576
1617
  command: r,
1577
- label: Yr(n.properties.label),
1578
- navigateToScreen: Yr(n.properties.navigateToScreen),
1579
- typeName: Yr(n.properties.typeName),
1580
- route: Yr(n.properties.route),
1618
+ label: $r(n.properties.label),
1619
+ navigateToScreen: $r(n.properties.navigateToScreen),
1620
+ typeName: $r(n.properties.typeName),
1621
+ route: $r(n.properties.route),
1581
1622
  form: e.forms.find((e) => e.forCommand === r)
1582
1623
  });
1583
1624
  }
1584
1625
  return t;
1585
1626
  }
1586
- function Jr(e) {
1627
+ function Qr(e) {
1587
1628
  return e.flatMap((e) => {
1588
1629
  let t = e;
1589
- return t.componentName === "core:action" ? [t] : Jr(Object.values(t.slots ?? {}).flat());
1630
+ return t.componentName === "core:action" ? [t] : Qr(Object.values(t.slots ?? {}).flat());
1590
1631
  });
1591
1632
  }
1592
- function Yr(e) {
1633
+ function $r(e) {
1593
1634
  return typeof e == "string" && e !== "" ? e : void 0;
1594
1635
  }
1595
1636
  // src/StageConfirmDialog.tsx
1596
- function Xr({ element: e }) {
1597
- let { routes: t, parameters: n, queries: r, selections: i } = z(), [o, s] = l(), u = c(null), d = typeof e.properties.title == "string" ? e.properties.title : "", f = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], p = typeof e.properties.home == "string" ? e.properties.home : void 0, m = f.find((e) => e.command === o), h = gr(i, r);
1598
- return a(() => u.current?.focus(), []), /* @__PURE__ */ I("section", {
1637
+ function ei({ element: e }) {
1638
+ let { routes: t, parameters: n, queries: r, selections: i } = H(), [o, s] = l(), u = c(null), d = typeof e.properties.title == "string" ? e.properties.title : "", f = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], p = typeof e.properties.home == "string" ? e.properties.home : void 0, m = f.find((e) => e.command === o), h = yr(i, r);
1639
+ return a(() => u.current?.focus(), []), /* @__PURE__ */ z("section", {
1599
1640
  className: "scene-slice-dialog stage-confirm-dialog",
1600
1641
  role: "dialog",
1601
- "aria-label": W(d),
1602
- "data-stage-component": Wr,
1642
+ "aria-label": q(d),
1643
+ "data-stage-component": Jr,
1603
1644
  children: [
1604
- /* @__PURE__ */ F("header", {
1645
+ /* @__PURE__ */ R("header", {
1605
1646
  className: "scene-slice-dialog-header",
1606
- children: /* @__PURE__ */ F("h2", {
1647
+ children: /* @__PURE__ */ R("h2", {
1607
1648
  className: "scene-slice-dialog-title",
1608
- children: W(d)
1649
+ children: q(d)
1609
1650
  })
1610
1651
  }),
1611
- /* @__PURE__ */ F("div", {
1652
+ /* @__PURE__ */ R("div", {
1612
1653
  className: "stage-confirm-dialog__decisions",
1613
- children: f.map((e, t) => /* @__PURE__ */ F("button", {
1654
+ children: f.map((e, t) => /* @__PURE__ */ R("button", {
1614
1655
  ref: t === 0 ? u : void 0,
1615
1656
  type: "button",
1616
1657
  className: t === 0 ? "scene-slice-dialog-submit stage-confirm-dialog__decision" : "scene-slice-dialog-cancel stage-confirm-dialog__decision",
1617
1658
  "data-emphasis": t === 0 ? "primary" : "secondary",
1618
1659
  "aria-pressed": e.command === o,
1619
1660
  onClick: () => s(e.command),
1620
- children: Qr(e)
1661
+ children: ni(e)
1621
1662
  }, e.command))
1622
1663
  }),
1623
- m && /* @__PURE__ */ F(Xn, { children: /* @__PURE__ */ F($n, { element: ti(m, t?.commandSchemas?.[m.command] ?? "", n, h) }, m.command) }),
1624
- /* @__PURE__ */ F("footer", {
1664
+ m && /* @__PURE__ */ R(Qn, { children: /* @__PURE__ */ R(nr, { element: ai(m, t?.commandSchemas?.[m.command] ?? "", n, h) }, m.command) }),
1665
+ /* @__PURE__ */ R("footer", {
1625
1666
  className: "scene-slice-dialog-footer",
1626
- children: /* @__PURE__ */ F("button", {
1667
+ children: /* @__PURE__ */ R("button", {
1627
1668
  type: "button",
1628
1669
  className: "scene-slice-dialog-cancel stage-confirm-dialog__cancel",
1629
- onClick: () => Zr(f, p),
1670
+ onClick: () => ti(f, p),
1630
1671
  children: "Cancel"
1631
1672
  })
1632
1673
  })
1633
1674
  ]
1634
1675
  });
1635
1676
  }
1636
- function Zr(e, t) {
1677
+ function ti(e, t) {
1637
1678
  let n = new Set(e.map((e) => e.navigateToScreen).filter((e) => !!e)), r = n.size === 1 ? [...n][0] : t;
1638
- r && K(r, {});
1679
+ r && Y(r, {});
1639
1680
  }
1640
- function Qr(e) {
1641
- return e.label ?? W(e.command);
1681
+ function ni(e) {
1682
+ return e.label ?? q(e.command);
1642
1683
  }
1643
- function $r(e, t, n) {
1644
- return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || dr(e, n) !== void 0;
1684
+ function ri(e, t, n) {
1685
+ return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || mr(e, n) !== void 0;
1645
1686
  }
1646
- function ei(e, t, n, r) {
1687
+ function ii(e, t, n, r) {
1647
1688
  let i = e.form?.fields ?? [], a = i.length > 0 ? i : t.filter((e) => !e.unsupportedReason).map((e) => ({
1648
1689
  name: e.name,
1649
1690
  label: e.name
1650
- })), o = new Set(t.filter((e) => $r(e, n, r)).map((e) => e.name)), s = a.filter((e) => !o.has(e.sourceProperty ?? e.name)), c = new Set(s.map((e) => e.sourceProperty ?? e.name)), l = t.filter((e) => e.identifier && e.required && !o.has(e.name) && !c.has(e.name));
1691
+ })), o = new Set(t.filter((e) => ri(e, n, r)).map((e) => e.name)), s = a.filter((e) => !o.has(e.sourceProperty ?? e.name)), c = new Set(s.map((e) => e.sourceProperty ?? e.name)), l = t.filter((e) => e.identifier && e.required && !o.has(e.name) && !c.has(e.name));
1651
1692
  return [...s, ...l.map((e) => ({
1652
1693
  name: e.name,
1653
- label: W(e.name)
1694
+ label: q(e.name)
1654
1695
  }))];
1655
1696
  }
1656
- function ti(e, t, n, r) {
1657
- let i = ei(e, U(t), n, r);
1697
+ function ai(e, t, n, r) {
1698
+ let i = ii(e, K(t), n, r);
1658
1699
  return {
1659
1700
  id: `confirm-${e.command}`,
1660
- componentName: Wr,
1701
+ componentName: Jr,
1661
1702
  properties: {
1662
1703
  command: e.command,
1663
- label: Qr(e),
1704
+ label: ni(e),
1664
1705
  submitLabel: "Confirm",
1665
1706
  typeName: e.typeName,
1666
1707
  route: e.route,
@@ -1674,13 +1715,13 @@ function ti(e, t, n, r) {
1674
1715
  slots: {}
1675
1716
  };
1676
1717
  }
1677
- function ni(e) {
1718
+ function oi(e) {
1678
1719
  return typeof e == "object" && !!e && !Array.isArray(e);
1679
1720
  }
1680
- function ri(e, t) {
1721
+ function si(e, t) {
1681
1722
  if (!Array.isArray(e) || !Array.isArray(t)) return;
1682
- let n = new Map(e.filter(ni).map((e) => [JSON.stringify(e.id), e.column]));
1683
- for (let e of t.filter(ni)) {
1723
+ let n = new Map(e.filter(oi).map((e) => [JSON.stringify(e.id), e.column]));
1724
+ for (let e of t.filter(oi)) {
1684
1725
  let t = JSON.stringify(e.id);
1685
1726
  if (n.has(t) && n.get(t) !== e.column) return {
1686
1727
  item: {
@@ -1691,9 +1732,9 @@ function ri(e, t) {
1691
1732
  };
1692
1733
  }
1693
1734
  }
1694
- function ii(e, t, n, r) {
1735
+ function ci(e, t, n, r) {
1695
1736
  if (!Array.isArray(e)) return;
1696
- let i = e.filter(ni).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
1737
+ let i = e.filter(oi).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
1697
1738
  if (i !== void 0) return {
1698
1739
  item: {
1699
1740
  ...i,
@@ -1703,11 +1744,11 @@ function ii(e, t, n, r) {
1703
1744
  previous: t.previous
1704
1745
  };
1705
1746
  }
1706
- function ai(e, t) {
1707
- return (n) => n.path === "$guard" ? Pt(n.value, e.item) : n.path === "value" ? e.value : n.path === "previous" ? e.previous : n.path?.startsWith("item.") ? Ft(n.path, e.item) : t(n);
1747
+ function li(e, t) {
1748
+ return (n) => n.path === "$guard" ? jt(n.value, e.item) : n.path === "value" ? e.value : n.path === "previous" ? e.previous : n.path?.startsWith("item.") ? Mt(n.path, e.item) : t(n);
1708
1749
  }
1709
- function oi(e, t) {
1710
- let n = he(), i = z(), { element: a, rowsProperty: o, idField: u, valueField: d } = e, f = s(() => C(le(a.id, a.behaviors), m.Change), [a.behaviors, a.id]), p = c(void 0), h = c(!1), [g, _] = l(0), v = c({
1750
+ function ui(e, t) {
1751
+ let n = fe(), i = H(), { element: a, rowsProperty: o, idField: u, valueField: d } = e, f = s(() => C(oe(a.id, a.behaviors), m.Change), [a.behaviors, a.id]), p = c(void 0), h = c(!1), [g, _] = l(0), v = c({
1711
1752
  scope: n,
1712
1753
  data: i,
1713
1754
  element: a,
@@ -1720,13 +1761,13 @@ function oi(e, t) {
1720
1761
  bindings: f
1721
1762
  };
1722
1763
  let y = r((e, t) => {
1723
- let { scope: n, data: r, element: i, bindings: a } = v.current, s = ri(e, t);
1764
+ let { scope: n, data: r, element: i, bindings: a } = v.current, s = si(e, t);
1724
1765
  if (!n || a.length === 0 || s === void 0) return;
1725
- let c = ii(i.properties[o], s, u, d);
1766
+ let c = ci(i.properties[o], s, u, d);
1726
1767
  if (c === void 0) return;
1727
1768
  let l = {
1728
1769
  ...n.context,
1729
- resolve: ai(c, n.context.resolve)
1770
+ resolve: li(c, n.context.resolve)
1730
1771
  }, f = !1, p = !1, m = {
1731
1772
  ...n.dispatcher,
1732
1773
  executeCommand: async (e, t) => {
@@ -1734,7 +1775,7 @@ function oi(e, t) {
1734
1775
  return r?.isSuccess ? f = !0 : p = !0, r;
1735
1776
  }
1736
1777
  };
1737
- T(a, m, l).then((e) => {
1778
+ E(a, m, l).then((e) => {
1738
1779
  e.findings.length > 0 && n.onFindings?.(e.findings), r.refreshAfterCommand(), (!f || p) && _((e) => e + 1);
1739
1780
  });
1740
1781
  }, [
@@ -1758,24 +1799,24 @@ function oi(e, t) {
1758
1799
  revision: g
1759
1800
  };
1760
1801
  }
1761
- function si(e) {
1762
- let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = oi({
1802
+ function di(e) {
1803
+ let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = ui({
1763
1804
  element: t,
1764
1805
  rowsProperty: "cards",
1765
1806
  idField: typeof t.properties.cardId == "string" ? t.properties.cardId : "id",
1766
1807
  valueField: n
1767
- }, e.bindingOutputs), i = xe;
1768
- return r.declared ? /* @__PURE__ */ F(i, {
1808
+ }, e.bindingOutputs), i = ve;
1809
+ return r.declared ? /* @__PURE__ */ R(i, {
1769
1810
  ...e,
1770
1811
  interactions: {
1771
1812
  ...e.interactions,
1772
1813
  onChange: r.onChange
1773
1814
  },
1774
1815
  bindingOutputs: r.outputs
1775
- }, r.revision) : /* @__PURE__ */ F(i, { ...e });
1816
+ }, r.revision) : /* @__PURE__ */ R(i, { ...e });
1776
1817
  }
1777
- var ci = ue(Ee, j.KanbanBoard), li = "Stage:commandForm";
1778
- function ui(e, t, n = {}) {
1818
+ var fi = j(Ce, P.KanbanBoard), pi = "Stage:commandForm";
1819
+ function mi(e, t, n = {}) {
1779
1820
  return {
1780
1821
  id: e,
1781
1822
  componentName: "",
@@ -1783,23 +1824,23 @@ function ui(e, t, n = {}) {
1783
1824
  slots: n
1784
1825
  };
1785
1826
  }
1786
- function Z(e, t, n = "") {
1827
+ function Q(e, t, n = "") {
1787
1828
  let r = e.properties[t];
1788
1829
  return typeof r == "string" ? r : n;
1789
1830
  }
1790
- function di(e, t, n) {
1831
+ function hi(e, t, n) {
1791
1832
  let r = typeof e == "number" && Number.isInteger(e) ? n && n.length === t?.length ? t?.[n.indexOf(e)] : t?.[e] : e;
1792
- return typeof r == "string" && t?.includes(r) ? W(r) : String(e ?? "");
1833
+ return typeof r == "string" && t?.includes(r) ? q(r) : String(e ?? "");
1793
1834
  }
1794
- function fi(e, t) {
1835
+ function gi(e, t) {
1795
1836
  let n = e.properties.queryArguments;
1796
- if (!gi(n)) return {
1837
+ if (!Si(n)) return {
1797
1838
  values: {},
1798
1839
  ready: !0
1799
1840
  };
1800
1841
  let r = {}, i = !0;
1801
1842
  for (let [e, a] of Object.entries(n)) {
1802
- let n = hi(a) ? t.resolveBinding(a) : a;
1843
+ let n = xi(a) ? t.resolveBinding(a) : a;
1803
1844
  r[e] = n, (n == null || n === "") && (i = !1);
1804
1845
  }
1805
1846
  return {
@@ -1807,7 +1848,7 @@ function fi(e, t) {
1807
1848
  ready: i
1808
1849
  };
1809
1850
  }
1810
- function pi(e, t) {
1851
+ function _i(e, t) {
1811
1852
  let n = (e.slots.columns ?? []).map((e) => {
1812
1853
  let t = e.properties;
1813
1854
  return {
@@ -1822,140 +1863,148 @@ function pi(e, t) {
1822
1863
  }));
1823
1864
  return n.length > 0 ? n : r;
1824
1865
  }
1825
- function Q(e, t) {
1866
+ function vi(e, t) {
1826
1867
  return e[t] ?? e.id ?? e.key;
1827
1868
  }
1828
- function mi({ element: e, slots: t }) {
1829
- let n = z(), r = Z(e, "query", Z(e, "typeName", e.id)), i = (Z(e, "query") ? n.routes?.queries?.[Z(e, "query")] : void 0) ?? Z(e, "route"), o = s(() => fi(e, n), [n, e]), { rows: c, error: l, loading: u } = B({
1869
+ function yi({ element: e, slots: t }) {
1870
+ let n = H(), r = Q(e, "query", Q(e, "typeName", e.id)), i = (Q(e, "query") ? n.routes?.queries?.[Q(e, "query")] : void 0) ?? Q(e, "route"), o = s(() => gi(e, n), [n, e]), { rows: c, error: l, loading: u, awaitingCommand: d } = U({
1830
1871
  scope: e.id,
1831
1872
  name: r,
1832
1873
  route: i || void 0,
1833
1874
  arguments: o.values,
1834
1875
  ready: o.ready
1835
- }), d = pi(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, _ = Ur(e);
1876
+ }), f = _i(e, c), p = Q(e, "navigateOnRowClickToScreen"), m = Q(e, "navigateOnRowClickByParameter"), h = Q(e, "dataKey") || m || "id", g = n.selections[e.id], _ = m ? n.parameters[m] : void 0, v = qr(e);
1836
1877
  a(() => {
1837
- if (!h) return;
1838
- let t = Q(h, m), r = t === void 0 ? void 0 : c.find((e) => Q(e, m) === t);
1839
- r && r !== h ? n.selectRow(e.id, r) : !r && t !== void 0 && !u && n.clearSelection(e.id);
1878
+ if (!g) return;
1879
+ let t = vi(g, h), r = t === void 0 ? void 0 : c.find((e) => vi(e, h) === t);
1880
+ r && r !== g ? n.selectRow(e.id, r) : !r && t !== void 0 && !u && n.clearSelection(e.id);
1840
1881
  }, [
1841
1882
  n,
1842
- m,
1883
+ h,
1843
1884
  e.id,
1844
1885
  u,
1845
1886
  c,
1846
- h
1887
+ g
1847
1888
  ]), a(() => {
1848
- if (!p) return;
1849
- if (g === void 0) {
1850
- h && n.clearSelection(e.id);
1889
+ if (!m) return;
1890
+ if (_ === void 0) {
1891
+ g && n.clearSelection(e.id);
1851
1892
  return;
1852
1893
  }
1853
- if (h && String(Q(h, m)) === g) return;
1854
- let t = c.find((e) => String(Q(e, m)) === g);
1894
+ if (g && String(vi(g, h)) === _) return;
1895
+ let t = c.find((e) => String(vi(e, h)) === _);
1855
1896
  t && n.selectRow(e.id, t);
1856
1897
  }, [
1857
1898
  n,
1858
- m,
1899
+ h,
1859
1900
  e.id,
1860
- g,
1861
- p,
1901
+ _,
1902
+ m,
1862
1903
  c,
1863
- h
1904
+ g
1864
1905
  ]);
1865
- let v = (t) => {
1866
- let r = Q(t, m);
1867
- if (p && r != null) {
1906
+ let y = (t) => {
1907
+ let r = vi(t, h);
1908
+ if (m && r != null) {
1868
1909
  let i = {
1869
- ...f && f !== n.screen ? {} : n.parameters,
1870
- [p]: String(r)
1910
+ ...p && p !== n.screen ? {} : n.parameters,
1911
+ [m]: String(r)
1871
1912
  };
1872
- f && f !== n.screen || n.selectRow(e.id, t), K(f || n.screen, i);
1913
+ p && p !== n.screen || n.selectRow(e.id, t), Y(p || n.screen, i);
1873
1914
  } else n.selectRow(e.id, t);
1874
1915
  };
1875
- return !Z(e, "query") && !i && !yt(r) ? /* @__PURE__ */ I("section", {
1916
+ return !Q(e, "query") && !i && !gt(r) ? /* @__PURE__ */ z("section", {
1876
1917
  className: "stage-table",
1877
1918
  "data-scene-id": e.id,
1878
- children: [/* @__PURE__ */ I("p", {
1919
+ children: [/* @__PURE__ */ z("p", {
1879
1920
  className: "stage-note",
1880
1921
  children: [
1881
1922
  "No query is exposed for ",
1882
- Z(e, "typeName", "this read model"),
1923
+ Q(e, "typeName", "this read model"),
1883
1924
  " yet."
1884
1925
  ]
1885
1926
  }), t.columns]
1886
- }) : /* @__PURE__ */ I("section", {
1927
+ }) : /* @__PURE__ */ z("section", {
1887
1928
  className: "stage-table",
1888
1929
  "data-scene-id": e.id,
1889
1930
  children: [
1890
- u && /* @__PURE__ */ F(Ue, {
1931
+ (u || d) && /* @__PURE__ */ R(Be, {
1891
1932
  severity: "info",
1892
1933
  text: "Loading…"
1893
1934
  }),
1894
- l && /* @__PURE__ */ F(Ue, {
1935
+ l && /* @__PURE__ */ R(Be, {
1895
1936
  severity: "error",
1896
1937
  text: l
1897
1938
  }),
1898
- h && /* @__PURE__ */ F(L, {
1939
+ g && /* @__PURE__ */ R(B, {
1899
1940
  type: "button",
1900
1941
  size: "small",
1901
1942
  onClick: () => {
1902
- if (n.clearSelection(e.id), !p || n.parameters[p] === void 0) return;
1903
- let { [p]: t, ...r } = n.parameters;
1904
- K(n.screen, r);
1943
+ if (n.clearSelection(e.id), !m || n.parameters[m] === void 0) return;
1944
+ let { [m]: t, ...r } = n.parameters;
1945
+ Y(n.screen, r);
1905
1946
  },
1906
1947
  children: "Clear selection"
1907
1948
  }),
1908
- /* @__PURE__ */ I("table", {
1909
- "aria-label": Z(e, "label", Z(e, "typeName", "Results")),
1910
- children: [/* @__PURE__ */ F("thead", { children: /* @__PURE__ */ F("tr", { children: d.map((e) => /* @__PURE__ */ F("th", {
1949
+ /* @__PURE__ */ z("table", {
1950
+ "aria-label": Q(e, "label", Q(e, "typeName", "Results")),
1951
+ children: [/* @__PURE__ */ R("thead", { children: /* @__PURE__ */ R("tr", { children: f.map((e) => /* @__PURE__ */ R("th", {
1911
1952
  scope: "col",
1912
1953
  children: e.label
1913
- }, e.property)) }) }), /* @__PURE__ */ I("tbody", { children: [c.map((e, t) => /* @__PURE__ */ F("tr", {
1914
- "aria-selected": h === e,
1954
+ }, e.property)) }) }), /* @__PURE__ */ z("tbody", { children: [c.map((e, t) => /* @__PURE__ */ R("tr", {
1955
+ "aria-selected": g === e,
1915
1956
  tabIndex: 0,
1916
- onClick: () => _.click(e, () => v(e)),
1917
- onDoubleClick: _.doubleClick ? () => _.doubleClick?.(e) : void 0,
1957
+ onClick: () => v.click(e, () => y(e)),
1958
+ onDoubleClick: v.doubleClick ? () => v.doubleClick?.(e) : void 0,
1918
1959
  onKeyDown: (t) => {
1919
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), v(e));
1960
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), y(e));
1920
1961
  },
1921
- children: d.map((t) => /* @__PURE__ */ F("td", { children: di(e[t.property], t.options, t.optionValues) }, t.property))
1922
- }, String(Q(e, m) ?? t))), c.length === 0 && !u && /* @__PURE__ */ F("tr", { children: /* @__PURE__ */ F("td", {
1923
- colSpan: Math.max(d.length, 1),
1924
- children: "No records found"
1925
- }) })] })]
1962
+ children: f.map((t) => /* @__PURE__ */ R("td", { children: hi(e[t.property], t.options, t.optionValues) }, t.property))
1963
+ }, String(vi(e, h) ?? t))), /* @__PURE__ */ R(bi, {
1964
+ rowCount: c.length,
1965
+ columnCount: f.length,
1966
+ loading: u,
1967
+ awaitingCommand: d
1968
+ })] })]
1926
1969
  })
1927
1970
  ]
1928
1971
  });
1929
1972
  }
1930
- function hi(e) {
1931
- return gi(e) && (typeof e.path == "string" || typeof e.kind == "string");
1973
+ function bi({ rowCount: e, columnCount: t, loading: n, awaitingCommand: r }) {
1974
+ return e !== 0 || n || r ? null : /* @__PURE__ */ R("tr", { children: /* @__PURE__ */ R("td", {
1975
+ colSpan: Math.max(t, 1),
1976
+ children: "No records found"
1977
+ }) });
1978
+ }
1979
+ function xi(e) {
1980
+ return Si(e) && (typeof e.path == "string" || typeof e.kind == "string");
1932
1981
  }
1933
- function gi(e) {
1982
+ function Si(e) {
1934
1983
  return typeof e == "object" && !!e && !Array.isArray(e);
1935
1984
  }
1936
- function _i({ element: e, interactions: t, slots: n }) {
1937
- return zr(e) ? /* @__PURE__ */ F(Hr, {
1985
+ function Ci({ element: e, interactions: t, slots: n }) {
1986
+ return Ur(e) ? /* @__PURE__ */ R(Kr, {
1938
1987
  element: e,
1939
1988
  interactions: t
1940
- }) : /* @__PURE__ */ F(vi, {
1989
+ }) : /* @__PURE__ */ R(wi, {
1941
1990
  element: e,
1942
1991
  interactions: t,
1943
1992
  slots: n
1944
1993
  });
1945
1994
  }
1946
- function vi({ element: e, interactions: t }) {
1947
- let n = Z(e, "label", Z(e, "command")), r = G(Z(e, "command"), Z(e, "typeName"), Z(e, "route")), i = gn(e), a = yi(e, i), o = Z(e, "schema"), c = s(() => U(o), [o]), { selectedRows: l } = q(), u = _n(i, l);
1948
- return r ? a.length > 0 || vn(i, u) ? /* @__PURE__ */ F(L, {
1995
+ function wi({ element: e, interactions: t }) {
1996
+ let n = Q(e, "label", Q(e, "command")), r = J(Q(e, "command"), Q(e, "typeName"), Q(e, "route")), i = vn(e), a = Ti(e, i), o = Q(e, "schema"), c = s(() => K(o), [o]), { selectedRows: l } = $n(), u = yn(i, l);
1997
+ return r ? a.length > 0 || bn(i, u) ? /* @__PURE__ */ R(B, {
1949
1998
  type: "button",
1950
1999
  "data-scene-id": e.id,
1951
2000
  disabled: !0,
1952
2001
  title: "Select a row first",
1953
2002
  ...t,
1954
2003
  children: n
1955
- }) : /* @__PURE__ */ F(xi, {
1956
- element: u ? Sn(e, c, u) : e,
2004
+ }) : /* @__PURE__ */ R(Di, {
2005
+ element: u ? wn(e, c, u) : e,
1957
2006
  label: n
1958
- }) : /* @__PURE__ */ F(L, {
2007
+ }) : /* @__PURE__ */ R(B, {
1959
2008
  type: "button",
1960
2009
  "data-scene-id": e.id,
1961
2010
  disabled: !0,
@@ -1964,28 +2013,28 @@ function vi({ element: e, interactions: t }) {
1964
2013
  children: n
1965
2014
  });
1966
2015
  }
1967
- function yi(e, t) {
1968
- let { parameters: n } = z(), r = Z(e, "schema"), i = e.properties.fields, a = Z(e, "generationMode").toLowerCase(), o = s(() => U(r), [r]), { selectableRows: c, selectedRows: l } = q(), u = Array.isArray(i) ? i : [], d = u.length > 0 || a === "manual" ? new Set(u.map(bi).filter((e) => e !== "")) : void 0;
1969
- return !d || t !== void 0 ? [] : _r(o.filter((e) => !d.has(e.name)), n, l, c);
2016
+ function Ti(e, t) {
2017
+ let { parameters: n } = H(), r = Q(e, "schema"), i = e.properties.fields, a = Q(e, "generationMode").toLowerCase(), o = s(() => K(r), [r]), { selectableRows: c, selectedRows: l } = $n(), u = Array.isArray(i) ? i : [], d = u.length > 0 || a === "manual" ? new Set(u.map(Ei).filter((e) => e !== "")) : void 0;
2018
+ return !d || t !== void 0 ? [] : br(o.filter((e) => !d.has(e.name)), n, l, c);
1970
2019
  }
1971
- function bi(e) {
1972
- return gi(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
2020
+ function Ei(e) {
2021
+ return Si(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
1973
2022
  }
1974
- function xi({ element: e, label: t }) {
2023
+ function Di({ element: e, label: t }) {
1975
2024
  let [n, i] = l(0), [a, o] = l(!1), s = r(() => {
1976
2025
  o(!1), i((e) => e + 1);
1977
- }, []), c = /* @__PURE__ */ F(Zn.Provider, {
2026
+ }, []), c = /* @__PURE__ */ R(er.Provider, {
1978
2027
  value: s,
1979
- children: /* @__PURE__ */ F($n, { element: e }, n)
2028
+ children: /* @__PURE__ */ R(nr, { element: e }, n)
1980
2029
  });
1981
- return /* @__PURE__ */ I("div", {
2030
+ return /* @__PURE__ */ z("div", {
1982
2031
  className: "stage-action",
1983
2032
  "data-scene-id": e.id,
1984
- children: [/* @__PURE__ */ F(L, {
2033
+ children: [/* @__PURE__ */ R(B, {
1985
2034
  type: "button",
1986
2035
  onClick: () => o(!0),
1987
2036
  children: t
1988
- }), /* @__PURE__ */ F(He, {
2037
+ }), /* @__PURE__ */ R(ze, {
1989
2038
  title: t,
1990
2039
  visible: a,
1991
2040
  onClose: () => o(!1),
@@ -1995,45 +2044,45 @@ function xi({ element: e, label: t }) {
1995
2044
  })]
1996
2045
  });
1997
2046
  }
1998
- function Si(e) {
1999
- let t = e.element ?? ui("slice-dialog", {}), n = ge(), { routes: i, parameters: a } = z(), o = me(n?.currentDialogParameters), c = Z(t, "command") || o?.command || Z(t, "slice") || "", u = Z(t, "title") || o?.title || c, d = i?.commandSchemas?.[c], f = s(() => U(d ?? ""), [d]), { selectableRows: p, selectedRows: m } = q(), h = r(() => n?.closeDialog(), [n]), [g, _] = l(null), v = (e) => e.identifier && e.required && fr(e, p) && dr(e, m) !== void 0;
2000
- if (!d || !(f.some((e) => e.options || e.members || e.item) || f.some(v))) return e.element ? /* @__PURE__ */ F(ne, {
2047
+ function Oi(e) {
2048
+ let t = e.element ?? mi("slice-dialog", {}), n = pe(), { routes: i, parameters: a } = H(), o = de(n?.currentDialogParameters), c = Q(t, "command") || o?.command || Q(t, "slice") || "", u = Q(t, "title") || o?.title || c, d = i?.commandSchemas?.[c], f = s(() => K(d ?? ""), [d]), { selectableRows: p, selectedRows: m } = $n(), h = r(() => n?.closeDialog(), [n]), [g, _] = l(null), v = (e) => e.identifier && e.required && hr(e, p) && mr(e, m) !== void 0;
2049
+ if (!d || !(f.some((e) => e.options || e.members || e.item) || f.some(v))) return e.element ? /* @__PURE__ */ R(D, {
2001
2050
  element: e.element,
2002
2051
  slots: e.slots ?? {}
2003
- }) : /* @__PURE__ */ F(se, {});
2004
- let y = f.filter((e) => !lr(e, a) && !v(e)), b = ui(`slice-dialog-${c}`, {
2052
+ }) : /* @__PURE__ */ R(ie, {});
2053
+ let y = f.filter((e) => !fr(e, a) && !v(e)), b = mi(`slice-dialog-${c}`, {
2005
2054
  command: c,
2006
2055
  label: u,
2007
2056
  schema: d,
2008
2057
  fields: y.map((e) => ({
2009
2058
  name: e.name,
2010
- label: W(e.name)
2059
+ label: q(e.name)
2011
2060
  })),
2012
2061
  generationMode: "manual"
2013
2062
  });
2014
- return /* @__PURE__ */ I("section", {
2063
+ return /* @__PURE__ */ z("section", {
2015
2064
  className: "scene-slice-dialog",
2016
- "data-scene-slice-dialog": Z(t, "slice") || o?.slice,
2065
+ "data-scene-slice-dialog": Q(t, "slice") || o?.slice,
2017
2066
  "data-scene-command": c,
2018
2067
  children: [
2019
- /* @__PURE__ */ F("header", {
2068
+ /* @__PURE__ */ R("header", {
2020
2069
  className: "scene-slice-dialog-header",
2021
- children: /* @__PURE__ */ F("h2", {
2070
+ children: /* @__PURE__ */ R("h2", {
2022
2071
  className: "scene-slice-dialog-title",
2023
2072
  children: u
2024
2073
  })
2025
2074
  }),
2026
- /* @__PURE__ */ F(Zn.Provider, {
2075
+ /* @__PURE__ */ R(er.Provider, {
2027
2076
  value: h,
2028
- children: /* @__PURE__ */ F(Qn.Provider, {
2077
+ children: /* @__PURE__ */ R(tr.Provider, {
2029
2078
  value: g,
2030
- children: /* @__PURE__ */ F($n, { element: b })
2079
+ children: /* @__PURE__ */ R(nr, { element: b })
2031
2080
  })
2032
2081
  }),
2033
- /* @__PURE__ */ F("footer", {
2082
+ /* @__PURE__ */ R("footer", {
2034
2083
  ref: _,
2035
2084
  className: "scene-slice-dialog-footer",
2036
- children: /* @__PURE__ */ F("button", {
2085
+ children: /* @__PURE__ */ R("button", {
2037
2086
  type: "button",
2038
2087
  className: "scene-slice-dialog-cancel",
2039
2088
  onClick: h,
@@ -2043,18 +2092,18 @@ function Si(e) {
2043
2092
  ]
2044
2093
  });
2045
2094
  }
2046
- function Ci(e) {
2095
+ function ki(e) {
2047
2096
  let { element: t } = e;
2048
- return Z(t, "slice") === "" ? Z(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */ F(Ei, { ...e }) : /* @__PURE__ */ F(E, { ...e }) : /* @__PURE__ */ F(wi, { ...e });
2097
+ return Q(t, "slice") === "" ? Q(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */ R(Mi, { ...e }) : /* @__PURE__ */ R(O, { ...e }) : /* @__PURE__ */ R(Ai, { ...e });
2049
2098
  }
2050
- function wi(e) {
2051
- let { element: t } = e, { routes: n, parameters: r } = z(), i = Z(t, "slice"), a = Z(t, "command") || i.split(".").at(-1) || "", o = n?.commandSchemas?.[a], c = s(() => U(o ?? ""), [o]), { selectableRows: l, selectedRows: u } = q();
2052
- if (_r(c, r, u, l).length === 0) return /* @__PURE__ */ F(E, { ...e });
2053
- let d = Z(t, "label", Z(t, "name", t.id));
2054
- return /* @__PURE__ */ F("span", {
2099
+ function Ai(e) {
2100
+ let { element: t } = e, { routes: n, parameters: r } = H(), i = Q(t, "slice"), a = Q(t, "command") || i.split(".").at(-1) || "", o = n?.commandSchemas?.[a], c = s(() => K(o ?? ""), [o]), { selectableRows: l, selectedRows: u } = $n();
2101
+ if (br(c, r, u, l).length === 0) return /* @__PURE__ */ R(O, { ...e });
2102
+ let d = Q(t, "label", Q(t, "name", t.id));
2103
+ return /* @__PURE__ */ R("span", {
2055
2104
  className: "stage-toolbar-action",
2056
- "data-scene-toolbar-item": Z(t, "name", t.id),
2057
- children: /* @__PURE__ */ F(L, {
2105
+ "data-scene-toolbar-item": Q(t, "name", t.id),
2106
+ children: /* @__PURE__ */ R(B, {
2058
2107
  type: "button",
2059
2108
  "data-scene-id": t.id,
2060
2109
  disabled: !0,
@@ -2064,15 +2113,15 @@ function wi(e) {
2064
2113
  })
2065
2114
  });
2066
2115
  }
2067
- function Ti(e, t, n) {
2068
- return t !== "screen" && !!e.identifier && e.required && fr(e, n);
2116
+ function ji(e, t, n) {
2117
+ return t !== "screen" && !!e.identifier && e.required && hr(e, n);
2069
2118
  }
2070
- function Ei(e) {
2071
- let { element: t } = e, { routes: n, parameters: r } = z(), i = Z(t, "name", t.id), a = Z(t, "target"), o = Z(t, "label", i), c = n?.commandSchemas?.[a], l = s(() => U(c ?? ""), [c]), { selectableRows: u, selectedRows: d } = q(), f = gn(t), p = f === void 0 ? _r(l, r, d, u) : [], m = l.filter((e) => !lr(e, r) && !Ti(e, f, u)), h = c ? {
2119
+ function Mi(e) {
2120
+ let { element: t } = e, { routes: n, parameters: r } = H(), i = Q(t, "name", t.id), a = Q(t, "target"), o = Q(t, "label", i), c = n?.commandSchemas?.[a], l = s(() => K(c ?? ""), [c]), { selectableRows: u, selectedRows: d } = $n(), f = vn(t), p = f === void 0 ? br(l, r, d, u) : [], m = l.filter((e) => !fr(e, r) && !ji(e, f, u)), h = c ? {
2072
2121
  schema: c,
2073
2122
  fields: m.map((e) => ({
2074
2123
  name: e.name,
2075
- label: W(e.name)
2124
+ label: q(e.name)
2076
2125
  })),
2077
2126
  generationMode: "manual"
2078
2127
  } : {}, g = {
@@ -2082,39 +2131,39 @@ function Ei(e) {
2082
2131
  command: a,
2083
2132
  label: o,
2084
2133
  ...h,
2085
- ...bn(t, f)
2134
+ ...Sn(t, f)
2086
2135
  }
2087
2136
  };
2088
- return /* @__PURE__ */ F("span", {
2137
+ return /* @__PURE__ */ R("span", {
2089
2138
  className: "stage-toolbar-action",
2090
2139
  "data-scene-toolbar-item": i,
2091
- children: p.length > 0 ? /* @__PURE__ */ F(L, {
2140
+ children: p.length > 0 ? /* @__PURE__ */ R(B, {
2092
2141
  type: "button",
2093
2142
  "data-scene-id": t.id,
2094
2143
  disabled: !0,
2095
2144
  title: "Select a row first",
2096
2145
  ...e.interactions,
2097
2146
  children: o
2098
- }) : /* @__PURE__ */ F(_i, {
2147
+ }) : /* @__PURE__ */ R(Ci, {
2099
2148
  element: g,
2100
2149
  interactions: e.interactions,
2101
2150
  slots: e.slots
2102
2151
  })
2103
2152
  });
2104
2153
  }
2105
- var Di = {
2106
- ...O,
2107
- "core:table": mi,
2108
- "core:action": _i,
2109
- "core:toolbarItem": Ci,
2110
- "core:sliceDialog": Si,
2111
- [li]: $n,
2112
- [Wr]: Xr,
2113
- [ci]: si
2154
+ var Ni = {
2155
+ ...se,
2156
+ "core:table": yi,
2157
+ "core:action": Ci,
2158
+ "core:toolbarItem": ki,
2159
+ "core:sliceDialog": Oi,
2160
+ [pi]: nr,
2161
+ [Jr]: ei,
2162
+ [fi]: di
2114
2163
  };
2115
2164
  // src/useStrings.ts
2116
- function Oi() {
2117
- let e = lt(), [t, n] = l([]), [r, i] = l(""), [o, s] = l({});
2165
+ function Pi() {
2166
+ let e = ot(), [t, n] = l([]), [r, i] = l(""), [o, s] = l({});
2118
2167
  return a(() => {
2119
2168
  let t = new AbortController();
2120
2169
  return e.locales(t.signal).then((e) => {
@@ -2135,11 +2184,11 @@ function Oi() {
2135
2184
  dictionary: o
2136
2185
  };
2137
2186
  }
2138
- var ki = /* @__PURE__ */ new Set(["core:table"]);
2139
- function Ai(e) {
2140
- return ji(e, /* @__PURE__ */ new Map(), void 0);
2187
+ var Fi = /* @__PURE__ */ new Set(["core:table"]);
2188
+ function Ii(e) {
2189
+ return Li(e, /* @__PURE__ */ new Map(), void 0);
2141
2190
  }
2142
- function ji(e, t, n) {
2191
+ function Li(e, t, n) {
2143
2192
  let r = e;
2144
2193
  if (!r.slots) return e;
2145
2194
  let i = !1, a = {};
@@ -2148,7 +2197,7 @@ function ji(e, t, n) {
2148
2197
  a[e] = o.map((e) => {
2149
2198
  let t = e, n = $(t, "typeName");
2150
2199
  t.componentName === "core:data" && n && (r.set(n, t), s = t);
2151
- let a = ji(Ni(Mi(t, r), s), r, s);
2200
+ let a = Li(zi(Ri(t, r), s), r, s);
2152
2201
  return a !== e && (i = !0), a;
2153
2202
  });
2154
2203
  }
@@ -2157,8 +2206,8 @@ function ji(e, t, n) {
2157
2206
  slots: a
2158
2207
  } : e;
2159
2208
  }
2160
- function Mi(e, t) {
2161
- if (!ki.has(e.componentName)) return e;
2209
+ function Ri(e, t) {
2210
+ if (!Fi.has(e.componentName)) return e;
2162
2211
  let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
2163
2212
  if (!r || e.properties.queryArguments !== void 0) return e;
2164
2213
  let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
@@ -2167,7 +2216,7 @@ function Mi(e, t) {
2167
2216
  properties: a
2168
2217
  };
2169
2218
  }
2170
- function Ni(e, t) {
2219
+ function zi(e, t) {
2171
2220
  if (e.componentName !== "core:action" || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
2172
2221
  let n = { ...e.properties };
2173
2222
  if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
@@ -2185,7 +2234,7 @@ function $(e, t) {
2185
2234
  return typeof n == "string" && n.length > 0 ? n : void 0;
2186
2235
  }
2187
2236
  // src/stageQueryBindings.tsx
2188
- function Pi(e) {
2237
+ function Bi(e) {
2189
2238
  let t = /* @__PURE__ */ new Set(), n = (e) => {
2190
2239
  if (Array.isArray(e)) {
2191
2240
  e.forEach(n);
@@ -2201,7 +2250,7 @@ function Pi(e) {
2201
2250
  };
2202
2251
  return r(e), [...t];
2203
2252
  }
2204
- function Fi(e) {
2253
+ function Vi(e) {
2205
2254
  let t = /* @__PURE__ */ new Map(), n = (e, t) => {
2206
2255
  let n = e.properties?.[t];
2207
2256
  return typeof n == "string" && n.length > 0 ? n : void 0;
@@ -2220,8 +2269,8 @@ function Fi(e) {
2220
2269
  };
2221
2270
  return r(e), [...t.values()];
2222
2271
  }
2223
- function Ii({ source: e }) {
2224
- let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = e.by ? r[e.by] || i[e.by] : void 0, o = s(() => e.by ? a ? { [e.by]: a } : {} : {
2272
+ function Hi({ source: e }) {
2273
+ let { routes: t, routesReady: n, parameters: r, session: i } = H(), a = e.by ? r[e.by] || i[e.by] : void 0, o = s(() => e.by ? a ? { [e.by]: a } : {} : {
2225
2274
  ...i,
2226
2275
  ...r
2227
2276
  }, [
@@ -2230,7 +2279,7 @@ function Ii({ source: e }) {
2230
2279
  i,
2231
2280
  e.by
2232
2281
  ]);
2233
- return B({
2282
+ return U({
2234
2283
  scope: `data:${e.typeName}`,
2235
2284
  name: e.query,
2236
2285
  alias: e.typeName,
@@ -2240,12 +2289,12 @@ function Ii({ source: e }) {
2240
2289
  list: !0
2241
2290
  }), null;
2242
2291
  }
2243
- function Li({ name: e }) {
2244
- let { routes: t, routesReady: n, parameters: r, session: i } = z(), a = s(() => ({
2292
+ function Ui({ name: e }) {
2293
+ let { routes: t, routesReady: n, parameters: r, session: i } = H(), a = s(() => ({
2245
2294
  ...i,
2246
2295
  ...r
2247
2296
  }), [r, i]);
2248
- return B({
2297
+ return U({
2249
2298
  scope: `binding:${e}`,
2250
2299
  name: e,
2251
2300
  route: t?.queries?.[e],
@@ -2254,37 +2303,37 @@ function Li({ name: e }) {
2254
2303
  list: !0
2255
2304
  }), null;
2256
2305
  }
2257
- function Ri({ element: e }) {
2258
- let t = s(() => Pi(e), [e]), n = s(() => Fi(e), [e]);
2259
- return /* @__PURE__ */ I(Ve, { children: [t.map((e) => /* @__PURE__ */ F(Li, { name: e }, e)), n.map((e) => /* @__PURE__ */ F(Ii, { source: e }, e.typeName))] });
2306
+ function Wi({ element: e }) {
2307
+ let t = s(() => Bi(e), [e]), n = s(() => Vi(e), [e]);
2308
+ return /* @__PURE__ */ z(Re, { children: [t.map((e) => /* @__PURE__ */ R(Ui, { name: e }, e)), n.map((e) => /* @__PURE__ */ R(Hi, { source: e }, e.typeName))] });
2260
2309
  }
2261
2310
  // src/stageThemeChoice.ts
2262
- var zi = "cratis.stage.theme";
2263
- function Bi() {
2311
+ var Gi = "cratis.stage.theme";
2312
+ function Ki() {
2264
2313
  try {
2265
2314
  return globalThis.localStorage ?? null;
2266
2315
  } catch {
2267
2316
  return null;
2268
2317
  }
2269
2318
  }
2270
- function Vi() {
2319
+ function qi() {
2271
2320
  try {
2272
- return Bi()?.getItem("cratis.stage.theme") || void 0;
2321
+ return Ki()?.getItem("cratis.stage.theme") || void 0;
2273
2322
  } catch {
2274
2323
  return;
2275
2324
  }
2276
2325
  }
2277
- function Hi(e) {
2326
+ function Ji(e) {
2278
2327
  try {
2279
- Bi()?.setItem(zi, e);
2328
+ Ki()?.setItem(Gi, e);
2280
2329
  } catch {}
2281
2330
  }
2282
- function Ui(e) {
2331
+ function Yi(e) {
2283
2332
  let t = /* @__PURE__ */ new Set(), n = [];
2284
2333
  for (let r of e.flatMap((e) => e.contributions ?? [])) {
2285
- let e = Gi(r);
2334
+ let e = Zi(r);
2286
2335
  if (!e) continue;
2287
- let i = qi(e);
2336
+ let i = $i(e);
2288
2337
  t.has(i) || (t.add(i), n.push(e));
2289
2338
  }
2290
2339
  return n.map((e, t) => ({
@@ -2292,47 +2341,47 @@ function Ui(e) {
2292
2341
  index: t
2293
2342
  })).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
2294
2343
  }
2295
- function Wi(e) {
2344
+ function Xi(e) {
2296
2345
  let t = {
2297
2346
  label: "",
2298
2347
  children: []
2299
2348
  };
2300
2349
  for (let n of e) {
2301
- let e = n.hierarchy.reduce((e, t) => Ji(e, t, !1), t);
2302
- (n.group ? Ji(e, n.group, !0) : e).children.push(Yi(n));
2350
+ let e = n.hierarchy.reduce((e, t) => ea(e, t, !1), t);
2351
+ (n.group ? ea(e, n.group, !0) : e).children.push(ta(n));
2303
2352
  }
2304
2353
  return t.children;
2305
2354
  }
2306
- function Gi(e) {
2355
+ function Zi(e) {
2307
2356
  if (e.contributionPointName !== "Navigation") return;
2308
2357
  let t = e.content?.properties ?? {}, n = t.label, r = t.targetScreen;
2309
2358
  if (typeof n != "string" || typeof r != "string") return;
2310
- let i = Ki(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
2359
+ let i = Qi(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
2311
2360
  return {
2312
2361
  label: n,
2313
2362
  targetScreen: r,
2314
2363
  hierarchy: i,
2315
2364
  order: a,
2316
- ...Zi({
2317
- id: Xi(t.id),
2318
- group: Xi(t.group),
2319
- icon: Xi(t.icon),
2320
- presentation: Xi(t.presentation),
2321
- destination: $i(o) && ea(o) ? o : void 0
2365
+ ...ra({
2366
+ id: na(t.id),
2367
+ group: na(t.group),
2368
+ icon: na(t.icon),
2369
+ presentation: na(t.presentation),
2370
+ destination: aa(o) && oa(o) ? o : void 0
2322
2371
  })
2323
2372
  };
2324
2373
  }
2325
- function Ki(e) {
2374
+ function Qi(e) {
2326
2375
  return Array.isArray(e.hierarchy) ? e.hierarchy.filter((e) => typeof e == "string") : [];
2327
2376
  }
2328
- function qi(e) {
2377
+ function $i(e) {
2329
2378
  return e.id === void 0 ? JSON.stringify([
2330
2379
  e.hierarchy,
2331
2380
  e.targetScreen,
2332
2381
  e.label
2333
2382
  ]) : JSON.stringify(["id", e.id]);
2334
2383
  }
2335
- function Ji(e, t, n) {
2384
+ function ea(e, t, n) {
2336
2385
  let r = e.children.find((e) => e.screen === void 0 && e.section === !0 === n && e.label === t);
2337
2386
  if (r) return r;
2338
2387
  let i = n ? {
@@ -2345,12 +2394,12 @@ function Ji(e, t, n) {
2345
2394
  };
2346
2395
  return e.children.push(i), i;
2347
2396
  }
2348
- function Yi(e) {
2397
+ function ta(e) {
2349
2398
  return {
2350
2399
  label: e.label,
2351
- ...Zi({ id: e.id || void 0 }),
2400
+ ...ra({ id: e.id || void 0 }),
2352
2401
  screen: e.targetScreen,
2353
- ...Zi({
2402
+ ...ra({
2354
2403
  icon: e.icon || void 0,
2355
2404
  presentation: e.presentation || void 0,
2356
2405
  destination: e.destination
@@ -2358,27 +2407,27 @@ function Yi(e) {
2358
2407
  children: []
2359
2408
  };
2360
2409
  }
2361
- function Xi(e) {
2410
+ function na(e) {
2362
2411
  return typeof e == "string" ? e : void 0;
2363
2412
  }
2364
- function Zi(e) {
2413
+ function ra(e) {
2365
2414
  return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
2366
2415
  }
2367
- function Qi(e, t) {
2416
+ function ia(e, t) {
2368
2417
  for (let n of e) {
2369
2418
  if (n.screen === t) return [n.label];
2370
- let e = Qi(n.children, t);
2419
+ let e = ia(n.children, t);
2371
2420
  if (e.length > 0) return n.section ? e : [n.label, ...e];
2372
2421
  }
2373
2422
  return [];
2374
2423
  }
2375
- function $i(e) {
2424
+ function aa(e) {
2376
2425
  return typeof e == "object" && !!e && !Array.isArray(e);
2377
2426
  }
2378
- function ea(e) {
2427
+ function oa(e) {
2379
2428
  return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
2380
2429
  }
2381
- function ta(e, t, n) {
2430
+ function sa(e, t, n) {
2382
2431
  return e.filter((e) => !t.has(e.name)).map((e) => ({
2383
2432
  label: e.name,
2384
2433
  targetScreen: e.name,
@@ -2386,54 +2435,54 @@ function ta(e, t, n) {
2386
2435
  }));
2387
2436
  }
2388
2437
  // src/blueprint.ts
2389
- var na = "Stage:locale", ra = "Stage:themeToggle", ia = "Cratis.Components", aa = "PrimeReact", oa = /* @__PURE__ */ new Map();
2390
- function sa(e) {
2391
- return Ne(e).packages.includes(aa);
2438
+ var ca = "Stage:locale", la = "Stage:themeToggle", ua = "Cratis.Components", da = "PrimeReact", fa = /* @__PURE__ */ new Map();
2439
+ function pa(e) {
2440
+ return Ae(e).packages.includes(da);
2392
2441
  }
2393
- function ca(e, t) {
2394
- oa.set(e, t);
2442
+ function ma(e, t) {
2443
+ fa.set(e, t);
2395
2444
  }
2396
- function la(e) {
2397
- let t = Ne(e);
2445
+ function ha(e) {
2446
+ let t = Ae(e);
2398
2447
  return {
2399
2448
  ...t,
2400
2449
  name: e?.length ? t.name : "Stage",
2401
2450
  packages: x(t.packages, {
2402
- baseline: ia,
2403
- catalog: { [Ee]: g.Blueprint }
2451
+ baseline: ua,
2452
+ catalog: { [Ce]: g.Blueprint }
2404
2453
  })
2405
2454
  };
2406
2455
  }
2407
- var ua = {
2408
- ...Ce,
2409
- [ia]: rt.components
2456
+ var ga = {
2457
+ ...be,
2458
+ [ua]: et.components
2410
2459
  };
2411
- function da(e) {
2412
- let t = [...oa.values()].reduce((e, t) => ({
2460
+ function _a(e) {
2461
+ let t = [...fa.values()].reduce((e, t) => ({
2413
2462
  ...e,
2414
2463
  ...t.components
2415
2464
  }), {});
2416
2465
  return {
2417
- ...O,
2418
- ...nt,
2466
+ ...se,
2467
+ ...$e,
2419
2468
  ...t,
2420
- ...Te,
2421
- ...Me,
2469
+ ...Se,
2470
+ ...ke,
2422
2471
  ...e
2423
2472
  };
2424
2473
  }
2425
- function fa(e) {
2426
- let t = Object.fromEntries([...oa].map(([e, t]) => [e, t.declared]));
2474
+ function va(e) {
2475
+ let t = Object.fromEntries([...fa].map(([e, t]) => [e, t.declared]));
2427
2476
  return {
2428
2477
  ...e,
2429
- ...ua,
2478
+ ...ga,
2430
2479
  ...t
2431
2480
  };
2432
2481
  }
2433
- var pa = "Stage:navigationTree";
2434
- function ma(e, t, n) {
2482
+ var ya = "Stage:navigationTree";
2483
+ function ba(e, t, n) {
2435
2484
  let r = t?.title ?? "Cratis Stage";
2436
- return P(e, j.Logo, {
2485
+ return L(e, P.Logo, {
2437
2486
  label: r,
2438
2487
  initials: r.slice(0, 1).toUpperCase() || "S",
2439
2488
  targetScreen: n,
@@ -2442,40 +2491,40 @@ function ma(e, t, n) {
2442
2491
  ...t?.showName === void 0 ? {} : { showName: t.showName }
2443
2492
  });
2444
2493
  }
2445
- function ha(e, t, n, r, i, a = !1, o = !0) {
2446
- let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = Ui(e), u = ta(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = Wi([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => je({
2494
+ function xa(e, t, n, r, i, a = !1, o = !0) {
2495
+ let s = e[0]?.name ?? "", c = i?.title ?? "Cratis Stage", l = Yi(e), u = sa(e, new Set(l.map((e) => e.targetScreen)), "Other screens"), d = Xi([...l, ...l.length > 0 ? u : []]), f = e.map((e, n) => Oe({
2447
2496
  label: e.name,
2448
2497
  targetScreen: e.name,
2449
2498
  icon: "pi pi-table",
2450
2499
  group: "Screens",
2451
2500
  order: n
2452
- }, t)), p = Qi(Wi(l), t), m = e.find((e) => e.name === t)?.path?.length ? Qi(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? P("menu-hierarchy", pa, {
2501
+ }, t)), p = ia(Xi(l), t), m = e.find((e) => e.name === t)?.path?.length ? ia(d, t) : [], h = p.length > 0 ? p : m, g = l.length > 0 ? L("menu-hierarchy", ya, {
2453
2502
  nodes: d,
2454
2503
  activeScreen: t
2455
- }) : P("menu-screens", j.Menu, {
2504
+ }) : L("menu-screens", P.Menu, {
2456
2505
  title: "Screens",
2457
2506
  label: "Screens"
2458
2507
  }, { items: f }), _ = [];
2459
- n.length > 1 && _.push(P("topbar-locale", na, {
2508
+ n.length > 1 && _.push(L("topbar-locale", ca, {
2460
2509
  locales: n,
2461
2510
  locale: r
2462
- })), _.push(P("topbar-theme", ra, {}));
2511
+ })), _.push(L("topbar-theme", la, {}));
2463
2512
  let v = { regionNavigation: a };
2464
2513
  return {
2465
- [M.Topbar]: [P("topbar", j.Topbar, v, {
2466
- logo: [ma("topbar-logo", i, s)],
2514
+ [F.Topbar]: [L("topbar", P.Topbar, v, {
2515
+ logo: [ba("topbar-logo", i, s)],
2467
2516
  end: _
2468
2517
  })],
2469
- [M.Sidebar]: [P("sidebar", j.Sidebar, v, { logo: [ma("sidebar-logo", i, s)] })],
2470
- ...a ? {} : { [M.Menu]: [g] },
2471
- [M.Breadcrumb]: [P("breadcrumb", j.Breadcrumb, {
2518
+ [F.Sidebar]: [L("sidebar", P.Sidebar, v, { logo: [ba("sidebar-logo", i, s)] })],
2519
+ ...a ? {} : { [F.Menu]: [g] },
2520
+ [F.Breadcrumb]: [L("breadcrumb", P.Breadcrumb, {
2472
2521
  homeTargetScreen: s,
2473
2522
  items: (h.length > 0 ? h : [t]).map((e) => ({ label: e }))
2474
2523
  })],
2475
- ...o ? { [M.Footer]: [P("footer", j.Footer, { text: `${c} · rendered from your model` })] } : {},
2476
- [M.ConfigPanel]: [P(j.ConfigPanel, j.ConfigPanel, {
2524
+ ...o ? { [F.Footer]: [L("footer", P.Footer, { text: `${c} · rendered from your model` })] } : {},
2525
+ [F.ConfigPanel]: [L(P.ConfigPanel, P.ConfigPanel, {
2477
2526
  title: "Settings",
2478
- themes: N.map((e) => ({
2527
+ themes: I.map((e) => ({
2479
2528
  name: e.name,
2480
2529
  label: e.name,
2481
2530
  isDark: e.isDark ?? !1
@@ -2483,11 +2532,11 @@ function ha(e, t, n, r, i, a = !1, o = !0) {
2483
2532
  })]
2484
2533
  };
2485
2534
  }
2486
- function ga(e) {
2535
+ function Sa(e) {
2487
2536
  return `#/${encodeURIComponent(e)}`;
2488
2537
  }
2489
2538
  // src/externalRouteHref.ts
2490
- function _a(e) {
2539
+ function Ca(e) {
2491
2540
  try {
2492
2541
  let t = new URL(e ?? "");
2493
2542
  return t.protocol === "http:" || t.protocol === "https:" ? e : void 0;
@@ -2496,48 +2545,48 @@ function _a(e) {
2496
2545
  }
2497
2546
  }
2498
2547
  // src/StageChrome.tsx
2499
- var va = t({
2548
+ var wa = t({
2500
2549
  locales: [],
2501
2550
  locale: "",
2502
2551
  setLocale: () => void 0,
2503
2552
  activity: ""
2504
2553
  });
2505
- function ya({ state: e, children: t }) {
2506
- return /* @__PURE__ */ F(va.Provider, {
2554
+ function Ta({ state: e, children: t }) {
2555
+ return /* @__PURE__ */ R(wa.Provider, {
2507
2556
  value: e,
2508
2557
  children: t
2509
2558
  });
2510
2559
  }
2511
- var ba = "Stage:activity";
2512
- function xa() {
2513
- let { locales: e, locale: t, setLocale: n } = i(va);
2514
- return e.length < 2 ? null : /* @__PURE__ */ F("select", {
2560
+ var Ea = "Stage:activity";
2561
+ function Da() {
2562
+ let { locales: e, locale: t, setLocale: n } = i(wa);
2563
+ return e.length < 2 ? null : /* @__PURE__ */ R("select", {
2515
2564
  className: "stage-locale",
2516
2565
  "aria-label": "Locale",
2517
2566
  value: t,
2518
2567
  onChange: (e) => n(e.target.value),
2519
- children: e.map((e) => /* @__PURE__ */ F("option", {
2568
+ children: e.map((e) => /* @__PURE__ */ R("option", {
2520
2569
  value: e,
2521
2570
  children: e
2522
2571
  }, e))
2523
2572
  });
2524
2573
  }
2525
- function Sa({ element: e }) {
2526
- let { config: t, setThemeName: n, setColorScheme: r } = Pe(), i = N.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === A.Dark, a = N.find((e) => (e.isDark ?? !1) !== i);
2574
+ function Oa({ element: e }) {
2575
+ let { config: t, setThemeName: n, setColorScheme: r } = je(), i = I.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === N.Dark, a = I.find((e) => (e.isDark ?? !1) !== i);
2527
2576
  if (!a) return null;
2528
2577
  let o = i ? "Switch to a light theme" : "Switch to a dark theme";
2529
- return /* @__PURE__ */ F("div", {
2578
+ return /* @__PURE__ */ R("div", {
2530
2579
  className: "stage-theme-toggle",
2531
2580
  "data-scene-id": e.id,
2532
- children: /* @__PURE__ */ F("button", {
2581
+ children: /* @__PURE__ */ R("button", {
2533
2582
  type: "button",
2534
2583
  className: "stage-theme-toggle__button",
2535
2584
  "aria-label": o,
2536
2585
  title: o,
2537
2586
  onClick: () => {
2538
- Hi(a.name), n(a.name), r(a.isDark ? A.Dark : A.Light);
2587
+ Ji(a.name), n(a.name), r(a.isDark ? N.Dark : N.Light);
2539
2588
  },
2540
- children: /* @__PURE__ */ F("svg", {
2589
+ children: /* @__PURE__ */ R("svg", {
2541
2590
  width: "18",
2542
2591
  height: "18",
2543
2592
  viewBox: "0 0 24 24",
@@ -2547,43 +2596,43 @@ function Sa({ element: e }) {
2547
2596
  strokeLinecap: "round",
2548
2597
  strokeLinejoin: "round",
2549
2598
  "aria-hidden": "true",
2550
- children: i ? /* @__PURE__ */ I(Ve, { children: [/* @__PURE__ */ F("circle", {
2599
+ children: i ? /* @__PURE__ */ z(Re, { children: [/* @__PURE__ */ R("circle", {
2551
2600
  cx: "12",
2552
2601
  cy: "12",
2553
2602
  r: "4"
2554
- }), /* @__PURE__ */ F("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" })] }) : /* @__PURE__ */ F("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
2603
+ }), /* @__PURE__ */ R("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" })] }) : /* @__PURE__ */ R("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
2555
2604
  })
2556
2605
  })
2557
2606
  });
2558
2607
  }
2559
- function Ca({ element: e }) {
2608
+ function ka({ element: e }) {
2560
2609
  let t = e.properties ?? {};
2561
- return /* @__PURE__ */ F("nav", {
2610
+ return /* @__PURE__ */ R("nav", {
2562
2611
  className: "stage-navigation-tree",
2563
2612
  "aria-label": "Navigation",
2564
2613
  "data-scene-id": e.id,
2565
- children: /* @__PURE__ */ F(wa, {
2614
+ children: /* @__PURE__ */ R(Aa, {
2566
2615
  nodes: t.nodes ?? [],
2567
2616
  activeScreen: t.activeScreen
2568
2617
  })
2569
2618
  });
2570
2619
  }
2571
- function wa({ nodes: e, activeScreen: t }) {
2572
- return /* @__PURE__ */ F("ul", {
2620
+ function Aa({ nodes: e, activeScreen: t }) {
2621
+ return /* @__PURE__ */ R("ul", {
2573
2622
  role: "tree",
2574
- children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ I("li", {
2623
+ children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ z("li", {
2575
2624
  role: "treeitem",
2576
2625
  "aria-expanded": "true",
2577
- children: [/* @__PURE__ */ F("span", {
2626
+ children: [/* @__PURE__ */ R("span", {
2578
2627
  className: "stage-navigation-group",
2579
2628
  children: e.label
2580
- }), /* @__PURE__ */ F(wa, {
2629
+ }), /* @__PURE__ */ R(Aa, {
2581
2630
  nodes: e.children,
2582
2631
  activeScreen: t
2583
2632
  })]
2584
- }, e.label) : /* @__PURE__ */ F("li", {
2633
+ }, e.label) : /* @__PURE__ */ R("li", {
2585
2634
  role: "treeitem",
2586
- children: /* @__PURE__ */ F(Ta, {
2635
+ children: /* @__PURE__ */ R(ja, {
2587
2636
  node: e,
2588
2637
  screen: e.screen,
2589
2638
  activeScreen: t
@@ -2591,11 +2640,11 @@ function wa({ nodes: e, activeScreen: t }) {
2591
2640
  }, `${e.screen}:${e.label}`))
2592
2641
  });
2593
2642
  }
2594
- function Ta({ node: e, screen: t, activeScreen: n }) {
2595
- let r = i(D), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external", c = o && r && !s && ea(o) ? (e) => {
2643
+ function ja({ node: e, screen: t, activeScreen: n }) {
2644
+ let r = i(A), a = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", o = e.destination, s = o?.kind === "external", c = o && r && !s && oa(o) ? (e) => {
2596
2645
  e.preventDefault(), r.navigate(o);
2597
- } : void 0, l = s ? _a(o.route) : ga(t), u = s && l === void 0;
2598
- return /* @__PURE__ */ I("a", {
2646
+ } : void 0, l = s ? Ca(o.route) : Sa(t), u = s && l === void 0;
2647
+ return /* @__PURE__ */ z("a", {
2599
2648
  href: l,
2600
2649
  rel: s && !u ? "noreferrer" : void 0,
2601
2650
  "aria-disabled": u ? "true" : void 0,
@@ -2604,30 +2653,30 @@ function Ta({ node: e, screen: t, activeScreen: n }) {
2604
2653
  "data-presentation": e.presentation,
2605
2654
  "data-icon": e.icon,
2606
2655
  onClick: c,
2607
- children: [a !== "text" && e.icon && /* @__PURE__ */ F("span", {
2656
+ children: [a !== "text" && e.icon && /* @__PURE__ */ R("span", {
2608
2657
  className: "stage-navigation-icon",
2609
2658
  "aria-hidden": "true",
2610
2659
  "data-icon-name": e.icon
2611
2660
  }), a !== "icon" && e.label]
2612
2661
  });
2613
2662
  }
2614
- function Ea({ element: e }) {
2615
- let t = typeof e.properties.name == "string" ? e.properties.name : "", n = i(D), r = ve(), a = z(), o = n?.outlets[t], s = o && r ? r.screens[o] : void 0, c = e.properties.closable === !0;
2616
- return /* @__PURE__ */ I("div", {
2663
+ function Ma({ element: e }) {
2664
+ let t = typeof e.properties.name == "string" ? e.properties.name : "", n = i(A), r = he(), a = H(), o = n?.outlets[t], s = o && r ? r.screens[o] : void 0, c = e.properties.closable === !0;
2665
+ return /* @__PURE__ */ z("div", {
2617
2666
  "data-scene-outlet": t,
2618
2667
  "data-scene-outlet-screen": o,
2619
- children: [c && o && /* @__PURE__ */ F("div", {
2668
+ children: [c && o && /* @__PURE__ */ R("div", {
2620
2669
  className: "scene-outlet-bar",
2621
- children: /* @__PURE__ */ F("button", {
2670
+ children: /* @__PURE__ */ R("button", {
2622
2671
  type: "button",
2623
2672
  className: "scene-outlet-close",
2624
2673
  "aria-label": "Close",
2625
2674
  onClick: () => n?.closeOutlet(t),
2626
2675
  children: "Close"
2627
2676
  })
2628
- }), s && r && /* @__PURE__ */ F(Yn, {
2677
+ }), s && r && /* @__PURE__ */ R(Zn, {
2629
2678
  element: s,
2630
- children: /* @__PURE__ */ F(ae, {
2679
+ children: /* @__PURE__ */ R(k, {
2631
2680
  element: s,
2632
2681
  registry: r.registry,
2633
2682
  resolveBinding: a.resolveBinding
@@ -2635,16 +2684,16 @@ function Ea({ element: e }) {
2635
2684
  })]
2636
2685
  });
2637
2686
  }
2638
- function Da() {
2639
- let { activity: e } = i(va);
2640
- return e ? /* @__PURE__ */ F("p", {
2687
+ function Na() {
2688
+ let { activity: e } = i(wa);
2689
+ return e ? /* @__PURE__ */ R("p", {
2641
2690
  className: "stage-activity",
2642
2691
  role: "status",
2643
2692
  children: e
2644
2693
  }) : null;
2645
2694
  }
2646
- function Oa() {
2647
- let e = ye(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
2695
+ function Pa() {
2696
+ let e = ge(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
2648
2697
  return a(() => {
2649
2698
  let r = e?.isDark ? "dark" : "light";
2650
2699
  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 ?? "";
@@ -2654,40 +2703,40 @@ function Oa() {
2654
2703
  n
2655
2704
  ]), null;
2656
2705
  }
2657
- var ka = {
2658
- [na]: xa,
2659
- [ra]: Sa,
2660
- [pa]: Ca,
2661
- [ba]: Da,
2662
- "core:outlet": Ea
2663
- }, Aa = [
2706
+ var Fa = {
2707
+ [ca]: Da,
2708
+ [la]: Oa,
2709
+ [ya]: ka,
2710
+ [Ea]: Na,
2711
+ "core:outlet": Ma
2712
+ }, Ia = [
2664
2713
  "navigationMode",
2665
2714
  "menuTheme",
2666
2715
  "showFooter"
2667
- ], ja = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
2668
- function Ma(e, t, n = !1) {
2716
+ ], La = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
2717
+ function Ra(e, t, n = !1) {
2669
2718
  let r = [], i = t.options ?? {}, a = {
2670
2719
  showFooter: !0,
2671
2720
  followsSystem: !1,
2672
2721
  problems: r
2673
2722
  };
2674
- for (let [e, n] of Object.entries(i)) if (!Aa.includes(e)) r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${Aa.join(", ")}.`);
2723
+ for (let [e, n] of Object.entries(i)) if (!Ia.includes(e)) r.push(`The shell '${t.name}' has no option '${e}'; the options it understands are ${Ia.join(", ")}.`);
2675
2724
  else if (e === "navigationMode") {
2676
- let e = ke.find((e) => e === n);
2677
- e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${ke.join(", ")}.`);
2725
+ let e = Ee.find((e) => e === n);
2726
+ e ? a.mode = e : r.push(`Option 'navigationMode' is '${String(n)}'; expected one of ${Ee.join(", ")}.`);
2678
2727
  } else if (e === "menuTheme") {
2679
- let e = Ae.find((e) => e === n);
2680
- e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${Ae.join(", ")}.`);
2728
+ let e = De.find((e) => e === n);
2729
+ e ? a.menuTheme = e : r.push(`Option 'menuTheme' is '${String(n)}'; expected one of ${De.join(", ")}.`);
2681
2730
  } else typeof n == "boolean" ? a.showFooter = n : r.push(`Option 'showFooter' is '${String(n)}'; expected true or false.`);
2682
2731
  let o = e?.appearance;
2683
2732
  if (o?.colorScheme !== void 0) {
2684
2733
  a.followsSystem = o.colorScheme === u.System;
2685
2734
  let e = a.followsSystem ? n : o.colorScheme === u.Dark;
2686
- a.colorScheme = e ? A.Dark : A.Light, a.themeName = N.find((t) => (t.isDark ?? !1) === e)?.name;
2735
+ a.colorScheme = e ? N.Dark : N.Light, a.themeName = I.find((t) => (t.isDark ?? !1) === e)?.name;
2687
2736
  }
2688
- return o?.accent !== void 0 && (ja.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
2737
+ return o?.accent !== void 0 && (La.test(o.accent) ? a.accent = o.accent : r.push(`The accent '${o.accent}' is not a colour written as #rgb or #rrggbb.`)), a;
2689
2738
  }
2690
- function Na(e, t) {
2739
+ function za(e, t) {
2691
2740
  if (e?.root === void 0) return [];
2692
2741
  let n = /* @__PURE__ */ new Set([
2693
2742
  v.RootTemplateUnknown,
@@ -2699,7 +2748,7 @@ function Na(e, t) {
2699
2748
  ]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
2700
2749
  return r.length === 0 && t.origin !== y.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;
2701
2750
  }
2702
- function Pa(e) {
2751
+ function Ba(e) {
2703
2752
  let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
2704
2753
  0,
2705
2754
  2,
@@ -2707,7 +2756,7 @@ function Pa(e) {
2707
2756
  ].map((e) => parseInt(t.slice(e, e + 2), 16));
2708
2757
  return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
2709
2758
  }
2710
- function Fa(e, t) {
2759
+ function Va(e, t) {
2711
2760
  if (t === void 0) return e;
2712
2761
  let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
2713
2762
  0,
@@ -2719,25 +2768,25 @@ function Fa(e, t) {
2719
2768
  tokens: {
2720
2769
  ...e.tokens,
2721
2770
  "primary.color": t,
2722
- "primary.contrastColor": Pa(t),
2771
+ "primary.contrastColor": Ba(t),
2723
2772
  "focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
2724
2773
  }
2725
2774
  }));
2726
2775
  }
2727
2776
  // src/StageShellSettings.tsx
2728
- var Ia = "(prefers-color-scheme: dark)";
2729
- function La() {
2777
+ var Ha = "(prefers-color-scheme: dark)";
2778
+ function Ua() {
2730
2779
  return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
2731
2780
  }
2732
- function Ra({ settings: e, onSystemSchemeChange: t }) {
2733
- let n = c(Pe());
2734
- n.current = Pe();
2781
+ function Wa({ settings: e, onSystemSchemeChange: t }) {
2782
+ let n = c(je());
2783
+ n.current = je();
2735
2784
  let { mode: r, menuTheme: i, colorScheme: o, themeName: s } = e;
2736
2785
  return a(() => {
2737
2786
  let { setMode: e, setMenuTheme: t, setColorScheme: a, setThemeName: c } = n.current;
2738
2787
  r !== void 0 && e(r), i !== void 0 && t(i);
2739
- let l = N.find((e) => e.name === Vi());
2740
- l ? (c(l.name), a(l.isDark ? A.Dark : A.Light)) : (o !== void 0 && a(o), s !== void 0 && c(s));
2788
+ let l = I.find((e) => e.name === qi());
2789
+ l ? (c(l.name), a(l.isDark ? N.Dark : N.Light)) : (o !== void 0 && a(o), s !== void 0 && c(s));
2741
2790
  }, [
2742
2791
  r,
2743
2792
  i,
@@ -2745,15 +2794,15 @@ function Ra({ settings: e, onSystemSchemeChange: t }) {
2745
2794
  s
2746
2795
  ]), a(() => {
2747
2796
  if (!e.followsSystem || !globalThis.matchMedia || !t) return;
2748
- let n = globalThis.matchMedia(Ia), r = (e) => t(e.matches);
2797
+ let n = globalThis.matchMedia(Ha), r = (e) => t(e.matches);
2749
2798
  return n.addEventListener("change", r), () => n.removeEventListener("change", r);
2750
2799
  }, [e.followsSystem, t]), null;
2751
2800
  }
2752
2801
  // src/stageNavigationModel.ts
2753
- function za(e) {
2802
+ function Ga(e) {
2754
2803
  return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
2755
2804
  }
2756
- function Ba(e) {
2805
+ function Ka(e) {
2757
2806
  let t = /* @__PURE__ */ new Map();
2758
2807
  for (let n of e) {
2759
2808
  let e = (n.path ?? []).join(".");
@@ -2766,41 +2815,41 @@ function Ba(e) {
2766
2815
  return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
2767
2816
  };
2768
2817
  }
2769
- function Va(e) {
2818
+ function qa(e) {
2770
2819
  return (t) => e.find((e) => e.name === t)?.path?.[0];
2771
2820
  }
2772
- function Ha(e, t, n) {
2821
+ function Ja(e, t, n) {
2773
2822
  let r = e.navigation ?? {
2774
2823
  application: { regions: [] },
2775
2824
  modules: []
2776
2825
  };
2777
2826
  return {
2778
2827
  structure: e.structure ?? { modules: [] },
2779
- navigation: n ? Ua(r, n) : r,
2780
- screenFor: Ba(e.screens),
2781
- moduleOf: Va(e.screens),
2828
+ navigation: n ? Ya(r, n) : r,
2829
+ screenFor: Ka(e.screens),
2830
+ moduleOf: qa(e.screens),
2782
2831
  ...t ? { isVisible: t } : {}
2783
2832
  };
2784
2833
  }
2785
- function Ua(e, t) {
2786
- return typeof e == "string" ? ee(e, t) : Array.isArray(e) ? e.map((e) => Ua(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, Ua(n, t)])) : e;
2834
+ function Ya(e, t) {
2835
+ return typeof e == "string" ? T(e, t) : Array.isArray(e) ? e.map((e) => Ya(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, Ya(n, t)])) : e;
2787
2836
  }
2788
2837
  // src/stageSlices.ts
2789
- function Wa(e) {
2790
- return (t) => U(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
2838
+ function Xa(e) {
2839
+ return (t) => K(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
2791
2840
  name: e.name,
2792
2841
  type: e.type === "text" || e.type === void 0 ? "string" : e.type,
2793
- label: Ga(e.name),
2842
+ label: Za(e.name),
2794
2843
  required: e.required
2795
2844
  }));
2796
2845
  }
2797
- function Ga(e) {
2846
+ function Za(e) {
2798
2847
  return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
2799
2848
  }
2800
- function Ka(e, t, n) {
2849
+ function Qa(e, t, n) {
2801
2850
  return { invoke: async (r, i, a) => {
2802
2851
  let o = a ?? r.slice(r.lastIndexOf(".") + 1);
2803
- if (!G(o)) return {
2852
+ if (!J(o)) return {
2804
2853
  succeeded: !1,
2805
2854
  message: t ? `The modeled command “${o}” is not registered by this Stage.` : `The modeled command “${o}” is waiting for Stage routes.`
2806
2855
  };
@@ -2817,7 +2866,7 @@ function Ka(e, t, n) {
2817
2866
  } };
2818
2867
  }
2819
2868
  // src/withoutSeededSlots.ts
2820
- function qa(e, t) {
2869
+ function $a(e, t) {
2821
2870
  let n = /* @__PURE__ */ new Map();
2822
2871
  for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
2823
2872
  return e.map((e) => {
@@ -2834,7 +2883,7 @@ function qa(e, t) {
2834
2883
  });
2835
2884
  }
2836
2885
  // src/stageIcons.ts
2837
- var Ja = /* @__PURE__ */ new Map([
2886
+ var eo = /* @__PURE__ */ new Map([
2838
2887
  ["chart", "chart-column"],
2839
2888
  ["add", "plus"],
2840
2889
  ["dollar", "dollar-sign"],
@@ -2842,23 +2891,23 @@ var Ja = /* @__PURE__ */ new Map([
2842
2891
  ["refresh", "refresh-cw"],
2843
2892
  ["invoice", "receipt-text"],
2844
2893
  ["batch", "layers"]
2845
- ]), Ya = (e) => e.trim().replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])([0-9]+)/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), Xa = pe([{
2894
+ ]), to = (e) => e.trim().replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])([0-9]+)/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), no = ue([{
2846
2895
  library: _,
2847
2896
  loadGlyph: async ({ key: e }) => {
2848
- let t = Ya(e), n = Ja.get(t) ?? t;
2849
- if (Object.hasOwn(it, n)) return (await it[n]())?.default;
2897
+ let t = to(e), n = eo.get(t) ?? t;
2898
+ if (Object.hasOwn(tt, n)) return (await tt[n]())?.default;
2850
2899
  }
2851
2900
  }]);
2852
2901
  // src/App.tsx
2853
- function Za(e = {}) {
2854
- return da({
2902
+ function ro(e = {}) {
2903
+ return _a({
2855
2904
  ...e,
2856
- ...Di,
2857
- ...ka
2905
+ ...Ni,
2906
+ ...Fa
2858
2907
  });
2859
2908
  }
2860
- function Qa(e, t) {
2861
- return P(`form-${e}-${t.name}`, li, {
2909
+ function io(e, t) {
2910
+ return L(`form-${e}-${t.name}`, pi, {
2862
2911
  command: t.forCommand,
2863
2912
  label: t.name,
2864
2913
  generationMode: t.generationMode,
@@ -2866,36 +2915,36 @@ function Qa(e, t) {
2866
2915
  fields: t.fields
2867
2916
  });
2868
2917
  }
2869
- function $a(e, t) {
2918
+ function ao(e, t) {
2870
2919
  let n = e.screens[0];
2871
- return De(e, n, {
2872
- profile: la(e.uiProfiles),
2873
- blueprintTemplates: t?.length ? [...Oe, ...t] : Oe
2920
+ return we(e, n, {
2921
+ profile: ha(e.uiProfiles),
2922
+ blueprintTemplates: t?.length ? [...Te, ...t] : Te
2874
2923
  });
2875
2924
  }
2876
- function eo(e, t, n, r, i, a, o = !0) {
2877
- let s = za(e.navigation), c = to(e);
2925
+ function oo(e, t, n, r, i, a, o = !0) {
2926
+ let s = Ga(e.navigation), c = so(e);
2878
2927
  return {
2879
- profile: la(e.uiProfiles),
2880
- catalog: fa(r),
2881
- blueprintTemplates: a?.length ? [...Oe, ...a] : Oe,
2928
+ profile: ha(e.uiProfiles),
2929
+ catalog: va(r),
2930
+ blueprintTemplates: a?.length ? [...Te, ...a] : Te,
2882
2931
  namedTemplateOnly: !0,
2883
- chrome: (r, i) => i === j.FullPageShell ? { [M.ConfigPanel]: ha(e.screens, r.name, t, n, c, s, o)[M.ConfigPanel] } : ha(e.screens, r.name, t, n, c, s, o),
2884
- form: Qa,
2885
- trailing: [P("activity", ba)],
2932
+ chrome: (r, i) => i === P.FullPageShell ? { [F.ConfigPanel]: xa(e.screens, r.name, t, n, c, s, o)[F.ConfigPanel] } : xa(e.screens, r.name, t, n, c, s, o),
2933
+ form: io,
2934
+ trailing: [L("activity", Ea)],
2886
2935
  decorate: (e) => {
2887
- let t = Ai(e);
2936
+ let t = Ii(e);
2888
2937
  return i ? w(t, i) : t;
2889
2938
  }
2890
2939
  };
2891
2940
  }
2892
- function to(e) {
2941
+ function so(e) {
2893
2942
  let t = e.navigation?.application.logo;
2894
2943
  if (t) return {
2895
2944
  title: t.title,
2896
2945
  image: t.image || void 0
2897
2946
  };
2898
- let n = la(e.uiProfiles).identity;
2947
+ let n = ha(e.uiProfiles).identity;
2899
2948
  if (!n?.name) return;
2900
2949
  let r = n.logo;
2901
2950
  return {
@@ -2905,22 +2954,22 @@ function to(e) {
2905
2954
  showName: n.showName
2906
2955
  };
2907
2956
  }
2908
- function no(e, t, n, r, i, a) {
2909
- let [o] = Kr([t], ro(e));
2910
- return we(e, o, eo(e, n, r, i, void 0, a)).element;
2957
+ function co(e, t, n, r, i, a) {
2958
+ let [o] = Xr([t], lo(e));
2959
+ return xe(e, o, oo(e, n, r, i, void 0, a)).element;
2911
2960
  }
2912
- function ro(e) {
2961
+ function lo(e) {
2913
2962
  return [...e.screenTemplates ?? [], ...e.dialogTemplates ?? []];
2914
2963
  }
2915
- function io() {
2964
+ function uo() {
2916
2965
  try {
2917
2966
  return globalThis.localStorage ?? null;
2918
2967
  } catch {
2919
2968
  return null;
2920
2969
  }
2921
2970
  }
2922
- function ao({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: o = "hash" } = {}) {
2923
- let c = lt(), [u, d] = l(), [f, p] = l(""), m = s(() => Za(e), [e, u]), h = ut(), g = Oi();
2971
+ function fo({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: o = "hash" } = {}) {
2972
+ let c = ot(), [u, d] = l(), [f, p] = l(""), m = s(() => ro(e), [e, u]), h = st(), g = Pi();
2924
2973
  return a(() => {
2925
2974
  let e = new AbortController();
2926
2975
  return c.scene(e.signal).then((e) => d(r?.length ? {
@@ -2929,10 +2978,10 @@ function ao({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
2929
2978
  } : e)).catch((t) => {
2930
2979
  e.signal.aborted || p(t instanceof Error ? t.message : String(t));
2931
2980
  }), () => e.abort();
2932
- }, [c, r]), f ? /* @__PURE__ */ I("main", {
2981
+ }, [c, r]), f ? /* @__PURE__ */ z("main", {
2933
2982
  className: "stage-message",
2934
- children: [/* @__PURE__ */ F("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ F("p", { children: f })]
2935
- }) : u ? /* @__PURE__ */ F(oo, {
2983
+ children: [/* @__PURE__ */ R("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ R("p", { children: f })]
2984
+ }) : u ? /* @__PURE__ */ R(po, {
2936
2985
  scene: u,
2937
2986
  registry: m,
2938
2987
  routing: o,
@@ -2941,25 +2990,25 @@ function ao({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
2941
2990
  packageCatalog: t,
2942
2991
  screenTemplates: n,
2943
2992
  isVisible: i
2944
- }) : /* @__PURE__ */ F("main", {
2993
+ }) : /* @__PURE__ */ R("main", {
2945
2994
  className: "stage-message",
2946
- children: /* @__PURE__ */ F("h1", { children: "Preparing the Stage" })
2995
+ children: /* @__PURE__ */ R("h1", { children: "Preparing the Stage" })
2947
2996
  });
2948
2997
  }
2949
- function oo({ scene: e, registry: t, routing: n, routeState: i, strings: a, packageCatalog: o, screenTemplates: c, isVisible: u }) {
2998
+ function po({ scene: e, registry: t, routing: n, routeState: i, strings: a, packageCatalog: o, screenTemplates: c, isVisible: u }) {
2950
2999
  let d = s(() => {
2951
- if (In(n), n === "hash") return k();
3000
+ if (Rn(n), n === "hash") return M();
2952
3001
  let e = /^#\/(.+)$/.exec(globalThis.location.hash);
2953
- return e && globalThis.history.replaceState(null, "", `/${e[1]}`), fe(window, "/");
2954
- }, [n]), [f, p] = l(La), m = e.screens[0]?.name ?? "", h = s(() => la(e.uiProfiles), [e]), g = s(() => m ? $a(e, c) : void 0, [
3002
+ return e && globalThis.history.replaceState(null, "", `/${e[1]}`), le(window, "/");
3003
+ }, [n]), [f, p] = l(Ua), m = e.screens[0]?.name ?? "", h = s(() => ha(e.uiProfiles), [e]), g = s(() => m ? ao(e, c) : void 0, [
2955
3004
  e,
2956
3005
  c,
2957
3006
  m
2958
- ]), _ = s(() => g ? Na(h, g) : [], [h, g]), v = s(() => g ? Ma(h, g, f) : void 0, [
3007
+ ]), _ = s(() => g ? za(h, g) : [], [h, g]), v = s(() => g ? Ra(h, g, f) : void 0, [
2959
3008
  h,
2960
3009
  g,
2961
3010
  f
2962
- ]), y = s(() => Fa(N, v?.accent), [v?.accent]), b = v?.showFooter ?? !0, x = s(() => eo(e, a.locales, a.locale, o, a.dictionary, c, b), [
3011
+ ]), y = s(() => Va(I, v?.accent), [v?.accent]), b = v?.showFooter ?? !0, x = s(() => oo(e, a.locales, a.locale, o, a.dictionary, c, b), [
2963
3012
  e,
2964
3013
  a.locales,
2965
3014
  a.locale,
@@ -2967,37 +3016,37 @@ function oo({ scene: e, registry: t, routing: n, routeState: i, strings: a, pack
2967
3016
  o,
2968
3017
  c,
2969
3018
  b
2970
- ]), S = r((e) => p(e), []), C = s(() => Ha(e, u, a.dictionary), [
3019
+ ]), S = r((e) => p(e), []), C = s(() => Ja(e, u, a.dictionary), [
2971
3020
  e,
2972
3021
  u,
2973
3022
  a.dictionary
2974
3023
  ]), w = s(() => ({
2975
3024
  ...e,
2976
- screens: Kr(qa(e.screens, [
3025
+ screens: Xr($a(e.screens, [
2977
3026
  ...e.screenTemplates,
2978
3027
  ...e.dialogTemplates ?? [],
2979
- ...Oe,
3028
+ ...Te,
2980
3029
  ...c ?? []
2981
- ]), ro(e))
3030
+ ]), lo(e))
2982
3031
  }), [e, c]);
2983
- return m ? _.length > 0 ? /* @__PURE__ */ I("main", {
3032
+ return m ? _.length > 0 ? /* @__PURE__ */ z("main", {
2984
3033
  className: "stage-message",
2985
3034
  role: "alert",
2986
3035
  "data-stage-startup-problem": "root-template",
2987
3036
  children: [
2988
- /* @__PURE__ */ F("h1", { children: "Unable to start this Stage" }),
2989
- /* @__PURE__ */ F("p", { children: "The ui profile's root template cannot be the application's shell." }),
2990
- /* @__PURE__ */ F("ul", { children: _.map((e) => /* @__PURE__ */ F("li", { children: e }, e)) })
3037
+ /* @__PURE__ */ R("h1", { children: "Unable to start this Stage" }),
3038
+ /* @__PURE__ */ R("p", { children: "The ui profile's root template cannot be the application's shell." }),
3039
+ /* @__PURE__ */ R("ul", { children: _.map((e) => /* @__PURE__ */ R("li", { children: e }, e)) })
2991
3040
  ]
2992
- }) : /* @__PURE__ */ F(be, {
3041
+ }) : /* @__PURE__ */ R(_e, {
2993
3042
  application: w,
2994
3043
  composition: x,
2995
3044
  navigationModel: C,
2996
3045
  registry: t,
2997
3046
  initialScreen: m,
2998
3047
  history: d,
2999
- layoutConfigStorage: io(),
3000
- scope: (t, n) => /* @__PURE__ */ F(so, {
3048
+ layoutConfigStorage: uo(),
3049
+ scope: (t, n) => /* @__PURE__ */ R(mo, {
3001
3050
  scene: e,
3002
3051
  routeState: i,
3003
3052
  strings: a,
@@ -3007,25 +3056,25 @@ function oo({ scene: e, registry: t, routing: n, routeState: i, strings: a, pack
3007
3056
  onSystemSchemeChange: S,
3008
3057
  children: n
3009
3058
  }),
3010
- renderScreen: (e, n) => /* @__PURE__ */ F(lo, {
3059
+ renderScreen: (e, n) => /* @__PURE__ */ R(go, {
3011
3060
  element: e,
3012
3061
  configuration: n,
3013
3062
  registry: t
3014
3063
  }),
3015
- renderDialog: () => /* @__PURE__ */ F(Si, {}),
3016
- renderDialogTemplate: (e, n, r) => /* @__PURE__ */ F(uo, {
3064
+ renderDialog: () => /* @__PURE__ */ R(Oi, {}),
3065
+ renderDialogTemplate: (e, n, r) => /* @__PURE__ */ R(_o, {
3017
3066
  template: e,
3018
3067
  content: n,
3019
3068
  registry: t,
3020
3069
  strings: a,
3021
3070
  close: () => r.closeDialog()
3022
3071
  })
3023
- }) : /* @__PURE__ */ I("main", {
3072
+ }) : /* @__PURE__ */ z("main", {
3024
3073
  className: "stage-message",
3025
- 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." })]
3074
+ children: [/* @__PURE__ */ R("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ R("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
3026
3075
  });
3027
3076
  }
3028
- function so({ scene: e, routeState: t, strings: n, navigation: r, themes: i, shellSettings: o, onSystemSchemeChange: s, children: c }) {
3077
+ function mo({ scene: e, routeState: t, strings: n, navigation: r, themes: i, shellSettings: o, onSystemSchemeChange: s, children: c }) {
3029
3078
  let [u, f] = l(""), { navigate: p } = r;
3030
3079
  return a(() => f(""), [r.currentScreen, r.currentDialog]), a(() => {
3031
3080
  let e = (e) => {
@@ -3042,24 +3091,24 @@ function so({ scene: e, routeState: t, strings: n, navigation: r, themes: i, she
3042
3091
  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.`));
3043
3092
  };
3044
3093
  return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
3045
- }, [p, e]), /* @__PURE__ */ F(re, {
3046
- registry: Xa,
3047
- children: /* @__PURE__ */ I(Se, {
3094
+ }, [p, e]), /* @__PURE__ */ R(te, {
3095
+ registry: no,
3096
+ children: /* @__PURE__ */ z(ye, {
3048
3097
  themes: i,
3049
3098
  children: [
3050
- o && /* @__PURE__ */ F(Ra, {
3099
+ o && /* @__PURE__ */ R(Wa, {
3051
3100
  settings: o,
3052
3101
  onSystemSchemeChange: s
3053
3102
  }),
3054
- /* @__PURE__ */ F(Oa, {}),
3055
- /* @__PURE__ */ F(Wt, {
3103
+ /* @__PURE__ */ R(Pa, {}),
3104
+ /* @__PURE__ */ R(Ht, {
3056
3105
  routes: t.routes,
3057
3106
  routesReady: t.ready,
3058
3107
  parameters: r.currentParameters,
3059
3108
  locale: n.locale,
3060
3109
  locales: n.locales,
3061
3110
  screen: r.primaryScreen ?? e.screens[0]?.name ?? "",
3062
- children: /* @__PURE__ */ F(co, {
3111
+ children: /* @__PURE__ */ R(ho, {
3063
3112
  activity: u,
3064
3113
  routesReady: t.ready,
3065
3114
  scene: e,
@@ -3072,14 +3121,14 @@ function so({ scene: e, routeState: t, strings: n, navigation: r, themes: i, she
3072
3121
  })
3073
3122
  });
3074
3123
  }
3075
- function co({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
3076
- let o = z(), c = _e(), l = Nn(), u = s(() => Ka(l, t, o.refreshAfterCommand), [
3124
+ function ho({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i, children: a }) {
3125
+ let o = H(), c = me(), l = Fn(), u = s(() => Qa(l, t, o.refreshAfterCommand), [
3077
3126
  l,
3078
3127
  t,
3079
3128
  o.refreshAfterCommand
3080
- ]), f = s(() => Wa(n.commandSchemas), [n.commandSchemas]), p = de({
3129
+ ]), f = s(() => Xa(n.commandSchemas), [n.commandSchemas]), p = ce({
3081
3130
  executeCommand: async (e, n) => {
3082
- let i = G(e);
3131
+ let i = J(e);
3083
3132
  if (!i && !t) return r(`The modeled command “${e}” is waiting for Stage routes.`), {
3084
3133
  isSuccess: !1,
3085
3134
  validationErrors: []
@@ -3096,7 +3145,7 @@ function co({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
3096
3145
  };
3097
3146
  },
3098
3147
  navigate: (e, t) => {
3099
- n.screens.some((t) => t.name === e) ? K(e, Rn(t)) : r(`The modeled screen “${e}” is not available.`);
3148
+ n.screens.some((t) => t.name === e) ? Y(e, Bn(t)) : r(`The modeled screen “${e}” is not available.`);
3100
3149
  },
3101
3150
  navigateBack: () => globalThis.history?.back(),
3102
3151
  openDialog: async (e) => {
@@ -3113,18 +3162,18 @@ function co({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
3113
3162
  refreshQuery: async (e) => o.refreshQuery(e),
3114
3163
  raise: async (e) => r(`The modeled trigger “${e}” is not available in this Stage runtime.`)
3115
3164
  });
3116
- return /* @__PURE__ */ F(ya, {
3165
+ return /* @__PURE__ */ R(Ta, {
3117
3166
  state: {
3118
3167
  locales: i.locales,
3119
3168
  locale: i.locale,
3120
3169
  setLocale: i.setLocale,
3121
3170
  activity: e
3122
3171
  },
3123
- children: /* @__PURE__ */ F(ce, {
3172
+ children: /* @__PURE__ */ R(ae, {
3124
3173
  invoker: u,
3125
- children: /* @__PURE__ */ F(oe, {
3174
+ children: /* @__PURE__ */ R(re, {
3126
3175
  fieldsFor: f,
3127
- children: /* @__PURE__ */ F(ie, {
3176
+ children: /* @__PURE__ */ R(ne, {
3128
3177
  dispatcher: p,
3129
3178
  context: {
3130
3179
  resolve: o.resolveBinding,
@@ -3138,11 +3187,11 @@ function co({ activity: e, routesReady: t, scene: n, setActivity: r, strings: i,
3138
3187
  })
3139
3188
  });
3140
3189
  }
3141
- function lo({ element: e, configuration: t, registry: n }) {
3142
- let r = z(), i = nn();
3143
- return /* @__PURE__ */ I(Yn, {
3190
+ function go({ element: e, configuration: t, registry: n }) {
3191
+ let r = H(), i = an();
3192
+ return /* @__PURE__ */ z(Zn, {
3144
3193
  element: e,
3145
- children: [/* @__PURE__ */ F(Ri, { element: e }), /* @__PURE__ */ F(ae, {
3194
+ children: [/* @__PURE__ */ R(Wi, { element: e }), /* @__PURE__ */ R(k, {
3146
3195
  element: e,
3147
3196
  registry: n,
3148
3197
  resolveBinding: r.resolveBinding,
@@ -3152,27 +3201,27 @@ function lo({ element: e, configuration: t, registry: n }) {
3152
3201
  })]
3153
3202
  });
3154
3203
  }
3155
- function uo({ template: e, content: t, registry: n, strings: r, close: i }) {
3156
- let o = z(), s = nn(), c = w(t, r.dictionary);
3204
+ function _o({ template: e, content: t, registry: n, strings: r, close: i }) {
3205
+ let o = H(), s = an(), c = w(t, r.dictionary);
3157
3206
  return a(() => {
3158
3207
  let e = (e) => {
3159
3208
  e.key === "Escape" && i();
3160
3209
  };
3161
3210
  return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
3162
- }, [i]), /* @__PURE__ */ F("div", {
3211
+ }, [i]), /* @__PURE__ */ R("div", {
3163
3212
  className: "stage-dialog-backdrop",
3164
- children: /* @__PURE__ */ I("section", {
3213
+ children: /* @__PURE__ */ z("section", {
3165
3214
  role: "dialog",
3166
3215
  "aria-modal": "true",
3167
3216
  "aria-label": e.displayName ?? e.name,
3168
3217
  className: "stage-dialog",
3169
- children: [/* @__PURE__ */ F("button", {
3218
+ children: [/* @__PURE__ */ R("button", {
3170
3219
  type: "button",
3171
3220
  onClick: i,
3172
3221
  children: "Close"
3173
- }), /* @__PURE__ */ F(Yn, {
3222
+ }), /* @__PURE__ */ R(Zn, {
3174
3223
  element: c,
3175
- children: /* @__PURE__ */ F(ae, {
3224
+ children: /* @__PURE__ */ R(k, {
3176
3225
  element: c,
3177
3226
  registry: n,
3178
3227
  resolveBinding: o.resolveBinding,
@@ -3183,4 +3232,4 @@ function uo({ template: e, content: t, registry: n, strings: r, close: i }) {
3183
3232
  })
3184
3233
  });
3185
3234
  }
3186
- export { ao as App, ao as StageApplication, $n as StageCommandForm, Wt as StageDataProvider, Hr as StageGuardedAction, ct as StageSourceProvider, no as composeStageScreen, Ka as createStageSliceInvoker, Gt as dataChanged, jn as executeRegisteredCommand, ht as hostedBasePath, sa as listsPrimeReact, St as performQuery, vt as registerQueryRouteResolver, ca as registerStageLibrary, G as registeredCommand, yt as registeredQuery, Wa as sliceFieldsFrom, Za as stageApplicationRegistry, eo as stageComposition, e as stageDarkSelector, ot as stageEndpoints, $a as stageShellOf, at as staticStageSource, Ct as subscribeQuery, Nn as useStageCommandExecutor, z as useStageData, B as useStageQuery, lt as useStageSource };
3235
+ export { fo as App, fo as StageApplication, nr as StageCommandForm, Ht as StageDataProvider, Kr as StageGuardedAction, at as StageSourceProvider, co as composeStageScreen, Qa as createStageSliceInvoker, qt as dataChanged, Nn as executeRegisteredCommand, ft as hostedBasePath, pa as listsPrimeReact, yt as performQuery, ht as registerQueryRouteResolver, ma as registerStageLibrary, J as registeredCommand, gt as registeredQuery, Xa as sliceFieldsFrom, ro as stageApplicationRegistry, oo as stageComposition, e as stageDarkSelector, rt as stageEndpoints, ao as stageShellOf, nt as staticStageSource, bt as subscribeQuery, Fn as useStageCommandExecutor, H as useStageData, U as useStageQuery, ot as useStageSource };