@kosdev-code/kos-freestyle-sdk 2.1.16 → 2.1.18
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/extension-utils-BUUtrM-T.cjs +2 -0
- package/{extension-utils-BVDLwtKr.cjs.map → extension-utils-BUUtrM-T.cjs.map} +1 -1
- package/extension-utils-sj0P_x9E.js +220 -0
- package/{extension-utils-BE0Y1Zlv.js.map → extension-utils-sj0P_x9E.js.map} +1 -1
- package/freestyle-registration-manager-DSugLmqT.js +1739 -0
- package/freestyle-registration-manager-DSugLmqT.js.map +1 -0
- package/freestyle-registration-manager-rmrOsUZq.cjs +2 -0
- package/freestyle-registration-manager-rmrOsUZq.cjs.map +1 -0
- package/index.cjs +1 -1
- package/index.js +34 -27
- package/models/models/carb-agitator/carb-agitator-model.d.ts +38 -6
- package/models/models/carb-agitator/carb-agitator-model.d.ts.map +1 -1
- package/models/models/carb-agitator/index.d.ts +1 -1
- package/models/models/carb-agitator/index.d.ts.map +1 -1
- package/models/models/carb-agitator/services/carb-tank-services.d.ts +4 -0
- package/models/models/carb-agitator/services/carb-tank-services.d.ts.map +1 -0
- package/models/models/carb-agitator/types/index.d.ts +1 -8
- package/models/models/cgp-pump/cgp-pump-model.d.ts +24 -0
- package/models/models/cgp-pump/cgp-pump-model.d.ts.map +1 -0
- package/models/models/cgp-pump/index.d.ts +4 -0
- package/models/models/cgp-pump/index.d.ts.map +1 -0
- package/models/models/cgp-pump/types/index.d.ts +5 -0
- package/models/models/fcm-pump/fcm-pump-model.d.ts +28 -0
- package/models/models/fcm-pump/fcm-pump-model.d.ts.map +1 -0
- package/models/models/{carb-agitator/carb-agitator-registration.d.ts → fcm-pump/fcm-pump-registration.d.ts} +23 -20
- package/models/models/fcm-pump/fcm-pump-registration.d.ts.map +1 -0
- package/models/models/fcm-pump/index.d.ts +5 -0
- package/models/models/fcm-pump/index.d.ts.map +1 -0
- package/models/models/fcm-pump/services/fcm-pump-services.d.ts +17 -0
- package/models/models/fcm-pump/services/fcm-pump-services.d.ts.map +1 -0
- package/models/models/fcm-pump/services/index.d.ts +2 -0
- package/models/models/fcm-pump/services/index.d.ts.map +1 -0
- package/models/models/fcm-pump/types/index.d.ts +5 -0
- package/models/models/freestyle-assembly/freestyle-assembly-model.d.ts +4 -2
- package/models/models/freestyle-assembly/freestyle-assembly-model.d.ts.map +1 -1
- package/models/models/index.d.ts +4 -0
- package/models/models/index.d.ts.map +1 -1
- package/models/models/lfcv-pump/index.d.ts +5 -0
- package/models/models/lfcv-pump/index.d.ts.map +1 -0
- package/models/models/lfcv-pump/lfcv-pump-model.d.ts +20 -0
- package/models/models/lfcv-pump/lfcv-pump-model.d.ts.map +1 -0
- package/models/models/lfcv-pump/lfcv-pump-registration.d.ts +87 -0
- package/models/models/lfcv-pump/lfcv-pump-registration.d.ts.map +1 -0
- package/models/models/lfcv-pump/services/index.d.ts +2 -0
- package/models/models/lfcv-pump/services/index.d.ts.map +1 -0
- package/models/models/lfcv-pump/services/lfcv-pump-services.d.ts +10 -0
- package/models/models/lfcv-pump/services/lfcv-pump-services.d.ts.map +1 -0
- package/models/models/lfcv-pump/types/index.d.ts +5 -0
- package/models/models/spm-pump/index.d.ts +5 -0
- package/models/models/spm-pump/index.d.ts.map +1 -0
- package/models/models/spm-pump/services/index.d.ts +2 -0
- package/models/models/spm-pump/services/index.d.ts.map +1 -0
- package/models/models/spm-pump/services/spm-pump-services.d.ts +7 -0
- package/models/models/spm-pump/services/spm-pump-services.d.ts.map +1 -0
- package/models/models/spm-pump/spm-pump-model.d.ts +26 -0
- package/models/models/spm-pump/spm-pump-model.d.ts.map +1 -0
- package/models/models/spm-pump/spm-pump-registration.d.ts +87 -0
- package/models/models/spm-pump/spm-pump-registration.d.ts.map +1 -0
- package/models/models/spm-pump/types/index.d.ts +5 -0
- package/models/models/types/assembly.d.ts +7 -3
- package/models/models/types/assembly.d.ts.map +1 -1
- package/models/utils/extensions/assembly/assembly-data-mapper.d.ts +1 -5
- package/models/utils/extensions/assembly/assembly-data-mapper.d.ts.map +1 -1
- package/models/utils/freestyle-registration-manager.d.ts.map +1 -1
- package/models.cjs +1 -1
- package/models.js +27 -20
- package/package.json +2 -2
- package/ui.cjs +1 -1
- package/ui.js +2 -2
- package/{use-nutrition-info-DjIGT-mE.cjs → use-nutrition-info-DSdA_SRp.cjs} +2 -2
- package/{use-nutrition-info-DjIGT-mE.cjs.map → use-nutrition-info-DSdA_SRp.cjs.map} +1 -1
- package/{use-nutrition-info-CjXNGbCN.js → use-nutrition-info-DtcZs7dL.js} +5 -5
- package/{use-nutrition-info-CjXNGbCN.js.map → use-nutrition-info-DtcZs7dL.js.map} +1 -1
- package/extension-utils-BE0Y1Zlv.js +0 -201
- package/extension-utils-BVDLwtKr.cjs +0 -2
- package/freestyle-registration-manager-CDbljuRk.cjs +0 -2
- package/freestyle-registration-manager-CDbljuRk.cjs.map +0 -1
- package/freestyle-registration-manager-z0aYdMcC.js +0 -1069
- package/freestyle-registration-manager-z0aYdMcC.js.map +0 -1
- package/models/models/carb-agitator/carb-agitator-registration.d.ts.map +0 -1
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import { RemoteTrayContainerModel } from '../remote-tray';
|
|
2
2
|
import { IceAgitatorModel } from '../ice-agitator';
|
|
3
3
|
import { CartridgeAgitatorContainerModel } from '../cartridge-agitator';
|
|
4
|
-
import {
|
|
4
|
+
import { KosStateProp } from '@kosdev-code/kos-ui-sdk';
|
|
5
5
|
|
|
6
6
|
export interface FreestyleHolderModelExt {
|
|
7
7
|
agitated?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export interface FreestyleModelAssemblyExt {
|
|
10
10
|
iceAgitator: IceAgitatorModel;
|
|
11
|
-
carbAgitator: CarbAgitatorModel;
|
|
12
11
|
cartridgeAgitators: CartridgeAgitatorContainerModel;
|
|
13
12
|
remoteTrays: RemoteTrayContainerModel;
|
|
14
13
|
supportsIce: boolean;
|
|
15
14
|
supportsCarb: boolean;
|
|
16
15
|
}
|
|
17
|
-
export type Agitator = IceAgitatorModel
|
|
16
|
+
export type Agitator = IceAgitatorModel;
|
|
18
17
|
export interface ActiveAware {
|
|
19
18
|
active: boolean;
|
|
20
19
|
}
|
|
20
|
+
export interface ProbeAware {
|
|
21
|
+
highProbeWet: KosStateProp<boolean>;
|
|
22
|
+
lowProbeWet: KosStateProp<boolean>;
|
|
23
|
+
filling: KosStateProp<boolean>;
|
|
24
|
+
}
|
|
21
25
|
//# sourceMappingURL=assembly.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assembly.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-freestyle-sdk/src/models/models/types/assembly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"assembly.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-freestyle-sdk/src/models/models/types/assembly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,kBAAkB,EAAE,+BAA+B,CAAC;IACpD,WAAW,EAAE,wBAAwB,CAAC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AAExC,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAEpC,WAAW,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAEnC,OAAO,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;CAChC"}
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { FreestyleAssemblyResponse } from './types';
|
|
2
2
|
import { FreestyleModelAssemblyExt } from '../../../models/types/assembly';
|
|
3
3
|
import { IceAgitatorModel } from '../../../models/ice-agitator';
|
|
4
|
-
import { CarbAgitatorModel } from '../../../models/carb-agitator';
|
|
5
4
|
import { DataMapper } from '@kosdev-code/kos-ui-sdk';
|
|
6
5
|
|
|
7
|
-
export type AgitatorTypes = "iceAgitator"
|
|
6
|
+
export type AgitatorTypes = "iceAgitator";
|
|
8
7
|
export declare const AGITATOR_KEYS: AgitatorTypes[];
|
|
9
8
|
export declare const AGITATOR_FACTORY_MAP: {
|
|
10
9
|
iceAgitator: (id: string) => (options?: import('../../../models/ice-agitator').IceAgitatorOptions | undefined, parentId?: string | undefined) => IceAgitatorModel;
|
|
11
|
-
carbAgitator: (id: string) => (options?: import('../../../models/carb-agitator').CarbAgitatorOptions | undefined, parentId?: string | undefined) => CarbAgitatorModel;
|
|
12
10
|
};
|
|
13
11
|
export declare const AGITATOR_NAME_MAP: {
|
|
14
12
|
iceAgitator: string;
|
|
15
|
-
carbAgitator: string;
|
|
16
|
-
cartridgeAgitator: string;
|
|
17
13
|
};
|
|
18
14
|
export declare const freestyleAssemblyDataMapper: DataMapper<FreestyleAssemblyResponse, FreestyleModelAssemblyExt>;
|
|
19
15
|
//# sourceMappingURL=assembly-data-mapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assembly-data-mapper.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/extensions/assembly/assembly-data-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"assembly-data-mapper.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/extensions/assembly/assembly-data-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAGzD,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;AAC1C,eAAO,MAAM,aAAa,EAAE,aAAa,EAAoB,CAAC;AAC9D,eAAO,MAAM,oBAAoB;;CAEhC,CAAC;AACF,eAAO,MAAM,iBAAiB;;CAE7B,CAAC;AAIF,eAAO,MAAM,2BAA2B,EAAE,UAAU,CAClD,yBAAyB,EACzB,yBAAyB,CA8D1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"freestyle-registration-manager.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/freestyle-registration-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,IAAI,yBAAyB,EAU9C,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAKL,mBAAmB,EAEnB,KAAK,kBAAkB,EAExB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"freestyle-registration-manager.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-freestyle-sdk/src/models/utils/freestyle-registration-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,IAAI,yBAAyB,EAU9C,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAKL,mBAAmB,EAEnB,KAAK,kBAAkB,EAExB,MAAM,yBAAyB,CAAC;AAgBjC,eAAO,MAAM,uBAAuB,YACxB,CAAC;;;;;CA+GV,CAAC;AAEJ,KAAK,aAAa,CAAC,CAAC,IAAI,OAAO,yBAAyB,GAAG;IACzD,SAAS,EAAE;QAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC,CAAC,CAAC,CAAA;KAAE,CAAC;IACnD,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACnE,KAAK,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7D,SAAS,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;CACtE,CAAC;AAEF,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;CAEtB,CAAC;AAcF,KAAK,oBAAoB,GAAG,aAAa,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEpE,QAAA,MAAM,gBAAgB,EAAE,oBAA+C,CAAC;AAExE,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/models.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./freestyle-registration-manager-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./freestyle-registration-manager-rmrOsUZq.cjs"),r=require("./extension-utils-BUUtrM-T.cjs");require("@kosdev-code/kos-ui-sdk");require("@kosdev-code/kos-dispense-sdk");exports.AGITATION_REQUIRED_TROUBLE=e.AGITATION_REQUIRED_TROUBLE;exports.AgitationRequiredTrouble=e.AgitationRequiredTrouble;exports.CarbAgitator=e.CarbAgitator;exports.CartridgeAgitator=e.CartridgeAgitator;exports.CartridgeAgitatorContainer=e.CartridgeAgitatorContainer;exports.CartridgeAgitatorEvents=e.CartridgeAgitatorEvents;exports.CgpPump=e.CgpPump;exports.FcmPump=e.FcmPump;exports.FreestyleAssembly=e.FreestyleAssembly;exports.FreestyleHolder=e.FreestyleHolder;exports.FreestyleNozzle=e.FreestyleNozzle;exports.FreestylePump=e.FreestylePump;exports.IceAgitator=e.IceAgitator;exports.IceAgitatorEvents=e.IceAgitatorEvents;exports.KosModelRegistry=e.KosModelRegistry;exports.LfcvPump=e.LfcvPump;exports.SpmPump=e.SpmPump;exports.registerFreestyleModels=e.registerFreestyleModels;exports.EXTENSION_PLUGIN_VISIBILITY=r.EXTENSION_PLUGIN_VISIBILITY;exports.FcmPumpServices=r.index;exports.FreestyleExtensionManager=r.FreestyleExtensionManager;exports.FreestyleNozzleServices=r.index$1;exports.FreestylePumpServices=r.index$2;exports.KosExtensionManager=r.KosExtensionManager;exports.LfcvPumpServices=r.index$3;exports.SpmPumpServices=r.index$4;
|
|
2
2
|
//# sourceMappingURL=models.cjs.map
|
package/models.js
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
|
-
import { A as t,
|
|
2
|
-
import { E as
|
|
1
|
+
import { A as t, j as i, C as o, c as m, a as g, b as p, d as l, F as c, e as F, f as I, g as n, h as u, i as A, I as y, K as E, L as P, S, r as d } from "./freestyle-registration-manager-DSugLmqT.js";
|
|
2
|
+
import { E as C, i as L, F as N, a as T, b, K as f, c as R, d as x } from "./extension-utils-sj0P_x9E.js";
|
|
3
3
|
import "@kosdev-code/kos-ui-sdk";
|
|
4
4
|
import "@kosdev-code/kos-dispense-sdk";
|
|
5
5
|
export {
|
|
6
6
|
t as AGITATION_REQUIRED_TROUBLE,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
b as
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
i as AgitationRequiredTrouble,
|
|
8
|
+
o as CarbAgitator,
|
|
9
|
+
m as CartridgeAgitator,
|
|
10
|
+
g as CartridgeAgitatorContainer,
|
|
11
|
+
p as CartridgeAgitatorEvents,
|
|
12
|
+
l as CgpPump,
|
|
13
|
+
C as EXTENSION_PLUGIN_VISIBILITY,
|
|
14
|
+
c as FcmPump,
|
|
15
|
+
L as FcmPumpServices,
|
|
16
|
+
F as FreestyleAssembly,
|
|
17
|
+
N as FreestyleExtensionManager,
|
|
18
|
+
I as FreestyleHolder,
|
|
19
|
+
n as FreestyleNozzle,
|
|
20
|
+
T as FreestyleNozzleServices,
|
|
21
|
+
u as FreestylePump,
|
|
22
|
+
b as FreestylePumpServices,
|
|
23
|
+
A as IceAgitator,
|
|
24
|
+
y as IceAgitatorEvents,
|
|
25
|
+
f as KosExtensionManager,
|
|
26
|
+
E as KosModelRegistry,
|
|
27
|
+
P as LfcvPump,
|
|
28
|
+
R as LfcvPumpServices,
|
|
29
|
+
S as SpmPump,
|
|
30
|
+
x as SpmPumpServices,
|
|
31
|
+
d as registerFreestyleModels
|
|
25
32
|
};
|
|
26
33
|
//# sourceMappingURL=models.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kosdev-code/kos-freestyle-sdk",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"kos": {
|
|
33
33
|
"build": {
|
|
34
|
-
"gitHash": "
|
|
34
|
+
"gitHash": "a67b416c6600353f7483b900351970722d3e3282"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
package/ui.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./use-nutrition-info-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./use-nutrition-info-DSdA_SRp.cjs");require("@kosdev-code/kos-dispense-sdk");require("@kosdev-code/kos-ui-sdk");require("./freestyle-registration-manager-rmrOsUZq.cjs");require("@emotion/react/jsx-runtime");require("react");exports.useFreestyleAssemblyContext=e.useFreestyleAssemblyContext;exports.useFreestyleNozzleContext=e.useFreestyleNozzleContext;exports.useIceAgitator=e.useIceAgitator;exports.useNutritionInfo=e.useNutritionInfo;exports.withIceAgitator=e.withIceAgitator;
|
|
2
2
|
//# sourceMappingURL=ui.cjs.map
|
package/ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as m, a as p, b as u, c as l, w as n } from "./use-nutrition-info-
|
|
1
|
+
import { u as m, a as p, b as u, c as l, w as n } from "./use-nutrition-info-DtcZs7dL.js";
|
|
2
2
|
import "@kosdev-code/kos-dispense-sdk";
|
|
3
3
|
import "@kosdev-code/kos-ui-sdk";
|
|
4
|
-
import "./freestyle-registration-manager-
|
|
4
|
+
import "./freestyle-registration-manager-DSugLmqT.js";
|
|
5
5
|
import "@emotion/react/jsx-runtime";
|
|
6
6
|
import "react";
|
|
7
7
|
export {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const f=require("@kosdev-code/kos-dispense-sdk"),r=require("@kosdev-code/kos-ui-sdk"),i=require("./freestyle-registration-manager-
|
|
2
|
-
//# sourceMappingURL=use-nutrition-info-
|
|
1
|
+
"use strict";const f=require("@kosdev-code/kos-dispense-sdk"),r=require("@kosdev-code/kos-ui-sdk"),i=require("./freestyle-registration-manager-rmrOsUZq.cjs"),c=require("@emotion/react/jsx-runtime"),u=require("react"),d=()=>{const{model:e}=f.useAssemblyContext();return e?r.getKosCompanionModel(e,i.FreestyleAssembly.type):null},y=()=>{const{model:e}=f.useNozzleContext();return e?r.getKosCompanionModel(e,i.FreestyleNozzle.type):null},a=e=>{const t=e;return r.useKosModel({modelId:t,modelType:i.IceAgitator.type,options:{}})};function m(e){return t=>s=>{const{model:n,status:o,KosModelLoader:l}=a(t);return c.jsx(l,{...o,children:c.jsx(e,{...s,iceAgitator:n})})}}const g=(e,t)=>{if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0},z=e=>{const t=y(),[s,n]=u.useState(),o=u.useRef([]);return u.useEffect(()=>{t&&!g(e,o.current)&&(t.cupSizes=e,o.current=e);const l=r.kosAutoEffect(()=>{t&&n(t.nutritionInfo)});return()=>{l()}},[e,t]),s};exports.useFreestyleAssemblyContext=d;exports.useFreestyleNozzleContext=y;exports.useIceAgitator=a;exports.useNutritionInfo=z;exports.withIceAgitator=m;
|
|
2
|
+
//# sourceMappingURL=use-nutrition-info-DSdA_SRp.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-nutrition-info-
|
|
1
|
+
{"version":3,"file":"use-nutrition-info-DSdA_SRp.cjs","sources":["../../../../packages/sdk/kos-freestyle-sdk/src/ui/hooks/freestyle-assembly/use-freestyle-assembly.ts","../../../../packages/sdk/kos-freestyle-sdk/src/ui/hooks/freestyle-nozzle/use-freestyle-nozzle.ts","../../../../packages/sdk/kos-freestyle-sdk/src/ui/hooks/ice-agitator/use-ice-agitator.ts","../../../../packages/sdk/kos-freestyle-sdk/src/ui/hooks/ice-agitator/with-ice-agitator.tsx","../../../../packages/sdk/kos-freestyle-sdk/src/ui/hooks/nutrition/use-nutrition-info.ts"],"sourcesContent":["import { useAssemblyContext } from \"@kosdev-code/kos-dispense-sdk\";\nimport { getKosCompanionModel } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n FreestyleAssembly,\n type FreestyleAssemblyModel,\n} from \"../../../models\";\n\nexport const useFreestyleAssemblyContext =\n (): FreestyleAssemblyModel | null => {\n const { model } = useAssemblyContext();\n\n const freestyleAssembly = model\n ? getKosCompanionModel<FreestyleAssemblyModel>(\n model,\n FreestyleAssembly.type\n )\n : null;\n\n return freestyleAssembly;\n };\n","import { useNozzleContext } from \"@kosdev-code/kos-dispense-sdk\";\nimport { getKosCompanionModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { FreestyleNozzle, type FreestyleNozzleModel } from \"../../../models\";\n\nexport const useFreestyleNozzleContext = (): FreestyleNozzleModel | null => {\n const { model } = useNozzleContext();\n\n const freestyleNozzle = model\n ? getKosCompanionModel<FreestyleNozzleModel>(model, FreestyleNozzle.type)\n : null;\n\n return freestyleNozzle;\n};\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { IceAgitator, type IceAgitatorModel } from \"../../../models\";\n\nexport const useIceAgitator = (id: string) => {\n const modelId = id;\n const result = useKosModel<IceAgitatorModel>({\n modelId,\n modelType: IceAgitator.type,\n options: {},\n });\n\n return result;\n};\n","import { IceAgitatorModel } from \"../../../models\";\nimport { useIceAgitator } from \"./use-ice-agitator\";\n\nexport interface IceAgitatorProps {\n iceAgitator: IceAgitatorModel;\n}\n\nexport function withIceAgitator<T extends IceAgitatorProps = IceAgitatorProps>(\n WrappedComponent: React.ComponentType<T>\n) {\n return (id: string) => (props: Omit<T, keyof IceAgitatorProps>) => {\n const { model, status, KosModelLoader } = useIceAgitator(id);\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} iceAgitator={model} />\n </KosModelLoader>\n );\n };\n}\n","import { kosAutoEffect } from \"@kosdev-code/kos-ui-sdk\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type { FreestyleNozzleServices } from \"../../../models\";\nimport { useFreestyleNozzleContext } from \"../freestyle-nozzle\";\n\n// Custom function to check deep equality of two arrays\nconst arraysEqual = (a: number[], b: number[]): boolean => {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n};\n\nexport const useNutritionInfo = (cupSizes: number[]) => {\n const freestyleNozzle = useFreestyleNozzleContext();\n const [nutritionInfo, setNutritionInfo] =\n useState<FreestyleNozzleServices.FreestyleNutritionInfoResponse>();\n\n // Use a ref to keep track of the previous cupSizes value\n const prevCupSizesRef = useRef<number[]>([]);\n\n useEffect(() => {\n if (freestyleNozzle && !arraysEqual(cupSizes, prevCupSizesRef.current)) {\n freestyleNozzle.cupSizes = cupSizes;\n prevCupSizesRef.current = cupSizes;\n }\n const disposer = kosAutoEffect(() => {\n if (freestyleNozzle) {\n setNutritionInfo(freestyleNozzle.nutritionInfo);\n }\n });\n\n return () => {\n disposer();\n };\n }, [cupSizes, freestyleNozzle]);\n\n return nutritionInfo;\n};\n"],"names":["useFreestyleAssemblyContext","model","useAssemblyContext","getKosCompanionModel","FreestyleAssembly","useFreestyleNozzleContext","useNozzleContext","FreestyleNozzle","useIceAgitator","id","modelId","useKosModel","IceAgitator","withIceAgitator","WrappedComponent","props","status","KosModelLoader","jsx","arraysEqual","a","b","i","useNutritionInfo","cupSizes","freestyleNozzle","nutritionInfo","setNutritionInfo","useState","prevCupSizesRef","useRef","useEffect","disposer","kosAutoEffect"],"mappings":"yNAOaA,EACX,IAAqC,CACnC,KAAM,CAAE,MAAAC,CAAA,EAAUC,qBAAA,EASlB,OAP0BD,EACtBE,EAAAA,qBACEF,EACAG,oBAAkB,IAAA,EAEpB,IAGN,ECfWC,EAA4B,IAAmC,CAC1E,KAAM,CAAE,MAAAJ,CAAA,EAAUK,mBAAA,EAMlB,OAJwBL,EACpBE,EAAAA,qBAA2CF,EAAOM,EAAAA,gBAAgB,IAAI,EACtE,IAGN,ECTaC,EAAkBC,GAAe,CAC5C,MAAMC,EAAUD,EAOhB,OANeE,EAAAA,YAA8B,CAC3C,QAAAD,EACA,UAAWE,EAAAA,YAAY,KACvB,QAAS,CAAA,CAAC,CACX,CAGH,ECLO,SAASC,EACdC,EACA,CACA,OAAQL,GAAgBM,GAA2C,CACjE,KAAM,CAAE,MAAAd,EAAO,OAAAe,EAAQ,eAAAC,CAAA,EAAmBT,EAAeC,CAAE,EAE3D,OACES,EAAAA,IAACD,EAAA,CAAgB,GAAGD,EAClB,SAAAE,EAAAA,IAACJ,GAAkB,GAAIC,EAAa,YAAad,CAAA,CAAO,CAAA,CAC1D,CAEJ,CACF,CCZA,MAAMkB,EAAc,CAACC,EAAaC,IAAyB,CACzD,GAAID,EAAE,SAAWC,EAAE,OAAQ,MAAO,GAClC,QAASC,EAAI,EAAGA,EAAIF,EAAE,OAAQE,IAC5B,GAAIF,EAAEE,CAAC,IAAMD,EAAEC,CAAC,EAAG,MAAO,GAE5B,MAAO,EACT,EAEaC,EAAoBC,GAAuB,CACtD,MAAMC,EAAkBpB,EAAA,EAClB,CAACqB,EAAeC,CAAgB,EACpCC,WAAA,EAGIC,EAAkBC,EAAAA,OAAiB,EAAE,EAE3CC,OAAAA,EAAAA,UAAU,IAAM,CACVN,GAAmB,CAACN,EAAYK,EAAUK,EAAgB,OAAO,IACnEJ,EAAgB,SAAWD,EAC3BK,EAAgB,QAAUL,GAE5B,MAAMQ,EAAWC,EAAAA,cAAc,IAAM,CAC/BR,GACFE,EAAiBF,EAAgB,aAAa,CAElD,CAAC,EAED,MAAO,IAAM,CACXO,EAAA,CACF,CACF,EAAG,CAACR,EAAUC,CAAe,CAAC,EAEvBC,CACT"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { useAssemblyContext as
|
|
1
|
+
import { useAssemblyContext as i, useNozzleContext as f } from "@kosdev-code/kos-dispense-sdk";
|
|
2
2
|
import { getKosCompanionModel as u, useKosModel as c, kosAutoEffect as m } from "@kosdev-code/kos-ui-sdk";
|
|
3
|
-
import {
|
|
3
|
+
import { e as a, g as y, i as d } from "./freestyle-registration-manager-DSugLmqT.js";
|
|
4
4
|
import { jsx as l } from "@emotion/react/jsx-runtime";
|
|
5
5
|
import { useState as p, useRef as z, useEffect as A } from "react";
|
|
6
6
|
const E = () => {
|
|
7
|
-
const { model: e } =
|
|
7
|
+
const { model: e } = i();
|
|
8
8
|
return e ? u(
|
|
9
9
|
e,
|
|
10
10
|
a.type
|
|
11
11
|
) : null;
|
|
12
12
|
}, g = () => {
|
|
13
|
-
const { model: e } =
|
|
13
|
+
const { model: e } = f();
|
|
14
14
|
return e ? u(e, y.type) : null;
|
|
15
15
|
}, I = (e) => c({
|
|
16
16
|
modelId: e,
|
|
@@ -49,4 +49,4 @@ export {
|
|
|
49
49
|
E as u,
|
|
50
50
|
K as w
|
|
51
51
|
};
|
|
52
|
-
//# sourceMappingURL=use-nutrition-info-
|
|
52
|
+
//# sourceMappingURL=use-nutrition-info-DtcZs7dL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-nutrition-info-
|
|
1
|
+
{"version":3,"file":"use-nutrition-info-DtcZs7dL.js","sources":["../../../../packages/sdk/kos-freestyle-sdk/src/ui/hooks/freestyle-assembly/use-freestyle-assembly.ts","../../../../packages/sdk/kos-freestyle-sdk/src/ui/hooks/freestyle-nozzle/use-freestyle-nozzle.ts","../../../../packages/sdk/kos-freestyle-sdk/src/ui/hooks/ice-agitator/use-ice-agitator.ts","../../../../packages/sdk/kos-freestyle-sdk/src/ui/hooks/ice-agitator/with-ice-agitator.tsx","../../../../packages/sdk/kos-freestyle-sdk/src/ui/hooks/nutrition/use-nutrition-info.ts"],"sourcesContent":["import { useAssemblyContext } from \"@kosdev-code/kos-dispense-sdk\";\nimport { getKosCompanionModel } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n FreestyleAssembly,\n type FreestyleAssemblyModel,\n} from \"../../../models\";\n\nexport const useFreestyleAssemblyContext =\n (): FreestyleAssemblyModel | null => {\n const { model } = useAssemblyContext();\n\n const freestyleAssembly = model\n ? getKosCompanionModel<FreestyleAssemblyModel>(\n model,\n FreestyleAssembly.type\n )\n : null;\n\n return freestyleAssembly;\n };\n","import { useNozzleContext } from \"@kosdev-code/kos-dispense-sdk\";\nimport { getKosCompanionModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { FreestyleNozzle, type FreestyleNozzleModel } from \"../../../models\";\n\nexport const useFreestyleNozzleContext = (): FreestyleNozzleModel | null => {\n const { model } = useNozzleContext();\n\n const freestyleNozzle = model\n ? getKosCompanionModel<FreestyleNozzleModel>(model, FreestyleNozzle.type)\n : null;\n\n return freestyleNozzle;\n};\n","import { useKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { IceAgitator, type IceAgitatorModel } from \"../../../models\";\n\nexport const useIceAgitator = (id: string) => {\n const modelId = id;\n const result = useKosModel<IceAgitatorModel>({\n modelId,\n modelType: IceAgitator.type,\n options: {},\n });\n\n return result;\n};\n","import { IceAgitatorModel } from \"../../../models\";\nimport { useIceAgitator } from \"./use-ice-agitator\";\n\nexport interface IceAgitatorProps {\n iceAgitator: IceAgitatorModel;\n}\n\nexport function withIceAgitator<T extends IceAgitatorProps = IceAgitatorProps>(\n WrappedComponent: React.ComponentType<T>\n) {\n return (id: string) => (props: Omit<T, keyof IceAgitatorProps>) => {\n const { model, status, KosModelLoader } = useIceAgitator(id);\n\n return (\n <KosModelLoader {...status}>\n <WrappedComponent {...(props as T)} iceAgitator={model} />\n </KosModelLoader>\n );\n };\n}\n","import { kosAutoEffect } from \"@kosdev-code/kos-ui-sdk\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport type { FreestyleNozzleServices } from \"../../../models\";\nimport { useFreestyleNozzleContext } from \"../freestyle-nozzle\";\n\n// Custom function to check deep equality of two arrays\nconst arraysEqual = (a: number[], b: number[]): boolean => {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n};\n\nexport const useNutritionInfo = (cupSizes: number[]) => {\n const freestyleNozzle = useFreestyleNozzleContext();\n const [nutritionInfo, setNutritionInfo] =\n useState<FreestyleNozzleServices.FreestyleNutritionInfoResponse>();\n\n // Use a ref to keep track of the previous cupSizes value\n const prevCupSizesRef = useRef<number[]>([]);\n\n useEffect(() => {\n if (freestyleNozzle && !arraysEqual(cupSizes, prevCupSizesRef.current)) {\n freestyleNozzle.cupSizes = cupSizes;\n prevCupSizesRef.current = cupSizes;\n }\n const disposer = kosAutoEffect(() => {\n if (freestyleNozzle) {\n setNutritionInfo(freestyleNozzle.nutritionInfo);\n }\n });\n\n return () => {\n disposer();\n };\n }, [cupSizes, freestyleNozzle]);\n\n return nutritionInfo;\n};\n"],"names":["useFreestyleAssemblyContext","model","useAssemblyContext","getKosCompanionModel","FreestyleAssembly","useFreestyleNozzleContext","useNozzleContext","FreestyleNozzle","useIceAgitator","id","useKosModel","IceAgitator","withIceAgitator","WrappedComponent","props","status","KosModelLoader","jsx","arraysEqual","a","b","i","useNutritionInfo","cupSizes","freestyleNozzle","nutritionInfo","setNutritionInfo","useState","prevCupSizesRef","useRef","useEffect","disposer","kosAutoEffect"],"mappings":";;;;;AAOO,MAAMA,IACX,MAAqC;AACnC,QAAM,EAAE,OAAAC,EAAA,IAAUC,EAAA;AASlB,SAP0BD,IACtBE;AAAA,IACEF;AAAA,IACAG,EAAkB;AAAA,EAAA,IAEpB;AAGN,GCfWC,IAA4B,MAAmC;AAC1E,QAAM,EAAE,OAAAJ,EAAA,IAAUK,EAAA;AAMlB,SAJwBL,IACpBE,EAA2CF,GAAOM,EAAgB,IAAI,IACtE;AAGN,GCTaC,IAAiB,CAACC,MAEdC,EAA8B;AAAA,EAC3C,SAFcD;AAAA,EAGd,WAAWE,EAAY;AAAA,EACvB,SAAS,CAAA;AAAC,CACX;ACFI,SAASC,EACdC,GACA;AACA,SAAO,CAACJ,MAAe,CAACK,MAA2C;AACjE,UAAM,EAAE,OAAAb,GAAO,QAAAc,GAAQ,gBAAAC,EAAA,IAAmBR,EAAeC,CAAE;AAE3D,WACE,gBAAAQ,EAACD,GAAA,EAAgB,GAAGD,GAClB,UAAA,gBAAAE,EAACJ,KAAkB,GAAIC,GAAa,aAAab,EAAA,CAAO,EAAA,CAC1D;AAAA,EAEJ;AACF;ACZA,MAAMiB,IAAc,CAACC,GAAaC,MAAyB;AACzD,MAAID,EAAE,WAAWC,EAAE;AAAQ,WAAO;AAClC,WAASC,IAAI,GAAGA,IAAIF,EAAE,QAAQE;AAC5B,QAAIF,EAAEE,CAAC,MAAMD,EAAEC,CAAC;AAAG,aAAO;AAE5B,SAAO;AACT,GAEaC,IAAmB,CAACC,MAAuB;AACtD,QAAMC,IAAkBnB,EAAA,GAClB,CAACoB,GAAeC,CAAgB,IACpCC,EAAA,GAGIC,IAAkBC,EAAiB,EAAE;AAE3C,SAAAC,EAAU,MAAM;AACd,IAAIN,KAAmB,CAACN,EAAYK,GAAUK,EAAgB,OAAO,MACnEJ,EAAgB,WAAWD,GAC3BK,EAAgB,UAAUL;AAE5B,UAAMQ,IAAWC,EAAc,MAAM;AACnC,MAAIR,KACFE,EAAiBF,EAAgB,aAAa;AAAA,IAElD,CAAC;AAED,WAAO,MAAM;AACX,MAAAO,EAAA;AAAA,IACF;AAAA,EACF,GAAG,CAACR,GAAUC,CAAe,CAAC,GAEvBC;AACT;"}
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
var c = Object.defineProperty;
|
|
2
|
-
var g = (r, e, t) => e in r ? c(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var o = (r, e, t) => (g(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import { j as u, N as p, k as b, l as y, m as v, n as f } from "./freestyle-registration-manager-z0aYdMcC.js";
|
|
5
|
-
import { DispenseExtensionManager as w } from "@kosdev-code/kos-dispense-sdk";
|
|
6
|
-
import { kosFetch as M, processMiddleware as I, ExtensionManager as d, KosFeatureFlags as S, EXTENSION_TROUBLE_DATA_MAPPER as h, CoreExtensionManager as F } from "@kosdev-code/kos-ui-sdk";
|
|
7
|
-
const Z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8
|
-
__proto__: null,
|
|
9
|
-
InvalidRequestError: u,
|
|
10
|
-
NutritionInfoError: p,
|
|
11
|
-
getFreestyleNutritionInfo: b
|
|
12
|
-
}, Symbol.toStringTag, { value: "Module" })), ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
13
|
-
__proto__: null,
|
|
14
|
-
replacePump: y
|
|
15
|
-
}, Symbol.toStringTag, { value: "Module" })), m = (r, e) => (r[e.dbId.toString()] = e, r), E = async (r, e) => {
|
|
16
|
-
const s = r.data.assets.reduce(m, {});
|
|
17
|
-
r.result = { ...r.result, assets: s }, await e();
|
|
18
|
-
};
|
|
19
|
-
function B(r) {
|
|
20
|
-
const e = {};
|
|
21
|
-
for (const t in r)
|
|
22
|
-
if (r.hasOwnProperty(t) && t.includes("slot") && !t.includes("slotrb")) {
|
|
23
|
-
const n = t.split(".")[1], a = r[`slot.${n}.beverage`];
|
|
24
|
-
if (a) {
|
|
25
|
-
e[a] || (e[a] = {}), e[a].rank = n;
|
|
26
|
-
const i = t.replace(`slot.${n}.`, "");
|
|
27
|
-
e[a][i] = r[t];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return e;
|
|
31
|
-
}
|
|
32
|
-
const R = (r) => (e, t) => (e[t] = r.beverageScreens[t], e[t].beverages = B(e[t]), e), A = async (r, e) => {
|
|
33
|
-
const t = r.data, s = Object.keys(t.beverageScreens).reduce(
|
|
34
|
-
R(t),
|
|
35
|
-
t.beverageScreens
|
|
36
|
-
);
|
|
37
|
-
r.result = { ...r.result, beverageScreens: s }, await e();
|
|
38
|
-
}, _ = (r, e) => (r[e.beverageId.toString()] = e, r), P = async (r, e) => {
|
|
39
|
-
const t = r.data, s = t.beverages.reduce(
|
|
40
|
-
_,
|
|
41
|
-
{}
|
|
42
|
-
), n = t.beverages.reduce((a, i) => (a[i.dbId.toString()] = i.beverageId.toString(), a), {});
|
|
43
|
-
r.result = { ...r.result, beverages: s, beverageMap: n }, await e();
|
|
44
|
-
};
|
|
45
|
-
function O(r) {
|
|
46
|
-
const e = { rank: 0 };
|
|
47
|
-
for (const t in r)
|
|
48
|
-
if (r.hasOwnProperty(t) && t.includes("slot")) {
|
|
49
|
-
const s = t.split(".")[1], n = s.split(":")[1], a = r[`slot.${s}.brand`];
|
|
50
|
-
if (a) {
|
|
51
|
-
e[a] || (e[a] = {
|
|
52
|
-
rank: Number(n)
|
|
53
|
-
});
|
|
54
|
-
const i = t.replace(`slot.${s}.`, "");
|
|
55
|
-
e[a][i] = r[t];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return e;
|
|
59
|
-
}
|
|
60
|
-
const k = async (r, e) => {
|
|
61
|
-
const t = r.data, s = O(t.brandScreen);
|
|
62
|
-
r.result = { ...r.result, brandScreen: s }, await e();
|
|
63
|
-
}, T = (r, e) => (r[e.dbId.toString()] = e, r), N = async (r, e) => {
|
|
64
|
-
const s = r.data.brands.reduce(T, {});
|
|
65
|
-
r.result = { ...r.result, brands: s }, await e();
|
|
66
|
-
}, $ = async (r, e) => {
|
|
67
|
-
r.result = { ...r.data }, await e();
|
|
68
|
-
}, q = (r, e) => (r[e.dbId.toString()] = e, r), z = async (r, e) => {
|
|
69
|
-
const s = r.data.flavors.reduce(
|
|
70
|
-
q,
|
|
71
|
-
{}
|
|
72
|
-
);
|
|
73
|
-
r.result = { ...r.result, flavors: s }, await e();
|
|
74
|
-
};
|
|
75
|
-
function K(r, e) {
|
|
76
|
-
return r[`slotrb:${e}.brand`];
|
|
77
|
-
}
|
|
78
|
-
const L = (r) => (e, t, s, n) => {
|
|
79
|
-
e.relatedBrand || (e.relatedBrand = {}), e.relatedBrand[t] || (e.relatedBrand[t] = {
|
|
80
|
-
rank: s
|
|
81
|
-
});
|
|
82
|
-
const a = n.replace(`slotrb:${s}.`, "");
|
|
83
|
-
e.relatedBrand[t][a] = r[n];
|
|
84
|
-
};
|
|
85
|
-
function C(r) {
|
|
86
|
-
const e = {};
|
|
87
|
-
for (const t in r)
|
|
88
|
-
if (r.hasOwnProperty(t) && t.includes("slot") && t.includes("slotrb")) {
|
|
89
|
-
const n = t.split(":")[1].split(".")[0], a = K(r, n);
|
|
90
|
-
L(r)(e, a, n, t);
|
|
91
|
-
}
|
|
92
|
-
return e;
|
|
93
|
-
}
|
|
94
|
-
const U = (r) => (e, t) => (e[t] = r.beverageScreens[t], e[t].beverages = {
|
|
95
|
-
...e[t].beverages,
|
|
96
|
-
...C(e[t])
|
|
97
|
-
}, e), x = async (r, e) => {
|
|
98
|
-
const t = r.data, s = Object.keys(t.beverageScreens).reduce(
|
|
99
|
-
U(t),
|
|
100
|
-
t.beverageScreens
|
|
101
|
-
);
|
|
102
|
-
r.result = { ...r.result, beverageScreens: s }, await e();
|
|
103
|
-
}, D = async (r, e = [], t = !1) => {
|
|
104
|
-
const s = t ? [...e] : [
|
|
105
|
-
$,
|
|
106
|
-
E,
|
|
107
|
-
z,
|
|
108
|
-
P,
|
|
109
|
-
N,
|
|
110
|
-
A,
|
|
111
|
-
x,
|
|
112
|
-
k,
|
|
113
|
-
...e
|
|
114
|
-
];
|
|
115
|
-
return await I(r, s);
|
|
116
|
-
}, V = ({
|
|
117
|
-
url: r = "http://localhost:8081/system/cui/core.json",
|
|
118
|
-
middleware: e = [],
|
|
119
|
-
replace: t = !1
|
|
120
|
-
} = {}) => async () => {
|
|
121
|
-
const s = await M(r);
|
|
122
|
-
if (s.ok) {
|
|
123
|
-
const n = await s.json();
|
|
124
|
-
if (!n)
|
|
125
|
-
throw new Error("Failed to parse availability context");
|
|
126
|
-
return await D(n, e, t);
|
|
127
|
-
}
|
|
128
|
-
throw new Error("Failed to load availability context");
|
|
129
|
-
}, X = async (r) => {
|
|
130
|
-
const { id: e, name: t, ...s } = r;
|
|
131
|
-
return {
|
|
132
|
-
...s,
|
|
133
|
-
ingredientMacro: s.bib && !s.sweetener ? "macro" : "micro"
|
|
134
|
-
};
|
|
135
|
-
}, G = {
|
|
136
|
-
macro: "ingredientMacro"
|
|
137
|
-
}, Y = async (r) => {
|
|
138
|
-
var e;
|
|
139
|
-
return {
|
|
140
|
-
bevId: (e = r.beverage) == null ? void 0 : e.rawId
|
|
141
|
-
};
|
|
142
|
-
}, l = "pluginVisibility";
|
|
143
|
-
class j {
|
|
144
|
-
constructor(e, t) {
|
|
145
|
-
o(this, "core");
|
|
146
|
-
o(this, "dispense");
|
|
147
|
-
this.core = e, this.dispense = t;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Loads the core brandset data into a format that can be consumed by the
|
|
151
|
-
* freestyle models.
|
|
152
|
-
* */
|
|
153
|
-
registerFreestyleBrandsetReader(e = {}) {
|
|
154
|
-
return this.dispense.registerAvailabilityLoader(
|
|
155
|
-
V(e)
|
|
156
|
-
), this;
|
|
157
|
-
}
|
|
158
|
-
registerFreestylePourableMapper() {
|
|
159
|
-
this.dispense.registerSelectedPourableDataMapper(Y);
|
|
160
|
-
}
|
|
161
|
-
registerFreestyleAssemblyMapper() {
|
|
162
|
-
this.dispense.registerAssemblyDataMapper(v);
|
|
163
|
-
}
|
|
164
|
-
registerFreestyleIngredientIndex() {
|
|
165
|
-
this.dispense.registerIngredientIndex(G);
|
|
166
|
-
}
|
|
167
|
-
registerFreestyleIngredientDataMapper() {
|
|
168
|
-
this.dispense.registerIngredientDataMapper(X);
|
|
169
|
-
}
|
|
170
|
-
registerFreestyleIceAgitator() {
|
|
171
|
-
d[l].register(
|
|
172
|
-
l,
|
|
173
|
-
(e) => e !== "iceAgitator" || S.isFeatureEnabled(f)
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
registerFreestyleAgitationRequiredTroubleMapper() {
|
|
177
|
-
d[h].register(
|
|
178
|
-
"agitationRequired",
|
|
179
|
-
async (e) => ({ isAgitationRequired: !!e.data.agitationRequired })
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
initializeFreestyleExtension() {
|
|
183
|
-
this.registerFreestylePourableMapper(), this.registerFreestyleAssemblyMapper(), this.registerFreestyleIngredientIndex(), this.registerFreestyleIngredientDataMapper(), this.registerFreestyleIceAgitator(), this.registerFreestyleAgitationRequiredTroubleMapper();
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
class re {
|
|
187
|
-
constructor() {
|
|
188
|
-
o(this, "dispense");
|
|
189
|
-
o(this, "core");
|
|
190
|
-
o(this, "freestyle");
|
|
191
|
-
this.dispense = new w(), this.core = new F(), this.freestyle = new j(this.core, this.dispense);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
export {
|
|
195
|
-
l as E,
|
|
196
|
-
j as F,
|
|
197
|
-
re as K,
|
|
198
|
-
ee as a,
|
|
199
|
-
Z as i
|
|
200
|
-
};
|
|
201
|
-
//# sourceMappingURL=extension-utils-BE0Y1Zlv.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var g=Object.defineProperty;var p=(r,e,t)=>e in r?g(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var d=(r,e,t)=>(p(r,typeof e!="symbol"?e+"":e,t),t);const l=require("./freestyle-registration-manager-CDbljuRk.cjs"),b=require("@kosdev-code/kos-dispense-sdk"),i=require("@kosdev-code/kos-ui-sdk"),y=Object.freeze(Object.defineProperty({__proto__:null,InvalidRequestError:l.InvalidRequestError,NutritionInfoError:l.NutritionInfoError,getFreestyleNutritionInfo:l.getFreestyleNutritionInfo},Symbol.toStringTag,{value:"Module"})),v=Object.freeze(Object.defineProperty({__proto__:null,replacePump:l.replacePump},Symbol.toStringTag,{value:"Module"})),I=(r,e)=>(r[e.dbId.toString()]=e,r),f=async(r,e)=>{const s=r.data.assets.reduce(I,{});r.result={...r.result,assets:s},await e()};function M(r){const e={};for(const t in r)if(r.hasOwnProperty(t)&&t.includes("slot")&&!t.includes("slotrb")){const n=t.split(".")[1],a=r[`slot.${n}.beverage`];if(a){e[a]||(e[a]={}),e[a].rank=n;const o=t.replace(`slot.${n}.`,"");e[a][o]=r[t]}}return e}const S=r=>(e,t)=>(e[t]=r.beverageScreens[t],e[t].beverages=M(e[t]),e),w=async(r,e)=>{const t=r.data,s=Object.keys(t.beverageScreens).reduce(S(t),t.beverageScreens);r.result={...r.result,beverageScreens:s},await e()},h=(r,e)=>(r[e.beverageId.toString()]=e,r),E=async(r,e)=>{const t=r.data,s=t.beverages.reduce(h,{}),n=t.beverages.reduce((a,o)=>(a[o.dbId.toString()]=o.beverageId.toString(),a),{});r.result={...r.result,beverages:s,beverageMap:n},await e()};function F(r){const e={rank:0};for(const t in r)if(r.hasOwnProperty(t)&&t.includes("slot")){const s=t.split(".")[1],n=s.split(":")[1],a=r[`slot.${s}.brand`];if(a){e[a]||(e[a]={rank:Number(n)});const o=t.replace(`slot.${s}.`,"");e[a][o]=r[t]}}return e}const B=async(r,e)=>{const t=r.data,s=F(t.brandScreen);r.result={...r.result,brandScreen:s},await e()},R=(r,e)=>(r[e.dbId.toString()]=e,r),m=async(r,e)=>{const s=r.data.brands.reduce(R,{});r.result={...r.result,brands:s},await e()},A=async(r,e)=>{r.result={...r.data},await e()},_=(r,e)=>(r[e.dbId.toString()]=e,r),P=async(r,e)=>{const s=r.data.flavors.reduce(_,{});r.result={...r.result,flavors:s},await e()};function k(r,e){return r[`slotrb:${e}.brand`]}const O=r=>(e,t,s,n)=>{e.relatedBrand||(e.relatedBrand={}),e.relatedBrand[t]||(e.relatedBrand[t]={rank:s});const a=n.replace(`slotrb:${s}.`,"");e.relatedBrand[t][a]=r[n]};function N(r){const e={};for(const t in r)if(r.hasOwnProperty(t)&&t.includes("slot")&&t.includes("slotrb")){const n=t.split(":")[1].split(".")[0],a=k(r,n);O(r)(e,a,n,t)}return e}const T=r=>(e,t)=>(e[t]=r.beverageScreens[t],e[t].beverages={...e[t].beverages,...N(e[t])},e),q=async(r,e)=>{const t=r.data,s=Object.keys(t.beverageScreens).reduce(T(t),t.beverageScreens);r.result={...r.result,beverageScreens:s},await e()},$=async(r,e=[],t=!1)=>{const s=t?[...e]:[A,f,P,E,m,w,q,B,...e];return await i.processMiddleware(r,s)},x=({url:r="http://localhost:8081/system/cui/core.json",middleware:e=[],replace:t=!1}={})=>async()=>{const s=await i.kosFetch(r);if(s.ok){const n=await s.json();if(!n)throw new Error("Failed to parse availability context");return await $(n,e,t)}throw new Error("Failed to load availability context")},L=async r=>{const{id:e,name:t,...s}=r;return{...s,ingredientMacro:s.bib&&!s.sweetener?"macro":"micro"}},z={macro:"ingredientMacro"},K=async r=>{var e;return{bevId:(e=r.beverage)==null?void 0:e.rawId}},c="pluginVisibility";class u{constructor(e,t){d(this,"core");d(this,"dispense");this.core=e,this.dispense=t}registerFreestyleBrandsetReader(e={}){return this.dispense.registerAvailabilityLoader(x(e)),this}registerFreestylePourableMapper(){this.dispense.registerSelectedPourableDataMapper(K)}registerFreestyleAssemblyMapper(){this.dispense.registerAssemblyDataMapper(l.freestyleAssemblyDataMapper)}registerFreestyleIngredientIndex(){this.dispense.registerIngredientIndex(z)}registerFreestyleIngredientDataMapper(){this.dispense.registerIngredientDataMapper(L)}registerFreestyleIceAgitator(){i.ExtensionManager[c].register(c,e=>e!=="iceAgitator"||i.KosFeatureFlags.isFeatureEnabled(l.FEATURE_SUPPORTS_ICE))}registerFreestyleAgitationRequiredTroubleMapper(){i.ExtensionManager[i.EXTENSION_TROUBLE_DATA_MAPPER].register("agitationRequired",async e=>({isAgitationRequired:!!e.data.agitationRequired}))}initializeFreestyleExtension(){this.registerFreestylePourableMapper(),this.registerFreestyleAssemblyMapper(),this.registerFreestyleIngredientIndex(),this.registerFreestyleIngredientDataMapper(),this.registerFreestyleIceAgitator(),this.registerFreestyleAgitationRequiredTroubleMapper()}}class U{constructor(){d(this,"dispense");d(this,"core");d(this,"freestyle");this.dispense=new b.DispenseExtensionManager,this.core=new i.CoreExtensionManager,this.freestyle=new u(this.core,this.dispense)}}exports.EXTENSION_PLUGIN_VISIBILITY=c;exports.FreestyleExtensionManager=u;exports.KosExtensionManager=U;exports.index=y;exports.index$1=v;
|
|
2
|
-
//# sourceMappingURL=extension-utils-BVDLwtKr.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var ve=Object.defineProperty;var Ie=(e,t,o)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var s=(e,t,o)=>(Ie(e,typeof t!="symbol"?t+"":t,o),o);const r=require("@kosdev-code/kos-ui-sdk"),g=require("@kosdev-code/kos-dispense-sdk");var Ee=Object.getOwnPropertyDescriptor,Me=(e,t,o,i)=>{for(var a=i>1?void 0:i?Ee(t,o):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=l(a)||a);return a};const V="carb-agitator-model";let F=class{constructor(e,t,o){s(this,"id");s(this,"name");s(this,"path");s(this,"logger");this.id=e,this.name=t.name,this.path=t.path,this.logger=o.logger}async init(){this.logger.debug(`initializing carb-agitator ${this.id}`)}async load(){this.logger.debug(`loading carb-agitator ${this.id}`)}};F=Me([r.kosModel(V)],F);const k=new r.KosModelRegistrationFactory({class:F,type:V});var Oe=Object.defineProperty,Te=Object.getOwnPropertyDescriptor,W=(e,t,o,i)=>{for(var a=i>1?void 0:i?Te(t,o):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=(i?l(t,o,a):l(a))||a);return i&&a&&Oe(t,o,a),a};const X="cartridge-agitator-container-model";let O=class{constructor(e,t,o){s(this,"id");s(this,"logger");s(this,"_models");this.id=e,this.logger=o.logger,this._models=new r.KosModelContainer({parentId:e})}getModel(e){return this._models.getModel(e)}get models(){return this._models}get data(){return this._models.data}addModel(e){this._models.addModel(e)}removeModel(e){this._models.removeModel(e)}async init(){this.logger.debug(`initializing cartridge-agitator-container container ${this.id}`)}async load(){this.logger.debug(`loading cartridge-agitator-container container ${this.id}`)}};W([r.kosChild],O.prototype,"_models",2);O=W([r.kosModel(X)],O);const{URL:Q}=r.resolveServiceUrl("CARTRIDGE_AGITATOR_SERVICE"),{postModel:Ae}=r.ServiceFactory.build({basePath:`${Q}/api/ext/freestyle/freestyle/ice`}),Se=async(e,t)=>{const o=await Ae({model:{},tracker:t,urlOverride:`${Q}/api/handle/${e}/test`});if(!(o!=null&&o.data))throw new Error("No response from server");return o.data};var Ce=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,R=(e,t,o,i)=>{for(var a=i>1?void 0:i?Re(t,o):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=(i?l(t,o,a):l(a))||a);return i&&a&&Ce(t,o,a),a};const Z="cartridge-agitator-model";class v{}s(v,"TOPIC_AGITATION_STARTED","/kos/events/ddk/agitation-started"),s(v,"TOPIC_AGITATION_ENDED","/kos/events/ddk/agitation-ended");const $e=r.createPropKey("statePath");let P=class{constructor(e,t){s(this,"id");s(this,"agitating");s(this,"path");s(this,"statePath");s(this,"name");this.id=e,this.path=t.path,this.name=t.name,this.statePath=t.statePath}get isAgitating(){return!!this.agitating.value}async testAgitate(e){if(!e)throw new Error("No tracker provided");return this.logger.info(`agitating cartridge-agitator ${this.id}`),Se(this.path,e)}handleAgitation(){var e;this.isAgitating?(this.logger.info(`agitating cartridge-agitator ${this.id}`),r.EventBus.publish(v.TOPIC_AGITATION_STARTED,{path:this.path,futureId:(e=this.future)==null?void 0:e.futureId})):r.EventBus.publish(v.TOPIC_AGITATION_ENDED,{path:this.path})}};R([r.kosStateProp({path:$e,attribute:"agitating"})],P.prototype,"agitating",2);R([r.kosFuture()],P.prototype,"testAgitate",1);R([r.kosModelEffect({dependencies:e=>[e.isAgitating]})],P.prototype,"handleAgitation",1);P=R([r.kosModel(Z),r.kosFutureAware(),r.kosLoggerAware()],P);const x=new r.KosModelRegistrationFactory({class:P,type:Z}),$=new r.SingletonKosModelRegistrationFactory({class:O,type:X});$.addRelatedModel(x);var we=Object.defineProperty,De=Object.getOwnPropertyDescriptor,J=(e,t,o,i)=>{for(var a=i>1?void 0:i?De(t,o):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=(i?l(t,o,a):l(a))||a);return i&&a&&we(t,o,a),a};const ee="freestyle-assembly-model",te="iceAgitator",ze="carbAgitator",Fe="remoteTrays";let T=class{constructor(e,t,o){s(this,"id");s(this,"logger");s(this,"assembly");s(this,"_remoteTrays");this.id=e,this.logger=o.logger,this.assembly=t.companionParent}get holderGroups(){return this.assembly.holderGroups}get nozzlePaths(){return this.assembly.nozzlePaths}get allHolders(){return this.assembly.allHolders}getHoldersByGroup(e){return this.assembly.getHoldersByGroup(e)}getHoldersByNozzle(e){return this.assembly.getHoldersByNozzle(e)}get pumpsByNozzle(){return this.assembly.pumpsByNozzle}get pumpPaths(){return this.assembly.pumpPaths}get boards(){return this.assembly.boards}updateModel(e){return this.assembly.updateModel(e)}get iceAgitator(){return this.assembly.iceAgitator}get carbAgitator(){return this.assembly.carbAgitator}get cartridgeAgitators(){return this.assembly.cartridgeAgitators}get defaultCartridgeAgitator(){return this.assembly.cartridgeAgitators.data[0]}get cartridgeAgitatorModels(){return this.assembly.cartridgeAgitators.data}get hasCartridgeAgitators(){return this.assembly.cartridgeAgitators.data.length>0}get remoteTrays(){return this.assembly.remoteTrays}get hasRemoteTrays(){return this.assembly.remoteTrays?this.assembly.remoteTrays.data.length>0:!1}get supportsRemoteTrays(){return r.KosFeatureFlags.isFeatureEnabled(Fe)}get supportsIce(){return r.KosFeatureFlags.isFeatureEnabled(te)}get supportsCarb(){return r.KosFeatureFlags.isFeatureEnabled(ze)}async init(){this.logger.debug(`initializing freestyle-assembly ${this.id}`)}};J([r.kosChild],T.prototype,"_remoteTrays",2);T=J([r.kosParentAware(),r.kosModel(ee)],T);const A=new r.SingletonKosModelRegistrationFactory({class:T,type:ee});var Le=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,re=(e,t,o,i)=>{for(var a=i>1?void 0:i?Ne(t,o):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=(i?l(t,o,a):l(a))||a);return i&&a&&Le(t,o,a),a};const oe="remote-tray-model";r.createPropKey("holderPath");const Ke=r.createPropKey("configPath");let S=class{constructor(e,t,o){s(this,"id");s(this,"logger");s(this,"holderPath");s(this,"configPath");s(this,"name");s(this,"remoteTrayEnabled");this.id=e,this.logger=o.logger,this.holderPath=t.holderPath,this.configPath=t.configPath,this.name=t.name}get troubles(){var e;return((e=this.holder)==null?void 0:e.troubles)??[]}get troubleStatus(){return""}get troublesByType(){var e;return((e=this.holder)==null?void 0:e.troublesByType)??{}}updateModel(e){}get holder(){return r.getKosModelSync(this.holderPath).model}get active(){return!!this.remoteTrayEnabled.value}async init(){this.logger.debug(`initializing remote-tray ${this.id}`)}async load(){this.logger.debug(`loading remote-tray ${this.id}`)}};re([r.kosConfigProperty({path:Ke,attribute:"enabled"})],S.prototype,"remoteTrayEnabled",2);S=re([r.kosModel(oe)],S);const _=new r.KosModelRegistrationFactory({class:S,type:oe});var Ue=Object.getOwnPropertyDescriptor,Ge=(e,t,o,i)=>{for(var a=i>1?void 0:i?Ue(t,o):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=l(a)||a);return a};const ae="remote-tray-container-model";let L=class{constructor(e){s(this,"id");this.id=e}};L=Ge([r.kosModel(ae),r.kosLoggerAware(),r.kosContainerAware()],L);const w=new r.SingletonKosModelRegistrationFactory({class:L,type:ae});w.addRelatedModel(_);var Be=Object.getOwnPropertyDescriptor,je=(e,t,o,i)=>{for(var a=i>1?void 0:i?Be(t,o):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=l(a)||a);return a};const se="freestyle-holder-model";function ke(e){const t=r.KosContextManager.getContext(e),o=t==null?void 0:t.get(A.type);if(!o){r.KosLog.error("Freestyle assembly not found");return}return o}async function xe(e,t){if(!e||!t)return;const o=await e[t]();if(o!=null&&o.tracker)return r.FutureManager.getFuture(o.tracker)}let N=class{constructor(e,t,o){s(this,"id");s(this,"logger");s(this,"holder");s(this,"context");s(this,"future");this.id=e,this.logger=o.logger,this.context=o.kosContext,this.holder=t.companionParent}get agitated(){return this.holder.data.agitated}async agitate(){if(!this.holder.data.agitated)return;this.future=void 0;const e=ke(this.id);if(!e)return;if(!e.defaultCartridgeAgitator){this.logger.error("Agitator not found");return}return this.future=await xe(e.defaultCartridgeAgitator,"testAgitate"),this.future}get isRemote(){const e=`${_.type}-${this.holder.path}`,t=r.getKosModelSync(e);return t!=null&&t.model?!!t.model.remoteTrayEnabled.value:!1}async init(){this.logger.debug(`initializing freestyle-holder ${this.id}`)}async load(){this.logger.debug(`loading freestyle-holder ${this.id}`)}};N=je([r.kosModel(se)],N);const K=new r.KosModelRegistrationFactory({class:N,type:se}),{URL:qe}=r.resolveServiceUrl("FREESTYLE-NOZZLE_SERVICE"),{getOne:He}=r.ServiceFactory.build({basePath:`${qe}/api/freestyle-nozzle`}),M=r.KosLog.createLogger({name:"freestyle-nozzle-service",group:"Services"});class ie extends Error{constructor(t){super(t),this.name="NutritionInfoError"}}class U extends Error{constructor(t){super(t),this.name="InvalidRequestError"}}const ne=async(e,t,o,i="http://localhost:8081")=>{if(M.debug("sending GET for freestyle-nozzle"),!t)throw M.error("Invalid freestyle-nozzle request: beverageId is required"),new U("No beverageId provided");if(!o||o.length===0)throw M.error("Invalid freestyle-nozzle request: volumes are required"),new U("No volumes provided");const a=await He({urlOverride:`${i}${e}/pipeline/beverage/engine/nutrition/${t}?volumes=${o.join(",")}`});if(!(a!=null&&a.data))throw M.error("Failed to retrieve freestyle-nozzle data"),new Error("Failed to retrieve freestyle-nozzle data");if(a.data.error)throw new ie(a.data.error);return a.data};var Ye=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,le=(e,t,o,i)=>{for(var a=i>1?void 0:i?Ve(t,o):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=(i?l(t,o,a):l(a))||a);return i&&a&&Ye(t,o,a),a};const ge="freestyle-nozzle-model";let C=class{constructor(e,t,o){s(this,"id");s(this,"logger");s(this,"nozzleModel");s(this,"_cupSizes");s(this,"_nutritionInfo");this.id=e,this.logger=o.logger,this.nozzleModel=t.companionParent,this._cupSizes=[100]}set cupSizes(e){this._cupSizes=e}get nutritionInfo(){return this._nutritionInfo}get selectedPourable(){return this.nozzleModel.selectedPourable}async handleBeverageSelection(){if(this.nozzleModel.selectedPourable.beverage&&this._cupSizes.length){this.logger.debug(`selected beverage: ${this.nozzleModel.selectedPourable.beverage.rawId}. Volume: ${this._cupSizes.join(", ")}`);const e=this.nozzleModel.selectedPourable.beverage.rawId,t=this.nozzleModel.urlPrefix;try{const o=await ne(t,e,this._cupSizes);r.kosAction(()=>{this._nutritionInfo=o})}catch(o){this.logger.error(`Error fetching nutrition info: ${o}`)}}}async init(){this.logger.debug(`initializing freestyle-nozzle ${this.id}`)}unload(){this.logger.debug(`unloading freestyle-nozzle ${this.id}`)}async load(){this.logger.debug(`loading freestyle-nozzle ${this.id}`)}};le([r.kosModelEffect({dependencies:e=>[e.selectedPourable.beverage]})],C.prototype,"handleBeverageSelection",1);C=le([r.kosParentAware(),r.kosModel(ge)],C);const G=new r.KosModelRegistrationFactory({class:C,type:ge}),{URL:de}=r.resolveServiceUrl("PUMP_SERVICE"),{postModel:We}=r.ServiceFactory.build({basePath:`${de}/api/ext/freestyle/microCalibration`}),z=r.KosLog.createLogger({name:"freestyle-pump-service",group:"Services"}),ce=async(e,t)=>{var o,i,a,n,l;z.debug(`replacePump - sending POST request to /api/ext/freestyle/microCalibration/cal/${e}/code/${t}`);try{const d=await We({model:{},urlOverride:`${de}/api/ext/freestyle/microCalibration/cal/${e}/code/${t}`});return z.debug("replacePump - response:",d),((d==null?void 0:d.status)===200||(d==null?void 0:d.status)===499)&&((o=d.data)!=null&&o.error)?[d.data.error||"unknownError",d.data]:[void 0,d==null?void 0:d.data]}catch(d){if(z.error(`replacePump - sending POST request to /api/cal/${e}/code/${t}`,d),d instanceof r.FetchError){const b=((a=(i=d.payload)==null?void 0:i.data)==null?void 0:a.error)||((n=d.payload)==null?void 0:n.error)||"unknownError";return[b,((l=d.payload)==null?void 0:l.data)||{error:b}]}}return["unknownError",{error:"unknownError"}]};var Xe=Object.getOwnPropertyDescriptor,Qe=(e,t,o,i)=>{for(var a=i>1?void 0:i?Xe(t,o):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=l(a)||a);return a};const ue="freestyle-pump-model";let B=class{constructor(e,t,o){s(this,"id");s(this,"logger");s(this,"pump");this.id=e,this.logger=o.logger,this.pump=t.companionParent}async replacePump(e){const[t,o]=await ce(this.pump.path,e);return t&&this.logger.error(`Failed to replace the pump, ${this.pump.id}`,t),[t,o]}};B=Qe([r.kosModel(ue)],B);const j=new r.KosModelRegistrationFactory({class:B,type:ue}),{URL:m}=r.resolveServiceUrl("ICE_AGITATOR_SERVICE"),{getAll:pe,postModel:D}=r.ServiceFactory.build({basePath:`${m}/api/ext/freestyle/ice`}),he=r.KosLog.createLogger({name:"ice-agitator-service",group:"Services"}),Ze=async e=>(he.debug("sending GET for ice types"),await pe({urlOverride:`${m}/api/handle/${e}/types`})),Je=async(e,t)=>(he.debug("sending POST for ice types"),await D({urlOverride:`${m}/api/handle/${e}/type/${t}`,model:{}})),et=async e=>await pe({urlOverride:`${m}/api/kos/config/details/${e}/4`}),tt=async(e,t)=>{const o=await D({model:{},tracker:t,urlOverride:`${m}/api/handle/${e}/pour`});if(!(o!=null&&o.data))throw new Error("No response from server");return o==null?void 0:o.data},rt=async(e,t)=>{const o=await D({model:{},tracker:t,urlOverride:`${m}/api/handle/${e}/test/agitation`});if(!(o!=null&&o.data))throw new Error("No response from server");return o==null?void 0:o.data},ot=async(e,t)=>{const o=await D({model:{},tracker:t,urlOverride:`${m}/api/handle/${e}/test/gate`});if(!(o!=null&&o.data))throw new Error("No response from server");return o==null?void 0:o.data};var at=Object.defineProperty,st=Object.getOwnPropertyDescriptor,u=(e,t,o,i)=>{for(var a=i>1?void 0:i?st(t,o):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=(i?l(t,o,a):l(a))||a);return i&&a&&at(t,o,a),a};class I{}s(I,"TOPIC_AGITATION_STARTED","/kos/events/ddk/ice-agitation-started"),s(I,"TOPIC_AGITATION_ENDED","/kos/events/ddk/ice-agitation-ended");const ye="ice-agitator-model",fe=r.createPropKey("statePath");let c=class{constructor(e,t,o){s(this,"id");s(this,"name");s(this,"path");s(this,"volWithoutIceMl");s(this,"durationSec");s(this,"enableIceChuteClear");s(this,"iceChuteClearDurationMs");s(this,"iceChuteClearIntervalSec");s(this,"iceChuteClearRetryIntervalSec");s(this,"maxDispenseSec");s(this,"type");s(this,"dilutionOffset");s(this,"inactivitySec");s(this,"agitating");s(this,"iceChuteOpen");s(this,"statePath");s(this,"_allIceTypes");s(this,"logger");s(this,"currentState",g.PourState.IDLE);s(this,"resetDefaultValues",async()=>await et(this.path));this.id=e,this.name=t.name,this.path=t.path,this.statePath=t.statePath,this._allIceTypes=[],this.logger=o.logger}get iceTypes(){return this._allIceTypes}get isAgitating(){return!!this.agitating.value}get isIceChuteOpen(){return!!this.iceChuteOpen.value}get isPouring(){var e;return!!(this.pourFuture&&!((e=this.pourFuture)!=null&&e.endState))||this.currentState===g.PourState.POUR_STARTING||this.currentState===g.PourState.POURING||this.currentState===g.PourState.POUR_CANCELING}get canPour(){return this.currentState===g.PourState.IDLE}updateIfCurrent(e,t){this.currentState===e&&r.kosAction(()=>{this.currentState=t})}async pourIce(e){try{if(this.currentState===g.PourState.IDLE){if(this.updateIfCurrent(g.PourState.IDLE,g.PourState.POUR_STARTING),!e)throw new Error("No tracker provided");const t=await tt(this.path,e);return this.updateIfCurrent(g.PourState.POUR_STARTING,g.PourState.POURING),t!=null&&t.endState&&this.updateIfCurrent(g.PourState.POURING,g.PourState.IDLE),t}else throw new Error(`Cannot pour in state ${this.currentState}`)}catch(t){throw this.logger.error(t),this.currentState=g.PourState.IDLE,t}}async cancelIceDispense(){var e;this.currentState===g.PourState.POURING||this.currentState===g.PourState.POUR_STARTING?(this.currentState=g.PourState.POUR_CANCELING,await((e=this.pourFuture)==null?void 0:e.cancelFuture()),r.kosAction(()=>{this.currentState=g.PourState.IDLE})):this.logger.warn(`Cannot cancel ice dispense in state ${this.currentState}`)}async testAgitate(e){if(!e)throw new Error("No tracker provided");return this.logger.info(`agitating ice-agitator ${this.id}`),rt(this.path,e)}async testGate(e){if(!e)throw new Error("No tracker provided");return this.logger.info(`testing ice gate: ${this.id}`),ot(this.path,e)}handleAgitationChange(){var e;this.isAgitating?(this.logger.info(`agitating ice-agitator ${this.id}`),r.EventBus.publish(I.TOPIC_AGITATION_STARTED,{path:this.path,futureId:(e=this.futureHandler.future)==null?void 0:e.futureId})):r.EventBus.publish(I.TOPIC_AGITATION_ENDED,{path:this.path})}async updateIceType(e){await Je(this.path,e)}async init(){this.logger.debug(`initializing ice-agitator ${this.id}`)}async load(){this.logger.debug(`loading ice-agitator ${this.id}`);const e=await Ze(this.path);(e==null?void 0:e.status)===200&&r.kosAction(()=>{this._allIceTypes=e.data||[]})}};u([r.kosConfigProperty({path:r.KOS_MODEL_ID,attribute:"settings.volWithoutIceMl"})],c.prototype,"volWithoutIceMl",2);u([r.kosConfigProperty({path:r.KOS_MODEL_ID,attribute:"settings.durationSec",converter:{to:"second"}})],c.prototype,"durationSec",2);u([r.kosConfigProperty({path:r.KOS_MODEL_ID,attribute:"enableIceChuteClear"})],c.prototype,"enableIceChuteClear",2);u([r.kosConfigProperty({path:r.KOS_MODEL_ID,attribute:"iceChuteClearDurationMs"})],c.prototype,"iceChuteClearDurationMs",2);u([r.kosConfigProperty({path:r.KOS_MODEL_ID,attribute:"iceChuteClearIntervalSec"})],c.prototype,"iceChuteClearIntervalSec",2);u([r.kosConfigProperty({path:r.KOS_MODEL_ID,attribute:"iceChuteClearRetryIntervalSec"})],c.prototype,"iceChuteClearRetryIntervalSec",2);u([r.kosConfigProperty({path:r.KOS_MODEL_ID,attribute:"maxDispenseSec"})],c.prototype,"maxDispenseSec",2);u([r.kosConfigProperty({path:r.KOS_MODEL_ID,attribute:"type"})],c.prototype,"type",2);u([r.kosConfigProperty({path:r.KOS_MODEL_ID,attribute:"settings.dilutionOffset"})],c.prototype,"dilutionOffset",2);u([r.kosConfigProperty({path:r.KOS_MODEL_ID,attribute:"settings.inactivitySec",converter:{to:"minute"}})],c.prototype,"inactivitySec",2);u([r.kosStateProp({path:fe,attribute:"agitating"})],c.prototype,"agitating",2);u([r.kosStateProp({path:fe,attribute:"iceChuteOpen"})],c.prototype,"iceChuteOpen",2);u([r.kosFuture({alias:"pour"})],c.prototype,"pourIce",1);u([r.kosFuture({alias:"agitate"})],c.prototype,"testAgitate",1);u([r.kosFuture({alias:"gate"})],c.prototype,"testGate",1);u([r.kosModelEffect({dependencies:e=>[e.isAgitating]})],c.prototype,"handleAgitationChange",1);c=u([r.kosModel(ye),r.kosMultipleFutureAware()],c);const q=new r.KosModelRegistrationFactory({class:c,type:ye});var it=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,H=(e,t,o,i)=>{for(var a=i>1?void 0:i?nt(t,o):t,n=e.length-1,l;n>=0;n--)(l=e[n])&&(a=(i?l(t,o,a):l(a))||a);return i&&a&&it(t,o,a),a};const Y="agitation-required-trouble-model",lt=e=>{if(e.data.agitationRequired)return Y},me="InsufficientAgitationTrouble";let E=class{constructor(e,t,o){s(this,"id");s(this,"logger");s(this,"trouble");s(this,"_deferred");s(this,"_holdersLoaded",!1);s(this,"agitateBeforePour");this.id=e,this.logger=o.logger,this._deferred=!1,this.trouble=t.companionParent}async resolve(){return this.trouble.resolve()}get holder(){const e=this.trouble.data.holderPaths[0],t=r.getKosModelSync(e);if(!(!this._holdersLoaded&&!t.model))return t==null?void 0:t.model}updateHolder(){if(!this._holdersLoaded){const e=this.trouble.data.holderPaths[0];r.getKosModelSync(e).model&&(this._holdersLoaded=!0)}}get shouldDefer(){var i,a;if(!this.holder)return!0;const t=(((i=this.holder)==null?void 0:i.troublesByType[me])||[]).length>0;return!!((a=this.agitateBeforePour)!=null&&a.value)&&t}get deferred(){return this._deferred}defer(){this._deferred=!0}clearDefer(){this._deferred=!1}};H([r.kosConfigProperty({path:"app:kosdev.ddk:app",attribute:"ncui.agitateBeforePour"})],E.prototype,"agitateBeforePour",2);H([r.kosTopicHandler({topic:r.modelTypeEventTopicFactory(g.Assembly.type),lifecycle:r.DependencyLifecycle.INIT})],E.prototype,"updateHolder",1);E=H([r.kosModel(Y)],E);const Pe=new r.KosModelRegistrationFactory({class:E,type:Y}),gt=["iceAgitator","carbAgitator"],dt={iceAgitator:q.factory,carbAgitator:k.factory},ct=r.KosLog.createLogger({name:"freestyle-assembly-data-mapper"}),ut=async e=>{const t=$.instance().options({}).build(),o=w.instance().options({}).build(),i=e.assemblies.reduce((l,d)=>{var b;return gt.forEach(p=>{var f;const y=d[p];if(y){const be=dt[p](y.path);l[p]=be({name:y.name,path:y.path,statePath:((f=y.state)==null?void 0:f.path)||""})}}),(b=d.cartridgeAgitators)==null||b.forEach(p=>{var f;const y=x.instance(p.path).options({name:p.name,path:p.path,statePath:((f=p.state)==null?void 0:f.path)||""}).build();t.addModel(y)}),d.remoteTrays&&d.remoteTrays.forEach(p=>{ct.info(`Found remote tray ${p.name} with path ${p.path}`);const y=`${_.type}-${p.holderPath}`,f=_.instance(y).options({holderPath:p.holderPath,configPath:p.path,name:p.name}).build();o.addModel(f)}),l},{}),a=!!i.iceAgitator,n=!!i.carbAgitator;return{...i,cartridgeAgitators:t,remoteTrays:o,supportsCarb:n,supportsIce:a}},_e=e=>()=>(r.registerCoreModels(e)(),g.registerDispenseModels(e)(),G.register(),A.register(),q.register(),k.register(),$.register(),j.register(),K.register(),_.register(),w.register(),r.RegistrationManager.companion.register(e)(g.Nozzle.type,G.type),r.RegistrationManager.companion.register(e)(g.Assembly.type,A.type),Pe.register(),r.RegistrationManager.companion.register(e)(r.Trouble.type,lt),r.RegistrationManager.companion.register(e)(g.Pump.type,j.type),r.RegistrationManager.companion.register(e)(g.Holder.type,K.type),r.ExtensionManager[r.EXTENSION_TROUBLE_DATA_MAPPER].register("EnjoyByTrouble",async t=>{if(t.data.enjoyByDate){const o=new Date(t.data.enjoyByDate);return{enjoyByDays:Math.floor((new Date().getTime()-o.getTime())/(1e3*60*60*24))||""}}return{}}),r.ExtensionManager[r.EXTENSION_TROUBLE_DATA_MAPPER].register("SuperPumpRequiredTrouble",async t=>{const{model:o}=r.getKosModelSync(g.PumpContainer.type);return o?{superPumps:o.models.getIndexByKey(g.PumpIndex.byType,"microSuper").map(n=>n.name).join(", ")}:{}}),r.ExtensionManager[r.EXTENSION_TROUBLE_DATA_MAPPER].register("MicroPumpAirDetectTrouble",async t=>{if(t.ifaces.includes("container"))return{};if(t.data.pumpPath){const{model:o}=r.getKosModelSync(t.data.pumpPath);if(o){const i=o.ingredientId?r.getKosModelSync(o.ingredientId).model:void 0;return{ingredientId:o.ingredientId,ingredientName:(i==null?void 0:i.name)||""}}}return{}}),{preload:r.RegistrationManager.model.preloadModel(e),model:r.RegistrationManager.model.register(e),companion:r.RegistrationManager.companion.register(e),legacy:r.RegistrationManager.model.registerLegacyModel(e)}),h={...g.KosModelRegistry};h.freestyle={models:_e(h)};h.preload=r.RegistrationManager.model.preloadModel(h);h.model=r.RegistrationManager.model.register(h);h.companion=r.RegistrationManager.companion.register(h);h.legacy=r.RegistrationManager.model.registerLegacyModel(h);const pt=h;exports.AGITATION_REQUIRED_TROUBLE=me;exports.AgitationRequiredTrouble=Pe;exports.CarbAgitator=k;exports.CartridgeAgitator=x;exports.CartridgeAgitatorContainer=$;exports.CartridgeAgitatorEvents=v;exports.FEATURE_SUPPORTS_ICE=te;exports.FreestyleAssembly=A;exports.FreestyleHolder=K;exports.FreestyleNozzle=G;exports.FreestylePump=j;exports.IceAgitator=q;exports.IceAgitatorEvents=I;exports.InvalidRequestError=U;exports.KosModelRegistry=pt;exports.NutritionInfoError=ie;exports.RemoteTray=_;exports.RemoteTrayContainer=w;exports.freestyleAssemblyDataMapper=ut;exports.getFreestyleNutritionInfo=ne;exports.registerFreestyleModels=_e;exports.replacePump=ce;
|
|
2
|
-
//# sourceMappingURL=freestyle-registration-manager-CDbljuRk.cjs.map
|