@kosdev-code/kos-ddk-model-components 2.0.2 → 2.0.4
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/components/holders/holder-card.d.ts.map +1 -1
- package/components/index.d.ts +3 -1
- package/components/index.d.ts.map +1 -1
- package/components/notification-card-view/notification-card-view.d.ts.map +1 -1
- package/components/pump-cards/index.d.ts +1 -0
- package/components/pump-cards/index.d.ts.map +1 -1
- package/components/pump-cards/super-pump/index.d.ts +2 -0
- package/components/pump-cards/super-pump/index.d.ts.map +1 -0
- package/components/pump-cards/super-pump/super-pump-card.d.ts +9 -0
- package/components/pump-cards/super-pump/super-pump-card.d.ts.map +1 -0
- package/components/remote-nns-modal/index.d.ts +2 -0
- package/components/remote-nns-modal/index.d.ts.map +1 -0
- package/components/remote-nns-modal/remote-nns-modal.d.ts +11 -0
- package/components/remote-nns-modal/remote-nns-modal.d.ts.map +1 -0
- package/components/remote-tray/detail/remote-tray.d.ts +9 -0
- package/components/remote-tray/detail/remote-tray.d.ts.map +1 -0
- package/components/remote-tray/index.d.ts +3 -0
- package/components/remote-tray/index.d.ts.map +1 -0
- package/components/remote-tray/summary/remote-tray.d.ts +9 -0
- package/components/remote-tray/summary/remote-tray.d.ts.map +1 -0
- package/components/software/software.d.ts.map +1 -1
- package/components/spm-field-calibration/spm-field-calibration-modal.d.ts.map +1 -1
- package/hooks/holder-experience/holder-experience.d.ts.map +1 -1
- package/hooks/troubles/index.d.ts +2 -0
- package/hooks/troubles/index.d.ts.map +1 -1
- package/hooks/troubles/use-trouble-data.d.ts +4 -0
- package/hooks/troubles/use-trouble-data.d.ts.map +1 -0
- package/hooks/troubles/use-trouble-decoration.d.ts +111 -0
- package/hooks/troubles/use-trouble-decoration.d.ts.map +1 -0
- package/index.cjs +80 -57
- package/index.js +1741 -1443
- package/package.json +7 -7
package/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Ln=Object.defineProperty;var En=(e,t,n)=>t in e?Ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var I=(e,t,n)=>(En(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@kosdev-code/kos-ui-sdk"),o=require("@emotion/react/jsx-runtime"),y=require("@emotion/styled"),a=require("@kosdev-code/kos-ddk-components"),u=require("react"),S=require("@kosdev-code/kos-ddk-models"),_=require("@kosdev-code/kos-ddk-styles"),Fe=require("@kosdev-code/kos-dispense-sdk"),J=require("@kosdev-code/kos-freestyle-sdk"),N=require("@kosdev-code/kos-ui-plugin"),L=require("@kosdev-code/kos-ui-plugin/utilities"),yt=require("react-router-dom");class E{constructor(t,n){I(this,"future");I(this,"intentContainer");I(this,"title");I(this,"intent");I(this,"namespace");I(this,"successMessage");I(this,"failureMessage");I(this,"actionLabel");this.intentContainer=t,this.title=n.title,this.namespace=n.namespace,this.intent=n.intent,this.successMessage=n.successMessage,this.failureMessage=n.failureMessage,this.actionLabel=n.actionLabel}get type(){return"intentContainer"}async performAction(){const t=await this.intentContainer.performIntent(this.intent);t!=null&&t.tracker&&(this.future=l.FutureManager.getFuture(t.tracker))}}class wt extends E{constructor(t){super(t,{title:"Calibrate",intent:"CALIBRATE",successMessage:"Calibrate Complete",failureMessage:"Calibrate Failed"})}enabled(){return!0}}class jt extends E{constructor(t){super(t,{title:"45ml Flow Test",intent:"FIXED_45",successMessage:"45ml Flow Test Complete",failureMessage:"45ml Flow Test Failed"})}enabled(){return!0}}class St extends E{constructor(t){super(t,{title:"Flush",intent:"FLUSH",successMessage:"Flush Complete",failureMessage:"Flush Failed"})}enabled(){return!0}}class kt extends E{constructor(t){super(t,{title:"High Flow Test",intent:"HIGH_FLOW_TEST",successMessage:"High Flow Test Complete",failureMessage:"High Flow Test Failed"})}enabled(){return!0}}class Pt extends E{constructor(t){super(t,{title:"Hold to Pour",intent:"HOLD_TO_POUR",successMessage:"Pour Complete",failureMessage:"Pour Failed"})}enabled(){return!0}}class Tt extends E{constructor(t){super(t,{title:"Low Flow Test",intent:"LOW_FLOW_TEST",successMessage:"Low Flow Test Complete",failureMessage:"Low Flow Test Failed"})}enabled(){return!0}}class It extends E{constructor(t){super(t,{title:"Manual Override",intent:"SOFT_START",successMessage:"Manual Override Complete",failureMessage:"Manual Override Failed"})}enabled(){return!0}}class Dt extends E{constructor(t){super(t,{title:"Reset",intent:"MSV_RESET",successMessage:"Reset Complete",failureMessage:"Reset Failed"})}enabled(){return!0}}class At extends E{constructor(t){super(t,{title:"Prime",intent:"PRIME",successMessage:"Prime Complete",failureMessage:"Prime Failed"})}enabled(){return!0}}class Ft extends E{constructor(t){super(t,{title:"Purge",intent:"PURGE",successMessage:"Purge Complete",failureMessage:"Purge Failed"})}enabled(){return!0}}class Lt{constructor(t,n){I(this,"future");I(this,"troubleAware");I(this,"title");I(this,"troubleKey");I(this,"namespace");I(this,"successMessage");I(this,"failureMessage");I(this,"actionLabel");this.troubleAware=t,this.troubleKey=n.trouble,this.namespace=n.namespace||"troubles",this.title=n.title||`${this.namespace}:troubles.${this.troubleKey}.progress`,this.successMessage=n.successMessage||`${this.namespace}:troubles.${this.troubleKey}.success`,this.failureMessage=n.failureMessage||`${this.namespace}:troubles.${this.troubleKey}.error`,this.actionLabel=n.action||`${this.namespace}:troubles.${this.troubleKey}.action`}get type(){return"troubleAware"}async performAction(){const t=this.troubleAware.troublesByType[this.troubleKey];if(!t)return;const s=await t[0].resolve();s!=null&&s.tracker&&(this.future=l.FutureManager.getFuture(s.tracker))}}class Et extends Lt{constructor(t,n){super(t,{trouble:n})}enabled(){return!0}}const Bn="PrimeTrouble",Mn="PurgeTrouble",Kn=y.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
overflow-y: auto;
|
|
5
5
|
overflow-x: hidden;
|
|
6
6
|
gap: 32px;
|
|
7
7
|
height: 100%;
|
|
8
|
-
`,
|
|
8
|
+
`,Bt=l.kosComponent(({holder:e,onComplete:t})=>{const[n,s]=u.useState(!1),{t:r}=l.useKosTranslation("common"),{componentModeOverride:c}=a.useComponentConfigurationContext(),d=e.data.agitated;return o.jsx(a.Modal,{contain:c!=="compact",onClosed:t,show:!n,children:o.jsxs(Kn,{children:[o.jsx(a.Header,{contain:c==="compact",showCloseButton:!0,title:r("shelf-agitator"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:c==="compact"?a.BackButton:void 0}),o.jsx(a.Content,{align:"top",children:o.jsx(a.InfoCard,{label:r("agitating"),padding:"x-large",value:r(d?"no":"yes")})}),o.jsx(a.Footer,{children:o.jsx(a.Button,{mode:"primary",disabled:d,onPointerDown:()=>console.log("agitate!"),children:r("test-shelf-agitator")})})]})})}),Le=()=>{const e=S.AgitationControl.type;return l.useKosModel({modelId:e,modelType:S.AgitationControl.type,options:{}})},K=e=>{var d,i;const[t,n]=u.useState(e==null?void 0:e.futureHandler.future),[s,r]=u.useState((i=(d=e==null?void 0:e.futureHandler)==null?void 0:d.future)==null?void 0:i.endState);u.useEffect(()=>{const p=l.kosAutoEffect(()=>{const m=e==null?void 0:e.futureHandler.future;n(m),r(m==null?void 0:m.endState)});return()=>{p(),e==null||e.futureHandler.removeFuture()}},[e==null?void 0:e.futureHandler]);const c=u.useCallback(()=>{e==null||e.futureHandler.removeFuture()},[e==null?void 0:e.futureHandler]);return{future:t,clearFuture:c,success:s===l.FutureEndState.Success,failure:s&&s!==l.FutureEndState.Success}},Rn=l.KosLog.createLogger({name:"future-progress-bar"}),Mt=y(a.CloseButton)`
|
|
9
9
|
--ddk-component-icon-button-icon-color-active: var(
|
|
10
10
|
--ddk-component-progress-bar-close-button-color-active
|
|
11
11
|
);
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
--ddk-component-icon-button-icon-color-hover: var(
|
|
19
19
|
--ddk-component-progress-bar-close-button-color-hover
|
|
20
20
|
);
|
|
21
|
-
`,
|
|
21
|
+
`,Nn=y.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
flex-direction: column;
|
|
24
24
|
width: 100%;
|
|
25
25
|
gap: 8px;
|
|
26
|
-
`,
|
|
26
|
+
`,Kt=y.div`
|
|
27
27
|
align-items: var(--ddk-component-progress-bar-message-align-items);
|
|
28
28
|
color: var(--ddk-component-progress-bar-message-color);
|
|
29
29
|
display: flex;
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
gap: var(--ddk-component-progress-bar-message-gap);
|
|
32
32
|
justify-content: space-between;
|
|
33
33
|
width: 100%;
|
|
34
|
-
`,
|
|
34
|
+
`,Rt=y.div`
|
|
35
35
|
display: flex;
|
|
36
36
|
gap: var(--ddk-component-status-bar-gap);
|
|
37
37
|
align-items: center;
|
|
38
|
-
|
|
38
|
+
`,$n=y.div`
|
|
39
39
|
border-top: solid 1px #888888;
|
|
40
40
|
padding-top: 8px;
|
|
41
41
|
width: calc(100% - 10px);
|
|
42
|
-
`,
|
|
42
|
+
`,ee=({children:e,onPointerDown:t,title:n,subtitle:s})=>{const{componentModeOverride:r}=a.useComponentConfigurationContext(),{t:c}=l.useKosTranslation("common"),d=n??e;return o.jsxs(Kt,{children:[o.jsxs(Nn,{children:[o.jsxs(Rt,{style:{fontSize:"var(--ddk-component-progress-bar-message-font-size)"},children:[o.jsx(_.MessageErrorIcon,{style:{color:"var(--ddk-component-progress-bar-icon-color-failure)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),d]}),s&&o.jsx($n,{children:s})]}),r==="compact"?o.jsx(a.Button,{mode:"primary",onPointerDown:t,children:c("close","Close")}):o.jsx(Mt,{label:!1,size:"large",onPointerDown:t})]})},fe=({children:e,onPointerDown:t})=>{const{componentModeOverride:n}=a.useComponentConfigurationContext(),{t:s}=l.useKosTranslation("common");return o.jsxs(Kt,{children:[o.jsxs(Rt,{children:[o.jsx(_.SuccessIcon,{style:{color:"var(--ddk-semantic-color-system-green)",fontSize:"var(--ddk-component-progress-bar-icon-size)"}}),e]}),n==="compact"?o.jsx(a.Button,{mode:"primary",onPointerDown:t,children:s("close","Close")}):o.jsx(Mt,{label:!1,size:"large",onPointerDown:t})]})},gt=e=>(e==null?void 0:e.title)&&(e==null?void 0:e.subtitle),D=l.kosComponent(({title:e,future:t,failureMessage:n,successMessage:s,cancelMessage:r,isCancelable:c=!0,onSuccess:d,onClose:i})=>{const{t:p}=l.useKosTranslation("common"),[m,x]=u.useState(!0),[g,h]=u.useState(),f=`${t==null?void 0:t.timeRemaining} ${p("remaining","remaining")}`,C=u.useCallback(()=>{g!=="in-progress"&&(i==null||i(),x(!1))},[i,g]),b=u.useCallback(()=>{C(),d==null||d()},[C,d]);u.useEffect(()=>{(t==null?void 0:t.status)==="IN_PROGRESS"||(t==null?void 0:t.status)==="NOT_ACTIVE"?(h("in-progress"),x(!0)):(t==null?void 0:t.status)==="SUCCESS"?(h("success"),x(!!s),s||(C(),d==null||d())):(t==null?void 0:t.status)==="FAIL"||(t==null?void 0:t.status)==="ABORT"?(h("failure"),x(!!n)):(t==null?void 0:t.status)==="CANCEL"?(h("cancelled"),x(!!r)):t&&Rn.error("unknown status",t==null?void 0:t.status)},[n,t,t==null?void 0:t.status,s,r,C,d]);const j=gt(n)?n.subtitle:void 0,P=gt(n)?n.title:n??p("something-went-wrong","Something went wrong");return t&&o.jsx(a.ProgressBar,{isCancelable:c,onCancel:()=>{t.cancelFuture()},blocked:g==="in-progress",onClose:C,renderFailure:n&&o.jsx(ee,{subtitle:j,onPointerDown:C,children:P}),renderCancel:r&&o.jsx(ee,{onPointerDown:C,children:r}),renderSuccess:s&&o.jsx(fe,{onPointerDown:b,children:s}),show:m,status:g,subtitle:f,title:e,value:t.progress})}),On=l.KosLog.createLogger({name:"agitation-control-view"});On.debug("agitation-control-view component loaded");const Vn=y.div``,Hn=l.kosComponent(()=>{const{model:e}=Le(),{t,i18n:n}=l.useKosTranslation("troubles"),{future:s,failure:r}=K(e),c=u.useCallback(()=>{e&&e.clearAll()},[e]),d=s==null?void 0:s.reason,i=d?`__troubles.errors.${d}__`:void 0,p="troubles.agitation.error",m=n.exists(`troubles.errors.${d}`);return o.jsx(Vn,{children:o.jsx(D,{title:t("troubles.agitation.title"),future:s,isCancelable:!0,onClose:c,failureMessage:t(p,{context:i&&m?"reason":void 0,data:{reason:i}})})})}),Nt=l.kosComponent(({pump:e,onComplete:t})=>{const{t:n}=l.useKosTranslation("common",{keyPrefix:"fcm-calibration"}),[s,r]=u.useState("high-flow-test-idle"),[c,d]=u.useState(),[i,p]=u.useState(),[m,x]=u.useState(),{future:g}=K(e);u.useEffect(()=>{switch(g==null?void 0:g.endState){case"CANCEL":switch(s){case"high-flow-test-in-progress":r("high-flow-test-idle");break;default:d("calibration-canceled"),r("failure")}break;case"SUCCESS":switch(s){case"high-flow-test-in-progress":r("high-flow-test-success");break;case"calibration-in-progress":r("calibration-input");break;case"verification-in-progress":r("verification-input");break}break;case"FAIL":d(g==null?void 0:g.reason),r("failure");break}},[g==null?void 0:g.endState,g==null?void 0:g.reason,s]);const h=u.useMemo(()=>({"high-flow-test-idle":{information:o.jsx(a.LabelInformation,{children:n("high-flow-test-idle-information")}),footer:o.jsx(a.Button,{onPointerDown:()=>{e.performPreCalibrate(),r("high-flow-test-in-progress")},children:n("initiate-high-flow-test")}),status:"information"},"high-flow-test-in-progress":{information:o.jsx(a.LabelInformation,{children:n("high-flow-test-in-progress-information")}),footer:o.jsx(a.Button,{disabled:!0,children:n("initiate-high-flow-test")}),status:"loading"},"high-flow-test-success":{information:o.jsx(a.LabelInformation,{children:n("high-flow-test-success-information")}),footer:o.jsx(a.Button,{onPointerDown:()=>r("calibration-idle"),children:n("proceed")}),status:"success"},"calibration-idle":{information:o.jsx(a.BodyMediumInformation,{children:n("calibration-idle-information")}),footer:o.jsx(a.Button,{onPointerDown:()=>{e.performCalibrate(),r("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:o.jsx(a.LabelInformation,{children:n("calibration-in-progress-information")}),status:"loading"},"calibration-input":{information:o.jsxs(o.Fragment,{children:[o.jsx(a.BodyMediumInformation,{children:n("calibration-input-information")}),o.jsx(a.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:f=>{f!==void 0&&p(f)},value:i!==void 0?i:""})]}),footer:o.jsx(a.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&r("verification-idle")},children:n("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:o.jsx(a.BodyMediumInformation,{children:n("verification-idle-information")}),footer:o.jsx(a.Button,{onPointerDown:async()=>{i!==void 0&&(e.performVerify(i),r("verification-in-progress"))},children:n("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:o.jsx(a.LabelInformation,{children:n("verification-in-progress-information")}),status:"loading"},"verification-input":{information:o.jsxs(o.Fragment,{children:[o.jsx(a.BodyMediumInformation,{children:n("verification-input-information")}),o.jsx(a.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:f=>{f!==void 0&&x(f)},value:m!==void 0?m:""})]}),footer:o.jsx(a.Button,{disabled:m===void 0,onPointerDown:async()=>{if(i===void 0||m===void 0)return;const f=await e.performComplete(i,m);f==="success"?r("verification-success"):(d(f),r(f==="errBadPump"?"verification-failure":"failure"))},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:o.jsx(a.LabelInformation,{children:n("verification-success-information")}),footer:o.jsx(a.Button,{onPointerDown:t,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:o.jsx(a.LabelInformation,{children:n(`error.${c}`)}),footer:o.jsx(a.Button,{onPointerDown:t,children:n("exit-calibration")}),status:"error"},failure:{information:o.jsxs(o.Fragment,{children:[o.jsx(a.LabelInformation,{children:n("calibration-failed")}),o.jsx(a.BodyMediumInformation,{children:n(`error.${c||"unknownError"}`)})]}),footer:o.jsx(a.Button,{onPointerDown:t,children:n("exit-calibration")}),status:"error"}}),[c,t,e,n,i,m]);return o.jsxs(o.Fragment,{children:[o.jsx(a.WorkflowModal,{title:n(e.name),...h[s],onClose:()=>t()}),g&&o.jsx(D,{title:n("initiating"),future:g})]})}),_n=l.kosComponent(({cardModel:e})=>{l.KosLog.debug("Agitator",e.path);const{t}=l.useKosTranslation(["agitator","common"]),{future:n}=K(e),s=u.useCallback(r=>{r==="agitate"&&(e==null||e.testAgitate())},[e]);return o.jsxs(o.Fragment,{children:[o.jsx(a.Content,{children:o.jsx(a.InfoCard,{label:"Agitating",value:e.isAgitating?t("common:yes"):t("common:no")})}),o.jsx(a.Footer,{children:o.jsx(a.Button,{onPointerDown:()=>s("agitate"),children:t("action.label",{context:"agitator"})})}),n&&o.jsx(D,{title:t("testing"),future:n})]})}),Un=y.div`
|
|
43
43
|
font-size: var(--ddk-component-holder-card-footer-font-size);
|
|
44
44
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
45
|
-
`,
|
|
45
|
+
`,zn=l.kosComponent(e=>{l.KosLog.debug(`summary component loaded for holder ${e}`),l.KosLog.info(`render agitator summary for holder ${e.cardModel.path}`);const{t}=l.useKosTranslation("common");return o.jsxs(o.Fragment,{children:[o.jsx(a.StatusIndicator,{size:"small",status:"completed"}),e.cardModel.isAgitating&&o.jsx(Un,{children:t("agitating")})]})}),Wn={getStagedChange:void 0,updateStagedChange:void 0,saveChanges:void 0,clearStagedChanges:void 0},$t=u.createContext(Wn),Ot=({children:e})=>{const[t,n]=u.useState({}),s=i=>t[i],r=(i,p)=>{n(m=>({...m,[i]:p}))},c=()=>n({}),d=async()=>{for(const i in t)t[i].configProperty.updateProperty(t[i].value);c()};return o.jsx($t.Provider,{value:{getStagedChange:s,updateStagedChange:r,saveChanges:d,clearStagedChanges:c},children:e})},Ee=()=>u.useContext($t),Gn=e=>t=>o.jsx(Ot,{children:o.jsx(e,{...t})}),Vt=({label:e,configProperty:t})=>{const{value:n}=l.useConfigProperty({configProperty:t});return o.jsx(a.InfoCard,{label:e,value:n})},be=({configProperty:e,hideUnits:t,isValid:n,...s})=>{var x,g;const{t:r}=l.useKosTranslation("common",{keyPrefix:"validation"}),{significantValue:c}=l.useConfigProperty({configProperty:e}),d=h=>{h||(h=""),e.updateProperty(h)},i=(x=e.displayOptions)==null?void 0:x.max,p=(g=e.displayOptions)==null?void 0:g.min,m=u.useCallback(h=>{const f=n==null?void 0:n(h);return f||(Number(h)<p?r("minValue",{data:{minValue:p}}):Number(h)>i?r("maxValue",{data:{maxValue:i}}):void 0)},[n,i,p,r]);return o.jsx(a.InputCard,{...s,isValid:m,onChange:d,unitValue:t?void 0:e.unit,value:c})},H=({configProperty:e,label:t,onChange:n,...s})=>{var d,i;const{t:r}=l.useKosTranslation(["config-properties","common"]),c=l.useConfigProperty({configProperty:e});return o.jsx(a.InputRangeCard,{...s,label:t??r(e.id),layout:"num",maxValue:(d=c.displayOptions)==null?void 0:d.max,minValue:(i=c.displayOptions)==null?void 0:i.min,onChange:p=>e.updateProperty(p),unitValue:c.unit,value:c.significantValue})},te=({configProperty:e,overrideChecked:t,...n})=>{var p;const{getStagedChange:s,updateStagedChange:r}=Ee(),{value:c}=l.useConfigProperty({configProperty:e}),d=((p=s==null?void 0:s(e.id))==null?void 0:p.value)??c,i=m=>{r?r(e.id,{configProperty:e,value:m}):e.updateProperty(m)};return o.jsx(a.ToggleCard,{toggleLabel:d==="true"?"Enabled":"Disabled",...n,onChange:i,checked:t!==void 0?t:d==="true"})},qn=e=>(e==null?void 0:e.map(t=>({id:t.value,label:t.label})))||[],Ce=({collapse:e,cancelButtonLabel:t,configProperty:n,displayMode:s="raw",displayValue:r,float:c,items:d,label:i,onChange:p,onSave:m,proceedButtonLabel:x,selectedItemId:g,unitValue:h,...f})=>{const{t:C}=l.useKosTranslation(["config-properties","common"]),b=l.useConfigProperty({configProperty:n,optionsTransformer:qn});return o.jsx(a.PickerCard,{...f,cancelButtonLabel:t??(C("discard-changes",{defaultValue:"Discard Changes",ns:"common"})||void 0),collapse:e,displayValue:r??s==="raw"?b.value:b.displayValue,float:c,items:d??b.mappedOptions,label:i??C(n.id),onSave:j=>m?m(j):n.updateProperty(j),proceedButtonLabel:x??(C("save",{defaultValue:"Save",ns:"common"})||void 0),selectedItemId:g??b.value,unitValue:h??b.unit})},Xn=y(be)`
|
|
46
46
|
border-top: var(--ddk-component-input-enable-card-input-container-border);
|
|
47
47
|
border-radius: 0;
|
|
48
48
|
cursor: pointer;
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
--ddk-component-input-enable-card-input-font-weight
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
|
-
`,
|
|
81
|
+
`,Yn=y(Ce)`
|
|
82
82
|
border-top: var(--ddk-component-input-enable-card-input-container-border);
|
|
83
83
|
border-radius: 0;
|
|
84
84
|
cursor: pointer;
|
|
@@ -115,14 +115,14 @@
|
|
|
115
115
|
--ddk-component-input-enable-card-input-font-weight
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
|
-
`,
|
|
118
|
+
`,Zn=(e,t,n,s,r)=>{let c;const d=r==="compact"?Xn:be,i=r==="compact"?Yn:Ce,p=s.label??n(e.id);switch(e.schemaType){case"boolean":c=o.jsx(te,{configProperty:e,...s,label:p});break;case"double":c=o.jsx(H,{configProperty:e,...s,label:p});break;case"int":c=o.jsx(H,{configProperty:e,...s,label:p});break;case"String":c=o.jsx(d,{configProperty:e,...s,label:p});break;case"enum":c=o.jsx(i,{configProperty:e,...s,label:p});break}return c},Qn=e=>(e==null?void 0:e.map(t=>({id:t.value,label:t.label})))||[],Ht=({configProperty:e,factory:t,mappedOptions:n,t:s,...r})=>{const{t:c}=l.useKosTranslation(["config-properties","common"]),{componentModeOverride:d}=a.useComponentConfigurationContext(),i=l.useConfigProperty({configProperty:e,optionsTransformer:Qn});return t=t??Zn,t(e,{...i,mappedOptions:n??i.mappedOptions},s??c,r,d)},Jn=y(a.Card)`
|
|
119
119
|
align-items: ${e=>e.mode==="compact"?"flex-start":void 0};
|
|
120
120
|
flex-direction: var(
|
|
121
121
|
--ddk-component-input-enable-card-container-flex-direction
|
|
122
122
|
);
|
|
123
123
|
padding: var(--ddk-component-input-enable-card-container-padding);
|
|
124
124
|
gap: var(--ddk-component-input-enable-card-container-gap);
|
|
125
|
-
`,
|
|
125
|
+
`,eo=y.div`
|
|
126
126
|
box-sizing: border-box;
|
|
127
127
|
display: flex;
|
|
128
128
|
flex-direction: var(
|
|
@@ -130,27 +130,27 @@
|
|
|
130
130
|
);
|
|
131
131
|
gap: var(--ddk-component-input-enable-card-input-container-gap);
|
|
132
132
|
width: 100%;
|
|
133
|
-
`,
|
|
133
|
+
`,to=y(Ht)`
|
|
134
134
|
width: 100%;
|
|
135
|
-
`,
|
|
135
|
+
`,no=y.div`
|
|
136
136
|
box-sizing: border-box;
|
|
137
137
|
padding: ${e=>e.compact?"var(--ddk-component-input-enable-card-toggle-container-padding)":"0"};
|
|
138
138
|
width: var(--ddk-component-input-enable-card-toggle-container-width);
|
|
139
|
-
`,Rt=({configProperties:e,disabled:t,enabledConfigProperty:o})=>{const{value:s}=l.useConfigProperty({configProperty:o}),r=s==="true",{componentModeOverride:c}=a.useComponentConfigurationContext(),d=e.length===1,i=d?qo:Nt;return n.jsxs(Wo,{disabled:!r||t,mode:c,children:[n.jsx(Go,{children:e.map(p=>n.jsx(i,{disabled:!r||t,label:p.options?p.options.label:void 0,configProperty:p.configProperty,collapse:!d&&c==="standard",layout:p.options?p.options.layout:void 0,float:!0,hideUnits:p.options?p.options.hideUnits:void 0},p.configProperty.id))}),n.jsx(Xo,{compact:!d||c==="compact",children:n.jsx(X,{alwaysShowLabel:!0,collapse:!0,configProperty:o,disabled:t,stretch:c==="compact"})})]})},Yo=({configProperty:e,disabled:t,enabledConfigProperty:o,options:s})=>{const r=u.useMemo(()=>[{configProperty:e,options:s}],[e,s]);return n.jsx(Rt,{configProperties:r,disabled:t,enabledConfigProperty:o})},Ot=({configProperty:e,...t})=>{const{value:o}=l.useConfigProperty({configProperty:e}),s=r=>{r!==void 0&&(e==null||e.updateProperty(String(r)))};return n.jsx(a.SwitchCard,{...t,onChange:s,value:o})},$t=({description:e,float:t,label:o,modalTitle:s,onSave:r,time:c,...d})=>{const{regionModel:i}=l.useKosRegions(),{t:p}=l.useKosTranslation("common",{keyPrefix:"schedule"}),{amPmOptions:m,formattedTime:x,hourOptions:g,minuteOptions:f,setTime:h,time:w}=l.useRegionTimeProps({initialDate:c}),S=w.getHours(),y=u.useMemo(()=>[{id:"hr",items:g,selectedItemId:S<12?S:S-12,loop:!0},{id:"min",items:f,selectedItemId:w.getMinutes(),loop:!0},{id:"ampm",items:m,selectedItemId:S<12?"AM":"PM"}],[m,g,f,w,S]),k=u.useMemo(()=>[{id:"hr",items:g,selectedItemId:S,loop:!0},{id:"min",items:f,selectedItemId:w.getMinutes(),loop:!0}],[g,f,w,S]);return n.jsx(a.MultiPickerCard,{...d,cancelButtonLabel:p("discard-changes","Discard Changes")||void 0,closeButtonLabel:p("close","Close")||void 0,data:i!=null&&i.is12HourTimeFormat?y:k,description:e,displayValue:x,float:t,icon:H.TimeIcon,label:o,modalTitle:s,proceedButtonLabel:p("save","Save")||void 0,onSave:P=>{const T=i!=null&&i.is12HourTimeFormat?P.ampm==="AM"?P.hr:P.hr+12:P.hr,C=P.min,b=new Date(w);b.setHours(T),b.setMinutes(C),h(b),r==null||r({hours:T,minutes:C})}})},Vt=({configProperty:e,...t})=>{var x;const{getStagedChange:o,updateStagedChange:s}=De(),{value:r}=l.useConfigProperty({configProperty:e}),c=((x=o==null?void 0:o(e.id))==null?void 0:x.value)??r,{hours:d,minutes:i}=j.toTimeComponents(Number(c)),p=new Date;p.setHours(d),p.setMinutes(i);const m=g=>{const f=j.toSeconds(g.hours,g.minutes);s?s(e.id,{configProperty:e,value:f}):e.updateProperty(f)};return n.jsx($t,{...t,onSave:m,time:p})},Zo=[0,6],Ht=({day:e=new Date().getDate(),month:t=new Date().getMonth(),onSave:o,year:s=new Date().getFullYear(),...r})=>{var h,w,S,y,k,P;const{t:c}=l.useKosTranslation("region"),{regionModel:d}=l.useKosRegions(),i=l.useDateProps({date:{year:s,month:t,day:e},formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(d==null?void 0:d.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:Zo,yearsRange:[s-10,s+10]}}),p=u.useMemo(()=>{var T,C;return(C=(T=i==null?void 0:i.dateState)==null?void 0:T.yearsOptionsArray)==null?void 0:C.map(b=>({id:b.value,label:b.label}))},[(h=i==null?void 0:i.dateState)==null?void 0:h.yearsOptionsArray]),m=u.useMemo(()=>{var T,C;return(C=(T=i==null?void 0:i.dateState)==null?void 0:T.daysOptionsArray)==null?void 0:C.map(b=>({id:b.value,label:b.label}))},[(w=i==null?void 0:i.dateState)==null?void 0:w.daysOptionsArray]),x=u.useMemo(()=>{var T,C;return(C=(T=i==null?void 0:i.dateState)==null?void 0:T.monthsOptionsArray)==null?void 0:C.map(b=>({id:b.value,label:String(b.label)}))},[(S=i==null?void 0:i.dateState)==null?void 0:S.monthsOptionsArray]),g=u.useMemo(()=>{const T=[];return d==null||d.selectedDateOrder.split("").forEach(C=>{var b,D,E;C==="y"?T.push({id:"year",items:p,selectedItemId:(b=i==null?void 0:i.dateState)==null?void 0:b.year,loop:!1}):C==="m"?T.push({id:"month",items:x,selectedItemId:(D=i==null?void 0:i.dateState)==null?void 0:D.month}):C==="d"&&T.push({id:"day",items:m,selectedItemId:(E=i==null?void 0:i.dateState)==null?void 0:E.day,loop:!1})}),T},[(y=i==null?void 0:i.dateState)==null?void 0:y.day,(k=i==null?void 0:i.dateState)==null?void 0:k.month,(P=i==null?void 0:i.dateState)==null?void 0:P.year,m,x,d==null?void 0:d.selectedDateOrder,p]),f=u.useCallback(async T=>{const b=new Date(T.year,T.month+1,0).getDate(),D=T.day>b?1:T.day;o({day:D,month:T.month,year:T.year})},[o]);return n.jsx(a.MultiPickerCard,{cancelButtonLabel:c("discard-changes","Discard Changes")||void 0,closeButtonLabel:c("close","Close")||void 0,data:g,displayValue:i.dateState.formattedDate,icon:H.CalendarIcon,label:c("todays-date","Today's Date"),onSave:f,proceedButtonLabel:c("save","Save")||void 0,...r})},_t=l.kosComponent(({pump:e,onComplete:t})=>{const{t:o}=l.useKosTranslation("common",{keyPrefix:"fcm-diagnostics"}),[s,r]=u.useState("idle"),[c,d]=u.useState(),i=u.useCallback(async()=>{r("test"),d(void 0);const m=await e.performElectricalTest();m.error?(d(m.error),r("failure")):m.result==="errEEPROM"?(d("errEEPROM"),r("failure")):r("success")},[e]),p=u.useMemo(()=>({idle:{information:n.jsx(a.LabelInformation,{children:o("perform-electrical-test")}),footer:n.jsx(a.Button,{onPointerDown:i,children:o("electrical-test")})},test:{information:n.jsx(a.LabelInformation,{children:o("testing")}),footer:n.jsx(a.Button,{disabled:!0,children:o("electrical-test")}),status:"loading"},success:{information:n.jsx(a.LabelInformation,{children:o("electrical-test-success-header")}),footer:n.jsx(a.Button,{onPointerDown:i,children:o("electrical-test")}),status:"success"},failure:{information:n.jsxs(n.Fragment,{children:[n.jsx(a.LabelInformation,{children:o("electrical-test-failure-header")}),n.jsx(a.BodyMediumInformation,{children:o(`error.${c}`)})]}),footer:n.jsx(a.Button,{onPointerDown:i,children:o("electrical-test")}),status:"information"}}),[c,o,i]);return n.jsx(a.WorkflowModal,{title:o(e.name),...p[s],onClose:()=>t()})}),Pe={title:"",summary:"",successMessage:"",failureMessage:"",actionLabel:""},Qo=e=>{const[t,o]=u.useState(null),[s,r]=u.useState(Pe),c=e.map(d=>{const[i,,p]=d;return[i==null?void 0:i.future,i,p]}).flat();return u.useEffect(()=>{const d=e.find(i=>{const[p]=i;return!!(p!=null&&p.future)});d?(o(d[0]),r(d[2])):(o(null),r(Pe))},[...c,e]),[t,s]},Jo=e=>{switch(e){case"calibrate":return ft;case"fixed-45":return bt;case"flush":return Ct;case"high-flow-test":return vt;case"hold-to-pour":return yt;case"low-flow-test":return wt;case"manual-override":return jt;case"msv-reset":return St;case"prime":return kt;case"purge":return Tt;default:return}},en=e=>(t,o="intents")=>({title:e(`${o}:troubles.${t}.progress`),summary:e(`${o}:troubles.${t}.summary`),successMessage:e(`${o}:troubles.${t}.success`),failureMessage:e(`${o}:troubles.${t}.error`),actionLabel:e(`${o}:troubles.${t}.action`)}),Y=(e,t=Jo)=>{const{t:o}=l.useKosTranslation("troubles"),[s,r]=u.useState(null),[c,d]=u.useState(Pe),i=u.useCallback(async p=>{const m=t(p);if(m){const x=en(o)(p);d(x);const g=new m(e);await g.performAction(),r(g)}},[t,e,o]);return[s,i,c]},tn=e=>(l.KosLog.debug(`pumpActionFactory: actionId=${e}`),It),on=e=>(t,o="troubles")=>({title:e(`${o}:troubles.${t}.progress`),summary:e(`${o}:troubles.${t}.summary`),successMessage:e(`${o}:troubles.${t}.success`),failureMessage:e(`${o}:troubles.${t}.error`),actionLabel:e(`${o}:troubles.${t}.action`)}),nn=(e,t,o=tn)=>{const{t:s}=l.useKosTranslation("troubles"),[r,c]=u.useState(null),[d]=u.useState(on(s)(t)),i=u.useCallback(async()=>{const p=o(t);if(p){const m=new p(e,t);await m.performAction(),c(m)}},[o,e,t]);return[r,i,d]};function sn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Ae();return n.jsx(r,{...s,children:n.jsx(e,{...t,agitationControl:o})})}}const Ee=()=>{const e=j.Animation.type;return l.useKosModel({modelId:e,modelType:j.Animation.type,options:{}})};function Ut(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Ee();return n.jsx(r,{...s,children:n.jsx(e,{...t,animation:o})})}}const Z=()=>{const e=j.Application.type;return l.useKosModel({modelId:e,modelType:j.Application.type,options:{}})};function rn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Z();return n.jsx(r,{...s,children:n.jsx(e,{...t,application:o})})}}const zt=()=>{const e=j.CarbWater.type;return l.useKosModel({modelId:e,modelType:j.CarbWater.type,options:{}})};function an(e){return t=>{const{model:o,status:s,KosModelLoader:r}=zt();return n.jsx(r,{...s,children:n.jsx(e,{...t,carbWater:o})})}}const Wt=()=>{const e=j.CopyLogs.type;return l.useKosModel({modelId:e,modelType:j.CopyLogs.type,options:{},activate:!0,destroyOnUnmount:!0})};function cn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Wt();return n.jsx(r,{...s,children:n.jsx(e,{...t,copyLogs:o})})}}const Le=()=>{const e=j.DashboardOperations.type;return l.useKosModel({modelId:e,modelType:j.DashboardOperations.type,options:{}})};function ln(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Le();return n.jsx(r,{...s,children:n.jsx(e,{...t,dashboardOperations:o})})}}const Fe=()=>{const e=j.DispenserInfo.type;return l.useKosModel({modelId:e,modelType:j.DispenserInfo.type,options:{}})};function Gt(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Fe();return n.jsx(r,{...s,children:n.jsx(e,{...t,dispenserInfo:o})})}}const qt=e=>{const t=e;return l.useKosModel({modelId:t,modelType:j.Door.type,options:{}})};function dn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=qt(t.id);return n.jsx(r,{...s,children:n.jsx(e,{...t,door:o})})}}const dt={[L.EXTENSION_POINT_SETUP]:"setupDescriptor",[L.EXTENSION_POINT_CUI]:"cuiDescriptor",[L.EXTENSION_POINT_UTIL]:"utilDescriptor"},Xt=({defaultNamespace:e,extensionPoint:t})=>{const{getExtensions:o}=N.useKosPluginsContext(),s=o(t),r=s.map(p=>p.data.namespace)||[],{t:c}=l.useKosTranslation([e,...new Set(r)]),d=s.reduce((p,m)=>{const x=m;return p[x.data[dt[t]]]={extension:t,module:x.id,namespace:x.data.namespace,title:x.data.title},p},{}),i=s.reduce((p,m)=>{const x=m;return p[x.data[dt[t]]]=`${x.data.namespace}:${x.data.title}`,p},{});return{namespaces:r,t:c,labelMap:i,contributionMap:d}},fe=(e,t)=>{const o=u.useMemo(()=>({agitate:At,calibrate:({holder:d,pump:i,onComplete:p})=>{const m=l.getKosCompanionModel(i??d.pumps.data[0],j.FcmPump.type);return n.jsx(Ft,{pump:m,onComplete:p})},calibrateSPM:({holder:d,pump:i,onComplete:p})=>{const m=l.getKosCompanionModel(i??d.pumps.data[0],j.SpmPump.type);return n.jsx(bo,{pump:m,onComplete:p})},diagnostics:({holder:d,pump:i,onComplete:p})=>{const m=l.getKosCompanionModel(i??d.pumps.data[0],j.FcmPump.type);return n.jsx(_t,{pump:m,onComplete:p})},"replace-pump":({holder:d,pump:i,onComplete:p})=>n.jsx(mo,{pump:i??d.pumps.data[0],onComplete:p}),"rfid-override":go,"replace-line":({holder:d,onComplete:i})=>n.jsx(po,{holder:d,onComplete:i})}),[]),[s,r]=u.useState(void 0),c=s?o[s]:void 0;return{holderExperience:c?n.jsx(c,{holder:e,pump:t,onComplete:()=>{console.log("onComplete"),r(void 0)}}):void 0,setHolderExperience:r,currentExperienceId:s}},Me=u.createContext(void 0),un=({children:e,value:t})=>n.jsx(Me.Provider,{value:t,children:e}),pn=e=>({HolderContent:void 0}),Be=(e,t=pn)=>{const o=u.useContext(Me);return t=(o==null?void 0:o.actionFactory)||t,t(e)},Ke=()=>{const e=j.IngredientSummary.type;return l.useKosModel({modelId:e,modelType:j.IngredientSummary.type,options:{}})};function mn(e){return()=>t=>{const{model:o,status:s,KosModelLoader:r}=Ke();return n.jsx(r,{...s,children:n.jsx(e,{...t,ingredientSummary:o})})}}const Ne=()=>{const e=j.MacroAssignment.type;return l.useKosModel({modelId:e,modelType:j.MacroAssignment.type,options:{}})};function Yt(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Ne();return n.jsx(r,{...s,children:n.jsx(e,{...t,macroAssignment:o})})}}const Re=e=>{const t=e;return l.useKosModel({modelId:t,modelType:j.NetworkTest.type,options:{}})};function gn(e){return t=>o=>{const{model:s,status:r,KosModelLoader:c}=Re(t);return n.jsx(c,{...r,children:n.jsx(e,{...o,networkTest:s})})}}const Oe=()=>{const e=j.NetworkTestContainer.type;return l.useKosModel({modelId:e,modelType:j.NetworkTestContainer.type,options:{}})};function Zt(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Oe();return n.jsx(r,{...s,children:n.jsx(e,{...t,networkTestContainer:o})})}}const Qt=()=>{const e=j.NutritiveSweetener.type;return l.useKosModel({modelId:e,modelType:j.NutritiveSweetener.type,options:{}})};function xn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Qt();return n.jsx(r,{...s,children:n.jsx(e,{...t,nutritiveSweetener:o})})}}const Jt=()=>{const e=j.PlainWater.type;return l.useKosModel({modelId:e,modelType:j.PlainWater.type,options:{},destroyOnUnmount:!0})};function hn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=Jt();return n.jsx(r,{...s,children:n.jsx(e,{...t,plainWater:o})})}}const fn=e=>{switch(e.type){case"fcm":return j.FcmPump.type;case"lfcv":return j.LfcvPump.type;case"micro":return j.SpmPump.type;default:return}},K="pluginVisibility",pe=new Map;l.registerExtensionPoint(K,{register:(e,t)=>{var o;pe.has(e)||pe.set(e,[]),(o=pe.get(e))==null||o.push(t)},execute:(e,t,o)=>{const s=pe.get(e);if(!s)return!0;const r=s.map(c=>c(t,o));return r.length===0?!0:!r.includes(!1)}});class eo{constructor(t,o){I(this,"core");I(this,"dispense");this.core=t,this.dispense=o}registerDashboardVisibilityFilter(t){return l.ExtensionManager[K].register(K,t),this}registerNavVisibilityFilter(t){return l.ExtensionManager[K].register(K,t),this}}class bn{constructor(){I(this,"dispense");I(this,"core");I(this,"plugin");this.dispense=new Ie.DispenseExtensionManager,this.core=new l.CoreExtensionManager,this.plugin=new eo(this.core,this.dispense)}}const be=e=>e?to(e.type):{action:"",label:"",progress:"",summary:""},to=e=>{const t=`troubles:troubles.${e}`;return{action:`${t}.action`,label:`${t}.label`,progress:`${t}.progress`,summary:`${t}.summary`}},Q=e=>{const{getExtensions:t}=N.useKosPluginsContext();return{getExtensions:u.useCallback(s=>t(s).filter(d=>{const i=d.id;return l.ExtensionManager[K].execute(K,i,e)}),[t,e])}},Ce=()=>{const e=j.Reboot.type;return l.useKosModel({modelId:e,modelType:j.Reboot.type,options:{}})};function Cn(e){return()=>t=>{const{model:o,status:s,KosModelLoader:r}=Ce();return n.jsx(r,{...s,children:n.jsx(e,{...t,reboot:o})})}}const ve=()=>{const e=j.Settings.type;return l.useKosModel({modelId:e,modelType:j.Settings.type,options:{}})};function $e(e){return t=>{const{model:o,status:s,KosModelLoader:r}=ve();return n.jsx(r,{...s,children:n.jsx(e,{...t,settings:o})})}}const Ve=e=>{const t=e;return l.useKosModel({modelId:t,modelType:j.SetupStep.type,options:{}})};function vn(e){return t=>o=>{const{model:s,status:r,KosModelLoader:c}=Ve(t);return n.jsx(c,{...r,children:n.jsx(e,{...o,setupStep:s})})}}const He=()=>{const e=j.SetupStepContainer.type;return l.useKosModel({modelId:e,modelType:j.SetupStepContainer.type,options:{}})};function oo(e){return t=>{const{model:o,status:s,KosModelLoader:r}=He();return n.jsx(r,{...s,children:n.jsx(e,{...t,setupStepContainer:o})})}}const no=()=>{const e=j.Start.type;return l.useKosModel({modelId:e,modelType:j.Start.type,options:{}})};function yn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=no();return n.jsx(r,{...s,children:n.jsx(e,{...t,start:o})})}}const _e=()=>{const e=j.TroubleActionManager.type,{getExtensions:t}=Q(),o=t(L.EXTENSION_POINT_TROUBLE_ACTION).map(r=>r.data);return l.useKosModel({modelId:e,modelType:j.TroubleActionManager.type,options:{definitions:o}})};function wn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=_e();return n.jsx(r,{...s,children:n.jsx(e,{...t,troubleAction:o})})}}const jn=({troubleType:e,condition:t})=>{const{model:o}=l.useTroubleContainerModel(),[s,r]=u.useState(!1),[c,d]=u.useState([]);return u.useEffect(()=>l.kosAutoEffect(()=>{const p=(e?o==null?void 0:o.troubles.getIndexByKey("byType",e):o==null?void 0:o.troubles.data)||[],m=t?p.filter(t):p;r(m.length>0),d(m)}),[t,o,e]),[s,c.length>0?c[0]:void 0,c]},Ue=e=>{const t=e;return l.useKosModel({modelId:t,modelType:j.Utilities.type,options:{}})};function Sn(e){return t=>o=>{const{model:s,status:r,KosModelLoader:c}=Ue(t);return n.jsx(c,{...r,children:n.jsx(e,{...o,utilities:s})})}}const ze=()=>{const e=j.UtilitiesContainer.type;return l.useKosModel({modelId:e,modelType:j.UtilitiesContainer.type,options:{}})};function kn(e){return t=>{const{model:o,status:s,KosModelLoader:r}=ze();return n.jsx(r,{...s,children:n.jsx(e,{...t,utilitiesContainer:o})})}}const so=l.withDevice(l.kosComponent(({device:e})=>{const{t}=l.useKosTranslation("dispenser-profile"),s=e.serialNumber==="unassigned"?void 0:e.serialNumber;return n.jsx(a.InfoCard,{label:t("dispenser-serial"),value:s})})),Tn=Gt(l.kosComponent(({dispenserInfo:e})=>{const{t}=l.useKosTranslation("dispenser-profile");return n.jsxs(n.Fragment,{children:[n.jsx(Kt,{label:t("dispenser-name","Dispenser Name"),configProperty:e.name}),n.jsx(so,{})]})})),Pn=$e(l.kosComponent(({settings:e})=>{const{t}=l.useKosTranslation("dispenser-profile"),o=s=>{if(s&&s.length>=25)return"The name shouldn’t exceed 25 characters."};return n.jsxs(n.Fragment,{children:[n.jsx(xe,{closeButtonLabel:t("close","Close")||void 0,configProperty:e==null?void 0:e.name,isValid:o,label:t("dispenser-name","Dispenser Name"),layout:"alphanumeric",maxLength:25}),n.jsx(Vt,{label:t("activate-and-reboot-time"),configProperty:e.activateAndRebootTime})]})})),ro=v(a.LabelDate)`
|
|
139
|
+
`,_t=({configProperties:e,disabled:t,enabledConfigProperty:n})=>{const{value:s}=l.useConfigProperty({configProperty:n}),r=s==="true",{componentModeOverride:c}=a.useComponentConfigurationContext(),d=e.length===1,i=d?to:Ht;return o.jsxs(Jn,{disabled:!r||t,mode:c,children:[o.jsx(eo,{children:e.map(p=>o.jsx(i,{disabled:!r||t,label:p.options?p.options.label:void 0,configProperty:p.configProperty,collapse:!d&&c==="standard",layout:p.options?p.options.layout:void 0,float:!0,hideUnits:p.options?p.options.hideUnits:void 0},p.configProperty.id))}),o.jsx(no,{compact:!d||c==="compact",children:o.jsx(te,{alwaysShowLabel:!0,collapse:!0,configProperty:n,disabled:t,stretch:c==="compact"})})]})},oo=({configProperty:e,disabled:t,enabledConfigProperty:n,options:s})=>{const r=u.useMemo(()=>[{configProperty:e,options:s}],[e,s]);return o.jsx(_t,{configProperties:r,disabled:t,enabledConfigProperty:n})},Ut=({configProperty:e,...t})=>{const{value:n}=l.useConfigProperty({configProperty:e}),s=r=>{r!==void 0&&(e==null||e.updateProperty(String(r)))};return o.jsx(a.SwitchCard,{...t,onChange:s,value:n})},zt=({description:e,float:t,label:n,modalTitle:s,onSave:r,time:c,...d})=>{const{regionModel:i}=l.useKosRegions(),{t:p}=l.useKosTranslation("common",{keyPrefix:"schedule"}),{amPmOptions:m,formattedTime:x,hourOptions:g,minuteOptions:h,setTime:f,time:C}=l.useRegionTimeProps({initialDate:c}),b=C.getHours(),j=u.useMemo(()=>[{id:"hr",items:g,selectedItemId:b<12?b:b-12,loop:!0},{id:"min",items:h,selectedItemId:C.getMinutes(),loop:!0},{id:"ampm",items:m,selectedItemId:b<12?"AM":"PM"}],[m,g,h,C,b]),P=u.useMemo(()=>[{id:"hr",items:g,selectedItemId:b,loop:!0},{id:"min",items:h,selectedItemId:C.getMinutes(),loop:!0}],[g,h,C,b]);return o.jsx(a.MultiPickerCard,{...d,cancelButtonLabel:p("discard-changes","Discard Changes")||void 0,closeButtonLabel:p("close","Close")||void 0,data:i!=null&&i.is12HourTimeFormat?j:P,description:e,displayValue:x,float:t,icon:_.TimeIcon,label:n,modalTitle:s,proceedButtonLabel:p("save","Save")||void 0,onSave:T=>{const k=i!=null&&i.is12HourTimeFormat?T.ampm==="AM"?T.hr:T.hr+12:T.hr,w=T.min,v=new Date(C);v.setHours(k),v.setMinutes(w),f(v),r==null||r({hours:k,minutes:w})}})},Wt=({configProperty:e,...t})=>{var x;const{getStagedChange:n,updateStagedChange:s}=Ee(),{value:r}=l.useConfigProperty({configProperty:e}),c=((x=n==null?void 0:n(e.id))==null?void 0:x.value)??r,{hours:d,minutes:i}=S.toTimeComponents(Number(c)),p=new Date;p.setHours(d),p.setMinutes(i);const m=g=>{const h=S.toSeconds(g.hours,g.minutes);s?s(e.id,{configProperty:e,value:h}):e.updateProperty(h)};return o.jsx(zt,{...t,onSave:m,time:p})},so=[0,6],Gt=({day:e=new Date().getDate(),month:t=new Date().getMonth(),onSave:n,year:s=new Date().getFullYear(),...r})=>{var f,C,b,j,P,T;const{t:c}=l.useKosTranslation("region"),{regionModel:d}=l.useKosRegions(),i=l.useDateProps({date:{year:s,month:t,day:e},formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(d==null?void 0:d.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:so,yearsRange:[s-10,s+10]}}),p=u.useMemo(()=>{var k,w;return(w=(k=i==null?void 0:i.dateState)==null?void 0:k.yearsOptionsArray)==null?void 0:w.map(v=>({id:v.value,label:v.label}))},[(f=i==null?void 0:i.dateState)==null?void 0:f.yearsOptionsArray]),m=u.useMemo(()=>{var k,w;return(w=(k=i==null?void 0:i.dateState)==null?void 0:k.daysOptionsArray)==null?void 0:w.map(v=>({id:v.value,label:v.label}))},[(C=i==null?void 0:i.dateState)==null?void 0:C.daysOptionsArray]),x=u.useMemo(()=>{var k,w;return(w=(k=i==null?void 0:i.dateState)==null?void 0:k.monthsOptionsArray)==null?void 0:w.map(v=>({id:v.value,label:String(v.label)}))},[(b=i==null?void 0:i.dateState)==null?void 0:b.monthsOptionsArray]),g=u.useMemo(()=>{const k=[];return d==null||d.selectedDateOrder.split("").forEach(w=>{var v,A,F;w==="y"?k.push({id:"year",items:p,selectedItemId:(v=i==null?void 0:i.dateState)==null?void 0:v.year,loop:!1}):w==="m"?k.push({id:"month",items:x,selectedItemId:(A=i==null?void 0:i.dateState)==null?void 0:A.month}):w==="d"&&k.push({id:"day",items:m,selectedItemId:(F=i==null?void 0:i.dateState)==null?void 0:F.day,loop:!1})}),k},[(j=i==null?void 0:i.dateState)==null?void 0:j.day,(P=i==null?void 0:i.dateState)==null?void 0:P.month,(T=i==null?void 0:i.dateState)==null?void 0:T.year,m,x,d==null?void 0:d.selectedDateOrder,p]),h=u.useCallback(async k=>{const v=new Date(k.year,k.month+1,0).getDate(),A=k.day>v?1:k.day;n({day:A,month:k.month,year:k.year})},[n]);return o.jsx(a.MultiPickerCard,{cancelButtonLabel:c("discard-changes","Discard Changes")||void 0,closeButtonLabel:c("close","Close")||void 0,data:g,displayValue:i.dateState.formattedDate,icon:_.CalendarIcon,label:c("todays-date","Today's Date"),onSave:h,proceedButtonLabel:c("save","Save")||void 0,...r})},qt=l.kosComponent(({pump:e,onComplete:t})=>{const{t:n}=l.useKosTranslation("common",{keyPrefix:"fcm-diagnostics"}),[s,r]=u.useState("idle"),[c,d]=u.useState(),i=u.useCallback(async()=>{r("test"),d(void 0);const m=await e.performElectricalTest();m.error?(d(m.error),r("failure")):m.result==="errEEPROM"?(d("errEEPROM"),r("failure")):r("success")},[e]),p=u.useMemo(()=>({idle:{information:o.jsx(a.LabelInformation,{children:n("perform-electrical-test")}),footer:o.jsx(a.Button,{onPointerDown:i,children:n("electrical-test")})},test:{information:o.jsx(a.LabelInformation,{children:n("testing")}),footer:o.jsx(a.Button,{disabled:!0,children:n("electrical-test")}),status:"loading"},success:{information:o.jsx(a.LabelInformation,{children:n("electrical-test-success-header")}),footer:o.jsx(a.Button,{onPointerDown:i,children:n("electrical-test")}),status:"success"},failure:{information:o.jsxs(o.Fragment,{children:[o.jsx(a.LabelInformation,{children:n("electrical-test-failure-header")}),o.jsx(a.BodyMediumInformation,{children:n(`error.${c}`)})]}),footer:o.jsx(a.Button,{onPointerDown:i,children:n("electrical-test")}),status:"information"}}),[c,n,i]);return o.jsx(a.WorkflowModal,{title:n(e.name),...p[s],onClose:()=>t()})}),Ae={title:"",summary:"",successMessage:"",failureMessage:"",actionLabel:""},ro=e=>{const[t,n]=u.useState(null),[s,r]=u.useState(Ae),c=e.map(d=>{const[i,,p]=d;return[i==null?void 0:i.future,i,p]}).flat();return u.useEffect(()=>{const d=e.find(i=>{const[p]=i;return!!(p!=null&&p.future)});d?(n(d[0]),r(d[2])):(n(null),r(Ae))},[...c,e]),[t,s]},io=e=>{switch(e){case"calibrate":return wt;case"fixed-45":return jt;case"flush":return St;case"high-flow-test":return kt;case"hold-to-pour":return Pt;case"low-flow-test":return Tt;case"manual-override":return It;case"msv-reset":return Dt;case"prime":return At;case"purge":return Ft;default:return}},ao=e=>(t,n="intents")=>({title:e(`${n}:troubles.${t}.progress`),summary:e(`${n}:troubles.${t}.summary`),successMessage:e(`${n}:troubles.${t}.success`),failureMessage:e(`${n}:troubles.${t}.error`),actionLabel:e(`${n}:troubles.${t}.action`)}),ne=(e,t=io)=>{const{t:n}=l.useKosTranslation("troubles"),[s,r]=u.useState(null),[c,d]=u.useState(Ae),i=u.useCallback(async p=>{const m=t(p);if(m){const x=ao(n)(p);d(x);const g=new m(e);await g.performAction(),r(g)}},[t,e,n]);return[s,i,c]},co=e=>(l.KosLog.debug(`pumpActionFactory: actionId=${e}`),Et),lo=e=>(t,n="troubles")=>({title:e(`${n}:troubles.${t}.progress`),summary:e(`${n}:troubles.${t}.summary`),successMessage:e(`${n}:troubles.${t}.success`),failureMessage:e(`${n}:troubles.${t}.error`),actionLabel:e(`${n}:troubles.${t}.action`)}),uo=(e,t,n=co)=>{const{t:s}=l.useKosTranslation("troubles"),[r,c]=u.useState(null),[d]=u.useState(lo(s)(t)),i=u.useCallback(async()=>{const p=n(t);if(p){const m=new p(e,t);await m.performAction(),c(m)}},[n,e,t]);return[r,i,d]};function po(e){return t=>{const{model:n,status:s,KosModelLoader:r}=Le();return o.jsx(r,{...s,children:o.jsx(e,{...t,agitationControl:n})})}}const Be=()=>{const e=S.Animation.type;return l.useKosModel({modelId:e,modelType:S.Animation.type,options:{}})};function Xt(e){return t=>{const{model:n,status:s,KosModelLoader:r}=Be();return o.jsx(r,{...s,children:o.jsx(e,{...t,animation:n})})}}const oe=()=>{const e=S.Application.type;return l.useKosModel({modelId:e,modelType:S.Application.type,options:{}})};function mo(e){return t=>{const{model:n,status:s,KosModelLoader:r}=oe();return o.jsx(r,{...s,children:o.jsx(e,{...t,application:n})})}}const Yt=()=>{const e=S.CarbWater.type;return l.useKosModel({modelId:e,modelType:S.CarbWater.type,options:{}})};function go(e){return t=>{const{model:n,status:s,KosModelLoader:r}=Yt();return o.jsx(r,{...s,children:o.jsx(e,{...t,carbWater:n})})}}const Zt=()=>{const e=S.CopyLogs.type;return l.useKosModel({modelId:e,modelType:S.CopyLogs.type,options:{},activate:!0,destroyOnUnmount:!0})};function xo(e){return t=>{const{model:n,status:s,KosModelLoader:r}=Zt();return o.jsx(r,{...s,children:o.jsx(e,{...t,copyLogs:n})})}}const Me=()=>{const e=S.DashboardOperations.type;return l.useKosModel({modelId:e,modelType:S.DashboardOperations.type,options:{}})};function ho(e){return t=>{const{model:n,status:s,KosModelLoader:r}=Me();return o.jsx(r,{...s,children:o.jsx(e,{...t,dashboardOperations:n})})}}const Ke=()=>{const e=S.DispenserInfo.type;return l.useKosModel({modelId:e,modelType:S.DispenserInfo.type,options:{}})};function Qt(e){return t=>{const{model:n,status:s,KosModelLoader:r}=Ke();return o.jsx(r,{...s,children:o.jsx(e,{...t,dispenserInfo:n})})}}const Jt=e=>{const t=e;return l.useKosModel({modelId:t,modelType:S.Door.type,options:{}})};function fo(e){return t=>{const{model:n,status:s,KosModelLoader:r}=Jt(t.id);return o.jsx(r,{...s,children:o.jsx(e,{...t,door:n})})}}const xt={[L.EXTENSION_POINT_SETUP]:"setupDescriptor",[L.EXTENSION_POINT_CUI]:"cuiDescriptor",[L.EXTENSION_POINT_UTIL]:"utilDescriptor"},en=({defaultNamespace:e,extensionPoint:t})=>{const{getExtensions:n}=N.useKosPluginsContext(),s=n(t),r=s.map(p=>p.data.namespace)||[],{t:c}=l.useKosTranslation([e,...new Set(r)]),d=s.reduce((p,m)=>{const x=m;return p[x.data[xt[t]]]={extension:t,module:x.id,namespace:x.data.namespace,title:x.data.title},p},{}),i=s.reduce((p,m)=>{const x=m;return p[x.data[xt[t]]]=`${x.data.namespace}:${x.data.title}`,p},{});return{namespaces:r,t:c,labelMap:i,contributionMap:d}},se=(e,t)=>{const n=u.useMemo(()=>({agitate:Bt,calibrate:({holder:d,pump:i,onComplete:p})=>{const m=l.getKosCompanionModel(i??d.pumps.data[0],S.FcmPump.type);return o.jsx(Nt,{pump:m,onComplete:p})},calibrateSPM:({holder:d,pump:i,onComplete:p})=>{const m=l.getKosCompanionModel(i??d.pumps.data[0],S.SpmPump.type);return o.jsx(kn,{pump:m,onComplete:p})},diagnostics:({holder:d,pump:i,onComplete:p})=>{const m=l.getKosCompanionModel(i??d.pumps.data[0],S.FcmPump.type);return o.jsx(qt,{pump:m,onComplete:p})},"replace-pump":({holder:d,pump:i,onComplete:p})=>o.jsx(vn,{pump:i??d.pumps.data[0],onComplete:p}),"rfid-override":yn,"replace-line":({holder:d,onComplete:i})=>o.jsx(Cn,{holder:d,onComplete:i})}),[]),[s,r]=u.useState(void 0),c=s?n[s]:void 0;return{holderExperience:c?o.jsx(c,{holder:e,pump:t,onComplete:()=>{r(void 0)}}):void 0,setHolderExperience:r,currentExperienceId:s}},Re=u.createContext(void 0),bo=({children:e,value:t})=>o.jsx(Re.Provider,{value:t,children:e}),Co=e=>({HolderContent:void 0}),Ne=(e,t=Co)=>{const n=u.useContext(Re);return t=(n==null?void 0:n.actionFactory)||t,t(e)},$e=()=>{const e=S.IngredientSummary.type;return l.useKosModel({modelId:e,modelType:S.IngredientSummary.type,options:{}})};function vo(e){return()=>t=>{const{model:n,status:s,KosModelLoader:r}=$e();return o.jsx(r,{...s,children:o.jsx(e,{...t,ingredientSummary:n})})}}const Oe=()=>{const e=S.MacroAssignment.type;return l.useKosModel({modelId:e,modelType:S.MacroAssignment.type,options:{}})};function tn(e){return t=>{const{model:n,status:s,KosModelLoader:r}=Oe();return o.jsx(r,{...s,children:o.jsx(e,{...t,macroAssignment:n})})}}const Ve=e=>{const t=e;return l.useKosModel({modelId:t,modelType:S.NetworkTest.type,options:{}})};function yo(e){return t=>n=>{const{model:s,status:r,KosModelLoader:c}=Ve(t);return o.jsx(c,{...r,children:o.jsx(e,{...n,networkTest:s})})}}const He=()=>{const e=S.NetworkTestContainer.type;return l.useKosModel({modelId:e,modelType:S.NetworkTestContainer.type,options:{}})};function nn(e){return t=>{const{model:n,status:s,KosModelLoader:r}=He();return o.jsx(r,{...s,children:o.jsx(e,{...t,networkTestContainer:n})})}}const on=()=>{const e=S.NutritiveSweetener.type;return l.useKosModel({modelId:e,modelType:S.NutritiveSweetener.type,options:{}})};function wo(e){return t=>{const{model:n,status:s,KosModelLoader:r}=on();return o.jsx(r,{...s,children:o.jsx(e,{...t,nutritiveSweetener:n})})}}const sn=()=>{const e=S.PlainWater.type;return l.useKosModel({modelId:e,modelType:S.PlainWater.type,options:{},destroyOnUnmount:!0})};function jo(e){return t=>{const{model:n,status:s,KosModelLoader:r}=sn();return o.jsx(r,{...s,children:o.jsx(e,{...t,plainWater:n})})}}const So=e=>{switch(e.type){case"fcm":return S.FcmPump.type;case"lfcv":return S.LfcvPump.type;case"micro":return S.SpmPump.type;default:return}},M="pluginVisibility",xe=new Map;l.registerExtensionPoint(M,{register:(e,t)=>{var n;xe.has(e)||xe.set(e,[]),(n=xe.get(e))==null||n.push(t)},execute:(e,t,n)=>{const s=xe.get(e);if(!s)return!0;const r=s.map(c=>c(t,n));return r.length===0?!0:!r.includes(!1)}});class rn{constructor(t,n){I(this,"core");I(this,"dispense");this.core=t,this.dispense=n}registerDashboardVisibilityFilter(t){return l.ExtensionManager[M].register(M,t),this}registerNavVisibilityFilter(t){return l.ExtensionManager[M].register(M,t),this}}class ko{constructor(){I(this,"dispense");I(this,"core");I(this,"plugin");this.dispense=new Fe.DispenseExtensionManager,this.core=new l.CoreExtensionManager,this.plugin=new rn(this.core,this.dispense)}}const re=e=>e?an(e.type):{action:"",label:"",progress:"",summary:""},an=e=>{const t=`troubles:troubles.${e}`;return{action:`${t}.action`,label:`${t}.label`,progress:`${t}.progress`,summary:`${t}.summary`}},ie=e=>{const{getExtensions:t}=N.useKosPluginsContext();return{getExtensions:u.useCallback(s=>t(s).filter(d=>{const i=d.id;return l.ExtensionManager[M].execute(M,i,e)}),[t,e])}},ve=()=>{const e=S.Reboot.type;return l.useKosModel({modelId:e,modelType:S.Reboot.type,options:{}})};function Po(e){return()=>t=>{const{model:n,status:s,KosModelLoader:r}=ve();return o.jsx(r,{...s,children:o.jsx(e,{...t,reboot:n})})}}const ye=()=>{const e=S.Settings.type;return l.useKosModel({modelId:e,modelType:S.Settings.type,options:{}})};function _e(e){return t=>{const{model:n,status:s,KosModelLoader:r}=ye();return o.jsx(r,{...s,children:o.jsx(e,{...t,settings:n})})}}const Ue=e=>{const t=e;return l.useKosModel({modelId:t,modelType:S.SetupStep.type,options:{}})};function To(e){return t=>n=>{const{model:s,status:r,KosModelLoader:c}=Ue(t);return o.jsx(c,{...r,children:o.jsx(e,{...n,setupStep:s})})}}const ze=()=>{const e=S.SetupStepContainer.type;return l.useKosModel({modelId:e,modelType:S.SetupStepContainer.type,options:{}})};function cn(e){return t=>{const{model:n,status:s,KosModelLoader:r}=ze();return o.jsx(r,{...s,children:o.jsx(e,{...t,setupStepContainer:n})})}}const ln=()=>{const e=S.Start.type;return l.useKosModel({modelId:e,modelType:S.Start.type,options:{}})};function Io(e){return t=>{const{model:n,status:s,KosModelLoader:r}=ln();return o.jsx(r,{...s,children:o.jsx(e,{...t,start:n})})}}const We=()=>{const e=S.TroubleActionManager.type,{getExtensions:t}=ie(),n=t(L.EXTENSION_POINT_TROUBLE_ACTION).map(r=>r.data);return l.useKosModel({modelId:e,modelType:S.TroubleActionManager.type,options:{definitions:n}})};function Do(e){return t=>{const{model:n,status:s,KosModelLoader:r}=We();return o.jsx(r,{...s,children:o.jsx(e,{...t,troubleAction:n})})}}const we=e=>{const[t,n]=u.useState({});return u.useEffect(()=>{async function s(){if(e){const r=await l.troubleDataFactory(e);n(r)}}s()},[e]),t},Ao=e=>!e||e==="white",Fo=e=>e?void 0:"white",dn=e=>{if(!l.isTroubleAware(e))return{};const t=e,{visibleTroubles:n,initialized:s}=z(t),r=(n==null?void 0:n.length)??0,c=n==null?void 0:n[0],d=r>0,i=d?`${c==null?void 0:c.color}`:void 0,p=Ao(i),m=d?Fo(p):void 0;return{backgroundColor:i,fontColor:m,highestTrouble:c,initialized:s,troubleCount:r,hasTroubles:d}},Lo=({troubleType:e,condition:t})=>{const{model:n}=l.useTroubleContainerModel(),[s,r]=u.useState(!1),[c,d]=u.useState([]);return u.useEffect(()=>l.kosAutoEffect(()=>{const p=(e?n==null?void 0:n.troubles.getIndexByKey("byType",e):n==null?void 0:n.troubles.data)||[],m=t?p.filter(t):p;r(m.length>0),d(m)}),[t,n,e]),[s,c.length>0?c[0]:void 0,c]},Ge=e=>{const t=e;return l.useKosModel({modelId:t,modelType:S.Utilities.type,options:{}})};function Eo(e){return t=>n=>{const{model:s,status:r,KosModelLoader:c}=Ge(t);return o.jsx(c,{...r,children:o.jsx(e,{...n,utilities:s})})}}const qe=()=>{const e=S.UtilitiesContainer.type;return l.useKosModel({modelId:e,modelType:S.UtilitiesContainer.type,options:{}})};function Bo(e){return t=>{const{model:n,status:s,KosModelLoader:r}=qe();return o.jsx(r,{...s,children:o.jsx(e,{...t,utilitiesContainer:n})})}}const un=l.withDevice(l.kosComponent(({device:e})=>{const{t}=l.useKosTranslation("dispenser-profile"),s=e.serialNumber==="unassigned"?void 0:e.serialNumber;return o.jsx(a.InfoCard,{label:t("dispenser-serial"),value:s})})),Mo=Qt(l.kosComponent(({dispenserInfo:e})=>{const{t}=l.useKosTranslation("dispenser-profile");return o.jsxs(o.Fragment,{children:[o.jsx(Vt,{label:t("dispenser-name","Dispenser Name"),configProperty:e.name}),o.jsx(un,{})]})})),Ko=_e(l.kosComponent(({settings:e})=>{const{t}=l.useKosTranslation("dispenser-profile"),n=s=>{if(s&&s.length>=25)return"The name shouldn’t exceed 25 characters."};return o.jsxs(o.Fragment,{children:[o.jsx(be,{closeButtonLabel:t("close","Close")||void 0,configProperty:e==null?void 0:e.name,isValid:n,label:t("dispenser-name","Dispenser Name"),layout:"alphanumeric",maxLength:25}),o.jsx(Wt,{label:t("activate-and-reboot-time"),configProperty:e.activateAndRebootTime})]})})),pn=y(a.LabelDate)`
|
|
140
140
|
color: var(--ddk-generic-color-grey-60);
|
|
141
141
|
font-size: var(--ddk-component-enjoy-by-font-size-small);
|
|
142
142
|
font-weight: var(--ddk-component-enjoy-by-font-weight-small);
|
|
143
|
-
`,
|
|
143
|
+
`,Ro=y(a.LabelDate)`
|
|
144
144
|
color: var(--ddk-component-dashboard-enjoy-by-trouble-warning-color);
|
|
145
|
-
`,
|
|
145
|
+
`,No=y(pn)`
|
|
146
146
|
color: var(--ddk-component-dashboard-enjoy-by-trouble-warning-color);
|
|
147
|
-
`,
|
|
147
|
+
`,Xe=({holder:e,size:t})=>{const{t:n}=l.useKosTranslation("common"),{regionModel:s}=l.useKosRegions(),r=!!e.enjoyByDate,c=e.enjoyByDate??new Date,{formattedDate:d}=l.useFormattedDate({year:c.getFullYear(),month:c.getMonth(),day:c.getDay(),formatString:(s==null?void 0:s.selectedDateFormat)||""}),i=e.hasEnjoyByWarning?t==="small"?No:Ro:t==="small"?pn:a.LabelDate;return r&&o.jsx(i,{children:n("enjoy-by",{data:{date:d}})})},$o=({item:e,valueKey:t})=>{const{t:n}=l.useKosTranslation("hardware-info"),{linked:s}=e;if(t==="link.serialNum"&&!s)return o.jsx(a.LabelInformationExtraSmall,{children:n("not-connected")});const r=a.getItemData(e,t);return r||"—"},Oo=y(a.Table)`
|
|
148
148
|
& ul {
|
|
149
149
|
list-style-type: none;
|
|
150
150
|
margin: 0;
|
|
151
151
|
padding: 0;
|
|
152
152
|
}
|
|
153
|
-
`,
|
|
153
|
+
`,Vo=l.kosComponent(()=>{const{model:e}=Fe.useBoardContainer(),{t}=l.useKosTranslation("hardware-info"),n=(e==null?void 0:e.boardList.map(s=>{var r,c,d;return{...s,link:{...s.link,firmwareVersions:(r=s.link)!=null&&r.firmwareVersions&&s.link.firmwareVersions.length>0?o.jsx("ul",{children:(d=(c=s.link)==null?void 0:c.firmwareVersions)==null?void 0:d.map((i,p)=>o.jsx("li",{children:i},p))}):"—"}}}))||[];return e&&e.boardList&&o.jsx(Oo,{CellRenderer:$o,data:n,dataKeys:["name","type","link.hardwareVersion","link.serialNum","link.firmwareVersions"],headers:[t("name"),t("type"),t("revision"),t("serial-number"),t("firmware")],heading:t("tower")||void 0})}),U=({disabled:e,model:t,onPour:n,onPourCancel:s,...r})=>{const{t:c}=l.useKosTranslation("common"),[d,i]=u.useState(t.isPouring?"halt":"idle"),p=u.useRef(),m=u.useRef(!1),x=250;u.useEffect(()=>l.kosAutoEffect(()=>{t.isPouring||(m.current=!1,clearTimeout(p.current),p.current=void 0,i("idle"))}),[t]),u.useEffect(()=>()=>{t.isPouring&&t.cancelPour()},[t]);const g=u.useCallback(()=>{t&&(e||t.isPouring||(t.performIntent("HOLD_TO_POUR"),p.current=setTimeout(()=>{m.current=!0,p.current=void 0,i("run")},x)))},[e,t]),h=u.useCallback(()=>{t&&(m.current?(t.cancelPour(),m.current=!1,i("idle")):p.current?(clearTimeout(p.current),p.current=void 0,i("halt")):t.isPouring&&(t.cancelPour(),i("idle")))},[t]),f=u.useCallback(()=>{d!=="halt"&&h()},[h,d]);return o.jsx(a.TapAndHoldButton,{disabled:e,mode:"primary",onPointerCancel:h,onPointerDown:g,onPointerOut:f,onPointerUp:h,...r,state:d,children:c(c(d==="idle"?"tapOrHoldToPour":d==="run"?"releaseToStop":"stop"))})},Ye=u.createContext(void 0),Ho=({children:e})=>{const{model:t,ready:n}=Be(),s=u.useMemo(()=>n&&t?{model:t}:{},[n,t]);return o.jsx(Ye.Provider,{value:s,children:e})},_o=()=>{const e=u.useContext(Ye);if(!e)throw new Error("useAnimationContext must be used within a AnimationProvider");return e},Uo=Xt(({animation:e,animationOverrides:t,children:n,componentModeOverride:s,modalModeOverride:r})=>{const[c,d]=u.useState(!0),[i,p]=u.useState(!0),[m,x]=u.useState(!0);return u.useEffect(()=>{const g=l.kosAutoEffect(()=>{const h=!!(!(t!=null&&t.disableAll)&&(t!=null&&t.enableDial))&&!!(!e.disableAll.value&&e.enableDial.value),f=!!(!(t!=null&&t.disableAll)&&(t!=null&&t.enableModal))&&!!(!e.disableAll.value&&e.enableModal.value),C=!!(!(t!=null&&t.disableAll)&&(t!=null&&t.enableSideBar))&&!!(!e.disableAll.value&&e.enableSideBar.value);d(h),p(f),x(C)});return()=>{g()}},[e,t==null?void 0:t.disableAll,t==null?void 0:t.enableDial,t==null?void 0:t.enableModal,t==null?void 0:t.enableSideBar]),o.jsx(a.ComponentConfigurationProvider,{value:{componentModeOverride:s,enableDialAnimation:c,enableModalAnimation:i,enableSidebarAnimation:m,modalModeOverride:r},children:n})}),Ze=u.createContext(void 0),zo=({children:e})=>{const{model:t,ready:n}=oe(),s=u.useMemo(()=>n&&t?{model:t}:{},[n,t]);return o.jsx(Ze.Provider,{value:s,children:e})},je=()=>{const e=u.useContext(Ze);if(!e)throw new Error("useApplicationContext must be used within a ApplicationProvider");return e},Qe=u.createContext(void 0),Wo=({children:e})=>{const{model:t,ready:n}=Me(),s=u.useMemo(()=>n&&t?{model:t}:{},[n,t]);return o.jsx(Qe.Provider,{value:s,children:e})},Go=()=>{const e=u.useContext(Qe);if(!e)throw new Error("useDashboardOperationsContext must be used within a DashboardOperationsProvider");return e},Je=u.createContext(void 0),qo=({children:e})=>{const{model:t,ready:n}=Ke(),s=u.useMemo(()=>n&&t?{model:t}:{},[n,t]);return o.jsx(Je.Provider,{value:s,children:e})},Xo=()=>{const e=u.useContext(Je);if(!e)throw new Error("useDispenserInfoContext must be used within a DispenserInfoProvider");return e},et=u.createContext(void 0),Yo=({children:e})=>{const{model:t,ready:n}=$e(),s=u.useMemo(()=>n&&t?{model:t}:{},[n,t]);return o.jsx(et.Provider,{value:s,children:e})},Zo=()=>{const e=u.useContext(et);if(!e)throw new Error("useIngredientSummaryContext must be used within a IngredientSummaryProvider");return e},tt=u.createContext(void 0),Qo=({children:e})=>{const{model:t,ready:n}=Oe(),s=u.useMemo(()=>n&&t?{model:t}:{},[n,t]);return o.jsx(tt.Provider,{value:s,children:e})},Jo=()=>{const e=u.useContext(tt);if(!e)throw new Error("useMacroAssignmentContext must be used within a MacroAssignmentProvider");return e},nt=u.createContext(void 0),es=({children:e,id:t})=>{const{model:n,ready:s}=Ve(t),r=u.useMemo(()=>s&&n?{model:n}:{},[s,n]);return o.jsx(nt.Provider,{value:r,children:e})},ts=()=>{const e=u.useContext(nt);if(!e)throw new Error("useNetworkTestContext must be used within a NetworkTestProvider");return e},ot=u.createContext(void 0),ns=({children:e})=>{const{model:t,ready:n}=He(),s=u.useMemo(()=>n&&t?{model:t}:{},[n,t]);return o.jsx(ot.Provider,{value:s,children:e})},os=()=>{const e=u.useContext(ot);if(!e)throw new Error("useNetworkTestContainerContext must be used within a NetworkTestContainerProvider");return e},st=u.createContext(void 0),ss=({children:e})=>{const{model:t,ready:n}=ve(),s=u.useMemo(()=>n&&t?{model:t}:{},[n,t]);return o.jsx(st.Provider,{value:s,children:e})},rs=()=>{const e=u.useContext(st);if(!e)throw new Error("useRebootContext must be used within a RebootProvider");return e},rt=u.createContext(void 0),is=({children:e})=>{const{model:t,ready:n}=ye(),s=u.useMemo(()=>n&&t?{model:t}:{},[n,t]);return o.jsx(rt.Provider,{value:s,children:e})},as=()=>{const e=u.useContext(rt);if(!e)throw new Error("useSettingsContext must be used within a SettingsProvider");return e},it=u.createContext(void 0),cs=({children:e,id:t})=>{const{model:n,ready:s}=Ue(t),r=u.useMemo(()=>s&&n?{model:n}:{},[s,n]);return o.jsx(it.Provider,{value:r,children:e})},ls=()=>{const e=u.useContext(it);if(!e)throw new Error("useSetupStepContext must be used within a SetupStepProvider");return e},at=u.createContext(void 0),ds=({children:e})=>{const{model:t,ready:n}=ze(),s=u.useMemo(()=>n&&t?{model:t}:{},[n,t]);return o.jsx(at.Provider,{value:s,children:e})},us=()=>{const e=u.useContext(at);if(!e)throw new Error("useSetupStepContainerContext must be used within a SetupStepContainerProvider");return e},ct=u.createContext(void 0),ps=({children:e,id:t})=>{const{model:n,ready:s}=Ge(t),r=u.useMemo(()=>s&&n?{model:n}:{},[s,n]);return o.jsx(ct.Provider,{value:r,children:e})},ms=()=>{const e=u.useContext(ct);if(!e)throw new Error("useUtilitiesContext must be used within a UtilitiesProvider");return e},lt=u.createContext(void 0),gs=({children:e})=>{const{model:t,ready:n}=qe(),s=u.useMemo(()=>n&&t?{model:t}:{},[n,t]);return o.jsx(lt.Provider,{value:s,children:e})},xs=()=>{const e=u.useContext(lt);if(!e)throw new Error("useUtilitiesContainerContext must be used within a UtilitiesContainerProvider");return e},z=e=>{const{model:t}=je(),[n,s]=u.useState(),r=t==null?void 0:t.currentRole,c=!!n;return u.useLayoutEffect(()=>{const d=l.kosAutoEffect(()=>{const i=e.troubles.filter(S.troubleVisibilityFilter(r));s(p=>{const m=p??[];return i.length!==m.length||i.some(x=>!m.includes(x))?i:m})});return()=>{d()}},[e,r]),{visibleTroubles:n,initialized:c}},mn=l.KosLog.createLogger({name:"holder-group-view"});mn.debug("holder-group-view component loaded");const ht=y.div`
|
|
154
154
|
align-items: start;
|
|
155
155
|
|
|
156
156
|
display: flex;
|
|
@@ -160,29 +160,29 @@
|
|
|
160
160
|
text-overflow: ellipsis;
|
|
161
161
|
width: 100%;
|
|
162
162
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
163
|
-
`,
|
|
163
|
+
`,hs=y.div`
|
|
164
164
|
display: flex;
|
|
165
165
|
align-items: center;
|
|
166
166
|
justify-content: center;
|
|
167
167
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
168
|
-
`,
|
|
168
|
+
`,fs=y.div`
|
|
169
169
|
font-size: var(--ddk-component-holder-card-footer-font-size);
|
|
170
170
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
171
|
-
`,
|
|
171
|
+
`,bs=e=>!e||e==="white",Cs=e=>e?void 0:"white",vs=(e,t)=>t&&t.hasEnjoyByWarning?"var(--ddk-component-dashboard-enjoy-by-trouble-warning-color)":e?void 0:"white",gn=l.kosComponent(({holder:e,onHolderSelect:t,showNavIcon:n,summaryBody:s})=>{const{model:r}=oe(),{visibleTroubles:c,initialized:d}=z(e),i=r==null?void 0:r.currentRole,{t:p}=l.useKosTranslation("troubles"),{t:m}=l.useKosTranslation("common"),{componentModeOverride:x}=a.useComponentConfigurationContext(),g=x==="compact",{getExtensions:h}=ie();let f=!1;const C=l.getKosCompanionModel(e,J.FreestyleHolder.type);C!=null&&C.isRemote&&(mn.warn("Holder is remote, skipping rendering"),f=!0);const[b,j]=u.useState(!1),P=!!e.ingredientId,T=u.useCallback(()=>{j(!1)},[]),k=(c==null?void 0:c.length)??0,w=c==null?void 0:c[0],v=k>0,A=we(w),F=e.hasFuelGuage,B=e.fillPercent,ae=v?`${w==null?void 0:w.color}`:void 0,ce=bs(ae),W=f?"var(--ddk-generic-color-grey-30)":v?Cs(ce):P?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",le=f?"var(--ddk-generic-color-grey-30)":v?vs(ce,e):P?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",de=a.useAbbreviation(e.name,g),ke=f?m("disabled"):e.removed?m(e.previousIngredientName):e.unassigned?m("unassigned"):m(e.ingredientName),G=o.jsx(ht,{color:W,children:ke}),Pe=o.jsx(hs,{color:W,children:de}),ue=o.jsxs(ht,{children:[e.name," ",ke]}),Te=P&&F&&!v&&d?s??o.jsx(a.FuelGauge,{color:v?"var(--ddk-generic-color-white)":void 0,size:"small",value:B}):null,Ie=P&&F&&!v&&d&&a.getFillColor(B)||void 0,q=l.ExtensionManager.executeDashboardKeyFactory(e)||"",pe=u.useMemo(()=>h(L.EXTENSION_POINT_DASHBOARD),[h]),X=u.useMemo(()=>pe.filter(R=>!!R.data.pumpDetail).reduce((R,mt)=>(R[mt.data.pumpDetail.dashboardKey]=mt.data.pumpDetail,R),{}),[pe]),Y=!!X[q],{HolderContent:O,modalOptions:V}=Ne(e),me=u.useMemo(()=>{var R;return O?o.jsx(O,{holder:e,onComplete:T}):Y?o.jsx(N.DynamicComponent,{extension:L.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL,module:(R=X[q])==null?void 0:R.id,props:{holder:e}}):void 0},[O,T,X,Y,e,q]),In=re(w),Dn=o.jsx(fs,{color:v?W:le,children:C!=null&&C.isRemote?m("remote-nns-active"):v?p(In.summary,{context:w!=null&&w.deferred?"queued":void 0,data:A}):!g&&o.jsx(Xe,{size:"small",holder:e})}),{holderExperience:An,setHolderExperience:pt}=se(e),{future:ge}=K(w),Fn=u.useCallback(()=>{f||e.sortedPumps.length<=0||(i==="technician"?j(!0):e.unassigned||e.removed?pt("rfid-override"):v&&(t==null||t(e)))},[e,v,t,i,pt]);return o.jsxs(o.Fragment,{children:[o.jsxs(a.Modal,{contain:!g,...V,show:b,onClose:T,children:[o.jsx(a.Header,{contain:g,showCloseButton:!0,title:ue,onClose:T,CloseButton:g?a.BackButton:void 0}),me]}),o.jsx(u.Suspense,{children:An}),o.jsx(a.HolderDashboardCard,{avatar:Pe,backgroundColor:ae,footer:Dn,cardId:e.path,errors:k,title:G,indicatorColor:Ie,disabled:f,body:Te,showNavIcon:n,onCardSelect:Fn},e.path),(w==null?void 0:w.future)&&o.jsx(D,{title:G,future:ge,failureMessage:p(`troubles.${w.type}.error`,{context:ge==null?void 0:ge.reason})})]})}),dt=y.div`
|
|
172
172
|
display: flex;
|
|
173
173
|
flex-direction: var(--ddk-component-dashboard-card-flex-direction);
|
|
174
174
|
row-gap: var(--ddk-component-dashboard-row-gap);
|
|
175
175
|
column-gap: var(--ddk-component-dashboard-column-gap);
|
|
176
176
|
height: 100%;
|
|
177
177
|
user-select: none;
|
|
178
|
-
`,
|
|
178
|
+
`,ys=l.kosComponent(({holder:e,showNavIcons:t})=>{const n=e.troubles[0],s=()=>{n!=null&&n.resolvable&&n.resolve()};return o.jsx(gn,{holder:e,showNavIcon:t,onHolderSelect:s},e.id)}),ws=l.kosComponent(({holders:e,showNavIcons:t,...n})=>{const s=u.useMemo(()=>e.map(r=>o.jsx(ys,{holder:r,showNavIcons:!!t},r.id)),[e,t]);return o.jsx(dt,{...n,children:s})}),js=l.KosLog.createLogger({name:"holder-group-view"});js.debug("holder-group-view component loaded");const ft=["water","carb","ns","nns"],Ss=y.div`
|
|
179
179
|
display: flex;
|
|
180
180
|
flex-direction: column;
|
|
181
181
|
overflow-y: auto;
|
|
182
182
|
overflow-x: hidden;
|
|
183
183
|
justify-content: space-between;
|
|
184
184
|
height: 100%;
|
|
185
|
-
`,
|
|
185
|
+
`,bt=y.div`
|
|
186
186
|
align-items: start;
|
|
187
187
|
|
|
188
188
|
display: flex;
|
|
@@ -192,25 +192,25 @@
|
|
|
192
192
|
text-overflow: ellipsis;
|
|
193
193
|
width: 100%;
|
|
194
194
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
195
|
-
`,
|
|
195
|
+
`,ks=y.div`
|
|
196
196
|
display: flex;
|
|
197
197
|
align-items: center;
|
|
198
198
|
justify-content: center;
|
|
199
199
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
200
|
-
`,
|
|
200
|
+
`,Ps=y.div`
|
|
201
201
|
font-size: var(--ddk-component-holder-card-footer-font-size);
|
|
202
202
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
203
|
-
`,
|
|
203
|
+
`,Ts=e=>!e||e==="white",Is=e=>e?void 0:"white",xn=l.kosComponent(({holder:e,onHolderSelect:t,showNavIcon:n})=>{var Y,O;const{model:s}=oe(),{visibleTroubles:r,initialized:c}=z(e),{t:d}=l.useKosTranslation(["troubles","common"]),{componentModeOverride:i}=a.useComponentConfigurationContext(),p=i==="compact",{getExtensions:m}=ie(),x=(Y=s==null?void 0:s.currentRole)==null?void 0:Y.toLowerCase(),[g,h]=u.useState(!1),f=!!e.ingredientId,C=(r==null?void 0:r.length)??0,b=r==null?void 0:r[0],j=r?r.length>0:!1,P=j?`${b==null?void 0:b.color}`:void 0,T=Ts(P),k=j?Is(T):f?void 0:"var(--ddk-component-dashboard-card-color-unassigned)",w=a.useAbbreviation(e.name,i==="compact"),v=d(`common:macros.${e.name}`),A=d(`common:${e.ingredientName}`),F=f?ft.includes(e.name)?"":` ${A}`:` ${d("common:macros.unassigned")}`,B=`${v}${F}`,ae=p?ft.includes(e.name)?v:F:`${v} ${F}`,ce=i==="compact"&&o.jsx(ks,{color:k,children:w}),W=o.jsx(bt,{color:k,children:ae}),le=o.jsx(bt,{children:B}),de=l.ExtensionManager.executeDashboardKeyFactory(e)||"",G=m(L.EXTENSION_POINT_DASHBOARD).filter(V=>!!V.data.pumpDetail).reduce((V,me)=>(V[me.data.pumpDetail.dashboardKey]=me.data.pumpDetail,V),{}),Pe=!!G[de],{HolderContent:ue,modalOptions:Te}=Ne(e),Ie=ue?o.jsx(ue,{holder:e,onComplete:()=>h(!1)}):Pe?o.jsx(N.DynamicComponent,{extension:L.EXTENSION_POINT_DASHBOARD_PUMP_DETAIL,module:(O=G[de])==null?void 0:O.id,props:{holder:e}}):null,q=re(b),pe=j?o.jsx(Ps,{color:k,children:d(q.summary)}):null,X=u.useCallback(()=>{e.sortedPumps.length>0&&(x==="technician"?h(!0):j&&(t==null||t(e)))},[j,e,t,x]);return o.jsxs(o.Fragment,{children:[o.jsx(a.HolderDashboardCard,{avatar:ce,backgroundColor:P,body:j?null:o.jsx(a.StatusIndicator,{size:"small",status:j?"pending":"completed"}),footer:pe,cardId:e.path,errors:C,title:W,showNavIcon:n,onCardSelect:X},e.path),o.jsx(a.Modal,{contain:i!=="compact",...Te,show:g,onClose:()=>h(!1),children:o.jsxs(Ss,{children:[o.jsx(a.Header,{contain:i==="compact",showCloseButton:!0,title:le,onClose:()=>h(!1),CloseButton:i==="compact"?a.BackButton:void 0}),Ie]})}),(b==null?void 0:b.future)&&o.jsx(D,{title:le,future:b==null?void 0:b.future})]})}),Ds=l.kosComponent(({holders:e,showNavIcons:t,...n})=>o.jsx(dt,{...n,children:e.map(s=>{const r=s.troubles[0];return o.jsx(xn,{holder:s,showNavIcon:t,onHolderSelect:()=>{r.resolvable&&r.resolve()}},s.id)})})),As=y(_.MessageInformationIconWithBackground)`
|
|
204
204
|
width: var(--ddk-component-macro-card-unavailable-icon-size);
|
|
205
205
|
height: var(--ddk-component-macro-card-unavailable-icon-size);
|
|
206
|
-
`,
|
|
206
|
+
`,Fs=y(a.UtilityModalHeading)`
|
|
207
207
|
text-align: center;
|
|
208
208
|
font-size: var(--ddk-component-sub-modal-heading-font-size-medium);
|
|
209
|
-
`,
|
|
209
|
+
`,Ls=y.div`
|
|
210
210
|
height: 100%;
|
|
211
211
|
overflow-y: auto;
|
|
212
212
|
width: 100%;
|
|
213
|
-
`,
|
|
213
|
+
`,Es=y.div`
|
|
214
214
|
display: grid;
|
|
215
215
|
gap: var(--ddk-component-macro-setup-card-gap);
|
|
216
216
|
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
justify-content: center;
|
|
221
221
|
width: 100%;
|
|
222
222
|
user-select: none;
|
|
223
|
-
`,
|
|
223
|
+
`,Bs=e=>{const{componentModeOverride:t}=a.useComponentConfigurationContext();return o.jsx(Es,{compact:t==="compact",...e})},Ms=y.div`
|
|
224
224
|
align-items: center;
|
|
225
225
|
|
|
226
226
|
background: ${e=>e.selected?"var(--ddk-generic-color-grey-5)":"var(--ddk-generic-color-white)"};
|
|
@@ -243,23 +243,28 @@
|
|
|
243
243
|
overflow-wrap: anywhere;
|
|
244
244
|
padding: var(--ddk-component-macro-setup-card-header-padding-md);
|
|
245
245
|
text-align: center;
|
|
246
|
-
`,
|
|
246
|
+
`,Ks=y.div`
|
|
247
247
|
align-items: center;
|
|
248
248
|
display: flex;
|
|
249
249
|
flex-direction: column;
|
|
250
250
|
gap: 32px;
|
|
251
251
|
height: 100%;
|
|
252
252
|
justify-content: center;
|
|
253
|
-
`,
|
|
253
|
+
`,Rs=y.div`
|
|
254
254
|
color: var(--ddk-component-macro-card-unavailable-font-color);
|
|
255
255
|
font-size: var(--ddk-component-macro-card-unavailable-font-size);
|
|
256
256
|
font-weight: var(--ddk-component-macro-card-unavailable-font-weight);
|
|
257
|
-
`,
|
|
257
|
+
`,ut=tn(({holder:e,onComplete:t,macroAssignment:n,showCloseButton:s=!0})=>{const{t:r}=l.useKosTranslation("setup"),{t:c}=l.useKosTranslation("common"),{componentModeOverride:d}=a.useComponentConfigurationContext(),[i,p]=u.useState(e.ingredient),m=y.div`
|
|
258
258
|
display: flex;
|
|
259
259
|
flex-direction: column;
|
|
260
260
|
gap: 24px;
|
|
261
261
|
height: 100%;
|
|
262
|
-
`;return
|
|
262
|
+
`;return o.jsxs(m,{children:[o.jsx(a.Content,{children:n.hasMacroIngredients?o.jsxs(o.Fragment,{children:[d==="standard"&&o.jsx(Fs,{children:r("select-and-assign-ingredients-for",{data:{name:c(`macros.${e.name}`)}})}),o.jsx(Ls,{children:o.jsx(Bs,{children:n.macroIngredients.map(x=>o.jsx(Ms,{selected:(i==null?void 0:i.id)===x.id,onPointerDown:()=>{i===x||p(x)},children:x.name},x.id))})})]}):o.jsxs(Ks,{children:[o.jsx(As,{}),o.jsx(Rs,{children:r("no-ingredients-available-for-assignment")})]})}),o.jsx(a.Footer,{children:n.hasMacroIngredients?o.jsxs(o.Fragment,{children:[d==="standard"&&s&&o.jsx(a.Button,{onPointerDown:()=>{t==null||t()},children:c("close")}),o.jsx(a.Button,{mode:"primary",disabled:!i||i.id===e.ingredientId,onPointerDown:async()=>{await e.assignIngredient(i==null?void 0:i.id),t==null||t()},children:c("assignIngredient")})]}):s!==!1&&o.jsx(a.Button,{mode:"primary",onPointerDown:()=>{t==null||t()},children:c("proceed")})})]})}),Ns=y.div`
|
|
263
|
+
display: flex;
|
|
264
|
+
flex-direction: column;
|
|
265
|
+
gap: 24px;
|
|
266
|
+
padding: 24px;
|
|
267
|
+
`,$s=Fe.withAssembly(({assembly:e,showHeading:t})=>o.jsx(hn,{iceAgitator:e.iceAgitator,showHeading:t})),hn=l.kosComponent(({iceAgitator:e,showHeading:t})=>{const{t:n}=l.useKosTranslation("about"),s=yt.useLocation(),{componentModeOverride:r}=a.useComponentConfigurationContext(),c=(e==null?void 0:e.iceTypes.map(i=>({id:i,label:i})))||[],d=u.useCallback(async()=>{(e==null?void 0:e.type.value)!==void 0&&(e==null||e.updateIceType(e.type.value))},[e]);return e?o.jsxs(a.TabContainer,{children:[t&&o.jsx(a.SettingsSubheading,{children:n("ice-settings","Ice Settings")}),r==="compact"?o.jsx(Ut,{configProperty:e.type,onChange:i=>e.updateIceType(i),options:c,label:n("ice-type","Ice Type")}):o.jsx(Ce,{configProperty:e.type,onSave:i=>e.updateIceType(i),items:c,label:n("ice-type","Ice Type")||void 0}),o.jsx(H,{configProperty:e.durationSec,label:n("agitation-duration","Agitation duration")||void 0}),o.jsx(H,{configProperty:e.inactivitySec,label:n("agitate-inactivity","Agitate after inactivity")||void 0}),o.jsx(H,{configProperty:e.volWithoutIceMl,label:n("agitate-without-ice","Agitate after poured without ice")||void 0}),r!=="compact"&&(s==null?void 0:s.pathname.includes("/settings"))&&o.jsx(a.Footer,{children:o.jsx(a.Button,{onPointerDown:d,children:n("reset")})})]}):"Ice model not loaded..."}),Os=l.kosComponent(({cardModel:e})=>{l.KosLog.debug("Agitator",e.path);const{t}=l.useKosTranslation(["agitator","common"]),n=u.useCallback(r=>{r==="agitate"?e==null||e.testAgitate():r==="gate"?e==null||e.testGate():r==="pour"?e==null||e.pourIce():r==="cancelPour"&&(e==null||e.cancelIceDispense())},[e]),s=e.isAgitating||e.isIceChuteOpen;return o.jsxs(o.Fragment,{children:[o.jsxs(a.Content,{children:[o.jsx(a.FrameContainer,{name:"Ice Properties",children:o.jsxs(Vs,{children:[o.jsxs(Ct,{children:[o.jsxs(he,{children:[o.jsx(a.Label,{children:"Agitation Duration:"}),o.jsx(Z,{children:e.durationSec.displayValue})]}),o.jsxs(he,{children:[o.jsx(a.Label,{children:"Ice Max Dispense:"}),o.jsx(Z,{children:e.maxDispenseSec.displayValue})]}),o.jsxs(he,{children:[o.jsx(a.Label,{children:"Agitate After:"}),o.jsxs(Z,{children:[e.inactivitySec.displayValue," Inactive"]}),o.jsxs(Z,{children:[e.volWithoutIceMl.displayValue," Poured without ice"]})]})]}),o.jsx(Ct,{children:o.jsxs(he,{children:[o.jsx(a.Label,{children:"Ice Type:"}),o.jsx(Z,{children:e.type.displayValue})]})})]})}),o.jsx(a.InfoCard,{label:"Agitating",value:e.isAgitating?t("common:yes"):t("common:no")}),o.jsx(a.InfoCard,{label:"Ice Chute Open",value:e.isIceChuteOpen?t("common:yes"):t("common:no")})]}),o.jsxs(a.Footer,{children:[o.jsx(a.Button,{disabled:s,onPointerDown:()=>n("agitate"),children:t("action.label",{context:"agitator"})}),o.jsx(a.Button,{disabled:s,onPointerDown:()=>n("gate"),children:t("action.label",{context:"gate"})}),o.jsx(a.Button,{disabled:s,onPointerUp:()=>n("cancelPour"),onPointerDown:()=>n("pour"),children:t("action.label",{context:"pour"})})]}),e.agitateFuture&&o.jsx(D,{title:t("testing"),future:e.agitateFuture}),e.gateFuture&&o.jsx(D,{title:t("testing"),future:e.gateFuture})]})}),Vs=y.div`
|
|
263
268
|
display: flex;
|
|
264
269
|
flex-direction: row;
|
|
265
270
|
align-items: center;
|
|
@@ -268,7 +273,7 @@
|
|
|
268
273
|
height: 100%;
|
|
269
274
|
gap: 10px;
|
|
270
275
|
padding-block: 16px;
|
|
271
|
-
`,
|
|
276
|
+
`,Ct=y.div`
|
|
272
277
|
display: flex;
|
|
273
278
|
flex-direction: column;
|
|
274
279
|
align-items: flex-start;
|
|
@@ -278,21 +283,16 @@
|
|
|
278
283
|
padding-inline: 16px;
|
|
279
284
|
|
|
280
285
|
gap: 10px;
|
|
281
|
-
`,
|
|
286
|
+
`,he=y.div`
|
|
282
287
|
display: flex;
|
|
283
288
|
flex-direction: column;
|
|
284
289
|
width: 100%;
|
|
285
|
-
`,
|
|
290
|
+
`,Z=y(a.Text)`
|
|
286
291
|
color: var(--ddk-generic-color-grey-60);
|
|
287
|
-
`,
|
|
292
|
+
`,Hs=y.div`
|
|
288
293
|
font-size: var(--ddk-component-holder-card-footer-font-size);
|
|
289
294
|
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
290
|
-
`,
|
|
291
|
-
display: flex;
|
|
292
|
-
flex-direction: column;
|
|
293
|
-
gap: 24px;
|
|
294
|
-
padding: 24px;
|
|
295
|
-
`,Bs=Ie.withAssembly(({assembly:e,showHeading:t})=>n.jsx(lo,{iceAgitator:e.iceAgitator,showHeading:t})),lo=l.kosComponent(({iceAgitator:e,showHeading:t})=>{const{t:o}=l.useKosTranslation("about"),s=ht.useLocation(),{componentModeOverride:r}=a.useComponentConfigurationContext(),c=(e==null?void 0:e.iceTypes.map(i=>({id:i,label:i})))||[],d=u.useCallback(async()=>{(e==null?void 0:e.type.value)!==void 0&&(e==null||e.updateIceType(e.type.value))},[e]);return e?n.jsxs(a.TabContainer,{children:[t&&n.jsx(a.SettingsSubheading,{children:o("ice-settings","Ice Settings")}),r==="compact"?n.jsx(Ot,{configProperty:e.type,onChange:i=>e.updateIceType(i),options:c,label:o("ice-type","Ice Type")}):n.jsx(he,{configProperty:e.type,onSave:i=>e.updateIceType(i),items:c,label:o("ice-type","Ice Type")||void 0}),n.jsx(V,{configProperty:e.durationSec,label:o("agitation-duration","Agitation duration")||void 0}),n.jsx(V,{configProperty:e.inactivitySec,label:o("agitate-inactivity","Agitate after inactivity")||void 0}),n.jsx(V,{configProperty:e.volWithoutIceMl,label:o("agitate-without-ice","Agitate after poured without ice")||void 0}),r!=="compact"&&(s==null?void 0:s.pathname.includes("/settings"))&&n.jsx(a.Footer,{children:n.jsx(a.Button,{onPointerDown:d,children:o("reset")})})]}):"Ice model not loaded..."}),Ks=l.kosComponent(({showHeading:e})=>{var p,m,x,g,f,h,w,S;const{t}=l.useKosTranslation("region"),{model:o}=ve(),{regionModel:s}=l.useKosRegions(),r=u.useCallback(y=>({id:y,label:t(`locale.country.${y}`)}),[t]),{selectedRegion:c,updateRegion:d,regionSelectProps:i}=l.useKosRegions(r);return n.jsxs(a.TabContainer,{children:[e&&n.jsx(a.SettingsSubheading,{children:t("localization","Localization")}),n.jsx(a.PickerCard,{cancelButtonLabel:t("discard-changes","Discard Changes")||void 0,closeButtonLabel:t("close","Close")||void 0,displayValue:t(`locale.country.${c}`)||void 0,items:i.options,label:t("country","Country"),loop:!1,onSave:y=>d(y),proceedButtonLabel:t("save","Save")||void 0,selectedItemId:c}),((p=s==null?void 0:s.unitSystemOptions)==null?void 0:p.length)&&n.jsx(a.SwitchCard,{label:t("units-of-measurement","Units of Measurement"),options:(m=s==null?void 0:s.unitSystemOptions)==null?void 0:m.map(y=>({id:y.id,label:`${t(`locale.unit.${y.id}`)}/${t(`locale.units.${y.id}`)}`})),onChange:y=>s==null?void 0:s.setSelectedUnitSystem(String(y)),value:String(s==null?void 0:s.selectedUnitSystem).toLowerCase()}),n.jsx(a.PickerCard,{cancelButtonLabel:t("discard-changes","Discard Changes")||void 0,closeButtonLabel:t("close","Close")||void 0,displayValue:(x=o==null?void 0:o.ncuiLanguage)!=null&&x.displayValue?t(`locale-ncui-language.${(g=o==null?void 0:o.ncuiLanguage)==null?void 0:g.displayValue}`):void 0,items:(w=(h=(f=o==null?void 0:o.ncuiLanguageData)==null?void 0:f.data)==null?void 0:h.languages)==null?void 0:w.map(({locale:y,name:k})=>({id:y,label:k})),label:t("non-consumer-language","Non-Consumer Language"),loop:!1,onSave:y=>{var k;return(k=o==null?void 0:o.ncuiLanguage)==null?void 0:k.updateProperty(y)},proceedButtonLabel:t("save","Save")||void 0,selectedItemId:(S=o==null?void 0:o.ncuiLanguage)==null?void 0:S.displayValue})]})});v.div`
|
|
295
|
+
`,_s=l.kosComponent(e=>{l.KosLog.debug(`summary component loaded for holder ${e}`),l.KosLog.info(`render agitator summary for holder ${e.cardModel.path}`);const{t}=l.useKosTranslation("common");return o.jsxs(o.Fragment,{children:[o.jsx(a.StatusIndicator,{size:"small",status:"completed"}),e.cardModel.isAgitating&&o.jsx(Hs,{children:t("agitating")})]})}),Us=l.kosComponent(({showHeading:e})=>{var p,m,x,g,h,f,C,b;const{t}=l.useKosTranslation("region"),{model:n}=ye(),{regionModel:s}=l.useKosRegions(),r=u.useCallback(j=>({id:j,label:t(`locale.country.${j}`)}),[t]),{selectedRegion:c,updateRegion:d,regionSelectProps:i}=l.useKosRegions(r);return o.jsxs(a.TabContainer,{children:[e&&o.jsx(a.SettingsSubheading,{children:t("localization","Localization")}),o.jsx(a.PickerCard,{cancelButtonLabel:t("discard-changes","Discard Changes")||void 0,closeButtonLabel:t("close","Close")||void 0,displayValue:t(`locale.country.${c}`)||void 0,items:i.options,label:t("country","Country"),loop:!1,onSave:j=>d(j),proceedButtonLabel:t("save","Save")||void 0,selectedItemId:c}),((p=s==null?void 0:s.unitSystemOptions)==null?void 0:p.length)&&o.jsx(a.SwitchCard,{label:t("units-of-measurement","Units of Measurement"),options:(m=s==null?void 0:s.unitSystemOptions)==null?void 0:m.map(j=>({id:j.id,label:`${t(`locale.unit.${j.id}`)}/${t(`locale.units.${j.id}`)}`})),onChange:j=>s==null?void 0:s.setSelectedUnitSystem(String(j)),value:String(s==null?void 0:s.selectedUnitSystem).toLowerCase()}),o.jsx(a.PickerCard,{cancelButtonLabel:t("discard-changes","Discard Changes")||void 0,closeButtonLabel:t("close","Close")||void 0,displayValue:(x=n==null?void 0:n.ncuiLanguage)!=null&&x.displayValue?t(`locale-ncui-language.${(g=n==null?void 0:n.ncuiLanguage)==null?void 0:g.displayValue}`):void 0,items:(C=(f=(h=n==null?void 0:n.ncuiLanguageData)==null?void 0:h.data)==null?void 0:f.languages)==null?void 0:C.map(({locale:j,name:P})=>({id:j,label:P})),label:t("non-consumer-language","Non-Consumer Language"),loop:!1,onSave:j=>{var P;return(P=n==null?void 0:n.ncuiLanguage)==null?void 0:P.updateProperty(j)},proceedButtonLabel:t("save","Save")||void 0,selectedItemId:(b=n==null?void 0:n.ncuiLanguage)==null?void 0:b.displayValue})]})});y.div`
|
|
296
296
|
display: flex;
|
|
297
297
|
font-size: var(--ddk-generic-font-size-x-small);
|
|
298
298
|
font-weight: normal;
|
|
@@ -326,11 +326,11 @@
|
|
|
326
326
|
display: flex;
|
|
327
327
|
justify-content: flex-end;
|
|
328
328
|
}
|
|
329
|
-
`;const
|
|
329
|
+
`;const zs=y.div`
|
|
330
330
|
display: flex;
|
|
331
331
|
align-items: center;
|
|
332
332
|
justify-content: flex-end;
|
|
333
|
-
`,
|
|
333
|
+
`,Ws=({item:e,valueKey:t})=>{const{label:n,value:s}=e;if(t==="label")return o.jsx("div",{children:o.jsx("b",{children:n})});if(t==="value")return o.jsx(zs,{children:s})},Gs=({groupName:e,networkTestContainer:t})=>{var s;const{t:n}=l.useKosTranslation("connectivity");return((s=t==null?void 0:t.models.getIndexByKey("group",e))==null?void 0:s.map(r=>{const c=e==="interface",d=c?r.results.map(i=>({label:i.name,value:i.val})):[];return c?o.jsx(a.Table,{CellRenderer:Ws,data:d,dataKeys:["label","value"],heading:r.name}):o.jsx(a.StatusCard,{leftLabel:n(`${r.name}`),rightLabel:r.inProgress?n("inProgress"):r.timestamp?r.passed?n("success"):n("Fail"):n("testNotRun"),type:r.inProgress?"InProgress":r.timestamp?r.passed?"Success":"Fail":"Default",failureMessage:n("failureMessage"),lastSuccess:r==null?void 0:r.timestamp,lastSuccessful:n("lastSuccessful")},r.id)}))||[]},qs=nn(Gs),Xs=y.div`
|
|
334
334
|
background-color: var(--ddk-generic-color-grey-80);
|
|
335
335
|
color: var(--ddk-generic-color-grey-5);
|
|
336
336
|
border-radius: 5px;
|
|
@@ -339,43 +339,58 @@
|
|
|
339
339
|
align-items: center;
|
|
340
340
|
justify-content: center;
|
|
341
341
|
font-size: var(--ddk-generic-font-size-xx-small);
|
|
342
|
-
`,
|
|
342
|
+
`,fn=l.kosComponent(({showAction:e=!0,trouble:t,showHolder:n})=>{var j;const{t:s}=l.useKosTranslation(["troubles"]),{model:r}=je(),c=r==null?void 0:r.currentRole,d=we(t),{action:i,label:p,progress:m}=re(t),x=t.resolvable??!1,{future:g}=K(t),h=(j=t==null?void 0:t.data)!=null&&j.holderNames&&t.data.holderNames.length>0?o.jsx(Xs,{children:t.data.holderNames[0]}):null,f=(t==null?void 0:t.color)??"orange",C=(t==null?void 0:t.shouldDefer)??!1,b=(t==null?void 0:t.deferred)??!1;return o.jsxs(o.Fragment,{children:[o.jsx(a.NotificationCard,{label:s(p,{context:c==null?void 0:c.toLowerCase(),data:d}),indicatorColor:f,buttonLabel:e?b?"Queued":C?"Queue":s(i,{context:c,defaultValue:""}):void 0,date:t.createTime,prefix:n?h:void 0,onAction:e&&x&&!b?()=>{t.resolve()}:void 0}),g&&o.jsx(D,{title:s(m,{context:c}),future:b?void 0:g,failureMessage:s(`troubles.${t.type}.error`,{context:g!=null&&g.reason?"reason":void 0,data:{reason:g!=null&&g.reason?`__troubles.errors.${g==null?void 0:g.reason}__`:void 0}})})]})}),Ys=({viewContainerId:e,extensionPointId:t,tabs:n,...s})=>{const{getExtensions:r}=N.useKosPluginsContext(),c=r(e),d=r(t).reduce((g,h)=>(g[h.id]=h,g),{}),i=c.map(g=>g.data.namespace),{t:p}=l.useKosTranslation(["",...new Set(i)]),m=c.map(g=>{const h=[...g.data.settings].map(f=>{const C=d[f];return o.jsxs(a.TabContainer,{children:[o.jsx(a.SettingsSubheading,{children:p(`${C.data.namespace}:${C.data.title}`)}),o.jsx(N.DynamicComponent,{extension:t,module:f})]},C.id)});return{id:g.id,label:p(`${g.data.namespace}:${g.data.title}`),content:o.jsx(a.TabViewLayout,{children:h})}}),x=[...n,...m];return o.jsx(a.TabRouter,{...s,tabs:x})},Se=l.kosComponent(({holder:e})=>{const{t}=l.useKosTranslation("common"),{componentModeOverride:n}=a.useComponentConfigurationContext(),s=n==="compact",{visibleTroubles:r,initialized:c}=z(e),i=((r==null?void 0:r.length)??0)>0,p=!!e.troublesByType.FlushTrouble,m=!!e.troublesByType.PrimeTrouble,x=!!e.troublesByType.PurgeTrouble,g=p?e.troublesByType.FlushTrouble[0]:m?e.troublesByType.PrimeTrouble[0]:x?e.troublesByType.PurgeTrouble[0]:null,h=(g==null?void 0:g.shouldDefer)??!1,f=(g==null?void 0:g.deferred)??!1,[C,b]=ne(e),j=u.useCallback(P=>{h?g==null||g.resolve():b(P)},[b,h,g]);return i&&c&&s?o.jsxs(o.Fragment,{children:[p?o.jsx(a.Button,{disabled:f,mode:"primary",onPointerDown:()=>j("flush"),children:t("flush",{context:f?"queued":""})}):x?o.jsx(a.Button,{disabled:f,mode:"primary",onPointerDown:()=>j("purge"),children:t("purge",{context:f?"queued":""})}):m?o.jsx(a.Button,{disabled:f,mode:"primary",onPointerDown:()=>j("prime"),children:t("prime",{context:f?"queued":""})}):null,C&&o.jsx(D,{...C})]}):null}),$=({holder:e,filter:t})=>{const{componentModeOverride:n}=a.useComponentConfigurationContext(),s=n==="standard",{visibleTroubles:r,initialized:c}=z(e),d=t?r==null?void 0:r.filter(t):r;return((d==null?void 0:d.length)??0)>0&&c&&(r==null?void 0:r.map(m=>o.jsx(fn,{showAction:s,trouble:m},m.id)))},Zs=l.kosComponent(({holder:e})=>{const{t}=l.useKosTranslation("common"),[n,s]=ne(e),[r,c]=u.useState();u.useEffect(()=>{async function h(){if(e.ingredientId!==void 0){const f=await e.resolveIntentVolume("CALIBRATE");c(Math.round(f.volume))}}h()},[e,e.ingredientId]);const d=e.ingredientId!==void 0,i=r&&r>0,{holderExperience:p,setHolderExperience:m,currentExperienceId:x}=se(e);return d||x==="replace-line"?o.jsxs(o.Fragment,{children:[o.jsx(a.Content,{contain:!0,children:o.jsx($,{holder:e})}),o.jsxs(a.Footer,{children:[o.jsx(a.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?t("intentPour",{data:{volume:r}}):t("calibrate")}),o.jsx(a.Button,{onPointerDown:()=>m("replace-line"),children:t("replace-line")}),o.jsx(U,{disabled:!d,model:e}),o.jsx(Se,{holder:e})]}),o.jsx(u.Suspense,{children:p}),n&&o.jsx(D,{...n})]}):o.jsx(ut,{showCloseButton:!1,holder:e})}),Qs=l.kosComponent(({holder:e})=>{const{t}=l.useKosTranslation("common"),[n,s]=ne(e),[r,c]=u.useState();u.useEffect(()=>{async function p(){if(e.ingredientId!==void 0){const m=await e.resolveIntentVolume("CALIBRATE");c(Math.round(m.volume))}}p()},[e,e.ingredientId]);const d=e.ingredientId!==void 0,i=r&&r>0;return d?o.jsxs(o.Fragment,{children:[o.jsx(a.Content,{contain:!0,children:o.jsx($,{holder:e})}),o.jsxs(a.Footer,{children:[o.jsx(a.Button,{disabled:!i,onPointerDown:()=>s("calibrate"),children:i?t("intentPour",{data:{volume:r}}):t("calibrate")}),o.jsx(U,{disabled:!d,model:e}),o.jsx(Se,{holder:e})]}),n&&o.jsx(D,{...n})]}):o.jsx(ut,{showCloseButton:!1,holder:e})}),Js=y.div`
|
|
343
|
+
display: flex;
|
|
344
|
+
flex-direction: column;
|
|
345
|
+
gap: var(--ddk-component-super-pump-container-gap);
|
|
346
|
+
`,er=y.div`
|
|
347
|
+
display: flex;
|
|
348
|
+
flex-direction: column;
|
|
349
|
+
gap: var(--ddk-component-cartridge-container-gap);
|
|
350
|
+
`,bn=l.kosComponent(({holder:e})=>{const t=J.useFreestyleAssemblyContext(),{t:n}=l.useKosTranslation("common"),[s,r]=u.useState("all"),c=t==null?void 0:t.cartridgeAgitatorModels[0],d=!!e.ingredientId,i=e.pumps.getModel(s),p=l.getKosCompanionModel(e,J.FreestyleHolder.type),m=!!(p!=null&&p.agitated),{holderExperience:x,setHolderExperience:g}=se(e,i),h=u.useCallback(P=>{r(P.id)},[]),f=e.hasFuelGuage,C=e.fillPercent,{future:b}=K(c),j=u.useCallback(P=>P.data.pumpPath===(i==null?void 0:i.path),[i==null?void 0:i.path]);return o.jsxs(o.Fragment,{children:[o.jsxs(Js,{children:[o.jsxs(a.Content,{contain:!0,children:[d&&f&&o.jsxs(er,{children:[o.jsx(a.FuelGauge,{size:"large",value:C,showBarsOverride:!0}),o.jsx(Xe,{holder:e})]}),o.jsx(a.Tabs,{activeTab:s,contain:!1,tabs:[{id:"all",label:n("all"),content:o.jsx($,{holder:e})},...e.pumps.data.filter(P=>!P.virtual).map(P=>({id:P.id,label:n(`macros.${P.name}`),content:o.jsx($,{holder:P,filter:j})}))],onChange:h,showBackground:!1})]}),o.jsxs(a.Footer,{children:[i?o.jsxs(o.Fragment,{children:[o.jsx(a.Button,{onPointerDown:()=>g("replace-pump"),children:n("replace-pump")}),o.jsx(a.Button,{onPointerDown:()=>g("calibrateSPM"),children:n("calibrate")})]}):o.jsxs(o.Fragment,{children:[!d&&o.jsx(a.Button,{onPointerDown:()=>g("rfid-override"),children:n("rfid-override")}),o.jsx(a.Button,{onPointerDown:()=>g("replace-line"),children:n("replace-line")}),m&&o.jsx(a.Button,{onPointerDown:()=>c==null?void 0:c.testAgitate(),children:n("agitate")})]}),o.jsx(U,{disabled:!d,model:i||e})]})]}),o.jsx(u.Suspense,{children:x}),b&&o.jsx(D,{title:n("agitating"),future:b})]})}),tr=l.kosComponent(({holder:e})=>o.jsxs(o.Fragment,{children:[o.jsx($,{holder:e}),o.jsxs(a.Footer,{children:[o.jsx(U,{model:e}),o.jsx(Se,{holder:e})]})]})),nr=l.kosComponent(({holder:e})=>{const{t}=l.useKosTranslation("common"),[n,s]=ne(e),{holderExperience:r,setHolderExperience:c}=se(e);return o.jsxs(o.Fragment,{children:[o.jsx($,{holder:e}),o.jsxs(a.Footer,{children:[o.jsx(U,{model:e}),o.jsx(a.Button,{onPointerDown:()=>s("high-flow-test"),children:t("high-flow-test")}),o.jsx(a.Button,{onPointerDown:()=>s("low-flow-test"),children:t("low-flow-test")}),o.jsx(a.Button,{onPointerDown:()=>c("diagnostics"),children:t("diagnostics")}),o.jsx(a.Button,{onPointerDown:()=>c("calibrate"),children:t("calibrate")})]}),o.jsx(u.Suspense,{children:r}),n&&o.jsx(D,{...n})]})}),or=y.section`
|
|
343
351
|
align-items: center;
|
|
344
352
|
display: flex;
|
|
345
353
|
flex-direction: column;
|
|
346
354
|
gap: 32px;
|
|
347
355
|
height: 100%;
|
|
348
356
|
justify-content: space-between;
|
|
349
|
-
`,
|
|
357
|
+
`,sr=y.div`
|
|
350
358
|
display: flex;
|
|
351
359
|
gap: 32px;
|
|
352
360
|
flex-direction: column;
|
|
353
361
|
align-items: center;
|
|
354
362
|
padding: 32px;
|
|
355
|
-
`,
|
|
363
|
+
`,rr=y.div`
|
|
356
364
|
display: flex;
|
|
357
365
|
flex-direction: column;
|
|
358
366
|
gap: 12px;
|
|
359
367
|
text-align: center;
|
|
360
|
-
`,
|
|
368
|
+
`,ir=({onComplete:e})=>{const{t}=l.useKosTranslation("reboot"),[n,s]=u.useState(!1),{model:r}=ve(),{componentModeOverride:c}=a.useComponentConfigurationContext();return o.jsxs(a.Modal,{show:!n,onClose:()=>s(!0),onClosed:e,contain:c!=="compact",children:[c==="compact"&&o.jsx(a.Header,{title:t("reboot"),showCloseButton:!0,onClose:()=>s(!0),CloseButton:a.CompactCloseButton}),o.jsxs(or,{children:[o.jsxs(sr,{children:[o.jsx(a.QuestionIconStyle,{}),o.jsx(rr,{children:o.jsx(a.UtilityModalHeading,{children:t("modal-heading","Are you sure you want to reboot dispenser?")})})]}),o.jsx(a.CancelProceedFooter,{cancelLabel:`${t("cancel","Cancel")}`,proceedLabel:`${t("reboot","Reboot")}`,onCancel:()=>s(!0),onProceed:()=>r==null?void 0:r.completeReboot()})]})]})},Q=y(a.LabelInformation)`
|
|
369
|
+
text-align: center;
|
|
370
|
+
`,ar=l.kosComponent(({remoteTray:e,onComplete:t})=>{const{t:n}=l.useKosTranslation("common",{keyPrefix:"remote-nns"}),[s,r]=u.useState("idle"),[c,d]=u.useState({}),[i,p]=u.useState({}),x=e.holder.pumps.data.filter(T=>T.childPump),g=e.remoteTrayEnabled.value===!0,h=()=>x.every(T=>{const k=c[T.name];return k!=null&&k!==""}),f=u.useCallback((T,k)=>{d(w=>({...w,[T]:k}))},[]),C=u.useCallback(T=>(k="")=>{f(T,k)},[f]),b=u.useCallback(async()=>{e.remoteTrayEnabled.updateProperty(!g),r(g?"disableSuccess":"success")},[g,e.remoteTrayEnabled]),j=u.useCallback(async()=>{r("progress"),p({});let T=!1;await Promise.all(x.map(async k=>{try{const w=l.getKosCompanionModel(k,J.FreestylePump.type),[v]=await w.replacePump(c[k.name]);v&&(p(A=>({...A,[k.name]:v})),T=!0)}catch(w){console.error(w),p(v=>({...v,[k.name]:"unknownError"})),T=!0}})),T?r("pump"):b()},[g,c,x,e.remoteTrayEnabled,b]),P=u.useMemo(()=>({idle:{title:n(g?"disable-title":"idle-title"),information:o.jsx(Q,{children:n(g?"disable-info":"idle-info")}),footer:o.jsx(a.Button,{onPointerDown:()=>{g?b():r("pump")},children:n(g?"disable":"enable")}),status:"information"},pump:{title:n("pump-title"),information:o.jsxs(o.Fragment,{children:[o.jsx(Q,{children:n("pump-info")}),x.map(T=>o.jsx(a.ErrorInputCard,{layout:"hex",description:i[T.name]?n(`errors.${i[T.name]}`):"",value:c[T.name]??"",label:n(`pumps.${T.name}`),onChange:C(T.name)},T.name))]}),footer:o.jsxs(o.Fragment,{children:[o.jsx(a.Button,{disabled:!h(),onPointerDown:j,children:n("enter")}),o.jsx(a.Button,{onPointerDown:t,children:n("cancel")})]})},progress:{title:n("progress-title"),information:o.jsx(Q,{children:n("progress-info")}),status:"loading"},success:{title:n("success-title"),information:o.jsx(Q,{children:n("success-info")}),status:"success"},disableSuccess:{title:n("disable-success-title"),information:o.jsx(Q,{children:n("disable-success-info")}),status:"success"}}),[f,g,t,c,i,x,j,n]);return o.jsx(a.WorkflowModal,{...P[s],onClose:()=>t()})}),cr=l.kosComponent(({cardModel:e})=>(l.KosLog.debug("RemoteTray",e.name),o.jsx(bn,{holder:e.holder}))),lr=y.div`
|
|
371
|
+
font-size: var(--ddk-component-holder-card-footer-font-size);
|
|
372
|
+
color: ${e=>e.color??"var(--ddk-generic-color-black)"};
|
|
373
|
+
position: absolute;
|
|
374
|
+
bottom: 6px;
|
|
375
|
+
`,dr=l.kosComponent(e=>{l.KosLog.debug(`summary component loaded for holder ${e}`),l.KosLog.info(`render agitator summary for holder ${e.cardModel.name}`);const{t}=l.useKosTranslation("troubles"),n=e.cardModel,{hasTroubles:s,highestTrouble:r}=dn(n),c=re(r),d=we(r);return s?o.jsx(lr,{children:t(c.summary,{context:r!=null&&r.deferred?"queued":void 0,data:d})}):o.jsx(a.StatusIndicator,{size:"small",status:"completed"})}),Cn=l.kosComponent(({holder:e,onComplete:t})=>{const{t:n}=l.useKosTranslation("replace-line"),[s,r]=u.useState(),[c,d]=u.useState();u.useEffect(()=>{e.replaceLine().then(()=>{r("success")})},[e]);const i=()=>{if(c){r(void 0);return}t()};return o.jsx(a.StatusBar,{show:s!==void 0,onClose:i,children:s==="failure"?o.jsx(ee,{children:n(c||"unknownError")}):s==="success"?o.jsx(fe,{children:n("success")}):null})}),ur=y.div`
|
|
361
376
|
display: flex;
|
|
362
377
|
flex-direction: column;
|
|
363
378
|
overflow-y: auto;
|
|
364
379
|
overflow-x: hidden;
|
|
365
380
|
gap: 32px;
|
|
366
381
|
height: 100%;
|
|
367
|
-
`,
|
|
382
|
+
`,vn=l.kosComponent(({pump:e,onComplete:t})=>{const[n,s]=u.useState(!1),{t:r}=l.useKosTranslation("replace-pump"),{componentModeOverride:c}=a.useComponentConfigurationContext(),[d,i]=u.useState(),[p,m]=u.useState(),[x,g]=u.useState(),h=l.getKosCompanionModel(e,J.FreestylePump.type),f=e.name,C=u.useCallback(P=>{if(P!==void 0&&P.length===0)return r("pump-calibration-length-error")},[r]),b=u.useCallback(async()=>{if(d===void 0)return;const[P]=await h.replacePump(d);P?(m("failure"),g(P)):m("success")},[h,d]),j=()=>{if(x){m(void 0);return}s(!0)};return o.jsxs(o.Fragment,{children:[o.jsx(a.Modal,{contain:c!=="compact",onClosed:t,show:!n,children:o.jsxs(ur,{children:[o.jsx(a.Header,{contain:c==="compact",showCloseButton:!0,title:f?r("label-replace-pump",{label:f}):r("replace-pump"),showOpenButton:!1,onClose:()=>s(!0),CloseButton:c==="compact"?a.BackButton:void 0}),o.jsx(a.Content,{align:"top",children:o.jsx(a.InputCard,{isValid:C,label:r("enter-pump-calibration-code"),layout:"hex",value:d,onChange:P=>{g(void 0),i(P)}})}),o.jsx(a.Footer,{children:o.jsx(a.Button,{mode:"primary",disabled:!d||!!x,onPointerDown:b,children:r("replace-pump")})})]})}),o.jsx(a.StatusBar,{show:p!==void 0,onClose:j,children:p==="failure"?o.jsx(ee,{children:r(x||"unknownError")}):p==="success"?o.jsx(fe,{children:r("success")}):null})]})}),pr=/^[0-9a-fA-F]+$/,vt=e=>pr.test(e),mr=y.div`
|
|
368
383
|
display: flex;
|
|
369
384
|
flex-direction: column;
|
|
370
385
|
overflow-y: auto;
|
|
371
386
|
overflow-x: hidden;
|
|
372
387
|
height: 100%;
|
|
373
|
-
`,
|
|
388
|
+
`,yn=l.kosComponent(({holder:e,onComplete:t})=>{const n=e.name,[s,r]=u.useState(!1),{t:c}=l.useKosTranslation("rfid-override"),{componentModeOverride:d}=a.useComponentConfigurationContext(),[i,p]=u.useState(),[m,x]=u.useState(),[g,h]=u.useState(),[f,C]=u.useState(),[b,j]=u.useState(),P=w=>{if(w!==void 0&&w.length!==12)return c("errIdLen");if(!vt(w))return c("errIdFormat")},T=w=>{if(w!==void 0&&w.length!==8)return c("errCodeLen");if(!vt(w))return c("errCodeFormat")},k=async()=>{try{await e.overrideRfidCode({stickerId:i,stickerCode:m}),r(!0)}catch(w){switch(w.type){case"errIdLen":case"errIdFormat":C(w.type);break;case"errCodeLen":case"errCodeFormat":j(w.type);break;case"errVerify":case"errBadJson":h(w.type);break}}};return o.jsxs(a.Modal,{contain:d!=="compact",mode:"maximized",onClosed:t,show:!s,children:[o.jsx(a.Header,{contain:d==="compact",showCloseButton:!0,title:n?c("label-rfid-override",{label:n}):c("rfid-override"),showOpenButton:!1,onClose:()=>r(!0),CloseButton:d==="compact"?a.BackButton:void 0}),o.jsxs(mr,{children:[o.jsxs(a.Content,{align:"top",children:[o.jsx(a.InfoContainer,{children:c("info")}),o.jsx(a.ErrorInputCard,{isValid:P,description:f?c(f):void 0,label:c("enter-cartridge-id"),layout:"hex",value:i,onChange:w=>{C(void 0),p(w)}}),o.jsx(a.ErrorInputCard,{isValid:T,description:b?c(b):void 0,label:c("enter-code"),layout:"hex",value:m,onChange:w=>{j(void 0),x(w)}})]}),o.jsx(a.Footer,{children:o.jsx(a.Button,{mode:"primary",disabled:!i||!m,onPointerDown:k,children:c("override")})}),g&&o.jsx(a.ProgressBar,{onClose:()=>h(void 0),renderFailure:o.jsx(a.FailureCard,{heading:c("rfid-override"),message:c(g,{holder:e.name})}),show:!0,status:"failure",title:"",value:0})]})]})}),gr=l.kosComponent(({setupPath:e})=>{const{model:t}=je(),[n,s]=u.useState(!1),[r]=yt.useSearchParams(),c=!!r.get("skipSetup"),d=a.useNavigate();return u.useEffect(()=>{!n&&(t!=null&&t.setupRequired)&&(s(!0),c||d(e))},[t==null?void 0:t.setupRequired,n,d,e,c]),null}),wn=y.div`
|
|
374
389
|
cursor: pointer;
|
|
375
390
|
display: flex;
|
|
376
391
|
gap: 8px;
|
|
377
392
|
align-items: center;
|
|
378
|
-
`,
|
|
393
|
+
`,jn=y.div`
|
|
379
394
|
color: var(--ddk-generic-color-grey-100, #171717);
|
|
380
395
|
font-size: var(--ddk-component-sidebar-font-size-medium);
|
|
381
396
|
font-style: normal;
|
|
@@ -384,16 +399,24 @@
|
|
|
384
399
|
letter-spacing: 0.44px;
|
|
385
400
|
white-space: nowrap;
|
|
386
401
|
overflow: hidden;
|
|
387
|
-
`,
|
|
402
|
+
`,Sn=l.kosComponent(({setupStepContainer:e,onStepSelected:t,...n})=>{const{t:s,labelMap:r}=en({defaultNamespace:"setup",extensionPoint:L.EXTENSION_POINT_SETUP}),c=e==null?void 0:e.currentStep,d=(e==null?void 0:e.data.map(i=>o.jsxs(wn,{onPointerDown:()=>{e.setCurrentStep(i.id),t(i.id)},children:[o.jsx(a.StatusIndicator,{size:"large",status:c===i?"active":i.complete?"completed":"pending"}),o.jsx(jn,{children:s(r[i.name]??i.titleKey)})]},i.id)))||[];return o.jsx(a.Sidebar,{...n,children:d})}),xr=cn(Sn),hr=l.kosComponent(()=>{const{model:e}=l.useSoftwareInfo();return(e==null?void 0:e.nodes)&&e.nodes.map((t,n)=>o.jsxs(a.FrameContainer,{name:t.nodeName,children:[o.jsx("div",{children:o.jsx(a.FrameBody,{keyList:[],tableHead:`KOS Release Version: ${t.kosVersion}`,tableData:[]})},"kosVersion"),Object.keys(t.group).map((s,r)=>o.jsx("div",{children:o.jsx(a.FrameBody,{keyList:["name","version"],tableHead:s==="undefined"?"":s,tableData:t.group[s]})},r))]},n))});y.div`
|
|
403
|
+
display: flex;
|
|
404
|
+
justify-content: space-between;
|
|
405
|
+
align-items: center;
|
|
406
|
+
padding: 8px;
|
|
407
|
+
width: 100%;
|
|
408
|
+
`;const De=y(a.LabelInformation)`
|
|
409
|
+
white-space: pre-wrap;
|
|
410
|
+
`,kn=l.kosComponent(({pump:e,onComplete:t})=>{const{t:n}=l.useKosTranslation("common",{keyPrefix:"spm-field-calibration"}),[s,r]=u.useState("preparation-idle"),[c,d]=u.useState(),[i,p]=u.useState(),[m,x]=u.useState(),{clearFuture:g,future:h}=K(e);u.useEffect(()=>{switch(h==null?void 0:h.endState){case"CANCEL":switch(s){case"preparation-in-progress":r("preparation-idle");break;default:d("calibration-canceled"),r("failure")}break;case"SUCCESS":switch(s){case"preparation-in-progress":r("preparation-success");break;case"calibration-in-progress":r("calibration-input");break;case"verification-in-progress":r("verification-input");break}break;case"FAIL":case"ABORT":d(""),r("failure");break}},[h==null?void 0:h.endState,h==null?void 0:h.reason,s]);const f=u.useMemo(()=>({"preparation-idle":{information:o.jsx(De,{children:n("preparation-idle-info")}),footer:o.jsx(a.Button,{onPointerDown:()=>{g(),e.performPreCalibrate(),r("preparation-in-progress")},children:n("preparation-action")}),status:"information"},"preparation-in-progress":{information:o.jsx(a.LabelInformation,{children:n("preparation-progress-info")}),footer:o.jsx(a.Button,{disabled:!0,children:n("preparation-action")}),status:"loading"},"preparation-success":{information:o.jsx(a.LabelInformation,{children:n("preparation-success-info")}),footer:o.jsx(a.Button,{onPointerDown:()=>r("calibration-idle"),children:n("preparation-success-action")}),status:"success"},"preparation-failed":{},"calibration-idle":{information:o.jsx(De,{children:n("calibration-idle-info")}),footer:o.jsx(a.Button,{onPointerDown:()=>{g(),e.performCalibrate(),r("calibration-in-progress")},children:n("calibrate")}),status:"information"},"calibration-in-progress":{information:o.jsx(a.LabelInformation,{children:n("calibration-progress-info")}),status:"loading"},"calibration-input":{information:o.jsxs(o.Fragment,{children:[o.jsx(a.LabelInformation,{children:n("calibration-input-info")}),o.jsx(a.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:b=>{b!==void 0&&p(b)},value:i!==void 0?i:""})]}),footer:o.jsx(a.Button,{disabled:i===void 0,onPointerDown:()=>{i!==void 0&&r("verification-idle")},children:n("proceed")}),status:"information"},"calibration-input-confirmation":{},"verification-idle":{information:o.jsx(De,{children:n("verification-idle-info")}),footer:o.jsx(a.Button,{onPointerDown:async()=>{i!==void 0&&(g(),e.performVerify(i,h==null?void 0:h.clientData),r("verification-in-progress"))},children:n("initiate-verification-pour")}),status:"information"},"verification-in-progress":{information:o.jsx(a.LabelInformation,{children:n("verification-progress-info")}),status:"loading"},"verification-trouble":{},"verification-input":{information:o.jsxs(o.Fragment,{children:[o.jsx(a.LabelInformation,{children:n("verification-input-info")}),o.jsx(a.InputCard,{label:"Volume",unitValue:"ml",layout:"num",onChange:b=>{b!==void 0&&x(b)},value:m!==void 0?m:""})]}),footer:o.jsx(a.Button,{disabled:m===void 0,onPointerDown:async()=>{if(i===void 0||m===void 0)return;g();const[b,j]=await e.performComplete(i,m,h==null?void 0:h.clientData);b?(d(b),r("failure")):r("verification-success")},children:n("proceed")}),status:"information"},"verification-input-confirmation":{},"verification-success":{information:o.jsx(a.LabelInformation,{children:n("verification-success-info")}),footer:o.jsx(a.Button,{onPointerDown:t,children:n("exit-calibration")}),status:"success"},"verification-failure":{information:o.jsx(a.LabelInformation,{children:n("verification-failed-info",{data:{ingredient:e.name}})}),footer:o.jsx(a.Button,{onPointerDown:t,children:n("exit-calibration")}),status:"error"},failure:{information:o.jsxs(o.Fragment,{children:[o.jsx(a.LabelInformation,{children:n("calibration-failed")}),o.jsx(a.BodyMediumInformation,{children:n(`error.${c||"unknownError"}`)})]}),footer:o.jsx(a.Button,{onPointerDown:t,children:n("exit-calibration")}),status:"error"}}),[g,c,h==null?void 0:h.clientData,t,e,n,i,m]);let C;switch(s){case"preparation-in-progress":C="preparation-progress-title";break;case"calibration-in-progress":C="calibration-progress-title";break;case"verification-in-progress":C="verification-progress-title";break;default:C="initiating"}return o.jsxs(o.Fragment,{children:[o.jsx(a.WorkflowModal,{title:n("title",{data:{ingredient:e.name}}),...f[s],onClose:()=>t()}),h&&o.jsx(D,{title:n(C),future:h})]})}),fr=l.KosLog.createLogger({name:"state-experience"});fr.debug("state-experience component loaded");const br=y.div``,Cr=l.kosComponent(()=>{const{getExtensions:e}=ie(),{model:t}=We(),[n,s]=u.useState(null);return u.useEffect(()=>l.kosAutoEffect(()=>{const d=e(L.EXTENSION_POINT_TROUBLE_ACTION).reduce((g,h)=>{const f=h;return g[f.data.stateKey??f.data.troubleType]={extension:L.EXTENSION_POINT_TROUBLE_ACTION,module:f.id,namespace:f.data.namespace,title:f.data.title,stateValue:f.data.stateValue??f.data.troubleType},g},{}),i=t==null?void 0:t.activeTroubleType,p=t==null?void 0:t.activeTrouble,m=i?d[i]:void 0,x=m?o.jsx(N.DynamicComponent,{...m,props:{trouble:p}}):null;s(x)}),[e,t]),o.jsx(br,{children:n})}),vr=[0,6],Pn=()=>{const{regionModel:e}=l.useKosRegions(),{model:t}=l.useKosTime(),[n,s]=u.useState(new Date),r=n.getFullYear(),c=l.useDateProps({formatOptions:{dayFormat:"short",yearFormat:"long",monthFormat:"long",formatString:(e==null?void 0:e.selectedDateFormat)||"yyyy/MM/dd"},filterOptions:{daysOfWeekFilter:vr,yearsRange:[r-10,r+10]}}),d=u.useCallback((m,x)=>{switch(m){case"year":c.dateActions.setYear(x.id);break;case"month":c.dateActions.setMonth(x.id);break;case"day":c.dateActions.setDay(x.id);break}},[c.dateActions]),i=u.useCallback(()=>{c.dateActions.setYear(n.getFullYear()),c.dateActions.setMonth(n.getMonth()),c.dateActions.setDay(n.getDate())},[n,c.dateActions]),p=u.useCallback(async({day:m,month:x,year:g})=>{c.dateActions.setYear(g),c.dateActions.setMonth(x),c.dateActions.setDay(m),await(t==null?void 0:t.updateSystemDate({day:m,month:x,year:g})),s(new Date)},[c.dateActions,t]);return o.jsx(Gt,{onDiscard:i,onChange:d,onSave:p})},Tn=l.kosComponent(({...e})=>{var i;const{regionModel:t}=l.useKosRegions(),{model:n}=l.useKosTime(),{t:s}=l.useKosTranslation("common"),r=t==null?void 0:t.allTimeZones.map(p=>({id:p,label:p.replace(/_/g," ")})),c=(i=t==null?void 0:t.timeZones)==null?void 0:i.map(p=>({id:p,label:p.replace(/_/g," ")})),d=[{id:"region",label:s("suggested"),items:c||[]},{id:"all",label:s("all"),items:r||[]}];return o.jsx(a.SwitchPickerCard,{...e,label:s("time-zone"),data:d,displayValue:(n==null?void 0:n.timezone).replace("_"," "),loop:!1,selectedItemId:n==null?void 0:n.timezone,onSave:n==null?void 0:n.updateSystemTimezone,closeButtonLabel:s("close","Close")||void 0,cancelButtonLabel:s("discard-changes","Discard Changes")||void 0,proceedButtonLabel:s("save","Save")||void 0})}),yr=l.kosComponent(({showHeading:e})=>{var f,C,b,j,P,T,k,w;const{t}=l.useKosTranslation("region"),{regionModel:n}=l.useKosRegions(),{model:s}=l.useKosTime(),{amPmOptions:r,formattedTime:c,hourOptions:d,minuteOptions:i,setTime:p,time:m}=l.useRegionTimeProps(),x=m.getHours(),g=u.useMemo(()=>[{id:"hr",items:d,selectedItemId:x<12?x:x-12,loop:!0},{id:"min",items:i,selectedItemId:m.getMinutes(),loop:!0},{id:"ampm",items:r,selectedItemId:x<12?"AM":"PM"}],[r,d,i,m,x]),h=u.useMemo(()=>[{id:"hr",items:d,selectedItemId:x,loop:!0},{id:"min",items:i,selectedItemId:m.getMinutes(),loop:!0}],[d,i,m,x]);return u.useEffect(()=>{const v=setInterval(()=>{p(new Date)},3e4);return()=>{clearInterval(v)}},[p]),o.jsxs(a.TabContainer,{children:[e&&o.jsx(a.SettingsSubheading,{children:t("time-settings","Time Settings")}),((f=n==null?void 0:n.dateFormatOptions)==null?void 0:f.length)&&o.jsx(a.SwitchCard,{label:t("date-format","Date Format"),value:(b=(C=n==null?void 0:n.dateFormatOptions)==null?void 0:C.find(v=>v.format===n.selectedDateFormat))==null?void 0:b.id,options:(j=n==null?void 0:n.dateFormatOptions)==null?void 0:j.map(v=>({label:v.format.toUpperCase(),...v})),onChange:v=>v&&(n==null?void 0:n.setSelectedDateFormat(String(v)))}),o.jsx(Pn,{}),o.jsx(Tn,{}),((P=n==null?void 0:n.timeFormatOptions)==null?void 0:P.length)&&o.jsx(a.SwitchCard,{label:t("time-format","Time Format"),value:(k=(T=n==null?void 0:n.timeFormatOptions)==null?void 0:T.find(v=>v.format===n.selectedTimeFormat))==null?void 0:k.id,options:(w=n==null?void 0:n.timeFormatOptions)==null?void 0:w.map(v=>({label:v!=null&&v.ampm?"12 HR":"24 HR",...v})).reverse(),onChange:v=>v&&(n==null?void 0:n.setSelectedTimeFormat(String(v)))}),o.jsx(a.MultiPickerCard,{data:n!=null&&n.is12HourTimeFormat?g:h,icon:_.TimeIcon,displayValue:c,label:t("current-time","Current Time"),closeButtonLabel:t("close","Close")||void 0,cancelButtonLabel:t("discard-changes","Discard Changes")||void 0,proceedButtonLabel:t("save","Save")||void 0,onSave:v=>{const A=n!=null&&n.is12HourTimeFormat?v.ampm==="AM"?v.hr:v.hr+12:v.hr,F=v.min,B=new Date(m);B.setHours(A),B.setMinutes(F),p(B),s==null||s.updateSystemTime({hour:A,min:F,sec:0})}})]})}),wr=_e(l.kosComponent(({settings:e,showHeading:t})=>{const{t:n}=l.useKosTranslation("dispenser-profile");return o.jsxs(a.TabContainer,{children:[t&&o.jsx(a.SettingsSubheading,{children:n("water-settings","Water Settings")}),o.jsx(te,{label:n("plain-water","Plain Water"),configProperty:e.hidePlainWaterBev}),o.jsx(te,{label:n("carbonated-water","Carbonated Water"),configProperty:e.hideCarbWaterBev})]})})),jr=y.div`
|
|
388
411
|
display: flex;
|
|
389
412
|
flex-direction: column;
|
|
390
413
|
gap: 12px;
|
|
391
|
-
`,
|
|
414
|
+
`,Sr=y.div`
|
|
392
415
|
display: flex;
|
|
393
416
|
flex-direction: row;
|
|
394
417
|
gap: 12px;
|
|
395
418
|
align-items: center;
|
|
396
419
|
justify-content: center;
|
|
397
|
-
`,
|
|
420
|
+
`,kr=y(a.Button)`
|
|
398
421
|
display: block;
|
|
399
|
-
`;exports.ActionButton=
|
|
422
|
+
`;exports.ActionButton=kr;exports.ActionContainer=jr;exports.ActionRow=Sr;exports.AgitationControlView=Hn;exports.AgitatorDetail=_n;exports.AgitatorModal=Bt;exports.AgitatorSummary=zn;exports.AnimationContext=Ye;exports.AnimationProvider=Ho;exports.ApplicationComponentConfigurationProvider=Uo;exports.ApplicationContext=Ze;exports.ApplicationProvider=zo;exports.CalibrateAction=wt;exports.CalibrateModal=Nt;exports.ConfigPropInfoCard=Vt;exports.ConfigPropInputCard=be;exports.ConfigPropInputRangeCard=H;exports.ConfigPropMultiInputEnableCard=_t;exports.ConfigPropPickerCard=Ce;exports.ConfigPropSingleInputEnableCard=oo;exports.ConfigPropSwitchCard=Ut;exports.ConfigPropTimePickerCard=Wt;exports.ConfigPropToggleCard=te;exports.DashboardOperationsContext=Qe;exports.DashboardOperationsProvider=Wo;exports.DatePickerCard=Gt;exports.DiagnosticsModal=qt;exports.DispenserInfoContext=Je;exports.DispenserInfoProvider=qo;exports.DispenserInfoSettings=Mo;exports.DispenserSerialNumber=un;exports.DispenserSettings=Ko;exports.EXTENSION_PLUGIN_VISIBILITY=M;exports.EnjoyByDate=Xe;exports.FailureMessage=ee;exports.Fixed45FlowTestAction=jt;exports.FlushAction=St;exports.FutureProgressBar=D;exports.GenericTroubleAction=Et;exports.HardwareInfo=Vo;exports.HighFlowTestAction=kt;exports.HoldToPourAction=Pt;exports.HoldToPourButton=U;exports.HolderActions=Se;exports.HolderCard=gn;exports.HolderContentContext=Re;exports.HolderContentProvider=bo;exports.HolderGroup=dt;exports.HolderGroupView=ws;exports.HolderNotifications=$;exports.IceAgitatorDetail=Os;exports.IceAgitatorSettings=hn;exports.IceAgitatorSettingsContainer=Ns;exports.IceAgitatorSettingsView=$s;exports.IceAgitatorSummary=_s;exports.IngredientSummaryContext=et;exports.IngredientSummaryProvider=Yo;exports.IntentAction=E;exports.KosPluginExtensionManager=ko;exports.LFCVPumpCard=Zs;exports.LocalizationSettings=Us;exports.LowFlowTestAction=Tt;exports.MSVPumpCard=Qs;exports.MSVResetAction=Dt;exports.MacroAssignmentContext=tt;exports.MacroAssignmentProvider=Qo;exports.MacroHolderCard=xn;exports.MacroHolderGroupView=Ds;exports.MacroSetupStepCard=ut;exports.ManualOverrideAction=It;exports.NetworkTestContainerContext=ot;exports.NetworkTestContainerProvider=ns;exports.NetworkTestContext=nt;exports.NetworkTestProvider=es;exports.NetworkTestResults=qs;exports.NotificationCardView=fn;exports.PluginExtensionManager=rn;exports.PluginTabs=Ys;exports.PrimeAction=At;exports.PurgeAction=Ft;exports.RFIDOverride=yn;exports.RebootContext=st;exports.RebootProvider=ss;exports.RebootView=ir;exports.RemoteNNSModal=ar;exports.RemoteTrayDetail=cr;exports.RemoteTraySummary=dr;exports.ReplaceLine=Cn;exports.ReplacePump=vn;exports.SPMFieldCalibrationModal=kn;exports.SettingsContext=rt;exports.SettingsProvider=is;exports.SetupRequired=gr;exports.SetupSidebar=xr;exports.SetupSidebarComp=Sn;exports.SetupStepContainerContext=at;exports.SetupStepContainerProvider=ds;exports.SetupStepContext=it;exports.SetupStepProvider=cs;exports.Software=hr;exports.StagedChangesProvider=Ot;exports.StateExperience=Cr;exports.StepItem=wn;exports.StepTitle=jn;exports.SuccessMessage=fe;exports.SuperPumpCard=bn;exports.SystemDatePickerCard=Pn;exports.TROUBLE_PRIME=Bn;exports.TROUBLE_PURGE=Mn;exports.TimePickerCard=zt;exports.TimeSettings=yr;exports.TimeZonePickerCard=Tn;exports.TroubleAction=Lt;exports.UtilitiesContainerContext=lt;exports.UtilitiesContainerProvider=gs;exports.UtilitiesContext=ct;exports.UtilitiesProvider=ps;exports.ValveCard=tr;exports.WaterPumpCard=nr;exports.WaterSettings=wr;exports.pumpTypeFactory=So;exports.troubleLabelByType=an;exports.troubleLabelFactory=re;exports.useAgitationControl=Le;exports.useAnimation=Be;exports.useAnimationContext=_o;exports.useApplication=oe;exports.useApplicationContext=je;exports.useCarbWater=Yt;exports.useCombinedActions=ro;exports.useCopyLogs=Zt;exports.useDashboardOperations=Me;exports.useDashboardOperationsContext=Go;exports.useDispenserInfo=Ke;exports.useDispenserInfoContext=Xo;exports.useDoor=Jt;exports.useFutureContainer=K;exports.useHolderContent=Ne;exports.useHolderExperience=se;exports.useIngredientSummary=$e;exports.useIngredientSummaryContext=Zo;exports.useMacroAssignment=Oe;exports.useMacroAssignmentContext=Jo;exports.useNetworkTest=Ve;exports.useNetworkTestContainer=He;exports.useNetworkTestContainerContext=os;exports.useNetworkTestContext=ts;exports.useNutritiveSweetener=on;exports.usePlainWater=sn;exports.usePluginExtensions=ie;exports.usePumpAction=ne;exports.useReboot=ve;exports.useRebootContext=rs;exports.useSettings=ye;exports.useSettingsContext=as;exports.useSetupStep=Ue;exports.useSetupStepContainer=ze;exports.useSetupStepContainerContext=us;exports.useSetupStepContext=ls;exports.useStagedChanges=Ee;exports.useStart=ln;exports.useTroubleAction=uo;exports.useTroubleActionState=We;exports.useTroubleData=we;exports.useTroubleDecoration=dn;exports.useTroubleVisibility=Lo;exports.useUtilities=Ge;exports.useUtilitiesContainer=qe;exports.useUtilitiesContainerContext=xs;exports.useUtilitiesContext=ms;exports.useViewExtensions=en;exports.useVisibleTroubles=z;exports.withAgitationControl=po;exports.withAnimation=Xt;exports.withApplication=mo;exports.withCarbWater=go;exports.withCopyLogs=xo;exports.withDashboardOperations=ho;exports.withDispenserInfo=Qt;exports.withDoor=fo;exports.withIngredientSummary=vo;exports.withMacroAssignment=tn;exports.withNetworkTest=yo;exports.withNetworkTestContainer=nn;exports.withNutritiveSweetener=wo;exports.withPlainWater=jo;exports.withReboot=Po;exports.withSettings=_e;exports.withSetupStep=To;exports.withSetupStepContainer=cn;exports.withStagedChanges=Gn;exports.withStart=Io;exports.withTroubleAction=Do;exports.withUtilities=Eo;exports.withUtilitiesContainer=Bo;
|