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,CAAC,UAAY,wBAAwB,MAAQ,oBAAoB,OAAS,qBAAqB,eAAiB,6BAA6B,cAAgB,4BAA4B,eAAiB,6BAA6B,MAAQ,oBAAoB,YAAc,0BAA0B,IAAM,kBAAkB,yBAA2B,yC,kBCA/WD,EAAOC,QAAU,CAAC,UAAY,wBAAwB,MAAQ,sB,kBCA9DD,EAAOC,QAAU,CAAC,cAAgB,6BAA6B,iBAAmB,gCAAgC,KAAO,oBAAoB,SAAW,wBAAwB,sBAAwB,qCAAqC,UAAY","sources":["webpack://_N_E/./node_modules/next-translate/lib/esm/formatElements.js","webpack://_N_E/./node_modules/next-translate/lib/esm/Trans.js","webpack://_N_E/./src/components/Course/ContentContainer/index.tsx","webpack://_N_E/./src/components/Course/CoursesList/index.tsx","webpack://_N_E/./src/components/Course/CoursesPageLayout/index.tsx","webpack://_N_E/./src/components/DataFetcher/index.tsx","webpack://_N_E/./public/icons/retry.svg","webpack://_N_E/./src/components/Error/index.tsx","webpack://_N_E/./src/components/NextSeoWrapper.tsx","webpack://_N_E/./src/components/dls/Card/Card.tsx","webpack://_N_E/./src/components/dls/Pill/index.tsx","webpack://_N_E/./src/utils/string.ts","webpack://_N_E/./src/components/Course/ContentContainer/ContentContainer.module.scss","webpack://_N_E/./src/components/Course/CoursesList/LessonsList.module.scss","webpack://_N_E/./src/components/Course/CoursesPageLayout/CoursesPageLayout.module.scss","webpack://_N_E/./src/components/Error/Error.module.scss","webpack://_N_E/./src/components/dls/Card/Card.module.scss","webpack://_N_E/./src/components/dls/Pill/Pill.module.scss","webpack://_N_E/./src/pages/index.module.scss"],"sourcesContent":["import React, { cloneElement, Fragment } from 'react';\nvar tagRe = /<(\\w+)>(.*?)<\\/\\1>|<(\\w+)\\/>/;\nvar nlRe = /(?:\\r\\n|\\r|\\n)/g;\nfunction getElements(parts) {\n if (!parts.length)\n return [];\n var _a = parts.slice(0, 4), paired = _a[0], children = _a[1], unpaired = _a[2], after = _a[3];\n return [\n [(paired || unpaired), children || '', after],\n ].concat(getElements(parts.slice(4, parts.length)));\n}\nexport default function formatElements(value, elements) {\n if (elements === void 0) { elements = []; }\n var parts = value.replace(nlRe, '').split(tagRe);\n if (parts.length === 1)\n return value;\n var tree = [];\n var before = parts.shift();\n if (before)\n tree.push(before);\n getElements(parts).forEach(function (_a, realIndex) {\n var key = _a[0], children = _a[1], after = _a[2];\n var element = elements[key] || React.createElement(Fragment, null);\n tree.push(cloneElement(element, { key: realIndex }, children ? formatElements(children, elements) : element.props.children));\n if (after)\n tree.push(after);\n });\n return tree;\n}\n","import { useMemo } from 'react';\nimport useTranslation from './useTranslation';\nimport formatElements from './formatElements';\nexport default function Trans(_a) {\n var i18nKey = _a.i18nKey, values = _a.values, components = _a.components, fallback = _a.fallback, defaultTrans = _a.defaultTrans, ns = _a.ns;\n var _b = useTranslation(ns), t = _b.t, lang = _b.lang;\n var result = useMemo(function () {\n var text = t(i18nKey, values, { fallback: fallback, default: defaultTrans });\n if (!components || components.length === 0)\n return text;\n return formatElements(text, components);\n }, [i18nKey, values, components, lang]);\n return result;\n}\n","import React from 'react';\n\nimport styles from './ContentContainer.module.scss';\n\ntype Props = {\n children: React.ReactNode;\n};\n\nconst ContentContainer: React.FC<Props> = ({ children }) => {\n return <div className={styles.container}>{children}</div>;\n};\n\nexport default ContentContainer;\n","import React from 'react';\n\nimport classNames from 'classnames';\nimport Trans from 'next-translate/Trans';\nimport useTranslation from 'next-translate/useTranslation';\n\nimport styles from './LessonsList.module.scss';\n\nimport Card, { CardSize } from '@/dls/Card/Card';\nimport Link, { LinkVariant } from '@/dls/Link/Link';\nimport Pill from '@/dls/Pill';\nimport { Course } from '@/types/auth/Course';\nimport { logButtonClick } from '@/utils/eventLogger';\nimport {\n getCoursesNavigationUrl,\n getCourseNavigationUrl,\n getLessonNavigationUrl,\n} from '@/utils/navigation';\n\ntype Props = {\n courses: Course[];\n isMyCourses: boolean;\n};\n\nconst MIN_COURSES_COUNT = 6;\n\nconst CoursesList: React.FC<Props> = ({ courses, isMyCourses }) => {\n const { t } = useTranslation('learn');\n const onMyCourses = () => {\n logButtonClick('user_no_courses_link');\n };\n\n const onAllCoursesClicked = () => {\n logButtonClick('all_courses_link');\n };\n\n // if the user has no courses, show a message\n if (isMyCourses && courses.length === 0) {\n return (\n <span>\n <Trans\n i18nKey=\"learn:empty-learning-plans\"\n components={{\n link: (\n <Link\n onClick={onMyCourses}\n key={0}\n href={getCoursesNavigationUrl()}\n variant={LinkVariant.Blend}\n />\n ),\n }}\n />\n </span>\n );\n }\n\n let comingSoonCourses = [];\n // if we should put a coming soon placeholder\n if (!isMyCourses && courses.length < MIN_COURSES_COUNT) {\n // just fill the array with 0s\n comingSoonCourses = new Array(MIN_COURSES_COUNT - courses.length).fill(0);\n }\n\n return (\n <div>\n <div className={styles.container}>\n {courses.map((course) => {\n const { slug, id, continueFromLesson, title, isCompleted, thumbnail } = course;\n const navigateTo = continueFromLesson\n ? getLessonNavigationUrl(slug, continueFromLesson)\n : getCourseNavigationUrl(slug);\n return (\n <Link key={id} href={navigateTo}>\n <Card\n shouldShowFullTitle\n imgSrc={thumbnail}\n title={\n <div className={styles.titleContainer}>\n {title}\n {isCompleted ? <Pill>{t('completed')}</Pill> : ''}\n </div>\n }\n imgAlt={title}\n size={CardSize.Large}\n className={classNames(styles.cardContainer, styles.comingSoonContainer)}\n />\n </Link>\n );\n })}\n {/* eslint-disable-next-line @typescript-eslint/naming-convention */}\n {comingSoonCourses.map((_, i) => {\n return (\n <Card\n // eslint-disable-next-line react/no-array-index-key\n key={i}\n imgSrc=\"https://images.quran.com/coming-soon.png\"\n size={CardSize.Large}\n className={classNames(styles.cardContainer, styles.comingSoonContainer)}\n title={t('coming-soon')}\n />\n );\n })}\n </div>\n {isMyCourses && (\n <div className={styles.allCourses}>\n <Link\n variant={LinkVariant.Highlight}\n onClick={onAllCoursesClicked}\n href={getCoursesNavigationUrl()}\n >\n {t('all-learning-plans')}\n </Link>\n </div>\n )}\n </div>\n );\n};\n\nexport default CoursesList;\n","/* eslint-disable react/no-multi-comp */\nimport classNames from 'classnames';\nimport Trans from 'next-translate/Trans';\nimport useTranslation from 'next-translate/useTranslation';\n\nimport styles from './CoursesPageLayout.module.scss';\n\nimport ContentContainer from '@/components/Course/ContentContainer';\nimport CoursesList from '@/components/Course/CoursesList';\nimport DataFetcher from '@/components/DataFetcher';\nimport Spinner from '@/dls/Spinner/Spinner';\nimport layoutStyles from '@/pages/index.module.scss';\nimport { CoursesResponse } from '@/types/auth/Course';\nimport { privateFetcher } from '@/utils/auth/api';\nimport { makeGetCoursesUrl } from '@/utils/auth/apiPaths';\n\nconst Loading = () => <Spinner />;\n\ntype Props = {\n isMyCourses?: boolean;\n};\n\nconst CoursesPageLayout: React.FC<Props> = ({ isMyCourses = false }) => {\n const { t } = useTranslation('learn');\n return (\n <div className={layoutStyles.pageContainer}>\n <ContentContainer>\n <p className={styles.title}>\n {isMyCourses ? t('common:my-learning-plans') : t('common:learning-plans')}\n </p>\n {!isMyCourses && (\n <div className={styles.desc}>\n <Trans\n i18nKey=\"learn:learning-plans-desc\"\n components={{\n br: <br key={0} />,\n }}\n />\n </div>\n )}\n\n <div className={classNames(layoutStyles.flow, styles.container)}>\n <DataFetcher\n loading={Loading}\n fetcher={privateFetcher}\n queryKey={makeGetCoursesUrl({ myCourses: isMyCourses })}\n render={(data: CoursesResponse) => (\n <CoursesList courses={data.data} isMyCourses={isMyCourses} />\n )}\n />\n </div>\n </ContentContainer>\n </div>\n );\n};\n\nexport default CoursesPageLayout;\n","import React, { memo } from 'react';\n\nimport useSWRImmutable from 'swr/immutable';\n\nimport Error from '@/components/Error';\nimport Spinner from '@/dls/Spinner/Spinner';\nimport { fetcher } from 'src/api';\nimport { BaseResponse } from 'types/ApiResponses';\n\ninterface Props {\n queryKey: string;\n render: (data: BaseResponse) => JSX.Element;\n renderError?: (error: any) => JSX.Element | undefined;\n initialData?: BaseResponse;\n loading?: () => JSX.Element;\n fetcher?: (queryKey: string) => Promise<BaseResponse>;\n showSpinnerOnRevalidate?: boolean;\n onFetchSuccess?: (data: BaseResponse) => void;\n}\n\n/**\n * Data fetcher is a dynamic component that serves as a container for a component\n * that depends on data from a remote API to render. This component handles:\n * 1. Calling the API.\n * 2. Caching the response (due to using useSwr).\n * 3. Handling errors if any by showing an error message.\n * 4. Handling when the user is offline while trying to fetch the API response.\n * 5. Dynamically passing the response data through render-props to the parent.\n *\n * @param {Props} props\n * @returns {JSX.Element}\n */\nconst DataFetcher: React.FC<Props> = ({\n queryKey,\n render,\n renderError,\n initialData,\n loading = () => <Spinner />,\n fetcher: dataFetcher = fetcher,\n showSpinnerOnRevalidate = true,\n onFetchSuccess,\n}: Props): JSX.Element => {\n const { data, error, isValidating, mutate } = useSWRImmutable(\n queryKey,\n () =>\n dataFetcher(queryKey)\n .then((res) => {\n onFetchSuccess?.(res);\n return Promise.resolve(res);\n })\n .catch((err) => Promise.reject(err)),\n {\n fallbackData: initialData,\n },\n );\n\n // if showSpinnerOnRevalidate is true, we should show the spinner if we are revalidating the data.\n // otherwise, we should only show the spinner on initial loads.\n if (showSpinnerOnRevalidate ? isValidating : isValidating && !data) {\n return loading();\n }\n\n const onRetryClicked = () => {\n mutate();\n };\n\n /**\n * if we haven't fetched the data yet and the device is not online (because we don't want to show an offline message if the data already exists).\n * or if we had an error when calling the API.\n */\n if (error) {\n // if there is a custom error renderer, use it.\n if (renderError) {\n const errorComponent = renderError(error);\n // if the custom error renderer returns false, it means that it doesn't want to render anything special.\n if (typeof errorComponent !== 'undefined') {\n return errorComponent;\n }\n }\n return <Error onRetryClicked={onRetryClicked} error={error} />;\n }\n\n return render(data);\n};\n\nexport default memo(DataFetcher);\n","var _path;\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nimport * as React from \"react\";\nvar SvgRetry = function SvgRetry(props) {\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 15,\n height: 15,\n viewBox: \"0 0 15 15\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, props), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1.85 7.5c0-2.835 2.21-5.65 5.65-5.65 2.778 0 4.152 2.056 4.737 3.15H10.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-1 0v1.813C12.296 3.071 10.666.85 7.5.85 3.437.85.85 4.185.85 7.5c0 3.315 2.587 6.65 6.65 6.65 1.944 0 3.562-.77 4.714-1.942a6.77 6.77 0 0 0 1.428-2.167.5.5 0 1 0-.925-.38 5.77 5.77 0 0 1-1.216 1.846c-.971.99-2.336 1.643-4.001 1.643-3.44 0-5.65-2.815-5.65-5.65Z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n })));\n};\nexport default SvgRetry;","import React from 'react';\n\nimport useTranslation from 'next-translate/useTranslation';\n\nimport styles from './Error.module.scss';\n\nimport Button, { ButtonSize, ButtonType } from '@/dls/Button/Button';\nimport RetryIcon from '@/icons/retry.svg';\nimport { OFFLINE_ERROR } from 'src/api';\n\ninterface Props {\n onRetryClicked: () => void;\n error: Error;\n}\n\nconst Error: React.FC<Props> = ({ onRetryClicked, error }) => {\n const { t } = useTranslation('common');\n return (\n <div className={styles.container}>\n <p className={styles.text}>\n {error.message !== OFFLINE_ERROR ? t('error.general') : t('error.offline')}\n </p>\n <Button\n prefix={<RetryIcon />}\n size={ButtonSize.Small}\n type={ButtonType.Secondary}\n onClick={onRetryClicked}\n >\n {t('retry')}\n </Button>\n </div>\n );\n};\n\nexport default Error;\n","import React from 'react';\n\nimport { NextSeo } from 'next-seo';\n\nimport { SEOProps } from '@/utils/seo';\nimport { truncateString } from '@/utils/string';\n\ninterface Props extends SEOProps {\n url?: string;\n image?: string;\n imageAlt?: string;\n imageWidth?: number;\n imageHeight?: number;\n}\n\nconst NextSeoWrapper: React.FC<Props> = (props) => {\n const { url, image, imageAlt, imageHeight, imageWidth, openGraph, description, ...rest } = props;\n const openGraphParams = {\n ...(openGraph && { openGraph }),\n ...(url && { url }),\n ...(image && {\n images: [{ url: image, width: imageWidth, height: imageHeight, alt: imageAlt }],\n }),\n };\n const params = {\n ...rest,\n ...(description && { description: truncateString(description, 150) }),\n };\n return <NextSeo {...params} openGraph={openGraphParams} />;\n};\n\nexport default NextSeoWrapper;\n","import { ReactNode } from 'react';\n\nimport classNames from 'classnames';\nimport Image from 'next/image';\n\nimport styles from './Card.module.scss';\n\nimport Button, { ButtonVariant } from '@/dls/Button/Button';\n\nexport enum CardSize {\n Medium = 'medium',\n Large = 'large',\n}\n\ntype CardProps = {\n size: CardSize;\n title: React.ReactNode;\n description?: React.ReactNode;\n onImgClick?: () => void;\n imgSrc?: string;\n className?: string;\n imgAlt?: string;\n actionIcon?: ReactNode;\n shouldFlipIconOnRTL?: boolean;\n onActionIconClick?: () => void;\n shouldShowFullTitle?: boolean;\n ariaLabel?: string;\n tooltip?: string;\n};\n\nconst Card = ({\n size,\n title,\n description,\n onImgClick,\n imgSrc,\n actionIcon,\n imgAlt,\n shouldFlipIconOnRTL = true,\n onActionIconClick,\n className,\n shouldShowFullTitle = false,\n ariaLabel,\n tooltip,\n}: CardProps) => {\n return (\n <div\n className={classNames(className, styles.container, {\n [styles.large]: size === CardSize.Large,\n [styles.medium]: size === CardSize.Medium,\n })}\n >\n <div\n className={classNames(styles.imageContainer)}\n role=\"button\"\n tabIndex={0}\n onKeyPress={onImgClick}\n onClick={onImgClick}\n >\n {imgSrc && <Image alt={imgAlt} className={styles.img} src={imgSrc} layout=\"fill\" />}\n\n {actionIcon && (\n <div className={styles.cardHoverEffectContainer} data-theme=\"dark\">\n {actionIcon}\n </div>\n )}\n </div>\n <div className={styles.bodyContainer}>\n <div className={styles.textsContainer}>\n <div\n className={classNames({\n [styles.title]: !shouldShowFullTitle,\n })}\n >\n {title}\n </div>\n <div className={styles.description}>{description}</div>\n </div>\n {size === CardSize.Large && actionIcon && (\n <Button\n onClick={() => {\n if (onActionIconClick) onActionIconClick();\n }}\n className={styles.playIconContainer}\n variant={ButtonVariant.Ghost}\n shouldFlipOnRTL={shouldFlipIconOnRTL}\n tooltip={tooltip}\n ariaLabel={ariaLabel}\n >\n {actionIcon}\n </Button>\n )}\n </div>\n </div>\n );\n};\n\nexport default Card;\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport styles from './Pill.module.scss';\n\nexport enum PillSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n}\n\ntype Props = {\n children: React.ReactNode;\n size?: PillSize;\n};\n\nconst Pill: React.FC<Props> = ({ children, size = PillSize.MEDIUM }) => {\n return (\n <div\n className={classNames(styles.container, {\n [styles.medium]: size === PillSize.MEDIUM,\n [styles.small]: size === PillSize.SMALL,\n })}\n >\n {children}\n </div>\n );\n};\n\nexport default Pill;\n","/**\n * Shorten a text by setting the maximum number of characters\n * by the value of the parameter and adding \"...\" at the end.\n *\n * @param {string} rawString\n * @param {number} length\n * @param {string} suffix\n * @returns {string}\n */\nexport const truncateString = (rawString: string, length: number, suffix = '...'): string => {\n const characters = rawString.split('', length);\n let shortenedText = '';\n for (let index = 0; index < characters.length; index += 1) {\n const character = characters[index];\n if (shortenedText.length === length - 1) {\n shortenedText = `${shortenedText}${character}${suffix}`;\n break;\n }\n shortenedText = `${shortenedText}${character}`;\n }\n return shortenedText;\n};\n\n/**\n * Strip HTML tags from a string.\n *\n * @param {string} rawString\n * @returns {string}\n */\nexport const stripHTMLTags = (rawString: string): string => rawString.replace(/(<([^>]+)>)/gi, '');\n\n/**\n * Convert a slugified collection id to collection id only after\n * removing the slug.\n *\n * @param {string} slugifiedCollectionId\n * @returns {string}\n */\nexport const slugifiedCollectionIdToCollectionId = (slugifiedCollectionId: string): string => {\n if (!slugifiedCollectionId) {\n return '';\n }\n const splits = slugifiedCollectionId.split('-');\n // if there is no slug in the url (collections with a name that cannot be slugified e.g. emoticons)\n if (splits.length === 1) {\n return splits[0];\n }\n return splits[splits.length - 1];\n};\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"ContentContainer_container__s7dX2\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"LessonsList_container__sQhlU\",\"cardContainer\":\"LessonsList_cardContainer__L1414\",\"allCourses\":\"LessonsList_allCourses__zqklC\",\"titleContainer\":\"LessonsList_titleContainer__HsM17\",\"comingSoonContainer\":\"LessonsList_comingSoonContainer__kFoW6\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"CoursesPageLayout_container__nif3j\",\"title\":\"CoursesPageLayout_title__romC1\",\"desc\":\"CoursesPageLayout_desc__p5Z4C\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"Error_container__1m9XV\",\"text\":\"Error_text__yg4kD\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"Card_container__7W1p2\",\"large\":\"Card_large__7cD4G\",\"medium\":\"Card_medium__WKx2o\",\"imageContainer\":\"Card_imageContainer__QDTmv\",\"bodyContainer\":\"Card_bodyContainer__RLoL2\",\"textsContainer\":\"Card_textsContainer__Qfmez\",\"title\":\"Card_title__1EtMk\",\"description\":\"Card_description__fNtqy\",\"img\":\"Card_img__ahjCx\",\"cardHoverEffectContainer\":\"Card_cardHoverEffectContainer__N5U8L\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"Pill_container__FoIEg\",\"small\":\"Pill_small__zCILo\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"pageContainer\":\"index_pageContainer__Pxtn3\",\"loadingContainer\":\"index_loadingContainer__WEZFc\",\"flow\":\"index_flow__rCTR5\",\"flowItem\":\"index_flowItem__GnXWz\",\"additionalVerticalGap\":\"index_additionalVerticalGap__nzYz6\",\"fullWidth\":\"index_fullWidth__1n4ux\"};"],"names":["tagRe","nlRe","getElements","parts","length","_a","slice","paired","children","unpaired","concat","formatElements","value","elements","replace","split","tree","before","shift","push","forEach","realIndex","key","after","element","Fragment","cloneElement","props","Trans","i18nKey","values","components","fallback","defaultTrans","ns","_b","useTranslation","t","lang","useMemo","text","default","div","className","styles","courses","isMyCourses","span","link","Link","onClick","logButtonClick","href","getCoursesNavigationUrl","variant","LinkVariant","comingSoonCourses","Array","fill","map","course","slug","id","continueFromLesson","title","isCompleted","thumbnail","navigateTo","getLessonNavigationUrl","getCourseNavigationUrl","Card","shouldShowFullTitle","imgSrc","Pill","imgAlt","size","CardSize","classNames","_","i","Loading","Spinner","layoutStyles","ContentContainer","p","br","DataFetcher","loading","fetcher","privateFetcher","queryKey","makeGetCoursesUrl","myCourses","render","data","CoursesList","renderError","initialData","dataFetcher","showSpinnerOnRevalidate","onFetchSuccess","useSWRImmutable","then","res","Promise","resolve","catch","err","reject","fallbackData","error","isValidating","mutate","errorComponent","Error","onRetryClicked","memo","_path","_extends","Object","assign","bind","n","e","arguments","r","hasOwnProperty","call","apply","width","height","viewBox","xmlns","d","fillRule","clipRule","message","OFFLINE_ERROR","Button","prefix","RetryIcon","ButtonSize","type","ButtonType","url","image","imageAlt","imageHeight","imageWidth","openGraph","description","rest","openGraphParams","images","alt","params","truncateString","NextSeo","onImgClick","actionIcon","shouldFlipIconOnRTL","onActionIconClick","ariaLabel","tooltip","Large","Medium","role","tabIndex","onKeyPress","Image","src","layout","data-theme","ButtonVariant","shouldFlipOnRTL","PillSize","MEDIUM","SMALL","rawString","suffix","characters","shortenedText","index","character","stripHTMLTags","slugifiedCollectionIdToCollectionId","slugifiedCollectionId","splits","module","exports"],"sourceRoot":""}