1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175 |
- exports.id = 57933;
- exports.ids = [57933];
- exports.modules = {
- /***/ 62182:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var map = {
- "./ar.json": [
- 70017,
- 70017
- ],
- "./bn.json": [
- 94149,
- 94149
- ],
- "./en.json": [
- 69029,
- 69029
- ],
- "./fa.json": [
- 53557,
- 53557
- ],
- "./fr.json": [
- 10229,
- 10229
- ],
- "./id.json": [
- 46833,
- 46833
- ],
- "./it.json": [
- 23577,
- 23577
- ],
- "./ms.json": [
- 21492,
- 21492
- ],
- "./nl.json": [
- 53802,
- 53802
- ],
- "./pt.json": [
- 74105,
- 74105
- ],
- "./ru.json": [
- 92390,
- 92390
- ],
- "./sq.json": [
- 72413,
- 72413
- ],
- "./th.json": [
- 6383,
- 6383
- ],
- "./tr.json": [
- 81115,
- 81115
- ],
- "./ur.json": [
- 92246,
- 92246
- ],
- "./zh.json": [
- 71119,
- 71119
- ]
- };
- function webpackAsyncContext(req) {
- if(!__webpack_require__.o(map, req)) {
- return Promise.resolve().then(() => {
- var e = new Error("Cannot find module '" + req + "'");
- e.code = 'MODULE_NOT_FOUND';
- throw e;
- });
- }
- var ids = map[req], id = ids[0];
- return __webpack_require__.e(ids[1]).then(() => {
- return __webpack_require__.t(id, 3 | 16);
- });
- }
- webpackAsyncContext.keys = () => (Object.keys(map));
- webpackAsyncContext.id = 62182;
- module.exports = webpackAsyncContext;
- /***/ }),
- /***/ 92684:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "BP": () => (/* binding */ getSearchResults),
- /* harmony export */ "Bz": () => (/* binding */ getAvailableLanguages),
- /* harmony export */ "Fp": () => (/* binding */ getHizbVerses),
- /* harmony export */ "H4": () => (/* binding */ getNewSearchResults),
- /* harmony export */ "IP": () => (/* binding */ getPagesLookup),
- /* harmony export */ "LE": () => (/* binding */ getRubVerses),
- /* harmony export */ "U0": () => (/* binding */ getChapterIdBySlug),
- /* harmony export */ "_i": () => (/* binding */ fetcher),
- /* harmony export */ "ei": () => (/* binding */ getFootnote),
- /* harmony export */ "iw": () => (/* binding */ getPageVerses),
- /* harmony export */ "ix": () => (/* binding */ getChapterVerses),
- /* harmony export */ "lt": () => (/* binding */ getChapterAudioData),
- /* harmony export */ "m0": () => (/* binding */ getJuzVerses),
- /* harmony export */ "tS": () => (/* binding */ getAvailableReciters),
- /* harmony export */ "vp": () => (/* binding */ getRangeVerses),
- /* harmony export */ "yH": () => (/* binding */ OFFLINE_ERROR),
- /* harmony export */ "yZ": () => (/* binding */ getAvailableTranslations),
- /* harmony export */ "zg": () => (/* binding */ getChapterInfo),
- /* harmony export */ "zm": () => (/* binding */ getReciterData)
- /* harmony export */ });
- /* unused harmony exports SEARCH_FETCH_OPTIONS, getAvailableWordByWordTranslations, getVerseTimestamps, getTranslationsInfo, getAdvancedCopyRawResult, getTafsirs, getChapter, getTafsirContent */
- /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59606);
- /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(humps__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(46127);
- /* eslint-disable max-lines */
- const SEARCH_FETCH_OPTIONS = {
- headers: {
- // eslint-disable-next-line @typescript-eslint/naming-convention
- "x-api-key": process.env.NEXT_PUBLIC_SEARCH_API_KEY
- }
- };
- const OFFLINE_ERROR = "OFFLINE";
- const fetcher = async function fetcher(input, init) {
- // if the user is not online when making the API call
- if (false) {}
- const res = await fetch(input, init);
- if (!res.ok || res.status === 500 || res.status === 404) {
- throw res;
- }
- const json = await res.json();
- return (0,humps__WEBPACK_IMPORTED_MODULE_0__.camelizeKeys)(json);
- };
- const getChapterVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeVersesUrl */ .ML)(id, locale, params));
- const getRangeVerses = async (locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeByRangeVersesUrl */ .Eo)(locale, params));
- /**
- * Get the current available translations with the name translated in the current language.
- *
- * @param {string} language we use this to get translated names of authors in specific the current language.
- *
- * @returns {Promise<TranslationsResponse>}
- */ const getAvailableTranslations = async (language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeTranslationsUrl */ .c7)(language));
- /**
- * Get the current available wbw translations with the name translated in the current language.
- *
- * @param {string} language we use this to get translated names of authors in specific the current language.
- *
- * @returns {Promise<WordByWordTranslationsResponse>}
- */ const getAvailableWordByWordTranslations = async (language)=>fetcher(makeWordByWordTranslationsUrl(language));
- /**
- * Get the current available languages with the name translated in the current language.
- *
- * @param {string} language we use this to get language names in specific the current language.
- *
- * @returns {Promise<LanguagesResponse>}
- */ const getAvailableLanguages = async (language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeLanguagesUrl */ .G1)(language));
- /**
- * Get list of available reciters.
- *
- * @param {string} locale the locale.
- *
- * @returns {Promise<RecitersResponse>}
- */ const getAvailableReciters = async (locale, fields)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeAvailableRecitersUrl */ .jL)(locale, fields));
- const getReciterData = async (reciterId, locale)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeReciterUrl */ .Sn)(reciterId, locale));
- /**
- * Get audio file for a specific reciter and chapter.
- * additionally you can pass `segment: true` to get the timestamps
- * for each verse and words
- *
- * @param {number} reciterId
- * @param {number} chapter the id of the chapter
- */ const getChapterAudioData = async (reciterId, chapter, segments = false)=>{
- const res = await fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeChapterAudioDataUrl */ .$6)(reciterId, chapter, segments));
- if (res.error) {
- throw new Error(res.error);
- }
- if (res.status === 500) {
- throw new Error("server error: fail to get audio file");
- }
- const { audioFiles: audioData } = res;
- const [firstAudio] = audioData;
- if (!firstAudio) {
- throw new Error("No audio file found");
- }
- return {
- ...firstAudio,
- reciterId
- };
- };
- /**
- * Get the timestamps for a specific verseKey.
- * We need this to select to move the cursor in the audio player when we click "play" in a specific verse.
- *
- * @param {number} reciterId
- * @param {number} verseKey example "1:1", meaning chapter 1, verse 1
- * @returns {Promise<AudioTimestampsResponse>}
- */ const getVerseTimestamps = async (reciterId, verseKey)=>fetcher(makeAudioTimestampsUrl(reciterId, verseKey));
- /**
- * Get the information of translations by their IDs.
- *
- * @param {string} locale the current user locale.
- * @param {number[]} translations the ids of the translations selected.
- * @returns {Promise<TranslationsResponse>}
- */ const getTranslationsInfo = async (locale, translations)=>fetcher(makeTranslationsInfoUrl(locale, translations));
- /**
- * Get the advanced copy content that will be copied to clipboard and put in a file.
- *
- * @param {AdvancedCopyRequest} params
- * @returns {Promise<AdvancedCopyRawResultResponse>}
- */ const getAdvancedCopyRawResult = async (params)=>fetcher(makeAdvancedCopyUrl(params));
- /**
- * Get the search results of a query.
- *
- * @param {SearchRequest} params
- * @returns {Promise<SearchResponse>}
- */ const getSearchResults = async (params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeSearchResultsUrl */ ["do"])(params));
- /**
- * Get the search results of a query.
- *
- * @param {SearchRequestParams} params
- * @returns {Promise<NewSearchResponse>}
- */ const getNewSearchResults = async (params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeNewSearchResultsUrl */ .UC)(params), SEARCH_FETCH_OPTIONS);
- /**
- * Get the list of tafsirs.
- *
- * @param {string} language
- * @returns {Promise<TafsirsResponse>}
- */ const getTafsirs = async (language)=>fetcher(makeTafsirsUrl(language));
- /**
- * Get a chapter's info
- *
- * @param {string} chapterId
- * @param {string} language
- * @returns {Promise<ChapterInfoResponse>}
- */ const getChapterInfo = async (chapterId, language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeChapterInfoUrl */ .Iq)(chapterId, language));
- /**
- * Get a chapter's.
- *
- * @param {string} chapterIdOrSlug
- * @param {string} language
- * @returns {Promise<ChapterInfoResponse>}
- */ const getChapter = async (chapterIdOrSlug, language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeChapterUrl */ .ME)(chapterIdOrSlug, language));
- /**
- * Get the verses of a specific Juz.
- *
- * @param {string} id the ID of the Juz.
- * @param {string} locale the locale.
- * @param {string} params the params that we might need to include that differs from the default ones.
- *
- * @returns {Promise<VersesResponse>}
- */ const getJuzVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeJuzVersesUrl */ .IC)(id, locale, params));
- /**
- * Get the verses of a specific Rub El Hizb.
- *
- * @param {string} id the ID of the Rub El Hizb.
- * @param {string} locale the locale.
- * @param {string} params the params that we might need to include that differs from the default ones.
- *
- * @returns {Promise<VersesResponse>}
- */ const getRubVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeRubVersesUrl */ .Im)(id, locale, params));
- /**
- * Get the verses of a specific Hizb.
- *
- * @param {string} id the ID of the Hizb.
- * @param {string} locale the locale.
- * @param {string} params the params that we might need to include that differs from the default ones.
- *
- * @returns {Promise<VersesResponse>}
- */ const getHizbVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeHizbVersesUrl */ .Y8)(id, locale, params));
- /**
- * Get the verses of a specific page.
- *
- * @param {string} id the ID of the page.
- * @param {string} locale the locale.
- * @param {string} params the params that we might need to include that differs from the default ones.
- *
- * @returns {Promise<VersesResponse>}
- */ const getPageVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makePageVersesUrl */ .K2)(id, locale, params));
- /**
- * Get the footnote details.
- *
- * @param {string} footnoteId the ID of the footnote.
- *
- * @returns {Promise<FootnoteResponse>}
- */ const getFootnote = async (footnoteId)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeFootnoteUrl */ .OT)(footnoteId));
- /**
- * Get the footnote details.
- *
- * @param {PagesLookUpRequest} params
- *
- * @returns {Promise<PagesLookUpResponse>}
- */ const getPagesLookup = async (params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makePagesLookupUrl */ .I$)(params));
- /**
- * Get the chapter id by a slug.
- *
- * @param {string} slug
- * @param {string} locale
- * @returns {Promise<false|string>}
- */ const getChapterIdBySlug = async (slug, locale)=>{
- try {
- const chapterResponse = await getChapter(encodeURI(slug), locale);
- return chapterResponse.chapter.id;
- } catch (error) {
- return false;
- }
- };
- /**
- * Get the Tafsir content of a verse by the tafsir ID.
- *
- * @param {string} tafsirIdOrSlug
- * @param {string} verseKey
- * @param {QuranFont} quranFont
- * @param {MushafLines} mushafLines
- * @returns {Promise<TafsirContentResponse>}
- */ const getTafsirContent = (tafsirIdOrSlug, verseKey, quranFont, mushafLines, locale)=>{
- return fetcher(makeTafsirContentUrl(tafsirIdOrSlug, verseKey, {
- lang: locale,
- quranFont,
- mushafLines
- }));
- };
- /***/ }),
- /***/ 92099:
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "analytics": () => (/* binding */ analytics),
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
- /* harmony export */ "isFirebaseEnabled": () => (/* binding */ isFirebaseEnabled)
- /* harmony export */ });
- /* harmony import */ var firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33773);
- /* harmony import */ var firebase_compat_analytics__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88813);
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__, firebase_compat_analytics__WEBPACK_IMPORTED_MODULE_1__]);
- ([firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__, firebase_compat_analytics__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
- const firebaseConfig = {
- apiKey: process.env.NEXT_PUBLIC_FS_API_KEY,
- authDomain: process.env.NEXT_PUBLIC_FS_AUTH_DOMAIN,
- projectId: process.env.NEXT_PUBLIC_FS_PROJECT_ID,
- storageBucket: process.env.NEXT_PUBLIC_FS_STORAGE_BUCKET,
- messagingSenderId: process.env.NEXT_PUBLIC_FS_MESSAGING_SENDER_ID,
- appId: process.env.NEXT_PUBLIC_FS_APP_ID,
- measurementId: process.env.NEXT_PUBLIC_FS_MEASUREMENT_ID
- };
- const isFirebaseEnabled = false && 0;
- if (!firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"].apps.length) {
- firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"].initializeApp(firebaseConfig);
- }
- const analytics = ()=>{
- if (isFirebaseEnabled) {
- return firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"].analytics();
- }
- return null;
- };
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"]);
- __webpack_async_result__();
- } catch(e) { __webpack_async_result__(e); } });
- /***/ }),
- /***/ 11854:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "YS": () => (/* binding */ DEFAULT_RECITER),
- /* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__),
- /* harmony export */ "hw": () => (/* binding */ DEFAULT_XSTATE_INITIAL_STATE),
- /* harmony export */ "j7": () => (/* binding */ DEFAULT_TAFSIRS)
- /* harmony export */ });
- /* unused harmony export DEFAULT_TRANSLATIONS */
- /* harmony import */ var _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61243);
- /* harmony import */ var _redux_types_ThemeType__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79265);
- /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50467);
- // Tafsir Ibn Kathir in English
- const DEFAULT_TAFSIRS = [
- "en-tafisr-ibn-kathir"
- ];
- const DEFAULT_RECITER = {
- id: 7,
- name: "Mishari Rashid al-`Afasy",
- recitationStyle: "Warsh",
- relativePath: "mishaari_raashid_al_3afaasee"
- };
- const TAFSIRS_INITIAL_STATE = {
- selectedTafsirs: DEFAULT_TAFSIRS,
- isUsingDefaultTafsirs: true
- };
- const DEFAULT_TRANSLATIONS = [
- 131
- ]; // Dr. Mustafa Khattab, the Clear Quran
- const TRANSLATIONS_INITIAL_STATE = {
- selectedTranslations: DEFAULT_TRANSLATIONS,
- isUsingDefaultTranslations: true
- };
- const QURAN_READER_STYLES_INITIAL_STATE = {
- // the base sizes in rem
- tafsirFontScale: 3,
- quranTextFontScale: 3,
- translationFontScale: 3,
- wordByWordFontScale: 3,
- quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.MadaniV1 */ .fr.MadaniV1,
- mushafLines: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .MushafLines.SixteenLines */ .AN.SixteenLines,
- isUsingDefaultFont: true
- };
- const DEFAULT_WBW_LOCALE = "en";
- const READING_PREFERENCES_INITIAL_STATE = {
- readingPreference: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .ReadingPreference.Translation */ .m3.Translation,
- selectedWordByWordLocale: DEFAULT_WBW_LOCALE,
- isUsingDefaultWordByWordLocale: true,
- wordByWordContentType: [
- types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .WordByWordType.Translation */ .Oj.Translation
- ],
- wordByWordDisplay: [
- types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .WordByWordDisplay.TOOLTIP */ .PT.TOOLTIP
- ],
- wordClickFunctionality: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .WordClickFunctionality.PlayAudio */ .MB.PlayAudio
- };
- const THEME_INITIAL_STATE = {
- type: _redux_types_ThemeType__WEBPACK_IMPORTED_MODULE_1__/* ["default"].Auto */ .Z.Auto
- };
- const AUDIO_INITIAL_STATE = {
- enableAutoScrolling: true,
- isDownloadingAudio: false,
- showTooltipWhenPlayingAudio: false
- };
- const DEFAULT_XSTATE_INITIAL_STATE = {
- playbackRate: 1,
- reciterId: DEFAULT_RECITER.id,
- volume: 1
- };
- const NOTIFICATIONS_INITIAL_STATE = {
- notifications: [],
- paginatedNotifications: {},
- isFetchingNotifications: false,
- isLoadingNotifications: false,
- unseenCount: 0
- };
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].THEME */ .Z.THEME]: THEME_INITIAL_STATE,
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].READING_PREFERENCES */ .Z.READING_PREFERENCES]: READING_PREFERENCES_INITIAL_STATE,
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].QURAN_READER_STYLES */ .Z.QURAN_READER_STYLES]: QURAN_READER_STYLES_INITIAL_STATE,
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRANSLATIONS */ .Z.TRANSLATIONS]: TRANSLATIONS_INITIAL_STATE,
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TAFSIRS */ .Z.TAFSIRS]: TAFSIRS_INITIAL_STATE,
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].AUDIO_PLAYER_STATE */ .Z.AUDIO_PLAYER_STATE]: AUDIO_INITIAL_STATE,
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].NOTIFICATIONS */ .Z.NOTIFICATIONS]: NOTIFICATIONS_INITIAL_STATE
- });
- /***/ }),
- /***/ 59875:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467);
- const DEFAULT_TAFSIR = "ar-tafseer-al-qurtubi";
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- tafsirs: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs,
- selectedTafsirs: [
- DEFAULT_TAFSIR
- ]
- },
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: []
- },
- readingPreferences: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences,
- readingPreference: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .ReadingPreference.Reading */ .m3.Reading
- }
- });
- /***/ }),
- /***/ 79395:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467);
- const DEFAULT_TRANSLATION = 161; // Taisirul Quran
- const DEFAULT_TAFSIR = "bn-tafsir-ahsanul-bayaan"; // Tafsir Ahsanul Bayaan
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- quranReaderStyles: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].quranReaderStyles */ .ZP.quranReaderStyles,
- quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .QuranFont.IndoPak */ .fr.IndoPak
- },
- readingPreferences: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences,
- selectedWordByWordLocale: "bn"
- },
- tafsirs: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs,
- selectedTafsirs: [
- DEFAULT_TAFSIR
- ]
- },
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 84835:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP);
- /***/ }),
- /***/ 15412:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- const DEFAULT_TRANSLATION = 29; // Hussein Taji
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 30823:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- const DEFAULT_TRANSLATION = 31; // Muhammad Hamidullah
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 41950:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467);
- const DEFAULT_TRANSLATION = 33; // Indonesian Islamic affairs ministry
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- readingPreferences: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences,
- selectedWordByWordLocale: "id"
- },
- quranReaderStyles: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].quranReaderStyles */ .ZP.quranReaderStyles,
- quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .QuranFont.IndoPak */ .fr.IndoPak
- },
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 84443:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- const DEFAULT_TRANSLATION = 153; // Hamza Roberto Piccardo
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 38195:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- const DEFAULT_TRANSLATION = 39; // Abdullah Muhammad Basmeih
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 10024:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- const DEFAULT_TRANSLATION = 144; // Sofian S. Siregar
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 80563:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- const DEFAULT_TRANSLATION = 43; // Samir
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 23269:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- const DEFAULT_TRANSLATION = 45; // Elmir Kuliev
- const DEFAULT_TAFSIR = "ru-tafseer-al-saddi"; // Russian Tafseer Al Saddi
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- },
- tafsirs: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs,
- selectedTafsirs: [
- DEFAULT_TAFSIR
- ]
- }
- });
- /***/ }),
- /***/ 12586:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- const DEFAULT_TRANSLATION = 47; // Albanian
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 43222:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- const DEFAULT_TRANSLATION = 230; // Society of Institutes and Universities
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 79896:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- const DEFAULT_TRANSLATION = 77; // Diyanet
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 80046:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467);
- const DEFAULT_TRANSLATION = 158; // Bayan Ul Quran
- const DEFAULT_TAFSIR = "tafseer-ibn-e-kaseer-urdu"; // Bayan ul Quran
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- quranReaderStyles: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].quranReaderStyles */ .ZP.quranReaderStyles,
- quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .QuranFont.IndoPak */ .fr.IndoPak
- },
- readingPreferences: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences,
- selectedWordByWordLocale: "ur"
- },
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- },
- tafsirs: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs,
- selectedTafsirs: [
- DEFAULT_TAFSIR
- ]
- }
- });
- /***/ }),
- /***/ 5492:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
- const DEFAULT_TRANSLATION = 56; // Ma Jain
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
- translations: {
- ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
- selectedTranslations: [
- DEFAULT_TRANSLATION
- ]
- }
- });
- /***/ }),
- /***/ 17241:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "$t": () => (/* binding */ getNotificationsInitialState),
- /* harmony export */ "Fy": () => (/* binding */ getTafsirsInitialState),
- /* harmony export */ "aq": () => (/* binding */ getAudioPlayerStateInitialState),
- /* harmony export */ "h0": () => (/* binding */ getTranslationsInitialState),
- /* harmony export */ "iF": () => (/* binding */ getLocaleInitialState),
- /* harmony export */ "kq": () => (/* binding */ getQuranReaderStylesInitialState),
- /* harmony export */ "r2": () => (/* binding */ getStoreInitialState),
- /* harmony export */ "wH": () => (/* binding */ getReadingPreferencesInitialState),
- /* harmony export */ "yO": () => (/* binding */ getThemeInitialState)
- /* harmony export */ });
- /* harmony import */ var _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61243);
- /* eslint-disable import/no-dynamic-require */ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable global-require */
- /**
- * Get the initial state of the store.
- *
- * @param {string} locale
- * @returns {RootState}
- */ const getStoreInitialState = (locale)=>{
- return {
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].THEME */ .Z.THEME]: getThemeInitialState(locale),
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].READING_PREFERENCES */ .Z.READING_PREFERENCES]: getReadingPreferencesInitialState(locale),
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].QURAN_READER_STYLES */ .Z.QURAN_READER_STYLES]: getQuranReaderStylesInitialState(locale),
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRANSLATIONS */ .Z.TRANSLATIONS]: getTranslationsInitialState(locale),
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TAFSIRS */ .Z.TAFSIRS]: getTafsirsInitialState(locale),
- // @ts-ignore
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].AUDIO_PLAYER_STATE */ .Z.AUDIO_PLAYER_STATE]: getAudioPlayerStateInitialState(locale),
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].DEFAULT_SETTINGS */ .Z.DEFAULT_SETTINGS]: {
- isUsingDefaultSettings: true
- },
- [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].NOTIFICATIONS */ .Z.NOTIFICATIONS]: getNotificationsInitialState(locale)
- };
- };
- const DEFAULT_LOCALE = "en";
- /**
- * Dynamically load the default settings of the locale passed.
- *
- * @param {string} locale
- * @returns {DefaultSettings}
- */ const importLocaleFile = (locale)=>__webpack_require__(70301)(`./${locale}`).default;
- /**
- * Get specific settings by its key for a locale.
- * e.g. get the settings for theme by the key 'theme'.
- *
- * @param {string} locale
- * @param {string} key
- * @returns {any}
- */ const getLocaleInitialStateByKey = (locale, key)=>importLocaleFile(locale)[key];
- const getLocaleInitialState = (locale)=>importLocaleFile(locale);
- const getThemeInitialState = (locale = DEFAULT_LOCALE)=>{
- return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].THEME */ .Z.THEME);
- };
- const getReadingPreferencesInitialState = (locale = DEFAULT_LOCALE)=>{
- return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].READING_PREFERENCES */ .Z.READING_PREFERENCES);
- };
- const getQuranReaderStylesInitialState = (locale = DEFAULT_LOCALE)=>{
- return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].QURAN_READER_STYLES */ .Z.QURAN_READER_STYLES);
- };
- const getTranslationsInitialState = (locale = DEFAULT_LOCALE)=>{
- return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRANSLATIONS */ .Z.TRANSLATIONS);
- };
- const getTafsirsInitialState = (locale = DEFAULT_LOCALE)=>{
- return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TAFSIRS */ .Z.TAFSIRS);
- };
- const getAudioPlayerStateInitialState = (locale = DEFAULT_LOCALE)=>{
- return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].AUDIO_PLAYER_STATE */ .Z.AUDIO_PLAYER_STATE);
- };
- const getNotificationsInitialState = (locale = DEFAULT_LOCALE)=>{
- return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].NOTIFICATIONS */ .Z.NOTIFICATIONS);
- };
- /***/ }),
- /***/ 85895:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__),
- /* harmony export */ "ag": () => (/* binding */ selectSearchHistory),
- /* harmony export */ "rd": () => (/* binding */ removeSearchHistoryRecord),
- /* harmony export */ "zr": () => (/* binding */ addSearchHistoryRecord)
- /* harmony export */ });
- /* unused harmony export searchSlice */
- /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75184);
- /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61243);
- const initialState = {
- searchHistory: []
- };
- const MAXIMUM_RECENT_SEARCH_QUERIES = 5;
- const searchSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({
- name: _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_1__/* ["default"].SEARCH */ .Z.SEARCH,
- initialState,
- reducers: {
- addSearchHistoryRecord: (state, action)=>{
- let newSearchHistory = [
- ...state.searchHistory
- ];
- const newSearchQuery = action.payload;
- // if we have reached the maximum number of search queries, remove the last element
- if (state.searchHistory.length >= MAXIMUM_RECENT_SEARCH_QUERIES) {
- // splice will mutate newSearchHistory and remove the last element
- newSearchHistory.splice(-1);
- }
- // filter out the old search queries that match the new search queries (if any).
- newSearchHistory = newSearchHistory.filter((currentSearchQuery)=>currentSearchQuery !== newSearchQuery);
- // put the new search query at the beginning of the array
- newSearchHistory = [
- newSearchQuery,
- ...newSearchHistory
- ];
- return {
- ...state,
- searchHistory: newSearchHistory
- };
- },
- removeSearchHistoryRecord: (state, action)=>{
- // filter out the search queries from the current search queries array.
- const newSearchHistory = [
- ...state.searchHistory
- ].filter((currentSearchQuery)=>currentSearchQuery !== action.payload);
- return {
- ...state,
- searchHistory: newSearchHistory
- };
- }
- }
- });
- const { addSearchHistoryRecord , removeSearchHistoryRecord } = searchSlice.actions;
- const selectSearchHistory = (state)=>state.search.searchHistory;
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (searchSlice.reducer);
- /***/ }),
- /***/ 61243:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- var SliceName;
- (function(SliceName) {
- SliceName["THEME"] = "theme";
- SliceName["READING_PREFERENCES"] = "readingPreferences";
- SliceName["QURAN_READER_STYLES"] = "quranReaderStyles";
- SliceName["TRANSLATIONS"] = "translations";
- SliceName["TAFSIRS"] = "tafsirs";
- SliceName["AUDIO_PLAYER_STATE"] = "audioPlayerState";
- SliceName["DEFAULT_SETTINGS"] = "defaultSettings";
- SliceName["BANNER"] = "banner";
- SliceName["NAVBAR"] = "navbar";
- SliceName["SESSION"] = "session";
- SliceName["BOOKMARKS"] = "bookmarks";
- SliceName["VOICE_SEARCH"] = "voiceSearch";
- SliceName["WELCOME_MESSAGE"] = "welcomeMessage";
- SliceName["COMMAND_BAR"] = "commandBar";
- SliceName["CONTEXT_MENU"] = "contextMenu";
- SliceName["FONT_FACES"] = "fontFaces";
- SliceName["NOTES"] = "notes";
- SliceName["READING_TRACKER"] = "readingTracker";
- SliceName["READING_VIEW_HOVERED_VERSE"] = "readingViewHoveredVerse";
- SliceName["SIDEBAR_NAVIGATION"] = "sidebarNavigation";
- SliceName["SEARCH"] = "search";
- SliceName["LOCALE"] = "locale";
- SliceName["USER_DATA_SYNC"] = "userDataSync";
- SliceName["PERSIST_GATE_HYDRATION"] = "persistGateHydration";
- SliceName["REVELATION_ORDER"] = "revelationOrder";
- SliceName["NOTIFICATIONS"] = "notifications";
- SliceName["ONBOARDING"] = "onboarding";
- })(SliceName || (SliceName = {}));
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SliceName);
- /***/ }),
- /***/ 79265:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- var ThemeType;
- (function(ThemeType) {
- ThemeType["Auto"] = "auto";
- ThemeType["Light"] = "light";
- ThemeType["Sepia"] = "sepia";
- ThemeType["Dark"] = "dark";
- })(ThemeType || (ThemeType = {}));
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ThemeType);
- /***/ }),
- /***/ 4917:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "$P": () => (/* binding */ getMushafId),
- /* harmony export */ "H": () => (/* binding */ API_HOST),
- /* harmony export */ "bf": () => (/* binding */ makeUrl),
- /* harmony export */ "gK": () => (/* binding */ ITEMS_PER_PAGE),
- /* harmony export */ "hD": () => (/* binding */ getDefaultWordFields)
- /* harmony export */ });
- /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59606);
- /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(humps__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _qs_stringify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99921);
- /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50467);
- const ITEMS_PER_PAGE = 10;
- const STAGING_API_HOST = "https://staging.quran.com";
- const PRODUCTION_API_HOST = "https://api.qurancdn.com";
- const API_ROOT_PATH = "/api/qdc";
- // env variables in Vercel can't be dynamic, we have to hardcode the urls here. https://stackoverflow.com/questions/44342226/next-js-error-only-absolute-urls-are-supported
- const API_HOST = process.env.NEXT_PUBLIC_VERCEL_ENV === "production" ? PRODUCTION_API_HOST : STAGING_API_HOST;
- /**
- * Generates a url to make an api call to our backend
- *
- * @param {string} path the path for the call
- * @param {Record<string, unknown>} parameters optional query params, {a: 1, b: 2} is parsed to "?a=1&b=2"
- * @returns {string}
- */ const makeUrl = (path, parameters)=>{
- if (!parameters) {
- return `${API_HOST}${API_ROOT_PATH}${path}`;
- }
- const decamelizedParams = (0,humps__WEBPACK_IMPORTED_MODULE_0__.decamelizeKeys)(parameters);
- // The following section parses the query params for convenience
- // E.g. parses {a: 1, b: 2} to "?a=1&b=2"
- const queryParameters = `?${(0,_qs_stringify__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(decamelizedParams)}`;
- return `${API_HOST}${API_ROOT_PATH}${path}${queryParameters}`;
- };
- /**
- * Get the default word fields that should exist in the response.
- * qpc_uthmani_hafs is added so that we can use it as a fallback
- * text for QCF font V1 and V2.
- *
- * @param {QuranFont} quranFont the selected quran font since.
- * @returns {{ wordFields: string}}
- *
- */ const getDefaultWordFields = (quranFont = types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.QPCHafs */ .fr.QPCHafs)=>({
- wordFields: `verse_key,verse_id,page_number,location,text_uthmani,${quranFont}${quranFont === types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.QPCHafs */ .fr.QPCHafs ? "" : `,${types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.QPCHafs */ .fr.QPCHafs}`}`
- });
- /**
- * Get the mushaf id based on the value inside redux (if it's not SSR).
- *
- * @param {QuranFont} quranFont
- * @param {MushafLines} mushafLines
- * @returns {{mushaf: Mushaf}}
- */ const getMushafId = (// eslint-disable-next-line default-param-last
- quranFont = types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.QPCHafs */ .fr.QPCHafs, mushafLines)=>{
- let mushaf = types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFontMushaf */ .ru[quranFont];
- // convert the Indopak mushaf to either 15 or 16 lines Mushaf
- if (quranFont === types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.IndoPak */ .fr.IndoPak && mushafLines) {
- mushaf = mushafLines === types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .MushafLines.FifteenLines */ .AN.FifteenLines ? types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .Mushaf.Indopak15Lines */ .RA.Indopak15Lines : types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .Mushaf.Indopak16Lines */ .RA.Indopak16Lines;
- }
- return {
- mushaf
- };
- };
- /***/ }),
- /***/ 46127:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "$6": () => (/* binding */ makeChapterAudioDataUrl),
- /* harmony export */ "A9": () => (/* binding */ makeTafsirsUrl),
- /* harmony export */ "Eo": () => (/* binding */ makeByRangeVersesUrl),
- /* harmony export */ "G1": () => (/* binding */ makeLanguagesUrl),
- /* harmony export */ "I$": () => (/* binding */ makePagesLookupUrl),
- /* harmony export */ "IC": () => (/* binding */ makeJuzVersesUrl),
- /* harmony export */ "Im": () => (/* binding */ makeRubVersesUrl),
- /* harmony export */ "Iq": () => (/* binding */ makeChapterInfoUrl),
- /* harmony export */ "K2": () => (/* binding */ makePageVersesUrl),
- /* harmony export */ "ME": () => (/* binding */ makeChapterUrl),
- /* harmony export */ "ML": () => (/* binding */ makeVersesUrl),
- /* harmony export */ "OT": () => (/* binding */ makeFootnoteUrl),
- /* harmony export */ "Sn": () => (/* binding */ makeReciterUrl),
- /* harmony export */ "UC": () => (/* binding */ makeNewSearchResultsUrl),
- /* harmony export */ "Wq": () => (/* binding */ makeVersesFilterUrl),
- /* harmony export */ "Wy": () => (/* binding */ makeTafsirContentUrl),
- /* harmony export */ "Y8": () => (/* binding */ makeHizbVersesUrl),
- /* harmony export */ "c7": () => (/* binding */ makeTranslationsUrl),
- /* harmony export */ "do": () => (/* binding */ makeSearchResultsUrl),
- /* harmony export */ "jL": () => (/* binding */ makeAvailableRecitersUrl),
- /* harmony export */ "v2": () => (/* binding */ makeByVerseKeyUrl)
- /* harmony export */ });
- /* unused harmony exports DEFAULT_VERSES_PARAMS, makeWordByWordTranslationsUrl, makeAudioTimestampsUrl, makeTranslationsInfoUrl, makeAdvancedCopyUrl, makeNewSearchApiUrl, makeNavigationSearchUrl, makeDonateUrl, makeDonatePageUrl */
- /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59606);
- /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(humps__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4917);
- /* harmony import */ var _qs_stringify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99921);
- /* harmony import */ var _redux_defaultSettings_defaultSettings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11854);
- /* harmony import */ var _redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17241);
- /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50467);
- const DEFAULT_VERSES_PARAMS = {
- words: true,
- translationFields: "resource_name,language_id",
- perPage: _api__WEBPACK_IMPORTED_MODULE_1__/* .ITEMS_PER_PAGE */ .gK,
- fields: `${types_QuranReader__WEBPACK_IMPORTED_MODULE_5__/* .QuranFont.Uthmani */ .fr.Uthmani},chapter_id,hizb_number,text_imlaei_simple`
- };
- /**
- * Use the default params and allow overriding the default values e.g. translations.
- *
- * @param {string} currentLocale
- * @param {Record<string, unknown>} params
- * @param {boolean} includeTranslationFields
- * @returns {Record<string, unknown>}
- */ const getVersesParams = (currentLocale, params, includeTranslationFields = true)=>{
- const defaultParams = {
- ...DEFAULT_VERSES_PARAMS,
- translations: (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_4__/* .getTranslationsInitialState */ .h0)(currentLocale).selectedTranslations.join(", "),
- reciter: _redux_defaultSettings_defaultSettings__WEBPACK_IMPORTED_MODULE_3__/* .DEFAULT_RECITER.id */ .YS.id,
- wordTranslationLanguage: (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_4__/* .getReadingPreferencesInitialState */ .wH)(currentLocale).selectedWordByWordLocale
- };
- if (!includeTranslationFields) {
- delete defaultParams.translationFields;
- delete defaultParams.translations;
- }
- return {
- ...defaultParams,
- ...params
- };
- };
- const makeVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_chapter/${id}`, getVersesParams(currentLocale, params));
- const makeByRangeVersesUrl = (currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_range`, getVersesParams(currentLocale, params));
- const makeVersesFilterUrl = (params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/filter`, {
- ...params
- });
- /**
- * Compose the url for the translations API.
- *
- * @param {string} language
- * @returns {string}
- */ const makeTranslationsUrl = (language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/resources/translations", {
- language
- });
- /**
- * Compose the url for the wbw translations API.
- *
- * @param {string} language
- * @returns {string}
- */ const makeWordByWordTranslationsUrl = (language)=>makeUrl("/resources/word_by_word_translations", {
- language
- });
- /**
- * Compose the url for the languages API.
- *
- * @param {string} language
- * @returns {string}
- */ const makeLanguagesUrl = (language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/resources/languages", {
- language
- });
- /**
- * Compose the url for reciters API.
- *
- * @param {string} locale the user's language code.
- * @returns {string}
- */ const makeAvailableRecitersUrl = (locale, fields)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/audio/reciters", {
- locale,
- fields
- });
- const makeReciterUrl = (reciterId, locale)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/audio/reciters/${reciterId}`, {
- locale,
- fields: [
- "profile_picture",
- "cover_image",
- "bio"
- ]
- });
- /**
- * Compose the url of the audio file of a surah.
- *
- * @param {number} reciterId id of reciter
- * @param {number} chapter the surah number.
- * @param {boolean} segments include segments info
- *
- * @returns {string}
- */ const makeChapterAudioDataUrl = (reciterId, chapter, segments)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/audio/reciters/${reciterId}/audio_files`, {
- chapter,
- segments
- });
- const makeAudioTimestampsUrl = (reciterId, verseKey)=>makeUrl(`/audio/reciters/${reciterId}/timestamp?verse_key=${verseKey}`);
- /**
- * Compose the url for the translations' filter API.
- *
- * @param {string} locale the user's language code.
- * @param {number[]} translations an array holding the translations' IDs.
- * @returns {string}
- */ const makeTranslationsInfoUrl = (locale, translations)=>makeUrl("/resources/translations/filter", {
- locale,
- translations: translations.join(", ")
- });
- /**
- * Compose the url for the advanced copy API.
- *
- * @param {AdvancedCopyRequest} params the request params.
- * @returns {string}
- */ const makeAdvancedCopyUrl = (params)=>makeUrl("/verses/advanced_copy", params);
- /**
- * Compose the url for search API.
- *
- * @param {SearchRequest} params the request params.
- * @returns {string}
- */ const makeSearchResultsUrl = (params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/search", params);
- const makeNewSearchApiUrl = (params)=>{
- const baseUrl = process.env.NEXT_PUBLIC_SEARCH_BASE_URL;
- return `${baseUrl}/v1/search?${(0,_qs_stringify__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)((0,humps__WEBPACK_IMPORTED_MODULE_0__.decamelizeKeys)(params))}`;
- };
- const makeNewSearchResultsUrl = (params)=>makeNewSearchApiUrl(params);
- /**
- * Compose the url for the navigation search API that is used to show results inside the command bar.
- *
- * @param {string} query the request params.
- * @returns {string}
- */ const makeNavigationSearchUrl = (query)=>makeUrl("/navigate", {
- query
- });
- /**
- * Compose the url for the tafsirs API.
- *
- * @param {string} language the user's language code.
- * @returns {string}
- */ const makeTafsirsUrl = (language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/resources/tafsirs", {
- language
- });
- const makeTafsirContentUrl = (tafsirId, verseKey, options)=>{
- const params = {
- locale: options.lang,
- words: true,
- ...(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .getDefaultWordFields */ .hD)(options.quranFont),
- ...(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .getMushafId */ .$P)(options.quranFont, options.mushafLines)
- };
- return (0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/tafsirs/${tafsirId}/by_ayah/${verseKey}`, params);
- };
- /**
- * Compose the url for the pages look up API.
- *
- * @param {PagesLookUpRequest} params
- * @returns {string}
- */ const makePagesLookupUrl = (params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/pages/lookup", params);
- /**
- * Compose the url for the chapter's info API.
- *
- * @param {string} chapterId the chapter Id.
- * @param {string} language the user's language code.
- * @returns {string}
- */ const makeChapterInfoUrl = (chapterId, language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/chapters/${chapterId}/info`, {
- language
- });
- /**
- * Compose the url for the chapter's API.
- *
- * @param {string} chapterIdOrSlug the chapter Id or the slug.
- * @param {string} language the user's language code.
- * @returns {string}
- */ const makeChapterUrl = (chapterIdOrSlug, language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/chapters/${chapterIdOrSlug}`, {
- language
- });
- /**
- * Compose the url for Juz's verses API.
- *
- * @param {string} id the Id of the juz.
- * @param {string} currentLocale the locale.
- * @param {Record<string, unknown>} params in-case we need to over-ride the default params.
- * @returns {string}
- */ const makeJuzVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_juz/${id}`, getVersesParams(currentLocale, params));
- /**
- * Compose the url for Rub el Hizb's verses API.
- *
- * @param {string} id the Id of the Rub el Hizb.
- * @param {string} currentLocale the locale.
- * @param {Record<string, unknown>} params in-case we need to over-ride the default params.
- * @returns {string}
- */ const makeRubVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_rub_el_hizb/${id}`, getVersesParams(currentLocale, params));
- /**
- * Compose the url for Hizb's verses API.
- *
- * @param {string} id the Id of the hizb.
- * @param {string} currentLocale the locale.
- * @param {Record<string, unknown>} params in-case we need to over-ride the default params.
- * @returns {string}
- */ const makeHizbVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_hizb/${id}`, getVersesParams(currentLocale, params));
- /**
- * Compose the url for by verse key API.
- *
- * @param {string} verseKey the Id of the juz.
- * @param {Record<string, unknown>} params in-case we need to over-ride the default params.
- * @returns {string}
- */ const makeByVerseKeyUrl = (verseKey, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_key/${verseKey}`, params);
- /**
- * Compose the url for page's verses API.
- *
- * @param {string} id the Id of the page.
- * @param {string} currentLocale the locale.
- * @param {Record<string, unknown>} params in-case we need to over-ride the default params.
- * @param {boolean} includeTranslationFields
- * @returns {string}
- */ const makePageVersesUrl = (id, currentLocale, params, includeTranslationFields = true)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_page/${id}`, getVersesParams(currentLocale, params, includeTranslationFields));
- /**
- * Compose the url for footnote's API.
- *
- * @param {string} footnoteId
- * @returns {string}
- */ const makeFootnoteUrl = (footnoteId)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/foot_notes/${footnoteId}`);
- const makeDonateUrl = (showDonationPopup = false)=>`https://donate.quran.foundation${showDonationPopup ? "?showDonationPopup" : ""}`;
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
- const makeDonatePageUrl = (isOnce = true, shouldUseProviderUrl = false)=>{
- if (shouldUseProviderUrl) {
- return `https://give.quran.foundation/give/${isOnce ? 482507 : 474400}/#!/donation/checkout`;
- }
- return makeDonateUrl();
- };
- /***/ }),
- /***/ 95892:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "T4": () => (/* binding */ getAllChaptersData),
- /* harmony export */ "_L": () => (/* binding */ getChapterReadingProgress),
- /* harmony export */ "dy": () => (/* binding */ getChapterData),
- /* harmony export */ "it": () => (/* binding */ getChapterIdsForJuz),
- /* harmony export */ "op": () => (/* binding */ getChapterIdsForPage)
- /* harmony export */ });
- /* unused harmony exports getAllJuzMappings, getChapterAndVerseMappingForJuz, isFirstSurah, isLastSurah, QURAN_CHAPTERS_COUNT, getRandomChapterId */
- /* harmony import */ var lodash_random__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35526);
- /* harmony import */ var lodash_random__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_random__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19303);
- /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable global-require */
- const DEFAULT_LANGUAGE = "en";
- const SUPPORTED_CHAPTER_LOCALES = [
- "en",
- "ar",
- "bn",
- "fr",
- "id",
- "it",
- "nl",
- "ru",
- "tr",
- "ur",
- "zh",
- ];
- /**
- * Get chapters data from the json file, by language
- *
- * @param {string} lang
- * @returns {Promise<Record<string, Chapter>>} chapter
- */ const getAllChaptersData = (lang = DEFAULT_LANGUAGE)=>{
- if (SUPPORTED_CHAPTER_LOCALES.includes(lang)) {
- return new Promise((res)=>{
- __webpack_require__(62182)(`./${lang}.json`).then((data)=>{
- res(data.default);
- });
- });
- }
- return new Promise((res)=>{
- __webpack_require__.e(/* import() */ 69029).then(__webpack_require__.t.bind(__webpack_require__, 69029, 19)).then((data)=>{
- // @ts-ignore
- res(data.default);
- });
- });
- };
- /**
- * Get chapter data by id from the json file
- *
- * @param {ChaptersData} chapters
- * @param {string} id
- * @returns {Chapter} chapter
- */ const getChapterData = (chapters, id)=>chapters[(0,_number__WEBPACK_IMPORTED_MODULE_1__/* .formatStringNumber */ .XK)(id)];
- /**
- * Given a pageId, get chapter ids from a json file
- *
- * @param {string} pageId
- * @returns {Promise<string[]>} chapterIds
- */ const getChapterIdsForPage = (pageId)=>{
- return new Promise((res)=>{
- __webpack_require__.e(/* import() */ 80370).then(__webpack_require__.t.bind(__webpack_require__, 80370, 19)).then((data)=>{
- res(data.default[pageId]);
- });
- });
- };
- /**
- * Given a juzId, get chapters ids from a json file
- *
- * @param {string} juzId
- * @returns {string[]} chapterIds
- */ const getChapterIdsForJuz = async (juzId)=>{
- return new Promise((res)=>{
- __webpack_require__.e(/* import() */ 19535).then(__webpack_require__.t.bind(__webpack_require__, 19535, 19)).then((data)=>{
- res(data.default[juzId]);
- });
- });
- };
- /**
- * get ChapterAndVerseMapping for all juzs
- *
- * @returns {[juz: string]: ChapterAndVerseMapping}
- */ const getAllJuzMappings = ()=>{
- return new Promise((res)=>{
- __webpack_require__.e(/* import() */ 92447).then(__webpack_require__.t.bind(__webpack_require__, 92447, 19)).then((data)=>{
- res(data.default);
- });
- });
- };
- /**
- * Given a juzId get a chapter + verse mapping for this juz
- *
- * @param {string} juzId
- * @returns {[chapter: string]: string}
- *
- * original data source: https://api.quran.com/api/v4/juzs
- *
- * Example:
- * getChapterAndVerseMappingForJuz("1") // { "1": "1-7", "2" : "1-141"}
- * -> juz "1" contains chapter "1" with verse "1-7" and chapter "2" with verse "1-141"
- *
- */ const getChapterAndVerseMappingForJuz = async (juzId)=>{
- const juzVerseMapping = await getAllJuzMappings();
- return juzVerseMapping[juzId];
- };
- /**
- * Whether the current surah is the first surah.
- *
- * @param {number} surahNumber
- * @param {boolean} isReadingByRevelationOrder
- * @returns {boolean}
- */ const isFirstSurah = (surahNumber, isReadingByRevelationOrder)=>{
- if (!isReadingByRevelationOrder) return surahNumber === 1;
- return REVELATION_ORDER[0] === surahNumber;
- };
- /**
- * Whether the current surah is the last surah.
- *
- * @param {number} surahNumber
- * @param {boolean} isReadingByRevelationOrder
- * @returns {boolean}
- */ const isLastSurah = (surahNumber, isReadingByRevelationOrder)=>{
- if (!isReadingByRevelationOrder) return surahNumber === 114;
- return REVELATION_ORDER[REVELATION_ORDER.length - 1] === surahNumber;
- };
- /**
- * Get how much percentage of the chapter has been read.
- *
- * @param {number} currentVerse
- * @param {number} totalNumberOfVerses
- * @returns {number}
- */ const getChapterReadingProgress = (currentVerse, totalNumberOfVerses)=>Math.ceil(currentVerse * 100 / totalNumberOfVerses);
- const QURAN_CHAPTERS_COUNT = 114;
- const getRandomChapterId = ()=>{
- return random(1, QURAN_CHAPTERS_COUNT);
- };
- /***/ }),
- /***/ 55943:
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "An": () => (/* binding */ logCarouselSlideCompletion),
- /* harmony export */ "Dy": () => (/* binding */ logEmptySearchResults),
- /* harmony export */ "Io": () => (/* binding */ logTarteelLinkClick),
- /* harmony export */ "Kz": () => (/* binding */ logEvent),
- /* harmony export */ "MY": () => (/* binding */ logButtonClick),
- /* harmony export */ "Q8": () => (/* binding */ logValueChange),
- /* harmony export */ "dz": () => (/* binding */ logFormSubmission),
- /* harmony export */ "qS": () => (/* binding */ logSearchResults),
- /* harmony export */ "tL": () => (/* binding */ logTextSearchQuery),
- /* harmony export */ "u8": () => (/* binding */ logItemSelectionChange)
- /* harmony export */ });
- /* harmony import */ var _types_SearchType__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73634);
- /* harmony import */ var src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(92099);
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__]);
- src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
- /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/naming-convention */
- /**
- * Filter out empty search queries.
- *
- * @param {string} rawSearchQuery
- * @returns {string}
- */ const getSearchQuery = (rawSearchQuery)=>{
- if (!rawSearchQuery) {
- return "";
- }
- // trim search query so we don't log a query like ' '.
- return rawSearchQuery.trim();
- };
- const logEvent = async (eventName, params)=>{
- if (src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__.isFirebaseEnabled) {
- Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 92099)).then((firebaseModule)=>{
- // eslint-disable-next-line i18next/no-literal-string
- firebaseModule.analytics().logEvent(eventName, params);
- });
- }
- };
- /**
- * Log when a button is clicked.
- *
- * @param {string} buttonName
- */ const logButtonClick = (buttonName, params)=>{
- logEvent(`${buttonName}_clicked`, params);
- };
- /**
- * Log when a form is submitted.
- *
- * @param {string} formName
- */ const logFormSubmission = (formName, params)=>{
- logEvent(`${formName}_form_submitted`, params);
- };
- /**
- * Log when a carousel slide is completed.
- *
- * @param {string} carouselName
- * @param {number|string} slideNumber
- */ const logCarouselSlideCompletion = (carouselName, slideNumber)=>{
- logEvent(`${carouselName}_slide_${slideNumber}_completed`);
- };
- /**
- * Log when a value changes.
- *
- * @param {string} name
- * @param {string | boolean | number | string[] | number[] | Record<string, string>} currentValue
- * @param {string | boolean | number | string[] | number[] | Record<string, string>} newValue
- */ const logValueChange = (name, currentValue, newValue, params = {})=>{
- logEvent(`${name}_change`, {
- current_value: currentValue,
- new_value: newValue,
- ...params
- });
- };
- /**
- * Log when the user makes a search query whether through typing or voice search when there are no results.
- *
- * @param {SearchResultsParams} eventData
- */ const logEmptySearchResults = ({ query: searchQuery , source , type =_types_SearchType__WEBPACK_IMPORTED_MODULE_0__/* ["default"].Text */ .Z.Text , service })=>{
- const query = getSearchQuery(searchQuery);
- // if the searchQuery is not empty
- if (query !== "") {
- logEvent(`${type}_search_query_with_no_result`, {
- query,
- source,
- ...service && {
- service
- }
- });
- }
- };
- /**
- * Log when the user makes a search query whether through typing or voice search when there are results.
- *
- * @param {SearchResultsParams} eventData
- */ const logSearchResults = ({ query: searchQuery , source , type =_types_SearchType__WEBPACK_IMPORTED_MODULE_0__/* ["default"].Text */ .Z.Text , service })=>{
- const query = getSearchQuery(searchQuery);
- // if the searchQuery is not empty
- if (query !== "") {
- logEvent("search_query_with_results", {
- type,
- query,
- source,
- ...service && {
- service
- }
- });
- }
- };
- /**
- * Log text search queries entered by the user.
- *
- * @param {string} searchQuery
- * @param {SearchQuerySource} source
- */ const logTextSearchQuery = (searchQuery, source)=>{
- const query = getSearchQuery(searchQuery);
- // if the searchQuery is not empty
- if (query !== "") {
- logEvent("search_query", {
- query,
- source
- });
- }
- };
- const logTarteelLinkClick = (type)=>{
- logEvent("tarteel_link_click", {
- type: `${type}_attribution`
- });
- };
- /**
- * Log when an item selection status change.
- *
- * @param {string} itemName
- * @param {string | number} itemId
- * @param {boolean} isSelected
- */ const logItemSelectionChange = (itemName, itemId, isSelected = true)=>{
- logEvent(`${itemName}_${isSelected ? "selected" : "unselected"}`, {
- value: itemId
- });
- };
- __webpack_async_result__();
- } catch(e) { __webpack_async_result__(e); } });
- /***/ }),
- /***/ 57933:
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "AO": () => (/* binding */ getNotesNavigationUrl),
- /* harmony export */ "CZ": () => (/* binding */ getJuzNavigationUrl),
- /* harmony export */ "ES": () => (/* binding */ getCourseNavigationUrl),
- /* harmony export */ "Fk": () => (/* binding */ getRamadanActivitiesNavigationUrl),
- /* harmony export */ "GK": () => (/* binding */ getPageNavigationUrl),
- /* harmony export */ "HT": () => (/* binding */ getVerseReflectionNavigationUrl),
- /* harmony export */ "I8": () => (/* binding */ getVerseSelectedTafsirNavigationUrl),
- /* harmony export */ "L$": () => (/* binding */ getMyCoursesNavigationUrl),
- /* harmony export */ "Mf": () => (/* binding */ getRubNavigationUrl),
- /* harmony export */ "P6": () => (/* binding */ getChapterWithStartingVerseUrl),
- /* harmony export */ "So": () => (/* binding */ getVerseTafsirNavigationUrl),
- /* harmony export */ "Wq": () => (/* binding */ getHizbNavigationUrl),
- /* harmony export */ "Y9": () => (/* binding */ getReciterChapterNavigationUrl),
- /* harmony export */ "Z2": () => (/* binding */ getCanonicalUrl),
- /* harmony export */ "Zm": () => (/* binding */ getSurahInfoNavigationUrl),
- /* harmony export */ "_V": () => (/* binding */ fakeNavigate),
- /* harmony export */ "aT": () => (/* binding */ getReciterNavigationUrl),
- /* harmony export */ "dC": () => (/* binding */ getLessonNavigationUrl),
- /* harmony export */ "gk": () => (/* binding */ getLoginNavigationUrl),
- /* harmony export */ "hb": () => (/* binding */ scrollWindowToTop),
- /* harmony export */ "kJ": () => (/* binding */ getProfileNavigationUrl),
- /* harmony export */ "lj": () => (/* binding */ getNotificationSettingsNavigationUrl),
- /* harmony export */ "ly": () => (/* binding */ getQuranicCalendarNavigationUrl),
- /* harmony export */ "nT": () => (/* binding */ getQuranicCalendarRangesNavigationUrl),
- /* harmony export */ "oJ": () => (/* binding */ getReadingGoalProgressNavigationUrl),
- /* harmony export */ "p5": () => (/* binding */ getVerseNavigationUrl),
- /* harmony export */ "pO": () => (/* binding */ getProductUpdatesUrl),
- /* harmony export */ "pg": () => (/* binding */ getCollectionNavigationUrl),
- /* harmony export */ "qm": () => (/* binding */ getSurahNavigationUrl),
- /* harmony export */ "qs": () => (/* binding */ getVerseNavigationUrlByVerseKey),
- /* harmony export */ "ty": () => (/* binding */ getCoursesNavigationUrl),
- /* harmony export */ "uv": () => (/* binding */ QuranicCalendarRangesNavigationSettings),
- /* harmony export */ "we": () => (/* binding */ getReadingGoalNavigationUrl),
- /* harmony export */ "xl": () => (/* binding */ getRangesNavigationUrl),
- /* harmony export */ "zp": () => (/* binding */ resolveUrlBySearchNavigationType)
- /* harmony export */ });
- /* unused harmony exports getSurahRangeNavigationUrlByVerseKey, getPreviousSurahNavigationUrl, getNextSurahNavigationUrl, getSearchQueryNavigationUrl */
- /* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63477);
- /* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(querystring__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87098);
- /* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(69663);
- /* harmony import */ var _verse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44519);
- /* harmony import */ var _types_QueryParam__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11721);
- /* harmony import */ var _types_QuranReader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50467);
- /* harmony import */ var types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(87582);
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_search__WEBPACK_IMPORTED_MODULE_1__]);
- _search__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
- /* eslint-disable max-lines */
- /**
- * Get the href link to a verse.
- *
- * @param {string} verseKey
- * @returns {string}
- */ const getVerseNavigationUrlByVerseKey = (verseKey)=>{
- const [chapterId, verseNumber] = (0,_verse__WEBPACK_IMPORTED_MODULE_2__/* .getVerseAndChapterNumbersFromKey */ .bV)(verseKey);
- return `/${chapterId}/${verseNumber}`;
- };
- /**
- * Get the href link to a verse range e.g. 3:5-7.
- *
- * @param {string} key
- * @returns {string}
- */ const getSurahRangeNavigationUrlByVerseKey = (key)=>{
- const { surah , from , to } = (0,_verse__WEBPACK_IMPORTED_MODULE_2__/* .getVerseNumberRangeFromKey */ .YN)(key);
- return `/${surah}/${from}-${to}`;
- };
- /**
- * Get the scroll to link of a verseKey.
- *
- * @param {string} verseKey
- * @returns {string}
- */ const getChapterWithStartingVerseUrl = (verseKey)=>{
- const [chapterId, verseNumber] = (0,_verse__WEBPACK_IMPORTED_MODULE_2__/* .getVerseAndChapterNumbersFromKey */ .bV)(verseKey);
- return `/${chapterId}?${_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].STARTING_VERSE */ .Z.STARTING_VERSE}=${verseNumber}`;
- };
- /**
- * Get the href link to a verse.
- *
- * @param {string} chapterIdOrSlug
- * @param {string} verseNumber
- * @returns {string}
- */ const getVerseNavigationUrl = (chapterIdOrSlug, verseNumber)=>`/${chapterIdOrSlug}/${verseNumber}`;
- /**
- * Get the href link to a range.
- *
- * @param {string} startVerseKey
- * @param {string} endVerseKey
- * @returns {string}
- */ const getRangesNavigationUrl = (startVerseKey, endVerseKey)=>`/${startVerseKey}-${endVerseKey}`;
- /**
- * Get the href link to a juz.
- *
- * @param {string | number} juzNumber
- * @returns {string}
- */ const getJuzNavigationUrl = (juzNumber)=>`/juz/${juzNumber}`;
- /**
- * Get the href link to a Rub el Hizb.
- *
- * @param {string | number} rubNumber
- * @returns {string}
- */ const getRubNavigationUrl = (rubNumber)=>`/rub/${rubNumber}`;
- /**
- * Get the href link to a hizb.
- *
- * @param {string | number} hizbNumber
- * @returns {string}
- */ const getHizbNavigationUrl = (hizbNumber)=>`/hizb/${hizbNumber}`;
- /**
- * Get the href link to a page.
- *
- * @param {string | number} pageNumber
- * @returns {string}
- */ const getPageNavigationUrl = (pageNumber)=>`/page/${pageNumber}`;
- /**
- * Get the href link to tafsir for Ayah.
- *
- * @param {string | number} chapterIdOrSlug
- * @param {number} verseNumber
- * @returns {string}
- */ const getVerseTafsirNavigationUrl = (chapterIdOrSlug, verseNumber, tafsirId)=>`/${chapterIdOrSlug}/${verseNumber}/tafsirs${tafsirId ? `?${(0,querystring__WEBPACK_IMPORTED_MODULE_0__.stringify)({
- tafsirId
- })}` : ""}`;
- /**
- * Get the href link to selected tafsir for Ayah.
- *
- * @param {string | number} chapterId
- * @param {number} verseNumber
- * @param {number |string} tafsirId
- * @returns {string}
- */ const getVerseSelectedTafsirNavigationUrl = (chapterId, verseNumber, tafsirId)=>`/${chapterId}:${verseNumber}/tafsirs/${tafsirId}`;
- /**
- * Get the href link to selected tafsir for Ayah.
- *
- * @param {string} verseKey
- * @returns {string}
- */ const getVerseReflectionNavigationUrl = (verseKey)=>`/${verseKey}/reflections`;
- /**
- * Get the href link to a surah.
- *
- * @param {string | number} surahIdOrSlug
- * @returns {string}
- */ const getSurahNavigationUrl = (surahIdOrSlug)=>`/${surahIdOrSlug}`;
- var QuranicCalendarRangesNavigationSettings;
- (function(QuranicCalendarRangesNavigationSettings) {
- QuranicCalendarRangesNavigationSettings["EnglishOnly"] = "englishOnly";
- QuranicCalendarRangesNavigationSettings["EnglishAndArabic"] = "englishAndArabic";
- QuranicCalendarRangesNavigationSettings["DefaultSettings"] = "defaultSettings";
- })(QuranicCalendarRangesNavigationSettings || (QuranicCalendarRangesNavigationSettings = {}));
- const getQuranicCalendarRangesNavigationUrl = (ranges, settings)=>{
- const params = {
- [_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].FLOW */ .Z.FLOW]: _types_QuranReader__WEBPACK_IMPORTED_MODULE_4__/* .QuranReaderFlow.QURANIC_CALENDER */ .Bc.QURANIC_CALENDER
- };
- if (settings !== QuranicCalendarRangesNavigationSettings.DefaultSettings) {
- params[_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].Translations */ .Z.Translations] = 85;
- if (settings === QuranicCalendarRangesNavigationSettings.EnglishOnly) {
- params[_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].HIDE_ARABIC */ .Z.HIDE_ARABIC] = "true";
- }
- }
- return `${ranges}?${(0,querystring__WEBPACK_IMPORTED_MODULE_0__.stringify)(params)}`;
- };
- /**
- * Get the href link to the previous surah.
- *
- * @param {number} chapterNumber
- * @param {boolean} isReadingByRevelationOrder
- * @returns {string}
- */ const getPreviousSurahNavigationUrl = (chapterNumber, isReadingByRevelationOrder)=>{
- if (!isReadingByRevelationOrder) {
- return getSurahNavigationUrl(chapterNumber - 1);
- }
- const currentChapterRevelationOrderIndex = REVELATION_ORDER.indexOf(chapterNumber);
- const previousChapterRevelationOrderIndex = currentChapterRevelationOrderIndex - 1;
- const previousChapterNumberByRevelationOrder = REVELATION_ORDER[previousChapterRevelationOrderIndex];
- return getSurahNavigationUrl(previousChapterNumberByRevelationOrder);
- };
- /**
- * Get the href link to the next surah.
- *
- * @param chapterNumber
- * @param isReadingByRevelationOrder
- * @returns {string}
- */ const getNextSurahNavigationUrl = (chapterNumber, isReadingByRevelationOrder)=>{
- if (!isReadingByRevelationOrder) {
- return getSurahNavigationUrl(chapterNumber + 1);
- }
- const currentChapterRevelationOrderIndex = REVELATION_ORDER.indexOf(chapterNumber);
- const nextChapterRevelationOrderIndex = currentChapterRevelationOrderIndex + 1;
- const nextChapterNumberByRevelationOrder = REVELATION_ORDER[nextChapterRevelationOrderIndex];
- return getSurahNavigationUrl(nextChapterNumberByRevelationOrder);
- };
- /**
- * Generate the navigation url based on the type.
- *
- * @param {SearchNavigationType} type
- * @param {string | number} key
- * @param {boolean} isKalimatSearch
- * @returns {string}
- */ const resolveUrlBySearchNavigationType = (type, key, isKalimatSearch = false)=>{
- const stringKey = isKalimatSearch ? (0,_search__WEBPACK_IMPORTED_MODULE_1__/* .searchIdToNavigationKey */ .Ck)(type, String(key)) : String(key);
- if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.AYAH */ .H.AYAH) {
- return getChapterWithStartingVerseUrl(stringKey);
- }
- if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.JUZ */ .H.JUZ) {
- return getJuzNavigationUrl(stringKey);
- }
- if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.RUB_EL_HIZB */ .H.RUB_EL_HIZB) {
- return getRubNavigationUrl(stringKey);
- }
- if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.HIZB */ .H.HIZB) {
- return getHizbNavigationUrl(stringKey);
- }
- if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.PAGE */ .H.PAGE) {
- return getPageNavigationUrl(stringKey);
- }
- if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.SEARCH_PAGE */ .H.SEARCH_PAGE) {
- return getSearchQueryNavigationUrl(stringKey);
- }
- if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.RANGE */ .H.RANGE) {
- return getSurahRangeNavigationUrlByVerseKey(stringKey);
- }
- // for the Surah navigation
- return getSurahNavigationUrl(stringKey);
- };
- /**
- * Get the href link to the search page with a specific query.
- *
- * @param {string} query the search query.
- * @returns {string}
- */ const getSearchQueryNavigationUrl = (query)=>`/search${query ? `?${_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].QUERY */ .Z.QUERY}=${query}` : ""}`;
- /**
- * Get the href link to the info page of a Surah.
- *
- * @param {string} chapterIdOrSlug
- * @returns {string} chapterUrl
- */ const getSurahInfoNavigationUrl = (chapterIdOrSlug)=>`/surah/${chapterIdOrSlug}/info`;
- /**
- * Get href link to the reciter page
- *
- * @param {string} reciterId
- * @returns {string} reciterPageUrl
- */ const getReciterNavigationUrl = (reciterId)=>`/reciters/${reciterId}`;
- /**
- * Get href link to the course page
- *
- * @param {string} courseSlug
- * @returns {string} coursePageUrl
- */ const getCourseNavigationUrl = (courseSlug)=>`/learning-plans/${courseSlug}`;
- /**
- * Get href link to the lesson page
- *
- * @param {string} courseSlug
- * @returns {string} lessonPageUrl
- */ const getLessonNavigationUrl = (courseSlug, lessonSlug)=>`/learning-plans/${courseSlug}/lessons/${lessonSlug}`;
- /**
- * Get href link to an audio recitation page by reciterId and chapterId
- *
- * @param {string} reciterId
- * @param {string} chapterId
- * @returns {string} recitationPageUrl
- */ const getReciterChapterNavigationUrl = (reciterId, chapterId)=>`/reciters/${reciterId}/${chapterId}`;
- /**
- * Get the canonical url. Will include the language in the url except for English.
- *
- * @param {string} lang
- * @param {string} path
- * @returns {string}
- */ const getCanonicalUrl = (lang, path)=>`${(0,_url__WEBPACK_IMPORTED_MODULE_6__/* .getBasePath */ .bv)()}${lang === "en" ? "" : `/${lang}`}${path}`;
- /**
- * Get the href link to the product updates page.
- *
- * @param {string} id
- * @returns {string}
- */ const getProductUpdatesUrl = (id = "")=>`/product-updates${`${id ? `/${id}` : ""}`}`;
- const getProfileNavigationUrl = ()=>{
- return "/profile";
- };
- const getCollectionNavigationUrl = (collectionId)=>{
- return `/collections/${collectionId}`;
- };
- const getReadingGoalNavigationUrl = ()=>"/reading-goal";
- const getMyCoursesNavigationUrl = ()=>"/my-learning-plans";
- const getCoursesNavigationUrl = ()=>"/learning-plans";
- const getRamadanActivitiesNavigationUrl = ()=>"/ramadan-activities";
- const getLoginNavigationUrl = (redirectTo)=>`/login${redirectTo ? `?${_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].REDIRECT_TO */ .Z.REDIRECT_TO}=${redirectTo}` : ""}`;
- const getReadingGoalProgressNavigationUrl = ()=>"/reading-goal/progress";
- const getNotesNavigationUrl = ()=>"/notes-and-reflections";
- const getNotificationSettingsNavigationUrl = ()=>"/notification-settings";
- const getQuranicCalendarNavigationUrl = ()=>"/calendar";
- /**
- * Update the browser history with the new url.
- * without actually navigating into that url.
- * So it does not trigger re render or page visit on Next.js
- *
- * @param {string} url
- * @param {string} locale
- */ const fakeNavigate = (url, locale)=>{
- window.history.pushState({}, "", `${locale === "en" ? "" : `/${locale}`}${url}`);
- };
- /**
- * Scroll to the top of the page.
- */ const scrollWindowToTop = ()=>{
- if (false) {}
- };
- __webpack_async_result__();
- } catch(e) { __webpack_async_result__(e); } });
- /***/ }),
- /***/ 19303:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "XK": () => (/* binding */ formatStringNumber),
- /* harmony export */ "XN": () => (/* binding */ getPageNumberFromIndexAndPerPage),
- /* harmony export */ "uZ": () => (/* binding */ convertNumberToDecimal),
- /* harmony export */ "xT": () => (/* binding */ convertFractionToPercent)
- /* harmony export */ });
- /* eslint-disable import/prefer-default-export */ /**
- * This function returns a number string after making sure
- * it's in the valid format. e.g.
- * 1 -> 1
- * 001 -> 1
- *
- * @param {string} number
- * @returns {string}
- */ const formatStringNumber = (number)=>String(Number(number));
- /**
- * This function takes a fraction (a number between 0 and 1) and converts it to a percent number (limited to 100).
- *
- * @param {string | number} fraction a number between 0 and 1
- * @param {number} decimalPoints number of decimal points
- * @returns {number} a number between 0 and 100
- */ const convertFractionToPercent = (fraction, decimalPoints = 1)=>{
- const number = convertNumberToDecimal(Number(fraction) * 100, decimalPoints);
- return Math.min(number, 100);
- };
- /**
- * This function takes a number and converts it to a decimal number.
- *
- * @param {string | number} number
- * @param {number} decimalPoints number of decimal points
- * @returns {number}
- */ const convertNumberToDecimal = (number, decimalPoints = 1)=>{
- return Number((typeof number === "string" ? Number(number) : number).toFixed(decimalPoints));
- };
- /**
- * This function takes an item index and the number of items per page and returns the page number.
- *
- * Example:
- * index: 0, perPage: 10 -> 1
- * index: 1, perPage: 10 -> 1
- * index: 10, perPage: 10 -> 2
- * index: 11, perPage: 10 -> 2
- *
- * @param {number} index
- * @param {number} perPage
- * @returns {number}
- */ const getPageNumberFromIndexAndPerPage = (index, perPage)=>{
- return Math.ceil((index + 1) / perPage);
- };
- /***/ }),
- /***/ 99921:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- // Reference: https://github.com/billjs/query-string/blob/master/src/index.ts
- const defaultStringifyFunction = (key, value)=>value;
- const defaultEq = "=";
- const defaultSep = "&";
- const defaultConfig = {
- eq: defaultEq,
- sep: defaultSep,
- prefix: "",
- fn: defaultStringifyFunction
- };
- /**
- * Given a query object, return the query string
- * See qs-stringify.test.ts for examples
- *
- * @param {QueryObject} obj a query object to be converted to a query string
- * @param {Config} config optional configuration
- * @returns {string} query string
- *
- * @example
- * stringify({a: 1, b: 2}) // returns 'a=1&b=s'
- */ function stringify(obj, config = defaultConfig) {
- const { eq , sep , fn , prefix } = {
- ...defaultConfig,
- ...config
- };
- if (obj == null || !isObject(obj)) {
- return "";
- }
- return Object.entries(obj).filter(([, value])=>value !== null) // filter out null values
- .map(([key, value])=>{
- if (Array.isArray(value)) {
- return encode(key, value.join(","), {
- eq,
- fn,
- prefix
- });
- }
- if (isObject(value)) {
- return stringify(value, {
- eq,
- sep,
- fn,
- prefix: getKey(key, prefix)
- });
- }
- return encode(key, value, {
- eq,
- fn,
- prefix
- });
- }).join(sep);
- }
- // encode the key and add prefix if necessary
- const getKey = (key, prefix = "")=>{
- const encodedKey = encodeURIComponent(key);
- if (prefix) return `${prefix}[${encodedKey}]`;
- return encodedKey;
- };
- // encode the key and value of a query object
- const encode = (key, value, { eq =defaultEq , fn =defaultStringifyFunction , prefix ="" })=>{
- const newValue = encodeURIComponent(fn(key, value));
- const newKey = getKey(key, prefix);
- return [
- newKey,
- newValue
- ].join(eq);
- };
- // check if the given value is an object
- function isObject(obj) {
- const type = typeof obj;
- return obj && (type === "object" || type === "function") || false;
- }
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringify);
- /***/ }),
- /***/ 87098:
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Ck": () => (/* binding */ searchIdToNavigationKey),
- /* harmony export */ "Em": () => (/* binding */ getSearchNavigationResult),
- /* harmony export */ "Gs": () => (/* binding */ getDefaultTranslationIdsByLang),
- /* harmony export */ "NC": () => (/* binding */ getTranslationsByLanguages),
- /* harmony export */ "UC": () => (/* binding */ searchGetResults),
- /* harmony export */ "YA": () => (/* binding */ addToSearchHistory)
- /* harmony export */ });
- /* unused harmony exports LOCALE_TO_TRANSLATION_LANGUAGE, idToPageNumber, idToJuzNumber */
- /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(98492);
- /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _eventLogger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55943);
- /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(92684);
- /* harmony import */ var _redux_slices_Search_search__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85895);
- /* harmony import */ var _types_Search_SearchRequestParams__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(92086);
- /* harmony import */ var _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64609);
- /* harmony import */ var _utils_chapter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95892);
- /* harmony import */ var _utils_locale__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24709);
- /* harmony import */ var _utils_verse__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(44519);
- /* harmony import */ var types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(87582);
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_eventLogger__WEBPACK_IMPORTED_MODULE_1__]);
- _eventLogger__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
- /* eslint-disable max-lines */ /* eslint-disable react-func/max-lines-per-function */
- const LOCALE_TO_TRANSLATION_LANGUAGE = {
- en: "english",
- ar: "arabic",
- bn: "bengali",
- fa: "persian",
- fr: "french",
- id: "indonesian",
- it: "italian",
- nl: "dutch",
- pt: "portuguese",
- ru: "russian",
- sq: "albanian",
- th: "thai",
- tr: "turkish",
- ur: "urdu",
- zh: "chinese",
- ms: "malay"
- };
- /**
- * Given a list of translations, group them by language
- * after converting the language name to lowercase to account
- * for case differences e.g. "dutch", "Dutch"
- *
- * @param {AvailableTranslation[]} translations
- * @returns {Record<string, AvailableTranslation[]>}
- */ const getTranslationsByLanguages = (translations)=>{
- const translationByLanguages = lodash_groupBy__WEBPACK_IMPORTED_MODULE_0___default()(translations, (translation)=>translation.languageName.toLowerCase());
- return translationByLanguages;
- };
- /**
- * Get the default translation ids for the passed language.
- *
- * @param {AvailableTranslation[]} translations
- * @param {string} lang
- * @param {boolean} returnAsString
- * @returns {string | string[]}
- */ const getDefaultTranslationIdsByLang = (translations, lang, returnAsString = true)=>{
- const translationsByLanguages = getTranslationsByLanguages(translations);
- let translationIds = [];
- // If the language is in the map, return list of its translation ids
- if (translationsByLanguages[LOCALE_TO_TRANSLATION_LANGUAGE[lang]]) {
- translationIds = translationsByLanguages[LOCALE_TO_TRANSLATION_LANGUAGE[lang]].map((translation)=>translation.id.toString());
- }
- if (returnAsString) {
- return translationIds.join(",");
- }
- return translationIds;
- };
- /**
- * Convert a search id to navigation key. an example of
- * a search id is j29 for Juz 29 or p50 for Page 50.
- *
- * @param {type} type
- * @param {string} id
- * @returns {string}
- */ const searchIdToNavigationKey = (type, id)=>{
- if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.JUZ */ .H.JUZ) {
- // e.g. j29
- return idToJuzNumber(id);
- }
- if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.PAGE */ .H.PAGE) {
- // e.g. p50
- return idToPageNumber(id);
- }
- // e.g. 1 or 1:1 which don't need converting
- return id;
- };
- const idToPageNumber = (id)=>id.substring(id.indexOf("p") + 1);
- const idToJuzNumber = (id)=>id.substring(id.indexOf("j") + 1);
- const getSearchNavigationResult = (chaptersData, result, t, locale)=>{
- const { key , resultType } = result;
- if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.JUZ */ .H.JUZ) {
- const juzNumber = idToJuzNumber(key);
- return {
- name: `${t("common:juz")} ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(Number(juzNumber), locale)}`,
- key: juzNumber,
- resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.JUZ */ .H.JUZ
- };
- }
- if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.PAGE */ .H.PAGE) {
- const pageNumber = idToPageNumber(key);
- return {
- name: `${t("common:page")} ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(Number(pageNumber), locale)}`,
- key: pageNumber,
- resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.PAGE */ .H.PAGE
- };
- }
- if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.RANGE */ .H.RANGE) {
- const { surah , from , to } = (0,_utils_verse__WEBPACK_IMPORTED_MODULE_8__/* .getVerseNumberRangeFromKey */ .YN)(key);
- return {
- name: `${t("common:surah")} ${(0,_utils_chapter__WEBPACK_IMPORTED_MODULE_6__/* .getChapterData */ .dy)(chaptersData, `${surah}`).transliteratedName} ${t("common:ayah")} ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(from, locale)} - ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(to, locale)}`,
- key,
- resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.RANGE */ .H.RANGE
- };
- }
- if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.AYAH */ .H.AYAH) {
- const [surahNumber, ayahNumber] = (0,_utils_verse__WEBPACK_IMPORTED_MODULE_8__/* .getVerseAndChapterNumbersFromKey */ .bV)(key);
- return {
- name: `${t("common:surah")} ${(0,_utils_chapter__WEBPACK_IMPORTED_MODULE_6__/* .getChapterData */ .dy)(chaptersData, `${surahNumber}`).transliteratedName}, ${t("common:ayah")} ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(Number(ayahNumber), locale)}`,
- key,
- resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.AYAH */ .H.AYAH
- };
- }
- // when it's a chapter
- return {
- name: `${t("common:surah")} ${(0,_utils_chapter__WEBPACK_IMPORTED_MODULE_6__/* .getChapterData */ .dy)(chaptersData, key).transliteratedName}`,
- key,
- resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.SURAH */ .H.SURAH
- };
- };
- /**
- * Call BE to fetch the search results using the passed filters
- * and if there are no results call Kalimat API.
- *
- * @param {SearchQuerySource} source
- * @param {string} query
- * @param {number} page
- * @param {number} pageSize
- * @param {(arg: boolean) => void} setIsSearching
- * @param {(arg: boolean) => void} setHasError
- * @param {(data: SearchResponse) => void} setSearchResult
- * @param {string} languages
- * @param {string} translations
- */ const searchGetResults = (source, query, page, pageSize, setIsSearching, setHasError, setSearchResult, languages, translations)=>{
- setIsSearching(true);
- (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logTextSearchQuery */ .tL)(query, source);
- (0,_api__WEBPACK_IMPORTED_MODULE_2__/* .getSearchResults */ .BP)({
- query,
- ...languages && {
- filterLanguages: languages
- },
- size: pageSize,
- page,
- ...translations && {
- filterTranslations: translations
- }
- }).then(async (response)=>{
- if (response.status === 500) {
- setHasError(true);
- } else {
- setSearchResult({
- ...response,
- service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].QDC */ .Z.QDC
- });
- const noQdcResults = response.pagination.totalRecords === 0 && !response.result.navigation.length;
- // if there is no navigations nor verses in the response
- if (noQdcResults) {
- (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logEmptySearchResults */ .Dy)({
- query,
- source,
- service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].QDC */ .Z.QDC
- });
- const kalimatResponse = await (0,_api__WEBPACK_IMPORTED_MODULE_2__/* .getNewSearchResults */ .H4)({
- mode: _types_Search_SearchRequestParams__WEBPACK_IMPORTED_MODULE_4__/* .SearchMode.Advanced */ .N.Advanced,
- query,
- size: pageSize,
- filterLanguages: languages,
- page,
- exactMatchesOnly: 0,
- // translations will be included only when there is a selected translation
- ...translations && {
- filterTranslations: translations,
- translationFields: "resource_name"
- }
- });
- setSearchResult({
- ...kalimatResponse,
- service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].KALIMAT */ .Z.KALIMAT
- });
- if (kalimatResponse.pagination.totalRecords === 0) {
- (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logEmptySearchResults */ .Dy)({
- query,
- source,
- service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].KALIMAT */ .Z.KALIMAT
- });
- } else {
- (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logSearchResults */ .qS)({
- query,
- source,
- service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].KALIMAT */ .Z.KALIMAT
- });
- }
- }
- }
- }).catch(()=>{
- setHasError(true);
- }).finally(()=>{
- setIsSearching(false);
- });
- };
- /**
- * Adds the searched text to the recent history.
- *
- * @param {Dispatch<AnyAction>} dispatch
- * @param {string} debouncedSearchQuery
- * @param {SearchQuerySource} source
- */ const addToSearchHistory = (dispatch, debouncedSearchQuery, source)=>{
- dispatch({
- type: _redux_slices_Search_search__WEBPACK_IMPORTED_MODULE_3__/* .addSearchHistoryRecord.type */ .zr.type,
- payload: debouncedSearchQuery
- });
- (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logTextSearchQuery */ .tL)(debouncedSearchQuery, source);
- };
- __webpack_async_result__();
- } catch(e) { __webpack_async_result__(e); } });
- /***/ }),
- /***/ 44519:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Bo": () => (/* binding */ getDistanceBetweenVerses),
- /* harmony export */ "G$": () => (/* binding */ makeWordLocation),
- /* harmony export */ "LQ": () => (/* binding */ getVerseWords),
- /* harmony export */ "TO": () => (/* binding */ getWordDataByLocation),
- /* harmony export */ "Tc": () => (/* binding */ getChapterNumberFromKey),
- /* harmony export */ "YN": () => (/* binding */ getVerseNumberRangeFromKey),
- /* harmony export */ "Yx": () => (/* binding */ isVerseKeyWithinRanges),
- /* harmony export */ "ZZ": () => (/* binding */ getFirstWordOfSurah),
- /* harmony export */ "bV": () => (/* binding */ getVerseAndChapterNumbersFromKey),
- /* harmony export */ "cI": () => (/* binding */ getFirstAndLastVerseKeys),
- /* harmony export */ "kC": () => (/* binding */ isLastVerseOfSurah),
- /* harmony export */ "qB": () => (/* binding */ generateChapterVersesKeys),
- /* harmony export */ "tR": () => (/* binding */ getVerseNumberFromKey),
- /* harmony export */ "u": () => (/* binding */ makeVerseKey)
- /* harmony export */ });
- /* unused harmony exports sortWordLocation, formatChapterId, getVerseUrl, sortByVerseKey, sortVersesObjectByVerseKeys, isFirstVerseOfSurah, getChapterFirstAndLastVerseKey, shortenVerseText */
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64042);
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _chapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95892);
- /* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19303);
- /* harmony import */ var _verseKeys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36495);
- /* eslint-disable max-lines */ /* eslint-disable react-func/max-lines-per-function */
- const COLON_SPLITTER = ":";
- /**
- * This will generate all the keys for the verses of a chapter. a key is `{chapterId}:{verseId}`.
- *
- * @param {ChaptersData} data
- * @param {string} chapterId
- * @returns {string[]}
- */ const generateChapterVersesKeys = (data, chapterId)=>{
- const chapterNumberString = (0,_number__WEBPACK_IMPORTED_MODULE_3__/* .formatStringNumber */ .XK)(chapterId);
- return lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(data[chapterNumberString].versesCount).map((verseId)=>`${chapterNumberString}:${verseId + 1}`);
- };
- /**
- * Get the chapter number from its key. A key is the combination between the verse's chapter
- * and its number separated by ":" e.g. 1:5.
- *
- * @param {string} verseKey
- * @returns {number} The verse number extracted from the key.
- */ const getChapterNumberFromKey = (verseKey)=>Number(verseKey.split(COLON_SPLITTER)[0]);
- /**
- * Get the verse number from its key. A key is the combination between the verse's chapter
- * and its number separated by ":" e.g. 1:5.
- *
- * @param {string} verseKey
- * @returns {number} The verse number extracted from the key.
- */ const getVerseNumberFromKey = (verseKey)=>Number(verseKey.split(COLON_SPLITTER)[1]);
- /**
- * If the verse is a range of verses, for example 1:3-5
- * we'll return {surah: 1, from: 3, to: 5}
- *
- * @param {string} verseKey
- * @returns {surah: number, from: Number, to: Number}
- */ const getVerseNumberRangeFromKey = (verseKey)=>{
- const splits = verseKey.split(COLON_SPLITTER);
- const surahNumber = splits[0];
- const verseNumber = splits[1]; // for example (3-5)
- const [from, to] = verseNumber.split("-"); // for example [3, 5]
- return {
- surah: Number(surahNumber),
- from: Number(from),
- to: to ? Number(to) : Number(from)
- };
- };
- /**
- * Get the chapter and verse number of a verse from its key.
- *
- * @param {string} verseKey
- * @returns {[string, string]} The verse number extracted from the key.
- */ const getVerseAndChapterNumbersFromKey = (verseKey)=>{
- const splits = verseKey.split(COLON_SPLITTER);
- return [
- splits[0],
- splits[1]
- ];
- };
- /**
- * Split the word's location and get the surahNumber, verseNumber and wordNumber.
- *
- * @param {string} wordLocation the word location {surahNumber}:{verseNumber}:{wordNumber}
- * @returns {[string, string, string]}
- */ const getWordDataByLocation = (wordLocation)=>{
- const locationSplits = wordLocation.split(COLON_SPLITTER);
- return [
- locationSplits[0],
- locationSplits[1],
- locationSplits[2]
- ];
- };
- /**
- * Extract the data related to a word. The first is the chapter Id,
- * the second is whether the word is the first word of the first verse
- * of the Surah. To do that we will have to split the word location
- * which comes in the following format: {surahNumber}:{verseNumber}:{wordNumber}.
- * For this to be true, the combination of {verseNumber}:{wordNumber} has to be
- * 1:1.
- *
- * @param {string} wordLocation whose format is {surahNumber}:{verseNumber}:{wordNumber} e.g. "112:1:1"
- * @returns {{ chapterId: string; isFirstWordOfSurah: boolean }}
- */ const getFirstWordOfSurah = (wordLocation)=>{
- const locationSplits = getWordDataByLocation(wordLocation);
- return {
- chapterId: locationSplits[0],
- isFirstWordOfSurah: locationSplits[1] === "1" && locationSplits[2] === "1"
- };
- };
- /**
- * sort the the word location of the verses
- *
- * @param {string[]} locations , the location of the word, Example ['1:1:2', '1:1:1', '1:3:1]
- * @returns {number} sortedLocations , Example ['1:1:1', '1:1:2', '1:3:1']
- *
- * Reference: https://gomakethings.com/sorting-an-array-by-multiple-criteria-with-vanilla-javascript/
- */ const sortWordLocation = (locations)=>locations.sort((a, b)=>{
- const [aChapter, aVerse, aWord] = a.split(":");
- const [bChapter, bVerse, bWord] = b.split(":");
- if (Number(aChapter) > Number(bChapter)) return 1;
- if (Number(aChapter) < Number(bChapter)) return -1;
- if (Number(aVerse) > Number(bVerse)) return 1;
- if (Number(aVerse) < Number(bVerse)) return -1;
- if (Number(aWord) > Number(bWord)) return 1;
- if (Number(aWord) < Number(bWord)) return -1;
- return 0;
- });
- /**
- * Format chapter id, add prefix '0' if it's a single digit number
- *
- * @param {string} id chapter id
- * @returns {string} formattedChapterId
- *
- * @example
- * // returns '01'
- * formatChapterId('1')
- * @example
- * // returns '102'
- * formatChapterId('102')
- */ const formatChapterId = (id)=>`0${id}`.slice(-2);
- /**
- * Given the verseKey, return the verseUrl
- *
- * @param {string} verseKey example: "1:5"
- * @returns {string} verseUrl , example "/1/5";
- */ const getVerseUrl = (verseKey)=>{
- const [chapterNumber, verseNumber] = getVerseAndChapterNumbersFromKey(verseKey);
- return `/${chapterNumber}/${verseNumber}`;
- };
- /**
- * This is a sorting function that is meant to be used with array.sort() function
- * to sort a list of verse keys to match their appearance in the Mushaf.
- *
- * @param {string} verseKey1
- * @param {string} verseKey2
- * @returns {number}
- */ const sortByVerseKey = (verseKey1, verseKey2)=>{
- const [chapterId1, verseId1] = getVerseAndChapterNumbersFromKey(verseKey1);
- const [chapterId2, verseId2] = getVerseAndChapterNumbersFromKey(verseKey2);
- const chapterId1Number = Number(chapterId1);
- const chapterId2Number = Number(chapterId2);
- const verseId1Number = Number(verseId1);
- const verseId2Number = Number(verseId2);
- if (chapterId1Number > chapterId2Number) {
- return 1;
- }
- if (chapterId1Number < chapterId2Number) {
- return -1;
- }
- return verseId1Number > verseId2Number ? 1 : -1;
- };
- /**
- * Sort an object by keys whose keys are verse keys.
- *
- * @param {Record<string, unknown>} object
- * @returns {Record<string, unknown>}
- */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
- const sortVersesObjectByVerseKeys = (object)=>{
- const sortedObject = {};
- Object.keys(object).sort((verseKey1, verseKey2)=>sortByVerseKey(verseKey1, verseKey2)).forEach((verseKey)=>{
- sortedObject[verseKey] = object[verseKey];
- });
- return sortedObject;
- };
- /**
- * make verseKey from chapterNumber and verseNumber, example "1:5"
- *
- * @param {number|string} chapterNumber
- * @param {number|string} verseNumberOrRangeFrom
- * @param {number|string} rangeTo
- * @returns {string}
- */ const makeVerseKey = (chapterNumber, verseNumberOrRangeFrom, rangeTo)=>{
- if (rangeTo && verseNumberOrRangeFrom !== rangeTo) {
- return `${chapterNumber}:${verseNumberOrRangeFrom}-${rangeTo}`;
- }
- return `${chapterNumber}:${verseNumberOrRangeFrom}`;
- };
- /**
- * make wordLocation from verseKey and wordPosition, example "1:1:2"
- *
- * @param {string} verseKey
- * @param {string} wordPosition
- * @returns {string} wordLocation
- */ const makeWordLocation = (verseKey, wordPosition)=>`${verseKey}:${wordPosition}`;
- /**
- * Get the words of each verse. This can be used to extend
- * the BE response of each word to add custom fields.
- *
- * @param {Verse} verse
- * @param {boolean} isReadingView
- * @returns {Word[]}
- */ const getVerseWords = (verse, isReadingView = false)=>{
- const words = [];
- verse.words.forEach((word)=>{
- const wordVerse = {
- ...verse
- };
- words.push({
- ...word,
- hizbNumber: verse.hizbNumber,
- ...isReadingView && {
- verse: wordVerse
- }
- });
- });
- return words;
- };
- /**
- * Calculate the number of verses in a range of chapters.
- *
- * @param {ChaptersData} chaptersData
- * @param {number} startChapter
- * @param {number} endChapter
- * @returns {number}
- */ const getNumberOfVersesInRangeOfChapters = (chaptersData, startChapter, endChapter)=>{
- let total = 0;
- for(let currentChapterId = startChapter; currentChapterId < endChapter; currentChapterId += 1){
- total += (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, String(currentChapterId)).versesCount;
- }
- return total;
- };
- /**
- * Calculate how far apart 2 verses are from each other. The order of the verses
- * won't matter as we swap them if they are not in the same order of the Mushaf.
- *
- * @param {ChaptersData} chaptersData
- * @param {string} firstVerseKey
- * @param {string} secondVerseKey
- *
- * @returns {number}
- */ const getDistanceBetweenVerses = (chaptersData, firstVerseKey, secondVerseKey)=>{
- // eslint-disable-next-line prefer-const
- let [firstChapterString, firstVerseNumberString] = getVerseAndChapterNumbersFromKey(firstVerseKey);
- const [secondChapterString, secondVerseNumberString] = getVerseAndChapterNumbersFromKey(secondVerseKey);
- let firstChapterNumber = Number(firstChapterString);
- let secondChapterNumber = Number(secondChapterString);
- let firstVerseNumber = Number(firstVerseNumberString);
- let secondVerseNumber = Number(secondVerseNumberString);
- // if they are within the same chapter
- if (firstChapterNumber === secondChapterNumber) {
- if (firstVerseNumber > secondVerseNumber) {
- return firstVerseNumber - secondVerseNumber;
- }
- return secondVerseNumber - firstVerseNumber;
- }
- // if the first verse chapter is after the second, we swap them to match the same order in the Mushaf
- if (firstChapterNumber > secondChapterNumber) {
- [firstVerseNumber, secondVerseNumber, firstChapterNumber, secondChapterNumber, firstChapterString, ] = [
- secondVerseNumber,
- firstVerseNumber,
- secondChapterNumber,
- firstChapterNumber,
- secondChapterString,
- ];
- }
- let distance = 0;
- // if there is more than 1 full chapter in between the verses' chapters being checked, we sum the number of verses in each chapter.
- if (secondChapterNumber - firstChapterNumber > 1) {
- distance += getNumberOfVersesInRangeOfChapters(chaptersData, firstChapterNumber + 1, secondChapterNumber);
- }
- /*
- 1. we add the number of verses from beginning of the second verse's chapter -> the verse itself.
- 2. we add the difference between the last verse of the first verse's chapter and the first verse itself.
- */ return distance + secondVerseNumber + (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, firstChapterString).versesCount - firstVerseNumber;
- };
- /**
- * Whether the current verse is the first in surah.
- *
- * @param {number} verseNumber
- * @returns {boolean}
- */ const isFirstVerseOfSurah = (verseNumber)=>verseNumber === 1;
- /**
- * Whether the current verse is the last in surah.
- *
- * @param {ChaptersData} chaptersData
- * @param {string} chapterNumber
- * @param {number} verseNumber
- * @returns {boolean}
- */ const isLastVerseOfSurah = (chaptersData, chapterNumber, verseNumber)=>verseNumber === (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, chapterNumber).versesCount;
- const getChapterFirstAndLastVerseKey = (chaptersData, chapterId)=>{
- if (!chaptersData) {
- return [
- "",
- ""
- ];
- }
- const chapterData = getChapterData(chaptersData, chapterId);
- return [
- makeVerseKey(Number(chapterId), 1),
- makeVerseKey(Number(chapterId), chapterData.versesCount),
- ];
- };
- /**
- * Shorten a text by setting the maximum number of characters
- * by the value of the parameter and adding "..." at the end.
- *
- * @param {string} text
- * @param {number} length
- * @returns {string}
- */ const shortenVerseText = (text, length = 150)=>{
- const characters = text.split("", length);
- let shortenedText = "";
- for(let index = 0; index < characters.length; index += 1){
- const character = characters[index];
- if (shortenedText.length === length - 1) {
- shortenedText = `${shortenedText}${character}...`;
- break;
- }
- shortenedText = `${shortenedText}${character}`;
- }
- return shortenedText;
- };
- /**
- * Given list of verses, get all the first and the last verseKeys
- *
- * @param {Record<string, Verse>} verses
- * @returns {string[]} [firstVerseKey, lastVerseKey]
- */ const getFirstAndLastVerseKeys = (verses)=>{
- const verseKeys = Object.keys(verses).sort(sortByVerseKey);
- return [
- verseKeys[0],
- verseKeys[verseKeys.length - 1]
- ];
- };
- /**
- * This function checks if a verse key is within a range or an array of ranges.
- *
- * Examples:
- * - `isVerseKeyWithinRanges('1:1', '1:1-1:7')` -> `true`
- * - `isVerseKeyWithinRanges('1:1', '1:2-1:7')` -> `false`
- * - `isVerseKeyWithinRanges('2:4', ['1:1-1:7', '2:1-2:5'])` -> `true`
- * - `isVerseKeyWithinRanges('2:10', ['1:2-1:7', '2:1-2:5'])` -> `false`
- *
- * @param {string} verseKey - verse key, e.g. 1:1
- * @param {string[] | string} ranges - verse range or array of verse ranges, e.g. `1:1-1:7` or `['1:1-1:7', '2:1-2:5']`
- * @returns {boolean}
- */ const isVerseKeyWithinRanges = (verseKey, ranges)=>{
- const [chapter, verse] = getVerseAndChapterNumbersFromKey(verseKey).map(Number);
- const rangesArray = Array.isArray(ranges) ? ranges : [
- ranges
- ];
- for(let i = 0; i < rangesArray.length; i += 1){
- const verseRange = rangesArray[i];
- const [from, to] = (0,_verseKeys__WEBPACK_IMPORTED_MODULE_2__/* .parseVerseRange */ .p)(verseRange, true);
- // if the chapter is less than or greater than the range, then skip this range
- if (chapter < from.chapter || chapter > to.chapter) {
- continue;
- }
- // if the chapter is equal to the chapter of the range start, then check if the verse is within the range
- // if the verse is less than the range, then skip this range
- if (chapter === from.chapter && verse < from.verse) {
- continue;
- }
- // if the chapter is equal to the chapter of the range end, then check if the verse is within the range
- // if the verse is greater than the range, then skip this range
- if (chapter === to.chapter && verse > to.verse) {
- continue;
- }
- // if we're here, it means that the verse is within the range
- // so we can return true directly and end the loop
- return true;
- }
- // if we're here, it means that the verse is not within any of the ranges
- // so we can return false
- return false;
- };
- /***/ }),
- /***/ 36495:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "h": () => (/* binding */ generateVerseKeysBetweenTwoVerseKeys),
- /* harmony export */ "p": () => (/* binding */ parseVerseRange)
- /* harmony export */ });
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64042);
- /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _chapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95892);
- /* eslint-disable react-func/max-lines-per-function */ /* eslint-disable import/prefer-default-export */
- /**
- * Generate the verse keys between two verse keys.
- *
- * @param {ChaptersData} chaptersData
- * @param {string} fromVerseKey
- * @param {string} toVerseKey
- * @returns {string[]}
- */ const generateVerseKeysBetweenTwoVerseKeys = (chaptersData, fromVerseKey, toVerseKey)=>{
- const verseKeys = [];
- const [startChapter, startVerse] = fromVerseKey.split(":");
- const [endChapter, endVerse] = toVerseKey.split(":");
- if (startChapter === endChapter) {
- lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(Number(startVerse), Number(endVerse) + 1).forEach((verseNumber)=>{
- verseKeys.push(`${startChapter}:${verseNumber}`);
- });
- } else {
- lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(Number(startChapter), Number(endChapter) + 1).forEach((chapterNumber)=>{
- if (chapterNumber === Number(startChapter)) {
- const chapterData = (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, startChapter);
- lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(Number(startVerse), chapterData.versesCount + 1).forEach((verseNumber)=>{
- verseKeys.push(`${startChapter}:${verseNumber}`);
- });
- } else if (chapterNumber === Number(endChapter)) {
- lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(1, Number(endVerse) + 1).forEach((verseNumber)=>{
- verseKeys.push(`${endChapter}:${verseNumber}`);
- });
- } else {
- const chapterData1 = (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, String(chapterNumber));
- lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(1, chapterData1.versesCount + 1).forEach((verseNumber)=>{
- verseKeys.push(`${chapterNumber}:${verseNumber}`);
- });
- }
- });
- }
- return verseKeys;
- };
- const parseVerseRange = (verseRange, parseAsNumbers)=>{
- const result = verseRange.match(/(\d+):(\d+)-(\d+):(\d+)/);
- if (!result) {
- return null;
- }
- const [, startChapter, startVerse, endChapter, endVerse] = result;
- if (!startChapter || !startVerse || !endChapter || !endVerse) {
- return null;
- }
- const parse = (value)=>parseAsNumbers ? Number(value) : value;
- return [
- {
- chapter: parse(startChapter),
- verse: parse(startVerse),
- verseKey: `${startChapter}:${startVerse}`
- },
- {
- chapter: parse(endChapter),
- verse: parse(endVerse),
- verseKey: `${endChapter}:${endVerse}`
- },
- ];
- };
- /***/ }),
- /***/ 11721:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- var QueryParam;
- (function(QueryParam) {
- QueryParam["Translations"] = "translations";
- QueryParam["Reciter"] = "reciter";
- QueryParam["WBW_LOCALE"] = "wbw_locale";
- QueryParam["HIDE_ARABIC"] = "hideArabic";
- QueryParam["FLOW"] = "flow";
- QueryParam["STARTING_VERSE"] = "startingVerse";
- QueryParam["QUERY"] = "query";
- QueryParam["REDIRECT_TO"] = "r";
- })(QueryParam || (QueryParam = {}));
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QueryParam);
- /***/ }),
- /***/ 50467:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "AN": () => (/* binding */ MushafLines),
- /* harmony export */ "Bc": () => (/* binding */ QuranReaderFlow),
- /* harmony export */ "MB": () => (/* binding */ WordClickFunctionality),
- /* harmony export */ "Oj": () => (/* binding */ WordByWordType),
- /* harmony export */ "PT": () => (/* binding */ WordByWordDisplay),
- /* harmony export */ "Qi": () => (/* binding */ QuranReaderDataType),
- /* harmony export */ "RA": () => (/* binding */ Mushaf),
- /* harmony export */ "fr": () => (/* binding */ QuranFont),
- /* harmony export */ "m3": () => (/* binding */ ReadingPreference),
- /* harmony export */ "ru": () => (/* binding */ QuranFontMushaf),
- /* harmony export */ "v3": () => (/* binding */ FALLBACK_FONT)
- /* harmony export */ });
- var WordByWordType;
- (function(WordByWordType) {
- WordByWordType["Translation"] = "translation";
- WordByWordType["Transliteration"] = "transliteration";
- })(WordByWordType || (WordByWordType = {}));
- var ReadingPreference;
- (function(ReadingPreference) {
- ReadingPreference["Translation"] = "translation";
- ReadingPreference["Reading"] = "reading";
- })(ReadingPreference || (ReadingPreference = {}));
- var WordClickFunctionality;
- (function(WordClickFunctionality) {
- WordClickFunctionality["PlayAudio"] = "play-audio";
- WordClickFunctionality["NoAudio"] = "no-audio";
- })(WordClickFunctionality || (WordClickFunctionality = {}));
- var QuranReaderDataType;
- (function(QuranReaderDataType) {
- QuranReaderDataType["Chapter"] = "chapter";
- QuranReaderDataType["Verse"] = "verse";
- QuranReaderDataType["ChapterVerseRanges"] = "chapterVerseRanges";
- QuranReaderDataType["Ranges"] = "ranges";
- QuranReaderDataType["Tafsir"] = "tafsir";
- QuranReaderDataType["SelectedTafsir"] = "selectedTafsir";
- QuranReaderDataType["Hizb"] = "hizb";
- QuranReaderDataType["Juz"] = "juz";
- QuranReaderDataType["Rub"] = "rub";
- QuranReaderDataType["Page"] = "page";
- })(QuranReaderDataType || (QuranReaderDataType = {}));
- var QuranFont;
- (function(QuranFont) {
- QuranFont["MadaniV1"] = "code_v1";
- QuranFont["MadaniV2"] = "code_v2";
- QuranFont["Uthmani"] = "text_uthmani";
- QuranFont["IndoPak"] = "text_indopak";
- QuranFont["QPCHafs"] = "qpc_uthmani_hafs";
- QuranFont["Tajweed"] = "tajweed";
- })(QuranFont || (QuranFont = {}));
- const FALLBACK_FONT = QuranFont.QPCHafs;
- var MushafLines;
- (function(MushafLines) {
- MushafLines["FifteenLines"] = "15_lines";
- MushafLines["SixteenLines"] = "16_lines";
- })(MushafLines || (MushafLines = {}));
- var Mushaf;
- (function(Mushaf) {
- Mushaf[Mushaf["QCFV2"] = 1] = "QCFV2";
- Mushaf[Mushaf["QCFV1"] = 2] = "QCFV1";
- Mushaf[Mushaf["Indopak"] = 3] = "Indopak";
- Mushaf[Mushaf["UthmaniHafs"] = 4] = "UthmaniHafs";
- Mushaf[Mushaf["KFGQPCHAFS"] = 5] = "KFGQPCHAFS";
- Mushaf[Mushaf["Indopak15Lines"] = 6] = "Indopak15Lines";
- Mushaf[Mushaf["Indopak16Lines"] = 7] = "Indopak16Lines";
- Mushaf[Mushaf["Tajweeed"] = 11] = "Tajweeed";
- })(Mushaf || (Mushaf = {}));
- const QuranFontMushaf = {
- [QuranFont.MadaniV1]: Mushaf.QCFV1,
- [QuranFont.MadaniV2]: Mushaf.QCFV2,
- [QuranFont.Uthmani]: Mushaf.UthmaniHafs,
- [QuranFont.IndoPak]: Mushaf.Indopak,
- [QuranFont.QPCHafs]: Mushaf.KFGQPCHAFS,
- [QuranFont.Tajweed]: Mushaf.Tajweeed
- };
- var WordByWordDisplay;
- (function(WordByWordDisplay) {
- WordByWordDisplay["INLINE"] = "inline";
- WordByWordDisplay["TOOLTIP"] = "tooltip";
- })(WordByWordDisplay || (WordByWordDisplay = {}));
- var QuranReaderFlow;
- (function(QuranReaderFlow) {
- QuranReaderFlow["QURANIC_CALENDER"] = "calendar";
- })(QuranReaderFlow || (QuranReaderFlow = {}));
- /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({
- ReadingPreference,
- QuranFont
- });
- /***/ }),
- /***/ 92086:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "N": () => (/* binding */ SearchMode)
- /* harmony export */ });
- var SearchMode;
- (function(SearchMode) {
- SearchMode["Advanced"] = "advanced";
- SearchMode["Quick"] = "quick";
- })(SearchMode || (SearchMode = {}));
- /***/ }),
- /***/ 64609:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- var SearchService;
- (function(SearchService) {
- SearchService["KALIMAT"] = "kalimat";
- SearchService["QDC"] = "qdc";
- SearchService["Tarteel"] = "tarteel";
- })(SearchService || (SearchService = {}));
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchService);
- /***/ }),
- /***/ 87582:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "H": () => (/* binding */ SearchNavigationType)
- /* harmony export */ });
- var SearchNavigationType;
- (function(SearchNavigationType) {
- SearchNavigationType["SURAH"] = "surah";
- SearchNavigationType["JUZ"] = "juz";
- SearchNavigationType["HIZB"] = "hizb";
- SearchNavigationType["AYAH"] = "ayah";
- SearchNavigationType["RUB_EL_HIZB"] = "rub_el_hizb";
- SearchNavigationType["SEARCH_PAGE"] = "search_page";
- SearchNavigationType["PAGE"] = "page";
- SearchNavigationType["RANGE"] = "range";
- })(SearchNavigationType || (SearchNavigationType = {}));
- /***/ }),
- /***/ 73634:
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- var SearchType;
- (function(SearchType) {
- SearchType["Voice"] = "voice";
- SearchType["Text"] = "text";
- })(SearchType || (SearchType = {}));
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchType);
- /***/ }),
- /***/ 70301:
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- var map = {
- "./ar": 59875,
- "./ar.ts": 59875,
- "./bn": 79395,
- "./bn.ts": 79395,
- "./en": 84835,
- "./en.ts": 84835,
- "./fa": 15412,
- "./fa.ts": 15412,
- "./fr": 30823,
- "./fr.ts": 30823,
- "./id": 41950,
- "./id.ts": 41950,
- "./it": 84443,
- "./it.ts": 84443,
- "./ms": 38195,
- "./ms.ts": 38195,
- "./nl": 10024,
- "./nl.ts": 10024,
- "./pt": 80563,
- "./pt.ts": 80563,
- "./ru": 23269,
- "./ru.ts": 23269,
- "./sq": 12586,
- "./sq.ts": 12586,
- "./th": 43222,
- "./th.ts": 43222,
- "./tr": 79896,
- "./tr.ts": 79896,
- "./ur": 80046,
- "./ur.ts": 80046,
- "./zh": 5492,
- "./zh.ts": 5492
- };
- function webpackContext(req) {
- var id = webpackContextResolve(req);
- return __webpack_require__(id);
- }
- function webpackContextResolve(req) {
- if(!__webpack_require__.o(map, req)) {
- var e = new Error("Cannot find module '" + req + "'");
- e.code = 'MODULE_NOT_FOUND';
- throw e;
- }
- return map[req];
- }
- webpackContext.keys = function webpackContextKeys() {
- return Object.keys(map);
- };
- webpackContext.resolve = webpackContextResolve;
- module.exports = webpackContext;
- webpackContext.id = 70301;
- /***/ })
- };
- ;
- //# sourceMappingURL=57933.js.map
|