@kosdev-code/kos-ui-sdk 0.1.0-dev.5697 → 0.1.0-dev.5698

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/index.js CHANGED
@@ -356,7 +356,7 @@ function Pa(t, e, s) {
356
356
  const d = o(u);
357
357
  if (i.has(d))
358
358
  return;
359
- i.add(d), i.size > 1e3 && Array.from(i).slice(0, 500).forEach((f) => i.delete(f));
359
+ i.add(d), i.size > 1e3 && Array.from(i).slice(0, 500).forEach((p) => i.delete(p));
360
360
  }
361
361
  await e(u);
362
362
  }
@@ -365,8 +365,8 @@ function Pa(t, e, s) {
365
365
  const u = await r(), d = Array.isArray(u) ? u : [u];
366
366
  for (const h of d)
367
367
  if (o) {
368
- const f = o(h);
369
- i.has(f) || (i.add(f), await e(h));
368
+ const p = o(h);
369
+ i.has(p) || (i.add(p), await e(h));
370
370
  } else
371
371
  await e(h);
372
372
  } catch (u) {
@@ -393,7 +393,7 @@ function Ra(t) {
393
393
  return a.data;
394
394
  const h = await en(e, {
395
395
  getCurrentState: o,
396
- shouldUseFetchedState: (f) => !!f,
396
+ shouldUseFetchedState: (p) => !!p,
397
397
  timeout: d
398
398
  });
399
399
  return a.state = "connected", a.data = h, u(), h;
@@ -539,7 +539,7 @@ const pd = [
539
539
  "font-weight: bold"
540
540
  ].join(";"), Ws = (t) => (e) => {
541
541
  C.getLevel() <= t && e();
542
- }, g = {
542
+ }, m = {
543
543
  ...C,
544
544
  ifDebug: Ws(C.levels.DEBUG),
545
545
  ifInfo: Ws(C.levels.INFO),
@@ -567,7 +567,7 @@ const pd = [
567
567
  }
568
568
  }, ne = Symbol("SubscriptionHandlers"), N = Symbol("DependencyModels"), dr = Symbol("FutureService"), yt = Symbol("ChildModels"), hr = Symbol("ParentModel"), fr = Symbol("LogConfig"), vn = Symbol("ReferenceConfig"), Ba = Symbol("KosModelSymbol"), et = Symbol("ModelEffects"), vt = Symbol("CompanionParentModel"), Ha = Symbol("FutureContainerSetup"), qa = Symbol(
569
569
  "MultipleFutureContainerSetup"
570
- ), pr = Symbol("FutureAliases"), za = Symbol("TroubleAwareSetup"), Va = Symbol("LoggerSetup"), Ka = Symbol("ContainerAwareSetup"), Bs = Symbol("StateMachineSetup"), Es = Symbol("StateEntryHandlers"), gr = Symbol("StateExitHandlers"), EM = Symbol("StateActionHandlers"), tn = Symbol("OptionsRequired"), md = Symbol("KosViewModelSymbol"), Ga = Symbol("ViewModelConfig"), yd = Symbol("ReloadAwareSetup"), wo = g.createLogger({ group: "decorators", name: "fsm-injection" });
570
+ ), pr = Symbol("FutureAliases"), za = Symbol("TroubleAwareSetup"), Va = Symbol("LoggerSetup"), Ka = Symbol("ContainerAwareSetup"), Bs = Symbol("StateMachineSetup"), Es = Symbol("StateEntryHandlers"), gr = Symbol("StateExitHandlers"), EM = Symbol("StateActionHandlers"), tn = Symbol("OptionsRequired"), md = Symbol("KosViewModelSymbol"), Ga = Symbol("ViewModelConfig"), yd = Symbol("ReloadAwareSetup"), wo = m.createLogger({ group: "decorators", name: "fsm-injection" });
571
571
  function Ya(t) {
572
572
  const e = t[Bs];
573
573
  if (!e)
@@ -853,7 +853,7 @@ const CM = ({ group: t } = { group: "" }) => (e) => {
853
853
  class Qa {
854
854
  static create({ modelId: e, modelTypeName: s, component: r }) {
855
855
  const n = [r ?? "kos", s, e].filter(Boolean).join(".");
856
- return g.createLogger({ name: n });
856
+ return m.createLogger({ name: n });
857
857
  }
858
858
  }
859
859
  function Kd(t) {
@@ -896,7 +896,7 @@ function Gd(t) {
896
896
  }
897
897
  const DM = (t) => (e, s) => {
898
898
  e[vn] = e[vn] || {}, e[vn][s] = t;
899
- }, wn = g.createLogger({ name: "resolve-parameters" }), be = ({
899
+ }, wn = m.createLogger({ name: "resolve-parameters" }), be = ({
900
900
  value: t,
901
901
  modelId: e,
902
902
  modelData: s
@@ -1014,19 +1014,19 @@ function ts(t) {
1014
1014
  )}`;
1015
1015
  if (e[jt][i] = o, !t.lifecycle) {
1016
1016
  const c = function(...u) {
1017
- const d = u[u.length - 1], h = async (f) => {
1018
- const p = ai.get(c);
1019
- if (!p)
1017
+ const d = u[u.length - 1], h = async (p) => {
1018
+ const f = ai.get(c);
1019
+ if (!f)
1020
1020
  throw new Error("Service request metadata not found for method");
1021
1021
  try {
1022
- const { default: m } = await Promise.resolve().then(() => $o), { resolvedPath: y, apiParams: v, finalBody: _, finalRequestOptions: U } = Yd(
1023
- p,
1022
+ const { default: g } = await Promise.resolve().then(() => $o), { resolvedPath: y, apiParams: v, finalBody: _, finalRequestOptions: U } = Yd(
1023
+ f,
1024
1024
  this,
1025
1025
  u,
1026
- f
1026
+ p
1027
1027
  ), [D, $] = await Wd(
1028
- m,
1029
- p.method,
1028
+ g,
1029
+ f.method,
1030
1030
  y,
1031
1031
  v,
1032
1032
  _,
@@ -1036,23 +1036,23 @@ function ts(t) {
1036
1036
  return Qd(
1037
1037
  D,
1038
1038
  $,
1039
- p.errorHandler,
1039
+ f.errorHandler,
1040
1040
  this
1041
1041
  );
1042
1042
  let L = $;
1043
- return p.transform && (L = p.transform($)), [null, L];
1044
- } catch (m) {
1045
- return [m.message || "Unknown error", null];
1043
+ return f.transform && (L = f.transform($)), [null, L];
1044
+ } catch (g) {
1045
+ return [g.message || "Unknown error", null];
1046
1046
  }
1047
1047
  };
1048
1048
  if (Wa(d))
1049
1049
  return d.$request = h, n.apply(this, u);
1050
1050
  {
1051
- const f = {
1051
+ const p = {
1052
1052
  [Mo]: !0,
1053
1053
  $request: h
1054
1054
  };
1055
- return n.apply(this, [...u, f]);
1055
+ return n.apply(this, [...u, p]);
1056
1056
  }
1057
1057
  };
1058
1058
  ai.set(c, o), r.value = c;
@@ -1061,7 +1061,7 @@ function ts(t) {
1061
1061
  };
1062
1062
  }
1063
1063
  var Zd = /* @__PURE__ */ ((t) => (t.GET = "GET", t.PUT = "PUT", t.POST = "POST", t.DELETE = "DELETE", t))(Zd || {}), he = /* @__PURE__ */ ((t) => (t.IMMEDIATE = "immediate", t.SINGLE = "single", t.TTL = "ttl", t.PERMANENT = "permanent", t.MANUAL = "manual", t))(he || {}), Ft = /* @__PURE__ */ ((t) => (t.ALL = "all", t.AFTER_REQUEST = "after-request", t.AFTER_RESPONSE = "after-response", t.NONE = "none", t))(Ft || {});
1064
- const Xd = g.createLogger({ name: "kos-state-machine" });
1064
+ const Xd = m.createLogger({ name: "kos-state-machine" });
1065
1065
  function xM(t, e) {
1066
1066
  return (s) => (s.prototype[Bs] = {
1067
1067
  config: {
@@ -1221,7 +1221,7 @@ class _o {
1221
1221
  try {
1222
1222
  await this._future.cancelFuture();
1223
1223
  } catch (e) {
1224
- throw g.error(e), e;
1224
+ throw m.error(e), e;
1225
1225
  }
1226
1226
  }
1227
1227
  }
@@ -1353,7 +1353,7 @@ const ue = "canvas-renderer", rh = "kos.declarative.futureLifecycleWrapper", _n
1353
1353
  return await r(e);
1354
1354
  } catch (o) {
1355
1355
  if (n.failurePolicy === "continue") {
1356
- g.error(`Error executing data loader for id ${t}`), g.error(o);
1356
+ m.error(`Error executing data loader for id ${t}`), m.error(o);
1357
1357
  return;
1358
1358
  }
1359
1359
  throw new Mn(t, "dataLoader", o);
@@ -1377,7 +1377,7 @@ const ue = "canvas-renderer", rh = "kos.declarative.futureLifecycleWrapper", _n
1377
1377
  return n(e, s);
1378
1378
  } catch (i) {
1379
1379
  if (o.failurePolicy === "continue")
1380
- return g.error(`Error executing property mapper for id ${t}`), g.error(i), "";
1380
+ return m.error(`Error executing property mapper for id ${t}`), m.error(i), "";
1381
1381
  throw new Mn(t, "propertyMapper", i);
1382
1382
  }
1383
1383
  }
@@ -1401,7 +1401,7 @@ const ue = "canvas-renderer", rh = "kos.declarative.futureLifecycleWrapper", _n
1401
1401
  Object.assign(n, a);
1402
1402
  } catch (a) {
1403
1403
  if (i.failurePolicy === "continue") {
1404
- g.error(`Error executing data mapper for id ${t}`), g.error(a);
1404
+ m.error(`Error executing data mapper for id ${t}`), m.error(a);
1405
1405
  continue;
1406
1406
  }
1407
1407
  throw new Mn(t, "dataMapper", a);
@@ -1412,7 +1412,7 @@ const ue = "canvas-renderer", rh = "kos.declarative.futureLifecycleWrapper", _n
1412
1412
  canvas: {
1413
1413
  registerRenderer: (t, e) => {
1414
1414
  if (!M[ue]) {
1415
- g.warn(
1415
+ m.warn(
1416
1416
  `Canvas renderer extension point is not registered. Cannot register renderer "${t}".`
1417
1417
  );
1418
1418
  return;
@@ -1496,7 +1496,7 @@ class Ja {
1496
1496
  }), Object.keys(s).forEach((n) => {
1497
1497
  const o = s[n], i = this.data[n] || [];
1498
1498
  if (ah(o, i))
1499
- g.debug(`KosContainerIndex - Index ${n} is the same`);
1499
+ m.debug(`KosContainerIndex - Index ${n} is the same`);
1500
1500
  else {
1501
1501
  this.data[n] = o;
1502
1502
  const a = e.get(n) || /* @__PURE__ */ new Set();
@@ -1541,7 +1541,7 @@ function ch(t, e, s = []) {
1541
1541
  )
1542
1542
  );
1543
1543
  }
1544
- const de = g.createLogger({ name: "kos-container-model" });
1544
+ const de = m.createLogger({ name: "kos-container-model" });
1545
1545
  class Ze {
1546
1546
  constructor(e) {
1547
1547
  l(this, "_data");
@@ -1723,13 +1723,13 @@ class Ze {
1723
1723
  const s = this._disposerMap.get(e.id);
1724
1724
  s && (s(), this._disposerMap.delete(e.id));
1725
1725
  const r = Object.entries(this._optionsMap || {}), n = Object.values(this._optionsMap || {}), o = new Map(r.map(([u, d]) => [d, u])), i = (u) => {
1726
- var h, f;
1726
+ var h, p;
1727
1727
  n.includes(u.name) && ((h = this.index.get(o.get(u.name))) == null || h.refresh());
1728
1728
  const d = r.filter(
1729
- ([, p]) => typeof p == "function"
1729
+ ([, f]) => typeof f == "function"
1730
1730
  );
1731
- for (const [p] of d)
1732
- (f = this.index.get(p)) == null || f.refresh();
1731
+ for (const [f] of d)
1732
+ (p = this.index.get(f)) == null || p.refresh();
1733
1733
  }, a = ch(
1734
1734
  e,
1735
1735
  i,
@@ -1925,9 +1925,9 @@ const Te = async (t) => {
1925
1925
  const e = T.getInstance().modelManager.getModelById(t.id);
1926
1926
  e && await e.fsm.transitionTo(k.UNLOAD, b.UNLOADED);
1927
1927
  }, jM = async (t) => {
1928
- await T.getInstance().whenReady(), await T.getInstance().modelManager.reloadModel(t), g.debug(
1928
+ await T.getInstance().whenReady(), await T.getInstance().modelManager.reloadModel(t), m.debug(
1929
1929
  `reload model initiated for model ${t.id}, model ready: ${zn(t)} - ${Date.now()} `
1930
- ), await Te(t), g.debug(
1930
+ ), await Te(t), m.debug(
1931
1931
  `reload model complete for model ${t.id}, model ready: ${zn(t)} - ${Date.now()} `
1932
1932
  );
1933
1933
  }, BM = async (t) => {
@@ -1978,7 +1978,7 @@ const Te = async (t) => {
1978
1978
  }, li = (t, e) => {
1979
1979
  const s = T.getInstance().modelManager.getModelById(t);
1980
1980
  if (!s) {
1981
- g.info(`Model not found for id ${t}`);
1981
+ m.info(`Model not found for id ${t}`);
1982
1982
  return;
1983
1983
  }
1984
1984
  return Array.from(s.companionModels.all()).find(
@@ -1989,7 +1989,7 @@ const Te = async (t) => {
1989
1989
  if (!e)
1990
1990
  throw new Error("Model not found");
1991
1991
  return e.isReady();
1992
- }, hh = g.createLogger({ name: "kos-model-factory" }), mr = {
1992
+ }, hh = m.createLogger({ name: "kos-model-factory" }), mr = {
1993
1993
  byModelType: (t) => T.getInstance().modelManager.getModelFactory(
1994
1994
  t
1995
1995
  ),
@@ -2224,7 +2224,7 @@ class Ne extends ec {
2224
2224
  };
2225
2225
  }
2226
2226
  }
2227
- const Vn = g.createLogger({ group: "decorators", name: "kos-model" });
2227
+ const Vn = m.createLogger({ group: "decorators", name: "kos-model" });
2228
2228
  function gh(t, e, s) {
2229
2229
  var o;
2230
2230
  const r = (o = t[hr]) == null ? void 0 : o.parentId;
@@ -2509,34 +2509,34 @@ function Mh(t, e) {
2509
2509
  "trace",
2510
2510
  "getCompanionParent"
2511
2511
  // Don't override our own getCompanionParent
2512
- ], u = (p) => {
2513
- const m = i.constructor.prototype[ne] || {};
2514
- return Object.values(m).some((y) => {
2512
+ ], u = (f) => {
2513
+ const g = i.constructor.prototype[ne] || {};
2514
+ return Object.values(g).some((y) => {
2515
2515
  const v = y == null ? void 0 : y.handler;
2516
- return v === i[p] || v === i.constructor.prototype[p];
2516
+ return v === i[f] || v === i.constructor.prototype[f];
2517
2517
  });
2518
- }, d = (p) => p === "constructor" || p.startsWith("_") || p.startsWith("__") || a.includes(p) || c.includes(p) || o.includes(p) || u(p) || // Exclude topic handler methods in decorator mode
2519
- p in t, h = /* @__PURE__ */ new Set();
2520
- Object.getOwnPropertyNames(i).filter((p) => !d(p)).forEach((p) => h.add(p));
2521
- let f = Object.getPrototypeOf(i);
2522
- for (; f && f !== Object.prototype; )
2523
- Object.getOwnPropertyNames(f).filter((p) => !d(p)).forEach((p) => h.add(p)), f = Object.getPrototypeOf(f);
2524
- for (const p of h)
2518
+ }, d = (f) => f === "constructor" || f.startsWith("_") || f.startsWith("__") || a.includes(f) || c.includes(f) || o.includes(f) || u(f) || // Exclude topic handler methods in decorator mode
2519
+ f in t, h = /* @__PURE__ */ new Set();
2520
+ Object.getOwnPropertyNames(i).filter((f) => !d(f)).forEach((f) => h.add(f));
2521
+ let p = Object.getPrototypeOf(i);
2522
+ for (; p && p !== Object.prototype; )
2523
+ Object.getOwnPropertyNames(p).filter((f) => !d(f)).forEach((f) => h.add(f)), p = Object.getPrototypeOf(p);
2524
+ for (const f of h)
2525
2525
  try {
2526
- const m = i[p];
2527
- typeof m == "function" ? t[p] = (...y) => m.apply(i, y) : Object.defineProperty(t, p, {
2528
- get: () => i[p],
2526
+ const g = i[f];
2527
+ typeof g == "function" ? t[f] = (...y) => g.apply(i, y) : Object.defineProperty(t, f, {
2528
+ get: () => i[f],
2529
2529
  set: (y) => {
2530
- i[p] = y;
2530
+ i[f] = y;
2531
2531
  },
2532
2532
  enumerable: !0,
2533
2533
  configurable: !0
2534
2534
  // Allow MobX to make this observable
2535
2535
  });
2536
- } catch (m) {
2536
+ } catch (g) {
2537
2537
  Vn.debug(
2538
- `Skipping companion proxy for property ${p}:`,
2539
- m
2538
+ `Skipping companion proxy for property ${f}:`,
2539
+ g
2540
2540
  );
2541
2541
  }
2542
2542
  }
@@ -2571,7 +2571,7 @@ const $h = {
2571
2571
  var c;
2572
2572
  const [s, r = {}] = e, n = J.createContext(s);
2573
2573
  gh(t, s, r);
2574
- const i = !!t.prototype[Va] ? null : g.createLogger({
2574
+ const i = !!t.prototype[Va] ? null : m.createLogger({
2575
2575
  name: t.prototype.modelTypeId,
2576
2576
  group: ((c = t[fr]) == null ? void 0 : c.group) ?? "kos-model"
2577
2577
  }), a = new t(s, r, {
@@ -2585,8 +2585,8 @@ function R(t) {
2585
2585
  return (e) => {
2586
2586
  var o, i;
2587
2587
  const s = e, r = typeof t == "string" ? { modelTypeId: t, autoRegister: !1 } : { autoRegister: !1, ...t };
2588
- s.prototype.modelTypeId = r.modelTypeId, s.prototype[Ba] = !0, (o = s.prototype)[ne] ?? (o[ne] = {}), (i = s.prototype)[N] ?? (i[N] = {}), r.optionsRequired && (s.prototype[tn] = !0), g.ifDebug(() => {
2589
- g.debug(`Registering model with id ${r.modelTypeId}`);
2588
+ s.prototype.modelTypeId = r.modelTypeId, s.prototype[Ba] = !0, (o = s.prototype)[ne] ?? (o[ne] = {}), (i = s.prototype)[N] ?? (i[N] = {}), r.optionsRequired && (s.prototype[tn] = !0), m.ifDebug(() => {
2589
+ m.debug(`Registering model with id ${r.modelTypeId}`);
2590
2590
  });
2591
2591
  const n = new Proxy(s, $h);
2592
2592
  if (r.singleton !== void 0) {
@@ -2665,18 +2665,18 @@ function Ch(t, e) {
2665
2665
  destinationAddress: u,
2666
2666
  debounce: d,
2667
2667
  throttle: h,
2668
- buffer: f,
2669
- filter: p,
2670
- once: m,
2668
+ buffer: p,
2669
+ filter: f,
2670
+ once: g,
2671
2671
  wildcardName: y,
2672
2672
  flow: v,
2673
2673
  requiresBaseline: _
2674
2674
  } = t, U = e.value, D = Dh(U, {
2675
2675
  debounce: d,
2676
2676
  throttle: h,
2677
- buffer: f,
2678
- once: m
2679
- }), $ = xh(p, s);
2677
+ buffer: p,
2678
+ once: g
2679
+ }), $ = xh(f, s);
2680
2680
  return {
2681
2681
  websocket: n,
2682
2682
  fos: o,
@@ -2690,7 +2690,7 @@ function Ch(t, e) {
2690
2690
  wildcardName: y,
2691
2691
  flow: v,
2692
2692
  requiresBaseline: _,
2693
- once: m
2693
+ once: g
2694
2694
  };
2695
2695
  }
2696
2696
  function Dh(t, e) {
@@ -2808,12 +2808,12 @@ function Kh(t, e) {
2808
2808
  return;
2809
2809
  const s = t[et], r = [];
2810
2810
  for (const a of Object.keys(s)) {
2811
- const { value: c, dependencies: u, options: d } = s[a], h = c.bind(t), f = () => {
2811
+ const { value: c, dependencies: u, options: d } = s[a], h = c.bind(t), p = () => {
2812
2812
  Z(() => h());
2813
- }, p = u ? Jt(() => u(t), f, {
2813
+ }, f = u ? Jt(() => u(t), p, {
2814
2814
  fireImmediately: !!(d != null && d.fireImmediately)
2815
- }) : Xt(f);
2816
- r.push(p);
2815
+ }) : Xt(p);
2816
+ r.push(f);
2817
2817
  }
2818
2818
  Object.defineProperty(t, zh, {
2819
2819
  value: r,
@@ -2893,7 +2893,7 @@ const Dn = /* @__PURE__ */ new Map(), tc = {
2893
2893
  clearTimeout(s);
2894
2894
  });
2895
2895
  }
2896
- }, Qh = g.createLogger({ name: "kos-dependency-manager" });
2896
+ }, Qh = m.createLogger({ name: "kos-dependency-manager" });
2897
2897
  class Zh {
2898
2898
  constructor() {
2899
2899
  l(this, "_usedByCache", /* @__PURE__ */ new Map());
@@ -2926,7 +2926,7 @@ class Zh {
2926
2926
  this._usedByCache.clear(), this._usesCache.clear();
2927
2927
  }
2928
2928
  }
2929
- const di = g.createLogger({ name: "kos-model-cache" });
2929
+ const di = m.createLogger({ name: "kos-model-cache" });
2930
2930
  class Xh {
2931
2931
  constructor(e = []) {
2932
2932
  l(this, "_modelsById", te.map(/* @__PURE__ */ new Map()));
@@ -3005,9 +3005,9 @@ function Bt(t, e) {
3005
3005
  );
3006
3006
  }
3007
3007
  function Jh(t, e) {
3008
- t.length !== 0 && (g.error(`${e} - ${t.length} error(s) occurred:`), t.forEach(({ error: s, context: r }, n) => {
3008
+ t.length !== 0 && (m.error(`${e} - ${t.length} error(s) occurred:`), t.forEach(({ error: s, context: r }, n) => {
3009
3009
  const o = s instanceof yr ? s : Bt(s, r);
3010
- g.error(
3010
+ m.error(
3011
3011
  ` [${n + 1}/${t.length}] ${o.toDetailedString()}`
3012
3012
  );
3013
3013
  }));
@@ -3022,7 +3022,7 @@ function hi(t, e) {
3022
3022
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
3023
3023
  });
3024
3024
  }
3025
- const ef = (t) => typeof t == "function", Zs = g.createLogger({ name: "kos-companion-instantiator" });
3025
+ const ef = (t) => typeof t == "function", Zs = m.createLogger({ name: "kos-companion-instantiator" });
3026
3026
  class tf {
3027
3027
  constructor(e, s, r) {
3028
3028
  this.registry = e, this.cache = s, this.createModel = r;
@@ -3204,7 +3204,7 @@ const nc = (t, e, s) => {
3204
3204
  let r;
3205
3205
  return { promise: new Promise((i, a) => {
3206
3206
  r = setTimeout(() => {
3207
- g.error(
3207
+ m.error(
3208
3208
  `Model ${e.modelId} - ${e.modelTypeName} - ${s} timed out after ${t}ms`
3209
3209
  ), a(
3210
3210
  new uf(
@@ -3228,46 +3228,46 @@ const nc = (t, e, s) => {
3228
3228
  return t.filter(br);
3229
3229
  }
3230
3230
  }, hf = (t, e) => {
3231
- var f;
3231
+ var p;
3232
3232
  const s = e.id || e.modelType, r = be({
3233
3233
  value: s,
3234
3234
  modelData: t.modelData,
3235
3235
  modelId: t.modelId
3236
3236
  }), n = e.resolutionPolicy || ht.CREATE;
3237
- g.debug(
3237
+ m.debug(
3238
3238
  `Resolving dependent model ${e.modelType} with id ${r} (policy: ${n})`
3239
3239
  );
3240
- const o = Object.keys((e == null ? void 0 : e.options) || {}).reduce((p, m) => {
3241
- const y = e.options[m];
3242
- return p[m] = be({
3240
+ const o = Object.keys((e == null ? void 0 : e.options) || {}).reduce((f, g) => {
3241
+ const y = e.options[g];
3242
+ return f[g] = be({
3243
3243
  value: y,
3244
3244
  modelData: t.modelData,
3245
3245
  modelId: t.modelId
3246
- }), p;
3246
+ }), f;
3247
3247
  }, {}), i = T.getInstance().modelManager, a = i.registry.models[e.modelType];
3248
3248
  if (!a) {
3249
- const p = `No model registered for type ${e.modelType}`;
3250
- if (g.error(
3249
+ const f = `No model registered for type ${e.modelType}`;
3250
+ if (m.error(
3251
3251
  `Failed to resolve dependency for model ${t.modelId}:
3252
3252
  - Dependency Type: ${e.modelType}
3253
3253
  - Dependency ID: ${r}
3254
3254
  - Resolution Policy: ${n}
3255
3255
  - Parent Model: ${t.modelTypeName}
3256
3256
  - Parent Model ID: ${t.modelId}
3257
- - Error: ${p}`
3257
+ - Error: ${f}`
3258
3258
  ), n === ht.CONTINUE)
3259
- return g.warn(
3259
+ return m.warn(
3260
3260
  `Model type not registered (policy: CONTINUE) - Model ${t.modelId} will continue without dependency ${e.modelType} [${r}]`
3261
3261
  ), { dependentModel: null, dataModelId: r, success: !1 };
3262
3262
  throw new Error(
3263
- `Dependency resolution failed - Model ${t.modelId} cannot resolve dependency ${e.modelType} [${r}]: ${p}`
3263
+ `Dependency resolution failed - Model ${t.modelId} cannot resolve dependency ${e.modelType} [${r}]: ${f}`
3264
3264
  );
3265
3265
  }
3266
3266
  const c = i.getModelById(r);
3267
3267
  if (c) {
3268
3268
  if (c.modelTypeName !== e.modelType) {
3269
- const p = `Model type mismatch: expected ${e.modelType}, found ${c.modelTypeName}`;
3270
- if (g.error(
3269
+ const f = `Model type mismatch: expected ${e.modelType}, found ${c.modelTypeName}`;
3270
+ if (m.error(
3271
3271
  `Failed to resolve dependency for model ${t.modelId}:
3272
3272
  - Dependency Type: ${e.modelType}
3273
3273
  - Dependency ID: ${r}
@@ -3275,16 +3275,16 @@ const nc = (t, e, s) => {
3275
3275
  - Parent Model: ${t.modelTypeName}
3276
3276
  - Parent Model ID: ${t.modelId}
3277
3277
  - Found Model Type: ${c.modelTypeName}
3278
- - Error: ${p}`
3278
+ - Error: ${f}`
3279
3279
  ), n === ht.CONTINUE)
3280
- return g.warn(
3280
+ return m.warn(
3281
3281
  `Model type mismatch (policy: CONTINUE) - Model ${t.modelId} will continue without dependency`
3282
3282
  ), { dependentModel: null, dataModelId: r, success: !1 };
3283
3283
  throw new Error(
3284
- `Dependency resolution failed - Model ${t.modelId} cannot resolve dependency ${e.modelType} [${r}]: ${p}`
3284
+ `Dependency resolution failed - Model ${t.modelId} cannot resolve dependency ${e.modelType} [${r}]: ${f}`
3285
3285
  );
3286
3286
  }
3287
- return g.debug(
3287
+ return m.debug(
3288
3288
  `Found existing dependent model ${e.modelType} with id ${r}`
3289
3289
  ), {
3290
3290
  dependentModel: { model: c, data: c.modelData },
@@ -3292,16 +3292,16 @@ const nc = (t, e, s) => {
3292
3292
  success: !0
3293
3293
  };
3294
3294
  }
3295
- if (g.debug(
3295
+ if (m.debug(
3296
3296
  `Model ${e.modelType} [${r}] does not exist. Applying resolution policy: ${n}`
3297
3297
  ), n === ht.CONTINUE)
3298
- return g.warn(
3298
+ return m.warn(
3299
3299
  `Model ${e.modelType} [${r}] not found (policy: CONTINUE) - Model ${t.modelId} will continue without this dependency`
3300
3300
  ), { dependentModel: null, dataModelId: r, success: !1 };
3301
3301
  const u = Object.keys(o).length > 0, d = a.class || a.create;
3302
- if (((f = d == null ? void 0 : d.prototype) == null ? void 0 : f[tn]) === !0 && !u) {
3303
- const p = `Model ${e.modelType} requires options but none were provided`;
3304
- throw g.error(
3302
+ if (((p = d == null ? void 0 : d.prototype) == null ? void 0 : p[tn]) === !0 && !u) {
3303
+ const f = `Model ${e.modelType} requires options but none were provided`;
3304
+ throw m.error(
3305
3305
  `Failed to resolve dependency for model ${t.modelId}:
3306
3306
  - Dependency Type: ${e.modelType}
3307
3307
  - Dependency ID: ${r}
@@ -3309,24 +3309,24 @@ const nc = (t, e, s) => {
3309
3309
  - Parent Model: ${t.modelTypeName}
3310
3310
  - Parent Model ID: ${t.modelId}
3311
3311
  - Provided Options: ${JSON.stringify(o, null, 2)}
3312
- - Error: ${p}
3312
+ - Error: ${f}
3313
3313
  - Model requires options but dependency declaration provides none`
3314
3314
  ), new Error(
3315
- `Dependency resolution failed - Model ${t.modelId} cannot resolve dependency ${e.modelType} [${r}]: ${p}. Use resolutionPolicy: DependencyResolutionPolicy.CONTINUE if this dependency is optional.`
3315
+ `Dependency resolution failed - Model ${t.modelId} cannot resolve dependency ${e.modelType} [${r}]: ${f}. Use resolutionPolicy: DependencyResolutionPolicy.CONTINUE if this dependency is optional.`
3316
3316
  );
3317
3317
  }
3318
3318
  try {
3319
- const p = T.getInstance().modelManager.createModelInstance(
3319
+ const f = T.getInstance().modelManager.createModelInstance(
3320
3320
  e.modelType,
3321
3321
  r,
3322
3322
  o
3323
3323
  );
3324
- return g.debug(
3324
+ return m.debug(
3325
3325
  `Successfully created dependent model ${e.modelType} with id ${r}`
3326
- ), { dependentModel: p, dataModelId: r, success: !0 };
3327
- } catch (p) {
3328
- const m = p instanceof Error ? p.message : String(p);
3329
- throw g.error(
3326
+ ), { dependentModel: f, dataModelId: r, success: !0 };
3327
+ } catch (f) {
3328
+ const g = f instanceof Error ? f.message : String(f);
3329
+ throw m.error(
3330
3330
  `Failed to create dependency for model ${t.modelId}:
3331
3331
  - Dependency Type: ${e.modelType}
3332
3332
  - Dependency ID: ${r}
@@ -3334,37 +3334,37 @@ const nc = (t, e, s) => {
3334
3334
  - Parent Model: ${t.modelTypeName}
3335
3335
  - Parent Model ID: ${t.modelId}
3336
3336
  - Provided Options: ${JSON.stringify(o, null, 2)}
3337
- - Error: ${m}`
3337
+ - Error: ${g}`
3338
3338
  ), n === ht.FAIL ? new Error(
3339
- `Dependency resolution failed (policy: FAIL) - Model ${t.modelId} cannot resolve dependency ${e.modelType} [${r}]: ${m}`
3340
- ) : p;
3339
+ `Dependency resolution failed (policy: FAIL) - Model ${t.modelId} cannot resolve dependency ${e.modelType} [${r}]: ${g}`
3340
+ ) : f;
3341
3341
  }
3342
3342
  }, ff = (t, e = O.READY) => {
3343
3343
  var n;
3344
3344
  const s = ((n = t.modelData) == null ? void 0 : n[N]) || {};
3345
- return Object.keys(s).length === 0 ? (g.debug(`${t.modelId} has no dependencies. Returning`), []) : Object.keys(s).filter((o) => s[o].lifecycle === e).map((o) => {
3345
+ return Object.keys(s).length === 0 ? (m.debug(`${t.modelId} has no dependencies. Returning`), []) : Object.keys(s).filter((o) => s[o].lifecycle === e).map((o) => {
3346
3346
  const i = s[o], a = hf(t, i);
3347
3347
  if (!a.success || !a.dependentModel)
3348
- return g.debug(
3348
+ return m.debug(
3349
3349
  `Skipping dependency ${i.modelType} with id ${a.dataModelId} - resolution failed with CONTINUE policy`
3350
3350
  ), t.modelData[o] = void 0, null;
3351
3351
  const { dependentModel: c, dataModelId: u } = a;
3352
- t.modelData[o] = c.data, g.debug(
3352
+ t.modelData[o] = c.data, m.debug(
3353
3353
  `waiting for dependent model ${i.modelType} with id ${u} - waiting for WHENREADY`
3354
3354
  );
3355
- const d = async (p, m, y) => {
3355
+ const d = async (f, g, y) => {
3356
3356
  var v;
3357
- await ((v = p.whenReady) == null ? void 0 : v.call(p)), g.debug(`dependent model ${m} with id ${y} - READY`);
3358
- }, { promise: h, cancel: f } = nc(
3357
+ await ((v = f.whenReady) == null ? void 0 : v.call(f)), m.debug(`dependent model ${g} with id ${y} - READY`);
3358
+ }, { promise: h, cancel: p } = nc(
3359
3359
  sc,
3360
3360
  t,
3361
3361
  t.status
3362
3362
  );
3363
3363
  return Promise.race([
3364
3364
  d(c.model, i.modelType, u).then(() => {
3365
- f();
3366
- }).catch((p) => {
3367
- const m = Bt(p, {
3365
+ p();
3366
+ }).catch((f) => {
3367
+ const g = Bt(f, {
3368
3368
  modelType: i.modelType,
3369
3369
  modelId: u,
3370
3370
  parentModel: {
@@ -3374,25 +3374,25 @@ const nc = (t, e, s) => {
3374
3374
  lifecycle: e,
3375
3375
  operation: "dependency whenReady()"
3376
3376
  });
3377
- throw g.error(m.toDetailedString()), f(), m;
3377
+ throw m.error(g.toDetailedString()), p(), g;
3378
3378
  }),
3379
3379
  h
3380
3380
  ]);
3381
3381
  }).filter((o) => !!o);
3382
3382
  }, pf = async (t, e, s, r) => {
3383
- if (g.debug(`Execute lifecycle with ${e.length} models`), e.length === 0) {
3384
- g.debug(`${t.modelId} has no children. Returning`);
3383
+ if (m.debug(`Execute lifecycle with ${e.length} models`), e.length === 0) {
3384
+ m.debug(`${t.modelId} has no children. Returning`);
3385
3385
  return;
3386
3386
  }
3387
3387
  if (!s) {
3388
- g.error(
3388
+ m.error(
3389
3389
  `${t.modelId} is not transitioning with a valid target ${s}`
3390
3390
  );
3391
3391
  return;
3392
3392
  }
3393
3393
  const n = e.map((a) => {
3394
3394
  let c;
3395
- return An[s] && a ? c = An[s](a) : (a || g.error("model is undefined. This shouldn't happen"), An[s] || g.error(
3395
+ return An[s] && a ? c = An[s](a) : (a || m.error("model is undefined. This shouldn't happen"), An[s] || m.error(
3396
3396
  `There is no promise in the Transition Map for ${s}`
3397
3397
  )), {
3398
3398
  promise: c,
@@ -3401,7 +3401,7 @@ const nc = (t, e, s) => {
3401
3401
  type: a == null ? void 0 : a.modelTypeName,
3402
3402
  status: a == null ? void 0 : a.status
3403
3403
  };
3404
- }).filter((a) => a.promise ? a.model ? !0 : (g.error(`No model found ${a.modelId}`), !1) : (g.error(`No promise found ${a.modelId}`), !1)), o = await Promise.allSettled(
3404
+ }).filter((a) => a.promise ? a.model ? !0 : (m.error(`No model found ${a.modelId}`), !1) : (m.error(`No promise found ${a.modelId}`), !1)), o = await Promise.allSettled(
3405
3405
  n.map((a) => {
3406
3406
  var d;
3407
3407
  if (!a.model || !a.status)
@@ -3415,7 +3415,7 @@ const nc = (t, e, s) => {
3415
3415
  (d = a.promise) == null ? void 0 : d.then(() => {
3416
3416
  u();
3417
3417
  }).catch((h) => {
3418
- const f = Bt(h, {
3418
+ const p = Bt(h, {
3419
3419
  modelType: a.type || "unknown",
3420
3420
  modelId: a.modelId,
3421
3421
  parentModel: {
@@ -3425,7 +3425,7 @@ const nc = (t, e, s) => {
3425
3425
  lifecycle: r,
3426
3426
  operation: `transition to ${s}`
3427
3427
  });
3428
- throw g.error(f.toDetailedString()), u(), f;
3428
+ throw m.error(p.toDetailedString()), u(), p;
3429
3429
  }),
3430
3430
  c
3431
3431
  ]);
@@ -3464,9 +3464,9 @@ const nc = (t, e, s) => {
3464
3464
  const r = (await Promise.allSettled(
3465
3465
  ff(t, e)
3466
3466
  )).filter((n) => n.status === "rejected");
3467
- r.length && (g.error(
3467
+ r.length && (m.error(
3468
3468
  `There were ${r.length} failed dependent models on ${e}`
3469
- ), g.error(r));
3469
+ ), m.error(r));
3470
3470
  };
3471
3471
  function mf(t) {
3472
3472
  const e = `KosModel(${t.modelTypeName}:${t.modelId})`;
@@ -3567,22 +3567,22 @@ function yf(t, e, s, r) {
3567
3567
  const d = t[ne] || {}, h = Object.keys(d);
3568
3568
  return h.length === 0 ? { count: 0, data: [] } : {
3569
3569
  count: h.length,
3570
- data: h.map((f) => {
3571
- const p = d[f];
3570
+ data: h.map((p) => {
3571
+ const f = d[p];
3572
3572
  return {
3573
- topic: f,
3574
- websocket: !!p.websocket,
3575
- ...p.lifecycle && { lifecycle: p.lifecycle },
3576
- ...p.fos && { fos: !0 },
3577
- ...p.bridge && { bridge: !0 },
3578
- ...p.destinationAddress && {
3579
- destinationAddress: p.destinationAddress
3573
+ topic: p,
3574
+ websocket: !!f.websocket,
3575
+ ...f.lifecycle && { lifecycle: f.lifecycle },
3576
+ ...f.fos && { fos: !0 },
3577
+ ...f.bridge && { bridge: !0 },
3578
+ ...f.destinationAddress && {
3579
+ destinationAddress: f.destinationAddress
3580
3580
  },
3581
- ...p.wildcardName && {
3582
- wildcardName: p.wildcardName
3581
+ ...f.wildcardName && {
3582
+ wildcardName: f.wildcardName
3583
3583
  },
3584
- ...p.flow && { flow: !0 },
3585
- ...p.requiresBaseline && { requiresBaseline: !0 }
3584
+ ...f.flow && { flow: !0 },
3585
+ ...f.requiresBaseline && { requiresBaseline: !0 }
3586
3586
  };
3587
3587
  })
3588
3588
  };
@@ -3691,7 +3691,7 @@ class wf {
3691
3691
  this.disposers = [];
3692
3692
  }
3693
3693
  }
3694
- const Ef = g.createLogger({ name: "model-active-machine" }), Mf = (t) => {
3694
+ const Ef = m.createLogger({ name: "model-active-machine" }), Mf = (t) => {
3695
3695
  const e = _s(b.INACTIVE, {
3696
3696
  [b.FAILED]: X(
3697
3697
  x(k.GO_ACTIVE, b.ACTIVATING)
@@ -3741,7 +3741,7 @@ const Ef = g.createLogger({ name: "model-active-machine" }), Mf = (t) => {
3741
3741
  e,
3742
3742
  (r) => Ef.debug(r.machine.current)
3743
3743
  ), machine: e };
3744
- }, fi = g.createLogger({ name: "model-online-machine" }), _f = (t) => {
3744
+ }, fi = m.createLogger({ name: "model-online-machine" }), _f = (t) => {
3745
3745
  const e = _s(b.OFFLINE, {
3746
3746
  [b.ONLINE]: X(
3747
3747
  x(
@@ -3792,7 +3792,7 @@ const Ef = g.createLogger({ name: "model-active-machine" }), Mf = (t) => {
3792
3792
  "error",
3793
3793
  b.FAILED,
3794
3794
  V(() => {
3795
- g.error(
3795
+ m.error(
3796
3796
  `Model ${t.modelId} - ${t.modelTypeName} failed to initialize. Transitioning to FAILED state.`
3797
3797
  ), t.status = b.FAILED;
3798
3798
  })
@@ -3897,7 +3897,7 @@ const Ef = g.createLogger({ name: "model-active-machine" }), Mf = (t) => {
3897
3897
  [b.UNLOADED]: X(),
3898
3898
  [b.FAILED]: X()
3899
3899
  });
3900
- }, $f = g.createLogger({ name: "kos-model-lifecycle" }), Sf = (t) => ({ service: Ts(
3900
+ }, $f = m.createLogger({ name: "kos-model-lifecycle" }), Sf = (t) => ({ service: Ts(
3901
3901
  Tf(t),
3902
3902
  (s) => $f.debug(
3903
3903
  `state machine for model ${t.modelId}: ${s.machine.current});`
@@ -4508,7 +4508,7 @@ const Bf = ({
4508
4508
  Hf(e),
4509
4509
  typeof s == "string" ? s : JSON.stringify(s)
4510
4510
  ), n = T.getInstance().transport.socket;
4511
- n ? (g.debug("Sending message", r), n.socket.send(r)) : g.error("socket transport is not initialized");
4511
+ n ? (m.debug("Sending message", r), n.socket.send(r)) : m.error("socket transport is not initialized");
4512
4512
  }, qf = ({
4513
4513
  path: t,
4514
4514
  responseId: e,
@@ -4529,13 +4529,13 @@ const Bf = ({
4529
4529
  Bf(e),
4530
4530
  JSON.stringify(s)
4531
4531
  ), n = T.getInstance().transport.socket;
4532
- n ? n.socket.send(r) : g.error("socket transport is not initialized");
4532
+ n ? n.socket.send(r) : m.error("socket transport is not initialized");
4533
4533
  }, JM = (t, e) => {
4534
4534
  const s = e.responseId ? { status: e.status, data: t } : t, r = $t(
4535
4535
  qf(e),
4536
4536
  JSON.stringify(s)
4537
4537
  ), n = T.getInstance().transport.socket;
4538
- n ? n.socket.send(r) : g.error("socket transport is not initialized");
4538
+ n ? n.socket.send(r) : m.error("socket transport is not initialized");
4539
4539
  }, zf = ({
4540
4540
  topic: t
4541
4541
  }) => {
@@ -4582,7 +4582,7 @@ const Bf = ({
4582
4582
  zf(e),
4583
4583
  JSON.stringify(s)
4584
4584
  ), n = T.getInstance().transport.socket;
4585
- n ? n.socket.send(r) : g.error("socket transport is not initialized");
4585
+ n ? n.socket.send(r) : m.error("socket transport is not initialized");
4586
4586
  }, Gf = ({
4587
4587
  msg: t,
4588
4588
  options: e
@@ -4591,7 +4591,7 @@ const Bf = ({
4591
4591
  Kf(e),
4592
4592
  JSON.stringify(s)
4593
4593
  ), n = T.getInstance().transport.socket;
4594
- n ? n.socket.send(r) : g.error("socket transport is not initialized");
4594
+ n ? n.socket.send(r) : m.error("socket transport is not initialized");
4595
4595
  }, Yf = ({
4596
4596
  msg: t,
4597
4597
  options: e
@@ -4600,14 +4600,14 @@ const Bf = ({
4600
4600
  Vf(e),
4601
4601
  JSON.stringify(s)
4602
4602
  ), n = T.getInstance().transport.socket;
4603
- n ? n.socket.send(r) : g.error("socket transport is not initialized");
4603
+ n ? n.socket.send(r) : m.error("socket transport is not initialized");
4604
4604
  }, pi = (t, e) => {
4605
4605
  try {
4606
4606
  return e ? t.body ?? t : JSON.parse(t.body);
4607
4607
  } catch {
4608
4608
  return t.body || t;
4609
4609
  }
4610
- }, at = g.createLogger({ name: "kos-fetch" }), Wf = process.env.KOS_WS_TIMEOUT ? parseInt(process.env.KOS_WS_TIMEOUT) : 3e4, Qf = () => new Promise((t) => {
4610
+ }, at = m.createLogger({ name: "kos-fetch" }), Wf = process.env.KOS_WS_TIMEOUT ? parseInt(process.env.KOS_WS_TIMEOUT) : 3e4, Qf = () => new Promise((t) => {
4611
4611
  setTimeout(() => {
4612
4612
  t(!0);
4613
4613
  }, 0);
@@ -4639,7 +4639,7 @@ const Bf = ({
4639
4639
  at.debug(`path: ${o}`);
4640
4640
  const i = (e == null ? void 0 : e.timeout) || Wf, a = Jf(e), c = Zf(i), u = e != null && e.signal ? Xf([e.signal, c]) : c, d = await kf(e == null ? void 0 : e.body), h = {};
4641
4641
  d.contentType && (h["content-type"] = d.contentType), d.encoding && (h["content-encoding"] = d.encoding);
4642
- const f = $t(
4642
+ const p = $t(
4643
4643
  a({
4644
4644
  path: o,
4645
4645
  requestId: r,
@@ -4652,17 +4652,17 @@ const Bf = ({
4652
4652
  }),
4653
4653
  d.data
4654
4654
  );
4655
- return new Promise((p, m) => {
4655
+ return new Promise((f, g) => {
4656
4656
  let y = null;
4657
4657
  if (u.aborted) {
4658
4658
  const D = u.reason;
4659
- (D == null ? void 0 : D.name) === "TimeoutError" ? at.error(`Timeout occurred - url: ${t}`) : at.debug(`Request aborted - url: ${t}`), m(D || new DOMException("Aborted", "AbortError"));
4659
+ (D == null ? void 0 : D.name) === "TimeoutError" ? at.error(`Timeout occurred - url: ${t}`) : at.debug(`Request aborted - url: ${t}`), g(D || new DOMException("Aborted", "AbortError"));
4660
4660
  return;
4661
4661
  }
4662
4662
  const v = () => {
4663
4663
  y && y();
4664
4664
  const D = u.reason;
4665
- (D == null ? void 0 : D.name) === "TimeoutError" ? at.error(`Timeout occurred - url: ${t}`) : at.debug(`Request aborted - url: ${t}`), m(D || new DOMException("Aborted", "AbortError"));
4665
+ (D == null ? void 0 : D.name) === "TimeoutError" ? at.error(`Timeout occurred - url: ${t}`) : at.debug(`Request aborted - url: ${t}`), g(D || new DOMException("Aborted", "AbortError"));
4666
4666
  };
4667
4667
  u.addEventListener("abort", v, { once: !0 });
4668
4668
  const _ = I(r, (D) => {
@@ -4727,13 +4727,13 @@ const Bf = ({
4727
4727
  },
4728
4728
  bodyUsed: !1
4729
4729
  };
4730
- _.unsubscribe(), Qf().then(() => p(us));
4730
+ _.unsubscribe(), Qf().then(() => f(us));
4731
4731
  });
4732
4732
  y = _.unsubscribe;
4733
4733
  const U = e != null && e.fos ? s.fosSocket : s.socket;
4734
4734
  if (!U)
4735
4735
  throw Error(`No web socket transport available: ${e}`);
4736
- U == null || U.send(f);
4736
+ U == null || U.send(p);
4737
4737
  });
4738
4738
  };
4739
4739
  let we = "kos:", Ue = ep;
@@ -4741,7 +4741,7 @@ if (process.env.KOS_MOCK_FETCH === "true") {
4741
4741
  const t = process.env.KOS_PORT || "9999";
4742
4742
  Ue = fetch, we = `http://localhost:${t}`;
4743
4743
  }
4744
- const tp = () => ({ isMock: !1, URL: we }), Js = g.createLogger({ name: "kos-service-request" }), gi = "errUnknown";
4744
+ const tp = () => ({ isMock: !1, URL: we }), Js = m.createLogger({ name: "kos-service-request" }), gi = "errUnknown";
4745
4745
  async function er(t, e, s, r, n) {
4746
4746
  const o = r != null && r.path ? Object.keys(r.path).reduce(
4747
4747
  (u, d) => String(u).replace(`{${d}}`, r == null ? void 0 : r.path[d]),
@@ -4788,7 +4788,7 @@ function ot() {
4788
4788
  const je = ot(), $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4789
4789
  __proto__: null,
4790
4790
  default: je
4791
- }, Symbol.toStringTag, { value: "Module" })), ut = g.createLogger({
4791
+ }, Symbol.toStringTag, { value: "Module" })), ut = m.createLogger({
4792
4792
  name: "kos-service-request-manager",
4793
4793
  group: "Model"
4794
4794
  });
@@ -5265,10 +5265,10 @@ class fp {
5265
5265
  for (this.enqueueEvent(u); this.eventQueue.length > 0; ) {
5266
5266
  const d = this.dequeueEvent();
5267
5267
  d && o.push(d);
5268
- const f = Date.now() - i;
5269
- if (o.length >= r || f >= n) {
5270
- const p = await a();
5271
- p !== void 0 && (yield p);
5268
+ const p = Date.now() - i;
5269
+ if (o.length >= r || p >= n) {
5270
+ const f = await a();
5271
+ f !== void 0 && (yield f);
5272
5272
  break;
5273
5273
  }
5274
5274
  }
@@ -5276,8 +5276,8 @@ class fp {
5276
5276
  o.push(u);
5277
5277
  const h = Date.now() - i;
5278
5278
  if (o.length >= r || h >= n) {
5279
- const f = await a();
5280
- f !== void 0 && (yield f);
5279
+ const p = await a();
5280
+ p !== void 0 && (yield p);
5281
5281
  }
5282
5282
  }
5283
5283
  const c = await a();
@@ -5417,7 +5417,7 @@ const Ie = class Ie {
5417
5417
  ), this.socket.onmessage = this.onMessage.bind(this), this.socket.onopen = this.onOpen.bind(this), this.socket.onclose = this.onClose.bind(this), this.socket.onerror = this.onError.bind(this), this.oldSend = this.socket.send, this.connectionEstablished = !1, I("/mock/msg/receive", (c) => {
5418
5418
  var u, d;
5419
5419
  if (c != null && c.body) {
5420
- g.wsReceive(c == null ? void 0 : c.body);
5420
+ m.wsReceive(c == null ? void 0 : c.body);
5421
5421
  const h = {
5422
5422
  data: c.body
5423
5423
  };
@@ -5436,9 +5436,9 @@ const Ie = class Ie {
5436
5436
  }
5437
5437
  onMessage(e) {
5438
5438
  try {
5439
- g.debug("webSocketTransport: onMessage received");
5439
+ m.debug("webSocketTransport: onMessage received");
5440
5440
  const { headers: s, body: r } = this.processMessageEvent(e);
5441
- g.wsReceive(e.data);
5441
+ m.wsReceive(e.data);
5442
5442
  const n = s.subscription || s[this.RESPONSE_ID_HEADER] || s.topic || s.type;
5443
5443
  if (n) {
5444
5444
  let o = r, i = s;
@@ -5452,26 +5452,26 @@ const Ie = class Ie {
5452
5452
  H(n, o, i);
5453
5453
  }
5454
5454
  } catch (s) {
5455
- g.error("onMessage exception", s.message, s.stack);
5455
+ m.error("onMessage exception", s.message, s.stack);
5456
5456
  }
5457
5457
  }
5458
5458
  onOpen(e) {
5459
- g.info("websocket connection opened"), this.reconnectAttempts = 0, this.socket = e.currentTarget, Z(() => {
5459
+ m.info("websocket connection opened"), this.reconnectAttempts = 0, this.socket = e.currentTarget, Z(() => {
5460
5460
  var s;
5461
5461
  this.connectionEstablished = !0, this.alias && this.socket.send(`type:kos.addr.alias
5462
5462
  alias:${this.alias}
5463
5463
 
5464
- `), g.debug(
5464
+ `), m.debug(
5465
5465
  `sending ${this.offlineMessages.length} offline FOS messages`
5466
5466
  ), this.offlineMessages.forEach((r) => {
5467
5467
  var n;
5468
- g.debug(`sending offline message ${r.msg}`), (n = this.socket) == null || n.send(r.msg);
5468
+ m.debug(`sending offline message ${r.msg}`), (n = this.socket) == null || n.send(r.msg);
5469
5469
  }), this.offlineMessages = [], (s = this.onConnectionEstablished) == null || s.call(this);
5470
5470
  });
5471
5471
  }
5472
5472
  onClose(e) {
5473
5473
  const { code: s, reason: r, wasClean: n } = e;
5474
- g.warn(
5474
+ m.warn(
5475
5475
  `WebSocket closed: code=${s}, reason=${r || "none"}, wasClean=${n}`
5476
5476
  ), Z(() => {
5477
5477
  this.connectionEstablished = !1;
@@ -5480,23 +5480,23 @@ alias:${this.alias}
5480
5480
  if (this.onConnectionLost)
5481
5481
  if (o && this.reconnectAttempts < Ie.MAX_RECONNECT_ATTEMPTS) {
5482
5482
  const i = this.calculateBackoffDelay();
5483
- g.debug(
5483
+ m.debug(
5484
5484
  `Reconnecting in ${i}ms (attempt ${this.reconnectAttempts + 1}/${Ie.MAX_RECONNECT_ATTEMPTS})`
5485
5485
  ), setTimeout(() => {
5486
5486
  var a;
5487
5487
  this.reconnectAttempts++, (a = this.onConnectionLost) == null || a.call(this);
5488
5488
  }, i);
5489
5489
  } else
5490
- this.reconnectAttempts >= Ie.MAX_RECONNECT_ATTEMPTS ? (g.error(
5490
+ this.reconnectAttempts >= Ie.MAX_RECONNECT_ATTEMPTS ? (m.error(
5491
5491
  `Max reconnection attempts (${Ie.MAX_RECONNECT_ATTEMPTS}) reached. Giving up.`
5492
5492
  ), H("websocket.max_retries_exceeded", {
5493
5493
  attempts: this.reconnectAttempts
5494
- })) : g.info(
5494
+ })) : m.info(
5495
5495
  `Not reconnecting due to close code ${s} (intentional close or configuration error)`
5496
5496
  );
5497
5497
  }
5498
5498
  onError(e) {
5499
- g.error("websocket error: ", e), H("websocket.error", { event: e });
5499
+ m.error("websocket error: ", e), H("websocket.error", { event: e });
5500
5500
  }
5501
5501
  /**
5502
5502
  * Determines whether to attempt reconnection based on WebSocket close code.
@@ -5553,7 +5553,7 @@ alias:${this.alias}
5553
5553
  }
5554
5554
  send(e) {
5555
5555
  var s, r;
5556
- if (g.wsSend(e), window.kosLogEvents) {
5556
+ if (m.wsSend(e), window.kosLogEvents) {
5557
5557
  const { headers: n, body: o } = yi(String(e));
5558
5558
  H(Zr.SEND, { headers: n, body: o });
5559
5559
  }
@@ -5689,9 +5689,9 @@ class bi {
5689
5689
  onConnectionEstablished: i,
5690
5690
  onConnectionLost: a
5691
5691
  }) {
5692
- return g.debug("initializing websocket connection"), g.warn(
5692
+ return m.debug("initializing websocket connection"), m.warn(
5693
5693
  `kosWindowWebsocketOpen: ${globalThis.kosWindowWebsocketOpen ? "true" : "false"}`
5694
- ), g.warn(`fos: ${n ? "true" : "false"}`), window.kosMockWs || globalThis.kosWindowWebsocketOpen && !n ? (g.warn("Using bridged message transport"), new yp({
5694
+ ), m.warn(`fos: ${n ? "true" : "false"}`), window.kosMockWs || globalThis.kosWindowWebsocketOpen && !n ? (m.warn("Using bridged message transport"), new yp({
5695
5695
  host: e,
5696
5696
  port: s,
5697
5697
  protocol: r,
@@ -5766,7 +5766,7 @@ class Is {
5766
5766
  }
5767
5767
  init() {
5768
5768
  var e, s;
5769
- if (g.warn(`Initializing WebSocketTransport on ${this.host}:${this.port}`), this.useFosTransport && (this.fosSocket = bi.build({
5769
+ if (m.warn(`Initializing WebSocketTransport on ${this.host}:${this.port}`), this.useFosTransport && (this.fosSocket = bi.build({
5770
5770
  host: this.host,
5771
5771
  port: this.fosPort || 9854,
5772
5772
  protocol: this.protocol,
@@ -5791,9 +5791,9 @@ class Is {
5791
5791
  return this;
5792
5792
  }
5793
5793
  _sendSubscriptionMessage(e, s, r = !1, n = !1, o) {
5794
- var f, p, m, y;
5794
+ var p, f, g, y;
5795
5795
  ct.debug(`${s} to topic ${e}`);
5796
- const i = $e(), a = i == null ? void 0 : i.connId, c = o ?? a ?? ((f = window == null ? void 0 : window.kosBridge) == null ? void 0 : f.call(window, "connId"));
5796
+ const i = $e(), a = i == null ? void 0 : i.connId, c = o ?? a ?? ((p = window == null ? void 0 : window.kosBridge) == null ? void 0 : p.call(window, "connId"));
5797
5797
  ct.debug(`subscribing with connId ${c}`);
5798
5798
  const u = c ? `dst-addr:${c}
5799
5799
  ` : "", d = r ? `subscribe:${e}` : n ? `type:fos.broker
@@ -5802,7 +5802,7 @@ ${u}topics:${e}
5802
5802
  ` : `${u}type:kos.broker.${s}
5803
5803
 
5804
5804
  ["${e}"]`;
5805
- if (r ? (p = this.fosSocket) == null ? void 0 : p.connectionEstablished : (m = this.socket) == null ? void 0 : m.connectionEstablished) {
5805
+ if (r ? (f = this.fosSocket) == null ? void 0 : f.connectionEstablished : (g = this.socket) == null ? void 0 : g.connectionEstablished) {
5806
5806
  const v = r ? this.fosSocket : this.socket;
5807
5807
  (y = v == null ? void 0 : v.socket) == null || y.send(d);
5808
5808
  } else {
@@ -5973,42 +5973,42 @@ class Mp {
5973
5973
  }
5974
5974
  createHandler(e, s) {
5975
5975
  return async (r) => {
5976
- var n;
5976
+ var n, o;
5977
5977
  try {
5978
- const o = (n = r == null ? void 0 : r.headers) == null ? void 0 : n["src-addr"], i = s.destinationAddress && this.resolvePropKey(s.destinationAddress), a = i ? o === i : !0, c = this.extractWildcardCapture(
5978
+ const i = (n = r == null ? void 0 : r.headers) == null ? void 0 : n["src-alias"], a = (o = r == null ? void 0 : r.headers) == null ? void 0 : o["src-addr"], c = s.destinationAddress && this.resolvePropKey(s.destinationAddress), u = c ? !!(i && i === c || a === c) : !0, d = this.extractWildcardCapture(
5979
5979
  e,
5980
5980
  r,
5981
5981
  s
5982
- ), u = this.isBaselineReady(e);
5983
- if (!this.model.isReady() || !u) {
5984
- u ? this.log.warn(
5982
+ ), h = this.isBaselineReady(e);
5983
+ if (!this.model.isReady() || !h) {
5984
+ h ? this.log.warn(
5985
5985
  `Model ${this.modelId} not ready. Queuing message for ${e}`
5986
5986
  ) : this.log.warn(
5987
5987
  `Baseline not ready for ${e}. Queuing message.`
5988
5988
  );
5989
- const d = () => {
5990
- const h = pi(r, s.skipParse), f = s.transform(h);
5991
- if (a && s.condition(f, this.modelData, r))
5989
+ const p = () => {
5990
+ const f = pi(r, s.skipParse), g = s.transform(f);
5991
+ if (u && s.condition(g, this.modelData, r))
5992
5992
  return this.callHandlerWithWildcard(
5993
5993
  s,
5994
- f,
5995
- c,
5994
+ g,
5995
+ d,
5996
5996
  r
5997
5997
  );
5998
5998
  };
5999
- this.offlineQueue.enqueue(d, e, r);
5999
+ this.offlineQueue.enqueue(p, e, r);
6000
6000
  } else {
6001
- const d = pi(r, s.skipParse), h = s.transform(d);
6002
- if (a && s.condition(h, this.modelData, r))
6001
+ const p = pi(r, s.skipParse), f = s.transform(p);
6002
+ if (u && s.condition(f, this.modelData, r))
6003
6003
  return this.callHandlerWithWildcard(
6004
6004
  s,
6005
- h,
6006
- c,
6005
+ f,
6006
+ d,
6007
6007
  r
6008
6008
  );
6009
6009
  }
6010
- } catch (o) {
6011
- this.log.error(`Error handling subscription for ${e}`, o);
6010
+ } catch (i) {
6011
+ this.log.error(`Error handling subscription for ${e}`, i);
6012
6012
  }
6013
6013
  };
6014
6014
  }
@@ -6525,13 +6525,13 @@ class xp {
6525
6525
  n,
6526
6526
  Dt(o, "effect")
6527
6527
  )), Tp(n)) {
6528
- const f = Dt(o, "subscription");
6528
+ const p = Dt(o, "subscription");
6529
6529
  h.subscriptionManager = new Mp(
6530
6530
  e,
6531
6531
  n,
6532
6532
  s,
6533
6533
  a,
6534
- f
6534
+ p
6535
6535
  ), h.onlineLifecycleManager = new Cf(
6536
6536
  e,
6537
6537
  Dt(o, "online")
@@ -6750,13 +6750,13 @@ class Pp {
6750
6750
  this._isLoadExecuting = !0;
6751
6751
  try {
6752
6752
  F.debug(`Loading model ${s} with id ${r}`), await Xs(this, O.LOAD);
6753
- const d = J.getContext(r), h = `${Ap}.${s}`, f = await M.loader.executeLoader(
6753
+ const d = J.getContext(r), h = `${Ap}.${s}`, p = await M.loader.executeLoader(
6754
6754
  h,
6755
6755
  {}
6756
6756
  );
6757
- f && (F.info(
6757
+ p && (F.info(
6758
6758
  `Setting loaded context for ${r}, type: ${s}`
6759
- ), d == null || d.set(h, f)), await ((n = this.serviceRequestManager) == null ? void 0 : n.executeForLifecycle(
6759
+ ), d == null || d.set(h, p)), await ((n = this.serviceRequestManager) == null ? void 0 : n.executeForLifecycle(
6760
6760
  O.LOAD
6761
6761
  )), await ((i = (o = this.modelData) == null ? void 0 : o.load) == null ? void 0 : i.call(o, d)), ae(() => {
6762
6762
  this.loaded = !0;
@@ -6853,7 +6853,7 @@ class Pp {
6853
6853
  this.companionManager.clear();
6854
6854
  }
6855
6855
  }
6856
- const Pn = g.createLogger({ name: "kos-model-instantiator" });
6856
+ const Pn = m.createLogger({ name: "kos-model-instantiator" });
6857
6857
  class Rp {
6858
6858
  constructor(e, s) {
6859
6859
  l(this, "companionInstantiator");
@@ -6904,12 +6904,12 @@ class Rp {
6904
6904
  });
6905
6905
  }
6906
6906
  try {
6907
- const h = n.create ? n.create({ modelTypeId: e, id: o, options: r }) : new n.class(o, r), f = new Pp({
6907
+ const h = n.create ? n.create({ modelTypeId: e, id: o, options: r }) : new n.class(o, r), p = new Pp({
6908
6908
  modelTypeName: e,
6909
6909
  id: o,
6910
6910
  modelData: h
6911
6911
  });
6912
- this.cache.addModel(f), this._createCompanionModels(f, r);
6912
+ this.cache.addModel(p), this._createCompanionModels(p, r);
6913
6913
  } catch (h) {
6914
6914
  throw hi(h, {
6915
6915
  modelType: e,
@@ -6983,7 +6983,7 @@ let kp = class {
6983
6983
  return zs(e);
6984
6984
  }
6985
6985
  };
6986
- const Lp = 10, Ei = g.createLogger({ name: "kos-model-manager" });
6986
+ const Lp = 10, Ei = m.createLogger({ name: "kos-model-manager" });
6987
6987
  class Fp {
6988
6988
  constructor() {
6989
6989
  l(this, "cache");
@@ -7403,7 +7403,7 @@ const Np = (t) => {
7403
7403
  r,
7404
7404
  (o) => C.debug(o.machine.current)
7405
7405
  ), online: s };
7406
- }, Q = g.createLogger({ name: "kos-core" }), Up = () => {
7406
+ }, Q = m.createLogger({ name: "kos-core" }), Up = () => {
7407
7407
  const t = $e(), e = t == null ? void 0 : t.alias, s = process.env.KOS_CONNECTION_ALIAS;
7408
7408
  return e || s || void 0;
7409
7409
  }, jp = () => {
@@ -7434,9 +7434,9 @@ const Np = (t) => {
7434
7434
  let s;
7435
7435
  return { promise: new Promise((o, i) => {
7436
7436
  s = setTimeout(() => {
7437
- e ? g.error(
7437
+ e ? m.error(
7438
7438
  `Model ${e.modelId} - ${e.modelTypeName} preloading - timed out after ${t}ms`
7439
- ) : g.error(`KOS Core preloading timed out after ${t}ms`), i(
7439
+ ) : m.error(`KOS Core preloading timed out after ${t}ms`), i(
7440
7440
  new Error(
7441
7441
  `Model ${e == null ? void 0 : e.modelId} - ${e == null ? void 0 : e.modelTypeName} - timed out after ${t}ms`
7442
7442
  )
@@ -7583,21 +7583,21 @@ class T {
7583
7583
  var i, a, c;
7584
7584
  const n = this.getInstance({ reset: s, connectionAlias: r });
7585
7585
  (i = e.extensions) != null && i.dataMapper && Object.keys(e.extensions.dataMapper).forEach((u) => {
7586
- var h, f;
7587
- const d = (f = (h = e.extensions) == null ? void 0 : h.dataMapper) == null ? void 0 : f[u];
7588
- d && (Array.isArray(d) ? d.forEach((p) => {
7589
- M.dataMapper.registerDataMapper(u, p);
7586
+ var h, p;
7587
+ const d = (p = (h = e.extensions) == null ? void 0 : h.dataMapper) == null ? void 0 : p[u];
7588
+ d && (Array.isArray(d) ? d.forEach((f) => {
7589
+ M.dataMapper.registerDataMapper(u, f);
7590
7590
  }) : M.dataMapper.registerDataMapper(u, d));
7591
7591
  }), (a = e.extensions) != null && a.propertyMapper && Object.keys(e.extensions.propertyMapper).forEach((u) => {
7592
- var h, f;
7593
- const d = (f = (h = e.extensions) == null ? void 0 : h.propertyMapper) == null ? void 0 : f[u];
7592
+ var h, p;
7593
+ const d = (p = (h = e.extensions) == null ? void 0 : h.propertyMapper) == null ? void 0 : p[u];
7594
7594
  d && M.propertyMapper.registerPropertyMapper(
7595
7595
  u,
7596
7596
  d
7597
7597
  );
7598
7598
  }), (c = e.extensions) != null && c.contextLoader && Object.keys(e.extensions.contextLoader).forEach((u) => {
7599
- var h, f;
7600
- const d = (f = (h = e.extensions) == null ? void 0 : h.contextLoader) == null ? void 0 : f[u];
7599
+ var h, p;
7600
+ const d = (p = (h = e.extensions) == null ? void 0 : h.contextLoader) == null ? void 0 : p[u];
7601
7601
  d && M.loader.registerLoader(u, d);
7602
7602
  }), A.model.getAll().forEach(([, u]) => {
7603
7603
  e.models = { ...e.models, ...u.registration };
@@ -7607,15 +7607,15 @@ class T {
7607
7607
  }, A.companion.getAll().forEach(([u, d]) => {
7608
7608
  e.companionModels = { ...e.companionModels }, e.companionModels[u] = e.companionModels[u] || [];
7609
7609
  for (const h of d) {
7610
- let f;
7610
+ let p;
7611
7611
  if (typeof h == "string") {
7612
- const p = e.models[h];
7613
- if (p != null && p.class) {
7614
- const m = p.class.prototype[vt];
7615
- f = m == null ? void 0 : m.lifecycle;
7612
+ const f = e.models[h];
7613
+ if (f != null && f.class) {
7614
+ const g = f.class.prototype[vt];
7615
+ p = g == null ? void 0 : g.lifecycle;
7616
7616
  }
7617
7617
  }
7618
- e.companionModels[u].push({ type: h, lifecycle: f });
7618
+ e.companionModels[u].push({ type: h, lifecycle: p });
7619
7619
  }
7620
7620
  }), A.model.getPreloadModels().forEach((u) => {
7621
7621
  e.preloadModels.includes(u) || e.preloadModels.push(u);
@@ -7628,7 +7628,7 @@ class T {
7628
7628
  }
7629
7629
  }
7630
7630
  l(T, "_instance");
7631
- const Kp = g.createLogger({
7631
+ const Kp = m.createLogger({
7632
7632
  name: "kos-model-visitor",
7633
7633
  group: "kos-ui-core"
7634
7634
  });
@@ -7889,7 +7889,7 @@ qs(eg, {
7889
7889
  const s = sr.get(t);
7890
7890
  if (!s)
7891
7891
  return [];
7892
- const r = s.map((a) => a(e)), o = (await Promise.allSettled(r)).map((a) => a.status === "fulfilled" ? a.value : (g.info(`Feature flag resolver ${t} failed: ${a.reason}`), [])).flat(), i = Array.from(new Set(o)).reduce(
7892
+ const r = s.map((a) => a(e)), o = (await Promise.allSettled(r)).map((a) => a.status === "fulfilled" ? a.value : (m.info(`Feature flag resolver ${t} failed: ${a.reason}`), [])).flat(), i = Array.from(new Set(o)).reduce(
7893
7893
  (a, c) => (a[c] = !0, a),
7894
7894
  {}
7895
7895
  );
@@ -8000,7 +8000,7 @@ const h_ = async (t, e) => {
8000
8000
  }), u = r ?? 3e3, d = window.setInterval(() => {
8001
8001
  let y = performance.now() - a;
8002
8002
  y = y / 1e3, y > u / 1e3 && i.abort();
8003
- }, u), h = n ?? 2e3, f = window.setInterval(() => {
8003
+ }, u), h = n ?? 2e3, p = window.setInterval(() => {
8004
8004
  Gf({
8005
8005
  msg: {},
8006
8006
  options: {
@@ -8008,12 +8008,12 @@ const h_ = async (t, e) => {
8008
8008
  destinationAddress: e
8009
8009
  }
8010
8010
  });
8011
- }, h), p = () => {
8012
- window.clearInterval(f), window.clearInterval(d), c();
8013
- }, m = () => {
8014
- p(), s && s(), i.signal.removeEventListener("abort", m);
8011
+ }, h), f = () => {
8012
+ window.clearInterval(p), window.clearInterval(d), c();
8013
+ }, g = () => {
8014
+ f(), s && s(), i.signal.removeEventListener("abort", g);
8015
8015
  };
8016
- return i.signal.addEventListener("abort", m), { cleanUpHeartbeat: p };
8016
+ return i.signal.addEventListener("abort", g), { cleanUpHeartbeat: f };
8017
8017
  }, cg = (...t) => (e) => t.reduce((s, r) => r(s), e), lg = {
8018
8018
  maxAttempts: 5,
8019
8019
  baseDelayMs: 100,
@@ -8027,14 +8027,14 @@ async function m_(t, e) {
8027
8027
  try {
8028
8028
  return await t();
8029
8029
  } catch (c) {
8030
- if (g.error(`Attempt ${s} failed: ${c}`), s < n)
8030
+ if (m.error(`Attempt ${s} failed: ${c}`), s < n)
8031
8031
  a = o * Math.pow(i, s), await new Promise((u) => setTimeout(u, a)), s++;
8032
8032
  else
8033
8033
  throw c;
8034
8034
  }
8035
8035
  throw new Error("All attempts failed");
8036
8036
  }
8037
- const ug = g.createLogger({ name: "kos-service-request" }), Ee = (t) => ({ isMock: !1, URL: we }), dg = (t, e, s) => async ({
8037
+ const ug = m.createLogger({ name: "kos-service-request" }), Ee = (t) => ({ isMock: !1, URL: we }), dg = (t, e, s) => async ({
8038
8038
  id: r,
8039
8039
  tracker: n,
8040
8040
  urlOverride: o,
@@ -8044,35 +8044,35 @@ const ug = g.createLogger({ name: "kos-service-request" }), Ee = (t) => ({ isMoc
8044
8044
  bridge: u,
8045
8045
  timeout: d,
8046
8046
  signal: h,
8047
- destinationAddress: f
8047
+ destinationAddress: p
8048
8048
  }) => {
8049
- const p = {
8049
+ const f = {
8050
8050
  method: "DELETE"
8051
8051
  };
8052
- t && (p.destinationAddress = t), n && (p.tracker = n), rs(p, {
8052
+ t && (f.destinationAddress = t), n && (f.tracker = n), rs(f, {
8053
8053
  ordered: i,
8054
8054
  studio: a,
8055
8055
  fos: c,
8056
8056
  bridge: u,
8057
8057
  timeout: d,
8058
8058
  signal: h,
8059
- destinationAddress: f
8059
+ destinationAddress: p
8060
8060
  });
8061
8061
  try {
8062
- const m = await s(o || `${e}/${r}`, p);
8063
- if (!m.ok)
8062
+ const g = await s(o || `${e}/${r}`, f);
8063
+ if (!g.ok)
8064
8064
  throw Error(
8065
- `There was a problem deleting the model; returned status ${m.status}`
8065
+ `There was a problem deleting the model; returned status ${g.status}`
8066
8066
  );
8067
- return await m.json() ?? void 0;
8068
- } catch (m) {
8069
- if (m instanceof DOMException) {
8070
- if (m.name === "TimeoutError")
8067
+ return await g.json() ?? void 0;
8068
+ } catch (g) {
8069
+ if (g instanceof DOMException) {
8070
+ if (g.name === "TimeoutError")
8071
8071
  throw new G("Request timed out while deleting model");
8072
- if (m.name === "AbortError")
8072
+ if (g.name === "AbortError")
8073
8073
  throw new G("Request was cancelled while deleting model");
8074
8074
  }
8075
- throw m;
8075
+ throw g;
8076
8076
  }
8077
8077
  }, rs = (t, {
8078
8078
  ordered: e,
@@ -8104,29 +8104,29 @@ const ug = g.createLogger({ name: "kos-service-request" }), Ee = (t) => ({ isMoc
8104
8104
  signal: u,
8105
8105
  destinationAddress: d
8106
8106
  });
8107
- const f = r || e;
8107
+ const p = r || e;
8108
8108
  try {
8109
- const p = await s(f, h);
8110
- if (!p.ok) {
8109
+ const f = await s(p, h);
8110
+ if (!f.ok) {
8111
8111
  let y;
8112
8112
  try {
8113
- y = await p.json();
8113
+ y = await f.json();
8114
8114
  } catch {
8115
8115
  }
8116
8116
  throw new G(
8117
- `There was a problem retrieving the model; returned status ${p.status}`,
8117
+ `There was a problem retrieving the model; returned status ${f.status}`,
8118
8118
  y ?? void 0
8119
8119
  );
8120
8120
  }
8121
- return await p.json() ?? void 0;
8122
- } catch (p) {
8123
- if (p instanceof DOMException) {
8124
- if (p.name === "TimeoutError")
8121
+ return await f.json() ?? void 0;
8122
+ } catch (f) {
8123
+ if (f instanceof DOMException) {
8124
+ if (f.name === "TimeoutError")
8125
8125
  throw new G("Request timed out while retrieving models");
8126
- if (p.name === "AbortError")
8126
+ if (f.name === "AbortError")
8127
8127
  throw new G("Request was cancelled while retrieving models");
8128
8128
  }
8129
- throw p;
8129
+ throw f;
8130
8130
  }
8131
8131
  }, fg = (t, e, s) => async ({
8132
8132
  urlOverride: r,
@@ -8139,10 +8139,10 @@ const ug = g.createLogger({ name: "kos-service-request" }), Ee = (t) => ({ isMoc
8139
8139
  signal: d,
8140
8140
  destinationAddress: h
8141
8141
  }) => {
8142
- const f = {
8142
+ const p = {
8143
8143
  method: "GET"
8144
8144
  };
8145
- t && (f.destinationAddress = t), c && (f.tracker = c), rs(f, {
8145
+ t && (p.destinationAddress = t), c && (p.tracker = c), rs(p, {
8146
8146
  timeout: u,
8147
8147
  ordered: n,
8148
8148
  studio: o,
@@ -8151,30 +8151,30 @@ const ug = g.createLogger({ name: "kos-service-request" }), Ee = (t) => ({ isMoc
8151
8151
  signal: d,
8152
8152
  destinationAddress: h
8153
8153
  });
8154
- const p = r || e;
8155
- ug.debug(`resolvedUrl: ${p}`);
8154
+ const f = r || e;
8155
+ ug.debug(`resolvedUrl: ${f}`);
8156
8156
  try {
8157
- const m = await s(p, f);
8158
- if (!m.ok) {
8157
+ const g = await s(f, p);
8158
+ if (!g.ok) {
8159
8159
  let v;
8160
8160
  try {
8161
- v = await m.json();
8161
+ v = await g.json();
8162
8162
  } catch {
8163
8163
  }
8164
8164
  throw new G(
8165
- `There was a problem retrieving the model; returned status ${m.status}`,
8165
+ `There was a problem retrieving the model; returned status ${g.status}`,
8166
8166
  v ?? void 0
8167
8167
  );
8168
8168
  }
8169
- return await m.json() ?? void 0;
8170
- } catch (m) {
8171
- if (m instanceof DOMException) {
8172
- if (m.name === "TimeoutError")
8169
+ return await g.json() ?? void 0;
8170
+ } catch (g) {
8171
+ if (g instanceof DOMException) {
8172
+ if (g.name === "TimeoutError")
8173
8173
  throw new G("Request timed out while retrieving model");
8174
- if (m.name === "AbortError")
8174
+ if (g.name === "AbortError")
8175
8175
  throw new G("Request was cancelled while retrieving model");
8176
8176
  }
8177
- throw m;
8177
+ throw g;
8178
8178
  }
8179
8179
  }, pg = (t, e, s) => async ({
8180
8180
  urlOverride: r,
@@ -8187,10 +8187,10 @@ const ug = g.createLogger({ name: "kos-service-request" }), Ee = (t) => ({ isMoc
8187
8187
  signal: d,
8188
8188
  destinationAddress: h
8189
8189
  }) => {
8190
- const f = {
8190
+ const p = {
8191
8191
  method: "GET"
8192
8192
  };
8193
- t && (f.destinationAddress = t), rs(f, {
8193
+ t && (p.destinationAddress = t), rs(p, {
8194
8194
  timeout: u,
8195
8195
  ordered: o,
8196
8196
  studio: i,
@@ -8199,33 +8199,33 @@ const ug = g.createLogger({ name: "kos-service-request" }), Ee = (t) => ({ isMoc
8199
8199
  signal: d,
8200
8200
  destinationAddress: h
8201
8201
  });
8202
- const p = r || `${e}/${n}`;
8202
+ const f = r || `${e}/${n}`;
8203
8203
  try {
8204
- const m = await s(p, f);
8205
- if (!m.ok) {
8204
+ const g = await s(f, p);
8205
+ if (!g.ok) {
8206
8206
  let v;
8207
8207
  try {
8208
- v = await m.json();
8208
+ v = await g.json();
8209
8209
  } catch {
8210
8210
  }
8211
8211
  throw new G(
8212
- `There was a problem retrieving the model; returned status ${m.status}`,
8212
+ `There was a problem retrieving the model; returned status ${g.status}`,
8213
8213
  v ?? void 0
8214
8214
  );
8215
8215
  }
8216
- return await m.json() ?? void 0;
8217
- } catch (m) {
8218
- if (m instanceof DOMException) {
8219
- if (m.name === "TimeoutError")
8216
+ return await g.json() ?? void 0;
8217
+ } catch (g) {
8218
+ if (g instanceof DOMException) {
8219
+ if (g.name === "TimeoutError")
8220
8220
  throw new G(
8221
8221
  "Request timed out while retrieving model by ID"
8222
8222
  );
8223
- if (m.name === "AbortError")
8223
+ if (g.name === "AbortError")
8224
8224
  throw new G(
8225
8225
  "Request was cancelled while retrieving model by ID"
8226
8226
  );
8227
8227
  }
8228
- throw m;
8228
+ throw g;
8229
8229
  }
8230
8230
  };
8231
8231
  class G extends Error {
@@ -8245,43 +8245,43 @@ const Ii = (t, e, s) => async ({
8245
8245
  bridge: u,
8246
8246
  timeout: d,
8247
8247
  signal: h,
8248
- destinationAddress: f
8248
+ destinationAddress: p
8249
8249
  }) => {
8250
- const p = {
8250
+ const f = {
8251
8251
  method: "POST",
8252
8252
  body: typeof r == "string" ? r : JSON.stringify(r)
8253
8253
  };
8254
- t && (p.destinationAddress = t), i && (p.tracker = i), rs(p, {
8254
+ t && (f.destinationAddress = t), i && (f.tracker = i), rs(f, {
8255
8255
  timeout: d,
8256
8256
  ordered: o,
8257
8257
  studio: a,
8258
8258
  fos: c,
8259
8259
  bridge: u,
8260
8260
  signal: h,
8261
- destinationAddress: f
8261
+ destinationAddress: p
8262
8262
  });
8263
8263
  try {
8264
- const m = await s(n || e, p);
8265
- if (!m.ok) {
8264
+ const g = await s(n || e, f);
8265
+ if (!g.ok) {
8266
8266
  let v;
8267
8267
  try {
8268
- v = await m.json();
8268
+ v = await g.json();
8269
8269
  } catch {
8270
8270
  }
8271
8271
  throw new G(
8272
- `There was a problem sending the POST data; returned status ${m.status}`,
8272
+ `There was a problem sending the POST data; returned status ${g.status}`,
8273
8273
  v ?? void 0
8274
8274
  );
8275
8275
  }
8276
- return await m.json() ?? void 0;
8277
- } catch (m) {
8278
- if (m instanceof DOMException) {
8279
- if (m.name === "TimeoutError")
8276
+ return await g.json() ?? void 0;
8277
+ } catch (g) {
8278
+ if (g instanceof DOMException) {
8279
+ if (g.name === "TimeoutError")
8280
8280
  throw new G("Request timed out while adding model");
8281
- if (m.name === "AbortError")
8281
+ if (g.name === "AbortError")
8282
8282
  throw new G("Request was cancelled while adding model");
8283
8283
  }
8284
- throw m;
8284
+ throw g;
8285
8285
  }
8286
8286
  }, Oi = (t = "POST", e, s, r) => async ({
8287
8287
  // Reqeust should be Request = unknown...
@@ -8293,23 +8293,23 @@ const Ii = (t, e, s) => async ({
8293
8293
  fos: u,
8294
8294
  bridge: d,
8295
8295
  timeout: h,
8296
- signal: f,
8297
- destinationAddress: p
8296
+ signal: p,
8297
+ destinationAddress: f
8298
8298
  }) => {
8299
- const m = {
8299
+ const g = {
8300
8300
  method: t
8301
8301
  };
8302
- n && (m.body = JSON.stringify(n)), e && (m.destinationAddress = e), rs(m, {
8302
+ n && (g.body = JSON.stringify(n)), e && (g.destinationAddress = e), rs(g, {
8303
8303
  timeout: h,
8304
8304
  ordered: a,
8305
8305
  studio: c,
8306
8306
  fos: u,
8307
8307
  bridge: d,
8308
- signal: f,
8309
- destinationAddress: p
8308
+ signal: p,
8309
+ destinationAddress: f
8310
8310
  });
8311
8311
  try {
8312
- const y = await r(i || `${s}/${o}`, m);
8312
+ const y = await r(i || `${s}/${o}`, g);
8313
8313
  if (!y.ok) {
8314
8314
  let _;
8315
8315
  try {
@@ -8586,7 +8586,7 @@ const J = {
8586
8586
  rootContext: () => Me.get("root")
8587
8587
  };
8588
8588
  J.createContext("root");
8589
- const $_ = (t) => J.getContext(t.id), lt = g.createLogger({ name: "kos-data-container" });
8589
+ const $_ = (t) => J.getContext(t.id), lt = m.createLogger({ name: "kos-data-container" });
8590
8590
  class gc {
8591
8591
  constructor(e) {
8592
8592
  l(this, "_data");
@@ -8988,8 +8988,8 @@ class vg {
8988
8988
  let d = 0;
8989
8989
  const h = async () => {
8990
8990
  if (d < c.middlewares.length) {
8991
- const f = c.middlewares[d++];
8992
- await f(i, s, h);
8991
+ const p = c.middlewares[d++];
8992
+ await p(i, s, h);
8993
8993
  }
8994
8994
  };
8995
8995
  await h();
@@ -9056,7 +9056,7 @@ class vg {
9056
9056
  }, {}) : {};
9057
9057
  }
9058
9058
  }
9059
- const mc = g.createLogger({ name: "intent-service" }), O_ = (t) => {
9059
+ const mc = m.createLogger({ name: "intent-service" }), O_ = (t) => {
9060
9060
  mo(`/kos/intent/${t.type}`) ? H(`/kos/intent/${t.type}`, t.options, {
9061
9061
  "kos.intent.type": t.type
9062
9062
  }) : mc.info(`No subscribers for intent ${t.type}. Intent not sent.`);
@@ -9077,7 +9077,7 @@ const mc = g.createLogger({ name: "intent-service" }), O_ = (t) => {
9077
9077
  });
9078
9078
  } else
9079
9079
  mc.info(`No subscribers for intent ${t.type}. Intent not sent.`), e([null, { body: void 0, payload: void 0 }]);
9080
- }), He = g.createLogger({ name: "app-startup-service" });
9080
+ }), He = m.createLogger({ name: "app-startup-service" });
9081
9081
  async function wg(t, e = {}) {
9082
9082
  const {
9083
9083
  timeout: s = 3e4,
@@ -9155,7 +9155,7 @@ async function A_() {
9155
9155
  }
9156
9156
  const Ci = Ns, yc = ha, ae = Z, ee = Xt, Eg = Jt, bc = te, vc = "Not Assigned", P_ = "kos.trouble.added", R_ = "kos.trouble.removed";
9157
9157
  var ce = /* @__PURE__ */ ((t) => (t.TroubleRank = "kos.trouble.rank.mapper", t.TroubleColor = "kos.trouble.color.mapper", t.TroubleRole = "kos.trouble.role.mapper", t.RegionServicePath = "kos.region.service_path.mapper", t.ConfigServicePath = "kos.config.service_path.mapper", t))(ce || {}), wr = /* @__PURE__ */ ((t) => (t.TIME_CHANGE = "/kos/internal/time/time", t.DAY_CHANGE = "/kos/internal/time/day", t.TIMEZONE_CHANGE = "/kos/internal/time/timezone", t))(wr || {});
9158
- const wc = g.createLogger({
9158
+ const wc = m.createLogger({
9159
9159
  name: "config-bean-service",
9160
9160
  group: "Services"
9161
9161
  }), Oo = we, Mg = (t) => (t == null ? void 0 : t.decimals) !== void 0, { postModel: _g, getOne: Tg } = ge.build({
@@ -9225,7 +9225,7 @@ function Pg(t, e) {
9225
9225
  if (new RegExp(`^${s}$`).test(e))
9226
9226
  return s;
9227
9227
  }
9228
- const Do = "config-bean-model", rr = g.getLogger(Do), Rg = es("path");
9228
+ const Do = "config-bean-model", rr = m.getLogger(Do), Rg = es("path");
9229
9229
  function kg(t) {
9230
9230
  return M.propertyMapper.hasMapper(
9231
9231
  ce.ConfigServicePath
@@ -9521,7 +9521,7 @@ var Bg = Object.defineProperty, Hg = Object.getOwnPropertyDescriptor, Po = (t, e
9521
9521
  (i = t[o]) && (n = (r ? i(e, s, n) : i(n)) || n);
9522
9522
  return r && n && Bg(e, s, n), n;
9523
9523
  };
9524
- const Er = "region-info-model", ds = g.createLogger({ name: "region-info-model" });
9524
+ const Er = "region-info-model", ds = m.createLogger({ name: "region-info-model" });
9525
9525
  function qg(t) {
9526
9526
  return M.propertyMapper.hasMapper(
9527
9527
  ce.RegionServicePath
@@ -9885,7 +9885,7 @@ const F_ = (t, e, s, r) => {
9885
9885
  }), d = i.getDefaultUnitForMeasure(a, u.system), h = i.getDefaultUnitDecimalPlaces(
9886
9886
  a,
9887
9887
  u.system
9888
- ), f = {
9888
+ ), p = {
9889
9889
  ...r,
9890
9890
  minDecimals: (r == null ? void 0 : r.minDecimals) ?? h,
9891
9891
  maxDecimals: (r == null ? void 0 : r.maxDecimals) ?? h
@@ -9894,13 +9894,13 @@ const F_ = (t, e, s, r) => {
9894
9894
  value: n,
9895
9895
  unit: d || o.unit || "",
9896
9896
  display: Di(n, d || o.unit || "", {
9897
- ...f,
9897
+ ...p,
9898
9898
  mode: "long"
9899
9899
  }),
9900
9900
  shortDisplay: Di(
9901
9901
  n,
9902
9902
  d || o.unit || "",
9903
- { ...f, mode: "short" }
9903
+ { ...p, mode: "short" }
9904
9904
  )
9905
9905
  };
9906
9906
  };
@@ -10022,7 +10022,7 @@ function Qg(t, e) {
10022
10022
  const r = new Date(s.getTime() + t * 1e3);
10023
10023
  return gt(r, e);
10024
10024
  }
10025
- const Mr = "config-bean-prop-model", At = g.createLogger({ name: "config-bean-prop-model" }), Zg = es("path"), Xg = es("serviceBasePath");
10025
+ const Mr = "config-bean-prop-model", At = m.createLogger({ name: "config-bean-prop-model" }), Zg = es("path"), Xg = es("serviceBasePath");
10026
10026
  let Cs = class {
10027
10027
  constructor(t, e) {
10028
10028
  l(this, "id");
@@ -10331,13 +10331,13 @@ let Cs = class {
10331
10331
  return n;
10332
10332
  }
10333
10333
  getConverter() {
10334
- var r, n, o, i, a, c, u, d, h, f, p;
10334
+ var r, n, o, i, a, c, u, d, h, p, f;
10335
10335
  const { unit: t, measure: e } = this.getConverterFromFormat(), s = t === "drt" ? "second" : t;
10336
10336
  if (this.converter) {
10337
- const m = (r = this.converter) == null ? void 0 : r.measure, y = (o = (n = this.converter) == null ? void 0 : n.to) == null ? void 0 : o.measure, v = (a = (i = this.converter) == null ? void 0 : i.from) == null ? void 0 : a.measure, _ = m || y || v || e, U = ((u = (c = this.converter) == null ? void 0 : c.to) == null ? void 0 : u.unit) || this.regionInfo.getDefaultUnitForMeasure(
10337
+ const g = (r = this.converter) == null ? void 0 : r.measure, y = (o = (n = this.converter) == null ? void 0 : n.to) == null ? void 0 : o.measure, v = (a = (i = this.converter) == null ? void 0 : i.from) == null ? void 0 : a.measure, _ = g || y || v || e, U = ((u = (c = this.converter) == null ? void 0 : c.to) == null ? void 0 : u.unit) || this.regionInfo.getDefaultUnitForMeasure(
10338
10338
  _,
10339
10339
  ((h = (d = this.converter) == null ? void 0 : d.to) == null ? void 0 : h.system) ?? this.regionInfo.defaultUnitSystem
10340
- ), D = ((p = (f = this.converter) == null ? void 0 : f.to) == null ? void 0 : p.system) ?? this.regionInfo.getUnitSystem(U), $ = this.schemaFormat === "drt" ? "second" : this.schemaFormat || s;
10340
+ ), D = ((f = (p = this.converter) == null ? void 0 : p.to) == null ? void 0 : f.system) ?? this.regionInfo.getUnitSystem(U), $ = this.schemaFormat === "drt" ? "second" : this.schemaFormat || s;
10341
10341
  return {
10342
10342
  ...this.converter,
10343
10343
  from: {
@@ -10353,14 +10353,14 @@ let Cs = class {
10353
10353
  };
10354
10354
  }
10355
10355
  if (s && e) {
10356
- const m = this.regionInfo.getDefaultUnitForMeasure(
10356
+ const g = this.regionInfo.getDefaultUnitForMeasure(
10357
10357
  e,
10358
10358
  this.regionInfo.defaultUnitSystem
10359
- ), y = this.regionInfo.getUnitSystem(s), v = this.regionInfo.getUnitSystem(m);
10359
+ ), y = this.regionInfo.getUnitSystem(s), v = this.regionInfo.getUnitSystem(g);
10360
10360
  return {
10361
10361
  measure: e,
10362
10362
  to: {
10363
- unit: y === v ? s : m
10363
+ unit: y === v ? s : g
10364
10364
  }
10365
10365
  };
10366
10366
  }
@@ -10449,7 +10449,7 @@ const Oc = (t) => ({
10449
10449
  note: t.note,
10450
10450
  tracker: t.tracker
10451
10451
  }), Cc = (t, e) => {
10452
- g.debug(`future dto ${t.id} end state ${t.endState}`), g.debug(`future model ${e.id} end state ${e.endState}`), e.endState ? g.debug(`future model ${e.id} is already complete`) : (g.debug(`updating future model ${e.id}`), Z(() => {
10452
+ m.debug(`future dto ${t.id} end state ${t.endState}`), m.debug(`future model ${e.id} end state ${e.endState}`), e.endState ? m.debug(`future model ${e.id} is already complete`) : (m.debug(`updating future model ${e.id}`), Z(() => {
10453
10453
  const s = Oc(t);
10454
10454
  ae(() => {
10455
10455
  Object.keys(s).forEach((r) => {
@@ -10460,7 +10460,7 @@ const Oc = (t) => ({
10460
10460
  }, Jg = (t) => (e) => (s) => t.build(String(e), s), Dc = (t) => (e) => cg(
10461
10461
  Oc,
10462
10462
  Jg(t)(e.tracker || e.id)
10463
- )(e), nn = g.createLogger({ name: "future-service", group: "Services" }), { isMock: em, URL: Vs } = Ee();
10463
+ )(e), nn = m.createLogger({ name: "future-service", group: "Services" }), { isMock: em, URL: Vs } = Ee();
10464
10464
  var wt = /* @__PURE__ */ ((t) => (t.Success = "SUCCESS", t.Fail = "FAIL", t.Aborted = "ABORT", t.Canceled = "CANCEL", t))(wt || {});
10465
10465
  const { getAll: tm, modifyModel: sm, addModel: rm, deleteModel: nm, postModel: om } = ge.build({
10466
10466
  destinationAddress: "",
@@ -10598,7 +10598,7 @@ var gm = Object.defineProperty, mm = Object.getOwnPropertyDescriptor, Rc = (t, e
10598
10598
  (i = t[o]) && (n = (r ? i(e, s, n) : i(n)) || n);
10599
10599
  return r && n && gm(e, s, n), n;
10600
10600
  };
10601
- const Rn = g.getLogger(Ks.type);
10601
+ const Rn = m.getLogger(Ks.type);
10602
10602
  let Dr = class {
10603
10603
  /**
10604
10604
  * @category Constructor
@@ -10738,7 +10738,7 @@ var Em = Object.defineProperty, Mm = Object.getOwnPropertyDescriptor, ko = (t, e
10738
10738
  (i = t[o]) && (n = (r ? i(e, s, n) : i(n)) || n);
10739
10739
  return r && n && Em(e, s, n), n;
10740
10740
  };
10741
- const nr = g.getLogger(Et.type);
10741
+ const nr = m.getLogger(Et.type);
10742
10742
  let Ds = class {
10743
10743
  constructor(t, e, s) {
10744
10744
  l(this, "id");
@@ -10895,7 +10895,7 @@ Ds = ko([
10895
10895
  ], Ds);
10896
10896
  const _m = Ds, { URL: Gs } = Ee(), { getOne: Tm, postModel: $m, deleteModel: Lc } = ge.build({
10897
10897
  basePath: `${Gs}/api/keyVal`
10898
- }), Gn = g.createLogger({
10898
+ }), Gn = m.createLogger({
10899
10899
  name: "key-value-service",
10900
10900
  group: "Services"
10901
10901
  }), Fc = async (t, e) => {
@@ -11044,29 +11044,29 @@ function Hc(t) {
11044
11044
  }
11045
11045
  function Yn(t, e, s, r, n) {
11046
11046
  for (var o = [], i = [], a, c, u, d, h = 0; h < t.length; h++) {
11047
- var f = t[h], p = f.type;
11048
- if (p === _e || p === Mt)
11049
- Array.isArray(f.value) ? o.push.apply(o, Yn(f.value.map(function(m) {
11050
- return new P(_e, m);
11051
- }).concat(new P(Kt, f.value.length)), e, s, r, n)) : o.push(f);
11052
- else if (p === Ke && n.hasOwnProperty(f.value))
11053
- f = new P(_e, n[f.value]), o.push(f);
11054
- else if (p === is && o.length > 1)
11055
- c = o.pop(), a = o.pop(), d = s[f.value], f = new P(_e, d(a.value, c.value)), o.push(f);
11056
- else if (p === as && o.length > 2)
11057
- u = o.pop(), c = o.pop(), a = o.pop(), f.value === "?" ? o.push(a.value ? c.value : u.value) : (d = r[f.value], f = new P(_e, d(a.value, c.value, u.value)), o.push(f));
11058
- else if (p === os && o.length > 0)
11059
- a = o.pop(), d = e[f.value], f = new P(_e, d(a.value)), o.push(f);
11060
- else if (p === pe) {
11047
+ var p = t[h], f = p.type;
11048
+ if (f === _e || f === Mt)
11049
+ Array.isArray(p.value) ? o.push.apply(o, Yn(p.value.map(function(g) {
11050
+ return new P(_e, g);
11051
+ }).concat(new P(Kt, p.value.length)), e, s, r, n)) : o.push(p);
11052
+ else if (f === Ke && n.hasOwnProperty(p.value))
11053
+ p = new P(_e, n[p.value]), o.push(p);
11054
+ else if (f === is && o.length > 1)
11055
+ c = o.pop(), a = o.pop(), d = s[p.value], p = new P(_e, d(a.value, c.value)), o.push(p);
11056
+ else if (f === as && o.length > 2)
11057
+ u = o.pop(), c = o.pop(), a = o.pop(), p.value === "?" ? o.push(a.value ? c.value : u.value) : (d = r[p.value], p = new P(_e, d(a.value, c.value, u.value)), o.push(p));
11058
+ else if (f === os && o.length > 0)
11059
+ a = o.pop(), d = e[p.value], p = new P(_e, d(a.value)), o.push(p);
11060
+ else if (f === pe) {
11061
11061
  for (; o.length > 0; )
11062
11062
  i.push(o.shift());
11063
- i.push(new P(pe, Yn(f.value, e, s, r, n)));
11064
- } else if (p === St && o.length > 0)
11065
- a = o.pop(), o.push(new P(_e, a.value[f.value]));
11063
+ i.push(new P(pe, Yn(p.value, e, s, r, n)));
11064
+ } else if (f === St && o.length > 0)
11065
+ a = o.pop(), o.push(new P(_e, a.value[p.value]));
11066
11066
  else {
11067
11067
  for (; o.length > 0; )
11068
11068
  i.push(o.shift());
11069
- i.push(f);
11069
+ i.push(p);
11070
11070
  }
11071
11071
  }
11072
11072
  for (; o.length > 0; )
@@ -11091,37 +11091,37 @@ function ft(t, e, s) {
11091
11091
  if (No(t))
11092
11092
  return Be(t, s);
11093
11093
  for (var d = t.length, h = 0; h < d; h++) {
11094
- var f = t[h], p = f.type;
11095
- if (p === _e || p === Mt)
11096
- r.push(f.value);
11097
- else if (p === is)
11098
- o = r.pop(), n = r.pop(), f.value === "and" ? r.push(n ? !!ft(o, e, s) : !1) : f.value === "or" ? r.push(n ? !0 : !!ft(o, e, s)) : f.value === "=" ? (a = e.binaryOps[f.value], r.push(a(n, ft(o, e, s), s))) : (a = e.binaryOps[f.value], r.push(a(Be(n, s), Be(o, s))));
11099
- else if (p === as)
11100
- i = r.pop(), o = r.pop(), n = r.pop(), f.value === "?" ? r.push(ft(n ? o : i, e, s)) : (a = e.ternaryOps[f.value], r.push(a(Be(n, s), Be(o, s), Be(i, s))));
11101
- else if (p === Ke)
11102
- if (f.value in e.functions)
11103
- r.push(e.functions[f.value]);
11104
- else if (f.value in e.unaryOps && e.parser.isOperatorEnabled(f.value))
11105
- r.push(e.unaryOps[f.value]);
11094
+ var p = t[h], f = p.type;
11095
+ if (f === _e || f === Mt)
11096
+ r.push(p.value);
11097
+ else if (f === is)
11098
+ o = r.pop(), n = r.pop(), p.value === "and" ? r.push(n ? !!ft(o, e, s) : !1) : p.value === "or" ? r.push(n ? !0 : !!ft(o, e, s)) : p.value === "=" ? (a = e.binaryOps[p.value], r.push(a(n, ft(o, e, s), s))) : (a = e.binaryOps[p.value], r.push(a(Be(n, s), Be(o, s))));
11099
+ else if (f === as)
11100
+ i = r.pop(), o = r.pop(), n = r.pop(), p.value === "?" ? r.push(ft(n ? o : i, e, s)) : (a = e.ternaryOps[p.value], r.push(a(Be(n, s), Be(o, s), Be(i, s))));
11101
+ else if (f === Ke)
11102
+ if (p.value in e.functions)
11103
+ r.push(e.functions[p.value]);
11104
+ else if (p.value in e.unaryOps && e.parser.isOperatorEnabled(p.value))
11105
+ r.push(e.unaryOps[p.value]);
11106
11106
  else {
11107
- var m = s[f.value];
11108
- if (m !== void 0)
11109
- r.push(m);
11107
+ var g = s[p.value];
11108
+ if (g !== void 0)
11109
+ r.push(g);
11110
11110
  else
11111
- throw new Error("undefined variable: " + f.value);
11111
+ throw new Error("undefined variable: " + p.value);
11112
11112
  }
11113
- else if (p === os)
11114
- n = r.pop(), a = e.unaryOps[f.value], r.push(a(Be(n, s)));
11115
- else if (p === Vt) {
11116
- for (u = f.value, c = []; u-- > 0; )
11113
+ else if (f === os)
11114
+ n = r.pop(), a = e.unaryOps[p.value], r.push(a(Be(n, s)));
11115
+ else if (f === Vt) {
11116
+ for (u = p.value, c = []; u-- > 0; )
11117
11117
  c.unshift(Be(r.pop(), s));
11118
11118
  if (a = r.pop(), a.apply && a.call)
11119
11119
  r.push(a.apply(void 0, c));
11120
11120
  else
11121
11121
  throw new Error(a + " is not a function");
11122
- } else if (p === on)
11122
+ } else if (f === on)
11123
11123
  r.push(function() {
11124
- for (var y = r.pop(), v = [], _ = f.value; _-- > 0; )
11124
+ for (var y = r.pop(), v = [], _ = p.value; _-- > 0; )
11125
11125
  v.unshift(r.pop());
11126
11126
  var U = r.pop(), D = function() {
11127
11127
  for (var $ = Object.assign({}, s), L = 0, se = v.length; L < se; L++)
@@ -11133,16 +11133,16 @@ function ft(t, e, s) {
11133
11133
  writable: !1
11134
11134
  }), s[U] = D, D;
11135
11135
  }());
11136
- else if (p === pe)
11137
- r.push(Cm(f, e));
11138
- else if (p === Fo)
11139
- r.push(f);
11140
- else if (p === St)
11141
- n = r.pop(), r.push(n[f.value]);
11142
- else if (p === an)
11136
+ else if (f === pe)
11137
+ r.push(Cm(p, e));
11138
+ else if (f === Fo)
11139
+ r.push(p);
11140
+ else if (f === St)
11141
+ n = r.pop(), r.push(n[p.value]);
11142
+ else if (f === an)
11143
11143
  r.pop();
11144
- else if (p === Kt) {
11145
- for (u = f.value, c = []; u-- > 0; )
11144
+ else if (f === Kt) {
11145
+ for (u = p.value, c = []; u-- > 0; )
11146
11146
  c.unshift(r.pop());
11147
11147
  r.push(c);
11148
11148
  } else
@@ -12305,7 +12305,7 @@ Oy(xr, "Registration");
12305
12305
  xr = Iy([
12306
12306
  R({ modelTypeId: Cy, singleton: !1 })
12307
12307
  ], xr);
12308
- const xy = xr.Registration, Ay = g.createLogger({
12308
+ const xy = xr.Registration, Ay = m.createLogger({
12309
12309
  name: "kos-log-manager-service",
12310
12310
  group: "Services"
12311
12311
  }), Py = "/api/kos/logs/overrides", Gc = async () => (Ay.debug("sending GET for kos-log-manager"), await je.get(Py)), H_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -12353,7 +12353,7 @@ let Yt = class {
12353
12353
  * @private
12354
12354
  */
12355
12355
  resolveLoggers() {
12356
- const t = g.getLoggers(), s = Object.entries(t).map(
12356
+ const t = m.getLoggers(), s = Object.entries(t).map(
12357
12357
  ([r, n]) => ({
12358
12358
  name: r,
12359
12359
  level: Ny(n.getLevel())
@@ -12379,14 +12379,14 @@ let Yt = class {
12379
12379
  Object.values(this.resolveLoggers()).filter(
12380
12380
  (r) => r.name.startsWith(t.name)
12381
12381
  ).forEach((r) => {
12382
- const n = g.getLoggers()[r.name];
12382
+ const n = m.getLoggers()[r.name];
12383
12383
  if (!n) {
12384
12384
  this.logger.debug(`Logger ${r.name} not found`);
12385
12385
  return;
12386
12386
  }
12387
12387
  n.setLevel(t.level);
12388
12388
  });
12389
- const s = g.getLoggers()[t.name];
12389
+ const s = m.getLoggers()[t.name];
12390
12390
  if (!s) {
12391
12391
  this.logger.debug(`Logger ${t.name} not found`);
12392
12392
  return;
@@ -12404,10 +12404,10 @@ let Yt = class {
12404
12404
  Object.values(this.resolveLoggers()).filter(
12405
12405
  (r) => r.name.startsWith(t.name)
12406
12406
  ).forEach((r) => {
12407
- const n = g.getLoggers()[r.name];
12407
+ const n = m.getLoggers()[r.name];
12408
12408
  n || this.logger.debug(`Logger ${r.name} not found`), n == null || n.resetLevel();
12409
12409
  });
12410
- const s = g.getLoggers()[t.name];
12410
+ const s = m.getLoggers()[t.name];
12411
12411
  s || this.logger.debug(`Logger ${t.name} not found`), s == null || s.resetLevel(), globalThis.kos.logOverrides = this._overrides.data;
12412
12412
  }
12413
12413
  handleOverrideAdded(t, e) {
@@ -12480,7 +12480,7 @@ const Uy = new Ne({
12480
12480
  }), { URL: Ys } = Ee(), { postModel: zo, getOne: jy } = ge.build({
12481
12481
  basePath: `${Ys}/api/kos-time`
12482
12482
  });
12483
- g.createLogger({
12483
+ m.createLogger({
12484
12484
  name: "kos-time-service",
12485
12485
  group: "Services"
12486
12486
  });
@@ -12656,13 +12656,13 @@ Jc([
12656
12656
  Ar = Jc([
12657
12657
  R(el)
12658
12658
  ], Ar);
12659
- const Yy = g.createLogger({
12659
+ const Yy = m.createLogger({
12660
12660
  name: "log-stream-container-service",
12661
12661
  group: "Services"
12662
12662
  }), tl = () => {
12663
12663
  var r;
12664
12664
  const t = $e(), s = (t == null ? void 0 : t.connId) || ((r = window == null ? void 0 : window.kosBridge) == null ? void 0 : r.call(window, "connId"));
12665
- return g.error(`getKosConnectionId: ${s}`), s;
12665
+ return m.error(`getKosConnectionId: ${s}`), s;
12666
12666
  }, cs = tl(), Wy = "/api/kos/logs/node/{nodeId}/streams", sl = async () => (Yy.debug("sending GET for log-stream-container"), await je.get(
12667
12667
  Wy,
12668
12668
  {
@@ -13132,7 +13132,7 @@ const ab = (t) => (t == null ? void 0 : t.rank) !== void 0, cb = (t) => (t == nu
13132
13132
  }), fl = () => {
13133
13133
  var r;
13134
13134
  const t = $e(), s = (t == null ? void 0 : t.connId) || ((r = window == null ? void 0 : window.kosBridge) == null ? void 0 : r.call(window, "connId"));
13135
- return g.error(`getKosConnectionId: ${s}`), s;
13135
+ return m.error(`getKosConnectionId: ${s}`), s;
13136
13136
  }, Ko = fl(), pl = async (t) => await fb({
13137
13137
  urlOverride: `${pn}${t}`,
13138
13138
  destinationAddress: Ko
@@ -13192,7 +13192,7 @@ qs(Zn, {
13192
13192
  };
13193
13193
  const r = s.map((i) => i(e));
13194
13194
  return (await Promise.allSettled(r)).reduce(
13195
- (i, a) => (a.status === "fulfilled" ? i = { ...i, ...a.value } : g.info(`Trouble mapper ${t} failed: ${a.reason}`), i),
13195
+ (i, a) => (a.status === "fulfilled" ? i = { ...i, ...a.value } : m.info(`Trouble mapper ${t} failed: ${a.reason}`), i),
13196
13196
  { ...e.data }
13197
13197
  );
13198
13198
  }
@@ -13207,7 +13207,7 @@ qs(gn, {
13207
13207
  const s = ir.get(t);
13208
13208
  if (!s)
13209
13209
  return [];
13210
- const r = s.map((i) => i(e)), o = (await Promise.allSettled(r)).map((i) => i.status === "fulfilled" ? i.value : (g.info(`Trouble mapper ${t} failed: ${i.reason}`), [])).flat();
13210
+ const r = s.map((i) => i(e)), o = (await Promise.allSettled(r)).map((i) => i.status === "fulfilled" ? i.value : (m.info(`Trouble mapper ${t} failed: ${i.reason}`), [])).flat();
13211
13211
  return Array.from(new Set(o));
13212
13212
  }
13213
13213
  });
@@ -13288,9 +13288,9 @@ let kr = class {
13288
13288
  group: u,
13289
13289
  createTime: d,
13290
13290
  role: h,
13291
- color: f,
13292
- servicePath: p,
13293
- rawJson: m,
13291
+ color: p,
13292
+ servicePath: f,
13293
+ rawJson: g,
13294
13294
  ...y
13295
13295
  }, v) {
13296
13296
  l(this, "id");
@@ -13312,7 +13312,7 @@ let kr = class {
13312
13312
  l(this, "createTime");
13313
13313
  l(this, "rawJson");
13314
13314
  l(this, "_mapped", {});
13315
- this.id = t, this.logger = v.logger, this.type = c, this._troubleId = n, this._resolvable = !!e, this.ifaces = a, this.rank = i, this.role = h, this.color = f, this.tags = s, this.info = r, this.group = u, this.rawJson = m, this.servicePath = p ?? "/api/kos/troubles", this.createTime = d, this.clientData = o, this.data = {}, Object.assign(this.data, y), this.futureHandler = new _o(this);
13315
+ this.id = t, this.logger = v.logger, this.type = c, this._troubleId = n, this._resolvable = !!e, this.ifaces = a, this.rank = i, this.role = h, this.color = p, this.tags = s, this.info = r, this.group = u, this.rawJson = g, this.servicePath = f ?? "/api/kos/troubles", this.createTime = d, this.clientData = o, this.data = {}, Object.assign(this.data, y), this.futureHandler = new _o(this);
13316
13316
  }
13317
13317
  // -------------------LIFECYCLE----------------------------
13318
13318
  getTitleWithContext(t) {
@@ -13518,7 +13518,7 @@ _t = mn([
13518
13518
  ], _t);
13519
13519
  const Ps = _t.Registration, { URL: vl } = Ee(), { getAll: Tb } = ge.build({
13520
13520
  basePath: `${vl}/api/kos/ota`
13521
- }), qi = g.createLogger({
13521
+ }), qi = m.createLogger({
13522
13522
  name: "ota-service",
13523
13523
  group: "Services"
13524
13524
  }), $b = async () => {
@@ -13705,7 +13705,7 @@ function Cb(t) {
13705
13705
  e && (e.abort(), e = void 0);
13706
13706
  }, s.getController = () => e, s.isActive = () => !!e, s;
13707
13707
  }
13708
- const Fn = g.createLogger({
13708
+ const Fn = m.createLogger({
13709
13709
  name: "software-info-service",
13710
13710
  group: "Services"
13711
13711
  }), Go = async (t) => {
@@ -13793,7 +13793,7 @@ const eo = {
13793
13793
  )
13794
13794
  }, { URL: El } = Ee(), { getOne: Pb } = ge.build({
13795
13795
  basePath: `${El}/api/kos/state`
13796
- }), Rb = g.createLogger({
13796
+ }), Rb = m.createLogger({
13797
13797
  name: "state-bean-service",
13798
13798
  group: "Services"
13799
13799
  }), Ml = async ({ path: t }) => (Rb.debug("sending GET for state-bean"), await Pb({
@@ -13946,7 +13946,7 @@ const $l = {
13946
13946
  factory: ve.Factory.create(ms)
13947
13947
  }, { URL: jb } = Ee(), { getAll: Bb } = ge.build({
13948
13948
  basePath: `${jb}/api/state-prop`
13949
- }), Hb = g.createLogger({
13949
+ }), Hb = m.createLogger({
13950
13950
  name: "state-prop-service",
13951
13951
  group: "Services"
13952
13952
  }), qb = async () => (Hb.debug("sending GET for state-prop"), await Bb({})), Y_ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -13954,7 +13954,7 @@ const $l = {
13954
13954
  getStateProps: qb
13955
13955
  }, Symbol.toStringTag, { value: "Module" })), { URL: Yo } = Ee(), { getOne: Sl } = ge.build({
13956
13956
  basePath: `${Yo}/api/translation`
13957
- }), Ms = g.createLogger({
13957
+ }), Ms = m.createLogger({
13958
13958
  name: "translation-service",
13959
13959
  group: "Services"
13960
13960
  }), zb = () => {
@@ -14034,9 +14034,9 @@ const to = (t, e) => {
14034
14034
  if (u.includes(".")) {
14035
14035
  const d = u.split(".");
14036
14036
  let h = s;
14037
- for (const f of d)
14038
- if (h && typeof h == "object" && Object.prototype.hasOwnProperty.call(h, f))
14039
- h = h[f];
14037
+ for (const p of d)
14038
+ if (h && typeof h == "object" && Object.prototype.hasOwnProperty.call(h, p))
14039
+ h = h[p];
14040
14040
  else
14041
14041
  return a;
14042
14042
  return h;
@@ -14380,7 +14380,7 @@ let Rs = class {
14380
14380
  this.processEvent(e);
14381
14381
  }
14382
14382
  processEvent(t, e = !1) {
14383
- g.debug("kos event received");
14383
+ m.debug("kos event received");
14384
14384
  const { body: s, headers: r } = t.body, n = r["request-id"] || r["response-id"], o = r["request-id"] || r["response-id"] || r.topic || r.type;
14385
14385
  if (o) {
14386
14386
  let i = o;
@@ -14399,7 +14399,7 @@ let Rs = class {
14399
14399
  direction: e ? "send" : "receive",
14400
14400
  mocked: !!r.mocked
14401
14401
  };
14402
- this.events.set(i, a), g.debug(`logged ${this.events.size} events`);
14402
+ this.events.set(i, a), m.debug(`logged ${this.events.size} events`);
14403
14403
  }
14404
14404
  }
14405
14405
  };
@@ -15073,14 +15073,14 @@ class mv extends Ct {
15073
15073
  if (i === c)
15074
15074
  u = this.baseColor.r, d = this.baseColor.g, h = this.baseColor.b;
15075
15075
  else if (i < c && i > c - this.trailColors.length) {
15076
- const p = c - i;
15077
- if (p < this.trailColors.length) {
15078
- const m = this.trailColors[p];
15079
- u = m.r, d = m.g, h = m.b;
15076
+ const f = c - i;
15077
+ if (f < this.trailColors.length) {
15078
+ const g = this.trailColors[f];
15079
+ u = g.r, d = g.g, h = g.b;
15080
15080
  }
15081
15081
  }
15082
- const f = (i * s + a) * 4;
15083
- o[f] = u, o[f + 1] = d, o[f + 2] = h, o[f + 3] = 255;
15082
+ const p = (i * s + a) * 4;
15083
+ o[p] = u, o[p + 1] = d, o[p + 2] = h, o[p + 3] = 255;
15084
15084
  }
15085
15085
  this.ctx.putImageData(n, 0, 0);
15086
15086
  }
@@ -15276,10 +15276,10 @@ class Ul extends Ct {
15276
15276
  this.drawScrollingImage(s, r, n, i), this.checkScrollCompletion(s, r, n, i);
15277
15277
  }
15278
15278
  drawScrollingImage(s, r, n, o) {
15279
- var h, f, p, m, y, v, _, U, D;
15279
+ var h, p, f, g, y, v, _, U, D;
15280
15280
  const i = this.img.width / this.img.height;
15281
15281
  let a, c;
15282
- ((h = this.scrollConfig) == null ? void 0 : h.maintainAspectRatio) !== !1 ? (f = this.scrollConfig) != null && f.height ? (c = this.scrollConfig.height, a = c * i) : (p = this.scrollConfig) != null && p.width ? (a = this.scrollConfig.width, c = a / i) : n === "left" || n === "right" ? (c = r, a = c * i) : (a = s, c = a / i) : (a = ((m = this.scrollConfig) == null ? void 0 : m.width) || s, c = ((y = this.scrollConfig) == null ? void 0 : y.height) || r);
15282
+ ((h = this.scrollConfig) == null ? void 0 : h.maintainAspectRatio) !== !1 ? (p = this.scrollConfig) != null && p.height ? (c = this.scrollConfig.height, a = c * i) : (f = this.scrollConfig) != null && f.width ? (a = this.scrollConfig.width, c = a / i) : n === "left" || n === "right" ? (c = r, a = c * i) : (a = s, c = a / i) : (a = ((g = this.scrollConfig) == null ? void 0 : g.width) || s, c = ((y = this.scrollConfig) == null ? void 0 : y.height) || r);
15283
15283
  let u, d;
15284
15284
  switch (n === "left" || n === "right" ? (u = 0, ((v = this.scrollConfig) == null ? void 0 : v.offsetY) === "center" || ((_ = this.scrollConfig) == null ? void 0 : _.offsetY) === void 0 ? d = (r - c) / 2 : d = this.scrollConfig.offsetY) : (((U = this.scrollConfig) == null ? void 0 : U.offsetX) === "center" || ((D = this.scrollConfig) == null ? void 0 : D.offsetX) === void 0 ? u = (s - a) / 2 : u = this.scrollConfig.offsetX, d = 0), n) {
15285
15285
  case "left": {
@@ -15341,12 +15341,12 @@ class Ul extends Ct {
15341
15341
  }
15342
15342
  }
15343
15343
  checkScrollCompletion(s, r, n, o) {
15344
- var h, f, p, m, y;
15344
+ var h, p, f, g, y;
15345
15345
  if (!this.isPlaying)
15346
15346
  return;
15347
15347
  const i = this.img.width / this.img.height;
15348
15348
  let a, c;
15349
- switch (((h = this.scrollConfig) == null ? void 0 : h.maintainAspectRatio) !== !1 ? (f = this.scrollConfig) != null && f.height ? (c = this.scrollConfig.height, a = c * i) : (p = this.scrollConfig) != null && p.width ? (a = this.scrollConfig.width, c = a / i) : n === "left" || n === "right" ? (c = r, a = c * i) : (a = s, c = a / i) : (a = ((m = this.scrollConfig) == null ? void 0 : m.width) || s, c = ((y = this.scrollConfig) == null ? void 0 : y.height) || r), n) {
15349
+ switch (((h = this.scrollConfig) == null ? void 0 : h.maintainAspectRatio) !== !1 ? (p = this.scrollConfig) != null && p.height ? (c = this.scrollConfig.height, a = c * i) : (f = this.scrollConfig) != null && f.width ? (a = this.scrollConfig.width, c = a / i) : n === "left" || n === "right" ? (c = r, a = c * i) : (a = s, c = a / i) : (a = ((g = this.scrollConfig) == null ? void 0 : g.width) || s, c = ((y = this.scrollConfig) == null ? void 0 : y.height) || r), n) {
15350
15350
  case "left":
15351
15351
  case "right":
15352
15352
  this.loopConfig;
@@ -15740,7 +15740,7 @@ class Mv extends Ct {
15740
15740
  if (r === 0)
15741
15741
  o = i = a = n;
15742
15742
  else {
15743
- const c = (h, f, p) => (p < 0 && (p += 1), p > 1 && (p -= 1), p < 0.16666666666666666 ? h + (f - h) * 6 * p : p < 0.5 ? f : p < 0.6666666666666666 ? h + (f - h) * (0.6666666666666666 - p) * 6 : h), u = n < 0.5 ? n * (1 + r) : n + r - n * r, d = 2 * n - u;
15743
+ const c = (h, p, f) => (f < 0 && (f += 1), f > 1 && (f -= 1), f < 0.16666666666666666 ? h + (p - h) * 6 * f : f < 0.5 ? p : f < 0.6666666666666666 ? h + (p - h) * (0.6666666666666666 - f) * 6 : h), u = n < 0.5 ? n * (1 + r) : n + r - n * r, d = 2 * n - u;
15744
15744
  o = c(d, u, s + 1 / 3), i = c(d, u, s), a = c(d, u, s - 1 / 3);
15745
15745
  }
15746
15746
  return [Math.round(o * 255), Math.round(i * 255), Math.round(a * 255)];
@@ -15757,8 +15757,8 @@ class Mv extends Ct {
15757
15757
  let i = 0;
15758
15758
  for (let a = 0; a < r; a++)
15759
15759
  for (let c = 0; c < s; c++) {
15760
- const u = (c + this.offset) % s / s, d = this.minHue / 360 + u * ((this.maxHue - this.minHue) / 360), [h, f, p] = this.hslToRgb(d, 1, 0.5);
15761
- o[i++] = h, o[i++] = f, o[i++] = p, o[i++] = 255;
15760
+ const u = (c + this.offset) % s / s, d = this.minHue / 360 + u * ((this.maxHue - this.minHue) / 360), [h, p, f] = this.hslToRgb(d, 1, 0.5);
15761
+ o[i++] = h, o[i++] = p, o[i++] = f, o[i++] = 255;
15762
15762
  }
15763
15763
  this.ctx.putImageData(n, 0, 0);
15764
15764
  }
@@ -15981,7 +15981,7 @@ const ks = new Ne({
15981
15981
  type: jl
15982
15982
  }), { URL: Zo } = Ee(), { getOne: Bl } = ge.build({
15983
15983
  basePath: `${Zo}/api/device`
15984
- }), zr = g.createLogger({ name: "device-service", group: "Services" }), Hl = async () => {
15984
+ }), zr = m.createLogger({ name: "device-service", group: "Services" }), Hl = async () => {
15985
15985
  zr.debug("sending GET for device serial number");
15986
15986
  try {
15987
15987
  const t = await Bl({
@@ -16284,7 +16284,7 @@ const Gl = new Ae({
16284
16284
  type: Kl
16285
16285
  }), { URL: Rv } = Ee(), { getAll: kv } = ge.build({
16286
16286
  basePath: `${Rv}/api/kos/network/interfaces`
16287
- }), Wi = g.createLogger({
16287
+ }), Wi = m.createLogger({
16288
16288
  name: "network-interface-service",
16289
16289
  group: "Services"
16290
16290
  }), Yl = async () => {
@@ -16381,7 +16381,7 @@ const Gr = new Ne({
16381
16381
  Gr.addRelatedModel(Gl);
16382
16382
  const { URL: Nv } = Ee(), { getAll: Uv } = ge.build({
16383
16383
  basePath: `${Nv}/api/kos/storage/devices`
16384
- }), Qi = g.createLogger({
16384
+ }), Qi = m.createLogger({
16385
16385
  name: "storage-device-service",
16386
16386
  group: "Services"
16387
16387
  }), Zl = async () => {
@@ -16548,7 +16548,7 @@ const Fs = new Ne({
16548
16548
  Fs.addRelatedModel(ao);
16549
16549
  const { URL: Jo } = Ee(), { getAll: Vv, postModel: Kv } = ge.build({
16550
16550
  basePath: `${Jo}/api/kos/update/available`
16551
- }), Zi = g.createLogger({
16551
+ }), Zi = m.createLogger({
16552
16552
  name: "usb-update-service",
16553
16553
  group: "Services"
16554
16554
  }), eu = async () => {
@@ -16938,7 +16938,7 @@ const na = ot(), hT = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin
16938
16938
  api: na,
16939
16939
  default: na,
16940
16940
  kosServiceRequest: aw
16941
- }, Symbol.toStringTag, { value: "Module" })), lu = "/kos-timer-event", uu = "/kos-timer-event/tick", du = "defaultTimerEnd", vs = g.createLogger({ name: "timer-manager" }), cw = (t) => t.updateProperty !== void 0;
16941
+ }, Symbol.toStringTag, { value: "Module" })), lu = "/kos-timer-event", uu = "/kos-timer-event/tick", du = "defaultTimerEnd", vs = m.createLogger({ name: "timer-manager" }), cw = (t) => t.updateProperty !== void 0;
16942
16942
  class lw {
16943
16943
  /**
16944
16944
  * Creates a new timer.
@@ -16957,7 +16957,7 @@ class lw {
16957
16957
  this.name = e;
16958
16958
  const n = typeof s == "number" ? s : s.value || 60;
16959
16959
  this.timeout = n, this.state = "inactive", this.remainingTime = n, cw(s) && ee(() => {
16960
- g.info(
16960
+ m.info(
16961
16961
  `Updating config value timer ${e} with new timeout value ${s.value}`
16962
16962
  );
16963
16963
  const o = s.value || 60;
@@ -17165,7 +17165,7 @@ function pu(t, e, s = {}) {
17165
17165
  } = s;
17166
17166
  return async function(...a) {
17167
17167
  const c = ss();
17168
- g.debug(
17168
+ m.debug(
17169
17169
  `Calling future service ${e} with tracker ${c}`
17170
17170
  );
17171
17171
  let u, d;
@@ -17174,37 +17174,37 @@ function pu(t, e, s = {}) {
17174
17174
  tracker: c,
17175
17175
  id: vc
17176
17176
  });
17177
- n && (h.namespace = n), g.debug(`waiting for future ${h.id} to be ready`), await Te(h), g.debug(`future ${h.id} is ready`), ae(() => {
17178
- g.debug(`Adding future ${h.id} to futureHandler`), this.futureHandler.addFuture(h, r);
17177
+ n && (h.namespace = n), m.debug(`waiting for future ${h.id} to be ready`), await Te(h), m.debug(`future ${h.id} is ready`), ae(() => {
17178
+ m.debug(`Adding future ${h.id} to futureHandler`), this.futureHandler.addFuture(h, r);
17179
17179
  }), o && u && (d = ee(() => {
17180
- (h.status === "CANCELLED" || h.endState === wt.Canceled) && (g.debug(`Future ${h.id} cancelled, aborting request`), u == null || u.abort());
17180
+ (h.status === "CANCELLED" || h.endState === wt.Canceled) && (m.debug(`Future ${h.id} cancelled, aborting request`), u == null || u.abort());
17181
17181
  }), u.signal.addEventListener(
17182
17182
  "abort",
17183
17183
  async () => {
17184
17184
  if (h.status !== "CANCELLED" && h.endState !== wt.Canceled && !h.endState) {
17185
- g.debug(
17185
+ m.debug(
17186
17186
  `AbortController aborted, cancelling future ${h.id}`
17187
17187
  );
17188
17188
  try {
17189
17189
  await h.cancelFuture();
17190
- } catch (p) {
17191
- g.error(`Failed to cancel future ${h.id}:`, p);
17190
+ } catch (f) {
17191
+ m.error(`Failed to cancel future ${h.id}:`, f);
17192
17192
  }
17193
17193
  }
17194
17194
  },
17195
17195
  { once: !0 }
17196
17196
  ));
17197
- const f = () => {
17197
+ const p = () => {
17198
17198
  d && (d(), d = void 0);
17199
17199
  };
17200
17200
  try {
17201
- const p = [...a];
17201
+ const f = [...a];
17202
17202
  if (o && u) {
17203
- const v = p[p.length - 1];
17204
- v && typeof v == "object" && "aborted" in v ? p[p.length - 1] = u.signal : p.push(u.signal);
17203
+ const v = f[f.length - 1];
17204
+ v && typeof v == "object" && "aborted" in v ? f[f.length - 1] = u.signal : f.push(u.signal);
17205
17205
  }
17206
17206
  if (i === "context") {
17207
- const v = p[p.length - 1];
17207
+ const v = f[f.length - 1];
17208
17208
  if (Wa(v))
17209
17209
  v.$tracker = c;
17210
17210
  else {
@@ -17212,25 +17212,25 @@ function pu(t, e, s = {}) {
17212
17212
  [Mo]: !0,
17213
17213
  $tracker: c
17214
17214
  };
17215
- p.push(_);
17215
+ f.push(_);
17216
17216
  }
17217
17217
  } else
17218
- p.push(c);
17219
- const m = (
17218
+ f.push(c);
17219
+ const g = (
17220
17220
  // eslint-disable-next-line no-invalid-this
17221
- await t.apply(this, p)
17221
+ await t.apply(this, f)
17222
17222
  );
17223
- g.debug(`received future response for ${c}`, m);
17224
- const y = hw(m) ? m : m == null ? void 0 : m.data;
17225
- return y ? (y.progress = 1, g.debug("mapping future response to future model"), h.endState ? g.debug(
17223
+ m.debug(`received future response for ${c}`, g);
17224
+ const y = hw(g) ? g : g == null ? void 0 : g.data;
17225
+ return y ? (y.progress = 1, m.debug("mapping future response to future model"), h.endState ? m.debug(
17226
17226
  `future ${h.id} has already completed. Not updating the model`
17227
- ) : Cc(y, h)) : this.futureHandler.removeFuture(r), f(), y;
17228
- } catch (p) {
17229
- if (f(), o && (u != null && u.signal.aborted)) {
17230
- const m = new Error("Operation cancelled");
17231
- throw g.debug(`Operation ${e} was cancelled`), m;
17227
+ ) : Cc(y, h)) : this.futureHandler.removeFuture(r), p(), y;
17228
+ } catch (f) {
17229
+ if (p(), o && (u != null && u.signal.aborted)) {
17230
+ const g = new Error("Operation cancelled");
17231
+ throw m.debug(`Operation ${e} was cancelled`), g;
17232
17232
  }
17233
- throw g.error(p), p;
17233
+ throw m.error(f), f;
17234
17234
  }
17235
17235
  };
17236
17236
  }
@@ -17273,7 +17273,7 @@ function pT(t) {
17273
17273
  };
17274
17274
  };
17275
17275
  }
17276
- const Ht = g.createLogger({ name: "services", group: "Services" }), gT = async (t, e) => fw(t, e, `${we}/api/server/login`), fw = async (t, e, s = `${we}/api/login`) => {
17276
+ const Ht = m.createLogger({ name: "services", group: "Services" }), gT = async (t, e) => fw(t, e, `${we}/api/server/login`), fw = async (t, e, s = `${we}/api/login`) => {
17277
17277
  const r = await Ue(`${s}`, {
17278
17278
  method: "POST",
17279
17279
  destinationAddress: "",
@@ -17357,12 +17357,12 @@ function vT(t, e, s, r) {
17357
17357
  cancelFuture: a,
17358
17358
  future: c
17359
17359
  } = n, u = o;
17360
- let d = 0, h = "PENDING", f = !0;
17361
- const p = /* @__PURE__ */ new Set();
17362
- let m;
17363
- return c && typeof c == "object" && (m = Xt(() => {
17360
+ let d = 0, h = "PENDING", p = !0;
17361
+ const f = /* @__PURE__ */ new Set();
17362
+ let g;
17363
+ return c && typeof c == "object" && (g = Xt(() => {
17364
17364
  const y = c.progress || 0, v = c.status || "PENDING", _ = !c.endState;
17365
- (y !== d || v !== h || _ !== f) && (d = y, h = v, f = _, p.forEach((U) => {
17365
+ (y !== d || v !== h || _ !== p) && (d = y, h = v, p = _, f.forEach((U) => {
17366
17366
  try {
17367
17367
  U(d, h);
17368
17368
  } catch (D) {
@@ -17370,21 +17370,21 @@ function vT(t, e, s, r) {
17370
17370
  }
17371
17371
  }));
17372
17372
  })), o.finally(() => {
17373
- f = !1, i != null && i.signal.aborted || (h = "COMPLETED", p.forEach((y) => {
17373
+ p = !1, i != null && i.signal.aborted || (h = "COMPLETED", f.forEach((y) => {
17374
17374
  try {
17375
17375
  y(d, h);
17376
17376
  } catch (v) {
17377
17377
  console.warn("Progress callback error:", v);
17378
17378
  }
17379
- })), m && m(), p.clear();
17379
+ })), g && g(), f.clear();
17380
17380
  }), u.cancel = async () => {
17381
- i && !i.signal.aborted && i.abort(), a && await a(), f = !1, h = "CANCELLED", p.forEach((y) => {
17381
+ i && !i.signal.aborted && i.abort(), a && await a(), p = !1, h = "CANCELLED", f.forEach((y) => {
17382
17382
  try {
17383
17383
  y(d, h);
17384
17384
  } catch (v) {
17385
17385
  console.warn("Progress callback error:", v);
17386
17386
  }
17387
- }), m && m();
17387
+ }), g && g();
17388
17388
  }, u.getController = () => i, u.isCancelled = () => (i == null ? void 0 : i.signal.aborted) ?? !1, Object.defineProperty(u, "progress", {
17389
17389
  get: () => d,
17390
17390
  enumerable: !0
@@ -17392,9 +17392,9 @@ function vT(t, e, s, r) {
17392
17392
  get: () => h,
17393
17393
  enumerable: !0
17394
17394
  }), Object.defineProperty(u, "isRunning", {
17395
- get: () => f,
17395
+ get: () => p,
17396
17396
  enumerable: !0
17397
- }), u.onProgressUpdate = (y) => (p.add(y), y(d, h), () => p.delete(y)), u;
17397
+ }), u.onProgressUpdate = (y) => (f.add(y), y(d, h), () => f.delete(y)), u;
17398
17398
  }
17399
17399
  const yw = ju`
17400
17400
  0% {
@@ -17531,7 +17531,7 @@ const _w = {
17531
17531
  [s]
17532
17532
  );
17533
17533
  return /* @__PURE__ */ w(ti.Provider, { value: { model: e, setModel: r }, children: t });
17534
- }, gu = g.createLogger({ name: "kos-model-hierarchy-context" }), Sw = {
17534
+ }, gu = m.createLogger({ name: "kos-model-hierarchy-context" }), Sw = {
17535
17535
  models: [],
17536
17536
  addModel: () => {
17537
17537
  gu.debug("Default implementation being used. Do Nothing.");
@@ -17560,7 +17560,7 @@ const _w = {
17560
17560
  const r = Ve(s.id);
17561
17561
  return (r == null ? void 0 : r.type) === t;
17562
17562
  }
17563
- })[0], Cw = g.createLogger({ name: "kos-model-loader" }), Dw = () => /* @__PURE__ */ w("div", {}), xw = ({ fallback: t, children: e, ...s }) => /* @__PURE__ */ w($w, { children: /* @__PURE__ */ w(Mw, { fallback: t, children: /* @__PURE__ */ w(Bu, { children: /* @__PURE__ */ w(Aw, { ...s, children: e }) }) }) }), Aw = (t) => {
17563
+ })[0], Cw = m.createLogger({ name: "kos-model-loader" }), Dw = () => /* @__PURE__ */ w("div", {}), xw = ({ fallback: t, children: e, ...s }) => /* @__PURE__ */ w($w, { children: /* @__PURE__ */ w(Mw, { fallback: t, children: /* @__PURE__ */ w(Bu, { children: /* @__PURE__ */ w(Aw, { ...s, children: e }) }) }) }), Aw = (t) => {
17564
17564
  const [e, s] = E(), [r, n] = E(!1), { setModel: o } = bt(ti), i = bt(si);
17565
17565
  if (S(() => {
17566
17566
  t.model && (s(t.model), o(t.model), n(!0), i && i.addModel(t.model));
@@ -17669,42 +17669,42 @@ const oe = (t) => {
17669
17669
  return S(() => {
17670
17670
  t.forceUpdate && h && To(h) && h.updateModel(t.options || {});
17671
17671
  }, [h]), S(() => {
17672
- async function f() {
17672
+ async function p() {
17673
17673
  try {
17674
17674
  return await o.kosCore.whenReady(), r && await (d == null ? void 0 : d.fsm.transitionTo(
17675
17675
  k.GO_ACTIVE,
17676
17676
  b.ACTIVE
17677
17677
  )), a(!0), d;
17678
- } catch (m) {
17679
- throw u(m.message), m;
17678
+ } catch (g) {
17679
+ throw u(g.message), g;
17680
17680
  }
17681
17681
  }
17682
- let p;
17683
- return o.kosCore && e && f().then((m) => {
17684
- p = ee(() => {
17685
- const y = (m == null ? void 0 : m.status) === b.READY;
17682
+ let f;
17683
+ return o.kosCore && e && p().then((g) => {
17684
+ f = ee(() => {
17685
+ const y = (g == null ? void 0 : g.status) === b.READY;
17686
17686
  a(y);
17687
17687
  });
17688
- }).catch((m) => {
17689
- console.error(m);
17688
+ }).catch((g) => {
17689
+ console.error(g);
17690
17690
  }), () => {
17691
17691
  if (r) {
17692
17692
  if (h != null && h.id) {
17693
- const m = o.kosCore.modelManager.getModelById(
17693
+ const g = o.kosCore.modelManager.getModelById(
17694
17694
  h.id
17695
17695
  );
17696
- m == null || m.fsm.transitionTo(k.GO_INACTIVE, b.INACTIVE).then(() => {
17696
+ g == null || g.fsm.transitionTo(k.GO_INACTIVE, b.INACTIVE).then(() => {
17697
17697
  if (n) {
17698
17698
  const y = h.id;
17699
17699
  qe(h).then(() => {
17700
- pt.delete(y), p == null || p();
17700
+ pt.delete(y), f == null || f();
17701
17701
  });
17702
17702
  }
17703
17703
  });
17704
17704
  }
17705
17705
  } else
17706
17706
  n && h && qe(h).then(() => {
17707
- pt.delete(e), p == null || p();
17707
+ pt.delete(e), f == null || f();
17708
17708
  });
17709
17709
  };
17710
17710
  }, [
@@ -17781,12 +17781,12 @@ const Mu = Us(void 0), Hw = () => {
17781
17781
  rootUrl: n,
17782
17782
  descriptorResolver: o
17783
17783
  }) => {
17784
- const [i, a] = E(!1), [c, u] = E(), [d, h] = E(), f = n || Hw(), p = Y(() => e ?? "app/system", [e]);
17784
+ const [i, a] = E(!1), [c, u] = E(), [d, h] = E(), p = n || Hw(), f = Y(() => e ?? "app/system", [e]);
17785
17785
  S(() => {
17786
17786
  async function v() {
17787
- const U = (Array.isArray(p) ? p : [p]).map((se) => (o || Kb(se))()), L = (await Promise.allSettled(U)).map((se) => {
17787
+ const U = (Array.isArray(f) ? f : [f]).map((se) => (o || Kb(se))()), L = (await Promise.allSettled(U)).map((se) => {
17788
17788
  if (se.status === "rejected") {
17789
- g.warn("Failed to load localization descriptor", se.reason);
17789
+ m.warn("Failed to load localization descriptor", se.reason);
17790
17790
  return;
17791
17791
  }
17792
17792
  return se.value;
@@ -17803,10 +17803,10 @@ const Mu = Us(void 0), Hw = () => {
17803
17803
  u(L);
17804
17804
  }
17805
17805
  v();
17806
- }, [p, o]), S(() => {
17806
+ }, [f, o]), S(() => {
17807
17807
  async function v() {
17808
17808
  if (c) {
17809
- const _ = f, { translations: U } = await ev.init({
17809
+ const _ = p, { translations: U } = await ev.init({
17810
17810
  lang: s,
17811
17811
  descriptor: c,
17812
17812
  defaultNamespace: "common",
@@ -17817,8 +17817,8 @@ const Mu = Us(void 0), Hw = () => {
17817
17817
  }
17818
17818
  }
17819
17819
  v();
17820
- }, [s, c, r, f]);
17821
- const m = Y(() => i ? {
17820
+ }, [s, c, r, p]);
17821
+ const g = Y(() => i ? {
17822
17822
  setLocale: (v) => {
17823
17823
  d && (d.currentLocale = v);
17824
17824
  }
@@ -17827,7 +17827,7 @@ const Mu = Us(void 0), Hw = () => {
17827
17827
  throw new Error("Translations not ready");
17828
17828
  }
17829
17829
  }, [i, d]), y = i ? t : null;
17830
- return /* @__PURE__ */ w(Mu.Provider, { value: m, children: y });
17830
+ return /* @__PURE__ */ w(Mu.Provider, { value: g, children: y });
17831
17831
  }, PT = () => {
17832
17832
  const t = bt(Mu);
17833
17833
  if (!t)
@@ -17868,7 +17868,7 @@ function Kw({
17868
17868
  const u = c.getContext("2d");
17869
17869
  u == null || u.putImageData(a, 0, 0), t.imageSmoothingEnabled = !1, t.clearRect(0, 0, r * o, n * o), t.drawImage(c, 0, 0, r * o, n * o);
17870
17870
  }
17871
- const Gw = g.createLogger({ name: "canvas-streamer" });
17871
+ const Gw = m.createLogger({ name: "canvas-streamer" });
17872
17872
  Gw.debug("main-view component loaded");
17873
17873
  const Un = 10, Yw = pa(
17874
17874
  ({
@@ -17894,9 +17894,9 @@ const Un = 10, Yw = pa(
17894
17894
  const d = re(
17895
17895
  (h) => {
17896
17896
  if (a.current && n) {
17897
- const f = a.current.getContext("2d");
17898
- f && Kw({
17899
- ctx: f,
17897
+ const p = a.current.getContext("2d");
17898
+ p && Kw({
17899
+ ctx: p,
17900
17900
  format: "base64",
17901
17901
  dataString: h,
17902
17902
  height: e,
@@ -18021,8 +18021,8 @@ const BT = (t) => {
18021
18021
  async function d(h) {
18022
18022
  try {
18023
18023
  h && (await Te(h), o(!0));
18024
- } catch (f) {
18025
- a(f.message);
18024
+ } catch (p) {
18025
+ a(p.message);
18026
18026
  }
18027
18027
  }
18028
18028
  d(e);
@@ -18056,7 +18056,7 @@ function HT(t) {
18056
18056
  return /* @__PURE__ */ w(n, { ...r, children: /* @__PURE__ */ w(t, { ...e, storageDeviceContainer: s }) });
18057
18057
  };
18058
18058
  }
18059
- const jn = g.createLogger({ name: "use-timer" }), qT = ({
18059
+ const jn = m.createLogger({ name: "use-timer" }), qT = ({
18060
18060
  timerName: t,
18061
18061
  onTimerExpired: e,
18062
18062
  onTimerTick: s,
@@ -18070,8 +18070,8 @@ const jn = g.createLogger({ name: "use-timer" }), qT = ({
18070
18070
  return;
18071
18071
  }
18072
18072
  const u = I(lu, (d) => {
18073
- const { name: h, action: f, remainingTime: p } = d == null ? void 0 : d.body;
18074
- h === t && (f === du ? e({ name: h, action: f, remainingTime: p, timer: o }) : r != null && r[f] && r[f]({ name: h, action: f, remainingTime: p, timer: o }));
18073
+ const { name: h, action: p, remainingTime: f } = d == null ? void 0 : d.body;
18074
+ h === t && (p === du ? e({ name: h, action: p, remainingTime: f, timer: o }) : r != null && r[p] && r[p]({ name: h, action: p, remainingTime: f, timer: o }));
18075
18075
  });
18076
18076
  return n && o.start(), () => {
18077
18077
  u.unsubscribe();
@@ -18080,8 +18080,8 @@ const jn = g.createLogger({ name: "use-timer" }), qT = ({
18080
18080
  if (!o || !s)
18081
18081
  return;
18082
18082
  const u = `${uu}/${t}`, d = I(u, (h) => {
18083
- const { name: f, remainingTime: p } = h == null ? void 0 : h.body;
18084
- f === t && s({ name: f, remainingTime: p, timer: o });
18083
+ const { name: p, remainingTime: f } = h == null ? void 0 : h.body;
18084
+ p === t && s({ name: p, remainingTime: f, timer: o });
18085
18085
  });
18086
18086
  return () => {
18087
18087
  d.unsubscribe();
@@ -18181,10 +18181,10 @@ const lE = async () => {
18181
18181
  }), [e == null ? void 0 : e.keyPrefix, a]);
18182
18182
  return { t: re(
18183
18183
  (d, h) => {
18184
- const f = e != null && e.keyPrefix ? `${e.keyPrefix}.${d}` : d;
18185
- return a ? a.resolveKey(f, h) : (g.debug(
18186
- `Translation model ${t} not ready for key: ${f}`
18187
- ), f);
18184
+ const p = e != null && e.keyPrefix ? `${e.keyPrefix}.${d}` : d;
18185
+ return a ? a.resolveKey(p, h) : (m.debug(
18186
+ `Translation model ${t} not ready for key: ${p}`
18187
+ ), p);
18188
18188
  },
18189
18189
  [e == null ? void 0 : e.keyPrefix, t, a]
18190
18190
  ), i18n: c };
@@ -18264,16 +18264,16 @@ const ZT = ({ path: t, propKey: e }) => {
18264
18264
  options: {
18265
18265
  path: t
18266
18266
  }
18267
- }), [r, n] = E(!1), [o, i] = E(), [a, c] = E(""), [u, d] = E(), h = (f) => {
18268
- o && e && o.updateProperty(e, f);
18267
+ }), [r, n] = E(!1), [o, i] = E(), [a, c] = E(""), [u, d] = E(), h = (p) => {
18268
+ o && e && o.updateProperty(e, p);
18269
18269
  };
18270
18270
  return S(() => {
18271
- var f;
18272
- s.model && i(s.model), s.model && e && ((f = s.model) != null && f.props.has(e) ? c(s.model.props[e]) : d(`property ${e} not found`)), s.ready && n(s.ready);
18271
+ var p;
18272
+ s.model && i(s.model), s.model && e && ((p = s.model) != null && p.props.has(e) ? c(s.model.props[e]) : d(`property ${e} not found`)), s.ready && n(s.ready);
18273
18273
  }, [s.ready, s.model, e]), S(() => {
18274
18274
  e && Xt(() => {
18275
- const f = o == null ? void 0 : o.props[e];
18276
- c(f || "");
18275
+ const p = o == null ? void 0 : o.props[e];
18276
+ c(p || "");
18277
18277
  });
18278
18278
  }, [o, e]), {
18279
18279
  config: o,
@@ -18444,15 +18444,15 @@ function ME({
18444
18444
  dayFormat: a = "short"
18445
18445
  } = {}
18446
18446
  }) {
18447
- const c = $u(o, r), u = _E(o, r, t), d = TE(i, t), h = $E(i, t), f = Su(e, s), p = IE(e, s, t, n), m = DE(s, e, p), y = OE(t, a);
18447
+ const c = $u(o, r), u = _E(o, r, t), d = TE(i, t), h = $E(i, t), p = Su(e, s), f = IE(e, s, t, n), g = DE(s, e, f), y = OE(t, a);
18448
18448
  return {
18449
- daysArray: f,
18449
+ daysArray: p,
18450
18450
  monthsArray: d,
18451
18451
  yearsArray: c,
18452
18452
  yearsOptionsArray: u,
18453
18453
  monthsOptionsArray: h,
18454
- daysOptionsArray: p,
18455
- calendarDayArray: m,
18454
+ daysOptionsArray: f,
18455
+ calendarDayArray: g,
18456
18456
  dayNamesArray: y
18457
18457
  };
18458
18458
  }
@@ -18557,7 +18557,7 @@ function t$({
18557
18557
  daysOfWeekFilter: u = []
18558
18558
  } = {}
18559
18559
  }) {
18560
- const [d, h] = E(e), [f, p] = E(c), [m, y] = E(s), [v, _] = E(r);
18560
+ const [d, h] = E(e), [p, f] = E(c), [g, y] = E(s), [v, _] = E(r);
18561
18561
  S(() => {
18562
18562
  h(e);
18563
18563
  }, [e]), S(() => {
@@ -18577,8 +18577,8 @@ function t$({
18577
18577
  } = ME({
18578
18578
  locale: t,
18579
18579
  year: d,
18580
- yearRange: f,
18581
- month: m,
18580
+ yearRange: p,
18581
+ month: g,
18582
18582
  formatOptions: {
18583
18583
  yearFormat: n,
18584
18584
  monthFormat: o,
@@ -18587,18 +18587,18 @@ function t$({
18587
18587
  daysOfWeekFilter: u
18588
18588
  }), { formattedDate: ie } = CE({
18589
18589
  year: d,
18590
- month: m,
18590
+ month: g,
18591
18591
  day: v,
18592
18592
  formatString: a
18593
18593
  });
18594
18594
  return {
18595
18595
  dateActions: {
18596
18596
  setYear: h,
18597
- setYearRange: p,
18597
+ setYearRange: f,
18598
18598
  setMonth: y,
18599
18599
  setDay: _,
18600
18600
  nextMonth: () => {
18601
- const le = m < 11 ? Re(d) : Re(d + 1), me = m < 11 ? m + 1 : 0;
18601
+ const le = g < 11 ? Re(d) : Re(d + 1), me = g < 11 ? g + 1 : 0;
18602
18602
  if (!lr(le, me, v)) {
18603
18603
  const it = ur(le, me);
18604
18604
  _(it);
@@ -18606,7 +18606,7 @@ function t$({
18606
18606
  me === 0 && h(le), y(me);
18607
18607
  },
18608
18608
  previousMonth: () => {
18609
- const le = Re(m === 0 ? d - 1 : d), me = m === 0 ? 11 : m - 1;
18609
+ const le = Re(g === 0 ? d - 1 : d), me = g === 0 ? 11 : g - 1;
18610
18610
  if (!lr(le, me, v)) {
18611
18611
  const it = ur(le, me);
18612
18612
  _(it);
@@ -18614,28 +18614,28 @@ function t$({
18614
18614
  me === 11 && h(le), y(me);
18615
18615
  },
18616
18616
  nextYear: () => {
18617
- const le = d < f[1] ? d + 1 : f[0], me = Re(le);
18618
- if (lr(me, m, v))
18617
+ const le = d < p[1] ? d + 1 : p[0], me = Re(le);
18618
+ if (lr(me, g, v))
18619
18619
  h(le);
18620
18620
  else {
18621
- const it = ur(Re(d + 1), m);
18621
+ const it = ur(Re(d + 1), g);
18622
18622
  _(it), h(le);
18623
18623
  }
18624
18624
  },
18625
18625
  previousYear: () => {
18626
- const le = d > f[0] ? d - 1 : f[0], me = Re(le);
18627
- if (lr(me, m, v))
18626
+ const le = d > p[0] ? d - 1 : p[0], me = Re(le);
18627
+ if (lr(me, g, v))
18628
18628
  h(le);
18629
18629
  else {
18630
- const it = ur(Re(d - 1), m);
18630
+ const it = ur(Re(d - 1), g);
18631
18631
  _(it), h(le);
18632
18632
  }
18633
18633
  }
18634
18634
  },
18635
18635
  dateState: {
18636
18636
  year: d,
18637
- yearRange: f,
18638
- month: m,
18637
+ yearRange: p,
18638
+ month: g,
18639
18639
  day: v,
18640
18640
  yearsArray: U,
18641
18641
  yearsOptionsArray: D,
@@ -18686,11 +18686,11 @@ const PE = ({
18686
18686
  }
18687
18687
  });
18688
18688
  return S(() => {
18689
- const d = Number(t), h = Math.floor(d / 3600), f = Math.floor(d % 3600 / 60), p = d % 60;
18690
- s(h), n(f), i(p);
18691
- const m = /* @__PURE__ */ new Date();
18692
- m.setHours(0, 0, 0, 0);
18693
- const y = new Date(m.getTime() + d * 1e3);
18689
+ const d = Number(t), h = Math.floor(d / 3600), p = Math.floor(d % 3600 / 60), f = d % 60;
18690
+ s(h), n(p), i(f);
18691
+ const g = /* @__PURE__ */ new Date();
18692
+ g.setHours(0, 0, 0, 0);
18693
+ const y = new Date(g.getTime() + d * 1e3);
18694
18694
  c(new Date(y));
18695
18695
  }, [t]), {
18696
18696
  hours: e,
@@ -18934,7 +18934,7 @@ function c$(t, e, s = BE) {
18934
18934
  try {
18935
18935
  r.observe(t, o);
18936
18936
  } catch (i) {
18937
- g.error(i);
18937
+ m.error(i);
18938
18938
  }
18939
18939
  return () => {
18940
18940
  r && r.disconnect();
@@ -18949,7 +18949,7 @@ const HE = {
18949
18949
  const e = t.event.currentTarget.getBoundingClientRect(), [s, r] = t.xy;
18950
18950
  return s < e.left || s > e.right || r < e.top || r > e.bottom;
18951
18951
  }
18952
- }, Bn = g.createLogger({
18952
+ }, Bn = m.createLogger({
18953
18953
  name: "usePressGesture",
18954
18954
  group: "kos-hooks"
18955
18955
  });
@@ -19075,16 +19075,16 @@ function YE({
19075
19075
  }, []), u = re((y) => {
19076
19076
  const v = new Date(y);
19077
19077
  o(v);
19078
- }, []), d = GE(n, r), { hourOptions: h, minuteOptions: f, secondOptions: p, amPmOptions: m } = KE({
19078
+ }, []), d = GE(n, r), { hourOptions: h, minuteOptions: p, secondOptions: f, amPmOptions: g } = KE({
19079
19079
  formatOptions: t,
19080
19080
  locale: s
19081
19081
  });
19082
19082
  return {
19083
- amPmOptions: m,
19083
+ amPmOptions: g,
19084
19084
  formattedTime: d,
19085
19085
  hourOptions: h,
19086
- minuteOptions: f,
19087
- secondOptions: p,
19086
+ minuteOptions: p,
19087
+ secondOptions: f,
19088
19088
  setHours: i,
19089
19089
  setMinutes: a,
19090
19090
  setSeconds: c,
@@ -19104,20 +19104,20 @@ const u$ = (t) => {
19104
19104
  function d$(t, e, s = {}) {
19105
19105
  const { disposeOnUnmount: r = !0 } = s, [n, o] = E(!1), [i, a] = E(void 0), c = mt(null), u = mt(!0), d = mt(!1), h = Y(() => {
19106
19106
  if (!u.current && c.current && r && Cn(c.current)) {
19107
- const p = c.current;
19107
+ const f = c.current;
19108
19108
  Promise.resolve().then(() => {
19109
- Cn(p) && p.dispose();
19109
+ Cn(f) && f.dispose();
19110
19110
  });
19111
19111
  }
19112
19112
  u.current = !1, d.current = !1;
19113
- const f = t();
19114
- return c.current = f, f;
19113
+ const p = t();
19114
+ return c.current = p, p;
19115
19115
  }, e);
19116
19116
  return S(() => {
19117
19117
  d.current || (Hh(h) ? (d.current = !0, o(!1), a(void 0), h.ready().then(() => {
19118
19118
  o(!0);
19119
- }).catch((f) => {
19120
- a(f), o(!1);
19119
+ }).catch((p) => {
19120
+ a(p), o(!1);
19121
19121
  })) : (o(!0), a(void 0)));
19122
19122
  }, [h]), S(
19123
19123
  () => () => {
@@ -19132,7 +19132,7 @@ function h$(t) {
19132
19132
  return s ? /* @__PURE__ */ w(ww, { message: "Wait a moment while your project reloads..." }) : /* @__PURE__ */ w(t, { ...e });
19133
19133
  };
19134
19134
  }
19135
- const ca = g.createLogger({
19135
+ const ca = m.createLogger({
19136
19136
  name: "studio-properties-service",
19137
19137
  group: "Services"
19138
19138
  }), WE = "/api/kos/studio/properties", xu = async (t) => {
@@ -19214,7 +19214,7 @@ let co = class {
19214
19214
  }
19215
19215
  if (e) {
19216
19216
  const s = Object.keys(e).reduce((r, n) => (r[n] = e[n] ?? n, r), {});
19217
- this.data.setValues(s ?? la), g.ifDebug(
19217
+ this.data.setValues(s ?? la), m.ifDebug(
19218
19218
  () => this.logger.debug(`studio-properties loaded: ${JSON.stringify(s)}`)
19219
19219
  );
19220
19220
  }
@@ -19335,7 +19335,7 @@ export {
19335
19335
  Zd as KosFetchMethods,
19336
19336
  Fa as KosGlobalConfig,
19337
19337
  ac as KosHttpRouteManager,
19338
- g as KosLog,
19338
+ m as KosLog,
19339
19339
  Uy as KosLogManager,
19340
19340
  H_ as KosLogManagerServices,
19341
19341
  Qa as KosLoggerFactory,