\n {/* Learning Track dropdown for mobile viwes*/}\n\n
\n \n Learning Track\n \n\n \n \n {pathwayName} \n\n \n \n \n \n
\n
\n\n {isOpen && (\n
\n {/*
*/}\n {listData}\n
\n )}\n
\n )}\n >\n );\n}\n\nexport default DrawerLeft;\n","import React, { useState, useEffect, useRef } from \"react\";\nimport { useHistory } from \"react-router-dom\";\nimport CreateClassComponent from \"../../components/Class\";\nimport ClassesList from \"../../components/Class/ClassList\";\nimport { useSelector } from \"react-redux\";\nimport \"../../components/Class/ClassList/styles.scss\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../services/api\";\nimport \"./styles.scss\";\nimport useStyles from \"./styles\";\nimport {\n Container,\n Button,\n Modal,\n useMediaQuery,\n Box,\n Stack,\n Typography,\n Dialog,\n DialogTitle,\n DialogActions,\n Grid,\n} from \"@mui/material\";\nimport { breakpoints } from \"../../theme/constant\";\nimport ClassForm from \"../../components/Class/ClassForm\";\nimport SuccessModel from \"../../components/Class/SuccessModel\";\nimport NewVolunteerCard from \"../../components/Class/NewVolunteerCard\";\nimport DrawerLeft from \"./Drawer\";\nimport ReactPaginate from \"react-paginate\";\n\nfunction ToggleClassFormModal() {\n const [showModal, setShowModal] = useState(false);\n const [formType, setFormType] = useState(\"batch\");\n const [classToEdit, setClassToEdit] = useState({});\n const [indicator, setIndicator] = useState(false);\n const [showConsentModal, setShowConsentModal] = useState(false);\n const [refreshKey, setRefreshKey] = useState(true);\n // const { data = [] } = useSelector(({ Class }) => Class.allClasses);\n const user = useSelector(({ User }) => User);\n const [open, setOpen] = React.useState(false);\n const handleOpen = () => setOpen(true);\n const [openSuccessfullModal, setOpenSuccessfullModal] = useState(false);\n const [isEditMode, setIsEditMode] = React.useState(false);\n const classes = useStyles();\n const [showClass, setShowClasses] = useState(true);\n const [pathwayID, setPathwayId] = useState(1);\n\n const [pathwayName, setPathwayName] = useState(\"Python\");\n\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const isActiveIpad = useMediaQuery(\"(max-width:1300px)\");\n\n const rolesList = user.data.user.rolesList;\n const canSpecifyFacilitator = rolesList.indexOf(\"admin\") > -1;\n\n const [calenderConsent, setCalenderConsent] = useState(true);\n const [authUrl, setAuthUrl] = useState(\"\");\n const [Newpathways, setNewPathways] = useState([]);\n const [typeOfClass, setTypeOfClass] = useState(\"batch\");\n const url = window.location.href;\n\n const toggleModalOpen = () => {\n // setFormType();\n setClassToEdit({});\n // setShowModal(!showModal);\n CalenderConsent();\n };\n\n //here can check\n const editClass = (classId, indicator) => {\n setClassToEdit(data.find((classData) => classData.id === classId));\n setIsEditMode(true);\n setShowModal(true);\n setIndicator(indicator);\n };\n\n const CalenderConsent = () => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/users/calendar/tokens`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n if (res.data.success) {\n setCalenderConsent(true);\n setShowModal(true);\n } else {\n setCalenderConsent(false);\n setShowConsentModal(true);\n setShowModal(false);\n }\n })\n .catch((err) => {});\n };\n\n const handleClose = () => {\n setShowConsentModal(false);\n };\n\n const codeGenerate = async () => {\n return axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/users/calendar/generateAuthURL`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n setAuthUrl(res.data.url);\n })\n .catch((err) => {});\n };\n\n const calledOnce = useRef(false);\n const history = useHistory();\n\n useEffect(() => {\n let code;\n let payload;\n let user_id;\n let user_email;\n if (url.includes(\"code\")) {\n const decodedUri = decodeURIComponent(url);\n user_id = decodedUri.split(\"=\")[2].split(\"+\")[0];\n user_email = decodedUri.split(\"=\")[3].split(\"&\")[0];\n code = url.split(\"code=\")[1].split(\"scope\")[0];\n payload = {\n ...payload,\n user_id: parseInt(user_id, 10),\n user_email: user_email,\n };\n calledOnce.current = true;\n }\n if (calledOnce.current) {\n return axios({\n method: METHODS.PUT,\n url: `${process.env.REACT_APP_MERAKI_URL}/users/calendar/tokens`,\n\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n code: code,\n },\n data: payload,\n })\n .then((res) => {\n if (res.data.success) {\n setShowModal(true);\n history.push(\"/batch\");\n }\n })\n .catch((err) => {});\n }\n }, [calledOnce]);\n const [newVolunteer, setNewVolunteer] = useState(false);\n\n const [data, setData] = useState([]);\n const [page, setPage] = useState(0);\n const [loading, setLoading] = useState(true);\n const [totalCount, setTotalCount] = useState();\n const limit = 9;\n\n useEffect(() => {\n refreshKey &&\n axios({\n method: METHODS.GET,\n url: `${\n process.env.REACT_APP_MERAKI_URL\n }/batches/${pathwayID}?limit=${limit}&page=${\n page + 1\n }&typeOfClass=${typeOfClass}`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n setData(res.data.batches);\n setTotalCount(res.data.total_count);\n setLoading(false);\n setRefreshKey(false);\n })\n .catch((res) => {\n setLoading(false);\n });\n }, [pathwayID, limit, page, typeOfClass, refreshKey, setRefreshKey]);\n\n const pageCount = Math.ceil(totalCount / limit);\n\n const changePage = ({ selected }) => {\n setPage(selected);\n setRefreshKey(true);\n };\n\n useEffect(() => {\n try {\n const newVol = localStorage.getItem(\"isNewVolunteer\");\n if (newVol == \"true\" && newVol != null) {\n setNewVolunteer(true);\n } else {\n setNewVolunteer(false);\n }\n } catch (error) {\n //console.error('Error accessing localStorage:', error);\n return {};\n }\n }, [newVolunteer]);\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/names`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n setNewPathways(res.data);\n })\n .catch((err) => {});\n }, []);\n\n return (\n \n {!isSelf && senderName && (\n
\n )}\n
\n
\n
\n {format(new Date(formattedMessage.origin_server_ts), \"hh:mm aaa\")}\n
\n
\n {senderName}\n
\n
\n
{\n setMessageActionsMenu(false);\n setIsMessageActionsDropdownOpen(false);\n }}\n >\n {replyToMessage && (\n
\n
\n
in reply to
\n
\n
member.sender === replyToMessage.sender\n )\n )}\n style={{\n marginRight: 8,\n width: 16,\n height: 16,\n fontSize: 12,\n }}\n />\n \n {getMemberName(\n members.find(\n (member) => member.sender === replyToMessage.sender\n )\n )}\n
\n \n
\n
{replyToMessage.body}
\n
\n )}\n
\n {isMessageActionsMenuOpen && messageActions.length > 0 && (\n
\n {\n setIsMessageActionsDropdownOpen(\n !isMessageActionsDropdownOpen\n );\n }}\n >\n \n \n \n
\n )}\n
\n {formattedMessage.options && renderOptions(formattedMessage.options)}\n
\n {isSelf && senderName && (\n
\n )}\n
\n );\n }\n return null;\n};\n","import React, { useEffect, useRef } from \"react\";\nimport Message from \"../Message\";\nimport format from \"date-fns/format\";\nimport { getMemberName, getAreDatesOnDifferentDays } from \"../utils\";\nimport \"./styles.scss\";\n\nexport default ({\n messages,\n selfChatId,\n onScroll,\n members,\n onSendMessage,\n deleteMessage,\n activateReplyToMessageState,\n prevScrollPosition,\n}) => {\n const messagesRef = useRef();\n\n useEffect(() => {\n if (prevScrollPosition) {\n messagesRef.current.scrollTop = prevScrollPosition;\n }\n }, [messages && messages.length]);\n\n return (\n {\n setSelectedRoomId(null);\n }}\n icon={ }\n styles={{\n top: 16,\n left: 16,\n }}\n />\n )}\n >\n );\n };\n\n return (\n \n {isInitializingClient ? (\n \n ) : (\n <>\n {renderRooms()}\n {renderChat()}\n >\n )}\n
\n );\n};\n\nexport default Mentor;\n","import React, { useState } from \"react\";\nimport axios from \"axios\";\nimport { useSelector } from \"react-redux\";\nimport Loader from \"../common/Loader\";\nimport { toast } from \"react-toastify\";\nimport \"./styles.scss\";\n\nfunction MerakiChatRoom() {\n const [loading, setLoading] = useState(false);\n const user = useSelector(({ User }) => User);\n const [chatRoom, setChatRoom] = useState({\n name: \"\",\n topic: \"\",\n roomAliasName: \"\",\n visibility: \"\",\n });\n\n const handleChange = async (event) => {\n setChatRoom({ ...chatRoom, [event.target.name]: event.target.value });\n };\n\n const submit = (event) => {\n setLoading(true);\n event && event.preventDefault();\n axios\n .post(`${process.env.REACT_APP_MERAKI_URL}/chat/room`, chatRoom, {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then(() => {\n toast.success(\"Room Created!\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n });\n setLoading(false);\n })\n .catch((error) => {\n toast.error(\n `Room couldn't be created!: ${error.response.status} ${error.response.data.message.error}`,\n {\n position: toast.POSITION.BOTTOM_RIGHT,\n }\n );\n setLoading(false);\n });\n };\n\n return (\n <>\n \n >\n );\n}\n\nexport default MerakiChatRoom;\n","import React, { useEffect, useState } from \"react\";\nimport axios from \"axios\";\nimport { useSelector } from \"react-redux\";\n// import { BsArrowUpDown } from \"react-icons/bs\";\nimport { BsArrowDownUp } from 'react-icons/bs';\nimport { METHODS } from \"../../services/api\";\nimport { useDebounce } from \"use-debounce\";\nimport ReactPaginate from \"react-paginate\";\nimport moment from \"moment\";\nimport Slider from \"rc-slider\";\nimport \"rc-slider/assets/index.css\";\nimport \"./styles.scss\";\n\n\n\nconst { createSliderWithTooltip } = Slider;\nconst Range = createSliderWithTooltip(Slider.Range);\n\nconst getPartnerIdFromUrl = () => {\n let partnerId;\n if (window.location.pathname.includes(\"partner\")) {\n partnerId = window.location.pathname.split(\"/\").pop();\n }\n return partnerId;\n};\n\nfunction MerakiUsers() {\n const [pageNumber, setPageNumber] = useState(0);\n const [totalCount, setTotalCount] = useState();\n const [message, setMessage] = useState(\"\");\n const [students, setStudents] = useState([]);\n const [slicedStudents, setSlicedStudents] = useState([]);\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [sortMethod, setSortMethod] = useState(\"dsc\");\n const [sort_class, setSortClass] = useState(\"sorter\");\n const [filterVal, setFilterVal] = useState([0, 0]);\n const [filteredData, setFilteredData] = useState(false);\n const [debouncedText] = useDebounce(searchTerm, 400);\n\n const user = useSelector(({ User }) => User);\n\n const limit = 10;\n let id = getPartnerIdFromUrl();\n useEffect(() => {\n // let id = getPartnerIdFromUrl();\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/users/students/classes${\n searchTerm.length > 0 ? `?name=${searchTerm}` : \"\"\n }`,\n headers: { accept: \"application/json\", Authorization: user.data.token },\n })\n .then((res) => {\n if (\n id == user.data.user.partner_id ||\n user.data.user.rolesList.indexOf(\"admin\") > -1\n ) {\n if (res.data.students.length < 1) {\n setMessage(\"There are no results to display\");\n } else {\n const data = res.data.students\n .map((item) => {\n if (item.classes_registered.length > 0) {\n item.averageRating = 0;\n let avg = 0;\n let count = 0;\n item.classes_registered.map((f) => {\n if (f.feedback.feedback) {\n avg = avg + parseInt(f.feedback.feedback);\n count += 1;\n }\n });\n if (avg > 0) item.averageRating = avg / count;\n else item.averageRating = avg;\n item.classes_registered = item.classes_registered.sort(\n (c1, c2) => {\n return new Date(c1.start_time) - new Date(c2.start_time);\n }\n );\n }\n return {\n ...item,\n // not overwriting original created_at because we need the date object to sort by date\n formatted_created_at: item.created_at\n ? moment(item.created_at.replace(\"Z\", \"\")).format(\n \"DD-MM-YYYY\"\n )\n : \"\",\n classes_registered: item.classes_registered.map((item) => {\n return {\n ...item,\n formatted_start_time: item.start_time\n ? moment(item.start_time.replace(\"Z\", \"\")).format(\n \"DD-MM-YYYY\"\n )\n : \"\",\n /**\n * REVIEW\n * Why item is there again in the next line?\n */\n item,\n formatted_end_time: item.end_time\n ? moment(item.end_time.replace(\"Z\", \"\")).format(\n \"hh:mm a\"\n )\n : \"\",\n };\n }),\n };\n })\n .sort((a, b) => {\n return a.name.localeCompare(b.name);\n });\n setStudents(data);\n setSlicedStudents(\n data.slice(pageNumber * limit, (pageNumber + 1) * limit)\n );\n setTotalCount(res.data.count);\n }\n }\n })\n .catch((err) => {});\n }, [debouncedText]);\n\n const pageCount = Math.ceil(totalCount / limit);\n const changePage = ({ selected }) => {\n setPageNumber(selected);\n };\n\n const sortStudents = (byMethod) => {\n const students = filteredData ? filter : students;\n let sortedStudents;\n if (byMethod === \"name\") {\n sortedStudents = students.sort().reverse();\n } else if (byMethod === \"enroll_date\") {\n sortedStudents = students.sort((a, b) =>\n sortMethod === \"asc\"\n ? new Date(a.created_at) - new Date(b.created_at)\n : new Date(b.created_at) - new Date(a.created_at)\n );\n } else if (byMethod === \"total_classes\") {\n sortedStudents = students.sort((a, b) =>\n sortMethod === \"asc\"\n ? a.classes_registered.length - b.classes_registered.length\n : b.classes_registered.length - a.classes_registered.length\n );\n } else if (byMethod === \"last_class_title\") {\n const zeroClass = students.filter((a) => {\n return a.classes_registered.length <= 0;\n });\n sortedStudents = students\n .filter((a) => {\n return a.classes_registered.length > 0;\n })\n .sort((a, b) => {\n return sortMethod === \"asc\"\n ? a.classes_registered[\n a.classes_registered.length - 1\n ].title.localeCompare(\n b.classes_registered[b.classes_registered.length - 1].title\n )\n : b.classes_registered[\n b.classes_registered.length - 1\n ].title.localeCompare(\n a.classes_registered[a.classes_registered.length - 1].title\n );\n });\n sortedStudents = [...sortedStudents, ...zeroClass];\n } else if (byMethod === \"last_class_date\") {\n const zeroClass = students.filter((a) => {\n return a.classes_registered.length <= 0;\n });\n sortedStudents = students\n .filter((a) => {\n if (a.classes_registered.length > 0) {\n a.classes_registered = a.classes_registered.sort((c1, c2) => {\n return new Date(c1.start_time) - new Date(c2.start_time);\n });\n return a;\n }\n })\n .sort((a, b) => {\n const startTimeOfA = [];\n const startTimeOfB = [];\n a.classes_registered.forEach((c) =>\n startTimeOfA.push(new Date(c.start_time))\n );\n b.classes_registered.forEach((c) =>\n startTimeOfB.push(new Date(c.start_time))\n );\n return sortMethod === \"asc\"\n ? Math.max(...startTimeOfA) - Math.max(...startTimeOfB)\n : Math.max(...startTimeOfB) - Math.max(...startTimeOfA);\n });\n sortedStudents = [...sortedStudents, ...zeroClass];\n } else if (byMethod === \"rating\") {\n const zeroClass = students.filter((a) => {\n return a.classes_registered.length <= 0;\n });\n sortedStudents = students.sort((a, b) => {\n return sortMethod === \"asc\"\n ? a.averageRating - b.averageRating\n : b.averageRating - a.averageRating;\n });\n sortedStudents = [...sortedStudents, ...zeroClass];\n }\n setStudents(sortedStudents);\n setSlicedStudents(\n sortedStudents.slice(pageNumber * limit, (pageNumber + 1) * limit)\n );\n if (sortMethod === \"asc\") {\n setSortClass(\"sorter\");\n setSortMethod(\"dsc\");\n } else {\n setSortClass(\"sorter turn\");\n setSortMethod(\"asc\");\n }\n };\n\n const handleChange = (value) => {\n setFilteredData(true);\n setFilterVal(value);\n };\n\n let filter = [];\n students.filter((item) => {\n if (filterVal[0] === 0) {\n if (item.classes_registered.length === 0) {\n filter.push(item);\n }\n } else if (filterVal[0] === 30) {\n if (item.classes_registered.length >= 30) {\n filter.push(item);\n }\n } else {\n const range = (min, max) =>\n Array.from({ length: max - min + 1 }, (_, i) => min + i);\n range(filterVal[0], filterVal[1]).map((range) => {\n if (item.classes_registered.length === range) {\n filter.push(item);\n }\n });\n }\n });\n\n useEffect(() => {\n if (filteredData) {\n const slicedData = filter.slice(\n pageNumber * limit,\n (pageNumber + 1) * limit\n );\n setSlicedStudents(slicedData);\n } else {\n const slicedData = students.slice(\n pageNumber * limit,\n (pageNumber + 1) * limit\n );\n setSlicedStudents(slicedData);\n }\n }, [pageNumber, filterVal]);\n\n return (\n \n
\n
\n {\n setSearchTerm(e.target.value);\n }}\n />\n
\n
\n }\n nextLabel={ }\n initialPage={0}\n marginPagesDisplayed={0}\n onPageChange={changePage}\n pageCount={pageCount}\n containerClassName=\"paginationBttns\"\n previousLinkClassName=\"previousBttn\"\n nextLinkClassName=\"nextBttn\"\n disabledClassName=\"paginationDisabled\"\n activeClassName=\"paginationActive\"\n />\n
\n
\n
\n
Total attended classes \n
\n (value === 40 ? (value = \"30+\") : value)}\n value={filterVal}\n onChange={handleChange}\n marks={{\n 0: 0,\n 1: 1,\n 6: 6,\n 10: 10,\n 15: 15,\n 20: 20,\n 25: 25,\n 30: 30,\n 40: `${30}+`,\n }}\n />\n
\n
{\n setFilteredData(false);\n setFilterVal([0, 0]);\n }}\n className=\"filter-clear\"\n >\n clear\n \n
\n
\n \n \n \n Students Name\n sortStudents(\"name\")}\n >\n \n \n \n \n Partner Name\n {/* sortStudents(\"name\")}\n >\n \n */}\n \n\n \n Enroll date\n sortStudents(\"enroll_date\")}\n >\n \n \n \n \n Classes Attended\n sortStudents(\"total_classes\")}\n >\n \n \n \n \n Last Class Title\n sortStudents(\"last_class_title\")}\n >\n \n \n \n \n Last Class Date\n sortStudents(\"last_class_date\")}\n >\n \n \n \n Last Class Time \n \n Average Rating\n sortStudents(\"rating\")}\n >\n \n \n \n \n \n \n {filteredData\n ? slicedStudents.map((item) => {\n let getStars = 0;\n let totalStarts = item.classes_registered.length * 5;\n item.classes_registered.map((stars) => {\n getStars = getStars + Number(stars.feedback.feedback);\n });\n return (\n \n {item.name} \n\n \n {item.partner ? item.partner.name : \"NA\"}\n \n\n \n {item.formatted_created_at}\n \n \n {\" \"}\n {item.classes_registered.length}\n \n\n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[\n item.classes_registered.length - 1\n ][\"title\"] != \"\"\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"title\"]\n : \"NA\"}\n \n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_start_time\"]\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_start_time\"]\n : \"NA\"}\n \n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_end_time\"]\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_end_time\"]\n : \"NA\"}\n \n \n {[1, 2, 3, 4, 5].map((star) => {\n return Math.ceil(item.averageRating) > 0 &&\n star <= Math.ceil(item.averageRating) ? (\n \n ) : (\n \n );\n })}\n \n \n );\n })\n : slicedStudents.map((item) => {\n let getStars = 0;\n let totalStarts = item.classes_registered.length * 5;\n item.classes_registered.map((stars) => {\n getStars = getStars + Number(stars.feedback.feedback);\n });\n return (\n \n {item.name} \n\n \n {item.partner ? item.partner.name : \"NA\"}\n \n\n \n {item.formatted_created_at}\n \n \n {\" \"}\n {item.classes_registered.length}\n \n\n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[\n item.classes_registered.length - 1\n ][\"title\"] != \"\"\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"title\"]\n : \"NA\"}\n \n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_start_time\"]\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_start_time\"]\n : \"NA\"}\n \n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_end_time\"]\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_end_time\"]\n : \"NA\"}\n \n \n {[1, 2, 3, 4, 5].map((star) => {\n return Math.ceil(item.averageRating) > 0 &&\n star <= Math.ceil(item.averageRating) ? (\n \n ) : (\n \n );\n })}\n \n \n );\n })}\n {message ? {message} : null}\n \n
\n
\n );\n}\n\nexport default MerakiUsers;\n","import React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../services/api\";\nimport \"./styles.scss\";\nimport { toast } from \"react-toastify\";\nimport MerakiCreateRoom from \"../CreateChatRoom/index\";\nimport MerakiUsers from \"../MerakiUsers\";\n\nfunction User() {\n const user = useSelector(({ User }) => User);\n const [allClasses, setAllClasses] = useState([]);\n const [values, setValues] = useState({\n email: \"\",\n roomId: \"\",\n });\n const lang = { en: \"English\", hi: \"Hindi\", sp: \"Spoken English\" };\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/chat/rooms`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n setAllClasses(res.data);\n })\n .catch((err) => {});\n }, []);\n\n const changeHandler = (e) => {\n setValues({ ...values, [e.target.name]: e.target.value });\n };\n\n const submitHandler = () => {\n const notify = () => {\n const roomAlias = allClasses.filter((c) => {\n return c.room_id === values.roomId;\n });\n const className =\n lang[roomAlias[0].room_alias.split(\"meraki\")[1].substr(0, 2)] +\n \" Class - \" +\n roomAlias[0].room_alias\n .split(\":navgurukul.org\")[0]\n .split(\"meraki\")[1]\n .split(\"class\")[1];\n toast.success(`Added ${values.email} to ${className} successfully!`, {\n position: toast.POSITION.BOTTOM_RIGHT,\n autoClose: 2500,\n });\n };\n return axios({\n method: METHODS.POST,\n url: `${process.env.REACT_APP_MERAKI_URL}/chat/addUser/${values.roomId}?email=${values.email}`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then(() => {\n notify();\n })\n .catch((err) => {});\n };\n\n return (\n <>\n \n \n \n Email\n \n \n \n Select Class\n \n \n \n Select a Class from options below\n \n {allClasses.map((item, index) => {\n const className =\n lang[item.room_alias.split(\"meraki\")[1].substr(0, 2)] +\n \" Class - \" +\n item.room_alias\n .split(\":navgurukul.org\")[0]\n .split(\"meraki\")[1]\n .split(\"class\")[1];\n return (\n \n {className}\n \n );\n })}\n \n \n Add\n \n
\n \n \n
\n >\n );\n}\n\nexport default User;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n underline: {\n width: \"60px\",\n textAlign: \"center\",\n marginBottom: \"30px\",\n },\n list: {\n display: \"flex\",\n marginLeft: \"12px\",\n },\n}));\n\nexport default useStyles;\n","import React from \"react\";\nimport { Container, Box, Typography } from \"@mui/material\";\nimport CircleIcon from \"@mui/icons-material/Circle\";\nimport useStyles from \"./styles\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../theme/constant\";\n\nfunction PrivacyPolicy() {\n const classes = useStyles();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n return (\n \n \n \n Privacy Policy\n \n \n NavGurukul Foundation for Social Welfare built the Meraki app as an\n Open Source app. This service is provided by NavGurukul Foundation for\n Social Welfare at no cost and is intended for use as is.\n \n \n This page is used to inform visitors regarding our policies with the\n collection, use, and disclosure of personal information if anyone\n decided to use our service. If you choose to use our service, then you\n agree to the collection and use of information in relation to this\n policy. The personal information that we collect is used for providing\n and improving the service. We will not use or share your information\n with anyone except as described in this privacy policy.\n \n \n The terms used in this privacy policy have the same meanings as in our\n terms and conditions, which is accessible at Meraki unless otherwise\n defined in this privacy policy.\n \n \n \n \n Information Collection and Use\n \n \n For a better experience, while using our service, we may require you\n to provide us with certain personally identifiable information,\n including but not limited to Email Address, Name, Profile Picture\n link, Google User ID. The information that we request will be retained\n by us and used as described in this privacy policy. The app does use\n third party services that may collect information used to identify\n you. Link to privacy policy of third party service providers used by\n the app.\n \n \n The app does use third party services that may collect information\n used to identify you. Link to privacy policy of third party service\n providers used by the app.\n \n \n \n Google Play Services \n \n \n \n Google Analytics for Firebase \n \n \n \n Log Data \n\n \n We want to inform you that whenever you use our service, in the case\n of an error in the app we collect data and information (through third\n party products) on your phone called log data. This log data may\n include information such as your device Internet Protocol (“IP”)\n address, device name, operating system version, the configuration of\n the app when utilizing our service, the time and date of your use of\n the service, and other statistics.\n \n \n \n Cookies \n \n Cookies are files with a small amount of data that are commonly used\n as anonymous unique identifiers. These are sent to your browser from\n the websites that you visit and are stored on your devices internal\n memory.\n \n \n This service does not use these “cookies” explicitly. However, the app\n may use third party code and libraries that use “cookies” to collect\n information and improve their services. You have the option to either\n accept or refuse these cookies and know when a cookie is being sent to\n your device. If you choose to refuse our cookies, you may not be able\n to use some portions of this service.\n \n \n \n Service Providers \n\n \n We may employ third-party companies and individuals due to the\n following reasons:-\n {[\n \"To facilitate our service\",\n \"To provide the service on our behalf\",\n \"To perform service-related services\",\n \"To assist us in analyzing how our service is used\",\n ].map((text) => (\n \n \n {text} \n \n ))}\n \n \n We want to inform users of this service that these third parties have\n access to your personal information. The reason is to perform the\n tasks assigned to them on our behalf. However, they are obligated not\n to disclose or use the information for any other purpose.\n \n \n \n Security \n\n \n We value your trust in providing us your personal information, thus we\n are striving to use commercially acceptable means of protecting it.\n But remember that no method of transmission over the internet, or\n method of electronic storage is 100% secure and reliable, and we\n cannot guarantee its absolute security.\n \n \n \n Links to Other Sites \n\n \n This service may contain links to other sites. If you click on a\n third-party link, you will be directed to that site. Note that these\n external sites are not operated by us. Therefore, we strongly advise\n you to review the privacy policy of these websites. We have no control\n over and assume no responsibility for the content, privacy policies,\n or practices of any third-party sites or services.\n \n \n \n Children’s Privacy \n\n \n These services do not address anyone under the age of 13. We do not\n knowingly collect personally identifiable information from children\n under 13 years of age. In the case we discover that a child under 13\n has provided us with personal information, we immediately delete this\n from our servers. If you are a parent or guardian and you are aware\n that your child has provided us with personal information, please\n contact us so that we will be able to do necessary actions.\n \n \n \n \n Changes to this Privacy Policy\n \n\n \n We may update our privacy policy from time to time. Thus, you are\n advised to review this page periodically for any changes. We will\n notify you of any changes by posting the new privacy policy on this\n page. This policy is effective as of 2020-12-01\n \n \n \n Contact Us \n\n \n If you have any questions or suggestions about our privacy policy, do\n not hesitate to contact us at{\" \"}\n team@merakilearn.org. \n \n \n \n );\n}\n\nexport default PrivacyPolicy;\n","import React, { useEffect, useState } from \"react\";\nimport axios from \"axios\";\nimport ReactPaginate from \"react-paginate\";\nimport { CopyToClipboard } from \"react-copy-to-clipboard\";\n// import { BsArrowUpDown } from \"react-icons/bs\";\nimport { BsArrowDownUp } from 'react-icons/bs';\n\nimport \"./styles.scss\";\nimport { METHODS } from \"../../../services/api\";\nimport { Link } from \"react-router-dom\";\nimport { useDebounce } from \"use-debounce\";\nimport { PATHS } from \"../../../constant\";\nimport { useSelector } from \"react-redux\";\nimport { toast } from \"react-toastify\";\nimport { Redirect } from \"react-router-dom\";\n\ntoast.configure();\n\nfunction PartnerDashboard() {\n const [pageNumber, setPageNumber] = useState(0);\n const [totalCount, setTotalCount] = useState();\n const [partners, setPartners] = useState([]);\n const [slicedPartners, setSlicedPartners] = useState([]);\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [sortMethod, setSortMethod] = useState(\"dsc\");\n const [sort_class, setSortClass] = useState(\"sorter\");\n const [debouncedText] = useDebounce(searchTerm, 400);\n const [message, setMessage] = useState(\"\");\n const [isDisabled, setDisabled] = useState(false);\n\n const user = useSelector(({ User }) => User);\n const limit = 15;\n\n \n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/partners${\n searchTerm.length > 0 ? `?name=${searchTerm}` : \"\"\n }`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n }).then((res) => {\n if (res.data.partners.length < 1) {\n setSlicedPartners([]);\n setMessage(\"There are no results to display\");\n } else {\n setPartners(res.data.partners);\n setSlicedPartners(\n res.data.partners.slice(pageNumber * limit, (pageNumber + 1) * limit)\n );\n setTotalCount(res.data.partners.length);\n }\n });\n }, [debouncedText]);\n\n useEffect(() => {\n const slicedData = partners.slice(\n pageNumber * limit,\n (pageNumber + 1) * limit\n );\n setSlicedPartners(slicedData);\n }, [pageNumber]);\n\n const pageCount = Math.ceil(totalCount / limit);\n const changePage = ({ selected }) => {\n setPageNumber(selected);\n };\n\n const sortPartners = (byMethod) => {\n let sortedPartners = partners;\n if (byMethod === \"name\") {\n sortedPartners = partners.sort().reverse();\n } else if (byMethod === \"students\") {\n sortedPartners = partners.sort((a, b) => {\n return sortMethod === \"asc\" ? a.users - b.users : b.users - a.users;\n });\n }\n setPartners(sortedPartners);\n setSlicedPartners(\n sortedPartners.slice(pageNumber * limit, (pageNumber + 1) * limit)\n );\n if (sortMethod === \"asc\") {\n setSortClass(\"sorter\");\n setSortMethod(\"dsc\");\n } else {\n setSortClass(\"sorter turn\");\n setSortMethod(\"asc\");\n }\n };\n\n const createMerakiLink = (id, platform) => {\n // commenting the console.log for now\n // console.log(id, platform);\n\n axios({\n method: METHODS.PUT,\n url: `${process.env.REACT_APP_MERAKI_URL}/partners/${id}/merakiLink`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n platform: platform,\n },\n })\n .then((res) => {\n console.log(res);\n\n toast.success(\"Link created!\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n autoClose: 2500,\n });\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/partners?${\n searchTerm.length > 0\n ? `name=${searchTerm}`\n : `limit=${limit}&page=${pageNumber + 1}`\n }`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n }).then((res) => {\n setPartners(res.data.partners);\n setTotalCount(res.data.count);\n });\n })\n .catch(() => {\n toast.error(\"Something went wrong\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n autoClose: 2500,\n });\n });\n };\n if (user.data.user.rolesList.indexOf(\"admin\") > -1) {\n return (\n <>\n \n
\n
\n {\n setSearchTerm(e.target.value);\n setMessage(\"\");\n }}\n />\n
\n
\n }\n nextLabel={ }\n initialPage={0}\n marginPagesDisplayed={0}\n onPageChange={changePage}\n pageCount={pageCount}\n containerClassName=\"paginationBttns\"\n previousLinkClassName=\"previousBttn\"\n nextLinkClassName=\"nextBttn\"\n disabledClassName=\"paginationDisabled\"\n activeClassName=\"paginationActive\"\n />\n
\n
\n
\n \n \n \n Partner's Name\n sortPartners(\"name\")}\n >\n \n \n \n \n Number of students\n sortPartners(\"students\")}\n >\n \n \n \n Meraki - Android Link \n Meraki - Web Link \n {/* Partner specific url */}\n \n \n \n {slicedPartners.map((item) => {\n return (\n \n \n \n {\" \"}\n {item.name}\n \n \n {item.user} \n {item.meraki_link ? (\n \n \n Get Link\n \n {\n toast.success(\"Copied to Clipboard\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n autoClose: 1200,\n });\n }}\n >\n \n \n \n ) : (\n \n createMerakiLink(item.id, \"android\")}\n >\n Create link\n
\n \n )}\n {item.web_link ? (\n \n \n Get Link\n \n {\n toast.success(\"Copied to Clipboard\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n autoClose: 1200,\n });\n }}\n >\n \n \n \n ) : (\n \n createMerakiLink(item.id, \"web\")}\n >\n Create link\n
\n \n )}\n {/* \n \n Get Url\n \n {\n toast.success(\"Copied to Clipboard\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n autoClose: 1200,\n });\n }}\n >\n \n \n */}\n \n );\n })}\n {message ? {message} : null}\n \n
\n
\n >\n );\n }\n return ;\n}\nexport default PartnerDashboard;\n","import React, { useState, useEffect, useRef } from \"react\";\nimport axios from \"axios\";\nimport { useSelector } from \"react-redux\";\nimport { toast } from \"react-toastify\";\nimport \"./style.scss\";\nimport { METHODS } from \"../../services/api\";\nimport {\n TextField,\n InputAdornment,\n IconButton,\n Typography,\n Grid,\n} from \"@mui/material\";\nimport {\n Radio,\n RadioGroup,\n FormControlLabel,\n FormControl,\n} from \"@mui/material\";\nimport { Visibility, VisibilityOff } from \"@mui/icons-material\";\nimport { FormHelperText } from \"@mui/material\";\n\nfunction AddStudent({\n openEditForm,\n setOpenEditForm,\n userId,\n userName,\n userEmail,\n setTriggerdGet,\n studentid,\n stupassword,\n}) {\n const [openForm, setOpenForm] = useState(false);\n const [studentEmail, setStudentEmail] = useState(\"\");\n const [studentName, setStudentName] = useState(\"\");\n const [newUserName, setNewUserName] = useState(\"\");\n const [password, setPassword] = useState(\"\");\n const [showPassword, setShowPassword] = useState(false);\n const [loginMethod, setLoginMethod] = useState(\"email\");\n const user = useSelector(({ User }) => User);\n const partnerId = window.location.pathname.split(\"/\")[2];\n const [error, setError] = useState(false);\n const [errorData, setErrorData] = useState(\"\");\n const [errors, setErrors] = useState({\n name: \"\",\n username: \"\",\n password: \"\",\n email: \"\",\n });\n\n const handlePasswordVisibility = (e) => {\n e.stopPropagation();\n setShowPassword(!showPassword);\n };\n\n const handleInputChange = (e) => {\n const { name, value } = e.target;\n setErrors({ name: \"\", username: \"\", password: \"\", email: \"\" });\n if (name === \"studentName\") setStudentName(value);\n if (name === \"studentEmail\") setStudentEmail(value);\n if (name === \"newUserName\") setNewUserName(value);\n if (name === \"password\") setPassword(value);\n };\n\n const clearFormAndErrors = () => {\n setStudentName(\"\");\n setStudentEmail(\"\");\n setNewUserName(\"\");\n setPassword(\"\");\n setErrors({\n name: \"\",\n username: \"\",\n password: \"\",\n email: \"\",\n });\n setError(false);\n setErrorData(\"\");\n };\n\n useEffect(() => {\n if (openEditForm) {\n setStudentName(userName);\n setStudentEmail(userEmail);\n setLoginMethod(userEmail ? \"email\" : \"username\");\n setPassword(stupassword);\n setNewUserName(studentid);\n } else {\n clearFormAndErrors();\n }\n }, [openEditForm, userName, userEmail, studentid, stupassword]);\n\n const validateForm = () => {\n const newErrors = {\n name: \"\",\n username: \"\",\n password: \"\",\n email: \"\",\n };\n let isValid = true;\n if (!studentName) {\n newErrors.name = \"Please enter a student name\";\n isValid = false;\n }\n if (loginMethod === \"email\") {\n if (!studentEmail) {\n newErrors.email = \"Please enter an email\";\n isValid = false;\n }\n } else {\n if (!newUserName) {\n newErrors.username = \"Please enter a username\";\n isValid = false;\n }\n if (!password) {\n newErrors.password = \"Please enter a password\";\n isValid = false;\n }\n }\n setErrors(newErrors);\n return isValid;\n };\n\n const submit = () => {\n if (validateForm()) {\n setError(false);\n if (openEditForm) {\n editStudent();\n } else {\n addStudent();\n }\n }\n };\n\n const editStudent = () => {\n const data = { name: studentName };\n if (password) {\n data.password = password;\n }\n return axios({\n url: `${process.env.REACT_APP_MERAKI_URL}/partners/${userId}/user`,\n method: METHODS.PUT,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: user.data.token,\n },\n data,\n })\n .then((data) => {\n if (data.data.error) {\n // Throw the full response data object\n throw data.data;\n }\n toast.success(`Student ${data.data.message}`, {\n position: toast.POSITION.BOTTOM_RIGHT,\n });\n setTriggerdGet((prev) => {\n return !prev;\n });\n clearFormAndErrors();\n setOpenEditForm(false);\n })\n .catch((e) => {\n if (e.erorrCode === 2001) {\n setErrors({ ...errors, name: e?.message });\n } else if (e.erorrCode === 2003) {\n setErrors({ ...errors, password: e?.message });\n } else {\n setErrorData(e?.message);\n setError(true);\n }\n });\n };\n\n const addStudent = () => {\n const url = `${process.env.REACT_APP_MERAKI_URL}/partners/addUser?partner_id=${partnerId}`;\n const headers = {\n \"Content-Type\": \"application/json\",\n Authorization: user.data.token,\n };\n const data =\n loginMethod === \"email\"\n ? { name: studentName, email: studentEmail }\n : { name: studentName, user_name: newUserName, password: password };\n return axios({\n url,\n method: METHODS.POST,\n headers,\n data,\n })\n .then((response) => {\n if (response.data.error) {\n // Throw the full response data object\n throw response.data;\n }\n toast.success(\"Student Added Successfully\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n });\n setTriggerdGet((prev) => {\n return !prev;\n });\n clearFormAndErrors();\n setOpenForm(false);\n })\n .catch((e) => {\n if (e.erorrCode === 2005) {\n setErrors({ ...errors, email: e?.message });\n } else if (e.erorrCode === 2001) {\n setErrors({ ...errors, name: e?.message });\n } else if (e.erorrCode === 2003) {\n setErrors({ ...errors, password: e?.message });\n } else {\n setErrorData(e?.message);\n setError(true);\n }\n });\n };\n\n return (\n <>\n setOpenForm(true)} className=\"add_student_btn\">\n Add Student\n \n {(openEditForm || openForm) && (\n \n
{\n setOpenForm(false);\n setOpenEditForm(false);\n clearFormAndErrors();\n }}\n >\n \n
\n
\n
\n {openEditForm ? \"Edit Student\" : \"Add New Student\"}\n \n {\n setOpenForm(false);\n setOpenEditForm(false);\n clearFormAndErrors();\n }}\n >\n X\n \n \n
\n \n \n \n\n \n \n Login Method\n \n \n setLoginMethod(e.target.value)}\n row\n disabled={openEditForm}\n >\n }\n label=\"Email\"\n disabled={openEditForm}\n />\n }\n label=\"Username and Password\"\n disabled={openEditForm}\n />\n \n \n \n\n {loginMethod === \"email\" ? (\n \n \n \n ) : (\n <>\n \n \n \n\n \n \n \n handlePasswordVisibility(e)}\n >\n {showPassword ? (\n \n ) : (\n \n )}\n \n
\n \n ),\n }}\n />\n \n >\n )}\n\n {error && (\n \n \n {errorData}\n \n \n )}\n\n \n \n {openEditForm ? \"Update Student Details\" : \"Add Student\"}\n \n \n \n
\n
\n \n
\n )}\n >\n );\n}\n\nexport default AddStudent;\n\nfunction useOutsideAlerter(ref, handleClick) {\n useEffect(() => {\n function handleClickOutside(event) {\n if (ref.current && !ref.current.contains(event.target)) {\n handleClick(event);\n }\n }\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [ref, handleClick]);\n}\n\nfunction OutsideAlerter({ children, handleClick }) {\n const wrapperRef = useRef(null);\n useOutsideAlerter(wrapperRef, handleClick);\n return (\n \n {children}\n
\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport axios from \"axios\";\nimport { useSelector } from \"react-redux\";\n// import { BsArrowUpDown } from \"react-icons/bs\";\nimport { BsArrowDownUp } from 'react-icons/bs';\nimport { PATHS } from \"../../../constant.js\";\n// import AccessTimeIcon from \"@mui/icons-material/AccessTime\";\nimport { METHODS } from \"../../../services/api.js\";\nimport { useDebounce } from \"use-debounce\";\nimport ReactPaginate from \"react-paginate\";\nimport moment from \"moment\";\nimport { Link } from \"react-router-dom\";\n// import Slider from \"rc-slider\";\nimport \"rc-slider/assets/index.css\";\nimport \"./styles.scss\";\nimport { Redirect } from \"react-router-dom\";\nimport AddStudent from \"../../../pages/AddStudent/index.js\";\nimport { toast } from \"react-toastify\";\nimport { hasOneFrom } from \"../../../common/utils\";\nimport {\n Box,\n Button,\n Grid,\n Container,\n Typography,\n CardContent,\n Card,\n} from \"@mui/material\";\nimport { Stack, Dialog, DialogTitle, DialogActions } from \"@mui/material\";\nimport { useHistory } from 'react-router-dom';\n\n\n// const { createSliderWithTooltip } = Slider;\n// const Range = createSliderWithTooltip(Slider.Range);\n\nconst getPartnerIdFromUrl = () => {\n let partnerId;\n if (window.location.pathname.includes(\"partner\")) {\n partnerId = window.location.pathname.split(\"/\").pop();\n }\n return partnerId;\n};\n\nfunction StudentData() {\n const [pageNumber, setPageNumber] = useState(0);\n const [totalCount, setTotalCount] = useState();\n const [message, setMessage] = useState(\"\");\n const [students, setStudents] = useState([]);\n const [slicedStudents, setSlicedStudents] = useState([]);\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [sortMethod, setSortMethod] = useState(\"dsc\");\n const [sort_class, setSortClass] = useState(\"sorter\");\n // const [filterVal, setFilterVal] = useState([0, 0]);\n // const [filteredData, setFilteredData] = useState(false);\n const [debouncedText] = useDebounce(searchTerm, 400);\n const user = useSelector(({ User }) => User);\n const [openEditForm, setOpenEditForm] = useState(false);\n const [userId, setUserId] = useState();\n const [partnerName, setpartnerName] = useState();\n const [userName, setUserName] = useState();\n // const [isDisabled, setDisabled] = useState(true);\n const [studentid, setstudentId] = useState();\n const [stupassword, setStupassword] = useState();\n const [studentEmail, setStudentEmail] = useState();\n // const [csvUpdatedTime, setCSVUpdatedTime] = useState([]);\n const [showModal, setShowModal] = useState(false);\n const [selectedStudentId, setSelectedStudentId] = useState(null);\n const history = useHistory();\n\n const handleNavigation = () => {\n history.push('/report'); // Replace with your desired path\n };\n const [triggerdGet, setTriggerdGet] = useState(false);\n const loginUser = user.data.user.id;\n\n // Fetching the csv updated time\n\n // useEffect(() => {\n // axios({\n // method: METHODS.GET,\n // url: `${process.env.REACT_APP_MERAKI_URL}/tcb/csv/read-date-csv`,\n // headers: { accept: \"application/json\", Authorization: user.data.token },\n // })\n // .then((response) => {\n // setCSVUpdatedTime(response.data);\n // })\n // .catch((err) => {\n // console.log(err);\n // });\n // }, []);\n\n const limit = 10;\n let id = getPartnerIdFromUrl();\n\n const fetchAPI = () =>\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/partners/${id}/users${searchTerm.length > 0 ? `?name=${searchTerm}` : \"\"\n }`,\n headers: { accept: \"application/json\", Authorization: user.data.token },\n })\n .then((res) => {\n setpartnerName(res.data.partner_name);\n if (\n id === user.data.user.partner_id ||\n hasOneFrom(user.data.user.rolesList, [\n \"admin\",\n \"partner_view\",\n \"partner_edit\",\n \"partner\",\n ])\n ) {\n if (\n !Array.isArray(res.data.students) ||\n res.data.students.length === 0\n ) {\n // if (res.data.students && res?.data?.students.length < 1) {\n setMessage(\"There are no results to display\");\n setSlicedStudents([]);\n } else {\n const data = res.data.students\n .map((item) => {\n if (item.classes_registered.length > 0) {\n item.averageRating = 0;\n let avg = 0;\n let count = 0;\n item.classes_registered.map((f) => {\n if (f.feedback.feedback) {\n avg = avg + parseInt(f.feedback.feedback);\n count += 1;\n }\n });\n if (avg > 0) item.averageRating = avg / count;\n else item.averageRating = avg;\n item.classes_registered = item.classes_registered.sort(\n (c1, c2) => {\n return new Date(c1.start_time) - new Date(c2.start_time);\n }\n );\n }\n return {\n ...item,\n // not overwriting original created_at because we need the date object to sort by date\n formatted_created_at: moment(item.created_at).format(\n \"DD-MM-YYYY\"\n ),\n // formatted_created_at: moment(\n // // item.created_at.replace(\"Z\")\n // ).format(\"DD-MM-YYYY\"),\n classes_registered: item.classes_registered.map((item) => {\n return {\n ...item,\n formatted_start_time: moment(\n item.start_time.replace(\"Z\", \"\")\n ).format(\"DD-MM-YYYY\"),\n /**\n * REVIEW\n * Why item is there again in the next line?\n */\n item,\n formatted_end_time: moment(\n item.end_time.replace(\"Z\", \"\")\n ).format(\"hh:mm a\"),\n };\n }),\n };\n })\n .sort((a, b) => {\n return a.name.localeCompare(b.name);\n });\n setStudents(data);\n setSlicedStudents(\n data.slice(pageNumber * limit, (pageNumber + 1) * limit)\n );\n setTotalCount(data.length);\n setpartnerName(res.data.partner_name);\n }\n }\n })\n .catch((err) => { });\n\n useEffect(() => {\n fetchAPI();\n }, [debouncedText]);\n\n useEffect(() => {\n if (triggerdGet) {\n fetchAPI();\n setTriggerdGet(false);\n }\n }, [triggerdGet]);\n\n useEffect(() => {\n setSlicedStudents(\n students.slice(pageNumber * limit, (pageNumber + 1) * limit)\n );\n }, [pageNumber, students]);\n\n const pageCount = Math.ceil(totalCount / limit);\n\n const changePage = ({ selected }) => {\n setPageNumber(selected);\n const newSlicedStudents = students.slice(\n selected * limit,\n (selected + 1) * limit\n );\n setSlicedStudents(newSlicedStudents);\n };\n\n // todays date in the formate like 4 june 2024\n const today = new Date();\n const options = {\n weekday: \"long\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n };\n const formattedDate = today.toLocaleDateString(\"en-US\", options);\n\n const sortStudents = (byMethod) => {\n const student = students;\n let sortedStudents;\n if (byMethod === \"name\") {\n sortedStudents = student.sort().reverse();\n } else if (byMethod === \"gmail_studentId\") {\n sortedStudents = student.sort().reverse();\n }\n\n // else if (byMethod === \"enroll_date\") {\n // sortedStudents = student.sort((a, b) =>\n // sortMethod === \"asc\"\n // ? new Date(a.created_at) - new Date(b.created_at)\n // : new Date(b.created_at) - new Date(a.created_at)\n // );\n // } else if (byMethod === \"total_classes\") {\n // sortedStudents = student.sort((a, b) =>\n // sortMethod === \"asc\"\n // ? a.classes_registered.length - b.classes_registered.length\n // : b.classes_registered.length - a.classes_registered.length\n // );\n // }\n else if (byMethod === \"last_class_title\") {\n const zeroClass = student.filter((a) => {\n return a.classes_registered.length <= 0;\n });\n sortedStudents = student\n .filter((a) => {\n return a.classes_registered.length > 0;\n })\n .sort((a, b) => {\n return sortMethod === \"asc\"\n ? a.classes_registered[\n a.classes_registered.length - 1\n ].title.localeCompare(\n b.classes_registered[b.classes_registered.length - 1].title\n )\n : b.classes_registered[\n b.classes_registered.length - 1\n ].title.localeCompare(\n a.classes_registered[a.classes_registered.length - 1].title\n );\n });\n sortedStudents = [...sortedStudents, ...zeroClass];\n }\n\n // else if (byMethod === \"last_class_date\") {\n // const zeroClass = students.filter((a) => {\n // return a.classes_registered.length <= 0;\n // });\n // sortedStudents = student\n // .filter((a) => {\n // if (a.classes_registered.length > 0) {\n // a.classes_registered = a.classes_registered.sort((c1, c2) => {\n // return new Date(c1.start_time) - new Date(c2.start_time);\n // });\n // return a;\n // }\n // })\n // .sort((a, b) => {\n // const startTimeOfA = [];\n // const startTimeOfB = [];\n // a.classes_registered.forEach((c) =>\n // startTimeOfA.push(new Date(c.start_time))\n // );\n // b.classes_registered.forEach((c) =>\n // startTimeOfB.push(new Date(c.start_time))\n // );\n // return sortMethod === \"asc\"\n // ? Math.max(...startTimeOfA) - Math.max(...startTimeOfB)\n // : Math.max(...startTimeOfB) - Math.max(...startTimeOfA);\n // });\n // sortedStudents = [...sortedStudents, ...zeroClass];\n // }\n\n // else if (byMethod === \"rating\") {\n // const zeroClass = student.filter((a) => {\n // return a.classes_registered.length <= 0;\n // });\n // sortedStudents = student.sort((a, b) => {\n // return sortMethod === \"asc\"\n // ? a.averageRating - b.averageRating\n // : b.averageRating - a.averageRating;\n // });\n // sortedStudents = [...sortedStudents, ...zeroClass];\n // }\n setStudents(sortedStudents);\n setSlicedStudents(\n sortedStudents.slice(pageNumber * limit, (pageNumber + 1) * limit)\n );\n if (sortMethod === \"asc\") {\n setSortClass(\"sorter\");\n setSortMethod(\"dsc\");\n } else {\n setSortClass(\"sorter turn\");\n setSortMethod(\"asc\");\n }\n };\n\n // const handleChange = (value) => {\n // setFilteredData(true);\n // setFilterVal(value);\n // setDisabled(false);\n // };\n\n const handleClickOpen = (id) => {\n setSelectedStudentId(id);\n setShowModal(true);\n };\n\n const handleClose = () => {\n setShowModal(false);\n setSelectedStudentId(null);\n };\n\n const removeStudent = (id) => {\n setShowModal(!showModal);\n return axios({\n url: `${process.env.REACT_APP_MERAKI_URL}/partners/${id}/user`,\n method: METHODS.DELETE,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((data) => {\n if (data.data.error) throw new Error(data.data.message);\n toast.success(\"Student deleted successfully!\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n });\n window.location.reload(1);\n })\n .catch((e) => {\n toast.error(`Student couldn't be deleted!: ${e.message}`, {\n position: toast.POSITION.BOTTOM_RIGHT,\n });\n });\n };\n\n // let filter = [];\n // students.filter((item) => {\n // if (filterVal[0] === 0) {\n // if (item.classes_registered.length === 0) {\n // filter.push(item);\n // }\n // } else if (filterVal[0] === 30) {\n // if (item.classes_registered.length >= 30) {\n // filter.push(item);\n // }\n // } else {\n // const range = (min, max) =>\n // Array.from({ length: max - min + 1 }, (_, i) => min + i);\n // range(filterVal[0], filterVal[1]).map((range) => {\n // if (item.classes_registered.length === range) {\n // filter.push(item);\n // }\n // });\n // }\n // });\n\n // useEffect(() => {\n // if (filteredData) {\n // const slicedData = filter.slice(\n // pageNumber * limit,\n // (pageNumber + 1) * limit\n // );\n // setSlicedStudents(slicedData);\n // } else {\n // const slicedData = students.slice(\n // pageNumber * limit,\n // (pageNumber + 1) * limit\n // );\n // setSlicedStudents(slicedData);\n // }\n // }, [pageNumber, filterVal]);\n\n if (\n hasOneFrom(user.data.user.rolesList, [\n \"admin\",\n \"partner_view\",\n \"partner_edit\",\n \"partner\",\n ]) ||\n user.data.user.partner_id == id\n ) {\n // writing a function which calls the get api while clicking on the download report button\n\n const downloadReport = (url) => {\n axios({\n method: METHODS.GET,\n url: url,\n headers: { accept: \"application/json\", Authorization: user.data.token },\n responseType: \"blob\",\n })\n .then((res) => {\n const url = window.URL.createObjectURL(new Blob([res.data]));\n const link = document.createElement(\"a\");\n link.href = url;\n link.setAttribute(\"download\", \"report.csv\");\n document.body.appendChild(link);\n link.click();\n })\n .catch((err) => {\n console.log(err);\n });\n };\n\n // Usage:\n // For the first API ,student Progress Report\n // const studentReport1 = () => {\n // const reportUrl = `${process.env.REACT_APP_MERAKI_URL}/tcb/csv/progress/roport`;\n // downloadReport(reportUrl);\n // };\n // For the second API ,student Progress Report(_last 7 days)\n\n // const studentReport2 = () => {\n // const reportUrl = `${process.env.REACT_APP_MERAKI_URL}/tcb/csv/last-week/login-report`;\n // downloadReport(reportUrl);\n // };\n\n\n\n return id == 1359 ? (\n <>\n {/* \n {partnerName} \n \n */}\n \n
{partnerName} \n
\n MCDigital Course-2.0\n \n
\n
\n {\n setSearchTerm(e.target.value);\n setMessage(\"\");\n }}\n />\n
\n
\n }\n nextLabel={ }\n initialPage={0}\n marginPagesDisplayed={0}\n onPageChange={changePage}\n pageCount={pageCount}\n containerClassName=\"paginationBttns\"\n previousLinkClassName=\"previousBttn\"\n nextLinkClassName=\"nextBttn\"\n disabledClassName=\"paginationDisabled\"\n activeClassName=\"paginationActive\"\n />\n
\n
\n
\n \n \n \n Students Name\n sortStudents(\"name\")}\n >\n \n \n \n \n Gmail or Meraki Student ID\n sortStudents(\"gmail_studentId\")}\n >\n \n \n \n \n Latest Attended Class\n sortStudents(\"last_class_title\")}\n >\n \n \n \n \n \n \n {slicedStudents.map((item) => {\n let getStars = 0;\n {\n /* let totalStarts = item.classes_registered.length * 5; */\n }\n item.classes_registered.map((stars) => {\n getStars = getStars + Number(stars.feedback.feedback);\n });\n return (\n \n \n \n {item.name}\n \n \n \n \n {item.email ? item.email : item.user_name}\n \n \n {/* \n {item.formatted_created_at}\n */}\n\n {/* \n {\" \"}\n {item.classes_registered.length}\n */}\n\n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[item.classes_registered.length - 1][\n \"title\"\n ] != \"\"\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"title\"]\n : \"NA\"}\n \n\n {/* \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[item.classes_registered.length - 1][\n \"formatted_start_time\"\n ]\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_start_time\"]\n : \"NA\"}\n \n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[item.classes_registered.length - 1][\n \"formatted_end_time\"\n ]\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_end_time\"]\n : \"NA\"}\n \n \n {[1, 2, 3, 4, 5].map((star) => {\n return Math.ceil(item.averageRating) > 0 &&\n star <= Math.ceil(item.averageRating) ? (\n \n ) : (\n \n );\n })}\n */}\n {((hasOneFrom(user.data.user.rolesList, [\n \"partner_edit\",\n \"partner\",\n ]) &&\n user.data.user.partner_id == id) ||\n hasOneFrom(user.data.user.rolesList, [\"admin\"])) && (\n \n {\n setOpenEditForm(true);\n setUserId(item.id);\n setUserName(item.name);\n setStudentEmail(item.email);\n setStupassword(item.password);\n setstudentId(item.user_name);\n }}\n />\n {loginUser == item.id ? null : (\n <>\n handleClickOpen(item.id)}\n />\n {/* dialog box for delete button */}\n\n \n \n \n Are you sure you want to delete this student?\n \n \n \n \n \n {\n e.stopPropagation();\n return removeStudent(selectedStudentId); // Ensure this function gets the correct student ID\n }}\n color=\"error\"\n variant=\"contained\"\n sx={{ mr: \"15px\", width: \"100px\" }}\n >\n Yes\n \n \n No\n \n \n \n \n \n >\n )}\n \n )}\n \n );\n })}\n {message ? {message} : null}\n \n
\n
\n
\n Generate Report\n \n
\n {/* {showReportOptions && (\n \n
\n \n \n \n \n All Time Student Progress Report\n \n \n \n Last updated on {csvUpdatedTime.allUsersDetailUpdatedOn} at{\" \"}\n {csvUpdatedTime.at}\n \n \n The report contains student progress since the start of the\n programme until the present day\n \n \n Download Report\n \n \n \n \n \n \n \n \n Seven Days Student Progress Report\n \n \n \n Last updated on{\" \"}\n {csvUpdatedTime.lastWeekUsersLoginDetailsUpdatedOn} at{\" \"}\n {csvUpdatedTime.at}\n \n \n The report contains student progress from the last 7 days\n until the present day\n \n \n Download Report\n \n \n \n \n \n
\n )} */}\n >\n ) : (\n \n
{partnerName} \n
\n
\n {\n setSearchTerm(e.target.value);\n setMessage(\"\");\n }}\n />\n
\n
\n }\n nextLabel={ }\n initialPage={0}\n marginPagesDisplayed={0}\n onPageChange={changePage}\n pageCount={pageCount}\n containerClassName=\"paginationBttns\"\n previousLinkClassName=\"previousBttn\"\n nextLinkClassName=\"nextBttn\"\n disabledClassName=\"paginationDisabled\"\n activeClassName=\"paginationActive\"\n />\n
\n
\n {/*
\n
Total attended classes \n
\n (value === 40 ? (value = \"30+\") : value)}\n value={filterVal}\n onChange={handleChange}\n marks={{\n 0: 0,\n 1: 1,\n 6: 6,\n 10: 10,\n 15: 15,\n 20: 20,\n 25: 25,\n 30: 30,\n 40: `${30}+`,\n }}\n />\n
\n
{\n setFilteredData(false);\n setFilterVal([0, 0]);\n setDisabled(true);\n }}\n className=\"filter-clear\"\n >\n clear\n \n
*/}\n
\n \n \n \n Students Name\n sortStudents(\"name\")}\n >\n \n \n \n {/* \n Enroll date\n sortStudents(\"enroll_date\")}\n >\n \n \n */}\n {/* \n Classes Enrolled to\n sortStudents(\"total_classes\")}\n >\n \n \n */}\n\n \n Gmail or Meraki Student ID\n sortStudents(\"gmail_studentId\")}\n >\n \n \n \n \n Latest Attended Class\n sortStudents(\"last_class_title\")}\n >\n \n \n \n {/* \n Last Class Date\n sortStudents(\"last_class_date\")}\n >\n \n \n \n Last Class Time \n \n Average Rating\n sortStudents(\"rating\")}\n >\n \n \n */}\n \n \n \n {/* {filteredData\n ? slicedStudents.map((item) => {\n let getStars = 0;\n let totalStarts = item.classes_registered.length * 5;\n item.classes_registered.map((stars) => {\n getStars = getStars + Number(stars.feedback.feedback);\n });\n return (\n \n \n \n {item.name}\n \n \n \n {\" \"}\n {item.classes_registered.length}\n \n\n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[\n item.classes_registered.length - 1\n ][\"title\"] != \"\"\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"title\"]\n : \"NA\"}\n \n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_start_time\"]\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_start_time\"]\n : \"NA\"}\n \n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_end_time\"]\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_end_time\"]\n : \"NA\"}\n \n \n {[1, 2, 3, 4, 5].map((star) => {\n return Math.ceil(item.averageRating) > 0 &&\n star <= Math.ceil(item.averageRating) ? (\n \n ) : (\n \n );\n })}\n \n \n );\n }) */}\n {slicedStudents.map((item) => {\n let getStars = 0;\n {\n /* let totalStarts = item.classes_registered.length * 5; */\n }\n item.classes_registered.map((stars) => {\n getStars = getStars + Number(stars.feedback.feedback);\n });\n return (\n \n \n \n {item.name}\n \n \n \n \n {item.email ? item.email : item.user_name}\n \n \n {/* \n {item.formatted_created_at}\n */}\n\n {/* \n {\" \"}\n {item.classes_registered.length}\n */}\n\n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[item.classes_registered.length - 1][\n \"title\"\n ] != \"\"\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"title\"]\n : \"NA\"}\n \n\n {/* \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[item.classes_registered.length - 1][\n \"formatted_start_time\"\n ]\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_start_time\"]\n : \"NA\"}\n \n \n {item.classes_registered &&\n item.classes_registered.length > 0 &&\n item.classes_registered[item.classes_registered.length - 1][\n \"formatted_end_time\"\n ]\n ? item.classes_registered[\n item.classes_registered.length - 1\n ][\"formatted_end_time\"]\n : \"NA\"}\n \n \n {[1, 2, 3, 4, 5].map((star) => {\n return Math.ceil(item.averageRating) > 0 &&\n star <= Math.ceil(item.averageRating) ? (\n \n ) : (\n \n );\n })}\n */}\n {((hasOneFrom(user.data.user.rolesList, [\n \"partner_edit\",\n \"partner\",\n ]) &&\n user.data.user.partner_id == id) ||\n hasOneFrom(user.data.user.rolesList, [\"admin\"])) && (\n \n {\n setOpenEditForm(true);\n setUserId(item.id);\n setUserName(item.name);\n setStudentEmail(item.email);\n setStupassword(item.password);\n setstudentId(item.user_name);\n }}\n />\n {loginUser == item.id ? null : (\n <>\n handleClickOpen(item.id)}\n />\n {/* dialog box for delete button */}\n\n \n \n \n Are you sure you want to delete this student?\n \n \n \n \n \n {\n e.stopPropagation();\n return removeStudent(selectedStudentId); // Ensure this function gets the correct student ID\n }}\n color=\"error\"\n variant=\"contained\"\n sx={{ mr: \"15px\", width: \"100px\" }}\n >\n Yes\n \n \n No\n \n \n \n \n \n >\n )}\n \n )}\n \n );\n })}\n {message ? {message} : null}\n \n
\n\n
\n
\n );\n }\n return ;\n}\n\nexport default StudentData;\n","import React, { useEffect, useState } from \"react\";\nimport \"./styles.scss\";\nimport { useDebounce } from \"use-debounce\";\nimport ReactPaginate from \"react-paginate\";\n// import { BsArrowUpDown } from \"react-icons/bs\";\nimport { BsArrowDownUp } from 'react-icons/bs';\n\n\n\nfunction StudentClassData(props) {\n const [pageNumber, setPageNumber] = useState(0);\n const [classes, setClasses] = useState([]);\n const [slicedClasses, setSlicedClasses] = useState([]);\n const [sortMethod, setSortMethod] = useState(\"dsc\");\n const [sort_class, setSortClass] = useState(\"sorter\");\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [debouncedText] = useDebounce(searchTerm);\n const [totalCount, setTotalCount] = useState(\n props.location.state.pass.length\n );\n\n const limit = 10;\n\n const pageCount = Math.ceil(totalCount / limit);\n const changePage = ({ selected }) => {\n setPageNumber(selected);\n };\n\n useEffect(() => {\n const data = props.location.state.pass.filter((searchValue) => {\n if (searchTerm == \"\") {\n return searchValue;\n } else if (\n searchValue.title.toLowerCase().includes(searchTerm.toLowerCase())\n ) {\n return searchValue;\n }\n });\n setTotalCount(data.length);\n const slicedData = data.slice(pageNumber * limit, (pageNumber + 1) * limit);\n setClasses(data);\n setSlicedClasses(slicedData);\n }, [debouncedText, pageNumber]);\n\n const languageMap = {\n hi: \"Hindi\",\n te: \"Telugu\",\n en: \"English\",\n ta: \"Tamil\",\n };\n\n const sortClasses = (byMethod) => {\n let sortedClasses;\n if (byMethod === \"title\") {\n sortedClasses = classes.sort((a, b) =>\n sortMethod === \"asc\"\n ? a.title.localeCompare(b.title)\n : b.title.localeCompare(a.title)\n );\n } else if (byMethod === \"id\") {\n sortedClasses = classes.sort((a, b) =>\n sortMethod === \"asc\" ? a.id - b.id : b.id - a.id\n );\n } else if (byMethod === \"facilitator\") {\n sortedClasses = classes.sort((a, b) =>\n sortMethod === \"asc\"\n ? a.facilitator_name.localeCompare(b.facilitator_name)\n : b.facilitator_name.localeCompare(a.facilitator_name)\n );\n } else if (byMethod === \"date\") {\n sortedClasses = classes.sort((a, b) => {\n return sortMethod === \"asc\"\n ? new Date(a.start_time) - new Date(b.start_time)\n : new Date(b.start_time) - new Date(a.start_time);\n });\n } else if (byMethod === \"rating\") {\n const nullFeedback = classes.filter((c) => c.feedback.feedback === null);\n sortedClasses = classes\n .filter((c) => c.feedback.feedback)\n .sort((a, b) =>\n sortMethod === \"asc\"\n ? parseInt(a.feedback.feedback) - parseInt(b.feedback.feedback)\n : parseInt(b.feedback.feedback) - parseInt(a.feedback.feedback)\n );\n sortedClasses = [...sortedClasses, ...nullFeedback];\n }\n\n setClasses(sortedClasses);\n setSlicedClasses(\n sortedClasses.slice(pageNumber * limit, (pageNumber + 1) * limit)\n );\n if (sortMethod === \"asc\") {\n setSortClass(\"sorter\");\n setSortMethod(\"dsc\");\n } else {\n setSortClass(\"sorter turn\");\n setSortMethod(\"asc\");\n }\n };\n\n return (\n \n
\n {\" \"}\n Total Classes by {props.location.state.passName} :{\" \"}\n {props.location.state.pass.length}\n
\n
{props.location.state.passEmail} \n
\n
\n {\n setSearchTerm(e.target.value);\n }}\n />\n
\n
\n }\n nextLabel={ }\n initialPage={0}\n marginPagesDisplayed={0}\n pageCount={pageCount}\n onPageChange={changePage}\n containerClassName=\"paginationBttns\"\n previousLinkClassName=\"previousBttn\"\n nextLinkClassName=\"nextBttn\"\n disabledClassName=\"paginationDisabled\"\n activeClassName=\"paginationActive\"\n />\n
\n
\n\n
\n \n \n \n Class Title\n sortClasses(\"title\")}\n >\n \n \n \n \n Class Id\n sortClasses(\"id\")}>\n \n \n \n \n Facilitator\n sortClasses(\"facilitator\")}\n >\n \n \n \n Language \n \n Class Date\n sortClasses(\"date\")}\n >\n \n \n \n \n Class Rating\n sortClasses(\"rating\")}\n >\n \n \n \n \n \n \n {classes && classes.length > 0 ? (\n slicedClasses.map((item) => {\n return (\n \n {item.title} \n {item.id} \n {item.facilitator_name} \n {languageMap[item.lang]} \n {item.formatted_start_time} \n \n {[1, 2, 3, 4, 5].map((star) => {\n return item.feedback.feedback > 0 &&\n star <= item.feedback.feedback ? (\n \n ) : (\n \n );\n })}\n \n \n );\n })\n ) : (\n \n
There are no results to display... \n \n )}\n \n
\n
\n );\n}\n\nexport default StudentClassData;\n","import { makeStyles } from \"@material-ui/styles\";\nconst useStyles = makeStyles(() => ({\n profileBox: {\n // transform: \"translateY(-50px)\",\n },\n imageContainer: {\n width: \"100%\",\n justifyContent: \"left\",\n alignItems: \"left\",\n },\n\n bgImage: {\n width: \"100%\",\n objectFit: \"cover\",\n height: \"290px\",\n backgroundColor: \"pink\",\n },\n Right_tick: {\n marginLeft: \"8px\",\n verticalAlign: \"baseline\",\n },\n dialog: {\n padding: \"40px\",\n },\n}));\nexport default useStyles;\n","import * as React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Dialog from \"@mui/material/Dialog\";\nimport DialogActions from \"@mui/material/DialogActions\";\nimport DialogContent from \"@mui/material/DialogContent\";\nimport { CircularProgress, Box, Typography } from \"@mui/material\";\nimport axios from \"axios\";\nimport { useSelector } from \"react-redux\";\nimport { toast } from \"react-toastify\";\n\nexport default function DropOut(props) {\n const { open, close, title, id, unregister_all, setIsEnrolled } = props;\n const [loading, setLoading] = React.useState(false);\n const user = useSelector(({ User }) => User);\n\n const handelDropOut = (Id) => {\n setLoading(true);\n axios\n .delete(\n `${\n process.env.REACT_APP_MERAKI_URL\n }/classes/${Id}/unregister?unregister-all=${unregister_all || false}`,\n {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: user.data.token,\n },\n }\n )\n .then(() => {\n toast.success(\"Class Dropped\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n autoClose: 2500,\n });\n setLoading(false);\n close();\n if (setIsEnrolled) {\n setIsEnrolled(false);\n }\n })\n .catch((err) => {\n toast.error(\"Failed To Drop Out of Class\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n autoClose: 2500,\n });\n close();\n });\n };\n return (\n \n \n \n \n Confirm dropping out of the batch\n \n \n If you have missed some classes, you can take revision classes\n without dropping off\n \n \n \n {\n handelDropOut(id);\n }}\n color=\"error\"\n >\n {loading ? : \"Drop Out\"}\n \n \n Stay Enrolled\n \n \n \n \n );\n}\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n cardDrop: {\n margin: \"20px\",\n minWidth: \"300px\",\n cursor: \"pointer\",\n },\n cardContent: {\n height: \"145px\",\n },\n cardChip: {\n height: \"10px\",\n margin: \"12px 0px\",\n borderRadius: \"10px\",\n },\n cardImg: {\n display: \"flex\",\n },\n dropbatchDiv: {\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n alignItems: \"center\",\n },\n link: {\n textDecoration: \"none\",\n color: \"black\",\n },\n}));\nexport default useStyles;\n","import {\n Chip,\n Typography,\n Grid,\n Card,\n CardContent,\n CardActions,\n Button,\n} from \"@mui/material\";\nimport { PATHS, interpolatePath } from \"../../constant\";\nimport axios from \"axios\";\nimport { format } from \"../../common/date\";\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { METHODS } from \"../../services/api\";\nimport DropOut from \"../BatchClassComponents/DropOut\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../theme/constant\";\nimport useStyles from \"./styles\";\nimport { Link } from \"react-router-dom\";\n\nfunction DropOutIndividualComponent(props) {\n const classes = useStyles();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n const { title, id, pathway_name, open, setOpen, start_time, end_time } =\n props;\n const close = () => {\n setOpen(false);\n };\n\n return (\n <>\n \n \n \n \n \n {title}\n \n \n {/* */}\n \n From {format(start_time, \"dd MMM yy\")} -{\" \"}\n {format(end_time, \"dd MMM yy\")}\n \n \n \n \n \n {\n setOpen(true);\n }}\n color=\"error\"\n >\n Drop Out\n \n \n \n \n >\n );\n}\n\nfunction DropOutBatchesProfile() {\n const [dropOutBatches, setDropOutBatches] = useState(null);\n const [open, setOpen] = useState(false);\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n const user = useSelector(({ User }) => User);\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/users/EnrolledBatches`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n if (res?.data?.length > 0) {\n setDropOutBatches(res.data);\n } else {\n setDropOutBatches(null);\n }\n })\n .catch((err) => {});\n }, [open]);\n\n // if (dropOutBatches !== null) {\n // dropOutBatches.map((item) => {console.log(item.pathway_id)})\n // }\n\n return (\n \n
\n {dropOutBatches && (\n \n Enrolled Batches\n \n )}\n \n {dropOutBatches?.map((dropOutBatch, index) => {\n return (\n \n \n \n );\n })}\n \n
\n
\n );\n}\n\nexport default DropOutBatchesProfile;\n","import React from \"react\";\nimport { useEffect, useState } from \"react\";\nimport {\n Typography,\n Container,\n CardContent,\n Button,\n Box,\n Modal,\n} from \"@mui/material\";\nimport { Card, Grid } from \"@mui/material\";\nimport DownloadIcon from \"@mui/icons-material/Download\";\nimport CheckCircleIcon from \"@mui/icons-material/CheckCircle\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../services/api\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { useParams } from \"react-router-dom\";\n// import { actions as enrolledBatchesActions } from \"../../components/PathwayCourse/redux/action\";\nimport { PATHS, versionCode } from \"../../constant\";\nimport { Link } from \"react-router-dom\";\nimport useStyles from \"./styles\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../theme/constant\";\n\nfunction saveFile(url) {\n // Get file name from url.\n var filename = url.substring(url.lastIndexOf(\"/\") + 1).split(\"?\")[0];\n var xhr = new XMLHttpRequest();\n xhr.responseType = \"blob\";\n xhr.onload = function () {\n let a = document.createElement(\"a\");\n a.href = window.URL.createObjectURL(xhr.response); // xhr.response is a blob\n a.download = filename; // Set the file name.\n a.style.display = \"none\";\n document.body.appendChild(a);\n a.click();\n };\n xhr.open(\"GET\", url);\n xhr.send();\n}\n\nfunction CertificateCard({ item, courseTime, completedPortion }) {\n const user = useSelector(({ User }) => User);\n\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const [openModal, setOpenModal] = useState(false);\n const [certificate, setCertificate] = useState(\"\");\n const [loader, setLoader] = useState(false);\n const pathwayId = item.id;\n\n const date = new Date(courseTime);\n const options = { day: \"numeric\", month: \"short\", year: \"2-digit\" };\n const formattedDate = date.toLocaleDateString(\"en-US\", options);\n\n // useEffect(() => {\n // dispatch(pathwayActions.getPathwaysCourse({ pathwayId: pathwayId }));\n // }, [dispatch, pathwayId]);\n const modalStyle = {\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"544px\",\n bgcolor: \"background.paper\",\n outline: \"none\",\n borderRadius: \"8px\",\n boxShadow: 24,\n p: 4,\n };\n // useEffect(() => {\n // dispatch(pathwayActions.getPathwaysCourse({ pathwayId: pathwayId }));\n // }, [dispatch, pathwayId]);\n\n const completedAll = completedPortion == 100;\n\n useEffect(() => {\n if (completedAll) {\n axios({\n method: METHODS.POST,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/${pathwayId}/complete`,\n headers: {\n \"version-code\": versionCode,\n accept: \"application/json\",\n Authorization: user.data?.token || \"\",\n },\n data: {\n pathwayId: pathwayId,\n },\n });\n }\n });\n\n const handleModal = () => {\n setLoader(true);\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/certificate`,\n headers: {\n accept: \"application/json\",\n Authorization: user?.data?.token,\n },\n })\n .then((response) => {\n setLoader(false);\n setOpenModal((prev) => !prev);\n setCertificate(response?.data?.url);\n })\n .catch((err) => {});\n };\n\n const downloadCert = () => {\n saveFile(certificate);\n };\n return (\n \n \n \n {`${item?.name} Certificate`} \n \n \n {/* */}\n
\n {`Meraki certifies that you have diligently \n attended all classes and taken the practice questions.\n You have a good grasp of ${item?.name} fundamentals.`} \n \n {/* Share to Friends */}\n Get Certificate \n \n \n \n\n {completedAll ? (\n <>\n \n \n \n \n \n \n \n {item.name} \n \n \n \n {formattedDate} \n \n \n\n \n \n Download Certificate\n \n \n \n >\n ) : (\n <>\n \n Please complete one or more of the learning tracks in full to unlock\n your certificates.\n \n \n Go to Dashboard \n \n >\n )}\n \n );\n}\n\nexport default CertificateCard;\n","import React from \"react\";\nimport {\n Typography,\n Container,\n CardContent,\n Button,\n Box,\n Modal,\n} from \"@mui/material\";\n\nimport LockOutlinedIcon from \"@mui/icons-material/LockOutlined\";\nimport { interpolatePath, PATHS } from \"../../constant\";\nimport { Link } from \"react-router-dom\";\nimport LockOpenIcon from \"@mui/icons-material/LockOpen\";\nfunction UnlockOpportunities(props) {\n const { item, completedPortion } = props;\n\n const completedAll = completedPortion >= 100;\n\n // useEffect(() => {\n // dispatch(pathwayActions.getPathwaysCourse({ pathwayId: pathwayId }));\n // }, [dispatch, pathwayId]);\n\n return (\n \n {completedAll ? (\n <>\n \n Opportunities\n \n \n \n Get Coursera paid subscriptions, free keyboards and scholarships to\n bootcamps\n \n \n \n Explore Opportunities\n \n \n >\n ) : (\n <>\n \n Opportunities\n \n \n \n Unlock access to Coursera paid subscriptions, free keyboards and\n scholarships to bootcamps by completing the Python learning track.\n \n >\n )}\n \n );\n}\n\nexport default UnlockOpportunities;\n","import React, { useState, useEffect } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../services/api\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../theme/constant\";\nimport EditIcon from \"@mui/icons-material/Edit\";\nimport Dialog from \"@mui/material/Dialog\";\nimport DialogActions from \"@mui/material/DialogActions\";\nimport DialogContent from \"@mui/material/DialogContent\";\nimport DialogContentText from \"@mui/material/DialogContentText\";\nimport DialogTitle from \"@mui/material/DialogTitle\";\nimport MuiPhoneNumber from \"material-ui-phone-number\";\nimport { format } from \"../../common/date\";\nimport Avatar from \"react-avatar-edit\";\n\nimport {\n Grid,\n TextField,\n Typography,\n Button,\n Container,\n Box,\n FormControl,\n FormHelperText,\n Snackbar,\n} from \"@mui/material\";\nimport { actions } from \"../../components/User/redux/action\";\nimport useStyles from \"./styles\";\nimport DropOutBatchesProfile from \"../../components/DropOutBatches/DropOutBatchesProfile\";\nimport {\n getAuth,\n RecaptchaVerifier,\n signInWithPhoneNumber,\n} from \"firebase/auth\";\nimport { initializeApp } from \"firebase/app\";\nimport CertificateCard from \"./CertificateCard\";\nimport { useParams, useHistory } from \"react-router-dom\";\n\nimport UnlockOpportunities from \"./UnlockOpportunities\";\nimport LastLoginTime from \"./LastLoginTime/LastLoginTime\";\nimport { toast } from \"react-toastify\";\n\nconst firebaseConfig = {\n apiKey: process.env.REACT_APP_API_KEY,\n authDomain: process.env.REACT_APP_authDomain,\n projectId: process.env.REACT_APP_projectId,\n storageBucket: process.env.REACT_APP_storageBucket,\n messagingSenderId: process.env.REACT_APP_messagingSenderId,\n appId: process.env.REACT_APP_appId,\n};\n\nfunction Profile() {\n // console.log(format(new Date(), 'yyyy/MM/dd kk:mm:ss'))\n const params = useParams();\n const classes = useStyles();\n const user = useSelector(({ User }) => User);\n const date = user.data.user.last_login_at;\n\n const [completedPortion, setCompletedPortion] = useState({});\n const [courseTime, setCourseTime] = useState();\n\n // console.log(timeData,timehourData,min,loginMin,hour,loginHour)\n\n const [userData, setUserData] = useState([]);\n const [isEditing, setIsEditing] = useState(false);\n const [editName, setEditName] = useState(null);\n const [msg, setMsg] = useState();\n const [LoadBatches, setLoadBatches] = useState(false);\n const dispatch = useDispatch();\n const [helperText, setHelperText] = useState();\n const [showError, setShowError] = useState(true);\n const [open, setOpen] = React.useState(false);\n const [imgDialogs, setImgDialoags] = useState(false);\n const [imgCrop, setImgCrop] = useState(false);\n const [storeImg, setStoreImg] = useState([]);\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const [new_Profiles, setNew_Profiles] = useState(userData.profile_picture);\n const [countryCode, setCountryCode] = useState(\n `+${user?.data?.user?.contact?.split(\"-\")?.[0]}` || \"+91\"\n );\n const [contact, setContact] = useState(\n user?.data?.user?.contact?.split(\"-\")?.[1] || null\n );\n\n const [confirmationResult, setConfirmationResult] = React.useState(null);\n const [message, setMessage] = React.useState(\"\");\n const [startOtp, setStartOtp] = React.useState(false);\n\n const [otp, setOtp] = React.useState(\"\");\n const [snackBarOpen, setSnackBarOpen] = React.useState(false);\n\n const { loading, data } = useSelector((state) => state.PathwaysDropdow);\n\n const handleSnackBarClose = () => {\n setSnackBarOpen(false);\n setMessage(\"\");\n };\n const onCrop = (view) => {\n setImgCrop(view);\n };\n\n const onExit = () => {\n setImgCrop(null);\n };\n\n const saveImg = () => {\n setShowError(false);\n setStoreImg([...storeImg, { imgCrop }]);\n setImgDialoags(false);\n };\n\n const New_Profile = storeImg.map((item) => item.imgCrop);\n\n const handleClickOpen = () => {\n setIsEditing(true);\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n // OTP AUTH FUNCTION\n const app = initializeApp(firebaseConfig);\n const onSignInSubmit = (event) => {\n event.preventDefault();\n if (!confirmationResult) {\n setupRecaptcha();\n }\n const phoneNumber = `${countryCode}${contact}`;\n const appVerifier = window.recaptchaVerifier;\n const auth = getAuth();\n\n signInWithPhoneNumber(auth, phoneNumber, appVerifier)\n .then((result) => {\n setMessage(\"OTP sent successfully\");\n setSnackBarOpen(true);\n setStartOtp(true);\n setConfirmationResult(result);\n })\n .catch((error) => {\n console.log(error);\n setMessage(\"Enter valid phone number\");\n setOpen(true);\n });\n };\n const setupRecaptcha = () => {\n const auth = getAuth();\n window.recaptchaVerifier = new RecaptchaVerifier(\n \"recaptcha-container\",\n {\n size: \"invisible\",\n callback: (response) => {\n onSignInSubmit();\n },\n },\n auth\n );\n };\n useEffect(() => {}, [showError]);\n const OtpEnter = (event) => {\n confirmationResult\n .confirm(otp)\n .then((result) => {\n const user = result.user;\n if (!user.isAnonymous) {\n setShowError(false);\n setMessage(\"Phone number verified successfully\");\n setSnackBarOpen(true);\n }\n })\n .catch((error) => {\n setMessage(\"enter valid otp\");\n setOpen(true);\n setOtp(\"\");\n });\n };\n // OTP AUTH FUNCTION\n useEffect(() => {\n if (loading) {\n dispatch(actions.onUserRefreshDataIntent({ token: user.data.token }));\n }\n }, []);\n\n useEffect(() => {\n setUserData(user?.data?.user);\n });\n\n useEffect(() => {\n setEditName(userData?.name);\n }, [setEditName, userData]);\n\n useEffect(() => {\n if (editName == \"\") {\n setHelperText(\"Please enter your name\");\n setShowError(true);\n } else if (\n /[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,<>\\/?]+/.test(editName) ||\n /\\d/.test(editName)\n ) {\n setHelperText(\n \"Please use only capital or small letters. Numbers and symbols cannot be used in a name\"\n );\n setShowError(true);\n } else if (editName?.length > 25) {\n setHelperText(\"Name length should not be more than 25\");\n } else {\n setHelperText();\n }\n }, [editName]);\n\n const pathwayId = data?.pathways?.find((item) => item.code === \"PRGPYT\")?.id;\n\n useEffect(() => {\n if (user?.data?.token && pathwayId) {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/${pathwayId}/totalProgress`,\n headers: {\n accept: \"application/json\",\n Authorization: user?.data?.token,\n },\n })\n .then((response) => {\n setCompletedPortion(response.data.total_completed_portion);\n setCourseTime(response.data.complete_at);\n })\n .catch((err) => {});\n }\n }, [pathwayId]);\n\n const editProfile = () => {\n let payload = {\n name: editName,\n profile_picture: new_Profiles,\n };\n\n if (contact != null) {\n payload[\"contact\"] = `${countryCode.replace(\"+\", \"\")}-${contact}`;\n }\n\n setIsEditing(false);\n setMsg(true);\n axios({\n method: METHODS.PUT,\n url: `${process.env.REACT_APP_MERAKI_URL}/users/${user.data.user.id}`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n data: payload,\n })\n .then((res) => {\n dispatch(actions.onUserRefreshDataIntent({ token: user.data.token }));\n setMsg(false);\n setUserData(res.data.user);\n toast.success(`Profile Updated Successfully`, {\n position: toast.POSITION.BOTTOM_RIGHT,\n });\n })\n .catch((err) => {});\n };\n\n return (\n <>\n \n \n \n \n
\n {isEditing && (\n
\n \n \n {\"Edit Profile\"}\n \n \n \n \n \n \n \n {\n setImgDialoags(true);\n setImgCrop(false);\n }}\n color=\"primary\"\n sx={{ cursor: \"pointer\", pb: 2 }}\n >\n Update Photo\n \n setImgDialoags(false)}\n >\n \n Update Photo\n \n {\n const formDatas = new FormData();\n formDatas.append(\"image\", file);\n fetch(\n `${process.env.REACT_APP_MERAKI_URL}/courseEditor/ImageUploadS3`,\n {\n headers: {\n accept:\n \"application/json, text/plain, */*\",\n \"accept-language\":\n \"en-GB,en-US;q=0.9,en;q=0.8\",\n },\n referrerPolicy:\n \"strict-origin-when-cross-origin\",\n body: formDatas,\n method: \"POST\",\n mode: \"cors\",\n credentials: \"omit\",\n }\n ).then((res) => {\n res.json().then((data) => {\n setNew_Profiles(data.file.url);\n });\n });\n }}\n onCrop={onCrop}\n />\n \n Save\n \n \n \n Tips: Try square JPG or PNG with atleast 500*500\n resolution for high quality profile display\n \n \n \n \n
\n \n \n 0\n }\n // id=\"standard-basic\"\n label=\"Name\"\n fullWidth\n sx={{ mt: \"10px\", width: \"100%\" }}\n value={editName}\n helperText={helperText}\n onChange={(e) => {\n setEditName(e.target.value);\n if (e.target.value != userData.name) {\n setShowError(false);\n }\n }}\n />\n \n \n Email cannot be changed as it is linked to your Google\n account\n \n \n \n \n \n \n {\n setCountryCode(val);\n }}\n />\n \n \n {\n setContact(e.target.value);\n }}\n value={contact}\n name=\"contact\"\n id=\"contact\"\n variant=\"outlined\"\n helperText=\"Enter Phone Number\"\n fullWidth\n maxLength={10}\n error={contact?.length != 10 && contact?.length > 0}\n />\n \n \n {\n onSignInSubmit(event);\n setShowError(true);\n }}\n disabled={contact?.length != 10}\n >\n Get OTP\n {\" \"}\n \n {startOtp && (\n <>\n \n {\n setOtp(e.target.value);\n }}\n value={otp}\n name=\"OTP\"\n id=\"contact\"\n variant=\"outlined\"\n helperText=\"Enter OTP\"\n fullWidth\n maxLength={6}\n error={otp.length != 6 && otp.length > 0}\n />\n \n \n {\n OtpEnter(e);\n }}\n disabled={otp.length != 6}\n >\n Verify OTP\n {\" \"}\n \n >\n )}\n \n \n \n \n setIsEditing(false)}\n >\n Cancel\n \n \n Save Changes\n \n \n \n \n )}\n\n {msg ? (\n
Please wait... \n ) : (\n
\n {userData.name}\n {isActive && !isEditing && (\n \n \n \n )}\n \n )}\n\n
\n {userData.email}\n \n {/*
\n {user.data.user.rolesList.includes(\"volunteer\") &&\n userData.contact !== null && (\n <>\n \n {`+${userData.contact?.replace(\"-\", \"\")}`}\n \n \n >\n )}\n */}\n\n
\n {/* {!isActive && \"Edit Profile\"} */}\n Edit Profile\n \n\n {/*
*/}\n
\n \n \n \n My Certificates\n \n {data?.pathways?.map(\n (item) =>\n item.code === \"PRGPYT\" && (\n \n )\n )}\n\n {data?.pathways?.map(\n (item) =>\n item.code === \"PRGPYT\" && (\n \n )\n )}\n \n \n \n >\n );\n}\nexport default Profile;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n section_Heading: {\n margin: \"32px 0px 16px 0px\",\n },\n\n cards: {\n maxWidth: \"352px\",\n },\n mobileCards: {\n maxWidth: \"100%\",\n },\n\n card_button: {\n margin: \"0px 0px 16px 0px\",\n align: \"center\",\n },\n}));\n\nexport default useStyles;\n","import React, { useState, useEffect } from \"react\";\nimport useStyles from \"./styles\";\nimport { PATHS } from \"../../constant\";\nimport axios from \"axios\";\nimport { useSelector } from \"react-redux\";\nimport { METHODS } from \"../../services/api\";\nimport { breakpoints } from \"../../theme/constant\";\nimport { getQueryVariable } from \"../../common/utils\";\nimport { Link } from \"react-router-dom\";\nimport ExternalLink from \"../../components/common/ExternalLink\";\n\nimport {\n Container,\n Typography,\n Chip,\n Grid,\n Button,\n CardContent,\n CardActions,\n useMediaQuery,\n Card,\n} from \"@mui/material\";\nimport ArrowForwardIosIcon from \"@mui/icons-material/ArrowForwardIos\";\n\nfunction Opportunities() {\n const classes = useStyles();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n const [partner, setPartner] = useState([]);\n const user = useSelector(({ User }) => User);\n\n const partnerId = user.data && user.data.user.partner_id;\n\n const partnerIdFromAndroid = getQueryVariable(\"partner_id\");\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/partners`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data ? user.data.token : \"\",\n },\n })\n .then((res) => {\n setPartner(res.data.partners);\n })\n .catch((err) => {});\n }, []);\n\n return (\n <>\n \n \n \n \n Curated list of opportunities to skyrocket your career\n \n \n Admission Opportunities \n \n \n \n \n \n \n \n \n NavGurukul One-Year Residential Programmme\n \n \n \n \n Featured\n \n \n \n \n Eligibility: Basic coding knowledge\n \n \n \n \n \n } mr={1}>\n Apply Now\n \n \n \n \n \n \n \n \n \n \n HyperVerge Fellowships\n \n \n Eligibility: Basic coding knowledge\n \n \n \n \n \n }>\n Apply Now\n \n \n \n \n \n \n \n \n \n \n \n Grants / Advanced Courses / Mentorships\n \n \n \n \n By learning with Meraki, you can avail benefits such as:\n \n Grants such as free keyboards for typing practice \n Coursera Membership \n Advanced english courses \n 1:1 Mentorship sessions \n \n \n \n \n }\n variant=\"outlined\"\n sx={{ width: isActive ? \"100%\" : \"255px\" }}\n >\n Apply Now\n \n \n \n \n \n \n \n >\n );\n}\nexport default Opportunities;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n Grid_Space: {\n margin: \"40px 0px\",\n },\n AFE_approaches: {\n fontWeight: 700,\n },\n Approaches_text: {\n marginLeft: \"28px\",\n },\n Hadings: {\n marginBottom: \"20px\",\n },\n\n Fiber_space: {\n marginRight: \"8px\",\n },\n Ng_AFE: {\n marginBottom: \"16px\",\n },\n Img_size: {\n width: 328,\n height: 210,\n },\n Large_img_size: {\n width: 543,\n height: 360,\n },\n IMG: {\n width: \"95%\",\n // height: \"90%\",\n },\n}));\n\nexport default useStyles;\n","import React from \"react\";\nimport useStyles from \"./styles\";\nimport { breakpoints } from \"../../theme/constant\";\nimport {\n Container,\n Typography,\n Grid,\n Button,\n useMediaQuery,\n List,\n ListItem,\n ListItemText,\n} from \"@mui/material\";\n\n\nimport ArrowForwardIosIcon from \"@mui/icons-material/ArrowForwardIos\";\nimport ExternalLink from \"../common/ExternalLink\";\nimport CircleIcon from \"@mui/icons-material/Circle\";\n\nfunction AFEpage() {\n const classes = useStyles();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n Closing The Gender Gap in Technology\n \n \n \n \n India’s tech industry employs 10 million people; however, women\n only make up 34% of the workforce. Women represent 40% of\n entry-level tech jobs & the representation gets lower as they move\n up, with 30% in mid-level positions and as low as 20% in senior\n roles.\n \n\n \n To reduce the gender gap in technology and equip them with CS\n readiness skills, we work with young women from underserved\n communities.\n \n \n \n \n \n Our Mission\n \n \n \n \n \n \n Our Mission\n \n \n \n NavGurukul is a registered non-profit organisation working to\n empower students from underserved communities financially. Started\n in 2016 by IIT-D Alumnus, the organisation equips the youth with\n 21st-century skills through programming, coding, critical\n thinking, and problem-solving. It is committed to supporting its\n students until their placements.\n \n\n \n NavGurukul offers a 1-year fully-funded skilling and recruitment\n program in software engineering that enables them to secure\n aspirational careers.\n \n \n \n \n \n \n \n \n Our Approach\n \n \n \n \n \n \n\n \n \n \n Our Approach\n \n \n \n NavGurukul is working with a two-step approach to make our\n students CS-ready and placed in tech jobs.\n \n \n \n \n Accessibility and readiness program: Meraki\n \n Age group: 13+ girls/ women\n \n \n \n \n \n \n Skilling and job placement program: Residential Program\n \n Age group 18 - 29 years\n \n \n \n
\n \n \n \n\n \n \n NavGurukul 🤝 AFE\n \n \n \n \n \n \n Amazon Future Engineer (AFE) is a comprehensive\n childhood-to-career program to increase access to computer\n science education for children and young adults who typically\n lack these opportunities.\n \n \n To take its mission forward in India, AFE has partnered with\n Navguruku in its Meraki program to close the gender gap in\n technology. Meraki is an android application focused on making\n programming and digital skills accessible to learners from\n different communities through a smartphone to create direct job\n opportunities or admissions to aspirational training programs.\n The focus area is young women and girls to bridge the gender gap\n in the digital literacy sector.\n \n \n \n }>\n Visit Amazon Future Engineer\n \n \n \n \n \n >\n );\n}\nexport default AFEpage;\n","import React, { useState } from \"react\";\nimport \"./styles.scss\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../services/api\";\n\nfunction NavgurukulIntroduce() {\n const [getMerakiUrl, setGetMerakiUrl] = useState([]);\n\n const partnerId = window.location.href.split(\"navgurukul/\")[1];\n\n const getMerakiLink = () => {\n axios({\n method: METHODS.PUT,\n url: `${process.env.REACT_APP_MERAKI_URL}/partners/${partnerId}/merakiLink`,\n headers: {\n accept: \"application/json\",\n platform: \"android\",\n },\n })\n .then((res) => {\n setGetMerakiUrl(res.data.meraki_link);\n })\n .catch((err) => {});\n };\n\n return (\n \n );\n}\n\nexport default NavgurukulIntroduce;\n","import React, { useState, useEffect } from \"react\";\nimport { Redirect } from \"react-router-dom\";\nimport { getQueryVariable } from \"../../../common/utils\";\nimport { PATHS } from \"../../../constant\";\nimport { sendToken } from \"../../User/redux/api\";\n\nfunction RedirectComponent() {\n const [emailId, setEmailId] = useState(null);\n // const uri = window.location.href;\n // const uri = `https://www.merakilearn.org/redirect?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY0MSIsImVtYWlsIjoicG9vbmFtMTlAbmF2Z3VydWt1bC5vcmciLCJpYXQiOjE2NDU1MDgwNDIsImV4cCI6MTY3NzA2NTY0Mn0.az9n0hnUmj_2jHzj7LJ6ldAa_f74_gECF1BBDIzgU44&redirectUrl=admission`;\n\n const token = getQueryVariable(\"token\");\n // undefined => \"\", remove leading slashes in redirect\n const redirect = (getQueryVariable(\"redirectUrl\") || \"\").replace(/^\\/+/g, \"\");\n\n useEffect(() => {\n sendToken({ token })\n .then((res) => {\n if (res.data.user.email) {\n setEmailId(res.data.user.email);\n }\n })\n .catch((err) => {});\n }, []);\n\n try {\n if (emailId && !emailId.includes(\"@fake.com\")) {\n localStorage.setItem(\"Token\", token);\n }\n } catch (error) {\n //console.error('Error accessing localStorage:', error);\n return {};\n }\n\n return (\n <>\n {emailId ? (\n \n ) : null}\n >\n );\n}\n\nexport default RedirectComponent;\n","import React, { useEffect, useState } from \"react\";\nimport axios from \"axios\";\nimport { Link } from \"react-router-dom\";\nimport { useSelector } from \"react-redux\";\nimport { METHODS } from \"../../../services/api\";\nimport star from \"../../../asset/ratingIcon.svg\";\nimport moment from \"moment\";\nimport \"./styles.scss\";\nimport { useDebounce } from \"use-debounce\";\nimport ReactPaginate from \"react-paginate\";\n// import { BsArrowUpDown } from \"react-icons/bs\";\nimport { BsArrowDownUp } from 'react-icons/bs';\n\nfunction VolunteerDashboard() {\n const limit = 10;\n const [volunteer, setVolunteer] = useState([]);\n const [selctedPathway, setSelectedPathway] = useState(\"\");\n const [cacheVolunteer, setCacheVolunteer] = useState([]);\n const [slicedVolunteer, setSlicedVolunteer] = useState([]);\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [pageNumber, setPageNumber] = useState(0);\n const [sortMethod, setSortMethod] = useState(\"dsc\");\n const [debouncedText] = useDebounce(searchTerm);\n const [language, setLangue] = useState(\"All\");\n const [week, setWeek] = useState(\"All\");\n const [rating, setRating] = useState(\"All\");\n\n let pageCount = Math.ceil(volunteer && volunteer.length / limit);\n\n if (selctedPathway) {\n pageCount = Math.ceil(slicedVolunteer && slicedVolunteer.length / limit);\n }\n\n const [dropdowns, setDropdowns] = useState({\n duration: false,\n language: false,\n rating: false,\n });\n\n const user = useSelector(({ User }) => User);\n\n const changePage = ({ selected }) => {\n setPageNumber(selected);\n };\n\n const handleDropdown = (e) => (key) => {\n setDropdowns({ ...dropdowns, [key]: !dropdowns[key] });\n };\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/volunteers`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n setVolunteer(res.data);\n setCacheVolunteer(res.data);\n setSlicedVolunteer(\n res.data.slice(pageNumber * limit, (pageNumber + 1) * limit)\n );\n pageCount = Math.ceil(\n slicedVolunteer && slicedVolunteer.length / limit\n );\n })\n .catch((err) => {});\n }, []);\n\n const languageMap = {\n hi: \"Hindi\",\n te: \"Telugu\",\n en: \"English\",\n ta: \"Tamil\",\n };\n\n function filterPathway(pathway, volunteer) {\n return volunteer.filter((el) => {\n for (let i of el.pathways) {\n if (i === pathway) {\n return true;\n }\n }\n });\n }\n\n function filterweek(language, rating) {\n language(\"All\");\n rating(\"All\");\n let date = Date.now();\n return cacheVolunteer.filter((el) => {\n const classes = el.classes;\n const cur_date =\n classes.length && new Date(classes[classes.length - 1].end_time);\n if (week === \"All\") {\n return true;\n }\n if (cur_date >= date - week * 7 * 24 * 60 * 60 * 1000) {\n return true;\n }\n });\n }\n\n function ratings(week, language) {\n week(\"All\");\n language(\"All\");\n return cacheVolunteer.filter(\n (el) => rating === \"All\" || rating == el.avg_rating\n );\n }\n\n function numberOfWeek(el) {\n const classes = el.classes;\n let last_date =\n classes.length && new Date(classes[classes.length - 1].end_time);\n let new_date = classes.length && new Date(el.classes[0].end_time);\n return Math.ceil((last_date - new_date) / (7 * 24 * 60 * 60 * 1000));\n }\n\n function filterLanguage(week, rating) {\n week(\"All\");\n rating(\"All\");\n return cacheVolunteer.filter(\n (el) =>\n language == \"All\" ||\n language == languageMap[el.classes[el.classes.length - 1].lang]\n );\n }\n\n const sortVolunteers = (byMethod) => {\n let sortedVolunteers;\n if (byMethod === \"enroll_date\") {\n sortedVolunteers = volunteer.sort((a, b) =>\n sortMethod === \"asc\"\n ? new Date(a.last_class_date) - new Date(b.last_class_date)\n : new Date(b.last_class_date) - new Date(a.last_class_date)\n );\n }\n setVolunteer(sortedVolunteers);\n setSlicedVolunteer(\n sortedVolunteers.slice(pageNumber * limit, (pageNumber + 1) * limit)\n );\n if (sortMethod === \"asc\") {\n setSortMethod(\"dsc\");\n } else {\n setSortMethod(\"asc\");\n }\n };\n\n useEffect(() => {\n const data =\n volunteer &&\n volunteer.filter((searchValue) =>\n searchValue.name.toLowerCase().includes(searchTerm.toLowerCase())\n );\n const slicedData = data.slice(pageNumber * limit, (pageNumber + 1) * limit);\n // setVolunteer(data)\n setSlicedVolunteer(slicedData);\n }, [debouncedText, pageNumber]);\n\n return (\n <>\n \n
\n {\n setSearchTerm(e.target.value);\n }}\n />\n
\n\n
\n {\n setSlicedVolunteer(filterPathway(\"Python\", cacheVolunteer));\n setSelectedPathway(\"Python\");\n }}\n >\n Python\n \n {\n setSlicedVolunteer(\n filterPathway(\"Spoken English\", cacheVolunteer)\n );\n setSelectedPathway(\"Spoken English\");\n }}\n >\n Spoken English\n \n {\n setSlicedVolunteer(filterPathway(\"Typing\", cacheVolunteer));\n setSelectedPathway(\"Typing\");\n }}\n >\n Typing\n \n {\n setSelectedPathway(\"Filter\");\n setSlicedVolunteer(cacheVolunteer);\n }}\n >\n Filter\n \n
\n\n {selctedPathway === \"Filter\" ? (\n
\n
\n
Duration \n
handleDropdown(e)(\"duration\")}>\n {week === \"All\" ? \"All Time\" : `Past ${week} week`}\n \n {dropdowns.duration ? (\n
\n
\n {\n setWeek(\"All\");\n }}\n className={week === \"All\" ? \"checked\" : \"\"}\n value=\"All Time\"\n >\n All Time\n \n {\n setWeek(1);\n }}\n className={week === 1 ? \"checked\" : \"\"}\n value=\"Past 1 week\"\n >\n Past 1 week\n \n {\n setWeek(4);\n }}\n className={week === 4 ? \"checked\" : \"\"}\n value=\"Past 4 week\"\n >\n Past 4 week\n \n {\n setWeek(8);\n }}\n className={week === 8 ? \"checked\" : \"\"}\n value=\"Past 8 week\"\n >\n Past 8 week\n \n {\n setWeek(12);\n }}\n className={week === 12 ? \"checked\" : \"\"}\n value=\"Past 12 week\"\n >\n Past 12 week\n \n \n
{\n setSlicedVolunteer(filterweek(setLangue, setRating));\n handleDropdown(e)(\"duration\");\n }}\n >\n Apply\n \n
\n ) : (\n \"\"\n )}\n
\n
\n
Language \n
handleDropdown(e)(\"language\")}>\n {language == \"All\" ? \"All Languages\" : language}\n \n {dropdowns.language ? (\n
\n
\n {\n setLangue(\"All\");\n }}\n className={language == \"All\" ? \"checked\" : \"\"}\n value=\"All\"\n >\n All\n \n {\n setLangue(\"English\");\n }}\n className={language == \"English\" ? \"checked\" : \"\"}\n value=\"English\"\n >\n English\n \n {\n setLangue(\"Hindi\");\n }}\n className={language == \"Hindi\" ? \"checked\" : \"\"}\n value=\"Hindi\"\n >\n Hindi\n \n \n
{\n setSlicedVolunteer(filterLanguage(setWeek, setRating));\n handleDropdown(e)(\"language\");\n }}\n >\n Apply\n \n
\n ) : (\n \"\"\n )}\n
\n
\n
Avg. Rating \n
handleDropdown(e)(\"rating\")}>\n {rating === \"All\" ? \"All Ratings\" : `${rating} Star`}\n \n {dropdowns.rating ? (\n
\n ) : (\n \"\"\n )}\n
\n
\n ) : (\n \"\"\n )}\n\n
\n \n \n Name \n No. of Classes \n Engagement (Weeks) \n \n Last Class Date\n sortVolunteers(\"enroll_date\")}\n >\n \n \n \n Last Class Title \n Last Class Lang \n Avg.Rating \n \n \n \n {/* {volunteer && volunteer.length > 0 ? ( */}\n {slicedVolunteer && slicedVolunteer.length > 0 ? (\n slicedVolunteer.map((item) => {\n let ratingCount = 0;\n let count = 0;\n item.classes.map((classes) => {\n classes.ratings.map((rating) => {\n if (rating.rating) {\n ratingCount += parseInt(rating.rating);\n count += 1;\n }\n });\n });\n item.avg_rating = Math.ceil(ratingCount / count);\n const sortedClasses =\n item.classes.length &&\n item.classes.sort((a, b) => {\n return new Date(a.start_time) - new Date(b.start_time);\n });\n item.last_class_date =\n sortedClasses.length &&\n sortedClasses[sortedClasses.length - 1].start_time;\n let getStars = 0;\n let totalStarts = item.classes.length * 5;\n item.classes.map((stars) => {\n getStars = getStars + Number(stars.classes);\n });\n return (\n \n \n \n {item.name}\n \n \n {item.classes.length} \n {numberOfWeek(item)} \n \n {moment(\n item.last_class_date\n // sortedClasses[sortedClasses.length - 1].start_time\n ).format(\"DD-MM-YYYY\")}\n \n \n {item.classes &&\n item.classes.length > 0 &&\n item.classes[item.classes.length - 1][\"title\"] != \"\"\n ? item.classes[item.classes.length - 1][\"title\"]\n : \"NA\"}\n \n \n {item.classes &&\n item.classes.length > 0 &&\n item.classes[item.classes.length - 1][\"lang\"] != \"\"\n ? languageMap[\n item.classes[item.classes.length - 1][\"lang\"]\n ]\n : \"NA\"}\n \n \n {/* {item.classes.ratings} */}\n {/* {item.classes &&\n item.classes.length > 0 && item.classes[item.classes.length - 1\n ][\"ratings\"] != \"\"\n ? item.classes[\n item.classes.length - 1\n ][\"ratings\"]\n : \"NA\"} */}\n {[1, 2, 3, 4, 5].map((star) => {\n return Math.ceil(item.avg_rating) > 0 &&\n star <= Math.ceil(item.avg_rating) ? (\n \n ) : (\n \n );\n })}\n \n \n );\n })\n ) : (\n \n
There are no results to display... \n \n )}\n \n
\n\n
\n
\n
\n Showing {pageNumber * limit + 1}-\n {(pageNumber + 1) * limit > volunteer.length\n ? volunteer.length\n : (pageNumber + 1) * limit}\n of {volunteer.length}\n
\n
\n
\n }\n nextLabel={ }\n initialPage={0}\n marginPagesDisplayed={0}\n pageCount={pageCount}\n onPageChange={changePage}\n containerClassName=\"paginationBttns-volunteer\"\n previousLinkClassName=\"previousBttn\"\n nextLinkClassName=\"nextBttn\"\n disabledClassName=\"paginationDisabled\"\n activeClassName=\"paginationActive-volunteer\"\n />\n
\n
\n
\n >\n );\n}\n\nexport default VolunteerDashboard;\n","import React, { useEffect, useState } from \"react\";\nimport axios from \"axios\";\nimport { Link } from \"react-router-dom\";\nimport { useSelector } from \"react-redux\";\nimport { METHODS } from \"../../../services/api\";\nimport { PATHS } from \"../../../constant\";\nimport moment from \"moment\";\nimport ReactPaginate from \"react-paginate\";\nimport { useDebounce } from \"use-debounce\";\n// import { BsArrowUpDown } from \"react-icons/bs\";\n// import { BsArrowDownUp } from \"react-icons/bs\";\nimport { BsArrowDownUp } from 'react-icons/bs';\n\nimport \"./styles.scss\";\n\nfunction VolunteerOverview(props) {\n const [searchTerm, setSearchTerm] = useState(\"\");\n const [classes, setClasses] = useState([]);\n const [slicedClasses, setSlicedClasses] = useState();\n const user = useSelector(({ User }) => User);\n const [pageNumber, setPageNumber] = useState(0);\n const [sortMethod, setSortMethod] = useState(\"dsc\");\n const [debouncedText] = useDebounce(searchTerm);\n\n const limit = 10;\n\n const volunteerClassData = props.location.state.pass;\n const pageCount = Math.ceil(volunteerClassData.classes.length / limit);\n const changePage = ({ selected }) => {\n setPageNumber(selected);\n };\n\n const firstIndex = (pageNumber + 1) * limit;\n const lastIndex = volunteerClassData.classes.length;\n\n const lang = { en: \"English\", hi: \"Hindi\" };\n let language = \"\";\n new Set(volunteerClassData.classes.map((item) => item.lang)).forEach(\n (item) => (language = language + lang[item] + \", \")\n );\n\n const languageMap = {\n hi: \"Hindi\",\n te: \"Telugu\",\n en: \"English\",\n ta: \"Tamil\",\n };\n\n useEffect(() => {\n const data = volunteerClassData.classes.filter((searchValue) => {\n if (searchTerm == \"\") {\n return searchValue;\n } else if (\n searchValue.title.toLowerCase().includes(searchTerm.toLowerCase())\n ) {\n return searchValue;\n }\n });\n const slicedData = data.slice(pageNumber * limit, (pageNumber + 1) * limit);\n setClasses(data);\n setSlicedClasses(slicedData);\n }, [debouncedText, pageNumber]);\n\n const sortClasses = (byMethod) => {\n let sortedClasses;\n if (byMethod === \"class_date\") {\n sortedClasses = classes.sort((a, b) =>\n sortMethod === \"asc\"\n ? new Date(a.end_time) - new Date(b.end_time)\n : new Date(b.end_time) - new Date(a.end_time)\n );\n }\n setClasses(sortedClasses);\n setSlicedClasses(\n sortedClasses.slice(pageNumber * limit, (pageNumber + 1) * limit)\n );\n if (sortMethod === \"asc\") {\n setSortMethod(\"dsc\");\n } else {\n setSortMethod(\"asc\");\n }\n };\n\n return (\n <>\n \n
\n
\n \n {\" \"}\n Home\n {\" \"}\n /\n \n {\" \"}\n Volunteer \n \n
\n
/ {volunteerClassData.name}
\n
\n
\n
{volunteerClassData.name}
\n
Python: {language.slice(0, -2)}
\n
Total Classes: {volunteerClassData.classes.length}
\n
\n Associated Partner:{\" \"}\n {volunteerClassData.partner ? volunteerClassData.partner : \"NA\"}\n
\n
\n
\n {\n setSearchTerm(e.target.value);\n }}\n />\n
\n
\n \n \n Class Title \n \n Class Date\n sortClasses(\"class_date\")}\n >\n \n \n \n Class Time \n \n Student Enrollments\n {/* sortClasses(\"enrollment\")}\n >\n \n */}\n \n Language \n Avg. Rating \n \n \n \n {classes && classes.length > 0 ? (\n slicedClasses.map((item) => {\n // let ratingCount = 0;\n // item.ratings.map((item) => {\n // if (item.rating) ratingCount += parseInt(item.rating);\n\n // return ratingCount;\n // });\n // item.avg_rating = Math.ceil(\n // item.ratings.length && ratingCount / item.ratings.length\n // );\n const ratings = item.ratings.filter((item) => item.rating);\n item.avg_rating =\n ratings.length &&\n Math.ceil(\n ratings.reduce(\n (ratingSum, item) => ratingSum + parseInt(item.rating),\n 0\n ) / ratings.length\n );\n return (\n \n {item.title} \n \n {moment.utc(item.end_time).format(\"DD-MM-YYYY\")}\n \n \n {moment\n .utc(item.start_time)\n .add(330, \"minute\")\n .format(\"kk:mm\")}\n \n \n {item.max_enrollment ? item.max_enrollment : \"NA\"}\n \n {languageMap[item.lang]} \n \n {[1, 2, 3, 4, 5].map((star) => {\n return item.avg_rating > 0 &&\n star <= item.avg_rating ? (\n \n ) : (\n \n );\n })}\n \n \n );\n })\n ) : (\n \n
There are no results to display... \n \n )}\n \n
\n\n
\n
\n
\n Showing {pageNumber * limit + 1}-\n {firstIndex > lastIndex ? lastIndex : firstIndex}\n of {lastIndex}\n
\n
\n
\n }\n nextLabel={ }\n initialPage={0}\n marginPagesDisplayed={0}\n pageCount={pageCount}\n onPageChange={changePage}\n containerClassName=\"paginationBttns-volunteer\"\n previousLinkClassName=\"previousBttn\"\n nextLinkClassName=\"nextBttn\"\n disabledClassName=\"paginationDisabled\"\n activeClassName=\"paginationActive-volunteer\"\n />\n
\n
\n
\n >\n );\n}\nexport default VolunteerOverview;\n","import React, { useEffect, useState } from \"react\";\nimport axios from \"axios\";\nimport { useSelector } from \"react-redux\";\nimport { METHODS } from \"../../../services/api\";\nimport { Link } from \"react-router-dom\";\nimport { PATHS } from \"../../../constant\";\nimport { hasOneFrom } from \"../../../common/utils\";\nimport { Redirect } from \"react-router-dom\";\nimport \"../style.scss\";\n\nfunction Dashboard({ stateId }) {\n const user = useSelector(({ User }) => User);\n const [districtPartner, setDistrictPartner] = useState([]);\n const [districtPartnerData, setDistrictPartnerData] = useState([]);\n const [filterData, setFilterData] = useState([]);\n const [value, setValue] = useState();\n const [region, setRegion] = useState();\n const [isRegion, setIsRegion] = useState();\n const [regionData, setRegionData] = useState();\n const [regionDistrictPartner, setRegionDistrictPartner] = useState([]);\n const [district, setDistrict] = useState();\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/partners/${stateId}/groups`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n setRegion();\n const partnerGroups = res.data.partner_groups_data;\n const includesRegion =\n partnerGroups[0].partner_group_name.includes(\"_REGION\");\n\n setDistrictPartner(res.data);\n setIsRegion(includesRegion);\n\n setDistrictPartnerData(partnerGroups);\n setRegionData(partnerGroups);\n\n if (includesRegion) {\n setValue();\n setRegionDistrictPartner(\n partnerGroups[0].partner_groups_data.partner_groups_data\n );\n setFilterData([\n partnerGroups[0].partner_groups_data.partner_groups_data[0],\n ]);\n } else {\n setFilterData([partnerGroups[0]]);\n setDistrict();\n }\n })\n .catch((err) => {});\n }, [stateId]);\n\n const handleSelcet = (e) => {\n const stateFilterData = districtPartnerData.filter(\n (el) => el.partner_group_name === e.target.value\n );\n setFilterData(stateFilterData);\n setValue(e.target.value);\n };\n\n const tableDistrict = (region) => {\n const regionItem = regionData.find(\n (item) => item.partner_group_name === region\n );\n setRegion(region);\n const regionPartner =\n regionItem && regionItem.partner_groups_data.partner_groups_data;\n\n setRegionDistrictPartner(regionPartner);\n setDistrict(\"all\");\n };\n\n const selectRegion = (e) => {\n const regionItem = regionData.find(\n (item) => item.partner_group_name === e.target.value\n );\n const regionPartner =\n regionItem && regionItem.partner_groups_data.partner_groups_data;\n\n setRegionDistrictPartner(regionPartner);\n setRegion(e.target.value);\n if (e.target.value !== \"all\") {\n setFilterData([regionPartner[0]]);\n }\n };\n\n const selecetDistrict = (e) => {\n const districtPartner = [\n regionDistrictPartner.find(\n (item) => item.partner_group_name === e.target.value\n ),\n ];\n setDistrict(e.target.value);\n setFilterData(districtPartner);\n };\n\n const canSpecifyPartnerGroupId =\n hasOneFrom(user.data.user.rolesList, [\n \"admin\",\n \"partner\",\n \"partner_view\",\n ]) && user.data.user.partner_group_id;\n\n if (canSpecifyPartnerGroupId) {\n return (\n \n
Overview \n
\n
\n \n {districtPartner.total_no_of_groups}\n \n Total Number of Groups \n
\n
\n \n {districtPartner.total_no_of_partners}\n \n \n Total Number of Partners\n \n
\n
\n \n {districtPartner.total_no_of_students}\n \n Total Enrolled Students \n
\n
\n {isRegion ? (\n <>\n
\n
Please choose a Region \n \n All \n {regionData &&\n regionData.map((item, i) => {\n return (\n <>\n \n {item.partner_group_name}\n \n >\n );\n })}\n \n \n\n {region !== \"all\" && (\n
\n
Please choose a group \n \n All \n {regionDistrictPartner &&\n regionDistrictPartner.map((item, i) => {\n return (\n <>\n \n {item.partner_group_name}\n \n >\n );\n })}\n \n \n )}\n >\n ) : (\n
\n
Please choose a group \n \n All \n {districtPartnerData.map((item, i) => {\n return (\n <>\n \n {item.partner_group_name}\n \n >\n );\n })}\n \n \n )}\n\n {value === \"all\" ? (\n
\n
\n \n \n Group Name \n Number of Partners \n Number of Students \n \n \n \n {districtPartnerData.map((item) => {\n return (\n \n \n {item.partner_group_name}\n \n \n {item.total_no_of_partners}\n \n \n {item.total_no_of_students}\n \n \n );\n })}\n \n
\n
\n ) : region === \"all\" ? (\n
\n
\n \n \n Group Name \n Number of Districts \n Number of ITIs \n Number of Students \n \n \n \n {districtPartnerData.map((item) => {\n return (\n {\n tableDistrict(\n item.partner_groups_data.partner_group_name\n );\n }}\n >\n \n {item.partner_groups_data.partner_group_name}\n \n\n \n {item.partner_groups_data.total_no_of_groups}\n \n\n \n {item.partner_groups_data.total_no_of_partners}\n \n \n {item.partner_groups_data.total_no_of_students}\n \n \n );\n })}\n \n
\n
\n ) : district === \"all\" ? (\n
\n
\n \n \n Group Name \n Number of ITIs \n Number of Students \n \n \n \n {regionDistrictPartner.map((item) => {\n return (\n \n \n {item.partner_group_name}\n \n \n {item.total_no_of_partners}\n \n \n {item.total_no_of_students}\n \n \n );\n })}\n \n
\n
\n ) : (\n
\n {/*
*/}\n
\n {filterData.map((item) => {\n return item.partners.map((name) => {\n return (\n
\n
\n
{name.partner_name} \n
\n \n {name.users_count} Students\n \n
\n \n
\n );\n });\n })}\n
\n
\n )}\n
\n );\n }\n return ;\n}\n\nexport default Dashboard;\n","import React, { useEffect, useState } from \"react\";\nimport axios from \"axios\";\nimport { useSelector } from \"react-redux\";\nimport { METHODS } from \"../../services/api\";\nimport \"./style.scss\";\nimport Dashboard from \"./Dashboard\";\n\nfunction StateDashboard() {\n const user = useSelector(({ User }) => User);\n const [states, setStates] = useState();\n const [stateId, setStateId] = useState();\n\n const clusterId = user.data.user.partner_group_id;\n const admin = user.data.user.rolesList.indexOf(\"admin\") > -1;\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/partners/clusters`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n setStates(res.data);\n if (clusterId) {\n res.data.filter((item) => {\n if (clusterId === item.id) setStateId(item.id);\n });\n } else {\n setStateId(res.data[0].id);\n }\n })\n .catch((err) => {});\n }, []);\n\n const selectedState = (id) => {\n setStateId(id);\n };\n\n return (\n <>\n {states && (\n \n {states.map((item) => {\n const name = `${\n item.name[0] + item.name.slice(1).toLowerCase()\n } Dashboard`;\n return (\n
\n
selectedState(item.id)}\n className={\n admin\n ? stateId === item.id\n ? \"dark-text\"\n : \"light-text\"\n : clusterId === item.id\n ? \"dark-text\"\n : \"light-text\"\n }\n >\n {(clusterId === item.id || admin) && name}\n \n {admin ? stateId === item.id && : \"\"}\n \n );\n })}\n
\n )}\n \n >\n );\n}\nexport default StateDashboard;\n","import { makeStyles } from \"@material-ui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n ourStorybttn: {\n height: \"40px\",\n padding: \"-20\",\n color: \"grey\",\n borderRadius: \"50%\",\n },\n ourStoryHrline: {\n width: \"60px\",\n textAlign: \"center\",\n marginBottom: \"30px\",\n },\n ourStoryHr: {\n width: \" 10%\",\n border: \" 10px dotted\",\n borderStyle: \"none none dotted\",\n color: \"grey\",\n marginTop: \"10px\",\n },\n ourStorylogo: {\n height: \"30px\",\n width: \"120px\",\n },\n ourStorylogo1: {\n height: \"20px\",\n width: \"50px\",\n },\n\n ourStorySpace: {\n marginTop: \"50px\",\n },\n}));\n\nexport default useStyles;\n","import React from \"react\";\nimport { Container, Grid, Typography } from \"@mui/material\";\nimport useStyles from \"./styles\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../theme/constant\";\n\nconst OurStory = () => {\n const classes = useStyles();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n return (\n <>\n \n \n \n “Bringing the joy of learning to the students of most underserved\n communities”\n \n \n \n Meraki, as an organization, lives by the above motivation. Meraki\n is part of NavGurukul Foundation for Social Welfare. It started in\n 2020 to bring low-cost online tech education to students from\n low-income families across India. NavGurukul already runs\n successful campus programs across India, and Meraki is an\n extension of that effort.\n \n \n In our pursuit, numerous volunteers and partners helped us create\n relationships with government bodies, schools and NGOs to cater to\n their students or just individual students.\n \n \n \n \n >\n );\n};\nexport default OurStory;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n cardGrid: {\n padding: \"10px 16px 10px 16px\",\n },\n\n link: {\n textDecoration: \"none\",\n color: \"black\",\n },\n}));\n\nexport default useStyles;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n courseNumber: {\n // marginRight: \"10px\",\n // verticalAlign: \"top\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"2px\",\n background: \"#E9F5E9\",\n width: \"20px\",\n height: \"20px\",\n borderRadius: \"50%\",\n },\n courseCard: {\n margin: \"15px 0\",\n \"&:hover\": {\n boxShadow:\n \"0px 16px 24px rgba(0, 0, 0, 0.06), 0px 6px 30px rgba(0, 0, 0, 0.04), 0px 8px 10px rgba(0, 0, 0, 0.08)\",\n },\n },\n progressBar: {\n width: \"95%\",\n },\n}));\n\nexport default useStyles;\n","import React, { useState, useEffect } from \"react\";\nimport { timeLeftFormat } from \"../../common/date\";\nimport { Button } from \"@mui/material\";\nimport ExternalLink from \"../common/ExternalLink\";\n\nfunction LearningTrackTimerButton({\n startTime = new Date(),\n link,\n joinOnClick,\n}) {\n const ONE_SECOND = 1000; //millisecs\n const ONE_MINUTE = 60 * ONE_SECOND;\n const CAN_JOIN_MSG = \"Join Now\";\n // const TOO_LATE = \"less than a minute (too late to join)\";\n // const CLASS_PAST_START = \"progress or concluded (too late to join)\";\n const timeLeftFormatOptions = {\n expiredText: CAN_JOIN_MSG,\n precision: [2, 2, 2, 2, 1, 1],\n cutoffTextArr: [\"\", \"\", \"\", \"\", CAN_JOIN_MSG, CAN_JOIN_MSG],\n cutoffNumArr: [0, 0, 0, 0, 10, 60],\n };\n // const canJoin = () => minutesUntil(startTime) <= 10;\n const [timeRemainingMsg, setTimeRemainingMsg] = useState(\n timeLeftFormat(startTime, timeLeftFormatOptions)\n );\n\n useEffect(() => {\n setTimeRemainingMsg(timeLeftFormat(startTime, timeLeftFormatOptions));\n const timer = setInterval(() => {\n const newTimeRemainingMsg = timeLeftFormat(\n startTime,\n timeLeftFormatOptions\n );\n setTimeRemainingMsg(newTimeRemainingMsg);\n if (newTimeRemainingMsg === CAN_JOIN_MSG) {\n clearInterval(timer); // can join so can dispose of timer now\n }\n }, ONE_MINUTE);\n return () => clearInterval(timer); // cleans up on unmount\n }, [startTime]);\n\n return (\n <>\n {timeRemainingMsg === CAN_JOIN_MSG ? (\n \n \n {CAN_JOIN_MSG}\n \n \n ) : (\n \n Starts in {timeRemainingMsg}\n \n )}\n >\n );\n}\n\nexport default LearningTrackTimerButton;\n","import React, { useEffect, useState } from \"react\";\nimport { format } from \"../../common/date\";\nimport {\n Typography,\n Container,\n CardActionArea,\n CardMedia,\n Card,\n CardContent,\n Box,\n Link,\n LinearProgress,\n Collapse,\n Button,\n Chip,\n} from \"@mui/material\";\nimport { useParams } from \"react-router-dom\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { Grid, IconButton } from \"@mui/material\";\nimport { actions as pathwayActions } from \"../PathwayCourse/redux/action\";\nimport { actions as upcomingBatchesActions } from \"../PathwayCourse/redux/action\";\nimport { actions as upcomingClassActions } from \"../PathwayCourse/redux/action\";\nimport { actions as enrolledBatchesActions } from \"../PathwayCourse/redux/action\";\n\nimport useStyles from \"./styles\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../theme/constant\";\nimport { useHistory } from \"react-router-dom\";\nimport { interpolatePath, PATHS } from \"../../constant\";\nimport { getPathwaysCourse } from \"../PathwayCourse/redux/api\";\nimport { getUpcomingBatches } from \"../PathwayCourse/redux/api\";\nimport KeyboardArrowDownIcon from \"@mui/icons-material/KeyboardArrowDown\";\nimport KeyboardArrowUpIcon from \"@mui/icons-material/KeyboardArrowUp\";\nimport { METHODS } from \"../../services/api\";\nimport axios from \"axios\";\nimport LearningTrackTimerButton from \"./LearningTrackTimerButton\";\nimport path from \"path\";\nimport { InsertEmoticonRounded } from \"@mui/icons-material\";\n\nfunction LearningTrackCard(props) {\n const user = useSelector(({ User }) => User);\n // const pathwaysData = useSelector(({ Pathways }) => Pathways);\n const dispatch = useDispatch();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n // const isActiveIpad = useMediaQuery(\"(max-width:1300px)\");\n const classes = useStyles();\n const history = useHistory();\n // const [PathwayData, setPathwayData] = useState([]);\n // const [courseIndex, setCourseIndex] = useState(0);\n const [open, setOpen] = React.useState(false);\n const { item, setPathway } = props;\n const pathwayId = item.pathway_id;\n const [completedPortionJason, setCompletedPortionJason] = useState();\n const [upcomingBatchesData, setUpcomingBatchesData] = useState();\n const params = useParams();\n\n // useEffect(() => {\n // getPathwaysCourse({ pathwayId: pathwayId }).then((res) => {\n // setPathwayData(res.data);\n // });\n\n // const COurseIndex = PathwayData?.courses?.findIndex((course, index) => {\n // if (course.course_id === item.course_id) {\n // return index;\n // }\n // });\n // setCourseIndex(COurseIndex);\n // }, [item]);\n\n const data = useSelector((state) => {\n return state;\n });\n\n useEffect(() => {\n // setLoading(true);\n if (user?.data?.token && pathwayId) {\n // dispatch(\n // enrolledBatchesActions.getEnrolledBatches({\n // pathwayId: pathwayId,\n // authToken: user?.data?.token,\n // })\n // );\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/${pathwayId}/totalProgress`,\n headers: {\n accept: \"application/json\",\n Authorization: user?.data?.token,\n },\n })\n .then((response) => {\n setCompletedPortionJason(response.data.total_completed_portion);\n })\n .catch((err) => {});\n }\n }, [pathwayId]);\n\n // useEffect(() => {\n // dispatch(pathwayActions.getPathwaysCourse({ pathwayId: pathwayId }));\n // }, [dispatch, pathwayId]);\n\n useEffect(() => {\n if (showUpcomingBatchData) {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/${pathwayId}/upcomingBatches`,\n headers: {\n accept: \"application/json\",\n Authorization: user?.data?.token,\n },\n })\n .then((res) => {\n setUpcomingBatchesData(res.data);\n })\n .catch((err) => {});\n }\n }, []);\n // const upcomingBatchesData = useSelector((state) => {\n // return state.Pathways?.upcomingBatches?.data;\n // });\n\n // useEffect(() => {\n // dispatch(pathwayActions.getPathways());\n // }, [dispatch, pathwayId]);\n\n const pathwayCourseData = data.PathwaysDropdow?.data?.pathways.find(\n (item) => {\n return item.id == pathwayId;\n }\n );\n\n const showUpcomingBatchData =\n pathwayCourseData?.code == \"PRGPYT\" || pathwayCourseData?.code == \"SPKENG\";\n\n return (\n <>\n \n \n \n \n \n \n \n \n {item?.pathway_name}\n \n \n \n \n \n Progress:\n {completedPortionJason}%\n \n \n \n \n\n {showUpcomingBatchData && upcomingBatchesData?.length > 0 && (\n <>\n \n Batch : {upcomingBatchesData[0].title}\n \n \n Upcoming Classes\n \n \n \n \n \n \n \n {upcomingBatchesData[0]?.sub_title}\n \n \n \n {upcomingBatchesData[0]?.type === \"batch\" && (\n \n )}\n \n \n \n {upcomingBatchesData[0]?.start_time &&\n format(upcomingBatchesData[0]?.start_time, \"dd MMM yy\")}\n \n \n \n\n \n >\n )}\n {\n history.push(\n interpolatePath(PATHS.PATHWAY_COURSE, {\n pathwayId: item.pathway_id,\n })\n );\n }}\n >\n Go to Track\n \n \n \n >\n );\n}\n\nexport default LearningTrackCard;\n","import React from \"react\";\nimport { Typography, Container } from \"@mui/material\";\nimport { Grid } from \"@mui/material\";\nimport LearningTrackCard from \"./LearningTrackCard\";\n\nfunction ReturningUserPage({ learningTracks }) {\n return (\n <>\n \n \n My Learning Tracks\n \n \n {learningTracks.map((item) => (\n \n ))}\n \n \n >\n );\n}\nexport default ReturningUserPage;\n","import React, { useEffect, useState } from \"react\";\nimport useStyles from \"./styles\";\nimport PathwayCard from \"../../pages/Home/PathwayCard\";\nimport { Container, Grid, Typography, useMediaQuery, Box } from \"@mui/material\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport ReturningUserPage from \"../ReturningUser/ReturningUserPage\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../services/api\";\nimport { versionCode } from \"../../constant\";\nimport { breakpoints } from \"../../theme/constant\";\nimport { PATHWAYS_INFO } from \"../../constant\";\nimport Loader from \"../../components/common/Loader\";\n\nconst NewUserDashbord = () => {\n const user = useSelector(({ User }) => User);\n const UserName = user.data.user.name;\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const classes = useStyles();\n const dispatch = useDispatch();\n const [learningTracks, setLearningTracks] = useState([]);\n const { loading, data } = useSelector((state) => state.PathwaysDropdow);\n\n // useEffect(() => {\n // dispatch(\n // pathwayActions.getPathwaysDropdown({\n // authToken: user,\n // })\n // );\n // }, [dispatch, user]);\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/ongoingTopic`,\n headers: {\n \"version-code\": versionCode,\n accept: \"application/json\",\n Authorization: user?.data?.token || \"\",\n },\n })\n .then((res) => {\n const data = res.data;\n setLearningTracks(res.data);\n })\n .catch((err) => {});\n }, []);\n\n const miscellaneousPathway = data?.pathways.filter((pathway) =>\n PATHWAYS_INFO.some((miscPathway) => pathway.name === miscPathway.name)\n );\n const pathwayData = data?.pathways\n .filter((pathway) => !miscellaneousPathway.includes(pathway))\n .concat(miscellaneousPathway);\n\n return (\n <>\n {loading ? (\n \n \n \n ) : learningTracks.length <= 0 ? (\n <>\n \n \n Hello, {UserName} 👋\n \n \n Please choose a learning track to begin!\n \n \n \n \n {pathwayData?.map((item) => (\n \n \n \n ))}\n \n \n >\n ) : (\n \n )}\n >\n );\n};\nexport default NewUserDashbord;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n team_fontNunito: {\n fontFamily: \"Nunito Sans\",\n fontWeight: \"700\",\n },\n team_alignRight: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-end\",\n },\n image: {\n width: \"352px\",\n height: \"284px\",\n },\n team_hrline: {\n width: \"160px\",\n height: \"5px\",\n margin: \"0\",\n },\n team_conainerLeft: {\n display: \"flex\",\n alignItems: \"center\",\n },\n team_conainerRight: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-end\",\n },\n team_button_box: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n team_button_box_mob: {\n // commented code is for button scroll feature\n display: \"flex\",\n // overflow: \"auto\",\n // whiteSpace: \"nowrap\",\n alignItems: \"center\",\n justifyContent: \"space-around\",\n },\n team_MobileSelector: {\n padding: \"10px 25px\",\n borderBottom: \"3px solid transparent\",\n cursor: \"pointer\",\n },\n team_selector: {\n padding: \"10px 35px\",\n borderBottom: \"3px solid transparent\",\n cursor: \"pointer\",\n },\n team_containerTopSpace: {\n marginTop: \"5rem\",\n padding: 0,\n },\n team_infoCardContaier: {\n marginTop: \"1rem\",\n display: \"flex\",\n flexWrap: \"wrap\",\n justifContent: \"space-between\",\n transition: \"all ease-in 0.2s\",\n pointerEvents: \"none\",\n marginBottom: \"32px\",\n },\n team_responsiveContainer: {\n marginTop: \"61px\",\n // marginTop: \"4rem\",\n padding: \"0\",\n },\n team_infoResponsiveContainer: {\n padding: \"0\",\n marginTop: \"1rem\",\n display: \"flex\",\n flexWrap: \"wrap\",\n justifContent: \"space-between\",\n transition: \"all ease-in 0.2s\",\n pointerEvents: \"none\",\n },\n team_descriptionPopup: {\n paddingTop: \"16px\",\n pointerEvents: \"all\",\n boxShadow:\n \"0px 4px 5px rgba(46, 46, 46, 0.06),0px 1px 10px rgba(46, 46, 46, 0.04), 0px 2px 4px rgba(46, 46, 46, 0.08)\",\n borderRadius: \"10px\",\n backgroundColor: \"#fff\",\n padding: \"0 16px\",\n width: \"300px\",\n textAlign: \"left\",\n zIndex: \"9\",\n border: \"2px solid #48a145\",\n boxSizing: \"border-box\",\n opacity: \"1\",\n },\n team_cardDetails: {\n position: \"relative\",\n border: \"none\",\n marginTop: \"32px\",\n marginBottom: \"16px\",\n cursor: \"pointer\",\n transition: \"all ease-in-out 0.2s\",\n pointerEvents: \"auto\",\n \"&:hover\": {\n cursor: \"pointer\",\n boxShadow: \"none\",\n opacity: \"1\",\n \"& $middle\": {\n opacity: \"92%\",\n backgroundColor: \"#3A8137\",\n },\n },\n },\n middle: {\n opacity: 0,\n position: \"absolute\",\n width: \"100%\",\n height: \"100%\",\n top: \"0%\",\n left: \"0%\",\n \"& hover\": {\n \"$ team_cardDetails\": {\n opacity: 0.3,\n },\n },\n },\n\n text: {\n color: \"#FFFFFF\",\n padding: \"16px\",\n },\n\n team_cardImg: {\n width: \"256px\",\n height: \"320px\",\n transition: \"all ease-in 0.2s\",\n boxSizing: \"content-box\",\n objectFit: \"cover\",\n },\n team_mobileCardImg: {\n width: \"100%\",\n height: \"312px\",\n transition: \"all ease-in 0.2s\",\n padding: \"0px\",\n boxSizing: \"content-box\",\n objectFit: \"cover\",\n },\n team_cardTitle: {\n fontWeight: \"bold\",\n },\n team_cardDescription: {\n color: \"#6D6D6D\",\n },\n team_socialIcon: {\n marginInline: \"0.5rem\",\n },\n team_popupDetails: {\n display: \"flex\",\n alignItems: \"center\",\n },\n team_btn1: { height: \"48px\", width: \"100%\" },\n team_btn: { height: \"48px\", width: \"250px\" },\n}));\n\nexport default useStyles;\n","import React, { useState, useEffect } from \"react\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport axios from \"axios\";\nimport { breakpoints } from \"../../theme/constant\";\nimport LinkedIn from \"../../components/common/SocialMediaIcons/LinkedIn\";\nimport Twitter from \"../../components/common/SocialMediaIcons/Twitter\";\nimport { Container, Grid, Typography, Button, Box } from \"@mui/material\";\nimport useStyles from \"./styles\";\n\nfunction shuffleArray(arr) {\n for (let i = arr.length - 1; i >= 0; i--) {\n const newIndex = Math.floor(Math.random() * (i + 1));\n [arr[i], arr[newIndex]] = [arr[newIndex], arr[i]];\n }\n return arr;\n}\n\nconst content = \"Awaiting content from team member\";\n\nconst Popup = (props) => {\n const classes = useStyles();\n return (\n \n \n \n {props.Name}\n \n {props.linkedin ? (\n \n \n \n ) : (\n <>>\n )}\n {props.twitter ? (\n \n \n \n ) : (\n <>>\n )}\n \n\n \n {props.Content}\n \n \n );\n};\n\nfunction Team() {\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const classes = useStyles();\n const [team, setTeam] = useState([]);\n const [members, setMembers] = useState({\n teamMembers: true,\n volunteers: false,\n exTeam: false,\n });\n\n useEffect(() => {\n axios({\n url: `https://navgurukul.github.io/tarabai-shinde/data/meraki_team.json`,\n })\n .then((res) => {\n setTeam(res.data);\n })\n .catch((err) => {});\n }, []);\n\n const condition = members.teamMembers\n ? \"teamMembers\"\n : members.volunteers\n ? \"volunteers\"\n : \"exTeam\";\n let teamMember = [];\n let supporters = [];\n let exTeam = [];\n\n const teamData = Object.values(team).filter((item) => {\n if (\n item.Association !== null &&\n item.Photo !== null &&\n item.Name !== null &&\n item.Content &&\n item.Content.length > 0 &&\n item.Designation !== null\n ) {\n if (item.Association === \"Volunteer\") {\n supporters.push(item);\n } else if (item.Association === \"Ex-Team\") {\n exTeam.push(item);\n } else {\n teamMember.push(item);\n }\n return item;\n }\n });\n\n const name = \"Awaiting Member's Name\";\n\n return (\n \n \n \n \n Meet the team of core members, a ton of volunteers, and past members\n that have made it all possible.\n \n\n \n Meraki aims to remain free for underserved communities in India. We\n have been fortunate to find passionate people sharing our goals and\n helping us build one of the best learning platforms out there.\n \n \n \n \n \n \n \n \n \n {\n setMembers({\n exTeam: false,\n volunteers: false,\n teamMembers: true,\n });\n }}\n variant=\"subtitle1\"\n className={\n !isActive ? classes.team_selector : classes.team_MobileSelector\n }\n style={\n members.teamMembers\n ? {\n fontWeight: \"bold\",\n borderBottom: \"3px solid #48a145\",\n }\n : { color: \"#9c9999\" }\n }\n >\n Core Team\n \n \n \n {\n setMembers({\n exTeam: false,\n teamMembers: false,\n volunteers: true,\n });\n }}\n variant=\"subtitle1\"\n className={\n !isActive ? classes.team_selector : classes.team_MobileSelector\n }\n style={\n members.volunteers\n ? {\n fontWeight: \"bold\",\n borderBottom: \"3px solid #48a145\",\n }\n : { color: \"#9c9999\" }\n }\n >\n Our Supporters\n \n \n \n {/* Commented code is containing & sowing the data of Ex-team members */}\n {/* \n {\n setMembers({\n exTeam: true,\n teamMembers: false,\n volunteers: false,\n });\n }}\n variant=\"subtitle1\"\n className={\n !isActive ? classes.team_selector : classes.team_MobileSelector\n }\n style={\n members.exTeam\n ? {\n fontWeight: \"bold\",\n borderBottom: \"3px solid #48a145\",\n }\n : { color: \"#9c9999\" }\n }\n >\n Ex-Team\n \n */}\n\n \n \n {teamData ? (\n shuffleArray(teamData).map((item) => {\n if (\n (condition === \"volunteers\" &&\n item.Association === \"Volunteer\") ||\n (condition === \"exTeam\" && item.Association === \"Ex-Team\") ||\n (condition === \"teamMembers\" &&\n item.Association !== \"Volunteer\" &&\n item.Association !== \"Ex-Team\")\n ) {\n return (\n \n \n \n \n \n {(item.Content.length && item.Content) || content}\n \n \n \n \n {item.Name}\n \n \n {item.Designation}\n \n \n );\n }\n })\n ) : (\n <>>\n )}\n \n \n \n \n );\n}\n\nexport default Team;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n underline: {\n width: \"65px\",\n marginBottom: \"35px\",\n },\n containerColor: {\n backgroundColor: \"#F5F5F5\",\n },\n typography: {\n marginBottom: \"200px\",\n // align: \"center\",\n },\n image: {\n margin: \"auto\",\n display: \"block\",\n maxWidth: \"100%\",\n maxHeight: \"100%\",\n },\n btnPartner: {\n alignItems: \"center\",\n },\n}));\nexport default useStyles;\n","import React from \"react\";\nimport { PATHS } from \"../../constant\";\nimport useStyles from \"./Styles\";\nimport Image from \"./assest/dicto.jpg\";\nimport axios from \"axios\";\nimport ArrowForwardIosIcon from \"@mui/icons-material/ArrowForwardIos\";\nimport { useState, useEffect } from \"react\";\nimport {\n Stack,\n Chip,\n Typography,\n Button,\n Container,\n Card,\n CardActions,\n Link,\n CardContent,\n Grid,\n IconButton,\n} from \"@mui/material\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../theme/constant\";\n\nconst OurPartner = () => {\n const classes = useStyles();\n const [partner, setPartner] = useState([]);\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n useEffect(() => {\n axios\n .get(\n \"https://navgurukul.github.io/tarabai-shinde/data/meraki_partners.json\"\n )\n .then((response) => {\n setPartner(response.data);\n })\n .catch((err) => {});\n }, []);\n\n return (\n <>\n \n \n \n \n Partners are ones who open the doors to quality education for our\n students\n \n \n Do you want to be a part and help out your students through\n Meraki? Look no further and make the move.\n \n \n \n \n Join as a Partner\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Amazon Future Engineer\n \n \n Amazon Future Engineer is a complete package of\n childhood-to-career program aimed at increasing access to\n computer science education for children and young adults from\n underserved and underrepresented communities. Amazon has\n partnered with Meraki to further our cause.\n \n \n \n Learn More {\" \"}\n \n \n \n \n \n \n \n \n Partner List{\" \"}\n \n \n {Object.keys(partner).map((item) => {\n return (\n \n {partner[item].Name !== null &&\n partner[item].OrganisationType !== null &&\n !partner[item].State !== null &&\n !partner[item].City !== null && (\n \n \n \n {partner[item].Name}\n \n {partner[item].OrganisationType === \"Non - Profit\" ? (\n \n ) : partner[item].OrganisationType === \"Government\" ? (\n \n ) : partner[item].OrganisationType ===\n \"Educational Institution\" ? (\n \n ) : partner[item].OrganisationType ===\n \"Community based organisation\" ? (\n \n ) : (\n \"\"\n )}\n \n \n {partner[item].Url !== \"NA\" &&\n partner[item].Url !== null && (\n \n \n \n \n \n )}\n \n \n )}\n \n );\n })}\n \n \n >\n );\n};\n\nexport default OurPartner;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n List: {\n display: \"flex\",\n marginTop: \"20px\",\n },\n\n paper: {\n width: \"430px\",\n },\n contentImg: {\n padding: 5,\n marginRight: 5,\n },\n contentNumber: {\n padding: \"8px\",\n },\n youtubeVideo: {\n width: \"100%\",\n margin: \"20px 0\",\n },\n heading: {\n margin: \"30px 0 10px 0\",\n },\n contentImage: {\n marginTop: \"32px\",\n maxWidth: \"100%\",\n },\n contentImageBox: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexWrap: \"wrap\",\n },\n\n contentImg: {\n padding: 5,\n marginRight: 5,\n },\n codeBackground: {\n background: \"#E5E5E5\",\n padding: 16,\n margin: \"15px 0\",\n borderRadius: \"8px\",\n },\n codeWrap: {\n whiteSpace: \"pre-wrap\",\n lineHeight: 27,\n },\n codeExampleImg: {\n marginRight: 10,\n },\n tableHead: {\n borderRight: \"none\",\n borderLeft: \"none\",\n borderTop: \"none\",\n borderBottom: \"2px solid #DEDEDE !important\",\n },\n option: {\n boxShadow:\n \"0px 1px 2px #48A145, 0px 2px 1px #48A145, 0px 1px 5px #48A145 !important\",\n },\n userSelectedCorrect: {\n border: \"2px solid #48A145\",\n background: \"#E9F5E9 !important\",\n },\n correctAnswer: {\n border: \"2px solid #48A145 !important\",\n },\n inCorrectAnswer: {\n border: \"2px solid #F44336 !important\",\n background: \"#FFE5E3 !important\",\n },\n greishOption: {\n border: \"2px solid #F5F5F5 !important\",\n background: \"#F5F5F5 !important\",\n },\n bottomRow: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n position: \"fixed !important\",\n zIndex: 100,\n bottom: \"0px\",\n background: \"#fff\",\n boxShadow:\n \"0px -1px 2px rgba(0, 0, 0, 0.06), 0px -2px 2px rgba(0, 0, 0, 0.04), 0px -1px 5px rgba(0, 0, 0, 0.08)\",\n },\n scrollContainer: {\n \"&::-webkit-scrollbar\": { display: \"none\" },\n overflowX: \"auto\",\n width: \"325px\",\n whiteSpace: \"nowrap\",\n },\n edit: {\n color: \"#000000\",\n },\n editField: {\n margin: \"10px 0px\",\n },\n textarea: {\n width: 529,\n margin: \"10px 0px\",\n padding: \"20px 10px\",\n border: \"1px solid #BDBDBD\",\n borderRadius: \"4px\",\n fontSize: \"1.125rem\",\n color: \"#2E2E2E\",\n fontFamily: \"Noto Sans\",\n resize: \"none\",\n outline: \"none\",\n \"&:focus\": {\n border: \"2px solid #48A145 !important\",\n },\n },\n mainHeader: {\n position: \"sticky\",\n },\n editingHeader: {\n position: \"sticky\",\n marginTop: 64,\n },\n editingHeaderMobile: {\n position: \"sticky\",\n marginTop: 104,\n },\n optionImg: {\n objectFit: \"cover\",\n width: \"100%\",\n height: \"140px\",\n borderRadius: \"8px\",\n },\n cursorA: {\n cursor: \"default !important\",\n },\n cursorP: {\n cursor: \"pointer !important\",\n },\n}));\n\nexport default useStyles;\n","import React, { useEffect, useState } from \"react\";\nimport { Grid, Typography, Box, Button, Paper, Stack } from \"@mui/material\";\nimport useStyles from \"../../styles\";\nimport get from \"lodash/get\";\nimport { Radio, Checkbox, FormControlLabel, RadioGroup } from \"@mui/material\";\nimport CancelIcon from \"@mui/icons-material/Cancel\";\nimport CheckCircleIcon from \"@material-ui/icons/CheckCircle\";\nimport DOMPurify from \"dompurify\";\n// import { fi } from \"date-fns/locale\";\nfunction UnsafeHTML(props) {\n const { html, Container, ...otherProps } = props;\n const sanitizedHTML = DOMPurify.sanitize(html);\n return (\n \n );\n}\n\nconst headingVarients = {};\n\n[Typography, \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"].forEach(\n (Name, index) =>\n (headingVarients[index + 1] = (data) => (\n \n ))\n);\n\nconst AssessmentContent = ({\n content,\n answer,\n setAnswer,\n setSolution,\n submit,\n solution,\n setSubmit,\n correct,\n index,\n setSubmitDisable,\n triedAgain,\n setTriedAgain,\n submitDisable,\n submitAssessment,\n type,\n setType,\n Partially_ans,\n setWrongAnswer,\n finalDesicion,\n}) => {\n const classes = useStyles();\n if (content.component === \"header\") {\n if (triedAgain > 1) {\n return headingVarients[content.variant](\n DOMPurify.sanitize(get(content, \"value\"))\n );\n }\n }\n\n if (content.component === \"text\") {\n const text = DOMPurify.sanitize(get(content, \"value\"));\n if (index === 0) {\n return (\n \n \n Output\n \n\n \n \n \n \n );\n }\n if (index === 2) {\n if (triedAgain > 1) {\n return (\n \n \n \n );\n } else {\n const Partially_retry = DOMPurify.sanitize(get(Partially_ans, \"value\"));\n return (\n <>\n {submit && finalDesicion && finalDesicion !== \"CORRECT\" ? (\n \n ) : (\n \"\"\n )}\n\n \n {/* \n {\n setTriedAgain(triedAgain + 1);\n submitAssessment();\n }}\n >\n \n See Answer & Explanation\n \n \n */}\n \n {\n setAnswer([]);\n setSubmit();\n setSubmitDisable();\n }}\n >\n Re-try \n \n \n \n >\n );\n }\n }\n }\n if (content.component === \"questionCode\") {\n const text = DOMPurify.sanitize(get(content, \"value\"));\n return (\n \n \n \n );\n }\n if (content.component === \"questionExpression\") {\n const text = DOMPurify.sanitize(get(content, \"value\"));\n return (\n \n );\n }\n if (content.component === \"image\") {\n const image = DOMPurify.sanitize(get(content, \"value\"));\n\n const isImage = image.match(/\\.(jpeg|jpg|gif|png)$/);\n\n if (isImage) {\n return ;\n }\n\n return (\n \n );\n }\n if (content.component === \"options\") {\n return (\n \n \n {Object.values(content.value).map((item, index) => {\n const text = DOMPurify.sanitize(item.value);\n const isChecked = answer?.includes(item.id);\n const isRadioChecked =\n answer?.length === 1 && answer?.includes(item.id);\n\n const isValuePresent = solution?.some(\n (sitem) => sitem.value === item.id\n );\n return (\n <>\n \n 1\n ? isValuePresent\n ? answer?.includes(item.id)\n ? classes.userSelectedCorrect\n : \"\" // classes.correctAnswer commented out to remove the green color from the correct answer after the 2nd attemt.we will retrive it once android will have the same.\n : answer?.includes(item.id)\n ? classes.inCorrectAnswer\n : \"\"\n : submit &&\n answer?.includes(item.id) &&\n classes.greishOption\n }\n >\n \n {}}\n checkedIcon={ }\n />\n ) : answer?.includes(item.id) &&\n triedAgain > 1 ? (\n \n ) : (\n {\n if (!submit) {\n setAnswer([item.id]);\n }\n }}\n />\n )\n ) : (\n {\n if (!submit) {\n setAnswer([item.id]);\n }\n }}\n />\n )\n ) : submit ? (\n answer?.includes(item.id) &&\n isValuePresent &&\n triedAgain > 1 ? (\n {}} //this is for not changing the state\n checkedIcon={ }\n className={\n submit ? classes.cursorA : classes.cursorP\n }\n />\n ) : answer?.includes(item.id) && triedAgain > 1 ? (\n \n ) : (\n {\n if (!submit) {\n const updatedAnswer = isChecked\n ? answer.filter((id) => id !== item.id)\n : [...answer, item.id];\n setAnswer(updatedAnswer);\n }\n }}\n className={\n submit ? classes.cursorA : classes.cursorP\n }\n />\n )\n ) : (\n {\n if (!submit) {\n const updatedAnswer = isChecked\n ? answer.filter((id) => id !== item.id)\n : [...answer, item.id];\n setAnswer(updatedAnswer);\n }\n }}\n className={\n submit ? classes.cursorA : classes.cursorP\n }\n />\n )\n }\n label={\n item.option_type !== \"image\" ? (\n \n ) : (\n \n )\n }\n />\n \n \n \n >\n );\n })}\n \n \n );\n }\n if (content.component === \"solution\") {\n setSolution(content?.correct_options_value);\n setType(content?.type);\n setWrongAnswer();\n }\n return \"\";\n};\nexport default AssessmentContent;\n","import React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { Container, Box, Button } from \"@mui/material\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../../../services/api\";\nimport { useParams } from \"react-router-dom\";\nimport AssessmentContent from \"./AssessmentContent\";\n\nfunction Assessment({\n data,\n exerciseId,\n exerciseSlugId,\n courseData,\n setCourseData,\n setProgressTrackId,\n res,\n triger,\n setTriger,\n lang,\n}) {\n const user = useSelector(({ User }) => User);\n\n const [answer, setAnswer] = useState([]);\n const [correct, setCorrect] = useState();\n const [solution, setSolution] = useState();\n const [submit, setSubmit] = useState();\n const [submitDisable, setSubmitDisable] = useState();\n const [status, setStatus] = useState();\n const [triedAgain, setTriedAgain] = useState(res?.attempt_count);\n const params = useParams();\n const [type, setType] = useState(\"single\");\n const [wrongAnswer, setWrongAnswer] = useState();\n\n // Assessment submit handler\n const isValuesCorrect = (value1, value2) => {\n if (value1?.length !== value2?.length) {\n return false; // Lengths are different, so they are not the same\n }\n\n for (let i = 0; i < value1?.length; i++) {\n if (!value2?.includes(value1[i]?.value)) {\n return false; // Elements are different, so they are not the same\n }\n }\n\n return true; // Length and elements match, so they are the same\n };\n\n const isCorrect = isValuesCorrect(solution, answer);\n\n const calculateSelections = () => {\n let correctSelections = 0;\n let incorrectSelections = 0;\n\n answer &&\n answer.forEach((option) => {\n const isCorrect = solution?.some(\n (correctOption) => correctOption?.value === option\n );\n if (isCorrect) {\n correctSelections++;\n } else {\n incorrectSelections++;\n }\n });\n\n return { correctSelections, incorrectSelections };\n };\n\n const { correctSelections, incorrectSelections } = calculateSelections();\n\n const submitAssessment = (isCorrect) => {\n const correctStr = isCorrect ? \"Pass\" : \"Fail\";\n setSubmit(true);\n\n // Commented this API to test if progress tracking is working fine now\n\n // axios({\n // method: METHODS.POST,\n // url: `${process.env.REACT_APP_MERAKI_URL}/progressTracking/learningTrackStatus`,\n // headers: {\n // accept: \"application/json\",\n // Authorization: user.data?.token || \"\",\n // },\n // data: {\n // pathway_id: params.pathwayId,\n // course_id: params.courseId,\n // exercise_id: courseData.id,\n // },\n // });\n if (isCorrect) {\n setTriedAgain(triedAgain + 2);\n } else {\n setTriedAgain(triedAgain + 1);\n }\n axios({\n method: METHODS.POST,\n url: `${process.env.REACT_APP_MERAKI_URL}/assessment/slug/complete`,\n headers: {\n accept: \"application/json\",\n Authorization:\n user?.data?.token || localStorage.getItem(\"studentAuthToken\"),\n },\n data: [\n {\n // assessment_id: exerciseId,\n slug_id: exerciseSlugId,\n selected_option: answer,\n status: correctStr,\n course_id: +params.courseId,\n lang: lang,\n },\n ],\n })\n .then((res) => {})\n .catch((err) => {});\n setCorrect(isCorrect);\n setStatus(correctStr);\n setSubmitDisable(true);\n setTriger(!triger);\n };\n\n console.log(data);\n useEffect(() => {\n // adding a nullish coalescing operator (??), so that the null value can not effect on the assessment.\n // if (res?.assessment_id === (courseData ?? {}).id) {\n if (res?.slug_id === (courseData ?? {}).slug_id) {\n if (res?.attempt_status === \"CORRECT\") {\n setAnswer(res?.selected_option);\n setCorrect(true);\n setTriedAgain(2);\n setStatus(\"pass\");\n setSubmitDisable(true);\n setSubmit(true);\n } else if (res?.attempt_status === \"INCORRECT\") {\n setAnswer(res?.selected_option);\n setTriedAgain(res?.attempt_count);\n setSubmitDisable(true);\n setSubmit(true);\n } else if (res?.attempt_status === \"PARTIALLY_CORRECT\") {\n setAnswer(res?.selected_option);\n setTriedAgain(res?.attempt_count);\n setSubmitDisable(true);\n setSubmit(true);\n } else if (res?.attempt_status === \"PARTIALLY_INCORRECT\") {\n setAnswer(res?.selected_option);\n setTriedAgain(res?.attempt_count);\n setSubmitDisable(true);\n setSubmit(true);\n }\n }\n }, [res, triedAgain]);\n\n // const handleOptionClick = (id) => {\n // if (!submitDisable) {\n // if (answer.includes(id)) {\n // // Item is already selected, so remove it\n // setAnswer(answer.filter((itemId) => itemId !== id));\n // } else {\n // // Item is not selected, so add it\n // setAnswer([...answer, id]);\n // }\n // }\n // };\n // console.log(\"data\", data);\n\n return (\n \n {data &&\n data.map((content) => (\n \n ))}\n\n \n \n Submit\n \n \n\n {data &&\n submit &&\n data?.map((content) => {\n let dataArr = [];\n if (\n data[2]?.type === \"single\" ||\n data[2]?.assessment_type === \"single\"\n ) {\n dataArr =\n content?.value && correct\n ? content?.value?.correct\n : content?.value?.incorrect;\n } else if (\n data[2]?.type === \"multiple\" ||\n data[2]?.assessment_type === \"multiple\"\n ) {\n dataArr =\n content?.value && res?.attempt_status === \"PARTIALLY_CORRECT\"\n ? content?.value?.partially_correct\n : content?.value &&\n res?.attempt_status === \"PARTIALLY_INCORRECT\"\n ? content?.value?.partially_incorrect\n : content?.value && res?.attempt_status === \"CORRECT\"\n ? content?.value?.correct\n : content?.value?.incorrect;\n }\n\n return (\n content?.component === \"output\" &&\n dataArr?.map((content, index) => (\n \n ))\n );\n })}\n \n );\n}\n\nexport default Assessment;\n","import { makeStyles } from \"@mui/styles\";\nimport { display } from \"@mui/system\";\n\nconst useStyles = makeStyles((theme) => ({\n cardGrid: {\n padding: \"10px 16px 10px 16px\",\n marginTop: \"20px\",\n },\n icons: {\n marginRight: \"15px\",\n position: \"flex-start\",\n },\n centere: {\n align: \"center\",\n },\n\n Button: {\n paddingRight: \"20px\",\n paddingBottom: \"10px\",\n },\n link: {\n textDecoration: \"none\",\n color: \"green\",\n cursor: \"pointer\",\n },\n MoreBatchWrap: {\n display: \"flex\",\n flexDirection: \"column\",\n padding: \"25px\",\n },\n MoreBatchCard: {\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n padding: \"20px 0\",\n minHeight: \"170px\",\n },\n ButtonInfo: {\n borderRedius: \"90px\",\n },\n FlexedContant: {\n display: \"flex\",\n },\n BatchEnroll2Box: {\n maxWidth: 500,\n mb: 10,\n pt: 3,\n height: 280,\n padding: \"15px\",\n },\n BatchEnroll2DateNDegree: {\n display: \"flex\",\n justifyContent: \"center\",\n padding: \"10px 0\",\n mb: 1,\n },\n ExerciseBatchClassCard: {\n maxWidth: 350,\n },\n EnrollInCourseBox1: {\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n width: \"100vw\",\n flexWrap: \"wrap\",\n marginTop: \"50px\",\n },\n EnrollInCourseBox2: {\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n flexWrap: \"wrap\",\n },\n EnrollInCourseCard: {\n align: \"right\",\n mt: 1,\n maxWidth: 370,\n mb: 10,\n },\n EnrollInCourseFormBox: {\n display: \"flex\",\n justifyContent: \"start\",\n },\n\n DoubtClassLangChip: {\n marginLeft: 10,\n borderRadius: 90,\n height: 30,\n },\n DropOut: {\n display: \"flex\",\n cursor: \"pointer\",\n justifyContent: \"center\",\n },\n DoubtClassInfoSections: {\n padding: \"16px\",\n marginTop: \"16px\",\n borderRadius: \"20px\",\n },\n NeedHelpBoxContant: {\n display: \"flex\",\n mb: 1,\n },\n ViewClassDetailButtonBox: {\n width: \"100%\",\n display: \"flex\",\n justifyContent: \"flex-end\",\n alignItems: \"center\",\n },\n RevisionClassEnrollBox: {\n marginTop: \"32px\",\n maxWidth: 350,\n align: \"right\",\n display: \"flex\",\n justifyContent: \"center\",\n },\n ReviseCardDates: {\n display: \"flex\",\n justifyContent: \"start\",\n },\n UnAvailableRevisionClass: {\n padding: \"8px\",\n marginBottom: \"35px\",\n },\n}));\n\nexport default useStyles;\n","import * as React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Dialog from \"@mui/material/Dialog\";\nimport DialogActions from \"@mui/material/DialogActions\";\nimport DialogContent from \"@mui/material/DialogContent\";\nimport { CircularProgress, Typography } from \"@mui/material\";\nimport useStyles from \"./styles\";\nimport axios from \"axios\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { toast } from \"react-toastify\";\nimport { format } from \"../../common/date\";\nimport { useParams } from \"react-router-dom\";\nimport { actions as enrolledBatchesActions } from \"../PathwayCourse/redux/action\";\nimport { actions as upcomingClassActions } from \"../PathwayCourse/redux/action\";\n\nexport default function AlertDialog(props) {\n const classes = useStyles();\n const {\n open,\n close,\n title,\n start_time,\n end_time,\n id,\n registerAll,\n exerciseReload,\n setIsEnrolled,\n type,\n reloadContent,\n } = props;\n\n const user = useSelector(({ User }) => User);\n const params = useParams();\n const pathwayId = params.pathwayId;\n const dispatch = useDispatch();\n const [loading, setLoading] = React.useState(false);\n const handelEnrollment = (Id) => {\n setLoading(true);\n axios\n .post(\n `${\n process.env.REACT_APP_MERAKI_URL\n }/classes/${Id}/register?register-all=${registerAll || false}`,\n {},\n {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: user.data.token,\n },\n }\n )\n .then(() => {\n toast.success(\"Class Enrolled\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n autoClose: 2500,\n });\n setLoading(false);\n\n close();\n if (registerAll) {\n dispatch(\n enrolledBatchesActions.getEnrolledBatches({\n pathwayId: pathwayId,\n authToken: user?.data?.token,\n })\n );\n dispatch(\n upcomingClassActions.getupcomingEnrolledClasses({\n pathwayId: pathwayId,\n authToken: user?.data?.token,\n })\n );\n } else if (setIsEnrolled) {\n setIsEnrolled(true);\n }\n reloadContent && reloadContent();\n })\n .catch((err) => {\n setLoading(false);\n toast.error(\"Failed To Enroll To Class\", {\n position: toast.POSITION.BOTTOM_RIGHT,\n autoClose: 2500,\n });\n close();\n });\n };\n const dialougContentMap = {\n batch: [\n \"Awesome! You have taken the first step to being a programmer\",\n \"Batch: \" + title,\n ],\n DoubtClass: [\"Doubt Class\", \"Class : \" + title],\n RevisionClass: [\"Revision Class\", \"From: \" + title],\n };\n return (\n \n
\n \n <>\n \n {dialougContentMap[type][0]}\n \n \n {dialougContentMap[type][1]}\n \n >\n \n \n {start_time ? format(start_time, \"dd MMM yy\") : \"\"} , {\" \"}\n {start_time ? format(start_time, \"hh:mm aaa\") : \"\"}-{\" \"}\n {end_time ? format(end_time, \"hh:mm aaa\") : \"\"}\n \n \n \n \n Back\n \n {\n handelEnrollment(id);\n }}\n variant=\"contained\"\n >\n {loading ? (\n \n ) : (\n \" Confirm Enrollment\"\n )}\n \n \n \n
\n );\n}\n","import React from \"react\";\nimport { useEffect, useState } from \"react\";\nimport { Container, Typography } from \"@mui/material\";\nimport { CardContent, Card, Button } from \"@mui/material\";\nimport { Box } from \"@mui/system\";\nimport axios from \"axios\";\nimport useStyles from \"../styles\";\nimport { useSelector } from \"react-redux\";\nimport { METHODS } from \"../../../services/api\";\nimport Radio from \"@mui/material/Radio\";\nimport RadioGroup from \"@mui/material/RadioGroup\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport FormControl from \"@mui/material/FormControl\";\nimport { format } from \"../../../common/date\";\nimport AlertDialog from \"../AlertDialog\";\nimport ExerciseBatchClass from \"../ExerciseBatchClass/ExerciseBatchClass\";\nimport DropOut from \"../DropOut\";\nconst NoRevisionClassImage = require(\"./assets/NoRevision.svg\");\nfunction RevisionClassEnroll(props) {\n const classes = useStyles();\n const user = useSelector(({ User }) => User);\n const { id } = props;\n const [revisionData, setRevisionData] = useState([]);\n const [revisionId, setRevisionId] = useState(null);\n const [open, setOpen] = useState(false);\n const close = () => [setOpen(false)];\n const [DataToEnroll, setDataToEnroll] = useState(null);\n const [dropOutOpen, setDropOutOpen] = useState(false);\n const closeDropOut = () => [setDropOutOpen(false)];\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/classes/${id}/revision`,\n headers: {\n accept: \"application/json\",\n Authorization: user?.data?.token,\n },\n })\n .then((res) => {\n // setUserEnrolledClasses(res.data);\n const data = res.data;\n setRevisionData(data);\n setDataToEnroll(data[0]);\n })\n .catch((err) => {});\n }, [dropOutOpen, open]);\n return (\n \n \n {DataToEnroll?.is_enrolled ? (\n <>\n \n {\n setDropOutOpen(true);\n }}\n >\n Can`t attend ?\n {\" \"}\n \n >\n ) : revisionData.length > 0 ? (\n \n \n \n Missed the class or need to revise? Enroll in a class from\n another batch\n \n \n \n \n {revisionData.map((item) => {\n return (\n {\n setRevisionId(e.target.value);\n setDataToEnroll(item);\n }}\n control={ }\n // you can put your value using {} <- this\n label={`${format(\n item.start_time,\n \"dd MMM yy\"\n )}, ${format(\n item.start_time,\n \"hh:mm aaa\"\n )} - ${format(item.end_time, \"hh:mm aaa\")}`}\n />\n );\n })}\n \n \n \n {\n setOpen(true);\n }}\n variant=\"contained\"\n fullWidth\n >\n Enroll\n \n \n \n \n ) : (\n <>\n \n \n {/* */}\n \n Looks like there are no revision class. We will keep looking for\n them and inform you as they come\n \n {/* */}\n \n >\n )}\n \n \n );\n}\n\nexport default RevisionClassEnroll;\n","import React, { useState, useEffect } from \"react\";\nimport { isBeforeNow, millisecondsUntil } from \"../../../common/date\";\n\n/**\n * Shows the future (React) element before the given date, past element after,\n * updating what's shown from the future to the past, if the time passes\n * when the user is viewing this component.\n * @param {ReactElement=} future the element to show before date, if any\n * @param {ReactElement=} past the element to show after date, if any\n * @param {Date|string=} date Valid Date string recognized by formatInTimeZone\n * (https://www.npmjs.com/package/date-fns-tz#formatintimezone)\n * or Date for which to base which Component to show, defaults to now\n */\nfunction FutureOrPast({ future = \"\", past = \"\", date = new Date() }) {\n const [isInFuture, setIsInFuture] = useState(!isBeforeNow(date));\n\n useEffect(() => {\n const msUntilDate = millisecondsUntil(date);\n setIsInFuture(!isBeforeNow(date));\n // Don't set timer if it's too far in future:\n // https://developer.mozilla.org/en-US/docs/Web/API/setTimeout#maximum_delay_value\n if (isInFuture && msUntilDate <= 2 ** 31 - 1) {\n const timer = setTimeout(() => {\n setIsInFuture(false);\n }, msUntilDate);\n return () => clearTimeout(timer); // cleans up on unmount\n }\n }, [date]);\n\n return isInFuture ? future : past;\n}\n\nexport default FutureOrPast;\n","import React, { useState } from \"react\";\nimport { Container, CardContent, Card, Typography, Box } from \"@mui/material\";\nimport useStyles from \"../styles\";\nimport { format } from \"../../../common/date\";\nimport RevisionClassEnroll from \"../Revision/RevisionClassEnroll\";\nimport FutureOrPast from \"../../common/FutureOrPast\";\nimport ClassJoinTimerButton from \"../../Class/ClassJoinTimerButton\";\n\nconst ExerciseBatchClass = (props) => {\n const classes = useStyles();\n const [dropOutOpen, setDropOutOpen] = useState(false);\n const { facilitator, start_time, end_time, is_enrolled, meet_link, id } =\n props;\n const closeDropOut = () => {\n setDropOutOpen(false);\n };\n\n return (\n \n \n \n \n \n \n {format(start_time, \"dd MMM yy\")},{\" \"}\n {format(start_time, \"hh:mm aaa\")} -{\" \"}\n {format(end_time, \"hh:mm aaa\")}\n \n \n {\" \"}\n \n {facilitator}\n \n \n Please join at least 10 mintues before the scheduled time\n \n \n \n \n \n \n }\n past={ }\n />\n );\n};\n\nexport default ExerciseBatchClass;\n","import React, { useEffect, useState } from \"react\";\nimport { CardContent, Card, Button, Typography } from \"@mui/material\";\nimport { Box } from \"@mui/system\";\nimport useStyles from \"../styles\";\nimport { useSelector } from \"react-redux\";\nimport Radio from \"@mui/material/Radio\";\nimport RadioGroup from \"@mui/material/RadioGroup\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport FormControl from \"@mui/material/FormControl\";\nimport { format } from \"../../../common/date\";\nimport AlertDialog from \"../AlertDialog.js\";\nimport { METHODS } from \"../../../services/api\";\nimport axios from \"axios\";\nimport { useParams } from \"react-router-dom\";\n\nconst NotEnrolledSvg = require(\"./notEnrolled.svg\");\n\nconst CourseEnroll = (props) => {\n const classes = useStyles();\n const params = useParams();\n const user = useSelector(({ User }) => User);\n const upcomingBatchesData = useSelector((state) => {\n return state.Pathways?.upcomingBatches?.data;\n });\n\n\n const { reloadContent } = props;\n const pathwayId = params.pathwayId;\n const data = upcomingBatchesData?.slice(0, 3).map((item) => {\n return {\n id: item.id,\n title: item.title,\n startTime: item.start_time,\n endTime: item.end_time,\n };\n });\n const [selectedBatchToEnroll, setSelectedBatchToEnroll] = useState(\n data && data[0]\n );\n useEffect(() => {}, [selectedBatchToEnroll]);\n const [open, setOpen] = useState(false);\n const close = () => {\n setOpen(false);\n };\n\n return (\n <>\n \n \n \n \n \n \n \n It seems you are not part of a batch. Please enroll in a batch\n to attend the live classes.\n \n \n \n \n {data?.map((item) => {\n return (\n <>\n {\n setSelectedBatchToEnroll(item);\n }}\n key={item.id}\n value={item.id}\n control={ }\n label={{item?.title} }\n />\n \n {format(item?.startTime, \"dd MMM yy\")} -\n {format(item?.endTime, \"dd MMM yy\")}\n \n >\n );\n })}\n \n \n \n {\n setOpen(true);\n }}\n >\n Enroll\n \n \n \n \n \n \n \n >\n );\n};\nexport default CourseEnroll;\n","import React, { useState } from \"react\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { Typography, Chip } from \"@mui/material\";\nimport { Button } from \"@mui/material\";\nimport { Box } from \"@mui/system\";\nimport useStyles from \"./styles\";\nimport { breakpoints } from \"../../theme/constant\";\nimport ArrowForwardIosIcon from \"@mui/icons-material/ArrowForwardIos\";\nimport SwipeableDrawer from \"@mui/material/SwipeableDrawer\";\nimport { lang, TimeLeft } from \"../../constant\";\nimport { format } from \"../../common/date\";\nimport AlertDialog from \"./AlertDialog\";\nimport DropOut from \"./DropOut\";\n\nexport const MoreDetails = (props) => {\n const { open, setOpen, isEnrolled, setIsEnrolled } = props;\n\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const classes = useStyles();\n const { actions, value } = props;\n const toggleDrawer = (changeTo) => (event) => {\n if (\n event &&\n event.type === \"keydown\" &&\n (event.key === \"Tab\" || event.key === \"Shift\")\n ) {\n return;\n }\n\n setOpen(changeTo);\n };\n const [ConfirmationOpen, setConfirmationOpen] = useState(false);\n\n const [openDropOut, setOpenDropOut] = useState(false);\n const anchorPos = \"right\";\n const close = () => {\n setConfirmationOpen(false);\n };\n let [TimeLefts, setTimeLefts] = useState(TimeLeft(actions.start_time));\n var ONE_MINUTE = 60 * 1000;\n setInterval(() => {\n setTimeLefts(TimeLeft(actions.start_time));\n }, ONE_MINUTE);\n const closeDropOut = () => {\n setOpenDropOut(false);\n };\n return (\n \n
\n \n \n \n Doubt Class\n \n \n {actions?.title}\n \n \n \n\n \n \n \n Clear your doubts related to the first class of Python and other\n queries during your studies\n \n \n \n {actions?.start_time\n ? format(actions?.start_time, \"dd MMM yy\")\n : \"\"}\n ,\n {actions?.start_time\n ? format(actions?.start_time, \"hh:mm aaa\")\n : \"\"}{\" \"}\n -{actions?.end_time ? format(actions?.end_time, \"hh:mm aaa\") : \"\"}\n \n \n {\" \"}\n \n {actions?.facilitator_name}\n \n \n Please join at least 10 mintues before the scheduled time\n \n {isEnrolled ? (\n <>\n {TimeLefts == \"joinNow\" ? (\n \n \n Join Now\n \n \n ) : (\n \n Starts in {TimeLefts}\n \n )}\n \n {\n setOpenDropOut(true);\n }}\n variant=\"body2\"\n color=\"error.main\"\n className={classes.DropOut}\n >\n can`t attend?\n {\" \"}\n >\n ) : (\n setConfirmationOpen(true)}\n >\n Enroll\n \n )}\n \n \n \n
\n
\n );\n};\n\nconst ClassDetails = ({ setOpen, isActive }) => {\n return (\n \n }\n onClick={() => {\n setOpen(true);\n }}\n sx={{\n width: isActive ? \"90%\" : \"215px\",\n display: \"flex\",\n justifyContent: \"flex-end\",\n }}\n >\n View Class Details\n \n
\n );\n};\n\nconst DoubtClassExerciseComponent = (props) => {\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const classes = useStyles();\n const { actions, value } = props;\n const [open, setOpen] = useState(false);\n const [isEnrolled, setIsEnrolled] = useState(actions?.is_enrolled);\n return !isEnrolled ? (\n <>\n \n \n {\" \"}\n \n Need help? We got you covered. Enroll in the doubt class on{\" \"}\n {format(actions?.start_time, \"dd MMM yy\")}\n at {format(actions?.start_time, \"hh:mm aaa\")} -{\" \"}\n {format(actions?.end_time, \"hh:mm aaa\")}\n \n\n \n {/* \n }\n onClick={() => {\n setOpen(true);\n }}\n >\n View Class Details\n \n
*/}\n {/* */}\n \n \n >\n ) : (\n <>\n \n <>\n \n \n Upcoming Doubt Class\n \n \n \n {format(actions?.start_time, \"dd MMM yy\")}\n at {format(actions?.start_time, \"hh:mm aaa\")} -{\" \"}\n {format(actions?.end_time, \"hh:mm aaa\")}\n \n {/* {actions.facilitator_name} */}\n \n \n {/* \n }\n onClick={() => {\n setOpen(true);\n }}\n width={isActive ? \"90%\" : \"215px\"} >\n View Class Details\n \n
*/}\n \n >\n >\n );\n};\nexport default DoubtClassExerciseComponent;\n","import { Box, Chip, Typography } from \"@mui/material\";\nimport React from \"react\";\n// import { TimeLeft } from \"../../../constant\";\nimport { format } from \"../../../common/date\";\nimport FutureOrPast from \"../../common/FutureOrPast\";\nimport { breakpoints } from \"../../../theme/constant\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\n\nfunction ClassTopic({ courseData }) {\n const languageMap = {\n hi: \"Hindi\",\n en: \"English\",\n te: \"Telugu\",\n ta: \"Tamil\",\n mr: \"Marathi\",\n };\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n return (\n <>\n \n \n {courseData.sub_title || courseData.title}\n \n \n \n \n \n \n \n Clear your doubts related to the first class of Python and other\n queries during your studies\n \n \n \n \n If you miss the class or need to revise, you can enroll in an extra\n class to catch up after {format(courseData.start_time, \"dd MMM yy\")}\n \n \n \n \n \n \n \n\n \n Completed on {format(courseData.start_time, \"dd MMM yy\")}\n \n \n \n }\n />\n \n >\n );\n}\n\nexport default ClassTopic;\n","import { Box, Container, Grid, Skeleton, Typography } from \"@mui/material\";\nimport React from \"react\";\n\nfunction ExerciseContentLoading() {\n return (\n \n \n \n \n \n \n \n \n {/* create skeleton for text */}\n {[1, 1, 1, 6, 4, 4, 8, 3, 4].map((item, index) => (\n \n \n \n \n ))}\n \n \n \n \n );\n}\n\nexport default ExerciseContentLoading;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n //For desktop only\n DesktopDrawer: {\n width: (props) => props.drawerWidth,\n flexShrink: 0,\n \"& .MuiDrawer-paper\": {\n width: (props) => props.drawerWidth,\n boxSizing: \"border-box\",\n },\n overflow: \"hidden\",\n \"& ::-webkit-scrollbar\": { display: \"none\" },\n zIndex: 0,\n },\n\n //For both desktop and mobile\n ListItemsTypography: {\n fontSize: \"14px\",\n lineHeight: \"21px\",\n textDecoration: \"none\",\n },\n ListItemLink: {\n textDecoration: \"none\",\n fontSize: \"14px\",\n width: \"100%\",\n },\n courseNameTypography: {\n fontWeight: \"400\",\n },\n\n //Content List text\n ContentListDiv: {\n display: \"flex\",\n alignItems: \"center\",\n cursor: \"pointer\",\n left: \"24px\",\n marginLeft: \"10px\",\n marginTop: \"200px\",\n },\n ContentListIcon: {\n color: \"#6D6D6D\",\n width: \"20px\",\n height: \"28px\",\n },\n}));\n\nexport default useStyles;\n","import * as React from \"react\";\nimport Box from \"@mui/material/Box\";\nimport Drawer from \"@mui/material/Drawer\";\nimport List from \"@mui/material/List\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItem from \"@mui/material/ListItem\";\nimport { Typography, useMediaQuery } from \"@mui/material\";\nimport { Link, useParams } from \"react-router-dom\";\nimport { interpolatePath, PATHS } from \"../../../../constant\";\nimport useStyles from \"./styles\";\nimport AssignmentOutlinedIcon from \"@mui/icons-material/AssignmentOutlined\";\nimport ArrowRightAltIcon from \"@mui/icons-material/ArrowRightAlt\";\nfunction Item({\n progressTrackId,\n setSelected,\n selected,\n index,\n ref1,\n setExerciseId,\n classes,\n params,\n contentType,\n id,\n title,\n visitedExercises,\n setVisitedExercises,\n}) {\n const [completed, setCompleted] = React.useState(false);\n\n const isVisited = visitedExercises.includes(id);\n const itemStyle = {\n color: isVisited\n ? \"#48A145\"\n : selected === index || completed\n ? \"#48A145\"\n : \"#6D6D6D\",\n fontWeight: selected === index ? \"bold\" : \"\",\n textDecoration: \"none\",\n };\n\n React.useEffect(() => {\n if (\n contentType === \"assessment\" &&\n progressTrackId?.assessments?.includes(id)\n ) {\n setCompleted(true);\n } else if (\n contentType === \"class_topic\" &&\n progressTrackId?.classes?.includes(id)\n ) {\n setCompleted(true);\n } else if (\n contentType === \"exercise\" &&\n progressTrackId?.exercises?.includes(id)\n ) {\n setCompleted(true);\n }\n }, [progressTrackId, id, contentType]);\n\n const handleClick = () => {\n setSelected(index);\n setExerciseId(index);\n if (contentType === \"exercise\") {\n setVisitedExercises((prev) => {\n if (!prev.includes(id)) {\n const updated = [...prev, id];\n localStorage.setItem(\"visitedExercises\", JSON.stringify(updated));\n return updated;\n }\n return prev;\n });\n }\n };\n\n return (\n \n \n \n \n {selected === index && (\n \n )}\n {index + 1 + \". \"}\n {title === \"assessment\" ? \"Practice Question\" : title}\n \n \n \n \n );\n}\n\nfunction PersistentDrawerLeft({\n list,\n setSelected,\n setExerciseId,\n progressTrackId,\n courseTitle,\n}) {\n const [visitedExercises, setVisitedExercises] = React.useState(() => {\n const stored = localStorage.getItem(\"visitedExercises\");\n return stored ? JSON.parse(stored) : [];\n });\n\n // const [selected, setSelectedState] = React.useState(\n // parseInt(localStorage.getItem(lastSelectedExercise_${params.courseId})) || parseInt(params.exerciseId)\n // );\n\n const desktop = useMediaQuery(\"(min-width: 1050px)\");\n const laptop = useMediaQuery(\"(min-width: 1000px)\");\n const params = useParams();\n const courseName = courseTitle.toUpperCase();\n const drawerWidth = desktop ? 260 : laptop ? 160 : 160;\n const selected = parseInt(params.exerciseId);\n const classes = useStyles({ desktop, laptop, drawerWidth });\n\n const ref1 = React.useRef();\n React.useEffect(() => {\n if (ref1.current) {\n ref1.current.scrollIntoView({\n block: \"center\",\n });\n }\n }, [selected]);\n\n // React.useEffect(() => {\n // if (ref1.current) {\n // ref1.current.scrollIntoView({\n // block: \"center\",\n // });\n // }\n // }, [selected]);\n\n // const handleExerciseSelect = (index) => {\n // setSelectedState(index);\n // setExerciseId(index);\n // localStorage.setItem(lastSelectedExercise-${params.courseId}, index);\n // };\n\n return (\n \n \n \n
\n {/* \n \n */}\n \n
\n \n \n \n \n {courseName}\n \n \n \n {list?.map((obj, index) => (\n \n ))}\n
\n
\n \n \n );\n}\nexport default PersistentDrawerLeft;\n","import * as React from \"react\";\nimport { Link, useParams } from \"react-router-dom\";\nimport { interpolatePath, PATHS } from \"../../../../constant\";\nimport Box from \"@mui/material/Box\";\nimport CssBaseline from \"@mui/material/CssBaseline\";\nimport Divider from \"@mui/material/Divider\";\nimport Drawer from \"@mui/material/Drawer\";\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport Toolbar from \"@mui/material/Toolbar\";\nimport Typography from \"@mui/material/Typography\";\nimport { useMediaQuery } from \"@mui/material\";\nimport ArrowRightAltIcon from \"@mui/icons-material/ArrowRightAlt\";\nimport useStyles from \"./styles\";\n\nconst drawerWidth = 240;\n\nfunction Item({\n progressTrackId,\n selected,\n index,\n setOpen,\n setSelected,\n setExerciseId,\n classes,\n params,\n contentType,\n id,\n ref1,\n title,\n}) {\n const [completed, setCompleted] = React.useState(false);\n\n const ItemStyle = {\n color: selected === index || completed ? \"#48A145\" : \"#6D6D6D\",\n fontWeight: selected === index ? \"bold\" : \"\",\n };\n const clickOnTitle = (index) => () => {\n setSelected(index);\n setOpen(false);\n };\n React.useEffect(() => {\n if (contentType === \"assessment\") {\n if (progressTrackId?.assessments?.includes(id)) {\n setCompleted(true);\n }\n } else if (contentType === \"class_topic\") {\n if (progressTrackId?.classes?.includes(id)) {\n setCompleted(true);\n }\n } else if (contentType === \"exercise\") {\n if (progressTrackId?.exercises?.includes(id)) {\n setCompleted(true);\n }\n }\n }, [progressTrackId]);\n\n return (\n <>\n \n \n {\n setSelected(index);\n setExerciseId(index);\n }}\n >\n \n {selected === index ? (\n \n ) : (\n \"\"\n )}\n {index + 1 + \". \"}\n {title === \"assessment\" ? \"Practice Question\" : title}\n \n \n \n \n >\n );\n}\n\nfunction MobileDrawer(props) {\n const desktop = useMediaQuery(\"(min-width: 1050px)\");\n const laptop = useMediaQuery(\"(min-width: 1000px)\");\n const params = useParams();\n const {\n window,\n setSelected,\n list,\n open,\n setOpen,\n setExerciseId,\n progressTrackId,\n } = props;\n //const [mobileOpen, setMobileOpen] = React.useState(false);\n const selected = parseInt(params.exerciseId);\n const classes = useStyles({ desktop, laptop, drawerWidth });\n const ref1 = React.useRef();\n React.useEffect(() => {\n if (ref1.current) {\n ref1.current.scrollIntoView({\n block: \"center\",\n });\n }\n }, []);\n\n const handleDrawerToggle = () => {\n setOpen((prev) => !prev);\n };\n\n const drawer = (\n \n
\n
\n
\n {list?.map((obj, index) => (\n \n ))}\n
\n
\n );\n\n const container =\n window !== undefined ? () => window().document.body : undefined;\n\n return (\n \n \n \n {/* The implementation can be swapped with js to avoid SEO duplication of links. */}\n \n {drawer}\n \n \n \n );\n}\n\nexport default MobileDrawer;\n","import React from \"react\";\nimport { Typography } from \"@mui/material\";\nimport AssignmentOutlinedIcon from \"@mui/icons-material/AssignmentOutlined\";\nimport useStyles from \"./styles\";\n\nexport default function ContentListText(props) {\n const { setOpenDrawer } = props;\n const textStyle = { color: \"#6D6D6D\", fontSize: \"12px\", marginLeft: \"8px\" };\n const classes = useStyles();\n\n return (\n setOpenDrawer(true)} className={classes.ContentListDiv}>\n
\n
\n CONTENT LIST\n \n
\n );\n}\n","import React, { useEffect, useState, useMemo, useRef } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { METHODS } from \"../../../services/api\";\nimport axios from \"axios\";\nimport get from \"lodash/get\";\nimport YouTube from \"react-youtube\";\nimport DOMPurify from \"dompurify\";\nimport { useParams } from \"react-router-dom\";\nimport CircleIcon from \"@mui/icons-material/Circle\";\nimport { getCourseContent } from \"../../../components/Course/redux/api\";\n// import { actions as courseActions } from \"../../../components/Course/redux/action\";\nimport { actions as enrolledBatchesActions } from \"../../PathwayCourse/redux/action\";\nimport { breakpoints } from \"../../../theme/constant\";\n\nimport Assessment from \"../ExerciseContent/Assessment\";\nimport {\n TableRow,\n TableHead,\n TableCell,\n TableBody,\n Table,\n TableContainer,\n Typography,\n Container,\n Box,\n Button,\n Grid,\n useMediaQuery,\n} from \"@mui/material\";\n\n// import HiddenContent from \"../HiddenContent\";\nimport { versionCode } from \"../../../constant\";\n\nimport useStyles from \"../styles\";\nimport ExerciseBatchClass from \"../../BatchClassComponents/ExerciseBatchClass/ExerciseBatchClass\";\nimport CourseEnroll from \"../../BatchClassComponents/EnrollInCourse/EnrollInCourse\";\nimport DoubtClassExerciseComponent from \"../../BatchClassComponents/DoubtClassExerciseComponent\";\nimport RevisionClassEnroll from \"../../BatchClassComponents/Revision/RevisionClassEnroll\";\nimport { actions as upcomingBatchesActions } from \"../..//PathwayCourse/redux/action\";\n// import { actions as upcomingClassActions } from \"../../PathwayCourse/redux/action\";\nimport ClassTopic from \"../ClassTopic/ClassTopic\";\nimport ExerciseContentLoading from \"./ExerciseContentLoading\";\nimport PersistentDrawerLeft from \"./Drawers/Drawer\";\nimport MobileDrawer from \"./Drawers/MobileDrawer\";\nimport ContentListText from \"./Drawers/ContentListText\";\n\nconst createVisulizeURL = (code, lang, mode) => {\n // only support two languages for now\n const l = lang == \"python\" ? \"2\" : \"js\";\n const replacedCode = code && code.replace(/ /g, \"\\n\");\n const visualizerCode = replacedCode.replace(/ /g, \" \");\n const url = `http://pythontutor.com/visualize.html#code=${encodeURIComponent(\n visualizerCode\n )\n .replace(/%2C|%2F/g, decodeURIComponent)\n .replace(/\\(/g, \"%28\")\n .replace(\n /\\)/g,\n \"%29\"\n )}&cumulative=false&curInstr=0&heapPrimitives=nevernest&mode=${mode}&origin=opt-frontend.js&py=${l}&rawInputLstJSON=%5B%5D&textReferences=false`;\n return url;\n};\n\nfunction UnsafeHTML(props) {\n const { html, Container, ...otherProps } = props;\n const sanitizedHTML = DOMPurify.sanitize(html);\n return (\n \n );\n}\n\nconst headingVarients = {};\n\n[Typography, \"h2\", \"h3\", \"h4\", \"h5\", \"h6\"].forEach(\n (Name, index) =>\n (headingVarients[index + 1] = (data) => (\n \n // \n ))\n);\n\nconst RenderDoubtClass = ({ data, exercise }) => {\n const params = useParams();\n const pathwayId = params.pathwayId;\n const classes = useStyles();\n if (data?.component === \"banner\") {\n const value = data.value;\n const actions = JSON.parse(data.actions[0].data);\n const { start_time, end_time } = actions;\n return (\n \n {start_time && end_time && (\n <>\n
\n\n
\n >\n )}\n
\n );\n }\n return null;\n};\n\nconst RenderContent = ({ data, exercise, pathwayData }) => {\n const classes = useStyles();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const playerRef = useRef(null);\n\n const videoId = data.value.includes(\"=\")\n ? data.value.split(\"=\")[1]\n : data.value;\n\n const [isPlaying, setIsPlaying] = useState(false);\n const [allowedTime, setAllowedTime] = useState(0);\n\n const onReady = (event) => {\n playerRef.current = event.target;\n };\n\n const onStateChange = (event) => {\n if (event.data === window.YT.PlayerState.PLAYING) {\n setIsPlaying(true);\n } else {\n setIsPlaying(false);\n }\n };\n\n useEffect(() => {\n let intervalId;\n\n if (isPlaying) {\n intervalId = setInterval(() => {\n if (playerRef.current) {\n const currentTime = playerRef.current.getCurrentTime();\n if (currentTime > allowedTime + 5) {\n // Allow a 5-second buffer\n playerRef.current.seekTo(allowedTime);\n } else {\n setAllowedTime(currentTime);\n }\n }\n }, 1000);\n } else if (intervalId) {\n clearInterval(intervalId);\n }\n\n return () => clearInterval(intervalId);\n }, [isPlaying, allowedTime]);\n\n const opts = {\n height: \"390\",\n width: \"640\",\n playerVars: {\n controls: 1, // Disable default controls\n disablekb: 1, // Disable keyboard controls\n },\n };\n\n if (data.component === \"header\") {\n return (\n \n {headingVarients[data.variant](DOMPurify.sanitize(get(data, \"value\")))}\n \n );\n }\n if (data.component === \"image\") {\n return (\n <>\n \n \n \n >\n );\n }\n if (data.component === \"youtube\") {\n const videoId = data.value.includes(\"=\")\n ? data.value.split(\"=\")[1]\n : data.value;\n return pathwayData?.code !== \"TCBPI\" ? (\n \n ) : (\n \n );\n }\n if (data.component === \"text\") {\n const text = DOMPurify.sanitize(get(data, \"value\"));\n if (data.decoration && data.decoration.type === \"bullet\") {\n return (\n \n \n \n \n );\n }\n if (data.decoration && data.decoration.type === \"number\") {\n return (\n \n \n \n \n );\n } else {\n return (\n \n );\n }\n }\n if (data.component === \"table\") {\n const allData = data.value.map((item) => item.items);\n const dataInCol = allData[0].map((_, i) =>\n allData.map((_, j) => allData[j][i])\n );\n return (\n \n \n \n \n {data.value.map((item, idx) => {\n const header = DOMPurify.sanitize(item.header);\n return (\n \n );\n })}\n \n \n \n {dataInCol.map((item, index) => {\n return (\n \n {item.map((row, idx) => {\n const rowData = DOMPurify.sanitize(row);\n return (\n \n );\n })}\n \n );\n })}\n \n
\n \n );\n }\n\n if (data.component === \"code\") {\n const codeContent = DOMPurify.sanitize(get(data, \"value\"));\n return (\n \n
\n {/* */}\n \n \n Code Example \n \n {/* */}\n \n \n \n Visualize\n \n \n \n
\n );\n }\n // if (data.type === \"solution\") {\n // return (\n // \n // \n // \n //
\n // \n // );\n // }\n\n return \"\";\n};\n\nfunction ExerciseContent({\n exerciseId,\n lang,\n contentList,\n setExerciseId,\n setProgressTrackId,\n courseTitle,\n progressTrackId,\n}) {\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const user = useSelector(({ User }) => User);\n const [content, setContent] = useState([]);\n const [course, setCourse] = useState();\n const [exercise, setExercise] = useState();\n const classes = useStyles();\n const params = useParams();\n const courseId = params.courseId;\n const pathwayId = params.pathwayId;\n const [showJoinClass, setShowJoinClass] = useState(true);\n const [courseData, setCourseData] = useState({ content_type: null });\n const [cashedData, setCashedData] = useState([]);\n const [loading, setLoading] = useState(true);\n const [openMobile, setOpenMobile] = useState(false);\n const [assessmentResult, setAssessmentResult] = useState(null);\n const [triger, setTriger] = useState(false);\n const [pathwayName, setPathwayName] = useState([]);\n const dispatch = useDispatch();\n\n useEffect(() => {\n if (cashedData?.length > 0) {\n setLoading(false);\n }\n }, [cashedData]);\n const upcomingBatchesData = useSelector((state) => {\n return state.Pathways?.upcomingBatches?.data;\n });\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/names`,\n headers: {\n accept: \"application/json\",\n Authorization: localStorage.getItem(\"studentAuthToken\") || user?.data?.token,\n },\n })\n .then((res) => {\n console.log(res.data, \"pathwayName\");\n setPathwayName(res.data);\n })\n .catch((err) => {});\n }, []);\n\n const pathwayData = pathwayName.find((item) => {\n return item.id == pathwayId;\n });\n\n // const userEnrolledClasses = useSelector((state) => {\n // return state.Pathways?.upcomingEnrolledClasses?.data;\n // });\n\n const reloadContent = () => {\n getCourseContent({ courseId, lang, versionCode, user }).then((res) => {\n setExercise(res.data.course?.course_content[exerciseId]);\n setContent(res.data.course?.course_content[exerciseId].content);\n setCourseData(res.data.course?.course_content[exerciseId]);\n setCashedData(res.data.course?.course_content);\n });\n };\n\n useEffect(() => {\n getCourseContent({ courseId, lang, versionCode, user }).then((res) => {\n setCourse(res?.data?.course.name);\n setExercise(res?.data?.course?.course_content?.[params.exerciseId]);\n setContent(\n res?.data?.course?.course_content?.[params.exerciseId]?.content\n );\n setCourseData(res?.data?.course?.course_content?.[params.exerciseId]);\n setCashedData(res?.data?.course?.course_content);\n });\n }, [courseId, lang, triger, user]);\n\n useEffect(() => {\n setExercise(cashedData?.[params.exerciseId]);\n setContent(cashedData?.[params.exerciseId]?.content);\n\n setCourseData(cashedData?.[params.exerciseId]);\n }, [params.exerciseId]);\n\n useEffect(() => {\n if (exercise?.content_type === \"assessment\") {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/assessment/${exercise?.slug_id}/complete`,\n // url: `${process.env.REACT_APP_MERAKI_URL}/assessment/${exercise?.id}/student/result/v2`,\n headers: {\n accept: \"application/json\",\n Authorization:\n user?.data?.token || localStorage.getItem(\"studentAuthToken\"),\n },\n }).then((res) => {\n const keyToModify = \"selected_option\";\n const newValue = res?.data?.selected_option;\n const modifiedObject = {\n ...res,\n data: {\n ...res.data,\n [keyToModify]: newValue,\n },\n };\n setAssessmentResult(modifiedObject.data); // passing this after parsing the data.\n });\n }\n }, [triger, exerciseId, exercise]);\n\n const enrolledBatches = useSelector((state) => {\n if (state?.Pathways?.enrolledBatches?.data?.length > 0) {\n return state?.Pathways?.enrolledBatches?.data;\n } else {\n return null;\n }\n });\n\n useEffect(() => {\n // getupcomingEnrolledClasses\n if (\n user?.data?.token &&\n pathwayId !== \"miscellaneous\" &&\n pathwayId !== \"residential\" &&\n pathwayId !== \"c4caPathway\" &&\n pathwayId !== \"aidcxPathway\"\n ) {\n dispatch(\n enrolledBatchesActions.getEnrolledBatches({\n pathwayId: pathwayId,\n authToken: user?.data?.token,\n })\n );\n dispatch(\n upcomingBatchesActions.getUpcomingBatches({\n pathwayId: pathwayId,\n authToken: user?.data?.token,\n })\n );\n }\n }, [params.pathwayId]);\n\n function ExerciseContentMain() {\n const [selected, setSelected] = useState(params.exerciseId);\n const desktop = useMediaQuery(\"(min-width: 900px)\");\n\n return (\n \n {!desktop && }\n \n \n \n \n {courseData?.content_type == \"class_topic\" &&\n enrolledBatches && }\n \n \n \n\n \n {courseData?.content_type == \"class_topic\" && (\n <>\n {enrolledBatches ? (\n \n ) : (\n \n )}\n >\n )}\n \n \n\n \n {desktop ? (\n \n ) : (\n \n )}\n {content &&\n content.map((contentItem, index) => (\n \n ))}\n\n {exercise && exercise.content_type === \"exercise\" && (\n \n {/* {course} */}\n {/* \n {exercise && exercise.name}\n */}\n \n {content &&\n content.map((contentItem, index) => (\n \n ))}\n \n \n )}\n {exercise && exercise.content_type === \"assessment\" && (\n \n )}\n \n \n );\n }\n return <>{!loading ? : }>;\n}\nexport default ExerciseContent;\n","import React from \"react\";\nimport { Typography, Container, Box, Button } from \"@mui/material\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../../theme/constant\";\nimport { interpolatePath, PATHS } from \"../../../constant\";\nimport { useHistory, useParams } from \"react-router-dom\";\n\nfunction CourseCompletionPage(props) {\n const {\n data,\n nextPathwayIndex,\n setSuccessfulExerciseCompletion,\n pathwayModule,\n pathwayModuleIndex,\n C4CALastPage,\n } = props;\n const params = useParams();\n const { pathwayId } = params;\n\n const history = useHistory();\n\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n return (\n <>\n \n \n \n \n Congratulations! You completed{\" \"}\n {C4CALastPage\n ? pathwayModule[pathwayModuleIndex]?.name\n : data?.[nextPathwayIndex - 1]?.name}\n \n {\n history.push(\n interpolatePath(PATHS.PATHWAY_COURSE_CONTENT, {\n courseId: C4CALastPage\n ? pathwayModule?.[pathwayModuleIndex]?.id\n : data?.[nextPathwayIndex]?.id,\n exerciseId: 0,\n pathwayId: params.pathwayId,\n })\n );\n setSuccessfulExerciseCompletion(false);\n }}\n variant=\"contained\"\n >\n Next Up: {data?.[nextPathwayIndex]?.name}\n \n \n \n >\n );\n}\n\nexport default CourseCompletionPage;\n","import React from \"react\";\nimport { Typography, Container, Box, Button } from \"@mui/material\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../../theme/constant\";\nimport { interpolatePath, PATHS } from \"../../../constant\";\nimport { useHistory } from \"react-router-dom\";\nimport { useParams } from \"react-router-dom\";\n\nfunction LastCoursePage({ C4CALastPage }) {\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const history = useHistory();\n const params = useParams();\n const studentAuthToken = localStorage.getItem(\"studentAuthToken\");\n const platformFlag = localStorage.getItem(\"platformFlag\");\n return (\n <>\n \n \n \n \n Congratulations! You completed the track\n \n {(platformFlag && platformFlag) ? (\n {\n history.push(\n studentAuthToken\n ? \"/aidcx-pathway\"\n : interpolatePath(PATHS.PATHWAY_COURSE, {\n pathwayId: params.pathwayId,\n })\n );\n }}\n variant=\"contained\"\n >\n Return to Dashboard\n \n ) : (\n {\n history.push(\n studentAuthToken\n ? \"/c4ca-pathway\"\n : interpolatePath(PATHS.PATHWAY_COURSE, {\n pathwayId: params.pathwayId,\n })\n );\n }}\n variant=\"contained\"\n >\n Return to Dashboard\n \n )}\n \n \n >\n );\n}\n\nexport default LastCoursePage;\n","import React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { useParams } from \"react-router-dom\";\nimport { actions as pathwayActions } from \"../../PathwayCourse/redux/action\";\nimport { useDispatch } from \"react-redux\";\nimport CourseCompletionPage from \"./CourseCompletionPage\";\nimport LastCoursePage from \"./LastCoursePage\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../../services/api\";\n\nfunction CompletionComponent({ setSuccessfulExerciseCompletion }) {\n const params = useParams();\n const courseID = params.courseId;\n const user = useSelector(({ User }) => User);\n const [pathway, setPathway] = useState([]);\n\n const dispatch = useDispatch();\n\n const pathwayCourses = useSelector(\n (state) => state?.Pathways?.pathwayCourse?.data?.courses\n );\n const [nextPathwayIndex, setNextPathwayIndex] = React.useState();\n const [pathwayModuleIndex, setPathwayModuleIndex] = useState();\n useEffect(() => {\n params.pathwayId !== \"c4caPathway\" &&\n dispatch(\n pathwayActions.getPathwaysCourse({ pathwayId: params.pathwayId })\n );\n }, [dispatch, params.pathwayId]);\n\n useEffect(() => {\n const currentIndex = pathwayCourses?.findIndex(\n (course) => course.id == courseID\n );\n if (currentIndex !== -1) {\n setNextPathwayIndex(currentIndex + 1);\n }\n }, [pathwayCourses]);\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/c4ca`,\n headers: {\n accept: \"application/json\",\n Authorization: user?.data?.token,\n },\n })\n .then((response) => {\n setPathway(response?.data);\n })\n .catch((err) => {});\n }, [setPathway]);\n\n const filterCourses = pathway?.modules?.filter((item) => {\n return item.courses.length > 0;\n });\n\n const pathwayModule = filterCourses?.flatMap((item) => item.courses) || [];\n\n useEffect(() => {\n const currentIndex = pathwayModule?.findIndex(\n (course) => course.id == courseID\n );\n if (currentIndex !== -1) {\n if (pathwayModule[currentIndex].completed_portion === 100) {\n setPathwayModuleIndex(currentIndex + 1);\n }\n }\n }, [pathwayModule]);\n\n const C4CALastPage = pathwayModule.some((item) => item.id == courseID);\n\n const courseComplete = !C4CALastPage\n ? pathwayCourses && pathwayCourses[nextPathwayIndex]\n : pathwayModule && pathwayModule[pathwayModuleIndex];\n\n return (\n \n {courseComplete ? (\n \n ) : (\n \n )}\n
\n );\n}\n\nexport default CompletionComponent;\n","import React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { METHODS } from \"../../services/api\";\nimport axios from \"axios\";\nimport \"./style/index.scss\";\nimport ExerciseContent from \"./ExerciseContent\";\nimport ArrowBackIosIcon from \"@mui/icons-material/ArrowBackIos\";\nimport ArrowForwardIosIcon from \"@mui/icons-material/ArrowForwardIos\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport useStyles from \"./styles\";\nimport { Link } from \"react-router-dom\";\nimport { useHistory } from \"react-router-dom\";\nimport { useParams } from \"react-router-dom\";\nimport { PATHS, interpolatePath, versionCode } from \"../../constant\";\nimport \"slick-carousel/slick/slick.css\";\nimport \"slick-carousel/slick/slick.css\";\nimport KeyboardArrowDownIcon from \"@mui/icons-material/KeyboardArrowDown\";\nimport {\n Container,\n Box,\n AppBar,\n Toolbar,\n useMediaQuery,\n Typography,\n Button,\n Select,\n MenuItem,\n} from \"@mui/material\";\nimport ModeEditOutlineOutlinedIcon from \"@mui/icons-material/ModeEditOutlineOutlined\";\nimport CompletionComponent from \"./CourseCompletion/CompletionComponent\";\nimport ExerciseImage from \"./ExerciseImage/ExerciseImage.js\";\nimport { breakpoints } from \"../../theme/constant\";\nconst languageMap = {\n \"hi-IN\": \"Hindi\",\n en: \"English\",\n \"te-IN\": \"Telugu\",\n ta: \"Tamil\",\n mr: \"Marathi\",\n \"or-IN\": \"Oriya\",\n \"kn-IN\": \"Kannada\",\n};\nconst Exercise = ({\n course,\n exerciseId,\n setExerciseId,\n classes,\n history,\n params,\n progressTrackId,\n}) => {\n const courseLength = course;\n const imageRef = React.useRef();\n useEffect(() => {\n if (imageRef.current) {\n imageRef.current.scrollIntoView({\n block: \"center\",\n });\n }\n }, [imageRef.current]);\n return (\n <>\n {courseLength?.map((exercise, index) => {\n return (\n \n );\n })}\n >\n );\n};\nfunction NavigationComponent({\n index,\n exerciseId,\n setExerciseId,\n history,\n params,\n exercise,\n progressTrackId,\n imageRef,\n}) {\n return (\n <>\n {\n history.push(\n interpolatePath(PATHS.PATHWAY_COURSE_CONTENT, {\n courseId: params.courseId,\n exerciseId: index,\n pathwayId: params.pathwayId,\n })\n );\n }}\n index={index}\n imageRef={imageRef}\n selected={exerciseId == index}\n contentType={exercise.content_type}\n setExerciseId={setExerciseId}\n useSelector\n progressTrackId={progressTrackId}\n />\n >\n );\n}\nfunction PathwayExercise() {\n const history = useHistory();\n const user = useSelector(({ User }) => User);\n const [course, setCourse] = useState([]);\n const [courseTitle, setCourseTitle] = useState(\"\");\n const [exerciseId, setExerciseId] = useState(0);\n const [previousExerciseId, setPreviousExerciseId] = useState(-1);\n const classes = useStyles();\n const params = useParams();\n const courseId = params.courseId;\n const courseLength = course && course.length ? course.length : 0;\n const [availableLang, setAvailableLang] = useState([\"en\"]);\n const [progressTrackId, setProgressTrackId] = useState(-1);\n const [successfulExerciseCompletion, setSuccessfulExerciseCompletion] =\n useState(false);\n const [showArrow, setShowArrow] = useState({ left: false, right: true });\n const scrollRef = React.useRef();\n const [language, setLanguage] = useState(\"en\");\n // const [excersiseSlugId, setExerciseSlugId] = useState();\n // const editor = user.data.user.rolesList.indexOf(\"admin\") > -1;\n const onScroll = () => {\n const scrollY = scrollRef.current.scrollLeft; //Don't get confused by what's scrolling - It's not the window\n const scrollTop = scrollRef.current.scrollTop;\n const maxScrollLeft =\n scrollRef.current.scrollWidth - scrollRef.current.clientWidth;\n if (!showArrow.left) {\n if (scrollY > 0) {\n setShowArrow((prev) => {\n return { ...prev, left: true };\n });\n }\n } else if (showArrow.left) {\n if (scrollY === 0) {\n setShowArrow((prev) => {\n return { ...prev, left: false };\n });\n }\n }\n if (showArrow.right) {\n if (Math.ceil(scrollY) >= maxScrollLeft - 2) {\n setShowArrow((prev) => {\n return { ...prev, right: false };\n });\n }\n } else if (!showArrow.right) {\n if (Math.ceil(scrollY) < maxScrollLeft - 2) {\n setShowArrow((prev) => {\n return { ...prev, right: true };\n });\n }\n }\n };\n const addCompletedExercise = () => {\n setProgressTrackId({\n ...(progressTrackId || {}),\n exercises: (progressTrackId?.exercises || []).concat(\n course[exerciseId].slug_id\n ),\n });\n };\n useEffect(() => {\n // Disable automatic scroll restoration\n if (\"scrollRestoration\" in window.history) {\n window.history.scrollRestoration = \"manual\";\n }\n // Reset scroll position on page load\n window.onload = () => {\n setTimeout(() => {\n window.scrollTo(0, 0);\n }, 0);\n };\n // Clean up\n return () => {\n window.onload = null; // Remove the onload event handler when the component unmounts\n };\n }, []);\n useEffect(() => {\n if (localStorage.getItem(\"studentAuth\") || (user && user?.data?.token)) {\n return;\n } else {\n history.push(PATHS.LOGIN);\n }\n }, []);\n useEffect(() => {\n setExerciseId(parseInt(params.exerciseId));\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/courses/${courseId}/content/slug?lang=${language}`,\n headers: {\n \"version-code\": versionCode,\n accept: \"application/json\",\n Authorization:\n user.data?.token || localStorage.getItem(\"studentAuthToken\") || \"\",\n },\n })\n .then((res) => {\n setCourse(res?.data?.course?.course_content);\n setCourseTitle(res?.data?.course?.name);\n setAvailableLang(res?.data?.course?.lang_available);\n // setExerciseSlugId(res?.data?.course?.course_content[params.exerciseId]);\n })\n .catch((err) => {\n console.log(err);\n });\n }, [courseId, language]);\n useEffect(() => {\n if (\n course[previousExerciseId]?.content_type !== \"exercise\" &&\n !progressTrackId?.exercises?.includes(course[previousExerciseId]?.slug_id)\n ) {\n // fixes #1105: https://github.com/navgurukul/bhanwari-devi/issues/1105\n // Manually add completed exercises (not assessments) as completed so don't make API\n // request in this case or when the exercise has already been marked as completed\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/progressTracking/${courseId}/completedContent`,\n headers: {\n \"version-code\": versionCode,\n accept: \"application/json\",\n Authorization:\n user.data?.token || localStorage.getItem(\"studentAuthToken\") || \"\",\n },\n })\n .then((res) => {\n setProgressTrackId(res.data);\n })\n .catch((err) => {});\n }\n setPreviousExerciseId(exerciseId);\n }, [exerciseId]);\n const LangDropDown = () => {\n return availableLang?.length === 1 ? (\n \n {Lang[availableLang[0]]}\n \n ) : (\n (\n \n )}\n onChange={(e) => {\n setLanguage(e.target.value);\n }}\n variant=\"standard\"\n >\n {availableLang?.map((lang) => {\n return (\n \n {Lang[lang]}\n \n );\n })}\n \n );\n };\n const Lang = languageMap;\n const previousClickHandler = () => {\n if (exerciseId > 0) {\n setSuccessfulExerciseCompletion(false);\n history.push(\n interpolatePath(PATHS.PATHWAY_COURSE_CONTENT, {\n courseId: params.courseId,\n exerciseId: exerciseId - 1,\n pathwayId: params.pathwayId,\n })\n );\n setExerciseId(exerciseId - 1);\n // localStorage.setItem(`lastSelectedExercise_${params.courseId}`, exerciseId - 1);\n }\n };\n const nextClickHandler = () => {\n if (exerciseId < courseLength - 1) {\n history.push(\n interpolatePath(PATHS.PATHWAY_COURSE_CONTENT, {\n courseId: params.courseId,\n exerciseId: exerciseId + 1,\n pathwayId: params.pathwayId,\n })\n );\n } else {\n setSuccessfulExerciseCompletion(true);\n }\n if (\n course[exerciseId].content_type === \"exercise\" &&\n !progressTrackId?.exercises?.includes(course[exerciseId].slug_id)\n ) {\n axios({\n method: METHODS.POST,\n url: `${process.env.REACT_APP_MERAKI_URL}/progressTracking/add/learningTrackStatus`,\n headers: {\n \"version-code\": versionCode,\n accept: \"application/json\",\n Authorization:\n user.data?.token || localStorage.getItem(\"studentAuthToken\") || \"\",\n },\n data: {\n pathway_id: params.pathwayId === \"c4caPathway\" ? 12 : params.pathwayId ,\n course_id: params.courseId,\n slug_id: course[exerciseId].slug_id,\n type: \"exercise\",\n lang: language,\n },\n }).then((res) => {\n addCompletedExercise();\n });\n addCompletedExercise();\n }\n setExerciseId(exerciseId + 1);\n };\n const nextArrowClickHandler = () => {\n if (exerciseId < courseLength - 1) {\n history.push(\n interpolatePath(PATHS.PATHWAY_COURSE_CONTENT, {\n courseId: params.courseId,\n exerciseId: exerciseId + 1,\n pathwayId: params.pathwayId,\n })\n );\n setExerciseId(exerciseId + 1);\n // localStorage.setItem(`lastSelectedExercise_${params.courseId}`, exerciseId + 1);\n }\n };\n const onChangeHandlerClick = () => {\n if (\n course[exerciseId].content_type === \"exercise\" &&\n !progressTrackId?.exercises?.includes(course[exerciseId].slug_id)\n ) {\n axios({\n method: METHODS.POST,\n url: `${process.env.REACT_APP_MERAKI_URL}/exercises/${course[exerciseId].slug_id}/markcomplete`,\n headers: {\n \"version-code\": versionCode,\n accept: \"application/json\",\n Authorization:\n user.data?.token || localStorage.getItem(\"studentAuthToken\") || \"\",\n },\n params: {\n lang: language,\n type: course[exerciseId].content_type,\n },\n })\n .then((res) => {\n // add it here in case it gets overwritten as incomplete by a response from `/completedContent`\n // that comes in before the request marking it as complete is handled\n addCompletedExercise();\n })\n .catch((err) => {\n console.log(err);\n });\n // add it here so it gets marked as completed before response comes in\n addCompletedExercise();\n }\n };\n // to avoid duplication\n function languageSelectMenu() {\n const langMenu = availableLang.map((lang) => (\n {Lang[lang]} \n ));\n return availableLang.length === 1 ? (\n langMenu\n ) : (\n null}\n onChange={(e) => {\n setLanguage(e.target.value);\n }}\n variant=\"standard\"\n >\n {langMenu}\n \n );\n }\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const isActiveIpad = useMediaQuery(\"(max-width:1300px)\");\n return (\n <>\n \n \n \n
\n \n \n \n \n \n {/* \n {\n scrollRef.current.scrollBy({\n right: 0,\n left: -60,\n behavior: \"smooth\",\n });\n }}\n />\n \n \n
\n {\n scrollRef.current.scrollBy({\n right: 0,\n left: 60,\n behavior: \"smooth\",\n });\n }}\n />\n */}\n \n \n
\n \n
\n \n \n \n \n \n \n
\n {/*
\n \n {course &&\n course?.map((exercise, index) => {\n return (\n <>\n {\n setExerciseId(index);\n }}\n >\n \n \n >\n );\n })}\n
\n */}\n
\n \n \n {/* {editor && (\n \n \n \n \n \n \n \n Want to update the content?\n \n {\n history.push(\n interpolatePath(PATHS.PATHWAY_COURSE_CONTENT_EDIT, {\n courseId: params.courseId,\n exerciseId: params.exerciseId,\n pathwayId: params.pathwayId,\n })\n );\n }}\n >\n Start Editing\n \n \n \n \n \n \n )} */}\n {successfulExerciseCompletion ? (\n \n ) : (\n // \n \n \n \n )}\n \n \n {/* }\n >\n Back\n \n }\n disabled={!(exerciseId < courseLength)}\n variant=\"text\"\n color=\"primary\"\n onClick={() => {\n nextClickHandler();\n onChangeHandlerClick();\n }}\n >\n Next\n */}\n }\n >\n Back\n \n }\n disabled={!(exerciseId < courseLength)}\n variant=\"text\"\n color=\"primary\"\n onClick={() => {\n nextClickHandler();\n onChangeHandlerClick();\n }}\n >\n Next\n \n \n \n >\n );\n}\nexport default PathwayExercise;","import React from \"react\";\nimport { Box, Typography, Card, CardContent } from \"@mui/material\";\nfunction NoBatchEnroll() {\n return (\n <>\n \n \n \n \n Not seeing the batch to enroll?\n \n \n Usually, it takes one day for the batch to show here once a\n partner’s students are onboarded. Please go ahead and take a look\n at the course content in the meantime.\n \n \n \n \n >\n );\n}\n\nexport default NoBatchEnroll;\n","import React, { useEffect, useState } from \"react\";\nimport { breakpoints } from \"../../theme/constant\";\nimport Modal from \"@mui/material/Modal\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport { Box, Typography, Button } from \"@mui/material\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport axios from \"axios\";\nimport OutlinedInput from \"@mui/material/OutlinedInput\";\nimport InputLabel from \"@mui/material/InputLabel\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport FormControl from \"@mui/material/FormControl\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Select from \"@mui/material/Select\";\nimport Checkbox from \"@mui/material/Checkbox\";\nimport { METHODS } from \"../../services/api\";\nimport TextField from \"@mui/material/TextField\";\nimport useStyles from \"./styles\";\nimport { exec } from \"child_process\";\n\nconst style = {\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: 400,\n bgcolor: \"background.paper\",\n boxShadow: 24,\n p: 4,\n margin: \"3rem 0rem\",\n};\n\nfunction CustomModal({\n isFormModalOpen,\n setisFormModalOpen,\n setisFormFilled,\n user,\n}) {\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const classes = useStyles({ isActive });\n const [teacherDetails, setTeacherDetails] = useState({\n zone: \"\",\n school_id: \"\",\n school_name: \"\",\n teacher_name: \"\",\n teacher_id: \"\",\n class_of_teacher: \"\",\n phone_number: \"\",\n employee_type: \"\",\n });\n\n\n const ITEM_HEIGHT = 48;\n const ITEM_PADDING_TOP = 8;\n const MenuProps = {\n PaperProps: {\n style: {\n maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP,\n width: 250,\n },\n },\n };\n\n const classesOfTeacher = [\n \"Class 1\",\n \"Class 2\",\n \"Class 3\",\n \"Class 4\",\n \"Class 5\",\n ];\n\n const zoneArray = [\n \"Central\",\n \"Civil Lines\",\n \"CTSP\",\n \"Karol Bagh\",\n \"Keshavpuram\",\n \"Narela\",\n \"Rohini\",\n \"Nazafgarh\",\n \"South\",\n \"Sharda.North\",\n \"Sharda.South\",\n \"West\",\n ];\n\n const employeetype = [\n \"teacher\",\n \"principal\",\n \"mentor_teacher\",\n \"school_inspector\",\n \"clerical_staff\",\n ];\n\n const [teacherClass, setTeacherClass] = useState([]);\n const [errors, setErrors] = useState({});\n\n const handleChange = (event) => {\n const {\n target: { value },\n } = event;\n setTeacherClass(typeof value === \"string\" ? value.split(\",\") : value);\n };\n\n useEffect(() => {\n setTeacherDetails((prev) => ({\n ...prev,\n class_of_teacher: teacherClass.join(\",\"),\n }));\n }, [teacherClass]);\n\n const handleFormModalClose = () => {\n setisFormModalOpen(false);\n };\n\n const validateForm = () => {\n const newErrors = {};\n const containsNumbers = /\\d/;\n const containsOnlyNumbers = /^\\d+$/;\n\n if (!teacherDetails.zone) newErrors.zone = \"Zone is required.\";\n if (\n !teacherDetails.school_id &&\n teacherDetails.employee_type !== \"clerical_staff\"\n )\n newErrors.school_id = \"School ID is required.\";\n else if (\n teacherDetails.school_id &&\n !containsOnlyNumbers.test(teacherDetails.school_id)\n )\n newErrors.school_id = \"School ID should contain only digits.\";\n else if (\n teacherDetails.school_id &&\n (teacherDetails.school_id.toString().length < 7 ||\n teacherDetails.school_id.toString().length > 7)\n )\n newErrors.school_id = \"School ID must be of 7 digits only\";\n\n if (\n !teacherDetails.school_name &&\n teacherDetails.employee_type !== \"clerical_staff\"\n )\n newErrors.school_name = \"School Name is required.\";\n else if (containsNumbers.test(teacherDetails.school_name))\n newErrors.school_name = \"School Name should not contain numbers.\";\n\n // Validate fields based on employee type\n const validateEmployeeDetails = () => {\n if (!teacherDetails.teacher_name)\n newErrors.teacher_name = \"Teacher Name is required.\";\n else if (containsNumbers.test(teacherDetails.teacher_name))\n newErrors.teacher_name = \"Teacher Name should not contain numbers.\";\n\n if (\n !teacherDetails.teacher_id &&\n teacherDetails.employee_type !== \"clerical_staff\"\n )\n newErrors.teacher_id = \"Teacher ID is required.\";\n else if (\n teacherDetails.teacher_id &&\n !containsOnlyNumbers.test(teacherDetails.teacher_id)\n )\n newErrors.teacher_id = \"Teacher ID should contain only digits.\";\n else if (\n teacherDetails.teacher_id &&\n (teacherDetails.teacher_id.toString().length < 8 ||\n teacherDetails.teacher_id.toString().length > 8)\n )\n newErrors.teacher_id = \"Teacher ID must be of 8 digits only\";\n\n if (!teacherDetails.teacher_name)\n newErrors.teacher_name = \"Pricipal Name is required.\";\n else if (containsNumbers.test(teacherDetails.teacher_name))\n newErrors.teacher_name = \"Pricipal Name should not contain numbers.\";\n\n if (\n !teacherDetails.teacher_id &&\n teacherDetails.employee_type !== \"clerical_staff\"\n )\n newErrors.teacher_id = \"Pricipal ID is required.\";\n else if (\n teacherDetails.teacher_id &&\n !containsOnlyNumbers.test(teacherDetails.teacher_id)\n )\n newErrors.teacher_id = \"Pricipal ID should contain only digits.\";\n else if (\n teacherDetails.teacher_id &&\n (teacherDetails.teacher_id.toString().length < 8 ||\n teacherDetails.teacher_id.toString().length > 8)\n )\n newErrors.teacher_id = \"Pricipal ID must be of 8 digits only\";\n\n if (!teacherDetails.teacher_name)\n newErrors.teacher_name = \"Mentor Teacher Name is required.\";\n else if (containsNumbers.test(teacherDetails.teacher_name))\n newErrors.teacher_name =\n \"Mentor Teacher Name should not contain numbers.\";\n\n if (\n !teacherDetails.teacher_id &&\n teacherDetails.employee_type !== \"clerical_staff\"\n )\n newErrors.teacher_id = \"Mentor Teacher ID is required.\";\n else if (\n teacherDetails.teacher_id &&\n !containsOnlyNumbers.test(teacherDetails.teacher_id)\n )\n newErrors.teacher_id = \"Mentor Teacher ID should contain only digits.\";\n else if (\n teacherDetails.teacher_id &&\n (teacherDetails.teacher_id.toString().length < 8 ||\n teacherDetails.teacher_id.toString().length > 8)\n )\n newErrors.teacher_id = \"Mentor Teacher ID must be of 7 digits only\";\n\n if (!teacherDetails.teacher_name)\n newErrors.teacher_name = \"School Inspector Name is required.\";\n else if (containsNumbers.test(teacherDetails.teacher_name))\n newErrors.teacher_name =\n \"School Inspector Name should not contain numbers.\";\n\n if (\n !teacherDetails.teacher_id &&\n teacherDetails.employee_type !== \"clerical_staff\"\n )\n newErrors.teacher_id = \"School Inspector ID is required.\";\n else if (\n teacherDetails.teacher_id &&\n !containsOnlyNumbers.test(teacherDetails.teacher_id)\n )\n newErrors.teacher_id =\n \"School Inspector ID should contain only digits.\";\n else if (\n teacherDetails.teacher_id &&\n (teacherDetails.teacher_id.toString().length < 8 ||\n teacherDetails.teacher_id.toString().length > 8)\n )\n newErrors.teacher_id = \"School Inspector ID must be of 8 digits only\";\n\n if (!teacherDetails.teacher_name)\n newErrors.teacher_name = \"Employee Name is required.\";\n else if (containsNumbers.test(teacherDetails.teacher_name))\n newErrors.teacher_name = \"Employee Name should not contain numbers.\";\n\n if (\n !teacherDetails.teacher_id &&\n teacherDetails.employee_type !== \"clerical_staff\"\n )\n newErrors.teacher_id = \"Employee ID is required.\";\n else if (\n teacherDetails.teacher_id &&\n !containsOnlyNumbers.test(teacherDetails.teacher_id)\n )\n newErrors.teacher_id = \"Employee ID should contain only digits.\";\n else if (\n teacherDetails.teacher_id &&\n (teacherDetails.teacher_id.toString().length < 8 ||\n teacherDetails.teacher_id.toString().length > 8)\n )\n newErrors.teacher_id = \"EmployeeID must be of 8 digits only\";\n };\n\n if (teacherDetails.employee_type === \"teacher\") {\n validateEmployeeDetails();\n if (!teacherDetails.class_of_teacher)\n newErrors.class_of_teacher = \"Class of Teacher is required.\";\n } else if (teacherDetails.employee_type === \"principal\") {\n validateEmployeeDetails();\n } else if (teacherDetails.employee_type === \"mentor_teacher\") {\n validateEmployeeDetails();\n } else if (teacherDetails.employee_type === \"school_inspector\") {\n validateEmployeeDetails();\n } else if (teacherDetails.employee_type === \"clerical_staff\") {\n validateEmployeeDetails();\n }\n if (!teacherDetails.phone_number)\n newErrors.phone_number = \"Phone number is required.\";\n else if (!containsOnlyNumbers.test(teacherDetails.phone_number))\n newErrors.phone_number = \"Phone number should contain only digits.\";\n else if (teacherDetails.phone_number.toString().length !== 10)\n newErrors.phone_number = \"Phone number must be of 10 digits only\";\n\n setErrors(newErrors);\n return Object.keys(newErrors).length === 0;\n };\n\n const handleSubmitteacherDetails = () => {\n if (validateForm()) {\n const dataToSend = { ...teacherDetails };\n\n if (\n teacherDetails.employee_type !== \"teacher\" &&\n teacherDetails.employee_type !== \"mentor_teacher\"\n ) {\n delete dataToSend.class_of_teacher;\n }\n\n if (teacherDetails.employee_type === \"clerical_staff\") {\n delete dataToSend.school_id;\n delete dataToSend.school_name;\n } else {\n if (dataToSend.school_id && isNaN(Number(dataToSend.school_id))) {\n delete dataToSend.school_id;\n }\n if (!dataToSend.school_name || dataToSend.school_name.trim() === \"\") {\n delete dataToSend.school_name;\n }\n }\n\n axios({\n method: METHODS.POST,\n url: `${process.env.REACT_APP_MERAKI_URL}/teacher/create`,\n headers: {\n accept: \"application/json\",\n Authorization: user?.data?.token,\n },\n data: dataToSend,\n })\n .then((res) => {\n handleFormModalClose();\n setisFormFilled(true);\n setTeacherDetails({\n zone: \"\",\n school_id: \"\",\n school_name: \"\",\n teacher_name: \"\",\n teacher_id: \"\",\n class_of_teacher: \"\",\n phone_number: \"\",\n employee_type: \"\",\n });\n window.location.reload();\n })\n .catch((err) => console.log(err));\n }\n };\n\n const renderError = (field) =>\n errors[field] && {errors[field]} ;\n\n return (\n \n \n \n \n Employee Details\n \n \n \n\n \n \n \n Select Employee Type\n \n {\n setTeacherDetails({\n zone: \"\",\n school_id: \"\",\n school_name: \"\",\n teacher_name: \"\",\n teacher_id: \"\",\n class_of_teacher: \"\",\n phone_number: \"\",\n employee_type: e.target.value,\n });\n setTeacherClass([]);\n setErrors({});\n }}\n >\n {employeetype.map((name) => (\n \n \n \n ))}\n \n \n\n {teacherDetails.employee_type === \"principal\" && (\n <>\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n teacher_name: e.target.value,\n }));\n }}\n />\n {renderError(\"teacher_name\")}\n\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n teacher_id: e.target.value,\n }));\n }}\n />\n {renderError(\"teacher_id\")}\n >\n )}\n\n {teacherDetails.employee_type === \"teacher\" && (\n <>\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n teacher_name: e.target.value,\n }));\n }}\n />\n {renderError(\"teacher_name\")}\n\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n teacher_id: e.target.value,\n }));\n }}\n />\n {renderError(\"teacher_id\")}\n\n \n Select Class \n }\n renderValue={(selected) => selected.join(\", \")}\n MenuProps={MenuProps}\n >\n {classesOfTeacher.map((name) => (\n \n -1} />\n \n \n ))}\n \n \n\n {renderError(\"class_of_teacher\")}\n >\n )}\n\n {teacherDetails.employee_type === \"mentor_teacher\" && (\n <>\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n teacher_name: e.target.value,\n }));\n }}\n />\n {renderError(\"teacher_name\")}\n\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n teacher_id: e.target.value,\n }));\n }}\n />\n {renderError(\"teacher_id\")}\n\n \n Select Class \n }\n renderValue={(selected) => selected.join(\", \")}\n MenuProps={MenuProps}\n >\n {classesOfTeacher.map((name) => (\n \n -1} />\n \n \n ))}\n \n \n\n {renderError(\"class_of_teacher\")}\n >\n )}\n {teacherDetails.employee_type === \"school_inspector\" && (\n <>\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n teacher_name: e.target.value,\n }));\n }}\n />\n {renderError(\"teacher_name\")}\n\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n teacher_id: e.target.value,\n }));\n }}\n />\n {renderError(\"teacher_id\")}\n >\n )}\n\n {teacherDetails.employee_type === \"clerical_staff\" && (\n <>\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n teacher_name: e.target.value,\n }));\n }}\n />\n {renderError(\"teacher_name\")}\n\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n teacher_id: e.target.value,\n }));\n }}\n />\n {renderError(\"teacher_id\")}\n >\n )}\n\n \n Select Zone \n {\n setTeacherDetails((prev) => ({\n ...prev,\n zone: e.target.value,\n }));\n }}\n >\n {zoneArray.map((name) => (\n \n \n \n ))}\n \n \n {renderError(\"zone\")}\n\n {teacherDetails.employee_type !== \"clerical_staff\" && (\n <>\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n school_id: e.target.value,\n }));\n }}\n />\n {renderError(\"school_id\")}\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n school_name: e.target.value,\n }));\n }}\n />\n {renderError(\"school_name\")}\n >\n )}\n {\n e.persist();\n setTeacherDetails((prev) => ({\n ...prev,\n phone_number: e.target.value,\n }));\n }}\n />\n {renderError(\"phone_number\")}\n \n \n Submit Details\n \n \n \n );\n}\nexport default CustomModal;\n","import React, { useState, useEffect } from 'react';\nimport {\n Dialog, DialogTitle, IconButton, DialogContent,\n Typography, DialogActions, Button, Radio, RadioGroup,\n FormControlLabel, FormControl, FormLabel, Divider, Box,\n CircularProgress, Snackbar, Alert\n} from '@mui/material';\nimport CloseIcon from '@mui/icons-material/Close';\nimport { useHistory } from 'react-router-dom';\nimport axios from 'axios';\nimport { useSelector } from \"react-redux\";\nimport PropTypes from 'prop-types';\nimport { METHODS } from \"../../services/api\";\nimport { PATHS, interpolatePath } from \"../../constant\";\n\n\nconst PreQuiz = ({ open, handleClose, courseId, courseName, courseData, pathwayId }) => {\n const user = useSelector(({ User }) => User);\n const [courseContent, setCourseContent] = useState([]);\n const [selectedAnswers, setSelectedAnswers] = useState({});\n const [slugId, setSlugId] = useState(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState(null);\n const [openSnackbar, setOpenSnackbar] = useState(false);\n const [snackbarMessage, setSnackbarMessage] = useState('');\n const [snackbarSeverity, setSnackbarSeverity] = useState('success');\n const history = useHistory();\n useEffect(() => {\n const formSubmitted = localStorage.getItem(`preQuizSubmitted_${courseId}`);\n if (formSubmitted) {\n history.push(interpolatePath(PATHS.PATHWAY_COURSE_CONTENT, {\n courseId,\n exerciseId: 0,\n pathwayId,\n }));\n }\n }, [courseId, history, pathwayId]);\n\n\n\n useEffect(() => {\n if (!courseId) return;\n axios({\n method: 'GET',\n url: `${process.env.REACT_APP_MERAKI_URL}/courses/${courseId}/prequiz`,\n headers: {\n accept: \"application/json\",\n Authorization: user?.data?.token || localStorage.getItem(\"studentAuthToken\"),\n },\n })\n .then((response) => {\n console.log('Fetched Data:', response.data);\n\n if (response.data.course.course_content) {\n setCourseContent(response.data.course.course_content);\n setSlugId(response.data.course.course_content[0]?.slug_id);\n } else {\n console.error('Unexpected data structure:', response.data);\n setError('Unexpected data structure.');\n }\n\n setLoading(false);\n })\n .catch((err) => {\n console.error('API call failed:', err);\n setError('Failed to fetch questions.');\n setLoading(false);\n });\n }, [courseId]);\n\n const handleChange = (event, questionText) => {\n const selectedOptionId = parseInt(event.target.value, 10);\n setSelectedAnswers(prevState => ({\n ...prevState,\n [questionText]: selectedOptionId,\n }));\n };\n\n\n\n const handleSubmit = async () => {\n const token = user?.data?.token || localStorage.getItem(\"studentAuthToken\");\n\n const resultsArray = courseContent\n .filter(item => item && item.content_type === 'prequiz')\n .map(item => {\n const selectedOptionId = Array.isArray(selectedAnswers[item.content[0]?.value])\n ? selectedAnswers[item.content[0]?.value]\n : [selectedAnswers[item.content[0]?.value]];\n\n const correctAnswerIds = Array.isArray(item.content[2]?.correct_options_value)\n ? item.content[2].correct_options_value.map(option => option.value)\n : [];\n\n const isCorrect = selectedOptionId[0] === correctAnswerIds[0];\n const status = isCorrect ? 'Pass' : 'Fail';\n const language = item.lang_available ? item.lang_available[0] : 'en';\n const courseId = item.course_id ? Number(item.course_id) : 0;\n const slugId = item.slug_id ? Number(item.slug_id) : 0;\n\n if (selectedOptionId.length > 0) {\n return {\n slug_id: slugId,\n course_id: courseId,\n selected_option: selectedOptionId,\n status: status,\n lang: language,\n };\n }\n return null;\n }).filter(Boolean);\n\n if (resultsArray.length > 0) {\n console.log('Payload being sent:', resultsArray);\n\n axios({\n method: METHODS.POST,\n url: `${process.env.REACT_APP_MERAKI_URL}/assessment/slug/complete`,\n headers: {\n accept: \"application/json\",\n Authorization: token,\n },\n data: resultsArray,\n })\n .then((res) => {\n console.log('API call successful', res);\n setSnackbarMessage('Form submitted successfully!');\n setSnackbarSeverity('success');\n setOpenSnackbar(true);\n\n localStorage.setItem(`preQuizSubmitted_${courseId}`, true);\n\n history.push(interpolatePath(PATHS.PATHWAY_COURSE_CONTENT, {\n courseId,\n exerciseId: 0,\n pathwayId,\n }));\n })\n .catch((err) => {\n console.error('API call failed', err);\n setSnackbarMessage(\"Please select every question's answer\");\n setSnackbarSeverity('error');\n setOpenSnackbar(true);\n });\n } else {\n setSnackbarMessage('No questions answered.');\n setSnackbarSeverity('warning');\n setOpenSnackbar(true);\n }\n console.log('Prepared Result:', resultsArray);\n };\n\n const handleCloseSnackbar = () => {\n setOpenSnackbar(false);\n };\n\n const handleDialogClose = (event, reason) => {\n if (reason !== 'backdropClick' && reason !== 'escapeKeyDown') {\n handleClose();\n }\n };\n\n return (\n \n \n {courseName}\n \n theme.palette.grey[500],\n }}\n >\n \n \n \n \n \n \n Welcome to the Pre-Quiz\n \n \n \n 1. This quiz is to test your basic proficiency.\n \n \n 2. It consists of multiple choice questions.\n \n \n 3. It is mandatory to complete the pre-quiz to access course material.\n \n \n {loading ? (\n \n ) : error ? (\n {error} \n ) : (\n \n {courseContent.map((item, index) => (\n \n {item.content_type === 'prequiz' && (\n <>\n 0 ? \"48px\" : \"0px\",\n fontFamily: \"Noto Sans\",\n lineHeight: \"170%\",\n fontSize: \"18px\",\n color: \"Black\"\n }}\n >\n {index + 1}. {item.content[0].value} \n \n handleChange(event, item.content[0].value)}\n >\n {item.content[1].value.map((option, idx) => (\n }\n label={option.value}\n />\n ))}\n \n >\n )}\n
\n ))}\n \n )}\n \n \n \n Submit Answer\n \n \n \n \n \n \n \n {snackbarMessage}\n \n \n \n );\n};\n\nexport default PreQuiz;\n","import React, { useState } from \"react\";\nimport {\n Box,\n Typography,\n Card,\n CardContent,\n CardActions,\n LinearProgress,\n Grid,\n} from \"@mui/material\";\nimport { useHistory } from \"react-router-dom\";\nimport { PATHS, interpolatePath } from \"../../constant\";\nimport useStyles from \"./styles\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport PreQuiz from \"./PreQuiz\"; \n\nconst McDigitalCourse = ({\n pathwayCourseData,\n completedPortion,\n pathwayId,\n courseData\n}) => {\n const [selectedCourse, setSelectedCourse] = useState(null);\n const [courseName, setCourseName] = useState(''); \n const [quizOpen, setQuizOpen] = useState(false);\n const history = useHistory();\n const isActive = useMediaQuery(\"(max-width:600px)\");\n const classes = useStyles({ isActive });\n const handleCourseClick = (course) => {\n if (course.isPreQuizCompleted) { //condition for isPreQuizCompleted===\"false\"\n setSelectedCourse(course);\n setCourseName(course.name);\n setQuizOpen(true);\n } else {\n history.push(\n interpolatePath(PATHS.PATHWAY_COURSE_CONTENT, {\n courseId: course.id,\n exerciseId: 0,\n pathwayId: pathwayId,\n })\n );\n }\n };\n \n \n \n const handleClose = () => {\n setQuizOpen(false);\n };\n\n return (\n \n \n Mandatory Courses\n \n \n {pathwayCourseData.length > 0 ? (\n pathwayCourseData.map((item, index) =>\n item.isMandatory === \"true\" ? (\n \n handleCourseClick(item)}\n >\n \n \n \n \n {index + 1}\n \n\n \n {item.name}\n \n
\n \n \n \n \n \n \n ) : null\n )\n ) : (\n No mandatory courses available. \n )}\n \n\n \n Optional Courses\n \n\n \n {pathwayCourseData.length > 0 ? (\n pathwayCourseData.map((item, index) =>\n item.isMandatory === \"false\" ? (\n \n handleCourseClick(item)}\n >\n \n \n \n \n {index + 1}\n \n\n \n {item.name}\n \n
\n \n \n \n \n \n \n ) : null\n )\n ) : (\n No optional courses available. \n )}\n \n\n \n \n \n );\n};\n\nexport default McDigitalCourse;\n","import * as React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Dialog from \"@mui/material/Dialog\";\nimport { TextField, Typography } from \"@mui/material\";\nimport { breakpoints } from \"../../theme/constant\";\nimport useStyles from \"./styles\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { useSelector } from \"react-redux\";\nimport AlertDialog from \"./AlertDialog\";\nimport { Box } from \"@mui/system\";\nimport { format } from \"../../common/date\";\nexport default function CheckMoreBatches(props) {\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const classes = useStyles();\n const {\n open,\n handleUpcomingBatchesClickOpen,\n handleUpcomingBatchesClickClose,\n } = props;\n\n const { upcomingBatchesData } = props;\n const user = useSelector(({ User }) => User);\n const [openDialog, setOpenDialog] = React.useState(false);\n const [AlertData, setAlertData] = React.useState({});\n const handelEnrollment = () => {\n setOpenDialog(true);\n };\n\n const close = () => {\n setOpenDialog(false);\n };\n return (\n <>\n \n {upcomingBatchesData?.length > 1 ? (\n \n \n More Batches\n \n {upcomingBatchesData?.slice(1, 3).map((item) => (\n \n {\" \"}\n \n {item.title}\n \n \n \n {format(item.start_time, \"dd MMM yy\")} -{\" \"}\n {format(item.last_class_date, \"dd MMM yy\")}\n \n {\n handelEnrollment(item.id);\n setAlertData({\n title: item.title,\n start_time: item.start_time,\n end_time: item.end_batch_time,\n id: item.id,\n });\n }}\n variant=\"contained\">\n Enroll Batch\n \n \n ))}\n \n \n ) : (\n \n \n \n It’s a void out here. Unfortunately, we only have one batch\n running at the moment.\n \n \n )}\n \n >\n );\n}\n","import React from \"react\";\nimport useStyles from \"./styles\";\nimport { Container, Typography } from \"@mui/material\";\nimport { PATHS, interpolatePath } from \"../../constant\";\nimport { format } from \"../../common/date\";\nimport { CardContent, Card, Button } from \"@mui/material\";\nimport { Box } from \"@mui/system\";\nimport AlertDialog from \"./AlertDialog\";\nimport { useSelector } from \"react-redux\";\nimport CheckMoreBatches from \"./CheckMoreBatches\";\nimport { useHistory } from \"react-router-dom\";\n\nconst PathwayCourseBatchEnroll1 = ({ upcomingBatchesData }) => {\n const history = useHistory();\n const [open, setOpen] = React.useState(false);\n const [upcomingBatchesOpen, setUpcomingBatchesOpen] = React.useState(false);\n const classes = useStyles();\n const user = useSelector(({ User }) => User);\n\n const handleClickOpen = () => {\n if (user?.data?.token) {\n setOpen(!open);\n } else {\n history.push(interpolatePath(PATHS.LOGIN));\n }\n };\n\n const close = () => {\n setOpen(false);\n };\n const handleUpcomingBatchesClickOpen = () => {\n setUpcomingBatchesOpen(true);\n };\n const handleUpcomingBatchesClickClose = () => {\n setUpcomingBatchesOpen(false);\n };\n\n const batch = upcomingBatchesData[0];\n\n return batch ? (\n <>\n \n \n \n \n \n {batch?.title}\n \n \n \n From {format(batch?.start_time, \"dd MMM yy\")} -{\" \"}\n {format(batch?.last_class_date, \"dd MMM yy\")}\n \n \n \n Access to live classes\n \n \n Enroll Batch\n \n \n \n Can’t start on {format(batch?.start_time, \"dd MMM yy\")}\n {\" ? \"}\n \n {\" \"} \n Check out our other batches \n \n \n \n \n \n \n \n >\n ) : (\n \"\"\n );\n};\nexport default PathwayCourseBatchEnroll1;\n","import React, { useEffect } from \"react\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../../theme/constant\";\nimport Chip from \"@mui/material/Chip\";\nimport CircleIcon from \"@mui/icons-material/Circle\";\nimport {\n Container,\n Box,\n Grid,\n Card,\n Stack,\n Button,\n CardContent,\n Typography,\n} from \"@mui/material\";\nimport { interpolatePath, PATHS } from \"../../../constant\";\nimport { format } from \"../../../common/date\";\nimport { getCourseContent } from \"../../Course/redux/api\";\nimport { useSelector } from \"react-redux\";\nimport { versionCode } from \"../../../constant\";\nimport { Link, useHistory } from \"react-router-dom\";\n\nimport useStyles from \"../styles\";\nconst PathwayCards = ({ userEnrolledClasses, data }) => {\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const history = useHistory();\n const language = {\n hi: \"Hindi\",\n en: \"English\",\n mr: \"Marathi\",\n };\n\n const sliceNumber = data?.code === \"ACB\" ? 1 : 3;\n\n function UpcomingClassCardComponent({ item }) {\n const classes = useStyles();\n const isActive = useMediaQuery(\n \"(max-width:\" + breakpoints.values.sm + \"px)\"\n );\n const user = useSelector(({ User }) => User);\n\n const [classIndex, setClassIndex] = React.useState(0);\n useEffect(() => {\n const courseId = item.course_id;\n getCourseContent({ courseId, versionCode, user }).then((res) => {\n const index = res.data.course.course_content.findIndex(\n (ex) => ex.id === item.id\n );\n\n setClassIndex(index);\n });\n }, []);\n\n return (\n \n \n {\n // history.push(\n // interpolatePath(PATHS.PATHWAY_COURSE_CONTENT, {\n // courseId: item.course_id,\n // exerciseId: classIndex,\n // pathwayId: item.pathway_id,\n // })\n // );\n // }}\n style={\n item.pathway_id === 7\n ? {\n // minWidth: isActive ? \"95%\" : \"350\",\n marginRight: isActive ? \"500px\" : \"130px\",\n marginLeft: isActive ? \"5px\" : \"15px\",\n }\n : {\n minWidth: isActive ? \"95%\" : \"350\",\n marginRight: isActive ? \"500px\" : \"40px\",\n marginLeft: isActive ? \"5px\" : \"15px\",\n }\n }\n >\n \n\n \n \n \n {item.sub_title || item.title}\n \n \n \n \n \n \n {format(item.start_time, \"dd MMM yy\")}\n \n \n \n \n \n {language[item.lang]}\n \n \n \n \n \n \n \n );\n }\n\n return (\n <>\n \n \n Upcoming Classes\n \n\n \n {userEnrolledClasses?.slice(0, sliceNumber).map((item) => {\n return (\n <>\n \n >\n );\n })}\n
\n \n >\n );\n};\n\nexport default PathwayCards;\n","import { createTheme } from \"@mui/material/styles\";\nimport { breakpoints } from \"./constant\";\nlet theme = createTheme();\nconst shadows = theme.shadows;\nshadows[2] =\n \"0px 1px 2px rgba(0, 0, 0, 0.06), 0px 2px 1px rgba(0, 0, 0, 0.04), 0px 1px 5px rgba(0, 0, 0, 0.08)\";\n// Removing shadow[9], use shadow[8] for hadder scrollup\nshadows[8] =\n \"0px 4px 4px rgba(0, 0, 0, 0.06), 0px 8px 12px rgba(0, 0, 0, 0.04), 0px 4px 24px rgba(0, 0, 0, 0.08)\";\nshadows[16] =\n \"0px 16px 24px rgba(0, 0, 0, 0.06), 0px 6px 30px rgba(0, 0, 0, 0.04), 0px 8px 10px rgba(0, 0, 0, 0.08)\";\nshadows[24] =\n \"0px 24px 38px rgba(0, 0, 0, 0.06), 0px 9px 46px rgba(0, 0, 0, 0.04), 0px 11px 15px rgba(0, 0, 0, 0.08)\";\n\ntheme = createTheme(theme, {\n breakpoints,\n palette: {\n mode: \"light\",\n default: {\n // main: \"#FFFFFF\",\n // contrastText: \"#000000\",\n light: \"#0066FF\",\n main: \"#fff\",\n // dark: will be calculated from palette.secondary.main,\n contrastText: \"#FFCC00\",\n },\n primary: {\n //Green\n main: \"#48A145\",\n light: \"#E9F5E9\",\n dark: \"#3A8137\",\n lighter: \"#FAFAFA\",\n },\n secondary: {\n //Violet\n main: \"#FFCC00\",\n light: \"#FFF5CC\",\n dark: \"#CCA300\",\n contrastText: \"#2E2E2E\",\n },\n error: {\n //Red\n main: \"#F44336\",\n light: \"#FFE5E3\",\n dark: \"#C3362B\",\n },\n warning: {\n //Yellow\n main: \"#FFC107\",\n contrastText: \"#2E2E2E\",\n light: \"#FFF3CD\",\n dark: \"#CC9A06\",\n },\n info: {\n //Blue\n main: \"#2196F3\",\n dark: \"#1A78C2\",\n light: \"#D3EAFD\",\n },\n success: {\n //Green as primary\n main: \"#48A145\",\n light: \"#E9F5E9\",\n dark: \"#3A8137\",\n },\n grey: {\n main: \"#BDBDBD\",\n // main: \"rgba(0, 0, 0, 0.12)\",\n },\n text: {\n primary: \"#2E2E2E\",\n secondary: \"#6D6D6D\",\n disabled: \"#949494\",\n hint: \"#949494\",\n },\n background: {\n default: \"#FFFFFF\",\n paper: \"#FFFFFF\",\n },\n dark: {\n main: \"#2E2E2E\",\n contrastText: \"#FFFFFF\",\n },\n divider: \"#DEDEDE\",\n },\n typography: {\n fontFamily: \"Josefin Sans\",\n fontSize: 18,\n h1: {\n letterSpacing: \"-1px\",\n fontWeight: 600,\n fontSize: \"6rem\",\n lineHeight: \"130%\",\n fontFamily: \"Josefin Sans\",\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"4rem\",\n },\n },\n h2: {\n letterSpacing: \"-0.6px\",\n fontSize: \"4.5rem\",\n lineHeight: \"130%\",\n fontFamily: \"Josefin Sans\",\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"3rem\",\n },\n fontWeight: 600,\n },\n h3: {\n fontSize: \"3.5rem\",\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"2.5rem\",\n },\n fontWeight: 600,\n fontFamily: \"Josefin Sans\",\n lineHeight: \"130%\",\n },\n h4: {\n fontWeight: 600,\n fontSize: \"2.625rem\",\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \" 2rem\",\n },\n fontFamily: \"Josefin Sans\",\n lineHeight: \"130%\",\n },\n h5: {\n fontWeight: 600,\n fontSize: \"2rem\",\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \" 1.5rem\",\n },\n lineHeight: \"150%\",\n fontFamily: \"Josefin Sans\",\n },\n h6: {\n fontSize: \"1.5rem\",\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \" 1.25rem\",\n },\n lineHeight: \"150%\",\n fontWeight: 600,\n fontFamily: \"Josefin Sans\",\n },\n subtitle1: {\n fontSize: \"1.125rem\",\n fontFamily: \"Noto Sans\",\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"1rem\",\n },\n lineHeight: \"170%\",\n fontWeight: 700,\n },\n subtitle2: {\n fontSize: \"0.875rem\",\n fontFamily: \"Noto Sans\",\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"0.875rem\",\n },\n fontWeight: 700,\n lineHeight: \"170%\",\n },\n body1: {\n fontSize: \"1.125rem\",\n fontFamily: \"Noto Sans\",\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"1rem\",\n },\n lineHeight: \"170%\",\n fontWeight: 400,\n },\n body2: {\n fontSize: \"0.875rem\", //1rem\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"0.875rem\",\n },\n fontFamily: \"Noto Sans \",\n lineHeight: \"170%\",\n fontWeight: 400,\n },\n body3: {\n fontSize: \"0.875rem\", //0.875rem\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"0.875rem\",\n },\n fontFamily: \"Noto Sans \",\n lineHeight: \"170%\",\n fontWeight: 400,\n },\n button: {\n fontSize: \"1.125rem\",\n fontFamily: \"Noto Sans\",\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"1rem\",\n },\n lineHeight: \"170%\",\n fontWeight: 700,\n textTransform: \"none\",\n },\n caption: {\n fontSize: \"0.75rem\",\n fontFamily: \"Noto Sans\",\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"0.75rem\",\n },\n lineHeight: \"150%\",\n fontWeight: 400,\n },\n overline: {\n fontFamily: \"Noto Sans\",\n fontSize: \"0.75rem\",\n lineHeight: \"150%\",\n fontWeight: 400,\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"0.75rem\",\n },\n },\n code: {\n fontFamily: \"IBM Plex Mono\",\n fontSize: \"1.125rem\",\n lineHeight: \"170%\",\n fontWeight: 400,\n [theme.breakpoints.down(\"sm\")]: {\n fontSize: \"1rem\",\n },\n },\n },\n shadows,\n});\ntheme.components = {\n MuiCardMedia: {\n defaultProps: {\n disableRipple: true,\n },\n styleOverrides: {\n root: { width: 64 },\n },\n },\n MuiPaper: {\n styleOverrides: {\n root: {\n borderRadius: \"8px\",\n },\n },\n },\n MuiButton: {\n styleOverrides: {\n root: {\n borderRadius: \"8px\",\n height: \"48px\",\n },\n },\n },\n MuiMenuItem: {\n styleOverrides: {\n root: {\n height: \"48px\",\n // margin: \"10px 16px 10px 16px\",\n \"&:hover\": {\n backgroundColor: \"#E9F5E9\",\n borderRadius: \"8px\",\n },\n },\n },\n },\n MuiTableRow: {\n styleOverrides: {\n root: {\n // backgroundColor: theme.palette.divider,\n backgroundColor: \"#F5F5F5\",\n \"&:hover\": {\n backgroundColor: \"#F5F5F5\",\n boxShadow: \"0px 0px 0px\",\n },\n },\n },\n },\n // MuiTextareaAutosize: {\n // styleOverrides: {\n // root: {\n // width: 529,\n // margin: \"10px 0px\",\n // padding: \"20px 10px\",\n // border: \"1px solid #BDBDBD\",\n // borderRadius: \"4px\",\n // fontSize: \"1.125rem\",\n // color: \"#2E2E2E\",\n // fontFamily: \"Noto Sans\",\n // resize: \"none\",\n // outline: \"none\",\n // \"&:focus\": {\n // border: \"2px solid #48A145 !important\",\n // },\n // },\n // },\n // },\n};\nexport default theme;\n","import React from \"react\";\nimport { useLocation } from \"react-router-dom\";\n\n// https://v5.reactrouter.com/web/example/query-parameters\nexport const useQuery = () => {\n\n\n const { search } = useLocation();\n\n\n return React.useMemo(() => new URLSearchParams(search), [search]);\n};\n","const en = {};\nen.LEARN = \"Learn\";\nen.ABOUT = \"About\";\nen.GET_INVOLVED = \"Get Involved\";\nen.OUR_STORY = \"Our Story\";\nen.DASHBOARD = \"Dashboard\";\nen.STATEPARTNER = \"State Partners\";\nen.SWITCH_VIEWS = \"Switch Views\";\nen.SWITCH_TO_VIEW = \"Switch to %1 View\";\nen.STUDENT = \"Student\";\nen.VOLUNTEER = \"Volunteer\";\nen.ADMIN = \"Admin\";\nen.PARTNER = \"Partner\";\nen.STUDENTS = \"Students\";\nen.VOLUNTEERS = \"Tutors\";\nen.PARTNERS = \"Partners\";\nen.DONATE = \"Donate\";\nen.VOLUNTEER_WITH_US = \"Volunteer with Us\";\nen.MERAKI_TEAM = \"Meraki Team\";\nen.MENTOR = \"Mentor\";\nen.SCRATCH = 'Scratch';\nen.NAVGURUKUL_ADMISSION = \"Navgurukul Admission\";\nen.OPPORTUNITIES = \"Opportunities\";\nen.CLASSES = \"Classes\";\nen.SEARCH_FOR_COURSES = \"Search for Courses...\";\nen.CAREERS = \"Careers\";\nen.PROFILE = \"Profile\";\nen.LOGOUT = \"Logout\";\nen.TUTOR = \"Tutor\";\nen.CERTIFICATE_COMPLETION_WARNING =\n \"Please complete all the courses to unlock %1 certificate\";\n en.PEEPUL_CERTIFICATE_COMPLETE_WARNING =\n \"Please complete at least 80% of course to unlock %1 certificate\";\n\nexport default en;\n","import {\n useLanguageConstants,\n getTranslationKey,\n} from \"../../../common/language\";\n\nfunction Message({ constantKey, children, args = [] }) {\n const { language, MSG } = useLanguageConstants();\n const key = constantKey || getTranslationKey(children);\n\n if (key) {\n if (!MSG[key]) {\n console.warn(\n \"Message key\",\n key,\n \"does not exist. Using\",\n key,\n \". Please update the message constants.\"\n );\n return key;\n } else {\n return MSG[key]?.split(/(%\\d+)/g).map((part) => {\n if (/^%\\d+/.test(part) && parseInt(part.substring(1)) <= args.length) {\n return args[parseInt(part.substring(1)) - 1];\n } else {\n return part;\n }\n });\n }\n } else {\n return children;\n }\n}\n\nexport default Message;\n","import { useContext } from \"react\";\nimport { LanguageProvider } from \"./context\";\nimport { useQuery } from \"./url\";\nimport { lang } from \"../constant\";\nimport en from \"../msg/en\";\n\nexport const useLanguage = () => {\n const hl = useQuery().get(\"hl\") || localStorage.getItem(\"hl\");\n const isLanguageSupported = Object.keys(lang).includes(hl);\n if (isLanguageSupported) {\n localStorage.setItem(\"hl\", hl);\n return hl;\n } else {\n return \"en\"; // default to English\n }\n};\n\nexport const useLanguageConstants = () => {\n return useContext(LanguageProvider);\n};\n\nexport const getTranslationKey = (englishText) => {\n return Object.keys(en).find((key) => en[key] === englishText);\n};\n","import React from \"react\";\nimport Snackbar from \"@mui/material/Snackbar\";\nimport theme from \"../../theme/theme\";\nimport Message from \"../../components/common/Message/index\";\n\nconst CustomSnackbar = ({ openSnackbar, handleSnackbar, pathwayName }) => {\n\n return (\n \n ) : (\n \n )\n }\n onClose={handleSnackbar}\n ContentProps={{\n sx: {\n background: theme.palette.secondary.contrastText,\n fontWeight: \"400\",\n fontSize: theme.typography.fontSize,\n width: \"328px\",\n textAlign: \"left\",\n },\n }}\n />\n );\n};\n\nexport default CustomSnackbar;\n","import React, { useEffect, useState } from \"react\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../services/api\";\nimport { format } from \"../../common/date\";\nimport { useSelector } from \"react-redux\";\nimport ClassJoinTimerButton from \"../Class/ClassJoinTimerButton\";\nimport {\n Typography,\n Grid,\n Button,\n Container,\n Card,\n CardContent,\n Chip,\n CardActions,\n Box,\n Stack,\n} from \"@mui/material\";\nimport AccessTimeIcon from \"@mui/icons-material/AccessTime\";\nimport DateRangeIcon from \"@mui/icons-material/DateRange\";\nimport ArrowForwardIcon from \"@mui/icons-material/ArrowForward\";\nimport useStyles from \"./styles\";\nimport { breakpoints } from \"../../theme/constant\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport DoubtClassCard from \"./DoubtClassCard\";\nimport { Link } from \"react-router-dom\";\n\nfunction AmazonBootcampBatch({ enrolledBatches }) {\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const classes = useStyles();\n const [enrollClasses, setEnrollClasses] = useState([]);\n const [doubtclasses, setDoubtclasses] = useState([]);\n const user = useSelector(({ User }) => User);\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/7/ACBEnrolledBatches`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n setEnrollClasses(res.data);\n })\n .catch((err) => {});\n }, []);\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/doubtclasses/7`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n setDoubtclasses(res.data);\n })\n .catch((err) => {});\n }, []);\n\n const enrolledBatcheClasses = enrollClasses.filter(\n (item) => item.type === \"batch\"\n );\n\n console.log(enrollClasses)\n\n return (\n <>\n \n \n \n {enrolledBatches}\n \n \n \n \n Videos\n \n \n {/* \n } color=\"inherit\">\n Preferences\n \n */}\n \n \n \n Live Classes\n \n\n \n \n {enrolledBatcheClasses.map((item, index) => (\n \n {index === 0 && (\n \n )}\n \n \n \n \n \n \n \n \n {item.title}\n \n \n \n \n \n \n \n {format(item.start_time, \"dd MMM yy\")}\n \n \n \n \n \n {/* 2 PM */}\n {format(item.start_time, \"hh:mm aaa\")}\n \n \n \n \n \n }>\n \n \n \n \n \n ))}\n \n \n\n {/* {doubtclasses.length > 0 && (\n \n Doubt Class\n \n )}\n\n \n {doubtclasses.length > 0 &&\n doubtclasses?.map((item, index) => (\n \n ))}\n */}\n \n >\n );\n}\n\nexport default AmazonBootcampBatch;\n","import React, { useState, useEffect } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../../theme/constant\";\nimport NoBatchEnroll from \"../../BatchClassComponents/NoBatchEnroll\";\nimport { actions as upcomingBatchesActions } from \"../redux/action\";\nimport { actions as upcomingClassActions } from \"../redux/action\";\n\nimport { Container, Grid, Typography } from \"@mui/material\";\nimport useStyles from \"../styles\";\nimport PathwayCourseBatchEnroll1 from \"../../BatchClassComponents/PathwayCourseBatchEnroll1\";\nimport ExternalLink from \"../../common/ExternalLink\";\nimport AmazonBootcampBatch from \"../../BatchClassComponents/AmazonBootcampBatch\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../../services/api\";\nimport { versionCode } from \"../../../constant\";\nimport DOMPurify from \"dompurify\";\nimport get from \"lodash/get\";\n\nfunction UnsafeHTML(props) {\n const { html, Container, ...otherProps } = props;\n const sanitizedHTML = DOMPurify.sanitize(html);\n return (\n \n );\n}\n\nfunction AmazonCodingProgrammer({ pathwayId, pathwayCourseData }) {\n const dispatch = useDispatch();\n const user = useSelector(({ User }) => User);\n const { data } = useSelector((state) => state.Pathways);\n const pathway = useSelector((state) => state);\n const classes = useStyles();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n const upcomingBatchesData = useSelector((state) => {\n return state.Pathways?.upcomingBatches?.data;\n });\n\n // Filter batches with less than the dynamic max_enrolment value or no limit if null\n const filteredUpcomingBatches = upcomingBatchesData\n ?.filter((batch) => {\n const maxEnrolment = batch.max_enrolment;\n return maxEnrolment === null || batch.registrations.length < maxEnrolment;\n })\n .slice(0, 1);\n\n\n const enrolledBatches = useSelector((state) => {\n if (state?.Pathways?.enrolledBatches?.data?.length > 0) {\n return state?.Pathways?.enrolledBatches?.data;\n } else {\n return null;\n }\n });\n\n useEffect(() => {\n if (user?.data?.token && enrolledBatches?.length > 0) {\n dispatch(\n upcomingClassActions.getupcomingEnrolledClasses({\n pathwayId: pathwayId,\n authToken: user?.data?.token,\n })\n );\n } else {\n if (user?.data?.token) {\n dispatch(\n upcomingBatchesActions.getUpcomingBatches({\n pathwayId: pathwayId,\n authToken: user?.data?.token,\n })\n );\n }\n }\n }, [enrolledBatches]);\n\n const userEnrolledClasses = useSelector((state) => {\n return state.Pathways?.upcomingEnrolledClasses?.data;\n });\n\n return (\n \n {enrolledBatches ? (\n \n ) : (\n \n \n \n \n Learning Track\n \n \n Foundations of Data Structures and Algorithms\n \n \n {pathwayCourseData?.description}\n \n\n {pathwayCourseData?.summary.map((content, index) => {\n if (content.component === \"header\") {\n return (\n \n );\n } else {\n return (\n \n );\n }\n })}\n \n \n {filteredUpcomingBatches?.length > 0 ? (\n \n ) : (\n \n )}\n \n \n \n )}\n \n );\n}\n\nexport default AmazonCodingProgrammer;\n","import React, { useEffect } from \"react\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport CheckIcon from \"@mui/icons-material/Check\";\nimport Snackbar from \"@mui/material/Snackbar\";\nimport useStyles from \"./styles\";\nimport { Link, useHistory } from \"react-router-dom\";\nimport { PATHS, interpolatePath } from \"../../constant\";\nimport { useParams } from \"react-router-dom\";\nimport { breakpoints } from \"../../theme/constant\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { actions as pathwayActions } from \"./redux/action\";\nimport { actions as upcomingBatchesActions } from \"./redux/action\";\nimport { actions as upcomingClassActions } from \"./redux/action\";\nimport { actions as enrolledBatchesActions } from \"./redux/action\";\nimport ExternalLink from \"../common/ExternalLink\";\nimport LockIcon from \"@mui/icons-material/Lock\";\nimport NoBatchEnroll from \"../BatchClassComponents/NoBatchEnroll\";\nimport { CardContent } from \"@mui/material\";\n\n// import { ReactComponent as CertificateIcon } from \"./asset/certificate-grey.svg\";\nimport certificateGrey from \"./asset/certificate-grey.svg\";\n// import { ReactComponent as CertificateIconColored } from \"./asset/certificate-color.svg\";\nimport certificateColored from \"./asset/certificate-color.svg\";\nimport Modal from \"@mui/material/Modal\";\nimport CustomModal from \"./CustomModal\";\nimport CloseIcon from \"@mui/icons-material/Close\";\n\n\nimport { Card, Typography, CardActions, LinearProgress } from \"@mui/material\";\nimport McDigitalCourse from \"./McDigitalCourse\";\n// import ReactPDF from \"./ReactPDF.js\";\nimport {\n Container,\n Box,\n Grid,\n CardMedia,\n Button,\n Skeleton,\n FormControlLabel,\n Checkbox,\n} from \"@mui/material\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport PathwayCourseBatchEnroll1 from \"../BatchClassComponents/PathwayCourseBatchEnroll1\";\nimport PathwayCourseBatchEnroll2 from \"../BatchClassComponents/PathwayCourseBatchEnroll2\";\nimport PathwayCards from \"./PathwayCards/index.js\";\nimport { useState } from \"react\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../services/api\";\nimport CustomSnackbar from \"./customSnackbar\";\nimport MuiAlert from \"@mui/material/Alert\";\nimport { max } from \"date-fns\";\nimport AmazonCodingProgrammer from \"./AmazonCodingProgrammer\";\nimport DOMPurify from \"dompurify\";\nimport get from \"lodash/get\";\n\nfunction UnsafeHTML(props) {\n const { html, Container, ...otherProps } = props;\n const sanitizedHTML = DOMPurify.sanitize(html);\n return (\n \n );\n}\n\nconst Alert = React.forwardRef(function Alert(props, ref) {\n return ;\n});\n\nfunction saveFile(url) {\n // Get file name from url.\n var filename = url.substring(url.lastIndexOf(\"/\") + 1).split(\"?\")[0];\n var xhr = new XMLHttpRequest();\n xhr.responseType = \"blob\";\n xhr.onload = function () {\n let a = document.createElement(\"a\");\n a.href = window.URL.createObjectURL(xhr.response); // xhr.response is a blob\n a.download = filename; // Set the file name.\n a.style.display = \"none\";\n document.body.appendChild(a);\n a.click();\n };\n xhr.open(\"GET\", url);\n xhr.send();\n}\n\nfunction PathwayCourse() {\n const user = useSelector(({ User }) => User);\n const dispatch = useDispatch();\n const { pathwayCourse } = useSelector((state) => state.Pathways);\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const classes = useStyles({ isActive });\n const params = useParams();\n const pathwayId = params.pathwayId;\n const [completedPortion, setCompletedPortion] = useState({});\n const [openSnackbar, setOpenSnackbar] = useState(false);\n const [openModal, setOpenModal] = useState(false);\n\n const [isFormModalOpen, setisFormModalOpen] = useState(false);\n const [certificate, setCertificate] = useState(\"\");\n let completedAll = completedPortion?.total === 100;\n let [isFormFilled, setisFormFilled] = useState(false);\n\n const [open, setOpen] = React.useState(false);\n const [loader, setLoader] = useState(false);\n const [displayCert, setDisplayCert] = useState(false);\n const [pathwayCode, setPathwayCode] = useState(false);\n const [certificateCode, setCertificateCode] = useState(\"\");\n\n const [isChecked, setIsChecked] = useState(false); // State for checkbox\n\n const [userName, setUserName] = useState(\"\"); // State for storing user name\n\n useEffect(() => {\n const authData = JSON.parse(localStorage.getItem(\"__AUTH__\"));\n if (\n authData &&\n authData.data &&\n authData.data.user &&\n authData.data.user.name\n ) {\n setUserName(authData.data.user.name); // Set user name from local storage\n }\n }, []);\n\n const handleToggleCheckbox = () => {\n setIsChecked(!isChecked); // Toggle checkbox state\n };\n\n const handleCloseModal = () => {\n setOpenModal(false);\n };\n const modalStyle = {\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: isActive ? \"300px\" : \"544px\",\n bgcolor: \"background.paper\",\n outline: \"none\",\n borderRadius: \"8px\",\n box: 24,\n p: 4,\n };\n\n const data = useSelector((state) => {\n return state;\n });\n\n const upcomingBatchesData = useSelector((state) => {\n return state.Pathways?.upcomingBatches?.data;\n });\n\n const userEnrolledClasses = useSelector((state) => {\n return state.Pathways?.upcomingEnrolledClasses?.data;\n });\n\n const enrolledBatches = useSelector((state) => {\n if (state?.Pathways?.enrolledBatches?.data?.length > 0) {\n return state?.Pathways?.enrolledBatches?.data;\n } else {\n return null;\n }\n });\n\n const handleSnackbar = () => {\n setOpenSnackbar((prev) => !prev);\n };\n\n const handleModal = () => {\n setLoader(true);\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/certificate?pathway_code=${certificateCode}`,\n headers: {\n accept: \"application/json\",\n Authorization:\n user?.data?.token || localStorage.getItem(\"studentAuthToken\"),\n },\n })\n .then((response) => {\n setLoader(false);\n setCertificate(response?.data?.url);\n if (response) {\n setOpenModal((prev) => !prev);\n }\n })\n .catch((err) => {});\n };\n\n const downloadCert = () => {\n saveFile(certificate);\n };\n\n // const shareCertificate = () => {\n // if (navigator.share !== undefined) {\n // const title = `Check out my ${pathwayCourseData?.pathway} certificate`;\n // const text = `I completed a ${pathwayCourseData?.pathway} from Meraki!`;\n // const url = certificate;\n // navigator\n // .share({\n // title,\n // text,\n // url,\n // })\n // .catch((err) => console.error(err));\n // }\n // };\n\n const loading = useSelector((state) => {\n const upcomingBatchesState = state?.Pathways?.upcomingBatches;\n const enrolledBatchesState = state?.Pathways?.enrolledBatches;\n return (\n (!upcomingBatchesState ||\n !enrolledBatchesState ||\n upcomingBatchesState.loading ||\n enrolledBatchesState.loading) &&\n !(upcomingBatchesData?.length > 0) &&\n !(enrolledBatches?.length > 0)\n );\n });\n\n const history = useHistory();\n useEffect(() => {\n dispatch(\n pathwayActions.getPathwaysCourse({\n pathwayId: pathwayId,\n authToken: user?.data?.token,\n })\n );\n }, [dispatch, pathwayId]);\n\n ///////////////////////complete portion data////////////////////\n\n useEffect(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/teacher/checking`,\n headers: {\n accept: \"application/json\",\n Authorization:\n user?.data?.token || localStorage.getItem(\"studentAuthToken\"),\n },\n })\n .then((response) => {\n setisFormFilled(response.data);\n })\n .catch((err) => {});\n // }, [pathwayId, pathwayCourse]);\n }, []);\n\n useEffect(() => {\n if (user?.data?.token && pathwayId) {\n dispatch(\n enrolledBatchesActions.getEnrolledBatches({\n pathwayId: pathwayId,\n authToken: user?.data?.token,\n })\n );\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/${pathwayId}/totalProgress`,\n headers: {\n accept: \"application/json\",\n Authorization:\n user?.data?.token || localStorage.getItem(\"studentAuthToken\"),\n },\n })\n .then((response) => {\n setCompletedPortion((prevState) => ({\n ...prevState,\n total: response?.data?.total_completed_portion,\n }));\n\n response.data.pathway.map((item) => {\n setCompletedPortion((prevState) => ({\n ...prevState,\n [item.course_id]: item.completed_portion,\n }));\n });\n })\n .catch((err) => {});\n }\n }, [dispatch, pathwayId]);\n\n ////////////////// upcoming classes data ////////////////\n useEffect(() => {\n if (user?.data?.token && enrolledBatches?.length > 0) {\n dispatch(\n upcomingClassActions.getupcomingEnrolledClasses({\n pathwayId: pathwayId,\n authToken: user?.data?.token,\n })\n );\n } else {\n if (user?.data?.token) {\n dispatch(\n upcomingBatchesActions.getUpcomingBatches({\n pathwayId: pathwayId,\n authToken: user?.data?.token,\n })\n );\n }\n }\n }, [enrolledBatches, pathwayId]);\n\n /*For Content List Scroll Position*/\n useEffect(() => {\n try {\n if (localStorage.getItem(\"contentListScroll\")) {\n localStorage.removeItem(\"contentListScroll\");\n }\n } catch (error) {\n return {};\n }\n try {\n if (localStorage.getItem(\"contentListScrollMobile\")) {\n localStorage.removeItem(\"contentListScrollMobile\");\n }\n } catch (error) {\n //console.error('Error accessing localStorage:',);\n return {};\n }\n }, []);\n\n const pathwayCourseData = data.Pathways.data?.pathways.find((item) => {\n return item.id == pathwayId;\n });\n\n useEffect(() => {\n if (pathwayCourse?.data) {\n setCertificateCode(pathwayCourse?.data?.code);\n pathwayCourse?.data.code === \"PRGPYT\" ||\n pathwayCourse?.data.code === \"TCBPI\" ||\n pathwayCourse?.data.code === \"SCRTHB\"\n ? setDisplayCert(true)\n : setDisplayCert(false);\n }\n }, [pathwayCourse?.data]);\n\n const onHandleSnackbarOpen = () => {\n setOpen(true);\n };\n const handleOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n const handleFormModal = () => {\n setisFormModalOpen(true);\n };\n\n // const PopupBox = styled(Dialog)(({ theme }) => ({\n // '& .MuiDialogContent-root': {\n // padding: theme.spacing(2),\n // },\n // '& .MuiDialogActions-root': {\n // padding: theme.spacing(1),\n // },\n // }));\n\n // const handleClickOpen = () => {\n // setOpen(true);\n // };\n\n return (\n <>\n \n {user.data !== null ? (\n \n Please share your teacher details first to start the course\n \n ) : (\n \n Please Login First and Share your Details to Unlock The course\n \n )}\n \n \n {pathwayCourse?.data?.type === \"withoutCourse\" ? (\n \n ) : (\n <>\n {/* ............enroll class heading............... */}\n {enrolledBatches && !loading ? (\n <>\n \n {enrolledBatches[0]?.title}\n \n >\n ) : (\n \"\"\n )}\n {/*............... certificate modal.............. */}\n\n \n \n \n \n \n {\" \"}\n {`${pathwayCourse?.data?.name\n ?.split(\" \")\n .pop()} Certificate`}\n \n \n \n \n Your name on the certificate as per our records\n \n \n {userName}\n \n \n Please ensure that your name is correct. In case, there is a\n mistake, please change your name in the\n “Profile” \n section\n \n \n }\n label=\"I confirm that my name displayed above is correct\"\n sx={{ mt: 4 }}\n />\n \n {/* Share to Friends */}\n \n Get Certificate\n \n \n \n \n\n {/* ................UserEnroll classs................. */}\n\n {enrolledBatches ? (\n <>\n \n >\n ) : (\n pathwayCourse?.data && (\n <>\n \n \n \n \n {pathwayCourse?.data.name}\n \n \n {/* {pathwayCourse?.data.description} */}\n Explore and learn the essential material and tools to\n start \n supporting your students learning on Meraki\n \n\n {pathwayCourse?.data.video_link && (\n \n \n \n \n {\" \"} \n What's it all about? \n \n \n \n )}\n\n {/* .....summary .......*/}\n {pathwayCourse?.data?.code === \"TCBPI\" &&\n pathwayCourse?.data?.summary.map((content, index) => {\n if (content.component === \"text\") {\n return (\n \n );\n }\n })}\n\n {/* ..........login button when user are not login............... */}\n\n {!user?.data?.token &&\n (pathwayCourse?.data.code == \"PRGPYT\" ||\n pathwayCourse?.data.code == \"SPKENG\") && (\n <>\n \n Want to learn through live classes by a teacher?\n \n {\n history.push(PATHS.LOGIN);\n }}\n >\n Login\n \n >\n )}\n \n \n {/* ........upcoming classes............ */}\n \n {user?.data?.token &&\n (pathwayCourse?.data.code == \"PRGPYT\" ||\n pathwayCourse?.data.code == \"SPKENG\") &&\n (loading ? (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ) : upcomingBatchesData?.length > 0 ? (\n \n ) : (\n \n ))}\n \n \n\n {/* ...............Learning outcomes..................... */}\n {pathwayCourse?.data?.outcomes.length > 0 && (\n \n \n Learning Outcomes\n \n \n {pathwayCourse?.data.outcomes.map((content, index) => {\n if (content.component === \"text\") {\n return (\n \n \n \n \n \n \n \n \n );\n }\n })}\n \n \n )}\n >\n )\n )}\n {/* ................Courses........................ */}\n\n \n {pathwayCourse?.data?.code === \"TCBPI\" ? (\n isFormFilled ? (\n \n ) : (\n \n \n \n \n Please take out few minutes and fill your details\n \n \n The details will be used for partner report purposes\n only\n \n \n \n Fill Your Details\n \n \n \n )\n ) : (\n <>\n \n Courses\n \n\n \n {pathwayCourse?.data?.courses?.map((item, index) => (\n \n \n \n \n \n \n {!isFormFilled && pathwayCode ? (\n \n ) : (\n \n {index + 1}\n \n )}\n\n \n {item.name}\n \n
\n \n \n \n \n \n \n \n ))}\n \n >\n )}\n\n {/* ...............certificate three dot button................ */}\n\n \n\n {displayCert ? (\n \n \n \n \n \n {completedAll ? (\n loader ? (\n \n ) : (\n // \n \n )\n ) : (\n // \n \n )}\n \n {pathwayCourse?.data?.name} Certificate\n \n \n \n\n \n ) : null}\n \n \n >\n )}{\" \"}\n ;\n >\n );\n}\nexport default PathwayCourse;\n","import React, { useEffect } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { actions as pathwayActions } from \"../../PathwayCourse/redux/action\";\nimport { useDispatch } from \"react-redux\";\nimport { breakpoints } from \"../../../theme/constant\";\nimport {\n Container,\n Box,\n Grid,\n Card,\n Typography,\n Button,\n Stack,\n} from \"@mui/material\";\nimport { Link } from \"react-router-dom\";\nimport { interpolatePath, PATHS } from \"../../../constant\";\nimport useStyles from \"../styles\";\n\nfunction ResidentialProgramme() {\n const dispatch = useDispatch();\n const user = useSelector(({ User }) => User);\n const { data } = useSelector((state) => state.Pathways);\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const isActiveIpad = useMediaQuery(\"(max-width:1300px)\");\n\n const classes = useStyles();\n\n useEffect(() => {\n dispatch(\n pathwayActions.getPathways({\n authToken: user,\n })\n );\n }, [dispatch]);\n\n const resPathway =\n data && data.pathways.find((pathway) => pathway.code === \"PRCRSE\");\n const pathwayCourse = resPathway && resPathway.courses;\n\n return (\n \n \n \n \n \n Learning Track\n \n \n Residential Programme Info- Track\n \n \n Navgurukul, our parent organization, offers fully funded 1 year\n software engineering programme. Learn all about it in this\n introductory course and get ready to apply for it.\n \n \n \n \n\n \n \n Courses\n \n \n {pathwayCourse &&\n pathwayCourse.map((item, index) => (\n \n \n \n \n \n \n {index + 1}\n \n \n {item.name}\n \n
\n \n \n \n ))}\n \n \n\n {/* \n Have you completed the overview? \n \n \n Yes, let's take the test\n \n \n */}\n \n );\n}\n\nexport default ResidentialProgramme;\n","import React, { useEffect } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { actions as courseActions } from \"../../Course/redux/action\";\nimport { actions as pathwayActions } from \"../../PathwayCourse/redux/action\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../../theme/constant\";\n\nimport { Link } from \"react-router-dom\";\nimport { PATHS, interpolatePath } from \"../../../constant\";\nimport { Container, Box, Grid, Card, Typography } from \"@mui/material\";\nimport useStyles from \"../styles\";\n\nfunction MiscellaneousCourses() {\n const dispatch = useDispatch();\n const user = useSelector(({ User }) => User);\n const { data } = useSelector(({ Course }) => Course);\n const pathway = useSelector((state) => state);\n const classes = useStyles();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n useEffect(() => {\n dispatch(courseActions.getCourses());\n }, [dispatch]);\n\n useEffect(() => {\n dispatch(\n pathwayActions.getPathways({\n authToken: user,\n })\n );\n }, [dispatch, user]);\n\n const pathwayCourseId =\n (pathway.Pathways.data &&\n pathway.Pathways.data.pathways\n .map((pathway) => pathway.courses || [])\n .flat()\n .map((course) => course.id)) ||\n [];\n\n const otherCourses =\n data &&\n data.allCourses.filter(\n (item) => pathwayCourseId && !pathwayCourseId.includes(item.id)\n );\n\n return (\n \n \n \n \n \n \n Miscellaneous Courses\n \n \n Do you want to delve into Android, Game Development, Web Dev\n Basics or just some fun projects? Check out these courses for a\n sneak peak into these exciting fields.\n \n \n \n \n\n \n \n Courses\n \n \n {otherCourses &&\n otherCourses.map((item, index) => (\n \n \n \n \n {item.name}\n \n \n \n \n ))}\n \n \n \n \n );\n}\n\nexport default MiscellaneousCourses;\n","import { useQuery } from \"./url\";\nimport { useEffect } from \"react\";\n\n/**\n * A custom hook that calls the provided function, if any, every time the\n * search parameter of the query string changes\n * @param {Function} cb the function to call with the search parameter or empty\n * string if it's not present\n * @return {string} the value of the search parameter in the query string, if\n * present, otherwise the empty string\n */\nexport const useSearchQuery = (cb) => {\n const query = useQuery();\n const search = query.get(\"search\") || \"\";\n useEffect(() => {\n if (typeof cb === \"function\") {\n cb(search);\n }\n }, [search]);\n\n return search;\n};\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n course: {\n paddingBottom: 40,\n },\n courseCard: {\n marginBottom: 10,\n },\n box: {\n marginLeft: \"16px\",\n marginTop: 32,\n },\n courseName: {\n background: \"#E9F5E9\",\n width: \"24px\",\n height: \"24px\",\n borderRadius: \"50%\",\n },\n pathwayCard: {\n margin: \"15px 0\",\n \"&:hover\": {\n boxShadow:\n \"0px 16px 24px rgba(0, 0, 0, 0.06), 0px 6px 30px rgba(0, 0, 0, 0.04), 0px 8px 10px rgba(0, 0, 0, 0.08)\",\n },\n },\n pathwayLink: {\n textDecoration: \"none\",\n },\n courseImage: {\n objectFit: \"cover\",\n width: \"100%\",\n height: \"200px\",\n borderRadius: \"8px\",\n },\n courseTitleNumber: {\n display: \"flex\",\n alignItems: \"baseline\",\n paddingTop: \"16px\",\n },\n}));\n\nexport default useStyles;\n","import React, { useEffect, useState, useRef } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { useLocation } from \"react-router-dom\";\nimport { useHistory } from \"react-router-dom\";\nimport { actions as courseActions } from \"../Course/redux/action\";\nimport { actions as pathwayActions } from \"../PathwayCourse/redux/action\";\nimport { breakpoints } from \"../../theme/constant\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { Link } from \"react-router-dom\";\nimport { PATHS, interpolatePath } from \"../../constant\";\nimport { useSearchQuery } from \"../../common/search\";\nimport {\n Box,\n TextField,\n Container,\n Typography,\n Grid,\n Card,\n} from \"@mui/material\";\nimport useStyles from \"./styles\";\nimport { Popover, InputAdornment } from \"@mui/material\";\nimport SearchOutlinedIcon from \"@mui/icons-material/SearchOutlined\";\nimport { METHODS } from \"../../services/api\";\nimport axios from \"axios\";\n\nfunction usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n }, [value]);\n return ref.current;\n}\n\nfunction SearchCourse(props) {\n const { data } = useSelector(({ Course }) => Course);\n const pathway = useSelector((state) => state.Pathways);\n const dispatch = useDispatch();\n\n const [search, setSearch] = useState(\"\");\n const [focus, setFocus] = useState(true);\n\n const prevSearch = usePrevious(search);\n\n useSearchQuery(setSearch);\n const history = useHistory();\n const classes = useStyles();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const [updated, setUpdated] = useState(\"\");\n const user = useSelector(({ User }) => User);\n const userId = user.data?.user.id;\n\n useEffect(() => {\n setUpdated(search);\n }, [search]);\n\n useEffect(() => {\n dispatch(courseActions.getCourses());\n }, [dispatch]);\n\n useEffect(() => {\n dispatch(\n pathwayActions.getPathways({\n authToken: user,\n })\n );\n }, [dispatch, user]);\n\n const handleSearchChange = (e) => {\n if (e.key == \"Enter\") {\n if (e.target.value == \"\") {\n history.replace(`/search-course/?search=${prevSearch}`);\n } else {\n history.replace(`/search-course/?search=${e.target.value}`);\n }\n e.preventDefault();\n }\n };\n\n // useEffect(() => {\n // const data = JSON.parse(localStorage.getItem(\"recent\"));\n // if (data !== null) {\n // setrecentSearch(data);\n // }\n // }, [setrecentSearch]);\n\n const pathwayCourseIds =\n pathway.data?.pathways\n .map((pathway) => pathway.courses || [])\n .flat()\n .map((course) => course.id) || [];\n\n const otherCourseResults = data?.allCourses.filter((item) => {\n return (\n // item.course_type === \"json\" &&\n !pathwayCourseIds.includes(item.id) &&\n item.name.toLowerCase().includes(search.toLowerCase())\n );\n });\n\n const pathwayTrackResults = pathway.data?.pathways\n .map((pathway) => {\n return {\n ...pathway,\n courses: pathway.courses?.filter((course) => {\n return course.name.toLowerCase().includes(search.toLowerCase());\n }),\n };\n })\n .filter((pathway) => pathway.courses?.length > 0);\n\n const hasSearchResults =\n pathwayTrackResults?.length > 0 || otherCourseResults?.length > 0;\n\n // const handleDataBar = (name) => {\n // if (!recentSearch.includes(name)) {\n // localStorage.setItem(\"recent\", JSON.stringify([...recentSearch, name]));\n // }\n // };\n\n const countCourse = pathwayTrackResults?.map((item) => {\n return item.courses?.length;\n });\n\n let sum = countCourse?.reduce((total, item) => {\n return total + item;\n }, 0);\n\n let misscount = otherCourseResults?.length;\n\n let totalCourse = sum + misscount;\n\n const onPopularsearch = (name) => {\n if (user.data !== null) {\n axios({\n method: METHODS.POST,\n url: `${process.env.REACT_APP_MERAKI_URL}/search/${userId}/${name}`,\n headers: {\n accept: \"application/json\",\n Authorization: user.data?.token || \"\",\n },\n data: {\n name: name,\n user_id: userId,\n },\n })\n .then((res) => {\n // console.log(res)\n })\n .catch((err) => {});\n }\n };\n\n return (\n <>\n \n \n \n \n ),\n }}\n sx={{ margin: \"40px 0px 0px 0px\" }}\n inputRef={(input) => {\n if (input != null) {\n input.focus();\n }\n }}\n variant=\"standard\"\n fullWidth\n value={updated}\n onKeyPress={handleSearchChange}\n onChange={(e) => {\n setUpdated(e.target.value);\n }}\n />\n \n {isNaN(totalCourse) ? 0 : totalCourse} result found\n \n \n \n {/* {recentSearch} */}\n \n {search ? (\n <>\n \n {pathwayTrackResults?.map((pathway, index) => {\n return (\n <>\n \n {pathway.name}\n \n \n {pathway.courses.map((item, index) => (\n \n \n {\n onPopularsearch(item.name);\n }}\n >\n \n \n \n {index + 1}\n \n \n {item.name}\n \n
\n \n \n \n ))}\n \n >\n );\n })}\n\n {otherCourseResults?.length > 0 && (\n <>\n \n Miscellaneous Courses\n \n \n {otherCourseResults?.map((item, index) => (\n <>\n \n \n {\n onPopularsearch(item.name);\n }}\n >\n \n {item.name}\n \n \n \n \n >\n ))}\n \n >\n )}\n \n {!hasSearchResults && (\n <>\n \n \n \n \n Whoops. The results for taken away!\n \n Please try a new search\n \n >\n )}\n >\n ) : null}\n \n \n >\n );\n}\n\nexport default SearchCourse;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n volunteerFlow: {\n paddingTop: \"5px\",\n },\n volunteerImg: {\n width: \"500px\",\n paddingLeft: \"32px\",\n },\n volunteerImg1: {\n width: \"350px\",\n },\n volunteerCard: {\n border: \"1px solid #48A145\",\n height: \"95%\",\n padding: \"16px\",\n borderRadius: \"8px !importent\",\n },\n volunteerCard1: {\n border: \"1px solid #FFCC00\",\n height: \"95%\",\n padding: \"16px\",\n },\n volunteerCard2: {\n border: \"1px solid #FFCC00\",\n height: \"95%\",\n padding: \"16px 16px 0px 16px\",\n },\n displayIcon: {\n display: \"flex\",\n marginTop: \"8px\",\n },\n IconColor: {\n color: \"#6D6D6D\",\n },\n TextContent: {\n paddingLeft: \"10px\",\n // color: \"#000000\",\n },\n\n VolunteerHrline: {\n width: \"200px\",\n height: \"4px\",\n background: \"#2196F3\",\n },\n\n TrackCard: {\n maxWidth: 256,\n height: 171,\n \"&:hover\": {\n border: \"1px solid #48A145\",\n boxShadow:\n \"0px 16px 24px rgba(0, 0, 0, 0.06), 0px 6px 30px rgba(0, 0, 0, 0.04), 0px 8px 10px rgba(0, 0, 0, 0.08)\",\n },\n },\n selectedTrack: {\n boxShadow: \"1px 1px 0px #E9F5E9\",\n maxWidth: 256,\n height: 171,\n border: \"1px solid #48A145\",\n },\n TrackButtonBox: {\n display: \"flex\",\n justifyContent: \"flex-end\",\n marginBottom: \"20px\",\n },\n TrackImages: {\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n height: \"100%\",\n flexDirection: \"column\",\n },\n link: {\n textDecoration: \"none\",\n },\n backToAllClasses: {\n lineHeight: 1.5,\n fontWeight: 700,\n fontFamily: \"Lusitana\",\n fontSize: \"1.5rem\",\n },\n classCard: {\n padding: \"18px \",\n height: \"320px\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"space-between\",\n },\n}));\n\nexport default useStyles;\n","import React from \"react\";\nimport { useHistory } from \"react-router-dom\";\nimport {\n Typography,\n Container,\n Grid,\n Box,\n Button,\n Card,\n CardContent,\n CardActions,\n useMediaQuery,\n} from \"@mui/material\";\nimport { PATHS } from \"../../constant\";\nimport { useSelector } from \"react-redux\";\nimport useStyles from \"./styles\";\nimport ArrowRightAltIcon from \"@mui/icons-material/ArrowRightAlt\";\nimport { breakpoints } from \"../../theme/constant\";\n\nfunction VolunteerAutomation() {\n const classes = useStyles();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const isActiveIpad = useMediaQuery(\"(max-width:1300px)\");\n\n const user = useSelector(({ User }) => User);\n let history = useHistory();\n\n const pathname = window.location.pathname;\n const rolesList = user?.data?.user.rolesList; // TODO: Use selector\n\n const handleClick = () => {\n if (rolesList) {\n history.push(PATHS.VOLUNTEER_FORM);\n // if (rolesList.includes(\"volunteer\")) {\n // history.push(PATHS.CLASS);\n // } else {\n // history.push(PATHS.VOLUNTEER_FORM);\n // }\n } else {\n history.push(PATHS.LOGIN, pathname);\n }\n };\n\n return (\n \n \n \n \n \n Help Students Get their Dream Job in Tech\n \n \n Why Volunteer?\n \n \n \n \n Gain a wide network to leverage for advancing your skills and\n career prospects.\n \n \n \n \n \n Help students from low-income families to get their first job in\n tech.\n \n \n \n \n \n \n \n \n \n \n \n Areas to Volunteer In\n \n\n \n \n \n \n \n \n Teaching\n \n \n \n \n Python\n \n \n \n \n \n Spoken English\n \n \n \n \n {\" \"}\n Expected effort\n \n : 2 hours / week for 15 weeks\n \n \n Please volunteer only if you are professional who has worked\n with Python or have great command over English.\n \n \n \n \n Start Now\n \n \n \n \n \n \n \n \n \n Tech\n \n \n \n \n UX/Graphic Design\n \n \n \n \n \n Android (Kotlin)\n \n \n \n \n \n Front End Dev (React)\n \n \n\n \n \n \n Back End Dev\n \n \n\n \n \n \n Project Management\n \n \n \n \n \n Curriculum Creation & Translation\n \n \n \n \n \n Expected effort\n \n : 4 hours / week for 15 weeks\n \n \n You will be taken to a Google form.\n \n \n \n \n \n Start Now\n \n \n \n \n \n \n );\n}\n\nexport default VolunteerAutomation;\n","import React, { useEffect } from \"react\";\nimport {\n Typography,\n Container,\n Grid,\n Box,\n CardMedia,\n useMediaQuery,\n Card,\n} from \"@mui/material\";\nimport { breakpoints } from \"../../theme/constant\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { actions as pathwayActions } from \"../PathwayCourse/redux/action\";\nimport useStyles from \"./styles\";\n\nfunction SelectTrack({ setDisable, pathwayId, setPathwayId }) {\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const user = useSelector(({ User }) => User);\n const classes = useStyles();\n const { data } = useSelector((state) => state.PathwaysDropdow);\n useEffect(() => {\n if (pathwayId.length === 0) {\n setDisable(true);\n } else {\n setDisable(false);\n }\n }, [pathwayId]);\n const handleChange = (id) => {\n if (pathwayId.includes(id)) {\n setPathwayId(pathwayId.filter((item) => item !== id));\n } else {\n setPathwayId([...pathwayId, id]);\n }\n };\n\n const dispatch = useDispatch();\n\n useEffect(() => {\n dispatch(\n pathwayActions.getPathwaysDropdown({\n authToken: user,\n })\n );\n }, [dispatch, user]);\n\n return (\n \n \n \n Please choose what you’d like to teach\n \n \n We run the learning tracks in a batch format with multiple live\n classes.\n \n \n \n \n {data &&\n data.pathways &&\n data.pathways.map((item) => {\n if (\n item.name === \"Python\" ||\n item.name === \"Spoken English\" ||\n item.name?.toLocaleLowerCase() ===\n \"Amazon Coding Bootcamp\".toLocaleLowerCase()\n ) {\n return (\n \n handleChange(item.id)}\n >\n \n \n {item.name} \n \n \n \n );\n }\n })}\n \n \n \n );\n}\n\nexport default SelectTrack;\n","import React, { useEffect } from \"react\";\nimport { Typography, Container, Stack, Button } from \"@mui/material\";\n\nfunction Confirmation({ setDisable }) {\n useEffect(() => {\n setDisable(false);\n }, []);\n\n return (\n \n \n We can’t wait to see you taking classes\n \n \n It’s all done. Thanks for completing the short onboarding. Your students\n are eager to meet you in the first class\n \n\n \n \n \n \n );\n}\n\nexport default Confirmation;\n","import React, { useEffect } from \"react\";\nimport {\n Grid,\n Typography,\n Container,\n TextField,\n Box,\n FormLabel,\n FormGroup,\n FormControlLabel,\n Checkbox,\n Stack,\n} from \"@mui/material\";\nimport { LocalizationProvider } from \"@mui/x-date-pickers/LocalizationProvider\";\nimport { DesktopTimePicker } from \"@mui/x-date-pickers/DesktopTimePicker\";\nimport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\nimport moment from \"moment\";\nimport DesktopDatePicker from \"@mui/lab/DesktopDatePicker\";\nimport itLocale from \"date-fns/locale/it\";\n\nfunction Availability({ setAvailability, availability, setDisable }) {\n const days = {\n MO: \"Mon\",\n TU: \"Tue\",\n WE: \"Wed\",\n TH: \"Thu\",\n FR: \"Fri\",\n SA: \"Sat\",\n SU: \"Sun\",\n };\n\n const handleChange = (e) => {\n setAvailability({ ...availability, [e.target.name]: e.target.value });\n };\n\n const handleDaySelection = (e) => {\n const index = availability.available_on_days.indexOf(e.target.value);\n if (index === -1) {\n setAvailability({\n ...availability,\n [\"available_on_days\"]: [\n ...availability.available_on_days,\n e.target.value,\n ],\n });\n } else {\n const dayDeleted = availability.available_on_days.filter(\n (selectedDay) => selectedDay !== e.target.value\n );\n setAvailability({ ...availability, [\"available_on_days\"]: dayDeleted });\n }\n };\n\n useEffect(() => {\n if (\n availability.hours_per_week.length > 0 &&\n availability.available_on_days.length > 0\n // &&\n // availability.available_on_time.length > 0\n ) {\n setDisable(false);\n } else {\n setDisable(true);\n }\n }, [availability]);\n\n return (\n \n \n Please tell us your availability to teach\n \n \n We recommend giving nearly 3 hours per week for about 15 weeks duration.\n \n\n \n handleChange(e)}\n value={availability.hours_per_week}\n name=\"hours_per_week\"\n id=\"contact\"\n variant=\"outlined\"\n fullWidth\n />\n \n\n \n \n Available on days\n \n \n \n {Object.keys(days).map((item) => (\n \n }\n // onClick={() => {\n // setOnInput((prev) => {\n // return { ...prev, days: true };\n // });\n // }}\n label={item}\n labelPlacement={item}\n />\n ))}\n \n\n \n \n Please provide 3 preferred start times in a day (Classes are of 1\n hour)\n \n \n {[\n { label: \"First Start Time\", prop: \"first_time\" },\n { label: \"Second Start Time\", prop: \"second_time\" },\n { label: \"Third Start Time\", prop: \"third_time\" },\n ].map(({ label, prop }) => (\n \n \n {\n // setAvailability({\n // ...availability,\n // [prop]: time,\n // });\n // }}\n onChange={(time) => {\n // let time = time.getHours() + \":\" + time.getMinutes()\n setAvailability({\n ...availability,\n [\"available_on_time\"]: {\n ...availability.available_on_time,\n [prop]: time,\n },\n });\n }}\n // minTime={\n // availability.date === moment().format(\"YYYY-MM-DD\")\n // ? new Date(new Date().setSeconds(0))\n // : null\n // }\n renderInput={(params) => }\n />\n \n \n ))}\n \n \n \n );\n}\n\nexport default Availability;\n","import React, { useEffect } from \"react\";\nimport { Typography, Container, Box } from \"@mui/material\";\nimport ExternalLink from \"../common/ExternalLink\";\nimport ArrowRightAltIcon from \"@mui/icons-material/ArrowRightAlt\";\nimport useStyles from \"./styles\";\n\nfunction CodeOfConduct({ setDisable }) {\n const classes = useStyles();\n\n useEffect(() => {\n setDisable(false);\n }, []);\n\n return (\n \n \n \n Code of Conduct\n \n \n We work with girls (primarily minors) from low-income families. Hence,\n as a volunteer, you must understand and abide by the code of conduct\n and privacy policy.\n \n \n \n \n Video during calls is optional. If enabling video, please maintain\n an appropriate dress standard.\n \n \n \n \n \n Please keep the interactions polite. No one should convey abusive\n language and irrelevant material in speech or writing.\n \n \n \n \n \n We respect your and the student's privacy. Please do not share/ask\n for personal contact details.\n \n \n \n \n \n Raise any concerns you witness to the Meraki team and treat all\n students fairly and equally.\n \n \n \n The above are the most important points to keep in mind. However,\n please feel free to read our detailed{\" \"}\n \n Volunteering with Meraki \n {\" \"}\n To proceed to next step\n \n \n \n );\n}\n\nexport default CodeOfConduct;\n","import React, { useEffect, useState } from \"react\";\nimport {\n Typography,\n Container,\n Box,\n TextField,\n Button,\n Snackbar,\n Grid,\n} from \"@mui/material\";\nimport {\n getAuth,\n RecaptchaVerifier,\n signInWithPhoneNumber,\n} from \"firebase/auth\";\nimport axios from \"axios\";\nimport { initializeApp } from \"firebase/app\";\nimport MuiPhoneNumber from \"material-ui-phone-number\";\n\nconst firebaseConfig = {\n apiKey: process.env.REACT_APP_API_KEY,\n authDomain: process.env.REACT_APP_authDomain,\n projectId: process.env.REACT_APP_projectId,\n storageBucket: process.env.REACT_APP_storageBucket,\n messagingSenderId: process.env.REACT_APP_messagingSenderId,\n appId: process.env.REACT_APP_appId,\n};\n\nconst CountryList = require(\"country-list-with-dial-code-and-flag\");\n\nfunction VerifyPhoneNo(props) {\n const { setDisable, setContact, contact, setNextButton } = props;\n const [otp, setOtp] = useState(\"\");\n const [bgColor, setBgColor] = useState(false);\n const [verifyOpen, setVerifyOpen] = useState(false);\n const [generateOtp, setGenerateOtp] = useState(true);\n const [startOtp, setStartOtp] = useState(false);\n const [confirmationResult, setConfirmationResult] = useState(null);\n const [timer, setTimer] = useState(\"5:00\");\n const [isStartTimer, setIsStartTimer] = useState(false);\n const [countryCode, setCountryCode] = useState(\n (contact && `${contact?.split(\" \")[0]}`) || \"+91\"\n );\n const [phone, setPhone] = useState(\"\");\n const phoneData = `${countryCode.slice(1)}-${phone}`;\n const app = initializeApp(firebaseConfig);\n\n const handleChange = (event) => {\n const number = event.target.value?.replace(/[^0-9]/g, \"\") || \"\";\n if (number.length <= 10) {\n setPhone(number);\n }\n };\n\n useEffect(() => {\n setDisable(true);\n setNextButton(false);\n if (contact) {\n setDisable(false);\n setNextButton(true);\n setVerifyOpen(true);\n setGenerateOtp(false);\n }\n }, [contact]);\n\n const [open, setOpen] = useState(false);\n const [message, setMessage] = useState(\"\");\n\n const handleClose = () => {\n setOpen(false);\n setMessage(\"\");\n };\n\n const setupRecaptcha = () => {\n const auth = getAuth();\n window.recaptchaVerifier = new RecaptchaVerifier(\n \"recaptcha-container\",\n {\n size: \"invisible\",\n callback: () => {\n onSignInSubmit();\n },\n },\n auth\n );\n };\n\n const countTimer = () => {\n setIsStartTimer(true);\n let countDownDate = new Date().getTime() + 300000;\n const interval = setInterval(() => {\n let now = new Date().getTime();\n let distance = countDownDate - now;\n let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));\n let seconds = Math.floor((distance % (1000 * 60)) / 1000);\n setTimer(`${minutes}:${seconds < 10 ? \"0\" : \"\"}${seconds}`);\n if (distance < 0) {\n clearInterval(interval);\n setTimer(null);\n setIsStartTimer(false);\n setOtp(\"\");\n setStartOtp(false);\n }\n }, 1000);\n };\n\n const onSignInSubmit = async () => {\n try {\n const response = await axios({\n url: `${process.env.REACT_APP_MERAKI_URL}/volunteers/${phoneData}`,\n method: \"GET\",\n headers: {\n accept: \"application/json\",\n },\n });\n if (response.data !== \"please register your mobile number\") {\n setOpen(true);\n setMessage(response.data);\n } else {\n if (!confirmationResult) {\n setupRecaptcha();\n }\n const phoneNumber = `${countryCode} ${phone}`;\n setContact(phoneNumber);\n const appVerifier = window.recaptchaVerifier;\n const auth = getAuth();\n signInWithPhoneNumber(auth, phoneNumber, appVerifier)\n .then((result) => {\n setMessage(\"OTP sent successfully\");\n setOpen(true);\n setStartOtp(true);\n setConfirmationResult(result);\n countTimer();\n setVerifyOpen(false);\n })\n .catch(() => {\n setMessage(\"Enter valid phone number or tried too many times\");\n setOpen(true);\n });\n }\n } catch (e) {\n console.log(e);\n }\n };\n\n const verifyOtp = () => {\n confirmationResult\n .confirm(otp)\n .then(() => {\n setMessage(\"Phone number verified successfully\");\n setOpen(true);\n setDisable(false);\n setIsStartTimer(false);\n setVerifyOpen(true);\n setNextButton(true);\n })\n .catch(() => {\n setMessage(\"Invalid OTP\");\n setOpen(true);\n setOtp(\"\");\n setBgColor(true);\n });\n };\n\n const countryData = CountryList.findFlagByDialCode(countryCode);\n\n return (\n \n
\n \n Please provide your phone number.\n \n \n {generateOtp ? (\n \n \n setCountryCode(val)}\n />\n \n \n \n \n \n ) : (\n {`${countryData.dial_code} ${contact.split(\" \")[1]}`} \n )}\n\n {!startOtp && generateOtp && (\n \n Generate OTP\n \n )}\n\n {startOtp && (\n <>\n setOtp(e.target.value)}\n fullWidth\n sx={{ mt: 2 }}\n inputProps={{\n maxLength: 6,\n style: {\n backgroundColor: bgColor ? \"#fdecea\" : \"inherit\",\n },\n }}\n />\n \n {`OTP expires in ${isStartTimer ? timer : \"\"}`}\n \n \n Verify OTP\n \n >\n )}\n\n {verifyOpen && (\n \n You have been verified successfully.\n \n )}\n\n \n \n \n );\n}\n\nexport default VerifyPhoneNo;\n","import React from \"react\";\nimport { Typography, Container } from \"@mui/material\";\nimport ReactPlayer from \"react-player\";\n\nfunction IntroVideo({ setDisable }) {\n const handleProgress = (secs) => {\n if (secs > 1) {\n setDisable(false);\n }\n };\n\n return (\n \n \n \n Our teaching philosophy\n \n handleProgress(e.playedSeconds)}\n />\n \n \n );\n}\n\nexport default IntroVideo;\n","import React, { useState } from \"react\";\nimport { PATHS } from \"../../constant\";\nimport Stepper from \"@mui/material/Stepper\";\nimport Step from \"@mui/material/Step\";\nimport { useHistory } from \"react-router-dom\";\nimport { StepLabel } from \"@mui/material\";\nimport Dialog from \"@mui/material/Dialog\";\nimport DialogActions from \"@mui/material/DialogActions\";\nimport DialogContent from \"@mui/material/DialogContent\";\nimport DialogContentText from \"@mui/material/DialogContentText\";\nimport DialogTitle from \"@mui/material/DialogTitle\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport {\n Container,\n Box,\n AppBar,\n Toolbar,\n Typography,\n Button,\n Select,\n MenuItem,\n IconButton,\n} from \"@mui/material\";\nimport ArrowBackIosIcon from \"@mui/icons-material/ArrowBackIos\";\nimport ArrowForwardIosIcon from \"@mui/icons-material/ArrowForwardIos\";\nimport SelectTrack from \"./SelectTrack\";\nimport Confirmation from \"./Confirmation\";\nimport AttendClass from \"./AttendClass\";\nimport Availability from \"./Availability\";\nimport CodeOfConduct from \"./CodeOfConduct\";\nimport VerifyPhoneNo from \"./VerifyPhoneNo\";\nimport IntroVideo from \"./IntroVideo\";\nimport axios from \"axios\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { METHODS } from \"../../services/api\";\nimport { actions } from \"../User/redux/action\";\nimport { Link } from \"react-router-dom\";\nimport \"./styles.scss\";\nimport { getObjectState, saveObjectState } from \"../../common/storage\";\n\nfunction HorizontalLinearStepper() {\n let history = useHistory();\n const user = useSelector(({ User }) => User);\n const roles = user?.data?.user.rolesList; // TODO: Use selector for this\n const uid = user?.data?.user.id; // TODO: Factor out common logic used for selected role PR # 660\n const allUsersState = getObjectState(\"volunteer_automation\", \"state\");\n const currentState = allUsersState?.[uid] || {\n completed: [],\n };\n const dispatch = useDispatch();\n const [activeStep, setActiveStep] = React.useState(currentState.step || 0);\n const [skipped, setSkipped] = React.useState(new Set());\n const [completed, setCompleted] = React.useState(currentState.completed);\n const [disable, setDisable] = React.useState(!completed[activeStep]);\n const [contact, setContact] = useState(currentState.contact);\n const [pathwayId, setPathwayId] = useState(currentState.pathwayId || []);\n const [enrollId, setEnrollId] = useState(currentState.enrollId || null);\n const [open, setOpen] = React.useState(false);\n const [nextButton, setNextButton] = React.useState(\"true\");\n const [countryCode, setCountryCode] = React.useState(\"\");\n const [phone, setPhone] = React.useState(\"\");\n\n const current_time = new Date();\n const [availability, setAvailability] = React.useState(\n currentState.availability || {\n hours_per_week: \"\",\n available_on_days: [],\n available_on_time: {\n first_time: current_time,\n second_time: current_time,\n third_time: current_time,\n },\n }\n );\n\n const itemValues = { contact, enrollId, pathwayId, availability };\n\n const handleClickOpen = () => {\n setOpen(true);\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const updateAndSaveState = (setter, key, value) => {\n setter && setter(value);\n currentState[key] = value;\n saveObjectState(\"volunteer_automation\", \"state\", {\n ...allUsersState,\n [uid]: currentState,\n });\n };\n\n // Commented below code to redirect to volunteer onboarded form, even if the user has volunteer role.\n // React.useEffect(() => {\n // if (roles?.includes(\"volunteer\")) {\n // history.push(PATHS.CLASS);\n // }\n // }, [roles]);\n\n const setActiveStepCompleted = () => {\n const newCompleted = completed.slice();\n newCompleted[activeStep] = true;\n updateAndSaveState(setCompleted, \"completed\", newCompleted);\n };\n\n const steps = [\n {\n label: \"Verify Phone No.\",\n itemKey: \"contact\",\n component: (\n \n ),\n },\n {\n label: \"Select Track\",\n itemKey: \"pathwayId\",\n component: (\n \n ),\n },\n {\n label: \"Your Availability\",\n itemKey: \"availability\",\n component: (\n \n ),\n },\n {\n label: \"Intro Video\",\n component: ,\n },\n {\n label: \"Code of Conduct\",\n component: ,\n },\n // {\n // label: \"Attend Class\",\n // itemKey: \"enrollId\",\n // component: (\n // \n // ),\n // },\n {\n label: \"Confirmation\",\n component: ,\n },\n ];\n\n const isStepSkipped = (step) => {\n return skipped.has(step);\n };\n\n const setActiveStepHandler = (changeBy, prevActiveStep) => {\n const itemKey = steps[prevActiveStep]?.itemKey;\n const currentStep = prevActiveStep + changeBy;\n\n if (itemKey && !disable) {\n // button was enabled by Component for this step so it's completed\n // and we should therefore update the state for this key\n currentState[itemKey] = itemValues[itemKey];\n }\n\n setDisable(!completed[currentStep]);\n\n updateAndSaveState(null, \"step\", currentStep);\n return currentStep;\n };\n\n const handleNext = () => {\n let newSkipped = skipped;\n setActiveStepCompleted();\n // currentState.completed should be present if the user didn't\n // alter their localStorage but we'll check anyway to avoid a crash\n //currentState.completed && (currentState.completed[activeStep] = true);\n\n if (isStepSkipped(activeStep)) {\n newSkipped = new Set(newSkipped.values());\n newSkipped.delete(activeStep);\n }\n\n setActiveStep(setActiveStepHandler.bind(null, 1));\n setSkipped(newSkipped);\n };\n\n const handleBack = () => {\n setActiveStep(setActiveStepHandler.bind(null, -1));\n };\n\n const submit = () => {\n const contactNumber = contact.split(\"+\")[1].split(\" \").join(\"-\");\n return axios({\n url: `${process.env.REACT_APP_MERAKI_URL}/volunteers/Automation`,\n method: METHODS.POST,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n data: {\n contact: contactNumber,\n pathway_id: pathwayId,\n ...availability,\n },\n })\n .then(\n (res) => {\n try {\n localStorage.setItem(\"isNewVolunteer\", true);\n } catch (error) {\n //console.error('Error accessing localStorage:', error);\n return {};\n }\n history.push(PATHS.CLASS);\n return axios({\n url: `${process.env.REACT_APP_MERAKI_URL}/users/volunteerRole`,\n method: METHODS.POST,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token,\n },\n })\n .then(\n (res) => {\n dispatch(\n actions.onUserRefreshDataIntent({ token: user.data.token })\n );\n },\n (error) => {\n console.log(error);\n }\n )\n .catch((err) => {});\n },\n (error) => {\n console.log(error);\n }\n )\n .catch((err) => {});\n };\n\n return (\n <>\n \n \n \n \n \n \n \n {\"Leave Registration?\"}\n \n \n \n Goals can change all the time. However, we will keep your\n registration progress intact in case you return back.\n \n \n \n \n Leave \n \n \n Stay on Page\n \n \n \n \n \n Tutor Registration\n \n \n \n\n \n \n \n {steps.map((step, index) => {\n const stepProps = {};\n const labelProps = {};\n\n if (isStepSkipped(index)) {\n stepProps.completed = false;\n }\n return (\n \n \n {step.label}\n \n \n );\n })}\n \n
\n \n <>\n {steps.map((step, index) => {\n if (activeStep === index) {\n return (\n \n \n {step.component}\n \n \n );\n }\n })}\n >\n \n \n {activeStep > 0 && (\n }\n >\n Back\n \n )}\n\n \n {activeStep === steps.length - 1 ? (\n }\n onClick={submit}\n >\n Go to Dashboard\n \n ) : (\n nextButton && (\n }\n onClick={handleNext}\n disabled={disable}\n >\n Next\n \n )\n )}\n \n \n \n \n >\n );\n}\n\nexport default HorizontalLinearStepper;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n videoContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n },\n video: {\n maxWidth: \"100%\",\n },\n}));\nexport default useStyles;\n","import React, { useState, useEffect } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { versionCode } from \"../../../constant\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../../services/api\";\n\nimport { Typography, Paper, Button, Grid } from \"@mui/material\";\nimport useStyles from \"./style\";\nconst YouTubePlaylist = ({\n setPlaylistVideos,\n playlistVideos,\n slicedVideos,\n setSlicedVideos,\n pageNumber,\n limit,\n}) => {\n const classes = useStyles();\n const user = useSelector(({ User }) => User);\n let recurring_id = null;\n\n // Getting the recurring_id and then calling youtubeBroadcast api to get the videos array to display videos.\n useEffect(() => {\n let isMounted = true;\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/7/ACBEnrolledBatches`,\n headers: {\n accept: \"application/json\",\n \"version-code\": versionCode,\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n const foundBatch = res.data.find((item) => item.recurring_id);\n if (foundBatch) {\n recurring_id = foundBatch.recurring_id;\n }\n })\n .then(() => {\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/youtubeBroadcast/${recurring_id}`,\n headers: {\n accept: \"application/json\",\n \"version-code\": versionCode,\n Authorization: user.data.token,\n },\n })\n .then((res) => {\n if (isMounted) {\n setPlaylistVideos(res.data);\n }\n })\n .catch((err) => {});\n })\n\n .catch((err) => {});\n\n return () => {\n isMounted = false;\n };\n }, [recurring_id]);\n\n // sliced videos setting:\n useEffect(() => {\n const slicedData = playlistVideos.slice(\n pageNumber * limit,\n (pageNumber + 1) * limit\n );\n setSlicedVideos(slicedData);\n }, [playlistVideos]);\n\n // ---------------------------------------------\n\n return (\n \n {slicedVideos.map((video) => (\n \n \n \n {video.title}\n \n \n VIDEO \n
\n \n window.open(\n `https://www.youtube.com/embed/${video.video_id}`,\n \"_blank\"\n )\n }\n >\n Go to YouTube\n \n \n \n ))}\n \n );\n};\n\nexport default YouTubePlaylist;\n","import React, { useState } from \"react\";\nimport YouTubePlaylist from \"./YouTubePlaylist\";\nimport { Typography, Box, Container } from \"@mui/material\";\nimport ReactPaginate from \"react-paginate\";\n\nconst AmazonVideos = () => {\n const [playlistVideos, setPlaylistVideos] = useState([]);\n const [slicedVideos, setSlicedVideos] = useState([]);\n const [pageNumber, setPageNumber] = useState(0);\n const limit = 6;\n const totalCount = playlistVideos?.length;\n const pageCount = Math.ceil(totalCount / limit);\n const changePage = ({ selected }) => {\n setPageNumber(selected);\n };\n\n return (\n <>\n \n \n Amazon Coding Programmers \n \n }\n nextLabel={ }\n initialPage={0}\n marginPagesDisplayed={0}\n onPageChange={changePage}\n pageCount={pageCount}\n containerClassName=\"paginationBttns\"\n previousLinkClassName=\"previousBttn\"\n nextLinkClassName=\"nextBttn\"\n disabledClassName=\"paginationDisabled\"\n activeClassName=\"paginationActive\"\n />\n
\n \n\n \n \n Batch 1\n \n \n \n \n >\n );\n};\n\nexport default AmazonVideos;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n listItem: {\n fontSize: \"1.125rem\",\n fontFamily: \"Noto Sans\",\n fontWeight: \"400\",\n lineHeight: \"1.5\",\n },\n headingMargin: {\n marginTop: \"32px\",\n },\n}));\n\nexport default useStyles;\n","import React, { useState, useEffect, useRef } from \"react\";\nimport { useHistory } from \"react-router-dom\";\nimport CreateClassComponent from \"../../components/Class\";\nimport ClassesList from \"../../components/Class/ClassList\";\nimport { useSelector } from \"react-redux\";\nimport \"../../components/Class/ClassList/styles.scss\";\nimport axios from \"axios\";\nimport { METHODS } from \"../../services/api\";\n// import \"./styles.scss\";\nimport useStyles from \"./styles\";\nimport {\n Container,\n Button,\n Modal,\n useMediaQuery,\n Box,\n Stack,\n Typography,\n Dialog,\n DialogTitle,\n DialogActions,\n} from \"@mui/material\";\nimport { List, ListItem, ListSubheader } from \"@mui/material\";\nimport { breakpoints } from \"../../theme/constant\";\nimport ClassForm from \"../../components/Class/ClassForm\";\n\nimport SuccessModel from \"../../components/Class/SuccessModel\";\nimport NewVolunteerCard from \"../../components/Class/NewVolunteerCard\";\n\nfunction GscoIdea() {\n const classes = useStyles();\n\n return (\n \n \n NavGurukul has developed a mobile-first platform called Meraki, which is\n already used by more than 55,000 learners across Haryana and\n Maharashtra. The students are taught skills such as Python, English,\n Typing, Scratch, and Web Development using a simple android phone and a\n keyboard (optional.)\n \n \n Alexa Chatbot:\n \n \n To introduce the learners to skills such as AI, ML, NLP, and IOT, we\n want to build a specific functionality in the application (both mobile -\n kotlin and web - reactjs) that will allow the learners to create an\n Alexa chatbot using blocks. In simpler words, without writing any code -\n students will be able to make functional chatbots that they can test on\n their phones or on Alexa devices. The Alexa Skills Kit (ASK) is a\n software development framework that enables you to create content called\n skills. Skills are like apps for Alexa. NavGurukul has already\n integrated Scratch - a block-based programming language with a simple\n visual interface that allows young people to create digital stories,\n games, and animations.\n \n \n This project involves building the following capabilities:\n \n \n \n Define and implement a basic set of scratch blocks to create the Alexa\n skill/app,\n \n \n Define and implement character blocks, motion blocks, control blocks,\n event blocks, and custom blocks mapped to the corresponding Alexa\n Programming Language.\n \n \n Define and implement a block to publish the Alexa skill/app to\n Alexa-enabled devices.\n \n
\n \n Build a playground to learn blockchain:\n \n \n \n To build a playground for learning blockchain, the first step would be\n to create a chatbot that can explain the basics of blockchain\n technology to users. The chatbot should be able to answer questions\n about blockchain and provide helpful information, such as what a\n blockchain is, who invented it, and how it works. Additionally, it\n should be able to provide examples of real-world applications of\n blockchain technology and explain the benefits and risks associated\n with using it.\n \n \n Once the basics have been established, the chatbot can provide more\n advanced topics, such as how to create a blockchain, how to use smart\n contracts, and how to develop decentralized applications. The chatbot\n should also be able to provide resources and tutorials to help users\n get started with blockchain development.\n \n \n Finally, the chatbot can provide an interactive playground where users\n can practice using blockchain technology. This would include\n activities such as setting up a private blockchain network,\n programming a smart contract, or building a decentralized application.\n The chatbot should be able to provide helpful feedback and resources\n to help users complete the activities.\n \n
\n \n Building a platform to learn technology in the user-preferred language:\n \n \n The goal of this project is to build a platform that leverages AI to\n identify language proficiency levels and create personalized language\n learning experiences for users. The platform will use a combination of\n natural language processing and machine learning algorithms to determine\n the learner's current level of proficiency in a target language and\n provide content that is tailored to their needs.\n \n To achieve this, the following steps will be undertaken:\n \n \n \n Develop an algorithm to identify the learner's current level of\n proficiency in the target language based on factors such as grammar,\n vocabulary, and writing style.\n \n \n Create a platform for delivering the learning content that can track\n the learner's progress and adjust the content based on their\n performance.\n \n \n Incorporate machine learning algorithms to continuously evaluate and\n improve the content, tailoring it to the individual needs and\n preferences of each learner.\n \n \n Offer a wide range of subjects, such as English as a Second Language,\n to accommodate a diverse group of learners.\n \n \n Continuously gather feedback from learners and make improvements to\n the platform based on that feedback to ensure that the solution is\n constantly evolving and improving.\n \n
\n \n This project aligns well with the goals of Google Summer of Code as it\n involves using AI to improve education and make it more accessible and\n personalized for learners.\n \n \n );\n}\n\nexport default GscoIdea;\n","import React, { useEffect, useState } from \"react\";\nimport axios from \"axios\";\nimport { useSelector } from \"react-redux\";\nimport { Button, Card, CardContent, Grid, Typography } from \"@mui/material\";\nimport AccessTimeIcon from \"@mui/icons-material/AccessTime\";\n\nconst ReportGenerate = () => {\n const user = useSelector(({ User }) => User); // Use inside the component\n const [csvUpdatedTime, setCSVUpdatedTime] = useState({});\n \n\n useEffect(() => {\n if (user?.data?.token) {\n axios({\n method: \"GET\",\n url: `${process.env.REACT_APP_MERAKI_URL}/tcb/csv/read-date-csv`,\n headers: { accept: \"application/json\", Authorization: user.data.token },\n })\n .then((response) => {\n setCSVUpdatedTime(response.data);\n })\n .catch((err) => {\n console.log(err);\n });\n }\n }, [user?.data?.token]); // Add token as dependency\n\n const downloadReport = (url, fileName = \"report.csv\") => {\n if (!url) {\n console.error(\"URL is required to download the report.\");\n return;\n }\n\n if (!user?.data?.token) {\n console.error(\"User token is missing.\");\n return;\n }\n\n axios({\n method: \"GET\",\n url: url,\n headers: { accept: \"application/json\", Authorization: user.data.token },\n responseType: \"blob\",\n })\n .then((res) => {\n const blob = new Blob([res.data]);\n const downloadUrl = window.URL.createObjectURL(blob); // Changed variable name\n const link = document.createElement(\"a\");\n link.href = downloadUrl;\n link.setAttribute(\"download\", fileName);\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link); // Clean up the DOM\n })\n .catch((err) => {\n console.error(\"Error downloading the report:\", err);\n alert(\"Failed to download the report. Please try again.\");\n });\n };\n\n const studentReport1 = () => {\n const reportUrl = `${process.env.REACT_APP_MERAKI_URL}/tcb/csv/progress/roport`;\n downloadReport(reportUrl);\n };\n\n const studentReport2 = () => {\n const reportUrl = `${process.env.REACT_APP_MERAKI_URL}/tcb/csv/last-week/login-report`;\n downloadReport(reportUrl);\n };\n\n return (\n \n
peepul india \n
\n MCDigital Course-2.0\n \n
\n \n \n \n \n All Time Student Progress Report\n \n \n \n Last updated on {csvUpdatedTime?.allUsersDetailUpdatedOn} at{\" \"}\n {csvUpdatedTime?.at}\n \n \n The report contains student progress since the start of the\n programme until the present day.\n \n \n Download Report\n \n \n \n \n \n \n \n \n Seven Days Student Progress Report\n \n \n \n Last updated on{\" \"}\n {csvUpdatedTime?.lastWeekUsersLoginDetailsUpdatedOn} at{\" \"}\n {csvUpdatedTime?.at}\n \n \n The report contains student progress from the last 7 days\n until the present day.\n \n \n Download Report\n \n \n \n \n \n
\n );\n \n};\n\nexport default ReportGenerate;\n","import React, { useEffect, useState } from \"react\";\nimport {\n Container,\n Grid,\n Typography,\n Box,\n Card,\n CardContent,\n CardActions,\n LinearProgress,\n} from \"@mui/material\";\nimport { METHODS } from \"../../../services/api\";\nimport axios from \"axios\";\nimport { useSelector } from \"react-redux\";\nimport useStyles from \"../styles\";\nimport { PATHS, interpolatePath } from \"../../../constant\";\nimport { Link } from \"react-router-dom\";\nimport LockIcon from \"@mui/icons-material/Lock\";\nimport LockOpenIcon from \"@mui/icons-material/LockOpen\";\nimport { toast } from \"react-toastify\";\nimport \"react-toastify/dist/ReactToastify.css\";\nimport { useHistory } from \"react-router-dom/cjs/react-router-dom.min\";\nimport DOMPurify from \"dompurify\";\nimport CheckIcon from \"@mui/icons-material/Check\";\nimport get from \"lodash/get\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../../theme/constant\";\n\ntoast.configure();\n\nfunction UnsafeHTML(props) {\n const { html, Container, ...otherProps } = props;\n const sanitizedHTML = DOMPurify.sanitize(html);\n return (\n \n );\n}\n\nfunction Aidcxpathway() {\n const user = useSelector(({ User }) => User);\n const [pathway, setPathway] = useState([]);\n const [allCourses, setAllCourses] = useState([]);\n const classes = useStyles();\n const history = useHistory();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n useEffect(() => {\n if (localStorage.getItem(\"studentAuth\") === null) history.push(\"/login\");\n\n axios({\n method: METHODS.GET,\n url: `${process.env.REACT_APP_MERAKI_URL}/pathways/aidcx`,\n headers: {\n accept: \"application/json\",\n Authorization: localStorage.getItem(\"studentAuthToken\"),\n },\n })\n .then((response) => {\n console.log(response, \"RESPONSE\");\n console.log(response?.data?.data?.courses, \"courses\");\n setAllCourses(response?.data?.data?.courses);\n if (pathway?.length < 1) setPathway(response?.data);\n })\n .catch((err) => {});\n }, []);\n\n const filterCourses = pathway?.modules?.filter((item) => {\n return item.courses.length > 0;\n });\n\n const [unlockedCourses, setUnlockedCourses] = useState([]);\n\n // Function to check if a course is unlocked\n\n // Effect to automatically unlock courses when their percentage reaches 100\n // useEffect(() => {\n // filterCourses &&\n // filterCourses.forEach((item, index) => {\n // const lastCourseIndex = item.courses.length - 1;\n // item.courses.forEach((course, courseindex) => {\n // if (course.completed_portion === 100) {\n // if (courseindex < lastCourseIndex) {\n // const nextCourse = item.courses[courseindex + 1];\n // if (!isCourseUnlocked(nextCourse.id)) {\n // // Automatically unlock the next course\n // setUnlockedCourses([...unlockedCourses, nextCourse.id]);\n // }\n // }\n // }\n // if (item.completed_portion === 100) {\n // if (index < filterCourses.length - 1) {\n // const nextItem = filterCourses[index + 1];\n // const firstCourseOfNextItem = nextItem.courses[0];\n\n // if (!isCourseUnlocked(firstCourseOfNextItem.id)) {\n // setUnlockedCourses([\n // ...unlockedCourses,\n // firstCourseOfNextItem.id,\n // ]);\n // }\n // }\n // }\n // });\n // });\n // }, [unlockedCourses, filterCourses]);\n\n const isCourseUnlocked = (courseId) => {\n return unlockedCourses.includes(courseId);\n };\n\n return (\n \n \n \n \n Learning AIDCX-pathway\n \n \n {pathway?.name}\n \n \n {pathway?.description}\n \n \n \n\n \n \n {allCourses.map((course, index) => {\n return (\n \n \n \n {/* Top Box that grows to push CardContent & CardActions down */}\n \n \n \n\n \n \n {/* Always display the index number */}\n \n {index + 1}\n \n {course.name} \n \n \n\n \n \n \n \n \n \n );\n })}\n \n \n \n );\n}\nexport default Aidcxpathway;\n","import React from \"react\";\nimport { Route } from \"react-router-dom\";\nimport { PrivateRoute } from \"./Routes\";\n// import { userRoles } from '../services/auth'\nimport Home from \"../pages/Home\";\nimport { PATHS } from \"../constant\";\nimport Login from \"../pages/Login\";\nimport CreateClass from \"../pages/CreateClass\";\nimport Mentor from \"../pages/Mentor\";\nimport User from \"../components/User\";\nimport PrivacyPolicy from \"../components/PrivacyPolicy\";\nimport PartnerData from \"../components/Dashboard/PartnerData\";\nimport StudentData from \"../components/Dashboard/StudentData\";\nimport StudentClassData from \"../components/Dashboard/StudentClassData\";\nimport Profile from \"../pages/Profile\";\nimport Opportunities from \"../pages/Opportunities\";\nimport AFEpage from \"../components/AFEpage\";\nimport NavgurukulIntroduce from \"../pages/Navgurukul\";\n// import Admission from \"../pages/Navgurukul/merakiAdmission\";\nimport RedirectComponent from \"../components/common/RedirectComponent\";\nimport VolunteerDashboard from \"../components/VolunteerDashbord/VolunteerDetails\";\nimport VolunteerOverview from \"../components/VolunteerDashbord/IndividualVolunteers\";\nimport StatePartnerDashboard from \"../pages/StatePartnerDashboard\";\nimport OurStory from \"../pages/OurStory\";\nimport NewUserDashbord from \"../components/NewUserDashbord\";\nimport Team from \"../pages/Team\";\nimport Partner from \"../pages/OurPartner\";\nimport PathwayExercise from \"../components/PathwayExercise/\";\nimport PathwayCourse from \"../components/PathwayCourse\";\nimport ResidentialCourse from \"../components/PathwayCourse/ResidentialCourse\";\nimport MiscellaneousCourses from \"../components/PathwayCourse/MiscellaneousCourses\";\nimport SearchCourse from \"../components/SearchBar\";\nimport ReturningUserPage from \"../components/ReturningUser/ReturningUserPage\";\nimport VolunteerAutomation from \"../components/VolunteerAutomation\";\nimport VolunteerForm from \"../components/VolunteerAutomation/Stepper\";\nimport ClassCard from \"../components/Class/ClassCard\";\nimport AmazonVideos from \"../components/PathwayCourse/AmazonCodingProgrammer/AmazonVideos\";\n// import ClassFormModel from \"../components/BatchClassComponents/ClassFormModel\";\nimport GsocIdea from \"../pages/GsocIdea/GsocIdea\";\nimport C4CApathway from \"../components/PathwayCourse/C4CApathway\";\nimport ReportGenerate from \"../pages/ReportGenerate/ReportGenerate\";\nimport Aidcxpathway from \"../components/PathwayCourse/Aidcxpathway\";\n// import Credits from \"../pages/Credits\";\n\nconst Routing = () => {\n return (\n <>\n\n {/* Public routes */}\n {/* Route home page to login in */}\n \n \n \n \n \n \n\n \n \n \n \n \n {/* */}\n\n \n \n \n \n \n\n \n\n \n \n \n \n\n {/* Private routes */}\n\n \n\n \n {/* */}\n \n {/* */}\n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n {/* } /> */}\n\n >\n );\n};\n\nexport default Routing;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n link: {\n textDecoration: \"none\",\n color: \"black\",\n },\n box: {\n padding: \"20px 0px 0px 20px\",\n },\n mobileBox: {\n width: 415,\n height: \"100%\",\n },\n RightBox: {\n flexGrow: 1,\n display: { xs: \"flex\", md: \"none\" },\n },\n crossIcon: {\n flexGrow: 0,\n paddingRight: \"50px\",\n },\n meraki: {\n flexGrow: 1,\n },\n merakiLearn: {\n flexGrow: 0,\n display: { xs: \"none\", md: \"flex\" },\n },\n button: {\n textDecoration: \"none\",\n color: \"white\",\n },\n bgColor: {\n background: \"#e9f5e9\",\n },\n active: {\n color: \"#48a145\",\n },\n buttonLink: {\n textDecoration: \"none\",\n },\n scratchLink: {\n height: \"36px\",\n padding: \"6px 16px\",\n display: \"flex\",\n alignItems: \"center\",\n \"&:hover\": {\n backgroundColor: \"#E9F5E9\",\n borderRadius: \"8px\",\n },\n },\n donate: {\n height: \"36px\",\n padding: \"6px 16px\",\n display: \"flex\",\n alignItems: \"center\",\n \"&:hover\": {\n backgroundColor: \"#E9F5E9\",\n borderRadius: \"8px\",\n },\n },\n}));\n\nexport default useStyles;\n","import React from \"react\";\nimport {\n Typography,\n MenuItem,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n} from \"@mui/material\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport Message from \"../common/Message\";\n\n// TODO: Make it conform to this signature, adding properties as necessary\n/**\n * Component for representing a mobile dropdown AccordionDropDown menu.\n * @param {string} textMsgKey the constant key for the text to display on the menu item toggling\n * the dropdown\n * @param {Array.=} textArgs an optional arguments Array to supply to\n * the Message component\n * @param {Array.} options the Array of options in the dropdown menu\n */\nexport default function AccordionDropDownMenu({\n textMsgKey,\n textArgs,\n // options,\n children,\n}) {\n return (\n \n }\n aria-controls=\"panel1a-content\"\n id=\"panel1a-header\"\n sx={{ width: 380 }}\n >\n \n \n \n \n {children} \n \n );\n}\n","import React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport ExternalLink from \"../common/ExternalLink\";\nimport { MenuItem } from \"@mui/material\";\nimport useStyles from \"./styles\";\n\nexport default function DropdownLink({\n to,\n external,\n padding,\n margin,\n linkOnClick,\n children,\n ...props\n}) {\n const A = external ? ExternalLink : Link;\n const toKey = external ? \"href\" : \"to\";\n const classes = useStyles();\n return (\n \n \n {children}\n \n \n );\n}\n","import React, { useEffect } from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { PATHS, interpolatePath } from \"../../constant\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport useStyles from \"./styles\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { actions as pathwayActions } from \"../PathwayCourse/redux/action\";\nimport AccordionDropDownMenu from \"./AccordionDropDownMenu\";\nimport ExternalLink from \"../common/ExternalLink\";\nimport DropdownLink from \"./DropdownLink\";\nimport LaunchIcon from \"@mui/icons-material/Launch\";\nimport Message from \"../common/Message\";\nimport { LEARN_KEY, ABOUT_KEY, GET_INVOLVED_KEY, MENU_ITEMS } from \"./constant\";\nimport { PATHWAYS_INFO } from \"../../constant\";\nimport {\n Typography,\n Menu,\n MenuItem,\n CardContent,\n Divider,\n Accordion,\n AccordionSummary,\n AccordionDetails,\n} from \"@mui/material\";\n\nconst students = {\n [LEARN_KEY]: [],\n [ABOUT_KEY]: [\n { name: \"Our Story\", path: PATHS.OUR_STORY, type: \"internal\" },\n { name: \"Meraki Team\", path: PATHS.TEAM, type: \"internal\" },\n ],\n [GET_INVOLVED_KEY]: [\n {\n name: ,\n path: PATHS.VOLUNTEER_AUTOMATION,\n type: \"internal\",\n },\n {\n name: \"Our Partner\",\n path: PATHS.OUR_PARTNER,\n type: \"internal\",\n },\n // {\n // name: ,\n // path: \"https://www.navgurukul.org/donate\",\n // type: \"external\",\n // },\n {\n name: \"Careers\",\n path: \"https://recruiterflow.com/navgurukul/jobs\",\n type: \"external\",\n },\n ],\n};\n\nexport const MobileDropDown = ({ menuKey, handleClose, toggleDrawer }) => {\n const classes = useStyles();\n const user = useSelector(({ User }) => User);\n const dispatch = useDispatch();\n const { data } = useSelector((state) => state.PathwaysDropdow);\n // const { language, MSG } = useLanguageConstants(); //useContext(LanguageProvider);\n\n // useEffect(() => {\n // dispatch(\n // pathwayActions.getPathwaysDropdown({\n // authToken: user,\n // })\n // );\n // }, [dispatch, user]);\n\n const miscellaneousPathway = data?.pathways.filter((pathway) =>\n PATHWAYS_INFO.some((miscPathway) => pathway.name === miscPathway.name)\n );\n const pathwayData = data?.pathways\n .filter((pathway) => !miscellaneousPathway.includes(pathway))\n .concat(miscellaneousPathway);\n\n data?.pathways && (students[LEARN_KEY] = pathwayData);\n\n return (\n \n {students[menuKey].map((menu, index) => {\n if (menu.type === \"external\") {\n return (\n \n \n {menuKey === LEARN_KEY && (\n \n )}\n \n \n {menu.name}\n \n \n \n \n \n );\n } else {\n return (\n \n \n {menuKey === LEARN_KEY && (\n \n )}\n \n \n {menu.name}\n \n \n \n \n );\n }\n })}\n \n );\n};\n\nexport const DropDown = ({\n dropDown,\n //handleClose,\n toggleDrawer,\n //setInDropdown,\n //handleMouseLeave,\n}) => {\n const classes = useStyles();\n const user = useSelector(({ User }) => User);\n const dispatch = useDispatch();\n const { data } = useSelector((state) => state.PathwaysDropdow);\n\n // useEffect(() => {\n // dispatch(\n // pathwayActions.getPathwaysDropdown({\n // authToken: user,\n // })\n // );\n // }, [dispatch, user]);\n\n return (\n <>\n {dropDown &&\n students[dropDown].map((menu, index) => {\n if (menu.type === \"external\") {\n return (\n <>\n \n \n {menu.name}\n \n \n \n {dropDown === LEARN_KEY &&\n index === students[dropDown].length - 3 && }\n >\n );\n } else {\n return (\n <>\n \n {dropDown === LEARN_KEY && (\n \n )}\n \n {menu.name}\n \n \n {dropDown === LEARN_KEY &&\n index === students[dropDown].length - 3 && }\n >\n );\n }\n })}\n >\n );\n};\n","import React from \"react\";\nimport useStyles from \"./styles\";\n\nimport { Typography, MenuItem } from \"@mui/material\";\nimport { NavLink } from \"react-router-dom\";\nimport OpenInNewIcon from \"@mui/icons-material/OpenInNew\";\nfunction HeaderNavLink({ to, text, toggleDrawer, externalLink }) {\n const classes = useStyles();\n\n function handleLinkClick(event) {\n if (externalLink) {\n event.preventDefault();\n window.open(to, externalLink ? \"_blank\" : \"_self\");\n }\n }\n\n return (\n \n \n \n {text}\n {externalLink && (\n \n )}\n \n \n \n );\n}\nexport default HeaderNavLink;\n","import React from \"react\";\nimport { isTouchScreen } from \"../../common/utils\";\nimport Menu from \"@mui/material/Menu\";\n\n/**\n * Component for representing a dropdown menu with a visible toggling button.\n * Clicking on the button the first time (or also hovering over it on a non-touch\n * screen) opens the menu clicking on the button a second time or on the menu option\n * closes it. The menu is also closed after a delay after moving off of it\n * (on a non-touch screen).\n * @param {ReactElement} DropDownButton the button to toggle the opening/closing of the menu\n * @param {object=} menuContainerProps properties of the menu\n * @param {number=} delay the delay in ms for which to close the menu on a non-touch screen after\n * the pointer is moved off of it, defaults to 200\n * @param {boolean=} attachRight true exactly when the dropdown menu's right edge should coincide\n * with the right of the toggle button\n * @param {Function=} onOpenMenu an optional handler that's called when the menu is opened\n * @param {Function=} onCloseMenu an optional handler that's called when the menu is closed\n * @param {Array.} children the Array of options in the dropdown menu\n */\nexport default function DropDownMenu({\n DropDownButton,\n menuContainerProps,\n delay,\n attachRight,\n onOpenMenu,\n onCloseMenu,\n children,\n}) {\n const [inDropdown, setInDropdown] = React.useState({\n inProgress: false,\n value: false,\n });\n\n // const ref = React.useRef(null);\n\n const [anchorEl, setAnchorEl] = React.useState(null);\n // #802: part of hack to make button clickable over presentation layer\n // when menu is open, needed for sidebar\n const [offsetX, setOffsetX] = React.useState(0);\n const [offsetY, setOffsetY] = React.useState(0);\n // We can just adjust the margin left/top of the presentation layer when\n // attaching the menu to the left, but the hack won't work if attaching\n // to the right. In that case, we use a preset margin-top which is set\n // for the current heading.\n const useOffset = !attachRight;\n const offset = useOffset\n ? { ml: offsetX + \"px\", mt: offsetY + \"px\" }\n : { mt: \"45px\" };\n\n const inDropdownRef = React.useRef(inDropdown);\n inDropdownRef.current = inDropdown;\n\n const handleOpenMenu = (event) => {\n typeof onOpenMenu === \"function\" && onOpenMenu(event);\n setAnchorEl(event.currentTarget);\n setOffsetX(event.currentTarget.getBoundingClientRect().left);\n setOffsetY(event.currentTarget.getBoundingClientRect().bottom);\n /*\n setOffsetY(\n event.currentTarget.getBoundingClientRect().bottom -\n event.currentTarget.getBoundingClientRect().height / 2 +\n 6\n );\n */\n };\n\n const handleCloseMenu = () => {\n typeof onCloseMenu === \"function\" && onCloseMenu();\n setAnchorEl(null);\n };\n\n const updateInDropdownState = () => {\n setInDropdown({ inProgress: true, value: false });\n setTimeout(\n () =>\n setInDropdown({\n value: inDropdownRef.current?.value,\n inProgress: false,\n }),\n delay || 200\n );\n };\n\n const DropDownButtonWithHandlers = React.cloneElement(DropDownButton, {\n onMouseEnter: (e) => {\n if (typeof DropDownButton.props.onMouseEnter === \"function\") {\n DropDownButton.props.onMouseEnter(e);\n }\n if (!isTouchScreen()) {\n setInDropdown({ value: true, inProgress: false });\n handleOpenMenu(e);\n }\n },\n onMouseLeave: (e) => {\n if (typeof DropDownButton.props.onMouseLeave === \"function\") {\n DropDownButton.props.onMouseLeave(e);\n }\n\n if (!isTouchScreen()) {\n updateInDropdownState();\n }\n },\n onClick: (e) => (anchorEl ? handleCloseMenu() : handleOpenMenu(e)),\n /*\n style: {\n // #802: hack to make button clickable over presentation layer when menu is open\n // This won't work because its header parent has a lower z-index than the modal\n // We can change this \n // (https://mui.com/material-ui/customization/default-theme/?expand-path=$.zIndex)\n // but its an even worse hack and the shadow will appear under the header. \n position: 'relative',\n zIndex: (menuContainerProps?.zIndex || 0) + 10000,\n ...DropDownButton.props.style,\n },\n */\n });\n\n React.useEffect(() => {\n if (!inDropdown.inProgress && !inDropdown.value) {\n // mouse has moved out of main menu item and its\n // dropdown after delay milliseconds\n // menuCloseHandler();\n //console.log(inDropdown);\n handleCloseMenu();\n }\n }, [inDropdown]);\n\n // React.useEffect(() => {\n // const handleClickOutside = (event) => {\n // if (\n // !ref?.current?.contains(event.target) &&\n // !inDropdown.inProgress &&\n // !inDropdown.value\n // ) {\n // handleCloseMenu();\n // }\n // };\n // document.addEventListener(\"mousedown\", handleClickOutside);\n // }, []);\n\n return (\n <>\n {DropDownButtonWithHandlers}\n \n !isTouchScreen() &&\n setInDropdown({ value: true, inProgress: false }),\n onMouseLeave: () => !isTouchScreen() && updateInDropdownState(),\n onClick: handleCloseMenu,\n }}\n hideBackdrop\n open={!!anchorEl}\n // To resolve issue https://github.com/mui/material-ui/issues/5185\n disableScrollLock={true}>\n {children}\n \n >\n );\n}\n","import React from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { actions as userActions } from \"../../User/redux/action\";\nimport { PATHS } from \"../../../constant\";\nimport { Link, NavLink } from \"react-router-dom\";\nimport {\n Box,\n IconButton,\n Typography,\n Menu,\n Avatar,\n MenuItem,\n} from \"@mui/material\";\nimport useStyles from \"../styles\";\nimport Message from \"../../common/Message\";\nimport DropDownMenu from \"../DropDownMenu\";\n// import { isTouchScreen } from \"../../../common/utils\";\n\n// function UserMenu({ profile }) {\nfunction UserMenu() {\n // const [anchorElUser, setAnchorElUser] = React.useState(null);\n const classes = useStyles();\n const dispatch = useDispatch();\n const user = useSelector(({ User }) => User);\n const profilePict = user?.data?.user?.profile_picture;\n const name = user?.data?.user?.name;\n\n /*\n React.useEffect(() => {\n sendToken({ token: user.data.token }).then((res) => {\n setProfile(res.data.user.profile_picture);\n });\n }, []);\n*/\n\n /*\n const handleOpenUserMenu = (event) => {\n setAnchorElUser(event.currentTarget);\n };\n\n const handleCloseUserMenu = () => {\n setAnchorElUser(null);\n };\n */\n\n return (\n \n \n \n \n }\n menuContainerProps={{\n // sx: { mt: '45px' },\n id: \"menu-appbar\",\n /*\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'right',\n },\n keepMounted: true,\n transformOrigin: {\n vertical: 'top',\n horizontal: 'right',\n },\n */\n }}\n attachRight\n >\n \n \n \n \n \n \n \n {/* \n \n NG Admissions \n \n */}\n \n \n Opportunities \n \n \n dispatch(userActions.logout())}\n className={classes.link}\n >\n \n \n \n \n \n \n \n \n );\n}\n\nexport default UserMenu;\n","import React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport HeaderNavLink from \"../HeaderNavlink\";\nimport Message from \"../../common/Message\";\nimport { PATHS } from \"../../../constant\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport SearchIcon from \"@mui/icons-material/Search\";\nimport {\n Box,\n // Typography,\n // Menu,\n // MenuItem,\n Button,\n} from \"@mui/material\";\n\nfunction SearchHeader() {\n return (\n \n {/* \n }>\n \n \n \n \n */}\n \n );\n}\n\nexport default SearchHeader;\n","import React from \"react\";\nimport DropDownMenu from \"./DropDownMenu\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Typography from \"@mui/material/Typography\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport ExpandLessIcon from \"@mui/icons-material/ExpandLess\";\nimport Message from \"../common/Message\";\n\n/**\n * Component for representing a dropdown menu with a visible multilingual text toggling\n * button with expanding more/less icon.\n * Clicking on the button the first time (or also hovering over it on a non-touch\n * screen) opens the menu while clicking on the button a second time or on the menu\n * option closes it. The menu is also closed after a delay after moving off of it\n * (on a non-touch screen).\n * @param {string} btnTextMsgKey the constant key for the text to display on the button\n * @param {Array.=} btnTextArgs an optional arguments Array to supply to\n * the Message component\n * @param {object=} menuContainerProps properties of the menu\n * @param {number=} delay the delay for which to close the menu on a non-touch screen after\n * the pointer is moved off of it\n * @param {boolean=} attachRight true exactly when the dropdown menu's right edge should coincide\n * with the right of the toggle button\n * @param {Array.} children the Array of options in the dropdown menu\n */\nexport default function TextButtonDropDownMenu({\n btnTextMsgKey,\n btnTextArgs,\n menuContainerProps,\n delay,\n attachRight,\n children,\n ...otherProps\n}) {\n const [isOpen, setIsOpen] = React.useState(false);\n return (\n \n \n \n \n {isOpen ? : }\n \n }\n onOpenMenu={() => setIsOpen(true)}\n onCloseMenu={() => setIsOpen(false)}\n attachRight={attachRight}\n delay={delay}\n menuContainerProps={menuContainerProps}\n >\n {children}\n \n );\n}\n","import React, { useEffect, useState, useRef } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { useLocation } from \"react-router-dom\";\nimport { useHistory } from \"react-router-dom\";\n\nimport { METHODS } from \"../../services/api\";\nimport { breakpoints } from \"../../theme/constant\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { Link } from \"react-router-dom\";\nimport { PATHS, interpolatePath } from \"../../constant\";\nimport { useSearchQuery } from \"../../common/search\";\nimport {\n Box,\n TextField,\n Container,\n Typography,\n Grid,\n Card,\n Button,\n Tooltip,\n Popper,\n setRef,\n} from \"@mui/material\";\nimport useStyles from \"./styles\";\nimport { Popover, InputAdornment, Modal } from \"@mui/material\";\nimport SearchOutlinedIcon from \"@mui/icons-material/SearchOutlined\";\nimport Backdrop from \"@mui/material/Backdrop\";\nimport axios from \"axios\";\n\nfunction usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n }, [value]);\n return ref.current;\n}\n\nfunction SearchPopup() {\n const { data } = useSelector(({ Course }) => Course);\n const user = useSelector(({ User }) => User);\n const userId = user.data?.user?.id;\n const pathway = useSelector((state) => state.Pathways);\n const dispatch = useDispatch();\n // const [recentSearch,setrecentSearch]=useState(\"\")\n const [search, setSearch] = useState(\"\");\n const [focus, setFocus] = useState(true);\n useSearchQuery(setSearch);\n const history = useHistory();\n const classes = useStyles();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n const [anchorEl, setAnchorEl] = useState(null);\n const [popular, setPopular] = useState([]);\n const [recentSearch, setRecentSearch] = useState([]);\n\n const prevSearch = usePrevious(search);\n\n const handleClick = (event) => {\n setAnchorEl(anchorEl ? null : event.currentTarget);\n };\n\n const open = Boolean(anchorEl);\n const id = open ? \"simple-popper\" : undefined;\n\n const handleSearchChange = (e) => {\n if (e.key == \"Enter\") {\n if (e.target.value == \"\") {\n if (!search == \"\") {\n history.replace(`/search-course/?search=${prevSearch}`);\n }\n } else {\n history.replace(`/search-course/?search=${e.target.value}`);\n }\n setAnchorEl(null);\n e.preventDefault();\n }\n };\n\n const handleSearchBar = (e) => {\n history.replace(`/search-course/?search=${e.target.value}`);\n setAnchorEl(null);\n };\n\n useEffect(() => {\n axios({\n url: `${process.env.REACT_APP_MERAKI_URL}/search/popular`,\n method: METHODS.GET,\n headers: {\n accept: \"application/json\",\n Authorization: false,\n },\n })\n .then((res) => {\n setPopular(res.data.top_popular);\n })\n .catch((err) => {});\n }, []);\n\n useEffect(() => {\n if (user.data !== null) {\n axios({\n url: `${process.env.REACT_APP_MERAKI_URL}/search/${userId}`,\n method: METHODS.GET,\n headers: {\n accept: \"application/json\",\n Authorization: user.data.token || null,\n },\n })\n .then((res) => {\n setRecentSearch(res.data.user_search);\n })\n .catch((err) => {});\n }\n }, []);\n\n const pathwayCourseIds =\n pathway.data?.pathways\n .map((pathway) => pathway.courses || [])\n .flat()\n .map((course) => course.id) || [];\n const otherCourseResults = data?.allCourses.filter((item) => {\n return (\n // item.course_type === \"json\" &&\n !pathwayCourseIds.includes(item.id) &&\n item.name.toLowerCase().includes(search.toLowerCase())\n );\n });\n const pathwayTrackResults = pathway.data?.pathways\n .map((pathway) => {\n return {\n ...pathway,\n courses: pathway.courses?.filter((course) => {\n return course.name.toLowerCase().includes(search.toLowerCase());\n }),\n };\n })\n .filter((pathway) => pathway.courses?.length > 0);\n\n const hasSearchResults =\n pathwayTrackResults?.length > 0 || otherCourseResults?.length > 0;\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n // const recent = JSON.parse(localStorage.getItem(\"recent\"));\n\n return (\n <>\n \n \n \n\n \n \n \n \n \n \n ),\n }}\n sx={{ margin: \"40px 0px 32px 0px\" }}\n inputRef={(input) => {\n if (input != null) {\n input.focus();\n }\n }}\n variant=\"standard\"\n fullWidth\n onKeyPress={handleSearchChange}\n onChange={(e) => {\n setSearch(e.target.value);\n }}\n />\n\n <>\n {recentSearch && recentSearch?.length ? (\n <>\n Recent Searches \n\n \n {recentSearch.map((item) => (\n \n \n {item}\n \n \n ))}\n \n >\n ) : (\n <>\n Popular Searches \n \n {popular.map((item) => (\n \n \n {item}\n \n \n ))}\n \n >\n )}\n >\n \n \n \n >\n );\n}\nexport default SearchPopup;\n","import React from \"react\";\n\nimport { DropDown, MobileDropDown } from \"../DropDown\";\nimport { Box, Typography, Menu, MenuItem, Button } from \"@mui/material\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport ExpandLessIcon from \"@mui/icons-material/ExpandLess\";\nimport HeaderNavLink from \"../HeaderNavlink\";\nimport SearchHeader from \"../SearchHeader\";\nimport Message from \"../../common/Message\";\nimport { PATHS } from \"../../../constant\";\nimport TextButtonDropDownMenu from \"../TextButtonDropDownMenu\";\nimport LaunchOutlinedIcon from \"@mui/icons-material/LaunchOutlined\";\nimport {\n LEARN_KEY,\n MENU_ITEMS,\n // ROLES,\n // ADMIN_ROLE_KEY as ADMIN,\n // PARTNER_ROLE_KEY as PARTNER,\n // PARTNER_VIEW_ROLE_KEY as PARTNER_VIEW,\n // PARTNER_EDIT_ROLE_KEY as PARTNER_EDIT,\n // STUDENT_ROLE_KEY as STUDENT,\n // VOLUNTEER_ROLE_KEY as VOLUNTEER,\n} from \"../constant\";\nimport SearchPopup from \"../../SearchBar/SearchPopup\";\nimport ExternalLink from \"../../common/ExternalLink\";\nimport useStyles from \"../../Header\";\n\nfunction CommonLeftStudentHeader({ toggleDrawer }) {\n const classes = useStyles();\n return (\n <>\n }\n toggleDrawer={toggleDrawer}\n />\n }\n toggleDrawer={toggleDrawer}\n externalLink=\"true\"\n />\n >\n );\n}\n\nfunction StudentHeader({ leftDrawer, toggleDrawer, onlyRole }) {\n const [learn, setLearn] = React.useState(null);\n\n const handleCloseLearn = () => {\n setLearn(null);\n };\n\n return (\n <>\n \n \n \n \n\n \n \n \n \n \n \n\n \n {!leftDrawer && }\n\n {/* }\n toggleDrawer={toggleDrawer}\n />\n }\n toggleDrawer={toggleDrawer}\n /> */}\n \n >\n );\n}\n\nexport default StudentHeader;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { Box } from \"@mui/material\";\nimport HeaderNavLink from \"../HeaderNavlink\";\nimport SearchHeader from \"../SearchHeader\";\nimport Message from \"../../common/Message\";\nimport { PATHS } from \"../../../constant\";\nimport SearchPopup from \"../../SearchBar/SearchPopup\";\n\nfunction AdminHeader({ leftDrawer, toggleDrawer }) {\n const user = useSelector(({ User }) => User);\n const partnerGroupId = user.data.user.partner_group_id;\n\n return (\n <>\n \n {/* }\n toggleDrawer={toggleDrawer}\n /> */}\n }\n toggleDrawer={toggleDrawer}\n />\n {/* \n }\n toggleDrawer={toggleDrawer}\n /> */}\n\n }\n toggleDrawer={toggleDrawer}\n />\n }\n toggleDrawer={toggleDrawer}\n />\n {partnerGroupId && (\n \n }\n toggleDrawer={toggleDrawer}\n />\n )}\n \n {!leftDrawer && }\n >\n );\n}\n\nexport default AdminHeader;\n","import React from \"react\";\nimport { Box } from \"@mui/material\";\nimport HeaderNavLink from \"../HeaderNavlink\";\nimport SearchHeader from \"../SearchHeader\";\nimport Message from \"../../common/Message\";\nimport { PATHS } from \"../../../constant\";\nimport SearchPopup from \"../../SearchBar/SearchPopup\";\n\nfunction VolunteerHeader({ leftDrawer, toggleDrawer }) {\n return (\n <>\n \n }\n toggleDrawer={toggleDrawer}\n />\n \n {!leftDrawer && }\n >\n );\n}\n\nexport default VolunteerHeader;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { Box } from \"@mui/material\";\nimport HeaderNavLink from \"../HeaderNavlink\";\nimport SearchHeader from \"../SearchHeader\";\nimport Message from \"../../common/Message\";\nimport { PATHS } from \"../../../constant\";\nimport SearchPopup from \"../../SearchBar/SearchPopup\";\n\nfunction PartnerHeader({ leftDrawer, toggleDrawer }) {\n const user = useSelector(({ User }) => User);\n const partnerId = user.data.user.partner_id;\n const partnerGroupId = user.data.user.partner_group_id;\n\n return (\n <>\n \n \n }\n toggleDrawer={toggleDrawer}\n />\n \n {!leftDrawer && }\n >\n );\n}\n\nexport default PartnerHeader;\n","import React from \"react\";\nimport StudentHeader from \"../StudentHeader\";\nimport AdminHeader from \"../AdminHeader\";\nimport VolunteerHeader from \"../VolunteerHeader\";\nimport PartnerHeader from \"../PartnerHeader\";\nimport {\n ADMIN_ROLE_KEY as ADMIN,\n PARTNER_ROLE_KEY as PARTNER,\n STUDENT_ROLE_KEY as STUDENT,\n VOLUNTEER_ROLE_KEY as VOLUNTEER,\n} from \"../constant\";\n\nfunction RoleSpecificHeader({ role, isUniqueRole, leftDrawer, toggleDrawer }) {\n const drawerProps = { leftDrawer, toggleDrawer };\n\n const roleSpecificComponentMap = {\n [STUDENT]: ,\n [ADMIN]: ,\n [VOLUNTEER]: ,\n [PARTNER]: ,\n };\n\n return roleSpecificComponentMap[role] || \"\";\n}\n\nexport default RoleSpecificHeader;\n","import React from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { NavLink, useLocation, useHistory } from \"react-router-dom\";\nimport { PATHS } from \"../../../constant\";\nimport useStyles from \"../styles\";\nimport { Box, Typography, Menu, MenuItem } from \"@mui/material\";\nimport TextButtonDropDownMenu from \"../TextButtonDropDownMenu\";\n// import ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n// import ExpandLessIcon from \"@mui/icons-material/ExpandLess\";\nimport Message from \"../../common/Message\";\nimport {\n MENU_ITEMS,\n ROLES,\n ADMIN_ROLE_KEY as ADMIN,\n PARTNER_ROLE_KEY as PARTNER,\n PARTNER_VIEW_ROLE_KEY as PARTNER_VIEW,\n PARTNER_EDIT_ROLE_KEY as PARTNER_EDIT,\n STUDENT_ROLE_KEY as STUDENT,\n VOLUNTEER_ROLE_KEY as VOLUNTEER,\n} from \"../constant\";\nimport AccordionDropDownMenu from \"../AccordionDropDownMenu\";\n// import { isTouchScreen } from \"../../../common/utils\";\n\n/*\nconst rolesLandingPages = {\n [STUDENT]: PATHS.NEW_USER_DASHBOARD,\n [ADMIN]: PATHS.PARTNERS,\n [VOLUNTEER]: PATHS.CLASS,\n [PARTNER]: PATHS.PARTNERS,\n};\n*/\n\n// const SELECTED_ROLE_KEY = \"selectedRole\";\nconst ID_TO_SELECTED_ROLE_MAP_KEY = \"idToSelectedRoleMap\";\n\nfunction ChangeRole({ isToggle, role, setRoleView, roleView, uid }) {\n const classes = useStyles();\n const styles = isToggle ? {} : { margin: \"0 10px\" };\n const roleStr = ;\n\n const roleLandingPage = role.landingPage;\n // classes.bgColor doesn't do anything because it's overriden by the\n // transparency of the list item\n return roleLandingPage ? (\n {\n setRoleView(role.key);\n // localStorage.setItem(SELECTED_ROLE_KEY, role.key);\n const idToSelectedRoleMap =\n JSON.parse(localStorage.getItem(ID_TO_SELECTED_ROLE_MAP_KEY)) || {};\n idToSelectedRoleMap[uid] = role.key;\n localStorage.setItem(\n ID_TO_SELECTED_ROLE_MAP_KEY,\n JSON.stringify(idToSelectedRoleMap)\n );\n // !isToggle && handleCloseSwitchView();\n }}\n sx={styles}\n className={roleView === role.key && classes.bgColor}\n // className={classes.link}\n >\n {isToggle ? (\n \n ) : (\n roleStr\n )}\n \n ) : (\n \"\"\n );\n}\n\nfunction ChangeRolesView({ setRole, roles, uid, leftDrawer }) {\n const defaultRole = roles.find((role) => role.assignedRole) || roles[0];\n const lastSelectedRoleKey = JSON.parse(\n localStorage.getItem(ID_TO_SELECTED_ROLE_MAP_KEY)\n )?.[uid]; // || localStorage.getItem(SELECTED_ROLE_KEY);\n const hasLastSelectedRole = roles.some(\n (role) => role.key === lastSelectedRoleKey\n );\n const [roleView, setRoleView] = React.useState(\n hasLastSelectedRole ? lastSelectedRoleKey : defaultRole?.key\n );\n const otherRole =\n roles[(roles.findIndex((role) => role.key === roleView) + 1) % 2];\n\n const commonProps = { setRoleView, roleView, uid };\n const history = useHistory();\n let menu = \"\";\n\n if (roles.length > 2) {\n const menuContents = (\n \n {roles.map((role) => (\n \n ))}\n
\n );\n menu = leftDrawer ? (\n \n {menuContents}\n \n ) : (\n \n {menuContents}\n \n );\n } else if (roles.length === 2) {\n menu = ;\n }\n //const location = useLocation();\n\n React.useEffect(() => {\n setRole(roleView);\n // if (location !== roles[roleView]) {\n // for load\n // history.push(roles[roleView]);\n //}\n }, [roleView]);\n\n // React.useEffect(() => {\n // const roleData = roles.find((role) => role.key === roleView);\n // roleData?.landingPage && history.push(roleData.landingPage);\n // }, []);\n\n return (\n \n {menu}\n \n );\n}\n\nexport default ChangeRolesView;\n","import React, { useState, useEffect } from \"react\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { Link, NavLink, useLocation, useHistory } from \"react-router-dom\";\nimport { PATHS, interpolatePath } from \"../../constant\";\nimport { hasOneFrom } from \"../../common/utils\";\nimport { actions as userActions } from \"../User/redux/action\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport ExpandLessIcon from \"@mui/icons-material/ExpandLess\";\nimport useStyles from \"./styles\";\nimport { DropDown, MobileDropDown } from \"./DropDown\";\nimport { sendToken } from \"../User/redux/api\";\nimport { actions as pathwayActions } from \"../../components/PathwayCourse/redux/action\";\nimport SearchIcon from \"@mui/icons-material/Search\";\nimport { Box, Typography, Menu, MenuItem, Button } from \"@mui/material\";\nimport HeaderNavLink from \"./HeaderNavlink\";\nimport UserMenu from \"./UserMenu\";\nimport SearchBar from \"../SearchBar\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Message from \"../common/Message\";\nimport {\n LEARN_KEY,\n MENU_ITEMS,\n ROLES,\n ADMIN_ROLE_KEY as ADMIN,\n PARTNER_ROLE_KEY as PARTNER,\n PARTNER_VIEW_ROLE_KEY as PARTNER_VIEW,\n PARTNER_EDIT_ROLE_KEY as PARTNER_EDIT,\n STUDENT_ROLE_KEY as STUDENT,\n VOLUNTEER_ROLE_KEY as VOLUNTEER,\n} from \"./constant\";\nimport StudentHeader from \"./StudentHeader\";\nimport AdminHeader from \"./AdminHeader\";\nimport VolunteerHeader from \"./VolunteerHeader\";\nimport PartnerHeader from \"./PartnerHeader\";\nimport RoleSpecificHeader from \"./RoleSpecificHeader\";\nimport SearchHeader from \"./SearchHeader\";\nimport ChangeRolesView from \"./ChangeRolesView\";\nimport { selectRolesData, selectUserId } from \"../User/redux/selectors\";\n\n/*\nconst savedRolesToKeysMap = Object.keys(ROLES).reduce((roleKeyMap, roleKey) => {\n roleKeyMap[ROLES[roleKey].savedValue] = roleKey;\n return roleKeyMap;\n}, {});\n*/\n\nconst rolesLandingPages = {\n [STUDENT]: PATHS.NEW_USER_DASHBOARD,\n [ADMIN]: PATHS.PARTNERS,\n [VOLUNTEER]: PATHS.CLASS,\n [PARTNER]: PATHS.PARTNERS,\n};\n\nfunction AuthenticatedHeaderOption({\n setRole,\n role,\n toggleDrawer,\n leftDrawer,\n handleSearchChange,\n}) {\n //const [RoleSpecificHeader, setRoleSpecificHeader] = React.useState(null);\n const roles = useSelector(selectRolesData);\n const uid = useSelector(selectUserId);\n // const history = useHistory();\n // const location = useLocation();\n\n const rolesWithLandingPages = roles.map((role) => ({\n ...role,\n landingPage: rolesLandingPages[role.key] || \"/\",\n }));\n\n // const [role, setRole] = React.useState(null);\n // const user = useSelector(({ User }) => User);\n const isUniqueRole = roles.length === 1;\n // const dispatch = useDispatch();\n // const pathway = useSelector((state) => state.Pathways);\n\n // special case for partner landing page\n const partnerRole = rolesWithLandingPages.find(\n (role) => role.key === PARTNER\n );\n if (partnerRole) {\n if (partnerRole.properties.partnerGroupId != null) {\n partnerRole.landingPage = `${PATHS.STATE}/${partnerRole.properties.partnerGroupId}`;\n } else if (partnerRole.properties.partnerId != null) {\n partnerRole.landingPage = `${PATHS.PARTNERS}/${partnerRole.properties.partnerId}`;\n }\n }\n\n /*\n useEffect(() => {\n if (location !== rolesWithLandingPages[role.key]) {\n history.push(rolesWithLandingPages[role.key]);\n }\n }, [role]);\n*/\n /*\n useEffect(() => {\n sendToken({ token: user.data.token }).then((res) => {\n // setPartnerId(res.data.user.partner_id);\n // setProfile(res.data.user.profile_picture);\n });\n }, []);\n*/\n\n // useEffect(() => {\n // dispatch(pathwayActions.getPathways());\n //}, [dispatch]);\n\n // const pythonPathwayId =\n // pathway.data?.pathways.find((pathway) => pathway.code === \"PRGPYT\")?.id;\n\n // const merakiStudents = rolesList.length < 1; //admin\n\n return (\n <>\n \n \n \n \n {!leftDrawer && }\n >\n );\n}\n\nexport default AuthenticatedHeaderOption;\n","import React, { useState, useEffect, useRef } from \"react\";\nimport theme from \"../../theme/theme\";\nimport { useSelector } from \"react-redux\";\nimport { Link } from \"react-router-dom\";\nimport { PATHS } from \"../../constant\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport ExpandLessIcon from \"@mui/icons-material/ExpandLess\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport useStyles from \"./styles\";\nimport List from \"@mui/material/List\";\nimport { DropDown, MobileDropDown } from \"./DropDown\";\nimport { useRouteMatch } from \"react-router-dom\";\nimport SearchIcon from \"@mui/icons-material/Search\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { breakpoints } from \"../../theme/constant\";\nimport {\n AppBar,\n Box,\n Toolbar,\n Container,\n Button,\n MenuItem,\n ThemeProvider,\n SwipeableDrawer,\n Typography,\n useMediaQuery,\n} from \"@mui/material\";\nimport PropTypes from \"prop-types\";\nimport { withRouter } from \"react-router\";\nimport { NavLink } from \"react-router-dom\";\nimport {\n PUBLIC_MENU_KEYS,\n // LEARN_KEY,\n MENU_ITEMS,\n // ROLES,\n ADMIN_ROLE_KEY as ADMIN,\n PARTNER_ROLE_KEY as PARTNER,\n // PARTNER_VIEW_ROLE_KEY as PARTNER_VIEW,\n // PARTNER_EDIT_ROLE_KEY as PARTNER_EDIT,\n STUDENT_ROLE_KEY as STUDENT,\n VOLUNTEER_ROLE_KEY as VOLUNTEER,\n} from \"./constant\";\nimport ExternalLink from \"../common/ExternalLink\";\nimport { selectRolesData } from \"../User/redux/selectors\";\nimport AuthenticatedHeaderOption from \"./AuthenticatedHeaderOption\";\nimport SearchBar from \"../SearchBar\";\nimport { useHistory } from \"react-router-dom\";\nimport { useLocation } from \"react-router-dom\";\nimport Message from \"../common/Message\";\nimport TextButtonDropDownMenu from \"./TextButtonDropDownMenu\";\nimport SearchPopup from \"../SearchBar/SearchPopup\";\nimport LaunchOutlinedIcon from \"@mui/icons-material/Launch\";\nimport HeaderNavLink from \"./HeaderNavlink\";\n\nimport OpenInNewIcon from \"@mui/icons-material/OpenInNew\";\n// import { PUBLIC_MENU_KEYS, MENU_ITEMS } from \"./constant\";\n// import { useContext } from \"react\";\n// import { useLanguageConstants, getTranslationKey } from \"../../common/language\";\n// import { LanguageProvider } from \"../../common/context\";\n\nconst PublicMenuOption = ({ leftDrawer, toggleDrawer }) => {\n const [indicator, setIndicator] = useState(null);\n const [dropDownMenu, setDropDownMenu] = useState(null);\n const [selectedMenu, SetSelectedMenu] = useState(null);\n const [inDropdown, setInDropdown] = useState({\n inProgress: false,\n value: false,\n });\n const inDropdownRef = useRef(inDropdown);\n inDropdownRef.current = inDropdown;\n const classes = useStyles();\n // const { language, MSG } = useLanguageConstants(); //useContext(LanguageProvider);\n\n const menuOpenHandler = (event, menuKey) => {\n setIndicator(event.currentTarget);\n setDropDownMenu(menuKey);\n SetSelectedMenu(menuKey);\n };\n\n const showLoginButton = !useRouteMatch({\n path: PATHS.LOGIN,\n });\n\n const menuCloseHandler = () => {\n setIndicator(null);\n };\n\n const updateInDropdownState = () => {\n setInDropdown({ inProgress: true, value: false });\n setTimeout(\n () =>\n setInDropdown({\n value: inDropdownRef.current?.value,\n inProgress: false,\n }),\n 200\n );\n };\n\n useEffect(() => {\n if (!inDropdown.inProgress && !inDropdown.value) {\n // mouse has moved out of main menu item and its\n // dropdown after delay milliseconds\n menuCloseHandler();\n }\n }, [inDropdown]);\n\n const [scratchUrl, setScratchUrl] = useState(\n `https://scratch.merakilearn.org/login`\n );\n\n useEffect(() => {\n if (\n window.location.origin === \"http://localhost:3000\" ||\n window.location.origin ===\n \"https://www.merd-bhanwaridevi.merakilearn.org\"\n ) {\n setScratchUrl(`https://dev.scratch.merakilearn.org/login`);\n }\n }, []);\n\n return (\n <>\n \n {localStorage.getItem(\"studentAuth\") ? null : (\n <>\n {PUBLIC_MENU_KEYS.map((menuKey, index) => (\n <>\n \n \n \n >\n ))}\n\n \n \n \n Donate\n \n \n \n \n >\n )}\n \n\n \n {localStorage.getItem(\"studentAuth\") ? null : (\n <>\n {PUBLIC_MENU_KEYS.map((menuKey) => (\n \n ))}\n \n \n \n Donate\n \n \n \n \n >\n )}\n \n\n {localStorage.getItem(\"studentAuth\") ? (\n \n \n Scratch\n \n \n \n ) : (\n <>\n {!leftDrawer && (\n \n \n \n )}\n\n {showLoginButton && !leftDrawer && (\n \n \n Log in \n \n \n )}\n >\n )}\n >\n );\n};\n\nconst MobileVersion = ({ toggleDrawer, leftDrawer, setRole, role }) => {\n const { data } = useSelector(({ User }) => User);\n const isAuthenticated = data && data.isAuthenticated;\n const classes = useStyles();\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {isAuthenticated ? (\n \n ) : (\n \n )}\n
\n \n );\n};\n\nfunction Header() {\n const classes = useStyles();\n const { data } = useSelector(({ User }) => User);\n const user = useSelector(({ User }) => User);\n const [position, setposition] = useState(true);\n const roles = useSelector(selectRolesData);\n const [role, setRole] = React.useState(null);\n const isAuthenticated = data && data.isAuthenticated;\n const [leftDrawer, setLeftDrawer] = useState(false);\n const [bgColor, setBgcolor] = useState(false);\n let location = useLocation();\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n window.addEventListener(\"resize\", () => {\n if (window.outerWidth > theme.breakpoints.values.md) {\n setLeftDrawer(false);\n }\n });\n\n const partnerGroupId = user?.data?.user?.partner_group_id;\n const partnerId = user?.data?.user?.partner_id;\n\n const rolesLandingPages = {\n [STUDENT]: PATHS.NEW_USER_DASHBOARD,\n [ADMIN]: PATHS.PARTNERS,\n [VOLUNTEER]: PATHS.CLASS,\n [PARTNER]: partnerGroupId\n ? `${PATHS.STATE}/${partnerGroupId}`\n : `${PATHS.PARTNERS}/${partnerId || \"\"}`,\n };\n\n useEffect(() => {\n if (location.pathname === \"/home\" || location.pathname === \"/\") {\n setBgcolor(true);\n } else {\n setBgcolor(false);\n }\n }, [location]);\n\n const roleKey = roles\n .map((userRole) => userRole.key)\n .find((key) => key === role);\n const defaultPage = rolesLandingPages[roleKey] || \"/\";\n\n const toggleDrawer = (open) => (event) => {\n if (\n event &&\n event.type === \"keydown\" &&\n (event.key === \"Tab\" || event.key === \"Shift\")\n ) {\n return;\n }\n setLeftDrawer(open);\n };\n const [elevation, setElevation] = useState(0);\n window.addEventListener(\"scroll\", () => {\n if (window.scrollY > 0) {\n setElevation(8);\n } else {\n setElevation(0);\n }\n });\n\n // window.addEventListener(\"scroll\", changeBackground);\n\n window.addEventListener(\"scroll\", () => {\n let count = isActive ? 900 : 770;\n if (window.scrollY > count) {\n setposition(false);\n } else {\n setposition(true);\n }\n });\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {/* \n \n \n \n \n \n */}\n \n \n \n \n \n \n \n {isAuthenticated ? (\n \n ) : (\n <>\n \n >\n )}\n \n \n \n \n );\n}\n\nexport default Header;\n","import { makeStyles } from \"@mui/styles\";\n\nconst useStyles = makeStyles((theme) => ({\n logo: {\n padding: \"0px 8px 0px 16px\",\n marginBottom: \"20px\",\n },\n meraki: {\n padding: \"20px 8px\",\n },\n socialMedia: {\n paddingLeft: \"9px\",\n },\n image: {\n padding: \"0px 8px\",\n },\n content: {\n padding: \"10px 10px 0px 16px\",\n width: \"300px\",\n },\n hover: {\n \"&:hover\": {\n color: \"#48a145\",\n },\n },\n link: {\n textDecoration: \"none\",\n },\n CareerNDoner: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n \"&:hover\": {\n color: \"#48a145\",\n },\n },\n}));\n\nexport default useStyles;\n","import React, { useEffect } from \"react\";\nimport { Grid, Box, Container, List, Typography, Divider } from \"@mui/material\";\nimport useStyles from \"./styles\";\nimport { Link } from \"react-router-dom\";\nimport { PATHS, interpolatePath } from \"../../constant\";\nimport LaunchOutlinedIcon from \"@mui/icons-material/LaunchOutlined\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { actions as pathwayActions } from \"../PathwayCourse/redux/action\";\nimport ExternalLink from \"../common/ExternalLink\";\nimport useMediaQuery from \"@mui/material/useMediaQuery\";\nimport { breakpoints } from \"../../theme/constant\";\nimport { PATHWAYS_INFO } from \"../../constant\";\n\nconst menu = {\n About: [\n { name: \"Our Story\", type: \"internal\", path: PATHS.OUR_STORY },\n { name: \"Meraki Team\", type: \"internal\", path: PATHS.TEAM },\n ],\n LearningTracks: [],\n GetInvolved: [\n {\n name: \"Volunteer With Us\",\n type: \"internal\",\n path: PATHS.VOLUNTEER_AUTOMATION,\n },\n {\n name: \"Our Partners\",\n type: \"internal\",\n path: PATHS.OUR_PARTNER,\n },\n {\n name: \"Careers\",\n type: \"external\",\n path: \"https://recruiterflow.com/navgurukul/jobs\",\n },\n ],\n};\n\nconst MenuList = (menuItem) => {\n const title = menuItem.split(/(?=[A-Z])/).join(\" \");\n const user = useSelector(({ User }) => User);\n const classes = useStyles();\n const dispatch = useDispatch();\n const { data } = useSelector((state) => {\n return state.PathwaysDropdow;\n });\n\n // useEffect(() => {\n // dispatch(\n // pathwayActions.getPathwaysDropdown({\n // authToken: user,\n // })\n // );\n // }, [dispatch, user]);\n\n const miscellaneousPathway = data?.pathways.filter((pathway) =>\n PATHWAYS_INFO.some((miscPathway) => pathway.name === miscPathway.name)\n );\n const pathwayData = data?.pathways\n .filter((pathway) => !miscellaneousPathway.includes(pathway))\n .concat(miscellaneousPathway);\n\n if (menuItem === \"LearningTracks\") {\n menu[menuItem] = pathwayData;\n }\n\n const subMenu = menu[menuItem];\n\n return (\n <>\n \n {title}\n \n \n {subMenu?.map((item) => {\n if (item.type === \"external\") {\n return (\n \n \n {item.name} \n \n \n );\n } else {\n const toLink = item.id\n ? interpolatePath(PATHS.PATHWAY_COURSE, {\n pathwayId: item.id,\n })\n : item.path;\n return (\n \n \n {item.name}\n \n \n );\n }\n })}\n
\n >\n );\n};\n\nfunction FooterIcon(props) {\n const classes = useStyles();\n\n const socialMediaLink = {\n facebook: \"https://www.facebook.com/navgurukul/\",\n linkedIn: \"https://www.linkedin.com/company/navgurukul/\",\n twitter: \"https://twitter.com/navgurukul\",\n };\n\n return (\n \n \n \n \n \n );\n}\n\nfunction Footer() {\n const classes = useStyles();\n const user = useSelector(({ User }) => User);\n const dispatch = useDispatch();\n const { data } = useSelector((state) => {\n return state.PathwaysDropdow;\n });\n\n const isActive = useMediaQuery(\"(max-width:\" + breakpoints.values.sm + \"px)\");\n\n // useEffect(() => {\n // dispatch(\n // pathwayActions.getPathwaysDropdown({\n // authToken: user,\n // })\n // );\n // }, [dispatch, user]);\n\n menu.LearningTracks &&\n data &&\n data.pathways &&\n data.pathways.forEach((pathway) => {\n menu.LearningTracks.forEach((item) => {\n if (pathway.code === item.code) {\n item.id = pathway.id;\n }\n });\n });\n\n return (\n \n \n \n \n \n \n \n \n \n \n {[\"facebook\", \"linkedIn\", \"twitter\"].map((imgName) => (\n \n ))}\n \n \n \n © 2022 NavGurukul Foundation for Social Welfare\n \n \n \n \n {MenuList(\"About\")}\n \n \n {MenuList(\"LearningTracks\")}\n \n \n {MenuList(\"GetInvolved\")}\n \n \n Donate \n \n \n \n \n \n Learn on Mobile\n \n \n \n \n \n \n Now on Playstore\n \n \n \n \n \n \n \n \n \n \n \n \n Legal & Privacy Policy\n \n \n \n \n \n Made with ❤️ for our students{\" \"}\n \n \n \n \n \n \n );\n}\n\nexport default Footer;\n","const hi = {};\nhi.LEARN = \"सीखें\";\nhi.ABOUT = \"के बारे में\";\nhi.GET_INVOLVED = \"उलझना\";\nhi.OUR_STORY = \"हमारी कहानी\";\nhi.DASHBOARD = \"डैशबोर्ड\";\nhi.STATEPARTNER = \"स्टेटपार्टनर\";\nhi.SWITCH_VIEWS = \"दृष्टिकोण स्विच करें\";\nhi.SWITCH_TO_VIEW = \"%1 के दृष्टिकोण पर स्विच करें\";\nhi.STUDENT = \"छात्र\";\nhi.VOLUNTEER = \"स्वयंसेवक\";\nhi.ADMIN = \"एडमिन\";\nhi.PARTNER = \"साथी\";\nhi.STUDENTS = \"छात्र\";\nhi.VOLUNTEERS = \"स्वयंसेवक\";\nhi.PARTNERS = \"साथी\";\nhi.DONATE = \"दान करें\";\nhi.VOLUNTEER_WITH_US = \"हमारे साथ स्वयंसेवक करें\";\nhi.MERAKI_TEAM = \"मेराकी टीम\";\nhi.MENTOR = \"गुरु\"; // \"पथप्रदर्शक\";\nhi.SCRATCH = \"स्क्रैच\";\nhi.NAVGURUKUL_ADMISSION = \"नवगुरुकुल प्रवेश\";\nhi.OPPORTUNITIES = \"अवसर\";\nhi.CLASSES = \"कक्षाएं\";\nhi.SEARCH_FOR_COURSES = \"पाठ्यक्रमों के लिए खोजें...\";\nhi.CAREERS = \"करियर\";\nhi.PROFILE = \"प्रोफ़ाइल\";\nhi.LOGOUT = \"लॉगआउट\";\nhi.TUTOR = \"टुटर\";\nhi.CERTIFICATE_COMPLETION_WARNING =\n \"%1 सर्टिफिकेट प्राप्त करने के लिए कृपया सारे कोर्सेज पूर्ण करे.\";\n\nexport default hi;\n","import { lang } from \"../constant\";\nimport en from \"./en\";\nimport hi from \"./hi\";\n// import mr from \"./mr\";\n// import ta from \"./ta\";\n// import te from \"./te\";\n\nconst MSG = { en, hi }; //, mr, ta, te};\n\n// Default language constants to English\nObject.keys(lang).forEach((lang) => (MSG[lang] = { ...en, ...MSG[lang] }));\n\nexport default MSG;\n","import React, { useEffect } from \"react\";\nimport Routing from \"../../routing\";\nimport Header from \"../Header\";\nimport Footer from \"../Footer\";\nimport { useRouteMatch } from \"react-router-dom\";\nimport { useSelector, useDispatch } from \"react-redux\";\nimport { actions as pathwayActions } from \"../PathwayCourse/redux/action\";\nimport { HideHeader, HideFooter } from \"../../constant\";\nimport { ThemeProvider } from \"@mui/material/styles\";\nimport { LanguageProvider } from \"../../common/context\";\nimport { useLanguage } from \"../../common/language\";\nimport theme from \"../../theme/theme\";\nimport MSG from \"../../msg\";\n\nimport \"./styles.scss\";\n\nfunction App() {\n const language = useLanguage();\n const showHeader = !useRouteMatch({\n path: HideHeader,\n });\n const showFooter = !useRouteMatch({\n path: HideFooter,\n });\n\n const user = useSelector(({ User }) => User);\n const dispatch = useDispatch();\n\n useEffect(() => {\n dispatch(\n pathwayActions.getPathwaysDropdown({\n authToken: user,\n })\n );\n }, [dispatch, user]);\n\n return (\n \n \n \n {showHeader ?
: \"\"}\n
\n {\" \"}\n {\" \"}\n
\n {showFooter ?
: \"\"}\n
\n \n \n );\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\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 subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\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.0/8 are 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 function register(config) {\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.href);\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/facebook/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. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then((registration) => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === \"installed\") {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\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\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch((error) => {\n // eslint-disable-next-line no-console\n console.error(\"Error during service worker registration:\", error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { \"Service-Worker\": \"script\" },\n })\n .then((response) => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get(\"content-type\");\n if (\n response.status === 404 ||\n (contentType != null && contentType.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, config);\n }\n })\n .catch(() => {});\n}\n\nexport function unregister() {\n if (\"serviceWorker\" in navigator) {\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister();\n });\n }\n}\n","// ScrollToTop.jsx\nimport { useEffect } from \"react\";\nimport { useLocation } from \"react-router-dom\";\nimport React from \"react\";\nconst ScrollToTop = (props) => {\n const location = useLocation();\n useEffect(() => {\n window.scrollTo(0, 0);\n }, [location]);\n\n return <>{props.children}>;\n};\n\nexport default ScrollToTop;\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { BrowserRouter } from \"react-router-dom\";\nimport { Provider } from \"react-redux\";\nimport initialStore from \"./store.js\";\nimport \"./index.css\";\nimport App from \"./components/App/index.js\";\nimport { DeviceProvider } from \"./common/context\";\nimport * as serviceWorker from \"./serviceWorker\";\nimport { getIsMobile } from \"./common/utils\";\nimport ScrollToTop from \"./common/ScrollTotOP.js\";\nimport * as Sentry from \"@sentry/react\";\nimport { BrowserTracing } from \"@sentry/tracing\";\n\nSentry.init({\n dsn: process.env.REACT_APP_SENTRY_DSN,\n integrations: [new BrowserTracing()],\n\n // Set tracesSampleRate to 1.0 to capture 100%\n // of transactions for performance monitoring.\n // We recommend adjusting this value in production\n tracesSampleRate: 1.0,\n});\n\n// To learn redux and redux saga\n// https://www.codementor.io/@rajjeet/step-by-step-how-to-add-redux-saga-to-a-react-redux-app-11xqieyj67\n// https://redux.js.org/recipes/configuring-your-store\nReactDOM.render(\n \n \n \n \n \n \n \n \n \n \n ,\n document.getElementById(\"root\")\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n","module.exports = __webpack_public_path__ + \"static/media/calender.31c9e099.svg\";","module.exports = __webpack_public_path__ + \"static/media/doublequote.3d3da03c.svg\";","module.exports = __webpack_public_path__ + \"static/media/leftquote.15517aab.svg\";","module.exports = __webpack_public_path__ + \"static/media/calendar.ed7f8251.svg\";","module.exports = __webpack_public_path__ + \"static/media/Group.ad76898f.svg\";","module.exports = __webpack_public_path__ + \"static/media/specialdeals.fda256b1.svg\";","var map = {\n\t\"./amzbootcamp.svg\": 1768,\n\t\"./language.svg\": 1769,\n\t\"./logo.svg\": 598,\n\t\"./menu.svg\": 893,\n\t\"./meraki.svg\": 894,\n\t\"./misc.svg\": 1770,\n\t\"./python.svg\": 1771,\n\t\"./random.svg\": 1772,\n\t\"./residential.svg\": 1773,\n\t\"./scratch.svg\": 1774,\n\t\"./web.svg\": 1775\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 597;","module.exports = __webpack_public_path__ + \"static/media/logo.558f2635.svg\";","// This can still cause collisions if the namespace can contain --\nconst getKeyName = (namespace, key) => namespace + \"--\" + key;\n\nconst saveObjectState = (namespace, key, data) => {\n try {\n const lsKey = getKeyName(namespace, key);\n localStorage.setItem(lsKey, JSON.stringify(data));\n } catch (error) {\n //console.error('Error accessing localStorage:', error);\n return {};\n }\n};\n\nconst getObjectState = (namespace, key) => {\n const lsKey = getKeyName(namespace, key);\n return JSON.parse(localStorage.getItem(lsKey));\n};\n\nconst setItemInState = (namespace, key, itemKey, value) => {\n const data = getObjectState(namespace, key);\n if (data[itemKey] !== value) {\n // don't set again if same value\n data[itemKey] = value;\n saveObjectState(namespace, key, data);\n }\n};\n\nmodule.exports = { saveObjectState, getObjectState, setItemInState };\n","module.exports = __webpack_public_path__ + \"static/media/Email.3861449b.svg\";","module.exports = __webpack_public_path__ + \"static/media/Group.84865e94.svg\";","module.exports = __webpack_public_path__ + \"static/media/Layer.5ec4176b.svg\";","module.exports = __webpack_public_path__ + \"static/media/butterfly.c4adb9c8.svg\";","module.exports = __webpack_public_path__ + \"static/media/girls.fdbf530b.svg\";","module.exports = __webpack_public_path__ + \"static/media/lang.a884469a.svg\";","module.exports = __webpack_public_path__ + \"static/media/livelessons.66938df1.svg\";","module.exports = __webpack_public_path__ + \"static/media/main_image.133268fa.svg\";","module.exports = __webpack_public_path__ + \"static/media/scale.abf4ec23.svg\";","module.exports = __webpack_public_path__ + \"static/media/whatsapp.4bc5f357.svg\";","module.exports = __webpack_public_path__ + \"static/media/ClassCreated.c46399b2.svg\";","module.exports = __webpack_public_path__ + \"static/media/facilitator.e854db31.svg\";","module.exports = __webpack_public_path__ + \"static/media/language.e4b76cde.svg\";","const getIsMobile = () => {\n let check = false;\n (function (a) {\n if (\n /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(\n a\n ) ||\n // eslint-disable-next-line no-useless-escape\n /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(\n a.substr(0, 4)\n )\n )\n check = true;\n })(navigator.userAgent || navigator.vendor || window.opera);\n return check;\n};\n\nconst isTouchScreen = () => {\n // https://stackoverflow.com/a/4819886\n return (\n \"ontouchstart\" in window ||\n navigator.maxTouchPoints > 0 ||\n navigator.msMaxTouchPoints > 0\n );\n};\n\nconst getQueryVariable = (queryVars) => {\n var query = window.location.search.substring(1);\n var vars = query.split(\"&\");\n for (var i = 0; i < vars.length; i++) {\n var pair = vars[i].split(\"=\");\n if (decodeURIComponent(pair[0]) == queryVars) {\n return decodeURIComponent(vars[i]);\n }\n }\n};\n\nconst hasOneFrom = (arr1, arr2) => arr2.some((item) => arr1.includes(item));\n\nmodule.exports = { getIsMobile, getQueryVariable, hasOneFrom, isTouchScreen };\n","module.exports = __webpack_public_path__ + \"static/media/Second-img.4fd1f36d.svg\";","module.exports = __webpack_public_path__ + \"static/media/code-example.593998ef.svg\";","module.exports = __webpack_public_path__ + \"static/media/degree.54daf7f9.svg\";","module.exports = __webpack_public_path__ + \"static/media/playButton.b16f857a.svg\";","module.exports = __webpack_public_path__ + \"static/media/menu.123e7350.svg\";","module.exports = __webpack_public_path__ + \"static/media/meraki.dd9c8e09.svg\";","module.exports = __webpack_public_path__ + \"static/media/logo.c77050df.svg\";","module.exports = __webpack_public_path__ + \"static/media/playStore.35f7af8f.svg\";","module.exports = __webpack_public_path__ + \"static/media/dicto.1b9fb29b.jpg\";","module.exports = __webpack_public_path__ + \"static/media/certificate-grey.26c54b12.svg\";","module.exports = __webpack_public_path__ + \"static/media/certificate-color.b448278f.svg\";"],"sourceRoot":""}