2 lines
60 KiB
JavaScript
2 lines
60 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["main"],{"00b4":function(e,t,c){"use strict";c("ac1f");var n=c("23e7"),r=c("da84"),a=c("c65b"),o=c("e330"),u=c("1626"),l=c("861d"),s=function(){var e=!1,t=/[ac]/;return t.exec=function(){return e=!0,/./.exec.apply(this,arguments)},!0===t.test("abc")&&e}(),i=r.Error,d=o(/./.test);n({target:"RegExp",proto:!0,forced:!s},{test:function(e){var t=this.exec;if(!u(t))return d(this,e);var c=a(t,this,e);if(null!==c&&!l(c))throw new i("RegExp exec method returned something other than an Object or null");return!!c}})},"0395":function(e,t,c){"use strict";var n=c("1da1"),r=(c("caad"),c("96cf"),c("7a23")),a=c("6c02"),o=c("dad5"),u=c("2906"),l={id:"user-auth-form"},s={id:"user-form"},i={class:"form-items"},d=["disabled","placeholder"],b=["disabled","placeholder"],O=["disabled","placeholder"],j=["disabled","placeholder"],f=["disabled"],p={key:1},m=Object(r["createTextVNode"])(" - "),k={key:2},v={class:"account"},y=Object(r["defineComponent"])({props:{action:null,token:{default:""}},setup:function(e){var t=e,c=Object(a["c"])(),y=Object(u["a"])(),h=Object(r["toRefs"])(t),E=h.action,w=Object(r["reactive"])({username:"",email:"",password:"",password_conf:""}),N=Object(r["computed"])((function(){return _(t.action)})),S=Object(r["computed"])((function(){return y.getters[o["b"].GETTERS.ERROR_MESSAGES]})),g=Object(r["computed"])((function(){return y.getters[o["b"].GETTERS.APP_CONFIG]})),B=Object(r["computed"])((function(){return"register"===t.action&&!g.value.is_registration_enabled})),V=Object(r["ref"])(!1);function _(e){switch(e){case"reset-request":case"reset":return"buttons.SUBMIT";default:return"buttons.".concat(t.action.toUpperCase())}}function C(){V.value=!0}function D(e){switch(e){case"reset":return t.token?y.dispatch(o["a"].ACTIONS.RESET_USER_PASSWORD,{password:w.password,password_conf:w.password_conf,token:t.token}):y.commit(o["b"].MUTATIONS.SET_ERROR_MESSAGES,"user.INVALID_TOKEN");case"reset-request":return y.dispatch(o["a"].ACTIONS.SEND_PASSWORD_RESET_REQUEST,{email:w.email});default:y.dispatch(o["a"].ACTIONS.LOGIN_OR_REGISTER,{actionType:e,formData:w,redirectUrl:c.query.from})}}function T(){w.username="",w.email="",w.password="",w.password_conf=""}return Object(r["watch"])((function(){return c.path}),Object(n["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:y.commit(o["b"].MUTATIONS.EMPTY_ERROR_MESSAGES),V.value=!1,T();case 3:case"end":return e.stop()}}),e)})))),function(e,t){var c=Object(r["resolveComponent"])("AlertMessage"),n=Object(r["resolveComponent"])("router-link"),a=Object(r["resolveComponent"])("ErrorMessage");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",l,[Object(r["createElementVNode"])("div",s,[Object(r["createElementVNode"])("div",{class:Object(r["normalizeClass"])(["form-box",{disabled:Object(r["unref"])(B)}])},[Object(r["unref"])(B)?(Object(r["openBlock"])(),Object(r["createBlock"])(c,{key:0,message:"user.REGISTER_DISABLED"})):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("form",{class:Object(r["normalizeClass"])({errors:V.value}),onSubmit:t[4]||(t[4]=Object(r["withModifiers"])((function(e){return D(Object(r["unref"])(E))}),["prevent"]))},[Object(r["createElementVNode"])("div",i,["register"===Object(r["unref"])(E)?Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("input",{key:0,id:"username",disabled:Object(r["unref"])(B),required:"",onInvalid:C,"onUpdate:modelValue":t[0]||(t[0]=function(e){return Object(r["unref"])(w).username=e}),placeholder:e.$t("user.USERNAME")},null,40,d)),[[r["vModelText"],Object(r["unref"])(w).username]]):Object(r["createCommentVNode"])("",!0),"reset"!==Object(r["unref"])(E)?Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("input",{key:1,id:"email",disabled:Object(r["unref"])(B),required:"",onInvalid:C,type:"email","onUpdate:modelValue":t[1]||(t[1]=function(e){return Object(r["unref"])(w).email=e}),placeholder:"reset-request"===Object(r["unref"])(E)?e.$t("user.ENTER_EMAIL"):e.$t("user.EMAIL")},null,40,b)),[[r["vModelText"],Object(r["unref"])(w).email]]):Object(r["createCommentVNode"])("",!0),"reset-request"!==Object(r["unref"])(E)?Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("input",{key:2,id:"password",disabled:Object(r["unref"])(B),required:"",onInvalid:C,type:"password","onUpdate:modelValue":t[2]||(t[2]=function(e){return Object(r["unref"])(w).password=e}),placeholder:"reset"===Object(r["unref"])(E)?e.$t("user.ENTER_PASSWORD"):e.$t("user.PASSWORD")},null,40,O)),[[r["vModelText"],Object(r["unref"])(w).password]]):Object(r["createCommentVNode"])("",!0),["register","reset"].includes(Object(r["unref"])(E))?Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("input",{key:3,id:"confirm-password",disabled:Object(r["unref"])(B),type:"password",required:"",onInvalid:C,"onUpdate:modelValue":t[3]||(t[3]=function(e){return Object(r["unref"])(w).password_conf=e}),placeholder:"reset"===Object(r["unref"])(E)?e.$t("user.ENTER_PASSWORD_CONFIRMATION"):e.$t("user.PASSWORD_CONFIRM")},null,40,j)),[[r["vModelText"],Object(r["unref"])(w).password_conf]]):Object(r["createCommentVNode"])("",!0)]),Object(r["createElementVNode"])("button",{type:"submit",disabled:Object(r["unref"])(B)},Object(r["toDisplayString"])(e.$t(Object(r["unref"])(N))),9,f)],34),"login"===Object(r["unref"])(E)?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",p,[Object(r["createVNode"])(n,{class:"links",to:"/register"},{default:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("user.REGISTER")),1)]})),_:1}),m,Object(r["createVNode"])(n,{class:"links",to:"/password-reset/request"},{default:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("user.PASSWORD_FORGOTTEN")),1)]})),_:1})])):Object(r["createCommentVNode"])("",!0),"register"===Object(r["unref"])(E)?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",k,[Object(r["createElementVNode"])("span",v,Object(r["toDisplayString"])(e.$t("user.ALREADY_HAVE_ACCOUNT")),1),Object(r["createVNode"])(n,{class:"links",to:"/login"},{default:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.$t("user.LOGIN")),1)]})),_:1})])):Object(r["createCommentVNode"])("",!0),Object(r["unref"])(S)?(Object(r["openBlock"])(),Object(r["createBlock"])(a,{key:3,message:Object(r["unref"])(S)},null,8,["message"])):Object(r["createCommentVNode"])("",!0)],2)])])}}}),h=(c("85bb"),c("6b0d")),E=c.n(h);const w=E()(y,[["__scopeId","data-v-742267ca"]]);t["a"]=w},"07fe":function(e,t,c){},"091a":function(e,t,c){"use strict";c("7116")},"0ccb":function(e,t,c){var n=c("e330"),r=c("50c4"),a=c("577e"),o=c("1148"),u=c("1d80"),l=n(o),s=n("".slice),i=Math.ceil,d=function(e){return function(t,c,n){var o,d,b=a(u(t)),O=r(c),j=b.length,f=void 0===n?" ":a(n);return O<=j||""==f?b:(o=O-j,d=l(f,i(o/f.length)),d.length>o&&(d=s(d,0,o)),e?b+d:d+b)}};e.exports={start:d(!1),end:d(!0)}},1574:function(e,t,c){"use strict";c("e79b")},1970:function(e,t,c){"use strict";c("fdcd")},"1a1f":function(e,t,c){"use strict";c("efea")},"1bbf":function(e,t,c){},"1e7c":function(e,t,c){},"20fc":function(e,t,c){"use strict";c("1bbf")},"33b7":function(e,t,c){},"351a":function(e,t,c){"use strict";c("79b0")},"4d90":function(e,t,c){"use strict";var n=c("23e7"),r=c("0ccb").start,a=c("9a0c");n({target:"String",proto:!0,forced:a},{padStart:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},"4fad":function(e,t,c){var n=c("23e7"),r=c("6f53").entries;n({target:"Object",stat:!0},{entries:function(e){return r(e)}})},"5c56":function(e,t,c){"use strict";c("7639")},"605d1":function(e,t,c){},"6f53":function(e,t,c){var n=c("83ab"),r=c("e330"),a=c("df75"),o=c("fc6a"),u=c("d1e7").f,l=r(u),s=r([].push),i=function(e){return function(t){var c,r=o(t),u=a(r),i=u.length,d=0,b=[];while(i>d)c=u[d++],n&&!l(r,c)||s(b,e?[c,r[c]]:r[c]);return b}};e.exports={entries:i(!0),values:i(!1)}},7116:function(e,t,c){},7277:function(e,t,c){"use strict";c.r(t);var n=c("7a23");function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var c=0,n=new Array(t);c<t;c++)n[c]=e[c];return n}function a(e){if(Array.isArray(e))return r(e)}c("a4d3"),c("e01a"),c("d3b7"),c("d28b"),c("3ca3"),c("ddb0"),c("a630");function o(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}c("fb6a"),c("b0c0"),c("ac1f"),c("00b4");function u(e,t){if(e){if("string"===typeof e)return r(e,t);var c=Object.prototype.toString.call(e).slice(8,-1);return"Object"===c&&e.constructor&&(c=e.constructor.name),"Map"===c||"Set"===c?Array.from(e):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?r(e,t):void 0}}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(e){return a(e)||o(e)||u(e)||l()}var i=c("5530"),d=(c("4de4"),c("b166")),b=c("fd3a"),O=c("8c86");function j(e,t){Object(O["a"])(2,arguments);var c=Object(b["a"])(e),n=Object(b["a"])(t),r=c.getTime()-n.getTime();return r<0?-1:r>0?1:r}function f(e,t){Object(O["a"])(2,arguments);var c=Object(b["a"])(e),n=Object(b["a"])(t),r=c.getFullYear()-n.getFullYear(),a=c.getMonth()-n.getMonth();return 12*r+a}function p(e){Object(O["a"])(1,arguments);var t=Object(b["a"])(e);return t.setHours(23,59,59,999),t}var m=c("8cac");function k(e){Object(O["a"])(1,arguments);var t=Object(b["a"])(e);return p(t).getTime()===Object(m["a"])(t).getTime()}function v(e,t){Object(O["a"])(2,arguments);var c,n=Object(b["a"])(e),r=Object(b["a"])(t),a=j(n,r),o=Math.abs(f(n,r));if(o<1)c=0;else{1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-a*o);var u=j(n,r)===-a;k(Object(b["a"])(e))&&1===o&&1===j(e,r)&&(u=!1),c=a*(o-Number(u))}return 0===c?0:c}function y(e,t){return Object(O["a"])(2,arguments),Object(b["a"])(e).getTime()-Object(b["a"])(t).getTime()}var h={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},E="trunc";function w(e){return e?h[e]:h[E]}function N(e,t,c){Object(O["a"])(2,arguments);var n=y(e,t)/1e3;return w(null===c||void 0===c?void 0:c.roundingMethod)(n)}var S=c("8923");function g(e,t){if(null==e)throw new TypeError("assign requires that input parameter not be null or undefined");for(var c in t=t||{},t)Object.prototype.hasOwnProperty.call(t,c)&&(e[c]=t[c]);return e}function B(e){return g({},e)}var V=c("2420"),_=1440,C=2520,D=43200,T=86400;function R(e,t){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(O["a"])(2,arguments);var n=c.locale||S["a"];if(!n.formatDistance)throw new RangeError("locale must contain formatDistance property");var r=j(e,t);if(isNaN(r))throw new RangeError("Invalid time value");var a,o,u=B(c);u.addSuffix=Boolean(c.addSuffix),u.comparison=r,r>0?(a=Object(b["a"])(t),o=Object(b["a"])(e)):(a=Object(b["a"])(e),o=Object(b["a"])(t));var l,s=N(o,a),i=(Object(V["a"])(o)-Object(V["a"])(a))/1e3,d=Math.round((s-i)/60);if(d<2)return c.includeSeconds?s<5?n.formatDistance("lessThanXSeconds",5,u):s<10?n.formatDistance("lessThanXSeconds",10,u):s<20?n.formatDistance("lessThanXSeconds",20,u):s<40?n.formatDistance("halfAMinute",null,u):s<60?n.formatDistance("lessThanXMinutes",1,u):n.formatDistance("xMinutes",1,u):0===d?n.formatDistance("lessThanXMinutes",1,u):n.formatDistance("xMinutes",d,u);if(d<45)return n.formatDistance("xMinutes",d,u);if(d<90)return n.formatDistance("aboutXHours",1,u);if(d<_){var f=Math.round(d/60);return n.formatDistance("aboutXHours",f,u)}if(d<C)return n.formatDistance("xDays",1,u);if(d<D){var p=Math.round(d/_);return n.formatDistance("xDays",p,u)}if(d<T)return l=Math.round(d/D),n.formatDistance("aboutXMonths",l,u);if(l=v(o,a),l<12){var m=Math.round(d/D);return n.formatDistance("xMonths",m,u)}var k=l%12,y=Math.floor(l/12);return k<3?n.formatDistance("aboutXYears",y,u):k<9?n.formatDistance("overXYears",y,u):n.formatDistance("almostXYears",y+1,u)}var M=c("68c6"),I=c("c46a"),x=c("dad5"),A=c("2906"),L=c("5e65"),U=function(e){return Object(n["pushScopeId"])("data-v-1f38262e"),e=e(),Object(n["popScopeId"])(),e},$={class:"timeline-workout"},F={class:"box"},P={class:"workout-user-date"},G={class:"workout-user"},z=["title"],W={key:0},q={key:1,class:"no-map"},Y={class:"img"},H={class:"data"},K=U((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1)})),X={key:0},J={class:"data"},Q=U((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-road","aria-hidden":"true"},null,-1)})),Z={key:0},ee={key:0,class:"data elevation"},te=["alt"],ce={class:"data-values"},ne={key:1,class:"data altitude"},re=U((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1)})),ae={class:"data-values"},oe=Object(n["defineComponent"])({props:{user:null,workout:{default:function(){return{}}},sport:{default:function(){return{}}}},setup:function(e){var t=e,c=Object(A["a"])(),r=Object(n["toRefs"])(t),a=r.user,o=r.workout,u=r.sport,l=Object(n["computed"])((function(){return c.getters[x["b"].GETTERS.LOCALE]}));return function(e,t){var c=Object(n["resolveComponent"])("router-link"),r=Object(n["resolveComponent"])("SportImage");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",$,[Object(n["createElementVNode"])("div",F,[Object(n["createElementVNode"])("div",P,[Object(n["createElementVNode"])("div",G,[Object(n["createVNode"])(I["a"],{user:Object(n["unref"])(a)},null,8,["user"]),Object(n["unref"])(a).username?(Object(n["openBlock"])(),Object(n["createBlock"])(c,{key:0,class:"workout-user-name",to:{name:"User",params:{username:Object(n["unref"])(a).username}}},{default:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(Object(n["unref"])(a).username),1)]})),_:1},8,["to"])):Object(n["createCommentVNode"])("",!0)]),Object(n["unref"])(o).id?(Object(n["openBlock"])(),Object(n["createBlock"])(c,{key:0,class:"workout-title",to:{name:"Workout",params:{workoutId:Object(n["unref"])(o).id}}},{default:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(Object(n["unref"])(o).title),1)]})),_:1},8,["to"])):Object(n["createCommentVNode"])("",!0),Object(n["unref"])(o).workout_date&&Object(n["unref"])(a)?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",{key:1,class:"workout-date",title:Object(n["unref"])(d["a"])(Object(n["unref"])(L["c"])(Object(n["unref"])(o).workout_date,Object(n["unref"])(a).timezone),"dd/MM/yyyy HH:mm")},Object(n["toDisplayString"])(Object(n["unref"])(R)(new Date(Object(n["unref"])(o).workout_date),new Date,{addSuffix:!0,locale:Object(n["unref"])(l)})),9,z)):Object(n["createCommentVNode"])("",!0)]),Object(n["createElementVNode"])("div",{class:Object(n["normalizeClass"])(["workout-map",{"no-cursor":!Object(n["unref"])(o)}]),onClick:t[0]||(t[0]=function(t){return Object(n["unref"])(o).id?e.$router.push({name:"Workout",params:{workoutId:Object(n["unref"])(o).id}}):null})},[Object(n["unref"])(o)?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",W,[Object(n["unref"])(o).with_gpx?(Object(n["openBlock"])(),Object(n["createBlock"])(M["a"],{key:0,workout:Object(n["unref"])(o)},null,8,["workout"])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",q,Object(n["toDisplayString"])(e.$t("workouts.NO_MAP")),1))])):Object(n["createCommentVNode"])("",!0)],2),Object(n["createElementVNode"])("div",{class:Object(n["normalizeClass"])(["workout-data",{"without-gpx":Object(n["unref"])(o)&&!Object(n["unref"])(o).with_gpx}]),onClick:t[1]||(t[1]=function(t){return Object(n["unref"])(o).id?e.$router.push({name:"Workout",params:{workoutId:Object(n["unref"])(o).id}}):null})},[Object(n["createElementVNode"])("div",Y,[Object(n["unref"])(u).label?(Object(n["openBlock"])(),Object(n["createBlock"])(r,{key:0,"sport-label":Object(n["unref"])(u).label},null,8,["sport-label"])):Object(n["createCommentVNode"])("",!0)]),Object(n["createElementVNode"])("div",H,[K,Object(n["unref"])(o)?(Object(n["openBlock"])(),Object(n["createElementBlock"])("span",X,Object(n["toDisplayString"])(Object(n["unref"])(o).moving),1)):Object(n["createCommentVNode"])("",!0)]),Object(n["createElementVNode"])("div",J,[Q,Object(n["unref"])(o)?(Object(n["openBlock"])(),Object(n["createElementBlock"])("span",Z,Object(n["toDisplayString"])(Object(n["unref"])(o).distance)+" km",1)):Object(n["createCommentVNode"])("",!0)]),Object(n["unref"])(o)&&Object(n["unref"])(o).with_gpx?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ee,[Object(n["createElementVNode"])("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:e.$t("workouts.ELEVATION")},null,8,te),Object(n["createElementVNode"])("div",ce,[Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(Object(n["unref"])(o).min_alt)+"/",1),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(Object(n["unref"])(o).max_alt)+" m ",1)])])):Object(n["createCommentVNode"])("",!0),Object(n["unref"])(o)&&Object(n["unref"])(o).with_gpx?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ne,[re,Object(n["createElementVNode"])("div",ae,[Object(n["createElementVNode"])("span",null,"+ "+Object(n["toDisplayString"])(Object(n["unref"])(o).ascent)+"/",1),Object(n["createElementVNode"])("span",null,"- "+Object(n["toDisplayString"])(Object(n["unref"])(o).descent)+" m ",1)])])):Object(n["createCommentVNode"])("",!0)],2)])])}}}),ue=(c("9796"),c("6b0d")),le=c.n(ue);const se=le()(oe,[["__scopeId","data-v-1f38262e"]]);var ie=se,de=c("1724"),be=c("9230"),Oe={id:"timeline"},je={class:"section-title"},fe={key:0},pe={key:1},me={key:1,class:"more-workouts"},ke=Object(n["defineComponent"])({props:{sports:null,user:null},setup:function(e){var t=e,c=Object(A["a"])(),r=Object(n["toRefs"])(t),a=r.sports,o=r.user,u=Object(n["ref"])(1),l=5,d=t.user.nb_workouts>=l?l:t.user.nb_workouts;Object(n["onBeforeMount"])((function(){return j()}));var b=Object(n["computed"])((function(){return c.getters[x["f"].GETTERS.TIMELINE_WORKOUTS]})),O=Object(n["computed"])((function(){return b.value.length>0&&null!==b.value[b.value.length-1].previous_workout}));function j(){c.dispatch(x["f"].ACTIONS.GET_TIMELINE_WORKOUTS,Object(i["a"])({page:u.value,per_page:l},be["a"]))}function f(){u.value+=1,c.dispatch(x["f"].ACTIONS.GET_MORE_TIMELINE_WORKOUTS,Object(i["a"])({page:u.value,per_page:l},be["a"]))}return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Oe,[Object(n["createElementVNode"])("div",je,Object(n["toDisplayString"])(e.$t("workouts.LATEST_WORKOUTS")),1),Object(n["unref"])(o).nb_workouts>0&&0===Object(n["unref"])(b).length?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",fe,[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(s(Array(Object(n["unref"])(d)).keys()),(function(e){return Object(n["openBlock"])(),Object(n["createBlock"])(ie,{user:Object(n["unref"])(o),key:e},null,8,["user"])})),128))])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",pe,[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(Object(n["unref"])(b),(function(e){return Object(n["openBlock"])(),Object(n["createBlock"])(ie,{workout:e,sport:Object(n["unref"])(b).length>0?Object(n["unref"])(a).filter((function(t){return t.id===e.sport_id}))[0]:null,user:Object(n["unref"])(o),key:e.id},null,8,["workout","sport","user"])})),128)),0===Object(n["unref"])(b).length?(Object(n["openBlock"])(),Object(n["createBlock"])(de["a"],{key:0})):Object(n["createCommentVNode"])("",!0),Object(n["unref"])(O)?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",me,[Object(n["createElementVNode"])("button",{onClick:f},Object(n["toDisplayString"])(e.$t("workouts.LOAD_MORE_WORKOUT")),1)])):Object(n["createCommentVNode"])("",!0)]))])}}});c("5c56");const ve=le()(ke,[["__scopeId","data-v-0480e38a"]]);var ye=ve,he=c("74b5"),Ee=c("a618"),we=(c("caad"),c("f7f1"));function Ne(e){Object(O["a"])(1,arguments);var t=Object(b["a"])(e);return t.setHours(0,0,0,0),t}function Se(e,t){Object(O["a"])(2,arguments);var c=Ne(e),n=Ne(t);return c.getTime()===n.getTime()}function ge(e,t){Object(O["a"])(2,arguments);var c=Object(b["a"])(e),n=Object(b["a"])(t);return c.getFullYear()===n.getFullYear()&&c.getMonth()===n.getMonth()}function Be(e){return Object(O["a"])(1,arguments),Se(e,Date.now())}c("d81d");var Ve=["title"],_e=Object(n["defineComponent"])({props:{workout:null,sportLabel:null},setup:function(e){var t=e,c=Object(n["toRefs"])(t),r=c.workout,a=c.sportLabel;return function(e,t){var c=Object(n["resolveComponent"])("SportImage");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",{class:"calendar-workout",onClick:t[0]||(t[0]=function(t){return e.$router.push({name:"Workout",params:{workoutId:Object(n["unref"])(r).id}})})},[Object(n["createVNode"])(c,{"sport-label":Object(n["unref"])(a),title:Object(n["unref"])(r).title},null,8,["sport-label","title"]),Object(n["createElementVNode"])("sup",null,[Object(n["unref"])(r).records.length>0?(Object(n["openBlock"])(),Object(n["createElementBlock"])("i",{key:0,class:"fa fa-trophy custom-fa-small","aria-hidden":"true",title:Object(n["unref"])(r).records.map((function(t){return" ".concat(e.$t("workouts.RECORD_".concat(t.record_type)))}))},null,8,Ve)):Object(n["createCommentVNode"])("",!0)])])}}});c("091a");const Ce=_e;var De=Ce,Te=(c("99af"),c("4fad"),{class:"donut-chart"}),Re={height:"34",width:"34",viewBox:"0 0 34 34"},Me=["stroke","stroke-dashoffset","transform"],Ie=Object(n["defineComponent"])({props:{colors:null,datasets:null},setup:function(e){var t=e,c=Object(n["toRefs"])(t),r=c.colors,a=c.datasets,o=-90,u=16,l=16,s=14,i=2*Math.PI*s;function d(e,t){return t-e*t}function b(e,t){var c="rotate(".concat(o,", ").concat(u,", ").concat(l,")");return o=360*t+o,c}return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Te,[(Object(n["openBlock"])(),Object(n["createElementBlock"])("svg",Re,[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(Object.entries(Object(n["unref"])(a)),(function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("g",{key:t},[Object(n["createElementVNode"])("circle",{cx:u,cy:l,r:s,fill:"transparent",stroke:Object(n["unref"])(r)[+e[0]],"stroke-dashoffset":d(e[1].percentage,i),"stroke-dasharray":i,"stroke-width":"3","stroke-opacity":"0.8",transform:b(t,e[1].percentage)},null,8,Me)])})),128))]))])}}});const xe=Ie;var Ae=xe,Le=c("1119"),Ue={class:"calendar-workouts-chart"},$e={class:"workouts-count"},Fe={key:0,class:"workouts-pane"},Pe={class:"more-workouts"},Ge=Object(n["defineComponent"])({props:{colors:null,datasets:null,sports:null,workouts:null},setup:function(e){var t=e,c=Object(n["toRefs"])(t),r=c.colors,a=c.datasets,o=c.sports,u=c.workouts,l=Object(n["ref"])(!0);function s(e){e.stopPropagation(),l.value=!l.value}return function(e,t){var c=Object(n["resolveDirective"])("click-outside");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Ue,[Object(n["createElementVNode"])("div",{class:"workouts-chart",onClick:s},[Object(n["createElementVNode"])("div",$e,Object(n["toDisplayString"])(Object(n["unref"])(u).length),1),Object(n["createVNode"])(Ae,{datasets:Object(n["unref"])(a),colors:Object(n["unref"])(r)},null,8,["datasets","colors"])]),l.value?Object(n["createCommentVNode"])("",!0):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Fe,[Object(n["withDirectives"])(Object(n["createElementVNode"])("div",Pe,[Object(n["createElementVNode"])("i",{class:"fa fa-times calendar-more","aria-hidden":"true",onClick:s}),(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(Object(n["unref"])(u),(function(e,t){return Object(n["openBlock"])(),Object(n["createBlock"])(De,{key:t,workout:e,sportLabel:Object(n["unref"])(Le["a"])(e,Object(n["unref"])(o))},null,8,["workout","sportLabel"])})),128))],512),[[c,s]])]))])}}});c("aca6");const ze=le()(Ge,[["__scopeId","data-v-7529132c"]]);var We=ze,qe={class:"calendar-workouts"},Ye={class:"desktop-display"},He={key:0,class:"workouts-display"},Ke={key:1,class:"donut-display"},Xe={class:"mobile-display"},Je={key:0,class:"donut-display"},Qe=Object(n["defineComponent"])({props:{workouts:null,sports:null},setup:function(e){var t=e,c=Object(n["toRefs"])(t),r=c.workouts,a=c.sports,o=Object(n["computed"])((function(){return Object(be["c"])(t.workouts)})),u=Object(n["computed"])((function(){return Object(Le["c"])(t.sports)})),l=6;return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",qe,[Object(n["createElementVNode"])("div",Ye,[Object(n["unref"])(r).length<=l?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",He,[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(Object(n["unref"])(r).slice(0,l),(function(e,t){return Object(n["openBlock"])(),Object(n["createBlock"])(De,{key:t,workout:e,sportLabel:Object(n["unref"])(Le["a"])(e,Object(n["unref"])(a))},null,8,["workout","sportLabel"])})),128))])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Ke,[Object(n["createVNode"])(We,{workouts:Object(n["unref"])(r),sports:Object(n["unref"])(a),datasets:Object(n["unref"])(o),colors:Object(n["unref"])(u)},null,8,["workouts","sports","datasets","colors"])]))]),Object(n["createElementVNode"])("div",Xe,[Object(n["unref"])(r).length>0?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Je,[Object(n["createVNode"])(We,{workouts:Object(n["unref"])(r),sports:Object(n["unref"])(a),datasets:Object(n["unref"])(o),colors:Object(n["unref"])(u)},null,8,["workouts","sports","datasets","colors"])])):Object(n["createCommentVNode"])("",!0)])])}}});c("c7c8");const Ze=Qe;var et=Ze,tt={class:"calendar-cells"},ct={class:"calendar-cell-day"},nt=Object(n["defineComponent"])({props:{currentDay:null,endDate:null,sports:null,startDate:null,timezone:null,weekStartingMonday:null,workouts:null},setup:function(e){var t=e,c=Object(n["toRefs"])(t),r=c.currentDay,a=c.endDate,o=c.sports,u=c.startDate,l=c.timezone,s=c.weekStartingMonday,i=c.workouts,b=Object(n["ref"])([]);function O(){b.value=[];var e=u.value;while(e<=a.value){for(var t=[],c=0;c<7;c++)t.push(e),e=Object(we["a"])(e,1);b.value.push(t)}}function j(e){return s.value?[5,6].includes(e):[0,6].includes(e)}function f(e,t){return t?t.filter((function(t){return Se(Object(L["c"])(t.workout_date,l),e)})).reverse():[]}return Object(n["onMounted"])((function(){return O()})),Object(n["watch"])((function(){return t.currentDay}),(function(){return O()})),function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",tt,[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(b.value,(function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",{class:"calendar-row",key:t},[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(e,(function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",{class:Object(n["normalizeClass"])(["calendar-cell",{"disabled-cell":!Object(n["unref"])(ge)(e,Object(n["unref"])(r)),"week-end":j(t),today:Object(n["unref"])(Be)(e)}]),key:t},[Object(n["createVNode"])(et,{workouts:f(e,Object(n["unref"])(i)),sports:Object(n["unref"])(o)},null,8,["workouts","sports"]),Object(n["createElementVNode"])("div",ct,Object(n["toDisplayString"])(Object(n["unref"])(d["a"])(e,"d")),1)],2)})),128))])})),128))])}}});c("a86d");const rt=nt;var at=rt,ot={class:"calendar-days"},ut=Object(n["defineComponent"])({props:{startDate:null,localeOptions:null},setup:function(e){for(var t=e,c=[],r=0;r<7;r++)c.push(Object(we["a"])(t.startDate,r));return function(t,r){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ot,[(Object(n["openBlock"])(),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(c,(function(t,c){return Object(n["createElementVNode"])("div",{class:"calendar-day",key:c},Object(n["toDisplayString"])(Object(n["unref"])(d["a"])(t,"EEE",{locale:e.localeOptions})),1)})),64))])}}});c("20fc");const lt=ut;var st=lt,it={class:"calendar-header"},dt=Object(n["createElementVNode"])("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1),bt=[dt],Ot={class:"calendar-month"},jt=Object(n["createElementVNode"])("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1),ft=[jt],pt=Object(n["defineComponent"])({props:{day:null,localeOptions:null},emits:["displayNextMonth","displayPreviousMonth"],setup:function(e,t){var c=t.emit,r=e,a=Object(n["toRefs"])(r),o=a.day,u=a.localeOptions;return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",it,[Object(n["createElementVNode"])("div",{class:"calendar-arrow calendar-arrow-left",onClick:t[0]||(t[0]=function(e){return c("displayPreviousMonth")})},bt),Object(n["createElementVNode"])("div",Ot,[Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(Object(n["unref"])(d["a"])(Object(n["unref"])(o),"MMM yyyy",{locale:Object(n["unref"])(u)})),1)]),Object(n["createElementVNode"])("div",{class:"calendar-arrow calendar-arrow-right",onClick:t[1]||(t[1]=function(e){return c("displayNextMonth")})},ft)])}}});c("1a1f");const mt=pt;var kt=mt,vt={id:"user-calendar"},yt={class:"calendar-card box"},ht=Object(n["defineComponent"])({props:{sports:null,user:null},setup:function(e){var t=e,c=Object(A["a"])(),r=Object(n["toRefs"])(t),a=r.sports,o=r.user,u="yyyy-MM-dd",l=Object(n["ref"])(new Date),s=Object(n["ref"])(Object(L["b"])(l.value,t.user.weekm)),b=Object(n["computed"])((function(){return c.getters[x["f"].GETTERS.CALENDAR_WORKOUTS]})),O=Object(n["computed"])((function(){return c.getters[x["b"].GETTERS.LOCALE]}));function j(){s.value=Object(L["b"])(l.value,t.user.weekm);var e=Object(i["a"])({from:Object(d["a"])(s.value.start,u),to:Object(d["a"])(s.value.end,u),page:1,per_page:100},be["a"]);c.dispatch(x["f"].ACTIONS.GET_CALENDAR_WORKOUTS,e)}function f(){l.value=Object(he["a"])(l.value,1),j()}function p(){l.value=Object(Ee["a"])(l.value,1),j()}return Object(n["onBeforeMount"])((function(){return j()})),function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",vt,[Object(n["createElementVNode"])("div",yt,[Object(n["createVNode"])(kt,{day:Object(n["unref"])(l),"locale-options":Object(n["unref"])(O),onDisplayNextMonth:f,onDisplayPreviousMonth:p},null,8,["day","locale-options"]),Object(n["createVNode"])(st,{"start-date":Object(n["unref"])(s).start,"locale-options":Object(n["unref"])(O)},null,8,["start-date","locale-options"]),Object(n["createVNode"])(at,{currentDay:Object(n["unref"])(l),"end-date":Object(n["unref"])(s).end,sports:Object(n["unref"])(a),"start-date":Object(n["unref"])(s).start,timezone:Object(n["unref"])(o).timezone,workouts:Object(n["unref"])(b),weekStartingMonday:Object(n["unref"])(o).weekm},null,8,["currentDay","end-date","sports","start-date","timezone","workouts","weekStartingMonday"])])])}}});c("8917");const Et=ht;var wt=Et,Nt=c("f628"),St=c("ec59"),gt={class:"user-month-stats"},Bt=Object(n["defineComponent"])({props:{sports:null,user:null},setup:function(e){var t=e,c=Object(n["toRefs"])(t),r=c.sports,a=c.user,o=new Date,u={duration:"week",start:Object(Nt["a"])(o),end:Object(m["a"])(o)},l=t.sports.map((function(e){return e.id}));return function(e,t){var c=Object(n["resolveComponent"])("Card");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",gt,[Object(n["createVNode"])(c,null,{title:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.$t("dashboard.THIS_MONTH")),1)]})),content:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(St["a"],{sports:Object(n["unref"])(r),user:Object(n["unref"])(a),"chart-params":u,"displayed-sport-ids":Object(n["unref"])(l),"hide-chart-if-no-data":!0},null,8,["sports","user","displayed-sport-ids"])]})),_:1})])}}});c("bd2d");const Vt=le()(Bt,[["__scopeId","data-v-7926683e"]]);var _t=Vt,Ct=(c("b64b"),c("4e82"),c("47e2")),Dt={class:"records-card"},Tt={class:"record-type"},Rt={class:"record-value"},Mt={class:"record-date"},It=Object(n["defineComponent"])({props:{records:null,sportTranslatedLabel:null},setup:function(e){var t=e,c=Object(n["toRefs"])(t),r=c.records,a=c.sportTranslatedLabel;return function(e,t){var c=Object(n["resolveComponent"])("SportImage"),o=Object(n["resolveComponent"])("router-link"),u=Object(n["resolveComponent"])("Card");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Dt,[Object(n["createVNode"])(u,null,{title:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(c,{"sport-label":Object(n["unref"])(r).label},null,8,["sport-label"]),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(Object(n["unref"])(a)),1)]})),content:Object(n["withCtx"])((function(){return[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(Object(n["unref"])(r).records,(function(t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",{class:"record",key:t.id},[Object(n["createElementVNode"])("span",Tt,Object(n["toDisplayString"])(e.$t("workouts.RECORD_".concat(t.record_type))),1),Object(n["createElementVNode"])("span",Rt,Object(n["toDisplayString"])(t.value),1),Object(n["createElementVNode"])("span",Mt,[Object(n["createVNode"])(o,{to:{name:"Workout",params:{workoutId:t.workout_id}}},{default:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(t.workout_date),1)]})),_:2},1032,["to"])])])})),128))]})),_:1})])}}});c("9317");const xt=le()(It,[["__scopeId","data-v-470b4411"]]);var At=xt,Lt=(c("7db0"),function(e,t){var c;switch(e.record_type){case"AS":case"MS":c="".concat(e.value," km/h");break;case"FD":c="".concat(e.value," km");break;case"LD":c=e.value;break;default:throw new Error('Invalid record type, expected: "AS", "FD", "LD", "MD", got: "'.concat(e.record_type,'"'))}return{workout_date:Object(L["a"])(Object(L["c"])(e.workout_date,t)).workout_date,workout_id:e.workout_id,id:e.id,record_type:e.record_type,value:c}}),Ut=function(e,t,c){return e.reduce((function(e,n){var r=t.find((function(e){return e.id===n.sport_id}));return r&&r.label&&(void 0===e[r.translatedLabel]&&(e[r.translatedLabel]={label:r.label,records:[]}),e[r.translatedLabel].records.push(Lt(n,c))),e}),{})},$t=function(e){return Object(n["pushScopeId"])("data-v-1de215c6"),e=e(),Object(n["popScopeId"])(),e},Ft={class:"user-records-section"},Pt={class:"section-title"},Gt=$t((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-trophy custom-fa-small","aria-hidden":"true"},null,-1)})),zt={class:"user-records"},Wt={key:0,class:"no-records"},qt=Object(n["defineComponent"])({props:{sports:null,user:null},setup:function(e){var t=e,c=Object(Ct["b"])(),r=c.t,a=Object(n["computed"])((function(){return Ut(t.user.records,Object(Le["d"])(t.sports,r),t.user.timezone)}));return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Ft,[Object(n["createElementVNode"])("div",Pt,[Gt,Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.RECORD",2)),1)]),Object(n["createElementVNode"])("div",zt,[0===Object.keys(Object(n["unref"])(a)).length?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Wt,Object(n["toDisplayString"])(e.$t("workouts.NO_RECORDS")),1)):Object(n["createCommentVNode"])("",!0),(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(Object.keys(Object(n["unref"])(a)).sort(),(function(e){return Object(n["openBlock"])(),Object(n["createBlock"])(At,{sportTranslatedLabel:e,records:Object(n["unref"])(a)[e],key:e},null,8,["sportTranslatedLabel","records"])})),128))])])}}});c("351a");const Yt=le()(qt,[["__scopeId","data-v-1de215c6"]]);var Ht=Yt,Kt=(c("466d"),c("1276"),c("b680"),c("a9e3"),c("05d9")),Xt={id:"user-stats"},Jt=Object(n["defineComponent"])({props:{user:null},setup:function(e){var t=e,c=Object(Ct["b"])(),r=c.t,a=Object(n["toRefs"])(t),o=a.user,u=Object(n["computed"])((function(){return t.user.total_duration})),l=Object(n["computed"])((function(){return s(u)}));function s(e){var t=e.value.match(/day/g)?e.value.split(", ")[1]:e.value;return{days:e.value.match(/day/g)?"".concat(e.value.split(" ")[0]," ").concat(e.value.match(/days/g)?r("common.DAY",2):r("common.DAY",1)):"0 ".concat(r("common.DAY",2),","),duration:"".concat(t.split(":")[0],"h ").concat(t.split(":")[1],"min")}}return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Xt,[Object(n["createVNode"])(Kt["a"],{icon:"calendar",value:Object(n["unref"])(o).nb_workouts,text:e.$t("workouts.WORKOUT",Object(n["unref"])(o).nb_workouts)},null,8,["value","text"]),Object(n["createVNode"])(Kt["a"],{icon:"road",value:Number(Object(n["unref"])(o).total_distance).toFixed(2),text:e.$t("workouts.KM")},null,8,["value","text"]),Object(n["createVNode"])(Kt["a"],{icon:"clock-o",value:Object(n["unref"])(l).days,text:Object(n["unref"])(l).duration},null,8,["value","text"]),Object(n["createVNode"])(Kt["a"],{icon:"tags",value:Object(n["unref"])(o).nb_sports,text:e.$t("workouts.SPORT",Object(n["unref"])(o).nb_sports)},null,8,["value","text"])])}}});c("7ce8");const Qt=Jt;var Zt=Qt,ec=function(e){return Object(n["pushScopeId"])("data-v-5590d1e6"),e=e(),Object(n["popScopeId"])(),e},tc={key:0,id:"dashboard",class:"view"},cc={class:"container mobile-menu"},nc={class:"box"},rc=ec((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-calendar","aria-hidden":"true"},null,-1)})),ac=[rc],oc=ec((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-bar-chart","aria-hidden":"true"},null,-1)})),uc=[oc],lc=ec((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-map-o","aria-hidden":"true"},null,-1)})),sc=[lc],ic=ec((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-trophy","aria-hidden":"true"},null,-1)})),dc=[ic],bc={class:"container"},Oc={class:"container dashboard-container"},jc={class:"left-container dashboard-sub-container"},fc={class:"right-container dashboard-sub-container"},pc=ec((function(){return Object(n["createElementVNode"])("div",{id:"bottom"},null,-1)})),mc={key:1,class:"app-loading"},kc=Object(n["defineComponent"])({setup:function(e){var t=Object(A["a"])(),c=Object(n["computed"])((function(){return t.getters[x["a"].GETTERS.AUTH_USER_PROFILE]})),r=Object(n["computed"])((function(){return t.getters[x["c"].GETTERS.SPORTS]})),a=Object(n["ref"])("calendar");function o(e){a.value=e}return function(e,t){var u=Object(n["resolveComponent"])("Loader");return Object(n["unref"])(c).username&&Object(n["unref"])(r).length>0?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",tc,[Object(n["createElementVNode"])("div",cc,[Object(n["createElementVNode"])("div",nc,[Object(n["createElementVNode"])("div",{class:Object(n["normalizeClass"])(["mobile-menu-item",{"is-selected":"calendar"===a.value}]),onClick:t[0]||(t[0]=function(e){return o("calendar")})},ac,2),Object(n["createElementVNode"])("div",{class:Object(n["normalizeClass"])(["mobile-menu-item",{"is-selected":"chart"===a.value}]),onClick:t[1]||(t[1]=function(e){return o("chart")})},uc,2),Object(n["createElementVNode"])("div",{class:Object(n["normalizeClass"])(["mobile-menu-item",{"is-selected":"timeline"===a.value}]),onClick:t[2]||(t[2]=function(e){return o("timeline")})},sc,2),Object(n["createElementVNode"])("div",{class:Object(n["normalizeClass"])(["mobile-menu-item",{"is-selected":"records"===a.value}]),onClick:t[3]||(t[3]=function(e){return o("records")})},dc,2)])]),Object(n["createElementVNode"])("div",bc,[Object(n["createVNode"])(Zt,{user:Object(n["unref"])(c)},null,8,["user"])]),Object(n["createElementVNode"])("div",Oc,[Object(n["createElementVNode"])("div",jc,[Object(n["createVNode"])(_t,{sports:Object(n["unref"])(r),user:Object(n["unref"])(c),class:Object(n["normalizeClass"])({"is-hidden":!("chart"===a.value)})},null,8,["sports","user","class"]),Object(n["createVNode"])(Ht,{sports:Object(n["unref"])(r),user:Object(n["unref"])(c),class:Object(n["normalizeClass"])({"is-hidden":!("records"===a.value)})},null,8,["sports","user","class"])]),Object(n["createElementVNode"])("div",fc,[Object(n["createVNode"])(wt,{sports:Object(n["unref"])(r),user:Object(n["unref"])(c),class:Object(n["normalizeClass"])({"is-hidden":!("calendar"===a.value)})},null,8,["sports","user","class"]),Object(n["createVNode"])(ye,{sports:Object(n["unref"])(r),user:Object(n["unref"])(c),class:Object(n["normalizeClass"])({"is-hidden":!("timeline"===a.value)})},null,8,["sports","user","class"])])]),pc])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",mc,[Object(n["createVNode"])(u)]))}}});c("918a");const vc=le()(kc,[["__scopeId","data-v-5590d1e6"]]);t["default"]=vc},7416:function(e,t,c){"use strict";c.d(t,"a",(function(){return B})),c.d(t,"b",(function(){return V})),c.d(t,"c",(function(){return _}));c("d81d"),c("4de4"),c("d3b7"),c("caad"),c("2532");var n=c("b166"),r=c("d6e9"),a=c("fe1f"),o=c("cdb6"),u=c("8c86");function l(e,t){Object(u["a"])(2,arguments);var c=Object(a["a"])(t);return Object(o["a"])(e,-c)}var s=c("69eb"),i=c("a618"),d=c("f628"),b=c("fd3a");function O(e){Object(u["a"])(1,arguments);var t=Object(b["a"])(e),c=t.getFullYear();return t.setFullYear(c+1,0,0),t.setHours(23,59,59,999),t}var j=c("2fc8"),f=c("8cac"),p=c("f7f1");function m(e,t){Object(u["a"])(2,arguments);var c=Object(a["a"])(t),n=7*c;return Object(p["a"])(e,n)}function k(e,t){Object(u["a"])(2,arguments);var c=Object(a["a"])(t);return m(e,-c)}var v=c("74b5"),y=c("5e65"),h=c("1119"),E={week:{api:"yyyy-MM-dd",chart:"dd/MM/yyyy"},month:{api:"yyyy-MM",chart:"MM/yyyy"},year:{api:"yyyy",chart:"yyyy"}},w=["nb_workouts","total_duration","total_distance","total_ascent","total_descent"],N=function(e,t){for(var c=[],n=Object(y["d"])(e.duration,e.start,t);n<=e.end;n=Object(y["e"])(e.duration,n))c.push(n);return c},S=function(e,t){return{label:e,backgroundColor:[t],data:[]}},g=function(e){var t={nb_workouts:[],total_distance:[],total_duration:[],total_ascent:[],total_descent:[]};return e.map((function(e){var c=h["b"][e.label];t.nb_workouts.push(S(e.label,c)),t.total_distance.push(S(e.label,c)),t.total_duration.push(S(e.label,c)),t.total_ascent.push(S(e.label,c)),t.total_descent.push(S(e.label,c))})),t},B=function(e,t,c,r,a){var o=N(e,t),u=E[e.duration],l=c.filter((function(e){return r.includes(e.id)})),s=[],i=g(l),d={};return l.map((function(e){return d[e.label]=e.id})),o.map((function(e){var t=Object(n["a"])(e,u.api),c=Object(n["a"])(e,u.chart);s.push(c),w.map((function(e){i[e].map((function(c){c.data.push(a!=={}&&t in a&&d[c.label]in a[t]?a[t][d[c.label]][e]:0)}))}))})),{labels:s,datasets:i}},V=function(e,t,c){var n=c?1:0,a="year"===t?Object(r["a"])(l(e,9)):"week"===t?Object(s["a"])(Object(i["a"])(e,2),{weekStartsOn:n}):Object(d["a"])(Object(i["a"])(e,11)),o="year"===t?O(e):"week"===t?Object(j["a"])(e,{weekStartsOn:n}):Object(f["a"])(e);return{duration:t,end:o,start:a}},_=function(e,t,c){var n=e.duration,a=e.start,u=e.end,b=c?1:0;return{duration:n,end:"year"===n?O(t?l(u,1):Object(o["a"])(u,1)):"week"===n?Object(j["a"])(t?k(u,1):m(u,1),{weekStartsOn:b}):Object(f["a"])(t?Object(i["a"])(u,1):Object(v["a"])(u,1)),start:"year"===n?Object(r["a"])(t?l(a,1):Object(o["a"])(a,1)):"week"===n?Object(s["a"])(t?k(a,1):m(a,1),{weekStartsOn:b}):Object(d["a"])(t?Object(i["a"])(a,1):Object(v["a"])(a,1))}}},7639:function(e,t,c){},"79b0":function(e,t,c){},"7ce8":function(e,t,c){"use strict";c("85f8")},"84f7":function(e,t,c){},"85bb":function(e,t,c){"use strict";c("1e7c")},"85f8":function(e,t,c){},8917:function(e,t,c){"use strict";c("c091")},"8def":function(e,t,c){},"918a":function(e,t,c){"use strict";c("84f7")},9317:function(e,t,c){"use strict";c("c255")},9796:function(e,t,c){"use strict";c("33b7")},"9a0c":function(e,t,c){var n=c("342f");e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(n)},"9c5c":function(e,t,c){"use strict";c("605d1")},a618:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var n=c("fe1f"),r=c("74b5"),a=c("8c86");function o(e,t){Object(a["a"])(2,arguments);var c=Object(n["a"])(t);return Object(r["a"])(e,-c)}},a86d:function(e,t,c){"use strict";c("aab2")},a986:function(e,t,c){"use strict";c("df5a")},aab2:function(e,t,c){},aca6:function(e,t,c){"use strict";c("f831")},b58a:function(e,t,c){},bd2d:function(e,t,c){"use strict";c("d02c")},c063:function(e,t,c){"use strict";c("c77e")},c091:function(e,t,c){},c255:function(e,t,c){},c71e:function(e,t,c){"use strict";c("8def")},c77e:function(e,t,c){},c7c8:function(e,t,c){"use strict";c("07fe")},c910:function(e,t,c){"use strict";c("b58a")},ccb2:function(e,t,c){"use strict";c.r(t);c("4de4"),c("d3b7"),c("caad"),c("2532");var n=c("7a23"),r=(c("d81d"),c("47e2")),a=c("ec59"),o={class:"chart-menu"},u={class:"chart-arrow"},l={class:"time-frames custom-checkboxes-group"},s={class:"time-frames-checkboxes custom-checkboxes"},i=["id","name","checked","onInput"],d={class:"chart-arrow"},b=Object(n["defineComponent"])({emits:["arrowClick","timeFrameUpdate"],setup:function(e,t){var c=t.emit,r=Object(n["ref"])("month"),a=["week","month","year"];function b(e){r.value=e,c("timeFrameUpdate",e)}return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",o,[Object(n["createElementVNode"])("div",u,[Object(n["createElementVNode"])("i",{class:"fa fa-chevron-left","aria-hidden":"true",onClick:t[0]||(t[0]=function(e){return c("arrowClick",!0)})})]),Object(n["createElementVNode"])("div",l,[Object(n["createElementVNode"])("div",s,[(Object(n["openBlock"])(),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(a,(function(t){return Object(n["createElementVNode"])("div",{class:"time-frame custom-checkbox",key:t},[Object(n["createElementVNode"])("label",null,[Object(n["createElementVNode"])("input",{type:"radio",id:t,name:t,checked:Object(n["unref"])(r)===t,onInput:function(e){return b(t)}},null,40,i),Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(e.$t("statistics.TIME_FRAMES.".concat(t))),1)])])})),64))])]),Object(n["createElementVNode"])("div",d,[Object(n["createElementVNode"])("i",{class:"fa fa-chevron-right","aria-hidden":"true",onClick:t[1]||(t[1]=function(e){return c("arrowClick",!1)})})])])}}}),O=(c("c063"),c("6b0d")),j=c.n(O);const f=j()(b,[["__scopeId","data-v-50ff40f3"]]);var p=f,m=c("1119"),k={class:"sports-menu"},v=["id","name","checked","onInput"],y={class:"sport-label"},h=Object(n["defineComponent"])({props:{userSports:null,selectedSportIds:{default:function(){return[]}}},emits:["selectedSportIdsUpdate"],setup:function(e,t){var c=t.emit,a=e,o=Object(r["b"])(),u=o.t,l=Object(n["inject"])("sportColors"),s=Object(n["toRefs"])(a),i=s.selectedSportIds,d=Object(n["computed"])((function(){return Object(m["d"])(a.userSports,u)}));function b(e){c("selectedSportIdsUpdate",e)}return function(e,t){var c=Object(n["resolveComponent"])("SportImage");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",k,[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(Object(n["unref"])(d),(function(e){return Object(n["openBlock"])(),Object(n["createElementBlock"])("label",{type:"checkbox",key:e.id,style:Object(n["normalizeStyle"])({color:Object(n["unref"])(l)[e.label]})},[Object(n["createElementVNode"])("input",{type:"checkbox",id:e.id,name:e.label,checked:Object(n["unref"])(i).includes(e.id),onInput:function(t){return b(e.id)}},null,40,v),Object(n["createVNode"])(c,{"sport-label":e.label},null,8,["sport-label"]),Object(n["createElementVNode"])("span",y,Object(n["toDisplayString"])(e.translatedLabel),1)],4)})),128))])}}});c("1970");const E=h;var w=E,N=c("7416"),S={key:0,id:"user-statistics"},g=Object(n["defineComponent"])({props:{sports:null,user:null},setup:function(e){var t=e,c=Object(r["b"])(),o=c.t,u=Object(n["toRefs"])(t),l=u.sports,s=u.user,i=Object(n["ref"])("month"),d=Object(n["ref"])(f(i.value)),b=Object(n["computed"])((function(){return Object(m["d"])(t.sports,o)})),O=Object(n["ref"])(v(t.sports));function j(e){i.value=e,d.value=f(i.value)}function f(e){return Object(N["b"])(new Date,e,t.user.weekm)}function k(e){d.value=Object(N["c"])(d.value,e,t.user.weekm)}function v(e){return e.map((function(e){return e.id}))}function y(e){O.value.includes(e)?O.value=O.value.filter((function(t){return t!==e})):O.value.push(e)}return Object(n["watch"])((function(){return t.sports}),(function(e){O.value=v(e)})),function(e,t){return Object(n["unref"])(b)?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",S,[Object(n["createVNode"])(p,{onTimeFrameUpdate:j,onArrowClick:k}),Object(n["createVNode"])(a["a"],{sports:Object(n["unref"])(l),user:Object(n["unref"])(s),chartParams:d.value,"displayed-sport-ids":O.value,fullStats:!0},null,8,["sports","user","chartParams","displayed-sport-ids"]),Object(n["createVNode"])(w,{"selected-sport-ids":O.value,"user-sports":Object(n["unref"])(l),onSelectedSportIdsUpdate:y},null,8,["selected-sport-ids","user-sports"])])):Object(n["createCommentVNode"])("",!0)}}});c("1574");const B=j()(g,[["__scopeId","data-v-fbf1fdc8"]]);var V=B,_=c("1724"),C=c("dad5"),D=c("2906"),T={id:"statistics",class:"view"},R={key:0,class:"container"},M=Object(n["defineComponent"])({setup:function(e){var t=Object(D["a"])(),c=Object(n["computed"])((function(){return t.getters[C["a"].GETTERS.AUTH_USER_PROFILE]})),r=Object(n["computed"])((function(){return t.getters[C["c"].GETTERS.SPORTS].filter((function(e){return c.value.sports_list.includes(e.id)}))}));return function(e,t){var a=Object(n["resolveComponent"])("Card");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",T,[Object(n["unref"])(c).username?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",R,[Object(n["createVNode"])(a,null,{title:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(e.$t("statistics.STATISTICS")),1)]})),content:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(V,{class:Object(n["normalizeClass"])({"stats-disabled":0===Object(n["unref"])(c).nb_workouts}),user:Object(n["unref"])(c),sports:Object(n["unref"])(r)},null,8,["class","user","sports"])]})),_:1}),0===Object(n["unref"])(c).nb_workouts?(Object(n["openBlock"])(),Object(n["createBlock"])(_["a"],{key:0})):Object(n["createCommentVNode"])("",!0)])):Object(n["createCommentVNode"])("",!0)])}}});c("a986");const I=j()(M,[["__scopeId","data-v-3d90c110"]]);t["default"]=I},d02c:function(e,t,c){},d277:function(e,t,c){"use strict";c.r(t);var n=c("7a23"),r={id:"bike"},a=["src"];function o(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",r,[Object(n["createElementVNode"])("img",{class:"bike-img",src:"/img/bike.svg",alt:"mountain bike"},null,8,a)])}c("c910");var u=c("6b0d"),l=c.n(u);const s={},i=l()(s,[["render",o],["__scopeId","data-v-b57bbb7e"]]);var d=i,b=c("0395"),O={id:"loginOrRegister",class:"view"},j={class:"container"},f={class:"container-sub"},p={class:"container-sub"},m=Object(n["defineComponent"])({props:{action:null},setup:function(e){var t=e,c=Object(n["toRefs"])(t),r=c.action;return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",O,[Object(n["createElementVNode"])("div",j,[Object(n["createElementVNode"])("div",f,[Object(n["createVNode"])(d)]),Object(n["createElementVNode"])("div",p,[Object(n["createVNode"])(b["a"],{action:Object(n["unref"])(r)},null,8,["action"])])])])}}});c("9c5c");const k=m;t["default"]=k},d28b:function(e,t,c){var n=c("746f");n("iterator")},df5a:function(e,t,c){},e01a:function(e,t,c){"use strict";var n=c("23e7"),r=c("83ab"),a=c("da84"),o=c("e330"),u=c("1a2d"),l=c("1626"),s=c("3a9b"),i=c("577e"),d=c("9bf2").f,b=c("e893"),O=a.Symbol,j=O&&O.prototype;if(r&&l(O)&&(!("description"in j)||void 0!==O().description)){var f={},p=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:i(arguments[0]),t=s(j,this)?new O(e):void 0===e?O():O(e);return""===e&&(f[t]=!0),t};b(p,O),p.prototype=j,j.constructor=p;var m="Symbol(test)"==String(O("test")),k=o(j.toString),v=o(j.valueOf),y=/^Symbol\((.*)\)[^)]+$/,h=o("".replace),E=o("".slice);d(j,"description",{configurable:!0,get:function(){var e=v(this),t=k(e);if(u(f,e))return"";var c=m?E(t,7,-1):h(t,y,"$1");return""===c?void 0:c}}),n({global:!0,forced:!0},{Symbol:p})}},e19f:function(e,t,c){"use strict";c.r(t);var n=c("7a23"),r=c("f7f9"),a={class:"not-found view"},o=Object(n["defineComponent"])({setup:function(e){return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",a,[Object(n["createVNode"])(r["a"])])}}});const u=o;t["default"]=u},e79b:function(e,t,c){},ec59:function(e,t,c){"use strict";var n=c("7a23"),r={class:"start-chart"},a={key:0},o={key:1},u={class:"chart-radio"},l=["checked"],s=["checked"],i=["checked"],d={key:0},b=["checked"],O={key:1},j=["checked"];function f(e,t,c,f,p,m){var k=Object(n["resolveComponent"])("Chart");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",r,[e.hideChartIfNoData&&e.emptyStats?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",a,Object(n["toDisplayString"])(e.$t("workouts.NO_WORKOUTS")),1)):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",o,[Object(n["createElementVNode"])("div",u,[Object(n["createElementVNode"])("label",null,[Object(n["createElementVNode"])("input",{type:"radio",name:"total_distance",checked:"total_distance"===e.displayedData,onClick:t[0]||(t[0]=function(){return e.updateDisplayData&&e.updateDisplayData.apply(e,arguments)})},null,8,l),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.DISTANCE")),1)]),Object(n["createElementVNode"])("label",null,[Object(n["createElementVNode"])("input",{type:"radio",name:"total_duration",checked:"total_duration"===e.displayedData,onClick:t[1]||(t[1]=function(){return e.updateDisplayData&&e.updateDisplayData.apply(e,arguments)})},null,8,s),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.DURATION")),1)]),Object(n["createElementVNode"])("label",null,[Object(n["createElementVNode"])("input",{type:"radio",name:"nb_workouts",checked:"nb_workouts"===e.displayedData,onClick:t[2]||(t[2]=function(){return e.updateDisplayData&&e.updateDisplayData.apply(e,arguments)})},null,8,i),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.WORKOUT",2)),1)]),e.fullStats?(Object(n["openBlock"])(),Object(n["createElementBlock"])("label",d,[Object(n["createElementVNode"])("input",{type:"radio",name:"total_ascent",checked:"total_ascent"===e.displayedData,onClick:t[3]||(t[3]=function(){return e.updateDisplayData&&e.updateDisplayData.apply(e,arguments)})},null,8,b),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.ASCENT")),1)])):Object(n["createCommentVNode"])("",!0),e.fullStats?(Object(n["openBlock"])(),Object(n["createElementBlock"])("label",O,[Object(n["createElementVNode"])("input",{type:"radio",name:"total_descent",checked:"total_descent"===e.displayedData,onClick:t[4]||(t[4]=function(){return e.updateDisplayData&&e.updateDisplayData.apply(e,arguments)})},null,8,j),Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(e.$t("workouts.DESCENT")),1)])):Object(n["createCommentVNode"])("",!0)]),e.labels.length>0?(Object(n["openBlock"])(),Object(n["createBlock"])(k,{key:0,datasets:e.datasets,labels:e.labels,displayedData:e.displayedData,displayedSportIds:e.displayedSportIds,fullStats:e.fullStats},null,8,["datasets","labels","displayedData","displayedSportIds","fullStats"])):Object(n["createCommentVNode"])("",!0)]))])}var p=c("1da1"),m=(c("96cf"),c("b0c0"),c("b64b"),c("b166")),k={class:"chart"};function v(e,t,c,r,a,o){var u=Object(n["resolveComponent"])("BarChart");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",k,[Object(n["createVNode"])(u,Object(n["mergeProps"])(e.barChartProps,{class:"bar-chart"}),null,16)])}c("e9c4"),c("d3b7"),c("d81d");var y=c("b48c"),h=c("47e2"),E=(c("b680"),c("25f0"),c("4d90"),c("99af"),function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c="0";t&&(c=String(Math.floor(e/86400)),e%=86400);var n=String(Math.floor(e/3600)).padStart(2,"0");e%=3600;var r=String(Math.floor(e/60)).padStart(2,"0"),a=String(e%60).padStart(2,"0");return t?"".concat("0"===c?"":"".concat(c,"d ")).concat("00"===n?"":"".concat(n,"h ")).concat(r,"m ").concat(a,"s"):"".concat("00"===n?"":"".concat(n,":")).concat(r,":").concat(a)}),w=function(e,t){var c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];switch(e){case"total_duration":return E(t,c);case"total_distance":return t.toFixed(2)+" km";case"total_ascent":case"total_descent":return(t/1e3).toFixed(2)+" km";default:return t.toString()}},N=Object(n["defineComponent"])({name:"Chart",components:{BarChart:y["BarChart"]},props:{datasets:{type:Object,required:!0},labels:{type:Object,required:!0},displayedData:{type:String,required:!0},displayedSportIds:{type:Array,required:!0},fullStats:{type:Boolean,required:!0}},setup:function(e){var t=Object(h["b"])(),c=t.t;function r(e){return isNaN(e)?0:+e}function a(e,t){return r(e)+r(t)}var o=Object(n["computed"])((function(){return{labels:e.labels,datasets:JSON.parse(JSON.stringify(e.datasets))}})),u=Object(n["computed"])((function(){return{responsive:!0,maintainAspectRatio:!0,animation:!1,layout:{padding:{top:e.fullStats?40:22}},scales:{x:{stacked:!0,grid:{drawOnChartArea:!1}},y:{stacked:!0,grid:{drawOnChartArea:!1},ticks:{maxTicksLimit:6,callback:function(t){return w(e.displayedData,+t,!1)}},afterFit:function(t){t.width=e.fullStats?75:60}}},plugins:{datalabels:{anchor:"end",align:"end",rotation:function(t){return e.fullStats&&t.chart.chartArea.width<580?310:0},display:function(t){return!(e.fullStats&&t.chart.chartArea.width<300)},formatter:function(t,c){var n=c.chart.data.datasets.map((function(e){return e.data[c.dataIndex]})).reduce((function(e,t){return a(e,t)}),0);return c.datasetIndex===e.displayedSportIds.length-1&&n>0?w(e.displayedData,n,!1):null}},legend:{display:!1},tooltip:{interaction:{intersect:!0,mode:"index"},filter:function(e){return"0"!==e.formattedValue},callbacks:{label:function(t){var n=c("sports.".concat(t.dataset.label,".LABEL"))||"";return n&&(n+=": "),null!==t.parsed.y&&(n+=w(e.displayedData,t.parsed.y)),n},footer:function(t){var n=0;return t.map((function(e){n+=e.parsed.y})),"".concat(c("common.TOTAL"),": ")+w(e.displayedData,n)}}}}}})),l=Object(y["useBarChart"])({chartData:o,options:u}),s=l.barChartProps;return{barChartProps:s}}}),S=c("6b0d"),g=c.n(S);const B=g()(N,[["render",v]]);var V=B,_=c("dad5"),C=c("2906"),D=c("7416"),T=Object(n["defineComponent"])({name:"UserMonthStats",components:{Chart:V},props:{sports:{type:Object,required:!0},user:{type:Object,required:!0},chartParams:{type:Object,required:!0},displayedSportIds:{type:Array,default:function(){return[]}},fullStats:{type:Boolean,default:!1},hideChartIfNoData:{type:Boolean,default:!1}},setup:function(e){var t=Object(C["a"])(),c=Object(n["ref"])("total_distance"),r=Object(n["computed"])((function(){return t.getters[_["d"].GETTERS.USER_STATS]})),a=Object(n["computed"])((function(){return Object(D["a"])(e.chartParams,e.user.weekm,e.sports,e.displayedSportIds,r.value)}));function o(c){t.dispatch(_["d"].ACTIONS.GET_USER_STATS,{username:e.user.username,filterType:"by_time",params:c})}function u(e){c.value=e.target.name}function l(e,t){return{from:Object(m["a"])(e.start,"yyyy-MM-dd"),to:Object(m["a"])(e.end,"yyyy-MM-dd"),time:"week"===e.duration?"week".concat(t.weekm?"m":""):e.duration}}return Object(n["onBeforeMount"])((function(){return o(l(e.chartParams,e.user))})),Object(n["watch"])((function(){return e.chartParams}),function(){var t=Object(p["a"])(regeneratorRuntime.mark((function t(c){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:o(l(c,e.user));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),{datasets:Object(n["computed"])((function(){return a.value.datasets[c.value]})),labels:Object(n["computed"])((function(){return a.value.labels})),emptyStats:Object(n["computed"])((function(){return 0===Object.keys(r.value).length})),displayedData:c,updateDisplayData:u}}});c("c71e");const R=g()(T,[["render",f],["__scopeId","data-v-6566dd7e"]]);t["a"]=R},efea:function(e,t,c){},f831:function(e,t,c){},fb6a:function(e,t,c){"use strict";var n=c("23e7"),r=c("da84"),a=c("e8b5"),o=c("68ee"),u=c("861d"),l=c("23cb"),s=c("07fa"),i=c("fc6a"),d=c("8418"),b=c("b622"),O=c("1dde"),j=c("f36a"),f=O("slice"),p=b("species"),m=r.Array,k=Math.max;n({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var c,n,r,b=i(this),O=s(b),f=l(e,O),v=l(void 0===t?O:t,O);if(a(b)&&(c=b.constructor,o(c)&&(c===m||a(c.prototype))?c=void 0:u(c)&&(c=c[p],null===c&&(c=void 0)),c===m||void 0===c))return j(b,f,v);for(n=new(void 0===c?m:c)(k(v-f,0)),r=0;f<v;f++,r++)f in b&&d(n,r,b[f]);return n.length=r,n}})},fdcd:function(e,t,c){}}]);
|
|
//# sourceMappingURL=main.e5da50b8.js.map
|