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

2 lines
118 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["workouts"],{"0385":function(e,t,n){"use strict";n.r(t);var o=n("7a23"),r=n("47e2"),a=(n("b0c0"),n("4de4"),n("d3b7"),n("caad"),n("2532"),n("6c02")),c=n("1119"),l=n("6284"),i=function(e){return Object(o["pushScopeId"])("data-v-fe8ba900"),e=e(),Object(o["popScopeId"])(),e},u={class:"workouts-filters"},s={class:"box"},d={class:"form"},b={class:"form-items-group"},p={class:"form-item"},f=["value"],m={class:"form-item"},O=["value"],j={class:"form-items-group"},h={class:"form-item"},g=["value"],v=i((function(){return Object(o["createElementVNode"])("option",{value:""},null,-1)})),y=["value"],k={class:"form-items-group"},w={class:"form-item"},E={class:"form-inputs-group"},N=["value"],S=["value"],V={class:"form-items-group"},T={class:"form-item"},D={class:"form-inputs-group"},_=["value"],I=["value"],C={class:"form-items-group"},x={class:"form-item"},B={class:"form-inputs-group"},R=["value"],A=["value"],U={class:"form-items-group"},L={class:"form-item"},P={class:"form-inputs-group"},$=["value"],M=["value"],F={class:"form-button"},H=Object(o["defineComponent"])({props:{authUser:null,sports:null},emits:["filter"],setup:function(e,t){var n=t.emit,i=e,H=Object(r["b"])(),z=H.t,G=Object(a["c"])(),W=Object(a["d"])(),q=Object(o["toRefs"])(i),K=q.authUser,Z=K.value.imperial_units?l["c"]["km"].defaultTarget:"km",X=Object(o["computed"])((function(){return Object(c["e"])(i.sports,z)})),J=Object.assign({},G.query);function Y(e){""===e.target.value?delete J[e.target.name]:J[e.target.name]=e.target.value}function Q(){n("filter"),"page"in J&&(J["page"]="1"),W.push({path:"/workouts",query:J})}function ee(){n("filter"),W.push({path:"/workouts",query:{}})}return Object(o["watch"])((function(){return G.query}),(function(e){J=Object.assign({},e)})),function(e,t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",u,[Object(o["createElementVNode"])("div",s,[Object(o["createElementVNode"])("div",d,[Object(o["createElementVNode"])("div",b,[Object(o["createElementVNode"])("div",p,[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:Y},null,40,f)]),Object(o["createElementVNode"])("div",m,[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:Y},null,40,O)])]),Object(o["createElementVNode"])("div",j,[Object(o["createElementVNode"])("div",h,[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:Y},[v,(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(Object(o["unref"])(X).filter((function(e){return Object(o["unref"])(K).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",k,[Object(o["createElementVNode"])("div",w,[Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.$t("workouts.DISTANCE"))+" ("+Object(o["toDisplayString"])(Object(o["unref"])(Z))+"): ",1),Object(o["createElementVNode"])("div",E,[Object(o["createElementVNode"])("input",{name:"distance_from",type:"number",min:"0",step:"0.1",value:e.$route.query.distance_from,onChange:Y},null,40,N),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:Y},null,40,S)])])]),Object(o["createElementVNode"])("div",V,[Object(o["createElementVNode"])("div",T,[Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.$t("workouts.DURATION"))+" ("+Object(o["toDisplayString"])(Object(o["unref"])(Z))+"): ",1),Object(o["createElementVNode"])("div",D,[Object(o["createElementVNode"])("input",{name:"duration_from",value:e.$route.query.duration_from,onChange:Y,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,_),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:Y,pattern:"^([0-9]*[0-9]):([0-5][0-9])$",placeholder:"hh:mm",type:"text"},null,40,I)])])]),Object(o["createElementVNode"])("div",C,[Object(o["createElementVNode"])("div",x,[Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.$t("workouts.AVE_SPEED"))+" ("+Object(o["toDisplayString"])(Object(o["unref"])(Z))+"): ",1),Object(o["createElementVNode"])("div",B,[Object(o["createElementVNode"])("input",{min:"0",name:"ave_speed_from",value:e.$route.query.ave_speed_from,onChange:Y,step:"0.1",type:"number"},null,40,R),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:Y,step:"0.1",type:"number"},null,40,A)])])]),Object(o["createElementVNode"])("div",U,[Object(o["createElementVNode"])("div",L,[Object(o["createElementVNode"])("label",null,Object(o["toDisplayString"])(e.$t("workouts.MAX_SPEED"))+" ("+Object(o["toDisplayString"])(Object(o["unref"])(Z))+"): ",1),Object(o["createElementVNode"])("div",P,[Object(o["createElementVNode"])("input",{min:"0",name:"max_speed_from",value:e.$route.query.max_speed_from,onChange:Y,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:Y,step:"0.1",type:"number"},null,40,M)])])])]),Object(o["createElementVNode"])("div",F,[Object(o["createElementVNode"])("button",{class:"confirm",onClick:Q},Object(o["toDisplayString"])(e.$t("buttons.FILTER")),1),Object(o["createElementVNode"])("button",{class:"confirm",onClick:ee},Object(o["toDisplayString"])(e.$t("buttons.CLEAR_FILTER")),1)])])])}}}),z=(n("5022"),n("6b0d")),G=n.n(z);const W=G()(H,[["__scopeId","data-v-fe8ba900"]]);var q=W,K=n("1da1"),Z=n("5530"),X=(n("96cf"),n("d81d"),n("b64b"),n("4fad"),n("ac1f"),n("466d"),n("7db0"),n("b166")),J=n("9176"),Y=n("6d7d"),Q=n("68c6"),ee=n("1724"),te=n("dad5"),ne=n("2906"),oe=n("97e5"),re=n("5e65"),ae=n("9230"),ce=function(e){return Object(o["pushScopeId"])("data-v-c2063212"),e=e(),Object(o["popScopeId"])(),e},le={class:"workouts-list"},ie={class:"total"},ue={class:"total-label"},se={key:0},de={key:0,class:"workouts-table responsive-table"},be=ce((function(){return Object(o["createElementVNode"])("th",{class:"sport-col"},null,-1)})),pe={class:"sport-col"},fe={class:"cell-heading"},me=["onMouseover"],Oe={class:"cell-heading"},je={key:0,class:"fa fa-map-o","aria-hidden":"true"},he={class:"cell-heading"},ge={class:"text-right"},ve={class:"cell-heading"},ye={class:"text-right"},ke={class:"cell-heading"},we={class:"text-right"},Ee={class:"cell-heading"},Ne={class:"text-right"},Se={class:"cell-heading"},Ve={class:"text-right"},Te={class:"cell-heading"},De={class:"text-right"},_e={class:"cell-heading"},Ie=ce((function(){return Object(o["createElementVNode"])("div",{id:"bottom"},null,-1)})),Ce=Object(o["defineComponent"])({props:{user:null,sports:null},setup:function(e){var t=e,n=Object(ne["a"])(),r=Object(a["c"])(),i=Object(a["d"])(),u=Object(o["toRefs"])(t),s=u.user,d=u.sports,b=["ave_speed","distance","duration","workout_date"],p=Object(o["computed"])((function(){return n.getters[te["f"].GETTERS.USER_WORKOUTS]})),f=Object(o["computed"])((function(){return n.getters[te["f"].GETTERS.WORKOUTS_PAGINATION]})),m=g(r.query),O=Object(o["ref"])(null);function j(e){n.dispatch(te["f"].ACTIONS.GET_USER_WORKOUTS,s.value.imperial_units?v(e):e)}function h(e,t){var n=Object.assign({},r.query);n[e]=t,"per_page"===e&&(n["page"]="1"),m=g(n),i.push({path:"/workouts",query:m})}function g(e){return m=Object(oe["a"])(e,b,ae["a"].order_by,{defaultSort:ae["a"].order}),Object.keys(e).filter((function(e){return oe["d"].includes(e)})).map((function(t){"string"===typeof e[t]&&(m[t]=e[t])})),m}function v(e){var t=Object(Z["a"])({},e);return Object.entries(t).map((function(e){e[0].match("speed|distance")&&(t[e[0]]=Object(l["a"])(+e[1],"mi","km"))})),t}function y(e){O.value=e}return Object(o["onBeforeMount"])((function(){j(m)})),Object(o["watch"])((function(){return r.query}),function(){var e=Object(K["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:m=g(t),j(m);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"),a=Object(o["resolveComponent"])("Distance");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",le,[Object(o["createElementVNode"])("div",{class:Object(o["normalizeClass"])(["box",{"empty-table":0===Object(o["unref"])(p).length}])},[Object(o["createElementVNode"])("div",ie,[Object(o["createElementVNode"])("span",ue,Object(o["toDisplayString"])(e.$t("common.TOTAL").toLowerCase())+": ",1),null!==Object(o["unref"])(f).total?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",se,Object(o["toDisplayString"])(Object(o["unref"])(f).total)+" "+Object(o["toDisplayString"])(e.$t("workouts.WORKOUT",Object(o["unref"])(f).total)),1)):Object(o["createCommentVNode"])("",!0)]),Object(o["createVNode"])(J["a"],{sort:Object(o["unref"])(oe["c"]),order_by:b,query:Object(o["unref"])(m),message:"workouts",onUpdateSelect:h},null,8,["sort","query"]),Object(o["unref"])(p).length>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",de,[Object(o["createVNode"])(Y["a"],{class:"top-pagination",pagination:Object(o["unref"])(f),path:"/workouts",query:Object(o["unref"])(m)},null,8,["pagination","query"]),Object(o["createElementVNode"])("table",null,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[be,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"])(p),(function(l){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:l.id},[Object(o["createElementVNode"])("td",pe,[Object(o["createElementVNode"])("span",fe,Object(o["toDisplayString"])(e.$t("workouts.SPORT",1)),1),Object(o["unref"])(d).length>0?(Object(o["openBlock"])(),Object(o["createBlock"])(n,{key:0,title:Object(o["unref"])(d).find((function(e){return e.id===l.sport_id})).translatedLabel,"sport-label":Object(o["unref"])(c["b"])(l,Object(o["unref"])(d)),color:Object(o["unref"])(c["a"])(l,Object(o["unref"])(d))},null,8,["title","sport-label","color"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("td",{class:"workout-title",onMouseover:function(e){return y(l.id)},onMouseleave:t[0]||(t[0]=function(e){return y(null)})},[Object(o["createElementVNode"])("span",Oe,Object(o["toDisplayString"])(Object(o["capitalize"])(e.$t("workouts.WORKOUT",1))),1),Object(o["createVNode"])(r,{class:"nav-item",to:{name:"Workout",params:{workoutId:l.id}}},{default:Object(o["withCtx"])((function(){return[l.with_gpx?(Object(o["openBlock"])(),Object(o["createElementBlock"])("i",je)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(l.title),1)]})),_:2},1032,["to"]),l.with_gpx&&O.value===l.id?(Object(o["openBlock"])(),Object(o["createBlock"])(Q["a"],{key:0,workout:l,"display-hover":!0},null,8,["workout"])):Object(o["createCommentVNode"])("",!0)],40,me),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",he,Object(o["toDisplayString"])(e.$t("workouts.DATE")),1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(Object(o["unref"])(X["a"])(Object(o["unref"])(re["c"])(l.workout_date,Object(o["unref"])(s).timezone),"dd/MM/yyyy HH:mm")),1)]),Object(o["createElementVNode"])("td",ge,[Object(o["createElementVNode"])("span",ve,Object(o["toDisplayString"])(e.$t("workouts.DISTANCE")),1),Object(o["createVNode"])(a,{distance:l.distance,unitFrom:"km",useImperialUnits:Object(o["unref"])(s).imperial_units},null,8,["distance","useImperialUnits"])]),Object(o["createElementVNode"])("td",ye,[Object(o["createElementVNode"])("span",ke,Object(o["toDisplayString"])(e.$t("workouts.DURATION")),1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(l.moving),1)]),Object(o["createElementVNode"])("td",we,[Object(o["createElementVNode"])("span",Ee,Object(o["toDisplayString"])(e.$t("workouts.AVE_SPEED")),1),Object(o["createVNode"])(a,{distance:l.ave_speed,unitFrom:"km",speed:!0,useImperialUnits:Object(o["unref"])(s).imperial_units},null,8,["distance","useImperialUnits"])]),Object(o["createElementVNode"])("td",Ne,[Object(o["createElementVNode"])("span",Se,Object(o["toDisplayString"])(e.$t("workouts.MAX_SPEED")),1),Object(o["createVNode"])(a,{distance:l.max_speed,unitFrom:"km",speed:!0,useImperialUnits:Object(o["unref"])(s).imperial_units},null,8,["distance","useImperialUnits"])]),Object(o["createElementVNode"])("td",Ve,[Object(o["createElementVNode"])("span",Te,Object(o["toDisplayString"])(e.$t("workouts.ASCENT")),1),l.with_gpx?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,distance:l.ascent,unitFrom:"m",useImperialUnits:Object(o["unref"])(s).imperial_units},null,8,["distance","useImperialUnits"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("td",De,[Object(o["createElementVNode"])("span",_e,Object(o["toDisplayString"])(e.$t("workouts.DESCENT")),1),l.with_gpx?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,distance:l.descent,unitFrom:"m",useImperialUnits:Object(o["unref"])(s).imperial_units},null,8,["distance","useImperialUnits"])):Object(o["createCommentVNode"])("",!0)])])})),128))])]),Object(o["createVNode"])(Y["a"],{pagination:Object(o["unref"])(f),path:"/workouts",query:Object(o["unref"])(m)},null,8,["pagination","query"])])):Object(o["createCommentVNode"])("",!0)],2),0===Object(o["unref"])(p).length?(Object(o["openBlock"])(),Object(o["createBlock"])(ee["a"],{key:0})):Object(o["createCommentVNode"])("",!0),Ie])}}});n("8aa2");const xe=G()(Ce,[["__scopeId","data-v-c2063212"]]);var Be=xe,Re={key:0,id:"workouts",class:"view"},Ae={class:"container workouts-container"},Ue={class:"display-filters"},Le={class:"list-container"},Pe=Object(o["defineComponent"])({setup:function(e){var t=Object(r["b"])(),n=t.t,a=Object(ne["a"])(),l=Object(o["computed"])((function(){return a.getters[te["a"].GETTERS.AUTH_USER_PROFILE]})),i=Object(o["computed"])((function(){return a.getters[te["c"].GETTERS.SPORTS]})),u=Object(o["computed"])((function(){return Object(c["e"])(i.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",Ae,[Object(o["createElementVNode"])("div",{class:Object(o["normalizeClass"])(["filters-container",{hidden:s.value}])},[Object(o["createVNode"])(q,{sports:Object(o["unref"])(u),authUser:Object(o["unref"])(l),onFilter:d},null,8,["sports","authUser"])],2),Object(o["createElementVNode"])("div",Ue,[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",Le,[Object(o["createVNode"])(Be,{user:Object(o["unref"])(l),sports:Object(o["unref"])(u)},null,8,["user","sports"])])])])):Object(o["createCommentVNode"])("",!0)}}});n("b1c7");const $e=G()(Pe,[["__scopeId","data-v-03de0ddc"]]);t["default"]=$e},"0716":function(e,t,n){},"0d3b":function(e,t,n){var o=n("d039"),r=n("b622"),a=n("c430"),c=r("iterator");e.exports=!o((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,o){t["delete"]("b"),n+=o+e})),a&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[c]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},"17b6":function(e,t,n){},"19aa":function(e,t,n){var o=n("da84"),r=n("3a9b"),a=o.TypeError;e.exports=function(e,t){if(r(t,e))return e;throw a("Incorrect invocation")}},"19e4":function(e,t,n){},2146:function(e,t,n){"use strict";n("4c68")},2349:function(e,t,n){},"2b3d":function(e,t,n){"use strict";n("3ca3");var o,r=n("23e7"),a=n("83ab"),c=n("0d3b"),l=n("da84"),i=n("0366"),u=n("e330"),s=n("37e8").f,d=n("6eeb"),b=n("19aa"),p=n("1a2d"),f=n("60da"),m=n("4df4"),O=n("4dae"),j=n("6547").codeAt,h=n("5fb2"),g=n("577e"),v=n("d44e"),y=n("9861"),k=n("69f3"),w=k.set,E=k.getterFor("URL"),N=y.URLSearchParams,S=y.getState,V=l.URL,T=l.TypeError,D=l.parseInt,_=Math.floor,I=Math.pow,C=u("".charAt),x=u(/./.exec),B=u([].join),R=u(1..toString),A=u([].pop),U=u([].push),L=u("".replace),P=u([].shift),$=u("".split),M=u("".slice),F=u("".toLowerCase),H=u([].unshift),z="Invalid authority",G="Invalid scheme",W="Invalid host",q="Invalid port",K=/[a-z]/i,Z=/[\d+-.a-z]/i,X=/\d/,J=/^0x/i,Y=/^[0-7]+$/,Q=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,ne=/[\0\t\n\r #/:<>?@[\\\]^|]/,oe=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,re=/[\t\n\r]/g,ae=function(e){var t,n,o,r,a,c,l,i=$(e,".");if(i.length&&""==i[i.length-1]&&i.length--,t=i.length,t>4)return e;for(n=[],o=0;o<t;o++){if(r=i[o],""==r)return e;if(a=10,r.length>1&&"0"==C(r,0)&&(a=x(J,r)?16:8,r=M(r,8==a?1:2)),""===r)c=0;else{if(!x(10==a?Q:8==a?Y:ee,r))return e;c=D(r,a)}U(n,c)}for(o=0;o<t;o++)if(c=n[o],o==t-1){if(c>=I(256,5-t))return null}else if(c>255)return null;for(l=A(n),o=0;o<n.length;o++)l+=n[o]*I(256,3-o);return l},ce=function(e){var t,n,o,r,a,c,l,i=[0,0,0,0,0,0,0,0],u=0,s=null,d=0,b=function(){return C(e,d)};if(":"==b()){if(":"!=C(e,1))return;d+=2,u++,s=u}while(b()){if(8==u)return;if(":"!=b()){t=n=0;while(n<4&&x(ee,b()))t=16*t+D(b(),16),d++,n++;if("."==b()){if(0==n)return;if(d-=n,u>6)return;o=0;while(b()){if(r=null,o>0){if(!("."==b()&&o<4))return;d++}if(!x(X,b()))return;while(x(X,b())){if(a=D(b(),10),null===r)r=a;else{if(0==r)return;r=10*r+a}if(r>255)return;d++}i[u]=256*i[u]+r,o++,2!=o&&4!=o||u++}if(4!=o)return;break}if(":"==b()){if(d++,!b())return}else if(b())return;i[u++]=t}else{if(null!==s)return;d++,u++,s=u}}if(null!==s){c=u-s,u=7;while(0!=u&&c>0)l=i[u],i[u--]=i[s+c-1],i[s+--c]=l}else if(8!=u)return;return i},le=function(e){for(var t=null,n=1,o=null,r=0,a=0;a<8;a++)0!==e[a]?(r>n&&(t=o,n=r),o=null,r=0):(null===o&&(o=a),++r);return r>n&&(t=o,n=r),t},ie=function(e){var t,n,o,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)H(t,e%256),e=_(e/256);return B(t,".")}if("object"==typeof e){for(t="",o=le(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),o===n?(t+=n?":":"::",r=!0):(t+=R(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},ue={},se=f({},ue,{" ":1,'"':1,"<":1,">":1,"`":1}),de=f({},se,{"#":1,"?":1,"{":1,"}":1}),be=f({},de,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),pe=function(e,t){var n=j(e,0);return n>32&&n<127&&!p(t,e)?e:encodeURIComponent(e)},fe={ftp:21,file:null,http:80,https:443,ws:80,wss:443},me=function(e,t){var n;return 2==e.length&&x(K,C(e,0))&&(":"==(n=C(e,1))||!t&&"|"==n)},Oe=function(e){var t;return e.length>1&&me(M(e,0,2))&&(2==e.length||"/"===(t=C(e,2))||"\\"===t||"?"===t||"#"===t)},je=function(e){return"."===e||"%2e"===F(e)},he=function(e){return e=F(e),".."===e||"%2e."===e||".%2e"===e||"%2e%2e"===e},ge={},ve={},ye={},ke={},we={},Ee={},Ne={},Se={},Ve={},Te={},De={},_e={},Ie={},Ce={},xe={},Be={},Re={},Ae={},Ue={},Le={},Pe={},$e=function(e,t,n){var o,r,a,c=g(e);if(t){if(r=this.parse(c),r)throw T(r);this.searchParams=null}else{if(void 0!==n&&(o=new $e(n,!0)),r=this.parse(c,null,o),r)throw T(r);a=S(new N),a.bindURL(this),this.searchParams=a}};$e.prototype={type:"URL",parse:function(e,t,n){var r,a,c,l,i=this,u=t||ge,s=0,d="",b=!1,f=!1,j=!1;e=g(e),t||(i.scheme="",i.username="",i.password="",i.host=null,i.port=null,i.path=[],i.query=null,i.fragment=null,i.cannotBeABaseURL=!1,e=L(e,oe,"")),e=L(e,re,""),r=m(e);while(s<=r.length){switch(a=r[s],u){case ge:if(!a||!x(K,a)){if(t)return G;u=ye;continue}d+=F(a),u=ve;break;case ve:if(a&&(x(Z,a)||"+"==a||"-"==a||"."==a))d+=F(a);else{if(":"!=a){if(t)return G;d="",u=ye,s=0;continue}if(t&&(i.isSpecial()!=p(fe,d)||"file"==d&&(i.includesCredentials()||null!==i.port)||"file"==i.scheme&&!i.host))return;if(i.scheme=d,t)return void(i.isSpecial()&&fe[i.scheme]==i.port&&(i.port=null));d="","file"==i.scheme?u=Ce:i.isSpecial()&&n&&n.scheme==i.scheme?u=ke:i.isSpecial()?u=Se:"/"==r[s+1]?(u=we,s++):(i.cannotBeABaseURL=!0,U(i.path,""),u=Ue)}break;case ye:if(!n||n.cannotBeABaseURL&&"#"!=a)return G;if(n.cannotBeABaseURL&&"#"==a){i.scheme=n.scheme,i.path=O(n.path),i.query=n.query,i.fragment="",i.cannotBeABaseURL=!0,u=Pe;break}u="file"==n.scheme?Ce:Ee;continue;case ke:if("/"!=a||"/"!=r[s+1]){u=Ee;continue}u=Ve,s++;break;case we:if("/"==a){u=Te;break}u=Ae;continue;case Ee:if(i.scheme=n.scheme,a==o)i.username=n.username,i.password=n.password,i.host=n.host,i.port=n.port,i.path=O(n.path),i.query=n.query;else if("/"==a||"\\"==a&&i.isSpecial())u=Ne;else if("?"==a)i.username=n.username,i.password=n.password,i.host=n.host,i.port=n.port,i.path=O(n.path),i.query="",u=Le;else{if("#"!=a){i.username=n.username,i.password=n.password,i.host=n.host,i.port=n.port,i.path=O(n.path),i.path.length--,u=Ae;continue}i.username=n.username,i.password=n.password,i.host=n.host,i.port=n.port,i.path=O(n.path),i.query=n.query,i.fragment="",u=Pe}break;case Ne:if(!i.isSpecial()||"/"!=a&&"\\"!=a){if("/"!=a){i.username=n.username,i.password=n.password,i.host=n.host,i.port=n.port,u=Ae;continue}u=Te}else u=Ve;break;case Se:if(u=Ve,"/"!=a||"/"!=C(d,s+1))continue;s++;break;case Ve:if("/"!=a&&"\\"!=a){u=Te;continue}break;case Te:if("@"==a){b&&(d="%40"+d),b=!0,c=m(d);for(var h=0;h<c.length;h++){var v=c[h];if(":"!=v||j){var y=pe(v,be);j?i.password+=y:i.username+=y}else j=!0}d=""}else if(a==o||"/"==a||"?"==a||"#"==a||"\\"==a&&i.isSpecial()){if(b&&""==d)return z;s-=m(d).length+1,d="",u=De}else d+=a;break;case De:case _e:if(t&&"file"==i.scheme){u=Be;continue}if(":"!=a||f){if(a==o||"/"==a||"?"==a||"#"==a||"\\"==a&&i.isSpecial()){if(i.isSpecial()&&""==d)return W;if(t&&""==d&&(i.includesCredentials()||null!==i.port))return;if(l=i.parseHost(d),l)return l;if(d="",u=Re,t)return;continue}"["==a?f=!0:"]"==a&&(f=!1),d+=a}else{if(""==d)return W;if(l=i.parseHost(d),l)return l;if(d="",u=Ie,t==_e)return}break;case Ie:if(!x(X,a)){if(a==o||"/"==a||"?"==a||"#"==a||"\\"==a&&i.isSpecial()||t){if(""!=d){var k=D(d,10);if(k>65535)return q;i.port=i.isSpecial()&&k===fe[i.scheme]?null:k,d=""}if(t)return;u=Re;continue}return q}d+=a;break;case Ce:if(i.scheme="file","/"==a||"\\"==a)u=xe;else{if(!n||"file"!=n.scheme){u=Ae;continue}if(a==o)i.host=n.host,i.path=O(n.path),i.query=n.query;else if("?"==a)i.host=n.host,i.path=O(n.path),i.query="",u=Le;else{if("#"!=a){Oe(B(O(r,s),""))||(i.host=n.host,i.path=O(n.path),i.shortenPath()),u=Ae;continue}i.host=n.host,i.path=O(n.path),i.query=n.query,i.fragment="",u=Pe}}break;case xe:if("/"==a||"\\"==a){u=Be;break}n&&"file"==n.scheme&&!Oe(B(O(r,s),""))&&(me(n.path[0],!0)?U(i.path,n.path[0]):i.host=n.host),u=Ae;continue;case Be:if(a==o||"/"==a||"\\"==a||"?"==a||"#"==a){if(!t&&me(d))u=Ae;else if(""==d){if(i.host="",t)return;u=Re}else{if(l=i.parseHost(d),l)return l;if("localhost"==i.host&&(i.host=""),t)return;d="",u=Re}continue}d+=a;break;case Re:if(i.isSpecial()){if(u=Ae,"/"!=a&&"\\"!=a)continue}else if(t||"?"!=a)if(t||"#"!=a){if(a!=o&&(u=Ae,"/"!=a))continue}else i.fragment="",u=Pe;else i.query="",u=Le;break;case Ae:if(a==o||"/"==a||"\\"==a&&i.isSpecial()||!t&&("?"==a||"#"==a)){if(he(d)?(i.shortenPath(),"/"==a||"\\"==a&&i.isSpecial()||U(i.path,"")):je(d)?"/"==a||"\\"==a&&i.isSpecial()||U(i.path,""):("file"==i.scheme&&!i.path.length&&me(d)&&(i.host&&(i.host=""),d=C(d,0)+":"),U(i.path,d)),d="","file"==i.scheme&&(a==o||"?"==a||"#"==a))while(i.path.length>1&&""===i.path[0])P(i.path);"?"==a?(i.query="",u=Le):"#"==a&&(i.fragment="",u=Pe)}else d+=pe(a,de);break;case Ue:"?"==a?(i.query="",u=Le):"#"==a?(i.fragment="",u=Pe):a!=o&&(i.path[0]+=pe(a,ue));break;case Le:t||"#"!=a?a!=o&&("'"==a&&i.isSpecial()?i.query+="%27":i.query+="#"==a?"%23":pe(a,ue)):(i.fragment="",u=Pe);break;case Pe:a!=o&&(i.fragment+=pe(a,se));break}s++}},parseHost:function(e){var t,n,o;if("["==C(e,0)){if("]"!=C(e,e.length-1))return W;if(t=ce(M(e,1,-1)),!t)return W;this.host=t}else if(this.isSpecial()){if(e=h(e),x(te,e))return W;if(t=ae(e),null===t)return W;this.host=t}else{if(x(ne,e))return W;for(t="",n=m(e),o=0;o<n.length;o++)t+=pe(n[o],ue);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return p(fe,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&me(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,o=e.password,r=e.host,a=e.port,c=e.path,l=e.query,i=e.fragment,u=t+":";return null!==r?(u+="//",e.includesCredentials()&&(u+=n+(o?":"+o:"")+"@"),u+=ie(r),null!==a&&(u+=":"+a)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?c[0]:c.length?"/"+B(c,"/"):"",null!==l&&(u+="?"+l),null!==i&&(u+="#"+i),u},setHref:function(e){var t=this.parse(e);if(t)throw T(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new Me(e.path[0]).origin}catch(n){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+ie(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(g(e)+":",ge)},getUsername:function(){return this.username},setUsername:function(e){var t=m(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=pe(t[n],be)}},getPassword:function(){return this.password},setPassword:function(e){var t=m(g(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=pe(t[n],be)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ie(e):ie(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,De)},getHostname:function(){var e=this.host;return null===e?"":ie(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,_e)},getPort:function(){var e=this.port;return null===e?"":g(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=g(e),""==e?this.port=null:this.parse(e,Ie))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+B(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Re))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=g(e),""==e?this.query=null:("?"==C(e,0)&&(e=M(e,1)),this.query="",this.parse(e,Le)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){e=g(e),""!=e?("#"==C(e,0)&&(e=M(e,1)),this.fragment="",this.parse(e,Pe)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Me=function(e){var t=b(this,Fe),n=arguments.length>1?arguments[1]:void 0,o=w(t,new $e(e,!1,n));a||(t.href=o.serialize(),t.origin=o.getOrigin(),t.protocol=o.getProtocol(),t.username=o.getUsername(),t.password=o.getPassword(),t.host=o.getHost(),t.hostname=o.getHostname(),t.port=o.getPort(),t.pathname=o.getPathname(),t.search=o.getSearch(),t.searchParams=o.getSearchParams(),t.hash=o.getHash())},Fe=Me.prototype,He=function(e,t){return{get:function(){return E(this)[e]()},set:t&&function(e){return E(this)[t](e)},configurable:!0,enumerable:!0}};if(a&&s(Fe,{href:He("serialize","setHref"),origin:He("getOrigin"),protocol:He("getProtocol","setProtocol"),username:He("getUsername","setUsername"),password:He("getPassword","setPassword"),host:He("getHost","setHost"),hostname:He("getHostname","setHostname"),port:He("getPort","setPort"),pathname:He("getPathname","setPathname"),search:He("getSearch","setSearch"),searchParams:He("getSearchParams"),hash:He("getHash","setHash")}),d(Fe,"toJSON",(function(){return E(this).serialize()}),{enumerable:!0}),d(Fe,"toString",(function(){return E(this).serialize()}),{enumerable:!0}),V){var ze=V.createObjectURL,Ge=V.revokeObjectURL;ze&&d(Me,"createObjectURL",i(ze,V)),Ge&&d(Me,"revokeObjectURL",i(Ge,V))}v(Me,"URL"),r({global:!0,forced:!c,sham:!a},{URL:Me})},"304a":function(e,t,n){"use strict";n.r(t);var o=n("1da1"),r=(n("96cf"),n("7a23")),a=n("6c02"),c=n("f7f9"),l=(n("7db0"),n("d3b7"),n("99af"),n("3ca3"),n("ddb0"),n("2b3d"),n("9861"),n("9c4a")),i=function(e){return Object(r["pushScopeId"])("data-v-4d9f9a8a"),e=e(),Object(r["popScopeId"])(),e},u={id:"workout-card-title"},s=["title"],d=i((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1)})),b=[d],p={class:"workout-card-title"},f={class:"workout-title-date"},m={key:0,class:"workout-title"},O={key:1,class:"workout-title"},j={class:"workout-segment"},h=Object(r["createTextVNode"])(" — "),g=i((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-map-marker","aria-hidden":"true"},null,-1)})),v={class:"workout-date"},y={class:"workout-link"},k=["title"],w=i((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1)})),E=[w],N=Object(r["defineComponent"])({props:{sport:null,workoutObject:null},emits:["displayModal"],setup:function(e,t){var n=t.emit,a=e,c=Object(r["toRefs"])(a),i=c.sport,d=c.workoutObject;function w(e){return N.apply(this,arguments)}function N(){return N=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,l["a"].get("workouts/".concat(t,"/gpx/download"),{responseType:"blob"}).then((function(e){var n=window.URL.createObjectURL(new Blob([e.data],{type:"application/gpx+xml"})),o=document.createElement("a");o.href=n,o.setAttribute("download","".concat(t,".gpx")),document.body.appendChild(o),o.click()}));case 2:case"end":return e.stop()}}),e)}))),N.apply(this,arguments)}return function(e,t){var o=Object(r["resolveComponent"])("SportImage"),a=Object(r["resolveComponent"])("router-link");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",u,[Object(r["createElementVNode"])("div",{class:Object(r["normalizeClass"])(["workout-previous workout-arrow",{inactive:!Object(r["unref"])(d).previousUrl}]),title:Object(r["unref"])(d).previousUrl?e.$t("workouts.PREVIOUS_".concat(Object(r["unref"])(d).type)):e.$t("workouts.NO_PREVIOUS_".concat(Object(r["unref"])(d).type)),onClick:t[0]||(t[0]=function(t){return Object(r["unref"])(d).previousUrl?e.$router.push(Object(r["unref"])(d).previousUrl):null})},b,10,s),Object(r["createElementVNode"])("div",p,[Object(r["createVNode"])(o,{"sport-label":Object(r["unref"])(i).label,color:Object(r["unref"])(i).color},null,8,["sport-label","color"]),Object(r["createElementVNode"])("div",f,["WORKOUT"===Object(r["unref"])(d).type?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",m,[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(Object(r["unref"])(d).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"])(d).workoutId}})})}),Object(r["unref"])(d).with_gpx?(Object(r["openBlock"])(),Object(r["createElementBlock"])("i",{key:0,class:"fa fa-download","aria-hidden":"true",onClick:t[2]||(t[2]=Object(r["withModifiers"])((function(e){return w(Object(r["unref"])(d).workoutId)}),["prevent"]))})):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("i",{class:"fa fa-trash","aria-hidden":"true",onClick:t[3]||(t[3]=function(e){return n("displayModal",!0)})})])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",O,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(Object(r["unref"])(d).title)+" ",1),Object(r["createElementVNode"])("span",j,[h,g,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.SEGMENT"))+" "+Object(r["toDisplayString"])(Object(r["unref"])(d).segmentId+1),1)])])),Object(r["createElementVNode"])("div",v,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(Object(r["unref"])(d).workoutDate)+" - "+Object(r["toDisplayString"])(Object(r["unref"])(d).workoutTime)+" ",1),Object(r["createElementVNode"])("span",y,["SEGMENT"===Object(r["unref"])(d).type?(Object(r["openBlock"])(),Object(r["createBlock"])(a,{key:0,to:{name:"Workout",params:{workoutId:Object(r["unref"])(d).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"])(d).nextUrl}]),title:Object(r["unref"])(d).nextUrl?e.$t("workouts.NEXT_".concat(Object(r["unref"])(d).type)):e.$t("workouts.NO_NEXT_".concat(Object(r["unref"])(d).type)),onClick:t[4]||(t[4]=function(t){return Object(r["unref"])(d).nextUrl?e.$router.push(Object(r["unref"])(d).nextUrl):null})},E,10,k)])}}}),S=(n("c12b"),n("6b0d")),V=n.n(S);const T=V()(N,[["__scopeId","data-v-4d9f9a8a"]]);var D=T,_=function(e){return Object(r["pushScopeId"])("data-v-1a5282f6"),e=e(),Object(r["popScopeId"])(),e},I={key:0,class:"workout-record"},C=_((function(){return Object(r["createElementVNode"])("sup",null,[Object(r["createElementVNode"])("i",{class:"fa fa-trophy","aria-hidden":"true"})],-1)})),x=[C],B=Object(r["defineComponent"])({props:{recordType:null,workoutObject:null},setup:function(e){var t=e,n=Object(r["toRefs"])(t),o=n.recordType,a=n.workoutObject;return function(e,t){return Object(r["unref"])(a).records&&Object(r["unref"])(a).records.find((function(e){return e.record_type===Object(r["unref"])(o)}))?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",I,x)):Object(r["createCommentVNode"])("",!0)}}});n("b86c");const R=V()(B,[["__scopeId","data-v-1a5282f6"]]);var A=R,U=(n("b680"),n("a9e3"),n("47e2")),L=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"],P=function(e){var t=Math.floor(e/22.5+.5);return L[t%16]},$={class:"wind"},M={class:"wind-bearing"},F=["title"],H=Object(r["defineComponent"])({props:{weather:null,useImperialUnits:{type:Boolean}},setup:function(e){var t=e,n=Object(r["toRefs"])(t),o=n.useImperialUnits,a=n.weather,c=Object(U["b"])(),l=c.t;function i(e){return l("workouts.WEATHER.WIND_DIRECTIONS.".concat(P(e)))}return function(e,t){var n=Object(r["resolveComponent"])("Distance");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",$,[Object(r["createVNode"])(n,{distance:Object(r["unref"])(a).wind,unitFrom:"m",digits:1,displayUnit:!1,useImperialUnits:Object(r["unref"])(o)},null,8,["distance","useImperialUnits"]),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(Object(r["unref"])(o)?"ft":"m")+"/s ",1),Object(r["createElementVNode"])("div",M,[Object(r["unref"])(a).windBearing?(Object(r["openBlock"])(),Object(r["createElementBlock"])("i",{key:0,class:"fa fa-long-arrow-up",style:Object(r["normalizeStyle"])({transform:"rotate(".concat(Object(r["unref"])(a).windBearing,"deg)")}),"aria-hidden":"true",title:i(Object(r["unref"])(a).windBearing)},null,12,F)):Object(r["createCommentVNode"])("",!0)])])}}});n("6aa3");const z=V()(H,[["__scopeId","data-v-06447b03"]]);var G=z,W=function(e){return Object(r["pushScopeId"])("data-v-76e9ab62"),e=e(),Object(r["popScopeId"])(),e},q={key:0,id:"workout-weather"},K={class:"weather-table"},Z=W((function(){return Object(r["createElementVNode"])("th",null,null,-1)})),X={class:"weather-th"},J=["src","alt","title"],Y={class:"weather-th"},Q=["src","alt","title"],ee=["alt","title"],te=["alt","title"],ne=["alt","title"],oe=Object(r["defineComponent"])({props:{workoutObject:null,useImperialUnits:{type:Boolean}},setup:function(e){var t=e,n=Object(r["toRefs"])(t),o=n.useImperialUnits,a=n.workoutObject;return function(e,t){return Object(r["unref"])(a).weatherStart&&Object(r["unref"])(a).weatherEnd?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",q,[Object(r["createElementVNode"])("table",K,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Z,Object(r["createElementVNode"])("th",null,[Object(r["createElementVNode"])("div",X,[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"])(a).weatherStart.icon,".svg"),alt:e.$t("workouts.WEATHER.DARK_SKY.".concat(Object(r["unref"])(a).weatherStart.icon)),title:e.$t("workouts.WEATHER.DARK_SKY.".concat(Object(r["unref"])(a).weatherStart.icon))},null,8,J)])]),Object(r["createElementVNode"])("th",null,[Object(r["createElementVNode"])("div",Y,[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"])(a).weatherEnd.icon,".svg"),alt:e.$t("workouts.WEATHER.DARK_SKY.".concat(Object(r["unref"])(a).weatherEnd.icon)),title:e.$t("workouts.WEATHER.DARK_SKY.".concat(Object(r["unref"])(a).weatherEnd.icon))},null,8,Q)])])])]),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,ee)]),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(Number(Object(r["unref"])(a).weatherStart.temperature).toFixed(1))+"°C ",1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(Number(Object(r["unref"])(a).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,te)]),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(Number(100*Object(r["unref"])(a).weatherStart.humidity).toFixed(1))+"% ",1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(Number(100*Object(r["unref"])(a).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,ne)]),Object(r["createElementVNode"])("td",null,[Object(r["createVNode"])(G,{weather:Object(r["unref"])(a).weatherStart,useImperialUnits:Object(r["unref"])(o)},null,8,["weather","useImperialUnits"])]),Object(r["createElementVNode"])("td",null,[Object(r["createVNode"])(G,{weather:Object(r["unref"])(a).weatherEnd,useImperialUnits:Object(r["unref"])(o)},null,8,["weather","useImperialUnits"])])])])])])):Object(r["createCommentVNode"])("",!0)}}});n("ffd1");const re=V()(oe,[["__scopeId","data-v-76e9ab62"]]);var ae=re,ce=function(e){return Object(r["pushScopeId"])("data-v-dc2fbc66"),e=e(),Object(r["popScopeId"])(),e},le={id:"workout-info"},ie={class:"workout-data"},ue=ce((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1)})),se={class:"label"},de=Object(r["createTextVNode"])(": "),be={class:"value"},pe={key:0},fe={class:"value"},me={class:"value"},Oe={class:"workout-data"},je=ce((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-road","aria-hidden":"true"},null,-1)})),he={class:"label"},ge=Object(r["createTextVNode"])(": "),ve={class:"workout-data"},ye=ce((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-tachometer","aria-hidden":"true"},null,-1)})),ke={class:"label"},we=Object(r["createTextVNode"])(": "),Ee=ce((function(){return Object(r["createElementVNode"])("br",null,null,-1)})),Ne={class:"label"},Se=Object(r["createTextVNode"])(": "),Ve={key:0,class:"workout-data"},Te=["alt"],De={class:"label"},_e=Object(r["createTextVNode"])(": "),Ie=ce((function(){return Object(r["createElementVNode"])("br",null,null,-1)})),Ce={class:"label"},xe=Object(r["createTextVNode"])(": "),Be={key:1,class:"workout-data"},Re=ce((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1)})),Ae={class:"label"},Ue=Object(r["createTextVNode"])(": "),Le=ce((function(){return Object(r["createElementVNode"])("br",null,null,-1)})),Pe={class:"label"},$e=Object(r["createTextVNode"])(": "),Me=Object(r["defineComponent"])({props:{workoutObject:null,useImperialUnits:{type:Boolean}},setup:function(e){var t=e,n=Object(r["toRefs"])(t),o=n.workoutObject,a=n.useImperialUnits,c=Object(r["computed"])((function(){return"0:00:00"!==t.workoutObject.pauses&&null!==t.workoutObject.pauses}));return function(e,t){var n=Object(r["resolveComponent"])("Distance");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",le,[Object(r["createElementVNode"])("div",ie,[ue,Object(r["createElementVNode"])("span",se,Object(r["toDisplayString"])(e.$t("workouts.DURATION")),1),de,Object(r["createElementVNode"])("span",be,Object(r["toDisplayString"])(Object(r["unref"])(o).moving),1),Object(r["createVNode"])(A,{workoutObject:Object(r["unref"])(o),recordType:"LD"},null,8,["workoutObject"]),Object(r["unref"])(c)?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",pe,[Object(r["createTextVNode"])(" ("+Object(r["toDisplayString"])(e.$t("workouts.PAUSES"))+": ",1),Object(r["createElementVNode"])("span",fe,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",me,Object(r["toDisplayString"])(Object(r["unref"])(o).duration)+")",1)])):Object(r["createCommentVNode"])("",!0)]),Object(r["createElementVNode"])("div",Oe,[je,Object(r["createElementVNode"])("span",he,Object(r["toDisplayString"])(e.$t("workouts.DISTANCE")),1),ge,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).distance,digits:3,unitFrom:"km",strong:!0,useImperialUnits:Object(r["unref"])(a)},null,8,["distance","useImperialUnits"]),Object(r["createVNode"])(A,{workoutObject:Object(r["unref"])(o),recordType:"FD"},null,8,["workoutObject"])]),Object(r["createElementVNode"])("div",ve,[ye,Object(r["createElementVNode"])("span",ke,Object(r["toDisplayString"])(e.$t("workouts.AVERAGE_SPEED")),1),we,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).aveSpeed,unitFrom:"km",speed:!0,strong:!0,useImperialUnits:Object(r["unref"])(a)},null,8,["distance","useImperialUnits"]),Object(r["createVNode"])(A,{workoutObject:Object(r["unref"])(o),recordType:"AS"},null,8,["workoutObject"]),Ee,Object(r["createElementVNode"])("span",Ne,Object(r["toDisplayString"])(e.$t("workouts.MAX_SPEED")),1),Se,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).maxSpeed,unitFrom:"km",speed:!0,strong:!0,useImperialUnits:Object(r["unref"])(a)},null,8,["distance","useImperialUnits"]),Object(r["createVNode"])(A,{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,Te),Object(r["createElementVNode"])("span",De,Object(r["toDisplayString"])(e.$t("workouts.MIN_ALTITUDE")),1),_e,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).minAlt,unitFrom:"m",strong:!0,useImperialUnits:Object(r["unref"])(a)},null,8,["distance","useImperialUnits"]),Ie,Object(r["createElementVNode"])("span",Ce,Object(r["toDisplayString"])(e.$t("workouts.MAX_ALTITUDE")),1),xe,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).maxAlt,unitFrom:"m",strong:!0,useImperialUnits:Object(r["unref"])(a)},null,8,["distance","useImperialUnits"])])):Object(r["createCommentVNode"])("",!0),null!==Object(r["unref"])(o).ascent&&null!==Object(r["unref"])(o).descent?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Be,[Re,Object(r["createElementVNode"])("span",Ae,Object(r["toDisplayString"])(e.$t("workouts.ASCENT")),1),Ue,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).ascent,unitFrom:"m",strong:!0,useImperialUnits:Object(r["unref"])(a)},null,8,["distance","useImperialUnits"]),Le,Object(r["createElementVNode"])("span",Pe,Object(r["toDisplayString"])(e.$t("workouts.DESCENT")),1),$e,Object(r["createVNode"])(n,{distance:Object(r["unref"])(o).descent,unitFrom:"m",strong:!0,useImperialUnits:Object(r["unref"])(a)},null,8,["distance","useImperialUnits"])])):Object(r["createCommentVNode"])("",!0),Object(r["createVNode"])(ae,{workoutObject:Object(r["unref"])(o),useImperialUnits:Object(r["unref"])(a)},null,8,["workoutObject","useImperialUnits"])])}}});n("5f44");const Fe=V()(Me,[["__scopeId","data-v-dc2fbc66"]]);var He=Fe,ze=n("e94f"),Ge=n("5afd"),We=(n("6cc5"),Object(r["defineComponent"])({props:{markerCoordinates:null,isStart:{type:Boolean}},setup:function(e){var t=e,n=Object(r["toRefs"])(t),o=n.isStart,a=n.markerCoordinates;return function(e,t){return Object(r["unref"])(a).latitude?(Object(r["openBlock"])(),Object(r["createBlock"])(Object(r["unref"])(Ge["g"]),{key:0,"lat-lng":[Object(r["unref"])(a).latitude,Object(r["unref"])(a).longitude]},{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(Object(r["unref"])(Ge["d"]),{"icon-url":"/img/workouts/".concat(Object(r["unref"])(o)?"start":"finish",".svg"),iconSize:[15,15]},null,8,["icon-url"])]})),_:1},8,["lat-lng"])):Object(r["createCommentVNode"])("",!0)}}}));const qe=We;var Ke=qe,Ze=n("dad5"),Xe=n("2906"),Je=n("d257"),Ye=function(e){return Object(r["pushScopeId"])("data-v-4aafe1d0"),e=e(),Object(r["popScopeId"])(),e},Qe={id:"workout-map"},et={key:0,class:"leaflet-container"},tt={key:1},nt=Ye((function(){return Object(r["createElementVNode"])("i",{class:"fa fa-refresh","aria-hidden":"true"},null,-1)})),ot={key:1,class:"no-map"},rt=Object(r["defineComponent"])({props:{workoutData:null,markerCoordinates:{default:function(){return{}}}},setup:function(e){var t=e,n=Object(Xe["a"])(),o=Object(r["toRefs"])(t),a=o.workoutData,c=o.markerCoordinates,l=Object(r["ref"])(null),i=Object(r["computed"])((function(){return h()})),u=Object(r["computed"])((function(){return n.getters[Ze["b"].GETTERS.APP_CONFIG]})),s=Object(r["computed"])((function(){return O(i)})),d=Object(r["computed"])((function(){return t.workoutData&&t.workoutData.gpx?m(t.workoutData.gpx):{}})),b=Object(r["computed"])((function(){return t.workoutData&&t.workoutData.chartData.length>0?{latitude:t.workoutData.chartData[0].latitude,longitude:t.workoutData.chartData[0].longitude}:{}})),p=Object(r["computed"])((function(){return t.workoutData&&t.workoutData.chartData.length>0?{latitude:t.workoutData.chartData[t.workoutData.chartData.length-1].latitude,longitude:t.workoutData.chartData[t.workoutData.chartData.length-1].longitude}:{}})),f=Object(r["ref"])(!1);function m(e){if(!e||""!==e)try{var t=Object(ze["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 j(e){var t,n;null!==(t=l.value)&&void 0!==t&&t.leafletObject&&(null===(n=l.value)||void 0===n||n.leafletObject.fitBounds(e))}function h(){return t.workoutData?[[t.workoutData.workout.bounds[0],t.workoutData.workout.bounds[1]],[t.workoutData.workout.bounds[2],t.workoutData.workout.bounds[3]]]:[]}function g(){var e;null===(e=l.value)||void 0===e||e.leafletObject.fitBounds(h())}function v(){f.value=!f.value,f.value||setTimeout((function(){g()}),100)}return function(e,t){var n=Object(r["resolveComponent"])("VFullscreen");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Qe,[Object(r["unref"])(a).loading?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",et)):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",tt,[Object(r["unref"])(a).workout.with_gpx?(Object(r["openBlock"])(),Object(r["createBlock"])(n,{key:0,modelValue:f.value,"onUpdate:modelValue":t[1]||(t[1]=function(e){return f.value=e})},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",{class:Object(r["normalizeClass"])(["leaflet-container",{"fullscreen-map":f.value}])},[Object(r["unref"])(d).jsonData&&Object(r["unref"])(s)&&2===Object(r["unref"])(i).length?(Object(r["openBlock"])(),Object(r["createBlock"])(Object(r["unref"])(Ge["f"]),{key:0,zoom:13,maxZoom:19,center:Object(r["unref"])(s),bounds:Object(r["unref"])(i),ref_key:"workoutMap",ref:l,onReady:t[0]||(t[0]=function(e){return j(Object(r["unref"])(i))})},{default:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(Object(r["unref"])(Ge["b"])),Object(r["createVNode"])(Object(r["unref"])(Ge["a"]),{position:"topleft",class:"map-control",onClick:g},{default:Object(r["withCtx"])((function(){return[nt]})),_:1}),Object(r["createVNode"])(Object(r["unref"])(Ge["a"]),{position:"topleft",class:"map-control",onClick:v},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("i",{class:Object(r["normalizeClass"])("fa fa-".concat(f.value?"compress":"arrows-alt")),"aria-hidden":"true"},null,2)]})),_:1}),Object(r["createVNode"])(Object(r["unref"])(Ge["h"]),{url:"".concat(Object(r["unref"])(Je["a"])(),"workouts/map_tile/{s}/{z}/{x}/{y}.png"),attribution:Object(r["unref"])(u).map_attribution,bounds:Object(r["unref"])(i)},null,8,["url","attribution","bounds"]),Object(r["createVNode"])(Object(r["unref"])(Ge["c"]),{geojson:Object(r["unref"])(d).jsonData},null,8,["geojson"]),Object(r["unref"])(c).latitude?(Object(r["openBlock"])(),Object(r["createBlock"])(Object(r["unref"])(Ge["g"]),{key:0,"lat-lng":[Object(r["unref"])(c).latitude,Object(r["unref"])(c).longitude]},null,8,["lat-lng"])):Object(r["createCommentVNode"])("",!0),Object(r["createVNode"])(Object(r["unref"])(Ge["e"]),{name:e.$t("workouts.START_AND_FINISH"),"layer-type":"overlay"},{default:Object(r["withCtx"])((function(){return[Object(r["unref"])(b).latitude?(Object(r["openBlock"])(),Object(r["createBlock"])(Ke,{key:0,markerCoordinates:Object(r["unref"])(b),isStart:!0},null,8,["markerCoordinates"])):Object(r["createCommentVNode"])("",!0),Object(r["unref"])(p).latitude?(Object(r["openBlock"])(),Object(r["createBlock"])(Ke,{key:1,markerCoordinates:Object(r["unref"])(p),isStart:!1},null,8,["markerCoordinates"])):Object(r["createCommentVNode"])("",!0)]})),_:1},8,["name"])]})),_:1},8,["center","bounds"])):Object(r["createCommentVNode"])("",!0)],2)]})),_:1},8,["modelValue"])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",ot,Object(r["toDisplayString"])(e.$t("workouts.NO_MAP")),1))]))])}}});n("85d8");const at=V()(rt,[["__scopeId","data-v-4aafe1d0"]]);var ct=at,lt=n("5e65"),it={class:"workout-detail"},ut=Object(r["defineComponent"])({props:{authUser:null,displaySegment:{type:Boolean},sports:null,workoutData:null,markerCoordinates:{default:function(){return{}}}},setup:function(e){var t=e,n=Object(a["c"])(),c=Object(Xe["a"])(),l=Object(r["toRefs"])(t),i=l.authUser,u=l.markerCoordinates,s=l.workoutData,d=Object(r["computed"])((function(){return t.workoutData.workout})),b=Object(r["ref"])(n.params.workoutId?+n.params.segmentId:null),p=Object(r["computed"])((function(){return d.value.segments.length>0&&b.value?d.value.segments[+b.value-1]:null})),f=Object(r["ref"])(!1),m=Object(r["computed"])((function(){return t.sports?t.sports.find((function(e){return e.id===t.workoutData.workout.sport_id})):{}})),O=Object(r["computed"])((function(){return h(d.value,p.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 h(e,n){var o=j(e,t.displaySegment,b.value?+b.value:null),r=Object(lt["a"])(Object(lt["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,weatherStart:n?null:e.weather_start,with_gpx:e.with_gpx,workoutId:e.id,workoutTime:r.workout_time}}function g(e){f.value=e}function v(e){c.dispatch(Ze["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&&(b.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",it,[Object(r["unref"])(f)?(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 v(Object(r["unref"])(O).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"])(D,{sport:Object(r["unref"])(m),workoutObject:Object(r["unref"])(O),onDisplayModal:t[2]||(t[2]=function(e){return g(!0)})},null,8,["sport","workoutObject"])]})),content:Object(r["withCtx"])((function(){return[Object(r["createVNode"])(ct,{workoutData:Object(r["unref"])(s),markerCoordinates:Object(r["unref"])(u)},null,8,["workoutData","markerCoordinates"]),Object(r["createVNode"])(He,{workoutObject:Object(r["unref"])(O),useImperialUnits:Object(r["unref"])(i).imperial_units},null,8,["workoutObject","useImperialUnits"])]})),_:1})])}}});n("e2f4");const st=V()(ut,[["__scopeId","data-v-578bb8ea"]]);var dt=st,bt=n("ade3"),pt=(n("e9c4"),n("ac1f"),n("5319"),n("b48c")),ft=(n("d9e2"),n("159b"),function(e){var t=document.getElementById(e);if(t){var n=t.querySelector("ul");return n||(n=document.createElement("ul"),t.appendChild(n)),n}throw new Error("No legend container")}),mt={id:"htmlLegend",afterUpdate:function(e,t,n){var o,r,a,c,l,i,u=ft(n.containerID);while(u.firstChild)u.firstChild.remove();var s=null!==(o=e.options.plugins)&&void 0!==o&&null!==(r=o.legend)&&void 0!==r&&null!==(a=r.labels)&&void 0!==a&&a.generateLabels?null===(c=e.options.plugins)||void 0===c||null===(l=c.legend)||void 0===l||null===(i=l.labels)||void 0===i?void 0:i.generateLabels(e):[];s.forEach((function(t){var n=document.createElement("li");n.onclick=function(){e.setDatasetVisibility(t.datasetIndex,!e.isDatasetVisible(t.datasetIndex)),e.update()};var o=document.createElement("input");o&&(o.type="checkbox",o.id=t.text,o.checked=!t.hidden);var r=document.createTextNode(t.text),a=document.createElement("span");a&&(a.style.background=String(t.fillStyle),a.style.borderColor=String(t.strokeStyle)),n.appendChild(o),n.appendChild(r),n.appendChild(a),u.appendChild(n)}))}},Ot=n("6284"),jt=n("9230"),ht=function(e){return Object(r["pushScopeId"])("data-v-7b25bb74"),e=e(),Object(r["popScopeId"])(),e},gt={id:"workout-chart"},vt={class:"chart-radio"},yt=["checked"],kt=["checked"],wt=ht((function(){return Object(r["createElementVNode"])("div",{id:"chart-legend"},null,-1)})),Et={class:"chart-info"},Nt={class:"no-data-cleaning"},St={class:"elevation-start"},Vt=["checked"],Tt=Object(r["defineComponent"])({props:{authUser:null,workoutData:null},emits:["getCoordinates"],setup:function(e,t){var n=t.emit,o=e,a=Object(U["b"])(),c=a.t,l=Object(r["ref"])(!0),i=Object(r["ref"])(!0),u=Object(r["computed"])((function(){return Object(jt["b"])(o.workoutData.chartData,c,o.authUser.imperial_units)})),s=y("km"),d=y("m"),b=Object(r["computed"])((function(){return{labels:l.value?u.value.distance_labels:u.value.duration_labels,datasets:JSON.parse(JSON.stringify([u.value.datasets.speed,u.value.datasets.elevation]))}})),p=Object(r["computed"])((function(){return u.value.coordinates})),f=Object(r["computed"])((function(){var e;return{responsive:!0,maintainAspectRatio:!0,animation:!1,layout:{padding:{top:22}},scales:(e={},Object(bt["a"])(e,l.value?"xDistance":"xDuration",{grid:{drawOnChartArea:!1},ticks:{count:10,callback:function(e){return l.value?Number(e).toFixed(2):h(e)}},type:"linear",bounds:"data",title:{display:!0,text:l.value?c("workouts.DISTANCE")+" (".concat(s,")"):c("workouts.DURATION")}}),Object(bt["a"])(e,"ySpeed",{grid:{drawOnChartArea:!1},position:"left",title:{display:!0,text:c("workouts.SPEED")+" (".concat(s,"/h)")}}),Object(bt["a"])(e,"yElevation",{beginAtZero:i.value,grid:{drawOnChartArea:!1},position:"right",title:{display:!0,text:c("workouts.ELEVATION")+" (".concat(d,")")}}),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+" ".concat(d):t+" ".concat(s,"/h")},title:function(e){return e.length>0&&g(p.value[e[0].dataIndex]),0===e.length?"":l.value?"".concat(c("workouts.DISTANCE"),": ").concat(e[0].label," ").concat(s):"".concat(c("workouts.DURATION"),": ").concat(h(e[0].label.replace(",","")))}}},legend:{display:!1},htmlLegend:{containerID:"chart-legend"}}}})),m=Object(pt["useLineChart"])({chartData:b,options:f,plugins:[mt]}),O=m.lineChartProps;function j(){l.value=!l.value}function h(e){return new Date(1e3*+e).toISOString().substr(11,8)}function g(e){n("getCoordinates",e)}function v(){g({latitude:null,longitude:null})}function y(e){return o.authUser.imperial_units?Ot["c"][e].defaultTarget:e}return function(e,t){var n=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",gt,[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",vt,[Object(r["createElementVNode"])("label",null,[Object(r["createElementVNode"])("input",{type:"radio",name:"distance",checked:Object(r["unref"])(l),onClick:j},null,8,yt),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"])(l),onClick:j},null,8,kt),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.DURATION")),1)])]),wt,Object(r["createVNode"])(Object(r["unref"])(pt["LineChart"]),Object(r["mergeProps"])(Object(r["unref"])(O),{class:"line-chart",onMouseleave:v}),null,16),Object(r["createElementVNode"])("div",Et,[Object(r["createElementVNode"])("div",Nt,Object(r["toDisplayString"])(e.$t("workouts.NO_DATA_CLEANING")),1),Object(r["createElementVNode"])("div",St,[Object(r["createElementVNode"])("label",null,[Object(r["createElementVNode"])("input",{type:"checkbox",checked:Object(r["unref"])(i),onClick:t[0]||(t[0]=function(e){return Object(r["isRef"])(i)?i.value=!Object(r["unref"])(i):i=!Object(r["unref"])(i)})},null,8,Vt),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.$t("workouts.START_ELEVATION_AT_ZERO")),1)])])])]})),_:1})])}}});n("73b0");const Dt=V()(Tt,[["__scopeId","data-v-7b25bb74"]]);var _t=Dt,It={id:"workout-note"},Ct=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",It,[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("c4b5");const xt=V()(Ct,[["__scopeId","data-v-028ad527"]]);var Bt=xt,Rt={id:"workout-segments"},At=Object(r["defineComponent"])({props:{segments:null,useImperialUnits:{type:Boolean}},setup:function(e){var t=e,n=Object(r["toRefs"])(t),o=n.segments,a=n.useImperialUnits;return function(e,t){var n=Object(r["resolveComponent"])("router-link"),c=Object(r["resolveComponent"])("Distance"),l=Object(r["resolveComponent"])("Card");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Rt,[Object(r["createVNode"])(l,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"))+": ",1),Object(r["createVNode"])(c,{distance:t.distance,unitFrom:"km",useImperialUnits:Object(r["unref"])(a)},null,8,["distance","useImperialUnits"]),Object(r["createTextVNode"])(", "+Object(r["toDisplayString"])(e.$t("workouts.DURATION"))+": "+Object(r["toDisplayString"])(t.duration)+") ",1)])})),128))])]})),_:1})])}}});n("dbf6");const Ut=V()(At,[["__scopeId","data-v-6b8a27cd"]]);var Lt=Ut,Pt=function(e){return Object(r["pushScopeId"])("data-v-d146d84a"),e=e(),Object(r["popScopeId"])(),e},$t={id:"workout",class:"view"},Mt={class:"container"},Ft={key:0,class:"workout-container"},Ht={key:0},zt=Pt((function(){return Object(r["createElementVNode"])("div",{id:"bottom"},null,-1)})),Gt={key:1},Wt=Object(r["defineComponent"])({props:{displaySegment:{type:Boolean}},setup:function(e){var t=e,n=Object(a["c"])(),l=Object(Xe["a"])(),i=Object(r["toRefs"])(t),u=i.displaySegment,s=Object(r["computed"])((function(){return l.getters[Ze["f"].GETTERS.WORKOUT_DATA]})),d=Object(r["computed"])((function(){return l.getters[Ze["a"].GETTERS.AUTH_USER_PROFILE]})),b=Object(r["computed"])((function(){return l.getters[Ze["c"].GETTERS.SPORTS]})),p=Object(r["ref"])({latitude:null,longitude:null});function f(e){p.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(Ze["f"].ACTIONS.GET_WORKOUT_DATA,e)})),Object(r["onUnmounted"])((function(){l.commit(Ze["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(Ze["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(Ze["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",$t,[Object(r["createElementVNode"])("div",Mt,[Object(r["unref"])(b).length>0?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ft,[Object(r["unref"])(s).workout.id?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ht,[Object(r["createVNode"])(dt,{workoutData:Object(r["unref"])(s),sports:Object(r["unref"])(b),authUser:Object(r["unref"])(d),markerCoordinates:Object(r["unref"])(p),displaySegment:Object(r["unref"])(u)},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"])(_t,{key:0,workoutData:Object(r["unref"])(s),authUser:Object(r["unref"])(d),displaySegment:Object(r["unref"])(u),onGetCoordinates:f},null,8,["workoutData","authUser","displaySegment"])):Object(r["createCommentVNode"])("",!0),!Object(r["unref"])(u)&&Object(r["unref"])(s).workout.segments.length>1?(Object(r["openBlock"])(),Object(r["createBlock"])(Lt,{key:1,segments:Object(r["unref"])(s).workout.segments,useImperialUnits:Object(r["unref"])(d).imperial_units},null,8,["segments","useImperialUnits"])):Object(r["createCommentVNode"])("",!0),Object(r["unref"])(u)?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createBlock"])(Bt,{key:2,notes:Object(r["unref"])(s).workout.notes},null,8,["notes"])),zt])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Gt,[Object(r["unref"])(s).loading?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createBlock"])(c["a"],{key:0,target:"WORKOUT"}))]))])):Object(r["createCommentVNode"])("",!0)])])}}});n("2146");const qt=V()(Wt,[["__scopeId","data-v-d146d84a"]]);t["default"]=qt},3450:function(e,t,n){},"3bd0":function(e,t,n){},"4c68":function(e,t,n){},5022:function(e,t,n){"use strict";n("83e8")},"57cc":function(e,t,n){},"5afd":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return E})),n.d(t,"b",(function(){return V})),n.d(t,"c",(function(){return C})),n.d(t,"d",(function(){return A})),n.d(t,"e",(function(){return U})),n.d(t,"f",(function(){return L})),n.d(t,"g",(function(){return M})),n.d(t,"h",(function(){return q}));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)}},a=e=>e&&"function"===typeof e.charAt?e.charAt(0).toUpperCase()+e.slice(1):e,c=(e,t,n)=>{for(const r in n){const c="set"+a(r);e[c]?Object(o["watch"])(()=>n[r],(t,n)=>{e[c](t,n)}):t[c]&&Object(o["watch"])(()=>n[r],e=>{t[c](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},i=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})},u=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",p={options:{type:Object,default:()=>({})}},f=e=>({options:e.options,methods:{}}),m={...p,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}},O=(e,t,n)=>{const r=Object(o["inject"])("addLayer"),a=Object(o["inject"])("removeLayer"),{options:c,methods:l}=f(e),i={...c,attribution:e.attribution,pane:e.pane},u=()=>r({leafletObject:t.value}),s=()=>a({leafletObject:t.value}),d={...l,setAttribution(e,t){const n=this.$parent.leafletObject.attributionControl;n.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){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:i,methods:d}},j=(e,t)=>{if(e&&t.default)return Object(o["h"])("div",{style:{display:"none"}},t.default())},h={...p,interactive:{type:Boolean,default:!0},bubblingMouseEvents:{type:Boolean,default:!0}},g={...m,...h,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}},v={...g,latLng:{type:[Object,Array],custom:!0,default:null},radius:{type:Number,default:null}};const y={...p,position:{type:String,default:"topright"}},k=(e,t)=>{const{options:n,methods:r}=f(e),a={...n,position:e.position},c={...r,setPosition(e){t.value&&t.value.setPosition(e)}};return Object(o["onUnmounted"])(()=>{t.value&&t.value.remove()}),{options:a,methods:c}},w=e=>e.default?Object(o["h"])("div",{ref:"root"},e.default()):null;var E={name:"LControl",props:{...y,disableClickPropagation:{type:Boolean,custom:!0,default:!0},disableScrollPropagation:{type:Boolean,custom:!0,default:!1}},setup(e,t){const r=Object(o["ref"])({}),a=Object(o["ref"])(null),l=Object(o["inject"])(b),i=Object(o["inject"])("registerControl"),{options:u,methods:s}=k(e,r);return Object(o["onMounted"])(async()=>{const{Control:b,DomEvent:p}=l?d.L:await n.e("chunk-2d0da8f3").then(n.bind(null,"6bb3")),f=b.extend({onAdd(){return a.value}});r.value=new f(u),c(s,r.value,e),i({leafletObject:r.value}),e.disableClickPropagation&&p.disableClickPropagation(a.value),e.disableScrollPropagation&&p.disableScrollPropagation(a.value),Object(o["nextTick"])(()=>t.emit("ready",r.value))}),{root:a,leafletObject:r}},render(){return w(this.$slots)},__file:"src/components/LControl.vue"};const N={...y,collapsed:{type:Boolean,default:!0},autoZIndex:{type:Boolean,default:!0},hideSingleBase:{type:Boolean,default:!1},sortLayers:{type:Boolean,default:!1},sortFunction:{type:Function,default:void 0}},S=(e,t)=>{const{options:n}=k(e,t),o={...n,collapsed:e.collapsed,autoZIndex:e.autoZIndex,hideSingleBase:e.hideSingleBase,sortLayers:e.sortLayers,sortFunction:e.sortFunction},r={addLayer(e){"base"===e.layerType?t.value.addBaseLayer(e.leafletObject,e.name):"overlay"===e.layerType&&t.value.addOverlay(e.leafletObject,e.name)},removeLayer(e){t.value.removeLayer(e.leafletObject)}};return{options:o,methods:r}};var V={name:"LControlLayers",props:N,setup(e,t){const r=Object(o["ref"])({}),a=Object(o["inject"])(b),l=Object(o["inject"])("registerLayerControl"),{options:i,methods:u}=S(e,r);return Object(o["onMounted"])(async()=>{const{control:s}=a?d.L:await n.e("chunk-2d0da8f3").then(n.bind(null,"6bb3"));r.value=s.layers(null,null,i),c(u,r.value,e),l({...e,...u,leafletObject:r.value}),Object(o["nextTick"])(()=>t.emit("ready",r.value))}),{leafletObject:r.value}},render(){return null},__file:"src/components/LControlLayers.vue"};Boolean,Boolean,Boolean;const T={...m},D=(e,t,n)=>{const{options:r,methods:a}=O(e,t,n),c={...r},l={...a,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:c,methods:l}};const _={...T,geojson:{type:[Object,Array],default:()=>({})}},I=(e,t)=>{const{options:n,methods:o}=D(e,t),r={...n,...e},a={...o,setGeojson(e){t.value.clearLayers(),t.value.addData(e)},getGeoJSONData(){return t.value.toGeoJSON()},getBounds(){return t.value.getBounds()}};return{options:r,methods:a}};var C={props:_,setup(e,t){const r=Object(o["ref"])({}),a=Object(o["ref"])(!1),i=Object(o["inject"])(b),u=Object(o["inject"])("addLayer"),{methods:s,options:p}=I(e,r);return Object(o["onMounted"])(async()=>{const{geoJSON:b,DomEvent:f}=i?d.L:await n.e("chunk-2d0da8f3").then(n.bind(null,"6bb3"));r.value=b(e.geojson,p);const m=l(t.attrs);f.on(r.value,m),c(s,r.value,e),u({...e,...s,leafletObject:r.value}),a.value=!0,Object(o["nextTick"])(()=>t.emit("ready",r.value))}),{ready:a,leafletObject:r}},render(){return j(this.ready,this.$slots)},__file:"src/components/LGeoJson.vue"};const x={...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}},B=(e,t,n)=>{const{options:o,methods:r}=O(e,t,n),a={...o,pane:e.pane,opacity:e.opacity,zIndex:e.zIndex,tileSize:e.tileSize,noWrap:e.noWrap,minZoom:e.minZoom,maxZoom:e.maxZoom};return{options:a,methods:{...r}}};const R={iconUrl:{type:String,custom:!0,default:null},iconRetinaUrl:{type:String,custom:!0,default:null},iconSize:{type:[Object,Array],custom:!0,default:null},iconAnchor:{type:[Object,Array],custom:!0,default:null},popupAnchor:{type:[Object,Array],custom:!0,default:()=>[0,0]},tooltipAnchor:{type:[Object,Array],custom:!0,default:()=>[0,0]},shadowUrl:{type:String,custom:!0,default:null},shadowRetinaUrl:{type:String,custom:!0,default:null},shadowSize:{type:[Object,Array],custom:!0,default:null},shadowAnchor:{type:[Object,Array],custom:!0,default:null},bgPos:{type:[Object,Array],custom:!0,default:()=>[0,0]},className:{type:String,custom:!0,default:""},options:{type:Object,custom:!0,default:()=>({})}};var A={name:"LIcon",props:{...R,...p},setup(e,t){const r=Object(o["ref"])(null),a=Object(o["inject"])(b),i=Object(o["inject"])("canSetParentHtml"),u=Object(o["inject"])("setParentHtml"),s=Object(o["inject"])("setIcon");let p,m,O,j,h=void 0;const g=(n,o,r)=>{const a=n&&n.innerHTML;if(!o)return void(r&&h&&i()&&u(a));const c=l(t.attrs);h&&m(h,c);const{options:d}=f(e),b={...d,iconUrl:e.iconUrl,iconRetinaUrl:e.iconRetinaUrl,iconSize:e.iconSize,iconAnchor:e.iconAnchor,popupAnchor:e.popupAnchor,tooltipAnchor:e.tooltipAnchor,shadowUrl:e.shadowUrl,shadowRetinaUrl:e.shadowRetinaUrl,shadowSize:e.shadowSize,shadowAnchor:e.shadowAnchor,bgPos:e.bgPos,className:e.className,html:a||e.html};h=b.html?O(b):j(b),p(h,c),s(h)},v=()=>{Object(o["nextTick"])(()=>g(r.value,!0,!1))},y=()=>{Object(o["nextTick"])(()=>g(r.value,!1,!0))},k={setIconUrl:v,setIconRetinaUrl:v,setIconSize:v,setIconAnchor:v,setPopupAnchor:v,setTooltipAnchor:v,setShadowUrl:v,setShadowRetinaUrl:v,setShadowAnchor:v,setBgPos:v,setClassName:v,setHtml:v};return Object(o["onMounted"])(async()=>{const{DomEvent:t,divIcon:o,icon:l}=a?d.L:await n.e("chunk-2d0da8f3").then(n.bind(null,"6bb3"));p=t.on,m=t.off,O=o,j=l,c(k,{},e);const i=new MutationObserver(y);i.observe(r.value,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),v()}),{root:r}},render(){const e=this.$slots.default?this.$slots.default():void 0;return Object(o["h"])("div",{ref:"root"},e)},__file:"src/components/LIcon.vue"};Boolean,Boolean;var U={props:T,setup(e,t){const r=Object(o["ref"])({}),a=Object(o["ref"])(!1),i=Object(o["inject"])(b),u=Object(o["inject"])("addLayer"),{methods:s}=D(e,r,t);return Object(o["onMounted"])(async()=>{const{layerGroup:b,DomEvent:p}=i?d.L:await n.e("chunk-2d0da8f3").then(n.bind(null,"6bb3"));r.value=b(e.options);const f=l(t.attrs);p.on(r.value,f),c(s,r.value,e),u({...e,...s,leafletObject:r.value}),a.value=!0,Object(o["nextTick"])(()=>t.emit("ready",r.value))}),{ready:a,leafletObject:r}},render(){return j(this.ready,this.$slots)},__file:"src/components/LLayerGroup.vue"},L={emits:["ready","update:zoom","update:center","update:bounds"],props:{...p,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 a=Object(o["ref"])(null),p=Object(o["reactive"])({ready:!1,leafletRef:{},layersToAdd:[],layersInControl:[]}),{options:m}=f(e),O={...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},j=u("addLayer"),h=u("removeLayer"),g=u("registerControl"),v=u("registerLayerControl");Object(o["provide"])(b,e.useGlobalLeaflet);const y={moveEndHandler(){t.emit("update:zoom",p.leafletRef.getZoom()),t.emit("update:center",p.leafletRef.getCenter()),t.emit("update:bounds",p.leafletRef.getBounds())},overlayAddHandler(e){const t=p.layersInControl.find(t=>t.name===e.name);t&&t.updateVisibleProp(!0)},overlayRemoveHandler(e){const t=p.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:u,CRS:b,Icon:f,latLngBounds:m,latLng:k,DomEvent:w}=e.useGlobalLeaflet?d.L:await n.e("chunk-2d0da8f3").then(n.bind(null,"6bb3"));try{O.beforeMapMount&&await O.beforeMapMount()}catch(V){console.error("The following error occurred running the provided beforeMapMount hook "+V.message)}await i(f);const E="string"==typeof O.crs?b[O.crs]:O.crs;O.crs=E||b.EPSG3857;const N={addLayer(e){if(void 0!==e.layerType)if(void 0===p.layerControl)p.layersToAdd.push(e);else{const t=p.layersInControl.find(t=>t.leafletObject._leaflet_id===e.leafletObject._leaflet_id);t||(p.layerControl.addLayer(e),p.layersInControl.push(e))}!1!==e.visible&&p.leafletRef.addLayer(e.leafletObject)},removeLayer(e){void 0!==e.layerType&&(void 0===p.layerControl?p.layersToAdd=p.layersToAdd.filter(t=>t.name!==e.name):(p.layerControl.removeLayer(e.leafletObject),p.layersInControl=p.layersInControl.filter(t=>t.leafletObject._leaflet_id!==e.leafletObject._leaflet_id))),p.leafletRef.removeLayer(e.leafletObject)},registerLayerControl(e){p.layerControl=e,p.layersToAdd.forEach(e=>{p.layerControl.addLayer(e)}),p.layersToAdd=[],g(e)},registerControl(e){p.leafletRef.addControl(e.leafletObject)},setZoom(t){const n=p.leafletRef.getZoom();t!==n&&p.leafletRef.setZoom(t,{animate:!e.noBlockingAnimations&&null})},setPaddingBottomRight(e){p.paddingBottomRight=e},setPaddingTopLeft(e){p.paddingTopLeft=e},setPadding(e){p.padding=e},setCrs(e){const t=p.leafletRef.getBounds();p.leafletRef.options.crs=e,p.leafletRef.fitBounds(t,{animate:!1,padding:[0,0]})},fitBounds(e){p.leafletRef.fitBounds(e,{animate:!this.noBlockingAnimations&&null})},setBounds(e){if(!e)return;const t=m(e);if(!t.isValid())return;const n=p.lastSetBounds||p.leafletRef.getBounds(),o=!n.equals(t,0);o&&(p.lastSetBounds=t,p.leafletRef.fitBounds(t,this.fitBoundsOptions))},setCenter(e){if(null==e)return;const t=k(e),n=p.lastSetCenter||p.leafletRef.getCenter();n.lat===t.lat&&n.lng===t.lng||(p.lastSetCenter=t,p.leafletRef.panTo(t,{animate:!this.noBlockingAnimations&&null}))}};s(j,N.addLayer),s(h,N.removeLayer),s(g,N.registerControl),s(v,N.registerLayerControl),p.leafletRef=u(a.value,O),c(N,p.leafletRef,e);const S=l(t.attrs);p.leafletRef.on("moveend",r(y.moveEndHandler,100)),p.leafletRef.on("overlayadd",y.overlayAddHandler),p.leafletRef.on("overlayremove",y.overlayRemoveHandler),w.on(p.leafletRef,S),p.ready=!0,Object(o["nextTick"])(()=>t.emit("ready",p.leafletRef))}),Object(o["onBeforeUnmount"])(()=>{p.leafletRef&&p.leafletRef.remove()});const k=Object(o["computed"])(()=>p.leafletRef),w=Object(o["computed"])(()=>p.ready);return{root:a,ready:w,leafletObject:k}},render(){return Object(o["h"])("div",{style:{width:"100%",height:"100%"},ref:"root"},this.ready?this.$slots.default():{})},__file:"src/components/LMap.vue"};const P={...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}},$=(e,t,n)=>{const{options:o,methods:r}=O(e,t,n),a={...o,...e},c={...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:a,methods:c}};var M={name:"LMarker",props:P,setup(e,t){const a=Object(o["ref"])({}),i=Object(o["ref"])(!1),u=Object(o["inject"])(b),s=Object(o["inject"])("addLayer");Object(o["provide"])("canSetParentHtml",()=>!!a.value.getElement()),Object(o["provide"])("setParentHtml",e=>a.value.getElement().innerHTML=e),Object(o["provide"])("setIcon",e=>a.value.setIcon&&a.value.setIcon(e));const{options:p,methods:f}=$(e,a,t);return void 0===p.icon&&delete p.icon,Object(o["onMounted"])(async()=>{const{marker:b,DomEvent:m}=u?d.L:await n.e("chunk-2d0da8f3").then(n.bind(null,"6bb3"));a.value=b(e.latLng,p);const O=l(t.attrs);m.on(a.value,O),a.value.on("move",r(f.latLngSync,100)),c(f,a.value,e),s({...e,...f,leafletObject:a.value}),i.value=!0,Object(o["nextTick"])(()=>t.emit("ready",a.value))}),{ready:i,leafletObject:a}},render(){return j(this.ready,this.$slots)},__file:"src/components/LMarker.vue"};const F={...g,latLngs:{type:Array,default:()=>[]},smoothFactor:{type:Number,custom:!0,default:1},noClip:{type:Boolean,custom:!0,default:!1}},H={...F};const z={...p,content:{type:String,default:null}};const G={...x,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:n,methods:o}=B(e,t),r={...n,tms:e.tms,subdomains:e.subdomains,detectRetina:e.detectRetina};return{options:r,methods:{...o}}};var q={props:G,setup(e,t){const r=Object(o["ref"])({}),a=Object(o["inject"])(b),i=Object(o["inject"])("addLayer"),{options:u,methods:s}=W(e,r);return Object(o["onMounted"])(async()=>{const{tileLayer:b,DomEvent:p}=a?d.L:await n.e("chunk-2d0da8f3").then(n.bind(null,"6bb3"));r.value=b(e.url,u);const f=l(t.attrs);p.on(r.value,f),c(s,r.value,e),i({...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("b680"),n("99af"),n("7a23")),a=n("47e2"),c=n("6c02"),l=n("dad5"),i=n("2906"),u=n("5e65"),s=n("c364"),d=n("1119"),b=n("6284"),p={id:"workout-form"},f=["onSubmit"],m={class:"form-items"},O={key:0,class:"form-item-radio"},j=["checked","disabled"],h={for:"withGpx"},g=["checked","disabled"],v={for:"withoutGpx"},y={class:"form-item"},k=["disabled"],w=["value"],E={key:1,class:"form-item"},N={for:"gpxFile"},S=["disabled"],V={class:"files-help info-box"},T={key:2,class:"form-item"},D={for:"title"},_=["required","disabled"],I={key:3},C={class:"workout-date-duration"},x={class:"form-item"},B={class:"workout-date-time"},R=["disabled"],A=["disabled"],U={class:"form-item"},L=["disabled"],P=Object(r["createTextVNode"])(" : "),$=["disabled"],M=Object(r["createTextVNode"])(" : "),F=["disabled"],H={class:"form-item"},z=["disabled"],G={class:"form-item"},W={key:1},q={key:2,class:"form-buttons"},K=["disabled"],Z=["onClick"],X=Object(r["defineComponent"])({props:{authUser:null,sports:null,isCreation:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},workout:{default:function(){return{}}}},setup:function(e){var t=e,n=Object(a["b"])(),X=n.t,J=Object(i["a"])(),Y=Object(c["d"])(),Q=Object(r["toRefs"])(t),ee=Q.authUser,te=Q.workout,ne=Q.isCreation,oe=Q.loading,re=Object(r["computed"])((function(){return Object(d["e"])(t.sports,X,"is_active_for_user",te.value.id?[te.value.sport_id]:[])})),ae=Object(r["computed"])((function(){return J.getters[l["b"].GETTERS.APP_CONFIG]})),ce=ae.value.max_single_file_size?Object(s["b"])(ae.value.max_single_file_size):"",le=ae.value.gpx_limit_import,ie=ae.value.max_zip_file_size?Object(s["b"])(ae.value.max_zip_file_size):"",ue=Object(r["computed"])((function(){return J.getters[l["b"].GETTERS.ERROR_MESSAGES]})),se=Object(r["reactive"])({sport_id:"",title:"",notes:"",workoutDate:"",workoutTime:"",workoutDurationHour:"",workoutDurationMinutes:"",workoutDurationSeconds:"",workoutDistance:""}),de=Object(r["ref"])(t.workout.id?t.workout.with_gpx:t.isCreation),be=null,pe=Object(r["ref"])(!1);function fe(e){se.notes=e}function me(){de.value=!de.value,pe.value=!1}function Oe(e){e.target.files&&(be=e.target.files[0])}function je(e){if(se.sport_id="".concat(e.sport_id),se.title=e.title,se.notes=e.notes,!e.with_gpx){var n=Object(u["a"])(Object(u["c"])(e.workout_date,t.authUser.timezone),"yyyy-MM-dd"),o=e.duration.split(":");se.workoutDistance="".concat(ee.value.imperial_units?Object(b["a"])(e.distance,"km","mi",2):parseFloat(e.distance.toFixed(2))),se.workoutDate=n.workout_date,se.workoutTime=n.workout_time,se.workoutDurationHour=o[0],se.workoutDurationMinutes=o[1],se.workoutDurationSeconds=o[2]}}function he(e){e.title=se.title,e.distance=ee.value.imperial_units?Object(b["a"])(+se.workoutDistance,"mi","km",3):+se.workoutDistance,e.duration=3600*+se.workoutDurationHour+60*+se.workoutDurationMinutes+ +se.workoutDurationSeconds,e.workout_date="".concat(se.workoutDate," ").concat(se.workoutTime)}function ge(){var e={sport_id:+se.sport_id,notes:se.notes};if(t.workout.id)t.workout.with_gpx?e.title=se.title:he(e),J.dispatch(l["f"].ACTIONS.EDIT_WORKOUT,{workoutId:t.workout.id,data:e});else if(de.value){if(!be){var n="workouts.NO_FILE_PROVIDED";return void J.commit(l["b"].MUTATIONS.SET_ERROR_MESSAGES,n)}e.file=be,J.dispatch(l["f"].ACTIONS.ADD_WORKOUT,e)}else he(e),J.dispatch(l["f"].ACTIONS.ADD_WORKOUT_WITHOUT_GPX,e)}function ve(){t.workout.id?Y.push({name:"Workout",params:{workoutId:t.workout.id}}):Y.go(-1)}function ye(){pe.value=!0}return Object(r["onMounted"])((function(){t.workout.id&&je(t.workout)})),Object(r["onUnmounted"])((function(){return J.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&&je(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"),a=Object(r["resolveComponent"])("Loader"),c=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"])(te)&&Object(r["unref"])(te).with_gpx}])},[Object(r["createVNode"])(c,null,{title:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("workouts.".concat(Object(r["unref"])(ne)?"ADD":"EDIT","_WORKOUT"))),1)]})),content:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",p,[Object(r["createElementVNode"])("form",{class:Object(r["normalizeClass"])({errors:pe.value}),onSubmit:Object(r["withModifiers"])(ge,["prevent"])},[Object(r["createElementVNode"])("div",m,[Object(r["unref"])(ne)?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",O,[Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("input",{id:"withGpx",type:"radio",checked:Object(r["unref"])(de),disabled:Object(r["unref"])(oe),onClick:me},null,8,j),Object(r["createElementVNode"])("label",h,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"])(de),disabled:Object(r["unref"])(oe),onClick:me},null,8,g),Object(r["createElementVNode"])("label",v,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:ye,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[0]||(t[0]=function(e){return Object(r["unref"])(se).sport_id=e})},[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(Object(r["unref"])(re),(function(e){return Object(r["openBlock"])(),Object(r["createElementBlock"])("option",{value:e.id,key:e.id},Object(r["toDisplayString"])(e.translatedLabel),9,w)})),128))],40,k),[[r["vModelSelect"],Object(r["unref"])(se).sport_id]])]),Object(r["unref"])(ne)&&Object(r["unref"])(de)?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",E,[Object(r["createElementVNode"])("label",N,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"])(oe),required:"",onInvalid:ye,onInput:Oe},null,40,S),Object(r["createElementVNode"])("div",V,[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"])(ce)),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"])(le)),1),Object(r["createElementVNode"])("li",null,Object(r["toDisplayString"])(e.$t("workouts.MAX_SIZE"))+": "+Object(r["toDisplayString"])(Object(r["unref"])(ie)),1)])])])])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",T,[Object(r["createElementVNode"])("label",D,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"])(ne),onInvalid:ye,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[1]||(t[1]=function(e){return Object(r["unref"])(se).title=e})},null,40,_),[[r["vModelText"],Object(r["unref"])(se).title]])])),Object(r["unref"])(de)?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",I,[Object(r["createElementVNode"])("div",C,[Object(r["createElementVNode"])("div",x,[Object(r["createElementVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.WORKOUT_DATE"))+":",1),Object(r["createElementVNode"])("div",B,[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{id:"workout-date",name:"workout-date",type:"date",required:"",onInvalid:ye,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[2]||(t[2]=function(e){return Object(r["unref"])(se).workoutDate=e})},null,40,R),[[r["vModelText"],Object(r["unref"])(se).workoutDate]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{id:"workout-time",name:"workout-time",class:"workout-time",type:"time",required:"",onInvalid:ye,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[3]||(t[3]=function(e){return Object(r["unref"])(se).workoutTime=e})},null,40,A),[[r["vModelText"],Object(r["unref"])(se).workoutTime]])])]),Object(r["createElementVNode"])("div",U,[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-1]?[0-9]|2[0-3])$",required:"",onInvalid:ye,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[4]||(t[4]=function(e){return Object(r["unref"])(se).workoutDurationHour=e})},null,40,L),[[r["vModelText"],Object(r["unref"])(se).workoutDurationHour]]),P,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:ye,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[5]||(t[5]=function(e){return Object(r["unref"])(se).workoutDurationMinutes=e})},null,40,$),[[r["vModelText"],Object(r["unref"])(se).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:ye,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[6]||(t[6]=function(e){return Object(r["unref"])(se).workoutDurationSeconds=e})},null,40,F),[[r["vModelText"],Object(r["unref"])(se).workoutDurationSeconds]])])])]),Object(r["createElementVNode"])("div",H,[Object(r["createElementVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.DISTANCE"))+" ("+Object(r["toDisplayString"])(Object(r["unref"])(ee).imperial_units?"mi":"km")+"): ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{name:"workout-distance",type:"number",min:"0",step:"0.001",required:"",onInvalid:ye,disabled:Object(r["unref"])(oe),"onUpdate:modelValue":t[7]||(t[7]=function(e){return Object(r["unref"])(se).workoutDistance=e})},null,40,z),[[r["vModelText"],Object(r["unref"])(se).workoutDistance]])])])),Object(r["createElementVNode"])("div",G,[Object(r["createElementVNode"])("label",null,Object(r["toDisplayString"])(e.$t("workouts.NOTES"))+": ",1),Object(r["createVNode"])(n,{name:"notes",input:Object(r["unref"])(se).notes,disabled:Object(r["unref"])(oe),onUpdateValue:fe},null,8,["input","disabled"])])]),Object(r["unref"])(ue)?(Object(r["openBlock"])(),Object(r["createBlock"])(o,{key:0,message:Object(r["unref"])(ue)},null,8,["message"])):Object(r["createCommentVNode"])("",!0),Object(r["unref"])(oe)?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",W,[Object(r["createVNode"])(a)])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",q,[Object(r["createElementVNode"])("button",{class:"confirm",type:"submit",disabled:Object(r["unref"])(oe)},Object(r["toDisplayString"])(e.$t("buttons.SUBMIT")),9,K),Object(r["createElementVNode"])("button",{class:"cancel",onClick:Object(r["withModifiers"])(ve,["prevent"])},Object(r["toDisplayString"])(e.$t("buttons.CANCEL")),9,Z)]))],42,f)])]})),_:1})],2)}}}),J=(n("e18c"),n("6b0d")),Y=n.n(J);const Q=Y()(X,[["__scopeId","data-v-22f139f6"]]);t["a"]=Q},"5f44":function(e,t,n){"use strict";n("0716")},"5fb2":function(e,t,n){"use strict";var o=n("da84"),r=n("e330"),a=2147483647,c=36,l=1,i=26,u=38,s=700,d=72,b=128,p="-",f=/[^\0-\u007E]/,m=/[.\u3002\uFF0E\uFF61]/g,O="Overflow: input needs wider integers to process",j=c-l,h=o.RangeError,g=r(m.exec),v=Math.floor,y=String.fromCharCode,k=r("".charCodeAt),w=r([].join),E=r([].push),N=r("".replace),S=r("".split),V=r("".toLowerCase),T=function(e){var t=[],n=0,o=e.length;while(n<o){var r=k(e,n++);if(r>=55296&&r<=56319&&n<o){var a=k(e,n++);56320==(64512&a)?E(t,((1023&r)<<10)+(1023&a)+65536):(E(t,r),n--)}else E(t,r)}return t},D=function(e){return e+22+75*(e<26)},_=function(e,t,n){var o=0;e=n?v(e/s):e>>1,e+=v(e/t);while(e>j*i>>1)e=v(e/j),o+=c;return v(o+(j+1)*e/(e+u))},I=function(e){var t=[];e=T(e);var n,o,r=e.length,u=b,s=0,f=d;for(n=0;n<e.length;n++)o=e[n],o<128&&E(t,y(o));var m=t.length,j=m;m&&E(t,p);while(j<r){var g=a;for(n=0;n<e.length;n++)o=e[n],o>=u&&o<g&&(g=o);var k=j+1;if(g-u>v((a-s)/k))throw h(O);for(s+=(g-u)*k,u=g,n=0;n<e.length;n++){if(o=e[n],o<u&&++s>a)throw h(O);if(o==u){var N=s,S=c;while(1){var V=S<=f?l:S>=f+i?i:S-f;if(N<V)break;var I=N-V,C=c-V;E(t,y(D(V+I%C))),N=v(I/C),S+=c}E(t,y(D(N))),f=_(s,k,j==m),s=0,j++}}s++,u++}return w(t,"")};e.exports=function(e){var t,n,o=[],r=S(N(V(e),m,"."),".");for(t=0;t<r.length;t++)n=r[t],E(o,g(f,n)?"xn--"+I(n):n);return w(o,".")}},"60da":function(e,t,n){"use strict";var o=n("83ab"),r=n("e330"),a=n("c65b"),c=n("d039"),l=n("df75"),i=n("7418"),u=n("d1e7"),s=n("7b0b"),d=n("44ad"),b=Object.assign,p=Object.defineProperty,f=r([].concat);e.exports=!b||c((function(){if(o&&1!==b({b:1},b(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=b({},e)[n]||l(b({},t)).join("")!=r}))?function(e,t){var n=s(e),r=arguments.length,c=1,b=i.f,p=u.f;while(r>c){var m,O=d(arguments[c++]),j=b?f(l(O),b(O)):l(O),h=j.length,g=0;while(h>g)m=j[g++],o&&!a(p,O,m)||(n[m]=O[m])}return n}:b},"692d":function(e,t,n){"use strict";n.r(t);var o=n("7a23"),r=n("5c76"),a=n("dad5"),c=n("2906"),l={id:"add-workout",class:"view"},i={class:"container"},u=Object(o["defineComponent"])({setup:function(e){var t=Object(c["a"])(),n=Object(o["computed"])((function(){return t.getters[a["c"].GETTERS.SPORTS]})),u=Object(o["computed"])((function(){return t.getters[a["a"].GETTERS.AUTH_USER_PROFILE]})),s=Object(o["computed"])((function(){return t.getters[a["f"].GETTERS.WORKOUT_DATA]}));return function(e,t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",l,[Object(o["createElementVNode"])("div",i,[Object(o["createVNode"])(r["a"],{authUser:Object(o["unref"])(u),sports:Object(o["unref"])(n),isCreation:!0,loading:Object(o["unref"])(s).loading},null,8,["authUser","sports","loading"])])])}}});const s=u;t["default"]=s},"6aa3":function(e,t,n){"use strict";n("2349")},"6b92":function(e,t,n){},"6cc5":function(e,t,n){},7240:function(e,t,n){},"73b0":function(e,t,n){"use strict";n("a0a8")},7787:function(e,t,n){},"83e8":function(e,t,n){},"85d8":function(e,t,n){"use strict";n("19e4")},"8aa2":function(e,t,n){"use strict";n("17b6")},"8ee9":function(e,t,n){"use strict";n.r(t);var o=n("1da1"),r=(n("96cf"),n("7a23")),a=n("6c02"),c=n("5c76"),l=n("dad5"),i=n("2906"),u={id:"edit-workout",class:"view"},s={class:"container"},d=Object(r["defineComponent"])({setup:function(e){var t=Object(a["c"])(),n=Object(i["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]})),p=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",u,[Object(r["createElementVNode"])("div",s,[Object(r["createVNode"])(c["a"],{authUser:Object(r["unref"])(d),sports:Object(r["unref"])(b),workout:Object(r["unref"])(p).workout,loading:Object(r["unref"])(p).loading},null,8,["authUser","sports","workout","loading"])])])}}});const b=d;t["default"]=b},9861:function(e,t,n){"use strict";n("e260");var o=n("23e7"),r=n("da84"),a=n("d066"),c=n("c65b"),l=n("e330"),i=n("0d3b"),u=n("6eeb"),s=n("e2cc"),d=n("d44e"),b=n("9ed3"),p=n("69f3"),f=n("19aa"),m=n("1626"),O=n("1a2d"),j=n("0366"),h=n("f5df"),g=n("825a"),v=n("861d"),y=n("577e"),k=n("7c73"),w=n("5c6c"),E=n("9a1f"),N=n("35a1"),S=n("d6d6"),V=n("b622"),T=n("addb"),D=V("iterator"),_="URLSearchParams",I=_+"Iterator",C=p.set,x=p.getterFor(_),B=p.getterFor(I),R=a("fetch"),A=a("Request"),U=a("Headers"),L=A&&A.prototype,P=U&&U.prototype,$=r.RegExp,M=r.TypeError,F=r.decodeURIComponent,H=r.encodeURIComponent,z=l("".charAt),G=l([].join),W=l([].push),q=l("".replace),K=l([].shift),Z=l([].splice),X=l("".split),J=l("".slice),Y=/\+/g,Q=Array(4),ee=function(e){return Q[e-1]||(Q[e-1]=$("((?:%[\\da-f]{2}){"+e+"})","gi"))},te=function(e){try{return F(e)}catch(t){return e}},ne=function(e){var t=q(e,Y," "),n=4;try{return F(t)}catch(o){while(n)t=q(t,ee(n--),te);return t}},oe=/[!'()~]|%20/g,re={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ae=function(e){return re[e]},ce=function(e){return q(H(e),oe,ae)},le=b((function(e,t){C(this,{type:I,iterator:E(x(e).entries),kind:t})}),"Iterator",(function(){var e=B(this),t=e.kind,n=e.iterator.next(),o=n.value;return n.done||(n.value="keys"===t?o.key:"values"===t?o.value:[o.key,o.value]),n}),!0),ie=function(e){this.entries=[],this.url=null,void 0!==e&&(v(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===z(e,0)?J(e,1):e:y(e)))};ie.prototype={type:_,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,o,r,a,l,i,u=N(e);if(u){t=E(e,u),n=t.next;while(!(o=c(n,t)).done){if(r=E(g(o.value)),a=r.next,(l=c(a,r)).done||(i=c(a,r)).done||!c(a,r).done)throw M("Expected sequence with length 2");W(this.entries,{key:y(l.value),value:y(i.value)})}}else for(var s in e)O(e,s)&&W(this.entries,{key:s,value:y(e[s])})},parseQuery:function(e){if(e){var t,n,o=X(e,"&"),r=0;while(r<o.length)t=o[r++],t.length&&(n=X(t,"="),W(this.entries,{key:ne(K(n)),value:ne(G(n,"="))}))}},serialize:function(){var e,t=this.entries,n=[],o=0;while(o<t.length)e=t[o++],W(n,ce(e.key)+"="+ce(e.value));return G(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ue=function(){f(this,se);var e=arguments.length>0?arguments[0]:void 0;C(this,new ie(e))},se=ue.prototype;if(s(se,{append:function(e,t){S(arguments.length,2);var n=x(this);W(n.entries,{key:y(e),value:y(t)}),n.updateURL()},delete:function(e){S(arguments.length,1);var t=x(this),n=t.entries,o=y(e),r=0;while(r<n.length)n[r].key===o?Z(n,r,1):r++;t.updateURL()},get:function(e){S(arguments.length,1);for(var t=x(this).entries,n=y(e),o=0;o<t.length;o++)if(t[o].key===n)return t[o].value;return null},getAll:function(e){S(arguments.length,1);for(var t=x(this).entries,n=y(e),o=[],r=0;r<t.length;r++)t[r].key===n&&W(o,t[r].value);return o},has:function(e){S(arguments.length,1);var t=x(this).entries,n=y(e),o=0;while(o<t.length)if(t[o++].key===n)return!0;return!1},set:function(e,t){S(arguments.length,1);for(var n,o=x(this),r=o.entries,a=!1,c=y(e),l=y(t),i=0;i<r.length;i++)n=r[i],n.key===c&&(a?Z(r,i--,1):(a=!0,n.value=l));a||W(r,{key:c,value:l}),o.updateURL()},sort:function(){var e=x(this);T(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){var t,n=x(this).entries,o=j(e,arguments.length>1?arguments[1]:void 0),r=0;while(r<n.length)t=n[r++],o(t.value,t.key,this)},keys:function(){return new le(this,"keys")},values:function(){return new le(this,"values")},entries:function(){return new le(this,"entries")}},{enumerable:!0}),u(se,D,se.entries,{name:"entries"}),u(se,"toString",(function(){return x(this).serialize()}),{enumerable:!0}),d(ue,_),o({global:!0,forced:!i},{URLSearchParams:ue}),!i&&m(U)){var de=l(P.has),be=l(P.set),pe=function(e){if(v(e)){var t,n=e.body;if(h(n)===_)return t=e.headers?new U(e.headers):new U,de(t,"content-type")||be(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),k(e,{body:w(0,y(n)),headers:w(0,t)})}return e};if(m(R)&&o({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return R(e,arguments.length>1?pe(arguments[1]):{})}}),m(A)){var fe=function(e){return f(this,L),new A(e,arguments.length>1?pe(arguments[1]):{})};L.constructor=fe,fe.prototype=L,o({global:!0,forced:!0},{Request:fe})}}e.exports={URLSearchParams:ue,getState:x}},a0a8:function(e,t,n){},a4ee:function(e,t,n){},a9e3:function(e,t,n){"use strict";var o=n("83ab"),r=n("da84"),a=n("e330"),c=n("94ca"),l=n("6eeb"),i=n("1a2d"),u=n("7156"),s=n("3a9b"),d=n("d9b5"),b=n("c04e"),p=n("d039"),f=n("241c").f,m=n("06cf").f,O=n("9bf2").f,j=n("408a"),h=n("58a8").trim,g="Number",v=r[g],y=v.prototype,k=r.TypeError,w=a("".slice),E=a("".charCodeAt),N=function(e){var t=b(e,"number");return"bigint"==typeof t?t:S(t)},S=function(e){var t,n,o,r,a,c,l,i,u=b(e,"number");if(d(u))throw k("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=h(u),t=E(u,0),43===t||45===t){if(n=E(u,2),88===n||120===n)return NaN}else if(48===t){switch(E(u,1)){case 66:case 98:o=2,r=49;break;case 79:case 111:o=8,r=55;break;default:return+u}for(a=w(u,2),c=a.length,l=0;l<c;l++)if(i=E(a,l),i<48||i>r)return NaN;return parseInt(a,o)}return+u};if(c(g,!v(" 0o1")||!v("0b1")||v("+0x1"))){for(var V,T=function(e){var t=arguments.length<1?0:v(N(e)),n=this;return s(y,n)&&p((function(){j(n)}))?u(Object(t),n,T):t},D=o?f(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),_=0;D.length>_;_++)i(v,V=D[_])&&!i(T,V)&&O(T,V,m(v,V));T.prototype=y,y.constructor=T,l(r,g,T)}},b1c7:function(e,t,n){"use strict";n("57cc")},b86c:function(e,t,n){"use strict";n("7240")},c12b:function(e,t,n){"use strict";n("7787")},c200:function(e,t,n){},c4b5:function(e,t,n){"use strict";n("3450")},d6d6:function(e,t,n){var o=n("da84"),r=o.TypeError;e.exports=function(e,t){if(e<t)throw r("Not enough arguments");return e}},dbf6:function(e,t,n){"use strict";n("a4ee")},e18c:function(e,t,n){"use strict";n("3bd0")},e2cc:function(e,t,n){var o=n("6eeb");e.exports=function(e,t,n){for(var r in t)o(e,r,t[r],n);return e}},e2f4:function(e,t,n){"use strict";n("c200")},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")),a=parseFloat(t(n(r,"opacity"))),c=parseFloat(t(n(r,"width")));e&&(o.stroke=e),isNaN(a)||(o["stroke-opacity"]=a),isNaN(c)||(o["stroke-width"]=96*c/25.4)}}return o}function r(e,o){const r={};let a,c;for(c=0;c<o.length;c++)a=n(e,o[c]),a&&(r[o[c]]=t(a));return r}function a(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 a=o[r];a.parentNode.parentNode===e&&(n[a.tagName.replace(":","_")]=t(a))}const a=e.getElementsByTagName("link");a.length&&(n.links=[]);for(let t=0;t<a.length;t++)n.links.push(Object.assign({href:a[t].getAttribute("href")},r(a[t],["text","type"])));return n}function c(e){const o=[parseFloat(e.getAttribute("lon")),parseFloat(e.getAttribute("lat"))],r=n(e,"ele"),a=n(e,"gpxtpx:hr")||n(e,"hr"),c=n(e,"time");let l;r&&(l=parseFloat(t(r)),isNaN(l)||o.push(l));const i={coordinates:o,time:c?t(c):null,extendedValues:[]};a&&i.extendedValues.push(["heart",parseFloat(t(a))]);const u=n(e,"extensions");if(null!==u)for(const s of["speed","course","hAcc","vAcc"]){const e=parseFloat(t(n(u,s)));isNaN(e)||i.extendedValues.push([s,e])}return i}function l(e){const t=i(e,"rtept");if(t)return{type:"Feature",properties:Object.assign(a(e),o(n(e,"extensions")),{_gpxType:"rte"}),geometry:{type:"LineString",coordinates:t.line}}}function i(e,t){const n=e.getElementsByTagName(t);if(n.length<2)return;const o=[],r=[],a={};for(let l=0;l<n.length;l++){const e=c(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],c="heart"===o?o:o+"s";a[c]||(a[c]=Array(n.length).fill(null)),a[c][l]=r}}return{line:o,times:r,extendedValues:a}}function u(e){const t=e.getElementsByTagName("trkseg"),r=[],c=[],l=[];for(let n=0;n<t.length;n++){const e=i(t[n],"trkpt");e&&(l.push(e),e.times&&e.times.length&&c.push(e.times))}if(0===l.length)return;const u=l.length>1,s=Object.assign(a(e),o(n(e,"extensions")),{_gpxType:"trk"},c.length?{coordinateProperties:{times:u?c:c[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),u?(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:u?{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=u(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(i=o[l],{type:"Feature",properties:Object.assign(a(i),r(i,["sym"])),geometry:{type:"Point",coordinates:c(i).coordinates}});var i}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 p(e,o){const r=[];for(const[a,c]of o){let o=n(e,a);if(!o){const t=e.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/ActivityExtension/v2",a);t.length&&(o=t[0])}const l=parseFloat(t(o));isNaN(l)||r.push([c,l])}return r}function f(e){const o=t(n(e,"LongitudeDegrees")),r=t(n(e,"LatitudeDegrees"));if(!o.length||!r.length)return null;const a=[parseFloat(o),parseFloat(r)],c=n(e,"AltitudeMeters"),l=n(e,"HeartRateBpm"),i=n(e,"Time");let u;return c&&(u=parseFloat(t(c)),isNaN(u)||a.push(u)),{coordinates:a,time:i?t(i):null,heartRate:l?parseFloat(t(l)):null,extensions:p(e,d)}}function m(e,t){const n=e.getElementsByTagName(t),o=[],r=[],a=[];if(n.length<2)return null;const c={extendedProperties:{}};for(let l=0;l<n.length;l++){const e=f(n[l]);if(null!==e){o.push(e.coordinates),e.time&&r.push(e.time),e.heartRate&&a.push(e.heartRate);for(const[t,o]of e.extensions)c.extendedProperties[t]||(c.extendedProperties[t]=Array(n.length).fill(null)),c.extendedProperties[t][l]=o}}return Object.assign(c,{line:o,times:r,heartRates:a})}function O(e){const o=e.getElementsByTagName("Track"),r=[],a=[],c=[],l=[];let i;const u=function(e){const t={};for(const[n,o]of e)t[n]=o;return t}(p(e,b)),s=n(e,"Name");s&&(u.name=t(s));for(let t=0;t<o.length;t++)i=m(o[t],"Trackpoint"),i&&(r.push(i.line),i.times.length&&a.push(i.times),i.heartRates.length&&c.push(i.heartRates),l.push(i.extendedProperties));for(let t=0;t<l.length;t++){const e=l[t];for(const n in e)1===o.length?u[n]=i.extendedProperties[n]:(u[n]||(u[n]=r.map(e=>Array(e.length).fill(null))),u[n][t]=e[n])}if(0!==r.length)return(a.length||c.length)&&(u.coordinateProperties=Object.assign(a.length?{times:1===r.length?a[0]:a}:{},c.length?{heart:1===r.length?c[0]:c}:{})),{type:"Feature",properties:u,geometry:{type:1===r.length?"LineString":"MultiLineString",coordinates:1===r.length?r[0]:r}}}function*j(e){const t=e.getElementsByTagName("Lap");for(let o=0;o<t.length;o++){const e=O(t[o]);e&&(yield e)}const n=e.getElementsByTagName("Courses");for(let o=0;o<n.length;o++){const e=O(n[o]);e&&(yield e)}}const h=/\s*/g,g=/^\s*|\s*$/g,v=/\s+/;function y(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 k(e){return e.replace(h,"").split(",").map(parseFloat)}function w(e){return e.replace(g,"").split(v).map(k)}function E(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+=E(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 a=t(n(o,"color"))||"";const c="stroke"==r||"fill"===r?r:r+"-color";"#"===a.substr(0,1)&&(a=a.substr(1)),6===a.length||3===a.length?e[c]=a:8===a.length&&(e[r+"-opacity"]=parseInt(a.substr(0,2),16)/255,e[c]="#"+a.substr(6,2)+a.substr(4,2)+a.substr(2,2))}function V(e,o,r,a){const c=parseFloat(t(n(o,r)));isNaN(c)||(e[a]=c)}function T(e){let n=e.getElementsByTagName("coord");const o=[],r=[];0===n.length&&(n=e.getElementsByTagName("gx:coord"));for(let c=0;c<n.length;c++)o.push(t(n[c]).split(" ").map(parseFloat));const a=e.getElementsByTagName("when");for(let c=0;c<a.length;c++)r.push(t(a[c]));return{coords:o,times:r}}function D(e){let o,r,a,c,l;const i=[],u=[];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(a=0;a<N.length;a++)if(r=e.getElementsByTagName(N[a]),r)for(c=0;c<r.length;c++)if(o=r[c],"Point"===N[a])i.push({type:"Point",coordinates:k(t(n(o,"coordinates")))});else if("LineString"===N[a])i.push({type:"LineString",coordinates:w(t(n(o,"coordinates")))});else if("Polygon"===N[a]){const e=o.getElementsByTagName("LinearRing"),r=[];for(l=0;l<e.length;l++)r.push(w(t(n(e[l],"coordinates"))));i.push({type:"Polygon",coordinates:r})}else if("Track"===N[a]||"gx:Track"===N[a]){const e=T(o);i.push({type:"LineString",coordinates:e.coords}),e.times.length&&u.push(e.times)}return{geoms:i,coordTimes:u}}function _(e,o,r,a){const c=D(e);let l;const i={},u=t(n(e,"name")),s=t(n(e,"address"));let d=t(n(e,"styleUrl"));const b=t(n(e,"description")),p=n(e,"TimeSpan"),f=n(e,"TimeStamp"),m=n(e,"ExtendedData");let O=n(e,"IconStyle"),j=n(e,"LabelStyle"),h=n(e,"LineStyle"),g=n(e,"PolyStyle");const v=n(e,"visibility");if(u&&(i.name=u),s&&(i.address=s),d){"#"!==d[0]&&(d="#"+d),i.styleUrl=d,o[d]&&(i.styleHash=o[d]),r[d]&&(i.styleMapHash=r[d],i.styleHash=o[r[d].normal]);const e=a[i.styleHash];e&&(O||(O=n(e,"IconStyle")),j||(j=n(e,"LabelStyle")),h||(h=n(e,"LineStyle")),g||(g=n(e,"PolyStyle")))}if(b&&(i.description=b),p){const e=t(n(p,"begin")),o=t(n(p,"end"));i.timespan={begin:e,end:o}}if(f&&(i.timestamp=t(n(f,"when"))),O){S(i,O,"icon"),V(i,O,"scale","icon-scale"),V(i,O,"heading","icon-heading");const e=n(O,"hotSpot");if(e){const t=parseFloat(e.getAttribute("x")),n=parseFloat(e.getAttribute("y"));isNaN(t)||isNaN(n)||(i["icon-offset"]=[t,n])}const o=n(O,"Icon");if(o){const e=t(n(o,"href"));e&&(i.icon=e)}}if(j&&(S(i,j,"label"),V(i,j,"scale","label-scale")),h&&(S(i,h,"stroke"),V(i,h,"width","stroke-width")),g){S(i,g,"fill");const e=t(n(g,"fill")),o=t(n(g,"outline"));e&&(i["fill-opacity"]="1"===e?i["fill-opacity"]||1:0),o&&(i["stroke-opacity"]="1"===o?i["stroke-opacity"]||1:0)}if(m){const e=m.getElementsByTagName("Data"),o=m.getElementsByTagName("SimpleData");for(l=0;l<e.length;l++)i[e[l].getAttribute("name")]=t(n(e[l],"value"));for(l=0;l<o.length;l++)i[o[l].getAttribute("name")]=t(o[l])}v&&(i.visibility=t(v)),c.coordTimes.length&&(i.coordinateProperties={times:1===c.coordTimes.length?c.coordTimes[0]:c.coordTimes});const y={type:"Feature",geometry:0===c.geoms.length?null:1===c.geoms.length?c.geoms[0]:{type:"GeometryCollection",geometries:c.geoms},properties:i};return e.getAttribute("id")&&(y.id=e.getAttribute("id")),y}function*I(e){const o={},r={},a={},c=e.getElementsByTagName("Placemark"),l=e.getElementsByTagName("Style"),i=e.getElementsByTagName("StyleMap");for(let t=0;t<l.length;t++){const e=y(E(l[t])).toString(16);o["#"+l[t].getAttribute("id")]=e,r[e]=l[t]}for(let u=0;u<i.length;u++){o["#"+i[u].getAttribute("id")]=y(E(i[u])).toString(16);const e=i[u].getElementsByTagName("Pair"),r={};for(let o=0;o<e.length;o++)r[t(n(e[o],"key"))]=t(n(e[o],"styleUrl"));a["#"+i[u].getAttribute("id")]=r}for(let t=0;t<c.length;t++){const e=_(c[t],o,a,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(I(e))}},e.kmlGen=I,e.tcx=function(e){return{type:"FeatureCollection",features:Array.from(j(e))}},e.tcxGen=j,Object.defineProperty(e,"__esModule",{value:!0})}))},ffd1:function(e,t,n){"use strict";n("6b92")}}]);
//# sourceMappingURL=workouts.becfe714.js.map