57933.js 128 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175
  1. exports.id = 57933;
  2. exports.ids = [57933];
  3. exports.modules = {
  4. /***/ 62182:
  5. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  6. var map = {
  7. "./ar.json": [
  8. 70017,
  9. 70017
  10. ],
  11. "./bn.json": [
  12. 94149,
  13. 94149
  14. ],
  15. "./en.json": [
  16. 69029,
  17. 69029
  18. ],
  19. "./fa.json": [
  20. 53557,
  21. 53557
  22. ],
  23. "./fr.json": [
  24. 10229,
  25. 10229
  26. ],
  27. "./id.json": [
  28. 46833,
  29. 46833
  30. ],
  31. "./it.json": [
  32. 23577,
  33. 23577
  34. ],
  35. "./ms.json": [
  36. 21492,
  37. 21492
  38. ],
  39. "./nl.json": [
  40. 53802,
  41. 53802
  42. ],
  43. "./pt.json": [
  44. 74105,
  45. 74105
  46. ],
  47. "./ru.json": [
  48. 92390,
  49. 92390
  50. ],
  51. "./sq.json": [
  52. 72413,
  53. 72413
  54. ],
  55. "./th.json": [
  56. 6383,
  57. 6383
  58. ],
  59. "./tr.json": [
  60. 81115,
  61. 81115
  62. ],
  63. "./ur.json": [
  64. 92246,
  65. 92246
  66. ],
  67. "./zh.json": [
  68. 71119,
  69. 71119
  70. ]
  71. };
  72. function webpackAsyncContext(req) {
  73. if(!__webpack_require__.o(map, req)) {
  74. return Promise.resolve().then(() => {
  75. var e = new Error("Cannot find module '" + req + "'");
  76. e.code = 'MODULE_NOT_FOUND';
  77. throw e;
  78. });
  79. }
  80. var ids = map[req], id = ids[0];
  81. return __webpack_require__.e(ids[1]).then(() => {
  82. return __webpack_require__.t(id, 3 | 16);
  83. });
  84. }
  85. webpackAsyncContext.keys = () => (Object.keys(map));
  86. webpackAsyncContext.id = 62182;
  87. module.exports = webpackAsyncContext;
  88. /***/ }),
  89. /***/ 92684:
  90. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  91. "use strict";
  92. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  93. /* harmony export */ "BP": () => (/* binding */ getSearchResults),
  94. /* harmony export */ "Bz": () => (/* binding */ getAvailableLanguages),
  95. /* harmony export */ "Fp": () => (/* binding */ getHizbVerses),
  96. /* harmony export */ "H4": () => (/* binding */ getNewSearchResults),
  97. /* harmony export */ "IP": () => (/* binding */ getPagesLookup),
  98. /* harmony export */ "LE": () => (/* binding */ getRubVerses),
  99. /* harmony export */ "U0": () => (/* binding */ getChapterIdBySlug),
  100. /* harmony export */ "_i": () => (/* binding */ fetcher),
  101. /* harmony export */ "ei": () => (/* binding */ getFootnote),
  102. /* harmony export */ "iw": () => (/* binding */ getPageVerses),
  103. /* harmony export */ "ix": () => (/* binding */ getChapterVerses),
  104. /* harmony export */ "lt": () => (/* binding */ getChapterAudioData),
  105. /* harmony export */ "m0": () => (/* binding */ getJuzVerses),
  106. /* harmony export */ "tS": () => (/* binding */ getAvailableReciters),
  107. /* harmony export */ "vp": () => (/* binding */ getRangeVerses),
  108. /* harmony export */ "yH": () => (/* binding */ OFFLINE_ERROR),
  109. /* harmony export */ "yZ": () => (/* binding */ getAvailableTranslations),
  110. /* harmony export */ "zg": () => (/* binding */ getChapterInfo),
  111. /* harmony export */ "zm": () => (/* binding */ getReciterData)
  112. /* harmony export */ });
  113. /* unused harmony exports SEARCH_FETCH_OPTIONS, getAvailableWordByWordTranslations, getVerseTimestamps, getTranslationsInfo, getAdvancedCopyRawResult, getTafsirs, getChapter, getTafsirContent */
  114. /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59606);
  115. /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(humps__WEBPACK_IMPORTED_MODULE_0__);
  116. /* harmony import */ var _utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(46127);
  117. /* eslint-disable max-lines */
  118. const SEARCH_FETCH_OPTIONS = {
  119. headers: {
  120. // eslint-disable-next-line @typescript-eslint/naming-convention
  121. "x-api-key": process.env.NEXT_PUBLIC_SEARCH_API_KEY
  122. }
  123. };
  124. const OFFLINE_ERROR = "OFFLINE";
  125. const fetcher = async function fetcher(input, init) {
  126. // if the user is not online when making the API call
  127. if (false) {}
  128. const res = await fetch(input, init);
  129. if (!res.ok || res.status === 500 || res.status === 404) {
  130. throw res;
  131. }
  132. const json = await res.json();
  133. return (0,humps__WEBPACK_IMPORTED_MODULE_0__.camelizeKeys)(json);
  134. };
  135. const getChapterVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeVersesUrl */ .ML)(id, locale, params));
  136. const getRangeVerses = async (locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeByRangeVersesUrl */ .Eo)(locale, params));
  137. /**
  138. * Get the current available translations with the name translated in the current language.
  139. *
  140. * @param {string} language we use this to get translated names of authors in specific the current language.
  141. *
  142. * @returns {Promise<TranslationsResponse>}
  143. */ const getAvailableTranslations = async (language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeTranslationsUrl */ .c7)(language));
  144. /**
  145. * Get the current available wbw translations with the name translated in the current language.
  146. *
  147. * @param {string} language we use this to get translated names of authors in specific the current language.
  148. *
  149. * @returns {Promise<WordByWordTranslationsResponse>}
  150. */ const getAvailableWordByWordTranslations = async (language)=>fetcher(makeWordByWordTranslationsUrl(language));
  151. /**
  152. * Get the current available languages with the name translated in the current language.
  153. *
  154. * @param {string} language we use this to get language names in specific the current language.
  155. *
  156. * @returns {Promise<LanguagesResponse>}
  157. */ const getAvailableLanguages = async (language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeLanguagesUrl */ .G1)(language));
  158. /**
  159. * Get list of available reciters.
  160. *
  161. * @param {string} locale the locale.
  162. *
  163. * @returns {Promise<RecitersResponse>}
  164. */ const getAvailableReciters = async (locale, fields)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeAvailableRecitersUrl */ .jL)(locale, fields));
  165. const getReciterData = async (reciterId, locale)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeReciterUrl */ .Sn)(reciterId, locale));
  166. /**
  167. * Get audio file for a specific reciter and chapter.
  168. * additionally you can pass `segment: true` to get the timestamps
  169. * for each verse and words
  170. *
  171. * @param {number} reciterId
  172. * @param {number} chapter the id of the chapter
  173. */ const getChapterAudioData = async (reciterId, chapter, segments = false)=>{
  174. const res = await fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeChapterAudioDataUrl */ .$6)(reciterId, chapter, segments));
  175. if (res.error) {
  176. throw new Error(res.error);
  177. }
  178. if (res.status === 500) {
  179. throw new Error("server error: fail to get audio file");
  180. }
  181. const { audioFiles: audioData } = res;
  182. const [firstAudio] = audioData;
  183. if (!firstAudio) {
  184. throw new Error("No audio file found");
  185. }
  186. return {
  187. ...firstAudio,
  188. reciterId
  189. };
  190. };
  191. /**
  192. * Get the timestamps for a specific verseKey.
  193. * We need this to select to move the cursor in the audio player when we click "play" in a specific verse.
  194. *
  195. * @param {number} reciterId
  196. * @param {number} verseKey example "1:1", meaning chapter 1, verse 1
  197. * @returns {Promise<AudioTimestampsResponse>}
  198. */ const getVerseTimestamps = async (reciterId, verseKey)=>fetcher(makeAudioTimestampsUrl(reciterId, verseKey));
  199. /**
  200. * Get the information of translations by their IDs.
  201. *
  202. * @param {string} locale the current user locale.
  203. * @param {number[]} translations the ids of the translations selected.
  204. * @returns {Promise<TranslationsResponse>}
  205. */ const getTranslationsInfo = async (locale, translations)=>fetcher(makeTranslationsInfoUrl(locale, translations));
  206. /**
  207. * Get the advanced copy content that will be copied to clipboard and put in a file.
  208. *
  209. * @param {AdvancedCopyRequest} params
  210. * @returns {Promise<AdvancedCopyRawResultResponse>}
  211. */ const getAdvancedCopyRawResult = async (params)=>fetcher(makeAdvancedCopyUrl(params));
  212. /**
  213. * Get the search results of a query.
  214. *
  215. * @param {SearchRequest} params
  216. * @returns {Promise<SearchResponse>}
  217. */ const getSearchResults = async (params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeSearchResultsUrl */ ["do"])(params));
  218. /**
  219. * Get the search results of a query.
  220. *
  221. * @param {SearchRequestParams} params
  222. * @returns {Promise<NewSearchResponse>}
  223. */ const getNewSearchResults = async (params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeNewSearchResultsUrl */ .UC)(params), SEARCH_FETCH_OPTIONS);
  224. /**
  225. * Get the list of tafsirs.
  226. *
  227. * @param {string} language
  228. * @returns {Promise<TafsirsResponse>}
  229. */ const getTafsirs = async (language)=>fetcher(makeTafsirsUrl(language));
  230. /**
  231. * Get a chapter's info
  232. *
  233. * @param {string} chapterId
  234. * @param {string} language
  235. * @returns {Promise<ChapterInfoResponse>}
  236. */ const getChapterInfo = async (chapterId, language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeChapterInfoUrl */ .Iq)(chapterId, language));
  237. /**
  238. * Get a chapter's.
  239. *
  240. * @param {string} chapterIdOrSlug
  241. * @param {string} language
  242. * @returns {Promise<ChapterInfoResponse>}
  243. */ const getChapter = async (chapterIdOrSlug, language)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeChapterUrl */ .ME)(chapterIdOrSlug, language));
  244. /**
  245. * Get the verses of a specific Juz.
  246. *
  247. * @param {string} id the ID of the Juz.
  248. * @param {string} locale the locale.
  249. * @param {string} params the params that we might need to include that differs from the default ones.
  250. *
  251. * @returns {Promise<VersesResponse>}
  252. */ const getJuzVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeJuzVersesUrl */ .IC)(id, locale, params));
  253. /**
  254. * Get the verses of a specific Rub El Hizb.
  255. *
  256. * @param {string} id the ID of the Rub El Hizb.
  257. * @param {string} locale the locale.
  258. * @param {string} params the params that we might need to include that differs from the default ones.
  259. *
  260. * @returns {Promise<VersesResponse>}
  261. */ const getRubVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeRubVersesUrl */ .Im)(id, locale, params));
  262. /**
  263. * Get the verses of a specific Hizb.
  264. *
  265. * @param {string} id the ID of the Hizb.
  266. * @param {string} locale the locale.
  267. * @param {string} params the params that we might need to include that differs from the default ones.
  268. *
  269. * @returns {Promise<VersesResponse>}
  270. */ const getHizbVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeHizbVersesUrl */ .Y8)(id, locale, params));
  271. /**
  272. * Get the verses of a specific page.
  273. *
  274. * @param {string} id the ID of the page.
  275. * @param {string} locale the locale.
  276. * @param {string} params the params that we might need to include that differs from the default ones.
  277. *
  278. * @returns {Promise<VersesResponse>}
  279. */ const getPageVerses = async (id, locale, params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makePageVersesUrl */ .K2)(id, locale, params));
  280. /**
  281. * Get the footnote details.
  282. *
  283. * @param {string} footnoteId the ID of the footnote.
  284. *
  285. * @returns {Promise<FootnoteResponse>}
  286. */ const getFootnote = async (footnoteId)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makeFootnoteUrl */ .OT)(footnoteId));
  287. /**
  288. * Get the footnote details.
  289. *
  290. * @param {PagesLookUpRequest} params
  291. *
  292. * @returns {Promise<PagesLookUpResponse>}
  293. */ const getPagesLookup = async (params)=>fetcher((0,_utils_apiPaths__WEBPACK_IMPORTED_MODULE_1__/* .makePagesLookupUrl */ .I$)(params));
  294. /**
  295. * Get the chapter id by a slug.
  296. *
  297. * @param {string} slug
  298. * @param {string} locale
  299. * @returns {Promise<false|string>}
  300. */ const getChapterIdBySlug = async (slug, locale)=>{
  301. try {
  302. const chapterResponse = await getChapter(encodeURI(slug), locale);
  303. return chapterResponse.chapter.id;
  304. } catch (error) {
  305. return false;
  306. }
  307. };
  308. /**
  309. * Get the Tafsir content of a verse by the tafsir ID.
  310. *
  311. * @param {string} tafsirIdOrSlug
  312. * @param {string} verseKey
  313. * @param {QuranFont} quranFont
  314. * @param {MushafLines} mushafLines
  315. * @returns {Promise<TafsirContentResponse>}
  316. */ const getTafsirContent = (tafsirIdOrSlug, verseKey, quranFont, mushafLines, locale)=>{
  317. return fetcher(makeTafsirContentUrl(tafsirIdOrSlug, verseKey, {
  318. lang: locale,
  319. quranFont,
  320. mushafLines
  321. }));
  322. };
  323. /***/ }),
  324. /***/ 92099:
  325. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  326. "use strict";
  327. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  328. __webpack_require__.r(__webpack_exports__);
  329. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  330. /* harmony export */ "analytics": () => (/* binding */ analytics),
  331. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
  332. /* harmony export */ "isFirebaseEnabled": () => (/* binding */ isFirebaseEnabled)
  333. /* harmony export */ });
  334. /* harmony import */ var firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33773);
  335. /* harmony import */ var firebase_compat_analytics__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(88813);
  336. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__, firebase_compat_analytics__WEBPACK_IMPORTED_MODULE_1__]);
  337. ([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__);
  338. const firebaseConfig = {
  339. apiKey: process.env.NEXT_PUBLIC_FS_API_KEY,
  340. authDomain: process.env.NEXT_PUBLIC_FS_AUTH_DOMAIN,
  341. projectId: process.env.NEXT_PUBLIC_FS_PROJECT_ID,
  342. storageBucket: process.env.NEXT_PUBLIC_FS_STORAGE_BUCKET,
  343. messagingSenderId: process.env.NEXT_PUBLIC_FS_MESSAGING_SENDER_ID,
  344. appId: process.env.NEXT_PUBLIC_FS_APP_ID,
  345. measurementId: process.env.NEXT_PUBLIC_FS_MEASUREMENT_ID
  346. };
  347. const isFirebaseEnabled = false && 0;
  348. if (!firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"].apps.length) {
  349. firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"].initializeApp(firebaseConfig);
  350. }
  351. const analytics = ()=>{
  352. if (isFirebaseEnabled) {
  353. return firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"].analytics();
  354. }
  355. return null;
  356. };
  357. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (firebase_compat_app__WEBPACK_IMPORTED_MODULE_0__["default"]);
  358. __webpack_async_result__();
  359. } catch(e) { __webpack_async_result__(e); } });
  360. /***/ }),
  361. /***/ 11854:
  362. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  363. "use strict";
  364. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  365. /* harmony export */ "YS": () => (/* binding */ DEFAULT_RECITER),
  366. /* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__),
  367. /* harmony export */ "hw": () => (/* binding */ DEFAULT_XSTATE_INITIAL_STATE),
  368. /* harmony export */ "j7": () => (/* binding */ DEFAULT_TAFSIRS)
  369. /* harmony export */ });
  370. /* unused harmony export DEFAULT_TRANSLATIONS */
  371. /* harmony import */ var _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61243);
  372. /* harmony import */ var _redux_types_ThemeType__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79265);
  373. /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50467);
  374. // Tafsir Ibn Kathir in English
  375. const DEFAULT_TAFSIRS = [
  376. "en-tafisr-ibn-kathir"
  377. ];
  378. const DEFAULT_RECITER = {
  379. id: 7,
  380. name: "Mishari Rashid al-`Afasy",
  381. recitationStyle: "Warsh",
  382. relativePath: "mishaari_raashid_al_3afaasee"
  383. };
  384. const TAFSIRS_INITIAL_STATE = {
  385. selectedTafsirs: DEFAULT_TAFSIRS,
  386. isUsingDefaultTafsirs: true
  387. };
  388. const DEFAULT_TRANSLATIONS = [
  389. 131
  390. ]; // Dr. Mustafa Khattab, the Clear Quran
  391. const TRANSLATIONS_INITIAL_STATE = {
  392. selectedTranslations: DEFAULT_TRANSLATIONS,
  393. isUsingDefaultTranslations: true
  394. };
  395. const QURAN_READER_STYLES_INITIAL_STATE = {
  396. // the base sizes in rem
  397. tafsirFontScale: 3,
  398. quranTextFontScale: 3,
  399. translationFontScale: 3,
  400. wordByWordFontScale: 3,
  401. quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.MadaniV1 */ .fr.MadaniV1,
  402. mushafLines: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .MushafLines.SixteenLines */ .AN.SixteenLines,
  403. isUsingDefaultFont: true
  404. };
  405. const DEFAULT_WBW_LOCALE = "en";
  406. const READING_PREFERENCES_INITIAL_STATE = {
  407. readingPreference: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .ReadingPreference.Translation */ .m3.Translation,
  408. selectedWordByWordLocale: DEFAULT_WBW_LOCALE,
  409. isUsingDefaultWordByWordLocale: true,
  410. wordByWordContentType: [
  411. types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .WordByWordType.Translation */ .Oj.Translation
  412. ],
  413. wordByWordDisplay: [
  414. types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .WordByWordDisplay.TOOLTIP */ .PT.TOOLTIP
  415. ],
  416. wordClickFunctionality: types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .WordClickFunctionality.PlayAudio */ .MB.PlayAudio
  417. };
  418. const THEME_INITIAL_STATE = {
  419. type: _redux_types_ThemeType__WEBPACK_IMPORTED_MODULE_1__/* ["default"].Auto */ .Z.Auto
  420. };
  421. const AUDIO_INITIAL_STATE = {
  422. enableAutoScrolling: true,
  423. isDownloadingAudio: false,
  424. showTooltipWhenPlayingAudio: false
  425. };
  426. const DEFAULT_XSTATE_INITIAL_STATE = {
  427. playbackRate: 1,
  428. reciterId: DEFAULT_RECITER.id,
  429. volume: 1
  430. };
  431. const NOTIFICATIONS_INITIAL_STATE = {
  432. notifications: [],
  433. paginatedNotifications: {},
  434. isFetchingNotifications: false,
  435. isLoadingNotifications: false,
  436. unseenCount: 0
  437. };
  438. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  439. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].THEME */ .Z.THEME]: THEME_INITIAL_STATE,
  440. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].READING_PREFERENCES */ .Z.READING_PREFERENCES]: READING_PREFERENCES_INITIAL_STATE,
  441. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].QURAN_READER_STYLES */ .Z.QURAN_READER_STYLES]: QURAN_READER_STYLES_INITIAL_STATE,
  442. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRANSLATIONS */ .Z.TRANSLATIONS]: TRANSLATIONS_INITIAL_STATE,
  443. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TAFSIRS */ .Z.TAFSIRS]: TAFSIRS_INITIAL_STATE,
  444. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].AUDIO_PLAYER_STATE */ .Z.AUDIO_PLAYER_STATE]: AUDIO_INITIAL_STATE,
  445. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].NOTIFICATIONS */ .Z.NOTIFICATIONS]: NOTIFICATIONS_INITIAL_STATE
  446. });
  447. /***/ }),
  448. /***/ 59875:
  449. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  450. "use strict";
  451. __webpack_require__.r(__webpack_exports__);
  452. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  453. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  454. /* harmony export */ });
  455. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  456. /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467);
  457. const DEFAULT_TAFSIR = "ar-tafseer-al-qurtubi";
  458. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  459. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  460. tafsirs: {
  461. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs,
  462. selectedTafsirs: [
  463. DEFAULT_TAFSIR
  464. ]
  465. },
  466. translations: {
  467. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  468. selectedTranslations: []
  469. },
  470. readingPreferences: {
  471. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences,
  472. readingPreference: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .ReadingPreference.Reading */ .m3.Reading
  473. }
  474. });
  475. /***/ }),
  476. /***/ 79395:
  477. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  478. "use strict";
  479. __webpack_require__.r(__webpack_exports__);
  480. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  481. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  482. /* harmony export */ });
  483. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  484. /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467);
  485. const DEFAULT_TRANSLATION = 161; // Taisirul Quran
  486. const DEFAULT_TAFSIR = "bn-tafsir-ahsanul-bayaan"; // Tafsir Ahsanul Bayaan
  487. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  488. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  489. quranReaderStyles: {
  490. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].quranReaderStyles */ .ZP.quranReaderStyles,
  491. quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .QuranFont.IndoPak */ .fr.IndoPak
  492. },
  493. readingPreferences: {
  494. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences,
  495. selectedWordByWordLocale: "bn"
  496. },
  497. tafsirs: {
  498. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs,
  499. selectedTafsirs: [
  500. DEFAULT_TAFSIR
  501. ]
  502. },
  503. translations: {
  504. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  505. selectedTranslations: [
  506. DEFAULT_TRANSLATION
  507. ]
  508. }
  509. });
  510. /***/ }),
  511. /***/ 84835:
  512. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  513. "use strict";
  514. __webpack_require__.r(__webpack_exports__);
  515. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  516. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  517. /* harmony export */ });
  518. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  519. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP);
  520. /***/ }),
  521. /***/ 15412:
  522. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  523. "use strict";
  524. __webpack_require__.r(__webpack_exports__);
  525. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  526. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  527. /* harmony export */ });
  528. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  529. const DEFAULT_TRANSLATION = 29; // Hussein Taji
  530. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  531. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  532. translations: {
  533. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  534. selectedTranslations: [
  535. DEFAULT_TRANSLATION
  536. ]
  537. }
  538. });
  539. /***/ }),
  540. /***/ 30823:
  541. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  542. "use strict";
  543. __webpack_require__.r(__webpack_exports__);
  544. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  545. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  546. /* harmony export */ });
  547. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  548. const DEFAULT_TRANSLATION = 31; // Muhammad Hamidullah
  549. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  550. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  551. translations: {
  552. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  553. selectedTranslations: [
  554. DEFAULT_TRANSLATION
  555. ]
  556. }
  557. });
  558. /***/ }),
  559. /***/ 41950:
  560. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  561. "use strict";
  562. __webpack_require__.r(__webpack_exports__);
  563. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  564. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  565. /* harmony export */ });
  566. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  567. /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467);
  568. const DEFAULT_TRANSLATION = 33; // Indonesian Islamic affairs ministry
  569. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  570. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  571. readingPreferences: {
  572. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences,
  573. selectedWordByWordLocale: "id"
  574. },
  575. quranReaderStyles: {
  576. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].quranReaderStyles */ .ZP.quranReaderStyles,
  577. quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .QuranFont.IndoPak */ .fr.IndoPak
  578. },
  579. translations: {
  580. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  581. selectedTranslations: [
  582. DEFAULT_TRANSLATION
  583. ]
  584. }
  585. });
  586. /***/ }),
  587. /***/ 84443:
  588. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  589. "use strict";
  590. __webpack_require__.r(__webpack_exports__);
  591. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  592. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  593. /* harmony export */ });
  594. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  595. const DEFAULT_TRANSLATION = 153; // Hamza Roberto Piccardo
  596. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  597. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  598. translations: {
  599. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  600. selectedTranslations: [
  601. DEFAULT_TRANSLATION
  602. ]
  603. }
  604. });
  605. /***/ }),
  606. /***/ 38195:
  607. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  608. "use strict";
  609. __webpack_require__.r(__webpack_exports__);
  610. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  611. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  612. /* harmony export */ });
  613. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  614. const DEFAULT_TRANSLATION = 39; // Abdullah Muhammad Basmeih
  615. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  616. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  617. translations: {
  618. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  619. selectedTranslations: [
  620. DEFAULT_TRANSLATION
  621. ]
  622. }
  623. });
  624. /***/ }),
  625. /***/ 10024:
  626. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  627. "use strict";
  628. __webpack_require__.r(__webpack_exports__);
  629. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  630. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  631. /* harmony export */ });
  632. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  633. const DEFAULT_TRANSLATION = 144; // Sofian S. Siregar
  634. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  635. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  636. translations: {
  637. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  638. selectedTranslations: [
  639. DEFAULT_TRANSLATION
  640. ]
  641. }
  642. });
  643. /***/ }),
  644. /***/ 80563:
  645. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  646. "use strict";
  647. __webpack_require__.r(__webpack_exports__);
  648. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  649. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  650. /* harmony export */ });
  651. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  652. const DEFAULT_TRANSLATION = 43; // Samir
  653. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  654. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  655. translations: {
  656. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  657. selectedTranslations: [
  658. DEFAULT_TRANSLATION
  659. ]
  660. }
  661. });
  662. /***/ }),
  663. /***/ 23269:
  664. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  665. "use strict";
  666. __webpack_require__.r(__webpack_exports__);
  667. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  668. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  669. /* harmony export */ });
  670. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  671. const DEFAULT_TRANSLATION = 45; // Elmir Kuliev
  672. const DEFAULT_TAFSIR = "ru-tafseer-al-saddi"; // Russian Tafseer Al Saddi
  673. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  674. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  675. translations: {
  676. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  677. selectedTranslations: [
  678. DEFAULT_TRANSLATION
  679. ]
  680. },
  681. tafsirs: {
  682. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs,
  683. selectedTafsirs: [
  684. DEFAULT_TAFSIR
  685. ]
  686. }
  687. });
  688. /***/ }),
  689. /***/ 12586:
  690. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  691. "use strict";
  692. __webpack_require__.r(__webpack_exports__);
  693. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  694. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  695. /* harmony export */ });
  696. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  697. const DEFAULT_TRANSLATION = 47; // Albanian
  698. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  699. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  700. translations: {
  701. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  702. selectedTranslations: [
  703. DEFAULT_TRANSLATION
  704. ]
  705. }
  706. });
  707. /***/ }),
  708. /***/ 43222:
  709. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  710. "use strict";
  711. __webpack_require__.r(__webpack_exports__);
  712. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  713. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  714. /* harmony export */ });
  715. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  716. const DEFAULT_TRANSLATION = 230; // Society of Institutes and Universities
  717. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  718. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  719. translations: {
  720. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  721. selectedTranslations: [
  722. DEFAULT_TRANSLATION
  723. ]
  724. }
  725. });
  726. /***/ }),
  727. /***/ 79896:
  728. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  729. "use strict";
  730. __webpack_require__.r(__webpack_exports__);
  731. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  732. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  733. /* harmony export */ });
  734. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  735. const DEFAULT_TRANSLATION = 77; // Diyanet
  736. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  737. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  738. translations: {
  739. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  740. selectedTranslations: [
  741. DEFAULT_TRANSLATION
  742. ]
  743. }
  744. });
  745. /***/ }),
  746. /***/ 80046:
  747. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  748. "use strict";
  749. __webpack_require__.r(__webpack_exports__);
  750. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  751. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  752. /* harmony export */ });
  753. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  754. /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(50467);
  755. const DEFAULT_TRANSLATION = 158; // Bayan Ul Quran
  756. const DEFAULT_TAFSIR = "tafseer-ibn-e-kaseer-urdu"; // Bayan ul Quran
  757. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  758. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  759. quranReaderStyles: {
  760. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].quranReaderStyles */ .ZP.quranReaderStyles,
  761. quranFont: types_QuranReader__WEBPACK_IMPORTED_MODULE_1__/* .QuranFont.IndoPak */ .fr.IndoPak
  762. },
  763. readingPreferences: {
  764. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].readingPreferences */ .ZP.readingPreferences,
  765. selectedWordByWordLocale: "ur"
  766. },
  767. translations: {
  768. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  769. selectedTranslations: [
  770. DEFAULT_TRANSLATION
  771. ]
  772. },
  773. tafsirs: {
  774. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].tafsirs */ .ZP.tafsirs,
  775. selectedTafsirs: [
  776. DEFAULT_TAFSIR
  777. ]
  778. }
  779. });
  780. /***/ }),
  781. /***/ 5492:
  782. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  783. "use strict";
  784. __webpack_require__.r(__webpack_exports__);
  785. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  786. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  787. /* harmony export */ });
  788. /* harmony import */ var _defaultSettings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11854);
  789. const DEFAULT_TRANSLATION = 56; // Ma Jain
  790. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  791. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP,
  792. translations: {
  793. ..._defaultSettings__WEBPACK_IMPORTED_MODULE_0__/* ["default"].translations */ .ZP.translations,
  794. selectedTranslations: [
  795. DEFAULT_TRANSLATION
  796. ]
  797. }
  798. });
  799. /***/ }),
  800. /***/ 17241:
  801. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  802. "use strict";
  803. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  804. /* harmony export */ "$t": () => (/* binding */ getNotificationsInitialState),
  805. /* harmony export */ "Fy": () => (/* binding */ getTafsirsInitialState),
  806. /* harmony export */ "aq": () => (/* binding */ getAudioPlayerStateInitialState),
  807. /* harmony export */ "h0": () => (/* binding */ getTranslationsInitialState),
  808. /* harmony export */ "iF": () => (/* binding */ getLocaleInitialState),
  809. /* harmony export */ "kq": () => (/* binding */ getQuranReaderStylesInitialState),
  810. /* harmony export */ "r2": () => (/* binding */ getStoreInitialState),
  811. /* harmony export */ "wH": () => (/* binding */ getReadingPreferencesInitialState),
  812. /* harmony export */ "yO": () => (/* binding */ getThemeInitialState)
  813. /* harmony export */ });
  814. /* harmony import */ var _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61243);
  815. /* eslint-disable import/no-dynamic-require */ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable global-require */
  816. /**
  817. * Get the initial state of the store.
  818. *
  819. * @param {string} locale
  820. * @returns {RootState}
  821. */ const getStoreInitialState = (locale)=>{
  822. return {
  823. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].THEME */ .Z.THEME]: getThemeInitialState(locale),
  824. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].READING_PREFERENCES */ .Z.READING_PREFERENCES]: getReadingPreferencesInitialState(locale),
  825. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].QURAN_READER_STYLES */ .Z.QURAN_READER_STYLES]: getQuranReaderStylesInitialState(locale),
  826. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRANSLATIONS */ .Z.TRANSLATIONS]: getTranslationsInitialState(locale),
  827. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TAFSIRS */ .Z.TAFSIRS]: getTafsirsInitialState(locale),
  828. // @ts-ignore
  829. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].AUDIO_PLAYER_STATE */ .Z.AUDIO_PLAYER_STATE]: getAudioPlayerStateInitialState(locale),
  830. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].DEFAULT_SETTINGS */ .Z.DEFAULT_SETTINGS]: {
  831. isUsingDefaultSettings: true
  832. },
  833. [_redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].NOTIFICATIONS */ .Z.NOTIFICATIONS]: getNotificationsInitialState(locale)
  834. };
  835. };
  836. const DEFAULT_LOCALE = "en";
  837. /**
  838. * Dynamically load the default settings of the locale passed.
  839. *
  840. * @param {string} locale
  841. * @returns {DefaultSettings}
  842. */ const importLocaleFile = (locale)=>__webpack_require__(70301)(`./${locale}`).default;
  843. /**
  844. * Get specific settings by its key for a locale.
  845. * e.g. get the settings for theme by the key 'theme'.
  846. *
  847. * @param {string} locale
  848. * @param {string} key
  849. * @returns {any}
  850. */ const getLocaleInitialStateByKey = (locale, key)=>importLocaleFile(locale)[key];
  851. const getLocaleInitialState = (locale)=>importLocaleFile(locale);
  852. const getThemeInitialState = (locale = DEFAULT_LOCALE)=>{
  853. return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].THEME */ .Z.THEME);
  854. };
  855. const getReadingPreferencesInitialState = (locale = DEFAULT_LOCALE)=>{
  856. return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].READING_PREFERENCES */ .Z.READING_PREFERENCES);
  857. };
  858. const getQuranReaderStylesInitialState = (locale = DEFAULT_LOCALE)=>{
  859. return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].QURAN_READER_STYLES */ .Z.QURAN_READER_STYLES);
  860. };
  861. const getTranslationsInitialState = (locale = DEFAULT_LOCALE)=>{
  862. return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TRANSLATIONS */ .Z.TRANSLATIONS);
  863. };
  864. const getTafsirsInitialState = (locale = DEFAULT_LOCALE)=>{
  865. return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].TAFSIRS */ .Z.TAFSIRS);
  866. };
  867. const getAudioPlayerStateInitialState = (locale = DEFAULT_LOCALE)=>{
  868. return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].AUDIO_PLAYER_STATE */ .Z.AUDIO_PLAYER_STATE);
  869. };
  870. const getNotificationsInitialState = (locale = DEFAULT_LOCALE)=>{
  871. return getLocaleInitialStateByKey(locale, _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_0__/* ["default"].NOTIFICATIONS */ .Z.NOTIFICATIONS);
  872. };
  873. /***/ }),
  874. /***/ 85895:
  875. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  876. "use strict";
  877. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  878. /* harmony export */ "ZP": () => (__WEBPACK_DEFAULT_EXPORT__),
  879. /* harmony export */ "ag": () => (/* binding */ selectSearchHistory),
  880. /* harmony export */ "rd": () => (/* binding */ removeSearchHistoryRecord),
  881. /* harmony export */ "zr": () => (/* binding */ addSearchHistoryRecord)
  882. /* harmony export */ });
  883. /* unused harmony export searchSlice */
  884. /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(75184);
  885. /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__);
  886. /* harmony import */ var _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61243);
  887. const initialState = {
  888. searchHistory: []
  889. };
  890. const MAXIMUM_RECENT_SEARCH_QUERIES = 5;
  891. const searchSlice = (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_0__.createSlice)({
  892. name: _redux_types_SliceName__WEBPACK_IMPORTED_MODULE_1__/* ["default"].SEARCH */ .Z.SEARCH,
  893. initialState,
  894. reducers: {
  895. addSearchHistoryRecord: (state, action)=>{
  896. let newSearchHistory = [
  897. ...state.searchHistory
  898. ];
  899. const newSearchQuery = action.payload;
  900. // if we have reached the maximum number of search queries, remove the last element
  901. if (state.searchHistory.length >= MAXIMUM_RECENT_SEARCH_QUERIES) {
  902. // splice will mutate newSearchHistory and remove the last element
  903. newSearchHistory.splice(-1);
  904. }
  905. // filter out the old search queries that match the new search queries (if any).
  906. newSearchHistory = newSearchHistory.filter((currentSearchQuery)=>currentSearchQuery !== newSearchQuery);
  907. // put the new search query at the beginning of the array
  908. newSearchHistory = [
  909. newSearchQuery,
  910. ...newSearchHistory
  911. ];
  912. return {
  913. ...state,
  914. searchHistory: newSearchHistory
  915. };
  916. },
  917. removeSearchHistoryRecord: (state, action)=>{
  918. // filter out the search queries from the current search queries array.
  919. const newSearchHistory = [
  920. ...state.searchHistory
  921. ].filter((currentSearchQuery)=>currentSearchQuery !== action.payload);
  922. return {
  923. ...state,
  924. searchHistory: newSearchHistory
  925. };
  926. }
  927. }
  928. });
  929. const { addSearchHistoryRecord , removeSearchHistoryRecord } = searchSlice.actions;
  930. const selectSearchHistory = (state)=>state.search.searchHistory;
  931. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (searchSlice.reducer);
  932. /***/ }),
  933. /***/ 61243:
  934. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  935. "use strict";
  936. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  937. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  938. /* harmony export */ });
  939. var SliceName;
  940. (function(SliceName) {
  941. SliceName["THEME"] = "theme";
  942. SliceName["READING_PREFERENCES"] = "readingPreferences";
  943. SliceName["QURAN_READER_STYLES"] = "quranReaderStyles";
  944. SliceName["TRANSLATIONS"] = "translations";
  945. SliceName["TAFSIRS"] = "tafsirs";
  946. SliceName["AUDIO_PLAYER_STATE"] = "audioPlayerState";
  947. SliceName["DEFAULT_SETTINGS"] = "defaultSettings";
  948. SliceName["BANNER"] = "banner";
  949. SliceName["NAVBAR"] = "navbar";
  950. SliceName["SESSION"] = "session";
  951. SliceName["BOOKMARKS"] = "bookmarks";
  952. SliceName["VOICE_SEARCH"] = "voiceSearch";
  953. SliceName["WELCOME_MESSAGE"] = "welcomeMessage";
  954. SliceName["COMMAND_BAR"] = "commandBar";
  955. SliceName["CONTEXT_MENU"] = "contextMenu";
  956. SliceName["FONT_FACES"] = "fontFaces";
  957. SliceName["NOTES"] = "notes";
  958. SliceName["READING_TRACKER"] = "readingTracker";
  959. SliceName["READING_VIEW_HOVERED_VERSE"] = "readingViewHoveredVerse";
  960. SliceName["SIDEBAR_NAVIGATION"] = "sidebarNavigation";
  961. SliceName["SEARCH"] = "search";
  962. SliceName["LOCALE"] = "locale";
  963. SliceName["USER_DATA_SYNC"] = "userDataSync";
  964. SliceName["PERSIST_GATE_HYDRATION"] = "persistGateHydration";
  965. SliceName["REVELATION_ORDER"] = "revelationOrder";
  966. SliceName["NOTIFICATIONS"] = "notifications";
  967. SliceName["ONBOARDING"] = "onboarding";
  968. })(SliceName || (SliceName = {}));
  969. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SliceName);
  970. /***/ }),
  971. /***/ 79265:
  972. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  973. "use strict";
  974. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  975. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  976. /* harmony export */ });
  977. var ThemeType;
  978. (function(ThemeType) {
  979. ThemeType["Auto"] = "auto";
  980. ThemeType["Light"] = "light";
  981. ThemeType["Sepia"] = "sepia";
  982. ThemeType["Dark"] = "dark";
  983. })(ThemeType || (ThemeType = {}));
  984. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ThemeType);
  985. /***/ }),
  986. /***/ 4917:
  987. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  988. "use strict";
  989. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  990. /* harmony export */ "$P": () => (/* binding */ getMushafId),
  991. /* harmony export */ "H": () => (/* binding */ API_HOST),
  992. /* harmony export */ "bf": () => (/* binding */ makeUrl),
  993. /* harmony export */ "gK": () => (/* binding */ ITEMS_PER_PAGE),
  994. /* harmony export */ "hD": () => (/* binding */ getDefaultWordFields)
  995. /* harmony export */ });
  996. /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59606);
  997. /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(humps__WEBPACK_IMPORTED_MODULE_0__);
  998. /* harmony import */ var _qs_stringify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(99921);
  999. /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50467);
  1000. const ITEMS_PER_PAGE = 10;
  1001. const STAGING_API_HOST = "https://staging.quran.com";
  1002. const PRODUCTION_API_HOST = "https://api.qurancdn.com";
  1003. const API_ROOT_PATH = "/api/qdc";
  1004. // 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
  1005. const API_HOST = process.env.NEXT_PUBLIC_VERCEL_ENV === "production" ? PRODUCTION_API_HOST : STAGING_API_HOST;
  1006. /**
  1007. * Generates a url to make an api call to our backend
  1008. *
  1009. * @param {string} path the path for the call
  1010. * @param {Record<string, unknown>} parameters optional query params, {a: 1, b: 2} is parsed to "?a=1&b=2"
  1011. * @returns {string}
  1012. */ const makeUrl = (path, parameters)=>{
  1013. if (!parameters) {
  1014. return `${API_HOST}${API_ROOT_PATH}${path}`;
  1015. }
  1016. const decamelizedParams = (0,humps__WEBPACK_IMPORTED_MODULE_0__.decamelizeKeys)(parameters);
  1017. // The following section parses the query params for convenience
  1018. // E.g. parses {a: 1, b: 2} to "?a=1&b=2"
  1019. const queryParameters = `?${(0,_qs_stringify__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(decamelizedParams)}`;
  1020. return `${API_HOST}${API_ROOT_PATH}${path}${queryParameters}`;
  1021. };
  1022. /**
  1023. * Get the default word fields that should exist in the response.
  1024. * qpc_uthmani_hafs is added so that we can use it as a fallback
  1025. * text for QCF font V1 and V2.
  1026. *
  1027. * @param {QuranFont} quranFont the selected quran font since.
  1028. * @returns {{ wordFields: string}}
  1029. *
  1030. */ const getDefaultWordFields = (quranFont = types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.QPCHafs */ .fr.QPCHafs)=>({
  1031. 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}`}`
  1032. });
  1033. /**
  1034. * Get the mushaf id based on the value inside redux (if it's not SSR).
  1035. *
  1036. * @param {QuranFont} quranFont
  1037. * @param {MushafLines} mushafLines
  1038. * @returns {{mushaf: Mushaf}}
  1039. */ const getMushafId = (// eslint-disable-next-line default-param-last
  1040. quranFont = types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.QPCHafs */ .fr.QPCHafs, mushafLines)=>{
  1041. let mushaf = types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFontMushaf */ .ru[quranFont];
  1042. // convert the Indopak mushaf to either 15 or 16 lines Mushaf
  1043. if (quranFont === types_QuranReader__WEBPACK_IMPORTED_MODULE_2__/* .QuranFont.IndoPak */ .fr.IndoPak && mushafLines) {
  1044. 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;
  1045. }
  1046. return {
  1047. mushaf
  1048. };
  1049. };
  1050. /***/ }),
  1051. /***/ 46127:
  1052. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1053. "use strict";
  1054. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1055. /* harmony export */ "$6": () => (/* binding */ makeChapterAudioDataUrl),
  1056. /* harmony export */ "A9": () => (/* binding */ makeTafsirsUrl),
  1057. /* harmony export */ "Eo": () => (/* binding */ makeByRangeVersesUrl),
  1058. /* harmony export */ "G1": () => (/* binding */ makeLanguagesUrl),
  1059. /* harmony export */ "I$": () => (/* binding */ makePagesLookupUrl),
  1060. /* harmony export */ "IC": () => (/* binding */ makeJuzVersesUrl),
  1061. /* harmony export */ "Im": () => (/* binding */ makeRubVersesUrl),
  1062. /* harmony export */ "Iq": () => (/* binding */ makeChapterInfoUrl),
  1063. /* harmony export */ "K2": () => (/* binding */ makePageVersesUrl),
  1064. /* harmony export */ "ME": () => (/* binding */ makeChapterUrl),
  1065. /* harmony export */ "ML": () => (/* binding */ makeVersesUrl),
  1066. /* harmony export */ "OT": () => (/* binding */ makeFootnoteUrl),
  1067. /* harmony export */ "Sn": () => (/* binding */ makeReciterUrl),
  1068. /* harmony export */ "UC": () => (/* binding */ makeNewSearchResultsUrl),
  1069. /* harmony export */ "Wq": () => (/* binding */ makeVersesFilterUrl),
  1070. /* harmony export */ "Wy": () => (/* binding */ makeTafsirContentUrl),
  1071. /* harmony export */ "Y8": () => (/* binding */ makeHizbVersesUrl),
  1072. /* harmony export */ "c7": () => (/* binding */ makeTranslationsUrl),
  1073. /* harmony export */ "do": () => (/* binding */ makeSearchResultsUrl),
  1074. /* harmony export */ "jL": () => (/* binding */ makeAvailableRecitersUrl),
  1075. /* harmony export */ "v2": () => (/* binding */ makeByVerseKeyUrl)
  1076. /* harmony export */ });
  1077. /* unused harmony exports DEFAULT_VERSES_PARAMS, makeWordByWordTranslationsUrl, makeAudioTimestampsUrl, makeTranslationsInfoUrl, makeAdvancedCopyUrl, makeNewSearchApiUrl, makeNavigationSearchUrl, makeDonateUrl, makeDonatePageUrl */
  1078. /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59606);
  1079. /* harmony import */ var humps__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(humps__WEBPACK_IMPORTED_MODULE_0__);
  1080. /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4917);
  1081. /* harmony import */ var _qs_stringify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(99921);
  1082. /* harmony import */ var _redux_defaultSettings_defaultSettings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11854);
  1083. /* harmony import */ var _redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17241);
  1084. /* harmony import */ var types_QuranReader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50467);
  1085. const DEFAULT_VERSES_PARAMS = {
  1086. words: true,
  1087. translationFields: "resource_name,language_id",
  1088. perPage: _api__WEBPACK_IMPORTED_MODULE_1__/* .ITEMS_PER_PAGE */ .gK,
  1089. fields: `${types_QuranReader__WEBPACK_IMPORTED_MODULE_5__/* .QuranFont.Uthmani */ .fr.Uthmani},chapter_id,hizb_number,text_imlaei_simple`
  1090. };
  1091. /**
  1092. * Use the default params and allow overriding the default values e.g. translations.
  1093. *
  1094. * @param {string} currentLocale
  1095. * @param {Record<string, unknown>} params
  1096. * @param {boolean} includeTranslationFields
  1097. * @returns {Record<string, unknown>}
  1098. */ const getVersesParams = (currentLocale, params, includeTranslationFields = true)=>{
  1099. const defaultParams = {
  1100. ...DEFAULT_VERSES_PARAMS,
  1101. translations: (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_4__/* .getTranslationsInitialState */ .h0)(currentLocale).selectedTranslations.join(", "),
  1102. reciter: _redux_defaultSettings_defaultSettings__WEBPACK_IMPORTED_MODULE_3__/* .DEFAULT_RECITER.id */ .YS.id,
  1103. wordTranslationLanguage: (0,_redux_defaultSettings_util__WEBPACK_IMPORTED_MODULE_4__/* .getReadingPreferencesInitialState */ .wH)(currentLocale).selectedWordByWordLocale
  1104. };
  1105. if (!includeTranslationFields) {
  1106. delete defaultParams.translationFields;
  1107. delete defaultParams.translations;
  1108. }
  1109. return {
  1110. ...defaultParams,
  1111. ...params
  1112. };
  1113. };
  1114. const makeVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_chapter/${id}`, getVersesParams(currentLocale, params));
  1115. const makeByRangeVersesUrl = (currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_range`, getVersesParams(currentLocale, params));
  1116. const makeVersesFilterUrl = (params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/filter`, {
  1117. ...params
  1118. });
  1119. /**
  1120. * Compose the url for the translations API.
  1121. *
  1122. * @param {string} language
  1123. * @returns {string}
  1124. */ const makeTranslationsUrl = (language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/resources/translations", {
  1125. language
  1126. });
  1127. /**
  1128. * Compose the url for the wbw translations API.
  1129. *
  1130. * @param {string} language
  1131. * @returns {string}
  1132. */ const makeWordByWordTranslationsUrl = (language)=>makeUrl("/resources/word_by_word_translations", {
  1133. language
  1134. });
  1135. /**
  1136. * Compose the url for the languages API.
  1137. *
  1138. * @param {string} language
  1139. * @returns {string}
  1140. */ const makeLanguagesUrl = (language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/resources/languages", {
  1141. language
  1142. });
  1143. /**
  1144. * Compose the url for reciters API.
  1145. *
  1146. * @param {string} locale the user's language code.
  1147. * @returns {string}
  1148. */ const makeAvailableRecitersUrl = (locale, fields)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/audio/reciters", {
  1149. locale,
  1150. fields
  1151. });
  1152. const makeReciterUrl = (reciterId, locale)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/audio/reciters/${reciterId}`, {
  1153. locale,
  1154. fields: [
  1155. "profile_picture",
  1156. "cover_image",
  1157. "bio"
  1158. ]
  1159. });
  1160. /**
  1161. * Compose the url of the audio file of a surah.
  1162. *
  1163. * @param {number} reciterId id of reciter
  1164. * @param {number} chapter the surah number.
  1165. * @param {boolean} segments include segments info
  1166. *
  1167. * @returns {string}
  1168. */ const makeChapterAudioDataUrl = (reciterId, chapter, segments)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/audio/reciters/${reciterId}/audio_files`, {
  1169. chapter,
  1170. segments
  1171. });
  1172. const makeAudioTimestampsUrl = (reciterId, verseKey)=>makeUrl(`/audio/reciters/${reciterId}/timestamp?verse_key=${verseKey}`);
  1173. /**
  1174. * Compose the url for the translations' filter API.
  1175. *
  1176. * @param {string} locale the user's language code.
  1177. * @param {number[]} translations an array holding the translations' IDs.
  1178. * @returns {string}
  1179. */ const makeTranslationsInfoUrl = (locale, translations)=>makeUrl("/resources/translations/filter", {
  1180. locale,
  1181. translations: translations.join(", ")
  1182. });
  1183. /**
  1184. * Compose the url for the advanced copy API.
  1185. *
  1186. * @param {AdvancedCopyRequest} params the request params.
  1187. * @returns {string}
  1188. */ const makeAdvancedCopyUrl = (params)=>makeUrl("/verses/advanced_copy", params);
  1189. /**
  1190. * Compose the url for search API.
  1191. *
  1192. * @param {SearchRequest} params the request params.
  1193. * @returns {string}
  1194. */ const makeSearchResultsUrl = (params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/search", params);
  1195. const makeNewSearchApiUrl = (params)=>{
  1196. const baseUrl = process.env.NEXT_PUBLIC_SEARCH_BASE_URL;
  1197. return `${baseUrl}/v1/search?${(0,_qs_stringify__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)((0,humps__WEBPACK_IMPORTED_MODULE_0__.decamelizeKeys)(params))}`;
  1198. };
  1199. const makeNewSearchResultsUrl = (params)=>makeNewSearchApiUrl(params);
  1200. /**
  1201. * Compose the url for the navigation search API that is used to show results inside the command bar.
  1202. *
  1203. * @param {string} query the request params.
  1204. * @returns {string}
  1205. */ const makeNavigationSearchUrl = (query)=>makeUrl("/navigate", {
  1206. query
  1207. });
  1208. /**
  1209. * Compose the url for the tafsirs API.
  1210. *
  1211. * @param {string} language the user's language code.
  1212. * @returns {string}
  1213. */ const makeTafsirsUrl = (language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/resources/tafsirs", {
  1214. language
  1215. });
  1216. const makeTafsirContentUrl = (tafsirId, verseKey, options)=>{
  1217. const params = {
  1218. locale: options.lang,
  1219. words: true,
  1220. ...(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .getDefaultWordFields */ .hD)(options.quranFont),
  1221. ...(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .getMushafId */ .$P)(options.quranFont, options.mushafLines)
  1222. };
  1223. return (0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/tafsirs/${tafsirId}/by_ayah/${verseKey}`, params);
  1224. };
  1225. /**
  1226. * Compose the url for the pages look up API.
  1227. *
  1228. * @param {PagesLookUpRequest} params
  1229. * @returns {string}
  1230. */ const makePagesLookupUrl = (params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)("/pages/lookup", params);
  1231. /**
  1232. * Compose the url for the chapter's info API.
  1233. *
  1234. * @param {string} chapterId the chapter Id.
  1235. * @param {string} language the user's language code.
  1236. * @returns {string}
  1237. */ const makeChapterInfoUrl = (chapterId, language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/chapters/${chapterId}/info`, {
  1238. language
  1239. });
  1240. /**
  1241. * Compose the url for the chapter's API.
  1242. *
  1243. * @param {string} chapterIdOrSlug the chapter Id or the slug.
  1244. * @param {string} language the user's language code.
  1245. * @returns {string}
  1246. */ const makeChapterUrl = (chapterIdOrSlug, language)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/chapters/${chapterIdOrSlug}`, {
  1247. language
  1248. });
  1249. /**
  1250. * Compose the url for Juz's verses API.
  1251. *
  1252. * @param {string} id the Id of the juz.
  1253. * @param {string} currentLocale the locale.
  1254. * @param {Record<string, unknown>} params in-case we need to over-ride the default params.
  1255. * @returns {string}
  1256. */ const makeJuzVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_juz/${id}`, getVersesParams(currentLocale, params));
  1257. /**
  1258. * Compose the url for Rub el Hizb's verses API.
  1259. *
  1260. * @param {string} id the Id of the Rub el Hizb.
  1261. * @param {string} currentLocale the locale.
  1262. * @param {Record<string, unknown>} params in-case we need to over-ride the default params.
  1263. * @returns {string}
  1264. */ const makeRubVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_rub_el_hizb/${id}`, getVersesParams(currentLocale, params));
  1265. /**
  1266. * Compose the url for Hizb's verses API.
  1267. *
  1268. * @param {string} id the Id of the hizb.
  1269. * @param {string} currentLocale the locale.
  1270. * @param {Record<string, unknown>} params in-case we need to over-ride the default params.
  1271. * @returns {string}
  1272. */ const makeHizbVersesUrl = (id, currentLocale, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_hizb/${id}`, getVersesParams(currentLocale, params));
  1273. /**
  1274. * Compose the url for by verse key API.
  1275. *
  1276. * @param {string} verseKey the Id of the juz.
  1277. * @param {Record<string, unknown>} params in-case we need to over-ride the default params.
  1278. * @returns {string}
  1279. */ const makeByVerseKeyUrl = (verseKey, params)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_key/${verseKey}`, params);
  1280. /**
  1281. * Compose the url for page's verses API.
  1282. *
  1283. * @param {string} id the Id of the page.
  1284. * @param {string} currentLocale the locale.
  1285. * @param {Record<string, unknown>} params in-case we need to over-ride the default params.
  1286. * @param {boolean} includeTranslationFields
  1287. * @returns {string}
  1288. */ const makePageVersesUrl = (id, currentLocale, params, includeTranslationFields = true)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/verses/by_page/${id}`, getVersesParams(currentLocale, params, includeTranslationFields));
  1289. /**
  1290. * Compose the url for footnote's API.
  1291. *
  1292. * @param {string} footnoteId
  1293. * @returns {string}
  1294. */ const makeFootnoteUrl = (footnoteId)=>(0,_api__WEBPACK_IMPORTED_MODULE_1__/* .makeUrl */ .bf)(`/foot_notes/${footnoteId}`);
  1295. const makeDonateUrl = (showDonationPopup = false)=>`https://donate.quran.foundation${showDonationPopup ? "?showDonationPopup" : ""}`;
  1296. // eslint-disable-next-line @typescript-eslint/no-unused-vars
  1297. const makeDonatePageUrl = (isOnce = true, shouldUseProviderUrl = false)=>{
  1298. if (shouldUseProviderUrl) {
  1299. return `https://give.quran.foundation/give/${isOnce ? 482507 : 474400}/#!/donation/checkout`;
  1300. }
  1301. return makeDonateUrl();
  1302. };
  1303. /***/ }),
  1304. /***/ 95892:
  1305. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1306. "use strict";
  1307. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1308. /* harmony export */ "T4": () => (/* binding */ getAllChaptersData),
  1309. /* harmony export */ "_L": () => (/* binding */ getChapterReadingProgress),
  1310. /* harmony export */ "dy": () => (/* binding */ getChapterData),
  1311. /* harmony export */ "it": () => (/* binding */ getChapterIdsForJuz),
  1312. /* harmony export */ "op": () => (/* binding */ getChapterIdsForPage)
  1313. /* harmony export */ });
  1314. /* unused harmony exports getAllJuzMappings, getChapterAndVerseMappingForJuz, isFirstSurah, isLastSurah, QURAN_CHAPTERS_COUNT, getRandomChapterId */
  1315. /* harmony import */ var lodash_random__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35526);
  1316. /* harmony import */ var lodash_random__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_random__WEBPACK_IMPORTED_MODULE_0__);
  1317. /* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19303);
  1318. /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable global-require */
  1319. const DEFAULT_LANGUAGE = "en";
  1320. const SUPPORTED_CHAPTER_LOCALES = [
  1321. "en",
  1322. "ar",
  1323. "bn",
  1324. "fr",
  1325. "id",
  1326. "it",
  1327. "nl",
  1328. "ru",
  1329. "tr",
  1330. "ur",
  1331. "zh",
  1332. ];
  1333. /**
  1334. * Get chapters data from the json file, by language
  1335. *
  1336. * @param {string} lang
  1337. * @returns {Promise<Record<string, Chapter>>} chapter
  1338. */ const getAllChaptersData = (lang = DEFAULT_LANGUAGE)=>{
  1339. if (SUPPORTED_CHAPTER_LOCALES.includes(lang)) {
  1340. return new Promise((res)=>{
  1341. __webpack_require__(62182)(`./${lang}.json`).then((data)=>{
  1342. res(data.default);
  1343. });
  1344. });
  1345. }
  1346. return new Promise((res)=>{
  1347. __webpack_require__.e(/* import() */ 69029).then(__webpack_require__.t.bind(__webpack_require__, 69029, 19)).then((data)=>{
  1348. // @ts-ignore
  1349. res(data.default);
  1350. });
  1351. });
  1352. };
  1353. /**
  1354. * Get chapter data by id from the json file
  1355. *
  1356. * @param {ChaptersData} chapters
  1357. * @param {string} id
  1358. * @returns {Chapter} chapter
  1359. */ const getChapterData = (chapters, id)=>chapters[(0,_number__WEBPACK_IMPORTED_MODULE_1__/* .formatStringNumber */ .XK)(id)];
  1360. /**
  1361. * Given a pageId, get chapter ids from a json file
  1362. *
  1363. * @param {string} pageId
  1364. * @returns {Promise<string[]>} chapterIds
  1365. */ const getChapterIdsForPage = (pageId)=>{
  1366. return new Promise((res)=>{
  1367. __webpack_require__.e(/* import() */ 80370).then(__webpack_require__.t.bind(__webpack_require__, 80370, 19)).then((data)=>{
  1368. res(data.default[pageId]);
  1369. });
  1370. });
  1371. };
  1372. /**
  1373. * Given a juzId, get chapters ids from a json file
  1374. *
  1375. * @param {string} juzId
  1376. * @returns {string[]} chapterIds
  1377. */ const getChapterIdsForJuz = async (juzId)=>{
  1378. return new Promise((res)=>{
  1379. __webpack_require__.e(/* import() */ 19535).then(__webpack_require__.t.bind(__webpack_require__, 19535, 19)).then((data)=>{
  1380. res(data.default[juzId]);
  1381. });
  1382. });
  1383. };
  1384. /**
  1385. * get ChapterAndVerseMapping for all juzs
  1386. *
  1387. * @returns {[juz: string]: ChapterAndVerseMapping}
  1388. */ const getAllJuzMappings = ()=>{
  1389. return new Promise((res)=>{
  1390. __webpack_require__.e(/* import() */ 92447).then(__webpack_require__.t.bind(__webpack_require__, 92447, 19)).then((data)=>{
  1391. res(data.default);
  1392. });
  1393. });
  1394. };
  1395. /**
  1396. * Given a juzId get a chapter + verse mapping for this juz
  1397. *
  1398. * @param {string} juzId
  1399. * @returns {[chapter: string]: string}
  1400. *
  1401. * original data source: https://api.quran.com/api/v4/juzs
  1402. *
  1403. * Example:
  1404. * getChapterAndVerseMappingForJuz("1") // { "1": "1-7", "2" : "1-141"}
  1405. * -> juz "1" contains chapter "1" with verse "1-7" and chapter "2" with verse "1-141"
  1406. *
  1407. */ const getChapterAndVerseMappingForJuz = async (juzId)=>{
  1408. const juzVerseMapping = await getAllJuzMappings();
  1409. return juzVerseMapping[juzId];
  1410. };
  1411. /**
  1412. * Whether the current surah is the first surah.
  1413. *
  1414. * @param {number} surahNumber
  1415. * @param {boolean} isReadingByRevelationOrder
  1416. * @returns {boolean}
  1417. */ const isFirstSurah = (surahNumber, isReadingByRevelationOrder)=>{
  1418. if (!isReadingByRevelationOrder) return surahNumber === 1;
  1419. return REVELATION_ORDER[0] === surahNumber;
  1420. };
  1421. /**
  1422. * Whether the current surah is the last surah.
  1423. *
  1424. * @param {number} surahNumber
  1425. * @param {boolean} isReadingByRevelationOrder
  1426. * @returns {boolean}
  1427. */ const isLastSurah = (surahNumber, isReadingByRevelationOrder)=>{
  1428. if (!isReadingByRevelationOrder) return surahNumber === 114;
  1429. return REVELATION_ORDER[REVELATION_ORDER.length - 1] === surahNumber;
  1430. };
  1431. /**
  1432. * Get how much percentage of the chapter has been read.
  1433. *
  1434. * @param {number} currentVerse
  1435. * @param {number} totalNumberOfVerses
  1436. * @returns {number}
  1437. */ const getChapterReadingProgress = (currentVerse, totalNumberOfVerses)=>Math.ceil(currentVerse * 100 / totalNumberOfVerses);
  1438. const QURAN_CHAPTERS_COUNT = 114;
  1439. const getRandomChapterId = ()=>{
  1440. return random(1, QURAN_CHAPTERS_COUNT);
  1441. };
  1442. /***/ }),
  1443. /***/ 55943:
  1444. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1445. "use strict";
  1446. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  1447. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1448. /* harmony export */ "An": () => (/* binding */ logCarouselSlideCompletion),
  1449. /* harmony export */ "Dy": () => (/* binding */ logEmptySearchResults),
  1450. /* harmony export */ "Io": () => (/* binding */ logTarteelLinkClick),
  1451. /* harmony export */ "Kz": () => (/* binding */ logEvent),
  1452. /* harmony export */ "MY": () => (/* binding */ logButtonClick),
  1453. /* harmony export */ "Q8": () => (/* binding */ logValueChange),
  1454. /* harmony export */ "dz": () => (/* binding */ logFormSubmission),
  1455. /* harmony export */ "qS": () => (/* binding */ logSearchResults),
  1456. /* harmony export */ "tL": () => (/* binding */ logTextSearchQuery),
  1457. /* harmony export */ "u8": () => (/* binding */ logItemSelectionChange)
  1458. /* harmony export */ });
  1459. /* harmony import */ var _types_SearchType__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73634);
  1460. /* harmony import */ var src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(92099);
  1461. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__]);
  1462. src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  1463. /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/naming-convention */
  1464. /**
  1465. * Filter out empty search queries.
  1466. *
  1467. * @param {string} rawSearchQuery
  1468. * @returns {string}
  1469. */ const getSearchQuery = (rawSearchQuery)=>{
  1470. if (!rawSearchQuery) {
  1471. return "";
  1472. }
  1473. // trim search query so we don't log a query like ' '.
  1474. return rawSearchQuery.trim();
  1475. };
  1476. const logEvent = async (eventName, params)=>{
  1477. if (src_lib_firebase__WEBPACK_IMPORTED_MODULE_1__.isFirebaseEnabled) {
  1478. Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 92099)).then((firebaseModule)=>{
  1479. // eslint-disable-next-line i18next/no-literal-string
  1480. firebaseModule.analytics().logEvent(eventName, params);
  1481. });
  1482. }
  1483. };
  1484. /**
  1485. * Log when a button is clicked.
  1486. *
  1487. * @param {string} buttonName
  1488. */ const logButtonClick = (buttonName, params)=>{
  1489. logEvent(`${buttonName}_clicked`, params);
  1490. };
  1491. /**
  1492. * Log when a form is submitted.
  1493. *
  1494. * @param {string} formName
  1495. */ const logFormSubmission = (formName, params)=>{
  1496. logEvent(`${formName}_form_submitted`, params);
  1497. };
  1498. /**
  1499. * Log when a carousel slide is completed.
  1500. *
  1501. * @param {string} carouselName
  1502. * @param {number|string} slideNumber
  1503. */ const logCarouselSlideCompletion = (carouselName, slideNumber)=>{
  1504. logEvent(`${carouselName}_slide_${slideNumber}_completed`);
  1505. };
  1506. /**
  1507. * Log when a value changes.
  1508. *
  1509. * @param {string} name
  1510. * @param {string | boolean | number | string[] | number[] | Record<string, string>} currentValue
  1511. * @param {string | boolean | number | string[] | number[] | Record<string, string>} newValue
  1512. */ const logValueChange = (name, currentValue, newValue, params = {})=>{
  1513. logEvent(`${name}_change`, {
  1514. current_value: currentValue,
  1515. new_value: newValue,
  1516. ...params
  1517. });
  1518. };
  1519. /**
  1520. * Log when the user makes a search query whether through typing or voice search when there are no results.
  1521. *
  1522. * @param {SearchResultsParams} eventData
  1523. */ const logEmptySearchResults = ({ query: searchQuery , source , type =_types_SearchType__WEBPACK_IMPORTED_MODULE_0__/* ["default"].Text */ .Z.Text , service })=>{
  1524. const query = getSearchQuery(searchQuery);
  1525. // if the searchQuery is not empty
  1526. if (query !== "") {
  1527. logEvent(`${type}_search_query_with_no_result`, {
  1528. query,
  1529. source,
  1530. ...service && {
  1531. service
  1532. }
  1533. });
  1534. }
  1535. };
  1536. /**
  1537. * Log when the user makes a search query whether through typing or voice search when there are results.
  1538. *
  1539. * @param {SearchResultsParams} eventData
  1540. */ const logSearchResults = ({ query: searchQuery , source , type =_types_SearchType__WEBPACK_IMPORTED_MODULE_0__/* ["default"].Text */ .Z.Text , service })=>{
  1541. const query = getSearchQuery(searchQuery);
  1542. // if the searchQuery is not empty
  1543. if (query !== "") {
  1544. logEvent("search_query_with_results", {
  1545. type,
  1546. query,
  1547. source,
  1548. ...service && {
  1549. service
  1550. }
  1551. });
  1552. }
  1553. };
  1554. /**
  1555. * Log text search queries entered by the user.
  1556. *
  1557. * @param {string} searchQuery
  1558. * @param {SearchQuerySource} source
  1559. */ const logTextSearchQuery = (searchQuery, source)=>{
  1560. const query = getSearchQuery(searchQuery);
  1561. // if the searchQuery is not empty
  1562. if (query !== "") {
  1563. logEvent("search_query", {
  1564. query,
  1565. source
  1566. });
  1567. }
  1568. };
  1569. const logTarteelLinkClick = (type)=>{
  1570. logEvent("tarteel_link_click", {
  1571. type: `${type}_attribution`
  1572. });
  1573. };
  1574. /**
  1575. * Log when an item selection status change.
  1576. *
  1577. * @param {string} itemName
  1578. * @param {string | number} itemId
  1579. * @param {boolean} isSelected
  1580. */ const logItemSelectionChange = (itemName, itemId, isSelected = true)=>{
  1581. logEvent(`${itemName}_${isSelected ? "selected" : "unselected"}`, {
  1582. value: itemId
  1583. });
  1584. };
  1585. __webpack_async_result__();
  1586. } catch(e) { __webpack_async_result__(e); } });
  1587. /***/ }),
  1588. /***/ 57933:
  1589. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1590. "use strict";
  1591. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  1592. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1593. /* harmony export */ "AO": () => (/* binding */ getNotesNavigationUrl),
  1594. /* harmony export */ "CZ": () => (/* binding */ getJuzNavigationUrl),
  1595. /* harmony export */ "ES": () => (/* binding */ getCourseNavigationUrl),
  1596. /* harmony export */ "Fk": () => (/* binding */ getRamadanActivitiesNavigationUrl),
  1597. /* harmony export */ "GK": () => (/* binding */ getPageNavigationUrl),
  1598. /* harmony export */ "HT": () => (/* binding */ getVerseReflectionNavigationUrl),
  1599. /* harmony export */ "I8": () => (/* binding */ getVerseSelectedTafsirNavigationUrl),
  1600. /* harmony export */ "L$": () => (/* binding */ getMyCoursesNavigationUrl),
  1601. /* harmony export */ "Mf": () => (/* binding */ getRubNavigationUrl),
  1602. /* harmony export */ "P6": () => (/* binding */ getChapterWithStartingVerseUrl),
  1603. /* harmony export */ "So": () => (/* binding */ getVerseTafsirNavigationUrl),
  1604. /* harmony export */ "Wq": () => (/* binding */ getHizbNavigationUrl),
  1605. /* harmony export */ "Y9": () => (/* binding */ getReciterChapterNavigationUrl),
  1606. /* harmony export */ "Z2": () => (/* binding */ getCanonicalUrl),
  1607. /* harmony export */ "Zm": () => (/* binding */ getSurahInfoNavigationUrl),
  1608. /* harmony export */ "_V": () => (/* binding */ fakeNavigate),
  1609. /* harmony export */ "aT": () => (/* binding */ getReciterNavigationUrl),
  1610. /* harmony export */ "dC": () => (/* binding */ getLessonNavigationUrl),
  1611. /* harmony export */ "gk": () => (/* binding */ getLoginNavigationUrl),
  1612. /* harmony export */ "hb": () => (/* binding */ scrollWindowToTop),
  1613. /* harmony export */ "kJ": () => (/* binding */ getProfileNavigationUrl),
  1614. /* harmony export */ "lj": () => (/* binding */ getNotificationSettingsNavigationUrl),
  1615. /* harmony export */ "ly": () => (/* binding */ getQuranicCalendarNavigationUrl),
  1616. /* harmony export */ "nT": () => (/* binding */ getQuranicCalendarRangesNavigationUrl),
  1617. /* harmony export */ "oJ": () => (/* binding */ getReadingGoalProgressNavigationUrl),
  1618. /* harmony export */ "p5": () => (/* binding */ getVerseNavigationUrl),
  1619. /* harmony export */ "pO": () => (/* binding */ getProductUpdatesUrl),
  1620. /* harmony export */ "pg": () => (/* binding */ getCollectionNavigationUrl),
  1621. /* harmony export */ "qm": () => (/* binding */ getSurahNavigationUrl),
  1622. /* harmony export */ "qs": () => (/* binding */ getVerseNavigationUrlByVerseKey),
  1623. /* harmony export */ "ty": () => (/* binding */ getCoursesNavigationUrl),
  1624. /* harmony export */ "uv": () => (/* binding */ QuranicCalendarRangesNavigationSettings),
  1625. /* harmony export */ "we": () => (/* binding */ getReadingGoalNavigationUrl),
  1626. /* harmony export */ "xl": () => (/* binding */ getRangesNavigationUrl),
  1627. /* harmony export */ "zp": () => (/* binding */ resolveUrlBySearchNavigationType)
  1628. /* harmony export */ });
  1629. /* unused harmony exports getSurahRangeNavigationUrlByVerseKey, getPreviousSurahNavigationUrl, getNextSurahNavigationUrl, getSearchQueryNavigationUrl */
  1630. /* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(63477);
  1631. /* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(querystring__WEBPACK_IMPORTED_MODULE_0__);
  1632. /* harmony import */ var _search__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87098);
  1633. /* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(69663);
  1634. /* harmony import */ var _verse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44519);
  1635. /* harmony import */ var _types_QueryParam__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11721);
  1636. /* harmony import */ var _types_QuranReader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(50467);
  1637. /* harmony import */ var types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(87582);
  1638. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_search__WEBPACK_IMPORTED_MODULE_1__]);
  1639. _search__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  1640. /* eslint-disable max-lines */
  1641. /**
  1642. * Get the href link to a verse.
  1643. *
  1644. * @param {string} verseKey
  1645. * @returns {string}
  1646. */ const getVerseNavigationUrlByVerseKey = (verseKey)=>{
  1647. const [chapterId, verseNumber] = (0,_verse__WEBPACK_IMPORTED_MODULE_2__/* .getVerseAndChapterNumbersFromKey */ .bV)(verseKey);
  1648. return `/${chapterId}/${verseNumber}`;
  1649. };
  1650. /**
  1651. * Get the href link to a verse range e.g. 3:5-7.
  1652. *
  1653. * @param {string} key
  1654. * @returns {string}
  1655. */ const getSurahRangeNavigationUrlByVerseKey = (key)=>{
  1656. const { surah , from , to } = (0,_verse__WEBPACK_IMPORTED_MODULE_2__/* .getVerseNumberRangeFromKey */ .YN)(key);
  1657. return `/${surah}/${from}-${to}`;
  1658. };
  1659. /**
  1660. * Get the scroll to link of a verseKey.
  1661. *
  1662. * @param {string} verseKey
  1663. * @returns {string}
  1664. */ const getChapterWithStartingVerseUrl = (verseKey)=>{
  1665. const [chapterId, verseNumber] = (0,_verse__WEBPACK_IMPORTED_MODULE_2__/* .getVerseAndChapterNumbersFromKey */ .bV)(verseKey);
  1666. return `/${chapterId}?${_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].STARTING_VERSE */ .Z.STARTING_VERSE}=${verseNumber}`;
  1667. };
  1668. /**
  1669. * Get the href link to a verse.
  1670. *
  1671. * @param {string} chapterIdOrSlug
  1672. * @param {string} verseNumber
  1673. * @returns {string}
  1674. */ const getVerseNavigationUrl = (chapterIdOrSlug, verseNumber)=>`/${chapterIdOrSlug}/${verseNumber}`;
  1675. /**
  1676. * Get the href link to a range.
  1677. *
  1678. * @param {string} startVerseKey
  1679. * @param {string} endVerseKey
  1680. * @returns {string}
  1681. */ const getRangesNavigationUrl = (startVerseKey, endVerseKey)=>`/${startVerseKey}-${endVerseKey}`;
  1682. /**
  1683. * Get the href link to a juz.
  1684. *
  1685. * @param {string | number} juzNumber
  1686. * @returns {string}
  1687. */ const getJuzNavigationUrl = (juzNumber)=>`/juz/${juzNumber}`;
  1688. /**
  1689. * Get the href link to a Rub el Hizb.
  1690. *
  1691. * @param {string | number} rubNumber
  1692. * @returns {string}
  1693. */ const getRubNavigationUrl = (rubNumber)=>`/rub/${rubNumber}`;
  1694. /**
  1695. * Get the href link to a hizb.
  1696. *
  1697. * @param {string | number} hizbNumber
  1698. * @returns {string}
  1699. */ const getHizbNavigationUrl = (hizbNumber)=>`/hizb/${hizbNumber}`;
  1700. /**
  1701. * Get the href link to a page.
  1702. *
  1703. * @param {string | number} pageNumber
  1704. * @returns {string}
  1705. */ const getPageNavigationUrl = (pageNumber)=>`/page/${pageNumber}`;
  1706. /**
  1707. * Get the href link to tafsir for Ayah.
  1708. *
  1709. * @param {string | number} chapterIdOrSlug
  1710. * @param {number} verseNumber
  1711. * @returns {string}
  1712. */ const getVerseTafsirNavigationUrl = (chapterIdOrSlug, verseNumber, tafsirId)=>`/${chapterIdOrSlug}/${verseNumber}/tafsirs${tafsirId ? `?${(0,querystring__WEBPACK_IMPORTED_MODULE_0__.stringify)({
  1713. tafsirId
  1714. })}` : ""}`;
  1715. /**
  1716. * Get the href link to selected tafsir for Ayah.
  1717. *
  1718. * @param {string | number} chapterId
  1719. * @param {number} verseNumber
  1720. * @param {number |string} tafsirId
  1721. * @returns {string}
  1722. */ const getVerseSelectedTafsirNavigationUrl = (chapterId, verseNumber, tafsirId)=>`/${chapterId}:${verseNumber}/tafsirs/${tafsirId}`;
  1723. /**
  1724. * Get the href link to selected tafsir for Ayah.
  1725. *
  1726. * @param {string} verseKey
  1727. * @returns {string}
  1728. */ const getVerseReflectionNavigationUrl = (verseKey)=>`/${verseKey}/reflections`;
  1729. /**
  1730. * Get the href link to a surah.
  1731. *
  1732. * @param {string | number} surahIdOrSlug
  1733. * @returns {string}
  1734. */ const getSurahNavigationUrl = (surahIdOrSlug)=>`/${surahIdOrSlug}`;
  1735. var QuranicCalendarRangesNavigationSettings;
  1736. (function(QuranicCalendarRangesNavigationSettings) {
  1737. QuranicCalendarRangesNavigationSettings["EnglishOnly"] = "englishOnly";
  1738. QuranicCalendarRangesNavigationSettings["EnglishAndArabic"] = "englishAndArabic";
  1739. QuranicCalendarRangesNavigationSettings["DefaultSettings"] = "defaultSettings";
  1740. })(QuranicCalendarRangesNavigationSettings || (QuranicCalendarRangesNavigationSettings = {}));
  1741. const getQuranicCalendarRangesNavigationUrl = (ranges, settings)=>{
  1742. const params = {
  1743. [_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].FLOW */ .Z.FLOW]: _types_QuranReader__WEBPACK_IMPORTED_MODULE_4__/* .QuranReaderFlow.QURANIC_CALENDER */ .Bc.QURANIC_CALENDER
  1744. };
  1745. if (settings !== QuranicCalendarRangesNavigationSettings.DefaultSettings) {
  1746. params[_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].Translations */ .Z.Translations] = 85;
  1747. if (settings === QuranicCalendarRangesNavigationSettings.EnglishOnly) {
  1748. params[_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].HIDE_ARABIC */ .Z.HIDE_ARABIC] = "true";
  1749. }
  1750. }
  1751. return `${ranges}?${(0,querystring__WEBPACK_IMPORTED_MODULE_0__.stringify)(params)}`;
  1752. };
  1753. /**
  1754. * Get the href link to the previous surah.
  1755. *
  1756. * @param {number} chapterNumber
  1757. * @param {boolean} isReadingByRevelationOrder
  1758. * @returns {string}
  1759. */ const getPreviousSurahNavigationUrl = (chapterNumber, isReadingByRevelationOrder)=>{
  1760. if (!isReadingByRevelationOrder) {
  1761. return getSurahNavigationUrl(chapterNumber - 1);
  1762. }
  1763. const currentChapterRevelationOrderIndex = REVELATION_ORDER.indexOf(chapterNumber);
  1764. const previousChapterRevelationOrderIndex = currentChapterRevelationOrderIndex - 1;
  1765. const previousChapterNumberByRevelationOrder = REVELATION_ORDER[previousChapterRevelationOrderIndex];
  1766. return getSurahNavigationUrl(previousChapterNumberByRevelationOrder);
  1767. };
  1768. /**
  1769. * Get the href link to the next surah.
  1770. *
  1771. * @param chapterNumber
  1772. * @param isReadingByRevelationOrder
  1773. * @returns {string}
  1774. */ const getNextSurahNavigationUrl = (chapterNumber, isReadingByRevelationOrder)=>{
  1775. if (!isReadingByRevelationOrder) {
  1776. return getSurahNavigationUrl(chapterNumber + 1);
  1777. }
  1778. const currentChapterRevelationOrderIndex = REVELATION_ORDER.indexOf(chapterNumber);
  1779. const nextChapterRevelationOrderIndex = currentChapterRevelationOrderIndex + 1;
  1780. const nextChapterNumberByRevelationOrder = REVELATION_ORDER[nextChapterRevelationOrderIndex];
  1781. return getSurahNavigationUrl(nextChapterNumberByRevelationOrder);
  1782. };
  1783. /**
  1784. * Generate the navigation url based on the type.
  1785. *
  1786. * @param {SearchNavigationType} type
  1787. * @param {string | number} key
  1788. * @param {boolean} isKalimatSearch
  1789. * @returns {string}
  1790. */ const resolveUrlBySearchNavigationType = (type, key, isKalimatSearch = false)=>{
  1791. const stringKey = isKalimatSearch ? (0,_search__WEBPACK_IMPORTED_MODULE_1__/* .searchIdToNavigationKey */ .Ck)(type, String(key)) : String(key);
  1792. if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.AYAH */ .H.AYAH) {
  1793. return getChapterWithStartingVerseUrl(stringKey);
  1794. }
  1795. if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.JUZ */ .H.JUZ) {
  1796. return getJuzNavigationUrl(stringKey);
  1797. }
  1798. if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.RUB_EL_HIZB */ .H.RUB_EL_HIZB) {
  1799. return getRubNavigationUrl(stringKey);
  1800. }
  1801. if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.HIZB */ .H.HIZB) {
  1802. return getHizbNavigationUrl(stringKey);
  1803. }
  1804. if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.PAGE */ .H.PAGE) {
  1805. return getPageNavigationUrl(stringKey);
  1806. }
  1807. if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.SEARCH_PAGE */ .H.SEARCH_PAGE) {
  1808. return getSearchQueryNavigationUrl(stringKey);
  1809. }
  1810. if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_5__/* .SearchNavigationType.RANGE */ .H.RANGE) {
  1811. return getSurahRangeNavigationUrlByVerseKey(stringKey);
  1812. }
  1813. // for the Surah navigation
  1814. return getSurahNavigationUrl(stringKey);
  1815. };
  1816. /**
  1817. * Get the href link to the search page with a specific query.
  1818. *
  1819. * @param {string} query the search query.
  1820. * @returns {string}
  1821. */ const getSearchQueryNavigationUrl = (query)=>`/search${query ? `?${_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].QUERY */ .Z.QUERY}=${query}` : ""}`;
  1822. /**
  1823. * Get the href link to the info page of a Surah.
  1824. *
  1825. * @param {string} chapterIdOrSlug
  1826. * @returns {string} chapterUrl
  1827. */ const getSurahInfoNavigationUrl = (chapterIdOrSlug)=>`/surah/${chapterIdOrSlug}/info`;
  1828. /**
  1829. * Get href link to the reciter page
  1830. *
  1831. * @param {string} reciterId
  1832. * @returns {string} reciterPageUrl
  1833. */ const getReciterNavigationUrl = (reciterId)=>`/reciters/${reciterId}`;
  1834. /**
  1835. * Get href link to the course page
  1836. *
  1837. * @param {string} courseSlug
  1838. * @returns {string} coursePageUrl
  1839. */ const getCourseNavigationUrl = (courseSlug)=>`/learning-plans/${courseSlug}`;
  1840. /**
  1841. * Get href link to the lesson page
  1842. *
  1843. * @param {string} courseSlug
  1844. * @returns {string} lessonPageUrl
  1845. */ const getLessonNavigationUrl = (courseSlug, lessonSlug)=>`/learning-plans/${courseSlug}/lessons/${lessonSlug}`;
  1846. /**
  1847. * Get href link to an audio recitation page by reciterId and chapterId
  1848. *
  1849. * @param {string} reciterId
  1850. * @param {string} chapterId
  1851. * @returns {string} recitationPageUrl
  1852. */ const getReciterChapterNavigationUrl = (reciterId, chapterId)=>`/reciters/${reciterId}/${chapterId}`;
  1853. /**
  1854. * Get the canonical url. Will include the language in the url except for English.
  1855. *
  1856. * @param {string} lang
  1857. * @param {string} path
  1858. * @returns {string}
  1859. */ const getCanonicalUrl = (lang, path)=>`${(0,_url__WEBPACK_IMPORTED_MODULE_6__/* .getBasePath */ .bv)()}${lang === "en" ? "" : `/${lang}`}${path}`;
  1860. /**
  1861. * Get the href link to the product updates page.
  1862. *
  1863. * @param {string} id
  1864. * @returns {string}
  1865. */ const getProductUpdatesUrl = (id = "")=>`/product-updates${`${id ? `/${id}` : ""}`}`;
  1866. const getProfileNavigationUrl = ()=>{
  1867. return "/profile";
  1868. };
  1869. const getCollectionNavigationUrl = (collectionId)=>{
  1870. return `/collections/${collectionId}`;
  1871. };
  1872. const getReadingGoalNavigationUrl = ()=>"/reading-goal";
  1873. const getMyCoursesNavigationUrl = ()=>"/my-learning-plans";
  1874. const getCoursesNavigationUrl = ()=>"/learning-plans";
  1875. const getRamadanActivitiesNavigationUrl = ()=>"/ramadan-activities";
  1876. const getLoginNavigationUrl = (redirectTo)=>`/login${redirectTo ? `?${_types_QueryParam__WEBPACK_IMPORTED_MODULE_3__/* ["default"].REDIRECT_TO */ .Z.REDIRECT_TO}=${redirectTo}` : ""}`;
  1877. const getReadingGoalProgressNavigationUrl = ()=>"/reading-goal/progress";
  1878. const getNotesNavigationUrl = ()=>"/notes-and-reflections";
  1879. const getNotificationSettingsNavigationUrl = ()=>"/notification-settings";
  1880. const getQuranicCalendarNavigationUrl = ()=>"/calendar";
  1881. /**
  1882. * Update the browser history with the new url.
  1883. * without actually navigating into that url.
  1884. * So it does not trigger re render or page visit on Next.js
  1885. *
  1886. * @param {string} url
  1887. * @param {string} locale
  1888. */ const fakeNavigate = (url, locale)=>{
  1889. window.history.pushState({}, "", `${locale === "en" ? "" : `/${locale}`}${url}`);
  1890. };
  1891. /**
  1892. * Scroll to the top of the page.
  1893. */ const scrollWindowToTop = ()=>{
  1894. if (false) {}
  1895. };
  1896. __webpack_async_result__();
  1897. } catch(e) { __webpack_async_result__(e); } });
  1898. /***/ }),
  1899. /***/ 19303:
  1900. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1901. "use strict";
  1902. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1903. /* harmony export */ "XK": () => (/* binding */ formatStringNumber),
  1904. /* harmony export */ "XN": () => (/* binding */ getPageNumberFromIndexAndPerPage),
  1905. /* harmony export */ "uZ": () => (/* binding */ convertNumberToDecimal),
  1906. /* harmony export */ "xT": () => (/* binding */ convertFractionToPercent)
  1907. /* harmony export */ });
  1908. /* eslint-disable import/prefer-default-export */ /**
  1909. * This function returns a number string after making sure
  1910. * it's in the valid format. e.g.
  1911. * 1 -> 1
  1912. * 001 -> 1
  1913. *
  1914. * @param {string} number
  1915. * @returns {string}
  1916. */ const formatStringNumber = (number)=>String(Number(number));
  1917. /**
  1918. * This function takes a fraction (a number between 0 and 1) and converts it to a percent number (limited to 100).
  1919. *
  1920. * @param {string | number} fraction a number between 0 and 1
  1921. * @param {number} decimalPoints number of decimal points
  1922. * @returns {number} a number between 0 and 100
  1923. */ const convertFractionToPercent = (fraction, decimalPoints = 1)=>{
  1924. const number = convertNumberToDecimal(Number(fraction) * 100, decimalPoints);
  1925. return Math.min(number, 100);
  1926. };
  1927. /**
  1928. * This function takes a number and converts it to a decimal number.
  1929. *
  1930. * @param {string | number} number
  1931. * @param {number} decimalPoints number of decimal points
  1932. * @returns {number}
  1933. */ const convertNumberToDecimal = (number, decimalPoints = 1)=>{
  1934. return Number((typeof number === "string" ? Number(number) : number).toFixed(decimalPoints));
  1935. };
  1936. /**
  1937. * This function takes an item index and the number of items per page and returns the page number.
  1938. *
  1939. * Example:
  1940. * index: 0, perPage: 10 -> 1
  1941. * index: 1, perPage: 10 -> 1
  1942. * index: 10, perPage: 10 -> 2
  1943. * index: 11, perPage: 10 -> 2
  1944. *
  1945. * @param {number} index
  1946. * @param {number} perPage
  1947. * @returns {number}
  1948. */ const getPageNumberFromIndexAndPerPage = (index, perPage)=>{
  1949. return Math.ceil((index + 1) / perPage);
  1950. };
  1951. /***/ }),
  1952. /***/ 99921:
  1953. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1954. "use strict";
  1955. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1956. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  1957. /* harmony export */ });
  1958. // Reference: https://github.com/billjs/query-string/blob/master/src/index.ts
  1959. const defaultStringifyFunction = (key, value)=>value;
  1960. const defaultEq = "=";
  1961. const defaultSep = "&";
  1962. const defaultConfig = {
  1963. eq: defaultEq,
  1964. sep: defaultSep,
  1965. prefix: "",
  1966. fn: defaultStringifyFunction
  1967. };
  1968. /**
  1969. * Given a query object, return the query string
  1970. * See qs-stringify.test.ts for examples
  1971. *
  1972. * @param {QueryObject} obj a query object to be converted to a query string
  1973. * @param {Config} config optional configuration
  1974. * @returns {string} query string
  1975. *
  1976. * @example
  1977. * stringify({a: 1, b: 2}) // returns 'a=1&b=s'
  1978. */ function stringify(obj, config = defaultConfig) {
  1979. const { eq , sep , fn , prefix } = {
  1980. ...defaultConfig,
  1981. ...config
  1982. };
  1983. if (obj == null || !isObject(obj)) {
  1984. return "";
  1985. }
  1986. return Object.entries(obj).filter(([, value])=>value !== null) // filter out null values
  1987. .map(([key, value])=>{
  1988. if (Array.isArray(value)) {
  1989. return encode(key, value.join(","), {
  1990. eq,
  1991. fn,
  1992. prefix
  1993. });
  1994. }
  1995. if (isObject(value)) {
  1996. return stringify(value, {
  1997. eq,
  1998. sep,
  1999. fn,
  2000. prefix: getKey(key, prefix)
  2001. });
  2002. }
  2003. return encode(key, value, {
  2004. eq,
  2005. fn,
  2006. prefix
  2007. });
  2008. }).join(sep);
  2009. }
  2010. // encode the key and add prefix if necessary
  2011. const getKey = (key, prefix = "")=>{
  2012. const encodedKey = encodeURIComponent(key);
  2013. if (prefix) return `${prefix}[${encodedKey}]`;
  2014. return encodedKey;
  2015. };
  2016. // encode the key and value of a query object
  2017. const encode = (key, value, { eq =defaultEq , fn =defaultStringifyFunction , prefix ="" })=>{
  2018. const newValue = encodeURIComponent(fn(key, value));
  2019. const newKey = getKey(key, prefix);
  2020. return [
  2021. newKey,
  2022. newValue
  2023. ].join(eq);
  2024. };
  2025. // check if the given value is an object
  2026. function isObject(obj) {
  2027. const type = typeof obj;
  2028. return obj && (type === "object" || type === "function") || false;
  2029. }
  2030. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (stringify);
  2031. /***/ }),
  2032. /***/ 87098:
  2033. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  2034. "use strict";
  2035. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  2036. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2037. /* harmony export */ "Ck": () => (/* binding */ searchIdToNavigationKey),
  2038. /* harmony export */ "Em": () => (/* binding */ getSearchNavigationResult),
  2039. /* harmony export */ "Gs": () => (/* binding */ getDefaultTranslationIdsByLang),
  2040. /* harmony export */ "NC": () => (/* binding */ getTranslationsByLanguages),
  2041. /* harmony export */ "UC": () => (/* binding */ searchGetResults),
  2042. /* harmony export */ "YA": () => (/* binding */ addToSearchHistory)
  2043. /* harmony export */ });
  2044. /* unused harmony exports LOCALE_TO_TRANSLATION_LANGUAGE, idToPageNumber, idToJuzNumber */
  2045. /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(98492);
  2046. /* harmony import */ var lodash_groupBy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_groupBy__WEBPACK_IMPORTED_MODULE_0__);
  2047. /* harmony import */ var _eventLogger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55943);
  2048. /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(92684);
  2049. /* harmony import */ var _redux_slices_Search_search__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(85895);
  2050. /* harmony import */ var _types_Search_SearchRequestParams__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(92086);
  2051. /* harmony import */ var _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(64609);
  2052. /* harmony import */ var _utils_chapter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95892);
  2053. /* harmony import */ var _utils_locale__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(24709);
  2054. /* harmony import */ var _utils_verse__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(44519);
  2055. /* harmony import */ var types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(87582);
  2056. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_eventLogger__WEBPACK_IMPORTED_MODULE_1__]);
  2057. _eventLogger__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
  2058. /* eslint-disable max-lines */ /* eslint-disable react-func/max-lines-per-function */
  2059. const LOCALE_TO_TRANSLATION_LANGUAGE = {
  2060. en: "english",
  2061. ar: "arabic",
  2062. bn: "bengali",
  2063. fa: "persian",
  2064. fr: "french",
  2065. id: "indonesian",
  2066. it: "italian",
  2067. nl: "dutch",
  2068. pt: "portuguese",
  2069. ru: "russian",
  2070. sq: "albanian",
  2071. th: "thai",
  2072. tr: "turkish",
  2073. ur: "urdu",
  2074. zh: "chinese",
  2075. ms: "malay"
  2076. };
  2077. /**
  2078. * Given a list of translations, group them by language
  2079. * after converting the language name to lowercase to account
  2080. * for case differences e.g. "dutch", "Dutch"
  2081. *
  2082. * @param {AvailableTranslation[]} translations
  2083. * @returns {Record<string, AvailableTranslation[]>}
  2084. */ const getTranslationsByLanguages = (translations)=>{
  2085. const translationByLanguages = lodash_groupBy__WEBPACK_IMPORTED_MODULE_0___default()(translations, (translation)=>translation.languageName.toLowerCase());
  2086. return translationByLanguages;
  2087. };
  2088. /**
  2089. * Get the default translation ids for the passed language.
  2090. *
  2091. * @param {AvailableTranslation[]} translations
  2092. * @param {string} lang
  2093. * @param {boolean} returnAsString
  2094. * @returns {string | string[]}
  2095. */ const getDefaultTranslationIdsByLang = (translations, lang, returnAsString = true)=>{
  2096. const translationsByLanguages = getTranslationsByLanguages(translations);
  2097. let translationIds = [];
  2098. // If the language is in the map, return list of its translation ids
  2099. if (translationsByLanguages[LOCALE_TO_TRANSLATION_LANGUAGE[lang]]) {
  2100. translationIds = translationsByLanguages[LOCALE_TO_TRANSLATION_LANGUAGE[lang]].map((translation)=>translation.id.toString());
  2101. }
  2102. if (returnAsString) {
  2103. return translationIds.join(",");
  2104. }
  2105. return translationIds;
  2106. };
  2107. /**
  2108. * Convert a search id to navigation key. an example of
  2109. * a search id is j29 for Juz 29 or p50 for Page 50.
  2110. *
  2111. * @param {type} type
  2112. * @param {string} id
  2113. * @returns {string}
  2114. */ const searchIdToNavigationKey = (type, id)=>{
  2115. if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.JUZ */ .H.JUZ) {
  2116. // e.g. j29
  2117. return idToJuzNumber(id);
  2118. }
  2119. if (type === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.PAGE */ .H.PAGE) {
  2120. // e.g. p50
  2121. return idToPageNumber(id);
  2122. }
  2123. // e.g. 1 or 1:1 which don't need converting
  2124. return id;
  2125. };
  2126. const idToPageNumber = (id)=>id.substring(id.indexOf("p") + 1);
  2127. const idToJuzNumber = (id)=>id.substring(id.indexOf("j") + 1);
  2128. const getSearchNavigationResult = (chaptersData, result, t, locale)=>{
  2129. const { key , resultType } = result;
  2130. if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.JUZ */ .H.JUZ) {
  2131. const juzNumber = idToJuzNumber(key);
  2132. return {
  2133. name: `${t("common:juz")} ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(Number(juzNumber), locale)}`,
  2134. key: juzNumber,
  2135. resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.JUZ */ .H.JUZ
  2136. };
  2137. }
  2138. if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.PAGE */ .H.PAGE) {
  2139. const pageNumber = idToPageNumber(key);
  2140. return {
  2141. name: `${t("common:page")} ${(0,_utils_locale__WEBPACK_IMPORTED_MODULE_7__/* .toLocalizedNumber */ .rQ)(Number(pageNumber), locale)}`,
  2142. key: pageNumber,
  2143. resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.PAGE */ .H.PAGE
  2144. };
  2145. }
  2146. if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.RANGE */ .H.RANGE) {
  2147. const { surah , from , to } = (0,_utils_verse__WEBPACK_IMPORTED_MODULE_8__/* .getVerseNumberRangeFromKey */ .YN)(key);
  2148. return {
  2149. 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)}`,
  2150. key,
  2151. resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.RANGE */ .H.RANGE
  2152. };
  2153. }
  2154. if (resultType === types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.AYAH */ .H.AYAH) {
  2155. const [surahNumber, ayahNumber] = (0,_utils_verse__WEBPACK_IMPORTED_MODULE_8__/* .getVerseAndChapterNumbersFromKey */ .bV)(key);
  2156. return {
  2157. 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)}`,
  2158. key,
  2159. resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.AYAH */ .H.AYAH
  2160. };
  2161. }
  2162. // when it's a chapter
  2163. return {
  2164. name: `${t("common:surah")} ${(0,_utils_chapter__WEBPACK_IMPORTED_MODULE_6__/* .getChapterData */ .dy)(chaptersData, key).transliteratedName}`,
  2165. key,
  2166. resultType: types_SearchNavigationResult__WEBPACK_IMPORTED_MODULE_9__/* .SearchNavigationType.SURAH */ .H.SURAH
  2167. };
  2168. };
  2169. /**
  2170. * Call BE to fetch the search results using the passed filters
  2171. * and if there are no results call Kalimat API.
  2172. *
  2173. * @param {SearchQuerySource} source
  2174. * @param {string} query
  2175. * @param {number} page
  2176. * @param {number} pageSize
  2177. * @param {(arg: boolean) => void} setIsSearching
  2178. * @param {(arg: boolean) => void} setHasError
  2179. * @param {(data: SearchResponse) => void} setSearchResult
  2180. * @param {string} languages
  2181. * @param {string} translations
  2182. */ const searchGetResults = (source, query, page, pageSize, setIsSearching, setHasError, setSearchResult, languages, translations)=>{
  2183. setIsSearching(true);
  2184. (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logTextSearchQuery */ .tL)(query, source);
  2185. (0,_api__WEBPACK_IMPORTED_MODULE_2__/* .getSearchResults */ .BP)({
  2186. query,
  2187. ...languages && {
  2188. filterLanguages: languages
  2189. },
  2190. size: pageSize,
  2191. page,
  2192. ...translations && {
  2193. filterTranslations: translations
  2194. }
  2195. }).then(async (response)=>{
  2196. if (response.status === 500) {
  2197. setHasError(true);
  2198. } else {
  2199. setSearchResult({
  2200. ...response,
  2201. service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].QDC */ .Z.QDC
  2202. });
  2203. const noQdcResults = response.pagination.totalRecords === 0 && !response.result.navigation.length;
  2204. // if there is no navigations nor verses in the response
  2205. if (noQdcResults) {
  2206. (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logEmptySearchResults */ .Dy)({
  2207. query,
  2208. source,
  2209. service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].QDC */ .Z.QDC
  2210. });
  2211. const kalimatResponse = await (0,_api__WEBPACK_IMPORTED_MODULE_2__/* .getNewSearchResults */ .H4)({
  2212. mode: _types_Search_SearchRequestParams__WEBPACK_IMPORTED_MODULE_4__/* .SearchMode.Advanced */ .N.Advanced,
  2213. query,
  2214. size: pageSize,
  2215. filterLanguages: languages,
  2216. page,
  2217. exactMatchesOnly: 0,
  2218. // translations will be included only when there is a selected translation
  2219. ...translations && {
  2220. filterTranslations: translations,
  2221. translationFields: "resource_name"
  2222. }
  2223. });
  2224. setSearchResult({
  2225. ...kalimatResponse,
  2226. service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].KALIMAT */ .Z.KALIMAT
  2227. });
  2228. if (kalimatResponse.pagination.totalRecords === 0) {
  2229. (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logEmptySearchResults */ .Dy)({
  2230. query,
  2231. source,
  2232. service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].KALIMAT */ .Z.KALIMAT
  2233. });
  2234. } else {
  2235. (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logSearchResults */ .qS)({
  2236. query,
  2237. source,
  2238. service: _types_Search_SearchService__WEBPACK_IMPORTED_MODULE_5__/* ["default"].KALIMAT */ .Z.KALIMAT
  2239. });
  2240. }
  2241. }
  2242. }
  2243. }).catch(()=>{
  2244. setHasError(true);
  2245. }).finally(()=>{
  2246. setIsSearching(false);
  2247. });
  2248. };
  2249. /**
  2250. * Adds the searched text to the recent history.
  2251. *
  2252. * @param {Dispatch<AnyAction>} dispatch
  2253. * @param {string} debouncedSearchQuery
  2254. * @param {SearchQuerySource} source
  2255. */ const addToSearchHistory = (dispatch, debouncedSearchQuery, source)=>{
  2256. dispatch({
  2257. type: _redux_slices_Search_search__WEBPACK_IMPORTED_MODULE_3__/* .addSearchHistoryRecord.type */ .zr.type,
  2258. payload: debouncedSearchQuery
  2259. });
  2260. (0,_eventLogger__WEBPACK_IMPORTED_MODULE_1__/* .logTextSearchQuery */ .tL)(debouncedSearchQuery, source);
  2261. };
  2262. __webpack_async_result__();
  2263. } catch(e) { __webpack_async_result__(e); } });
  2264. /***/ }),
  2265. /***/ 44519:
  2266. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2267. "use strict";
  2268. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2269. /* harmony export */ "Bo": () => (/* binding */ getDistanceBetweenVerses),
  2270. /* harmony export */ "G$": () => (/* binding */ makeWordLocation),
  2271. /* harmony export */ "LQ": () => (/* binding */ getVerseWords),
  2272. /* harmony export */ "TO": () => (/* binding */ getWordDataByLocation),
  2273. /* harmony export */ "Tc": () => (/* binding */ getChapterNumberFromKey),
  2274. /* harmony export */ "YN": () => (/* binding */ getVerseNumberRangeFromKey),
  2275. /* harmony export */ "Yx": () => (/* binding */ isVerseKeyWithinRanges),
  2276. /* harmony export */ "ZZ": () => (/* binding */ getFirstWordOfSurah),
  2277. /* harmony export */ "bV": () => (/* binding */ getVerseAndChapterNumbersFromKey),
  2278. /* harmony export */ "cI": () => (/* binding */ getFirstAndLastVerseKeys),
  2279. /* harmony export */ "kC": () => (/* binding */ isLastVerseOfSurah),
  2280. /* harmony export */ "qB": () => (/* binding */ generateChapterVersesKeys),
  2281. /* harmony export */ "tR": () => (/* binding */ getVerseNumberFromKey),
  2282. /* harmony export */ "u": () => (/* binding */ makeVerseKey)
  2283. /* harmony export */ });
  2284. /* unused harmony exports sortWordLocation, formatChapterId, getVerseUrl, sortByVerseKey, sortVersesObjectByVerseKeys, isFirstVerseOfSurah, getChapterFirstAndLastVerseKey, shortenVerseText */
  2285. /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64042);
  2286. /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_0__);
  2287. /* harmony import */ var _chapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95892);
  2288. /* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19303);
  2289. /* harmony import */ var _verseKeys__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36495);
  2290. /* eslint-disable max-lines */ /* eslint-disable react-func/max-lines-per-function */
  2291. const COLON_SPLITTER = ":";
  2292. /**
  2293. * This will generate all the keys for the verses of a chapter. a key is `{chapterId}:{verseId}`.
  2294. *
  2295. * @param {ChaptersData} data
  2296. * @param {string} chapterId
  2297. * @returns {string[]}
  2298. */ const generateChapterVersesKeys = (data, chapterId)=>{
  2299. const chapterNumberString = (0,_number__WEBPACK_IMPORTED_MODULE_3__/* .formatStringNumber */ .XK)(chapterId);
  2300. return lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(data[chapterNumberString].versesCount).map((verseId)=>`${chapterNumberString}:${verseId + 1}`);
  2301. };
  2302. /**
  2303. * Get the chapter number from its key. A key is the combination between the verse's chapter
  2304. * and its number separated by ":" e.g. 1:5.
  2305. *
  2306. * @param {string} verseKey
  2307. * @returns {number} The verse number extracted from the key.
  2308. */ const getChapterNumberFromKey = (verseKey)=>Number(verseKey.split(COLON_SPLITTER)[0]);
  2309. /**
  2310. * Get the verse number from its key. A key is the combination between the verse's chapter
  2311. * and its number separated by ":" e.g. 1:5.
  2312. *
  2313. * @param {string} verseKey
  2314. * @returns {number} The verse number extracted from the key.
  2315. */ const getVerseNumberFromKey = (verseKey)=>Number(verseKey.split(COLON_SPLITTER)[1]);
  2316. /**
  2317. * If the verse is a range of verses, for example 1:3-5
  2318. * we'll return {surah: 1, from: 3, to: 5}
  2319. *
  2320. * @param {string} verseKey
  2321. * @returns {surah: number, from: Number, to: Number}
  2322. */ const getVerseNumberRangeFromKey = (verseKey)=>{
  2323. const splits = verseKey.split(COLON_SPLITTER);
  2324. const surahNumber = splits[0];
  2325. const verseNumber = splits[1]; // for example (3-5)
  2326. const [from, to] = verseNumber.split("-"); // for example [3, 5]
  2327. return {
  2328. surah: Number(surahNumber),
  2329. from: Number(from),
  2330. to: to ? Number(to) : Number(from)
  2331. };
  2332. };
  2333. /**
  2334. * Get the chapter and verse number of a verse from its key.
  2335. *
  2336. * @param {string} verseKey
  2337. * @returns {[string, string]} The verse number extracted from the key.
  2338. */ const getVerseAndChapterNumbersFromKey = (verseKey)=>{
  2339. const splits = verseKey.split(COLON_SPLITTER);
  2340. return [
  2341. splits[0],
  2342. splits[1]
  2343. ];
  2344. };
  2345. /**
  2346. * Split the word's location and get the surahNumber, verseNumber and wordNumber.
  2347. *
  2348. * @param {string} wordLocation the word location {surahNumber}:{verseNumber}:{wordNumber}
  2349. * @returns {[string, string, string]}
  2350. */ const getWordDataByLocation = (wordLocation)=>{
  2351. const locationSplits = wordLocation.split(COLON_SPLITTER);
  2352. return [
  2353. locationSplits[0],
  2354. locationSplits[1],
  2355. locationSplits[2]
  2356. ];
  2357. };
  2358. /**
  2359. * Extract the data related to a word. The first is the chapter Id,
  2360. * the second is whether the word is the first word of the first verse
  2361. * of the Surah. To do that we will have to split the word location
  2362. * which comes in the following format: {surahNumber}:{verseNumber}:{wordNumber}.
  2363. * For this to be true, the combination of {verseNumber}:{wordNumber} has to be
  2364. * 1:1.
  2365. *
  2366. * @param {string} wordLocation whose format is {surahNumber}:{verseNumber}:{wordNumber} e.g. "112:1:1"
  2367. * @returns {{ chapterId: string; isFirstWordOfSurah: boolean }}
  2368. */ const getFirstWordOfSurah = (wordLocation)=>{
  2369. const locationSplits = getWordDataByLocation(wordLocation);
  2370. return {
  2371. chapterId: locationSplits[0],
  2372. isFirstWordOfSurah: locationSplits[1] === "1" && locationSplits[2] === "1"
  2373. };
  2374. };
  2375. /**
  2376. * sort the the word location of the verses
  2377. *
  2378. * @param {string[]} locations , the location of the word, Example ['1:1:2', '1:1:1', '1:3:1]
  2379. * @returns {number} sortedLocations , Example ['1:1:1', '1:1:2', '1:3:1']
  2380. *
  2381. * Reference: https://gomakethings.com/sorting-an-array-by-multiple-criteria-with-vanilla-javascript/
  2382. */ const sortWordLocation = (locations)=>locations.sort((a, b)=>{
  2383. const [aChapter, aVerse, aWord] = a.split(":");
  2384. const [bChapter, bVerse, bWord] = b.split(":");
  2385. if (Number(aChapter) > Number(bChapter)) return 1;
  2386. if (Number(aChapter) < Number(bChapter)) return -1;
  2387. if (Number(aVerse) > Number(bVerse)) return 1;
  2388. if (Number(aVerse) < Number(bVerse)) return -1;
  2389. if (Number(aWord) > Number(bWord)) return 1;
  2390. if (Number(aWord) < Number(bWord)) return -1;
  2391. return 0;
  2392. });
  2393. /**
  2394. * Format chapter id, add prefix '0' if it's a single digit number
  2395. *
  2396. * @param {string} id chapter id
  2397. * @returns {string} formattedChapterId
  2398. *
  2399. * @example
  2400. * // returns '01'
  2401. * formatChapterId('1')
  2402. * @example
  2403. * // returns '102'
  2404. * formatChapterId('102')
  2405. */ const formatChapterId = (id)=>`0${id}`.slice(-2);
  2406. /**
  2407. * Given the verseKey, return the verseUrl
  2408. *
  2409. * @param {string} verseKey example: "1:5"
  2410. * @returns {string} verseUrl , example "/1/5";
  2411. */ const getVerseUrl = (verseKey)=>{
  2412. const [chapterNumber, verseNumber] = getVerseAndChapterNumbersFromKey(verseKey);
  2413. return `/${chapterNumber}/${verseNumber}`;
  2414. };
  2415. /**
  2416. * This is a sorting function that is meant to be used with array.sort() function
  2417. * to sort a list of verse keys to match their appearance in the Mushaf.
  2418. *
  2419. * @param {string} verseKey1
  2420. * @param {string} verseKey2
  2421. * @returns {number}
  2422. */ const sortByVerseKey = (verseKey1, verseKey2)=>{
  2423. const [chapterId1, verseId1] = getVerseAndChapterNumbersFromKey(verseKey1);
  2424. const [chapterId2, verseId2] = getVerseAndChapterNumbersFromKey(verseKey2);
  2425. const chapterId1Number = Number(chapterId1);
  2426. const chapterId2Number = Number(chapterId2);
  2427. const verseId1Number = Number(verseId1);
  2428. const verseId2Number = Number(verseId2);
  2429. if (chapterId1Number > chapterId2Number) {
  2430. return 1;
  2431. }
  2432. if (chapterId1Number < chapterId2Number) {
  2433. return -1;
  2434. }
  2435. return verseId1Number > verseId2Number ? 1 : -1;
  2436. };
  2437. /**
  2438. * Sort an object by keys whose keys are verse keys.
  2439. *
  2440. * @param {Record<string, unknown>} object
  2441. * @returns {Record<string, unknown>}
  2442. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
  2443. const sortVersesObjectByVerseKeys = (object)=>{
  2444. const sortedObject = {};
  2445. Object.keys(object).sort((verseKey1, verseKey2)=>sortByVerseKey(verseKey1, verseKey2)).forEach((verseKey)=>{
  2446. sortedObject[verseKey] = object[verseKey];
  2447. });
  2448. return sortedObject;
  2449. };
  2450. /**
  2451. * make verseKey from chapterNumber and verseNumber, example "1:5"
  2452. *
  2453. * @param {number|string} chapterNumber
  2454. * @param {number|string} verseNumberOrRangeFrom
  2455. * @param {number|string} rangeTo
  2456. * @returns {string}
  2457. */ const makeVerseKey = (chapterNumber, verseNumberOrRangeFrom, rangeTo)=>{
  2458. if (rangeTo && verseNumberOrRangeFrom !== rangeTo) {
  2459. return `${chapterNumber}:${verseNumberOrRangeFrom}-${rangeTo}`;
  2460. }
  2461. return `${chapterNumber}:${verseNumberOrRangeFrom}`;
  2462. };
  2463. /**
  2464. * make wordLocation from verseKey and wordPosition, example "1:1:2"
  2465. *
  2466. * @param {string} verseKey
  2467. * @param {string} wordPosition
  2468. * @returns {string} wordLocation
  2469. */ const makeWordLocation = (verseKey, wordPosition)=>`${verseKey}:${wordPosition}`;
  2470. /**
  2471. * Get the words of each verse. This can be used to extend
  2472. * the BE response of each word to add custom fields.
  2473. *
  2474. * @param {Verse} verse
  2475. * @param {boolean} isReadingView
  2476. * @returns {Word[]}
  2477. */ const getVerseWords = (verse, isReadingView = false)=>{
  2478. const words = [];
  2479. verse.words.forEach((word)=>{
  2480. const wordVerse = {
  2481. ...verse
  2482. };
  2483. words.push({
  2484. ...word,
  2485. hizbNumber: verse.hizbNumber,
  2486. ...isReadingView && {
  2487. verse: wordVerse
  2488. }
  2489. });
  2490. });
  2491. return words;
  2492. };
  2493. /**
  2494. * Calculate the number of verses in a range of chapters.
  2495. *
  2496. * @param {ChaptersData} chaptersData
  2497. * @param {number} startChapter
  2498. * @param {number} endChapter
  2499. * @returns {number}
  2500. */ const getNumberOfVersesInRangeOfChapters = (chaptersData, startChapter, endChapter)=>{
  2501. let total = 0;
  2502. for(let currentChapterId = startChapter; currentChapterId < endChapter; currentChapterId += 1){
  2503. total += (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, String(currentChapterId)).versesCount;
  2504. }
  2505. return total;
  2506. };
  2507. /**
  2508. * Calculate how far apart 2 verses are from each other. The order of the verses
  2509. * won't matter as we swap them if they are not in the same order of the Mushaf.
  2510. *
  2511. * @param {ChaptersData} chaptersData
  2512. * @param {string} firstVerseKey
  2513. * @param {string} secondVerseKey
  2514. *
  2515. * @returns {number}
  2516. */ const getDistanceBetweenVerses = (chaptersData, firstVerseKey, secondVerseKey)=>{
  2517. // eslint-disable-next-line prefer-const
  2518. let [firstChapterString, firstVerseNumberString] = getVerseAndChapterNumbersFromKey(firstVerseKey);
  2519. const [secondChapterString, secondVerseNumberString] = getVerseAndChapterNumbersFromKey(secondVerseKey);
  2520. let firstChapterNumber = Number(firstChapterString);
  2521. let secondChapterNumber = Number(secondChapterString);
  2522. let firstVerseNumber = Number(firstVerseNumberString);
  2523. let secondVerseNumber = Number(secondVerseNumberString);
  2524. // if they are within the same chapter
  2525. if (firstChapterNumber === secondChapterNumber) {
  2526. if (firstVerseNumber > secondVerseNumber) {
  2527. return firstVerseNumber - secondVerseNumber;
  2528. }
  2529. return secondVerseNumber - firstVerseNumber;
  2530. }
  2531. // if the first verse chapter is after the second, we swap them to match the same order in the Mushaf
  2532. if (firstChapterNumber > secondChapterNumber) {
  2533. [firstVerseNumber, secondVerseNumber, firstChapterNumber, secondChapterNumber, firstChapterString, ] = [
  2534. secondVerseNumber,
  2535. firstVerseNumber,
  2536. secondChapterNumber,
  2537. firstChapterNumber,
  2538. secondChapterString,
  2539. ];
  2540. }
  2541. let distance = 0;
  2542. // if there is more than 1 full chapter in between the verses' chapters being checked, we sum the number of verses in each chapter.
  2543. if (secondChapterNumber - firstChapterNumber > 1) {
  2544. distance += getNumberOfVersesInRangeOfChapters(chaptersData, firstChapterNumber + 1, secondChapterNumber);
  2545. }
  2546. /*
  2547. 1. we add the number of verses from beginning of the second verse's chapter -> the verse itself.
  2548. 2. we add the difference between the last verse of the first verse's chapter and the first verse itself.
  2549. */ return distance + secondVerseNumber + (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, firstChapterString).versesCount - firstVerseNumber;
  2550. };
  2551. /**
  2552. * Whether the current verse is the first in surah.
  2553. *
  2554. * @param {number} verseNumber
  2555. * @returns {boolean}
  2556. */ const isFirstVerseOfSurah = (verseNumber)=>verseNumber === 1;
  2557. /**
  2558. * Whether the current verse is the last in surah.
  2559. *
  2560. * @param {ChaptersData} chaptersData
  2561. * @param {string} chapterNumber
  2562. * @param {number} verseNumber
  2563. * @returns {boolean}
  2564. */ const isLastVerseOfSurah = (chaptersData, chapterNumber, verseNumber)=>verseNumber === (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, chapterNumber).versesCount;
  2565. const getChapterFirstAndLastVerseKey = (chaptersData, chapterId)=>{
  2566. if (!chaptersData) {
  2567. return [
  2568. "",
  2569. ""
  2570. ];
  2571. }
  2572. const chapterData = getChapterData(chaptersData, chapterId);
  2573. return [
  2574. makeVerseKey(Number(chapterId), 1),
  2575. makeVerseKey(Number(chapterId), chapterData.versesCount),
  2576. ];
  2577. };
  2578. /**
  2579. * Shorten a text by setting the maximum number of characters
  2580. * by the value of the parameter and adding "..." at the end.
  2581. *
  2582. * @param {string} text
  2583. * @param {number} length
  2584. * @returns {string}
  2585. */ const shortenVerseText = (text, length = 150)=>{
  2586. const characters = text.split("", length);
  2587. let shortenedText = "";
  2588. for(let index = 0; index < characters.length; index += 1){
  2589. const character = characters[index];
  2590. if (shortenedText.length === length - 1) {
  2591. shortenedText = `${shortenedText}${character}...`;
  2592. break;
  2593. }
  2594. shortenedText = `${shortenedText}${character}`;
  2595. }
  2596. return shortenedText;
  2597. };
  2598. /**
  2599. * Given list of verses, get all the first and the last verseKeys
  2600. *
  2601. * @param {Record<string, Verse>} verses
  2602. * @returns {string[]} [firstVerseKey, lastVerseKey]
  2603. */ const getFirstAndLastVerseKeys = (verses)=>{
  2604. const verseKeys = Object.keys(verses).sort(sortByVerseKey);
  2605. return [
  2606. verseKeys[0],
  2607. verseKeys[verseKeys.length - 1]
  2608. ];
  2609. };
  2610. /**
  2611. * This function checks if a verse key is within a range or an array of ranges.
  2612. *
  2613. * Examples:
  2614. * - `isVerseKeyWithinRanges('1:1', '1:1-1:7')` -> `true`
  2615. * - `isVerseKeyWithinRanges('1:1', '1:2-1:7')` -> `false`
  2616. * - `isVerseKeyWithinRanges('2:4', ['1:1-1:7', '2:1-2:5'])` -> `true`
  2617. * - `isVerseKeyWithinRanges('2:10', ['1:2-1:7', '2:1-2:5'])` -> `false`
  2618. *
  2619. * @param {string} verseKey - verse key, e.g. 1:1
  2620. * @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']`
  2621. * @returns {boolean}
  2622. */ const isVerseKeyWithinRanges = (verseKey, ranges)=>{
  2623. const [chapter, verse] = getVerseAndChapterNumbersFromKey(verseKey).map(Number);
  2624. const rangesArray = Array.isArray(ranges) ? ranges : [
  2625. ranges
  2626. ];
  2627. for(let i = 0; i < rangesArray.length; i += 1){
  2628. const verseRange = rangesArray[i];
  2629. const [from, to] = (0,_verseKeys__WEBPACK_IMPORTED_MODULE_2__/* .parseVerseRange */ .p)(verseRange, true);
  2630. // if the chapter is less than or greater than the range, then skip this range
  2631. if (chapter < from.chapter || chapter > to.chapter) {
  2632. continue;
  2633. }
  2634. // if the chapter is equal to the chapter of the range start, then check if the verse is within the range
  2635. // if the verse is less than the range, then skip this range
  2636. if (chapter === from.chapter && verse < from.verse) {
  2637. continue;
  2638. }
  2639. // if the chapter is equal to the chapter of the range end, then check if the verse is within the range
  2640. // if the verse is greater than the range, then skip this range
  2641. if (chapter === to.chapter && verse > to.verse) {
  2642. continue;
  2643. }
  2644. // if we're here, it means that the verse is within the range
  2645. // so we can return true directly and end the loop
  2646. return true;
  2647. }
  2648. // if we're here, it means that the verse is not within any of the ranges
  2649. // so we can return false
  2650. return false;
  2651. };
  2652. /***/ }),
  2653. /***/ 36495:
  2654. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2655. "use strict";
  2656. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2657. /* harmony export */ "h": () => (/* binding */ generateVerseKeysBetweenTwoVerseKeys),
  2658. /* harmony export */ "p": () => (/* binding */ parseVerseRange)
  2659. /* harmony export */ });
  2660. /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(64042);
  2661. /* harmony import */ var lodash_range__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_range__WEBPACK_IMPORTED_MODULE_0__);
  2662. /* harmony import */ var _chapter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(95892);
  2663. /* eslint-disable react-func/max-lines-per-function */ /* eslint-disable import/prefer-default-export */
  2664. /**
  2665. * Generate the verse keys between two verse keys.
  2666. *
  2667. * @param {ChaptersData} chaptersData
  2668. * @param {string} fromVerseKey
  2669. * @param {string} toVerseKey
  2670. * @returns {string[]}
  2671. */ const generateVerseKeysBetweenTwoVerseKeys = (chaptersData, fromVerseKey, toVerseKey)=>{
  2672. const verseKeys = [];
  2673. const [startChapter, startVerse] = fromVerseKey.split(":");
  2674. const [endChapter, endVerse] = toVerseKey.split(":");
  2675. if (startChapter === endChapter) {
  2676. lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(Number(startVerse), Number(endVerse) + 1).forEach((verseNumber)=>{
  2677. verseKeys.push(`${startChapter}:${verseNumber}`);
  2678. });
  2679. } else {
  2680. lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(Number(startChapter), Number(endChapter) + 1).forEach((chapterNumber)=>{
  2681. if (chapterNumber === Number(startChapter)) {
  2682. const chapterData = (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, startChapter);
  2683. lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(Number(startVerse), chapterData.versesCount + 1).forEach((verseNumber)=>{
  2684. verseKeys.push(`${startChapter}:${verseNumber}`);
  2685. });
  2686. } else if (chapterNumber === Number(endChapter)) {
  2687. lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(1, Number(endVerse) + 1).forEach((verseNumber)=>{
  2688. verseKeys.push(`${endChapter}:${verseNumber}`);
  2689. });
  2690. } else {
  2691. const chapterData1 = (0,_chapter__WEBPACK_IMPORTED_MODULE_1__/* .getChapterData */ .dy)(chaptersData, String(chapterNumber));
  2692. lodash_range__WEBPACK_IMPORTED_MODULE_0___default()(1, chapterData1.versesCount + 1).forEach((verseNumber)=>{
  2693. verseKeys.push(`${chapterNumber}:${verseNumber}`);
  2694. });
  2695. }
  2696. });
  2697. }
  2698. return verseKeys;
  2699. };
  2700. const parseVerseRange = (verseRange, parseAsNumbers)=>{
  2701. const result = verseRange.match(/(\d+):(\d+)-(\d+):(\d+)/);
  2702. if (!result) {
  2703. return null;
  2704. }
  2705. const [, startChapter, startVerse, endChapter, endVerse] = result;
  2706. if (!startChapter || !startVerse || !endChapter || !endVerse) {
  2707. return null;
  2708. }
  2709. const parse = (value)=>parseAsNumbers ? Number(value) : value;
  2710. return [
  2711. {
  2712. chapter: parse(startChapter),
  2713. verse: parse(startVerse),
  2714. verseKey: `${startChapter}:${startVerse}`
  2715. },
  2716. {
  2717. chapter: parse(endChapter),
  2718. verse: parse(endVerse),
  2719. verseKey: `${endChapter}:${endVerse}`
  2720. },
  2721. ];
  2722. };
  2723. /***/ }),
  2724. /***/ 11721:
  2725. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2726. "use strict";
  2727. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2728. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  2729. /* harmony export */ });
  2730. var QueryParam;
  2731. (function(QueryParam) {
  2732. QueryParam["Translations"] = "translations";
  2733. QueryParam["Reciter"] = "reciter";
  2734. QueryParam["WBW_LOCALE"] = "wbw_locale";
  2735. QueryParam["HIDE_ARABIC"] = "hideArabic";
  2736. QueryParam["FLOW"] = "flow";
  2737. QueryParam["STARTING_VERSE"] = "startingVerse";
  2738. QueryParam["QUERY"] = "query";
  2739. QueryParam["REDIRECT_TO"] = "r";
  2740. })(QueryParam || (QueryParam = {}));
  2741. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (QueryParam);
  2742. /***/ }),
  2743. /***/ 50467:
  2744. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2745. "use strict";
  2746. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2747. /* harmony export */ "AN": () => (/* binding */ MushafLines),
  2748. /* harmony export */ "Bc": () => (/* binding */ QuranReaderFlow),
  2749. /* harmony export */ "MB": () => (/* binding */ WordClickFunctionality),
  2750. /* harmony export */ "Oj": () => (/* binding */ WordByWordType),
  2751. /* harmony export */ "PT": () => (/* binding */ WordByWordDisplay),
  2752. /* harmony export */ "Qi": () => (/* binding */ QuranReaderDataType),
  2753. /* harmony export */ "RA": () => (/* binding */ Mushaf),
  2754. /* harmony export */ "fr": () => (/* binding */ QuranFont),
  2755. /* harmony export */ "m3": () => (/* binding */ ReadingPreference),
  2756. /* harmony export */ "ru": () => (/* binding */ QuranFontMushaf),
  2757. /* harmony export */ "v3": () => (/* binding */ FALLBACK_FONT)
  2758. /* harmony export */ });
  2759. var WordByWordType;
  2760. (function(WordByWordType) {
  2761. WordByWordType["Translation"] = "translation";
  2762. WordByWordType["Transliteration"] = "transliteration";
  2763. })(WordByWordType || (WordByWordType = {}));
  2764. var ReadingPreference;
  2765. (function(ReadingPreference) {
  2766. ReadingPreference["Translation"] = "translation";
  2767. ReadingPreference["Reading"] = "reading";
  2768. })(ReadingPreference || (ReadingPreference = {}));
  2769. var WordClickFunctionality;
  2770. (function(WordClickFunctionality) {
  2771. WordClickFunctionality["PlayAudio"] = "play-audio";
  2772. WordClickFunctionality["NoAudio"] = "no-audio";
  2773. })(WordClickFunctionality || (WordClickFunctionality = {}));
  2774. var QuranReaderDataType;
  2775. (function(QuranReaderDataType) {
  2776. QuranReaderDataType["Chapter"] = "chapter";
  2777. QuranReaderDataType["Verse"] = "verse";
  2778. QuranReaderDataType["ChapterVerseRanges"] = "chapterVerseRanges";
  2779. QuranReaderDataType["Ranges"] = "ranges";
  2780. QuranReaderDataType["Tafsir"] = "tafsir";
  2781. QuranReaderDataType["SelectedTafsir"] = "selectedTafsir";
  2782. QuranReaderDataType["Hizb"] = "hizb";
  2783. QuranReaderDataType["Juz"] = "juz";
  2784. QuranReaderDataType["Rub"] = "rub";
  2785. QuranReaderDataType["Page"] = "page";
  2786. })(QuranReaderDataType || (QuranReaderDataType = {}));
  2787. var QuranFont;
  2788. (function(QuranFont) {
  2789. QuranFont["MadaniV1"] = "code_v1";
  2790. QuranFont["MadaniV2"] = "code_v2";
  2791. QuranFont["Uthmani"] = "text_uthmani";
  2792. QuranFont["IndoPak"] = "text_indopak";
  2793. QuranFont["QPCHafs"] = "qpc_uthmani_hafs";
  2794. QuranFont["Tajweed"] = "tajweed";
  2795. })(QuranFont || (QuranFont = {}));
  2796. const FALLBACK_FONT = QuranFont.QPCHafs;
  2797. var MushafLines;
  2798. (function(MushafLines) {
  2799. MushafLines["FifteenLines"] = "15_lines";
  2800. MushafLines["SixteenLines"] = "16_lines";
  2801. })(MushafLines || (MushafLines = {}));
  2802. var Mushaf;
  2803. (function(Mushaf) {
  2804. Mushaf[Mushaf["QCFV2"] = 1] = "QCFV2";
  2805. Mushaf[Mushaf["QCFV1"] = 2] = "QCFV1";
  2806. Mushaf[Mushaf["Indopak"] = 3] = "Indopak";
  2807. Mushaf[Mushaf["UthmaniHafs"] = 4] = "UthmaniHafs";
  2808. Mushaf[Mushaf["KFGQPCHAFS"] = 5] = "KFGQPCHAFS";
  2809. Mushaf[Mushaf["Indopak15Lines"] = 6] = "Indopak15Lines";
  2810. Mushaf[Mushaf["Indopak16Lines"] = 7] = "Indopak16Lines";
  2811. Mushaf[Mushaf["Tajweeed"] = 11] = "Tajweeed";
  2812. })(Mushaf || (Mushaf = {}));
  2813. const QuranFontMushaf = {
  2814. [QuranFont.MadaniV1]: Mushaf.QCFV1,
  2815. [QuranFont.MadaniV2]: Mushaf.QCFV2,
  2816. [QuranFont.Uthmani]: Mushaf.UthmaniHafs,
  2817. [QuranFont.IndoPak]: Mushaf.Indopak,
  2818. [QuranFont.QPCHafs]: Mushaf.KFGQPCHAFS,
  2819. [QuranFont.Tajweed]: Mushaf.Tajweeed
  2820. };
  2821. var WordByWordDisplay;
  2822. (function(WordByWordDisplay) {
  2823. WordByWordDisplay["INLINE"] = "inline";
  2824. WordByWordDisplay["TOOLTIP"] = "tooltip";
  2825. })(WordByWordDisplay || (WordByWordDisplay = {}));
  2826. var QuranReaderFlow;
  2827. (function(QuranReaderFlow) {
  2828. QuranReaderFlow["QURANIC_CALENDER"] = "calendar";
  2829. })(QuranReaderFlow || (QuranReaderFlow = {}));
  2830. /* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({
  2831. ReadingPreference,
  2832. QuranFont
  2833. });
  2834. /***/ }),
  2835. /***/ 92086:
  2836. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2837. "use strict";
  2838. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2839. /* harmony export */ "N": () => (/* binding */ SearchMode)
  2840. /* harmony export */ });
  2841. var SearchMode;
  2842. (function(SearchMode) {
  2843. SearchMode["Advanced"] = "advanced";
  2844. SearchMode["Quick"] = "quick";
  2845. })(SearchMode || (SearchMode = {}));
  2846. /***/ }),
  2847. /***/ 64609:
  2848. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2849. "use strict";
  2850. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2851. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  2852. /* harmony export */ });
  2853. var SearchService;
  2854. (function(SearchService) {
  2855. SearchService["KALIMAT"] = "kalimat";
  2856. SearchService["QDC"] = "qdc";
  2857. SearchService["Tarteel"] = "tarteel";
  2858. })(SearchService || (SearchService = {}));
  2859. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchService);
  2860. /***/ }),
  2861. /***/ 87582:
  2862. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2863. "use strict";
  2864. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2865. /* harmony export */ "H": () => (/* binding */ SearchNavigationType)
  2866. /* harmony export */ });
  2867. var SearchNavigationType;
  2868. (function(SearchNavigationType) {
  2869. SearchNavigationType["SURAH"] = "surah";
  2870. SearchNavigationType["JUZ"] = "juz";
  2871. SearchNavigationType["HIZB"] = "hizb";
  2872. SearchNavigationType["AYAH"] = "ayah";
  2873. SearchNavigationType["RUB_EL_HIZB"] = "rub_el_hizb";
  2874. SearchNavigationType["SEARCH_PAGE"] = "search_page";
  2875. SearchNavigationType["PAGE"] = "page";
  2876. SearchNavigationType["RANGE"] = "range";
  2877. })(SearchNavigationType || (SearchNavigationType = {}));
  2878. /***/ }),
  2879. /***/ 73634:
  2880. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  2881. "use strict";
  2882. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  2883. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  2884. /* harmony export */ });
  2885. var SearchType;
  2886. (function(SearchType) {
  2887. SearchType["Voice"] = "voice";
  2888. SearchType["Text"] = "text";
  2889. })(SearchType || (SearchType = {}));
  2890. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchType);
  2891. /***/ }),
  2892. /***/ 70301:
  2893. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  2894. var map = {
  2895. "./ar": 59875,
  2896. "./ar.ts": 59875,
  2897. "./bn": 79395,
  2898. "./bn.ts": 79395,
  2899. "./en": 84835,
  2900. "./en.ts": 84835,
  2901. "./fa": 15412,
  2902. "./fa.ts": 15412,
  2903. "./fr": 30823,
  2904. "./fr.ts": 30823,
  2905. "./id": 41950,
  2906. "./id.ts": 41950,
  2907. "./it": 84443,
  2908. "./it.ts": 84443,
  2909. "./ms": 38195,
  2910. "./ms.ts": 38195,
  2911. "./nl": 10024,
  2912. "./nl.ts": 10024,
  2913. "./pt": 80563,
  2914. "./pt.ts": 80563,
  2915. "./ru": 23269,
  2916. "./ru.ts": 23269,
  2917. "./sq": 12586,
  2918. "./sq.ts": 12586,
  2919. "./th": 43222,
  2920. "./th.ts": 43222,
  2921. "./tr": 79896,
  2922. "./tr.ts": 79896,
  2923. "./ur": 80046,
  2924. "./ur.ts": 80046,
  2925. "./zh": 5492,
  2926. "./zh.ts": 5492
  2927. };
  2928. function webpackContext(req) {
  2929. var id = webpackContextResolve(req);
  2930. return __webpack_require__(id);
  2931. }
  2932. function webpackContextResolve(req) {
  2933. if(!__webpack_require__.o(map, req)) {
  2934. var e = new Error("Cannot find module '" + req + "'");
  2935. e.code = 'MODULE_NOT_FOUND';
  2936. throw e;
  2937. }
  2938. return map[req];
  2939. }
  2940. webpackContext.keys = function webpackContextKeys() {
  2941. return Object.keys(map);
  2942. };
  2943. webpackContext.resolve = webpackContextResolve;
  2944. module.exports = webpackContext;
  2945. webpackContext.id = 70301;
  2946. /***/ })
  2947. };
  2948. ;
  2949. //# sourceMappingURL=57933.js.map