@idm-plugin/geo 1.8.2 → 1.8.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
- import * as S from "@turf/turf";
2
- import E from "moment";
1
+ import * as f from "@turf/turf";
2
+ import s from "moment";
3
3
  import _ from "@log4js-node/log4js-api";
4
4
  var a0 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
5
  function X0(I) {
@@ -13,41 +13,41 @@ var j = { exports: {} };
13
13
  //! license : MIT
14
14
  //! github.com/moment/moment-timezone
15
15
  (function(M, z) {
16
- I.exports ? I.exports = z(E) : z(M.moment);
16
+ I.exports ? I.exports = z(s) : z(M.moment);
17
17
  })(a0, function(M) {
18
18
  M.version === void 0 && M.default && (M = M.default);
19
- var z = "0.5.48", b = {}, O = {}, c = {}, p = {}, A = {}, o;
19
+ var z = "0.5.48", b = {}, O = {}, c = {}, p = {}, A = {}, W;
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 q = M.version.split("."), Y = +q[0], d = +q[1];
22
22
  (Y < 2 || Y === 2 && d < 6) && D("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js " + M.version + ". See momentjs.com");
23
- function L(W) {
24
- return W > 96 ? W - 87 : W > 64 ? W - 29 : W - 48;
23
+ function L(o) {
24
+ return o > 96 ? o - 87 : o > 64 ? o - 29 : o - 48;
25
25
  }
26
- function T(W) {
27
- var a = 0, n = W.split("."), R = n[0], e = n[1] || "", r = 1, l, U = 0, V = 1;
28
- for (W.charCodeAt(0) === 45 && (a = 1, V = -1), a; a < R.length; a++)
29
- l = L(R.charCodeAt(a)), U = 60 * U + l;
26
+ function T(o) {
27
+ var a = 0, n = o.split("."), R = n[0], e = n[1] || "", r = 1, Z, U = 0, V = 1;
28
+ for (o.charCodeAt(0) === 45 && (a = 1, V = -1), a; a < R.length; a++)
29
+ Z = L(R.charCodeAt(a)), U = 60 * U + Z;
30
30
  for (a = 0; a < e.length; a++)
31
- r = r / 60, l = L(e.charCodeAt(a)), U += l * r;
31
+ r = r / 60, Z = L(e.charCodeAt(a)), U += Z * r;
32
32
  return U * V;
33
33
  }
34
- function N(W) {
35
- for (var a = 0; a < W.length; a++)
36
- W[a] = T(W[a]);
34
+ function N(o) {
35
+ for (var a = 0; a < o.length; a++)
36
+ o[a] = T(o[a]);
37
37
  }
38
- function i(W, a) {
38
+ function i(o, a) {
39
39
  for (var n = 0; n < a; n++)
40
- W[n] = Math.round((W[n - 1] || 0) + W[n] * 6e4);
41
- W[a - 1] = 1 / 0;
40
+ o[n] = Math.round((o[n - 1] || 0) + o[n] * 6e4);
41
+ o[a - 1] = 1 / 0;
42
42
  }
43
- function t(W, a) {
43
+ function t(o, a) {
44
44
  var n = [], R;
45
45
  for (R = 0; R < a.length; R++)
46
- n[R] = W[a[R]];
46
+ n[R] = o[a[R]];
47
47
  return n;
48
48
  }
49
- function s(W) {
50
- var a = W.split("|"), n = a[2].split(" "), R = a[3].split(""), e = a[4].split(" ");
49
+ function l(o) {
50
+ var a = o.split("|"), n = a[2].split(" "), R = a[3].split(""), e = a[4].split(" ");
51
51
  return N(n), N(R), N(e), i(e, R.length), {
52
52
  name: a[0],
53
53
  abbrs: t(a[1].split(" "), R),
@@ -56,94 +56,94 @@ var j = { exports: {} };
56
56
  population: a[5] | 0
57
57
  };
58
58
  }
59
- function G(W) {
60
- W && this._set(s(W));
59
+ function G(o) {
60
+ o && this._set(l(o));
61
61
  }
62
- function Z(W, a) {
62
+ function P(o, a) {
63
63
  var n = a.length;
64
- if (W < a[0])
64
+ if (o < a[0])
65
65
  return 0;
66
- if (n > 1 && a[n - 1] === 1 / 0 && W >= a[n - 2])
66
+ if (n > 1 && a[n - 1] === 1 / 0 && o >= a[n - 2])
67
67
  return n - 1;
68
- if (W >= a[n - 1])
68
+ if (o >= a[n - 1])
69
69
  return -1;
70
70
  for (var R, e = 0, r = n - 1; r - e > 1; )
71
- R = Math.floor((e + r) / 2), a[R] <= W ? e = R : r = R;
71
+ R = Math.floor((e + r) / 2), a[R] <= o ? e = R : r = R;
72
72
  return r;
73
73
  }
74
74
  G.prototype = {
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;
75
+ _set: function(o) {
76
+ this.name = o.name, this.abbrs = o.abbrs, this.untils = o.untils, this.offsets = o.offsets, this.population = o.population;
77
77
  },
78
- _index: function(W) {
79
- var a = +W, n = this.untils, R;
80
- if (R = Z(a, n), R >= 0)
78
+ _index: function(o) {
79
+ var a = +o, n = this.untils, R;
80
+ if (R = P(a, n), R >= 0)
81
81
  return R;
82
82
  },
83
83
  countries: function() {
84
- var W = this.name;
84
+ var o = this.name;
85
85
  return Object.keys(c).filter(function(a) {
86
- return c[a].zones.indexOf(W) !== -1;
86
+ return c[a].zones.indexOf(o) !== -1;
87
87
  });
88
88
  },
89
- parse: function(W) {
90
- var a = +W, n = this.offsets, R = this.untils, e = R.length - 1, r, l, U, V;
89
+ parse: function(o) {
90
+ var a = +o, n = this.offsets, R = this.untils, e = R.length - 1, r, Z, U, V;
91
91
  for (V = 0; V < e; V++)
92
- if (r = n[V], l = n[V + 1], U = n[V && V - 1], r < l && u.moveAmbiguousForward ? r = l : r > U && u.moveInvalidForward && (r = U), a < R[V] - r * 6e4)
92
+ if (r = n[V], Z = n[V + 1], U = n[V && V - 1], r < Z && u.moveAmbiguousForward ? r = Z : r > U && u.moveInvalidForward && (r = U), a < R[V] - r * 6e4)
93
93
  return n[V];
94
94
  return n[e];
95
95
  },
96
- abbr: function(W) {
97
- return this.abbrs[this._index(W)];
96
+ abbr: function(o) {
97
+ return this.abbrs[this._index(o)];
98
98
  },
99
- offset: function(W) {
100
- return D("zone.offset has been deprecated in favor of zone.utcOffset"), this.offsets[this._index(W)];
99
+ offset: function(o) {
100
+ return D("zone.offset has been deprecated in favor of zone.utcOffset"), this.offsets[this._index(o)];
101
101
  },
102
- utcOffset: function(W) {
103
- return this.offsets[this._index(W)];
102
+ utcOffset: function(o) {
103
+ return this.offsets[this._index(o)];
104
104
  }
105
105
  };
106
- function B(W, a) {
107
- this.name = W, this.zones = a;
106
+ function B(o, a) {
107
+ this.name = o, this.zones = a;
108
108
  }
109
- function m(W) {
110
- var a = W.toTimeString(), n = a.match(/\([a-z ]+\)/i);
111
- 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 = +W, this.abbr = n, this.offset = W.getTimezoneOffset();
109
+ function m(o) {
110
+ var a = o.toTimeString(), n = a.match(/\([a-z ]+\)/i);
111
+ 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();
112
112
  }
113
- function H(W) {
114
- this.zone = W, this.offsetScore = 0, this.abbrScore = 0;
113
+ function H(o) {
114
+ this.zone = o, this.offsetScore = 0, this.abbrScore = 0;
115
115
  }
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++;
116
+ H.prototype.scoreOffsetAt = function(o) {
117
+ this.offsetScore += Math.abs(this.zone.utcOffset(o.at) - o.offset), this.zone.abbr(o.at).replace(/[^A-Z]/g, "") !== o.abbr && this.abbrScore++;
118
118
  };
119
- function Q(W, a) {
120
- for (var n, R; R = ((a.at - W.at) / 12e4 | 0) * 6e4; )
121
- n = new m(new Date(W.at + R)), n.offset === W.offset ? W = n : a = n;
122
- return W;
119
+ function Q(o, a) {
120
+ for (var n, R; R = ((a.at - o.at) / 12e4 | 0) * 6e4; )
121
+ n = new m(new Date(o.at + R)), n.offset === o.offset ? o = n : a = n;
122
+ return o;
123
123
  }
124
124
  function F() {
125
- var W = (/* @__PURE__ */ new Date()).getFullYear() - 2, a = new m(new Date(W, 0, 1)), n = a.offset, R = [a], e, r, l, U;
125
+ var o = (/* @__PURE__ */ new Date()).getFullYear() - 2, a = new m(new Date(o, 0, 1)), n = a.offset, R = [a], e, r, Z, U;
126
126
  for (U = 1; U < 48; U++)
127
- l = new Date(W, U, 1).getTimezoneOffset(), l !== n && (r = new m(new Date(W, U, 1)), e = Q(a, r), R.push(e), R.push(new m(new Date(e.at + 6e4))), a = r, n = l);
127
+ Z = new Date(o, U, 1).getTimezoneOffset(), Z !== n && (r = new m(new Date(o, U, 1)), e = Q(a, r), R.push(e), R.push(new m(new Date(e.at + 6e4))), a = r, n = Z);
128
128
  for (U = 0; U < 4; U++)
129
- R.push(new m(new Date(W + U, 0, 1))), R.push(new m(new Date(W + U, 6, 1)));
129
+ R.push(new m(new Date(o + U, 0, 1))), R.push(new m(new Date(o + U, 6, 1)));
130
130
  return R;
131
131
  }
132
- function M0(W, a) {
133
- return W.offsetScore !== a.offsetScore ? W.offsetScore - a.offsetScore : W.abbrScore !== a.abbrScore ? W.abbrScore - a.abbrScore : W.zone.population !== a.zone.population ? a.zone.population - W.zone.population : a.zone.name.localeCompare(W.zone.name);
132
+ function M0(o, a) {
133
+ 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);
134
134
  }
135
- function z0(W, a) {
135
+ function z0(o, a) {
136
136
  var n, R;
137
137
  for (N(a), n = 0; n < a.length; n++)
138
- R = a[n], A[R] = A[R] || {}, A[R][W] = !0;
138
+ R = a[n], A[R] = A[R] || {}, A[R][o] = !0;
139
139
  }
140
- function b0(W) {
141
- var a = W.length, n = {}, R = [], e = {}, r, l, U, V;
140
+ function b0(o) {
141
+ var a = o.length, n = {}, R = [], e = {}, r, Z, U, V;
142
142
  for (r = 0; r < a; r++)
143
- if (U = W[r].offset, !e.hasOwnProperty(U)) {
143
+ if (U = o[r].offset, !e.hasOwnProperty(U)) {
144
144
  V = A[U] || {};
145
- for (l in V)
146
- V.hasOwnProperty(l) && (n[l] = !0);
145
+ for (Z in V)
146
+ V.hasOwnProperty(Z) && (n[Z] = !0);
147
147
  e[U] = !0;
148
148
  }
149
149
  for (r in n)
@@ -152,69 +152,69 @@ var j = { exports: {} };
152
152
  }
153
153
  function p0() {
154
154
  try {
155
- var W = Intl.DateTimeFormat().resolvedOptions().timeZone;
156
- if (W && W.length > 3) {
157
- var a = p[K(W)];
155
+ var o = Intl.DateTimeFormat().resolvedOptions().timeZone;
156
+ if (o && o.length > 3) {
157
+ var a = p[h(o)];
158
158
  if (a)
159
159
  return a;
160
- D("Moment Timezone found " + W + " from the Intl api, but did not have that data loaded.");
160
+ D("Moment Timezone found " + o + " from the Intl api, but did not have that data loaded.");
161
161
  }
162
162
  } catch {
163
163
  }
164
- var n = F(), R = n.length, e = b0(n), r = [], l, U, V;
164
+ var n = F(), R = n.length, e = b0(n), r = [], Z, U, V;
165
165
  for (U = 0; U < e.length; U++) {
166
- for (l = new H(g(e[U])), V = 0; V < R; V++)
167
- l.scoreOffsetAt(n[V]);
168
- r.push(l);
166
+ for (Z = new H(g(e[U])), V = 0; V < R; V++)
167
+ Z.scoreOffsetAt(n[V]);
168
+ r.push(Z);
169
169
  }
170
170
  return r.sort(M0), r.length > 0 ? r[0].zone.name : void 0;
171
171
  }
172
- function O0(W) {
173
- return (!o || W) && (o = p0()), o;
172
+ function O0(o) {
173
+ return (!W || o) && (W = p0()), W;
174
174
  }
175
- function K(W) {
176
- return (W || "").toLowerCase().replace(/\//g, "_");
175
+ function h(o) {
176
+ return (o || "").toLowerCase().replace(/\//g, "_");
177
177
  }
178
- function k(W) {
178
+ function k(o) {
179
179
  var a, n, R, e;
180
- for (typeof W == "string" && (W = [W]), a = 0; a < W.length; a++)
181
- R = W[a].split("|"), n = R[0], e = K(n), b[e] = W[a], p[e] = n, z0(e, R[2].split(" "));
180
+ for (typeof o == "string" && (o = [o]), a = 0; a < o.length; a++)
181
+ R = o[a].split("|"), n = R[0], e = h(n), b[e] = o[a], p[e] = n, z0(e, R[2].split(" "));
182
182
  }
183
- function g(W, a) {
184
- W = K(W);
185
- var n = b[W], R;
186
- return n instanceof G ? n : typeof n == "string" ? (n = new G(n), b[W] = n, n) : O[W] && a !== g && (R = g(O[W], g)) ? (n = b[W] = new G(), n._set(R), n.name = p[W], n) : null;
183
+ function g(o, a) {
184
+ o = h(o);
185
+ var n = b[o], R;
186
+ return n instanceof G ? n : typeof n == "string" ? (n = new G(n), b[o] = n, n) : O[o] && a !== g && (R = g(O[o], g)) ? (n = b[o] = new G(), n._set(R), n.name = p[o], n) : null;
187
187
  }
188
188
  function A0() {
189
- var W, a = [];
190
- for (W in p)
191
- p.hasOwnProperty(W) && (b[W] || b[O[W]]) && p[W] && a.push(p[W]);
189
+ var o, a = [];
190
+ for (o in p)
191
+ p.hasOwnProperty(o) && (b[o] || b[O[o]]) && p[o] && a.push(p[o]);
192
192
  return a.sort();
193
193
  }
194
194
  function c0() {
195
195
  return Object.keys(c);
196
196
  }
197
- function v(W) {
197
+ function v(o) {
198
198
  var a, n, R, e;
199
- for (typeof W == "string" && (W = [W]), a = 0; a < W.length; a++)
200
- n = W[a].split("|"), R = K(n[0]), e = K(n[1]), O[R] = e, p[R] = n[0], O[e] = R, p[e] = n[1];
199
+ for (typeof o == "string" && (o = [o]), a = 0; a < o.length; a++)
200
+ n = o[a].split("|"), R = h(n[0]), e = h(n[1]), O[R] = e, p[R] = n[0], O[e] = R, p[e] = n[1];
201
201
  }
202
- function W0(W) {
202
+ function W0(o) {
203
203
  var a, n, R, e;
204
- if (!(!W || !W.length))
205
- for (a = 0; a < W.length; a++)
206
- e = W[a].split("|"), n = e[0].toUpperCase(), R = e[1].split(" "), c[n] = new B(
204
+ if (!(!o || !o.length))
205
+ for (a = 0; a < o.length; a++)
206
+ e = o[a].split("|"), n = e[0].toUpperCase(), R = e[1].split(" "), c[n] = new B(
207
207
  n,
208
208
  R
209
209
  );
210
210
  }
211
- function o0(W) {
212
- return W = W.toUpperCase(), c[W] || null;
211
+ function o0(o) {
212
+ return o = o.toUpperCase(), c[o] || null;
213
213
  }
214
- function q0(W, a) {
215
- if (W = o0(W), !W)
214
+ function q0(o, a) {
215
+ if (o = o0(o), !o)
216
216
  return null;
217
- var n = W.zones.sort();
217
+ var n = o.zones.sort();
218
218
  return a ? n.map(function(R) {
219
219
  var e = g(R);
220
220
  return {
@@ -223,62 +223,62 @@ var j = { exports: {} };
223
223
  };
224
224
  }) : n;
225
225
  }
226
- function Y0(W) {
227
- k(W.zones), v(W.links), W0(W.countries), u.dataVersion = W.version;
226
+ function Y0(o) {
227
+ k(o.zones), v(o.links), W0(o.countries), u.dataVersion = o.version;
228
228
  }
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);
229
+ function $(o) {
230
+ return $.didShowError || ($.didShowError = !0, D("moment.tz.zoneExists('" + o + "') has been deprecated in favor of !moment.tz.zone('" + o + "')")), !!g(o);
231
231
  }
232
- function J(W) {
233
- var a = W._f === "X" || W._f === "x";
234
- return !!(W._a && W._tzm === void 0 && !a);
232
+ function J(o) {
233
+ var a = o._f === "X" || o._f === "x";
234
+ return !!(o._a && o._tzm === void 0 && !a);
235
235
  }
236
- function D(W) {
237
- typeof console < "u" && typeof console.error == "function" && console.error(W);
236
+ function D(o) {
237
+ typeof console < "u" && typeof console.error == "function" && console.error(o);
238
238
  }
239
- function u(W) {
239
+ function u(o) {
240
240
  var a = Array.prototype.slice.call(arguments, 0, -1), n = arguments[arguments.length - 1], R = M.utc.apply(null, a), e;
241
- return !M.isMoment(W) && J(R) && (e = g(n)) && R.add(e.parse(R), "minutes"), R.tz(n), R;
241
+ return !M.isMoment(o) && J(R) && (e = g(n)) && R.add(e.parse(R), "minutes"), R.tz(n), R;
242
242
  }
243
- u.version = z, u.dataVersion = "", u._zones = b, u._links = O, u._names = p, u._countries = c, 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 = s, u.unpackBase60 = T, u.needsOffset = J, u.moveInvalidForward = !0, u.moveAmbiguousForward = !1, u.countries = c0, u.zonesForCountry = q0;
243
+ u.version = z, u.dataVersion = "", u._zones = b, u._links = O, u._names = p, u._countries = c, 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 = l, u.unpackBase60 = T, u.needsOffset = J, u.moveInvalidForward = !0, u.moveAmbiguousForward = !1, u.countries = c0, u.zonesForCountry = q0;
244
244
  var C = M.fn;
245
- M.tz = u, M.defaultZone = null, M.updateOffset = function(W, a) {
245
+ M.tz = u, M.defaultZone = null, M.updateOffset = function(o, a) {
246
246
  var n = M.defaultZone, R;
247
- if (W._z === void 0 && (n && J(W) && !W._isUTC && W.isValid() && (W._d = M.utc(W._a)._d, W.utc().add(n.parse(W), "minutes")), W._z = n), W._z)
248
- if (R = W._z.utcOffset(W), Math.abs(R) < 16 && (R = R / 60), W.utcOffset !== void 0) {
249
- var e = W._z;
250
- W.utcOffset(-R, a), W._z = e;
247
+ if (o._z === void 0 && (n && J(o) && !o._isUTC && o.isValid() && (o._d = M.utc(o._a)._d, o.utc().add(n.parse(o), "minutes")), o._z = n), o._z)
248
+ if (R = o._z.utcOffset(o), Math.abs(R) < 16 && (R = R / 60), o.utcOffset !== void 0) {
249
+ var e = o._z;
250
+ o.utcOffset(-R, a), o._z = e;
251
251
  } else
252
- W.zone(R, a);
253
- }, C.tz = function(W, a) {
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, a) : D("Moment Timezone has no data for " + W + ". See http://momentjs.com/timezone/docs/#/data-loading/."), this;
252
+ o.zone(R, a);
253
+ }, C.tz = function(o, a) {
254
+ if (o) {
255
+ if (typeof o != "string")
256
+ throw new Error("Time zone name must be a string, got " + o + " [" + typeof o + "]");
257
+ return this._z = g(o), this._z ? M.updateOffset(this, a) : D("Moment Timezone has no data for " + o + ". 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(W) {
262
+ function y(o) {
263
263
  return function() {
264
- return this._z ? this._z.abbr(this) : W.call(this);
264
+ return this._z ? this._z.abbr(this) : o.call(this);
265
265
  };
266
266
  }
267
- function w(W) {
267
+ function w(o) {
268
268
  return function() {
269
- return this._z = null, W.apply(this, arguments);
269
+ return this._z = null, o.apply(this, arguments);
270
270
  };
271
271
  }
272
- function d0(W) {
272
+ function d0(o) {
273
273
  return function() {
274
- return arguments.length > 0 && (this._z = null), W.apply(this, arguments);
274
+ return arguments.length > 0 && (this._z = null), o.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(W) {
278
- return (Y < 2 || Y === 2 && d < 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;
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(o) {
278
+ return (Y < 2 || Y === 2 && d < 9) && D("Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js " + M.version + "."), M.defaultZone = o ? g(o) : null, M;
279
279
  };
280
- var h = M.momentProperties;
281
- return Object.prototype.toString.call(h) === "[object Array]" ? (h.push("_z"), h.push("_a")) : h && (h._z = null), M;
280
+ var K = M.momentProperties;
281
+ return Object.prototype.toString.call(K) === "[object Array]" ? (K.push("_z"), K.push("_a")) : K && (K._z = null), M;
282
282
  });
283
283
  })(j);
284
284
  var n0 = j.exports;
@@ -1145,15 +1145,15 @@ var x = { exports: {} };
1145
1145
  throw new RangeError("invalid coordinates");
1146
1146
  if (90 <= z)
1147
1147
  return "Etc/GMT";
1148
- var p = -1, A = 48 * (180 + b) / 360.00000000000006, o = 24 * (90 - z) / 180.00000000000003, q = 0 | A, Y = 0 | o, d = 96 * Y + 2 * q;
1148
+ var p = -1, A = 48 * (180 + b) / 360.00000000000006, W = 24 * (90 - z) / 180.00000000000003, q = 0 | A, Y = 0 | W, d = 96 * Y + 2 * q;
1149
1149
  for (d = 56 * O.charCodeAt(d) + O.charCodeAt(d + 1) - 1995; d + c.length < 3136; )
1150
- d = 56 * O.charCodeAt(d = 8 * (p = p + d + 1) + 4 * (Y = 0 | (o = 2 * (o - Y) % 2)) + 2 * (q = 0 | (A = 2 * (A - q) % 2)) + 2304) + O.charCodeAt(d + 1) - 1995;
1150
+ d = 56 * O.charCodeAt(d = 8 * (p = p + d + 1) + 4 * (Y = 0 | (W = 2 * (W - Y) % 2)) + 2 * (q = 0 | (A = 2 * (A - q) % 2)) + 2304) + O.charCodeAt(d + 1) - 1995;
1151
1151
  return c[d + c.length - 3136];
1152
1152
  }
1153
1153
  I.exports = M;
1154
1154
  })(x);
1155
- var S0 = x.exports;
1156
- const f0 = /* @__PURE__ */ X0(S0);
1155
+ var f0 = x.exports;
1156
+ const S0 = /* @__PURE__ */ X0(f0);
1157
1157
  class X {
1158
1158
  /**
1159
1159
  * 基于输入的经度,计算出时区
@@ -1161,7 +1161,7 @@ class X {
1161
1161
  * @param lat
1162
1162
  */
1163
1163
  static guessTimeZoneOffset(M, z) {
1164
- const b = f0(z, M), O = E().tz(b).utcOffset();
1164
+ const b = S0(z, M), O = s().tz(b).utcOffset();
1165
1165
  return this.roundPrecision(O / 60, 1);
1166
1166
  }
1167
1167
  /**
@@ -1177,13 +1177,13 @@ class X {
1177
1177
  z = z < 6 ? 6 : z, M = X.convertToStdLng(M, z);
1178
1178
  let O = "E";
1179
1179
  M < 0 && (O = "W"), M = Math.abs(M), b = b.toUpperCase();
1180
- let c = M * 3600, p, A, o, q, Y, d;
1181
- p = c % 3600 % 60, b.indexOf("S") !== -1 && (c = c - p, A = X.padNumber(p, 2, 2)), o = c / 60 % 60, b.indexOf("M") !== -1 && (b.indexOf("S") !== -1 ? q = X.roundPrecision(o, z).toString().padStart(2, "0") : q = X.padNumber(o, 2, 2), c = c - o * 60), Y = c / 3600, b.indexOf("M") !== -1 ? d = X.roundPrecision(Y, z).toString().padStart(3, "0") : d = X.padNumber(Y, 3, 2), Number(A) >= 60 && (q = Number(q) + 1, A = 0), Number(q) >= 60 && (d = Number(d) + 1, q = 0);
1180
+ let c = M * 3600, p, A, W, q, Y, d;
1181
+ p = c % 3600 % 60, b.indexOf("S") !== -1 && (c = c - p, A = X.padNumber(p, 2, 2)), W = c / 60 % 60, b.indexOf("M") !== -1 && (b.indexOf("S") !== -1 ? q = X.roundPrecision(W, z).toString().padStart(2, "0") : q = X.padNumber(W, 2, 2), c = c - W * 60), Y = c / 3600, b.indexOf("M") !== -1 ? d = X.roundPrecision(Y, z).toString().padStart(3, "0") : d = X.padNumber(Y, 3, 2), Number(A) >= 60 && (q = Number(q) + 1, A = 0), Number(q) >= 60 && (d = Number(d) + 1, q = 0);
1182
1182
  const L = `${b.replace(/S+/gi, A).replace(/M+/gi, q).replace(/H+/gi, d)}${O}`;
1183
1183
  return {
1184
1184
  direction: O,
1185
1185
  degree: X.roundPrecision(Y, z),
1186
- minute: X.roundPrecision(o, z),
1186
+ minute: X.roundPrecision(W, z),
1187
1187
  second: X.roundPrecision(p, z),
1188
1188
  pretty: L
1189
1189
  };
@@ -1198,13 +1198,13 @@ class X {
1198
1198
  z = z < 6 ? 6 : z, M = M % 180;
1199
1199
  let O = "N";
1200
1200
  M < 0 && (O = "S"), M = Math.abs(M), b = b.toUpperCase();
1201
- let c = M * 3600, p, A, o, q, Y, d;
1202
- p = c % 3600 % 60, b.indexOf("S") !== -1 && (c = c - p, A = X.padNumber(p, 2, 2)), o = c / 60 % 60, b.indexOf("M") !== -1 && (b.indexOf("S") !== -1 ? q = X.roundPrecision(o, z).toString().padStart(2, "0") : q = X.padNumber(o, 2, 2), c = c - o * 60), Y = c / 3600, b.indexOf("M") !== -1 ? d = X.roundPrecision(Y, z).toString().padStart(2, "0") : d = X.padNumber(Y, 2, 2), Number(A) >= 60 && (q = Number(q) + 1, A = 0), Number(q) >= 60 && (d = Number(d) + 1, q = 0);
1201
+ let c = M * 3600, p, A, W, q, Y, d;
1202
+ p = c % 3600 % 60, b.indexOf("S") !== -1 && (c = c - p, A = X.padNumber(p, 2, 2)), W = c / 60 % 60, b.indexOf("M") !== -1 && (b.indexOf("S") !== -1 ? q = X.roundPrecision(W, z).toString().padStart(2, "0") : q = X.padNumber(W, 2, 2), c = c - W * 60), Y = c / 3600, b.indexOf("M") !== -1 ? d = X.roundPrecision(Y, z).toString().padStart(2, "0") : d = X.padNumber(Y, 2, 2), Number(A) >= 60 && (q = Number(q) + 1, A = 0), Number(q) >= 60 && (d = Number(d) + 1, q = 0);
1203
1203
  const L = `${b.replace(/S+/gi, A).replace(/M+/gi, q).replace(/H+/gi, d)}${O}`;
1204
1204
  return {
1205
1205
  direction: O,
1206
1206
  degree: X.roundPrecision(Y, z),
1207
- minute: X.roundPrecision(o, z),
1207
+ minute: X.roundPrecision(W, z),
1208
1208
  second: X.roundPrecision(p, z),
1209
1209
  pretty: L
1210
1210
  };
@@ -1215,11 +1215,11 @@ class X {
1215
1215
  M = X.strReplace(M, "LNG");
1216
1216
  const O = M[M.length - 1].toUpperCase();
1217
1217
  M = M.substring(0, M.length - 1).trim();
1218
- const c = M.split(" ").filter((o) => o !== "").map((o) => Math.abs(Number(o)));
1218
+ const c = M.split(" ").filter((W) => W !== "").map((W) => Math.abs(Number(W)));
1219
1219
  let [p, A] = c;
1220
1220
  if (A = A > 60 ? A / Math.pow(10, String(A).length - 2) : A, p > 360 && !A) {
1221
- const o = this.roundPrecision(p / 100, 0);
1222
- A = p - o * 100, p = o;
1221
+ const W = this.roundPrecision(p / 100, 0);
1222
+ A = p - W * 100, p = W;
1223
1223
  }
1224
1224
  b = p + (A ?? 0) / 60, O === "W" && (b = b * -1);
1225
1225
  } else
@@ -1232,11 +1232,11 @@ class X {
1232
1232
  M = X.strReplace(M, "LAT");
1233
1233
  const O = M[M.length - 1].toUpperCase();
1234
1234
  M = M.substring(0, M.length - 1).trim();
1235
- const c = M.split(" ").filter((o) => o !== "").map((o) => Math.abs(Number(o)));
1235
+ const c = M.split(" ").filter((W) => W !== "").map((W) => Math.abs(Number(W)));
1236
1236
  let [p, A] = c;
1237
1237
  if (A = A > 60 ? A / Math.pow(10, String(A).length - 2) : A, p > 90 && !A) {
1238
- const o = this.roundPrecision(p / 100, 0);
1239
- A = p - o * 100, p = o;
1238
+ const W = this.roundPrecision(p / 100, 0);
1239
+ A = p - W * 100, p = W;
1240
1240
  }
1241
1241
  if (b = p + (A ?? 0) / 60, b > 90)
1242
1242
  throw new Error(`latitude out of range: ${M}${O}`);
@@ -1311,7 +1311,7 @@ try {
1311
1311
  } catch {
1312
1312
  } finally {
1313
1313
  }
1314
- class f {
1314
+ class S {
1315
1315
  /**
1316
1316
  * 计算方位角
1317
1317
  * @param from 坐标 {lng, lat}
@@ -1321,12 +1321,12 @@ class f {
1321
1321
  * @returns {number} 单位度
1322
1322
  */
1323
1323
  static calculateBearing(M, z, b = !0, O = 4) {
1324
- const c = S.points([
1324
+ const c = f.points([
1325
1325
  [M.lng, M.lat],
1326
1326
  [z.lng, z.lat]
1327
1327
  ]);
1328
1328
  let p;
1329
- return b ? p = S.rhumbBearing(c.features[0], c.features[1]) : p = S.bearing(c.features[0], c.features[1]), p < 0 && (p += 360), X.roundPrecision(p, O);
1329
+ return b ? p = f.rhumbBearing(c.features[0], c.features[1]) : p = f.bearing(c.features[0], c.features[1]), p < 0 && (p += 360), X.roundPrecision(p, O);
1330
1330
  }
1331
1331
  /**
1332
1332
  * 计算两点间距离
@@ -1339,12 +1339,12 @@ class f {
1339
1339
  */
1340
1340
  static calculateDistance(M, z, b = !0, O = 4, c = "nauticalmiles") {
1341
1341
  M = { ...M }, z = { ...z }, M.lng = X.convertToStdLng(M.lng, O), z.lng = X.convertToStdLng(z.lng, O);
1342
- const p = S.points([
1342
+ const p = f.points([
1343
1343
  [M.lng, M.lat],
1344
1344
  [z.lng, z.lat]
1345
1345
  ]);
1346
1346
  let A;
1347
- return b ? A = S.rhumbDistance(p.features[0], p.features[1], { units: c }) : A = S.distance(p.features[0], p.features[1], { units: c }), X.roundPrecision(A, O);
1347
+ return b ? A = f.rhumbDistance(p.features[0], p.features[1], { units: c }) : A = f.distance(p.features[0], p.features[1], { units: c }), X.roundPrecision(A, O);
1348
1348
  }
1349
1349
  /**
1350
1350
  * 计算航线距离
@@ -1356,10 +1356,10 @@ class f {
1356
1356
  let O = 0, c;
1357
1357
  for (const p of M)
1358
1358
  for (let A = 0; A < p.length - 1; A++) {
1359
- const o = { lng: p[A][0], lat: p[A][1] };
1360
- A === 0 && c && (O += this.calculateDistance(c, o, !0, z, b));
1359
+ const W = { lng: p[A][0], lat: p[A][1] };
1360
+ A === 0 && c && (O += this.calculateDistance(c, W, !0, z, b));
1361
1361
  const q = { lng: p[A + 1][0], lat: p[A + 1][1] };
1362
- O += this.calculateDistance(o, q, !0, z, b), c = q;
1362
+ O += this.calculateDistance(W, q, !0, z, b), c = q;
1363
1363
  }
1364
1364
  return X.roundPrecision(O, z);
1365
1365
  }
@@ -1372,11 +1372,11 @@ class f {
1372
1372
  * @param rhumb
1373
1373
  */
1374
1374
  static calculateCoordinate(M, z, b, O = "nauticalmiles", c = !0) {
1375
- const p = S.point([M.lng, M.lat]);
1375
+ const p = f.point([M.lng, M.lat]);
1376
1376
  let A;
1377
- c ? A = S.rhumbDestination(p, b, z, { units: O }) : A = S.destination(p, b, z, { units: O });
1378
- const o = A.geometry.coordinates;
1379
- return { lng: X.convertToStdLng(o[0], 8), lat: X.roundPrecision(o[1], 8) };
1377
+ c ? A = f.rhumbDestination(p, b, z, { units: O }) : A = f.destination(p, b, z, { units: O });
1378
+ const W = A.geometry.coordinates;
1379
+ return { lng: X.convertToStdLng(W[0], 8), lat: X.roundPrecision(W[1], 8) };
1380
1380
  }
1381
1381
  /**
1382
1382
  * 插值大圆坐标(基于两点方位角和间距)
@@ -1388,11 +1388,11 @@ class f {
1388
1388
  * @param units 单位,默认 nm(海里)
1389
1389
  */
1390
1390
  static interpolateCoordinates(M, z, b, O = !0, c = !0, p = "nauticalmiles") {
1391
- const A = [], o = this.calculateBearing(M, z, !1), q = this.calculateDistance(M, z, !1, 8, p);
1391
+ const A = [], W = this.calculateBearing(M, z, !1), q = this.calculateDistance(M, z, !1, 8, p);
1392
1392
  O && A.push({ lng: M.lng, lat: M.lat });
1393
1393
  let Y = 0;
1394
1394
  for (; Y < q; )
1395
- Y += b, Y < q && A.push(this.calculateCoordinate(M, o, Y, p, !1));
1395
+ Y += b, Y < q && A.push(this.calculateCoordinate(M, W, Y, p, !1));
1396
1396
  return c && A.push({ lng: z.lng, lat: z.lat }), A;
1397
1397
  }
1398
1398
  /**
@@ -1415,25 +1415,25 @@ class f {
1415
1415
  let c, p;
1416
1416
  for (let A = 0; A < M.length - 1; A++) {
1417
1417
  c = X.convertToStdLng(M[A].lng, 8), p = X.convertToStdLng(M[A + 1].lng, 8), M[A].lat = X.roundPrecision(M[A].lat, 8), M[A + 1].lat = X.roundPrecision(M[A + 1].lat, 8), b.push([c, M[A].lat]);
1418
- const o = c - p;
1419
- if (Math.abs(o) > 180) {
1418
+ const W = c - p;
1419
+ if (Math.abs(W) > 180) {
1420
1420
  const q = X.convertToMonotonicLng2([
1421
1421
  [c, M[A].lat],
1422
1422
  [p, M[A + 1].lat]
1423
1423
  ]);
1424
1424
  let Y, d;
1425
- z ? (Y = S.lineString(q), d = S.lineString([
1426
- [o > 0 ? 180 : -180, 89],
1427
- [o > 0 ? 180 : -180, -89]
1428
- ])) : (Y = S.greatCircle(q[0], q[1]), d = S.greatCircle([o > 0 ? 180 : -180, 89], [o > 0 ? 180 : -180, -89]));
1429
- const L = S.lineIntersect(Y, d);
1425
+ z ? (Y = f.lineString(q), d = f.lineString([
1426
+ [W > 0 ? 180 : -180, 89],
1427
+ [W > 0 ? 180 : -180, -89]
1428
+ ])) : (Y = f.greatCircle(q[0], q[1]), d = f.greatCircle([W > 0 ? 180 : -180, 89], [W > 0 ? 180 : -180, -89]));
1429
+ const L = f.lineIntersect(Y, d);
1430
1430
  let T;
1431
1431
  if (L.features.length) {
1432
- const N = S.getCoord(L.features[0]);
1432
+ const N = f.getCoord(L.features[0]);
1433
1433
  T = X.roundPrecision(N[1], 8);
1434
1434
  } else
1435
1435
  T = M[A].lat;
1436
- o > 0 ? (b.push([180 - 1e-6, T]), O.push([...b]), b = [], b.push([-(180 - 1e-6), T])) : (b.push([-(180 - 1e-6), T]), O.push([...b]), b = [], b.push([180 - 1e-6, T]));
1436
+ W > 0 ? (b.push([180 - 1e-6, T]), O.push([...b]), b = [], b.push([-(180 - 1e-6), T])) : (b.push([-(180 - 1e-6), T]), O.push([...b]), b = [], b.push([180 - 1e-6, T]));
1437
1437
  }
1438
1438
  A === M.length - 2 && b.push([p, M[A + 1].lat]);
1439
1439
  }
@@ -1495,9 +1495,9 @@ class f {
1495
1495
  static mergeCoordinateToRoute(M, z) {
1496
1496
  M.lng = X.convertToStdLng(M.lng, 8);
1497
1497
  let b = Number.MAX_VALUE, O = 0, c = 0, p, A;
1498
- return z.forEach((o, q) => {
1499
- for (let Y = 0; Y < o.length - 1; Y++) {
1500
- const d = { lng: o[Y][0], lat: o[Y][1] }, L = { lng: o[Y + 1][0], lat: o[Y + 1][1] }, T = this.calculatePointToLineDistance(M, d, L);
1498
+ return z.forEach((W, q) => {
1499
+ for (let Y = 0; Y < W.length - 1; Y++) {
1500
+ const d = { lng: W[Y][0], lat: W[Y][1] }, L = { lng: W[Y + 1][0], lat: W[Y + 1][1] }, T = this.calculatePointToLineDistance(M, d, L);
1501
1501
  b > T && (b = T, c = Y, O = q, p = this.calculateDistance(d, M), A = this.calculateDistance(L, M));
1502
1502
  }
1503
1503
  }), p !== 0 && A !== 0 ? z[O].splice(c + 1, 0, [M.lng, M.lat]) : p === 0 ? z[O].splice(c, 1, [M.lng, M.lat]) : A === 0 && z[O].splice(c + 1, 1, [M.lng, M.lat]), z;
@@ -1509,8 +1509,8 @@ class f {
1509
1509
  */
1510
1510
  static appendCoordinateToRoute(M, z) {
1511
1511
  M.lng = X.convertToStdLng(M.lng, 8);
1512
- const b = f.convertRouteToCoordinates(z);
1513
- return b.push(M), f.divideAccordingToLng(b);
1512
+ const b = S.convertRouteToCoordinates(z);
1513
+ return b.push(M), S.divideAccordingToLng(b);
1514
1514
  }
1515
1515
  /**
1516
1516
  * 向route头加1个坐标
@@ -1518,8 +1518,8 @@ class f {
1518
1518
  * @param route
1519
1519
  */
1520
1520
  static unshiftCoordinateToRoute(M, z) {
1521
- const b = f.convertRouteToCoordinates(z);
1522
- return b.unshift(M), f.divideAccordingToLng(b);
1521
+ const b = S.convertRouteToCoordinates(z);
1522
+ return b.unshift(M), S.divideAccordingToLng(b);
1523
1523
  }
1524
1524
  /**
1525
1525
  * 合并多个waypoints进航线
@@ -1546,12 +1546,12 @@ class f {
1546
1546
  if (c === 2)
1547
1547
  return;
1548
1548
  const A = [];
1549
- for (const o of p) {
1550
- if (X.roundPrecision(z.lng, 8) === X.roundPrecision(o[0], 8) && X.roundPrecision(z.lat, 8) === X.roundPrecision(o[1], 8)) {
1551
- A.push(o), c === 0 && A.push([M.lng, M.lat]), c = 2;
1549
+ for (const W of p) {
1550
+ if (X.roundPrecision(z.lng, 8) === X.roundPrecision(W[0], 8) && X.roundPrecision(z.lat, 8) === X.roundPrecision(W[1], 8)) {
1551
+ A.push(W), c === 0 && A.push([M.lng, M.lat]), c = 2;
1552
1552
  break;
1553
1553
  }
1554
- c === 1 ? A.push(o) : X.roundPrecision(M.lng, 8) === X.roundPrecision(o[0], 8) && X.roundPrecision(M.lat, 8) === X.roundPrecision(o[1], 8) && (c = 1, A.push(o));
1554
+ c === 1 ? A.push(W) : X.roundPrecision(M.lng, 8) === X.roundPrecision(W[0], 8) && X.roundPrecision(M.lat, 8) === X.roundPrecision(W[1], 8) && (c = 1, A.push(W));
1555
1555
  }
1556
1556
  A.length && O.push(A);
1557
1557
  }), O;
@@ -1567,10 +1567,10 @@ class f {
1567
1567
  static calculateRangeWaypoints(M, z, b, O = []) {
1568
1568
  const c = this.convertRouteToCoordinates(b, 0), p = this.mergeCoordinatesToWaypoints([M, z], c.length ? c : O), A = p.findIndex(
1569
1569
  (Y) => X.roundPrecision(M.lng, 8) === X.roundPrecision(Y.lng, 8) && X.roundPrecision(M.lat, 8) === X.roundPrecision(Y.lat, 8)
1570
- ), o = p.findIndex(
1570
+ ), W = p.findIndex(
1571
1571
  (Y) => X.roundPrecision(z.lng, 8) === X.roundPrecision(Y.lng, 8) && X.roundPrecision(z.lat, 8) === X.roundPrecision(Y.lat, 8)
1572
1572
  );
1573
- return p.filter((Y, d) => d >= A && d <= o);
1573
+ return p.filter((Y, d) => d >= A && d <= W);
1574
1574
  }
1575
1575
  /**
1576
1576
  * 计算坐标到航路上的最短距离
@@ -1580,9 +1580,9 @@ class f {
1580
1580
  static calculateMinDistanceToRoute(M, z) {
1581
1581
  let b = Number.MAX_VALUE, O = 0, c = 0;
1582
1582
  return z.forEach((p, A) => {
1583
- for (let o = 0; o < p.length - 1; o++) {
1584
- const q = { lng: p[o][0], lat: p[o][1] }, Y = { lng: p[o + 1][0], lat: p[o + 1][1] }, d = this.calculatePointToLineDistance(M, q, Y);
1585
- b > d && (b = d, O = o, c = A);
1583
+ for (let W = 0; W < p.length - 1; W++) {
1584
+ const q = { lng: p[W][0], lat: p[W][1] }, Y = { lng: p[W + 1][0], lat: p[W + 1][1] }, d = this.calculatePointToLineDistance(M, q, Y);
1585
+ b > d && (b = d, O = W, c = A);
1586
1586
  }
1587
1587
  }), { minDist: b, segIndex: c, minIndex: O };
1588
1588
  }
@@ -1593,21 +1593,21 @@ class f {
1593
1593
  * @return [[[lng, lat]]]
1594
1594
  */
1595
1595
  static calculateSubRoute(M, z) {
1596
- const b = f.convertRouteToCoordinates(z);
1597
- f.mergeCoordinateToWaypoints(M, b, !0), z = f.divideAccordingToLng(b);
1596
+ const b = S.convertRouteToCoordinates(z);
1597
+ S.mergeCoordinateToWaypoints(M, b, !0), z = S.divideAccordingToLng(b);
1598
1598
  const { segIndex: O, minIndex: c } = this.calculateMinDistanceToRoute({ ...M }, z);
1599
1599
  M.lng = X.convertToStdLng(M.lng);
1600
1600
  const p = [];
1601
1601
  let A = !0;
1602
- for (let o = O; o < z.length; o++)
1602
+ for (let W = O; W < z.length; W++)
1603
1603
  if (A) {
1604
1604
  const q = [];
1605
1605
  q.push([M.lng, M.lat]);
1606
- for (let Y = c + 1; Y < z[o].length; Y++)
1607
- M.lng === z[o][Y][0] && M.lat === z[o][Y][1] || q.push(z[o][Y]);
1606
+ for (let Y = c + 1; Y < z[W].length; Y++)
1607
+ M.lng === z[W][Y][0] && M.lat === z[W][Y][1] || q.push(z[W][Y]);
1608
1608
  p.push(q), A = !1;
1609
1609
  } else
1610
- p.push([...z[o]]);
1610
+ p.push([...z[W]]);
1611
1611
  return p;
1612
1612
  }
1613
1613
  /**
@@ -1619,12 +1619,12 @@ class f {
1619
1619
  static calculateSubWaypoints(M, z) {
1620
1620
  let b = Number.MAX_VALUE, O = 0;
1621
1621
  for (let p = 0; p < z.length - 1; p++) {
1622
- const A = z[p], o = z[p + 1];
1622
+ const A = z[p], W = z[p + 1];
1623
1623
  if (this.calculateDistance(M, A) === 0)
1624
1624
  return z;
1625
- if (this.calculateDistance(M, o) === 0)
1625
+ if (this.calculateDistance(M, W) === 0)
1626
1626
  return z.filter((Y, d) => d > 0);
1627
- const q = this.calculatePointToLineDistance(M, A, o);
1627
+ const q = this.calculatePointToLineDistance(M, A, W);
1628
1628
  b > q && (b = q, O = p);
1629
1629
  }
1630
1630
  M.lng = X.convertToStdLng(M.lng);
@@ -1644,11 +1644,11 @@ class f {
1644
1644
  M.lng = X.convertToStdLng(M.lng, 8), z = { ...z }, b = { ...b }, z.lng = X.convertToStdLng(z.lng, 8), b.lng = X.convertToStdLng(b.lng, 8);
1645
1645
  const c = X.convertToMonotonicLng([z, b]);
1646
1646
  z = c[0], b = c[1];
1647
- const p = S.lineString([
1647
+ const p = f.lineString([
1648
1648
  [z.lng, z.lat],
1649
1649
  [b.lng, b.lat]
1650
- ]), A = S.pointToLineDistance(S.point([M.lng, M.lat]), p, O), o = S.pointToLineDistance(S.point([M.lng > 0 ? M.lng - 360 : M.lng + 360, M.lat]), p, O);
1651
- return X.roundPrecision(Math.min(A, o), 6);
1650
+ ]), A = f.pointToLineDistance(f.point([M.lng, M.lat]), p, O), W = f.pointToLineDistance(f.point([M.lng > 0 ? M.lng - 360 : M.lng + 360, M.lat]), p, O);
1651
+ return X.roundPrecision(Math.min(A, W), 6);
1652
1652
  }
1653
1653
  /**
1654
1654
  * 计算途经点的COG, Distance等属性
@@ -1691,20 +1691,20 @@ class f {
1691
1691
  if (z.length < 2)
1692
1692
  z.push(M);
1693
1693
  else {
1694
- for (let o = 0; o < z.length - 1; o++) {
1695
- const q = { lng: z[o].lng, lat: z[o].lat }, Y = { lng: z[o + 1].lng, lat: z[o + 1].lat }, d = this.calculatePointToLineDistance(M, q, Y);
1696
- O >= d && (O = d, c = o, p = this.calculateDistance(q, M, !1, 6), A = this.calculateDistance(Y, M, !1, 6));
1694
+ for (let W = 0; W < z.length - 1; W++) {
1695
+ const q = { lng: z[W].lng, lat: z[W].lat }, Y = { lng: z[W + 1].lng, lat: z[W + 1].lat }, d = this.calculatePointToLineDistance(M, q, Y);
1696
+ O >= d && (O = d, c = W, p = this.calculateDistance(q, M, !1, 6), A = this.calculateDistance(Y, M, !1, 6));
1697
1697
  }
1698
1698
  p !== 0 && A !== 0 ? p < O || p === O && c === 0 ? z.unshift(M) : A < O || A === O && c === z.length - 2 ? z.push(M) : z.splice(c + 1, 0, M) : p === 0 ? b ? z.splice(c, 1, M) : z.splice(c + 1, 0, M) : A === 0 && (b ? z.splice(c + 1, 1, M) : z.splice(c + 1, 0, M));
1699
1699
  }
1700
- return z.map((o, q) => {
1701
- o.lng = X.convertToStdLng(o.lng);
1700
+ return z.map((W, q) => {
1701
+ W.lng = X.convertToStdLng(W.lng);
1702
1702
  const Y = z[q + 1];
1703
- if (Y && (o.bearing || ((o.positionTime || 0) > (Y.positionTime || 0) ? o.bearing = this.calculateBearing(Y, o, !0) : o.bearing = this.calculateBearing(o, Y, !0)), o.cog = o.cog || o.bearing, !o.sog && o.positionTime && Y.positionTime)) {
1704
- const d = this.calculateDistance(o, Y, !0), L = Math.abs(Y.positionTime - o.positionTime) / 3600;
1705
- o.sog = X.roundPrecision(d / L, 2);
1703
+ if (Y && (W.bearing || ((W.positionTime || 0) > (Y.positionTime || 0) ? W.bearing = this.calculateBearing(Y, W, !0) : W.bearing = this.calculateBearing(W, Y, !0)), W.cog = W.cog || W.bearing, !W.sog && W.positionTime && Y.positionTime)) {
1704
+ const d = this.calculateDistance(W, Y, !0), L = Math.abs(Y.positionTime - W.positionTime) / 3600;
1705
+ W.sog = X.roundPrecision(d / L, 2);
1706
1706
  }
1707
- return o;
1707
+ return W;
1708
1708
  });
1709
1709
  }
1710
1710
  /**
@@ -1730,8 +1730,8 @@ class f {
1730
1730
  * @param route [[[lng, lat]]]
1731
1731
  */
1732
1732
  static nearestCoordinateInRoute(M, z) {
1733
- const b = S.point([M.lng, M.lat]), c = this.convertRouteToCoordinates(z).map((q) => [q.lng, q.lat]), p = S.lineString(c), A = S.nearestPointOnLine(p, b), o = S.getCoord(A);
1734
- return { lng: X.roundPrecision(o[0], 8), lat: X.roundPrecision(o[1], 8) };
1733
+ const b = f.point([M.lng, M.lat]), c = this.convertRouteToCoordinates(z).map((q) => [q.lng, q.lat]), p = f.lineString(c), A = f.nearestPointOnLine(p, b), W = f.getCoord(A);
1734
+ return { lng: X.roundPrecision(W[0], 8), lat: X.roundPrecision(W[1], 8) };
1735
1735
  }
1736
1736
  /**
1737
1737
  * 计算经过方向上的最后一个waypoint
@@ -1765,18 +1765,18 @@ class f {
1765
1765
  static calculateNextCoordinateAlongRoute(M, z, b, O = "nauticalmiles") {
1766
1766
  var L;
1767
1767
  const c = M.speed || 12, p = [];
1768
- let A = [], o = !1, q = 0, Y = 0, d;
1768
+ let A = [], W = !1, q = 0, Y = 0, d;
1769
1769
  if (z && b.length ? (p.push(M), b.forEach((T, N) => {
1770
- if (o)
1770
+ if (W)
1771
1771
  A.push(T);
1772
1772
  else {
1773
1773
  const i = [];
1774
1774
  let t;
1775
- for (let s = 0; s < T.length; s++)
1775
+ for (let l = 0; l < T.length; l++)
1776
1776
  if (d)
1777
- i.push(T[s]);
1777
+ i.push(T[l]);
1778
1778
  else {
1779
- t = { lng: T[s][0], lat: T[s][1] };
1779
+ t = { lng: T[l][0], lat: T[l][1] };
1780
1780
  const G = this.calculateDistance(M, t, !0, 8, O);
1781
1781
  if (q += G, q < z)
1782
1782
  Y += G, G && p.push(t), M = t;
@@ -1784,10 +1784,10 @@ class f {
1784
1784
  if (Y = z, q === z)
1785
1785
  d = t, i.push([d.lng, d.lat]);
1786
1786
  else {
1787
- const Z = q - z, B = this.calculateBearing(t, M);
1788
- d = this.calculateCoordinate(t, B, Z, O), i.push([d.lng, d.lat]), i.push([t.lng, t.lat]);
1787
+ const P = q - z, B = this.calculateBearing(t, M);
1788
+ d = this.calculateCoordinate(t, B, P, O), i.push([d.lng, d.lat]), i.push([t.lng, t.lat]);
1789
1789
  }
1790
- o = !0;
1790
+ W = !0;
1791
1791
  }
1792
1792
  }
1793
1793
  i.length && A.push(i), N === b.length - 1 && !d && (d = t);
@@ -1807,10 +1807,10 @@ class f {
1807
1807
  * @param to {lng, lat}
1808
1808
  */
1809
1809
  static nearestCoordinateInLine(M, z, b) {
1810
- const O = X.convertToStdLng(M.lng, 6), c = S.point([O, M.lat]), p = X.convertToStdLng(z.lng, 6), A = X.convertToStdLng(b.lng, 6), o = S.lineString([
1810
+ const O = X.convertToStdLng(M.lng, 6), c = f.point([O, M.lat]), p = X.convertToStdLng(z.lng, 6), A = X.convertToStdLng(b.lng, 6), W = f.lineString([
1811
1811
  [p, z.lat],
1812
1812
  [A, b.lat]
1813
- ]), q = S.nearestPointOnLine(o, c), Y = S.getCoord(q), d = X.roundPrecision(Y[0], 6), L = X.roundPrecision(Y[1], 6);
1813
+ ]), q = f.nearestPointOnLine(W, c), Y = f.getCoord(q), d = X.roundPrecision(Y[0], 6), L = X.roundPrecision(Y[1], 6);
1814
1814
  return { lng: d, lat: L, inline: !(d === p && L === z.lat) && !(d === A && L === b.lat) };
1815
1815
  }
1816
1816
  /**
@@ -1823,16 +1823,16 @@ class f {
1823
1823
  let O, c;
1824
1824
  return M.forEach((p) => {
1825
1825
  p.forEach((A) => {
1826
- const o = { lng: X.roundPrecision(A[0], 8), lat: X.roundPrecision(A[1], 8) };
1826
+ const W = { lng: X.roundPrecision(A[0], 8), lat: X.roundPrecision(A[1], 8) };
1827
1827
  if (!c)
1828
- b.push(o), c = o;
1828
+ b.push(W), c = W;
1829
1829
  else if (c.bearing === void 0)
1830
- c.bearing = this.calculateBearing(c, o, !0);
1830
+ c.bearing = this.calculateBearing(c, W, !0);
1831
1831
  else {
1832
- const q = this.calculateDistance(O, o, !0);
1833
- q && q >= z && (O.bearing = this.calculateBearing(O, o, !0), b.push(O), c = O);
1832
+ const q = this.calculateDistance(O, W, !0);
1833
+ q && q >= z && (O.bearing = this.calculateBearing(O, W, !0), b.push(O), c = O);
1834
1834
  }
1835
- O = o;
1835
+ O = W;
1836
1836
  });
1837
1837
  }), O && b.push(O), b;
1838
1838
  }
@@ -1858,8 +1858,8 @@ class f {
1858
1858
  for (let O = 1; O < z.length; O++) {
1859
1859
  const c = z[O - 1], p = z[O];
1860
1860
  if (p.gcToPrevious) {
1861
- const A = M.findIndex((q) => q.lng === c.lng && q.lat === c.lat), o = M.findIndex((q) => q.lng === p.lng && q.lat === p.lat);
1862
- for (let q = o - 1; q > A; q--)
1861
+ const A = M.findIndex((q) => q.lng === c.lng && q.lat === c.lat), W = M.findIndex((q) => q.lng === p.lng && q.lat === p.lat);
1862
+ for (let q = W - 1; q > A; q--)
1863
1863
  M.splice(q, 1);
1864
1864
  }
1865
1865
  }
@@ -1877,12 +1877,12 @@ class f {
1877
1877
  static calculateCenter(M) {
1878
1878
  const z = [];
1879
1879
  for (const A of M)
1880
- for (const o of A)
1881
- z.push(o);
1882
- const b = S.featureCollection([]), O = X.convertToMonotonicLng2(z);
1880
+ for (const W of A)
1881
+ z.push(W);
1882
+ const b = f.featureCollection([]), O = X.convertToMonotonicLng2(z);
1883
1883
  for (const A of O)
1884
- b.features.push(S.point(A));
1885
- const p = S.center(b).geometry.coordinates;
1884
+ b.features.push(f.point(A));
1885
+ const p = f.center(b).geometry.coordinates;
1886
1886
  return { lng: X.convertToStdLng(p[0], 8), lat: X.roundPrecision(p[1], 8) };
1887
1887
  }
1888
1888
  /**
@@ -1902,8 +1902,8 @@ class f {
1902
1902
  for (const c of M)
1903
1903
  for (const p of c)
1904
1904
  z.push(p);
1905
- const b = X.convertToMonotonicLng2(z), O = S.lineString(b);
1906
- return S.bbox(O);
1905
+ const b = X.convertToMonotonicLng2(z), O = f.lineString(b);
1906
+ return f.bbox(O);
1907
1907
  }
1908
1908
  /**
1909
1909
  * 计算BBox
@@ -1922,10 +1922,10 @@ class f {
1922
1922
  static simplifyCoordinates(M, z = 1, b = 180) {
1923
1923
  const O = [];
1924
1924
  for (let c = 1; c < M.length; c++) {
1925
- const p = M[c - 1], A = M[c], o = M[c + 1];
1925
+ const p = M[c - 1], A = M[c], W = M[c + 1];
1926
1926
  let q = !1, Y = !1;
1927
- if ((p.velocity || p.suspend || p.important || p.pilot || c === 1) && (q = !0, O.push(p)), A.gcToPrevious && (q || (q = !0, O.push(p)), Y = !0, O.push(A), c++), o) {
1928
- const d = f.calculateDistance(p, A, !0), L = f.calculateDistance(A, o, !0), T = f.calculateDistance(p, o, !0), N = (Math.pow(d, 2) + Math.pow(L, 2) - Math.pow(T, 2)) / (2 * d * L);
1927
+ if ((p.velocity || p.suspend || p.important || p.pilot || c === 1) && (q = !0, O.push(p)), A.gcToPrevious && (q || (q = !0, O.push(p)), Y = !0, O.push(A), c++), W) {
1928
+ const d = S.calculateDistance(p, A, !0), L = S.calculateDistance(A, W, !0), T = S.calculateDistance(p, W, !0), N = (Math.pow(d, 2) + Math.pow(L, 2) - Math.pow(T, 2)) / (2 * d * L);
1929
1929
  Math.round(Math.acos(N) * 180 / Math.PI) < b && T > z && !Y && (O.push(A), c++);
1930
1930
  }
1931
1931
  if (c >= M.length - 1) {
@@ -1942,7 +1942,7 @@ class f {
1942
1942
  * @param waypoints 带时间的轨迹, 单位秒
1943
1943
  */
1944
1944
  static nearestTSPointInWaypoints(M, z, b) {
1945
- const O = E.unix(M), c = b.filter(
1945
+ const O = s.unix(M), c = b.filter(
1946
1946
  (p) => O.clone().subtract(z, "hour").unix() <= (p.positionTime || 0) && O.clone().add(z, "h").unix() >= (p.positionTime || 0)
1947
1947
  );
1948
1948
  return c.sort((p, A) => (p.positionTime || 0) - (A.positionTime || 0)), c.at(-1);
@@ -1953,17 +1953,17 @@ class f {
1953
1953
  * @param positions 带时间(positionTime)的轨迹
1954
1954
  */
1955
1955
  static deadReckoning(M, z) {
1956
- var c, p, A, o;
1956
+ var c, p, A, W;
1957
1957
  M > 1e12 && (M = Math.round(M / 1e3));
1958
- const b = E.unix(M);
1958
+ const b = s.unix(M);
1959
1959
  let O = z.find((q) => q.positionTime === b.unix());
1960
1960
  if (!O) {
1961
- const q = (p = (c = z.filter((d) => (d == null ? void 0 : d.positionTime) < b.unix())) == null ? void 0 : c.sort((d, L) => (d.positionTime || 0) - (L.positionTime || 0))) == null ? void 0 : p.at(-1), Y = (o = (A = z.filter((d) => (d == null ? void 0 : d.positionTime) > b.unix())) == null ? void 0 : A.sort((d, L) => (d.positionTime || 0) - (L.positionTime || 0))) == null ? void 0 : o.at(0);
1961
+ const q = (p = (c = z.filter((d) => (d == null ? void 0 : d.positionTime) < b.unix())) == null ? void 0 : c.sort((d, L) => (d.positionTime || 0) - (L.positionTime || 0))) == null ? void 0 : p.at(-1), Y = (W = (A = z.filter((d) => (d == null ? void 0 : d.positionTime) > b.unix())) == null ? void 0 : A.sort((d, L) => (d.positionTime || 0) - (L.positionTime || 0))) == null ? void 0 : W.at(0);
1962
1962
  if (q && Y) {
1963
- const d = f.calculateBearing(q, Y, !0), L = f.calculateDistance(q, Y), T = (b.unix() - q.positionTime) / (Y.positionTime - q.positionTime);
1964
- O = f.calculateCoordinate(q, d, L * T), O.positionTime = b.unix(), O.utc = b.utc().format(), O.cog = d, O.sog = Math.round(L / ((Y.positionTime - q.positionTime) / 3600) * 100) / 100;
1963
+ const d = S.calculateBearing(q, Y, !0), L = S.calculateDistance(q, Y), T = (b.unix() - q.positionTime) / (Y.positionTime - q.positionTime);
1964
+ O = S.calculateCoordinate(q, d, L * T), O.positionTime = b.unix(), O.utc = b.utc().format(), O.cog = d, O.sog = Math.round(L / ((Y.positionTime - q.positionTime) / 3600) * 100) / 100;
1965
1965
  } else
1966
- O = q || Y, O && (O.utc = E.unix(O == null ? void 0 : O.positionTime).utc().format());
1966
+ O = q || Y, O && (O.utc = s.unix(O == null ? void 0 : O.positionTime).utc().format());
1967
1967
  }
1968
1968
  return O;
1969
1969
  }
@@ -1976,19 +1976,19 @@ class f {
1976
1976
  z = JSON.parse(JSON.stringify(z)), z.sort((q, Y) => q.positionTime - Y.positionTime);
1977
1977
  let b = Number.MAX_SAFE_INTEGER, O = Number.MAX_SAFE_INTEGER;
1978
1978
  for (let q = 0; q < z.length - 1; q++) {
1979
- const Y = z[q], d = z[q + 1], L = f.calculatePointToLineDistance(M, Y, d);
1979
+ const Y = z[q], d = z[q + 1], L = S.calculatePointToLineDistance(M, Y, d);
1980
1980
  L < b && (b = L, O = q);
1981
1981
  }
1982
- const c = z[O], p = z[O + 1], A = f.calculateDistance(c, M), o = f.calculateDistance(p, M);
1982
+ const c = z[O], p = z[O + 1], A = S.calculateDistance(c, M), W = S.calculateDistance(p, M);
1983
1983
  if (A === 0)
1984
1984
  M = c;
1985
- else if (o === 0)
1985
+ else if (W === 0)
1986
1986
  M = p;
1987
1987
  else {
1988
- const q = f.nearestCoordinateInLine(M, c, p), Y = c.positionTime, d = p.positionTime, L = f.calculateDistance(c, q), T = f.calculateDistance(c, p), N = Math.round(Y + (d - Y) * (L / T));
1988
+ const q = S.nearestCoordinateInLine(M, c, p), Y = c.positionTime, d = p.positionTime, L = S.calculateDistance(c, q), T = S.calculateDistance(c, p), N = Math.round(Y + (d - Y) * (L / T));
1989
1989
  M.positionTime = N;
1990
1990
  }
1991
- return M.utc = M.positionTime ? E.unix(M.positionTime).utc().format() : void 0, M.positionTime ? M : void 0;
1991
+ return M.utc = M.positionTime ? s.unix(M.positionTime).utc().format() : void 0, M.positionTime ? M : void 0;
1992
1992
  }
1993
1993
  /**
1994
1994
  * 翻转轨迹
@@ -2004,9 +2004,9 @@ class f {
2004
2004
  return M.reverse();
2005
2005
  }
2006
2006
  }
2007
- let P;
2007
+ let E;
2008
2008
  try {
2009
- P = _.getLogger("vessel");
2009
+ E = _.getLogger("vessel");
2010
2010
  } catch {
2011
2011
  } finally {
2012
2012
  }
@@ -2017,19 +2017,19 @@ class t0 {
2017
2017
  */
2018
2018
  static convert2Geojson(M) {
2019
2019
  var b, O, c;
2020
- const z = S.featureCollection([]);
2020
+ const z = f.featureCollection([]);
2021
2021
  for (const p of M) {
2022
2022
  const A = (b = p.history) == null ? void 0 : b[0];
2023
2023
  if (p.forecasts) {
2024
2024
  A && A.wind && (A.wind.kts = A.kts);
2025
- for (const o of p.forecasts) {
2025
+ for (const W of p.forecasts) {
2026
2026
  let q;
2027
- const Y = [], d = E(o.date).utc(), L = `${p.name}-${o.model}`;
2028
- for (const N in o == null ? void 0 : o.hours) {
2029
- const i = o.hours[N];
2027
+ const Y = [], d = s(W.date).utc(), L = `${p.name}-${W.model}`;
2028
+ for (const N in W == null ? void 0 : W.hours) {
2029
+ const i = W.hours[N];
2030
2030
  q = q || i;
2031
- const t = d.clone().add(Number(N), "hour"), s = S.point([i.lng, i.lat], {
2032
- model: o.model,
2031
+ const t = d.clone().add(Number(N), "hour"), l = f.point([i.lng, i.lat], {
2032
+ model: W.model,
2033
2033
  name: p.name,
2034
2034
  date: t.format(),
2035
2035
  hour: Number(N),
@@ -2041,20 +2041,20 @@ class t0 {
2041
2041
  category: L,
2042
2042
  type: "forecast"
2043
2043
  });
2044
- z.features.push(s), Y.push(s.geometry.coordinates);
2044
+ z.features.push(l), Y.push(l.geometry.coordinates);
2045
2045
  }
2046
2046
  const T = {
2047
2047
  kts: void 0,
2048
2048
  deg: void 0
2049
2049
  };
2050
2050
  if (A) {
2051
- const N = E(A.updated).utc();
2051
+ const N = s(A.updated).utc();
2052
2052
  if (q) {
2053
- const t = f.calculateDistance(A, q), s = E(q.utc || q.updated).diff(N, "h", !0);
2054
- T.kts = Math.round(t / s * 100) / 100, T.deg = f.calculateBearing(A, q, !0, 0);
2053
+ const t = S.calculateDistance(A, q), l = s(q.utc || q.updated).diff(N, "h", !0);
2054
+ T.kts = Math.round(t / l * 100) / 100, T.deg = S.calculateBearing(A, q, !0, 0);
2055
2055
  }
2056
- const i = S.point([A.lng, A.lat], {
2057
- model: o.model,
2056
+ const i = f.point([A.lng, A.lat], {
2057
+ model: W.model,
2058
2058
  name: p.name,
2059
2059
  date: N.format(),
2060
2060
  hour: 0,
@@ -2063,15 +2063,17 @@ class t0 {
2063
2063
  wind: A.wind,
2064
2064
  movement: T,
2065
2065
  category: L,
2066
- type: "forecast"
2066
+ type: "forecast",
2067
+ important: !0
2068
+ // 第一个预报点为重要点
2067
2069
  });
2068
2070
  z.features.push(i), Y.unshift(i.geometry.coordinates);
2069
2071
  }
2070
2072
  if ((Y == null ? void 0 : Y.length) > 1) {
2071
- const N = S.lineString(X.convertToMonotonicLng2(Y), {
2072
- date: o.date,
2073
+ const N = f.lineString(X.convertToMonotonicLng2(Y), {
2074
+ date: A.updated,
2073
2075
  id: p.id || p.name,
2074
- model: o.model,
2076
+ model: W.model,
2075
2077
  name: p.name,
2076
2078
  category: L,
2077
2079
  type: "forecast",
@@ -2081,12 +2083,12 @@ class t0 {
2081
2083
  }
2082
2084
  }
2083
2085
  }
2084
- if ((O = p.history) != null && O.length) {
2085
- const o = [], q = E(A == null ? void 0 : A.updated).utc(), Y = E((c = p.history) == null ? void 0 : c.at(-1).updated).utc(), d = q.diff(Y, "h") % 24 > 2 ? 24 : 12;
2086
+ if (z.features.sort((W, q) => W.properties.type === "forecast" && q.properties.type === "forecast" && W.geometry.type === "Point" && q.geometry.type === "Point" ? s(W.properties.date).valueOf() - s(q.properties.date).valueOf() : 0), (O = p.history) != null && O.length) {
2087
+ const W = [], q = s(A == null ? void 0 : A.updated).utc(), Y = s((c = p.history) == null ? void 0 : c.at(-1).updated).utc(), d = q.diff(Y, "h") % 24 > 2 ? 24 : 12;
2086
2088
  for (const L of p.history) {
2087
- const T = E(L.updated).utc(), N = T.isSameOrBefore(q) || T.isSame(Y);
2089
+ const T = s(L.updated).utc(), N = T.isSameOrBefore(q) || T.isSame(Y);
2088
2090
  N && q.add(-d, "h");
2089
- const i = S.point([L.lng, L.lat], {
2091
+ const i = f.point([L.lng, L.lat], {
2090
2092
  name: p.name,
2091
2093
  date: T.format(),
2092
2094
  format: T.format("MMM-DD/HHmm[Z]"),
@@ -2099,10 +2101,10 @@ class t0 {
2099
2101
  movement: L.movement,
2100
2102
  important: N
2101
2103
  });
2102
- z.features.push(i), o.push(i.geometry.coordinates);
2104
+ z.features.push(i), W.push(i.geometry.coordinates);
2103
2105
  }
2104
- if (o.length === 1 && o.push(o[0]), o.length > 1) {
2105
- const L = S.lineString(X.convertToMonotonicLng2(o), {
2106
+ if (W.length === 1 && W.push(W[0]), W.length > 1) {
2107
+ const L = f.lineString(X.convertToMonotonicLng2(W), {
2106
2108
  name: p.name,
2107
2109
  type: "history",
2108
2110
  updated: A == null ? void 0 : A.updated,
@@ -2113,6 +2115,7 @@ class t0 {
2113
2115
  z.features.push(L);
2114
2116
  }
2115
2117
  }
2118
+ z.features.sort((W, q) => W.properties.type === "forecast" && q.properties.type === "forecast" && W.geometry.type === "Point" && q.geometry.type === "Point" ? s(W.properties.date).valueOf() - s(q.properties.date).valueOf() : W.properties.type === "history" && q.properties.type === "history" && W.geometry.type === "Point" && q.geometry.type === "Point" ? s(q.properties.date).valueOf() - s(W.properties.date).valueOf() : 0);
2116
2119
  }
2117
2120
  return z;
2118
2121
  }
@@ -2122,28 +2125,28 @@ class t0 {
2122
2125
  * @param step
2123
2126
  */
2124
2127
  static interpolate(M, z = 3) {
2125
- var c, p, A, o;
2128
+ var c, p, A, W;
2126
2129
  const b = (c = M == null ? void 0 : M.data) == null ? void 0 : c.features.filter((q) => q.geometry.type === "LineString" && q.properties.type === "forecast"), O = [];
2127
2130
  for (const q of b) {
2128
- const Y = q.properties.name, d = q.properties.model, L = q.properties.showCircle, T = q.properties.disabled, N = E(q.properties.date).utc();
2131
+ const Y = q.properties.name, d = q.properties.model, L = q.properties.showCircle, T = q.properties.disabled, N = s(q.properties.date).utc();
2129
2132
  let i = z * 60 - (N.get("hour") * 60 + N.get("minute")) % (z * 60);
2130
2133
  const t = (p = M == null ? void 0 : M.data) == null ? void 0 : p.features.filter(
2131
- (Z) => Z.geometry.type === "Point" && Z.properties.type === "forecast" && Z.properties.category === `${Y}-${d}`
2134
+ (P) => P.geometry.type === "Point" && P.properties.type === "forecast" && P.properties.category === `${Y}-${d}`
2132
2135
  );
2133
- let s, G = N.clone().add(i, "minute").set({ minute: 0, second: 0, millisecond: 0 });
2134
- for (; s = this.pickIndex(t, G), s <= t.length - 1; ) {
2135
- if (s > 0) {
2136
- const Z = t[s], B = s === 0 ? void 0 : t[s - 1], m = (i / 60 - ((A = B == null ? void 0 : B.properties) == null ? void 0 : A.hour)) / (Z.properties.hour - ((o = B == null ? void 0 : B.properties) == null ? void 0 : o.hour)), H = this.computeNumber(B == null ? void 0 : B.geometry.coordinates[0], Z.geometry.coordinates[0], m), Q = this.computeNumber(B == null ? void 0 : B.geometry.coordinates[1], Z.geometry.coordinates[1], m), F = S.point([H, Q], {
2136
+ let l, G = N.clone().add(i, "minute").set({ minute: 0, second: 0, millisecond: 0 });
2137
+ for (; l = this.pickIndex(t, G), l <= t.length - 1; ) {
2138
+ if (l > 0) {
2139
+ const P = t[l], B = l === 0 ? void 0 : t[l - 1], m = (i / 60 - ((A = B == null ? void 0 : B.properties) == null ? void 0 : A.hour)) / (P.properties.hour - ((W = B == null ? void 0 : B.properties) == null ? void 0 : W.hour)), H = this.computeNumber(B == null ? void 0 : B.geometry.coordinates[0], P.geometry.coordinates[0], m), Q = this.computeNumber(B == null ? void 0 : B.geometry.coordinates[1], P.geometry.coordinates[1], m), F = f.point([H, Q], {
2137
2140
  name: Y,
2138
2141
  model: d,
2139
- category: Z == null ? void 0 : Z.properties.category,
2142
+ category: P == null ? void 0 : P.properties.category,
2140
2143
  date: G.format(),
2141
2144
  format: G.format("MMM-DD/HHmm[Z]"),
2142
- gusts: this.computeNumber(B == null ? void 0 : B.properties.gusts, Z.properties.gusts, m),
2143
- hour: this.computeNumber(B == null ? void 0 : B.properties.hour, Z.properties.hour, m),
2144
- movement: this.computeNumber(B == null ? void 0 : B.properties.movement, Z.properties.movement, m),
2145
- pressure: this.computeNumber(B == null ? void 0 : B.properties.pressure, Z.properties.pressure, m),
2146
- wind: this.computeNumber(B == null ? void 0 : B.properties.wind, Z.properties.wind, m),
2145
+ gusts: this.computeNumber(B == null ? void 0 : B.properties.gusts, P.properties.gusts, m),
2146
+ hour: this.computeNumber(B == null ? void 0 : B.properties.hour, P.properties.hour, m),
2147
+ movement: this.computeNumber(B == null ? void 0 : B.properties.movement, P.properties.movement, m),
2148
+ pressure: this.computeNumber(B == null ? void 0 : B.properties.pressure, P.properties.pressure, m),
2149
+ wind: this.computeNumber(B == null ? void 0 : B.properties.wind, P.properties.wind, m),
2147
2150
  type: "forecast",
2148
2151
  disabled: T,
2149
2152
  showCircle: L
@@ -2177,23 +2180,23 @@ class t0 {
2177
2180
  * @param options
2178
2181
  */
2179
2182
  static diversionPassageAt(M, z, b, O = {}) {
2180
- const { t1: c, t2: p, hr: A, hours: o } = this.tropicalCenterTwin(z, 24, O);
2183
+ const { t1: c, t2: p, hr: A, hours: W } = this.tropicalCenterTwin(z, 24, O);
2181
2184
  if (c && p) {
2182
2185
  if (!O.debug) {
2183
- const N = f.calculateDistance(M, c), i = f.calculateDistance(M, p);
2186
+ const N = S.calculateDistance(M, c), i = S.calculateDistance(M, p);
2184
2187
  if (N > 2 * b && i > 2 * b)
2185
- return P == null || P.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need diversion: %j", O.requestId, N, i, {
2188
+ return E == null || E.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need diversion: %j", O.requestId, N, i, {
2186
2189
  from: M,
2187
2190
  t1: c,
2188
2191
  t2: p,
2189
2192
  hr: A
2190
2193
  }), {};
2191
2194
  }
2192
- const q = f.calculateBearing(M, c), Y = f.calculateBearing(c, p), d = Math.abs(q - Y);
2195
+ const q = S.calculateBearing(M, c), Y = S.calculateBearing(c, p), d = Math.abs(q - Y);
2193
2196
  let L = 0;
2194
2197
  d < 180 ? L = d + 90 : d >= 180 && (L = d - 90);
2195
- const T = f.calculateCoordinate(c, L, b);
2196
- return P == null || P.info("[%s] the right tangent position: %j", O.requestId, {
2198
+ const T = S.calculateCoordinate(c, L, b);
2199
+ return E == null || E.info("[%s] the right tangent position: %j", O.requestId, {
2197
2200
  from: M,
2198
2201
  t1: c,
2199
2202
  t2: p,
@@ -2201,7 +2204,7 @@ class t0 {
2201
2204
  bearing1: q,
2202
2205
  bearing2: Y,
2203
2206
  right: T
2204
- }), { at: T, t1: c, t2: p, hr: Number(A), hours: o };
2207
+ }), { at: T, t1: c, t2: p, hr: Number(A), hours: W };
2205
2208
  }
2206
2209
  return {};
2207
2210
  }
@@ -2216,22 +2219,22 @@ class t0 {
2216
2219
  * @param options
2217
2220
  */
2218
2221
  static driftPassageAt(M, z, b, O = {}) {
2219
- const { t1: c, t2: p, hr: A, hours: o } = this.tropicalCenterTwin(z, 24, O);
2222
+ const { t1: c, t2: p, hr: A, hours: W } = this.tropicalCenterTwin(z, 24, O);
2220
2223
  if (c && p) {
2221
2224
  if (!O.debug) {
2222
- const T = f.calculateDistance(M, c), N = f.calculateDistance(M, p);
2225
+ const T = S.calculateDistance(M, c), N = S.calculateDistance(M, p);
2223
2226
  if (T > 2 * b && N > 2 * b)
2224
- return P == null || P.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need drifting: %j", O.requestId, T, N, {
2227
+ return E == null || E.info("[%s] the distance between from and t1(%d) and t2(%d) is enough, no need drifting: %j", O.requestId, T, N, {
2225
2228
  from: M,
2226
2229
  t1: c,
2227
2230
  t2: p,
2228
2231
  hr: A
2229
2232
  }), {};
2230
2233
  }
2231
- const q = f.calculateBearing(M, c), Y = f.calculateBearing(c, p), d = f.calculateDistance(M, c);
2232
- return { at: f.calculateCoordinate(c, q - Y + 180, b < d ? b : d), t1: c, t2: p, hr: Number(A), hours: o };
2234
+ const q = S.calculateBearing(M, c), Y = S.calculateBearing(c, p), d = S.calculateDistance(M, c);
2235
+ return { at: S.calculateCoordinate(c, q - Y + 180, b < d ? b : d), t1: c, t2: p, hr: Number(A), hours: W };
2233
2236
  } else
2234
- return P == null || P.info("[%s] no need drift: %j", O.requestId, { from: M, t1: c, t2: p, hr: A }), {};
2237
+ return E == null || E.info("[%s] no need drift: %j", O.requestId, { from: M, t1: c, t2: p, hr: A }), {};
2235
2238
  }
2236
2239
  /**
2237
2240
  * 获取台风中心点对
@@ -2248,20 +2251,20 @@ class t0 {
2248
2251
  O = { ...i.hours, ...O };
2249
2252
  });
2250
2253
  const c = ((d = M == null ? void 0 : M.history) == null ? void 0 : d[0]) || (O == null ? void 0 : O[(L = Object.keys(O)) == null ? void 0 : L[0]]);
2251
- P == null || P.info("[%s] the first tropical center: %j", b.requestId, c);
2254
+ E == null || E.info("[%s] the first tropical center: %j", b.requestId, c);
2252
2255
  let p = (T = Object.keys(O || {}).filter((i) => Number(i) <= (z < 0 ? 24 : z))) == null ? void 0 : T.at(-1);
2253
2256
  p || (p = (N = Object.keys(O || {}).filter((i) => Number(i) <= (z < 0 ? 24 : 2 * z))) == null ? void 0 : N.at(-1));
2254
2257
  const A = O == null ? void 0 : O[p || -1];
2255
- P == null || P.info("[%s] the second tropical center: %j in %d hrs", b.requestId, A, p);
2256
- const o = Object.keys(O || {}).filter((i) => Number(i) <= Number(p)), q = { 0: c };
2257
- for (const i of o)
2258
+ E == null || E.info("[%s] the second tropical center: %j in %d hrs", b.requestId, A, p);
2259
+ const W = Object.keys(O || {}).filter((i) => Number(i) <= Number(p)), q = { 0: c };
2260
+ for (const i of W)
2258
2261
  q[i] = O[i];
2259
2262
  return { t1: c, t2: A, hr: Number(p), hours: q };
2260
2263
  }
2261
2264
  static pickIndex(M, z) {
2262
2265
  let b = 0;
2263
2266
  for (const O of M) {
2264
- if (E(O.properties.date).isAfter(z))
2267
+ if (s(O.properties.date).isAfter(z))
2265
2268
  return b === 0 ? -1 : b;
2266
2269
  b++;
2267
2270
  }
@@ -2289,7 +2292,7 @@ class V0 {
2289
2292
  return `${M.lat}|${M.lng}|${M.positionTime}|${M.sog}|${M.cog}|${M.hdg}|${M.draught}|${z}|${JSON.stringify(M.meteo || {})}|${M.vendor}|${M.deleted}`;
2290
2293
  }
2291
2294
  static str2Json(M) {
2292
- const [z, b, O, c, p, A, o, q, Y, d, L] = M.split("|");
2295
+ const [z, b, O, c, p, A, W, q, Y, d, L] = M.split("|");
2293
2296
  return {
2294
2297
  lat: Number(z),
2295
2298
  lng: Number(b),
@@ -2298,7 +2301,7 @@ class V0 {
2298
2301
  cog: Number(p),
2299
2302
  hdg: Number(A),
2300
2303
  //@ts-ignore
2301
- draught: isNaN(o) ? null : Number(o),
2304
+ draught: isNaN(W) ? null : Number(W),
2302
2305
  type: q,
2303
2306
  important: q !== "A",
2304
2307
  meteo: Y ? JSON.parse(Y) : void 0,
@@ -2308,21 +2311,21 @@ class V0 {
2308
2311
  }
2309
2312
  static inspectStoppages(M, z = 1, b = !0) {
2310
2313
  const O = M.at(0).positionTime < M.at(-1).positionTime;
2311
- O || M.sort((o, q) => o.positionTime - q.positionTime);
2314
+ O || M.sort((W, q) => W.positionTime - q.positionTime);
2312
2315
  const c = [];
2313
2316
  let p, A;
2314
- for (let o = 0; o < M.length - 1; o++) {
2315
- const q = M[o];
2317
+ for (let W = 0; W < M.length - 1; W++) {
2318
+ const q = M[W];
2316
2319
  if (!(b && ["N", "B", "E", "NOON", "BOSP", "EOSP"].includes(q.type))) {
2317
- for (let Y = o + 1; Y < M.length; Y++) {
2320
+ for (let Y = W + 1; Y < M.length; Y++) {
2318
2321
  const d = M[Y - 1], L = M[Y];
2319
2322
  if (b && ["N", "B", "E", "NOON", "BOSP", "EOSP"].includes(q.type))
2320
2323
  continue;
2321
2324
  const T = L.positionTime - d.positionTime;
2322
- if (f.calculateDistance(L, d, !0, 4) / (T / 3600) < z)
2323
- p || (p = q), Y === M.length - 1 && (A = L, o = Y);
2325
+ if (S.calculateDistance(L, d, !0, 4) / (T / 3600) < z)
2326
+ p || (p = q), Y === M.length - 1 && (A = L, W = Y);
2324
2327
  else {
2325
- p && (A = M[Y - 1], o = Y);
2328
+ p && (A = M[Y - 1], W = Y);
2326
2329
  break;
2327
2330
  }
2328
2331
  }
@@ -2333,28 +2336,28 @@ class V0 {
2333
2336
  lng: p.lng,
2334
2337
  sog: p.sog,
2335
2338
  positionTime: p.positionTime,
2336
- utc: E.unix(p.positionTime).utc().format()
2339
+ utc: s.unix(p.positionTime).utc().format()
2337
2340
  },
2338
2341
  end: {
2339
2342
  lat: A.lat,
2340
2343
  lng: A.lng,
2341
2344
  sog: A.sog,
2342
2345
  positionTime: A.positionTime,
2343
- utc: E.unix(A.positionTime).utc().format()
2346
+ utc: s.unix(A.positionTime).utc().format()
2344
2347
  },
2345
2348
  duration: A.positionTime - p.positionTime
2346
- }, d = M.filter((T) => T.positionTime >= Y.start.positionTime && T.positionTime <= Y.end.positionTime), L = f.divideAccordingToLng(d);
2347
- Y.distance = f.calculateRouteDistance(L), Y.hours = Math.round(Y.duration / 3600 * 10) / 10, Y.avgSog = Math.round(Y.distance / Y.hours * 10) / 10, c.push(Y);
2349
+ }, d = M.filter((T) => T.positionTime >= Y.start.positionTime && T.positionTime <= Y.end.positionTime), L = S.divideAccordingToLng(d);
2350
+ Y.distance = S.calculateRouteDistance(L), Y.hours = Math.round(Y.duration / 3600 * 10) / 10, Y.avgSog = Math.round(Y.distance / Y.hours * 10) / 10, c.push(Y);
2348
2351
  }
2349
2352
  p = void 0, A = void 0;
2350
2353
  }
2351
2354
  }
2352
- return O || M.sort((o, q) => q.positionTime - o.positionTime), c;
2355
+ return O || M.sort((W, q) => q.positionTime - W.positionTime), c;
2353
2356
  }
2354
2357
  }
2355
2358
  export {
2356
2359
  V0 as AisHelper,
2357
- f as LaneHelper,
2360
+ S as LaneHelper,
2358
2361
  X as LngLatHelper,
2359
2362
  t0 as TropicalHelper
2360
2363
  };