@kosdev-code/kos-dispense-sdk 2.1.39 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/{dispense-registration-manager-C6k10ipu.cjs → dispense-registration-manager-BH0mkCQx.cjs} +227 -253
  2. package/dispense-registration-manager-BH0mkCQx.cjs.map +1 -0
  3. package/{dispense-registration-manager-lJlcyq5G.js → dispense-registration-manager-BSKa5Oi9.js} +244 -270
  4. package/dispense-registration-manager-BSKa5Oi9.js.map +1 -0
  5. package/{extension-utils-DNbm2KRk.cjs → extension-utils-FKfiDSbi.cjs} +14 -25
  6. package/extension-utils-FKfiDSbi.cjs.map +1 -0
  7. package/{extension-utils-AS0Z5eod.js → extension-utils-jntF0-vN.js} +20 -31
  8. package/extension-utils-jntF0-vN.js.map +1 -0
  9. package/extensions/control-pour-extension.d.ts +8 -9
  10. package/extensions/control-pour-extension.d.ts.map +1 -1
  11. package/extensions/index.d.ts.map +1 -1
  12. package/index.cjs +3 -6
  13. package/index.cjs.map +1 -1
  14. package/index.d.ts.map +1 -1
  15. package/index.js +89 -92
  16. package/index.js.map +1 -1
  17. package/models/constants/constants.d.ts.map +1 -1
  18. package/models/constants/index.d.ts.map +1 -1
  19. package/models/index.d.ts.map +1 -1
  20. package/models/models/assembly/assembly-model.d.ts +4 -5
  21. package/models/models/assembly/assembly-model.d.ts.map +1 -1
  22. package/models/models/assembly/assembly-registration.d.ts +1 -2
  23. package/models/models/assembly/assembly-registration.d.ts.map +1 -1
  24. package/models/models/assembly/board-utils.d.ts +1 -2
  25. package/models/models/assembly/board-utils.d.ts.map +1 -1
  26. package/models/models/assembly/holder-utils.d.ts +1 -2
  27. package/models/models/assembly/holder-utils.d.ts.map +1 -1
  28. package/models/models/assembly/index.d.ts.map +1 -1
  29. package/models/models/assembly/nozzle-utils.d.ts +1 -2
  30. package/models/models/assembly/nozzle-utils.d.ts.map +1 -1
  31. package/models/models/assembly/pump-utils.d.ts +2 -3
  32. package/models/models/assembly/pump-utils.d.ts.map +1 -1
  33. package/models/models/assembly/services/assembly-services.d.ts +0 -1
  34. package/models/models/assembly/services/assembly-services.d.ts.map +1 -1
  35. package/models/models/assembly/services/index.d.ts.map +1 -1
  36. package/models/models/assembly/types/index.d.ts +2 -3
  37. package/models/models/availability/availability-model.d.ts +1 -2
  38. package/models/models/availability/availability-model.d.ts.map +1 -1
  39. package/models/models/availability/index.d.ts.map +1 -1
  40. package/models/models/availability/types/index.d.ts +0 -1
  41. package/models/models/board/board-container-model.d.ts +2 -3
  42. package/models/models/board/board-container-model.d.ts.map +1 -1
  43. package/models/models/board/board-container-registration.d.ts +2 -3
  44. package/models/models/board/board-container-registration.d.ts.map +1 -1
  45. package/models/models/board/board-model.d.ts +1 -2
  46. package/models/models/board/board-model.d.ts.map +1 -1
  47. package/models/models/board/board-registration.d.ts +1 -2
  48. package/models/models/board/board-registration.d.ts.map +1 -1
  49. package/models/models/board/index.d.ts.map +1 -1
  50. package/models/models/board/types/index.d.ts +0 -2
  51. package/models/models/board/types/services.d.ts.map +1 -1
  52. package/models/models/board/utils/board-trouble-data-mapper.d.ts +1 -2
  53. package/models/models/board/utils/board-trouble-data-mapper.d.ts.map +1 -1
  54. package/models/models/board/utils/board-trouble-resolver.d.ts +0 -1
  55. package/models/models/board/utils/board-trouble-resolver.d.ts.map +1 -1
  56. package/models/models/device-assembly/device-assembly-model.d.ts +2 -3
  57. package/models/models/device-assembly/device-assembly-model.d.ts.map +1 -1
  58. package/models/models/device-assembly/device-assembly-registration.d.ts +2 -3
  59. package/models/models/device-assembly/device-assembly-registration.d.ts.map +1 -1
  60. package/models/models/device-assembly/index.d.ts.map +1 -1
  61. package/models/models/generic-pour/generic-pour-model.d.ts +3 -4
  62. package/models/models/generic-pour/generic-pour-model.d.ts.map +1 -1
  63. package/models/models/generic-pour/generic-pour-registration.d.ts +2 -3
  64. package/models/models/generic-pour/generic-pour-registration.d.ts.map +1 -1
  65. package/models/models/generic-pour/index.d.ts.map +1 -1
  66. package/models/models/generic-pour/services/generic-pour-services.d.ts.map +1 -1
  67. package/models/models/generic-pour/services/index.d.ts.map +1 -1
  68. package/models/models/holder/holder-model.d.ts +1 -2
  69. package/models/models/holder/holder-model.d.ts.map +1 -1
  70. package/models/models/holder/index.d.ts.map +1 -1
  71. package/models/models/holder/services/assignment-services.d.ts.map +1 -1
  72. package/models/models/holder/services/holder-services.d.ts.map +1 -1
  73. package/models/models/holder/services/index.d.ts.map +1 -1
  74. package/models/models/holder/types/index.d.ts +5 -7
  75. package/models/models/holder/utils/holder-utils.d.ts +0 -1
  76. package/models/models/holder/utils/holder-utils.d.ts.map +1 -1
  77. package/models/models/holder-container/holder-container-model.d.ts +1 -2
  78. package/models/models/holder-container/holder-container-model.d.ts.map +1 -1
  79. package/models/models/holder-container/index.d.ts.map +1 -1
  80. package/models/models/holder-container/types/index.d.ts +1 -3
  81. package/models/models/index.d.ts.map +1 -1
  82. package/models/models/ingredient/index.d.ts.map +1 -1
  83. package/models/models/ingredient/ingredient-model.d.ts +1 -2
  84. package/models/models/ingredient/ingredient-model.d.ts.map +1 -1
  85. package/models/models/ingredient/services/index.d.ts.map +1 -1
  86. package/models/models/ingredient/services/ingredient-services.d.ts.map +1 -1
  87. package/models/models/ingredient/types/index.d.ts +0 -2
  88. package/models/models/ingredient-container/index.d.ts.map +1 -1
  89. package/models/models/ingredient-container/ingredient-container-model.d.ts +1 -2
  90. package/models/models/ingredient-container/ingredient-container-model.d.ts.map +1 -1
  91. package/models/models/ingredient-container/types/index.d.ts +1 -3
  92. package/models/models/nozzle/index.d.ts.map +1 -1
  93. package/models/models/nozzle/nozzle-model.d.ts +6 -7
  94. package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
  95. package/models/models/nozzle/services/index.d.ts.map +1 -1
  96. package/models/models/nozzle/services/nozzle-services.d.ts.map +1 -1
  97. package/models/models/nozzle/types/index.d.ts +1 -3
  98. package/models/models/pump/index.d.ts.map +1 -1
  99. package/models/models/pump/pump-model.d.ts +1 -2
  100. package/models/models/pump/pump-model.d.ts.map +1 -1
  101. package/models/models/pump/services/index.d.ts.map +1 -1
  102. package/models/models/pump/services/pump-services.d.ts +3 -5
  103. package/models/models/pump/services/pump-services.d.ts.map +1 -1
  104. package/models/models/pump/types/index.d.ts +1 -3
  105. package/models/models/pump/utils/pump-trouble-resolver.d.ts +0 -1
  106. package/models/models/pump/utils/pump-trouble-resolver.d.ts.map +1 -1
  107. package/models/models/pump-container/index.d.ts.map +1 -1
  108. package/models/models/pump-container/pump-container-model.d.ts +1 -2
  109. package/models/models/pump-container/pump-container-model.d.ts.map +1 -1
  110. package/models/models/pump-container/types/index.d.ts +1 -3
  111. package/models/models/types/assembly.d.ts.map +1 -1
  112. package/models/models/types/index.d.ts.map +1 -1
  113. package/models/models/types/intent.d.ts +0 -1
  114. package/models/models/types/intent.d.ts.map +1 -1
  115. package/models/models/types/pouring.d.ts.map +1 -1
  116. package/models/utils/dispense-registration-manager.d.ts +5 -6
  117. package/models/utils/dispense-registration-manager.d.ts.map +1 -1
  118. package/models/utils/extension-utils.d.ts +6 -7
  119. package/models/utils/extension-utils.d.ts.map +1 -1
  120. package/models/utils/openapi-index.d.ts.map +1 -1
  121. package/models/utils/registration.d.ts +0 -1
  122. package/models/utils/registration.d.ts.map +1 -1
  123. package/models/utils/service.d.ts +34 -35
  124. package/models/utils/service.d.ts.map +1 -1
  125. package/models/utils/services/dispense/1.6.5/service.d.ts +34 -35
  126. package/models/utils/services/dispense/1.6.5/service.d.ts.map +1 -1
  127. package/models/utils/services/dispense/1.8.1/service.d.ts +34 -35
  128. package/models/utils/services/dispense/1.8.1/service.d.ts.map +1 -1
  129. package/models/utils/services/dispense/daily/service.d.ts +34 -35
  130. package/models/utils/services/dispense/daily/service.d.ts.map +1 -1
  131. package/models/utils/services-index.d.ts.map +1 -1
  132. package/models.cjs +2 -4
  133. package/models.cjs.map +1 -1
  134. package/models.d.ts +1 -0
  135. package/models.js +25 -27
  136. package/models.js.map +1 -1
  137. package/package.json +10 -11
  138. package/{pump-provider-D4Ed_gH6.cjs → pump-provider-D4iVLU-o.cjs} +154 -175
  139. package/pump-provider-D4iVLU-o.cjs.map +1 -0
  140. package/{pump-provider-BSEusYig.js → pump-provider-ntLT8vr7.js} +217 -238
  141. package/pump-provider-ntLT8vr7.js.map +1 -0
  142. package/ui/contexts/assembly/assembly-provider.d.ts +1 -2
  143. package/ui/contexts/assembly/assembly-provider.d.ts.map +1 -1
  144. package/ui/contexts/assembly/index.d.ts.map +1 -1
  145. package/ui/contexts/availability/availability-provider.d.ts +1 -2
  146. package/ui/contexts/availability/availability-provider.d.ts.map +1 -1
  147. package/ui/contexts/availability/index.d.ts.map +1 -1
  148. package/ui/contexts/board/board-provider.d.ts +1 -2
  149. package/ui/contexts/board/board-provider.d.ts.map +1 -1
  150. package/ui/contexts/board/index.d.ts.map +1 -1
  151. package/ui/contexts/board-container/board-container-provider.d.ts +1 -2
  152. package/ui/contexts/board-container/board-container-provider.d.ts.map +1 -1
  153. package/ui/contexts/board-container/index.d.ts.map +1 -1
  154. package/ui/contexts/cui-kit/cui-kit.d.ts +1 -2
  155. package/ui/contexts/cui-kit/cui-kit.d.ts.map +1 -1
  156. package/ui/contexts/cui-kit/index.d.ts.map +1 -1
  157. package/ui/contexts/device-assembly/device-assembly-provider.d.ts +1 -2
  158. package/ui/contexts/device-assembly/device-assembly-provider.d.ts.map +1 -1
  159. package/ui/contexts/device-assembly/index.d.ts.map +1 -1
  160. package/ui/contexts/holder/holder-provider.d.ts +1 -2
  161. package/ui/contexts/holder/holder-provider.d.ts.map +1 -1
  162. package/ui/contexts/holder/index.d.ts.map +1 -1
  163. package/ui/contexts/holder-container/holder-container-provider.d.ts +1 -2
  164. package/ui/contexts/holder-container/holder-container-provider.d.ts.map +1 -1
  165. package/ui/contexts/holder-container/index.d.ts.map +1 -1
  166. package/ui/contexts/index.d.ts.map +1 -1
  167. package/ui/contexts/ingredient/index.d.ts.map +1 -1
  168. package/ui/contexts/ingredient/ingredient-provider.d.ts +1 -2
  169. package/ui/contexts/ingredient/ingredient-provider.d.ts.map +1 -1
  170. package/ui/contexts/ingredient-container/index.d.ts.map +1 -1
  171. package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts +1 -2
  172. package/ui/contexts/ingredient-container/ingredient-container-provider.d.ts.map +1 -1
  173. package/ui/contexts/nozzle/index.d.ts.map +1 -1
  174. package/ui/contexts/nozzle/nozzle-provider.d.ts +1 -2
  175. package/ui/contexts/nozzle/nozzle-provider.d.ts.map +1 -1
  176. package/ui/contexts/pump/index.d.ts.map +1 -1
  177. package/ui/contexts/pump/pump-provider.d.ts +1 -2
  178. package/ui/contexts/pump/pump-provider.d.ts.map +1 -1
  179. package/ui/hooks/assembly/index.d.ts.map +1 -1
  180. package/ui/hooks/assembly/use-assembly.d.ts +1 -2
  181. package/ui/hooks/assembly/use-assembly.d.ts.map +1 -1
  182. package/ui/hooks/assembly/with-assembly.d.ts +0 -1
  183. package/ui/hooks/assembly/with-assembly.d.ts.map +1 -1
  184. package/ui/hooks/availability/index.d.ts.map +1 -1
  185. package/ui/hooks/availability/use-availability.d.ts +1 -2
  186. package/ui/hooks/availability/use-availability.d.ts.map +1 -1
  187. package/ui/hooks/availability/with-availability.d.ts +0 -1
  188. package/ui/hooks/availability/with-availability.d.ts.map +1 -1
  189. package/ui/hooks/board/index.d.ts.map +1 -1
  190. package/ui/hooks/board/use-board.d.ts +1 -2
  191. package/ui/hooks/board/use-board.d.ts.map +1 -1
  192. package/ui/hooks/board/with-board.d.ts +0 -1
  193. package/ui/hooks/board/with-board.d.ts.map +1 -1
  194. package/ui/hooks/board-container/index.d.ts.map +1 -1
  195. package/ui/hooks/board-container/use-board-container.d.ts +1 -2
  196. package/ui/hooks/board-container/use-board-container.d.ts.map +1 -1
  197. package/ui/hooks/board-container/with-board-container.d.ts +0 -1
  198. package/ui/hooks/board-container/with-board-container.d.ts.map +1 -1
  199. package/ui/hooks/cui-kit/dispense-topics.d.ts +0 -1
  200. package/ui/hooks/cui-kit/dispense-topics.d.ts.map +1 -1
  201. package/ui/hooks/cui-kit/index.d.ts.map +1 -1
  202. package/ui/hooks/cui-kit/use-ambient-attract-timers.d.ts +0 -1
  203. package/ui/hooks/cui-kit/use-ambient-attract-timers.d.ts.map +1 -1
  204. package/ui/hooks/cui-kit/use-beverages.d.ts +1 -2
  205. package/ui/hooks/cui-kit/use-beverages.d.ts.map +1 -1
  206. package/ui/hooks/cui-kit/use-brands.d.ts +1 -2
  207. package/ui/hooks/cui-kit/use-brands.d.ts.map +1 -1
  208. package/ui/hooks/cui-kit/use-cui-kit.d.ts +3 -4
  209. package/ui/hooks/cui-kit/use-cui-kit.d.ts.map +1 -1
  210. package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts +0 -1
  211. package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts.map +1 -1
  212. package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts +0 -1
  213. package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts.map +1 -1
  214. package/ui/hooks/cui-kit/use-dispense-timers.d.ts +0 -1
  215. package/ui/hooks/cui-kit/use-dispense-timers.d.ts.map +1 -1
  216. package/ui/hooks/cui-kit/use-flavors.d.ts +1 -2
  217. package/ui/hooks/cui-kit/use-flavors.d.ts.map +1 -1
  218. package/ui/hooks/device-assembly/index.d.ts.map +1 -1
  219. package/ui/hooks/device-assembly/use-device-assembly.d.ts +1 -2
  220. package/ui/hooks/device-assembly/use-device-assembly.d.ts.map +1 -1
  221. package/ui/hooks/device-assembly/with-device-assembly.d.ts +0 -1
  222. package/ui/hooks/device-assembly/with-device-assembly.d.ts.map +1 -1
  223. package/ui/hooks/generic-pour/index.d.ts.map +1 -1
  224. package/ui/hooks/generic-pour/use-generic-pour.d.ts +2 -3
  225. package/ui/hooks/generic-pour/use-generic-pour.d.ts.map +1 -1
  226. package/ui/hooks/generic-pour/with-generic-pour.d.ts +0 -1
  227. package/ui/hooks/generic-pour/with-generic-pour.d.ts.map +1 -1
  228. package/ui/hooks/holder/index.d.ts.map +1 -1
  229. package/ui/hooks/holder/use-holder.d.ts +1 -2
  230. package/ui/hooks/holder/use-holder.d.ts.map +1 -1
  231. package/ui/hooks/holder/with-holder.d.ts +0 -1
  232. package/ui/hooks/holder/with-holder.d.ts.map +1 -1
  233. package/ui/hooks/holder-container/index.d.ts.map +1 -1
  234. package/ui/hooks/holder-container/use-holder-container.d.ts +1 -2
  235. package/ui/hooks/holder-container/use-holder-container.d.ts.map +1 -1
  236. package/ui/hooks/holder-container/with-holder-container.d.ts +0 -1
  237. package/ui/hooks/holder-container/with-holder-container.d.ts.map +1 -1
  238. package/ui/hooks/index.d.ts.map +1 -1
  239. package/ui/hooks/ingredient/index.d.ts.map +1 -1
  240. package/ui/hooks/ingredient/use-ingredient-pour.d.ts +2 -3
  241. package/ui/hooks/ingredient/use-ingredient-pour.d.ts.map +1 -1
  242. package/ui/hooks/ingredient/use-ingredient.d.ts +1 -2
  243. package/ui/hooks/ingredient/use-ingredient.d.ts.map +1 -1
  244. package/ui/hooks/ingredient/with-ingredient.d.ts +0 -1
  245. package/ui/hooks/ingredient/with-ingredient.d.ts.map +1 -1
  246. package/ui/hooks/ingredient-container/index.d.ts.map +1 -1
  247. package/ui/hooks/ingredient-container/use-ingredient-container.d.ts +1 -2
  248. package/ui/hooks/ingredient-container/use-ingredient-container.d.ts.map +1 -1
  249. package/ui/hooks/ingredient-container/with-ingredient-container.d.ts +0 -1
  250. package/ui/hooks/ingredient-container/with-ingredient-container.d.ts.map +1 -1
  251. package/ui/hooks/nozzle/index.d.ts.map +1 -1
  252. package/ui/hooks/nozzle/use-dispense-kit.d.ts +0 -1
  253. package/ui/hooks/nozzle/use-dispense-kit.d.ts.map +1 -1
  254. package/ui/hooks/nozzle/use-nozzle.d.ts +1 -2
  255. package/ui/hooks/nozzle/use-nozzle.d.ts.map +1 -1
  256. package/ui/hooks/nozzle/with-nozzle.d.ts +0 -1
  257. package/ui/hooks/nozzle/with-nozzle.d.ts.map +1 -1
  258. package/ui/hooks/nozzle-pour/index.d.ts.map +1 -1
  259. package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts +3 -4
  260. package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts.map +1 -1
  261. package/ui/hooks/pour/index.d.ts.map +1 -1
  262. package/ui/hooks/pour/use-pour.d.ts +4 -5
  263. package/ui/hooks/pour/use-pour.d.ts.map +1 -1
  264. package/ui/hooks/pump/index.d.ts.map +1 -1
  265. package/ui/hooks/pump/use-pump.d.ts +1 -2
  266. package/ui/hooks/pump/use-pump.d.ts.map +1 -1
  267. package/ui/hooks/pump/with-pump.d.ts +0 -1
  268. package/ui/hooks/pump/with-pump.d.ts.map +1 -1
  269. package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts +1 -2
  270. package/ui/hooks/utils/pour-strategy/hold-to-pour-intent-strategy.d.ts.map +1 -1
  271. package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts +0 -1
  272. package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts.map +1 -1
  273. package/ui/hooks/utils/pour-strategy/index.d.ts.map +1 -1
  274. package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts +1 -2
  275. package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts.map +1 -1
  276. package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts +1 -2
  277. package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts.map +1 -1
  278. package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts +1 -2
  279. package/ui/hooks/utils/pour-strategy/tap-to-pour-intent-strategy.d.ts.map +1 -1
  280. package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts +0 -1
  281. package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts.map +1 -1
  282. package/ui/index.d.ts.map +1 -1
  283. package/ui/utils/pour-context.d.ts.map +1 -1
  284. package/ui.cjs +1 -5
  285. package/ui.cjs.map +1 -1
  286. package/ui.d.ts +1 -0
  287. package/ui.js +64 -68
  288. package/ui.js.map +1 -1
  289. package/dispense-registration-manager-C6k10ipu.cjs.map +0 -1
  290. package/dispense-registration-manager-lJlcyq5G.js.map +0 -1
  291. package/extension-utils-AS0Z5eod.js.map +0 -1
  292. package/extension-utils-DNbm2KRk.cjs.map +0 -1
  293. package/kos-models.json +0 -180
  294. package/pump-provider-BSEusYig.js.map +0 -1
  295. package/pump-provider-D4Ed_gH6.cjs.map +0 -1
@@ -1,13 +1,7 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
- var __publicField = (obj, key, value) => {
5
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
- return value;
7
- };
8
2
  const jsxRuntime = require("@emotion/react/jsx-runtime");
9
3
  const kosUiSdk = require("@kosdev-code/kos-ui-sdk");
10
- const dispenseRegistrationManager = require("./dispense-registration-manager-C6k10ipu.cjs");
4
+ const dispenseRegistrationManager = require("./dispense-registration-manager-BH0mkCQx.cjs");
11
5
  const React = require("react");
12
6
  const useAssembly = () => {
13
7
  const modelId = dispenseRegistrationManager.Assembly.type;
@@ -108,8 +102,7 @@ const useBeverages = ({
108
102
  const [beverages, setBeverages] = React.useState([]);
109
103
  const [selectedBeverage, setSelectedBeverage] = React.useState(null);
110
104
  const companions = React.useMemo(() => {
111
- if (!companionType)
112
- return [];
105
+ if (!companionType) return [];
113
106
  return beverages.map(
114
107
  (brand) => kosUiSdk.getKosCompanionModel(brand, companionType)
115
108
  );
@@ -117,30 +110,29 @@ const useBeverages = ({
117
110
  const selectBeverage = React.useCallback(
118
111
  async (beverage, context, forceUpdate) => {
119
112
  setSelectedBeverage(beverage);
120
- await (nozzle == null ? void 0 : nozzle.setSelectedPourable({ beverage, context }, forceUpdate));
121
- onBeverageSelected == null ? void 0 : onBeverageSelected(beverage);
113
+ await nozzle?.setSelectedPourable({ beverage, context }, forceUpdate);
114
+ onBeverageSelected?.(beverage);
122
115
  },
123
116
  [nozzle, onBeverageSelected]
124
117
  );
125
118
  const clearBeverage = React.useCallback(async () => {
126
119
  setSelectedBeverage(null);
127
- await (nozzle == null ? void 0 : nozzle.setSelectedPourable({ beverage: void 0 }));
128
- onClearBeverage == null ? void 0 : onClearBeverage();
120
+ await nozzle?.setSelectedPourable({ beverage: void 0 });
121
+ onClearBeverage?.();
129
122
  }, [nozzle, onClearBeverage]);
130
123
  React.useEffect(() => {
131
124
  const disposer = kosUiSdk.kosAutoEffect(() => {
132
- if (!nozzle)
133
- return;
125
+ if (!nozzle) return;
134
126
  const selectedBrand = nozzle.selectedBrand;
135
127
  if (!selectedBrand) {
136
128
  const allBeverages = nozzle.getGroupAvailabilityItems("beverages").filter((beverage) => beverage.visible);
137
129
  setBeverages(allBeverages ?? []);
138
- onBeverageListUpdated == null ? void 0 : onBeverageListUpdated(allBeverages);
130
+ onBeverageListUpdated?.(allBeverages);
139
131
  return;
140
132
  }
141
133
  const beverages2 = nozzle.getAvailabilityByParent(selectedBrand.id).filter((b) => b.visible);
142
134
  setBeverages(beverages2 ?? []);
143
- onBeverageListUpdated == null ? void 0 : onBeverageListUpdated(beverages2);
135
+ onBeverageListUpdated?.(beverages2);
144
136
  });
145
137
  return () => {
146
138
  disposer();
@@ -163,8 +155,7 @@ const useBrands = ({
163
155
  const [selectedBrand, setSelectedBrand] = React.useState(null);
164
156
  const [brands, setBrands] = React.useState([]);
165
157
  const companions = React.useMemo(() => {
166
- if (!companionType)
167
- return [];
158
+ if (!companionType) return [];
168
159
  return brands.map((brand) => kosUiSdk.getKosCompanionModel(brand, companionType));
169
160
  }, [brands, companionType]);
170
161
  const selectBrand = React.useCallback(
@@ -175,20 +166,19 @@ const useBrands = ({
175
166
  `forceUpdate is not currently supported when setting brand`
176
167
  );
177
168
  }
178
- nozzle == null ? void 0 : nozzle.setSelectedBrand(brand, context);
179
- onBrandSelected == null ? void 0 : onBrandSelected(brand);
169
+ nozzle?.setSelectedBrand(brand, context);
170
+ onBrandSelected?.(brand);
180
171
  },
181
172
  [nozzle, onBrandSelected]
182
173
  );
183
174
  const clearBrand = React.useCallback(() => {
184
175
  setSelectedBrand(null);
185
- nozzle == null ? void 0 : nozzle.setSelectedBrand(void 0);
186
- onBrandCleared == null ? void 0 : onBrandCleared();
176
+ nozzle?.setSelectedBrand(void 0);
177
+ onBrandCleared?.();
187
178
  }, [nozzle, onBrandCleared]);
188
179
  React.useEffect(() => {
189
180
  const disposer = kosUiSdk.kosAutoEffect(() => {
190
- if (!nozzle)
191
- return;
181
+ if (!nozzle) return;
192
182
  setBrands(nozzle.visibleBrands);
193
183
  });
194
184
  return () => {
@@ -204,9 +194,7 @@ const useBrands = ({
204
194
  };
205
195
  };
206
196
  class PourContext {
207
- constructor() {
208
- __publicField(this, "_data", /* @__PURE__ */ new Map());
209
- }
197
+ _data = /* @__PURE__ */ new Map();
210
198
  get(key) {
211
199
  return this._data.get(key);
212
200
  }
@@ -227,14 +215,14 @@ const logger$7 = kosUiSdk.KosLog.createLogger({
227
215
  const HoldToPourStrategy = {
228
216
  name: "HoldToPourStrategy",
229
217
  async initiate(nozzle) {
230
- if (!(nozzle == null ? void 0 : nozzle.canPour)) {
231
- logger$7.debug(`Nozzle ${nozzle == null ? void 0 : nozzle.id} cannot pour. Returning early.`);
218
+ if (!nozzle?.canPour) {
219
+ logger$7.debug(`Nozzle ${nozzle?.id} cannot pour. Returning early.`);
232
220
  return;
233
221
  }
234
- await (nozzle == null ? void 0 : nozzle.pour());
222
+ await nozzle?.pour();
235
223
  },
236
224
  async initiateEnded(nozzle) {
237
- await (nozzle == null ? void 0 : nozzle.cancelPour());
225
+ await nozzle?.cancelPour();
238
226
  }
239
227
  };
240
228
  const logger$6 = kosUiSdk.KosLog.createLogger({
@@ -254,18 +242,18 @@ const useNozzlePour = ({
254
242
  pourContext || new PourContext()
255
243
  );
256
244
  const handlePour = React.useCallback(async () => {
257
- const canPour = onBeforePour ? await (onBeforePour == null ? void 0 : onBeforePour(context)) : true;
245
+ const canPour = onBeforePour ? await onBeforePour?.(context) : true;
258
246
  if (canPour) {
259
247
  logger$6.debug(
260
- `[${strategy == null ? void 0 : strategy.name}] - Pour initiated for nozzle ${nozzle == null ? void 0 : nozzle.id}.`
248
+ `[${strategy?.name}] - Pour initiated for nozzle ${nozzle?.id}.`
261
249
  );
262
- strategy == null ? void 0 : strategy.initiate(nozzle);
263
- onPour == null ? void 0 : onPour();
250
+ strategy?.initiate(nozzle);
251
+ onPour?.();
264
252
  } else {
265
253
  logger$6.debug(
266
- `[${strategy == null ? void 0 : strategy.name}] - Did not pass onBeforePour gate for nozzle ${nozzle == null ? void 0 : nozzle.id}. Cancelling pour.`
254
+ `[${strategy?.name}] - Did not pass onBeforePour gate for nozzle ${nozzle?.id}. Cancelling pour.`
267
255
  );
268
- onBeforePourRejected == null ? void 0 : onBeforePourRejected();
256
+ onBeforePourRejected?.();
269
257
  }
270
258
  }, [
271
259
  onPour,
@@ -277,17 +265,16 @@ const useNozzlePour = ({
277
265
  onBeforePourRejected
278
266
  ]);
279
267
  const handleCancelPour = React.useCallback(() => {
280
- var _a;
281
268
  logger$6.debug(
282
- `[${strategy == null ? void 0 : strategy.name}] - Pour initiate ended called for nozzle ${nozzle == null ? void 0 : nozzle.id}.`
269
+ `[${strategy?.name}] - Pour initiate ended called for nozzle ${nozzle?.id}.`
283
270
  );
284
- (_a = strategy == null ? void 0 : strategy.initiateEnded) == null ? void 0 : _a.call(strategy, nozzle);
285
- onPourCancel == null ? void 0 : onPourCancel();
271
+ strategy?.initiateEnded?.(nozzle);
272
+ onPourCancel?.();
286
273
  }, [onPourCancel, nozzle, strategy]);
287
274
  const forceCancelPour = React.useCallback(() => {
288
- logger$6.debug(`Force cancelling pour for nozzle ${nozzle == null ? void 0 : nozzle.id}.`);
289
- nozzle == null ? void 0 : nozzle.cancelPour();
290
- onPourCancel == null ? void 0 : onPourCancel();
275
+ logger$6.debug(`Force cancelling pour for nozzle ${nozzle?.id}.`);
276
+ nozzle?.cancelPour();
277
+ onPourCancel?.();
291
278
  }, [onPourCancel, nozzle]);
292
279
  const handleUpdateContext = React.useCallback(
293
280
  (key, value) => {
@@ -320,12 +307,11 @@ const useFlavors = ({
320
307
  }) => {
321
308
  const { model: nozzle } = useNozzleContext();
322
309
  const flavors = React.useMemo(
323
- () => (nozzle == null ? void 0 : nozzle.getGroupAvailabilityItems("flavors").filter((f) => f.visible)) ?? [],
310
+ () => nozzle?.getGroupAvailabilityItems("flavors").filter((f) => f.visible) ?? [],
324
311
  [nozzle]
325
312
  );
326
313
  const companions = React.useMemo(() => {
327
- if (!companionType)
328
- return [];
314
+ if (!companionType) return [];
329
315
  return flavors.map(
330
316
  (flavor) => kosUiSdk.getKosCompanionModel(flavor, companionType)
331
317
  );
@@ -334,9 +320,9 @@ const useFlavors = ({
334
320
  const selectFlavor = React.useCallback(
335
321
  async (flavor, context, forceUpdate) => {
336
322
  setSelectedFlavors(
337
- (previous) => (previous == null ? void 0 : previous.includes(flavor)) ? [...previous.filter((p) => p !== flavor)] : [...previous ?? [], flavor]
323
+ (previous) => previous?.includes(flavor) ? [...previous.filter((p) => p !== flavor)] : [...previous ?? [], flavor]
338
324
  );
339
- if (nozzle == null ? void 0 : nozzle.selectedPourable) {
325
+ if (nozzle?.selectedPourable) {
340
326
  const { beverage } = nozzle.selectedPourable;
341
327
  await nozzle.setSelectedPourable(
342
328
  {
@@ -347,16 +333,16 @@ const useFlavors = ({
347
333
  forceUpdate
348
334
  );
349
335
  }
350
- onFlavorSelected == null ? void 0 : onFlavorSelected(flavor, selectedFlavors ?? []);
336
+ onFlavorSelected?.(flavor, selectedFlavors ?? []);
351
337
  },
352
338
  [nozzle, onFlavorSelected, selectedFlavors]
353
339
  );
354
340
  const clear = React.useCallback(async () => {
355
341
  setSelectedFlavors([]);
356
- if (nozzle == null ? void 0 : nozzle.selectedPourable) {
342
+ if (nozzle?.selectedPourable) {
357
343
  const { beverage } = nozzle.selectedPourable;
358
344
  nozzle.setSelectedPourable({ beverage });
359
- onFlavorCleared == null ? void 0 : onFlavorCleared();
345
+ onFlavorCleared?.();
360
346
  }
361
347
  }, [nozzle, onFlavorCleared]);
362
348
  return {
@@ -375,7 +361,6 @@ const useCuiKit = ({
375
361
  initialGroup = DISPENSE_GROUP_BRAND,
376
362
  options = {}
377
363
  }) => {
378
- var _a, _b, _c;
379
364
  const [currentGroup, setCurrentGroup] = React.useState(initialGroup);
380
365
  const { model: nozzle } = useNozzleContext();
381
366
  const timersRef = React.useRef([]);
@@ -384,71 +369,69 @@ const useCuiKit = ({
384
369
  const onBrandSelected = React.useCallback(
385
370
  (model) => {
386
371
  setCurrentGroup(DISPENSE_GROUP_BEVERAGE);
387
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/brand/selected/`;
372
+ const topic = `/kos/dispense/${nozzle?.path}/brand/selected/`;
388
373
  kosUiSdk.EventBus.publish(topic, model);
389
374
  },
390
- [nozzle == null ? void 0 : nozzle.path]
375
+ [nozzle?.path]
391
376
  );
392
377
  const onBrandCleared = React.useCallback(() => {
393
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/brand/cleared/`;
378
+ const topic = `/kos/dispense/${nozzle?.path}/brand/cleared/`;
394
379
  kosUiSdk.EventBus.publish(topic, {});
395
- }, [nozzle == null ? void 0 : nozzle.path]);
380
+ }, [nozzle?.path]);
396
381
  const onBeverageListUpdated = React.useCallback(
397
382
  (beverages2) => {
398
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/beverage/list/updated/`;
383
+ const topic = `/kos/dispense/${nozzle?.path}/beverage/list/updated/`;
399
384
  kosUiSdk.EventBus.publish(topic, beverages2);
400
385
  },
401
- [nozzle == null ? void 0 : nozzle.path]
386
+ [nozzle?.path]
402
387
  );
403
388
  const onBeverageSelected = React.useCallback(
404
389
  (model) => {
405
- var _a2;
406
390
  setCurrentGroup(DISPENSE_GROUP_FLAVOR);
407
- (_a2 = updatePourContext.current) == null ? void 0 : _a2.call(updatePourContext, "selectedBeverage", model);
408
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/beverage/selected/`;
391
+ updatePourContext.current?.("selectedBeverage", model);
392
+ const topic = `/kos/dispense/${nozzle?.path}/beverage/selected/`;
409
393
  kosUiSdk.EventBus.publish(topic, model);
410
394
  },
411
- [nozzle == null ? void 0 : nozzle.path]
395
+ [nozzle?.path]
412
396
  );
413
397
  const onBeverageCleared = React.useCallback(() => {
414
- var _a2;
415
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/beverage/cleared/`;
416
- (_a2 = removeFromPourContext.current) == null ? void 0 : _a2.call(removeFromPourContext, "selectedBeverage");
398
+ const topic = `/kos/dispense/${nozzle?.path}/beverage/cleared/`;
399
+ removeFromPourContext.current?.("selectedBeverage");
417
400
  kosUiSdk.EventBus.publish(topic, {});
418
- }, [nozzle == null ? void 0 : nozzle.path]);
401
+ }, [nozzle?.path]);
419
402
  const onFlavorSelected = React.useCallback(
420
403
  (model) => {
421
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/flavor/selected/`;
404
+ const topic = `/kos/dispense/${nozzle?.path}/flavor/selected/`;
422
405
  kosUiSdk.EventBus.publish(topic, model);
423
406
  },
424
- [nozzle == null ? void 0 : nozzle.path]
407
+ [nozzle?.path]
425
408
  );
426
409
  const onFlavorCleared = React.useCallback(() => {
427
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/flavor/cleared/`;
410
+ const topic = `/kos/dispense/${nozzle?.path}/flavor/cleared/`;
428
411
  kosUiSdk.EventBus.publish(topic, {});
429
- }, [nozzle == null ? void 0 : nozzle.path]);
412
+ }, [nozzle?.path]);
430
413
  const onPour = React.useCallback(() => {
431
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/pour/`;
414
+ const topic = `/kos/dispense/${nozzle?.path}/pour/`;
432
415
  kosUiSdk.EventBus.publish(topic, {});
433
- }, [nozzle == null ? void 0 : nozzle.path]);
416
+ }, [nozzle?.path]);
434
417
  const handleBeforePour = React.useCallback(
435
418
  async (context) => {
436
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/pre/pour/`;
419
+ const topic = `/kos/dispense/${nozzle?.path}/pre/pour/`;
437
420
  kosUiSdk.EventBus.publish(topic, {});
438
- return await (onBeforePour == null ? void 0 : onBeforePour(context)) || true;
421
+ return await onBeforePour?.(context) || true;
439
422
  },
440
- [nozzle == null ? void 0 : nozzle.path]
423
+ [nozzle?.path]
441
424
  );
442
425
  const handleBeforePourRejected = React.useCallback(async () => {
443
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/pre/pour/rejected/`;
426
+ const topic = `/kos/dispense/${nozzle?.path}/pre/pour/rejected/`;
444
427
  kosUiSdk.EventBus.publish(topic, {});
445
- }, [nozzle == null ? void 0 : nozzle.path]);
428
+ }, [nozzle?.path]);
446
429
  const onPourCancel = React.useCallback(() => {
447
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/pour/cancel/`;
430
+ const topic = `/kos/dispense/${nozzle?.path}/pour/cancel/`;
448
431
  kosUiSdk.EventBus.publish(topic, {});
449
- }, [nozzle == null ? void 0 : nozzle.path]);
432
+ }, [nozzle?.path]);
450
433
  const { brands, selectBrand, selectedBrand, clearBrand, brandCompanions } = useBrands({
451
- companionType: (_a = options.companionTypes) == null ? void 0 : _a.brand,
434
+ companionType: options.companionTypes?.brand,
452
435
  onBrandSelected,
453
436
  onBrandCleared
454
437
  });
@@ -459,7 +442,7 @@ const useCuiKit = ({
459
442
  clearBeverage,
460
443
  beverageCompanions
461
444
  } = useBeverages({
462
- companionType: (_b = options.companionTypes) == null ? void 0 : _b.beverage,
445
+ companionType: options.companionTypes?.beverage,
463
446
  onBeverageSelected,
464
447
  onClearBeverage: onBeverageCleared,
465
448
  onBeverageListUpdated
@@ -471,7 +454,7 @@ const useCuiKit = ({
471
454
  selectedFlavors,
472
455
  flavorCompanions
473
456
  } = useFlavors({
474
- companionType: (_c = options.companionTypes) == null ? void 0 : _c.flavor,
457
+ companionType: options.companionTypes?.flavor,
475
458
  onFlavorSelected,
476
459
  onFlavorCleared
477
460
  });
@@ -503,7 +486,7 @@ const useCuiKit = ({
503
486
  }
504
487
  }, [clearBeverage, clearBrand, currentGroup, initialGroup]);
505
488
  const home = React.useCallback(() => {
506
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/home/`;
489
+ const topic = `/kos/dispense/${nozzle?.path}/home/`;
507
490
  kosUiSdk.EventBus.publish(topic, {});
508
491
  setCurrentGroup(initialGroup);
509
492
  if (initialGroup === DISPENSE_GROUP_BRAND) {
@@ -604,31 +587,31 @@ const useAmbientAttractTimers = (props) => {
604
587
  const handleAmbientTimer = React.useCallback(() => {
605
588
  if (onAmbientTimer) {
606
589
  kosUiSdk.KosLog.info("Ambient timer expired. Calling callback");
607
- onAmbientTimer == null ? void 0 : onAmbientTimer();
590
+ onAmbientTimer?.();
608
591
  }
609
592
  }, [onAmbientTimer]);
610
593
  const handleAttractTimer = React.useCallback(() => {
611
594
  if (onAttractTimer) {
612
595
  kosUiSdk.KosLog.info("Attract timer expired. Calling callback");
613
- onAttractTimer == null ? void 0 : onAttractTimer();
596
+ onAttractTimer?.();
614
597
  }
615
598
  }, [onAttractTimer]);
616
599
  const handleResetAttractTimer = React.useCallback(() => {
617
600
  if (attractTimer) {
618
601
  attractTimer.restart();
619
- onResetAttractTimer == null ? void 0 : onResetAttractTimer();
602
+ onResetAttractTimer?.();
620
603
  }
621
604
  }, [attractTimer, onResetAttractTimer]);
622
605
  const handlePauseAttractTimer = React.useCallback(() => {
623
606
  if (attractTimer) {
624
607
  attractTimer.reset();
625
- onResetAttractTimer == null ? void 0 : onResetAttractTimer();
608
+ onResetAttractTimer?.();
626
609
  }
627
610
  }, [attractTimer, onResetAttractTimer]);
628
611
  const handleResume = React.useCallback(() => {
629
612
  if (attractTimer) {
630
613
  attractTimer.pause();
631
- onResumeAttractTimer == null ? void 0 : onResumeAttractTimer();
614
+ onResumeAttractTimer?.();
632
615
  }
633
616
  }, [attractTimer, onResumeAttractTimer]);
634
617
  React.useEffect(() => {
@@ -639,25 +622,25 @@ const useAmbientAttractTimers = (props) => {
639
622
  defaultAttractTime
640
623
  );
641
624
  if (defaultAttractTime) {
642
- timer == null ? void 0 : timer.addTimeoutAction({
625
+ timer?.addTimeoutAction({
643
626
  name: "attract-timer",
644
627
  remainingTime: 0,
645
628
  action: handleAttractTimer
646
629
  });
647
630
  }
648
631
  if (defaultAmbientTime) {
649
- timer == null ? void 0 : timer.addTimeoutAction({
632
+ timer?.addTimeoutAction({
650
633
  name: "ambient-timer",
651
634
  remainingTime: defaultAmbientTime,
652
635
  action: handleAmbientTimer
653
636
  });
654
637
  }
655
638
  if (defaultAttractTime) {
656
- timer == null ? void 0 : timer.start();
639
+ timer?.start();
657
640
  }
658
641
  setAttractTimer(timer ?? null);
659
642
  return () => {
660
- timer == null ? void 0 : timer.reset();
643
+ timer?.reset();
661
644
  setAttractTimer(null);
662
645
  };
663
646
  }
@@ -743,7 +726,7 @@ const useDispenseLifecycle = ({
743
726
  }) => {
744
727
  const { model: nozzle } = useNozzleContext();
745
728
  React.useEffect(() => {
746
- const topics = buildDispenseTopics(nozzle == null ? void 0 : nozzle.path, {
729
+ const topics = buildDispenseTopics(nozzle?.path, {
747
730
  onBrandSelected,
748
731
  onBrandCleared,
749
732
  onBeverageListUpdated,
@@ -766,10 +749,10 @@ const useDispenseLifecycle = ({
766
749
  ({ topic, callback }) => subscribe(topic, callback)
767
750
  );
768
751
  return () => {
769
- disposers.forEach((disposer) => disposer == null ? void 0 : disposer());
752
+ disposers.forEach((disposer) => disposer?.());
770
753
  };
771
754
  }, [
772
- nozzle == null ? void 0 : nozzle.path,
755
+ nozzle?.path,
773
756
  onAmbientTimer,
774
757
  onAttractTimer,
775
758
  onBeverageCleared,
@@ -805,7 +788,7 @@ const useCuiKitTimers = (props) => {
805
788
  if (!hasAreYouThereFiredRef.current && onAreYouThereTimer) {
806
789
  kosUiSdk.KosLog.info("Are you there timer expired. Calling callback");
807
790
  hasAreYouThereFiredRef.current = true;
808
- onAreYouThereTimer == null ? void 0 : onAreYouThereTimer();
791
+ onAreYouThereTimer?.();
809
792
  }
810
793
  }, [onAreYouThereTimer]);
811
794
  const handleIdleTimer = React.useCallback(() => {
@@ -815,7 +798,7 @@ const useCuiKitTimers = (props) => {
815
798
  );
816
799
  if (onIdleTimer) {
817
800
  log$1.debug("Idle timer expired. Calling callback");
818
- onIdleTimer == null ? void 0 : onIdleTimer();
801
+ onIdleTimer?.();
819
802
  } else {
820
803
  log$1.debug("No onIdleTimer callback provided!");
821
804
  }
@@ -825,7 +808,7 @@ const useCuiKitTimers = (props) => {
825
808
  if (idleTimer) {
826
809
  idleTimer.restart();
827
810
  hasAreYouThereFiredRef.current = false;
828
- onResetIdleTimer == null ? void 0 : onResetIdleTimer();
811
+ onResetIdleTimer?.();
829
812
  }
830
813
  }, [idleTimer, onResetIdleTimer, props.prefix]);
831
814
  const handlePauseIdleTimer = React.useCallback(() => {
@@ -833,12 +816,12 @@ const useCuiKitTimers = (props) => {
833
816
  if (idleTimer) {
834
817
  idleTimer.reset();
835
818
  hasAreYouThereFiredRef.current = false;
836
- onResetIdleTimer == null ? void 0 : onResetIdleTimer();
819
+ onResetIdleTimer?.();
837
820
  }
838
821
  }, [idleTimer, onResetIdleTimer, props.prefix]);
839
822
  React.useEffect(() => {
840
823
  log$1.debug(
841
- `useCuiKitTimers effect triggered - nozzle: ${!!nozzle}, path: ${nozzle == null ? void 0 : nozzle.path}, callbacks: handleIdle=${!!handleIdleTimer}, handleAreYouThere=${!!handleAreYouThereTimer}`
824
+ `useCuiKitTimers effect triggered - nozzle: ${!!nozzle}, path: ${nozzle?.path}, callbacks: handleIdle=${!!handleIdleTimer}, handleAreYouThere=${!!handleAreYouThereTimer}`
842
825
  );
843
826
  if (nozzle) {
844
827
  log$1.info("Nozzle is available. Creating timers");
@@ -850,19 +833,19 @@ const useCuiKitTimers = (props) => {
850
833
  `Adding idle timer action for ${props.prefix ?? ""}idle-timer-${nozzle.path} with callback:`,
851
834
  !!handleIdleTimer
852
835
  );
853
- timer == null ? void 0 : timer.addTimeoutAction({
836
+ timer?.addTimeoutAction({
854
837
  name: "idle-timer",
855
838
  remainingTime: 0,
856
839
  action: handleIdleTimer
857
840
  });
858
- timer == null ? void 0 : timer.addTimeoutAction({
841
+ timer?.addTimeoutAction({
859
842
  name: "are-you-there-timer",
860
843
  remainingTime: defaultAreYouThereTime,
861
844
  action: handleAreYouThereTimer
862
845
  });
863
846
  setIdleTimer(timer ?? null);
864
847
  return () => {
865
- timer == null ? void 0 : timer.reset();
848
+ timer?.reset();
866
849
  setIdleTimer(null);
867
850
  };
868
851
  }
@@ -892,26 +875,25 @@ const useDefaultCuiKitLifecycle = ({
892
875
  onBeforeAreYouThereTimer,
893
876
  areYouThereRejectionPolicy = "pause"
894
877
  }) => {
895
- var _a, _b, _c, _d;
896
878
  const [showAmbientScreen, setShowAmbientScreen] = React.useState(false);
897
879
  const [showAttractScreen, setShowAttractScreen] = React.useState(false);
898
880
  const { model: nozzle } = useNozzleContext();
899
881
  const [hasPoured, setHasPoured] = React.useState(false);
900
- const idleTimeout = (inactivity == null ? void 0 : inactivity.idleTimeout) ?? 15;
901
- const areYouThereTimeout = (inactivity == null ? void 0 : inactivity.areYouThereTimeoutOffset) ?? 10;
902
- const idlePourTimeout = (pour == null ? void 0 : pour.idleTimeout) ?? (inactivity == null ? void 0 : inactivity.idleTimeout) ?? 10;
903
- const areYouTherePourTimeout = (pour == null ? void 0 : pour.areYouThereTimeoutOffset) ?? (inactivity == null ? void 0 : inactivity.areYouThereTimeoutOffset) ?? 5;
904
- const ambientTimeout = screens == null ? void 0 : screens.ambientTimeoutOffset;
905
- const attractTimeout = screens == null ? void 0 : screens.attractTimeout;
882
+ const idleTimeout = inactivity?.idleTimeout ?? 15;
883
+ const areYouThereTimeout = inactivity?.areYouThereTimeoutOffset ?? 10;
884
+ const idlePourTimeout = pour?.idleTimeout ?? inactivity?.idleTimeout ?? 10;
885
+ const areYouTherePourTimeout = pour?.areYouThereTimeoutOffset ?? inactivity?.areYouThereTimeoutOffset ?? 5;
886
+ const ambientTimeout = screens?.ambientTimeoutOffset;
887
+ const attractTimeout = screens?.attractTimeout;
906
888
  const handleIdleTimeout = React.useCallback(() => {
907
889
  log.info("handleIdleTimeout called - navigating home and publishing event");
908
890
  setShowAreYouThere(false);
909
- kit == null ? void 0 : kit.nav.home();
891
+ kit?.nav.home();
910
892
  if (nozzle) {
911
893
  const topic = `/kos/dispense/${nozzle.path}/idle/timeout/`;
912
894
  kosUiSdk.EventBus.publish(topic, {});
913
895
  }
914
- }, [(_a = kit == null ? void 0 : kit.nav) == null ? void 0 : _a.home, nozzle]);
896
+ }, [kit?.nav?.home, nozzle]);
915
897
  const handleResetIdleTimer = React.useCallback(() => {
916
898
  log.info("handleResetIdleTimer called - resetting idle timer");
917
899
  setShowAreYouThere(false);
@@ -940,13 +922,13 @@ const useDefaultCuiKitLifecycle = ({
940
922
  if (attractTimeout) {
941
923
  setShowAttractScreen(false);
942
924
  setShowAmbientScreen(false);
943
- kit == null ? void 0 : kit.nav.home();
925
+ kit?.nav.home();
944
926
  if (nozzle) {
945
927
  const topic = `/kos/dispense/${nozzle.path}/attract/resume/`;
946
928
  kosUiSdk.EventBus.publish(topic, {});
947
929
  }
948
930
  }
949
- }, [kit == null ? void 0 : kit.nav, attractTimeout, nozzle]);
931
+ }, [kit?.nav, attractTimeout, nozzle]);
950
932
  const {
951
933
  pause: ambientPause,
952
934
  restart: ambientRestart,
@@ -958,7 +940,7 @@ const useDefaultCuiKitLifecycle = ({
958
940
  onAttractTimer: handleAttractTimer,
959
941
  onResumeAttractTimer: handleAttractResume
960
942
  });
961
- (_b = kit == null ? void 0 : kit.timers) == null ? void 0 : _b.add(attractTimer);
943
+ kit?.timers?.add(attractTimer);
962
944
  const [showAreYouThere, setShowAreYouThere] = React.useState(false);
963
945
  log.info(
964
946
  "Creating idle timer with timeout:",
@@ -1054,8 +1036,8 @@ const useDefaultCuiKitLifecycle = ({
1054
1036
  });
1055
1037
  }
1056
1038
  }, [pourIdleTimer, areYouTherePourTimeout, handleAreYouThereTimer]);
1057
- (_c = kit == null ? void 0 : kit.timers) == null ? void 0 : _c.add(idleTimer);
1058
- (_d = kit == null ? void 0 : kit.timers) == null ? void 0 : _d.add(pourIdleTimer);
1039
+ kit?.timers?.add(idleTimer);
1040
+ kit?.timers?.add(pourIdleTimer);
1059
1041
  const handlePour = React.useCallback(() => {
1060
1042
  setHasPoured(false);
1061
1043
  pausePourTimer();
@@ -1126,7 +1108,7 @@ const useDefaultCuiKitLifecycle = ({
1126
1108
  const areYouThereCountdown = hasPoured ? areYouTherePourTimeout : areYouThereTimeout;
1127
1109
  React.useEffect(() => {
1128
1110
  if (nozzle && attractTimer) {
1129
- const topic = `/kos/dispense/${nozzle == null ? void 0 : nozzle.path}/init/`;
1111
+ const topic = `/kos/dispense/${nozzle?.path}/init/`;
1130
1112
  kosUiSdk.EventBus.publish(topic, {});
1131
1113
  }
1132
1114
  }, [nozzle, attractTimer]);
@@ -1203,19 +1185,19 @@ const logger$5 = kosUiSdk.KosLog.createLogger({
1203
1185
  const HoldToPourIntentStrategy = {
1204
1186
  name: "HoldToPourIntentStrategy",
1205
1187
  async initiate(model, intent) {
1206
- if (!(model == null ? void 0 : model.canPour)) {
1207
- logger$5.debug(`${model == null ? void 0 : model.id} cannot pour. Returning early.`);
1188
+ if (!model?.canPour) {
1189
+ logger$5.debug(`${model?.id} cannot pour. Returning early.`);
1208
1190
  return;
1209
1191
  }
1210
1192
  if (intent) {
1211
1193
  logger$5.debug(`performing intent: ${intent}`);
1212
- await (model == null ? void 0 : model.performIntent(intent));
1194
+ await model?.performIntent(intent);
1213
1195
  } else {
1214
1196
  logger$5.debug("no intent provided. Returning early.");
1215
1197
  }
1216
1198
  },
1217
1199
  async initiateEnded(nozzle) {
1218
- await (nozzle == null ? void 0 : nozzle.cancelPour());
1200
+ await nozzle?.cancelPour();
1219
1201
  }
1220
1202
  };
1221
1203
  const logger$4 = kosUiSdk.KosLog.createLogger({
@@ -1230,23 +1212,22 @@ const useIngredientPour = ({
1230
1212
  }) => {
1231
1213
  const handlePour = React.useCallback(() => {
1232
1214
  logger$4.debug(
1233
- `[${strategy == null ? void 0 : strategy.name}] - Pour initiated for model ${intentContainer == null ? void 0 : intentContainer.id}.`
1215
+ `[${strategy?.name}] - Pour initiated for model ${intentContainer?.id}.`
1234
1216
  );
1235
- strategy == null ? void 0 : strategy.initiate(intentContainer);
1236
- onPour == null ? void 0 : onPour();
1217
+ strategy?.initiate(intentContainer);
1218
+ onPour?.();
1237
1219
  }, [onPour, intentContainer, strategy]);
1238
1220
  const handleCancelPour = React.useCallback(() => {
1239
- var _a;
1240
1221
  logger$4.debug(
1241
- `[${strategy == null ? void 0 : strategy.name}] - Pour initiate ended called for nozzle ${intentContainer == null ? void 0 : intentContainer.id}.`
1222
+ `[${strategy?.name}] - Pour initiate ended called for nozzle ${intentContainer?.id}.`
1242
1223
  );
1243
- (_a = strategy == null ? void 0 : strategy.initiateEnded) == null ? void 0 : _a.call(strategy, intentContainer);
1244
- onPourCancel == null ? void 0 : onPourCancel();
1224
+ strategy?.initiateEnded?.(intentContainer);
1225
+ onPourCancel?.();
1245
1226
  }, [onPourCancel, intentContainer, strategy]);
1246
1227
  const forceCancelPour = React.useCallback(() => {
1247
- logger$4.debug(`Force cancelling pour for nozzle ${intentContainer == null ? void 0 : intentContainer.id}.`);
1248
- intentContainer == null ? void 0 : intentContainer.cancelPour();
1249
- onPourCancel == null ? void 0 : onPourCancel();
1228
+ logger$4.debug(`Force cancelling pour for nozzle ${intentContainer?.id}.`);
1229
+ intentContainer?.cancelPour();
1230
+ onPourCancel?.();
1250
1231
  }, [onPourCancel, intentContainer]);
1251
1232
  const handlers = kosUiSdk.usePressGesture({
1252
1233
  onPressed: handlePour,
@@ -1303,39 +1284,38 @@ const usePourTarget = ({
1303
1284
  );
1304
1285
  const handlePour = React.useCallback(async () => {
1305
1286
  logger$3.debug(
1306
- `[${strategy == null ? void 0 : strategy.name}] - calling before pour for pour target ${pourTarget == null ? void 0 : pourTarget.id}.`
1287
+ `[${strategy?.name}] - calling before pour for pour target ${pourTarget?.id}.`
1307
1288
  );
1308
- const canPour = onBeforePour ? await (onBeforePour == null ? void 0 : onBeforePour(context)) : true;
1289
+ const canPour = onBeforePour ? await onBeforePour?.(context) : true;
1309
1290
  if (canPour) {
1310
1291
  logger$3.debug(
1311
- `[${strategy == null ? void 0 : strategy.name}] - Pour initiated for pour target ${pourTarget == null ? void 0 : pourTarget.id}.`
1292
+ `[${strategy?.name}] - Pour initiated for pour target ${pourTarget?.id}.`
1312
1293
  );
1313
- await (strategy == null ? void 0 : strategy.initiate(pourTarget));
1314
- onPour == null ? void 0 : onPour();
1315
- if (!(pourTarget == null ? void 0 : pourTarget.isPouring)) {
1316
- onPourAbort == null ? void 0 : onPourAbort();
1294
+ await strategy?.initiate(pourTarget);
1295
+ onPour?.();
1296
+ if (!pourTarget?.isPouring) {
1297
+ onPourAbort?.();
1317
1298
  }
1318
1299
  } else {
1319
1300
  logger$3.debug(
1320
- `[${strategy == null ? void 0 : strategy.name}] - Pour cancelled for pour target ${pourTarget == null ? void 0 : pourTarget.id}.`
1301
+ `[${strategy?.name}] - Pour cancelled for pour target ${pourTarget?.id}.`
1321
1302
  );
1322
- onPourCancel == null ? void 0 : onPourCancel();
1303
+ onPourCancel?.();
1323
1304
  }
1324
1305
  }, [onPour, onBeforePour, onPourAbort, pourTarget, strategy, context]);
1325
1306
  const handleCancelPour = React.useCallback(async () => {
1326
- var _a;
1327
1307
  logger$3.debug(
1328
- `[${strategy == null ? void 0 : strategy.name}] - Pour initiate ended called for pour target ${pourTarget == null ? void 0 : pourTarget.id}.`
1308
+ `[${strategy?.name}] - Pour initiate ended called for pour target ${pourTarget?.id}.`
1329
1309
  );
1330
- const ignore = await ((_a = strategy == null ? void 0 : strategy.initiateEnded) == null ? void 0 : _a.call(strategy, pourTarget));
1310
+ const ignore = await strategy?.initiateEnded?.(pourTarget);
1331
1311
  if (!ignore) {
1332
- onPourCancel == null ? void 0 : onPourCancel();
1312
+ onPourCancel?.();
1333
1313
  }
1334
1314
  }, [onPourCancel, pourTarget, strategy]);
1335
1315
  const forceCancelPour = React.useCallback(async () => {
1336
- logger$3.debug(`Force cancelling pour for pour target ${pourTarget == null ? void 0 : pourTarget.id}.`);
1337
- await (pourTarget == null ? void 0 : pourTarget.cancelPour());
1338
- onPourCancel == null ? void 0 : onPourCancel();
1316
+ logger$3.debug(`Force cancelling pour for pour target ${pourTarget?.id}.`);
1317
+ await pourTarget?.cancelPour();
1318
+ onPourCancel?.();
1339
1319
  }, [onPourCancel, pourTarget]);
1340
1320
  const handleUpdateContext = React.useCallback(
1341
1321
  (key, value) => {
@@ -1366,42 +1346,41 @@ const logger$2 = kosUiSdk.KosLog.createLogger({
1366
1346
  group: "kos-hooks"
1367
1347
  });
1368
1348
  class TapOrHoldIntentStrategy {
1349
+ intent;
1350
+ name = "TapOrHoldIntentStrategy";
1351
+ isHold = false;
1352
+ disposer = null;
1369
1353
  constructor(intent) {
1370
- __publicField(this, "intent");
1371
- __publicField(this, "name", "TapOrHoldIntentStrategy");
1372
- __publicField(this, "isHold", false);
1373
- __publicField(this, "disposer", null);
1374
1354
  this.intent = intent;
1375
1355
  }
1376
1356
  async initiate(model, intent) {
1377
1357
  this.disposer = setTimeout(() => {
1378
1358
  this.isHold = true;
1379
1359
  }, 250);
1380
- if ((model == null ? void 0 : model.isPouring) && !this.isHold) {
1360
+ if (model?.isPouring && !this.isHold) {
1381
1361
  logger$2.debug(`additional tap detected. cancelling pour`);
1382
1362
  await model.cancelPour();
1383
1363
  return;
1384
1364
  }
1385
- if (!(model == null ? void 0 : model.canPour)) {
1386
- logger$2.debug(`${model == null ? void 0 : model.id} cannot pour. Returning early.`);
1365
+ if (!model?.canPour) {
1366
+ logger$2.debug(`${model?.id} cannot pour. Returning early.`);
1387
1367
  return;
1388
1368
  }
1389
1369
  if (intent) {
1390
1370
  logger$2.debug(`performing intent: ${intent}`);
1391
- await (model == null ? void 0 : model.performIntent(intent));
1371
+ await model?.performIntent(intent);
1392
1372
  } else {
1393
1373
  logger$2.debug("no intent provided. Returning early.");
1394
1374
  }
1395
1375
  }
1396
1376
  async initiateEnded(nozzle) {
1397
- if (this.disposer)
1398
- clearTimeout(this.disposer);
1377
+ if (this.disposer) clearTimeout(this.disposer);
1399
1378
  this.disposer = null;
1400
1379
  if (!this.isHold) {
1401
1380
  logger$2.debug("Tap detected. don't cancel and return.");
1402
1381
  return true;
1403
1382
  }
1404
- await (nozzle == null ? void 0 : nozzle.cancelPour());
1383
+ await nozzle?.cancelPour();
1405
1384
  return false;
1406
1385
  }
1407
1386
  }
@@ -1412,18 +1391,18 @@ const logger$1 = kosUiSdk.KosLog.createLogger({
1412
1391
  const TapToPourIntentStrategy = {
1413
1392
  name: "TapToPourIntentStrategy",
1414
1393
  async initiate(model, intent) {
1415
- if (model == null ? void 0 : model.isPouring) {
1416
- logger$1.debug(`Nozzle ${model == null ? void 0 : model.id} is already pouring. cancelling pour`);
1394
+ if (model?.isPouring) {
1395
+ logger$1.debug(`Nozzle ${model?.id} is already pouring. cancelling pour`);
1417
1396
  await model.cancelPour();
1418
1397
  return;
1419
1398
  }
1420
- if (!(model == null ? void 0 : model.canPour)) {
1421
- logger$1.debug(`Nozzle ${model == null ? void 0 : model.id} cannot pour. Returning early.`);
1399
+ if (!model?.canPour) {
1400
+ logger$1.debug(`Nozzle ${model?.id} cannot pour. Returning early.`);
1422
1401
  return;
1423
1402
  }
1424
1403
  if (intent) {
1425
1404
  logger$1.debug(`performing intent: ${intent}`);
1426
- await (model == null ? void 0 : model.performIntent(intent));
1405
+ await model?.performIntent(intent);
1427
1406
  } else {
1428
1407
  logger$1.debug("no intent provided. Returning early.");
1429
1408
  }
@@ -1439,16 +1418,16 @@ const logger = kosUiSdk.KosLog.createLogger({
1439
1418
  const TapToPourStrategy = {
1440
1419
  name: "TapToPourStrategy",
1441
1420
  async initiate(nozzle) {
1442
- if (nozzle == null ? void 0 : nozzle.isPouring) {
1443
- logger.debug(`Nozzle ${nozzle == null ? void 0 : nozzle.id} is already pouring. cancelling pour`);
1421
+ if (nozzle?.isPouring) {
1422
+ logger.debug(`Nozzle ${nozzle?.id} is already pouring. cancelling pour`);
1444
1423
  await nozzle.cancelPour();
1445
1424
  return;
1446
1425
  }
1447
- if (!(nozzle == null ? void 0 : nozzle.canPour)) {
1448
- logger.debug(`Nozzle ${nozzle == null ? void 0 : nozzle.id} cannot pour. Returning early.`);
1426
+ if (!nozzle?.canPour) {
1427
+ logger.debug(`Nozzle ${nozzle?.id} cannot pour. Returning early.`);
1449
1428
  return;
1450
1429
  }
1451
- await (nozzle == null ? void 0 : nozzle.pour());
1430
+ await nozzle?.pour();
1452
1431
  },
1453
1432
  async initiateEnded(_nozzle) {
1454
1433
  return true;
@@ -1608,8 +1587,8 @@ function DispenseView({
1608
1587
  props
1609
1588
  }) {
1610
1589
  const { nozzlePaths } = useDeviceAssemblyContext();
1611
- const totalNozzles = (nozzlePaths == null ? void 0 : nozzlePaths.length) || 0;
1612
- const nozzles = (nozzlePaths == null ? void 0 : nozzlePaths.map((path, index) => /* @__PURE__ */ jsxRuntime.jsx(NozzleProvider, { path, children: /* @__PURE__ */ jsxRuntime.jsx(
1590
+ const totalNozzles = nozzlePaths?.length || 0;
1591
+ const nozzles = nozzlePaths?.map((path, index) => /* @__PURE__ */ jsxRuntime.jsx(NozzleProvider, { path, children: /* @__PURE__ */ jsxRuntime.jsx(
1613
1592
  CuiKitWrapper,
1614
1593
  {
1615
1594
  provider,
@@ -1623,7 +1602,7 @@ function DispenseView({
1623
1602
  },
1624
1603
  children
1625
1604
  }
1626
- ) }, path))) || [];
1605
+ ) }, path)) || [];
1627
1606
  return nozzles;
1628
1607
  }
1629
1608
  function CuiKit({
@@ -1821,4 +1800,4 @@ exports.withHolderContainer = withHolderContainer;
1821
1800
  exports.withIngredient = withIngredient;
1822
1801
  exports.withIngredientContainer = withIngredientContainer;
1823
1802
  exports.withNozzle = withNozzle;
1824
- //# sourceMappingURL=pump-provider-D4Ed_gH6.cjs.map
1803
+ //# sourceMappingURL=pump-provider-D4iVLU-o.cjs.map