2 lines
83 KiB
JavaScript
2 lines
83 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["workouts"],{"0385":function(e,t,o){"use strict";o.r(t);var r=o("7a23"),a=Object(r["withScopeId"])("data-v-819c97ae");Object(r["pushScopeId"])("data-v-819c97ae");var n={key:0,id:"workouts"},c={class:"container workouts-container"},i={class:"display-filters"},l={class:"list-container"};Object(r["popScopeId"])();var u=a((function(e,t,o,a,u,s){var d=Object(r["resolveComponent"])("WorkoutsFilters"),p=Object(r["resolveComponent"])("WorkoutsList");return e.authUser.username?(Object(r["openBlock"])(),Object(r["createBlock"])("div",n,[Object(r["createVNode"])("div",c,[Object(r["createVNode"])("div",{class:["filters-container",{hidden:e.hiddenFilters}]},[Object(r["createVNode"])(d,{sports:e.translatedSports,authUser:e.authUser,onFilter:e.toggleFilters},null,8,["sports","authUser","onFilter"])],2),Object(r["createVNode"])("div",i,[Object(r["createVNode"])("div",{onClick:t[1]||(t[1]=function(){return e.toggleFilters&&e.toggleFilters.apply(e,arguments)})},[Object(r["createVNode"])("i",{class:"fa fa-caret-".concat(e.hiddenFilters?"down":"up"),"aria-hidden":"true"},null,2),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.$t("workouts.".concat(e.hiddenFilters?"DISPLAY":"HIDE","_FILTERS"))),1)])]),Object(r["createVNode"])("div",l,[Object(r["createVNode"])(p,{user:e.authUser,sports:e.translatedSports},null,8,["user","sports"])])])])):Object(r["createCommentVNode"])("",!0)})),s=o("47e2"),d=(o("4de4"),o("caad"),o("2532"),Object(r["withScopeId"])("data-v-78f33062"));Object(r["pushScopeId"])("data-v-78f33062");var p={class:"workouts-filters"},b={class:"box"},O={class:"form"},j={class:"form-items-group"},m={class:"form-item"},f={class:"form-item"},k={class:"form-items-group"},g={class:"form-item"},y=Object(r["createVNode"])("option",{value:""},null,-1),v={class:"form-items-group"},w={class:"form-item"},h={class:"form-inputs-group"},N={class:"form-items-group"},S={class:"form-item"},T={class:"form-inputs-group"},V={class:"form-items-group"},D={class:"form-item"},C={class:"form-inputs-group"},_={class:"form-items-group"},E={class:"form-item"},x={class:"form-inputs-group"},A={class:"form-button"};Object(r["popScopeId"])();var B=d((function(e,t,o,a,n,c){return Object(r["openBlock"])(),Object(r["createBlock"])("div",p,[Object(r["createVNode"])("div",b,[Object(r["createVNode"])("div",O,[Object(r["createVNode"])("div",j,[Object(r["createVNode"])("div",m,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.FROM"))+": ",1),Object(r["createVNode"])("input",{name:"from",type:"date",value:e.$route.query.from,onChange:t[1]||(t[1]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,40,["value"])]),Object(r["createVNode"])("div",f,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.TO"))+": ",1),Object(r["createVNode"])("input",{name:"to",type:"date",value:e.$route.query.to,onChange:t[2]||(t[2]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,40,["value"])])]),Object(r["createVNode"])("div",k,[Object(r["createVNode"])("div",g,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.SPORT",1))+":",1),Object(r["createVNode"])("select",{name:"sport_id",value:e.$route.query.sport_id,onChange:t[3]||(t[3]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},[y,(Object(r["openBlock"])(!0),Object(r["createBlock"])(r["Fragment"],null,Object(r["renderList"])(e.translatedSports.filter((function(t){return e.authUser.sports_list.includes(t.id)})),(function(e){return Object(r["openBlock"])(),Object(r["createBlock"])("option",{value:e.id,key:e.id},Object(r["toDisplayString"])(e.label),9,["value"])})),128))],40,["value"])])]),Object(r["createVNode"])("div",v,[Object(r["createVNode"])("div",w,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.DISTANCE"))+" (km): ",1),Object(r["createVNode"])("div",h,[Object(r["createVNode"])("input",{name:"distance_from",type:"number",min:"0",step:"1",value:e.$route.query.distance_from,onChange:t[4]||(t[4]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,40,["value"]),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.$t("workouts.TO")),1),Object(r["createVNode"])("input",{name:"distance_to",type:"number",min:"0",step:"1",value:e.$route.query.distance_to,onChange:t[5]||(t[5]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)})},null,40,["value"])])])]),Object(r["createVNode"])("div",N,[Object(r["createVNode"])("div",S,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.DURATION"))+" (km): ",1),Object(r["createVNode"])("div",T,[Object(r["createVNode"])("input",{name:"duration_from",value:e.$route.query.duration_from,onChange:t[6]||(t[6]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,["value"]),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.$t("workouts.TO")),1),Object(r["createVNode"])("input",{name:"duration_to",value:e.$route.query.duration_to,onChange:t[7]||(t[7]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,["value"])])])]),Object(r["createVNode"])("div",V,[Object(r["createVNode"])("div",D,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.AVE_SPEED"))+" (km): ",1),Object(r["createVNode"])("div",C,[Object(r["createVNode"])("input",{min:"0",name:"ave_speed_from",value:e.$route.query.ave_speed_from,onChange:t[8]||(t[8]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,40,["value"]),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.$t("workouts.TO")),1),Object(r["createVNode"])("input",{min:"0",name:"ave_speed_to",value:e.$route.query.ave_speed_to,onChange:t[9]||(t[9]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,40,["value"])])])]),Object(r["createVNode"])("div",_,[Object(r["createVNode"])("div",E,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_SPEED"))+" (km): ",1),Object(r["createVNode"])("div",x,[Object(r["createVNode"])("input",{min:"0",name:"max_speed_from",value:e.$route.query.max_speed_from,onChange:t[10]||(t[10]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,40,["value"]),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.$t("workouts.TO")),1),Object(r["createVNode"])("input",{min:"0",name:"max_speed_to",value:e.$route.query.max_speed_to,onChange:t[11]||(t[11]=function(){return e.handleFilterChange&&e.handleFilterChange.apply(e,arguments)}),step:"1",type:"number"},null,40,["value"])])])])]),Object(r["createVNode"])("div",A,[Object(r["createVNode"])("button",{class:"confirm",onClick:t[12]||(t[12]=function(){return e.onFilter&&e.onFilter.apply(e,arguments)})},Object(r["toDisplayString"])(e.$t("buttons.FILTER")),1)])])])})),I=(o("b0c0"),o("6c02")),R=o("1119"),L=Object(r["defineComponent"])({name:"WorkoutsFilters",props:{authUser:{type:Object,required:!0},sports:{type:Object,required:!0}},emits:["filter"],setup:function(e,t){var o=t.emit,a=Object(s["b"])(),n=a.t,c=Object(I["c"])(),i=Object(I["d"])(),l=Object(r["computed"])((function(){return Object(R["d"])(e.sports,n)})),u=Object.assign({},c.query);function d(e){""===e.target.value?delete u[e.target.name]:u[e.target.name]=e.target.value}function p(){o("filter"),"page"in u&&(u["page"]="1"),i.push({path:"/workouts",query:u})}return Object(r["watch"])((function(){return c.query}),(function(e){u=Object.assign({},e)})),{translatedSports:l,onFilter:p,handleFilterChange:d}}});o("166a");L.render=B,L.__scopeId="data-v-78f33062";var U=L,M=(o("b680"),o("a9e3"),Object(r["withScopeId"])("data-v-977fe558"));Object(r["pushScopeId"])("data-v-977fe558");var W={class:"workouts-list"},$={class:"total"},F={class:"total-label"},P={key:0},G={key:0,class:"workouts-table responsive-table"},q=Object(r["createVNode"])("th",{class:"sport-col"},null,-1),H={class:"sport-col"},z={class:"cell-heading"},K={class:"cell-heading"},Z={key:0,class:"fa fa-map-o","aria-hidden":"true"},J={class:"cell-heading"},X={class:"text-right"},Y={class:"cell-heading"},Q={class:"text-right"},ee={class:"cell-heading"},te={class:"text-right"},oe={class:"cell-heading"},re={class:"text-right"},ae={class:"cell-heading"},ne=Object(r["createVNode"])("div",{id:"bottom"},null,-1);Object(r["popScopeId"])();var ce=M((function(e,t,o,a,n,c){var i=Object(r["resolveComponent"])("FilterSelects"),l=Object(r["resolveComponent"])("Pagination"),u=Object(r["resolveComponent"])("SportImage"),s=Object(r["resolveComponent"])("router-link"),d=Object(r["resolveComponent"])("StaticMap"),p=Object(r["resolveComponent"])("NoWorkouts");return Object(r["openBlock"])(),Object(r["createBlock"])("div",W,[Object(r["createVNode"])("div",{class:["box",{"empty-table":0===e.workouts.length}]},[Object(r["createVNode"])("div",$,[Object(r["createVNode"])("span",F,Object(r["toDisplayString"])(e.$t("common.TOTAL").toLowerCase())+": ",1),null!==e.pagination.total?(Object(r["openBlock"])(),Object(r["createBlock"])("span",P,Object(r["toDisplayString"])(e.pagination.total)+" "+Object(r["toDisplayString"])(e.$t("workouts.WORKOUT",e.pagination.total)),1)):Object(r["createCommentVNode"])("",!0)]),Object(r["createVNode"])(i,{sort:e.sortList,order_by:e.orderByList,query:e.query,message:"workouts",onUpdateSelect:e.reloadWorkouts},null,8,["sort","order_by","query","onUpdateSelect"]),e.workouts.length>0?(Object(r["openBlock"])(),Object(r["createBlock"])("div",G,[Object(r["createVNode"])(l,{class:"top-pagination",pagination:e.pagination,path:"/workouts",query:e.query},null,8,["pagination","query"]),Object(r["createVNode"])("table",null,[Object(r["createVNode"])("thead",null,[Object(r["createVNode"])("tr",null,[q,Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.WORKOUT",1))),1),Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.DATE"))),1),Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.DISTANCE"))),1),Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.DURATION"))),1),Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.AVE_SPEED"))),1),Object(r["createVNode"])("th",null,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.MAX_SPEED"))),1)])]),Object(r["createVNode"])("tbody",null,[(Object(r["openBlock"])(!0),Object(r["createBlock"])(r["Fragment"],null,Object(r["renderList"])(e.workouts,(function(o){return Object(r["openBlock"])(),Object(r["createBlock"])("tr",{key:o.id},[Object(r["createVNode"])("td",H,[Object(r["createVNode"])("span",z,Object(r["toDisplayString"])(e.$t("workouts.SPORT",1)),1),Object(r["createVNode"])(u,{title:e.sports.filter((function(e){return e.id===o.sport_id}))[0].translatedLabel,"sport-label":e.sports.filter((function(e){return e.id===o.sport_id}))[0].label},null,8,["title","sport-label"])]),Object(r["createVNode"])("td",{class:"workout-title",onMouseover:function(t){return e.onHover(o.id)},onMouseleave:t[1]||(t[1]=function(t){return e.onHover(null)})},[Object(r["createVNode"])("span",K,Object(r["toDisplayString"])(e.capitalize(e.$t("workouts.WORKOUT",1))),1),Object(r["createVNode"])(s,{class:"nav-item",to:{name:"Workout",params:{workoutId:o.id}}},{default:M((function(){return[o.with_gpx?(Object(r["openBlock"])(),Object(r["createBlock"])("i",Z)):Object(r["createCommentVNode"])("",!0),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(o.title),1)]})),_:2},1032,["to"]),o.with_gpx&&e.hoverWorkoutId===o.id?(Object(r["openBlock"])(),Object(r["createBlock"])(d,{key:0,workout:o,"display-hover":!0},null,8,["workout"])):Object(r["createCommentVNode"])("",!0)],40,["onMouseover"]),Object(r["createVNode"])("td",null,[Object(r["createVNode"])("span",J,Object(r["toDisplayString"])(e.$t("workouts.DATE")),1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.format(e.getDateWithTZ(o.workout_date,e.user.timezone),"dd/MM/yyyy HH:mm")),1)]),Object(r["createVNode"])("td",X,[Object(r["createVNode"])("span",Y,Object(r["toDisplayString"])(e.$t("workouts.DISTANCE")),1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(Number(o.distance).toFixed(2))+" km ",1)]),Object(r["createVNode"])("td",Q,[Object(r["createVNode"])("span",ee,Object(r["toDisplayString"])(e.$t("workouts.DURATION")),1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(o.moving),1)]),Object(r["createVNode"])("td",te,[Object(r["createVNode"])("span",oe,Object(r["toDisplayString"])(e.$t("workouts.AVE_SPEED")),1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(o.ave_speed)+" km/h ",1)]),Object(r["createVNode"])("td",re,[Object(r["createVNode"])("span",ae,Object(r["toDisplayString"])(e.$t("workouts.MAX_SPEED")),1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(o.max_speed)+" km/h ",1)])])})),128))])]),Object(r["createVNode"])(l,{pagination:e.pagination,path:"/workouts",query:e.query},null,8,["pagination","query"])])):Object(r["createCommentVNode"])("",!0)],2),0===e.workouts.length?(Object(r["openBlock"])(),Object(r["createBlock"])(p,{key:0})):Object(r["createCommentVNode"])("",!0),ne])})),ie=o("1da1"),le=(o("96cf"),o("d81d"),o("b64b"),o("b166")),ue=o("9176"),se=o("6d7d"),de=o("68c6"),pe=o("1724"),be=o("dad5"),Oe=o("2906"),je=o("97e5"),me=o("5e65"),fe=o("9230"),ke=Object(r["defineComponent"])({name:"WorkoutsList",components:{FilterSelects:ue["a"],NoWorkouts:pe["a"],Pagination:se["a"],StaticMap:de["a"]},props:{user:{type:Object,required:!0},sports:{type:Object}},setup:function(){var e=Object(Oe["a"])(),t=Object(I["c"])(),o=Object(I["d"])(),a=["ave_speed","distance","duration","workout_date"],n=Object(r["computed"])((function(){return e.getters[be["f"].GETTERS.USER_WORKOUTS]})),c=Object(r["computed"])((function(){return e.getters[be["f"].GETTERS.WORKOUTS_PAGINATION]})),i=d(t.query),l=Object(r["ref"])(null);function u(t){e.dispatch(be["f"].ACTIONS.GET_USER_WORKOUTS,t)}function s(e,r){var a=Object.assign({},t.query);a[e]=r,"per_page"===e&&(a["page"]="1"),i=d(a),o.push({path:"/workouts",query:i})}function d(e){return i=Object(je["a"])(e,a,fe["a"].order_by,{defaultSort:fe["a"].order,query:i}),Object.keys(e).filter((function(e){return je["d"].includes(e)})).map((function(t){"string"===typeof e[t]&&(i[t]=e[t])})),i}function p(e){l.value=e}return Object(r["onBeforeMount"])((function(){u(i)})),Object(r["watch"])((function(){return t.query}),function(){var e=Object(ie["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=d(t),u(i);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),{query:i,hoverWorkoutId:l,orderByList:a,pagination:c,sortList:je["c"],workouts:n,capitalize:r["capitalize"],format:le["a"],getDateWithTZ:me["c"],onHover:p,reloadWorkouts:s}}});o("7a49");ke.render=ce,ke.__scopeId="data-v-977fe558";var ge=ke,ye=Object(r["defineComponent"])({name:"WorkoutsView",components:{WorkoutsFilters:U,WorkoutsList:ge},setup:function(){var e=Object(s["b"])(),t=e.t,o=Object(Oe["a"])(),a=Object(r["computed"])((function(){return o.getters[be["e"].GETTERS.AUTH_USER_PROFILE]})),n=Object(r["computed"])((function(){return o.getters[be["b"].GETTERS.SPORTS]})),c=Object(r["computed"])((function(){return Object(R["d"])(n.value,t)})),i=Object(r["ref"])(!0);function l(){i.value=!i.value}return{authUser:a,hiddenFilters:i,translatedSports:c,toggleFilters:l}}});o("8475");ye.render=u,ye.__scopeId="data-v-819c97ae";t["default"]=ye},"166a":function(e,t,o){"use strict";o("43bc")},"18ac":function(e,t,o){},2794:function(e,t,o){"use strict";o("3854")},"2de4":function(e,t,o){},"304a":function(e,t,o){"use strict";o.r(t);var r=o("7a23"),a=Object(r["withScopeId"])("data-v-a4156454");Object(r["pushScopeId"])("data-v-a4156454");var n={id:"workout"},c={class:"container"},i={key:0,class:"workout-container"},l={key:0},u=Object(r["createVNode"])("div",{id:"bottom"},null,-1),s={key:1};Object(r["popScopeId"])();var d=a((function(e,t,o,a,d,p){var b=Object(r["resolveComponent"])("WorkoutDetail"),O=Object(r["resolveComponent"])("WorkoutChart"),j=Object(r["resolveComponent"])("WorkoutSegments"),m=Object(r["resolveComponent"])("WorkoutNotes"),f=Object(r["resolveComponent"])("NotFound");return Object(r["openBlock"])(),Object(r["createBlock"])("div",n,[Object(r["createVNode"])("div",c,[e.sports.length>0?(Object(r["openBlock"])(),Object(r["createBlock"])("div",i,[e.workoutData.workout.id?(Object(r["openBlock"])(),Object(r["createBlock"])("div",l,[Object(r["createVNode"])(b,{workoutData:e.workoutData,sports:e.sports,authUser:e.authUser,markerCoordinates:e.markerCoordinates,displaySegment:e.displaySegment},null,8,["workoutData","sports","authUser","markerCoordinates","displaySegment"]),e.workoutData.workout.with_gpx&&e.workoutData.chartData.length>0?(Object(r["openBlock"])(),Object(r["createBlock"])(O,{key:0,workoutData:e.workoutData,authUser:e.authUser,displaySegment:e.displaySegment,onGetCoordinates:e.updateCoordinates},null,8,["workoutData","authUser","displaySegment","onGetCoordinates"])):Object(r["createCommentVNode"])("",!0),!e.displaySegment&&e.workoutData.workout.segments.length>1?(Object(r["openBlock"])(),Object(r["createBlock"])(j,{key:1,segments:e.workoutData.workout.segments},null,8,["segments"])):Object(r["createCommentVNode"])("",!0),e.displaySegment?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createBlock"])(m,{key:2,notes:e.workoutData.workout.notes},null,8,["notes"])),u])):(Object(r["openBlock"])(),Object(r["createBlock"])("div",s,[e.workoutData.loading?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createBlock"])(f,{key:0,target:"WORKOUT"}))]))])):Object(r["createCommentVNode"])("",!0)])])})),p=o("1da1"),b=(o("96cf"),o("6c02")),O=o("f7f9"),j=Object(r["withScopeId"])("data-v-2230775e");Object(r["pushScopeId"])("data-v-2230775e");var m={id:"workout-chart"},f={class:"chart-radio"},k={class:"no-data-cleaning"};Object(r["popScopeId"])();var g=j((function(e,t,o,a,n,c){var i=Object(r["resolveComponent"])("LineChart"),l=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createBlock"])("div",m,[Object(r["createVNode"])(l,null,{title:j((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.ANALYSIS")),1)]})),content:j((function(){return[Object(r["createVNode"])("div",f,[Object(r["createVNode"])("label",null,[Object(r["createVNode"])("input",{type:"radio",name:"distance",checked:e.displayDistance,onClick:t[1]||(t[1]=function(){return e.updateDisplayDistance&&e.updateDisplayDistance.apply(e,arguments)})},null,8,["checked"]),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DISTANCE")),1)]),Object(r["createVNode"])("label",null,[Object(r["createVNode"])("input",{type:"radio",name:"duration",checked:!e.displayDistance,onClick:t[2]||(t[2]=function(){return e.updateDisplayDistance&&e.updateDisplayDistance.apply(e,arguments)})},null,8,["checked"]),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DURATION")),1)])]),Object(r["createVNode"])(i,Object(r["mergeProps"])(e.lineChartProps,{class:"line-chart",onMouseleave:e.emitEmptyCoordinates}),null,16,["onMouseleave"]),Object(r["createVNode"])("div",k,Object(r["toDisplayString"])(e.$t("workouts.NO_DATA_CLEANING")),1)]})),_:1})])})),y=o("ade3"),v=(o("b680"),o("a9e3"),o("99af"),o("ac1f"),o("5319"),o("b48c")),w=o("47e2"),h=o("9230"),N=Object(r["defineComponent"])({name:"WorkoutChart",components:{LineChart:v["LineChart"]},props:{authUser:{type:Object,required:!0},workoutData:{type:Object,required:!0}},emits:["getCoordinates"],setup:function(e,t){var o=t.emit,a=Object(w["b"])(),n=a.t,c=Object(r["ref"])(!0),i=Object(r["computed"])((function(){return Object(h["b"])(e.workoutData.chartData,n)})),l=Object(r["computed"])((function(){return{labels:c.value?i.value.distance_labels:i.value.duration_labels,datasets:JSON.parse(JSON.stringify([i.value.datasets.speed,i.value.datasets.elevation]))}})),u=Object(r["computed"])((function(){return i.value.coordinates})),s=Object(r["computed"])((function(){var e;return{responsive:!0,maintainAspectRatio:!0,animation:!1,layout:{padding:{top:22}},scales:(e={},Object(y["a"])(e,c.value?"xDistance":"xDuration",{grid:{drawOnChartArea:!1},ticks:{count:10,callback:function(e){return c.value?Number(e).toFixed(2):p(e)}},type:"linear",bounds:"data",title:{display:!0,text:c.value?n("workouts.DISTANCE")+" (km)":n("workouts.DURATION")}}),Object(y["a"])(e,"ySpeed",{grid:{drawOnChartArea:!1},position:"left",title:{display:!0,text:n("workouts.SPEED")+" (km/h)"}}),Object(y["a"])(e,"yElevation",{beginAtZero:!0,grid:{drawOnChartArea:!1},position:"right",title:{display:!0,text:n("workouts.ELEVATION")+" (m)"}}),e),elements:{point:{pointStyle:"circle",pointRadius:0}},plugins:{datalabels:{display:!1},tooltip:{interaction:{intersect:!1,mode:"index"},callbacks:{label:function(e){var t=" ".concat(e.dataset.label,": ").concat(e.formattedValue);return"yElevation"===e.dataset.yAxisID?t+" m":t+" km/h"},title:function(e){return e.length>0&&b(u.value[e[0].dataIndex]),0===e.length?"":c.value?"".concat(n("workouts.DISTANCE"),": ").concat(e[0].label," km"):"".concat(n("workouts.DURATION"),": ").concat(p(e[0].label.replace(",","")))}}}}}}));function d(){c.value=!c.value}function p(e){return new Date(1e3*+e).toISOString().substr(11,8)}function b(e){o("getCoordinates",e)}function O(){b({latitude:null,longitude:null})}var j=Object(v["useLineChart"])({chartData:l,options:s}),m=j.lineChartProps;return{displayDistance:c,lineChartProps:m,emitEmptyCoordinates:O,updateDisplayDistance:d}}});o("5687");N.render=g,N.__scopeId="data-v-2230775e";var S=N,T=Object(r["withScopeId"])("data-v-a17554ea");Object(r["pushScopeId"])("data-v-a17554ea");var V={class:"workout-detail"};Object(r["popScopeId"])();var D=T((function(e,t,o,a,n,c){var i=Object(r["resolveComponent"])("Modal"),l=Object(r["resolveComponent"])("WorkoutCardTitle"),u=Object(r["resolveComponent"])("WorkoutMap"),s=Object(r["resolveComponent"])("WorkoutData"),d=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createBlock"])("div",V,[e.displayModal?(Object(r["openBlock"])(),Object(r["createBlock"])(i,{key:0,title:e.$t("common.CONFIRMATION"),message:e.$t("workouts.WORKOUT_DELETION_CONFIRMATION"),onConfirmAction:t[1]||(t[1]=function(t){return e.deleteWorkout(e.workoutObject.workoutId)}),onCancelAction:t[2]||(t[2]=function(t){return e.updateDisplayModal(!1)})},null,8,["title","message"])):Object(r["createCommentVNode"])("",!0),Object(r["createVNode"])(d,null,{title:T((function(){return[Object(r["createVNode"])(l,{sport:e.sport,workoutObject:e.workoutObject,onDisplayModal:t[3]||(t[3]=function(t){return e.updateDisplayModal(!0)})},null,8,["sport","workoutObject"])]})),content:T((function(){return[Object(r["createVNode"])(u,{workoutData:e.workoutData,markerCoordinates:e.markerCoordinates},null,8,["workoutData","markerCoordinates"]),Object(r["createVNode"])(s,{workoutObject:e.workoutObject},null,8,["workoutObject"])]})),_:1})])})),C=(o("7db0"),Object(r["withScopeId"])("data-v-9cab340c"));Object(r["pushScopeId"])("data-v-9cab340c");var _={id:"workout-card-title"},E=Object(r["createVNode"])("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1),x={class:"workout-card-title"},A={class:"workout-title-date"},B={key:0,class:"workout-title"},I={key:1,class:"workout-title"},R={class:"workout-segment"},L=Object(r["createTextVNode"])(" — "),U=Object(r["createVNode"])("i",{class:"fa fa-map-marker","aria-hidden":"true"},null,-1),M={class:"workout-date"},W={class:"workout-link"},$=Object(r["createVNode"])("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1);Object(r["popScopeId"])();var F=C((function(e,t,o,a,n,c){var i=Object(r["resolveComponent"])("SportImage"),l=Object(r["resolveComponent"])("router-link");return Object(r["openBlock"])(),Object(r["createBlock"])("div",_,[Object(r["createVNode"])("div",{class:["workout-previous workout-arrow",{inactive:!e.workoutObject.previousUrl}],title:e.workoutObject.previousUrl?e.$t("workouts.PREVIOUS_".concat(e.workoutObject.type)):e.$t("workouts.NO_PREVIOUS_".concat(e.workoutObject.type)),onClick:t[1]||(t[1]=function(t){return e.workoutObject.previousUrl?e.$router.push(e.workoutObject.previousUrl):null})},[E],10,["title"]),Object(r["createVNode"])("div",x,[Object(r["createVNode"])(i,{"sport-label":e.sport.label},null,8,["sport-label"]),Object(r["createVNode"])("div",A,["WORKOUT"===e.workoutObject.type?(Object(r["openBlock"])(),Object(r["createBlock"])("div",B,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.workoutObject.title)+" ",1),Object(r["createVNode"])("i",{class:"fa fa-edit","aria-hidden":"true",onClick:t[2]||(t[2]=function(t){return e.$router.push({name:"EditWorkout",params:{workoutId:e.workoutObject.workoutId}})})}),Object(r["createVNode"])("i",{class:"fa fa-trash","aria-hidden":"true",onClick:t[3]||(t[3]=function(t){return e.emit("displayModal",!0)})})])):(Object(r["openBlock"])(),Object(r["createBlock"])("div",I,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.workoutObject.title)+" ",1),Object(r["createVNode"])("span",R,[L,U,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.SEGMENT"))+" "+Object(r["toDisplayString"])(e.workoutObject.segmentId+1),1)])])),Object(r["createVNode"])("div",M,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.workoutObject.workoutDate)+" - "+Object(r["toDisplayString"])(e.workoutObject.workoutTime)+" ",1),Object(r["createVNode"])("span",W,["SEGMENT"===e.workoutObject.type?(Object(r["openBlock"])(),Object(r["createBlock"])(l,{key:0,to:{name:"Workout",params:{workoutId:e.workoutObject.workoutId}}},{default:C((function(){return[Object(r["createTextVNode"])(" > "+Object(r["toDisplayString"])(e.$t("workouts.BACK_TO_WORKOUT")),1)]})),_:1},8,["to"])):Object(r["createCommentVNode"])("",!0)])])])]),Object(r["createVNode"])("div",{class:["workout-next workout-arrow",{inactive:!e.workoutObject.nextUrl}],title:e.workoutObject.nextUrl?e.$t("workouts.NEXT_".concat(e.workoutObject.type)):e.$t("workouts.NO_NEXT_".concat(e.workoutObject.type)),onClick:t[4]||(t[4]=function(t){return e.workoutObject.nextUrl?e.$router.push(e.workoutObject.nextUrl):null})},[$],10,["title"])])})),P=Object(r["defineComponent"])({name:"WorkoutCardTitle",props:{sport:{type:Object,required:!0},workoutObject:{type:Object,required:!0}},emits:["displayModal"],setup:function(e,t){var o=t.emit;return{emit:o}}});o("5910");P.render=F,P.__scopeId="data-v-9cab340c";var G=P,q=Object(r["withScopeId"])("data-v-45a7f031");Object(r["pushScopeId"])("data-v-45a7f031");var H={id:"workout-info"},z={class:"workout-data"},K=Object(r["createVNode"])("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1),Z={key:0},J={class:"workout-data"},X=Object(r["createVNode"])("i",{class:"fa fa-road","aria-hidden":"true"},null,-1),Y={class:"workout-data"},Q=Object(r["createVNode"])("i",{class:"fa fa-tachometer","aria-hidden":"true"},null,-1),ee=Object(r["createVNode"])("br",null,null,-1),te={key:0,class:"workout-data"},oe=Object(r["createVNode"])("br",null,null,-1),re={key:1,class:"workout-data"},ae=Object(r["createVNode"])("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1),ne=Object(r["createVNode"])("br",null,null,-1);Object(r["popScopeId"])();var ce=q((function(e,t,o,a,n,c){var i=Object(r["resolveComponent"])("WorkoutRecord"),l=Object(r["resolveComponent"])("WorkoutWeather");return Object(r["openBlock"])(),Object(r["createBlock"])("div",H,[Object(r["createVNode"])("div",z,[K,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DURATION"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.moving),1),Object(r["createVNode"])(i,{workoutObject:e.workoutObject,record_type:"LD"},null,8,["workoutObject"]),e.withPause?(Object(r["openBlock"])(),Object(r["createBlock"])("div",Z,[Object(r["createTextVNode"])(" ("+Object(r["toDisplayString"])(e.$t("workouts.PAUSES"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.pauses),1),Object(r["createTextVNode"])(" - "+Object(r["toDisplayString"])(e.$t("workouts.TOTAL_DURATION"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.duration)+")",1)])):Object(r["createCommentVNode"])("",!0)]),Object(r["createVNode"])("div",J,[X,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DISTANCE"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.distance)+" km",1),Object(r["createVNode"])(i,{workoutObject:e.workoutObject,record_type:"FD"},null,8,["workoutObject"])]),Object(r["createVNode"])("div",Y,[Q,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.AVERAGE_SPEED"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.aveSpeed)+" km/h",1),Object(r["createVNode"])(i,{workoutObject:e.workoutObject,record_type:"AS"},null,8,["workoutObject"]),ee,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.MAX_SPEED"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.maxSpeed)+" km/h",1),Object(r["createVNode"])(i,{workoutObject:e.workoutObject,record_type:"MS"},null,8,["workoutObject"])]),null!==e.workoutObject.maxAlt&&null!==e.workoutObject.minAlt?(Object(r["openBlock"])(),Object(r["createBlock"])("div",te,[Object(r["createVNode"])("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:e.$t("workouts.ELEVATION")},null,8,["alt"]),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.MIN_ALTITUDE"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.minAlt)+" m",1),oe,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.MAX_ALTITUDE"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.maxAlt)+" m",1)])):Object(r["createCommentVNode"])("",!0),null!==e.workoutObject.ascent&&null!==e.workoutObject.descent?(Object(r["openBlock"])(),Object(r["createBlock"])("div",re,[ae,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.ASCENT"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.ascent)+" m",1),ne,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DESCENT"))+": ",1),Object(r["createVNode"])("span",null,Object(r["toDisplayString"])(e.workoutObject.descent)+" m",1)])):Object(r["createCommentVNode"])("",!0),Object(r["createVNode"])(l,{workoutObject:e.workoutObject},null,8,["workoutObject"])])})),ie=Object(r["withScopeId"])("data-v-da96984c");Object(r["pushScopeId"])("data-v-da96984c");var le={key:0,class:"workout-record"},ue=Object(r["createVNode"])("sup",null,[Object(r["createVNode"])("i",{class:"fa fa-trophy","aria-hidden":"true"})],-1);Object(r["popScopeId"])();var se=ie((function(e,t,o,a,n,c){return e.workoutObject.records&&e.workoutObject.records.find((function(t){return t.record_type===e.record_type}))?(Object(r["openBlock"])(),Object(r["createBlock"])("span",le,[ue])):Object(r["createCommentVNode"])("",!0)})),de=Object(r["defineComponent"])({name:"WorkoutRecord",props:{record_type:{type:String,required:!0},workoutObject:{type:Object,required:!0}}});o("bfb4");de.render=se,de.__scopeId="data-v-da96984c";var pe=de,be=Object(r["withScopeId"])("data-v-7eb41918");Object(r["pushScopeId"])("data-v-7eb41918");var Oe={key:0,id:"workout-weather"},je={class:"weather-table"},me=Object(r["createVNode"])("th",null,null,-1),fe={class:"weather-th"},ke={class:"weather-th"};Object(r["popScopeId"])();var ge=be((function(e,t,o,a,n,c){return e.workoutObject.weatherStart&&e.workoutObject.weatherEnd?(Object(r["openBlock"])(),Object(r["createBlock"])("div",Oe,[Object(r["createVNode"])("table",je,[Object(r["createVNode"])("thead",null,[Object(r["createVNode"])("tr",null,[me,Object(r["createVNode"])("th",null,[Object(r["createVNode"])("div",fe,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.START"))+" ",1),Object(r["createVNode"])("img",{class:"weather-img",src:"/img/weather/".concat(e.workoutObject.weatherStart.icon,".svg"),alt:e.$t("workouts.WEATHER.DARK_SKY.".concat(e.workoutObject.weatherStart.icon)),title:e.$t("workouts.WEATHER.DARK_SKY.".concat(e.workoutObject.weatherStart.icon))},null,8,["src","alt","title"])])]),Object(r["createVNode"])("th",null,[Object(r["createVNode"])("div",ke,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.END"))+" ",1),Object(r["createVNode"])("img",{class:"weather-img",src:"/img/weather/".concat(e.workoutObject.weatherEnd.icon,".svg"),alt:e.$t("workouts.WEATHER.DARK_SKY.".concat(e.workoutObject.weatherEnd.icon)),title:e.$t("workouts.WEATHER.DARK_SKY.".concat(e.workoutObject.weatherEnd.icon))},null,8,["src","alt","title"])])])])]),Object(r["createVNode"])("tbody",null,[Object(r["createVNode"])("tr",null,[Object(r["createVNode"])("td",null,[Object(r["createVNode"])("img",{class:"weather-img weather-img-small",src:"/img/weather/temperature.svg",alt:e.$t("workouts.WEATHER.TEMPERATURE"),title:e.$t("workouts.WEATHER.TEMPERATURE")},null,8,["alt","title"])]),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(e.workoutObject.weatherStart.temperature).toFixed(1))+"°C ",1),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(e.workoutObject.weatherEnd.temperature).toFixed(1))+"°C ",1)]),Object(r["createVNode"])("tr",null,[Object(r["createVNode"])("td",null,[Object(r["createVNode"])("img",{class:"weather-img weather-img-small",src:"/img/weather/pour-rain.svg",alt:e.$t("workouts.WEATHER.HUMIDITY"),title:e.$t("workouts.WEATHER.HUMIDITY")},null,8,["alt","title"])]),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(100*e.workoutObject.weatherStart.humidity).toFixed(1))+"% ",1),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(100*e.workoutObject.weatherEnd.humidity).toFixed(1))+"% ",1)]),Object(r["createVNode"])("tr",null,[Object(r["createVNode"])("td",null,[Object(r["createVNode"])("img",{class:"weather-img weather-img-small",src:"/img/weather/breeze.svg",alt:e.$t("workouts.WEATHER.WIND"),title:e.$t("workouts.WEATHER.WIND")},null,8,["alt","title"])]),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(e.workoutObject.weatherStart.wind).toFixed(1))+"m/s",1),Object(r["createVNode"])("td",null,Object(r["toDisplayString"])(Number(e.workoutObject.weatherEnd.wind).toFixed(1))+"m/s",1)])])])])):Object(r["createCommentVNode"])("",!0)})),ye=Object(r["defineComponent"])({name:"WorkoutWeather",props:{workoutObject:{type:Object,required:!0}}});o("6595");ye.render=ge,ye.__scopeId="data-v-7eb41918";var ve=ye,we=Object(r["defineComponent"])({name:"WorkoutData",components:{WorkoutRecord:pe,WorkoutWeather:ve},props:{workoutObject:{type:Object,required:!0}},setup:function(e){return{withPause:Object(r["computed"])((function(){return"0:00:00"!==e.workoutObject.pauses&&null!==e.workoutObject.pauses}))}}});o("c04f");we.render=ce,we.__scopeId="data-v-45a7f031";var he=we,Ne=Object(r["withScopeId"])("data-v-76f3a2e8");Object(r["pushScopeId"])("data-v-76f3a2e8");var Se={id:"workout-map"},Te={key:0,class:"leaflet-container"},Ve={key:1},De={key:0,class:"leaflet-container"},Ce={key:1,class:"no-map"};Object(r["popScopeId"])();var _e=Ne((function(e,t,o,a,n,c){var i=Object(r["resolveComponent"])("LTileLayer"),l=Object(r["resolveComponent"])("LGeoJson"),u=Object(r["resolveComponent"])("LMarker"),s=Object(r["resolveComponent"])("LMap");return Object(r["openBlock"])(),Object(r["createBlock"])("div",Se,[e.workoutData.loading?(Object(r["openBlock"])(),Object(r["createBlock"])("div",Te)):(Object(r["openBlock"])(),Object(r["createBlock"])("div",Ve,[e.workoutData.workout.with_gpx?(Object(r["openBlock"])(),Object(r["createBlock"])("div",De,[e.geoJson.jsonData&&e.center&&2===e.bounds.length?(Object(r["openBlock"])(),Object(r["createBlock"])(s,{key:0,zoom:13,center:e.center,bounds:e.bounds,ref:"workoutMap",onReady:t[1]||(t[1]=function(t){return e.fitBounds(e.bounds)})},{default:Ne((function(){return[Object(r["createVNode"])(i,{url:"".concat(e.getApiUrl(),"workouts/map_tile/{s}/{z}/{x}/{y}.png"),attribution:e.appConfig.map_attribution,bounds:e.bounds},null,8,["url","attribution","bounds"]),Object(r["createVNode"])(l,{geojson:e.geoJson.jsonData},null,8,["geojson"]),e.markerCoordinates.latitude?(Object(r["openBlock"])(),Object(r["createBlock"])(u,{key:0,"lat-lng":[e.markerCoordinates.latitude,e.markerCoordinates.longitude]},null,8,["lat-lng"])):Object(r["createCommentVNode"])("",!0)]})),_:1},8,["center","bounds"])):Object(r["createCommentVNode"])("",!0)])):(Object(r["openBlock"])(),Object(r["createBlock"])("div",Ce,Object(r["toDisplayString"])(e.$t("workouts.NO_MAP")),1))]))])})),Ee=o("e94f"),xe=o("5afd"),Ae=o("dad5"),Be=o("2906"),Ie=o("d257"),Re=Object(r["defineComponent"])({name:"WorkoutMap",components:{LGeoJson:xe["a"],LMap:xe["b"],LMarker:xe["c"],LTileLayer:xe["d"]},props:{workoutData:{type:Object},markerCoordinates:{type:Object,required:!1}},setup:function(e){var t=Object(Be["a"])();function o(e){if(!e||""!==e)try{var t=Object(Ee["gpx"])((new DOMParser).parseFromString(e,"text/xml"));return{jsonData:t}}catch(o){return console.error("Invalid gpx content"),{}}return{}}function a(e){return[(e.value[0][0]+e.value[1][0])/2,(e.value[0][1]+e.value[1][1])/2]}function n(e){var t,o;null!==(t=c.value)&&void 0!==t&&t.leafletObject&&(null===(o=c.value)||void 0===o||o.leafletObject.fitBounds(e))}var c=Object(r["ref"])(null),i=Object(r["computed"])((function(){return e.workoutData?[[e.workoutData.workout.bounds[0],e.workoutData.workout.bounds[1]],[e.workoutData.workout.bounds[2],e.workoutData.workout.bounds[3]]]:[]})),l=Object(r["computed"])((function(){return t.getters[Ae["a"].GETTERS.APP_CONFIG]})),u=Object(r["computed"])((function(){return a(i)})),s=Object(r["computed"])((function(){return e.workoutData&&e.workoutData.gpx?o(e.workoutData.gpx):{}}));return{appConfig:l,bounds:i,center:u,geoJson:s,workoutMap:c,fitBounds:n,getApiUrl:Ie["a"]}}});o("2794");Re.render=_e,Re.__scopeId="data-v-76f3a2e8";var Le=Re,Ue=o("5e65"),Me=Object(r["defineComponent"])({name:"WorkoutDetail",components:{WorkoutCardTitle:G,WorkoutData:he,WorkoutMap:Le},props:{authUser:{type:Object,required:!0},displaySegment:{type:Boolean,required:!0},markerCoordinates:{type:Object,required:!1},sports:{type:Object},workoutData:{type:Object,required:!0}},setup:function(e){var t=Object(b["c"])(),o=Object(Be["a"])();function a(e,t,o){var r=t&&o&&1!==o?"/workouts/".concat(e.id,"/segment/").concat(o-1):!t&&e.previous_workout?"/workouts/".concat(e.previous_workout):null,a=t&&o&&o<e.segments.length?"/workouts/".concat(e.id,"/segment/").concat(o+1):!t&&e.next_workout?"/workouts/".concat(e.next_workout):null;return{previousUrl:r,nextUrl:a}}function n(t,o){var r=a(t,e.displaySegment,u.value?+u.value:null),n=Object(Ue["a"])(Object(Ue["c"])(e.workoutData.workout.workout_date,e.authUser.timezone));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:r.nextUrl,pauses:o?o.pauses:t.pauses,previousUrl:r.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,workoutId:t.id,weatherStart:o?null:t.weather_start,workoutTime:n.workout_time}}function c(e){d.value=e}function i(e){o.dispatch(Ae["f"].ACTIONS.DELETE_WORKOUT,{workoutId:e})}var l=Object(r["computed"])((function(){return e.workoutData.workout})),u=Object(r["ref"])(t.params.workoutId?+t.params.segmentId:null),s=Object(r["computed"])((function(){return l.value.segments.length>0&&u.value?l.value.segments[+u.value-1]:null})),d=Object(r["ref"])(!1);return Object(r["watch"])((function(){return t.params.segmentId}),function(){var e=Object(p["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t&&(u.value=+t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),{sport:Object(r["computed"])((function(){return e.sports?e.sports.find((function(t){return t.id===e.workoutData.workout.sport_id})):{}})),workoutObject:Object(r["computed"])((function(){return n(l.value,s.value)})),displayModal:d,deleteWorkout:i,updateDisplayModal:c}}});o("c2ce");Me.render=D,Me.__scopeId="data-v-a17554ea";var We=Me,$e=Object(r["withScopeId"])("data-v-5c47d30a");Object(r["pushScopeId"])("data-v-5c47d30a");var Fe={id:"workout-note"};Object(r["popScopeId"])();var Pe=$e((function(e,t,o,a,n,c){var i=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createBlock"])("div",Fe,[Object(r["createVNode"])(i,null,{title:$e((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.NOTES")),1)]})),content:$e((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.notes&&""!==e.notes?e.notes:e.$t("workouts.NO_NOTES")),1)]})),_:1})])})),Ge=Object(r["defineComponent"])({name:"WorkoutNotes",props:{notes:{type:String,required:!1}}});o("42ec");Ge.render=Pe,Ge.__scopeId="data-v-5c47d30a";var qe=Ge,He=Object(r["withScopeId"])("data-v-5c40d110");Object(r["pushScopeId"])("data-v-5c40d110");var ze={id:"workout-segments"};Object(r["popScopeId"])();var Ke=He((function(e,t,o,a,n,c){var i=Object(r["resolveComponent"])("router-link"),l=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createBlock"])("div",ze,[Object(r["createVNode"])(l,null,{title:He((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.SEGMENT",2)),1)]})),content:He((function(){return[Object(r["createVNode"])("ul",null,[(Object(r["openBlock"])(!0),Object(r["createBlock"])(r["Fragment"],null,Object(r["renderList"])(e.segments,(function(t,o){return Object(r["openBlock"])(),Object(r["createBlock"])("li",{key:t.segment_id},[Object(r["createVNode"])(i,{to:{name:"WorkoutSegment",params:{workoutId:t.workout_id,segmentId:o+1}}},{default:He((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.SEGMENT",1))+" "+Object(r["toDisplayString"])(o+1),1)]})),_:2},1032,["to"]),Object(r["createTextVNode"])(" ("+Object(r["toDisplayString"])(e.$t("workouts.DISTANCE"))+": "+Object(r["toDisplayString"])(t.distance)+" km, "+Object(r["toDisplayString"])(e.$t("workouts.DURATION"))+": "+Object(r["toDisplayString"])(t.duration)+") ",1)])})),128))])]})),_:1})])})),Ze=Object(r["defineComponent"])({name:"WorkoutSegments",props:{segments:{type:Object,required:!0}}});o("628e");Ze.render=Ke,Ze.__scopeId="data-v-5c40d110";var Je=Ze,Xe=Object(r["defineComponent"])({name:"Workout",components:{NotFound:O["a"],WorkoutChart:S,WorkoutDetail:We,WorkoutNotes:qe,WorkoutSegments:Je},props:{displaySegment:{type:Boolean,required:!0}},setup:function(e){var t=Object(b["c"])(),o=Object(Be["a"])();Object(r["onBeforeMount"])((function(){var r={workoutId:t.params.workoutId};e.displaySegment&&(r.segmentId=t.params.segmentId),o.dispatch(Ae["f"].ACTIONS.GET_WORKOUT_DATA,r)}));var a=Object(r["computed"])((function(){return o.getters[Ae["f"].GETTERS.WORKOUT_DATA]})),n=Object(r["computed"])((function(){return o.getters[Ae["e"].GETTERS.AUTH_USER_PROFILE]})),c=Object(r["computed"])((function(){return o.getters[Ae["b"].GETTERS.SPORTS]})),i=Object(r["ref"])({latitude:null,longitude:null});function l(e){i.value={latitude:e.latitude,longitude:e.longitude}}return Object(r["watch"])((function(){return t.params.workoutId}),function(){var e=Object(p["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t&&o.dispatch(Ae["f"].ACTIONS.GET_WORKOUT_DATA,{workoutId:t});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Object(r["watch"])((function(){return t.params.segmentId}),function(){var e=Object(p["a"])(regeneratorRuntime.mark((function e(r){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.params.workoutId&&(a={workoutId:t.params.workoutId},r&&(a.segmentId=r),o.dispatch(Ae["f"].ACTIONS.GET_WORKOUT_DATA,a));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Object(r["onUnmounted"])((function(){o.commit(Ae["f"].MUTATIONS.EMPTY_WORKOUT)})),{authUser:n,markerCoordinates:i,sports:c,workoutData:a,updateCoordinates:l}}});o("5be4");Xe.render=d,Xe.__scopeId="data-v-a4156454";t["default"]=Xe},3854:function(e,t,o){},"42ec":function(e,t,o){"use strict";o("8300")},"43bc":function(e,t,o){},5687:function(e,t,o){"use strict";o("bef2")},5910:function(e,t,o){"use strict";o("b76e")},"5afd":function(e,t,o){"use strict";(function(e){o.d(t,"a",(function(){return D})),o.d(t,"b",(function(){return x})),o.d(t,"c",(function(){return I})),o.d(t,"d",(function(){return $}));var r=o("7a23");const a=(e,t)=>{let o;return function(...r){const a=this;o&&clearTimeout(o),o=setTimeout(()=>{e.apply(a,r),o=null},t)}},n=e=>e&&"function"===typeof e.charAt?e.charAt(0).toUpperCase()+e.slice(1):e,c=(e,t,o)=>{for(const a in o){const c="set"+n(a);e[c]?Object(r["watch"])(()=>o[a],(t,o)=>{e[c](t,o)}):t[c]&&Object(r["watch"])(()=>o[a],e=>{t[c](e)})}},i=e=>{const t={};for(const o in e)if(o.startsWith("on")&&!o.startsWith("onUpdate")&&"onReady"!==o){const r=o.slice(2).toLocaleLowerCase();t[r]=e[o]}return t},l=async e=>{const t=await Promise.all([o.e("chunk-2d0c9189").then(o.t.bind(null,"584d",7)),o.e("chunk-2d0cf391").then(o.t.bind(null,"6397",7)),o.e("chunk-2d22523a").then(o.t.bind(null,"e2b9",7))]);delete e.Default.prototype._getIconUrl,e.Default.mergeOptions({iconRetinaUrl:t[0].default,iconUrl:t[1].default,shadowUrl:t[2].default})},u=e=>{const t=Object(r["ref"])(()=>console.warn(`Method ${e} has been invoked without being replaced`)),o=(...e)=>t.value(...e);return o.wrapped=t,Object(r["provide"])(e,o),o},s=(e,t)=>e.wrapped.value=t,d="object"===typeof self&&self.self===self&&self||"object"===typeof e&&e.global===e&&e||void 0,p="useGlobalLeaflet",b={options:{type:Object,default:()=>({})}},O=e=>({options:e.options,methods:{}}),j={...b,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}},m=(e,t,o)=>{const a=Object(r["inject"])("addLayer"),n=Object(r["inject"])("removeLayer"),{options:c,methods:i}=O(e),l={...c,attribution:e.attribution,pane:e.pane},u=()=>a({leafletObject:t.value}),s=()=>n({leafletObject:t.value}),d={...i,setAttribution(e,t){const o=this.$parent.leafletObject.attributionControl;o.removeAttribution(t).addAttribution(e)},setName(){s(),e.visible&&u()},setLayerType(){s(),e.visible&&u()},setVisible(e){t.value&&(e?u():s())},bindPopup({leafletObject:e}){t.value.bindPopup(e)},bindTooltip({leafletObject:e}){t.value.bindTooltip(e)},unbindTooltip(){const e=t.value?t.value.getTooltip():null;e&&e.unbindTooltip()},unbindPopup(){const e=t.value?t.value.getPopup():null;e&&e.unbindPopup()},updateVisibleProp(e){o.emit("update:visible",e)}};return Object(r["provide"])("bindPopup",d.bindPopup),Object(r["provide"])("bindTooltip",d.bindTooltip),Object(r["provide"])("unbindTooltip",d.unbindTooltip),Object(r["provide"])("unbindPopup",d.unbindPopup),Object(r["onUnmounted"])(()=>{d.unbindPopup(),d.unbindTooltip(),s()}),{options:l,methods:d}},f=(e,t)=>{if(e&&t.default)return Object(r["h"])("div",{style:{display:"none"}},t.default())},k={...b,interactive:{type:Boolean,default:!0},bubblingMouseEvents:{type:Boolean,default:!0}},g={...j,...k,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}},y={...g,latLng:{type:[Object,Array],custom:!0,default:null},radius:{type:Number,default:null}};const v={...b,position:{type:String,default:"topright"}},w=(e,t)=>{const{options:o,methods:a}=O(e),n={...o,position:e.position},c={...a,setPosition(e){t.value&&t.value.setPosition(e)}};return Object(r["onUnmounted"])(()=>{t.value&&t.value.remove()}),{options:n,methods:c}},h=e=>e.default?Object(r["h"])("div",{ref:"root"},e.default()):null;Boolean,Boolean;Boolean,Boolean,Boolean,Boolean;Boolean,Boolean,Boolean;const N={...j},S=(e,t,o)=>{const{options:a,methods:n}=m(e,t,o),c={...a},i={...n,addLayer(e){t.value.addLayer(e.leafletObject)},removeLayer(e){t.value.removeLayer(e.leafletObject)}};return Object(r["provide"])("addLayer",i.addLayer),Object(r["provide"])("removeLayer",i.removeLayer),{options:c,methods:i}};const T={...N,geojson:{type:[Object,Array],default:()=>({})}},V=(e,t)=>{const{options:o,methods:r}=S(e,t),a={...o,...e},n={...r,setGeojson(e){t.value.clearLayers(),t.value.addData(e)},getGeoJSONData(){return t.value.toGeoJSON()},getBounds(){return t.value.getBounds()}};return{options:a,methods:n}};var D={props:T,setup(e,t){const a=Object(r["ref"])({}),n=Object(r["ref"])(!1),l=Object(r["inject"])(p),u=Object(r["inject"])("addLayer"),{methods:s,options:b}=V(e,a);return Object(r["onMounted"])(async()=>{const{geoJSON:p,DomEvent:O}=l?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));a.value=p(e.geojson,b);const j=i(t.attrs);O.on(a.value,j),c(s,a.value,e),u({...e,...s,leafletObject:a.value}),n.value=!0,Object(r["nextTick"])(()=>t.emit("ready",a.value))}),{ready:n,leafletObject:a}},render(){return f(this.ready,this.$slots)},__file:"src/components/LGeoJson.vue"};const C={...j,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,o)=>{const{options:r,methods:a}=m(e,t,o),n={...r,pane:e.pane,opacity:e.opacity,zIndex:e.zIndex,tileSize:e.tileSize,noWrap:e.noWrap,minZoom:e.minZoom,maxZoom:e.maxZoom};return{options:n,methods:{...a}}};const E={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:()=>({})}};Boolean,Boolean;var x={emits:["ready","update:zoom","update:center","update:bounds"],props:{...b,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(e,t){const n=Object(r["ref"])(null),b=Object(r["reactive"])({ready:!1,leafletRef:{},layersToAdd:[],layersInControl:[]}),{options:j}=O(e),m={...j,minZoom:e.minZoom,maxZoom:e.maxZoom,maxBounds:e.maxBounds,maxBoundsViscosity:e.maxBoundsViscosity,worldCopyJump:e.worldCopyJump,crs:e.crs,center:e.center,zoom:e.zoom,inertia:e.inertia,inertiaDeceleration:e.inertiaDeceleration,inertiaMaxSpeed:e.inertiaMaxSpeed,easeLinearity:e.easeLinearity,zoomAnimation:e.zoomAnimation,zoomAnimationThreshold:e.zoomAnimationThreshold,fadeAnimation:e.fadeAnimation,markerZoomAnimation:e.markerZoomAnimation},f=u("addLayer"),k=u("removeLayer"),g=u("registerControl"),y=u("registerLayerControl");Object(r["provide"])(p,e.useGlobalLeaflet);const v={moveEndHandler(){t.emit("update:zoom",b.leafletRef.getZoom()),t.emit("update:center",b.leafletRef.getCenter()),t.emit("update:bounds",b.leafletRef.getBounds())},overlayAddHandler(e){const t=b.layersInControl.find(t=>t.name===e.name);t&&t.updateVisibleProp(!0)},overlayRemoveHandler(e){const t=b.layersInControl.find(t=>t.name===e.name);t&&t.updateVisibleProp(!1)}};Object(r["onMounted"])(async()=>{e.useGlobalLeaflet&&(d.L=d.L||await o.e("chunk-2d2248b6").then(o.t.bind(null,"e11e",7)));const{map:u,CRS:p,Icon:O,latLngBounds:j,latLng:w,DomEvent:h}=e.useGlobalLeaflet?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));try{m.beforeMapMount&&await m.beforeMapMount()}catch(V){console.error("The following error occurred running the provided beforeMapMount hook "+V.message)}await l(O);const N="string"==typeof m.crs?p[m.crs]:m.crs;m.crs=N||p.EPSG3857;const S={addLayer(e){if(void 0!==e.layerType)if(void 0===b.layerControl)b.layersToAdd.push(e);else{const t=b.layersInControl.find(t=>t.leafletObject._leaflet_id===e.leafletObject._leaflet_id);t||(b.layerControl.addLayer(e),b.layersInControl.push(e))}!1!==e.visible&&b.leafletRef.addLayer(e.leafletObject)},removeLayer(e){void 0!==e.layerType&&(void 0===b.layerControl?b.layersToAdd=b.layersToAdd.filter(t=>t.name!==e.name):(b.layerControl.removeLayer(e.leafletObject),b.layersInControl=b.layersInControl.filter(t=>t.leafletObject._leaflet_id!==e.leafletObject._leaflet_id))),b.leafletRef.removeLayer(e.leafletObject)},registerLayerControl(e){b.layerControl=e,b.layersToAdd.forEach(e=>{b.layerControl.addLayer(e)}),b.layersToAdd=[],g(e)},registerControl(e){b.leafletRef.addControl(e.leafletObject)},setZoom(t){const o=b.leafletRef.getZoom();t!==o&&b.leafletRef.setZoom(t,{animate:!e.noBlockingAnimations&&null})},setPaddingBottomRight(e){b.paddingBottomRight=e},setPaddingTopLeft(e){b.paddingTopLeft=e},setPadding(e){b.padding=e},setCrs(e){const t=b.leafletRef.getBounds();b.leafletRef.options.crs=e,b.leafletRef.fitBounds(t,{animate:!1,padding:[0,0]})},fitBounds(e){b.leafletRef.fitBounds(e,{animate:!this.noBlockingAnimations&&null})},setBounds(e){if(!e)return;const t=j(e);if(!t.isValid())return;const o=b.lastSetBounds||b.leafletRef.getBounds(),r=!o.equals(t,0);r&&(b.lastSetBounds=t,b.leafletRef.fitBounds(t,this.fitBoundsOptions))},setCenter(e){if(null==e)return;const t=w(e),o=b.lastSetCenter||b.leafletRef.getCenter();o.lat===t.lat&&o.lng===t.lng||(b.lastSetCenter=t,b.leafletRef.panTo(t,{animate:!this.noBlockingAnimations&&null}))}};s(f,S.addLayer),s(k,S.removeLayer),s(g,S.registerControl),s(y,S.registerLayerControl),b.leafletRef=u(n.value,m),c(S,b.leafletRef,e);const T=i(t.attrs);b.leafletRef.on("moveend",a(v.moveEndHandler,100)),b.leafletRef.on("overlayadd",v.overlayAddHandler),b.leafletRef.on("overlayremove",v.overlayRemoveHandler),h.on(b.leafletRef,T),b.ready=!0,Object(r["nextTick"])(()=>t.emit("ready",b.leafletRef))}),Object(r["onBeforeUnmount"])(()=>{b.leafletRef&&b.leafletRef.remove()});const w=Object(r["computed"])(()=>b.leafletRef),h=Object(r["computed"])(()=>b.ready);return{root:n,ready:h,leafletObject:w}},render(){return Object(r["h"])("div",{style:{width:"100%",height:"100%"},ref:"root"},this.ready?this.$slots.default():{})},__file:"src/components/LMap.vue"};const A={...j,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}},B=(e,t,o)=>{const{options:r,methods:a}=m(e,t,o),n={...r,...e},c={...a,setDraggable(e){t.value.dragging&&(e?t.value.dragging.enable():t.value.dragging.disable())},latLngSync(e){o.emit("update:latLng",e.latlng),o.emit("update:lat-lng",e.latlng)},setLatLng(e){if(null!=e&&t.value){const o=t.value.getLatLng();o&&o.equals(e)||t.value.setLatLng(e)}}};return{options:n,methods:c}};var I={name:"LMarker",props:A,setup(e,t){const n=Object(r["ref"])({}),l=Object(r["ref"])(!1),u=Object(r["inject"])(p),s=Object(r["inject"])("addLayer");Object(r["provide"])("canSetParentHtml",()=>!!n.value.getElement()),Object(r["provide"])("setParentHtml",e=>n.value.getElement().innerHTML=e),Object(r["provide"])("setIcon",e=>n.value.setIcon&&n.value.setIcon(e));const{options:b,methods:O}=B(e,n,t);return void 0===b.icon&&delete b.icon,Object(r["onMounted"])(async()=>{const{marker:p,DomEvent:j}=u?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));n.value=p(e.latLng,b);const m=i(t.attrs);j.on(n.value,m),n.value.on("move",a(O.latLngSync,100)),c(O,n.value,e),s({...e,...O,leafletObject:n.value}),l.value=!0,Object(r["nextTick"])(()=>t.emit("ready",n.value))}),{ready:l,leafletObject:n}},render(){return f(this.ready,this.$slots)},__file:"src/components/LMarker.vue"};const R={...g,latLngs:{type:Array,default:()=>[]},smoothFactor:{type:Number,custom:!0,default:1},noClip:{type:Boolean,custom:!0,default:!1}},L={...R};const U={...b,content:{type:String,default:null}};const M={...C,tms:{type:Boolean,default:!1},subdomains:{type:String,default:"abc"},detectRetina:{type:Boolean,default:!1},url:{type:String,default:null}},W=(e,t)=>{const{options:o,methods:r}=_(e,t),a={...o,tms:e.tms,subdomains:e.subdomains,detectRetina:e.detectRetina};return{options:a,methods:{...r}}};var $={props:M,setup(e,t){const a=Object(r["ref"])({}),n=Object(r["inject"])(p),l=Object(r["inject"])("addLayer"),{options:u,methods:s}=W(e,a);return Object(r["onMounted"])(async()=>{const{tileLayer:p,DomEvent:b}=n?d.L:await o.e("chunk-2d0da8f3").then(o.bind(null,"6bb3"));a.value=p(e.url,u);const O=i(t.attrs);b.on(a.value,O),c(s,a.value,e),l({...e,...s,leafletObject:a.value}),Object(r["nextTick"])(()=>t.emit("ready",a.value))}),{leafletObject:a}},render(){return null},__file:"src/components/LTileLayer.vue"};Boolean,Boolean}).call(this,o("c8ba"))},"5be4":function(e,t,o){"use strict";o("8ee6")},"5c76":function(e,t,o){"use strict";o("4de4");var r=o("7a23"),a=Object(r["withScopeId"])("data-v-0dfe7a73");Object(r["pushScopeId"])("data-v-0dfe7a73");var n={id:"workout-form"},c={class:"form-items"},i={key:0,class:"form-item-radio"},l={for:"withGpx"},u={for:"withoutGpx"},s={class:"form-item"},d={key:1,class:"form-item"},p={for:"gpxFile"},b={class:"files-help info-box"},O={key:2,class:"form-item"},j={for:"title"},m={key:3},f={class:"workout-date-duration"},k={class:"form-item"},g={class:"workout-date-time"},y={class:"form-item"},v=Object(r["createTextVNode"])(" : "),w=Object(r["createTextVNode"])(" : "),h={class:"form-item"},N={class:"form-item"},S={key:1},T={key:2,class:"form-buttons"};Object(r["popScopeId"])();var V=a((function(e,t,o,V,D,C){var _=Object(r["resolveComponent"])("CustomTextArea"),E=Object(r["resolveComponent"])("ErrorMessage"),x=Object(r["resolveComponent"])("Loader"),A=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createBlock"])("div",{id:"workout-edition",class:["center-card center-card with-margin",{"center-form":e.workout&&e.workout.with_gpx}]},[Object(r["createVNode"])(A,null,{title:a((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.".concat(e.isCreation?"ADD":"EDIT","_WORKOUT"))),1)]})),content:a((function(){return[Object(r["createVNode"])("div",n,[Object(r["createVNode"])("form",{onSubmit:t[13]||(t[13]=Object(r["withModifiers"])((function(){return e.updateWorkout&&e.updateWorkout.apply(e,arguments)}),["prevent"]))},[Object(r["createVNode"])("div",c,[e.isCreation?(Object(r["openBlock"])(),Object(r["createBlock"])("div",i,[Object(r["createVNode"])("div",null,[Object(r["createVNode"])("input",{id:"withGpx",type:"radio",checked:e.withGpx,disabled:e.loading,onClick:t[1]||(t[1]=function(){return e.updateWithGpx&&e.updateWithGpx.apply(e,arguments)})},null,8,["checked","disabled"]),Object(r["createVNode"])("label",l,Object(r["toDisplayString"])(e.$t("workouts.WITH_GPX")),1)]),Object(r["createVNode"])("div",null,[Object(r["createVNode"])("input",{id:"withoutGpx",type:"radio",checked:!e.withGpx,disabled:e.loading,onClick:t[2]||(t[2]=function(){return e.updateWithGpx&&e.updateWithGpx.apply(e,arguments)})},null,8,["checked","disabled"]),Object(r["createVNode"])("label",u,Object(r["toDisplayString"])(e.$t("workouts.WITHOUT_GPX")),1)])])):Object(r["createCommentVNode"])("",!0),Object(r["createVNode"])("div",s,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.SPORT",1))+": ",1),Object(r["withDirectives"])(Object(r["createVNode"])("select",{id:"sport",required:"",disabled:e.loading,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.workoutDataObject.sport_id=t})},[(Object(r["openBlock"])(!0),Object(r["createBlock"])(r["Fragment"],null,Object(r["renderList"])(e.translatedSports.filter((function(e){return e.is_active})),(function(e){return Object(r["openBlock"])(),Object(r["createBlock"])("option",{value:e.id,key:e.id},Object(r["toDisplayString"])(e.label),9,["value"])})),128))],8,["disabled"]),[[r["vModelSelect"],e.workoutDataObject.sport_id]])]),e.isCreation&&e.withGpx?(Object(r["openBlock"])(),Object(r["createBlock"])("div",d,[Object(r["createVNode"])("label",p,Object(r["toDisplayString"])(e.$t("workouts.GPX_FILE"))+" "+Object(r["toDisplayString"])(e.$t("workouts.ZIP_ARCHIVE_DESCRIPTION"))+": ",1),Object(r["createVNode"])("input",{id:"gpxFile",name:"gpxFile",type:"file",accept:".gpx, .zip",disabled:e.loading,onInput:t[4]||(t[4]=function(){return e.updateFile&&e.updateFile.apply(e,arguments)})},null,40,["disabled"]),Object(r["createVNode"])("div",b,[Object(r["createVNode"])("div",null,[Object(r["createVNode"])("strong",null,Object(r["toDisplayString"])(e.$t("workouts.GPX_FILE"))+":",1),Object(r["createVNode"])("ul",null,[Object(r["createVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_SIZE"))+": "+Object(r["toDisplayString"])(e.fileSizeLimit),1)])]),Object(r["createVNode"])("div",null,[Object(r["createVNode"])("strong",null,Object(r["toDisplayString"])(e.$t("workouts.ZIP_ARCHIVE"))+":",1),Object(r["createVNode"])("ul",null,[Object(r["createVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.NO_FOLDER")),1),Object(r["createVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_FILES"))+": "+Object(r["toDisplayString"])(e.gpx_limit_import),1),Object(r["createVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_SIZE"))+": "+Object(r["toDisplayString"])(e.zipSizeLimit),1)])])])])):(Object(r["openBlock"])(),Object(r["createBlock"])("div",O,[Object(r["createVNode"])("label",j,Object(r["toDisplayString"])(e.$t("workouts.TITLE"))+": ",1),Object(r["withDirectives"])(Object(r["createVNode"])("input",{id:"title",name:"title",type:"text",required:!e.isCreation,disabled:e.loading,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.workoutDataObject.title=t})},null,8,["required","disabled"]),[[r["vModelText"],e.workoutDataObject.title]])])),e.withGpx?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createBlock"])("div",m,[Object(r["createVNode"])("div",f,[Object(r["createVNode"])("div",k,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.WORKOUT_DATE"))+":",1),Object(r["createVNode"])("div",g,[Object(r["withDirectives"])(Object(r["createVNode"])("input",{id:"workout-date",name:"workout-date",type:"date",required:"",disabled:e.loading,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.workoutDataObject.workoutDate=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutDate]]),Object(r["withDirectives"])(Object(r["createVNode"])("input",{id:"workout-time",name:"workout-time",class:"workout-time",type:"time",required:"",disabled:e.loading,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.workoutDataObject.workoutTime=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutTime]])])]),Object(r["createVNode"])("div",y,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.DURATION"))+":",1),Object(r["createVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createVNode"])("input",{id:"workout-duration-hour",name:"workout-duration-hour",class:"workout-duration",type:"text",placeholder:"HH",pattern:"^([0-9]*[0-9])$",required:"",disabled:e.loading,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.workoutDataObject.workoutDurationHour=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutDurationHour]]),v,Object(r["withDirectives"])(Object(r["createVNode"])("input",{id:"workout-duration-minutes",name:"workout-duration-minutes",class:"workout-duration",type:"text",pattern:"^([0-5][0-9])$",placeholder:"MM",required:"",disabled:e.loading,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.workoutDataObject.workoutDurationMinutes=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutDurationMinutes]]),w,Object(r["withDirectives"])(Object(r["createVNode"])("input",{id:"workout-duration-seconds",name:"workout-duration-seconds",class:"workout-duration",type:"text",pattern:"^([0-5][0-9])$",placeholder:"SS",required:"",disabled:e.loading,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.workoutDataObject.workoutDurationSeconds=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutDurationSeconds]])])])]),Object(r["createVNode"])("div",h,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.DISTANCE"))+" (km):",1),Object(r["withDirectives"])(Object(r["createVNode"])("input",{name:"workout-distance",type:"number",min:"0",step:"0.1",required:"",disabled:e.loading,"onUpdate:modelValue":t[11]||(t[11]=function(t){return e.workoutDataObject.workoutDistance=t})},null,8,["disabled"]),[[r["vModelText"],e.workoutDataObject.workoutDistance]])])])),Object(r["createVNode"])("div",N,[Object(r["createVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.NOTES"))+": ",1),Object(r["createVNode"])(_,{name:"notes",input:e.workoutDataObject.notes,disabled:e.loading,onUpdateValue:e.updateNotes},null,8,["input","disabled","onUpdateValue"])])]),e.errorMessages?(Object(r["openBlock"])(),Object(r["createBlock"])(E,{key:0,message:e.errorMessages},null,8,["message"])):Object(r["createCommentVNode"])("",!0),e.loading?(Object(r["openBlock"])(),Object(r["createBlock"])("div",S,[Object(r["createVNode"])(x)])):(Object(r["openBlock"])(),Object(r["createBlock"])("div",T,[Object(r["createVNode"])("button",{class:"confirm",type:"submit",disabled:e.loading},Object(r["toDisplayString"])(e.$t("buttons.SUBMIT")),9,["disabled"]),Object(r["createVNode"])("button",{class:"cancel",onClick:t[12]||(t[12]=Object(r["withModifiers"])((function(){return e.onCancel&&e.onCancel.apply(e,arguments)}),["prevent"]))},Object(r["toDisplayString"])(e.$t("buttons.CANCEL")),1)]))],32)])]})),_:1})],2)})),D=o("1da1"),C=(o("96cf"),o("ac1f"),o("1276"),o("99af"),o("47e2")),_=o("6c02"),E=o("dad5"),x=o("2906"),A=o("5e65"),B=o("c364"),I=o("1119"),R=Object(r["defineComponent"])({name:"WorkoutEdition",props:{authUser:{type:Object,required:!0},isCreation:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},sports:{type:Object,required:!0},workout:{type:Object,required:!1}},setup:function(e){var t=Object(C["b"])(),o=t.t,a=Object(x["a"])(),n=Object(_["d"])();Object(r["onMounted"])((function(){e.workout&&e.workout.id&&k(e.workout)}));var c=Object(r["computed"])((function(){return Object(I["d"])(e.sports,o)})),i=Object(r["computed"])((function(){return a.getters[E["a"].GETTERS.APP_CONFIG]})),l=i.value.max_single_file_size?Object(B["b"])(i.value.max_single_file_size):"",u=i.value.gpx_limit_import,s=i.value.max_zip_file_size?Object(B["b"])(i.value.max_zip_file_size):"",d=Object(r["computed"])((function(){return a.getters[E["a"].GETTERS.ERROR_MESSAGES]})),p=Object(r["reactive"])({sport_id:"",title:"",notes:"",workoutDate:"",workoutTime:"",workoutDurationHour:"",workoutDurationMinutes:"",workoutDurationSeconds:"",workoutDistance:""}),b=Object(r["ref"])(e.workout?e.workout.with_gpx:e.isCreation),O=null;function j(e){p.notes=e}function m(){b.value=!b.value}function f(e){e.target.files&&(O=e.target.files[0])}function k(t){if(p.sport_id="".concat(t.sport_id),p.title=t.title,p.notes=t.notes,!t.with_gpx){var o=Object(A["a"])(Object(A["c"])(t.workout_date,e.authUser.timezone),"yyyy-MM-dd"),r=t.duration.split(":");p.workoutDistance="".concat(t.distance),p.workoutDate=o.workout_date,p.workoutTime=o.workout_time,p.workoutDurationHour=r[0],p.workoutDurationMinutes=r[1],p.workoutDurationSeconds=r[2]}}function g(e){e.title=p.title,e.distance=+p.workoutDistance,e.duration=3600*+p.workoutDurationHour+60*+p.workoutDurationMinutes+ +p.workoutDurationSeconds,e.workout_date="".concat(p.workoutDate," ").concat(p.workoutTime)}function y(){var t={sport_id:+p.sport_id,notes:p.notes};if(e.workout)e.workout.with_gpx?(t.title=p.title,a.dispatch(E["f"].ACTIONS.EDIT_WORKOUT,{workoutId:e.workout.id,data:t})):(g(t),a.dispatch(E["f"].ACTIONS.ADD_WORKOUT_WITHOUT_GPX,t));else if(b.value){if(!O){var o="workouts.NO_FILE_PROVIDED";return void a.commit(E["a"].MUTATIONS.SET_ERROR_MESSAGES,o)}t.file=O,a.dispatch(E["f"].ACTIONS.ADD_WORKOUT,t)}else g(t),a.dispatch(E["f"].ACTIONS.ADD_WORKOUT_WITHOUT_GPX,t)}function v(){e.workout?n.push({name:"Workout",params:{workoutId:e.workout.id}}):n.go(-1)}return Object(r["watch"])((function(){return e.workout}),function(){var e=Object(D["a"])(regeneratorRuntime.mark((function e(t,o){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t!==o&&t&&t.id&&k(t);case 1:case"end":return e.stop()}}),e)})));return function(t,o){return e.apply(this,arguments)}}()),Object(r["onUnmounted"])((function(){return a.commit(E["a"].MUTATIONS.EMPTY_ERROR_MESSAGES)})),{appConfig:i,errorMessages:d,fileSizeLimit:l,gpx_limit_import:u,translatedSports:c,withGpx:b,zipSizeLimit:s,workoutDataObject:p,onCancel:v,updateFile:f,updateNotes:j,updateWithGpx:m,updateWorkout:y}}});o("9a58");R.render=V,R.__scopeId="data-v-0dfe7a73";t["a"]=R},"628e":function(e,t,o){"use strict";o("be77")},6595:function(e,t,o){"use strict";o("cc92")},"692d":function(e,t,o){"use strict";o.r(t);var r=o("7a23"),a=Object(r["withScopeId"])("data-v-2e2371d9");Object(r["pushScopeId"])("data-v-2e2371d9");var n={id:"add-workout"},c={class:"container"};Object(r["popScopeId"])();var i=a((function(e,t,o,a,i,l){var u=Object(r["resolveComponent"])("WorkoutEdition");return Object(r["openBlock"])(),Object(r["createBlock"])("div",n,[Object(r["createVNode"])("div",c,[Object(r["createVNode"])(u,{authUser:e.authUser,sports:e.sports,isCreation:!0,loading:e.workoutData.loading},null,8,["authUser","sports","loading"])])])})),l=o("5c76"),u=o("dad5"),s=o("2906"),d=Object(r["defineComponent"])({name:"AddWorkout",components:{WorkoutEdition:l["a"]},setup:function(){var e=Object(s["a"])(),t=Object(r["computed"])((function(){return e.getters[u["b"].GETTERS.SPORTS]})),o=Object(r["computed"])((function(){return e.getters[u["e"].GETTERS.AUTH_USER_PROFILE]})),a=Object(r["computed"])((function(){return e.getters[u["f"].GETTERS.WORKOUT_DATA]}));return{authUser:o,sports:t,workoutData:a}}});o("ebf5");d.render=i,d.__scopeId="data-v-2e2371d9";t["default"]=d},"7a49":function(e,t,o){"use strict";o("885d")},"7f59":function(e,t,o){},8300:function(e,t,o){},8475:function(e,t,o){"use strict";o("a133")},"885d":function(e,t,o){},"8ee6":function(e,t,o){},"8ee9":function(e,t,o){"use strict";o.r(t);var r=o("7a23"),a={id:"edit-workout"},n={class:"container"};function c(e,t,o,c,i,l){var u=Object(r["resolveComponent"])("WorkoutEdition");return Object(r["openBlock"])(),Object(r["createBlock"])("div",a,[Object(r["createVNode"])("div",n,[Object(r["createVNode"])(u,{authUser:e.authUser,sports:e.sports,workout:e.workoutData.workout,loading:e.workoutData.loading},null,8,["authUser","sports","workout","loading"])])])}var i=o("1da1"),l=(o("96cf"),o("6c02")),u=o("5c76"),s=o("dad5"),d=o("2906"),p=Object(r["defineComponent"])({name:"EditWorkout",components:{WorkoutEdition:u["a"]},setup:function(){var e=Object(l["c"])(),t=Object(d["a"])();Object(r["onBeforeMount"])((function(){t.dispatch(s["f"].ACTIONS.GET_WORKOUT_DATA,{workoutId:e.params.workoutId})}));var o=Object(r["computed"])((function(){return t.getters[s["e"].GETTERS.AUTH_USER_PROFILE]})),a=Object(r["computed"])((function(){return t.getters[s["b"].GETTERS.SPORTS]})),n=Object(r["computed"])((function(){return t.getters[s["f"].GETTERS.WORKOUT_DATA]}));return Object(r["watch"])((function(){return e.params.workoutId}),function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(o){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:o||t.commit(s["f"].MUTATIONS.EMPTY_WORKOUT);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),{authUser:o,sports:a,workoutData:n}}});p.render=c;t["default"]=p},"9a58":function(e,t,o){"use strict";o("7f59")},a133:function(e,t,o){},a33d:function(e,t,o){},b76e:function(e,t,o){},be77:function(e,t,o){},bef2:function(e,t,o){},bfb4:function(e,t,o){"use strict";o("a33d")},c04f:function(e,t,o){"use strict";o("d8e9")},c2ce:function(e,t,o){"use strict";o("2de4")},cc92:function(e,t,o){},d8e9:function(e,t,o){},e94f:function(e,t,o){!function(e,o){o(t)}(0,(function(e){"use strict";function t(e){return e&&e.normalize&&e.normalize(),e&&e.textContent||""}function o(e,t){const o=e.getElementsByTagName(t);return o.length?o[0]:null}function r(e){const r={};if(e){const a=o(e,"line");if(a){const e=t(o(a,"color")),n=parseFloat(t(o(a,"opacity"))),c=parseFloat(t(o(a,"width")));e&&(r.stroke=e),isNaN(n)||(r["stroke-opacity"]=n),isNaN(c)||(r["stroke-width"]=96*c/25.4)}}return r}function a(e,r){const a={};let n,c;for(c=0;c<r.length;c++)n=o(e,r[c]),n&&(a[r[c]]=t(n));return a}function n(e){const o=a(e,["name","cmt","desc","type","time","keywords"]),r=e.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*");for(let a=0;a<r.length;a++){const n=r[a];n.parentNode.parentNode===e&&(o[n.tagName.replace(":","_")]=t(n))}const n=e.getElementsByTagName("link");n.length&&(o.links=[]);for(let t=0;t<n.length;t++)o.links.push(Object.assign({href:n[t].getAttribute("href")},a(n[t],["text","type"])));return o}function c(e){const r=[parseFloat(e.getAttribute("lon")),parseFloat(e.getAttribute("lat"))],a=o(e,"ele"),n=o(e,"gpxtpx:hr")||o(e,"hr"),c=o(e,"time");let i;a&&(i=parseFloat(t(a)),isNaN(i)||r.push(i));const l={coordinates:r,time:c?t(c):null,extendedValues:[]};n&&l.extendedValues.push(["heart",parseFloat(t(n))]);const u=o(e,"extensions");if(null!==u)for(const s of["speed","course","hAcc","vAcc"]){const e=parseFloat(t(o(u,s)));isNaN(e)||l.extendedValues.push([s,e])}return l}function i(e){const t=l(e,"rtept");if(t)return{type:"Feature",properties:Object.assign(n(e),r(o(e,"extensions")),{_gpxType:"rte"}),geometry:{type:"LineString",coordinates:t.line}}}function l(e,t){const o=e.getElementsByTagName(t);if(o.length<2)return;const r=[],a=[],n={};for(let i=0;i<o.length;i++){const e=c(o[i]);r.push(e.coordinates),e.time&&a.push(e.time);for(let t=0;t<e.extendedValues.length;t++){const[r,a]=e.extendedValues[t],c="heart"===r?r:r+"s";n[c]||(n[c]=Array(o.length).fill(null)),n[c][i]=a}}return{line:r,times:a,extendedValues:n}}function u(e){const t=e.getElementsByTagName("trkseg"),a=[],c=[],i=[];for(let o=0;o<t.length;o++){const e=l(t[o],"trkpt");e&&(i.push(e),e.times&&e.times.length&&c.push(e.times))}if(0===i.length)return;const u=i.length>1,s=Object.assign(n(e),r(o(e,"extensions")),{_gpxType:"trk"},c.length?{coordinateProperties:{times:u?c:c[0]}}:{});for(let o=0;o<i.length;o++){const e=i[o];a.push(e.line);for(const[t,r]of Object.entries(e.extendedValues)){let e=s;"heart"===t&&(s.coordinateProperties||(s.coordinateProperties={}),e=s.coordinateProperties),u?(e[t]||(e[t]=i.map(e=>new Array(e.line.length).fill(null))),e[t][o]=r):e[t]=r}}return{type:"Feature",properties:s,geometry:u?{type:"MultiLineString",coordinates:a}:{type:"LineString",coordinates:a[0]}}}function*s(e){const t=e.getElementsByTagName("trk"),o=e.getElementsByTagName("rte"),r=e.getElementsByTagName("wpt");for(let a=0;a<t.length;a++){const e=u(t[a]);e&&(yield e)}for(let a=0;a<o.length;a++){const e=i(o[a]);e&&(yield e)}for(let i=0;i<r.length;i++)yield(l=r[i],{type:"Feature",properties:Object.assign(n(l),a(l,["sym"])),geometry:{type:"Point",coordinates:c(l).coordinates}});var l}const d=[["heartRate","heartRates"],["Cadence","cadences"],["Speed","speeds"],["Watts","watts"]],p=[["TotalTimeSeconds","totalTimeSeconds"],["DistanceMeters","distanceMeters"],["MaximumSpeed","maxSpeed"],["AverageHeartRateBpm","avgHeartRate"],["MaximumHeartRateBpm","maxHeartRate"],["AvgSpeed","avgSpeed"],["AvgWatts","avgWatts"],["MaxWatts","maxWatts"]];function b(e,r){const a=[];for(const[n,c]of r){let r=o(e,n);if(!r){const t=e.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/ActivityExtension/v2",n);t.length&&(r=t[0])}const i=parseFloat(t(r));isNaN(i)||a.push([c,i])}return a}function O(e){const r=t(o(e,"LongitudeDegrees")),a=t(o(e,"LatitudeDegrees"));if(!r.length||!a.length)return null;const n=[parseFloat(r),parseFloat(a)],c=o(e,"AltitudeMeters"),i=o(e,"HeartRateBpm"),l=o(e,"Time");let u;return c&&(u=parseFloat(t(c)),isNaN(u)||n.push(u)),{coordinates:n,time:l?t(l):null,heartRate:i?parseFloat(t(i)):null,extensions:b(e,d)}}function j(e,t){const o=e.getElementsByTagName(t),r=[],a=[],n=[];if(o.length<2)return null;const c={extendedProperties:{}};for(let i=0;i<o.length;i++){const e=O(o[i]);if(null!==e){r.push(e.coordinates),e.time&&a.push(e.time),e.heartRate&&n.push(e.heartRate);for(const[t,r]of e.extensions)c.extendedProperties[t]||(c.extendedProperties[t]=Array(o.length).fill(null)),c.extendedProperties[t][i]=r}}return Object.assign(c,{line:r,times:a,heartRates:n})}function m(e){const r=e.getElementsByTagName("Track"),a=[],n=[],c=[],i=[];let l;const u=function(e){const t={};for(const[o,r]of e)t[o]=r;return t}(b(e,p)),s=o(e,"Name");s&&(u.name=t(s));for(let t=0;t<r.length;t++)l=j(r[t],"Trackpoint"),l&&(a.push(l.line),l.times.length&&n.push(l.times),l.heartRates.length&&c.push(l.heartRates),i.push(l.extendedProperties));for(let t=0;t<i.length;t++){const e=i[t];for(const o in e)1===r.length?u[o]=l.extendedProperties[o]:(u[o]||(u[o]=a.map(e=>Array(e.length).fill(null))),u[o][t]=e[o])}if(0!==a.length)return(n.length||c.length)&&(u.coordinateProperties=Object.assign(n.length?{times:1===a.length?n[0]:n}:{},c.length?{heart:1===a.length?c[0]:c}:{})),{type:"Feature",properties:u,geometry:{type:1===a.length?"LineString":"MultiLineString",coordinates:1===a.length?a[0]:a}}}function*f(e){const t=e.getElementsByTagName("Lap");for(let r=0;r<t.length;r++){const e=m(t[r]);e&&(yield e)}const o=e.getElementsByTagName("Courses");for(let r=0;r<o.length;r++){const e=m(o[r]);e&&(yield e)}}const k=/\s*/g,g=/^\s*|\s*$/g,y=/\s+/;function v(e){if(!e||!e.length)return 0;let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o)|0;return t}function w(e){return e.replace(k,"").split(",").map(parseFloat)}function h(e){return e.replace(g,"").split(y).map(w)}function N(e){if(void 0!==e.xml)return e.xml;if(e.tagName){let t=e.tagName;for(let o=0;o<e.attributes.length;o++)t+=e.attributes[o].name+e.attributes[o].value;for(let o=0;o<e.childNodes.length;o++)t+=N(e.childNodes[o]);return t}return"#text"===e.nodeName?(e.nodeValue||e.value||"").trim():"#cdata-section"===e.nodeName?e.nodeValue:""}const S=["Polygon","LineString","Point","Track","gx:Track"];function T(e,r,a){let n=t(o(r,"color"))||"";const c="stroke"==a||"fill"===a?a:a+"-color";"#"===n.substr(0,1)&&(n=n.substr(1)),6===n.length||3===n.length?e[c]=n:8===n.length&&(e[a+"-opacity"]=parseInt(n.substr(0,2),16)/255,e[c]="#"+n.substr(6,2)+n.substr(4,2)+n.substr(2,2))}function V(e,r,a,n){const c=parseFloat(t(o(r,a)));isNaN(c)||(e[n]=c)}function D(e){let o=e.getElementsByTagName("coord");const r=[],a=[];0===o.length&&(o=e.getElementsByTagName("gx:coord"));for(let c=0;c<o.length;c++)r.push(t(o[c]).split(" ").map(parseFloat));const n=e.getElementsByTagName("when");for(let c=0;c<n.length;c++)a.push(t(n[c]));return{coords:r,times:a}}function C(e){let r,a,n,c,i;const l=[],u=[];if(o(e,"MultiGeometry"))return C(o(e,"MultiGeometry"));if(o(e,"MultiTrack"))return C(o(e,"MultiTrack"));if(o(e,"gx:MultiTrack"))return C(o(e,"gx:MultiTrack"));for(n=0;n<S.length;n++)if(a=e.getElementsByTagName(S[n]),a)for(c=0;c<a.length;c++)if(r=a[c],"Point"===S[n])l.push({type:"Point",coordinates:w(t(o(r,"coordinates")))});else if("LineString"===S[n])l.push({type:"LineString",coordinates:h(t(o(r,"coordinates")))});else if("Polygon"===S[n]){const e=r.getElementsByTagName("LinearRing"),a=[];for(i=0;i<e.length;i++)a.push(h(t(o(e[i],"coordinates"))));l.push({type:"Polygon",coordinates:a})}else if("Track"===S[n]||"gx:Track"===S[n]){const e=D(r);l.push({type:"LineString",coordinates:e.coords}),e.times.length&&u.push(e.times)}return{geoms:l,coordTimes:u}}function _(e,r,a,n){const c=C(e);let i;const l={},u=t(o(e,"name")),s=t(o(e,"address"));let d=t(o(e,"styleUrl"));const p=t(o(e,"description")),b=o(e,"TimeSpan"),O=o(e,"TimeStamp"),j=o(e,"ExtendedData");let m=o(e,"IconStyle"),f=o(e,"LabelStyle"),k=o(e,"LineStyle"),g=o(e,"PolyStyle");const y=o(e,"visibility");if(u&&(l.name=u),s&&(l.address=s),d){"#"!==d[0]&&(d="#"+d),l.styleUrl=d,r[d]&&(l.styleHash=r[d]),a[d]&&(l.styleMapHash=a[d],l.styleHash=r[a[d].normal]);const e=n[l.styleHash];e&&(m||(m=o(e,"IconStyle")),f||(f=o(e,"LabelStyle")),k||(k=o(e,"LineStyle")),g||(g=o(e,"PolyStyle")))}if(p&&(l.description=p),b){const e=t(o(b,"begin")),r=t(o(b,"end"));l.timespan={begin:e,end:r}}if(O&&(l.timestamp=t(o(O,"when"))),m){T(l,m,"icon"),V(l,m,"scale","icon-scale"),V(l,m,"heading","icon-heading");const e=o(m,"hotSpot");if(e){const t=parseFloat(e.getAttribute("x")),o=parseFloat(e.getAttribute("y"));isNaN(t)||isNaN(o)||(l["icon-offset"]=[t,o])}const r=o(m,"Icon");if(r){const e=t(o(r,"href"));e&&(l.icon=e)}}if(f&&(T(l,f,"label"),V(l,f,"scale","label-scale")),k&&(T(l,k,"stroke"),V(l,k,"width","stroke-width")),g){T(l,g,"fill");const e=t(o(g,"fill")),r=t(o(g,"outline"));e&&(l["fill-opacity"]="1"===e?l["fill-opacity"]||1:0),r&&(l["stroke-opacity"]="1"===r?l["stroke-opacity"]||1:0)}if(j){const e=j.getElementsByTagName("Data"),r=j.getElementsByTagName("SimpleData");for(i=0;i<e.length;i++)l[e[i].getAttribute("name")]=t(o(e[i],"value"));for(i=0;i<r.length;i++)l[r[i].getAttribute("name")]=t(r[i])}y&&(l.visibility=t(y)),c.coordTimes.length&&(l.coordinateProperties={times:1===c.coordTimes.length?c.coordTimes[0]:c.coordTimes});const v={type:"Feature",geometry:0===c.geoms.length?null:1===c.geoms.length?c.geoms[0]:{type:"GeometryCollection",geometries:c.geoms},properties:l};return e.getAttribute("id")&&(v.id=e.getAttribute("id")),v}function*E(e){const r={},a={},n={},c=e.getElementsByTagName("Placemark"),i=e.getElementsByTagName("Style"),l=e.getElementsByTagName("StyleMap");for(let t=0;t<i.length;t++){const e=v(N(i[t])).toString(16);r["#"+i[t].getAttribute("id")]=e,a[e]=i[t]}for(let u=0;u<l.length;u++){r["#"+l[u].getAttribute("id")]=v(N(l[u])).toString(16);const e=l[u].getElementsByTagName("Pair"),a={};for(let r=0;r<e.length;r++)a[t(o(e[r],"key"))]=t(o(e[r],"styleUrl"));n["#"+l[u].getAttribute("id")]=a}for(let t=0;t<c.length;t++){const e=_(c[t],r,n,a);e&&(yield e)}}e.gpx=function(e){return{type:"FeatureCollection",features:Array.from(s(e))}},e.gpxGen=s,e.kml=function(e){return{type:"FeatureCollection",features:Array.from(E(e))}},e.kmlGen=E,e.tcx=function(e){return{type:"FeatureCollection",features:Array.from(f(e))}},e.tcxGen=f,Object.defineProperty(e,"__esModule",{value:!0})}))},ebf5:function(e,t,o){"use strict";o("18ac")}}]);
|
|
//# sourceMappingURL=workouts.c5b00439.js.map
|