@quranjs/api 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/api.cjs.development.js +2627 -0
  2. package/dist/api.cjs.development.js.map +1 -0
  3. package/dist/api.cjs.production.min.js +2 -0
  4. package/dist/api.cjs.production.min.js.map +1 -0
  5. package/dist/api.esm.js +2618 -0
  6. package/dist/api.esm.js.map +1 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.js +8 -0
  9. package/dist/sdk/index.d.ts +183 -0
  10. package/dist/sdk/utils.d.ts +125 -0
  11. package/dist/sdk/v4/_fetcher.d.ts +3 -0
  12. package/dist/sdk/v4/audio.d.ts +52 -0
  13. package/dist/sdk/v4/chapters.d.ts +13 -0
  14. package/dist/sdk/v4/index.d.ts +173 -0
  15. package/dist/sdk/v4/juzs.d.ts +5 -0
  16. package/dist/sdk/v4/resources.d.ts +26 -0
  17. package/dist/sdk/v4/search.d.ts +22 -0
  18. package/dist/sdk/v4/verses.d.ts +64 -0
  19. package/dist/types/ChapterId.d.ts +1 -0
  20. package/dist/types/HizbNumber.d.ts +1 -0
  21. package/dist/types/JuzNumber.d.ts +1 -0
  22. package/dist/types/PageNumber.d.ts +1 -0
  23. package/dist/types/RubNumber.d.ts +1 -0
  24. package/dist/types/VerseKey.d.ts +1 -0
  25. package/dist/types/api/ApiResponses.d.ts +18 -0
  26. package/dist/types/api/AudioData.d.ts +17 -0
  27. package/dist/types/api/AudioResponse.d.ts +8 -0
  28. package/dist/types/api/Chapter.d.ts +14 -0
  29. package/dist/types/api/ChapterInfo.d.ts +8 -0
  30. package/dist/types/api/Footnote.d.ts +6 -0
  31. package/dist/types/api/Juz.d.ts +8 -0
  32. package/dist/types/api/Pagination.d.ts +7 -0
  33. package/dist/types/api/Reciter.d.ts +21 -0
  34. package/dist/types/api/Resources.d.ts +70 -0
  35. package/dist/types/api/Segment.d.ts +4 -0
  36. package/dist/types/api/Tafsir.d.ts +7 -0
  37. package/dist/types/api/TafsirInfo.d.ts +9 -0
  38. package/dist/types/api/TranslatedName.d.ts +4 -0
  39. package/dist/types/api/Translation.d.ts +17 -0
  40. package/dist/types/api/Transliteration.d.ts +4 -0
  41. package/dist/types/api/Verse.d.ts +32 -0
  42. package/dist/types/api/Word.d.ts +28 -0
  43. package/dist/types/api/index.d.ts +18 -0
  44. package/dist/types/index.d.ts +88 -0
  45. package/dist/utils/misc.d.ts +1 -0
  46. package/dist/utils/qs-stringify.d.ts +21 -0
  47. package/package.json +1 -1
@@ -0,0 +1,2627 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var types = require('@/types');
6
+ var fetch = require('cross-fetch');
7
+ var humps = require('humps');
8
+ var stringify = require('@/utils/qs-stringify');
9
+ var misc = require('@/utils/misc');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch);
14
+ var stringify__default = /*#__PURE__*/_interopDefaultLegacy(stringify);
15
+
16
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
17
+ try {
18
+ var info = gen[key](arg);
19
+ var value = info.value;
20
+ } catch (error) {
21
+ reject(error);
22
+ return;
23
+ }
24
+
25
+ if (info.done) {
26
+ resolve(value);
27
+ } else {
28
+ Promise.resolve(value).then(_next, _throw);
29
+ }
30
+ }
31
+
32
+ function _asyncToGenerator(fn) {
33
+ return function () {
34
+ var self = this,
35
+ args = arguments;
36
+ return new Promise(function (resolve, reject) {
37
+ var gen = fn.apply(self, args);
38
+
39
+ function _next(value) {
40
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
41
+ }
42
+
43
+ function _throw(err) {
44
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
45
+ }
46
+
47
+ _next(undefined);
48
+ });
49
+ };
50
+ }
51
+
52
+ function _extends() {
53
+ _extends = Object.assign || function (target) {
54
+ for (var i = 1; i < arguments.length; i++) {
55
+ var source = arguments[i];
56
+
57
+ for (var key in source) {
58
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
59
+ target[key] = source[key];
60
+ }
61
+ }
62
+ }
63
+
64
+ return target;
65
+ };
66
+
67
+ return _extends.apply(this, arguments);
68
+ }
69
+
70
+ var runtime = {exports: {}};
71
+
72
+ /**
73
+ * Copyright (c) 2014-present, Facebook, Inc.
74
+ *
75
+ * This source code is licensed under the MIT license found in the
76
+ * LICENSE file in the root directory of this source tree.
77
+ */
78
+
79
+ (function (module) {
80
+ var runtime = (function (exports) {
81
+
82
+ var Op = Object.prototype;
83
+ var hasOwn = Op.hasOwnProperty;
84
+ var undefined$1; // More compressible than void 0.
85
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
86
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
87
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
88
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
89
+
90
+ function define(obj, key, value) {
91
+ Object.defineProperty(obj, key, {
92
+ value: value,
93
+ enumerable: true,
94
+ configurable: true,
95
+ writable: true
96
+ });
97
+ return obj[key];
98
+ }
99
+ try {
100
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
101
+ define({}, "");
102
+ } catch (err) {
103
+ define = function(obj, key, value) {
104
+ return obj[key] = value;
105
+ };
106
+ }
107
+
108
+ function wrap(innerFn, outerFn, self, tryLocsList) {
109
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
110
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
111
+ var generator = Object.create(protoGenerator.prototype);
112
+ var context = new Context(tryLocsList || []);
113
+
114
+ // The ._invoke method unifies the implementations of the .next,
115
+ // .throw, and .return methods.
116
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
117
+
118
+ return generator;
119
+ }
120
+ exports.wrap = wrap;
121
+
122
+ // Try/catch helper to minimize deoptimizations. Returns a completion
123
+ // record like context.tryEntries[i].completion. This interface could
124
+ // have been (and was previously) designed to take a closure to be
125
+ // invoked without arguments, but in all the cases we care about we
126
+ // already have an existing method we want to call, so there's no need
127
+ // to create a new function object. We can even get away with assuming
128
+ // the method takes exactly one argument, since that happens to be true
129
+ // in every case, so we don't have to touch the arguments object. The
130
+ // only additional allocation required is the completion record, which
131
+ // has a stable shape and so hopefully should be cheap to allocate.
132
+ function tryCatch(fn, obj, arg) {
133
+ try {
134
+ return { type: "normal", arg: fn.call(obj, arg) };
135
+ } catch (err) {
136
+ return { type: "throw", arg: err };
137
+ }
138
+ }
139
+
140
+ var GenStateSuspendedStart = "suspendedStart";
141
+ var GenStateSuspendedYield = "suspendedYield";
142
+ var GenStateExecuting = "executing";
143
+ var GenStateCompleted = "completed";
144
+
145
+ // Returning this object from the innerFn has the same effect as
146
+ // breaking out of the dispatch switch statement.
147
+ var ContinueSentinel = {};
148
+
149
+ // Dummy constructor functions that we use as the .constructor and
150
+ // .constructor.prototype properties for functions that return Generator
151
+ // objects. For full spec compliance, you may wish to configure your
152
+ // minifier not to mangle the names of these two functions.
153
+ function Generator() {}
154
+ function GeneratorFunction() {}
155
+ function GeneratorFunctionPrototype() {}
156
+
157
+ // This is a polyfill for %IteratorPrototype% for environments that
158
+ // don't natively support it.
159
+ var IteratorPrototype = {};
160
+ define(IteratorPrototype, iteratorSymbol, function () {
161
+ return this;
162
+ });
163
+
164
+ var getProto = Object.getPrototypeOf;
165
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
166
+ if (NativeIteratorPrototype &&
167
+ NativeIteratorPrototype !== Op &&
168
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
169
+ // This environment has a native %IteratorPrototype%; use it instead
170
+ // of the polyfill.
171
+ IteratorPrototype = NativeIteratorPrototype;
172
+ }
173
+
174
+ var Gp = GeneratorFunctionPrototype.prototype =
175
+ Generator.prototype = Object.create(IteratorPrototype);
176
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
177
+ define(Gp, "constructor", GeneratorFunctionPrototype);
178
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
179
+ GeneratorFunction.displayName = define(
180
+ GeneratorFunctionPrototype,
181
+ toStringTagSymbol,
182
+ "GeneratorFunction"
183
+ );
184
+
185
+ // Helper for defining the .next, .throw, and .return methods of the
186
+ // Iterator interface in terms of a single ._invoke method.
187
+ function defineIteratorMethods(prototype) {
188
+ ["next", "throw", "return"].forEach(function(method) {
189
+ define(prototype, method, function(arg) {
190
+ return this._invoke(method, arg);
191
+ });
192
+ });
193
+ }
194
+
195
+ exports.isGeneratorFunction = function(genFun) {
196
+ var ctor = typeof genFun === "function" && genFun.constructor;
197
+ return ctor
198
+ ? ctor === GeneratorFunction ||
199
+ // For the native GeneratorFunction constructor, the best we can
200
+ // do is to check its .name property.
201
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
202
+ : false;
203
+ };
204
+
205
+ exports.mark = function(genFun) {
206
+ if (Object.setPrototypeOf) {
207
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
208
+ } else {
209
+ genFun.__proto__ = GeneratorFunctionPrototype;
210
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
211
+ }
212
+ genFun.prototype = Object.create(Gp);
213
+ return genFun;
214
+ };
215
+
216
+ // Within the body of any async function, `await x` is transformed to
217
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
218
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
219
+ // meant to be awaited.
220
+ exports.awrap = function(arg) {
221
+ return { __await: arg };
222
+ };
223
+
224
+ function AsyncIterator(generator, PromiseImpl) {
225
+ function invoke(method, arg, resolve, reject) {
226
+ var record = tryCatch(generator[method], generator, arg);
227
+ if (record.type === "throw") {
228
+ reject(record.arg);
229
+ } else {
230
+ var result = record.arg;
231
+ var value = result.value;
232
+ if (value &&
233
+ typeof value === "object" &&
234
+ hasOwn.call(value, "__await")) {
235
+ return PromiseImpl.resolve(value.__await).then(function(value) {
236
+ invoke("next", value, resolve, reject);
237
+ }, function(err) {
238
+ invoke("throw", err, resolve, reject);
239
+ });
240
+ }
241
+
242
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
243
+ // When a yielded Promise is resolved, its final value becomes
244
+ // the .value of the Promise<{value,done}> result for the
245
+ // current iteration.
246
+ result.value = unwrapped;
247
+ resolve(result);
248
+ }, function(error) {
249
+ // If a rejected Promise was yielded, throw the rejection back
250
+ // into the async generator function so it can be handled there.
251
+ return invoke("throw", error, resolve, reject);
252
+ });
253
+ }
254
+ }
255
+
256
+ var previousPromise;
257
+
258
+ function enqueue(method, arg) {
259
+ function callInvokeWithMethodAndArg() {
260
+ return new PromiseImpl(function(resolve, reject) {
261
+ invoke(method, arg, resolve, reject);
262
+ });
263
+ }
264
+
265
+ return previousPromise =
266
+ // If enqueue has been called before, then we want to wait until
267
+ // all previous Promises have been resolved before calling invoke,
268
+ // so that results are always delivered in the correct order. If
269
+ // enqueue has not been called before, then it is important to
270
+ // call invoke immediately, without waiting on a callback to fire,
271
+ // so that the async generator function has the opportunity to do
272
+ // any necessary setup in a predictable way. This predictability
273
+ // is why the Promise constructor synchronously invokes its
274
+ // executor callback, and why async functions synchronously
275
+ // execute code before the first await. Since we implement simple
276
+ // async functions in terms of async generators, it is especially
277
+ // important to get this right, even though it requires care.
278
+ previousPromise ? previousPromise.then(
279
+ callInvokeWithMethodAndArg,
280
+ // Avoid propagating failures to Promises returned by later
281
+ // invocations of the iterator.
282
+ callInvokeWithMethodAndArg
283
+ ) : callInvokeWithMethodAndArg();
284
+ }
285
+
286
+ // Define the unified helper method that is used to implement .next,
287
+ // .throw, and .return (see defineIteratorMethods).
288
+ this._invoke = enqueue;
289
+ }
290
+
291
+ defineIteratorMethods(AsyncIterator.prototype);
292
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
293
+ return this;
294
+ });
295
+ exports.AsyncIterator = AsyncIterator;
296
+
297
+ // Note that simple async functions are implemented on top of
298
+ // AsyncIterator objects; they just return a Promise for the value of
299
+ // the final result produced by the iterator.
300
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
301
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
302
+
303
+ var iter = new AsyncIterator(
304
+ wrap(innerFn, outerFn, self, tryLocsList),
305
+ PromiseImpl
306
+ );
307
+
308
+ return exports.isGeneratorFunction(outerFn)
309
+ ? iter // If outerFn is a generator, return the full iterator.
310
+ : iter.next().then(function(result) {
311
+ return result.done ? result.value : iter.next();
312
+ });
313
+ };
314
+
315
+ function makeInvokeMethod(innerFn, self, context) {
316
+ var state = GenStateSuspendedStart;
317
+
318
+ return function invoke(method, arg) {
319
+ if (state === GenStateExecuting) {
320
+ throw new Error("Generator is already running");
321
+ }
322
+
323
+ if (state === GenStateCompleted) {
324
+ if (method === "throw") {
325
+ throw arg;
326
+ }
327
+
328
+ // Be forgiving, per 25.3.3.3.3 of the spec:
329
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
330
+ return doneResult();
331
+ }
332
+
333
+ context.method = method;
334
+ context.arg = arg;
335
+
336
+ while (true) {
337
+ var delegate = context.delegate;
338
+ if (delegate) {
339
+ var delegateResult = maybeInvokeDelegate(delegate, context);
340
+ if (delegateResult) {
341
+ if (delegateResult === ContinueSentinel) continue;
342
+ return delegateResult;
343
+ }
344
+ }
345
+
346
+ if (context.method === "next") {
347
+ // Setting context._sent for legacy support of Babel's
348
+ // function.sent implementation.
349
+ context.sent = context._sent = context.arg;
350
+
351
+ } else if (context.method === "throw") {
352
+ if (state === GenStateSuspendedStart) {
353
+ state = GenStateCompleted;
354
+ throw context.arg;
355
+ }
356
+
357
+ context.dispatchException(context.arg);
358
+
359
+ } else if (context.method === "return") {
360
+ context.abrupt("return", context.arg);
361
+ }
362
+
363
+ state = GenStateExecuting;
364
+
365
+ var record = tryCatch(innerFn, self, context);
366
+ if (record.type === "normal") {
367
+ // If an exception is thrown from innerFn, we leave state ===
368
+ // GenStateExecuting and loop back for another invocation.
369
+ state = context.done
370
+ ? GenStateCompleted
371
+ : GenStateSuspendedYield;
372
+
373
+ if (record.arg === ContinueSentinel) {
374
+ continue;
375
+ }
376
+
377
+ return {
378
+ value: record.arg,
379
+ done: context.done
380
+ };
381
+
382
+ } else if (record.type === "throw") {
383
+ state = GenStateCompleted;
384
+ // Dispatch the exception by looping back around to the
385
+ // context.dispatchException(context.arg) call above.
386
+ context.method = "throw";
387
+ context.arg = record.arg;
388
+ }
389
+ }
390
+ };
391
+ }
392
+
393
+ // Call delegate.iterator[context.method](context.arg) and handle the
394
+ // result, either by returning a { value, done } result from the
395
+ // delegate iterator, or by modifying context.method and context.arg,
396
+ // setting context.delegate to null, and returning the ContinueSentinel.
397
+ function maybeInvokeDelegate(delegate, context) {
398
+ var method = delegate.iterator[context.method];
399
+ if (method === undefined$1) {
400
+ // A .throw or .return when the delegate iterator has no .throw
401
+ // method always terminates the yield* loop.
402
+ context.delegate = null;
403
+
404
+ if (context.method === "throw") {
405
+ // Note: ["return"] must be used for ES3 parsing compatibility.
406
+ if (delegate.iterator["return"]) {
407
+ // If the delegate iterator has a return method, give it a
408
+ // chance to clean up.
409
+ context.method = "return";
410
+ context.arg = undefined$1;
411
+ maybeInvokeDelegate(delegate, context);
412
+
413
+ if (context.method === "throw") {
414
+ // If maybeInvokeDelegate(context) changed context.method from
415
+ // "return" to "throw", let that override the TypeError below.
416
+ return ContinueSentinel;
417
+ }
418
+ }
419
+
420
+ context.method = "throw";
421
+ context.arg = new TypeError(
422
+ "The iterator does not provide a 'throw' method");
423
+ }
424
+
425
+ return ContinueSentinel;
426
+ }
427
+
428
+ var record = tryCatch(method, delegate.iterator, context.arg);
429
+
430
+ if (record.type === "throw") {
431
+ context.method = "throw";
432
+ context.arg = record.arg;
433
+ context.delegate = null;
434
+ return ContinueSentinel;
435
+ }
436
+
437
+ var info = record.arg;
438
+
439
+ if (! info) {
440
+ context.method = "throw";
441
+ context.arg = new TypeError("iterator result is not an object");
442
+ context.delegate = null;
443
+ return ContinueSentinel;
444
+ }
445
+
446
+ if (info.done) {
447
+ // Assign the result of the finished delegate to the temporary
448
+ // variable specified by delegate.resultName (see delegateYield).
449
+ context[delegate.resultName] = info.value;
450
+
451
+ // Resume execution at the desired location (see delegateYield).
452
+ context.next = delegate.nextLoc;
453
+
454
+ // If context.method was "throw" but the delegate handled the
455
+ // exception, let the outer generator proceed normally. If
456
+ // context.method was "next", forget context.arg since it has been
457
+ // "consumed" by the delegate iterator. If context.method was
458
+ // "return", allow the original .return call to continue in the
459
+ // outer generator.
460
+ if (context.method !== "return") {
461
+ context.method = "next";
462
+ context.arg = undefined$1;
463
+ }
464
+
465
+ } else {
466
+ // Re-yield the result returned by the delegate method.
467
+ return info;
468
+ }
469
+
470
+ // The delegate iterator is finished, so forget it and continue with
471
+ // the outer generator.
472
+ context.delegate = null;
473
+ return ContinueSentinel;
474
+ }
475
+
476
+ // Define Generator.prototype.{next,throw,return} in terms of the
477
+ // unified ._invoke helper method.
478
+ defineIteratorMethods(Gp);
479
+
480
+ define(Gp, toStringTagSymbol, "Generator");
481
+
482
+ // A Generator should always return itself as the iterator object when the
483
+ // @@iterator function is called on it. Some browsers' implementations of the
484
+ // iterator prototype chain incorrectly implement this, causing the Generator
485
+ // object to not be returned from this call. This ensures that doesn't happen.
486
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
487
+ define(Gp, iteratorSymbol, function() {
488
+ return this;
489
+ });
490
+
491
+ define(Gp, "toString", function() {
492
+ return "[object Generator]";
493
+ });
494
+
495
+ function pushTryEntry(locs) {
496
+ var entry = { tryLoc: locs[0] };
497
+
498
+ if (1 in locs) {
499
+ entry.catchLoc = locs[1];
500
+ }
501
+
502
+ if (2 in locs) {
503
+ entry.finallyLoc = locs[2];
504
+ entry.afterLoc = locs[3];
505
+ }
506
+
507
+ this.tryEntries.push(entry);
508
+ }
509
+
510
+ function resetTryEntry(entry) {
511
+ var record = entry.completion || {};
512
+ record.type = "normal";
513
+ delete record.arg;
514
+ entry.completion = record;
515
+ }
516
+
517
+ function Context(tryLocsList) {
518
+ // The root entry object (effectively a try statement without a catch
519
+ // or a finally block) gives us a place to store values thrown from
520
+ // locations where there is no enclosing try statement.
521
+ this.tryEntries = [{ tryLoc: "root" }];
522
+ tryLocsList.forEach(pushTryEntry, this);
523
+ this.reset(true);
524
+ }
525
+
526
+ exports.keys = function(object) {
527
+ var keys = [];
528
+ for (var key in object) {
529
+ keys.push(key);
530
+ }
531
+ keys.reverse();
532
+
533
+ // Rather than returning an object with a next method, we keep
534
+ // things simple and return the next function itself.
535
+ return function next() {
536
+ while (keys.length) {
537
+ var key = keys.pop();
538
+ if (key in object) {
539
+ next.value = key;
540
+ next.done = false;
541
+ return next;
542
+ }
543
+ }
544
+
545
+ // To avoid creating an additional object, we just hang the .value
546
+ // and .done properties off the next function object itself. This
547
+ // also ensures that the minifier will not anonymize the function.
548
+ next.done = true;
549
+ return next;
550
+ };
551
+ };
552
+
553
+ function values(iterable) {
554
+ if (iterable) {
555
+ var iteratorMethod = iterable[iteratorSymbol];
556
+ if (iteratorMethod) {
557
+ return iteratorMethod.call(iterable);
558
+ }
559
+
560
+ if (typeof iterable.next === "function") {
561
+ return iterable;
562
+ }
563
+
564
+ if (!isNaN(iterable.length)) {
565
+ var i = -1, next = function next() {
566
+ while (++i < iterable.length) {
567
+ if (hasOwn.call(iterable, i)) {
568
+ next.value = iterable[i];
569
+ next.done = false;
570
+ return next;
571
+ }
572
+ }
573
+
574
+ next.value = undefined$1;
575
+ next.done = true;
576
+
577
+ return next;
578
+ };
579
+
580
+ return next.next = next;
581
+ }
582
+ }
583
+
584
+ // Return an iterator with no values.
585
+ return { next: doneResult };
586
+ }
587
+ exports.values = values;
588
+
589
+ function doneResult() {
590
+ return { value: undefined$1, done: true };
591
+ }
592
+
593
+ Context.prototype = {
594
+ constructor: Context,
595
+
596
+ reset: function(skipTempReset) {
597
+ this.prev = 0;
598
+ this.next = 0;
599
+ // Resetting context._sent for legacy support of Babel's
600
+ // function.sent implementation.
601
+ this.sent = this._sent = undefined$1;
602
+ this.done = false;
603
+ this.delegate = null;
604
+
605
+ this.method = "next";
606
+ this.arg = undefined$1;
607
+
608
+ this.tryEntries.forEach(resetTryEntry);
609
+
610
+ if (!skipTempReset) {
611
+ for (var name in this) {
612
+ // Not sure about the optimal order of these conditions:
613
+ if (name.charAt(0) === "t" &&
614
+ hasOwn.call(this, name) &&
615
+ !isNaN(+name.slice(1))) {
616
+ this[name] = undefined$1;
617
+ }
618
+ }
619
+ }
620
+ },
621
+
622
+ stop: function() {
623
+ this.done = true;
624
+
625
+ var rootEntry = this.tryEntries[0];
626
+ var rootRecord = rootEntry.completion;
627
+ if (rootRecord.type === "throw") {
628
+ throw rootRecord.arg;
629
+ }
630
+
631
+ return this.rval;
632
+ },
633
+
634
+ dispatchException: function(exception) {
635
+ if (this.done) {
636
+ throw exception;
637
+ }
638
+
639
+ var context = this;
640
+ function handle(loc, caught) {
641
+ record.type = "throw";
642
+ record.arg = exception;
643
+ context.next = loc;
644
+
645
+ if (caught) {
646
+ // If the dispatched exception was caught by a catch block,
647
+ // then let that catch block handle the exception normally.
648
+ context.method = "next";
649
+ context.arg = undefined$1;
650
+ }
651
+
652
+ return !! caught;
653
+ }
654
+
655
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
656
+ var entry = this.tryEntries[i];
657
+ var record = entry.completion;
658
+
659
+ if (entry.tryLoc === "root") {
660
+ // Exception thrown outside of any try block that could handle
661
+ // it, so set the completion value of the entire function to
662
+ // throw the exception.
663
+ return handle("end");
664
+ }
665
+
666
+ if (entry.tryLoc <= this.prev) {
667
+ var hasCatch = hasOwn.call(entry, "catchLoc");
668
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
669
+
670
+ if (hasCatch && hasFinally) {
671
+ if (this.prev < entry.catchLoc) {
672
+ return handle(entry.catchLoc, true);
673
+ } else if (this.prev < entry.finallyLoc) {
674
+ return handle(entry.finallyLoc);
675
+ }
676
+
677
+ } else if (hasCatch) {
678
+ if (this.prev < entry.catchLoc) {
679
+ return handle(entry.catchLoc, true);
680
+ }
681
+
682
+ } else if (hasFinally) {
683
+ if (this.prev < entry.finallyLoc) {
684
+ return handle(entry.finallyLoc);
685
+ }
686
+
687
+ } else {
688
+ throw new Error("try statement without catch or finally");
689
+ }
690
+ }
691
+ }
692
+ },
693
+
694
+ abrupt: function(type, arg) {
695
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
696
+ var entry = this.tryEntries[i];
697
+ if (entry.tryLoc <= this.prev &&
698
+ hasOwn.call(entry, "finallyLoc") &&
699
+ this.prev < entry.finallyLoc) {
700
+ var finallyEntry = entry;
701
+ break;
702
+ }
703
+ }
704
+
705
+ if (finallyEntry &&
706
+ (type === "break" ||
707
+ type === "continue") &&
708
+ finallyEntry.tryLoc <= arg &&
709
+ arg <= finallyEntry.finallyLoc) {
710
+ // Ignore the finally entry if control is not jumping to a
711
+ // location outside the try/catch block.
712
+ finallyEntry = null;
713
+ }
714
+
715
+ var record = finallyEntry ? finallyEntry.completion : {};
716
+ record.type = type;
717
+ record.arg = arg;
718
+
719
+ if (finallyEntry) {
720
+ this.method = "next";
721
+ this.next = finallyEntry.finallyLoc;
722
+ return ContinueSentinel;
723
+ }
724
+
725
+ return this.complete(record);
726
+ },
727
+
728
+ complete: function(record, afterLoc) {
729
+ if (record.type === "throw") {
730
+ throw record.arg;
731
+ }
732
+
733
+ if (record.type === "break" ||
734
+ record.type === "continue") {
735
+ this.next = record.arg;
736
+ } else if (record.type === "return") {
737
+ this.rval = this.arg = record.arg;
738
+ this.method = "return";
739
+ this.next = "end";
740
+ } else if (record.type === "normal" && afterLoc) {
741
+ this.next = afterLoc;
742
+ }
743
+
744
+ return ContinueSentinel;
745
+ },
746
+
747
+ finish: function(finallyLoc) {
748
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
749
+ var entry = this.tryEntries[i];
750
+ if (entry.finallyLoc === finallyLoc) {
751
+ this.complete(entry.completion, entry.afterLoc);
752
+ resetTryEntry(entry);
753
+ return ContinueSentinel;
754
+ }
755
+ }
756
+ },
757
+
758
+ "catch": function(tryLoc) {
759
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
760
+ var entry = this.tryEntries[i];
761
+ if (entry.tryLoc === tryLoc) {
762
+ var record = entry.completion;
763
+ if (record.type === "throw") {
764
+ var thrown = record.arg;
765
+ resetTryEntry(entry);
766
+ }
767
+ return thrown;
768
+ }
769
+ }
770
+
771
+ // The context.catch method must only be called with a location
772
+ // argument that corresponds to a known catch block.
773
+ throw new Error("illegal catch attempt");
774
+ },
775
+
776
+ delegateYield: function(iterable, resultName, nextLoc) {
777
+ this.delegate = {
778
+ iterator: values(iterable),
779
+ resultName: resultName,
780
+ nextLoc: nextLoc
781
+ };
782
+
783
+ if (this.method === "next") {
784
+ // Deliberately forget the last sent value so that we don't
785
+ // accidentally pass it on to the delegate.
786
+ this.arg = undefined$1;
787
+ }
788
+
789
+ return ContinueSentinel;
790
+ }
791
+ };
792
+
793
+ // Regardless of whether this script is executing as a CommonJS module
794
+ // or not, return the runtime object so that we can declare the variable
795
+ // regeneratorRuntime in the outer scope, which allows this module to be
796
+ // injected easily by `bin/regenerator --include-runtime script.js`.
797
+ return exports;
798
+
799
+ }(
800
+ // If this script is executing as a CommonJS module, use module.exports
801
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
802
+ // object. Either way, the resulting object will be used to initialize
803
+ // the regeneratorRuntime variable at the top of this file.
804
+ module.exports
805
+ ));
806
+
807
+ try {
808
+ regeneratorRuntime = runtime;
809
+ } catch (accidentalStrictMode) {
810
+ // This module should not be running in strict mode, so the above
811
+ // assignment should always work unless something is misconfigured. Just
812
+ // in case runtime.js accidentally runs in strict mode, in modern engines
813
+ // we can explicitly access globalThis. In older engines we can escape
814
+ // strict mode using a global Function call. This could conceivably fail
815
+ // if a Content Security Policy forbids using Function, but in that case
816
+ // the proper solution is to fix the accidental strict mode problem. If
817
+ // you've misconfigured your bundler to force strict mode and applied a
818
+ // CSP to forbid Function, and you're not willing to fix either of those
819
+ // problems, please detail your unique predicament in a GitHub issue.
820
+ if (typeof globalThis === "object") {
821
+ globalThis.regeneratorRuntime = runtime;
822
+ } else {
823
+ Function("r", "regeneratorRuntime = r")(runtime);
824
+ }
825
+ }
826
+ }(runtime));
827
+
828
+ var _regeneratorRuntime = runtime.exports;
829
+
830
+ var API_BASE_URL = 'https://api.quran.com/api/v4/';
831
+ var makeUrl = function makeUrl(url, params) {
832
+ var baseUrl = "" + API_BASE_URL + misc.removeBeginningSlash(url);
833
+ if (!params) return baseUrl;
834
+ var decamelizedKeys = humps.decamelizeKeys(params);
835
+ var paramsString = stringify__default["default"](decamelizedKeys);
836
+ if (!paramsString) return baseUrl;
837
+ return baseUrl + "?" + paramsString;
838
+ };
839
+ var fetcher = /*#__PURE__*/function () {
840
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(url, params) {
841
+ var res, json;
842
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
843
+ while (1) {
844
+ switch (_context.prev = _context.next) {
845
+ case 0:
846
+ if (params === void 0) {
847
+ params = {};
848
+ }
849
+
850
+ _context.next = 3;
851
+ return fetch__default["default"](makeUrl(url, params));
852
+
853
+ case 3:
854
+ res = _context.sent;
855
+
856
+ if (!(res.status >= 400)) {
857
+ _context.next = 6;
858
+ break;
859
+ }
860
+
861
+ throw new Error(res.status + " " + res.statusText);
862
+
863
+ case 6:
864
+ _context.next = 8;
865
+ return res.json();
866
+
867
+ case 8:
868
+ json = _context.sent;
869
+ return _context.abrupt("return", humps.camelizeKeys(json));
870
+
871
+ case 10:
872
+ case "end":
873
+ return _context.stop();
874
+ }
875
+ }
876
+ }, _callee);
877
+ }));
878
+
879
+ return function fetcher(_x, _x2) {
880
+ return _ref.apply(this, arguments);
881
+ };
882
+ }();
883
+
884
+ // this maps chapterNumber to verseCount
885
+ var versesMaping = {
886
+ '1': 7,
887
+ '2': 286,
888
+ '3': 200,
889
+ '4': 176,
890
+ '5': 120,
891
+ '6': 165,
892
+ '7': 206,
893
+ '8': 75,
894
+ '9': 129,
895
+ '10': 109,
896
+ '11': 123,
897
+ '12': 111,
898
+ '13': 43,
899
+ '14': 52,
900
+ '15': 99,
901
+ '16': 128,
902
+ '17': 111,
903
+ '18': 110,
904
+ '19': 98,
905
+ '20': 135,
906
+ '21': 112,
907
+ '22': 78,
908
+ '23': 118,
909
+ '24': 64,
910
+ '25': 77,
911
+ '26': 227,
912
+ '27': 93,
913
+ '28': 88,
914
+ '29': 69,
915
+ '30': 60,
916
+ '31': 34,
917
+ '32': 30,
918
+ '33': 73,
919
+ '34': 54,
920
+ '35': 45,
921
+ '36': 83,
922
+ '37': 182,
923
+ '38': 88,
924
+ '39': 75,
925
+ '40': 85,
926
+ '41': 54,
927
+ '42': 53,
928
+ '43': 89,
929
+ '44': 59,
930
+ '45': 37,
931
+ '46': 35,
932
+ '47': 38,
933
+ '48': 29,
934
+ '49': 18,
935
+ '50': 45,
936
+ '51': 60,
937
+ '52': 49,
938
+ '53': 62,
939
+ '54': 55,
940
+ '55': 78,
941
+ '56': 96,
942
+ '57': 29,
943
+ '58': 22,
944
+ '59': 24,
945
+ '60': 13,
946
+ '61': 14,
947
+ '62': 11,
948
+ '63': 11,
949
+ '64': 18,
950
+ '65': 12,
951
+ '66': 12,
952
+ '67': 30,
953
+ '68': 52,
954
+ '69': 52,
955
+ '70': 44,
956
+ '71': 28,
957
+ '72': 28,
958
+ '73': 20,
959
+ '74': 56,
960
+ '75': 40,
961
+ '76': 31,
962
+ '77': 50,
963
+ '78': 40,
964
+ '79': 46,
965
+ '80': 42,
966
+ '81': 29,
967
+ '82': 19,
968
+ '83': 36,
969
+ '84': 25,
970
+ '85': 22,
971
+ '86': 17,
972
+ '87': 19,
973
+ '88': 26,
974
+ '89': 30,
975
+ '90': 20,
976
+ '91': 15,
977
+ '92': 21,
978
+ '93': 11,
979
+ '94': 8,
980
+ '95': 8,
981
+ '96': 19,
982
+ '97': 5,
983
+ '98': 8,
984
+ '99': 8,
985
+ '100': 11,
986
+ '101': 11,
987
+ '102': 8,
988
+ '103': 3,
989
+ '104': 9,
990
+ '105': 5,
991
+ '106': 4,
992
+ '107': 7,
993
+ '108': 3,
994
+ '109': 6,
995
+ '110': 3,
996
+ '111': 5,
997
+ '112': 4,
998
+ '113': 5,
999
+ '114': 6
1000
+ };
1001
+ /**
1002
+ * Validates chapter id
1003
+ * @param id chapter id
1004
+ * @example
1005
+ isValidChapterId('1') // true
1006
+ isValidChapterId('114') // true
1007
+ isValidChapterId('0') // false
1008
+ isValidChapterId('-1') // false
1009
+ isValidChapterId('200') // false
1010
+ */
1011
+
1012
+ var isValidChapterId = function isValidChapterId(id) {
1013
+ var parsedId = typeof id === 'number' ? id : Number(id);
1014
+ if (!parsedId || parsedId <= 0 || parsedId > 114) return false;
1015
+ return true;
1016
+ };
1017
+ /**
1018
+ * Validates juz number
1019
+ * @param juz juz number
1020
+ * @example
1021
+ isValidJuz('1') // true
1022
+ isValidJuz('30') // true
1023
+ isValidJuz('0') // false
1024
+ isValidJuz('-1') // false
1025
+ isValidJuz('200') // false
1026
+ */
1027
+
1028
+
1029
+ var isValidJuz = function isValidJuz(juz) {
1030
+ var parsedJuz = typeof juz === 'number' ? juz : Number(juz);
1031
+ if (!parsedJuz || parsedJuz <= 0 || parsedJuz > 30) return false;
1032
+ return true;
1033
+ };
1034
+ /**
1035
+ * Validates rub number
1036
+ * @param rub rub number
1037
+ * @example
1038
+ isValidRub('1') // true
1039
+ isValidRub('240') // true
1040
+ isValidRub('0') // false
1041
+ isValidRub('-1') // false
1042
+ isValidRub('300') // false
1043
+ */
1044
+
1045
+
1046
+ var isValidRub = function isValidRub(rub) {
1047
+ var parsedRub = typeof rub === 'number' ? rub : Number(rub);
1048
+ if (!parsedRub || parsedRub <= 0 || parsedRub > 240) return false;
1049
+ return true;
1050
+ };
1051
+ /**
1052
+ * Validates hizb number
1053
+ * @param hizb hizb number
1054
+ * @example
1055
+ isValidHizb('1') // true
1056
+ isValidHizb('60') // true
1057
+ isValidHizb('0') // false
1058
+ isValidHizb('-1') // false
1059
+ isValidHizb('200') // false
1060
+ */
1061
+
1062
+
1063
+ var isValidHizb = function isValidHizb(hizb) {
1064
+ var parsedHizb = typeof hizb === 'number' ? hizb : Number(hizb);
1065
+ if (!parsedHizb || parsedHizb <= 0 || parsedHizb > 60) return false;
1066
+ return true;
1067
+ };
1068
+ /**
1069
+ * Validates mushaf page number
1070
+ * @param page mushaf page number
1071
+ * @example
1072
+ isValidQuranPage('1') // true
1073
+ isValidQuranPage('604') // true
1074
+ isValidQuranPage('0') // false
1075
+ isValidQuranPage('-1') // false
1076
+ isValidQuranPage('1000') // false
1077
+ */
1078
+
1079
+
1080
+ var isValidQuranPage = function isValidQuranPage(page) {
1081
+ var parsedPage = typeof page === 'number' ? page : Number(page);
1082
+ if (!parsedPage || parsedPage <= 0 || parsedPage > 604) return false;
1083
+ return true;
1084
+ };
1085
+ /**
1086
+ * Validates verse key
1087
+ * @param key colon separated verse key (chapter:verse)
1088
+ * @example
1089
+ isValidVerseKey('1:1') // true
1090
+ isValidVerseKey('30:1') // true
1091
+ isValidVerseKey('0') // false
1092
+ isValidVerseKey('1:-') // false
1093
+ isValidVerseKey('1_1') // false
1094
+ */
1095
+
1096
+
1097
+ var isValidVerseKey = function isValidVerseKey(key) {
1098
+ var _key$trim$split = key.trim().split(':'),
1099
+ chapterId = _key$trim$split[0],
1100
+ verseId = _key$trim$split[1];
1101
+
1102
+ if (!chapterId || !verseId || !isValidChapterId(chapterId)) return false;
1103
+ var parsedVerse = Number(verseId);
1104
+ var verseCount = versesMaping[chapterId];
1105
+ if (!parsedVerse || parsedVerse <= 0 || parsedVerse > verseCount) return false;
1106
+ return true;
1107
+ };
1108
+
1109
+ var Utils = {
1110
+ isValidChapterId: isValidChapterId,
1111
+ isValidJuz: isValidJuz,
1112
+ isValidRub: isValidRub,
1113
+ isValidHizb: isValidHizb,
1114
+ isValidQuranPage: isValidQuranPage,
1115
+ isValidVerseKey: isValidVerseKey
1116
+ };
1117
+
1118
+ var defaultOptions$2 = {
1119
+ language: types.Language.ARABIC
1120
+ };
1121
+
1122
+ var getChapterOptions = function getChapterOptions(options) {
1123
+ if (options === void 0) {
1124
+ options = {};
1125
+ }
1126
+
1127
+ var _final = _extends({}, defaultOptions$2, options);
1128
+
1129
+ return _final;
1130
+ };
1131
+ /**
1132
+ * Get all chapters.
1133
+ * @description https://quran.api-docs.io/v4/chapters/list-chapters
1134
+ * @param {Options} options
1135
+ * @example
1136
+ * quran.v4.chapters.findAll()
1137
+ */
1138
+
1139
+
1140
+ var findAll$1 = /*#__PURE__*/function () {
1141
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
1142
+ var params, _yield$fetcher, chapters;
1143
+
1144
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
1145
+ while (1) {
1146
+ switch (_context.prev = _context.next) {
1147
+ case 0:
1148
+ params = getChapterOptions(options);
1149
+ _context.next = 3;
1150
+ return fetcher('/chapters', params);
1151
+
1152
+ case 3:
1153
+ _yield$fetcher = _context.sent;
1154
+ chapters = _yield$fetcher.chapters;
1155
+ return _context.abrupt("return", chapters);
1156
+
1157
+ case 6:
1158
+ case "end":
1159
+ return _context.stop();
1160
+ }
1161
+ }
1162
+ }, _callee);
1163
+ }));
1164
+
1165
+ return function findAll(_x) {
1166
+ return _ref.apply(this, arguments);
1167
+ };
1168
+ }();
1169
+ /**
1170
+ * Get chapter by id.
1171
+ * @description https://quran.api-docs.io/v4/chapters/get-chapter
1172
+ * @param {ChapterId} id chapter id, minimum 1, maximum 114
1173
+ * @param {Options} options
1174
+ * @example
1175
+ * quran.v4.chapters.findById('1')
1176
+ * quran.v4.chapters.findById('114')
1177
+ */
1178
+
1179
+
1180
+ var findById = /*#__PURE__*/function () {
1181
+ var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id, options) {
1182
+ var params, _yield$fetcher2, chapter;
1183
+
1184
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
1185
+ while (1) {
1186
+ switch (_context2.prev = _context2.next) {
1187
+ case 0:
1188
+ if (Utils.isValidChapterId(id)) {
1189
+ _context2.next = 2;
1190
+ break;
1191
+ }
1192
+
1193
+ throw new Error('Invalid chapter id');
1194
+
1195
+ case 2:
1196
+ params = getChapterOptions(options);
1197
+ _context2.next = 5;
1198
+ return fetcher("/chapters/" + id, params);
1199
+
1200
+ case 5:
1201
+ _yield$fetcher2 = _context2.sent;
1202
+ chapter = _yield$fetcher2.chapter;
1203
+ return _context2.abrupt("return", chapter);
1204
+
1205
+ case 8:
1206
+ case "end":
1207
+ return _context2.stop();
1208
+ }
1209
+ }
1210
+ }, _callee2);
1211
+ }));
1212
+
1213
+ return function findById(_x2, _x3) {
1214
+ return _ref2.apply(this, arguments);
1215
+ };
1216
+ }();
1217
+ /**
1218
+ * Get chapter info by id.
1219
+ * @description https://quran.api-docs.io/v4/chapters/chapter_info
1220
+ * @param {ChapterId} id chapter id, minimum 1, maximum 114
1221
+ * @param {Options} options
1222
+ * @example
1223
+ * quran.v4.chapters.findInfoById('1')
1224
+ * quran.v4.chapters.findInfoById('114')
1225
+ */
1226
+
1227
+
1228
+ var findInfoById = /*#__PURE__*/function () {
1229
+ var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, options) {
1230
+ var params, _yield$fetcher3, chapterInfo;
1231
+
1232
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
1233
+ while (1) {
1234
+ switch (_context3.prev = _context3.next) {
1235
+ case 0:
1236
+ if (Utils.isValidChapterId(id)) {
1237
+ _context3.next = 2;
1238
+ break;
1239
+ }
1240
+
1241
+ throw new Error('Invalid chapter id');
1242
+
1243
+ case 2:
1244
+ params = getChapterOptions(options);
1245
+ _context3.next = 5;
1246
+ return fetcher("/chapters/" + id + "/info", params);
1247
+
1248
+ case 5:
1249
+ _yield$fetcher3 = _context3.sent;
1250
+ chapterInfo = _yield$fetcher3.chapterInfo;
1251
+ return _context3.abrupt("return", chapterInfo);
1252
+
1253
+ case 8:
1254
+ case "end":
1255
+ return _context3.stop();
1256
+ }
1257
+ }
1258
+ }, _callee3);
1259
+ }));
1260
+
1261
+ return function findInfoById(_x4, _x5) {
1262
+ return _ref3.apply(this, arguments);
1263
+ };
1264
+ }();
1265
+
1266
+ var chapters = {
1267
+ findAll: findAll$1,
1268
+ findById: findById,
1269
+ findInfoById: findInfoById
1270
+ };
1271
+
1272
+ var defaultOptions$1 = {
1273
+ language: types.Language.ARABIC,
1274
+ perPage: 50
1275
+ };
1276
+
1277
+ var getVerseOptions = function getVerseOptions(options) {
1278
+ if (options === void 0) {
1279
+ options = {};
1280
+ }
1281
+
1282
+ var initial = _extends({}, defaultOptions$1, options);
1283
+
1284
+ var result = {
1285
+ language: initial.language,
1286
+ perPage: initial.perPage
1287
+ };
1288
+ if (initial.page) result.page = initial.page;
1289
+ if (initial.words !== undefined) result.words = initial.words;
1290
+ if (initial.translations) result.translations = initial.translations.join(',');
1291
+ if (initial.tafsirs) result.tafsirs = initial.tafsirs.join(',');
1292
+
1293
+ if (initial.fields) {
1294
+ var fields = [];
1295
+
1296
+ for (var _i = 0, _Object$entries = Object.entries(initial.fields); _i < _Object$entries.length; _i++) {
1297
+ var _Object$entries$_i = _Object$entries[_i],
1298
+ key = _Object$entries$_i[0],
1299
+ value = _Object$entries$_i[1];
1300
+ if (value) fields.push(humps.decamelize(key));
1301
+ }
1302
+
1303
+ result.fields = fields.join(',');
1304
+ }
1305
+
1306
+ if (initial.wordFields) {
1307
+ var wordFields = [];
1308
+
1309
+ for (var _i2 = 0, _Object$entries2 = Object.entries(initial.wordFields); _i2 < _Object$entries2.length; _i2++) {
1310
+ var _Object$entries2$_i = _Object$entries2[_i2],
1311
+ _key = _Object$entries2$_i[0],
1312
+ _value = _Object$entries2$_i[1];
1313
+ if (_value) wordFields.push(humps.decamelize(_key));
1314
+ }
1315
+
1316
+ result.wordFields = wordFields.join(',');
1317
+ }
1318
+
1319
+ if (initial.translationFields) {
1320
+ var translationFields = [];
1321
+
1322
+ for (var _i3 = 0, _Object$entries3 = Object.entries(initial.translationFields); _i3 < _Object$entries3.length; _i3++) {
1323
+ var _Object$entries3$_i = _Object$entries3[_i3],
1324
+ _key2 = _Object$entries3$_i[0],
1325
+ _value2 = _Object$entries3$_i[1];
1326
+ if (_value2) translationFields.push(humps.decamelize(_key2));
1327
+ }
1328
+
1329
+ result.translationFields = translationFields.join(',');
1330
+ }
1331
+
1332
+ if (initial.reciter) result.audio = initial.reciter;
1333
+ return result;
1334
+ };
1335
+ /**
1336
+ * Get a specific ayah with key. Key is combination of surah number and ayah number.
1337
+ * @description https://quran.api-docs.io/v4/verses/by-specific-verse-by-key
1338
+ * @param {VerseKey} key - surah number and ayah number separated by a colon.
1339
+ * @param {GetVerseOptions} options
1340
+ * @example
1341
+ * quran.v4.verses.findByKey('1:1')
1342
+ * quran.v4.verses.findByKey('101:5')
1343
+ */
1344
+
1345
+
1346
+ var findByKey = /*#__PURE__*/function () {
1347
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(key, options) {
1348
+ var params, url, _yield$fetcher, verse;
1349
+
1350
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
1351
+ while (1) {
1352
+ switch (_context.prev = _context.next) {
1353
+ case 0:
1354
+ if (Utils.isValidVerseKey(key)) {
1355
+ _context.next = 2;
1356
+ break;
1357
+ }
1358
+
1359
+ throw new Error('Invalid verse key');
1360
+
1361
+ case 2:
1362
+ params = getVerseOptions(options);
1363
+ url = "/verses/by_key/" + key;
1364
+ _context.next = 6;
1365
+ return fetcher(url, params);
1366
+
1367
+ case 6:
1368
+ _yield$fetcher = _context.sent;
1369
+ verse = _yield$fetcher.verse;
1370
+ return _context.abrupt("return", verse);
1371
+
1372
+ case 9:
1373
+ case "end":
1374
+ return _context.stop();
1375
+ }
1376
+ }
1377
+ }, _callee);
1378
+ }));
1379
+
1380
+ return function findByKey(_x, _x2) {
1381
+ return _ref.apply(this, arguments);
1382
+ };
1383
+ }();
1384
+ /**
1385
+ * Get all ayahs for a specific chapter (surah).
1386
+ * @description https://quran.api-docs.io/v4/verses/by_chapter
1387
+ * @param {ChapterId} id - chapter id (surah number)
1388
+ * @param {GetVerseOptions} options
1389
+ * @example
1390
+ * quran.v4.verses.findByChapter('1')
1391
+ * quran.v4.verses.findByChapter('101')
1392
+ */
1393
+
1394
+
1395
+ var findByChapter = /*#__PURE__*/function () {
1396
+ var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id, options) {
1397
+ var params, url, _yield$fetcher2, verses;
1398
+
1399
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
1400
+ while (1) {
1401
+ switch (_context2.prev = _context2.next) {
1402
+ case 0:
1403
+ if (Utils.isValidChapterId(id)) {
1404
+ _context2.next = 2;
1405
+ break;
1406
+ }
1407
+
1408
+ throw new Error('Invalid chapter id');
1409
+
1410
+ case 2:
1411
+ params = getVerseOptions(options);
1412
+ url = "/verses/by_chapter/" + id;
1413
+ _context2.next = 6;
1414
+ return fetcher(url, params);
1415
+
1416
+ case 6:
1417
+ _yield$fetcher2 = _context2.sent;
1418
+ verses = _yield$fetcher2.verses;
1419
+ return _context2.abrupt("return", verses);
1420
+
1421
+ case 9:
1422
+ case "end":
1423
+ return _context2.stop();
1424
+ }
1425
+ }
1426
+ }, _callee2);
1427
+ }));
1428
+
1429
+ return function findByChapter(_x3, _x4) {
1430
+ return _ref2.apply(this, arguments);
1431
+ };
1432
+ }();
1433
+ /**
1434
+ * Get all ayahs for a specific page in the Quran.
1435
+ * @description https://quran.api-docs.io/v4/verses/by-page
1436
+ * @param {PageNumber} page - Quran page number
1437
+ * @param {GetVerseOptions} options
1438
+ * @example
1439
+ * quran.v4.verses.findByPage('1')
1440
+ * quran.v4.verses.findByPage('101')
1441
+ */
1442
+
1443
+
1444
+ var findByPage = /*#__PURE__*/function () {
1445
+ var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(page, options) {
1446
+ var params, url, _yield$fetcher3, verses;
1447
+
1448
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
1449
+ while (1) {
1450
+ switch (_context3.prev = _context3.next) {
1451
+ case 0:
1452
+ if (Utils.isValidQuranPage(page)) {
1453
+ _context3.next = 2;
1454
+ break;
1455
+ }
1456
+
1457
+ throw new Error('Invalid page');
1458
+
1459
+ case 2:
1460
+ params = getVerseOptions(options);
1461
+ url = "/verses/by_page/" + page;
1462
+ _context3.next = 6;
1463
+ return fetcher(url, params);
1464
+
1465
+ case 6:
1466
+ _yield$fetcher3 = _context3.sent;
1467
+ verses = _yield$fetcher3.verses;
1468
+ return _context3.abrupt("return", verses);
1469
+
1470
+ case 9:
1471
+ case "end":
1472
+ return _context3.stop();
1473
+ }
1474
+ }
1475
+ }, _callee3);
1476
+ }));
1477
+
1478
+ return function findByPage(_x5, _x6) {
1479
+ return _ref3.apply(this, arguments);
1480
+ };
1481
+ }();
1482
+ /**
1483
+ * Get all ayahs for a Juz.
1484
+ * @description https://quran.api-docs.io/v4/verses/by-juz
1485
+ * @param {JuzNumber} id - juz number
1486
+ * @param {GetVerseOptions} options
1487
+ * @example
1488
+ * quran.v4.verses.findByJuz('1')
1489
+ * quran.v4.verses.findByJuz('29')
1490
+ */
1491
+
1492
+
1493
+ var findByJuz = /*#__PURE__*/function () {
1494
+ var _ref4 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(juz, options) {
1495
+ var params, url, _yield$fetcher4, verses;
1496
+
1497
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
1498
+ while (1) {
1499
+ switch (_context4.prev = _context4.next) {
1500
+ case 0:
1501
+ if (Utils.isValidJuz(juz)) {
1502
+ _context4.next = 2;
1503
+ break;
1504
+ }
1505
+
1506
+ throw new Error('Invalid juz');
1507
+
1508
+ case 2:
1509
+ params = getVerseOptions(options);
1510
+ url = "/verses/by_juz/" + juz;
1511
+ _context4.next = 6;
1512
+ return fetcher(url, params);
1513
+
1514
+ case 6:
1515
+ _yield$fetcher4 = _context4.sent;
1516
+ verses = _yield$fetcher4.verses;
1517
+ return _context4.abrupt("return", verses);
1518
+
1519
+ case 9:
1520
+ case "end":
1521
+ return _context4.stop();
1522
+ }
1523
+ }
1524
+ }, _callee4);
1525
+ }));
1526
+
1527
+ return function findByJuz(_x7, _x8) {
1528
+ return _ref4.apply(this, arguments);
1529
+ };
1530
+ }(); // TODO: uncomment when API is fixed
1531
+
1532
+ /**
1533
+ * Get all ayahs for a Hizb.
1534
+ * @description https://quran.api-docs.io/v4/verses/by-hizb-number
1535
+ * @param {HizbNumber} hizb - hizb number
1536
+ * @param {GetVerseOptions} options
1537
+ * @example
1538
+ * quran.v4.verses.findByHizb('1')
1539
+ * quran.v4.verses.findByHizb('29')
1540
+ */
1541
+ // const findByHizb = async (hizb: HizbNumber, options?: GetVerseOptions) => {
1542
+ // if (!Utils.isValidHizb(hizb)) throw new Error('Invalid hizb');
1543
+ // const params = getVerseOptions(options);
1544
+ // const url = `/verses/by_hizb/${hizb}`;
1545
+ // const { verses } = await fetcher<{ verses: Verse[] }>(url, params);
1546
+ // return verses;
1547
+ // };
1548
+ // TODO: uncomment when API is fixed
1549
+
1550
+ /**
1551
+ * Get all ayahs for a Rub.
1552
+ * @description https://quran.api-docs.io/v4/verses/by-rub-number
1553
+ * @param {RubNumber} rub - rub number
1554
+ * @param {GetVerseOptions} options
1555
+ * @example
1556
+ * quran.v4.verses.findByRub('1')
1557
+ * quran.v4.verses.findByRub('29')
1558
+ */
1559
+ // const findByRub = async (rub: RubNumber, options?: GetVerseOptions) => {
1560
+ // if (!Utils.isValidRub(rub)) throw new Error('Invalid rub');
1561
+ // const params = getVerseOptions(options);
1562
+ // const url = `/verses/by_rub/${rub}`;
1563
+ // const { verses } = await fetcher<{ verses: Verse[] }>(url, params);
1564
+ // return verses;
1565
+ // };
1566
+
1567
+ /**
1568
+ * Get a random ayah.
1569
+ * @description https://quran.api-docs.io/v4/verses/random
1570
+ * @param {GetVerseOptions} options
1571
+ * @example
1572
+ * quran.v4.verses.findRandom()
1573
+ */
1574
+
1575
+
1576
+ var findRandom = /*#__PURE__*/function () {
1577
+ var _ref5 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(options) {
1578
+ var params, _yield$fetcher5, verse;
1579
+
1580
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
1581
+ while (1) {
1582
+ switch (_context5.prev = _context5.next) {
1583
+ case 0:
1584
+ params = getVerseOptions(options);
1585
+ _context5.next = 3;
1586
+ return fetcher('/verses/random', params);
1587
+
1588
+ case 3:
1589
+ _yield$fetcher5 = _context5.sent;
1590
+ verse = _yield$fetcher5.verse;
1591
+ return _context5.abrupt("return", verse);
1592
+
1593
+ case 6:
1594
+ case "end":
1595
+ return _context5.stop();
1596
+ }
1597
+ }
1598
+ }, _callee5);
1599
+ }));
1600
+
1601
+ return function findRandom(_x9) {
1602
+ return _ref5.apply(this, arguments);
1603
+ };
1604
+ }();
1605
+
1606
+ var verses = {
1607
+ findByKey: findByKey,
1608
+ findByChapter: findByChapter,
1609
+ findByPage: findByPage,
1610
+ findByJuz: findByJuz,
1611
+ // findByHizb,
1612
+ // findByRub,
1613
+ findRandom: findRandom
1614
+ };
1615
+
1616
+ /**
1617
+ * Get All Juzs
1618
+ * @description https://quran.api-docs.io/v4/juz/get-all-juzs
1619
+ * @example
1620
+ * quran.v4.juzs.findAll()
1621
+ */
1622
+
1623
+ var findAll = /*#__PURE__*/function () {
1624
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
1625
+ var _yield$fetcher, juzs;
1626
+
1627
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
1628
+ while (1) {
1629
+ switch (_context.prev = _context.next) {
1630
+ case 0:
1631
+ _context.next = 2;
1632
+ return fetcher('/juzs');
1633
+
1634
+ case 2:
1635
+ _yield$fetcher = _context.sent;
1636
+ juzs = _yield$fetcher.juzs;
1637
+ return _context.abrupt("return", juzs);
1638
+
1639
+ case 5:
1640
+ case "end":
1641
+ return _context.stop();
1642
+ }
1643
+ }
1644
+ }, _callee);
1645
+ }));
1646
+
1647
+ return function findAll() {
1648
+ return _ref.apply(this, arguments);
1649
+ };
1650
+ }();
1651
+
1652
+ var juzs = {
1653
+ findAll: findAll
1654
+ };
1655
+
1656
+ var defaultChapterRecitationsOptions = {
1657
+ language: types.Language.ARABIC
1658
+ };
1659
+
1660
+ var getChapterRecitationsOptions = function getChapterRecitationsOptions(options) {
1661
+ if (options === void 0) {
1662
+ options = {};
1663
+ }
1664
+
1665
+ var _final = _extends({}, defaultChapterRecitationsOptions, options);
1666
+
1667
+ return _final;
1668
+ };
1669
+
1670
+ var defaultVerseRecitationsOptions = {
1671
+ language: types.Language.ARABIC
1672
+ };
1673
+
1674
+ var getVerseRecitationsOptions = function getVerseRecitationsOptions(options) {
1675
+ if (options === void 0) {
1676
+ options = {};
1677
+ }
1678
+
1679
+ var initial = _extends({}, defaultVerseRecitationsOptions, options);
1680
+
1681
+ var _final2 = {
1682
+ language: initial.language
1683
+ };
1684
+
1685
+ if (initial.fields) {
1686
+ var fields = [];
1687
+
1688
+ for (var _i = 0, _Object$entries = Object.entries(initial.fields); _i < _Object$entries.length; _i++) {
1689
+ var _Object$entries$_i = _Object$entries[_i],
1690
+ key = _Object$entries$_i[0],
1691
+ value = _Object$entries$_i[1];
1692
+ if (value) fields.push(humps.decamelize(key));
1693
+ }
1694
+
1695
+ _final2.fields = fields.join(',');
1696
+ }
1697
+
1698
+ return _final2;
1699
+ };
1700
+ /**
1701
+ * Get all chapter recitations for specific reciter
1702
+ * @description https://quran.api-docs.io/v4/audio-recitations/list-of-all-surah-audio-files-for-specific-reciter
1703
+ * @param {string} reciterId
1704
+ * @param {GetChapterRecitationsOptions} options
1705
+ * @example
1706
+ * quran.v4.audio.findAllChapterRecitations('2')
1707
+ */
1708
+
1709
+
1710
+ var findAllChapterRecitations = /*#__PURE__*/function () {
1711
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(reciterId, options) {
1712
+ var params, _yield$fetcher, audioFiles;
1713
+
1714
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
1715
+ while (1) {
1716
+ switch (_context.prev = _context.next) {
1717
+ case 0:
1718
+ params = getChapterRecitationsOptions(options);
1719
+ _context.next = 3;
1720
+ return fetcher("/chapter_recitations/" + reciterId, params);
1721
+
1722
+ case 3:
1723
+ _yield$fetcher = _context.sent;
1724
+ audioFiles = _yield$fetcher.audioFiles;
1725
+ return _context.abrupt("return", audioFiles);
1726
+
1727
+ case 6:
1728
+ case "end":
1729
+ return _context.stop();
1730
+ }
1731
+ }
1732
+ }, _callee);
1733
+ }));
1734
+
1735
+ return function findAllChapterRecitations(_x, _x2) {
1736
+ return _ref.apply(this, arguments);
1737
+ };
1738
+ }();
1739
+ /**
1740
+ * Get chapter recitation for specific reciter and a specific chapter
1741
+ * @description https://quran.api-docs.io/v4/audio-recitations/get-single-surah-audio-for-specific-reciter
1742
+ * @param {ChapterId} chapterId
1743
+ * @param {string} reciterId
1744
+ * @param {GetChapterRecitationsOptions} options
1745
+ * @example
1746
+ * quran.v4.audio.findChapterRecitationById('1', '2') // first chapter recitation for reciter 2
1747
+ */
1748
+
1749
+
1750
+ var findChapterRecitationById = /*#__PURE__*/function () {
1751
+ var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(chapterId, reciterId, options) {
1752
+ var params, _yield$fetcher2, audioFile;
1753
+
1754
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
1755
+ while (1) {
1756
+ switch (_context2.prev = _context2.next) {
1757
+ case 0:
1758
+ if (Utils.isValidChapterId(chapterId)) {
1759
+ _context2.next = 2;
1760
+ break;
1761
+ }
1762
+
1763
+ throw new Error('Invalid chapter id');
1764
+
1765
+ case 2:
1766
+ params = getChapterRecitationsOptions(options);
1767
+ _context2.next = 5;
1768
+ return fetcher("/chapter_recitations/" + reciterId + "/" + chapterId, params);
1769
+
1770
+ case 5:
1771
+ _yield$fetcher2 = _context2.sent;
1772
+ audioFile = _yield$fetcher2.audioFile;
1773
+ return _context2.abrupt("return", audioFile);
1774
+
1775
+ case 8:
1776
+ case "end":
1777
+ return _context2.stop();
1778
+ }
1779
+ }
1780
+ }, _callee2);
1781
+ }));
1782
+
1783
+ return function findChapterRecitationById(_x3, _x4, _x5) {
1784
+ return _ref2.apply(this, arguments);
1785
+ };
1786
+ }();
1787
+ /**
1788
+ * Get all verse audio files for a specific reciter and a specific chapter
1789
+ * @description https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-surah
1790
+ * @param {ChapterId} chapterId
1791
+ * @param {string} recitationId
1792
+ * @param {GetVerseRecitationsOptions} options
1793
+ * @example
1794
+ * quran.v4.audio.findVerseRecitationsByChapter('1', '2')
1795
+ */
1796
+
1797
+
1798
+ var findVerseRecitationsByChapter = /*#__PURE__*/function () {
1799
+ var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(chapterId, recitationId, options) {
1800
+ var params, data;
1801
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
1802
+ while (1) {
1803
+ switch (_context3.prev = _context3.next) {
1804
+ case 0:
1805
+ if (Utils.isValidChapterId(chapterId)) {
1806
+ _context3.next = 2;
1807
+ break;
1808
+ }
1809
+
1810
+ throw new Error('Invalid chapter id');
1811
+
1812
+ case 2:
1813
+ params = getVerseRecitationsOptions(options);
1814
+ _context3.next = 5;
1815
+ return fetcher("/recitations/" + recitationId + "/by_chapter/" + chapterId, params);
1816
+
1817
+ case 5:
1818
+ data = _context3.sent;
1819
+ return _context3.abrupt("return", data);
1820
+
1821
+ case 7:
1822
+ case "end":
1823
+ return _context3.stop();
1824
+ }
1825
+ }
1826
+ }, _callee3);
1827
+ }));
1828
+
1829
+ return function findVerseRecitationsByChapter(_x6, _x7, _x8) {
1830
+ return _ref3.apply(this, arguments);
1831
+ };
1832
+ }();
1833
+ /**
1834
+ * Get all verse audio files for a specific reciter and a specific juz
1835
+ * @description https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-juz
1836
+ * @param {JuzNumber} juz
1837
+ * @param {string} recitationId
1838
+ * @param {GetRecitationsOptions} options
1839
+ * @example
1840
+ * quran.v4.audio.findVerseRecitationsByJuz('1', '2')
1841
+ */
1842
+
1843
+
1844
+ var findVerseRecitationsByJuz = /*#__PURE__*/function () {
1845
+ var _ref4 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(juz, recitationId, options) {
1846
+ var params, data;
1847
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
1848
+ while (1) {
1849
+ switch (_context4.prev = _context4.next) {
1850
+ case 0:
1851
+ if (Utils.isValidJuz(juz)) {
1852
+ _context4.next = 2;
1853
+ break;
1854
+ }
1855
+
1856
+ throw new Error('Invalid juz');
1857
+
1858
+ case 2:
1859
+ params = getVerseRecitationsOptions(options);
1860
+ _context4.next = 5;
1861
+ return fetcher("/recitations/" + recitationId + "/by_juz/" + juz, params);
1862
+
1863
+ case 5:
1864
+ data = _context4.sent;
1865
+ return _context4.abrupt("return", data);
1866
+
1867
+ case 7:
1868
+ case "end":
1869
+ return _context4.stop();
1870
+ }
1871
+ }
1872
+ }, _callee4);
1873
+ }));
1874
+
1875
+ return function findVerseRecitationsByJuz(_x9, _x10, _x11) {
1876
+ return _ref4.apply(this, arguments);
1877
+ };
1878
+ }();
1879
+ /**
1880
+ * Get all verse audio files for a specific reciter and a specific mushaf page
1881
+ * @description https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-madani-mushaf-page
1882
+ * @param {PageNumber} page
1883
+ * @param {string} recitationId
1884
+ * @param {GetVerseRecitationsOptions} options
1885
+ * @example
1886
+ * quran.v4.audio.findVerseRecitationsByPage('1', '2')
1887
+ */
1888
+
1889
+
1890
+ var findVerseRecitationsByPage = /*#__PURE__*/function () {
1891
+ var _ref5 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(page, recitationId, options) {
1892
+ var params, data;
1893
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
1894
+ while (1) {
1895
+ switch (_context5.prev = _context5.next) {
1896
+ case 0:
1897
+ if (Utils.isValidQuranPage(page)) {
1898
+ _context5.next = 2;
1899
+ break;
1900
+ }
1901
+
1902
+ throw new Error('Invalid page');
1903
+
1904
+ case 2:
1905
+ params = getVerseRecitationsOptions(options);
1906
+ _context5.next = 5;
1907
+ return fetcher("/recitations/" + recitationId + "/by_page/" + page, params);
1908
+
1909
+ case 5:
1910
+ data = _context5.sent;
1911
+ return _context5.abrupt("return", data);
1912
+
1913
+ case 7:
1914
+ case "end":
1915
+ return _context5.stop();
1916
+ }
1917
+ }
1918
+ }, _callee5);
1919
+ }));
1920
+
1921
+ return function findVerseRecitationsByPage(_x12, _x13, _x14) {
1922
+ return _ref5.apply(this, arguments);
1923
+ };
1924
+ }();
1925
+ /**
1926
+ * Get all verse audio files for a specific reciter and a specific rub
1927
+ * @description https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-rub
1928
+ * @param {RubNumber} rub
1929
+ * @param {string} recitationId
1930
+ * @param {GetVerseRecitationsOptions} options
1931
+ * @example
1932
+ * quran.v4.audio.findVerseRecitationsByRub('1', '2')
1933
+ */
1934
+
1935
+
1936
+ var findVerseRecitationsByRub = /*#__PURE__*/function () {
1937
+ var _ref6 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(rub, recitationId, options) {
1938
+ var params, data;
1939
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
1940
+ while (1) {
1941
+ switch (_context6.prev = _context6.next) {
1942
+ case 0:
1943
+ if (Utils.isValidRub(rub)) {
1944
+ _context6.next = 2;
1945
+ break;
1946
+ }
1947
+
1948
+ throw new Error('Invalid rub');
1949
+
1950
+ case 2:
1951
+ params = getVerseRecitationsOptions(options);
1952
+ _context6.next = 5;
1953
+ return fetcher("/recitations/" + recitationId + "/by_rub/" + rub, params);
1954
+
1955
+ case 5:
1956
+ data = _context6.sent;
1957
+ return _context6.abrupt("return", data);
1958
+
1959
+ case 7:
1960
+ case "end":
1961
+ return _context6.stop();
1962
+ }
1963
+ }
1964
+ }, _callee6);
1965
+ }));
1966
+
1967
+ return function findVerseRecitationsByRub(_x15, _x16, _x17) {
1968
+ return _ref6.apply(this, arguments);
1969
+ };
1970
+ }();
1971
+ /**
1972
+ * Get all verse audio files for a specific reciter and a specific hizb
1973
+ * @description https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-hizb
1974
+ * @param {HizbNumber} hizb
1975
+ * @param {string} recitationId
1976
+ * @param {GetVerseRecitationsOptions} options
1977
+ * @example
1978
+ * quran.v4.audio.findVerseRecitationsByHizb('1', '2')
1979
+ */
1980
+
1981
+
1982
+ var findVerseRecitationsByHizb = /*#__PURE__*/function () {
1983
+ var _ref7 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(hizb, recitationId, options) {
1984
+ var params, data;
1985
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
1986
+ while (1) {
1987
+ switch (_context7.prev = _context7.next) {
1988
+ case 0:
1989
+ if (Utils.isValidHizb(hizb)) {
1990
+ _context7.next = 2;
1991
+ break;
1992
+ }
1993
+
1994
+ throw new Error('Invalid hizb');
1995
+
1996
+ case 2:
1997
+ params = getVerseRecitationsOptions(options);
1998
+ _context7.next = 5;
1999
+ return fetcher("/recitations/" + recitationId + "/by_hizb/" + hizb, params);
2000
+
2001
+ case 5:
2002
+ data = _context7.sent;
2003
+ return _context7.abrupt("return", data);
2004
+
2005
+ case 7:
2006
+ case "end":
2007
+ return _context7.stop();
2008
+ }
2009
+ }
2010
+ }, _callee7);
2011
+ }));
2012
+
2013
+ return function findVerseRecitationsByHizb(_x18, _x19, _x20) {
2014
+ return _ref7.apply(this, arguments);
2015
+ };
2016
+ }();
2017
+ /**
2018
+ * Get all verse audio files for a specific reciter and a specific hizb
2019
+ * @description https://quran.api-docs.io/v4/audio-recitations/get-ayah-recitations-for-specific-ayah
2020
+ * @param {VerseKey} key
2021
+ * @param {string} recitationId
2022
+ * @param {GetVerseRecitationsOptions} options
2023
+ * @example
2024
+ * quran.v4.audio.findVerseRecitationsByKey('1:1', '2')
2025
+ */
2026
+
2027
+
2028
+ var findVerseRecitationsByKey = /*#__PURE__*/function () {
2029
+ var _ref8 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(key, recitationId, options) {
2030
+ var params, data;
2031
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
2032
+ while (1) {
2033
+ switch (_context8.prev = _context8.next) {
2034
+ case 0:
2035
+ if (Utils.isValidVerseKey(key)) {
2036
+ _context8.next = 2;
2037
+ break;
2038
+ }
2039
+
2040
+ throw new Error('Invalid verse key');
2041
+
2042
+ case 2:
2043
+ params = getVerseRecitationsOptions(options);
2044
+ _context8.next = 5;
2045
+ return fetcher("/recitations/" + recitationId + "/by_ayah/" + key, params);
2046
+
2047
+ case 5:
2048
+ data = _context8.sent;
2049
+ return _context8.abrupt("return", data);
2050
+
2051
+ case 7:
2052
+ case "end":
2053
+ return _context8.stop();
2054
+ }
2055
+ }
2056
+ }, _callee8);
2057
+ }));
2058
+
2059
+ return function findVerseRecitationsByKey(_x21, _x22, _x23) {
2060
+ return _ref8.apply(this, arguments);
2061
+ };
2062
+ }();
2063
+
2064
+ var audio = {
2065
+ findAllChapterRecitations: findAllChapterRecitations,
2066
+ findChapterRecitationById: findChapterRecitationById,
2067
+ findVerseRecitationsByChapter: findVerseRecitationsByChapter,
2068
+ findVerseRecitationsByJuz: findVerseRecitationsByJuz,
2069
+ findVerseRecitationsByPage: findVerseRecitationsByPage,
2070
+ findVerseRecitationsByRub: findVerseRecitationsByRub,
2071
+ findVerseRecitationsByHizb: findVerseRecitationsByHizb,
2072
+ findVerseRecitationsByKey: findVerseRecitationsByKey
2073
+ };
2074
+
2075
+ var defaultOptions = {
2076
+ language: types.Language.ARABIC
2077
+ };
2078
+
2079
+ var getResourcesOptions = function getResourcesOptions(options) {
2080
+ if (options === void 0) {
2081
+ options = {};
2082
+ }
2083
+
2084
+ var _final = _extends({}, defaultOptions, options);
2085
+
2086
+ return _final;
2087
+ };
2088
+ /**
2089
+ * Get all recitations.
2090
+ * @description https://quran.api-docs.io/v4/resources/recitations
2091
+ * @param {GetResourcesOptions} options
2092
+ * @example
2093
+ * quran.v4.resources.findAllRecitations()
2094
+ */
2095
+
2096
+
2097
+ var findAllRecitations = /*#__PURE__*/function () {
2098
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(options) {
2099
+ var params, _yield$fetcher, recitations;
2100
+
2101
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
2102
+ while (1) {
2103
+ switch (_context.prev = _context.next) {
2104
+ case 0:
2105
+ params = getResourcesOptions(options);
2106
+ _context.next = 3;
2107
+ return fetcher('/resources/recitations', params);
2108
+
2109
+ case 3:
2110
+ _yield$fetcher = _context.sent;
2111
+ recitations = _yield$fetcher.recitations;
2112
+ return _context.abrupt("return", recitations);
2113
+
2114
+ case 6:
2115
+ case "end":
2116
+ return _context.stop();
2117
+ }
2118
+ }
2119
+ }, _callee);
2120
+ }));
2121
+
2122
+ return function findAllRecitations(_x) {
2123
+ return _ref.apply(this, arguments);
2124
+ };
2125
+ }(); // TODO: uncomment when API is ready
2126
+
2127
+ /**
2128
+ * Get all recitation info.
2129
+ * @description https://quran.api-docs.io/v4/resources/recitation-info
2130
+ * @param {string} id recitation id
2131
+ * @param {GetResourcesOptions} options
2132
+ * @example
2133
+ * quran.v4.resources.findRecitationInfo('1')
2134
+ */
2135
+ // const findRecitationInfo = async (id: string, options?: GetResourcesOptions) => {
2136
+ // const params = getResourcesOptions(options);
2137
+ // const { info } = await fetcher<{
2138
+ // info: RecitationInfoResource;
2139
+ // }>(`/resources/recitations/${id}/info`, params);
2140
+ // return info;
2141
+ // };
2142
+
2143
+ /**
2144
+ * Get all translations.
2145
+ * @description https://quran.api-docs.io/v4/resources/translations
2146
+ * @param {GetResourcesOptions} options
2147
+ * @example
2148
+ * quran.v4.resources.findAllTranslations()
2149
+ */
2150
+
2151
+
2152
+ var findAllTranslations = /*#__PURE__*/function () {
2153
+ var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(options) {
2154
+ var params, _yield$fetcher2, translations;
2155
+
2156
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
2157
+ while (1) {
2158
+ switch (_context2.prev = _context2.next) {
2159
+ case 0:
2160
+ params = getResourcesOptions(options);
2161
+ _context2.next = 3;
2162
+ return fetcher('/resources/translations', params);
2163
+
2164
+ case 3:
2165
+ _yield$fetcher2 = _context2.sent;
2166
+ translations = _yield$fetcher2.translations;
2167
+ return _context2.abrupt("return", translations);
2168
+
2169
+ case 6:
2170
+ case "end":
2171
+ return _context2.stop();
2172
+ }
2173
+ }
2174
+ }, _callee2);
2175
+ }));
2176
+
2177
+ return function findAllTranslations(_x2) {
2178
+ return _ref2.apply(this, arguments);
2179
+ };
2180
+ }(); // TODO: uncomment when API is ready
2181
+
2182
+ /**
2183
+ * Get translation info.
2184
+ * @description https://quran.api-docs.io/v4/resources/translation-info
2185
+ * @param {string} id translation id
2186
+ * @param {GetResourcesOptions} options
2187
+ * @example
2188
+ * quran.v4.resources.findTranslationInfo('169')
2189
+ */
2190
+ // const findTranslationInfo = async (id: string, options?: GetResourcesOptions) => {
2191
+ // const params = getResourcesOptions(options);
2192
+ // const { info } = await fetcher<{
2193
+ // info: TranslationInfoResource;
2194
+ // }>(`/resources/translations/${id}/info`, params);
2195
+ // return info;
2196
+ // };
2197
+
2198
+ /**
2199
+ * Get all tafsirs.
2200
+ * @description https://quran.api-docs.io/v4/resources/tafsirs
2201
+ * @param {GetResourcesOptions} options
2202
+ * @example
2203
+ * quran.v4.resources.findAllTafsirs()
2204
+ */
2205
+
2206
+
2207
+ var findAllTafsirs = /*#__PURE__*/function () {
2208
+ var _ref3 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(options) {
2209
+ var params, _yield$fetcher3, tafsirs;
2210
+
2211
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
2212
+ while (1) {
2213
+ switch (_context3.prev = _context3.next) {
2214
+ case 0:
2215
+ params = getResourcesOptions(options);
2216
+ _context3.next = 3;
2217
+ return fetcher('/resources/tafsirs', params);
2218
+
2219
+ case 3:
2220
+ _yield$fetcher3 = _context3.sent;
2221
+ tafsirs = _yield$fetcher3.tafsirs;
2222
+ return _context3.abrupt("return", tafsirs);
2223
+
2224
+ case 6:
2225
+ case "end":
2226
+ return _context3.stop();
2227
+ }
2228
+ }
2229
+ }, _callee3);
2230
+ }));
2231
+
2232
+ return function findAllTafsirs(_x3) {
2233
+ return _ref3.apply(this, arguments);
2234
+ };
2235
+ }(); // TODO: uncomment when API is ready
2236
+
2237
+ /**
2238
+ * Get tafsir info.
2239
+ * @description https://quran.api-docs.io/v4/resources/tafsirs-info
2240
+ * @param {string} id tafsir id
2241
+ * @param {GetResourcesOptions} options
2242
+ * @example
2243
+ * quran.v4.resources.findTranslationInfo('1')
2244
+ */
2245
+ // const findTafsirInfo = async (id: string, options?: GetResourcesOptions) => {
2246
+ // const params = getResourcesOptions(options);
2247
+ // const { info } = await fetcher<{
2248
+ // info: TafsirInfoResource;
2249
+ // }>(`/resources/tafsirs/${id}/info`, params);
2250
+ // return info;
2251
+ // };
2252
+
2253
+ /**
2254
+ * Get all recitation styles.
2255
+ * @description https://quran.api-docs.io/v4/resources/recitation-styles
2256
+ * @example
2257
+ * quran.v4.resources.findAllRecitationStyles()
2258
+ */
2259
+
2260
+
2261
+ var findAllRecitationStyles = /*#__PURE__*/function () {
2262
+ var _ref4 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
2263
+ var _yield$fetcher4, recitationStyles;
2264
+
2265
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
2266
+ while (1) {
2267
+ switch (_context4.prev = _context4.next) {
2268
+ case 0:
2269
+ _context4.next = 2;
2270
+ return fetcher('/resources/recitation_styles');
2271
+
2272
+ case 2:
2273
+ _yield$fetcher4 = _context4.sent;
2274
+ recitationStyles = _yield$fetcher4.recitationStyles;
2275
+ return _context4.abrupt("return", recitationStyles);
2276
+
2277
+ case 5:
2278
+ case "end":
2279
+ return _context4.stop();
2280
+ }
2281
+ }
2282
+ }, _callee4);
2283
+ }));
2284
+
2285
+ return function findAllRecitationStyles() {
2286
+ return _ref4.apply(this, arguments);
2287
+ };
2288
+ }();
2289
+ /**
2290
+ * Get all languages.
2291
+ * @description https://quran.api-docs.io/v4/resources/languages
2292
+ * @param {GetResourcesOptions} options
2293
+ * @example
2294
+ * quran.v4.resources.findAllLanguages()
2295
+ */
2296
+
2297
+
2298
+ var findAllLanguages = /*#__PURE__*/function () {
2299
+ var _ref5 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(options) {
2300
+ var params, _yield$fetcher5, languages;
2301
+
2302
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
2303
+ while (1) {
2304
+ switch (_context5.prev = _context5.next) {
2305
+ case 0:
2306
+ params = getResourcesOptions(options);
2307
+ _context5.next = 3;
2308
+ return fetcher('/resources/languages', params);
2309
+
2310
+ case 3:
2311
+ _yield$fetcher5 = _context5.sent;
2312
+ languages = _yield$fetcher5.languages;
2313
+ return _context5.abrupt("return", languages);
2314
+
2315
+ case 6:
2316
+ case "end":
2317
+ return _context5.stop();
2318
+ }
2319
+ }
2320
+ }, _callee5);
2321
+ }));
2322
+
2323
+ return function findAllLanguages(_x4) {
2324
+ return _ref5.apply(this, arguments);
2325
+ };
2326
+ }();
2327
+ /**
2328
+ * Get all chapter infos.
2329
+ * @description https://quran.api-docs.io/v4/resources/chapter-info
2330
+ * @param {GetResourcesOptions} options
2331
+ * @example
2332
+ * quran.v4.resources.findAllChapterInfos()
2333
+ */
2334
+
2335
+
2336
+ var findAllChapterInfos = /*#__PURE__*/function () {
2337
+ var _ref6 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(options) {
2338
+ var params, _yield$fetcher6, chapterInfos;
2339
+
2340
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
2341
+ while (1) {
2342
+ switch (_context6.prev = _context6.next) {
2343
+ case 0:
2344
+ params = getResourcesOptions(options);
2345
+ _context6.next = 3;
2346
+ return fetcher('/resources/chapter_infos', params);
2347
+
2348
+ case 3:
2349
+ _yield$fetcher6 = _context6.sent;
2350
+ chapterInfos = _yield$fetcher6.chapterInfos;
2351
+ return _context6.abrupt("return", chapterInfos);
2352
+
2353
+ case 6:
2354
+ case "end":
2355
+ return _context6.stop();
2356
+ }
2357
+ }
2358
+ }, _callee6);
2359
+ }));
2360
+
2361
+ return function findAllChapterInfos(_x5) {
2362
+ return _ref6.apply(this, arguments);
2363
+ };
2364
+ }();
2365
+ /**
2366
+ * Get verse media.
2367
+ * @description https://quran.api-docs.io/v4/resources/verse_media
2368
+ * @param {GetResourcesOptions} options
2369
+ * @example
2370
+ * quran.v4.resources.findVerseMedia()
2371
+ */
2372
+
2373
+
2374
+ var findVerseMedia = /*#__PURE__*/function () {
2375
+ var _ref7 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(options) {
2376
+ var params, _yield$fetcher7, verseMedia;
2377
+
2378
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
2379
+ while (1) {
2380
+ switch (_context7.prev = _context7.next) {
2381
+ case 0:
2382
+ params = getResourcesOptions(options);
2383
+ _context7.next = 3;
2384
+ return fetcher("/resources/verse_media", params);
2385
+
2386
+ case 3:
2387
+ _yield$fetcher7 = _context7.sent;
2388
+ verseMedia = _yield$fetcher7.verseMedia;
2389
+ return _context7.abrupt("return", verseMedia);
2390
+
2391
+ case 6:
2392
+ case "end":
2393
+ return _context7.stop();
2394
+ }
2395
+ }
2396
+ }, _callee7);
2397
+ }));
2398
+
2399
+ return function findVerseMedia(_x6) {
2400
+ return _ref7.apply(this, arguments);
2401
+ };
2402
+ }();
2403
+ /**
2404
+ * Get all chapter reciters.
2405
+ * @description https://quran.api-docs.io/v4/resources/list-of-chapter-reciters
2406
+ * @param {GetResourcesOptions} options
2407
+ * @example
2408
+ * quran.v4.resources.findAllChapterReciters()
2409
+ */
2410
+
2411
+
2412
+ var findAllChapterReciters = /*#__PURE__*/function () {
2413
+ var _ref8 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(options) {
2414
+ var params, _yield$fetcher8, reciters;
2415
+
2416
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
2417
+ while (1) {
2418
+ switch (_context8.prev = _context8.next) {
2419
+ case 0:
2420
+ params = getResourcesOptions(options);
2421
+ _context8.next = 3;
2422
+ return fetcher("/resources/chapter_reciters", params);
2423
+
2424
+ case 3:
2425
+ _yield$fetcher8 = _context8.sent;
2426
+ reciters = _yield$fetcher8.reciters;
2427
+ return _context8.abrupt("return", reciters);
2428
+
2429
+ case 6:
2430
+ case "end":
2431
+ return _context8.stop();
2432
+ }
2433
+ }
2434
+ }, _callee8);
2435
+ }));
2436
+
2437
+ return function findAllChapterReciters(_x7) {
2438
+ return _ref8.apply(this, arguments);
2439
+ };
2440
+ }();
2441
+
2442
+ var resources = {
2443
+ findAllRecitations: findAllRecitations,
2444
+ findAllTranslations: findAllTranslations,
2445
+ findAllTafsirs: findAllTafsirs,
2446
+ findAllRecitationStyles: findAllRecitationStyles,
2447
+ findAllLanguages: findAllLanguages,
2448
+ findVerseMedia: findVerseMedia,
2449
+ findAllChapterReciters: findAllChapterReciters,
2450
+ findAllChapterInfos: findAllChapterInfos // findRecitationInfo
2451
+ // findTranslationInfo
2452
+ // findTafsirInfo
2453
+
2454
+ };
2455
+
2456
+ var defaultSearchOptions = {
2457
+ language: types.Language.ARABIC,
2458
+ size: 30
2459
+ };
2460
+
2461
+ var getSearchOptions = function getSearchOptions(q, options) {
2462
+ if (options === void 0) {
2463
+ options = {};
2464
+ }
2465
+
2466
+ var all = _extends({}, defaultSearchOptions, options, {
2467
+ q: q
2468
+ });
2469
+
2470
+ return all;
2471
+ };
2472
+ /**
2473
+ * Search
2474
+ * @description https://quran.api-docs.io/v4/search/KfCmk4KQYbtyK9adj
2475
+ * @param q search query
2476
+ * @param options search options
2477
+ * @example
2478
+ * quran.v4.search.search('الله')
2479
+ * quran.v4.search.search('الله', { language: Language.ENGLISH })
2480
+ * quran.v4.search.search('الله', { language: Language.ENGLISH, size: 10 })
2481
+ * quran.v4.search.search('الله', { language: Language.ENGLISH, page: 2 })
2482
+ */
2483
+
2484
+
2485
+ var search = /*#__PURE__*/function () {
2486
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(q, options) {
2487
+ var params, _yield$fetcher, search;
2488
+
2489
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
2490
+ while (1) {
2491
+ switch (_context.prev = _context.next) {
2492
+ case 0:
2493
+ params = getSearchOptions(q, options);
2494
+ _context.next = 3;
2495
+ return fetcher('/search', params);
2496
+
2497
+ case 3:
2498
+ _yield$fetcher = _context.sent;
2499
+ search = _yield$fetcher.search;
2500
+ return _context.abrupt("return", search);
2501
+
2502
+ case 6:
2503
+ case "end":
2504
+ return _context.stop();
2505
+ }
2506
+ }
2507
+ }, _callee);
2508
+ }));
2509
+
2510
+ return function search(_x, _x2) {
2511
+ return _ref.apply(this, arguments);
2512
+ };
2513
+ }();
2514
+
2515
+ var searchApi = {
2516
+ search: search
2517
+ };
2518
+
2519
+ var v4 = {
2520
+ chapters: chapters,
2521
+ verses: verses,
2522
+ juzs: juzs,
2523
+ audio: audio,
2524
+ resources: resources,
2525
+ search: searchApi
2526
+ };
2527
+
2528
+ var quran = {
2529
+ v4: v4,
2530
+ utils: Utils
2531
+ };
2532
+
2533
+ exports.CharType = void 0;
2534
+
2535
+ (function (CharType) {
2536
+ CharType["Word"] = "word";
2537
+ CharType["End"] = "end";
2538
+ CharType["Pause"] = "pause";
2539
+ CharType["Sajdah"] = "sajdah";
2540
+ CharType["RubElHizb"] = "rub-el-hizb";
2541
+ })(exports.CharType || (exports.CharType = {}));
2542
+
2543
+ exports.Language = void 0;
2544
+
2545
+ (function (Language) {
2546
+ Language["ARABIC"] = "ar";
2547
+ Language["ENGLISH"] = "en";
2548
+ Language["URDU"] = "ur";
2549
+ Language["BENGALI"] = "bn";
2550
+ Language["TURKISH"] = "tr";
2551
+ Language["SPANISH"] = "es";
2552
+ Language["GERMAN"] = "de";
2553
+ Language["BOSNIAN"] = "bs";
2554
+ Language["RUSSIAN"] = "ru";
2555
+ Language["ALBANIAN_AL"] = "al";
2556
+ Language["FRENCH"] = "fr";
2557
+ Language["DUTCH"] = "nl";
2558
+ Language["TAMIL"] = "ta";
2559
+ Language["TAJIK"] = "tg";
2560
+ Language["INDONESIAN"] = "id";
2561
+ Language["UZBEK"] = "uz";
2562
+ Language["VIETNAMESE"] = "vi";
2563
+ Language["CHINESE"] = "zh";
2564
+ Language["ITALIAN"] = "it";
2565
+ Language["JAPANESE"] = "ja";
2566
+ Language["MALAYALAM"] = "ml";
2567
+ Language["AMHARIC"] = "am";
2568
+ Language["KAZAKH"] = "kk";
2569
+ Language["PORTUGUESE"] = "pt";
2570
+ Language["TAGALOG"] = "tl";
2571
+ Language["THAI"] = "th";
2572
+ Language["KOREAN"] = "ko";
2573
+ Language["HINDI"] = "hi";
2574
+ Language["KURDISH"] = "ku";
2575
+ Language["HAUSA"] = "ha";
2576
+ Language["AZERI"] = "az";
2577
+ Language["SWAHILI"] = "sw";
2578
+ Language["PERSIAN"] = "fa";
2579
+ Language["SERBIAN"] = "sr";
2580
+ Language["MARANAO"] = "mrn";
2581
+ Language["AMAZIGH"] = "zgh";
2582
+ Language["ASSAMESE"] = "as";
2583
+ Language["BULGARIAN"] = "bg";
2584
+ Language["CHECHEN"] = "ce";
2585
+ Language["CZECH"] = "cs";
2586
+ Language["DIVEHI"] = "dv";
2587
+ Language["DHIVEHI"] = "dv";
2588
+ Language["MALDIVIAN"] = "dv";
2589
+ Language["FINNISH"] = "fi";
2590
+ Language["GUJAARATI"] = "gu";
2591
+ Language["HEBREW"] = "he";
2592
+ Language["GEORGIAN"] = "ka";
2593
+ Language["CENTRAL_KHMER"] = "km";
2594
+ Language["GANDA"] = "lg";
2595
+ Language["MARATHI"] = "mr";
2596
+ Language["YORUBA"] = "yo";
2597
+ Language["MALAY"] = "ms";
2598
+ Language["NEPALI"] = "ne";
2599
+ Language["SWEDISH"] = "sv";
2600
+ Language["TELUGU"] = "te";
2601
+ Language["TATAR"] = "tt";
2602
+ Language["UIGHUR"] = "ug";
2603
+ Language["UYGHUR"] = "ug";
2604
+ Language["UKRAINIAN"] = "uk";
2605
+ Language["NORWEGIAN"] = "no";
2606
+ Language["OROMO"] = "om";
2607
+ Language["POLISH"] = "pl";
2608
+ Language["PASHTO"] = "ps";
2609
+ Language["ROMANIAN"] = "ro";
2610
+ Language["SINDHI"] = "sd";
2611
+ Language["NORTHERN_SAMI"] = "se";
2612
+ Language["SINHALA"] = "si";
2613
+ Language["SINHALESE"] = "si";
2614
+ Language["SOMALI"] = "so";
2615
+ Language["ALBANIAN_SQ"] = "sq";
2616
+ })(exports.Language || (exports.Language = {}));
2617
+
2618
+ exports.QuranFont = void 0;
2619
+
2620
+ (function (QuranFont) {
2621
+ QuranFont["MadaniV1"] = "code_v1";
2622
+ QuranFont["MadaniV2"] = "code_v2";
2623
+ QuranFont["Uthmani"] = "text_uthmani";
2624
+ })(exports.QuranFont || (exports.QuranFont = {}));
2625
+
2626
+ exports.quran = quran;
2627
+ //# sourceMappingURL=api.cjs.development.js.map