@cratis/stage.runtime 5.6.0 → 5.8.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
@@ -1988,7 +1988,43 @@ function Ta(e) {
1988
1988
  let t = new Date(e);
1989
1989
  return Number.isNaN(t.getTime()) ? void 0 : t.toLocaleString();
1990
1990
  }
1991
- function Ea(e) {
1991
+ // src/commandAvailability.ts
1992
+ var Ea = { unavailable: !1 };
1993
+ function Da(e, n, r) {
1994
+ let i = c(t), [a, o] = m(Ea), s = JSON.stringify(n);
1995
+ return l(() => {
1996
+ if (!e) {
1997
+ o(Ea);
1998
+ return;
1999
+ }
2000
+ let t = !0;
2001
+ return Oa(e, n, i).then((e) => {
2002
+ t && o(e);
2003
+ }), () => {
2004
+ t = !1;
2005
+ };
2006
+ }, [
2007
+ e,
2008
+ s,
2009
+ r,
2010
+ i
2011
+ ]), a;
2012
+ }
2013
+ async function Oa(e, t, n) {
2014
+ try {
2015
+ let r = new e();
2016
+ r.setMicroservice(n.microservice), r.setApiBasePath(qt(n.apiBasePath)), r.setOrigin(n.origin ?? ""), r.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
2017
+ for (let e of r.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(r, e.name, t[e.name]);
2018
+ let i = await r.validate();
2019
+ return i.isAuthorized === !1 ? {
2020
+ unavailable: !0,
2021
+ reason: i.authorizationFailureReason || void 0
2022
+ } : Ea;
2023
+ } catch {
2024
+ return Ea;
2025
+ }
2026
+ }
2027
+ function ka(e) {
1992
2028
  let t = Be(), n = p(void 0), r = f(() => se(ke(e.id, e.behaviors), C.DoubleClick), [e.behaviors, e.id]);
1993
2029
  l(() => () => clearTimeout(n.current), []);
1994
2030
  let i = s((e) => {
@@ -2012,7 +2048,7 @@ function Ea(e) {
2012
2048
  };
2013
2049
  }
2014
2050
  // src/stageSceneRouting.ts
2015
- var Da = {
2051
+ var Aa = {
2016
2052
  routedSlots: {},
2017
2053
  tabSlots: {},
2018
2054
  filters: {},
@@ -2020,7 +2056,7 @@ var Da = {
2020
2056
  segmentScreens: {},
2021
2057
  slotDefaults: {}
2022
2058
  };
2023
- function Oa(e) {
2059
+ function ja(e) {
2024
2060
  let t = [...(e.layouts ?? []).flatMap((e) => e.slots ?? []), ...(e.screenTemplates ?? []).flatMap((e) => e.slots ?? [])], n = {};
2025
2061
  for (let e of t) e.role !== A.Panel && (e.routed || (e.routedBy?.length ?? 0) > 0) && (n[e.name] = e.routedBy ?? []);
2026
2062
  let r = [
@@ -2034,11 +2070,11 @@ function Oa(e) {
2034
2070
  ...(e.outletLevels ?? []).flatMap((e) => [...(e.refinements ?? []).flatMap((e) => e.items ?? []), ...(e.contributions ?? []).flatMap((e) => e.items ?? [])]),
2035
2071
  ...(e.screens ?? []).flatMap((e) => (e.outletContributions ?? []).flatMap((e) => e.items ?? []))
2036
2072
  ], o = {};
2037
- for (let e of ka(a)) e.kind === E.Filter && (o[e.sets?.parameter ?? e.id] = e.sets?.query);
2073
+ for (let e of Ma(a)) e.kind === E.Filter && (o[e.sets?.parameter ?? e.id] = e.sets?.query);
2038
2074
  let s = {}, c = {};
2039
2075
  for (let t of e.screens ?? []) {
2040
2076
  s[pe(t.name)] = t.name;
2041
- for (let e of Object.values(t.slotContent ?? {}).flat().flatMap(Aa)) {
2077
+ for (let e of Object.values(t.slotContent ?? {}).flat().flatMap(Na)) {
2042
2078
  let t = e.properties ?? {};
2043
2079
  e.componentName === "core:slot" && typeof t.shows == "string" && typeof t.name == "string" && (c[t.name] = t.shows);
2044
2080
  }
@@ -2052,19 +2088,19 @@ function Oa(e) {
2052
2088
  slotDefaults: c
2053
2089
  };
2054
2090
  }
2055
- function ka(e) {
2056
- return e.flatMap((e) => e.kind === E.Group ? [e, ...ka(e.items ?? [])] : [e]);
2091
+ function Ma(e) {
2092
+ return e.flatMap((e) => e.kind === E.Group ? [e, ...Ma(e.items ?? [])] : [e]);
2057
2093
  }
2058
- function Aa(e) {
2094
+ function Na(e) {
2059
2095
  let t = e.slots ?? {};
2060
- return [e, ...Object.values(t).flat().flatMap(Aa)];
2096
+ return [e, ...Object.values(t).flat().flatMap(Na)];
2061
2097
  }
2062
- var ja = "@";
2063
- function Ma(e, t) {
2064
- let n = e.indexOf("?"), r = n < 0 ? e : e.slice(0, n), i = n < 0 ? "" : e.slice(n + 1), a = r.split("/").filter((e) => e.length > 0), o = a.findIndex((e) => e.startsWith(ja)), s = (o < 0 ? a : a.slice(0, o)).join("/"), c = {}, l = {};
2098
+ var Pa = "@";
2099
+ function Fa(e, t) {
2100
+ let n = e.indexOf("?"), r = n < 0 ? e : e.slice(0, n), i = n < 0 ? "" : e.slice(n + 1), a = r.split("/").filter((e) => e.length > 0), o = a.findIndex((e) => e.startsWith(Pa)), s = (o < 0 ? a : a.slice(0, o)).join("/"), c = {}, l = {};
2065
2101
  for (let e = o; e >= 0 && e < a.length;) {
2066
2102
  let n = e + 1;
2067
- for (; n < a.length && !a[n].startsWith(ja);) n++;
2103
+ for (; n < a.length && !a[n].startsWith(Pa);) n++;
2068
2104
  let r = decodeURIComponent(a[e].slice(1)), i = a.slice(e + 1, n).join("/"), o = r.indexOf(".");
2069
2105
  if (o > 0) i && (l[r.slice(o + 1)] = decodeURIComponent(i));
2070
2106
  else if (t.routedSlots[r]) {
@@ -2088,14 +2124,14 @@ function Ma(e, t) {
2088
2124
  }
2089
2125
  };
2090
2126
  }
2091
- function Na(e, t, n) {
2092
- let r = e ?? "", i = r.indexOf("?"), a = i < 0 ? r : r.slice(0, i), o = i < 0 ? "" : r.slice(i + 1), s = a.split("/").filter((e) => e.length > 0).map(Pa);
2127
+ function Ia(e, t, n) {
2128
+ let r = e ?? "", i = r.indexOf("?"), a = i < 0 ? r : r.slice(0, i), o = i < 0 ? "" : r.slice(i + 1), s = a.split("/").filter((e) => e.length > 0).map(La);
2093
2129
  for (let [e, r] of Object.entries(n.routedSlots)) {
2094
2130
  let i = t.slots[e];
2095
- i && s.push(`${ja}${encodeURIComponent(e)}`, ...Re(i, r).split("/").filter((e) => e.length > 0).map(Pa));
2131
+ i && s.push(`${Pa}${encodeURIComponent(e)}`, ...Re(i, r).split("/").filter((e) => e.length > 0).map(La));
2096
2132
  for (let [r, i] of Object.entries(n.tabSlots)) {
2097
2133
  let n = t.tabs[r];
2098
- i === e && n && s.push(`${ja}${encodeURIComponent(e)}.${encodeURIComponent(r)}`, Pa(encodeURIComponent(n)));
2134
+ i === e && n && s.push(`${Pa}${encodeURIComponent(e)}.${encodeURIComponent(r)}`, La(encodeURIComponent(n)));
2099
2135
  }
2100
2136
  }
2101
2137
  let c = new URLSearchParams(o);
@@ -2103,20 +2139,20 @@ function Na(e, t, n) {
2103
2139
  let l = c.toString();
2104
2140
  return l ? `${s.join("/")}?${l}` : s.join("/");
2105
2141
  }
2106
- function Pa(e) {
2107
- return e.startsWith(ja) ? `%40${e.slice(1)}` : e;
2142
+ function La(e) {
2143
+ return e.startsWith(Pa) ? `%40${e.slice(1)}` : e;
2108
2144
  }
2109
- var Fa = "sceneNavigation";
2110
- function Ia(e, t, n) {
2111
- let r = () => t === "hash" ? e.location.hash.replace(/^#\/?/, "") : `${e.location.pathname}${e.location.search}`.replace(/^\//, ""), i = (n) => t === "hash" ? `${e.location.pathname}${e.location.search}#/${n}` : `/${n}`, a = () => e.history.state?.[Fa], o = (e) => e === void 0 ? void 0 : Ma(e, n).scene, s = Ma(r(), n).route, c, l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = () => l.forEach((e) => e()), f = (t, r, a) => {
2112
- let o = a ? { [Fa]: a } : e.history.state, c = i(Na(r, s, n));
2145
+ var Ra = "sceneNavigation";
2146
+ function za(e, t, n) {
2147
+ let r = () => t === "hash" ? e.location.hash.replace(/^#\/?/, "") : `${e.location.pathname}${e.location.search}`.replace(/^\//, ""), i = (n) => t === "hash" ? `${e.location.pathname}${e.location.search}#/${n}` : `/${n}`, a = () => e.history.state?.[Ra], o = (e) => e === void 0 ? void 0 : Fa(e, n).scene, s = Fa(r(), n).route, c, l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = () => l.forEach((e) => e()), f = (t, r, a) => {
2148
+ let o = a ? { [Ra]: a } : e.history.state, c = i(Ia(r, s, n));
2113
2149
  t === "push" ? e.history.pushState(o, "", c) : e.history.replaceState(o, "", c);
2114
2150
  }, p = (e, t) => {
2115
2151
  e !== s && (s = e, d(), t && f(t, o(r())));
2116
2152
  }, m = () => {
2117
2153
  c = void 0;
2118
- let e = Ma(r(), n), t = La(s, e.route, n);
2119
- Ra(t, s) || (s = t, d()), u.forEach((t) => t(e.scene, a()));
2154
+ let e = Fa(r(), n), t = Ba(s, e.route, n);
2155
+ Va(t, s) || (s = t, d()), u.forEach((t) => t(e.scene, a()));
2120
2156
  }, h = !1, g = () => {
2121
2157
  h || (h = !0, e.addEventListener("popstate", m), t === "hash" && e.addEventListener("hashchange", m));
2122
2158
  }, _ = () => {
@@ -2151,7 +2187,7 @@ function Ia(e, t, n) {
2151
2187
  }
2152
2188
  };
2153
2189
  }
2154
- function La(e, t, n) {
2190
+ function Ba(e, t, n) {
2155
2191
  let r = Object.fromEntries(Object.entries(e.slots).filter(([e]) => !n.routedSlots[e])), i = Object.fromEntries(Object.entries(e.tabs).filter(([e]) => !n.tabSlots[e]));
2156
2192
  return {
2157
2193
  slots: {
@@ -2165,10 +2201,10 @@ function La(e, t, n) {
2165
2201
  query: n.pageRouted ? t.query : e.query
2166
2202
  };
2167
2203
  }
2168
- function Ra(e, t) {
2204
+ function Va(e, t) {
2169
2205
  return JSON.stringify(e) === JSON.stringify(t);
2170
2206
  }
2171
- function za(e) {
2207
+ function Ha(e) {
2172
2208
  let t = h(e.subscribe, e.getState, e.getState);
2173
2209
  return f(() => ({
2174
2210
  state: t,
@@ -2178,21 +2214,21 @@ function za(e) {
2178
2214
  setQueryParameter: e.setQueryParameter
2179
2215
  }), [e, t]);
2180
2216
  }
2181
- var Ba = a(Da);
2182
- function Va(e, t, n) {
2217
+ var Ua = a(Aa);
2218
+ function Wa(e, t, n) {
2183
2219
  return Object.fromEntries(Object.entries(t).filter(([t, r]) => r !== "" && t in e.filters && (e.filters[t] === void 0 || e.filters[t] === n)));
2184
2220
  }
2185
- function Ha(e) {
2186
- let t = c(Ba), n = Ge(), r = JSON.stringify(Va(t, n, e));
2221
+ function Ga(e) {
2222
+ let t = c(Ua), n = Ge(), r = JSON.stringify(Wa(t, n, e));
2187
2223
  return f(() => JSON.parse(r), [r]);
2188
2224
  }
2189
2225
  // src/stageDialogScreens.ts
2190
- var Ua = "Stage:confirmDialog", Wa = "ConfirmDialog";
2191
- function Ga(e, t) {
2226
+ var Ka = "Stage:confirmDialog", qa = "ConfirmDialog";
2227
+ function Ja(e, t) {
2192
2228
  let n = new Set(t.map((e) => e.name));
2193
2229
  return e.map((t) => {
2194
- if (t.screenTemplate !== Wa || n.has(Wa)) return t;
2195
- let r = Ka(t), i = e.find((e) => e.name !== t.name)?.name, a = R(`confirm-dialog-${t.name}`, Ua, {
2230
+ if (t.screenTemplate !== qa || n.has(qa)) return t;
2231
+ let r = Ya(t), i = e.find((e) => e.name !== t.name)?.name, a = R(`confirm-dialog-${t.name}`, Ka, {
2196
2232
  title: t.name,
2197
2233
  decisions: r,
2198
2234
  home: i
@@ -2205,38 +2241,38 @@ function Ga(e, t) {
2205
2241
  };
2206
2242
  });
2207
2243
  }
2208
- function Ka(e) {
2244
+ function Ya(e) {
2209
2245
  let t = [];
2210
- for (let n of qa(Object.values(e.slotContent).flat())) {
2211
- let r = Ja(n.properties.command);
2246
+ for (let n of Xa(Object.values(e.slotContent).flat())) {
2247
+ let r = Za(n.properties.command);
2212
2248
  r && !t.some((e) => e.command === r) && t.push({
2213
2249
  command: r,
2214
- label: Ja(n.properties.label),
2215
- navigateToScreen: Ja(n.properties.navigateToScreen),
2216
- typeName: Ja(n.properties.typeName),
2217
- route: Ja(n.properties.route),
2250
+ label: Za(n.properties.label),
2251
+ navigateToScreen: Za(n.properties.navigateToScreen),
2252
+ typeName: Za(n.properties.typeName),
2253
+ route: Za(n.properties.route),
2218
2254
  form: e.forms.find((e) => e.forCommand === r)
2219
2255
  });
2220
2256
  }
2221
2257
  return t;
2222
2258
  }
2223
- function qa(e) {
2259
+ function Xa(e) {
2224
2260
  return e.flatMap((e) => {
2225
2261
  let t = e;
2226
- return t.componentName === "core:action" ? [t] : qa(Object.values(t.slots ?? {}).flat());
2262
+ return t.componentName === "core:action" ? [t] : Xa(Object.values(t.slots ?? {}).flat());
2227
2263
  });
2228
2264
  }
2229
- function Ja(e) {
2265
+ function Za(e) {
2230
2266
  return typeof e == "string" && e !== "" ? e : void 0;
2231
2267
  }
2232
2268
  // src/StageConfirmDialog.tsx
2233
- function Ya({ element: e }) {
2269
+ function Qa({ element: e }) {
2234
2270
  let { routes: t, parameters: n, queries: r, selections: i } = W(), [a, o] = m(), s = p(null), c = typeof e.properties.title == "string" ? e.properties.title : "", u = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], d = typeof e.properties.home == "string" ? e.properties.home : void 0, f = u.find((e) => e.command === a), h = Qi(i, r);
2235
2271
  return l(() => s.current?.focus(), []), /* @__PURE__ */ V("section", {
2236
2272
  className: "scene-slice-dialog stage-confirm-dialog",
2237
2273
  role: "dialog",
2238
2274
  "aria-label": J(c),
2239
- "data-stage-component": Ua,
2275
+ "data-stage-component": Ka,
2240
2276
  children: [
2241
2277
  /* @__PURE__ */ B("header", {
2242
2278
  className: "scene-slice-dialog-header",
@@ -2254,50 +2290,50 @@ function Ya({ element: e }) {
2254
2290
  "data-emphasis": t === 0 ? "primary" : "secondary",
2255
2291
  "aria-pressed": e.command === a,
2256
2292
  onClick: () => o(e.command),
2257
- children: Za(e)
2293
+ children: eo(e)
2258
2294
  }, e.command))
2259
2295
  }),
2260
- f && /* @__PURE__ */ B(mi, { children: /* @__PURE__ */ B(Oi, { element: eo(f, t?.commandSchemas?.[f.command] ?? "", n, h) }, f.command) }),
2296
+ f && /* @__PURE__ */ B(mi, { children: /* @__PURE__ */ B(Oi, { element: ro(f, t?.commandSchemas?.[f.command] ?? "", n, h) }, f.command) }),
2261
2297
  /* @__PURE__ */ B("footer", {
2262
2298
  className: "scene-slice-dialog-footer",
2263
2299
  children: /* @__PURE__ */ B("button", {
2264
2300
  type: "button",
2265
2301
  className: "scene-slice-dialog-cancel stage-confirm-dialog__cancel",
2266
- onClick: () => Xa(u, d),
2302
+ onClick: () => $a(u, d),
2267
2303
  children: "Cancel"
2268
2304
  })
2269
2305
  })
2270
2306
  ]
2271
2307
  });
2272
2308
  }
2273
- function Xa(e, t) {
2309
+ function $a(e, t) {
2274
2310
  let n = new Set(e.map((e) => e.navigateToScreen).filter((e) => !!e)), r = n.size === 1 ? [...n][0] : t;
2275
2311
  r && pn(r, {});
2276
2312
  }
2277
- function Za(e) {
2313
+ function eo(e) {
2278
2314
  return e.label ?? J(e.command);
2279
2315
  }
2280
- function Qa(e, t, n) {
2316
+ function to(e, t, n) {
2281
2317
  return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || qi(e, n) !== void 0;
2282
2318
  }
2283
- function $a(e, t, n, r) {
2319
+ function no(e, t, n, r) {
2284
2320
  let i = e.form?.fields ?? [], a = i.length > 0 ? i : t.filter((e) => !e.unsupportedReason).map((e) => ({
2285
2321
  name: e.name,
2286
2322
  label: e.name
2287
- })), o = new Set(t.filter((e) => Qa(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));
2323
+ })), o = new Set(t.filter((e) => to(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));
2288
2324
  return [...s, ...l.map((e) => ({
2289
2325
  name: e.name,
2290
2326
  label: J(e.name)
2291
2327
  }))];
2292
2328
  }
2293
- function eo(e, t, n, r) {
2294
- let i = $a(e, Y(t), n, r);
2329
+ function ro(e, t, n, r) {
2330
+ let i = no(e, Y(t), n, r);
2295
2331
  return {
2296
2332
  id: `confirm-${e.command}`,
2297
- componentName: Ua,
2333
+ componentName: Ka,
2298
2334
  properties: {
2299
2335
  command: e.command,
2300
- label: Za(e),
2336
+ label: eo(e),
2301
2337
  submitLabel: "Confirm",
2302
2338
  typeName: e.typeName,
2303
2339
  route: e.route,
@@ -2311,13 +2347,13 @@ function eo(e, t, n, r) {
2311
2347
  slots: {}
2312
2348
  };
2313
2349
  }
2314
- function to(e) {
2350
+ function io(e) {
2315
2351
  return typeof e == "object" && !!e && !Array.isArray(e);
2316
2352
  }
2317
- function no(e, t) {
2353
+ function ao(e, t) {
2318
2354
  if (!Array.isArray(e) || !Array.isArray(t)) return;
2319
- let n = new Map(e.filter(to).map((e) => [JSON.stringify(e.id), e.column]));
2320
- for (let e of t.filter(to)) {
2355
+ let n = new Map(e.filter(io).map((e) => [JSON.stringify(e.id), e.column]));
2356
+ for (let e of t.filter(io)) {
2321
2357
  let t = JSON.stringify(e.id);
2322
2358
  if (n.has(t) && n.get(t) !== e.column) return {
2323
2359
  item: {
@@ -2328,9 +2364,9 @@ function no(e, t) {
2328
2364
  };
2329
2365
  }
2330
2366
  }
2331
- function ro(e, t, n, r) {
2367
+ function oo(e, t, n, r) {
2332
2368
  if (!Array.isArray(e)) return;
2333
- let i = e.filter(to).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
2369
+ let i = e.filter(io).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
2334
2370
  if (i !== void 0) return {
2335
2371
  item: {
2336
2372
  ...i,
@@ -2340,11 +2376,11 @@ function ro(e, t, n, r) {
2340
2376
  previous: t.previous
2341
2377
  };
2342
2378
  }
2343
- function io(e, t) {
2379
+ function so(e, t) {
2344
2380
  let n = re({ dataContext: { item: e.item } });
2345
2381
  return (r) => r.path === "value" ? e.value : r.path === "previous" ? e.previous : r.path === "item" || r.path?.startsWith("item.") ? n(r) : t(r);
2346
2382
  }
2347
- function ao(e, t) {
2383
+ function co(e, t) {
2348
2384
  let n = Be(), r = W(), { element: i, rowsProperty: a, idField: o, valueField: c } = e, l = f(() => se(ke(i.id, i.behaviors), C.Change), [i.behaviors, i.id]), u = p(void 0), d = p(!1), [h, g] = m(0), _ = p({
2349
2385
  scope: n,
2350
2386
  data: r,
@@ -2358,14 +2394,14 @@ function ao(e, t) {
2358
2394
  bindings: l
2359
2395
  };
2360
2396
  let v = s((e, t) => {
2361
- let { scope: n, data: r, element: i, bindings: s } = _.current, l = no(e, t);
2397
+ let { scope: n, data: r, element: i, bindings: s } = _.current, l = ao(e, t);
2362
2398
  if (!n || s.length === 0 || l === void 0) return;
2363
- let u = ro(i.properties[a], l, o, c);
2399
+ let u = oo(i.properties[a], l, o, c);
2364
2400
  if (u === void 0) return;
2365
2401
  let d = {
2366
2402
  ...n.context,
2367
2403
  subject: () => u.item,
2368
- resolve: io(u, n.context.resolve)
2404
+ resolve: so(u, n.context.resolve)
2369
2405
  }, f = !1, p = !1;
2370
2406
  vn(s, {
2371
2407
  ...n.dispatcher,
@@ -2397,8 +2433,8 @@ function ao(e, t) {
2397
2433
  revision: h
2398
2434
  };
2399
2435
  }
2400
- function oo(e) {
2401
- let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = ao({
2436
+ function lo(e) {
2437
+ let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = co({
2402
2438
  element: t,
2403
2439
  rowsProperty: "cards",
2404
2440
  idField: typeof t.properties.cardId == "string" ? t.properties.cardId : "id",
@@ -2413,8 +2449,8 @@ function oo(e) {
2413
2449
  bindingOutputs: r.outputs
2414
2450
  }, r.revision) : /* @__PURE__ */ B(i, { ...e });
2415
2451
  }
2416
- var so = Ae(it, I.KanbanBoard), co = "Stage:commandForm";
2417
- function lo(e, t, n = {}) {
2452
+ var uo = Ae(it, I.KanbanBoard), fo = "Stage:commandForm";
2453
+ function po(e, t, n = {}) {
2418
2454
  return {
2419
2455
  id: e,
2420
2456
  componentName: "",
@@ -2426,19 +2462,19 @@ function Q(e, t, n = "") {
2426
2462
  let r = e.properties[t];
2427
2463
  return typeof r == "string" ? r : n;
2428
2464
  }
2429
- function uo(e, t, n) {
2465
+ function mo(e, t, n) {
2430
2466
  let r = typeof e == "number" && Number.isInteger(e) ? n && n.length === t?.length ? t?.[n.indexOf(e)] : t?.[e] : e;
2431
2467
  return typeof r == "string" && t?.includes(r) ? J(r) : xa(e) ?? String(e ?? "");
2432
2468
  }
2433
- function fo(e, t) {
2469
+ function ho(e, t) {
2434
2470
  let n = e.properties.queryArguments;
2435
- if (!vo(n)) return {
2471
+ if (!xo(n)) return {
2436
2472
  values: {},
2437
2473
  ready: !0
2438
2474
  };
2439
2475
  let r = {}, i = !0;
2440
2476
  for (let [e, a] of Object.entries(n)) {
2441
- let n = _o(a) ? t.resolveBinding(a) : a;
2477
+ let n = bo(a) ? t.resolveBinding(a) : a;
2442
2478
  r[e] = n, (n == null || n === "") && (i = !1);
2443
2479
  }
2444
2480
  return {
@@ -2446,7 +2482,7 @@ function fo(e, t) {
2446
2482
  ready: i
2447
2483
  };
2448
2484
  }
2449
- function po(e, t) {
2485
+ function go(e, t) {
2450
2486
  let n = (e.slots.columns ?? []).map((e) => {
2451
2487
  let t = e.properties;
2452
2488
  return {
@@ -2461,12 +2497,12 @@ function po(e, t) {
2461
2497
  }));
2462
2498
  return n.length > 0 ? n : r;
2463
2499
  }
2464
- function mo(e, t) {
2500
+ function _o(e, t) {
2465
2501
  return e[t] ?? e.id ?? e.key;
2466
2502
  }
2467
- function ho({ element: e, slots: t }) {
2468
- let n = W(), r = Q(e, "query", Q(e, "typeName", e.id)), i = (Q(e, "query") ? n.routes?.queries?.[Q(e, "query")] : void 0) ?? Q(e, "route"), a = Ha(Q(e, "query") || void 0), o = f(() => {
2469
- let t = fo(e, n);
2503
+ function vo({ element: e, slots: t }) {
2504
+ let n = W(), r = Q(e, "query", Q(e, "typeName", e.id)), i = (Q(e, "query") ? n.routes?.queries?.[Q(e, "query")] : void 0) ?? Q(e, "route"), a = Ga(Q(e, "query") || void 0), o = f(() => {
2505
+ let t = ho(e, n);
2470
2506
  return {
2471
2507
  ...t,
2472
2508
  values: {
@@ -2484,10 +2520,10 @@ function ho({ element: e, slots: t }) {
2484
2520
  route: i || void 0,
2485
2521
  arguments: o.values,
2486
2522
  ready: o.ready
2487
- }), p = po(e, s), m = Q(e, "navigateOnRowClickToScreen"), h = Q(e, "navigateOnRowClickByParameter"), g = Q(e, "dataKey") || h || "id", _ = n.selections[e.id], v = h ? n.parameters[h] : void 0, y = Ea(e), b = (u || d) && s.length === 0 && !c;
2523
+ }), p = go(e, s), m = Q(e, "navigateOnRowClickToScreen"), h = Q(e, "navigateOnRowClickByParameter"), g = Q(e, "dataKey") || h || "id", _ = n.selections[e.id], v = h ? n.parameters[h] : void 0, y = ka(e), b = (u || d) && s.length === 0 && !c;
2488
2524
  l(() => {
2489
2525
  if (!_) return;
2490
- let t = mo(_, g), r = t === void 0 ? void 0 : s.find((e) => mo(e, g) === t);
2526
+ let t = _o(_, g), r = t === void 0 ? void 0 : s.find((e) => _o(e, g) === t);
2491
2527
  r && r !== _ ? n.selectRow(e.id, r) : !r && t !== void 0 && !u && n.clearSelection(e.id);
2492
2528
  }, [
2493
2529
  n,
@@ -2502,8 +2538,8 @@ function ho({ element: e, slots: t }) {
2502
2538
  _ && n.clearSelection(e.id);
2503
2539
  return;
2504
2540
  }
2505
- if (_ && String(mo(_, g)) === v) return;
2506
- let t = s.find((e) => String(mo(e, g)) === v);
2541
+ if (_ && String(_o(_, g)) === v) return;
2542
+ let t = s.find((e) => String(_o(e, g)) === v);
2507
2543
  t && n.selectRow(e.id, t);
2508
2544
  }, [
2509
2545
  n,
@@ -2515,7 +2551,7 @@ function ho({ element: e, slots: t }) {
2515
2551
  _
2516
2552
  ]);
2517
2553
  let x = (t) => {
2518
- let r = mo(t, g);
2554
+ let r = _o(t, g);
2519
2555
  if (h && r != null) {
2520
2556
  let i = {
2521
2557
  ...m && m !== n.screen ? {} : n.parameters,
@@ -2570,8 +2606,8 @@ function ho({ element: e, slots: t }) {
2570
2606
  onKeyDown: (t) => {
2571
2607
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), x(e));
2572
2608
  },
2573
- children: p.map((t) => /* @__PURE__ */ B("td", { children: uo(e[t.property], t.options, t.optionValues) }, t.property))
2574
- }, String(mo(e, g) ?? t))), /* @__PURE__ */ B(go, {
2609
+ children: p.map((t) => /* @__PURE__ */ B("td", { children: mo(e[t.property], t.options, t.optionValues) }, t.property))
2610
+ }, String(_o(e, g) ?? t))), /* @__PURE__ */ B(yo, {
2575
2611
  rowCount: s.length,
2576
2612
  columnCount: p.length,
2577
2613
  loading: u,
@@ -2581,30 +2617,30 @@ function ho({ element: e, slots: t }) {
2581
2617
  ]
2582
2618
  });
2583
2619
  }
2584
- function go({ rowCount: e, columnCount: t, loading: n, awaitingCommand: r }) {
2620
+ function yo({ rowCount: e, columnCount: t, loading: n, awaitingCommand: r }) {
2585
2621
  return e !== 0 || n || r ? null : /* @__PURE__ */ B("tr", { children: /* @__PURE__ */ B("td", {
2586
2622
  colSpan: Math.max(t, 1),
2587
2623
  children: "No records found"
2588
2624
  }) });
2589
2625
  }
2590
- function _o(e) {
2591
- return vo(e) && (typeof e.path == "string" || typeof e.kind == "string");
2626
+ function bo(e) {
2627
+ return xo(e) && (typeof e.path == "string" || typeof e.kind == "string");
2592
2628
  }
2593
- function vo(e) {
2629
+ function xo(e) {
2594
2630
  return typeof e == "object" && !!e && !Array.isArray(e);
2595
2631
  }
2596
- function yo({ element: e, interactions: t, slots: n }) {
2632
+ function So({ element: e, interactions: t, slots: n }) {
2597
2633
  return Dn(e) ? /* @__PURE__ */ B(On, {
2598
2634
  element: e,
2599
2635
  interactions: t
2600
- }) : /* @__PURE__ */ B(Co, {
2636
+ }) : /* @__PURE__ */ B(Eo, {
2601
2637
  element: e,
2602
2638
  interactions: t,
2603
2639
  slots: n
2604
2640
  });
2605
2641
  }
2606
- function bo(e) {
2607
- let { routes: t, parameters: n } = W(), r = Q(e, "schema") || t?.commandSchemas?.[Q(e, "command")], i = t?.commandSchemas?.[Q(e, "command")], a = f(() => Y(r ?? "", i), [r, i]), o = Hr(e), s = Ur(e, r), { selectableRows: c, selectedRows: l } = hi(), u = Q(e, "generationMode").toLowerCase() !== "manual", d = xo(e, o, s, u), p = u ? So(e, r, a, n, o, s ? [] : c) : {};
2642
+ function Co(e) {
2643
+ let { routes: t, parameters: n } = W(), r = Q(e, "schema") || t?.commandSchemas?.[Q(e, "command")], i = t?.commandSchemas?.[Q(e, "command")], a = f(() => Y(r ?? "", i), [r, i]), o = Hr(e), s = Ur(e, r), { selectableRows: c, selectedRows: l } = hi(), u = Q(e, "generationMode").toLowerCase() !== "manual", d = wo(e, o, s, u), p = u ? To(e, r, a, n, o, s ? [] : c) : {};
2608
2644
  return {
2609
2645
  element: {
2610
2646
  ...e,
@@ -2621,21 +2657,24 @@ function bo(e) {
2621
2657
  selectedRows: l
2622
2658
  };
2623
2659
  }
2624
- function xo(e, t, n, r) {
2660
+ function wo(e, t, n, r) {
2625
2661
  return n || t !== void 0 ? !1 : r || e.properties.rowAction === !0;
2626
2662
  }
2627
- function So(e, t, n, r, i, a) {
2663
+ function To(e, t, n, r, i, a) {
2628
2664
  let o = e.properties.fields;
2629
- if (!Array.isArray(o) || o.length === 0) return Bo(t, n, r, i, a);
2665
+ if (!Array.isArray(o) || o.length === 0) return Uo(t, n, r, i, a);
2630
2666
  if (a.length === 0 || i === "screen" || i === void 0 && e.properties.rowAction !== !0 && n.filter((e) => e.identifier).length > 1) return {};
2631
- let s = new Set(n.filter((e) => Ro(e, i, a)).map((e) => e.name));
2667
+ let s = new Set(n.filter((e) => Vo(e, i, a)).map((e) => e.name));
2632
2668
  return {
2633
- fields: o.filter((e) => !s.has(Eo(e))),
2669
+ fields: o.filter((e) => !s.has(ko(e))),
2634
2670
  generationMode: "manual"
2635
2671
  };
2636
2672
  }
2637
- function Co({ element: e, interactions: t }) {
2638
- let { element: n, subject: r, properties: i, selectedRows: a } = bo(e), o = Q(n, "label") || J(Q(n, "command")), s = on(Q(n, "command"), Q(n, "typeName"), Q(n, "route")), c = wo(n, r), l = Wr(r, a);
2673
+ function Eo({ element: e, interactions: t }) {
2674
+ let { element: n, subject: r, properties: i, selectedRows: a } = Co(e), o = Q(n, "label") || J(Q(n, "command")), s = on(Q(n, "command"), Q(n, "typeName"), Q(n, "route")), c = Do(n, r), l = Wr(r, a), { parameters: u, queryResults: d } = W(), f = l ? Yr(n, i, l).properties.subjectValues : void 0, p = Da(s, {
2675
+ ...u,
2676
+ ...xo(f) ? f : {}
2677
+ }, d);
2639
2678
  return s ? c.length > 0 || Gr(r, l) ? /* @__PURE__ */ B(H, {
2640
2679
  type: "button",
2641
2680
  "data-scene-id": n.id,
@@ -2643,7 +2682,15 @@ function Co({ element: e, interactions: t }) {
2643
2682
  title: "Select a row first",
2644
2683
  ...t,
2645
2684
  children: o
2646
- }) : /* @__PURE__ */ B(Oo, {
2685
+ }) : p.unavailable ? /* @__PURE__ */ B(H, {
2686
+ type: "button",
2687
+ "data-scene-id": n.id,
2688
+ "data-stage-availability": "unavailable",
2689
+ disabled: !0,
2690
+ title: p.reason || "Not available for this data",
2691
+ ...t,
2692
+ children: o
2693
+ }) : /* @__PURE__ */ B(jo, {
2647
2694
  element: l ? Yr(n, i, l) : n,
2648
2695
  label: o
2649
2696
  }) : /* @__PURE__ */ B(H, {
@@ -2655,23 +2702,23 @@ function Co({ element: e, interactions: t }) {
2655
2702
  children: o
2656
2703
  });
2657
2704
  }
2658
- function wo(e, t) {
2659
- let { parameters: n, routes: r } = W(), i = Q(e, "schema"), a = e.properties.fields, o = r?.commandSchemas?.[Q(e, "command")], s = f(() => Y(i, o), [i, o]), { selectableRows: c, selectedRows: l } = hi(), u = Array.isArray(a) ? a : [], d = To(e, u) ? new Set(u.map(Eo).filter((e) => e !== "")) : void 0;
2705
+ function Do(e, t) {
2706
+ let { parameters: n, routes: r } = W(), i = Q(e, "schema"), a = e.properties.fields, o = r?.commandSchemas?.[Q(e, "command")], s = f(() => Y(i, o), [i, o]), { selectableRows: c, selectedRows: l } = hi(), u = Array.isArray(a) ? a : [], d = Oo(e, u) ? new Set(u.map(ko).filter((e) => e !== "")) : void 0;
2660
2707
  return !d || t !== void 0 || Ur(e, i) ? [] : $i(s.filter((e) => !d.has(e.name)), n, l, c);
2661
2708
  }
2662
- function To(e, t) {
2709
+ function Oo(e, t) {
2663
2710
  return t.length > 0 || e.properties.rowAction === !0 || Q(e, "generationMode").toLowerCase() === "manual";
2664
2711
  }
2665
- function Eo(e) {
2666
- return vo(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
2712
+ function ko(e) {
2713
+ return xo(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
2667
2714
  }
2668
- function Do(e) {
2715
+ function Ao(e) {
2669
2716
  let t = (e?.parentElement?.classList.contains("stage-toolbar-action") ? e.parentElement : e)?.previousElementSibling;
2670
2717
  return t?.classList.contains("stage-action") === !0 || t?.classList.contains("stage-toolbar-action") === !0;
2671
2718
  }
2672
- function Oo({ element: e, label: t }) {
2719
+ function jo({ element: e, label: t }) {
2673
2720
  let [n, r] = m(0), [i, a] = m(!1), [o, c] = m(!1), l = p(null);
2674
- d(() => c(Do(l.current)));
2721
+ d(() => c(Ao(l.current)));
2675
2722
  let u = s(() => {
2676
2723
  a(!1), r((e) => e + 1);
2677
2724
  }, []), f = /* @__PURE__ */ B(wi.Provider, {
@@ -2701,20 +2748,20 @@ function Oo({ element: e, label: t }) {
2701
2748
  })]
2702
2749
  });
2703
2750
  }
2704
- function ko(e) {
2705
- let t = e.element ?? lo("slice-dialog", {}), n = Ve(), r = ze(n?.currentDialogParameters);
2751
+ function Mo(e) {
2752
+ let t = e.element ?? po("slice-dialog", {}), n = Ve(), r = ze(n?.currentDialogParameters);
2706
2753
  return /* @__PURE__ */ B(Sr, {
2707
2754
  slice: Q(t, "slice") || r?.slice || Q(t, "command") || r?.command,
2708
- children: /* @__PURE__ */ B(Ao, { ...e })
2755
+ children: /* @__PURE__ */ B(No, { ...e })
2709
2756
  });
2710
2757
  }
2711
- function Ao(e) {
2712
- let t = e.element ?? lo("slice-dialog", {}), n = Ve(), { routes: r, parameters: i } = W(), a = ze(n?.currentDialogParameters), o = Q(t, "command") || a?.command || Q(t, "slice") || "", c = Q(t, "title") || a?.title || J(o), l = r?.commandSchemas?.[o], u = f(() => Y(l ?? ""), [l]), { selectableRows: d, selectedRows: p } = hi(), h = s(() => n?.closeDialog(), [n]), [g, _] = m(null), v = (e) => e.identifier && e.required && Ji(e, d) && qi(e, p) !== void 0;
2758
+ function No(e) {
2759
+ let t = e.element ?? po("slice-dialog", {}), n = Ve(), { routes: r, parameters: i } = W(), a = ze(n?.currentDialogParameters), o = Q(t, "command") || a?.command || Q(t, "slice") || "", c = Q(t, "title") || a?.title || J(o), l = r?.commandSchemas?.[o], u = f(() => Y(l ?? ""), [l]), { selectableRows: d, selectedRows: p } = hi(), h = s(() => n?.closeDialog(), [n]), [g, _] = m(null), v = (e) => e.identifier && e.required && Ji(e, d) && qi(e, p) !== void 0;
2713
2760
  if (!l || !(u.some((e) => e.options || e.members || e.item) || u.some(v))) return e.element ? /* @__PURE__ */ B(_e, {
2714
2761
  element: e.element,
2715
2762
  slots: e.slots ?? {}
2716
2763
  }) : /* @__PURE__ */ B(De, {});
2717
- let y = u.filter((e) => !Gi(e, i) && !v(e)), b = lo(`slice-dialog-${o}`, {
2764
+ let y = u.filter((e) => !Gi(e, i) && !v(e)), b = po(`slice-dialog-${o}`, {
2718
2765
  command: o,
2719
2766
  label: c,
2720
2767
  schema: l,
@@ -2756,8 +2803,8 @@ function Ao(e) {
2756
2803
  ]
2757
2804
  });
2758
2805
  }
2759
- var jo = "core:toolbarItem";
2760
- function Mo({ element: e }) {
2806
+ var Po = "core:toolbarItem";
2807
+ function Fo({ element: e }) {
2761
2808
  let t = {
2762
2809
  kind: "button",
2763
2810
  id: Q(e, "name", e.id),
@@ -2774,19 +2821,19 @@ function Mo({ element: e }) {
2774
2821
  elementId: e.id
2775
2822
  }) : null;
2776
2823
  }
2777
- function No(e) {
2824
+ function Io(e) {
2778
2825
  let { element: t } = e, n = We(), r = f(() => Ie(t.id, t.properties, n), [
2779
2826
  n,
2780
2827
  t.id,
2781
2828
  t.properties
2782
2829
  ]);
2783
- return !r || r.kind !== D.Actions || !r.items.some((e) => Fo(t.id, e.item)) ? /* @__PURE__ */ B(ge, { ...e }) : /* @__PURE__ */ B("div", {
2830
+ return !r || r.kind !== D.Actions || !r.items.some((e) => Ro(t.id, e.item)) ? /* @__PURE__ */ B(ge, { ...e }) : /* @__PURE__ */ B("div", {
2784
2831
  className: "stage-toolbar",
2785
2832
  role: "toolbar",
2786
2833
  "aria-label": r.name,
2787
2834
  "data-scene-id": t.id,
2788
2835
  "data-scene-outlet": r.name,
2789
- children: Po(r.items, (e) => Fo(t.id, e.item)).map((n) => {
2836
+ children: Lo(r.items, (e) => Ro(t.id, e.item)).map((n) => {
2790
2837
  let i = (e) => /* @__PURE__ */ B(be, {
2791
2838
  outlet: {
2792
2839
  ...r,
@@ -2796,7 +2843,7 @@ function No(e) {
2796
2843
  item: t.properties.item,
2797
2844
  elementId: `${t.id}.${e[0].item.id}`
2798
2845
  }, e[0].item.id);
2799
- return n.stage ? /* @__PURE__ */ B(Io, {
2846
+ return n.stage ? /* @__PURE__ */ B(zo, {
2800
2847
  element: n.stage,
2801
2848
  slots: {},
2802
2849
  interactions: e.interactions,
@@ -2805,7 +2852,7 @@ function No(e) {
2805
2852
  })
2806
2853
  });
2807
2854
  }
2808
- function Po(e, t) {
2855
+ function Lo(e, t) {
2809
2856
  let n = [];
2810
2857
  for (let r of e) {
2811
2858
  let e = t(r), i = n.at(-1);
@@ -2816,12 +2863,12 @@ function Po(e, t) {
2816
2863
  }
2817
2864
  return n;
2818
2865
  }
2819
- function Fo(e, t) {
2866
+ function Ro(e, t) {
2820
2867
  if (t.kind !== "button") return;
2821
2868
  let n = t;
2822
2869
  if (!(n.navigateTo || n.builtIn !== void 0 || !n.slice && !n.command) && n.opens !== T.None && n.opens !== T.Drawer && n.opens !== T.Slot) return {
2823
2870
  id: `${e}.${n.id}`,
2824
- componentName: jo,
2871
+ componentName: Po,
2825
2872
  properties: {
2826
2873
  name: n.id,
2827
2874
  kind: "Action",
@@ -2839,13 +2886,13 @@ function Fo(e, t) {
2839
2886
  slots: {}
2840
2887
  };
2841
2888
  }
2842
- function Io(e) {
2889
+ function zo(e) {
2843
2890
  let { element: t } = e;
2844
- return Q(t, "slice") === "" ? /* @__PURE__ */ B(zo, { ...e }) : /* @__PURE__ */ B(Lo, { ...e });
2891
+ return Q(t, "slice") === "" ? /* @__PURE__ */ B(Ho, { ...e }) : /* @__PURE__ */ B(Bo, { ...e });
2845
2892
  }
2846
- function Lo(e) {
2893
+ function Bo(e) {
2847
2894
  let { element: t } = e, { routes: n, parameters: r } = W(), i = Q(t, "slice"), a = Q(t, "command") || i.split(".").at(-1) || "", o = n?.commandSchemas?.[a], s = f(() => Y(o ?? ""), [o]), { selectableRows: c, selectedRows: l } = hi();
2848
- if ((kr(o ?? "") ? [] : $i(s, r, l, c)).length === 0) return /* @__PURE__ */ B(z, { children: e.fallback ?? /* @__PURE__ */ B(Mo, { element: t }) });
2895
+ if ((kr(o ?? "") ? [] : $i(s, r, l, c)).length === 0) return /* @__PURE__ */ B(z, { children: e.fallback ?? /* @__PURE__ */ B(Fo, { element: t }) });
2849
2896
  let u = Q(t, "label", Q(t, "name", t.id));
2850
2897
  return /* @__PURE__ */ B("span", {
2851
2898
  className: "stage-toolbar-action",
@@ -2860,11 +2907,11 @@ function Lo(e) {
2860
2907
  })
2861
2908
  });
2862
2909
  }
2863
- function Ro(e, t, n) {
2910
+ function Vo(e, t, n) {
2864
2911
  return t !== "screen" && !!e.identifier && e.required && Ji(e, n);
2865
2912
  }
2866
- function zo(e) {
2867
- let { element: t } = e, { routes: n, parameters: r } = W(), i = Q(t, "name", t.id), a = Q(t, "target"), o = Q(t, "label", i), s = n?.commandSchemas?.[a], c = f(() => Y(s ?? ""), [s]), l = Hr(t), u = f(() => l === void 0 && kr(s ?? ""), [s, l]), { selectableRows: d, selectedRows: p } = hi(), m = u ? [] : d, h = l === void 0 && !u ? $i(c, r, p, m) : [], g = Bo(s, c, r, l, m), _ = u ? { createsEntity: !0 } : qr(t, l), v = {
2913
+ function Ho(e) {
2914
+ let { element: t } = e, { routes: n, parameters: r } = W(), i = Q(t, "name", t.id), a = Q(t, "target"), o = Q(t, "label", i), s = n?.commandSchemas?.[a], c = f(() => Y(s ?? ""), [s]), l = Hr(t), u = f(() => l === void 0 && kr(s ?? ""), [s, l]), { selectableRows: d, selectedRows: p } = hi(), m = u ? [] : d, h = l === void 0 && !u ? $i(c, r, p, m) : [], g = Uo(s, c, r, l, m), _ = u ? { createsEntity: !0 } : qr(t, l), v = {
2868
2915
  ...t,
2869
2916
  componentName: "core:action",
2870
2917
  properties: {
@@ -2885,37 +2932,37 @@ function zo(e) {
2885
2932
  title: "Select a row first",
2886
2933
  ...e.interactions,
2887
2934
  children: o
2888
- }) : /* @__PURE__ */ B(yo, {
2935
+ }) : /* @__PURE__ */ B(So, {
2889
2936
  element: v,
2890
2937
  interactions: e.interactions,
2891
2938
  slots: e.slots
2892
2939
  })
2893
2940
  });
2894
2941
  }
2895
- function Bo(e, t, n, r, i) {
2942
+ function Uo(e, t, n, r, i) {
2896
2943
  return e ? {
2897
2944
  schema: e,
2898
- fields: t.filter((e) => !Gi(e, n) && !Ro(e, r, i)).map((e) => ({
2945
+ fields: t.filter((e) => !Gi(e, n) && !Vo(e, r, i)).map((e) => ({
2899
2946
  name: e.name,
2900
2947
  label: J(e.name)
2901
2948
  })),
2902
2949
  generationMode: "manual"
2903
2950
  } : {};
2904
2951
  }
2905
- var Vo = {
2952
+ var Wo = {
2906
2953
  ...je,
2907
- "core:table": ho,
2908
- "core:action": yo,
2954
+ "core:table": vo,
2955
+ "core:action": So,
2909
2956
  "core:guarded-action": On,
2910
- "core:outletItems": No,
2911
- [jo]: Io,
2912
- "core:sliceDialog": ko,
2913
- [co]: Oi,
2914
- [Ua]: Ya,
2915
- [so]: oo
2957
+ "core:outletItems": Io,
2958
+ [Po]: zo,
2959
+ "core:sliceDialog": Mo,
2960
+ [fo]: Oi,
2961
+ [Ka]: Qa,
2962
+ [uo]: lo
2916
2963
  };
2917
2964
  // src/useStrings.ts
2918
- function Ho() {
2965
+ function Go() {
2919
2966
  let e = U(), [t, n] = m([]), [r, i] = m(""), [a, o] = m({});
2920
2967
  return l(() => {
2921
2968
  let t = new AbortController();
@@ -2937,11 +2984,11 @@ function Ho() {
2937
2984
  dictionary: a
2938
2985
  };
2939
2986
  }
2940
- var Uo = /* @__PURE__ */ new Set(["core:table"]);
2941
- function Wo(e) {
2942
- return Go(e, /* @__PURE__ */ new Map(), void 0);
2987
+ var Ko = /* @__PURE__ */ new Set(["core:table"]);
2988
+ function qo(e) {
2989
+ return Jo(e, /* @__PURE__ */ new Map(), void 0);
2943
2990
  }
2944
- function Go(e, t, n) {
2991
+ function Jo(e, t, n) {
2945
2992
  let r = e;
2946
2993
  if (!r.slots) return e;
2947
2994
  let i = !1, a = {};
@@ -2950,7 +2997,7 @@ function Go(e, t, n) {
2950
2997
  a[e] = o.map((e) => {
2951
2998
  let t = e, n = $(t, "typeName");
2952
2999
  t.componentName === "core:data" && n && (r.set(n, t), s = t);
2953
- let a = Go(qo(Ko(t, r), s), r, s);
3000
+ let a = Jo(Xo(Yo(t, r), s), r, s);
2954
3001
  return a !== e && (i = !0), a;
2955
3002
  });
2956
3003
  }
@@ -2959,8 +3006,8 @@ function Go(e, t, n) {
2959
3006
  slots: a
2960
3007
  } : e;
2961
3008
  }
2962
- function Ko(e, t) {
2963
- if (!Uo.has(e.componentName)) return e;
3009
+ function Yo(e, t) {
3010
+ if (!Ko.has(e.componentName)) return e;
2964
3011
  let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
2965
3012
  if (!r || e.properties.queryArguments !== void 0) return e;
2966
3013
  let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
@@ -2969,7 +3016,7 @@ function Ko(e, t) {
2969
3016
  properties: a
2970
3017
  };
2971
3018
  }
2972
- function qo(e, t) {
3019
+ function Xo(e, t) {
2973
3020
  if (!["core:guarded-action", "core:action"].includes(e.componentName) || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
2974
3021
  let n = { ...e.properties };
2975
3022
  if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
@@ -2987,7 +3034,7 @@ function $(e, t) {
2987
3034
  return typeof n == "string" && n.length > 0 ? n : void 0;
2988
3035
  }
2989
3036
  // src/stageQueryBindings.tsx
2990
- function Jo(e) {
3037
+ function Zo(e) {
2991
3038
  let t = /* @__PURE__ */ new Set(), n = (e) => {
2992
3039
  if (Array.isArray(e)) {
2993
3040
  e.forEach(n);
@@ -3003,7 +3050,7 @@ function Jo(e) {
3003
3050
  };
3004
3051
  return r(e), [...t];
3005
3052
  }
3006
- function Yo(e) {
3053
+ function Qo(e) {
3007
3054
  let t = /* @__PURE__ */ new Map(), n = (e, t) => {
3008
3055
  let n = e.properties?.[t];
3009
3056
  return typeof n == "string" && n.length > 0 ? n : void 0;
@@ -3022,8 +3069,8 @@ function Yo(e) {
3022
3069
  };
3023
3070
  return r(e), [...t.values()];
3024
3071
  }
3025
- function Xo({ source: e }) {
3026
- let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = e.by ? r[e.by] || i[e.by] : void 0, o = Ha(e.query), s = f(() => ({
3072
+ function $o({ source: e }) {
3073
+ let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = e.by ? r[e.by] || i[e.by] : void 0, o = Ga(e.query), s = f(() => ({
3027
3074
  ...o,
3028
3075
  ...e.by ? a ? { [e.by]: a } : {} : {
3029
3076
  ...i,
@@ -3046,8 +3093,8 @@ function Xo({ source: e }) {
3046
3093
  list: !0
3047
3094
  }), null;
3048
3095
  }
3049
- function Zo({ name: e }) {
3050
- let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = Ha(e), o = f(() => ({
3096
+ function es({ name: e }) {
3097
+ let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = Ga(e), o = f(() => ({
3051
3098
  ...a,
3052
3099
  ...i,
3053
3100
  ...r
@@ -3065,59 +3112,59 @@ function Zo({ name: e }) {
3065
3112
  list: !0
3066
3113
  }), null;
3067
3114
  }
3068
- function Qo({ element: e }) {
3069
- let t = f(() => Jo(e), [e]), n = f(() => Yo(e), [e]);
3070
- return /* @__PURE__ */ V(z, { children: [t.map((e) => /* @__PURE__ */ B(Zo, { name: e }, e)), n.map((e) => /* @__PURE__ */ B(Xo, { source: e }, e.typeName))] });
3115
+ function ts({ element: e }) {
3116
+ let t = f(() => Zo(e), [e]), n = f(() => Qo(e), [e]);
3117
+ return /* @__PURE__ */ V(z, { children: [t.map((e) => /* @__PURE__ */ B(es, { name: e }, e)), n.map((e) => /* @__PURE__ */ B($o, { source: e }, e.typeName))] });
3071
3118
  }
3072
3119
  // src/stageThemeChoice.ts
3073
- var $o = "cratis.stage.theme";
3074
- function es() {
3120
+ var ns = "cratis.stage.theme";
3121
+ function rs() {
3075
3122
  try {
3076
3123
  return globalThis.localStorage ?? null;
3077
3124
  } catch {
3078
3125
  return null;
3079
3126
  }
3080
3127
  }
3081
- function ts() {
3128
+ function is() {
3082
3129
  try {
3083
- return es()?.getItem("cratis.stage.theme") || void 0;
3130
+ return rs()?.getItem("cratis.stage.theme") || void 0;
3084
3131
  } catch {
3085
3132
  return;
3086
3133
  }
3087
3134
  }
3088
- function ns(e) {
3135
+ function as(e) {
3089
3136
  try {
3090
- es()?.setItem($o, e);
3137
+ rs()?.setItem(ns, e);
3091
3138
  } catch {}
3092
3139
  }
3093
3140
  // src/screenTitle.ts
3094
- var rs = "core:title", is = ["content", "main"];
3095
- function as(e) {
3141
+ var os = "core:title", ss = ["content", "main"];
3142
+ function cs(e) {
3096
3143
  let t = e;
3097
- if (t.componentName !== rs) return;
3144
+ if (t.componentName !== os) return;
3098
3145
  let n = t.properties?.text;
3099
3146
  return typeof n == "string" && n.trim().length > 0 ? n : void 0;
3100
3147
  }
3101
- function os(e) {
3148
+ function ls(e) {
3102
3149
  for (let t of e ?? []) {
3103
- let e = as(t);
3150
+ let e = cs(t);
3104
3151
  if (e !== void 0) return e;
3105
3152
  }
3106
3153
  }
3107
- function ss(e) {
3108
- let t = e.slotContent ?? {}, n = [...is, ...Object.keys(t).filter((e) => !is.includes(e))];
3154
+ function us(e) {
3155
+ let t = e.slotContent ?? {}, n = [...ss, ...Object.keys(t).filter((e) => !ss.includes(e))];
3109
3156
  for (let e of n) {
3110
- let n = os(t[e]);
3157
+ let n = ls(t[e]);
3111
3158
  if (n !== void 0) return n;
3112
3159
  }
3113
3160
  return Er(e.name);
3114
3161
  }
3115
- function cs(e) {
3162
+ function ds(e) {
3116
3163
  let t = /* @__PURE__ */ new Set(), n = [];
3117
3164
  for (let r of e.flatMap((e) => e.contributions ?? [])) {
3118
- let e = us(r);
3165
+ let e = ps(r);
3119
3166
  if (!e) continue;
3120
- let i = fs(e);
3167
+ let i = hs(e);
3121
3168
  t.has(i) || (t.add(i), n.push(e));
3122
3169
  }
3123
3170
  return n.map((e, t) => ({
@@ -3125,47 +3172,47 @@ function cs(e) {
3125
3172
  index: t
3126
3173
  })).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
3127
3174
  }
3128
- function ls(e) {
3175
+ function fs(e) {
3129
3176
  let t = {
3130
3177
  label: "",
3131
3178
  children: []
3132
3179
  };
3133
3180
  for (let n of e) {
3134
- let e = n.hierarchy.reduce((e, t) => ps(e, t, !1), t);
3135
- (n.group ? ps(e, n.group, !0) : e).children.push(ms(n));
3181
+ let e = n.hierarchy.reduce((e, t) => gs(e, t, !1), t);
3182
+ (n.group ? gs(e, n.group, !0) : e).children.push(_s(n));
3136
3183
  }
3137
3184
  return t.children;
3138
3185
  }
3139
- function us(e) {
3186
+ function ps(e) {
3140
3187
  if (e.contributionPointName !== "Navigation") return;
3141
3188
  let t = e.content?.properties ?? {}, n = t.label, r = t.targetScreen;
3142
3189
  if (typeof n != "string" || typeof r != "string") return;
3143
- let i = ds(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
3190
+ let i = ms(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
3144
3191
  return {
3145
3192
  label: n,
3146
3193
  targetScreen: r,
3147
3194
  hierarchy: i,
3148
3195
  order: a,
3149
- ...gs({
3150
- id: hs(t.id),
3151
- group: hs(t.group),
3152
- icon: hs(t.icon),
3153
- presentation: hs(t.presentation),
3154
- destination: vs(o) && ys(o) ? o : void 0
3196
+ ...ys({
3197
+ id: vs(t.id),
3198
+ group: vs(t.group),
3199
+ icon: vs(t.icon),
3200
+ presentation: vs(t.presentation),
3201
+ destination: xs(o) && Ss(o) ? o : void 0
3155
3202
  })
3156
3203
  };
3157
3204
  }
3158
- function ds(e) {
3205
+ function ms(e) {
3159
3206
  return Array.isArray(e.hierarchy) ? e.hierarchy.filter((e) => typeof e == "string") : [];
3160
3207
  }
3161
- function fs(e) {
3208
+ function hs(e) {
3162
3209
  return e.id === void 0 ? JSON.stringify([
3163
3210
  e.hierarchy,
3164
3211
  e.targetScreen,
3165
3212
  e.label
3166
3213
  ]) : JSON.stringify(["id", e.id]);
3167
3214
  }
3168
- function ps(e, t, n) {
3215
+ function gs(e, t, n) {
3169
3216
  let r = e.children.find((e) => e.screen === void 0 && e.section === !0 === n && e.label === t);
3170
3217
  if (r) return r;
3171
3218
  let i = n ? {
@@ -3178,12 +3225,12 @@ function ps(e, t, n) {
3178
3225
  };
3179
3226
  return e.children.push(i), i;
3180
3227
  }
3181
- function ms(e) {
3228
+ function _s(e) {
3182
3229
  return {
3183
3230
  label: e.label,
3184
- ...gs({ id: e.id || void 0 }),
3231
+ ...ys({ id: e.id || void 0 }),
3185
3232
  screen: e.targetScreen,
3186
- ...gs({
3233
+ ...ys({
3187
3234
  icon: e.icon || void 0,
3188
3235
  presentation: e.presentation || void 0,
3189
3236
  destination: e.destination
@@ -3191,58 +3238,58 @@ function ms(e) {
3191
3238
  children: []
3192
3239
  };
3193
3240
  }
3194
- function hs(e) {
3241
+ function vs(e) {
3195
3242
  return typeof e == "string" ? e : void 0;
3196
3243
  }
3197
- function gs(e) {
3244
+ function ys(e) {
3198
3245
  return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
3199
3246
  }
3200
- function _s(e, t) {
3247
+ function bs(e, t) {
3201
3248
  for (let n of e) {
3202
3249
  if (n.screen === t) return [n.label];
3203
- let e = _s(n.children, t);
3250
+ let e = bs(n.children, t);
3204
3251
  if (e.length > 0) return n.section ? e : [n.label, ...e];
3205
3252
  }
3206
3253
  return [];
3207
3254
  }
3208
- function vs(e) {
3255
+ function xs(e) {
3209
3256
  return typeof e == "object" && !!e && !Array.isArray(e);
3210
3257
  }
3211
- function ys(e) {
3258
+ function Ss(e) {
3212
3259
  return e.slot !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
3213
3260
  }
3214
- function bs(e, t, n) {
3261
+ function Cs(e, t, n) {
3215
3262
  return e.filter((e) => !t.has(e.name)).map((e) => ({
3216
- label: ss(e),
3263
+ label: us(e),
3217
3264
  targetScreen: e.name,
3218
3265
  hierarchy: e.path && e.path.length > 0 ? [...e.path] : [n]
3219
3266
  }));
3220
3267
  }
3221
3268
  // src/blueprint.ts
3222
- var xs = "Stage:locale", Ss = "Stage:themeToggle", Cs = "Stage:notes", ws = "Stage:acting-user", Ts = "Cratis.Components", Es = "PrimeReact", Ds = /* @__PURE__ */ new Map();
3223
- function Os(e) {
3224
- return ft(e).packages.includes(Es);
3269
+ var ws = "Stage:locale", Ts = "Stage:themeToggle", Es = "Stage:notes", Ds = "Stage:acting-user", Os = "Cratis.Components", ks = "PrimeReact", As = /* @__PURE__ */ new Map();
3270
+ function js(e) {
3271
+ return ft(e).packages.includes(ks);
3225
3272
  }
3226
- function ks(e, t) {
3227
- Ds.set(e, t);
3273
+ function Ms(e, t) {
3274
+ As.set(e, t);
3228
3275
  }
3229
- function As(e) {
3276
+ function Ns(e) {
3230
3277
  let t = ft(e);
3231
3278
  return {
3232
3279
  ...t,
3233
3280
  name: e?.length ? t.name : "Stage",
3234
3281
  packages: ie(t.packages, {
3235
- baseline: Ts,
3282
+ baseline: Os,
3236
3283
  catalog: { [it]: O.Blueprint }
3237
3284
  })
3238
3285
  };
3239
3286
  }
3240
- var js = {
3287
+ var Ps = {
3241
3288
  ...tt,
3242
- [Ts]: Ft.components
3289
+ [Os]: Ft.components
3243
3290
  };
3244
- function Ms(e) {
3245
- let t = [...Ds.values()].reduce((e, t) => ({
3291
+ function Fs(e) {
3292
+ let t = [...As.values()].reduce((e, t) => ({
3246
3293
  ...e,
3247
3294
  ...t.components
3248
3295
  }), {});
@@ -3255,16 +3302,16 @@ function Ms(e) {
3255
3302
  ...e
3256
3303
  };
3257
3304
  }
3258
- function Ns(e) {
3259
- let t = Object.fromEntries([...Ds].map(([e, t]) => [e, t.declared]));
3305
+ function Is(e) {
3306
+ let t = Object.fromEntries([...As].map(([e, t]) => [e, t.declared]));
3260
3307
  return {
3261
3308
  ...e,
3262
- ...js,
3309
+ ...Ps,
3263
3310
  ...t
3264
3311
  };
3265
3312
  }
3266
- var Ps = "Stage:navigationTree";
3267
- function Fs(e, t, n) {
3313
+ var Ls = "Stage:navigationTree";
3314
+ function Rs(e, t, n) {
3268
3315
  let r = t?.title ?? "Cratis Stage";
3269
3316
  return R(e, I.Logo, {
3270
3317
  label: r,
@@ -3275,33 +3322,33 @@ function Fs(e, t, n) {
3275
3322
  ...t?.showName === void 0 ? {} : { showName: t.showName }
3276
3323
  });
3277
3324
  }
3278
- function Is(e, t, n, r) {
3325
+ function zs(e, t, n, r) {
3279
3326
  let i = [];
3280
- return r && i.push(R("topbar-acting-user", ws, {})), e.length > 1 && i.push(R("topbar-locale", xs, {
3327
+ return r && i.push(R("topbar-acting-user", Ds, {})), e.length > 1 && i.push(R("topbar-locale", ws, {
3281
3328
  locales: e,
3282
3329
  locale: t
3283
- })), n && i.push(R("topbar-theme", Ss, {})), i;
3330
+ })), n && i.push(R("topbar-theme", Ts, {})), i;
3284
3331
  }
3285
- function Ls(e, t, n, r, i, a = {}) {
3286
- let { regions: o = !1, showFooter: s = !0, showThemeSwitcher: c = !0, showActingUser: l = !1 } = a, u = e[0]?.name ?? "", d = i?.title ?? "Cratis Stage", f = cs(e), p = bs(e, new Set(f.map((e) => e.targetScreen)), "Other screens"), m = ls([...f, ...f.length > 0 ? p : []]), h = e.map((e, n) => ut({
3287
- label: ss(e),
3332
+ function Bs(e, t, n, r, i, a = {}) {
3333
+ let { regions: o = !1, showFooter: s = !0, showThemeSwitcher: c = !0, showActingUser: l = !1 } = a, u = e[0]?.name ?? "", d = i?.title ?? "Cratis Stage", f = ds(e), p = Cs(e, new Set(f.map((e) => e.targetScreen)), "Other screens"), m = fs([...f, ...f.length > 0 ? p : []]), h = e.map((e, n) => ut({
3334
+ label: us(e),
3288
3335
  targetScreen: e.name,
3289
3336
  icon: "pi pi-table",
3290
3337
  group: "Screens",
3291
3338
  order: n
3292
- }, t)), g = e.find((e) => e.name === t), _ = g ? ss(g) : Er(t), v = _s(ls(f), t), y = e.find((e) => e.name === t)?.path?.length ? _s(m, t) : [], b = v.length > 0 ? v : y, x = f.length > 0 ? R("menu-hierarchy", Ps, {
3339
+ }, t)), g = e.find((e) => e.name === t), _ = g ? us(g) : Er(t), v = bs(fs(f), t), y = e.find((e) => e.name === t)?.path?.length ? bs(m, t) : [], b = v.length > 0 ? v : y, x = f.length > 0 ? R("menu-hierarchy", Ls, {
3293
3340
  nodes: m,
3294
3341
  activeScreen: t
3295
3342
  }) : R("menu-screens", I.Menu, {
3296
3343
  title: "Screens",
3297
3344
  label: "Screens"
3298
- }, { items: h }), S = [R("topbar-notes", Cs, {}), ...Is(n, r, c, l)], C = { regionNavigation: o };
3345
+ }, { items: h }), S = [R("topbar-notes", Es, {}), ...zs(n, r, c, l)], C = { regionNavigation: o };
3299
3346
  return {
3300
3347
  [L.Topbar]: [R("topbar", I.Topbar, C, {
3301
- logo: [Fs("topbar-logo", i, u)],
3348
+ logo: [Rs("topbar-logo", i, u)],
3302
3349
  end: S
3303
3350
  })],
3304
- [L.Sidebar]: [R("sidebar", I.Sidebar, C, { logo: [Fs("sidebar-logo", i, u)] })],
3351
+ [L.Sidebar]: [R("sidebar", I.Sidebar, C, { logo: [Rs("sidebar-logo", i, u)] })],
3305
3352
  ...o ? {} : { [L.Menu]: [x] },
3306
3353
  [L.Breadcrumb]: [R("breadcrumb", I.Breadcrumb, {
3307
3354
  homeTargetScreen: u,
@@ -3318,11 +3365,11 @@ function Ls(e, t, n, r, i, a = {}) {
3318
3365
  })]
3319
3366
  };
3320
3367
  }
3321
- function Rs(e) {
3368
+ function Vs(e) {
3322
3369
  return `#/${encodeURIComponent(e)}`;
3323
3370
  }
3324
3371
  // src/externalRouteHref.ts
3325
- function zs(e) {
3372
+ function Hs(e) {
3326
3373
  try {
3327
3374
  let t = new URL(e ?? "");
3328
3375
  return t.protocol === "http:" || t.protocol === "https:" ? e : void 0;
@@ -3331,11 +3378,11 @@ function zs(e) {
3331
3378
  }
3332
3379
  }
3333
3380
  // src/stageSlot.tsx
3334
- function Bs(e) {
3381
+ function Us(e) {
3335
3382
  return typeof e == "string" && e.length > 0 ? e : void 0;
3336
3383
  }
3337
- function Vs({ element: e }) {
3338
- let t = Me(e.properties), n = c(Se), r = He(), i = Ke(), a = W(), o = Bs(e.properties.shows), s = Bs(e.properties.showsBy), u = Bs(e.properties.showsFromElement) ?? Bs(e.properties.showsFrom), d = t.routed || o ? r?.state.slots[t.name] : void 0, f = u ? a.selections[u] : void 0, p = f && s ? f[s] : void 0, m = p == null || p === "" ? void 0 : String(p);
3384
+ function Ws({ element: e }) {
3385
+ let t = Me(e.properties), n = c(Se), r = He(), i = Ke(), a = W(), o = Us(e.properties.shows), s = Us(e.properties.showsBy), u = Us(e.properties.showsFromElement) ?? Us(e.properties.showsFrom), d = t.routed || o ? r?.state.slots[t.name] : void 0, f = u ? a.selections[u] : void 0, p = f && s ? f[s] : void 0, m = p == null || p === "" ? void 0 : String(p);
3339
3386
  l(() => {
3340
3387
  if (!r || !o || !s || m === void 0) return;
3341
3388
  let e = r.state.slots[t.name];
@@ -3366,7 +3413,7 @@ function Vs({ element: e }) {
3366
3413
  onClick: v,
3367
3414
  children: "Close"
3368
3415
  })
3369
- }), g && i && h && (d ? /* @__PURE__ */ B(Hs, {
3416
+ }), g && i && h && (d ? /* @__PURE__ */ B(Gs, {
3370
3417
  name: h,
3371
3418
  screen: g,
3372
3419
  registry: i.registry,
@@ -3391,7 +3438,7 @@ function Vs({ element: e }) {
3391
3438
  children: b
3392
3439
  });
3393
3440
  }
3394
- function Hs({ name: e, screen: t, registry: n, values: r }) {
3441
+ function Gs({ name: e, screen: t, registry: n, values: r }) {
3395
3442
  let i = W(), a = JSON.stringify({
3396
3443
  ...i.parameters,
3397
3444
  ...r
@@ -3405,7 +3452,7 @@ function Hs({ name: e, screen: t, registry: n, values: r }) {
3405
3452
  locale: i.locale,
3406
3453
  locales: i.locales,
3407
3454
  screen: e,
3408
- children: /* @__PURE__ */ B(Us, {
3455
+ children: /* @__PURE__ */ B(Ks, {
3409
3456
  name: e,
3410
3457
  screen: t,
3411
3458
  registry: n
@@ -3413,13 +3460,13 @@ function Hs({ name: e, screen: t, registry: n, values: r }) {
3413
3460
  })
3414
3461
  });
3415
3462
  }
3416
- function Us({ name: e, screen: t, registry: n }) {
3463
+ function Ks({ name: e, screen: t, registry: n }) {
3417
3464
  let r = W();
3418
3465
  return /* @__PURE__ */ B(xr, {
3419
3466
  screen: e,
3420
3467
  children: /* @__PURE__ */ V(pi, {
3421
3468
  element: t,
3422
- children: [/* @__PURE__ */ B(Qo, { element: t }), /* @__PURE__ */ B(xe, {
3469
+ children: [/* @__PURE__ */ B(ts, { element: t }), /* @__PURE__ */ B(xe, {
3423
3470
  element: t,
3424
3471
  registry: n,
3425
3472
  resolveBinding: r.resolveBinding,
@@ -3429,7 +3476,7 @@ function Us({ name: e, screen: t, registry: n }) {
3429
3476
  });
3430
3477
  }
3431
3478
  // src/sandboxActingUser.ts
3432
- async function Ws(e, t = fetch) {
3479
+ async function qs(e, t = fetch) {
3433
3480
  let n = await t(Rt.actingUser, {
3434
3481
  signal: e,
3435
3482
  credentials: "same-origin"
@@ -3438,7 +3485,7 @@ async function Ws(e, t = fetch) {
3438
3485
  let r = await n.json();
3439
3486
  return r.enabled === !0 && Array.isArray(r.users) && r.users.length > 0 ? r : void 0;
3440
3487
  }
3441
- async function Gs(e, t = fetch) {
3488
+ async function Js(e, t = fetch) {
3442
3489
  let n = await t(Rt.actingUser, {
3443
3490
  method: "PUT",
3444
3491
  credentials: "same-origin",
@@ -3447,11 +3494,11 @@ async function Gs(e, t = fetch) {
3447
3494
  });
3448
3495
  if (!n.ok) throw Error(`The sandbox could not change the acting user (${n.status}).`);
3449
3496
  }
3450
- async function Ks(e, t, n) {
3497
+ async function Ys(e, t, n) {
3451
3498
  e.selectActingUser && (await e.selectActingUser(t), n());
3452
3499
  }
3453
3500
  // src/SandboxActingUser.tsx
3454
- function qs() {
3501
+ function Xs() {
3455
3502
  let e = U(), [t, n] = m(), [r, i] = m(!1), [a, o] = m("");
3456
3503
  if (l(() => {
3457
3504
  let t = new AbortController();
@@ -3462,7 +3509,7 @@ function qs() {
3462
3509
  let s = async (t) => {
3463
3510
  i(!0), o("");
3464
3511
  try {
3465
- await Ks(e, t || null, () => window.location.reload());
3512
+ await Ys(e, t || null, () => window.location.reload());
3466
3513
  } catch {
3467
3514
  o("The acting user could not be changed. Try again."), i(!1);
3468
3515
  }
@@ -3494,25 +3541,25 @@ function qs() {
3494
3541
  });
3495
3542
  }
3496
3543
  // src/StageChrome.tsx
3497
- var Js = a({
3544
+ var Zs = a({
3498
3545
  locales: [],
3499
3546
  locale: "",
3500
3547
  setLocale: () => void 0,
3501
3548
  activity: ""
3502
3549
  });
3503
- function Ys({ state: e, children: t }) {
3504
- return /* @__PURE__ */ B(Js.Provider, {
3550
+ function Qs({ state: e, children: t }) {
3551
+ return /* @__PURE__ */ B(Zs.Provider, {
3505
3552
  value: e,
3506
3553
  children: t
3507
3554
  });
3508
3555
  }
3509
- var Xs = "Stage:activity";
3510
- function Zs() {
3511
- let { notesEnabled: e } = c(Js);
3556
+ var $s = "Stage:activity";
3557
+ function ec() {
3558
+ let { notesEnabled: e } = c(Zs);
3512
3559
  return e ? /* @__PURE__ */ B(r, { size: "small" }) : null;
3513
3560
  }
3514
- function Qs() {
3515
- let { locales: e, locale: t, setLocale: n } = c(Js);
3561
+ function tc() {
3562
+ let { locales: e, locale: t, setLocale: n } = c(Zs);
3516
3563
  return e.length < 2 ? null : /* @__PURE__ */ B("select", {
3517
3564
  className: "stage-locale",
3518
3565
  "aria-label": "Locale",
@@ -3524,7 +3571,7 @@ function Qs() {
3524
3571
  }, e))
3525
3572
  });
3526
3573
  }
3527
- function $s({ element: e }) {
3574
+ function nc({ element: e }) {
3528
3575
  let { config: t, setThemeName: n, setColorScheme: r } = pt(), i = at.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === F.Dark, a = at.find((e) => (e.isDark ?? !1) !== i);
3529
3576
  if (!a) return null;
3530
3577
  let o = i ? "Switch to a light theme" : "Switch to a dark theme";
@@ -3537,7 +3584,7 @@ function $s({ element: e }) {
3537
3584
  "aria-label": o,
3538
3585
  title: o,
3539
3586
  onClick: () => {
3540
- ns(a.name), n(a.name), r(a.isDark ? F.Dark : F.Light);
3587
+ as(a.name), n(a.name), r(a.isDark ? F.Dark : F.Light);
3541
3588
  },
3542
3589
  children: /* @__PURE__ */ B("svg", {
3543
3590
  width: "18",
@@ -3558,19 +3605,19 @@ function $s({ element: e }) {
3558
3605
  })
3559
3606
  });
3560
3607
  }
3561
- function ec({ element: e }) {
3608
+ function rc({ element: e }) {
3562
3609
  let t = e.properties ?? {};
3563
3610
  return /* @__PURE__ */ B("nav", {
3564
3611
  className: "stage-navigation-tree",
3565
3612
  "aria-label": "Navigation",
3566
3613
  "data-scene-id": e.id,
3567
- children: /* @__PURE__ */ B(tc, {
3614
+ children: /* @__PURE__ */ B(ic, {
3568
3615
  nodes: t.nodes ?? [],
3569
3616
  activeScreen: t.activeScreen
3570
3617
  })
3571
3618
  });
3572
3619
  }
3573
- function tc({ nodes: e, activeScreen: t }) {
3620
+ function ic({ nodes: e, activeScreen: t }) {
3574
3621
  return /* @__PURE__ */ B("ul", {
3575
3622
  role: "tree",
3576
3623
  children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ V("li", {
@@ -3579,13 +3626,13 @@ function tc({ nodes: e, activeScreen: t }) {
3579
3626
  children: [/* @__PURE__ */ B("span", {
3580
3627
  className: "stage-navigation-group",
3581
3628
  children: e.label
3582
- }), /* @__PURE__ */ B(tc, {
3629
+ }), /* @__PURE__ */ B(ic, {
3583
3630
  nodes: e.children,
3584
3631
  activeScreen: t
3585
3632
  })]
3586
3633
  }, e.label) : /* @__PURE__ */ B("li", {
3587
3634
  role: "treeitem",
3588
- children: /* @__PURE__ */ B(nc, {
3635
+ children: /* @__PURE__ */ B(ac, {
3589
3636
  node: e,
3590
3637
  screen: e.screen,
3591
3638
  activeScreen: t
@@ -3593,10 +3640,10 @@ function tc({ nodes: e, activeScreen: t }) {
3593
3640
  }, `${e.screen}:${e.label}`))
3594
3641
  });
3595
3642
  }
3596
- function nc({ node: e, screen: t, activeScreen: n }) {
3597
- let r = c(Se), i = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", a = e.destination, o = a?.kind === "external", s = a && r && !o && ys(a) ? (e) => {
3643
+ function ac({ node: e, screen: t, activeScreen: n }) {
3644
+ let r = c(Se), i = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", a = e.destination, o = a?.kind === "external", s = a && r && !o && Ss(a) ? (e) => {
3598
3645
  e.preventDefault(), r.navigate(a);
3599
- } : void 0, l = o ? zs(a.route) : Rs(t), u = o && l === void 0;
3646
+ } : void 0, l = o ? Hs(a.route) : Vs(t), u = o && l === void 0;
3600
3647
  return /* @__PURE__ */ V("a", {
3601
3648
  href: l,
3602
3649
  rel: o && !u ? "noreferrer" : void 0,
@@ -3613,15 +3660,15 @@ function nc({ node: e, screen: t, activeScreen: n }) {
3613
3660
  }), i !== "icon" && e.label]
3614
3661
  });
3615
3662
  }
3616
- function rc() {
3617
- let { activity: e } = c(Js);
3663
+ function oc() {
3664
+ let { activity: e } = c(Zs);
3618
3665
  return e ? /* @__PURE__ */ B("p", {
3619
3666
  className: "stage-activity",
3620
3667
  role: "status",
3621
3668
  children: e
3622
3669
  }) : null;
3623
3670
  }
3624
- function ic() {
3671
+ function sc() {
3625
3672
  let e = qe(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
3626
3673
  return l(() => {
3627
3674
  let r = e?.isDark ? "dark" : "light";
@@ -3632,27 +3679,27 @@ function ic() {
3632
3679
  n
3633
3680
  ]), null;
3634
3681
  }
3635
- var ac = {
3636
- [Cs]: Zs,
3637
- [ws]: qs,
3638
- [xs]: Qs,
3639
- [Ss]: $s,
3640
- [Ps]: ec,
3641
- [Xs]: rc,
3642
- "core:slot": Vs
3682
+ var cc = {
3683
+ [Es]: ec,
3684
+ [Ds]: Xs,
3685
+ [ws]: tc,
3686
+ [Ts]: nc,
3687
+ [Ls]: rc,
3688
+ [$s]: oc,
3689
+ "core:slot": Ws
3643
3690
  };
3644
3691
  // src/stageResponseContracts.ts
3645
- function oc(e) {
3692
+ function lc(e) {
3646
3693
  return {
3647
3694
  commandResponse: (t) => e?.commands[t] ?? void 0,
3648
- targetType: (t, n) => sc(e, t, n)
3695
+ targetType: (t, n) => uc(e, t, n)
3649
3696
  };
3650
3697
  }
3651
- function sc(e, t, n) {
3698
+ function uc(e, t, n) {
3652
3699
  if (n.kind === "message") return { kind: "string" };
3653
- if (n.kind === "argument") return cc(e, t, n.name);
3700
+ if (n.kind === "argument") return dc(e, t, n.name);
3654
3701
  }
3655
- function cc(e, t, n) {
3702
+ function dc(e, t, n) {
3656
3703
  switch (t.kind) {
3657
3704
  case S.ExecuteCommand: return e?.commandInputs[t.command]?.[n] ?? void 0;
3658
3705
  case S.Navigate: return e?.screenInputs[t.screen]?.[n] ?? void 0;
@@ -3660,13 +3707,13 @@ function cc(e, t, n) {
3660
3707
  }
3661
3708
  }
3662
3709
  // src/stageShell.ts
3663
- var lc = [
3710
+ var fc = [
3664
3711
  "navigationMode",
3665
3712
  "menuTheme",
3666
3713
  "showFooter",
3667
3714
  "showThemeSwitcher"
3668
- ], uc = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
3669
- function dc(e, t, n = !1) {
3715
+ ], pc = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
3716
+ function mc(e, t, n = !1) {
3670
3717
  let r = [], i = {
3671
3718
  showFooter: !0,
3672
3719
  showThemeSwitcher: !0,
@@ -3674,42 +3721,42 @@ function dc(e, t, n = !1) {
3674
3721
  problems: r
3675
3722
  };
3676
3723
  for (let [e, n] of Object.entries(t.options ?? {})) {
3677
- let a = fc(i, t.name, e, n);
3724
+ let a = hc(i, t.name, e, n);
3678
3725
  a && r.push(a);
3679
3726
  }
3680
- return mc(i, e?.appearance, n), i;
3727
+ return _c(i, e?.appearance, n), i;
3681
3728
  }
3682
- function fc(e, t, n, r) {
3683
- if (!lc.includes(n)) return `The shell '${t}' has no option '${n}'; the options it understands are ${lc.join(", ")}.`;
3684
- if (n === "navigationMode") return pc(n, r, ct, (t) => {
3729
+ function hc(e, t, n, r) {
3730
+ if (!fc.includes(n)) return `The shell '${t}' has no option '${n}'; the options it understands are ${fc.join(", ")}.`;
3731
+ if (n === "navigationMode") return gc(n, r, ct, (t) => {
3685
3732
  e.mode = t;
3686
3733
  });
3687
- if (n === "menuTheme") return pc(n, r, lt, (t) => {
3734
+ if (n === "menuTheme") return gc(n, r, lt, (t) => {
3688
3735
  e.menuTheme = t;
3689
3736
  });
3690
3737
  if (typeof r != "boolean") return `Option '${n}' is '${String(r)}'; expected true or false.`;
3691
3738
  n === "showFooter" ? e.showFooter = r : e.showThemeSwitcher = r;
3692
3739
  }
3693
- function pc(e, t, n, r) {
3740
+ function gc(e, t, n, r) {
3694
3741
  let i = n.find((e) => e === t);
3695
3742
  if (!i) return `Option '${e}' is '${String(t)}'; expected one of ${n.join(", ")}.`;
3696
3743
  r(i);
3697
3744
  }
3698
- function mc(e, t, n) {
3745
+ function _c(e, t, n) {
3699
3746
  if (t?.colorScheme !== void 0) {
3700
3747
  e.followsSystem = t.colorScheme === _.System;
3701
3748
  let r = e.followsSystem ? n : t.colorScheme === _.Dark;
3702
3749
  e.colorScheme = r ? F.Dark : F.Light, e.themeName = at.find((e) => (e.isDark ?? !1) === r)?.name, e.followsSystem || (e.showThemeSwitcher = !1);
3703
3750
  }
3704
- t?.accent !== void 0 && (uc.test(t.accent) ? e.accent = t.accent : e.problems.push(`The accent '${t.accent}' is not a colour written as #rgb or #rrggbb.`));
3751
+ t?.accent !== void 0 && (pc.test(t.accent) ? e.accent = t.accent : e.problems.push(`The accent '${t.accent}' is not a colour written as #rgb or #rrggbb.`));
3705
3752
  }
3706
- function hc(e) {
3753
+ function vc(e) {
3707
3754
  return {
3708
3755
  showFooter: e?.showFooter ?? !0,
3709
3756
  showThemeSwitcher: e?.showThemeSwitcher ?? !0
3710
3757
  };
3711
3758
  }
3712
- function gc(e, t) {
3759
+ function yc(e, t) {
3713
3760
  if (e?.root === void 0) return [];
3714
3761
  let n = /* @__PURE__ */ new Set([
3715
3762
  j.RootTemplateUnknown,
@@ -3721,7 +3768,7 @@ function gc(e, t) {
3721
3768
  ]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
3722
3769
  return r.length === 0 && t.origin !== M.Root && r.push(`The root template '${e.root.template.id}' did not resolve, so the application would not start in the shell it names.`), r;
3723
3770
  }
3724
- function _c(e) {
3771
+ function bc(e) {
3725
3772
  let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
3726
3773
  0,
3727
3774
  2,
@@ -3729,7 +3776,7 @@ function _c(e) {
3729
3776
  ].map((e) => parseInt(t.slice(e, e + 2), 16));
3730
3777
  return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
3731
3778
  }
3732
- function vc(e, t) {
3779
+ function xc(e, t) {
3733
3780
  if (t === void 0) return e;
3734
3781
  let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
3735
3782
  0,
@@ -3741,24 +3788,24 @@ function vc(e, t) {
3741
3788
  tokens: {
3742
3789
  ...e.tokens,
3743
3790
  "primary.color": t,
3744
- "primary.contrastColor": _c(t),
3791
+ "primary.contrastColor": bc(t),
3745
3792
  "focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
3746
3793
  }
3747
3794
  }));
3748
3795
  }
3749
3796
  // src/StageShellSettings.tsx
3750
- var yc = "(prefers-color-scheme: dark)";
3751
- function bc() {
3797
+ var Sc = "(prefers-color-scheme: dark)";
3798
+ function Cc() {
3752
3799
  return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
3753
3800
  }
3754
- function xc({ settings: e, onSystemSchemeChange: t }) {
3801
+ function wc({ settings: e, onSystemSchemeChange: t }) {
3755
3802
  let n = p(pt());
3756
3803
  n.current = pt();
3757
3804
  let { mode: r, menuTheme: i, colorScheme: a, themeName: o } = e;
3758
3805
  return l(() => {
3759
3806
  let { setMode: e, setMenuTheme: t, setColorScheme: s, setThemeName: c } = n.current;
3760
3807
  r !== void 0 && e(r), i !== void 0 && t(i);
3761
- let l = at.find((e) => e.name === ts());
3808
+ let l = at.find((e) => e.name === is());
3762
3809
  l ? (c(l.name), s(l.isDark ? F.Dark : F.Light)) : (a !== void 0 && s(a), o !== void 0 && c(o));
3763
3810
  }, [
3764
3811
  r,
@@ -3767,16 +3814,16 @@ function xc({ settings: e, onSystemSchemeChange: t }) {
3767
3814
  o
3768
3815
  ]), l(() => {
3769
3816
  if (!e.followsSystem || !globalThis.matchMedia || !t) return;
3770
- let n = globalThis.matchMedia(yc), r = (e) => t(e.matches);
3817
+ let n = globalThis.matchMedia(Sc), r = (e) => t(e.matches);
3771
3818
  return n.addEventListener("change", r), () => n.removeEventListener("change", r);
3772
3819
  }, [e.followsSystem, t]), null;
3773
3820
  }
3774
3821
  // src/stageNavigationModel.ts
3775
- function Sc(e) {
3822
+ function Tc(e) {
3776
3823
  return (e?.application.outlets.some((e) => e.defaults.length > 0) ?? !1) || (e?.modules.length ?? 0) > 0;
3777
3824
  }
3778
- function Cc(e) {
3779
- let t = e.filter(wc), n = /* @__PURE__ */ new Map();
3825
+ function Ec(e) {
3826
+ let t = e.filter(Dc), n = /* @__PURE__ */ new Map();
3780
3827
  for (let e of t) {
3781
3828
  let t = (e.path ?? []).join(".");
3782
3829
  t.length > 0 && !n.has(t) && n.set(t, e.name);
@@ -3788,41 +3835,41 @@ function Cc(e) {
3788
3835
  return n.get(r) ?? i ?? (t.some((e) => e.name === r) ? r : void 0);
3789
3836
  };
3790
3837
  }
3791
- function wc(e) {
3838
+ function Dc(e) {
3792
3839
  return e.fits === void 0 || e.fits.length === 0 || e.fits.includes(k.Page);
3793
3840
  }
3794
- function Tc(e) {
3841
+ function Oc(e) {
3795
3842
  return (t) => e.find((e) => e.name === t)?.path?.[0];
3796
3843
  }
3797
- function Ec(e, t, n) {
3844
+ function kc(e, t, n) {
3798
3845
  let r = e.navigation ?? {
3799
3846
  application: { outlets: [] },
3800
3847
  modules: []
3801
3848
  };
3802
3849
  return {
3803
3850
  structure: e.structure ?? { modules: [] },
3804
- navigation: n ? Dc(r, n) : r,
3805
- screenFor: Cc(e.screens),
3806
- moduleOf: Tc(e.screens),
3851
+ navigation: n ? Ac(r, n) : r,
3852
+ screenFor: Ec(e.screens),
3853
+ moduleOf: Oc(e.screens),
3807
3854
  ...t ? { isVisible: t } : {}
3808
3855
  };
3809
3856
  }
3810
- function Dc(e, t) {
3811
- return typeof e == "string" ? le(e, t) : Array.isArray(e) ? e.map((e) => Dc(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, Dc(n, t)])) : e;
3857
+ function Ac(e, t) {
3858
+ return typeof e == "string" ? le(e, t) : Array.isArray(e) ? e.map((e) => Ac(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, Ac(n, t)])) : e;
3812
3859
  }
3813
3860
  // src/stageSlices.ts
3814
- function Oc(e) {
3861
+ function jc(e) {
3815
3862
  return (t) => Y(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
3816
3863
  name: e.name,
3817
3864
  type: e.type === "text" || e.type === void 0 ? "string" : e.type,
3818
- label: kc(e.name),
3865
+ label: Mc(e.name),
3819
3866
  required: e.required
3820
3867
  }));
3821
3868
  }
3822
- function kc(e) {
3869
+ function Mc(e) {
3823
3870
  return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
3824
3871
  }
3825
- function Ac(e, t, n) {
3872
+ function Nc(e, t, n) {
3826
3873
  return { invoke: async (r, i, a) => {
3827
3874
  let o = a ?? r.slice(r.lastIndexOf(".") + 1);
3828
3875
  if (!on(o)) return {
@@ -3842,7 +3889,7 @@ function Ac(e, t, n) {
3842
3889
  } };
3843
3890
  }
3844
3891
  // src/withoutSeededSlots.ts
3845
- function jc(e, t) {
3892
+ function Pc(e, t) {
3846
3893
  let n = /* @__PURE__ */ new Map();
3847
3894
  for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
3848
3895
  return e.map((e) => {
@@ -3859,9 +3906,9 @@ function jc(e, t) {
3859
3906
  });
3860
3907
  }
3861
3908
  // src/stageOutlets.tsx
3862
- function Mc(e) {
3909
+ function Fc(e) {
3863
3910
  let t = new Map(e.screens.map((e) => [e.name, e]));
3864
- return Nc(e.structure).map((n) => {
3911
+ return Ic(e.structure).map((n) => {
3865
3912
  let r = t.get(n.name), i = n.command ? Y(e.commandSchemas?.[n.command] ?? "").map((e) => e.identity ? {
3866
3913
  name: e.name,
3867
3914
  source: te.DataContext
@@ -3875,11 +3922,11 @@ function Mc(e) {
3875
3922
  };
3876
3923
  });
3877
3924
  }
3878
- function Nc(e) {
3925
+ function Ic(e) {
3879
3926
  let t = (e) => e.flatMap((e) => [...e.slices, ...t(e.features ?? [])]);
3880
3927
  return (e?.modules ?? []).flatMap((e) => [...e.slices ?? [], ...t(e.features ?? [])]);
3881
3928
  }
3882
- function Pc(e, t) {
3929
+ function Lc(e, t) {
3883
3930
  let n = e.screens.find((e) => e.name === t);
3884
3931
  if (!n) return { chain: [] };
3885
3932
  let { chain: r, contributors: i } = ae({
@@ -3892,19 +3939,19 @@ function Pc(e, t) {
3892
3939
  return {
3893
3940
  chain: r,
3894
3941
  contributors: i,
3895
- slices: Mc(e),
3942
+ slices: Fc(e),
3896
3943
  slots: c
3897
3944
  };
3898
3945
  }
3899
- function Fc({ source: e, screen: t, children: n }) {
3900
- let r = f(() => Pc(e, t), [e, t]);
3946
+ function Rc({ source: e, screen: t, children: n }) {
3947
+ let r = f(() => Lc(e, t), [e, t]);
3901
3948
  return /* @__PURE__ */ B(Ce, {
3902
3949
  value: r,
3903
3950
  children: n
3904
3951
  });
3905
3952
  }
3906
3953
  // src/stageIcons.ts
3907
- var Ic = /* @__PURE__ */ new Map([
3954
+ var zc = /* @__PURE__ */ new Map([
3908
3955
  ["chart", "chart-column"],
3909
3956
  ["add", "plus"],
3910
3957
  ["dollar", "dollar-sign"],
@@ -3912,23 +3959,23 @@ var Ic = /* @__PURE__ */ new Map([
3912
3959
  ["refresh", "refresh-cw"],
3913
3960
  ["invoice", "receipt-text"],
3914
3961
  ["batch", "layers"]
3915
- ]), Lc = (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(), Rc = Pe([{
3962
+ ]), Bc = (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(), Vc = Pe([{
3916
3963
  library: ee,
3917
3964
  loadGlyph: async ({ key: e }) => {
3918
- let t = Lc(e), n = Ic.get(t) ?? t;
3965
+ let t = Bc(e), n = zc.get(t) ?? t;
3919
3966
  if (Object.hasOwn(It, n)) return (await It[n]())?.default;
3920
3967
  }
3921
3968
  }]);
3922
3969
  // src/App.tsx
3923
- function zc(e = {}) {
3924
- return Ms({
3970
+ function Hc(e = {}) {
3971
+ return Fs({
3925
3972
  ...e,
3926
- ...Vo,
3927
- ...ac
3973
+ ...Wo,
3974
+ ...cc
3928
3975
  });
3929
3976
  }
3930
- function Bc(e, t) {
3931
- return R(`form-${e}-${t.name}`, co, {
3977
+ function Uc(e, t) {
3978
+ return R(`form-${e}-${t.name}`, fo, {
3932
3979
  command: t.forCommand,
3933
3980
  label: t.name,
3934
3981
  generationMode: t.generationMode,
@@ -3937,47 +3984,47 @@ function Bc(e, t) {
3937
3984
  onSubmit: t.onSubmit
3938
3985
  });
3939
3986
  }
3940
- function Vc(e, t) {
3987
+ function Wc(e, t) {
3941
3988
  let n = e.screens[0];
3942
3989
  return ot(e, n, {
3943
- profile: As(e.uiProfiles),
3990
+ profile: Ns(e.uiProfiles),
3944
3991
  blueprintTemplates: t?.length ? [...st, ...t] : st
3945
3992
  });
3946
3993
  }
3947
- function Hc(e, t) {
3994
+ function Gc(e, t) {
3948
3995
  return t ? e.map((e) => ({
3949
3996
  ...e,
3950
3997
  slotContent: Object.fromEntries(Object.entries(e.slotContent ?? {}).map(([e, n]) => [e, n.map((e) => ce(e, t))]))
3951
3998
  })) : e;
3952
3999
  }
3953
- function Uc(e, t, n, r, i, a, o = !0, s = !0, c = !1) {
4000
+ function Kc(e, t, n, r, i, a, o = !0, s = !0, c = !1) {
3954
4001
  let l = {
3955
- regions: Sc(e.navigation),
4002
+ regions: Tc(e.navigation),
3956
4003
  showFooter: o,
3957
4004
  showThemeSwitcher: s,
3958
4005
  showActingUser: c
3959
- }, u = Hc(e.screens, i), d = Wc(e);
4006
+ }, u = Gc(e.screens, i), d = qc(e);
3960
4007
  return {
3961
- profile: As(e.uiProfiles),
3962
- catalog: Ns(r),
4008
+ profile: Ns(e.uiProfiles),
4009
+ catalog: Is(r),
3963
4010
  blueprintTemplates: a?.length ? [...st, ...a] : st,
3964
4011
  namedTemplateOnly: !0,
3965
- chrome: (e, r) => r === I.FullPageShell ? { [L.ConfigPanel]: Ls(u, e.name, t, n, d, l)[L.ConfigPanel] } : Ls(u, e.name, t, n, d, l),
3966
- form: Bc,
3967
- trailing: [R("activity", Xs)],
4012
+ chrome: (e, r) => r === I.FullPageShell ? { [L.ConfigPanel]: Bs(u, e.name, t, n, d, l)[L.ConfigPanel] } : Bs(u, e.name, t, n, d, l),
4013
+ form: Uc,
4014
+ trailing: [R("activity", $s)],
3968
4015
  decorate: (e) => {
3969
- let t = Wo(or(e));
4016
+ let t = qo(or(e));
3970
4017
  return i ? ce(t, i) : t;
3971
4018
  }
3972
4019
  };
3973
4020
  }
3974
- function Wc(e) {
4021
+ function qc(e) {
3975
4022
  let t = e.navigation?.application.logo;
3976
4023
  if (t) return {
3977
4024
  title: t.title,
3978
4025
  image: t.image || void 0
3979
4026
  };
3980
- let n = As(e.uiProfiles).identity;
4027
+ let n = Ns(e.uiProfiles).identity;
3981
4028
  if (!n?.name) return;
3982
4029
  let r = n.logo;
3983
4030
  return {
@@ -3987,22 +4034,22 @@ function Wc(e) {
3987
4034
  showName: n.showName
3988
4035
  };
3989
4036
  }
3990
- function Gc(e, t, n, r, i, a) {
3991
- let [o] = Ga([t], Kc(e));
3992
- return nt(e, o, Uc(e, n, r, i, void 0, a)).element;
4037
+ function Jc(e, t, n, r, i, a) {
4038
+ let [o] = Ja([t], Yc(e));
4039
+ return nt(e, o, Kc(e, n, r, i, void 0, a)).element;
3993
4040
  }
3994
- function Kc(e) {
4041
+ function Yc(e) {
3995
4042
  return [...e.screenTemplates ?? [], ...e.dialogTemplates ?? []];
3996
4043
  }
3997
- function qc() {
4044
+ function Xc() {
3998
4045
  try {
3999
4046
  return globalThis.localStorage ?? null;
4000
4047
  } catch {
4001
4048
  return null;
4002
4049
  }
4003
4050
  }
4004
- function Jc({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: a = "hash" } = {}) {
4005
- let o = U(), [s, c] = m(), [u, d] = m(""), p = f(() => zc(e), [e, s]), h = Vt(), g = Ho();
4051
+ function Zc({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: a = "hash" } = {}) {
4052
+ let o = U(), [s, c] = m(), [u, d] = m(""), p = f(() => Hc(e), [e, s]), h = Vt(), g = Go();
4006
4053
  return l(() => {
4007
4054
  let e = new AbortController();
4008
4055
  return o.scene(e.signal).then((e) => c(r?.length ? {
@@ -4014,7 +4061,7 @@ function Jc({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
4014
4061
  }, [o, r]), u ? /* @__PURE__ */ V("main", {
4015
4062
  className: "stage-message",
4016
4063
  children: [/* @__PURE__ */ B("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ B("p", { children: u })]
4017
- }) : s ? /* @__PURE__ */ B(Yc, {
4064
+ }) : s ? /* @__PURE__ */ B(Qc, {
4018
4065
  scene: s,
4019
4066
  registry: p,
4020
4067
  routing: a,
@@ -4028,24 +4075,24 @@ function Jc({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
4028
4075
  children: /* @__PURE__ */ B("h1", { children: "Preparing the Stage" })
4029
4076
  });
4030
4077
  }
4031
- function Yc({ scene: e, registry: t, routing: n, routeState: r, strings: a, packageCatalog: o, screenTemplates: c, isVisible: u }) {
4032
- let d = f(() => Oa(e), [e]), p = f(() => {
4078
+ function Qc({ scene: e, registry: t, routing: n, routeState: r, strings: a, packageCatalog: o, screenTemplates: c, isVisible: u }) {
4079
+ let d = f(() => ja(e), [e]), p = f(() => {
4033
4080
  if (hn(n), n === "path") {
4034
4081
  let e = /^#\/(.+)$/.exec(globalThis.location.hash);
4035
4082
  e && globalThis.history.replaceState(null, "", `/${e[1]}`);
4036
4083
  }
4037
- return Ia(window, n, d);
4084
+ return za(window, n, d);
4038
4085
  }, [n, d]);
4039
4086
  l(() => () => p.dispose(), [p]);
4040
- let h = za(p), g = p.history, [_, v] = m(bc), y = fr(), b = e.screens[0]?.name ?? "", x = f(() => As(e.uiProfiles), [e]), S = f(() => b ? Vc(e, c) : void 0, [
4087
+ let h = Ha(p), g = p.history, [_, v] = m(Cc), y = fr(), b = e.screens[0]?.name ?? "", x = f(() => Ns(e.uiProfiles), [e]), S = f(() => b ? Wc(e, c) : void 0, [
4041
4088
  e,
4042
4089
  c,
4043
4090
  b
4044
- ]), C = f(() => S ? gc(x, S) : [], [x, S]), w = f(() => S ? dc(x, S, _) : void 0, [
4091
+ ]), C = f(() => S ? yc(x, S) : [], [x, S]), w = f(() => S ? mc(x, S, _) : void 0, [
4045
4092
  x,
4046
4093
  S,
4047
4094
  _
4048
- ]), T = f(() => vc(at, w?.accent), [w?.accent]), { showFooter: E, showThemeSwitcher: D } = hc(w), O = U(), k = !!O.actingUser && !!O.selectActingUser, A = f(() => Uc(e, a.locales, a.locale, o, a.dictionary, c, E, D, k), [
4095
+ ]), T = f(() => xc(at, w?.accent), [w?.accent]), { showFooter: E, showThemeSwitcher: D } = vc(w), O = U(), k = !!O.actingUser && !!O.selectActingUser, A = f(() => Kc(e, a.locales, a.locale, o, a.dictionary, c, E, D, k), [
4049
4096
  e,
4050
4097
  a.locales,
4051
4098
  a.locale,
@@ -4055,18 +4102,18 @@ function Yc({ scene: e, registry: t, routing: n, routeState: r, strings: a, pack
4055
4102
  E,
4056
4103
  D,
4057
4104
  k
4058
- ]), ee = s((e) => v(e), []), te = f(() => Ec(e, u, a.dictionary), [
4105
+ ]), ee = s((e) => v(e), []), te = f(() => kc(e, u, a.dictionary), [
4059
4106
  e,
4060
4107
  u,
4061
4108
  a.dictionary
4062
4109
  ]), ne = f(() => ({
4063
4110
  ...e,
4064
- screens: Ga(jc(e.screens, [
4111
+ screens: Ja(Pc(e.screens, [
4065
4112
  ...e.screenTemplates,
4066
4113
  ...e.dialogTemplates ?? [],
4067
4114
  ...st,
4068
4115
  ...c ?? []
4069
- ]), Kc(e))
4116
+ ]), Yc(e))
4070
4117
  }), [e, c]);
4071
4118
  if (!b) return /* @__PURE__ */ V("main", {
4072
4119
  className: "stage-message",
@@ -4089,8 +4136,8 @@ function Yc({ scene: e, registry: t, routing: n, routeState: r, strings: a, pack
4089
4136
  registry: t,
4090
4137
  initialScreen: b,
4091
4138
  history: g,
4092
- layoutConfigStorage: qc(),
4093
- scope: (t, n) => /* @__PURE__ */ B(Xc, {
4139
+ layoutConfigStorage: Xc(),
4140
+ scope: (t, n) => /* @__PURE__ */ B($c, {
4094
4141
  scene: e,
4095
4142
  notes: y,
4096
4143
  routeState: r,
@@ -4101,20 +4148,20 @@ function Yc({ scene: e, registry: t, routing: n, routeState: r, strings: a, pack
4101
4148
  onSystemSchemeChange: ee,
4102
4149
  children: n
4103
4150
  }),
4104
- renderScreen: (e, n) => /* @__PURE__ */ B($c, {
4151
+ renderScreen: (e, n) => /* @__PURE__ */ B(nl, {
4105
4152
  element: e,
4106
4153
  configuration: n,
4107
4154
  registry: t
4108
4155
  }),
4109
- renderDialog: () => /* @__PURE__ */ B(ko, {}),
4110
- renderDialogTemplate: (e, n, r) => /* @__PURE__ */ B(el, {
4156
+ renderDialog: () => /* @__PURE__ */ B(Mo, {}),
4157
+ renderDialogTemplate: (e, n, r) => /* @__PURE__ */ B(rl, {
4111
4158
  template: e,
4112
4159
  content: n,
4113
4160
  registry: t,
4114
4161
  strings: a,
4115
4162
  close: () => r.closeDialog()
4116
4163
  })
4117
- }), M = /* @__PURE__ */ B(Ba.Provider, {
4164
+ }), M = /* @__PURE__ */ B(Ua.Provider, {
4118
4165
  value: d,
4119
4166
  children: /* @__PURE__ */ B(we, {
4120
4167
  router: h,
@@ -4127,7 +4174,7 @@ function Yc({ scene: e, registry: t, routing: n, routeState: r, strings: a, pack
4127
4174
  children: M
4128
4175
  }) : M;
4129
4176
  }
4130
- function Xc({ scene: e, notes: t, routeState: n, strings: r, navigation: i, themes: a, shellSettings: o, onSystemSchemeChange: s, children: c }) {
4177
+ function $c({ scene: e, notes: t, routeState: n, strings: r, navigation: i, themes: a, shellSettings: o, onSystemSchemeChange: s, children: c }) {
4131
4178
  let [u, d] = m(""), { navigate: f } = i;
4132
4179
  return l(() => d(""), [i.currentScreen, i.currentDialog]), l(() => {
4133
4180
  let e = (e) => {
@@ -4145,16 +4192,16 @@ function Xc({ scene: e, notes: t, routeState: n, strings: r, navigation: i, them
4145
4192
  };
4146
4193
  return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
4147
4194
  }, [f, e]), /* @__PURE__ */ B(ve, {
4148
- registry: Rc,
4195
+ registry: Vc,
4149
4196
  children: /* @__PURE__ */ V(et, {
4150
4197
  themes: a,
4151
4198
  children: [
4152
- o && /* @__PURE__ */ B(xc, {
4199
+ o && /* @__PURE__ */ B(wc, {
4153
4200
  settings: o,
4154
4201
  onSystemSchemeChange: s
4155
4202
  }),
4156
- /* @__PURE__ */ B(ic, {}),
4157
- /* @__PURE__ */ B(Qc, {
4203
+ /* @__PURE__ */ B(sc, {}),
4204
+ /* @__PURE__ */ B(tl, {
4158
4205
  scene: e,
4159
4206
  screen: i.primaryScreen,
4160
4207
  notes: t
@@ -4166,7 +4213,7 @@ function Xc({ scene: e, notes: t, routeState: n, strings: r, navigation: i, them
4166
4213
  locale: r.locale,
4167
4214
  locales: r.locales,
4168
4215
  screen: i.primaryScreen ?? e.screens[0]?.name ?? "",
4169
- children: /* @__PURE__ */ B(Zc, {
4216
+ children: /* @__PURE__ */ B(el, {
4170
4217
  activity: u,
4171
4218
  notesEnabled: t.enabled,
4172
4219
  routesReady: n.ready,
@@ -4176,7 +4223,7 @@ function Xc({ scene: e, notes: t, routeState: n, strings: r, navigation: i, them
4176
4223
  children: /* @__PURE__ */ B(br, {
4177
4224
  structure: e.structure,
4178
4225
  screens: e.screens,
4179
- children: /* @__PURE__ */ B(Fc, {
4226
+ children: /* @__PURE__ */ B(Rc, {
4180
4227
  source: e,
4181
4228
  screen: i.primaryScreen,
4182
4229
  children: c
@@ -4188,12 +4235,12 @@ function Xc({ scene: e, notes: t, routeState: n, strings: r, navigation: i, them
4188
4235
  })
4189
4236
  });
4190
4237
  }
4191
- function Zc({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivity: i, strings: a, children: o }) {
4192
- let s = W(), c = Ue(), l = dn(), u = f(() => Ac(l, n, s.refreshAfterCommand), [
4238
+ function el({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivity: i, strings: a, children: o }) {
4239
+ let s = W(), c = Ue(), l = dn(), u = f(() => Nc(l, n, s.refreshAfterCommand), [
4193
4240
  l,
4194
4241
  n,
4195
4242
  s.refreshAfterCommand
4196
- ]), d = f(() => Oc(r.commandSchemas), [r.commandSchemas]), p = Ne({
4243
+ ]), d = f(() => jc(r.commandSchemas), [r.commandSchemas]), p = Ne({
4197
4244
  executeCommand: async (e, t) => {
4198
4245
  let r = on(e);
4199
4246
  if (!r && !n) return i(`The modeled command “${e}” is waiting for Stage routes.`), {
@@ -4229,7 +4276,7 @@ function Zc({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivit
4229
4276
  refreshQuery: async (e) => s.refreshQuery(e),
4230
4277
  raise: async (e) => i(`The modeled trigger “${e}” is not available in this Stage runtime.`)
4231
4278
  });
4232
- return /* @__PURE__ */ B(Ys, {
4279
+ return /* @__PURE__ */ B(Qs, {
4233
4280
  state: {
4234
4281
  locales: a.locales,
4235
4282
  locale: a.locale,
@@ -4246,7 +4293,7 @@ function Zc({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivit
4246
4293
  context: {
4247
4294
  resolve: s.resolveBinding,
4248
4295
  localize: (e) => a.dictionary[e] ?? e,
4249
- responseContracts: oc(r.responseContracts)
4296
+ responseContracts: lc(r.responseContracts)
4250
4297
  },
4251
4298
  attachments: [],
4252
4299
  onFindings: (e) => i(e.map((e) => e.detail).join(" ")),
@@ -4256,20 +4303,20 @@ function Zc({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivit
4256
4303
  })
4257
4304
  });
4258
4305
  }
4259
- function Qc({ scene: e, screen: t, notes: r }) {
4306
+ function tl({ scene: e, screen: t, notes: r }) {
4260
4307
  return n({
4261
4308
  screen: vr(e.screens.find((e) => e.name === t)),
4262
4309
  values: { modelReferences: r.modelReferences }
4263
4310
  }), null;
4264
4311
  }
4265
- function $c({ element: e, configuration: t, registry: n }) {
4312
+ function nl({ element: e, configuration: t, registry: n }) {
4266
4313
  let r = W(), i = tr(), a = Ve();
4267
4314
  return /* @__PURE__ */ B(xr, {
4268
4315
  screen: a?.primaryScreen,
4269
4316
  children: /* @__PURE__ */ V(pi, {
4270
4317
  element: e,
4271
4318
  outputScope: i.scope,
4272
- children: [/* @__PURE__ */ B(Qo, { element: e }), /* @__PURE__ */ B(xe, {
4319
+ children: [/* @__PURE__ */ B(ts, { element: e }), /* @__PURE__ */ B(xe, {
4273
4320
  element: e,
4274
4321
  registry: n,
4275
4322
  resolveBinding: r.resolveBinding,
@@ -4280,7 +4327,7 @@ function $c({ element: e, configuration: t, registry: n }) {
4280
4327
  })
4281
4328
  });
4282
4329
  }
4283
- function el({ template: e, content: t, registry: n, strings: r, close: i }) {
4330
+ function rl({ template: e, content: t, registry: n, strings: r, close: i }) {
4284
4331
  let a = W(), o = tr(), s = ce(t, r.dictionary);
4285
4332
  return l(() => {
4286
4333
  let e = (e) => {
@@ -4311,4 +4358,4 @@ function el({ template: e, content: t, registry: n, strings: r, close: i }) {
4311
4358
  })
4312
4359
  });
4313
4360
  }
4314
- export { Jc as App, Jc as StageApplication, Oi as StageCommandForm, zn as StageDataProvider, On as StageGuardedAction, Bt as StageSourceProvider, Gc as composeStageScreen, Ac as createStageSliceInvoker, Wn as dataChanged, ln as executeRegisteredCommand, sr as fetchModelReferences, Kt as hostedBasePath, Os as listsPrimeReact, cr as modelReferenceFor, lr as modelReferenceMap, $t as performQuery, Ws as readSandboxActingUser, dr as readStageNotes, Yt as registerQueryRouteResolver, ks as registerStageLibrary, on as registeredCommand, Xt as registeredQuery, Oc as sliceFieldsFrom, zc as stageApplicationRegistry, Uc as stageComposition, e as stageDarkSelector, Rt as stageEndpoints, Vc as stageShellOf, Lt as staticStageSource, en as subscribeQuery, dn as useStageCommandExecutor, W as useStageData, G as useStageQuery, U as useStageSource, Gs as writeSandboxActingUser };
4361
+ export { Zc as App, Zc as StageApplication, Oi as StageCommandForm, zn as StageDataProvider, On as StageGuardedAction, Bt as StageSourceProvider, Jc as composeStageScreen, Nc as createStageSliceInvoker, Wn as dataChanged, ln as executeRegisteredCommand, sr as fetchModelReferences, Kt as hostedBasePath, js as listsPrimeReact, cr as modelReferenceFor, lr as modelReferenceMap, $t as performQuery, qs as readSandboxActingUser, dr as readStageNotes, Yt as registerQueryRouteResolver, Ms as registerStageLibrary, on as registeredCommand, Xt as registeredQuery, jc as sliceFieldsFrom, Hc as stageApplicationRegistry, Kc as stageComposition, e as stageDarkSelector, Rt as stageEndpoints, Wc as stageShellOf, Lt as staticStageSource, en as subscribeQuery, dn as useStageCommandExecutor, W as useStageData, G as useStageQuery, U as useStageSource, Js as writeSandboxActingUser };