@kosdev-code/kos-dispense-sdk 2.0.30 → 2.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1 -1
- package/index.js +1 -1
- package/models/utils/service.d.ts +12 -12
- package/package.json +3 -3
- package/{pump-provider-CiU4D_1r.js → pump-provider-0z7R7MK1.js} +298 -294
- package/pump-provider-0z7R7MK1.js.map +1 -0
- package/pump-provider-DgkR1iwg.cjs +2 -0
- package/pump-provider-DgkR1iwg.cjs.map +1 -0
- package/ui/hooks/cui-kit/use-brands.d.ts +1 -1
- package/ui/hooks/cui-kit/use-brands.d.ts.map +1 -1
- package/ui.cjs +1 -1
- package/ui.js +1 -1
- package/pump-provider-CiU4D_1r.js.map +0 -1
- package/pump-provider-DzxdPW8o.cjs +0 -2
- package/pump-provider-DzxdPW8o.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var ze = Object.defineProperty;
|
|
2
|
+
var et = (e, t, r) => t in e ? ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var _ = (e, t, r) => (et(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
4
|
import { jsx as u } from "@emotion/react/jsx-runtime";
|
|
5
|
-
import { useKosModel as E, getKosCompanionModel as pe, kosAutoEffect as
|
|
6
|
-
import tt, { createContext as S, useMemo as P, useContext as k, useState as
|
|
5
|
+
import { useKosModel as E, getKosCompanionModel as pe, kosAutoEffect as He, KosLog as w, usePressGesture as me, EventBus as T, TimerManager as Se } from "@kosdev-code/kos-ui-sdk";
|
|
6
|
+
import tt, { createContext as S, useMemo as P, useContext as k, useState as I, useCallback as i, useEffect as Y, useRef as st } from "react";
|
|
7
7
|
import { A as $e, a as we, d as rt, c as Pe, N as nt, e as ge, H as ot, f as Te, I as Ie, g as Ae, G as at, P as xe } from "./dispense-registration-manager-CKFF29mO.js";
|
|
8
|
-
const
|
|
8
|
+
const Ne = () => {
|
|
9
9
|
const e = $e.type;
|
|
10
10
|
return E({
|
|
11
11
|
modelId: e,
|
|
@@ -13,13 +13,13 @@ const Se = () => {
|
|
|
13
13
|
options: {}
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
function
|
|
16
|
+
function Bt(e) {
|
|
17
17
|
return (t) => {
|
|
18
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
18
|
+
const { model: r, status: n, KosModelLoader: s } = Ne();
|
|
19
19
|
return /* @__PURE__ */ u(s, { ...n, children: /* @__PURE__ */ u(e, { ...t, assembly: r }) });
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const Be = () => {
|
|
23
23
|
const e = we.type;
|
|
24
24
|
return E({
|
|
25
25
|
modelId: e,
|
|
@@ -27,9 +27,9 @@ const Ne = () => {
|
|
|
27
27
|
options: {}
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function Kt(e) {
|
|
31
31
|
return (t) => {
|
|
32
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
32
|
+
const { model: r, status: n, KosModelLoader: s } = Be();
|
|
33
33
|
return /* @__PURE__ */ u(s, { ...n, children: /* @__PURE__ */ u(e, { ...t, beverage: r }) });
|
|
34
34
|
};
|
|
35
35
|
}
|
|
@@ -44,7 +44,7 @@ function Lt(e) {
|
|
|
44
44
|
return /* @__PURE__ */ u(o, { ...s, children: /* @__PURE__ */ u(e, { ...r, board: n }) });
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const Le = () => {
|
|
48
48
|
const e = Pe.type;
|
|
49
49
|
return E({
|
|
50
50
|
modelId: e,
|
|
@@ -54,21 +54,21 @@ const Be = () => {
|
|
|
54
54
|
};
|
|
55
55
|
function Ct(e) {
|
|
56
56
|
return (t) => {
|
|
57
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
57
|
+
const { model: r, status: n, KosModelLoader: s } = Le();
|
|
58
58
|
return /* @__PURE__ */ u(s, { ...n, children: /* @__PURE__ */ u(e, { ...t, boardContainer: r }) });
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const Ce = (e) => E({
|
|
62
62
|
modelId: e,
|
|
63
63
|
modelType: nt.type,
|
|
64
64
|
options: {
|
|
65
65
|
path: e
|
|
66
66
|
}
|
|
67
|
-
}),
|
|
68
|
-
const { model: r, ready: n } =
|
|
69
|
-
return /* @__PURE__ */ u(
|
|
67
|
+
}), De = S(void 0), it = ({ children: e, path: t }) => {
|
|
68
|
+
const { model: r, ready: n } = Ce(t), s = P(() => n && r ? { model: r } : {}, [n, r]);
|
|
69
|
+
return /* @__PURE__ */ u(De.Provider, { value: s, children: e });
|
|
70
70
|
}, C = () => {
|
|
71
|
-
const e = k(
|
|
71
|
+
const e = k(De);
|
|
72
72
|
if (!e)
|
|
73
73
|
throw new Error("useNozzleContext must be used within a NozzleProvider");
|
|
74
74
|
return e;
|
|
@@ -77,18 +77,18 @@ const Le = (e) => E({
|
|
|
77
77
|
onClearBeverage: t,
|
|
78
78
|
companionType: r
|
|
79
79
|
}) => {
|
|
80
|
-
const { model: n } = C(), [s, o] =
|
|
81
|
-
(
|
|
80
|
+
const { model: n } = C(), [s, o] = I([]), [c, m] = I(null), h = P(() => r ? s.map(
|
|
81
|
+
(d) => pe(d, r)
|
|
82
82
|
) : [], [s, r]), f = i(
|
|
83
|
-
async (
|
|
84
|
-
|
|
83
|
+
async (d) => {
|
|
84
|
+
m(d), await (n == null ? void 0 : n.setSelectedPourable({ beverage: d })), e == null || e(d);
|
|
85
85
|
},
|
|
86
86
|
[n, e]
|
|
87
|
-
),
|
|
88
|
-
|
|
87
|
+
), l = i(async () => {
|
|
88
|
+
m(null), await (n == null ? void 0 : n.setSelectedPourable({ beverage: void 0 })), t == null || t();
|
|
89
89
|
}, [n, t]);
|
|
90
|
-
return
|
|
91
|
-
const
|
|
90
|
+
return Y(() => {
|
|
91
|
+
const d = He(() => {
|
|
92
92
|
if (!n)
|
|
93
93
|
return;
|
|
94
94
|
const v = n.selectedBrand;
|
|
@@ -101,42 +101,46 @@ const Le = (e) => E({
|
|
|
101
101
|
o(b ?? []);
|
|
102
102
|
});
|
|
103
103
|
return () => {
|
|
104
|
-
|
|
104
|
+
d();
|
|
105
105
|
};
|
|
106
106
|
}, [n]), {
|
|
107
107
|
beverages: s,
|
|
108
108
|
beverageCompanions: h,
|
|
109
109
|
selectBeverage: f,
|
|
110
|
-
selectedBeverage:
|
|
111
|
-
clearBeverage:
|
|
110
|
+
selectedBeverage: c,
|
|
111
|
+
clearBeverage: l
|
|
112
112
|
};
|
|
113
113
|
}, dt = ({
|
|
114
114
|
onBrandSelected: e,
|
|
115
115
|
onBrandCleared: t,
|
|
116
116
|
companionType: r
|
|
117
117
|
}) => {
|
|
118
|
-
const { model: n } = C(), [s, o] =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
), p = P(() => r ? d.map((c) => pe(c, r)) : [], [d, r]), h = i(
|
|
122
|
-
async (c) => {
|
|
123
|
-
o(c), n == null || n.setSelectedBrand(c), e == null || e(c);
|
|
118
|
+
const { model: n } = C(), [s, o] = I(null), [c, m] = I([]), h = P(() => r ? c.map((d) => pe(d, r)) : [], [c, r]), f = i(
|
|
119
|
+
async (d) => {
|
|
120
|
+
o(d), n == null || n.setSelectedBrand(d), e == null || e(d);
|
|
124
121
|
},
|
|
125
122
|
[n, e]
|
|
126
|
-
),
|
|
123
|
+
), l = i(() => {
|
|
127
124
|
o(null), n == null || n.setSelectedBrand(void 0), t == null || t();
|
|
128
125
|
}, [n, t]);
|
|
129
|
-
return {
|
|
130
|
-
|
|
131
|
-
|
|
126
|
+
return Y(() => {
|
|
127
|
+
const d = He(() => {
|
|
128
|
+
n && m(n.visibleBrands);
|
|
129
|
+
});
|
|
130
|
+
return () => {
|
|
131
|
+
d();
|
|
132
|
+
};
|
|
133
|
+
}, [n]), {
|
|
134
|
+
brands: c,
|
|
135
|
+
brandCompanions: h,
|
|
132
136
|
selectedBrand: s,
|
|
133
|
-
selectBrand:
|
|
134
|
-
clearBrand:
|
|
137
|
+
selectBrand: f,
|
|
138
|
+
clearBrand: l
|
|
135
139
|
};
|
|
136
140
|
}, ut = w.createLogger({
|
|
137
141
|
name: "HoldToPourStrategy",
|
|
138
142
|
group: "kos-hooks"
|
|
139
|
-
}),
|
|
143
|
+
}), Re = {
|
|
140
144
|
name: "HoldToPourStrategy",
|
|
141
145
|
async initiate(e) {
|
|
142
146
|
if (!(e != null && e.canPour)) {
|
|
@@ -156,26 +160,26 @@ const Le = (e) => E({
|
|
|
156
160
|
onPourCancel: t,
|
|
157
161
|
onBeforePour: r,
|
|
158
162
|
onBeforePourRejected: n,
|
|
159
|
-
strategy: s =
|
|
163
|
+
strategy: s = Re
|
|
160
164
|
}) => {
|
|
161
|
-
const { model: o } = C(),
|
|
165
|
+
const { model: o } = C(), c = i(async () => {
|
|
162
166
|
(r ? await (r == null ? void 0 : r()) : !0) ? (Q.debug(
|
|
163
167
|
`[${s == null ? void 0 : s.name}] - Pour initiated for nozzle ${o == null ? void 0 : o.id}.`
|
|
164
168
|
), s == null || s.initiate(o), e == null || e()) : (Q.debug(
|
|
165
169
|
`[${s == null ? void 0 : s.name}] - Did not pass onBeforePour gate for nozzle ${o == null ? void 0 : o.id}. Cancelling pour.`
|
|
166
170
|
), n == null || n());
|
|
167
|
-
}, [e, o, s, r, t]),
|
|
168
|
-
var
|
|
171
|
+
}, [e, o, s, r, t]), m = i(() => {
|
|
172
|
+
var l;
|
|
169
173
|
Q.debug(
|
|
170
174
|
`[${s == null ? void 0 : s.name}] - Pour initiate ended called for nozzle ${o == null ? void 0 : o.id}.`
|
|
171
|
-
), (
|
|
175
|
+
), (l = s == null ? void 0 : s.initiateEnded) == null || l.call(s, o), t == null || t();
|
|
172
176
|
}, [t, o, s]), h = i(() => {
|
|
173
177
|
Q.debug(`Force cancelling pour for nozzle ${o == null ? void 0 : o.id}.`), o == null || o.cancelPour(), t == null || t();
|
|
174
178
|
}, [t, o]);
|
|
175
179
|
return {
|
|
176
180
|
handlers: me({
|
|
177
|
-
onPressed:
|
|
178
|
-
onRelease:
|
|
181
|
+
onPressed: c,
|
|
182
|
+
onRelease: m
|
|
179
183
|
}).dom,
|
|
180
184
|
cancel: h,
|
|
181
185
|
status: o
|
|
@@ -186,92 +190,92 @@ const Le = (e) => E({
|
|
|
186
190
|
companionType: r
|
|
187
191
|
}) => {
|
|
188
192
|
const { model: n } = C(), s = P(
|
|
189
|
-
() => (n == null ? void 0 : n.getGroupAvailabilityItems("flavors").filter((
|
|
193
|
+
() => (n == null ? void 0 : n.getGroupAvailabilityItems("flavors").filter((l) => l.visible)) ?? [],
|
|
190
194
|
[n]
|
|
191
195
|
), o = P(() => r ? s.map(
|
|
192
|
-
(
|
|
193
|
-
) : [], [s, r]), [
|
|
194
|
-
async (
|
|
195
|
-
if (
|
|
196
|
-
(
|
|
196
|
+
(l) => pe(l, r)
|
|
197
|
+
) : [], [s, r]), [c, m] = I([]), h = i(
|
|
198
|
+
async (l) => {
|
|
199
|
+
if (m(
|
|
200
|
+
(d) => d != null && d.includes(l) ? [...d.filter((v) => v !== l)] : [...d ?? [], l]
|
|
197
201
|
), n != null && n.selectedPourable) {
|
|
198
|
-
const { beverage:
|
|
202
|
+
const { beverage: d } = n.selectedPourable;
|
|
199
203
|
await n.setSelectedPourable({
|
|
200
|
-
beverage:
|
|
201
|
-
additional:
|
|
204
|
+
beverage: d,
|
|
205
|
+
additional: c ?? []
|
|
202
206
|
});
|
|
203
207
|
}
|
|
204
|
-
e == null || e(
|
|
208
|
+
e == null || e(l, c ?? []);
|
|
205
209
|
},
|
|
206
|
-
[n, e,
|
|
210
|
+
[n, e, c]
|
|
207
211
|
), f = i(async () => {
|
|
208
|
-
if (
|
|
209
|
-
const { beverage:
|
|
210
|
-
n.setSelectedPourable({ beverage:
|
|
212
|
+
if (m([]), n != null && n.selectedPourable) {
|
|
213
|
+
const { beverage: l } = n.selectedPourable;
|
|
214
|
+
n.setSelectedPourable({ beverage: l }), t == null || t();
|
|
211
215
|
}
|
|
212
216
|
}, [n, t]);
|
|
213
217
|
return {
|
|
214
218
|
flavors: s,
|
|
215
219
|
flavorCompanions: o,
|
|
216
220
|
selectFlavor: h,
|
|
217
|
-
selectedFlavors:
|
|
221
|
+
selectedFlavors: c,
|
|
218
222
|
clearFlavors: f
|
|
219
223
|
};
|
|
220
|
-
}, G = "brands", X = "beverages",
|
|
224
|
+
}, G = "brands", X = "beverages", j = "flavors", R = w.createLogger({ name: "use-cui-kit" }), mt = ({
|
|
221
225
|
initialGroup: e = G,
|
|
222
226
|
options: t = {}
|
|
223
227
|
}) => {
|
|
224
228
|
var W, q, J;
|
|
225
|
-
const [r, n] =
|
|
226
|
-
(
|
|
227
|
-
n(
|
|
229
|
+
const [r, n] = I(e), { model: s } = C(), o = st([]), c = i(
|
|
230
|
+
(p) => {
|
|
231
|
+
n(j);
|
|
228
232
|
const N = `/kos/dispense/${s == null ? void 0 : s.path}/brand/selected/`;
|
|
229
|
-
T.publish(N,
|
|
233
|
+
T.publish(N, p);
|
|
230
234
|
},
|
|
231
235
|
[s == null ? void 0 : s.path]
|
|
232
|
-
),
|
|
233
|
-
const
|
|
234
|
-
T.publish(
|
|
236
|
+
), m = i(() => {
|
|
237
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/brand/cleared/`;
|
|
238
|
+
T.publish(p, {});
|
|
235
239
|
}, [s == null ? void 0 : s.path]), h = i(
|
|
236
|
-
(
|
|
237
|
-
n(
|
|
240
|
+
(p) => {
|
|
241
|
+
n(j);
|
|
238
242
|
const N = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/selected/`;
|
|
239
|
-
T.publish(N,
|
|
243
|
+
T.publish(N, p);
|
|
240
244
|
},
|
|
241
245
|
[s == null ? void 0 : s.path]
|
|
242
246
|
), f = i(() => {
|
|
243
|
-
const
|
|
244
|
-
T.publish(
|
|
245
|
-
}, [s == null ? void 0 : s.path]),
|
|
246
|
-
(
|
|
247
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/cleared/`;
|
|
248
|
+
T.publish(p, {});
|
|
249
|
+
}, [s == null ? void 0 : s.path]), l = i(
|
|
250
|
+
(p) => {
|
|
247
251
|
const N = `/kos/dispense/${s == null ? void 0 : s.path}/flavor/selected/`;
|
|
248
|
-
T.publish(N,
|
|
252
|
+
T.publish(N, p);
|
|
249
253
|
},
|
|
250
254
|
[s == null ? void 0 : s.path]
|
|
251
|
-
),
|
|
252
|
-
const
|
|
253
|
-
T.publish(
|
|
255
|
+
), d = i(() => {
|
|
256
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/flavor/cleared/`;
|
|
257
|
+
T.publish(p, {});
|
|
254
258
|
}, [s == null ? void 0 : s.path]), v = i(() => {
|
|
255
|
-
const
|
|
256
|
-
T.publish(
|
|
259
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/pour/`;
|
|
260
|
+
T.publish(p, {});
|
|
257
261
|
}, [s == null ? void 0 : s.path]), b = i(async () => {
|
|
258
|
-
const
|
|
259
|
-
return T.publish(
|
|
262
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/pre/pour/`;
|
|
263
|
+
return T.publish(p, {}), await (g == null ? void 0 : g()) || !0;
|
|
260
264
|
}, [s == null ? void 0 : s.path]), a = i(async () => {
|
|
261
|
-
const
|
|
262
|
-
T.publish(
|
|
265
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/pre/pour/rejected/`;
|
|
266
|
+
T.publish(p, {});
|
|
263
267
|
}, [s == null ? void 0 : s.path]), $ = i(() => {
|
|
264
|
-
const
|
|
265
|
-
T.publish(
|
|
266
|
-
}, [s == null ? void 0 : s.path]), { brands: y, selectBrand: H, selectedBrand:
|
|
268
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/pour/cancel/`;
|
|
269
|
+
T.publish(p, {});
|
|
270
|
+
}, [s == null ? void 0 : s.path]), { brands: y, selectBrand: H, selectedBrand: B, clearBrand: K, brandCompanions: V } = dt({
|
|
267
271
|
companionType: (W = t.companionTypes) == null ? void 0 : W.brand,
|
|
268
|
-
onBrandSelected:
|
|
269
|
-
onBrandCleared:
|
|
272
|
+
onBrandSelected: c,
|
|
273
|
+
onBrandCleared: m
|
|
270
274
|
}), {
|
|
271
275
|
beverages: z,
|
|
272
276
|
selectBeverage: ee,
|
|
273
277
|
selectedBeverage: te,
|
|
274
|
-
clearBeverage:
|
|
278
|
+
clearBeverage: A,
|
|
275
279
|
beverageCompanions: D
|
|
276
280
|
} = ct({
|
|
277
281
|
companionType: (q = t.companionTypes) == null ? void 0 : q.beverage,
|
|
@@ -279,16 +283,16 @@ const Le = (e) => E({
|
|
|
279
283
|
onClearBeverage: f
|
|
280
284
|
}), {
|
|
281
285
|
clearFlavors: se,
|
|
282
|
-
flavors:
|
|
283
|
-
selectFlavor:
|
|
286
|
+
flavors: O,
|
|
287
|
+
selectFlavor: x,
|
|
284
288
|
selectedFlavors: L,
|
|
285
289
|
flavorCompanions: re
|
|
286
290
|
} = pt({
|
|
287
291
|
companionType: (J = t.companionTypes) == null ? void 0 : J.flavor,
|
|
288
|
-
onFlavorSelected:
|
|
289
|
-
onFlavorCleared:
|
|
290
|
-
}), [g, M] =
|
|
291
|
-
M(() =>
|
|
292
|
+
onFlavorSelected: l,
|
|
293
|
+
onFlavorCleared: d
|
|
294
|
+
}), [g, M] = I(), ne = i((p) => {
|
|
295
|
+
M(() => p);
|
|
292
296
|
}, []), oe = lt({
|
|
293
297
|
onPour: v,
|
|
294
298
|
onPourCancel: $,
|
|
@@ -297,42 +301,42 @@ const Le = (e) => E({
|
|
|
297
301
|
}), ae = i(() => {
|
|
298
302
|
switch (R.debug(`Navigating back from group: ${r}`), r) {
|
|
299
303
|
case G:
|
|
300
|
-
|
|
304
|
+
A(), K();
|
|
301
305
|
break;
|
|
302
306
|
case X:
|
|
303
|
-
case
|
|
304
|
-
n(e),
|
|
307
|
+
case j:
|
|
308
|
+
n(e), A(), K();
|
|
305
309
|
break;
|
|
306
310
|
}
|
|
307
|
-
}, [
|
|
308
|
-
const
|
|
309
|
-
T.publish(
|
|
310
|
-
}, [
|
|
311
|
+
}, [A, K, r, e]), ie = i(() => {
|
|
312
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/home/`;
|
|
313
|
+
T.publish(p, {}), n(e), e === G && (A(), K()), e === X && A();
|
|
314
|
+
}, [A, K, e]), ce = i(() => {
|
|
311
315
|
if (o.current.length === 0) {
|
|
312
316
|
R.debug("No timers to pause.");
|
|
313
317
|
return;
|
|
314
318
|
}
|
|
315
|
-
R.debug(`Pausing ${o.current.length} timers.`), o.current.forEach((
|
|
316
|
-
R.debug(`Pausing timer with id ${
|
|
319
|
+
R.debug(`Pausing ${o.current.length} timers.`), o.current.forEach((p) => {
|
|
320
|
+
R.debug(`Pausing timer with id ${p.id}.`), p.pause();
|
|
317
321
|
});
|
|
318
322
|
}, []), de = i(() => {
|
|
319
323
|
if (o.current.length === 0) {
|
|
320
324
|
R.debug("No timers to restart.");
|
|
321
325
|
return;
|
|
322
326
|
}
|
|
323
|
-
R.debug(`Restarting ${o.current.length} timers.`), o.current.forEach((
|
|
324
|
-
R.debug(`Restarting timer with id ${
|
|
327
|
+
R.debug(`Restarting ${o.current.length} timers.`), o.current.forEach((p) => {
|
|
328
|
+
R.debug(`Restarting timer with id ${p.id}.`), p.restart();
|
|
325
329
|
});
|
|
326
330
|
}, []);
|
|
327
331
|
return {
|
|
328
332
|
timers: {
|
|
329
|
-
add: i((
|
|
330
|
-
if (
|
|
331
|
-
if (o.current.some((N) => N.id ===
|
|
332
|
-
R.debug(`Timer with id ${
|
|
333
|
+
add: i((p) => {
|
|
334
|
+
if (p) {
|
|
335
|
+
if (o.current.some((N) => N.id === p.id)) {
|
|
336
|
+
R.debug(`Timer with id ${p.id} already exists.`);
|
|
333
337
|
return;
|
|
334
338
|
}
|
|
335
|
-
o.current.push(
|
|
339
|
+
o.current.push(p);
|
|
336
340
|
}
|
|
337
341
|
}, []),
|
|
338
342
|
pause: ce,
|
|
@@ -346,14 +350,14 @@ const Le = (e) => E({
|
|
|
346
350
|
pour: oe,
|
|
347
351
|
updateOnBeforePour: ne,
|
|
348
352
|
selections: {
|
|
349
|
-
[G]:
|
|
353
|
+
[G]: B,
|
|
350
354
|
[X]: te,
|
|
351
|
-
[
|
|
355
|
+
[j]: L
|
|
352
356
|
},
|
|
353
357
|
[G]: {
|
|
354
358
|
models: y,
|
|
355
359
|
companions: V,
|
|
356
|
-
clear:
|
|
360
|
+
clear: K,
|
|
357
361
|
handlers: {
|
|
358
362
|
onSelected: H
|
|
359
363
|
}
|
|
@@ -361,54 +365,54 @@ const Le = (e) => E({
|
|
|
361
365
|
[X]: {
|
|
362
366
|
models: z,
|
|
363
367
|
companions: D,
|
|
364
|
-
clear:
|
|
368
|
+
clear: A,
|
|
365
369
|
handlers: {
|
|
366
370
|
onSelected: ee
|
|
367
371
|
}
|
|
368
372
|
},
|
|
369
|
-
[
|
|
370
|
-
models:
|
|
373
|
+
[j]: {
|
|
374
|
+
models: O,
|
|
371
375
|
companions: re,
|
|
372
376
|
clear: se,
|
|
373
377
|
handlers: {
|
|
374
|
-
onSelected:
|
|
378
|
+
onSelected: x
|
|
375
379
|
}
|
|
376
380
|
}
|
|
377
381
|
};
|
|
378
382
|
}, ht = (e) => {
|
|
379
|
-
const { model: t } = C(), [r, n] =
|
|
383
|
+
const { model: t } = C(), [r, n] = I(null), {
|
|
380
384
|
onAmbientTimer: s,
|
|
381
385
|
onAttractTimer: o,
|
|
382
|
-
onResetAttractTimer:
|
|
383
|
-
onResumeAttractTimer:
|
|
386
|
+
onResetAttractTimer: c,
|
|
387
|
+
onResumeAttractTimer: m,
|
|
384
388
|
defaultAttractTime: h,
|
|
385
389
|
defaultAmbientTime: f
|
|
386
|
-
} = e,
|
|
390
|
+
} = e, l = i(() => {
|
|
387
391
|
s && (w.info("Ambient timer expired. Calling callback"), s == null || s());
|
|
388
|
-
}, [s]),
|
|
392
|
+
}, [s]), d = i(() => {
|
|
389
393
|
o && (w.info("Attract timer expired. Calling callback"), o == null || o());
|
|
390
394
|
}, [o]), v = i(() => {
|
|
391
|
-
r && (r.restart(),
|
|
392
|
-
}, [r,
|
|
393
|
-
r && (r.reset(),
|
|
394
|
-
}, [r,
|
|
395
|
-
r && (r.pause(),
|
|
396
|
-
}, [r,
|
|
397
|
-
return
|
|
395
|
+
r && (r.restart(), c == null || c());
|
|
396
|
+
}, [r, c]), b = i(() => {
|
|
397
|
+
r && (r.reset(), c == null || c());
|
|
398
|
+
}, [r, c]), a = i(() => {
|
|
399
|
+
r && (r.pause(), m == null || m());
|
|
400
|
+
}, [r, m]);
|
|
401
|
+
return Y(() => {
|
|
398
402
|
if (t && h) {
|
|
399
403
|
w.info("Nozzle is available. Creating timers");
|
|
400
|
-
const $ =
|
|
404
|
+
const $ = Se.createTimer(
|
|
401
405
|
"attract-timer-" + t.path,
|
|
402
406
|
h
|
|
403
407
|
);
|
|
404
408
|
return h && ($ == null || $.addTimeoutAction({
|
|
405
409
|
name: "attract-timer",
|
|
406
410
|
remainingTime: 0,
|
|
407
|
-
action:
|
|
411
|
+
action: d
|
|
408
412
|
})), f && ($ == null || $.addTimeoutAction({
|
|
409
413
|
name: "ambient-timer",
|
|
410
414
|
remainingTime: f,
|
|
411
|
-
action:
|
|
415
|
+
action: l
|
|
412
416
|
})), h && ($ == null || $.start()), n($ ?? null), () => {
|
|
413
417
|
$ == null || $.reset(), n(null);
|
|
414
418
|
};
|
|
@@ -419,8 +423,8 @@ const Le = (e) => E({
|
|
|
419
423
|
}, [
|
|
420
424
|
f,
|
|
421
425
|
h,
|
|
422
|
-
|
|
423
|
-
|
|
426
|
+
l,
|
|
427
|
+
d,
|
|
424
428
|
t
|
|
425
429
|
]), {
|
|
426
430
|
attractTimer: r,
|
|
@@ -438,17 +442,17 @@ const Le = (e) => E({
|
|
|
438
442
|
onBeverageCleared: n,
|
|
439
443
|
onBeverageSelected: s,
|
|
440
444
|
onFlavorCleared: o,
|
|
441
|
-
onFlavorSelected:
|
|
442
|
-
onReturnToHome:
|
|
445
|
+
onFlavorSelected: c,
|
|
446
|
+
onReturnToHome: m,
|
|
443
447
|
onPour: h,
|
|
444
448
|
onPourCancel: f,
|
|
445
|
-
onBeforePourRejected:
|
|
446
|
-
onAmbientTimer:
|
|
449
|
+
onBeforePourRejected: l,
|
|
450
|
+
onAmbientTimer: d,
|
|
447
451
|
onAttractTimer: v,
|
|
448
452
|
onResumeAttractTimer: b
|
|
449
453
|
}) => {
|
|
450
454
|
const { model: a } = C();
|
|
451
|
-
|
|
455
|
+
Y(() => {
|
|
452
456
|
const y = [
|
|
453
457
|
{
|
|
454
458
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/brand/selected/`,
|
|
@@ -468,7 +472,7 @@ const Le = (e) => E({
|
|
|
468
472
|
},
|
|
469
473
|
{
|
|
470
474
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/flavor/selected/`,
|
|
471
|
-
callback:
|
|
475
|
+
callback: c
|
|
472
476
|
},
|
|
473
477
|
{
|
|
474
478
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/flavor/cleared/`,
|
|
@@ -481,11 +485,11 @@ const Le = (e) => E({
|
|
|
481
485
|
},
|
|
482
486
|
{
|
|
483
487
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/pre/pour/rejected/`,
|
|
484
|
-
callback:
|
|
488
|
+
callback: l
|
|
485
489
|
},
|
|
486
490
|
{
|
|
487
491
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/ambient/start/`,
|
|
488
|
-
callback:
|
|
492
|
+
callback: d
|
|
489
493
|
},
|
|
490
494
|
{
|
|
491
495
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/attract/start/`,
|
|
@@ -501,60 +505,60 @@ const Le = (e) => E({
|
|
|
501
505
|
},
|
|
502
506
|
{
|
|
503
507
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/home/`,
|
|
504
|
-
callback:
|
|
508
|
+
callback: m
|
|
505
509
|
}
|
|
506
510
|
].map(
|
|
507
|
-
({ topic: H, callback:
|
|
511
|
+
({ topic: H, callback: B }) => ft(H, B)
|
|
508
512
|
);
|
|
509
513
|
return () => {
|
|
510
514
|
y.forEach((H) => H == null ? void 0 : H());
|
|
511
515
|
};
|
|
512
516
|
}, [
|
|
513
517
|
a == null ? void 0 : a.path,
|
|
514
|
-
|
|
518
|
+
d,
|
|
515
519
|
v,
|
|
516
520
|
n,
|
|
517
521
|
s,
|
|
518
522
|
r,
|
|
519
523
|
t,
|
|
520
524
|
o,
|
|
521
|
-
|
|
525
|
+
c,
|
|
522
526
|
h,
|
|
523
527
|
f,
|
|
524
528
|
b,
|
|
525
529
|
e,
|
|
526
|
-
|
|
530
|
+
m
|
|
527
531
|
]);
|
|
528
532
|
}, Ee = (e) => {
|
|
529
|
-
const { model: t } = C(), [r, n] =
|
|
533
|
+
const { model: t } = C(), [r, n] = I(null), {
|
|
530
534
|
onAreYouThereTimer: s,
|
|
531
535
|
onIdleTimer: o,
|
|
532
|
-
onResetIdleTimer:
|
|
533
|
-
defaultAreYouThereTime:
|
|
536
|
+
onResetIdleTimer: c,
|
|
537
|
+
defaultAreYouThereTime: m = 10,
|
|
534
538
|
defaultIdleTime: h = 20
|
|
535
539
|
} = e, f = i(() => {
|
|
536
540
|
s && (w.info("Are you there timer expired. Calling callback"), s == null || s());
|
|
537
|
-
}, [s]),
|
|
541
|
+
}, [s]), l = i(() => {
|
|
538
542
|
o && (w.info("Idle timer expired. Calling callback"), o == null || o());
|
|
539
|
-
}, [o]),
|
|
540
|
-
r && (r.restart(),
|
|
541
|
-
}, [r,
|
|
542
|
-
r && (r.reset(),
|
|
543
|
-
}, [r,
|
|
544
|
-
return
|
|
543
|
+
}, [o]), d = i(() => {
|
|
544
|
+
r && (r.restart(), c == null || c());
|
|
545
|
+
}, [r, c]), v = i(() => {
|
|
546
|
+
r && (r.reset(), c == null || c());
|
|
547
|
+
}, [r, c]);
|
|
548
|
+
return Y(() => {
|
|
545
549
|
if (t) {
|
|
546
550
|
w.info("Nozzle is available. Creating timers");
|
|
547
|
-
const b =
|
|
551
|
+
const b = Se.createTimer(
|
|
548
552
|
`${e.prefix ?? ""}idle-timer-${t.path}`,
|
|
549
553
|
h
|
|
550
554
|
);
|
|
551
555
|
return b == null || b.addTimeoutAction({
|
|
552
556
|
name: "idle-timer",
|
|
553
557
|
remainingTime: 0,
|
|
554
|
-
action:
|
|
558
|
+
action: l
|
|
555
559
|
}), b == null || b.addTimeoutAction({
|
|
556
560
|
name: "are-you-there-timer",
|
|
557
|
-
remainingTime:
|
|
561
|
+
remainingTime: m,
|
|
558
562
|
action: f
|
|
559
563
|
}), n(b ?? null), () => {
|
|
560
564
|
b == null || b.reset(), n(null);
|
|
@@ -564,15 +568,15 @@ const Le = (e) => E({
|
|
|
564
568
|
w.info("Nozzle is not available. No timers to clear");
|
|
565
569
|
};
|
|
566
570
|
}, [
|
|
567
|
-
|
|
571
|
+
m,
|
|
568
572
|
h,
|
|
569
573
|
f,
|
|
570
|
-
|
|
574
|
+
l,
|
|
571
575
|
t,
|
|
572
576
|
e.prefix
|
|
573
577
|
]), {
|
|
574
578
|
idleTimer: r,
|
|
575
|
-
restart:
|
|
579
|
+
restart: d,
|
|
576
580
|
pause: v
|
|
577
581
|
};
|
|
578
582
|
}, Dt = ({
|
|
@@ -582,33 +586,33 @@ const Le = (e) => E({
|
|
|
582
586
|
screens: n
|
|
583
587
|
}) => {
|
|
584
588
|
var N, fe, be, ve;
|
|
585
|
-
const [s, o] =
|
|
589
|
+
const [s, o] = I(!1), [c, m] = I(!1), [h, f] = I(!1), { model: l } = C(), [d, v] = I(!1), b = (t == null ? void 0 : t.idleTimeout) ?? 15, a = (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 10, $ = (r == null ? void 0 : r.idleTimeout) ?? (t == null ? void 0 : t.idleTimeout) ?? 10, y = (r == null ? void 0 : r.areYouThereTimeoutOffset) ?? (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 5, H = n == null ? void 0 : n.ambientTimeoutOffset, B = n == null ? void 0 : n.attractTimeout, K = i(() => {
|
|
586
590
|
o(!0);
|
|
587
591
|
}, []), V = i(() => {
|
|
588
592
|
o(!1), e == null || e.nav.home();
|
|
589
593
|
}, [(N = e == null ? void 0 : e.nav) == null ? void 0 : N.home]), z = i(() => {
|
|
590
|
-
H && (
|
|
594
|
+
H && (m(!0), f(!1));
|
|
591
595
|
}, [H]), ee = i(() => {
|
|
592
|
-
|
|
593
|
-
}, [
|
|
594
|
-
|
|
595
|
-
}, [e == null ? void 0 : e.nav,
|
|
596
|
-
pause:
|
|
596
|
+
B && (f(!0), m(!1));
|
|
597
|
+
}, [B]), te = i(() => {
|
|
598
|
+
B && (f(!1), m(!1), e == null || e.nav.home());
|
|
599
|
+
}, [e == null ? void 0 : e.nav, B]), {
|
|
600
|
+
pause: A,
|
|
597
601
|
restart: D,
|
|
598
602
|
resume: se,
|
|
599
|
-
attractTimer:
|
|
603
|
+
attractTimer: O
|
|
600
604
|
} = ht({
|
|
601
605
|
defaultAmbientTime: H,
|
|
602
|
-
defaultAttractTime:
|
|
606
|
+
defaultAttractTime: B,
|
|
603
607
|
onAmbientTimer: z,
|
|
604
608
|
onAttractTimer: ee,
|
|
605
609
|
onResumeAttractTimer: te
|
|
606
610
|
});
|
|
607
|
-
(fe = e == null ? void 0 : e.timers) == null || fe.add(
|
|
608
|
-
const { pause:
|
|
611
|
+
(fe = e == null ? void 0 : e.timers) == null || fe.add(O);
|
|
612
|
+
const { pause: x, restart: L, idleTimer: re } = Ee({
|
|
609
613
|
defaultAreYouThereTime: a,
|
|
610
614
|
defaultIdleTime: b,
|
|
611
|
-
onAreYouThereTimer:
|
|
615
|
+
onAreYouThereTimer: K,
|
|
612
616
|
onIdleTimer: V
|
|
613
617
|
});
|
|
614
618
|
(be = e == null ? void 0 : e.timers) == null || be.add(re);
|
|
@@ -619,30 +623,30 @@ const Le = (e) => E({
|
|
|
619
623
|
} = Ee({
|
|
620
624
|
defaultAreYouThereTime: y,
|
|
621
625
|
defaultIdleTime: $,
|
|
622
|
-
onAreYouThereTimer:
|
|
626
|
+
onAreYouThereTimer: K,
|
|
623
627
|
onIdleTimer: V,
|
|
624
628
|
prefix: "pour-"
|
|
625
629
|
});
|
|
626
630
|
(ve = e == null ? void 0 : e.timers) == null || ve.add(ne);
|
|
627
631
|
const oe = i(() => {
|
|
628
|
-
v(!1), g(),
|
|
629
|
-
}, [
|
|
630
|
-
v(!0), console.log("restarting pour timer"), M(),
|
|
631
|
-
}, [
|
|
632
|
+
v(!1), g(), x();
|
|
633
|
+
}, [x, g]), ae = i(() => {
|
|
634
|
+
v(!0), console.log("restarting pour timer"), M(), x();
|
|
635
|
+
}, [x, M]), ie = i(() => {
|
|
632
636
|
v(!1), console.log("restarting pour timer on before pour rejected"), g(), L();
|
|
633
637
|
}, []), ce = i(() => {
|
|
634
|
-
o(!1),
|
|
635
|
-
}, [
|
|
636
|
-
|
|
637
|
-
}, [
|
|
638
|
-
f(!1),
|
|
638
|
+
o(!1), d ? (M(), x()) : (L(), g());
|
|
639
|
+
}, [d, x, g, L, M]), de = i(() => {
|
|
640
|
+
A(), f(!1), m(!1), L();
|
|
641
|
+
}, [A, L]), he = i(() => {
|
|
642
|
+
f(!1), m(!1), v(!1), g(), D();
|
|
639
643
|
}, [D, g]), W = i(() => {
|
|
640
|
-
f(!1),
|
|
641
|
-
}, [
|
|
642
|
-
f(!1),
|
|
643
|
-
}, [D,
|
|
644
|
-
f(!1),
|
|
645
|
-
}, [D,
|
|
644
|
+
f(!1), m(!1), v(!1), A(), L();
|
|
645
|
+
}, [A, L]), q = i(() => {
|
|
646
|
+
f(!1), m(!1), v(!1), D(), x(), g();
|
|
647
|
+
}, [D, x, g]), J = i(() => {
|
|
648
|
+
f(!1), m(!1), D(), x();
|
|
649
|
+
}, [D, x]);
|
|
646
650
|
bt({
|
|
647
651
|
onBrandSelected: de,
|
|
648
652
|
onBrandCleared: he,
|
|
@@ -653,21 +657,21 @@ const Le = (e) => E({
|
|
|
653
657
|
onBeforePourRejected: ie,
|
|
654
658
|
onInit: J
|
|
655
659
|
});
|
|
656
|
-
const
|
|
657
|
-
return
|
|
658
|
-
if (
|
|
659
|
-
const
|
|
660
|
-
T.publish(
|
|
660
|
+
const p = d ? y : a;
|
|
661
|
+
return Y(() => {
|
|
662
|
+
if (l && O) {
|
|
663
|
+
const Ze = `/kos/dispense/${l == null ? void 0 : l.path}/init/`;
|
|
664
|
+
T.publish(Ze, {});
|
|
661
665
|
}
|
|
662
|
-
}, [
|
|
666
|
+
}, [l, O]), {
|
|
663
667
|
showAreYouThere: s,
|
|
664
668
|
clearAreYouThere: ce,
|
|
665
|
-
areYouThereCountdown:
|
|
666
|
-
showAmbientScreen:
|
|
669
|
+
areYouThereCountdown: p,
|
|
670
|
+
showAmbientScreen: c,
|
|
667
671
|
showAttractScreen: h,
|
|
668
672
|
pauseScreenTimer: se
|
|
669
673
|
};
|
|
670
|
-
},
|
|
674
|
+
}, ye = () => {
|
|
671
675
|
const e = ge.type;
|
|
672
676
|
return E({
|
|
673
677
|
modelId: e,
|
|
@@ -677,22 +681,22 @@ const Le = (e) => E({
|
|
|
677
681
|
};
|
|
678
682
|
function Rt(e) {
|
|
679
683
|
return (t) => {
|
|
680
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
684
|
+
const { model: r, status: n, KosModelLoader: s } = ye();
|
|
681
685
|
return /* @__PURE__ */ u(s, { ...n, children: /* @__PURE__ */ u(e, { ...t, deviceAssembly: r }) });
|
|
682
686
|
};
|
|
683
687
|
}
|
|
684
|
-
const
|
|
688
|
+
const Me = (e) => E({
|
|
685
689
|
modelId: e,
|
|
686
690
|
modelType: ot.type,
|
|
687
691
|
options: {}
|
|
688
692
|
});
|
|
689
693
|
function yt(e, t) {
|
|
690
694
|
return (r) => {
|
|
691
|
-
const { model: n, status: s, KosModelLoader: o } =
|
|
695
|
+
const { model: n, status: s, KosModelLoader: o } = Me(e);
|
|
692
696
|
return /* @__PURE__ */ u(o, { ...s, children: /* @__PURE__ */ u(t, { ...r, holder: n }) });
|
|
693
697
|
};
|
|
694
698
|
}
|
|
695
|
-
const
|
|
699
|
+
const Ye = () => {
|
|
696
700
|
const e = Te.type;
|
|
697
701
|
return E({
|
|
698
702
|
modelId: e,
|
|
@@ -702,11 +706,11 @@ const Me = () => {
|
|
|
702
706
|
};
|
|
703
707
|
function Mt(e) {
|
|
704
708
|
return (t) => {
|
|
705
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
709
|
+
const { model: r, status: n, KosModelLoader: s } = Ye();
|
|
706
710
|
return /* @__PURE__ */ u(s, { ...n, children: /* @__PURE__ */ u(e, { ...t, holderContainer: r }) });
|
|
707
711
|
};
|
|
708
712
|
}
|
|
709
|
-
const
|
|
713
|
+
const Oe = () => {
|
|
710
714
|
const e = Ie.type;
|
|
711
715
|
return E({
|
|
712
716
|
modelId: e,
|
|
@@ -746,7 +750,7 @@ const Ye = () => {
|
|
|
746
750
|
le.debug(
|
|
747
751
|
`[${n == null ? void 0 : n.name}] - Pour initiate ended called for nozzle ${r == null ? void 0 : r.id}.`
|
|
748
752
|
), (h = n == null ? void 0 : n.initiateEnded) == null || h.call(n, r), t == null || t();
|
|
749
|
-
}, [t, r, n]),
|
|
753
|
+
}, [t, r, n]), c = i(() => {
|
|
750
754
|
le.debug(`Force cancelling pour for nozzle ${r == null ? void 0 : r.id}.`), r == null || r.cancelPour(), t == null || t();
|
|
751
755
|
}, [t, r]);
|
|
752
756
|
return {
|
|
@@ -754,17 +758,17 @@ const Ye = () => {
|
|
|
754
758
|
onPressed: s,
|
|
755
759
|
onRelease: o
|
|
756
760
|
}).dom,
|
|
757
|
-
cancel:
|
|
761
|
+
cancel: c,
|
|
758
762
|
status: r
|
|
759
763
|
};
|
|
760
764
|
};
|
|
761
765
|
function Ot(e) {
|
|
762
766
|
return (t) => {
|
|
763
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
767
|
+
const { model: r, status: n, KosModelLoader: s } = Oe();
|
|
764
768
|
return /* @__PURE__ */ u(s, { ...n, children: /* @__PURE__ */ u(e, { ...t, ingredient: r }) });
|
|
765
769
|
};
|
|
766
770
|
}
|
|
767
|
-
const
|
|
771
|
+
const _e = () => {
|
|
768
772
|
const e = Ae.type;
|
|
769
773
|
return E({
|
|
770
774
|
modelId: e,
|
|
@@ -772,19 +776,19 @@ const Oe = () => {
|
|
|
772
776
|
options: {}
|
|
773
777
|
});
|
|
774
778
|
};
|
|
775
|
-
function
|
|
779
|
+
function _t(e) {
|
|
776
780
|
return (t) => {
|
|
777
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
781
|
+
const { model: r, status: n, KosModelLoader: s } = _e();
|
|
778
782
|
return /* @__PURE__ */ u(s, { ...n, children: /* @__PURE__ */ u(e, { ...t, ingredientContainer: r }) });
|
|
779
783
|
};
|
|
780
784
|
}
|
|
781
|
-
function
|
|
785
|
+
function Gt(e, t) {
|
|
782
786
|
return (r) => {
|
|
783
|
-
const { model: n, status: s, KosModelLoader: o } =
|
|
787
|
+
const { model: n, status: s, KosModelLoader: o } = Ce(e);
|
|
784
788
|
return /* @__PURE__ */ u(o, { ...s, children: /* @__PURE__ */ u(t, { ...r, nozzle: n }) });
|
|
785
789
|
};
|
|
786
790
|
}
|
|
787
|
-
const
|
|
791
|
+
const F = w.createLogger({
|
|
788
792
|
name: "usePour",
|
|
789
793
|
group: "kos-hooks"
|
|
790
794
|
}), jt = ({
|
|
@@ -793,59 +797,59 @@ const j = w.createLogger({
|
|
|
793
797
|
onPourCancel: r,
|
|
794
798
|
onPourAbort: n,
|
|
795
799
|
pourTarget: s,
|
|
796
|
-
strategy: o =
|
|
800
|
+
strategy: o = Re
|
|
797
801
|
}) => {
|
|
798
|
-
const
|
|
799
|
-
|
|
802
|
+
const c = i(async () => {
|
|
803
|
+
F.debug(
|
|
800
804
|
`[${o == null ? void 0 : o.name}] - calling before pour for pour target ${s == null ? void 0 : s.id}.`
|
|
801
|
-
), (e ? await (e == null ? void 0 : e()) : !0) ? (
|
|
805
|
+
), (e ? await (e == null ? void 0 : e()) : !0) ? (F.debug(
|
|
802
806
|
`[${o == null ? void 0 : o.name}] - Pour initiated for pour target ${s == null ? void 0 : s.id}.`
|
|
803
|
-
), await (o == null ? void 0 : o.initiate(s)), t == null || t(), s != null && s.isPouring || n == null || n()) : (
|
|
807
|
+
), await (o == null ? void 0 : o.initiate(s)), t == null || t(), s != null && s.isPouring || n == null || n()) : (F.debug(
|
|
804
808
|
`[${o == null ? void 0 : o.name}] - Pour cancelled for pour target ${s == null ? void 0 : s.id}.`
|
|
805
809
|
), r == null || r());
|
|
806
|
-
}, [t, s, o]),
|
|
807
|
-
var
|
|
808
|
-
|
|
810
|
+
}, [t, s, o]), m = i(async () => {
|
|
811
|
+
var d;
|
|
812
|
+
F.debug(
|
|
809
813
|
`[${o == null ? void 0 : o.name}] - Pour initiate ended called for pour target ${s == null ? void 0 : s.id}.`
|
|
810
|
-
), await ((
|
|
814
|
+
), await ((d = o == null ? void 0 : o.initiateEnded) == null ? void 0 : d.call(o, s)) || r == null || r();
|
|
811
815
|
}, [r, s, o]), h = i(async () => {
|
|
812
|
-
|
|
816
|
+
F.debug(`Force cancelling pour for pour target ${s == null ? void 0 : s.id}.`), await (s == null ? void 0 : s.cancelPour()), r == null || r();
|
|
813
817
|
}, [r, s]);
|
|
814
818
|
return {
|
|
815
819
|
handlers: me({
|
|
816
|
-
onPressed:
|
|
817
|
-
onRelease:
|
|
820
|
+
onPressed: c,
|
|
821
|
+
onRelease: m
|
|
818
822
|
}).dom,
|
|
819
823
|
cancel: h,
|
|
820
824
|
status: s
|
|
821
825
|
};
|
|
822
|
-
},
|
|
826
|
+
}, U = w.createLogger({
|
|
823
827
|
name: "TapOrHoldIntentStrategy",
|
|
824
828
|
group: "kos-hooks"
|
|
825
829
|
});
|
|
826
830
|
class Ft {
|
|
827
831
|
constructor(t) {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
+
_(this, "intent");
|
|
833
|
+
_(this, "name", "TapOrHoldIntentStrategy");
|
|
834
|
+
_(this, "isHold", !1);
|
|
835
|
+
_(this, "disposer", null);
|
|
832
836
|
this.intent = t;
|
|
833
837
|
}
|
|
834
838
|
async initiate(t, r) {
|
|
835
839
|
if (this.disposer = setTimeout(() => {
|
|
836
840
|
this.isHold = !0;
|
|
837
841
|
}, 250), t != null && t.isPouring && !this.isHold) {
|
|
838
|
-
|
|
842
|
+
U.debug("additional tap detected. cancelling pour"), await t.cancelPour();
|
|
839
843
|
return;
|
|
840
844
|
}
|
|
841
845
|
if (!(t != null && t.canPour)) {
|
|
842
|
-
|
|
846
|
+
U.debug(`${t == null ? void 0 : t.id} cannot pour. Returning early.`);
|
|
843
847
|
return;
|
|
844
848
|
}
|
|
845
|
-
r ? (
|
|
849
|
+
r ? (U.debug(`performing intent: ${r}`), await (t == null ? void 0 : t.performIntent(r))) : U.debug("no intent provided. Returning early.");
|
|
846
850
|
}
|
|
847
851
|
async initiateEnded(t) {
|
|
848
|
-
return this.disposer && clearTimeout(this.disposer), this.disposer = null, this.isHold ? (await (t == null ? void 0 : t.cancelPour()), !1) : (
|
|
852
|
+
return this.disposer && clearTimeout(this.disposer), this.disposer = null, this.isHold ? (await (t == null ? void 0 : t.cancelPour()), !1) : (U.debug("Tap detected. don't cancel and return."), !0);
|
|
849
853
|
}
|
|
850
854
|
}
|
|
851
855
|
const Z = w.createLogger({
|
|
@@ -905,7 +909,7 @@ function Wt(e) {
|
|
|
905
909
|
};
|
|
906
910
|
}
|
|
907
911
|
const Ge = S(void 0), qt = ({ children: e }) => {
|
|
908
|
-
const { model: t, ready: r } =
|
|
912
|
+
const { model: t, ready: r } = Ne(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
909
913
|
return /* @__PURE__ */ u(Ge.Provider, { value: n, children: e });
|
|
910
914
|
}, Jt = () => {
|
|
911
915
|
const e = k(
|
|
@@ -916,47 +920,47 @@ const Ge = S(void 0), qt = ({ children: e }) => {
|
|
|
916
920
|
"useAssemblyContext must be used within a AssemblyProvider"
|
|
917
921
|
);
|
|
918
922
|
return e;
|
|
919
|
-
},
|
|
920
|
-
const { model: t, ready: r } =
|
|
921
|
-
return /* @__PURE__ */ u(
|
|
923
|
+
}, je = S(void 0), Qt = ({ children: e }) => {
|
|
924
|
+
const { model: t, ready: r } = Be(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
925
|
+
return /* @__PURE__ */ u(je.Provider, { value: n, children: e });
|
|
922
926
|
}, Xt = () => {
|
|
923
|
-
const e = k(
|
|
927
|
+
const e = k(je);
|
|
924
928
|
if (!e)
|
|
925
929
|
throw new Error(
|
|
926
930
|
"useAvailabilityContext must be used within a AvailabilityProvider"
|
|
927
931
|
);
|
|
928
932
|
return e;
|
|
929
|
-
},
|
|
933
|
+
}, Fe = S(void 0), Zt = ({ children: e, id: t }) => {
|
|
930
934
|
const { model: r, ready: n } = Ke(t), s = P(() => n && r ? { model: r } : {}, [n, r]);
|
|
931
|
-
return /* @__PURE__ */ u(
|
|
935
|
+
return /* @__PURE__ */ u(Fe.Provider, { value: s, children: e });
|
|
932
936
|
}, zt = () => {
|
|
933
|
-
const e = k(
|
|
937
|
+
const e = k(Fe);
|
|
934
938
|
if (!e)
|
|
935
939
|
throw new Error("useBoardContext must be used within a BoardProvider");
|
|
936
940
|
return e;
|
|
937
|
-
},
|
|
938
|
-
const { model: t, ready: r } =
|
|
939
|
-
return /* @__PURE__ */ u(
|
|
941
|
+
}, Ue = S(void 0), es = ({ children: e }) => {
|
|
942
|
+
const { model: t, ready: r } = Le(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
943
|
+
return /* @__PURE__ */ u(Ue.Provider, { value: n, children: e });
|
|
940
944
|
}, ts = () => {
|
|
941
|
-
const e = k(
|
|
945
|
+
const e = k(Ue);
|
|
942
946
|
if (!e)
|
|
943
947
|
throw new Error(
|
|
944
948
|
"useBoardContainerContext must be used within a BoardContainerProvider"
|
|
945
949
|
);
|
|
946
950
|
return e;
|
|
947
|
-
},
|
|
951
|
+
}, Ve = S(
|
|
948
952
|
void 0
|
|
949
953
|
), wt = ({ children: e }) => {
|
|
950
|
-
const { model: t, ready: r } =
|
|
954
|
+
const { model: t, ready: r } = ye(), n = P(() => {
|
|
951
955
|
if (r && t) {
|
|
952
956
|
const o = t.nozzlePaths;
|
|
953
957
|
return { model: t, nozzlePaths: o };
|
|
954
958
|
}
|
|
955
959
|
return {};
|
|
956
960
|
}, [r, t]), s = r && t ? e : null;
|
|
957
|
-
return /* @__PURE__ */ u(
|
|
961
|
+
return /* @__PURE__ */ u(Ve.Provider, { value: n, children: s });
|
|
958
962
|
}, Pt = () => {
|
|
959
|
-
const e = k(
|
|
963
|
+
const e = k(Ve);
|
|
960
964
|
if (!e)
|
|
961
965
|
throw new Error(
|
|
962
966
|
"useDeviceAssemblyContext must be used within a DeviceAssemblyProvider"
|
|
@@ -1011,43 +1015,43 @@ function ss(e) {
|
|
|
1011
1015
|
At({ provider: r, props: e })
|
|
1012
1016
|
];
|
|
1013
1017
|
}
|
|
1014
|
-
const
|
|
1015
|
-
const { model: r, ready: n } =
|
|
1016
|
-
return /* @__PURE__ */ u(
|
|
1018
|
+
const We = S(void 0), rs = ({ children: e, id: t }) => {
|
|
1019
|
+
const { model: r, ready: n } = Me(t || ""), s = P(() => n && r ? { model: r } : {}, [n, r]);
|
|
1020
|
+
return /* @__PURE__ */ u(We.Provider, { value: s, children: e });
|
|
1017
1021
|
}, ns = () => {
|
|
1018
|
-
const e = k(
|
|
1022
|
+
const e = k(We);
|
|
1019
1023
|
if (!e)
|
|
1020
1024
|
throw new Error("useHolderContext must be used within a HolderProvider");
|
|
1021
1025
|
return e;
|
|
1022
|
-
},
|
|
1026
|
+
}, qe = S(
|
|
1023
1027
|
void 0
|
|
1024
1028
|
), os = ({ children: e }) => {
|
|
1025
|
-
const { model: t, ready: r } =
|
|
1026
|
-
return /* @__PURE__ */ u(
|
|
1029
|
+
const { model: t, ready: r } = Ye(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
1030
|
+
return /* @__PURE__ */ u(qe.Provider, { value: n, children: e });
|
|
1027
1031
|
}, as = () => {
|
|
1028
|
-
const e = k(
|
|
1032
|
+
const e = k(qe);
|
|
1029
1033
|
if (!e)
|
|
1030
1034
|
throw new Error(
|
|
1031
1035
|
"useHolderContainerContext must be used within a HolderContainerProvider"
|
|
1032
1036
|
);
|
|
1033
1037
|
return e;
|
|
1034
|
-
},
|
|
1035
|
-
const { model: t, ready: r } =
|
|
1036
|
-
return /* @__PURE__ */ u(
|
|
1038
|
+
}, Je = S(void 0), is = ({ children: e }) => {
|
|
1039
|
+
const { model: t, ready: r } = Oe(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
1040
|
+
return /* @__PURE__ */ u(Je.Provider, { value: n, children: e });
|
|
1037
1041
|
}, cs = () => {
|
|
1038
|
-
const e = k(
|
|
1042
|
+
const e = k(Je);
|
|
1039
1043
|
if (!e)
|
|
1040
1044
|
throw new Error(
|
|
1041
1045
|
"useIngredientContext must be used within a IngredientProvider"
|
|
1042
1046
|
);
|
|
1043
1047
|
return e;
|
|
1044
|
-
},
|
|
1048
|
+
}, Qe = S(
|
|
1045
1049
|
void 0
|
|
1046
1050
|
), ds = ({ children: e }) => {
|
|
1047
|
-
const { model: t, ready: r } =
|
|
1048
|
-
return /* @__PURE__ */ u(
|
|
1051
|
+
const { model: t, ready: r } = _e(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
1052
|
+
return /* @__PURE__ */ u(Qe.Provider, { value: n, children: e });
|
|
1049
1053
|
}, us = () => {
|
|
1050
|
-
const e = k(
|
|
1054
|
+
const e = k(Qe);
|
|
1051
1055
|
if (!e)
|
|
1052
1056
|
throw new Error(
|
|
1053
1057
|
"useIngredientContainerContext must be used within a IngredientContainerProvider"
|
|
@@ -1060,17 +1064,17 @@ const Ve = S(void 0), rs = ({ children: e, id: t }) => {
|
|
|
1060
1064
|
modelType: xe.type,
|
|
1061
1065
|
options: {}
|
|
1062
1066
|
});
|
|
1063
|
-
},
|
|
1067
|
+
}, Xe = S(void 0), ls = ({ children: e }) => {
|
|
1064
1068
|
const { model: t, ready: r } = xt(), n = P(() => r && t ? { model: t } : {}, [r, t]);
|
|
1065
|
-
return /* @__PURE__ */ u(
|
|
1069
|
+
return /* @__PURE__ */ u(Xe.Provider, { value: n, children: e });
|
|
1066
1070
|
}, ps = () => {
|
|
1067
|
-
const e = k(
|
|
1071
|
+
const e = k(Xe);
|
|
1068
1072
|
if (!e)
|
|
1069
1073
|
throw new Error("usePumpContext must be used within a PumpProvider");
|
|
1070
1074
|
return e;
|
|
1071
1075
|
};
|
|
1072
1076
|
export {
|
|
1073
|
-
|
|
1077
|
+
_t as $,
|
|
1074
1078
|
qt as A,
|
|
1075
1079
|
Zt as B,
|
|
1076
1080
|
Tt as C,
|
|
@@ -1080,7 +1084,7 @@ export {
|
|
|
1080
1084
|
X as G,
|
|
1081
1085
|
rs as H,
|
|
1082
1086
|
is as I,
|
|
1083
|
-
|
|
1087
|
+
j as J,
|
|
1084
1088
|
mt as K,
|
|
1085
1089
|
Dt as L,
|
|
1086
1090
|
bt as M,
|
|
@@ -1088,23 +1092,23 @@ export {
|
|
|
1088
1092
|
Ee as O,
|
|
1089
1093
|
ls as P,
|
|
1090
1094
|
pt as Q,
|
|
1091
|
-
|
|
1095
|
+
ye as R,
|
|
1092
1096
|
Rt as S,
|
|
1093
|
-
|
|
1097
|
+
Me as T,
|
|
1094
1098
|
yt as U,
|
|
1095
|
-
|
|
1099
|
+
Ye as V,
|
|
1096
1100
|
Mt as W,
|
|
1097
|
-
|
|
1101
|
+
Oe as X,
|
|
1098
1102
|
Yt as Y,
|
|
1099
1103
|
Ot as Z,
|
|
1100
|
-
|
|
1104
|
+
_e as _,
|
|
1101
1105
|
Qt as a,
|
|
1102
|
-
|
|
1103
|
-
|
|
1106
|
+
Ce as a0,
|
|
1107
|
+
Gt as a1,
|
|
1104
1108
|
lt as a2,
|
|
1105
1109
|
jt as a3,
|
|
1106
1110
|
vt as a4,
|
|
1107
|
-
|
|
1111
|
+
Re as a5,
|
|
1108
1112
|
Ft as a6,
|
|
1109
1113
|
Ut as a7,
|
|
1110
1114
|
Vt as a8,
|
|
@@ -1125,15 +1129,15 @@ export {
|
|
|
1125
1129
|
us as n,
|
|
1126
1130
|
C as o,
|
|
1127
1131
|
ps as p,
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1132
|
+
Ne as q,
|
|
1133
|
+
Be as r,
|
|
1134
|
+
Kt as s,
|
|
1131
1135
|
Ke as t,
|
|
1132
1136
|
Jt as u,
|
|
1133
1137
|
Lt as v,
|
|
1134
|
-
|
|
1135
|
-
|
|
1138
|
+
Bt as w,
|
|
1139
|
+
Le as x,
|
|
1136
1140
|
Ct as y,
|
|
1137
1141
|
ct as z
|
|
1138
1142
|
};
|
|
1139
|
-
//# sourceMappingURL=pump-provider-
|
|
1143
|
+
//# sourceMappingURL=pump-provider-0z7R7MK1.js.map
|