FitTrackee/fittrackee_api/dist/static/js/main.e589eaf8.chunk.js.map

1 line
330 KiB
Plaintext

{"version":3,"sources":["locales/index.js","locales/en/resources.js","locales/fr/resources.js","i18n.js","components/Common/Message.jsx","utils/index.js","fitTrackeeApi/index.js","actions/index.js","actions/application.js","components/Admin/AdminApplication.jsx","components/Admin/AdminStats.jsx","components/Admin/AdminDashboard.jsx","components/Admin/AdminSports.jsx","components/Common/Pagination.jsx","components/Admin/AdminUsers.jsx","components/Others/NotFound.jsx","components/Admin/index.jsx","utils/activities.js","fitTrackeeApi/auth.js","actions/user.js","actions/activities.js","components/Activity/ActivityForms/FormWithGpx.jsx","components/Activity/ActivityForms/FormWithoutGpx.jsx","components/Activity/ActivityAddOrEdit.jsx","components/Activity/ActivityAdd.jsx","components/Activity/ActivityDisplay/ActivityCardHeader.jsx","components/Activity/ActivityDisplay/ActivityCharts.jsx","components/Activity/ActivityDisplay/ActivityWeather.jsx","components/Activity/ActivityDisplay/ActivityDetails.jsx","components/Activity/ActivityDisplay/ActivityMap.jsx","components/Activity/ActivityDisplay/ActivityNoMap.jsx","components/Activity/ActivityDisplay/ActivityNotes.jsx","components/Activity/ActivityDisplay/ActivitySegments.jsx","components/Common/CustomModal.jsx","components/Activity/ActivityDisplay/index.jsx","components/Activity/ActivityEdit.jsx","components/Activity/index.jsx","components/Activities/ActivitiesFilter.jsx","components/Common/StaticMap.jsx","components/Activities/ActivitiesList.jsx","components/Common/NoActivities.jsx","components/Activities/index.jsx","components/User/ProfileDetail.jsx","components/User/CurrentUserProfile.jsx","components/Dashboard/ActivityCard.jsx","components/Dashboard/CalendarActivity.jsx","components/Dashboard/CalendarActivities.jsx","components/Dashboard/Calendar.jsx","components/Dashboard/Records.jsx","actions/stats.js","utils/stats.js","components/Common/Stats/CustomTooltip.jsx","components/Common/Stats/CustomLabel.jsx","components/Common/Stats/StatsChart.jsx","components/Common/Stats/index.jsx","components/Dashboard/Statistics.jsx","components/Dashboard/UserStatistics.jsx","components/Dashboard/index.jsx","components/Footer/index.jsx","components/User/Logout.jsx","images/flags/en.svg","images/flags/fr.svg","components/NavBar/LanguageDropdown.jsx","components/NavBar/index.jsx","images/password.svg","images/mail-send.svg","components/User/PasswordReset.jsx","components/User/ProfileEdit.jsx","components/Statistics/index.jsx","components/User/Form.jsx","components/User/UserForm.jsx","components/User/UserProfile.jsx","components/App.jsx","components/Root.jsx","registerServiceWorker.js","reducers/initial.js","utils/history.js","reducers/index.js","index.js"],"names":["resources","en","activities","administration","common","dashboard","messages","sports","statistics","user","fr","i18n","use","XHR","LanguageDetector","init","debug","process","lng","fallbackLng","keySeparator","interpolation","escapeValue","ns","defaultNS","Message","this","props","message","t","singleMessage","split","length","className","map","msg","key","id","value","React","PureComponent","suffixes","getFileSize","fileSize","asText","i","Math","floor","log","size","suffix","pow","toFixed","userFilters","label","sortOrders","isLoggedIn","window","localStorage","authToken","createApiRequest","params","headers","noAuthorization","Authorization","getItem","type","requestParams","method","body","JSON","stringify","request","Request","url","fetch","then","response","status","json","catch","error","console","Error","getDateWithTZ","date","tz","dt","DateTime","fromISO","format","Date","setZone","parse","toFormat","sortValues","a","b","valueALabel","toLowerCase","valueBLabel","translateValues","values","sort","formatUrl","pathname","query","username","Object","keys","filter","index","FitTrackeeApi","target","data","setData","setPaginatedData","pagination","setError","setLoading","loading","updateSportsData","updateUsersData","getOrUpdateData","action","canDispatch","dispatch","isNaN","ret","users","updateLanguage","language","i18next","changeLanguage","setLanguage","setAppConfig","getAppData","FitTrackeeGenericApi","getData","AdminApplication","context","state","formData","isInEdition","initForm","prevProps","appConfig","k","includes","setState","e","name","preventDefault","onHandleConfigFormSubmit","onSubmit","toggleInEdition","htmlFor","aria-hidden","title","min","max_users","onChange","handleFormChange","step","max_single_file_size","max_zip_file_size","gpx_limit_import","onClick","history","push","Component","connect","assign","updateData","updateAppConfig","AdminStats","loadAppStats","appStats","uploadDirSize","uploads_dir_size","withTranslation","application","AdminDashboard","to","is_registration_enabled","AdminSports","loadSports","updateSport","sport","src","img","alt","is_active","data-toggle","has_activities","sportId","isActive","Pagination","newQuery","page","pages","aria-label","has_prev","getUrl","aria-disabled","Array","from","_","has_next","AdminUsers","per_page","order_by","order","loadUsers","initState","location","authUser","updateUser","translatedFilters","translatedSortOrders","updatePage","picture","now","email","created_at","nb_activities","admin","disabled","router","userName","isAdmin","NotFound","useTranslation","Helmet","config","exact","path","render","component","activityColors","recordsLabels","record_type","formatActivityDate","dateTime","dateFormat","timeFormat","activity_date","activity_time","formatActivityDuration","seconds","newDate","subHours","setSeconds","getTime","formatChartData","chartData","time","duration","sortSports","sportALabel","sportBLabel","translateSports","onlyActive","PictureError","ProfileUpdateError","loadProfile","getProfile","isAuthenticated","profil","handleUserFormSubmit","formType","onlyPasswords","errMsg","password","password_conf","RegisterFormControl","arr","val","obj","generateIds","loginOrRegisterOrPasswordReset","setItem","auth_token","deleteUser","deleteData","r","setGpx","gpxContent","setChartData","editActivity","form","getMoreActivities","onAddActivity","FormData","append","gpxFile","files","notes","addDataWithFile","addActivity","onEditActivity","activity","sport_id","translatedSports","zipTooltip","fileSizeLimit","encType","event","defaultValue","required","Trans","i18nKey","data-placement","accept","maxLength","onAddOrEdit","d","distance","addData","activityDate","activityTime","activityDateTime","timezone","pattern","placeholder","ActivityAddEdit","withGpx","changeEvent","with_gpx","checked","handleRadioChange","ActivityAddOrEdit","ActivityCardHeader","dataType","displayModal","segmentId","previousUrl","previous_activity","nextUrl","segments","next_activity","ActivityCharts","displayDistance","dataToHide","loadActivityData","loadSegmentData","find","splice","indexOf","xDataKey","xScale","updateCoordinates","xInterval","parseInt","displayData","handleLegendChange","height","margin","top","right","left","bottom","onMouseMove","activePayload","onMouseLeave","allowDecimals","dataKey","offset","position","scale","interval","tickFormatter","angle","yAxisId","orientation","fill","stroke","dot","unit","strokeWidth","labelFormatter","activityId","chart_data","getActivityChartData","getSegmentChartData","ActivityWeather","weather_start","weather_end","icon","summary","Number","temperature","humidity","wind","ActivityDetails","withPauses","pauses","moving","records","ave_speed","max_speed","min_alt","max_alt","ascent","descent","ActivityMap","zoom","loadActivityGpx","loadSegmentGpx","coordinates","mapAttribution","jsonData","gpx","DOMParser","parseFromString","togeojson","getGeoJson","bounds","Map","boundsOptions","padding","TileLayer","attribution","GeoJSON","hash","latitude","Marker","longitude","map_attribution","getActivityGpx","getSegmentGpx","ActivityNoMap","ActivityNotes","ActivitySegments","segment","activity_id","CustomModal","close","text","confirm","ActivityDisplay","loadActivity","match","prevState","payload","onDeleteActivity","s","Promise","resolve","ActivityEdit","ActivityAdd","ActivitiesFilter","loadActivities","updateParams","StaticMap","display","href","rel","ActivitiesList","scope","idx","NoActivities","Activities","loadMoreActivities","paginationEnd","setParams","onDeletePicture","deletePicture","onUploadPicture","reset","uploadPicture","editable","isDeletable","createdAt","birthDate","birth_date","first_name","last_name","bio","weekm","go","ActivityCard","CalendarActivity","isDisabled","isMore","sportImg","rec","CalendarActivities","isHidden","dayActivities","act","handleDisplayMore","getStartAndEndMonth","weekStartOnMonday","monthStart","startOfMonth","monthEnd","endOfMonth","weekStartsOn","start","startOfWeek","end","endOfWeek","Calendar","calendarDate","currentMonth","startDate","endDate","loadMonthActivities","localeOptions","handlePrevMonth","handleNextMonth","days","addDays","day","isSameDay","rows","formattedDate","filterActivities","isSameMonth","isWeekEnd","isToday","addMonths","updateStateDate","subMonths","locale","enGB","renderHeader","renderDays","renderCells","calendarActivities","RecordsCard","recordsBySport","reduce","sportList","record","recordType","formatRecord","sportLabel","colSpan","xAxisFormats","xAxis","formatDuration","totalSeconds","formatWithDay","String","hours","padStart","minutes","formatValue","displayedData","dateIncrement","addYears","formatStats","stats","displayedSports","nbActivitiesStats","distanceStats","durationStats","x","xAxisFormat","dataNbActivities","dataDistance","dataDuration","total_distance","total_duration","startOfYear","CustomTooltip","active","total","p","style","color","CustomLabel","y","width","formattedValue","fontSize","textAnchor","dominantBaseline","StatsCharts","content","isAnimationActive","stackId","Statistics","statsParams","displayEmpty","getStats","Stats","UserStatistics","nb_sports","DashBoard","Footer","Logout","UserLogout","_extends","arguments","source","prototype","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","sourceKeys","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","createElement","_ref3","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","_ref10","_ref11","_ref12","_ref13","_ref14","_ref","svgRef","enableBackground","viewBox","ref","ForwardRef","forwardRef","languages","selected","flag","Dropdown","isOpen","onUpdateLanguage","toggleDropdown","lang","NavBar","data-target","aria-controls","aria-expanded","LanguageDropdown","xmlSpace","PasswordReset","ProfileEdit","onDeleteUser","onHandleProfileFormSubmit","readOnly","postData","handleProfileFormSubmit","durations","updateDisplayedSports","subYears","endOfYear","concat","forward","newStart","newEnd","subWeeks","addWeeks","sports_list","handleOnClickArrows","handleOnChangeDuration","handleOnChangeSports","Form","pageTitle","charAt","toUpperCase","slice","isRegistrationAllowed","userForm","onHandleFormChange","UserForm","emptyForm","onHandleUserFormSubmit","token","UserProfile","loadUser","currentUser","App","loadAppConfig","Dashboard","CurrentUserProfile","Activity","Admin","Root","store","children","isLocalhost","Boolean","hostname","registerValidSW","swUrl","navigator","serviceWorker","register","registration","onupdatefound","installingWorker","installing","onstatechange","controller","originalHistory","emptyData","handleDataAndError","initial","removeItem","routesWithoutAuthentication","updatePath","toPath","newPath","pathInterceptor","createBrowserHistory","args","replace","listen","scrollTo","rootNode","document","getElementById","createStore","combineReducers","connectRouter","__STATE__","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","compose","applyMiddleware","routerMiddleware","thunk","ReactDOM","I18nextProvider","URL","origin","addEventListener","get","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":"qvlBAGaA,EAAY,CACvBC,GCKyB,CACzBC,W,OACAC,e,OACAC,O,OACAC,U,OACAC,S,OACAC,O,OACAC,W,OACAC,K,QDZAC,GEIyB,CACzBR,W,OACAC,e,OACAC,O,OACAC,U,OACAC,S,OACAC,O,OACAC,W,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GAAgBC,MAGnBpmB,OAAM,WAELE,QAAQlC,IACN,oEA/DAkrB,CAAwB9C,GAGxBD,GAAgBC,OIIxB+C,K","file":"static/js/main.e589eaf8.chunk.js","sourcesContent":["import { enResources } from './en/resources'\nimport { frResources } from './fr/resources'\n\nexport const resources = {\n en: enResources,\n fr: frResources,\n}\n","import EnActivitiesTranslations from './activities.json'\nimport EnAdministrationTranslations from './administration.json'\nimport EnCommonTranslations from './common.json'\nimport EnDashboardTranslations from './dashboard.json'\nimport EnMessagesTranslations from './messages.json'\nimport EnSportsTranslations from './sports.json'\nimport EnStatisticsTranslations from './statistics.json'\nimport EnUserTranslations from './user.json'\n\nexport const enResources = {\n activities: EnActivitiesTranslations,\n administration: EnAdministrationTranslations,\n common: EnCommonTranslations,\n dashboard: EnDashboardTranslations,\n messages: EnMessagesTranslations,\n sports: EnSportsTranslations,\n statistics: EnStatisticsTranslations,\n user: EnUserTranslations,\n}\n","import FrActivitiesTranslations from './activities.json'\nimport FrAdministrationTranslations from './administration.json'\nimport FrCommonTranslations from './common.json'\nimport FrDashboardTranslations from './dashboard.json'\nimport FrMessagesTranslations from './messages.json'\nimport FrSportsTranslations from './sports.json'\nimport FrStatisticsTranslations from './statistics.json'\nimport FrUserTranslations from './user.json'\n\nexport const frResources = {\n activities: FrActivitiesTranslations,\n administration: FrAdministrationTranslations,\n common: FrCommonTranslations,\n dashboard: FrDashboardTranslations,\n messages: FrMessagesTranslations,\n sports: FrSportsTranslations,\n statistics: FrStatisticsTranslations,\n user: FrUserTranslations,\n}\n","import i18n from 'i18next'\nimport LanguageDetector from 'i18next-browser-languagedetector'\nimport XHR from 'i18next-xhr-backend'\n\nimport { resources } from './locales'\n\ni18n\n .use(XHR)\n .use(LanguageDetector)\n .init({\n debug: process.env.NODE_ENV === 'development',\n lng: 'en',\n fallbackLng: 'en',\n keySeparator: false,\n interpolation: {\n escapeValue: false,\n },\n resources,\n ns: ['common'],\n defaultNS: 'common',\n })\n\nexport default i18n\n","import React from 'react'\n\nexport default class Message extends React.PureComponent {\n render() {\n const { message, messages, t } = this.props\n const singleMessage =\n message === '' || !message\n ? ''\n : message.split('|').length > 1\n ? `${t(`messages:${message.split('|')[0]}`)}: ${t(\n `messages:${message.split('|')[1]}`\n )}`\n : t(`messages:${message}`)\n return (\n <div className=\"error-message\">\n {singleMessage !== '' && <code>{singleMessage}</code>}\n {messages && messages.length > 0 && (\n <code>\n <ul>\n {messages.map(msg => (\n <li key={msg.id}>{t(`messages:${msg.value}`)}</li>\n ))}\n </ul>\n </code>\n )}\n </div>\n )\n }\n}\n","import { format, parse } from 'date-fns'\nimport { DateTime } from 'luxon'\n\nconst suffixes = ['bytes', 'KB', 'MB', 'GB', 'TB']\nexport const getFileSize = (fileSize, asText = true) => {\n const i = Math.floor(Math.log(fileSize) / Math.log(1024))\n if (!fileSize) {\n return asText ? '0 bytes' : { size: 0, suffix: 'bytes' }\n }\n const size = (fileSize / Math.pow(1024, i)).toFixed(1)\n const suffix = suffixes[i]\n return asText ? `${size}${suffix}` : { size, suffix }\n}\n\nexport const getFileSizeInMB = fileSize => {\n const value = fileSize / 1048576\n return (!fileSize && 0) || +value.toFixed(2)\n}\n\nexport const version = '0.3.0-beta' // version stored in 'utils' for now\nexport const apiUrl =\n process.env.NODE_ENV === 'production'\n ? '/api/'\n : `${process.env.REACT_APP_API_URL}/api/`\n\nexport const userFilters = [\n { key: 'activities_count', label: 'activities count' },\n { key: 'admin', label: 'admin rights' },\n { key: 'created_at', label: 'registration date' },\n { key: 'username', label: 'user name' },\n]\n\nexport const sortOrders = [\n { key: 'asc', label: 'ascending' },\n { key: 'desc', label: 'descending' },\n]\n\nexport const isLoggedIn = () => !!window.localStorage.authToken\n\nexport const generateIds = arr => {\n let i = 0\n return arr.map(val => {\n const obj = { id: i, value: val }\n i++\n return obj\n })\n}\n\nexport const createApiRequest = params => {\n const headers = {}\n if (!params.noAuthorization) {\n headers.Authorization = `Bearer ${window.localStorage.getItem('authToken')}`\n }\n if (params.type) {\n headers['Content-Type'] = params.type\n }\n const requestParams = {\n method: params.method,\n headers: headers,\n }\n if (params.type === 'application/json' && params.body) {\n requestParams.body = JSON.stringify(params.body)\n } else if (params.body) {\n requestParams.body = params.body\n }\n const request = new Request(`${apiUrl}${params.url}`, requestParams)\n return fetch(request)\n .then(response =>\n params.method === 'DELETE' || response.status === 413\n ? response\n : response.json()\n )\n .catch(error => {\n console.error(error)\n return new Error('An error occurred. Please contact the administrator.')\n })\n}\n\nexport const getDateWithTZ = (date, tz) => {\n if (!date) {\n return ''\n }\n const dt = DateTime.fromISO(\n format(new Date(date), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n ).setZone(tz)\n return parse(\n dt.toFormat('yyyy-MM-dd HH:mm:ss'),\n 'yyyy-MM-dd HH:mm:ss',\n new Date()\n )\n}\n\nexport const capitalize = target =>\n target.charAt(0).toUpperCase() + target.slice(1)\n\nexport const rangePagination = pages =>\n Array.from({ length: pages }, (_, i) => i + 1)\n\nconst sortValues = (a, b) => {\n const valueALabel = a.label.toLowerCase()\n const valueBLabel = b.label.toLowerCase()\n return valueALabel > valueBLabel ? 1 : valueALabel < valueBLabel ? -1 : 0\n}\n\nexport const translateValues = (t, values, key = 'common') =>\n values\n .map(value => ({\n ...value,\n label: t(`${key}:${value.label}`),\n }))\n .sort(sortValues)\n\nexport const formatUrl = (pathname, query) => {\n let url = pathname\n if (query.id || (pathname === 'users' && query.username)) {\n url = `${url}/${query.username ? query.username : query.id}`\n } else if (Object.keys(query).length > 0) {\n url += '?'\n Object.keys(query)\n .filter(key => query[key])\n .map(\n (key, index) => (url += `${index === 0 ? '' : '&'}${key}=${query[key]}`)\n )\n }\n return url\n}\n","import { createApiRequest, formatUrl } from '../utils'\n\nexport default class FitTrackeeApi {\n static getData(target, data = {}) {\n const url = formatUrl(target, data)\n const params = {\n url: url,\n method: 'GET',\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static addData(target, data) {\n const params = {\n url: target,\n method: 'POST',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static addDataWithFile(target, data) {\n const params = {\n url: target,\n method: 'POST',\n body: data,\n }\n return createApiRequest(params)\n }\n\n static postData(target, data) {\n const params = {\n url: `${target}${data.id ? `/${data.id}` : ''}`,\n method: 'POST',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static updateData(target, data) {\n const params = {\n url: `${target}${\n data.id ? `/${data.id}` : data.username ? `/${data.username}` : ''\n }`,\n method: 'PATCH',\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static deleteData(target, id) {\n const params = {\n url: `${target}/${id}`,\n method: 'DELETE',\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n}\n","import i18next from 'i18next'\n\nimport FitTrackeeApi from '../fitTrackeeApi/index'\nimport { history } from '../index'\n\nexport const setData = (target, data) => ({\n type: 'SET_DATA',\n data,\n target,\n})\nexport const setPaginatedData = (target, data, pagination) => ({\n type: 'SET_PAGINATED_DATA',\n data,\n pagination,\n target,\n})\n\nexport const setError = message => ({\n type: 'SET_ERROR',\n message,\n})\n\nexport const setLanguage = language => ({\n type: 'SET_LANGUAGE',\n language,\n})\n\nexport const setLoading = loading => ({\n type: 'SET_LOADING',\n loading,\n})\n\nexport const updateSportsData = data => ({\n type: 'UPDATE_SPORT_DATA',\n data,\n})\n\nexport const updateUsersData = data => ({\n type: 'UPDATE_USER_DATA',\n data,\n})\n\nexport const getOrUpdateData = (\n action,\n target,\n data,\n canDispatch = true\n) => dispatch => {\n dispatch(setLoading(true))\n if (data && data.id && isNaN(data.id)) {\n dispatch(setLoading(false))\n return dispatch(setError(`${target}|Incorrect id`))\n }\n dispatch(setError(''))\n return FitTrackeeApi[action](target, data)\n .then(ret => {\n if (ret.status === 'success') {\n if (canDispatch) {\n if (target === 'users' && action === 'getData') {\n return dispatch(setPaginatedData(target, ret.data, ret.pagination))\n }\n dispatch(setData(target, ret.data))\n } else if (action === 'updateData' && target === 'sports') {\n dispatch(updateSportsData(ret.data.sports[0]))\n } else if (action === 'updateData' && target === 'users') {\n dispatch(updateUsersData(ret.data.users[0]))\n }\n } else {\n dispatch(setError(`${target}|${ret.message || ret.status}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`${target}|${error}`))\n })\n}\n\nexport const addData = (target, data) => dispatch =>\n FitTrackeeApi.addData(target, data)\n .then(ret => {\n if (ret.status === 'created') {\n history.push(`/admin/${target}`)\n } else {\n dispatch(setError(`${target}|${ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`${target}|${error}`)))\n\nexport const deleteData = (target, id) => dispatch => {\n if (isNaN(id)) {\n return dispatch(setError(target, `${target}|Incorrect id`))\n }\n return FitTrackeeApi.deleteData(target, id)\n .then(ret => {\n if (ret.status === 204) {\n history.push(`/admin/${target}`)\n } else {\n dispatch(setError(`${target}|${ret.message || ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`${target}|${error}`)))\n}\n\nexport const updateLanguage = language => dispatch => {\n i18next.changeLanguage(language).then(dispatch(setLanguage(language)))\n}\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { setError } from './index'\n\nexport const setAppConfig = data => ({\n type: 'SET_APP_CONFIG',\n data,\n})\n\nexport const setAppStats = data => ({\n type: 'SET_APP_STATS',\n data,\n})\n\nexport const getAppData = target => dispatch =>\n FitTrackeeGenericApi.getData(target)\n .then(ret => {\n if (ret.status === 'success') {\n if (target === 'config') {\n dispatch(setAppConfig(ret.data))\n } else if (target === 'stats/all') {\n dispatch(setAppStats(ret.data))\n }\n } else {\n dispatch(setError(`application|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`application|${error}`)))\n\nexport const updateAppConfig = formData => dispatch =>\n FitTrackeeGenericApi.updateData('config', formData)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setAppConfig(ret.data))\n } else {\n dispatch(setError(`application|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`application|${error}`)))\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { updateAppConfig } from '../../actions/application'\nimport { history } from '../../index'\nimport { getFileSizeInMB } from '../../utils'\n\nclass AdminApplication extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {},\n isInEdition: false,\n }\n }\n\n componentDidMount() {\n this.initForm()\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.appConfig !== prevProps.appConfig) {\n this.initForm()\n }\n }\n\n initForm() {\n const { appConfig } = this.props\n const formData = {}\n Object.keys(appConfig).map(k =>\n appConfig[k] === null\n ? (formData[k] = '')\n : ['max_single_file_size', 'max_zip_file_size'].includes(k)\n ? (formData[k] = getFileSizeInMB(appConfig[k]))\n : (formData[k] = appConfig[k])\n )\n this.setState({ formData })\n }\n\n handleFormChange(e) {\n const { formData } = this.state\n formData[e.target.name] = +e.target.value\n this.setState(formData)\n }\n\n toggleInEdition(e) {\n e.preventDefault()\n const { isInEdition } = this.state\n this.setState({ isInEdition: !isInEdition })\n }\n\n render() {\n const { message, onHandleConfigFormSubmit, t } = this.props\n const { formData, isInEdition } = this.state\n return (\n <div>\n {message && <Message message={message} t={t} />}\n {Object.keys(formData).length > 0 && (\n <div className=\"row\">\n <div className=\"col-md-12\">\n <div className=\"card\">\n <div className=\"card-header\">\n <strong>\n {t('administration:Application configuration')}\n </strong>\n </div>\n <div className=\"card-body\">\n <form\n className={`app-config-form ${\n isInEdition ? '' : 'form-disabled'\n }`}\n onSubmit={e => {\n this.toggleInEdition(e)\n onHandleConfigFormSubmit(formData)\n }}\n >\n <div className=\"form-group row\">\n <label\n className=\"col-sm-6 col-form-label\"\n htmlFor=\"max_users\"\n >\n {t(\n // eslint-disable-next-line max-len\n 'administration:Max. number of active users'\n )}\n <sup>\n <i\n className=\"fa fa-question-circle\"\n aria-hidden=\"true\"\n title={t('administration:if 0, no limitation')}\n />\n </sup>\n :\n </label>\n <input\n className=\"col-sm-5\"\n id=\"max_users\"\n name=\"max_users\"\n type=\"number\"\n min=\"0\"\n value={formData.max_users}\n onChange={e => this.handleFormChange(e)}\n />\n </div>\n <div className=\"form-group row\">\n <label\n className=\"col-sm-6 col-form-label\"\n htmlFor=\"max_single_file_size\"\n >\n {t(\n 'administration:Max. size of uploaded files (in Mb)'\n )}\n :\n </label>\n <input\n className=\"col-sm-5\"\n id=\"max_single_file_size\"\n name=\"max_single_file_size\"\n type=\"number\"\n step=\"0.1\"\n min=\"0\"\n value={formData.max_single_file_size}\n onChange={e => this.handleFormChange(e)}\n />\n </div>\n <div className=\"form-group row\">\n <label\n className=\"col-sm-6 col-form-label\"\n htmlFor=\"max_zip_file_size\"\n >\n {t('administration:Max. size of zip archive (in Mb)')}:\n </label>\n <input\n className=\"col-sm-5\"\n id=\"max_zip_file_size\"\n name=\"max_zip_file_size\"\n type=\"number\"\n step=\"0.1\"\n min=\"0\"\n value={formData.max_zip_file_size}\n onChange={e => this.handleFormChange(e)}\n />\n </div>\n <div className=\"form-group row\">\n <label\n className=\"col-sm-6 col-form-label\"\n htmlFor=\"gpx_limit_import\"\n >\n {t('administration:Max. files of zip archive')}\n </label>\n <input\n className=\"col-sm-5\"\n id=\"gpx_limit_import\"\n name=\"gpx_limit_import\"\n type=\"number\"\n min=\"0\"\n value={formData.gpx_limit_import}\n onChange={e => this.handleFormChange(e)}\n />\n </div>\n {isInEdition ? (\n <>\n <input\n type=\"submit\"\n className=\"btn btn-primary\"\n value={t('common:Submit')}\n />\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={e => this.toggleInEdition(e)}\n value={t('common:Cancel')}\n />\n </>\n ) : (\n <>\n <input\n type=\"submit\"\n className=\"btn btn-primary\"\n onClick={e => {\n this.toggleInEdition(e)\n }}\n value={t('common:Edit')}\n />\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/admin')}\n value={t('common:Back')}\n />\n </>\n )}\n </form>\n </div>\n </div>\n </div>\n </div>\n )}\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n message: state.message,\n }),\n dispatch => ({\n onHandleConfigFormSubmit: formData => {\n const data = Object.assign({}, formData)\n data.max_single_file_size *= 1048576\n data.max_zip_file_size *= 1048576\n dispatch(updateAppConfig(data))\n },\n })\n)(AdminApplication)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport { getAppData } from '../../actions/application'\nimport { getFileSize } from '../../utils'\n\nclass AdminStats extends React.Component {\n componentDidMount() {\n this.props.loadAppStats()\n }\n\n render() {\n const { appStats, t } = this.props\n const uploadDirSize = getFileSize(appStats.uploads_dir_size, false)\n return (\n <div className=\"row\">\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card activity-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-users fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">\n {appStats.users ? appStats.users : 0}\n </div>\n <div>{`${\n appStats.users === 1\n ? t('administration:user')\n : t('administration:users')\n }`}</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card activity-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-tags fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">\n {appStats.sports ? appStats.sports : 0}\n </div>\n <div>{`${\n appStats.sports === 1 ? t('common:sport') : t('common:sports')\n }`}</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card activity-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-calendar fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">\n {appStats.activities ? appStats.activities : 0}\n </div>\n <div>{`${\n appStats.activities === 1\n ? t('common:workout')\n : t('common:workouts')\n }`}</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card activity-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-folder-open fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">{uploadDirSize.size}</div>\n <div>\n {uploadDirSize.suffix} ({t('administration:uploads')})\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n appStats: state.application.statistics,\n }),\n dispatch => ({\n loadAppStats: () => {\n dispatch(getAppData('stats/all'))\n },\n })\n )(AdminStats)\n)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport AdminStats from './AdminStats'\n\nexport default function AdminDashboard(props) {\n const { appConfig, t } = props\n return (\n <div className=\"card activity-card\">\n <div className=\"card-header\">\n <strong>{t('administration:Administration')}</strong>\n </div>\n <div className=\"card-body\">\n <AdminStats />\n <br />\n <dl className=\"admin-items\">\n <dt>\n <Link\n to={{\n pathname: '/admin/application',\n }}\n >\n {t('administration:Application')}\n </Link>\n </dt>\n <dd>\n {t(\n 'administration:Update application configuration ' +\n '(maximum number of registered users, maximum files size).'\n )}\n <br />\n <strong>\n {t(\n `administration:Registration is currently ${\n appConfig.is_registration_enabled ? 'enabled' : 'disabled'\n }.`\n )}\n </strong>\n </dd>\n <br />\n <dt>\n <Link\n to={{\n pathname: '/admin/sports',\n }}\n >\n {t('administration:Sports')}\n </Link>\n </dt>\n <dd>{t('administration:Enable/disable sports.')}</dd>\n <br />\n <dt>\n <Link\n to={{\n pathname: '/admin/users',\n }}\n >\n {t('administration:Users')}\n </Link>\n </dt>\n <dd>\n {t(\n 'administration:Add/remove admin rights, ' +\n 'delete user account.'\n )}\n </dd>\n </dl>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { getOrUpdateData } from '../../actions'\nimport { history } from '../../index'\n\nclass AdminSports extends React.Component {\n componentDidMount() {\n this.props.loadSports()\n }\n\n render() {\n const { message, sports, t, updateSport } = this.props\n return (\n <div>\n {message && <Message message={message} t={t} />}\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card\">\n <div className=\"card-header\">\n <strong>{t('administration:Sports')}</strong>\n </div>\n <div className=\"card-body\">\n {sports.length > 0 && (\n <table className=\"table\">\n <thead>\n <tr>\n <th>{t('administration:id')}</th>\n <th>{t('administration:Image')}</th>\n <th>{t('administration:Label')}</th>\n <th>{t('administration:Active')}</th>\n <th>{t('administration:Actions')}</th>\n </tr>\n </thead>\n <tbody>\n {sports.map(sport => (\n <tr key={sport.id}>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:id')}\n </span>\n {sport.id}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:Image')}\n </span>\n <img\n className=\"admin-img\"\n src={sport.img ? sport.img : '/img/photo.png'}\n alt=\"sport logo\"\n />\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:Label')}\n </span>\n {t(`sports:${sport.label}`)}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:Active')}\n </span>\n {sport.is_active ? (\n <i\n className=\"fa fa-check-square-o custom-fa\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n />\n ) : (\n <i\n className=\"fa fa-square-o custom-fa\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n />\n )}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:Actions')}\n </span>\n <input\n type=\"submit\"\n className={`btn btn-${\n sport.is_active ? 'dark' : 'primary'\n } btn-sm`}\n value={\n sport.is_active\n ? t('administration:Disable')\n : t('administration:Enable')\n }\n onClick={() =>\n updateSport(sport.id, !sport.is_active)\n }\n />\n {sport.has_activities && (\n <span className=\"admin-message\">\n <i\n className=\"fa fa-warning custom-fa\"\n aria-hidden=\"true\"\n />\n {t('administration:activities exist')}\n </span>\n )}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n )}\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/admin/')}\n value={t('common:Back')}\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadSports: () => {\n dispatch(getOrUpdateData('getData', 'sports'))\n },\n updateSport: (sportId, isActive) => {\n const data = { id: sportId, is_active: isActive }\n dispatch(getOrUpdateData('updateData', 'sports', data, false))\n },\n })\n)(AdminSports)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { formatUrl, rangePagination } from '../../utils'\n\nexport default class Pagination extends React.PureComponent {\n getUrl(value) {\n const { query, pathname } = this.props\n const newQuery = Object.assign({}, query)\n let page = query.page ? +query.page : 1\n switch (value) {\n case 'prev':\n page -= 1\n break\n case 'next':\n page += 1\n break\n default:\n page = +value\n }\n newQuery.page = page\n return formatUrl(pathname, newQuery)\n }\n\n render() {\n const { pagination, t } = this.props\n return (\n <>\n {pagination && Object.keys(pagination).length > 0 && (\n <nav aria-label=\"Page navigation example\">\n <ul className=\"pagination justify-content-center\">\n <li\n className={`page-item ${pagination.has_prev ? '' : 'disabled'}`}\n >\n <Link\n className=\"page-link\"\n to={this.getUrl('prev')}\n aria-disabled={!pagination.has_prev}\n >\n {t('common:Previous')}\n </Link>\n </li>\n {rangePagination(pagination.pages).map(page => (\n <li\n key={page}\n className={`page-item ${\n page === pagination.page ? 'active' : ''\n }`}\n >\n <Link className=\"page-link\" to={this.getUrl(page)}>\n {page}\n </Link>\n </li>\n ))}\n <li\n className={`page-item ${pagination.has_next ? '' : 'disabled'}`}\n >\n <Link\n className=\"page-link\"\n to={this.getUrl('next')}\n aria-disabled={!pagination.has_next}\n >\n {t('common:Next')}\n </Link>\n </li>\n </ul>\n </nav>\n )}\n </>\n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\nimport { Link } from 'react-router-dom'\n\nimport Message from '../Common/Message'\nimport Pagination from '../Common/Pagination'\nimport { history } from '../../index'\nimport { getOrUpdateData } from '../../actions'\nimport {\n apiUrl,\n formatUrl,\n sortOrders,\n translateValues,\n userFilters,\n} from '../../utils'\n\nclass AdminUsers extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n page: null,\n per_page: null,\n order_by: 'created_at',\n order: 'asc',\n }\n }\n\n componentDidMount() {\n this.props.loadUsers(this.initState())\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.location.query !== this.props.location.query) {\n this.props.loadUsers(this.props.location.query)\n }\n }\n\n initState() {\n const { query } = this.props.location\n const newQuery = {\n page: query.page,\n per_page: query.per_page,\n order_by: query.order_by ? query.order_by : 'created_at',\n order: query.order ? query.order : 'asc',\n }\n this.setState(newQuery)\n return newQuery\n }\n\n updatePage(key, value) {\n const query = Object.assign({}, this.state)\n query[key] = value\n this.setState(query)\n const url = formatUrl(this.props.location.pathname, query)\n history.push(url)\n }\n\n render() {\n const {\n authUser,\n location,\n message,\n t,\n pagination,\n updateUser,\n users,\n } = this.props\n const translatedFilters = translateValues(t, userFilters)\n const translatedSortOrders = translateValues(t, sortOrders)\n return (\n <div>\n {message && <Message message={message} t={t} />}\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card\">\n <div className=\"card-header\">\n <strong>{t('administration:Users')}</strong>\n </div>\n <div className=\"card-body\">\n <div className=\"row user-filters\">\n <div className=\"col-lg-4 col-md-6 col-sm-12\">\n <label htmlFor=\"order_by\">\n {t('common:Sort by')}:{' '}\n <select\n id=\"order_by\"\n name=\"order_by\"\n value={this.state.order_by}\n onChange={e =>\n this.updatePage('order_by', e.target.value)\n }\n >\n {translatedFilters.map(filter => (\n <option key={filter.key} value={filter.key}>\n {filter.label}\n </option>\n ))}\n </select>{' '}\n </label>\n </div>\n <div className=\"col-lg-4 col-md-6 col-sm-12\">\n <label htmlFor=\"sort\">\n {t('common:Sort')}:{' '}\n <select\n id=\"sort\"\n name=\"sort\"\n value={this.state.order}\n onChange={e =>\n this.updatePage('order', e.target.value)\n }\n >\n {translatedSortOrders.map(sort => (\n <option key={sort.key} value={sort.key}>\n {sort.label}\n </option>\n ))}\n </select>{' '}\n </label>\n </div>\n </div>\n <table className=\"table\">\n <thead>\n <tr>\n <th>#</th>\n <th>{t('user:Username')}</th>\n <th>{t('user:Email')}</th>\n <th>{t('user:Registration Date')}</th>\n <th>{t('activities:Activities')}</th>\n <th>{t('user:Admin')}</th>\n <th>{t('administration:Actions')}</th>\n </tr>\n </thead>\n <tbody>\n {users.map(user => (\n <tr key={user.username}>\n <td>\n <span className=\"heading-span-absolute\">#</span>\n {user.picture === true ? (\n <img\n alt=\"Avatar\"\n src={`${apiUrl}users/${\n user.username\n }/picture?${Date.now()}`}\n className=\"img-fluid App-nav-profile-img\"\n />\n ) : (\n <i\n className=\"fa fa-user-circle-o fa-2x no-picture\"\n aria-hidden=\"true\"\n />\n )}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('user:Username')}\n </span>\n <Link to={`/users/${user.username}`}>\n {user.username}\n </Link>\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('user:Email')}\n </span>\n {user.email}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('user:Registration Date')}\n </span>\n {format(\n new Date(user.created_at),\n 'dd/MM/yyyy HH:mm'\n )}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('activities:Activities')}\n </span>\n {user.nb_activities}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('user:Admin')}\n </span>\n {user.admin ? (\n <i\n className=\"fa fa-check-square-o custom-fa\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n />\n ) : (\n <i\n className=\"fa fa-square-o custom-fa\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n />\n )}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('administration:Actions')}\n </span>\n <input\n type=\"submit\"\n className={`btn btn-${\n user.admin ? 'dark' : 'primary'\n } btn-sm`}\n disabled={user.username === authUser.username}\n value={\n user.admin\n ? t('administration:Remove admin rights')\n : t('administration:Add admin rights')\n }\n onClick={() =>\n updateUser(user.username, !user.admin)\n }\n />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n <Pagination\n pagination={pagination}\n pathname={location.pathname}\n query={this.state}\n t={t}\n />\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/admin/')}\n value={t('common:Back')}\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n authUser: state.user,\n location: state.router.location,\n message: state.message,\n pagination: state.users.pagination,\n users: state.users.data,\n }),\n dispatch => ({\n loadUsers: query => {\n dispatch(getOrUpdateData('getData', 'users', query))\n },\n updateUser: (userName, isAdmin) => {\n const data = { username: userName, admin: isAdmin }\n dispatch(getOrUpdateData('updateData', 'users', data, false))\n },\n })\n)(AdminUsers)\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { useTranslation } from 'react-i18next'\n\nexport default function NotFound() {\n const { t } = useTranslation()\n return (\n <div>\n <Helmet>\n <title>fittrackee - 404</title>\n </Helmet>\n <h1 className=\"page-title\">{t('Page not found')}</h1>\n </div>\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Route, Switch } from 'react-router-dom'\n\nimport AdminApplication from './AdminApplication'\nimport AdminDashboard from './AdminDashboard'\nimport AdminSports from './AdminSports'\nimport AdminUsers from './AdminUsers'\nimport NotFound from './../Others/NotFound'\n\nfunction Admin(props) {\n const { appConfig, t, user } = props\n return (\n <>\n <Helmet>\n <title>FitTrackee - {t('administration:Administration')}</title>\n </Helmet>\n <div className=\"container dashboard\">\n {user.admin ? (\n <Switch>\n <Route\n exact\n path=\"/admin\"\n render={() => <AdminDashboard appConfig={appConfig} t={t} />}\n />\n <Route\n exact\n path=\"/admin/application\"\n render={() => <AdminApplication appConfig={appConfig} t={t} />}\n />\n <Route\n exact\n path=\"/admin/sports\"\n render={() => <AdminSports t={t} />}\n />\n <Route\n exact\n path=\"/admin/users\"\n render={() => <AdminUsers t={t} />}\n />\n <Route component={NotFound} />\n </Switch>\n ) : (\n <NotFound />\n )}\n </div>\n </>\n )\n}\n\nexport default withTranslation()(\n connect(state => ({\n appConfig: state.application.config,\n user: state.user,\n }))(Admin)\n)\n","import { format, subHours } from 'date-fns'\nimport togeojson from '@mapbox/togeojson'\n\nimport { getDateWithTZ } from './index'\n\nexport const activityColors = [\n '#55a8a3',\n '#98C3A9',\n '#D0838A',\n '#ECC77E',\n '#926692',\n '#929292',\n '#428bca',\n]\n\nexport const recordsLabels = [\n { record_type: 'AS', label: 'Ave. speed' },\n { record_type: 'FD', label: 'Farest distance' },\n { record_type: 'LD', label: 'Longest duration' },\n { record_type: 'MS', label: 'Max. speed' },\n]\n\nexport const getGeoJson = gpxContent => {\n let jsonData\n if (gpxContent) {\n const gpx = new DOMParser().parseFromString(gpxContent, 'text/xml')\n jsonData = togeojson.gpx(gpx)\n }\n return { jsonData }\n}\n\nexport const formatActivityDate = (\n dateTime,\n dateFormat = null,\n timeFormat = null\n) => {\n if (!dateFormat) {\n dateFormat = 'yyyy/MM/dd'\n }\n if (!timeFormat) {\n timeFormat = 'HH:mm'\n }\n return {\n activity_date: dateTime ? format(dateTime, dateFormat) : null,\n activity_time: dateTime ? format(dateTime, timeFormat) : null,\n }\n}\n\nexport const formatActivityDuration = seconds => {\n let newDate = new Date(0)\n newDate = subHours(newDate.setSeconds(seconds), 1)\n return newDate.getTime()\n}\n\nexport const formatChartData = chartData => {\n for (let i = 0; i < chartData.length; i++) {\n chartData[i].time = new Date(chartData[i].time).getTime()\n chartData[i].duration = formatActivityDuration(chartData[i].duration)\n }\n return chartData\n}\n\nexport const formatRecord = (record, tz) => {\n let value\n switch (record.record_type) {\n case 'AS':\n case 'MS':\n value = `${record.value} km/h`\n break\n case 'FD':\n value = `${record.value} km`\n break\n default:\n // 'LD'\n value = record.value // eslint-disable-line prefer-destructuring\n }\n const [recordType] = recordsLabels.filter(\n r => r.record_type === record.record_type\n )\n return {\n activity_date: formatActivityDate(getDateWithTZ(record.activity_date, tz))\n .activity_date,\n activity_id: record.activity_id,\n id: record.id,\n record_type: recordType.label,\n value: value,\n }\n}\n\nconst sortSports = (a, b) => {\n const sportALabel = a.label.toLowerCase()\n const sportBLabel = b.label.toLowerCase()\n return sportALabel > sportBLabel ? 1 : sportALabel < sportBLabel ? -1 : 0\n}\n\nexport const translateSports = (sports, t, onlyActive = false) =>\n sports\n .filter(sport => (onlyActive ? sport.is_active : true))\n .map(sport => ({\n ...sport,\n label: t(`sports:${sport.label}`),\n }))\n .sort(sortSports)\n","import { createApiRequest } from '../utils'\n\nexport default class FitTrackeeApi {\n static loginOrRegisterOrPasswordReset(target, data) {\n const params = {\n url: `auth/${target}`,\n method: 'POST',\n noAuthorization: true,\n body: data,\n type: 'application/json',\n }\n return createApiRequest(params)\n }\n\n static deletePicture() {\n const params = {\n url: 'auth/picture',\n method: 'DELETE',\n }\n return createApiRequest(params)\n }\n}\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport FitTrackeeApi from '../fitTrackeeApi/auth'\nimport { history } from '../index'\nimport { generateIds } from '../utils'\nimport { getOrUpdateData, setError, updateLanguage } from './index'\nimport { getAppData } from './application'\n\nconst AuthError = message => ({ type: 'AUTH_ERROR', message })\n\nconst AuthErrors = messages => ({ type: 'AUTH_ERRORS', messages })\n\nconst PictureError = message => ({ type: 'PICTURE_ERROR', message })\n\nconst ProfileSuccess = profil => ({ type: 'PROFILE_SUCCESS', profil })\n\nconst ProfileError = message => ({ type: 'PROFILE_ERROR', message })\n\nconst ProfileUpdateError = message => ({\n type: 'PROFILE_UPDATE_ERROR',\n message,\n})\n\nexport const logout = () => ({ type: 'LOGOUT' })\n\nexport const loadProfile = () => dispatch => {\n if (window.localStorage.getItem('authToken')) {\n return dispatch(getProfile())\n }\n return { type: 'LOGOUT' }\n}\n\nexport const getProfile = () => dispatch =>\n FitTrackeeGenericApi.getData('auth/profile')\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(getOrUpdateData('getData', 'sports'))\n ret.data.isAuthenticated = true\n if (ret.data.language) {\n dispatch(updateLanguage(ret.data.language))\n }\n return dispatch(ProfileSuccess(ret.data))\n }\n return dispatch(ProfileError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nexport const loginOrRegisterOrPasswordReset = (target, formData) => dispatch =>\n FitTrackeeApi.loginOrRegisterOrPasswordReset(target, formData)\n .then(ret => {\n if (ret.status === 'success') {\n if (target === 'password/reset-request') {\n return history.push({\n pathname: '/password-reset/sent',\n })\n }\n if (target === 'password/update') {\n return history.push({\n pathname: '/updated-password',\n })\n }\n if (target === 'login' || target === 'register') {\n window.localStorage.setItem('authToken', ret.auth_token)\n if (target === 'register') {\n dispatch(getAppData('config'))\n }\n return dispatch(getProfile())\n }\n }\n return dispatch(AuthError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nconst RegisterFormControl = (formData, onlyPasswords = false) => {\n const errMsg = []\n if (\n !onlyPasswords &&\n (formData.username.length < 3 || formData.username.length > 12)\n ) {\n errMsg.push('3 to 12 characters required for username.')\n }\n if (formData.password !== formData.password_conf) {\n errMsg.push(\"Password and password confirmation don't match.\")\n }\n if (formData.password.length < 8) {\n errMsg.push('8 characters required for password.')\n }\n return errMsg\n}\n\nexport const handleUserFormSubmit = (formData, formType) => dispatch => {\n if (formType === 'register' || formType === 'password/update') {\n const ret = RegisterFormControl(formData, formType === 'password/update')\n if (ret.length > 0) {\n return dispatch(AuthErrors(generateIds(ret)))\n }\n }\n return dispatch(loginOrRegisterOrPasswordReset(formType, formData))\n}\n\nexport const handleProfileFormSubmit = formData => dispatch => {\n if (!formData.password === formData.password_conf) {\n return dispatch(\n ProfileUpdateError(\"Password and password confirmation don't match.\")\n )\n }\n delete formData.id\n return FitTrackeeGenericApi.postData('auth/profile/edit', formData)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(getProfile())\n return history.push('/profile')\n }\n dispatch(ProfileUpdateError(ret.message))\n })\n .catch(error => {\n throw error\n })\n}\n\nexport const uploadPicture = event => dispatch => {\n event.preventDefault()\n const form = new FormData()\n form.append('file', event.target.picture.files[0])\n event.target.reset()\n return FitTrackeeGenericApi.addDataWithFile('auth/picture', form)\n .then(ret => {\n if (ret.status === 'success') {\n return dispatch(getProfile())\n }\n const msg = ret.message.match(/file size exceeds/g)\n ? 'Error during picture update, file size exceeds max size.'\n : ret.message\n return dispatch(PictureError(msg))\n })\n .catch(error => {\n throw error\n })\n}\n\nexport const deletePicture = () => dispatch =>\n FitTrackeeApi.deletePicture()\n .then(ret => {\n if (ret.status === 204) {\n return dispatch(getProfile())\n }\n return dispatch(PictureError(ret.message))\n })\n .catch(error => {\n throw error\n })\n\nexport const deleteUser = (username, isAdmin = false) => dispatch =>\n FitTrackeeGenericApi.deleteData('users', username)\n .then(ret => {\n if (ret.status === 204) {\n dispatch(getAppData('config'))\n if (isAdmin) {\n history.push('/admin/users')\n } else {\n dispatch(logout())\n history.push('/')\n }\n } else {\n ret.json().then(r => dispatch(setError(`${r.message}`)))\n }\n })\n .catch(error => dispatch(setError(`user|${error}`)))\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { history } from '../index'\nimport { formatChartData } from '../utils/activities'\nimport { setError, setLoading } from './index'\nimport { loadProfile } from './user'\n\nexport const pushActivities = activities => ({\n type: 'PUSH_ACTIVITIES',\n activities,\n})\n\nexport const removeActivity = activityId => ({\n type: 'REMOVE_ACTIVITY',\n activityId,\n})\n\nexport const updateCalendar = activities => ({\n type: 'UPDATE_CALENDAR',\n activities,\n})\n\nexport const setGpx = gpxContent => ({\n type: 'SET_GPX',\n gpxContent,\n})\n\nexport const setChartData = chartData => ({\n type: 'SET_CHART_DATA',\n chartData,\n})\n\nexport const addActivity = form => dispatch =>\n FitTrackeeGenericApi.addDataWithFile('activities', form)\n .then(ret => {\n if (ret.status === 'created') {\n if (ret.data.activities.length === 0) {\n dispatch(setError('activities|no correct file.'))\n } else if (ret.data.activities.length === 1) {\n dispatch(loadProfile())\n history.push(`/activities/${ret.data.activities[0].id}`)\n } else {\n // ret.data.activities.length > 1\n dispatch(loadProfile())\n history.push('/')\n }\n } else if (ret.status === 413) {\n dispatch(\n setError('activities|File size is greater than the allowed size')\n )\n } else {\n dispatch(setError(`activities|${ret.message}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`activities|${error}`))\n })\n\nexport const addActivityWithoutGpx = form => dispatch =>\n FitTrackeeGenericApi.addData('activities/no_gpx', form)\n .then(ret => {\n if (ret.status === 'created') {\n dispatch(loadProfile())\n history.push(`/activities/${ret.data.activities[0].id}`)\n } else {\n dispatch(setError(`activities|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`activities|${error}`)))\n\nexport const getActivityGpx = activityId => dispatch => {\n if (activityId) {\n return FitTrackeeGenericApi.getData(`activities/${activityId}/gpx`)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setGpx(ret.data.gpx))\n } else {\n dispatch(setError(`activities|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`activities|${error}`)))\n }\n dispatch(setGpx(null))\n}\n\nexport const getSegmentGpx = (activityId, segmentId) => dispatch => {\n if (activityId) {\n return FitTrackeeGenericApi.getData(\n `activities/${activityId}/gpx/segment/${segmentId}`\n )\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setGpx(ret.data.gpx))\n } else {\n dispatch(setError(`activities|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`activities|${error}`)))\n }\n dispatch(setGpx(null))\n}\n\nexport const getActivityChartData = activityId => dispatch => {\n if (activityId) {\n return FitTrackeeGenericApi.getData(`activities/${activityId}/chart_data`)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setChartData(formatChartData(ret.data.chart_data)))\n } else {\n dispatch(setError(`activities|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`activities|${error}`)))\n }\n dispatch(setChartData(null))\n}\n\nexport const getSegmentChartData = (activityId, segmentId) => dispatch => {\n if (activityId) {\n return FitTrackeeGenericApi.getData(\n `activities/${activityId}/chart_data/segment/${segmentId}`\n )\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setChartData(formatChartData(ret.data.chart_data)))\n } else {\n dispatch(setError(`activities|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`activities|${error}`)))\n }\n dispatch(setChartData(null))\n}\n\nexport const deleteActivity = id => dispatch =>\n FitTrackeeGenericApi.deleteData('activities', id)\n .then(ret => {\n if (ret.status === 204) {\n Promise.resolve(dispatch(removeActivity(id)))\n .then(() => dispatch(loadProfile()))\n .then(() => history.push('/'))\n } else {\n dispatch(setError(`activities|${ret.status}`))\n }\n })\n .catch(error => dispatch(setError(`activities|${error}`)))\n\nexport const editActivity = form => dispatch =>\n FitTrackeeGenericApi.updateData('activities', form)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(loadProfile())\n history.push(`/activities/${ret.data.activities[0].id}`)\n } else {\n dispatch(setError(`activities|${ret.message}`))\n }\n dispatch(setLoading(false))\n })\n .catch(error => {\n dispatch(setLoading(false))\n dispatch(setError(`activities|${error}`))\n })\n\nexport const getMoreActivities = params => dispatch =>\n FitTrackeeGenericApi.getData('activities', params)\n .then(ret => {\n if (ret.status === 'success') {\n if (ret.data.activities.length > 0) {\n dispatch(pushActivities(ret.data.activities))\n }\n } else {\n dispatch(setError(`activities|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`activities|${error}`)))\n\nexport const getMonthActivities = (from, to) => dispatch =>\n FitTrackeeGenericApi.getData('activities', {\n from,\n to,\n order: 'asc',\n per_page: 100,\n })\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(updateCalendar(ret.data.activities))\n } else {\n dispatch(setError(`activities|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`activities|${error}`)))\n","import React from 'react'\nimport { Trans } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport { setLoading } from '../../../actions/index'\nimport { addActivity, editActivity } from '../../../actions/activities'\nimport { history } from '../../../index'\nimport { getFileSize } from '../../../utils'\nimport { translateSports } from '../../../utils/activities'\n\nfunction FormWithGpx(props) {\n const {\n activity,\n appConfig,\n loading,\n onAddActivity,\n onEditActivity,\n sports,\n t,\n } = props\n const sportId = activity ? activity.sport_id : ''\n const translatedSports = translateSports(sports, t, true)\n const zipTooltip = `${t('activities:no folder inside')}, ${\n appConfig.gpx_limit_import\n } ${t('activities:files max')}, ${t('activities:max size')}: ${getFileSize(\n appConfig.max_zip_file_size\n )}`\n const fileSizeLimit = getFileSize(appConfig.max_single_file_size)\n return (\n <form\n encType=\"multipart/form-data\"\n method=\"post\"\n onSubmit={event => event.preventDefault()}\n >\n <div className=\"form-group\">\n <label>\n {t('common:Sport')}:\n <select\n className=\"form-control input-lg\"\n defaultValue={sportId}\n disabled={loading}\n name=\"sport\"\n required\n >\n <option value=\"\" />\n {translatedSports.map(sport => (\n <option key={sport.id} value={sport.id}>\n {sport.label}\n </option>\n ))}\n </select>\n </label>\n </div>\n {activity ? (\n <div className=\"form-group\">\n <label>\n {t('activities:Title')}:\n <input\n name=\"title\"\n defaultValue={activity ? activity.title : ''}\n disabled={loading}\n className=\"form-control input-lg\"\n />\n </label>\n </div>\n ) : (\n <div className=\"form-group\">\n <label>\n <Trans i18nKey=\"activities:gpxFile\">\n <strong>gpx</strong> file\n </Trans>\n <sup>\n <i\n className=\"fa fa-question-circle\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n title={`${t('activities:max size')}: ${fileSizeLimit}`}\n />\n </sup>{' '}\n <Trans i18nKey=\"activities:zipFile\">\n or <strong> zip</strong> file containing <strong>gpx </strong>\n files\n </Trans>\n <sup>\n <i\n className=\"fa fa-question-circle\"\n aria-hidden=\"true\"\n data-toggle=\"tooltip\"\n data-placement=\"top\"\n title={zipTooltip}\n />\n </sup>{' '}\n :\n <input\n accept=\".gpx, .zip\"\n className=\"form-control form-control-file gpx-file\"\n disabled={loading}\n name=\"gpxFile\"\n required\n type=\"file\"\n />\n </label>\n </div>\n )}\n <div className=\"form-group\">\n <label>\n {t('activities:Notes')}:\n <textarea\n name=\"notes\"\n defaultValue={activity ? activity.notes : ''}\n disabled={loading}\n className=\"form-control input-lg\"\n maxLength=\"500\"\n />\n </label>\n </div>\n {loading ? (\n <div className=\"loader\" />\n ) : (\n <div>\n <input\n type=\"submit\"\n className=\"btn btn-primary\"\n onClick={event =>\n activity ? onEditActivity(event, activity) : onAddActivity(event)\n }\n value={t('common:Submit')}\n />\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/')}\n value={t('common:Cancel')}\n />\n </div>\n )}\n </form>\n )\n}\n\nexport default connect(\n state => ({\n appConfig: state.application.config,\n loading: state.loading,\n }),\n dispatch => ({\n onAddActivity: e => {\n dispatch(setLoading(true))\n const form = new FormData()\n form.append('file', e.target.form.gpxFile.files[0])\n /* prettier-ignore */\n form.append(\n 'data',\n `{\"sport_id\": ${e.target.form.sport.value\n }, \"notes\": \"${e.target.form.notes.value}\"}`\n )\n dispatch(addActivity(form))\n },\n onEditActivity: (e, activity) => {\n dispatch(\n editActivity({\n id: activity.id,\n notes: e.target.form.notes.value,\n sport_id: +e.target.form.sport.value,\n title: e.target.form.title.value,\n })\n )\n },\n })\n)(FormWithGpx)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport {\n addActivityWithoutGpx,\n editActivity,\n} from '../../../actions/activities'\nimport { history } from '../../../index'\nimport { getDateWithTZ } from '../../../utils'\nimport { formatActivityDate, translateSports } from '../../../utils/activities'\n\nfunction FormWithoutGpx(props) {\n const { activity, onAddOrEdit, sports, t, user } = props\n const translatedSports = translateSports(sports, t, true)\n let activityDate,\n activityTime,\n sportId = ''\n if (activity) {\n const activityDateTime = formatActivityDate(\n getDateWithTZ(activity.activity_date, user.timezone),\n 'yyyy-MM-dd'\n )\n activityDate = activityDateTime.activity_date\n activityTime = activityDateTime.activity_time\n sportId = activity.sport_id\n }\n\n return (\n <form onSubmit={event => event.preventDefault()}>\n <div className=\"form-group\">\n <label>\n {t('activities:Title')}:\n <input\n name=\"title\"\n defaultValue={activity ? activity.title : ''}\n className=\"form-control input-lg\"\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('common:Sport')}:\n <select\n className=\"form-control input-lg\"\n defaultValue={sportId}\n name=\"sport_id\"\n required\n >\n <option value=\"\" />\n {translatedSports.map(sport => (\n <option key={sport.id} value={sport.id}>\n {sport.label}\n </option>\n ))}\n </select>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('activities:Activity Date')}:\n <div className=\"container\">\n <div className=\"row\">\n <input\n name=\"activity_date\"\n defaultValue={activityDate}\n className=\"form-control col-md\"\n required\n type=\"date\"\n />\n <input\n name=\"activity_time\"\n defaultValue={activityTime}\n className=\"form-control col-md\"\n required\n type=\"time\"\n />\n </div>\n </div>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('activities:Duration')}:\n <input\n name=\"duration\"\n defaultValue={activity ? activity.duration : ''}\n className=\"form-control col-xs-4\"\n pattern=\"^([0-9]*[0-9]):([0-5][0-9]):([0-5][0-9])$\"\n placeholder=\"hh:mm:ss\"\n required\n type=\"text\"\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('activities:Distance')} (km):\n <input\n name=\"distance\"\n defaultValue={activity ? activity.distance : ''}\n className=\"form-control input-lg\"\n min={0}\n required\n step=\"0.001\"\n type=\"number\"\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('activities:Notes')}:\n <textarea\n name=\"notes\"\n defaultValue={activity ? activity.notes : ''}\n className=\"form-control input-lg\"\n maxLength=\"500\"\n />\n </label>\n </div>\n <input\n type=\"submit\"\n className=\"btn btn-primary\"\n onClick={event => onAddOrEdit(event, activity)}\n value={t('common:Submit')}\n />\n <input\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/')}\n value={t('common:Cancel')}\n />\n </form>\n )\n}\n\nexport default connect(\n state => ({\n user: state.user,\n }),\n dispatch => ({\n onAddOrEdit: (e, activity) => {\n const d = e.target.form.duration.value.split(':')\n const duration = +d[0] * 60 * 60 + +d[1] * 60 + +d[2]\n\n /* prettier-ignore */\n const activityDate = `${e.target.form.activity_date.value\n } ${ e.target.form.activity_time.value}`\n\n const data = {\n activity_date: activityDate,\n distance: +e.target.form.distance.value,\n duration,\n notes: e.target.form.notes.value,\n sport_id: +e.target.form.sport_id.value,\n title: e.target.form.title.value,\n }\n if (activity) {\n data.id = activity.id\n dispatch(editActivity(data))\n } else {\n dispatch(addActivityWithoutGpx(data))\n }\n },\n })\n)(FormWithoutGpx)\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport FormWithGpx from './ActivityForms/FormWithGpx'\nimport FormWithoutGpx from './ActivityForms/FormWithoutGpx'\nimport Message from '../Common/Message'\n\nclass ActivityAddEdit extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n withGpx: true,\n }\n }\n\n handleRadioChange(changeEvent) {\n this.setState({\n withGpx:\n changeEvent.target.name === 'withGpx'\n ? changeEvent.target.value\n : !changeEvent.target.value,\n })\n }\n\n render() {\n const { activity, loading, message, sports, t } = this.props\n const { withGpx } = this.state\n return (\n <div>\n <Helmet>\n <title>\n FitTrackee -{' '}\n {activity\n ? t('activities:Edit a workout')\n : t('activities:Add a workout')}\n </title>\n </Helmet>\n <br />\n <br />\n <Message message={message} t={t} />\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md-2\" />\n <div className=\"col-md-8\">\n <div className=\"card add-activity\">\n <h2 className=\"card-header text-center\">\n {activity\n ? t('activities:Edit a workout')\n : t('activities:Add a workout')}\n </h2>\n <div className=\"card-body\">\n {activity ? (\n activity.with_gpx ? (\n <FormWithGpx activity={activity} sports={sports} t={t} />\n ) : (\n <FormWithoutGpx\n activity={activity}\n sports={sports}\n t={t}\n />\n )\n ) : (\n <div>\n <form>\n <div className=\"form-group row\">\n <div className=\"col\">\n <label className=\"radioLabel\">\n <input\n className=\"add-activity-radio\"\n type=\"radio\"\n name=\"withGpx\"\n disabled={loading}\n checked={withGpx}\n onChange={event =>\n this.handleRadioChange(event)\n }\n />\n {t('activities:with gpx file')}\n </label>\n </div>\n <div className=\"col\">\n <label className=\"radioLabel\">\n <input\n className=\"add-activity-radio\"\n type=\"radio\"\n name=\"withoutGpx\"\n disabled={loading}\n checked={!withGpx}\n onChange={event =>\n this.handleRadioChange(event)\n }\n />\n {t('activities:without gpx file')}\n </label>\n </div>\n </div>\n </form>\n {withGpx ? (\n <FormWithGpx sports={sports} t={t} />\n ) : (\n <FormWithoutGpx sports={sports} t={t} />\n )}\n </div>\n )}\n </div>\n </div>\n </div>\n <div className=\"col-md-2\" />\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(state => ({\n loading: state.loading,\n }))(ActivityAddEdit)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport ActivityAddOrEdit from './ActivityAddOrEdit'\n\nfunction ActivityAdd(props) {\n const { message, sports } = props\n return (\n <div>\n <ActivityAddOrEdit activity={null} message={message} sports={sports} />\n </div>\n )\n}\n\nexport default connect(state => ({\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n}))(ActivityAdd)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { getDateWithTZ } from '../../../utils'\nimport { formatActivityDate } from '../../../utils/activities'\n\nexport default function ActivityCardHeader(props) {\n const {\n activity,\n dataType,\n displayModal,\n segmentId,\n sport,\n t,\n title,\n user,\n } = props\n const activityDate = activity\n ? formatActivityDate(getDateWithTZ(activity.activity_date, user.timezone))\n : null\n\n const previousUrl =\n dataType === 'segment' && segmentId !== 1\n ? `/activities/${activity.id}/segment/${segmentId - 1}`\n : dataType === 'activity' && activity.previous_activity\n ? `/activities/${activity.previous_activity}`\n : null\n const nextUrl =\n dataType === 'segment' && segmentId < activity.segments.length\n ? `/activities/${activity.id}/segment/${segmentId + 1}`\n : dataType === 'activity' && activity.next_activity\n ? `/activities/${activity.next_activity}`\n : null\n\n return (\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-auto\">\n {previousUrl ? (\n <Link className=\"unlink\" to={previousUrl}>\n <i\n className=\"fa fa-chevron-left\"\n aria-hidden=\"true\"\n title={t(`activities:See previous ${dataType}`)}\n />\n </Link>\n ) : (\n <i\n className=\"fa fa-chevron-left inactive-link\"\n aria-hidden=\"true\"\n title={t(`activities:No previous ${dataType}`)}\n />\n )}\n </div>\n <div className=\"col-auto col-activity-logo\">\n <img className=\"sport-img-medium\" src={sport.img} alt=\"sport logo\" />\n </div>\n <div className=\"col\">\n {dataType === 'activity' ? (\n <>\n {title}{' '}\n <Link className=\"unlink\" to={`/activities/${activity.id}/edit`}>\n <i\n className=\"fa fa-edit custom-fa\"\n aria-hidden=\"true\"\n title={t('activities:Edit activity')}\n />\n </Link>\n <i\n className=\"fa fa-trash custom-fa\"\n aria-hidden=\"true\"\n onClick={() => displayModal(true)}\n title={t('activities:Delete activity')}\n />\n </>\n ) : (\n <>\n {/* prettier-ignore */}\n <Link\n to={`/activities/${activity.id}`}\n >\n {title}\n </Link>{' '}\n - {t('activities:segment')} {segmentId}\n </>\n )}\n <br />\n {activityDate && (\n <span className=\"activity-date\">\n {`${activityDate.activity_date} - ${activityDate.activity_time}`}\n </span>\n )}\n </div>\n <div className=\"col-auto\">\n {nextUrl ? (\n <Link className=\"unlink\" to={nextUrl}>\n <i\n className=\"fa fa-chevron-right\"\n aria-hidden=\"true\"\n title={t(`activities:See next ${dataType}`)}\n />\n </Link>\n ) : (\n <i\n className=\"fa fa-chevron-right inactive-link\"\n aria-hidden=\"true\"\n title={t(`activities:No next ${dataType}`)}\n />\n )}\n </div>\n </div>\n </div>\n )\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\nimport {\n Area,\n ComposedChart,\n Line,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts'\n\nimport {\n getActivityChartData,\n getSegmentChartData,\n} from '../../../actions/activities'\n\nclass ActivityCharts extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayDistance: true,\n dataToHide: [],\n }\n }\n\n componentDidMount() {\n if (this.props.dataType === 'activity') {\n this.props.loadActivityData(this.props.activity.id)\n } else {\n this.props.loadSegmentData(this.props.activity.id, this.props.segmentId)\n }\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.dataType === 'activity' &&\n prevProps.activity.id !== this.props.activity.id) ||\n (this.props.dataType === 'activity' && prevProps.dataType === 'segment')\n ) {\n this.props.loadActivityData(this.props.activity.id)\n }\n if (\n this.props.dataType === 'segment' &&\n prevProps.segmentId !== this.props.segmentId\n ) {\n this.props.loadSegmentData(this.props.activity.id, this.props.segmentId)\n }\n }\n\n componentWillUnmount() {\n this.props.loadActivityData(null)\n }\n\n handleRadioChange(changeEvent) {\n this.setState({\n displayDistance:\n changeEvent.target.name === 'distance'\n ? changeEvent.target.value\n : !changeEvent.target.value,\n })\n }\n\n handleLegendChange(e) {\n const { dataToHide } = this.state\n const name = e.target.name // eslint-disable-line prefer-destructuring\n if (dataToHide.find(d => d === name)) {\n dataToHide.splice(dataToHide.indexOf(name), 1)\n } else {\n dataToHide.push(name)\n }\n this.setState({ dataToHide })\n }\n\n displayData(name) {\n const { dataToHide } = this.state\n return !dataToHide.find(d => d === name)\n }\n\n render() {\n const { chartData, t, updateCoordinates } = this.props\n const { displayDistance } = this.state\n const xInterval = chartData ? parseInt(chartData.length / 10, 10) : 0\n let xDataKey, xScale\n if (displayDistance) {\n xDataKey = 'distance'\n xScale = 'linear'\n } else {\n xDataKey = 'duration'\n xScale = 'time'\n }\n return (\n <div className=\"container\">\n {chartData && chartData.length > 0 ? (\n <div>\n <div className=\"row chart-radio\">\n <label className=\"radioLabel col-md-1\">\n <input\n type=\"radio\"\n name=\"distance\"\n checked={displayDistance}\n onChange={e => this.handleRadioChange(e)}\n />\n {t('activities:distance')}\n </label>\n <label className=\"radioLabel col-md-1\">\n <input\n type=\"radio\"\n name=\"duration\"\n checked={!displayDistance}\n onChange={e => this.handleRadioChange(e)}\n />\n {t('activities:duration')}\n </label>\n </div>\n <div className=\"row chart-radio\">\n <div className=\"col-md-5\" />\n <label className=\"radioLabel col-md-1\">\n <input\n type=\"checkbox\"\n name=\"speed\"\n checked={this.displayData('speed')}\n onChange={e => this.handleLegendChange(e)}\n />\n {t('activities:speed')}\n </label>\n <label className=\"radioLabel col-md-1\">\n <input\n type=\"checkbox\"\n name=\"elevation\"\n checked={this.displayData('elevation')}\n onChange={e => this.handleLegendChange(e)}\n />\n {t('activities:elevation')}\n </label>\n <div className=\"col-md-5\" />\n </div>\n <div className=\"row chart\">\n <ResponsiveContainer height={300}>\n <ComposedChart\n data={chartData}\n margin={{ top: 15, right: 30, left: 20, bottom: 15 }}\n onMouseMove={e => updateCoordinates(e.activePayload)}\n onMouseLeave={() => updateCoordinates(null)}\n >\n <XAxis\n allowDecimals={false}\n dataKey={xDataKey}\n label={{\n value: t(`activities:${xDataKey}`),\n offset: 0,\n position: 'bottom',\n }}\n scale={xScale}\n interval={xInterval}\n tickFormatter={value =>\n displayDistance ? value : format(value, 'HH:mm:ss')\n }\n type=\"number\"\n />\n <YAxis\n label={{\n value: `${t('activities:speed')} (km/h)`,\n angle: -90,\n position: 'left',\n }}\n yAxisId=\"left\"\n />\n <YAxis\n label={{\n value: `${t('activities:elevation')} (m)`,\n angle: -90,\n position: 'right',\n }}\n yAxisId=\"right\"\n orientation=\"right\"\n />\n {this.displayData('elevation') && (\n <Area\n yAxisId=\"right\"\n type=\"linear\"\n dataKey=\"elevation\"\n name={t('activities:elevation')}\n fill=\"#e5e5e5\"\n stroke=\"#cccccc\"\n dot={false}\n unit=\" m\"\n />\n )}\n {this.displayData('speed') && (\n <Line\n yAxisId=\"left\"\n type=\"linear\"\n dataKey=\"speed\"\n name={t('activities:speed')}\n stroke=\"#8884d8\"\n strokeWidth={2}\n dot={false}\n unit=\" km/h\"\n />\n )}\n <Tooltip\n labelFormatter={value =>\n displayDistance\n ? `${t('activities:distance')}: ${value} km`\n : `${t('activities:duration')}: ${format(\n value,\n 'HH:mm:ss'\n )}`\n }\n />\n </ComposedChart>\n </ResponsiveContainer>\n </div>\n <div className=\"chart-info\">\n {t('activities:data from gpx, without any cleaning')}\n </div>\n </div>\n ) : (\n t('activities:No data to display')\n )}\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n chartData: state.chartData,\n }),\n dispatch => ({\n loadActivityData: activityId => {\n dispatch(getActivityChartData(activityId))\n },\n loadSegmentData: (activityId, segmentId) => {\n dispatch(getSegmentChartData(activityId, segmentId))\n },\n })\n)(ActivityCharts)\n","import React from 'react'\n\nexport default function ActivityWeather(props) {\n const { activity, t } = props\n return (\n <div className=\"container\">\n {activity.weather_start && activity.weather_end && (\n <table className=\"table table-borderless weather-table text-center\">\n <thead>\n <tr>\n <th />\n <th>\n {t('activities:Start')}\n <br />\n <img\n className=\"weather-img\"\n src={`/img/weather/${activity.weather_start.icon}.png`}\n alt={`activity weather (${activity.weather_start.icon})`}\n title={activity.weather_start.summary}\n />\n </th>\n <th>\n {t('activities:End')}\n <br />\n <img\n className=\"weather-img\"\n src={`/img/weather/${activity.weather_end.icon}.png`}\n alt={`activity weather (${activity.weather_end.icon})`}\n title={activity.weather_end.summary}\n />\n </th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td>\n <img\n className=\"weather-img-small\"\n src=\"/img/weather/temperature.png\"\n alt=\"Temperatures\"\n />\n </td>\n <td>{Number(activity.weather_start.temperature).toFixed(1)}°C</td>\n <td>{Number(activity.weather_end.temperature).toFixed(1)}°C</td>\n </tr>\n <tr>\n <td>\n <img\n className=\"weather-img-small\"\n src=\"/img/weather/pour-rain.png\"\n alt=\"Temperatures\"\n />\n </td>\n <td>\n {Number(activity.weather_start.humidity * 100).toFixed(1)}%\n </td>\n <td>{Number(activity.weather_end.humidity * 100).toFixed(1)}%</td>\n </tr>\n <tr>\n <td>\n <img\n className=\"weather-img-small\"\n src=\"/img/weather/breeze.png\"\n alt=\"Temperatures\"\n />\n </td>\n <td>{Number(activity.weather_start.wind).toFixed(1)}m/s</td>\n <td>{Number(activity.weather_end.wind).toFixed(1)}m/s</td>\n </tr>\n </tbody>\n </table>\n )}\n </div>\n )\n}\n","import React from 'react'\n\nimport ActivityWeather from './ActivityWeather'\n\nexport default function ActivityDetails(props) {\n const { activity, t } = props\n const withPauses = activity.pauses !== '0:00:00' && activity.pauses !== null\n return (\n <div className=\"activity-details\">\n <p>\n <i className=\"fa fa-clock-o custom-fa\" aria-hidden=\"true\" />\n {t('activities:Duration')}: {activity.moving}\n {activity.records &&\n activity.records.find(r => r.record_type === 'LD') && (\n <sup>\n <i className=\"fa fa-trophy custom-fa\" aria-hidden=\"true\" />\n </sup>\n )}\n {withPauses && (\n <span>\n <br />({t('activities:pauses')}: {activity.pauses},{' '}\n {t('activities:total duration')}: {activity.duration})\n </span>\n )}\n </p>\n <p>\n <i className=\"fa fa-road custom-fa\" aria-hidden=\"true\" />\n {t('activities:Distance')}: {activity.distance} km\n {activity.records &&\n activity.records.find(r => r.record_type === 'FD') && (\n <sup>\n <i className=\"fa fa-trophy custom-fa\" aria-hidden=\"true\" />\n </sup>\n )}\n </p>\n <p>\n <i className=\"fa fa-tachometer custom-fa\" aria-hidden=\"true\" />\n {t('activities:Average speed')}: {activity.ave_speed} km/h\n {activity.records &&\n activity.records.find(r => r.record_type === 'AS') && (\n <sup>\n <i className=\"fa fa-trophy custom-fa\" aria-hidden=\"true\" />\n </sup>\n )}\n <br />\n {t('activities:Max. speed')}: {activity.max_speed} km/h\n {activity.records &&\n activity.records.find(r => r.record_type === 'MS') && (\n <sup>\n <i className=\"fa fa-trophy custom-fa\" aria-hidden=\"true\" />\n </sup>\n )}\n </p>\n {activity.min_alt && activity.max_alt && (\n <p>\n <i className=\"fi-mountains custom-fa\" />\n {t('activities:Min. altitude')}: {activity.min_alt}m\n <br />\n {t('activities:Max. altitude')}: {activity.max_alt}m\n </p>\n )}\n {activity.ascent && activity.descent && (\n <p>\n <i className=\"fa fa-location-arrow custom-fa\" />\n {t('activities:Ascent')}: {activity.ascent}m\n <br />\n {t('activities:Descent')}: {activity.descent}m\n </p>\n )}\n <ActivityWeather activity={activity} t={t} />\n </div>\n )\n}\n","import hash from 'object-hash'\nimport React from 'react'\nimport { GeoJSON, Map, Marker, TileLayer } from 'react-leaflet'\nimport { connect } from 'react-redux'\n\nimport { getActivityGpx, getSegmentGpx } from '../../../actions/activities'\nimport { apiUrl } from '../../../utils'\nimport { getGeoJson } from '../../../utils/activities'\n\nclass ActivityMap extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n zoom: 13,\n }\n }\n\n componentDidMount() {\n if (this.props.dataType === 'activity') {\n this.props.loadActivityGpx(this.props.activity.id)\n } else {\n this.props.loadSegmentGpx(this.props.activity.id, this.props.segmentId)\n }\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.dataType === 'activity' &&\n prevProps.activity.id !== this.props.activity.id) ||\n (this.props.dataType === 'activity' && prevProps.dataType === 'segment')\n ) {\n this.props.loadActivityGpx(this.props.activity.id)\n }\n if (\n this.props.dataType === 'segment' &&\n prevProps.segmentId !== this.props.segmentId\n ) {\n this.props.loadSegmentGpx(this.props.activity.id, this.props.segmentId)\n }\n }\n\n componentWillUnmount() {\n this.props.loadActivityGpx(null)\n }\n\n render() {\n const { activity, coordinates, gpxContent, mapAttribution } = this.props\n const { jsonData } = getGeoJson(gpxContent)\n const bounds = [\n [activity.bounds[0], activity.bounds[1]],\n [activity.bounds[2], activity.bounds[3]],\n ]\n\n return (\n <div>\n {jsonData && (\n <Map\n zoom={this.state.zoom}\n bounds={bounds}\n boundsOptions={{ padding: [10, 10] }}\n >\n <TileLayer\n // eslint-disable-next-line max-len\n attribution={mapAttribution}\n url={`${apiUrl}activities/map_tile/{s}/{z}/{x}/{y}.png`}\n />\n <GeoJSON\n // hash as a key to force re-rendering\n key={hash(jsonData)}\n data={jsonData}\n />\n {coordinates.latitude && (\n <Marker\n position={[coordinates.latitude, coordinates.longitude]}\n />\n )}\n </Map>\n )}\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n gpxContent: state.gpx,\n mapAttribution: state.application.config.map_attribution,\n }),\n dispatch => ({\n loadActivityGpx: activityId => {\n dispatch(getActivityGpx(activityId))\n },\n loadSegmentGpx: (activityId, segmentId) => {\n dispatch(getSegmentGpx(activityId, segmentId))\n },\n })\n)(ActivityMap)\n","import React from 'react'\n\nexport default function ActivityNoMap(props) {\n const { t } = props\n return (\n <div className=\"activity-no-map text-center\">{t('activities:No Map')}</div>\n )\n}\n","import React from 'react'\n\nexport default function ActivityNotes(props) {\n const { notes, t } = props\n return (\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card activity-card\">\n <div className=\"card-body\">\n Notes\n <div className=\"activity-notes\">\n {notes ? notes : t('activities:No notes')}\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nexport default function ActivitySegments(props) {\n const { segments, t } = props\n return (\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card activity-card\">\n <div className=\"card-body\">\n {t('activities:Segments')}\n <div className=\"activity-segments\">\n <ul>\n {segments.map((segment, index) => (\n <li\n className=\"activity-segments-list\"\n // eslint-disable-next-line react/no-array-index-key\n key={`segment-${index}`}\n >\n <Link\n to={`/activities/${segment.activity_id}/segment/${\n index + 1\n }`}\n >\n {t('activities:segment')} {index + 1}\n </Link>{' '}\n ({t('activities:distance')}: {segment.distance} km,{' '}\n {t('activities:duration')}: {segment.duration})\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { useTranslation } from 'react-i18next'\n\nexport default function CustomModal(props) {\n const { t } = useTranslation()\n return (\n <div className=\"custom-modal-backdrop\">\n <div className=\"custom-modal\">\n <div className=\"modal-content\">\n <div className=\"modal-header\">\n <h5 className=\"modal-title\">{props.title}</h5>\n <button\n type=\"button\"\n className=\"close\"\n aria-label=\"Close\"\n onClick={() => props.close()}\n >\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div className=\"modal-body\">\n <p>{props.text}</p>\n </div>\n <div className=\"modal-footer\">\n <button\n type=\"button\"\n className=\"btn btn-primary\"\n onClick={() => props.confirm()}\n >\n {t('common:Yes')}\n </button>\n <button\n type=\"button\"\n className=\"btn btn-secondary\"\n onClick={() => props.close()}\n >\n {t('common:No')}\n </button>\n </div>\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport ActivityCardHeader from './ActivityCardHeader'\nimport ActivityCharts from './ActivityCharts'\nimport ActivityDetails from './ActivityDetails'\nimport ActivityMap from './ActivityMap'\nimport ActivityNoMap from './ActivityNoMap'\nimport ActivityNotes from './ActivityNotes'\nimport ActivitySegments from './ActivitySegments'\nimport CustomModal from '../../Common/CustomModal'\nimport Message from '../../Common/Message'\nimport { getOrUpdateData } from '../../../actions'\nimport { deleteActivity } from '../../../actions/activities'\n\nclass ActivityDisplay extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayModal: false,\n coordinates: {\n latitude: null,\n longitude: null,\n },\n }\n }\n\n componentDidMount() {\n this.props.loadActivity(this.props.match.params.activityId)\n }\n\n componentDidUpdate(prevProps) {\n if (\n prevProps.match.params.activityId !== this.props.match.params.activityId\n ) {\n this.props.loadActivity(this.props.match.params.activityId)\n }\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n updateCoordinates(activePayload) {\n const coordinates =\n activePayload && activePayload.length > 0\n ? {\n latitude: activePayload[0].payload.latitude,\n longitude: activePayload[0].payload.longitude,\n }\n : {\n latitude: null,\n longitude: null,\n }\n this.setState(prevState => ({\n ...prevState,\n coordinates,\n }))\n }\n\n render() {\n const {\n activities,\n message,\n onDeleteActivity,\n sports,\n t,\n user,\n } = this.props\n const { coordinates, displayModal } = this.state\n const [activity] = activities\n const title = activity ? activity.title : t('activities:Activity')\n const [sport] = activity\n ? sports.filter(s => s.id === activity.sport_id)\n : []\n const segmentId = parseInt(this.props.match.params.segmentId)\n const dataType = segmentId >= 0 ? 'segment' : 'activity'\n return (\n <div className=\"activity-page\">\n <Helmet>\n <title>FitTrackee - {title}</title>\n </Helmet>\n {message ? (\n <Message message={message} t={t} />\n ) : (\n <div className=\"container\">\n {displayModal && (\n <CustomModal\n title={t('common:Confirmation')}\n text={t(\n 'activities:Are you sure you want to delete this activity?'\n )}\n confirm={() => {\n onDeleteActivity(activity.id)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n {activity && sport && activities.length === 1 && (\n <div>\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card activity-card\">\n <div className=\"card-header\">\n <ActivityCardHeader\n activity={activity}\n dataType={dataType}\n segmentId={segmentId}\n sport={sport}\n t={t}\n title={title}\n user={user}\n displayModal={() => this.displayModal(true)}\n />\n </div>\n <div className=\"card-body\">\n <div className=\"row\">\n <div className=\"col-md-8\">\n {activity.with_gpx ? (\n <ActivityMap\n activity={activity}\n coordinates={coordinates}\n dataType={dataType}\n segmentId={segmentId}\n />\n ) : (\n <ActivityNoMap t={t} />\n )}\n </div>\n <div className=\"col\">\n <ActivityDetails\n activity={\n dataType === 'activity'\n ? activity\n : activity.segments[segmentId - 1]\n }\n t={t}\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n {activity.with_gpx && (\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"card activity-card\">\n <div className=\"card-body\">\n <div className=\"row\">\n <div className=\"col\">\n <div className=\"chart-title\">\n {t('activities:Chart')}\n </div>\n <ActivityCharts\n activity={activity}\n dataType={dataType}\n segmentId={segmentId}\n t={t}\n updateCoordinates={e =>\n this.updateCoordinates(e)\n }\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )}\n {dataType === 'activity' && (\n <>\n <ActivityNotes notes={activity.notes} t={t} />\n {activity.segments.length > 1 && (\n <ActivitySegments segments={activity.segments} t={t} />\n )}\n </>\n )}\n </div>\n )}\n </div>\n )}\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n activities: state.activities.data,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadActivity: activityId => {\n dispatch(getOrUpdateData('getData', 'activities', { id: activityId }))\n },\n onDeleteActivity: activityId => {\n dispatch(deleteActivity(activityId))\n },\n })\n )(ActivityDisplay)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\n\nimport ActivityAddOrEdit from './ActivityAddOrEdit'\nimport { getOrUpdateData } from '../../actions'\n\nclass ActivityEdit extends React.Component {\n componentDidMount() {\n this.props.loadActivity(this.props.match.params.activityId)\n }\n\n render() {\n const { activities, message, sports } = this.props\n const [activity] = activities\n return (\n <div>\n {sports.length > 0 && (\n <ActivityAddOrEdit\n activity={activity}\n message={message}\n sports={sports}\n />\n )}\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n activities: state.activities.data,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadActivity: activityId => {\n dispatch(getOrUpdateData('getData', 'activities', { id: activityId }))\n },\n })\n)(ActivityEdit)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { Redirect, Route, Switch } from 'react-router-dom'\n\nimport ActivityAdd from './ActivityAdd'\nimport ActivityDisplay from './ActivityDisplay'\nimport ActivityEdit from './ActivityEdit'\nimport NotFound from './../Others/NotFound'\nimport { isLoggedIn } from '../../utils'\n\nfunction Activity() {\n return (\n <div>\n {isLoggedIn() ? (\n <Switch>\n <Route exact path=\"/activities/add\" component={ActivityAdd} />\n <Route\n exact\n path=\"/activities/:activityId\"\n component={ActivityDisplay}\n />\n <Route\n exact\n path=\"/activities/:activityId/edit\"\n component={ActivityEdit}\n />\n <Route\n path=\"/activities/:activityId/segment/:segmentId\"\n component={ActivityDisplay}\n />\n <Route component={NotFound} />\n </Switch>\n ) : (\n <Redirect to=\"/login\" />\n )}\n </div>\n )\n}\n\nexport default connect(state => ({\n user: state.user,\n}))(Activity)\n","import React from 'react'\n\nimport { translateSports } from '../../utils/activities'\n\nexport default class ActivitiesFilter extends React.PureComponent {\n render() {\n const { loadActivities, sports, t, updateParams } = this.props\n const translatedSports = translateSports(sports, t)\n return (\n <div className=\"card\">\n <div className=\"card-body activity-filter\">\n <form onSubmit={event => event.preventDefault()}>\n <div className=\"form-group\">\n <label>\n {t('activities:From')}:\n <input\n className=\"form-control col-md\"\n name=\"from\"\n onChange={e => updateParams(e)}\n type=\"date\"\n />\n </label>\n <label>\n {t('activities:To')}:\n <input\n className=\"form-control col-md\"\n name=\"to\"\n onChange={e => updateParams(e)}\n type=\"date\"\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('common:Sport')}:\n <select\n className=\"form-control input-lg\"\n name=\"sport_id\"\n onChange={e => updateParams(e)}\n >\n <option value=\"\" />\n {translatedSports.map(sport => (\n <option key={sport.id} value={sport.id}>\n {sport.label}\n </option>\n ))}\n </select>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('activities:Distance')} (km):\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"distance_from\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n <div className=\"col-2 align-middle text-center\">\n {t('common:to')}\n </div>\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"distance_to\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n </div>\n </div>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('activities:Duration')}:\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n name=\"duration_from\"\n onChange={e => updateParams(e)}\n pattern=\"^([0-9]*[0-9]):([0-5][0-9])$\"\n placeholder=\"hh:mm\"\n type=\"text\"\n />\n </div>\n <div className=\"col-2 align-middle text-center\">\n {t('common:to')}\n </div>\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n name=\"duration_to\"\n onChange={e => updateParams(e)}\n pattern=\"^([0-9]*[0-9]):([0-5][0-9])$\"\n placeholder=\"hh:mm\"\n type=\"text\"\n />\n </div>\n </div>\n </div>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('activities:Average speed')} (km/h):\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"ave_speed_from\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n <div className=\"col-2 align-middle text-center\">\n {t('common:to')}\n </div>\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"ave_speed_to\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n </div>\n </div>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('activities:Max. speed')} (km/h):\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"max_speed_from\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n <div className=\"col-2 align-middle text-center\">\n {t('common:to')}\n </div>\n <div className=\"col-5\">\n <input\n className=\"form-control\"\n min={0}\n name=\"max_speed_to\"\n onChange={e => updateParams(e)}\n step=\"1\"\n type=\"number\"\n />\n </div>\n </div>\n </div>\n </label>\n </div>\n <input\n className=\"btn btn-primary btn-lg btn-block\"\n onClick={() => loadActivities()}\n type=\"submit\"\n value={t('activities:Filter')}\n />\n </form>\n </div>\n </div>\n )\n }\n}\n","import React from 'react'\n\nimport { apiUrl } from '../../utils'\n\nexport default class StaticMap extends React.PureComponent {\n render() {\n const { activity, display } = this.props\n\n return (\n <div className={`activity-map${display === 'list' ? '-list' : ''}`}>\n <img\n src={`${apiUrl}activities/map/${activity.map}?${Date.now()}`}\n alt=\"activity map\"\n />\n <div className={`map-attribution${display === 'list' ? '-list' : ''}`}>\n <span className=\"map-attribution-text\">©</span>\n <a\n className=\"map-attribution-text\"\n href=\"http://www.openstreetmap.org/copyright\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n OpenStreetMap\n </a>\n </div>\n </div>\n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport StaticMap from '../Common/StaticMap'\nimport { getDateWithTZ } from '../../utils'\n\nexport default class ActivitiesList extends React.PureComponent {\n render() {\n const { activities, loading, sports, t, user } = this.props\n return (\n <div className=\"card activity-card\">\n <div className=\"card-body\">\n <table className=\"table\">\n <thead>\n <tr>\n <th scope=\"col\" />\n <th scope=\"col\">{t('common:Workout')}</th>\n <th scope=\"col\">{t('activities:Date')}</th>\n <th scope=\"col\">{t('activities:Distance')}</th>\n <th scope=\"col\">{t('activities:Duration')}</th>\n <th scope=\"col\">{t('activities:Ave. speed')}</th>\n <th scope=\"col\">{t('activities:Max. speed')}</th>\n </tr>\n </thead>\n <tbody>\n {!loading &&\n sports &&\n activities.map((activity, idx) => (\n // eslint-disable-next-line react/no-array-index-key\n <tr key={idx}>\n <td>\n <span className=\"heading-span-absolute\">\n {t('common:Sport')}\n </span>\n <img\n className=\"activity-sport\"\n src={sports\n .filter(s => s.id === activity.sport_id)\n .map(s => s.img)}\n alt=\"activity sport logo\"\n />\n </td>\n <td className=\"activity-title\">\n <span className=\"heading-span-absolute\">\n {t('common:Workout')}\n </span>\n <Link to={`/activities/${activity.id}`}>\n {activity.title}\n </Link>\n {activity.map && (\n <StaticMap activity={activity} display=\"list\" />\n )}\n </td>\n <td>\n <span className=\"heading-span-absolute\">\n {t('activities:Date')}\n </span>\n {format(\n getDateWithTZ(activity.activity_date, user.timezone),\n 'dd/MM/yyyy HH:mm'\n )}\n </td>\n <td className=\"text-right\">\n <span className=\"heading-span-absolute\">\n {t('activities:Distance')}\n </span>\n {Number(activity.distance).toFixed(2)} km\n </td>\n <td className=\"text-right\">\n <span className=\"heading-span-absolute\">\n {t('activities:Duration')}\n </span>\n {activity.moving}\n </td>\n <td className=\"text-right\">\n <span className=\"heading-span-absolute\">\n {t('activities:Ave. speed')}\n </span>\n {activity.ave_speed} km/h\n </td>\n <td className=\"text-right\">\n <span className=\"heading-span-absolute\">\n {t('activities:Max. speed')}\n </span>\n {activity.max_speed} km/h\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n {loading && <div className=\"loader\" />}\n </div>\n </div>\n )\n }\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nexport default class NoActivities extends React.PureComponent {\n render() {\n const { t } = this.props\n return (\n <div className=\"card text-center\">\n <div className=\"card-body\">\n {t('common:No workouts.')}{' '}\n <Link to={{ pathname: '/activities/add' }}>\n {t('dashboard:Upload one !')}\n </Link>\n </div>\n </div>\n )\n }\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport ActivitiesFilter from './ActivitiesFilter'\nimport ActivitiesList from './ActivitiesList'\nimport Message from '../Common/Message'\nimport NoActivities from '../Common/NoActivities'\nimport { getOrUpdateData } from '../../actions'\nimport { getMoreActivities } from '../../actions/activities'\n\nclass Activities extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n params: {\n page: 1,\n per_page: 10,\n },\n }\n }\n\n componentDidMount() {\n this.props.loadActivities(this.state.params)\n }\n\n setParams(e) {\n const { params } = this.state\n if (e.target.value === '') {\n delete params[e.target.name]\n } else {\n params[e.target.name] = e.target.value\n }\n params.page = 1\n this.setState(params)\n }\n render() {\n const {\n activities,\n loading,\n loadActivities,\n loadMoreActivities,\n message,\n sports,\n t,\n user,\n } = this.props\n const { params } = this.state\n const paginationEnd =\n activities.length > 0\n ? activities[activities.length - 1].previous_activity === null\n : true\n return (\n <div>\n <Helmet>\n <title>FitTrackee - {t('common:Workouts')}</title>\n </Helmet>\n {message ? (\n <Message message={message} t={t} />\n ) : (\n <div className=\"container history\">\n <div className=\"row\">\n <div className=\"col-md-3\">\n <ActivitiesFilter\n sports={sports}\n loadActivities={() => loadActivities(params)}\n t={t}\n updateParams={e => this.setParams(e)}\n />\n </div>\n <div className=\"col-md-9 activities-result\">\n <ActivitiesList\n activities={activities}\n loading={loading}\n sports={sports}\n t={t}\n user={user}\n />\n {!paginationEnd && (\n <input\n type=\"submit\"\n className=\"btn btn-default btn-md btn-block\"\n value=\"Load more activities\"\n onClick={() => {\n params.page += 1\n loadMoreActivities(params)\n this.setState(params)\n }}\n />\n )}\n {activities.length === 0 && <NoActivities t={t} />}\n </div>\n </div>\n </div>\n )}\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n activities: state.activities.data,\n loading: state.loading,\n message: state.message,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadActivities: params => {\n dispatch(getOrUpdateData('getData', 'activities', params))\n },\n loadMoreActivities: params => {\n dispatch(getMoreActivities(params))\n },\n })\n )(Activities)\n)\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport Message from '../Common/Message'\nimport { deletePicture, uploadPicture } from '../../actions/user'\nimport { apiUrl, getFileSize } from '../../utils'\nimport { history } from '../../index'\n\nfunction ProfileDetail({\n appConfig,\n displayModal,\n editable,\n isDeletable,\n message,\n onDeletePicture,\n onUploadPicture,\n pathname,\n t,\n user,\n}) {\n const createdAt = user.created_at\n ? format(new Date(user.created_at), 'dd/MM/yyyy HH:mm')\n : ''\n const birthDate = user.birth_date\n ? format(new Date(user.birth_date), 'dd/MM/yyyy')\n : ''\n const fileSizeLimit = getFileSize(appConfig.max_single_file_size)\n return (\n <div>\n <Helmet>\n <title>FitTrackee - {t('user:Profile')}</title>\n </Helmet>\n <Message message={message} t={t} />\n <div className=\"container\">\n <h1 className=\"page-title\">{t('user:Profile')}</h1>\n <div className=\"row\">\n <div className=\"col-md-12\">\n <div className=\"card\">\n <div className=\"card-header userName\">\n <strong>{user.username}</strong>\n </div>\n <div className=\"card-body\">\n <div className=\"row\">\n <div className=\"col-md-8\">\n <p>\n {/* eslint-disable-next-line max-len */}\n <span className=\"user-label\">\n {t('user:Email')}\n </span>: {user.email}\n </p>\n <p>\n <span className=\"user-label\">\n {t('user:Registration Date')}\n </span>\n : {createdAt}\n </p>\n <p>\n <span className=\"user-label\">{t('user:First Name')}</span>\n : {user.first_name}\n </p>\n <p>\n {/* eslint-disable-next-line max-len */}\n <span className=\"user-label\">\n {t('user:Last Name')}\n </span>: {user.last_name}\n </p>\n <p>\n <span className=\"user-label\">{t('user:Birth Date')}</span>\n : {birthDate}\n </p>\n <p>\n {/* eslint-disable-next-line max-len */}\n <span className=\"user-label\">\n {t('user:Location')}\n </span>: {user.location}\n </p>\n <p>\n <span className=\"user-label\">{t('user:Bio')}</span>:{' '}\n {user.bio}\n </p>\n <p>\n {/* eslint-disable-next-line max-len */}\n <span className=\"user-label\">\n {t('user:Language')}\n </span>: {user.language}\n </p>\n <p>\n {/* eslint-disable-next-line max-len */}\n <span className=\"user-label\">\n {t('user:Timezone')}\n </span>: {user.timezone}\n </p>\n <p>\n <span className=\"user-label\">\n {t('user:First day of week')}\n </span>\n : {user.weekm ? t('user:Monday') : t('user:Sunday')}\n </p>\n </div>\n <div className=\"col-md-4\">\n {user.picture === true && (\n <div>\n <img\n alt=\"Profile\"\n src={\n `${apiUrl}users/${user.username}/picture` +\n `?${Date.now()}`\n }\n className=\"img-fluid App-profile-img-small\"\n />\n {editable && (\n <>\n <br />\n <button\n type=\"submit\"\n onClick={() => onDeletePicture()}\n >\n {t('user:Delete picture')}\n </button>\n <br />\n <br />\n </>\n )}\n </div>\n )}\n {editable && (\n <form\n encType=\"multipart/form-data\"\n onSubmit={event => onUploadPicture(event)}\n >\n <input\n type=\"file\"\n name=\"picture\"\n accept=\".png,.jpg,.gif\"\n />\n <br />\n <button type=\"submit\">{t('user:Send')}</button>\n {` (max. size: ${fileSizeLimit})`}\n </form>\n )}{' '}\n </div>\n </div>\n {editable && (\n <button\n className=\"btn btn-primary\"\n onClick={() => history.push('/profile/edit')}\n >\n {t('common:Edit')}\n </button>\n )}\n {isDeletable && (\n <button\n className=\"btn btn-danger\"\n onClick={() => displayModal(true)}\n >\n {t('user:Delete user account')}\n </button>\n )}\n <button\n className=\"btn btn-secondary\"\n onClick={() =>\n pathname === '/profile' ? history.push('/') : history.go(-1)\n }\n >\n {t(\n pathname === '/profile'\n ? 'common:Back to home'\n : 'common:Back'\n )}\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n appConfig: state.application.config,\n pathname: state.router.location.pathname,\n message: state.message,\n }),\n dispatch => ({\n onDeletePicture: () => {\n dispatch(deletePicture())\n },\n onUploadPicture: event => {\n dispatch(uploadPicture(event))\n },\n })\n )(ProfileDetail)\n)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport ProfileDetail from './ProfileDetail'\n\nfunction CurrentUserProfile({ t, user }) {\n return (\n <div>\n <ProfileDetail editable t={t} user={user} />\n </div>\n )\n}\n\nexport default withTranslation()(\n connect(state => ({\n user: state.user,\n }))(CurrentUserProfile)\n)\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport StaticMap from '../Common/StaticMap'\nimport { getDateWithTZ } from '../../utils'\n\nexport default function ActivityCard(props) {\n const { activity, sports, t, user } = props\n\n return (\n <div className=\"card activity-card text-center\">\n <div className=\"card-header\">\n <Link to={`/activities/${activity.id}`}>\n {sports\n .filter(sport => sport.id === activity.sport_id)\n .map(sport => t(`sports:${sport.label}`))}{' '}\n -{' '}\n {format(\n getDateWithTZ(activity.activity_date, user.timezone),\n 'dd/MM/yyyy HH:mm'\n )}\n </Link>\n </div>\n <div className=\"card-body\">\n <div className=\"row\">\n {activity.map && (\n <div className=\"col\">\n <StaticMap activity={activity} />\n </div>\n )}\n <div className=\"col\">\n <p>\n <i className=\"fa fa-clock-o\" aria-hidden=\"true\" />{' '}\n {t('activities:Duration')}: {activity.moving}\n {activity.map ? (\n <span>\n <br />\n <br />\n </span>\n ) : (\n ' - '\n )}\n <i className=\"fa fa-road\" aria-hidden=\"true\" />{' '}\n {t('activities:Distance')}: {activity.distance} km\n </p>\n </div>\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { recordsLabels } from '../../utils/activities'\n\nexport default function CalendarActivity(props) {\n const { activity, isDisabled, isMore, sportImg } = props\n return (\n <Link\n className={`calendar-activity${isMore}`}\n to={`/activities/${activity.id}`}\n >\n <>\n <img\n alt=\"activity sport logo\"\n className={`activity-sport ${isDisabled}`}\n src={sportImg}\n title={activity.title}\n />\n {activity.records.length > 0 && (\n <sup>\n <i\n className=\"fa fa-trophy custom-fa-small\"\n aria-hidden=\"true\"\n title={activity.records.map(\n rec =>\n ` ${\n recordsLabels.filter(\n r => r.record_type === rec.record_type\n )[0].label\n }`\n )}\n />\n </sup>\n )}\n </>\n </Link>\n )\n}\n","import React from 'react'\n\nimport CalendarActivity from './CalendarActivity'\n\nexport default class CalendarActivities extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n isHidden: true,\n }\n }\n\n handleDisplayMore() {\n this.setState({\n isHidden: !this.state.isHidden,\n })\n }\n\n render() {\n const { dayActivities, isDisabled, sports } = this.props\n const { isHidden } = this.state\n return (\n <div>\n {dayActivities.map(act => (\n <CalendarActivity\n key={act.id}\n activity={act}\n isDisabled={isDisabled}\n isMore=\"\"\n sportImg={sports.filter(s => s.id === act.sport_id).map(s => s.img)}\n />\n ))}\n {dayActivities.length > 2 && (\n <i\n className={`fa fa-${isHidden ? 'plus' : 'times'} calendar-more`}\n aria-hidden=\"true\"\n onClick={() => this.handleDisplayMore()}\n title=\"show more activities\"\n />\n )}\n {!isHidden && (\n <div className=\"calendar-display-more\">\n {dayActivities.map(act => (\n <CalendarActivity\n key={act.id}\n activity={act}\n isDisabled={isDisabled}\n isMore=\"-more\"\n sportImg={sports\n .filter(s => s.id === act.sport_id)\n .map(s => s.img)}\n />\n ))}\n </div>\n )}\n </div>\n )\n }\n}\n","// eslint-disable-next-line max-len\n// source: https://blog.flowandform.agency/create-a-custom-calendar-in-react-3df1bfd0b728\nimport {\n addDays,\n addMonths,\n endOfMonth,\n endOfWeek,\n format,\n isSameDay,\n isSameMonth,\n isToday,\n startOfMonth,\n startOfWeek,\n subMonths,\n} from 'date-fns'\nimport { enGB, fr } from 'date-fns/locale'\nimport React from 'react'\nimport { connect } from 'react-redux'\n\nimport CalendarActivities from './CalendarActivities'\nimport { getMonthActivities } from '../../actions/activities'\nimport { getDateWithTZ } from '../../utils'\n\nconst getStartAndEndMonth = (date, weekStartOnMonday) => {\n const monthStart = startOfMonth(date)\n const monthEnd = endOfMonth(date)\n const weekStartsOn = weekStartOnMonday ? 1 : 0\n return {\n start: startOfWeek(monthStart, { weekStartsOn }),\n end: endOfWeek(monthEnd),\n }\n}\n\nclass Calendar extends React.Component {\n constructor(props, context) {\n super(props, context)\n const calendarDate = new Date()\n this.state = {\n currentMonth: calendarDate,\n startDate: getStartAndEndMonth(calendarDate, props.weekm).start,\n endDate: getStartAndEndMonth(calendarDate, props.weekm).end,\n weekStartOnMonday: props.weekm,\n }\n }\n\n componentDidMount() {\n this.props.loadMonthActivities(this.state.startDate, this.state.endDate)\n }\n\n renderHeader(localeOptions) {\n const dateFormat = 'MMM yyyy'\n return (\n <div className=\"header row flex-middle\">\n <div className=\"col col-start\" onClick={() => this.handlePrevMonth()}>\n <i className=\"fa fa-chevron-left\" aria-hidden=\"true\" />\n </div>\n <div className=\"col col-center\">\n <span>\n {format(this.state.currentMonth, dateFormat, localeOptions)}\n </span>\n </div>\n <div className=\"col col-end\" onClick={() => this.handleNextMonth()}>\n <i className=\"fa fa-chevron-right\" aria-hidden=\"true\" />\n </div>\n </div>\n )\n }\n\n renderDays(localeOptions) {\n const dateFormat = 'EEE'\n const days = []\n const { startDate } = this.state\n\n for (let i = 0; i < 7; i++) {\n days.push(\n <div className=\"col col-center\" key={i}>\n {format(addDays(startDate, i), dateFormat, localeOptions)}\n </div>\n )\n }\n return <div className=\"days row\">{days}</div>\n }\n\n filterActivities(day) {\n const { activities, user } = this.props\n if (activities) {\n return activities.filter(act =>\n isSameDay(getDateWithTZ(act.activity_date, user.timezone), day)\n )\n }\n return []\n }\n\n renderCells() {\n const { currentMonth, startDate, endDate, weekStartOnMonday } = this.state\n const { sports } = this.props\n\n const dateFormat = 'd'\n const rows = []\n\n let days = []\n let day = startDate\n let formattedDate = ''\n\n while (day <= endDate) {\n for (let i = 0; i < 7; i++) {\n formattedDate = format(day, dateFormat)\n const dayActivities = this.filterActivities(day)\n const isDisabled = isSameMonth(day, currentMonth) ? '' : '-disabled'\n const isWeekEnd = weekStartOnMonday\n ? [5, 6].includes(i)\n : [0, 6].includes(i)\n days.push(\n <div\n className={`col cell ${isWeekEnd ? ' weekend' : ''}${\n isToday(day) ? ' today' : ''\n }`}\n key={day}\n >\n <div className={`img${isDisabled}`}>\n <span className=\"number\">{formattedDate}</span>\n <CalendarActivities\n dayActivities={dayActivities}\n isDisabled={isDisabled}\n sports={sports}\n />\n </div>\n </div>\n )\n day = addDays(day, 1)\n }\n rows.push(\n <div className=\"row\" key={day}>\n {days}\n </div>\n )\n days = []\n }\n return <div className=\"body\">{rows}</div>\n }\n\n updateStateDate(calendarDate) {\n const { start, end } = getStartAndEndMonth(\n calendarDate,\n this.state.weekStartOnMonday\n )\n this.setState({\n currentMonth: calendarDate,\n startDate: start,\n endDate: end,\n })\n this.props.loadMonthActivities(start, end)\n }\n\n handleNextMonth() {\n const calendarDate = addMonths(this.state.currentMonth, 1)\n this.updateStateDate(calendarDate)\n }\n\n handlePrevMonth() {\n const calendarDate = subMonths(this.state.currentMonth, 1)\n this.updateStateDate(calendarDate)\n }\n\n render() {\n const localeOptions = {\n locale: this.props.language === 'fr' ? fr : enGB,\n }\n return (\n <div className=\"card activity-card\">\n <div className=\"calendar\">\n {this.renderHeader(localeOptions)}\n {this.renderDays(localeOptions)}\n {this.renderCells()}\n </div>\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n activities: state.calendarActivities.data,\n language: state.language,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadMonthActivities: (start, end) => {\n const dateFormat = 'yyyy-MM-dd'\n dispatch(\n getMonthActivities(format(start, dateFormat), format(end, dateFormat))\n )\n },\n })\n)(Calendar)\n","import React from 'react'\nimport { Link } from 'react-router-dom'\n\nimport { formatRecord, translateSports } from '../../utils/activities'\n\nexport default function RecordsCard(props) {\n const { records, sports, t, user } = props\n const translatedSports = translateSports(sports, t)\n const recordsBySport = records.reduce((sportList, record) => {\n const sport = translatedSports.find(s => s.id === record.sport_id)\n if (sportList[sport.label] === void 0) {\n sportList[sport.label] = {\n img: sport.img,\n records: [],\n }\n }\n sportList[sport.label].records.push(formatRecord(record, user.timezone))\n return sportList\n }, {})\n\n return (\n <div className=\"card activity-card\">\n <div className=\"card-header\">{t('activities:Personal records')}</div>\n <div className=\"card-body\">\n {Object.keys(recordsBySport).length === 0\n ? t('common:No records.')\n : Object.keys(recordsBySport)\n .sort()\n .map(sportLabel => (\n <div key={sportLabel}>\n <span className=\"heading-span\">\n <img\n alt={`${sportLabel} logo`}\n className=\"record-logo\"\n src={recordsBySport[sportLabel].img}\n />\n {sportLabel}\n </span>\n {/* eslint-disable-next-line max-len */}\n <table className=\"table table-borderless table-sm record-table\">\n <thead>\n <tr>\n <th colSpan=\"3\">\n <img\n alt={`${sportLabel} logo`}\n className=\"record-logo\"\n src={recordsBySport[sportLabel].img}\n />\n {sportLabel}\n </th>\n </tr>\n </thead>\n <tbody>\n {recordsBySport[sportLabel].records.map(rec => (\n <tr className=\"record-tr\" key={rec.id}>\n <td className=\"record-td\">\n {t(`activities:${rec.record_type}`)}\n </td>\n <td className=\"record-td text-right\">{rec.value}</td>\n <td className=\"record-td text-right\">\n <Link to={`/activities/${rec.activity_id}`}>\n {rec.activity_date}\n </Link>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n ))}\n </div>\n </div>\n )\n}\n","import FitTrackeeGenericApi from '../fitTrackeeApi'\nimport { setData, setError } from './index'\n\nexport const getStats = (userName, type, data) => dispatch =>\n FitTrackeeGenericApi.getData(`stats/${userName}/${type}`, data)\n .then(ret => {\n if (ret.status === 'success') {\n dispatch(setData('statistics', ret.data))\n } else {\n dispatch(setError(`statistics|${ret.message}`))\n }\n })\n .catch(error => dispatch(setError(`statistics|${error}`)))\n","import {\n addDays,\n addMonths,\n addYears,\n format,\n startOfMonth,\n startOfWeek,\n startOfYear,\n} from 'date-fns'\n\nconst xAxisFormats = [\n { duration: 'week', dateFormat: 'yyyy-MM-dd', xAxis: 'dd/MM' },\n { duration: 'month', dateFormat: 'yyyy-MM', xAxis: 'MM/yyyy' },\n { duration: 'year', dateFormat: 'yyyy', xAxis: 'yyyy' },\n]\n\nexport const formatDuration = (totalSeconds, formatWithDay = false) => {\n let days = '0'\n if (formatWithDay) {\n days = String(Math.floor(totalSeconds / 86400))\n totalSeconds %= 86400\n }\n const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0')\n totalSeconds %= 3600\n const minutes = String(Math.floor(totalSeconds / 60)).padStart(2, '0')\n const seconds = String(totalSeconds % 60).padStart(2, '0')\n if (formatWithDay) {\n return `${days === '0' ? '' : `${days}d:`}${\n hours === '00' ? '' : `${hours}h:`\n }${minutes}m:${seconds}s`\n }\n return `${hours === '00' ? '' : `${hours}:`}${minutes}:${seconds}`\n}\n\nexport const formatValue = (displayedData, value) =>\n value === 0\n ? ''\n : displayedData === 'distance'\n ? `${value.toFixed(2)} km`\n : displayedData === 'duration'\n ? formatDuration(value)\n : value\n\nconst dateIncrement = (duration, day) => {\n switch (duration) {\n case 'week':\n return addDays(day, 7)\n case 'year':\n return addYears(day, 1)\n case 'month':\n default:\n return addMonths(day, 1)\n }\n}\n\nconst startDate = (duration, day, weekm) => {\n switch (duration) {\n case 'week':\n return startOfWeek(day, { weekStartsOn: weekm ? 1 : 0 })\n case 'year':\n return startOfYear(day)\n case 'month':\n default:\n return startOfMonth(day)\n }\n}\n\nexport const formatStats = (stats, sports, params, displayedSports, weekm) => {\n const nbActivitiesStats = []\n const distanceStats = []\n const durationStats = []\n\n for (\n let day = startDate(params.duration, params.start, weekm);\n day <= params.end;\n day = dateIncrement(params.duration, day)\n ) {\n const [xAxisFormat] = xAxisFormats.filter(\n x => x.duration === params.duration\n )\n const date = format(day, xAxisFormat.dateFormat)\n const xAxis = format(day, xAxisFormat.xAxis)\n const dataNbActivities = { date: xAxis }\n const dataDistance = { date: xAxis }\n const dataDuration = { date: xAxis }\n\n if (stats[date]) {\n Object.keys(stats[date])\n .filter(sportId =>\n displayedSports ? displayedSports.includes(+sportId) : true\n )\n .map(sportId => {\n const sportLabel = sports.filter(s => s.id === +sportId)[0].label\n dataNbActivities[sportLabel] = stats[date][sportId].nb_activities\n dataDistance[sportLabel] = stats[date][sportId].total_distance\n dataDuration[sportLabel] = stats[date][sportId].total_duration\n return null\n })\n }\n nbActivitiesStats.push(dataNbActivities)\n distanceStats.push(dataDistance)\n durationStats.push(dataDuration)\n }\n\n return {\n activities: nbActivitiesStats,\n distance: distanceStats,\n duration: durationStats,\n }\n}\n","import React from 'react'\n\nimport { formatDuration } from '../../../utils/stats'\n\nconst formatValue = (displayedData, value) =>\n displayedData === 'duration'\n ? formatDuration(value, true)\n : displayedData === 'distance'\n ? value.toFixed(2)\n : value\n\n/**\n * @return {null}\n */\nexport default function CustomTooltip(props) {\n const { active } = props\n if (active) {\n const { displayedData, payload, label } = props\n let total = 0\n payload.map(p => (total += p.value))\n return (\n <div className=\"custom-tooltip\">\n <p className=\"custom-tooltip-label\">{label}</p>\n {payload.map(p => (\n <p key={p.name} style={{ color: p.fill }}>\n {p.name}: {formatValue(displayedData, p.value)} {p.unit}\n </p>\n ))}\n {payload.length > 0 && (\n <p>Total: {formatValue(displayedData, total)}</p>\n )}\n </div>\n )\n }\n return null\n}\n","import React from 'react'\n\nimport { formatValue } from '../../../utils/stats'\n\n/**\n * @return {null}\n */\nexport default function CustomLabel(props) {\n const { displayedData, x, y, width, value } = props\n if (!value) {\n return null\n }\n const radius = 10\n const formattedValue = formatValue(displayedData, value)\n\n return (\n <g>\n <text\n x={x + width / 2}\n y={y - radius}\n fill=\"#666\"\n fontSize=\"11\"\n textAnchor=\"middle\"\n dominantBaseline=\"middle\"\n >\n {formattedValue}\n </text>\n </g>\n )\n}\n","import React from 'react'\nimport {\n Bar,\n BarChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts'\n\nimport { activityColors } from '../../../utils/activities'\nimport { formatValue } from '../../../utils/stats'\nimport CustomTooltip from './CustomTooltip'\nimport CustomLabel from './CustomLabel'\n\nexport default class StatsCharts extends React.PureComponent {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayedData: 'distance',\n }\n }\n handleRadioChange(changeEvent) {\n this.setState({\n displayedData: changeEvent.target.name,\n })\n }\n\n render() {\n const { displayedData } = this.state\n const { sports, stats, t } = this.props\n if (Object.keys(stats).length === 0) {\n return t('common:No workouts.')\n }\n return (\n <div className=\"chart-stats\">\n <div className=\"row chart-radio\">\n <label className=\"radioLabel col\">\n <input\n type=\"radio\"\n name=\"distance\"\n checked={displayedData === 'distance'}\n onChange={e => this.handleRadioChange(e)}\n />\n {t('statistics:distance')}\n </label>\n <label className=\"radioLabel col\">\n <input\n type=\"radio\"\n name=\"duration\"\n checked={displayedData === 'duration'}\n onChange={e => this.handleRadioChange(e)}\n />\n {t('statistics:duration')}\n </label>\n <label className=\"radioLabel col\">\n <input\n type=\"radio\"\n name=\"activities\"\n checked={displayedData === 'activities'}\n onChange={e => this.handleRadioChange(e)}\n />\n {t('statistics:activities')}\n </label>\n </div>\n <ResponsiveContainer height={300}>\n <BarChart data={stats[displayedData]} margin={{ top: 15, bottom: 0 }}>\n <XAxis\n dataKey=\"date\"\n interval={0} // to force to display all ticks\n />\n <YAxis tickFormatter={value => formatValue(displayedData, value)} />\n <Tooltip\n content={<CustomTooltip displayedData={displayedData} />}\n />\n {sports.map((s, i) => (\n <Bar\n // disable for now due to problems w/ CustomLabel\n // see https://github.com/recharts/recharts/issues/829\n isAnimationActive={false}\n key={s.id}\n dataKey={s.label}\n stackId=\"a\"\n fill={activityColors[i]}\n label={\n i === sports.length - 1 ? (\n <CustomLabel displayedData={displayedData} />\n ) : (\n ''\n )\n }\n name={t(`sports:${s.label}`)}\n />\n ))}\n </BarChart>\n </ResponsiveContainer>\n </div>\n )\n }\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { connect } from 'react-redux'\n\nimport { getStats } from '../../../actions/stats'\nimport { formatStats } from '../../../utils/stats'\nimport StatsChart from './StatsChart'\n\nclass Statistics extends React.PureComponent {\n componentDidMount() {\n this.updateData()\n }\n\n componentDidUpdate(prevProps) {\n if (\n (this.props.user.username &&\n this.props.user.username !== prevProps.user.username) ||\n this.props.statsParams !== prevProps.statsParams\n ) {\n this.updateData()\n }\n }\n\n updateData() {\n if (this.props.user.username) {\n this.props.loadActivities(\n this.props.user.username,\n this.props.user.weekm,\n this.props.statsParams\n )\n }\n }\n\n render() {\n const {\n displayedSports,\n sports,\n statistics,\n statsParams,\n displayEmpty,\n t,\n user,\n } = this.props\n if (!displayEmpty && Object.keys(statistics).length === 0) {\n return <span>{t('common:No workouts.')}</span>\n }\n const stats = formatStats(\n statistics,\n sports,\n statsParams,\n displayedSports,\n user.weekm\n )\n return <StatsChart sports={sports} stats={stats} t={t} />\n }\n}\n\nexport default connect(\n state => ({\n sports: state.sports.data,\n statistics: state.statistics.data,\n user: state.user,\n }),\n dispatch => ({\n loadActivities: (userName, weekm, data) => {\n const dateFormat = 'yyyy-MM-dd'\n // depends on user config (first day of week)\n const time =\n data.duration === 'week'\n ? `${data.duration}${weekm ? 'm' : ''}`\n : data.duration\n const params = {\n from: format(data.start, dateFormat),\n to: format(data.end, dateFormat),\n time: time,\n }\n dispatch(getStats(userName, data.type, params))\n },\n })\n)(Statistics)\n","import { endOfMonth, startOfMonth } from 'date-fns'\nimport React from 'react'\n\nimport Stats from '../Common/Stats'\n\nexport default class Statistics extends React.Component {\n constructor(props, context) {\n super(props, context)\n const date = new Date()\n this.state = {\n start: startOfMonth(date),\n end: endOfMonth(date),\n duration: 'week',\n type: 'by_time',\n }\n }\n\n render() {\n const { t } = this.props\n return (\n <div className=\"card activity-card\">\n <div className=\"card-header\">{t('dashboard:This month')}</div>\n <div className=\"card-body\">\n <Stats displayEmpty={false} statsParams={this.state} t={t} />\n </div>\n </div>\n )\n }\n}\n","import React from 'react'\n\nexport default function UserStatistics(props) {\n const { t, user } = props\n const days = user.total_duration.match(/day/g)\n ? `${user.total_duration.split(' ')[0]} ${\n user.total_duration.match(/days/g) ? t('common:days') : t('common:day')\n }`\n : `0 ${t('common:days')},`\n let duration = user.total_duration.match(/day/g)\n ? user.total_duration.split(', ')[1]\n : user.total_duration\n duration = `${duration.split(':')[0]}h ${duration.split(':')[1]}min`\n return (\n <div className=\"row\">\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card activity-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-calendar fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">{user.nb_activities}</div>\n <div>{`${\n user.nb_activities === 1\n ? t('common:workout')\n : t('common:workouts')\n }`}</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card activity-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-road fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">\n {Number(user.total_distance).toFixed(2)}\n </div>\n <div>km</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card activity-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-clock-o fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">{days}</div>\n <div>{duration}</div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-3 col-md-6 col-sm-6\">\n <div className=\"card activity-card\">\n <div className=\"card-body row\">\n <div className=\"col-3\">\n <i className=\"fa fa-tags fa-3x fa-color\" />\n </div>\n <div className=\"col-9 text-right\">\n <div className=\"huge\">{user.nb_sports}</div>\n <div>{`${\n user.nb_sports === 1 ? t('common:sport') : t('common:sports')\n }`}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport ActivityCard from './ActivityCard'\nimport Calendar from './Calendar'\nimport Message from '../Common/Message'\nimport NoActivities from '../Common/NoActivities'\nimport Records from './Records'\nimport Statistics from './Statistics'\nimport UserStatistics from './UserStatistics'\nimport { getOrUpdateData } from '../../actions'\nimport { getMoreActivities } from '../../actions/activities'\n\nclass DashBoard extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n page: 1,\n }\n }\n\n componentDidMount() {\n this.props.loadActivities()\n }\n\n render() {\n const {\n activities,\n loadMoreActivities,\n message,\n records,\n sports,\n t,\n user,\n } = this.props\n const paginationEnd =\n activities.length > 0\n ? activities[activities.length - 1].previous_activity === null\n : true\n const { page } = this.state\n return (\n <div>\n <Helmet>\n <title>FitTrackee - {t('common:Dashboard')}</title>\n </Helmet>\n {message ? (\n <Message message={message} t={t} />\n ) : (\n activities &&\n user.total_duration &&\n sports.length > 0 && (\n <div className=\"container dashboard\">\n <UserStatistics user={user} t={t} />\n <div className=\"row\">\n <div className=\"col-md-4\">\n <Statistics t={t} />\n <Records\n t={t}\n records={records}\n sports={sports}\n user={user}\n />\n </div>\n <div className=\"col-md-8\">\n <Calendar weekm={user.weekm} />\n {activities.length > 0 ? (\n activities.map(activity => (\n <ActivityCard\n activity={activity}\n key={activity.id}\n sports={sports}\n t={t}\n user={user}\n />\n ))\n ) : (\n <NoActivities t={t} />\n )}\n {!paginationEnd && (\n <input\n type=\"submit\"\n className=\"btn btn-default btn-md btn-block\"\n value=\"Load more activities\"\n onClick={() => {\n loadMoreActivities(page + 1)\n this.setState({ page: page + 1 })\n }}\n />\n )}\n </div>\n </div>\n </div>\n )\n )}\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n activities: state.activities.data,\n message: state.message,\n records: state.records.data,\n sports: state.sports.data,\n user: state.user,\n }),\n dispatch => ({\n loadActivities: () => {\n dispatch(getOrUpdateData('getData', 'activities', { page: 1 }))\n dispatch(getOrUpdateData('getData', 'records'))\n },\n loadMoreActivities: page => {\n dispatch(getMoreActivities({ page }))\n },\n })\n )(DashBoard)\n)\n","import React from 'react'\n\nimport { version } from './../../utils'\n\nexport default function Footer() {\n return (\n <footer className=\"footer\">\n <div className=\"container\">\n <strong>FitTrackee</strong> v{version} -{' '}\n <a\n href=\"https://github.com/SamR1/FitTrackee\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n source code\n </a>{' '}\n under{' '}\n <a\n href=\"https://choosealicense.com/licenses/gpl-3.0/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n GPLv3\n </a>{' '}\n license -{' '}\n <a\n href=\"https://samr1.github.io/FitTrackee/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n documentation\n </a>\n </div>\n </footer>\n )\n}\n","import React from 'react'\nimport { Trans } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Link } from 'react-router-dom'\n\nimport { logout } from '../../actions/user'\n\nclass Logout extends React.Component {\n componentDidMount() {\n this.props.UserLogout()\n }\n render() {\n return (\n <div className=\"container dashboard\">\n <div className=\"row\">\n <div className=\"col-2\" />\n <div className=\"card col-8\">\n <div className=\"card-body\">\n <div className=\"text-center\">\n <Trans i18nKey=\"user:loggedOut\">\n You are now logged out. Click <Link to=\"/login\">here</Link> to\n log back in.\n </Trans>\n </div>\n </div>\n </div>\n <div className=\"col-2\" />\n </div>\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n user: state.user,\n }),\n dispatch => ({\n UserLogout: () => {\n dispatch(logout())\n },\n })\n)(Logout)\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m466.916 27.803h-421.832c-24.859 0-45.084 20.225-45.084 45.084v366.226c0 24.859 20.225 45.084 45.084 45.084h421.832c24.859 0 45.084-20.225 45.084-45.084v-366.226c0-24.859-20.225-45.084-45.084-45.084z\",\n fill: \"#f0f9ff\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m198.58 188.334-181.344-150.862c-7.75 6.107-13.456 14.691-15.905 24.554l164.142 136.551h33.102z\",\n fill: \"#f40055\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 198.576h33.93l163.447-135.973c-2.325-9.923-7.93-18.592-15.613-24.796l-181.764 151.211z\",\n fill: \"#c20044\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m165.472 313.425-164.141 136.549c2.449 9.863 8.155 18.447 15.905 24.553l181.344-150.861-.005-10.241z\",\n fill: \"#f40055\"\n});\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 313.425v9.557l181.765 151.211c7.683-6.204 13.288-14.874 15.613-24.796l-163.446-135.971z\",\n fill: \"#c20044\"\n});\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m53.273 27.803 145.302 120.879v-120.879z\",\n fill: \"#406bd4\"\n});\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 150.571v-122.768h148.082z\",\n fill: \"#3257b0\"\n});\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m394.732 198.575 117.268-97.556v97.556z\",\n fill: \"#3257b0\"\n});\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"g\", {\n fill: \"#406bd4\"\n}, /*#__PURE__*/React.createElement(\"path\", {\n d: \"m0 99.317v99.258h119.313z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m0 313.425v97.699l117.44-97.699z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"m50.49 484.197 148.085-122.676v122.676z\"\n}));\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m313.425 484.197v-124.139l149.221 124.139z\",\n fill: \"#3257b0\"\n});\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m512 409.423-115.395-95.998h115.395z\",\n fill: \"#3257b0\"\n});\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m512 222.142h-222.142v-194.339h-67.716v194.339h-222.142v67.716h222.142v194.339h67.716v-194.339h222.142z\",\n fill: \"#f40055\"\n});\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m289.858 222.142v-194.339h-33.858v456.394h33.858v-194.339h222.142v-67.716z\",\n fill: \"#c20044\"\n});\n\nvar SvgEn = function SvgEn(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n enableBackground: \"new 0 0 512 512\",\n height: 512,\n viewBox: \"0 0 512 512\",\n width: 512,\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgEn, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/en.501888db.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m173.899 31.804h-8.707l-4.397-4h-115.711c-24.859-.001-45.084 20.224-45.084 45.083v366.226c0 24.859 20.225 45.084 45.084 45.084h115.711l6.348-4h6.755v-448.393z\",\n fill: \"#406bd4\"\n});\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m466.916 27.803h-115.711l-4.523 4h-5.141v448.393h4.141l5.523 4h115.711c24.859 0 45.084-20.225 45.084-45.084v-366.225c0-24.859-20.225-45.084-45.084-45.084z\",\n fill: \"#c20044\"\n});\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m160.795 27.803h190.409v456.394h-190.409z\",\n fill: \"#f0f9ff\"\n});\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"m256 27.803h95.205v456.394h-95.205z\",\n fill: \"#cee5f5\"\n});\n\nvar SvgFr = function SvgFr(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n enableBackground: \"new 0 0 512 512\",\n height: 512,\n viewBox: \"0 0 512 512\",\n width: 512,\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2, _ref3, _ref4, _ref5);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgFr, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/fr.b75cd962.svg\";\nexport { ForwardRef as ReactComponent };","import React, { Component } from 'react'\nimport { connect } from 'react-redux'\n\nimport { ReactComponent as EnFlag } from '../../images/flags/en.svg'\nimport { ReactComponent as FrFlag } from '../../images/flags/fr.svg'\nimport { updateLanguage } from '../../actions/index'\n\nexport const languages = [\n {\n name: 'en',\n selected: true,\n flag: <EnFlag />,\n },\n {\n name: 'fr',\n selected: false,\n flag: <FrFlag />,\n },\n]\n\nclass Dropdown extends Component {\n constructor(props) {\n super(props)\n this.state = {\n isOpen: false,\n }\n }\n\n toggleDropdown() {\n this.setState(prevState => ({\n isOpen: !prevState.isOpen,\n }))\n }\n\n render() {\n const { isOpen } = this.state\n const { language: selected, onUpdateLanguage } = this.props\n return (\n <div className=\"dropdown-wrapper\" onClick={() => this.toggleDropdown()}>\n <ul className=\"dropdown-list i18n-flag\">\n {languages\n .filter(language =>\n isOpen ? language : language.name === selected\n )\n .map(language => (\n <li\n className={`dropdown-item${\n language.name === selected && isOpen\n ? ' dropdown-item-selected'\n : ''\n }`}\n key={language.name}\n onClick={() => onUpdateLanguage(language.name, selected)}\n >\n {language.flag} {language.name}\n </li>\n ))}\n </ul>\n </div>\n )\n }\n}\n\nexport default connect(\n state => ({\n language: state.language,\n }),\n dispatch => ({\n onUpdateLanguage: (lang, selected) => {\n if (lang !== selected) {\n dispatch(updateLanguage(lang))\n }\n },\n })\n)(Dropdown)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { withTranslation } from 'react-i18next'\nimport { Link } from 'react-router-dom'\n\nimport LanguageDropdown from './LanguageDropdown'\nimport { apiUrl } from '../../utils'\n\nclass NavBar extends React.PureComponent {\n render() {\n const { admin, isAuthenticated, picture, t, username } = this.props\n return (\n <header>\n <nav className=\"navbar navbar-expand-lg navbar-light bg-light\">\n <div className=\"container\">\n <span className=\"navbar-brand\">FitTrackee</span>\n <button\n className=\"navbar-toggler\"\n type=\"button\"\n data-toggle=\"collapse\"\n data-target=\"#navbarSupportedContent\"\n aria-controls=\"navbarSupportedContent\"\n aria-expanded=\"false\"\n aria-label=\"Toggle navigation\"\n >\n <span className=\"navbar-toggler-icon\" />\n </button>\n <div\n className=\"collapse navbar-collapse\"\n id=\"navbarSupportedContent\"\n >\n <ul className=\"navbar-nav mr-auto\">\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/',\n }}\n >\n {t('common:Dashboard')}\n </Link>\n </li>\n {isAuthenticated && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/activities/history',\n }}\n >\n {t('Workouts')}\n </Link>\n </li>\n )}\n {isAuthenticated && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/activities/statistics',\n }}\n >\n {t('common:Statistics')}\n </Link>\n </li>\n )}\n {admin && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/admin',\n }}\n >\n Admin\n </Link>\n </li>\n )}\n {isAuthenticated && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/activities/add',\n }}\n >\n <strong>{t('common:Add workout')}</strong>\n </Link>\n </li>\n )}\n </ul>\n {/* prettier-ignore */}\n <ul\n className=\"navbar-nav flex-row ml-md-auto d-none d-md-flex\"\n >\n {!isAuthenticated && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/register',\n }}\n >\n {t('user:Register')}\n </Link>\n </li>\n )}\n {!isAuthenticated && (\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/login',\n }}\n >\n {t('user:Login')}\n </Link>\n </li>\n )}\n {isAuthenticated && (\n <>\n {picture === true ? (\n <img\n alt=\"Avatar\"\n src={`${apiUrl}users/${username}/picture?${Date.now()}`}\n className=\"img-fluid App-nav-profile-img\"\n />\n ) : (\n <i\n className=\"fa fa-user-circle-o fa-2x no-picture\"\n aria-hidden=\"true\"\n />\n )}\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/profile',\n }}\n >\n {username}\n </Link>\n </li>\n <li className=\"nav-item\">\n <Link\n className=\"nav-link\"\n to={{\n pathname: '/logout',\n }}\n >\n {t('user:Logout')}\n </Link>\n </li>\n </>\n )}\n <li><LanguageDropdown /></li>\n </ul>\n </div>\n </div>\n </nav>\n </header>\n )\n }\n}\n\nexport default withTranslation()(\n connect(({ user }) => ({\n admin: user.admin,\n isAuthenticated: user.isAuthenticated,\n picture: user.picture,\n username: user.username,\n }))(NavBar)\n)\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M468.683,287.265h-69.07c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h69.07 c4.147,0,7.508-3.361,7.508-7.508C476.191,290.626,472.83,287.265,468.683,287.265z\"\n})));\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M105.012,268.377L85.781,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L58.034,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C109.507,275.266,108.499,270.62,105.012,268.377z\"\n})));\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M194.441,268.377L175.21,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.47,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.776l-17.471-11.243 c-3.487-2.245-8.133-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L147.463,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.47,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C198.936,275.266,197.928,270.62,194.441,268.377z\"\n})));\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M283.871,268.377L264.64,256l19.231-12.376c3.487-2.243,4.495-6.888,2.251-10.376c-2.245-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.775c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.471-11.243 c-3.486-2.245-8.134-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L236.892,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.471-11.243v20.775 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.886-1.216,6.32-3.446C288.366,275.266,287.358,270.62,283.871,268.377z\"\n})));\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M373.3,268.377L354.069,256l19.231-12.376c3.487-2.244,4.495-6.889,2.25-10.376c-2.244-3.486-6.888-4.497-10.376-2.25 l-17.471,11.243v-20.776c0-4.147-3.361-7.508-7.508-7.508c-4.147,0-7.508,3.361-7.508,7.508v20.775l-17.47-11.243 c-3.486-2.245-8.132-1.238-10.376,2.25c-2.245,3.487-1.237,8.133,2.25,10.376L326.322,256l-19.231,12.376 c-3.487,2.244-4.495,6.889-2.25,10.376c1.435,2.23,3.852,3.446,6.32,3.446c1.391,0,2.799-0.386,4.056-1.196l17.47-11.243v20.776 c0,4.147,3.361,7.508,7.508,7.508c4.147,0,7.508-3.361,7.508-7.508V269.76l17.471,11.243c1.257,0.809,2.664,1.196,4.056,1.196 c2.467,0,4.885-1.216,6.32-3.446C377.795,275.266,376.787,270.62,373.3,268.377z\"\n})));\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M271.792,330.359H15.016V181.642h93.1c4.147,0,7.508-3.361,7.508-7.508c0-4.147-3.361-7.508-7.508-7.508H12.513 C5.613,166.626,0,172.24,0,179.14v153.722c0,6.9,5.613,12.513,12.513,12.513h259.278c4.147,0,7.508-3.361,7.508-7.508 C279.299,333.72,275.939,330.359,271.792,330.359z\"\n})));\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M499.487,166.626H162.174c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h334.811v148.716H323.848 c-4.147,0-7.508,3.361-7.508,7.508c0,4.147,3.361,7.508,7.508,7.508h175.64c6.9,0,12.513-5.613,12.513-12.513V179.14 C512.001,172.24,506.387,166.626,499.487,166.626z\"\n})));\n\nvar SvgPassword = function SvgPassword(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Layer_1\",\n x: \"0px\",\n y: \"0px\",\n viewBox: \"0 0 512.001 512.001\",\n style: {\n enableBackground: \"new 0 0 512.001 512.001\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgPassword, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/password.488f5f4c.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M339.798,260.429c0.13-0.026,0.257-0.061,0.385-0.094c0.109-0.028,0.219-0.051,0.326-0.084 c0.125-0.038,0.247-0.085,0.369-0.129c0.108-0.039,0.217-0.074,0.324-0.119c0.115-0.048,0.226-0.104,0.338-0.157 c0.109-0.052,0.22-0.1,0.327-0.158c0.107-0.057,0.208-0.122,0.312-0.184c0.107-0.064,0.215-0.124,0.319-0.194 c0.111-0.074,0.214-0.156,0.321-0.236c0.09-0.067,0.182-0.13,0.27-0.202c0.162-0.133,0.316-0.275,0.466-0.421 c0.027-0.026,0.056-0.048,0.083-0.075c0.028-0.028,0.052-0.059,0.079-0.088c0.144-0.148,0.284-0.3,0.416-0.46 c0.077-0.094,0.144-0.192,0.216-0.289c0.074-0.1,0.152-0.197,0.221-0.301c0.074-0.111,0.139-0.226,0.207-0.34 c0.057-0.096,0.118-0.19,0.171-0.289c0.062-0.115,0.114-0.234,0.169-0.351c0.049-0.104,0.101-0.207,0.146-0.314 c0.048-0.115,0.086-0.232,0.128-0.349c0.041-0.114,0.085-0.227,0.12-0.343c0.036-0.118,0.062-0.238,0.092-0.358 c0.029-0.118,0.063-0.234,0.086-0.353c0.028-0.141,0.045-0.283,0.065-0.425c0.014-0.1,0.033-0.199,0.043-0.3 c0.025-0.249,0.038-0.498,0.038-0.748V92.76c0-4.143-3.357-7.5-7.5-7.5h-236.25c-0.066,0-0.13,0.008-0.196,0.01 c-0.143,0.004-0.285,0.01-0.427,0.022c-0.113,0.009-0.225,0.022-0.337,0.037c-0.128,0.016-0.255,0.035-0.382,0.058 c-0.119,0.021-0.237,0.046-0.354,0.073c-0.119,0.028-0.238,0.058-0.356,0.092c-0.117,0.033-0.232,0.069-0.346,0.107 c-0.117,0.04-0.234,0.082-0.349,0.128c-0.109,0.043-0.216,0.087-0.322,0.135c-0.118,0.053-0.235,0.11-0.351,0.169 c-0.099,0.051-0.196,0.103-0.292,0.158c-0.116,0.066-0.23,0.136-0.343,0.208c-0.093,0.06-0.184,0.122-0.274,0.185 c-0.106,0.075-0.211,0.153-0.314,0.235c-0.094,0.075-0.186,0.152-0.277,0.231c-0.09,0.079-0.179,0.158-0.266,0.242 c-0.099,0.095-0.194,0.194-0.288,0.294c-0.047,0.05-0.097,0.094-0.142,0.145c-0.027,0.03-0.048,0.063-0.074,0.093 c-0.094,0.109-0.182,0.223-0.27,0.338c-0.064,0.084-0.13,0.168-0.19,0.254c-0.078,0.112-0.15,0.227-0.222,0.343 c-0.059,0.095-0.12,0.189-0.174,0.286c-0.063,0.112-0.118,0.227-0.175,0.342c-0.052,0.105-0.106,0.21-0.153,0.317 c-0.049,0.113-0.092,0.23-0.135,0.345c-0.043,0.113-0.087,0.225-0.124,0.339c-0.037,0.115-0.067,0.232-0.099,0.349 c-0.032,0.12-0.066,0.239-0.093,0.36c-0.025,0.113-0.042,0.228-0.062,0.342c-0.022,0.13-0.044,0.26-0.06,0.39 c-0.013,0.108-0.019,0.218-0.027,0.328c-0.01,0.14-0.019,0.28-0.021,0.421c-0.001,0.041-0.006,0.081-0.006,0.122v46.252 c0,4.143,3.357,7.5,7.5,7.5s7.5-3.357,7.5-7.5v-29.595l66.681,59.037c-0.348,0.245-0.683,0.516-0.995,0.827l-65.687,65.687v-49.288 c0-4.143-3.357-7.5-7.5-7.5s-7.5,3.357-7.5,7.5v9.164h-38.75c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h38.75v43.231 c0,4.143,3.357,7.5,7.5,7.5h236.25c0.247,0,0.494-0.013,0.74-0.037c0.115-0.011,0.226-0.033,0.339-0.049 C339.542,260.469,339.67,260.454,339.798,260.429z M330.834,234.967l-65.688-65.687c-0.042-0.042-0.087-0.077-0.13-0.117 l49.383-41.897c3.158-2.68,3.546-7.412,0.866-10.571c-2.678-3.157-7.41-3.547-10.571-0.866l-84.381,71.59l-98.444-87.158h208.965 V234.967z M185.878,179.888c0.535-0.535,0.969-1.131,1.308-1.765l28.051,24.835c1.418,1.255,3.194,1.885,4.972,1.885 c1.726,0,3.451-0.593,4.853-1.781l28.587-24.254c0.26,0.38,0.553,0.743,0.89,1.08l65.687,65.687H120.191L185.878,179.888z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M7.5,170.676h126.667c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H7.5c-4.143,0-7.5,3.357-7.5,7.5 S3.357,170.676,7.5,170.676z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.625,129.345H77.5c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5H20.625c-4.143,0-7.5,3.357-7.5,7.5 S16.482,129.345,20.625,129.345z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M62.5,226.51h-55c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h55c4.143,0,7.5-3.357,7.5-7.5S66.643,226.51,62.5,226.51z\"\n}));\n\nvar SvgMailSend = function SvgMailSend(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n x: \"0px\",\n y: \"0px\",\n viewBox: \"0 0 345.834 345.834\",\n style: {\n enableBackground: \"new 0 0 345.834 345.834\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgMailSend, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/mail-send.66b8d739.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { Link } from 'react-router-dom'\n\nimport { ReactComponent as Password } from '../../images/password.svg'\nimport { ReactComponent as MailSend } from '../../images/mail-send.svg'\n\nexport default function PasswordReset(props) {\n const { t } = useTranslation()\n const { action } = props\n return (\n <div className=\"container dashboard\">\n <div className=\"row\">\n <div className=\"col-2\" />\n <div className=\"card col-8\">\n <div className=\"card-body\">\n <div className=\"text-center \">\n {action === 'sent' && (\n <>\n <div className=\"svg-icon\">\n <MailSend />\n </div>\n {t(\n // eslint-disable-next-line max-len\n \"user:Check your email. If your address is in our database, you'll received an email with a link to reset your password.\"\n )}\n </>\n )}\n {action === 'updated' && (\n <>\n <div className=\"svg-icon\">\n <Password />\n </div>\n <Trans i18nKey=\"user:updatedPasswordText\">\n {/* prettier-ignore */}\n Your password have been updated. Click\n <Link to=\"/login\">here</Link> to log in.\n </Trans>\n </>\n )}\n </div>\n </div>\n </div>\n <div className=\"col-2\" />\n </div>\n </div>\n )\n}\n","import { format } from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport TimezonePicker from 'react-timezone'\n\nimport Message from '../Common/Message'\nimport { deleteUser, handleProfileFormSubmit } from '../../actions/user'\nimport { history } from '../../index'\nimport { languages } from '../NavBar/LanguageDropdown'\nimport CustomModal from '../Common/CustomModal'\n\nclass ProfileEdit extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {},\n displayModal: false,\n }\n }\n\n componentDidMount() {\n this.initForm()\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.user !== this.props.user) {\n this.initForm()\n }\n }\n\n initForm() {\n const { user } = this.props\n const formData = {}\n Object.keys(user).map(k =>\n user[k] === null\n ? (formData[k] = '')\n : k === 'birth_date'\n ? (formData[k] = format(new Date(user[k]), 'yyyy-MM-DD'))\n : (formData[k] = user[k])\n )\n this.setState({ formData })\n }\n\n handleFormChange(e) {\n const { formData } = this.state\n if (e.target.name === 'weekm') {\n formData.weekm = e.target.value === 'Monday'\n } else {\n formData[e.target.name] = e.target.value\n }\n this.setState(formData)\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n render() {\n const {\n message,\n onDeleteUser,\n onHandleProfileFormSubmit,\n t,\n user,\n } = this.props\n const { displayModal, formData } = this.state\n return (\n <div>\n <Helmet>\n <title>FitTrackee - {t('user:Profile Edition')}</title>\n </Helmet>\n {formData.isAuthenticated && (\n <div className=\"container\">\n {displayModal && (\n <CustomModal\n title={t('common:Confirmation')}\n text={t(\n 'user:Are you sure you want to delete your account? ' +\n 'All data will be deleted, this cannot be undone.'\n )}\n confirm={() => {\n onDeleteUser(user.username)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n <h1 className=\"page-title\">{t('user:Profile Edition')}</h1>\n <div className=\"row\">\n <div className=\"col-md-2\" />\n <div className=\"col-md-8\">\n <div className=\"card\">\n <div className=\"card-header\">{user.username}</div>\n <div className=\"card-body\">\n <div className=\"row\">\n <div className=\"col-md-12\">\n <form\n onSubmit={event => {\n event.preventDefault()\n onHandleProfileFormSubmit(formData)\n }}\n >\n <div className=\"form-group\">\n <label>\n {t('user:Email')}:\n <input\n name=\"email\"\n className=\"form-control input-lg\"\n type=\"text\"\n value={formData.email}\n readOnly\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Registration Date')}:\n <input\n name=\"createdAt\"\n className=\"form-control input-lg\"\n type=\"text\"\n value={formData.created_at}\n disabled\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Password')}:\n <input\n name=\"password\"\n className=\"form-control input-lg\"\n type=\"password\"\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Password Confirmation')}:\n <input\n name=\"password_conf\"\n className=\"form-control input-lg\"\n type=\"password\"\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <hr />\n <div className=\"form-group\">\n <label>\n {t('user:First Name')}:\n <input\n name=\"first_name\"\n className=\"form-control input-lg\"\n type=\"text\"\n value={formData.first_name}\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Last Name')}:\n <input\n name=\"last_name\"\n className=\"form-control input-lg\"\n type=\"text\"\n value={formData.last_name}\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Birth Date')}\n <input\n name=\"birth_date\"\n className=\"form-control input-lg\"\n type=\"date\"\n value={formData.birth_date}\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Location')}:\n <input\n name=\"location\"\n className=\"form-control input-lg\"\n type=\"text\"\n value={formData.location}\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Bio')}:\n <textarea\n name=\"bio\"\n className=\"form-control input-lg\"\n maxLength=\"200\"\n value={formData.bio}\n onChange={e => this.handleFormChange(e)}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Language')}:\n <select\n name=\"language\"\n className=\"form-control input-lg\"\n value={formData.language}\n onChange={e => this.handleFormChange(e)}\n >\n {languages.map(lang => (\n <option value={lang.name} key={lang.name}>\n {lang.name}\n </option>\n ))}\n </select>\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:Timezone')}:\n <TimezonePicker\n className=\"form-control timezone-custom\"\n onChange={tz => {\n const e = {\n target: {\n name: 'timezone',\n value: tz ? tz : 'Europe/Paris',\n },\n }\n this.handleFormChange(e)\n }}\n value={formData.timezone}\n />\n </label>\n </div>\n <div className=\"form-group\">\n <label>\n {t('user:First day of week')}:\n <select\n name=\"weekm\"\n className=\"form-control input-lg\"\n value={formData.weekm ? 'Monday' : 'Sunday'}\n onChange={e => this.handleFormChange(e)}\n >\n <option value=\"Sunday\">\n {t('user:Sunday')}\n </option>\n <option value=\"Monday\">\n {t('user:Monday')}\n </option>\n </select>\n </label>\n </div>\n <button type=\"submit\" className=\"btn btn-primary\">\n {t('common:Submit')}\n </button>\n <button\n className=\"btn btn-danger\"\n onClick={event => {\n event.preventDefault()\n this.displayModal(true)\n }}\n >\n {t('user:Delete my account')}\n </button>\n <button\n type=\"submit\"\n className=\"btn btn-secondary\"\n onClick={() => history.push('/profile')}\n >\n {t('common:Cancel')}\n </button>\n </form>\n <Message message={message} t={t} />\n </div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-md-2\" />\n </div>\n </div>\n )}\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n location: state.router.location,\n message: state.message,\n user: state.user,\n }),\n dispatch => ({\n onDeleteUser: username => {\n dispatch(deleteUser(username))\n },\n onHandleProfileFormSubmit: formData => {\n dispatch(handleProfileFormSubmit(formData))\n },\n })\n )(ProfileEdit)\n)\n","import {\n endOfMonth,\n endOfWeek,\n endOfYear,\n startOfMonth,\n startOfYear,\n startOfWeek,\n addMonths,\n addWeeks,\n addYears,\n subMonths,\n subWeeks,\n subYears,\n} from 'date-fns'\nimport React from 'react'\nimport { Helmet } from 'react-helmet'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport NoActivities from '../Common/NoActivities'\nimport Stats from '../Common/Stats'\nimport { activityColors, translateSports } from '../../utils/activities'\n\nconst durations = ['week', 'month', 'year']\n\nclass Statistics extends React.Component {\n constructor(props, context) {\n super(props, context)\n const date = new Date()\n this.state = {\n displayedSports: props.sports.map(sport => sport.id),\n statsParams: {\n start: startOfMonth(subMonths(date, 11)),\n end: endOfMonth(date),\n duration: 'month',\n type: 'by_time',\n },\n }\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.sports !== prevProps.sports) {\n this.updateDisplayedSports()\n }\n }\n\n updateDisplayedSports() {\n const { sports } = this.props\n this.setState({ displayedSports: sports.map(sport => sport.id) })\n }\n\n handleOnChangeDuration(e) {\n const duration = e.target.name\n\n const date = new Date()\n const start =\n duration === 'year'\n ? startOfYear(subYears(date, 9))\n : duration === 'week'\n ? startOfMonth(subMonths(date, 2))\n : startOfMonth(subMonths(date, 11))\n const end =\n duration === 'year'\n ? endOfYear(date)\n : duration === 'week'\n ? endOfWeek(date)\n : endOfMonth(date)\n this.setState({ statsParams: { duration, end, start, type: 'by_time' } })\n }\n\n handleOnChangeSports(sportId) {\n const { displayedSports } = this.state\n if (displayedSports.includes(sportId)) {\n this.setState({\n displayedSports: displayedSports.filter(s => s !== sportId),\n })\n } else {\n this.setState({ displayedSports: displayedSports.concat([sportId]) })\n }\n }\n\n handleOnClickArrows(forward) {\n const { start, end, duration } = this.state.statsParams\n let newStart, newEnd\n if (forward) {\n newStart =\n duration === 'year'\n ? startOfYear(subYears(start, 1))\n : duration === 'week'\n ? startOfWeek(subWeeks(start, 1))\n : startOfMonth(subMonths(start, 1))\n newEnd =\n duration === 'year'\n ? endOfYear(subYears(end, 1))\n : duration === 'week'\n ? endOfWeek(subWeeks(end, 1))\n : endOfMonth(subMonths(end, 1))\n } else {\n newStart =\n duration === 'year'\n ? startOfYear(addYears(start, 1))\n : duration === 'week'\n ? startOfWeek(addWeeks(start, 1))\n : startOfMonth(addMonths(start, 1))\n newEnd =\n duration === 'year'\n ? endOfYear(addYears(end, 1))\n : duration === 'week'\n ? endOfWeek(addWeeks(end, 1))\n : endOfMonth(addMonths(end, 1))\n }\n this.setState({\n statsParams: { duration, end: newEnd, start: newStart, type: 'by_time' },\n })\n }\n\n render() {\n const { displayedSports, statsParams } = this.state\n const { sports, t, user } = this.props\n const translatedSports = translateSports(\n sports.filter(sport => user.sports_list.includes(sport.id)),\n t\n )\n return (\n <>\n <Helmet>\n <title>FitTrackee - {t('statistics:Statistics')}</title>\n </Helmet>\n <div className=\"container dashboard\">\n <div className=\"card activity-card\">\n <div className=\"card-header\">{t('statistics:Statistics')}</div>\n <div\n className={`card-body${\n user.nb_activities === 0 ? ' stats-disabled' : ''\n }`}\n >\n <div className=\"chart-filters row\">\n <div className=\"col chart-arrows\">\n <p className=\"text-center\">\n <i\n className=\"fa fa-chevron-left\"\n aria-hidden=\"true\"\n onClick={() => this.handleOnClickArrows(true)}\n />\n </p>\n </div>\n <div className=\"col-md-3 time-frames justify-content-around\">\n {durations.map(d => (\n <div className=\"time-frame\" key={d}>\n <label>\n <input\n type=\"radio\"\n id={d}\n name={d}\n checked={d === statsParams.duration}\n onChange={e => this.handleOnChangeDuration(e)}\n />\n <span>{t(`statistics:${d}`)}</span>\n </label>\n </div>\n ))}\n </div>\n <div className=\"col chart-arrows\">\n <p className=\"text-center\">\n <i\n className=\"fa fa-chevron-right\"\n aria-hidden=\"true\"\n onClick={() => this.handleOnClickArrows(false)}\n />\n </p>\n </div>\n </div>\n <Stats\n displayEmpty\n displayedSports={displayedSports}\n statsParams={statsParams}\n t={t}\n />\n <div className=\"row chart-activities\">\n {translatedSports.map(sport => (\n <label className=\"col activity-label\" key={sport.id}>\n <input\n type=\"checkbox\"\n checked={displayedSports.includes(sport.id)}\n name={sport.label}\n onChange={() => this.handleOnChangeSports(sport.id)}\n />\n <span style={{ color: activityColors[sport.id - 1] }}>\n {` ${sport.label}`}\n </span>\n </label>\n ))}\n </div>\n </div>\n </div>\n {user.nb_activities === 0 && <NoActivities t={t} />}\n </div>\n </>\n )\n }\n}\n\nexport default withTranslation()(\n connect(state => ({\n sports: state.sports.data,\n user: state.user,\n }))(Statistics)\n)\n","import React from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { Helmet } from 'react-helmet'\nimport { Link } from 'react-router-dom'\n\nimport { history } from '../../index'\n\nexport default function Form(props) {\n const { t } = useTranslation()\n const pageTitle = `user:${props.formType\n .charAt(0)\n .toUpperCase()}${props.formType.slice(1)}`\n return (\n <div>\n <Helmet>\n <title>FitTrackee - {t(`user:${props.formType}`)}</title>\n </Helmet>\n <h1 className=\"page-title\">{t(pageTitle)}</h1>\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-md-3\" />\n <div className=\"col-md-6\">\n <br />\n {props.formType === 'register' && !props.isRegistrationAllowed ? (\n <div className=\"card\">\n <div className=\"card-body\">Registration is disabled.</div>\n <div className=\"card-body\">\n <button\n type=\"submit\"\n className=\"btn btn-secondary btn-lg btn-block\"\n onClick={() => history.go(-1)}\n >\n Back\n </button>\n </div>\n </div>\n ) : (\n <>\n <form\n onSubmit={event =>\n props.handleUserFormSubmit(event, props.formType)\n }\n >\n {props.formType === 'register' && (\n <div className=\"form-group\">\n <input\n className=\"form-control input-lg\"\n name=\"username\"\n placeholder={t('user:Enter a username')}\n required\n type=\"text\"\n value={props.userForm.username}\n onChange={props.onHandleFormChange}\n />\n </div>\n )}\n {props.formType !== 'password reset' && (\n <div className=\"form-group\">\n <input\n className=\"form-control input-lg\"\n name=\"email\"\n placeholder={t('user:Enter an email address')}\n required\n type=\"email\"\n value={props.userForm.email}\n onChange={props.onHandleFormChange}\n />\n </div>\n )}\n {props.formType !== 'reset your password' && (\n <>\n <div className=\"form-group\">\n <input\n className=\"form-control input-lg\"\n name=\"password\"\n placeholder={t('user:Enter a password')}\n required\n type=\"password\"\n value={props.userForm.password}\n onChange={props.onHandleFormChange}\n />\n </div>\n {props.formType !== 'login' && (\n <div className=\"form-group\">\n <input\n className=\"form-control input-lg\"\n name=\"password_conf\"\n placeholder={t(\n 'user:Enter the password confirmation'\n )}\n required\n type=\"password\"\n value={props.userForm.password_conf}\n onChange={props.onHandleFormChange}\n />\n </div>\n )}\n </>\n )}\n <input\n type=\"submit\"\n className=\"btn btn-primary btn-lg btn-block\"\n value={t('Submit')}\n />\n </form>\n <p className=\"password-forget\">\n {props.formType === 'login' && (\n <Link\n to={{\n pathname: '/password-reset/request',\n }}\n >\n {t('user:Forgot password?')}\n </Link>\n )}\n </p>\n </>\n )}\n </div>\n <div className=\"col-md-3\" />\n </div>\n </div>\n </div>\n )\n}\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\nimport { Redirect } from 'react-router-dom'\n\nimport Form from './Form'\nimport Message from '../Common/Message'\nimport { handleUserFormSubmit } from '../../actions/user'\nimport { isLoggedIn } from '../../utils'\n\nclass UserForm extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n formData: {\n username: '',\n email: '',\n password: '',\n password_conf: '',\n },\n }\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.location.pathname !== this.props.location.pathname) {\n this.emptyForm()\n }\n }\n\n emptyForm() {\n const { formData } = this.state\n Object.keys(formData).map(k => (formData[k] = ''))\n this.setState(formData)\n }\n\n onHandleFormChange(e) {\n const { formData } = this.state\n formData[e.target.name] = e.target.value\n this.setState(formData)\n }\n\n render() {\n const {\n formType,\n isRegistrationAllowed,\n message,\n messages,\n onHandleUserFormSubmit,\n t,\n } = this.props\n const { formData } = this.state\n const { token } = this.props.location.query\n return (\n <div>\n {isLoggedIn() || (formType === 'password reset' && !token) ? (\n <Redirect to=\"/\" />\n ) : (\n <div>\n <Message message={message} messages={messages} t={t} />\n <Form\n isRegistrationAllowed={isRegistrationAllowed}\n formType={formType}\n userForm={formData}\n onHandleFormChange={event => this.onHandleFormChange(event)}\n handleUserFormSubmit={event => {\n event.preventDefault()\n if (formType === 'password reset') {\n formData.token = token\n }\n onHandleUserFormSubmit(formData, formType)\n }}\n />\n </div>\n )}\n </div>\n )\n }\n}\nexport default withTranslation()(\n connect(\n state => ({\n isRegistrationAllowed: state.application.config.is_registration_enabled,\n location: state.router.location,\n message: state.message,\n messages: state.messages,\n }),\n dispatch => ({\n onHandleUserFormSubmit: (formData, formType) => {\n formType =\n formType === 'password reset'\n ? 'password/update'\n : formType === 'reset your password'\n ? 'password/reset-request'\n : formType\n dispatch(handleUserFormSubmit(formData, formType))\n },\n })\n )(UserForm)\n)\n","import React from 'react'\nimport { withTranslation } from 'react-i18next'\nimport { connect } from 'react-redux'\n\nimport CustomModal from '../Common/CustomModal'\nimport ProfileDetail from './ProfileDetail'\nimport { getOrUpdateData } from '../../actions'\nimport { deleteUser } from '../../actions/user'\n\nclass UserProfile extends React.Component {\n constructor(props, context) {\n super(props, context)\n this.state = {\n displayModal: false,\n }\n }\n\n componentDidMount() {\n this.props.loadUser(this.props.match.params.userName)\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.match.params.userName !== this.props.match.params.userName) {\n this.props.loadUser(this.props.match.params.userName)\n }\n }\n\n displayModal(value) {\n this.setState(prevState => ({\n ...prevState,\n displayModal: value,\n }))\n }\n\n render() {\n const { t, currentUser, onDeleteUser, users } = this.props\n const { displayModal } = this.state\n const [user] = users\n const editable = user ? currentUser.username === user.username : false\n return (\n <div>\n {displayModal && (\n <CustomModal\n title={t('common:Confirmation')}\n text={t(\n 'user:Are you sure you want to delete this account? ' +\n 'All data will be deleted, this cannot be undone.'\n )}\n confirm={() => {\n onDeleteUser(user.username)\n this.displayModal(false)\n }}\n close={() => this.displayModal(false)}\n />\n )}\n {user && (\n <ProfileDetail\n editable={editable}\n isDeletable={currentUser.admin && !editable}\n onDeleteUser={onDeleteUser}\n displayModal={e => this.displayModal(e)}\n t={t}\n user={user}\n />\n )}\n </div>\n )\n }\n}\n\nexport default withTranslation()(\n connect(\n state => ({\n currentUser: state.user,\n users: state.users.data,\n }),\n dispatch => ({\n onDeleteUser: username => {\n dispatch(deleteUser(username, true))\n },\n loadUser: userName => {\n dispatch(getOrUpdateData('getData', 'users', { username: userName }))\n },\n })\n )(UserProfile)\n)\n","import React from 'react'\nimport { connect } from 'react-redux'\nimport { Route, Switch } from 'react-router-dom'\n\nimport './App.css'\nimport Admin from './Admin'\nimport Activity from './Activity'\nimport Activities from './Activities'\nimport CurrentUserProfile from './User/CurrentUserProfile'\nimport Dashboard from './Dashboard'\nimport Footer from './Footer'\nimport Logout from './User/Logout'\nimport NavBar from './NavBar'\nimport NotFound from './Others/NotFound'\nimport PasswordReset from './User/PasswordReset'\nimport ProfileEdit from './User/ProfileEdit'\nimport Statistics from './Statistics'\nimport UserForm from './User/UserForm'\nimport UserProfile from './User/UserProfile'\nimport { getAppData } from '../actions/application'\n\nclass App extends React.Component {\n constructor(props) {\n super(props)\n this.props = props\n }\n componentDidMount() {\n this.props.loadAppConfig()\n }\n\n render() {\n return (\n <div className=\"App\">\n <NavBar />\n <Switch>\n <Route exact path=\"/\" component={Dashboard} />\n <Route\n exact\n path=\"/register\"\n render={() => <UserForm formType={'register'} />}\n />\n <Route\n exact\n path=\"/login\"\n render={() => <UserForm formType={'login'} />}\n />\n <Route\n exact\n path=\"/password-reset\"\n render={() => <UserForm formType={'password reset'} />}\n />\n <Route\n exact\n path=\"/password-reset/request\"\n render={() => <UserForm formType={'reset your password'} />}\n />\n <Route\n exact\n path=\"/password-reset/sent\"\n render={() => <PasswordReset action={'sent'} />}\n />\n <Route\n exact\n path=\"/updated-password\"\n render={() => <PasswordReset action={'updated'} />}\n />\n <Route exact path=\"/password-reset/sent\" component={PasswordReset} />\n <Route exact path=\"/logout\" component={Logout} />\n <Route exact path=\"/profile/edit\" component={ProfileEdit} />\n <Route exact path=\"/profile\" component={CurrentUserProfile} />\n <Route exact path=\"/activities/history\" component={Activities} />\n <Route exact path=\"/activities/statistics\" component={Statistics} />\n <Route exact path=\"/users/:userName\" component={UserProfile} />\n <Route path=\"/activities\" component={Activity} />\n <Route path=\"/admin\" component={Admin} />\n <Route component={NotFound} />\n </Switch>\n <Footer />\n </div>\n )\n }\n}\nexport default connect(\n () => ({}),\n dispatch => ({\n loadAppConfig: () => {\n dispatch(getAppData('config'))\n },\n })\n)(App)\n","import React from 'react'\nimport { Provider } from 'react-redux'\nimport { ConnectedRouter } from 'connected-react-router'\n\nexport default function Root({ store, history, children }) {\n return (\n <Provider store={store}>\n <ConnectedRouter history={history}>{children}</ConnectedRouter>\n </Provider>\n )\n}\n","// In production, we register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n)\n\nexport default function register() {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location)\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets;\n // see https://github.com/facebookincubator/create-react-app/issues/2374\n return\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`\n\n if (isLocalhost) {\n // This is running on localhost.\n // Lets check if a service worker still exists or not.\n checkValidServiceWorker(swUrl)\n } else {\n // Is not local host. Just register service worker\n registerValidSW(swUrl)\n }\n })\n }\n}\n\nfunction registerValidSW(swUrl) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a \"New content is\n // available; please refresh.\" message in your web app.\n // eslint-disable-next-line no-console\n console.log('New content is available; please refresh.')\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n // eslint-disable-next-line no-console\n console.log('Content is cached for offline use.')\n }\n }\n }\n }\n })\n .catch(error => {\n console.error('Error during service worker registration:', error)\n })\n}\n\nfunction checkValidServiceWorker(swUrl) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n if (\n response.status === 404 ||\n response.headers.get('content-type').indexOf('javascript') === -1\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload()\n })\n })\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl)\n }\n })\n .catch(() => {\n // eslint-disable-next-line no-console\n console.log(\n 'No internet connection found. App is running in offline mode.'\n )\n })\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister()\n })\n }\n}\n","const emptyData = {\n data: [],\n}\n\nexport default {\n language: 'en',\n message: '',\n messages: [],\n user: {\n isAuthenticated: false,\n },\n activities: {\n ...emptyData,\n },\n application: {\n statistics: {},\n config: {\n gpx_limit_import: null,\n is_registration_enabled: null,\n max_single_file_size: null,\n max_users: null,\n max_zip_file_size: null,\n registration: null,\n },\n },\n calendarActivities: {\n ...emptyData,\n },\n chartData: [],\n // check if storing gpx content is OK\n gpx: null,\n loading: false,\n records: {\n ...emptyData,\n },\n sports: {\n ...emptyData,\n },\n statistics: {\n data: {},\n },\n users: {\n ...emptyData,\n },\n}\n","const routesWithoutAuthentication = [\n '/login',\n '/register',\n '/password-reset',\n '/password-reset/request',\n '/password-reset/sent',\n '/updated-password',\n]\n\nconst updatePath = (toPath, newPath) => {\n if (typeof toPath === 'string' || toPath instanceof String) {\n toPath = newPath\n } else {\n toPath.pathname = newPath\n }\n return toPath\n}\n\nconst pathInterceptor = toPath => {\n if (\n !window.localStorage.authToken &&\n !routesWithoutAuthentication.includes(toPath.pathname)\n ) {\n toPath = updatePath(toPath, '/login')\n }\n if (\n window.localStorage.authToken &&\n routesWithoutAuthentication.includes(toPath.pathname)\n ) {\n toPath = updatePath(toPath, '/')\n }\n return toPath\n}\n\nexport const historyEnhancer = originalHistory => {\n originalHistory.location = pathInterceptor(originalHistory.location)\n return {\n ...originalHistory,\n push: (path, ...args) =>\n originalHistory.push(pathInterceptor(path), ...args),\n replace: (path, ...args) =>\n originalHistory.replace(pathInterceptor(path), ...args),\n }\n}\n","import { connectRouter } from 'connected-react-router'\nimport { combineReducers } from 'redux'\n\nimport initial from './initial'\n\nconst handleDataAndError = (state, type, action) => {\n if (action.target !== type) {\n return state\n }\n if (action.type === 'SET_DATA') {\n return {\n ...state,\n data: action.data[action.target],\n }\n }\n if (action.type === 'SET_PAGINATED_DATA') {\n return {\n ...state,\n data: action.data[action.target],\n pagination: action.pagination,\n }\n }\n return state\n}\n\nconst activities = (state = initial.activities, action) => {\n switch (action.type) {\n case 'LOGOUT':\n return initial.activities\n case 'PUSH_ACTIVITIES':\n return {\n ...state,\n data: state.data.concat(action.activities),\n }\n case 'REMOVE_ACTIVITY':\n return {\n ...state,\n data: state.data.filter(activity => activity.id !== action.activityId),\n }\n default:\n return handleDataAndError(state, 'activities', action)\n }\n}\n\nconst application = (state = initial.application, action) => {\n if (action.type === 'SET_APP_CONFIG') {\n return {\n ...state,\n config: action.data,\n }\n }\n if (action.type === 'SET_APP_STATS') {\n return {\n ...state,\n statistics: action.data,\n }\n }\n return state\n}\n\nconst calendarActivities = (state = initial.calendarActivities, action) => {\n switch (action.type) {\n case 'LOGOUT':\n return initial.calendarActivities\n case 'UPDATE_CALENDAR':\n return {\n ...state,\n data: action.activities,\n }\n default:\n return handleDataAndError(state, 'calendarActivities', action)\n }\n}\n\nconst chartData = (state = initial.chartData, action) => {\n if (action.type === 'SET_CHART_DATA') {\n return action.chartData\n }\n return state\n}\n\nconst gpx = (state = initial.gpx, action) => {\n if (action.type === 'SET_GPX') {\n return action.gpxContent\n }\n return state\n}\n\nconst language = (state = initial.language, action) => {\n if (action.type === 'SET_LANGUAGE') {\n return action.language\n }\n return state\n}\n\nconst loading = (state = initial.loading, action) => {\n if (action.type === 'SET_LOADING') {\n return action.loading\n }\n return state\n}\n\nconst message = (state = initial.message, action) => {\n switch (action.type) {\n case 'AUTH_ERROR':\n case 'PROFILE_ERROR':\n case 'PROFILE_UPDATE_ERROR':\n case 'PICTURE_ERROR':\n case 'SET_ERROR':\n return action.message\n case 'LOGOUT':\n case 'PROFILE_SUCCESS':\n case 'SET_RESULTS':\n case '@@router/LOCATION_CHANGE':\n return ''\n default:\n return state\n }\n}\n\nconst messages = (state = initial.messages, action) => {\n switch (action.type) {\n case 'AUTH_ERRORS':\n return action.messages\n case 'LOGOUT':\n case 'PROFILE_SUCCESS':\n case '@@router/LOCATION_CHANGE':\n return []\n default:\n return state\n }\n}\n\nconst records = (state = initial.records, action) => {\n if (action.type === 'LOGOUT') {\n return initial.records\n }\n return handleDataAndError(state, 'records', action)\n}\n\nconst sports = (state = initial.sports, action) => {\n if (action.type === 'UPDATE_SPORT_DATA') {\n return {\n ...state,\n data: state.data.map(sport => {\n if (sport.id === action.data.id) {\n sport.is_active = action.data.is_active\n }\n return sport\n }),\n }\n }\n return handleDataAndError(state, 'sports', action)\n}\n\nconst users = (state = initial.users, action) => {\n if (action.type === 'UPDATE_USER_DATA') {\n return {\n ...state,\n data: state.data.map(user => {\n if (user.username === action.data.username) {\n user.admin = action.data.admin\n }\n return user\n }),\n }\n }\n return handleDataAndError(state, 'users', action)\n}\n\nconst user = (state = initial.user, action) => {\n switch (action.type) {\n case 'AUTH_ERROR':\n case 'PROFILE_ERROR':\n case 'LOGOUT':\n window.localStorage.removeItem('authToken')\n return initial.user\n case 'PROFILE_SUCCESS':\n return action.profil\n default:\n return state\n }\n}\n\nconst statistics = (state = initial.statistics, action) => {\n if (action.type === 'LOGOUT') {\n return initial.statistics\n }\n return handleDataAndError(state, 'statistics', action)\n}\n\nexport default history =>\n combineReducers({\n activities,\n application,\n calendarActivities,\n chartData,\n gpx,\n language,\n loading,\n message,\n messages,\n records,\n router: connectRouter(history),\n sports,\n statistics,\n user,\n users,\n })\n","/* eslint-disable react/jsx-filename-extension */\nimport { createBrowserHistory } from 'history'\nimport React from 'react'\nimport { I18nextProvider } from 'react-i18next'\nimport ReactDOM from 'react-dom'\nimport { routerMiddleware } from 'connected-react-router'\nimport { applyMiddleware, compose, createStore } from 'redux'\nimport thunk from 'redux-thunk'\n\nimport i18n from './i18n'\nimport App from './components/App'\nimport Root from './components/Root'\nimport registerServiceWorker from './registerServiceWorker'\nimport createRootReducer from './reducers'\nimport { loadProfile } from './actions/user'\nimport { historyEnhancer } from './utils/history'\n\nexport const history = historyEnhancer(createBrowserHistory())\n\nhistory.listen(() => {\n window.scrollTo(0, 0)\n})\n\nexport const rootNode = document.getElementById('root')\n\nexport const store = createStore(\n createRootReducer(history),\n window.__STATE__, // Server state\n (window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose)(\n applyMiddleware(routerMiddleware(history), thunk)\n )\n)\n\nif (window.localStorage.authToken !== null) {\n store.dispatch(loadProfile())\n}\n\nReactDOM.render(\n <Root store={store} history={history}>\n <I18nextProvider i18n={i18n}>\n <App />\n </I18nextProvider>\n </Root>,\n rootNode\n)\nregisterServiceWorker()\n"],"sourceRoot":""}