@idm-plugin/geo 1.6.2 → 1.6.4

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
@@ -1,5 +1,5 @@
1
1
  import * as T from "@turf/turf";
2
- import g from "moment";
2
+ import C from "moment";
3
3
  import _ from "@log4js-node/log4js-api";
4
4
  var X0 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
5
  function a0(E) {
@@ -13,42 +13,42 @@ var j = { exports: {} };
13
13
  //! license : MIT
14
14
  //! github.com/moment/moment-timezone
15
15
  (function(M, z) {
16
- E.exports ? E.exports = z(g) : z(M.moment);
16
+ E.exports ? E.exports = z(C) : z(M.moment);
17
17
  })(X0, function(M) {
18
18
  M.version === void 0 && M.default && (M = M.default);
19
- var z = "0.5.45", p = {}, O = {}, A = {}, b = {}, W = {}, q;
19
+ var z = "0.5.45", p = {}, O = {}, A = {}, b = {}, c = {}, q;
20
20
  (!M || typeof M.version != "string") && D("Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/");
21
21
  var o = M.version.split("."), R = +o[0], Y = +o[1];
22
22
  (R < 2 || R === 2 && Y < 6) && D("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js " + M.version + ". See momentjs.com");
23
- function i(c) {
24
- return c > 96 ? c - 87 : c > 64 ? c - 29 : c - 48;
23
+ function i(W) {
24
+ return W > 96 ? W - 87 : W > 64 ? W - 29 : W - 48;
25
25
  }
26
- function e(c) {
27
- var d = 0, X = c.split("."), n = X[0], L = X[1] || "", f = 1, t, B = 0, V = 1;
28
- for (c.charCodeAt(0) === 45 && (d = 1, V = -1), d; d < n.length; d++)
26
+ function e(W) {
27
+ var d = 0, X = W.split("."), n = X[0], L = X[1] || "", f = 1, t, B = 0, V = 1;
28
+ for (W.charCodeAt(0) === 45 && (d = 1, V = -1), d; d < n.length; d++)
29
29
  t = i(n.charCodeAt(d)), B = 60 * B + t;
30
30
  for (d = 0; d < L.length; d++)
31
31
  f = f / 60, t = i(L.charCodeAt(d)), B += t * f;
32
32
  return B * V;
33
33
  }
34
- function U(c) {
35
- for (var d = 0; d < c.length; d++)
36
- c[d] = e(c[d]);
34
+ function u(W) {
35
+ for (var d = 0; d < W.length; d++)
36
+ W[d] = e(W[d]);
37
37
  }
38
- function S(c, d) {
38
+ function S(W, d) {
39
39
  for (var X = 0; X < d; X++)
40
- c[X] = Math.round((c[X - 1] || 0) + c[X] * 6e4);
41
- c[d - 1] = 1 / 0;
40
+ W[X] = Math.round((W[X - 1] || 0) + W[X] * 6e4);
41
+ W[d - 1] = 1 / 0;
42
42
  }
43
- function s(c, d) {
43
+ function s(W, d) {
44
44
  var X = [], n;
45
45
  for (n = 0; n < d.length; n++)
46
- X[n] = c[d[n]];
46
+ X[n] = W[d[n]];
47
47
  return X;
48
48
  }
49
- function P(c) {
50
- var d = c.split("|"), X = d[2].split(" "), n = d[3].split(""), L = d[4].split(" ");
51
- return U(X), U(n), U(L), S(L, n.length), {
49
+ function P(W) {
50
+ var d = W.split("|"), X = d[2].split(" "), n = d[3].split(""), L = d[4].split(" ");
51
+ return u(X), u(n), u(L), S(L, n.length), {
52
52
  name: d[0],
53
53
  abbrs: s(d[1].split(" "), n),
54
54
  offsets: s(X, n),
@@ -56,92 +56,92 @@ var j = { exports: {} };
56
56
  population: d[5] | 0
57
57
  };
58
58
  }
59
- function G(c) {
60
- c && this._set(P(c));
59
+ function G(W) {
60
+ W && this._set(P(W));
61
61
  }
62
- function l(c, d) {
62
+ function l(W, d) {
63
63
  var X = d.length;
64
- if (c < d[0])
64
+ if (W < d[0])
65
65
  return 0;
66
- if (X > 1 && d[X - 1] === 1 / 0 && c >= d[X - 2])
66
+ if (X > 1 && d[X - 1] === 1 / 0 && W >= d[X - 2])
67
67
  return X - 1;
68
- if (c >= d[X - 1])
68
+ if (W >= d[X - 1])
69
69
  return -1;
70
70
  for (var n, L = 0, f = X - 1; f - L > 1; )
71
- n = Math.floor((L + f) / 2), d[n] <= c ? L = n : f = n;
71
+ n = Math.floor((L + f) / 2), d[n] <= W ? L = n : f = n;
72
72
  return f;
73
73
  }
74
74
  G.prototype = {
75
- _set: function(c) {
76
- this.name = c.name, this.abbrs = c.abbrs, this.untils = c.untils, this.offsets = c.offsets, this.population = c.population;
75
+ _set: function(W) {
76
+ this.name = W.name, this.abbrs = W.abbrs, this.untils = W.untils, this.offsets = W.offsets, this.population = W.population;
77
77
  },
78
- _index: function(c) {
79
- var d = +c, X = this.untils, n;
78
+ _index: function(W) {
79
+ var d = +W, X = this.untils, n;
80
80
  if (n = l(d, X), n >= 0)
81
81
  return n;
82
82
  },
83
83
  countries: function() {
84
- var c = this.name;
84
+ var W = this.name;
85
85
  return Object.keys(A).filter(function(d) {
86
- return A[d].zones.indexOf(c) !== -1;
86
+ return A[d].zones.indexOf(W) !== -1;
87
87
  });
88
88
  },
89
- parse: function(c) {
90
- var d = +c, X = this.offsets, n = this.untils, L = n.length - 1, f, t, B, V;
89
+ parse: function(W) {
90
+ var d = +W, X = this.offsets, n = this.untils, L = n.length - 1, f, t, B, V;
91
91
  for (V = 0; V < L; V++)
92
- if (f = X[V], t = X[V + 1], B = X[V && V - 1], f < t && r.moveAmbiguousForward ? f = t : f > B && r.moveInvalidForward && (f = B), d < n[V] - f * 6e4)
92
+ if (f = X[V], t = X[V + 1], B = X[V && V - 1], f < t && U.moveAmbiguousForward ? f = t : f > B && U.moveInvalidForward && (f = B), d < n[V] - f * 6e4)
93
93
  return X[V];
94
94
  return X[L];
95
95
  },
96
- abbr: function(c) {
97
- return this.abbrs[this._index(c)];
96
+ abbr: function(W) {
97
+ return this.abbrs[this._index(W)];
98
98
  },
99
- offset: function(c) {
100
- return D("zone.offset has been deprecated in favor of zone.utcOffset"), this.offsets[this._index(c)];
99
+ offset: function(W) {
100
+ return D("zone.offset has been deprecated in favor of zone.utcOffset"), this.offsets[this._index(W)];
101
101
  },
102
- utcOffset: function(c) {
103
- return this.offsets[this._index(c)];
102
+ utcOffset: function(W) {
103
+ return this.offsets[this._index(W)];
104
104
  }
105
105
  };
106
- function N(c, d) {
107
- this.name = c, this.zones = d;
106
+ function N(W, d) {
107
+ this.name = W, this.zones = d;
108
108
  }
109
- function I(c) {
110
- var d = c.toTimeString(), X = d.match(/\([a-z ]+\)/i);
111
- X && X[0] ? (X = X[0].match(/[A-Z]/g), X = X ? X.join("") : void 0) : (X = d.match(/[A-Z]{3,5}/g), X = X ? X[0] : void 0), X === "GMT" && (X = void 0), this.at = +c, this.abbr = X, this.offset = c.getTimezoneOffset();
109
+ function I(W) {
110
+ var d = W.toTimeString(), X = d.match(/\([a-z ]+\)/i);
111
+ X && X[0] ? (X = X[0].match(/[A-Z]/g), X = X ? X.join("") : void 0) : (X = d.match(/[A-Z]{3,5}/g), X = X ? X[0] : void 0), X === "GMT" && (X = void 0), this.at = +W, this.abbr = X, this.offset = W.getTimezoneOffset();
112
112
  }
113
- function H(c) {
114
- this.zone = c, this.offsetScore = 0, this.abbrScore = 0;
113
+ function H(W) {
114
+ this.zone = W, this.offsetScore = 0, this.abbrScore = 0;
115
115
  }
116
- H.prototype.scoreOffsetAt = function(c) {
117
- this.offsetScore += Math.abs(this.zone.utcOffset(c.at) - c.offset), this.zone.abbr(c.at).replace(/[^A-Z]/g, "") !== c.abbr && this.abbrScore++;
116
+ H.prototype.scoreOffsetAt = function(W) {
117
+ this.offsetScore += Math.abs(this.zone.utcOffset(W.at) - W.offset), this.zone.abbr(W.at).replace(/[^A-Z]/g, "") !== W.abbr && this.abbrScore++;
118
118
  };
119
- function Q(c, d) {
120
- for (var X, n; n = ((d.at - c.at) / 12e4 | 0) * 6e4; )
121
- X = new I(new Date(c.at + n)), X.offset === c.offset ? c = X : d = X;
122
- return c;
119
+ function Q(W, d) {
120
+ for (var X, n; n = ((d.at - W.at) / 12e4 | 0) * 6e4; )
121
+ X = new I(new Date(W.at + n)), X.offset === W.offset ? W = X : d = X;
122
+ return W;
123
123
  }
124
124
  function F() {
125
- var c = (/* @__PURE__ */ new Date()).getFullYear() - 2, d = new I(new Date(c, 0, 1)), X = d.offset, n = [d], L, f, t, B;
125
+ var W = (/* @__PURE__ */ new Date()).getFullYear() - 2, d = new I(new Date(W, 0, 1)), X = d.offset, n = [d], L, f, t, B;
126
126
  for (B = 1; B < 48; B++)
127
- t = new Date(c, B, 1).getTimezoneOffset(), t !== X && (f = new I(new Date(c, B, 1)), L = Q(d, f), n.push(L), n.push(new I(new Date(L.at + 6e4))), d = f, X = t);
127
+ t = new Date(W, B, 1).getTimezoneOffset(), t !== X && (f = new I(new Date(W, B, 1)), L = Q(d, f), n.push(L), n.push(new I(new Date(L.at + 6e4))), d = f, X = t);
128
128
  for (B = 0; B < 4; B++)
129
- n.push(new I(new Date(c + B, 0, 1))), n.push(new I(new Date(c + B, 6, 1)));
129
+ n.push(new I(new Date(W + B, 0, 1))), n.push(new I(new Date(W + B, 6, 1)));
130
130
  return n;
131
131
  }
132
- function M0(c, d) {
133
- return c.offsetScore !== d.offsetScore ? c.offsetScore - d.offsetScore : c.abbrScore !== d.abbrScore ? c.abbrScore - d.abbrScore : c.zone.population !== d.zone.population ? d.zone.population - c.zone.population : d.zone.name.localeCompare(c.zone.name);
132
+ function M0(W, d) {
133
+ return W.offsetScore !== d.offsetScore ? W.offsetScore - d.offsetScore : W.abbrScore !== d.abbrScore ? W.abbrScore - d.abbrScore : W.zone.population !== d.zone.population ? d.zone.population - W.zone.population : d.zone.name.localeCompare(W.zone.name);
134
134
  }
135
- function z0(c, d) {
135
+ function z0(W, d) {
136
136
  var X, n;
137
- for (U(d), X = 0; X < d.length; X++)
138
- n = d[X], W[n] = W[n] || {}, W[n][c] = !0;
137
+ for (u(d), X = 0; X < d.length; X++)
138
+ n = d[X], c[n] = c[n] || {}, c[n][W] = !0;
139
139
  }
140
- function b0(c) {
141
- var d = c.length, X = {}, n = [], L = {}, f, t, B, V;
140
+ function b0(W) {
141
+ var d = W.length, X = {}, n = [], L = {}, f, t, B, V;
142
142
  for (f = 0; f < d; f++)
143
- if (B = c[f].offset, !L.hasOwnProperty(B)) {
144
- V = W[B] || {};
143
+ if (B = W[f].offset, !L.hasOwnProperty(B)) {
144
+ V = c[B] || {};
145
145
  for (t in V)
146
146
  V.hasOwnProperty(t) && (X[t] = !0);
147
147
  L[B] = !0;
@@ -152,130 +152,130 @@ var j = { exports: {} };
152
152
  }
153
153
  function p0() {
154
154
  try {
155
- var c = Intl.DateTimeFormat().resolvedOptions().timeZone;
156
- if (c && c.length > 3) {
157
- var d = b[K(c)];
155
+ var W = Intl.DateTimeFormat().resolvedOptions().timeZone;
156
+ if (W && W.length > 3) {
157
+ var d = b[K(W)];
158
158
  if (d)
159
159
  return d;
160
- D("Moment Timezone found " + c + " from the Intl api, but did not have that data loaded.");
160
+ D("Moment Timezone found " + W + " from the Intl api, but did not have that data loaded.");
161
161
  }
162
162
  } catch {
163
163
  }
164
164
  var X = F(), n = X.length, L = b0(X), f = [], t, B, V;
165
165
  for (B = 0; B < L.length; B++) {
166
- for (t = new H(m(L[B])), V = 0; V < n; V++)
166
+ for (t = new H(g(L[B])), V = 0; V < n; V++)
167
167
  t.scoreOffsetAt(X[V]);
168
168
  f.push(t);
169
169
  }
170
170
  return f.sort(M0), f.length > 0 ? f[0].zone.name : void 0;
171
171
  }
172
- function O0(c) {
173
- return (!q || c) && (q = p0()), q;
172
+ function O0(W) {
173
+ return (!q || W) && (q = p0()), q;
174
174
  }
175
- function K(c) {
176
- return (c || "").toLowerCase().replace(/\//g, "_");
175
+ function K(W) {
176
+ return (W || "").toLowerCase().replace(/\//g, "_");
177
177
  }
178
- function k(c) {
178
+ function k(W) {
179
179
  var d, X, n, L;
180
- for (typeof c == "string" && (c = [c]), d = 0; d < c.length; d++)
181
- n = c[d].split("|"), X = n[0], L = K(X), p[L] = c[d], b[L] = X, z0(L, n[2].split(" "));
180
+ for (typeof W == "string" && (W = [W]), d = 0; d < W.length; d++)
181
+ n = W[d].split("|"), X = n[0], L = K(X), p[L] = W[d], b[L] = X, z0(L, n[2].split(" "));
182
182
  }
183
- function m(c, d) {
184
- c = K(c);
185
- var X = p[c], n;
186
- return X instanceof G ? X : typeof X == "string" ? (X = new G(X), p[c] = X, X) : O[c] && d !== m && (n = m(O[c], m)) ? (X = p[c] = new G(), X._set(n), X.name = b[c], X) : null;
183
+ function g(W, d) {
184
+ W = K(W);
185
+ var X = p[W], n;
186
+ return X instanceof G ? X : typeof X == "string" ? (X = new G(X), p[W] = X, X) : O[W] && d !== g && (n = g(O[W], g)) ? (X = p[W] = new G(), X._set(n), X.name = b[W], X) : null;
187
187
  }
188
188
  function A0() {
189
- var c, d = [];
190
- for (c in b)
191
- b.hasOwnProperty(c) && (p[c] || p[O[c]]) && b[c] && d.push(b[c]);
189
+ var W, d = [];
190
+ for (W in b)
191
+ b.hasOwnProperty(W) && (p[W] || p[O[W]]) && b[W] && d.push(b[W]);
192
192
  return d.sort();
193
193
  }
194
194
  function c0() {
195
195
  return Object.keys(A);
196
196
  }
197
- function v(c) {
197
+ function v(W) {
198
198
  var d, X, n, L;
199
- for (typeof c == "string" && (c = [c]), d = 0; d < c.length; d++)
200
- X = c[d].split("|"), n = K(X[0]), L = K(X[1]), O[n] = L, b[n] = X[0], O[L] = n, b[L] = X[1];
199
+ for (typeof W == "string" && (W = [W]), d = 0; d < W.length; d++)
200
+ X = W[d].split("|"), n = K(X[0]), L = K(X[1]), O[n] = L, b[n] = X[0], O[L] = n, b[L] = X[1];
201
201
  }
202
- function W0(c) {
202
+ function W0(W) {
203
203
  var d, X, n, L;
204
- if (!(!c || !c.length))
205
- for (d = 0; d < c.length; d++)
206
- L = c[d].split("|"), X = L[0].toUpperCase(), n = L[1].split(" "), A[X] = new N(
204
+ if (!(!W || !W.length))
205
+ for (d = 0; d < W.length; d++)
206
+ L = W[d].split("|"), X = L[0].toUpperCase(), n = L[1].split(" "), A[X] = new N(
207
207
  X,
208
208
  n
209
209
  );
210
210
  }
211
- function q0(c) {
212
- return c = c.toUpperCase(), A[c] || null;
211
+ function q0(W) {
212
+ return W = W.toUpperCase(), A[W] || null;
213
213
  }
214
- function o0(c, d) {
215
- if (c = q0(c), !c)
214
+ function o0(W, d) {
215
+ if (W = q0(W), !W)
216
216
  return null;
217
- var X = c.zones.sort();
217
+ var X = W.zones.sort();
218
218
  return d ? X.map(function(n) {
219
- var L = m(n);
219
+ var L = g(n);
220
220
  return {
221
221
  name: n,
222
222
  offset: L.utcOffset(/* @__PURE__ */ new Date())
223
223
  };
224
224
  }) : X;
225
225
  }
226
- function Y0(c) {
227
- k(c.zones), v(c.links), W0(c.countries), r.dataVersion = c.version;
226
+ function Y0(W) {
227
+ k(W.zones), v(W.links), W0(W.countries), U.dataVersion = W.version;
228
228
  }
229
- function $(c) {
230
- return $.didShowError || ($.didShowError = !0, D("moment.tz.zoneExists('" + c + "') has been deprecated in favor of !moment.tz.zone('" + c + "')")), !!m(c);
229
+ function $(W) {
230
+ return $.didShowError || ($.didShowError = !0, D("moment.tz.zoneExists('" + W + "') has been deprecated in favor of !moment.tz.zone('" + W + "')")), !!g(W);
231
231
  }
232
- function J(c) {
233
- var d = c._f === "X" || c._f === "x";
234
- return !!(c._a && c._tzm === void 0 && !d);
232
+ function J(W) {
233
+ var d = W._f === "X" || W._f === "x";
234
+ return !!(W._a && W._tzm === void 0 && !d);
235
235
  }
236
- function D(c) {
237
- typeof console < "u" && typeof console.error == "function" && console.error(c);
236
+ function D(W) {
237
+ typeof console < "u" && typeof console.error == "function" && console.error(W);
238
238
  }
239
- function r(c) {
239
+ function U(W) {
240
240
  var d = Array.prototype.slice.call(arguments, 0, -1), X = arguments[arguments.length - 1], n = M.utc.apply(null, d), L;
241
- return !M.isMoment(c) && J(n) && (L = m(X)) && n.add(L.parse(n), "minutes"), n.tz(X), n;
241
+ return !M.isMoment(W) && J(n) && (L = g(X)) && n.add(L.parse(n), "minutes"), n.tz(X), n;
242
242
  }
243
- r.version = z, r.dataVersion = "", r._zones = p, r._links = O, r._names = b, r._countries = A, r.add = k, r.link = v, r.load = Y0, r.zone = m, r.zoneExists = $, r.guess = O0, r.names = A0, r.Zone = G, r.unpack = P, r.unpackBase60 = e, r.needsOffset = J, r.moveInvalidForward = !0, r.moveAmbiguousForward = !1, r.countries = c0, r.zonesForCountry = o0;
244
- var C = M.fn;
245
- M.tz = r, M.defaultZone = null, M.updateOffset = function(c, d) {
243
+ U.version = z, U.dataVersion = "", U._zones = p, U._links = O, U._names = b, U._countries = A, U.add = k, U.link = v, U.load = Y0, U.zone = g, U.zoneExists = $, U.guess = O0, U.names = A0, U.Zone = G, U.unpack = P, U.unpackBase60 = e, U.needsOffset = J, U.moveInvalidForward = !0, U.moveAmbiguousForward = !1, U.countries = c0, U.zonesForCountry = o0;
244
+ var m = M.fn;
245
+ M.tz = U, M.defaultZone = null, M.updateOffset = function(W, d) {
246
246
  var X = M.defaultZone, n;
247
- if (c._z === void 0 && (X && J(c) && !c._isUTC && c.isValid() && (c._d = M.utc(c._a)._d, c.utc().add(X.parse(c), "minutes")), c._z = X), c._z)
248
- if (n = c._z.utcOffset(c), Math.abs(n) < 16 && (n = n / 60), c.utcOffset !== void 0) {
249
- var L = c._z;
250
- c.utcOffset(-n, d), c._z = L;
247
+ if (W._z === void 0 && (X && J(W) && !W._isUTC && W.isValid() && (W._d = M.utc(W._a)._d, W.utc().add(X.parse(W), "minutes")), W._z = X), W._z)
248
+ if (n = W._z.utcOffset(W), Math.abs(n) < 16 && (n = n / 60), W.utcOffset !== void 0) {
249
+ var L = W._z;
250
+ W.utcOffset(-n, d), W._z = L;
251
251
  } else
252
- c.zone(n, d);
253
- }, C.tz = function(c, d) {
254
- if (c) {
255
- if (typeof c != "string")
256
- throw new Error("Time zone name must be a string, got " + c + " [" + typeof c + "]");
257
- return this._z = m(c), this._z ? M.updateOffset(this, d) : D("Moment Timezone has no data for " + c + ". See http://momentjs.com/timezone/docs/#/data-loading/."), this;
252
+ W.zone(n, d);
253
+ }, m.tz = function(W, d) {
254
+ if (W) {
255
+ if (typeof W != "string")
256
+ throw new Error("Time zone name must be a string, got " + W + " [" + typeof W + "]");
257
+ return this._z = g(W), this._z ? M.updateOffset(this, d) : D("Moment Timezone has no data for " + W + ". See http://momentjs.com/timezone/docs/#/data-loading/."), this;
258
258
  }
259
259
  if (this._z)
260
260
  return this._z.name;
261
261
  };
262
- function y(c) {
262
+ function y(W) {
263
263
  return function() {
264
- return this._z ? this._z.abbr(this) : c.call(this);
264
+ return this._z ? this._z.abbr(this) : W.call(this);
265
265
  };
266
266
  }
267
- function w(c) {
267
+ function w(W) {
268
268
  return function() {
269
- return this._z = null, c.apply(this, arguments);
269
+ return this._z = null, W.apply(this, arguments);
270
270
  };
271
271
  }
272
- function d0(c) {
272
+ function d0(W) {
273
273
  return function() {
274
- return arguments.length > 0 && (this._z = null), c.apply(this, arguments);
274
+ return arguments.length > 0 && (this._z = null), W.apply(this, arguments);
275
275
  };
276
276
  }
277
- C.zoneName = y(C.zoneName), C.zoneAbbr = y(C.zoneAbbr), C.utc = w(C.utc), C.local = w(C.local), C.utcOffset = d0(C.utcOffset), M.tz.setDefault = function(c) {
278
- return (R < 2 || R === 2 && Y < 9) && D("Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js " + M.version + "."), M.defaultZone = c ? m(c) : null, M;
277
+ m.zoneName = y(m.zoneName), m.zoneAbbr = y(m.zoneAbbr), m.utc = w(m.utc), m.local = w(m.local), m.utcOffset = d0(m.utcOffset), M.tz.setDefault = function(W) {
278
+ return (R < 2 || R === 2 && Y < 9) && D("Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js " + M.version + "."), M.defaultZone = W ? g(W) : null, M;
279
279
  };
280
280
  var h = M.momentProperties;
281
281
  return Object.prototype.toString.call(h) === "[object Array]" ? (h.push("_z"), h.push("_a")) : h && (h._z = null), M;
@@ -1144,9 +1144,9 @@ var x = { exports: {} };
1144
1144
  throw new RangeError("invalid coordinates");
1145
1145
  if (90 <= z)
1146
1146
  return "Etc/GMT";
1147
- var b = -1, W = 48 * (180 + p) / 360.00000000000006, q = 24 * (90 - z) / 180.00000000000003, o = 0 | W, R = 0 | q, Y = 96 * R + 2 * o;
1147
+ var b = -1, c = 48 * (180 + p) / 360.00000000000006, q = 24 * (90 - z) / 180.00000000000003, o = 0 | c, R = 0 | q, Y = 96 * R + 2 * o;
1148
1148
  for (Y = 56 * O.charCodeAt(Y) + O.charCodeAt(Y + 1) - 1995; Y + A.length < 3136; )
1149
- Y = 56 * O.charCodeAt(Y = 8 * (b = b + Y + 1) + 4 * (R = 0 | (q = 2 * (q - R) % 2)) + 2 * (o = 0 | (W = 2 * (W - o) % 2)) + 2304) + O.charCodeAt(Y + 1) - 1995;
1149
+ Y = 56 * O.charCodeAt(Y = 8 * (b = b + Y + 1) + 4 * (R = 0 | (q = 2 * (q - R) % 2)) + 2 * (o = 0 | (c = 2 * (c - o) % 2)) + 2304) + O.charCodeAt(Y + 1) - 1995;
1150
1150
  return A[Y + A.length - 3136];
1151
1151
  }
1152
1152
  E.exports = M;
@@ -1160,7 +1160,7 @@ class a {
1160
1160
  * @param lat
1161
1161
  */
1162
1162
  static guessTimeZoneOffset(M, z) {
1163
- const p = B0(z, M), O = g().tz(p).utcOffset();
1163
+ const p = B0(z, M), O = C().tz(p).utcOffset();
1164
1164
  return this.roundPrecision(O / 60, 1);
1165
1165
  }
1166
1166
  /**
@@ -1176,9 +1176,9 @@ class a {
1176
1176
  z = z < 6 ? 6 : z, M = a.convertToStdLng(M, z);
1177
1177
  let O = "E";
1178
1178
  M < 0 && (O = "W"), M = Math.abs(M), p = p.toUpperCase();
1179
- let A = M * 3600, b, W, q, o, R, Y;
1180
- b = A % 3600 % 60, p.indexOf("S") !== -1 && (A = A - b, W = a.padNumber(b, 2, 2)), q = A / 60 % 60, p.indexOf("M") !== -1 && (p.indexOf("S") !== -1 ? o = a.roundPrecision(q, z).toString().padStart(2, "0") : o = a.padNumber(q, 2, 2), A = A - q * 60), R = A / 3600, p.indexOf("M") !== -1 ? Y = a.roundPrecision(R, z).toString().padStart(3, "0") : Y = a.padNumber(R, 3, 2), Number(W) >= 60 && (o = Number(o) + 1, W = 0), Number(o) >= 60 && (Y = Number(Y) + 1, o = 0);
1181
- const i = `${p.replace(/S+/gi, W).replace(/M+/gi, o).replace(/H+/gi, Y)}${O}`;
1179
+ let A = M * 3600, b, c, q, o, R, Y;
1180
+ b = A % 3600 % 60, p.indexOf("S") !== -1 && (A = A - b, c = a.padNumber(b, 2, 2)), q = A / 60 % 60, p.indexOf("M") !== -1 && (p.indexOf("S") !== -1 ? o = a.roundPrecision(q, z).toString().padStart(2, "0") : o = a.padNumber(q, 2, 2), A = A - q * 60), R = A / 3600, p.indexOf("M") !== -1 ? Y = a.roundPrecision(R, z).toString().padStart(3, "0") : Y = a.padNumber(R, 3, 2), Number(c) >= 60 && (o = Number(o) + 1, c = 0), Number(o) >= 60 && (Y = Number(Y) + 1, o = 0);
1181
+ const i = `${p.replace(/S+/gi, c).replace(/M+/gi, o).replace(/H+/gi, Y)}${O}`;
1182
1182
  return {
1183
1183
  direction: O,
1184
1184
  degree: a.roundPrecision(R, z),
@@ -1197,9 +1197,9 @@ class a {
1197
1197
  z = z < 6 ? 6 : z, M = M % 180;
1198
1198
  let O = "N";
1199
1199
  M < 0 && (O = "S"), M = Math.abs(M), p = p.toUpperCase();
1200
- let A = M * 3600, b, W, q, o, R, Y;
1201
- b = A % 3600 % 60, p.indexOf("S") !== -1 && (A = A - b, W = a.padNumber(b, 2, 2)), q = A / 60 % 60, p.indexOf("M") !== -1 && (p.indexOf("S") !== -1 ? o = a.roundPrecision(q, z).toString().padStart(2, "0") : o = a.padNumber(q, 2, 2), A = A - q * 60), R = A / 3600, p.indexOf("M") !== -1 ? Y = a.roundPrecision(R, z).toString().padStart(2, "0") : Y = a.padNumber(R, 2, 2), Number(W) >= 60 && (o = Number(o) + 1, W = 0), Number(o) >= 60 && (Y = Number(Y) + 1, o = 0);
1202
- const i = `${p.replace(/S+/gi, W).replace(/M+/gi, o).replace(/H+/gi, Y)}${O}`;
1200
+ let A = M * 3600, b, c, q, o, R, Y;
1201
+ b = A % 3600 % 60, p.indexOf("S") !== -1 && (A = A - b, c = a.padNumber(b, 2, 2)), q = A / 60 % 60, p.indexOf("M") !== -1 && (p.indexOf("S") !== -1 ? o = a.roundPrecision(q, z).toString().padStart(2, "0") : o = a.padNumber(q, 2, 2), A = A - q * 60), R = A / 3600, p.indexOf("M") !== -1 ? Y = a.roundPrecision(R, z).toString().padStart(2, "0") : Y = a.padNumber(R, 2, 2), Number(c) >= 60 && (o = Number(o) + 1, c = 0), Number(o) >= 60 && (Y = Number(Y) + 1, o = 0);
1202
+ const i = `${p.replace(/S+/gi, c).replace(/M+/gi, o).replace(/H+/gi, Y)}${O}`;
1203
1203
  return {
1204
1204
  direction: O,
1205
1205
  degree: a.roundPrecision(R, z),
@@ -1215,12 +1215,12 @@ class a {
1215
1215
  const O = M[M.length - 1].toUpperCase();
1216
1216
  M = M.substring(0, M.length - 1).trim();
1217
1217
  const A = M.split(" ").filter((q) => q !== "").map((q) => Number(q));
1218
- let [b, W] = A;
1219
- if (W = W > 60 ? W / Math.pow(10, String(W).length - 2) : W, b > 360 && !W) {
1218
+ let [b, c] = A;
1219
+ if (c = c > 60 ? c / Math.pow(10, String(c).length - 2) : c, b > 360 && !c) {
1220
1220
  const q = this.roundPrecision(b / 100, 0);
1221
- W = b - q * 100, b = q;
1221
+ c = b - q * 100, b = q;
1222
1222
  }
1223
- p = b + (W ?? 0) / 60, O === "W" && (p = p * -1);
1223
+ p = b + (c ?? 0) / 60, O === "W" && (p = p * -1);
1224
1224
  } else
1225
1225
  p = Number(M);
1226
1226
  return a.convertToStdLng(p, z);
@@ -1232,12 +1232,12 @@ class a {
1232
1232
  const O = M[M.length - 1].toUpperCase();
1233
1233
  M = M.substring(0, M.length - 1).trim();
1234
1234
  const A = M.split(" ").filter((q) => q !== "").map((q) => Number(q));
1235
- let [b, W] = A;
1236
- if (W = W > 60 ? W / Math.pow(10, String(W).length - 2) : W, b > 90 && !W) {
1235
+ let [b, c] = A;
1236
+ if (c = c > 60 ? c / Math.pow(10, String(c).length - 2) : c, b > 90 && !c) {
1237
1237
  const q = this.roundPrecision(b / 100, 0);
1238
- W = b - q * 100, b = q;
1238
+ c = b - q * 100, b = q;
1239
1239
  }
1240
- if (p = b + (W ?? 0) / 60, p > 90)
1240
+ if (p = b + (c ?? 0) / 60, p > 90)
1241
1241
  throw new Error(`latitude out of range: ${M}${O}`);
1242
1242
  O === "S" && (p = p * -1);
1243
1243
  } else
@@ -1310,7 +1310,7 @@ try {
1310
1310
  } catch {
1311
1311
  } finally {
1312
1312
  }
1313
- class u {
1313
+ class r {
1314
1314
  /**
1315
1315
  * 计算方位角
1316
1316
  * @param from 坐标 {lng, lat}
@@ -1342,8 +1342,8 @@ class u {
1342
1342
  [M.lng, M.lat],
1343
1343
  [z.lng, z.lat]
1344
1344
  ]);
1345
- let W;
1346
- return p ? W = T.rhumbDistance(b.features[0], b.features[1], { units: A }) : W = T.distance(b.features[0], b.features[1], { units: A }), a.roundPrecision(W, O);
1345
+ let c;
1346
+ return p ? c = T.rhumbDistance(b.features[0], b.features[1], { units: A }) : c = T.distance(b.features[0], b.features[1], { units: A }), a.roundPrecision(c, O);
1347
1347
  }
1348
1348
  /**
1349
1349
  * 计算航线距离
@@ -1354,10 +1354,10 @@ class u {
1354
1354
  static calculateRouteDistance(M, z = 4, p = "nauticalmiles") {
1355
1355
  let O = 0, A;
1356
1356
  for (const b of M)
1357
- for (let W = 0; W < b.length - 1; W++) {
1358
- const q = { lng: b[W][0], lat: b[W][1] };
1359
- W === 0 && A && (O += this.calculateDistance(A, q, !0, z, p));
1360
- const o = { lng: b[W + 1][0], lat: b[W + 1][1] };
1357
+ for (let c = 0; c < b.length - 1; c++) {
1358
+ const q = { lng: b[c][0], lat: b[c][1] };
1359
+ c === 0 && A && (O += this.calculateDistance(A, q, !0, z, p));
1360
+ const o = { lng: b[c + 1][0], lat: b[c + 1][1] };
1361
1361
  O += this.calculateDistance(q, o, !0, z, p), A = o;
1362
1362
  }
1363
1363
  return a.roundPrecision(O, z);
@@ -1372,9 +1372,9 @@ class u {
1372
1372
  */
1373
1373
  static calculateCoordinate(M, z, p, O = "nauticalmiles", A = !0) {
1374
1374
  const b = T.point([M.lng, M.lat]);
1375
- let W;
1376
- A ? W = T.rhumbDestination(b, p, z, { units: O }) : W = T.destination(b, p, z, { units: O });
1377
- const q = W.geometry.coordinates;
1375
+ let c;
1376
+ A ? c = T.rhumbDestination(b, p, z, { units: O }) : c = T.destination(b, p, z, { units: O });
1377
+ const q = c.geometry.coordinates;
1378
1378
  return { lng: a.convertToStdLng(q[0], 8), lat: a.roundPrecision(q[1], 8) };
1379
1379
  }
1380
1380
  /**
@@ -1387,12 +1387,12 @@ class u {
1387
1387
  * @param units 单位,默认 nm(海里)
1388
1388
  */
1389
1389
  static interpolateCoordinates(M, z, p, O = !0, A = !0, b = "nauticalmiles") {
1390
- const W = [], q = this.calculateBearing(M, z, !1), o = this.calculateDistance(M, z, !1, 8, b);
1391
- O && W.push({ lng: M.lng, lat: M.lat });
1390
+ const c = [], q = this.calculateBearing(M, z, !1), o = this.calculateDistance(M, z, !1, 8, b);
1391
+ O && c.push({ lng: M.lng, lat: M.lat });
1392
1392
  let R = 0;
1393
1393
  for (; R < o; )
1394
- R += p, R < o && W.push(this.calculateCoordinate(M, q, R, b, !1));
1395
- return A && W.push({ lng: z.lng, lat: z.lat }), W;
1394
+ R += p, R < o && c.push(this.calculateCoordinate(M, q, R, b, !1));
1395
+ return A && c.push({ lng: z.lng, lat: z.lat }), c;
1396
1396
  }
1397
1397
  /**
1398
1398
  * 分组坐标(如相邻两个坐标经度差超180度,需以180为界将坐标分为两组)
@@ -1412,13 +1412,13 @@ class u {
1412
1412
  let p = [];
1413
1413
  const O = [];
1414
1414
  let A, b;
1415
- for (let W = 0; W < M.length - 1; W++) {
1416
- A = a.convertToStdLng(M[W].lng, 8), b = a.convertToStdLng(M[W + 1].lng, 8), M[W].lat = a.roundPrecision(M[W].lat, 8), M[W + 1].lat = a.roundPrecision(M[W + 1].lat, 8), p.push([A, M[W].lat]);
1415
+ for (let c = 0; c < M.length - 1; c++) {
1416
+ A = a.convertToStdLng(M[c].lng, 8), b = a.convertToStdLng(M[c + 1].lng, 8), M[c].lat = a.roundPrecision(M[c].lat, 8), M[c + 1].lat = a.roundPrecision(M[c + 1].lat, 8), p.push([A, M[c].lat]);
1417
1417
  const q = A - b;
1418
1418
  if (Math.abs(q) > 180) {
1419
1419
  const o = a.convertToMonotonicLng2([
1420
- [A, M[W].lat],
1421
- [b, M[W + 1].lat]
1420
+ [A, M[c].lat],
1421
+ [b, M[c + 1].lat]
1422
1422
  ]);
1423
1423
  let R, Y;
1424
1424
  z ? (R = T.lineString(o), Y = T.lineString([
@@ -1428,13 +1428,13 @@ class u {
1428
1428
  const i = T.lineIntersect(R, Y);
1429
1429
  let e;
1430
1430
  if (i.features.length) {
1431
- const U = T.getCoord(i.features[0]);
1432
- e = a.roundPrecision(U[1], 8);
1431
+ const u = T.getCoord(i.features[0]);
1432
+ e = a.roundPrecision(u[1], 8);
1433
1433
  } else
1434
- e = M[W].lat;
1434
+ e = M[c].lat;
1435
1435
  q > 0 ? (p.push([180 - 1e-6, e]), O.push([...p]), p = [], p.push([-(180 - 1e-6), e])) : (p.push([-(180 - 1e-6), e]), O.push([...p]), p = [], p.push([180 - 1e-6, e]));
1436
1436
  }
1437
- W === M.length - 2 && p.push([b, M[W + 1].lat]);
1437
+ c === M.length - 2 && p.push([b, M[c + 1].lat]);
1438
1438
  }
1439
1439
  return O.push(p), O;
1440
1440
  }
@@ -1445,7 +1445,7 @@ class u {
1445
1445
  static deduplicateRoute(M) {
1446
1446
  const z = [];
1447
1447
  for (const p of M) {
1448
- const O = p.reduce((A, b) => (A.findIndex((W) => W[0] === b[0] && W[1] === b[1]) === -1 && A.push(b), A), []);
1448
+ const O = p.reduce((A, b) => (A.findIndex((c) => c[0] === b[0] && c[1] === b[1]) === -1 && A.push(b), A), []);
1449
1449
  z.push(O);
1450
1450
  }
1451
1451
  return z;
@@ -1493,13 +1493,13 @@ class u {
1493
1493
  */
1494
1494
  static mergeCoordinateToRoute(M, z) {
1495
1495
  M.lng = a.convertToStdLng(M.lng, 8);
1496
- let p = Number.MAX_VALUE, O = 0, A = 0, b, W;
1496
+ let p = Number.MAX_VALUE, O = 0, A = 0, b, c;
1497
1497
  return z.forEach((q, o) => {
1498
1498
  for (let R = 0; R < q.length - 1; R++) {
1499
1499
  const Y = { lng: q[R][0], lat: q[R][1] }, i = { lng: q[R + 1][0], lat: q[R + 1][1] }, e = this.calculatePointToLineDistance(M, Y, i);
1500
- p > e && (p = e, A = R, O = o, b = this.calculateDistance(Y, M), W = this.calculateDistance(i, M));
1500
+ p > e && (p = e, A = R, O = o, b = this.calculateDistance(Y, M), c = this.calculateDistance(i, M));
1501
1501
  }
1502
- }), b !== 0 && W !== 0 ? z[O].splice(A + 1, 0, [M.lng, M.lat]) : b === 0 ? z[O].splice(A, 1, [M.lng, M.lat]) : W === 0 && z[O].splice(A + 1, 1, [M.lng, M.lat]), z;
1502
+ }), b !== 0 && c !== 0 ? z[O].splice(A + 1, 0, [M.lng, M.lat]) : b === 0 ? z[O].splice(A, 1, [M.lng, M.lat]) : c === 0 && z[O].splice(A + 1, 1, [M.lng, M.lat]), z;
1503
1503
  }
1504
1504
  /**
1505
1505
  * 向Route尾加1个坐标
@@ -1508,8 +1508,8 @@ class u {
1508
1508
  */
1509
1509
  static appendCoordinateToRoute(M, z) {
1510
1510
  M.lng = a.convertToStdLng(M.lng, 8);
1511
- const p = u.convertRouteToCoordinates(z);
1512
- return p.push(M), u.divideAccordingToLng(p);
1511
+ const p = r.convertRouteToCoordinates(z);
1512
+ return p.push(M), r.divideAccordingToLng(p);
1513
1513
  }
1514
1514
  /**
1515
1515
  * 向route头加1个坐标
@@ -1517,8 +1517,8 @@ class u {
1517
1517
  * @param route
1518
1518
  */
1519
1519
  static unshiftCoordinateToRoute(M, z) {
1520
- const p = u.convertRouteToCoordinates(z);
1521
- return p.unshift(M), u.divideAccordingToLng(p);
1520
+ const p = r.convertRouteToCoordinates(z);
1521
+ return p.unshift(M), r.divideAccordingToLng(p);
1522
1522
  }
1523
1523
  /**
1524
1524
  * 合并多个waypoints进航线
@@ -1544,15 +1544,15 @@ class u {
1544
1544
  return p.forEach((b) => {
1545
1545
  if (A === 2)
1546
1546
  return;
1547
- const W = [];
1547
+ const c = [];
1548
1548
  for (const q of b) {
1549
1549
  if (a.roundPrecision(z.lng, 8) === a.roundPrecision(q[0], 8) && a.roundPrecision(z.lat, 8) === a.roundPrecision(q[1], 8)) {
1550
- W.push(q), A === 0 && W.push([M.lng, M.lat]), A = 2;
1550
+ c.push(q), A === 0 && c.push([M.lng, M.lat]), A = 2;
1551
1551
  break;
1552
1552
  }
1553
- A === 1 ? W.push(q) : a.roundPrecision(M.lng, 8) === a.roundPrecision(q[0], 8) && a.roundPrecision(M.lat, 8) === a.roundPrecision(q[1], 8) && (A = 1, W.push(q));
1553
+ A === 1 ? c.push(q) : a.roundPrecision(M.lng, 8) === a.roundPrecision(q[0], 8) && a.roundPrecision(M.lat, 8) === a.roundPrecision(q[1], 8) && (A = 1, c.push(q));
1554
1554
  }
1555
- W.length && O.push(W);
1555
+ c.length && O.push(c);
1556
1556
  }), O;
1557
1557
  }
1558
1558
  /**
@@ -1564,12 +1564,12 @@ class u {
1564
1564
  * @return [{lng, lat}]
1565
1565
  */
1566
1566
  static calculateRangeWaypoints(M, z, p, O = []) {
1567
- const A = this.convertRouteToCoordinates(p, 0), b = this.mergeCoordinatesToWaypoints([M, z, ...O], A), W = b.findIndex(
1567
+ const A = this.convertRouteToCoordinates(p, 0), b = this.mergeCoordinatesToWaypoints([M, z, ...O], A), c = b.findIndex(
1568
1568
  (R) => a.roundPrecision(M.lng, 8) === a.roundPrecision(R.lng, 8) && a.roundPrecision(M.lat, 8) === a.roundPrecision(R.lat, 8)
1569
1569
  ), q = b.findIndex(
1570
1570
  (R) => a.roundPrecision(z.lng, 8) === a.roundPrecision(R.lng, 8) && a.roundPrecision(z.lat, 8) === a.roundPrecision(R.lat, 8)
1571
1571
  );
1572
- return b.filter((R, Y) => Y >= W && Y <= q);
1572
+ return b.filter((R, Y) => Y >= c && Y <= q);
1573
1573
  }
1574
1574
  /**
1575
1575
  * 计算坐标到航路上的最短距离
@@ -1578,10 +1578,10 @@ class u {
1578
1578
  */
1579
1579
  static calculateMinDistanceToRoute(M, z) {
1580
1580
  let p = Number.MAX_VALUE, O = 0, A = 0;
1581
- return z.forEach((b, W) => {
1581
+ return z.forEach((b, c) => {
1582
1582
  for (let q = 0; q < b.length - 1; q++) {
1583
1583
  const o = { lng: b[q][0], lat: b[q][1] }, R = { lng: b[q + 1][0], lat: b[q + 1][1] }, Y = this.calculatePointToLineDistance(M, o, R);
1584
- p > Y && (p = Y, O = q, A = W);
1584
+ p > Y && (p = Y, O = q, A = c);
1585
1585
  }
1586
1586
  }), { minDist: p, segIndex: A, minIndex: O };
1587
1587
  }
@@ -1592,19 +1592,19 @@ class u {
1592
1592
  * @return [[[lng, lat]]]
1593
1593
  */
1594
1594
  static calculateSubRoute(M, z) {
1595
- const p = u.convertRouteToCoordinates(z);
1596
- u.mergeCoordinateToWaypoints(M, p, !0), z = u.divideAccordingToLng(p);
1595
+ const p = r.convertRouteToCoordinates(z);
1596
+ r.mergeCoordinateToWaypoints(M, p, !0), z = r.divideAccordingToLng(p);
1597
1597
  const { segIndex: O, minIndex: A } = this.calculateMinDistanceToRoute({ ...M }, z);
1598
1598
  M.lng = a.convertToStdLng(M.lng);
1599
1599
  const b = [];
1600
- let W = !0;
1600
+ let c = !0;
1601
1601
  for (let q = O; q < z.length; q++)
1602
- if (W) {
1602
+ if (c) {
1603
1603
  const o = [];
1604
1604
  o.push([M.lng, M.lat]);
1605
1605
  for (let R = A + 1; R < z[q].length; R++)
1606
1606
  M.lng === z[q][R][0] && M.lat === z[q][R][1] || o.push(z[q][R]);
1607
- b.push(o), W = !1;
1607
+ b.push(o), c = !1;
1608
1608
  } else
1609
1609
  b.push([...z[q]]);
1610
1610
  return b;
@@ -1618,12 +1618,12 @@ class u {
1618
1618
  static calculateSubWaypoints(M, z) {
1619
1619
  let p = Number.MAX_VALUE, O = 0;
1620
1620
  for (let b = 0; b < z.length - 1; b++) {
1621
- const W = z[b], q = z[b + 1];
1622
- if (this.calculateDistance(M, W) === 0)
1621
+ const c = z[b], q = z[b + 1];
1622
+ if (this.calculateDistance(M, c) === 0)
1623
1623
  return z;
1624
1624
  if (this.calculateDistance(M, q) === 0)
1625
1625
  return z.filter((R, Y) => Y > 0);
1626
- const o = this.calculatePointToLineDistance(M, W, q);
1626
+ const o = this.calculatePointToLineDistance(M, c, q);
1627
1627
  p > o && (p = o, O = b);
1628
1628
  }
1629
1629
  M.lng = a.convertToStdLng(M.lng);
@@ -1646,8 +1646,8 @@ class u {
1646
1646
  const b = T.lineString([
1647
1647
  [z.lng, z.lat],
1648
1648
  [p.lng, p.lat]
1649
- ]), W = T.pointToLineDistance(T.point([M.lng, M.lat]), b, O), q = T.pointToLineDistance(T.point([M.lng > 0 ? M.lng - 360 : M.lng + 360, M.lat]), b, O);
1650
- return a.roundPrecision(Math.min(W, q), 6);
1649
+ ]), c = T.pointToLineDistance(T.point([M.lng, M.lat]), b, O), q = T.pointToLineDistance(T.point([M.lng > 0 ? M.lng - 360 : M.lng + 360, M.lat]), b, O);
1650
+ return a.roundPrecision(Math.min(c, q), 6);
1651
1651
  }
1652
1652
  /**
1653
1653
  * 计算途经点的COG, Distance等属性
@@ -1686,15 +1686,15 @@ class u {
1686
1686
  */
1687
1687
  static mergeCoordinateToWaypoints(M, z, p = !0) {
1688
1688
  M.lng = a.convertToStdLng(M.lng, 8);
1689
- let O = Number.MAX_VALUE, A = 0, b = 0, W = 0;
1689
+ let O = Number.MAX_VALUE, A = 0, b = 0, c = 0;
1690
1690
  if (z.length < 2)
1691
1691
  z.push(M);
1692
1692
  else {
1693
1693
  for (let q = 0; q < z.length - 1; q++) {
1694
1694
  const o = { lng: z[q].lng, lat: z[q].lat }, R = { lng: z[q + 1].lng, lat: z[q + 1].lat }, Y = this.calculatePointToLineDistance(M, o, R);
1695
- O >= Y && (O = Y, A = q, b = this.calculateDistance(o, M, !1, 6), W = this.calculateDistance(R, M, !1, 6));
1695
+ O >= Y && (O = Y, A = q, b = this.calculateDistance(o, M, !1, 6), c = this.calculateDistance(R, M, !1, 6));
1696
1696
  }
1697
- b !== 0 && W !== 0 ? b < O || b === O && A === 0 ? z.unshift(M) : W < O || W === O && A === z.length - 2 ? z.push(M) : z.splice(A + 1, 0, M) : b === 0 ? p && z.splice(A, 1, M) : W === 0 && p && z.splice(A + 1, 1, M);
1697
+ b !== 0 && c !== 0 ? b < O || b === O && A === 0 ? z.unshift(M) : c < O || c === O && A === z.length - 2 ? z.push(M) : z.splice(A + 1, 0, M) : b === 0 ? p && z.splice(A, 1, M) : c === 0 && p && z.splice(A + 1, 1, M);
1698
1698
  }
1699
1699
  return z.map((q) => (q.lng = a.convertToStdLng(q.lng), q));
1700
1700
  }
@@ -1721,7 +1721,7 @@ class u {
1721
1721
  * @param route [[[lng, lat]]]
1722
1722
  */
1723
1723
  static nearestCoordinateInRoute(M, z) {
1724
- const p = T.point([M.lng, M.lat]), A = this.convertRouteToCoordinates(z).map((o) => [o.lng, o.lat]), b = T.lineString(A), W = T.nearestPointOnLine(b, p), q = T.getCoord(W);
1724
+ const p = T.point([M.lng, M.lat]), A = this.convertRouteToCoordinates(z).map((o) => [o.lng, o.lat]), b = T.lineString(A), c = T.nearestPointOnLine(b, p), q = T.getCoord(c);
1725
1725
  return { lng: a.roundPrecision(q[0], 8), lat: a.roundPrecision(q[1], 8) };
1726
1726
  }
1727
1727
  /**
@@ -1756,10 +1756,10 @@ class u {
1756
1756
  static calculateNextCoordinateAlongRoute(M, z, p, O = "nauticalmiles") {
1757
1757
  var i;
1758
1758
  const A = M.speed || 12, b = [];
1759
- let W = [], q = !1, o = 0, R = 0, Y;
1760
- if (z && p.length ? (b.push(M), p.forEach((e, U) => {
1759
+ let c = [], q = !1, o = 0, R = 0, Y;
1760
+ if (z && p.length ? (b.push(M), p.forEach((e, u) => {
1761
1761
  if (q)
1762
- W.push(e);
1762
+ c.push(e);
1763
1763
  else {
1764
1764
  const S = [];
1765
1765
  let s;
@@ -1781,15 +1781,15 @@ class u {
1781
1781
  q = !0;
1782
1782
  }
1783
1783
  }
1784
- S.length && W.push(S), U === p.length - 1 && !Y && (Y = s);
1784
+ S.length && c.push(S), u === p.length - 1 && !Y && (Y = s);
1785
1785
  }
1786
- })) : (W = p, Y = { ...M }), Y)
1787
- if (b.push(Y), Y.distanceFromPrevious = R, Y.hourFromPrevious = Math.round(R / A * 1e4) / 1e4, ((i = W[0]) == null ? void 0 : i.length) > 1) {
1788
- const e = { lng: W[0][1][0], lat: W[0][1][1] };
1786
+ })) : (c = p, Y = { ...M }), Y)
1787
+ if (b.push(Y), Y.distanceFromPrevious = R, Y.hourFromPrevious = Math.round(R / A * 1e4) / 1e4, ((i = c[0]) == null ? void 0 : i.length) > 1) {
1788
+ const e = { lng: c[0][1][0], lat: c[0][1][1] };
1789
1789
  Y.bearing = this.calculateBearing(Y, e);
1790
1790
  } else
1791
1791
  Y.bearing = 0;
1792
- return { coordinate: Y, nextRoute: W, prevRoute: b };
1792
+ return { coordinate: Y, nextRoute: c, prevRoute: b };
1793
1793
  }
1794
1794
  /**
1795
1795
  * 返回最近点及其是否为垂足(最近点不是起点或终点)
@@ -1798,11 +1798,11 @@ class u {
1798
1798
  * @param to {lng, lat}
1799
1799
  */
1800
1800
  static nearestCoordinateInLine(M, z, p) {
1801
- const O = a.convertToStdLng(M.lng, 6), A = T.point([O, M.lat]), b = a.convertToStdLng(z.lng, 6), W = a.convertToStdLng(p.lng, 6), q = T.lineString([
1801
+ const O = a.convertToStdLng(M.lng, 6), A = T.point([O, M.lat]), b = a.convertToStdLng(z.lng, 6), c = a.convertToStdLng(p.lng, 6), q = T.lineString([
1802
1802
  [b, z.lat],
1803
- [W, p.lat]
1803
+ [c, p.lat]
1804
1804
  ]), o = T.nearestPointOnLine(q, A), R = T.getCoord(o), Y = a.roundPrecision(R[0], 6), i = a.roundPrecision(R[1], 6);
1805
- return { lng: Y, lat: i, inline: !(Y === b && i === z.lat) && !(Y === W && i === p.lat) };
1805
+ return { lng: Y, lat: i, inline: !(Y === b && i === z.lat) && !(Y === c && i === p.lat) };
1806
1806
  }
1807
1807
  /**
1808
1808
  * 将route转coordinate
@@ -1813,8 +1813,8 @@ class u {
1813
1813
  const p = [];
1814
1814
  let O, A;
1815
1815
  return M.forEach((b) => {
1816
- b.forEach((W) => {
1817
- const q = { lng: a.roundPrecision(W[0], 8), lat: a.roundPrecision(W[1], 8) };
1816
+ b.forEach((c) => {
1817
+ const q = { lng: a.roundPrecision(c[0], 8), lat: a.roundPrecision(c[1], 8) };
1818
1818
  if (!A)
1819
1819
  p.push(q), A = q;
1820
1820
  else if (A.bearing === void 0)
@@ -1849,8 +1849,8 @@ class u {
1849
1849
  for (let O = 1; O < z.length; O++) {
1850
1850
  const A = z[O - 1], b = z[O];
1851
1851
  if (b.gcToPrevious) {
1852
- const W = M.findIndex((o) => o.lng === A.lng && o.lat === A.lat), q = M.findIndex((o) => o.lng === b.lng && o.lat === b.lat);
1853
- for (let o = q - 1; o > W; o--)
1852
+ const c = M.findIndex((o) => o.lng === A.lng && o.lat === A.lat), q = M.findIndex((o) => o.lng === b.lng && o.lat === b.lat);
1853
+ for (let o = q - 1; o > c; o--)
1854
1854
  M.splice(o, 1);
1855
1855
  }
1856
1856
  }
@@ -1867,12 +1867,12 @@ class u {
1867
1867
  */
1868
1868
  static calculateCenter(M) {
1869
1869
  const z = [];
1870
- for (const W of M)
1871
- for (const q of W)
1870
+ for (const c of M)
1871
+ for (const q of c)
1872
1872
  z.push(q);
1873
1873
  const p = T.featureCollection([]), O = a.convertToMonotonicLng2(z);
1874
- for (const W of O)
1875
- p.features.push(T.point(W));
1874
+ for (const c of O)
1875
+ p.features.push(T.point(c));
1876
1876
  const b = T.center(p).geometry.coordinates;
1877
1877
  return { lng: a.convertToStdLng(b[0], 8), lat: a.roundPrecision(b[1], 8) };
1878
1878
  }
@@ -1913,11 +1913,11 @@ class u {
1913
1913
  static simplifyCoordinates(M, z = 10, p = 160) {
1914
1914
  const O = [];
1915
1915
  for (let A = 1; A < M.length; A++) {
1916
- const b = M[A - 1], W = M[A], q = M[A + 1];
1916
+ const b = M[A - 1], c = M[A], q = M[A + 1];
1917
1917
  let o = !1, R = !1;
1918
- if ((b.velocity || b.suspend || b.important || b.pilot || A === 1) && (o = !0, O.push(b)), W.gcToPrevious && (o || (o = !0, O.push(b)), R = !0, O.push(W), A++), q) {
1919
- const Y = u.calculateDistance(b, W, !0), i = u.calculateDistance(W, q, !0), e = u.calculateDistance(b, q, !0), U = (Math.pow(Y, 2) + Math.pow(i, 2) - Math.pow(e, 2)) / (2 * Y * i);
1920
- Math.round(Math.acos(U) * 180 / Math.PI) < p && e > z && !R && (O.push(W), A++);
1918
+ if ((b.velocity || b.suspend || b.important || b.pilot || A === 1) && (o = !0, O.push(b)), c.gcToPrevious && (o || (o = !0, O.push(b)), R = !0, O.push(c), A++), q) {
1919
+ const Y = r.calculateDistance(b, c, !0), i = r.calculateDistance(c, q, !0), e = r.calculateDistance(b, q, !0), u = (Math.pow(Y, 2) + Math.pow(i, 2) - Math.pow(e, 2)) / (2 * Y * i);
1920
+ Math.round(Math.acos(u) * 180 / Math.PI) < p && e > z && !R && (O.push(c), A++);
1921
1921
  }
1922
1922
  if (A >= M.length - 1) {
1923
1923
  const Y = M.at(-1);
@@ -1933,10 +1933,30 @@ class u {
1933
1933
  * @param waypoints 带时间的轨迹, 单位秒
1934
1934
  */
1935
1935
  static nearestTSPointInWaypoints(M, z, p) {
1936
- const O = g.unix(M), A = p.filter(
1936
+ const O = C.unix(M), A = p.filter(
1937
1937
  (b) => O.clone().subtract(z, "hour").unix() <= (b.positionTime || 0) && O.clone().add(z, "h").unix() >= (b.positionTime || 0)
1938
1938
  );
1939
- return A.sort((b, W) => (b.positionTime || 0) - (W.positionTime || 0)), A.at(-1);
1939
+ return A.sort((b, c) => (b.positionTime || 0) - (c.positionTime || 0)), A.at(-1);
1940
+ }
1941
+ /**
1942
+ * 推测船位
1943
+ * @param ts 目标时间的船位,单位 s
1944
+ * @param positions 带时间(positionTime)的轨迹
1945
+ */
1946
+ static deadReckoning(M, z) {
1947
+ var A, b;
1948
+ M > 1e12 && (M = Math.round(M / 1e3));
1949
+ const p = C.unix(M);
1950
+ let O = z.find((c) => c.positionTime === p.unix());
1951
+ if (!O) {
1952
+ const c = (b = (A = z.filter((o) => (o == null ? void 0 : o.positionTime) < p.unix())) == null ? void 0 : A.sort((o, R) => (o.positionTime || 0) - (R.positionTime || 0))) == null ? void 0 : b.at(-1), q = z.find((o) => (o == null ? void 0 : o.positionTime) > p.unix());
1953
+ if (c && q) {
1954
+ const o = r.calculateBearing(c, q, !0), R = r.calculateDistance(c, q), Y = (p.unix() - c.positionTime) / (q.positionTime - c.positionTime);
1955
+ O = r.calculateCoordinate(c, o, R * Y), O.positionTime = p.unix(), O.utc = p.format(), O.cog = o, O.sog = Math.round(R / ((q.positionTime - c.positionTime) / 3600) * 100) / 100;
1956
+ } else
1957
+ O = c || q, O && (O.utc = C.unix(O == null ? void 0 : O.positionTime).utc().format());
1958
+ }
1959
+ return O;
1940
1960
  }
1941
1961
  /**
1942
1962
  * 翻转轨迹
@@ -1971,9 +1991,9 @@ class V0 {
1971
1991
  const A = (p = O.history) == null ? void 0 : p[0];
1972
1992
  A && A.wind && (A.wind.spd = A.spd, A.wind.kts = A.kts);
1973
1993
  for (const b of O.forecasts) {
1974
- const W = [], q = g(b.date).utc(), o = `${O.name}-${b.model}`;
1994
+ const c = [], q = C(b.date).utc(), o = `${O.name}-${b.model}`;
1975
1995
  if (A) {
1976
- const R = g(A.updated).utc(), Y = T.point([A.lng, A.lat], {
1996
+ const R = C(A.updated).utc(), Y = T.point([A.lng, A.lat], {
1977
1997
  model: b.model,
1978
1998
  name: O.name,
1979
1999
  date: R.format(),
@@ -1984,7 +2004,7 @@ class V0 {
1984
2004
  category: o,
1985
2005
  type: "forecast"
1986
2006
  });
1987
- z.features.push(Y), W.push(Y.geometry.coordinates);
2007
+ z.features.push(Y), c.push(Y.geometry.coordinates);
1988
2008
  }
1989
2009
  for (const R in b == null ? void 0 : b.hours) {
1990
2010
  const Y = b.hours[R];
@@ -2002,10 +2022,10 @@ class V0 {
2002
2022
  category: o,
2003
2023
  type: "forecast"
2004
2024
  });
2005
- z.features.push(e), W.push(e.geometry.coordinates);
2025
+ z.features.push(e), c.push(e.geometry.coordinates);
2006
2026
  }
2007
- if ((W == null ? void 0 : W.length) > 1) {
2008
- const R = T.lineString(a.convertToMonotonicLng2(W), {
2027
+ if ((c == null ? void 0 : c.length) > 1) {
2028
+ const R = T.lineString(a.convertToMonotonicLng2(c), {
2009
2029
  date: b.date,
2010
2030
  id: O.id || O.name,
2011
2031
  model: b.model,
@@ -2019,25 +2039,25 @@ class V0 {
2019
2039
  }
2020
2040
  if (O.history) {
2021
2041
  const A = [];
2022
- for (const W of O.history) {
2023
- const q = g(W.updated).utc(), o = T.point([W.lng, W.lat], {
2042
+ for (const c of O.history) {
2043
+ const q = C(c.updated).utc(), o = T.point([c.lng, c.lat], {
2024
2044
  name: O.name,
2025
2045
  date: q.format(),
2026
2046
  format: q.format("MMM-DD/HHmm[Z]"),
2027
- pressure: W.pressure > 1e4 ? a.roundPrecision(W.pressure / 100, 0) : a.roundPrecision(W.pressure, 0),
2028
- spd: W.speed || W.spd,
2029
- kts: W.kts,
2030
- source: W.source,
2031
- level: W.type,
2047
+ pressure: c.pressure > 1e4 ? a.roundPrecision(c.pressure / 100, 0) : a.roundPrecision(c.pressure, 0),
2048
+ spd: c.speed || c.spd,
2049
+ kts: c.kts,
2050
+ source: c.source,
2051
+ level: c.type,
2032
2052
  type: "history",
2033
2053
  category: `${O.name}-history`,
2034
- wind: W.wind
2054
+ wind: c.wind
2035
2055
  });
2036
2056
  z.features.push(o), A.push(o.geometry.coordinates);
2037
2057
  }
2038
2058
  const b = O.history[0];
2039
2059
  if (A.length === 1 && A.push(A[0]), A.length > 1) {
2040
- const W = T.lineString(a.convertToMonotonicLng2(A), {
2060
+ const c = T.lineString(a.convertToMonotonicLng2(A), {
2041
2061
  name: O.name,
2042
2062
  type: "history",
2043
2063
  updated: b == null ? void 0 : b.updated,
@@ -2047,7 +2067,7 @@ class V0 {
2047
2067
  source: b == null ? void 0 : b.source,
2048
2068
  level: b == null ? void 0 : b.type
2049
2069
  });
2050
- z.features.push(W);
2070
+ z.features.push(c);
2051
2071
  }
2052
2072
  }
2053
2073
  }
@@ -2059,18 +2079,18 @@ class V0 {
2059
2079
  * @param step
2060
2080
  */
2061
2081
  static interpolate(M, z = 3) {
2062
- var A, b, W, q;
2082
+ var A, b, c, q;
2063
2083
  const p = (A = M == null ? void 0 : M.data) == null ? void 0 : A.features.filter((o) => o.geometry.type === "LineString" && o.properties.type === "forecast"), O = [];
2064
2084
  for (const o of p) {
2065
- const R = o.properties.name, Y = o.properties.model, i = o.properties.showCircle, e = o.properties.disabled, U = g(o.properties.date).utc();
2066
- let S = z * 60 - (U.get("hour") * 60 + U.get("minute")) % (z * 60);
2085
+ const R = o.properties.name, Y = o.properties.model, i = o.properties.showCircle, e = o.properties.disabled, u = C(o.properties.date).utc();
2086
+ let S = z * 60 - (u.get("hour") * 60 + u.get("minute")) % (z * 60);
2067
2087
  const s = (b = M == null ? void 0 : M.data) == null ? void 0 : b.features.filter(
2068
2088
  (l) => l.geometry.type === "Point" && l.properties.type === "forecast" && l.properties.category === `${R}-${Y}`
2069
2089
  );
2070
- let P, G = U.clone().add(S, "minute").set({ minute: 0, second: 0, millisecond: 0 });
2090
+ let P, G = u.clone().add(S, "minute").set({ minute: 0, second: 0, millisecond: 0 });
2071
2091
  for (; P = this.pickIndex(s, G), P <= s.length - 1; ) {
2072
2092
  if (P > 0) {
2073
- const l = s[P], N = P === 0 ? void 0 : s[P - 1], I = (S / 60 - ((W = N == null ? void 0 : N.properties) == null ? void 0 : W.hour)) / (l.properties.hour - ((q = N == null ? void 0 : N.properties) == null ? void 0 : q.hour)), H = this.computeNumber(N == null ? void 0 : N.geometry.coordinates[0], l.geometry.coordinates[0], I), Q = this.computeNumber(N == null ? void 0 : N.geometry.coordinates[1], l.geometry.coordinates[1], I), F = T.point([H, Q], {
2093
+ const l = s[P], N = P === 0 ? void 0 : s[P - 1], I = (S / 60 - ((c = N == null ? void 0 : N.properties) == null ? void 0 : c.hour)) / (l.properties.hour - ((q = N == null ? void 0 : N.properties) == null ? void 0 : q.hour)), H = this.computeNumber(N == null ? void 0 : N.geometry.coordinates[0], l.geometry.coordinates[0], I), Q = this.computeNumber(N == null ? void 0 : N.geometry.coordinates[1], l.geometry.coordinates[1], I), F = T.point([H, Q], {
2074
2094
  name: R,
2075
2095
  model: Y,
2076
2096
  category: l == null ? void 0 : l.properties.category,
@@ -2087,7 +2107,7 @@ class V0 {
2087
2107
  });
2088
2108
  O.push(F);
2089
2109
  }
2090
- S += z * 60, G = U.clone().add(S, "minute").set({ minute: 0, second: 0, millisecond: 0 });
2110
+ S += z * 60, G = u.clone().add(S, "minute").set({ minute: 0, second: 0, millisecond: 0 });
2091
2111
  }
2092
2112
  }
2093
2113
  return O;
@@ -2114,22 +2134,22 @@ class V0 {
2114
2134
  * @param options
2115
2135
  */
2116
2136
  static diversionPassageAt(M, z, p, O = {}) {
2117
- const { t1: A, t2: b, hr: W, hours: q } = this.tropicalCenterTwin(z, 24, O);
2137
+ const { t1: A, t2: b, hr: c, hours: q } = this.tropicalCenterTwin(z, 24, O);
2118
2138
  if (A && b) {
2119
2139
  if (!O.debug) {
2120
- const U = u.calculateDistance(M, A), S = u.calculateDistance(M, b);
2121
- if (U > 2 * p && S > 2 * p)
2122
- return Z == null || Z.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need diversion: %j", O.requestId, U, S, {
2140
+ const u = r.calculateDistance(M, A), S = r.calculateDistance(M, b);
2141
+ if (u > 2 * p && S > 2 * p)
2142
+ return Z == null || Z.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need diversion: %j", O.requestId, u, S, {
2123
2143
  from: M,
2124
2144
  t1: A,
2125
2145
  t2: b,
2126
- hr: W
2146
+ hr: c
2127
2147
  }), {};
2128
2148
  }
2129
- const o = u.calculateBearing(M, A), R = u.calculateBearing(A, b), Y = Math.abs(o - R);
2149
+ const o = r.calculateBearing(M, A), R = r.calculateBearing(A, b), Y = Math.abs(o - R);
2130
2150
  let i = 0;
2131
2151
  Y < 180 ? i = Y + 90 : Y >= 180 && (i = Y - 90);
2132
- const e = u.calculateCoordinate(A, i, p);
2152
+ const e = r.calculateCoordinate(A, i, p);
2133
2153
  return Z == null || Z.info("[%s] the right tangent position: %j", O.requestId, {
2134
2154
  from: M,
2135
2155
  t1: A,
@@ -2138,7 +2158,7 @@ class V0 {
2138
2158
  bearing1: o,
2139
2159
  bearing2: R,
2140
2160
  right: e
2141
- }), { at: e, t1: A, t2: b, hr: Number(W), hours: q };
2161
+ }), { at: e, t1: A, t2: b, hr: Number(c), hours: q };
2142
2162
  }
2143
2163
  return {};
2144
2164
  }
@@ -2153,22 +2173,22 @@ class V0 {
2153
2173
  * @param options
2154
2174
  */
2155
2175
  static driftPassageAt(M, z, p, O = {}) {
2156
- const { t1: A, t2: b, hr: W, hours: q } = this.tropicalCenterTwin(z, 24, O);
2176
+ const { t1: A, t2: b, hr: c, hours: q } = this.tropicalCenterTwin(z, 24, O);
2157
2177
  if (A && b) {
2158
2178
  if (!O.debug) {
2159
- const e = u.calculateDistance(M, A), U = u.calculateDistance(M, b);
2160
- if (e > 2 * p && U > 2 * p)
2161
- return Z == null || Z.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need drifting: %j", O.requestId, e, U, {
2179
+ const e = r.calculateDistance(M, A), u = r.calculateDistance(M, b);
2180
+ if (e > 2 * p && u > 2 * p)
2181
+ return Z == null || Z.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need drifting: %j", O.requestId, e, u, {
2162
2182
  from: M,
2163
2183
  t1: A,
2164
2184
  t2: b,
2165
- hr: W
2185
+ hr: c
2166
2186
  }), {};
2167
2187
  }
2168
- const o = u.calculateBearing(M, A), R = u.calculateBearing(A, b), Y = u.calculateDistance(M, A);
2169
- return { at: u.calculateCoordinate(A, o - R + 180, p < Y ? p : Y), t1: A, t2: b, hr: Number(W), hours: q };
2188
+ const o = r.calculateBearing(M, A), R = r.calculateBearing(A, b), Y = r.calculateDistance(M, A);
2189
+ return { at: r.calculateCoordinate(A, o - R + 180, p < Y ? p : Y), t1: A, t2: b, hr: Number(c), hours: q };
2170
2190
  } else
2171
- return Z == null || Z.info("[%s] no need drift: %j", O.requestId, { from: M, t1: A, t2: b, hr: W }), {};
2191
+ return Z == null || Z.info("[%s] no need drift: %j", O.requestId, { from: M, t1: A, t2: b, hr: c }), {};
2172
2192
  }
2173
2193
  /**
2174
2194
  * 获取台风中心点对
@@ -2179,7 +2199,7 @@ class V0 {
2179
2199
  * @private
2180
2200
  */
2181
2201
  static tropicalCenterTwin(M, z = 24, p = {}) {
2182
- var R, Y, i, e, U;
2202
+ var R, Y, i, e, u;
2183
2203
  let O = {};
2184
2204
  (R = M.forecasts) == null || R.forEach((S) => {
2185
2205
  O = { ...S.hours, ...O };
@@ -2187,18 +2207,18 @@ class V0 {
2187
2207
  const A = ((Y = M == null ? void 0 : M.history) == null ? void 0 : Y[0]) || (O == null ? void 0 : O[(i = Object.keys(O)) == null ? void 0 : i[0]]);
2188
2208
  Z == null || Z.info("[%s] the first tropical center: %j", p.requestId, A);
2189
2209
  let b = (e = Object.keys(O || {}).filter((S) => Number(S) <= (z < 0 ? 24 : z))) == null ? void 0 : e.at(-1);
2190
- b || (b = (U = Object.keys(O || {}).filter((S) => Number(S) <= (z < 0 ? 24 : 2 * z))) == null ? void 0 : U.at(-1));
2191
- const W = O == null ? void 0 : O[b || -1];
2192
- Z == null || Z.info("[%s] the second tropical center: %j in %d hrs", p.requestId, W, b);
2210
+ b || (b = (u = Object.keys(O || {}).filter((S) => Number(S) <= (z < 0 ? 24 : 2 * z))) == null ? void 0 : u.at(-1));
2211
+ const c = O == null ? void 0 : O[b || -1];
2212
+ Z == null || Z.info("[%s] the second tropical center: %j in %d hrs", p.requestId, c, b);
2193
2213
  const q = Object.keys(O || {}).filter((S) => Number(S) <= Number(b)), o = { 0: A };
2194
2214
  for (const S of q)
2195
2215
  o[S] = O[S];
2196
- return { t1: A, t2: W, hr: Number(b), hours: o };
2216
+ return { t1: A, t2: c, hr: Number(b), hours: o };
2197
2217
  }
2198
2218
  static pickIndex(M, z) {
2199
2219
  let p = 0;
2200
2220
  for (const O of M) {
2201
- if (g(O.properties.date).isAfter(z))
2221
+ if (C(O.properties.date).isAfter(z))
2202
2222
  return p === 0 ? -1 : p;
2203
2223
  p++;
2204
2224
  }
@@ -2226,14 +2246,14 @@ class t0 {
2226
2246
  return `${M.lat}|${M.lng}|${M.positionTime}|${M.sog}|${M.cog}|${M.hdg}|${M.draught}|${z}|${JSON.stringify(M.meteo || {})}|${M.vendor}|${M.deleted}`;
2227
2247
  }
2228
2248
  static str2Json(M) {
2229
- const [z, p, O, A, b, W, q, o, R, Y, i] = M.split("|");
2249
+ const [z, p, O, A, b, c, q, o, R, Y, i] = M.split("|");
2230
2250
  return {
2231
2251
  lat: Number(z),
2232
2252
  lng: Number(p),
2233
2253
  positionTime: Number(O),
2234
2254
  sog: Number(A),
2235
2255
  cog: Number(b),
2236
- hdg: Number(W),
2256
+ hdg: Number(c),
2237
2257
  //@ts-ignore
2238
2258
  draught: isNaN(q) ? null : Number(q),
2239
2259
  type: o,
@@ -2249,7 +2269,7 @@ class t0 {
2249
2269
  for (let A = 0; A < M.length - 1; A++) {
2250
2270
  const b = M[A];
2251
2271
  if (b.sog = b.sog || 0, b.sog < z) {
2252
- const W = b;
2272
+ const c = b;
2253
2273
  let q = M.at(-1);
2254
2274
  for (let o = A + 1; o < M.length; o++) {
2255
2275
  const R = M[o];
@@ -2261,24 +2281,24 @@ class t0 {
2261
2281
  break;
2262
2282
  }
2263
2283
  }
2264
- if (q.positionTime != W.positionTime) {
2284
+ if (q.positionTime != c.positionTime) {
2265
2285
  const o = {
2266
2286
  start: {
2267
- lat: W.lat,
2268
- lng: W.lng,
2269
- sog: W.sog,
2270
- positionTime: W.positionTime,
2271
- utc: g.unix(W.positionTime).utc().format()
2287
+ lat: c.lat,
2288
+ lng: c.lng,
2289
+ sog: c.sog,
2290
+ positionTime: c.positionTime,
2291
+ utc: C.unix(c.positionTime).utc().format()
2272
2292
  },
2273
2293
  end: {
2274
2294
  lat: q.lat,
2275
2295
  lng: q.lng,
2276
2296
  sog: q.sog,
2277
2297
  positionTime: q.positionTime,
2278
- utc: g.unix(q.positionTime).utc().format()
2298
+ utc: C.unix(q.positionTime).utc().format()
2279
2299
  },
2280
- duration: q.positionTime - W.positionTime,
2281
- distance: u.calculateDistance(W, q, !0, 4),
2300
+ duration: q.positionTime - c.positionTime,
2301
+ distance: r.calculateDistance(c, q, !0, 4),
2282
2302
  avgSog: 0
2283
2303
  };
2284
2304
  o.avgSog = Math.round(o.distance / (o.duration / 3600) * 100) / 100, O.push(o);
@@ -2290,7 +2310,7 @@ class t0 {
2290
2310
  }
2291
2311
  export {
2292
2312
  t0 as AisHelper,
2293
- u as LaneHelper,
2313
+ r as LaneHelper,
2294
2314
  a as LngLatHelper,
2295
2315
  V0 as TropicalHelper
2296
2316
  };