badiDate-locales.mjs 48 KB

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