@idm-plugin/meteo2 0.7.5 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -299,11 +299,11 @@ var n0 = { exports: {} };
299
299
  return O > 96 ? O - 87 : O > 64 ? O - 29 : O - 48;
300
300
  }
301
301
  function f(O) {
302
- var a = 0, n = O.split("."), R = n[0], t = n[1] || "", U = 1, G, V = 0, I = 1;
302
+ var a = 0, n = O.split("."), R = n[0], t = n[1] || "", U = 1, C, V = 0, I = 1;
303
303
  for (O.charCodeAt(0) === 45 && (a = 1, I = -1), a; a < R.length; a++)
304
- G = q(R.charCodeAt(a)), V = 60 * V + G;
304
+ C = q(R.charCodeAt(a)), V = 60 * V + C;
305
305
  for (a = 0; a < t.length; a++)
306
- U = U / 60, G = q(t.charCodeAt(a)), V += G * U;
306
+ U = U / 60, C = q(t.charCodeAt(a)), V += C * U;
307
307
  return V * I;
308
308
  }
309
309
  function e(O) {
@@ -362,9 +362,9 @@ var n0 = { exports: {} };
362
362
  });
363
363
  },
364
364
  parse: function(O) {
365
- var a = +O, n = this.offsets, R = this.untils, t = R.length - 1, U, G, V, I;
365
+ var a = +O, n = this.offsets, R = this.untils, t = R.length - 1, U, C, V, I;
366
366
  for (I = 0; I < t; I++)
367
- if (U = n[I], G = n[I + 1], V = n[I && I - 1], U < G && l.moveAmbiguousForward ? U = G : U > V && l.moveInvalidForward && (U = V), a < R[I] - U * 6e4)
367
+ if (U = n[I], C = n[I + 1], V = n[I && I - 1], U < C && Z.moveAmbiguousForward ? U = C : U > V && Z.moveInvalidForward && (U = V), a < R[I] - U * 6e4)
368
368
  return n[I];
369
369
  return n[t];
370
370
  },
@@ -381,51 +381,51 @@ var n0 = { exports: {} };
381
381
  function m(O, a) {
382
382
  this.name = O, this.zones = a;
383
383
  }
384
- function E(O) {
384
+ function l(O) {
385
385
  var a = O.toTimeString(), n = a.match(/\([a-z ]+\)/i);
386
386
  n && n[0] ? (n = n[0].match(/[A-Z]/g), n = n ? n.join("") : void 0) : (n = a.match(/[A-Z]{3,5}/g), n = n ? n[0] : void 0), n === "GMT" && (n = void 0), this.at = +O, this.abbr = n, this.offset = O.getTimezoneOffset();
387
387
  }
388
- function C(O) {
388
+ function P(O) {
389
389
  this.zone = O, this.offsetScore = 0, this.abbrScore = 0;
390
390
  }
391
- C.prototype.scoreOffsetAt = function(O) {
391
+ P.prototype.scoreOffsetAt = function(O) {
392
392
  this.offsetScore += Math.abs(this.zone.utcOffset(O.at) - O.offset), this.zone.abbr(O.at).replace(/[^A-Z]/g, "") !== O.abbr && this.abbrScore++;
393
393
  };
394
- function H(O, a) {
394
+ function K(O, a) {
395
395
  for (var n, R; R = ((a.at - O.at) / 12e4 | 0) * 6e4; )
396
- n = new E(new Date(O.at + R)), n.offset === O.offset ? O = n : a = n;
396
+ n = new l(new Date(O.at + R)), n.offset === O.offset ? O = n : a = n;
397
397
  return O;
398
398
  }
399
399
  function h() {
400
- var O = (/* @__PURE__ */ new Date()).getFullYear() - 2, a = new E(new Date(O, 0, 1)), n = a.offset, R = [a], t, U, G, V;
400
+ var O = (/* @__PURE__ */ new Date()).getFullYear() - 2, a = new l(new Date(O, 0, 1)), n = a.offset, R = [a], t, U, C, V;
401
401
  for (V = 1; V < 48; V++)
402
- G = new Date(O, V, 1).getTimezoneOffset(), G !== n && (U = new E(new Date(O, V, 1)), t = H(a, U), R.push(t), R.push(new E(new Date(t.at + 6e4))), a = U, n = G);
402
+ C = new Date(O, V, 1).getTimezoneOffset(), C !== n && (U = new l(new Date(O, V, 1)), t = K(a, U), R.push(t), R.push(new l(new Date(t.at + 6e4))), a = U, n = C);
403
403
  for (V = 0; V < 4; V++)
404
- R.push(new E(new Date(O + V, 0, 1))), R.push(new E(new Date(O + V, 6, 1)));
404
+ R.push(new l(new Date(O + V, 0, 1))), R.push(new l(new Date(O + V, 6, 1)));
405
405
  return R;
406
406
  }
407
- function g(O, a) {
407
+ function H(O, a) {
408
408
  return O.offsetScore !== a.offsetScore ? O.offsetScore - a.offsetScore : O.abbrScore !== a.abbrScore ? O.abbrScore - a.abbrScore : O.zone.population !== a.zone.population ? a.zone.population - O.zone.population : a.zone.name.localeCompare(O.zone.name);
409
409
  }
410
- function D(O, a) {
410
+ function g(O, a) {
411
411
  var n, R;
412
412
  for (e(a), n = 0; n < a.length; n++)
413
413
  R = a[n], A[R] = A[R] || {}, A[R][O] = !0;
414
414
  }
415
- function P(O) {
416
- var a = O.length, n = {}, R = [], t = {}, U, G, V, I;
415
+ function G(O) {
416
+ var a = O.length, n = {}, R = [], t = {}, U, C, V, I;
417
417
  for (U = 0; U < a; U++)
418
418
  if (V = O[U].offset, !t.hasOwnProperty(V)) {
419
419
  I = A[V] || {};
420
- for (G in I)
421
- I.hasOwnProperty(G) && (n[G] = !0);
420
+ for (C in I)
421
+ I.hasOwnProperty(C) && (n[C] = !0);
422
422
  t[V] = !0;
423
423
  }
424
424
  for (U in n)
425
425
  n.hasOwnProperty(U) && R.push(W[U]);
426
426
  return R;
427
427
  }
428
- function Z() {
428
+ function E() {
429
429
  try {
430
430
  var O = Intl.DateTimeFormat().resolvedOptions().timeZone;
431
431
  if (O && O.length > 3) {
@@ -436,16 +436,16 @@ var n0 = { exports: {} };
436
436
  }
437
437
  } catch {
438
438
  }
439
- var n = h(), R = n.length, t = P(n), U = [], G, V, I;
439
+ var n = h(), R = n.length, t = G(n), U = [], C, V, I;
440
440
  for (V = 0; V < t.length; V++) {
441
- for (G = new C(y(t[V])), I = 0; I < R; I++)
442
- G.scoreOffsetAt(n[I]);
443
- U.push(G);
441
+ for (C = new P(y(t[V])), I = 0; I < R; I++)
442
+ C.scoreOffsetAt(n[I]);
443
+ U.push(C);
444
444
  }
445
- return U.sort(g), U.length > 0 ? U[0].zone.name : void 0;
445
+ return U.sort(H), U.length > 0 ? U[0].zone.name : void 0;
446
446
  }
447
447
  function k(O) {
448
- return (!o || O) && (o = Z()), o;
448
+ return (!o || O) && (o = E()), o;
449
449
  }
450
450
  function _(O) {
451
451
  return (O || "").toLowerCase().replace(/\//g, "_");
@@ -453,7 +453,7 @@ var n0 = { exports: {} };
453
453
  function W0(O) {
454
454
  var a, n, R, t;
455
455
  for (typeof O == "string" && (O = [O]), a = 0; a < O.length; a++)
456
- R = O[a].split("|"), n = R[0], t = _(n), b[t] = O[a], W[t] = n, D(t, R[2].split(" "));
456
+ R = O[a].split("|"), n = R[0], t = _(n), b[t] = O[a], W[t] = n, g(t, R[2].split(" "));
457
457
  }
458
458
  function y(O, a) {
459
459
  O = _(O);
@@ -499,7 +499,7 @@ var n0 = { exports: {} };
499
499
  }) : n;
500
500
  }
501
501
  function f0(O) {
502
- W0(O.zones), o0(O.links), T0(O.countries), l.dataVersion = O.version;
502
+ W0(O.zones), o0(O.links), T0(O.countries), Z.dataVersion = O.version;
503
503
  }
504
504
  function O0(O) {
505
505
  return O0.didShowError || (O0.didShowError = !0, v("moment.tz.zoneExists('" + O + "') has been deprecated in favor of !moment.tz.zone('" + O + "')")), !!y(O);
@@ -511,13 +511,13 @@ var n0 = { exports: {} };
511
511
  function v(O) {
512
512
  typeof console < "u" && typeof console.error == "function" && console.error(O);
513
513
  }
514
- function l(O) {
514
+ function Z(O) {
515
515
  var a = Array.prototype.slice.call(arguments, 0, -1), n = arguments[arguments.length - 1], R = M.utc.apply(null, a), t;
516
516
  return !M.isMoment(O) && A0(R) && (t = y(n)) && R.add(t.parse(R), "minutes"), R.tz(n), R;
517
517
  }
518
- l.version = z, l.dataVersion = "", l._zones = b, l._links = p, l._names = W, l._countries = c, l.add = W0, l.link = o0, l.load = f0, l.zone = y, l.zoneExists = O0, l.guess = k, l.names = L0, l.Zone = B, l.unpack = u, l.unpackBase60 = f, l.needsOffset = A0, l.moveInvalidForward = !0, l.moveAmbiguousForward = !1, l.countries = e0, l.zonesForCountry = r0;
518
+ Z.version = z, Z.dataVersion = "", Z._zones = b, Z._links = p, Z._names = W, Z._countries = c, Z.add = W0, Z.link = o0, Z.load = f0, Z.zone = y, Z.zoneExists = O0, Z.guess = k, Z.names = L0, Z.Zone = B, Z.unpack = u, Z.unpackBase60 = f, Z.needsOffset = A0, Z.moveInvalidForward = !0, Z.moveAmbiguousForward = !1, Z.countries = e0, Z.zonesForCountry = r0;
519
519
  var w = M.fn;
520
- M.tz = l, M.defaultZone = null, M.updateOffset = function(O, a) {
520
+ M.tz = Z, M.defaultZone = null, M.updateOffset = function(O, a) {
521
521
  var n = M.defaultZone, R;
522
522
  if (O._z === void 0 && (n && A0(O) && !O._isUTC && O.isValid() && (O._d = M.utc(O._a)._d, O.utc().add(n.parse(O), "minutes")), O._z = n), O._z)
523
523
  if (R = O._z.utcOffset(O), Math.abs(R) < 16 && (R = R / 60), O.utcOffset !== void 0) {
@@ -1412,9 +1412,9 @@ const E0 = "2025b", I0 = [
1412
1412
  };
1413
1413
  var C0 = Z0;
1414
1414
  C0.tz.load(G0);
1415
- let K;
1415
+ let D;
1416
1416
  try {
1417
- K = p0.getLogger("meteo2");
1417
+ D = p0.getLogger("meteo2");
1418
1418
  } catch {
1419
1419
  } finally {
1420
1420
  }
@@ -1492,7 +1492,7 @@ class J0 {
1492
1492
  for (let W = 0; W < M.start_dates.length; W++) {
1493
1493
  M.start_date = M.start_dates[W], M.end_date = M.end_dates[W], M.fake = M.fakes[W];
1494
1494
  const A = M.url[W];
1495
- this.debug && K.debug("[%s] fetch weather via %s with %j", z.requestId, A, {
1495
+ this.debug && D.debug("[%s] fetch weather via %s with %j", z.requestId, A, {
1496
1496
  start_date: M.start_date,
1497
1497
  end_date: M.end_date,
1498
1498
  fake: M.fake,
@@ -1507,9 +1507,9 @@ class J0 {
1507
1507
  }
1508
1508
  delete M.apikey;
1509
1509
  const c = L();
1510
- return this.debug && K.info("[%s] fetch weather api (%j) cost: %d ms", z.requestId, M.url, c.diff(b, "ms")), p;
1510
+ return this.debug && D.info("[%s] fetch weather api (%j) cost: %d ms", z.requestId, M.url, c.diff(b, "ms")), p;
1511
1511
  } catch (b) {
1512
- return K.warn("[%s] weather forecast failed: %s, with %j", z.requestId, b, M), [];
1512
+ return D.warn("[%s] weather forecast failed: %s, with %j", z.requestId, b, M), [];
1513
1513
  }
1514
1514
  }
1515
1515
  /**
@@ -1537,14 +1537,14 @@ class J0 {
1537
1537
  for (let S = 0; S < M.start_dates.length; S++) {
1538
1538
  M.start_date = M.start_dates[S], M.end_date = M.end_dates[S], M.fake = M.fakes[S];
1539
1539
  const m = M.url[S];
1540
- this.debug && K.debug("[%s] fetch marine via %s with %j", z.requestId, m, {
1540
+ this.debug && D.debug("[%s] fetch marine via %s with %j", z.requestId, m, {
1541
1541
  start_date: M.start_date,
1542
1542
  end_date: M.end_date,
1543
1543
  fake: M.fake,
1544
1544
  step: S
1545
1545
  });
1546
- const E = await z0(m, M), C = await this.parseWeatherData(E, M, z);
1547
- q ? await this.mergeSegments(q, C) : q = C;
1546
+ const l = await z0(m, M), P = await this.parseWeatherData(l, M, z);
1547
+ q ? await this.mergeSegments(q, P) : q = P;
1548
1548
  }
1549
1549
  else {
1550
1550
  const S = await z0(M.url, M);
@@ -1552,11 +1552,11 @@ class J0 {
1552
1552
  }
1553
1553
  delete M.apikey;
1554
1554
  const f = L();
1555
- this.debug && K.info("[%s] fetch marine api (%j) cost: %d ms", z.requestId, M.url, f.diff(X, "ms"));
1555
+ this.debug && D.info("[%s] fetch marine api (%j) cost: %d ms", z.requestId, M.url, f.diff(X, "ms"));
1556
1556
  const e = await this.mergeMarineData(q), r = e.find((S) => S.model === "ncep_gfswave016"), N = e.find((S) => S.model === "ncep_gfswave025"), u = e.find((S) => S.model === "meteofrance_wave"), B = e.find((S) => S.model === "best_match");
1557
1557
  return (p = (b = B == null ? void 0 : B.hourly) == null ? void 0 : b.wave_height) != null && p.every((S) => S !== null) ? [B] : (W = (c = u == null ? void 0 : u.hourly) == null ? void 0 : c.wave_height) != null && W.every((S) => S !== null) ? [u] : (o = (A = r == null ? void 0 : r.hourly) == null ? void 0 : A.wave_height) != null && o.every((S) => S !== null) ? [r] : (Y = (d = N == null ? void 0 : N.hourly) == null ? void 0 : d.wave_height) != null && Y.every((S) => S !== null) ? [N] : e != null && e.length ? [e[0]] : [];
1558
1558
  } catch (X) {
1559
- return K.warn("[%s] marine forecast failed: %s, with %j", z.requestId, X, M), [];
1559
+ return D.warn("[%s] marine forecast failed: %s, with %j", z.requestId, X, M), [];
1560
1560
  }
1561
1561
  }
1562
1562
  /**
@@ -1570,62 +1570,62 @@ class J0 {
1570
1570
  var W, A, o, d, Y, X, q, f, e, r;
1571
1571
  const p = [], c = Math.pow(10, b.precision || 6);
1572
1572
  for (let N = 0; N < M.length; N++) {
1573
- const u = M[N], B = u.utcOffsetSeconds(), S = u.timezone(), m = u.current(), E = u.hourly(), C = u.sixHourly(), H = u.daily(), h = {};
1573
+ const u = M[N], B = u.utcOffsetSeconds(), S = u.timezone(), m = u.current(), l = u.hourly(), P = u.sixHourly(), K = u.daily(), h = {};
1574
1574
  if (h.timezone = S || void 0, h.offset = this.prettyTimezoneOffset(B), h.model = z.models instanceof Array ? (W = z.models) == null ? void 0 : W[N] : z.models || "best_match", m) {
1575
- const g = L();
1575
+ const H = L();
1576
1576
  h.current = {
1577
1577
  time: L.unix(Number(m.time())).utc().format()
1578
1578
  };
1579
- for (let P = 0; P < m.variablesLength(); P++) {
1580
- const Z = m.variables(P).value();
1581
- h.current[z.current[P]] = isNaN(Z) ? null : Math.round(Z * c) / c;
1579
+ for (let G = 0; G < m.variablesLength(); G++) {
1580
+ const E = m.variables(G).value();
1581
+ h.current[z.current[G]] = isNaN(E) ? null : Math.round(E * c) / c;
1582
1582
  }
1583
- const D = L();
1584
- this.debug && K.debug("[%s] fetch current variables cost: %d ms", b.requestId, D.diff(g, "ms"));
1583
+ const g = L();
1584
+ this.debug && D.debug("[%s] fetch current variables cost: %d ms", b.requestId, g.diff(H, "ms"));
1585
1585
  }
1586
- if (E) {
1587
- const g = L(), D = L.unix(Number(E.time())).add(z.fake ? 1 : 0, "year");
1586
+ if (l) {
1587
+ const H = L(), g = L.unix(Number(l.time())).add(z.fake ? 1 : 0, "year");
1588
1588
  h.hourly = {
1589
- date: D.utc().format(),
1590
- time: this.range(Number(E.time()), Number(E.timeEnd()), E.interval()).map(
1591
- (Z) => L.unix(Z).add(z.fake ? 1 : 0, "year").diff(D, "h")
1589
+ date: g.utc().format(),
1590
+ time: this.range(Number(l.time()), Number(l.timeEnd()), l.interval()).map(
1591
+ (E) => L.unix(E).add(z.fake ? 1 : 0, "year").diff(g, "h")
1592
1592
  )
1593
1593
  };
1594
- for (let Z = 0; Z < E.variablesLength(); Z++) {
1595
- const k = (d = (o = (A = E.variables(Z).valuesArray()) == null ? void 0 : A.toString()) == null ? void 0 : o.split(",")) == null ? void 0 : d.map((_) => isNaN(_) ? null : Math.round(Number(_) * c) / c);
1596
- h.hourly[z.hourly[Z]] = k;
1594
+ for (let E = 0; E < l.variablesLength(); E++) {
1595
+ const k = (d = (o = (A = l.variables(E).valuesArray()) == null ? void 0 : A.toString()) == null ? void 0 : o.split(",")) == null ? void 0 : d.map((_) => isNaN(_) ? null : Math.round(Number(_) * c) / c);
1596
+ h.hourly[z.hourly[E]] = k;
1597
1597
  }
1598
- const P = L();
1599
- this.debug && K.debug("[%s] fetch hourly variables cost: %d ms", b.requestId, P.diff(g, "ms"));
1598
+ const G = L();
1599
+ this.debug && D.debug("[%s] fetch hourly variables cost: %d ms", b.requestId, G.diff(H, "ms"));
1600
1600
  }
1601
- if (C) {
1602
- const g = L(), D = L.unix(Number(C.time())).add(z.fake ? 1 : 0, "year");
1601
+ if (P) {
1602
+ const H = L(), g = L.unix(Number(P.time())).add(z.fake ? 1 : 0, "year");
1603
1603
  h.sixHourly = {
1604
- date: D.utc().format(),
1605
- time: this.range(Number(C.time()), Number(C.timeEnd()), C.interval()).map(
1606
- (Z) => L.unix(Z).add(z.fake ? 1 : 0, "year").diff(D, "h")
1604
+ date: g.utc().format(),
1605
+ time: this.range(Number(P.time()), Number(P.timeEnd()), P.interval()).map(
1606
+ (E) => L.unix(E).add(z.fake ? 1 : 0, "year").diff(g, "h")
1607
1607
  )
1608
1608
  };
1609
- for (let Z = 0; Z < C.variablesLength(); Z += b.memberLength ?? 1) {
1610
- const k = (q = (X = (Y = C.variables(Z).valuesArray()) == null ? void 0 : Y.toString()) == null ? void 0 : X.split(",")) == null ? void 0 : q.map((_) => isNaN(_) ? null : Math.round(Number(_) * c) / c);
1611
- C.variables(Z), h.sixHourly[z.six_hourly[Z / (b.memberLength ?? 1)]] = k;
1609
+ for (let E = 0; E < P.variablesLength(); E += b.memberLength ?? 1) {
1610
+ const k = (q = (X = (Y = P.variables(E).valuesArray()) == null ? void 0 : Y.toString()) == null ? void 0 : X.split(",")) == null ? void 0 : q.map((_) => isNaN(_) ? null : Math.round(Number(_) * c) / c);
1611
+ P.variables(E), h.sixHourly[z.six_hourly[E / (b.memberLength ?? 1)]] = k;
1612
1612
  }
1613
- const P = L();
1614
- this.debug && K.debug("[%s] fetch 6-hourly variables cost: %d ms", b.requestId, P.diff(g, "ms"));
1613
+ const G = L();
1614
+ this.debug && D.debug("[%s] fetch 6-hourly variables cost: %d ms", b.requestId, G.diff(H, "ms"));
1615
1615
  }
1616
- if (H) {
1617
- const g = L();
1616
+ if (K) {
1617
+ const H = L();
1618
1618
  h.daily = {
1619
- time: this.range(Number(H.time()), Number(H.timeEnd()), H.interval()).map(
1620
- (P) => L.unix(P).add(z.fake ? 1 : 0, "year").utc().format()
1619
+ time: this.range(Number(K.time()), Number(K.timeEnd()), K.interval()).map(
1620
+ (G) => L.unix(G).add(z.fake ? 1 : 0, "year").utc().format()
1621
1621
  )
1622
1622
  };
1623
- for (let P = 0; P < H.variablesLength(); P += b.memberLength ?? 1) {
1624
- const Z = (r = (e = (f = H.variables(P).valuesArray()) == null ? void 0 : f.toString()) == null ? void 0 : e.split(",")) == null ? void 0 : r.map((k) => isNaN(k) ? null : Math.round(Number(k) * c) / c);
1625
- h.daily[z.daily[P / (b.memberLength ?? 1)]] = Z;
1623
+ for (let G = 0; G < K.variablesLength(); G += b.memberLength ?? 1) {
1624
+ const E = (r = (e = (f = K.variables(G).valuesArray()) == null ? void 0 : f.toString()) == null ? void 0 : e.split(",")) == null ? void 0 : r.map((k) => isNaN(k) ? null : Math.round(Number(k) * c) / c);
1625
+ h.daily[z.daily[G / (b.memberLength ?? 1)]] = E;
1626
1626
  }
1627
- const D = L();
1628
- this.debug && K.debug("[%s] fetch daily variables cost: %d ms", b.requestId, D.diff(g, "ms"));
1627
+ const g = L();
1628
+ this.debug && D.debug("[%s] fetch daily variables cost: %d ms", b.requestId, g.diff(H, "ms"));
1629
1629
  }
1630
1630
  p.push(h);
1631
1631
  }
@@ -1767,7 +1767,7 @@ class J0 {
1767
1767
  selfHosted: !0
1768
1768
  }) {
1769
1769
  var e, r, N, u, B, S;
1770
- z = this.toStdLng(z), this.debug && K.info("[%s] spot forecast params: %j", A.requestId, { lat: M, lng: z, datetime: b, simplify: p, withDaily: c, withHourly: W, options: A });
1770
+ z = this.toStdLng(z), this.debug && D.info("[%s] spot forecast params: %j", A.requestId, { lat: M, lng: z, datetime: b, simplify: p, withDaily: c, withHourly: W, options: A });
1771
1771
  const o = {
1772
1772
  apikey: this.apikey,
1773
1773
  latitude: M,
@@ -1818,7 +1818,7 @@ class J0 {
1818
1818
  precision: 6
1819
1819
  }) {
1820
1820
  var r, N;
1821
- z = this.toStdLng(z), this.debug && K.info("[%s] spot historical params: %j", o.requestId, { lat: M, lng: z, startDate: b, endDate: p, withMarine: A, options: o });
1821
+ z = this.toStdLng(z), this.debug && D.info("[%s] spot historical params: %j", o.requestId, { lat: M, lng: z, startDate: b, endDate: p, withMarine: A, options: o });
1822
1822
  const d = this.timezoneOffset(M, z), Y = L.utc(b).utcOffset(d), X = L.utc(p).utcOffset(d);
1823
1823
  Y.subtract(d > 0 ? d : -d, "h"), X.subtract(d > 0 ? d : -d, "h");
1824
1824
  const q = {
@@ -1869,7 +1869,7 @@ class J0 {
1869
1869
  async spotSeasonal(M, z, b, p, c = !1, W = {
1870
1870
  precision: 6
1871
1871
  }) {
1872
- z = this.toStdLng(z), this.debug && K.info("[%s] spot seasonal params: %j", W.requestId, { lat: M, lng: z, startDate: b, endDate: p, options: W });
1872
+ z = this.toStdLng(z), this.debug && D.info("[%s] spot seasonal params: %j", W.requestId, { lat: M, lng: z, startDate: b, endDate: p, options: W });
1873
1873
  const A = this.timezoneOffset(M, z), o = L.utc(b).utcOffset(A), d = p ? L.utc(p).utcOffset(A) : o.clone().add(1, "month");
1874
1874
  o.subtract(A > 0 ? A : -A, "h"), d.subtract(A > 0 ? A : -A, "h");
1875
1875
  const Y = {
@@ -1910,7 +1910,7 @@ class J0 {
1910
1910
  precision: 6
1911
1911
  }) {
1912
1912
  var X;
1913
- z = this.toStdLng(z), this.debug && K.info("[%s] spot climate params: %j", c.requestId, { lat: M, lng: z, startDate: b, endDate: p, options: c });
1913
+ z = this.toStdLng(z), this.debug && D.info("[%s] spot climate params: %j", c.requestId, { lat: M, lng: z, startDate: b, endDate: p, options: c });
1914
1914
  const W = this.timezoneOffset(M, z), A = L.utc(b).utcOffset(W), o = p ? L.utc(p).utcOffset(W) : A.clone().add(1, "day");
1915
1915
  o.subtract(W > 0 ? W : -W, "h"), A.subtract(W > 0 ? W : -W, "h");
1916
1916
  const d = {
@@ -1931,32 +1931,39 @@ class J0 {
1931
1931
  async update(M = {}) {
1932
1932
  const z = L.unix(this.METEO2_UPDATE.etime), b = this.METEO2_UPDATE.version, p = L();
1933
1933
  if (!b || z.clone().add(10, "minute").isBefore(p)) {
1934
- const c = M.url || "https://meteo3agent.idmwx.com/api/agents/update", A = await (await fetch(c, {
1934
+ const c = M.url || "https://meteo3agent.idmwx.com/api/agents/update", W = await fetch(c, {
1935
1935
  headers: {
1936
1936
  "Content-Type": "application/json",
1937
1937
  Authorization: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNsYmY5M3I0YTAwMDE4Ymx0NWJ4emFwNWMiLCJyb2xlIjoyMDQ3LCJpYXQiOjE2NzA1NTM0NzAsImV4cCI6Mzg3ODA3MzQ3MH0.MxTv0yLGarZCtOSCZfJHMqrXNMNN0-OL4gBGKGcYcc8"
1938
1938
  }
1939
- })).json();
1940
- if (A.code === 0) {
1941
- const o = A.data, d = M0.standardWeatherModels();
1942
- for (const Y of d) {
1943
- const X = M0.autoPickSubCategories(Y.alias), f = o.filter((e) => X.includes(e.category)).map((e) => {
1944
- var r, N, u, B, S, m;
1945
- return {
1946
- category: e.category,
1947
- meta: {
1948
- endTime: L.unix((r = e.meta) == null ? void 0 : r.data_end_time).utc().format(),
1949
- availabilityTime: L.unix((N = e.meta) == null ? void 0 : N.last_run_availability_time).utc().format(),
1950
- initialisationTime: L.unix((u = e.meta) == null ? void 0 : u.last_run_initialisation_time).utc().format(),
1951
- modificationTime: L.unix((B = e.meta) == null ? void 0 : B.last_run_modification_time).utc().format(),
1952
- temporalResolution: Math.round(((S = e.meta) == null ? void 0 : S.temporal_resolution_seconds) / 3600),
1953
- frequency: Math.round(((m = e.meta) == null ? void 0 : m.update_interval_seconds) / 3600)
1954
- }
1955
- };
1956
- });
1957
- f.length && (this.METEO2_UPDATE[Y.alias] = f);
1939
+ });
1940
+ try {
1941
+ const A = await W.json();
1942
+ if (A.code === 0) {
1943
+ const o = A.data, d = M0.standardWeatherModels();
1944
+ for (const Y of d) {
1945
+ const X = M0.autoPickSubCategories(Y.alias), f = o.filter((e) => X.includes(e.category)).map((e) => {
1946
+ var B, S, m, l, P, K;
1947
+ const r = L.unix((B = e.meta) == null ? void 0 : B.data_end_time).utc(), N = L.unix((S = e.meta) == null ? void 0 : S.last_run_availability_time).utc(), u = r.diff(N, "days");
1948
+ return {
1949
+ category: e.category,
1950
+ meta: {
1951
+ endTime: r.format(),
1952
+ availabilityTime: N.format(),
1953
+ days: u,
1954
+ initialisationTime: L.unix((m = e.meta) == null ? void 0 : m.last_run_initialisation_time).utc().format(),
1955
+ modificationTime: L.unix((l = e.meta) == null ? void 0 : l.last_run_modification_time).utc().format(),
1956
+ temporalResolution: Math.round(((P = e.meta) == null ? void 0 : P.temporal_resolution_seconds) / 3600),
1957
+ frequency: Math.round(((K = e.meta) == null ? void 0 : K.update_interval_seconds) / 3600)
1958
+ }
1959
+ };
1960
+ });
1961
+ f.length && (this.METEO2_UPDATE[Y.alias] = f);
1962
+ }
1963
+ this.METEO2_UPDATE.version = b + 1, this.METEO2_UPDATE.etime = p.unix();
1958
1964
  }
1959
- this.METEO2_UPDATE.version = b + 1, this.METEO2_UPDATE.etime = p.unix();
1965
+ } catch (A) {
1966
+ D.error("[%s] update meteo2 error: %s", M.requestId, A);
1960
1967
  }
1961
1968
  }
1962
1969
  return this.METEO2_UPDATE;
@@ -1995,6 +2002,7 @@ class k0 {
1995
2002
  * @param lng
1996
2003
  *
1997
2004
  * Start date (in YYYY-MM-DD format) to retrieve the tidal heights or extremes starting at midnight local time. You can also pass "today" to use the current date of the location.
2005
+ * @param days
1998
2006
  * @param date
1999
2007
  *
2000
2008
  * If this parameter is present the low and high tides will be returned.
@@ -2143,7 +2151,7 @@ const J = class J {
2143
2151
  static async parseHistory(M) {
2144
2152
  const z = `https://hifleet.com/hifleetapi/gettyphooninfo2.do?xuhao=${M}`, b = await Q.post(z).text(), p = await J.parser.parseStringPromise(b), c = p.typhoon.position instanceof Array ? p.typhoon.position : [p.typhoon.position], W = [];
2145
2153
  for (const A of c) {
2146
- const o = L(A.updatetime).utcOffset(8).utc().format(), d = Number(A.lat), Y = Number(A.lon), X = Number(A.pressure), q = Number(A.windspeed * 3600 / 1852), f = T.parseWindCircle(A.c7quad1 / 1.852), e = T.parseWindCircle(A.c7quad2 / 1.852), r = T.parseWindCircle(A.c7quad3 / 1.852), N = T.parseWindCircle(A.c7quad4 / 1.852), u = T.parseWindCircle(A.c10quad1 / 1.852), B = T.parseWindCircle(A.c10quad2 / 1.852), S = T.parseWindCircle(A.c10quad3 / 1.852), m = T.parseWindCircle(A.c10quad4 / 1.852), E = T.parseWindCircle(A.c12quad1 / 1.852), C = T.parseWindCircle(A.c12quad2 / 1.852), H = T.parseWindCircle(A.c12quad3 / 1.852), h = T.parseWindCircle(A.c12quad4 / 1.852), { r7: g, r10: D, r12: P } = T.estimateWindRadii(q, X, d), Z = {
2154
+ const o = L(A.updatetime).utcOffset(8).utc().format(), d = Number(A.lat), Y = Number(A.lon), X = Number(A.pressure), q = Number(A.windspeed * 3600 / 1852), f = T.parseWindCircle(A.c7quad1 / 1.852), e = T.parseWindCircle(A.c7quad2 / 1.852), r = T.parseWindCircle(A.c7quad3 / 1.852), N = T.parseWindCircle(A.c7quad4 / 1.852), u = T.parseWindCircle(A.c10quad1 / 1.852), B = T.parseWindCircle(A.c10quad2 / 1.852), S = T.parseWindCircle(A.c10quad3 / 1.852), m = T.parseWindCircle(A.c10quad4 / 1.852), l = T.parseWindCircle(A.c12quad1 / 1.852), P = T.parseWindCircle(A.c12quad2 / 1.852), K = T.parseWindCircle(A.c12quad3 / 1.852), h = T.parseWindCircle(A.c12quad4 / 1.852), { r7: H, r10: g, r12: G } = T.estimateWindRadii(q, X, d), E = {
2147
2155
  updated: o,
2148
2156
  lat: isNaN(d) ? null : d,
2149
2157
  lng: isNaN(Y) ? null : Y,
@@ -2151,24 +2159,24 @@ const J = class J {
2151
2159
  kts: isNaN(q) ? null : Math.round(q) || null,
2152
2160
  type: T.parseTropicalType(q),
2153
2161
  wind: {
2154
- r7: g,
2162
+ r7: H,
2155
2163
  r7ne: f,
2156
2164
  r7nw: e,
2157
2165
  r7sw: r,
2158
2166
  r7se: N,
2159
- r10: D,
2167
+ r10: g,
2160
2168
  r10ne: u,
2161
2169
  r10nw: B,
2162
2170
  r10sw: S,
2163
2171
  r10se: m,
2164
- r12: P,
2165
- r12ne: E,
2166
- r12nw: C,
2167
- r12sw: H,
2172
+ r12: G,
2173
+ r12ne: l,
2174
+ r12nw: P,
2175
+ r12sw: K,
2168
2176
  r12se: h
2169
2177
  }
2170
2178
  };
2171
- W.push(Z);
2179
+ W.push(E);
2172
2180
  }
2173
2181
  return W.sort((A, o) => L(o.updated).unix() - L(A.updated).unix()), W;
2174
2182
  }
@@ -2251,7 +2259,7 @@ let b0 = J;
2251
2259
  class j {
2252
2260
  static async parseHistory(M) {
2253
2261
  return M.map((z) => {
2254
- const b = Number(z.lat), p = Number(z.lon), c = Number(z.maxSP * 3600 / 1852), W = Number(z.minP), A = T.parseWindCircle(z.r7Ne / 1.852), o = T.parseWindCircle(z.r7Nw / 1.852), d = T.parseWindCircle(z.r7Se / 1.852), Y = T.parseWindCircle(z.r7Sw / 1.852), X = T.parseWindCircle(z.r10Ne / 1.852), q = T.parseWindCircle(z.r10Nw / 1.852), f = T.parseWindCircle(z.r10Se / 1.852), e = T.parseWindCircle(z.r10Sw / 1.852), r = T.parseWindCircle(z.r12Ne / 1.852), N = T.parseWindCircle(z.r12Nw / 1.852), u = T.parseWindCircle(z.r12Se / 1.852), B = T.parseWindCircle(z.r12Sw / 1.852), { r7: S, r10: m, r12: E } = T.estimateWindRadii(c, W, b);
2262
+ const b = Number(z.lat), p = Number(z.lon), c = Number(z.maxSP * 3600 / 1852), W = Number(z.minP), A = T.parseWindCircle(z.r7Ne / 1.852), o = T.parseWindCircle(z.r7Nw / 1.852), d = T.parseWindCircle(z.r7Se / 1.852), Y = T.parseWindCircle(z.r7Sw / 1.852), X = T.parseWindCircle(z.r10Ne / 1.852), q = T.parseWindCircle(z.r10Nw / 1.852), f = T.parseWindCircle(z.r10Se / 1.852), e = T.parseWindCircle(z.r10Sw / 1.852), r = T.parseWindCircle(z.r12Ne / 1.852), N = T.parseWindCircle(z.r12Nw / 1.852), u = T.parseWindCircle(z.r12Se / 1.852), B = T.parseWindCircle(z.r12Sw / 1.852), { r7: S, r10: m, r12: l } = T.estimateWindRadii(c, W, b);
2255
2263
  return {
2256
2264
  updated: L.utc(z.realTime).format(),
2257
2265
  lat: isNaN(b) ? null : b || null,
@@ -2269,7 +2277,7 @@ class j {
2269
2277
  r10nw: q,
2270
2278
  r10se: f,
2271
2279
  r10sw: e,
2272
- r12: E,
2280
+ r12: l,
2273
2281
  r12ne: r,
2274
2282
  r12nw: N,
2275
2283
  r12se: u,
@@ -2282,7 +2290,7 @@ class j {
2282
2290
  return M.map((z) => {
2283
2291
  const b = z.currentPosition, p = z.forecastPoints, c = L.utc(b.realTime).format(), W = {};
2284
2292
  return p.forEach((A) => {
2285
- const o = L.utc(A.forecastTime), d = o.diff(c, "hour"), Y = Math.round(A.maxSP * 3600 / 1852), X = Math.round(A.maxSP * 3600 / 1852), q = A.pressure, f = T.parseWindCircle(A.r7Ne / 1.852), e = T.parseWindCircle(A.r7Nw / 1.852), r = T.parseWindCircle(A.r7Sw / 1.852), N = T.parseWindCircle(A.r7Se / 1.852), u = T.parseWindCircle(A.r10Ne / 1.852), B = T.parseWindCircle(A.r10Nw / 1.852), S = T.parseWindCircle(A.r10Sw / 1.852), m = T.parseWindCircle(A.r10Se / 1.852), E = T.parseWindCircle(A.r12Ne / 1.852), C = T.parseWindCircle(A.r12Nw / 1.852), H = T.parseWindCircle(A.r12Sw / 1.852), h = T.parseWindCircle(A.r12Se / 1.852), { r7: g, r10: D, r12: P } = T.estimateWindRadii(Y, q, A.lat);
2293
+ const o = L.utc(A.forecastTime), d = o.diff(c, "hour"), Y = Math.round(A.maxSP * 3600 / 1852), X = Math.round(A.maxSP * 3600 / 1852), q = A.pressure, f = T.parseWindCircle(A.r7Ne / 1.852), e = T.parseWindCircle(A.r7Nw / 1.852), r = T.parseWindCircle(A.r7Sw / 1.852), N = T.parseWindCircle(A.r7Se / 1.852), u = T.parseWindCircle(A.r10Ne / 1.852), B = T.parseWindCircle(A.r10Nw / 1.852), S = T.parseWindCircle(A.r10Sw / 1.852), m = T.parseWindCircle(A.r10Se / 1.852), l = T.parseWindCircle(A.r12Ne / 1.852), P = T.parseWindCircle(A.r12Nw / 1.852), K = T.parseWindCircle(A.r12Sw / 1.852), h = T.parseWindCircle(A.r12Se / 1.852), { r7: H, r10: g, r12: G } = T.estimateWindRadii(Y, q, A.lat);
2286
2294
  W[d] = {
2287
2295
  lat: A.lat,
2288
2296
  lng: A.lon,
@@ -2292,20 +2300,20 @@ class j {
2292
2300
  kts: isNaN(Y) ? null : Y || null,
2293
2301
  type: T.parseTropicalType(Y),
2294
2302
  datetime: o.format(),
2295
- r7: g,
2303
+ r7: H,
2296
2304
  r7ne: f,
2297
2305
  r7nw: e,
2298
2306
  r7sw: r,
2299
2307
  r7se: N,
2300
- r10: D,
2308
+ r10: g,
2301
2309
  r10ne: u,
2302
2310
  r10nw: B,
2303
2311
  r10sw: S,
2304
2312
  r10se: m,
2305
- r12: P,
2306
- r12ne: E,
2307
- r12nw: C,
2308
- r12sw: H,
2313
+ r12: G,
2314
+ r12ne: l,
2315
+ r12nw: P,
2316
+ r12sw: K,
2309
2317
  r12se: h
2310
2318
  },
2311
2319
  gusts: {
@@ -2454,7 +2462,7 @@ class T {
2454
2462
  p = 51.6 * Math.exp(-0.0223 * M + 0.0281 * c) * Math.pow(Math.max(W, 10) / 100, 0.155);
2455
2463
  } else
2456
2464
  p = 46.4 * Math.exp(-0.0155 * M + 0.0169 * c);
2457
- return Math.max(10 / 1.852, Math.min(150 / 1.852, p));
2465
+ return Math.max(60 / 1.852, Math.min(150 / 1.852, p));
2458
2466
  }
2459
2467
  /**
2460
2468
  * 基于台风强度推算风圈基础半径的经验公式