@kosdev-code/kos-ddk-model-components 0.1.0-dev.5879 → 0.1.0-dev.5881

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.
@@ -1 +1 @@
1
- {"version":3,"file":"calibrate-modal.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/calibrate-modal/calibrate-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAsBnE,UAAU,mBAAoB,SAAQ,eAAe;IACnD,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,0BACF,mBAAmB;;CAqR3C,CAAC"}
1
+ {"version":3,"file":"calibrate-modal.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/calibrate-modal/calibrate-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAsBnE,UAAU,mBAAoB,SAAQ,eAAe;IACnD,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,0BACF,mBAAmB;;CAoR3C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"holder-card.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/holders/holder-card.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAEL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AA6BxC,UAAU,KAAK;IACb,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,aAAa,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC;AA+CD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAqQrD,CAAC"}
1
+ {"version":3,"file":"holder-card.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/holders/holder-card.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAEL,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AA6BxC,UAAU,KAAK;IACb,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,aAAa,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACvC;AA+CD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAsQrD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"macro-holder-card.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/holders/macro-holder-card.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAwHpE,UAAU,oBAAoB;IAC5B,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAID,eAAO,MAAM,eAAe,2DAMvB,oBAAoB;;CAmKxB,CAAC"}
1
+ {"version":3,"file":"macro-holder-card.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/holders/macro-holder-card.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAwHpE,UAAU,oBAAoB;IAC5B,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B;AAID,eAAO,MAAM,eAAe,2DAMvB,oBAAoB;;CAoKxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"remote-nns-modal.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/remote-nns-modal/remote-nns-modal.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,gCAAgC,CAAC;AAcxC,UAAU,mBAAoB,SAAQ,eAAe;IACnD,UAAU,EAAE,eAAe,CAAC;CAC7B;AAED,eAAO,MAAM,cAAc,gCACI,mBAAmB;;CAqLjD,CAAC"}
1
+ {"version":3,"file":"remote-nns-modal.d.ts","sourceRoot":"","sources":["../../../../../../packages/ddk/kos-ddk-model-components/src/components/remote-nns-modal/remote-nns-modal.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,gCAAgC,CAAC;AAcxC,UAAU,mBAAoB,SAAQ,eAAe;IACnD,UAAU,EAAE,eAAe,CAAC;CAC7B;AAED,eAAO,MAAM,cAAc,gCACI,mBAAmB;;CAoLjD,CAAC"}
package/index.cjs CHANGED
@@ -39,7 +39,7 @@
39
39
  border-top: solid 1px #888888;
40
40
  padding-top: 8px;
41
41
  width: calc(100% - 10px);
42
- `,Ne=({children:t,onPointerDown:e,title:n,subtitle:s})=>{const{componentModeOverride:o}=d.useComponentConfigurationContext(),{t:a}=u.useKosTranslation("common"),c=n??t;return r.jsxs(vs,{children:[r.jsxs(No,{children:[r.jsxs(Cs,{style:{fontSize:"var(--ddk-component-progress-bar-message-font-size)"},children:[r.jsx(ke.MessageErrorIcon,{style:{color:"var(--ddk-component-progress-bar-icon-color-failure)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),c]}),s&&r.jsx(Do,{children:s})]}),o==="compact"?r.jsx(d.Button,{mode:"primary",onPointerDown:e,children:a("close","Close")}):r.jsx(ys,{label:!1,size:"large",onPointerDown:e})]})},rt=({children:t,onPointerDown:e})=>{const{componentModeOverride:n}=d.useComponentConfigurationContext(),{t:s}=u.useKosTranslation("common");return r.jsxs(vs,{children:[r.jsxs(Cs,{children:[r.jsx(ke.SuccessIcon,{style:{color:"var(--ddk-semantic-color-system-green)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),t]}),n==="compact"?r.jsx(d.Button,{mode:"primary",onPointerDown:e,children:s("close","Close")}):r.jsx(ys,{label:!1,size:"large",onPointerDown:e})]})},Pn=t=>(t==null?void 0:t.title)&&(t==null?void 0:t.subtitle),K=u.kosComponent(({title:t,future:e,failureMessage:n,successMessage:s,cancelMessage:o,isCancelable:a=!0,onSuccess:c,onClose:i})=>{const{t:l}=u.useKosTranslation("common"),[m,h]=p.useState(!0),[f,g]=p.useState(),v=`${e==null?void 0:e.timeRemaining} ${l("remaining","remaining")}`,y=p.useCallback(()=>{f!=="in-progress"&&(i==null||i(),h(!1))},[i,f]),x=p.useCallback(()=>{y(),c==null||c()},[y,c]);p.useEffect(()=>{(e==null?void 0:e.status)==="IN_PROGRESS"||(e==null?void 0:e.status)==="NOT_ACTIVE"?(g("in-progress"),h(!0)):(e==null?void 0:e.status)==="SUCCESS"?(g("success"),h(!!s),s||(y(),c==null||c())):(e==null?void 0:e.status)==="FAIL"||(e==null?void 0:e.status)==="ABORT"?(g("failure"),h(!!n)):(e==null?void 0:e.status)==="CANCEL"?(g("cancelled"),h(!!o)):e&&Ao.error("unknown status",e==null?void 0:e.status)},[n,e,e==null?void 0:e.status,s,o,y,c]);const _=Pn(n)?n.subtitle:void 0,R=Pn(n)?n.title:n??l("something-went-wrong","Something went wrong");return e&&r.jsx(d.ProgressBar,{isCancelable:a,onCancel:()=>{e.cancelFuture()},blocked:f==="in-progress",onClose:y,renderFailure:n&&r.jsx(Ne,{subtitle:_,onPointerDown:y,children:R}),renderCancel:o&&r.jsx(Ne,{onPointerDown:y,children:o}),renderSuccess:s&&r.jsx(rt,{onPointerDown:x,children:s}),show:m,status:f,subtitle:v,title:t,value:e.progress})}),Oo=u.KosLog.createLogger({name:"agitation-control-view"});Oo.debug("agitation-control-view component loaded");const Ro=T.div``,Fo=u.kosComponent(()=>{const{model:t}=Kt(),{t:e,i18n:n}=u.useKosTranslation("troubles"),{future:s,failure:o}=J(t),a=p.useCallback(()=>{t&&t.clearAll()},[t]),c=s==null?void 0:s.reason,i=c?`__troubles.errors.${c}__`:void 0,l="troubles.agitation.error",m=n.exists(`troubles.errors.${c}`);return r.jsx(Ro,{children:r.jsx(K,{title:e("troubles.agitation.title"),future:s,isCancelable:!0,onClose:a,failureMessage:e(l,{context:i&&m?"reason":void 0,data:{reason:i}})})})}),ws=u.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"fcm-calibration"}),[s,o]=p.useState("high-flow-test-idle"),[a,c]=p.useState(),[i,l]=p.useState(),[m,h]=p.useState(),{future:f}=J(t);p.useEffect(()=>{switch(f==null?void 0:f.endState){case"CANCEL":switch(s){case"high-flow-test-in-progress":o("high-flow-test-idle");break;default:c("calibration-canceled"),o("failure")}break;case"SUCCESS":switch(s){case"high-flow-test-in-progress":o("high-flow-test-success");break;case"calibration-in-progress":o("calibration-input");break;case"verification-in-progress":o("verification-input");break}break;case"FAIL":c(f==null?void 0:f.reason),o("failure");break}},[f,f==null?void 0:f.endState,f==null?void 0:f.reason,s]);const g=p.useMemo(()=>({"high-flow-test-idle":{information:r.jsx(d.LabelInformation,{children:n("high-flow-test-idle-information")}),footer:r.jsx(d.Button,{onPointerDown:()=>{t.performPreCalibrate(),o("high-flow-test-in-progress")},children:n("initiate-high-flow-test")}),status:"information"},"high-flow-test-in-progress":{information:r.jsx(d.LabelInformation,{children:n("high-flow-test-in-progress-information")}),footer:r.jsx(d.Button,{disabled:!0,children:n("initiate-high-flow-test")}),status:"loading"},"high-flow-test-success":{information:r.jsx(d.LabelInformation,{children:n("high-flow-test-success-information")}),footer:r.jsx(d.Button,{onPointerDown:()=>o("calibration-idle"),children:n("proceed")}),status:"success"},"calibration-idle":{information:r.jsx(d.BodyMediumInformation,{children:n("calibration-idle-information")}),footer:r.jsx(d.Button,{onPointerDown:()=>{t.performCalibrate(),o("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:r.jsx(d.LabelInformation,{children:n("calibration-in-progress-information")}),status:"loading"},"calibration-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(d.BodyMediumInformation,{children:n("calibration-input-information")}),r.jsx(d.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:v=>{v!==void 0&&l(v)},value:i!==void 0?i:""})]}),footer:r.jsx(d.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&o("verification-idle")},children:n("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:r.jsx(d.BodyMediumInformation,{children:n("verification-idle-information")}),footer:r.jsx(d.Button,{onPointerDown:async()=>{i!==void 0&&(t.performVerify(i),o("verification-in-progress"))},children:n("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:r.jsx(d.LabelInformation,{children:n("verification-in-progress-information")}),status:"loading"},"verification-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(d.BodyMediumInformation,{children:n("verification-input-information")}),r.jsx(d.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:v=>{v!==void 0&&h(v)},value:m!==void 0?m:""})]}),footer:r.jsx(d.Button,{disabled:m===void 0,onPointerDown:async()=>{if(i===void 0||m===void 0)return;const v=await t.performComplete(i,m);v==="success"?o("verification-success"):(c(v),o(v==="errBadPump"?"verification-failure":"failure"))},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:r.jsx(d.LabelInformation,{children:n("verification-success-information")}),footer:r.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:r.jsx(d.LabelInformation,{children:n(`error.${a}`)}),footer:r.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"},failure:{information:r.jsxs(r.Fragment,{children:[r.jsx(d.LabelInformation,{children:n("calibration-failed")}),r.jsxs(d.BodyMediumInformation,{children:["Error Code: ",a,n(`error.${a||"unknownError"}`)]})]}),footer:r.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"}}),[a,e,t,n,i,m]);return r.jsxs(r.Fragment,{children:[r.jsx(d.WorkflowModal,{title:n(t.name),...g[s],onClose:()=>e()}),f&&r.jsx(K,{title:n("initiating"),future:f})]})}),Ut=u.kosComponent(({probeAware:t})=>{if(!t)return null;const e=t.highProbeWet.value,n=t.lowProbeWet.value,s=t.filling.value;return r.jsxs(Lo,{children:[r.jsxs(At,{children:[r.jsx(Nt,{children:"High Probe"}),r.jsx(Dt,{children:e?"Wet":"Dry"})]}),r.jsxs(At,{children:[r.jsx(Nt,{children:"Low Probe"}),r.jsx(Dt,{children:n?"Wet":"Dry"})]}),r.jsxs(At,{children:[r.jsx(Nt,{children:"Filling"}),r.jsx(Dt,{children:s?"Yes":"No"})]})]})}),Lo=T.div`
42
+ `,Ne=({children:t,onPointerDown:e,title:n,subtitle:s})=>{const{componentModeOverride:o}=d.useComponentConfigurationContext(),{t:a}=u.useKosTranslation("common"),c=n??t;return r.jsxs(vs,{children:[r.jsxs(No,{children:[r.jsxs(Cs,{style:{fontSize:"var(--ddk-component-progress-bar-message-font-size)"},children:[r.jsx(ke.MessageErrorIcon,{style:{color:"var(--ddk-component-progress-bar-icon-color-failure)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),c]}),s&&r.jsx(Do,{children:s})]}),o==="compact"?r.jsx(d.Button,{mode:"primary",onPointerDown:e,children:a("close","Close")}):r.jsx(ys,{label:!1,size:"large",onPointerDown:e})]})},rt=({children:t,onPointerDown:e})=>{const{componentModeOverride:n}=d.useComponentConfigurationContext(),{t:s}=u.useKosTranslation("common");return r.jsxs(vs,{children:[r.jsxs(Cs,{children:[r.jsx(ke.SuccessIcon,{style:{color:"var(--ddk-semantic-color-system-green)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),t]}),n==="compact"?r.jsx(d.Button,{mode:"primary",onPointerDown:e,children:s("close","Close")}):r.jsx(ys,{label:!1,size:"large",onPointerDown:e})]})},Pn=t=>(t==null?void 0:t.title)&&(t==null?void 0:t.subtitle),K=u.kosComponent(({title:t,future:e,failureMessage:n,successMessage:s,cancelMessage:o,isCancelable:a=!0,onSuccess:c,onClose:i})=>{const{t:l}=u.useKosTranslation("common"),[m,h]=p.useState(!0),[f,g]=p.useState(),v=`${e==null?void 0:e.timeRemaining} ${l("remaining","remaining")}`,y=p.useCallback(()=>{f!=="in-progress"&&(i==null||i(),h(!1))},[i,f]),x=p.useCallback(()=>{y(),c==null||c()},[y,c]);p.useEffect(()=>{(e==null?void 0:e.status)==="IN_PROGRESS"||(e==null?void 0:e.status)==="NOT_ACTIVE"?(g("in-progress"),h(!0)):(e==null?void 0:e.status)==="SUCCESS"?(g("success"),h(!!s),s||(y(),c==null||c())):(e==null?void 0:e.status)==="FAIL"||(e==null?void 0:e.status)==="ABORT"?(g("failure"),h(!!n)):(e==null?void 0:e.status)==="CANCEL"?(g("cancelled"),h(!!o)):e&&Ao.error("unknown status",e==null?void 0:e.status)},[n,e,e==null?void 0:e.status,s,o,y,c]);const _=Pn(n)?n.subtitle:void 0,R=Pn(n)?n.title:n??l("something-went-wrong","Something went wrong");return e&&r.jsx(d.ProgressBar,{isCancelable:a,onCancel:()=>{e.cancelFuture()},blocked:f==="in-progress",onClose:y,renderFailure:n&&r.jsx(Ne,{subtitle:_,onPointerDown:y,children:R}),renderCancel:o&&r.jsx(Ne,{onPointerDown:y,children:o}),renderSuccess:s&&r.jsx(rt,{onPointerDown:x,children:s}),show:m,status:f,subtitle:v,title:t,value:e.progress})}),Oo=u.KosLog.createLogger({name:"agitation-control-view"});Oo.debug("agitation-control-view component loaded");const Ro=T.div``,Fo=u.kosComponent(()=>{const{model:t}=Kt(),{t:e,i18n:n}=u.useKosTranslation("troubles"),{future:s,failure:o}=J(t),a=p.useCallback(()=>{t&&t.clearAll()},[t]),c=s==null?void 0:s.reason,i=c?`__troubles.errors.${c}__`:void 0,l="troubles.agitation.error",m=n.exists(`troubles.errors.${c}`);return r.jsx(Ro,{children:r.jsx(K,{title:e("troubles.agitation.title"),future:s,isCancelable:!0,onClose:a,failureMessage:e(l,{context:i&&m?"reason":void 0,data:{reason:i}})})})}),ws=u.kosComponent(({pump:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"fcm-calibration"}),[s,o]=p.useState("high-flow-test-idle"),[a,c]=p.useState(),[i,l]=p.useState(),[m,h]=p.useState(),{future:f}=J(t);p.useEffect(()=>{switch(f==null?void 0:f.endState){case"CANCEL":switch(s){case"high-flow-test-in-progress":o("high-flow-test-idle");break;default:c("calibration-canceled"),o("failure")}break;case"SUCCESS":switch(s){case"high-flow-test-in-progress":o("high-flow-test-success");break;case"calibration-in-progress":o("calibration-input");break;case"verification-in-progress":o("verification-input");break}break;case"FAIL":c(f==null?void 0:f.reason),o("failure");break}},[f,f==null?void 0:f.endState,f==null?void 0:f.reason,s]);const g=p.useMemo(()=>({"high-flow-test-idle":{information:r.jsx(d.LabelInformation,{children:n("high-flow-test-idle-information")}),footer:r.jsx(d.Button,{onPointerDown:()=>{t.performPreCalibrate(),o("high-flow-test-in-progress")},children:n("initiate-high-flow-test")}),status:"information"},"high-flow-test-in-progress":{information:r.jsx(d.LabelInformation,{children:n("high-flow-test-in-progress-information")}),footer:r.jsx(d.Button,{disabled:!0,children:n("initiate-high-flow-test")}),status:"loading"},"high-flow-test-success":{information:r.jsx(d.LabelInformation,{children:n("high-flow-test-success-information")}),footer:r.jsx(d.Button,{onPointerDown:()=>o("calibration-idle"),children:n("proceed")}),status:"success"},"calibration-idle":{information:r.jsx(d.BodyMediumInformation,{children:n("calibration-idle-information")}),footer:r.jsx(d.Button,{onPointerDown:()=>{t.performCalibrate(),o("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:r.jsx(d.LabelInformation,{children:n("calibration-in-progress-information")}),status:"loading"},"calibration-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(d.BodyMediumInformation,{children:n("calibration-input-information")}),r.jsx(d.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:v=>{v!==void 0&&l(v)},value:i!==void 0?i:""})]}),footer:r.jsx(d.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&o("verification-idle")},children:n("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:r.jsx(d.BodyMediumInformation,{children:n("verification-idle-information")}),footer:r.jsx(d.Button,{onPointerDown:async()=>{i!==void 0&&(t.performVerify(i),o("verification-in-progress"))},children:n("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:r.jsx(d.LabelInformation,{children:n("verification-in-progress-information")}),status:"loading"},"verification-input":{information:r.jsxs(r.Fragment,{children:[r.jsx(d.BodyMediumInformation,{children:n("verification-input-information")}),r.jsx(d.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:v=>{v!==void 0&&h(v)},value:m!==void 0?m:""})]}),footer:r.jsx(d.Button,{disabled:m===void 0,onPointerDown:async()=>{if(i===void 0||m===void 0)return;const v=await t.performComplete(i,m);v==="success"?o("verification-success"):(c(v),o(v==="errBadPump"?"verification-failure":"failure"))},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:r.jsx(d.LabelInformation,{children:n("verification-success-information")}),footer:r.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:r.jsx(d.LabelInformation,{children:n(`error.${a}`)}),footer:r.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"},failure:{information:r.jsxs(r.Fragment,{children:[r.jsx(d.LabelInformation,{children:n("calibration-failed")}),r.jsx(d.BodyMediumInformation,{children:n(`error.${a}`)})]}),footer:r.jsx(d.Button,{onPointerDown:e,children:n("exit-calibration")}),status:"error"}}),[a,e,t,n,i,m]);return r.jsxs(r.Fragment,{children:[r.jsx(d.WorkflowModal,{title:n(t.name),...g[s],onClose:()=>e()}),f&&r.jsx(K,{title:n("initiating"),future:f})]})}),Ut=u.kosComponent(({probeAware:t})=>{if(!t)return null;const e=t.highProbeWet.value,n=t.lowProbeWet.value,s=t.filling.value;return r.jsxs(Lo,{children:[r.jsxs(At,{children:[r.jsx(Nt,{children:"High Probe"}),r.jsx(Dt,{children:e?"Wet":"Dry"})]}),r.jsxs(At,{children:[r.jsx(Nt,{children:"Low Probe"}),r.jsx(Dt,{children:n?"Wet":"Dry"})]}),r.jsxs(At,{children:[r.jsx(Nt,{children:"Filling"}),r.jsx(Dt,{children:s?"Yes":"No"})]})]})}),Lo=T.div`
43
43
  display: grid;
44
44
  grid-template-columns: repeat(3, 1fr);
45
45
  gap: 16px;
@@ -195,7 +195,7 @@
195
195
  `,gi=T.div`
196
196
  font-size: var(--ddk-component-holder-card-footer-font-size);
197
197
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
198
- `,xi=t=>!t||t==="white",bi=t=>t?void 0:"white",yi=(t,e)=>e&&e.hasEnjoyByWarning?"var(--ddk-component-dashboard-enjoy-by-trouble-warning-color)":t?void 0:"white",so=u.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n,summaryBody:s,altNamePolicy:o="disable"})=>{const{model:a}=Me(),{visibleTroubles:c,initialized:i}=je(t),l=a==null?void 0:a.currentRole,{t:m}=u.useKosTranslation("troubles"),{t:h}=u.useKosTranslation("common"),{componentModeOverride:f}=d.useComponentConfigurationContext(),g=f==="compact",{getExtensions:v}=Te();let y=!1;const x=u.getKosCompanionModel(t,$.FreestyleHolder.type),_=x==null?void 0:x.altName,R=x==null?void 0:x.isRemote,D=o==="replace"&&!!_&&(x==null?void 0:x.isRemote);x!=null&&x.isRemote&&o==="disable"&&(no.warn("Holder is remote, skipping rendering"),y=!0);const[P,E]=p.useState(!1),w=!!t.ingredientId,U=p.useCallback(()=>{E(!1)},[]),q=(c==null?void 0:c.length)??0,B=c==null?void 0:c[0],H=q>0,wt=Ke(B),Ie=t.hasFuelGuage,pe=t.fillPercent,_t=t.removed?"var(--ddk-component-dashboard-card-background-color-removed)":y?"var(--ddk-component-dashboard-card-background-color-disabled)":H?`${B==null?void 0:B.color}`:t.unassigned?"var(--ddk-component-dashboard-card-background-color-unassigned)":void 0,ze=t.removed?"var(--ddk-component-dashboard-card-header-background-color-removed)":void 0,He=xi(_t),he=y?"white":t.unassigned?"var(--ddk-generic-color-grey-30)":H?bi(He):w?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",kt=y?"white":H?yi(He,t):w?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",Ze=D?h(_,{defaultValue:"Remote NNS Tray"}):d.useAbbreviation(t.name,g),We=y?h("disabled"):D?"":t.removed?h(t.previousIngredientName):t.unassigned?h("unassigned"):h(t.ingredientName),Xe=r.jsx(ns,{color:he,children:We}),St=r.jsx(fi,{color:he,children:Ze}),Tt=D?h(_,{defaultValue:"Remote NNS Tray"}):t.name,jt=r.jsxs(ns,{children:[Tt," ",We]}),It=w&&Ie&&!H&&i?s??r.jsx(d.FuelGauge,{color:H?"var(--ddk-generic-color-white)":void 0,size:"small",value:pe}):null,qe=w&&Ie&&!H&&i&&d.getFillColor(pe)||void 0,fe=u.ExtensionManager.executeDashboardKeyFactory(t)||"",ie=p.useMemo(()=>v(le.id),[v]),ge=p.useMemo(()=>ie.filter(ce=>!!ce.data).reduce((ce,En)=>{const So=En.data;return ce[So.dashboardKey]=En.data,ce},{}),[ie]),Ye=!!ge[fe],{HolderContent:Et,modalOptions:bo}=en(t),Pt=se.useExtensionComponent(le),yo=p.useMemo(()=>{var ce;return Et?r.jsx(Et,{holder:t,onComplete:U}):Ye&&Pt?r.jsx(Pt,{module:(ce=ge[fe])==null?void 0:ce.id,holder:t}):void 0},[Et,U,ge,Ye,t,fe,Pt]),vo=$e(B),Co=R&&!D,wo=r.jsx(gi,{color:H?he:kt,children:Co?h("remote-nns-active"):H?m(vo.summary,{context:B!=null&&B.deferred?"queued":void 0,data:wt}):!g&&r.jsx(mn,{size:"small",holder:t})}),{holderExperience:_o,setHolderExperience:In}=Se(t),{future:Ge}=J(B),ko=p.useCallback(()=>{y||t.sortedPumps.length<=0||(l==="technician"?E(!0):t.unassigned||t.removed?In("rfid-override"):H&&(e==null||e(t)))},[y,t,l,In,H,e]);return r.jsxs(r.Fragment,{children:[r.jsxs(d.Modal,{contain:!g,...bo,show:P,onClose:U,children:[r.jsx(d.Header,{contain:g,showCloseButton:!0,title:jt,onClose:U,CloseButton:g?d.BackButton:void 0}),yo]}),r.jsx(p.Suspense,{children:_o}),r.jsx(d.HolderDashboardCard,{avatar:St,headerBackgroundColor:ze,backgroundColor:_t,footer:wo,cardId:t.path,errors:q,title:Xe,indicatorColor:qe,disabled:y,body:It,showNavIcon:n,onCardSelect:ko},t.path),(B==null?void 0:B.future)&&r.jsx(K,{title:Xe,future:Ge,failureMessage:m(`troubles.${B.type}.error`,{context:Ge==null?void 0:Ge.reason})})]})}),jn=T.div`
198
+ `,xi=t=>!t||t==="white",bi=t=>t?void 0:"white",yi=(t,e)=>e&&e.hasEnjoyByWarning?"var(--ddk-component-dashboard-enjoy-by-trouble-warning-color)":t?void 0:"white",so=u.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n,summaryBody:s,altNamePolicy:o="disable"})=>{const{model:a}=Me(),{visibleTroubles:c,initialized:i}=je(t),l=a==null?void 0:a.currentRole,{t:m}=u.useKosTranslation("troubles"),{t:h}=u.useKosTranslation("common"),{componentModeOverride:f}=d.useComponentConfigurationContext(),g=f==="compact",{getExtensions:v}=Te();let y=!1;const x=u.getKosCompanionModel(t,$.FreestyleHolder.type),_=x==null?void 0:x.altName,R=x==null?void 0:x.isRemote,D=o==="replace"&&!!_&&(x==null?void 0:x.isRemote);x!=null&&x.isRemote&&o==="disable"&&(no.warn("Holder is remote, skipping rendering"),y=!0);const[P,E]=p.useState(!1),w=!!t.ingredientId,U=p.useCallback(()=>{E(!1)},[]),q=(c==null?void 0:c.length)??0,B=c==null?void 0:c[0],H=q>0,wt=Ke(B),Ie=t.hasFuelGuage,pe=t.fillPercent,_t=t.removed?"var(--ddk-component-dashboard-card-background-color-removed)":y?"var(--ddk-component-dashboard-card-background-color-disabled)":H?`${B==null?void 0:B.color}`:t.unassigned?"var(--ddk-component-dashboard-card-background-color-unassigned)":void 0,ze=!g&&t.removed?"var(--ddk-component-dashboard-card-header-background-color-removed)":void 0,He=xi(_t),he=y?"white":t.unassigned?"var(--ddk-generic-color-grey-30)":H?bi(He):w?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",kt=y?"white":H?yi(He,t):w?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",Ze=D?h(_,{defaultValue:"Remote NNS Tray"}):d.useAbbreviation(t.name,g),We=y?h("disabled"):D?"":t.removed?h(t.previousIngredientName):t.unassigned?h("unassigned"):h(t.ingredientName),Xe=r.jsx(ns,{color:he,children:We}),St=r.jsx(fi,{color:he,children:Ze}),Tt=D?h(_,{defaultValue:"Remote NNS Tray"}):t.name,jt=r.jsxs(ns,{children:[Tt," ",We]}),It=w&&Ie&&!H&&i?s??r.jsx(d.FuelGauge,{color:H?"var(--ddk-generic-color-white)":void 0,size:"small",value:pe}):null,qe=w&&Ie&&!H&&i&&d.getFillColor(pe)||void 0,fe=u.ExtensionManager.executeDashboardKeyFactory(t)||"",ie=p.useMemo(()=>v(le.id),[v]),ge=p.useMemo(()=>ie.filter(ce=>!!ce.data).reduce((ce,En)=>{const So=En.data;return ce[So.dashboardKey]=En.data,ce},{}),[ie]),Ye=!!ge[fe],{HolderContent:Et,modalOptions:bo}=en(t),Pt=se.useExtensionComponent(le),yo=p.useMemo(()=>{var ce;return Et?r.jsx(Et,{holder:t,onComplete:U}):Ye&&Pt?r.jsx(Pt,{module:(ce=ge[fe])==null?void 0:ce.id,holder:t}):void 0},[Et,U,ge,Ye,t,fe,Pt]),vo=$e(B),Co=R&&!D,wo=r.jsx(gi,{color:H?he:kt,children:Co?h("remote-nns-active"):H?m(vo.summary,{context:B!=null&&B.deferred?"queued":void 0,data:wt}):!g&&r.jsx(mn,{size:"small",holder:t})}),{holderExperience:_o,setHolderExperience:In}=Se(t),{future:Ge}=J(B),ko=p.useCallback(()=>{y||t.sortedPumps.length<=0||(l==="technician"?E(!0):t.unassigned||t.removed?In("rfid-override"):H&&(e==null||e(t)))},[y,t,l,In,H,e]);return r.jsxs(r.Fragment,{children:[r.jsxs(d.Modal,{contain:!g,...bo,show:P,onClose:U,children:[r.jsx(d.Header,{contain:g,showCloseButton:!0,title:jt,onClose:U,CloseButton:g?d.BackButton:void 0}),yo]}),r.jsx(p.Suspense,{children:_o}),r.jsx(d.HolderDashboardCard,{avatar:St,headerBackgroundColor:ze,backgroundColor:_t,footer:wo,cardId:t.path,errors:q,title:Xe,indicatorColor:qe,disabled:y,body:It,showNavIcon:n,onCardSelect:ko},t.path),(B==null?void 0:B.future)&&r.jsx(K,{title:Xe,future:Ge,failureMessage:m(`troubles.${B.type}.error`,{context:Ge==null?void 0:Ge.reason})})]})}),jn=T.div`
199
199
  display: flex;
200
200
  flex-direction: var(--ddk-component-dashboard-card-flex-direction);
201
201
  flex-wrap: nowrap;
@@ -229,7 +229,7 @@
229
229
  `,Ti=T.div`
230
230
  font-size: var(--ddk-component-holder-card-footer-font-size);
231
231
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
232
- `,ji=(t,e,n,s)=>{const o=s(`common:macros.${t.name}`),a=_i.includes(t.name),c=e?a?"":` ${s(`common:${t.ingredientName}`)}`:` ${s("common:macros.unassigned")}`,i=`${o}${c}`,l=n?a?o:c:`${o} ${c}`;return{titleText:i,cardTitleText:l}},Ii=u.kosComponent(({holder:t,dashboardKey:e,fallbackStatus:n})=>{const{getExtensions:s}=Te(),o=s(Le.id),a=l=>o.find(m=>{const h=m.data;return(h==null?void 0:h.dashboardKey)===l}),c=a(t.name)??a(e),i=se.useExtensionComponent(Le);return c&&i?r.jsx(i,{module:c.id,holder:t}):r.jsx(d.StatusIndicator,{size:"small",status:n})}),Ei=t=>!t||t==="white",Pi=t=>t?void 0:"white",oo=u.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n,summaryBody:s})=>{var qe,fe;const{model:o}=Me(),{visibleTroubles:a,initialized:c}=je(t),{t:i}=u.useKosTranslation(["troubles","common"]),{componentModeOverride:l}=d.useComponentConfigurationContext(),m=l==="compact",{getExtensions:h}=Te(),f=(qe=o==null?void 0:o.currentRole)==null?void 0:qe.toLowerCase(),[g,v]=p.useState(!1),y=!!t.ingredientId,x=(a==null?void 0:a.length)??0,_=a==null?void 0:a[0],R=a?a.length>0:!1,D=t.removed?"var(--ddk-component-dashboard-card-background-color-removed)":R?`${_==null?void 0:_.color}`:t.unassigned?"var(--ddk-component-dashboard-card-background-color-unassigned)":void 0,P=t.removed?"var(--ddk-component-dashboard-card-header-background-color-removed)":void 0,E=Ei(D),w=t.unassigned?"var(--ddk-generic-color-grey-30)":R?Pi(E):y?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",U=d.useAbbreviation(t.name,l==="compact"),{titleText:q,cardTitleText:B}=ji(t,y,m,i),H=l==="compact"&&r.jsx(Si,{color:w,children:U}),wt=r.jsx(ss,{color:w,children:B}),Ie=r.jsx(ss,{children:q}),pe=u.ExtensionManager.executeDashboardKeyFactory(t)||"",ze=h(le.id).filter(ie=>!!ie.data).reduce((ie,ge)=>{const Ye=ge.data;return ie[Ye.dashboardKey]=ge.data,ie},{}),He=!!ze[pe],{HolderContent:he,modalOptions:kt}=en(t),Ze=se.useExtensionComponent(le),We=s??r.jsx(Ii,{holder:t,dashboardKey:pe,fallbackStatus:R?"pending":"completed"}),Xe=he?r.jsx(he,{holder:t,onComplete:()=>v(!1)}):He&&Ze?r.jsx(Ze,{module:(fe=ze[pe])==null?void 0:fe.id,holder:t}):null,St=$e(_),Tt=Ke(_),jt=R?r.jsx(Ti,{color:w,children:i(St.summary,{context:_!=null&&_.deferred?"queued":void 0,data:Tt})}):null,It=p.useCallback(()=>{t.sortedPumps.length>0&&(f==="technician"?v(!0):R&&(e==null||e(t)))},[R,t,e,f]);return r.jsxs(r.Fragment,{children:[r.jsx(d.HolderDashboardCard,{avatar:H,headerBackgroundColor:P,backgroundColor:D,body:R?null:We,footer:jt,cardId:t.path,errors:x,title:wt,showNavIcon:n,onCardSelect:It},t.path),r.jsx(d.Modal,{contain:l!=="compact",...kt,show:g,onClose:()=>v(!1),children:r.jsxs(ki,{children:[r.jsx(d.Header,{contain:l==="compact",showCloseButton:!0,title:Ie,onClose:()=>v(!1),CloseButton:l==="compact"?d.BackButton:void 0}),Xe]})}),(_==null?void 0:_.future)&&r.jsx(K,{title:Ie,future:_==null?void 0:_.future})]})}),Ai=u.kosComponent(({holders:t,showNavIcons:e,...n})=>r.jsx(jn,{...n,children:t.map(s=>{const o=s.troubles[0];return r.jsx(oo,{holder:s,showNavIcon:e,onHolderSelect:()=>{o.resolvable&&o.resolve()}},s.id)})})),Ni=T(ke.MessageInformationIconWithBackground)`
232
+ `,ji=(t,e,n,s)=>{const o=s(`common:macros.${t.name}`),a=_i.includes(t.name),c=e?a?"":` ${s(`common:${t.ingredientName}`)}`:` ${s("common:macros.unassigned")}`,i=`${o}${c}`,l=n?a?o:c:`${o} ${c}`;return{titleText:i,cardTitleText:l}},Ii=u.kosComponent(({holder:t,dashboardKey:e,fallbackStatus:n})=>{const{getExtensions:s}=Te(),o=s(Le.id),a=l=>o.find(m=>{const h=m.data;return(h==null?void 0:h.dashboardKey)===l}),c=a(t.name)??a(e),i=se.useExtensionComponent(Le);return c&&i?r.jsx(i,{module:c.id,holder:t}):r.jsx(d.StatusIndicator,{size:"small",status:n})}),Ei=t=>!t||t==="white",Pi=t=>t?void 0:"white",oo=u.kosComponent(({holder:t,onHolderSelect:e,showNavIcon:n,summaryBody:s})=>{var qe,fe;const{model:o}=Me(),{visibleTroubles:a,initialized:c}=je(t),{t:i}=u.useKosTranslation(["troubles","common"]),{componentModeOverride:l}=d.useComponentConfigurationContext(),m=l==="compact",{getExtensions:h}=Te(),f=(qe=o==null?void 0:o.currentRole)==null?void 0:qe.toLowerCase(),[g,v]=p.useState(!1),y=!!t.ingredientId,x=(a==null?void 0:a.length)??0,_=a==null?void 0:a[0],R=a?a.length>0:!1,D=t.removed?"var(--ddk-component-dashboard-card-background-color-removed)":R?`${_==null?void 0:_.color}`:t.unassigned?"var(--ddk-component-dashboard-card-background-color-unassigned)":void 0,P=!m&&t.removed?"var(--ddk-component-dashboard-card-header-background-color-removed)":void 0,E=Ei(D),w=t.unassigned?"var(--ddk-generic-color-grey-30)":R?Pi(E):y?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",U=d.useAbbreviation(t.name,l==="compact"),{titleText:q,cardTitleText:B}=ji(t,y,m,i),H=l==="compact"&&r.jsx(Si,{color:w,children:U}),wt=r.jsx(ss,{color:w,children:B}),Ie=r.jsx(ss,{children:q}),pe=u.ExtensionManager.executeDashboardKeyFactory(t)||"",ze=h(le.id).filter(ie=>!!ie.data).reduce((ie,ge)=>{const Ye=ge.data;return ie[Ye.dashboardKey]=ge.data,ie},{}),He=!!ze[pe],{HolderContent:he,modalOptions:kt}=en(t),Ze=se.useExtensionComponent(le),We=s??r.jsx(Ii,{holder:t,dashboardKey:pe,fallbackStatus:R?"pending":"completed"}),Xe=he?r.jsx(he,{holder:t,onComplete:()=>v(!1)}):He&&Ze?r.jsx(Ze,{module:(fe=ze[pe])==null?void 0:fe.id,holder:t}):null,St=$e(_),Tt=Ke(_),jt=R?r.jsx(Ti,{color:w,children:i(St.summary,{context:_!=null&&_.deferred?"queued":void 0,data:Tt})}):null,It=p.useCallback(()=>{t.sortedPumps.length>0&&(f==="technician"?v(!0):R&&(e==null||e(t)))},[R,t,e,f]);return r.jsxs(r.Fragment,{children:[r.jsx(d.HolderDashboardCard,{avatar:H,headerBackgroundColor:P,backgroundColor:D,body:R?null:We,footer:jt,cardId:t.path,errors:x,title:wt,showNavIcon:n,onCardSelect:It},t.path),r.jsx(d.Modal,{contain:l!=="compact",...kt,show:g,onClose:()=>v(!1),children:r.jsxs(ki,{children:[r.jsx(d.Header,{contain:l==="compact",showCloseButton:!0,title:Ie,onClose:()=>v(!1),CloseButton:l==="compact"?d.BackButton:void 0}),Xe]})}),(_==null?void 0:_.future)&&r.jsx(K,{title:Ie,future:_==null?void 0:_.future})]})}),Ai=u.kosComponent(({holders:t,showNavIcons:e,...n})=>r.jsx(jn,{...n,children:t.map(s=>{const o=s.troubles[0];return r.jsx(oo,{holder:s,showNavIcon:e,onHolderSelect:()=>{o.resolvable&&o.resolve()}},s.id)})})),Ni=T(ke.MessageInformationIconWithBackground)`
233
233
  width: var(--ddk-component-macro-card-unavailable-icon-size);
234
234
  height: var(--ddk-component-macro-card-unavailable-icon-size);
235
235
  `,Di=T(d.UtilityModalHeading)`
@@ -379,7 +379,7 @@ ${e("agitator:agitate-after-without",{data:{value:t.volWithoutIceMl.displayValue
379
379
  text-align: center;
380
380
  `,dc=({onComplete:t})=>{const{t:e}=u.useKosTranslation("reboot"),[n,s]=p.useState(!1),{model:o}=bt(),{componentModeOverride:a}=d.useComponentConfigurationContext();return r.jsxs(d.Modal,{show:!n,onClose:()=>s(!0),onClosed:t,contain:a!=="compact",children:[a==="compact"&&r.jsx(d.Header,{title:e("reboot"),showCloseButton:!0,onClose:()=>s(!0),CloseButton:d.CompactCloseButton}),r.jsxs(ac,{children:[r.jsxs(ic,{children:[r.jsx(d.QuestionIconStyle,{}),r.jsx(cc,{children:r.jsx(d.UtilityModalHeading,{children:e("modal-heading","Are you sure you want to reboot dispenser?")})})]}),r.jsx(d.CancelProceedFooter,{cancelLabel:`${e("cancel","Cancel")}`,proceedLabel:`${e("reboot","Reboot")}`,onCancel:()=>s(!0),onProceed:()=>o==null?void 0:o.completeReboot()})]})]})},Ee=T(d.LabelInformation)`
381
381
  text-align: center;
382
- `,lc=u.kosComponent(({remoteTray:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"remote-nns"}),[s,o]=p.useState("idle"),[a,c]=p.useState({}),[i,l]=p.useState({}),h=t.holder.pumps.data.filter(D=>D.childPump),f=t.remoteTrayEnabled.value===!0,g=()=>h.every(D=>{const P=a[D.name];return P!=null&&P!==""}),v=p.useCallback((D,P)=>{c(E=>({...E,[D]:P}))},[]),y=p.useCallback(D=>(P="")=>{v(D,P)},[v]),x=p.useCallback(async()=>{t.remoteTrayEnabled.updateProperty(!f),o(f?"disableSuccess":"success")},[f,t.remoteTrayEnabled]),_=p.useCallback(async()=>{o("progress"),l({});let D=!1;await Promise.all(h.map(async P=>{try{const E=u.getKosCompanionModel(P,$.FreestylePump.type),[w]=await E.replacePump(a[P.name]);w&&(l(U=>({...U,[P.name]:w})),D=!0)}catch(E){console.error(E),l(w=>({...w,[P.name]:"unknownError"})),D=!0}})),D?o("pump"):x()},[f,a,h,t.remoteTrayEnabled,x]),R=p.useMemo(()=>({idle:{title:n(f?"disable-title":"idle-title"),information:r.jsx(Ee,{children:n(f?"disable-info":"idle-info")}),footer:r.jsx(d.Button,{onPointerDown:()=>{f?x():o("pump")},children:n(f?"disable":"enable")}),status:"information"},pump:{title:n("pump-title"),information:r.jsxs(r.Fragment,{children:[r.jsx(Ee,{children:n("pump-info")}),h.map(D=>r.jsx(d.ErrorInputCard,{layout:"hex",description:i[D.name]?n(`errors.${i[D.name]}`):"",value:a[D.name]??"",label:n(`pumps.${D.name}`),onChange:y(D.name)},D.name))]}),footer:r.jsxs(r.Fragment,{children:[r.jsx(d.Button,{disabled:!g(),onPointerDown:_,children:n("enter")}),r.jsx(d.Button,{onPointerDown:e,children:n("cancel")})]})},progress:{title:n("progress-title"),information:r.jsx(Ee,{children:n("progress-info")}),status:"loading"},success:{title:n("success-title"),information:r.jsx(Ee,{children:n("success-info")}),status:"success"},disableSuccess:{title:n("disable-success-title"),information:r.jsx(Ee,{children:n("disable-success-info")}),status:"success"}}),[v,f,e,a,i,h,_,n]);return r.jsx(d.WorkflowModal,{...R[s],onClose:()=>e()})}),uc=u.kosComponent(({cardModel:t})=>(u.KosLog.debug("RemoteTray",t.name),r.jsx(io,{holder:t.holder}))),mc=T.div`
382
+ `,lc=u.kosComponent(({remoteTray:t,onComplete:e})=>{const{t:n}=u.useKosTranslation("common",{keyPrefix:"remote-nns"}),[s,o]=p.useState("idle"),[a,c]=p.useState({}),[i,l]=p.useState({}),h=t.holder.pumps.data.filter(D=>D.childPump),f=t.remoteTrayEnabled.value===!0,g=p.useCallback(()=>h.every(D=>{const P=a[D.name];return P!=null&&P!==""}),[a,h]),v=p.useCallback((D,P)=>{c(E=>({...E,[D]:P}))},[]),y=p.useCallback(D=>(P="")=>{v(D,P)},[v]),x=p.useCallback(async()=>{t.remoteTrayEnabled.updateProperty(!f),o(f?"disableSuccess":"success")},[f,t.remoteTrayEnabled]),_=p.useCallback(async()=>{o("progress"),l({});let D=!1;await Promise.all(h.map(async P=>{try{const E=u.getKosCompanionModel(P,$.FreestylePump.type),[w]=await E.replacePump(a[P.name]);w&&(l(U=>({...U,[P.name]:w})),D=!0)}catch(E){console.error(E),l(w=>({...w,[P.name]:"unknownError"})),D=!0}})),D?o("pump"):x()},[a,h,x]),R=p.useMemo(()=>({idle:{title:n(f?"disable-title":"idle-title"),information:r.jsx(Ee,{children:n(f?"disable-info":"idle-info")}),footer:r.jsx(d.Button,{onPointerDown:()=>{f?x():o("pump")},children:n(f?"disable":"enable")}),status:"information"},pump:{title:n("pump-title"),information:r.jsxs(r.Fragment,{children:[r.jsx(Ee,{children:n("pump-info")}),h.map(D=>r.jsx(d.ErrorInputCard,{layout:"hex",description:i[D.name]?n(`errors.${i[D.name]}`):"",value:a[D.name]??"",label:n(`pumps.${D.name}`),onChange:y(D.name)},D.name))]}),footer:r.jsxs(r.Fragment,{children:[r.jsx(d.Button,{disabled:!g(),onPointerDown:_,children:n("enter")}),r.jsx(d.Button,{onPointerDown:e,children:n("cancel")})]})},progress:{title:n("progress-title"),information:r.jsx(Ee,{children:n("progress-info")}),status:"loading"},success:{title:n("success-title"),information:r.jsx(Ee,{children:n("success-info")}),status:"success"},disableSuccess:{title:n("disable-success-title"),information:r.jsx(Ee,{children:n("disable-success-info")}),status:"success"}}),[f,y,e,a,i,h,g,_,n,x]);return r.jsx(d.WorkflowModal,{...R[s],onClose:()=>e()})}),uc=u.kosComponent(({cardModel:t})=>(u.KosLog.debug("RemoteTray",t.name),r.jsx(io,{holder:t.holder}))),mc=T.div`
383
383
  font-size: var(--ddk-component-holder-card-footer-font-size);
384
384
  color: ${t=>t.color??"var(--ddk-generic-color-black)"};
385
385
  position: absolute;
package/index.js CHANGED
@@ -606,11 +606,7 @@ const Ei = S.div``, wd = D(() => {
606
606
  failure: {
607
607
  information: /* @__PURE__ */ f(N, { children: [
608
608
  /* @__PURE__ */ i(z, { children: n("calibration-failed") }),
609
- /* @__PURE__ */ f(Se, { children: [
610
- "Error Code: ",
611
- o,
612
- n(`error.${o || "unknownError"}`)
613
- ] })
609
+ /* @__PURE__ */ i(Se, { children: n(`error.${o}`) })
614
610
  ] }),
615
611
  footer: /* @__PURE__ */ i(w, { onPointerDown: e, children: n("exit-calibration") }),
616
612
  status: "error"
@@ -5241,7 +5237,7 @@ const Dr = S.div`
5241
5237
  h != null && h.isRemote && s === "disable" && (Us.warn("Holder is remote, skipping rendering"), y = !0);
5242
5238
  const [P, E] = T(!1), x = !!t.ingredientId, X = V(() => {
5243
5239
  E(!1);
5244
- }, []), oe = (c == null ? void 0 : c.length) ?? 0, U = c == null ? void 0 : c[0], te = oe > 0, Ht = Ut(U), Xe = t.hasFuelGuage, De = t.fillPercent, Wt = t.removed ? "var(--ddk-component-dashboard-card-background-color-removed)" : y ? "var(--ddk-component-dashboard-card-background-color-disabled)" : te ? `${U == null ? void 0 : U.color}` : t.unassigned ? "var(--ddk-component-dashboard-card-background-color-unassigned)" : void 0, lt = t.removed ? "var(--ddk-component-dashboard-card-header-background-color-removed)" : void 0, ut = ic(Wt), Ne = y ? "white" : t.unassigned ? "var(--ddk-generic-color-grey-30)" : te ? ac(ut) : x ? void 0 : "var(--ddk-component-dashboard-card-color-unassigned)", Xt = y ? "white" : te ? cc(ut, t) : x ? void 0 : "var(--ddk-component-dashboard-card-color-unassigned)", pt = R ? u(_, { defaultValue: "Remote NNS Tray" }) : Fr(t.name, m), mt = y ? u("disabled") : R ? "" : t.removed ? u(t.previousIngredientName) : t.unassigned ? u("unassigned") : u(t.ingredientName), ht = /* @__PURE__ */ i(Dr, { color: Ne, children: mt }), qt = /* @__PURE__ */ i(sc, { color: Ne, children: pt }), Yt = R ? u(_, { defaultValue: "Remote NNS Tray" }) : t.name, Gt = /* @__PURE__ */ f(Dr, { children: [
5240
+ }, []), oe = (c == null ? void 0 : c.length) ?? 0, U = c == null ? void 0 : c[0], te = oe > 0, Ht = Ut(U), Xe = t.hasFuelGuage, De = t.fillPercent, Wt = t.removed ? "var(--ddk-component-dashboard-card-background-color-removed)" : y ? "var(--ddk-component-dashboard-card-background-color-disabled)" : te ? `${U == null ? void 0 : U.color}` : t.unassigned ? "var(--ddk-component-dashboard-card-background-color-unassigned)" : void 0, lt = !m && t.removed ? "var(--ddk-component-dashboard-card-header-background-color-removed)" : void 0, ut = ic(Wt), Ne = y ? "white" : t.unassigned ? "var(--ddk-generic-color-grey-30)" : te ? ac(ut) : x ? void 0 : "var(--ddk-component-dashboard-card-color-unassigned)", Xt = y ? "white" : te ? cc(ut, t) : x ? void 0 : "var(--ddk-component-dashboard-card-color-unassigned)", pt = R ? u(_, { defaultValue: "Remote NNS Tray" }) : Fr(t.name, m), mt = y ? u("disabled") : R ? "" : t.removed ? u(t.previousIngredientName) : t.unassigned ? u("unassigned") : u(t.ingredientName), ht = /* @__PURE__ */ i(Dr, { color: Ne, children: mt }), qt = /* @__PURE__ */ i(sc, { color: Ne, children: pt }), Yt = R ? u(_, { defaultValue: "Remote NNS Tray" }) : t.name, Gt = /* @__PURE__ */ f(Dr, { children: [
5245
5241
  Yt,
5246
5242
  " ",
5247
5243
  mt
@@ -5433,7 +5429,7 @@ const pc = ["water", "carb", "ns", "nns"], mc = S.div`
5433
5429
  summaryBody: r
5434
5430
  }) => {
5435
5431
  var ft, Ae;
5436
- const { model: s } = At(), { visibleTroubles: o, initialized: c } = dt(t), { t: a } = I(["troubles", "common"]), { componentModeOverride: d } = J(), l = d === "compact", { getExtensions: u } = ct(), p = (ft = s == null ? void 0 : s.currentRole) == null ? void 0 : ft.toLowerCase(), [m, v] = T(!1), y = !!t.ingredientId, h = (o == null ? void 0 : o.length) ?? 0, _ = o == null ? void 0 : o[0], L = o ? o.length > 0 : !1, R = t.removed ? "var(--ddk-component-dashboard-card-background-color-removed)" : L ? `${_ == null ? void 0 : _.color}` : t.unassigned ? "var(--ddk-component-dashboard-card-background-color-unassigned)" : void 0, P = t.removed ? "var(--ddk-component-dashboard-card-header-background-color-removed)" : void 0, E = vc(R), x = t.unassigned ? "var(--ddk-generic-color-grey-30)" : L ? bc(E) : y ? void 0 : "var(--ddk-component-dashboard-card-color-unassigned)", X = Fr(
5432
+ const { model: s } = At(), { visibleTroubles: o, initialized: c } = dt(t), { t: a } = I(["troubles", "common"]), { componentModeOverride: d } = J(), l = d === "compact", { getExtensions: u } = ct(), p = (ft = s == null ? void 0 : s.currentRole) == null ? void 0 : ft.toLowerCase(), [m, v] = T(!1), y = !!t.ingredientId, h = (o == null ? void 0 : o.length) ?? 0, _ = o == null ? void 0 : o[0], L = o ? o.length > 0 : !1, R = t.removed ? "var(--ddk-component-dashboard-card-background-color-removed)" : L ? `${_ == null ? void 0 : _.color}` : t.unassigned ? "var(--ddk-component-dashboard-card-background-color-unassigned)" : void 0, P = !l && t.removed ? "var(--ddk-component-dashboard-card-header-background-color-removed)" : void 0, E = vc(R), x = t.unassigned ? "var(--ddk-generic-color-grey-30)" : L ? bc(E) : y ? void 0 : "var(--ddk-component-dashboard-card-color-unassigned)", X = Fr(
5437
5433
  t.name,
5438
5434
  d === "compact"
5439
5435
  ), { titleText: oe, cardTitleText: U } = gc(
@@ -6390,10 +6386,13 @@ const Nc = S.div`
6390
6386
  text-align: center;
6391
6387
  `, mu = D(
6392
6388
  ({ remoteTray: t, onComplete: e }) => {
6393
- const { t: n } = I("common", { keyPrefix: "remote-nns" }), [r, s] = T("idle"), [o, c] = T({}), [a, d] = T({}), u = t.holder.pumps.data.filter((R) => R.childPump), p = t.remoteTrayEnabled.value === !0, m = () => u.every((R) => {
6394
- const P = o[R.name];
6395
- return P != null && P !== "";
6396
- }), v = V((R, P) => {
6389
+ const { t: n } = I("common", { keyPrefix: "remote-nns" }), [r, s] = T("idle"), [o, c] = T({}), [a, d] = T({}), u = t.holder.pumps.data.filter((R) => R.childPump), p = t.remoteTrayEnabled.value === !0, m = V(
6390
+ () => u.every((R) => {
6391
+ const P = o[R.name];
6392
+ return P != null && P !== "";
6393
+ }),
6394
+ [o, u]
6395
+ ), v = V((R, P) => {
6397
6396
  c((E) => ({ ...E, [R]: P }));
6398
6397
  }, []), y = V(
6399
6398
  (R) => (P = "") => {
@@ -6420,13 +6419,7 @@ const Nc = S.div`
6420
6419
  }
6421
6420
  })
6422
6421
  ), R ? s("pump") : h();
6423
- }, [
6424
- p,
6425
- o,
6426
- u,
6427
- t.remoteTrayEnabled,
6428
- h
6429
- ]), L = F(() => ({
6422
+ }, [o, u, h]), L = F(() => ({
6430
6423
  idle: {
6431
6424
  title: n(p ? "disable-title" : "idle-title"),
6432
6425
  information: /* @__PURE__ */ i(qe, { children: n(p ? "disable-info" : "idle-info") }),
@@ -6478,14 +6471,16 @@ const Nc = S.div`
6478
6471
  status: "success"
6479
6472
  }
6480
6473
  }), [
6481
- v,
6482
6474
  p,
6475
+ y,
6483
6476
  e,
6484
6477
  o,
6485
6478
  a,
6486
6479
  u,
6480
+ m,
6487
6481
  _,
6488
- n
6482
+ n,
6483
+ h
6489
6484
  ]);
6490
6485
  return /* @__PURE__ */ i(Nt, { ...L[r], onClose: () => e() });
6491
6486
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosdev-code/kos-ddk-model-components",
3
- "version": "0.1.0-dev.5879",
3
+ "version": "0.1.0-dev.5881",
4
4
  "type": "module",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -11,15 +11,15 @@
11
11
  }
12
12
  },
13
13
  "dependencies": {
14
- "@kosdev-code/kos-ui-sdk": "0.1.0-dev.5879",
15
- "@kosdev-code/kos-dispense-sdk": "0.1.0-dev.5879",
16
- "@kosdev-code/kos-ddk-components": "0.1.0-dev.5879",
17
- "@kosdev-code/kos-ddk-models": "0.1.0-dev.5879",
18
- "@kosdev-code/kos-ddk-styles": "0.1.0-dev.5879"
14
+ "@kosdev-code/kos-ui-sdk": "0.1.0-dev.5881",
15
+ "@kosdev-code/kos-dispense-sdk": "0.1.0-dev.5881",
16
+ "@kosdev-code/kos-ddk-components": "0.1.0-dev.5881",
17
+ "@kosdev-code/kos-ddk-models": "0.1.0-dev.5881",
18
+ "@kosdev-code/kos-ddk-styles": "0.1.0-dev.5881"
19
19
  },
20
20
  "kos": {
21
21
  "build": {
22
- "gitHash": "99ec53de623832f5a64f47bf28a7de34133ef3ea"
22
+ "gitHash": "a164cedafaa2338d40f006ae34f91fb1906d84ec"
23
23
  }
24
24
  },
25
25
  "publishConfig": {