1import{v as s,B as u,x as c,y as m,j as l,z as p,O as n,D as r,G as y,I as o,Y as v,a2 as b,au as g,a6 as h,H as B}from"./index.ccd35ebd.js";import{Q as f}from"./QSlider.1da0b896.js";import"./TouchPan.fe5c8598.js";import"./touch.6391c159.js";const S={name:"Activity",data:()=>({modalState:!1,loading:!1,activityDescription:"",caloriesBurned:250}),computed:{caloriesBurnedHint(){return this.caloriesBurned>500?{label:"extreme",color:"green-10"}:this.caloriesBurned>300?{label:"high",color:"green-8"}:this.caloriesBurned>100?{label:"moderate",color:"green-6"}:{label:"light",color:"green-4"}}},methods:{async check(){this.loading=!0;const e=await this.$api("health/calcActivityCalorieBurnFromText",{activityDescription:this.activityDescription});e.success&&(this.caloriesBurned=e.data.caloriesBurned),this.loading=!1},async save(){this.loading=!0,await this.$apiPublic("remember/it",{context:"health",logType:"activityCalorieBurn",description:"user activity food",caloriesBurned:this.caloriesBurned,activityDescription:this.activityDescription}),this.activityDescription="",this.caloriesBurned=250,this.loading=!1}}},C={class:"text-capitalize"},D={class:"flex justify-end q-mt-sm q-gutter-sm"};function k(e,t,V,w,Q,a){const d=u("CardTopBar");return c(),m("div",null,[l(n,{label:"Activity",rounded:e.btnStyle.rounded,unelevated:e.btnStyle.unelevated,outline:e.btnStyle.outline,style:p({backgroundColor:e.$store.getters.brandColor,color:e.btnStyle.outline?e.$store.getters.brandColor:"white"}),onClick:t[0]||(t[0]=i=>e.modalState=!0)},null,8,["rounded","unelevated","outline","style"]),l(B,{modelValue:e.modalState,"onUpdate:modelValue":t[3]||(t[3]=i=>e.modalState=i)},{default:r(()=>[l(y,{style:{"max-width":"1200px !important",width:"900px"},class:"q-pa-md"},{default:r(()=>[l(d,{title:"Activity"}),o("div",C,[t[4]||(t[4]=o("span",null,"calories expended: ",-1)),o("span",{class:v(`text-bold text-${a.caloriesBurnedHint.color}`)},b(a.caloriesBurnedHint.label),3)]),l(f,{modelValue:e.caloriesBurned,"onUpdate:modelValue":t[1]||(t[1]=i=>e.caloriesBurned=i),min:100,max:1e3,label:""},null,8,["modelValue"]),l(g,{modelValue:e.activityDescription,"onUpdate:modelValue":t[2]||(t[2]=i=>e.activityDescription=i),modelModifiers:{trim:!0},filled:"",label:"estimate calorie burn from activity description",hint:"lift weights, 30 min",onKeydown:h(a.check,["enter"])},{append:r(()=>[l(n,{label:"estimate burn",rounded:e.btnStyle.rounded,unelevated:e.btnStyle.unelevated,outline:e.btnStyle.outline,loading:e.loading,disable:!e.activityDescription||e.loading,color:"green",onClick:a.check},null,8,["rounded","unelevated","outline","loading","disable","onClick"])]),_:1},8,["modelValue","onKeydown"]),o("div",D,[l(n,{label:"i did this",rounded:e.btnStyle.rounded,unelevated:e.btnStyle.unelevated,outline:e.btnStyle.outline,loading:e.loading,disable:e.loading,color:"green",onClick:a.save},null,8,["rounded","unelevated","outline","loading","disable","onClick"])])]),_:1})]),_:1},8,["modelValue"])])}var T=s(S,[["render",k]]);export{T as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.