{"version":3,"sources":["contexts/extenstions/safeFetch.js","contexts/extenstions/fromResult.js","contexts/extenstions/setLocalStorage.js","contexts/extenstions/url.js","contexts/teamActions/signIn.js","contexts/teamContext.js","contexts/teamActions/signUp.js","contexts/teamActions/signOut.js","contexts/teamActions/getRating.js","contexts/extenstions/parseResponseTime.js","contexts/taskActions/getNewTask.js","contexts/taskContext.js","contexts/taskActions/setTaskById.js","contexts/taskActions/sendAnswer.js","contexts/taskActions/getStatus.js","contexts/taskActions/getTakenTasks.js","blocks/TeamWidget.js","contexts/challengeActions/update.js","contexts/challengeActions/getNextRoundTime.js","contexts/challengeContext.js","contexts/challengeActions/getCurrentRound.js","contexts/challengeActions/getTaskTypes.js","contexts/challengeActions/getCanChooseType.js","contexts/challengeActions/getStartedRounds.js","contexts/challengeActions/getRoundById.js","blocks/ChallengeDescription.js","controls/FormContainer.js","blocks/CommonDescription.js","pages/Home.js","controls/navbar/Navbar.js","etc/onEnter.js","etc/useInput.js","blocks/Error.js","controls/navbar/LoginField.js","controls/navbar/Title.js","controls/navbar/Collapse.js","controls/navbar/NavLink.js","contexts/settingsContext.js","contexts/settingsActions/getSettings.js","blocks/NavMenu.js","blocks/Layout.js","controls/FormButton.js","pages/SignUp.js","pages/SignUpSuccess.js","blocks/NotAuthorized.js","pages/GetNewTask.js","blocks/ListItem.js","blocks/Deadline.js","pages/Task.js","blocks/LinkRow.js","pages/Status.js","blocks/TasksList.js","pages/StatusTask.js","pages/Rating.js","pages/Profile.js","App.js","registerServiceWorker.js","index.js"],"names":["checkStatus","response","Promise","resolve","reject","json","catch","errorName","errorDescription","errorLevel","then","ok","code","status","error","text","level","url","params","fetch","value","func","undefined","setLocalStorage","localStorage","setItem","secret","fromResult","get","setTeam","safeFetch","getTeam","useTeamContext","useState","team","teams","setTeams","useMemo","signIn","signUp","form","headers","method","body","signOut","clear","getRating","TeamContext","createContext","task","delta","Date","parse","responseTime","now","getTask","round","type","getTaskWithType","getTaskWithoutType","useTaskContext","setTask","takenTasks","setTakenTasks","getNewTask","parseResponseTime","setTaskById","id","sendAnswer","answer","JSON","stringify","getStatus","setStatus","getTakenTasks","page","setTasks","tasks","map","TaskContext","TeamWidget","ctx","useContext","taskCtx","getTasksCount","statuses","count","className","style","maxWidth","teamName","points","Object","values","reduce","a","b","role","aria-label","setChallenge","getChallenge","byDate","strA","startTimestamp","strB","dateA","dateB","useChallengeContext","challenge","update","getCurrentRound","rounds","filter","endTimestamp","getTaskTypes","taskTypes","getNextRoundTime","start","sort","toLocaleString","getCanChooseType","canChooseType","getStartedRounds","getRoundById","results","r","length","ChallengeContext","ChallengeDescription","Consumer","source","description","FormContainer","children","CommonDescription","Home","NavBar","Navbar","dark","onEnter","onKeyDown","e","keyCode","preventDefault","target","useInput","defaultState","set","onChange","timer","Header","styled","ToastHeader","icons","warning","title","Error","close","getState","setState","hide","clearTimeout","setTimeout","Toast","isOpen","toggle","tagClassName","icon","ToastBody","Fragment","LoginField","pending","setPending","setError","inputSecret","teamCtx","login","InputGroup","Input","placeholder","invalid","InputGroupAddon","addonType","Button","disabled","onClick","defaultProps","Title","NavbarBrand","tag","Link","to","Collapse","navbar","NavLink","NavItem","useSettingsContext","settings","setSettings","getSettings","SettingsContext","NavMenu","collapsed","setCollapsed","setTitle","challengeCtx","settingsCtx","useEffect","Container","NavbarToggler","canRegister","Layout","button","attrs","SignUp","newName","inputNewName","setNewName","inputTeamName","success","setSuccess","members","setMembers","handleAdd","name","concat","isMemberValid","field","push","key","index","val","i","test","every","isFormValid","challengeId","SignUpSuccess","NotAuthorized","GetNewTask","location","nextRoundTime","search","slice","split","x","handleSend","document","getElementById","Alert","color","defaultValue","ListItem","ListGroupItem","ListGroupItemHeading","Deadline","onDeadline","fixedDeadline","deadline","deadlineClass","handleDeadline","date","precision","onComplete","daysInHours","Task","match","inputAnswer","deadlineEnd","setDeadlineEnd","err","send","ListGroup","typeId","cost","userHint","whiteSpace","textAlign","question","teamAnswer","Row","LinkRow","clicked","setClicked","Status","setRounds","dateFormat","dateString","toLocaleDateString","toLocaleTimeString","byTypeStatus","isOver","r1","r2","date1","date2","Table","responsive","hover","tasksCount","sum","takenByType","t","takenByRound","TasksList","setPage","thirdColumn","ButtonGroup","Math","max","t1","t2","takeTimestamp","overflow","StatusTask","roundId","Rating","roundIndex","team1","team2","teamIdex","join","Profile","member","App","er","Provider","exact","path","component","exace","Boolean","window","hostname","baseUrl","getElementsByTagName","getAttribute","rootElement","ReactDOM","render","basename","navigator","serviceWorker","ready","registration","unregister"],"mappings":"qMAOMA,EAAc,SAACC,GAAD,OAAc,IAAIC,SAAQ,SAACC,EAASC,GAAV,OAAqBH,EAC9DI,OACAC,OAAM,iBAAO,CACVC,UAAW,wBACXC,iBAAkB,qgBAElBC,WAAY,YAEfC,MAAK,SAACL,GAAD,OAAWJ,EAASU,GACpBR,EAAQE,GACRD,GAjBQ,EAiBmBC,EAjB2C,CAC5EO,KAgBuBX,EAjBNY,OAEjBC,MAFc,EAAeP,UAG7BQ,KAHc,EAA0BP,iBAIxCQ,MAJc,EAA4CP,cAA5C,aAmBH,WAACQ,EAAKC,GAAN,OAAiBC,MAAMF,EAAKC,GACtCR,KAAKV,ICpBK,WAACoB,EAAOC,GAAR,OAAiB,IAAInB,SAAQ,SAACC,QAC5BmB,IAATD,GACAA,EAAKD,GAGTjB,EAAQiB,OCHNG,EAAkB,SAAClB,GAAD,OAAUmB,aAC7BC,QAAQ,SAAUpB,EAAKqB,SAEb,WAACrB,GAAD,OAAUsB,EAAWtB,EAAMkB,ICL3B,EACJ,YADI,EAEC,iBAFD,EAGJ,CACHV,OAAQ,mBACRe,IAAK,aALE,EAOD,eCDC,WAACF,EAAQG,GAAT,YAAkCP,IAAXI,EAChCxB,QAAQE,OAAO,CAAEQ,KAAM,IAAKE,MAAO,qBAHzB,SAACY,GAAD,OAAYI,EAAU,GAAD,OAAIb,EAAJ,mBAAwBS,IAIvDK,CAAQL,GACLhB,KAAKa,GACLb,KAAKmB,ICHP,SAASG,IACZ,MAAw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C,OAAO5F,SAAS6F,UAEc,UAA7BD,OAAO5F,SAAS6F,UAEhBD,OAAO5F,SAAS6F,SAASnE,MACxB,2DCTN,IAAMoE,GAAUvF,SAASwF,qBAAqB,QAAQ,GAAGC,aAAa,QAChEC,GAAc1F,SAASC,eAAe,QAE5C0F,IAASC,OACP,kBAAC,IAAD,CAAeC,SAAUN,IACvB,kBAACV,GAAD,OAEFa,IDwFM,kBAAmBI,WACnBA,UAAUC,cAAcC,MAAM7U,MAAK,SAAC8U,GAChCA,EAAaC,iB","file":"static/js/main.260a88e3.chunk.js","sourcesContent":["const errorInfo = ({ status }, { errorName, errorDescription, errorLevel }) => ({\n code: status,\n error: errorName,\n text: errorDescription,\n level: errorLevel,\n});\n\nconst checkStatus = (response) => new Promise((resolve, reject) => response\n .json()\n .catch(() => ({\n errorName: 'internal-server-error',\n errorDescription: 'Мы не смогли выполнить этот запрос.\\n'\n + 'Попробуйте повторить его позже или обратитесь к организаторам.',\n errorLevel: 'error',\n }))\n .then((json) => (response.ok\n ? resolve(json)\n : reject(errorInfo(response, json)))));\n\nexport default (url, params) => fetch(url, params)\n .then(checkStatus);\n","export default (value, func) => new Promise((resolve) => {\n if (func !== undefined) {\n func(value);\n }\n\n resolve(value);\n});\n","import fromResult from './fromResult';\n\nconst setLocalStorage = (json) => localStorage\n .setItem('secret', json.secret);\n\nexport default (json) => fromResult(json, setLocalStorage);\n","export default {\n teams: 'api/teams',\n challenges: 'api/challenges',\n tasks: {\n status: 'api/tasks/status',\n get: 'api/tasks',\n },\n settings: 'api/settings',\n};\n","import safeFetch from '../extenstions/safeFetch';\nimport setLocalStorage from '../extenstions/setLocalStorage';\nimport url from '../extenstions/url';\n\nconst getTeam = (secret) => safeFetch(`${url.teams}?secret=${secret}`);\n\nexport default (secret, setTeam) => ((secret === undefined)\n ? Promise.reject({ code: 400, error: 'undefined-secret' })\n : getTeam(secret)\n .then(setLocalStorage)\n .then(setTeam));\n","import { useState, useMemo } from 'react';\nimport { createContext } from 'react';\nimport signIn from './teamActions/signIn';\nimport signOut from './teamActions/signOut';\nimport signUp from './teamActions/signUp';\nimport getRating from './teamActions/getRating';\n\nexport function useTeamContext() {\n const [team, setTeam] = useState({});\n const [teams, setTeams] = useState([]);\n \n const teamContext = useMemo(() => ({\n signIn: (secret) => signIn(secret, setTeam),\n signUp: (form) => signUp(form, setTeam),\n signOut: () => signOut(setTeam),\n getRating: () => getRating(setTeams),\n teams,\n team,\n }), [team, teams]);\n return teamContext;\n }\n\nexport const TeamContext = createContext({});\n","import setLocalStorage from '../extenstions/setLocalStorage';\nimport safeFetch from '../extenstions/safeFetch';\nimport url from '../extenstions/url';\n\nexport default (form, setTeam) => safeFetch(url.teams, {\n headers: { 'Content-Type': 'application/json' },\n method: 'POST',\n body: form,\n})\n .then(setLocalStorage)\n .then(setTeam);\n","export default (setTeam) => {\n localStorage.clear();\n setTeam({});\n};\n","import safeFetch from '../extenstions/safeFetch';\nimport url from '../extenstions/url';\n\nexport default (setTeams) => safeFetch(`${url.teams}/all`)\n .then(setTeams);\n","export default (task) => ({\n ...task,\n delta: Date.parse(task.responseTime) - Date.now(),\n});\n","import safeFetch from '../extenstions/safeFetch';\nimport url from '../extenstions/url';\nimport parseResponseTime from '../extenstions/parseResponseTime';\n\nconst getTaskWithType = (round, type, secret) => safeFetch(\n `${url.tasks.get}?round=${round}&type=${type}&secret=${secret}`, { method: 'POST' },\n);\n\nconst getTaskWithoutType = (round, secret) => safeFetch(\n `${url.tasks.get}?round=${round}&secret=${secret}`, { method: 'POST' },\n);\n\nconst getTask = (round, type, secret) => (type !== undefined\n ? getTaskWithType(round, type, secret)\n : getTaskWithoutType(round, secret));\n\nexport default (round, type, secret, setTask) =>\n getTask(round, type, secret)\n .then(parseResponseTime)\n .then(setTask);\n","import { useState, useMemo } from 'react';\nimport { createContext } from 'react';\nimport getNewTask from './taskActions/getNewTask';\nimport setTaskById from './taskActions/setTaskById';\nimport sendAnswer from './taskActions/sendAnswer';\nimport getStatus from './taskActions/getStatus';\nimport getTakenTasks from './taskActions/getTakenTasks';\n\nexport function useTaskContext() {\n const [task, setTask] = useState({});\n const [takenTasks, setTakenTasks] = useState([]);\n \n const taskContext = useMemo(() => ({\n getNewTask: (round, type, secret) => getNewTask(round, type, secret, setTask),\n setTaskById: (id, secret) => setTaskById(id, secret, setTask),\n sendAnswer: (answer, secret) => sendAnswer(task.id, answer, secret, setTask),\n getStatus: (secret) => getStatus(secret, setTakenTasks),\n getTakenTasks: (secret, round, type, status, page, setTasks) => getTakenTasks(secret, round, type, status, page, setTasks),\n status: takenTasks,\n task,\n }), [task, takenTasks]);\n return taskContext;\n}\n\nexport const TaskContext = createContext({});\n","import safeFetch from '../extenstions/safeFetch';\nimport url from '../extenstions/url';\nimport parseResponseTime from '../extenstions/parseResponseTime';\n\nexport default (id, secret, setTask) => safeFetch(\n `${url.tasks.get}/${id}?secret=${secret}`,\n)\n .then(parseResponseTime)\n .then(setTask);\n","import safeFetch from '../extenstions/safeFetch';\nimport url from '../extenstions/url';\n\nexport default (id, answer, secret, setTask) =>\n safeFetch(`${url.tasks.get}/${id}?secret=${secret}`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ answer }),\n })\n .then(setTask);\n","import safeFetch from '../extenstions/safeFetch';\nimport url from '../extenstions/url';\n\nexport default (secret, setStatus) => safeFetch(`${url.tasks.status}?secret=${secret}`)\n .then(setStatus);\n","import safeFetch from '../extenstions/safeFetch';\nimport url from '../extenstions/url';\nimport parseResponseTime from '../extenstions/parseResponseTime';\n\nexport default (secret, round, type, status, page, setTasks) =>\n safeFetch(`${url.tasks.get}?secret=${secret}&round=${round}&type=${type}&status=${status}&offset=${10 * page}&count=10`)\n .then((tasks) => tasks\n .map(parseResponseTime))\n .then(setTasks);\n","import React, { useContext } from 'react';\nimport { TeamContext } from '../contexts/teamContext';\nimport { TaskContext } from '../contexts/taskContext';\n\nexport default function TeamWidget() {\n const ctx = useContext(TeamContext);\n const taskCtx = useContext(TaskContext);\n\n const getPoints = () => Object.values(ctx.team.points).reduce((a, b) => a + b, 0);\n\n function getTasksCount(statuses) {\n let count = 0;\n for (const round in taskCtx.status) {\n for (const type in taskCtx.status[round])\n for (const status in statuses) {\n if (taskCtx.status[round][type][statuses[status]] !== undefined) {\n count += taskCtx.status[round][type][statuses[status]];\n }\n }\n }\n return count;\n };\n\n return (\n
\n
\n
{ctx.team.teamName}
\n
\n
\n Очков: {ctx.team.points && getPoints()}\n
\n Взято задач: {getTasksCount([0,1,2])}\n
\n
\n {getTasksCount([1])}\n
\n
\n {getTasksCount([2])}\n
\n
\n {getTasksCount([0])}\n
\n
\n
\n
\n );\n}\n","import safeFetch from '../extenstions/safeFetch';\nimport url from '../extenstions/url';\nimport fromResult from '../extenstions/fromResult';\n\nconst getChallenge = (id, secret) => safeFetch(`${url.challenges}/${id}?secret=${secret}`);\n\nexport default (id, secret, setChallenge) => ((id === undefined)\n ? fromResult(Promise.reject,\n () => setChallenge({}))\n : getChallenge(id, secret)\n .then(setChallenge));\n","function byDate({ startTimestamp: strA }, { startTimestamp: strB }) {\n const dateA = Date.parse(strA);\n const dateB = Date.parse(strB);\n\n if (dateA > dateB) return 1;\n if (dateA < dateB) return -1;\n return 0;\n}\n\nexport default (challenge) => {\n if (!challenge) return null;\n\n const { rounds } = challenge;\n\n if (!rounds) return null;\n\n const round = rounds\n .filter(({ startTimestamp: start }) => new Date() < Date.parse(start))\n .sort(byDate)[0];\n\n if (!round) return null;\n\n const { startTimestamp } = round;\n\n return new Date(Date.parse(startTimestamp)).toLocaleString();\n};\n","import { useState, useMemo } from 'react';\nimport { createContext } from 'react';\nimport update from './challengeActions/update';\nimport getCurrentRound from './challengeActions/getCurrentRound';\nimport getTaskTypes from './challengeActions/getTaskTypes';\nimport getNextRoundTime from './challengeActions/getNextRoundTime';\nimport getCanChooseType from './challengeActions/getCanChooseType';\nimport getStartedRounds from './challengeActions/getStartedRounds';\nimport getRoundById from './challengeActions/getRoundById';\n\nexport function useChallengeContext() {\n const [challenge, setChallenge] = useState({});\n \n const challengeContext = useMemo(() => ({\n update: (id, secret) => update(id, secret, setChallenge),\n getCurrentRound: () => getCurrentRound(challenge),\n getTaskTypes: (round) => getTaskTypes(round),\n getNextRoundTime: () => getNextRoundTime(challenge),\n getCanChooseType: (round) => getCanChooseType(round),\n getStartedRounds: () => getStartedRounds(challenge),\n getRoundById: (id) => getRoundById(challenge, id),\n challenge,\n }), [challenge]);\n return challengeContext;\n}\n\nexport const ChallengeContext = createContext({});\n","export default (challenge) => {\n if (!challenge) return null;\n\n const { rounds } = challenge;\n\n if (!rounds) return null;\n\n return rounds\n .filter(({ startTimestamp, endTimestamp }) =>\n Date.parse(startTimestamp) <= new Date()\n && new Date() <= Date.parse(endTimestamp))[0];\n};\n","export default (round) => {\n if (!round) return [];\n\n const { taskTypes } = round;\n\n if (!taskTypes) return [];\n\n return taskTypes.map(({ id }) => id);\n};\n","export default (round) => {\n if (!round) return false;\n\n const { canChooseType } = round;\n\n return canChooseType === true;\n};\n","export default (challenge) => {\n if (!challenge) return null;\n\n const { rounds } = challenge;\n\n if (!rounds) return null;\n\n return rounds\n .filter(({ startTimestamp }) => Date.parse(startTimestamp) <= new Date());\n};\n","export default (challenge, id) => {\n if (!challenge) return null;\n\n const { rounds } = challenge;\n\n if (!rounds) return null;\n\n const results = rounds.filter((r) => r.id === id);\n\n if (results.length === 0) return null;\n\n return results[0];\n};\n","import React from 'react';\nimport ReactMarkdown from 'react-markdown';\nimport { ChallengeContext } from '../contexts/challengeContext';\n\nexport default function ChallengeDescription() {\n return (\n \n {(ctx) => }\n \n );\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default function FormContainer({ children }) {\n return (\n
\n {children}\n
\n );\n}\n\nFormContainer.propTypes = {\n children: PropTypes.arrayOf(PropTypes.node).isRequired,\n};\n","import React from 'react';\nimport FormContainer from '../controls/FormContainer';\n\nexport default function CommonDescription() {\n return (\n \n

Привет

\n

Это сервис для проведения онлайн-соревнований.

\n

\n Команде выдаются задачи различных типов.\n Им предлагается написать бота, автоматизирующего решения этих задач.\n

\n

\n Чем больше типов задач умеет решать бот, чем быстрее и оптимальнее он их решает,\n тем больше очков получит команда.\n

\n

\n Для начала, зарегистрируй команду на соревнование или войди, используя секретный ключ.\n

\n
\n );\n}\n","import React from 'react';\nimport TeamWidget from '../blocks/TeamWidget';\nimport ChallengeDescription from '../blocks/ChallengeDescription';\nimport CommonDescription from '../blocks/CommonDescription';\n\nexport default function Home() {\n return (\n
\n { localStorage.secret\n && (\n
\n
\n \n
\n
\n \n
\n
\n )}\n { !localStorage.secret\n && }\n
\n );\n}\n","import React from 'react';\nimport { Navbar } from 'reactstrap';\nimport PropTypes from 'prop-types';\n\nexport default function NavBar({ children }) {\n return (\n \n {children}\n \n );\n}\n\nNavBar.propTypes = {\n children: PropTypes.node.isRequired,\n};\n","export default function onEnter(func) {\n return {\n onKeyDown: (e) => {\n if (e.keyCode === 13) {\n e.preventDefault();\n func(e.target.value);\n }\n },\n };\n}\n","import { useState } from 'react';\n\nexport default function useInput(defaultState) {\n const [get, set] = useState(defaultState);\n const input = {\n onChange: (e) => set(e.target.value),\n value: get,\n };\n\n return [get, input, set];\n}\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Toast, ToastBody, ToastHeader } from 'reactstrap';\nimport styled from 'styled-components';\n\nconst Header = styled(ToastHeader)`\n .close {\n font-size: 1.2rem;\n }\n`;\n\nconst icons = {\n error: 'danger',\n warning: 'warning',\n};\n\nconst title = {\n error: 'Ошибка сервера',\n warning: 'Внимание',\n};\n\nlet timer;\n\nexport default function Error({ code, error, text, level, close }) {\n const [getState, setState] = useState(true);\n const hide = () => {\n clearTimeout(timer);\n setState(false);\n setTimeout(close, 500);\n };\n\n clearTimeout(timer);\n timer = setTimeout(hide, 3000);\n\n return (\n
\n \n
\n
\n { title[level] }\n
\n
\n \n { code }-{ error }\n { text && (\n \n
\n { text }\n
\n )}\n
\n
\n
\n );\n}\n\nError.propTypes = {\n code: PropTypes.number.isRequired,\n error: PropTypes.string.isRequired,\n close: PropTypes.func.isRequired,\n level: PropTypes.string.isRequired,\n text: PropTypes.string,\n};\n\nError.defaultProps = {\n text: '',\n};\n","import React, { useState, useContext } from 'react';\nimport {\n Input, Button, InputGroup, InputGroupAddon,\n} from 'reactstrap';\nimport PropTypes from 'prop-types';\nimport { TeamContext } from '../../contexts/teamContext';\nimport onEnter from '../../etc/onEnter';\nimport useInput from '../../etc/useInput';\nimport Error from '../../blocks/Error';\n\nexport default function LoginField() {\n const [pending, setPending] = useState(false);\n const [error, setError] = useState(null);\n const [secret, inputSecret] = useInput('');\n const teamCtx = useContext(TeamContext);\n\n const login = () => {\n setError(null);\n setPending(true);\n\n teamCtx\n .signIn(secret)\n .catch(setError);\n\n setPending(false);\n };\n\n return (\n \n { error && error.code !== 401 && setError(null)} /> }\n \n \n \n Войти\n \n \n \n );\n}\n\nLoginField.propTypes = {\n className: PropTypes.string,\n};\n\nLoginField.defaultProps = {\n className: '',\n};\n","import React from 'react';\nimport { NavbarBrand } from 'reactstrap';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\n\nexport default function Title({ text }) {\n return (\n \n { text }\n \n );\n}\n\nTitle.propTypes = {\n text: PropTypes.string.isRequired,\n};\n","import React from 'react';\nimport { Collapse as Collapsed } from 'reactstrap';\nimport PropTypes from 'prop-types';\n\nexport default function Collapse({ children, isOpen }) {\n return (\n \n {children}\n \n );\n}\n\nCollapse.propTypes = {\n children: PropTypes.arrayOf(PropTypes.node).isRequired,\n isOpen: PropTypes.bool.isRequired,\n};\n","import { NavItem, NavLink as OldNavLink } from 'reactstrap';\nimport { Link } from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nexport default function NavLink({ to, title, onClick }) {\n return (\n \n {title}\n \n );\n}\n\nNavLink.propTypes = {\n to: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n onClick: PropTypes.func,\n};\n\nNavLink.defaultProps = {\n onClick: null,\n};\n","import { useState, useMemo } from 'react';\nimport { createContext } from 'react';\nimport getSettings from './settingsActions/getSettings';\n\nexport function useSettingsContext() {\n const [settings, setSettings] = useState({});\n \n const settingsContext = useMemo(() => ({\n settings,\n getSettings: () => getSettings(setSettings),\n }), [settings]);\n return settingsContext;\n}\n\nexport const SettingsContext = createContext({});\n","import safeFetch from '../extenstions/safeFetch';\nimport url from '../extenstions/url';\n\nexport default (setSettings) => safeFetch(url.settings)\n .then(setSettings);\n","import { Container, NavbarToggler } from 'reactstrap';\nimport './NavMenu.css';\nimport React, { useState, useEffect, useContext } from 'react';\nimport NavBar from '../controls/navbar/Navbar';\nimport LoginField from '../controls/navbar/LoginField';\nimport { TeamContext } from '../contexts/teamContext';\nimport { ChallengeContext } from '../contexts/challengeContext';\nimport Title from '../controls/navbar/Title';\nimport Collapse from '../controls/navbar/Collapse';\nimport NavLink from '../controls/navbar/NavLink';\nimport {SettingsContext} from '../contexts/settingsContext';\n\nexport default function NavMenu() {\n const [collapsed, setCollapsed] = useState(true);\n const [title, setTitle] = useState(undefined);\n const teamCtx = useContext(TeamContext);\n const challengeCtx = useContext(ChallengeContext);\n const settingsCtx = useContext(SettingsContext);\n\n useEffect(() => setTitle(challengeCtx.challenge.title),\n [challengeCtx]);\n\n const toggleNavbar = () => setCollapsed(!collapsed);\n\n return (\n
\n \n \n \n <NavbarToggler onClick={toggleNavbar} />\n <Collapse isOpen={!collapsed}>\n <ul className=\"navbar-nav\">\n {!localStorage.secret && settingsCtx.settings.canRegister && (\n <React.Fragment>\n <NavLink to=\"/signup\" title=\"Регистрация\" />\n </React.Fragment>\n )}\n {localStorage.secret && (\n <React.Fragment>\n <NavLink to=\"/rating\" title=\"Рейтинг\" />\n <NavLink to=\"/status\" title=\"Задачи\" />\n <NavLink to=\"/profile\" title={teamCtx.team.teamName || 'Профиль'} />\n <NavLink to=\"/\" title=\"Выйти\" onClick={teamCtx.signOut} />\n </React.Fragment>\n )}\n </ul>\n {!localStorage.secret && <LoginField />}\n </Collapse>\n </Container>\n </NavBar>\n </header>\n );\n}\n","import { Container } from 'reactstrap';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport NavMenu from './NavMenu';\n\nexport default function Layout({ children }) {\n return (\n <div>\n <NavMenu />\n <Container>\n { children }\n </Container>\n </div>\n );\n}\n\nLayout.propTypes = {\n children: PropTypes.arrayOf(PropTypes.node).isRequired,\n};\n","import styled from 'styled-components';\n\nexport default styled.button.attrs({\n className: 'btn',\n type: 'button',\n})`\n width: 110px;\n text-align: center;\n display: inline;\n`;\n","import React, {useState, useContext, Fragment} from 'react';\nimport { Redirect } from 'react-router-dom';\nimport Button from '../controls/FormButton';\nimport useInput from '../etc/useInput';\nimport Error from '../blocks/Error';\nimport FormContainer from '../controls/FormContainer';\nimport onEnter from '../etc/onEnter';\nimport { TeamContext } from '../contexts/teamContext';\nimport { SettingsContext } from '../contexts/settingsContext';\n\nexport default function SignUp() {\n const [newName, inputNewName, setNewName] = useInput('');\n const [teamName, inputTeamName] = useInput('');\n\n const [success, setSuccess] = useState(false);\n const [pending, setPending] = useState(false);\n const [error, setError] = useState(null);\n const [members, setMembers] = useState([]);\n\n const teamCtx = useContext(TeamContext);\n const settingsCtx = useContext(SettingsContext);\n\n const removeName = (index) => setMembers(members.filter((val, i) => i !== index));\n const addName = (name) => setMembers(members.concat(name));\n const handleAdd = () => {\n addName(newName);\n setNewName('');\n };\n const handleSend = (e) => {\n e.preventDefault();\n\n setError(null);\n setPending(true);\n\n teamCtx\n .signUp(JSON.stringify({\n members,\n teamName,\n challengeId: settingsCtx.settings.challengeId,\n }))\n .then(() => setSuccess(true))\n .catch(setError);\n\n setPending(false);\n };\n\n const isTeamNameValid = (field) => field !== null && field !== '' && /^[A-Za-z]+[0-9]+_[0-9]+ /.test(field);\n const isMemberValid = (field) => field !== null && field !== '';\n const isFormValid = () => isTeamNameValid(teamName) && members.length > 0 && members.every(isMemberValid);\n\n return (\n <FormContainer>\n {success && <Redirect push to=\"/signupSuccess\" />}\n { error && <Error {...error} close={() => setError(null)} />}\n { settingsCtx.settings.canRegister && (\n <Fragment>\n <h1>Создать команду</h1>\n <form>\n <div className=\"form-group\">\n Идентификатор и название в формате «X0_0 Название»\n <input className=\"form-control\" {...inputTeamName} />\n </div>\n Участники\n {members.map((name, id) => (\n <div key={id} className=\"form-group input-group\">\n <input className=\"form-control\" value={name} disabled />\n <div className=\"input-group-append\">\n <Button className=\"btn-outline-danger\" onClick={() => removeName(id)}>\n Исключить\n </Button>\n </div>\n </div>\n ))}\n <div className=\"form-group input-group\">\n <input className=\"form-control\" {...inputNewName} {...onEnter(handleAdd)} />\n <div className=\"input-group-append\">\n <Button className=\"btn-outline-success\" onClick={handleAdd}>\n Добавить\n </Button>\n </div>\n </div>\n <Button\n disabled={!isFormValid() || pending}\n className=\"btn-primary\"\n onClick={handleSend}\n >\n Отправить\n </Button>\n </form>\n </Fragment>\n )}\n { !settingsCtx.settings.canRegister && <h1>Регистрация закрыта</h1> }\n </FormContainer>\n );\n}\n","import React from 'react';\nimport FormContainer from '../controls/FormContainer';\n\nexport default function SignUpSuccess() {\n const { secret } = localStorage;\n\n return (\n <FormContainer>\n <h1 className=\"text-nowrap\">Команда зарегистрирована</h1>\n <div className=\"py-4\">\n Ваш секретный ключ:\n <input disabled className=\"form-control\" value={secret} />\n </div>\n <div className=\"alert alert-warning\">\n Этот ключ используется для авторизации на сервере.\n <br />\n Передавайте его <b>ТОЛЬКО</b> участникам вашей команды.\n </div>\n </FormContainer>\n );\n}\n","import React, { Fragment } from 'react';\n\nexport default function NotAuthorized() {\n return (\n <Fragment>\n { !localStorage.secret && (\n <div>\n <h1>Вы не авторизированы</h1>\n Для доступа к этой странице, войдите с помощью секретного ключа.\n </div>\n )}\n </Fragment>\n );\n}\n","import React, { useContext, useState, useMemo } from 'react';\nimport { Alert, InputGroup, InputGroupAddon } from 'reactstrap';\nimport { Redirect } from 'react-router-dom';\nimport PropTypes from 'prop-types';\nimport Button from '../controls/FormButton';\nimport { TaskContext } from '../contexts/taskContext';\nimport Error from '../blocks/Error';\nimport { ChallengeContext } from '../contexts/challengeContext';\nimport NotAuthorized from '../blocks/NotAuthorized';\n\nexport default function GetNewTask({ location }) {\n const [error, setError] = useState(null);\n const [success, setSuccess] = useState(false);\n const [pending, setPending] = useState(false);\n\n const taskCtx = useContext(TaskContext);\n const challengeCtx = useContext(ChallengeContext);\n\n const round = useMemo(() => challengeCtx.getCurrentRound(), [challengeCtx]);\n const canChooseType = useMemo(() => challengeCtx.getCanChooseType(round), [challengeCtx, round]);\n const taskTypes = useMemo(() => challengeCtx.getTaskTypes(round), [challengeCtx, round]);\n const nextRoundTime = useMemo(() => challengeCtx.getNextRoundTime(), [challengeCtx]);\n\n const search = location.search\n .slice(1)\n .split('&')\n .map((x) => x.split('='))\n .filter((x) => x[0] === 'type')[0];\n\n const type = search !== undefined ? search[1] : undefined;\n\n const selectedType = () => (canChooseType\n ? document.getElementById('type').value\n : undefined);\n\n const handleSend = (e) => {\n e.preventDefault();\n setError(null);\n setPending(true);\n taskCtx\n .getNewTask(round.id, selectedType(), localStorage.secret)\n .then(() => {\n setPending(false);\n setSuccess(true);\n })\n .catch((e) => {\n setPending(false);\n setError(e);\n });\n };\n\n return (\n <React.Fragment>\n <h1>Получить задачу</h1>\n { success && <Redirect push to={`/tasks/${taskCtx.task.id}`} />}\n { error && <Error {...error} close={() => setError(null)} /> }\n <NotAuthorized />\n { !round && localStorage.secret && (\n <React.Fragment>\n <h4>Нельзя получить задачу</h4>\n Активного этапа сейчас нет.\n <br />\n Ближайший начнется в { nextRoundTime || 'следующей жизни' }.\n </React.Fragment>\n )}\n { round && (\n <div className=\"row\">\n <div className=\"col-lg-6 col-md-6 order-lg-1 order-md-1 mb-3\">\n <Alert color=\"warning\">\n <h4>Внимание</h4>\n Как только вы получите задачу, начнется отсчёт времени.<br />\n Вы не получите очков за задачу, отправив ее по истечении указанного времени.\n </Alert>\n </div>\n <div className=\"col-lg-6 col-md-6\">\n <form>\n { canChooseType && (\n <div>\n <h5>Тип задачи</h5>\n <InputGroup>\n <select className=\"form-control\" id=\"type\" defaultValue={type}>\n {taskTypes.map((id) => <option key={id}>{ id }</option>)}\n </select>\n <InputGroupAddon addonType=\"append\">\n <Button disabled={pending} className=\"btn-primary\" onClick={handleSend}>\n Получить\n </Button>\n </InputGroupAddon>\n </InputGroup>\n </div>\n )}\n { !canChooseType && (\n <React.Fragment>\n <p>\n В данном этапе выбирать тип задачи нельзя.\n <br />\n Вы получите задачу случайного типа.\n </p>\n <Button disabled={pending} className=\"btn-primary\" onClick={handleSend}>\n Получить\n </Button>\n </React.Fragment>\n )}\n </form>\n </div>\n </div>\n )}\n </React.Fragment>\n );\n}\n\nGetNewTask.propTypes = {\n location: PropTypes.shape({\n search: PropTypes.string.isRequired,\n }).isRequired,\n};\n","import React from 'react';\nimport { ListGroupItem, ListGroupItemHeading } from 'reactstrap';\nimport PropTypes from 'prop-types';\n\nexport default function ListItem({ title, value, children, className, color }) {\n return (\n <ListGroupItem className={className} color={color}>\n { title && <ListGroupItemHeading>{title}</ListGroupItemHeading> }\n <span className=\"text-right w-100\">\n {value}\n {children}\n </span>\n </ListGroupItem>\n );\n}\n\nListItem.propTypes = {\n title: PropTypes.string,\n color: PropTypes.string,\n className: PropTypes.string,\n value: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.number,\n ]),\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node,\n ]),\n};\n\nListItem.defaultProps = {\n title: undefined,\n value: '',\n children: [],\n color: 'white',\n className: '',\n};\n","import React, { Fragment } from \"react\";\r\nimport Countdown from \"react-countdown-now\";\r\n\r\nexport default function Deadline({ task, onDeadline }) {\r\n const fixedDeadline = task.deadline[task.deadline.length - 1] === 'Z' ? task.deadline : task.deadline + 'Z';\r\n const deadline = Date.parse(fixedDeadline) - task.delta;\r\n\r\n let deadlineClass = \"text-danger\";\r\n\r\n const handleDeadline = () => {\r\n onDeadline && onDeadline(true);\r\n deadlineClass += \" d-none\";\r\n };\r\n\r\n if (deadline < Date.now()) handleDeadline();\r\n\r\n return (\r\n <Fragment>\r\n <div className={deadlineClass}>\r\n <Countdown date={deadline} precision={1} onComplete={handleDeadline} daysInHours />\r\n </div>\r\n </Fragment>\r\n );\r\n}\r\n","import React, {Fragment, useContext, useEffect, useState} from 'react';\nimport ReactMarkdown from 'react-markdown';\nimport PropTypes from 'prop-types';\nimport { ListGroup, ListGroupItem, ListGroupItemHeading, InputGroup, Input, Button, InputGroupAddon, Alert } from 'reactstrap';\nimport ListItem from '../blocks/ListItem';\nimport { TaskContext } from '../contexts/taskContext';\nimport Error from '../blocks/Error';\nimport useInput from '../etc/useInput';\nimport onEnter from '../etc/onEnter';\nimport Deadline from '../blocks/Deadline';\n\nconst color = ['secondary', 'success', 'danger'];\n\n\nexport default function Task({ match }) {\n const [error, setError] = useState(null);\n const [pending, setPending] = useState(false);\n const [answer, inputAnswer] = useInput('');\n const ctx = useContext(TaskContext);\n const { id } = match.params;\n const [deadlineEnd, setDeadlineEnd] = useState(false);\n\n useEffect(() => {\n if (id !== ctx.task.id) {\n ctx.setTaskById(id, localStorage.secret)\n .catch((err) => {\n ctx.task.id = null;\n setError(err);\n });\n }\n }, [ctx, id]);\n\n const send = () => {\n setError(null);\n setPending(true);\n\n ctx.sendAnswer(answer, localStorage.secret)\n .then(() => {\n setPending(false);\n })\n .catch((e) => {\n setPending(false);\n setError(e);\n });\n };\n\n const handleSend = (e) => {\n e.preventDefault();\n send();\n };\n\n return (\n <div>\n { error && <Error {...error} close={() => setError(null)} />}\n { ctx.task.id === id && (\n <Fragment>\n { deadlineEnd && (\n <Alert color=\"danger\">\n <h4>Время истекло</h4>\n С этого момента вы не сможете получить очки за эту задачу\n </Alert>\n )}\n { ctx.task.status !== undefined && ctx.task.status !== 0 && (\n <Alert color={color[ctx.task.status]}>\n { ctx.task.status === 1 && <h4>Задача решена верно</h4> }\n { ctx.task.status === 2 && <h4>Ответ неверный</h4> }\n </Alert>\n )}\n <div className=\"row\">\n <div className=\"col-lg-3 col-md-4 order-md-1 pl-md-0\">\n <ListGroup>\n <ListItem title=\"ID задачи\" color={color[ctx.task.status]}>\n <small>{id}</small>\n </ListItem>\n <ListItem className=\"d-flex\" title=\"Тип\" value={ctx.task.typeId} />\n <ListItem className=\"d-flex\" title=\"Цена\" value={ctx.task.cost} />\n { ctx.task.status === 0 && (\n <ListItem className=\"d-flex\" title=\"Время\">\n <Deadline task={ctx.task} onDeadline={setDeadlineEnd} />\n </ListItem>\n )}\n { ctx.task.status !== 0 && (\n <ListItem className=\"d-flex\" title=\"Получено\" value={ctx.task.points} />\n )}\n </ListGroup>\n </div>\n <div className=\"col-lg-9 col-md-8 order-md-0 mt-n1 mt-md-0\">\n <ListGroup>\n <ListGroupItem>\n <ListGroupItemHeading>Задача</ListGroupItemHeading>\n <ReactMarkdown source={ctx.task.userHint} />\n </ListGroupItem>\n <ListItem>\n <pre style={{ whiteSpace: 'pre-wrap', textAlign: 'left' }}>\n {ctx.task.question}\n </pre>\n </ListItem>\n { ctx.task.status === 0 && (\n <ListItem className=\"p-0\">\n <InputGroup>\n <Input className=\"border-0\" placeholder=\"Ваш ответ\" {...inputAnswer} {...onEnter(send)} />\n <InputGroupAddon addonType=\"append\">\n <Button color=\"primary\" className=\"rounded-0\" disabled={pending} onClick={handleSend}>\n Отправить\n </Button>\n </InputGroupAddon>\n </InputGroup>\n </ListItem>\n )}\n { ctx.task.status !== 0 && (\n <ListItem title=\"Ваш ответ\" value={ctx.task.teamAnswer} />\n )}\n </ListGroup>\n </div>\n </div>\n </Fragment>\n )}\n </div>\n );\n}\n\nTask.propTypes = PropTypes.shape({\n match: PropTypes.shape({\n params: PropTypes.shape({\n id: PropTypes.string.isRequired,\n }).isRequired,\n }).isRequired,\n}).isRequired;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Redirect } from 'react-router-dom';\nimport styled from 'styled-components';\n\nconst Row = styled('tr')`\n cursor: pointer;\n`;\n\nexport default function LinkRow({ children, to }) {\n const [clicked, setClicked] = useState(false);\n const click = () => setClicked(true);\n\n return (\n <Row onClick={click}>\n { clicked && <Redirect push to={to} /> }\n {children}\n </Row>\n );\n}\n\nLinkRow.propTypes = {\n to: PropTypes.string.isRequired,\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node,\n ]),\n};\n\nLinkRow.defaultProps = {\n children: [],\n};\n","import React, { useContext, useState, useEffect } from 'react';\nimport { Button, Table } from 'reactstrap';\nimport ReactMarkdown from 'react-markdown';\nimport { Link } from 'react-router-dom';\nimport { ChallengeContext } from '../contexts/challengeContext';\nimport { TaskContext } from '../contexts/taskContext';\nimport LinkRow from '../blocks/LinkRow';\nimport Error from '../blocks/Error';\nimport NotAuthorized from '../blocks/NotAuthorized';\n\nexport default function Status() {\n const ctx = useContext(ChallengeContext);\n const taskCtx = useContext(TaskContext);\n const [rounds, setRounds] = useState(null);\n const [error, setError] = useState(null);\n\n useEffect(() => {\n setRounds(ctx.getStartedRounds());\n }, [ctx]);\n\n const dateFormat = (dateString) => {\n const date = new Date(dateString);\n return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;\n };\n\n const byStartTime = (r1, r2) => {\n const date1 = new Date(r1.startTimestamp);\n const date2 = new Date(r2.startTimestamp);\n\n if (date1 < date2) return 1;\n if (date1 > date2) return -1;\n return 0;\n };\n\n const takenByType = (round, type) => {\n if (taskCtx.status[round] === undefined) return 0;\n\n let sum = 0;\n for (let status = 0; status < 3; status += 1) {\n if (taskCtx.status[round][type][status] !== undefined) {\n sum += taskCtx.status[round][type][status];\n }\n }\n return sum;\n };\n\n const takenByRound = (round) => {\n if (taskCtx.status[round] === undefined) return 0;\n\n let count = 0;\n for (const type in taskCtx.status[round])\n for (const status in [0, 1, 2]) {\n if (taskCtx.status[round][type][status] !== undefined) {\n count += taskCtx.status[round][type][status];\n }\n }\n return count;\n };\n\n const byTypeStatus = (round, type, status) =>\n taskCtx.status[round] !== undefined && taskCtx.status[round][type][status] !== undefined\n ? taskCtx.status[round][type][status]\n : 0;\n\n const sum = (array) => array.reduce((a, b) => a + b, 0);\n const isOver = (r) => new Date(r.endTimestamp) < Date.now();\n const canChooseType = (round) => ctx.getCanChooseType(round) && !isOver(round);\n const getTasksCount = (round, statuses) => {\n let count = 0;\n for (const type in taskCtx.status[round])\n for (const status in statuses) {\n if (taskCtx.status[round][type][statuses[status]] !== undefined) {\n count += taskCtx.status[round][type][statuses[status]];\n }\n }\n return count;\n };\n\n return (\n <div>\n { error && <Error {...error} close={() => setError(null)} />}\n <h1>Этапы</h1>\n <NotAuthorized />\n { rounds && rounds.sort(byStartTime).map((round) => (\n <div key={round.id}>\n <div className=\"d-flex py-3 align-items-center flex-wrap\">\n <h2 className=\"m-0\">{round.id}</h2>\n <div className=\"px-3\">\n <p className=\"m-0\">\n <b>Начало:</b> {dateFormat(round.startTimestamp)}\n </p>\n <p className=\"m-0\">\n <b>Конец:</b> {dateFormat(round.endTimestamp)}\n </p>\n </div>\n <Button\n color={isOver(round) ? 'secondary' : 'primary'}\n tag={Link}\n to=\"/tasks\"\n disabled={isOver(round)}\n >\n {isOver(round) ? 'Этап завершен' : 'Взять задачу'}\n </Button>\n </div>\n <ReactMarkdown source={round.description} />\n <Table responsive hover>\n <thead>\n <tr>\n <th>Тип</th>\n <th>Всего</th>\n <th>Взято</th>\n <th><span role=\"img\" aria-label=\"completed\">✅</span></th>\n <th><span role=\"img\" aria-label=\"failed\">❌</span></th>\n <th><span role=\"img\" aria-label=\"waiting\">⏳</span></th>\n <th>Очки</th>\n </tr>\n </thead>\n <tbody>\n {round.taskTypes.map((type) => (\n <LinkRow key={type.id} to={`/status/${round.id}/${type.id}`}>\n <td className=\"text-nowrap\">\n <span className=\"pr-3\">{type.id}</span>\n { canChooseType(round)\n && (\n <Button\n className=\"btn-sm py-0 mt-n1\"\n color=\"primary\"\n tag={Link}\n to={`/tasks?type=${type.id}`}\n >\n +\n </Button>\n )}\n </td>\n <td>{type.tasksCount}</td>\n <td>{takenByType(round.id, type.id)}</td>\n <td>{byTypeStatus(round.id, type.id, 1)}</td>\n <td>{byTypeStatus(round.id, type.id, 2)}</td>\n <td>{byTypeStatus(round.id, type.id, 0)}</td>\n <td>{byTypeStatus(round.id, type.id, 'points')}</td>\n </LinkRow>\n ))}\n <tr className=\"bg-light\">\n <th>Итого</th>\n <th>{sum(round.taskTypes.map((t) => t.tasksCount))}</th>\n <th>{takenByRound(round.id)}</th>\n <th>{getTasksCount(round.id, [1])}</th>\n <th>{getTasksCount(round.id, [2])}</th>\n <th>{getTasksCount(round.id, [0])}</th>\n <th>{getTasksCount(round.id, ['points'])}</th>\n </tr>\n </tbody>\n </Table>\n </div>\n ))}\n </div>\n );\n}\n","import React, { useState, useContext, useEffect } from 'react';\nimport {Button, ButtonGroup, Table} from 'reactstrap';\nimport LinkRow from './LinkRow';\nimport Deadline from './Deadline';\nimport { TaskContext } from '../contexts/taskContext';\n\nexport default function TasksList({ round, type, status }) {\n const [page, setPage] = useState(0);\n const taskCtx = useContext(TaskContext);\n const [tasks, setTasks] = useState([]);\n\n useEffect(() => {\n setTasks([]);\n taskCtx.getTakenTasks(localStorage.secret, round, type, status, page, setTasks);\n }, [page, round, status, taskCtx, type]);\n\n const title = (status === 0)\n ? 'Задачи без ответа'\n : (status === 1)\n ? 'Решённые задачи'\n : 'Неверно решённые задачи';\n const thirdColumn = (status === 0)\n ? 'Время'\n : 'Очки';\n const dateFormat = (dateString) => {\n if (!dateString) return '–';\n const date = new Date(dateString);\n return (\n <span>\n {date.toLocaleDateString()}\n  \n {date.toLocaleTimeString()}\n </span>\n );\n };\n const byTakenTime = (t1, t2) => {\n const date1 = new Date(t1.takeTimestamp);\n const date2 = new Date(t2.takeTimestamp);\n if (date1 < date2) return 1;\n if (date1 > date2) return -1;\n return 0;\n };\n\n return (\n <div>\n <div className=\"d-flex py-3 align-items-center flex-wrap\">\n <h4 className=\"pr-3\">{title}</h4>\n <ButtonGroup>\n <Button color=\"primary\" disabled={page < 1} onClick={() => setPage(page - 1)}>←</Button>\n <Button color=\"primary\" disabled>{page * 10 + 1} — {page * 10 + Math.max(tasks.length, 1)}</Button>\n <Button color=\"primary\" disabled={!tasks.length} onClick={() => setPage(page + 1)}>→</Button>\n </ButtonGroup>\n </div>\n <Table responsive hover>\n <thead>\n <tr>\n <th>ID</th>\n <th>Взята</th>\n <th>{thirdColumn}</th>\n </tr>\n </thead>\n <tbody>\n {tasks.sort(byTakenTime).map((task) => (\n <LinkRow key={task.id} to={`/tasks/${task.id}`}>\n <td style={{ maxWidth: '10vw', overflow: 'hidden' }}>{task.id}</td>\n <td>{dateFormat(task.takeTimestamp)}</td>\n {status === 0 && (\n <td>\n <Deadline task={task} />\n </td>\n )}\n {status !== 0 && (\n <td>\n {task.points}\n </td>\n )}\n </LinkRow>\n ))}\n </tbody>\n </Table>\n </div>\n );\n}\n","import React, {\n useContext, useMemo, Fragment,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport { Button } from 'reactstrap';\nimport { Link } from 'react-router-dom';\nimport { ChallengeContext } from '../contexts/challengeContext';\nimport NotAuthorized from '../blocks/NotAuthorized';\nimport TasksList from '../blocks/TasksList';\n\nexport default function StatusTask({ match }) {\n const { roundId, typeId } = match.params;\n const ctx = useContext(ChallengeContext);\n\n const round = useMemo(() => ctx.getRoundById(roundId), [ctx, roundId]);\n const isOver = useMemo(() => !round || new Date(round.endTimestamp) < Date.now(), [round]);\n\n return (\n <div>\n <h1>Задачи</h1>\n <div className=\"d-flex py-3 align-items-center flex-wrap\">\n <h2 className=\"pr-3\">{roundId} — {typeId}</h2>\n { !isOver && <Button color=\"primary\" tag={Link} to={`/tasks?type=${typeId}`}>Взять задачу</Button> }\n </div>\n <NotAuthorized />\n {localStorage.secret && (\n <Fragment>\n <TasksList round={roundId} type={typeId} status={0} />\n <TasksList round={roundId} type={typeId} status={1} />\n <TasksList round={roundId} type={typeId} status={2} />\n </Fragment>\n )}\n </div>\n );\n}\n\nStatusTask.propTypes = PropTypes.shape({\n match: PropTypes.shape({\n params: PropTypes.shape({\n roundId: PropTypes.string.isRequired,\n typeId: PropTypes.string.isRequired,\n }).isRequired,\n }).isRequired,\n}).isRequired;\n","import React, { useContext, useMemo } from 'react';\nimport { Table } from 'reactstrap';\nimport { TeamContext } from '../contexts/teamContext';\nimport { ChallengeContext } from '../contexts/challengeContext';\n\nexport default function Rating() {\n const ctx = useContext(TeamContext);\n const challengeCtx = useContext(ChallengeContext);\n const rounds = useMemo(() => (challengeCtx.challenge.rounds\n ? challengeCtx.challenge.rounds.map((round) => round.id)\n : []), [challengeCtx]);\n const sum = (team) => Object.values(team.points).reduce((a, b) => a + b, 0);\n\n const bySum = (team1, team2) => {\n if (sum(team1) < sum(team2)) return 1;\n if (sum(team1) > sum(team2)) return -1;\n return 0;\n };\n\n return (\n <div>\n <h1>Рейтинг</h1>\n <Table responsive>\n <thead>\n <tr>\n <th>#</th>\n <th>Команда</th>\n <th>Состав</th>\n { rounds.map((round, roundIndex) => (\n <th key={roundIndex}>{round}</th>\n ))}\n <th>Очки</th>\n </tr>\n </thead>\n <tbody>\n { ctx.teams\n .filter((team) => team.challengeId === challengeCtx.challenge.id)\n .sort(bySum)\n .map((team, teamIdex) => (\n <tr key={teamIdex}>\n <td>{teamIdex + 1}</td>\n <td>{team.teamName}</td>\n <td>{team.members.join(', ')}</td>\n { rounds.map((round, roundIndex) => <td key={roundIndex}>{ team.points[round] }</td>)}\n <td>{sum(team)}</td>\n </tr>\n ))}\n </tbody>\n </Table>\n </div>\n );\n}\n","import React, { useContext } from 'react';\nimport { TeamContext } from '../contexts/teamContext';\nimport FormContainer from '../controls/FormContainer';\n\nexport default function Profile() {\n const ctx = useContext(TeamContext);\n\n return (\n <FormContainer>\n <h1>{ctx.team && ctx.team.teamName}</h1>\n <h4>Ваш секретный ключ</h4>\n <input disabled className=\"form-control my-2\" value={localStorage.secret} />\n <h4>Состав команды</h4>\n { ctx.team.members && ctx.team.members.map((member, index) => <input disabled className=\"form-control my-2\" key={index} value={member} />)}\n </FormContainer>\n );\n}\n","import React, { useState, useEffect } from 'react';\nimport { Route, Switch } from 'react-router-dom';\nimport Home from './pages/Home';\nimport Layout from './blocks/Layout';\nimport SignUp from './pages/SignUp';\nimport SignUpSuccess from './pages/SignUpSuccess';\nimport { TeamContext, useTeamContext } from './contexts/teamContext';\nimport { TaskContext, useTaskContext } from './contexts/taskContext';\nimport { ChallengeContext, useChallengeContext } from './contexts/challengeContext';\nimport GetNewTask from './pages/GetNewTask';\nimport Task from './pages/Task';\nimport Status from './pages/Status';\nimport StatusTask from './pages/StatusTask';\nimport Error from './blocks/Error';\nimport Rating from './pages/Rating';\nimport { SettingsContext, useSettingsContext } from './contexts/settingsContext';\nimport Profile from './pages/Profile';\n\nexport default function App() {\n const [error, setError] = useState(null);\n\n const teamCtx = useTeamContext();\n const taskCtx = useTaskContext();\n const challengeCtx = useChallengeContext();\n const settingsCtx = useSettingsContext();\n\n const secret = localStorage.secret;\n\n useEffect(() => {\n teamCtx\n .signIn(secret)\n .catch((e) => {\n if (e.error !== 'undefined-secret') setError(e);\n });\n teamCtx.getRating();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [secret]);\n\n useEffect(() => {\n challengeCtx\n .update(teamCtx.team.challengeId, secret)\n .catch(setError);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [teamCtx.team, secret]);\n\n useEffect(() => {\n taskCtx\n .getStatus(secret)\n .catch((er) => {\n if (er.code !== 401) setError(er);\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [teamCtx.team, secret]);\n\n useEffect(() => {\n settingsCtx\n .getSettings();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <SettingsContext.Provider value={settingsCtx}>\n <TaskContext.Provider value={taskCtx}>\n <TeamContext.Provider value={teamCtx}>\n <ChallengeContext.Provider value={challengeCtx}>\n <Layout>\n {error && <Error {...error} close={() => setError(null)} /> }\n <Route exact path=\"/\" component={Home} />\n <Route exact path=\"/signup\" component={SignUp} />\n <Route exact path=\"/signupSuccess\" component={SignUpSuccess} />\n <Route exact path=\"/rating\" component={Rating} />\n <Route exace path=\"/profile\" component={Profile} />\n <Switch>\n <Route exact path=\"/status\" component={Status} />\n <Route path=\"/status/:roundId/:typeId\" component={StatusTask} />\n </Switch>\n <Switch>\n <Route path=\"/tasks/:id\" component={Task} />\n <Route exact path=\"/tasks\" component={GetNewTask} />\n </Switch>\n </Layout>\n </ChallengeContext.Provider>\n </TeamContext.Provider>\n </TaskContext.Provider>\n </SettingsContext.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; 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. 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 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 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 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","import 'bootstrap/dist/css/bootstrap.css';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { BrowserRouter } from 'react-router-dom';\nimport App from './App';\nimport { unregister } from './registerServiceWorker';\n\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');\nconst rootElement = document.getElementById('root');\n\nReactDOM.render(\n <BrowserRouter basename={baseUrl}>\n <App />\n </BrowserRouter>,\n rootElement,\n);\n\nunregister();\n"],"sourceRoot":""}