@kosdev-code/kos-freestyle-sdk 2.0.8 → 2.0.9

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 (22) hide show
  1. package/{extension-utils-uYGl3TGm.js → extension-utils-DFxANOxc.js} +2 -2
  2. package/{extension-utils-uYGl3TGm.js.map → extension-utils-DFxANOxc.js.map} +1 -1
  3. package/{extension-utils-D_CXSnlW.cjs → extension-utils-DLH4Qofz.cjs} +2 -2
  4. package/{extension-utils-D_CXSnlW.cjs.map → extension-utils-DLH4Qofz.cjs.map} +1 -1
  5. package/freestyle-registration-manager-B46wED9t.cjs +2 -0
  6. package/{freestyle-registration-manager-yxRMbjlE.cjs.map → freestyle-registration-manager-B46wED9t.cjs.map} +1 -1
  7. package/{freestyle-registration-manager-pbtzJUqS.js → freestyle-registration-manager-DkqzBO2O.js} +230 -214
  8. package/{freestyle-registration-manager-pbtzJUqS.js.map → freestyle-registration-manager-DkqzBO2O.js.map} +1 -1
  9. package/index.cjs +1 -1
  10. package/index.js +3 -3
  11. package/models/models/agitation-required-trouble/agitation-required-trouble-model.d.ts +3 -1
  12. package/models/models/agitation-required-trouble/agitation-required-trouble-model.d.ts.map +1 -1
  13. package/models.cjs +1 -1
  14. package/models.js +2 -2
  15. package/package.json +4 -4
  16. package/ui.cjs +1 -1
  17. package/ui.js +2 -2
  18. package/{use-nutrition-info-D-wbfIlj.js → use-nutrition-info-BQrtsdMz.js} +2 -2
  19. package/{use-nutrition-info-D-wbfIlj.js.map → use-nutrition-info-BQrtsdMz.js.map} +1 -1
  20. package/{use-nutrition-info-CGrmEGIR.cjs → use-nutrition-info-ho4aniKd.cjs} +2 -2
  21. package/{use-nutrition-info-CGrmEGIR.cjs.map → use-nutrition-info-ho4aniKd.cjs.map} +1 -1
  22. package/freestyle-registration-manager-yxRMbjlE.cjs +0 -2
@@ -1,14 +1,14 @@
1
- var pe = Object.defineProperty;
2
- var he = (e, t, r) => t in e ? pe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var i = (e, t, r) => (he(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import { KosModelRegistry as ye, registerDispenseModels as fe, Nozzle as me, Assembly as be, Pump as _e, Holder as ve, PumpContainer as Pe, PumpIndex as Ae } from "@kosdev-code/kos-dispense-sdk";
5
- import { kosModel as f, KosModelRegistrationFactory as m, KosModelContainer as Ie, kosChild as $e, resolveServiceUrl as E, ServiceFactory as M, createPropKey as Oe, kosStateProp as Ee, kosFuture as Me, FutureHandler as Ce, kosEffect as Te, EventBus as K, SingletonKosModelRegistrationFactory as W, KosFeatureFlags as U, KosContextManager as we, KosLog as C, FutureManager as ze, kosParentAware as De, kosAutoEffect as Se, kosAction as Z, FetchError as Re, kosConfigProperty as p, KOS_MODEL_ID as y, getKosModelSync as A, RegistrationManager as g, registerCoreModels as Fe, Trouble as je, ExtensionManager as w, EXTENSION_TROUBLE_DATA_MAPPER as z } from "@kosdev-code/kos-ui-sdk";
6
- var Le = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor, Be = (e, t, r, o) => {
7
- for (var s = o > 1 ? void 0 : o ? Ne(t, r) : t, a = e.length - 1, n; a >= 0; a--)
1
+ var he = Object.defineProperty;
2
+ var ye = (e, t, r) => t in e ? he(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var i = (e, t, r) => (ye(e, typeof t != "symbol" ? t + "" : t, r), r);
4
+ import { Assembly as Z, KosModelRegistry as fe, registerDispenseModels as me, Nozzle as be, Pump as _e, Holder as ve, PumpContainer as Pe, PumpIndex as Ie } from "@kosdev-code/kos-dispense-sdk";
5
+ import { kosModel as f, KosModelRegistrationFactory as m, KosModelContainer as Ae, kosChild as $e, resolveServiceUrl as E, ServiceFactory as M, createPropKey as Oe, kosStateProp as Ee, kosFuture as Me, FutureHandler as Te, kosEffect as Ce, EventBus as K, SingletonKosModelRegistrationFactory as Q, KosFeatureFlags as U, KosContextManager as we, KosLog as T, FutureManager as ze, kosParentAware as De, kosAutoEffect as Se, kosAction as X, FetchError as Re, kosConfigProperty as p, KOS_MODEL_ID as y, kosTopicHandler as Fe, modelTypeEventTopicFactory as Le, DependencyLifecycle as je, getKosModelSync as _, RegistrationManager as d, registerCoreModels as Ne, Trouble as Be, ExtensionManager as w, EXTENSION_TROUBLE_DATA_MAPPER as z } from "@kosdev-code/kos-ui-sdk";
6
+ var xe = Object.defineProperty, He = Object.getOwnPropertyDescriptor, Ge = (e, t, r, o) => {
7
+ for (var s = o > 1 ? void 0 : o ? He(t, r) : t, a = e.length - 1, n; a >= 0; a--)
8
8
  (n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
9
- return o && s && Le(t, r, s), s;
9
+ return o && s && xe(t, r, s), s;
10
10
  };
11
- const Q = "carb-agitator-model";
11
+ const J = "carb-agitator-model";
12
12
  let S = class {
13
13
  constructor(e, t, r) {
14
14
  i(this, "id");
@@ -25,25 +25,25 @@ let S = class {
25
25
  this.logger.debug(`loading carb-agitator ${this.id}`);
26
26
  }
27
27
  };
28
- S = Be([
29
- f(Q)
28
+ S = Ge([
29
+ f(J)
30
30
  ], S);
31
- const X = new m({
31
+ const k = new m({
32
32
  class: S,
33
- type: Q
33
+ type: J
34
34
  });
35
- var xe = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, J = (e, t, r, o) => {
36
- for (var s = o > 1 ? void 0 : o ? Ge(t, r) : t, a = e.length - 1, n; a >= 0; a--)
35
+ var Ke = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, ee = (e, t, r, o) => {
36
+ for (var s = o > 1 ? void 0 : o ? Ue(t, r) : t, a = e.length - 1, n; a >= 0; a--)
37
37
  (n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
38
- return o && s && xe(t, r, s), s;
38
+ return o && s && Ke(t, r, s), s;
39
39
  };
40
- const k = "cartridge-agitator-container-model";
41
- let I = class {
40
+ const te = "cartridge-agitator-container-model";
41
+ let $ = class {
42
42
  constructor(e, t, r) {
43
43
  i(this, "id");
44
44
  i(this, "logger");
45
45
  i(this, "_models");
46
- this.id = e, this.logger = r.logger, this._models = new Ie({
46
+ this.id = e, this.logger = r.logger, this._models = new Ae({
47
47
  parentId: e
48
48
  });
49
49
  }
@@ -74,35 +74,35 @@ let I = class {
74
74
  );
75
75
  }
76
76
  };
77
- J([
77
+ ee([
78
78
  $e
79
- ], I.prototype, "_models", 2);
80
- I = J([
81
- f(k)
82
- ], I);
83
- const { URL: ee } = E("CARTRIDGE_AGITATOR_SERVICE"), { postModel: Ke } = M.build({
84
- basePath: `${ee}/api/ext/freestyle/freestyle/ice`
85
- }), Ue = async (e, t) => {
86
- const r = await Ke({
79
+ ], $.prototype, "_models", 2);
80
+ $ = ee([
81
+ f(te)
82
+ ], $);
83
+ const { URL: re } = E("CARTRIDGE_AGITATOR_SERVICE"), { postModel: qe } = M.build({
84
+ basePath: `${re}/api/ext/freestyle/freestyle/ice`
85
+ }), Ye = async (e, t) => {
86
+ const r = await qe({
87
87
  model: {},
88
88
  tracker: t,
89
- urlOverride: `${ee}/api/handle/${e}/test`
89
+ urlOverride: `${re}/api/handle/${e}/test`
90
90
  });
91
91
  if (!(r != null && r.data))
92
92
  throw new Error("No response from server");
93
93
  return r.data;
94
94
  };
95
- var He = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, B = (e, t, r, o) => {
96
- for (var s = o > 1 ? void 0 : o ? qe(t, r) : t, a = e.length - 1, n; a >= 0; a--)
95
+ var Ve = Object.defineProperty, We = Object.getOwnPropertyDescriptor, B = (e, t, r, o) => {
96
+ for (var s = o > 1 ? void 0 : o ? We(t, r) : t, a = e.length - 1, n; a >= 0; a--)
97
97
  (n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
98
- return o && s && He(t, r, s), s;
98
+ return o && s && Ve(t, r, s), s;
99
99
  };
100
- const te = "cartridge-agitator-model";
101
- class $ {
100
+ const se = "cartridge-agitator-model";
101
+ class O {
102
102
  }
103
- i($, "TOPIC_AGITATION_STARTED", "/kos/events/ddk/agitation-started"), i($, "TOPIC_AGITATION_ENDED", "/kos/events/ddk/agitation-ended");
104
- const Ye = Oe("statePath");
105
- let _ = class {
103
+ i(O, "TOPIC_AGITATION_STARTED", "/kos/events/ddk/agitation-started"), i(O, "TOPIC_AGITATION_ENDED", "/kos/events/ddk/agitation-ended");
104
+ const Ze = Oe("statePath");
105
+ let v = class {
106
106
  constructor(e, t, r) {
107
107
  i(this, "id");
108
108
  i(this, "futureHandler");
@@ -112,7 +112,7 @@ let _ = class {
112
112
  i(this, "path");
113
113
  i(this, "statePath");
114
114
  i(this, "name");
115
- this.id = e, this.logger = r.logger, this.futureHandler = new Ce(this), this.path = t.path, this.name = t.name, this.statePath = t.statePath;
115
+ this.id = e, this.logger = r.logger, this.futureHandler = new Te(this), this.path = t.path, this.name = t.name, this.statePath = t.statePath;
116
116
  }
117
117
  get isAgitating() {
118
118
  return !!this.agitating.value;
@@ -123,7 +123,7 @@ let _ = class {
123
123
  async testAgitate(e) {
124
124
  if (!e)
125
125
  throw new Error("No tracker provided");
126
- return this.logger.info(`agitating cartridge-agitator ${this.id}`), Ue(this.path, e);
126
+ return this.logger.info(`agitating cartridge-agitator ${this.id}`), Ye(this.path, e);
127
127
  }
128
128
  // -------------------LIFECYCLE----------------------------
129
129
  async init() {
@@ -134,14 +134,14 @@ let _ = class {
134
134
  (e = this.disposer) == null || e.call(this);
135
135
  }
136
136
  async load() {
137
- this.logger.debug(`loading cartridge-agitator ${this.id}`), this.disposer = Te(
137
+ this.logger.debug(`loading cartridge-agitator ${this.id}`), this.disposer = Ce(
138
138
  () => this.isAgitating,
139
139
  () => {
140
140
  var e;
141
- this.isAgitating ? (this.logger.info(`agitating cartridge-agitator ${this.id}`), K.publish($.TOPIC_AGITATION_STARTED, {
141
+ this.isAgitating ? (this.logger.info(`agitating cartridge-agitator ${this.id}`), K.publish(O.TOPIC_AGITATION_STARTED, {
142
142
  path: this.path,
143
143
  futureId: (e = this.futureHandler.future) == null ? void 0 : e.futureId
144
- })) : K.publish($.TOPIC_AGITATION_ENDED, {
144
+ })) : K.publish(O.TOPIC_AGITATION_ENDED, {
145
145
  path: this.path
146
146
  });
147
147
  },
@@ -150,28 +150,28 @@ let _ = class {
150
150
  }
151
151
  };
152
152
  B([
153
- Ee({ path: Ye, attribute: "agitating" })
154
- ], _.prototype, "agitating", 2);
153
+ Ee({ path: Ze, attribute: "agitating" })
154
+ ], v.prototype, "agitating", 2);
155
155
  B([
156
156
  Me()
157
- ], _.prototype, "testAgitate", 1);
158
- _ = B([
159
- f(te)
160
- ], _);
161
- const re = new m({
162
- class: _,
157
+ ], v.prototype, "testAgitate", 1);
158
+ v = B([
159
+ f(se)
160
+ ], v);
161
+ const oe = new m({
162
+ class: v,
163
+ type: se
164
+ }), x = new Q({
165
+ class: $,
163
166
  type: te
164
- }), x = new W({
165
- class: I,
166
- type: k
167
167
  });
168
- x.addRelatedModel(re);
169
- var Ve = Object.defineProperty, We = Object.getOwnPropertyDescriptor, Ze = (e, t, r, o) => {
170
- for (var s = o > 1 ? void 0 : o ? We(t, r) : t, a = e.length - 1, n; a >= 0; a--)
168
+ x.addRelatedModel(oe);
169
+ var Qe = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, Je = (e, t, r, o) => {
170
+ for (var s = o > 1 ? void 0 : o ? Xe(t, r) : t, a = e.length - 1, n; a >= 0; a--)
171
171
  (n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
172
- return o && s && Ve(t, r, s), s;
172
+ return o && s && Qe(t, r, s), s;
173
173
  };
174
- const se = "freestyle-assembly-model", Qe = "iceAgitator", Xe = "carbAgitator";
174
+ const ie = "freestyle-assembly-model", ke = "iceAgitator", et = "carbAgitator";
175
175
  let R = class {
176
176
  constructor(e, t, r) {
177
177
  i(this, "id");
@@ -226,10 +226,10 @@ let R = class {
226
226
  }
227
227
  // -------------------LIFECYCLE----------------------------
228
228
  get supportsIce() {
229
- return U.isFeatureEnabled(Qe);
229
+ return U.isFeatureEnabled(ke);
230
230
  }
231
231
  get supportsCarb() {
232
- return U.isFeatureEnabled(Xe);
232
+ return U.isFeatureEnabled(et);
233
233
  }
234
234
  async init() {
235
235
  this.logger.debug(`initializing freestyle-assembly ${this.id}`);
@@ -238,37 +238,37 @@ let R = class {
238
238
  this.logger.debug(`loading freestyle-assembly ${this.id}`);
239
239
  }
240
240
  };
241
- R = Ze([
242
- f(se)
241
+ R = Je([
242
+ f(ie)
243
243
  ], R);
244
- const F = new W({
244
+ const F = new Q({
245
245
  class: R,
246
- type: se
246
+ type: ie
247
247
  });
248
- var Je = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, et = (e, t, r, o) => {
249
- for (var s = o > 1 ? void 0 : o ? ke(t, r) : t, a = e.length - 1, n; a >= 0; a--)
248
+ var tt = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, st = (e, t, r, o) => {
249
+ for (var s = o > 1 ? void 0 : o ? rt(t, r) : t, a = e.length - 1, n; a >= 0; a--)
250
250
  (n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
251
- return o && s && Je(t, r, s), s;
251
+ return o && s && tt(t, r, s), s;
252
252
  };
253
- const oe = "freestyle-holder-model";
254
- function tt(e) {
253
+ const ae = "freestyle-holder-model";
254
+ function ot(e) {
255
255
  const t = we.getContext(e), r = t == null ? void 0 : t.get(
256
256
  F.type
257
257
  );
258
258
  if (!r) {
259
- C.error("Freestyle assembly not found");
259
+ T.error("Freestyle assembly not found");
260
260
  return;
261
261
  }
262
262
  return r;
263
263
  }
264
- async function rt(e, t) {
264
+ async function it(e, t) {
265
265
  if (!e || !t)
266
266
  return;
267
267
  const r = await e[t]();
268
268
  if (r != null && r.tracker)
269
269
  return ze.getFuture(r.tracker);
270
270
  }
271
- let j = class {
271
+ let L = class {
272
272
  constructor(e, t, r) {
273
273
  i(this, "id");
274
274
  i(this, "logger");
@@ -283,14 +283,14 @@ let j = class {
283
283
  if (!this.holder.data.agitated)
284
284
  return;
285
285
  this.future = void 0;
286
- const e = tt(this.id);
286
+ const e = ot(this.id);
287
287
  if (!e)
288
288
  return;
289
289
  if (!e.defaultCartridgeAgitator) {
290
290
  this.logger.error("Agitator not found");
291
291
  return;
292
292
  }
293
- return this.future = await rt(
293
+ return this.future = await it(
294
294
  e.defaultCartridgeAgitator,
295
295
  "testAgitate"
296
296
  ), this.future;
@@ -303,51 +303,51 @@ let j = class {
303
303
  this.logger.debug(`loading freestyle-holder ${this.id}`);
304
304
  }
305
305
  };
306
- j = et([
307
- f(oe)
308
- ], j);
309
- const H = new m({
310
- class: j,
311
- type: oe
312
- }), { URL: st } = E("FREESTYLE-NOZZLE_SERVICE"), { getOne: ot } = M.build({
313
- basePath: `${st}/api/freestyle-nozzle`
314
- }), P = C.createLogger({
306
+ L = st([
307
+ f(ae)
308
+ ], L);
309
+ const q = new m({
310
+ class: L,
311
+ type: ae
312
+ }), { URL: at } = E("FREESTYLE-NOZZLE_SERVICE"), { getOne: nt } = M.build({
313
+ basePath: `${at}/api/freestyle-nozzle`
314
+ }), A = T.createLogger({
315
315
  name: "freestyle-nozzle-service",
316
316
  group: "Services"
317
317
  });
318
- class it extends Error {
318
+ class lt extends Error {
319
319
  constructor(t) {
320
320
  super(t), this.name = "NutritionInfoError";
321
321
  }
322
322
  }
323
- class q extends Error {
323
+ class Y extends Error {
324
324
  constructor(t) {
325
325
  super(t), this.name = "InvalidRequestError";
326
326
  }
327
327
  }
328
- const at = async (e, t, r, o = "http://localhost:8081") => {
329
- if (P.debug("sending GET for freestyle-nozzle"), !t)
330
- throw P.error("Invalid freestyle-nozzle request: beverageId is required"), new q("No beverageId provided");
328
+ const dt = async (e, t, r, o = "http://localhost:8081") => {
329
+ if (A.debug("sending GET for freestyle-nozzle"), !t)
330
+ throw A.error("Invalid freestyle-nozzle request: beverageId is required"), new Y("No beverageId provided");
331
331
  if (!r || r.length === 0)
332
- throw P.error("Invalid freestyle-nozzle request: volumes are required"), new q("No volumes provided");
333
- const s = await ot({
332
+ throw A.error("Invalid freestyle-nozzle request: volumes are required"), new Y("No volumes provided");
333
+ const s = await nt({
334
334
  urlOverride: `${o}${e}/pipeline/beverage/engine/nutrition/${t}?volumes=${r.join(
335
335
  ","
336
336
  )}`
337
337
  });
338
338
  if (!(s != null && s.data))
339
- throw P.error("Failed to retrieve freestyle-nozzle data"), new Error("Failed to retrieve freestyle-nozzle data");
339
+ throw A.error("Failed to retrieve freestyle-nozzle data"), new Error("Failed to retrieve freestyle-nozzle data");
340
340
  if (s.data.error)
341
- throw new it(s.data.error);
341
+ throw new lt(s.data.error);
342
342
  return s.data;
343
343
  };
344
- var nt = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, gt = (e, t, r, o) => {
345
- for (var s = o > 1 ? void 0 : o ? lt(t, r) : t, a = e.length - 1, n; a >= 0; a--)
344
+ var ct = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, ut = (e, t, r, o) => {
345
+ for (var s = o > 1 ? void 0 : o ? gt(t, r) : t, a = e.length - 1, n; a >= 0; a--)
346
346
  (n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
347
- return o && s && nt(t, r, s), s;
347
+ return o && s && ct(t, r, s), s;
348
348
  };
349
- const ie = "freestyle-nozzle-model";
350
- let L = class {
349
+ const ne = "freestyle-nozzle-model";
350
+ let j = class {
351
351
  constructor(e, t, r) {
352
352
  i(this, "id");
353
353
  i(this, "logger");
@@ -372,12 +372,12 @@ let L = class {
372
372
  );
373
373
  const e = this.nozzleModel.selectedPourable.beverage.rawId, t = this.nozzleModel.urlPrefix;
374
374
  try {
375
- const r = await at(
375
+ const r = await dt(
376
376
  t,
377
377
  e,
378
378
  this._cupSizes
379
379
  );
380
- Z(() => {
380
+ X(() => {
381
381
  this._nutritionInfo = r;
382
382
  });
383
383
  } catch (r) {
@@ -393,27 +393,27 @@ let L = class {
393
393
  this.logger.debug(`loading freestyle-nozzle ${this.id}`);
394
394
  }
395
395
  };
396
- L = gt([
396
+ j = ut([
397
397
  De(),
398
- f(ie)
399
- ], L);
400
- const Y = new m({
401
- class: L,
402
- type: ie
403
- }), { URL: ae } = E("PUMP_SERVICE"), { postModel: ct } = M.build({
404
- basePath: `${ae}/api/ext/freestyle/microCalibration`
405
- }), D = C.createLogger({
398
+ f(ne)
399
+ ], j);
400
+ const V = new m({
401
+ class: j,
402
+ type: ne
403
+ }), { URL: le } = E("PUMP_SERVICE"), { postModel: pt } = M.build({
404
+ basePath: `${le}/api/ext/freestyle/microCalibration`
405
+ }), D = T.createLogger({
406
406
  name: "freestyle-pump-service",
407
407
  group: "Services"
408
- }), dt = async (e, t) => {
408
+ }), ht = async (e, t) => {
409
409
  var r, o, s, a, n;
410
410
  D.debug(
411
411
  `replacePump - sending POST request to /api/ext/freestyle/microCalibration/cal/${e}/code/${t}`
412
412
  );
413
413
  try {
414
- const l = await ct({
414
+ const l = await pt({
415
415
  model: {},
416
- urlOverride: `${ae}/api/ext/freestyle/microCalibration/cal/${e}/code/${t}`
416
+ urlOverride: `${le}/api/ext/freestyle/microCalibration/cal/${e}/code/${t}`
417
417
  });
418
418
  return D.debug("replacePump - response:", l), ((l == null ? void 0 : l.status) === 200 || (l == null ? void 0 : l.status) === 499) && ((r = l.data) != null && r.error) ? [l.data.error || "unknownError", l.data] : [void 0, l == null ? void 0 : l.data];
419
419
  } catch (l) {
@@ -421,18 +421,18 @@ const Y = new m({
421
421
  `replacePump - sending POST request to /api/cal/${e}/code/${t}`,
422
422
  l
423
423
  ), l instanceof Re) {
424
- const d = ((s = (o = l.payload) == null ? void 0 : o.data) == null ? void 0 : s.error) || ((a = l.payload) == null ? void 0 : a.error) || "unknownError";
425
- return [d, ((n = l.payload) == null ? void 0 : n.data) || { error: d }];
424
+ const g = ((s = (o = l.payload) == null ? void 0 : o.data) == null ? void 0 : s.error) || ((a = l.payload) == null ? void 0 : a.error) || "unknownError";
425
+ return [g, ((n = l.payload) == null ? void 0 : n.data) || { error: g }];
426
426
  }
427
427
  }
428
428
  return ["unknownError", { error: "unknownError" }];
429
429
  };
430
- var ut = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, ht = (e, t, r, o) => {
431
- for (var s = o > 1 ? void 0 : o ? pt(t, r) : t, a = e.length - 1, n; a >= 0; a--)
430
+ var yt = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, mt = (e, t, r, o) => {
431
+ for (var s = o > 1 ? void 0 : o ? ft(t, r) : t, a = e.length - 1, n; a >= 0; a--)
432
432
  (n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
433
- return o && s && ut(t, r, s), s;
433
+ return o && s && yt(t, r, s), s;
434
434
  };
435
- const ne = "freestyle-pump-model";
435
+ const de = "freestyle-pump-model";
436
436
  let N = class {
437
437
  constructor(e, t, r) {
438
438
  i(this, "id");
@@ -442,35 +442,35 @@ let N = class {
442
442
  }
443
443
  // -------------------LIFECYCLE----------------------------
444
444
  async replacePump(e) {
445
- const [t, r] = await dt(this.pump.path, e);
445
+ const [t, r] = await ht(this.pump.path, e);
446
446
  return t && this.logger.error(`Failed to replace the pump, ${this.pump.id}`, t), [t, r];
447
447
  }
448
448
  };
449
- N = ht([
450
- f(ne)
449
+ N = mt([
450
+ f(de)
451
451
  ], N);
452
- const V = new m({
452
+ const W = new m({
453
453
  class: N,
454
- type: ne
455
- }), { URL: T } = E("ICE_AGITATOR_SERVICE"), { getAll: le, postModel: yt } = M.build({
456
- basePath: `${T}/api/ext/freestyle/freestyle/ice`
457
- }), ge = C.createLogger({
454
+ type: de
455
+ }), { URL: C } = E("ICE_AGITATOR_SERVICE"), { getAll: ce, postModel: bt } = M.build({
456
+ basePath: `${C}/api/ext/freestyle/freestyle/ice`
457
+ }), ge = T.createLogger({
458
458
  name: "ice-agitator-service",
459
459
  group: "Services"
460
- }), ft = async () => (ge.debug("sending GET for ice types"), await le({
461
- urlOverride: `${T}/api/ext/freestyle/freestyle/ice/types`
462
- })), mt = async (e, t) => (ge.debug("sending POST for ice types"), await yt({
463
- urlOverride: `${T}/api/ext/freestyle/freestyle/ice/type/${e}/${t}`,
460
+ }), _t = async () => (ge.debug("sending GET for ice types"), await ce({
461
+ urlOverride: `${C}/api/ext/freestyle/freestyle/ice/types`
462
+ })), vt = async (e, t) => (ge.debug("sending POST for ice types"), await bt({
463
+ urlOverride: `${C}/api/ext/freestyle/freestyle/ice/type/${e}/${t}`,
464
464
  model: {}
465
- })), bt = async () => await le({
466
- urlOverride: `${T}/api/kos/config/details/assembly.core.board:macro.iceAgitator/4`
465
+ })), Pt = async () => await ce({
466
+ urlOverride: `${C}/api/kos/config/details/assembly.core.board:macro.iceAgitator/4`
467
467
  });
468
- var _t = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, h = (e, t, r, o) => {
469
- for (var s = o > 1 ? void 0 : o ? vt(t, r) : t, a = e.length - 1, n; a >= 0; a--)
468
+ var It = Object.defineProperty, At = Object.getOwnPropertyDescriptor, h = (e, t, r, o) => {
469
+ for (var s = o > 1 ? void 0 : o ? At(t, r) : t, a = e.length - 1, n; a >= 0; a--)
470
470
  (n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
471
- return o && s && _t(t, r, s), s;
471
+ return o && s && It(t, r, s), s;
472
472
  };
473
- const ce = "ice-agitator-model";
473
+ const ue = "ice-agitator-model";
474
474
  let c = class {
475
475
  constructor(e, t, r) {
476
476
  i(this, "id");
@@ -488,7 +488,7 @@ let c = class {
488
488
  i(this, "inactivitySec");
489
489
  i(this, "_allIceTypes");
490
490
  i(this, "logger");
491
- i(this, "resetDefaultValues", async () => await bt());
491
+ i(this, "resetDefaultValues", async () => await Pt());
492
492
  this.id = e, this.name = t.name, this.path = t.path, this._allIceTypes = [], this.logger = r.logger;
493
493
  }
494
494
  get iceTypes() {
@@ -496,15 +496,15 @@ let c = class {
496
496
  }
497
497
  // -------------------LIFECYCLE----------------------------
498
498
  async updateIceType(e) {
499
- await mt(this.id, e);
499
+ await vt(this.id, e);
500
500
  }
501
501
  async init() {
502
502
  this.logger.debug(`initializing ice-agitator ${this.id}`);
503
503
  }
504
504
  async load() {
505
505
  this.logger.debug(`loading ice-agitator ${this.id}`);
506
- const e = await ft();
507
- (e == null ? void 0 : e.status) === 200 && Z(() => {
506
+ const e = await _t();
507
+ (e == null ? void 0 : e.status) === 200 && X(() => {
508
508
  this._allIceTypes = e.data || [];
509
509
  });
510
510
  }
@@ -576,27 +576,28 @@ h([
576
576
  })
577
577
  ], c.prototype, "inactivitySec", 2);
578
578
  c = h([
579
- f(ce)
579
+ f(ue)
580
580
  ], c);
581
- const de = new m({
581
+ const pe = new m({
582
582
  class: c,
583
- type: ce
583
+ type: ue
584
584
  });
585
- var Pt = Object.defineProperty, At = Object.getOwnPropertyDescriptor, ue = (e, t, r, o) => {
586
- for (var s = o > 1 ? void 0 : o ? At(t, r) : t, a = e.length - 1, n; a >= 0; a--)
585
+ var $t = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, H = (e, t, r, o) => {
586
+ for (var s = o > 1 ? void 0 : o ? Ot(t, r) : t, a = e.length - 1, n; a >= 0; a--)
587
587
  (n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
588
- return o && s && Pt(t, r, s), s;
588
+ return o && s && $t(t, r, s), s;
589
589
  };
590
- const G = "agitation-required-trouble-model", It = (e) => {
590
+ const G = "agitation-required-trouble-model", Et = (e) => {
591
591
  if (e.data.agitationRequired)
592
592
  return G;
593
- }, $t = "InsufficientAgitationTrouble";
594
- let O = class {
593
+ }, Mt = "InsufficientAgitationTrouble";
594
+ let P = class {
595
595
  constructor(e, t, r) {
596
596
  i(this, "id");
597
597
  i(this, "logger");
598
598
  i(this, "trouble");
599
599
  i(this, "_deferred");
600
+ i(this, "_holdersLoaded", !1);
600
601
  i(this, "agitateBeforePour");
601
602
  this.id = e, this.logger = r.logger, this._deferred = !1, this.trouble = t.companionParent;
602
603
  }
@@ -604,12 +605,21 @@ let O = class {
604
605
  return this.trouble.resolve();
605
606
  }
606
607
  get holder() {
607
- const e = this.trouble.data.holderPaths[0], t = A(e);
608
- return t == null ? void 0 : t.model;
608
+ const e = this.trouble.data.holderPaths[0], t = _(e);
609
+ if (!(!this._holdersLoaded && !t.model))
610
+ return t == null ? void 0 : t.model;
611
+ }
612
+ updateHolder() {
613
+ if (!this._holdersLoaded) {
614
+ const e = this.trouble.data.holderPaths[0];
615
+ _(e).model && (this._holdersLoaded = !0);
616
+ }
609
617
  }
610
618
  get shouldDefer() {
611
619
  var o, s;
612
- const t = (((o = this.holder) == null ? void 0 : o.troublesByType[$t]) || []).length > 0;
620
+ if (!this.holder)
621
+ return !0;
622
+ const t = (((o = this.holder) == null ? void 0 : o.troublesByType[Mt]) || []).length > 0;
613
623
  return !!((s = this.agitateBeforePour) != null && s.value) && t;
614
624
  }
615
625
  get deferred() {
@@ -622,41 +632,47 @@ let O = class {
622
632
  this._deferred = !1;
623
633
  }
624
634
  };
625
- ue([
635
+ H([
626
636
  p({
627
637
  path: "app:kosdev.ddk:app",
628
638
  attribute: "ncui.agitateBeforePour"
629
639
  })
630
- ], O.prototype, "agitateBeforePour", 2);
631
- O = ue([
640
+ ], P.prototype, "agitateBeforePour", 2);
641
+ H([
642
+ Fe({
643
+ topic: Le(Z.type),
644
+ lifecycle: je.INIT
645
+ })
646
+ ], P.prototype, "updateHolder", 1);
647
+ P = H([
632
648
  f(G)
633
- ], O);
634
- const Ot = new m({
635
- class: O,
649
+ ], P);
650
+ const Tt = new m({
651
+ class: P,
636
652
  type: G
637
- }), Et = ["iceAgitator", "carbAgitator"], Mt = {
638
- iceAgitator: de.factory,
639
- carbAgitator: X.factory
640
- }, Dt = async (e) => {
653
+ }), Ct = ["iceAgitator", "carbAgitator"], wt = {
654
+ iceAgitator: pe.factory,
655
+ carbAgitator: k.factory
656
+ }, Ft = async (e) => {
641
657
  const t = x.instance().options({}).build(), r = e.assemblies.reduce((a, n) => {
642
658
  var l;
643
- return Et.forEach((d) => {
644
- const b = n[d];
659
+ return Ct.forEach((g) => {
660
+ const b = n[g];
645
661
  if (b) {
646
- const v = Mt[d](b.path);
647
- a[d] = v({
662
+ const I = wt[g](b.path);
663
+ a[g] = I({
648
664
  name: b.name,
649
665
  path: b.path
650
666
  });
651
667
  }
652
- }), (l = n.cartridgeAgitators) == null || l.forEach((d) => {
653
- var v;
654
- const b = re.instance(
655
- d.path
668
+ }), (l = n.cartridgeAgitators) == null || l.forEach((g) => {
669
+ var I;
670
+ const b = oe.instance(
671
+ g.path
656
672
  ).options({
657
- name: d.name,
658
- path: d.path,
659
- statePath: ((v = d.state) == null ? void 0 : v.path) || ""
673
+ name: g.name,
674
+ path: g.path,
675
+ statePath: ((I = g.state) == null ? void 0 : I.path) || ""
660
676
  }).build();
661
677
  t.addModel(b);
662
678
  }), a;
@@ -667,18 +683,18 @@ const Ot = new m({
667
683
  supportsCarb: s,
668
684
  supportsIce: o
669
685
  };
670
- }, Ct = (e) => () => (Fe(e)(), fe(e)(), Y.register(), F.register(), de.register(), X.register(), x.register(), V.register(), H.register(), g.companion.register(e)(
671
- me.type,
672
- Y.type
673
- ), g.companion.register(e)(
686
+ }, zt = (e) => () => (Ne(e)(), me(e)(), V.register(), F.register(), pe.register(), k.register(), x.register(), W.register(), q.register(), d.companion.register(e)(
674
687
  be.type,
688
+ V.type
689
+ ), d.companion.register(e)(
690
+ Z.type,
675
691
  F.type
676
- ), Ot.register(), g.companion.register(e)(
677
- je.type,
678
- It
679
- ), g.companion.register(e)(_e.type, V.type), g.companion.register(e)(
692
+ ), Tt.register(), d.companion.register(e)(
693
+ Be.type,
694
+ Et
695
+ ), d.companion.register(e)(_e.type, W.type), d.companion.register(e)(
680
696
  ve.type,
681
- H.type
697
+ q.type
682
698
  ), w[z].register(
683
699
  "EnjoyByTrouble",
684
700
  async (t) => {
@@ -696,12 +712,12 @@ const Ot = new m({
696
712
  "SuperPumpRequiredTrouble",
697
713
  // This is the trouble type
698
714
  async (t) => {
699
- const { model: r } = A(
715
+ const { model: r } = _(
700
716
  Pe.type
701
717
  );
702
718
  return r ? {
703
719
  superPumps: r.models.getIndexByKey(
704
- Ae.byType,
720
+ Ie.byType,
705
721
  "microSuper"
706
722
  ).map((a) => a.name).join(", ")
707
723
  } : {};
@@ -712,11 +728,11 @@ const Ot = new m({
712
728
  if (t.ifaces.includes("container"))
713
729
  return {};
714
730
  if (t.data.pumpPath) {
715
- const { model: r } = A(
731
+ const { model: r } = _(
716
732
  t.data.pumpPath
717
733
  );
718
734
  if (r) {
719
- const o = r.ingredientId ? A(r.ingredientId).model : void 0;
735
+ const o = r.ingredientId ? _(r.ingredientId).model : void 0;
720
736
  return {
721
737
  ingredientId: r.ingredientId,
722
738
  ingredientName: (o == null ? void 0 : o.name) || ""
@@ -726,40 +742,40 @@ const Ot = new m({
726
742
  return {};
727
743
  }
728
744
  ), {
729
- preload: g.model.preloadModel(e),
730
- model: g.model.register(e),
731
- companion: g.companion.register(e),
732
- legacy: g.model.registerLegacyModel(e)
745
+ preload: d.model.preloadModel(e),
746
+ model: d.model.register(e),
747
+ companion: d.companion.register(e),
748
+ legacy: d.model.registerLegacyModel(e)
733
749
  }), u = {
734
- ...ye
750
+ ...fe
735
751
  };
736
752
  u.freestyle = {
737
- models: Ct(u)
753
+ models: zt(u)
738
754
  };
739
- u.preload = g.model.preloadModel(u);
740
- u.model = g.model.register(u);
741
- u.companion = g.companion.register(u);
742
- u.legacy = g.model.registerLegacyModel(u);
743
- const St = u;
755
+ u.preload = d.model.preloadModel(u);
756
+ u.model = d.model.register(u);
757
+ u.companion = d.companion.register(u);
758
+ u.legacy = d.model.registerLegacyModel(u);
759
+ const Lt = u;
744
760
  export {
745
- $t as A,
746
- X as C,
761
+ Mt as A,
762
+ k as C,
747
763
  F,
748
- de as I,
749
- St as K,
750
- it as N,
764
+ pe as I,
765
+ Lt as K,
766
+ lt as N,
751
767
  x as a,
752
- $ as b,
753
- re as c,
754
- H as d,
755
- Y as e,
756
- V as f,
757
- Ot as g,
758
- q as h,
759
- at as i,
760
- dt as j,
761
- Dt as k,
762
- Qe as l,
763
- Ct as r
768
+ O as b,
769
+ oe as c,
770
+ q as d,
771
+ V as e,
772
+ W as f,
773
+ Tt as g,
774
+ Y as h,
775
+ dt as i,
776
+ ht as j,
777
+ Ft as k,
778
+ ke as l,
779
+ zt as r
764
780
  };
765
- //# sourceMappingURL=freestyle-registration-manager-pbtzJUqS.js.map
781
+ //# sourceMappingURL=freestyle-registration-manager-DkqzBO2O.js.map