@kosdev-code/kos-ddk-models 0.1.0-dev.5053

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