@zodiacs/engine 0.1.1-rc.14 → 0.1.1-rc.16

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +797 -6
  2. package/LICENSING.md +354 -21
  3. package/NOTICE +166 -9
  4. package/README.md +327 -84
  5. package/dist/api-VOW6Umy5.d.ts +197 -0
  6. package/dist/calc.d.ts +279 -0
  7. package/dist/calc.js +853 -0
  8. package/dist/{chunk-NAJ735VN.js → chunk-2OWGBT3O.js} +1 -1
  9. package/dist/{chunk-4OSOCZY2.js → chunk-4NV4ZEFZ.js} +21 -6
  10. package/dist/chunk-A3U2ZS2W.js +29 -0
  11. package/dist/chunk-I7O5EGFV.js +25 -0
  12. package/dist/chunk-KFTJMMG7.js +61 -0
  13. package/dist/chunk-KHBLFXFG.js +227 -0
  14. package/dist/chunk-L6ZHWJZ6.js +355 -0
  15. package/dist/chunk-N4B5JNMA.js +473 -0
  16. package/dist/chunk-O3NJRGJ2.js +56 -0
  17. package/dist/{chunk-RETEVD4F.js → chunk-WOU7JVD3.js} +293 -154
  18. package/dist/crossings.d.ts +1 -1
  19. package/dist/deltat.d.ts +8 -8
  20. package/dist/geo.d.ts +137 -8
  21. package/dist/geo.js +28 -166
  22. package/dist/houses-extra.d.ts +81 -0
  23. package/dist/houses-extra.js +337 -0
  24. package/dist/houses-q1O2GGp4.d.ts +128 -0
  25. package/dist/index.d.ts +8 -201
  26. package/dist/index.js +38 -315
  27. package/dist/internal-math-CmJ9xtaW.d.ts +160 -0
  28. package/dist/internal-math.d.ts +3 -2
  29. package/dist/internal-math.js +2 -2
  30. package/dist/internal.d.ts +2 -1
  31. package/dist/internal.js +4 -4
  32. package/dist/receipt.d.ts +74 -29
  33. package/dist/receipt.js +194 -33
  34. package/dist/rulers-9wljfVaO.d.ts +10 -0
  35. package/dist/sky.d.ts +158 -0
  36. package/dist/sky.js +377 -0
  37. package/dist/techniques.d.ts +410 -0
  38. package/dist/techniques.js +830 -0
  39. package/dist/timing.d.ts +473 -0
  40. package/dist/timing.js +904 -0
  41. package/dist/{types-CeafogFp.d.ts → types-B4MCoCCS.d.ts} +35 -4
  42. package/dist/tzdb-2025c-00-6GVG6RYL.js +6 -0
  43. package/dist/tzdb-2025c-01-CEYMG3LE.js +6 -0
  44. package/dist/tzdb-2025c-02-NWQJCVUU.js +6 -0
  45. package/dist/tzdb-2025c-03-PLHP6VH4.js +6 -0
  46. package/dist/tzdb-2025c-04-MEKUJA6M.js +6 -0
  47. package/dist/tzdb-2025c-05-3K5YKZBL.js +6 -0
  48. package/dist/tzdb-2025c-06-L2VV5XJV.js +6 -0
  49. package/dist/tzdb-2025c-07-H3GLGJGY.js +6 -0
  50. package/dist/tzdb-2025c-08-DA7QQIGD.js +6 -0
  51. package/dist/tzdb-2025c-09-MTXIO3QL.js +6 -0
  52. package/dist/tzdb-2025c-10-ASL4UW5C.js +6 -0
  53. package/dist/tzdb-2025c-11-EQEOANYB.js +6 -0
  54. package/dist/tzdb-2025c-12-NKCCXJ5G.js +6 -0
  55. package/dist/tzdb-2025c-13-DYTF3UC7.js +6 -0
  56. package/dist/tzdb-2025c-14-C25H45R5.js +6 -0
  57. package/dist/tzdb-2025c-15-7OYYZWRY.js +6 -0
  58. package/dist/vedic.d.ts +393 -0
  59. package/dist/vedic.js +930 -0
  60. package/dist/window.d.ts +178 -0
  61. package/dist/window.js +961 -0
  62. package/package.json +31 -3
  63. package/dist/chunk-GFT24GFR.js +0 -25
  64. package/dist/internal-math-BE2hcSHd.d.ts +0 -271
package/dist/index.d.ts CHANGED
@@ -1,203 +1,10 @@
1
- import { DeltaT } from './deltat.js';
2
- export { DELTA_T_MODEL, DELTA_T_TABLE, DeltaTSegment, DeltaTTable, deltaT, deltaTAt } from './deltat.js';
3
- import { B as BodyName, b as Chart, d as BirthInput, D as DateInput, e as ChartPoints, M as MoonPhase, a as BodyPosition, S as SynastryResult, T as TransitResult, f as Sect, g as MinimalBody, E as Element, I as InterAspect, h as Modality, P as PairSummary } from './types-CeafogFp.js';
4
- export { A as Angles, i as Aspect, j as AspectType, c as ChartFlag, C as ChartInput, k as ENGINE_VERSION, l as EPHEMERIS, m as HouseNumber, H as HouseSystem, n as Houses, o as MoonPhaseName, p as PointName, q as PointPosition, r as Polarity, s as SignDefinition, Z as ZodiacSign } from './types-CeafogFp.js';
5
- import { LongitudeCrossing, CrossingSearchOptions, CrossingSearchResult } from './crossings.js';
6
- export { BodyLongitudeAt, findLongitudeCrossingsWith, searchLongitudeCrossingsWith } from './crossings.js';
7
- export { A as ASPECTS, a as ASPECT_BODIES, b as ASPECT_TYPES, c as AngleInput, d as AspectDefinition, e as AspectMotion, E as ELEMENTS, H as HOUSE_SYSTEMS, M as MODALITIES, P as PLACIDUS_POLAR_FALLBACK, f as POLAR_FALLBACK, g as POLAR_UNDEFINED_HOUSE_SYSTEMS, S as SIGNS, h as SIGN_NAMES, i as STATIONARY_RELATIVE_SPEED, j as alcabitiusCusps, k as aspectMotion, l as campanusCusps, m as computeAngles, n as computeHouses, o as degreeInSign, p as eastPointOf, q as equalCusps, r as equalMcCusps, s as findAspects, t as houseOf, u as isPolarUndefinedHouseSystem, v as kochCusps, w as matchAspect, x as meanObliquity, y as meridianCusps, z as morinusCusps, B as normalizeLongitude, C as placidusCusps, D as porphyryCusps, F as ramcOf, G as regiomontanusCusps, I as separation, J as signForLongitude, K as signIndexForLongitude, L as topocentricCusps, N as vehlowCusps, O as vertexOf, Q as wholeSignCusps } from './internal-math-BE2hcSHd.js';
8
-
9
- /** Geometry over full ecliptic positions; no independent ephemeris is implied. */
10
-
11
- /** Site-compatible maximum orb, in degrees, for a pair without Sun or Moon. */
12
- declare const DECLINATION_ORB = 1;
13
- /** Site-compatible maximum orb when either identifier is exactly Sun or Moon. */
14
- declare const DECLINATION_ORB_LUMINARY = 1.5;
15
- interface DeclinationOrbPolicy {
16
- /** Inclusive maximum difference in degrees for an ordinary pair. */
17
- orb: number;
18
- /** Inclusive maximum when Sun or Moon is a member of the pair. */
19
- luminaryOrb: number;
20
- }
21
- declare const DEFAULT_DECLINATION_ORB_POLICY: Readonly<DeclinationOrbPolicy>;
22
- /**
23
- * Horizontal unit-vector magnitude below which RA is numerically undefined.
24
- * This is a floating-point singularity convention, not a physical error bound.
25
- */
26
- declare const RA_POLE_TOLERANCE: number;
27
- /**
28
- * Degrees of ecliptic latitude within which a supplied row labelled exactly
29
- * "Sun" is never flagged out of bounds by declinationsForBodies, by convention
30
- * (0.001°, 3.6″). A chart's own Sun, in chartDeclinations, is exempt at any
31
- * latitude. See outOfBounds.
32
- */
33
- declare const SUN_BOUND_LATITUDE = 0.001;
34
- interface EquatorialCoordinates {
35
- /** Right ascension in degrees [0,360), or null at a numerical celestial pole. */
36
- ra: number | null;
37
- /** Declination in degrees [-90,90], north positive. */
38
- dec: number;
39
- /** False exactly when ra is null; consult RA_POLE_TOLERANCE. */
40
- raDefined: boolean;
41
- }
42
- interface DeclinationBody {
43
- body: string;
44
- /** Ecliptic longitude in degrees; finite values wrap into [0,360). */
45
- lon: number;
46
- /** Full ecliptic latitude in degrees [-90,90], not an assumed zero. */
47
- lat: number;
48
- }
49
- interface DeclinationRow extends DeclinationBody, EquatorialCoordinates {
50
- /**
51
- * Strictly |declination| > the supplied true obliquity, with no uncertainty
52
- * allowance, except for the Sun, by convention. In chartDeclinations the
53
- * chart's own Sun row is never out of bounds, at any latitude. In
54
- * declinationsForBodies a row labelled exactly "Sun" is exempt while its
55
- * ecliptic latitude is within SUN_BOUND_LATITUDE, and flagged by the strict
56
- * rule beyond it. The real Sun does pass the bound at about half of all
57
- * solstices, by up to about 1.1″, but the ephemeris's solar declination is
58
- * off by up to about 2.7″ near the present and its solar latitude by tens of
59
- * arcseconds far from it (−68″ in year 2, +26″ in 3902), more than the
60
- * effect, so the flag could not say which.
61
- */
62
- outOfBounds: boolean;
63
- /**
64
- * |declination| − trueObliquity, in arcseconds: positive beyond the bound,
65
- * negative inside it. For every row but the exempt Sun, outOfBounds is
66
- * exactly boundMarginArcsec > 0. The flag describes the ephemeris's position;
67
- * it agrees with the real sky only where |boundMarginArcsec| exceeds the
68
- * ephemeris's declination error for that body (see the README).
69
- */
70
- boundMarginArcsec: number;
71
- }
72
- type DeclinationAspectType = "parallel" | "contraparallel";
73
- interface DeclinationAspect {
74
- a: string;
75
- b: string;
76
- type: DeclinationAspectType;
77
- /**
78
- * Degrees from the selected parallel or contraparallel: the exact
79
- * min(|decA − decB|, |decA + decB|) of the two declination doubles,
80
- * rounded to the nearest double.
81
- */
82
- orb: number;
83
- /** Inclusive maximum allowed by the explicit pair policy. */
84
- maximumOrb: number;
85
- decA: number;
86
- decB: number;
87
- /**
88
- * Ecliptic-longitude separation of the two supplied longitudes, reduced
89
- * exactly modulo 360, in degrees [0,180]; not sky separation. Rounded once.
90
- */
91
- separation: number;
92
- }
93
- interface Declinations {
94
- /**
95
- * True obliquity of date in degrees: the bound for out-of-bounds flags. From
96
- * chartDeclinations it is astronomy-engine's, at the chart instant on its TT
97
- * clock: the IAU 2006 mean obliquity plus astronomy-engine's five-term
98
- * truncation of the IAU 2000B nutation in obliquity. Elsewhere it is the
99
- * value supplied.
100
- */
101
- trueObliquity: number;
102
- rows: DeclinationRow[];
103
- aspects: DeclinationAspect[];
104
- orbPolicy: DeclinationOrbPolicy;
105
- convention: "true-equator-and-equinox-of-date; full-ecliptic-longitude-and-latitude";
106
- /** This derived feature is not asserted to be covered by the natal receipt. */
107
- receiptScope: "not-included-in-natal-receipt";
108
- }
109
- interface ChartDeclinations extends Declinations {
110
- /** Observation instant, retaining the engine's UTC-label/UT1 convention. */
111
- utc: string;
112
- /** The evaluated provider Delta-T used to obtain true obliquity. */
113
- deltaT: DeltaT;
114
- }
115
- /**
116
- * Rotate full ecliptic longitude/latitude into the equator associated with the
117
- * explicitly supplied true obliquity. Both angles and the obliquity are degrees.
118
- * The source frame/corrections must already be appropriate: this rotation does
119
- * not add light time, aberration, precession or an ephemeris precision guarantee.
120
- */
121
- declare function eclipticToEquatorial(longitudeDeg: number, latitudeDeg: number, trueObliquityDeg: number): EquatorialCoordinates;
122
- /** Declination from full longitude/latitude and explicitly supplied obliquity. */
123
- declare function declinationOf(lon: number, lat: number, trueObliquity: number): number;
124
- /** Inclusive pair allowance; the returned value makes the applied policy explicit. */
125
- declare function declinationOrb(a: string, b: string, policy?: Readonly<DeclinationOrbPolicy>): number;
126
- /**
127
- * Site-compatible nearest declination aspect for each supplied pair. Inclusive
128
- * orbs, decided exactly on the declination doubles; a parallel wins an exact
129
- * tie at the equator. Every supplied body is eligible, including nodes; no
130
- * longitude-aspect body filter is inferred.
131
- */
132
- declare function findDeclinationAspects(bodies: readonly DeclinationBody[], trueObliquity: number, policy?: Readonly<DeclinationOrbPolicy>): DeclinationAspect[];
133
- /** Pure derived output; the chart wrapper supplies a provider obliquity of date. */
134
- declare function declinationsForBodies(bodies: readonly DeclinationBody[], trueObliquity: number, policy?: Readonly<DeclinationOrbPolicy>): Declinations;
135
-
136
- interface ReturnSeason {
137
- /** One-based return number. */
138
- index: number;
139
- crossings: LongitudeCrossing[];
140
- first: Date;
141
- last: Date;
142
- }
143
- interface SaturnReturnResult {
144
- natalLon: number;
145
- natalRetrograde: boolean;
146
- seasons: ReturnSeason[];
147
- }
148
- /**
149
- * Every instant in (from, to] when `body` sits exactly on `targetLongitude`,
150
- * from the engine's apparent geocentric longitudes, in time order. This is
151
- * {@link findLongitudeCrossingsWith} on the engine's ephemeris, with its
152
- * conventions: a root exactly at `from` is not reported and one exactly at
153
- * `to` is, an exact sample is reported once, and a pair of crossings around a
154
- * station that falls between two samples is found and kept. There is no
155
- * sample budget; {@link searchLongitudeCrossings} takes one and refuses
156
- * instead of throwing. Invalid input throws RangeError.
157
- */
158
- declare function findLongitudeCrossings(body: BodyName, targetLongitude: number, from: Date, to: Date, stepDays?: number): LongitudeCrossing[];
159
- /**
160
- * {@link findLongitudeCrossings} under an optional budget of ephemeris
161
- * evaluations, `maxSamples`, with the step as `stepDays` (default 5). Over
162
- * budget, it returns `{ status: "refused", reason: "sample-budget" }` with no
163
- * crossings rather than throwing.
164
- */
165
- declare function searchLongitudeCrossings(body: BodyName, targetLongitude: number, from: Date, to: Date, options?: CrossingSearchOptions): CrossingSearchResult;
166
- declare function groupIntoSeasons(crossings: readonly LongitudeCrossing[], gapDays?: number): ReturnSeason[];
167
-
168
- type NatalSource = Chart | BirthInput;
169
- type SaturnReturnSource = NatalSource | DateInput;
170
- /**
171
- * Apparent geocentric tropical positions for an instant. Speeds are sampled
172
- * up to six hours either side of it, so an instant nearer either end of the
173
- * Date range, or one astronomy-engine cannot evaluate, throws RangeError.
174
- */
175
- declare function positions(date: DateInput): BodyPosition[];
176
- /** Build a natal chart from an already resolved UTC instant. */
177
- declare function natalChart(birth: BirthInput): Chart;
178
- /**
179
- * Equatorial coordinates and declination aspects derived from a natal chart's
180
- * full ecliptic positions, on its own Delta T clock. A supplied Chart's
181
- * numerical positions remain caller claims, as with chartPoints and synastry.
182
- * This additional analysis is not included in the natal receipt.
183
- */
184
- declare function chartDeclinations(natal: NatalSource): ChartDeclinations;
185
- /**
186
- * The chart's points: the mean lunar node and its opposite, and Black Moon
187
- * Lilith (the mean lunar apogee), for any chart; with a birth time and place,
188
- * also the Vertex, the East Point, the chart's sect and the seven lots of
189
- * Paulus Alexandrinus. A supplied Chart is checked as `transits` checks one;
190
- * its lots are taken from its own ascendant and bodies.
191
- */
192
- declare function chartPoints(natal: NatalSource): ChartPoints;
193
- /** Snapshot of current positions and their major aspects to a natal chart. */
194
- declare function transits(natal: NatalSource, date: DateInput): TransitResult;
195
- /** Major inter-chart aspects and element/modality balances. */
196
- declare function synastry(first: NatalSource, second: NatalSource): SynastryResult;
197
- /** High-precision Moon phase derived from the same positions as charts. */
198
- declare function moonPhase(date: DateInput): MoonPhase;
199
- /** Natal Saturn and return seasons through approximately age 92. */
200
- declare function saturnReturn(birth: SaturnReturnSource): SaturnReturnResult;
1
+ export { C as ChartDeclinations, D as DECLINATION_ORB, a as DECLINATION_ORB_LUMINARY, b as DEFAULT_DECLINATION_ORB_POLICY, c as DeclinationAspect, d as DeclinationAspectType, e as DeclinationBody, f as DeclinationOrbPolicy, g as DeclinationRow, h as Declinations, E as EquatorialCoordinates, N as NatalSource, R as RA_POLE_TOLERANCE, i as ReturnSeason, S as SUN_BOUND_LATITUDE, j as SaturnReturnResult, k as SaturnReturnSource, l as chartDeclinations, m as chartPoints, n as declinationOf, o as declinationOrb, p as declinationsForBodies, q as eclipticToEquatorial, r as findDeclinationAspects, s as findLongitudeCrossings, t as groupIntoSeasons, u as moonPhase, v as natalChart, w as positions, x as saturnReturn, y as searchLongitudeCrossings, z as synastry, A as transits } from './api-VOW6Umy5.js';
2
+ import { D as DateInput, c as BodyPosition, k as Sect, l as MinimalBody, E as Element, I as InterAspect, m as Modality, P as PairSummary } from './types-B4MCoCCS.js';
3
+ export { A as Angles, n as Aspect, g as AspectType, f as BirthInput, B as BodyName, d as Chart, e as ChartFlag, C as ChartInput, i as ChartPoints, o as ENGINE_VERSION, p as EPHEMERIS, b as HouseNumber, H as HouseSystem, a as Houses, L as LeapSeconds, M as MoonPhase, q as MoonPhaseName, r as PointName, s as PointPosition, t as Polarity, u as SignDefinition, S as SynastryResult, h as TimeScale, T as TimeScaleName, j as TransitResult, U as Ut1MinusUtc, Z as ZodiacSign } from './types-B4MCoCCS.js';
4
+ export { A as ASPECTS, a as ASPECT_BODIES, b as ASPECT_TYPES, c as AspectDefinition, d as AspectMotion, E as ELEMENTS, M as MODALITIES, S as SIGNS, e as SIGN_NAMES, f as STATIONARY_RELATIVE_SPEED, g as aspectMotion, h as degreeInSign, i as findAspects, m as matchAspect, n as normalizeLongitude, s as separation, j as signForLongitude, k as signIndexForLongitude } from './internal-math-CmJ9xtaW.js';
5
+ export { A as AngleInput, H as HOUSE_SYSTEMS, P as PLACIDUS_POLAR_FALLBACK, a as POLAR_FALLBACK, b as POLAR_UNDEFINED_HOUSE_SYSTEMS, c as alcabitiusCusps, d as campanusCusps, e as computeAngles, f as computeHouses, g as eastPointOf, h as equalCusps, i as equalMcCusps, j as houseOf, k as isPolarUndefinedHouseSystem, l as kochCusps, m as meanObliquity, n as meridianCusps, o as morinusCusps, p as placidusCusps, q as porphyryCusps, r as ramcOf, s as regiomontanusCusps, t as topocentricCusps, v as vehlowCusps, u as vertexOf, w as wholeSignCusps } from './houses-q1O2GGp4.js';
6
+ export { DELTA_T_MODEL, DELTA_T_TABLE, DeltaT, DeltaTSegment, DeltaTTable, deltaT, deltaTAt } from './deltat.js';
7
+ export { BodyLongitudeAt, CrossingSearchOptions, CrossingSearchResult, LongitudeCrossing, findLongitudeCrossingsWith, searchLongitudeCrossingsWith } from './crossings.js';
201
8
 
202
9
  /** Fixed tropical-year convention for secondary progressions. */
203
10
  declare const PROGRESSION_DAYS_PER_YEAR = 365.2422;
@@ -475,4 +282,4 @@ declare function elementBalance(bodies: readonly MinimalBody[]): Record<Element,
475
282
  declare function modalityBalance(bodies: readonly MinimalBody[]): Record<Modality, number>;
476
283
  declare function summarizePair(first: readonly MinimalBody[], second: readonly MinimalBody[], topCount?: number): PairSummary;
477
284
 
478
- export { type AspectOrbInput, type AspectOrbLimits, type AspectPolicy, type AspectPolicyInput, type AspectPosition, type AspectRuleInput, BirthInput, BodyName, BodyPosition, CONFIGURED_ASPECT_ANGLES, Chart, type ChartDeclinations, ChartPoints, type ConfiguredAspect, type ConfiguredAspectMotion, type ConfiguredAspectResult, CrossingSearchOptions, CrossingSearchResult, DECLINATION_ORB, DECLINATION_ORB_LUMINARY, DEFAULT_ASPECT_POLICY, DEFAULT_DECLINATION_ORB_POLICY, DateInput, type DeclinationAspect, type DeclinationAspectType, type DeclinationBody, type DeclinationOrbPolicy, type DeclinationRow, type Declinations, DeltaT, EPHEMERIS_SPAN, Element, type EquatorialCoordinates, InterAspect, LOTS, LongitudeCrossing, type LotInputs, MEAN_LUNAR_INCLINATION, MinimalBody, Modality, MoonPhase, type NatalSource, PROGRESSION_DAYS_PER_YEAR, PairSummary, RA_POLE_TOLERANCE, REFERENCE_SPAN, type ResolvedAspectRule, type ReturnSeason, SUN_BOUND_LATITUDE, type SaturnReturnResult, type SaturnReturnSource, Sect, SynastryResult, TransitResult, antiscion, chartDeclinations, chartPoints, contraAntiscion, createAspectPolicy, declinationOf, declinationOrb, declinationsForBodies, eclipticToEquatorial, elementBalance, findConfiguredAspects, findDeclinationAspects, findInterAspects, findLongitudeCrossings, groupIntoSeasons, hellenisticLots, lunarMeanArguments, meanApogee, meanNodeLongitude, midpoint, modalityBalance, moonPhase, natalChart, outsideReferenceSpan, positions, progressedBodies, progressedInstant, saturnReturn, searchLongitudeCrossings, sectOf, summarizePair, synastry, transits };
285
+ export { type AspectOrbInput, type AspectOrbLimits, type AspectPolicy, type AspectPolicyInput, type AspectPosition, type AspectRuleInput, BodyPosition, CONFIGURED_ASPECT_ANGLES, type ConfiguredAspect, type ConfiguredAspectMotion, type ConfiguredAspectResult, DEFAULT_ASPECT_POLICY, DateInput, EPHEMERIS_SPAN, Element, InterAspect, LOTS, type LotInputs, MEAN_LUNAR_INCLINATION, MinimalBody, Modality, PROGRESSION_DAYS_PER_YEAR, PairSummary, REFERENCE_SPAN, type ResolvedAspectRule, Sect, antiscion, contraAntiscion, createAspectPolicy, elementBalance, findConfiguredAspects, findInterAspects, hellenisticLots, lunarMeanArguments, meanApogee, meanNodeLongitude, midpoint, modalityBalance, outsideReferenceSpan, progressedBodies, progressedInstant, sectOf, summarizePair };
package/dist/index.js CHANGED
@@ -1,13 +1,31 @@
1
+ import {
2
+ PROGRESSION_DAYS_PER_YEAR,
3
+ progressedBodies,
4
+ progressedInstant
5
+ } from "./chunk-I7O5EGFV.js";
6
+ import {
7
+ chartDeclinations,
8
+ chartPoints,
9
+ elementBalance,
10
+ findInterAspects,
11
+ findLongitudeCrossings,
12
+ groupIntoSeasons,
13
+ modalityBalance,
14
+ moonPhase,
15
+ natalChart,
16
+ positions,
17
+ saturnReturn,
18
+ searchLongitudeCrossings,
19
+ summarizePair,
20
+ synastry,
21
+ transits
22
+ } from "./chunk-L6ZHWJZ6.js";
23
+ import "./chunk-CPALRSPC.js";
1
24
  import {
2
25
  findLongitudeCrossingsWith,
3
26
  searchLongitudeCrossingsWith
4
27
  } from "./chunk-AECKV73C.js";
5
- import {
6
- assertDerivedFlags,
7
- snapshotFlags,
8
- timeFlags,
9
- validateBirthSettings
10
- } from "./chunk-PFGUCNOK.js";
28
+ import "./chunk-PFGUCNOK.js";
11
29
  import {
12
30
  DECLINATION_ORB,
13
31
  DECLINATION_ORB_LUMINARY,
@@ -15,17 +33,11 @@ import {
15
33
  LOTS,
16
34
  MEAN_LUNAR_INCLINATION,
17
35
  RA_POLE_TOLERANCE,
18
- SPEED_STEP_DAYS,
19
36
  SUN_BOUND_LATITUDE,
20
37
  absolute,
21
38
  antiscion,
22
- bodyLongitude,
23
39
  checkedBodyLabel,
24
40
  compareExact,
25
- computeBodies,
26
- computeChart,
27
- computeChartDeclinations,
28
- computePoints,
29
41
  contraAntiscion,
30
42
  declinationOf,
31
43
  declinationOrb,
@@ -35,7 +47,6 @@ import {
35
47
  exactSum,
36
48
  findDeclinationAspects,
37
49
  hellenisticLots,
38
- longitudeSpeed,
39
50
  lunarMeanArguments,
40
51
  meanApogee,
41
52
  meanNodeLongitude,
@@ -43,7 +54,18 @@ import {
43
54
  roundedValue,
44
55
  sectOf,
45
56
  signOf
46
- } from "./chunk-RETEVD4F.js";
57
+ } from "./chunk-WOU7JVD3.js";
58
+ import {
59
+ EPHEMERIS_SPAN,
60
+ REFERENCE_SPAN,
61
+ outsideReferenceSpan
62
+ } from "./chunk-KHBLFXFG.js";
63
+ import {
64
+ DELTA_T_MODEL,
65
+ DELTA_T_TABLE,
66
+ deltaT,
67
+ deltaTAt
68
+ } from "./chunk-ONBZ4HK7.js";
47
69
  import {
48
70
  HOUSE_SYSTEMS,
49
71
  PLACIDUS_POLAR_FALLBACK,
@@ -70,21 +92,7 @@ import {
70
92
  vehlowCusps,
71
93
  vertexOf,
72
94
  wholeSignCusps
73
- } from "./chunk-4OSOCZY2.js";
74
- import {
75
- dateFrom
76
- } from "./chunk-CPALRSPC.js";
77
- import {
78
- EPHEMERIS_SPAN,
79
- REFERENCE_SPAN,
80
- outsideReferenceSpan
81
- } from "./chunk-GFT24GFR.js";
82
- import {
83
- DELTA_T_MODEL,
84
- DELTA_T_TABLE,
85
- deltaT,
86
- deltaTAt
87
- } from "./chunk-ONBZ4HK7.js";
95
+ } from "./chunk-4NV4ZEFZ.js";
88
96
  import {
89
97
  ASPECTS,
90
98
  ASPECT_BODIES,
@@ -104,292 +112,7 @@ import {
104
112
  separation,
105
113
  signForLongitude,
106
114
  signIndexForLongitude
107
- } from "./chunk-NAJ735VN.js";
108
-
109
- // src/returns.ts
110
- var DAY = 864e5;
111
- function validMilliseconds(date, label) {
112
- if (!(date instanceof Date)) throw new RangeError(`${label} must be a valid Date.`);
113
- const milliseconds = Date.prototype.getTime.call(date);
114
- if (!Number.isFinite(milliseconds)) throw new RangeError(`${label} must be a valid Date.`);
115
- return milliseconds;
116
- }
117
- function findLongitudeCrossings(body, targetLongitude, from, to, stepDays = 5) {
118
- return findLongitudeCrossingsWith(bodyLongitude, body, targetLongitude, from, to, stepDays);
119
- }
120
- function searchLongitudeCrossings(body, targetLongitude, from, to, options) {
121
- return searchLongitudeCrossingsWith(bodyLongitude, body, targetLongitude, from, to, options);
122
- }
123
- function groupIntoSeasons(crossings, gapDays = 400) {
124
- if (!Number.isFinite(gapDays) || gapDays <= 0) {
125
- throw new RangeError("gapDays must be positive.");
126
- }
127
- const seasons = [];
128
- for (const crossing of crossings) {
129
- const current = seasons.at(-1);
130
- if (current && crossing.at.getTime() - current.last.getTime() <= gapDays * DAY) {
131
- current.crossings.push(crossing);
132
- current.last = crossing.at;
133
- } else {
134
- seasons.push({
135
- index: seasons.length + 1,
136
- crossings: [crossing],
137
- first: crossing.at,
138
- last: crossing.at
139
- });
140
- }
141
- }
142
- return seasons;
143
- }
144
- function computeSaturnReturns(birthUtc) {
145
- const birthTime = validMilliseconds(birthUtc, "Birth date");
146
- const before = new Date(birthTime - SPEED_STEP_DAYS * DAY);
147
- const after = new Date(birthTime + SPEED_STEP_DAYS * DAY);
148
- const from = new Date(birthTime + 26 * 365.25 * DAY);
149
- const to = new Date(birthTime + 92 * 365.25 * DAY);
150
- validMilliseconds(before, "Natal speed window start");
151
- validMilliseconds(after, "Natal speed window end");
152
- validMilliseconds(from, "Saturn return window start");
153
- validMilliseconds(to, "Saturn return window end");
154
- const natalLon = bodyLongitude("Saturn", birthUtc);
155
- const speed = longitudeSpeed("Saturn", birthUtc);
156
- return {
157
- natalLon,
158
- natalRetrograde: speed < 0,
159
- seasons: groupIntoSeasons(findLongitudeCrossings("Saturn", natalLon, from, to))
160
- };
161
- }
162
-
163
- // src/synastry.ts
164
- function findInterAspects(first, second) {
165
- const aBodies = first.filter((body) => ASPECT_BODIES.has(body.body));
166
- const bBodies = second.filter((body) => ASPECT_BODIES.has(body.body));
167
- const aspects = [];
168
- for (const a of aBodies) {
169
- for (const b of bBodies) {
170
- const match = matchAspect(a.body, a.lon, b.body, b.lon);
171
- if (!match) continue;
172
- aspects.push({
173
- a: a.body,
174
- aLon: a.lon,
175
- b: b.body,
176
- bLon: b.lon,
177
- type: match.definition.type,
178
- orb: match.orb
179
- });
180
- }
181
- }
182
- return aspects.sort((a, b) => a.orb - b.orb);
183
- }
184
- function elementBalance(bodies) {
185
- const balance = {
186
- fire: 0,
187
- earth: 0,
188
- air: 0,
189
- water: 0
190
- };
191
- for (const body of bodies) {
192
- if (!ASPECT_BODIES.has(body.body)) continue;
193
- balance[signForLongitude(body.lon).element] += 1;
194
- }
195
- return balance;
196
- }
197
- function modalityBalance(bodies) {
198
- const balance = {
199
- cardinal: 0,
200
- fixed: 0,
201
- mutable: 0
202
- };
203
- for (const body of bodies) {
204
- if (!ASPECT_BODIES.has(body.body)) continue;
205
- balance[signForLongitude(body.lon).modality] += 1;
206
- }
207
- return balance;
208
- }
209
- function summarizePair(first, second, topCount = 8) {
210
- if (!Number.isInteger(topCount) || topCount < 0) {
211
- throw new RangeError("topCount must be a non-negative integer.");
212
- }
213
- const aspects = findInterAspects(first, second);
214
- const counts = {
215
- conjunction: 0,
216
- sextile: 0,
217
- square: 0,
218
- trine: 0,
219
- opposition: 0
220
- };
221
- for (const aspect of aspects) counts[aspect.type] += 1;
222
- return {
223
- aspects,
224
- top: aspects.slice(0, topCount),
225
- counts,
226
- easeful: counts.trine + counts.sextile,
227
- charged: counts.square + counts.opposition,
228
- elements: {
229
- a: elementBalance(first),
230
- b: elementBalance(second)
231
- },
232
- modalities: {
233
- a: modalityBalance(first),
234
- b: modalityBalance(second)
235
- }
236
- };
237
- }
238
-
239
- // src/api.ts
240
- function isChart(value) {
241
- if (!value || typeof value !== "object") return false;
242
- const candidate = value;
243
- return Array.isArray(candidate.bodies) && Array.isArray(candidate.aspects) && candidate.input?.utc instanceof Date;
244
- }
245
- function isBirth(value) {
246
- return Boolean(value && typeof value === "object" && "utc" in value);
247
- }
248
- function resolvedChart(source) {
249
- if (!isChart(source)) {
250
- const chart = natalChart(source);
251
- return { chart, utc: chart.input.utc };
252
- }
253
- const sourceInput = source.input;
254
- const { input, flags: inputFlags } = validateBirth(sourceInput);
255
- const resultFlags = snapshotFlags(source.flags);
256
- const expected = timeFlags(inputFlags?.values ?? []);
257
- const hasHouses = input.timeKnown && input.latitude !== void 0;
258
- const houses = source.houses;
259
- const angles = source.angles;
260
- const actualHouseSystem = houses?.system;
261
- if ((hasHouses ? !angles || typeof angles !== "object" || Array.isArray(angles) || !houses || typeof houses !== "object" || Array.isArray(houses) : angles !== null || houses !== null) || houses !== null && actualHouseSystem !== input.houseSystem && !(isPolarUndefinedHouseSystem(input.houseSystem) && actualHouseSystem === POLAR_FALLBACK)) {
262
- throw new RangeError("chart flags must agree with its input and supplied house result.");
263
- }
264
- if (!input.timeKnown) expected.push("no-time");
265
- if (isPolarUndefinedHouseSystem(input.houseSystem) && actualHouseSystem === POLAR_FALLBACK) {
266
- expected.push("polar-fallback");
267
- }
268
- if (outsideReferenceSpan(input.utc)) expected.push("outside-reference-span");
269
- assertDerivedFlags(inputFlags?.values ?? [], expected);
270
- if (resultFlags.values.length !== expected.length || !expected.every((flag) => resultFlags.values.includes(flag))) {
271
- throw new RangeError("chart flags must agree with its input and supplied house result.");
272
- }
273
- const canonicalInputFlags = input.flags ?? [];
274
- const inputChanged = inputFlags !== void 0 && (inputFlags.hasDuplicates || inputFlags.values.length !== canonicalInputFlags.length);
275
- const resultChanged = resultFlags.hasDuplicates || !expected.every((flag, index) => flag === resultFlags.values[index]);
276
- if (!inputChanged && !resultChanged) return { chart: source, utc: input.utc };
277
- return {
278
- chart: {
279
- ...source,
280
- input: inputChanged ? input : sourceInput,
281
- flags: expected
282
- },
283
- utc: input.utc
284
- };
285
- }
286
- function validateBirth(birth) {
287
- if (!birth || typeof birth !== "object" || Array.isArray(birth)) {
288
- throw new RangeError("birth must be an object containing a resolved utc instant.");
289
- }
290
- const settings = validateBirthSettings(birth);
291
- const supplied = birth.flags;
292
- const flags = supplied === void 0 ? void 0 : snapshotFlags(supplied);
293
- const utc = dateFrom(birth.utc, "birth.utc");
294
- const pin = birth.deltaT;
295
- if (pin !== void 0 && (typeof pin !== "number" || !Number.isFinite(pin) || Math.abs(pin) > 1e10)) {
296
- throw new RangeError("deltaT must be a finite number of seconds, at most 1e10 in size.");
297
- }
298
- const possible = [];
299
- if (settings.timeKnown === false) possible.push("no-time");
300
- else if (settings.houseSystem !== void 0 && isPolarUndefinedHouseSystem(settings.houseSystem) && settings.latitude !== void 0) {
301
- possible.push("polar-fallback");
302
- }
303
- if (outsideReferenceSpan(utc)) possible.push("outside-reference-span");
304
- assertDerivedFlags(flags?.values ?? [], possible);
305
- const input = {
306
- utc,
307
- houseSystem: settings.houseSystem ?? "whole",
308
- timeKnown: settings.timeKnown ?? true,
309
- ...settings.latitude === void 0 ? {} : { latitude: settings.latitude, longitude: settings.longitude },
310
- ...flags === void 0 ? {} : { flags: timeFlags(flags.values) },
311
- ...pin === void 0 ? {} : { deltaT: pin }
312
- };
313
- return { input, flags };
314
- }
315
- function computedBirth({ input, flags }) {
316
- const chart = computeChart(input);
317
- assertDerivedFlags(flags?.values ?? [], chart.flags);
318
- return chart;
319
- }
320
- function positions(date) {
321
- return computeBodies(dateFrom(date, "date"));
322
- }
323
- function natalChart(birth) {
324
- return computedBirth(validateBirth(birth));
325
- }
326
- function chartDeclinations(natal) {
327
- return computeChartDeclinations(resolvedChart(natal).chart);
328
- }
329
- function chartPoints(natal) {
330
- const { chart } = resolvedChart(natal);
331
- return computePoints(chart);
332
- }
333
- function transits(natal, date) {
334
- const { chart } = resolvedChart(natal);
335
- const at = dateFrom(date, "date");
336
- const current = computeBodies(at);
337
- return {
338
- natal: chart,
339
- at,
340
- positions: current,
341
- aspects: findInterAspects(current, chart.bodies)
342
- };
343
- }
344
- function synastry(first, second) {
345
- const { chart: a } = resolvedChart(first);
346
- const { chart: b } = resolvedChart(second);
347
- return { a, b, ...summarizePair(a.bodies, b.bodies) };
348
- }
349
- function phaseName(angle) {
350
- if (angle < 22.5 || angle >= 337.5) return "New Moon";
351
- if (angle < 67.5) return "Waxing Crescent";
352
- if (angle < 112.5) return "First Quarter";
353
- if (angle < 157.5) return "Waxing Gibbous";
354
- if (angle < 202.5) return "Full Moon";
355
- if (angle < 247.5) return "Waning Gibbous";
356
- if (angle < 292.5) return "Last Quarter";
357
- return "Waning Crescent";
358
- }
359
- function moonPhase(date) {
360
- const at = dateFrom(date, "date");
361
- const angle = normalizeLongitude(bodyLongitude("Moon", at) - bodyLongitude("Sun", at));
362
- return {
363
- at,
364
- angle,
365
- illumination: (1 - Math.cos(angle * Math.PI / 180)) / 2,
366
- name: phaseName(angle),
367
- waxing: angle < 180
368
- };
369
- }
370
- function saturnReturn(birth) {
371
- let utc;
372
- if (isChart(birth)) {
373
- utc = resolvedChart(birth).utc;
374
- } else if (isBirth(birth)) {
375
- const validated = validateBirth(birth);
376
- utc = validated.flags?.values.includes("polar-fallback") ? computedBirth(validated).input.utc : validated.input.utc;
377
- } else utc = dateFrom(birth, "birth");
378
- return computeSaturnReturns(utc);
379
- }
380
-
381
- // src/progressions.ts
382
- var PROGRESSION_DAYS_PER_YEAR = 365.2422;
383
- var DAY_MS = 864e5;
384
- function progressedInstant(birthUtc, target) {
385
- const birth = dateFrom(birthUtc, "birthUtc");
386
- const at = dateFrom(target, "target");
387
- const yearsLived = (at.getTime() - birth.getTime()) / (PROGRESSION_DAYS_PER_YEAR * DAY_MS);
388
- return new Date(birth.getTime() + yearsLived * DAY_MS);
389
- }
390
- function progressedBodies(birthUtc, target) {
391
- return computeBodies(progressedInstant(birthUtc, target));
392
- }
115
+ } from "./chunk-2OWGBT3O.js";
393
116
 
394
117
  // src/configured-aspects.ts
395
118
  var CONFIGURED_ASPECT_ANGLES = Object.freeze({