calendaryjs-plugin-liturgical 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,3099 @@
1
+ import { addDays, parseDate, formatDate, daysBetween, resolveConflict, getYear, mergeEventConfig } from 'calendaryjs';
2
+
3
+ // package.json
4
+ var package_default = {
5
+ name: "calendaryjs-plugin-liturgical",
6
+ version: "0.1.0"};
7
+
8
+ // src/computus.ts
9
+ function computeEaster(year) {
10
+ const a = year % 19;
11
+ const b = Math.floor(year / 100);
12
+ const c = year % 100;
13
+ const d = Math.floor(b / 4);
14
+ const e = b % 4;
15
+ const f = Math.floor((b + 8) / 25);
16
+ const g = Math.floor((b - f + 1) / 3);
17
+ const h = (19 * a + b - d - g + 15) % 30;
18
+ const i = Math.floor(c / 4);
19
+ const k = c % 4;
20
+ const l = (32 + 2 * e + 2 * i - h - k) % 7;
21
+ const m = Math.floor((a + 11 * h + 22 * l) / 451);
22
+ const month = Math.floor((h + l - 7 * m + 114) / 31);
23
+ const day = (h + l - 7 * m + 114) % 31 + 1;
24
+ return new Date(year, month - 1, day);
25
+ }
26
+ function computeOrthodoxEaster(year) {
27
+ const a = year % 4;
28
+ const b = year % 7;
29
+ const c = year % 19;
30
+ const d = (19 * c + 15) % 30;
31
+ const e = (2 * a + 4 * b - d + 34) % 7;
32
+ const month = Math.floor((d + e + 114) / 31);
33
+ const day = (d + e + 114) % 31 + 1;
34
+ const julianDate = new Date(year, month - 1, day);
35
+ const gregorianDate = new Date(julianDate.getTime() + 13 * 864e5);
36
+ return gregorianDate;
37
+ }
38
+ function getEasterDateString(year) {
39
+ const easter = computeEaster(year);
40
+ const month = String(easter.getMonth() + 1).padStart(2, "0");
41
+ const day = String(easter.getDate()).padStart(2, "0");
42
+ return `${year}-${month}-${day}`;
43
+ }
44
+ function easterRelativeDate(year, offsetDays) {
45
+ const easter = computeEaster(year);
46
+ return new Date(easter.getFullYear(), easter.getMonth(), easter.getDate() + offsetDays);
47
+ }
48
+
49
+ // src/formulas/advent.ts
50
+ function getAdvent1(year) {
51
+ const christmas = new Date(year, 11, 25);
52
+ const christmasDay = christmas.getDay();
53
+ let daysBack;
54
+ if (christmasDay === 0) {
55
+ daysBack = 28;
56
+ } else {
57
+ daysBack = christmasDay + 21;
58
+ }
59
+ const advent1 = new Date(year, 11, 25 - daysBack);
60
+ return advent1;
61
+ }
62
+ function getAdvent2(year) {
63
+ const advent1 = getAdvent1(year);
64
+ return new Date(advent1.getFullYear(), advent1.getMonth(), advent1.getDate() + 7);
65
+ }
66
+ function getAdvent3(year) {
67
+ const advent1 = getAdvent1(year);
68
+ return new Date(advent1.getFullYear(), advent1.getMonth(), advent1.getDate() + 14);
69
+ }
70
+ function getAdvent4(year) {
71
+ const advent1 = getAdvent1(year);
72
+ return new Date(advent1.getFullYear(), advent1.getMonth(), advent1.getDate() + 21);
73
+ }
74
+ function getBaptismOfLord(year, epiphanyOnSunday = false) {
75
+ let epiphany;
76
+ if (epiphanyOnSunday) {
77
+ const jan2 = new Date(year, 0, 2);
78
+ const jan2Day = jan2.getDay();
79
+ const daysToSunday = jan2Day === 0 ? 0 : 7 - jan2Day;
80
+ epiphany = new Date(year, 0, 2 + daysToSunday);
81
+ } else {
82
+ epiphany = new Date(year, 0, 6);
83
+ }
84
+ const epiphanyDay = epiphany.getDay();
85
+ if (epiphanyOnSunday && epiphany.getDate() >= 7) {
86
+ return new Date(year, 0, epiphany.getDate() + 1);
87
+ }
88
+ const daysToNextSunday = epiphanyDay === 0 ? 7 : 7 - epiphanyDay;
89
+ return new Date(year, 0, epiphany.getDate() + daysToNextSunday);
90
+ }
91
+ function getChristTheKing(year) {
92
+ const advent1 = getAdvent1(year);
93
+ return new Date(advent1.getFullYear(), advent1.getMonth(), advent1.getDate() - 7);
94
+ }
95
+ function getHolyFamily(year) {
96
+ const christmas = new Date(year, 11, 25);
97
+ const christmasDay = christmas.getDay();
98
+ if (christmasDay === 0) {
99
+ return new Date(year, 11, 30);
100
+ }
101
+ const daysToSunday = 7 - christmasDay;
102
+ return new Date(year, 11, 25 + daysToSunday);
103
+ }
104
+
105
+ // src/daily/boundaries.ts
106
+ function getLiturgicalYear(date) {
107
+ const year = date.getFullYear();
108
+ const advent1ThisYear = getAdvent1(year);
109
+ if (date < advent1ThisYear) {
110
+ return year;
111
+ }
112
+ return year + 1;
113
+ }
114
+ function getLiturgicalYearBoundaries(liturgicalYear, epiphanyOnSunday = false) {
115
+ const advent1 = getAdvent1(liturgicalYear - 1);
116
+ const christmas = new Date(liturgicalYear - 1, 11, 25);
117
+ const baptismOfLord = getBaptismOfLord(liturgicalYear, epiphanyOnSunday);
118
+ const easter = computeEaster(liturgicalYear);
119
+ const ashWednesday = addDays(easter, -46);
120
+ const pentecost = addDays(easter, 49);
121
+ const christTheKing = getChristTheKing(liturgicalYear);
122
+ return {
123
+ advent1,
124
+ christmas,
125
+ baptismOfLord,
126
+ ashWednesday,
127
+ easter,
128
+ pentecost,
129
+ christTheKing
130
+ };
131
+ }
132
+
133
+ // src/daily/calculator.ts
134
+ function getLiturgicalDay(date, options = {}) {
135
+ const { epiphanyOnSunday = false } = options;
136
+ const d = typeof date === "string" ? parseDate(date) : date;
137
+ const dateStr = formatDate(d);
138
+ const dayOfWeek = d.getDay();
139
+ const isSunday = dayOfWeek === 0;
140
+ const isWeekday = !isSunday;
141
+ const litYear = getLiturgicalYear(d);
142
+ const boundaries = getLiturgicalYearBoundaries(litYear, epiphanyOnSunday);
143
+ const { season, week, rank, vestmentColor } = calculateSeasonAndWeek(
144
+ d,
145
+ boundaries,
146
+ litYear,
147
+ epiphanyOnSunday
148
+ );
149
+ return {
150
+ date: dateStr,
151
+ season,
152
+ week,
153
+ dayOfWeek,
154
+ rank,
155
+ vestmentColor,
156
+ isSunday,
157
+ isWeekday,
158
+ metadata: {
159
+ season,
160
+ rank,
161
+ vestmentColor
162
+ }
163
+ };
164
+ }
165
+ function calculateSeasonAndWeek(date, boundaries, litYear, epiphanyOnSunday) {
166
+ const { advent1, christmas, baptismOfLord, ashWednesday, easter, pentecost } = boundaries;
167
+ const nextAdvent1 = getLiturgicalYearBoundaries(litYear + 1, epiphanyOnSunday).advent1;
168
+ if (date >= advent1 && date < christmas) {
169
+ const daysFromAdvent1 = daysBetween(advent1, date);
170
+ const week = Math.floor(daysFromAdvent1 / 7) + 1;
171
+ const dayOfWeek = date.getDay();
172
+ return {
173
+ season: "advent",
174
+ week,
175
+ rank: dayOfWeek === 0 ? "solemnity" : "ordinary",
176
+ vestmentColor: week === 3 && dayOfWeek === 0 ? "rose" : "violet"
177
+ };
178
+ }
179
+ if (date >= christmas && date <= baptismOfLord) {
180
+ const daysFromChristmas = daysBetween(christmas, date);
181
+ const week = daysFromChristmas <= 7 ? 1 : 2;
182
+ return {
183
+ season: "christmas",
184
+ week,
185
+ rank: daysFromChristmas === 0 ? "solemnity" : "ordinary",
186
+ vestmentColor: "white"
187
+ };
188
+ }
189
+ if (date > baptismOfLord && date < ashWednesday) {
190
+ const daysFromBaptism = daysBetween(baptismOfLord, date);
191
+ const week = Math.floor(daysFromBaptism / 7) + 1;
192
+ const dayOfWeek = date.getDay();
193
+ return {
194
+ season: "ordinary-time-1",
195
+ week,
196
+ rank: dayOfWeek === 0 ? "solemnity" : "ordinary",
197
+ vestmentColor: "green"
198
+ };
199
+ }
200
+ const holySaturday = addDays(easter, -1);
201
+ if (date >= ashWednesday && date <= holySaturday) {
202
+ const firstSundayOfLent = addDays(ashWednesday, 7 - ashWednesday.getDay());
203
+ let week;
204
+ if (date < firstSundayOfLent) {
205
+ week = 0;
206
+ } else {
207
+ const daysFromFirstSunday = daysBetween(firstSundayOfLent, date);
208
+ week = Math.floor(daysFromFirstSunday / 7) + 1;
209
+ }
210
+ const dayOfWeek = date.getDay();
211
+ const palmSunday = addDays(easter, -7);
212
+ if (date >= palmSunday) {
213
+ week = 6;
214
+ }
215
+ return {
216
+ season: "lent",
217
+ week,
218
+ rank: dayOfWeek === 0 ? "solemnity" : "ordinary",
219
+ vestmentColor: week === 4 && dayOfWeek === 0 ? "rose" : "violet"
220
+ };
221
+ }
222
+ if (date >= easter && date <= pentecost) {
223
+ const daysFromEaster = daysBetween(easter, date);
224
+ const week = Math.floor(daysFromEaster / 7) + 1;
225
+ const dayOfWeek = date.getDay();
226
+ return {
227
+ season: "easter",
228
+ week,
229
+ rank: dayOfWeek === 0 ? "solemnity" : "ordinary",
230
+ vestmentColor: daysFromEaster === 49 ? "red" : "white"
231
+ // Pentecost is red
232
+ };
233
+ }
234
+ if (date > pentecost && date < nextAdvent1) {
235
+ const daysFromPentecost = daysBetween(pentecost, date);
236
+ const ot1Weeks = Math.floor(daysBetween(baptismOfLord, ashWednesday) / 7);
237
+ const ot2WeekOffset = ot1Weeks + 1;
238
+ const week = Math.floor(daysFromPentecost / 7) + ot2WeekOffset;
239
+ const dayOfWeek = date.getDay();
240
+ return {
241
+ season: "ordinary-time-2",
242
+ week,
243
+ rank: dayOfWeek === 0 ? "solemnity" : "ordinary",
244
+ vestmentColor: "green"
245
+ };
246
+ }
247
+ return {
248
+ season: "ordinary-time-2",
249
+ week: 1,
250
+ rank: "ordinary",
251
+ vestmentColor: "green"
252
+ };
253
+ }
254
+ function getLiturgicalDaysInRange(startDate, endDate, options = {}) {
255
+ const start = typeof startDate === "string" ? parseDate(startDate) : startDate;
256
+ const end = typeof endDate === "string" ? parseDate(endDate) : endDate;
257
+ const days = [];
258
+ const current = new Date(start);
259
+ while (current <= end) {
260
+ days.push(getLiturgicalDay(current, options));
261
+ current.setDate(current.getDate() + 1);
262
+ }
263
+ return days;
264
+ }
265
+ function getLiturgicalDaysForMonth(year, month, options = {}) {
266
+ const startDate = new Date(year, month - 1, 1);
267
+ const endDate = new Date(year, month, 0);
268
+ return getLiturgicalDaysInRange(startDate, endDate, options);
269
+ }
270
+ function getLiturgicalDaysForYear(year, options = {}) {
271
+ const startDate = new Date(year, 0, 1);
272
+ const endDate = new Date(year, 11, 31);
273
+ return getLiturgicalDaysInRange(startDate, endDate, options);
274
+ }
275
+
276
+ // src/generators/easter.ts
277
+ var easterEventHandler = {
278
+ validate(event) {
279
+ if (typeof event !== "object" || event === null) return false;
280
+ const e = event;
281
+ return e.type === "easter" && typeof e.id === "string";
282
+ },
283
+ generate(_event, year) {
284
+ return [computeEaster(year)];
285
+ }
286
+ };
287
+
288
+ // src/generators/offset.ts
289
+ var offsetEventHandler = {
290
+ validate(event) {
291
+ if (typeof event !== "object" || event === null) return false;
292
+ const e = event;
293
+ return e.type === "offset" && typeof e.baseEvent === "string" && typeof e.offsetDays === "number" && typeof e.id === "string";
294
+ },
295
+ generate(event, year) {
296
+ const offsetEvent = event;
297
+ let baseDate;
298
+ switch (offsetEvent.baseEvent) {
299
+ case "easter":
300
+ baseDate = computeEaster(year);
301
+ break;
302
+ default:
303
+ throw new Error(
304
+ `Unknown base event "${offsetEvent.baseEvent}". Supported base events: "easter".`
305
+ );
306
+ }
307
+ const resultDate = new Date(baseDate);
308
+ resultDate.setDate(resultDate.getDate() + offsetEvent.offsetDays);
309
+ return [resultDate];
310
+ }
311
+ };
312
+
313
+ // src/plugin.ts
314
+ function liturgical(options = {}) {
315
+ const { epiphanyOnSunday = false, enrichDays = true } = options;
316
+ const liturgicalDayEnricher = {
317
+ name: "liturgical",
318
+ priority: 20,
319
+ enrich(day) {
320
+ const litDay = getLiturgicalDay(day.date, {
321
+ epiphanyOnSunday
322
+ });
323
+ return {
324
+ ...day,
325
+ liturgical: {
326
+ season: litDay.season,
327
+ week: litDay.week,
328
+ rank: litDay.rank,
329
+ vestmentColor: litDay.vestmentColor
330
+ }
331
+ };
332
+ }
333
+ };
334
+ return {
335
+ name: package_default.name,
336
+ version: package_default.version,
337
+ install(calendary) {
338
+ if (enrichDays) {
339
+ calendary.registerDayEnricher(liturgicalDayEnricher);
340
+ }
341
+ },
342
+ eventTypes: {
343
+ easter: easterEventHandler,
344
+ offset: offsetEventHandler
345
+ },
346
+ formulas: {
347
+ "advent-1": (year) => getAdvent1(year),
348
+ "advent-2": (year) => getAdvent2(year),
349
+ "advent-3": (year) => getAdvent3(year),
350
+ "advent-4": (year) => getAdvent4(year),
351
+ "baptism-of-lord": (year) => getBaptismOfLord(year, epiphanyOnSunday),
352
+ "christ-the-king": (year) => getChristTheKing(year)
353
+ }
354
+ };
355
+ }
356
+
357
+ // src/keys.ts
358
+ var EASTER_CYCLE_KEYS = [
359
+ "EASTER_SUNDAY",
360
+ "ASH_WEDNESDAY",
361
+ "PALM_SUNDAY",
362
+ "HOLY_THURSDAY",
363
+ "GOOD_FRIDAY",
364
+ "HOLY_SATURDAY",
365
+ "DIVINE_MERCY_SUNDAY",
366
+ "ASCENSION",
367
+ "PENTECOST",
368
+ "TRINITY_SUNDAY",
369
+ "CORPUS_CHRISTI",
370
+ "SACRED_HEART",
371
+ "IMMACULATE_HEART"
372
+ ];
373
+ var FIXED_SOLEMNITY_KEYS = [
374
+ "MARY_MOTHER_OF_GOD",
375
+ "EPIPHANY",
376
+ "PRESENTATION",
377
+ "SAINT_JOSEPH",
378
+ "ANNUNCIATION",
379
+ "NATIVITY_OF_JOHN_BAPTIST",
380
+ "PETER_AND_PAUL",
381
+ "TRANSFIGURATION",
382
+ "ASSUMPTION",
383
+ "EXALTATION_OF_CROSS",
384
+ "ALL_SAINTS",
385
+ "ALL_SOULS",
386
+ "IMMACULATE_CONCEPTION",
387
+ "CHRISTMAS",
388
+ "HOLY_INNOCENTS",
389
+ "HOLY_FAMILY"
390
+ ];
391
+ var COMPUTED_KEYS = [
392
+ "ADVENT_1",
393
+ "ADVENT_2",
394
+ "ADVENT_3",
395
+ "ADVENT_4",
396
+ "BAPTISM_OF_LORD",
397
+ "CHRIST_THE_KING"
398
+ ];
399
+ var MEMORIAL_SAINT_KEYS = [
400
+ // January
401
+ "BASIL_GREGORY",
402
+ "ANTHONY_ABBOT",
403
+ "AGNES",
404
+ "FRANCIS_DE_SALES",
405
+ "TIMOTHY_TITUS",
406
+ "THOMAS_AQUINAS",
407
+ "JOHN_BOSCO",
408
+ // February
409
+ "AGATHA",
410
+ "PAUL_MIKI",
411
+ "SCHOLASTICA",
412
+ "OUR_LADY_OF_LOURDES",
413
+ "CYRIL_METHODIUS",
414
+ "POLYCARP",
415
+ // March
416
+ "PERPETUA_FELICITY",
417
+ "PATRICK",
418
+ "CYRIL_OF_JERUSALEM",
419
+ // April
420
+ "MARTIN_I",
421
+ "ANSELM",
422
+ "GEORGE",
423
+ "ADALBERT",
424
+ "FIDELIS",
425
+ "LOUIS_GRIGNION",
426
+ "PETER_CHANEL",
427
+ "CATHERINE_OF_SIENA",
428
+ "PIUS_V",
429
+ // May
430
+ "JOSEPH_WORKER",
431
+ "ATHANASIUS",
432
+ "NEREUS_ACHILLEUS",
433
+ "PANCRAS",
434
+ "OUR_LADY_OF_FATIMA",
435
+ "JOHN_I",
436
+ "BERNARDINE",
437
+ "PHILIP_NERI",
438
+ "AUGUSTINE_OF_CANTERBURY",
439
+ // June
440
+ "JUSTIN",
441
+ "MARCELLINUS_PETER",
442
+ "CHARLES_LWANGA",
443
+ "BONIFACE",
444
+ "NORBERT",
445
+ "EPHREM",
446
+ "BARNABAS",
447
+ "ROMUALD",
448
+ "JOHN_FISHER_THOMAS_MORE",
449
+ "FIRST_MARTYRS_OF_ROME",
450
+ // July
451
+ "THOMAS_APOSTLE",
452
+ "ELIZABETH_OF_PORTUGAL",
453
+ "MARIA_GORETTI",
454
+ "AUGUSTINE_ZHAO",
455
+ "BENEDICT",
456
+ "HENRY",
457
+ "CAMILLUS",
458
+ "BONAVENTURE",
459
+ "OUR_LADY_OF_MOUNT_CARMEL",
460
+ "APOLLINARIS",
461
+ "LAWRENCE_OF_BRINDISI",
462
+ "MARY_MAGDALENE",
463
+ "BRIDGET",
464
+ "SHARBEL",
465
+ "JAMES_APOSTLE",
466
+ "MARTHA",
467
+ "PETER_CHRYSOLOGUS",
468
+ "IGNATIUS_OF_LOYOLA",
469
+ // August
470
+ "ALPHONSUS",
471
+ "JOHN_VIANNEY",
472
+ "DEDICATION_MARY_MAJOR",
473
+ "SIXTUS_II",
474
+ "CAJETAN",
475
+ "DOMINIC",
476
+ "LAWRENCE",
477
+ "CLARE",
478
+ "JANE_FRANCES",
479
+ "PONTIAN_HIPPOLYTUS",
480
+ "MAXIMILIAN_KOLBE",
481
+ "JOHN_EUDES",
482
+ "BERNARD",
483
+ "PIUS_X",
484
+ "QUEENSHIP_OF_MARY",
485
+ "BARTHOLOMEW",
486
+ "LOUIS_IX",
487
+ "JOSEPH_CALASANZ",
488
+ "MONICA",
489
+ "AUGUSTINE",
490
+ "PASSION_OF_JOHN_BAPTIST",
491
+ // September
492
+ "GREGORY_THE_GREAT",
493
+ "BIRTH_OF_MARY",
494
+ "PETER_CLAVER",
495
+ "MOST_HOLY_NAME_OF_MARY",
496
+ "OUR_LADY_OF_SORROWS",
497
+ "CORNELIUS_CYPRIAN",
498
+ "ROBERT_BELLARMINE",
499
+ "JANUARIUS",
500
+ "MATTHEW",
501
+ "PADRE_PIO",
502
+ "COSMAS_DAMIAN",
503
+ "WENCESLAUS",
504
+ "LAWRENCE_RUIZ",
505
+ "ARCHANGELS",
506
+ "JEROME",
507
+ // October
508
+ "THERESE_OF_LISIEUX",
509
+ "GUARDIAN_ANGELS",
510
+ "FRANCIS_OF_ASSISI",
511
+ "FAUSTINA",
512
+ "BRUNO",
513
+ "OUR_LADY_OF_ROSARY",
514
+ "DENIS",
515
+ "CALLISTUS_I",
516
+ "TERESA_OF_AVILA",
517
+ "HEDWIG",
518
+ "MARGARET_MARY",
519
+ "IGNATIUS_OF_ANTIOCH",
520
+ "LUKE",
521
+ "ISAAC_JOGUES",
522
+ "PAUL_OF_CROSS",
523
+ "JOHN_PAUL_II",
524
+ "JOHN_OF_CAPISTRANO",
525
+ "ANTHONY_MARY_CLARET",
526
+ "SIMON_JUDE",
527
+ // November
528
+ "DEDICATION_LATERAN",
529
+ "LEO_THE_GREAT",
530
+ "MARTIN_OF_TOURS",
531
+ "JOSAPHAT",
532
+ "MARGARET_OF_SCOTLAND",
533
+ "GERTRUDE",
534
+ "ELIZABETH_OF_HUNGARY",
535
+ "DEDICATION_PETER_PAUL",
536
+ "PRESENTATION_OF_MARY",
537
+ "CLEMENT_I",
538
+ "COLUMBAN",
539
+ "CATHERINE_OF_ALEXANDRIA",
540
+ "ANDREW_APOSTLE",
541
+ // December
542
+ "FRANCIS_XAVIER",
543
+ "LUCY",
544
+ "STEPHEN_FIRST_MARTYR",
545
+ "JOHN_APOSTLE"
546
+ ];
547
+ var ALL_MASS_KEYS = [
548
+ ...EASTER_CYCLE_KEYS,
549
+ ...FIXED_SOLEMNITY_KEYS,
550
+ ...COMPUTED_KEYS,
551
+ ...MEMORIAL_SAINT_KEYS
552
+ ];
553
+ var MassKeys = {
554
+ // Easter Cycle
555
+ EASTER_SUNDAY: "EASTER_SUNDAY",
556
+ ASH_WEDNESDAY: "ASH_WEDNESDAY",
557
+ PALM_SUNDAY: "PALM_SUNDAY",
558
+ HOLY_THURSDAY: "HOLY_THURSDAY",
559
+ GOOD_FRIDAY: "GOOD_FRIDAY",
560
+ HOLY_SATURDAY: "HOLY_SATURDAY",
561
+ DIVINE_MERCY_SUNDAY: "DIVINE_MERCY_SUNDAY",
562
+ ASCENSION: "ASCENSION",
563
+ PENTECOST: "PENTECOST",
564
+ TRINITY_SUNDAY: "TRINITY_SUNDAY",
565
+ CORPUS_CHRISTI: "CORPUS_CHRISTI",
566
+ SACRED_HEART: "SACRED_HEART",
567
+ IMMACULATE_HEART: "IMMACULATE_HEART",
568
+ // Fixed Solemnities
569
+ MARY_MOTHER_OF_GOD: "MARY_MOTHER_OF_GOD",
570
+ EPIPHANY: "EPIPHANY",
571
+ PRESENTATION: "PRESENTATION",
572
+ SAINT_JOSEPH: "SAINT_JOSEPH",
573
+ ANNUNCIATION: "ANNUNCIATION",
574
+ NATIVITY_OF_JOHN_BAPTIST: "NATIVITY_OF_JOHN_BAPTIST",
575
+ PETER_AND_PAUL: "PETER_AND_PAUL",
576
+ TRANSFIGURATION: "TRANSFIGURATION",
577
+ ASSUMPTION: "ASSUMPTION",
578
+ EXALTATION_OF_CROSS: "EXALTATION_OF_CROSS",
579
+ ALL_SAINTS: "ALL_SAINTS",
580
+ ALL_SOULS: "ALL_SOULS",
581
+ IMMACULATE_CONCEPTION: "IMMACULATE_CONCEPTION",
582
+ CHRISTMAS: "CHRISTMAS",
583
+ HOLY_INNOCENTS: "HOLY_INNOCENTS",
584
+ HOLY_FAMILY: "HOLY_FAMILY",
585
+ // Computed
586
+ ADVENT_1: "ADVENT_1",
587
+ ADVENT_2: "ADVENT_2",
588
+ ADVENT_3: "ADVENT_3",
589
+ ADVENT_4: "ADVENT_4",
590
+ BAPTISM_OF_LORD: "BAPTISM_OF_LORD",
591
+ CHRIST_THE_KING: "CHRIST_THE_KING",
592
+ // Memorial Saints - January
593
+ BASIL_GREGORY: "BASIL_GREGORY",
594
+ ANTHONY_ABBOT: "ANTHONY_ABBOT",
595
+ AGNES: "AGNES",
596
+ FRANCIS_DE_SALES: "FRANCIS_DE_SALES",
597
+ TIMOTHY_TITUS: "TIMOTHY_TITUS",
598
+ THOMAS_AQUINAS: "THOMAS_AQUINAS",
599
+ JOHN_BOSCO: "JOHN_BOSCO",
600
+ // February
601
+ AGATHA: "AGATHA",
602
+ PAUL_MIKI: "PAUL_MIKI",
603
+ SCHOLASTICA: "SCHOLASTICA",
604
+ OUR_LADY_OF_LOURDES: "OUR_LADY_OF_LOURDES",
605
+ CYRIL_METHODIUS: "CYRIL_METHODIUS",
606
+ POLYCARP: "POLYCARP",
607
+ // March
608
+ PERPETUA_FELICITY: "PERPETUA_FELICITY",
609
+ PATRICK: "PATRICK",
610
+ CYRIL_OF_JERUSALEM: "CYRIL_OF_JERUSALEM",
611
+ // April
612
+ MARTIN_I: "MARTIN_I",
613
+ ANSELM: "ANSELM",
614
+ GEORGE: "GEORGE",
615
+ ADALBERT: "ADALBERT",
616
+ FIDELIS: "FIDELIS",
617
+ LOUIS_GRIGNION: "LOUIS_GRIGNION",
618
+ PETER_CHANEL: "PETER_CHANEL",
619
+ CATHERINE_OF_SIENA: "CATHERINE_OF_SIENA",
620
+ PIUS_V: "PIUS_V",
621
+ // May
622
+ JOSEPH_WORKER: "JOSEPH_WORKER",
623
+ ATHANASIUS: "ATHANASIUS",
624
+ NEREUS_ACHILLEUS: "NEREUS_ACHILLEUS",
625
+ PANCRAS: "PANCRAS",
626
+ OUR_LADY_OF_FATIMA: "OUR_LADY_OF_FATIMA",
627
+ JOHN_I: "JOHN_I",
628
+ BERNARDINE: "BERNARDINE",
629
+ PHILIP_NERI: "PHILIP_NERI",
630
+ AUGUSTINE_OF_CANTERBURY: "AUGUSTINE_OF_CANTERBURY",
631
+ // June
632
+ JUSTIN: "JUSTIN",
633
+ MARCELLINUS_PETER: "MARCELLINUS_PETER",
634
+ CHARLES_LWANGA: "CHARLES_LWANGA",
635
+ BONIFACE: "BONIFACE",
636
+ NORBERT: "NORBERT",
637
+ EPHREM: "EPHREM",
638
+ BARNABAS: "BARNABAS",
639
+ ROMUALD: "ROMUALD",
640
+ JOHN_FISHER_THOMAS_MORE: "JOHN_FISHER_THOMAS_MORE",
641
+ FIRST_MARTYRS_OF_ROME: "FIRST_MARTYRS_OF_ROME",
642
+ // July
643
+ THOMAS_APOSTLE: "THOMAS_APOSTLE",
644
+ ELIZABETH_OF_PORTUGAL: "ELIZABETH_OF_PORTUGAL",
645
+ MARIA_GORETTI: "MARIA_GORETTI",
646
+ AUGUSTINE_ZHAO: "AUGUSTINE_ZHAO",
647
+ BENEDICT: "BENEDICT",
648
+ HENRY: "HENRY",
649
+ CAMILLUS: "CAMILLUS",
650
+ BONAVENTURE: "BONAVENTURE",
651
+ OUR_LADY_OF_MOUNT_CARMEL: "OUR_LADY_OF_MOUNT_CARMEL",
652
+ APOLLINARIS: "APOLLINARIS",
653
+ LAWRENCE_OF_BRINDISI: "LAWRENCE_OF_BRINDISI",
654
+ MARY_MAGDALENE: "MARY_MAGDALENE",
655
+ BRIDGET: "BRIDGET",
656
+ SHARBEL: "SHARBEL",
657
+ JAMES_APOSTLE: "JAMES_APOSTLE",
658
+ MARTHA: "MARTHA",
659
+ PETER_CHRYSOLOGUS: "PETER_CHRYSOLOGUS",
660
+ IGNATIUS_OF_LOYOLA: "IGNATIUS_OF_LOYOLA",
661
+ // August
662
+ ALPHONSUS: "ALPHONSUS",
663
+ JOHN_VIANNEY: "JOHN_VIANNEY",
664
+ DEDICATION_MARY_MAJOR: "DEDICATION_MARY_MAJOR",
665
+ SIXTUS_II: "SIXTUS_II",
666
+ CAJETAN: "CAJETAN",
667
+ DOMINIC: "DOMINIC",
668
+ LAWRENCE: "LAWRENCE",
669
+ CLARE: "CLARE",
670
+ JANE_FRANCES: "JANE_FRANCES",
671
+ PONTIAN_HIPPOLYTUS: "PONTIAN_HIPPOLYTUS",
672
+ MAXIMILIAN_KOLBE: "MAXIMILIAN_KOLBE",
673
+ JOHN_EUDES: "JOHN_EUDES",
674
+ BERNARD: "BERNARD",
675
+ PIUS_X: "PIUS_X",
676
+ QUEENSHIP_OF_MARY: "QUEENSHIP_OF_MARY",
677
+ BARTHOLOMEW: "BARTHOLOMEW",
678
+ LOUIS_IX: "LOUIS_IX",
679
+ JOSEPH_CALASANZ: "JOSEPH_CALASANZ",
680
+ MONICA: "MONICA",
681
+ AUGUSTINE: "AUGUSTINE",
682
+ PASSION_OF_JOHN_BAPTIST: "PASSION_OF_JOHN_BAPTIST",
683
+ // September
684
+ GREGORY_THE_GREAT: "GREGORY_THE_GREAT",
685
+ BIRTH_OF_MARY: "BIRTH_OF_MARY",
686
+ PETER_CLAVER: "PETER_CLAVER",
687
+ MOST_HOLY_NAME_OF_MARY: "MOST_HOLY_NAME_OF_MARY",
688
+ OUR_LADY_OF_SORROWS: "OUR_LADY_OF_SORROWS",
689
+ CORNELIUS_CYPRIAN: "CORNELIUS_CYPRIAN",
690
+ ROBERT_BELLARMINE: "ROBERT_BELLARMINE",
691
+ JANUARIUS: "JANUARIUS",
692
+ MATTHEW: "MATTHEW",
693
+ PADRE_PIO: "PADRE_PIO",
694
+ COSMAS_DAMIAN: "COSMAS_DAMIAN",
695
+ WENCESLAUS: "WENCESLAUS",
696
+ LAWRENCE_RUIZ: "LAWRENCE_RUIZ",
697
+ ARCHANGELS: "ARCHANGELS",
698
+ JEROME: "JEROME",
699
+ // October
700
+ THERESE_OF_LISIEUX: "THERESE_OF_LISIEUX",
701
+ GUARDIAN_ANGELS: "GUARDIAN_ANGELS",
702
+ FRANCIS_OF_ASSISI: "FRANCIS_OF_ASSISI",
703
+ FAUSTINA: "FAUSTINA",
704
+ BRUNO: "BRUNO",
705
+ OUR_LADY_OF_ROSARY: "OUR_LADY_OF_ROSARY",
706
+ DENIS: "DENIS",
707
+ CALLISTUS_I: "CALLISTUS_I",
708
+ TERESA_OF_AVILA: "TERESA_OF_AVILA",
709
+ HEDWIG: "HEDWIG",
710
+ MARGARET_MARY: "MARGARET_MARY",
711
+ IGNATIUS_OF_ANTIOCH: "IGNATIUS_OF_ANTIOCH",
712
+ LUKE: "LUKE",
713
+ ISAAC_JOGUES: "ISAAC_JOGUES",
714
+ PAUL_OF_CROSS: "PAUL_OF_CROSS",
715
+ JOHN_PAUL_II: "JOHN_PAUL_II",
716
+ JOHN_OF_CAPISTRANO: "JOHN_OF_CAPISTRANO",
717
+ ANTHONY_MARY_CLARET: "ANTHONY_MARY_CLARET",
718
+ SIMON_JUDE: "SIMON_JUDE",
719
+ // November
720
+ DEDICATION_LATERAN: "DEDICATION_LATERAN",
721
+ LEO_THE_GREAT: "LEO_THE_GREAT",
722
+ MARTIN_OF_TOURS: "MARTIN_OF_TOURS",
723
+ JOSAPHAT: "JOSAPHAT",
724
+ MARGARET_OF_SCOTLAND: "MARGARET_OF_SCOTLAND",
725
+ GERTRUDE: "GERTRUDE",
726
+ ELIZABETH_OF_HUNGARY: "ELIZABETH_OF_HUNGARY",
727
+ DEDICATION_PETER_PAUL: "DEDICATION_PETER_PAUL",
728
+ PRESENTATION_OF_MARY: "PRESENTATION_OF_MARY",
729
+ CLEMENT_I: "CLEMENT_I",
730
+ COLUMBAN: "COLUMBAN",
731
+ CATHERINE_OF_ALEXANDRIA: "CATHERINE_OF_ALEXANDRIA",
732
+ ANDREW_APOSTLE: "ANDREW_APOSTLE",
733
+ // December
734
+ FRANCIS_XAVIER: "FRANCIS_XAVIER",
735
+ LUCY: "LUCY",
736
+ STEPHEN_FIRST_MARTYR: "STEPHEN_FIRST_MARTYR",
737
+ JOHN_APOSTLE: "JOHN_APOSTLE"
738
+ };
739
+
740
+ // src/definitions.ts
741
+ function meta(season, rank, vestmentColor) {
742
+ return { season, rank, vestmentColor };
743
+ }
744
+ var EASTER_CYCLE_EVENTS = [
745
+ {
746
+ key: "EASTER_SUNDAY",
747
+ type: "easter",
748
+ category: "easter-cycle",
749
+ metadata: meta("easter", "solemnity", "white")
750
+ },
751
+ {
752
+ key: "ASH_WEDNESDAY",
753
+ type: "offset",
754
+ category: "easter-cycle",
755
+ offsetDays: -46,
756
+ metadata: meta("lent", "solemnity", "violet")
757
+ },
758
+ {
759
+ key: "PALM_SUNDAY",
760
+ type: "offset",
761
+ category: "easter-cycle",
762
+ offsetDays: -7,
763
+ metadata: meta("lent", "solemnity", "red")
764
+ },
765
+ {
766
+ key: "HOLY_THURSDAY",
767
+ type: "offset",
768
+ category: "easter-cycle",
769
+ offsetDays: -3,
770
+ metadata: meta("lent", "solemnity", "white")
771
+ },
772
+ {
773
+ key: "GOOD_FRIDAY",
774
+ type: "offset",
775
+ category: "easter-cycle",
776
+ offsetDays: -2,
777
+ metadata: meta("lent", "solemnity", "red")
778
+ },
779
+ {
780
+ key: "HOLY_SATURDAY",
781
+ type: "offset",
782
+ category: "easter-cycle",
783
+ offsetDays: -1,
784
+ metadata: meta("lent", "solemnity", "white")
785
+ },
786
+ {
787
+ key: "DIVINE_MERCY_SUNDAY",
788
+ type: "offset",
789
+ category: "easter-cycle",
790
+ offsetDays: 7,
791
+ metadata: meta("easter", "solemnity", "white")
792
+ },
793
+ {
794
+ key: "ASCENSION",
795
+ type: "offset",
796
+ category: "easter-cycle",
797
+ offsetDays: 39,
798
+ // Thursday, can be moved to Sunday (+42)
799
+ metadata: meta("easter", "solemnity", "white")
800
+ },
801
+ {
802
+ key: "PENTECOST",
803
+ type: "offset",
804
+ category: "easter-cycle",
805
+ offsetDays: 49,
806
+ metadata: meta("easter", "solemnity", "red")
807
+ },
808
+ {
809
+ key: "TRINITY_SUNDAY",
810
+ type: "offset",
811
+ category: "easter-cycle",
812
+ offsetDays: 56,
813
+ metadata: meta("ordinary-time-2", "solemnity", "white")
814
+ },
815
+ {
816
+ key: "CORPUS_CHRISTI",
817
+ type: "offset",
818
+ category: "easter-cycle",
819
+ offsetDays: 60,
820
+ // Thursday, usually moved to Sunday (+63)
821
+ metadata: meta("ordinary-time-2", "solemnity", "white")
822
+ },
823
+ {
824
+ key: "SACRED_HEART",
825
+ type: "offset",
826
+ category: "easter-cycle",
827
+ offsetDays: 68,
828
+ // Friday after Corpus Christi
829
+ metadata: meta("ordinary-time-2", "solemnity", "white")
830
+ },
831
+ {
832
+ key: "IMMACULATE_HEART",
833
+ type: "offset",
834
+ category: "easter-cycle",
835
+ offsetDays: 69,
836
+ // Saturday after Sacred Heart
837
+ metadata: meta("ordinary-time-2", "memorial", "white")
838
+ }
839
+ ];
840
+ var FIXED_SOLEMNITY_EVENTS = [
841
+ {
842
+ key: "MARY_MOTHER_OF_GOD",
843
+ type: "const",
844
+ category: "solemnities",
845
+ month: 1,
846
+ day: 1,
847
+ metadata: meta("christmas", "solemnity", "white")
848
+ },
849
+ {
850
+ key: "EPIPHANY",
851
+ type: "const",
852
+ category: "solemnities",
853
+ month: 1,
854
+ day: 6,
855
+ metadata: meta("christmas", "solemnity", "white")
856
+ },
857
+ {
858
+ key: "PRESENTATION",
859
+ type: "const",
860
+ category: "feasts",
861
+ month: 2,
862
+ day: 2,
863
+ metadata: meta("ordinary-time-1", "feast", "white")
864
+ },
865
+ {
866
+ key: "SAINT_JOSEPH",
867
+ type: "const",
868
+ category: "solemnities",
869
+ month: 3,
870
+ day: 19,
871
+ metadata: meta("lent", "solemnity", "white")
872
+ },
873
+ {
874
+ key: "ANNUNCIATION",
875
+ type: "const",
876
+ category: "solemnities",
877
+ month: 3,
878
+ day: 25,
879
+ metadata: meta("lent", "solemnity", "white")
880
+ },
881
+ {
882
+ key: "NATIVITY_OF_JOHN_BAPTIST",
883
+ type: "const",
884
+ category: "solemnities",
885
+ month: 6,
886
+ day: 24,
887
+ metadata: meta("ordinary-time-2", "solemnity", "white")
888
+ },
889
+ {
890
+ key: "PETER_AND_PAUL",
891
+ type: "const",
892
+ category: "solemnities",
893
+ month: 6,
894
+ day: 29,
895
+ metadata: meta("ordinary-time-2", "solemnity", "red")
896
+ },
897
+ {
898
+ key: "TRANSFIGURATION",
899
+ type: "const",
900
+ category: "feasts",
901
+ month: 8,
902
+ day: 6,
903
+ metadata: meta("ordinary-time-2", "feast", "white")
904
+ },
905
+ {
906
+ key: "ASSUMPTION",
907
+ type: "const",
908
+ category: "solemnities",
909
+ month: 8,
910
+ day: 15,
911
+ metadata: meta("ordinary-time-2", "solemnity", "white")
912
+ },
913
+ {
914
+ key: "EXALTATION_OF_CROSS",
915
+ type: "const",
916
+ category: "feasts",
917
+ month: 9,
918
+ day: 14,
919
+ metadata: meta("ordinary-time-2", "feast", "red")
920
+ },
921
+ {
922
+ key: "ALL_SAINTS",
923
+ type: "const",
924
+ category: "solemnities",
925
+ month: 11,
926
+ day: 1,
927
+ metadata: meta("ordinary-time-2", "solemnity", "white")
928
+ },
929
+ {
930
+ key: "ALL_SOULS",
931
+ type: "const",
932
+ category: "solemnities",
933
+ month: 11,
934
+ day: 2,
935
+ metadata: meta("ordinary-time-2", "solemnity", "violet")
936
+ },
937
+ {
938
+ key: "IMMACULATE_CONCEPTION",
939
+ type: "const",
940
+ category: "solemnities",
941
+ month: 12,
942
+ day: 8,
943
+ metadata: meta("advent", "solemnity", "white")
944
+ },
945
+ {
946
+ key: "CHRISTMAS",
947
+ type: "const",
948
+ category: "solemnities",
949
+ month: 12,
950
+ day: 25,
951
+ metadata: meta("christmas", "solemnity", "white")
952
+ },
953
+ {
954
+ key: "HOLY_INNOCENTS",
955
+ type: "const",
956
+ category: "feasts",
957
+ month: 12,
958
+ day: 28,
959
+ metadata: meta("christmas", "feast", "red")
960
+ },
961
+ {
962
+ key: "HOLY_FAMILY",
963
+ type: "nth-weekday",
964
+ category: "solemnities",
965
+ // First Sunday after Dec 25; if Dec 25 itself is Sunday use Dec 30
966
+ dayOfWeek: 0,
967
+ after: { month: 12, day: 26 },
968
+ before: { month: 12, day: 31 },
969
+ fallback: { month: 12, day: 30 },
970
+ metadata: meta("christmas", "feast", "white")
971
+ }
972
+ ];
973
+ var COMPUTED_EVENTS = [
974
+ {
975
+ key: "ADVENT_1",
976
+ type: "formula",
977
+ category: "computed",
978
+ formula: "advent-1",
979
+ metadata: meta("advent", "solemnity", "violet")
980
+ },
981
+ {
982
+ key: "ADVENT_2",
983
+ type: "formula",
984
+ category: "computed",
985
+ formula: "advent-2",
986
+ metadata: meta("advent", "solemnity", "violet")
987
+ },
988
+ {
989
+ key: "ADVENT_3",
990
+ type: "formula",
991
+ category: "computed",
992
+ formula: "advent-3",
993
+ metadata: meta("advent", "solemnity", "rose")
994
+ },
995
+ {
996
+ key: "ADVENT_4",
997
+ type: "formula",
998
+ category: "computed",
999
+ formula: "advent-4",
1000
+ metadata: meta("advent", "solemnity", "violet")
1001
+ },
1002
+ {
1003
+ key: "BAPTISM_OF_LORD",
1004
+ type: "formula",
1005
+ category: "computed",
1006
+ formula: "baptism-of-lord",
1007
+ metadata: meta("christmas", "feast", "white")
1008
+ },
1009
+ {
1010
+ key: "CHRIST_THE_KING",
1011
+ type: "formula",
1012
+ category: "computed",
1013
+ formula: "christ-the-king",
1014
+ metadata: meta("ordinary-time-2", "solemnity", "white")
1015
+ }
1016
+ ];
1017
+ var MEMORIAL_SAINT_EVENTS = [
1018
+ // ===== JANUARY =====
1019
+ {
1020
+ key: "BASIL_GREGORY",
1021
+ type: "const",
1022
+ category: "memorials",
1023
+ month: 1,
1024
+ day: 2,
1025
+ metadata: meta("christmas", "memorial", "white")
1026
+ },
1027
+ {
1028
+ key: "ANTHONY_ABBOT",
1029
+ type: "const",
1030
+ category: "memorials",
1031
+ month: 1,
1032
+ day: 17,
1033
+ metadata: meta("ordinary-time-1", "memorial", "white")
1034
+ },
1035
+ {
1036
+ key: "AGNES",
1037
+ type: "const",
1038
+ category: "memorials",
1039
+ month: 1,
1040
+ day: 21,
1041
+ metadata: meta("ordinary-time-1", "memorial", "red")
1042
+ },
1043
+ {
1044
+ key: "FRANCIS_DE_SALES",
1045
+ type: "const",
1046
+ category: "memorials",
1047
+ month: 1,
1048
+ day: 24,
1049
+ metadata: meta("ordinary-time-1", "memorial", "white")
1050
+ },
1051
+ {
1052
+ key: "TIMOTHY_TITUS",
1053
+ type: "const",
1054
+ category: "memorials",
1055
+ month: 1,
1056
+ day: 26,
1057
+ metadata: meta("ordinary-time-1", "memorial", "white")
1058
+ },
1059
+ {
1060
+ key: "THOMAS_AQUINAS",
1061
+ type: "const",
1062
+ category: "memorials",
1063
+ month: 1,
1064
+ day: 28,
1065
+ metadata: meta("ordinary-time-1", "memorial", "white")
1066
+ },
1067
+ {
1068
+ key: "JOHN_BOSCO",
1069
+ type: "const",
1070
+ category: "memorials",
1071
+ month: 1,
1072
+ day: 31,
1073
+ metadata: meta("ordinary-time-1", "memorial", "white")
1074
+ },
1075
+ // ===== FEBRUARY =====
1076
+ {
1077
+ key: "AGATHA",
1078
+ type: "const",
1079
+ category: "memorials",
1080
+ month: 2,
1081
+ day: 5,
1082
+ metadata: meta("ordinary-time-1", "memorial", "red")
1083
+ },
1084
+ {
1085
+ key: "PAUL_MIKI",
1086
+ type: "const",
1087
+ category: "memorials",
1088
+ month: 2,
1089
+ day: 6,
1090
+ metadata: meta("ordinary-time-1", "memorial", "red")
1091
+ },
1092
+ {
1093
+ key: "SCHOLASTICA",
1094
+ type: "const",
1095
+ category: "memorials",
1096
+ month: 2,
1097
+ day: 10,
1098
+ metadata: meta("ordinary-time-1", "memorial", "white")
1099
+ },
1100
+ {
1101
+ key: "OUR_LADY_OF_LOURDES",
1102
+ type: "const",
1103
+ category: "memorials",
1104
+ month: 2,
1105
+ day: 11,
1106
+ metadata: meta("ordinary-time-1", "memorial", "white")
1107
+ },
1108
+ {
1109
+ key: "CYRIL_METHODIUS",
1110
+ type: "const",
1111
+ category: "memorials",
1112
+ month: 2,
1113
+ day: 14,
1114
+ metadata: meta("ordinary-time-1", "memorial", "white")
1115
+ },
1116
+ {
1117
+ key: "POLYCARP",
1118
+ type: "const",
1119
+ category: "memorials",
1120
+ month: 2,
1121
+ day: 23,
1122
+ metadata: meta("ordinary-time-1", "memorial", "red")
1123
+ },
1124
+ // ===== MARCH =====
1125
+ {
1126
+ key: "PERPETUA_FELICITY",
1127
+ type: "const",
1128
+ category: "memorials",
1129
+ month: 3,
1130
+ day: 7,
1131
+ metadata: meta("lent", "memorial", "red")
1132
+ },
1133
+ {
1134
+ key: "PATRICK",
1135
+ type: "const",
1136
+ category: "memorials",
1137
+ month: 3,
1138
+ day: 17,
1139
+ metadata: meta("lent", "memorial", "white")
1140
+ },
1141
+ {
1142
+ key: "CYRIL_OF_JERUSALEM",
1143
+ type: "const",
1144
+ category: "memorials",
1145
+ month: 3,
1146
+ day: 18,
1147
+ metadata: meta("lent", "memorial", "white")
1148
+ },
1149
+ // ===== APRIL =====
1150
+ {
1151
+ key: "MARTIN_I",
1152
+ type: "const",
1153
+ category: "memorials",
1154
+ month: 4,
1155
+ day: 13,
1156
+ metadata: meta("lent", "memorial", "red")
1157
+ },
1158
+ {
1159
+ key: "ANSELM",
1160
+ type: "const",
1161
+ category: "memorials",
1162
+ month: 4,
1163
+ day: 21,
1164
+ metadata: meta("easter", "memorial", "white")
1165
+ },
1166
+ {
1167
+ key: "GEORGE",
1168
+ type: "const",
1169
+ category: "memorials",
1170
+ month: 4,
1171
+ day: 23,
1172
+ metadata: meta("easter", "memorial", "red")
1173
+ },
1174
+ {
1175
+ key: "ADALBERT",
1176
+ type: "const",
1177
+ category: "memorials",
1178
+ month: 4,
1179
+ day: 23,
1180
+ metadata: meta("easter", "memorial", "red")
1181
+ },
1182
+ {
1183
+ key: "FIDELIS",
1184
+ type: "const",
1185
+ category: "memorials",
1186
+ month: 4,
1187
+ day: 24,
1188
+ metadata: meta("easter", "memorial", "red")
1189
+ },
1190
+ {
1191
+ key: "LOUIS_GRIGNION",
1192
+ type: "const",
1193
+ category: "memorials",
1194
+ month: 4,
1195
+ day: 28,
1196
+ metadata: meta("easter", "memorial", "white")
1197
+ },
1198
+ {
1199
+ key: "PETER_CHANEL",
1200
+ type: "const",
1201
+ category: "memorials",
1202
+ month: 4,
1203
+ day: 28,
1204
+ metadata: meta("easter", "memorial", "red")
1205
+ },
1206
+ {
1207
+ key: "CATHERINE_OF_SIENA",
1208
+ type: "const",
1209
+ category: "memorials",
1210
+ month: 4,
1211
+ day: 29,
1212
+ metadata: meta("easter", "memorial", "white")
1213
+ },
1214
+ {
1215
+ key: "PIUS_V",
1216
+ type: "const",
1217
+ category: "memorials",
1218
+ month: 4,
1219
+ day: 30,
1220
+ metadata: meta("easter", "memorial", "white")
1221
+ },
1222
+ // ===== MAY =====
1223
+ {
1224
+ key: "JOSEPH_WORKER",
1225
+ type: "const",
1226
+ category: "memorials",
1227
+ month: 5,
1228
+ day: 1,
1229
+ metadata: meta("easter", "memorial", "white")
1230
+ },
1231
+ {
1232
+ key: "ATHANASIUS",
1233
+ type: "const",
1234
+ category: "memorials",
1235
+ month: 5,
1236
+ day: 2,
1237
+ metadata: meta("easter", "memorial", "white")
1238
+ },
1239
+ {
1240
+ key: "NEREUS_ACHILLEUS",
1241
+ type: "const",
1242
+ category: "memorials",
1243
+ month: 5,
1244
+ day: 12,
1245
+ metadata: meta("easter", "memorial", "red")
1246
+ },
1247
+ {
1248
+ key: "PANCRAS",
1249
+ type: "const",
1250
+ category: "memorials",
1251
+ month: 5,
1252
+ day: 12,
1253
+ metadata: meta("easter", "memorial", "red")
1254
+ },
1255
+ {
1256
+ key: "OUR_LADY_OF_FATIMA",
1257
+ type: "const",
1258
+ category: "memorials",
1259
+ month: 5,
1260
+ day: 13,
1261
+ metadata: meta("easter", "memorial", "white")
1262
+ },
1263
+ {
1264
+ key: "JOHN_I",
1265
+ type: "const",
1266
+ category: "memorials",
1267
+ month: 5,
1268
+ day: 18,
1269
+ metadata: meta("easter", "memorial", "red")
1270
+ },
1271
+ {
1272
+ key: "BERNARDINE",
1273
+ type: "const",
1274
+ category: "memorials",
1275
+ month: 5,
1276
+ day: 20,
1277
+ metadata: meta("easter", "memorial", "white")
1278
+ },
1279
+ {
1280
+ key: "PHILIP_NERI",
1281
+ type: "const",
1282
+ category: "memorials",
1283
+ month: 5,
1284
+ day: 26,
1285
+ metadata: meta("easter", "memorial", "white")
1286
+ },
1287
+ {
1288
+ key: "AUGUSTINE_OF_CANTERBURY",
1289
+ type: "const",
1290
+ category: "memorials",
1291
+ month: 5,
1292
+ day: 27,
1293
+ metadata: meta("easter", "memorial", "white")
1294
+ },
1295
+ // ===== JUNE =====
1296
+ {
1297
+ key: "JUSTIN",
1298
+ type: "const",
1299
+ category: "memorials",
1300
+ month: 6,
1301
+ day: 1,
1302
+ metadata: meta("ordinary-time-2", "memorial", "red")
1303
+ },
1304
+ {
1305
+ key: "MARCELLINUS_PETER",
1306
+ type: "const",
1307
+ category: "memorials",
1308
+ month: 6,
1309
+ day: 2,
1310
+ metadata: meta("ordinary-time-2", "memorial", "red")
1311
+ },
1312
+ {
1313
+ key: "CHARLES_LWANGA",
1314
+ type: "const",
1315
+ category: "memorials",
1316
+ month: 6,
1317
+ day: 3,
1318
+ metadata: meta("ordinary-time-2", "memorial", "red")
1319
+ },
1320
+ {
1321
+ key: "BONIFACE",
1322
+ type: "const",
1323
+ category: "memorials",
1324
+ month: 6,
1325
+ day: 5,
1326
+ metadata: meta("ordinary-time-2", "memorial", "red")
1327
+ },
1328
+ {
1329
+ key: "NORBERT",
1330
+ type: "const",
1331
+ category: "memorials",
1332
+ month: 6,
1333
+ day: 6,
1334
+ metadata: meta("ordinary-time-2", "memorial", "white")
1335
+ },
1336
+ {
1337
+ key: "EPHREM",
1338
+ type: "const",
1339
+ category: "memorials",
1340
+ month: 6,
1341
+ day: 9,
1342
+ metadata: meta("ordinary-time-2", "memorial", "white")
1343
+ },
1344
+ {
1345
+ key: "BARNABAS",
1346
+ type: "const",
1347
+ category: "memorials",
1348
+ month: 6,
1349
+ day: 11,
1350
+ metadata: meta("ordinary-time-2", "memorial", "red")
1351
+ },
1352
+ {
1353
+ key: "ROMUALD",
1354
+ type: "const",
1355
+ category: "memorials",
1356
+ month: 6,
1357
+ day: 19,
1358
+ metadata: meta("ordinary-time-2", "memorial", "white")
1359
+ },
1360
+ {
1361
+ key: "JOHN_FISHER_THOMAS_MORE",
1362
+ type: "const",
1363
+ category: "memorials",
1364
+ month: 6,
1365
+ day: 22,
1366
+ metadata: meta("ordinary-time-2", "memorial", "red")
1367
+ },
1368
+ {
1369
+ key: "FIRST_MARTYRS_OF_ROME",
1370
+ type: "const",
1371
+ category: "memorials",
1372
+ month: 6,
1373
+ day: 30,
1374
+ metadata: meta("ordinary-time-2", "memorial", "red")
1375
+ },
1376
+ // ===== JULY =====
1377
+ {
1378
+ key: "THOMAS_APOSTLE",
1379
+ type: "const",
1380
+ category: "feasts",
1381
+ month: 7,
1382
+ day: 3,
1383
+ metadata: meta("ordinary-time-2", "feast", "red")
1384
+ },
1385
+ {
1386
+ key: "ELIZABETH_OF_PORTUGAL",
1387
+ type: "const",
1388
+ category: "memorials",
1389
+ month: 7,
1390
+ day: 4,
1391
+ metadata: meta("ordinary-time-2", "memorial", "white")
1392
+ },
1393
+ {
1394
+ key: "MARIA_GORETTI",
1395
+ type: "const",
1396
+ category: "memorials",
1397
+ month: 7,
1398
+ day: 6,
1399
+ metadata: meta("ordinary-time-2", "memorial", "red")
1400
+ },
1401
+ {
1402
+ key: "AUGUSTINE_ZHAO",
1403
+ type: "const",
1404
+ category: "memorials",
1405
+ month: 7,
1406
+ day: 9,
1407
+ metadata: meta("ordinary-time-2", "memorial", "red")
1408
+ },
1409
+ {
1410
+ key: "BENEDICT",
1411
+ type: "const",
1412
+ category: "memorials",
1413
+ month: 7,
1414
+ day: 11,
1415
+ metadata: meta("ordinary-time-2", "memorial", "white")
1416
+ },
1417
+ {
1418
+ key: "HENRY",
1419
+ type: "const",
1420
+ category: "memorials",
1421
+ month: 7,
1422
+ day: 13,
1423
+ metadata: meta("ordinary-time-2", "memorial", "white")
1424
+ },
1425
+ {
1426
+ key: "CAMILLUS",
1427
+ type: "const",
1428
+ category: "memorials",
1429
+ month: 7,
1430
+ day: 14,
1431
+ metadata: meta("ordinary-time-2", "memorial", "white")
1432
+ },
1433
+ {
1434
+ key: "BONAVENTURE",
1435
+ type: "const",
1436
+ category: "memorials",
1437
+ month: 7,
1438
+ day: 15,
1439
+ metadata: meta("ordinary-time-2", "memorial", "white")
1440
+ },
1441
+ {
1442
+ key: "OUR_LADY_OF_MOUNT_CARMEL",
1443
+ type: "const",
1444
+ category: "memorials",
1445
+ month: 7,
1446
+ day: 16,
1447
+ metadata: meta("ordinary-time-2", "memorial", "white")
1448
+ },
1449
+ {
1450
+ key: "APOLLINARIS",
1451
+ type: "const",
1452
+ category: "memorials",
1453
+ month: 7,
1454
+ day: 20,
1455
+ metadata: meta("ordinary-time-2", "memorial", "red")
1456
+ },
1457
+ {
1458
+ key: "LAWRENCE_OF_BRINDISI",
1459
+ type: "const",
1460
+ category: "memorials",
1461
+ month: 7,
1462
+ day: 21,
1463
+ metadata: meta("ordinary-time-2", "memorial", "white")
1464
+ },
1465
+ {
1466
+ key: "MARY_MAGDALENE",
1467
+ type: "const",
1468
+ category: "feasts",
1469
+ month: 7,
1470
+ day: 22,
1471
+ metadata: meta("ordinary-time-2", "feast", "white")
1472
+ },
1473
+ {
1474
+ key: "BRIDGET",
1475
+ type: "const",
1476
+ category: "memorials",
1477
+ month: 7,
1478
+ day: 23,
1479
+ metadata: meta("ordinary-time-2", "memorial", "white")
1480
+ },
1481
+ {
1482
+ key: "SHARBEL",
1483
+ type: "const",
1484
+ category: "memorials",
1485
+ month: 7,
1486
+ day: 24,
1487
+ metadata: meta("ordinary-time-2", "memorial", "white")
1488
+ },
1489
+ {
1490
+ key: "JAMES_APOSTLE",
1491
+ type: "const",
1492
+ category: "feasts",
1493
+ month: 7,
1494
+ day: 25,
1495
+ metadata: meta("ordinary-time-2", "feast", "red")
1496
+ },
1497
+ {
1498
+ key: "MARTHA",
1499
+ type: "const",
1500
+ category: "memorials",
1501
+ month: 7,
1502
+ day: 29,
1503
+ metadata: meta("ordinary-time-2", "memorial", "white")
1504
+ },
1505
+ {
1506
+ key: "PETER_CHRYSOLOGUS",
1507
+ type: "const",
1508
+ category: "memorials",
1509
+ month: 7,
1510
+ day: 30,
1511
+ metadata: meta("ordinary-time-2", "memorial", "white")
1512
+ },
1513
+ {
1514
+ key: "IGNATIUS_OF_LOYOLA",
1515
+ type: "const",
1516
+ category: "memorials",
1517
+ month: 7,
1518
+ day: 31,
1519
+ metadata: meta("ordinary-time-2", "memorial", "white")
1520
+ },
1521
+ // ===== AUGUST =====
1522
+ {
1523
+ key: "ALPHONSUS",
1524
+ type: "const",
1525
+ category: "memorials",
1526
+ month: 8,
1527
+ day: 1,
1528
+ metadata: meta("ordinary-time-2", "memorial", "white")
1529
+ },
1530
+ {
1531
+ key: "JOHN_VIANNEY",
1532
+ type: "const",
1533
+ category: "memorials",
1534
+ month: 8,
1535
+ day: 4,
1536
+ metadata: meta("ordinary-time-2", "memorial", "white")
1537
+ },
1538
+ {
1539
+ key: "DEDICATION_MARY_MAJOR",
1540
+ type: "const",
1541
+ category: "memorials",
1542
+ month: 8,
1543
+ day: 5,
1544
+ metadata: meta("ordinary-time-2", "memorial", "white")
1545
+ },
1546
+ {
1547
+ key: "SIXTUS_II",
1548
+ type: "const",
1549
+ category: "memorials",
1550
+ month: 8,
1551
+ day: 7,
1552
+ metadata: meta("ordinary-time-2", "memorial", "red")
1553
+ },
1554
+ {
1555
+ key: "CAJETAN",
1556
+ type: "const",
1557
+ category: "memorials",
1558
+ month: 8,
1559
+ day: 7,
1560
+ metadata: meta("ordinary-time-2", "memorial", "white")
1561
+ },
1562
+ {
1563
+ key: "DOMINIC",
1564
+ type: "const",
1565
+ category: "memorials",
1566
+ month: 8,
1567
+ day: 8,
1568
+ metadata: meta("ordinary-time-2", "memorial", "white")
1569
+ },
1570
+ {
1571
+ key: "LAWRENCE",
1572
+ type: "const",
1573
+ category: "feasts",
1574
+ month: 8,
1575
+ day: 10,
1576
+ metadata: meta("ordinary-time-2", "feast", "red")
1577
+ },
1578
+ {
1579
+ key: "CLARE",
1580
+ type: "const",
1581
+ category: "memorials",
1582
+ month: 8,
1583
+ day: 11,
1584
+ metadata: meta("ordinary-time-2", "memorial", "white")
1585
+ },
1586
+ {
1587
+ key: "JANE_FRANCES",
1588
+ type: "const",
1589
+ category: "memorials",
1590
+ month: 8,
1591
+ day: 12,
1592
+ metadata: meta("ordinary-time-2", "memorial", "white")
1593
+ },
1594
+ {
1595
+ key: "PONTIAN_HIPPOLYTUS",
1596
+ type: "const",
1597
+ category: "memorials",
1598
+ month: 8,
1599
+ day: 13,
1600
+ metadata: meta("ordinary-time-2", "memorial", "red")
1601
+ },
1602
+ {
1603
+ key: "MAXIMILIAN_KOLBE",
1604
+ type: "const",
1605
+ category: "memorials",
1606
+ month: 8,
1607
+ day: 14,
1608
+ metadata: meta("ordinary-time-2", "memorial", "red")
1609
+ },
1610
+ {
1611
+ key: "JOHN_EUDES",
1612
+ type: "const",
1613
+ category: "memorials",
1614
+ month: 8,
1615
+ day: 19,
1616
+ metadata: meta("ordinary-time-2", "memorial", "white")
1617
+ },
1618
+ {
1619
+ key: "BERNARD",
1620
+ type: "const",
1621
+ category: "memorials",
1622
+ month: 8,
1623
+ day: 20,
1624
+ metadata: meta("ordinary-time-2", "memorial", "white")
1625
+ },
1626
+ {
1627
+ key: "PIUS_X",
1628
+ type: "const",
1629
+ category: "memorials",
1630
+ month: 8,
1631
+ day: 21,
1632
+ metadata: meta("ordinary-time-2", "memorial", "white")
1633
+ },
1634
+ {
1635
+ key: "QUEENSHIP_OF_MARY",
1636
+ type: "const",
1637
+ category: "memorials",
1638
+ month: 8,
1639
+ day: 22,
1640
+ metadata: meta("ordinary-time-2", "memorial", "white")
1641
+ },
1642
+ {
1643
+ key: "BARTHOLOMEW",
1644
+ type: "const",
1645
+ category: "feasts",
1646
+ month: 8,
1647
+ day: 24,
1648
+ metadata: meta("ordinary-time-2", "feast", "red")
1649
+ },
1650
+ {
1651
+ key: "LOUIS_IX",
1652
+ type: "const",
1653
+ category: "memorials",
1654
+ month: 8,
1655
+ day: 25,
1656
+ metadata: meta("ordinary-time-2", "memorial", "white")
1657
+ },
1658
+ {
1659
+ key: "JOSEPH_CALASANZ",
1660
+ type: "const",
1661
+ category: "memorials",
1662
+ month: 8,
1663
+ day: 25,
1664
+ metadata: meta("ordinary-time-2", "memorial", "white")
1665
+ },
1666
+ {
1667
+ key: "MONICA",
1668
+ type: "const",
1669
+ category: "memorials",
1670
+ month: 8,
1671
+ day: 27,
1672
+ metadata: meta("ordinary-time-2", "memorial", "white")
1673
+ },
1674
+ {
1675
+ key: "AUGUSTINE",
1676
+ type: "const",
1677
+ category: "memorials",
1678
+ month: 8,
1679
+ day: 28,
1680
+ metadata: meta("ordinary-time-2", "memorial", "white")
1681
+ },
1682
+ {
1683
+ key: "PASSION_OF_JOHN_BAPTIST",
1684
+ type: "const",
1685
+ category: "memorials",
1686
+ month: 8,
1687
+ day: 29,
1688
+ metadata: meta("ordinary-time-2", "memorial", "red")
1689
+ },
1690
+ // ===== SEPTEMBER =====
1691
+ {
1692
+ key: "GREGORY_THE_GREAT",
1693
+ type: "const",
1694
+ category: "memorials",
1695
+ month: 9,
1696
+ day: 3,
1697
+ metadata: meta("ordinary-time-2", "memorial", "white")
1698
+ },
1699
+ {
1700
+ key: "BIRTH_OF_MARY",
1701
+ type: "const",
1702
+ category: "feasts",
1703
+ month: 9,
1704
+ day: 8,
1705
+ metadata: meta("ordinary-time-2", "feast", "white")
1706
+ },
1707
+ {
1708
+ key: "PETER_CLAVER",
1709
+ type: "const",
1710
+ category: "memorials",
1711
+ month: 9,
1712
+ day: 9,
1713
+ metadata: meta("ordinary-time-2", "memorial", "white")
1714
+ },
1715
+ {
1716
+ key: "MOST_HOLY_NAME_OF_MARY",
1717
+ type: "const",
1718
+ category: "memorials",
1719
+ month: 9,
1720
+ day: 12,
1721
+ metadata: meta("ordinary-time-2", "memorial", "white")
1722
+ },
1723
+ {
1724
+ key: "OUR_LADY_OF_SORROWS",
1725
+ type: "const",
1726
+ category: "memorials",
1727
+ month: 9,
1728
+ day: 15,
1729
+ metadata: meta("ordinary-time-2", "memorial", "white")
1730
+ },
1731
+ {
1732
+ key: "CORNELIUS_CYPRIAN",
1733
+ type: "const",
1734
+ category: "memorials",
1735
+ month: 9,
1736
+ day: 16,
1737
+ metadata: meta("ordinary-time-2", "memorial", "red")
1738
+ },
1739
+ {
1740
+ key: "ROBERT_BELLARMINE",
1741
+ type: "const",
1742
+ category: "memorials",
1743
+ month: 9,
1744
+ day: 17,
1745
+ metadata: meta("ordinary-time-2", "memorial", "white")
1746
+ },
1747
+ {
1748
+ key: "JANUARIUS",
1749
+ type: "const",
1750
+ category: "memorials",
1751
+ month: 9,
1752
+ day: 19,
1753
+ metadata: meta("ordinary-time-2", "memorial", "red")
1754
+ },
1755
+ {
1756
+ key: "MATTHEW",
1757
+ type: "const",
1758
+ category: "feasts",
1759
+ month: 9,
1760
+ day: 21,
1761
+ metadata: meta("ordinary-time-2", "feast", "red")
1762
+ },
1763
+ {
1764
+ key: "PADRE_PIO",
1765
+ type: "const",
1766
+ category: "memorials",
1767
+ month: 9,
1768
+ day: 23,
1769
+ metadata: meta("ordinary-time-2", "memorial", "white")
1770
+ },
1771
+ {
1772
+ key: "COSMAS_DAMIAN",
1773
+ type: "const",
1774
+ category: "memorials",
1775
+ month: 9,
1776
+ day: 26,
1777
+ metadata: meta("ordinary-time-2", "memorial", "red")
1778
+ },
1779
+ {
1780
+ key: "WENCESLAUS",
1781
+ type: "const",
1782
+ category: "memorials",
1783
+ month: 9,
1784
+ day: 28,
1785
+ metadata: meta("ordinary-time-2", "memorial", "red")
1786
+ },
1787
+ {
1788
+ key: "LAWRENCE_RUIZ",
1789
+ type: "const",
1790
+ category: "memorials",
1791
+ month: 9,
1792
+ day: 28,
1793
+ metadata: meta("ordinary-time-2", "memorial", "red")
1794
+ },
1795
+ {
1796
+ key: "ARCHANGELS",
1797
+ type: "const",
1798
+ category: "feasts",
1799
+ month: 9,
1800
+ day: 29,
1801
+ metadata: meta("ordinary-time-2", "feast", "white")
1802
+ },
1803
+ {
1804
+ key: "JEROME",
1805
+ type: "const",
1806
+ category: "memorials",
1807
+ month: 9,
1808
+ day: 30,
1809
+ metadata: meta("ordinary-time-2", "memorial", "white")
1810
+ },
1811
+ // ===== OCTOBER =====
1812
+ {
1813
+ key: "THERESE_OF_LISIEUX",
1814
+ type: "const",
1815
+ category: "memorials",
1816
+ month: 10,
1817
+ day: 1,
1818
+ metadata: meta("ordinary-time-2", "memorial", "white")
1819
+ },
1820
+ {
1821
+ key: "GUARDIAN_ANGELS",
1822
+ type: "const",
1823
+ category: "memorials",
1824
+ month: 10,
1825
+ day: 2,
1826
+ metadata: meta("ordinary-time-2", "memorial", "white")
1827
+ },
1828
+ {
1829
+ key: "FRANCIS_OF_ASSISI",
1830
+ type: "const",
1831
+ category: "memorials",
1832
+ month: 10,
1833
+ day: 4,
1834
+ metadata: meta("ordinary-time-2", "memorial", "white")
1835
+ },
1836
+ {
1837
+ key: "FAUSTINA",
1838
+ type: "const",
1839
+ category: "memorials",
1840
+ month: 10,
1841
+ day: 5,
1842
+ metadata: meta("ordinary-time-2", "memorial", "white")
1843
+ },
1844
+ {
1845
+ key: "BRUNO",
1846
+ type: "const",
1847
+ category: "memorials",
1848
+ month: 10,
1849
+ day: 6,
1850
+ metadata: meta("ordinary-time-2", "memorial", "white")
1851
+ },
1852
+ {
1853
+ key: "OUR_LADY_OF_ROSARY",
1854
+ type: "const",
1855
+ category: "memorials",
1856
+ month: 10,
1857
+ day: 7,
1858
+ metadata: meta("ordinary-time-2", "memorial", "white")
1859
+ },
1860
+ {
1861
+ key: "DENIS",
1862
+ type: "const",
1863
+ category: "memorials",
1864
+ month: 10,
1865
+ day: 9,
1866
+ metadata: meta("ordinary-time-2", "memorial", "red")
1867
+ },
1868
+ {
1869
+ key: "CALLISTUS_I",
1870
+ type: "const",
1871
+ category: "memorials",
1872
+ month: 10,
1873
+ day: 14,
1874
+ metadata: meta("ordinary-time-2", "memorial", "red")
1875
+ },
1876
+ {
1877
+ key: "TERESA_OF_AVILA",
1878
+ type: "const",
1879
+ category: "memorials",
1880
+ month: 10,
1881
+ day: 15,
1882
+ metadata: meta("ordinary-time-2", "memorial", "white")
1883
+ },
1884
+ {
1885
+ key: "HEDWIG",
1886
+ type: "const",
1887
+ category: "memorials",
1888
+ month: 10,
1889
+ day: 16,
1890
+ metadata: meta("ordinary-time-2", "memorial", "white")
1891
+ },
1892
+ {
1893
+ key: "MARGARET_MARY",
1894
+ type: "const",
1895
+ category: "memorials",
1896
+ month: 10,
1897
+ day: 16,
1898
+ metadata: meta("ordinary-time-2", "memorial", "white")
1899
+ },
1900
+ {
1901
+ key: "IGNATIUS_OF_ANTIOCH",
1902
+ type: "const",
1903
+ category: "memorials",
1904
+ month: 10,
1905
+ day: 17,
1906
+ metadata: meta("ordinary-time-2", "memorial", "red")
1907
+ },
1908
+ {
1909
+ key: "LUKE",
1910
+ type: "const",
1911
+ category: "feasts",
1912
+ month: 10,
1913
+ day: 18,
1914
+ metadata: meta("ordinary-time-2", "feast", "red")
1915
+ },
1916
+ {
1917
+ key: "ISAAC_JOGUES",
1918
+ type: "const",
1919
+ category: "memorials",
1920
+ month: 10,
1921
+ day: 19,
1922
+ metadata: meta("ordinary-time-2", "memorial", "red")
1923
+ },
1924
+ {
1925
+ key: "PAUL_OF_CROSS",
1926
+ type: "const",
1927
+ category: "memorials",
1928
+ month: 10,
1929
+ day: 19,
1930
+ metadata: meta("ordinary-time-2", "memorial", "white")
1931
+ },
1932
+ {
1933
+ key: "JOHN_PAUL_II",
1934
+ type: "const",
1935
+ category: "memorials",
1936
+ month: 10,
1937
+ day: 22,
1938
+ metadata: meta("ordinary-time-2", "memorial", "white")
1939
+ },
1940
+ {
1941
+ key: "JOHN_OF_CAPISTRANO",
1942
+ type: "const",
1943
+ category: "memorials",
1944
+ month: 10,
1945
+ day: 23,
1946
+ metadata: meta("ordinary-time-2", "memorial", "white")
1947
+ },
1948
+ {
1949
+ key: "ANTHONY_MARY_CLARET",
1950
+ type: "const",
1951
+ category: "memorials",
1952
+ month: 10,
1953
+ day: 24,
1954
+ metadata: meta("ordinary-time-2", "memorial", "white")
1955
+ },
1956
+ {
1957
+ key: "SIMON_JUDE",
1958
+ type: "const",
1959
+ category: "feasts",
1960
+ month: 10,
1961
+ day: 28,
1962
+ metadata: meta("ordinary-time-2", "feast", "red")
1963
+ },
1964
+ // ===== NOVEMBER =====
1965
+ {
1966
+ key: "DEDICATION_LATERAN",
1967
+ type: "const",
1968
+ category: "feasts",
1969
+ month: 11,
1970
+ day: 9,
1971
+ metadata: meta("ordinary-time-2", "feast", "white")
1972
+ },
1973
+ {
1974
+ key: "LEO_THE_GREAT",
1975
+ type: "const",
1976
+ category: "memorials",
1977
+ month: 11,
1978
+ day: 10,
1979
+ metadata: meta("ordinary-time-2", "memorial", "white")
1980
+ },
1981
+ {
1982
+ key: "MARTIN_OF_TOURS",
1983
+ type: "const",
1984
+ category: "memorials",
1985
+ month: 11,
1986
+ day: 11,
1987
+ metadata: meta("ordinary-time-2", "memorial", "white")
1988
+ },
1989
+ {
1990
+ key: "JOSAPHAT",
1991
+ type: "const",
1992
+ category: "memorials",
1993
+ month: 11,
1994
+ day: 12,
1995
+ metadata: meta("ordinary-time-2", "memorial", "red")
1996
+ },
1997
+ {
1998
+ key: "MARGARET_OF_SCOTLAND",
1999
+ type: "const",
2000
+ category: "memorials",
2001
+ month: 11,
2002
+ day: 16,
2003
+ metadata: meta("ordinary-time-2", "memorial", "white")
2004
+ },
2005
+ {
2006
+ key: "GERTRUDE",
2007
+ type: "const",
2008
+ category: "memorials",
2009
+ month: 11,
2010
+ day: 16,
2011
+ metadata: meta("ordinary-time-2", "memorial", "white")
2012
+ },
2013
+ {
2014
+ key: "ELIZABETH_OF_HUNGARY",
2015
+ type: "const",
2016
+ category: "memorials",
2017
+ month: 11,
2018
+ day: 17,
2019
+ metadata: meta("ordinary-time-2", "memorial", "white")
2020
+ },
2021
+ {
2022
+ key: "DEDICATION_PETER_PAUL",
2023
+ type: "const",
2024
+ category: "memorials",
2025
+ month: 11,
2026
+ day: 18,
2027
+ metadata: meta("ordinary-time-2", "memorial", "white")
2028
+ },
2029
+ {
2030
+ key: "PRESENTATION_OF_MARY",
2031
+ type: "const",
2032
+ category: "memorials",
2033
+ month: 11,
2034
+ day: 21,
2035
+ metadata: meta("ordinary-time-2", "memorial", "white")
2036
+ },
2037
+ {
2038
+ key: "CLEMENT_I",
2039
+ type: "const",
2040
+ category: "memorials",
2041
+ month: 11,
2042
+ day: 23,
2043
+ metadata: meta("ordinary-time-2", "memorial", "red")
2044
+ },
2045
+ {
2046
+ key: "COLUMBAN",
2047
+ type: "const",
2048
+ category: "memorials",
2049
+ month: 11,
2050
+ day: 23,
2051
+ metadata: meta("ordinary-time-2", "memorial", "white")
2052
+ },
2053
+ {
2054
+ key: "CATHERINE_OF_ALEXANDRIA",
2055
+ type: "const",
2056
+ category: "memorials",
2057
+ month: 11,
2058
+ day: 25,
2059
+ metadata: meta("ordinary-time-2", "memorial", "red")
2060
+ },
2061
+ {
2062
+ key: "ANDREW_APOSTLE",
2063
+ type: "const",
2064
+ category: "feasts",
2065
+ month: 11,
2066
+ day: 30,
2067
+ metadata: meta("advent", "feast", "red")
2068
+ },
2069
+ // ===== DECEMBER =====
2070
+ {
2071
+ key: "FRANCIS_XAVIER",
2072
+ type: "const",
2073
+ category: "memorials",
2074
+ month: 12,
2075
+ day: 3,
2076
+ metadata: meta("advent", "memorial", "white")
2077
+ },
2078
+ {
2079
+ key: "LUCY",
2080
+ type: "const",
2081
+ category: "memorials",
2082
+ month: 12,
2083
+ day: 13,
2084
+ metadata: meta("advent", "memorial", "red")
2085
+ },
2086
+ {
2087
+ key: "STEPHEN_FIRST_MARTYR",
2088
+ type: "const",
2089
+ category: "feasts",
2090
+ month: 12,
2091
+ day: 26,
2092
+ metadata: meta("christmas", "feast", "red")
2093
+ },
2094
+ {
2095
+ key: "JOHN_APOSTLE",
2096
+ type: "const",
2097
+ category: "feasts",
2098
+ month: 12,
2099
+ day: 27,
2100
+ metadata: meta("christmas", "feast", "white")
2101
+ }
2102
+ ];
2103
+ var ALL_LITURGICAL_EVENTS = [
2104
+ ...EASTER_CYCLE_EVENTS,
2105
+ ...FIXED_SOLEMNITY_EVENTS,
2106
+ ...COMPUTED_EVENTS,
2107
+ ...MEMORIAL_SAINT_EVENTS
2108
+ ];
2109
+ function getEventsByCategory(categories) {
2110
+ return ALL_LITURGICAL_EVENTS.filter((e) => categories.includes(e.category));
2111
+ }
2112
+
2113
+ // src/presets.ts
2114
+ var EASTER = {
2115
+ type: "easter",
2116
+ id: "easter-sunday",
2117
+ title: "Easter Sunday",
2118
+ categories: ["easter-cycle", "solemnities"],
2119
+ priority: 1,
2120
+ metadata: {
2121
+ season: "easter",
2122
+ rank: "solemnity",
2123
+ vestmentColor: "white"
2124
+ }
2125
+ };
2126
+ var ASH_WEDNESDAY = {
2127
+ type: "offset",
2128
+ id: "ash-wednesday",
2129
+ title: "Ash Wednesday",
2130
+ baseEvent: "easter",
2131
+ offsetDays: -46,
2132
+ categories: ["easter-cycle", "solemnities"],
2133
+ metadata: {
2134
+ season: "lent",
2135
+ rank: "solemnity",
2136
+ vestmentColor: "violet"
2137
+ }
2138
+ };
2139
+ var PALM_SUNDAY = {
2140
+ type: "offset",
2141
+ id: "palm-sunday",
2142
+ title: "Palm Sunday",
2143
+ baseEvent: "easter",
2144
+ offsetDays: -7,
2145
+ categories: ["easter-cycle", "solemnities"],
2146
+ metadata: {
2147
+ season: "lent",
2148
+ rank: "solemnity",
2149
+ vestmentColor: "red"
2150
+ }
2151
+ };
2152
+ var HOLY_THURSDAY = {
2153
+ type: "offset",
2154
+ id: "holy-thursday",
2155
+ title: "Holy Thursday",
2156
+ baseEvent: "easter",
2157
+ offsetDays: -3,
2158
+ categories: ["easter-cycle", "solemnities"],
2159
+ metadata: {
2160
+ season: "lent",
2161
+ rank: "solemnity",
2162
+ vestmentColor: "white"
2163
+ }
2164
+ };
2165
+ var GOOD_FRIDAY = {
2166
+ type: "offset",
2167
+ id: "good-friday",
2168
+ title: "Good Friday",
2169
+ baseEvent: "easter",
2170
+ offsetDays: -2,
2171
+ categories: ["easter-cycle", "solemnities"],
2172
+ metadata: {
2173
+ season: "lent",
2174
+ rank: "solemnity",
2175
+ vestmentColor: "red"
2176
+ }
2177
+ };
2178
+ var HOLY_SATURDAY = {
2179
+ type: "offset",
2180
+ id: "holy-saturday",
2181
+ title: "Holy Saturday",
2182
+ baseEvent: "easter",
2183
+ offsetDays: -1,
2184
+ categories: ["easter-cycle", "solemnities"],
2185
+ metadata: {
2186
+ season: "lent",
2187
+ rank: "solemnity",
2188
+ vestmentColor: "white"
2189
+ }
2190
+ };
2191
+ var ASCENSION = {
2192
+ type: "offset",
2193
+ id: "ascension",
2194
+ title: "Ascension",
2195
+ baseEvent: "easter",
2196
+ offsetDays: 39,
2197
+ categories: ["easter-cycle", "solemnities"],
2198
+ metadata: {
2199
+ season: "easter",
2200
+ rank: "solemnity",
2201
+ vestmentColor: "white"
2202
+ }
2203
+ };
2204
+ var PENTECOST = {
2205
+ type: "offset",
2206
+ id: "pentecost",
2207
+ title: "Pentecost",
2208
+ baseEvent: "easter",
2209
+ offsetDays: 49,
2210
+ categories: ["easter-cycle", "solemnities"],
2211
+ metadata: {
2212
+ season: "easter",
2213
+ rank: "solemnity",
2214
+ vestmentColor: "red"
2215
+ }
2216
+ };
2217
+ var TRINITY_SUNDAY = {
2218
+ type: "offset",
2219
+ id: "trinity-sunday",
2220
+ title: "Trinity Sunday",
2221
+ baseEvent: "easter",
2222
+ offsetDays: 56,
2223
+ categories: ["easter-cycle", "solemnities"],
2224
+ metadata: {
2225
+ season: "ordinary-time-2",
2226
+ rank: "solemnity",
2227
+ vestmentColor: "white"
2228
+ }
2229
+ };
2230
+ var CORPUS_CHRISTI = {
2231
+ type: "offset",
2232
+ id: "corpus-christi",
2233
+ title: "Corpus Christi",
2234
+ baseEvent: "easter",
2235
+ offsetDays: 60,
2236
+ categories: ["easter-cycle", "solemnities"],
2237
+ metadata: {
2238
+ season: "ordinary-time-2",
2239
+ rank: "solemnity",
2240
+ vestmentColor: "white"
2241
+ }
2242
+ };
2243
+ var LITURGICAL_EVENTS = [
2244
+ EASTER,
2245
+ ASH_WEDNESDAY,
2246
+ PALM_SUNDAY,
2247
+ HOLY_THURSDAY,
2248
+ GOOD_FRIDAY,
2249
+ HOLY_SATURDAY,
2250
+ ASCENSION,
2251
+ PENTECOST,
2252
+ TRINITY_SUNDAY,
2253
+ CORPUS_CHRISTI
2254
+ ];
2255
+ var SEASON_VESTMENT_COLORS = {
2256
+ advent: "violet",
2257
+ christmas: "white",
2258
+ "ordinary-time-1": "green",
2259
+ lent: "violet",
2260
+ easter: "white",
2261
+ "ordinary-time-2": "green"
2262
+ };
2263
+ function getSeason(date, options = {}) {
2264
+ const { epiphanyOnSunday = false } = options;
2265
+ const d = typeof date === "string" ? parseDate(date) : date;
2266
+ const liturgicalYear = getLiturgicalYear(d);
2267
+ const day = getLiturgicalDay(d, { epiphanyOnSunday });
2268
+ return {
2269
+ season: day.season,
2270
+ vestmentColor: SEASON_VESTMENT_COLORS[day.season],
2271
+ week: day.week,
2272
+ liturgicalYear
2273
+ };
2274
+ }
2275
+ function getCurrentSeason(options = {}) {
2276
+ return getSeason(/* @__PURE__ */ new Date(), options);
2277
+ }
2278
+ function getLiturgicalYearChart(liturgicalYear, options = {}) {
2279
+ const { epiphanyOnSunday = false } = options;
2280
+ const boundaries = getLiturgicalYearBoundaries(liturgicalYear, epiphanyOnSunday);
2281
+ const nextBoundaries = getLiturgicalYearBoundaries(liturgicalYear + 1, epiphanyOnSunday);
2282
+ const startDate = boundaries.advent1;
2283
+ const endDate = new Date(nextBoundaries.advent1);
2284
+ endDate.setDate(endDate.getDate() - 1);
2285
+ const totalDays = Math.round((endDate.getTime() - startDate.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
2286
+ const holySaturday = new Date(boundaries.easter);
2287
+ holySaturday.setDate(holySaturday.getDate() - 1);
2288
+ const beforeAshWednesday = new Date(boundaries.ashWednesday);
2289
+ beforeAshWednesday.setDate(beforeAshWednesday.getDate() - 1);
2290
+ const beforeNextAdvent = new Date(nextBoundaries.advent1);
2291
+ beforeNextAdvent.setDate(beforeNextAdvent.getDate() - 1);
2292
+ const seasonBoundaries = [
2293
+ {
2294
+ season: "advent",
2295
+ start: boundaries.advent1,
2296
+ end: new Date(boundaries.christmas.getTime() - 24 * 60 * 60 * 1e3)
2297
+ // Dec 24
2298
+ },
2299
+ {
2300
+ season: "christmas",
2301
+ start: boundaries.christmas,
2302
+ end: boundaries.baptismOfLord
2303
+ },
2304
+ {
2305
+ season: "ordinary-time-1",
2306
+ start: new Date(boundaries.baptismOfLord.getTime() + 24 * 60 * 60 * 1e3),
2307
+ // Day after Baptism
2308
+ end: beforeAshWednesday
2309
+ },
2310
+ {
2311
+ season: "lent",
2312
+ start: boundaries.ashWednesday,
2313
+ end: holySaturday
2314
+ },
2315
+ {
2316
+ season: "easter",
2317
+ start: boundaries.easter,
2318
+ end: boundaries.pentecost
2319
+ },
2320
+ {
2321
+ season: "ordinary-time-2",
2322
+ start: new Date(boundaries.pentecost.getTime() + 24 * 60 * 60 * 1e3),
2323
+ // Day after Pentecost
2324
+ end: beforeNextAdvent
2325
+ }
2326
+ ];
2327
+ let cumulativeDays = 0;
2328
+ const segments = seasonBoundaries.map(({ season, start, end }) => {
2329
+ const days = Math.round((end.getTime() - start.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
2330
+ const percentage = days / totalDays * 100;
2331
+ const startAngle = cumulativeDays / totalDays * 360;
2332
+ const endAngle = (cumulativeDays + days) / totalDays * 360;
2333
+ cumulativeDays += days;
2334
+ return {
2335
+ season,
2336
+ vestmentColor: SEASON_VESTMENT_COLORS[season],
2337
+ startDate: formatDate(start),
2338
+ endDate: formatDate(end),
2339
+ days,
2340
+ startAngle,
2341
+ endAngle,
2342
+ percentage
2343
+ };
2344
+ });
2345
+ return {
2346
+ liturgicalYear,
2347
+ calendarYearStart: liturgicalYear - 1,
2348
+ calendarYearEnd: liturgicalYear,
2349
+ startDate: formatDate(startDate),
2350
+ endDate: formatDate(endDate),
2351
+ totalDays,
2352
+ segments
2353
+ };
2354
+ }
2355
+ function getCalendarYearSeasons(calendarYear, options = {}) {
2356
+ const { epiphanyOnSunday = false } = options;
2357
+ const startDate = new Date(calendarYear, 0, 1);
2358
+ const endDate = new Date(calendarYear, 11, 31);
2359
+ const totalDays = 365 + (isLeapYear(calendarYear) ? 1 : 0);
2360
+ const segments = [];
2361
+ const currentDate = new Date(startDate);
2362
+ let currentSeason = null;
2363
+ let segmentStart = null;
2364
+ let cumulativeDays = 0;
2365
+ while (currentDate <= endDate) {
2366
+ const day = getLiturgicalDay(currentDate, { epiphanyOnSunday });
2367
+ if (day.season !== currentSeason) {
2368
+ if (currentSeason !== null && segmentStart !== null) {
2369
+ const prevEnd = new Date(currentDate);
2370
+ prevEnd.setDate(prevEnd.getDate() - 1);
2371
+ const days = Math.round((prevEnd.getTime() - segmentStart.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
2372
+ const percentage = days / totalDays * 100;
2373
+ const startAngle = cumulativeDays / totalDays * 360;
2374
+ cumulativeDays += days;
2375
+ const endAngle = cumulativeDays / totalDays * 360;
2376
+ segments.push({
2377
+ season: currentSeason,
2378
+ vestmentColor: SEASON_VESTMENT_COLORS[currentSeason],
2379
+ startDate: formatDate(segmentStart),
2380
+ endDate: formatDate(prevEnd),
2381
+ days,
2382
+ startAngle,
2383
+ endAngle,
2384
+ percentage
2385
+ });
2386
+ }
2387
+ currentSeason = day.season;
2388
+ segmentStart = new Date(currentDate);
2389
+ }
2390
+ currentDate.setDate(currentDate.getDate() + 1);
2391
+ }
2392
+ if (currentSeason !== null && segmentStart !== null) {
2393
+ const days = Math.round((endDate.getTime() - segmentStart.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
2394
+ const percentage = days / totalDays * 100;
2395
+ const startAngle = cumulativeDays / totalDays * 360;
2396
+ const endAngle = 360;
2397
+ segments.push({
2398
+ season: currentSeason,
2399
+ vestmentColor: SEASON_VESTMENT_COLORS[currentSeason],
2400
+ startDate: formatDate(segmentStart),
2401
+ endDate: formatDate(endDate),
2402
+ days,
2403
+ startAngle,
2404
+ endAngle,
2405
+ percentage
2406
+ });
2407
+ }
2408
+ return segments;
2409
+ }
2410
+ function isLeapYear(year) {
2411
+ return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
2412
+ }
2413
+
2414
+ // src/utils/texts.ts
2415
+ var DEFAULT_LITURGICAL_TEXTS = {
2416
+ // Easter Cycle
2417
+ EASTER_SUNDAY: {
2418
+ title: "Easter Sunday",
2419
+ keywords: ["easter", "resurrection", "paschal"]
2420
+ },
2421
+ ASH_WEDNESDAY: {
2422
+ title: "Ash Wednesday",
2423
+ keywords: ["ash", "lent", "fasting"]
2424
+ },
2425
+ PALM_SUNDAY: {
2426
+ title: "Palm Sunday",
2427
+ keywords: ["palm", "passion", "holy week"]
2428
+ },
2429
+ HOLY_THURSDAY: {
2430
+ title: "Holy Thursday",
2431
+ keywords: ["maundy", "last supper", "holy week"]
2432
+ },
2433
+ GOOD_FRIDAY: {
2434
+ title: "Good Friday",
2435
+ keywords: ["crucifixion", "passion", "holy week"]
2436
+ },
2437
+ HOLY_SATURDAY: {
2438
+ title: "Holy Saturday",
2439
+ keywords: ["vigil", "holy week"]
2440
+ },
2441
+ DIVINE_MERCY_SUNDAY: {
2442
+ title: "Divine Mercy Sunday",
2443
+ keywords: ["divine mercy", "octave of easter"]
2444
+ },
2445
+ ASCENSION: {
2446
+ title: "Ascension",
2447
+ keywords: ["ascension", "heaven"]
2448
+ },
2449
+ PENTECOST: {
2450
+ title: "Pentecost",
2451
+ keywords: ["pentecost", "holy spirit", "tongues of fire"]
2452
+ },
2453
+ TRINITY_SUNDAY: {
2454
+ title: "Trinity Sunday",
2455
+ keywords: ["trinity", "father son spirit"]
2456
+ },
2457
+ CORPUS_CHRISTI: {
2458
+ title: "Corpus Christi",
2459
+ keywords: ["corpus christi", "body of christ", "eucharist"]
2460
+ },
2461
+ SACRED_HEART: {
2462
+ title: "Sacred Heart of Jesus",
2463
+ keywords: ["sacred heart", "heart of jesus"]
2464
+ },
2465
+ IMMACULATE_HEART: {
2466
+ title: "Immaculate Heart of Mary",
2467
+ keywords: ["immaculate heart", "heart of mary"]
2468
+ },
2469
+ // Fixed Solemnities
2470
+ MARY_MOTHER_OF_GOD: {
2471
+ title: "Mary, Mother of God",
2472
+ keywords: ["mary", "mother of god", "theotokos"]
2473
+ },
2474
+ EPIPHANY: {
2475
+ title: "Epiphany",
2476
+ keywords: ["epiphany", "magi", "three kings"]
2477
+ },
2478
+ PRESENTATION: {
2479
+ title: "Presentation of the Lord",
2480
+ keywords: ["presentation", "candlemas", "simeon"]
2481
+ },
2482
+ SAINT_JOSEPH: {
2483
+ title: "Saint Joseph",
2484
+ keywords: ["joseph", "foster father"]
2485
+ },
2486
+ ANNUNCIATION: {
2487
+ title: "Annunciation",
2488
+ keywords: ["annunciation", "gabriel", "mary"]
2489
+ },
2490
+ NATIVITY_OF_JOHN_BAPTIST: {
2491
+ title: "Nativity of John the Baptist",
2492
+ keywords: ["john baptist", "birth"]
2493
+ },
2494
+ PETER_AND_PAUL: {
2495
+ title: "Saints Peter and Paul",
2496
+ keywords: ["peter", "paul", "apostles"]
2497
+ },
2498
+ TRANSFIGURATION: {
2499
+ title: "Transfiguration",
2500
+ keywords: ["transfiguration", "mount tabor"]
2501
+ },
2502
+ ASSUMPTION: {
2503
+ title: "Assumption of Mary",
2504
+ keywords: ["assumption", "mary", "heaven"]
2505
+ },
2506
+ EXALTATION_OF_CROSS: {
2507
+ title: "Exaltation of the Holy Cross",
2508
+ keywords: ["cross", "exaltation", "holy cross"]
2509
+ },
2510
+ ALL_SAINTS: {
2511
+ title: "All Saints",
2512
+ keywords: ["all saints", "saints"]
2513
+ },
2514
+ ALL_SOULS: {
2515
+ title: "All Souls",
2516
+ keywords: ["all souls", "faithful departed", "dead"]
2517
+ },
2518
+ IMMACULATE_CONCEPTION: {
2519
+ title: "Immaculate Conception",
2520
+ keywords: ["immaculate conception", "mary"]
2521
+ },
2522
+ CHRISTMAS: {
2523
+ title: "Christmas",
2524
+ keywords: ["christmas", "nativity", "birth of christ"]
2525
+ },
2526
+ HOLY_INNOCENTS: {
2527
+ title: "Holy Innocents",
2528
+ keywords: ["holy innocents", "martyrs", "herod"]
2529
+ },
2530
+ HOLY_FAMILY: {
2531
+ title: "Holy Family",
2532
+ keywords: ["holy family", "jesus mary joseph"]
2533
+ },
2534
+ // Computed
2535
+ ADVENT_1: {
2536
+ title: "First Sunday of Advent",
2537
+ keywords: ["advent", "first sunday"]
2538
+ },
2539
+ ADVENT_2: {
2540
+ title: "Second Sunday of Advent",
2541
+ keywords: ["advent", "second sunday"]
2542
+ },
2543
+ ADVENT_3: {
2544
+ title: "Third Sunday of Advent",
2545
+ keywords: ["advent", "third sunday", "gaudete"]
2546
+ },
2547
+ ADVENT_4: {
2548
+ title: "Fourth Sunday of Advent",
2549
+ keywords: ["advent", "fourth sunday"]
2550
+ },
2551
+ BAPTISM_OF_LORD: {
2552
+ title: "Baptism of the Lord",
2553
+ keywords: ["baptism", "jordan", "epiphany"]
2554
+ },
2555
+ CHRIST_THE_KING: {
2556
+ title: "Christ the King",
2557
+ keywords: ["christ the king", "king", "reign"]
2558
+ },
2559
+ // ===== MEMORIAL SAINTS =====
2560
+ // January
2561
+ BASIL_GREGORY: {
2562
+ title: "Saints Basil the Great and Gregory Nazianzen",
2563
+ keywords: ["basil", "gregory", "doctors"]
2564
+ },
2565
+ ANTHONY_ABBOT: { title: "Saint Anthony, Abbot", keywords: ["anthony", "abbot", "desert father"] },
2566
+ AGNES: { title: "Saint Agnes, Virgin and Martyr", keywords: ["agnes", "virgin", "martyr"] },
2567
+ FRANCIS_DE_SALES: {
2568
+ title: "Saint Francis de Sales",
2569
+ keywords: ["francis de sales", "doctor", "bishop"]
2570
+ },
2571
+ TIMOTHY_TITUS: { title: "Saints Timothy and Titus", keywords: ["timothy", "titus", "bishops"] },
2572
+ THOMAS_AQUINAS: {
2573
+ title: "Saint Thomas Aquinas",
2574
+ keywords: ["thomas aquinas", "doctor", "angelic"]
2575
+ },
2576
+ JOHN_BOSCO: { title: "Saint John Bosco", keywords: ["john bosco", "don bosco", "salesians"] },
2577
+ // February
2578
+ AGATHA: { title: "Saint Agatha", keywords: ["agatha", "virgin", "martyr"] },
2579
+ PAUL_MIKI: {
2580
+ title: "Saints Paul Miki and Companions",
2581
+ keywords: ["paul miki", "japan", "martyrs"]
2582
+ },
2583
+ SCHOLASTICA: { title: "Saint Scholastica", keywords: ["scholastica", "virgin", "benedict"] },
2584
+ OUR_LADY_OF_LOURDES: {
2585
+ title: "Our Lady of Lourdes",
2586
+ keywords: ["lourdes", "mary", "bernadette"]
2587
+ },
2588
+ CYRIL_METHODIUS: {
2589
+ title: "Saints Cyril and Methodius",
2590
+ keywords: ["cyril", "methodius", "slavs"]
2591
+ },
2592
+ POLYCARP: { title: "Saint Polycarp", keywords: ["polycarp", "bishop", "martyr"] },
2593
+ // March
2594
+ PERPETUA_FELICITY: {
2595
+ title: "Saints Perpetua and Felicity",
2596
+ keywords: ["perpetua", "felicity", "martyrs"]
2597
+ },
2598
+ PATRICK: { title: "Saint Patrick", keywords: ["patrick", "ireland", "bishop"] },
2599
+ CYRIL_OF_JERUSALEM: {
2600
+ title: "Saint Cyril of Jerusalem",
2601
+ keywords: ["cyril", "jerusalem", "doctor"]
2602
+ },
2603
+ // April
2604
+ MARTIN_I: { title: "Saint Martin I", keywords: ["martin", "pope", "martyr"] },
2605
+ ANSELM: { title: "Saint Anselm", keywords: ["anselm", "canterbury", "doctor"] },
2606
+ GEORGE: { title: "Saint George", keywords: ["george", "martyr", "dragon"] },
2607
+ ADALBERT: { title: "Saint Adalbert", keywords: ["adalbert", "bishop", "martyr"] },
2608
+ FIDELIS: { title: "Saint Fidelis of Sigmaringen", keywords: ["fidelis", "martyr", "capuchin"] },
2609
+ LOUIS_GRIGNION: {
2610
+ title: "Saint Louis Grignion de Montfort",
2611
+ keywords: ["louis montfort", "mary"]
2612
+ },
2613
+ PETER_CHANEL: { title: "Saint Peter Chanel", keywords: ["peter chanel", "martyr", "oceania"] },
2614
+ CATHERINE_OF_SIENA: {
2615
+ title: "Saint Catherine of Siena",
2616
+ keywords: ["catherine siena", "doctor", "mystic"]
2617
+ },
2618
+ PIUS_V: { title: "Saint Pius V", keywords: ["pius", "pope", "rosary"] },
2619
+ // May
2620
+ JOSEPH_WORKER: { title: "Saint Joseph the Worker", keywords: ["joseph", "worker", "labor"] },
2621
+ ATHANASIUS: { title: "Saint Athanasius", keywords: ["athanasius", "doctor", "alexandria"] },
2622
+ NEREUS_ACHILLEUS: {
2623
+ title: "Saints Nereus and Achilleus",
2624
+ keywords: ["nereus", "achilleus", "martyrs"]
2625
+ },
2626
+ PANCRAS: { title: "Saint Pancras", keywords: ["pancras", "martyr"] },
2627
+ OUR_LADY_OF_FATIMA: { title: "Our Lady of Fatima", keywords: ["fatima", "mary", "portugal"] },
2628
+ JOHN_I: { title: "Saint John I", keywords: ["john", "pope", "martyr"] },
2629
+ BERNARDINE: { title: "Saint Bernardine of Siena", keywords: ["bernardine", "siena", "preacher"] },
2630
+ PHILIP_NERI: { title: "Saint Philip Neri", keywords: ["philip neri", "oratory", "rome"] },
2631
+ AUGUSTINE_OF_CANTERBURY: {
2632
+ title: "Saint Augustine of Canterbury",
2633
+ keywords: ["augustine", "canterbury", "england"]
2634
+ },
2635
+ // June
2636
+ JUSTIN: { title: "Saint Justin Martyr", keywords: ["justin", "martyr", "philosopher"] },
2637
+ MARCELLINUS_PETER: {
2638
+ title: "Saints Marcellinus and Peter",
2639
+ keywords: ["marcellinus", "peter", "martyrs"]
2640
+ },
2641
+ CHARLES_LWANGA: {
2642
+ title: "Saints Charles Lwanga and Companions",
2643
+ keywords: ["charles lwanga", "uganda", "martyrs"]
2644
+ },
2645
+ BONIFACE: { title: "Saint Boniface", keywords: ["boniface", "germany", "martyr"] },
2646
+ NORBERT: { title: "Saint Norbert", keywords: ["norbert", "premonstratensians"] },
2647
+ EPHREM: { title: "Saint Ephrem", keywords: ["ephrem", "syria", "doctor"] },
2648
+ BARNABAS: { title: "Saint Barnabas", keywords: ["barnabas", "apostle", "cyprus"] },
2649
+ ROMUALD: { title: "Saint Romuald", keywords: ["romuald", "camaldolese"] },
2650
+ JOHN_FISHER_THOMAS_MORE: {
2651
+ title: "Saints John Fisher and Thomas More",
2652
+ keywords: ["john fisher", "thomas more", "martyrs", "england"]
2653
+ },
2654
+ FIRST_MARTYRS_OF_ROME: {
2655
+ title: "First Martyrs of the Holy Roman Church",
2656
+ keywords: ["martyrs", "rome", "nero"]
2657
+ },
2658
+ // July
2659
+ THOMAS_APOSTLE: { title: "Saint Thomas, Apostle", keywords: ["thomas", "apostle", "doubting"] },
2660
+ ELIZABETH_OF_PORTUGAL: {
2661
+ title: "Saint Elizabeth of Portugal",
2662
+ keywords: ["elizabeth", "portugal", "queen"]
2663
+ },
2664
+ MARIA_GORETTI: { title: "Saint Maria Goretti", keywords: ["maria goretti", "virgin", "martyr"] },
2665
+ AUGUSTINE_ZHAO: {
2666
+ title: "Saints Augustine Zhao Rong and Companions",
2667
+ keywords: ["augustine zhao", "china", "martyrs"]
2668
+ },
2669
+ BENEDICT: { title: "Saint Benedict", keywords: ["benedict", "monks", "nursia"] },
2670
+ HENRY: { title: "Saint Henry", keywords: ["henry", "emperor"] },
2671
+ CAMILLUS: { title: "Saint Camillus de Lellis", keywords: ["camillus", "sick", "nurses"] },
2672
+ BONAVENTURE: { title: "Saint Bonaventure", keywords: ["bonaventure", "doctor", "franciscan"] },
2673
+ OUR_LADY_OF_MOUNT_CARMEL: {
2674
+ title: "Our Lady of Mount Carmel",
2675
+ keywords: ["carmel", "mary", "scapular"]
2676
+ },
2677
+ APOLLINARIS: { title: "Saint Apollinaris", keywords: ["apollinaris", "ravenna", "martyr"] },
2678
+ LAWRENCE_OF_BRINDISI: {
2679
+ title: "Saint Lawrence of Brindisi",
2680
+ keywords: ["lawrence brindisi", "doctor", "capuchin"]
2681
+ },
2682
+ MARY_MAGDALENE: {
2683
+ title: "Saint Mary Magdalene",
2684
+ keywords: ["mary magdalene", "apostle to apostles"]
2685
+ },
2686
+ BRIDGET: { title: "Saint Bridget", keywords: ["bridget", "sweden", "mystic"] },
2687
+ SHARBEL: { title: "Saint Sharbel Makhluf", keywords: ["sharbel", "lebanon", "hermit"] },
2688
+ JAMES_APOSTLE: { title: "Saint James, Apostle", keywords: ["james", "apostle", "compostela"] },
2689
+ MARTHA: { title: "Saint Martha", keywords: ["martha", "bethany"] },
2690
+ PETER_CHRYSOLOGUS: {
2691
+ title: "Saint Peter Chrysologus",
2692
+ keywords: ["peter chrysologus", "doctor", "ravenna"]
2693
+ },
2694
+ IGNATIUS_OF_LOYOLA: {
2695
+ title: "Saint Ignatius of Loyola",
2696
+ keywords: ["ignatius", "loyola", "jesuits"]
2697
+ },
2698
+ // August
2699
+ ALPHONSUS: {
2700
+ title: "Saint Alphonsus Liguori",
2701
+ keywords: ["alphonsus", "liguori", "doctor", "redemptorists"]
2702
+ },
2703
+ JOHN_VIANNEY: {
2704
+ title: "Saint John Vianney",
2705
+ keywords: ["john vianney", "cure of ars", "priest"]
2706
+ },
2707
+ DEDICATION_MARY_MAJOR: {
2708
+ title: "Dedication of the Basilica of Saint Mary Major",
2709
+ keywords: ["mary major", "basilica", "rome"]
2710
+ },
2711
+ SIXTUS_II: { title: "Saint Sixtus II and Companions", keywords: ["sixtus", "pope", "martyrs"] },
2712
+ CAJETAN: { title: "Saint Cajetan", keywords: ["cajetan", "theatines"] },
2713
+ DOMINIC: { title: "Saint Dominic", keywords: ["dominic", "dominicans", "preacher"] },
2714
+ LAWRENCE: {
2715
+ title: "Saint Lawrence, Deacon and Martyr",
2716
+ keywords: ["lawrence", "deacon", "martyr"]
2717
+ },
2718
+ CLARE: { title: "Saint Clare", keywords: ["clare", "assisi", "poor clares"] },
2719
+ JANE_FRANCES: {
2720
+ title: "Saint Jane Frances de Chantal",
2721
+ keywords: ["jane frances", "chantal", "visitation"]
2722
+ },
2723
+ PONTIAN_HIPPOLYTUS: {
2724
+ title: "Saints Pontian and Hippolytus",
2725
+ keywords: ["pontian", "hippolytus", "martyrs"]
2726
+ },
2727
+ MAXIMILIAN_KOLBE: {
2728
+ title: "Saint Maximilian Kolbe",
2729
+ keywords: ["maximilian kolbe", "auschwitz", "martyr"]
2730
+ },
2731
+ JOHN_EUDES: { title: "Saint John Eudes", keywords: ["john eudes", "hearts"] },
2732
+ BERNARD: { title: "Saint Bernard", keywords: ["bernard", "clairvaux", "doctor"] },
2733
+ PIUS_X: { title: "Saint Pius X", keywords: ["pius", "pope", "eucharist"] },
2734
+ QUEENSHIP_OF_MARY: {
2735
+ title: "Queenship of the Blessed Virgin Mary",
2736
+ keywords: ["queenship", "mary", "queen"]
2737
+ },
2738
+ BARTHOLOMEW: {
2739
+ title: "Saint Bartholomew, Apostle",
2740
+ keywords: ["bartholomew", "apostle", "nathanael"]
2741
+ },
2742
+ LOUIS_IX: { title: "Saint Louis IX", keywords: ["louis", "france", "king"] },
2743
+ JOSEPH_CALASANZ: {
2744
+ title: "Saint Joseph Calasanz",
2745
+ keywords: ["joseph calasanz", "piarists", "schools"]
2746
+ },
2747
+ MONICA: { title: "Saint Monica", keywords: ["monica", "augustine", "mother"] },
2748
+ AUGUSTINE: { title: "Saint Augustine", keywords: ["augustine", "hippo", "doctor"] },
2749
+ PASSION_OF_JOHN_BAPTIST: {
2750
+ title: "Passion of Saint John the Baptist",
2751
+ keywords: ["john baptist", "beheading", "martyr"]
2752
+ },
2753
+ // September
2754
+ GREGORY_THE_GREAT: { title: "Saint Gregory the Great", keywords: ["gregory", "pope", "doctor"] },
2755
+ BIRTH_OF_MARY: {
2756
+ title: "Nativity of the Blessed Virgin Mary",
2757
+ keywords: ["birth", "mary", "nativity"]
2758
+ },
2759
+ PETER_CLAVER: { title: "Saint Peter Claver", keywords: ["peter claver", "slaves", "jesuit"] },
2760
+ MOST_HOLY_NAME_OF_MARY: { title: "Most Holy Name of Mary", keywords: ["name", "mary"] },
2761
+ OUR_LADY_OF_SORROWS: {
2762
+ title: "Our Lady of Sorrows",
2763
+ keywords: ["sorrows", "mary", "seven sorrows"]
2764
+ },
2765
+ CORNELIUS_CYPRIAN: {
2766
+ title: "Saints Cornelius and Cyprian",
2767
+ keywords: ["cornelius", "cyprian", "martyrs"]
2768
+ },
2769
+ ROBERT_BELLARMINE: {
2770
+ title: "Saint Robert Bellarmine",
2771
+ keywords: ["robert bellarmine", "doctor", "jesuit"]
2772
+ },
2773
+ JANUARIUS: { title: "Saint Januarius", keywords: ["januarius", "naples", "martyr"] },
2774
+ MATTHEW: {
2775
+ title: "Saint Matthew, Apostle and Evangelist",
2776
+ keywords: ["matthew", "apostle", "evangelist"]
2777
+ },
2778
+ PADRE_PIO: {
2779
+ title: "Saint Padre Pio of Pietrelcina",
2780
+ keywords: ["padre pio", "stigmata", "capuchin"]
2781
+ },
2782
+ COSMAS_DAMIAN: {
2783
+ title: "Saints Cosmas and Damian",
2784
+ keywords: ["cosmas", "damian", "martyrs", "physicians"]
2785
+ },
2786
+ WENCESLAUS: { title: "Saint Wenceslaus", keywords: ["wenceslaus", "bohemia", "martyr"] },
2787
+ LAWRENCE_RUIZ: {
2788
+ title: "Saints Lawrence Ruiz and Companions",
2789
+ keywords: ["lawrence ruiz", "philippines", "martyrs"]
2790
+ },
2791
+ ARCHANGELS: {
2792
+ title: "Saints Michael, Gabriel, and Raphael, Archangels",
2793
+ keywords: ["michael", "gabriel", "raphael", "archangels"]
2794
+ },
2795
+ JEROME: { title: "Saint Jerome", keywords: ["jerome", "doctor", "bible", "vulgate"] },
2796
+ // October
2797
+ THERESE_OF_LISIEUX: {
2798
+ title: "Saint Therese of the Child Jesus",
2799
+ keywords: ["therese", "lisieux", "little flower", "doctor"]
2800
+ },
2801
+ GUARDIAN_ANGELS: { title: "Holy Guardian Angels", keywords: ["guardian angels", "angels"] },
2802
+ FRANCIS_OF_ASSISI: {
2803
+ title: "Saint Francis of Assisi",
2804
+ keywords: ["francis", "assisi", "franciscans"]
2805
+ },
2806
+ FAUSTINA: { title: "Saint Faustina Kowalska", keywords: ["faustina", "divine mercy"] },
2807
+ BRUNO: { title: "Saint Bruno", keywords: ["bruno", "carthusians"] },
2808
+ OUR_LADY_OF_ROSARY: { title: "Our Lady of the Rosary", keywords: ["rosary", "mary", "lepanto"] },
2809
+ DENIS: { title: "Saint Denis and Companions", keywords: ["denis", "paris", "martyrs"] },
2810
+ CALLISTUS_I: { title: "Saint Callistus I", keywords: ["callistus", "pope", "martyr"] },
2811
+ TERESA_OF_AVILA: {
2812
+ title: "Saint Teresa of Avila",
2813
+ keywords: ["teresa", "avila", "doctor", "carmelite"]
2814
+ },
2815
+ HEDWIG: { title: "Saint Hedwig", keywords: ["hedwig", "silesia"] },
2816
+ MARGARET_MARY: {
2817
+ title: "Saint Margaret Mary Alacoque",
2818
+ keywords: ["margaret mary", "sacred heart"]
2819
+ },
2820
+ IGNATIUS_OF_ANTIOCH: {
2821
+ title: "Saint Ignatius of Antioch",
2822
+ keywords: ["ignatius", "antioch", "martyr"]
2823
+ },
2824
+ LUKE: { title: "Saint Luke, Evangelist", keywords: ["luke", "evangelist", "physician"] },
2825
+ ISAAC_JOGUES: {
2826
+ title: "Saints Isaac Jogues and Companions",
2827
+ keywords: ["isaac jogues", "north america", "martyrs"]
2828
+ },
2829
+ PAUL_OF_CROSS: { title: "Saint Paul of the Cross", keywords: ["paul cross", "passionists"] },
2830
+ JOHN_PAUL_II: { title: "Saint John Paul II", keywords: ["john paul", "pope", "poland"] },
2831
+ JOHN_OF_CAPISTRANO: {
2832
+ title: "Saint John of Capistrano",
2833
+ keywords: ["john capistrano", "franciscan"]
2834
+ },
2835
+ ANTHONY_MARY_CLARET: {
2836
+ title: "Saint Anthony Mary Claret",
2837
+ keywords: ["anthony claret", "claretians"]
2838
+ },
2839
+ SIMON_JUDE: { title: "Saints Simon and Jude, Apostles", keywords: ["simon", "jude", "apostles"] },
2840
+ // November
2841
+ DEDICATION_LATERAN: {
2842
+ title: "Dedication of the Lateran Basilica",
2843
+ keywords: ["lateran", "basilica", "rome"]
2844
+ },
2845
+ LEO_THE_GREAT: { title: "Saint Leo the Great", keywords: ["leo", "pope", "doctor"] },
2846
+ MARTIN_OF_TOURS: { title: "Saint Martin of Tours", keywords: ["martin", "tours", "cloak"] },
2847
+ JOSAPHAT: { title: "Saint Josaphat", keywords: ["josaphat", "bishop", "martyr"] },
2848
+ MARGARET_OF_SCOTLAND: {
2849
+ title: "Saint Margaret of Scotland",
2850
+ keywords: ["margaret", "scotland", "queen"]
2851
+ },
2852
+ GERTRUDE: { title: "Saint Gertrude", keywords: ["gertrude", "mystic"] },
2853
+ ELIZABETH_OF_HUNGARY: {
2854
+ title: "Saint Elizabeth of Hungary",
2855
+ keywords: ["elizabeth", "hungary", "charity"]
2856
+ },
2857
+ DEDICATION_PETER_PAUL: {
2858
+ title: "Dedication of the Basilicas of Saints Peter and Paul",
2859
+ keywords: ["peter", "paul", "basilicas", "rome"]
2860
+ },
2861
+ PRESENTATION_OF_MARY: {
2862
+ title: "Presentation of the Blessed Virgin Mary",
2863
+ keywords: ["presentation", "mary", "temple"]
2864
+ },
2865
+ CLEMENT_I: { title: "Saint Clement I", keywords: ["clement", "pope", "martyr"] },
2866
+ COLUMBAN: { title: "Saint Columban", keywords: ["columban", "ireland", "missionary"] },
2867
+ CATHERINE_OF_ALEXANDRIA: {
2868
+ title: "Saint Catherine of Alexandria",
2869
+ keywords: ["catherine", "alexandria", "martyr"]
2870
+ },
2871
+ ANDREW_APOSTLE: { title: "Saint Andrew, Apostle", keywords: ["andrew", "apostle", "scotland"] },
2872
+ // December
2873
+ FRANCIS_XAVIER: {
2874
+ title: "Saint Francis Xavier",
2875
+ keywords: ["francis xavier", "jesuit", "missions"]
2876
+ },
2877
+ LUCY: { title: "Saint Lucy", keywords: ["lucy", "virgin", "martyr", "light"] },
2878
+ STEPHEN_FIRST_MARTYR: {
2879
+ title: "Saint Stephen, First Martyr",
2880
+ keywords: ["stephen", "first martyr", "deacon"]
2881
+ },
2882
+ JOHN_APOSTLE: {
2883
+ title: "Saint John, Apostle and Evangelist",
2884
+ keywords: ["john", "apostle", "evangelist", "beloved"]
2885
+ }
2886
+ };
2887
+
2888
+ // src/utils/generator.ts
2889
+ function getYearsInRange(range) {
2890
+ const startYear = getYear(range.from);
2891
+ const endYear = getYear(range.to);
2892
+ const years = [];
2893
+ for (let y = startYear; y <= endYear; y++) {
2894
+ years.push(y);
2895
+ }
2896
+ return years;
2897
+ }
2898
+ function computeEventDate(def, year, options) {
2899
+ switch (def.type) {
2900
+ case "easter": {
2901
+ const easter = computeEaster(year);
2902
+ return formatDate(easter);
2903
+ }
2904
+ case "offset": {
2905
+ let offsetDays = def.offsetDays;
2906
+ if (def.key === "ASCENSION" && options.ascensionOnSunday) {
2907
+ offsetDays = 42;
2908
+ }
2909
+ if (def.key === "CORPUS_CHRISTI" && options.corpusChristiOnSunday) {
2910
+ offsetDays = 63;
2911
+ }
2912
+ const easter = computeEaster(year);
2913
+ const eventDate = addDays(easter, offsetDays);
2914
+ return formatDate(eventDate);
2915
+ }
2916
+ case "const": {
2917
+ if (def.month && def.day) {
2918
+ const month = String(def.month).padStart(2, "0");
2919
+ const day = String(def.day).padStart(2, "0");
2920
+ return `${year}-${month}-${day}`;
2921
+ }
2922
+ return null;
2923
+ }
2924
+ case "nth-weekday": {
2925
+ return computeNthWeekdayDate(def, year);
2926
+ }
2927
+ case "formula":
2928
+ return null;
2929
+ /* v8 ignore next 2 -- defensive: def.type is an exhaustive union (no other case) */
2930
+ default:
2931
+ return null;
2932
+ }
2933
+ }
2934
+ function computeNthWeekdayDate(def, year) {
2935
+ const dayOfWeek = def.dayOfWeek;
2936
+ if (dayOfWeek === void 0) return null;
2937
+ if (def.after !== void 0) {
2938
+ const candidate = firstWeekdayOnOrAfterAnchor(year, def.after, dayOfWeek);
2939
+ if (def.before !== void 0) {
2940
+ const beforeDate = new Date(year, def.before.month - 1, def.before.day);
2941
+ if (candidate === null || candidate >= beforeDate) {
2942
+ if (def.fallback !== void 0) {
2943
+ const m2 = String(def.fallback.month).padStart(2, "0");
2944
+ const d2 = String(def.fallback.day).padStart(2, "0");
2945
+ return `${year}-${m2}-${d2}`;
2946
+ }
2947
+ return null;
2948
+ }
2949
+ }
2950
+ if (candidate === null) return null;
2951
+ const m = String(candidate.getMonth() + 1).padStart(2, "0");
2952
+ const d = String(candidate.getDate()).padStart(2, "0");
2953
+ return `${year}-${m}-${d}`;
2954
+ }
2955
+ if (def.nth !== void 0 && def.nthMonth !== void 0) {
2956
+ const date = nthWeekdayInMonth(year, def.nthMonth, dayOfWeek, def.nth);
2957
+ if (!date) return null;
2958
+ const m = String(date.getMonth() + 1).padStart(2, "0");
2959
+ const d = String(date.getDate()).padStart(2, "0");
2960
+ return `${year}-${m}-${d}`;
2961
+ }
2962
+ return null;
2963
+ }
2964
+ function firstWeekdayOnOrAfterAnchor(year, anchor, dayOfWeek) {
2965
+ for (let offset = 0; offset <= 6; offset++) {
2966
+ const date = new Date(year, anchor.month - 1, anchor.day + offset);
2967
+ if (date.getDay() === dayOfWeek) return date;
2968
+ }
2969
+ return null;
2970
+ }
2971
+ function nthWeekdayInMonth(year, month, dayOfWeek, nth) {
2972
+ if (nth === -1) {
2973
+ const daysInMonth2 = new Date(year, month, 0).getDate();
2974
+ for (let d = daysInMonth2; d >= 1; d--) {
2975
+ const date = new Date(year, month - 1, d);
2976
+ if (date.getDay() === dayOfWeek) return date;
2977
+ }
2978
+ return null;
2979
+ }
2980
+ let count = 0;
2981
+ const daysInMonth = new Date(year, month, 0).getDate();
2982
+ for (let d = 1; d <= daysInMonth; d++) {
2983
+ const date = new Date(year, month - 1, d);
2984
+ if (date.getDay() === dayOfWeek) {
2985
+ count++;
2986
+ if (count === nth) return date;
2987
+ }
2988
+ }
2989
+ return null;
2990
+ }
2991
+ function buildEventConfig(def, options) {
2992
+ const key = def.key;
2993
+ const defaultText = DEFAULT_LITURGICAL_TEXTS[key] ?? { title: def.key };
2994
+ const customConfig = options.customResolver?.(key);
2995
+ const baseConfig = {
2996
+ id: def.key.toLowerCase().replace(/_/g, "-"),
2997
+ title: defaultText.title,
2998
+ metadata: def.metadata,
2999
+ priority: def.metadata.rank === "solemnity" ? 1 : def.metadata.rank === "feast" ? 2 : 3
3000
+ };
3001
+ if (defaultText.keywords && defaultText.keywords.length > 0) {
3002
+ baseConfig.keywords = defaultText.keywords;
3003
+ }
3004
+ const mergedConfig = mergeEventConfig(baseConfig, customConfig);
3005
+ switch (def.type) {
3006
+ case "easter":
3007
+ return { ...mergedConfig, type: "easter" };
3008
+ case "offset": {
3009
+ let offsetDays = def.offsetDays;
3010
+ if (def.key === "ASCENSION" && options.ascensionOnSunday) {
3011
+ offsetDays = 42;
3012
+ }
3013
+ if (def.key === "CORPUS_CHRISTI" && options.corpusChristiOnSunday) {
3014
+ offsetDays = 63;
3015
+ }
3016
+ return {
3017
+ ...mergedConfig,
3018
+ type: "offset",
3019
+ baseEvent: "easter",
3020
+ offsetDays
3021
+ };
3022
+ }
3023
+ case "const":
3024
+ return {
3025
+ ...mergedConfig,
3026
+ type: "const",
3027
+ month: def.month,
3028
+ day: def.day
3029
+ };
3030
+ case "nth-weekday":
3031
+ return {
3032
+ ...mergedConfig,
3033
+ type: "nth-weekday",
3034
+ dayOfWeek: def.dayOfWeek,
3035
+ nth: def.nth,
3036
+ month: def.nthMonth,
3037
+ after: def.after,
3038
+ before: def.before,
3039
+ fallback: def.fallback
3040
+ };
3041
+ case "formula":
3042
+ return {
3043
+ ...mergedConfig,
3044
+ type: "formula",
3045
+ formula: def.formula
3046
+ };
3047
+ /* v8 ignore start -- defensive: def.type is an exhaustive union, no unknown type reaches here */
3048
+ default:
3049
+ return { ...mergedConfig, type: "const", month: 1, day: 1 };
3050
+ }
3051
+ }
3052
+ var DEFAULT_OPTIONS = {
3053
+ epiphanyOnSunday: false,
3054
+ ascensionOnSunday: false,
3055
+ corpusChristiOnSunday: true,
3056
+ includeCategories: ["easter-cycle", "solemnities", "feasts", "memorials", "computed"],
3057
+ groupId: "liturgical-calendar"
3058
+ };
3059
+ function generateLiturgicalEvents(options) {
3060
+ const mergedOptions = { ...DEFAULT_OPTIONS, ...options };
3061
+ const range = mergedOptions.range;
3062
+ const years = getYearsInRange(range);
3063
+ const allEvents = [];
3064
+ const categories = mergedOptions.includeCategories;
3065
+ const eventDefs = getEventsByCategory(categories);
3066
+ for (const def of eventDefs) {
3067
+ const eventConfig = buildEventConfig(def, mergedOptions);
3068
+ let shouldDrop = false;
3069
+ const onConflict = "onConflict" in eventConfig ? eventConfig.onConflict : void 0;
3070
+ if (onConflict) {
3071
+ for (const year of years) {
3072
+ const eventDate = computeEventDate(def, year, mergedOptions);
3073
+ if (eventDate) {
3074
+ const conflictAction = resolveConflict(onConflict, eventDate);
3075
+ if (conflictAction.action === "drop") {
3076
+ shouldDrop = true;
3077
+ break;
3078
+ }
3079
+ }
3080
+ }
3081
+ }
3082
+ if (!shouldDrop) {
3083
+ allEvents.push(eventConfig);
3084
+ }
3085
+ }
3086
+ return {
3087
+ id: mergedOptions.groupId,
3088
+ events: allEvents
3089
+ };
3090
+ }
3091
+ function createLiturgicalGenerator(generatorOptions = {}) {
3092
+ const { defaults } = generatorOptions;
3093
+ return (options) => {
3094
+ const mergedOptions = { ...defaults, ...options };
3095
+ return generateLiturgicalEvents(mergedOptions);
3096
+ };
3097
+ }
3098
+
3099
+ export { ALL_LITURGICAL_EVENTS, ALL_MASS_KEYS, ASCENSION, ASH_WEDNESDAY, COMPUTED_EVENTS, COMPUTED_KEYS, CORPUS_CHRISTI, DEFAULT_LITURGICAL_TEXTS, EASTER, EASTER_CYCLE_EVENTS, EASTER_CYCLE_KEYS, FIXED_SOLEMNITY_EVENTS, FIXED_SOLEMNITY_KEYS, GOOD_FRIDAY, HOLY_SATURDAY, HOLY_THURSDAY, LITURGICAL_EVENTS, MEMORIAL_SAINT_EVENTS, MEMORIAL_SAINT_KEYS, MassKeys, PALM_SUNDAY, PENTECOST, TRINITY_SUNDAY, computeEaster, computeOrthodoxEaster, createLiturgicalGenerator, easterEventHandler, easterRelativeDate, generateLiturgicalEvents, getAdvent1, getAdvent2, getAdvent3, getAdvent4, getBaptismOfLord, getCalendarYearSeasons, getChristTheKing, getCurrentSeason, getEasterDateString, getEventsByCategory, getHolyFamily, getLiturgicalDay, getLiturgicalDaysForMonth, getLiturgicalDaysForYear, getLiturgicalDaysInRange, getLiturgicalYear, getLiturgicalYearBoundaries, getLiturgicalYearChart, getSeason, liturgical, offsetEventHandler };