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