@motioncomplex/cosmos-lib 1.0.9 → 1.0.15

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.
@@ -673,7 +673,7 @@ const L = {
673
673
  return { rise: d, transit: y, set: h };
674
674
  }
675
675
  };
676
- function ds(n, s = 6e4, e = 128) {
676
+ function bs(n, s = 6e4, e = 128) {
677
677
  const i = /* @__PURE__ */ new Map();
678
678
  return (t = /* @__PURE__ */ new Date()) => {
679
679
  const l = Math.round(t.getTime() / s), r = i.get(l);
@@ -682,7 +682,7 @@ function ds(n, s = 6e4, e = 128) {
682
682
  return i.size >= e && i.delete(i.keys().next().value), i.set(l, g), g;
683
683
  };
684
684
  }
685
- const Q = L.DEG_TO_RAD, Ss = ds((n) => {
685
+ const Q = L.DEG_TO_RAD, Is = bs((n) => {
686
686
  const s = _.planetEcliptic("earth", n), e = ((s.lon + 180) % 360 + 360) % 360, i = -s.lat, t = _.toJulian(n), { dPsi: l } = _.nutation(t), r = e + l, g = _.trueObliquity(t) * Q, o = r * Q, a = i * Q, v = Math.atan2(
687
687
  Math.sin(o) * Math.cos(g) - Math.tan(a) * Math.sin(g),
688
688
  Math.cos(o)
@@ -724,7 +724,7 @@ const Q = L.DEG_TO_RAD, Ss = ds((n) => {
724
724
  * ```
725
725
  */
726
726
  position(n = /* @__PURE__ */ new Date()) {
727
- return Ss(n);
727
+ return Is(n);
728
728
  },
729
729
  /**
730
730
  * Solar noon (transit) for a given observer.
@@ -834,7 +834,7 @@ const Q = L.DEG_TO_RAD, Ss = ds((n) => {
834
834
  astronomicalDusk: r.set
835
835
  };
836
836
  }
837
- }, M = L.DEG_TO_RAD, B = L.RAD_TO_DEG, Ds = [
837
+ }, M = L.DEG_TO_RAD, B = L.RAD_TO_DEG, ws = [
838
838
  [0, 0, 1, 0, 6288774, -20905355],
839
839
  [2, 0, -1, 0, 1274027, -3699111],
840
840
  [2, 0, 0, 0, 658314, -2955968],
@@ -885,7 +885,7 @@ const Q = L.DEG_TO_RAD, Ss = ds((n) => {
885
885
  [0, 0, 4, 0, 537, -1117],
886
886
  [4, -1, 0, 0, 520, -1571],
887
887
  [1, 0, -2, 0, -487, -1739]
888
- ], Cs = [
888
+ ], Rs = [
889
889
  [0, 0, 0, 1, 5128122],
890
890
  [0, 0, 1, 1, 280602],
891
891
  [0, 0, 1, -1, 277693],
@@ -916,39 +916,39 @@ const Q = L.DEG_TO_RAD, Ss = ds((n) => {
916
916
  [0, 0, 3, 1, 1107],
917
917
  [4, 0, 0, -1, 1021],
918
918
  [4, 0, -1, 1, 833]
919
- ], Z = 29.530588861, Is = ds((n) => {
919
+ ], Z = 29.530588861, xs = bs((n) => {
920
920
  const s = _.toJulian(n), e = (s - 2451545) / 36525, i = ((218.3164477 + 481267.88123421 * e - 15786e-7 * e * e + e * e * e / 538841 - e * e * e * e / 65194e3) % 360 + 360) % 360, t = ((297.8501921 + 445267.1114034 * e - 18819e-7 * e * e + e * e * e / 545868 - e * e * e * e / 113065e3) % 360 + 360) % 360, l = ((357.5291092 + 35999.0502909 * e - 1536e-7 * e * e + e * e * e / 2449e4) % 360 + 360) % 360, r = ((134.9633964 + 477198.8675055 * e + 87414e-7 * e * e + e * e * e / 69699 - e * e * e * e / 14712e3) % 360 + 360) % 360, g = ((93.272095 + 483202.0175233 * e - 36539e-7 * e * e - e * e * e / 3526e3 + e * e * e * e / 86331e4) % 360 + 360) % 360, o = 1 - 2516e-6 * e - 74e-7 * e * e, a = o * o, v = t * M, y = l * M, c = r * M, k = g * M;
921
921
  let u = 0, f = 0;
922
- for (const C of Ds) {
923
- const $ = C[0] * v + C[1] * y + C[2] * c + C[3] * k;
924
- let P = 1;
922
+ for (const C of ws) {
923
+ const Y = C[0] * v + C[1] * y + C[2] * c + C[3] * k;
924
+ let G = 1;
925
925
  const q = Math.abs(C[1]);
926
- q === 1 ? P = o : q === 2 && (P = a), u += C[4] * P * Math.sin($), f += C[5] * P * Math.cos($);
926
+ q === 1 ? G = o : q === 2 && (G = a), u += C[4] * G * Math.sin(Y), f += C[5] * G * Math.cos(Y);
927
927
  }
928
928
  let d = 0;
929
- for (const C of Cs) {
930
- const $ = C[0] * v + C[1] * y + C[2] * c + C[3] * k;
931
- let P = 1;
929
+ for (const C of Rs) {
930
+ const Y = C[0] * v + C[1] * y + C[2] * c + C[3] * k;
931
+ let G = 1;
932
932
  const q = Math.abs(C[1]);
933
- q === 1 ? P = o : q === 2 && (P = a), d += C[4] * P * Math.sin($);
933
+ q === 1 ? G = o : q === 2 && (G = a), d += C[4] * G * Math.sin(Y);
934
934
  }
935
935
  const h = (119.75 + 131.849 * e) * M, p = (53.09 + 479264.29 * e) * M, m = (313.45 + 481266.484 * e) * M;
936
936
  u += 3958 * Math.sin(h) + 1962 * Math.sin((i - g) * M) + 318 * Math.sin(p), d += -2235 * Math.sin(i * M) + 382 * Math.sin(m) + 175 * Math.sin(h - k) + 175 * Math.sin(h + k) + 127 * Math.sin((i - r) * M) - 115 * Math.sin((i + r) * M);
937
- const A = i + u / 1e6, b = d / 1e6, S = 385000.56 + f / 1e3, { dPsi: R } = _.nutation(s), H = A + R, E = _.trueObliquity(s) * M, U = H * M, X = b * M, zs = Math.atan2(
937
+ const A = i + u / 1e6, b = d / 1e6, S = 385000.56 + f / 1e3, { dPsi: R } = _.nutation(s), H = A + R, E = _.trueObliquity(s) * M, U = H * M, X = b * M, Ss = Math.atan2(
938
938
  Math.sin(U) * Math.cos(E) - Math.tan(X) * Math.sin(E),
939
939
  Math.cos(U)
940
- ) * B, Ms = Math.asin(
940
+ ) * B, Ds = Math.asin(
941
941
  Math.sin(X) * Math.cos(E) + Math.cos(X) * Math.sin(E) * Math.sin(U)
942
- ) * B, As = Math.asin(6378.14 / S) * B;
942
+ ) * B, Cs = Math.asin(6378.14 / S) * B;
943
943
  return {
944
- ra: (zs % 360 + 360) % 360,
945
- dec: Ms,
944
+ ra: (Ss % 360 + 360) % 360,
945
+ dec: Ds,
946
946
  distance_km: S,
947
947
  eclipticLon: (H % 360 + 360) % 360,
948
948
  eclipticLat: b,
949
- parallax: As
949
+ parallax: Cs
950
950
  };
951
- }, 6e4, 64), G = {
951
+ }, 6e4, 64), O = {
952
952
  /**
953
953
  * Geocentric equatorial and ecliptic position of the Moon.
954
954
  *
@@ -985,7 +985,7 @@ const Q = L.DEG_TO_RAD, Ss = ds((n) => {
985
985
  * ```
986
986
  */
987
987
  position(n = /* @__PURE__ */ new Date()) {
988
- return Is(n);
988
+ return xs(n);
989
989
  },
990
990
  /**
991
991
  * Moon phase information for a given date.
@@ -1154,7 +1154,7 @@ const Q = L.DEG_TO_RAD, Ss = ds((n) => {
1154
1154
  ) * B;
1155
1155
  return { l: g, b: o };
1156
1156
  }
1157
- }, ws = [
1157
+ }, Ts = [
1158
1158
  {
1159
1159
  id: "sun",
1160
1160
  name: "Sun",
@@ -1313,7 +1313,7 @@ const Q = L.DEG_TO_RAD, Ss = ds((n) => {
1313
1313
  description: "Windiest planet at 2,100 km/h; found by mathematical prediction before observation.",
1314
1314
  tags: ["solar-system", "planet", "ice-giant"]
1315
1315
  }
1316
- ], Rs = [
1316
+ ], Ns = [
1317
1317
  {
1318
1318
  id: "ngc7293",
1319
1319
  name: "Helix Nebula",
@@ -1549,7 +1549,7 @@ const Q = L.DEG_TO_RAD, Ss = ds((n) => {
1549
1549
  { id: "rotanev", name: "Rotanev", con: "Del", hr: 7882, ra: 309.387, dec: 14.595, mag: 3.63, spec: "F5III", pmRa: 118.07, pmDec: -46.85, bv: 0.44 },
1550
1550
  { id: "sualocin", name: "Sualocin", con: "Del", hr: 7906, ra: 309.91, dec: 15.912, mag: 3.77, spec: "B9IV", pmRa: 54.8, pmDec: 8.44, bv: -0.03 },
1551
1551
  { id: "proxima-centauri", name: "Proxima Centauri", con: "Cen", hr: 0, ra: 217.429, dec: -62.68, mag: 11.13, spec: "M5.5Ve", pmRa: -3775.4, pmDec: 765.54, bv: 1.9 }
1552
- ], fs = [
1552
+ ], _s = [
1553
1553
  // ────────────────────────────────────────────────────────────────
1554
1554
  // 1. Andromeda
1555
1555
  // ────────────────────────────────────────────────────────────────
@@ -3911,7 +3911,7 @@ const Q = L.DEG_TO_RAD, Ss = ds((n) => {
3911
3911
  [308.55, 27.09, 295.74, 24.08]
3912
3912
  ]
3913
3913
  }
3914
- ], rs = [
3914
+ ], as = [
3915
3915
  { messier: 1, name: "Crab Nebula", ngc: "NGC 1952", type: "nebula", subtype: "supernova remnant", constellation: "Tau", ra: 83.633, dec: 22.015, mag: 8.4, size_arcmin: 6, distance_kly: 6.5, description: "Supernova remnant from SN 1054, contains a pulsar" },
3916
3916
  { messier: 2, name: "M2", ngc: "NGC 7089", type: "cluster", subtype: "globular cluster", constellation: "Aqr", ra: 323.363, dec: -0.823, mag: 6.3, size_arcmin: 16, distance_kly: 37.5, description: "Rich globular cluster" },
3917
3917
  { messier: 3, name: "M3", ngc: "NGC 5272", type: "cluster", subtype: "globular cluster", constellation: "CVn", ra: 205.548, dec: 28.377, mag: 6.2, size_arcmin: 18, distance_kly: 33.9, description: "One of the finest globular clusters" },
@@ -4022,7 +4022,7 @@ const Q = L.DEG_TO_RAD, Ss = ds((n) => {
4022
4022
  { messier: 108, name: "M108", ngc: "NGC 3556", type: "galaxy", subtype: "barred spiral galaxy", constellation: "UMa", ra: 167.879, dec: 55.674, mag: 10, size_arcmin: 8, distance_kly: 45e3, description: "Nearly edge-on barred spiral near Owl Nebula" },
4023
4023
  { messier: 109, name: "M109", ngc: "NGC 3992", type: "galaxy", subtype: "barred spiral galaxy", constellation: "UMa", ra: 179.4, dec: 53.375, mag: 9.8, size_arcmin: 8, distance_kly: 83500, description: "Barred spiral galaxy near Phecda" },
4024
4024
  { messier: 110, name: "M110", ngc: "NGC 205", type: "galaxy", subtype: "elliptical galaxy", constellation: "And", ra: 10.092, dec: 41.685, mag: 8.5, size_arcmin: 22, distance_kly: 2690, description: "Satellite of Andromeda Galaxy" }
4025
- ], vs = [
4025
+ ], ys = [
4026
4026
  { id: "quadrantids", name: "Quadrantids", code: "QUA", radiantRA: 230.1, radiantDec: 48.5, solarLon: 283.16, peakDate: "Jan 04", start: "Dec 28", end: "Jan 12", zhr: 110, speed: 41, parentBody: "2003 EH1" },
4027
4027
  { id: "lyrids", name: "Lyrids", code: "LYR", radiantRA: 271.4, radiantDec: 33.6, solarLon: 32.32, peakDate: "Apr 22", start: "Apr 14", end: "Apr 30", zhr: 18, speed: 49, parentBody: "C/1861 G1 (Thatcher)" },
4028
4028
  { id: "eta-aquariids", name: "Eta Aquariids", code: "ETA", radiantRA: 338, radiantDec: -1, solarLon: 45.5, peakDate: "May 06", start: "Apr 19", end: "May 28", zhr: 50, speed: 66, parentBody: "1P/Halley" },
@@ -4047,7 +4047,7 @@ const Q = L.DEG_TO_RAD, Ss = ds((n) => {
4047
4047
  { id: "ursids", name: "Ursids", code: "URS", radiantRA: 217, radiantDec: 76, solarLon: 270.7, peakDate: "Dec 22", start: "Dec 17", end: "Dec 26", zhr: 10, speed: 33, parentBody: "8P/Tuttle" }
4048
4048
  ];
4049
4049
  let ss = "DEMO_KEY";
4050
- const ks = {
4050
+ const us = {
4051
4051
  /**
4052
4052
  * Set the NASA API key used for APOD requests.
4053
4053
  *
@@ -4256,7 +4256,7 @@ const ks = {
4256
4256
  copyright: t.copyright ?? "NASA"
4257
4257
  }));
4258
4258
  }
4259
- }, xs = {
4259
+ }, Ls = {
4260
4260
  /**
4261
4261
  * Search the ESA Hubble Space Telescope image archive.
4262
4262
  *
@@ -4303,7 +4303,7 @@ const ks = {
4303
4303
  });
4304
4304
  }
4305
4305
  };
4306
- async function re(n) {
4306
+ async function ce(n) {
4307
4307
  var l;
4308
4308
  const s = new URLSearchParams({
4309
4309
  REQUEST: "doQuery",
@@ -4324,7 +4324,7 @@ async function re(n) {
4324
4324
  const t = (l = (await e.json()).data) == null ? void 0 : l[0];
4325
4325
  return t ? { id: t[0], ra: t[1], dec: t[2], type: t[3] } : null;
4326
4326
  }
4327
- const Ts = {
4327
+ const Ps = {
4328
4328
  acrab: { g: "/rings.v3.skycell/0938/008/rings.v3.skycell.0938.008.stk.g.unconv.fits", i: "/rings.v3.skycell/0938/008/rings.v3.skycell.0938.008.stk.i.unconv.fits", r: "/rings.v3.skycell/0938/008/rings.v3.skycell.0938.008.stk.r.unconv.fits", y: "/rings.v3.skycell/0938/008/rings.v3.skycell.0938.008.stk.y.unconv.fits", z: "/rings.v3.skycell/0938/008/rings.v3.skycell.0938.008.stk.z.unconv.fits" },
4329
4329
  adhafera: { g: "/rings.v3.skycell/1800/085/rings.v3.skycell.1800.085.stk.g.unconv.fits", i: "/rings.v3.skycell/1800/085/rings.v3.skycell.1800.085.stk.i.unconv.fits", r: "/rings.v3.skycell/1800/085/rings.v3.skycell.1800.085.stk.r.unconv.fits", y: "/rings.v3.skycell/1800/085/rings.v3.skycell.1800.085.stk.y.unconv.fits", z: "/rings.v3.skycell/1800/085/rings.v3.skycell.1800.085.stk.z.unconv.fits" },
4330
4330
  adhara: { g: "/rings.v3.skycell/0658/075/rings.v3.skycell.0658.075.stk.g.unconv.fits", i: "/rings.v3.skycell/0658/075/rings.v3.skycell.0658.075.stk.i.unconv.fits", r: "/rings.v3.skycell/0658/075/rings.v3.skycell.0658.075.stk.r.unconv.fits", y: "/rings.v3.skycell/0658/075/rings.v3.skycell.0658.075.stk.y.unconv.fits", z: "/rings.v3.skycell/0658/075/rings.v3.skycell.0658.075.stk.z.unconv.fits" },
@@ -4564,7 +4564,7 @@ const Ts = {
4564
4564
  zosma: { g: "/rings.v3.skycell/1803/011/rings.v3.skycell.1803.011.stk.g.unconv.fits", i: "/rings.v3.skycell/1803/011/rings.v3.skycell.1803.011.stk.i.unconv.fits", r: "/rings.v3.skycell/1803/011/rings.v3.skycell.1803.011.stk.r.unconv.fits", y: "/rings.v3.skycell/1803/011/rings.v3.skycell.1803.011.stk.y.unconv.fits", z: "/rings.v3.skycell/1803/011/rings.v3.skycell.1803.011.stk.z.unconv.fits" },
4565
4565
  zubenelgenubi: { g: "/rings.v3.skycell/0933/092/rings.v3.skycell.0933.092.stk.g.unconv.fits", i: "/rings.v3.skycell/0933/092/rings.v3.skycell.0933.092.stk.i.unconv.fits", r: "/rings.v3.skycell/0933/092/rings.v3.skycell.0933.092.stk.r.unconv.fits", y: "/rings.v3.skycell/0933/092/rings.v3.skycell.0933.092.stk.y.unconv.fits", z: "/rings.v3.skycell/0933/092/rings.v3.skycell.0933.092.stk.z.unconv.fits" },
4566
4566
  zubeneschamali: { g: "/rings.v3.skycell/1111/068/rings.v3.skycell.1111.068.stk.g.unconv.fits", i: "/rings.v3.skycell/1111/068/rings.v3.skycell.1111.068.stk.i.unconv.fits", r: "/rings.v3.skycell/1111/068/rings.v3.skycell.1111.068.stk.r.unconv.fits", y: "/rings.v3.skycell/1111/068/rings.v3.skycell.1111.068.stk.y.unconv.fits", z: "/rings.v3.skycell/1111/068/rings.v3.skycell.1111.068.stk.z.unconv.fits" }
4567
- }, Ns = {
4567
+ }, Gs = {
4568
4568
  star: 15,
4569
4569
  planet: 10,
4570
4570
  nebula: 20,
@@ -4572,16 +4572,16 @@ const Ts = {
4572
4572
  cluster: 20,
4573
4573
  "black-hole": 8
4574
4574
  };
4575
- function Ls(n, s, e = {}) {
4576
- const { padding: i = 1.6, minFov: t = 4, maxFov: l = 120 } = e, r = n != null ? n * i : Ns[s] ?? 15;
4575
+ function Os(n, s, e = {}) {
4576
+ const { padding: i = 1.6, minFov: t = 4, maxFov: l = 120 } = e, r = n != null ? n * i : Gs[s] ?? 15;
4577
4577
  return Math.max(t, Math.min(l, r));
4578
4578
  }
4579
- const Ps = 0.25;
4580
- async function Gs(n, s, e, i, t = {}) {
4579
+ const Es = 0.25;
4580
+ async function Fs(n, s, e, i, t = {}) {
4581
4581
  if (e < -30) return null;
4582
- const l = Ts[n];
4582
+ const l = Ps[n];
4583
4583
  if (!l) return null;
4584
- const { outputSize: r = 1024, timeout: g = 15e3 } = t, o = Math.round(i * 60 / Ps), a = Math.max(r, Math.min(o, 1e4)), v = l.i ?? l.r ?? l.g, y = l.r ?? l.g ?? l.i, c = l.g ?? l.r ?? l.i;
4584
+ const { outputSize: r = 1024, timeout: g = 15e3 } = t, o = Math.round(i * 60 / Es), a = Math.max(r, Math.min(o, 1e4)), v = l.i ?? l.r ?? l.g, y = l.r ?? l.g ?? l.i, c = l.g ?? l.r ?? l.i;
4585
4585
  if (!v && !y && !c) return null;
4586
4586
  const k = new URL("https://ps1images.stsci.edu/cgi-bin/fitscut.cgi");
4587
4587
  v && k.searchParams.set("red", v), y && k.searchParams.set("green", y), c && k.searchParams.set("blue", c), k.searchParams.set("size", String(a)), k.searchParams.set("output_size", String(Math.min(r, a))), k.searchParams.set("format", "jpg"), k.searchParams.set("autoscale", "99.5");
@@ -4602,7 +4602,7 @@ async function Gs(n, s, e, i, t = {}) {
4602
4602
  return null;
4603
4603
  }
4604
4604
  }
4605
- async function Os(n, s, e, i = {}) {
4605
+ async function js(n, s, e, i = {}) {
4606
4606
  const { timeout: t = 15e3 } = i, l = s > -40 ? "poss2ukstu_red" : "poss1_red", r = new URL("https://archive.stsci.edu/cgi-bin/dss_search");
4607
4607
  r.searchParams.set("r", n.toFixed(6)), r.searchParams.set("d", s.toFixed(6)), r.searchParams.set("e", "J2000"), r.searchParams.set("w", e.toFixed(2)), r.searchParams.set("h", e.toFixed(2)), r.searchParams.set("f", "gif"), r.searchParams.set("v", l), r.searchParams.set("s", "on"), r.searchParams.set("compress", "none");
4608
4608
  try {
@@ -4622,12 +4622,12 @@ async function Os(n, s, e, i = {}) {
4622
4622
  return null;
4623
4623
  }
4624
4624
  }
4625
- let T = null, ts = null;
4626
- function Es(n) {
4625
+ let T = null, ls = null;
4626
+ function Bs(n) {
4627
4627
  T = n;
4628
4628
  }
4629
- function Fs(n) {
4630
- ts = n;
4629
+ function Vs(n) {
4630
+ ls = n;
4631
4631
  }
4632
4632
  const J = {
4633
4633
  // ── Solar system ──────────────────────────────────────────────────────────
@@ -4677,13 +4677,13 @@ const J = {
4677
4677
  "omega-cen": [{ filename: "Omega_Centauri_by_ESO.jpg", credit: "ESO" }],
4678
4678
  "m87-bh": [{ filename: "Black_hole_-_Messier_87_crop_max_res.jpg", credit: "Event Horizon Telescope · CC BY 4.0" }]
4679
4679
  };
4680
- async function ps(n, s = {}) {
4680
+ async function zs(n, s = {}) {
4681
4681
  const { source: e = "nasa", limit: i = 5 } = s, t = [];
4682
4682
  if (e === "nasa" || e === "all") {
4683
- const l = await ks.searchImages(n, { pageSize: i });
4683
+ const l = await us.searchImages(n, { pageSize: i });
4684
4684
  for (const r of l) {
4685
4685
  if (!r.nasaId) continue;
4686
- const o = (await ks.getAssets(r.nasaId)).filter((a) => /\.(jpe?g|png|tiff?)$/i.test(a));
4686
+ const o = (await us.getAssets(r.nasaId)).filter((a) => /\.(jpe?g|png|tiff?)$/i.test(a));
4687
4687
  o.length > 0 && t.push({
4688
4688
  urls: o,
4689
4689
  previewUrl: r.previewUrl,
@@ -4694,7 +4694,7 @@ async function ps(n, s = {}) {
4694
4694
  }
4695
4695
  }
4696
4696
  if (e === "esa" || e === "all") {
4697
- const l = await xs.searchHubble(n, i);
4697
+ const l = await Ls.searchHubble(n, i);
4698
4698
  for (const r of l) {
4699
4699
  const g = [r.imageUrl, r.thumbUrl].filter((o) => o !== null);
4700
4700
  g.length > 0 && t.push({
@@ -4709,28 +4709,28 @@ async function ps(n, s = {}) {
4709
4709
  return t.slice(0, i);
4710
4710
  }
4711
4711
  const K = /* @__PURE__ */ new Map();
4712
- function ls(n, s, e) {
4712
+ function rs(n, s, e) {
4713
4713
  return `${n}::${s}::${e}`;
4714
4714
  }
4715
- function js(n) {
4715
+ function Hs(n) {
4716
4716
  if (T)
4717
4717
  for (const s of n) {
4718
4718
  const e = T(s);
4719
4719
  if (!e) continue;
4720
- const i = ls(s, 1200, "nasa");
4721
- K.has(i) || cs(s, e.name, { prefetch: !1 }).catch(() => {
4720
+ const i = rs(s, 1200, "nasa");
4721
+ K.has(i) || gs(s, e.name, { prefetch: !1 }).catch(() => {
4722
4722
  });
4723
4723
  }
4724
4724
  }
4725
- const ys = /^(m|ngc|ic|sh2|arp|abell)\s*\d/i;
4726
- function Bs(n, s) {
4725
+ const ms = /^(m|ngc|ic|sh2|arp|abell)\s*\d/i;
4726
+ function Us(n, s) {
4727
4727
  const e = [], i = T == null ? void 0 : T(n);
4728
4728
  if (i != null && i.aliases)
4729
4729
  for (const t of i.aliases)
4730
- ys.test(t) && e.push(t);
4731
- return ys.test(n) && e.push(n.toUpperCase()), e.push(`${s} ${(i == null ? void 0 : i.type) ?? "astronomy"}`), e;
4730
+ ms.test(t) && e.push(t);
4731
+ return ms.test(n) && e.push(n.toUpperCase()), e.push(`${s} ${(i == null ? void 0 : i.type) ?? "astronomy"}`), e;
4732
4732
  }
4733
- async function cs(n, s, e = {}) {
4733
+ async function gs(n, s, e = {}) {
4734
4734
  const {
4735
4735
  width: i = 1200,
4736
4736
  srcsetWidths: t = [640, 1024, 1600],
@@ -4738,7 +4738,7 @@ async function cs(n, s, e = {}) {
4738
4738
  cutoutTimeout: r = 15e3,
4739
4739
  skipCutouts: g = !0,
4740
4740
  prefetch: o
4741
- } = e, a = ls(n, i, l);
4741
+ } = e, a = rs(n, i, l);
4742
4742
  if (K.has(a))
4743
4743
  return K.get(a) ?? null;
4744
4744
  let v = null;
@@ -4756,7 +4756,7 @@ async function cs(n, s, e = {}) {
4756
4756
  if (!v && !g && T) {
4757
4757
  const c = T(n);
4758
4758
  if (c && c.ra !== null && c.dec !== null) {
4759
- const k = Ls(c.size_arcmin, c.type), u = { outputSize: i, timeout: r }, f = await Gs(n, c.ra, c.dec, k, u);
4759
+ const k = Os(c.size_arcmin, c.type), u = { outputSize: i, timeout: r }, f = await Fs(n, c.ra, c.dec, k, u);
4760
4760
  if (f && (v = {
4761
4761
  src: f.url,
4762
4762
  srcset: null,
@@ -4764,7 +4764,7 @@ async function cs(n, s, e = {}) {
4764
4764
  credit: f.credit,
4765
4765
  source: "panstarrs"
4766
4766
  }), !v) {
4767
- const d = await Os(c.ra, c.dec, k, u);
4767
+ const d = await js(c.ra, c.dec, k, u);
4768
4768
  d && (v = {
4769
4769
  src: d.url,
4770
4770
  srcset: null,
@@ -4776,12 +4776,12 @@ async function cs(n, s, e = {}) {
4776
4776
  }
4777
4777
  }
4778
4778
  if (!v) {
4779
- const c = Bs(n, s), k = l === "nasa" ? ["nasa"] : l === "esa" ? ["esa"] : ["esa", "nasa"];
4779
+ const c = Us(n, s), k = l === "nasa" ? ["nasa"] : l === "esa" ? ["esa"] : ["esa", "nasa"];
4780
4780
  for (const u of k) {
4781
4781
  if (v) break;
4782
4782
  for (const f of c)
4783
4783
  try {
4784
- const d = await ps(f, { source: u, limit: 1 });
4784
+ const d = await zs(f, { source: u, limit: 1 });
4785
4785
  if (d.length > 0) {
4786
4786
  const h = d[0];
4787
4787
  v = {
@@ -4797,18 +4797,19 @@ async function cs(n, s, e = {}) {
4797
4797
  }
4798
4798
  }
4799
4799
  }
4800
- if (K.set(a, v), v && o !== !1 && T && ts) {
4800
+ if (K.set(a, v), v && o !== !1 && T && ls) {
4801
4801
  const c = T(n);
4802
4802
  if (c && c.ra !== null && c.dec !== null) {
4803
- const k = typeof o == "object" ? o : {}, { radius: u = 5, limit: f = 8 } = k, d = ts({ ra: c.ra, dec: c.dec }, u).filter((h) => h.object.id !== n && !K.has(ls(h.object.id, i, l))).slice(0, f);
4803
+ const k = typeof o == "object" ? o : {}, { radius: u = 5, limit: f = 8 } = k, d = ls({ ra: c.ra, dec: c.dec }, u).filter((h) => h.object.id !== n && !K.has(rs(h.object.id, i, l))).slice(0, f);
4804
4804
  for (const h of d)
4805
- cs(h.object.id, h.object.name, { ...e, prefetch: !1 }).catch(() => {
4805
+ gs(h.object.id, h.object.name, { ...e, prefetch: !1 }).catch(() => {
4806
4806
  });
4807
4807
  }
4808
4808
  }
4809
4809
  return v;
4810
4810
  }
4811
- function Vs(n) {
4811
+ const es = /* @__PURE__ */ new Set([0]);
4812
+ function qs(n) {
4812
4813
  return {
4813
4814
  id: n.id,
4814
4815
  name: n.name,
@@ -4822,7 +4823,7 @@ function Vs(n) {
4822
4823
  tags: ["star"]
4823
4824
  };
4824
4825
  }
4825
- function Hs(n) {
4826
+ function Ks(n) {
4826
4827
  return {
4827
4828
  id: `m${n.messier}`,
4828
4829
  name: n.name,
@@ -4837,35 +4838,36 @@ function Hs(n) {
4837
4838
  ...n.size_arcmin != null ? { size_arcmin: n.size_arcmin } : {}
4838
4839
  };
4839
4840
  }
4840
- const O = [
4841
- ...ws,
4842
- ...W.map(Vs),
4843
- ...rs.map(Hs),
4844
- ...Rs
4845
- ], hs = new Map(O.map((n) => [n.id, n])), Us = new Map(
4846
- O.flatMap(
4841
+ let P = [
4842
+ ...Ts,
4843
+ ...W.map(qs),
4844
+ ...as.map(Ks),
4845
+ ...Ns
4846
+ ], cs = new Map(P.map((n) => [n.id, n])), ds = new Map(
4847
+ P.flatMap(
4847
4848
  (n) => [n.name, ...n.aliases].map((s) => [s.toLowerCase(), n])
4848
4849
  )
4849
4850
  );
4850
- Es((n) => {
4851
- const s = hs.get(n);
4851
+ Bs((n) => {
4852
+ const s = cs.get(n);
4852
4853
  return s ? { id: s.id, ra: s.ra, dec: s.dec, size_arcmin: s.size_arcmin, type: s.type, name: s.name, aliases: s.aliases } : null;
4853
4854
  });
4854
- Fs(
4855
- (n, s) => O.filter(
4855
+ Vs(
4856
+ (n, s) => P.filter(
4856
4857
  (e) => e.ra !== null && e.dec !== null
4857
4858
  ).map((e) => ({
4858
4859
  object: e,
4859
4860
  separation: _.angularSeparation(n, { ra: e.ra, dec: e.dec })
4860
4861
  })).filter((e) => e.separation <= s).sort((e, i) => e.separation - i.separation)
4861
4862
  );
4862
- const qs = new Map(
4863
+ const Ws = new Map(
4863
4864
  W.map((n) => [n.name.toLowerCase(), n])
4864
- ), Ks = new Map(
4865
- fs.map((n) => [n.abbr.toLowerCase(), n])
4866
- ), Ws = new Map(
4867
- rs.map((n) => [n.messier, n])
4868
- ), Ys = O.map((n) => {
4865
+ ), $s = new Map(
4866
+ _s.map((n) => [n.abbr.toLowerCase(), n])
4867
+ ), Ys = new Map(
4868
+ as.map((n) => [n.messier, n])
4869
+ );
4870
+ let fs = P.map((n) => {
4869
4871
  var s;
4870
4872
  return {
4871
4873
  object: n,
@@ -4874,7 +4876,8 @@ const qs = new Map(
4874
4876
  descriptionLower: n.description.toLowerCase(),
4875
4877
  subtypeLower: (s = n.subtype) == null ? void 0 : s.toLowerCase()
4876
4878
  };
4877
- }), F = {
4879
+ });
4880
+ const F = {
4878
4881
  // ── Unified queries ────────────────────────────────────────────────────
4879
4882
  /**
4880
4883
  * Look up a celestial object by its exact identifier.
@@ -4892,7 +4895,7 @@ const qs = new Map(
4892
4895
  * ```
4893
4896
  */
4894
4897
  get(n) {
4895
- return hs.get(n) ?? null;
4898
+ return cs.get(n) ?? null;
4896
4899
  },
4897
4900
  /**
4898
4901
  * Look up a celestial object by name or any known alias (case-insensitive).
@@ -4910,7 +4913,7 @@ const qs = new Map(
4910
4913
  * ```
4911
4914
  */
4912
4915
  getByName(n) {
4913
- return Us.get(n.toLowerCase()) ?? null;
4916
+ return ds.get(n.toLowerCase()) ?? null;
4914
4917
  },
4915
4918
  /**
4916
4919
  * Return a shallow copy of the full unified catalog.
@@ -4927,7 +4930,7 @@ const qs = new Map(
4927
4930
  * ```
4928
4931
  */
4929
4932
  all() {
4930
- return [...O];
4933
+ return [...P];
4931
4934
  },
4932
4935
  /**
4933
4936
  * Filter the unified catalog by object type.
@@ -4945,7 +4948,7 @@ const qs = new Map(
4945
4948
  * ```
4946
4949
  */
4947
4950
  getByType(n) {
4948
- return O.filter((s) => s.type === n);
4951
+ return P.filter((s) => s.type === n);
4949
4952
  },
4950
4953
  /**
4951
4954
  * Filter the unified catalog by a tag string.
@@ -4963,7 +4966,7 @@ const qs = new Map(
4963
4966
  * ```
4964
4967
  */
4965
4968
  getByTag(n) {
4966
- return O.filter((s) => s.tags.includes(n));
4969
+ return P.filter((s) => s.tags.includes(n));
4967
4970
  },
4968
4971
  /**
4969
4972
  * Fuzzy search across name, aliases, description, and tags.
@@ -4986,7 +4989,7 @@ const qs = new Map(
4986
4989
  */
4987
4990
  search(n) {
4988
4991
  const s = n.toLowerCase().trim();
4989
- return s ? Ys.map((e) => {
4992
+ return s ? fs.map((e) => {
4990
4993
  var t;
4991
4994
  let i = 0;
4992
4995
  return e.object.id === s && (i += 100), e.nameLower === s && (i += 90), e.nameLower.startsWith(s) && (i += 50), e.aliasesLower.some((l) => l === s) && (i += 80), e.aliasesLower.some((l) => l.includes(s)) && (i += 20), e.nameLower.includes(s) && (i += 15), e.descriptionLower.includes(s) && (i += 5), e.object.tags.some((l) => l.includes(s)) && (i += 8), (t = e.subtypeLower) != null && t.includes(s) && (i += 10), { object: e.object, score: i };
@@ -5014,7 +5017,7 @@ const qs = new Map(
5014
5017
  * ```
5015
5018
  */
5016
5019
  nearby(n, s) {
5017
- return O.filter(
5020
+ return P.filter(
5018
5021
  (e) => e.ra !== null && e.dec !== null
5019
5022
  ).map((e) => ({
5020
5023
  object: e,
@@ -5109,7 +5112,7 @@ const qs = new Map(
5109
5112
  * images.forEach(img => console.log(img.title, img.urls[0]))
5110
5113
  * ```
5111
5114
  */
5112
- resolveImages: ps,
5115
+ resolveImages: zs,
5113
5116
  /**
5114
5117
  * Unified image pipeline — resolves the best available image for any
5115
5118
  * celestial object and returns it in an optimized, ready-to-render format.
@@ -5134,7 +5137,7 @@ const qs = new Map(
5134
5137
  * }
5135
5138
  * ```
5136
5139
  */
5137
- getImage: cs,
5140
+ getImage: gs,
5138
5141
  /**
5139
5142
  * Prefetch images for a list of object IDs in the background.
5140
5143
  *
@@ -5148,7 +5151,7 @@ const qs = new Map(
5148
5151
  * Data.prefetchImages(filteredObjects.map(o => o.id))
5149
5152
  * ```
5150
5153
  */
5151
- prefetchImages: js,
5154
+ prefetchImages: Hs,
5152
5155
  // ── Bright star queries ────────────────────────────────────────────────
5153
5156
  /**
5154
5157
  * Get all bright stars in the catalog (~200 IAU named stars).
@@ -5177,7 +5180,7 @@ const qs = new Map(
5177
5180
  * ```
5178
5181
  */
5179
5182
  getStarByName(n) {
5180
- return qs.get(n.toLowerCase()) ?? null;
5183
+ return Ws.get(n.toLowerCase()) ?? null;
5181
5184
  },
5182
5185
  /**
5183
5186
  * Get all bright stars belonging to a given constellation.
@@ -5234,7 +5237,7 @@ const qs = new Map(
5234
5237
  * ```
5235
5238
  */
5236
5239
  constellations() {
5237
- return fs;
5240
+ return _s;
5238
5241
  },
5239
5242
  /**
5240
5243
  * Look up a constellation by its 3-letter IAU abbreviation (case-insensitive).
@@ -5249,7 +5252,7 @@ const qs = new Map(
5249
5252
  * ```
5250
5253
  */
5251
5254
  getConstellation(n) {
5252
- return Ks.get(n.toLowerCase()) ?? null;
5255
+ return $s.get(n.toLowerCase()) ?? null;
5253
5256
  },
5254
5257
  // ── Messier catalog queries ────────────────────────────────────────────
5255
5258
  /**
@@ -5264,7 +5267,7 @@ const qs = new Map(
5264
5267
  * ```
5265
5268
  */
5266
5269
  messier() {
5267
- return rs;
5270
+ return as;
5268
5271
  },
5269
5272
  /**
5270
5273
  * Look up a Messier object by its catalog number.
@@ -5282,7 +5285,7 @@ const qs = new Map(
5282
5285
  * ```
5283
5286
  */
5284
5287
  getMessier(n) {
5285
- return Ws.get(n) ?? null;
5288
+ return Ys.get(n) ?? null;
5286
5289
  },
5287
5290
  // ── Meteor shower queries ──────────────────────────────────────────────
5288
5291
  /**
@@ -5298,7 +5301,7 @@ const qs = new Map(
5298
5301
  * ```
5299
5302
  */
5300
5303
  showers() {
5301
- return vs;
5304
+ return ys;
5302
5305
  },
5303
5306
  /**
5304
5307
  * Get meteor showers that are active on a given date.
@@ -5320,16 +5323,97 @@ const qs = new Map(
5320
5323
  */
5321
5324
  getActiveShowers(n) {
5322
5325
  const e = ((_.planetEcliptic("earth", n).lon + 180) % 360 + 360) % 360;
5323
- return vs.filter((i) => Math.abs(((e - i.solarLon + 180) % 360 + 360) % 360 - 180) < 20);
5326
+ return ys.filter((i) => Math.abs(((e - i.solarLon + 180) % 360 + 360) % 360 - 180) < 20);
5327
+ },
5328
+ // ── Star tier loading ──────────────────────────────────────────────────
5329
+ /**
5330
+ * Load an expanded star tier into the catalog.
5331
+ *
5332
+ * - **Tier 0** (default): ~200 IAU named bright stars — always bundled
5333
+ * - **Tier 1**: ~9,100 stars to magnitude 6.5 (naked-eye limit) — ~145 KB
5334
+ * - **Tier 2**: ~120,000 stars to magnitude 9+ — ~1.9 MB (compact binary)
5335
+ *
5336
+ * Loaded stars are merged into the unified catalog and become available
5337
+ * to `search()`, `nearby()`, `all()`, `getByType('star')`, and sky map
5338
+ * rendering. Loading is idempotent — calling again for an already-loaded
5339
+ * tier is a no-op.
5340
+ *
5341
+ * @param tier - The tier to load (1 or 2).
5342
+ * @returns A promise that resolves with the number of stars added.
5343
+ *
5344
+ * @remarks
5345
+ * Star data is sourced from the HYG Database v3.8 (public domain).
5346
+ * Attribution: David Nash, "HYG Stellar Database", https://github.com/astronexus/HYG-Database
5347
+ *
5348
+ * @example
5349
+ * ```ts
5350
+ * // Load naked-eye stars
5351
+ * const added = await Data.loadStarTier(1)
5352
+ * console.log(`Added ${added} stars`)
5353
+ *
5354
+ * // Now search finds fainter stars
5355
+ * const faint = Data.search('hip 12345')
5356
+ *
5357
+ * // Sky map renders more stars
5358
+ * renderSkyMap(canvas, Data.all(), { showMagnitudeLimit: 6.5 })
5359
+ * ```
5360
+ */
5361
+ async loadStarTier(n) {
5362
+ if (es.has(n)) return 0;
5363
+ let s;
5364
+ if (n === 1)
5365
+ s = (await import("./stars-tier1-C56Nvm8y.js")).loadTier1Stars();
5366
+ else if (n === 2)
5367
+ s = (await import("./stars-tier2-Ci6zwt3G.js")).loadTier2Stars();
5368
+ else
5369
+ throw new Error(`Unknown star tier: ${n}`);
5370
+ const e = s.map((i, t) => ({
5371
+ id: `hyg-t${n}-${t}`,
5372
+ name: `HYG ${n === 1 ? t + 200 : t + 9300}`,
5373
+ aliases: [],
5374
+ type: "star",
5375
+ ra: i.ra,
5376
+ dec: i.dec,
5377
+ magnitude: i.mag,
5378
+ description: "",
5379
+ tags: ["star", `tier-${n}`]
5380
+ }));
5381
+ for (const i of e) P.push(i);
5382
+ for (const i of e)
5383
+ cs.set(i.id, i), ds.set(i.name.toLowerCase(), i);
5384
+ for (const i of e)
5385
+ fs.push({
5386
+ object: i,
5387
+ nameLower: i.name.toLowerCase(),
5388
+ aliasesLower: [],
5389
+ descriptionLower: "",
5390
+ subtypeLower: void 0
5391
+ });
5392
+ return es.add(n), e.length;
5393
+ },
5394
+ /**
5395
+ * Check which star tiers are currently loaded.
5396
+ *
5397
+ * @returns A set of loaded tier numbers (always includes 0).
5398
+ *
5399
+ * @example
5400
+ * ```ts
5401
+ * Data.loadedStarTiers() // Set { 0 }
5402
+ * await Data.loadStarTier(1)
5403
+ * Data.loadedStarTiers() // Set { 0, 1 }
5404
+ * ```
5405
+ */
5406
+ loadedStarTiers() {
5407
+ return es;
5324
5408
  }
5325
- }, $s = ["mercury", "venus", "mars", "jupiter", "saturn", "uranus", "neptune"];
5409
+ }, Js = ["mercury", "venus", "mars", "jupiter", "saturn", "uranus", "neptune"];
5326
5410
  function j(n, s) {
5327
5411
  if (n.ra !== null && n.dec !== null)
5328
5412
  return { ra: n.ra, dec: n.dec };
5329
5413
  if (n.type === "planet") {
5330
5414
  const e = n.id;
5331
5415
  try {
5332
- const i = _.planetEcliptic(e, s), t = _.planetEcliptic("earth", s), l = bs(i, t);
5416
+ const i = _.planetEcliptic(e, s), t = _.planetEcliptic("earth", s), l = Ms(i, t);
5333
5417
  return _.eclipticToEquatorial(l);
5334
5418
  } catch {
5335
5419
  return null;
@@ -5340,27 +5424,27 @@ function j(n, s) {
5340
5424
  return { ra: e.ra, dec: e.dec };
5341
5425
  }
5342
5426
  if (n.id === "moon") {
5343
- const e = G.position(s);
5427
+ const e = O.position(s);
5344
5428
  return { ra: e.ra, dec: e.dec };
5345
5429
  }
5346
5430
  return null;
5347
5431
  }
5348
- function bs(n, s) {
5432
+ function Ms(n, s) {
5349
5433
  const e = Math.PI / 180, i = n.r * Math.cos(n.lat * e) * Math.cos(n.lon * e), t = n.r * Math.cos(n.lat * e) * Math.sin(n.lon * e), l = n.r * Math.sin(n.lat * e), r = s.r * Math.cos(s.lat * e) * Math.cos(s.lon * e), g = s.r * Math.cos(s.lat * e) * Math.sin(s.lon * e), o = s.r * Math.sin(s.lat * e), a = i - r, v = t - g, y = l - o, c = (Math.atan2(v, a) * 180 / Math.PI % 360 + 360) % 360, k = Math.atan2(y, Math.sqrt(a * a + v * v)) * 180 / Math.PI;
5350
5434
  return { lon: c, lat: k };
5351
5435
  }
5352
- function Js(n) {
5436
+ function Xs(n) {
5353
5437
  if (n <= 0) return 1 / 0;
5354
5438
  const s = 90 - n, e = s * Math.PI / 180;
5355
5439
  return 1 / (Math.cos(e) + 0.50572 * Math.pow(96.07995 - s, -1.6364));
5356
5440
  }
5357
- function es(n) {
5441
+ function ns(n) {
5358
5442
  const s = n.date ?? /* @__PURE__ */ new Date(), i = I.twilight(n).astronomicalDusk;
5359
5443
  if (!i) return null;
5360
5444
  const t = new Date(s.valueOf() + 864e5), r = I.twilight({ ...n, date: t }).astronomicalDawn;
5361
5445
  return r ? { start: i, end: r } : null;
5362
5446
  }
5363
- const ce = {
5447
+ const ae = {
5364
5448
  /**
5365
5449
  * Objects currently above the horizon, sorted by altitude (highest first).
5366
5450
  *
@@ -5389,7 +5473,7 @@ const ce = {
5389
5473
  constellation: l,
5390
5474
  tag: r,
5391
5475
  limit: g = 50
5392
- } = s, o = n.date ?? /* @__PURE__ */ new Date(), a = G.position(o), v = { ra: a.ra, dec: a.dec }, y = G.phase(o);
5476
+ } = s, o = n.date ?? /* @__PURE__ */ new Date(), a = O.position(o), v = { ra: a.ra, dec: a.dec }, y = O.phase(o);
5393
5477
  let c = F.all();
5394
5478
  if (t && (c = c.filter((u) => t.includes(u.type))), r && (c = c.filter((u) => u.tags.includes(r))), l) {
5395
5479
  const u = F.getStarsByConstellation(l), f = new Set(u.map((d) => d.id));
@@ -5402,7 +5486,7 @@ const ce = {
5402
5486
  if (!f) continue;
5403
5487
  const d = _.equatorialToHorizontal(f, { ...n, date: o });
5404
5488
  if (d.alt < e) continue;
5405
- const h = _.angularSeparation(f, v), p = us(h, y.illumination);
5489
+ const h = _.angularSeparation(f, v), p = ps(h, y.illumination);
5406
5490
  k.push({
5407
5491
  object: u,
5408
5492
  alt: d.alt,
@@ -5436,7 +5520,7 @@ const ce = {
5436
5520
  bestWindow(n, s, e = 10) {
5437
5521
  const i = F.get(n);
5438
5522
  if (!i) return null;
5439
- const t = es(s);
5523
+ const t = ns(s);
5440
5524
  if (!t) return null;
5441
5525
  const { start: l, end: r } = t, g = r.valueOf() - l.valueOf(), o = 60, a = g / o;
5442
5526
  let v = -1 / 0, y = l, c = null, k = null, u = !1;
@@ -5471,7 +5555,7 @@ const ce = {
5471
5555
  visibilityCurve(n, s, e = 100) {
5472
5556
  const i = F.get(n);
5473
5557
  if (!i) return null;
5474
- const t = es(s);
5558
+ const t = ns(s);
5475
5559
  if (!t) return null;
5476
5560
  const { start: l, end: r } = t, o = (r.valueOf() - l.valueOf()) / e, a = [];
5477
5561
  for (let v = 0; v <= e; v++) {
@@ -5499,11 +5583,11 @@ const ce = {
5499
5583
  * ```
5500
5584
  */
5501
5585
  planetEvents(n, s = {}) {
5502
- const { planets: e = $s, days: i = 365 } = s, t = n.date ?? /* @__PURE__ */ new Date(), l = [];
5586
+ const { planets: e = Js, days: i = 365 } = s, t = n.date ?? /* @__PURE__ */ new Date(), l = [];
5503
5587
  for (const r of e) {
5504
5588
  let g = -1, o = !0;
5505
5589
  for (let a = 0; a <= i; a++) {
5506
- const v = new Date(t.valueOf() + a * 864e5), y = Xs(r, v);
5590
+ const v = new Date(t.valueOf() + a * 864e5), y = Qs(r, v);
5507
5591
  if (a > 0) {
5508
5592
  const c = y > g;
5509
5593
  !c && o && g > 150 && l.push({
@@ -5546,7 +5630,7 @@ const ce = {
5546
5630
  if (!e) return null;
5547
5631
  const i = s.date ?? /* @__PURE__ */ new Date(), t = j(e, i);
5548
5632
  if (!t) return null;
5549
- const l = G.position(i), r = { ra: l.ra, dec: l.dec }, g = G.phase(i), o = _.angularSeparation(t, r), a = us(o, g.illumination);
5633
+ const l = O.position(i), r = { ra: l.ra, dec: l.dec }, g = O.phase(i), o = _.angularSeparation(t, r), a = ps(o, g.illumination);
5550
5634
  return { separation: o, illumination: g.illumination, score: a };
5551
5635
  },
5552
5636
  /**
@@ -5571,27 +5655,27 @@ const ce = {
5571
5655
  airmassCurve(n, s, e = 100) {
5572
5656
  const i = F.get(n);
5573
5657
  if (!i) return null;
5574
- const t = es(s);
5658
+ const t = ns(s);
5575
5659
  if (!t) return null;
5576
5660
  const { start: l, end: r } = t, o = (r.valueOf() - l.valueOf()) / e, a = [];
5577
5661
  for (let v = 0; v <= e; v++) {
5578
5662
  const y = new Date(l.valueOf() + v * o), c = j(i, y);
5579
5663
  if (!c) return null;
5580
5664
  const k = _.equatorialToHorizontal(c, { ...s, date: y });
5581
- k.alt > 0 && a.push({ date: y, alt: k.alt, airmass: Js(k.alt) });
5665
+ k.alt > 0 && a.push({ date: y, alt: k.alt, airmass: Xs(k.alt) });
5582
5666
  }
5583
5667
  return a;
5584
5668
  }
5585
5669
  };
5586
- function Xs(n, s) {
5587
- const e = _.planetEcliptic(n, s), i = _.planetEcliptic("earth", s), t = bs(e, i), l = _.eclipticToEquatorial(t), r = I.position(s);
5670
+ function Qs(n, s) {
5671
+ const e = _.planetEcliptic(n, s), i = _.planetEcliptic("earth", s), t = Ms(e, i), l = _.eclipticToEquatorial(t), r = I.position(s);
5588
5672
  return _.angularSeparation(l, { ra: r.ra, dec: r.dec });
5589
5673
  }
5590
- function us(n, s) {
5674
+ function ps(n, s) {
5591
5675
  const e = Math.max(0, Math.min(1, (120 - n) / 115));
5592
5676
  return s * e;
5593
5677
  }
5594
- class ae {
5678
+ class ge {
5595
5679
  constructor(s = {}) {
5596
5680
  this._playing = !1, this._disposed = !1, this._lastWallTime = null, this._timerId = null, this._rafId = null, this._listeners = /* @__PURE__ */ new Map(), this._tick = () => {
5597
5681
  this._disposed || !this._playing || (this._advance(), this._emitTick(), this._scheduleNext());
@@ -5746,17 +5830,17 @@ class ae {
5746
5830
  break;
5747
5831
  }
5748
5832
  case "moonrise": {
5749
- const l = G.riseTransitSet(i);
5833
+ const l = O.riseTransitSet(i);
5750
5834
  t = this._nextOccurrence(l.rise);
5751
5835
  break;
5752
5836
  }
5753
5837
  case "moonset": {
5754
- const l = G.riseTransitSet(i);
5838
+ const l = O.riseTransitSet(i);
5755
5839
  t = this._nextOccurrence(l.set);
5756
5840
  break;
5757
5841
  }
5758
5842
  case "moon-transit": {
5759
- const l = G.riseTransitSet(i);
5843
+ const l = O.riseTransitSet(i);
5760
5844
  t = this._nextOccurrence(l.transit);
5761
5845
  break;
5762
5846
  }
@@ -5806,7 +5890,7 @@ class ae {
5806
5890
  }
5807
5891
  }
5808
5892
  const N = L.DEG_TO_RAD;
5809
- function as(n, s, e = 500) {
5893
+ function os(n, s, e = 500) {
5810
5894
  const i = s.ra * N, t = s.dec * N, l = n.ra * N, r = n.dec * N, g = l - i, o = Math.sin(t) * Math.sin(r) + Math.cos(t) * Math.cos(r) * Math.cos(g), a = 2 / (1 + o);
5811
5895
  return {
5812
5896
  x: a * Math.cos(r) * Math.sin(g) * e,
@@ -5814,7 +5898,7 @@ function as(n, s, e = 500) {
5814
5898
  visible: o > -0.95
5815
5899
  };
5816
5900
  }
5817
- function gs(n, s) {
5901
+ function vs(n, s) {
5818
5902
  const { width: e, height: i } = s, t = (n.ra - 180) * N, l = n.dec * N;
5819
5903
  let r = l;
5820
5904
  for (let a = 0; a < 10; a++) {
@@ -5825,7 +5909,7 @@ function gs(n, s) {
5825
5909
  const g = e / 2 + e / (2 * Math.PI) * (2 * Math.SQRT2 / Math.PI) * t * Math.cos(r), o = i / 2 - i / 2 * Math.SQRT2 * Math.sin(r);
5826
5910
  return { x: g, y: o, visible: !0 };
5827
5911
  }
5828
- function os(n, s, e = 400) {
5912
+ function ks(n, s, e = 400) {
5829
5913
  const i = s.ra * N, t = s.dec * N, l = n.ra * N, r = n.dec * N, g = l - i, o = Math.sin(t) * Math.sin(r) + Math.cos(t) * Math.cos(r) * Math.cos(g);
5830
5914
  return o <= 0 ? { x: 0, y: 0, visible: !1 } : {
5831
5915
  x: e * Math.cos(r) * Math.sin(g) / o,
@@ -5833,7 +5917,7 @@ function os(n, s, e = 400) {
5833
5917
  visible: o > 0
5834
5918
  };
5835
5919
  }
5836
- function Qs(n) {
5920
+ function Zs(n) {
5837
5921
  var i;
5838
5922
  if (n.type === "nebula") return "#ff7744";
5839
5923
  if (n.type === "galaxy") return "#ffddaa";
@@ -5850,7 +5934,7 @@ function Qs(n) {
5850
5934
  };
5851
5935
  return s && s in e ? e[s] ?? "#ffffff" : "#ffffff";
5852
5936
  }
5853
- function _s(n, s, e = {}) {
5937
+ function As(n, s, e = {}) {
5854
5938
  const {
5855
5939
  projection: i = "stereographic",
5856
5940
  center: t = { ra: 0, dec: 0 },
@@ -5865,8 +5949,8 @@ function _s(n, s, e = {}) {
5865
5949
  if (!c) throw new Error("Canvas 2D context not available");
5866
5950
  const k = n.width, u = n.height, f = k / 2, d = u / 2, h = (p) => {
5867
5951
  if (i === "mollweide")
5868
- return gs(p, { width: k, height: u });
5869
- const m = i === "gnomonic" ? os(p, t, l) : as(p, t, l);
5952
+ return vs(p, { width: k, height: u });
5953
+ const m = i === "gnomonic" ? ks(p, t, l) : os(p, t, l);
5870
5954
  return { x: f + m.x, y: d - m.y, visible: m.visible };
5871
5955
  };
5872
5956
  if (c.fillStyle = a, c.fillRect(0, 0, k, u), r) {
@@ -5918,7 +6002,7 @@ function _s(n, s, e = {}) {
5918
6002
  if (p.ra === null || p.dec === null || p.magnitude !== null && p.magnitude > o) continue;
5919
6003
  const m = h({ ra: p.ra, dec: p.dec });
5920
6004
  if (!m.visible || m.x < -50 || m.x > k + 50 || m.y < -50 || m.y > u + 50) continue;
5921
- const A = p.magnitude ?? 5, b = Math.max(1.5, Math.min(10, (6 - A) * 0.9 + 1.5)), S = Qs(p);
6005
+ const A = p.magnitude ?? 5, b = Math.max(1.5, Math.min(10, (6 - A) * 0.9 + 1.5)), S = Zs(p);
5922
6006
  if (c.save(), p.type === "galaxy")
5923
6007
  c.strokeStyle = S, c.lineWidth = 1, c.beginPath(), c.ellipse(m.x, m.y, b * 2.5, b * 1.2, 0.4, 0, Math.PI * 2), c.stroke();
5924
6008
  else if (p.type === "nebula")
@@ -5932,25 +6016,25 @@ function _s(n, s, e = {}) {
5932
6016
  g && A < 3.5 && (c.fillStyle = y, c.font = `${Math.max(10, 13 - A)}px sans-serif`, c.fillText(p.name, m.x + b + 4, m.y - b)), c.restore();
5933
6017
  }
5934
6018
  }
5935
- const ge = { stereographic: as, mollweide: gs, gnomonic: os, render: _s }, Y = L.DEG_TO_RAD, V = 1 / Y;
5936
- function Zs(n, s, e, i) {
6019
+ const oe = { stereographic: os, mollweide: vs, gnomonic: ks, render: As }, $ = L.DEG_TO_RAD, V = 1 / $;
6020
+ function se(n, s, e, i) {
5937
6021
  const t = n / i, l = s / i, r = Math.sqrt(t * t + l * l);
5938
6022
  if (r === 0) return { ra: e.ra, dec: e.dec };
5939
- const g = 2 * Math.atan(r / 2), o = Math.sin(g), a = Math.cos(g), v = e.dec * Y, y = e.ra * Y, c = Math.asin(a * Math.sin(v) + l * o * Math.cos(v) / r) * V, k = (y + Math.atan2(
6023
+ const g = 2 * Math.atan(r / 2), o = Math.sin(g), a = Math.cos(g), v = e.dec * $, y = e.ra * $, c = Math.asin(a * Math.sin(v) + l * o * Math.cos(v) / r) * V, k = (y + Math.atan2(
5940
6024
  t * o,
5941
6025
  r * Math.cos(v) * a - l * Math.sin(v) * o
5942
6026
  )) * V;
5943
6027
  return !isFinite(k) || !isFinite(c) ? null : { ra: (k % 360 + 360) % 360, dec: c };
5944
6028
  }
5945
- function se(n, s, e, i) {
5946
- const t = n / i, l = s / i, r = Math.sqrt(t * t + l * l), g = e.dec * Y, o = e.ra * Y, a = Math.atan(r), v = Math.sin(a), y = Math.cos(a);
6029
+ function ee(n, s, e, i) {
6030
+ const t = n / i, l = s / i, r = Math.sqrt(t * t + l * l), g = e.dec * $, o = e.ra * $, a = Math.atan(r), v = Math.sin(a), y = Math.cos(a);
5947
6031
  let c, k;
5948
6032
  return r === 0 ? (c = e.dec, k = e.ra) : (c = Math.asin(y * Math.sin(g) + l * v * Math.cos(g) / r) * V, k = (o + Math.atan2(
5949
6033
  t * v,
5950
6034
  r * Math.cos(g) * y - l * Math.sin(g) * v
5951
6035
  )) * V), !isFinite(k) || !isFinite(c) ? null : { ra: (k % 360 + 360) % 360, dec: c };
5952
6036
  }
5953
- function ee(n, s, e, i) {
6037
+ function ne(n, s, e, i) {
5954
6038
  const l = -(s - i / 2) / (i / 2) / Math.SQRT2;
5955
6039
  if (Math.abs(l) > 1) return null;
5956
6040
  const r = Math.asin(l), g = (n - e / 2) / (e / (2 * Math.PI)), o = Math.cos(r);
@@ -5963,13 +6047,13 @@ function ee(n, s, e, i) {
5963
6047
  const y = Math.asin(v), c = ((a * V + 180) % 360 + 360) % 360, k = y * V;
5964
6048
  return !isFinite(c) || !isFinite(k) ? null : { ra: c, dec: k };
5965
6049
  }
5966
- function ms(n, s, e, i, t, l, r) {
6050
+ function hs(n, s, e, i, t, l, r) {
5967
6051
  if (t === "mollweide")
5968
- return ee(n, s, e, i);
6052
+ return ne(n, s, e, i);
5969
6053
  const g = e / 2, o = i / 2, a = n - g, v = o - s;
5970
- return t === "gnomonic" ? se(a, v, l, r) : Zs(a, v, l, r);
6054
+ return t === "gnomonic" ? ee(a, v, l, r) : se(a, v, l, r);
5971
6055
  }
5972
- function ns(n, s, e, i) {
6056
+ function is(n, s, e, i) {
5973
6057
  let t = null, l = 1 / 0;
5974
6058
  for (const r of n) {
5975
6059
  const g = r.x - s, o = r.y - e, a = g * g + o * o, v = Math.max(i, r.radius);
@@ -5977,7 +6061,7 @@ function ns(n, s, e, i) {
5977
6061
  }
5978
6062
  return t;
5979
6063
  }
5980
- const is = L.DEG_TO_RAD, ne = 250, ie = 10, w = {
6064
+ const ts = L.DEG_TO_RAD, ie = 250, te = 10, w = {
5981
6065
  panEnabled: !0,
5982
6066
  zoomEnabled: !0,
5983
6067
  selectEnabled: !0,
@@ -5987,7 +6071,7 @@ const is = L.DEG_TO_RAD, ne = 250, ie = 10, w = {
5987
6071
  hitRadius: 15,
5988
6072
  realTimeInterval: 1e3
5989
6073
  };
5990
- class te {
6074
+ class le {
5991
6075
  constructor(s, e, i = {}) {
5992
6076
  var r, g;
5993
6077
  this._projectedCache = [], this._selectedObject = null, this._hoveredObject = null, this._listeners = /* @__PURE__ */ new Map(), this._rafId = null, this._dirty = !1, this._realTimeTimer = null, this._pointers = /* @__PURE__ */ new Map(), this._disposed = !1, this._panAnimId = null, this._onPointerDown = (o) => {
@@ -6007,7 +6091,7 @@ class te {
6007
6091
  if (y && this._pointers.size === 1 && (this._opts.panEnabled ?? w.panEnabled)) {
6008
6092
  const c = a - y.lastX, k = v - y.lastY;
6009
6093
  if (y.lastX = a, y.lastY = v, this._view.projection === "mollweide") {
6010
- const u = this._canvas.width, f = this._canvas.height, d = ms(a - c, v - k, u, f, "mollweide", this._view.center, this._view.scale), h = ms(a, v, u, f, "mollweide", this._view.center, this._view.scale);
6094
+ const u = this._canvas.width, f = this._canvas.height, d = hs(a - c, v - k, u, f, "mollweide", this._view.center, this._view.scale), h = hs(a, v, u, f, "mollweide", this._view.center, this._view.scale);
6011
6095
  if (d && h) {
6012
6096
  let p = d.ra - h.ra;
6013
6097
  p > 180 && (p -= 360), p < -180 && (p += 360), this._view.center = {
@@ -6016,7 +6100,7 @@ class te {
6016
6100
  }, this._markDirty(), this._emitViewChange();
6017
6101
  }
6018
6102
  } else {
6019
- const u = c / this._view.scale / is, f = k / this._view.scale / is;
6103
+ const u = c / this._view.scale / ts, f = k / this._view.scale / ts;
6020
6104
  this._view.center = {
6021
6105
  ra: ((this._view.center.ra - u) % 360 + 360) % 360,
6022
6106
  dec: Math.max(-90, Math.min(90, this._view.center.dec + f))
@@ -6037,7 +6121,7 @@ class te {
6037
6121
  return;
6038
6122
  }
6039
6123
  if (this._pointers.size === 0 && (this._opts.hoverEnabled ?? w.hoverEnabled)) {
6040
- const c = this._opts.hitRadius ?? w.hitRadius, k = ns(this._projectedCache, a, v, c), u = (k == null ? void 0 : k.object) ?? null;
6124
+ const c = this._opts.hitRadius ?? w.hitRadius, k = is(this._projectedCache, a, v, c), u = (k == null ? void 0 : k.object) ?? null;
6041
6125
  u !== this._hoveredObject && (this._hoveredObject = u, this._markDirty(), this._emit("hover", {
6042
6126
  object: u,
6043
6127
  point: k ? { x: k.x, y: k.y, visible: !0 } : null,
@@ -6049,8 +6133,8 @@ class te {
6049
6133
  const a = this._pointers.get(o.pointerId);
6050
6134
  if (this._pointers.delete(o.pointerId), !a) return;
6051
6135
  const v = performance.now() - a.startTime, y = Math.hypot(a.lastX - a.startX, a.lastY - a.startY);
6052
- if (v < ne && y < ie && (this._opts.selectEnabled ?? w.selectEnabled)) {
6053
- const c = this._opts.hitRadius ?? w.hitRadius, k = ns(this._projectedCache, a.lastX, a.lastY, c);
6136
+ if (v < ie && y < te && (this._opts.selectEnabled ?? w.selectEnabled)) {
6137
+ const c = this._opts.hitRadius ?? w.hitRadius, k = is(this._projectedCache, a.lastX, a.lastY, c);
6054
6138
  k ? (this._selectedObject = k.object, this._markDirty(), this._emit("select", {
6055
6139
  object: k.object,
6056
6140
  point: { x: k.x, y: k.y, visible: !0 },
@@ -6148,7 +6232,7 @@ class te {
6148
6232
  * Return the celestial object at a given canvas pixel position, or `null`.
6149
6233
  */
6150
6234
  objectAt(s, e) {
6151
- const i = this._opts.hitRadius ?? w.hitRadius, t = ns(this._projectedCache, s, e, i);
6235
+ const i = this._opts.hitRadius ?? w.hitRadius, t = is(this._projectedCache, s, e, i);
6152
6236
  return (t == null ? void 0 : t.object) ?? null;
6153
6237
  }
6154
6238
  // ── Data ─────────────────────────────────────────────────────────────────
@@ -6192,7 +6276,7 @@ class te {
6192
6276
  render() {
6193
6277
  if (this._disposed) return;
6194
6278
  const s = this._canvas, e = this._ctx, i = s.width, t = s.height;
6195
- _s(s, this._objects, {
6279
+ As(s, this._objects, {
6196
6280
  ...this._opts,
6197
6281
  center: this._view.center,
6198
6282
  scale: this._view.scale,
@@ -6240,8 +6324,8 @@ class te {
6240
6324
  _project(s) {
6241
6325
  const e = this._canvas.width, i = this._canvas.height;
6242
6326
  if (this._view.projection === "mollweide")
6243
- return gs(s, { width: e, height: i });
6244
- const t = this._view.projection === "gnomonic" ? os(s, this._view.center, this._view.scale) : as(s, this._view.center, this._view.scale);
6327
+ return vs(s, { width: e, height: i });
6328
+ const t = this._view.projection === "gnomonic" ? ks(s, this._view.center, this._view.scale) : os(s, this._view.center, this._view.scale);
6245
6329
  return { x: e / 2 + t.x, y: i / 2 - t.y, visible: t.visible };
6246
6330
  }
6247
6331
  /** Rebuild the projected-object cache used for hit-testing and highlights. */
@@ -6280,7 +6364,7 @@ class te {
6280
6364
  const a = 72;
6281
6365
  let v = !1;
6282
6366
  for (let y = 0; y <= a; y++) {
6283
- const c = y / a * 2 * Math.PI, k = r.dec + l.radiusDeg * Math.sin(c), u = Math.cos(r.dec * is), f = r.ra + (u > 1e-6 ? l.radiusDeg * Math.cos(c) / u : 0), d = this._project({ ra: f, dec: Math.max(-90, Math.min(90, k)) });
6367
+ const c = y / a * 2 * Math.PI, k = r.dec + l.radiusDeg * Math.sin(c), u = Math.cos(r.dec * ts), f = r.ra + (u > 1e-6 ? l.radiusDeg * Math.cos(c) / u : 0), d = this._project({ ra: f, dec: Math.max(-90, Math.min(90, k)) });
6284
6368
  if (!d.visible) {
6285
6369
  v = !1;
6286
6370
  continue;
@@ -6338,40 +6422,40 @@ class te {
6338
6422
  );
6339
6423
  }
6340
6424
  }
6341
- function oe(n, s, e) {
6342
- return new te(n, s, e);
6425
+ function ve(n, s, e) {
6426
+ return new le(n, s, e);
6343
6427
  }
6344
6428
  export {
6345
6429
  _ as A,
6346
6430
  W as B,
6347
6431
  L as C,
6348
6432
  F as D,
6349
- xs as E,
6350
- te as I,
6351
- G as M,
6352
- ks as N,
6353
- ce as P,
6433
+ Ls as E,
6434
+ le as I,
6435
+ O as M,
6436
+ us as N,
6437
+ ae as P,
6354
6438
  I as S,
6355
- re as a,
6356
- ae as b,
6357
- oe as c,
6358
- fs as d,
6359
- Rs as e,
6439
+ ce as a,
6440
+ ge as b,
6441
+ ve as c,
6442
+ _s as d,
6443
+ Ns as e,
6360
6444
  J as f,
6361
- os as g,
6362
- rs as h,
6363
- vs as i,
6364
- ws as j,
6365
- ge as k,
6366
- ms as l,
6367
- gs as m,
6368
- Ls as n,
6369
- cs as o,
6370
- js as p,
6371
- ps as q,
6372
- _s as r,
6373
- as as s,
6374
- Qs as t,
6375
- Os as u,
6376
- Gs as v
6445
+ ks as g,
6446
+ as as h,
6447
+ ys as i,
6448
+ Ts as j,
6449
+ oe as k,
6450
+ hs as l,
6451
+ vs as m,
6452
+ Os as n,
6453
+ gs as o,
6454
+ Hs as p,
6455
+ zs as q,
6456
+ As as r,
6457
+ os as s,
6458
+ Zs as t,
6459
+ js as u,
6460
+ Fs as v
6377
6461
  };