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AA,CAAAA,GAAAA,KAAAA,IAAAA,SAAAA,CAAAA,EAAAA,EAAAA,SAAAA,CAAAA,EAAAA,QACzC,MAAID,EACK,IACEA,GAAcC,EAChBC,EAAAA,EAAQA,CAACC,OAAO,CAACH,GAAYI,cAAc,CAACF,EAAAA,EAAQA,CAACG,qBAAqB,EACxEL,GAAc,CAACC,EACjBC,EAAAA,EAAQA,CAACC,OAAO,CAACH,GAAYI,cAAc,CAACF,EAAAA,EAAQA,CAACI,yBAAyB,QAEzF,CA4cO,SAASlF,EAAWmF,CAAQ,EACjC,MAAO,CAbHA,CAAAA,KAAYC,GAaAD,GAbaA,MAabA,GAbiCA,QAajCA,CAb6C,CAc/D","sources":["webpack://_N_E/./components/Cards/Card.js","webpack://_N_E/./pages/Head.js","webpack://_N_E/./pages/backToTop.js","webpack://_N_E/./constants/Constants.js","webpack://_N_E/./utils/Utils.js","webpack://_N_E/"],"sourcesContent":["import Image from \"next/image\";\nimport Link from \"next/link\";\n\nimport CourseDetails from \"../../data/course-details/courseData.json\";\nimport { useEffect, useState } from \"react\";\nimport { BaseApiService } from \"@/utils/BaseApiService\";\nimport { isNotEmpty } from \"@/utils/Utils\";\n\nconst Card = ({ start, end, col, mt, isDesc, isUser }) => {\n const [courses, setCourses] = useState([]);\n\n const fetchCourses = async () => {\n let searchParameters = { searchTerm: \"\", offset: 0, limit: 12, featured: true };\n try {\n const response = await new BaseApiService(\"/courses\").getRequestWithJsonResponse(\n searchParameters\n );\n // console.log(\"Course Response:\", response);\n if (response && response.records) {\n setCourses(response.records);\n // console.log(\"Courses set:\", response.records); // Log the state update\n } else {\n console.error(\"Unexpected response structure:\", response);\n }\n } catch (error) {\n console.error(\"fetchCourses:fetchDataFromServer>>>>\", error);\n }\n };\n\n useEffect(() => {\n fetchCourses();\n }, []);\n\n const addToWishList = async (courseId) => {\n if (!confirm(\"Are you sure you want to add this course from your wishlist?\")) return; // Confirmation before deleting\n\n try {\n const response = await new BaseApiService(`/wishlist/add/${courseId}`)\n .postRequestWithJsonResponse({});\n\n console.log('Course added successfully:', response);\n alert('Course successfully added to wishlist!');\n } catch (error) {\n console.error('An error occurred:', error);\n alert(\"An error occurred while adding course to wishlist. Please try again.\");\n }\n };\n\n return (\n <>\n {courses.length === 0 ? (\n

No courses available.

\n ) : (\n courses.slice(start, end).map((data, index) => (\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n {[...Array(5)].map((_, index) => {\n const ratingValue = index + 1;\n return (\n \n );\n })}\n
\n ({data.ratingsCount} Reviews)\n
\n
\n addToWishList(data.id)}\n >\n \n \n
\n
\n\n

\n \n {data.title || \"Untitled Course\"}\n \n

\n\n
    \n
  • \n \n {data.numberOfLessons} Lessons\n
  • \n
  • \n \n {data.numberOfLessons} Students\n
  • \n
\n {isDesc ?

{data.description}

: \"\"}\n {isUser ? (\n
\n
\n \n \n \n \n \n
\n \n
\n ) : (\n \"\"\n )}\n
\n\n {\n data.isPaid ?\n
\n ${data.discountedPrice}\n ${data.price}\n
:\n
\n ${data.discountedPrice}\n ${data.price}\n
\n }\n\n {data.button ? (\n \n \n Add To Cart\n \n \n ) : (\n \n \n Learn More\n \n \n )}\n
\n
\n
\n \n ))\n )}\n \n );\n};\n\nexport default Card;\n","import Head from \"next/head\";\r\n\r\nconst PageHead = ({ title }) => {\r\n return (\r\n <>\r\n \r\n {title}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default PageHead;\r\n","import React, { useEffect, useRef } from \"react\";\n\nconst BackToTop = () => {\n const progressRef = useRef(null);\n\n useEffect(() => {\n const progressPath = progressRef.current?.querySelector(\"path\");\n if (!progressPath) return;\n\n const pathLength = progressPath.getTotalLength();\n progressPath.style.transition = \"none\";\n progressPath.style.strokeDasharray = `${pathLength} ${pathLength}`;\n progressPath.style.strokeDashoffset = pathLength;\n progressPath.getBoundingClientRect();\n progressPath.style.transition = \"stroke-dashoffset 10ms linear\";\n\n const updateProgress = () => {\n const scroll = window.pageYOffset || document.documentElement.scrollTop;\n const height =\n document.documentElement.scrollHeight -\n document.documentElement.clientHeight;\n const progress = pathLength - (scroll * pathLength) / height;\n progressPath.style.strokeDashoffset = progress;\n\n const rbtProgressParent = progressRef.current;\n if (rbtProgressParent) {\n if (scroll > 50) {\n rbtProgressParent.classList.add(\"rbt-backto-top-active\");\n } else {\n rbtProgressParent.classList.remove(\"rbt-backto-top-active\");\n }\n }\n };\n\n updateProgress();\n window.addEventListener(\"scroll\", updateProgress);\n\n progressRef.current?.addEventListener(\"click\", (event) => {\n event.preventDefault();\n window.scrollTo({ top: 0, behavior: \"smooth\" });\n });\n\n return () => {\n window.removeEventListener(\"scroll\", updateProgress);\n };\n }, []);\n\n return (\n
\n \n \n \n
\n );\n};\n\nexport default BackToTop;\n","export const STORAGE_URL = \"https://storage.bunnycdn.com/materialdesignnative\";\nexport const ACCESS_KEY = \"ba8dd74c-5844-4d83-8523b4a5f50d-a128-4190\";\nexport const MAXIMUM_RECORDS_PER_PAGE = 50;\n\nexport const EmailRegex = \"\";\nexport const SupportedTerritories = \"\";\n\nexport const LOCALITY_TYPES = [\n {\n id: 0,\n name: \"International\",\n },\n {\n id: 1,\n name: \"Local\",\n },\n];\n\nexport const COMPLEXITY_TYPES = [\n {\n id: 0,\n name: \"Starter\",\n },\n {\n id: 1,\n name: \"Intemediate\",\n },\n {\n id: 2,\n name: \"Advanced\",\n },\n];\n\nexport const TASK_VERIFICATION_TYPES = [\n {\n id: 0,\n name: \"Manual\",\n },\n {\n id: 1,\n name: \"Automatic\",\n },\n];","import { DateTime } from \"luxon\";\nimport { EmailRegex, SupportedTerritories } from \"../constants/Constants\";\nimport { UserSessionUtils } from \"./UserSessionUtils\";\n//import { isValidPhoneNumber, parsePhoneNumber } from \"libphonenumber-js\";\nimport { FAILED_TO_LOAD_MESSAGE, INTERNAL_SERVER_ERROR } from \"../constants/ErrorMessages\";\n//import { Badge } from \"react-bootstrap\";\n\n/**\n * This formats a date from the Calendar object into the yyyy-mm-dd format\n * @param {*} date\n * @returns\n */\nexport function formatJSDate(date, showTime = false) {\n if (date == null) return null;\n if (!showTime) {\n var d = new Date(date),\n month = \"\" + (d.getMonth() + 1),\n day = \"\" + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = \"0\" + month;\n if (day.length < 2) day = \"0\" + day;\n\n return [year, month, day].join(\"-\");\n } else {\n return new Date(date).toISOString();\n }\n}\n\nexport function formatToStandardDate(date) {\n date = new Date(date);\n\n const day = date.toLocaleString(\"default\", { day: \"2-digit\" });\n const month = date.toLocaleString(\"default\", { month: \"short\" });\n const year = date.toLocaleString(\"default\", { year: \"numeric\" });\n return day + \"/\" + month + \"/\" + year;\n}\n\n/**\n * This converts a number to the en-us locale to put commas in the string\n *\n * @param {Number} amount\n * @returns\n */\nexport function formatAmountWithCommas(amount, currency) {\n if (amount) {\n var formattedAmount = amount.toLocaleString();\n return currency == null ? formattedAmount : currency + \" \" + formattedAmount;\n } else return \"0\";\n}\n\n/**\n * This converts a number to the en-us locale to put commas in the number\n *\n * @param {Number} number\n * @returns {String}\n */\nexport function formatNumberWithCommas(number, defaultNumber = \"-\") {\n if (number) {\n return number.toLocaleString();\n } else {\n return defaultNumber;\n }\n}\n\n/**\n * This converts a string of a date time instance to a date time string using the\n * luxon DateTime library\n *\n * @param {string} date_value\n * @returns {string}\n */\nexport function toReadableDate(date_value, date_only = false) {\n if (date_value == null) {\n return \"-\";\n } else if (date_value && date_only) {\n return DateTime.fromISO(date_value).toLocaleString(DateTime.DATE_MED_WITH_WEEKDAY);\n } else if (date_value && !date_only) {\n return DateTime.fromISO(date_value).toLocaleString(DateTime.DATETIME_MED_WITH_WEEKDAY);\n }\n}\n\nexport function convertEpochToReadableDateTime(epoch_time) {\n return new Date(epoch_time * 1000);\n}\n\n/**\n * This returns the current date time into an ISO string\n */\nexport function getCurrentDateTimeISOFormat() {\n return DateTime.now().toISO();\n}\n\n/**\n * This returns the first date of the current month\n */\nexport function getFirstDateOfMonth() {\n return DateTime.local().startOf(\"month\").toISODate();\n}\n\n/**\n * This returns the current date into an ISO string\n */\nexport function getCurrentDateISOFormat() {\n return DateTime.now().toISODate();\n}\n\nexport function getDateFromString(dateString) {\n return DateTime.fromISO(dateString);\n}\n\n/**\n * This method is used to get a date object from all passed date string.\n *\n * @param dateString\n * @returns\n */\nexport function getDateWithAnyString(dateString) {\n console.log(dateString);\n if (dateString == null) return null;\n console.log(dateString);\n return new Date(dateString);\n}\n\n/**\n * This gets the date before by subtracting the number of days from the current date\n * @param numberOfDays\n * @returns\n */\nexport function getDateBeforeByDays(numberOfDays) {\n const currentDate = new Date();\n return new Date(\n currentDate.getFullYear(),\n currentDate.getMonth(),\n currentDate.getDate() - numberOfDays\n );\n}\n\n/**\n * Check if the dictionary is empty\n * @param obj\n * @returns\n */\nexport function isDictEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\nexport function replaceWithUnderscore(value) {\n return value.replace(/\\s+/g, \"_\").toLowerCase();\n}\n\n/**\n * This converts a boolean to a Yes or No string\n *\n * @param {Boolean} field\n * @returns\n */\nexport function formatBooleanFields(field) {\n if (field === null) return \"-\";\n else if (field === true) return \"Yes\";\n else if (field === false) return \"No\";\n}\n\nexport function sanitizeValue(recordValue) {\n return recordValue === null || recordValue === undefined ? \"-\" : recordValue;\n}\n\n/**\n * Generate random Id to be used as a device Id.\n *\n * @param length\n * @returns\n */\nexport function generateId(length) {\n var result = \"\";\n var characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n}\n\n/**\n * This formats a string to replace string contents with the arguments index e.g.\n * formatString(\"{0} is {1} and {2}\", \"This\", \"Great\", \"Wonderful\") would return\n * \"This is Great and Wonderful\".\n */\nexport function formatString(str, ...replacements) {\n for (let index = 0; index < replacements.length; index++) {\n str = str.replace(`{${index}}`, replacements[index]);\n }\n return str;\n}\n\n/**\n * This splits the supplied string by commas and returns a valid string\n * @param {string} commaSeparatedString\n * @returns {Array} an array of strings\n */\nexport function splitCommaSeparatedString(commaSeparatedString) {\n if (commaSeparatedString !== null) {\n return commaSeparatedString.split(\",\").map((item) => {\n return item.trim();\n });\n }\n return [];\n}\n\n/**\n * This validates a string using the libphonenumber js lib through the supported territories\n *\n * @param {string} phoneNumber\n * @returns\n */\nexport function validatePhoneNumber(phoneNumber) {\n var result = false;\n SupportedTerritories.forEach((territory) => {\n if (isValidPhoneNumber(phoneNumber, territory.countryIsoCode)) {\n result = true;\n }\n });\n return result;\n}\n\n/**\n * This adds a plus character to a phone number string after checking if the first character is a +\n *\n * @param {string} phoneNumber\n */\nexport function addPlusCharacterToPhoneNumber(phoneNumber) {\n if (phoneNumber.charAt(0) !== \"+\") {\n return \"+\" + phoneNumber;\n }\n return phoneNumber;\n}\n\n/**\n * This validates a string using the libphonenumber js lib to make sure it is in an international format\n *\n * @param {string} phoneNumber\n */\nexport function validateInternationalPhoneNumber(phoneNumber) {\n var result = false;\n try {\n var parsedPhoneNumber = parsePhoneNumber(addPlusCharacterToPhoneNumber(phoneNumber));\n if (\n parsedPhoneNumber != null &&\n SupportedTerritories.filter((e) => e.countryIsoCode === parsedPhoneNumber.country).length >\n 0 &&\n parsedPhoneNumber.isValid()\n ) {\n result = true;\n }\n } catch (error) {\n result = false;\n }\n return result;\n}\n\n/**\n * This validates an email string using a regular expression\n *\n * @param {string} email\n * @returns\n */\nexport function validateEmail(email) {\n return email.match(EmailRegex);\n}\n\n/**\n * This returns the value from a key value list of dictionaries\n * @param arr\n * @param key\n * @returns\n */\nexport function getArrayKeyValue(arr, key) {\n let value = null;\n\n for (const element of arr) {\n if (element?.key === key) {\n value = element?.value;\n break;\n }\n }\n\n return value;\n}\n\n/**\n * This checks whether a user has a specific permission\n * @param permission\n * @returns boolean\n */\nexport function userHasPermission(permissionName) {\n let userDetails = UserSessionUtils.getUserDetails();\n if (userDetails?.isASuperAdmin) {\n return true;\n }\n return userDetails?.permissionLists?.some(\n (userPermission) => userPermission.permissionName === permissionName\n );\n}\n\n/**\n * This checks whether a user has a specific permission using the permission Id. This is better since it is an enum\n * value in the back office. Use a combination of permission Id and Module\n * @param permission\n * @returns boolean\n */\nexport function userHasPermissionId(module, permissionId) {\n let userDetails = UserSessionUtils.getUserDetails();\n if (userDetails?.isASuperAdmin) {\n return true;\n }\n return userDetails?.permissionLists?.some(\n (userPermission) =>\n userPermission.module === module && userPermission.permissionId === permissionId\n );\n}\n\n/**\n * This checks whether a user has a list of permissions by cross referencing the module id and permission id.\n * It uses the permission id and module id because they are enum values in the back office with least likely\n * chance to change.\n * @param module\n * @param permissions\n * @returns\n */\nexport function userHasModulePermissions(module, permissions) {\n let userDetails = UserSessionUtils.getUserDetails();\n if (userDetails?.isASuperAdmin) {\n return true;\n }\n return userPermissionsContains(userDetails?.permissionLists, module, permissions);\n}\n\nexport function userPermissionsContains(userPermissionsList, module, permissionsArray) {\n return userPermissionsList?.some(\n (userPermission) =>\n userPermission.module === module && permissionsArray.includes(userPermission.permissionId)\n );\n}\n\nexport function arrayContains(arrayObject, value) {\n return arrayObject?.some((object) => value === object);\n}\n\nexport function getGoogleMapsURL(latitude, longitude) {\n return `https://www.google.com/maps/search/?api=1&query=${latitude},${longitude}`;\n}\n\n/**\n * This gets the default year range for the date picker to display when selecting a date in the past.\n * @returns\n */\nexport function getDefaultYearRange() {\n return `1900:${new Date().getFullYear() + 1}`;\n}\n\n/**\n * This gets the year range for a datepicker when selecting a date in the past and future\n * @param numberOfYearsBefore\n * @param numberOfYearsAfter\n * @returns\n */\nexport function getYearRange(numberOfYearsBefore, numberOfYearsAfter) {\n return `${new Date().getFullYear() - numberOfYearsBefore}:${\n new Date().getFullYear() + numberOfYearsAfter\n }`;\n}\n\n/**\n * This converts a string to all lower cases using the typescript fn of toLowerCase\n * @param stringToConvert\n * @returns\n */\nexport function convertToLowerCase(stringToConvert) {\n try {\n return stringToConvert?.toLowerCase();\n } catch (error) {\n return stringToConvert;\n }\n}\n\n/**\n * This templates returns formated text hyperlinked to the google maps page with the supplied coordinates\n * @param data :{ latitude; longitude }\n * @returns\n */\nexport const googleMapsLinkTemplate = (data) => {\n if (\n data?.latitude !== null &&\n data?.latitude !== undefined &&\n data?.longitude !== null &&\n data?.longitude !== undefined\n ) {\n return (\n {`${data?.latitude}, ${data?.longitude}`}\n );\n }\n};\n\n/**\n * Use this function to replace the default internal server error message with a\n * specific message of the object that failed to load\n * @param error\n * @param objectName\n * @returns\n */\nexport const sanitizeErrorMessage = (error, objectName) => {\n return error.message === INTERNAL_SERVER_ERROR\n ? formatString(FAILED_TO_LOAD_MESSAGE, objectName)\n : error.message;\n};\n\n/**\n * Truncates a string based on the max string size supplied\n * @param str\n * @param maxSize\n * @returns\n */\nexport const truncate = (str, maxSize) => {\n if (str === null || str === undefined) {\n return \"\";\n }\n return str.length > maxSize ? str.substring(0, maxSize) + \"...\" : str;\n};\n\n/**\n * Gives the status string custom styles\n * @param rowData\n * @returns\n */\nexport const statusBodyTemplate = (status) => {\n const bgName = \"secondary\";\n const knownStyle = toStyleClassName(status);\n return (\n \n {status}\n \n );\n};\n\nexport const renderPlainHtml = (content) => {\n return
;\n};\n/**\n * Replace underscore with space and capitalize each word.\n *\n * @param value\n * @returns\n */\nexport const replaceUnderscoreWithSpace = (value) => {\n if (value == null) return null;\n return value\n .toLowerCase()\n .split(\"_\")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n};\n\n/**\n * To perform the binary-to-Base64 conversion of a file:\n * @param buffer\n * @returns\n */\nexport function arrayBufferToBase64(buffer) {\n var binary = \"\";\n var bytes = new Uint8Array(buffer);\n var len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n\n/**\n * This converts a number string to an integer using parseInt. If the nu\n * @param numberString\n * @returns\n */\nexport function convertStringToNumber(numberString) {\n if (numberString !== null) return parseInt(numberString);\n return numberString;\n}\n/**\n * Removes white spaces from a string\n * @param anyString\n * @returns\n */\nexport function removeWhiteSpaces(anyString) {\n if (isEmpty(anyString)) {\n return null;\n }\n return anyString.replace(/\\s/g, \"\").toLocaleLowerCase();\n}\n\n/**\n * Cleans a string into the css style class name format\n * @param anyString\n * @returns\n */\nexport function toStyleClassName(anyString) {\n if (isEmpty(anyString)) {\n return null;\n }\n return removeWhiteSpaces(anyString)?.toLocaleLowerCase();\n}\n\nexport function genericDateBodyTemplate(displayDate) {\n return

{toReadableDate(displayDate, true)}

;\n}\n\nexport function genericAmountBodyTemplate(displayAmount) {\n return formatAmountWithCommas(displayAmount, null);\n}\n\n/**\n *\n * @param anyValue Returns true if a given object is null or undefined\n * @returns\n */\nexport function isEmpty(anyValue) {\n if (anyValue == undefined || anyValue == null || anyValue == \"null\") {\n return true;\n } else {\n return false;\n }\n}\n\n/**\n *\n * @param {*} anyValue\n * @returns\n */\nexport function isNotEmpty(anyValue) {\n return !isEmpty(anyValue);\n}\n\n/**\n * Converts a JSON object into a form data object\n * @param jsonData\n * @returns FormData object\n */\nexport function jsonToFormData(jsonData) {\n let accountProfileFormData = new FormData();\n for (var itemKey in jsonData) {\n if (jsonData[itemKey] !== undefined && jsonData[itemKey] !== null) {\n accountProfileFormData.append(itemKey, jsonData[itemKey]);\n }\n }\n return accountProfileFormData;\n}\n\nexport function sleep(ms) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"names":["__webpack_exports__","Z","start","end","col","mt","isDesc","isUser","param","courses","setCourses","useState","fetchCourses","response","BaseApiService","getRequestWithJsonResponse","searchTerm","offset","limit","featured","records","console","error","useEffect","addToWishList","courseId","confirm","concat","postRequestWithJsonResponse","log","alert","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsx","Fragment","length","p","slice","map","data","index","div","className","jsxs","Link","legacyBehavior","href","id","a","img","src","isNotEmpty","coverImageUrl","alt","style","width","height","_","ratingValue","i","Math","floor","averageRating","ceil","Number","isInteger","span","ratingsCount","title","onClick","h4","ul","li","numberOfLessons","description","instructor","imageUrl","fullName","category","name","isPaid","discountedPrice","price","button","Head","meta","content","link","rel","progressRef","useRef","progressPath","current","querySelector","pathLength","getTotalLength","transition","strokeDasharray","strokeDashoffset","getBoundingClientRect","updateProgress","scroll","window","pageYOffset","document","documentElement","scrollTop","progress","scrollHeight","clientHeight","rbtProgressParent","classList","add","remove","addEventListener","event","preventDefault","scrollTo","top","behavior","removeEventListener","ref","svg","viewBox","path","d","toReadableDate","date_value","date_only","DateTime","fromISO","toLocaleString","DATE_MED_WITH_WEEKDAY","DATETIME_MED_WITH_WEEKDAY","anyValue","undefined"],"sourceRoot":""}