@kosdev-code/kos-freestyle-sdk 0.1.0-dev.5164 → 0.1.0-dev.5168
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{extension-utils-DABHO8qx.cjs → extension-utils-CIeLBxMW.cjs} +2 -2
- package/{extension-utils-DABHO8qx.cjs.map → extension-utils-CIeLBxMW.cjs.map} +1 -1
- package/{extension-utils-CARIyqNK.js → extension-utils-mrQ_wiPv.js} +11 -11
- package/{extension-utils-CARIyqNK.js.map → extension-utils-mrQ_wiPv.js.map} +1 -1
- package/index.cjs +1 -1
- package/index.js +36 -33
- package/models/utils/openapi-index.d.ts +2 -2
- package/models/utils/services/freestyle/1.6.5/openapi.d.ts +1462 -0
- package/models/utils/services/freestyle/1.6.5/service.d.ts +118 -0
- package/models/utils/services/freestyle/1.6.5/service.d.ts.map +1 -0
- package/models/utils/services/freestyle/1.8.1/openapi.d.ts +1656 -0
- package/models/utils/services/freestyle/1.8.1/service.d.ts +118 -0
- package/models/utils/services/freestyle/1.8.1/service.d.ts.map +1 -0
- package/models/utils/services/handle/1.8.1/openapi.d.ts +237 -0
- package/models/utils/services/handle/1.8.1/service.d.ts +118 -0
- package/models/utils/services/handle/1.8.1/service.d.ts.map +1 -0
- package/models/utils/services-index.d.ts +3 -0
- package/models/utils/services-index.d.ts.map +1 -1
- package/models.cjs +1 -1
- package/models.js +30 -27
- package/package.json +4 -4
- package/{service-VUszslQD.cjs → service-DrOwtgpN.cjs} +2 -2
- package/service-DrOwtgpN.cjs.map +1 -0
- package/{service-C0WOCTr1.js → service-Rmefh9Kc.js} +497 -467
- package/service-Rmefh9Kc.js.map +1 -0
- package/ui.cjs +1 -1
- package/ui.js +2 -2
- package/{use-nutrition-info-BWyJAXF6.js → use-nutrition-info-Cb4qW_qq.js} +2 -2
- package/{use-nutrition-info-BWyJAXF6.js.map → use-nutrition-info-Cb4qW_qq.js.map} +1 -1
- package/{use-nutrition-info-BRX7H5o6.cjs → use-nutrition-info-DOOjBBqm.cjs} +2 -2
- package/{use-nutrition-info-BRX7H5o6.cjs.map → use-nutrition-info-DOOjBBqm.cjs.map} +1 -1
- package/service-C0WOCTr1.js.map +0 -1
- package/service-VUszslQD.cjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var ot=Object.defineProperty;var at=(e,t,r)=>t in e?ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var s=(e,t,r)=>(at(e,typeof t!="symbol"?t+"":t,r),r);const o=require("@kosdev-code/kos-ui-sdk"),d=require("@kosdev-code/kos-dispense-sdk"),{URL:pe}=o.resolveServiceUrl("ICE_AGITATOR_SERVICE"),{postModel:it}=o.ServiceFactory.build({basePath:`${pe}/api/ext/freestyle/ice`});o.KosLog.createLogger({name:"carb-tank-service",group:"Services"});const st=async(e,t)=>{const r=await it({model:{},tracker:t,urlOverride:`${pe}/api/handle/${e}/test`});if(!(r!=null&&r.data))throw new Error("No response from server");return r==null?void 0:r.data};var ge=Object.defineProperty,nt=Object.getOwnPropertyDescriptor,lt=(e,t,r)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t,r,i)=>{for(var a=i>1?void 0:i?nt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&ge(t,r,a),a},ut=(e,t,r)=>(lt(e,t+"",r),r);const ct="carb-agitator-model",oe=o.createPropKey("statePath");let h=class{constructor(e,t,r){s(this,"id");s(this,"name");s(this,"path");s(this,"statePath");s(this,"highProbeWet");s(this,"lowProbeWet");s(this,"filling");s(this,"enabled");var a;this.id=e,this.name=t.name,this.path=((a=r.kosContext.get("assembly-feature-carbTank"))==null?void 0:a.path)||"";const i=r.kosContext.get("assembly-state-path-carbTank");this.statePath=i}get holder(){var t;return(t=this.getCompanionParent())==null?void 0:t.getHoldersByGroup("carb")[0]}get pump(){var e;return(e=this.holder)==null?void 0:e.pumps.data[0]}get isFilling(){return!!this.filling.value}get isCarbInitialized(){return!!this.enabled.value}get canActivate(){return!this.enabled.value}get canProceed(){return this.isInState("INITIALIZED")||this.isInState("SKIPPED")}handleActivationStart(){this.logger.info("Carb tank activation started")}handleActivationComplete(){this.logger.info("Carb tank initialized")}handleInitialized(){this.logger.info("Carb tank ready to proceed")}handleSkipped(){this.logger.info("Proceeding without carbinator")}async activateCarbTank(){this.transition("ACTIVATE"),this.enabled.updateProperty(!0),this.transition("ACTIVATION_COMPLETE")}async deactivateCarbTank(){this.enabled.updateProperty(!1),this.transition("RESET")}skip(){this.transition("SKIP")}reset(){this.enabled.updateProperty(!1),this.transition("RESET")}toggleCarbTank(){this.enabled.value?this.deactivateCarbTank():this.activateCarbTank()}handleTestCarbTank(e){if(!e)throw new Error("No tracker provided");return this.logger.info(`testing carb tank: ${this.id}`),st(this.path,e)}};ut(h,"Registration");y([o.kosStateProp({path:oe,attribute:"highProbeWet"})],h.prototype,"highProbeWet",2);y([o.kosStateProp({path:oe,attribute:"lowProbeWet"})],h.prototype,"lowProbeWet",2);y([o.kosStateProp({path:oe,attribute:"filling"})],h.prototype,"filling",2);y([o.kosConfigProperty({path:"assembly:core:board:macksm:carbTank:carbTank",attribute:"enabled"})],h.prototype,"enabled",2);y([o.kosStateEntry("ACTIVATING")],h.prototype,"handleActivationStart",1);y([o.kosStateExit("ACTIVATING")],h.prototype,"handleActivationComplete",1);y([o.kosStateEntry("INITIALIZED")],h.prototype,"handleInitialized",1);y([o.kosStateEntry("SKIPPED")],h.prototype,"handleSkipped",1);y([o.kosStateGuard({allowedStates:["UNINITIALIZED"]})],h.prototype,"activateCarbTank",1);y([o.kosStateGuard({allowedStates:["UNINITIALIZED"]})],h.prototype,"skip",1);y([o.kosStateGuard({allowedStates:["INITIALIZED","SKIPPED"]})],h.prototype,"reset",1);y([o.kosFuture()],h.prototype,"handleTestCarbTank",1);h=y([o.kosModel({modelTypeId:ct,singleton:!1}),o.kosLoggerAware(),o.kosCompanion({mode:"composition",lifecycle:o.DependencyLifecycle.LOAD}),o.kosFutureAware(),o.kosStateMachine({initial:"UNINITIALIZED",states:{UNINITIALIZED:{on:{ACTIVATE:"ACTIVATING",SKIP:"SKIPPED"}},ACTIVATING:{on:{ACTIVATION_COMPLETE:"INITIALIZED"}},INITIALIZED:{on:{RESET:"UNINITIALIZED"}},SKIPPED:{on:{RESET:"UNINITIALIZED"}}}},{throwOnInvalid:!1})],h);const ae=h.Registration;var dt=Object.defineProperty,pt=Object.getOwnPropertyDescriptor,he=(e,t,r,i)=>{for(var a=i>1?void 0:i?pt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&dt(t,r,a),a};const fe="cartridge-agitator-container-model";let L=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"_models");this.id=e,this.logger=r.logger,this._models=new o.KosModelContainer({parentId:e})}getModel(e){return this._models.getModel(e)}get models(){return this._models}get data(){return this._models.data}addModel(e){this._models.addModel(e)}removeModel(e){this._models.removeModel(e)}async init(){this.logger.debug(`initializing cartridge-agitator-container container ${this.id}`)}async load(){this.logger.debug(`loading cartridge-agitator-container container ${this.id}`)}};he([o.kosChild],L.prototype,"_models",2);L=he([o.kosModel(fe)],L);const{URL:ye}=o.resolveServiceUrl("CARTRIDGE_AGITATOR_SERVICE"),{postModel:gt}=o.ServiceFactory.build({basePath:`${ye}/api/ext/freestyle/freestyle/ice`}),ht=async(e,t)=>{const r=await gt({model:{},tracker:t,urlOverride:`${ye}/api/handle/${e}/test`});if(!(r!=null&&r.data))throw new Error("No response from server");return r.data};var ft=Object.defineProperty,yt=Object.getOwnPropertyDescriptor,U=(e,t,r,i)=>{for(var a=i>1?void 0:i?yt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&ft(t,r,a),a};const me="cartridge-agitator-model";class O{}s(O,"TOPIC_AGITATION_STARTED","/kos/events/ddk/agitation-started"),s(O,"TOPIC_AGITATION_ENDED","/kos/events/ddk/agitation-ended");const mt=o.createPropKey("statePath");let C=class{constructor(e,t){s(this,"id");s(this,"agitating");s(this,"path");s(this,"statePath");s(this,"name");this.id=e,this.path=t.path,this.name=t.name,this.statePath=t.statePath}get isAgitating(){return!!this.agitating.value}async testAgitate(e){if(!e)throw new Error("No tracker provided");return this.logger.info(`agitating cartridge-agitator ${this.id}`),ht(this.path,e)}handleAgitation(){var e;this.isAgitating?(this.logger.info(`agitating cartridge-agitator ${this.id}`),o.EventBus.publish(O.TOPIC_AGITATION_STARTED,{path:this.path,futureId:(e=this.future)==null?void 0:e.futureId})):o.EventBus.publish(O.TOPIC_AGITATION_ENDED,{path:this.path})}};U([o.kosStateProp({path:mt,attribute:"agitating"})],C.prototype,"agitating",2);U([o.kosFuture()],C.prototype,"testAgitate",1);U([o.kosModelEffect({dependencies:e=>[e.isAgitating]})],C.prototype,"handleAgitation",1);C=U([o.kosModel(me),o.kosFutureAware(),o.kosLoggerAware()],C);const ie=new o.KosModelRegistrationFactory({class:C,type:me}),x=new o.SingletonKosModelRegistrationFactory({class:L,type:fe});x.addRelatedModel(ie);var Pe=Object.defineProperty,Pt=Object.getOwnPropertyDescriptor,bt=(e,t,r)=>t in e?Pe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G=(e,t,r,i)=>{for(var a=i>1?void 0:i?Pt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&Pe(t,r,a),a},vt=(e,t,r)=>(bt(e,t+"",r),r);const Tt="cgp-pump-model",se=o.createPropKey("statePath");let _=class{constructor(e,t){s(this,"highProbeWet");s(this,"lowProbeWet");s(this,"filling");s(this,"id");s(this,"state");var r;this.id=e,this.state=((r=t.data)==null?void 0:r.state)??{name:"unknown",path:""}}get statePath(){return this.state.path}};vt(_,"Registration");G([o.kosStateProp({path:se,attribute:"highProbeWet"})],_.prototype,"highProbeWet",2);G([o.kosStateProp({path:se,attribute:"lowProbeWet"})],_.prototype,"lowProbeWet",2);G([o.kosStateProp({path:se,attribute:"filling"})],_.prototype,"filling",2);_=G([o.kosModel({modelTypeId:Tt,singleton:!1}),o.kosCompanion({mode:"composition"}),o.kosLoggerAware()],_);const be=_.Registration,{URL:$}=o.resolveServiceUrl("FCM-PUMP_SERVICE"),{postModel:R}=o.ServiceFactory.build({basePath:`${$}/api/fcm-pump`}),f=o.KosLog.createLogger({name:"fcm-pump-service",group:"Services"}),ve=async e=>{var t,r,i,a,l;f.debug(`performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`);try{const n=await R({model:{},urlOverride:`${$}/api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`});return f.debug("performElectricalTest - response:",n),((n==null?void 0:n.status)===200||(n==null?void 0:n.status)===499)&&((t=n.data)!=null&&t.error)?[n.data.error||"unknownError",n.data]:[void 0,n==null?void 0:n.data]}catch(n){if(f.error(`performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`,n),n instanceof o.FetchError){const c=((i=(r=n.payload)==null?void 0:r.data)==null?void 0:i.error)||((a=n.payload)==null?void 0:a.error)||"unknownError";return[c,((l=n.payload)==null?void 0:l.data)||{error:c}]}}return["unknownError",{error:"unknownError"}]},Te=async(e,t)=>{f.debug(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/preCalibrate`);try{const r=await R({model:{},urlOverride:`${$}/api/ext/freestyle/fcm/calibration/${e}/preCalibrate`,tracker:t});return f.debug("performPreCalibrate - response:",r),r!=null&&r.data&&o.FutureManager.initiateFuture(r.data),r==null?void 0:r.data}catch(r){f.error(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/preCalibrate`,r);const i={id:t||"",endState:o.FutureEndState.Fail,tracker:t,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(i),i}},_e=async(e,t)=>{f.debug(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/calibrate`);try{const r=await R({model:{},urlOverride:`${$}/api/ext/freestyle/fcm/calibration/${e}/calibrate`,tracker:t});return f.debug("performPreCalibrate - response:",r),r!=null&&r.data&&o.FutureManager.initiateFuture(r.data),r==null?void 0:r.data}catch(r){f.error(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/calibrate`,r);const i={id:t||"",endState:o.FutureEndState.Fail,tracker:t,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(i),i}},Ie=async(e,t,r)=>{f.debug(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/verify/${t}`);try{const i=await R({model:{},urlOverride:`${$}/api/ext/freestyle/fcm/calibration/${e}/verify/${t}`,tracker:r});return f.debug("performVerify - response:",i),i!=null&&i.data&&o.FutureManager.initiateFuture(i.data),i==null?void 0:i.data}catch(i){f.error(`performVerify - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/verify/${t}`,i);const a={id:r||"",endState:o.FutureEndState.Fail,tracker:r,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(a),a}},_t=e=>e?e.data==="success"||!e.data?"success":e.data:"error",Ce=async(e,t,r)=>{f.debug(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`);try{const i=await R({model:{},urlOverride:`${$}/api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`});return f.debug("performPreCalibrate - response:",i),_t(i==null?void 0:i.data)}catch(i){f.error(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`,i);return}};var It=Object.defineProperty,Ct=Object.getOwnPropertyDescriptor,q=(e,t,r,i)=>{for(var a=i>1?void 0:i?Ct(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&It(t,r,a),a};const Ee="fcm-pump-model",Et=o.KosLog.createLogger({name:"fcm-pump-model"});let E=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"pumpModel");s(this,"futureHandler");this.id=e,this.logger=r.logger,this.pumpModel=t.companionParent,this.futureHandler=new o.FutureHandler(this)}get future(){return this.futureHandler.future}get name(){return this.pumpModel.name}get canPour(){return this.pumpModel.canPour}get isPouring(){return this.pumpModel.isPouring}async cancelPour(){return this.pumpModel.cancelPour()}performIntent(e){return this.pumpModel.performIntent(e)}async performElectricalTest(){const[e,t]=await ve(this.pumpModel.path);return e&&Et.error(`Failed to perform electrical test on pump ${this.id}`,e),t}getChildren(){return[...this.futureHandler.allFutures]}async performPreCalibrate(e){return Te(this.pumpModel.path,e)}async performCalibrate(e){return _e(this.pumpModel.path,e)}async performVerify(e,t){return Ie(this.pumpModel.path,e,t)}async performComplete(e,t){return Ce(this.pumpModel.path,e,t)}async init(){this.logger.debug(`initializing fcm-pump ${this.id}`)}async load(){this.logger.debug(`loading fcm-pump ${this.id}`)}};q([o.kosFuture()],E.prototype,"performPreCalibrate",1);q([o.kosFuture()],E.prototype,"performCalibrate",1);q([o.kosFuture()],E.prototype,"performVerify",1);E=q([o.kosModel(Ee)],E);const Se=new o.KosModelRegistrationFactory({class:E,type:Ee});var St=Object.defineProperty,Mt=Object.getOwnPropertyDescriptor,Me=(e,t,r,i)=>{for(var a=i>1?void 0:i?Mt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&St(t,r,a),a};const $e="freestyle-assembly-model",Oe="iceAgitator",$t="carbTank",Ot="remoteTrays";let N=class{constructor(e,t,r){s(this,"id");s(this,"_carbTankModel");s(this,"logger");s(this,"assembly");s(this,"_remoteTrays");this.id=e,this.logger=r.logger,this.assembly=t.companionParent}get holderGroups(){return this.assembly.holderGroups}get nozzlePaths(){return this.assembly.nozzlePaths}get allHolders(){return this.assembly.allHolders}getHoldersByGroup(e){return this.assembly.getHoldersByGroup(e)}getHoldersByNozzle(e){return this.assembly.getHoldersByNozzle(e)}get pumpsByNozzle(){return this.assembly.pumpsByNozzle}get pumpPaths(){return this.assembly.pumpPaths}get boards(){return this.assembly.boards}updateModel(e){return this.assembly.updateModel(e)}get iceAgitator(){return this.assembly.iceAgitator}get carbTank(){return this._carbTankModel}get cartridgeAgitators(){return this.assembly.cartridgeAgitators}get defaultCartridgeAgitator(){return this.assembly.cartridgeAgitators.data[0]}get cartridgeAgitatorModels(){return this.assembly.cartridgeAgitators.data}get hasCartridgeAgitators(){return this.assembly.cartridgeAgitators.data.length>0}get remoteTrays(){return this.assembly.remoteTrays}get hasRemoteTrays(){return this.assembly.remoteTrays?this.assembly.remoteTrays.data.length>0:!1}get supportsRemoteTrays(){return o.KosFeatureFlags.isFeatureEnabled(Ot)}get supportsIce(){return o.KosFeatureFlags.isFeatureEnabled(Oe)}get supportsCarb(){return o.KosFeatureFlags.isFeatureEnabled($t)}async init(){this.logger.debug(`initializing freestyle-assembly ${this.id}`)}async ready(){const e=o.getKosCompanionModel(this.assembly,ae.type);this._carbTankModel=e}};Me([o.kosChild],N.prototype,"_remoteTrays",2);N=Me([o.kosParentAware(),o.kosModel($e)],N);const z=new o.SingletonKosModelRegistrationFactory({class:N,type:$e});var At=Object.defineProperty,wt=Object.getOwnPropertyDescriptor,Ae=(e,t,r,i)=>{for(var a=i>1?void 0:i?wt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&At(t,r,a),a};const we="remote-tray-model";o.createPropKey("holderPath");const Rt=o.createPropKey("configPath");let k=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"holderPath");s(this,"configPath");s(this,"name");s(this,"remoteTrayEnabled");this.id=e,this.logger=r.logger,this.holderPath=t.holderPath,this.configPath=t.configPath,this.name=t.name}get troubles(){var e;return((e=this.holder)==null?void 0:e.troubles)??[]}get troubleStatus(){return""}get troublesByType(){var e;return((e=this.holder)==null?void 0:e.troublesByType)??{}}updateModel(e){}get holder(){return o.getKosModelSync(this.holderPath).model}get active(){return!!this.remoteTrayEnabled.value}async init(){this.logger.debug(`initializing remote-tray ${this.id}`)}async load(){this.logger.debug(`loading remote-tray ${this.id}`)}};Ae([o.kosConfigProperty({path:Rt,attribute:"enabled"})],k.prototype,"remoteTrayEnabled",2);k=Ae([o.kosModel(we)],k);const S=new o.KosModelRegistrationFactory({class:k,type:we});var Ft=Object.getOwnPropertyDescriptor,Dt=(e,t,r,i)=>{for(var a=i>1?void 0:i?Ft(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=n(a)||a);return a};const Re="remote-tray-container-model";let W=class{constructor(e){s(this,"id");this.id=e}};W=Dt([o.kosModel(Re),o.kosLoggerAware(),o.kosContainerAware()],W);const j=new o.SingletonKosModelRegistrationFactory({class:W,type:Re});j.addRelatedModel(S);var Lt=Object.getOwnPropertyDescriptor,Nt=(e,t,r,i)=>{for(var a=i>1?void 0:i?Lt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=n(a)||a);return a};const Fe="freestyle-holder-model";function zt(e){const t=o.KosContextManager.getContext(e),r=t==null?void 0:t.get(z.type);if(!r){o.KosLog.error("Freestyle assembly not found");return}return r}async function kt(e,t){if(!e||!t)return;const r=await e[t]();if(r!=null&&r.tracker)return o.FutureManager.getFuture(r.tracker)}let Z=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"holder");s(this,"context");s(this,"future");this.id=e,this.logger=r.logger,this.context=r.kosContext,this.holder=t.companionParent}get agitated(){return this.holder.data.agitated}async agitate(){if(!this.holder.data.agitated)return;this.future=void 0;const e=zt(this.id);if(!e)return;if(!e.defaultCartridgeAgitator){this.logger.error("Agitator not found");return}return this.future=await kt(e.defaultCartridgeAgitator,"testAgitate"),this.future}get isRemote(){const e=`${S.type}-${this.holder.path}`,t=o.getKosModelSync(e);return t!=null&&t.model?!!t.model.remoteTrayEnabled.value:!1}async init(){this.logger.debug(`initializing freestyle-holder ${this.id}`)}async load(){this.logger.debug(`loading freestyle-holder ${this.id}`)}};Z=Nt([o.kosModel(Fe)],Z);const X=new o.KosModelRegistrationFactory({class:Z,type:Fe}),{URL:Kt}=o.resolveServiceUrl("FREESTYLE-NOZZLE_SERVICE"),{getOne:Ut}=o.ServiceFactory.build({basePath:`${Kt}/api/freestyle-nozzle`}),D=o.KosLog.createLogger({name:"freestyle-nozzle-service",group:"Services"});class De extends Error{constructor(t){super(t),this.name="NutritionInfoError"}}class Q extends Error{constructor(t){super(t),this.name="InvalidRequestError"}}const Le=async(e,t,r,i="http://localhost:8081")=>{if(D.debug("sending GET for freestyle-nozzle"),!t)throw D.error("Invalid freestyle-nozzle request: beverageId is required"),new Q("No beverageId provided");if(!r||r.length===0)throw D.error("Invalid freestyle-nozzle request: volumes are required"),new Q("No volumes provided");const a=await Ut({urlOverride:`${i}${e}/pipeline/beverage/engine/nutrition/${t}?volumes=${r.join(",")}`});if(!(a!=null&&a.data))throw D.error("Failed to retrieve freestyle-nozzle data"),new Error("Failed to retrieve freestyle-nozzle data");if(a.data.error)throw new De(a.data.error);return a.data};var xt=Object.defineProperty,Gt=Object.getOwnPropertyDescriptor,Ne=(e,t,r,i)=>{for(var a=i>1?void 0:i?Gt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&xt(t,r,a),a};const ze="freestyle-nozzle-model";let K=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"nozzleModel");s(this,"_cupSizes");s(this,"_nutritionInfo");this.id=e,this.logger=r.logger,this.nozzleModel=t.companionParent,this._cupSizes=[100]}set cupSizes(e){this._cupSizes=e}get nutritionInfo(){return this._nutritionInfo}get selectedPourable(){return this.nozzleModel.selectedPourable}async handleBeverageSelection(){if(this.nozzleModel.selectedPourable.beverage&&this._cupSizes.length){this.logger.debug(`selected beverage: ${this.nozzleModel.selectedPourable.beverage.rawId}. Volume: ${this._cupSizes.join(", ")}`);const e=this.nozzleModel.selectedPourable.beverage.rawId,t=this.nozzleModel.urlPrefix;try{const r=await Le(t,e,this._cupSizes);o.kosAction(()=>{this._nutritionInfo=r})}catch(r){this.logger.error(`Error fetching nutrition info: ${r}`)}}}async init(){this.logger.debug(`initializing freestyle-nozzle ${this.id}`)}unload(){this.logger.debug(`unloading freestyle-nozzle ${this.id}`)}async load(){this.logger.debug(`loading freestyle-nozzle ${this.id}`)}};Ne([o.kosModelEffect({dependencies:e=>[e.selectedPourable.beverage]})],K.prototype,"handleBeverageSelection",1);K=Ne([o.kosParentAware(),o.kosModel(ze)],K);const J=new o.KosModelRegistrationFactory({class:K,type:ze}),{URL:ke}=o.resolveServiceUrl("PUMP_SERVICE"),{postModel:qt}=o.ServiceFactory.build({basePath:`${ke}/api/ext/freestyle/microCalibration`}),Y=o.KosLog.createLogger({name:"freestyle-pump-service",group:"Services"}),Ke=async(e,t)=>{var r,i,a,l,n;Y.debug(`replacePump - sending POST request to /api/ext/freestyle/microCalibration/cal/${e}/code/${t}`);try{const c=await qt({model:{},urlOverride:`${ke}/api/ext/freestyle/microCalibration/cal/${e}/code/${t}`});return Y.debug("replacePump - response:",c),((c==null?void 0:c.status)===200||(c==null?void 0:c.status)===499)&&((r=c.data)!=null&&r.error)?[c.data.error||"unknownError",c.data]:[void 0,c==null?void 0:c.data]}catch(c){if(Y.error(`replacePump - sending POST request to /api/cal/${e}/code/${t}`,c),c instanceof o.FetchError){const v=((a=(i=c.payload)==null?void 0:i.data)==null?void 0:a.error)||((l=c.payload)==null?void 0:l.error)||"unknownError";return[v,((n=c.payload)==null?void 0:n.data)||{error:v}]}}return["unknownError",{error:"unknownError"}]};var jt=Object.getOwnPropertyDescriptor,Vt=(e,t,r,i)=>{for(var a=i>1?void 0:i?jt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=n(a)||a);return a};const Ue="freestyle-pump-model";let ee=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"pump");this.id=e,this.logger=r.logger,this.pump=t.companionParent}async replacePump(e){const[t,r]=await Ke(this.pump.path,e);return t&&this.logger.error(`Failed to replace the pump, ${this.pump.id}`,t),[t,r]}};ee=Vt([o.kosModel(Ue)],ee);const te=new o.KosModelRegistrationFactory({class:ee,type:Ue}),{URL:I}=o.resolveServiceUrl("ICE_AGITATOR_SERVICE"),{getAll:xe,postModel:V}=o.ServiceFactory.build({basePath:`${I}/api/ext/freestyle/ice`}),Ge=o.KosLog.createLogger({name:"ice-agitator-service",group:"Services"}),Bt=async e=>(Ge.debug("sending GET for ice types"),await xe({urlOverride:`${I}/api/handle/${e}/types`})),Ht=async(e,t)=>(Ge.debug("sending POST for ice types"),await V({urlOverride:`${I}/api/handle/${e}/type/${t}`,model:{}})),Yt=async e=>await xe({urlOverride:`${I}/api/kos/config/details/${e}/4`}),Wt=async(e,t)=>{const r=await V({model:{},tracker:t,urlOverride:`${I}/api/handle/${e}/pour`});if(!(r!=null&&r.data))throw new Error("No response from server");return r==null?void 0:r.data},Zt=async(e,t)=>{const r=await V({model:{},tracker:t,urlOverride:`${I}/api/handle/${e}/test/agitation`});if(!(r!=null&&r.data))throw new Error("No response from server");return r==null?void 0:r.data},Xt=async(e,t)=>{const r=await V({model:{},tracker:t,urlOverride:`${I}/api/handle/${e}/test/gate`});if(!(r!=null&&r.data))throw new Error("No response from server");return r==null?void 0:r.data};var Qt=Object.defineProperty,Jt=Object.getOwnPropertyDescriptor,g=(e,t,r,i)=>{for(var a=i>1?void 0:i?Jt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&Qt(t,r,a),a};class A{}s(A,"TOPIC_AGITATION_STARTED","/kos/events/ddk/ice-agitation-started"),s(A,"TOPIC_AGITATION_ENDED","/kos/events/ddk/ice-agitation-ended");const qe="ice-agitator-model",je=o.createPropKey("statePath");let p=class{constructor(e,t,r){s(this,"id");s(this,"name");s(this,"path");s(this,"volWithoutIceMl");s(this,"durationSec");s(this,"enableIceChuteClear");s(this,"iceChuteClearDurationMs");s(this,"iceChuteClearIntervalSec");s(this,"iceChuteClearRetryIntervalSec");s(this,"maxDispenseSec");s(this,"type");s(this,"dilutionOffset");s(this,"inactivitySec");s(this,"agitating");s(this,"iceChuteOpen");s(this,"statePath");s(this,"_allIceTypes");s(this,"logger");s(this,"currentState",d.PourState.IDLE);s(this,"resetDefaultValues",async()=>await Yt(this.path));this.id=e,this.name=t.name,this.path=t.path,this.statePath=t.statePath,this._allIceTypes=[],this.logger=r.logger}get iceTypes(){return this._allIceTypes}get isAgitating(){return!!this.agitating.value}get isIceChuteOpen(){return!!this.iceChuteOpen.value}get isPouring(){var e;return!!(this.pourFuture&&!((e=this.pourFuture)!=null&&e.endState))||this.currentState===d.PourState.POUR_STARTING||this.currentState===d.PourState.POURING||this.currentState===d.PourState.POUR_CANCELING}get canPour(){return this.currentState===d.PourState.IDLE}updateIfCurrent(e,t){this.currentState===e&&o.kosAction(()=>{this.currentState=t})}async pourIce(e){try{if(this.currentState===d.PourState.IDLE){if(this.updateIfCurrent(d.PourState.IDLE,d.PourState.POUR_STARTING),!e)throw new Error("No tracker provided");const t=await Wt(this.path,e);return this.updateIfCurrent(d.PourState.POUR_STARTING,d.PourState.POURING),t!=null&&t.endState&&this.updateIfCurrent(d.PourState.POURING,d.PourState.IDLE),t}else throw new Error(`Cannot pour in state ${this.currentState}`)}catch(t){throw this.logger.error(t),this.currentState=d.PourState.IDLE,t}}async cancelIceDispense(){var e;this.currentState===d.PourState.POURING||this.currentState===d.PourState.POUR_STARTING?(this.currentState=d.PourState.POUR_CANCELING,await((e=this.pourFuture)==null?void 0:e.cancelFuture()),o.kosAction(()=>{this.currentState=d.PourState.IDLE})):this.logger.warn(`Cannot cancel ice dispense in state ${this.currentState}`)}async testAgitate(e){if(!e)throw new Error("No tracker provided");return this.logger.info(`agitating ice-agitator ${this.id}`),Zt(this.path,e)}async testGate(e){if(!e)throw new Error("No tracker provided");return this.logger.info(`testing ice gate: ${this.id}`),Xt(this.path,e)}handleAgitationChange(){var e;this.isAgitating?(this.logger.info(`agitating ice-agitator ${this.id}`),o.EventBus.publish(A.TOPIC_AGITATION_STARTED,{path:this.path,futureId:(e=this.futureHandler.future)==null?void 0:e.futureId})):o.EventBus.publish(A.TOPIC_AGITATION_ENDED,{path:this.path})}async updateIceType(e){await Ht(this.path,e)}async init(){this.logger.debug(`initializing ice-agitator ${this.id}`)}async load(){this.logger.debug(`loading ice-agitator ${this.id}`);const e=await Bt(this.path);(e==null?void 0:e.status)===200&&o.kosAction(()=>{this._allIceTypes=e.data||[]})}};g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"settings.volWithoutIceMl"})],p.prototype,"volWithoutIceMl",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"settings.durationSec",converter:{to:"second"}})],p.prototype,"durationSec",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"enableIceChuteClear"})],p.prototype,"enableIceChuteClear",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"iceChuteClearDurationMs"})],p.prototype,"iceChuteClearDurationMs",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"iceChuteClearIntervalSec"})],p.prototype,"iceChuteClearIntervalSec",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"iceChuteClearRetryIntervalSec"})],p.prototype,"iceChuteClearRetryIntervalSec",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"maxDispenseSec"})],p.prototype,"maxDispenseSec",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"type"})],p.prototype,"type",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"settings.dilutionOffset"})],p.prototype,"dilutionOffset",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"settings.inactivitySec",converter:{to:"minute"}})],p.prototype,"inactivitySec",2);g([o.kosStateProp({path:je,attribute:"agitating"})],p.prototype,"agitating",2);g([o.kosStateProp({path:je,attribute:"iceChuteOpen"})],p.prototype,"iceChuteOpen",2);g([o.kosFuture({alias:"pour"})],p.prototype,"pourIce",1);g([o.kosFuture({alias:"agitate"})],p.prototype,"testAgitate",1);g([o.kosFuture({alias:"gate"})],p.prototype,"testGate",1);g([o.kosModelEffect({dependencies:e=>[e.isAgitating]})],p.prototype,"handleAgitationChange",1);p=g([o.kosModel(qe),o.kosMultipleFutureAware()],p);const ne=new o.KosModelRegistrationFactory({class:p,type:qe});var er=Object.getOwnPropertyDescriptor,tr=(e,t,r,i)=>{for(var a=i>1?void 0:i?er(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=n(a)||a);return a};const Ve="lfcv-pump-model";let re=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"pumpModel");this.id=e,this.logger=r.logger,this.pumpModel=t.companionParent}get name(){return this.pumpModel.name}get canPour(){return this.pumpModel.canPour}get isPouring(){return this.pumpModel.isPouring}async cancelPour(){return this.pumpModel.cancelPour()}performIntent(e){return this.pumpModel.performIntent(e)}async init(){this.logger.debug(`initializing lfcv-pump ${this.id}`)}async load(){this.logger.debug(`loading lfcv-pump ${this.id}`)}};re=tr([o.kosModel(Ve)],re);const Be=new o.KosModelRegistrationFactory({class:re,type:Ve}),{URL:rr}=o.resolveServiceUrl("LFCV-PUMP_SERVICE"),{getAll:or}=o.ServiceFactory.build({basePath:`${rr}/api/lfcv-pump`}),ar=o.KosLog.createLogger({name:"lfcv-pump-service",group:"Services"}),ir=async()=>(ar.debug("sending GET for lfcv-pump"),await or({})),{URL:F}=o.resolveServiceUrl("SPM-PUMP_SERVICE"),{postModel:B}=o.ServiceFactory.build({basePath:`${F}/api/spm-pump`}),P=o.KosLog.createLogger({name:"spm-pump-service",group:"Services"}),He=async(e,t)=>{P.debug(`performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`);try{const r=await B({model:{},urlOverride:`${F}/api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`,tracker:t});return P.debug("performPreCalibrate - response:",r),r!=null&&r.data&&o.FutureManager.initiateFuture(r.data),r==null?void 0:r.data}catch(r){P.error(`performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`,r);const i={id:t||"",endState:o.FutureEndState.Fail,tracker:t,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(i),i}},Ye=async(e,t)=>{P.debug(`performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/calibrate`);try{const r=await B({model:{},urlOverride:`${F}/api/ext/freestyle/microCalibration/pour/${e}/calibrate`,tracker:t});return P.debug("performCalibrate - response:",r),r!=null&&r.data&&o.FutureManager.initiateFuture(r.data),r==null?void 0:r.data}catch(r){P.error(`performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/calibrate`,r);const i={id:t||"",endState:o.FutureEndState.Fail,tracker:t,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(i),i}},We=async(e,t,r,i)=>{P.debug(`performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/verify`);try{const a=await B({model:{...r,measuredCalibrationVolume:t},urlOverride:`${F}/api/ext/freestyle/microCalibration/pour/${e}/verify`,tracker:i});return P.debug("performVerify - response:",a),a!=null&&a.data&&o.FutureManager.initiateFuture(a.data),a==null?void 0:a.data}catch(a){P.error(`performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/verify`,a);const l={id:i||"",endState:o.FutureEndState.Fail,tracker:i,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(l),l}},Ze=async(e,t,r,i)=>{var a,l,n,c,v;P.debug(`performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/complete`);try{const u=await B({model:{...i,measuredCalibrationVolume:t,measuredVerificationVolume:r},urlOverride:`${F}/api/ext/freestyle/microCalibration/pour/${e}/complete`});return P.debug("performComplete - response:",u),((u==null?void 0:u.status)===200||(u==null?void 0:u.status)===499)&&((a=u.data)!=null&&a.error)?[u.data.error||"unknownError",u.data]:[void 0,u==null?void 0:u.data]}catch(u){if(P.error(`performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/complete`,u),u instanceof o.FetchError){const m=((n=(l=u.payload)==null?void 0:l.data)==null?void 0:n.error)||((c=u.payload)==null?void 0:c.error)||"unknownError";return[m,((v=u.payload)==null?void 0:v.data)||{error:m}]}}return["unknownError",{error:"unknownError"}]};var sr=Object.defineProperty,nr=Object.getOwnPropertyDescriptor,H=(e,t,r,i)=>{for(var a=i>1?void 0:i?nr(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&sr(t,r,a),a};const Xe="spm-pump-model";let M=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"pump");s(this,"futureHandler");this.id=e,this.logger=r.logger,this.pump=t.companionParent,this.futureHandler=new o.FutureHandler(this)}get name(){return this.pump.name}get canPour(){return this.pump.canPour}get isPouring(){return this.pump.isPouring}async cancelPour(){return this.pump.cancelPour()}performIntent(e){return this.pump.performIntent(e)}get future(){return this.futureHandler.future}async performPreCalibrate(e){return He(this.pump.path,e)}async performCalibrate(e){return Ye(this.pump.path,e)}async performVerify(e,t,r){return We(this.pump.path,e,t,r)}async performComplete(e,t,r){return Ze(this.pump.path,e,t,r)}async init(){this.logger.debug(`initializing spm-pump ${this.id}`)}async load(){this.logger.debug(`loading spm-pump ${this.id}`)}};H([o.kosFuture()],M.prototype,"performPreCalibrate",1);H([o.kosFuture()],M.prototype,"performCalibrate",1);H([o.kosFuture()],M.prototype,"performVerify",1);M=H([o.kosModel(Xe)],M);const Qe=new o.KosModelRegistrationFactory({class:M,type:Xe});var lr=Object.defineProperty,ur=Object.getOwnPropertyDescriptor,le=(e,t,r,i)=>{for(var a=i>1?void 0:i?ur(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&lr(t,r,a),a};const ue="agitation-required-trouble-model",cr=e=>{if(e.data.agitationRequired)return ue},Je="InsufficientAgitationTrouble";let w=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"trouble");s(this,"_deferred");s(this,"_holdersLoaded",!1);s(this,"agitateBeforePour");this.id=e,this.logger=r.logger,this._deferred=!1,this.trouble=t.companionParent}async resolve(){return this.trouble.resolve()}get holder(){const e=this.trouble.data.holderPaths[0],t=o.getKosModelSync(e);if(!(!this._holdersLoaded&&!t.model))return t==null?void 0:t.model}updateHolder(){if(!this._holdersLoaded){const e=this.trouble.data.holderPaths[0];o.getKosModelSync(e).model&&(this._holdersLoaded=!0)}}get shouldDefer(){var i,a;if(!this.holder)return!0;const t=(((i=this.holder)==null?void 0:i.troublesByType[Je])||[]).length>0;return!!((a=this.agitateBeforePour)!=null&&a.value)&&t}get deferred(){return this._deferred}defer(){this._deferred=!0}clearDefer(){this._deferred=!1}};le([o.kosConfigProperty({path:"app:kosdev.ddk:app",attribute:"ncui.agitateBeforePour"})],w.prototype,"agitateBeforePour",2);le([o.kosTopicHandler({topic:o.modelTypeEventTopicFactory(d.Assembly.type),lifecycle:o.DependencyLifecycle.INIT})],w.prototype,"updateHolder",1);w=le([o.kosModel(ue)],w);const et=new o.KosModelRegistrationFactory({class:w,type:ue}),dr=["iceAgitator"],pr={iceAgitator:ne.factory},gr=o.KosLog.createLogger({name:"freestyle-assembly-data-mapper"}),hr=async e=>{const t=x.instance().options({}).build(),r=j.instance().options({}).build(),i=e.assemblies.reduce((n,c)=>{var v;return dr.forEach(u=>{var T;const m=c[u];if(m){const rt=pr[u](m.path);n[u]=rt({name:m.name,path:m.path,statePath:((T=m.state)==null?void 0:T.path)||""})}}),(v=c.cartridgeAgitators)==null||v.forEach(u=>{var T;const m=ie.instance(u.path).options({name:u.name,path:u.path,statePath:((T=u.state)==null?void 0:T.path)||""}).build();t.addModel(m)}),c.remoteTrays&&c.remoteTrays.forEach(u=>{gr.info(`Found remote tray ${u.name} with path ${u.path}`);const m=`${S.type}-${u.holderPath}`,T=S.instance(m).options({holderPath:u.holderPath,configPath:u.path,name:u.name}).build();r.addModel(T)}),n},{}),a=!!i.iceAgitator,l=!!i.carbTank;return{...i,cartridgeAgitators:t,remoteTrays:r,supportsCarb:l,supportsIce:a}},tt=e=>()=>(o.registerCoreModels(e)(),d.registerDispenseModels(e)(),J.register(),z.register(),ne.register(),ae.register(),x.register(),Qe.register(),Se.register(),Be.register(),be.register(),te.register(),X.register(),S.register(),j.register(),o.RegistrationManager.companion.register(e)(d.Nozzle.type,J.type),o.RegistrationManager.companion.register(e)(d.Assembly.type,z.type),et.register(),o.RegistrationManager.companion.register(e)(o.Trouble.type,cr),o.RegistrationManager.companion.register(e)(d.Pump.type,te.type),o.RegistrationManager.companion.register(e)(d.Holder.type,X.type),o.ExtensionManager[o.EXTENSION_TROUBLE_DATA_MAPPER].register("EnjoyByTrouble",async t=>{if(t.data.enjoyByDate){const r=new Date(t.data.enjoyByDate);return{enjoyByDays:Math.floor((new Date().getTime()-r.getTime())/(1e3*60*60*24))||""}}return{}}),o.ExtensionManager[o.EXTENSION_TROUBLE_DATA_MAPPER].register("SuperPumpRequiredTrouble",async t=>{const{model:r}=o.getKosModelSync(d.PumpContainer.type);return r?{superPumps:r.models.getIndexByKey(d.PumpIndex.byType,"microSuper").map(l=>l.name).join(", ")}:{}}),o.ExtensionManager[o.EXTENSION_TROUBLE_DATA_MAPPER].register("MicroPumpAirDetectTrouble",async t=>{if(t.ifaces.includes("container"))return{};if(t.data.pumpPath){const{model:r}=o.getKosModelSync(t.data.pumpPath);if(r){const i=r.ingredientId?o.getKosModelSync(r.ingredientId).model:void 0;return{ingredientId:r.ingredientId,ingredientName:(i==null?void 0:i.name)||""}}}return{}}),{preload:o.RegistrationManager.model.preloadModel(e),model:o.RegistrationManager.model.register(e),companion:o.RegistrationManager.companion.register(e),legacy:o.RegistrationManager.model.registerLegacyModel(e)}),b={...d.KosModelRegistry};b.freestyle={models:tt(b)};b.preload=o.RegistrationManager.model.preloadModel(b);b.model=o.RegistrationManager.model.register(b);b.companion=o.RegistrationManager.companion.register(b);b.legacy=o.RegistrationManager.model.registerLegacyModel(b);const fr=b;function yr(e){return o.kosServiceRequest(e)}const ce=o.createClient(),mr=Object.freeze(Object.defineProperty({__proto__:null,api:ce,default:ce,kosServiceRequest:yr},Symbol.toStringTag,{value:"Module"}));function Pr(e){return o.kosServiceRequest(e)}const de=o.createClient(),br=Object.freeze(Object.defineProperty({__proto__:null,api:de,default:de,kosServiceRequest:Pr},Symbol.toStringTag,{value:"Module"}));exports.AGITATION_REQUIRED_TROUBLE=Je;exports.AgitationRequiredTrouble=et;exports.CarbAgitator=ae;exports.CartridgeAgitator=ie;exports.CartridgeAgitatorContainer=x;exports.CartridgeAgitatorEvents=O;exports.CgpPump=be;exports.FEATURE_SUPPORTS_ICE=Oe;exports.FcmPump=Se;exports.FreestyleAssembly=z;exports.FreestyleHolder=X;exports.FreestyleNozzle=J;exports.FreestylePump=te;exports.IceAgitator=ne;exports.IceAgitatorEvents=A;exports.InvalidRequestError=Q;exports.KosModelRegistry=fr;exports.LfcvPump=Be;exports.NutritionInfoError=De;exports.RemoteTray=S;exports.RemoteTrayContainer=j;exports.SpmPump=Qe;exports.freestyleAssemblyDataMapper=hr;exports.getFreestyleNutritionInfo=Le;exports.getLfcvPumps=ir;exports.performCalibrate=_e;exports.performCalibrate$1=Ye;exports.performComplete=Ce;exports.performComplete$1=Ze;exports.performElectricalTest=ve;exports.performPreCalibrate=Te;exports.performPreCalibrate$1=He;exports.performVerify=Ie;exports.performVerify$1=We;exports.registerFreestyleModels=tt;exports.replacePump=Ke;exports.service=mr;exports.service$1=br;
|
|
2
|
-
//# sourceMappingURL=service-
|
|
1
|
+
"use strict";var st=Object.defineProperty;var nt=(e,t,r)=>t in e?st(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var s=(e,t,r)=>(nt(e,typeof t!="symbol"?t+"":t,r),r);const o=require("@kosdev-code/kos-ui-sdk"),d=require("@kosdev-code/kos-dispense-sdk"),{URL:fe}=o.resolveServiceUrl("ICE_AGITATOR_SERVICE"),{postModel:lt}=o.ServiceFactory.build({basePath:`${fe}/api/ext/freestyle/ice`});o.KosLog.createLogger({name:"carb-tank-service",group:"Services"});const ut=async(e,t)=>{const r=await lt({model:{},tracker:t,urlOverride:`${fe}/api/handle/${e}/test`});if(!(r!=null&&r.data))throw new Error("No response from server");return r==null?void 0:r.data};var ye=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,dt=(e,t,r)=>t in e?ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t,r,i)=>{for(var a=i>1?void 0:i?ct(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&ye(t,r,a),a},pt=(e,t,r)=>(dt(e,t+"",r),r);const gt="carb-agitator-model",oe=o.createPropKey("statePath");let h=class{constructor(e,t,r){s(this,"id");s(this,"name");s(this,"path");s(this,"statePath");s(this,"highProbeWet");s(this,"lowProbeWet");s(this,"filling");s(this,"enabled");var a;this.id=e,this.name=t.name,this.path=((a=r.kosContext.get("assembly-feature-carbTank"))==null?void 0:a.path)||"";const i=r.kosContext.get("assembly-state-path-carbTank");this.statePath=i}get holder(){var t;return(t=this.getCompanionParent())==null?void 0:t.getHoldersByGroup("carb")[0]}get pump(){var e;return(e=this.holder)==null?void 0:e.pumps.data[0]}get isFilling(){return!!this.filling.value}get isCarbInitialized(){return!!this.enabled.value}get canActivate(){return!this.enabled.value}get canProceed(){return this.isInState("INITIALIZED")||this.isInState("SKIPPED")}handleActivationStart(){this.logger.info("Carb tank activation started")}handleActivationComplete(){this.logger.info("Carb tank initialized")}handleInitialized(){this.logger.info("Carb tank ready to proceed")}handleSkipped(){this.logger.info("Proceeding without carbinator")}async activateCarbTank(){this.transition("ACTIVATE"),this.enabled.updateProperty(!0),this.transition("ACTIVATION_COMPLETE")}async deactivateCarbTank(){this.enabled.updateProperty(!1),this.transition("RESET")}skip(){this.transition("SKIP")}reset(){this.enabled.updateProperty(!1),this.transition("RESET")}toggleCarbTank(){this.enabled.value?this.deactivateCarbTank():this.activateCarbTank()}handleTestCarbTank(e){if(!e)throw new Error("No tracker provided");return this.logger.info(`testing carb tank: ${this.id}`),ut(this.path,e)}};pt(h,"Registration");y([o.kosStateProp({path:oe,attribute:"highProbeWet"})],h.prototype,"highProbeWet",2);y([o.kosStateProp({path:oe,attribute:"lowProbeWet"})],h.prototype,"lowProbeWet",2);y([o.kosStateProp({path:oe,attribute:"filling"})],h.prototype,"filling",2);y([o.kosConfigProperty({path:"assembly:core:board:macksm:carbTank:carbTank",attribute:"enabled"})],h.prototype,"enabled",2);y([o.kosStateEntry("ACTIVATING")],h.prototype,"handleActivationStart",1);y([o.kosStateExit("ACTIVATING")],h.prototype,"handleActivationComplete",1);y([o.kosStateEntry("INITIALIZED")],h.prototype,"handleInitialized",1);y([o.kosStateEntry("SKIPPED")],h.prototype,"handleSkipped",1);y([o.kosStateGuard({allowedStates:["UNINITIALIZED"]})],h.prototype,"activateCarbTank",1);y([o.kosStateGuard({allowedStates:["UNINITIALIZED"]})],h.prototype,"skip",1);y([o.kosStateGuard({allowedStates:["INITIALIZED","SKIPPED"]})],h.prototype,"reset",1);y([o.kosFuture()],h.prototype,"handleTestCarbTank",1);h=y([o.kosModel({modelTypeId:gt,singleton:!1}),o.kosLoggerAware(),o.kosCompanion({mode:"composition",lifecycle:o.DependencyLifecycle.LOAD}),o.kosFutureAware(),o.kosStateMachine({initial:"UNINITIALIZED",states:{UNINITIALIZED:{on:{ACTIVATE:"ACTIVATING",SKIP:"SKIPPED"}},ACTIVATING:{on:{ACTIVATION_COMPLETE:"INITIALIZED"}},INITIALIZED:{on:{RESET:"UNINITIALIZED"}},SKIPPED:{on:{RESET:"UNINITIALIZED"}}}},{throwOnInvalid:!1})],h);const ae=h.Registration;var ht=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,me=(e,t,r,i)=>{for(var a=i>1?void 0:i?ft(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&ht(t,r,a),a};const Pe="cartridge-agitator-container-model";let L=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"_models");this.id=e,this.logger=r.logger,this._models=new o.KosModelContainer({parentId:e})}getModel(e){return this._models.getModel(e)}get models(){return this._models}get data(){return this._models.data}addModel(e){this._models.addModel(e)}removeModel(e){this._models.removeModel(e)}async init(){this.logger.debug(`initializing cartridge-agitator-container container ${this.id}`)}async load(){this.logger.debug(`loading cartridge-agitator-container container ${this.id}`)}};me([o.kosChild],L.prototype,"_models",2);L=me([o.kosModel(Pe)],L);const{URL:be}=o.resolveServiceUrl("CARTRIDGE_AGITATOR_SERVICE"),{postModel:yt}=o.ServiceFactory.build({basePath:`${be}/api/ext/freestyle/freestyle/ice`}),mt=async(e,t)=>{const r=await yt({model:{},tracker:t,urlOverride:`${be}/api/handle/${e}/test`});if(!(r!=null&&r.data))throw new Error("No response from server");return r.data};var Pt=Object.defineProperty,bt=Object.getOwnPropertyDescriptor,U=(e,t,r,i)=>{for(var a=i>1?void 0:i?bt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&Pt(t,r,a),a};const ve="cartridge-agitator-model";class O{}s(O,"TOPIC_AGITATION_STARTED","/kos/events/ddk/agitation-started"),s(O,"TOPIC_AGITATION_ENDED","/kos/events/ddk/agitation-ended");const vt=o.createPropKey("statePath");let I=class{constructor(e,t){s(this,"id");s(this,"agitating");s(this,"path");s(this,"statePath");s(this,"name");this.id=e,this.path=t.path,this.name=t.name,this.statePath=t.statePath}get isAgitating(){return!!this.agitating.value}async testAgitate(e){if(!e)throw new Error("No tracker provided");return this.logger.info(`agitating cartridge-agitator ${this.id}`),mt(this.path,e)}handleAgitation(){var e;this.isAgitating?(this.logger.info(`agitating cartridge-agitator ${this.id}`),o.EventBus.publish(O.TOPIC_AGITATION_STARTED,{path:this.path,futureId:(e=this.future)==null?void 0:e.futureId})):o.EventBus.publish(O.TOPIC_AGITATION_ENDED,{path:this.path})}};U([o.kosStateProp({path:vt,attribute:"agitating"})],I.prototype,"agitating",2);U([o.kosFuture()],I.prototype,"testAgitate",1);U([o.kosModelEffect({dependencies:e=>[e.isAgitating]})],I.prototype,"handleAgitation",1);I=U([o.kosModel(ve),o.kosFutureAware(),o.kosLoggerAware()],I);const ie=new o.KosModelRegistrationFactory({class:I,type:ve}),x=new o.SingletonKosModelRegistrationFactory({class:L,type:Pe});x.addRelatedModel(ie);var _e=Object.defineProperty,_t=Object.getOwnPropertyDescriptor,Tt=(e,t,r)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,q=(e,t,r,i)=>{for(var a=i>1?void 0:i?_t(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&_e(t,r,a),a},St=(e,t,r)=>(Tt(e,t+"",r),r);const It="cgp-pump-model",se=o.createPropKey("statePath");let T=class{constructor(e,t){s(this,"highProbeWet");s(this,"lowProbeWet");s(this,"filling");s(this,"id");s(this,"state");var r;this.id=e,this.state=((r=t.data)==null?void 0:r.state)??{name:"unknown",path:""}}get statePath(){return this.state.path}};St(T,"Registration");q([o.kosStateProp({path:se,attribute:"highProbeWet"})],T.prototype,"highProbeWet",2);q([o.kosStateProp({path:se,attribute:"lowProbeWet"})],T.prototype,"lowProbeWet",2);q([o.kosStateProp({path:se,attribute:"filling"})],T.prototype,"filling",2);T=q([o.kosModel({modelTypeId:It,singleton:!1}),o.kosCompanion({mode:"composition"}),o.kosLoggerAware()],T);const Te=T.Registration,{URL:M}=o.resolveServiceUrl("FCM-PUMP_SERVICE"),{postModel:w}=o.ServiceFactory.build({basePath:`${M}/api/fcm-pump`}),f=o.KosLog.createLogger({name:"fcm-pump-service",group:"Services"}),Se=async e=>{var t,r,i,a,l;f.debug(`performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`);try{const n=await w({model:{},urlOverride:`${M}/api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`});return f.debug("performElectricalTest - response:",n),((n==null?void 0:n.status)===200||(n==null?void 0:n.status)===499)&&((t=n.data)!=null&&t.error)?[n.data.error||"unknownError",n.data]:[void 0,n==null?void 0:n.data]}catch(n){if(f.error(`performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`,n),n instanceof o.FetchError){const c=((i=(r=n.payload)==null?void 0:r.data)==null?void 0:i.error)||((a=n.payload)==null?void 0:a.error)||"unknownError";return[c,((l=n.payload)==null?void 0:l.data)||{error:c}]}}return["unknownError",{error:"unknownError"}]},Ie=async(e,t)=>{f.debug(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/preCalibrate`);try{const r=await w({model:{},urlOverride:`${M}/api/ext/freestyle/fcm/calibration/${e}/preCalibrate`,tracker:t});return f.debug("performPreCalibrate - response:",r),r!=null&&r.data&&o.FutureManager.initiateFuture(r.data),r==null?void 0:r.data}catch(r){f.error(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/preCalibrate`,r);const i={id:t||"",endState:o.FutureEndState.Fail,tracker:t,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(i),i}},Ce=async(e,t)=>{f.debug(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/calibrate`);try{const r=await w({model:{},urlOverride:`${M}/api/ext/freestyle/fcm/calibration/${e}/calibrate`,tracker:t});return f.debug("performPreCalibrate - response:",r),r!=null&&r.data&&o.FutureManager.initiateFuture(r.data),r==null?void 0:r.data}catch(r){f.error(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/calibrate`,r);const i={id:t||"",endState:o.FutureEndState.Fail,tracker:t,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(i),i}},Ee=async(e,t,r)=>{f.debug(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/verify/${t}`);try{const i=await w({model:{},urlOverride:`${M}/api/ext/freestyle/fcm/calibration/${e}/verify/${t}`,tracker:r});return f.debug("performVerify - response:",i),i!=null&&i.data&&o.FutureManager.initiateFuture(i.data),i==null?void 0:i.data}catch(i){f.error(`performVerify - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/verify/${t}`,i);const a={id:r||"",endState:o.FutureEndState.Fail,tracker:r,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(a),a}},Ct=e=>e?e.data==="success"||!e.data?"success":e.data:"error",$e=async(e,t,r)=>{f.debug(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`);try{const i=await w({model:{},urlOverride:`${M}/api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`});return f.debug("performPreCalibrate - response:",i),Ct(i==null?void 0:i.data)}catch(i){f.error(`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`,i);return}};var Et=Object.defineProperty,$t=Object.getOwnPropertyDescriptor,G=(e,t,r,i)=>{for(var a=i>1?void 0:i?$t(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&Et(t,r,a),a};const Me="fcm-pump-model",Mt=o.KosLog.createLogger({name:"fcm-pump-model"});let C=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"pumpModel");s(this,"futureHandler");this.id=e,this.logger=r.logger,this.pumpModel=t.companionParent,this.futureHandler=new o.FutureHandler(this)}get future(){return this.futureHandler.future}get name(){return this.pumpModel.name}get canPour(){return this.pumpModel.canPour}get isPouring(){return this.pumpModel.isPouring}async cancelPour(){return this.pumpModel.cancelPour()}performIntent(e){return this.pumpModel.performIntent(e)}async performElectricalTest(){const[e,t]=await Se(this.pumpModel.path);return e&&Mt.error(`Failed to perform electrical test on pump ${this.id}`,e),t}getChildren(){return[...this.futureHandler.allFutures]}async performPreCalibrate(e){return Ie(this.pumpModel.path,e)}async performCalibrate(e){return Ce(this.pumpModel.path,e)}async performVerify(e,t){return Ee(this.pumpModel.path,e,t)}async performComplete(e,t){return $e(this.pumpModel.path,e,t)}async init(){this.logger.debug(`initializing fcm-pump ${this.id}`)}async load(){this.logger.debug(`loading fcm-pump ${this.id}`)}};G([o.kosFuture()],C.prototype,"performPreCalibrate",1);G([o.kosFuture()],C.prototype,"performCalibrate",1);G([o.kosFuture()],C.prototype,"performVerify",1);C=G([o.kosModel(Me)],C);const Oe=new o.KosModelRegistrationFactory({class:C,type:Me});var Ot=Object.defineProperty,At=Object.getOwnPropertyDescriptor,Ae=(e,t,r,i)=>{for(var a=i>1?void 0:i?At(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&Ot(t,r,a),a};const Re="freestyle-assembly-model",we="iceAgitator",Rt="carbTank",wt="remoteTrays";let N=class{constructor(e,t,r){s(this,"id");s(this,"_carbTankModel");s(this,"logger");s(this,"assembly");s(this,"_remoteTrays");this.id=e,this.logger=r.logger,this.assembly=t.companionParent}get holderGroups(){return this.assembly.holderGroups}get nozzlePaths(){return this.assembly.nozzlePaths}get allHolders(){return this.assembly.allHolders}getHoldersByGroup(e){return this.assembly.getHoldersByGroup(e)}getHoldersByNozzle(e){return this.assembly.getHoldersByNozzle(e)}get pumpsByNozzle(){return this.assembly.pumpsByNozzle}get pumpPaths(){return this.assembly.pumpPaths}get boards(){return this.assembly.boards}updateModel(e){return this.assembly.updateModel(e)}get iceAgitator(){return this.assembly.iceAgitator}get carbTank(){return this._carbTankModel}get cartridgeAgitators(){return this.assembly.cartridgeAgitators}get defaultCartridgeAgitator(){return this.assembly.cartridgeAgitators.data[0]}get cartridgeAgitatorModels(){return this.assembly.cartridgeAgitators.data}get hasCartridgeAgitators(){return this.assembly.cartridgeAgitators.data.length>0}get remoteTrays(){return this.assembly.remoteTrays}get hasRemoteTrays(){return this.assembly.remoteTrays?this.assembly.remoteTrays.data.length>0:!1}get supportsRemoteTrays(){return o.KosFeatureFlags.isFeatureEnabled(wt)}get supportsIce(){return o.KosFeatureFlags.isFeatureEnabled(we)}get supportsCarb(){return o.KosFeatureFlags.isFeatureEnabled(Rt)}async init(){this.logger.debug(`initializing freestyle-assembly ${this.id}`)}async ready(){const e=o.getKosCompanionModel(this.assembly,ae.type);this._carbTankModel=e}};Ae([o.kosChild],N.prototype,"_remoteTrays",2);N=Ae([o.kosParentAware(),o.kosModel(Re)],N);const z=new o.SingletonKosModelRegistrationFactory({class:N,type:Re});var Ft=Object.defineProperty,Dt=Object.getOwnPropertyDescriptor,Fe=(e,t,r,i)=>{for(var a=i>1?void 0:i?Dt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&Ft(t,r,a),a};const De="remote-tray-model";o.createPropKey("holderPath");const Lt=o.createPropKey("configPath");let k=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"holderPath");s(this,"configPath");s(this,"name");s(this,"remoteTrayEnabled");this.id=e,this.logger=r.logger,this.holderPath=t.holderPath,this.configPath=t.configPath,this.name=t.name}get troubles(){var e;return((e=this.holder)==null?void 0:e.troubles)??[]}get troubleStatus(){return""}get troublesByType(){var e;return((e=this.holder)==null?void 0:e.troublesByType)??{}}updateModel(e){}get holder(){return o.getKosModelSync(this.holderPath).model}get active(){return!!this.remoteTrayEnabled.value}async init(){this.logger.debug(`initializing remote-tray ${this.id}`)}async load(){this.logger.debug(`loading remote-tray ${this.id}`)}};Fe([o.kosConfigProperty({path:Lt,attribute:"enabled"})],k.prototype,"remoteTrayEnabled",2);k=Fe([o.kosModel(De)],k);const E=new o.KosModelRegistrationFactory({class:k,type:De});var Nt=Object.getOwnPropertyDescriptor,zt=(e,t,r,i)=>{for(var a=i>1?void 0:i?Nt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=n(a)||a);return a};const Le="remote-tray-container-model";let W=class{constructor(e){s(this,"id");this.id=e}};W=zt([o.kosModel(Le),o.kosLoggerAware(),o.kosContainerAware()],W);const j=new o.SingletonKosModelRegistrationFactory({class:W,type:Le});j.addRelatedModel(E);var kt=Object.getOwnPropertyDescriptor,Kt=(e,t,r,i)=>{for(var a=i>1?void 0:i?kt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=n(a)||a);return a};const Ne="freestyle-holder-model";function Ut(e){const t=o.KosContextManager.getContext(e),r=t==null?void 0:t.get(z.type);if(!r){o.KosLog.error("Freestyle assembly not found");return}return r}async function xt(e,t){if(!e||!t)return;const r=await e[t]();if(r!=null&&r.tracker)return o.FutureManager.getFuture(r.tracker)}let Z=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"holder");s(this,"context");s(this,"future");this.id=e,this.logger=r.logger,this.context=r.kosContext,this.holder=t.companionParent}get agitated(){return this.holder.data.agitated}async agitate(){if(!this.holder.data.agitated)return;this.future=void 0;const e=Ut(this.id);if(!e)return;if(!e.defaultCartridgeAgitator){this.logger.error("Agitator not found");return}return this.future=await xt(e.defaultCartridgeAgitator,"testAgitate"),this.future}get isRemote(){const e=`${E.type}-${this.holder.path}`,t=o.getKosModelSync(e);return t!=null&&t.model?!!t.model.remoteTrayEnabled.value:!1}async init(){this.logger.debug(`initializing freestyle-holder ${this.id}`)}async load(){this.logger.debug(`loading freestyle-holder ${this.id}`)}};Z=Kt([o.kosModel(Ne)],Z);const X=new o.KosModelRegistrationFactory({class:Z,type:Ne}),{URL:qt}=o.resolveServiceUrl("FREESTYLE-NOZZLE_SERVICE"),{getOne:Gt}=o.ServiceFactory.build({basePath:`${qt}/api/freestyle-nozzle`}),D=o.KosLog.createLogger({name:"freestyle-nozzle-service",group:"Services"});class ze extends Error{constructor(t){super(t),this.name="NutritionInfoError"}}class Q extends Error{constructor(t){super(t),this.name="InvalidRequestError"}}const ke=async(e,t,r,i="http://localhost:8081")=>{if(D.debug("sending GET for freestyle-nozzle"),!t)throw D.error("Invalid freestyle-nozzle request: beverageId is required"),new Q("No beverageId provided");if(!r||r.length===0)throw D.error("Invalid freestyle-nozzle request: volumes are required"),new Q("No volumes provided");const a=await Gt({urlOverride:`${i}${e}/pipeline/beverage/engine/nutrition/${t}?volumes=${r.join(",")}`});if(!(a!=null&&a.data))throw D.error("Failed to retrieve freestyle-nozzle data"),new Error("Failed to retrieve freestyle-nozzle data");if(a.data.error)throw new ze(a.data.error);return a.data};var jt=Object.defineProperty,Vt=Object.getOwnPropertyDescriptor,Ke=(e,t,r,i)=>{for(var a=i>1?void 0:i?Vt(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&jt(t,r,a),a};const Ue="freestyle-nozzle-model";let K=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"nozzleModel");s(this,"_cupSizes");s(this,"_nutritionInfo");this.id=e,this.logger=r.logger,this.nozzleModel=t.companionParent,this._cupSizes=[100]}set cupSizes(e){this._cupSizes=e}get nutritionInfo(){return this._nutritionInfo}get selectedPourable(){return this.nozzleModel.selectedPourable}async handleBeverageSelection(){if(this.nozzleModel.selectedPourable.beverage&&this._cupSizes.length){this.logger.debug(`selected beverage: ${this.nozzleModel.selectedPourable.beverage.rawId}. Volume: ${this._cupSizes.join(", ")}`);const e=this.nozzleModel.selectedPourable.beverage.rawId,t=this.nozzleModel.urlPrefix;try{const r=await ke(t,e,this._cupSizes);o.kosAction(()=>{this._nutritionInfo=r})}catch(r){this.logger.error(`Error fetching nutrition info: ${r}`)}}}async init(){this.logger.debug(`initializing freestyle-nozzle ${this.id}`)}unload(){this.logger.debug(`unloading freestyle-nozzle ${this.id}`)}async load(){this.logger.debug(`loading freestyle-nozzle ${this.id}`)}};Ke([o.kosModelEffect({dependencies:e=>[e.selectedPourable.beverage]})],K.prototype,"handleBeverageSelection",1);K=Ke([o.kosParentAware(),o.kosModel(Ue)],K);const J=new o.KosModelRegistrationFactory({class:K,type:Ue}),{URL:xe}=o.resolveServiceUrl("PUMP_SERVICE"),{postModel:Bt}=o.ServiceFactory.build({basePath:`${xe}/api/ext/freestyle/microCalibration`}),Y=o.KosLog.createLogger({name:"freestyle-pump-service",group:"Services"}),qe=async(e,t)=>{var r,i,a,l,n;Y.debug(`replacePump - sending POST request to /api/ext/freestyle/microCalibration/cal/${e}/code/${t}`);try{const c=await Bt({model:{},urlOverride:`${xe}/api/ext/freestyle/microCalibration/cal/${e}/code/${t}`});return Y.debug("replacePump - response:",c),((c==null?void 0:c.status)===200||(c==null?void 0:c.status)===499)&&((r=c.data)!=null&&r.error)?[c.data.error||"unknownError",c.data]:[void 0,c==null?void 0:c.data]}catch(c){if(Y.error(`replacePump - sending POST request to /api/cal/${e}/code/${t}`,c),c instanceof o.FetchError){const v=((a=(i=c.payload)==null?void 0:i.data)==null?void 0:a.error)||((l=c.payload)==null?void 0:l.error)||"unknownError";return[v,((n=c.payload)==null?void 0:n.data)||{error:v}]}}return["unknownError",{error:"unknownError"}]};var Ht=Object.getOwnPropertyDescriptor,Yt=(e,t,r,i)=>{for(var a=i>1?void 0:i?Ht(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=n(a)||a);return a};const Ge="freestyle-pump-model";let ee=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"pump");this.id=e,this.logger=r.logger,this.pump=t.companionParent}async replacePump(e){const[t,r]=await qe(this.pump.path,e);return t&&this.logger.error(`Failed to replace the pump, ${this.pump.id}`,t),[t,r]}};ee=Yt([o.kosModel(Ge)],ee);const te=new o.KosModelRegistrationFactory({class:ee,type:Ge}),{URL:S}=o.resolveServiceUrl("ICE_AGITATOR_SERVICE"),{getAll:je,postModel:V}=o.ServiceFactory.build({basePath:`${S}/api/ext/freestyle/ice`}),Ve=o.KosLog.createLogger({name:"ice-agitator-service",group:"Services"}),Wt=async e=>(Ve.debug("sending GET for ice types"),await je({urlOverride:`${S}/api/handle/${e}/types`})),Zt=async(e,t)=>(Ve.debug("sending POST for ice types"),await V({urlOverride:`${S}/api/handle/${e}/type/${t}`,model:{}})),Xt=async e=>await je({urlOverride:`${S}/api/kos/config/details/${e}/4`}),Qt=async(e,t)=>{const r=await V({model:{},tracker:t,urlOverride:`${S}/api/handle/${e}/pour`});if(!(r!=null&&r.data))throw new Error("No response from server");return r==null?void 0:r.data},Jt=async(e,t)=>{const r=await V({model:{},tracker:t,urlOverride:`${S}/api/handle/${e}/test/agitation`});if(!(r!=null&&r.data))throw new Error("No response from server");return r==null?void 0:r.data},er=async(e,t)=>{const r=await V({model:{},tracker:t,urlOverride:`${S}/api/handle/${e}/test/gate`});if(!(r!=null&&r.data))throw new Error("No response from server");return r==null?void 0:r.data};var tr=Object.defineProperty,rr=Object.getOwnPropertyDescriptor,g=(e,t,r,i)=>{for(var a=i>1?void 0:i?rr(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&tr(t,r,a),a};class A{}s(A,"TOPIC_AGITATION_STARTED","/kos/events/ddk/ice-agitation-started"),s(A,"TOPIC_AGITATION_ENDED","/kos/events/ddk/ice-agitation-ended");const Be="ice-agitator-model",He=o.createPropKey("statePath");let p=class{constructor(e,t,r){s(this,"id");s(this,"name");s(this,"path");s(this,"volWithoutIceMl");s(this,"durationSec");s(this,"enableIceChuteClear");s(this,"iceChuteClearDurationMs");s(this,"iceChuteClearIntervalSec");s(this,"iceChuteClearRetryIntervalSec");s(this,"maxDispenseSec");s(this,"type");s(this,"dilutionOffset");s(this,"inactivitySec");s(this,"agitating");s(this,"iceChuteOpen");s(this,"statePath");s(this,"_allIceTypes");s(this,"logger");s(this,"currentState",d.PourState.IDLE);s(this,"resetDefaultValues",async()=>await Xt(this.path));this.id=e,this.name=t.name,this.path=t.path,this.statePath=t.statePath,this._allIceTypes=[],this.logger=r.logger}get iceTypes(){return this._allIceTypes}get isAgitating(){return!!this.agitating.value}get isIceChuteOpen(){return!!this.iceChuteOpen.value}get isPouring(){var e;return!!(this.pourFuture&&!((e=this.pourFuture)!=null&&e.endState))||this.currentState===d.PourState.POUR_STARTING||this.currentState===d.PourState.POURING||this.currentState===d.PourState.POUR_CANCELING}get canPour(){return this.currentState===d.PourState.IDLE}updateIfCurrent(e,t){this.currentState===e&&o.kosAction(()=>{this.currentState=t})}async pourIce(e){try{if(this.currentState===d.PourState.IDLE){if(this.updateIfCurrent(d.PourState.IDLE,d.PourState.POUR_STARTING),!e)throw new Error("No tracker provided");const t=await Qt(this.path,e);return this.updateIfCurrent(d.PourState.POUR_STARTING,d.PourState.POURING),t!=null&&t.endState&&this.updateIfCurrent(d.PourState.POURING,d.PourState.IDLE),t}else throw new Error(`Cannot pour in state ${this.currentState}`)}catch(t){throw this.logger.error(t),this.currentState=d.PourState.IDLE,t}}async cancelIceDispense(){var e;this.currentState===d.PourState.POURING||this.currentState===d.PourState.POUR_STARTING?(this.currentState=d.PourState.POUR_CANCELING,await((e=this.pourFuture)==null?void 0:e.cancelFuture()),o.kosAction(()=>{this.currentState=d.PourState.IDLE})):this.logger.warn(`Cannot cancel ice dispense in state ${this.currentState}`)}async testAgitate(e){if(!e)throw new Error("No tracker provided");return this.logger.info(`agitating ice-agitator ${this.id}`),Jt(this.path,e)}async testGate(e){if(!e)throw new Error("No tracker provided");return this.logger.info(`testing ice gate: ${this.id}`),er(this.path,e)}handleAgitationChange(){var e;this.isAgitating?(this.logger.info(`agitating ice-agitator ${this.id}`),o.EventBus.publish(A.TOPIC_AGITATION_STARTED,{path:this.path,futureId:(e=this.futureHandler.future)==null?void 0:e.futureId})):o.EventBus.publish(A.TOPIC_AGITATION_ENDED,{path:this.path})}async updateIceType(e){await Zt(this.path,e)}async init(){this.logger.debug(`initializing ice-agitator ${this.id}`)}async load(){this.logger.debug(`loading ice-agitator ${this.id}`);const e=await Wt(this.path);(e==null?void 0:e.status)===200&&o.kosAction(()=>{this._allIceTypes=e.data||[]})}};g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"settings.volWithoutIceMl"})],p.prototype,"volWithoutIceMl",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"settings.durationSec",converter:{to:"second"}})],p.prototype,"durationSec",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"enableIceChuteClear"})],p.prototype,"enableIceChuteClear",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"iceChuteClearDurationMs"})],p.prototype,"iceChuteClearDurationMs",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"iceChuteClearIntervalSec"})],p.prototype,"iceChuteClearIntervalSec",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"iceChuteClearRetryIntervalSec"})],p.prototype,"iceChuteClearRetryIntervalSec",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"maxDispenseSec"})],p.prototype,"maxDispenseSec",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"type"})],p.prototype,"type",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"settings.dilutionOffset"})],p.prototype,"dilutionOffset",2);g([o.kosConfigProperty({path:o.KOS_MODEL_ID,attribute:"settings.inactivitySec",converter:{to:"minute"}})],p.prototype,"inactivitySec",2);g([o.kosStateProp({path:He,attribute:"agitating"})],p.prototype,"agitating",2);g([o.kosStateProp({path:He,attribute:"iceChuteOpen"})],p.prototype,"iceChuteOpen",2);g([o.kosFuture({alias:"pour"})],p.prototype,"pourIce",1);g([o.kosFuture({alias:"agitate"})],p.prototype,"testAgitate",1);g([o.kosFuture({alias:"gate"})],p.prototype,"testGate",1);g([o.kosModelEffect({dependencies:e=>[e.isAgitating]})],p.prototype,"handleAgitationChange",1);p=g([o.kosModel(Be),o.kosMultipleFutureAware()],p);const ne=new o.KosModelRegistrationFactory({class:p,type:Be});var or=Object.getOwnPropertyDescriptor,ar=(e,t,r,i)=>{for(var a=i>1?void 0:i?or(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=n(a)||a);return a};const Ye="lfcv-pump-model";let re=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"pumpModel");this.id=e,this.logger=r.logger,this.pumpModel=t.companionParent}get name(){return this.pumpModel.name}get canPour(){return this.pumpModel.canPour}get isPouring(){return this.pumpModel.isPouring}async cancelPour(){return this.pumpModel.cancelPour()}performIntent(e){return this.pumpModel.performIntent(e)}async init(){this.logger.debug(`initializing lfcv-pump ${this.id}`)}async load(){this.logger.debug(`loading lfcv-pump ${this.id}`)}};re=ar([o.kosModel(Ye)],re);const We=new o.KosModelRegistrationFactory({class:re,type:Ye}),{URL:ir}=o.resolveServiceUrl("LFCV-PUMP_SERVICE"),{getAll:sr}=o.ServiceFactory.build({basePath:`${ir}/api/lfcv-pump`}),nr=o.KosLog.createLogger({name:"lfcv-pump-service",group:"Services"}),lr=async()=>(nr.debug("sending GET for lfcv-pump"),await sr({})),{URL:F}=o.resolveServiceUrl("SPM-PUMP_SERVICE"),{postModel:B}=o.ServiceFactory.build({basePath:`${F}/api/spm-pump`}),P=o.KosLog.createLogger({name:"spm-pump-service",group:"Services"}),Ze=async(e,t)=>{P.debug(`performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`);try{const r=await B({model:{},urlOverride:`${F}/api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`,tracker:t});return P.debug("performPreCalibrate - response:",r),r!=null&&r.data&&o.FutureManager.initiateFuture(r.data),r==null?void 0:r.data}catch(r){P.error(`performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`,r);const i={id:t||"",endState:o.FutureEndState.Fail,tracker:t,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(i),i}},Xe=async(e,t)=>{P.debug(`performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/calibrate`);try{const r=await B({model:{},urlOverride:`${F}/api/ext/freestyle/microCalibration/pour/${e}/calibrate`,tracker:t});return P.debug("performCalibrate - response:",r),r!=null&&r.data&&o.FutureManager.initiateFuture(r.data),r==null?void 0:r.data}catch(r){P.error(`performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/calibrate`,r);const i={id:t||"",endState:o.FutureEndState.Fail,tracker:t,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(i),i}},Qe=async(e,t,r,i)=>{P.debug(`performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/verify`);try{const a=await B({model:{...r,measuredCalibrationVolume:t},urlOverride:`${F}/api/ext/freestyle/microCalibration/pour/${e}/verify`,tracker:i});return P.debug("performVerify - response:",a),a!=null&&a.data&&o.FutureManager.initiateFuture(a.data),a==null?void 0:a.data}catch(a){P.error(`performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/verify`,a);const l={id:i||"",endState:o.FutureEndState.Fail,tracker:i,reason:"Failed to resolve trouble"};return o.FutureManager.initiateFuture(l),l}},Je=async(e,t,r,i)=>{var a,l,n,c,v;P.debug(`performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/complete`);try{const u=await B({model:{...i,measuredCalibrationVolume:t,measuredVerificationVolume:r},urlOverride:`${F}/api/ext/freestyle/microCalibration/pour/${e}/complete`});return P.debug("performComplete - response:",u),((u==null?void 0:u.status)===200||(u==null?void 0:u.status)===499)&&((a=u.data)!=null&&a.error)?[u.data.error||"unknownError",u.data]:[void 0,u==null?void 0:u.data]}catch(u){if(P.error(`performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/complete`,u),u instanceof o.FetchError){const m=((n=(l=u.payload)==null?void 0:l.data)==null?void 0:n.error)||((c=u.payload)==null?void 0:c.error)||"unknownError";return[m,((v=u.payload)==null?void 0:v.data)||{error:m}]}}return["unknownError",{error:"unknownError"}]};var ur=Object.defineProperty,cr=Object.getOwnPropertyDescriptor,H=(e,t,r,i)=>{for(var a=i>1?void 0:i?cr(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&ur(t,r,a),a};const et="spm-pump-model";let $=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"pump");s(this,"futureHandler");this.id=e,this.logger=r.logger,this.pump=t.companionParent,this.futureHandler=new o.FutureHandler(this)}get name(){return this.pump.name}get canPour(){return this.pump.canPour}get isPouring(){return this.pump.isPouring}async cancelPour(){return this.pump.cancelPour()}performIntent(e){return this.pump.performIntent(e)}get future(){return this.futureHandler.future}async performPreCalibrate(e){return Ze(this.pump.path,e)}async performCalibrate(e){return Xe(this.pump.path,e)}async performVerify(e,t,r){return Qe(this.pump.path,e,t,r)}async performComplete(e,t,r){return Je(this.pump.path,e,t,r)}async init(){this.logger.debug(`initializing spm-pump ${this.id}`)}async load(){this.logger.debug(`loading spm-pump ${this.id}`)}};H([o.kosFuture()],$.prototype,"performPreCalibrate",1);H([o.kosFuture()],$.prototype,"performCalibrate",1);H([o.kosFuture()],$.prototype,"performVerify",1);$=H([o.kosModel(et)],$);const tt=new o.KosModelRegistrationFactory({class:$,type:et});var dr=Object.defineProperty,pr=Object.getOwnPropertyDescriptor,le=(e,t,r,i)=>{for(var a=i>1?void 0:i?pr(t,r):t,l=e.length-1,n;l>=0;l--)(n=e[l])&&(a=(i?n(t,r,a):n(a))||a);return i&&a&&dr(t,r,a),a};const ue="agitation-required-trouble-model",gr=e=>{if(e.data.agitationRequired)return ue},rt="InsufficientAgitationTrouble";let R=class{constructor(e,t,r){s(this,"id");s(this,"logger");s(this,"trouble");s(this,"_deferred");s(this,"_holdersLoaded",!1);s(this,"agitateBeforePour");this.id=e,this.logger=r.logger,this._deferred=!1,this.trouble=t.companionParent}async resolve(){return this.trouble.resolve()}get holder(){const e=this.trouble.data.holderPaths[0],t=o.getKosModelSync(e);if(!(!this._holdersLoaded&&!t.model))return t==null?void 0:t.model}updateHolder(){if(!this._holdersLoaded){const e=this.trouble.data.holderPaths[0];o.getKosModelSync(e).model&&(this._holdersLoaded=!0)}}get shouldDefer(){var i,a;if(!this.holder)return!0;const t=(((i=this.holder)==null?void 0:i.troublesByType[rt])||[]).length>0;return!!((a=this.agitateBeforePour)!=null&&a.value)&&t}get deferred(){return this._deferred}defer(){this._deferred=!0}clearDefer(){this._deferred=!1}};le([o.kosConfigProperty({path:"app:kosdev.ddk:app",attribute:"ncui.agitateBeforePour"})],R.prototype,"agitateBeforePour",2);le([o.kosTopicHandler({topic:o.modelTypeEventTopicFactory(d.Assembly.type),lifecycle:o.DependencyLifecycle.INIT})],R.prototype,"updateHolder",1);R=le([o.kosModel(ue)],R);const ot=new o.KosModelRegistrationFactory({class:R,type:ue}),hr=["iceAgitator"],fr={iceAgitator:ne.factory},yr=o.KosLog.createLogger({name:"freestyle-assembly-data-mapper"}),mr=async e=>{const t=x.instance().options({}).build(),r=j.instance().options({}).build(),i=e.assemblies.reduce((n,c)=>{var v;return hr.forEach(u=>{var _;const m=c[u];if(m){const it=fr[u](m.path);n[u]=it({name:m.name,path:m.path,statePath:((_=m.state)==null?void 0:_.path)||""})}}),(v=c.cartridgeAgitators)==null||v.forEach(u=>{var _;const m=ie.instance(u.path).options({name:u.name,path:u.path,statePath:((_=u.state)==null?void 0:_.path)||""}).build();t.addModel(m)}),c.remoteTrays&&c.remoteTrays.forEach(u=>{yr.info(`Found remote tray ${u.name} with path ${u.path}`);const m=`${E.type}-${u.holderPath}`,_=E.instance(m).options({holderPath:u.holderPath,configPath:u.path,name:u.name}).build();r.addModel(_)}),n},{}),a=!!i.iceAgitator,l=!!i.carbTank;return{...i,cartridgeAgitators:t,remoteTrays:r,supportsCarb:l,supportsIce:a}},at=e=>()=>(o.registerCoreModels(e)(),d.registerDispenseModels(e)(),J.register(),z.register(),ne.register(),ae.register(),x.register(),tt.register(),Oe.register(),We.register(),Te.register(),te.register(),X.register(),E.register(),j.register(),o.RegistrationManager.companion.register(e)(d.Nozzle.type,J.type),o.RegistrationManager.companion.register(e)(d.Assembly.type,z.type),ot.register(),o.RegistrationManager.companion.register(e)(o.Trouble.type,gr),o.RegistrationManager.companion.register(e)(d.Pump.type,te.type),o.RegistrationManager.companion.register(e)(d.Holder.type,X.type),o.ExtensionManager[o.EXTENSION_TROUBLE_DATA_MAPPER].register("EnjoyByTrouble",async t=>{if(t.data.enjoyByDate){const r=new Date(t.data.enjoyByDate);return{enjoyByDays:Math.floor((new Date().getTime()-r.getTime())/(1e3*60*60*24))||""}}return{}}),o.ExtensionManager[o.EXTENSION_TROUBLE_DATA_MAPPER].register("SuperPumpRequiredTrouble",async t=>{const{model:r}=o.getKosModelSync(d.PumpContainer.type);return r?{superPumps:r.models.getIndexByKey(d.PumpIndex.byType,"microSuper").map(l=>l.name).join(", ")}:{}}),o.ExtensionManager[o.EXTENSION_TROUBLE_DATA_MAPPER].register("MicroPumpAirDetectTrouble",async t=>{if(t.ifaces.includes("container"))return{};if(t.data.pumpPath){const{model:r}=o.getKosModelSync(t.data.pumpPath);if(r){const i=r.ingredientId?o.getKosModelSync(r.ingredientId).model:void 0;return{ingredientId:r.ingredientId,ingredientName:(i==null?void 0:i.name)||""}}}return{}}),{preload:o.RegistrationManager.model.preloadModel(e),model:o.RegistrationManager.model.register(e),companion:o.RegistrationManager.companion.register(e),legacy:o.RegistrationManager.model.registerLegacyModel(e)}),b={...d.KosModelRegistry};b.freestyle={models:at(b)};b.preload=o.RegistrationManager.model.preloadModel(b);b.model=o.RegistrationManager.model.register(b);b.companion=o.RegistrationManager.companion.register(b);b.legacy=o.RegistrationManager.model.registerLegacyModel(b);const Pr=b;function br(e){return o.kosServiceRequest(e)}const ce=o.createClient(),vr=Object.freeze(Object.defineProperty({__proto__:null,api:ce,default:ce,kosServiceRequest:br},Symbol.toStringTag,{value:"Module"}));function _r(e){return o.kosServiceRequest(e)}const de=o.createClient(),Tr=Object.freeze(Object.defineProperty({__proto__:null,api:de,default:de,kosServiceRequest:_r},Symbol.toStringTag,{value:"Module"}));function Sr(e){return o.kosServiceRequest(e)}const pe=o.createClient(),Ir=Object.freeze(Object.defineProperty({__proto__:null,api:pe,default:pe,kosServiceRequest:Sr},Symbol.toStringTag,{value:"Module"}));function Cr(e){return o.kosServiceRequest(e)}const ge=o.createClient(),Er=Object.freeze(Object.defineProperty({__proto__:null,api:ge,default:ge,kosServiceRequest:Cr},Symbol.toStringTag,{value:"Module"}));function $r(e){return o.kosServiceRequest(e)}const he=o.createClient(),Mr=Object.freeze(Object.defineProperty({__proto__:null,api:he,default:he,kosServiceRequest:$r},Symbol.toStringTag,{value:"Module"}));exports.AGITATION_REQUIRED_TROUBLE=rt;exports.AgitationRequiredTrouble=ot;exports.CarbAgitator=ae;exports.CartridgeAgitator=ie;exports.CartridgeAgitatorContainer=x;exports.CartridgeAgitatorEvents=O;exports.CgpPump=Te;exports.FEATURE_SUPPORTS_ICE=we;exports.FcmPump=Oe;exports.FreestyleAssembly=z;exports.FreestyleHolder=X;exports.FreestyleNozzle=J;exports.FreestylePump=te;exports.IceAgitator=ne;exports.IceAgitatorEvents=A;exports.InvalidRequestError=Q;exports.KosModelRegistry=Pr;exports.LfcvPump=We;exports.NutritionInfoError=ze;exports.RemoteTray=E;exports.RemoteTrayContainer=j;exports.SpmPump=tt;exports.freestyleAssemblyDataMapper=mr;exports.getFreestyleNutritionInfo=ke;exports.getLfcvPumps=lr;exports.performCalibrate=Ce;exports.performCalibrate$1=Xe;exports.performComplete=$e;exports.performComplete$1=Je;exports.performElectricalTest=Se;exports.performPreCalibrate=Ie;exports.performPreCalibrate$1=Ze;exports.performVerify=Ee;exports.performVerify$1=Qe;exports.registerFreestyleModels=at;exports.replacePump=qe;exports.service=vr;exports.service$1=Tr;exports.service$2=Ir;exports.service$3=Er;exports.service$4=Mr;
|
|
2
|
+
//# sourceMappingURL=service-DrOwtgpN.cjs.map
|