kaabalah 2.1.3 → 3.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.
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ // src/ifa/index.ts
4
+ function calculateOdu(date) {
5
+ const day = date.getDate().toString().padStart(2, "0");
6
+ const month = (date.getMonth() + 1).toString().padStart(2, "0");
7
+ const year = date.getFullYear().toString();
8
+ const leftNumbers = [
9
+ parseInt(day[0]),
10
+ // First digit of day
11
+ parseInt(month[0]),
12
+ // First digit of month
13
+ parseInt(year[0]),
14
+ // First digit of year
15
+ parseInt(year[2])
16
+ // Third digit of year
17
+ ];
18
+ const rightNumbers = [
19
+ parseInt(day[1]),
20
+ // Second digit of day
21
+ parseInt(month[1]),
22
+ // Second digit of month
23
+ parseInt(year[1]),
24
+ // Second digit of year
25
+ parseInt(year[3])
26
+ // Fourth digit of year
27
+ ];
28
+ function reduceNumber(num) {
29
+ if (num <= 16) return num;
30
+ return reduceNumber(num.toString().split("").reduce((a, b) => a + parseInt(b), 0));
31
+ }
32
+ const rawLeftSum = leftNumbers.reduce((a, b) => a + b, 0);
33
+ const rawRightSum = rightNumbers.reduce((a, b) => a + b, 0);
34
+ const north = reduceNumber(rawLeftSum);
35
+ const south = reduceNumber(rawRightSum);
36
+ const east = reduceNumber(north + south);
37
+ const west = reduceNumber(north + south + east);
38
+ const center = reduceNumber(north + south + east + west);
39
+ return {
40
+ leftNumbers,
41
+ rightNumbers,
42
+ north,
43
+ south,
44
+ east,
45
+ west,
46
+ center
47
+ };
48
+ }
49
+
50
+ exports.calculateOdu = calculateOdu;
51
+ //# sourceMappingURL=chunk-3WVZRLPG.js.map
52
+ //# sourceMappingURL=chunk-3WVZRLPG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ifa/index.ts"],"names":[],"mappings":";;;AAgBO,SAAS,aAAa,IAAwB,EAAA;AAEnD,EAAM,MAAA,GAAA,GAAM,KAAK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AAC,GAAG,CAAM,KAAA,CAAA,GAAI,GAAG,CAAC,CAAA;AAG1D,EAAM,MAAA,KAAA,GAAQ,aAAa,UAAU,CAAA;AACrC,EAAM,MAAA,KAAA,GAAQ,aAAa,WAAW,CAAA;AACtC,EAAM,MAAA,IAAA,GAAO,YAAa,CAAA,KAAA,GAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,IAAO,GAAA,YAAA,CAAa,KAAQ,GAAA,KAAA,GAAQ,IAAI,CAAA;AAC9C,EAAA,MAAM,MAAS,GAAA,YAAA,CAAa,KAAQ,GAAA,KAAA,GAAQ,OAAO,IAAI,CAAA;AAEvD,EAAO,OAAA;AAAA,IACL,WAAA;AAAA,IACA,YAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-3WVZRLPG.js","sourcesContent":["\nexport type OduNumbers = {\n leftNumbers: number[],\n rightNumbers: number[],\n north: number,\n south: number,\n east: number,\n west: number,\n center: number\n}\n\n/**\n * Calculate the Odu numbers based on a date\n * @param date - Date object\n * @returns Odu numbers\n */\nexport function calculateOdu(date: Date): OduNumbers {\n // Format the date into DD/MM/YYYY\n const day = date.getDate().toString().padStart(2, '0');\n const month = (date.getMonth() + 1).toString().padStart(2, '0');\n const year = date.getFullYear().toString();\n\n // Split into left and right columns\n const leftNumbers = [\n parseInt(day[0]), // First digit of day\n parseInt(month[0]), // First digit of month\n parseInt(year[0]), // First digit of year\n parseInt(year[2]) // Third digit of year\n ];\n\n const rightNumbers = [\n parseInt(day[1]), // Second digit of day\n parseInt(month[1]), // Second digit of month\n parseInt(year[1]), // Second digit of year\n parseInt(year[3]) // Fourth digit of year\n ];\n\n // Reduce numbers if they're greater than 16\n function reduceNumber(num: number): number {\n if (num <= 16) return num;\n return reduceNumber(num.toString().split('').reduce((a, b) => a + parseInt(b), 0));\n }\n\n // Calculate initial sums\n const rawLeftSum = leftNumbers.reduce((a, b) => a + b, 0);\n const rawRightSum = rightNumbers.reduce((a, b) => a + b, 0);\n\n // Calculate and reduce each direction\n const north = reduceNumber(rawLeftSum);\n const south = reduceNumber(rawRightSum);\n const east = reduceNumber(north + south);\n const west = reduceNumber(north + south + east);\n const center = reduceNumber(north + south + east + west);\n\n return {\n leftNumbers,\n rightNumbers,\n north,\n south,\n east,\n west,\n center\n };\n}"]}
@@ -0,0 +1,495 @@
1
+ 'use strict';
2
+
3
+ var chunkJJ76YVMI_js = require('./chunk-JJ76YVMI.js');
4
+
5
+ // src/numerology/index.ts
6
+ function parseDate(date) {
7
+ if (!date) {
8
+ throw new Error("Date is required");
9
+ }
10
+ if (!(date instanceof Date)) {
11
+ throw new Error("Date must be a Date object");
12
+ }
13
+ const formattedDate = date.toISOString().split("T")[0];
14
+ if (formattedDate.length !== 10) {
15
+ throw new Error("Date must be in the format YYYY-MM-DD or DD-MM-YYYY");
16
+ }
17
+ const parts = formattedDate.split(/[-/]/).map((p) => p.trim());
18
+ const isYYYYMMDD = parts[0].length === 4;
19
+ if (isYYYYMMDD) {
20
+ return { day: parts[2], month: parts[1], year: parts[0] };
21
+ } else {
22
+ return { day: parts[0], month: parts[1], year: parts[2] };
23
+ }
24
+ }
25
+ function mapDatePartsToBlocksOfTwo({
26
+ day,
27
+ month,
28
+ year
29
+ }) {
30
+ return {
31
+ day: day.padStart(2, "0"),
32
+ month: month.padStart(2, "0"),
33
+ year1: year.slice(0, 2),
34
+ year2: year.slice(2)
35
+ };
36
+ }
37
+ function digitSum(n) {
38
+ let s = 0;
39
+ for (const ch of String(Math.abs(n))) {
40
+ s += ch.charCodeAt(0) - 48;
41
+ }
42
+ return s;
43
+ }
44
+ var MASTER_NUMBERS = [11, 22, 33, 44];
45
+ function isMasterNumber(n) {
46
+ return MASTER_NUMBERS.includes(n);
47
+ }
48
+ function reduceToSingle(n, options = { preserveMasters: false }) {
49
+ if (n === 0) {
50
+ return 0;
51
+ }
52
+ let reduced = n;
53
+ while (reduced > 9) {
54
+ if (options?.preserveMasters && isMasterNumber(reduced)) {
55
+ break;
56
+ }
57
+ reduced = digitSum(reduced);
58
+ }
59
+ return reduced;
60
+ }
61
+ function reduceToSingleWithSteps(n, options = { preserveMasters: false }) {
62
+ const steps = [n];
63
+ if (n === 0) {
64
+ return {
65
+ reducedValue: 0,
66
+ reductionSteps: steps
67
+ };
68
+ }
69
+ let reduced = n;
70
+ while (reduced > 9) {
71
+ if (options?.preserveMasters && isMasterNumber(reduced)) {
72
+ break;
73
+ }
74
+ reduced = digitSum(reduced);
75
+ steps.push(reduced);
76
+ }
77
+ return {
78
+ reducedValue: reduced,
79
+ reductionSteps: steps
80
+ };
81
+ }
82
+ function reduceBlock(block) {
83
+ const n = [...block].reduce(
84
+ (acc, curr) => acc + (curr.charCodeAt(0) - 48),
85
+ 0
86
+ );
87
+ if (n === 0) {
88
+ return 0;
89
+ }
90
+ return reduceToSingle(n);
91
+ }
92
+ function calculateKaabalisticLifePath(birthDate) {
93
+ const { day, month, year1, year2 } = mapDatePartsToBlocksOfTwo(
94
+ parseDate(birthDate)
95
+ );
96
+ const reducedDay = reduceBlock(day);
97
+ const reducedMonth = reduceBlock(month);
98
+ const reducedYear1 = reduceBlock(year1);
99
+ const reducedYear2 = reduceBlock(year2);
100
+ const dayMonthSynthesis = parseInt(`${reducedDay}${reducedMonth}`, 10);
101
+ const yearSynthesis = parseInt(`${reducedYear1}${reducedYear2}`, 10);
102
+ const reducedDayMonthSynthesis = reduceToSingle(dayMonthSynthesis);
103
+ const reducedYearSynthesis = reduceToSingle(yearSynthesis);
104
+ const finalSynthesis = parseInt(
105
+ `${reducedDayMonthSynthesis}${reducedYearSynthesis}`,
106
+ 10
107
+ );
108
+ const lifePath = reduceToSingle(finalSynthesis, { preserveMasters: true });
109
+ const isMasterLifePath = isMasterNumber(lifePath);
110
+ const personalMythologyNumbers = [
111
+ parseInt(`${dayMonthSynthesis}${yearSynthesis}`, 10),
112
+ finalSynthesis
113
+ ];
114
+ if (finalSynthesis !== lifePath) {
115
+ personalMythologyNumbers.push(lifePath);
116
+ }
117
+ const reducedLifePath = reduceToSingle(lifePath);
118
+ if (isMasterLifePath) {
119
+ personalMythologyNumbers.push(reducedLifePath);
120
+ }
121
+ return {
122
+ parts: { day, month, year1, year2 },
123
+ reducedParts: { reducedDay, reducedMonth, reducedYear1, reducedYear2 },
124
+ syntheses: {
125
+ dayMonthSynthesis,
126
+ yearSynthesis,
127
+ reducedDayMonthSynthesis,
128
+ reducedYearSynthesis,
129
+ finalSynthesis
130
+ },
131
+ lifePath,
132
+ personalMythologyNumbers
133
+ };
134
+ }
135
+ function calculateStraightAcrossReductionLifePath(birthDate) {
136
+ const { day, month, year } = parseDate(birthDate);
137
+ const result = reduceToSingleWithSteps(
138
+ parseInt(`${day}${month}${year}`, 10),
139
+ { preserveMasters: true }
140
+ );
141
+ return {
142
+ lifePath: result.reducedValue,
143
+ reductionSteps: result.reductionSteps
144
+ };
145
+ }
146
+ function getDateEnergies(birthDate) {
147
+ const { day, month, year1, year2 } = mapDatePartsToBlocksOfTwo(
148
+ parseDate(birthDate)
149
+ );
150
+ const dayEnergy = reduceToSingleWithSteps(parseInt(day, 10), {
151
+ preserveMasters: true
152
+ });
153
+ const monthEnergy = reduceToSingleWithSteps(parseInt(month, 10), {
154
+ preserveMasters: true
155
+ });
156
+ const yearEnergy = reduceToSingleWithSteps(parseInt(year1 + year2, 10), {
157
+ preserveMasters: true
158
+ });
159
+ return {
160
+ dayEnergy,
161
+ monthEnergy,
162
+ yearEnergy
163
+ };
164
+ }
165
+ function calculateChallenges(birthDate) {
166
+ const { day, month, year } = parseDate(birthDate);
167
+ const reducedDay = reduceToSingle(parseInt(day, 10));
168
+ const reducedMonth = reduceToSingle(parseInt(month, 10));
169
+ const reducedYear = reduceToSingle(parseInt(year, 10));
170
+ const subChallenge1 = Math.abs(reducedMonth - reducedDay);
171
+ const subChallenge2 = Math.abs(reducedDay - reducedYear);
172
+ const mainChallenge = Math.abs(subChallenge1 - subChallenge2);
173
+ return {
174
+ day: reducedDay,
175
+ month: reducedMonth,
176
+ year: reducedYear,
177
+ mainChallenge,
178
+ subChallenge1,
179
+ subChallenge2
180
+ };
181
+ }
182
+ var CYCLE_MEANINGS = [
183
+ {
184
+ title: "Learning",
185
+ shortDescription: "A period for assertive action and learning through direct experience.",
186
+ personalDescription: "This period emphasizes assertive action and learning through direct experience. Utilize personal influence to seek favors, loans, or recognition from influential individuals such as government officials or community leaders. Ideal for enhancing personal reputation and prestige, keeping in mind that all actions carry consequences.",
187
+ businessDescription: "Ideal for promotional activities aimed at building goodwill, public recognition, and securing endorsements from prominent individuals. Prioritize the company's image and reputation over immediate profits.",
188
+ astrologySign: "Aries (Actions Have Consequences)"
189
+ },
190
+ {
191
+ title: "Hard Work",
192
+ shortDescription: "A time for diligent effort and adaptability to temporary changes.",
193
+ personalDescription: "A period where diligent effort and adaptability are crucial. Suitable for temporary changes such as moving homes, short trips, or career shifts. Avoid long-term commitments or significant investments unless carefully formalized.",
194
+ businessDescription: "Ideal for short-term experiments, temporary staffing adjustments, and forming beneficial business connections. Steer clear of verbal agreements or long-term commitments unless formally documented. Flexibility leads to progress.",
195
+ astrologySign: "Taurus (Stop Being Stubborn)"
196
+ },
197
+ {
198
+ title: "Friendship",
199
+ shortDescription: "A dynamic phase for ambitious projects and strengthening relationships.",
200
+ personalDescription: "A dynamic and energetic phase ideal for initiating ambitious projects requiring persistence and physical strength. Effective communication strengthens relationships, but impulsiveness should be avoided to prevent conflicts.",
201
+ businessDescription: "Ideal for expansion, energetic ventures, and assertive promotional activities. Excellent for debt collection but avoid legal conflicts. Maintain vigilance against accidents and disputes while leveraging strong communication.",
202
+ astrologySign: "Gemini (Communication is Power)"
203
+ },
204
+ {
205
+ title: "Opportunities",
206
+ shortDescription: "An intellectually fertile time for creativity and quick decision-making.",
207
+ personalDescription: "An intellectually fertile phase ideal for creative projects, innovation, and quick decision-making. Beware of deception, especially concerning documents or agreements. Foster mental growth and create valuable connections, but remain cautious.",
208
+ businessDescription: "Perfect for launching impactful marketing campaigns and securing new agreements. Excellent for promotional activities and intellectual creativity, but carefully scrutinize documents to avoid fraud.",
209
+ astrologySign: "Cancer (Nurture Mental Growth)"
210
+ },
211
+ {
212
+ title: "Tears/Decision",
213
+ shortDescription: "The most prosperous phase for financial resolution and spiritual advancement.",
214
+ personalDescription: "The most prosperous phase of the year, suitable for resolving financial issues, starting long journeys, and advancing spiritually. Interact with influential figures, manage debts, and engage in expansive social activities. Keep ego and selfishness balanced for optimal outcomes.",
215
+ businessDescription: "A prime time for investments, financial growth, global promotion, debt collection, and favorable legal outcomes. Emphasize fairness and generosity to enhance business success.",
216
+ astrologySign: "Leo (Balance Ego and Generosity)"
217
+ },
218
+ {
219
+ title: "Triple Blessing",
220
+ shortDescription: "Perfect for pleasures, social activities, and creative pursuits.",
221
+ personalDescription: "Ideal for enjoying pleasures, social activities, artistic endeavors, and short travels. Favorable for romantic interactions, relaxation, and creative pursuits. Organize personal life to balance enjoyment and refinement effectively.",
222
+ businessDescription: "Excellent time for promoting luxury products, arts, entertainment, and speculative investments. Ideal for forming friendly business alliances and strategic partnerships.",
223
+ astrologySign: "Virgo (Organize Your Pleasures)"
224
+ },
225
+ {
226
+ title: "Rest",
227
+ shortDescription: "A period of rest, introspection, and preparation for renewal.",
228
+ personalDescription: "A critical period of rest, introspection, and cautious preparation for renewal. Avoid initiating new ventures and instead focus on completing pending matters, managing legal affairs carefully, and protecting existing resources. Balance and patience are essential.",
229
+ businessDescription: "Period to conserve resources, avoid major expansions, and carefully manage internal restructuring. Postpone significant new ventures until the next cycle. Act diplomatically and cautiously to ensure stability.",
230
+ astrologySign: "Libra (Seek Balance and Reconstruction)"
231
+ }
232
+ ];
233
+ function addDays(date, days) {
234
+ const result = new Date(date);
235
+ result.setDate(result.getDate() + days);
236
+ return result;
237
+ }
238
+ function getMostRecentStartDate(startDate, today) {
239
+ const startMonth = startDate.getMonth();
240
+ const startDay = startDate.getDate();
241
+ let recentStart = new Date(today.getFullYear(), startMonth, startDay);
242
+ if (recentStart > today) {
243
+ recentStart = new Date(today.getFullYear() - 1, startMonth, startDay);
244
+ }
245
+ return recentStart;
246
+ }
247
+ function calculateCycles(startDate, today) {
248
+ const mostRecentStart = getMostRecentStartDate(startDate, today);
249
+ const cycleLength = 52;
250
+ const isFutureDate = startDate > today;
251
+ let currentYearlyCycle = null;
252
+ let currentAgeCycle = null;
253
+ const ageCycles = [];
254
+ const yearlyCycles = [];
255
+ if (!isFutureDate) {
256
+ const birthYear = startDate.getFullYear();
257
+ const currentYear = today.getFullYear();
258
+ const ageInYears = currentYear - birthYear;
259
+ currentAgeCycle = Math.floor(ageInYears / 7) % 7 + 1;
260
+ for (let i = 0; i < 7; i++) {
261
+ const cycleStart = new Date(
262
+ birthYear + i * 7,
263
+ startDate.getMonth(),
264
+ startDate.getDate()
265
+ );
266
+ const cycle = i + 1;
267
+ const isCurrentCycle = cycle === currentAgeCycle;
268
+ if (isCurrentCycle) {
269
+ const yearsSinceBirth = ageInYears;
270
+ const yearWithinAgeCycle = yearsSinceBirth % 7;
271
+ currentYearlyCycle = yearWithinAgeCycle + 1;
272
+ for (let j = 0; j < 7; j++) {
273
+ const ageCycleStartYear = birthYear + Math.floor(ageInYears / 7) * 7;
274
+ const yearlyCycleStart = new Date(
275
+ ageCycleStartYear + j,
276
+ startDate.getMonth(),
277
+ startDate.getDate()
278
+ );
279
+ const yearlyCycle = j + 1;
280
+ const isCurrentYearlyCycle = yearlyCycle === currentYearlyCycle;
281
+ yearlyCycles.push({
282
+ number: yearlyCycle,
283
+ description: CYCLE_MEANINGS[j],
284
+ isActive: isCurrentYearlyCycle,
285
+ cycleStart: yearlyCycleStart
286
+ });
287
+ }
288
+ }
289
+ ageCycles.push({
290
+ number: cycle,
291
+ description: CYCLE_MEANINGS[i],
292
+ isActive: isCurrentCycle,
293
+ cycleStart
294
+ });
295
+ }
296
+ }
297
+ const monthlyCycles = [];
298
+ for (let i = 0; i < 7; i++) {
299
+ const cycleStart = addDays(mostRecentStart, i * cycleLength);
300
+ monthlyCycles.push({
301
+ number: i + 1,
302
+ description: CYCLE_MEANINGS[i],
303
+ isActive: false,
304
+ cycleStart
305
+ });
306
+ }
307
+ let currentMonthlyCycle = null;
308
+ let daysInMonthlyCycle = 0;
309
+ for (let i = 0; i < 7; i++) {
310
+ const cycleStart = addDays(mostRecentStart, i * cycleLength);
311
+ const nextCycleStart = i < 6 ? addDays(mostRecentStart, (i + 1) * cycleLength) : addDays(mostRecentStart, 366);
312
+ if (today >= cycleStart && today < nextCycleStart) {
313
+ currentMonthlyCycle = i + 1;
314
+ daysInMonthlyCycle = Math.floor(
315
+ (today.getTime() - cycleStart.getTime()) / (1e3 * 60 * 60 * 24)
316
+ ) + 1;
317
+ monthlyCycles[i].isActive = true;
318
+ break;
319
+ }
320
+ }
321
+ const totalDays = Math.floor(
322
+ (today.getTime() - mostRecentStart.getTime()) / (1e3 * 60 * 60 * 24)
323
+ ) + 1;
324
+ return {
325
+ yearlyCycles,
326
+ ageCycles,
327
+ monthlyCycles,
328
+ currentYearlyCycle,
329
+ currentAgeCycle,
330
+ currentMonthlyCycle,
331
+ daysInMonthlyCycle,
332
+ totalDays
333
+ };
334
+ }
335
+ function calculateAge(birthDate, today = /* @__PURE__ */ new Date()) {
336
+ return today.getFullYear() - birthDate.getFullYear();
337
+ }
338
+ function calculateFibonacciCycle(birthDate, today) {
339
+ const currentAge = calculateAge(birthDate, today);
340
+ const cycle1 = reduceToSingleWithSteps(currentAge);
341
+ const cycle2 = reduceToSingleWithSteps(cycle1.reducedValue + 2);
342
+ const cycle3 = reduceToSingleWithSteps(
343
+ cycle1.reducedValue + cycle2.reductionSteps[0]
344
+ );
345
+ const cycle4 = reduceToSingleWithSteps(
346
+ cycle2.reductionSteps[0] + cycle3.reductionSteps[0]
347
+ );
348
+ const cycle5 = reduceToSingleWithSteps(
349
+ cycle3.reductionSteps[0] + cycle4.reductionSteps[0]
350
+ );
351
+ const cycle6 = reduceToSingleWithSteps(
352
+ cycle4.reductionSteps[0] + cycle5.reductionSteps[0]
353
+ );
354
+ const cycle7 = reduceToSingleWithSteps(
355
+ cycle5.reductionSteps[0] + cycle6.reductionSteps[0]
356
+ );
357
+ return {
358
+ currentAge,
359
+ cycle1,
360
+ cycle2,
361
+ cycle3,
362
+ cycle4,
363
+ cycle5,
364
+ cycle6,
365
+ cycle7
366
+ };
367
+ }
368
+ function calculateSoulNumber(firstName) {
369
+ const vowels = chunkJJ76YVMI_js.calculateGematria(firstName).vowels;
370
+ return {
371
+ reducedValue: vowels.finalValue,
372
+ reductionSteps: vowels.reductionSteps
373
+ };
374
+ }
375
+ function wrapMonth(month) {
376
+ const wrappedMonth = ((month - 1) % 12 + 12) % 12;
377
+ return wrappedMonth + 1;
378
+ }
379
+ function getLastBirthdayYear(birthDate, today) {
380
+ const thisYearsBirthday = new Date(
381
+ today.getFullYear(),
382
+ birthDate.getMonth(),
383
+ birthDate.getDate()
384
+ );
385
+ return today >= thisYearsBirthday ? today.getFullYear() : today.getFullYear() - 1;
386
+ }
387
+ function calculatePersonalYear(birthDate, today = /* @__PURE__ */ new Date()) {
388
+ const { day, month } = parseDate(birthDate);
389
+ const yearToUse = getLastBirthdayYear(birthDate, today);
390
+ return reduceToSingleWithSteps(
391
+ parseInt(day, 10) + parseInt(month, 10) + yearToUse,
392
+ { preserveMasters: true }
393
+ );
394
+ }
395
+ function calculatePersonalPeriods(birthDate, yearToUse, lifePath, soulNumber, currentAge) {
396
+ const { month } = parseDate(birthDate);
397
+ const birthMonth = parseInt(month, 10);
398
+ const periods = [
399
+ {
400
+ startMonth: wrapMonth(birthMonth + 0),
401
+ endMonth: wrapMonth(birthMonth + 3),
402
+ value: reduceToSingleWithSteps(yearToUse + currentAge, {
403
+ preserveMasters: true
404
+ })
405
+ },
406
+ {
407
+ startMonth: wrapMonth(birthMonth + 4),
408
+ endMonth: wrapMonth(birthMonth + 7),
409
+ value: reduceToSingleWithSteps(yearToUse + lifePath, {
410
+ preserveMasters: true
411
+ })
412
+ },
413
+ {
414
+ startMonth: wrapMonth(birthMonth + 8),
415
+ endMonth: wrapMonth(birthMonth + 11),
416
+ value: reduceToSingleWithSteps(yearToUse + soulNumber, {
417
+ preserveMasters: true
418
+ })
419
+ }
420
+ ];
421
+ return periods;
422
+ }
423
+ function diffInPersonalMonths(birthDate, today) {
424
+ const lastYear = getLastBirthdayYear(birthDate, today);
425
+ const base = new Date(lastYear, birthDate.getMonth(), birthDate.getDate());
426
+ let k = (today.getFullYear() - base.getFullYear()) * 12 + (today.getMonth() - base.getMonth());
427
+ if (today.getDate() < birthDate.getDate()) {
428
+ k -= 1;
429
+ }
430
+ if (k < 0) k = 0;
431
+ if (k > 12) k = 12;
432
+ return k;
433
+ }
434
+ function calculatePersonalMonths(birthDate, personalYear, today) {
435
+ const { month } = parseDate(birthDate);
436
+ const firstPersonalMonth = parseInt(month, 10);
437
+ const personalMonths = [];
438
+ for (let i = 0; i < 12; i++) {
439
+ const m = wrapMonth(firstPersonalMonth + i);
440
+ const value = reduceToSingleWithSteps(personalYear.reducedValue + m, {
441
+ preserveMasters: true
442
+ });
443
+ personalMonths.push({ month: m, value });
444
+ }
445
+ const currentPersonalMonthIndex = diffInPersonalMonths(birthDate, today);
446
+ return {
447
+ personalMonths,
448
+ currentPersonalMonthIndex
449
+ };
450
+ }
451
+ function calculatePersonalCycles(birthDate, today = /* @__PURE__ */ new Date(), firstName) {
452
+ const yearToUse = getLastBirthdayYear(birthDate, today);
453
+ const personalYear = calculatePersonalYear(birthDate, today);
454
+ const currentAge = calculateAge(
455
+ birthDate,
456
+ new Date(yearToUse, today.getMonth(), today.getDate())
457
+ );
458
+ const { lifePath } = calculateKaabalisticLifePath(birthDate);
459
+ const soulNumber = calculateSoulNumber(firstName);
460
+ const personalPeriods = calculatePersonalPeriods(birthDate, yearToUse, lifePath, soulNumber.reducedValue, currentAge);
461
+ const {
462
+ personalMonths,
463
+ currentPersonalMonthIndex: currentPersonalMonth
464
+ } = calculatePersonalMonths(birthDate, personalYear, today);
465
+ const currentPersonalPeriod = Math.floor(Math.min(currentPersonalMonth, 11) / 4);
466
+ return {
467
+ currentAge,
468
+ lifePath,
469
+ soulNumber,
470
+ personalYear,
471
+ personalPeriods,
472
+ personalMonths,
473
+ currentPersonalPeriod,
474
+ currentPersonalMonth,
475
+ yearUsedOnCalculations: yearToUse
476
+ };
477
+ }
478
+
479
+ exports.CYCLE_MEANINGS = CYCLE_MEANINGS;
480
+ exports.MASTER_NUMBERS = MASTER_NUMBERS;
481
+ exports.calculateChallenges = calculateChallenges;
482
+ exports.calculateCycles = calculateCycles;
483
+ exports.calculateFibonacciCycle = calculateFibonacciCycle;
484
+ exports.calculateKaabalisticLifePath = calculateKaabalisticLifePath;
485
+ exports.calculatePersonalCycles = calculatePersonalCycles;
486
+ exports.calculatePersonalMonths = calculatePersonalMonths;
487
+ exports.calculatePersonalPeriods = calculatePersonalPeriods;
488
+ exports.calculatePersonalYear = calculatePersonalYear;
489
+ exports.calculateStraightAcrossReductionLifePath = calculateStraightAcrossReductionLifePath;
490
+ exports.getDateEnergies = getDateEnergies;
491
+ exports.isMasterNumber = isMasterNumber;
492
+ exports.reduceToSingle = reduceToSingle;
493
+ exports.reduceToSingleWithSteps = reduceToSingleWithSteps;
494
+ //# sourceMappingURL=chunk-4IMODQPK.js.map
495
+ //# sourceMappingURL=chunk-4IMODQPK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/numerology/index.ts"],"names":["calculateGematria"],"mappings":";;;;;AAWA,SAAS,UAAU,IAA0D,EAAA;AAC3E,EAAA,IAAI,CAAC,IAAM,EAAA;AACT,IAAM,MAAA,IAAI,MAAM,kBAAkB,CAAA;AAAA;AAGpC,EAAI,IAAA,EAAE,gBAAgB,IAAO,CAAA,EAAA;AAC3B,IAAM,MAAA,IAAI,MAAM,4BAA4B,CAAA;AAAA;AAG9C,EAAA,MAAM,gBAAgB,IAAK,CAAA,WAAA,GAAc,KAAM,CAAA,GAA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AA,SAAA,EAAW,KAAK,CAAA;AAEtD,EAAM,MAAA,YAAA,GAAe,qBAAsB,CAAA,SAAA,EAAW,KAAK,CAAA;AAE3D,EAAA,MAAM,UAAa,GAAA,YAAA;AAAA,IACjB,SAAA;AAAA,IACA,IAAI,KAAK,SAAW,EAAA,KAAA,CAAM,UAAY,EAAA,KAAA,CAAM,SAAS;AAAA,GACvD;AACA,EAAA,MAAM,EAAE,QAAA,EAAa,GAAA,4BAAA,CAA6B,SAAS,CAAA;AAC3D,EAAM,MAAA,UAAA,GAAa,oBAAoB,SAAS,CAAA;AAEhD,EAAA,MAAM,kBACJ,wBAAyB,CAAA,SAAA,EAAW,WAAW,QAAU,EAAA,UAAA,CAAW,cAAc,UAAU,CAAA;AAE9F,EAAM,MAAA;AAAA,IACJ,cAAA;AAAA,IACA,yBAA2B,EAAA;AAAA,GACzB,GAAA,uBAAA,CAAwB,SAAW,EAAA,YAAA,EAAc,KAAK,CAAA;AAG1D,EAAM,MAAA,qBAAA,GAAwB,KAAK,KAAM,CAAA,IAAA,CAAK,IAAI,oBAAsB,EAAA,EAAE,IAAI,CAAC,CAAA;AAE/E,EAAO,OAAA;AAAA,IACL,UAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,YAAA;AAAA,IACA,eAAA;AAAA,IACA,cAAA;AAAA,IACA,qBAAA;AAAA,IACA,oBAAA;AAAA,IACA,sBAAwB,EAAA;AAAA,GAC1B;AACF","file":"chunk-4IMODQPK.js","sourcesContent":["/**\n * Numerology calculations\n */\n\nimport { calculateGematria } from \"../gematria\";\n\nexport type ReducedValueWithSteps = {\n reducedValue: number;\n reductionSteps: number[];\n};\n\nfunction parseDate(date: Date): { day: string; month: string; year: string } {\n if (!date) {\n throw new Error(\"Date is required\");\n }\n\n if (!(date instanceof Date)) {\n throw new Error(\"Date must be a Date object\");\n }\n\n const formattedDate = date.toISOString().split(\"T\")[0];\n\n if (formattedDate.length !== 10) {\n throw new Error(\"Date must be in the format YYYY-MM-DD or DD-MM-YYYY\");\n }\n\n const parts = formattedDate.split(/[-/]/).map((p) => p.trim());\n\n const isYYYYMMDD = parts[0].length === 4;\n\n if (isYYYYMMDD) {\n return { day: parts[2], month: parts[1], year: parts[0] };\n } else {\n return { day: parts[0], month: parts[1], year: parts[2] };\n }\n}\n\nfunction mapDatePartsToBlocksOfTwo({\n day,\n month,\n year,\n}: {\n day: string;\n month: string;\n year: string;\n}): { day: string; month: string; year1: string; year2: string } {\n return {\n day: day.padStart(2, \"0\"),\n month: month.padStart(2, \"0\"),\n year1: year.slice(0, 2),\n year2: year.slice(2),\n };\n}\n\nfunction digitSum(n: number): number {\n let s = 0;\n\n for (const ch of String(Math.abs(n))) {\n s += ch.charCodeAt(0) - 48;\n }\n\n return s;\n}\n\nexport const MASTER_NUMBERS = [11, 22, 33, 44];\n\nexport function isMasterNumber(n: number): boolean {\n return MASTER_NUMBERS.includes(n);\n}\n\nexport function reduceToSingle(\n n: number,\n options: { preserveMasters?: boolean } = { preserveMasters: false }\n): number {\n // standard digital root with 0 allowed; never preserve masters here\n if (n === 0) {\n return 0;\n }\n\n let reduced = n;\n while (reduced > 9) {\n if (options?.preserveMasters && isMasterNumber(reduced)) {\n break;\n }\n\n reduced = digitSum(reduced);\n }\n\n // optional tweak for exact \"00\" cases will be applied by caller, not here\n return reduced;\n}\n\nexport function reduceToSingleWithSteps(\n n: number,\n options: { preserveMasters?: boolean } = { preserveMasters: false }\n): ReducedValueWithSteps {\n const steps = [n];\n\n if (n === 0) {\n return {\n reducedValue: 0,\n reductionSteps: steps,\n };\n }\n\n let reduced = n;\n\n while (reduced > 9) {\n if (options?.preserveMasters && isMasterNumber(reduced)) {\n break;\n }\n\n reduced = digitSum(reduced);\n steps.push(reduced);\n }\n\n return {\n reducedValue: reduced,\n reductionSteps: steps,\n };\n}\n\nfunction reduceBlock(block: string): number {\n const n = [...block].reduce(\n (acc, curr) => acc + (curr.charCodeAt(0) - 48),\n 0\n );\n\n if (n === 0) {\n return 0;\n }\n\n return reduceToSingle(n);\n}\n\nexport type KaabalisticLifePathResult = {\n parts: {\n day: string;\n month: string;\n year1: string;\n year2: string;\n };\n reducedParts: {\n reducedDay: number;\n reducedMonth: number;\n reducedYear1: number;\n reducedYear2: number;\n };\n syntheses: {\n dayMonthSynthesis: number;\n yearSynthesis: number;\n reducedDayMonthSynthesis: number;\n reducedYearSynthesis: number;\n finalSynthesis: number;\n };\n lifePath: number;\n /**\n * Last three syntheses\n */\n personalMythologyNumbers: number[];\n};\n\n/**\n * Calculate the Kaabalistic life path number based on a birth date.\n * Note: This method produces more master numbers and never produces life path 2s (or any life path that ends with 0 like 10, 20, 30, etc.)\n */\nexport function calculateKaabalisticLifePath(\n birthDate: Date\n): KaabalisticLifePathResult {\n const { day, month, year1, year2 } = mapDatePartsToBlocksOfTwo(\n parseDate(birthDate)\n );\n\n const reducedDay = reduceBlock(day);\n const reducedMonth = reduceBlock(month);\n const reducedYear1 = reduceBlock(year1);\n const reducedYear2 = reduceBlock(year2);\n\n const dayMonthSynthesis = parseInt(`${reducedDay}${reducedMonth}`, 10);\n const yearSynthesis = parseInt(`${reducedYear1}${reducedYear2}`, 10);\n\n const reducedDayMonthSynthesis = reduceToSingle(dayMonthSynthesis);\n const reducedYearSynthesis = reduceToSingle(yearSynthesis);\n\n const finalSynthesis = parseInt(\n `${reducedDayMonthSynthesis}${reducedYearSynthesis}`,\n 10\n );\n\n const lifePath = reduceToSingle(finalSynthesis, { preserveMasters: true });\n const isMasterLifePath = isMasterNumber(lifePath);\n\n const personalMythologyNumbers = [\n parseInt(`${dayMonthSynthesis}${yearSynthesis}`, 10),\n finalSynthesis,\n ];\n\n if (finalSynthesis !== lifePath) {\n personalMythologyNumbers.push(lifePath);\n }\n\n const reducedLifePath = reduceToSingle(lifePath);\n if (isMasterLifePath) {\n personalMythologyNumbers.push(reducedLifePath);\n }\n\n return {\n parts: { day, month, year1, year2 },\n reducedParts: { reducedDay, reducedMonth, reducedYear1, reducedYear2 },\n syntheses: {\n dayMonthSynthesis,\n yearSynthesis,\n reducedDayMonthSynthesis,\n reducedYearSynthesis,\n finalSynthesis,\n },\n lifePath,\n personalMythologyNumbers,\n };\n}\n\nexport type StraightAcrossReductionLifePathResult = {\n lifePath: number;\n reductionSteps: number[];\n};\n\n/**\n * Calculate the traditional straight across reduction life path number based on a birth date.\n */\nexport function calculateStraightAcrossReductionLifePath(\n birthDate: Date\n): StraightAcrossReductionLifePathResult {\n const { day, month, year } = parseDate(birthDate);\n\n const result = reduceToSingleWithSteps(\n parseInt(`${day}${month}${year}`, 10),\n { preserveMasters: true }\n );\n\n return {\n lifePath: result.reducedValue,\n reductionSteps: result.reductionSteps,\n };\n}\n\nexport type DateEnergies = {\n dayEnergy: ReducedValueWithSteps;\n monthEnergy: ReducedValueWithSteps;\n yearEnergy: ReducedValueWithSteps;\n};\n\nexport function getDateEnergies(birthDate: Date): DateEnergies {\n const { day, month, year1, year2 } = mapDatePartsToBlocksOfTwo(\n parseDate(birthDate)\n );\n\n const dayEnergy = reduceToSingleWithSteps(parseInt(day, 10), {\n preserveMasters: true,\n });\n const monthEnergy = reduceToSingleWithSteps(parseInt(month, 10), {\n preserveMasters: true,\n });\n const yearEnergy = reduceToSingleWithSteps(parseInt(year1 + year2, 10), {\n preserveMasters: true,\n });\n\n return {\n dayEnergy,\n monthEnergy,\n yearEnergy,\n };\n}\n\nexport type Challenges = {\n day: number;\n month: number;\n year: number;\n mainChallenge: number;\n subChallenge1: number;\n subChallenge2: number;\n};\n\nexport function calculateChallenges(birthDate: Date): Challenges {\n const { day, month, year } = parseDate(birthDate);\n\n const reducedDay = reduceToSingle(parseInt(day, 10));\n const reducedMonth = reduceToSingle(parseInt(month, 10));\n const reducedYear = reduceToSingle(parseInt(year, 10));\n\n const subChallenge1 = Math.abs(reducedMonth - reducedDay);\n const subChallenge2 = Math.abs(reducedDay - reducedYear);\n const mainChallenge = Math.abs(subChallenge1 - subChallenge2);\n\n return {\n day: reducedDay,\n month: reducedMonth,\n year: reducedYear,\n mainChallenge,\n subChallenge1,\n subChallenge2,\n };\n}\n\nexport const CYCLE_MEANINGS = [\n {\n title: \"Learning\",\n shortDescription:\n \"A period for assertive action and learning through direct experience.\",\n personalDescription:\n \"This period emphasizes assertive action and learning through direct experience. Utilize personal influence to seek favors, loans, or recognition from influential individuals such as government officials or community leaders. Ideal for enhancing personal reputation and prestige, keeping in mind that all actions carry consequences.\",\n businessDescription:\n \"Ideal for promotional activities aimed at building goodwill, public recognition, and securing endorsements from prominent individuals. Prioritize the company's image and reputation over immediate profits.\",\n astrologySign: \"Aries (Actions Have Consequences)\",\n },\n {\n title: \"Hard Work\",\n shortDescription:\n \"A time for diligent effort and adaptability to temporary changes.\",\n personalDescription:\n \"A period where diligent effort and adaptability are crucial. Suitable for temporary changes such as moving homes, short trips, or career shifts. Avoid long-term commitments or significant investments unless carefully formalized.\",\n businessDescription:\n \"Ideal for short-term experiments, temporary staffing adjustments, and forming beneficial business connections. Steer clear of verbal agreements or long-term commitments unless formally documented. Flexibility leads to progress.\",\n astrologySign: \"Taurus (Stop Being Stubborn)\",\n },\n {\n title: \"Friendship\",\n shortDescription:\n \"A dynamic phase for ambitious projects and strengthening relationships.\",\n personalDescription:\n \"A dynamic and energetic phase ideal for initiating ambitious projects requiring persistence and physical strength. Effective communication strengthens relationships, but impulsiveness should be avoided to prevent conflicts.\",\n businessDescription:\n \"Ideal for expansion, energetic ventures, and assertive promotional activities. Excellent for debt collection but avoid legal conflicts. Maintain vigilance against accidents and disputes while leveraging strong communication.\",\n astrologySign: \"Gemini (Communication is Power)\",\n },\n {\n title: \"Opportunities\",\n shortDescription:\n \"An intellectually fertile time for creativity and quick decision-making.\",\n personalDescription:\n \"An intellectually fertile phase ideal for creative projects, innovation, and quick decision-making. Beware of deception, especially concerning documents or agreements. Foster mental growth and create valuable connections, but remain cautious.\",\n businessDescription:\n \"Perfect for launching impactful marketing campaigns and securing new agreements. Excellent for promotional activities and intellectual creativity, but carefully scrutinize documents to avoid fraud.\",\n astrologySign: \"Cancer (Nurture Mental Growth)\",\n },\n {\n title: \"Tears/Decision\",\n shortDescription:\n \"The most prosperous phase for financial resolution and spiritual advancement.\",\n personalDescription:\n \"The most prosperous phase of the year, suitable for resolving financial issues, starting long journeys, and advancing spiritually. Interact with influential figures, manage debts, and engage in expansive social activities. Keep ego and selfishness balanced for optimal outcomes.\",\n businessDescription:\n \"A prime time for investments, financial growth, global promotion, debt collection, and favorable legal outcomes. Emphasize fairness and generosity to enhance business success.\",\n astrologySign: \"Leo (Balance Ego and Generosity)\",\n },\n {\n title: \"Triple Blessing\",\n shortDescription:\n \"Perfect for pleasures, social activities, and creative pursuits.\",\n personalDescription:\n \"Ideal for enjoying pleasures, social activities, artistic endeavors, and short travels. Favorable for romantic interactions, relaxation, and creative pursuits. Organize personal life to balance enjoyment and refinement effectively.\",\n businessDescription:\n \"Excellent time for promoting luxury products, arts, entertainment, and speculative investments. Ideal for forming friendly business alliances and strategic partnerships.\",\n astrologySign: \"Virgo (Organize Your Pleasures)\",\n },\n {\n title: \"Rest\",\n shortDescription:\n \"A period of rest, introspection, and preparation for renewal.\",\n personalDescription:\n \"A critical period of rest, introspection, and cautious preparation for renewal. Avoid initiating new ventures and instead focus on completing pending matters, managing legal affairs carefully, and protecting existing resources. Balance and patience are essential.\",\n businessDescription:\n \"Period to conserve resources, avoid major expansions, and carefully manage internal restructuring. Postpone significant new ventures until the next cycle. Act diplomatically and cautiously to ensure stability.\",\n astrologySign: \"Libra (Seek Balance and Reconstruction)\",\n },\n];\n\nexport interface Cycle {\n number: number;\n description: {\n title: string;\n shortDescription: string;\n personalDescription: string;\n businessDescription: string;\n astrologySign: string;\n };\n isActive?: boolean;\n cycleStart?: Date;\n}\n\nexport interface CycleInfo {\n yearlyCycles: Cycle[];\n ageCycles: Cycle[];\n monthlyCycles: Cycle[];\n currentYearlyCycle: number | null;\n currentAgeCycle: number | null;\n currentMonthlyCycle: number | null;\n daysInMonthlyCycle: number;\n totalDays: number;\n}\n\n// Add days to a date\nfunction addDays(date: Date, days: number): Date {\n const result = new Date(date);\n result.setDate(result.getDate() + days);\n return result;\n}\n\n// Find the most recent anniversary of the start date\nfunction getMostRecentStartDate(startDate: Date, today: Date): Date {\n const startMonth = startDate.getMonth();\n const startDay = startDate.getDate();\n let recentStart = new Date(today.getFullYear(), startMonth, startDay);\n if (recentStart > today) {\n recentStart = new Date(today.getFullYear() - 1, startMonth, startDay);\n }\n return recentStart;\n}\n\n// Calculate cycles (annual and monthly)\nexport function calculateCycles(startDate: Date, today: Date): CycleInfo {\n const mostRecentStart = getMostRecentStartDate(startDate, today);\n const cycleLength = 52; // Fixed cycle length for monthly cycles\n\n // Skip annual cycle calculation if start date is in the future\n const isFutureDate = startDate > today;\n let currentYearlyCycle = null;\n let currentAgeCycle = null;\n const ageCycles: Cycle[] = [];\n const yearlyCycles: Cycle[] = [];\n if (!isFutureDate) {\n const birthYear = startDate.getFullYear();\n const currentYear = today.getFullYear();\n const ageInYears = currentYear - birthYear;\n currentAgeCycle = (Math.floor(ageInYears / 7) % 7) + 1;\n for (let i = 0; i < 7; i++) {\n // cycle start for year is which year it started\n const cycleStart = new Date(\n birthYear + i * 7,\n startDate.getMonth(),\n startDate.getDate()\n );\n\n const cycle = i + 1;\n const isCurrentCycle = cycle === currentAgeCycle;\n\n if (isCurrentCycle) {\n // Calculate yearly cycles within the current age cycle\n // The yearly cycle is based on the person's exact age in years\n // For example, if someone is 6 years old, they're in the 1st age cycle (0-7 years) and the 6th yearly cycle\n const yearsSinceBirth = ageInYears;\n const yearWithinAgeCycle = yearsSinceBirth % 7; // 0-6 representing which year within the current age cycle\n currentYearlyCycle = yearWithinAgeCycle + 1; // Convert to 1-7 range\n\n for (let j = 0; j < 7; j++) {\n // Calculate the start date for each yearly cycle within the current age cycle\n const ageCycleStartYear = birthYear + Math.floor(ageInYears / 7) * 7; // Start year of current age cycle\n const yearlyCycleStart = new Date(\n ageCycleStartYear + j,\n startDate.getMonth(),\n startDate.getDate()\n );\n const yearlyCycle = j + 1;\n\n const isCurrentYearlyCycle = yearlyCycle === currentYearlyCycle;\n\n yearlyCycles.push({\n number: yearlyCycle,\n description: CYCLE_MEANINGS[j],\n isActive: isCurrentYearlyCycle,\n cycleStart: yearlyCycleStart,\n });\n }\n }\n\n ageCycles.push({\n number: cycle,\n description: CYCLE_MEANINGS[i],\n isActive: isCurrentCycle,\n cycleStart,\n });\n }\n }\n\n // Monthly cycles (relative to start date)\n const monthlyCycles: Cycle[] = [];\n for (let i = 0; i < 7; i++) {\n const cycleStart = addDays(mostRecentStart, i * cycleLength);\n\n monthlyCycles.push({\n number: i + 1,\n description: CYCLE_MEANINGS[i],\n isActive: false,\n cycleStart: cycleStart,\n });\n }\n\n // Find current monthly cycle\n let currentMonthlyCycle = null;\n let daysInMonthlyCycle = 0;\n for (let i = 0; i < 7; i++) {\n const cycleStart = addDays(mostRecentStart, i * cycleLength);\n const nextCycleStart =\n i < 6\n ? addDays(mostRecentStart, (i + 1) * cycleLength)\n : addDays(mostRecentStart, 366);\n if (today >= cycleStart && today < nextCycleStart) {\n currentMonthlyCycle = i + 1;\n daysInMonthlyCycle =\n Math.floor(\n (today.getTime() - cycleStart.getTime()) / (1000 * 60 * 60 * 24)\n ) + 1;\n monthlyCycles[i].isActive = true;\n break;\n }\n }\n\n const totalDays =\n Math.floor(\n (today.getTime() - mostRecentStart.getTime()) / (1000 * 60 * 60 * 24)\n ) + 1;\n\n return {\n yearlyCycles,\n ageCycles,\n monthlyCycles,\n currentYearlyCycle,\n currentAgeCycle,\n currentMonthlyCycle,\n daysInMonthlyCycle,\n totalDays,\n };\n}\n\nfunction calculateAge(birthDate: Date, today: Date = new Date()): number {\n return today.getFullYear() - birthDate.getFullYear();\n}\n\nexport type FibonacciCycle = {\n currentAge: number;\n cycle1: ReducedValueWithSteps;\n cycle2: ReducedValueWithSteps;\n cycle3: ReducedValueWithSteps;\n cycle4: ReducedValueWithSteps;\n cycle5: ReducedValueWithSteps;\n cycle6: ReducedValueWithSteps;\n cycle7: ReducedValueWithSteps;\n};\n\nexport function calculateFibonacciCycle(\n birthDate: Date,\n today: Date\n): FibonacciCycle {\n const currentAge = calculateAge(birthDate, today);\n\n const cycle1 = reduceToSingleWithSteps(currentAge);\n const cycle2 = reduceToSingleWithSteps(cycle1.reducedValue + 2);\n const cycle3 = reduceToSingleWithSteps(\n cycle1.reducedValue + cycle2.reductionSteps[0]\n );\n const cycle4 = reduceToSingleWithSteps(\n cycle2.reductionSteps[0] + cycle3.reductionSteps[0]\n );\n const cycle5 = reduceToSingleWithSteps(\n cycle3.reductionSteps[0] + cycle4.reductionSteps[0]\n );\n const cycle6 = reduceToSingleWithSteps(\n cycle4.reductionSteps[0] + cycle5.reductionSteps[0]\n );\n const cycle7 = reduceToSingleWithSteps(\n cycle5.reductionSteps[0] + cycle6.reductionSteps[0]\n );\n\n return {\n currentAge,\n cycle1,\n cycle2,\n cycle3,\n cycle4,\n cycle5,\n cycle6,\n cycle7,\n };\n}\n\nexport type PersonalPeriod = {\n startMonth: number;\n endMonth: number;\n value: ReducedValueWithSteps;\n};\n\nexport type PersonalMonth = {\n month: number;\n value: ReducedValueWithSteps;\n};\n\nexport type PersonalCycles = {\n personalYear: ReducedValueWithSteps;\n personalPeriods: [PersonalPeriod, PersonalPeriod, PersonalPeriod];\n personalMonths: [\n PersonalMonth,\n PersonalMonth,\n PersonalMonth,\n PersonalMonth,\n PersonalMonth,\n PersonalMonth,\n PersonalMonth,\n PersonalMonth,\n PersonalMonth,\n PersonalMonth,\n PersonalMonth,\n PersonalMonth,\n PersonalMonth\n ];\n currentPersonalPeriod: number;\n currentPersonalMonth: number;\n currentAge: number;\n lifePath: number;\n soulNumber?: ReducedValueWithSteps;\n yearUsedOnCalculations: number;\n};\n\nfunction calculateSoulNumber(firstName: string): ReducedValueWithSteps {\n const vowels = calculateGematria(firstName).vowels;\n\n return {\n reducedValue: vowels.finalValue,\n reductionSteps: vowels.reductionSteps,\n }\n}\n\n/**\n * This function wraps the month number to a 1-12 range.\n */\nfunction wrapMonth(month: number): number {\n const wrappedMonth = (((month - 1) % 12) + 12) % 12;\n\n return wrappedMonth + 1;\n}\n\n/**\n * Returns the year of the most recent birthday relative to today.\n */\nfunction getLastBirthdayYear(birthDate: Date, today: Date): number {\n const thisYearsBirthday = new Date(\n today.getFullYear(),\n birthDate.getMonth(),\n birthDate.getDate()\n );\n\n return today >= thisYearsBirthday\n ? today.getFullYear()\n : today.getFullYear() - 1;\n}\n\nexport function calculatePersonalYear(\n birthDate: Date,\n today: Date = new Date()\n): ReducedValueWithSteps {\n const { day, month } = parseDate(birthDate);\n const yearToUse = getLastBirthdayYear(birthDate, today);\n\n return reduceToSingleWithSteps(\n parseInt(day, 10) + parseInt(month, 10) + yearToUse,\n { preserveMasters: true }\n );\n}\n\nexport function calculatePersonalPeriods(\n birthDate: Date,\n yearToUse: number,\n lifePath: number,\n soulNumber: number,\n currentAge: number\n): [PersonalPeriod, PersonalPeriod, PersonalPeriod] {\n const { month } = parseDate(birthDate);\n const birthMonth = parseInt(month, 10);\n\n const periods: [PersonalPeriod, PersonalPeriod, PersonalPeriod] = [\n {\n startMonth: wrapMonth(birthMonth + 0),\n endMonth: wrapMonth(birthMonth + 3),\n value: reduceToSingleWithSteps(yearToUse + currentAge, {\n preserveMasters: true,\n }),\n },\n {\n startMonth: wrapMonth(birthMonth + 4),\n endMonth: wrapMonth(birthMonth + 7),\n value: reduceToSingleWithSteps(yearToUse + lifePath, {\n preserveMasters: true,\n }),\n },\n {\n startMonth: wrapMonth(birthMonth + 8),\n endMonth: wrapMonth(birthMonth + 11),\n value: reduceToSingleWithSteps(yearToUse + soulNumber, {\n preserveMasters: true,\n }),\n },\n ];\n\n return periods;\n}\n\nfunction diffInPersonalMonths(birthDate: Date, today: Date): number {\n const lastYear = getLastBirthdayYear(birthDate, today);\n const base = new Date(lastYear, birthDate.getMonth(), birthDate.getDate());\n\n let k =\n (today.getFullYear() - base.getFullYear()) * 12 +\n (today.getMonth() - base.getMonth());\n\n // Only advance to the next personal month on the birth *day* each month\n if (today.getDate() < birthDate.getDate()) {\n k -= 1;\n }\n\n if (k < 0) k = 0;\n if (k > 12) k = 12; \n\n return k;\n}\n\nexport function calculatePersonalMonths(\n birthDate: Date,\n personalYear: ReducedValueWithSteps,\n today: Date\n): {\n personalMonths: PersonalCycles[\"personalMonths\"];\n currentPersonalMonthIndex: number;\n} {\n const { month } = parseDate(birthDate);\n const firstPersonalMonth = parseInt(month, 10);\n\n const personalMonths: PersonalMonth[] = [];\n for (let i = 0; i < 12; i++) {\n const m = wrapMonth(firstPersonalMonth + i);\n const value = reduceToSingleWithSteps(personalYear.reducedValue + m, {\n preserveMasters: true,\n });\n personalMonths.push({ month: m, value });\n }\n\n const currentPersonalMonthIndex = diffInPersonalMonths(birthDate, today);\n\n return {\n personalMonths: personalMonths as PersonalCycles[\"personalMonths\"],\n currentPersonalMonthIndex,\n };\n}\n\nexport function calculatePersonalCycles(\n birthDate: Date,\n today: Date = new Date(),\n firstName: string\n): PersonalCycles {\n const yearToUse = getLastBirthdayYear(birthDate, today);\n\n const personalYear = calculatePersonalYear(birthDate, today);\n\n const currentAge = calculateAge(\n birthDate,\n new Date(yearToUse, today.getMonth(), today.getDate())\n );\n const { lifePath } = calculateKaabalisticLifePath(birthDate);\n const soulNumber = calculateSoulNumber(firstName);\n\n const personalPeriods =\n calculatePersonalPeriods(birthDate, yearToUse, lifePath, soulNumber.reducedValue, currentAge);\n\n const {\n personalMonths,\n currentPersonalMonthIndex: currentPersonalMonth,\n } = calculatePersonalMonths(birthDate, personalYear, today);\n \n // Derive the period from the month index (0–12). Clamp 12 to last period.\n const currentPersonalPeriod = Math.floor(Math.min(currentPersonalMonth, 11) / 4);\n\n return {\n currentAge,\n lifePath,\n soulNumber,\n personalYear,\n personalPeriods,\n personalMonths,\n currentPersonalPeriod,\n currentPersonalMonth,\n yearUsedOnCalculations: yearToUse,\n };\n}\n"]}