FitTrackee/fittrackee/dist/static/js/workouts.8abaa659.js
2022-11-01 19:58:12 +01:00

2 lines
68 KiB
JavaScript

"use strict";(self["webpackChunkfittrackee_client"]=self["webpackChunkfittrackee_client"]||[]).push([[401],{2528:function(t,e,o){o.d(e,{Z:function(){return Q}});o(7658);var a=o(6252),n=o(3577),l=o(2262),r=o(9963),s=o(9150),i=o(2201),u=o(5801),d=o(9917),c=o(6558),p=o(8966),m=o(631),w=o(3649);const k={id:"workout-form"},f=["onSubmit"],_={class:"form-items"},v={key:0,class:"form-item-radio"},g=["checked","disabled"],y={for:"withGpx"},S=["checked","disabled"],U={for:"withoutGpx"},h={class:"form-item"},b=["disabled"],T=["value"],E={key:1,class:"form-item"},D={for:"gpxFile"},O=["disabled"],I={class:"files-help info-box"},A={key:2,class:"form-item"},C={for:"title"},R=["required","disabled"],$={key:3},N={class:"workout-date-duration"},x={class:"form-item"},z={class:"workout-date-time"},L=["disabled"],j=["disabled"],W={class:"form-item"},P=["disabled"],B=["disabled"],F=["disabled"],H={class:"form-item"},M=["disabled"],Z={class:"form-item"},q={key:1},G={key:2,class:"form-buttons"},K=["disabled"],Y=["onClick"];var V=(0,a.aZ)({__name:"WorkoutEdition",props:{authUser:null,sports:null,isCreation:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},workout:{default:()=>({})}},setup(t){const e=t,{t:o}=(0,s.QT)(),V=(0,d.o)(),J=(0,i.tv)(),{authUser:X,workout:Q,isCreation:tt,loading:et}=(0,l.BK)(e),ot=(0,a.Fl)((()=>(0,m.xH)(e.sports,o,"is_active_for_user",Q.value.id?[Q.value.sport_id]:[]))),at=(0,a.Fl)((()=>V.getters[u.SY.GETTERS.APP_CONFIG])),nt=at.value.max_single_file_size?(0,p.Z)(at.value.max_single_file_size):"",lt=at.value.gpx_limit_import,rt=at.value.max_zip_file_size?(0,p.Z)(at.value.max_zip_file_size):"",st=(0,a.Fl)((()=>V.getters[u.SY.GETTERS.ERROR_MESSAGES])),it=(0,l.qj)({sport_id:"",title:"",notes:"",workoutDate:"",workoutTime:"",workoutDurationHour:"",workoutDurationMinutes:"",workoutDurationSeconds:"",workoutDistance:""}),ut=(0,l.iH)(e.workout.id?e.workout.with_gpx:e.isCreation);let dt=null;const ct=(0,l.iH)(!1);function pt(t){it.notes=t}function mt(){ut.value=!ut.value,ct.value=!1}function wt(t){t.target.files&&(dt=t.target.files[0])}function kt(t){if(it.sport_id=`${t.sport_id}`,it.title=t.title,it.notes=t.notes,!t.with_gpx){const o=(0,c.Jo)((0,c.eB)(t.workout_date,e.authUser.timezone),"yyyy-MM-dd"),a=t.duration.split(":");it.workoutDistance=`${X.value.imperial_units?(0,w.sC)(t.distance,"km","mi",2):parseFloat(t.distance.toFixed(2))}`,it.workoutDate=o.workout_date,it.workoutTime=o.workout_time,it.workoutDurationHour=a[0],it.workoutDurationMinutes=a[1],it.workoutDurationSeconds=a[2]}}function ft(t){t.title=it.title,t.distance=X.value.imperial_units?(0,w.sC)(+it.workoutDistance,"mi","km",3):+it.workoutDistance,t.duration=3600*+it.workoutDurationHour+60*+it.workoutDurationMinutes+ +it.workoutDurationSeconds,t.workout_date=`${it.workoutDate} ${it.workoutTime}`}function _t(){const t={sport_id:+it.sport_id,notes:it.notes};if(e.workout.id)e.workout.with_gpx?t.title=it.title:ft(t),V.dispatch(u.aX.ACTIONS.EDIT_WORKOUT,{workoutId:e.workout.id,data:t});else if(ut.value){if(!dt){const t="workouts.NO_FILE_PROVIDED";return void V.commit(u.SY.MUTATIONS.SET_ERROR_MESSAGES,t)}t.file=dt,V.dispatch(u.aX.ACTIONS.ADD_WORKOUT,t)}else ft(t),V.dispatch(u.aX.ACTIONS.ADD_WORKOUT_WITHOUT_GPX,t)}function vt(){e.workout.id?J.push({name:"Workout",params:{workoutId:e.workout.id}}):J.go(-1)}function gt(){ct.value=!0}return(0,a.bv)((()=>{e.workout.id&&kt(e.workout)})),(0,a.Ah)((()=>V.commit(u.SY.MUTATIONS.EMPTY_ERROR_MESSAGES))),(0,a.YP)((()=>e.workout),(async(t,e)=>{t!==e&&t&&t.id&&kt(t)})),(t,e)=>{const o=(0,a.up)("CustomTextArea"),s=(0,a.up)("ErrorMessage"),i=(0,a.up)("Loader"),u=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",{id:"workout-edition",class:(0,n.C_)(["center-card with-margin",{"center-form":(0,l.SU)(Q)&&(0,l.SU)(Q).with_gpx}])},[(0,a.Wm)(u,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,n.zw)(t.$t(`workouts.${(0,l.SU)(tt)?"ADD":"EDIT"}_WORKOUT`)),1)])),content:(0,a.w5)((()=>[(0,a._)("div",k,[(0,a._)("form",{class:(0,n.C_)({errors:ct.value}),onSubmit:(0,r.iM)(_t,["prevent"])},[(0,a._)("div",_,[(0,l.SU)(tt)?((0,a.wg)(),(0,a.iD)("div",v,[(0,a._)("div",null,[(0,a._)("input",{id:"withGpx",type:"radio",checked:ut.value,disabled:(0,l.SU)(et),onClick:mt},null,8,g),(0,a._)("label",y,(0,n.zw)(t.$t("workouts.WITH_GPX")),1)]),(0,a._)("div",null,[(0,a._)("input",{id:"withoutGpx",type:"radio",checked:!ut.value,disabled:(0,l.SU)(et),onClick:mt},null,8,S),(0,a._)("label",U,(0,n.zw)(t.$t("workouts.WITHOUT_GPX")),1)])])):(0,a.kq)("",!0),(0,a._)("div",h,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.SPORT",1))+": ",1),(0,a.wy)((0,a._)("select",{id:"sport",required:"",onInvalid:gt,disabled:(0,l.SU)(et),"onUpdate:modelValue":e[0]||(e[0]=t=>it.sport_id=t)},[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,l.SU)(ot),(t=>((0,a.wg)(),(0,a.iD)("option",{value:t.id,key:t.id},(0,n.zw)(t.translatedLabel),9,T)))),128))],40,b),[[r.bM,it.sport_id]])]),(0,l.SU)(tt)&&ut.value?((0,a.wg)(),(0,a.iD)("div",E,[(0,a._)("label",D,(0,n.zw)(t.$t("workouts.GPX_FILE"))+" "+(0,n.zw)(t.$t("workouts.ZIP_ARCHIVE_DESCRIPTION"))+": ",1),(0,a._)("input",{id:"gpxFile",name:"gpxFile",type:"file",accept:".gpx, .zip",disabled:(0,l.SU)(et),required:"",onInvalid:gt,onInput:wt},null,40,O),(0,a._)("div",I,[(0,a._)("div",null,[(0,a._)("strong",null,(0,n.zw)(t.$t("workouts.GPX_FILE"))+":",1),(0,a._)("ul",null,[(0,a._)("li",null,(0,n.zw)(t.$t("workouts.MAX_SIZE"))+": "+(0,n.zw)((0,l.SU)(nt)),1)])]),(0,a._)("div",null,[(0,a._)("strong",null,(0,n.zw)(t.$t("workouts.ZIP_ARCHIVE"))+":",1),(0,a._)("ul",null,[(0,a._)("li",null,(0,n.zw)(t.$t("workouts.NO_FOLDER")),1),(0,a._)("li",null,(0,n.zw)(t.$t("workouts.MAX_FILES"))+": "+(0,n.zw)((0,l.SU)(lt)),1),(0,a._)("li",null,(0,n.zw)(t.$t("workouts.MAX_SIZE"))+": "+(0,n.zw)((0,l.SU)(rt)),1)])])])])):((0,a.wg)(),(0,a.iD)("div",A,[(0,a._)("label",C,(0,n.zw)(t.$t("workouts.TITLE"))+": ",1),(0,a.wy)((0,a._)("input",{id:"title",name:"title",type:"text",required:!(0,l.SU)(tt),onInvalid:gt,disabled:(0,l.SU)(et),"onUpdate:modelValue":e[1]||(e[1]=t=>it.title=t)},null,40,R),[[r.nr,it.title]])])),ut.value?(0,a.kq)("",!0):((0,a.wg)(),(0,a.iD)("div",$,[(0,a._)("div",N,[(0,a._)("div",x,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.WORKOUT_DATE"))+":",1),(0,a._)("div",z,[(0,a.wy)((0,a._)("input",{id:"workout-date",name:"workout-date",type:"date",required:"",onInvalid:gt,disabled:(0,l.SU)(et),"onUpdate:modelValue":e[2]||(e[2]=t=>it.workoutDate=t)},null,40,L),[[r.nr,it.workoutDate]]),(0,a.wy)((0,a._)("input",{id:"workout-time",name:"workout-time",class:"workout-time",type:"time",required:"",onInvalid:gt,disabled:(0,l.SU)(et),"onUpdate:modelValue":e[3]||(e[3]=t=>it.workoutTime=t)},null,40,j),[[r.nr,it.workoutTime]])])]),(0,a._)("div",W,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.DURATION"))+":",1),(0,a._)("div",null,[(0,a.wy)((0,a._)("input",{id:"workout-duration-hour",name:"workout-duration-hour",class:"workout-duration",type:"text",placeholder:"HH",minlength:"1",maxlength:"2",pattern:"^([0-1]?[0-9]|2[0-3])$",required:"",onInvalid:gt,disabled:(0,l.SU)(et),"onUpdate:modelValue":e[4]||(e[4]=t=>it.workoutDurationHour=t)},null,40,P),[[r.nr,it.workoutDurationHour]]),(0,a.Uk)(" : "),(0,a.wy)((0,a._)("input",{id:"workout-duration-minutes",name:"workout-duration-minutes",class:"workout-duration",type:"text",pattern:"^([0-5][0-9])$",minlength:"2",maxlength:"2",placeholder:"MM",required:"",onInvalid:gt,disabled:(0,l.SU)(et),"onUpdate:modelValue":e[5]||(e[5]=t=>it.workoutDurationMinutes=t)},null,40,B),[[r.nr,it.workoutDurationMinutes]]),(0,a.Uk)(" : "),(0,a.wy)((0,a._)("input",{id:"workout-duration-seconds",name:"workout-duration-seconds",class:"workout-duration",type:"text",pattern:"^([0-5][0-9])$",minlength:"2",maxlength:"2",placeholder:"SS",required:"",onInvalid:gt,disabled:(0,l.SU)(et),"onUpdate:modelValue":e[6]||(e[6]=t=>it.workoutDurationSeconds=t)},null,40,F),[[r.nr,it.workoutDurationSeconds]])])])]),(0,a._)("div",H,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.DISTANCE"))+" ("+(0,n.zw)((0,l.SU)(X).imperial_units?"mi":"km")+"): ",1),(0,a.wy)((0,a._)("input",{name:"workout-distance",type:"number",min:"0",step:"0.001",required:"",onInvalid:gt,disabled:(0,l.SU)(et),"onUpdate:modelValue":e[7]||(e[7]=t=>it.workoutDistance=t)},null,40,M),[[r.nr,it.workoutDistance]])])])),(0,a._)("div",Z,[(0,a._)("label",null,(0,n.zw)(t.$t("workouts.NOTES"))+": ",1),(0,a.Wm)(o,{name:"notes",input:it.notes,disabled:(0,l.SU)(et),onUpdateValue:pt},null,8,["input","disabled"])])]),(0,l.SU)(st)?((0,a.wg)(),(0,a.j4)(s,{key:0,message:(0,l.SU)(st)},null,8,["message"])):(0,a.kq)("",!0),(0,l.SU)(et)?((0,a.wg)(),(0,a.iD)("div",q,[(0,a.Wm)(i)])):((0,a.wg)(),(0,a.iD)("div",G,[(0,a._)("button",{class:"confirm",type:"submit",disabled:(0,l.SU)(et)},(0,n.zw)(t.$t("buttons.SUBMIT")),9,K),(0,a._)("button",{class:"cancel",onClick:(0,r.iM)(vt,["prevent"])},(0,n.zw)(t.$t("buttons.CANCEL")),9,Y)]))],42,f)])])),_:1})],2)}}}),J=o(3744);const X=(0,J.Z)(V,[["__scopeId","data-v-886f93f6"]]);var Q=X},4189:function(t,e,o){o.r(e),o.d(e,{default:function(){return p}});var a=o(6252),n=o(2262),l=o(2528),r=o(5801),s=o(9917);const i={id:"add-workout",class:"view"},u={class:"container"};var d=(0,a.aZ)({__name:"AddWorkout",setup(t){const e=(0,s.o)(),o=(0,a.Fl)((()=>e.getters[r.O8.GETTERS.SPORTS])),d=(0,a.Fl)((()=>e.getters[r.YN.GETTERS.AUTH_USER_PROFILE])),c=(0,a.Fl)((()=>e.getters[r.aX.GETTERS.WORKOUT_DATA]));return(t,e)=>((0,a.wg)(),(0,a.iD)("div",i,[(0,a._)("div",u,[(0,a.Wm)(l.Z,{authUser:(0,n.SU)(d),sports:(0,n.SU)(o),isCreation:!0,loading:(0,n.SU)(c).loading},null,8,["authUser","sports","loading"])])]))}});const c=d;var p=c},8237:function(t,e,o){o.r(e),o.d(e,{default:function(){return m}});var a=o(6252),n=o(2262),l=o(2201),r=o(2528),s=o(5801),i=o(9917);const u={id:"edit-workout",class:"view"},d={class:"container"};var c=(0,a.aZ)({__name:"EditWorkout",setup(t){const e=(0,l.yj)(),o=(0,i.o)(),c=(0,a.Fl)((()=>o.getters[s.YN.GETTERS.AUTH_USER_PROFILE])),p=(0,a.Fl)((()=>o.getters[s.O8.GETTERS.SPORTS])),m=(0,a.Fl)((()=>o.getters[s.aX.GETTERS.WORKOUT_DATA]));return(0,a.wF)((()=>{o.dispatch(s.aX.ACTIONS.GET_WORKOUT_DATA,{workoutId:e.params.workoutId})})),(0,a.YP)((()=>e.params.workoutId),(async t=>{t||o.commit(s.aX.MUTATIONS.EMPTY_WORKOUT)})),(t,e)=>((0,a.wg)(),(0,a.iD)("div",u,[(0,a._)("div",d,[(0,n.SU)(m).workout.id?((0,a.wg)(),(0,a.j4)(r.Z,{key:0,authUser:(0,n.SU)(c),sports:(0,n.SU)(p),workout:(0,n.SU)(m).workout,loading:(0,n.SU)(m).loading},null,8,["authUser","sports","workout","loading"])):(0,a.kq)("",!0)])]))}});const p=c;var m=p},4915:function(t,e,o){o.r(e),o.d(e,{default:function(){return Yo}});var a=o(6252),n=o(2262),l=o(2201),r=o(8273),s=(o(7658),o(3577)),i=o(9963),u=o(5167);const d=t=>((0,a.dD)("data-v-4d9f9a8a"),t=t(),(0,a.Cn)(),t),c={id:"workout-card-title"},p=["title"],m=d((()=>(0,a._)("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1))),w=[m],k={class:"workout-card-title"},f={class:"workout-title-date"},_={key:0,class:"workout-title"},v={key:1,class:"workout-title"},g={class:"workout-segment"},y=d((()=>(0,a._)("i",{class:"fa fa-map-marker","aria-hidden":"true"},null,-1))),S={class:"workout-date"},U={class:"workout-link"},h=["title"],b=d((()=>(0,a._)("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1))),T=[b];var E=(0,a.aZ)({__name:"WorkoutCardTitle",props:{sport:null,workoutObject:null},emits:["displayModal"],setup(t,{emit:e}){const o=t,{sport:l,workoutObject:r}=(0,n.BK)(o);async function d(t){await u.Z.get(`workouts/${t}/gpx/download`,{responseType:"blob"}).then((e=>{const o=window.URL.createObjectURL(new Blob([e.data],{type:"application/gpx+xml"})),a=document.createElement("a");a.href=o,a.setAttribute("download",`${t}.gpx`),document.body.appendChild(a),a.click()}))}return(t,o)=>{const u=(0,a.up)("SportImage"),m=(0,a.up)("router-link");return(0,a.wg)(),(0,a.iD)("div",c,[(0,a._)("div",{class:(0,s.C_)(["workout-previous workout-arrow",{inactive:!(0,n.SU)(r).previousUrl}]),title:(0,n.SU)(r).previousUrl?t.$t(`workouts.PREVIOUS_${(0,n.SU)(r).type}`):t.$t(`workouts.NO_PREVIOUS_${(0,n.SU)(r).type}`),onClick:o[0]||(o[0]=e=>(0,n.SU)(r).previousUrl?t.$router.push((0,n.SU)(r).previousUrl):null)},w,10,p),(0,a._)("div",k,[(0,a.Wm)(u,{"sport-label":(0,n.SU)(l).label,color:(0,n.SU)(l).color},null,8,["sport-label","color"]),(0,a._)("div",f,["WORKOUT"===(0,n.SU)(r).type?((0,a.wg)(),(0,a.iD)("div",_,[(0,a._)("span",null,(0,s.zw)((0,n.SU)(r).title),1),(0,a._)("i",{class:"fa fa-edit","aria-hidden":"true",onClick:o[1]||(o[1]=e=>t.$router.push({name:"EditWorkout",params:{workoutId:(0,n.SU)(r).workoutId}}))}),(0,n.SU)(r).with_gpx?((0,a.wg)(),(0,a.iD)("i",{key:0,class:"fa fa-download","aria-hidden":"true",onClick:o[2]||(o[2]=(0,i.iM)((t=>d((0,n.SU)(r).workoutId)),["prevent"]))})):(0,a.kq)("",!0),(0,a._)("i",{class:"fa fa-trash","aria-hidden":"true",onClick:o[3]||(o[3]=t=>e("displayModal",!0))})])):((0,a.wg)(),(0,a.iD)("div",v,[(0,a.Uk)((0,s.zw)((0,n.SU)(r).title)+" ",1),(0,a._)("span",g,[(0,a.Uk)(" — "),y,(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.SEGMENT"))+" "+(0,s.zw)((0,n.SU)(r).segmentId+1),1)])])),(0,a._)("div",S,[(0,a.Uk)((0,s.zw)((0,n.SU)(r).workoutDate)+" - "+(0,s.zw)((0,n.SU)(r).workoutTime)+" ",1),(0,a._)("span",U,["SEGMENT"===(0,n.SU)(r).type?((0,a.wg)(),(0,a.j4)(m,{key:0,to:{name:"Workout",params:{workoutId:(0,n.SU)(r).workoutId}}},{default:(0,a.w5)((()=>[(0,a.Uk)(" > "+(0,s.zw)(t.$t("workouts.BACK_TO_WORKOUT")),1)])),_:1},8,["to"])):(0,a.kq)("",!0)])])])]),(0,a._)("div",{class:(0,s.C_)(["workout-next workout-arrow",{inactive:!(0,n.SU)(r).nextUrl}]),title:(0,n.SU)(r).nextUrl?t.$t(`workouts.NEXT_${(0,n.SU)(r).type}`):t.$t(`workouts.NO_NEXT_${(0,n.SU)(r).type}`),onClick:o[4]||(o[4]=e=>(0,n.SU)(r).nextUrl?t.$router.push((0,n.SU)(r).nextUrl):null)},T,10,h)])}}}),D=o(3744);const O=(0,D.Z)(E,[["__scopeId","data-v-4d9f9a8a"]]);var I=O;const A=t=>((0,a.dD)("data-v-1a5282f6"),t=t(),(0,a.Cn)(),t),C={key:0,class:"workout-record"},R=A((()=>(0,a._)("sup",null,[(0,a._)("i",{class:"fa fa-trophy","aria-hidden":"true"})],-1))),$=[R];var N=(0,a.aZ)({__name:"WorkoutRecord",props:{recordType:null,workoutObject:null},setup(t){const e=t,{recordType:o,workoutObject:l}=(0,n.BK)(e);return(t,e)=>(0,n.SU)(l).records&&(0,n.SU)(l).records.find((t=>t.record_type===(0,n.SU)(o)))?((0,a.wg)(),(0,a.iD)("span",C,$)):(0,a.kq)("",!0)}});const x=(0,D.Z)(N,[["__scopeId","data-v-1a5282f6"]]);var z=x,L=o(9150);const j=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"],W=t=>{const e=Math.floor(t/22.5+.5);return j[e%16]},P={class:"wind"},B={class:"wind-bearing"},F=["title"];var H=(0,a.aZ)({__name:"WeatherWind",props:{weather:null,useImperialUnits:{type:Boolean}},setup(t){const e=t,{useImperialUnits:o,weather:l}=(0,n.BK)(e),{t:r}=(0,L.QT)();function i(t){return r(`workouts.WEATHER.WIND_DIRECTIONS.${W(t)}`)}return(t,e)=>{const r=(0,a.up)("Distance");return(0,a.wg)(),(0,a.iD)("div",P,[(0,a.Wm)(r,{distance:(0,n.SU)(l).wind,unitFrom:"m",digits:1,displayUnit:!1,useImperialUnits:(0,n.SU)(o)},null,8,["distance","useImperialUnits"]),(0,a.Uk)(" "+(0,s.zw)((0,n.SU)(o)?"ft":"m")+"/s ",1),(0,a._)("div",B,[(0,n.SU)(l).windBearing?((0,a.wg)(),(0,a.iD)("i",{key:0,class:"fa fa-long-arrow-down",style:(0,s.j5)({transform:`rotate(${(0,n.SU)(l).windBearing}deg)`}),"aria-hidden":"true",title:i((0,n.SU)(l).windBearing)},null,12,F)):(0,a.kq)("",!0)])])}}});const M=(0,D.Z)(H,[["__scopeId","data-v-46a7c31c"]]);var Z=M;const q=t=>((0,a.dD)("data-v-76e9ab62"),t=t(),(0,a.Cn)(),t),G={key:0,id:"workout-weather"},K={class:"weather-table"},Y=q((()=>(0,a._)("th",null,null,-1))),V={class:"weather-th"},J=["src","alt","title"],X={class:"weather-th"},Q=["src","alt","title"],tt=["alt","title"],et=["alt","title"],ot=["alt","title"];var at=(0,a.aZ)({__name:"WorkoutWeather",props:{workoutObject:null,useImperialUnits:{type:Boolean}},setup(t){const e=t,{useImperialUnits:o,workoutObject:l}=(0,n.BK)(e);return(t,e)=>(0,n.SU)(l).weatherStart&&(0,n.SU)(l).weatherEnd?((0,a.wg)(),(0,a.iD)("div",G,[(0,a._)("table",K,[(0,a._)("thead",null,[(0,a._)("tr",null,[Y,(0,a._)("th",null,[(0,a._)("div",V,[(0,a.Uk)((0,s.zw)(t.$t("workouts.START"))+" ",1),(0,a._)("img",{class:"weather-img",src:`/img/weather/${(0,n.SU)(l).weatherStart.icon}.svg`,alt:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherStart.icon}`),title:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherStart.icon}`)},null,8,J)])]),(0,a._)("th",null,[(0,a._)("div",X,[(0,a.Uk)((0,s.zw)(t.$t("workouts.END"))+" ",1),(0,a._)("img",{class:"weather-img",src:`/img/weather/${(0,n.SU)(l).weatherEnd.icon}.svg`,alt:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherEnd.icon}`),title:t.$t(`workouts.WEATHER.DARK_SKY.${(0,n.SU)(l).weatherEnd.icon}`)},null,8,Q)])])])]),(0,a._)("tbody",null,[(0,a._)("tr",null,[(0,a._)("td",null,[(0,a._)("img",{class:"weather-img weather-img-small",src:"/img/weather/temperature.svg",alt:t.$t("workouts.WEATHER.TEMPERATURE"),title:t.$t("workouts.WEATHER.TEMPERATURE")},null,8,tt)]),(0,a._)("td",null,(0,s.zw)(Number((0,n.SU)(l).weatherStart.temperature).toFixed(1))+"°C ",1),(0,a._)("td",null,(0,s.zw)(Number((0,n.SU)(l).weatherEnd.temperature).toFixed(1))+"°C ",1)]),(0,a._)("tr",null,[(0,a._)("td",null,[(0,a._)("img",{class:"weather-img weather-img-small",src:"/img/weather/pour-rain.svg",alt:t.$t("workouts.WEATHER.HUMIDITY"),title:t.$t("workouts.WEATHER.HUMIDITY")},null,8,et)]),(0,a._)("td",null,(0,s.zw)(Number(100*(0,n.SU)(l).weatherStart.humidity).toFixed(1))+"% ",1),(0,a._)("td",null,(0,s.zw)(Number(100*(0,n.SU)(l).weatherEnd.humidity).toFixed(1))+"% ",1)]),(0,a._)("tr",null,[(0,a._)("td",null,[(0,a._)("img",{class:"weather-img weather-img-small",src:"/img/weather/breeze.svg",alt:t.$t("workouts.WEATHER.WIND"),title:t.$t("workouts.WEATHER.WIND")},null,8,ot)]),(0,a._)("td",null,[(0,a.Wm)(Z,{weather:(0,n.SU)(l).weatherStart,useImperialUnits:(0,n.SU)(o)},null,8,["weather","useImperialUnits"])]),(0,a._)("td",null,[(0,a.Wm)(Z,{weather:(0,n.SU)(l).weatherEnd,useImperialUnits:(0,n.SU)(o)},null,8,["weather","useImperialUnits"])])])])])])):(0,a.kq)("",!0)}});const nt=(0,D.Z)(at,[["__scopeId","data-v-76e9ab62"]]);var lt=nt;const rt=t=>((0,a.dD)("data-v-74c5993b"),t=t(),(0,a.Cn)(),t),st={id:"workout-info"},it={class:"workout-data"},ut=rt((()=>(0,a._)("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1))),dt={class:"label"},ct={class:"value"},pt={key:0},mt={class:"value"},wt={class:"value"},kt={class:"workout-data"},ft=rt((()=>(0,a._)("i",{class:"fa fa-road","aria-hidden":"true"},null,-1))),_t={class:"label"},vt={class:"workout-data"},gt=rt((()=>(0,a._)("i",{class:"fa fa-tachometer","aria-hidden":"true"},null,-1))),yt={class:"label"},St=rt((()=>(0,a._)("br",null,null,-1))),Ut={class:"label"},ht={key:0,class:"workout-data"},bt=["alt"],Tt={class:"label"},Et=rt((()=>(0,a._)("br",null,null,-1))),Dt={class:"label"},Ot={key:1,class:"workout-data"},It=rt((()=>(0,a._)("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1))),At={class:"label"},Ct=rt((()=>(0,a._)("br",null,null,-1))),Rt={class:"label"};var $t=(0,a.aZ)({__name:"WorkoutData",props:{workoutObject:null,useImperialUnits:{type:Boolean},displayHARecord:{type:Boolean}},setup(t){const e=t,{displayHARecord:o,workoutObject:l,useImperialUnits:r}=(0,n.BK)(e),i=(0,a.Fl)((()=>"0:00:00"!==e.workoutObject.pauses&&null!==e.workoutObject.pauses));return(t,e)=>{const u=(0,a.up)("Distance");return(0,a.wg)(),(0,a.iD)("div",st,[(0,a._)("div",it,[ut,(0,a._)("span",dt,(0,s.zw)(t.$t("workouts.DURATION")),1),(0,a.Uk)(": "),(0,a._)("span",ct,(0,s.zw)((0,n.SU)(l).moving),1),(0,a.Wm)(z,{workoutObject:(0,n.SU)(l),recordType:"LD"},null,8,["workoutObject"]),(0,n.SU)(i)?((0,a.wg)(),(0,a.iD)("div",pt,[(0,a.Uk)(" ("+(0,s.zw)(t.$t("workouts.PAUSES"))+": ",1),(0,a._)("span",mt,(0,s.zw)((0,n.SU)(l).pauses),1),(0,a.Uk)(" - "+(0,s.zw)(t.$t("workouts.TOTAL_DURATION"))+": ",1),(0,a._)("span",wt,(0,s.zw)((0,n.SU)(l).duration)+")",1)])):(0,a.kq)("",!0)]),(0,a._)("div",kt,[ft,(0,a._)("span",_t,(0,s.zw)(t.$t("workouts.DISTANCE")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).distance,digits:3,unitFrom:"km",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,a.Wm)(z,{workoutObject:(0,n.SU)(l),recordType:"FD"},null,8,["workoutObject"])]),(0,a._)("div",vt,[gt,(0,a._)("span",yt,(0,s.zw)(t.$t("workouts.AVERAGE_SPEED")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).aveSpeed,unitFrom:"km",speed:!0,strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,a.Wm)(z,{workoutObject:(0,n.SU)(l),recordType:"AS"},null,8,["workoutObject"]),St,(0,a._)("span",Ut,(0,s.zw)(t.$t("workouts.MAX_SPEED")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).maxSpeed,unitFrom:"km",speed:!0,strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,a.Wm)(z,{workoutObject:(0,n.SU)(l),recordType:"MS"},null,8,["workoutObject"])]),null!==(0,n.SU)(l).maxAlt&&null!==(0,n.SU)(l).minAlt?((0,a.wg)(),(0,a.iD)("div",ht,[(0,a._)("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:t.$t("workouts.ELEVATION")},null,8,bt),(0,a._)("span",Tt,(0,s.zw)(t.$t("workouts.MIN_ALTITUDE")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).minAlt,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),Et,(0,a._)("span",Dt,(0,s.zw)(t.$t("workouts.MAX_ALTITUDE")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).maxAlt,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"])])):(0,a.kq)("",!0),null!==(0,n.SU)(l).ascent&&null!==(0,n.SU)(l).descent?((0,a.wg)(),(0,a.iD)("div",Ot,[It,(0,a._)("span",At,(0,s.zw)(t.$t("workouts.ASCENT")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).ascent,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"]),(0,n.SU)(o)?((0,a.wg)(),(0,a.j4)(z,{key:0,workoutObject:(0,n.SU)(l),recordType:"HA"},null,8,["workoutObject"])):(0,a.kq)("",!0),Ct,(0,a._)("span",Rt,(0,s.zw)(t.$t("workouts.DESCENT")),1),(0,a.Uk)(": "),(0,a.Wm)(u,{distance:(0,n.SU)(l).descent,unitFrom:"m",strong:!0,useImperialUnits:(0,n.SU)(r)},null,8,["distance","useImperialUnits"])])):(0,a.kq)("",!0),(0,a.Wm)(lt,{workoutObject:(0,n.SU)(l),useImperialUnits:(0,n.SU)(r)},null,8,["workoutObject","useImperialUnits"])])}}});const Nt=(0,D.Z)($t,[["__scopeId","data-v-74c5993b"]]);var xt=Nt;function zt(t,e){return Array.from(t.getElementsByTagName(e))}function Lt(t){return t?.normalize(),t&&t.textContent||""}function jt(t,e,o){const a=t.getElementsByTagName(e),n=a.length?a[0]:null;return n&&o&&o(n),n}function Wt(t,e,o){const a={};if(!t)return a;const n=t.getElementsByTagName(e),l=n.length?n[0]:null;return l&&o?o(l,a):a}function Pt(t,e,o){const a=Lt(jt(t,e));return a&&o&&o(a)||{}}function Bt(t,e,o){const a=parseFloat(Lt(jt(t,e)));if(!isNaN(a))return a&&o&&o(a)||{}}function Ft(t,e,o){const a=parseFloat(Lt(jt(t,e)));if(!isNaN(a))return a&&o&&o(a),a}function Ht(t,e){const o={};for(const a of e)Pt(t,a,(t=>{o[a]=t}));return o}function Mt(t){return 1===t?.nodeType}function Zt(t){return Wt(t,"line",(t=>{const e=Object.assign({},Pt(t,"color",(t=>({stroke:`#${t}`}))),Bt(t,"opacity",(t=>({"stroke-opacity":t}))),Bt(t,"width",(t=>({"stroke-width":96*t/25.4}))));return e}))}function qt(t){let e=[];if(null===t)return e;for(const o of Array.from(t.childNodes)){if(!Mt(o))continue;const t=Gt(o.nodeName);if("gpxtpx:TrackPointExtension"===t)e=e.concat(qt(o));else{const a=Lt(o);e.push([t,Kt(a)])}}return e}function Gt(t){return["heart","gpxtpx:hr","hr"].includes(t)?"heart":t}function Kt(t){const e=parseFloat(t);return isNaN(e)?t:e}function Yt(t){const e=[parseFloat(t.getAttribute("lon")||""),parseFloat(t.getAttribute("lat")||"")];if(isNaN(e[0])||isNaN(e[1]))return null;Ft(t,"ele",(t=>{e.push(t)}));const o=jt(t,"time");return{coordinates:e,time:o?Lt(o):null,extendedValues:qt(jt(t,"extensions"))}}function Vt(t){const e=Ht(t,["name","cmt","desc","type","time","keywords"]),o=Array.from(t.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*"));for(const n of o)n.parentNode?.parentNode===t&&(e[n.tagName.replace(":","_")]=Lt(n));const a=zt(t,"link");return a.length&&(e.links=a.map((t=>Object.assign({href:t.getAttribute("href")},Ht(t,["text","type"]))))),e}function Jt(t,e){const o=zt(t,e),a=[],n=[],l={};for(let r=0;r<o.length;r++){const t=Yt(o[r]);if(t){a.push(t.coordinates),t.time&&n.push(t.time);for(const[e,a]of t.extendedValues){const t="heart"===e?e:e.replace("gpxtpx:","")+"s";l[t]||(l[t]=Array(o.length).fill(null)),l[t][r]=a}}}if(!(a.length<2))return{line:a,times:n,extendedValues:l}}function Xt(t){const e=Jt(t,"rtept");if(e)return{type:"Feature",properties:Object.assign({_gpxType:"rte"},Vt(t),Zt(jt(t,"extensions"))),geometry:{type:"LineString",coordinates:e.line}}}function Qt(t){const e=zt(t,"trkseg"),o=[],a=[],n=[];for(const s of e){const t=Jt(s,"trkpt");t&&(n.push(t),t.times&&t.times.length&&a.push(t.times))}if(0===n.length)return null;const l=n.length>1,r=Object.assign({_gpxType:"trk"},Vt(t),Zt(jt(t,"extensions")),a.length?{coordinateProperties:{times:l?a:a[0]}}:{});for(const s of n){o.push(s.line),r.coordinateProperties||(r.coordinateProperties={});const t=r.coordinateProperties,e=Object.entries(s.extendedValues);for(let o=0;o<e.length;o++){const[a,r]=e[o];l?(t[a]||(t[a]=n.map((t=>new Array(t.line.length).fill(null)))),t[a][o]=r):t[a]=r}}return{type:"Feature",properties:r,geometry:l?{type:"MultiLineString",coordinates:o}:{type:"LineString",coordinates:o[0]}}}function te(t){const e=Object.assign(Vt(t),Ht(t,["sym"])),o=Yt(t);return o?{type:"Feature",properties:e,geometry:{type:"Point",coordinates:o.coordinates}}:null}function*ee(t){for(const e of zt(t,"trk")){const t=Qt(e);t&&(yield t)}for(const e of zt(t,"rte")){const t=Xt(e);t&&(yield t)}for(const e of zt(t,"wpt")){const t=te(e);t&&(yield t)}}function oe(t){return{type:"FeatureCollection",features:Array.from(ee(t))}}Math.PI;const ae=(t,e)=>{let o;return function(...a){const n=this;o&&clearTimeout(o),o=setTimeout((()=>{t.apply(n,a),o=null}),e)}},ne=t=>t&&"function"===typeof t.charAt?t.charAt(0).toUpperCase()+t.slice(1):t,le=(t,e,o)=>{for(const n in o){const l="set"+ne(n);t[l]?(0,a.YP)((()=>o[n]),((e,o)=>{t[l](e,o)})):e[l]&&(0,a.YP)((()=>o[n]),(t=>{e[l](t)}))}},re=t=>{const e={};for(const o in t)if(o.startsWith("on")&&!o.startsWith("onUpdate")&&"onReady"!==o){const a=o.slice(2).toLocaleLowerCase();e[a]=t[o]}return e},se=async t=>{const e=await Promise.all([o.e(431).then(o.t.bind(o,6431,17)),o.e(93).then(o.t.bind(o,7093,17)),o.e(858).then(o.t.bind(o,8858,17))]);delete t.Default.prototype._getIconUrl,t.Default.mergeOptions({iconRetinaUrl:e[0].default,iconUrl:e[1].default,shadowUrl:e[2].default})},ie=t=>{const e=(0,n.iH)((()=>console.warn(`Method ${t} has been invoked without being replaced`))),o=(...t)=>e.value(...t);return o.wrapped=e,(0,a.JJ)(t,o),o},ue=(t,e)=>t.wrapped.value=e,de="object"===typeof self&&self.self===self&&self||"object"===typeof o.g&&o.g.global===o.g&&o.g||void 0,ce="useGlobalLeaflet",pe={options:{type:Object,default:()=>({})}},me=t=>({options:t.options,methods:{}}),we={...pe,pane:{type:String,default:"overlayPane"},attribution:{type:String,default:null},name:{type:String,custom:!0,default:void 0},layerType:{type:String,custom:!0,default:void 0},visible:{type:Boolean,custom:!0,default:!0}},ke=(t,e,o)=>{const n=(0,a.f3)("addLayer"),l=(0,a.f3)("removeLayer"),{options:r,methods:s}=me(t),i={...r,attribution:t.attribution,pane:t.pane},u=()=>n({leafletObject:e.value}),d=()=>l({leafletObject:e.value}),c={...s,setAttribution(t,e){const o=this.$parent.leafletObject.attributionControl;o.removeAttribution(e).addAttribution(t)},setName(){d(),t.visible&&u()},setLayerType(){d(),t.visible&&u()},setVisible(t){e.value&&(t?u():d())},bindPopup({leafletObject:t}){e.value.bindPopup(t)},bindTooltip({leafletObject:t}){e.value.bindTooltip(t)},unbindTooltip(){const t=e.value?e.value.getTooltip():null;t&&t.unbindTooltip()},unbindPopup(){const t=e.value?e.value.getPopup():null;t&&t.unbindPopup()},updateVisibleProp(t){o.emit("update:visible",t)}};return(0,a.JJ)("bindPopup",c.bindPopup),(0,a.JJ)("bindTooltip",c.bindTooltip),(0,a.JJ)("unbindTooltip",c.unbindTooltip),(0,a.JJ)("unbindPopup",c.unbindPopup),(0,a.Ah)((()=>{c.unbindPopup(),c.unbindTooltip(),d()})),{options:i,methods:c}},fe=(t,e)=>{if(t&&e.default)return(0,a.h)("div",{style:{display:"none"}},e.default())},_e={...pe,interactive:{type:Boolean,default:!0},bubblingMouseEvents:{type:Boolean,default:!0}},ve={...we,..._e,stroke:{type:Boolean,custom:!0,default:!0},color:{type:String,custom:!0,default:"#3388ff"},weight:{type:Number,custom:!0,default:3},opacity:{type:Number,custom:!0,default:1},lineCap:{type:String,custom:!0,default:"round"},lineJoin:{type:String,custom:!0,default:"round"},dashArray:{type:String,custom:!0,default:null},dashOffset:{type:String,custom:!0,default:null},fill:{type:Boolean,custom:!0,default:!1},fillColor:{type:String,custom:!0,default:"#3388ff"},fillOpacity:{type:Number,custom:!0,default:.2},fillRule:{type:String,custom:!0,default:"evenodd"},className:{type:String,custom:!0,default:null}},ge={...ve,latLng:{type:[Object,Array],custom:!0,default:null},radius:{type:Number,default:null}};const ye={...pe,position:{type:String,default:"topright"}},Se=(t,e)=>{const{options:o,methods:n}=me(t),l={...o,position:t.position},r={...n,setPosition(t){e.value&&e.value.setPosition(t)}};return(0,a.Ah)((()=>{e.value&&e.value.remove()})),{options:l,methods:r}},Ue=t=>t.default?(0,a.h)("div",{ref:"root"},t.default()):null;var he={name:"LControl",props:{...ye,disableClickPropagation:{type:Boolean,custom:!0,default:!0},disableScrollPropagation:{type:Boolean,custom:!0,default:!1}},setup(t,e){const l=(0,n.iH)({}),r=(0,n.iH)(null),s=(0,a.f3)(ce),i=(0,a.f3)("registerControl"),{options:u,methods:d}=Se(t,l);return(0,a.bv)((async()=>{const{Control:n,DomEvent:c}=s?de.L:await o.e(633).then(o.bind(o,6633)),p=n.extend({onAdd(){return r.value}});l.value=new p(u),le(d,l.value,t),i({leafletObject:l.value}),t.disableClickPropagation&&c.disableClickPropagation(r.value),t.disableScrollPropagation&&c.disableScrollPropagation(r.value),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{root:r,leafletObject:l}},render(){return Ue(this.$slots)},__file:"src/components/LControl.vue"};const be={...ye,collapsed:{type:Boolean,default:!0},autoZIndex:{type:Boolean,default:!0},hideSingleBase:{type:Boolean,default:!1},sortLayers:{type:Boolean,default:!1},sortFunction:{type:Function,default:void 0}},Te=(t,e)=>{const{options:o}=Se(t,e),a={...o,collapsed:t.collapsed,autoZIndex:t.autoZIndex,hideSingleBase:t.hideSingleBase,sortLayers:t.sortLayers,sortFunction:t.sortFunction},n={addLayer(t){"base"===t.layerType?e.value.addBaseLayer(t.leafletObject,t.name):"overlay"===t.layerType&&e.value.addOverlay(t.leafletObject,t.name)},removeLayer(t){e.value.removeLayer(t.leafletObject)}};return{options:a,methods:n}};var Ee={name:"LControlLayers",props:be,setup(t,e){const l=(0,n.iH)({}),r=(0,a.f3)(ce),s=(0,a.f3)("registerLayerControl"),{options:i,methods:u}=Te(t,l);return(0,a.bv)((async()=>{const{control:n}=r?de.L:await o.e(633).then(o.bind(o,6633));l.value=n.layers(null,null,i),le(u,l.value,t),s({...t,...u,leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l.value}},render(){return null},__file:"src/components/LControlLayers.vue"};Boolean,Boolean,Boolean;const De={...we},Oe=(t,e,o)=>{const{options:n,methods:l}=ke(t,e,o),r={...n},s={...l,addLayer(t){e.value.addLayer(t.leafletObject)},removeLayer(t){e.value.removeLayer(t.leafletObject)}};return(0,a.JJ)("addLayer",s.addLayer),(0,a.JJ)("removeLayer",s.removeLayer),{options:r,methods:s}};const Ie={...De,geojson:{type:[Object,Array],default:()=>({})}},Ae=(t,e)=>{const{options:o,methods:a}=Oe(t,e),n={...o,...t},l={...a,setGeojson(t){e.value.clearLayers(),e.value.addData(t)},getGeoJSONData(){return e.value.toGeoJSON()},getBounds(){return e.value.getBounds()}};return{options:n,methods:l}};var Ce={props:Ie,setup(t,e){const l=(0,n.iH)({}),r=(0,n.iH)(!1),s=(0,a.f3)(ce),i=(0,a.f3)("addLayer"),{methods:u,options:d}=Ae(t,l);return(0,a.bv)((async()=>{const{geoJSON:n,DomEvent:c}=s?de.L:await o.e(633).then(o.bind(o,6633));l.value=n(t.geojson,d);const p=re(e.attrs);c.on(l.value,p),le(u,l.value,t),i({...t,...u,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return fe(this.ready,this.$slots)},__file:"src/components/LGeoJson.vue"};const Re={...we,pane:{type:String,default:"tilePane"},opacity:{type:Number,custom:!1,default:1},zIndex:{type:Number,default:1},tileSize:{type:Number,default:256},noWrap:{type:Boolean,default:!1},minZoom:{type:Number,default:0},maxZoom:{type:Number,default:void 0}},$e=(t,e,o)=>{const{options:a,methods:n}=ke(t,e,o),l={...a,pane:t.pane,opacity:t.opacity,zIndex:t.zIndex,tileSize:t.tileSize,noWrap:t.noWrap,minZoom:t.minZoom,maxZoom:t.maxZoom};return{options:l,methods:{...n}}};const Ne={iconUrl:{type:String,custom:!0,default:null},iconRetinaUrl:{type:String,custom:!0,default:null},iconSize:{type:[Object,Array],custom:!0,default:null},iconAnchor:{type:[Object,Array],custom:!0,default:null},popupAnchor:{type:[Object,Array],custom:!0,default:()=>[0,0]},tooltipAnchor:{type:[Object,Array],custom:!0,default:()=>[0,0]},shadowUrl:{type:String,custom:!0,default:null},shadowRetinaUrl:{type:String,custom:!0,default:null},shadowSize:{type:[Object,Array],custom:!0,default:null},shadowAnchor:{type:[Object,Array],custom:!0,default:null},bgPos:{type:[Object,Array],custom:!0,default:()=>[0,0]},className:{type:String,custom:!0,default:""},options:{type:Object,custom:!0,default:()=>({})}};var xe={name:"LIcon",props:{...Ne,...pe},setup(t,e){const l=(0,n.iH)(null),r=(0,a.f3)(ce),s=(0,a.f3)("canSetParentHtml"),i=(0,a.f3)("setParentHtml"),u=(0,a.f3)("setIcon");let d,c,p,m,w;const k=(o,a,n)=>{const l=o&&o.innerHTML;if(!a)return void(n&&w&&s()&&i(l));const r=re(e.attrs);w&&c(w,r);const{options:k}=me(t),f={...k,iconUrl:t.iconUrl,iconRetinaUrl:t.iconRetinaUrl,iconSize:t.iconSize,iconAnchor:t.iconAnchor,popupAnchor:t.popupAnchor,tooltipAnchor:t.tooltipAnchor,shadowUrl:t.shadowUrl,shadowRetinaUrl:t.shadowRetinaUrl,shadowSize:t.shadowSize,shadowAnchor:t.shadowAnchor,bgPos:t.bgPos,className:t.className,html:l||t.html};w=f.html?p(f):m(f),d(w,r),u(w)},f=()=>{(0,a.Y3)((()=>k(l.value,!0,!1)))},_=()=>{(0,a.Y3)((()=>k(l.value,!1,!0)))},v={setIconUrl:f,setIconRetinaUrl:f,setIconSize:f,setIconAnchor:f,setPopupAnchor:f,setTooltipAnchor:f,setShadowUrl:f,setShadowRetinaUrl:f,setShadowAnchor:f,setBgPos:f,setClassName:f,setHtml:f};return(0,a.bv)((async()=>{const{DomEvent:e,divIcon:a,icon:n}=r?de.L:await o.e(633).then(o.bind(o,6633));d=e.on,c=e.off,p=a,m=n,le(v,{},t);const s=new MutationObserver(_);s.observe(l.value,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),f()})),{root:l}},render(){const t=this.$slots.default?this.$slots.default():void 0;return(0,a.h)("div",{ref:"root"},t)},__file:"src/components/LIcon.vue"};Boolean,Boolean;var ze={props:De,setup(t,e){const l=(0,n.iH)({}),r=(0,n.iH)(!1),s=(0,a.f3)(ce),i=(0,a.f3)("addLayer"),{methods:u}=Oe(t,l,e);return(0,a.bv)((async()=>{const{layerGroup:n,DomEvent:d}=s?de.L:await o.e(633).then(o.bind(o,6633));l.value=n(t.options);const c=re(e.attrs);d.on(l.value,c),le(u,l.value,t),i({...t,...u,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return fe(this.ready,this.$slots)},__file:"src/components/LLayerGroup.vue"},Le={emits:["ready","update:zoom","update:center","update:bounds"],props:{...pe,center:{type:[Object,Array],default:()=>[0,0]},bounds:{type:[Array,Object],default:void 0},maxBounds:{type:[Array,Object],default:void 0},zoom:{type:Number,default:0},minZoom:{type:Number,default:void 0},maxZoom:{type:Number,default:void 0},paddingBottomRight:{type:Array,default:void 0},paddingTopLeft:{type:Array,default:void 0},padding:{type:Array,default:void 0},worldCopyJump:{type:Boolean,default:!1},crs:{type:[String,Object],default:"EPSG3857"},maxBoundsViscosity:{type:Number,default:void 0},inertia:{type:Boolean,default:void 0},inertiaDeceleration:{type:Number,default:void 0},inertiaMaxSpeed:{type:Number,default:void 0},easeLinearity:{type:Number,default:void 0},zoomAnimation:{type:Boolean,default:void 0},zoomAnimationThreshold:{type:Number,default:void 0},fadeAnimation:{type:Boolean,default:void 0},markerZoomAnimation:{type:Boolean,default:void 0},noBlockingAnimations:{type:Boolean,default:!1},useGlobalLeaflet:{type:Boolean,default:!1}},setup(t,e){const l=(0,n.iH)(null),r=(0,n.qj)({ready:!1,leafletRef:{},layersToAdd:[],layersInControl:[]}),{options:s}=me(t),i={...s,minZoom:t.minZoom,maxZoom:t.maxZoom,maxBounds:t.maxBounds,maxBoundsViscosity:t.maxBoundsViscosity,worldCopyJump:t.worldCopyJump,crs:t.crs,center:t.center,zoom:t.zoom,inertia:t.inertia,inertiaDeceleration:t.inertiaDeceleration,inertiaMaxSpeed:t.inertiaMaxSpeed,easeLinearity:t.easeLinearity,zoomAnimation:t.zoomAnimation,zoomAnimationThreshold:t.zoomAnimationThreshold,fadeAnimation:t.fadeAnimation,markerZoomAnimation:t.markerZoomAnimation},u=ie("addLayer"),d=ie("removeLayer"),c=ie("registerControl"),p=ie("registerLayerControl");(0,a.JJ)(ce,t.useGlobalLeaflet);const m={moveEndHandler(){e.emit("update:zoom",r.leafletRef.getZoom()),e.emit("update:center",r.leafletRef.getCenter()),e.emit("update:bounds",r.leafletRef.getBounds())},overlayAddHandler(t){const e=r.layersInControl.find((e=>e.name===t.name));e&&e.updateVisibleProp(!0)},overlayRemoveHandler(t){const e=r.layersInControl.find((e=>e.name===t.name));e&&e.updateVisibleProp(!1)}};(0,a.bv)((async()=>{t.useGlobalLeaflet&&(de.L=de.L||await o.e(243).then(o.t.bind(o,5243,23)));const{map:n,CRS:s,Icon:w,latLngBounds:k,latLng:f,DomEvent:_}=t.useGlobalLeaflet?de.L:await o.e(633).then(o.bind(o,6633));try{i.beforeMapMount&&await i.beforeMapMount()}catch(S){console.error(`The following error occurred running the provided beforeMapMount hook ${S.message}`)}await se(w);const v="string"==typeof i.crs?s[i.crs]:i.crs;i.crs=v||s.EPSG3857;const g={addLayer(t){if(void 0!==t.layerType)if(void 0===r.layerControl)r.layersToAdd.push(t);else{const e=r.layersInControl.find((e=>e.leafletObject._leaflet_id===t.leafletObject._leaflet_id));e||(r.layerControl.addLayer(t),r.layersInControl.push(t))}!1!==t.visible&&r.leafletRef.addLayer(t.leafletObject)},removeLayer(t){void 0!==t.layerType&&(void 0===r.layerControl?r.layersToAdd=r.layersToAdd.filter((e=>e.name!==t.name)):(r.layerControl.removeLayer(t.leafletObject),r.layersInControl=r.layersInControl.filter((e=>e.leafletObject._leaflet_id!==t.leafletObject._leaflet_id)))),r.leafletRef.removeLayer(t.leafletObject)},registerLayerControl(t){r.layerControl=t,r.layersToAdd.forEach((t=>{r.layerControl.addLayer(t)})),r.layersToAdd=[],c(t)},registerControl(t){r.leafletRef.addControl(t.leafletObject)},setZoom(e){const o=r.leafletRef.getZoom();e!==o&&r.leafletRef.setZoom(e,{animate:!t.noBlockingAnimations&&null})},setPaddingBottomRight(t){r.paddingBottomRight=t},setPaddingTopLeft(t){r.paddingTopLeft=t},setPadding(t){r.padding=t},setCrs(t){const e=r.leafletRef.getBounds();r.leafletRef.options.crs=t,r.leafletRef.fitBounds(e,{animate:!1,padding:[0,0]})},fitBounds(t){r.leafletRef.fitBounds(t,{animate:!this.noBlockingAnimations&&null})},setBounds(t){if(!t)return;const e=k(t);if(!e.isValid())return;const o=r.lastSetBounds||r.leafletRef.getBounds(),a=!o.equals(e,0);a&&(r.lastSetBounds=e,r.leafletRef.fitBounds(e,this.fitBoundsOptions))},setCenter(t){if(null==t)return;const e=f(t),o=r.lastSetCenter||r.leafletRef.getCenter();o.lat===e.lat&&o.lng===e.lng||(r.lastSetCenter=e,r.leafletRef.panTo(e,{animate:!this.noBlockingAnimations&&null}))}};ue(u,g.addLayer),ue(d,g.removeLayer),ue(c,g.registerControl),ue(p,g.registerLayerControl),r.leafletRef=n(l.value,i),le(g,r.leafletRef,t);const y=re(e.attrs);r.leafletRef.on("moveend",ae(m.moveEndHandler,100)),r.leafletRef.on("overlayadd",m.overlayAddHandler),r.leafletRef.on("overlayremove",m.overlayRemoveHandler),_.on(r.leafletRef,y),r.ready=!0,(0,a.Y3)((()=>e.emit("ready",r.leafletRef)))})),(0,a.Jd)((()=>{r.leafletRef&&r.leafletRef.remove()}));const w=(0,a.Fl)((()=>r.leafletRef)),k=(0,a.Fl)((()=>r.ready));return{root:l,ready:k,leafletObject:w}},render(){return(0,a.h)("div",{style:{width:"100%",height:"100%"},ref:"root"},this.ready?this.$slots.default():{})},__file:"src/components/LMap.vue"};const je={...we,pane:{type:String,default:"markerPane"},draggable:{type:Boolean,custom:!0,default:!1},latLng:{type:[Object,Array],custom:!0,default:null},icon:{type:[Object],default:()=>{},custom:!1},zIndexOffset:{type:Number,custom:!1,default:null}},We=(t,e,o)=>{const{options:a,methods:n}=ke(t,e,o),l={...a,...t},r={...n,setDraggable(t){e.value.dragging&&(t?e.value.dragging.enable():e.value.dragging.disable())},latLngSync(t){o.emit("update:latLng",t.latlng),o.emit("update:lat-lng",t.latlng)},setLatLng(t){if(null!=t&&e.value){const o=e.value.getLatLng();o&&o.equals(t)||e.value.setLatLng(t)}}};return{options:l,methods:r}};var Pe={name:"LMarker",props:je,setup(t,e){const l=(0,n.iH)({}),r=(0,n.iH)(!1),s=(0,a.f3)(ce),i=(0,a.f3)("addLayer");(0,a.JJ)("canSetParentHtml",(()=>!!l.value.getElement())),(0,a.JJ)("setParentHtml",(t=>l.value.getElement().innerHTML=t)),(0,a.JJ)("setIcon",(t=>l.value.setIcon&&l.value.setIcon(t)));const{options:u,methods:d}=We(t,l,e);return void 0===u.icon&&delete u.icon,(0,a.bv)((async()=>{const{marker:n,DomEvent:c}=s?de.L:await o.e(633).then(o.bind(o,6633));l.value=n(t.latLng,u);const p=re(e.attrs);c.on(l.value,p),l.value.on("move",ae(d.latLngSync,100)),le(d,l.value,t),i({...t,...d,leafletObject:l.value}),r.value=!0,(0,a.Y3)((()=>e.emit("ready",l.value)))})),{ready:r,leafletObject:l}},render(){return fe(this.ready,this.$slots)},__file:"src/components/LMarker.vue"};const Be={...ve,latLngs:{type:Array,default:()=>[]},smoothFactor:{type:Number,custom:!0,default:1},noClip:{type:Boolean,custom:!0,default:!1}},Fe={...Be};const He={...pe,content:{type:String,default:null}};const Me={...Re,tms:{type:Boolean,default:!1},subdomains:{type:String,default:"abc"},detectRetina:{type:Boolean,default:!1},url:{type:String,default:null}},Ze=(t,e)=>{const{options:o,methods:a}=$e(t,e),n={...o,tms:t.tms,subdomains:t.subdomains,detectRetina:t.detectRetina};return{options:n,methods:{...a}}};var qe={props:Me,setup(t,e){const l=(0,n.iH)({}),r=(0,a.f3)(ce),s=(0,a.f3)("addLayer"),{options:i,methods:u}=Ze(t,l);return(0,a.bv)((async()=>{const{tileLayer:n,DomEvent:d}=r?de.L:await o.e(633).then(o.bind(o,6633));l.value=n(t.url,i);const c=re(e.attrs);d.on(l.value,c),le(u,l.value,t),s({...t,...u,leafletObject:l.value}),(0,a.Y3)((()=>e.emit("ready",l.value)))})),{leafletObject:l}},render(){return null},__file:"src/components/LTileLayer.vue"};Boolean,Boolean;var Ge=(0,a.aZ)({__name:"CustomMarker",props:{markerCoordinates:null,isStart:{type:Boolean}},setup(t){const e=t,{isStart:o,markerCoordinates:l}=(0,n.BK)(e);return(t,e)=>(0,n.SU)(l).latitude?((0,a.wg)(),(0,a.j4)((0,n.SU)(Pe),{key:0,"lat-lng":[(0,n.SU)(l).latitude,(0,n.SU)(l).longitude]},{default:(0,a.w5)((()=>[(0,a.Wm)((0,n.SU)(xe),{"icon-url":`/img/workouts/${(0,n.SU)(o)?"start":"finish"}.svg`,iconSize:[15,15]},null,8,["icon-url"])])),_:1},8,["lat-lng"])):(0,a.kq)("",!0)}});const Ke=Ge;var Ye=Ke,Ve=o(5801),Je=o(9917),Xe=o(2024);const Qe=t=>((0,a.dD)("data-v-6b490f5d"),t=t(),(0,a.Cn)(),t),to={id:"workout-map"},eo={key:0,class:"leaflet-container"},oo={key:1},ao=Qe((()=>(0,a._)("i",{class:"fa fa-refresh","aria-hidden":"true"},null,-1))),no={key:1,class:"no-map"};var lo=(0,a.aZ)({__name:"index",props:{workoutData:null,markerCoordinates:{default:()=>({})}},setup(t){const e=t,o=(0,Je.o)(),{workoutData:l,markerCoordinates:r}=(0,n.BK)(e),i=(0,n.iH)(null),u=(0,a.Fl)((()=>g())),d=(0,a.Fl)((()=>o.getters[Ve.SY.GETTERS.APP_CONFIG])),c=(0,a.Fl)((()=>_(u))),p=(0,a.Fl)((()=>e.workoutData&&e.workoutData.gpx?f(e.workoutData.gpx):{})),m=(0,a.Fl)((()=>e.workoutData&&e.workoutData.chartData.length>0?{latitude:e.workoutData.chartData[0].latitude,longitude:e.workoutData.chartData[0].longitude}:{})),w=(0,a.Fl)((()=>e.workoutData&&e.workoutData.chartData.length>0?{latitude:e.workoutData.chartData[e.workoutData.chartData.length-1].latitude,longitude:e.workoutData.chartData[e.workoutData.chartData.length-1].longitude}:{})),k=(0,n.iH)(!1);function f(t){if(!t||""!==t)try{const e=oe((new DOMParser).parseFromString(t,"text/xml"));return{jsonData:e}}catch(e){return console.error("Invalid gpx content"),{}}return{}}function _(t){return[(t.value[0][0]+t.value[1][0])/2,(t.value[0][1]+t.value[1][1])/2]}function v(t){i.value?.leafletObject&&i.value?.leafletObject.fitBounds(t)}function g(){return e.workoutData?[[e.workoutData.workout.bounds[0],e.workoutData.workout.bounds[1]],[e.workoutData.workout.bounds[2],e.workoutData.workout.bounds[3]]]:[]}function y(){i.value?.leafletObject.fitBounds(g())}function S(){k.value=!k.value,k.value||setTimeout((()=>{y()}),100)}return(t,e)=>{const o=(0,a.up)("VFullscreen");return(0,a.wg)(),(0,a.iD)("div",to,[(0,n.SU)(l).loading?((0,a.wg)(),(0,a.iD)("div",eo)):((0,a.wg)(),(0,a.iD)("div",oo,[(0,n.SU)(l).workout.with_gpx?((0,a.wg)(),(0,a.j4)(o,{key:0,modelValue:k.value,"onUpdate:modelValue":e[1]||(e[1]=t=>k.value=t)},{default:(0,a.w5)((()=>[(0,a._)("div",{class:(0,s.C_)(["leaflet-container",{"fullscreen-map":k.value}])},[(0,n.SU)(p).jsonData&&(0,n.SU)(c)&&2===(0,n.SU)(u).length?((0,a.wg)(),(0,a.j4)((0,n.SU)(Le),{key:0,zoom:13,maxZoom:19,center:(0,n.SU)(c),bounds:(0,n.SU)(u),ref_key:"workoutMap",ref:i,onReady:e[0]||(e[0]=t=>v((0,n.SU)(u)))},{default:(0,a.w5)((()=>[(0,a.Wm)((0,n.SU)(Ee)),(0,a.Wm)((0,n.SU)(he),{position:"topleft",class:"map-control",onClick:y},{default:(0,a.w5)((()=>[ao])),_:1}),(0,a.Wm)((0,n.SU)(he),{position:"topleft",class:"map-control",onClick:S},{default:(0,a.w5)((()=>[(0,a._)("i",{class:(0,s.C_)("fa fa-"+(k.value?"compress":"arrows-alt")),"aria-hidden":"true"},null,2)])),_:1}),(0,a.Wm)((0,n.SU)(qe),{url:`${(0,n.SU)(Xe.k)()}workouts/map_tile/{s}/{z}/{x}/{y}.png`,attribution:(0,n.SU)(d).map_attribution,bounds:(0,n.SU)(u)},null,8,["url","attribution","bounds"]),(0,a.Wm)((0,n.SU)(Ce),{geojson:(0,n.SU)(p).jsonData},null,8,["geojson"]),(0,n.SU)(r).latitude?((0,a.wg)(),(0,a.j4)((0,n.SU)(Pe),{key:0,"lat-lng":[(0,n.SU)(r).latitude,(0,n.SU)(r).longitude]},null,8,["lat-lng"])):(0,a.kq)("",!0),(0,a.Wm)((0,n.SU)(ze),{name:t.$t("workouts.START_AND_FINISH"),"layer-type":"overlay"},{default:(0,a.w5)((()=>[(0,n.SU)(m).latitude?((0,a.wg)(),(0,a.j4)(Ye,{key:0,markerCoordinates:(0,n.SU)(m),isStart:!0},null,8,["markerCoordinates"])):(0,a.kq)("",!0),(0,n.SU)(w).latitude?((0,a.wg)(),(0,a.j4)(Ye,{key:1,markerCoordinates:(0,n.SU)(w),isStart:!1},null,8,["markerCoordinates"])):(0,a.kq)("",!0)])),_:1},8,["name"])])),_:1},8,["center","bounds"])):(0,a.kq)("",!0)],2)])),_:1},8,["modelValue"])):((0,a.wg)(),(0,a.iD)("div",no,(0,s.zw)(t.$t("workouts.NO_MAP")),1))]))])}}});const ro=(0,D.Z)(lo,[["__scopeId","data-v-6b490f5d"]]);var so=ro,io=o(6558);const uo={class:"workout-detail"};var co=(0,a.aZ)({__name:"index",props:{authUser:null,displaySegment:{type:Boolean},sports:null,workoutData:null,markerCoordinates:{default:()=>({})}},setup(t){const e=t,o=(0,l.yj)(),r=(0,Je.o)(),{authUser:s,markerCoordinates:i,workoutData:u}=(0,n.BK)(e),d=(0,a.Fl)((()=>e.workoutData.workout)),c=(0,n.iH)(o.params.workoutId?+o.params.segmentId:null),p=(0,a.Fl)((()=>d.value.segments.length>0&&c.value?d.value.segments[+c.value-1]:null)),m=(0,n.iH)(!1),w=(0,a.Fl)((()=>e.sports?e.sports.find((t=>t.id===e.workoutData.workout.sport_id)):{})),k=(0,a.Fl)((()=>_(d.value,p.value)));function f(t,e,o){const a=e&&o&&1!==o?`/workouts/${t.id}/segment/${o-1}`:!e&&t.previous_workout?`/workouts/${t.previous_workout}`:null,n=e&&o&&o<t.segments.length?`/workouts/${t.id}/segment/${o+1}`:!e&&t.next_workout?`/workouts/${t.next_workout}`:null;return{previousUrl:a,nextUrl:n}}function _(t,o){const a=f(t,e.displaySegment,c.value?+c.value:null),n=(0,io.Jo)((0,io.eB)(e.workoutData.workout.workout_date,e.authUser.timezone),e.authUser.date_format);return{ascent:o?o.ascent:t.ascent,aveSpeed:o?o.ave_speed:t.ave_speed,distance:o?o.distance:t.distance,descent:o?o.descent:t.descent,duration:o?o.duration:t.duration,maxAlt:o?o.max_alt:t.max_alt,maxSpeed:o?o.max_speed:t.max_speed,minAlt:o?o.min_alt:t.min_alt,moving:o?o.moving:t.moving,nextUrl:a.nextUrl,pauses:o?o.pauses:t.pauses,previousUrl:a.previousUrl,records:o?[]:t.records,segmentId:o?o.segment_id:null,title:t.title,type:e.displaySegment?"SEGMENT":"WORKOUT",workoutDate:n.workout_date,weatherEnd:o?null:t.weather_end,weatherStart:o?null:t.weather_start,with_gpx:t.with_gpx,workoutId:t.id,workoutTime:n.workout_time}}function v(t){m.value=t}function g(t){r.dispatch(Ve.aX.ACTIONS.DELETE_WORKOUT,{workoutId:t})}return(0,a.YP)((()=>o.params.segmentId),(async t=>{t&&(c.value=+t)})),(t,e)=>{const o=(0,a.up)("Modal"),l=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",uo,[m.value?((0,a.wg)(),(0,a.j4)(o,{key:0,title:t.$t("common.CONFIRMATION"),message:t.$t("workouts.WORKOUT_DELETION_CONFIRMATION"),onConfirmAction:e[0]||(e[0]=t=>g((0,n.SU)(k).workoutId)),onCancelAction:e[1]||(e[1]=t=>v(!1))},null,8,["title","message"])):(0,a.kq)("",!0),(0,a.Wm)(l,null,{title:(0,a.w5)((()=>[(0,a.Wm)(I,{sport:(0,n.SU)(w),workoutObject:(0,n.SU)(k),onDisplayModal:e[2]||(e[2]=t=>v(!0))},null,8,["sport","workoutObject"])])),content:(0,a.w5)((()=>[(0,a.Wm)(so,{workoutData:(0,n.SU)(u),markerCoordinates:(0,n.SU)(i)},null,8,["workoutData","markerCoordinates"]),(0,a.Wm)(xt,{workoutObject:(0,n.SU)(k),useImperialUnits:(0,n.SU)(s).imperial_units,displayHARecord:(0,n.SU)(s).display_ascent},null,8,["workoutObject","useImperialUnits","displayHARecord"])])),_:1})])}}});const po=(0,D.Z)(co,[["__scopeId","data-v-9fc0bab8"]]);var mo=po,wo=o(6518);const ko=t=>{const e=document.getElementById(t);if(e){let t=e.querySelector("ul");return t||(t=document.createElement("ul"),e.appendChild(t)),t}throw new Error("No legend container")},fo={id:"htmlLegend",afterUpdate(t,e,o){const a=ko(o.containerID);while(a.firstChild)a.firstChild.remove();const n=t.options.plugins?.legend?.labels?.generateLabels?t.options.plugins?.legend?.labels?.generateLabels(t):[];n.forEach((e=>{const o=document.createElement("li");o.onclick=()=>{void 0!==e.datasetIndex&&(t.setDatasetVisibility(e.datasetIndex,!t.isDatasetVisible(e.datasetIndex)),t.update())};const n=document.createElement("input");n&&(n.type="checkbox",n.id=e.text,n.checked=!e.hidden);const l=document.createTextNode(e.text),r=document.createElement("span");r&&(r.style.background=String(e.fillStyle),r.style.borderColor=String(e.strokeStyle)),o.appendChild(n),o.appendChild(l),o.appendChild(r),a.appendChild(o)}))}};var _o=o(3649),vo=o(3768);const go=t=>((0,a.dD)("data-v-dcea1168"),t=t(),(0,a.Cn)(),t),yo={id:"workout-chart"},So={class:"chart-radio"},Uo=["checked"],ho=["checked"],bo=go((()=>(0,a._)("div",{id:"chart-legend"},null,-1))),To={class:"chart-info"},Eo={class:"no-data-cleaning"},Do={class:"elevation-start"},Oo=["checked"];var Io=(0,a.aZ)({__name:"index",props:{authUser:null,workoutData:null},emits:["getCoordinates"],setup(t,{emit:e}){const o=t,{t:l}=(0,L.QT)(),r=(0,n.iH)(!0),i=(0,n.iH)(!0),u=(0,a.Fl)((()=>(0,vo.EX)(o.workoutData.chartData,l,o.authUser.imperial_units))),d=y("km"),c=y("m"),p=(0,a.Fl)((()=>({labels:r.value?u.value.distance_labels:u.value.duration_labels,datasets:JSON.parse(JSON.stringify([u.value.datasets.speed,u.value.datasets.elevation]))}))),m=(0,a.Fl)((()=>u.value.coordinates)),w=(0,a.Fl)((()=>({responsive:!0,maintainAspectRatio:!0,animation:!1,layout:{padding:{top:22}},scales:{[r.value?"xDistance":"xDuration"]:{grid:{drawOnChartArea:!1},ticks:{count:10,callback:function(t){return r.value?Number(t).toFixed(2):_(t)}},type:"linear",bounds:"data",title:{display:!0,text:r.value?l("workouts.DISTANCE")+` (${d})`:l("workouts.DURATION")}},ySpeed:{grid:{drawOnChartArea:!1},position:"left",title:{display:!0,text:l("workouts.SPEED")+` (${d}/h)`}},yElevation:{beginAtZero:i.value,grid:{drawOnChartArea:!1},position:"right",title:{display:!0,text:l("workouts.ELEVATION")+` (${c})`}}},elements:{point:{pointStyle:"circle",pointRadius:0}},plugins:{datalabels:{display:!1},tooltip:{interaction:{intersect:!1,mode:"index"},callbacks:{label:function(t){const e=` ${t.dataset.label}: ${t.formattedValue}`;return"yElevation"===t.dataset.yAxisID?e+` ${c}`:e+` ${d}/h`},title:function(t){return t.length>0&&v(m.value[t[0].dataIndex]),0===t.length?"":r.value?`${l("workouts.DISTANCE")}: ${t[0].label} ${d}`:`${l("workouts.DURATION")}: ${_(t[0].label.replace(",",""))}`}}},legend:{display:!1},htmlLegend:{containerID:"chart-legend"}}}))),{lineChartProps:k}=(0,wo.tn)({chartData:p,options:w,plugins:[fo]});function f(){r.value=!r.value}function _(t){return new Date(1e3*+t).toISOString().substr(11,8)}function v(t){e("getCoordinates",t)}function g(){v({latitude:null,longitude:null})}function y(t){return o.authUser.imperial_units?_o.Dl[t].defaultTarget:t}return(t,e)=>{const o=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",yo,[(0,a.Wm)(o,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.ANALYSIS")),1)])),content:(0,a.w5)((()=>[(0,a._)("div",So,[(0,a._)("label",null,[(0,a._)("input",{type:"radio",name:"distance",checked:r.value,onClick:f},null,8,Uo),(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.DISTANCE")),1)]),(0,a._)("label",null,[(0,a._)("input",{type:"radio",name:"duration",checked:!r.value,onClick:f},null,8,ho),(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.DURATION")),1)])]),bo,(0,a.Wm)((0,n.SU)(wo.wW),(0,a.dG)((0,n.SU)(k),{class:"line-chart",onMouseleave:g}),null,16),(0,a._)("div",To,[(0,a._)("div",Eo,(0,s.zw)(t.$t("workouts.NO_DATA_CLEANING")),1),(0,a._)("div",Do,[(0,a._)("label",null,[(0,a._)("input",{type:"checkbox",checked:i.value,onClick:e[0]||(e[0]=t=>i.value=!i.value)},null,8,Oo),(0,a.Uk)(" "+(0,s.zw)(t.$t("workouts.START_ELEVATION_AT_ZERO")),1)])])])])),_:1})])}}});const Ao=(0,D.Z)(Io,[["__scopeId","data-v-dcea1168"]]);var Co=Ao;const Ro={id:"workout-note"};var $o=(0,a.aZ)({__name:"WorkoutNotes",props:{notes:{default:()=>null}},setup(t){const e=t,{notes:o}=(0,n.BK)(e);return(t,e)=>{const l=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",Ro,[(0,a.Wm)(l,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.NOTES")),1)])),content:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)((0,n.SU)(o)&&""!==(0,n.SU)(o)?(0,n.SU)(o):t.$t("workouts.NO_NOTES")),1)])),_:1})])}}});const No=(0,D.Z)($o,[["__scopeId","data-v-028ad527"]]);var xo=No;const zo={id:"workout-segments"};var Lo=(0,a.aZ)({__name:"WorkoutSegments",props:{segments:null,useImperialUnits:{type:Boolean}},setup(t){const e=t,{segments:o,useImperialUnits:l}=(0,n.BK)(e);return(t,e)=>{const r=(0,a.up)("router-link"),i=(0,a.up)("Distance"),u=(0,a.up)("Card");return(0,a.wg)(),(0,a.iD)("div",zo,[(0,a.Wm)(u,null,{title:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.SEGMENT",2)),1)])),content:(0,a.w5)((()=>[(0,a._)("ul",null,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,n.SU)(o),((e,o)=>((0,a.wg)(),(0,a.iD)("li",{key:e.segment_id},[(0,a.Wm)(r,{to:{name:"WorkoutSegment",params:{workoutId:e.workout_id,segmentId:o+1}}},{default:(0,a.w5)((()=>[(0,a.Uk)((0,s.zw)(t.$t("workouts.SEGMENT",1))+" "+(0,s.zw)(o+1),1)])),_:2},1032,["to"]),(0,a.Uk)(" ("+(0,s.zw)(t.$t("workouts.DISTANCE"))+": ",1),(0,a.Wm)(i,{distance:e.distance,unitFrom:"km",useImperialUnits:(0,n.SU)(l)},null,8,["distance","useImperialUnits"]),(0,a.Uk)(", "+(0,s.zw)(t.$t("workouts.DURATION"))+": "+(0,s.zw)(e.duration)+") ",1)])))),128))])])),_:1})])}}});const jo=(0,D.Z)(Lo,[["__scopeId","data-v-6b8a27cd"]]);var Wo=jo;const Po=t=>((0,a.dD)("data-v-53c4e53a"),t=t(),(0,a.Cn)(),t),Bo={id:"workout",class:"view"},Fo={class:"container"},Ho={key:0,class:"workout-container"},Mo={key:0},Zo=Po((()=>(0,a._)("div",{id:"bottom"},null,-1))),qo={key:1};var Go=(0,a.aZ)({__name:"Workout",props:{displaySegment:{type:Boolean}},setup(t){const e=t,o=(0,l.yj)(),s=(0,Je.o)(),{displaySegment:i}=(0,n.BK)(e),u=(0,a.Fl)((()=>s.getters[Ve.aX.GETTERS.WORKOUT_DATA])),d=(0,a.Fl)((()=>s.getters[Ve.YN.GETTERS.AUTH_USER_PROFILE])),c=(0,a.Fl)((()=>s.getters[Ve.O8.GETTERS.SPORTS])),p=(0,n.iH)({latitude:null,longitude:null});function m(t){p.value={latitude:t.latitude,longitude:t.longitude}}return(0,a.wF)((()=>{const t={workoutId:o.params.workoutId};e.displaySegment&&(t.segmentId=o.params.segmentId),s.dispatch(Ve.aX.ACTIONS.GET_WORKOUT_DATA,t)})),(0,a.Ah)((()=>{s.commit(Ve.aX.MUTATIONS.EMPTY_WORKOUT)})),(0,a.YP)((()=>o.params.workoutId),(async t=>{t&&s.dispatch(Ve.aX.ACTIONS.GET_WORKOUT_DATA,{workoutId:t})})),(0,a.YP)((()=>o.params.segmentId),(async t=>{if(o.params.workoutId){const e={workoutId:o.params.workoutId};t&&(e.segmentId=t),s.dispatch(Ve.aX.ACTIONS.GET_WORKOUT_DATA,e)}})),(t,e)=>((0,a.wg)(),(0,a.iD)("div",Bo,[(0,a._)("div",Fo,[(0,n.SU)(c).length>0?((0,a.wg)(),(0,a.iD)("div",Ho,[(0,n.SU)(u).workout.id?((0,a.wg)(),(0,a.iD)("div",Mo,[(0,a.Wm)(mo,{workoutData:(0,n.SU)(u),sports:(0,n.SU)(c),authUser:(0,n.SU)(d),markerCoordinates:p.value,displaySegment:(0,n.SU)(i)},null,8,["workoutData","sports","authUser","markerCoordinates","displaySegment"]),(0,n.SU)(u).workout.with_gpx&&(0,n.SU)(u).chartData.length>0?((0,a.wg)(),(0,a.j4)(Co,{key:0,workoutData:(0,n.SU)(u),authUser:(0,n.SU)(d),displaySegment:(0,n.SU)(i),onGetCoordinates:m},null,8,["workoutData","authUser","displaySegment"])):(0,a.kq)("",!0),!(0,n.SU)(i)&&(0,n.SU)(u).workout.segments.length>1?((0,a.wg)(),(0,a.j4)(Wo,{key:1,segments:(0,n.SU)(u).workout.segments,useImperialUnits:(0,n.SU)(d).imperial_units},null,8,["segments","useImperialUnits"])):(0,a.kq)("",!0),(0,n.SU)(i)?(0,a.kq)("",!0):((0,a.wg)(),(0,a.j4)(xo,{key:2,notes:(0,n.SU)(u).workout.notes},null,8,["notes"])),Zo])):((0,a.wg)(),(0,a.iD)("div",qo,[(0,n.SU)(u).loading?(0,a.kq)("",!0):((0,a.wg)(),(0,a.j4)(r.Z,{key:0,target:"WORKOUT"}))]))])):(0,a.kq)("",!0)])]))}});const Ko=(0,D.Z)(Go,[["__scopeId","data-v-53c4e53a"]]);var Yo=Ko},5651:function(t,e,o){o.r(e),o.d(e,{default:function(){return Bt}});var a=o(6252),n=o(2262),l=o(3577),r=o(9150),s=(o(7658),o(2201)),i=o(631),u=o(3649);const d=t=>((0,a.dD)("data-v-6c38593a"),t=t(),(0,a.Cn)(),t),c={class:"workouts-filters"},p={class:"box"},m={class:"form"},w={class:"form-items-group"},k={class:"form-item"},f=["value"],_={class:"form-item"},v=["value"],g={class:"form-items-group"},y={class:"form-item"},S=["value"],U=d((()=>(0,a._)("option",{value:""},null,-1))),h=["value"],b={class:"form-items-group"},T={class:"form-item"},E={class:"form-inputs-group"},D=["value"],O=["value"],I={class:"form-items-group"},A={class:"form-item"},C={class:"form-inputs-group"},R=["value"],$=["value"],N={class:"form-items-group"},x={class:"form-item"},z={class:"form-inputs-group"},L=["value"],j=["value"],W={class:"form-items-group"},P={class:"form-item"},B={class:"form-inputs-group"},F=["value"],H=["value"],M={class:"form-button"};var Z=(0,a.aZ)({__name:"WorkoutsFilters",props:{authUser:null,sports:null},emits:["filter"],setup(t,{emit:e}){const o=t,{t:d}=(0,r.QT)(),Z=(0,s.yj)(),q=(0,s.tv)(),{authUser:G}=(0,n.BK)(o),K=G.value.imperial_units?u.Dl.km.defaultTarget:"km",Y=(0,a.Fl)((()=>(0,i.xH)(o.sports,d)));let V=Object.assign({},Z.query);function J(t){""===t.target.value?delete V[t.target.name]:V[t.target.name]=t.target.value}function X(){e("filter"),"page"in V&&(V["page"]="1"),q.push({path:"/workouts",query:V})}function Q(){e("filter"),q.push({path:"/workouts",query:{}})}return(0,a.YP)((()=>Z.query),(t=>{V=Object.assign({},t)})),(t,e)=>((0,a.wg)(),(0,a.iD)("div",c,[(0,a._)("div",p,[(0,a._)("div",m,[(0,a._)("div",w,[(0,a._)("div",k,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.FROM"))+": ",1),(0,a._)("input",{name:"from",type:"date",value:t.$route.query.from,onChange:J},null,40,f)]),(0,a._)("div",_,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.TO"))+": ",1),(0,a._)("input",{name:"to",type:"date",value:t.$route.query.to,onChange:J},null,40,v)])]),(0,a._)("div",g,[(0,a._)("div",y,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.SPORT",1))+":",1),(0,a._)("select",{name:"sport_id",value:t.$route.query.sport_id,onChange:J},[U,((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,n.SU)(Y).filter((t=>(0,n.SU)(G).sports_list.includes(t.id))),(t=>((0,a.wg)(),(0,a.iD)("option",{value:t.id,key:t.id},(0,l.zw)(t.translatedLabel),9,h)))),128))],40,S)])]),(0,a._)("div",b,[(0,a._)("div",T,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.DISTANCE"))+" ("+(0,l.zw)((0,n.SU)(K))+"): ",1),(0,a._)("div",E,[(0,a._)("input",{name:"distance_from",type:"number",min:"0",step:"0.1",value:t.$route.query.distance_from,onChange:J},null,40,D),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{name:"distance_to",type:"number",min:"0",step:"0.1",value:t.$route.query.distance_to,onChange:J},null,40,O)])])]),(0,a._)("div",I,[(0,a._)("div",A,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.DURATION"))+": ",1),(0,a._)("div",C,[(0,a._)("input",{name:"duration_from",value:t.$route.query.duration_from,onChange:J,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,R),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{name:"duration_to",value:t.$route.query.duration_to,onChange:J,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,$)])])]),(0,a._)("div",N,[(0,a._)("div",x,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.AVE_SPEED"))+" ("+(0,l.zw)((0,n.SU)(K))+"/h): ",1),(0,a._)("div",z,[(0,a._)("input",{min:"0",name:"ave_speed_from",value:t.$route.query.ave_speed_from,onChange:J,step:"0.1",type:"number"},null,40,L),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{min:"0",name:"ave_speed_to",value:t.$route.query.ave_speed_to,onChange:J,step:"0.1",type:"number"},null,40,j)])])]),(0,a._)("div",W,[(0,a._)("div",P,[(0,a._)("label",null,(0,l.zw)(t.$t("workouts.MAX_SPEED"))+" ("+(0,l.zw)((0,n.SU)(K))+"/h): ",1),(0,a._)("div",B,[(0,a._)("input",{min:"0",name:"max_speed_from",value:t.$route.query.max_speed_from,onChange:J,step:"0.1",type:"number"},null,40,F),(0,a._)("span",null,(0,l.zw)(t.$t("workouts.TO")),1),(0,a._)("input",{min:"0",name:"max_speed_to",value:t.$route.query.max_speed_to,onChange:J,step:"0.1",type:"number"},null,40,H)])])])]),(0,a._)("div",M,[(0,a._)("button",{class:"confirm",onClick:X},(0,l.zw)(t.$t("buttons.FILTER")),1),(0,a._)("button",{class:"confirm",onClick:Q},(0,l.zw)(t.$t("buttons.CLEAR_FILTER")),1)])])]))}}),q=o(3744);const G=(0,q.Z)(Z,[["__scopeId","data-v-6c38593a"]]);var K=G,Y=o(8626),V=o(5020),J=o(2056),X=o(5630),Q=o(5801),tt=o(9917),et=o(2766),ot=o(6558),at=o(3768);const nt=t=>((0,a.dD)("data-v-0f8ea7b0"),t=t(),(0,a.Cn)(),t),lt={class:"workouts-list"},rt={class:"total"},st={class:"total-label"},it={key:0},ut={key:0,class:"workouts-table responsive-table"},dt=nt((()=>(0,a._)("th",{class:"sport-col"},null,-1))),ct={class:"sport-col"},pt={class:"cell-heading"},mt=["onMouseover"],wt={class:"cell-heading"},kt={key:0,class:"fa fa-map-o","aria-hidden":"true"},ft={class:"title"},_t={class:"workout-date"},vt={class:"cell-heading"},gt={class:"text-right"},yt={class:"cell-heading"},St={class:"text-right"},Ut={class:"cell-heading"},ht={class:"text-right"},bt={class:"cell-heading"},Tt={class:"text-right"},Et={class:"cell-heading"},Dt={class:"text-right"},Ot={class:"cell-heading"},It={class:"text-right"},At={class:"cell-heading"},Ct=nt((()=>(0,a._)("div",{id:"bottom"},null,-1)));var Rt=(0,a.aZ)({__name:"WorkoutsList",props:{user:null,sports:null},setup(t){const e=t,o=(0,tt.o)(),r=(0,s.yj)(),d=(0,s.tv)(),{user:c,sports:p}=(0,n.BK)(e),m=["ave_speed","distance","duration","workout_date"],w=(0,a.Fl)((()=>o.getters[Q.aX.GETTERS.USER_WORKOUTS])),k=(0,a.Fl)((()=>o.getters[Q.aX.GETTERS.WORKOUTS_PAGINATION])),f=(0,a.Fl)((()=>o.getters[Q.SY.GETTERS.LANGUAGE]));let _=S(r.query);const v=(0,n.iH)(null);function g(t){o.dispatch(Q.aX.ACTIONS.GET_USER_WORKOUTS,c.value.imperial_units?U(t):t)}function y(t,e){const o=Object.assign({},r.query);o[t]=e,"per_page"===t&&(o["page"]="1"),_=S(o),d.push({path:"/workouts",query:_})}function S(t){const e=(0,et.pm)(t,m,at.eR.order_by,{defaultSort:at.eR.order});return Object.keys(t).filter((t=>et.Ne.includes(t))).map((o=>{"string"===typeof t[o]&&(e[o]=t[o])})),e}function U(t){const e={...t};return Object.entries(e).map((t=>{t[0].match("speed|distance")&&t[1]&&(e[t[0]]=(0,u.sC)(+t[1],"mi","km"))})),e}function h(t){v.value=t}return(0,a.wF)((()=>{g(_)})),(0,a.YP)((()=>r.query),(async t=>{_=S(t),g(_)})),(t,e)=>{const o=(0,a.up)("SportImage"),r=(0,a.up)("router-link"),s=(0,a.up)("Distance");return(0,a.wg)(),(0,a.iD)("div",lt,[(0,a._)("div",{class:(0,l.C_)(["box",{"empty-table":0===(0,n.SU)(w).length}])},[(0,a._)("div",rt,[(0,a._)("span",st,(0,l.zw)(t.$t("common.TOTAL").toLowerCase())+": ",1),null!==(0,n.SU)(k).total?((0,a.wg)(),(0,a.iD)("span",it,(0,l.zw)((0,n.SU)(k).total)+" "+(0,l.zw)(t.$t("workouts.WORKOUT",(0,n.SU)(k).total)),1)):(0,a.kq)("",!0)]),(0,a.Wm)(Y.Z,{sort:(0,n.SU)(et.fS),order_by:m,query:(0,n.SU)(_),message:"workouts",onUpdateSelect:y},null,8,["sort","query"]),(0,n.SU)(w).length>0?((0,a.wg)(),(0,a.iD)("div",ut,[(0,a.Wm)(V.Z,{class:"top-pagination",pagination:(0,n.SU)(k),path:"/workouts",query:(0,n.SU)(_)},null,8,["pagination","query"]),(0,a._)("table",null,[(0,a._)("thead",{class:(0,l.C_)({smaller:"de"===(0,n.SU)(f)})},[(0,a._)("tr",null,[dt,(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.WORKOUT",1))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DATE"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DISTANCE"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DURATION"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.AVE_SPEED"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.MAX_SPEED"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.ASCENT"))),1),(0,a._)("th",null,(0,l.zw)((0,l.kC)(t.$t("workouts.DESCENT"))),1)])],2),(0,a._)("tbody",null,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,n.SU)(w),(u=>((0,a.wg)(),(0,a.iD)("tr",{key:u.id},[(0,a._)("td",ct,[(0,a._)("span",pt,(0,l.zw)(t.$t("workouts.SPORT",1)),1),(0,n.SU)(p).length>0?((0,a.wg)(),(0,a.j4)(o,{key:0,title:(0,n.SU)(p).find((t=>t.id===u.sport_id)).translatedLabel,"sport-label":(0,n.SU)(i.PA)(u,(0,n.SU)(p)),color:(0,n.SU)(i.CM)(u,(0,n.SU)(p))},null,8,["title","sport-label","color"])):(0,a.kq)("",!0)]),(0,a._)("td",{class:"workout-title",onMouseover:t=>h(u.id),onMouseleave:e[0]||(e[0]=t=>h(null))},[(0,a._)("span",wt,(0,l.zw)((0,l.kC)(t.$t("workouts.WORKOUT",1))),1),(0,a.Wm)(r,{class:"nav-item",to:{name:"Workout",params:{workoutId:u.id}}},{default:(0,a.w5)((()=>[u.with_gpx?((0,a.wg)(),(0,a.iD)("i",kt)):(0,a.kq)("",!0),(0,a._)("span",ft,(0,l.zw)(u.title),1)])),_:2},1032,["to"]),u.with_gpx&&v.value===u.id?((0,a.wg)(),(0,a.j4)(J.Z,{key:0,workout:u,"display-hover":!0},null,8,["workout"])):(0,a.kq)("",!0)],40,mt),(0,a._)("td",_t,[(0,a._)("span",vt,(0,l.zw)(t.$t("workouts.DATE")),1),(0,a.Uk)(" "+(0,l.zw)((0,n.SU)(ot.p6)(u.workout_date,(0,n.SU)(c).timezone,(0,n.SU)(c).date_format)),1)]),(0,a._)("td",gt,[(0,a._)("span",yt,(0,l.zw)(t.$t("workouts.DISTANCE")),1),(0,a.Wm)(s,{distance:u.distance,unitFrom:"km",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",St,[(0,a._)("span",Ut,(0,l.zw)(t.$t("workouts.DURATION")),1),(0,a.Uk)(" "+(0,l.zw)(u.moving),1)]),(0,a._)("td",ht,[(0,a._)("span",bt,(0,l.zw)(t.$t("workouts.AVE_SPEED")),1),(0,a.Wm)(s,{distance:u.ave_speed,unitFrom:"km",speed:!0,useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",Tt,[(0,a._)("span",Et,(0,l.zw)(t.$t("workouts.MAX_SPEED")),1),(0,a.Wm)(s,{distance:u.max_speed,unitFrom:"km",speed:!0,useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])]),(0,a._)("td",Dt,[(0,a._)("span",Ot,(0,l.zw)(t.$t("workouts.ASCENT")),1),u.with_gpx?((0,a.wg)(),(0,a.j4)(s,{key:0,distance:u.ascent,unitFrom:"m",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])):(0,a.kq)("",!0)]),(0,a._)("td",It,[(0,a._)("span",At,(0,l.zw)(t.$t("workouts.DESCENT")),1),u.with_gpx?((0,a.wg)(),(0,a.j4)(s,{key:0,distance:u.descent,unitFrom:"m",useImperialUnits:(0,n.SU)(c).imperial_units},null,8,["distance","useImperialUnits"])):(0,a.kq)("",!0)])])))),128))])]),(0,a.Wm)(V.Z,{pagination:(0,n.SU)(k),path:"/workouts",query:(0,n.SU)(_)},null,8,["pagination","query"])])):(0,a.kq)("",!0)],2),0===(0,n.SU)(w).length?((0,a.wg)(),(0,a.j4)(X.Z,{key:0})):(0,a.kq)("",!0),Ct])}}});const $t=(0,q.Z)(Rt,[["__scopeId","data-v-0f8ea7b0"]]);var Nt=$t;const xt={key:0,id:"workouts",class:"view"},zt={class:"container workouts-container"},Lt={class:"display-filters"},jt={class:"list-container"};var Wt=(0,a.aZ)({__name:"WorkoutsView",setup(t){const{t:e}=(0,r.QT)(),o=(0,tt.o)(),s=(0,a.Fl)((()=>o.getters[Q.YN.GETTERS.AUTH_USER_PROFILE])),u=(0,a.Fl)((()=>o.getters[Q.O8.GETTERS.SPORTS])),d=(0,a.Fl)((()=>(0,i.xH)(u.value,e))),c=(0,n.iH)(!0);function p(){c.value=!c.value}return(t,e)=>(0,n.SU)(s).username?((0,a.wg)(),(0,a.iD)("div",xt,[(0,a._)("div",zt,[(0,a._)("div",{class:(0,l.C_)(["filters-container",{hidden:c.value}])},[(0,a.Wm)(K,{sports:(0,n.SU)(d),authUser:(0,n.SU)(s),onFilter:p},null,8,["sports","authUser"])],2),(0,a._)("div",Lt,[(0,a._)("div",{onClick:p},[(0,a._)("i",{class:(0,l.C_)("fa fa-caret-"+(c.value?"down":"up")),"aria-hidden":"true"},null,2),(0,a._)("span",null,(0,l.zw)(t.$t(`workouts.${c.value?"DISPLAY":"HIDE"}_FILTERS`)),1)])]),(0,a._)("div",jt,[(0,a.Wm)(Nt,{user:(0,n.SU)(s),sports:(0,n.SU)(d)},null,8,["user","sports"])])])])):(0,a.kq)("",!0)}});const Pt=(0,q.Z)(Wt,[["__scopeId","data-v-77e54012"]]);var Bt=Pt}}]);
//# sourceMappingURL=workouts.8abaa659.js.map