@kosdev-code/kos-ddk-models 2.1.1 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/index.d.ts +0 -3
  2. package/index.d.ts.map +1 -1
  3. package/index.js +1 -1
  4. package/index.mjs +1339 -1635
  5. package/kos-models.json +358 -0
  6. package/lib/agitation-control/agitation-control-model.d.ts +5 -1
  7. package/lib/agitation-control/agitation-control-model.d.ts.map +1 -1
  8. package/lib/animation/animation-model.d.ts +4 -0
  9. package/lib/animation/animation-model.d.ts.map +1 -1
  10. package/lib/application/application-model.d.ts +4 -0
  11. package/lib/application/application-model.d.ts.map +1 -1
  12. package/lib/application/services/application-services.d.ts +3 -0
  13. package/lib/application/services/application-services.d.ts.map +1 -1
  14. package/lib/auth/auth-model.d.ts +4 -0
  15. package/lib/auth/auth-model.d.ts.map +1 -1
  16. package/lib/carb-water/carb-water-model.d.ts +5 -2
  17. package/lib/carb-water/carb-water-model.d.ts.map +1 -1
  18. package/lib/copy-logs/copy-logs-model.d.ts +4 -0
  19. package/lib/copy-logs/copy-logs-model.d.ts.map +1 -1
  20. package/lib/dashboard-operations/dashboard-operations-model.d.ts +4 -0
  21. package/lib/dashboard-operations/dashboard-operations-model.d.ts.map +1 -1
  22. package/lib/dispenser/dispenser-model.d.ts +4 -0
  23. package/lib/dispenser/dispenser-model.d.ts.map +1 -1
  24. package/lib/dispenser-info/dispenser-info-model.d.ts +4 -0
  25. package/lib/dispenser-info/dispenser-info-model.d.ts.map +1 -1
  26. package/lib/door/door-model.d.ts +6 -1
  27. package/lib/door/door-model.d.ts.map +1 -1
  28. package/lib/enrollment/enrollment-model.d.ts +4 -0
  29. package/lib/enrollment/enrollment-model.d.ts.map +1 -1
  30. package/lib/ingredient-summary/ingredient-summary-model.d.ts +4 -0
  31. package/lib/ingredient-summary/ingredient-summary-model.d.ts.map +1 -1
  32. package/lib/lockout/lockout-model.d.ts +4 -0
  33. package/lib/lockout/lockout-model.d.ts.map +1 -1
  34. package/lib/macro-assignment/macro-assignment-model.d.ts +4 -0
  35. package/lib/macro-assignment/macro-assignment-model.d.ts.map +1 -1
  36. package/lib/network-test/network-test-container-model.d.ts +4 -0
  37. package/lib/network-test/network-test-container-model.d.ts.map +1 -1
  38. package/lib/network-test/network-test-model.d.ts +4 -0
  39. package/lib/network-test/network-test-model.d.ts.map +1 -1
  40. package/lib/nutritive-sweetener/nutritive-sweetener-model.d.ts +12 -5
  41. package/lib/nutritive-sweetener/nutritive-sweetener-model.d.ts.map +1 -1
  42. package/lib/plain-water/plain-water-model.d.ts +5 -2
  43. package/lib/plain-water/plain-water-model.d.ts.map +1 -1
  44. package/lib/reboot/reboot-model.d.ts +4 -0
  45. package/lib/reboot/reboot-model.d.ts.map +1 -1
  46. package/lib/settings/settings-model.d.ts +8 -2
  47. package/lib/settings/settings-model.d.ts.map +1 -1
  48. package/lib/settings/types/index.d.ts +1 -1
  49. package/lib/setup-step/setup-step-container-model.d.ts +4 -0
  50. package/lib/setup-step/setup-step-container-model.d.ts.map +1 -1
  51. package/lib/setup-step/setup-step-model.d.ts +4 -0
  52. package/lib/setup-step/setup-step-model.d.ts.map +1 -1
  53. package/lib/trouble-action/index.d.ts +4 -1
  54. package/lib/trouble-action/index.d.ts.map +1 -1
  55. package/lib/trouble-action/trouble-action-model.d.ts +267 -7
  56. package/lib/trouble-action/trouble-action-model.d.ts.map +1 -1
  57. package/lib/trouble-action/types/index.d.ts +95 -0
  58. package/lib/utilities/services/utilities-services.d.ts +1 -1
  59. package/lib/utilities/services/utilities-services.d.ts.map +1 -1
  60. package/lib/utilities/utilities-container-model.d.ts +4 -0
  61. package/lib/utilities/utilities-container-model.d.ts.map +1 -1
  62. package/lib/utilities/utilities-model.d.ts +4 -0
  63. package/lib/utilities/utilities-model.d.ts.map +1 -1
  64. package/package.json +6 -5
  65. package/start/start-model.d.ts +4 -0
  66. package/start/start-model.d.ts.map +1 -1
  67. package/utils/openapi-index.d.ts +2 -0
  68. package/utils/openapi-index.d.ts.map +1 -0
  69. package/utils/services/kosdev.ddk/snapshot/openapi.d.ts +971 -0
  70. package/utils/services/kosdev.ddk/snapshot/service.d.ts +122 -0
  71. package/utils/services/kosdev.ddk/snapshot/service.d.ts.map +1 -0
  72. package/utils/services-index.d.ts +2 -0
  73. package/utils/services-index.d.ts.map +1 -0
  74. package/lib/fcm-pump/fcm-pump-model.d.ts +0 -28
  75. package/lib/fcm-pump/fcm-pump-model.d.ts.map +0 -1
  76. package/lib/fcm-pump/fcm-pump-registration.d.ts +0 -87
  77. package/lib/fcm-pump/fcm-pump-registration.d.ts.map +0 -1
  78. package/lib/fcm-pump/index.d.ts +0 -5
  79. package/lib/fcm-pump/index.d.ts.map +0 -1
  80. package/lib/fcm-pump/services/fcm-pump-services.d.ts +0 -17
  81. package/lib/fcm-pump/services/fcm-pump-services.d.ts.map +0 -1
  82. package/lib/fcm-pump/services/index.d.ts +0 -2
  83. package/lib/fcm-pump/services/index.d.ts.map +0 -1
  84. package/lib/fcm-pump/types/index.d.ts +0 -5
  85. package/lib/lfcv-pump/index.d.ts +0 -5
  86. package/lib/lfcv-pump/index.d.ts.map +0 -1
  87. package/lib/lfcv-pump/lfcv-pump-model.d.ts +0 -20
  88. package/lib/lfcv-pump/lfcv-pump-model.d.ts.map +0 -1
  89. package/lib/lfcv-pump/lfcv-pump-registration.d.ts +0 -87
  90. package/lib/lfcv-pump/lfcv-pump-registration.d.ts.map +0 -1
  91. package/lib/lfcv-pump/services/index.d.ts +0 -2
  92. package/lib/lfcv-pump/services/index.d.ts.map +0 -1
  93. package/lib/lfcv-pump/services/lfcv-pump-services.d.ts +0 -10
  94. package/lib/lfcv-pump/services/lfcv-pump-services.d.ts.map +0 -1
  95. package/lib/lfcv-pump/types/index.d.ts +0 -5
  96. package/lib/spm-pump/index.d.ts +0 -5
  97. package/lib/spm-pump/index.d.ts.map +0 -1
  98. package/lib/spm-pump/services/index.d.ts +0 -2
  99. package/lib/spm-pump/services/index.d.ts.map +0 -1
  100. package/lib/spm-pump/services/spm-pump-services.d.ts +0 -7
  101. package/lib/spm-pump/services/spm-pump-services.d.ts.map +0 -1
  102. package/lib/spm-pump/spm-pump-model.d.ts +0 -26
  103. package/lib/spm-pump/spm-pump-model.d.ts.map +0 -1
  104. package/lib/spm-pump/spm-pump-registration.d.ts +0 -87
  105. package/lib/spm-pump/spm-pump-registration.d.ts.map +0 -1
  106. package/lib/spm-pump/types/index.d.ts +0 -5
  107. package/lib/trouble-action/trouble-action-registration.d.ts +0 -89
  108. package/lib/trouble-action/trouble-action-registration.d.ts.map +0 -1
package/index.mjs CHANGED
@@ -1,38 +1,38 @@
1
- var Ar = Object.defineProperty;
2
- var jr = (e, t, r) => t in e ? Ar(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var s = (e, t, r) => (jr(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import { resolveServiceUrl as h, ServiceFactory as f, KosLog as g, kosTopicHandler as we, kosModel as l, kosAction as _, Kos as c, isKosModel as u, createPropKey as Ur, kosStateProp as Vr, KosModelRegistrationFactory as Ee, kosDependency as m, KosModelContainer as tt, resolveContainerDeltas as pt, kosChild as Le, Device as Hr, kosConfigProperty as d, kosFuture as v, kosModelEffect as $t, MultipleFutureHandler as Wr, FutureEndState as b, TroubleServices as De, Troubles as gt, SingletonKosModelRegistrationFactory as ke, FetchError as Re, FutureManager as T, FutureHandler as pe, getKosCompanionModel as rt, StorageDeviceContainer as Nr, kosFutureAware as zr, kosLoggerAware as Br, KosDataContainer as Kr, TroubleContainer as ot, troubleByTypeReducer as Yr, registerExtensionPoint as qr, ExtensionManager as Ie, kosConfigBean as Gr, ObservableData as Qr, kosAutoEffect as Xr } from "@kosdev-code/kos-ui-sdk";
5
- import { AGITATION_REQUIRED_TROUBLE as Tt, CartridgeAgitatorEvents as Pt, FreestyleHolder as Jr } from "@kosdev-code/kos-freestyle-sdk";
6
- import { Assembly as Fe, HolderContainer as Zr, IngredientContainer as eo } from "@kosdev-code/kos-dispense-sdk";
7
- const ht = "PurgeTrouble", to = "PrimeTrouble", { URL: it } = h("AUTH_SERVICE"), { getOne: ro, postModel: oo } = f.build({
8
- basePath: `${it}/api/auth`
9
- }), Ot = g.createLogger({ name: "auth-service", group: "Services" }), Mt = async () => (Ot.debug("sending GET for auth"), await ro({
10
- urlOverride: `${it}/api/app/kosdev.ddk/auth/role`
11
- })), St = async (e) => (Ot.debug("sending POST for auth"), await oo({
12
- urlOverride: `${it}/api/app/kosdev.ddk/auth/pincode/${e}`,
1
+ var yo = Object.defineProperty;
2
+ var fo = (e, t, o) => t in e ? yo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
+ var i = (e, t, o) => (fo(e, typeof t != "symbol" ? t + "" : t, o), o);
4
+ import { resolveServiceUrl as h, ServiceFactory as y, KosLog as g, kosTopicHandler as Te, kosModel as l, kosAction as v, Kos as c, isKosModel as u, createPropKey as ht, kosStateProp as vo, kosConfigProperty as d, KosModelRegistrationFactory as mo, kosDependency as p, KosModelContainer as Ve, resolveContainerDeltas as it, kosChild as $e, Device as bo, kosFuture as M, kosModelEffect as Pe, MultipleFutureHandler as _o, FutureEndState as T, TroubleServices as Me, Troubles as nt, SingletonKosModelRegistrationFactory as He, getKosCompanionModel as Be, FetchError as yt, StorageDeviceContainer as To, kosFutureAware as $o, kosLoggerAware as Ke, KosDataContainer as Po, TroubleContainer as Ye, FutureHandler as Ge, troubleByTypeReducer as Mo, registerExtensionPoint as Oo, ExtensionManager as Oe, kosConfigBean as So, kosStateBean as wo, ObservableData as Eo } from "@kosdev-code/kos-ui-sdk";
5
+ import { AGITATION_REQUIRED_TROUBLE as ft, CartridgeAgitatorEvents as vt, FcmPump as mt, FreestyleHolder as Co } from "@kosdev-code/kos-freestyle-sdk";
6
+ import { Assembly as Se, HolderContainer as Lo, IngredientContainer as Do } from "@kosdev-code/kos-dispense-sdk";
7
+ const at = "PurgeTrouble", ko = "PrimeTrouble", { URL: qe } = h("AUTH_SERVICE"), { getOne: Io, postModel: Ro } = y.build({
8
+ basePath: `${qe}/api/auth`
9
+ }), bt = g.createLogger({ name: "auth-service", group: "Services" }), _t = async () => (bt.debug("sending GET for auth"), await Io({
10
+ urlOverride: `${qe}/api/app/kosdev.ddk/auth/role`
11
+ })), Tt = async (e) => (bt.debug("sending POST for auth"), await Ro({
12
+ urlOverride: `${qe}/api/app/kosdev.ddk/auth/pincode/${e}`,
13
13
  model: {}
14
- })), Ss = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
14
+ })), Bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
15
15
  __proto__: null,
16
- getCurrentRole: Mt,
17
- sendPinCode: St
16
+ getCurrentRole: _t,
17
+ sendPinCode: Tt
18
18
  }, Symbol.toStringTag, { value: "Module" }));
19
- var io = Object.defineProperty, so = Object.getOwnPropertyDescriptor, Ct = (e, t, r, i) => {
20
- for (var o = i > 1 ? void 0 : i ? so(t, r) : t, n = e.length - 1, a; n >= 0; n--)
21
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
22
- return i && o && io(t, r, o), o;
23
- };
24
- const z = "auth-model", ft = (e) => e.toLowerCase();
25
- let be = class {
26
- constructor(e, t, r) {
27
- s(this, "id");
28
- s(this, "logger");
29
- s(this, "currentRole");
30
- this.id = e, this.logger = r.logger, this.currentRole = "crew";
19
+ var Ao = Object.defineProperty, Fo = Object.getOwnPropertyDescriptor, $t = (e, t, o, s) => {
20
+ for (var r = s > 1 ? void 0 : s ? Fo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
21
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
22
+ return s && r && Ao(t, o, r), r;
23
+ };
24
+ const x = "auth-model", lt = (e) => e.toLowerCase();
25
+ let he = class {
26
+ constructor(e, t, o) {
27
+ i(this, "id");
28
+ i(this, "logger");
29
+ i(this, "currentRole");
30
+ this.id = e, this.logger = o.logger, this.currentRole = "crew";
31
31
  }
32
32
  async authorize(e) {
33
33
  if (!e)
34
34
  return !1;
35
- const t = await St(e);
35
+ const t = await Tt(e);
36
36
  return (t == null ? void 0 : t.status) === 200 ? t.data : !1;
37
37
  }
38
38
  // -------------------LIFECYCLE----------------------------
@@ -41,99 +41,109 @@ let be = class {
41
41
  }
42
42
  async load() {
43
43
  this.logger.debug(`loading auth ${this.id}`);
44
- const e = await Mt();
45
- (e == null ? void 0 : e.status) === 200 && (this.logger.debug(`response ${e.data}`), _(() => {
46
- this.currentRole = ft(e.data);
44
+ const e = await _t();
45
+ (e == null ? void 0 : e.status) === 200 && (this.logger.debug(`response ${e.data}`), v(() => {
46
+ this.currentRole = lt(e.data);
47
47
  }));
48
48
  }
49
49
  handleRoleChange(e) {
50
- this.currentRole = ft(e);
50
+ this.currentRole = lt(e);
51
51
  }
52
52
  forceRole(e) {
53
53
  this.currentRole = e;
54
54
  }
55
55
  };
56
- Ct([
57
- we({
56
+ $t([
57
+ Te({
58
58
  topic: "/app/kosdev.ddk/auth/role",
59
59
  websocket: !0
60
60
  })
61
- ], be.prototype, "handleRoleChange", 1);
62
- be = Ct([
63
- l(z)
64
- ], be);
65
- const st = {
61
+ ], he.prototype, "handleRoleChange", 1);
62
+ he = $t([
63
+ l(x)
64
+ ], he);
65
+ const Qe = {
66
66
  registration: {
67
- [z]: {
68
- class: be,
67
+ [x]: {
68
+ class: he,
69
69
  singleton: !1
70
70
  }
71
71
  },
72
- type: z,
73
- predicate: u(z),
74
- factory: c.Factory.create(z)
75
- };
76
- var ao = Object.defineProperty, no = Object.getOwnPropertyDescriptor, wt = (e, t, r, i) => {
77
- for (var o = i > 1 ? void 0 : i ? no(t, r) : t, n = e.length - 1, a; n >= 0; n--)
78
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
79
- return i && o && ao(t, r, o), o;
80
- };
81
- const Et = "door-model", lo = Ur("doorPath");
82
- let ve = class {
83
- constructor(e, t, r) {
84
- s(this, "id");
85
- s(this, "logger");
86
- s(this, "doorPath");
87
- s(this, "open");
88
- this.id = e, this.logger = r.logger, this.doorPath = t.doorPath;
72
+ type: x,
73
+ predicate: u(x),
74
+ factory: c.Factory.create(x)
75
+ };
76
+ var xo = Object.defineProperty, Uo = Object.getOwnPropertyDescriptor, Xe = (e, t, o, s) => {
77
+ for (var r = s > 1 ? void 0 : s ? Uo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
78
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
79
+ return s && r && xo(t, o, r), r;
80
+ };
81
+ const Pt = "door-model", jo = ht("doorPath");
82
+ let re = class {
83
+ constructor(e, t, o) {
84
+ i(this, "id");
85
+ i(this, "logger");
86
+ i(this, "doorPath");
87
+ i(this, "open");
88
+ i(this, "ignoreDoor");
89
+ this.id = e, this.logger = o.logger, this.doorPath = t.doorPath;
89
90
  }
90
91
  get currentState() {
91
92
  return this.open.value === void 0 ? "UNKNOWN" : this.open.value ? "OPEN" : "CLOSED";
92
93
  }
93
94
  get isOpen() {
94
- return this.open.value === void 0 ? !0 : this.open.value;
95
+ const e = this.open.value === void 0 ? !0 : this.open.value;
96
+ return this.ignoreDoor.value ? (this.logger.debug(
97
+ "Door state is being ignored (treating as closed) due to ignoreDoor config property being true."
98
+ ), !1) : e;
95
99
  }
96
100
  };
97
- wt([
98
- Vr({ path: lo, attribute: "state" })
99
- ], ve.prototype, "open", 2);
100
- ve = wt([
101
- l(Et)
102
- ], ve);
103
- const co = new Ee({
104
- class: ve,
105
- type: Et
106
- }), { URL: at } = h("SETUP-STEP_SERVICE"), { getAll: uo, postModel: po } = f.build({
107
- basePath: `${at}/api/setup-step`
108
- }), Lt = g.createLogger({
101
+ Xe([
102
+ vo({ path: jo, attribute: "state" })
103
+ ], re.prototype, "open", 2);
104
+ Xe([
105
+ d({
106
+ path: "app:kosdev.ddk:app",
107
+ attribute: "ncui.ignoreDoorStateOnExit"
108
+ })
109
+ ], re.prototype, "ignoreDoor", 2);
110
+ re = Xe([
111
+ l(Pt)
112
+ ], re);
113
+ const Wo = new mo({
114
+ class: re,
115
+ type: Pt
116
+ }), { URL: Je } = h("SETUP-STEP_SERVICE"), { getAll: No, postModel: zo } = y.build({
117
+ basePath: `${Je}/api/setup-step`
118
+ }), Mt = g.createLogger({
109
119
  name: "setup-step-service",
110
120
  group: "Services"
111
- }), Dt = async () => (Lt.debug("sending GET for setup-step"), await uo({
112
- urlOverride: `${at}/api/app/kosdev.ddk/setup/steps`
113
- })), kt = async (e) => (Lt.debug("sending POST for setup-step"), await po({
114
- urlOverride: `${at}/api/app/kosdev.ddk/setup/complete/${e}`,
121
+ }), Ot = async () => (Mt.debug("sending GET for setup-step"), await No({
122
+ urlOverride: `${Je}/api/app/kosdev.ddk/setup/steps`
123
+ })), St = async (e) => (Mt.debug("sending POST for setup-step"), await zo({
124
+ urlOverride: `${Je}/api/app/kosdev.ddk/setup/complete/${e}`,
115
125
  model: {}
116
- })), Cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
126
+ })), Ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
117
127
  __proto__: null,
118
- getSetupSteps: Dt,
119
- markStepComplete: kt
128
+ getSetupSteps: Ot,
129
+ markStepComplete: St
120
130
  }, Symbol.toStringTag, { value: "Module" }));
121
- var go = Object.getOwnPropertyDescriptor, ho = (e, t, r, i) => {
122
- for (var o = i > 1 ? void 0 : i ? go(t, r) : t, n = e.length - 1, a; n >= 0; n--)
123
- (a = e[n]) && (o = a(o) || o);
124
- return o;
131
+ var Vo = Object.getOwnPropertyDescriptor, Ho = (e, t, o, s) => {
132
+ for (var r = s > 1 ? void 0 : s ? Vo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
133
+ (a = e[n]) && (r = a(r) || r);
134
+ return r;
125
135
  };
126
- const B = "setup-step-model";
127
- let Ke = class {
128
- constructor(e, t, r) {
129
- s(this, "id");
130
- s(this, "idx");
131
- s(this, "name");
132
- s(this, "complete");
133
- s(this, "preStep");
134
- s(this, "exclusive");
135
- s(this, "logger");
136
- this.id = e, this.idx = t.idx, this.logger = r.logger, this.name = t.name, this.complete = t.complete, this.preStep = t.preStep, this.exclusive = t.exclusive;
136
+ const U = "setup-step-model";
137
+ let Ae = class {
138
+ constructor(e, t, o) {
139
+ i(this, "id");
140
+ i(this, "idx");
141
+ i(this, "name");
142
+ i(this, "complete");
143
+ i(this, "preStep");
144
+ i(this, "exclusive");
145
+ i(this, "logger");
146
+ this.id = e, this.idx = t.idx, this.logger = o.logger, this.name = t.name, this.complete = t.complete, this.preStep = t.preStep, this.exclusive = t.exclusive;
137
147
  }
138
148
  updateModel(e) {
139
149
  this.name = e.name, this.idx = e.idx, this.complete = e.complete, this.preStep = e.preStep, this.exclusive = e.exclusive;
@@ -145,8 +155,8 @@ let Ke = class {
145
155
  return `setup.${this.name}.body`;
146
156
  }
147
157
  async completeStep() {
148
- const e = await kt(this.name);
149
- (e == null ? void 0 : e.status) === 200 && _(() => {
158
+ const e = await St(this.name);
159
+ (e == null ? void 0 : e.status) === 200 && v(() => {
150
160
  this.complete = !0;
151
161
  });
152
162
  }
@@ -158,45 +168,45 @@ let Ke = class {
158
168
  this.logger.debug(`loading setup-step ${this.id}`);
159
169
  }
160
170
  };
161
- Ke = ho([
162
- l(B)
163
- ], Ke);
164
- const Rt = {
171
+ Ae = Ho([
172
+ l(U)
173
+ ], Ae);
174
+ const wt = {
165
175
  registration: {
166
- [B]: {
167
- class: Ke,
176
+ [U]: {
177
+ class: Ae,
168
178
  singleton: !1
169
179
  }
170
180
  },
171
- type: B,
172
- predicate: u(B),
173
- factory: c.Factory.create(B)
181
+ type: U,
182
+ predicate: u(U),
183
+ factory: c.Factory.create(U)
174
184
  };
175
- var fo = Object.defineProperty, mo = Object.getOwnPropertyDescriptor, xe = (e, t, r, i) => {
176
- for (var o = i > 1 ? void 0 : i ? mo(t, r) : t, n = e.length - 1, a; n >= 0; n--)
177
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
178
- return i && o && fo(t, r, o), o;
185
+ var Bo = Object.defineProperty, Ko = Object.getOwnPropertyDescriptor, we = (e, t, o, s) => {
186
+ for (var r = s > 1 ? void 0 : s ? Ko(t, o) : t, n = e.length - 1, a; n >= 0; n--)
187
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
188
+ return s && r && Bo(t, o, r), r;
179
189
  };
180
- const K = "setup-step-container-model";
181
- function mt(e) {
190
+ const j = "setup-step-container-model";
191
+ function dt(e) {
182
192
  return (t) => {
183
- const r = Rt.factory(t.id)(t);
184
- r.updateModel(t), e.addModel(r);
193
+ const o = wt.factory(t.id)(t);
194
+ o.updateModel(t), e.addModel(o);
185
195
  };
186
196
  }
187
- function yt(e) {
197
+ function ct(e) {
188
198
  return (t) => {
189
199
  e.removeModel(t);
190
200
  };
191
201
  }
192
- let R = class {
193
- constructor(e, t, r) {
194
- s(this, "id");
195
- s(this, "_currentStep");
196
- s(this, "logger");
197
- s(this, "models");
198
- s(this, "authModel");
199
- this.id = e, this.logger = r.logger, this._currentStep = void 0, this.models = new tt({
202
+ let E = class {
203
+ constructor(e, t, o) {
204
+ i(this, "id");
205
+ i(this, "_currentStep");
206
+ i(this, "logger");
207
+ i(this, "models");
208
+ i(this, "authModel");
209
+ this.id = e, this.logger = o.logger, this._currentStep = void 0, this.models = new Ve({
200
210
  parentId: e,
201
211
  sortKey: "idx"
202
212
  });
@@ -212,7 +222,7 @@ let R = class {
212
222
  if (!this._currentStep)
213
223
  this._currentStep = this.firstIncompleteStep;
214
224
  else {
215
- const e = this._currentStep.idx, t = this.models.data.find((r) => r.idx > e);
225
+ const e = this._currentStep.idx, t = this.models.data.find((o) => o.idx > e);
216
226
  t && (this._currentStep = t);
217
227
  }
218
228
  }
@@ -247,112 +257,124 @@ let R = class {
247
257
  }
248
258
  async load() {
249
259
  this.logger.debug(`loading setup-step-container container ${this.id}`);
250
- const e = await Dt();
260
+ const e = await Ot();
251
261
  if (e != null && e.data) {
252
262
  const t = e.data.map(
253
- (r, i) => ({
254
- ...r,
255
- idx: i,
256
- id: `setup-${r.name}`
263
+ (o, s) => ({
264
+ ...o,
265
+ idx: s,
266
+ id: `setup-${o.name}`
257
267
  })
258
268
  );
259
- pt({
269
+ it({
260
270
  container: this.models,
261
- onAddItem: mt(this),
262
- onRemoveItem: yt(this)
271
+ onAddItem: dt(this),
272
+ onRemoveItem: ct(this)
263
273
  })(t);
264
274
  }
265
275
  this.nextStep();
266
276
  }
267
277
  handleStepChanges(e) {
268
- const t = e.map((r, i) => ({
269
- ...r,
270
- idx: i,
271
- id: `setup-${r.name}`
278
+ const t = e.map((o, s) => ({
279
+ ...o,
280
+ idx: s,
281
+ id: `setup-${o.name}`
272
282
  }));
273
- pt({
283
+ it({
274
284
  container: this.models,
275
- onAddItem: mt(this),
276
- onRemoveItem: yt(this)
285
+ onAddItem: dt(this),
286
+ onRemoveItem: ct(this)
277
287
  })(t);
278
288
  }
279
289
  };
280
- xe([
281
- Le
282
- ], R.prototype, "models", 2);
283
- xe([
284
- m({ modelType: st.type })
285
- ], R.prototype, "authModel", 2);
286
- xe([
287
- we({
290
+ we([
291
+ $e
292
+ ], E.prototype, "models", 2);
293
+ we([
294
+ p({ modelType: Qe.type })
295
+ ], E.prototype, "authModel", 2);
296
+ we([
297
+ Te({
288
298
  topic: "/app/kosdev.ddk/setup/steps",
289
299
  websocket: !0
290
300
  })
291
- ], R.prototype, "handleStepChanges", 1);
292
- R = xe([
293
- l(K)
294
- ], R);
295
- const It = {
301
+ ], E.prototype, "handleStepChanges", 1);
302
+ E = we([
303
+ l(j)
304
+ ], E);
305
+ const Et = {
296
306
  registration: {
297
- [K]: {
298
- class: R,
307
+ [j]: {
308
+ class: E,
299
309
  singleton: !0
300
310
  },
301
- ...Rt.registration
311
+ ...wt.registration
302
312
  },
303
- type: K,
304
- predicate: u(K),
305
- factory: c.Singleton.create(K)
306
- }, { URL: ge } = h("AUTH_SERVICE"), { getOne: Ft, getAll: xt } = f.build({
307
- basePath: `${ge}/api/app/kosdev.ddk/ncui/`
308
- }), Ae = g.createLogger({ name: "auth-service", group: "Services" }), yo = async () => {
309
- Ae.debug("sending GET for cuis");
310
- const e = await xt({
311
- urlOverride: `${ge}/api/app/kosdev.ddk/cui`
313
+ type: j,
314
+ predicate: u(j),
315
+ factory: c.Singleton.create(j)
316
+ }, { URL: S } = h("AUTH_SERVICE"), { getOne: Ct, getAll: pe } = y.build({
317
+ basePath: `${S}/api/app/kosdev.ddk/ncui/`
318
+ }), se = g.createLogger({ name: "auth-service", group: "Services" }), Yo = async () => {
319
+ se.debug("sending GET for cuis");
320
+ const e = await pe({
321
+ urlOverride: `${S}/api/app/kosdev.ddk/cui`
312
322
  });
313
323
  if ((e == null ? void 0 : e.status) !== 200)
314
324
  throw new Error("Failed to retrieve cuis");
315
325
  return e.data;
316
- }, bo = async () => {
317
- Ae.debug("sending GET for navigation");
318
- const e = await xt({
319
- urlOverride: `${ge}/api/kos/descriptor/system:app/kondra.ncui.navigations`
320
- });
321
- if ((e == null ? void 0 : e.status) !== 200)
322
- throw new Error("Failed to retrieve navigation data");
323
- return e.data;
324
- }, vo = async () => (Ae.debug("navigating to CUI"), await Ft({
325
- urlOverride: `${ge}/api/app/kosdev.ddk/cui/open`
326
- })), _o = async () => (Ae.debug("navigating to NCUI"), await Ft({
327
- urlOverride: `${ge}/api/app/kosdev.ddk/ncui/open`
326
+ }, Go = async () => {
327
+ se.debug("sending GET for navigation");
328
+ try {
329
+ const e = await pe({
330
+ urlOverride: `${S}/api/kos/descriptor/app:kosdev.ddk:ncuiDescriptor/kondra.ncui.navigations`
331
+ });
332
+ if ((e == null ? void 0 : e.status) !== 200) {
333
+ se.info("no extensions found, using base data");
334
+ const t = await pe({
335
+ urlOverride: `${S}/api/kos/descriptor/system:app/kondra.ncui.navigations`
336
+ });
337
+ return (t == null ? void 0 : t.data) ?? [];
338
+ }
339
+ return (e == null ? void 0 : e.data) ?? [];
340
+ } catch {
341
+ const t = await pe({
342
+ urlOverride: `${S}/api/kos/descriptor/system:app/kondra.ncui.navigations`
343
+ });
344
+ return (t == null ? void 0 : t.data) ?? [];
345
+ }
346
+ }, qo = async () => (se.debug("navigating to CUI"), await Ct({
347
+ urlOverride: `${S}/api/app/kosdev.ddk/cui/open`
348
+ })), Qo = async () => (se.debug("navigating to NCUI"), await Ct({
349
+ urlOverride: `${S}/api/app/kosdev.ddk/ncui/open`
328
350
  }));
329
- var $o = Object.defineProperty, To = Object.getOwnPropertyDescriptor, L = (e, t, r, i) => {
330
- for (var o = i > 1 ? void 0 : i ? To(t, r) : t, n = e.length - 1, a; n >= 0; n--)
331
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
332
- return i && o && $o(t, r, o), o;
333
- };
334
- const Y = "application-model", At = (e, t = "") => e.reduce((r, i) => {
335
- const o = t ? `${t}.${i.name}` : i.name;
336
- if (r[o] = { ...i, root: !t }, i.children) {
337
- const n = At(i.children, o);
351
+ var Xo = Object.defineProperty, Jo = Object.getOwnPropertyDescriptor, O = (e, t, o, s) => {
352
+ for (var r = s > 1 ? void 0 : s ? Jo(t, o) : t, n = e.length - 1, a; n >= 0; n--)
353
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
354
+ return s && r && Xo(t, o, r), r;
355
+ };
356
+ const W = "application-model", Lt = (e, t = "") => e.reduce((o, s) => {
357
+ const r = t ? `${t}.${s.name}` : s.name;
358
+ if (o[r] = { ...s, root: !t }, s.children) {
359
+ const n = Lt(s.children, r);
338
360
  Object.keys(n).forEach((a) => {
339
- r[a] = n[a];
361
+ o[a] = n[a];
340
362
  });
341
363
  }
342
- return r;
364
+ return o;
343
365
  }, {});
344
- let M = class {
345
- constructor(e, t, r) {
346
- s(this, "id");
347
- s(this, "device");
348
- s(this, "authModel");
349
- s(this, "setupStepContainer");
350
- s(this, "door");
351
- s(this, "ncuiLanguage");
352
- s(this, "activeCui");
353
- s(this, "fallbackCui");
354
- s(this, "_cuis", []);
355
- s(this, "_navigationItems", []);
366
+ let b = class {
367
+ constructor(e, t, o) {
368
+ i(this, "id");
369
+ i(this, "device");
370
+ i(this, "authModel");
371
+ i(this, "setupStepContainer");
372
+ i(this, "door");
373
+ i(this, "ncuiLanguage");
374
+ i(this, "activeCui");
375
+ i(this, "fallbackCui");
376
+ i(this, "_cuis", []);
377
+ i(this, "_navigationItems", []);
356
378
  // @kosConfigProperty({
357
379
  // path: 'somewhere.enable.dial.animation',
358
380
  // attribute: 'enableDialAnimation',
@@ -368,9 +390,9 @@ let M = class {
368
390
  // attribute: 'enableSidebarAnimation',
369
391
  // })
370
392
  // enableSidebarAnimation!: KosConfigProperty<boolean>;
371
- s(this, "languages");
372
- s(this, "logger");
373
- this.id = e, this.languages = [], this._cuis = [], this.logger = r.logger, this.door = co.instance("app:kosdev.ddk:service:door:door").options({
393
+ i(this, "languages");
394
+ i(this, "logger");
395
+ this.id = e, this.languages = [], this._cuis = [], this.logger = o.logger, this.door = Wo.instance("app:kosdev.ddk:service:door:door").options({
374
396
  doorPath: "app:kosdev.ddk:service:door:door"
375
397
  }).build();
376
398
  }
@@ -381,10 +403,10 @@ let M = class {
381
403
  return this.authModel.currentRole;
382
404
  }
383
405
  get cuis() {
384
- return this._cuis.reduce((e, t) => (e[t.name] = t, e), {});
406
+ return this._cuis.reduce((e, t) => (e[t.appId] = t, e), {});
385
407
  }
386
408
  get navigationItems() {
387
- return At(this._navigationItems);
409
+ return Lt(this._navigationItems);
388
410
  }
389
411
  get hasCuiDefined() {
390
412
  return !!this.activeCui.value || !!this.fallbackCui.value;
@@ -393,19 +415,19 @@ let M = class {
393
415
  return this.door.isOpen;
394
416
  }
395
417
  async enter() {
396
- this.logger.info("navigating to NCUI"), await _o();
418
+ this.logger.info("navigating to NCUI"), await Qo();
397
419
  }
398
420
  async exit() {
399
- this.logger.info("navigating to CUI"), await vo();
421
+ this.logger.info("navigating to CUI"), await qo();
400
422
  }
401
423
  // -------------------LIFECYCLE----------------------------
402
424
  async load() {
403
- var r, i;
425
+ var o, s;
404
426
  this.logger.debug(`loading application ${this.id}`);
405
- const e = await bo();
427
+ const e = await Go();
406
428
  this._navigationItems = e;
407
- const t = await yo();
408
- this._cuis = t, (r = this.setupStepContainer) != null && r.hasIncompletePreSteps && ((i = this.authModel) == null || i.forceRole("technician")), this.languages = [
429
+ const t = await Yo();
430
+ this._cuis = t, (o = this.setupStepContainer) != null && o.hasIncompletePreSteps && ((s = this.authModel) == null || s.forceRole("technician")), this.languages = [
409
431
  {
410
432
  name: "English",
411
433
  locale: "en"
@@ -413,87 +435,87 @@ let M = class {
413
435
  ];
414
436
  }
415
437
  };
416
- L([
417
- m({ modelType: Hr.type })
418
- ], M.prototype, "device", 2);
419
- L([
420
- m({ modelType: st.type })
421
- ], M.prototype, "authModel", 2);
422
- L([
423
- m({ modelType: It.type })
424
- ], M.prototype, "setupStepContainer", 2);
425
- L([
426
- Le
427
- ], M.prototype, "door", 2);
428
- L([
438
+ O([
439
+ p({ modelType: bo.type })
440
+ ], b.prototype, "device", 2);
441
+ O([
442
+ p({ modelType: Qe.type })
443
+ ], b.prototype, "authModel", 2);
444
+ O([
445
+ p({ modelType: Et.type })
446
+ ], b.prototype, "setupStepContainer", 2);
447
+ O([
448
+ $e
449
+ ], b.prototype, "door", 2);
450
+ O([
429
451
  d({
430
452
  path: "app:kosdev.ddk:app",
431
453
  attribute: "ncui.ncuiLanguage"
432
454
  //updated attribute for language config property
433
455
  })
434
- ], M.prototype, "ncuiLanguage", 2);
435
- L([
456
+ ], b.prototype, "ncuiLanguage", 2);
457
+ O([
436
458
  d({
437
459
  path: "app:kosdev.ddk:service:cui",
438
460
  attribute: "activeCui"
439
461
  })
440
- ], M.prototype, "activeCui", 2);
441
- L([
462
+ ], b.prototype, "activeCui", 2);
463
+ O([
442
464
  d({
443
465
  path: "app:kosdev.ddk:service:cui",
444
466
  attribute: "fallbackCui"
445
467
  })
446
- ], M.prototype, "fallbackCui", 2);
447
- M = L([
448
- l(Y)
449
- ], M);
450
- const nt = {
468
+ ], b.prototype, "fallbackCui", 2);
469
+ b = O([
470
+ l(W)
471
+ ], b);
472
+ const Ze = {
451
473
  registration: {
452
- [Y]: {
453
- class: M,
474
+ [W]: {
475
+ class: b,
454
476
  singleton: !0
455
477
  }
456
478
  },
457
- type: Y,
458
- predicate: u(Y),
479
+ type: W,
480
+ predicate: u(W),
459
481
  factory: c.Singleton.create(
460
- Y
482
+ W
461
483
  )
462
- }, ye = {
484
+ }, ue = {
463
485
  none: 999,
464
486
  crew: 0,
465
487
  technician: 1,
466
488
  manager: 2
467
- }, jt = (e) => (t) => {
468
- if (t.type === Tt)
489
+ }, Dt = (e) => (t) => {
490
+ if (t.type === ft)
469
491
  return !1;
470
- const r = (t == null ? void 0 : t.role) || "technician";
471
- if (e && r) {
472
- const i = ye[e.toLowerCase()] ?? ye.crew, o = ye[r.toLowerCase()] ?? ye.crew;
473
- return i >= o;
492
+ const o = (t == null ? void 0 : t.role) || "technician";
493
+ if (e && o) {
494
+ const s = ue[e.toLowerCase()] ?? ue.crew, r = ue[o.toLowerCase()] ?? ue.crew;
495
+ return s >= r;
474
496
  }
475
497
  return !1;
476
498
  };
477
- var Po = Object.defineProperty, Oo = Object.getOwnPropertyDescriptor, U = (e, t, r, i) => {
478
- for (var o = i > 1 ? void 0 : i ? Oo(t, r) : t, n = e.length - 1, a; n >= 0; n--)
479
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
480
- return i && o && Po(t, r, o), o;
481
- };
482
- const Ut = "agitation-control-model", Ye = "resolve", Mo = "agitate";
483
- let w = class {
484
- constructor(e, t, r) {
485
- s(this, "id");
486
- s(this, "futureHandler");
487
- s(this, "logger");
488
- s(this, "troubleContainer");
489
- s(this, "_agitationFutureId");
490
- s(this, "_canExit", !0);
491
- s(this, "_exiting", !1);
492
- s(this, "_isFailed", !1);
493
- s(this, "disposer");
494
- s(this, "application");
495
- s(this, "inProgress", []);
496
- this.id = e, this.logger = r.logger, this.troubleContainer = t.companionParent, this.futureHandler = new Wr(this, Ye);
499
+ var Zo = Object.defineProperty, er = Object.getOwnPropertyDescriptor, I = (e, t, o, s) => {
500
+ for (var r = s > 1 ? void 0 : s ? er(t, o) : t, n = e.length - 1, a; n >= 0; n--)
501
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
502
+ return s && r && Zo(t, o, r), r;
503
+ };
504
+ const kt = "agitation-control-model", Fe = "resolve", tr = "agitate";
505
+ let $ = class {
506
+ constructor(e, t, o) {
507
+ i(this, "id");
508
+ i(this, "futureHandler");
509
+ i(this, "logger");
510
+ i(this, "troubleContainer");
511
+ i(this, "_agitationFutureId");
512
+ i(this, "_canExit", !0);
513
+ i(this, "_exiting", !1);
514
+ i(this, "_isFailed", !1);
515
+ i(this, "disposer");
516
+ i(this, "application");
517
+ i(this, "inProgress", []);
518
+ this.id = e, this.logger = o.logger, this.troubleContainer = t.companionParent, this.futureHandler = new _o(this, Fe);
497
519
  }
498
520
  set isFailed(e) {
499
521
  this._isFailed = e;
@@ -522,23 +544,23 @@ let w = class {
522
544
  });
523
545
  }
524
546
  get readyToResolve() {
525
- const e = this.queuedTroubles.length, t = this.queuedTroubles.filter((i) => i.shouldDefer), r = e > 0 && t.length === 0;
526
- return this.isDoorClosed && r && this.exiting;
547
+ const e = this.queuedTroubles.length, t = this.queuedTroubles.filter((s) => s.shouldDefer), o = e > 0 && t.length === 0;
548
+ return this.isDoorClosed && o && this.exiting;
527
549
  }
528
550
  onFutureUpdate(e) {
529
- e.endState === b.Success ? (this.logger.debug(
551
+ e.endState === T.Success ? (this.logger.debug(
530
552
  `Resolve deferred troubles future ${e.id} completed successfully`
531
553
  ), this.queuedTroubles.forEach((t) => {
532
554
  t.clearDefer();
533
- }), _(() => {
555
+ }), v(() => {
534
556
  this._canExit = !0, this._isFailed = !1;
535
- })) : (e.endState === b.Fail || e.endState === b.Canceled || e.endState === b.Aborted) && (this.logger.error(`Resolve deferred troubles future ${e.id} failed`), this.clearAll(), _(() => {
557
+ })) : (e.endState === T.Fail || e.endState === T.Canceled || e.endState === T.Aborted) && (this.logger.error(`Resolve deferred troubles future ${e.id} failed`), this.clearAll(), v(() => {
536
558
  this._canExit = !1, this._isFailed = !0;
537
559
  }));
538
560
  }
539
561
  async resolveDeferredTroubles(e) {
540
- const t = this.queuedTroubles.filter((i) => !i.shouldDefer).map((i) => i.rawId).filter((i) => !this.inProgress.includes(i));
541
- return this.inProgress.push(...t), t.length === 0 ? void 0 : await De.bulkResolveTroubles(
562
+ const t = this.queuedTroubles.filter((s) => !s.shouldDefer).map((s) => s.rawId).filter((s) => !this.inProgress.includes(s));
563
+ return this.inProgress.push(...t), t.length === 0 ? void 0 : await Me.bulkResolveTroubles(
542
564
  t,
543
565
  void 0,
544
566
  e
@@ -549,23 +571,23 @@ let w = class {
549
571
  }
550
572
  get queuedTroubles() {
551
573
  return this.troubleContainer.troubles.getIndexByKey(
552
- gt.INDEX_TROUBLES_BY_DEFERRED,
553
- gt.TROUBLES_DEFERRED
574
+ nt.INDEX_TROUBLES_BY_DEFERRED,
575
+ nt.TROUBLES_DEFERRED
554
576
  );
555
577
  }
556
578
  get visibleTroubles() {
557
579
  const e = this.application.currentRole;
558
- return this.troubleContainer.troubles.data.filter(jt(e)).filter((t) => t.type !== Tt);
580
+ return this.troubleContainer.troubles.data.filter(Dt(e)).filter((t) => t.type !== ft);
559
581
  }
560
582
  // -------------------LIFECYCLE----------------------------
561
583
  get future() {
562
584
  return this.futureHandler.future;
563
585
  }
564
586
  get resolveFuture() {
565
- return this.futureHandler.getFuture(Ye);
587
+ return this.futureHandler.getFuture(Fe);
566
588
  }
567
589
  get agitateFuture() {
568
- return this.futureHandler.getFuture(Mo);
590
+ return this.futureHandler.getFuture(tr);
569
591
  }
570
592
  handleAgitationStarted(e) {
571
593
  this.logger.info(`Agitation started for ${e.path}`), this._agitationFutureId = String(e.futureId);
@@ -586,306 +608,109 @@ let w = class {
586
608
  this.logger.debug(`loading agitation-control ${this.id}`);
587
609
  }
588
610
  };
589
- U([
590
- m({ modelType: nt.type })
591
- ], w.prototype, "application", 2);
592
- U([
593
- v({ alias: Ye })
594
- ], w.prototype, "resolveDeferredTroubles", 1);
595
- U([
596
- we({ topic: Pt.TOPIC_AGITATION_STARTED })
597
- ], w.prototype, "handleAgitationStarted", 1);
598
- U([
599
- we({ topic: Pt.TOPIC_AGITATION_ENDED })
600
- ], w.prototype, "handleAgitationEnded", 1);
601
- U([
602
- $t({
611
+ I([
612
+ p({ modelType: Ze.type })
613
+ ], $.prototype, "application", 2);
614
+ I([
615
+ M({ alias: Fe })
616
+ ], $.prototype, "resolveDeferredTroubles", 1);
617
+ I([
618
+ Te({ topic: vt.TOPIC_AGITATION_STARTED })
619
+ ], $.prototype, "handleAgitationStarted", 1);
620
+ I([
621
+ Te({ topic: vt.TOPIC_AGITATION_ENDED })
622
+ ], $.prototype, "handleAgitationEnded", 1);
623
+ I([
624
+ Pe({
603
625
  dependencies: (e) => [e.readyToResolve, e._agitationFutureId]
604
626
  })
605
- ], w.prototype, "handleReadyToResolve", 1);
606
- w = U([
607
- l(Ut)
608
- ], w);
609
- const ws = new ke({
610
- class: w,
611
- type: Ut
627
+ ], $.prototype, "handleReadyToResolve", 1);
628
+ $ = I([
629
+ l(kt)
630
+ ], $);
631
+ const Ys = new He({
632
+ class: $,
633
+ type: kt
612
634
  });
613
- var So = Object.defineProperty, Co = Object.getOwnPropertyDescriptor, he = (e, t, r, i) => {
614
- for (var o = i > 1 ? void 0 : i ? Co(t, r) : t, n = e.length - 1, a; n >= 0; n--)
615
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
616
- return i && o && So(t, r, o), o;
635
+ var or = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, le = (e, t, o, s) => {
636
+ for (var r = s > 1 ? void 0 : s ? rr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
637
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
638
+ return s && r && or(t, o, r), r;
617
639
  };
618
- const q = "animation-model";
619
- let k = class {
620
- constructor(e, t, r) {
621
- s(this, "id");
622
- s(this, "logger");
623
- s(this, "disableAll");
624
- s(this, "enableDial");
625
- s(this, "enableModal");
626
- s(this, "enableSideBar");
627
- this.id = e, this.logger = r.logger;
640
+ const N = "animation-model";
641
+ let w = class {
642
+ constructor(e, t, o) {
643
+ i(this, "id");
644
+ i(this, "logger");
645
+ i(this, "disableAll");
646
+ i(this, "enableDial");
647
+ i(this, "enableModal");
648
+ i(this, "enableSideBar");
649
+ this.id = e, this.logger = o.logger;
628
650
  }
629
651
  };
630
- he([
652
+ le([
631
653
  d({
632
654
  path: "app:kosdev.ddk:app",
633
655
  attribute: "ncui.uiConfig.animations.disableAll"
634
656
  })
635
- ], k.prototype, "disableAll", 2);
636
- he([
657
+ ], w.prototype, "disableAll", 2);
658
+ le([
637
659
  d({
638
660
  path: "app:kosdev.ddk:app",
639
661
  attribute: "ncui.uiConfig.animations.enableDial"
640
662
  })
641
- ], k.prototype, "enableDial", 2);
642
- he([
663
+ ], w.prototype, "enableDial", 2);
664
+ le([
643
665
  d({
644
666
  path: "app:kosdev.ddk:app",
645
667
  attribute: "ncui.uiConfig.animations.enableModal"
646
668
  })
647
- ], k.prototype, "enableModal", 2);
648
- he([
669
+ ], w.prototype, "enableModal", 2);
670
+ le([
649
671
  d({
650
672
  path: "app:kosdev.ddk:app",
651
673
  attribute: "ncui.uiConfig.animations.enableSideBar"
652
674
  })
653
- ], k.prototype, "enableSideBar", 2);
654
- k = he([
655
- l(q)
656
- ], k);
657
- const wo = {
675
+ ], w.prototype, "enableSideBar", 2);
676
+ w = le([
677
+ l(N)
678
+ ], w);
679
+ const sr = {
658
680
  registration: {
659
- [q]: {
660
- class: k,
681
+ [N]: {
682
+ class: w,
661
683
  singleton: !0
662
684
  }
663
685
  },
664
- type: q,
665
- predicate: u(q),
666
- factory: c.Singleton.create(q)
667
- }, { URL: Eo } = h("ANIMATION_SERVICE"), { getAll: Lo } = f.build({
668
- basePath: `${Eo}/api/animation`
669
- }), Do = g.createLogger({
686
+ type: N,
687
+ predicate: u(N),
688
+ factory: c.Singleton.create(N)
689
+ }, { URL: ir } = h("ANIMATION_SERVICE"), { getAll: nr } = y.build({
690
+ basePath: `${ir}/api/animation`
691
+ }), ar = g.createLogger({
670
692
  name: "animation-service",
671
693
  group: "Services"
672
- }), ko = async () => (Do.debug("sending GET for animation"), await Lo({})), Es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
694
+ }), lr = async () => (ar.debug("sending GET for animation"), await nr({})), Gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
673
695
  __proto__: null,
674
- getAnimations: ko
675
- }, Symbol.toStringTag, { value: "Module" })), { URL: V } = h("FCM-PUMP_SERVICE"), { postModel: fe } = f.build({
676
- basePath: `${V}/api/fcm-pump`
677
- }), y = g.createLogger({
678
- name: "fcm-pump-service",
679
- group: "Services"
680
- }), Vt = async (e) => {
681
- var t, r, i, o, n;
682
- y.debug(
683
- `performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`
684
- );
685
- try {
686
- const a = await fe({
687
- model: {},
688
- urlOverride: `${V}/api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`
689
- });
690
- return y.debug("performElectricalTest - response:", a), ((a == null ? void 0 : a.status) === 200 || (a == null ? void 0 : a.status) === 499) && ((t = a.data) != null && t.error) ? [a.data.error || "unknownError", a.data] : [void 0, a == null ? void 0 : a.data];
691
- } catch (a) {
692
- if (y.error(
693
- `performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`,
694
- a
695
- ), a instanceof Re) {
696
- const O = ((i = (r = a.payload) == null ? void 0 : r.data) == null ? void 0 : i.error) || ((o = a.payload) == null ? void 0 : o.error) || "unknownError";
697
- return [O, ((n = a.payload) == null ? void 0 : n.data) || { error: O }];
698
- }
699
- }
700
- return ["unknownError", { error: "unknownError" }];
701
- }, Ht = async (e, t) => {
702
- y.debug(
703
- `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/preCalibrate`
704
- );
705
- try {
706
- const r = await fe({
707
- model: {},
708
- urlOverride: `${V}/api/ext/freestyle/fcm/calibration/${e}/preCalibrate`,
709
- tracker: t
710
- });
711
- return y.debug("performPreCalibrate - response:", r), r != null && r.data && T.initiateFuture(r.data), r == null ? void 0 : r.data;
712
- } catch (r) {
713
- y.error(
714
- `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/preCalibrate`,
715
- r
716
- );
717
- const i = {
718
- id: t || "",
719
- endState: b.Fail,
720
- tracker: t,
721
- reason: "Failed to resolve trouble"
722
- };
723
- return T.initiateFuture(i), i;
724
- }
725
- }, Wt = async (e, t) => {
726
- y.debug(
727
- `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/calibrate`
728
- );
729
- try {
730
- const r = await fe({
731
- model: {},
732
- urlOverride: `${V}/api/ext/freestyle/fcm/calibration/${e}/calibrate`,
733
- tracker: t
734
- });
735
- return y.debug("performPreCalibrate - response:", r), r != null && r.data && T.initiateFuture(r.data), r == null ? void 0 : r.data;
736
- } catch (r) {
737
- y.error(
738
- `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/calibrate`,
739
- r
740
- );
741
- const i = {
742
- id: t || "",
743
- endState: b.Fail,
744
- tracker: t,
745
- reason: "Failed to resolve trouble"
746
- };
747
- return T.initiateFuture(i), i;
748
- }
749
- }, Nt = async (e, t, r) => {
750
- y.debug(
751
- `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/verify/${t}`
752
- );
753
- try {
754
- const i = await fe({
755
- model: {},
756
- urlOverride: `${V}/api/ext/freestyle/fcm/calibration/${e}/verify/${t}`,
757
- tracker: r
758
- });
759
- return y.debug("performVerify - response:", i), i != null && i.data && T.initiateFuture(i.data), i == null ? void 0 : i.data;
760
- } catch (i) {
761
- y.error(
762
- `performVerify - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/verify/${t}`,
763
- i
764
- );
765
- const o = {
766
- id: r || "",
767
- endState: b.Fail,
768
- tracker: r,
769
- reason: "Failed to resolve trouble"
770
- };
771
- return T.initiateFuture(o), o;
772
- }
773
- }, Ro = (e) => e ? e.data === "success" || !e.data ? "success" : e.data : "error", zt = async (e, t, r) => {
774
- y.debug(
775
- `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`
776
- );
777
- try {
778
- const i = await fe({
779
- model: {},
780
- urlOverride: `${V}/api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`
781
- });
782
- return y.debug("performPreCalibrate - response:", i), Ro(i == null ? void 0 : i.data);
783
- } catch (i) {
784
- y.error(
785
- `performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`,
786
- i
787
- );
788
- return;
789
- }
790
- }, Ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
791
- __proto__: null,
792
- performCalibrate: Wt,
793
- performComplete: zt,
794
- performElectricalTest: Vt,
795
- performPreCalibrate: Ht,
796
- performVerify: Nt
696
+ getAnimations: lr
797
697
  }, Symbol.toStringTag, { value: "Module" }));
798
- var Io = Object.defineProperty, Fo = Object.getOwnPropertyDescriptor, je = (e, t, r, i) => {
799
- for (var o = i > 1 ? void 0 : i ? Fo(t, r) : t, n = e.length - 1, a; n >= 0; n--)
800
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
801
- return i && o && Io(t, r, o), o;
802
- };
803
- const Bt = "fcm-pump-model", xo = g.createLogger({ name: "fcm-pump-model" });
804
- let I = class {
805
- constructor(e, t, r) {
806
- s(this, "id");
807
- s(this, "logger");
808
- s(this, "pumpModel");
809
- s(this, "futureHandler");
810
- this.id = e, this.logger = r.logger, this.pumpModel = t.companionParent, this.futureHandler = new pe(this);
811
- }
812
- get future() {
813
- return this.futureHandler.future;
814
- }
815
- get name() {
816
- return this.pumpModel.name;
817
- }
818
- get canPour() {
819
- return this.pumpModel.canPour;
820
- }
821
- get isPouring() {
822
- return this.pumpModel.isPouring;
823
- }
824
- async cancelPour() {
825
- return this.pumpModel.cancelPour();
826
- }
827
- performIntent(e) {
828
- return this.pumpModel.performIntent(e);
829
- }
830
- async performElectricalTest() {
831
- const [e, t] = await Vt(this.pumpModel.path);
832
- return e && xo.error(`Failed to perform electrical test on pump ${this.id}`, e), t;
833
- }
834
- getChildren() {
835
- return [...this.futureHandler.allFutures];
836
- }
837
- async performPreCalibrate(e) {
838
- return Ht(this.pumpModel.path, e);
839
- }
840
- async performCalibrate(e) {
841
- return Wt(this.pumpModel.path, e);
842
- }
843
- async performVerify(e, t) {
844
- return Nt(this.pumpModel.path, e, t);
845
- }
846
- async performComplete(e, t) {
847
- return zt(this.pumpModel.path, e, t);
848
- }
849
- // -------------------LIFECYCLE----------------------------
850
- async init() {
851
- this.logger.debug(`initializing fcm-pump ${this.id}`);
852
- }
853
- async load() {
854
- this.logger.debug(`loading fcm-pump ${this.id}`);
855
- }
856
- };
857
- je([
858
- v()
859
- ], I.prototype, "performPreCalibrate", 1);
860
- je([
861
- v()
862
- ], I.prototype, "performCalibrate", 1);
863
- je([
864
- v()
865
- ], I.prototype, "performVerify", 1);
866
- I = je([
867
- l(Bt)
868
- ], I);
869
- const Kt = new Ee({
870
- class: I,
871
- type: Bt
872
- });
873
- var Ao = Object.defineProperty, jo = Object.getOwnPropertyDescriptor, Yt = (e, t, r, i) => {
874
- for (var o = i > 1 ? void 0 : i ? jo(t, r) : t, n = e.length - 1, a; n >= 0; n--)
875
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
876
- return i && o && Ao(t, r, o), o;
877
- };
878
- const G = "carb-water-model";
879
- let _e = class {
880
- constructor(e, t, r) {
881
- s(this, "id");
882
- s(this, "assemblyModel");
883
- s(this, "logger");
884
- this.id = e, this.logger = r.logger;
698
+ var dr = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, It = (e, t, o, s) => {
699
+ for (var r = s > 1 ? void 0 : s ? cr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
700
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
701
+ return s && r && dr(t, o, r), r;
702
+ };
703
+ const z = "carb-water-model";
704
+ let ye = class {
705
+ constructor(e, t, o) {
706
+ i(this, "id");
707
+ i(this, "assemblyModel");
708
+ i(this, "logger");
709
+ this.id = e, this.logger = o.logger;
885
710
  }
886
711
  getPump() {
887
712
  const t = this.assemblyModel.getHoldersByGroup("carb")[0].pumps.data[0];
888
- return rt(t, Kt.type);
713
+ return Be(t, mt.type);
889
714
  }
890
715
  // -------------------LIFECYCLE----------------------------
891
716
  async init() {
@@ -895,102 +720,102 @@ let _e = class {
895
720
  this.logger.debug(`loading carb-water ${this.id}`);
896
721
  }
897
722
  };
898
- Yt([
899
- m({ modelType: Fe.type })
900
- ], _e.prototype, "assemblyModel", 2);
901
- _e = Yt([
902
- l(G)
903
- ], _e);
904
- const Uo = {
723
+ It([
724
+ p({ modelType: Se.type })
725
+ ], ye.prototype, "assemblyModel", 2);
726
+ ye = It([
727
+ l(z)
728
+ ], ye);
729
+ const ur = {
905
730
  registration: {
906
- [G]: {
907
- class: _e,
731
+ [z]: {
732
+ class: ye,
908
733
  singleton: !1
909
734
  }
910
735
  },
911
- type: G,
912
- predicate: u(G),
913
- factory: c.Factory.create(G)
914
- }, { URL: H } = h("COPY-LOGS_SERVICE"), { getAll: Vo, getOne: Ho, postModel: qt, deleteModel: Wo } = f.build({
915
- basePath: `${H}/api/copy-logs`
916
- }), $e = g.createLogger({
736
+ type: z,
737
+ predicate: u(z),
738
+ factory: c.Factory.create(z)
739
+ }, { URL: R } = h("COPY-LOGS_SERVICE"), { getAll: pr, getOne: gr, postModel: Rt, deleteModel: hr } = y.build({
740
+ basePath: `${R}/api/copy-logs`
741
+ }), fe = g.createLogger({
917
742
  name: "copy-logs-service",
918
743
  group: "Services"
919
- }), Gt = async (e, t) => {
920
- const r = await Wo({
744
+ }), At = async (e, t) => {
745
+ const o = await hr({
921
746
  tracker: t,
922
747
  id: e,
923
- urlOverride: `${H}/api/app/kosdev.ddk/copyLogs/${e}`
748
+ urlOverride: `${R}/api/app/kosdev.ddk/copyLogs/${e}`
924
749
  });
925
- if (!(r != null && r.data))
750
+ if (!(o != null && o.data))
926
751
  throw new Error("No response from server");
927
- return r.data;
928
- }, Qt = async (e, t) => {
929
- const r = await qt({
752
+ return o.data;
753
+ }, Ft = async (e, t) => {
754
+ const o = await Rt({
930
755
  model: {},
931
756
  tracker: t,
932
- urlOverride: `${H}/api/app/kosdev.ddk/copyLogs/eraseAndCopy/${e}`
757
+ urlOverride: `${R}/api/app/kosdev.ddk/copyLogs/eraseAndCopy/${e}`
933
758
  });
934
- if (!(r != null && r.data))
759
+ if (!(o != null && o.data))
935
760
  throw new Error("No response from server");
936
- return r.data;
937
- }, Xt = async (e, t) => {
938
- const r = await qt({
761
+ return o.data;
762
+ }, xt = async (e, t) => {
763
+ const o = await Rt({
939
764
  model: {},
940
765
  tracker: t,
941
- urlOverride: `${H}/api/app/kosdev.ddk/copyLogs/${e}`
766
+ urlOverride: `${R}/api/app/kosdev.ddk/copyLogs/${e}`
942
767
  });
943
- if (!(r != null && r.data))
768
+ if (!(o != null && o.data))
944
769
  throw new Error("No response from server");
945
- return r.data;
946
- }, Jt = async () => {
947
- $e.debug("sending GET for copy-logs");
770
+ return o.data;
771
+ }, Ut = async () => {
772
+ fe.debug("sending GET for copy-logs");
948
773
  try {
949
- const e = await Vo({
950
- urlOverride: `${H}/api/app/kosdev.ddk/copyLogs/volumes/size`
774
+ const e = await pr({
775
+ urlOverride: `${R}/api/app/kosdev.ddk/copyLogs/volumes/size`
951
776
  });
952
777
  return [void 0, e == null ? void 0 : e.data];
953
778
  } catch (e) {
954
- if (e instanceof Re)
955
- return $e.error(`Error fetching log file size: ${e.payload.error}`), [e.payload.error, void 0];
779
+ if (e instanceof yt)
780
+ return fe.error(`Error fetching log file size: ${e.payload.error}`), [e.payload.error, void 0];
956
781
  }
957
782
  return ["unknownError", void 0];
958
- }, Zt = async () => {
959
- $e.debug("sending GET for log file size");
783
+ }, jt = async () => {
784
+ fe.debug("sending GET for log file size");
960
785
  try {
961
- const e = await Ho({
962
- urlOverride: `${H}/api/app/kosdev.ddk/copyLogs/files/size`
786
+ const e = await gr({
787
+ urlOverride: `${R}/api/app/kosdev.ddk/copyLogs/files/size`
963
788
  });
964
789
  return [void 0, e == null ? void 0 : e.data];
965
790
  } catch (e) {
966
- if (e instanceof Re)
967
- return $e.error(`Error fetching log file size: ${e.payload.error}`), [e.payload.error, void 0];
791
+ if (e instanceof yt)
792
+ return fe.error(`Error fetching log file size: ${e.payload.error}`), [e.payload.error, void 0];
968
793
  }
969
794
  return ["unknownError", void 0];
970
- }, Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
795
+ }, qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
971
796
  __proto__: null,
972
- copyLogFromVolume: Xt,
973
- eraseAndCopyLogsToVolume: Qt,
974
- eraseVolume: Gt,
975
- getLogFileSize: Zt,
976
- getVolumes: Jt
797
+ copyLogFromVolume: xt,
798
+ eraseAndCopyLogsToVolume: Ft,
799
+ eraseVolume: At,
800
+ getLogFileSize: jt,
801
+ getVolumes: Ut
977
802
  }, Symbol.toStringTag, { value: "Module" }));
978
- var er = Object.defineProperty, No = Object.getOwnPropertyDescriptor, zo = (e, t, r) => t in e ? er(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, W = (e, t, r, i) => {
979
- for (var o = i > 1 ? void 0 : i ? No(t, r) : t, n = e.length - 1, a; n >= 0; n--)
980
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
981
- return i && o && er(t, r, o), o;
982
- }, Bo = (e, t, r) => (zo(e, t + "", r), r);
983
- const Ko = "copy-logs-model";
984
- let S = class {
803
+ var Wt = Object.defineProperty, yr = Object.getOwnPropertyDescriptor, fr = (e, t, o) => t in e ? Wt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, A = (e, t, o, s) => {
804
+ for (var r = s > 1 ? void 0 : s ? yr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
805
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
806
+ return s && r && Wt(t, o, r), r;
807
+ }, vr = (e, t, o) => (fr(e, t + "", o), o);
808
+ const mr = "copy-logs-model";
809
+ let _ = class {
985
810
  constructor(e) {
986
- s(this, "id");
987
- s(this, "_volumes");
988
- s(this, "storageDeviceContainer");
989
- s(this, "_activeVolume");
990
- s(this, "_logFileSize", 0);
991
- s(this, "_actionState", "idle");
992
- s(this, "copyProgress");
993
- this.id = e, this._volumes = new Kr(), this._activeVolume = void 0, this.copyProgress = {
811
+ i(this, "id");
812
+ i(this, "_volumes");
813
+ i(this, "storageDeviceContainer");
814
+ i(this, "_activeVolume");
815
+ i(this, "_logFileSize", 0);
816
+ i(this, "_actionState", "idle");
817
+ i(this, "copyProgress");
818
+ this.id = e, this._volumes = new Po(), this._activeVolume = void 0, this.copyProgress = {
994
819
  bytesCopied: 0,
995
820
  bytesToCopy: 0,
996
821
  filesCopied: 0,
@@ -1030,19 +855,19 @@ let S = class {
1030
855
  }
1031
856
  get diskFull() {
1032
857
  var e;
1033
- return ((e = this.future) == null ? void 0 : e.status) === b.Success && this.copyProgress.filesSkipped > 0;
858
+ return ((e = this.future) == null ? void 0 : e.status) === T.Success && this.copyProgress.filesSkipped > 0;
1034
859
  }
1035
860
  onFutureUpdate(e) {
1036
- this.logger.info(`Future update: ${e.status}`), e.status === b.Success && (this.logger.info(`Future success: ${e.status}`), this.diskFull && _(() => {
1037
- e.endState = b.Fail, e.reason = "errDiskFull";
1038
- })), e.status === b.Fail && this.logger.error(`Future failed: ${e.status}`), e.note === "copy" ? _(() => {
861
+ this.logger.info(`Future update: ${e.status}`), e.status === T.Success && (this.logger.info(`Future success: ${e.status}`), this.diskFull && v(() => {
862
+ e.endState = T.Fail, e.reason = "errDiskFull";
863
+ })), e.status === T.Fail && this.logger.error(`Future failed: ${e.status}`), e.note === "copy" ? v(() => {
1039
864
  this._actionState = "copying", this.copyProgress = e.clientData || {
1040
865
  bytesCopied: 0,
1041
866
  bytesToCopy: 0,
1042
867
  filesCopied: 0,
1043
868
  filesSkipped: 0
1044
869
  };
1045
- }) : (this._actionState = "erasing", _(() => {
870
+ }) : (this._actionState = "erasing", v(() => {
1046
871
  this.copyProgress = {
1047
872
  bytesCopied: 0,
1048
873
  bytesToCopy: 0,
@@ -1055,31 +880,31 @@ let S = class {
1055
880
  var t;
1056
881
  if (!e)
1057
882
  throw new Error("No tracker provided");
1058
- if (_(() => {
883
+ if (v(() => {
1059
884
  this._actionState = "erasing";
1060
885
  }), !this._activeVolume)
1061
886
  throw this.logger.error("No active volume selected"), new Error("No active volume selected");
1062
- return this.logger.info(`Erasing volume ${(t = this._activeVolume) == null ? void 0 : t.name}`), Qt(this._activeVolume.id, e);
887
+ return this.logger.info(`Erasing volume ${(t = this._activeVolume) == null ? void 0 : t.name}`), Ft(this._activeVolume.id, e);
1063
888
  }
1064
889
  async eraseVolume(e) {
1065
890
  var t;
1066
891
  if (!e)
1067
892
  throw new Error("No tracker provided");
1068
- if (_(() => {
893
+ if (v(() => {
1069
894
  this._actionState = "erasing";
1070
895
  }), !this._activeVolume)
1071
896
  throw this.logger.error("No active volume selected"), new Error("No active volume selected");
1072
- return this.logger.info(`Erasing volume ${(t = this._activeVolume) == null ? void 0 : t.name}`), Gt(this._activeVolume.id, e);
897
+ return this.logger.info(`Erasing volume ${(t = this._activeVolume) == null ? void 0 : t.name}`), At(this._activeVolume.id, e);
1073
898
  }
1074
899
  async copyLogs(e) {
1075
900
  var t;
1076
901
  if (!e)
1077
902
  throw new Error("No tracker provided");
1078
- if (_(() => {
903
+ if (v(() => {
1079
904
  this._actionState = "copying";
1080
905
  }), !this._activeVolume)
1081
906
  throw this.logger.error("No active volume selected"), new Error("No active volume selected");
1082
- return this.logger.info(`Copying logs to ${(t = this._activeVolume) == null ? void 0 : t.name}`), Xt(this._activeVolume.id, e);
907
+ return this.logger.info(`Copying logs to ${(t = this._activeVolume) == null ? void 0 : t.name}`), xt(this._activeVolume.id, e);
1083
908
  }
1084
909
  handleInsertion() {
1085
910
  this.inserted ? this.syncVolumes() : (this._volumes.clear(), this.clearActiveVolume());
@@ -1088,27 +913,27 @@ let S = class {
1088
913
  this.logger.debug(`initializing copy-logs ${this.id}`);
1089
914
  }
1090
915
  async syncVolumes() {
1091
- const [e, t] = await Jt(), [r, i] = await Zt();
1092
- if (r) {
1093
- this.logger.error(`Error fetching log file size: ${r}`);
916
+ const [e, t] = await Ut(), [o, s] = await jt();
917
+ if (o) {
918
+ this.logger.error(`Error fetching log file size: ${o}`);
1094
919
  return;
1095
920
  }
1096
921
  if (e) {
1097
922
  this.logger.error(`Error fetching volumes: ${e}`);
1098
923
  return;
1099
924
  }
1100
- t && (t.forEach((o) => {
1101
- const n = this.storageDeviceContainer.getModel(o.id);
925
+ t && (t.forEach((r) => {
926
+ const n = this.storageDeviceContainer.getModel(r.id);
1102
927
  if (n) {
1103
928
  const a = {
1104
- id: o.id,
929
+ id: r.id,
1105
930
  name: n.label,
1106
- freeBytes: o.info.freeBytes,
1107
- totalBytes: o.info.totalBytes
931
+ freeBytes: r.info.freeBytes,
932
+ totalBytes: r.info.totalBytes
1108
933
  };
1109
934
  this._volumes.addModel(a);
1110
935
  }
1111
- }), t.length === 1 ? this.updateActiveVolume(this._volumes.data[0]) : this.clearActiveVolume()), i && (this.logger.info(`Log file size: ${i}`), this.updateLogFileSize(parseInt(i, 10)));
936
+ }), t.length === 1 ? this.updateActiveVolume(this._volumes.data[0]) : this.clearActiveVolume()), s && (this.logger.info(`Log file size: ${s}`), this.updateLogFileSize(parseInt(s, 10)));
1112
937
  }
1113
938
  async activate() {
1114
939
  this.logger.debug(`activating copy-logs ${this.id}`), await this.syncVolumes();
@@ -1117,82 +942,82 @@ let S = class {
1117
942
  this.logger.debug(`loading copy-logs ${this.id}`);
1118
943
  }
1119
944
  };
1120
- Bo(S, "Registration");
1121
- W([
1122
- m({ modelType: Nr.type })
1123
- ], S.prototype, "storageDeviceContainer", 2);
1124
- W([
1125
- v()
1126
- ], S.prototype, "eraseAndCopyVolume", 1);
1127
- W([
1128
- v()
1129
- ], S.prototype, "eraseVolume", 1);
1130
- W([
1131
- v()
1132
- ], S.prototype, "copyLogs", 1);
1133
- W([
1134
- $t({
945
+ vr(_, "Registration");
946
+ A([
947
+ p({ modelType: To.type })
948
+ ], _.prototype, "storageDeviceContainer", 2);
949
+ A([
950
+ M()
951
+ ], _.prototype, "eraseAndCopyVolume", 1);
952
+ A([
953
+ M()
954
+ ], _.prototype, "eraseVolume", 1);
955
+ A([
956
+ M()
957
+ ], _.prototype, "copyLogs", 1);
958
+ A([
959
+ Pe({
1135
960
  dependencies: (e) => [e.inserted]
1136
961
  })
1137
- ], S.prototype, "handleInsertion", 1);
1138
- S = W([
1139
- l({ modelTypeId: Ko, singleton: !0 }),
1140
- zr(),
1141
- Br()
1142
- ], S);
1143
- const ks = S.Registration, tr = g.createLogger({
962
+ ], _.prototype, "handleInsertion", 1);
963
+ _ = A([
964
+ l({ modelTypeId: mr, singleton: !0 }),
965
+ $o(),
966
+ Ke()
967
+ ], _);
968
+ const Qs = _.Registration, Nt = g.createLogger({
1144
969
  name: "dashboard-operations-service",
1145
970
  group: "Services"
1146
- }), rr = async (e, t) => (tr.debug("resolveAll"), await De.bulkResolveTroubles(
971
+ }), zt = async (e, t) => (Nt.debug("resolveAll"), await Me.bulkResolveTroubles(
1147
972
  e,
1148
973
  void 0,
1149
974
  t
1150
- )), or = async (e, t) => (tr.debug("resolveTrouble"), await De.resolveTrouble(
975
+ )), Vt = async (e, t) => (Nt.debug("resolveTrouble"), await Me.resolveTrouble(
1151
976
  e,
1152
977
  void 0,
1153
978
  t
1154
- )), Rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
979
+ )), Xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1155
980
  __proto__: null,
1156
- resolveAll: rr,
1157
- resolveTrouble: or
981
+ resolveAll: zt,
982
+ resolveTrouble: Vt
1158
983
  }, Symbol.toStringTag, { value: "Module" }));
1159
- var Yo = Object.defineProperty, qo = Object.getOwnPropertyDescriptor, Ue = (e, t, r, i) => {
1160
- for (var o = i > 1 ? void 0 : i ? qo(t, r) : t, n = e.length - 1, a; n >= 0; n--)
1161
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
1162
- return i && o && Yo(t, r, o), o;
984
+ var br = Object.defineProperty, _r = Object.getOwnPropertyDescriptor, Ee = (e, t, o, s) => {
985
+ for (var r = s > 1 ? void 0 : s ? _r(t, o) : t, n = e.length - 1, a; n >= 0; n--)
986
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
987
+ return s && r && br(t, o, r), r;
1163
988
  };
1164
- const Q = "dashboard-operations-model";
1165
- function bt(e) {
989
+ const V = "dashboard-operations-model";
990
+ function ut(e) {
1166
991
  return !e.deferred;
1167
992
  }
1168
- function vt(e) {
993
+ function pt(e) {
1169
994
  return e.deferred;
1170
995
  }
1171
- let F = class {
1172
- constructor(e, t, r) {
1173
- s(this, "id");
1174
- s(this, "troubles");
1175
- s(this, "futureHandler");
1176
- s(this, "logger");
1177
- this.id = e, this.futureHandler = new pe(this), this.logger = r.logger;
996
+ let C = class {
997
+ constructor(e, t, o) {
998
+ i(this, "id");
999
+ i(this, "troubles");
1000
+ i(this, "futureHandler");
1001
+ i(this, "logger");
1002
+ this.id = e, this.futureHandler = new Ge(this), this.logger = o.logger;
1178
1003
  }
1179
1004
  get troublesByType() {
1180
1005
  return this.troubles.troubles.data.reduce(
1181
- Yr,
1006
+ Mo,
1182
1007
  {}
1183
1008
  );
1184
1009
  }
1185
1010
  get queuedPurgeTroubles() {
1186
- return this.purgeTroubles.filter(vt);
1011
+ return this.purgeTroubles.filter(pt);
1187
1012
  }
1188
1013
  get queuedPrimeTroubles() {
1189
- return this.primeTroubles.filter(vt);
1014
+ return this.primeTroubles.filter(pt);
1190
1015
  }
1191
1016
  get resolvablePrimeTroubles() {
1192
- return this.primeTroubles.filter(bt);
1017
+ return this.primeTroubles.filter(ut);
1193
1018
  }
1194
1019
  get resolvablePurgeTroubles() {
1195
- return this.purgeTroubles.filter(bt);
1020
+ return this.purgeTroubles.filter(ut);
1196
1021
  }
1197
1022
  get hasResolvablePurgeTroubles() {
1198
1023
  return this.resolvablePurgeTroubles.length > 0;
@@ -1207,10 +1032,10 @@ let F = class {
1207
1032
  return this.primeTroubles.length > 0;
1208
1033
  }
1209
1034
  get purgeTroubles() {
1210
- return this.troublesByType[ht] || [];
1035
+ return this.troublesByType[at] || [];
1211
1036
  }
1212
1037
  get primeTroubles() {
1213
- return this.troublesByType[to] || [];
1038
+ return this.troublesByType[ko] || [];
1214
1039
  }
1215
1040
  get future() {
1216
1041
  return this.futureHandler.getFuture();
@@ -1218,17 +1043,17 @@ let F = class {
1218
1043
  async resolveAllTroubles(e, t) {
1219
1044
  if (!t)
1220
1045
  throw new Error("No tracker provided");
1221
- const r = e === ht ? this.purgeTroubles : this.primeTroubles;
1222
- r.filter((a) => a.shouldDefer).forEach((a) => {
1046
+ const o = e === at ? this.purgeTroubles : this.primeTroubles;
1047
+ o.filter((a) => a.shouldDefer).forEach((a) => {
1223
1048
  this.logger.info(`Deferring trouble ${a.rawId}`), a.defer();
1224
1049
  });
1225
- const o = r.filter((a) => !a.shouldDefer).map((a) => a.rawId);
1226
- return o.length === 0 ? void 0 : await rr(o, t);
1050
+ const r = o.filter((a) => !a.shouldDefer).map((a) => a.rawId);
1051
+ return r.length === 0 ? void 0 : await zt(r, t);
1227
1052
  }
1228
1053
  async resolveTrouble(e, t) {
1229
1054
  if (!t)
1230
1055
  throw new Error("No tracker provided");
1231
- return await or(e, t);
1056
+ return await Vt(e, t);
1232
1057
  }
1233
1058
  // -------------------LIFECYCLE----------------------------
1234
1059
  async init() {
@@ -1238,40 +1063,42 @@ let F = class {
1238
1063
  this.logger.debug(`loading dashboard-operations ${this.id}`);
1239
1064
  }
1240
1065
  };
1241
- Ue([
1242
- m({ modelType: ot.type })
1243
- ], F.prototype, "troubles", 2);
1244
- Ue([
1245
- v()
1246
- ], F.prototype, "resolveAllTroubles", 1);
1247
- Ue([
1248
- v()
1249
- ], F.prototype, "resolveTrouble", 1);
1250
- F = Ue([
1251
- l(Q)
1252
- ], F);
1253
- const lt = {
1066
+ Ee([
1067
+ p({
1068
+ modelType: Ye.type
1069
+ })
1070
+ ], C.prototype, "troubles", 2);
1071
+ Ee([
1072
+ M()
1073
+ ], C.prototype, "resolveAllTroubles", 1);
1074
+ Ee([
1075
+ M()
1076
+ ], C.prototype, "resolveTrouble", 1);
1077
+ C = Ee([
1078
+ l(V)
1079
+ ], C);
1080
+ const et = {
1254
1081
  registration: {
1255
- [Q]: {
1256
- class: F,
1082
+ [V]: {
1083
+ class: C,
1257
1084
  singleton: !0
1258
1085
  }
1259
1086
  },
1260
- type: Q,
1261
- predicate: u(Q),
1262
- factory: c.Singleton.create(Q)
1087
+ type: V,
1088
+ predicate: u(V),
1089
+ factory: c.Singleton.create(V)
1263
1090
  };
1264
- var Go = Object.getOwnPropertyDescriptor, Qo = (e, t, r, i) => {
1265
- for (var o = i > 1 ? void 0 : i ? Go(t, r) : t, n = e.length - 1, a; n >= 0; n--)
1266
- (a = e[n]) && (o = a(o) || o);
1267
- return o;
1091
+ var Tr = Object.getOwnPropertyDescriptor, $r = (e, t, o, s) => {
1092
+ for (var r = s > 1 ? void 0 : s ? Tr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1093
+ (a = e[n]) && (r = a(r) || r);
1094
+ return r;
1268
1095
  };
1269
- const X = "dispenser-model";
1270
- let qe = class {
1271
- constructor(e, t, r) {
1272
- s(this, "id");
1273
- s(this, "logger");
1274
- this.id = e, this.logger = r.logger;
1096
+ const H = "dispenser-model";
1097
+ let xe = class {
1098
+ constructor(e, t, o) {
1099
+ i(this, "id");
1100
+ i(this, "logger");
1101
+ this.id = e, this.logger = o.logger;
1275
1102
  }
1276
1103
  updateModel() {
1277
1104
  }
@@ -1283,40 +1110,40 @@ let qe = class {
1283
1110
  this.logger.debug(`loading dispenser ${this.id}`);
1284
1111
  }
1285
1112
  };
1286
- qe = Qo([
1287
- l(X)
1288
- ], qe);
1289
- const Xo = {
1113
+ xe = $r([
1114
+ l(H)
1115
+ ], xe);
1116
+ const Pr = {
1290
1117
  registration: {
1291
- [X]: {
1292
- class: qe,
1118
+ [H]: {
1119
+ class: xe,
1293
1120
  singleton: !0
1294
1121
  }
1295
1122
  },
1296
- type: X,
1297
- predicate: u(X),
1298
- factory: c.Singleton.create(X)
1299
- }, { URL: Jo } = h("DISPENSER_SERVICE"), { getAll: Zo } = f.build({
1300
- basePath: `${Jo}/api/dispenser`
1301
- }), ei = g.createLogger({
1123
+ type: H,
1124
+ predicate: u(H),
1125
+ factory: c.Singleton.create(H)
1126
+ }, { URL: Mr } = h("DISPENSER_SERVICE"), { getAll: Or } = y.build({
1127
+ basePath: `${Mr}/api/dispenser`
1128
+ }), Sr = g.createLogger({
1302
1129
  name: "dispenser-service",
1303
1130
  group: "Services"
1304
- }), ti = async () => (ei.debug("sending GET for dispenser"), await Zo({})), Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1131
+ }), wr = async () => (Sr.debug("sending GET for dispenser"), await Or({})), Js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1305
1132
  __proto__: null,
1306
- getDispensers: ti
1133
+ getDispensers: wr
1307
1134
  }, Symbol.toStringTag, { value: "Module" }));
1308
- var ri = Object.defineProperty, oi = Object.getOwnPropertyDescriptor, ir = (e, t, r, i) => {
1309
- for (var o = i > 1 ? void 0 : i ? oi(t, r) : t, n = e.length - 1, a; n >= 0; n--)
1310
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
1311
- return i && o && ri(t, r, o), o;
1135
+ var Er = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, Ht = (e, t, o, s) => {
1136
+ for (var r = s > 1 ? void 0 : s ? Cr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1137
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
1138
+ return s && r && Er(t, o, r), r;
1312
1139
  };
1313
- const J = "dispenser-info-model";
1314
- let Te = class {
1315
- constructor(e, t, r) {
1316
- s(this, "logger");
1317
- s(this, "id");
1318
- s(this, "name");
1319
- this.id = e, this.logger = r.logger;
1140
+ const B = "dispenser-info-model";
1141
+ let ve = class {
1142
+ constructor(e, t, o) {
1143
+ i(this, "logger");
1144
+ i(this, "id");
1145
+ i(this, "name");
1146
+ this.id = e, this.logger = o.logger;
1320
1147
  }
1321
1148
  // -------------------LIFECYCLE----------------------------
1322
1149
  async init() {
@@ -1326,48 +1153,48 @@ let Te = class {
1326
1153
  this.logger.debug(`loading dispenser-info ${this.id}`);
1327
1154
  }
1328
1155
  };
1329
- ir([
1156
+ Ht([
1330
1157
  d({
1331
1158
  path: "kos:device",
1332
1159
  attribute: "name"
1333
1160
  })
1334
- ], Te.prototype, "name", 2);
1335
- Te = ir([
1336
- l(J)
1337
- ], Te);
1338
- const ii = {
1161
+ ], ve.prototype, "name", 2);
1162
+ ve = Ht([
1163
+ l(B)
1164
+ ], ve);
1165
+ const Lr = {
1339
1166
  registration: {
1340
- [J]: {
1341
- class: Te,
1167
+ [B]: {
1168
+ class: ve,
1342
1169
  singleton: !1
1343
1170
  }
1344
1171
  },
1345
- type: J,
1346
- predicate: u(J),
1172
+ type: B,
1173
+ predicate: u(B),
1347
1174
  factory: c.Factory.create(
1348
- J
1175
+ B
1349
1176
  )
1350
- }, { URL: si } = h("DISPENSER-INFO_SERVICE"), { getAll: ai } = f.build({
1351
- basePath: `${si}/api/dispenser-info`
1352
- }), ni = g.createLogger({
1177
+ }, { URL: Dr } = h("DISPENSER-INFO_SERVICE"), { getAll: kr } = y.build({
1178
+ basePath: `${Dr}/api/dispenser-info`
1179
+ }), Ir = g.createLogger({
1353
1180
  name: "dispenser-info-service",
1354
1181
  group: "Services"
1355
- }), li = async () => (ni.debug("sending GET for dispenser-info"), await ai({})), Fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1182
+ }), Rr = async () => (Ir.debug("sending GET for dispenser-info"), await kr({})), Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1356
1183
  __proto__: null,
1357
- getDispenserInfos: li
1184
+ getDispenserInfos: Rr
1358
1185
  }, Symbol.toStringTag, { value: "Module" }));
1359
- var ci = Object.getOwnPropertyDescriptor, ui = (e, t, r, i) => {
1360
- for (var o = i > 1 ? void 0 : i ? ci(t, r) : t, n = e.length - 1, a; n >= 0; n--)
1361
- (a = e[n]) && (o = a(o) || o);
1362
- return o;
1186
+ var Ar = Object.getOwnPropertyDescriptor, Fr = (e, t, o, s) => {
1187
+ for (var r = s > 1 ? void 0 : s ? Ar(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1188
+ (a = e[n]) && (r = a(r) || r);
1189
+ return r;
1363
1190
  };
1364
- const Z = "enrollment-model";
1365
- let Ge = class {
1366
- constructor(e, t, r) {
1367
- s(this, "id");
1368
- s(this, "logger");
1369
- s(this, "enrolled");
1370
- this.id = e, this.logger = r.logger, this.enrolled = !1;
1191
+ const K = "enrollment-model";
1192
+ let Ue = class {
1193
+ constructor(e, t, o) {
1194
+ i(this, "id");
1195
+ i(this, "logger");
1196
+ i(this, "enrolled");
1197
+ this.id = e, this.logger = o.logger, this.enrolled = !1;
1371
1198
  }
1372
1199
  updateModel(e) {
1373
1200
  console.log("updateModel:", e);
@@ -1380,77 +1207,77 @@ let Ge = class {
1380
1207
  this.logger.debug(`loading enrollment ${this.id}`);
1381
1208
  }
1382
1209
  };
1383
- Ge = ui([
1384
- l(Z)
1385
- ], Ge);
1386
- const di = {
1210
+ Ue = Fr([
1211
+ l(K)
1212
+ ], Ue);
1213
+ const xr = {
1387
1214
  registration: {
1388
- [Z]: {
1389
- class: Ge,
1215
+ [K]: {
1216
+ class: Ue,
1390
1217
  singleton: !0
1391
1218
  }
1392
1219
  },
1393
- type: Z,
1394
- predicate: u(Z),
1395
- factory: c.Singleton.create(Z)
1396
- }, { URL: pi } = h("ENROLLMENT_SERVICE"), { getAll: gi } = f.build({
1397
- basePath: `${pi}/api/enrollment`
1398
- }), hi = g.createLogger({
1220
+ type: K,
1221
+ predicate: u(K),
1222
+ factory: c.Singleton.create(K)
1223
+ }, { URL: Ur } = h("ENROLLMENT_SERVICE"), { getAll: jr } = y.build({
1224
+ basePath: `${Ur}/api/enrollment`
1225
+ }), Wr = g.createLogger({
1399
1226
  name: "enrollment-service",
1400
1227
  group: "Services"
1401
- }), fi = async () => (hi.debug("sending GET for enrollment"), await gi({})), xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1228
+ }), Nr = async () => (Wr.debug("sending GET for enrollment"), await jr({})), ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1402
1229
  __proto__: null,
1403
- getEnrollments: fi
1404
- }, Symbol.toStringTag, { value: "Module" })), As = (e) => e.toLowerCase().includes("micros"), js = (e) => !e.toLowerCase().includes("micros"), Us = (e) => (t) => {
1405
- const r = e == null ? void 0 : e.getHoldersByGroup(t);
1406
- return r ? r.map((i) => ({ id: i.id, name: i.ingredientName, path: i.path })) : null;
1407
- }, Vs = ["water", "carb", "ns", "nss"], ue = "dashboardKeyFactory", Be = [];
1408
- qr(ue, {
1230
+ getEnrollments: Nr
1231
+ }, Symbol.toStringTag, { value: "Module" })), ti = (e) => e.toLowerCase().includes("micros"), oi = (e) => !e.toLowerCase().includes("micros"), ri = (e) => (t) => {
1232
+ const o = e == null ? void 0 : e.getHoldersByGroup(t);
1233
+ return o ? o.map((s) => ({ id: s.id, name: s.ingredientName, path: s.path })) : null;
1234
+ }, si = ["water", "carb", "ns", "nss"], ie = "dashboardKeyFactory", ke = [];
1235
+ Oo(ie, {
1409
1236
  register: (e, t) => {
1410
- Be.includes(t) || Be.push(t);
1237
+ ke.includes(t) || ke.push(t);
1411
1238
  },
1412
1239
  execute: (e, t) => {
1413
- const r = Be.sort((i, o) => i.rank - o.rank);
1414
- for (const i of r) {
1415
- const o = i.factory(t);
1416
- if (o)
1417
- return o;
1240
+ const o = ke.sort((s, r) => s.rank - r.rank);
1241
+ for (const s of o) {
1242
+ const r = s.factory(t);
1243
+ if (r)
1244
+ return r;
1418
1245
  }
1419
1246
  }
1420
1247
  });
1421
- const mi = (e) => {
1422
- Ie[ue].register(
1423
- ue,
1248
+ const zr = (e) => {
1249
+ Oe[ie].register(
1250
+ ie,
1424
1251
  e
1425
1252
  );
1426
- }, yi = (e) => Ie[ue].execute(
1427
- ue,
1253
+ }, Vr = (e) => Oe[ie].execute(
1254
+ ie,
1428
1255
  e
1429
1256
  );
1430
- Ie.registerDashboardKeyFactory = mi;
1431
- Ie.executeDashboardKeyFactory = yi;
1432
- const Qe = 3600, sr = 60, Hs = (e) => {
1433
- const t = Math.floor(e / Qe), r = Math.floor(e % Qe / sr);
1434
- return { hours: t, minutes: r };
1435
- }, Ws = (e, t) => e * Qe + t * sr, bi = (e) => {
1436
- const r = (/* @__PURE__ */ new Date()).valueOf() - e.valueOf(), i = Math.floor(r / (1e3 * 60)), o = Math.floor(i / 60), n = Math.floor(o / 24), a = i % 60, O = o % 24;
1437
- let D = "";
1438
- return n > 0 && (D += `${n} day${n > 1 ? "s" : ""} `), O > 0 && (D += `${O} hour${O > 1 ? "s" : ""} `), (a > 0 || n === 0 && O === 0) && (D += `${a} minute${a > 1 ? "s" : ""} `), D;
1439
- };
1440
- var vi = Object.defineProperty, _i = Object.getOwnPropertyDescriptor, Ve = (e, t, r, i) => {
1441
- for (var o = i > 1 ? void 0 : i ? _i(t, r) : t, n = e.length - 1, a; n >= 0; n--)
1442
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
1443
- return i && o && vi(t, r, o), o;
1444
- };
1445
- const ee = "ingredient-summary-model";
1446
- let x = class {
1447
- constructor(e, t, r) {
1448
- s(this, "id");
1449
- s(this, "assemblyModel");
1450
- s(this, "dashboardOperationModel");
1451
- s(this, "appModel");
1452
- s(this, "logger");
1453
- this.id = e, this.logger = r.logger, this.dashboardOperationModel = lt.factory({});
1257
+ Oe.registerDashboardKeyFactory = zr;
1258
+ Oe.executeDashboardKeyFactory = Vr;
1259
+ const je = 3600, Bt = 60, ii = (e) => {
1260
+ const t = Math.floor(e / je), o = Math.floor(e % je / Bt);
1261
+ return { hours: t, minutes: o };
1262
+ }, ni = (e, t) => e * je + t * Bt, Hr = (e) => {
1263
+ const o = (/* @__PURE__ */ new Date()).valueOf() - e.valueOf(), s = Math.floor(o / (1e3 * 60)), r = Math.floor(s / 60), n = Math.floor(r / 24), a = s % 60, de = r % 24;
1264
+ let ce = "";
1265
+ return n > 0 && (ce += `${n} day${n > 1 ? "s" : ""} `), de > 0 && (ce += `${de} hour${de > 1 ? "s" : ""} `), (a > 0 || n === 0 && de === 0) && (ce += `${a} minute${a > 1 ? "s" : ""} `), ce;
1266
+ };
1267
+ var Br = Object.defineProperty, Kr = Object.getOwnPropertyDescriptor, Ce = (e, t, o, s) => {
1268
+ for (var r = s > 1 ? void 0 : s ? Kr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1269
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
1270
+ return s && r && Br(t, o, r), r;
1271
+ };
1272
+ const Y = "ingredient-summary-model";
1273
+ let L = class {
1274
+ constructor(e, t, o) {
1275
+ i(this, "id");
1276
+ i(this, "assemblyModel");
1277
+ i(this, "dashboardOperationModel");
1278
+ i(this, "appModel");
1279
+ i(this, "logger");
1280
+ this.id = e, this.logger = o.logger, this.dashboardOperationModel = et.factory({});
1454
1281
  }
1455
1282
  get highPriorityHolders() {
1456
1283
  return this.assemblyModel.allHolders.filter(
@@ -1458,16 +1285,16 @@ let x = class {
1458
1285
  );
1459
1286
  }
1460
1287
  get actionRequiredHolders() {
1461
- const e = this.appModel.currentRole, t = jt(e);
1462
- return this.assemblyModel.allHolders.filter((r) => {
1463
- const i = rt(
1464
- r,
1465
- Jr.type
1288
+ const e = this.appModel.currentRole, t = Dt(e);
1289
+ return this.assemblyModel.allHolders.filter((o) => {
1290
+ const s = Be(
1291
+ o,
1292
+ Co.type
1466
1293
  );
1467
- if (i != null && i.isRemote)
1294
+ if (s != null && s.isRemote)
1468
1295
  return !1;
1469
- const o = r.troubles.filter(t);
1470
- return o.length > 0 && o.find((n) => n.resolvable);
1296
+ const r = o.troubles.filter(t);
1297
+ return r.length > 0 && r.find((n) => n.resolvable);
1471
1298
  });
1472
1299
  }
1473
1300
  get lowLevelHolders() {
@@ -1484,104 +1311,53 @@ let x = class {
1484
1311
  this.logger.debug(`loading ingredient-summary ${this.id}`);
1485
1312
  }
1486
1313
  };
1487
- Ve([
1488
- m({ modelType: Fe.type })
1489
- ], x.prototype, "assemblyModel", 2);
1490
- Ve([
1491
- m({ modelType: lt.type })
1492
- ], x.prototype, "dashboardOperationModel", 2);
1493
- Ve([
1494
- m({ modelType: nt.type })
1495
- ], x.prototype, "appModel", 2);
1496
- x = Ve([
1497
- l(ee)
1498
- ], x);
1499
- const $i = {
1314
+ Ce([
1315
+ p({ modelType: Se.type })
1316
+ ], L.prototype, "assemblyModel", 2);
1317
+ Ce([
1318
+ p({ modelType: et.type })
1319
+ ], L.prototype, "dashboardOperationModel", 2);
1320
+ Ce([
1321
+ p({ modelType: Ze.type })
1322
+ ], L.prototype, "appModel", 2);
1323
+ L = Ce([
1324
+ l(Y)
1325
+ ], L);
1326
+ const Yr = {
1500
1327
  registration: {
1501
- [ee]: {
1502
- class: x,
1328
+ [Y]: {
1329
+ class: L,
1503
1330
  singleton: !1
1504
1331
  }
1505
1332
  },
1506
- type: ee,
1507
- predicate: u(ee),
1333
+ type: Y,
1334
+ predicate: u(Y),
1508
1335
  factory: c.Factory.create(
1509
- ee
1336
+ Y
1510
1337
  )
1511
- };
1512
- var Ti = Object.getOwnPropertyDescriptor, Pi = (e, t, r, i) => {
1513
- for (var o = i > 1 ? void 0 : i ? Ti(t, r) : t, n = e.length - 1, a; n >= 0; n--)
1514
- (a = e[n]) && (o = a(o) || o);
1515
- return o;
1516
- };
1517
- const ar = "lfcv-pump-model";
1518
- let Xe = class {
1519
- constructor(e, t, r) {
1520
- s(this, "id");
1521
- s(this, "logger");
1522
- s(this, "pumpModel");
1523
- this.id = e, this.logger = r.logger, this.pumpModel = t.companionParent;
1524
- }
1525
- get name() {
1526
- return this.pumpModel.name;
1527
- }
1528
- get canPour() {
1529
- return this.pumpModel.canPour;
1530
- }
1531
- get isPouring() {
1532
- return this.pumpModel.isPouring;
1533
- }
1534
- async cancelPour() {
1535
- return this.pumpModel.cancelPour();
1536
- }
1537
- performIntent(e) {
1538
- return this.pumpModel.performIntent(e);
1539
- }
1540
- // -------------------LIFECYCLE----------------------------
1541
- async init() {
1542
- this.logger.debug(`initializing lfcv-pump ${this.id}`);
1543
- }
1544
- async load() {
1545
- this.logger.debug(`loading lfcv-pump ${this.id}`);
1546
- }
1547
- };
1548
- Xe = Pi([
1549
- l(ar)
1550
- ], Xe);
1551
- const Ns = new Ee({
1552
- class: Xe,
1553
- type: ar
1554
- }), { URL: Oi } = h("LFCV-PUMP_SERVICE"), { getAll: Mi } = f.build({
1555
- basePath: `${Oi}/api/lfcv-pump`
1556
- }), Si = g.createLogger({
1557
- name: "lfcv-pump-service",
1558
- group: "Services"
1559
- }), Ci = async () => (Si.debug("sending GET for lfcv-pump"), await Mi({})), zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1560
- __proto__: null,
1561
- getLfcvPumps: Ci
1562
- }, Symbol.toStringTag, { value: "Module" })), { URL: ct } = h("LOCKOUT_SERVICE"), { postModel: nr } = f.build({
1563
- basePath: `${ct}/api/app/kosdev.ddk/lockout`
1564
- }), lr = g.createLogger({ name: "lockout-service", group: "Services" }), wi = async () => (lr.info("lock"), await nr({
1338
+ }, { URL: tt } = h("LOCKOUT_SERVICE"), { postModel: Kt } = y.build({
1339
+ basePath: `${tt}/api/app/kosdev.ddk/lockout`
1340
+ }), Yt = g.createLogger({ name: "lockout-service", group: "Services" }), Gr = async () => (Yt.info("lock"), await Kt({
1565
1341
  model: {},
1566
- urlOverride: `${ct}/api/app/kosdev.ddk/lockout/lockNow`
1567
- })), cr = async (e) => {
1568
- lr.info("unlock");
1569
- const t = await nr({
1342
+ urlOverride: `${tt}/api/app/kosdev.ddk/lockout/lockNow`
1343
+ })), Gt = async (e) => {
1344
+ Yt.info("unlock");
1345
+ const t = await Kt({
1570
1346
  model: {},
1571
- urlOverride: `${ct}/api/app/kosdev.ddk/lockout/unlock/${e}`
1347
+ urlOverride: `${tt}/api/app/kosdev.ddk/lockout/unlock/${e}`
1572
1348
  });
1573
1349
  return t == null ? void 0 : t.data;
1574
- }, Bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1350
+ }, ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1575
1351
  __proto__: null,
1576
- lock: wi,
1577
- unlock: cr
1352
+ lock: Gr,
1353
+ unlock: Gt
1578
1354
  }, Symbol.toStringTag, { value: "Module" }));
1579
- var Ei = Object.defineProperty, Li = Object.getOwnPropertyDescriptor, N = (e, t, r, i) => {
1580
- for (var o = i > 1 ? void 0 : i ? Li(t, r) : t, n = e.length - 1, a; n >= 0; n--)
1581
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
1582
- return i && o && Ei(t, r, o), o;
1355
+ var qr = Object.defineProperty, Qr = Object.getOwnPropertyDescriptor, F = (e, t, o, s) => {
1356
+ for (var r = s > 1 ? void 0 : s ? Qr(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1357
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
1358
+ return s && r && qr(t, o, r), r;
1583
1359
  };
1584
- const ur = "lockout-model", Di = [
1360
+ const qt = "lockout-model", Xr = [
1585
1361
  { day: "monday", lock: "dayWiseLockConfigMap.Mon.enabled", open: "dayWiseLockConfigMap.Mon.unlockTime", close: "dayWiseLockConfigMap.Mon.lockTime" },
1586
1362
  { day: "tuesday", lock: "dayWiseLockConfigMap.Tue.enabled", open: "dayWiseLockConfigMap.Tue.unlockTime", close: "dayWiseLockConfigMap.Tue.lockTime" },
1587
1363
  { day: "wednesday", lock: "dayWiseLockConfigMap.Wed.enabled", open: "dayWiseLockConfigMap.Wed.unlockTime", close: "dayWiseLockConfigMap.Wed.lockTime" },
@@ -1590,11 +1366,11 @@ const ur = "lockout-model", Di = [
1590
1366
  { day: "saturday", lock: "dayWiseLockConfigMap.Sat.enabled", open: "dayWiseLockConfigMap.Sat.unlockTime", close: "dayWiseLockConfigMap.Sat.lockTime" },
1591
1367
  { day: "sunday", lock: "dayWiseLockConfigMap.Sun.enabled", open: "dayWiseLockConfigMap.Sun.unlockTime", close: "dayWiseLockConfigMap.Sun.lockTime" }
1592
1368
  ];
1593
- let E = class {
1594
- constructor(e, t, r) {
1595
- s(this, "id");
1596
- s(this, "logger");
1597
- s(this, "dayEnabledList", [
1369
+ let P = class {
1370
+ constructor(e, t, o) {
1371
+ i(this, "id");
1372
+ i(this, "logger");
1373
+ i(this, "dayEnabledList", [
1598
1374
  "dayWiseLockConfigMap.Sun.enabled",
1599
1375
  "dayWiseLockConfigMap.Mon.enabled",
1600
1376
  "dayWiseLockConfigMap.Tue.enabled",
@@ -1603,7 +1379,7 @@ let E = class {
1603
1379
  "dayWiseLockConfigMap.Fri.enabled",
1604
1380
  "dayWiseLockConfigMap.Sat.enabled"
1605
1381
  ]);
1606
- s(this, "dayOpenAtList", [
1382
+ i(this, "dayOpenAtList", [
1607
1383
  "dayWiseLockConfigMap.Sun.unlockTime",
1608
1384
  "dayWiseLockConfigMap.Mon.unlockTime",
1609
1385
  "dayWiseLockConfigMap.Tue.unlockTime",
@@ -1612,7 +1388,7 @@ let E = class {
1612
1388
  "dayWiseLockConfigMap.Fri.unlockTime",
1613
1389
  "dayWiseLockConfigMap.Sat.unlockTime"
1614
1390
  ]);
1615
- s(this, "dayCloseAtList", [
1391
+ i(this, "dayCloseAtList", [
1616
1392
  "dayWiseLockConfigMap.Sun.lockTime",
1617
1393
  "dayWiseLockConfigMap.Mon.lockTime",
1618
1394
  "dayWiseLockConfigMap.Tue.lockTime",
@@ -1621,22 +1397,22 @@ let E = class {
1621
1397
  "dayWiseLockConfigMap.Fri.lockTime",
1622
1398
  "dayWiseLockConfigMap.Sat.lockTime"
1623
1399
  ]);
1624
- s(this, "saveMap");
1625
- s(this, "pin");
1626
- s(this, "nextLockSkipped");
1627
- s(this, "nextLockTime");
1628
- s(this, "nextUnLockTime");
1629
- s(this, "cuiLockout");
1630
- this.id = e, this.logger = r.logger, this.saveMap = /* @__PURE__ */ new Map();
1400
+ i(this, "saveMap");
1401
+ i(this, "pin");
1402
+ i(this, "nextLockSkipped");
1403
+ i(this, "nextLockTime");
1404
+ i(this, "nextUnLockTime");
1405
+ i(this, "cuiLockout");
1406
+ this.id = e, this.logger = o.logger, this.saveMap = /* @__PURE__ */ new Map();
1631
1407
  }
1632
1408
  get enabled() {
1633
1409
  const e = this.getProp(
1634
1410
  "oneTimeLockConfig.lockTime"
1635
- ), t = e !== void 0 && e !== "", r = this.getProp("lockScheduleEnabled");
1636
- return t || r;
1411
+ ), t = e !== void 0 && e !== "", o = this.getProp("lockScheduleEnabled");
1412
+ return t || o;
1637
1413
  }
1638
1414
  get schedule() {
1639
- return Di;
1415
+ return Xr;
1640
1416
  }
1641
1417
  getProp(e) {
1642
1418
  return this.saveMap.get(e);
@@ -1653,7 +1429,7 @@ let E = class {
1653
1429
  this.nextLockSkipped.updateProperty("0");
1654
1430
  }
1655
1431
  async unlock(e) {
1656
- return await cr(e);
1432
+ return await Gt(e);
1657
1433
  }
1658
1434
  async save() {
1659
1435
  return this.saveMap.forEach((e, t) => {
@@ -1675,61 +1451,61 @@ let E = class {
1675
1451
  this.logger.debug(`loading lockout ${this.id}`);
1676
1452
  }
1677
1453
  };
1678
- N([
1454
+ F([
1679
1455
  d({
1680
1456
  path: "app:kosdev.ddk:service:cuiLockout",
1681
1457
  attribute: "pin"
1682
1458
  })
1683
- ], E.prototype, "pin", 2);
1684
- N([
1459
+ ], P.prototype, "pin", 2);
1460
+ F([
1685
1461
  d({
1686
1462
  path: "app:kosdev.ddk:service:cuiLockout",
1687
1463
  attribute: "nextLockSkipped"
1688
1464
  })
1689
- ], E.prototype, "nextLockSkipped", 2);
1690
- N([
1465
+ ], P.prototype, "nextLockSkipped", 2);
1466
+ F([
1691
1467
  d({
1692
1468
  path: "app:kosdev.ddk:service:cuiLockout",
1693
1469
  attribute: "nextLockTime"
1694
1470
  })
1695
- ], E.prototype, "nextLockTime", 2);
1696
- N([
1471
+ ], P.prototype, "nextLockTime", 2);
1472
+ F([
1697
1473
  d({
1698
1474
  path: "app:kosdev.ddk:service:cuiLockout",
1699
1475
  attribute: "nextUnLockTime"
1700
1476
  })
1701
- ], E.prototype, "nextUnLockTime", 2);
1702
- N([
1703
- Gr({ path: "app:kosdev.ddk:service:cuiLockout" })
1704
- ], E.prototype, "cuiLockout", 2);
1705
- E = N([
1706
- l(ur)
1707
- ], E);
1708
- const Ks = new ke({
1709
- class: E,
1710
- type: ur
1711
- }), ki = async (e, t) => await De.bulkResolveTroubles(
1477
+ ], P.prototype, "nextUnLockTime", 2);
1478
+ F([
1479
+ So({ path: "app:kosdev.ddk:service:cuiLockout" })
1480
+ ], P.prototype, "cuiLockout", 2);
1481
+ P = F([
1482
+ l(qt)
1483
+ ], P);
1484
+ const li = new He({
1485
+ class: P,
1486
+ type: qt
1487
+ }), Jr = async (e, t) => await Me.bulkResolveTroubles(
1712
1488
  e,
1713
1489
  void 0,
1714
1490
  t
1715
1491
  );
1716
- var Ri = Object.defineProperty, Ii = Object.getOwnPropertyDescriptor, He = (e, t, r, i) => {
1717
- for (var o = i > 1 ? void 0 : i ? Ii(t, r) : t, n = e.length - 1, a; n >= 0; n--)
1718
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
1719
- return i && o && Ri(t, r, o), o;
1720
- };
1721
- const te = "macro-assignment-model", _t = "PurgeTrouble", Fi = "PrimeTrouble";
1722
- let A = class {
1723
- constructor(e, t, r) {
1724
- s(this, "id");
1725
- s(this, "logger");
1492
+ var Zr = Object.defineProperty, es = Object.getOwnPropertyDescriptor, Le = (e, t, o, s) => {
1493
+ for (var r = s > 1 ? void 0 : s ? es(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1494
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
1495
+ return s && r && Zr(t, o, r), r;
1496
+ };
1497
+ const G = "macro-assignment-model", gt = "PurgeTrouble", ts = "PrimeTrouble";
1498
+ let D = class {
1499
+ constructor(e, t, o) {
1500
+ i(this, "id");
1501
+ i(this, "logger");
1726
1502
  /**
1727
1503
  * futureHandler is used to handle async operations
1728
1504
  */
1729
- s(this, "futureHandler");
1730
- s(this, "holders");
1731
- s(this, "ingredients");
1732
- this.id = e, this.futureHandler = new pe(), this.logger = r.logger;
1505
+ i(this, "futureHandler");
1506
+ i(this, "holders");
1507
+ i(this, "ingredients");
1508
+ this.id = e, this.futureHandler = new Ge(), this.logger = o.logger;
1733
1509
  }
1734
1510
  /**
1735
1511
  * shortcut to the current running future
@@ -1758,15 +1534,15 @@ let A = class {
1758
1534
  * Relying on the indexing of troubles by type to find the purge troubles.
1759
1535
  */
1760
1536
  get holderPurgeTroubles() {
1761
- return this.macroHolders.reduce((t, r) => {
1762
- const i = r.troublesByType[_t] || [];
1763
- return t = [...t, ...i], t;
1537
+ return this.macroHolders.reduce((t, o) => {
1538
+ const s = o.troublesByType[gt] || [];
1539
+ return t = [...t, ...s], t;
1764
1540
  }, []);
1765
1541
  }
1766
1542
  get holderPrimeTroubles() {
1767
- return this.macroHolders.reduce((t, r) => {
1768
- const i = r.troublesByType[Fi] || [];
1769
- return t = [...t, ...i], t;
1543
+ return this.macroHolders.reduce((t, o) => {
1544
+ const s = o.troublesByType[ts] || [];
1545
+ return t = [...t, ...s], t;
1770
1546
  }, []);
1771
1547
  }
1772
1548
  /**
@@ -1801,53 +1577,53 @@ let A = class {
1801
1577
  async resolveAll(e, t) {
1802
1578
  if (!t)
1803
1579
  throw new Error("No tracker provided");
1804
- const i = (e === _t ? this.holderPurgeTroubles : this.holderPrimeTroubles).map((n) => n.rawId);
1805
- return await ki(i, t);
1806
- }
1807
- };
1808
- He([
1809
- m({ modelType: Zr.type })
1810
- ], A.prototype, "holders", 2);
1811
- He([
1812
- m({ modelType: eo.type })
1813
- ], A.prototype, "ingredients", 2);
1814
- He([
1815
- v()
1816
- ], A.prototype, "resolveAll", 1);
1817
- A = He([
1818
- l(te)
1819
- ], A);
1820
- const xi = {
1580
+ const s = (e === gt ? this.holderPurgeTroubles : this.holderPrimeTroubles).map((n) => n.rawId);
1581
+ return await Jr(s, t);
1582
+ }
1583
+ };
1584
+ Le([
1585
+ p({ modelType: Lo.type })
1586
+ ], D.prototype, "holders", 2);
1587
+ Le([
1588
+ p({ modelType: Do.type })
1589
+ ], D.prototype, "ingredients", 2);
1590
+ Le([
1591
+ M()
1592
+ ], D.prototype, "resolveAll", 1);
1593
+ D = Le([
1594
+ l(G)
1595
+ ], D);
1596
+ const os = {
1821
1597
  registration: {
1822
- [te]: {
1823
- class: A,
1598
+ [G]: {
1599
+ class: D,
1824
1600
  singleton: !0
1825
1601
  }
1826
1602
  },
1827
- type: te,
1828
- predicate: u(te),
1603
+ type: G,
1604
+ predicate: u(G),
1829
1605
  factory: c.Singleton.create(
1830
- te
1606
+ G
1831
1607
  )
1832
1608
  };
1833
- var Ai = Object.getOwnPropertyDescriptor, ji = (e, t, r, i) => {
1834
- for (var o = i > 1 ? void 0 : i ? Ai(t, r) : t, n = e.length - 1, a; n >= 0; n--)
1835
- (a = e[n]) && (o = a(o) || o);
1836
- return o;
1609
+ var rs = Object.getOwnPropertyDescriptor, ss = (e, t, o, s) => {
1610
+ for (var r = s > 1 ? void 0 : s ? rs(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1611
+ (a = e[n]) && (r = a(r) || r);
1612
+ return r;
1837
1613
  };
1838
- const re = "network-test-model";
1839
- let Je = class {
1840
- constructor(e, t, r) {
1841
- s(this, "id");
1842
- s(this, "group");
1843
- s(this, "passed");
1844
- s(this, "inProgress");
1845
- s(this, "failureTime");
1846
- s(this, "timestamp");
1847
- s(this, "name");
1848
- s(this, "results");
1849
- s(this, "logger");
1850
- this.id = e, this.logger = r.logger, this.group = t.group, this.passed = !1, this.inProgress = !1, this.name = t.name, this.results = [];
1614
+ const q = "network-test-model";
1615
+ let We = class {
1616
+ constructor(e, t, o) {
1617
+ i(this, "id");
1618
+ i(this, "group");
1619
+ i(this, "passed");
1620
+ i(this, "inProgress");
1621
+ i(this, "failureTime");
1622
+ i(this, "timestamp");
1623
+ i(this, "name");
1624
+ i(this, "results");
1625
+ i(this, "logger");
1626
+ this.id = e, this.logger = o.logger, this.group = t.group, this.passed = !1, this.inProgress = !1, this.name = t.name, this.results = [];
1851
1627
  }
1852
1628
  updateModel(e) {
1853
1629
  this.group = e.group, this.name = e.name, this.passed = e.passed, this.failureTime = e.failureTime, this.inProgress = e.inProgress, this.timestamp = e.timestamp, this.results = e.results;
@@ -1860,58 +1636,58 @@ let Je = class {
1860
1636
  this.logger.debug(`loading network-test ${this.id}`);
1861
1637
  }
1862
1638
  };
1863
- Je = ji([
1864
- l(re)
1865
- ], Je);
1866
- const dr = {
1639
+ We = ss([
1640
+ l(q)
1641
+ ], We);
1642
+ const Qt = {
1867
1643
  registration: {
1868
- [re]: {
1869
- class: Je,
1644
+ [q]: {
1645
+ class: We,
1870
1646
  singleton: !1
1871
1647
  }
1872
1648
  },
1873
- type: re,
1874
- predicate: u(re),
1875
- factory: c.Factory.create(re)
1876
- }, { URL: We } = h("NETWORK-TEST_SERVICE"), { getAll: Ui, getOne: pr } = f.build({
1877
- basePath: `${We}/api/app/ncui/network/tests`
1878
- }), Vi = g.createLogger({
1649
+ type: q,
1650
+ predicate: u(q),
1651
+ factory: c.Factory.create(q)
1652
+ }, { URL: De } = h("NETWORK-TEST_SERVICE"), { getAll: is, getOne: Xt } = y.build({
1653
+ basePath: `${De}/api/app/ncui/network/tests`
1654
+ }), ns = g.createLogger({
1879
1655
  name: "network-test-service",
1880
1656
  group: "Services"
1881
- }), gr = async () => {
1882
- Vi.debug("sending GET for network-test");
1883
- const e = await Ui({
1884
- urlOverride: `${We}/api/app/kosdev.ddk/network/tests`
1657
+ }), Jt = async () => {
1658
+ ns.debug("sending GET for network-test");
1659
+ const e = await is({
1660
+ urlOverride: `${De}/api/app/kosdev.ddk/network/tests`
1885
1661
  });
1886
1662
  return e == null ? void 0 : e.data;
1887
- }, hr = async () => {
1888
- const e = await pr({
1889
- urlOverride: `${We}/api/app/kosdev.ddk/network/reports`
1663
+ }, Zt = async () => {
1664
+ const e = await Xt({
1665
+ urlOverride: `${De}/api/app/kosdev.ddk/network/reports`
1890
1666
  });
1891
1667
  return e == null ? void 0 : e.data;
1892
- }, fr = async (e, t) => await pr({
1893
- urlOverride: `${We}/api/app/kosdev.ddk/network/tests/run/group/${e}`,
1668
+ }, eo = async (e, t) => await Xt({
1669
+ urlOverride: `${De}/api/app/kosdev.ddk/network/tests/run/group/${e}`,
1894
1670
  tracker: t
1895
- }), Ys = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1671
+ }), di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1896
1672
  __proto__: null,
1897
- getNetworkTests: gr,
1898
- getTestsReports: hr,
1899
- performGroupTest: fr
1673
+ getNetworkTests: Jt,
1674
+ getTestsReports: Zt,
1675
+ performGroupTest: eo
1900
1676
  }, Symbol.toStringTag, { value: "Module" }));
1901
- var Hi = Object.defineProperty, Wi = Object.getOwnPropertyDescriptor, ut = (e, t, r, i) => {
1902
- for (var o = i > 1 ? void 0 : i ? Wi(t, r) : t, n = e.length - 1, a; n >= 0; n--)
1903
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
1904
- return i && o && Hi(t, r, o), o;
1905
- };
1906
- const oe = "network-test-container-model";
1907
- let de = class {
1908
- constructor(e, t, r) {
1909
- s(this, "id");
1910
- s(this, "logger");
1911
- s(this, "lastTested");
1912
- s(this, "futureHandler");
1913
- s(this, "models");
1914
- this.id = e, this.logger = r.logger, this.futureHandler = new pe(this), this.models = new tt({
1677
+ var as = Object.defineProperty, ls = Object.getOwnPropertyDescriptor, ot = (e, t, o, s) => {
1678
+ for (var r = s > 1 ? void 0 : s ? ls(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1679
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
1680
+ return s && r && as(t, o, r), r;
1681
+ };
1682
+ const Q = "network-test-container-model";
1683
+ let ne = class {
1684
+ constructor(e, t, o) {
1685
+ i(this, "id");
1686
+ i(this, "logger");
1687
+ i(this, "lastTested");
1688
+ i(this, "futureHandler");
1689
+ i(this, "models");
1690
+ this.id = e, this.logger = o.logger, this.futureHandler = new Ge(this), this.models = new Ve({
1915
1691
  parentId: e,
1916
1692
  indexMap: {
1917
1693
  group: "group"
@@ -1937,28 +1713,28 @@ let de = class {
1937
1713
  );
1938
1714
  }
1939
1715
  getLastTested(e) {
1940
- const t = this.models.getIndexByKey("group", e).map((i) => i.timestamp && new Date(i.timestamp)), r = Math.max(
1941
- ...t.map((i) => i ? i.getTime() : 0)
1716
+ const t = this.models.getIndexByKey("group", e).map((s) => s.timestamp && new Date(s.timestamp)), o = Math.max(
1717
+ ...t.map((s) => s ? s.getTime() : 0)
1942
1718
  );
1943
- return r ? bi(new Date(r)) : "";
1719
+ return o ? Hr(new Date(o)) : "";
1944
1720
  }
1945
1721
  async load() {
1946
1722
  this.logger.debug(`loading network-test-container container ${this.id}`);
1947
- const e = await gr(), t = await hr();
1948
- e && e.forEach((r) => {
1949
- const i = dr.factory(r.id)(r);
1950
- this.addModel(i);
1951
- }), e && t && e.forEach((r) => {
1952
- const i = t == null ? void 0 : t[r.group], o = i == null ? void 0 : i[r.id], n = this.getModel(r.id);
1953
- if (n && o) {
1723
+ const e = await Jt(), t = await Zt();
1724
+ e && e.forEach((o) => {
1725
+ const s = Qt.factory(o.id)(o);
1726
+ this.addModel(s);
1727
+ }), e && t && e.forEach((o) => {
1728
+ const s = t == null ? void 0 : t[o.group], r = s == null ? void 0 : s[o.id], n = this.getModel(o.id);
1729
+ if (n && r) {
1954
1730
  const a = {
1955
- group: o.group,
1956
- name: o.name,
1957
- passed: o.passed,
1958
- failureTime: o.failureTime ? new Date(o.failureTime) : void 0,
1959
- inProgress: o.inProgress,
1960
- timestamp: new Date(o.timestamp),
1961
- results: o.results
1731
+ group: r.group,
1732
+ name: r.name,
1733
+ passed: r.passed,
1734
+ failureTime: r.failureTime ? new Date(r.failureTime) : void 0,
1735
+ inProgress: r.inProgress,
1736
+ timestamp: new Date(r.timestamp),
1737
+ results: r.results
1962
1738
  };
1963
1739
  n.updateModel(a);
1964
1740
  }
@@ -1967,117 +1743,125 @@ let de = class {
1967
1743
  async performTest(e, t) {
1968
1744
  if (!t)
1969
1745
  throw new Error("No tracker provided");
1970
- const r = await fr(e, t);
1971
- return r == null ? void 0 : r.data;
1746
+ const o = await eo(e, t);
1747
+ return o == null ? void 0 : o.data;
1972
1748
  }
1973
1749
  onFutureUpdate(e) {
1974
1750
  const { clientData: t } = e;
1975
- t && t.forEach((r) => {
1976
- const i = this.getModel(r.id);
1977
- if (_(() => {
1978
- this.lastTested = this.lastTested > new Date(r.timestamp) ? this.lastTested : new Date(r.timestamp);
1979
- }), i) {
1980
- const o = {
1981
- group: r.group,
1982
- name: r.name,
1983
- passed: r.passed,
1984
- failureTime: r.failureTime ? new Date(r.failureTime) : void 0,
1985
- inProgress: r.inProgress,
1986
- timestamp: new Date(r.timestamp),
1987
- results: r.results
1751
+ t && t.forEach((o) => {
1752
+ const s = this.getModel(o.id);
1753
+ if (v(() => {
1754
+ this.lastTested = this.lastTested > new Date(o.timestamp) ? this.lastTested : new Date(o.timestamp);
1755
+ }), s) {
1756
+ const r = {
1757
+ group: o.group,
1758
+ name: o.name,
1759
+ passed: o.passed,
1760
+ failureTime: o.failureTime ? new Date(o.failureTime) : void 0,
1761
+ inProgress: o.inProgress,
1762
+ timestamp: new Date(o.timestamp),
1763
+ results: o.results
1988
1764
  };
1989
- _(() => {
1990
- i.updateModel(o);
1765
+ v(() => {
1766
+ s.updateModel(r);
1991
1767
  });
1992
1768
  }
1993
1769
  });
1994
1770
  }
1995
1771
  };
1996
- ut([
1997
- Le
1998
- ], de.prototype, "models", 2);
1999
- ut([
2000
- v()
2001
- ], de.prototype, "performTest", 1);
2002
- de = ut([
2003
- l(oe)
2004
- ], de);
2005
- const Ni = {
1772
+ ot([
1773
+ $e
1774
+ ], ne.prototype, "models", 2);
1775
+ ot([
1776
+ M()
1777
+ ], ne.prototype, "performTest", 1);
1778
+ ne = ot([
1779
+ l(Q)
1780
+ ], ne);
1781
+ const ds = {
2006
1782
  registration: {
2007
- [oe]: {
2008
- class: de,
1783
+ [Q]: {
1784
+ class: ne,
2009
1785
  singleton: !0
2010
1786
  },
2011
- ...dr.registration
1787
+ ...Qt.registration
2012
1788
  },
2013
- type: oe,
2014
- predicate: u(oe),
2015
- factory: c.Singleton.create(oe)
1789
+ type: Q,
1790
+ predicate: u(Q),
1791
+ factory: c.Singleton.create(Q)
2016
1792
  };
2017
- var zi = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, mr = (e, t, r, i) => {
2018
- for (var o = i > 1 ? void 0 : i ? Bi(t, r) : t, n = e.length - 1, a; n >= 0; n--)
2019
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
2020
- return i && o && zi(t, r, o), o;
1793
+ var cs = Object.defineProperty, us = Object.getOwnPropertyDescriptor, rt = (e, t, o, s) => {
1794
+ for (var r = s > 1 ? void 0 : s ? us(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1795
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
1796
+ return s && r && cs(t, o, r), r;
2021
1797
  };
2022
- const ie = "nutritive-sweetener-model";
2023
- let Pe = class {
2024
- constructor(e, t, r) {
2025
- s(this, "id");
2026
- s(this, "assemblyModel");
2027
- s(this, "logger");
2028
- this.id = e, this.logger = r.logger;
1798
+ const X = "nutritive-sweetener-model", ps = ht("statePath");
1799
+ let ae = class {
1800
+ constructor(e, t) {
1801
+ i(this, "id");
1802
+ i(this, "assemblyModel");
1803
+ i(this, "pumpState");
1804
+ this.id = e;
2029
1805
  }
2030
- getHolder() {
1806
+ get holder() {
2031
1807
  return this.assemblyModel.getHoldersByGroup("ns")[0];
2032
1808
  }
2033
- getPump() {
2034
- return this.getHolder().pumps.data[0];
1809
+ getHolder() {
1810
+ return this.holder;
2035
1811
  }
2036
- // -------------------LIFECYCLE----------------------------
2037
- async init() {
2038
- this.logger.debug(`initializing nutritive-sweetener ${this.id}`);
1812
+ get statePath() {
1813
+ return `${this.pump.path}:airVent:state`;
2039
1814
  }
2040
- async load() {
2041
- this.logger.debug(`loading nutritive-sweetener ${this.id}`);
1815
+ get pump() {
1816
+ return this.holder.pumps.data[0];
1817
+ }
1818
+ getPump() {
1819
+ return this.pump;
2042
1820
  }
2043
1821
  };
2044
- mr([
2045
- m({ modelType: Fe.type })
2046
- ], Pe.prototype, "assemblyModel", 2);
2047
- Pe = mr([
2048
- l(ie)
2049
- ], Pe);
2050
- const Ki = {
1822
+ rt([
1823
+ p({ modelType: Se.type })
1824
+ ], ae.prototype, "assemblyModel", 2);
1825
+ rt([
1826
+ wo({
1827
+ path: ps
1828
+ })
1829
+ ], ae.prototype, "pumpState", 2);
1830
+ ae = rt([
1831
+ l(X),
1832
+ Ke()
1833
+ ], ae);
1834
+ const gs = {
2051
1835
  registration: {
2052
- [ie]: {
2053
- class: Pe,
1836
+ [X]: {
1837
+ class: ae,
2054
1838
  singleton: !1
2055
1839
  }
2056
1840
  },
2057
- type: ie,
2058
- predicate: u(ie),
2059
- factory: c.Factory.create(ie)
1841
+ type: X,
1842
+ predicate: u(X),
1843
+ factory: c.Factory.create(X)
2060
1844
  };
2061
- var Yi = Object.defineProperty, qi = Object.getOwnPropertyDescriptor, yr = (e, t, r, i) => {
2062
- for (var o = i > 1 ? void 0 : i ? qi(t, r) : t, n = e.length - 1, a; n >= 0; n--)
2063
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
2064
- return i && o && Yi(t, r, o), o;
1845
+ var hs = Object.defineProperty, ys = Object.getOwnPropertyDescriptor, to = (e, t, o, s) => {
1846
+ for (var r = s > 1 ? void 0 : s ? ys(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1847
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
1848
+ return s && r && hs(t, o, r), r;
2065
1849
  };
2066
- const se = "plain-water-model";
2067
- let Oe = class {
2068
- constructor(e, t, r) {
2069
- s(this, "id");
2070
- s(this, "assemblyModel");
2071
- s(this, "logger");
2072
- this.id = e, this.logger = r.logger;
1850
+ const J = "plain-water-model";
1851
+ let me = class {
1852
+ constructor(e, t, o) {
1853
+ i(this, "id");
1854
+ i(this, "assemblyModel");
1855
+ i(this, "logger");
1856
+ this.id = e, this.logger = o.logger;
2073
1857
  }
2074
1858
  getHolder() {
2075
1859
  return this.assemblyModel.getHoldersByGroup("water")[0];
2076
1860
  }
2077
1861
  getPump() {
2078
- var i, o;
2079
- const e = this.getHolder(), t = (o = (i = e == null ? void 0 : e.pumps) == null ? void 0 : i.data) == null ? void 0 : o[0];
2080
- return rt(t, Kt.type);
1862
+ var s, r;
1863
+ const e = this.getHolder(), t = (r = (s = e == null ? void 0 : e.pumps) == null ? void 0 : s.data) == null ? void 0 : r[0];
1864
+ return Be(t, mt.type);
2081
1865
  }
2082
1866
  // -------------------LIFECYCLE----------------------------
2083
1867
  async init() {
@@ -2087,45 +1871,45 @@ let Oe = class {
2087
1871
  this.logger.debug(`loading plain-water ${this.id}`);
2088
1872
  }
2089
1873
  };
2090
- yr([
2091
- m({ modelType: Fe.type })
2092
- ], Oe.prototype, "assemblyModel", 2);
2093
- Oe = yr([
2094
- l(se)
2095
- ], Oe);
2096
- const Gi = {
1874
+ to([
1875
+ p({ modelType: Se.type })
1876
+ ], me.prototype, "assemblyModel", 2);
1877
+ me = to([
1878
+ l(J)
1879
+ ], me);
1880
+ const fs = {
2097
1881
  registration: {
2098
- [se]: {
2099
- class: Oe,
1882
+ [J]: {
1883
+ class: me,
2100
1884
  singleton: !1
2101
1885
  }
2102
1886
  },
2103
- type: se,
2104
- predicate: u(se),
2105
- factory: c.Factory.create(se)
2106
- }, { URL: br } = h("REBOOT_SERVICE"), { postModel: Qi } = f.build({
2107
- basePath: `${br}/api/reboot`
2108
- }), Xi = g.createLogger({ name: "reboot-service", group: "Services" }), vr = async () => (Xi.debug("sending POST call for Reboot Dispenser"), await Qi({
2109
- urlOverride: `${br}/api/app/kosdev.ddk/ncui/reboot`,
1887
+ type: J,
1888
+ predicate: u(J),
1889
+ factory: c.Factory.create(J)
1890
+ }, { URL: oo } = h("REBOOT_SERVICE"), { postModel: vs } = y.build({
1891
+ basePath: `${oo}/api/reboot`
1892
+ }), ms = g.createLogger({ name: "reboot-service", group: "Services" }), ro = async () => (ms.debug("sending POST call for Reboot Dispenser"), await vs({
1893
+ urlOverride: `${oo}/api/app/kosdev.ddk/ncui/reboot`,
2110
1894
  model: {}
2111
- })), qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1895
+ })), ci = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2112
1896
  __proto__: null,
2113
- rebootDispenser: vr
1897
+ rebootDispenser: ro
2114
1898
  }, Symbol.toStringTag, { value: "Module" }));
2115
- var Ji = Object.getOwnPropertyDescriptor, Zi = (e, t, r, i) => {
2116
- for (var o = i > 1 ? void 0 : i ? Ji(t, r) : t, n = e.length - 1, a; n >= 0; n--)
2117
- (a = e[n]) && (o = a(o) || o);
2118
- return o;
1899
+ var bs = Object.getOwnPropertyDescriptor, _s = (e, t, o, s) => {
1900
+ for (var r = s > 1 ? void 0 : s ? bs(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1901
+ (a = e[n]) && (r = a(r) || r);
1902
+ return r;
2119
1903
  };
2120
- const ae = "reboot-model";
2121
- let Ze = class {
2122
- constructor(e, t, r) {
2123
- s(this, "id");
2124
- s(this, "logger");
2125
- this.id = e, this.logger = r.logger;
1904
+ const Z = "reboot-model";
1905
+ let Ne = class {
1906
+ constructor(e, t, o) {
1907
+ i(this, "id");
1908
+ i(this, "logger");
1909
+ this.id = e, this.logger = o.logger;
2126
1910
  }
2127
1911
  async completeReboot() {
2128
- await vr();
1912
+ await ro();
2129
1913
  }
2130
1914
  updateModel() {
2131
1915
  }
@@ -2137,46 +1921,45 @@ let Ze = class {
2137
1921
  this.logger.debug(`loading reboot ${this.id}`);
2138
1922
  }
2139
1923
  };
2140
- Ze = Zi([
2141
- l(ae)
2142
- ], Ze);
2143
- const es = {
1924
+ Ne = _s([
1925
+ l(Z)
1926
+ ], Ne);
1927
+ const Ts = {
2144
1928
  registration: {
2145
- [ae]: {
2146
- class: Ze,
1929
+ [Z]: {
1930
+ class: Ne,
2147
1931
  singleton: !1
2148
1932
  }
2149
1933
  },
2150
- type: ae,
2151
- predicate: u(ae),
2152
- factory: c.Factory.create(ae)
2153
- };
2154
- var ts = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, C = (e, t, r, i) => {
2155
- for (var o = i > 1 ? void 0 : i ? rs(t, r) : t, n = e.length - 1, a; n >= 0; n--)
2156
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
2157
- return i && o && ts(t, r, o), o;
2158
- };
2159
- const ne = "settings-model";
2160
- let P = class {
2161
- constructor(e, t, r) {
2162
- s(this, "id");
2163
- s(this, "logger");
2164
- s(this, "ncuiLanguageData");
2165
- s(this, "resolveDelaysMs");
2166
- s(this, "dateFormat");
2167
- s(this, "timeFormat");
2168
- s(this, "hidePlainWaterBev");
2169
- s(this, "hideCarbWaterBev");
2170
- s(this, "ncuiLanguage");
2171
- s(this, "name");
2172
- s(this, "activateAndRebootTime");
2173
- this.id = e, this.logger = r.logger;
2174
- }
2175
- updateModel(e) {
1934
+ type: Z,
1935
+ predicate: u(Z),
1936
+ factory: c.Factory.create(Z)
1937
+ };
1938
+ var $s = Object.defineProperty, Ps = Object.getOwnPropertyDescriptor, m = (e, t, o, s) => {
1939
+ for (var r = s > 1 ? void 0 : s ? Ps(t, o) : t, n = e.length - 1, a; n >= 0; n--)
1940
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
1941
+ return s && r && $s(t, o, r), r;
1942
+ };
1943
+ const ee = "settings-model";
1944
+ let f = class {
1945
+ constructor(e, t, o) {
1946
+ i(this, "id");
1947
+ i(this, "logger");
1948
+ i(this, "ncuiLanguageData");
1949
+ i(this, "resolveDelaysMs");
1950
+ i(this, "dateFormat");
1951
+ i(this, "timeFormat");
1952
+ i(this, "hidePlainWaterBev");
1953
+ i(this, "hideCarbWaterBev");
1954
+ i(this, "ncuiLanguage");
1955
+ i(this, "name");
1956
+ i(this, "activateAndRebootTime");
1957
+ i(this, "horizontalMode");
1958
+ this.id = e, this.logger = o.logger;
2176
1959
  }
2177
1960
  // -------------------LIFECYCLE----------------------------
2178
- async init() {
2179
- this.logger.debug(`initializing settings ${this.id}`);
1961
+ async ready() {
1962
+ this.updateDisplayMode();
2180
1963
  }
2181
1964
  async getNcuiLanguageList() {
2182
1965
  this.ncuiLanguageData = {
@@ -2204,98 +1987,115 @@ let P = class {
2204
1987
  }
2205
1988
  };
2206
1989
  }
1990
+ handleUpdateDisplayMode() {
1991
+ this.updateDisplayMode();
1992
+ }
1993
+ updateDisplayMode() {
1994
+ this.horizontalMode.value ? document.body.setAttribute("data-dashboard-layout", "horizontal") : document.body.setAttribute("data-dashboard-layout", "vertical");
1995
+ }
2207
1996
  };
2208
- C([
1997
+ m([
2209
1998
  d({
2210
1999
  path: "system:app",
2211
2000
  attribute: "resolveDelaysMs"
2212
2001
  // optionsExpander: () => [],
2213
2002
  })
2214
- ], P.prototype, "resolveDelaysMs", 2);
2215
- C([
2003
+ ], f.prototype, "resolveDelaysMs", 2);
2004
+ m([
2216
2005
  d({
2217
2006
  path: "system:app",
2218
2007
  attribute: "dateFormat"
2219
2008
  // optionsExpander: () => [],
2220
2009
  })
2221
- ], P.prototype, "dateFormat", 2);
2222
- C([
2010
+ ], f.prototype, "dateFormat", 2);
2011
+ m([
2223
2012
  d({
2224
2013
  path: "system:app",
2225
2014
  attribute: "timeFormat"
2226
2015
  // optionsExpander: () => [],
2227
2016
  })
2228
- ], P.prototype, "timeFormat", 2);
2229
- C([
2017
+ ], f.prototype, "timeFormat", 2);
2018
+ m([
2230
2019
  d({
2231
2020
  path: "app:kosdev.ddk:app",
2232
2021
  attribute: "ncui.hidePlainWaterBev"
2233
2022
  })
2234
- ], P.prototype, "hidePlainWaterBev", 2);
2235
- C([
2023
+ ], f.prototype, "hidePlainWaterBev", 2);
2024
+ m([
2236
2025
  d({
2237
2026
  path: "app:kosdev.ddk:app",
2238
2027
  attribute: "ncui.hideCarbWaterBev"
2239
2028
  })
2240
- ], P.prototype, "hideCarbWaterBev", 2);
2241
- C([
2029
+ ], f.prototype, "hideCarbWaterBev", 2);
2030
+ m([
2242
2031
  d({
2243
2032
  path: "app:kosdev.ddk:app",
2244
2033
  attribute: "ncui.ncuiLanguage"
2245
2034
  })
2246
- ], P.prototype, "ncuiLanguage", 2);
2247
- C([
2035
+ ], f.prototype, "ncuiLanguage", 2);
2036
+ m([
2248
2037
  d({
2249
2038
  path: "kos:device",
2250
2039
  attribute: "name"
2251
2040
  })
2252
- ], P.prototype, "name", 2);
2253
- C([
2041
+ ], f.prototype, "name", 2);
2042
+ m([
2254
2043
  d({
2255
2044
  path: "kos:service:OTA",
2256
2045
  attribute: "activateAndRebootTime"
2257
2046
  })
2258
- ], P.prototype, "activateAndRebootTime", 2);
2259
- P = C([
2260
- l(ne)
2261
- ], P);
2262
- const os = {
2047
+ ], f.prototype, "activateAndRebootTime", 2);
2048
+ m([
2049
+ d({
2050
+ path: "app:kosdev.ddk:app",
2051
+ attribute: "ncui.uiConfig.display.horizontalMode"
2052
+ })
2053
+ ], f.prototype, "horizontalMode", 2);
2054
+ m([
2055
+ Pe({
2056
+ dependencies: (e) => [e.horizontalMode.value]
2057
+ })
2058
+ ], f.prototype, "handleUpdateDisplayMode", 1);
2059
+ f = m([
2060
+ l(ee)
2061
+ ], f);
2062
+ const Ms = {
2263
2063
  registration: {
2264
- [ne]: {
2265
- class: P,
2064
+ [ee]: {
2065
+ class: f,
2266
2066
  singleton: !0
2267
2067
  }
2268
2068
  },
2269
- type: ne,
2270
- predicate: u(ne),
2271
- factory: c.Singleton.create(ne)
2272
- }, { URL: _r } = h("SETTINGS_SERVICE"), { getAll: $r } = f.build({
2273
- basePath: `${_r}/api/settings`
2274
- }), is = g.createLogger({
2069
+ type: ee,
2070
+ predicate: u(ee),
2071
+ factory: c.Singleton.create(ee)
2072
+ }, { URL: so } = h("SETTINGS_SERVICE"), { getAll: io } = y.build({
2073
+ basePath: `${so}/api/settings`
2074
+ }), Os = g.createLogger({
2275
2075
  name: "settings-service",
2276
2076
  group: "Services"
2277
- }), ss = async () => (is.debug("sending GET for settings"), await $r({})), as = async () => await $r({
2278
- urlOverride: `${_r}api/app/kosdev.ddk/ncui/languages`
2279
- }), Gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2077
+ }), Ss = async () => (Os.debug("sending GET for settings"), await io({})), ws = async () => await io({
2078
+ urlOverride: `${so}api/app/kosdev.ddk/ncui/languages`
2079
+ }), ui = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2280
2080
  __proto__: null,
2281
- getNcuiLanguage: as,
2282
- getSettings: ss
2081
+ getNcuiLanguage: ws,
2082
+ getSettings: Ss
2283
2083
  }, Symbol.toStringTag, { value: "Module" }));
2284
- var ns = Object.getOwnPropertyDescriptor, ls = (e, t, r, i) => {
2285
- for (var o = i > 1 ? void 0 : i ? ns(t, r) : t, n = e.length - 1, a; n >= 0; n--)
2286
- (a = e[n]) && (o = a(o) || o);
2287
- return o;
2084
+ var Es = Object.getOwnPropertyDescriptor, Cs = (e, t, o, s) => {
2085
+ for (var r = s > 1 ? void 0 : s ? Es(t, o) : t, n = e.length - 1, a; n >= 0; n--)
2086
+ (a = e[n]) && (r = a(r) || r);
2087
+ return r;
2288
2088
  };
2289
- const le = "utilities-model";
2290
- let et = class {
2291
- constructor(e, t, r) {
2292
- s(this, "id");
2293
- s(this, "name");
2294
- s(this, "options");
2295
- s(this, "roles");
2296
- s(this, "columnId");
2297
- s(this, "logger");
2298
- this.id = e, this.logger = r.logger, this.name = t.name, this.options = t.options, this.roles = t == null ? void 0 : t.roles, this.columnId = t.columnId;
2089
+ const te = "utilities-model";
2090
+ let ze = class {
2091
+ constructor(e, t, o) {
2092
+ i(this, "id");
2093
+ i(this, "name");
2094
+ i(this, "options");
2095
+ i(this, "roles");
2096
+ i(this, "columnId");
2097
+ i(this, "logger");
2098
+ this.id = e, this.logger = o.logger, this.name = t.name, this.options = t.options, this.roles = t == null ? void 0 : t.roles, this.columnId = t.columnId;
2299
2099
  }
2300
2100
  updateModel(e) {
2301
2101
  this.name = e.name, this.options = e.options, this.roles = e == null ? void 0 : e.roles;
@@ -2314,46 +2114,61 @@ let et = class {
2314
2114
  this.logger.debug(`loading utilities ${this.id}`);
2315
2115
  }
2316
2116
  };
2317
- et = ls([
2318
- l(le)
2319
- ], et);
2320
- const Tr = {
2117
+ ze = Cs([
2118
+ l(te)
2119
+ ], ze);
2120
+ const no = {
2321
2121
  registration: {
2322
- [le]: {
2323
- class: et,
2122
+ [te]: {
2123
+ class: ze,
2324
2124
  singleton: !1
2325
2125
  }
2326
2126
  },
2327
- type: le,
2328
- predicate: u(le),
2329
- factory: c.Factory.create(le)
2330
- }, { URL: Pr } = h("UTILITIES_SERVICE"), { getAll: cs } = f.build({
2331
- basePath: `${Pr}/api/utilities`
2332
- }), us = g.createLogger({
2127
+ type: te,
2128
+ predicate: u(te),
2129
+ factory: c.Factory.create(te)
2130
+ }, { URL: ge } = h("UTILITIES_SERVICE"), { getAll: Ie } = y.build({
2131
+ basePath: `${ge}/api/utilities`
2132
+ }), Re = g.createLogger({
2333
2133
  name: "utilities-service",
2334
2134
  group: "Services"
2335
- }), Or = async () => {
2336
- us.debug("sending GET for utilities");
2337
- const e = await cs({
2338
- urlOverride: `${Pr}/api/kos/descriptor/system:app/kondra.ncui.utilities`
2339
- });
2340
- return e == null ? void 0 : e.data;
2341
- }, Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2135
+ }), ao = async () => {
2136
+ Re.debug("sending GET for utilities");
2137
+ try {
2138
+ const e = await Ie({
2139
+ urlOverride: `${ge}/api/kos/descriptor/app:kosdev.ddk:ncuiDescriptor/kondra.ncui.utilities`
2140
+ });
2141
+ if ((e == null ? void 0 : e.status) !== 200) {
2142
+ Re.info("no extensions found, using base data");
2143
+ const t = await Ie({
2144
+ urlOverride: `${ge}/api/kos/descriptor/system:app/kondra.ncui.utilities`
2145
+ });
2146
+ return (t == null ? void 0 : t.data) ?? [];
2147
+ }
2148
+ return (e == null ? void 0 : e.data) ?? [];
2149
+ } catch (e) {
2150
+ Re.info(`error fetching utilities: ${e}. Using base data`);
2151
+ const t = await Ie({
2152
+ urlOverride: `${ge}/api/kos/descriptor/system:app/kondra.ncui.utilities`
2153
+ });
2154
+ return (t == null ? void 0 : t.data) ?? [];
2155
+ }
2156
+ }, pi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2342
2157
  __proto__: null,
2343
- getUtilities: Or
2158
+ getUtilities: ao
2344
2159
  }, Symbol.toStringTag, { value: "Module" }));
2345
- var ds = Object.defineProperty, ps = Object.getOwnPropertyDescriptor, Mr = (e, t, r, i) => {
2346
- for (var o = i > 1 ? void 0 : i ? ps(t, r) : t, n = e.length - 1, a; n >= 0; n--)
2347
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
2348
- return i && o && ds(t, r, o), o;
2160
+ var Ls = Object.defineProperty, Ds = Object.getOwnPropertyDescriptor, lo = (e, t, o, s) => {
2161
+ for (var r = s > 1 ? void 0 : s ? Ds(t, o) : t, n = e.length - 1, a; n >= 0; n--)
2162
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
2163
+ return s && r && Ls(t, o, r), r;
2349
2164
  };
2350
- const ce = "utilities-container-model";
2351
- let Me = class {
2352
- constructor(e, t, r) {
2353
- s(this, "id");
2354
- s(this, "logger");
2355
- s(this, "_models");
2356
- this.id = e, this.logger = r.logger, this._models = new tt({
2165
+ const oe = "utilities-container-model";
2166
+ let be = class {
2167
+ constructor(e, t, o) {
2168
+ i(this, "id");
2169
+ i(this, "logger");
2170
+ i(this, "_models");
2171
+ this.id = e, this.logger = o.logger, this._models = new Ve({
2357
2172
  parentId: e,
2358
2173
  sortKey: "id",
2359
2174
  indexMap: {
@@ -2385,142 +2200,223 @@ let Me = class {
2385
2200
  // -------------------LIFECYCLE----------------------------
2386
2201
  async load() {
2387
2202
  this.logger.debug(`loading utilities-container container ${this.id}`);
2388
- const e = await Or();
2389
- e == null || e.forEach((t, r) => {
2390
- t.forEach((i) => {
2391
- const o = {
2392
- ...i,
2393
- columnId: String(r)
2394
- }, n = Tr.factory(i.name)(
2395
- o
2203
+ const e = await ao();
2204
+ e == null || e.forEach((t, o) => {
2205
+ t.forEach((s) => {
2206
+ const r = {
2207
+ ...s,
2208
+ columnId: String(o)
2209
+ }, n = no.factory(s.name)(
2210
+ r
2396
2211
  );
2397
2212
  this.addModel(n);
2398
2213
  });
2399
2214
  });
2400
2215
  }
2401
2216
  };
2402
- Mr([
2403
- Le
2404
- ], Me.prototype, "_models", 2);
2405
- Me = Mr([
2406
- l(ce)
2407
- ], Me);
2408
- const gs = {
2217
+ lo([
2218
+ $e
2219
+ ], be.prototype, "_models", 2);
2220
+ be = lo([
2221
+ l(oe)
2222
+ ], be);
2223
+ const ks = {
2409
2224
  registration: {
2410
- [ce]: {
2411
- class: Me,
2225
+ [oe]: {
2226
+ class: be,
2412
2227
  singleton: !0
2413
2228
  },
2414
- ...Tr.registration
2229
+ ...no.registration
2415
2230
  },
2416
- type: ce,
2417
- predicate: u(ce),
2418
- factory: c.Singleton.create(ce)
2419
- }, Xs = {
2420
- ...wo.registration,
2421
- ...nt.registration,
2422
- ...st.registration,
2423
- ...Uo.registration,
2424
- ...lt.registration,
2425
- ...Xo.registration,
2426
- ...ii.registration,
2427
- ...di.registration,
2428
- ...$i.registration,
2429
- ...xi.registration,
2430
- ...Ni.registration,
2431
- ...Ki.registration,
2432
- ...Gi.registration,
2433
- ...es.registration,
2231
+ type: oe,
2232
+ predicate: u(oe),
2233
+ factory: c.Singleton.create(oe)
2234
+ }, gi = {
2235
+ ...sr.registration,
2236
+ ...Ze.registration,
2237
+ ...Qe.registration,
2238
+ ...ur.registration,
2239
+ ...et.registration,
2240
+ ...Pr.registration,
2241
+ ...Lr.registration,
2242
+ ...xr.registration,
2243
+ ...Yr.registration,
2434
2244
  ...os.registration,
2435
- ...It.registration,
2436
- ...gs.registration
2437
- };
2438
- var hs = Object.defineProperty, fs = Object.getOwnPropertyDescriptor, Sr = (e, t, r, i) => {
2439
- for (var o = i > 1 ? void 0 : i ? fs(t, r) : t, n = e.length - 1, a; n >= 0; n--)
2440
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
2441
- return i && o && hs(t, r, o), o;
2442
- };
2443
- const Cr = "trouble-action-model";
2444
- let Se = class {
2445
- constructor(e, t, r) {
2446
- s(this, "id");
2447
- s(this, "logger");
2448
- s(this, "troubleContainer");
2449
- s(this, "disposer");
2450
- s(this, "state");
2451
- s(this, "troubleActionData");
2452
- this.id = e, this.logger = r.logger, this.state = Qr(), this.troubleActionData = t.definitions.reduce((i, o) => (i[o.troubleType] = o, i), {});
2245
+ ...ds.registration,
2246
+ ...gs.registration,
2247
+ ...fs.registration,
2248
+ ...Ts.registration,
2249
+ ...Ms.registration,
2250
+ ...Et.registration,
2251
+ ...ks.registration
2252
+ };
2253
+ var co = Object.defineProperty, Is = Object.getOwnPropertyDescriptor, Rs = (e, t, o) => t in e ? co(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, st = (e, t, o, s) => {
2254
+ for (var r = s > 1 ? void 0 : s ? Is(t, o) : t, n = e.length - 1, a; n >= 0; n--)
2255
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
2256
+ return s && r && co(t, o, r), r;
2257
+ }, As = (e, t, o) => (Rs(e, t + "", o), o);
2258
+ const Fs = "trouble-action-model";
2259
+ let k = class {
2260
+ /**
2261
+ * Creates a new TroubleActionModel instance.
2262
+ *
2263
+ * Initializes the model with trouble action definitions that map trouble
2264
+ * types to state key-value pairs. The model begins monitoring the trouble
2265
+ * container immediately upon creation.
2266
+ *
2267
+ * @param modelId - Unique identifier for this model instance
2268
+ * @param options - Configuration options containing trouble action definitions
2269
+ * @param context - KOS creation context providing logger and framework services
2270
+ *
2271
+ * @category Lifecycle
2272
+ */
2273
+ constructor(e, t) {
2274
+ /**
2275
+ * Unique identifier for this model instance.
2276
+ *
2277
+ * Set during construction and used for model lifecycle management
2278
+ * and debugging purposes.
2279
+ *
2280
+ * @category Model Properties
2281
+ */
2282
+ i(this, "id");
2283
+ i(this, "troubleContainer");
2284
+ /**
2285
+ * Observable state object mapping trouble state keys to values.
2286
+ *
2287
+ * This reactive state object is automatically updated when troubles are
2288
+ * added or removed from the system. Keys and values are determined by
2289
+ * the trouble action definitions provided during model initialization.
2290
+ *
2291
+ * State keys that no longer have associated active troubles are set to
2292
+ * undefined.
2293
+ *
2294
+ * @example
2295
+ * ```typescript
2296
+ * // Access state values
2297
+ * const isAgitationRequired = troubleActionModel.state.agitationRequired;
2298
+ *
2299
+ * // State is reactive - updates automatically propagate to React components
2300
+ * ```
2301
+ *
2302
+ * @category Model State
2303
+ */
2304
+ i(this, "state");
2305
+ /**
2306
+ * Internal mapping of trouble types to their action definitions.
2307
+ *
2308
+ * Built from the definitions array provided in TroubleActionOptions during
2309
+ * construction. Used for efficient lookup when processing trouble changes.
2310
+ *
2311
+ * @category Internal State
2312
+ */
2313
+ i(this, "troubleActionData");
2314
+ this.id = e, this.state = Eo(), this.troubleActionData = t.definitions.reduce((o, s) => (o[s.troubleType] = s, o), {});
2453
2315
  }
2454
2316
  // -------------------LIFECYCLE----------------------------
2317
+ /**
2318
+ * Gets the first active trouble that has an associated action definition.
2319
+ *
2320
+ * Returns the first trouble found that matches any of the configured trouble
2321
+ * action definitions. If multiple troubles are active, priority is determined
2322
+ * by the order of trouble type keys in the troubleActionData object.
2323
+ *
2324
+ * @returns The active trouble model, or undefined if no matching troubles exist
2325
+ *
2326
+ * @example
2327
+ * ```typescript
2328
+ * const trouble = troubleActionModel.activeTrouble;
2329
+ * if (trouble) {
2330
+ * console.log(`Active trouble: ${trouble.type}`);
2331
+ * console.log(`Resolvable: ${trouble.resolvable}`);
2332
+ * }
2333
+ * ```
2334
+ *
2335
+ * @category Trouble Access
2336
+ * @see {@link TroubleContainerModel} for trouble data structure
2337
+ */
2455
2338
  get activeTrouble() {
2456
2339
  const e = Object.keys(this.troubleActionData);
2457
2340
  if (e.length > 0) {
2458
- const t = e[0], r = this.troubleContainer.troubles.getIndexByKey(
2341
+ const t = e[0], o = this.troubleContainer.troubles.getIndexByKey(
2459
2342
  "byType",
2460
2343
  t
2461
2344
  );
2462
- return r.length > 0 ? r[0] : void 0;
2345
+ return o.length > 0 ? o[0] : void 0;
2463
2346
  }
2464
2347
  }
2348
+ /**
2349
+ * Gets the type of the first active trouble with an associated action definition.
2350
+ *
2351
+ * Convenience getter that extracts the trouble type from the active trouble.
2352
+ * Commonly used for conditional UI rendering based on trouble type.
2353
+ *
2354
+ * @returns The active trouble type string, or undefined if no troubles are active
2355
+ *
2356
+ * @example
2357
+ * ```typescript
2358
+ * const troubleType = troubleActionModel.activeTroubleType;
2359
+ * if (troubleType === 'InsufficientAgitationTrouble') {
2360
+ * // Show agitation required UI
2361
+ * }
2362
+ * ```
2363
+ *
2364
+ * @category Trouble Access
2365
+ */
2465
2366
  get activeTroubleType() {
2466
2367
  var e;
2467
2368
  return (e = this.activeTrouble) == null ? void 0 : e.type;
2468
2369
  }
2469
- async init() {
2470
- this.logger.debug(`initializing trouble-action ${this.id}`), this.disposer = Xr(() => {
2471
- const e = this.troubleContainer.troubles.data.reduce((t, r) => {
2472
- const i = r.type;
2473
- if (this.troubleActionData[i]) {
2474
- const o = this.troubleActionData[i].stateKey ?? i, n = this.troubleActionData[i].stateValue ?? i;
2475
- t[o] = n;
2476
- }
2477
- return t;
2478
- }, {});
2479
- this.state.setValues(e), Object.keys(this.troubleActionData).forEach((t) => {
2480
- if (this.troubleContainer.troubles.getIndexByKey("byType", t).length === 0) {
2481
- const r = this.troubleActionData[t].stateKey ?? t;
2482
- this.state[r] = void 0;
2483
- }
2484
- });
2370
+ handleTroubleActions() {
2371
+ const e = this.troubleContainer.troubles.data.reduce((t, o) => {
2372
+ const s = o.type;
2373
+ if (this.troubleActionData[s]) {
2374
+ const r = this.troubleActionData[s].stateKey ?? s, n = this.troubleActionData[s].stateValue ?? s;
2375
+ t[r] = n;
2376
+ }
2377
+ return t;
2378
+ }, {});
2379
+ this.state.setValues(e), Object.keys(this.troubleActionData).forEach((t) => {
2380
+ if (this.troubleContainer.troubles.getIndexByKey("byType", t).length === 0) {
2381
+ const o = this.troubleActionData[t].stateKey ?? t;
2382
+ this.state[o] = void 0;
2383
+ }
2485
2384
  });
2486
2385
  }
2487
- unload() {
2488
- var e;
2489
- (e = this.disposer) == null || e.call(this);
2490
- }
2491
- async load() {
2492
- this.logger.debug(`loading trouble-action ${this.id}`);
2493
- }
2494
2386
  };
2495
- Sr([
2496
- m({ modelType: ot.type })
2497
- ], Se.prototype, "troubleContainer", 2);
2498
- Se = Sr([
2499
- l(Cr)
2500
- ], Se);
2501
- const Js = new ke({
2502
- class: Se,
2503
- type: Cr
2504
- }), { URL: wr } = h("START_SERVICE"), { getOne: ms } = f.build({
2505
- basePath: `${wr}/api/start`
2506
- }), ys = g.createLogger({ name: "start-service", group: "Services" }), Er = async () => (ys.debug("navigating to NCUI"), await ms({
2507
- urlOverride: `${wr}/api/app/kosdev.ddk/ncui/open`
2508
- })), Zs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2387
+ As(k, "Registration");
2388
+ st([
2389
+ p({ modelType: Ye.type })
2390
+ ], k.prototype, "troubleContainer", 2);
2391
+ st([
2392
+ Pe({
2393
+ dependencies: (e) => [e.troubleContainer.troubles.data]
2394
+ })
2395
+ ], k.prototype, "handleTroubleActions", 1);
2396
+ k = st([
2397
+ l({ modelTypeId: Fs, singleton: !0 }),
2398
+ Ke()
2399
+ ], k);
2400
+ const hi = k.Registration, { URL: uo } = h("START_SERVICE"), { getOne: xs } = y.build({
2401
+ basePath: `${uo}/api/start`
2402
+ }), Us = g.createLogger({ name: "start-service", group: "Services" }), po = async () => (Us.debug("navigating to NCUI"), await xs({
2403
+ urlOverride: `${uo}/api/app/kosdev.ddk/ncui/open`
2404
+ })), yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2509
2405
  __proto__: null,
2510
- navigateToNCui: Er
2406
+ navigateToNCui: po
2511
2407
  }, Symbol.toStringTag, { value: "Module" }));
2512
- var bs = Object.defineProperty, vs = Object.getOwnPropertyDescriptor, Lr = (e, t, r, i) => {
2513
- for (var o = i > 1 ? void 0 : i ? vs(t, r) : t, n = e.length - 1, a; n >= 0; n--)
2514
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
2515
- return i && o && bs(t, r, o), o;
2408
+ var js = Object.defineProperty, Ws = Object.getOwnPropertyDescriptor, go = (e, t, o, s) => {
2409
+ for (var r = s > 1 ? void 0 : s ? Ws(t, o) : t, n = e.length - 1, a; n >= 0; n--)
2410
+ (a = e[n]) && (r = (s ? a(t, o, r) : a(r)) || r);
2411
+ return s && r && js(t, o, r), r;
2516
2412
  };
2517
- const Dr = "start-model";
2518
- let Ce = class {
2519
- constructor(e, t, r) {
2520
- s(this, "id");
2521
- s(this, "logger");
2522
- s(this, "troubles");
2523
- this.id = e, this.logger = r.logger;
2413
+ const ho = "start-model";
2414
+ let _e = class {
2415
+ constructor(e, t, o) {
2416
+ i(this, "id");
2417
+ i(this, "logger");
2418
+ i(this, "troubles");
2419
+ this.id = e, this.logger = o.logger;
2524
2420
  }
2525
2421
  get firmwareFailed() {
2526
2422
  return this.troubles.troubles.getIndexByKey(
@@ -2535,7 +2431,7 @@ let Ce = class {
2535
2431
  ).length > 0;
2536
2432
  }
2537
2433
  async navigate() {
2538
- await Er();
2434
+ await po();
2539
2435
  }
2540
2436
  // -------------------LIFECYCLE----------------------------
2541
2437
  async init() {
@@ -2545,261 +2441,69 @@ let Ce = class {
2545
2441
  this.logger.debug(`loading start ${this.id}`);
2546
2442
  }
2547
2443
  };
2548
- Lr([
2549
- m({ modelType: ot.type })
2550
- ], Ce.prototype, "troubles", 2);
2551
- Ce = Lr([
2552
- l(Dr)
2553
- ], Ce);
2554
- const ea = new ke({
2555
- class: Ce,
2556
- type: Dr
2557
- }), { URL: me } = h("SPM-PUMP_SERVICE"), { postModel: Ne } = f.build({
2558
- basePath: `${me}/api/spm-pump`
2559
- }), $ = g.createLogger({
2560
- name: "spm-pump-service",
2561
- group: "Services"
2562
- }), kr = async (e, t) => {
2563
- $.debug(
2564
- `performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`
2565
- );
2566
- try {
2567
- const r = await Ne({
2568
- model: {},
2569
- urlOverride: `${me}/api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`,
2570
- tracker: t
2571
- });
2572
- return $.debug("performPreCalibrate - response:", r), r != null && r.data && T.initiateFuture(r.data), r == null ? void 0 : r.data;
2573
- } catch (r) {
2574
- $.error(
2575
- `performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`,
2576
- r
2577
- );
2578
- const i = {
2579
- id: t || "",
2580
- endState: b.Fail,
2581
- tracker: t,
2582
- reason: "Failed to resolve trouble"
2583
- };
2584
- return T.initiateFuture(i), i;
2585
- }
2586
- }, Rr = async (e, t) => {
2587
- $.debug(
2588
- `performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/calibrate`
2589
- );
2590
- try {
2591
- const r = await Ne({
2592
- model: {},
2593
- urlOverride: `${me}/api/ext/freestyle/microCalibration/pour/${e}/calibrate`,
2594
- tracker: t
2595
- });
2596
- return $.debug("performCalibrate - response:", r), r != null && r.data && T.initiateFuture(r.data), r == null ? void 0 : r.data;
2597
- } catch (r) {
2598
- $.error(
2599
- `performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/calibrate`,
2600
- r
2601
- );
2602
- const i = {
2603
- id: t || "",
2604
- endState: b.Fail,
2605
- tracker: t,
2606
- reason: "Failed to resolve trouble"
2607
- };
2608
- return T.initiateFuture(i), i;
2609
- }
2610
- }, Ir = async (e, t, r, i) => {
2611
- $.debug(
2612
- `performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/verify`
2613
- );
2614
- try {
2615
- const o = await Ne({
2616
- model: {
2617
- ...r,
2618
- // commandedCalibrationVolume: 0,
2619
- measuredCalibrationVolume: t
2620
- // measuredVerificationVolume: 0,
2621
- // newCalibrationValue: 0,
2622
- // pouredCalibrationVolume: 0,
2623
- },
2624
- urlOverride: `${me}/api/ext/freestyle/microCalibration/pour/${e}/verify`,
2625
- tracker: i
2626
- });
2627
- return $.debug("performVerify - response:", o), o != null && o.data && T.initiateFuture(o.data), o == null ? void 0 : o.data;
2628
- } catch (o) {
2629
- $.error(
2630
- `performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/verify`,
2631
- o
2632
- );
2633
- const n = {
2634
- id: i || "",
2635
- endState: b.Fail,
2636
- tracker: i,
2637
- reason: "Failed to resolve trouble"
2638
- };
2639
- return T.initiateFuture(n), n;
2640
- }
2641
- }, Fr = async (e, t, r, i) => {
2642
- var o, n, a, O, D;
2643
- $.debug(
2644
- `performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/complete`
2645
- );
2646
- try {
2647
- const p = await Ne({
2648
- model: {
2649
- ...i,
2650
- // commandedCalibrationVolume: 0,
2651
- measuredCalibrationVolume: t,
2652
- measuredVerificationVolume: r
2653
- // newCalibrationValue: 0,
2654
- // pouredCalibrationVolume: 0,
2655
- },
2656
- urlOverride: `${me}/api/ext/freestyle/microCalibration/pour/${e}/complete`
2657
- });
2658
- return $.debug("performComplete - response:", p), ((p == null ? void 0 : p.status) === 200 || (p == null ? void 0 : p.status) === 499) && ((o = p.data) != null && o.error) ? [p.data.error || "unknownError", p.data] : [void 0, p == null ? void 0 : p.data];
2659
- } catch (p) {
2660
- if ($.error(
2661
- `performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/complete`,
2662
- p
2663
- ), p instanceof Re) {
2664
- const dt = ((a = (n = p.payload) == null ? void 0 : n.data) == null ? void 0 : a.error) || ((O = p.payload) == null ? void 0 : O.error) || "unknownError";
2665
- return [dt, ((D = p.payload) == null ? void 0 : D.data) || { error: dt }];
2666
- }
2667
- }
2668
- return ["unknownError", { error: "unknownError" }];
2669
- }, ta = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2670
- __proto__: null,
2671
- performCalibrate: Rr,
2672
- performComplete: Fr,
2673
- performPreCalibrate: kr,
2674
- performVerify: Ir
2675
- }, Symbol.toStringTag, { value: "Module" }));
2676
- var _s = Object.defineProperty, $s = Object.getOwnPropertyDescriptor, ze = (e, t, r, i) => {
2677
- for (var o = i > 1 ? void 0 : i ? $s(t, r) : t, n = e.length - 1, a; n >= 0; n--)
2678
- (a = e[n]) && (o = (i ? a(t, r, o) : a(o)) || o);
2679
- return i && o && _s(t, r, o), o;
2680
- };
2681
- const xr = "spm-pump-model";
2682
- let j = class {
2683
- constructor(e, t, r) {
2684
- s(this, "id");
2685
- s(this, "logger");
2686
- s(this, "pump");
2687
- s(this, "futureHandler");
2688
- this.id = e, this.logger = r.logger, this.pump = t.companionParent, this.futureHandler = new pe(this);
2689
- }
2690
- get name() {
2691
- return this.pump.name;
2692
- }
2693
- get canPour() {
2694
- return this.pump.canPour;
2695
- }
2696
- get isPouring() {
2697
- return this.pump.isPouring;
2698
- }
2699
- async cancelPour() {
2700
- return this.pump.cancelPour();
2701
- }
2702
- performIntent(e) {
2703
- return this.pump.performIntent(e);
2704
- }
2705
- get future() {
2706
- return this.futureHandler.future;
2707
- }
2708
- async performPreCalibrate(e) {
2709
- return kr(this.pump.path, e);
2710
- }
2711
- async performCalibrate(e) {
2712
- return Rr(this.pump.path, e);
2713
- }
2714
- async performVerify(e, t, r) {
2715
- return Ir(this.pump.path, e, t, r);
2716
- }
2717
- async performComplete(e, t, r) {
2718
- return Fr(this.pump.path, e, t, r);
2719
- }
2720
- // -------------------LIFECYCLE----------------------------
2721
- async init() {
2722
- this.logger.debug(`initializing spm-pump ${this.id}`);
2723
- }
2724
- async load() {
2725
- this.logger.debug(`loading spm-pump ${this.id}`);
2726
- }
2727
- };
2728
- ze([
2729
- v()
2730
- ], j.prototype, "performPreCalibrate", 1);
2731
- ze([
2732
- v()
2733
- ], j.prototype, "performCalibrate", 1);
2734
- ze([
2735
- v()
2736
- ], j.prototype, "performVerify", 1);
2737
- j = ze([
2738
- l(xr)
2739
- ], j);
2740
- const ra = new Ee({
2741
- class: j,
2742
- type: xr
2444
+ go([
2445
+ p({ modelType: Ye.type })
2446
+ ], _e.prototype, "troubles", 2);
2447
+ _e = go([
2448
+ l(ho)
2449
+ ], _e);
2450
+ const fi = new He({
2451
+ class: _e,
2452
+ type: ho
2743
2453
  });
2744
2454
  export {
2745
- ws as AgitationControl,
2746
- wo as Animation,
2747
- Es as AnimationServices,
2748
- nt as Application,
2749
- st as Auth,
2750
- Ss as AuthServices,
2751
- Uo as CarbWater,
2752
- ks as CopyLogs,
2753
- Ds as CopyLogsServices,
2754
- Xs as DDKModels,
2755
- lt as DashboardOperations,
2756
- Rs as DashboardOperationsServices,
2757
- Xo as Dispenser,
2758
- ii as DispenserInfo,
2759
- Fs as DispenserInfoServices,
2760
- Is as DispenserServices,
2761
- co as Door,
2762
- ue as EXTENSION_POINT_DASHBOARD_KEY_FACTORY,
2763
- di as Enrollment,
2764
- xs as EnrollmentServices,
2765
- Kt as FcmPump,
2766
- Ls as FcmPumpServices,
2767
- $i as IngredientSummary,
2768
- Ns as LfcvPump,
2769
- zs as LfcvPumpServices,
2770
- Ks as Lockout,
2771
- Bs as LockoutServices,
2772
- Vs as MACRO_KEYS,
2773
- xi as MacroAssignment,
2774
- dr as NetworkTest,
2775
- Ni as NetworkTestContainer,
2776
- Ys as NetworkTestServices,
2777
- Ki as NutritiveSweetener,
2778
- Gi as PlainWater,
2779
- es as Reboot,
2780
- qs as RebootServices,
2781
- os as Settings,
2782
- Gs as SettingsServices,
2783
- Rt as SetupStep,
2784
- It as SetupStepContainer,
2785
- Cs as SetupStepServices,
2786
- ra as SpmPump,
2787
- ta as SpmPumpServices,
2788
- ea as Start,
2789
- Zs as StartServices,
2790
- to as TROUBLE_TYPE_PRIME,
2791
- ht as TROUBLE_TYPE_PURGE,
2792
- Js as TroubleActionManager,
2793
- Tr as Utilities,
2794
- gs as UtilitiesContainer,
2795
- Qs as UtilitiesServices,
2796
- bi as calculateTimeDifference,
2797
- yi as executeDashboardKeyFactory,
2798
- js as isMacroGroup,
2799
- As as isMicroGroup,
2800
- Us as macroHolderMap,
2801
- mi as registerDashboardKeyFactory,
2802
- Ws as toSeconds,
2803
- Hs as toTimeComponents,
2804
- jt as troubleVisibilityFilter
2455
+ Ys as AgitationControl,
2456
+ sr as Animation,
2457
+ Gs as AnimationServices,
2458
+ Ze as Application,
2459
+ Qe as Auth,
2460
+ Bs as AuthServices,
2461
+ ur as CarbWater,
2462
+ Qs as CopyLogs,
2463
+ qs as CopyLogsServices,
2464
+ gi as DDKModels,
2465
+ et as DashboardOperations,
2466
+ Xs as DashboardOperationsServices,
2467
+ Pr as Dispenser,
2468
+ Lr as DispenserInfo,
2469
+ Zs as DispenserInfoServices,
2470
+ Js as DispenserServices,
2471
+ Wo as Door,
2472
+ ie as EXTENSION_POINT_DASHBOARD_KEY_FACTORY,
2473
+ xr as Enrollment,
2474
+ ei as EnrollmentServices,
2475
+ Yr as IngredientSummary,
2476
+ li as Lockout,
2477
+ ai as LockoutServices,
2478
+ si as MACRO_KEYS,
2479
+ os as MacroAssignment,
2480
+ Qt as NetworkTest,
2481
+ ds as NetworkTestContainer,
2482
+ di as NetworkTestServices,
2483
+ gs as NutritiveSweetener,
2484
+ fs as PlainWater,
2485
+ Ts as Reboot,
2486
+ ci as RebootServices,
2487
+ Ms as Settings,
2488
+ ui as SettingsServices,
2489
+ wt as SetupStep,
2490
+ Et as SetupStepContainer,
2491
+ Ks as SetupStepServices,
2492
+ fi as Start,
2493
+ yi as StartServices,
2494
+ ko as TROUBLE_TYPE_PRIME,
2495
+ at as TROUBLE_TYPE_PURGE,
2496
+ hi as TroubleActionManager,
2497
+ no as Utilities,
2498
+ ks as UtilitiesContainer,
2499
+ pi as UtilitiesServices,
2500
+ Hr as calculateTimeDifference,
2501
+ Vr as executeDashboardKeyFactory,
2502
+ oi as isMacroGroup,
2503
+ ti as isMicroGroup,
2504
+ ri as macroHolderMap,
2505
+ zr as registerDashboardKeyFactory,
2506
+ ni as toSeconds,
2507
+ ii as toTimeComponents,
2508
+ Dt as troubleVisibilityFilter
2805
2509
  };