kaabalah 2.1.3 → 3.0.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/chunk-SHEGSIRU.js +488 -0
- package/dist/chunk-SHEGSIRU.js.map +1 -0
- package/dist/chunk-VV2YT6RZ.mjs +472 -0
- package/dist/chunk-VV2YT6RZ.mjs.map +1 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +61 -13
- package/dist/index.mjs +1 -1
- package/dist/numerology/index.d.mts +117 -6
- package/dist/numerology/index.d.ts +117 -6
- package/dist/numerology/index.js +55 -5
- package/dist/numerology/index.mjs +3 -1
- package/package.json +5 -5
- package/dist/chunk-RGMSQCP5.js +0 -163
- package/dist/chunk-RGMSQCP5.js.map +0 -1
- package/dist/chunk-W7GBKP5K.mjs +0 -159
- package/dist/chunk-W7GBKP5K.mjs.map +0 -1
|
@@ -0,0 +1,488 @@
|
|
|
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
|
+
lifePath
|
|
114
|
+
];
|
|
115
|
+
const reducedLifePath = reduceToSingle(lifePath);
|
|
116
|
+
if (isMasterLifePath) {
|
|
117
|
+
personalMythologyNumbers.push(reducedLifePath);
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
parts: { day, month, year1, year2 },
|
|
121
|
+
reducedParts: { reducedDay, reducedMonth, reducedYear1, reducedYear2 },
|
|
122
|
+
syntheses: {
|
|
123
|
+
dayMonthSynthesis,
|
|
124
|
+
yearSynthesis,
|
|
125
|
+
reducedDayMonthSynthesis,
|
|
126
|
+
reducedYearSynthesis,
|
|
127
|
+
finalSynthesis
|
|
128
|
+
},
|
|
129
|
+
lifePath,
|
|
130
|
+
personalMythologyNumbers
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
function calculateStraightAcrossReductionLifePath(birthDate) {
|
|
134
|
+
const { day, month, year } = parseDate(birthDate);
|
|
135
|
+
const result = reduceToSingleWithSteps(
|
|
136
|
+
parseInt(`${day}${month}${year}`, 10),
|
|
137
|
+
{ preserveMasters: true }
|
|
138
|
+
);
|
|
139
|
+
return {
|
|
140
|
+
lifePath: result.reducedValue,
|
|
141
|
+
reductionSteps: result.reductionSteps
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function getDateEnergies(birthDate) {
|
|
145
|
+
const { day, month, year1, year2 } = mapDatePartsToBlocksOfTwo(
|
|
146
|
+
parseDate(birthDate)
|
|
147
|
+
);
|
|
148
|
+
const dayEnergy = reduceToSingleWithSteps(parseInt(day, 10), {
|
|
149
|
+
preserveMasters: true
|
|
150
|
+
});
|
|
151
|
+
const monthEnergy = reduceToSingleWithSteps(parseInt(month, 10), {
|
|
152
|
+
preserveMasters: true
|
|
153
|
+
});
|
|
154
|
+
const yearEnergy = reduceToSingleWithSteps(parseInt(year1 + year2, 10), {
|
|
155
|
+
preserveMasters: true
|
|
156
|
+
});
|
|
157
|
+
return {
|
|
158
|
+
dayEnergy,
|
|
159
|
+
monthEnergy,
|
|
160
|
+
yearEnergy
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function calculateChallenges(birthDate) {
|
|
164
|
+
const { day, month, year } = parseDate(birthDate);
|
|
165
|
+
const reducedDay = reduceToSingle(parseInt(day, 10));
|
|
166
|
+
const reducedMonth = reduceToSingle(parseInt(month, 10));
|
|
167
|
+
const reducedYear = reduceToSingle(parseInt(year, 10));
|
|
168
|
+
const subChallenge1 = Math.abs(reducedMonth - reducedDay);
|
|
169
|
+
const subChallenge2 = Math.abs(reducedDay - reducedYear);
|
|
170
|
+
const mainChallenge = Math.abs(subChallenge1 - subChallenge2);
|
|
171
|
+
return {
|
|
172
|
+
day: reducedDay,
|
|
173
|
+
month: reducedMonth,
|
|
174
|
+
year: reducedYear,
|
|
175
|
+
mainChallenge,
|
|
176
|
+
subChallenge1,
|
|
177
|
+
subChallenge2
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
var CYCLE_MEANINGS = [
|
|
181
|
+
{
|
|
182
|
+
title: "Learning",
|
|
183
|
+
shortDescription: "A period for assertive action and learning through direct experience.",
|
|
184
|
+
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.",
|
|
185
|
+
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.",
|
|
186
|
+
astrologySign: "Aries (Actions Have Consequences)"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
title: "Hard Work",
|
|
190
|
+
shortDescription: "A time for diligent effort and adaptability to temporary changes.",
|
|
191
|
+
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.",
|
|
192
|
+
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.",
|
|
193
|
+
astrologySign: "Taurus (Stop Being Stubborn)"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
title: "Friendship",
|
|
197
|
+
shortDescription: "A dynamic phase for ambitious projects and strengthening relationships.",
|
|
198
|
+
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.",
|
|
199
|
+
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.",
|
|
200
|
+
astrologySign: "Gemini (Communication is Power)"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
title: "Opportunities",
|
|
204
|
+
shortDescription: "An intellectually fertile time for creativity and quick decision-making.",
|
|
205
|
+
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.",
|
|
206
|
+
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.",
|
|
207
|
+
astrologySign: "Cancer (Nurture Mental Growth)"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
title: "Tears/Decision",
|
|
211
|
+
shortDescription: "The most prosperous phase for financial resolution and spiritual advancement.",
|
|
212
|
+
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.",
|
|
213
|
+
businessDescription: "A prime time for investments, financial growth, global promotion, debt collection, and favorable legal outcomes. Emphasize fairness and generosity to enhance business success.",
|
|
214
|
+
astrologySign: "Leo (Balance Ego and Generosity)"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
title: "Triple Blessing",
|
|
218
|
+
shortDescription: "Perfect for pleasures, social activities, and creative pursuits.",
|
|
219
|
+
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.",
|
|
220
|
+
businessDescription: "Excellent time for promoting luxury products, arts, entertainment, and speculative investments. Ideal for forming friendly business alliances and strategic partnerships.",
|
|
221
|
+
astrologySign: "Virgo (Organize Your Pleasures)"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
title: "Rest",
|
|
225
|
+
shortDescription: "A period of rest, introspection, and preparation for renewal.",
|
|
226
|
+
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.",
|
|
227
|
+
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.",
|
|
228
|
+
astrologySign: "Libra (Seek Balance and Reconstruction)"
|
|
229
|
+
}
|
|
230
|
+
];
|
|
231
|
+
function addDays(date, days) {
|
|
232
|
+
const result = new Date(date);
|
|
233
|
+
result.setDate(result.getDate() + days);
|
|
234
|
+
return result;
|
|
235
|
+
}
|
|
236
|
+
function getMostRecentStartDate(startDate, today) {
|
|
237
|
+
const startMonth = startDate.getMonth();
|
|
238
|
+
const startDay = startDate.getDate();
|
|
239
|
+
let recentStart = new Date(today.getFullYear(), startMonth, startDay);
|
|
240
|
+
if (recentStart > today) {
|
|
241
|
+
recentStart = new Date(today.getFullYear() - 1, startMonth, startDay);
|
|
242
|
+
}
|
|
243
|
+
return recentStart;
|
|
244
|
+
}
|
|
245
|
+
function calculateCycles(startDate, today) {
|
|
246
|
+
const mostRecentStart = getMostRecentStartDate(startDate, today);
|
|
247
|
+
const cycleLength = 52;
|
|
248
|
+
const isFutureDate = startDate > today;
|
|
249
|
+
let currentYearlyCycle = null;
|
|
250
|
+
let currentAgeCycle = null;
|
|
251
|
+
const ageCycles = [];
|
|
252
|
+
const yearlyCycles = [];
|
|
253
|
+
if (!isFutureDate) {
|
|
254
|
+
const birthYear = startDate.getFullYear();
|
|
255
|
+
const currentYear = today.getFullYear();
|
|
256
|
+
const ageInYears = currentYear - birthYear;
|
|
257
|
+
currentAgeCycle = Math.floor(ageInYears / 7) % 7 + 1;
|
|
258
|
+
for (let i = 0; i < 7; i++) {
|
|
259
|
+
const cycleStart = new Date(
|
|
260
|
+
birthYear + i * 7,
|
|
261
|
+
startDate.getMonth(),
|
|
262
|
+
startDate.getDate()
|
|
263
|
+
);
|
|
264
|
+
const cycle = i + 1;
|
|
265
|
+
const isCurrentCycle = cycle === currentAgeCycle;
|
|
266
|
+
if (isCurrentCycle) {
|
|
267
|
+
const yearsSinceBirth = ageInYears;
|
|
268
|
+
const yearWithinAgeCycle = yearsSinceBirth % 7;
|
|
269
|
+
currentYearlyCycle = yearWithinAgeCycle + 1;
|
|
270
|
+
for (let j = 0; j < 7; j++) {
|
|
271
|
+
const ageCycleStartYear = birthYear + Math.floor(ageInYears / 7) * 7;
|
|
272
|
+
const yearlyCycleStart = new Date(
|
|
273
|
+
ageCycleStartYear + j,
|
|
274
|
+
startDate.getMonth(),
|
|
275
|
+
startDate.getDate()
|
|
276
|
+
);
|
|
277
|
+
const yearlyCycle = j + 1;
|
|
278
|
+
const isCurrentYearlyCycle = yearlyCycle === currentYearlyCycle;
|
|
279
|
+
yearlyCycles.push({
|
|
280
|
+
number: yearlyCycle,
|
|
281
|
+
description: CYCLE_MEANINGS[j],
|
|
282
|
+
isActive: isCurrentYearlyCycle,
|
|
283
|
+
cycleStart: yearlyCycleStart
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
ageCycles.push({
|
|
288
|
+
number: cycle,
|
|
289
|
+
description: CYCLE_MEANINGS[i],
|
|
290
|
+
isActive: isCurrentCycle,
|
|
291
|
+
cycleStart
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
const monthlyCycles = [];
|
|
296
|
+
for (let i = 0; i < 7; i++) {
|
|
297
|
+
const cycleStart = addDays(mostRecentStart, i * cycleLength);
|
|
298
|
+
monthlyCycles.push({
|
|
299
|
+
number: i + 1,
|
|
300
|
+
description: CYCLE_MEANINGS[i],
|
|
301
|
+
isActive: false,
|
|
302
|
+
cycleStart
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
let currentMonthlyCycle = null;
|
|
306
|
+
let daysInMonthlyCycle = 0;
|
|
307
|
+
for (let i = 0; i < 7; i++) {
|
|
308
|
+
const cycleStart = addDays(mostRecentStart, i * cycleLength);
|
|
309
|
+
const nextCycleStart = i < 6 ? addDays(mostRecentStart, (i + 1) * cycleLength) : addDays(mostRecentStart, 366);
|
|
310
|
+
if (today >= cycleStart && today < nextCycleStart) {
|
|
311
|
+
currentMonthlyCycle = i + 1;
|
|
312
|
+
daysInMonthlyCycle = Math.floor(
|
|
313
|
+
(today.getTime() - cycleStart.getTime()) / (1e3 * 60 * 60 * 24)
|
|
314
|
+
) + 1;
|
|
315
|
+
monthlyCycles[i].isActive = true;
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
const totalDays = Math.floor(
|
|
320
|
+
(today.getTime() - mostRecentStart.getTime()) / (1e3 * 60 * 60 * 24)
|
|
321
|
+
) + 1;
|
|
322
|
+
return {
|
|
323
|
+
yearlyCycles,
|
|
324
|
+
ageCycles,
|
|
325
|
+
monthlyCycles,
|
|
326
|
+
currentYearlyCycle,
|
|
327
|
+
currentAgeCycle,
|
|
328
|
+
currentMonthlyCycle,
|
|
329
|
+
daysInMonthlyCycle,
|
|
330
|
+
totalDays
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function calculateAge(birthDate, today = /* @__PURE__ */ new Date()) {
|
|
334
|
+
return today.getFullYear() - birthDate.getFullYear();
|
|
335
|
+
}
|
|
336
|
+
function calculateFibonacciCycle(birthDate, today) {
|
|
337
|
+
const currentAge = calculateAge(birthDate, today);
|
|
338
|
+
const cycle1 = reduceToSingleWithSteps(currentAge);
|
|
339
|
+
const cycle2 = reduceToSingleWithSteps(cycle1.reducedValue + 2);
|
|
340
|
+
const cycle3 = reduceToSingleWithSteps(
|
|
341
|
+
cycle1.reducedValue + cycle2.reductionSteps[0]
|
|
342
|
+
);
|
|
343
|
+
const cycle4 = reduceToSingleWithSteps(
|
|
344
|
+
cycle2.reductionSteps[0] + cycle3.reductionSteps[0]
|
|
345
|
+
);
|
|
346
|
+
const cycle5 = reduceToSingleWithSteps(
|
|
347
|
+
cycle3.reductionSteps[0] + cycle4.reductionSteps[0]
|
|
348
|
+
);
|
|
349
|
+
const cycle6 = reduceToSingleWithSteps(
|
|
350
|
+
cycle4.reductionSteps[0] + cycle5.reductionSteps[0]
|
|
351
|
+
);
|
|
352
|
+
const cycle7 = reduceToSingleWithSteps(
|
|
353
|
+
cycle5.reductionSteps[0] + cycle6.reductionSteps[0]
|
|
354
|
+
);
|
|
355
|
+
return {
|
|
356
|
+
currentAge,
|
|
357
|
+
cycle1,
|
|
358
|
+
cycle2,
|
|
359
|
+
cycle3,
|
|
360
|
+
cycle4,
|
|
361
|
+
cycle5,
|
|
362
|
+
cycle6,
|
|
363
|
+
cycle7
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
function calculateSoulNumber(firstName) {
|
|
367
|
+
return chunkJJ76YVMI_js.calculateGematria(firstName).vowels.finalValue;
|
|
368
|
+
}
|
|
369
|
+
function wrapMonth(month) {
|
|
370
|
+
const wrappedMonth = ((month - 1) % 12 + 12) % 12;
|
|
371
|
+
return wrappedMonth + 1;
|
|
372
|
+
}
|
|
373
|
+
function getLastBirthdayYear(birthDate, today) {
|
|
374
|
+
const thisYearsBirthday = new Date(
|
|
375
|
+
today.getFullYear(),
|
|
376
|
+
birthDate.getMonth(),
|
|
377
|
+
birthDate.getDate()
|
|
378
|
+
);
|
|
379
|
+
return today >= thisYearsBirthday ? today.getFullYear() : today.getFullYear() - 1;
|
|
380
|
+
}
|
|
381
|
+
function calculatePersonalYear(birthDate, today = /* @__PURE__ */ new Date()) {
|
|
382
|
+
const { day, month } = parseDate(birthDate);
|
|
383
|
+
const yearToUse = getLastBirthdayYear(birthDate, today);
|
|
384
|
+
return reduceToSingleWithSteps(
|
|
385
|
+
parseInt(day, 10) + parseInt(month, 10) + yearToUse,
|
|
386
|
+
{ preserveMasters: true }
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
function calculatePersonalPeriods(birthDate, yearToUse, lifePath, soulNumber, currentAge) {
|
|
390
|
+
const { month } = parseDate(birthDate);
|
|
391
|
+
const birthMonth = parseInt(month, 10);
|
|
392
|
+
const periods = [
|
|
393
|
+
{
|
|
394
|
+
startMonth: wrapMonth(birthMonth + 0),
|
|
395
|
+
endMonth: wrapMonth(birthMonth + 3),
|
|
396
|
+
value: reduceToSingleWithSteps(yearToUse + currentAge, {
|
|
397
|
+
preserveMasters: true
|
|
398
|
+
})
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
startMonth: wrapMonth(birthMonth + 4),
|
|
402
|
+
endMonth: wrapMonth(birthMonth + 7),
|
|
403
|
+
value: reduceToSingleWithSteps(yearToUse + lifePath, {
|
|
404
|
+
preserveMasters: true
|
|
405
|
+
})
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
startMonth: wrapMonth(birthMonth + 8),
|
|
409
|
+
endMonth: wrapMonth(birthMonth + 11),
|
|
410
|
+
value: reduceToSingleWithSteps(yearToUse + soulNumber, {
|
|
411
|
+
preserveMasters: true
|
|
412
|
+
})
|
|
413
|
+
}
|
|
414
|
+
];
|
|
415
|
+
return periods;
|
|
416
|
+
}
|
|
417
|
+
function diffInPersonalMonths(birthDate, today) {
|
|
418
|
+
const lastYear = getLastBirthdayYear(birthDate, today);
|
|
419
|
+
const base = new Date(lastYear, birthDate.getMonth(), birthDate.getDate());
|
|
420
|
+
let k = (today.getFullYear() - base.getFullYear()) * 12 + (today.getMonth() - base.getMonth());
|
|
421
|
+
if (today.getDate() < birthDate.getDate()) {
|
|
422
|
+
k -= 1;
|
|
423
|
+
}
|
|
424
|
+
if (k < 0) k = 0;
|
|
425
|
+
if (k > 12) k = 12;
|
|
426
|
+
return k;
|
|
427
|
+
}
|
|
428
|
+
function calculatePersonalMonths(birthDate, personalYear, today) {
|
|
429
|
+
const { month } = parseDate(birthDate);
|
|
430
|
+
const firstPersonalMonth = parseInt(month, 10);
|
|
431
|
+
const personalMonths = [];
|
|
432
|
+
for (let i = 0; i < 13; i++) {
|
|
433
|
+
const m = wrapMonth(firstPersonalMonth + i);
|
|
434
|
+
const value = reduceToSingleWithSteps(personalYear.reducedValue + m, {
|
|
435
|
+
preserveMasters: true
|
|
436
|
+
});
|
|
437
|
+
personalMonths.push({ month: m, value });
|
|
438
|
+
}
|
|
439
|
+
const currentPersonalMonthIndex = diffInPersonalMonths(birthDate, today);
|
|
440
|
+
return {
|
|
441
|
+
personalMonths,
|
|
442
|
+
currentPersonalMonthIndex
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
function calculatePersonalCycles(birthDate, today = /* @__PURE__ */ new Date(), firstName) {
|
|
446
|
+
const yearToUse = getLastBirthdayYear(birthDate, today);
|
|
447
|
+
const personalYear = calculatePersonalYear(birthDate, today);
|
|
448
|
+
const currentAge = calculateAge(
|
|
449
|
+
birthDate,
|
|
450
|
+
new Date(yearToUse, today.getMonth(), today.getDate())
|
|
451
|
+
);
|
|
452
|
+
const { lifePath } = calculateKaabalisticLifePath(birthDate);
|
|
453
|
+
const soulNumber = calculateSoulNumber(firstName);
|
|
454
|
+
const personalPeriods = calculatePersonalPeriods(birthDate, yearToUse, lifePath, soulNumber, currentAge);
|
|
455
|
+
const {
|
|
456
|
+
personalMonths,
|
|
457
|
+
currentPersonalMonthIndex: currentPersonalMonth
|
|
458
|
+
} = calculatePersonalMonths(birthDate, personalYear, today);
|
|
459
|
+
const currentPersonalPeriod = Math.floor(Math.min(currentPersonalMonth, 11) / 4);
|
|
460
|
+
return {
|
|
461
|
+
currentAge,
|
|
462
|
+
lifePath,
|
|
463
|
+
soulNumber,
|
|
464
|
+
personalYear,
|
|
465
|
+
personalPeriods,
|
|
466
|
+
personalMonths,
|
|
467
|
+
currentPersonalPeriod,
|
|
468
|
+
currentPersonalMonth
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
exports.CYCLE_MEANINGS = CYCLE_MEANINGS;
|
|
473
|
+
exports.MASTER_NUMBERS = MASTER_NUMBERS;
|
|
474
|
+
exports.calculateChallenges = calculateChallenges;
|
|
475
|
+
exports.calculateCycles = calculateCycles;
|
|
476
|
+
exports.calculateFibonacciCycle = calculateFibonacciCycle;
|
|
477
|
+
exports.calculateKaabalisticLifePath = calculateKaabalisticLifePath;
|
|
478
|
+
exports.calculatePersonalCycles = calculatePersonalCycles;
|
|
479
|
+
exports.calculatePersonalMonths = calculatePersonalMonths;
|
|
480
|
+
exports.calculatePersonalPeriods = calculatePersonalPeriods;
|
|
481
|
+
exports.calculatePersonalYear = calculatePersonalYear;
|
|
482
|
+
exports.calculateStraightAcrossReductionLifePath = calculateStraightAcrossReductionLifePath;
|
|
483
|
+
exports.getDateEnergies = getDateEnergies;
|
|
484
|
+
exports.isMasterNumber = isMasterNumber;
|
|
485
|
+
exports.reduceToSingle = reduceToSingle;
|
|
486
|
+
exports.reduceToSingleWithSteps = reduceToSingleWithSteps;
|
|
487
|
+
//# sourceMappingURL=chunk-SHEGSIRU.js.map
|
|
488
|
+
//# sourceMappingURL=chunk-SHEGSIRU.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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AA;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,SAAW,EAAA,QAAA,EAAU,YAAY,UAAU,CAAA;AAEjF,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;AAAA,GACF;AACF","file":"chunk-SHEGSIRU.js","sourcesContent":["/**\n * Numerology calculations\n */\n\nimport { calculateGematria } from \"../gematria\";\n\ntype 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\ntype 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 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\ntype 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\ntype 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\ntype 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\ntype 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\ntype PersonalPeriod = {\n startMonth: number;\n endMonth: number;\n value: ReducedValueWithSteps;\n};\n\ntype PersonalMonth = {\n month: number;\n value: ReducedValueWithSteps;\n};\n\ntype 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?: number;\n};\n\nfunction calculateSoulNumber(firstName: string): number {\n return calculateGematria(firstName).vowels.finalValue;\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; // 13th slot is the next birthday month\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 < 13; 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, 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 };\n}\n"]}
|