badiDate-locales.js 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702
  1. /**
  2. * @license BadiDate v3.0.2
  3. * (c) 2018 Jan Greis
  4. * licensed under MIT
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('luxon')) :
  8. typeof define === 'function' && define.amd ? define(['exports', 'luxon'], factory) :
  9. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.window = global.window || {}, global.luxon));
  10. }(this, (function (exports, luxon) { 'use strict';
  11. const month = {
  12. 1: 'Bahá',
  13. 2: 'Jalál',
  14. 3: 'Jamál',
  15. 4: '‘Aẓamat',
  16. 5: 'Núr',
  17. 6: 'Raḥmat',
  18. 7: 'Kalimát',
  19. 8: 'Kamál',
  20. 9: 'Asmá’',
  21. 10: '‘Izzat',
  22. 11: 'Ma_sh_íyyat',
  23. 12: '‘Ilm',
  24. 13: 'Qudrat',
  25. 14: 'Qawl',
  26. 15: 'Masá’il',
  27. 16: '_Sh_araf',
  28. 17: 'Sulṭán',
  29. 18: 'Mulk',
  30. 19: '‘Alá’',
  31. 20: 'Ayyám-i-Há',
  32. };
  33. const monthL = {
  34. 1: 'Splendour',
  35. 2: 'Glory',
  36. 3: 'Beauty',
  37. 4: 'Grandeur',
  38. 5: 'Light',
  39. 6: 'Mercy',
  40. 7: 'Words',
  41. 8: 'Perfection',
  42. 9: 'Names',
  43. 10: 'Might',
  44. 11: 'Will',
  45. 12: 'Knowledge',
  46. 13: 'Power',
  47. 14: 'Speech',
  48. 15: 'Questions',
  49. 16: 'Honour',
  50. 17: 'Sovereignty',
  51. 18: 'Dominion',
  52. 19: 'Loftiness',
  53. 20: 'Ayyám-i-Há',
  54. };
  55. const holyDay = {
  56. 1: 'Naw-Rúz',
  57. 2: 'First day of Riḍván',
  58. 3: 'Ninth day of Riḍván',
  59. 4: 'Twelfth day of Riḍván',
  60. 5: 'Declaration of the Báb',
  61. 6: 'Ascension of Bahá’u’lláh',
  62. 7: 'Martyrdom of the Báb',
  63. 8: 'Birth of the Báb',
  64. 9: 'Birth of Bahá’u’lláh',
  65. 10: 'Day of the Covenant',
  66. 11: 'Ascension of ‘Abdu’l-Bahá',
  67. };
  68. // CAREFUL: Numbering corresponds to Badí' week, i.e. 1 is Jalál (-> Saturday)
  69. const weekday = {
  70. 1: 'Jalál',
  71. 2: 'Jamál',
  72. 3: 'Kamál',
  73. 4: 'Fiḍál',
  74. 5: '‘Idál',
  75. 6: 'Istijlál',
  76. 7: 'Istiqlál',
  77. };
  78. const weekdayAbbr3 = {
  79. 1: 'Jal',
  80. 2: 'Jam',
  81. 3: 'Kam',
  82. 4: 'Fiḍ',
  83. 5: '‘Idá',
  84. 6: 'Isj',
  85. 7: 'Isq',
  86. };
  87. const weekdayAbbr2 = {
  88. 1: 'Jl',
  89. 2: 'Jm',
  90. 3: 'Ka',
  91. 4: 'Fi',
  92. 5: '‘Id',
  93. 6: 'Ij',
  94. 7: 'Iq',
  95. };
  96. const weekdayL = {
  97. 1: 'Glory',
  98. 2: 'Beauty',
  99. 3: 'Perfection',
  100. 4: 'Grace',
  101. 5: 'Justice',
  102. 6: 'Majesty',
  103. 7: 'Independence',
  104. };
  105. const yearInVahid = {
  106. 1: 'Alif',
  107. 2: 'Bá’',
  108. 3: 'Ab',
  109. 4: 'Dál',
  110. 5: 'Báb',
  111. 6: 'Váv',
  112. 7: 'Abad',
  113. 8: 'Jád',
  114. 9: 'Bahá',
  115. 10: 'Ḥubb',
  116. 11: 'Bahháj',
  117. 12: 'Javáb',
  118. 13: 'Aḥad',
  119. 14: 'Vahháb',
  120. 15: 'Vidád',
  121. 16: 'Badí‘',
  122. 17: 'Bahí',
  123. 18: 'Abhá',
  124. 19: 'Váḥid',
  125. };
  126. const vahid = 'Váḥid';
  127. const kulliShay = 'Kull-i-_Sh_ay’';
  128. const BE = 'B.E.';
  129. const badiCalendar = 'Badí‘ Calendar';
  130. const unicodeCharForZero = '0';
  131. const defaultFormat = 'd MM+ y BE';
  132. var en = /*#__PURE__*/Object.freeze({
  133. __proto__: null,
  134. month: month,
  135. monthL: monthL,
  136. holyDay: holyDay,
  137. weekday: weekday,
  138. weekdayAbbr3: weekdayAbbr3,
  139. weekdayAbbr2: weekdayAbbr2,
  140. weekdayL: weekdayL,
  141. yearInVahid: yearInVahid,
  142. vahid: vahid,
  143. kulliShay: kulliShay,
  144. BE: BE,
  145. badiCalendar: badiCalendar,
  146. unicodeCharForZero: unicodeCharForZero,
  147. defaultFormat: defaultFormat
  148. });
  149. const month$1 = {
  150. 1: 'البهاء',
  151. 2: 'الجلال',
  152. 3: 'الجمال',
  153. 4: 'العظمة',
  154. 5: 'النور',
  155. 6: 'الرحمة',
  156. 7: 'الكلمات',
  157. 8: 'الكمال',
  158. 9: 'الأسماء',
  159. 10: 'العزّة',
  160. 11: 'المشية',
  161. 12: 'العلم',
  162. 13: 'القدرة',
  163. 14: 'القول',
  164. 15: 'المسائل',
  165. 16: 'الشرف',
  166. 17: 'السلطان',
  167. 18: 'الملك',
  168. 19: 'العلاء',
  169. 20: 'ايام الهاء',
  170. };
  171. const monthL$1 = month$1;
  172. const holyDay$1 = {
  173. 1: 'عيد النَّيروز',
  174. 2: 'اليوم الأول من عيد الرِّضوان',
  175. 3: 'اليوم التاسع من عيد الرِّضوان',
  176. 4: 'اليوم الثاني عشر من عيد الرِّضوان',
  177. 5: 'يوم إعلان دعوة حضرة الباب',
  178. 6: 'يوم صعود حضرة بهاء الله',
  179. 7: 'يوم استشهاد حضرة الباب',
  180. 8: 'يوم ولادة حضرة الباب',
  181. 9: 'يوم ولادة حضرة بهاء الله',
  182. 10: 'يوم الميثاق',
  183. 11: 'يوم صعود حضرة عبد البهاء',
  184. };
  185. const weekday$1 = {
  186. 1: 'الجلال',
  187. 2: 'الجمال',
  188. 3: 'الكمال',
  189. 4: 'الفضّال',
  190. 5: 'العدّال',
  191. 6: 'الأستجلال',
  192. 7: 'الاستقلال',
  193. };
  194. const weekdayAbbr3$1 = {
  195. 1: 'جلا',
  196. 2: 'جما',
  197. 3: 'كما',
  198. 4: 'فضّا',
  199. 5: 'عدّا',
  200. 6: 'اسج',
  201. 7: 'اسق',
  202. };
  203. const weekdayAbbr2$1 = {
  204. 1: 'جل',
  205. 2: 'جم',
  206. 3: 'كم',
  207. 4: 'فض',
  208. 5: 'عد',
  209. 6: 'اج',
  210. 7: 'اق',
  211. };
  212. const weekdayL$1 = {
  213. 1: 'الجلال',
  214. 2: 'الجمال',
  215. 3: 'الكمال',
  216. 4: 'الفضّال',
  217. 5: 'العدّال',
  218. 6: 'الأستجلال',
  219. 7: 'أستقلال',
  220. };
  221. const yearInVahid$1 = {
  222. 1: 'ألف',
  223. 2: 'باء',
  224. 3: 'أب',
  225. 4: 'دﺍﻝ',
  226. 5: 'باب',
  227. 6: 'وﺍو',
  228. 7: 'أبد',
  229. 8: 'جاد',
  230. 9: 'بهاء',
  231. 10: 'حب',
  232. 11: 'بهاج',
  233. 12: 'جواب',
  234. 13: 'احد',
  235. 14: 'وﻫﺎب',
  236. 15: 'وداد',
  237. 16: 'بدیع',
  238. 17: 'بهي',
  239. 18: 'ابهى',
  240. 19: 'واحد',
  241. };
  242. const vahid$1 = 'واحد';
  243. const kulliShay$1 = 'كل شيء';
  244. const BE$1 = 'بديع';
  245. const badiCalendar$1 = 'تقويم بديع';
  246. const unicodeCharForZero$1 = '٠';
  247. const defaultFormat$1 = '‏d MM y BE‏';
  248. var ar = /*#__PURE__*/Object.freeze({
  249. __proto__: null,
  250. month: month$1,
  251. monthL: monthL$1,
  252. holyDay: holyDay$1,
  253. weekday: weekday$1,
  254. weekdayAbbr3: weekdayAbbr3$1,
  255. weekdayAbbr2: weekdayAbbr2$1,
  256. weekdayL: weekdayL$1,
  257. yearInVahid: yearInVahid$1,
  258. vahid: vahid$1,
  259. kulliShay: kulliShay$1,
  260. BE: BE$1,
  261. badiCalendar: badiCalendar$1,
  262. unicodeCharForZero: unicodeCharForZero$1,
  263. defaultFormat: defaultFormat$1
  264. });
  265. const monthL$2 = {
  266. 1: 'Herrlichkeit',
  267. 2: 'Ruhm',
  268. 3: 'Schönheit',
  269. 4: 'Größe',
  270. 5: 'Licht',
  271. 6: 'Barmherzigkeit',
  272. 7: 'Worte',
  273. 8: 'Vollkommenheit',
  274. 9: 'Namen',
  275. 10: 'Macht',
  276. 11: 'Wille',
  277. 12: 'Wissen',
  278. 13: 'Kraft',
  279. 14: 'Sprache',
  280. 15: 'Fragen',
  281. 16: 'Ehre',
  282. 17: 'Souveränität',
  283. 18: 'Herrschaft',
  284. 19: 'Erhabenheit',
  285. 20: 'Ayyám-i-Há',
  286. };
  287. const holyDay$2 = {
  288. 1: 'Naw-Rúz',
  289. 2: 'Erster Riḍván-Tag',
  290. 3: 'Neunter Riḍván-Tag',
  291. 4: 'Zwölfter Riḍván-Tag',
  292. 5: 'Erklärung des Báb',
  293. 6: 'Hinscheiden Bahá’u’lláhs',
  294. 7: 'Märtyrertod des Báb',
  295. 8: 'Geburt des Báb',
  296. 9: 'Geburt Bahá’u’lláhs',
  297. 10: 'Tag des Bundes',
  298. 11: 'Hinscheiden ‘Abdu’l-Bahás',
  299. };
  300. const weekdayL$2 = {
  301. 1: 'Ruhm',
  302. 2: 'Schönheit',
  303. 3: 'Vollkommenheit',
  304. 4: 'Gnade',
  305. 5: 'Gerechtigkeit',
  306. 6: 'Majestät',
  307. 7: 'Unabhängigkeit',
  308. };
  309. const BE$2 = 'B.E.';
  310. const badiCalendar$2 = 'Badí‘ Kalender';
  311. var de = /*#__PURE__*/Object.freeze({
  312. __proto__: null,
  313. monthL: monthL$2,
  314. holyDay: holyDay$2,
  315. weekdayL: weekdayL$2,
  316. BE: BE$2,
  317. badiCalendar: badiCalendar$2
  318. });
  319. const monthL$3 = {
  320. 1: 'Esplendor',
  321. 2: 'Gloria',
  322. 3: 'Belleza',
  323. 4: 'Grandeza',
  324. 5: 'Luz',
  325. 6: 'Misericordia',
  326. 7: 'Palabras',
  327. 8: 'Perfección',
  328. 9: 'Nombres',
  329. 10: 'Fuerza',
  330. 11: 'Voluntad',
  331. 12: 'Conocimiento',
  332. 13: 'Poder',
  333. 14: 'Discurso',
  334. 15: 'Preguntas',
  335. 16: 'Honor',
  336. 17: 'Soberanía',
  337. 18: 'Dominio',
  338. 19: 'Sublimidad',
  339. 20: 'Ayyám-i-Há',
  340. };
  341. const holyDay$3 = {
  342. 1: 'Naw-Rúz',
  343. 2: 'Primer día de Riḍván',
  344. 3: 'Noveno día de Riḍván',
  345. 4: 'Duodécimo día de Riḍván',
  346. 5: 'Declaración del Báb',
  347. 6: 'Ascensión de Bahá’u’lláh',
  348. 7: 'Martirio del Báb',
  349. 8: 'Nacimiento del Báb',
  350. 9: 'Nacimiento de Bahá’u’lláh',
  351. 10: 'Día de la Alianza',
  352. 11: 'Fallecimiento de ‘Abdu’l-Bahá',
  353. };
  354. const weekdayL$3 = {
  355. 1: 'Gloria',
  356. 2: 'Belleza',
  357. 3: 'Perfección',
  358. 4: 'Gracia',
  359. 5: 'Justicia',
  360. 6: 'Majestuosidad',
  361. 7: 'Independencia',
  362. };
  363. const BE$3 = 'E.B.';
  364. const badiCalendar$3 = 'Calendario Badí‘';
  365. var es = /*#__PURE__*/Object.freeze({
  366. __proto__: null,
  367. monthL: monthL$3,
  368. holyDay: holyDay$3,
  369. weekdayL: weekdayL$3,
  370. BE: BE$3,
  371. badiCalendar: badiCalendar$3
  372. });
  373. const month$2 = {
  374. 1: 'البهاء',
  375. 2: 'الجلال',
  376. 3: 'الجمال',
  377. 4: 'العظمة',
  378. 5: 'النور',
  379. 6: 'الرحمة',
  380. 7: 'الكلمات',
  381. 8: 'الكمال',
  382. 9: 'الأسماء',
  383. 10: 'العزّة',
  384. 11: 'المشية',
  385. 12: 'العلم',
  386. 13: 'القدرة',
  387. 14: 'القول',
  388. 15: 'المسائل',
  389. 16: 'الشرف',
  390. 17: 'السلطان',
  391. 18: 'الملك',
  392. 19: 'العلاء',
  393. 20: 'ايام الهاء',
  394. };
  395. const monthL$4 = {
  396. 1: 'بهاء',
  397. 2: 'جلال',
  398. 3: 'جمال',
  399. 4: 'عظمت',
  400. 5: 'نور',
  401. 6: 'رحمت',
  402. 7: 'كلمات',
  403. 8: 'كمال',
  404. 9: 'أسماء',
  405. 10: 'عزّت',
  406. 11: 'مشيت',
  407. 12: 'علم',
  408. 13: 'قدرت',
  409. 14: 'قول',
  410. 15: 'مسائل',
  411. 16: 'شرف',
  412. 17: 'سلطان',
  413. 18: 'ملك',
  414. 19: 'علاء',
  415. 20: 'ايام ها',
  416. };
  417. const holyDay$4 = {
  418. 1: 'عید نوروز',
  419. 2: 'روز اوّل عید رضوان',
  420. 3: 'روز نهم عید رضوان',
  421. 4: 'روز دوازدهم عید رضوان',
  422. 5: 'بعثت حضرت باب',
  423. 6: 'صعود حضرت بهاالله',
  424. 7: 'شهادت حضرت اعلی',
  425. 8: 'تولّد حضرت اعلی',
  426. 9: 'تولّد حضرت بهالله',
  427. 10: 'روز عهد و میثاق',
  428. 11: 'صعود حضرت عبدالبها',
  429. };
  430. const weekday$2 = {
  431. 1: 'یوم الجلال',
  432. 2: 'یوم الجمال',
  433. 3: 'یوم الكمال',
  434. 4: 'یوم الفضّال',
  435. 5: 'یوم العدّال',
  436. 6: 'یوم الأستجلال',
  437. 7: 'یوم الاستقلال',
  438. };
  439. const weekdayAbbr3$2 = {
  440. 1: 'جلا',
  441. 2: 'جما',
  442. 3: 'كما',
  443. 4: 'فضّا',
  444. 5: 'عدّا',
  445. 6: 'اسج',
  446. 7: 'اسق',
  447. };
  448. const weekdayAbbr2$2 = {
  449. 1: 'جل',
  450. 2: 'جم',
  451. 3: 'كم',
  452. 4: 'فض',
  453. 5: 'عد',
  454. 6: 'اج',
  455. 7: 'اق',
  456. };
  457. const weekdayL$4 = {
  458. 1: 'جلال',
  459. 2: 'جمال',
  460. 3: 'كمال',
  461. 4: 'فضّال',
  462. 5: 'عدّال',
  463. 6: 'استجلال',
  464. 7: 'استقلال',
  465. };
  466. const yearInVahid$2 = {
  467. 1: 'ألف',
  468. 2: 'باء',
  469. 3: 'أب',
  470. 4: 'دﺍﻝ',
  471. 5: 'باب',
  472. 6: 'وﺍو',
  473. 7: 'أبد',
  474. 8: 'جاد',
  475. 9: 'بهاء',
  476. 10: 'حب',
  477. 11: 'بهاج',
  478. 12: 'جواب',
  479. 13: 'احد',
  480. 14: 'وﻫﺎب',
  481. 15: 'وداد',
  482. 16: 'بدیع',
  483. 17: 'بهي',
  484. 18: 'ابهى',
  485. 19: 'واحد',
  486. };
  487. const vahid$2 = 'واحد';
  488. const kulliShay$2 = 'كل شيء';
  489. const BE$4 = 'بديع';
  490. const badiCalendar$4 = 'تقويم بديع';
  491. const unicodeCharForZero$2 = '۰';
  492. const defaultFormat$2 = '‏d MML y BE‏';
  493. var fa = /*#__PURE__*/Object.freeze({
  494. __proto__: null,
  495. month: month$2,
  496. monthL: monthL$4,
  497. holyDay: holyDay$4,
  498. weekday: weekday$2,
  499. weekdayAbbr3: weekdayAbbr3$2,
  500. weekdayAbbr2: weekdayAbbr2$2,
  501. weekdayL: weekdayL$4,
  502. yearInVahid: yearInVahid$2,
  503. vahid: vahid$2,
  504. kulliShay: kulliShay$2,
  505. BE: BE$4,
  506. badiCalendar: badiCalendar$4,
  507. unicodeCharForZero: unicodeCharForZero$2,
  508. defaultFormat: defaultFormat$2
  509. });
  510. const monthL$5 = {
  511. 1: 'Splendeur',
  512. 2: 'Gloire',
  513. 3: 'Beauté',
  514. 4: 'Grandeur',
  515. 5: 'Lumière',
  516. 6: 'Miséricorde',
  517. 7: 'Paroles',
  518. 8: 'Perfection',
  519. 9: 'Noms',
  520. 10: 'Puissance',
  521. 11: 'Volonté',
  522. 12: 'Connaissance',
  523. 13: 'Pouvoir',
  524. 14: 'Discours',
  525. 15: 'Questions',
  526. 16: 'Honneur',
  527. 17: 'Souveraineté',
  528. 18: 'Empire',
  529. 19: 'Élévation',
  530. 20: 'Ayyám-i-Há',
  531. };
  532. const holyDay$5 = {
  533. 1: 'Naw-Rúz',
  534. 2: 'Premier jour de Riḍván',
  535. 3: 'Neuvième jour de Riḍván',
  536. 4: 'Douzième jour de Riḍván',
  537. 5: 'Déclaration du Báb',
  538. 6: 'Ascension de Bahá’u’lláh',
  539. 7: 'Martyre du Báb',
  540. 8: 'Naissance du Báb',
  541. 9: 'Naissance de Bahá’u’lláh',
  542. 10: 'Jour de l’Alliance',
  543. 11: 'Ascension de ‘Abdu’l-Bahá',
  544. };
  545. const weekdayL$5 = {
  546. 1: 'Gloire',
  547. 2: 'Beauté',
  548. 3: 'Perfection',
  549. 4: 'Grâce',
  550. 5: 'Justice',
  551. 6: 'Majesté',
  552. 7: 'Indépendance',
  553. };
  554. const BE$5 = 'E.B.';
  555. const badiCalendar$5 = 'Calendrier Badí‘';
  556. var fr = /*#__PURE__*/Object.freeze({
  557. __proto__: null,
  558. monthL: monthL$5,
  559. holyDay: holyDay$5,
  560. weekdayL: weekdayL$5,
  561. BE: BE$5,
  562. badiCalendar: badiCalendar$5
  563. });
  564. const monthL$6 = {
  565. 1: 'Spožums',
  566. 2: 'Slava',
  567. 3: 'Skaistums',
  568. 4: 'Dižums',
  569. 5: 'Gaisma',
  570. 6: 'Žēlastība',
  571. 7: 'Vārdi',
  572. 8: 'Pilnība',
  573. 9: 'Nosaukumi',
  574. 10: 'Varenība',
  575. 11: 'Griba',
  576. 12: 'Zināšanas',
  577. 13: 'Vara',
  578. 14: 'Runa',
  579. 15: 'Jautājumi',
  580. 16: 'Gods',
  581. 17: 'Suverenitāte',
  582. 18: 'Valdīšana',
  583. 19: 'Cēlums',
  584. 20: 'Ayyám-i-Há',
  585. };
  586. const holyDay$6 = {
  587. 1: 'Naw-Rúz',
  588. 2: 'Riḍván pirmā diena',
  589. 3: 'Riḍván devītā diena',
  590. 4: 'Riḍván divpadsmitā diena',
  591. 5: 'Bába paziņojums',
  592. 6: 'Bahá’u’lláh Debessbraukšana',
  593. 7: 'Bába mocekļa nāve',
  594. 8: 'Bába dzimšanas diena',
  595. 9: 'Bahá’u’lláh dzimšanas diena',
  596. 10: 'Derības diena',
  597. 11: '‘Abdu’l-Bahá Debessbraukšana',
  598. };
  599. const weekdayL$6 = {
  600. 1: 'Slava',
  601. 2: 'Skaistums',
  602. 3: 'Pilnība',
  603. 4: 'Žēlastība',
  604. 5: 'Taisnīgums',
  605. 6: 'Majestātiskums',
  606. 7: 'Neatkarība',
  607. };
  608. const BE$6 = 'B.Ē.';
  609. const badiCalendar$6 = 'Badí‘ kalendārs';
  610. var lv = /*#__PURE__*/Object.freeze({
  611. __proto__: null,
  612. monthL: monthL$6,
  613. holyDay: holyDay$6,
  614. weekdayL: weekdayL$6,
  615. BE: BE$6,
  616. badiCalendar: badiCalendar$6
  617. });
  618. const monthL$7 = {
  619. 1: 'Pracht',
  620. 2: 'Heerlijkheid',
  621. 3: 'Schoonheid',
  622. 4: 'Grootheid',
  623. 5: 'Licht',
  624. 6: 'Barmhartigheid',
  625. 7: 'Woorden',
  626. 8: 'Volmaaktheid',
  627. 9: 'Namen',
  628. 10: 'Macht',
  629. 11: 'Wil',
  630. 12: 'Kennis',
  631. 13: 'Kracht',
  632. 14: 'Spraak',
  633. 15: 'Vragen',
  634. 16: 'Eer',
  635. 17: 'Soevereiniteit',
  636. 18: 'Heerschappij',
  637. 19: 'Verhevenheid',
  638. 20: 'Ayyám-i-Há',
  639. };
  640. const holyDay$7 = {
  641. 1: 'Naw-Rúz',
  642. 2: 'Eerste dag van Riḍván',
  643. 3: 'Negende dag van Riḍván',
  644. 4: 'Twaalfde dag van Riḍván',
  645. 5: 'Verkondiging van de Báb',
  646. 6: 'Heengaan van Bahá’u’lláh',
  647. 7: 'Marteldood van de Báb',
  648. 8: 'Geboortedag van de Báb',
  649. 9: 'Geboortedag van Bahá’u’lláh',
  650. 10: 'Dag van het Verbond',
  651. 11: 'Heengaan van ‘Abdu’l-Bahá',
  652. };
  653. const weekdayL$7 = {
  654. 1: 'Heerlijkheid',
  655. 2: 'Schoonheid',
  656. 3: 'Volmaaktheid',
  657. 4: 'Genade',
  658. 5: 'Gerechtigheid',
  659. 6: 'Majesteit',
  660. 7: 'Onafhankelijkheid',
  661. };
  662. const BE$7 = 'B.E.';
  663. const badiCalendar$7 = 'Badí‘-Kalender';
  664. var nl = /*#__PURE__*/Object.freeze({
  665. __proto__: null,
  666. monthL: monthL$7,
  667. holyDay: holyDay$7,
  668. weekdayL: weekdayL$7,
  669. BE: BE$7,
  670. badiCalendar: badiCalendar$7
  671. });
  672. const monthL$8 = {
  673. 1: 'Esplendor',
  674. 2: 'Glória',
  675. 3: 'Beleza',
  676. 4: 'Grandeza',
  677. 5: 'Luz',
  678. 6: 'Miséricórdia',
  679. 7: 'Palavras',
  680. 8: 'Perfeição',
  681. 9: 'Nomes',
  682. 10: 'Potência',
  683. 11: 'Vontade',
  684. 12: 'Conhecimento',
  685. 13: 'Poder',
  686. 14: 'Discurso',
  687. 15: 'Perguntas',
  688. 16: 'Honra',
  689. 17: 'Soberania',
  690. 18: 'Domínio',
  691. 19: 'Sublimidade',
  692. 20: 'Ayyám-i-Há',
  693. };
  694. const holyDay$8 = {
  695. 1: 'Naw-Rúz',
  696. 2: '1º dia do Riḍván',
  697. 3: '9º dia do Riḍván',
  698. 4: '12º dia do Riḍván',
  699. 5: 'Declaração do Báb',
  700. 6: 'Ascensão de Bahá’u’lláh',
  701. 7: 'Martírio do Báb',
  702. 8: 'Aniversário do Báb',
  703. 9: 'Aniversário de Bahá’u’lláh',
  704. 10: 'Dia do Convênio',
  705. 11: 'Ascensão de ‘Abdu’l-Bahá',
  706. };
  707. const weekdayL$8 = {
  708. 1: 'Glória',
  709. 2: 'Beleza',
  710. 3: 'Perfeição',
  711. 4: 'Graça',
  712. 5: 'Justiça',
  713. 6: 'Majestade',
  714. 7: 'Independência',
  715. };
  716. const BE$8 = 'E.B.';
  717. const badiCalendar$8 = 'Calendário Badí‘';
  718. var pt = /*#__PURE__*/Object.freeze({
  719. __proto__: null,
  720. monthL: monthL$8,
  721. holyDay: holyDay$8,
  722. weekdayL: weekdayL$8,
  723. BE: BE$8,
  724. badiCalendar: badiCalendar$8
  725. });
  726. const month$3 = {
  727. 1: 'Бахā',
  728. 2: 'Джалāл',
  729. 3: 'Джамāл',
  730. 4: '‘Аз̣амат',
  731. 5: 'Нӯр',
  732. 6: 'Рах̣мат',
  733. 7: 'Калимāт',
  734. 8: 'Камāл',
  735. 9: 'Асмā’',
  736. 10: '‘Иззат',
  737. 11: 'Машӣййат',
  738. 12: '‘Илм',
  739. 13: 'К̣удрат',
  740. 14: 'К̣аул',
  741. 15: 'Масā’ил',
  742. 16: 'Шараф',
  743. 17: 'Султ̣ан',
  744. 18: 'Мулк',
  745. 19: '‘Алā’',
  746. 20: 'Аййāм-и Хā',
  747. };
  748. const monthL$9 = {
  749. 1: 'Великолепие',
  750. 2: 'Слава',
  751. 3: 'Красота',
  752. 4: 'Величие',
  753. 5: 'Свет',
  754. 6: 'Милость',
  755. 7: 'Слова',
  756. 8: 'Совершенство',
  757. 9: 'Имена',
  758. 10: 'Мощь',
  759. 11: 'Воля',
  760. 12: 'Знание',
  761. 13: 'Могущество',
  762. 14: 'Речь',
  763. 15: 'Вопросы',
  764. 16: 'Честь',
  765. 17: 'Владычество',
  766. 18: 'Господство',
  767. 19: 'Возвышенность',
  768. 20: 'Аййāм-и Хā',
  769. };
  770. const holyDay$9 = {
  771. 1: 'Нау-Рӯз',
  772. 2: '1-й день Рид̣вāна',
  773. 3: '9-й день Рид̣вāна',
  774. 4: '12-й день Рид̣вāна',
  775. 5: 'Возвещение Баба',
  776. 6: 'Вознесение Бахауллы',
  777. 7: 'Мученическая Баба',
  778. 8: 'рождения Баба',
  779. 9: 'рождения Бахауллы',
  780. 10: 'День Завета',
  781. 11: 'Вознесение Абдул-Баха',
  782. };
  783. const weekday$3 = {
  784. 1: 'Джалāл',
  785. 2: 'Джамāл',
  786. 3: 'Камāл',
  787. 4: 'Фид̣āл',
  788. 5: '‘Идāл',
  789. 6: 'Истиджлāл',
  790. 7: 'Истик̣лāл',
  791. };
  792. const weekdayAbbr3$3 = {
  793. 1: 'Джл',
  794. 2: 'Джм',
  795. 3: 'Кам',
  796. 4: 'Фид̣',
  797. 5: '‘Идā',
  798. 6: 'Исд',
  799. 7: 'Иск̣',
  800. };
  801. const weekdayAbbr2$3 = {
  802. 1: 'Дл',
  803. 2: 'Дм',
  804. 3: 'Ка',
  805. 4: 'Фи',
  806. 5: '‘Ид',
  807. 6: 'Ид',
  808. 7: 'Ик̣',
  809. };
  810. const weekdayL$9 = {
  811. 1: 'Слава',
  812. 2: 'Красота',
  813. 3: 'Совершенство',
  814. 4: 'Благодать',
  815. 5: 'Справедливость',
  816. 6: 'Величие',
  817. 7: 'Независимость',
  818. };
  819. const yearInVahid$3 = {
  820. 1: 'Алиф',
  821. 2: 'Бā’',
  822. 3: 'Аб',
  823. 4: 'Дāл',
  824. 5: 'Бāб',
  825. 6: 'Вāв',
  826. 7: 'Абад',
  827. 8: 'Джāд',
  828. 9: 'Бахā',
  829. 10: 'Х̣убб',
  830. 11: 'Баххāдж',
  831. 12: 'Джавāб',
  832. 13: 'Ах̣ад',
  833. 14: 'Ваххāб',
  834. 15: 'Видāд',
  835. 16: 'Бадӣ‘',
  836. 17: 'Бахӣ',
  837. 18: 'Абхā',
  838. 19: 'Вāх̣ид',
  839. };
  840. const vahid$3 = 'Вāх̣ид';
  841. const kulliShay$3 = 'кулл-и шай’';
  842. const BE$9 = 'Э.Б.';
  843. const badiCalendar$9 = 'Календарь Бадӣ‘';
  844. var ru = /*#__PURE__*/Object.freeze({
  845. __proto__: null,
  846. month: month$3,
  847. monthL: monthL$9,
  848. holyDay: holyDay$9,
  849. weekday: weekday$3,
  850. weekdayAbbr3: weekdayAbbr3$3,
  851. weekdayAbbr2: weekdayAbbr2$3,
  852. weekdayL: weekdayL$9,
  853. yearInVahid: yearInVahid$3,
  854. vahid: vahid$3,
  855. kulliShay: kulliShay$3,
  856. BE: BE$9,
  857. badiCalendar: badiCalendar$9
  858. });
  859. const monthL$a = {
  860. 1: 'Praktfullhet',
  861. 2: 'Härlighet',
  862. 3: 'Skönhet',
  863. 4: 'Storhet',
  864. 5: 'Ljus',
  865. 6: 'Barmhärtighet',
  866. 7: 'Ord',
  867. 8: 'Fullkomlighet',
  868. 9: 'Namn',
  869. 10: 'Makt',
  870. 11: 'Vilja',
  871. 12: 'Kunskap',
  872. 13: 'Kraft',
  873. 14: 'Tal',
  874. 15: 'Frågor',
  875. 16: 'Ära',
  876. 17: 'Överhöghet',
  877. 18: 'Herravälde',
  878. 19: 'Upphöjdhet',
  879. 20: 'Ayyám-i-Há',
  880. };
  881. const holyDay$a = {
  882. 1: 'Naw-Rúz',
  883. 2: 'Första Riḍván',
  884. 3: 'Nionde Riḍván',
  885. 4: 'Tolfte Riḍván',
  886. 5: 'Bábs Deklaration',
  887. 6: 'Bahá’u’lláhs Bortgång',
  888. 7: 'Bábs Martyrskap',
  889. 8: 'Bábs Födelse',
  890. 9: 'Bahá’u’lláhs Födelse',
  891. 10: 'Förbundets dag',
  892. 11: '‘Abdu’l-Bahás Bortgång',
  893. };
  894. const weekdayL$a = {
  895. 1: 'Härlighet',
  896. 2: 'Skönhet',
  897. 3: 'Fullkomlighet',
  898. 4: 'Nåd',
  899. 5: 'Rättvisa',
  900. 6: 'Majestät',
  901. 7: 'Oberoende',
  902. };
  903. const BE$a = 'B.E.';
  904. const badiCalendar$a = 'Badí‘kalendern';
  905. var sv = /*#__PURE__*/Object.freeze({
  906. __proto__: null,
  907. monthL: monthL$a,
  908. holyDay: holyDay$a,
  909. weekdayL: weekdayL$a,
  910. BE: BE$a,
  911. badiCalendar: badiCalendar$a
  912. });
  913. const month$4 = {
  914. 1: '巴哈',
  915. 2: '贾拉勒',
  916. 3: '贾迈勒',
  917. 4: '阿泽迈特',
  918. 5: '努尔',
  919. 6: '拉赫迈特',
  920. 7: '凯利马特',
  921. 8: '卡迈勒',
  922. 9: '艾斯玛',
  923. 10: '伊扎特',
  924. 11: '迈希耶特',
  925. 12: '伊勒姆',
  926. 13: '古德雷特',
  927. 14: '高勒',
  928. 15: '迈萨伊勒',
  929. 16: '谢拉夫',
  930. 17: '苏丹',
  931. 18: '穆勒克',
  932. 19: '阿拉',
  933. 20: '阿亚米哈',
  934. };
  935. const monthL$b = {
  936. 1: '耀',
  937. 2: '辉',
  938. 3: '美',
  939. 4: '宏',
  940. 5: '光',
  941. 6: '仁',
  942. 7: '言',
  943. 8: '完',
  944. 9: '名',
  945. 10: '能',
  946. 11: '意',
  947. 12: '知',
  948. 13: '力',
  949. 14: '语',
  950. 15: '问',
  951. 16: '尊',
  952. 17: '权',
  953. 18: '统',
  954. 19: '崇',
  955. 20: '哈之日',
  956. };
  957. const holyDay$b = {
  958. 1: '诺鲁孜节',
  959. 2: '里兹万节第一日',
  960. 3: '里兹万节第九日',
  961. 4: '里兹万节第十二日',
  962. 5: '巴孛宣示日',
  963. 6: '巴哈欧拉升天日',
  964. 7: '巴孛殉道日',
  965. 8: '巴孛诞辰',
  966. 9: '巴哈欧拉诞辰',
  967. 10: '圣约日',
  968. 11: '阿博都-巴哈升天日',
  969. };
  970. const weekday$4 = {
  971. 1: '贾拉勒',
  972. 2: '贾迈勒',
  973. 3: '卡迈勒',
  974. 4: '菲达勒',
  975. 5: '伊达勒',
  976. 6: '伊斯提杰拉勒',
  977. 7: '伊斯提格拉勒',
  978. };
  979. const weekdayAbbr3$4 = {
  980. 1: '贾拉勒',
  981. 2: '贾迈勒',
  982. 3: '卡迈勒',
  983. 4: '菲达勒',
  984. 5: '伊达勒',
  985. 6: '伊斯杰',
  986. 7: '伊斯格',
  987. };
  988. const weekdayAbbr2$4 = {
  989. 1: '贾拉',
  990. 2: '贾迈',
  991. 3: '卡迈',
  992. 4: '菲达',
  993. 5: '伊达',
  994. 6: '伊杰',
  995. 7: '伊格',
  996. };
  997. const weekdayL$b = {
  998. 1: '辉日',
  999. 2: '美日',
  1000. 3: '完日',
  1001. 4: '恩日',
  1002. 5: '正日',
  1003. 6: '威日',
  1004. 7: '独日',
  1005. };
  1006. const yearInVahid$4 = {
  1007. 1: '艾利夫',
  1008. 2: '巴',
  1009. 3: '艾卜',
  1010. 4: '达勒',
  1011. 5: '巴卜',
  1012. 6: '瓦乌',
  1013. 7: '阿巴德',
  1014. 8: '贾德',
  1015. 9: '巴哈',
  1016. 10: '胡卜',
  1017. 11: '巴哈杰',
  1018. 12: '贾瓦卜',
  1019. 13: '阿哈德',
  1020. 14: '瓦哈卜',
  1021. 15: '维达德',
  1022. 16: '巴迪',
  1023. 17: '巴希',
  1024. 18: '阿卜哈',
  1025. 19: '瓦希德',
  1026. };
  1027. const vahid$4 = '瓦希德';
  1028. const kulliShay$4 = '库里沙伊';
  1029. const BE$b = 'BE';
  1030. const badiCalendar$b = '巴迪历';
  1031. var zh = /*#__PURE__*/Object.freeze({
  1032. __proto__: null,
  1033. month: month$4,
  1034. monthL: monthL$b,
  1035. holyDay: holyDay$b,
  1036. weekday: weekday$4,
  1037. weekdayAbbr3: weekdayAbbr3$4,
  1038. weekdayAbbr2: weekdayAbbr2$4,
  1039. weekdayL: weekdayL$b,
  1040. yearInVahid: yearInVahid$4,
  1041. vahid: vahid$4,
  1042. kulliShay: kulliShay$4,
  1043. BE: BE$b,
  1044. badiCalendar: badiCalendar$b
  1045. });
  1046. const monthL$c = {
  1047. 1: 'Splendor',
  1048. 16: 'Honor',
  1049. };
  1050. var en_us = /*#__PURE__*/Object.freeze({
  1051. __proto__: null,
  1052. monthL: monthL$c
  1053. });
  1054. /* eslint-disable dot-notation, line-comment-position, camelcase, sort-imports */
  1055. const badiLocale = { en, ar, de, es, fa, fr, lv, nl, pt, ru, sv, zh, 'en-us': en_us, default: en };
  1056. const setDefaultLanguage = (language) => {
  1057. if (badiLocale[language] === undefined) {
  1058. // eslint-disable-next-line no-console
  1059. console.log('Chosen language does not exist. Setting has not been changed.');
  1060. }
  1061. else {
  1062. badiLocale['default'] = badiLocale[language];
  1063. }
  1064. };
  1065. let underlineFormat = 'css';
  1066. const setUnderlineFormat = (format) => {
  1067. if (['css', 'u', 'diacritic', 'none'].includes(format)) {
  1068. underlineFormat = format;
  1069. }
  1070. else {
  1071. // eslint-disable-next-line no-console
  1072. console.log('Invalid underline format. Choose one of ["css", "u", "diacritic", "none"]. ' +
  1073. 'Setting has not been changed.');
  1074. }
  1075. };
  1076. const formatTokens = [
  1077. ['DDL', 'DD+', 'MML', 'MM+', 'WWL', 'yyv', 'KiS'],
  1078. ['dd', 'DD', 'mm', 'MM', 'ww', 'WW', 'yv', 'YV', 'vv', 'kk', 'yy', 'BE', 'BC', 'Va'],
  1079. ['d', 'D', 'm', 'M', 'W', 'v', 'k', 'y']
  1080. ];
  1081. // eslint-disable-next-line complexity
  1082. const formatBadiDate = (badiDate, formatString, language) => {
  1083. if (!badiDate.isValid) {
  1084. return 'Not a valid Badí‘ date';
  1085. }
  1086. if (typeof language === 'string' && badiLocale[language] === undefined && language.includes('-')) {
  1087. language = language.split('-')[0];
  1088. }
  1089. if (language === undefined || badiLocale[language] === undefined) {
  1090. language = 'default';
  1091. }
  1092. formatString = formatString !== null && formatString !== void 0 ? formatString : formatItemFallback(language, 'defaultFormat');
  1093. let formattedDate = '';
  1094. const length = formatString.length;
  1095. for (let i = 0; i < length; i++) {
  1096. // Text wrapped in {} is output as-is. A '{' without a matching '}'
  1097. // results in invalid input
  1098. if (formatString[i] === '{' && i < length - 1) {
  1099. for (let j = i + 1; j <= length; j++) {
  1100. if (j === length) {
  1101. return 'Invalid formatting string.';
  1102. }
  1103. if (formatString[j] === '}') {
  1104. i = j;
  1105. break;
  1106. }
  1107. formattedDate += formatString[j];
  1108. }
  1109. }
  1110. else {
  1111. const next1 = formatString[i];
  1112. const next2 = next1 + formatString[i + 1];
  1113. const next3 = next2 + formatString[i + 2];
  1114. if (formatTokens[0].includes(next3)) {
  1115. formattedDate += getFormatItem(badiDate, next3, language);
  1116. i += 2;
  1117. }
  1118. else if (formatTokens[1].includes(next2)) {
  1119. formattedDate += getFormatItem(badiDate, next2, language);
  1120. i += 1;
  1121. }
  1122. else if (formatTokens[2].includes(next1)) {
  1123. formattedDate += getFormatItem(badiDate, next1, language);
  1124. }
  1125. else {
  1126. formattedDate += next1;
  1127. }
  1128. }
  1129. }
  1130. return formattedDate;
  1131. };
  1132. // eslint-disable-next-line complexity
  1133. const getFormatItem = (badiDate, token, language) => {
  1134. switch (token) {
  1135. // Single character tokens
  1136. case 'd':
  1137. return digitRewrite(badiDate.day, language);
  1138. case 'D':
  1139. return postProcessLocaleItem(formatItemFallback(language, 'month', badiDate.day), 3);
  1140. case 'm':
  1141. return digitRewrite(badiDate.month, language);
  1142. case 'M':
  1143. return postProcessLocaleItem(formatItemFallback(language, 'month', badiDate.month), 3);
  1144. case 'W':
  1145. return formatItemFallback(language, 'weekdayAbbr3', (badiDate.gregorianDate.weekday + 1) % 7 + 1);
  1146. case 'y':
  1147. return digitRewrite(badiDate.year, language);
  1148. case 'v':
  1149. return digitRewrite((Math.floor((badiDate.year - 1) / 19) % 19) + 1, language);
  1150. case 'k':
  1151. return digitRewrite(Math.floor((badiDate.year - 1) / 361) + 1, language);
  1152. // Two character tokens
  1153. case 'dd':
  1154. return digitRewrite((`0${String(badiDate.day)}`).slice(-2), language);
  1155. case 'DD':
  1156. return postProcessLocaleItem(formatItemFallback(language, 'month', badiDate.day));
  1157. case 'mm':
  1158. return digitRewrite((`0${String(badiDate.month)}`).slice(-2), language);
  1159. case 'MM':
  1160. return postProcessLocaleItem(formatItemFallback(language, 'month', badiDate.month));
  1161. case 'ww':
  1162. return formatItemFallback(language, 'weekdayAbbr2', (badiDate.gregorianDate.weekday + 1) % 7 + 1);
  1163. case 'WW':
  1164. return formatItemFallback(language, 'weekday', (badiDate.gregorianDate.weekday + 1) % 7 + 1);
  1165. case 'yy':
  1166. return digitRewrite((`00${String(badiDate.year)}`).slice(-3), language);
  1167. case 'yv':
  1168. return digitRewrite((badiDate.year - 1) % 19 + 1, language);
  1169. case 'YV':
  1170. return formatItemFallback(language, 'yearInVahid', (badiDate.year - 1) % 19 + 1);
  1171. case 'vv':
  1172. return digitRewrite((`0${String((Math.floor((badiDate.year - 1) / 19) + 2) % 19 - 1)}`).slice(-2), language);
  1173. case 'kk':
  1174. return digitRewrite((`0${String(Math.floor((badiDate.year - 1) / 361) + 1)}`).slice(-2), language);
  1175. case 'Va':
  1176. return formatItemFallback(language, 'vahid');
  1177. case 'BE':
  1178. return formatItemFallback(language, 'BE');
  1179. case 'BC':
  1180. return formatItemFallback(language, 'badiCalendar');
  1181. // Three character tokens
  1182. case 'DDL':
  1183. return formatItemFallback(language, 'monthL', badiDate.day);
  1184. case 'DD+': {
  1185. const day = postProcessLocaleItem(formatItemFallback(language, 'month', badiDate.day));
  1186. const dayL = formatItemFallback(language, 'monthL', badiDate.day);
  1187. if (day === dayL) {
  1188. return day;
  1189. }
  1190. if (badiLocale[language] === badiLocale.fa) {
  1191. return `<span dir="rtl">${day} (${dayL})</span>`;
  1192. }
  1193. return `${day} (${dayL})`;
  1194. }
  1195. case 'MML':
  1196. return formatItemFallback(language, 'monthL', badiDate.month);
  1197. case 'MM+': {
  1198. const month = postProcessLocaleItem(formatItemFallback(language, 'month', badiDate.month));
  1199. const monthL = formatItemFallback(language, 'monthL', badiDate.month);
  1200. if (month === monthL) {
  1201. return month;
  1202. }
  1203. if (badiLocale[language] === badiLocale.fa) {
  1204. return `<span dir="rtl">${month} (${monthL})</span>`;
  1205. }
  1206. return `${month} (${monthL})`;
  1207. }
  1208. case 'WWL':
  1209. return formatItemFallback(language, 'weekdayL', (badiDate.gregorianDate.weekday + 1) % 7 + 1);
  1210. case 'yyv':
  1211. return digitRewrite((`0${String((badiDate.year - 1) % 19 + 1)}`).slice(-2), language);
  1212. case 'KiS':
  1213. return postProcessLocaleItem(formatItemFallback(language, 'kulliShay'));
  1214. // istanbul ignore next
  1215. default:
  1216. return '';
  1217. }
  1218. };
  1219. const postProcessLocaleItem = (item, crop) => {
  1220. if (crop && crop < item.length) {
  1221. let char = 0;
  1222. let counter = 0;
  1223. while (counter < crop) {
  1224. if (!'_’‘'.includes(item[char])) {
  1225. counter++;
  1226. }
  1227. char++;
  1228. }
  1229. if ('_’‘'.includes(item[char])) {
  1230. char++;
  1231. }
  1232. item = item.slice(0, char);
  1233. if (item.split('_').length % 2 === 0) {
  1234. item += '_';
  1235. }
  1236. }
  1237. const stringComponents = item.split('_');
  1238. for (let i = 1; i < stringComponents.length; i += 2) {
  1239. stringComponents[i] = underlineString(stringComponents[i]);
  1240. }
  1241. return stringComponents.join('');
  1242. };
  1243. const underlineString = (str) => {
  1244. switch (underlineFormat) {
  1245. case 'css':
  1246. return `<span style="text-decoration:underline">${str}</span>`;
  1247. case 'diacritic':
  1248. return str.split('').map(char => `${char}\u0332`).join('');
  1249. case 'u':
  1250. return `<u>${str}</u>`;
  1251. case 'none':
  1252. return str;
  1253. // istanbul ignore next
  1254. default:
  1255. throw new TypeError('Unexpected underlineFormat');
  1256. }
  1257. };
  1258. const digitRewrite = (number, language) => {
  1259. number = String(number);
  1260. const unicodeOffset = formatItemFallback(language, 'unicodeCharForZero').charCodeAt(0) - '0'.charCodeAt(0);
  1261. if (unicodeOffset === 0) {
  1262. return number;
  1263. }
  1264. const codePoints = [...number].map(num => num.charCodeAt(0) + unicodeOffset);
  1265. return String.fromCharCode(...codePoints);
  1266. };
  1267. const formatItemFallback = (language, category, index) => {
  1268. var _a;
  1269. if (index === undefined) {
  1270. while (badiLocale[language][category] === undefined) {
  1271. language = languageFallback(language);
  1272. }
  1273. return badiLocale[language][category];
  1274. }
  1275. while (((_a = badiLocale[language][category]) === null || _a === void 0 ? void 0 : _a[index]) === undefined) {
  1276. language = languageFallback(language);
  1277. }
  1278. return badiLocale[language][category][index];
  1279. };
  1280. const languageFallback = (languageCode) => {
  1281. if (languageCode.includes('-')) {
  1282. return languageCode.split('-')[0];
  1283. // eslint-disable-next-line no-negated-condition
  1284. }
  1285. else if (languageCode !== 'default') {
  1286. return 'default';
  1287. }
  1288. return 'en';
  1289. };
  1290. const badiYears = [
  1291. 'l4da', 'k4ci', 'k5c7', 'l4d6', 'l4ce', 'k4c4', 'k5d4', 'l4cb', 'l4c1', 'k4cj', 'k5c8', 'l4d7', 'l4cf', 'k4c5',
  1292. 'k4d5', 'k5ce', 'l4c2', 'k4d2', 'k4ca', 'k5da', 'l4ch', 'k4c6', 'k4d6', 'k5cf', 'l4c4', 'k4d4', 'k4cc', 'k5c1',
  1293. 'l4cj', 'k4c8', 'k4d8', 'k5cg', 'l4c5', 'k4d5', 'k4ce', 'k5c3', 'l4d2', 'k4ca', 'k4d9', 'k5ci', 'l4c6', 'k4d6',
  1294. 'k4cf', 'k4c4', 'k5d4', 'k4cb', 'k4bj', 'k4cj', 'k5c9', 'k4d8', 'k4cg', 'k4c6', 'k5d6', 'k4cd', 'k4c2', 'k4d2',
  1295. 'k5ca', 'k4d9', 'k4ci', 'k4c7', 'k5d7', 'k4cf', 'k4c4', 'k4d4', 'k5cc', 'k4bj', 'k4cj', 'k4c9', 'k5d9', 'k4cg',
  1296. 'k4c6', 'k4d5', 'k5cd', 'k4c2', 'k4d1', 'k4ca', 'k4da', 'j5cj', 'k4c7', 'k4d7', 'k4cf', 'j5c4', 'k4d3', 'k4cb',
  1297. 'k4c1', 'k5d1', 'l4c9', 'l4d9', 'l4ch', 'k5c6', 'l4d5', 'l4cd', 'l4c2', 'k5d2', 'l4ca', 'l4da', 'l4cj', 'k5c8',
  1298. 'l4d7', 'l4cf', 'l4c4', 'k5d4', 'l4cb', 'l4c1', 'l4d1', 'k5c9', 'l4d8', 'l4cg', 'l4c5', 'k4d5', 'k5ce', 'l4c2',
  1299. 'l4d2', 'k4cb', 'k5db', 'l4ci', 'l4c7', 'k4d7', 'k5cf', 'l4c4', 'l4d4', 'k4cc', 'k5c2', 'l4d1', 'l4c9', 'k4d9',
  1300. 'k5ch', 'l4c5', 'l4d5', 'k4ce', 'k5c3', 'l4d2', 'l4cb', 'k4da', 'k5ci', 'l4c6', 'l4d6', 'k4cf', 'k5c5', 'l4d4',
  1301. 'l4cc', 'k4c1', 'k4d1', 'k5c9', 'l4d8', 'k4cg', 'k4c6', 'k5d6', 'l4ce', 'k4c3', 'k4d3', 'k5cb', 'l4da', 'k4ci',
  1302. 'k4c7', 'k5d7', 'l4cf', 'k4c5', 'k4d5', 'k5cd', 'l4c1', 'k4cj', 'k4c9', 'k5d9', 'l4cg', 'k4c6', 'k4d6', 'k5ce',
  1303. 'l4c3', 'k4d2', 'k4ca', 'k5bj', 'l4ci', 'k4c7', 'k4d7', 'k4cg', 'k5c5', 'k4d4', 'k4cc', 'k4c1', 'k5d1', 'k4c9',
  1304. 'k4d9', 'k4ch', 'k5c7', 'l4d6', 'l4ce', 'l4c3', 'l5d3', 'l4ca', 'l4da', 'l4cj', 'l5c8', 'l4d7', 'l4cg', 'l4c5',
  1305. 'l5d4', 'l4cb', 'l4c1', 'l4d1', 'l5ca', 'l4d9', 'l4ch', 'l4c6', 'l5d6', 'l4cd', 'l4c2', 'l4d2', 'l4cb', 'k5c1',
  1306. 'l4cj', 'l4c8', 'l4d8', 'k5cg', 'l4c4', 'l4d4', 'l4cc', 'k5c2', 'l4d1', 'l4ca', 'l4da', 'k5ci', 'l4c6', 'l4d5',
  1307. 'l4ce', 'k5c3', 'l4d2', 'l4cb', 'l4db', 'k5cj', 'l4c8', 'l4d7', 'l4cf', 'k5c5', 'l4d4', 'l4cc', 'l4c2', 'k5d2',
  1308. 'l4c9', 'l4d9', 'l4ch', 'k4c6', 'k5d6', 'l4ce', 'l4c3', 'k4d3', 'k5cc', 'l4db', 'l4cj', 'k4c8', 'k5d8', 'l4cf',
  1309. 'l4c4', 'k4d5', 'k5cd', 'l4c2', 'l4d2', 'k4ca', 'k5d9', 'l4cg', 'l4c6', 'k4d6', 'k5cf', 'l4c3', 'l4d3', 'k4cb',
  1310. 'k5bj', 'l4ci', 'l4c7', 'k4d7', 'k5cg', 'l4c5', 'l4d5', 'k4cd', 'k4c2', 'k5d2', 'l4c9', 'k4d9', 'k4ch', 'k5c7',
  1311. 'l4d6', 'k4cf', 'k4c4', 'k5d4', 'l4cb', 'l4bj', 'l4cj', 'l5c8', 'm4d7', 'l4cg', 'l4c5', 'l5d5', 'm4cc', 'l4c1',
  1312. 'l4d1', 'l5ca', 'm4d9', 'l4ch', 'l4c7', 'l5d7', 'm4ce', 'l4c3', 'l4d3', 'l5cb', 'm4bi', 'l4ci', 'l4c8', 'l4d8',
  1313. 'l5ch', 'l4c5', 'l4d5', 'l4cd', 'l5c2', 'l4d1', 'l4c9', 'l4da', 'l5ci', 'l4c7', 'l4d7', 'l4cf', 'l5c4', 'l4d2',
  1314. 'l4cb', 'l4bj', 'l5d1', 'l4c8', 'l4d8', 'l4cg', 'l5c5', 'l4d4', 'l4cc', 'l4c2', 'l5d2', 'l4c9', 'l4da', 'l4ci',
  1315. ];
  1316. class BadiDate {
  1317. constructor(date) {
  1318. this._holyDay = undefined;
  1319. this._valid = true;
  1320. this._invalidReason = undefined;
  1321. try {
  1322. if (this._isDateObject(date)) {
  1323. this._gregorianDate = luxon.DateTime.fromObject({ year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate(), zone: 'UTC' });
  1324. }
  1325. else if (luxon.DateTime.isDateTime(date)) {
  1326. this._gregorianDate = luxon.DateTime.fromObject({ year: date.year, month: date.month, day: date.day, zone: 'UTC' });
  1327. }
  1328. else if (this._isYearMonthDay(date) || this._isYearHolyDayNumber(date)) {
  1329. this._setFromBadiDate(date);
  1330. }
  1331. else {
  1332. throw new TypeError('Unrecognized input format');
  1333. }
  1334. if (this._year === undefined) {
  1335. // We haven't set the Badí' date yet
  1336. this._setFromGregorianDate();
  1337. }
  1338. this._setHolyDay();
  1339. }
  1340. catch (err) {
  1341. this._setInvalid(err);
  1342. }
  1343. Object.freeze(this);
  1344. }
  1345. format(formatString, language) {
  1346. return formatBadiDate(this, formatString, language);
  1347. }
  1348. _isDateObject(arg) {
  1349. return Object.prototype.toString.call(arg) === '[object Date]';
  1350. }
  1351. _isYearMonthDay(arg) {
  1352. return typeof arg.year === 'number' && typeof arg.month === 'number' &&
  1353. typeof arg.day === 'number';
  1354. }
  1355. _isYearHolyDayNumber(arg) {
  1356. return typeof arg.year === 'number' && arg.month === undefined &&
  1357. arg.day === undefined && typeof arg.holyDayNumber === 'number';
  1358. }
  1359. _notInValidGregorianDateRange(datetime) {
  1360. const lowerBound = luxon.DateTime.fromObject({ year: 1844, month: 3, day: 21, zone: 'UTC' });
  1361. const upperBound = luxon.DateTime.fromObject({ year: 2351, month: 3, day: 20, zone: 'UTC' });
  1362. return datetime < lowerBound || datetime > upperBound;
  1363. }
  1364. _setFromGregorianDate() {
  1365. if (this._notInValidGregorianDateRange(this._gregorianDate)) {
  1366. throw new RangeError('Input date outside of valid range (1844-03-21 - 2351-03-20)');
  1367. }
  1368. const gregorianYear = this._gregorianDate.year;
  1369. const oldImplementationCutoff = luxon.DateTime.fromObject({ year: 2015, month: 3, day: 21, zone: 'UTC' });
  1370. if (this._gregorianDate < oldImplementationCutoff) {
  1371. const { month, day } = this._gregorianDate;
  1372. if (month < 3 || (month === 3 && day < 21)) {
  1373. this._nawRuz = luxon.DateTime.fromObject({ year: gregorianYear - 1, month: 3, day: 21, zone: 'UTC' });
  1374. this._year = gregorianYear - 1844;
  1375. }
  1376. else {
  1377. this._nawRuz = luxon.DateTime.fromObject({ year: gregorianYear, month: 3, day: 21, zone: 'UTC' });
  1378. this._year = gregorianYear - 1843;
  1379. }
  1380. this._setOldAyyamiHaLength();
  1381. this._yearTwinBirthdays = [12, 5, 13, 9];
  1382. }
  1383. else {
  1384. this._year = gregorianYear - 1843;
  1385. this._setBadiYearInfo(true);
  1386. }
  1387. this._setBadiMonthAndDay();
  1388. }
  1389. /**
  1390. * Set Badí' month and day from Gregorian date
  1391. */
  1392. _setBadiMonthAndDay() {
  1393. const dayOfBadiYear = this._dayOfYear(this._gregorianDate);
  1394. if (dayOfBadiYear < 343) {
  1395. this._month = Math.floor((dayOfBadiYear - 1) / 19 + 1);
  1396. this._day = (dayOfBadiYear - 1) % 19 + 1;
  1397. }
  1398. else if (dayOfBadiYear < 343 + this._ayyamiHaLength) {
  1399. this._month = 20;
  1400. this._day = dayOfBadiYear - 342;
  1401. }
  1402. else {
  1403. this._month = 19;
  1404. this._day = dayOfBadiYear - (342 + this._ayyamiHaLength);
  1405. }
  1406. }
  1407. _setFromBadiDate(date) {
  1408. this._year = date.year;
  1409. if (this._year < 1 || this._year > 507) {
  1410. throw new RangeError('Input date outside of valid range (1 - 507 B.E.)');
  1411. }
  1412. else if (this._year < 172) {
  1413. this._nawRuz = luxon.DateTime.fromObject({ year: 1843 + this._year, month: 3, day: 21, zone: 'UTC' });
  1414. this._setOldAyyamiHaLength();
  1415. this._yearTwinBirthdays = [12, 5, 13, 9];
  1416. }
  1417. else {
  1418. this._setBadiYearInfo();
  1419. }
  1420. if (this._isYearMonthDay(date)) {
  1421. this._month = date.month;
  1422. this._day = date.day;
  1423. if (this._month === 20 && this._day > this._ayyamiHaLength) {
  1424. // If only off by one day, we'll bubble up so that 5th Ayyám-i-Há in a year with only 4 days of
  1425. // Ayyám-i-Há can be salvaged
  1426. if (this._day - this._ayyamiHaLength === 1) {
  1427. this._month = 19;
  1428. this._day = 1;
  1429. }
  1430. else {
  1431. throw new TypeError('Input numbers do not designate a valid date');
  1432. }
  1433. }
  1434. if (this._month < 1 || this._month > 20 || this._day < 1 || this.day > 19) {
  1435. throw new TypeError('Input numbers do not designate a valid date');
  1436. }
  1437. }
  1438. else {
  1439. if (date.holyDayNumber < 1 || date.holyDayNumber > 11) {
  1440. throw new TypeError('Input numbers do not designate a valid Holy Day');
  1441. }
  1442. this._holyDay = date.holyDayNumber;
  1443. [this._month, this._day] = this._holyDayMapping()[this._holyDay];
  1444. }
  1445. this._gregorianDate = this._nawRuz.plus(luxon.Duration.fromObject({ days: this._dayOfYear([this._year, this._month, this._day]) - 1 }));
  1446. }
  1447. _setOldAyyamiHaLength() {
  1448. if (luxon.DateTime.fromObject({ year: this._nawRuz.year + 1 }).isInLeapYear) {
  1449. this._ayyamiHaLength = 5;
  1450. }
  1451. else {
  1452. this._ayyamiHaLength = 4;
  1453. }
  1454. }
  1455. _setBadiYearInfo(fromGregorianDate = false) {
  1456. let yearData = this._extractBadiYearInfo();
  1457. if (fromGregorianDate && this._gregorianDate < yearData.nawRuz) {
  1458. this._year -= 1;
  1459. yearData = this._extractBadiYearInfo();
  1460. }
  1461. this._nawRuz = yearData.nawRuz;
  1462. this._ayyamiHaLength = yearData.ayyamiHaLength;
  1463. this._yearTwinBirthdays = yearData.twinBirthdays;
  1464. }
  1465. _extractBadiYearInfo() {
  1466. let nawRuz, ayyamiHaLength, twinBirthdays;
  1467. // Check whether data needs to be unpacked or exists in the verbose version
  1468. // istanbul ignore else
  1469. if (badiYears[0] === 'l4da') {
  1470. const components = badiYears[this._year - 172].split('');
  1471. nawRuz = luxon.DateTime.fromObject({ year: this._year - 172 + 2015, month: 3, day: parseInt(components[0], 36), zone: 'UTC' });
  1472. ayyamiHaLength = parseInt(components[1], 36);
  1473. const TB1 = [parseInt(components[2], 36), parseInt(components[3], 36)];
  1474. const TB2 = TB1[1] < 19 ? [TB1[0], TB1[1] + 1] : [TB1[0] + 1, 1];
  1475. twinBirthdays = [TB1[0], TB1[1], TB2[0], TB2[1]];
  1476. }
  1477. else {
  1478. ({ nawRuz, ayyamiHaLength, twinBirthdays } = badiYears[this._year]);
  1479. nawRuz = luxon.DateTime.fromISO(nawRuz, { zone: 'UTC' });
  1480. }
  1481. return { nawRuz, ayyamiHaLength, twinBirthdays };
  1482. }
  1483. _dayOfYear(date) {
  1484. // Naw-Rúz is day 1
  1485. if (Array.isArray(date)) {
  1486. // We have a Badí' date
  1487. if (date[1] < 19) {
  1488. return 19 * (date[1] - 1) + date[2];
  1489. }
  1490. else if (date[1] === 20) {
  1491. return 342 + date[2];
  1492. }
  1493. // date[1] === 19
  1494. return 342 + this._ayyamiHaLength + date[2];
  1495. }
  1496. return date.diff(this._nawRuz).as('days') + 1;
  1497. }
  1498. _setInvalid(invalidReason) {
  1499. this._gregorianDate = luxon.DateTime.invalid('Not a valid Badí‘ date');
  1500. this._year = NaN;
  1501. this._month = NaN;
  1502. this._day = NaN;
  1503. this._ayyamiHaLength = NaN;
  1504. this._nawRuz = luxon.DateTime.invalid('Not a valid Badí‘ date');
  1505. this._valid = false;
  1506. this._invalidReason = invalidReason;
  1507. }
  1508. _setHolyDay() {
  1509. const mapping = this._holyDayMapping();
  1510. this._holyDay = parseInt(Object.keys(mapping)
  1511. .find(key => mapping[key][0] === this._month && mapping[key][1] === this._day), 10);
  1512. }
  1513. _holyDayMapping() {
  1514. return {
  1515. [1 /* NawRuz */]: [1, 1],
  1516. [2 /* FirstRidvan */]: [2, 13],
  1517. [3 /* NinthRidvan */]: [3, 2],
  1518. [4 /* TwelfthRidvan */]: [3, 5],
  1519. [5 /* DeclarationOfTheBab */]: [4, this._year < 172 ? 7 : 8],
  1520. [6 /* AscensionOfBahaullah */]: [4, 13],
  1521. [7 /* MartyrdomOfTheBab */]: [6, this._year < 172 ? 16 : 17],
  1522. [8 /* BirthOfTheBab */]: [this._yearTwinBirthdays[0], this._yearTwinBirthdays[1]],
  1523. [9 /* BirthOfBahaullah */]: [this._yearTwinBirthdays[2], this._yearTwinBirthdays[3]],
  1524. [10 /* DayOfTheCovenant */]: [14, 4],
  1525. [11 /* AscensionOfAbdulBaha */]: [14, 6],
  1526. };
  1527. }
  1528. _leapYearsBefore() {
  1529. let leapYearsBefore = Math.floor(Math.min(this.year - 1, 171) / 4);
  1530. if (this.year > 172) {
  1531. // istanbul ignore else
  1532. if (badiYears[0] === 'l4da') {
  1533. leapYearsBefore += badiYears.slice(0, this.year - 172).filter(entry => entry[1] === '5').length;
  1534. }
  1535. else {
  1536. leapYearsBefore += Object.entries(badiYears)
  1537. .filter(([year, data]) => parseInt(year, 10) < this.year &&
  1538. data.ayyamiHaLength === 5).length;
  1539. }
  1540. }
  1541. return leapYearsBefore;
  1542. }
  1543. holyDay(language = undefined) {
  1544. if (!this._holyDay) {
  1545. return '';
  1546. }
  1547. if (language === undefined || badiLocale[language] === undefined) {
  1548. language = 'default';
  1549. }
  1550. return formatItemFallback(language, 'holyDay', this._holyDay);
  1551. }
  1552. valueOf() {
  1553. return this._dayOfYear([this.year, this.month, this.day]) + this._leapYearsBefore() + (this.year - 1) * 365;
  1554. }
  1555. equals(other) {
  1556. return this.isValid && other.isValid && this.valueOf() === other.valueOf();
  1557. }
  1558. get isValid() {
  1559. return this._valid;
  1560. }
  1561. get invalidReason() {
  1562. return this._invalidReason;
  1563. }
  1564. get day() {
  1565. return this._day;
  1566. }
  1567. get month() {
  1568. return this._month;
  1569. }
  1570. get year() {
  1571. return this._year;
  1572. }
  1573. // number of the Badí' weekday between 1 (Jalál ~> Saturday) and 7 (Istiqlál ~> Friday).
  1574. get weekday() {
  1575. return (this._gregorianDate.weekday + 1) % 7 + 1;
  1576. }
  1577. get yearInVahid() {
  1578. return (this._year - 1) % 19 + 1;
  1579. }
  1580. get vahid() {
  1581. return (Math.floor((this._year - 1) / 19) % 19) + 1;
  1582. }
  1583. get kullIShay() {
  1584. return Math.floor((this._year - 1) / 361) + 1;
  1585. }
  1586. // Gregorian date on whose sunset the Badí' date ends.
  1587. get gregorianDate() {
  1588. return this._gregorianDate;
  1589. }
  1590. get ayyamiHaLength() {
  1591. return this._ayyamiHaLength;
  1592. }
  1593. get holyDayNumber() {
  1594. return this._holyDay ? this._holyDay : undefined;
  1595. }
  1596. get workSuspended() {
  1597. return this._holyDay ? this.holyDayNumber < 10 : undefined;
  1598. }
  1599. get nextMonth() {
  1600. let { year, month } = this;
  1601. switch (month) {
  1602. case 18:
  1603. month = 20;
  1604. break;
  1605. case 19:
  1606. month = 1;
  1607. year += 1;
  1608. break;
  1609. case 20:
  1610. month = 19;
  1611. break;
  1612. default:
  1613. month += 1;
  1614. }
  1615. return new BadiDate({ year, month, day: 1 });
  1616. }
  1617. get previousMonth() {
  1618. let { year, month } = this;
  1619. switch (month) {
  1620. case 1:
  1621. month = 19;
  1622. year -= 1;
  1623. break;
  1624. case 19:
  1625. month = 20;
  1626. break;
  1627. case 20:
  1628. month = 18;
  1629. break;
  1630. default:
  1631. month -= 1;
  1632. }
  1633. return new BadiDate({ year, month, day: 1 });
  1634. }
  1635. get nextDay() {
  1636. if (this._day === 19 || (this._month === 20 && this._day === this._ayyamiHaLength)) {
  1637. return this.nextMonth;
  1638. }
  1639. return new BadiDate({ year: this._year, month: this._month, day: this._day + 1 });
  1640. }
  1641. get previousDay() {
  1642. if (this._day === 1) {
  1643. const { previousMonth } = this;
  1644. let day = 19;
  1645. if (this._month === 19) {
  1646. day = this._ayyamiHaLength;
  1647. }
  1648. return new BadiDate({
  1649. year: previousMonth.year,
  1650. month: previousMonth.month,
  1651. day,
  1652. });
  1653. }
  1654. return new BadiDate({ year: this._year, month: this._month, day: this._day - 1 });
  1655. }
  1656. }
  1657. const badiDateSettings = (settings) => {
  1658. if (settings.defaultLanguage) {
  1659. setDefaultLanguage(settings.defaultLanguage);
  1660. }
  1661. if (settings.underlineFormat) {
  1662. setUnderlineFormat(settings.underlineFormat);
  1663. }
  1664. };
  1665. exports.BadiDate = BadiDate;
  1666. exports.badiDateSettings = badiDateSettings;
  1667. Object.defineProperty(exports, '__esModule', { value: true });
  1668. })));