FitTrackee/fittrackee/dist/static/js/workouts.abaf372c.js

2 lines
82 KiB
JavaScript
Raw Normal View History

2023-09-14 11:23:49 +02:00
"use strict";(self["webpackChunkfittrackee_client"]=self["webpackChunkfittrackee_client"]||[]).push([[401],{7871:function(e,t,o){o.d(t,{Z:function(){return ne}});o(7658);var a=o(6252),n=o(3577),l=o(2262),r=o(9963),s=o(2429),i=o(2201),u=o(5801),d=o(9917),c=o(6558),p=o(8966),m=o(631),w=o(3649);const v={id:"workout-form"},y=["onSubmit"],k={class:"form-items"},f={key:0,class:"form-item-radio"},_=["checked","disabled"],g={for:"withGpx"},S=["checked","disabled"],h={for:"withoutGpx"},b={class:"form-item"},U=["disabled"],T=["value"],O={key:1,class:"form-item"},E={for:"gpxFile"},D=["disabled"],I={class:"files-help info-box"},A={key:2,class:"form-item"},C={for:"title"},R=["required","disabled"],$={key:3},L={class:"workout-date-duration"},N={class:"form-item"},j={class:"workout-date-time"},x=["disabled"],z=["disabled"],W={class:"form-item"},F=["disabled"],B=["disabled"],H=["disabled"],P={class:"workout-data"},q={class:"form-item"},M=["disabled"],Z={class:"form-item"},K=["disabled"],G={class:"form-item"},Y=["disabled"],X={class:"form-item"},V={key:1},J={key:2,class:"form-buttons"},Q=["disabled"],ee=["onClick"];var te=(0,a.aZ)({__name:"WorkoutEdition",props:{authUser:null,sports:null,isCreation:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},workout:{default:()=>({})}},setup(e){const t=e,{t:o}=(0,s.QT)(),te=(0,d.o)(),oe=(0,i.tv)(),{authUser:ae,workout:ne,isCreation:le,loading:re}=(0,l.BK)(t),se=(0,a.Fl)((()=>(0,m.xH)(t.sports,o,"is_active_for_user",ne.value.id?[ne.value.sport_id]:[]))),ie=(0,a.Fl)((()=>te.getters[u.SY.GETTERS.APP_CONFIG])),ue=ie.value.max_single_file_size?(0,p.Z)(ie.value.max_single_file_size):"",de=ie.value.gpx_limit_import,ce=ie.value.max_zip_file_size?(0,p.Z)(ie.value.max_zip_file_size):"",pe=(0,a.Fl)((()=>te.getters[u.SY.GETTERS.ERROR_MESSAGES])),me=(0,l.qj)({sport_id:"",title:"",notes:"",workoutDate:"",workoutTime:"",workoutDurationHour:"",workoutDurationMinutes:"",workoutDurationSeconds:"",workoutDistance:"",workoutAscent:"",workoutDescent:""}),we=(0,l.iH)(ne.value.id?ne.value.with_gpx:le.value);let ve=null;const ye=(0,l.iH)(!1),ke=(0,l.iH)([]);function fe(e){me.notes=e}function _e(){we.value=!we.value,ye.value=!1}function ge(e){e.target.files&&(ve=e.target.files[0])}function Se(e){if(me.sport_id=`${e.sport_id}`,me.title=e.title,me.notes=e.notes,!e.with_gpx){const o=(0,c.Jo)((0,c.eB)(e.workout_date,t.authUser.timezone),"yyyy-MM-dd"),a=e.duration.split(":");me.workoutDistance=`${ae.value.imperial_units?(0,w.sC)(e.distance,"km","mi",3):parseFloat(e.distance.toFixed(3))}`,me.workoutDate=o.workout_date,me.workoutTime=o.workout_time,me.workoutDurationHour=a[0],me.workoutDurationMinutes=a[1],me.workoutDurationSeconds=a[2],me.workoutAscent=null===e.ascent?"":`${ae.value.imperial_units?(0,w.sC)(e.ascent,"m","ft",2):parseFloat(e.ascent.toFixed(2))}`,me.workoutDescent=null===e.descent?"":`${ae.value.imperial_units?(0,w.sC)(e.descent,"m","ft",2):parseFloat(e.descent.toFixed(2))}`}}function he(){return ke.value.includes("workouts.INVALID_DISTANCE")}function be(){return ke.value.includes("workouts.INVALID_DURATION")}function Ue(){return ke.value.includes("workouts.INVALID_ASCENT_OR_DESCENT")}function Te(e){ke.value=[],e.title=me.title,e.duration=3600*+me.workoutDurationHour+60*+me.workoutDurationMinutes+ +me.workoutDurationSeconds,e.duration<=0&&ke.value.push("workouts.INVALID_DURATION"),e.distance=ae.value.imperial_units?(0,w.sC)(+me.workoutDistance,"mi","km",3):+me.workoutDistance,e.distance<=0&&ke.value.push("workouts.INVALID_DISTANCE"),e.workout_date=`${me.workoutDate} ${me.workoutTime}`,e.ascent=""===me.workoutAscent?null:ae.value.imperial_units?(0,w.sC)(+me.workoutAscent,"ft","m",3):+me.workoutAscent,e.descent=""===me.workoutDescent?null:ae.value.imperial_units?(0,w.sC)(+me.workoutDescent,"ft","m",3):+me.workoutDescent,(null!==e.ascent&&null===e.descent||null===e.ascent&&null!==e.descent)&&ke.value.push("workouts.INVALID_ASCENT_OR_DESCENT")}function Oe(){const e={sport_id:+me.sport_id,notes:me.notes};if(t.workout.id)t.workout.with_gpx?e.title=me.title:Te(e),ke.value.length>0?te.commit(u.SY.MUTATIONS.SET_E
2023-10-04 17:40:59 +02:00
//# sourceMappingURL=workouts.abaf372c.js.map