FitTrackee/fittrackee/dist/static/js/main.8ecc731b.js

2 lines
63 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"),l=c("1626"),u=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(!l(t))return d(this,e);var c=a(t,this,e);if(null!==c&&!u(c))throw new i("RegExp exec method returned something other than an Object or null");return!!c}})},"0126":function(e,t,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"),l=c("2906"),u={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(l["a"])(),h=Object(r["toRefs"])(t),E=h.action,w=Object(r["reactive"])({username:"",email:"",password:"",password_conf:""}),N=Object(r["computed"])((function(){return V(t.action)})),g=Object(r["computed"])((function(){return y.getters[o["b"].GETTERS.ERROR_MESSAGES]})),S=Object(r["computed"])((function(){return y.getters[o["b"].GETTERS.APP_CONFIG]})),B=Object(r["computed"])((function(){return"register"===t.action&&!S.value.is_registration_enabled})),_=Object(r["ref"])(!1);function V(e){switch(e){case"reset-request":case"reset":return"buttons.SUBMIT";default:return"buttons.".concat(t.action.toUpperCase())}}function C(){_.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),_.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",u,[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:_.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"])(g)?(Object(r["openBlock"])(),Object(r["createBlock"])(a,{key:3,message:Object(r["unref"])(g)},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},"0ccb":function(e,t,c){var n=c("e330"),r=c("50c4"),a=c("577e"),o=c("1148"),l=c("1d80"),u=n(o),s=n("".slice),i=Math.ceil,d=function(e){return function(t,c,n){var o,d,b=a(l(t)),O=r(c),j=b.length,f=void 0===n?" ":a(n);return O<=j||""==f?b:(o=O-j,d=u(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)}},1288:function(e,t,c){},1574:function(e,t,c){"use strict";c("e79b")},"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")},"27c7":function(e,t,c){"use strict";c("cfca")},"31e7":function(e,t,c){"use strict";c("42ed")},"42ed":function(e,t,c){},"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)}})},"52bb":function(e,t,c){"use strict";c("1288")},"605d1":function(e,t,c){},"6f18":function(e,t,c){"use strict";c("aa01")},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 l(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 u(){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)||l(e)||u()}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 l=j(n,r)===-a;k(Object(b["a"])(e))&&1===o&&1===j(e,r)&&(l=!1),c=a*(o-Number(l))}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 g=c("8923");function S(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 S({},e)}var _=c("2420"),V=1440,C=2520,D=43200,T=86400;function I(e,t){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object(O["a"])(2,arguments);var n=c.locale||g["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,l=B(c);l.addSuffix=Boolean(c.addSuffix),l.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 u,s=N(o,a),i=(Object(_["a"])(o)-Object(_["a"])(a))/1e3,d=Math.round((s-i)/60);if(d<2)return c.includeSeconds?s<5?n.formatDistance("lessThanXSeconds",5,l):s<10?n.formatDistance("lessThanXSeconds",10,l):s<20?n.formatDistance("lessThanXSeconds",20,l):s<40?n.formatDistance("halfAMinute",null,l):s<60?n.formatDistance("lessThanXMinutes",1,l):n.formatDistance("xMinutes",1,l):0===d?n.formatDistance("lessThanXMinutes",1,l):n.formatDistance("xMinutes",d,l);if(d<45)return n.formatDistance("xMinutes",d,l);if(d<90)return n.formatDistance("aboutXHours",1,l);if(d<V){var f=Math.round(d/60);return n.formatDistance("aboutXHours",f,l)}if(d<C)return n.formatDistance("xDays",1,l);if(d<D){var p=Math.round(d/V);return n.formatDistance("xDays",p,l)}if(d<T)return u=Math.round(d/D),n.formatDistance("aboutXMonths",u,l);if(u=v(o,a),u<12){var m=Math.round(d/D);return n.formatDistance("xMonths",m,l)}var k=u%12,y=Math.floor(u/12);return k<3?n.formatDistance("aboutXYears",y,l):k<9?n.formatDistance("overXYears",y,l):n.formatDistance("almostXYears",y+1,l)}var R=c("68c6"),M=c("c46a"),x=c("dad5"),A=c("2906"),U=c("5e65"),L=function(e){return Object(n["pushScopeId"])("data-v-3af563d1"),e=e(),Object(n["popScopeId"])(),e},F={class:"timeline-workout"},$={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=L((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1)})),X={key:0},J={class:"data"},Q=L((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-road","aria-hidden":"true"},null,-1)})),Z={key:0,class:"data elevation"},ee=["alt"],te={class:"data-values"},ce=Object(n["createTextVNode"])("/ "),ne={key:1,class:"data altitude"},re=L((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1)})),ae={class:"data-values"},oe=Object(n["createTextVNode"])(" +"),le=Object(n["createTextVNode"])("/- "),ue=Object(n["defineComponent"])({props:{user:null,useImperialUnits: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,l=r.sport,u=r.useImperialUnits,s=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"),i=Object(n["resolveComponent"])("Distance");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",F,[Object(n["createElementVNode"])("div",$,[Object(n["createElementVNode"])("div",P,[Object(n["createElementVNode"])("div",G,[Object(n["createVNode"])(M["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"])(U["c"])(Object(n["unref"])(o).workout_date,Object(n["unref"])(a).timezone),"dd/MM/yyyy HH:mm")},Object(n["toDisplayString"])(Object(n["unref"])(I)(new Date(Object(n["unref"])(o).workout_date),new Date,{addSuffix:!0,locale:Object(n["unref"])(s)})),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"])(R["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"])(l).label?(Object(n["openBlock"])(),Object(n["createBlock"])(r,{key:0,"sport-label":Object(n["unref"])(l).label,color:Object(n["unref"])(l).color},null,8,["sport-label","color"])):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).id?(Object(n["openBlock"])(),Object(n["createBlock"])(i,{key:0,distance:Object(n["unref"])(o).distance,digits:3,unitFrom:"km",useImperialUnits:Object(n["unref"])(u)},null,8,["distance","useImperialUnits"])):Object(n["createCommentVNode"])("",!0)]),Object(n["unref"])(o)&&Object(n["unref"])(o).with_gpx?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Z,[Object(n["createElementVNode"])("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:e.$t("workouts.ELEVATION")},null,8,ee),Object(n["createElementVNode"])("div",te,[Object(n["unref"])(o).id?(Object(n["openBlock"])(),Object(n["createBlock"])(i,{key:0,distance:Object(n["unref"])(o).min_alt,unitFrom:"m",displayUnit:!1,useImperialUnits:Object(n["unref"])(u)},null,8,["distance","useImperialUnits"])):Object(n["createCommentVNode"])("",!0),ce,Object(n["unref"])(o).id?(Object(n["openBlock"])(),Object(n["createBlock"])(i,{key:1,distance:Object(n["unref"])(o).max_alt,unitFrom:"m",useImperialUnits:Object(n["unref"])(u)},null,8,["distance","useImperialUnits"])):Object(n["createCommentVNode"])("",!0)])])):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,[oe,Object(n["unref"])(o).id?(Object(n["openBlock"])(),Object(n["createBlock"])(i,{key:0,distance:Object(n["unref"])(o).ascent,unitFrom:"m",displayUnit:!1,useImperialUnits:Object(n["unref"])(u)},null,8,["distance","useImperialUnits"])):Object(n["createCommentVNode"])("",!0),le,Object(n["unref"])(o).id?(Object(n["openBlock"])(),Object(n["createBlock"])(i,{key:1,distance:Object(n["unref"])(o).descent,unitFrom:"m",useImperialUnits:Object(n["unref"])(u)},null,8,["distance","useImperialUnits"])):Object(n["createCommentVNode"])("",!0)])])):Object(n["createCommentVNode"])("",!0)],2)])])}}}),se=(c("27c7"),c("6b0d")),ie=c.n(se);const de=ie()(ue,[["__scopeId","data-v-3af563d1"]]);var be=de,Oe=c("1724"),je=c("9230"),fe={id:"timeline"},pe={class:"section-title"},me={key:0},ke={key:1},ve={key:1,class:"more-workouts"},ye=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,l=Object(n["ref"])(1),u=5,d=t.user.nb_workouts>=u?u: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:l.value,per_page:u},je["a"]))}function f(){l.value+=1,c.dispatch(x["f"].ACTIONS.GET_MORE_TIMELINE_WORKOUTS,Object(i["a"])({page:l.value,per_page:u},je["a"]))}return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",fe,[Object(n["createElementVNode"])("div",pe,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",me,[(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"])(be,{user:Object(n["unref"])(o),useImperialUnits:Object(n["unref"])(o).imperial_units,key:e},null,8,["user","useImperialUnits"])})),128))])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ke,[(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"])(be,{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),useImperialUnits:Object(n["unref"])(o).imperial_units,key:e.id},null,8,["workout","sport","user","useImperialUnits"])})),128)),0===Object(n["unref"])(b).length?(Object(n["openBlock"])(),Object(n["createBlock"])(Oe["a"],{key:0})):Object(n["createCommentVNode"])("",!0),Object(n["unref"])(O)?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ve,[Object(n["createElementVNode"])("button",{onClick:f},Object(n["toDisplayString"])(e.$t("workouts.LOAD_MORE_WORKOUT")),1)])):Object(n["createCommentVNode"])("",!0)]))])}}});c("31e7");const he=ie()(ye,[["__scopeId","data-v-b1432ee2"]]);var Ee=he,we=c("74b5"),Ne=c("a618"),ge=(c("caad"),c("f7f1"));function Se(e){Object(O["a"])(1,arguments);var t=Object(b["a"])(e);return t.setHours(0,0,0,0),t}function Be(e,t){Object(O["a"])(2,arguments);var c=Se(e),n=Se(t);return c.getTime()===n.getTime()}function _e(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 Ve(e){return Object(O["a"])(1,arguments),Be(e,Date.now())}c("d81d");var Ce=["title"],De=Object(n["defineComponent"])({props:{workout:null,sportLabel:null,sportColor:null},setup:function(e){var t=e,c=Object(n["toRefs"])(t),r=c.workout,a=c.sportLabel;return function(t,c){var o=Object(n["resolveComponent"])("SportImage");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",{class:"calendar-workout",onClick:c[0]||(c[0]=function(e){return t.$router.push({name:"Workout",params:{workoutId:Object(n["unref"])(r).id}})})},[Object(n["createVNode"])(o,{"sport-label":Object(n["unref"])(a),title:Object(n["unref"])(r).title,color:e.sportColor},null,8,["sport-label","title","color"]),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(e){return" ".concat(t.$t("workouts.RECORD_".concat(e.record_type)))}))},null,8,Ce)):Object(n["createCommentVNode"])("",!0)])])}}});c("a57b");const Te=De;var Ie=Te,Re=(c("99af"),c("4fad"),{class:"donut-chart"}),Me={height:"34",width:"34",viewBox:"0 0 34 34"},xe=["stroke","stroke-dashoffset","transform"],Ae=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,l=16,u=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(l,", ").concat(u,")");return o=360*t+o,c}return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Re,[(Object(n["openBlock"])(),Object(n["createElementBlock"])("svg",Me,[(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:l,cy:u,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,xe)])})),128))]))])}}});const Ue=Ae;var Le=Ue,Fe=c("1119"),$e={class:"calendar-workouts-chart"},Pe={class:"workouts-count"},Ge={key:0,class:"workouts-pane"},ze={class:"more-workouts"},We=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,l=c.workouts,u=Object(n["ref"])(!0);function s(e){e.stopPropagation(),u.value=!u.value}return function(e,t){var c=Object(n["resolveDirective"])("click-outside");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",$e,[Object(n["createElementVNode"])("div",{class:"workouts-chart",onClick:s},[Object(n["createElementVNode"])("div",Pe,Object(n["toDisplayString"])(Object(n["unref"])(l).length),1),Object(n["createVNode"])(Le,{datasets:Object(n["unref"])(a),colors:Object(n["unref"])(r)},null,8,["datasets","colors"])]),u.value?Object(n["createCommentVNode"])("",!0):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Ge,[Object(n["withDirectives"])(Object(n["createElementVNode"])("div",ze,[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"])(l),(function(e,t){return Object(n["openBlock"])(),Object(n["createBlock"])(Ie,{key:t,workout:e,sportLabel:Object(n["unref"])(Fe["b"])(e,Object(n["unref"])(o))},null,8,["workout","sportLabel"])})),128))],512),[[c,s]])]))])}}});c("aca6");const qe=ie()(We,[["__scopeId","data-v-7529132c"]]);var Ye=qe,He={class:"calendar-workouts"},Ke={class:"desktop-display"},Xe={key:0,class:"workouts-display"},Je={key:1,class:"donut-display"},Qe={class:"mobile-display"},Ze={key:0,class:"donut-display"},et=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(je["c"])(t.workouts)})),l=Object(n["computed"])((function(){return Object(Fe["d"])(t.sports)})),u=6;return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",He,[Object(n["createElementVNode"])("div",Ke,[Object(n["unref"])(r).length<=u?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Xe,[(Object(n["openBlock"])(!0),Object(n["createElementBlock"])(n["Fragment"],null,Object(n["renderList"])(Object(n["unref"])(r).slice(0,u),(function(e,t){return Object(n["openBlock"])(),Object(n["createBlock"])(Ie,{key:t,workout:e,sportLabel:Object(n["unref"])(Fe["b"])(e,Object(n["unref"])(a)),sportColor:Object(n["unref"])(Fe["a"])(e,Object(n["unref"])(a))},null,8,["workout","sportLabel","sportColor"])})),128))])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Je,[Object(n["createVNode"])(Ye,{workouts:Object(n["unref"])(r),sports:Object(n["unref"])(a),datasets:Object(n["unref"])(o),colors:Object(n["unref"])(l)},null,8,["workouts","sports","datasets","colors"])]))]),Object(n["createElementVNode"])("div",Qe,[Object(n["unref"])(r).length>0?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Ze,[Object(n["createVNode"])(Ye,{workouts:Object(n["unref"])(r),sports:Object(n["unref"])(a),datasets:Object(n["unref"])(o),colors:Object(n["unref"])(l)},null,8,["workouts","sports","datasets","colors"])])):Object(n["createCommentVNode"])("",!0)])])}}});c("7340");const tt=et;var ct=tt,nt={class:"calendar-cells"},rt={class:"calendar-cell-day"},at=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,l=c.startDate,u=c.timezone,s=c.weekStartingMonday,i=c.workouts,b=Object(n["ref"])([]);function O(){b.value=[];var e=l.value;while(e<=a.value){for(var t=[],c=0;c<7;c++)t.push(e),e=Object(ge["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 Be(Object(U["c"])(t.workout_date,u),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",nt,[(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"])(_e)(e,Object(n["unref"])(r)),"week-end":j(t),today:Object(n["unref"])(Ve)(e)}]),key:t},[Object(n["createVNode"])(ct,{workouts:f(e,Object(n["unref"])(i)),sports:Object(n["unref"])(o)},null,8,["workouts","sports"]),Object(n["createElementVNode"])("div",rt,Object(n["toDisplayString"])(Object(n["unref"])(d["a"])(e,"d")),1)],2)})),128))])})),128))])}}});c("a86d");const ot=at;var lt=ot,ut={class:"calendar-days"},st=Object(n["defineComponent"])({props:{startDate:null,localeOptions:null},setup:function(e){for(var t=e,c=[],r=0;r<7;r++)c.push(Object(ge["a"])(t.startDate,r));return function(t,r){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ut,[(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 it=st;var dt=it,bt={class:"calendar-header"},Ot=Object(n["createElementVNode"])("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1),jt=[Ot],ft={class:"calendar-month"},pt=Object(n["createElementVNode"])("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1),mt=[pt],kt=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,l=a.localeOptions;return function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",bt,[Object(n["createElementVNode"])("div",{class:"calendar-arrow calendar-arrow-left",onClick:t[0]||(t[0]=function(e){return c("displayPreviousMonth")})},jt),Object(n["createElementVNode"])("div",ft,[Object(n["createElementVNode"])("span",null,Object(n["toDisplayString"])(Object(n["unref"])(d["a"])(Object(n["unref"])(o),"MMM yyyy",{locale:Object(n["unref"])(l)})),1)]),Object(n["createElementVNode"])("div",{class:"calendar-arrow calendar-arrow-right",onClick:t[1]||(t[1]=function(e){return c("displayNextMonth")})},mt)])}}});c("1a1f");const vt=kt;var yt=vt,ht={id:"user-calendar"},Et={class:"calendar-card box"},wt=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,l="yyyy-MM-dd",u=Object(n["ref"])(new Date),s=Object(n["ref"])(Object(U["b"])(u.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(U["b"])(u.value,t.user.weekm);var e=Object(i["a"])({from:Object(d["a"])(s.value.start,l),to:Object(d["a"])(s.value.end,l),page:1,per_page:100},je["a"]);c.dispatch(x["f"].ACTIONS.GET_CALENDAR_WORKOUTS,e)}function f(){u.value=Object(we["a"])(u.value,1),j()}function p(){u.value=Object(Ne["a"])(u.value,1),j()}return Object(n["onBeforeMount"])((function(){return j()})),function(e,t){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",ht,[Object(n["createElementVNode"])("div",Et,[Object(n["createVNode"])(yt,{day:Object(n["unref"])(u),"locale-options":Object(n["unref"])(O),onDisplayNextMonth:f,onDisplayPreviousMonth:p},null,8,["day","locale-options"]),Object(n["createVNode"])(dt,{"start-date":Object(n["unref"])(s).start,"locale-options":Object(n["unref"])(O)},null,8,["start-date","locale-options"]),Object(n["createVNode"])(lt,{currentDay:Object(n["unref"])(u),"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 Nt=wt;var gt=Nt,St=c("f628"),Bt=c("ec59"),_t={class:"user-month-stats"},Vt=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,l={duration:"week",start:Object(St["a"])(o),end:Object(m["a"])(o)},u=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",_t,[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"])(Bt["a"],{sports:Object(n["unref"])(r),user:Object(n["unref"])(a),"chart-params":l,"displayed-sport-ids":Object(n["unref"])(u),"hide-chart-if-no-data":!0},null,8,["sports","user","displayed-sport-ids"])]})),_:1})])}}});c("bd2d");const Ct=ie()(Vt,[["__scopeId","data-v-7926683e"]]);var Dt=Ct,Tt=(c("b64b"),c("4e82"),c("47e2")),It={class:"records-card"},Rt={class:"record-type"},Mt={class:"record-value"},xt={class:"record-date"},At=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"),l=Object(n["resolveComponent"])("Card");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",It,[Object(n["createVNode"])(l,null,{title:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(c,{"sport-label":Object(n["unref"])(r).label,color:Object(n["unref"])(r).color},null,8,["sport-label","color"]),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",Rt,Object(n["toDisplayString"])(e.$t("workouts.RECORD_".concat(t.record_type))),1),Object(n["createElementVNode"])("span",Mt,Object(n["toDisplayString"])(t.value),1),Object(n["createElementVNode"])("span",xt,[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("52bb");const Ut=ie()(At,[["__scopeId","data-v-781bb13e"]]);var Lt=Ut,Ft=(c("7db0"),c("6284")),$t=function(e,t,c){var n,r="km",a=c?Ft["c"][r].defaultTarget:r;switch(e.record_type){case"AS":case"MS":n="".concat(Object(Ft["a"])(+e.value,r,a,2)," ").concat(a,"/h");break;case"FD":n="".concat(Object(Ft["a"])(+e.value,r,a,3)," ").concat(a);break;case"LD":n=e.value;break;default:throw new Error('Invalid record type, expected: "AS", "FD", "LD", "MD", got: "'.concat(e.record_type,'"'))}return{workout_date:Object(U["a"])(Object(U["c"])(e.workout_date,t)).workout_date,workout_id:e.workout_id,id:e.id,record_type:e.record_type,value:n}},Pt=function(e,t,c,n){return e.reduce((function(e,r){var a=t.find((function(e){return e.id===r.sport_id}));return a&&a.label&&(void 0===e[a.translatedLabel]&&(e[a.translatedLabel]={label:a.label,color:a.color,records:[]}),e[a.translatedLabel].records.push($t(r,c,n))),e}),{})},Gt=function(e){return Object(n["pushScopeId"])("data-v-122c3994"),e=e(),Object(n["popScopeId"])(),e},zt={class:"user-records-section"},Wt={class:"section-title"},qt=Gt((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-trophy custom-fa-small","aria-hidden":"true"},null,-1)})),Yt={class:"user-records"},Ht={key:0,class:"no-records"},Kt=Object(n["defineComponent"])({props:{sports:null,user:null},setup:function(e){var t=e,c=Object(Tt["b"])(),r=c.t,a=Object(n["computed"])((function(){return Pt(t.user.records,Object(Fe["e"])(t.sports,r),t.user.timezone,t.user.imperial_units)}));return function(t,c){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",zt,[Object(n["createElementVNode"])("div",Wt,[qt,Object(n["createTextVNode"])(" "+Object(n["toDisplayString"])(t.$t("workouts.RECORD",2)),1)]),Object(n["createElementVNode"])("div",Yt,[0===Object.keys(Object(n["unref"])(a)).length?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",Ht,Object(n["toDisplayString"])(t.$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(t){return Object(n["openBlock"])(),Object(n["createBlock"])(Lt,{sportTranslatedLabel:t,records:Object(n["unref"])(a)[t],key:t,useImperialUnits:e.user.imperial_units},null,8,["sportTranslatedLabel","records","useImperialUnits"])})),128))])])}}});c("f9e5");const Xt=ie()(Kt,[["__scopeId","data-v-122c3994"]]);var Jt=Xt,Qt=(c("b680"),c("466d"),c("1276"),c("05d9")),Zt={id:"user-stats"},ec=Object(n["defineComponent"])({props:{user:null},setup:function(e){var t=e,c=Object(Tt["b"])(),r=c.t,a=Object(n["toRefs"])(t),o=a.user,l=Object(n["computed"])((function(){return t.user.total_duration})),u=Object(n["computed"])((function(){return b(l)})),s="km",i=o.value.imperial_units?Ft["c"][s].defaultTarget:s,d=o.value.imperial_units?Object(Ft["a"])(o.value.total_distance,s,i,2):parseFloat(o.value.total_distance.toFixed(2));function b(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",Zt,[Object(n["createVNode"])(Qt["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"])(Qt["a"],{icon:"road",value:Object(n["unref"])(d),text:"mi"===Object(n["unref"])(i)?"miles":Object(n["unref"])(i)},null,8,["value","text"]),Object(n["createVNode"])(Qt["a"],{icon:"clock-o",value:Object(n["unref"])(u).days,text:Object(n["unref"])(u).duration},null,8,["value","text"]),Object(n["createVNode"])(Qt["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("8ea4");const tc=ec;var cc=tc,nc=function(e){return Object(n["pushScopeId"])("data-v-5590d1e6"),e=e(),Object(n["popScopeId"])(),e},rc={key:0,id:"dashboard",class:"view"},ac={class:"container mobile-menu"},oc={class:"box"},lc=nc((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-calendar","aria-hidden":"true"},null,-1)})),uc=[lc],sc=nc((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-bar-chart","aria-hidden":"true"},null,-1)})),ic=[sc],dc=nc((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-map-o","aria-hidden":"true"},null,-1)})),bc=[dc],Oc=nc((function(){return Object(n["createElementVNode"])("i",{class:"fa fa-trophy","aria-hidden":"true"},null,-1)})),jc=[Oc],fc={class:"container"},pc={class:"container dashboard-container"},mc={class:"left-container dashboard-sub-container"},kc={class:"right-container dashboard-sub-container"},vc=nc((function(){return Object(n["createElementVNode"])("div",{id:"bottom"},null,-1)})),yc={key:1,class:"app-loading"},hc=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 l=Object(n["resolveComponent"])("Loader");return Object(n["unref"])(c).username&&Object(n["unref"])(r).length>0?(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",rc,[Object(n["createElementVNode"])("div",ac,[Object(n["createElementVNode"])("div",oc,[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")})},uc,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")})},ic,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")})},bc,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")})},jc,2)])]),Object(n["createElementVNode"])("div",fc,[Object(n["createVNode"])(cc,{user:Object(n["unref"])(c)},null,8,["user"])]),Object(n["createElementVNode"])("div",pc,[Object(n["createElementVNode"])("div",mc,[Object(n["createVNode"])(Dt,{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"])(Jt,{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",kc,[Object(n["createVNode"])(gt,{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"])(Ee,{sports:Object(n["unref"])(r),user:Object(n["unref"])(c),class:Object(n["normalizeClass"])({"is-hidden":!("timeline"===a.value)})},null,8,["sports","user","class"])])]),vc])):(Object(n["openBlock"])(),Object(n["createElementBlock"])("div",yc,[Object(n["createVNode"])(l)]))}}});c("918a");const Ec=ie()(hc,[["__scopeId","data-v-5590d1e6"]]);t["default"]=Ec},7340:function(e,t,c){"use strict";c("fd77")},7416:function(e,t,c){"use strict";c.d(t,"a",(function(){return V})),c.d(t,"b",(function(){return C})),c.d(t,"c",(function(){return D}));c("d81d"),c("caad"),c("4de4"),c("d3b7"),c("2532");var n=c("b166"),r=c("d6e9"),a=c("fe1f"),o=c("cdb6"),l=c("8c86");function u(e,t){Object(l["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(l["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(l["a"])(2,arguments);var c=Object(a["a"])(t),n=7*c;return Object(p["a"])(e,n)}function k(e,t){Object(l["a"])(2,arguments);var c=Object(a["a"])(t);return m(e,-c)}var v=c("74b5"),y=c("5e65"),h=c("1119"),E=c("6284"),w={week:{api:"yyyy-MM-dd",chart:"dd/MM/yyyy"},month:{api:"yyyy-MM",chart:"MM/yyyy"},year:{api:"yyyy",chart:"yyyy"}},N=["average_speed","nb_workouts","total_duration","total_distance","total_ascent","total_descent"],g=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){var c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n={label:e,backgroundColor:[t],data:[]};return c&&(n.type="line",n.borderColor=[t],n.spanGaps=!0),n},B=function(e){var t={average_speed:[],nb_workouts:[],total_distance:[],total_duration:[],total_ascent:[],total_descent:[]};return e.map((function(e){var c=e.color?e.color:h["c"][e.label];t.average_speed.push(S(e.label,c,!0)),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},_=function(e,t,c){switch(e){case"average_speed":case"total_distance":case"total_ascent":case"total_descent":return Object(E["b"])(["average_speed","total_distance"].includes(e)?"km":"m",t,c);default:case"nb_workouts":case"total_duration":return t}},V=function(e,t,c,r,a,o){var l=g(e,t),u=w[e.duration],s=c.filter((function(e){return r.includes(e.id)})),i=[],d=B(s),b={};return s.map((function(e){return b[e.label]=e.id})),l.map((function(e){var t=Object(n["a"])(e,u.api),c=Object(n["a"])(e,u.chart);i.push(c),N.map((function(e){d[e].map((function(c){c.data.push(a!=={}&&t in a&&b[c.label]in a[t]?_(e,a[t][b[c.label]][e],o):"average_speed"===e?null:0)}))}))})),{labels:i,datasets:d}},C=function(e,t,c){var n=c?1:0,a="year"===t?Object(r["a"])(u(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}},D=function(e,t,c){var n=e.duration,a=e.start,l=e.end,b=c?1:0;return{duration:n,end:"year"===n?O(t?u(l,1):Object(o["a"])(l,1)):"week"===n?Object(j["a"])(t?k(l,1):m(l,1),{weekStartsOn:b}):Object(f["a"])(t?Object(i["a"])(l,1):Object(v["a"])(l,1)),start:"year"===n?Object(r["a"])(t?u(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))}}},"84f7":function(e,t,c){},"85bb":function(e,t,c){"use strict";c("1e7c")},8917:function(e,t,c){"use strict";c("c091")},"8ea4":function(e,t,c){"use strict";c("f587")},"918a":function(e,t,c){"use strict";c("84f7")},"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")},a57b:function(e,t,c){"use strict";c("f33d")},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")},aa01:function(e,t,c){},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){},c59c:function(e,t,c){},c77e:function(e,t,c){},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"},l={class:"chart-arrow"},u={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",l,[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",u,[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"])(),l=o.t,u=Object(n["inject"])("sportColors"),s=Object(n["toRefs"])(a),i=s.selectedSportIds,d=Object(n["computed"])((function(){return Object(m["e"])(a.userSports,l)}));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:e.color?e.color:Object(n["unref"])(u)[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,color:e.color},null,8,["sport-label","color"]),Object(n["createElementVNode"])("span",y,Object(n["toDisplayString"])(e.translatedLabel),1)],4)})),128))])}}});c("f048");const E=h;var w=E,N=c("7416"),g={key:0,id:"user-statistics"},S=Object(n["defineComponent"])({props:{sports:null,user:null},setup:function(e){var t=e,c=Object(r["b"])(),o=c.t,l=Object(n["toRefs"])(t),u=l.sports,s=l.user,i=Object(n["ref"])("month"),d=Object(n["ref"])(f(i.value)),b=Object(n["computed"])((function(){return Object(m["e"])(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",g,[Object(n["createVNode"])(p,{onTimeFrameUpdate:j,onArrowClick:k}),Object(n["createVNode"])(a["a"],{sports:Object(n["unref"])(u),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"])(u),onSelectedSportIdsUpdate:y},null,8,["selected-sport-ids","user-sports"])])):Object(n["createCommentVNode"])("",!0)}}});c("1574");const B=j()(S,[["__scopeId","data-v-fbf1fdc8"]]);var _=B,V=c("1724"),C=c("dad5"),D=c("2906"),T={id:"statistics",class:"view"},I={key:0,class:"container"},R=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",I,[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"])(_,{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"])(V["a"],{key:0})):Object(n["createCommentVNode"])("",!0)])):Object(n["createCommentVNode"])("",!0)])}}});c("a986");const M=j()(R,[["__scopeId","data-v-3d90c110"]]);t["default"]=M},cfca:function(e,t,c){},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 l=c("6b0d"),u=c.n(l);const s={},i=u()(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"),l=c("1a2d"),u=c("1626"),s=c("3a9b"),i=c("577e"),d=c("9bf2").f,b=c("e893"),O=a.Symbol,j=O&&O.prototype;if(r&&u(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(l(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 l=o;t["default"]=l},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},l={class:"chart-radio"},u=["checked"],s=["checked"],i=["checked"],d={key:0},b=["checked"],O={key:1},j=["checked"],f={key:2},p=["checked"];function m(e,t,c,m,k,v){var y=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",l,[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,u),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:"average_speed",checked:"average_speed"===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.AVERAGE_SPEED")),1)])):Object(n["createCommentVNode"])("",!0),e.fullStats?(Object(n["openBlock"])(),Object(n["createElementBlock"])("label",O,[Object(n["createElementVNode"])("input",{type:"radio",name:"total_ascent",checked:"total_ascent"===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.ASCENT")),1)])):Object(n["createCommentVNode"])("",!0),e.fullStats?(Object(n["openBlock"])(),Object(n["createElementBlock"])("label",f,[Object(n["createElementVNode"])("input",{type:"radio",name:"total_descent",checked:"total_descent"===e.displayedData,onClick:t[5]||(t[5]=function(){return e.updateDisplayData&&e.updateDisplayData.apply(e,arguments)})},null,8,p),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"])(y,{key:0,datasets:e.datasets,labels:e.labels,displayedData:e.displayedData,displayedSportIds:e.displayedSportIds,fullStats:e.fullStats,useImperialUnits:e.user.imperial_units},null,8,["datasets","labels","displayedData","displayedSportIds","fullStats","useImperialUnits"])):Object(n["createCommentVNode"])("",!0)]))])}var k=c("1da1"),v=(c("96cf"),c("b0c0"),c("b64b"),c("b166")),y={class:"chart"};function h(e,t,c,r,a,o){var l=Object(n["resolveComponent"])("BarChart");return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",y,[Object(n["createVNode"])(l,Object(n["mergeProps"])(e.barChartProps,{class:"bar-chart"}),null,16)])}c("e9c4"),c("d3b7"),c("d81d");var E=c("b48c"),w=c("47e2"),N=(c("99af"),c("b680"),c("25f0"),c("4d90"),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)}),g=c("6284"),S=function(e,t,c){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r="km",a=c?g["c"][r].defaultTarget:r;switch(e){case"average_speed":return"".concat(t.toFixed(2)," ").concat(a,"/h");case"total_duration":return N(t,n);case"total_distance":return"".concat(t.toFixed(2)," ").concat(a);case"total_ascent":case"total_descent":return"".concat((t/1e3).toFixed(2)," ").concat(a);default:return t.toString()}},B=Object(n["defineComponent"])({name:"Chart",components:{BarChart:E["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},useImperialUnits:{type:Boolean,required:!0}},setup:function(e){var t=Object(w["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))}})),l=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:"average_speed"!==e.displayedData,grid:{drawOnChartArea:!1},ticks:{maxTicksLimit:6,callback:function(t){return S(e.displayedData,+t,e.useImperialUnits,!1)}},afterFit:function(t){t.width=e.fullStats?75:60}}},plugins:{datalabels:{anchor:"end",align:"end",color:function(t){return"average_speed"===e.displayedData&&t.dataset.backgroundColor?t.dataset.backgroundColor[0]:"#666666"},rotation:function(t){return e.fullStats&&t.chart.chartArea.width<580?310:0},display:function(t){return!(e.fullStats&&t.chart.chartArea.width<300)&&("average_speed"!==e.displayedData||1==e.displayedSportIds.length&&"auto")},formatter:function(t,c){if("average_speed"===e.displayedData)return S(e.displayedData,t,e.useImperialUnits,!1);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?S(e.displayedData,n,e.useImperialUnits,!1):null}},legend:{display:!1},tooltip:{interaction:{intersect:!0,mode:"index",position:"average_speed"===e.displayedData?"nearest":"average"},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+=S(e.displayedData,t.parsed.y,e.useImperialUnits)),n},footer:function(t){if("average_speed"===e.displayedData)return"";var n=0;return t.map((function(e){n+=e.parsed.y})),"".concat(c("common.TOTAL"),": ")+S(e.displayedData,n,e.useImperialUnits)}}}}}})),u=Object(E["useBarChart"])({chartData:o,options:l}),s=u.barChartProps;return{barChartProps:s}}}),_=c("6b0d"),V=c.n(_);const C=V()(B,[["render",h]]);var D=C,T=c("dad5"),I=c("2906"),R=c("7416"),M=Object(n["defineComponent"])({name:"UserMonthStats",components:{Chart:D},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(I["a"])(),c=Object(n["ref"])("total_distance"),r=Object(n["computed"])((function(){return t.getters[T["d"].GETTERS.USER_STATS]})),a=Object(n["computed"])((function(){return Object(R["a"])(e.chartParams,e.user.weekm,e.sports,e.displayedSportIds,r.value,e.user.imperial_units)}));function o(c){t.dispatch(T["d"].ACTIONS.GET_USER_STATS,{username:e.user.username,filterType:"by_time",params:c})}function l(e){c.value=e.target.name}function u(e,t){return{from:Object(v["a"])(e.start,"yyyy-MM-dd"),to:Object(v["a"])(e.end,"yyyy-MM-dd"),time:"week"===e.duration?"week".concat(t.weekm?"m":""):e.duration}}return Object(n["onBeforeMount"])((function(){return o(u(e.chartParams,e.user))})),Object(n["watch"])((function(){return e.chartParams}),function(){var t=Object(k["a"])(regeneratorRuntime.mark((function t(c){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:o(u(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:l}}});c("6f18");const x=V()(M,[["render",m],["__scopeId","data-v-53f6491c"]]);t["a"]=x},efea:function(e,t,c){},f048:function(e,t,c){"use strict";c("c59c")},f33d:function(e,t,c){},f587:function(e,t,c){},f831:function(e,t,c){},f9e5:function(e,t,c){"use strict";c("0126")},fb6a:function(e,t,c){"use strict";var n=c("23e7"),r=c("da84"),a=c("e8b5"),o=c("68ee"),l=c("861d"),u=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=u(e,O),v=u(void 0===t?O:t,O);if(a(b)&&(c=b.constructor,o(c)&&(c===m||a(c.prototype))?c=void 0:l(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}})},fd77:function(e,t,c){}}]);
//# sourceMappingURL=main.8ecc731b.js.map