@zodiacs/engine 2.0.0-rc.2 → 2.0.0-rc.3

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 (70) hide show
  1. package/CHANGELOG.md +168 -0
  2. package/LICENSING.md +21 -7
  3. package/NOTICE +19 -9
  4. package/README.md +150 -38
  5. package/dist/{api-C_SVd9BJ.d.ts → api-G8RVGizH.d.ts} +1 -1
  6. package/dist/{ayanamsa-Clgkekhh.d.ts → ayanamsa-C4-pYjzm.d.ts} +2 -2
  7. package/dist/calc.d.ts +4 -4
  8. package/dist/calc.js +13 -9
  9. package/dist/{chunk-WONTOC5W.js → chunk-4RCOOAGI.js} +1 -1
  10. package/dist/{chunk-IXFUYEUF.js → chunk-EEKVS6W7.js} +17 -4
  11. package/dist/{chunk-N4UQLCBN.js → chunk-FXNA2TJM.js} +1 -1
  12. package/dist/{chunk-NX4PHQBL.js → chunk-JY2LU4VC.js} +61 -80
  13. package/dist/{chunk-B5LKF437.js → chunk-M65JXRFN.js} +40 -0
  14. package/dist/{chunk-PNXIA7MI.js → chunk-PU4HNPRX.js} +9 -4
  15. package/dist/{chunk-T6F4FYYS.js → chunk-QLQRN6RY.js} +1 -1
  16. package/dist/{chunk-FVGA776A.js → chunk-XINOD63H.js} +2 -2
  17. package/dist/{chunk-I3L4POY7.js → chunk-XO7MHH32.js} +2 -1
  18. package/dist/core.d.ts +21 -0
  19. package/dist/core.js +2953 -0
  20. package/dist/crossings.d.ts +2 -2
  21. package/dist/de440-pack.d.ts +2 -2
  22. package/dist/de440.d.ts +2 -2
  23. package/dist/{ephemeris-D1lM832F.d.ts → ephemeris-Bnmowcsk.d.ts} +1 -1
  24. package/dist/geo.d.ts +74 -16
  25. package/dist/geo.js +139 -5
  26. package/dist/{houses-icK01yXi.d.ts → houses-CAiYEICK.d.ts} +1 -1
  27. package/dist/houses-extra.d.ts +3 -3
  28. package/dist/index.d.ts +8 -8
  29. package/dist/index.js +6 -6
  30. package/dist/{internal-math-BGX23p4h.d.ts → internal-math-rq6do9IR.d.ts} +2 -2
  31. package/dist/internal-math.d.ts +4 -4
  32. package/dist/internal-math.js +1 -1
  33. package/dist/internal.d.ts +4 -4
  34. package/dist/internal.js +3 -3
  35. package/dist/receipt.d.ts +3 -3
  36. package/dist/receipt.js +65 -26
  37. package/dist/{rulers-CpS9qkvu.d.ts → rulers-CFGiWJza.d.ts} +1 -1
  38. package/dist/sky.d.ts +4 -4
  39. package/dist/sky.js +3 -3
  40. package/dist/techniques.d.ts +4 -4
  41. package/dist/techniques.js +9 -9
  42. package/dist/{time-bands-CZA9AlLg.d.ts → time-bands-BCmfa8FR.d.ts} +5 -4
  43. package/dist/{time-scale-DIFNa0gz.d.ts → time-scale-9vmKQPCn.d.ts} +14 -4
  44. package/dist/time.d.ts +3 -3
  45. package/dist/time.js +2 -2
  46. package/dist/timing.d.ts +5 -5
  47. package/dist/timing.js +6 -6
  48. package/dist/{types-BCnyWBQZ.d.ts → types-CkuiCcsV.d.ts} +7 -4
  49. package/dist/{tzdb-2025c-00-6GVG6RYL.js → tzdb-2026f-00-RAB4YONA.js} +4 -4
  50. package/dist/{tzdb-2025c-01-CEYMG3LE.js → tzdb-2026f-01-SWR7EW5U.js} +4 -4
  51. package/dist/{tzdb-2025c-02-NWQJCVUU.js → tzdb-2026f-02-SOLHCLDL.js} +3 -3
  52. package/dist/{tzdb-2025c-03-PLHP6VH4.js → tzdb-2026f-03-LYLMCVL7.js} +3 -3
  53. package/dist/{tzdb-2025c-04-MEKUJA6M.js → tzdb-2026f-04-XTKMZPKX.js} +4 -4
  54. package/dist/{tzdb-2025c-05-3K5YKZBL.js → tzdb-2026f-05-EOKCMY5O.js} +4 -4
  55. package/dist/{tzdb-2025c-06-L2VV5XJV.js → tzdb-2026f-06-O4LQW2N6.js} +4 -4
  56. package/dist/{tzdb-2025c-07-H3GLGJGY.js → tzdb-2026f-07-2FDJ5OJ7.js} +4 -4
  57. package/dist/{tzdb-2025c-08-DA7QQIGD.js → tzdb-2026f-08-OKEWSMIX.js} +4 -4
  58. package/dist/{tzdb-2025c-09-MTXIO3QL.js → tzdb-2026f-09-5GB7FKLF.js} +4 -4
  59. package/dist/{tzdb-2025c-10-ASL4UW5C.js → tzdb-2026f-10-GXHCIASR.js} +4 -4
  60. package/dist/{tzdb-2025c-11-EQEOANYB.js → tzdb-2026f-11-66EMKXFG.js} +4 -4
  61. package/dist/{tzdb-2025c-12-NKCCXJ5G.js → tzdb-2026f-12-YK3CZCIY.js} +3 -3
  62. package/dist/{tzdb-2025c-13-DYTF3UC7.js → tzdb-2026f-13-UNZD3QIH.js} +4 -4
  63. package/dist/{tzdb-2025c-14-C25H45R5.js → tzdb-2026f-14-4FQNGNZM.js} +4 -4
  64. package/dist/{tzdb-2025c-15-7OYYZWRY.js → tzdb-2026f-15-5TA3B2WI.js} +4 -4
  65. package/dist/vedic.d.ts +4 -4
  66. package/dist/vedic.js +6 -6
  67. package/dist/window.d.ts +2 -2
  68. package/dist/window.js +8 -5
  69. package/dist/{zone-history-0XzMGx9V.d.ts → zone-history-2UYUKA43.d.ts} +26 -9
  70. package/package.json +7 -3
@@ -1,6 +1,6 @@
1
1
  import { DeltaT } from './deltat.js';
2
- import { a as TimeScaleName, T as TimeScale } from './time-scale-DIFNa0gz.js';
3
- import { e as DateInput } from './types-BCnyWBQZ.js';
2
+ import { a as TimeScaleName, T as TimeScale } from './time-scale-9vmKQPCn.js';
3
+ import { e as DateInput } from './types-CkuiCcsV.js';
4
4
 
5
5
  /** The precession model of an epoch value: the engine's IAU 2006, Newcomb's (Kinoshita 1975) or IAU 1976. */
6
6
  type AyanamsaPrecessionModel = "engine" | "newcomb" | "iau1976";
package/dist/calc.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { DeltaT } from './deltat.js';
2
2
  import { E as EPHEMERIS_SPAN } from './reference-span-CILpclrz.js';
3
- import { T as TimeBands } from './time-bands-CZA9AlLg.js';
4
- import { T as TimeScale, a as TimeScaleName } from './time-scale-DIFNa0gz.js';
5
- import { g as ChartFlag, B as BodyName, H as HouseSystem, d as Chart, A as Angles } from './types-BCnyWBQZ.js';
6
- import { A as AyanamsaName, a as AyanamsaPrecessionModel } from './ayanamsa-Clgkekhh.js';
3
+ import { T as TimeBands } from './time-bands-BCmfa8FR.js';
4
+ import { T as TimeScale, a as TimeScaleName } from './time-scale-9vmKQPCn.js';
5
+ import { g as ChartFlag, B as BodyName, H as HouseSystem, d as Chart, A as Angles } from './types-CkuiCcsV.js';
6
+ import { A as AyanamsaName, a as AyanamsaPrecessionModel } from './ayanamsa-C4-pYjzm.js';
7
7
 
8
8
  /**
9
9
  * The frames of the calc entry point. A position is first found as a vector on
package/dist/calc.js CHANGED
@@ -7,14 +7,14 @@ import {
7
7
  userAyanamsa,
8
8
  wholeSignCusps,
9
9
  wrap360
10
- } from "./chunk-FVGA776A.js";
10
+ } from "./chunk-XINOD63H.js";
11
11
  import {
12
12
  eclipticRows,
13
13
  equatorRows
14
14
  } from "./chunk-LWZS7HI3.js";
15
15
  import {
16
16
  timeBands
17
- } from "./chunk-I3L4POY7.js";
17
+ } from "./chunk-XO7MHH32.js";
18
18
  import "./chunk-47ERTK5X.js";
19
19
  import {
20
20
  bodyLongitude,
@@ -26,14 +26,14 @@ import {
26
26
  meanNodeLongitude,
27
27
  onChartClock,
28
28
  refuseUnderSource
29
- } from "./chunk-PNXIA7MI.js";
29
+ } from "./chunk-PU4HNPRX.js";
30
30
  import {
31
31
  dateFrom
32
32
  } from "./chunk-CPALRSPC.js";
33
33
  import {
34
34
  ENGINE_VERSION,
35
35
  EPHEMERIS
36
- } from "./chunk-T6F4FYYS.js";
36
+ } from "./chunk-QLQRN6RY.js";
37
37
  import {
38
38
  eclipticFrame,
39
39
  eclipticOfDate,
@@ -45,7 +45,7 @@ import {
45
45
  TIME_SCALE_NAMES,
46
46
  elapsedDays,
47
47
  timeBasis
48
- } from "./chunk-B5LKF437.js";
48
+ } from "./chunk-M65JXRFN.js";
49
49
  import {
50
50
  searchLongitudeCrossingsWith
51
51
  } from "./chunk-TSS2SZWQ.js";
@@ -72,7 +72,7 @@ import {
72
72
  snapshotFlags,
73
73
  timeFlags,
74
74
  validateBirthSettings
75
- } from "./chunk-WONTOC5W.js";
75
+ } from "./chunk-4RCOOAGI.js";
76
76
 
77
77
  // src/calc.ts
78
78
  import { AstroTime, GeoMoonState, KM_PER_AU as KM_PER_AU2 } from "astronomy-engine";
@@ -1113,10 +1113,14 @@ function events(request) {
1113
1113
  return { status: "refused", reason: "sample-budget", detail: `The search needs more than ${maxSamples} evaluations.`, samples, maxSamples };
1114
1114
  }
1115
1115
  let late = 0;
1116
+ let flagged = false;
1116
1117
  const events2 = found.crossings.map(({ at: at2, retrograde }) => {
1117
1118
  const basis = timeBasis(at2.getTime(), "utc");
1118
1119
  const utc = timeBands(basis).tt;
1119
- if (deltaTExtrapolated(basis)) late = Math.max(late, utc);
1120
+ if (deltaTExtrapolated(basis)) {
1121
+ flagged = true;
1122
+ late = Math.max(late, utc);
1123
+ }
1120
1124
  return {
1121
1125
  at: at2.toISOString(),
1122
1126
  jdUt1: J2000_JD + basis.ut1Days,
@@ -1130,7 +1134,7 @@ function events(request) {
1130
1134
  kind,
1131
1135
  events: events2,
1132
1136
  samples: found.samples,
1133
- flags: [...late ? ["delta-t-extrapolated"] : [], ...chosen.fallback ? [chosen.fallback] : []],
1137
+ flags: [...flagged ? ["delta-t-extrapolated"] : [], ...chosen.fallback ? [chosen.fallback] : []],
1134
1138
  bounds: {
1135
1139
  timing: stretched(
1136
1140
  {
@@ -1148,7 +1152,7 @@ function events(request) {
1148
1152
  [
1149
1153
  ...positionIds(body, "ecliptic-true-of-date", "geocentric", "apparent", zodiac, chosen.from !== null),
1150
1154
  "search:scan-and-bisect",
1151
- ...late ? ["bounds:plus-delta-t-band"] : []
1155
+ ...flagged ? ["bounds:plus-delta-t-band"] : []
1152
1156
  ],
1153
1157
  void 0,
1154
1158
  true,
@@ -50,7 +50,7 @@ var DERIVED_FLAGS = [
50
50
  "de440-unavailable",
51
51
  "outside-de440-span"
52
52
  ];
53
- var FLAGS = ["dst-gap", "dst-fold", "lmt", "calendar-unknown", ...DERIVED_FLAGS];
53
+ var FLAGS = ["dst-gap", "dst-fold", "lmt", "calendar-unknown", "host-zone-data-differs", ...DERIVED_FLAGS];
54
54
  function snapshotFlags(value) {
55
55
  const length = Array.isArray(value) ? Object.getOwnPropertyDescriptor(value, "length")?.value : void 0;
56
56
  if (typeof length !== "number" || !Number.isInteger(length) || length < 0 || length > 64) {
@@ -9,7 +9,7 @@ import {
9
9
  ephemerisAt,
10
10
  longitudeSpeed,
11
11
  notingFallbacks
12
- } from "./chunk-PNXIA7MI.js";
12
+ } from "./chunk-PU4HNPRX.js";
13
13
  import {
14
14
  dateFrom
15
15
  } from "./chunk-CPALRSPC.js";
@@ -17,12 +17,12 @@ import {
17
17
  ASPECT_BODY_SET,
18
18
  EPHEMERIS,
19
19
  matchAspect
20
- } from "./chunk-T6F4FYYS.js";
20
+ } from "./chunk-QLQRN6RY.js";
21
21
  import {
22
22
  TIME_SCALE_NAMES,
23
23
  outsideReferenceSpan,
24
24
  timeBasis
25
- } from "./chunk-B5LKF437.js";
25
+ } from "./chunk-M65JXRFN.js";
26
26
  import {
27
27
  findLongitudeCrossingsWith,
28
28
  searchLongitudeCrossingsWith
@@ -41,7 +41,7 @@ import {
41
41
  snapshotFlags,
42
42
  timeFlags,
43
43
  validateBirthSettings
44
- } from "./chunk-WONTOC5W.js";
44
+ } from "./chunk-4RCOOAGI.js";
45
45
 
46
46
  // src/returns.ts
47
47
  var DAY = 864e5;
@@ -244,6 +244,14 @@ var BIRTH_FIELDS = [
244
244
  "flags",
245
245
  "deltaT"
246
246
  ];
247
+ var NEAR_MISS_KEYS = [
248
+ ["latitude", ["lat"]],
249
+ ["longitude", ["lng", "lon", "long"]],
250
+ ["houseSystem", ["house", "houses", "hsys", "housesystem"]],
251
+ ["timeScale", ["scale", "time_scale"]],
252
+ ["deltaT", ["delta_t"]],
253
+ ["timeKnown", ["time_known", "unknownTime"]]
254
+ ];
247
255
  function noBareDate(value, name) {
248
256
  if (typeof value === "string" && !value.includes("T")) {
249
257
  throw new RangeError(
@@ -264,6 +272,11 @@ function validateBirth(birth) {
264
272
  const flags = supplied === void 0 ? void 0 : snapshotFlags(supplied);
265
273
  const suppliedUtc = birth.utc;
266
274
  const utc = dateFrom(suppliedUtc, "birth.utc");
275
+ for (const key of Object.keys(birth)) {
276
+ const lower = key.toLowerCase();
277
+ const near = NEAR_MISS_KEYS.find(([real, names]) => real !== key && names.some((name) => name.toLowerCase() === lower));
278
+ if (near) throw new RangeError(`birth has no field "${key}"; use "${near[0]}".`);
279
+ }
267
280
  const pin = birth.deltaT;
268
281
  if (pin !== void 0 && (typeof pin !== "number" || !Number.isFinite(pin) || Math.abs(pin) > 1e10)) {
269
282
  throw new RangeError("deltaT must be a finite number of seconds, at most 1e10 in size.");
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  computeBodies
3
- } from "./chunk-PNXIA7MI.js";
3
+ } from "./chunk-PU4HNPRX.js";
4
4
  import {
5
5
  dateFrom
6
6
  } from "./chunk-CPALRSPC.js";
@@ -4,9 +4,6 @@ import {
4
4
  julianDayNumber,
5
5
  parseCalendarDate
6
6
  } from "./chunk-KFTJMMG7.js";
7
- import {
8
- validateBirthSettings
9
- } from "./chunk-WONTOC5W.js";
10
7
 
11
8
  // src/geo/calendar.ts
12
9
  var GREGORIAN_ADOPTION_SOURCES = /* @__PURE__ */ Object.freeze({
@@ -61,7 +58,7 @@ function calendarNote(gregorianDate, calendar, country) {
61
58
  return noteFor(gregorianDate, calendar, country);
62
59
  }
63
60
  function checkCalendarCountry(calendar, country) {
64
- if (calendar !== "gregorian" && calendar !== "julian") throw new RangeError('calendar must be "gregorian" or "julian".');
61
+ checkCalendar(calendar);
65
62
  if (typeof country !== "string" || !country.trim()) throw new RangeError("country must be a nonempty string.");
66
63
  }
67
64
  function noteFor(gregorianDate, calendar, country) {
@@ -71,32 +68,53 @@ function noteFor(gregorianDate, calendar, country) {
71
68
  if (gregorianDate.length > 10 || gregorianDate >= adoption.firstGregorian) return julian ? { kind: "new-style", adoption } : null;
72
69
  return julian ? null : { kind: "old-style", adoption };
73
70
  }
71
+ function checkCalendar(calendar) {
72
+ if (calendar !== "gregorian" && calendar !== "julian") throw new RangeError('calendar must be "gregorian" or "julian".');
73
+ }
74
+ function julianDayNumber2(date, calendar = "gregorian") {
75
+ checkCalendar(calendar);
76
+ const { year, month, day } = date ?? {};
77
+ if (![year, month, day].every(Number.isInteger) || Math.abs(year) > 1e5) {
78
+ throw new RangeError("date must be { year, month, day } in integers, the year between -100000 and 100000.");
79
+ }
80
+ const jdn = julianDayNumber({ year, month, day }, calendar);
81
+ const back = civilDateOf(jdn, calendar);
82
+ if (back.year !== year || back.month !== month || back.day !== day) throw new RangeError(`date does not exist in the ${calendar} calendar.`);
83
+ return jdn;
84
+ }
85
+ function dateOfJulianDayNumber(jdn, calendar = "gregorian") {
86
+ checkCalendar(calendar);
87
+ if (!Number.isSafeInteger(jdn) || jdn < julianDayNumber({ year: -1e5, month: 1, day: 1 }, calendar) || jdn > julianDayNumber({ year: 1e5, month: 12, day: 31 }, calendar)) {
88
+ throw new RangeError("jdn must be an integer within the years -100000 to 100000.");
89
+ }
90
+ return civilDateOf(jdn, calendar);
91
+ }
74
92
 
75
- // src/tzdb/tzdb-2025c.ts
93
+ // src/tzdb/tzdb-2026f.ts
76
94
  var TZDB = /* @__PURE__ */ Object.freeze({
77
- version: "2025c",
78
- sha256: "4aa79e4effee53fc4029ffe5f6ebe97937282ebcdf386d5d2da91ce84142f957",
95
+ version: "2026f",
96
+ sha256: "01b4a91cec5167ed48c11e8ab78f2048cead78ce94b0cafcad0ae8c5a3044d3d",
79
97
  form: "main+backzone"
80
98
  });
81
99
  var SHARD_LOADERS = [
82
- () => import("./tzdb-2025c-00-6GVG6RYL.js"),
83
- () => import("./tzdb-2025c-01-CEYMG3LE.js"),
84
- () => import("./tzdb-2025c-02-NWQJCVUU.js"),
85
- () => import("./tzdb-2025c-03-PLHP6VH4.js"),
86
- () => import("./tzdb-2025c-04-MEKUJA6M.js"),
87
- () => import("./tzdb-2025c-05-3K5YKZBL.js"),
88
- () => import("./tzdb-2025c-06-L2VV5XJV.js"),
89
- () => import("./tzdb-2025c-07-H3GLGJGY.js"),
90
- () => import("./tzdb-2025c-08-DA7QQIGD.js"),
91
- () => import("./tzdb-2025c-09-MTXIO3QL.js"),
92
- () => import("./tzdb-2025c-10-ASL4UW5C.js"),
93
- () => import("./tzdb-2025c-11-EQEOANYB.js"),
94
- () => import("./tzdb-2025c-12-NKCCXJ5G.js"),
95
- () => import("./tzdb-2025c-13-DYTF3UC7.js"),
96
- () => import("./tzdb-2025c-14-C25H45R5.js"),
97
- () => import("./tzdb-2025c-15-7OYYZWRY.js")
100
+ () => import("./tzdb-2026f-00-RAB4YONA.js"),
101
+ () => import("./tzdb-2026f-01-SWR7EW5U.js"),
102
+ () => import("./tzdb-2026f-02-SOLHCLDL.js"),
103
+ () => import("./tzdb-2026f-03-LYLMCVL7.js"),
104
+ () => import("./tzdb-2026f-04-XTKMZPKX.js"),
105
+ () => import("./tzdb-2026f-05-EOKCMY5O.js"),
106
+ () => import("./tzdb-2026f-06-O4LQW2N6.js"),
107
+ () => import("./tzdb-2026f-07-2FDJ5OJ7.js"),
108
+ () => import("./tzdb-2026f-08-OKEWSMIX.js"),
109
+ () => import("./tzdb-2026f-09-5GB7FKLF.js"),
110
+ () => import("./tzdb-2026f-10-GXHCIASR.js"),
111
+ () => import("./tzdb-2026f-11-66EMKXFG.js"),
112
+ () => import("./tzdb-2026f-12-YK3CZCIY.js"),
113
+ () => import("./tzdb-2026f-13-UNZD3QIH.js"),
114
+ () => import("./tzdb-2026f-14-4FQNGNZM.js"),
115
+ () => import("./tzdb-2026f-15-5TA3B2WI.js")
98
116
  ];
99
- var LATER_CAUSES = "26z1v3r9wo.2lzdo.2092c.51mzc.;4omh4gkhm0.;8i4hw7ji4c.8fno.94cvo.;emnzt8v8m6.;pibsacwtc0.;shzcp6wjs0.609ic.14eec.;qn9anc1rqo.;hr04d6wjeo.609ic.14eec.;iwfdj6f1oo.;jxme485390.;vxtl73htjc.;zmgwf7egs0!;008wxcglro.4g1o.ie6c.3m1o.;xgck2d5eqc!;x90aj50d2u.;e4lpj23xc0.;n97c09emgo.6l9mc.;c1i1b2i6cc.;srkypcglq0.4970.il10.3lyc.1glac.fl5o.6hh0.4ypc.67h0.4t70.6hc1.4yqz.69p1.4yqz.69p1.4vjz.;6bx5p6nh2c.69c80.14eec.fzlo.;d7foo4bvj0.;da48bez4xo.;cc60723xc0.;r2ctm3r9wo.2lzdo.2092c.51mzc.;09xrhgo29o.;23q2c4g4g0.;2fq0m6nh2c.69c80.14eec.nrlo.;73ubg6wji0.609ic.14eec.;glme93r9mo.;iztuh9nq0c.;yksj0kmbc.;94mmz6nh2c.69c80.14eec.195lo.oeuc.;c9gx56mm3c.74rc.3y7yc.l5o.;ftdfk2i6cc.;fyvor6f1oo.;oqbaz9c9u0.;upch43ip7c.;4tlos3ofjo.38450.;bzp0f6wjn0.8fhf0.;cwffa6mm3c.74rc.;lal8k92wc0.;oyxuu31w40.4rwuc!;z0hat2fygi.bwwu.;091etgo29o.;blqvj6wjlc.f49c.5l5ao.14eec.jnto.;tgp36clt30.;9wqor23xc0.;vma32kmbc.;6vjgid5eoo!;agkxx6wji0.609ic.14eec.fznc.;bt63w1yu1o.;6fyvm6dbgo.;93ycg6f1oo.;jenq11pdmo.;kikwv6wjjo.609ic.14eec.;6i87mkmbc.;ktr4c6bdnc.tlnc.3mpic.3w1o.;lnqdp1pdmo.;x5jk0173j0.;ylrpy4bvj0.;yvsdoecogo.10ao0.;51sa56mm3c.74rc.3y7yc.l5o.;imjhpc1rsc.1onac.;xgvkj6tqo0.632mc.;4rg6l6wjd0.609k0.;cx7tr6mm3c.74rc.;e7mcw6wjlc.609ic.14eec.;3se9a6dbgo.;8k2bmkmbc.;nkww16bdnc.hxnc.;sjll11ibsc.856ho.12w0.;tbefcc1rsc.1onac.;v730i4n7yc.;dvg44kmbc.;v977f6mm3c.74rc.3y7yc.ddo.;7egrqe35eo.;lgxqt4g4g0.k8uc.;8hz4v6mm3c.74rc.3y7yc.l5o.;pyva5q8v0.;npf8s6wjn0.a2170.;x1w033is10.3drdo.609ic.58r0.z5p0.;068n925yo0.;kjcdu4m9pu.;b0ken2i6e0.;e0yew2i6cc.;pfxgu6wjn0.609ic.14eec.;4oapw3r3pc.9lic.;9linmuzqo.gvqc.;z70s311v0q6_;zme5q6wjoo.a215c.;oh15y11je0.k8uc.5a80c.88fo.321o.193ac.;blv5h6mjvc.22jc.43cec.l5o.;d7hxtkmbc.;jvnzr6f1oo.;wrz6f32nac.h2ho.;x7xki3r9mo.;0aanqasrbo.8fio.;foc486wjoo.609ic.14eec.;wh9055mw2o.;04yj4kmbc.;31xyt6wjeo.609ic.14eec.gurc.;k0dlb4n7yc.;k4x616wjeo.609k0.14eec.fzlo.;qsklxf141o.b9k0.;d90416wjlc.11sxc.4ygmo.14eec.fzlo.;diqxz9emgo.5klmc.;hqu65r7tc.;r60tt9c9u0.;7hozj7egs0!;n4f883r3pc.bjf0.4vl5o.560rc.;rcx29bn8lc.;tyfb56wjoo.;3mwwdr7tc.;h2j0f6wjoo.;n3exs6wjgc.609ic.14eec.;pf3zccwtc0.14eec.;3wlms4692o.8kazc.;hjhq6852vo.;yded86mm3c.74rc.;cshzubvnvo.2mmo0.;mkxe53htjc.;u226p6mm3c.74rc.;v8ck8774zc.5b2c.;xy1qbcgltc.;s3w2g3ofjo.38450.u8uc.;58co631w1s.4rwuw!;x8ghc1uhio.;y3thu2fygi.bwwu.;u3e1j1qwm9.57t4f.;cga095k1yu.;7xj8c6wjs0.609ic.14eec.;5m66y6wjlc.37w6c.2sddo.14eec.hxlo.;69icl31w40.4rwuc!;mu12m6bdnc.tlnc.3mpic.3w1o.;odp3marwl0.ndo.;otx0189jyu.4r36.2yq8u.;sxc0n6nh2c.69c80.14eec.;mez0y6wjoo.;tsxgk3r9mo.;2447s1zep0.7ms9o.;3s5e6c1rsc.1onac.;983km2uo86.;qbuhn50d2u.;qslwbe5bvo.;u0hxf6wji0.3qpv0.29jlo.58r0.z5p0.;cft6i6borc.dpfc.42jic.1p5o.13cko.jezc.;6o3pl3uzh0.;ertoo6wjs0.609ic.14eec.fzlo.;h5uvn5k1yu.;sa6yk50dkc.;4q92r6bdnc.hxnc.;wfyr46wjoo.;7zfow2rx5i.;j06xje5c0o.;teiet4bvo0.;6v8ej6mjvc.22jc.43bac.1p5o.;ajtnw2x3so.;ttwf6ea8x0.uog0.;o6n0f6wjlc.609k0.;4bqjbaryt0.l5o.;j9sdo38geo.;0hdnqebsg6.;6qmtw6f1qc.177go.68h90.6h8o.;asm1e4n7yc.;kzndtc1rsc.1onac.;mmp3d1kcxo.;pjzkh6wjd0.609k0.";
117
+ var LATER_CAUSES = "26z1v3r9wo.2lzdo.2092c.51mzc.;4omh4gkhm0.;8i4hw7ji4c.8fno.94cvo.;emnzt8v8m6.;pibsacwtc0.;shzcp6wjs0.609ic.14eec.;qn9anc1rqo.;hr04d6wjeo.609ic.14eec.;iwfdj6f1oo.;jxme485390.;vxtl73htjc.;zmgwf7egs0!;008wxcglro.4g1o.ie6c.3m1o.;xgck2d5eqc!;x90aj50d2u.;e4lpj23xc0.;n97c09emgo.6l9mc.;c1i1b2i6cc.;srkypcglq0.4970.il10.3lyc.1glac.fl5o.6hh0.4ypc.67h0.4t70.6hc1.4yqz.69p1.4yqz.69p1.4vjz.;6bx5p6nh2c.69c80.14eec.fzlo.;d7foo4bvj0.;da48bez4xo.;cc60723xc0.;r2ctm3r9wo.2lzdo.2092c.51mzc.;09xrhgo29o.;23q2c4g4g0.;2fq0m6nh2c.69c80.14eec.nrlo.;73ubg6wji0.609ic.14eec.;glme93r9mo.;iztuh9nq0c.;yksj0kmbc.;94mmz6nh2c.69c80.14eec.195lo.oeuc.;c9gx56mm3c.74rc.3y7yc.l5o.;ftdfk2i6cc.;fyvor6f1oo.;oqbaz9c9u0.;upch43ip7c.;4tlos3ofjo.38450.;bzp0f6wjn0.8fhf0.;cwffa6mm3c.74rc.;lal8k92wc0.;oyxuu31w40.4rwuc!;z0hat2fygi.bwwu.;091etgo29o.;blqvj6wjlc.f49c.5l5ao.14eec.jnto.;tgp36clt30.;9wqor23xc0.;vma32kmbc.;6vjgid5eoo!;agkxx6wji0.609ic.14eec.fznc.;bt63w1yu1o.fsjs0.;6fyvm6dbgo.;93ycg6f1oo.;jenq11pdmo.;kikwv6wjjo.609ic.14eec.;6i87mkmbc.;ktr4c6bdnc.tlnc.3mpic.3w1o.;lnqdp1pdmo.;x5jk0173j0.;ylrpy4bvj0.;yvsdoecogo.10ao0.;51sa56mm3c.74rc.3y7yc.l5o.;imjhpc1rsc.1onac.;xgvkj6tqo0.632mc.;4rg6l6wjd0.609k0.;cx7tr6mm3c.74rc.;e7mcw6wjlc.609ic.14eec.;3se9a6dbgo.;8k2bmkmbc.;nkww16bdnc.hxnc.;sjll11ibsc.856ho.12w0.;tbefcc1rsc.1onac.;v730i4n7yc.;dvg44kmbc.;v977f6mm3c.74rc.3y7yc.ddo.;7egrqe35eo.;lgxqt4g4g0.k8uc.cr0jc.;8hz4v6mm3c.74rc.3y7yc.l5o.;pyva5q8v0.;npf8s6wjn0.a2170.;x1w033is10.3drdo.609ic.58r0.z5p0.;068n925yo0.;kjcdu4m9pu.;b0ken2i6e0.;e0yew2i6cc.;pfxgu6wjn0.609ic.14eec.;4oapw3r3pc.9lic.;9linmuzqo.gvqc.;z70s311v0q6_;zme5q6wjoo.a215c.;oh15y11je0.k8uc.5a80c.88fo.321o.193ac.;blv5h6mjvc.22jc.43cec.l5o.;d7hxtkmbc.;jvnzr6f1oo.;wrz6f32nac.h2ho.;x7xki3r9mo.;0aanqasrbo.8fio.;foc486wjoo.609ic.14eec.;wh9055mw2o.;04yj4kmbc.;31xyt6wjeo.609ic.14eec.gurc.;k0dlb4n7yc.;k4x616wjeo.609k0.14eec.fzlo.;qsklxf141o.b9k0.;d90416wjlc.11sxc.4ygmo.14eec.fzlo.;diqxz9emgo.5klmc.;hqu65r7tc.;r60tt9c9u0.;7hozj7egs0!;n4f883r3pc.bjf0.4vl5o.560rc.;rcx29bn8lc.;tyfb56wjoo.;3mwwdr7tc.;h2j0f6wjoo.;n3exs6wjgc.609ic.14eec.;pf3zccwtc0.14eec.;3wlms4692o.8kazc.;hjhq6852vo.;yded86mm3c.74rc.;cshzubvnvo.2mmo0.;mkxe53htjc.;u226p6mm3c.74rc.;v8ck8774zc.5b2c.;xy1qbcgltc.;s3w2g3ofjo.38450.u8uc.;58co631w1s.4rwuw!;x8ghc1uhio.;y3thu2fygi.bwwu.;u3e1j1qwm9.57t4f.;cga095k1yu.;7xj8c6wjs0.609ic.14eec.;5m66y6wjlc.37w6c.2sddo.14eec.hxlo.;69icl31w40.4rwuc!;mu12m6bdnc.tlnc.3mpic.3w1o.;odp3marwl0.ndo.;otx0189jyu.4r36.2yq8u.;sxc0n6nh2c.69c80.14eec.;mez0y6wjoo.;tsxgk3r9mo.;2447s1zep0.7ms9o.;3s5e6c1rsc.1onac.;983km2uo86.;qbuhn50d2u.;qslwbe5bvo.;u0hxf6wji0.3qpv0.29jlo.58r0.z5p0.;cft6i6borc.dpfc.42jic.1p5o.13cko.jezc.;6o3pl3uzh0.;ertoo6wjs0.609ic.14eec.fzlo.;h5uvn5k1yu.;sa6yk50dkc.;4q92r6bdnc.hxnc.;wfyr46wjoo.;7zfow2rx5i.;j06xje5c0o.;teiet4bvo0.;6v8ej6mjvc.22jc.43bac.1p5o.;ajtnw2x3so.;ttwf6ea8x0.uog0.;o6n0f6wjlc.609k0.;4bqjbaryt0.l5o.;j9sdo38geo.;0hdnqebsg6.;6qmtw6f1qc.177go.68h90.6h8o.;asm1e4n7yc.;kzndtc1rsc.1onac.;mmp3d1kcxo.;pjzkh6wjd0.609k0.";
100
118
 
101
119
  // src/geo/zone-history.ts
102
120
  var CAUSES = { d: "dst", l: "legal-change", x: "date-line" };
@@ -197,7 +215,7 @@ function laterCause(timeZone, ms) {
197
215
  return later.get(nameHash(timeZone) % 36 ** 5)?.get(ms) ?? "dst";
198
216
  }
199
217
 
200
- // src/geo/timezone.ts
218
+ // src/geo/local-clock.ts
201
219
  var offsetFormatters = /* @__PURE__ */ new Map();
202
220
  function validateTimeZone(timeZone) {
203
221
  if (typeof timeZone !== "string" || timeZone.trim().length === 0) {
@@ -241,6 +259,11 @@ function hostTzdbVersion() {
241
259
  const tz = globalThis.process?.versions?.tz;
242
260
  return typeof tz === "string" && /^\d{4}[a-z]$/u.test(tz) ? tz : null;
243
261
  }
262
+ var REAL_HOST = { offsetAt, tzdbVersion: hostTzdbVersion };
263
+ var host = REAL_HOST;
264
+ function currentHost() {
265
+ return host;
266
+ }
244
267
  function firstChange(clockAt, lo, hi) {
245
268
  const from = clockAt(lo);
246
269
  while (hi - lo > 1) {
@@ -275,7 +298,7 @@ function readClock(wallMs, clockAt, samples, fold) {
275
298
  function zoneClock(timeZone, history) {
276
299
  return (ms) => {
277
300
  const offset = history && ms < 0 ? history.offsets[history.types[typeIndexAt(history, ms)]] : null;
278
- return offset ?? Math.round(offsetAt(timeZone, ms) * 60);
301
+ return offset ?? Math.round(host.offsetAt(timeZone, ms) * 60);
279
302
  };
280
303
  }
281
304
  function birthplaceClock(history, wallMs, longitude, zoneAt) {
@@ -313,7 +336,7 @@ function readOptions(options = {}) {
313
336
  return { longitude, calendar, country, fold };
314
337
  }
315
338
  var pad = (value, width = 2) => String(value).padStart(width, "0");
316
- function resolveLocalToUtc(date, time, timeZone, options) {
339
+ function readLocalTime(date, time, timeZone, options) {
317
340
  offsetFormatter(timeZone);
318
341
  const { longitude, calendar, country, fold } = readOptions(options);
319
342
  const written = parseCalendarDate(date, calendar);
@@ -377,7 +400,7 @@ function resolveLocalToUtc(date, time, timeZone, options) {
377
400
  dataForm: history.hostLegal ? "main" : "main+backzone",
378
401
  abbreviation: inEra ? null : history.abbreviations[type],
379
402
  dst: !inEra && history.dst[type]
380
- } : { source: "intl", tzdbVersion: hostTzdbVersion(), dataForm: "host", abbreviation: null, dst: null };
403
+ } : { source: "intl", tzdbVersion: host.tzdbVersion(), dataForm: "host", abbreviation: null, dst: null };
381
404
  const offsetMinutes = chosen.offset / 60;
382
405
  return {
383
406
  utc: new Date(chosen.utcMs),
@@ -390,7 +413,7 @@ function resolveLocalToUtc(date, time, timeZone, options) {
390
413
  transition,
391
414
  localMeanTime,
392
415
  zone,
393
- intlOffsetMinutes: shipped ? offsetAt(timeZone, chosen.utcMs) : null,
416
+ intlOffsetMinutes: shipped ? host.offsetAt(timeZone, chosen.utcMs) : null,
394
417
  calendarNote: country === void 0 ? null : noteFor(gregorianDate, calendar, country),
395
418
  localResolution: {
396
419
  date: gregorianDate,
@@ -431,65 +454,23 @@ var ZoneHistoryNotLoadedError = class extends Error {
431
454
  super("The zone's history before 1970 is not loaded: await prepareLocalTime(date, timeZone) first.");
432
455
  }
433
456
  };
434
- var LOCAL_BIRTH_KEYS = [
435
- "date",
436
- "time",
437
- "timeZone",
438
- "latitude",
439
- "longitude",
440
- "houseSystem",
441
- "timeKnown",
442
- "calendar",
443
- "country",
444
- "fold"
445
- ];
446
- function resolveLocalBirth(input) {
447
- if (!input || typeof input !== "object" || Array.isArray(input)) {
448
- throw new RangeError("birth must be an object containing a local date and timezone.");
449
- }
450
- for (const key of Object.getOwnPropertyNames(input)) {
451
- if (!LOCAL_BIRTH_KEYS.includes(key)) throw new RangeError(`Unknown local birth field "${key}".`);
452
- }
453
- const fields = Object.fromEntries(LOCAL_BIRTH_KEYS.map((key) => [key, input[key]]));
454
- const settings = validateBirthSettings(fields);
455
- const { time, calendar, country, fold } = fields;
456
- const timeKnown = settings.timeKnown ?? time !== void 0;
457
- if (timeKnown && time === void 0) {
458
- throw new RangeError("time is required when timeKnown is true.");
459
- }
460
- const resolution = resolveLocalToUtc(fields.date, time === void 0 ? "12:00" : time, fields.timeZone, {
461
- longitude: settings.longitude,
462
- calendar,
463
- country,
464
- fold
465
- });
466
- return {
467
- birth: {
468
- utc: resolution.utc,
469
- timeKnown,
470
- houseSystem: settings.houseSystem ?? "whole",
471
- flags: resolution.flags,
472
- ...settings.latitude === void 0 ? {} : { latitude: settings.latitude, longitude: settings.longitude }
473
- },
474
- resolution,
475
- reference: time === void 0 ? "local-noon" : "supplied-instant"
476
- };
477
- }
478
- function resolveBirth(input) {
479
- return resolveLocalBirth(input).birth;
480
- }
481
457
 
482
458
  export {
483
459
  GREGORIAN_ADOPTION_SOURCES,
484
460
  GREGORIAN_ADOPTION,
485
461
  gregorianAdoption,
486
462
  calendarNote,
463
+ julianDayNumber2 as julianDayNumber,
464
+ dateOfJulianDayNumber,
487
465
  TZDB,
466
+ nameHash,
488
467
  offsetAt,
489
- resolveLocalToUtc,
468
+ DAY,
469
+ PROBE,
470
+ FIXED_ZONE,
471
+ currentHost,
472
+ readLocalTime,
490
473
  prepareLocalTime,
491
474
  zoneOffsetAt,
492
- ZoneHistoryNotLoadedError,
493
- resolveLocalBirth,
494
- resolveBirth
475
+ ZoneHistoryNotLoadedError
495
476
  };
@@ -151,7 +151,14 @@ function ut1MinusUtcAt(utcMs) {
151
151
  return tableUt1MinusUtc(utcMs, taiMinusUtcAt(utcMs));
152
152
  }
153
153
  var modelDeltaT = (ut1Ms) => deltaTAt((ut1Ms - J2000_MS) / DAY);
154
+ var TT_MINUS_TAI_MS = 32184;
154
155
  function timeBasis(ms, scale = "utc", pin) {
156
+ return basisOf(ms, scale, pin, true);
157
+ }
158
+ function timeBasisBeforeContinuousUtc(ms, scale = "utc", pin) {
159
+ return basisOf(ms, scale, pin, false);
160
+ }
161
+ function basisOf(ms, scale, pin, continuous) {
155
162
  const record = (utcMs2, ut1Ms2, deltaT, basis, ut1MinusUtc, leapSeconds) => {
156
163
  const ut1Days = (ut1Ms2 - J2000_MS) / DAY;
157
164
  return {
@@ -169,6 +176,36 @@ function timeBasis(ms, scale = "utc", pin) {
169
176
  return record(ms, ms + (ut1MinusUtc?.seconds ?? 0) * 1e3, deltaT, "pinned", ut1MinusUtc, null);
170
177
  }
171
178
  const utc = scale === "tt" ? ms - modelDeltaT(ms).seconds * 1e3 : ms;
179
+ if (continuous && utc > UT1_TO_MS) {
180
+ const taiMinusUtc2 = taiMinusUtcAt(utc);
181
+ const ttMinusUtcMs = taiMinusUtc2 * 1e3 + TT_MINUS_TAI_MS;
182
+ const leapSeconds = { taiMinusUtc: taiMinusUtc2, listed: false };
183
+ if (scale === "utc") {
184
+ const ttMs = ms + ttMinusUtcMs;
185
+ let ut1Ms3 = ttMs;
186
+ for (let round = 0; round < 4; round += 1) ut1Ms3 = ttMs - modelDeltaT(ut1Ms3).seconds * 1e3;
187
+ const deltaT2 = modelDeltaT(ut1Ms3);
188
+ return {
189
+ utcMs: ms,
190
+ ut1Days: (ut1Ms3 - J2000_MS) / DAY,
191
+ ttDays: (ttMs - J2000_MS) / DAY,
192
+ deltaT: deltaT2,
193
+ timeScale: {
194
+ input: scale,
195
+ basis: "continuous-utc",
196
+ // From ΔT rather than from UT1 − UTC in milliseconds, so that 32.184 s + TAI − UTC − (UT1 − UTC)
197
+ // is ΔT to the rounding of seconds; the milliseconds since 1970 round to 8 µs at the far end.
198
+ ut1MinusUtc: { seconds: ttMinusUtcMs / 1e3 - deltaT2.seconds, sigma: deltaT2.sigma, source: "model" },
199
+ leapSeconds
200
+ }
201
+ };
202
+ }
203
+ let ut1Ms2 = ms;
204
+ if (scale === "tt") for (let round = 0; round < 4; round += 1) ut1Ms2 = ms - modelDeltaT(ut1Ms2).seconds * 1e3;
205
+ const deltaT = modelDeltaT(ut1Ms2);
206
+ const utcMs2 = (scale === "tt" ? ms : ut1Ms2 + deltaT.seconds * 1e3) - ttMinusUtcMs;
207
+ return record(utcMs2, ut1Ms2, deltaT, "continuous-utc", { seconds: ttMinusUtcMs / 1e3 - deltaT.seconds, sigma: deltaT.sigma, source: "model" }, leapSeconds);
208
+ }
172
209
  if (utc < LEAP_SECONDS_FROM || utc > UT1_TO_MS) {
173
210
  let ut1Ms2 = ms;
174
211
  if (scale === "tt") for (let round = 0; round < 4; round += 1) ut1Ms2 = ms - modelDeltaT(ut1Ms2).seconds * 1e3;
@@ -207,6 +244,7 @@ var MODEL_KNOTS_FROM = (1941 - 2e3) * 365.25;
207
244
  function pieceOf({ timeScale, deltaT, utcMs, ut1Days }) {
208
245
  const { input, basis, ut1MinusUtc } = timeScale;
209
246
  if (input === "tt") return "";
247
+ if (input === "utc" && (basis === "iers" || basis === "continuous-utc")) return `tai-utc ${taiMinusUtcAt(utcMs)}`;
210
248
  const model = deltaT.model === DELTA_T_MODEL ? ut1Days < MODEL_KNOTS_FROM ? "spline" : "knots" : deltaT.model;
211
249
  if (input === "ut1") return `${basis} ${model}`;
212
250
  const reading = ut1MinusUtc === null ? "as-ut1" : ut1MinusUtc.source === "fallback" ? "fallback" : taiMinusUtcAt(utcMs);
@@ -221,8 +259,10 @@ export {
221
259
  EPHEMERIS_SPAN,
222
260
  outsideReferenceSpan,
223
261
  UT1_DATA,
262
+ UT1_TO_MS,
224
263
  TIME_SCALE_NAMES,
225
264
  DELTA_T_IERS_MODEL,
226
265
  timeBasis,
266
+ timeBasisBeforeContinuousUtc,
227
267
  elapsedDays
228
268
  };
@@ -2,7 +2,7 @@ import {
2
2
  ENGINE_VERSION,
3
3
  EPHEMERIS,
4
4
  findAspects
5
- } from "./chunk-T6F4FYYS.js";
5
+ } from "./chunk-QLQRN6RY.js";
6
6
  import {
7
7
  eclipticFrame,
8
8
  eclipticOfDate,
@@ -13,7 +13,7 @@ import {
13
13
  elapsedDays,
14
14
  outsideReferenceSpan,
15
15
  timeBasis
16
- } from "./chunk-B5LKF437.js";
16
+ } from "./chunk-M65JXRFN.js";
17
17
  import {
18
18
  shippedDe440Source
19
19
  } from "./chunk-UXY4RU57.js";
@@ -366,11 +366,16 @@ import {
366
366
  MakeTime,
367
367
  SetDeltaTFunction
368
368
  } from "astronomy-engine";
369
+
370
+ // src/ephemeris-shipped.ts
371
+ var INITIAL_DEFAULT_EPHEMERIS = "de440";
372
+
373
+ // src/ephemeris.ts
369
374
  var RAD3 = 180 / Math.PI;
370
375
  var DAY = 864e5;
371
376
  var UTC_CLOCK = { scale: "utc", pin: void 0 };
372
377
  var source = null;
373
- var defaultName = "de440";
378
+ var defaultName = INITIAL_DEFAULT_EPHEMERIS;
374
379
  var DEFAULT_MARGIN_DAYS = 1;
375
380
  var SECONDS_PER_DAY = 86400;
376
381
  var shipped;
@@ -695,7 +700,7 @@ function chartAt(input) {
695
700
  ephemeris: named(from)
696
701
  };
697
702
  }
698
- var deltaTExtrapolated = ({ deltaT: d, timeScale: t }, ut1) => (ut1 || t.input != "tt") && t.basis == "delta-t" && /^e/.test(d.segment);
703
+ var deltaTExtrapolated = ({ deltaT: d, timeScale: t }, ut1) => (ut1 || t.input != "tt") && (t.basis == "delta-t" || t.basis == "continuous-utc") && /^e/.test(d.segment);
699
704
  function meanLunarPoints(basis) {
700
705
  const time = timeOf(basis);
701
706
  const centuries = time.tt / 36525;
@@ -78,7 +78,7 @@ function findAspects(bodies) {
78
78
  }
79
79
 
80
80
  // src/types.ts
81
- var ENGINE_VERSION = "2.0.0-rc.2";
81
+ var ENGINE_VERSION = "2.0.0-rc.3";
82
82
  var EPHEMERIS = /* @__PURE__ */ Object.freeze({ name: "astronomy-engine", version: "2.1.19" });
83
83
 
84
84
  export {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  onChartClock,
6
6
  refuseUnderSource
7
- } from "./chunk-PNXIA7MI.js";
7
+ } from "./chunk-PU4HNPRX.js";
8
8
  import {
9
9
  dateFrom
10
10
  } from "./chunk-CPALRSPC.js";
@@ -17,7 +17,7 @@ import {
17
17
  TIME_SCALE_NAMES,
18
18
  outsideReferenceSpan,
19
19
  timeBasis
20
- } from "./chunk-B5LKF437.js";
20
+ } from "./chunk-M65JXRFN.js";
21
21
 
22
22
  // src/vedic/ayanamsa.ts
23
23
  import { BaryState, Body, HelioVector } from "astronomy-engine";
@@ -5,11 +5,12 @@ function timeBands(record) {
5
5
  const { input, basis, ut1MinusUtc } = Object(timeScale);
6
6
  const d = deltaT?.sigma === null ? 0 : deltaT?.sigma;
7
7
  const u = ut1MinusUtc === null ? 0 : ut1MinusUtc?.sigma;
8
- if (!isBand(d) || !isBand(u) || !["utc", "ut1", "tt"].includes(input) || !["iers", "delta-t", "pinned"].includes(basis)) {
8
+ if (!isBand(d) || !isBand(u) || !["utc", "ut1", "tt"].includes(input) || !["iers", "continuous-utc", "delta-t", "pinned"].includes(basis)) {
9
9
  throw new RangeError("timeBands takes the deltaT and timeScale that a time basis, a chart or a calc instant records.");
10
10
  }
11
11
  if (input === "tt") return { tt: 0, ut1: d };
12
12
  if (input === "ut1") return { tt: d, ut1: 0 };
13
+ if (basis === "continuous-utc") return { tt: 0, ut1: d };
13
14
  return { tt: basis === "iers" ? 0 : basis === "pinned" ? u : Math.hypot(u, d), ut1: u };
14
15
  }
15
16
 
package/dist/core.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ export * from "./index.js";
2
+ import type { DefaultEphemeris, DefaultEphemerisName } from "./index.js";
3
+ /**
4
+ * What a call outside `withEphemeris` computes on in @zodiacs/engine/core,
5
+ * which carries no DE440 pack: `name` is `"astronomy-engine"`, this entry's
6
+ * default, unless `setDefaultEphemeris("de440")` chose otherwise, and
7
+ * `de440.opened` is always false, with `de440.error` saying why. The
8
+ * setting is this entry's own: the root's `setDefaultEphemeris` does not
9
+ * change it.
10
+ */
11
+ export declare function defaultEphemeris(): DefaultEphemeris;
12
+ /**
13
+ * Choose what a call outside `withEphemeris` computes on in
14
+ * @zodiacs/engine/core, from now on: `"astronomy-engine"` (this entry's
15
+ * default) or `"de440"`, which here still computes on astronomy-engine, since
16
+ * this entry carries no pack, and flags each result `"de440-unavailable"`.
17
+ * For DE440 positions, import @zodiacs/engine, or supply a pack through
18
+ * @zodiacs/engine/de440 and `withEphemeris`. It is this entry's setting
19
+ * alone: the root's is apart from it.
20
+ */
21
+ export declare function setDefaultEphemeris(name: DefaultEphemerisName): void;