aviation-chart 0.1.21 → 0.1.23

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 jt from "maplibre-gl";
2
- var vt, Rt, Mt;
2
+ var vt, Rt, Pt;
3
3
  function Ot(o, r) {
4
4
  if (!vt)
5
5
  vt = r;
@@ -7,7 +7,7 @@ function Ot(o, r) {
7
7
  Rt = r;
8
8
  else {
9
9
  var d = "var sharedChunk = {}; (" + vt + ")(sharedChunk); (" + Rt + ")(sharedChunk);", y = {};
10
- vt(y), Mt = r(y), typeof window < "u" && (Mt.workerUrl = window.URL.createObjectURL(
10
+ vt(y), Pt = r(y), typeof window < "u" && (Pt.workerUrl = window.URL.createObjectURL(
11
11
  new Blob([d], { type: "text/javascript" })
12
12
  ));
13
13
  }
@@ -144,52 +144,52 @@ Ot(["exports"], function(o) {
144
144
  const a = i / (e.width - 1);
145
145
  let l, s, c, m, f, h;
146
146
  const u = {}, _ = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
147
- function P(M, I, R) {
148
- M[0] === 0 ? R(a * (h - 1), a * (f - g(c, I, l))) : M[0] === 2 ? R(a * h, a * (f - g(m, I, s))) : M[1] === 0 ? R(a * (h - g(s, I, l)), a * (f - 1)) : R(a * (h - g(m, I, c)), a * f);
147
+ function M(P, L, R) {
148
+ P[0] === 0 ? R(a * (h - 1), a * (f - g(c, L, l))) : P[0] === 2 ? R(a * h, a * (f - g(m, L, s))) : P[1] === 0 ? R(a * (h - g(s, L, l)), a * (f - 1)) : R(a * (h - g(m, L, c)), a * f);
149
149
  }
150
150
  for (f = 1 - n; f < e.height + n; f++) {
151
151
  s = e.get(0, f - 1), m = e.get(0, f);
152
- let M = Math.min(s, m), I = Math.max(s, m);
152
+ let P = Math.min(s, m), L = Math.max(s, m);
153
153
  for (h = 1 - n; h < e.width + n; h++) {
154
154
  l = s, c = m, s = e.get(h, f - 1), m = e.get(h, f);
155
- const R = M, V = I;
156
- if (M = Math.min(s, m), I = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
155
+ const R = P, V = L;
156
+ if (P = Math.min(s, m), L = Math.max(s, m), isNaN(l) || isNaN(s) || isNaN(m) || isNaN(c))
157
157
  continue;
158
- const dt = Math.min(R, M), pt = Math.max(V, I), X = Math.ceil(dt / t) * t, ot = Math.floor(pt / t) * t;
158
+ const dt = Math.min(R, P), pt = Math.max(V, L), X = Math.ceil(dt / t) * t, ot = Math.floor(pt / t) * t;
159
159
  for (let C = X; C <= ot; C += t) {
160
- const At = l > C, q = s > C, nt = c > C, _t = m > C;
161
- for (const bt of d[(At ? 8 : 0) | (q ? 4 : 0) | (_t ? 2 : 0) | (nt ? 1 : 0)]) {
162
- let Y = _.get(C);
163
- Y || _.set(C, Y = /* @__PURE__ */ new Map());
160
+ const kt = l > C, q = s > C, nt = c > C, _t = m > C;
161
+ for (const bt of d[(kt ? 8 : 0) | (q ? 4 : 0) | (_t ? 2 : 0) | (nt ? 1 : 0)]) {
162
+ let H = _.get(C);
163
+ H || _.set(C, H = /* @__PURE__ */ new Map());
164
164
  let lt = F.get(C);
165
165
  lt || F.set(C, lt = /* @__PURE__ */ new Map());
166
- const kt = bt[0], zt = bt[1], yt = y(e.width, h, f, kt), st = y(e.width, h, f, zt);
167
- let G, Tt;
168
- if (G = lt.get(yt))
169
- if (lt.delete(yt), Tt = Y.get(st))
170
- if (Y.delete(st), G === Tt) {
171
- if (P(zt, C, G.append), !G.isEmpty()) {
166
+ const At = bt[0], zt = bt[1], yt = y(e.width, h, f, At), st = y(e.width, h, f, zt);
167
+ let I, Tt;
168
+ if (I = lt.get(yt))
169
+ if (lt.delete(yt), Tt = H.get(st))
170
+ if (H.delete(st), I === Tt) {
171
+ if (M(zt, C, I.append), !I.isEmpty()) {
172
172
  let rt = u[C];
173
- rt || (u[C] = rt = []), rt.push(G.lineString());
173
+ rt || (u[C] = rt = []), rt.push(I.lineString());
174
174
  }
175
175
  } else
176
- G.appendFragment(Tt), lt.set(G.end = Tt.end, G);
176
+ I.appendFragment(Tt), lt.set(I.end = Tt.end, I);
177
177
  else
178
- P(zt, C, G.append), lt.set(G.end = st, G);
179
- else if (G = Y.get(st))
180
- Y.delete(st), P(kt, C, G.prepend), Y.set(G.start = yt, G);
178
+ M(zt, C, I.append), lt.set(I.end = st, I);
179
+ else if (I = H.get(st))
180
+ H.delete(st), M(At, C, I.prepend), H.set(I.start = yt, I);
181
181
  else {
182
182
  const rt = new r(yt, st);
183
- P(kt, C, rt.append), P(zt, C, rt.append), Y.set(yt, rt), lt.set(st, rt);
183
+ M(At, C, rt.append), M(zt, C, rt.append), H.set(yt, rt), lt.set(st, rt);
184
184
  }
185
185
  }
186
186
  }
187
187
  }
188
188
  }
189
- for (const [M, I] of _.entries()) {
189
+ for (const [P, L] of _.entries()) {
190
190
  let R = null;
191
- for (const V of I.values())
192
- V.isEmpty() || (R == null && (R = u[M] || (u[M] = [])), R.push(V.lineString()));
191
+ for (const V of L.values())
192
+ V.isEmpty() || (R == null && (R = u[P] || (u[P] = [])), R.push(V.lineString()));
193
193
  }
194
194
  return u;
195
195
  }
@@ -203,7 +203,7 @@ Ot(["exports"], function(o) {
203
203
  function O(t) {
204
204
  return Object.fromEntries(t.split("~").map((e) => e.split("*").map(Number)).map(([e, ...i]) => [e, i]));
205
205
  }
206
- function k({ thresholds: t, ...e }) {
206
+ function A({ thresholds: t, ...e }) {
207
207
  return b({ thresholds: S(t), ...e }).map(([i, n]) => `${encodeURIComponent(i)}=${encodeURIComponent(n)}`).join("&");
208
208
  }
209
209
  function z(t) {
@@ -247,7 +247,7 @@ Ot(["exports"], function(o) {
247
247
  return e && (a = new Float32Array(i.length), a.set(i)), { ...n, data: a, transferrables: [a.buffer] };
248
248
  });
249
249
  }
250
- function A(t) {
250
+ function k(t) {
251
251
  return t.then(({ arrayBuffer: e }) => {
252
252
  const i = T(e);
253
253
  return {
@@ -261,7 +261,7 @@ Ot(["exports"], function(o) {
261
261
  return j == null && (j = typeof OffscreenCanvas < "u" && new OffscreenCanvas(1, 1).getContext("2d") && typeof createImageBitmap == "function"), j || !1;
262
262
  }
263
263
  let tt = null;
264
- function H() {
264
+ function Y() {
265
265
  if (tt == null && (tt = !1, ct() && typeof VideoFrame < "u")) {
266
266
  const i = new OffscreenCanvas(5, 5).getContext("2d", { willReadFrequently: !0 });
267
267
  if (i) {
@@ -279,7 +279,7 @@ Ot(["exports"], function(o) {
279
279
  }
280
280
  return tt || !1;
281
281
  }
282
- function L(t, e, i) {
282
+ function G(t, e, i) {
283
283
  let n = () => {
284
284
  };
285
285
  const a = setTimeout(() => {
@@ -344,7 +344,7 @@ Ot(["exports"], function(o) {
344
344
  function W(t, e) {
345
345
  return K || (K = new OffscreenCanvas(t.width, t.height), et = K.getContext("2d", {
346
346
  willReadFrequently: !0
347
- })), Gt(t, e, K, et);
347
+ })), It(t, e, K, et);
348
348
  }
349
349
  async function xt(t, e, i) {
350
350
  var n, a, l;
@@ -379,7 +379,7 @@ Ot(["exports"], function(o) {
379
379
  B(i) || l(n), URL.revokeObjectURL(n.src), n.onload = null;
380
380
  }, n.onerror = () => s(new Error("Could not load image.")), n.src = t.size ? URL.createObjectURL(t) : "";
381
381
  });
382
- return Gt(a, e, N, it);
382
+ return It(a, e, N, it);
383
383
  }
384
384
  function te(t, e, i) {
385
385
  return self.actor.send("decodeImage", [], i, void 0, t, e);
@@ -391,8 +391,8 @@ Ot(["exports"], function(o) {
391
391
  self instanceof WorkerGlobalScope
392
392
  );
393
393
  }
394
- const It = H() ? xt : ct() ? at : ee() ? te : qt;
395
- function Gt(t, e, i, n) {
394
+ const Lt = Y() ? xt : ct() ? at : ee() ? te : qt;
395
+ function It(t, e, i, n) {
396
396
  if (i.width = t.width, i.height = t.height, !n)
397
397
  throw new Error("failed to get context");
398
398
  n.drawImage(t, 0, 0, t.width, t.height);
@@ -421,7 +421,7 @@ Ot(["exports"], function(o) {
421
421
  if (a <= 1)
422
422
  return this;
423
423
  const s = 0.5 - 1 / (2 * a), c = (m, f) => {
424
- const h = m / a - s, u = f / a - s, _ = Math.floor(h), F = Math.floor(u), P = this.get(_, F), M = this.get(_ + 1, F), I = this.get(_, F + 1), R = this.get(_ + 1, F + 1), V = h - _, dt = u - F, pt = l(P, M, V), X = l(I, R, V);
424
+ const h = m / a - s, u = f / a - s, _ = Math.floor(h), F = Math.floor(u), M = this.get(_, F), P = this.get(_ + 1, F), L = this.get(_, F + 1), R = this.get(_ + 1, F + 1), V = h - _, dt = u - F, pt = l(M, P, V), X = l(L, R, V);
425
425
  return l(pt, X, dt);
426
426
  };
427
427
  return new $(this.width * a, this.height * a, c);
@@ -488,19 +488,19 @@ Ot(["exports"], function(o) {
488
488
  }
489
489
  return (F ? -1 : 1) * s * Math.pow(2, l - n);
490
490
  }, Et.write = function(t, e, i, n, a, l) {
491
- var s, c, m, f = l * 8 - a - 1, h = (1 << f) - 1, u = h >> 1, _ = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = n ? 0 : l - 1, P = n ? 1 : -1, M = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
492
- for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -s)) < 1 && (s--, m *= 2), s + u >= 1 ? e += _ / m : e += _ * Math.pow(2, 1 - u), e * m >= 2 && (s++, m /= 2), s + u >= h ? (c = 0, s = h) : s + u >= 1 ? (c = (e * m - 1) * Math.pow(2, a), s = s + u) : (c = e * Math.pow(2, u - 1) * Math.pow(2, a), s = 0)); a >= 8; t[i + F] = c & 255, F += P, c /= 256, a -= 8)
491
+ var s, c, m, f = l * 8 - a - 1, h = (1 << f) - 1, u = h >> 1, _ = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = n ? 0 : l - 1, M = n ? 1 : -1, P = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
492
+ for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (c = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (m = Math.pow(2, -s)) < 1 && (s--, m *= 2), s + u >= 1 ? e += _ / m : e += _ * Math.pow(2, 1 - u), e * m >= 2 && (s++, m /= 2), s + u >= h ? (c = 0, s = h) : s + u >= 1 ? (c = (e * m - 1) * Math.pow(2, a), s = s + u) : (c = e * Math.pow(2, u - 1) * Math.pow(2, a), s = 0)); a >= 8; t[i + F] = c & 255, F += M, c /= 256, a -= 8)
493
493
  ;
494
- for (s = s << a | c, f += a; f > 0; t[i + F] = s & 255, F += P, s /= 256, f -= 8)
494
+ for (s = s << a | c, f += a; f > 0; t[i + F] = s & 255, F += M, s /= 256, f -= 8)
495
495
  ;
496
- t[i + F - P] |= M * 128;
496
+ t[i + F - M] |= P * 128;
497
497
  };
498
498
  var ne = v, gt = Et;
499
499
  function v(t) {
500
500
  this.buf = ArrayBuffer.isView && ArrayBuffer.isView(t) ? t : new Uint8Array(t || 0), this.pos = 0, this.type = 0, this.length = this.buf.length;
501
501
  }
502
502
  v.Varint = 0, v.Fixed64 = 1, v.Bytes = 2, v.Fixed32 = 5;
503
- var Ft = 65536 * 65536, Lt = 1 / Ft, le = 12, Bt = typeof TextDecoder > "u" ? null : new TextDecoder("utf8");
503
+ var Ft = 65536 * 65536, Gt = 1 / Ft, le = 12, Bt = typeof TextDecoder > "u" ? null : new TextDecoder("utf8");
504
504
  v.prototype = {
505
505
  destroy: function() {
506
506
  this.buf = null;
@@ -648,10 +648,10 @@ Ot(["exports"], function(o) {
648
648
  this.realloc(4), ft(this.buf, t, this.pos), this.pos += 4;
649
649
  },
650
650
  writeFixed64: function(t) {
651
- this.realloc(8), ft(this.buf, t & -1, this.pos), ft(this.buf, Math.floor(t * Lt), this.pos + 4), this.pos += 8;
651
+ this.realloc(8), ft(this.buf, t & -1, this.pos), ft(this.buf, Math.floor(t * Gt), this.pos + 4), this.pos += 8;
652
652
  },
653
653
  writeSFixed64: function(t) {
654
- this.realloc(8), ft(this.buf, t & -1, this.pos), ft(this.buf, Math.floor(t * Lt), this.pos + 4), this.pos += 8;
654
+ this.realloc(8), ft(this.buf, t & -1, this.pos), ft(this.buf, Math.floor(t * Gt), this.pos + 4), this.pos += 8;
655
655
  },
656
656
  writeVarint: function(t) {
657
657
  if (t = +t || 0, t > 268435455 || t < 0) {
@@ -877,13 +877,13 @@ Ot(["exports"], function(o) {
877
877
  for (const n of i.keys)
878
878
  e.writeStringField(3, n);
879
879
  for (const n of i.values)
880
- e.writeMessage(4, ke, n);
880
+ e.writeMessage(4, Ae, n);
881
881
  }
882
882
  function Fe(t, e) {
883
883
  const i = t.feature;
884
884
  if (!i || !e)
885
885
  throw new Error();
886
- e.writeMessage(2, Se, t), e.writeVarintField(3, i.type), e.writeMessage(4, Ae, i);
886
+ e.writeMessage(2, Se, t), e.writeVarintField(3, i.type), e.writeMessage(4, ke, i);
887
887
  }
888
888
  function Se(t, e) {
889
889
  const i = t.feature;
@@ -908,7 +908,7 @@ Ot(["exports"], function(o) {
908
908
  function Vt(t) {
909
909
  return t << 1 ^ t >> 31;
910
910
  }
911
- function Ae(t, e) {
911
+ function ke(t, e) {
912
912
  if (!e)
913
913
  throw new Error();
914
914
  const i = t.geometry, n = t.type;
@@ -925,20 +925,20 @@ Ot(["exports"], function(o) {
925
925
  n === ht.POLYGON && e.writeVarint(St(7, 1));
926
926
  }
927
927
  }
928
- function ke(t, e) {
928
+ function Ae(t, e) {
929
929
  if (!e)
930
930
  throw new Error();
931
931
  typeof t == "string" ? e.writeStringField(1, t) : typeof t == "boolean" ? e.writeBooleanField(7, t) : typeof t == "number" && (t % 1 !== 0 ? e.writeDoubleField(3, t) : t < 0 ? e.writeSVarintField(6, t) : e.writeVarintField(5, t));
932
932
  }
933
933
  class Re {
934
934
  constructor(e, i, n, a, l) {
935
- this.loaded = Promise.resolve(), this.decodeImage = It, this.fetchAndParseTile = (s, c, m, f, h) => {
935
+ this.loaded = Promise.resolve(), this.decodeImage = Lt, this.fetchAndParseTile = (s, c, m, f, h) => {
936
936
  const u = this, _ = this.demUrlPattern.replace("{z}", s.toString()).replace("{x}", c.toString()).replace("{y}", m.toString());
937
- return h == null || h.useTile(_), this.parsedCache.get(_, async (F, P) => {
938
- const M = await u.fetchTile(s, c, m, P, h);
939
- if (B(P))
937
+ return h == null || h.useTile(_), this.parsedCache.get(_, async (F, M) => {
938
+ const P = await u.fetchTile(s, c, m, M, h);
939
+ if (B(M))
940
940
  throw new Error("canceled");
941
- const I = u.decodeImage(M.data, u.encoding, P), R = h == null ? void 0 : h.marker("decode"), V = await I;
941
+ const L = u.decodeImage(P.data, u.encoding, M), R = h == null ? void 0 : h.marker("decode"), V = await L;
942
942
  return R == null || R(), V;
943
943
  }, f);
944
944
  }, this.tileCache = new Z(i), this.parsedCache = new Z(i), this.contourCache = new Z(i), this.timeoutMs = l, this.demUrlPattern = e, this.encoding = n, this.maxzoom = a;
@@ -951,7 +951,7 @@ Ot(["exports"], function(o) {
951
951
  };
952
952
  l == null || l.fetchTile(s);
953
953
  const h = l == null ? void 0 : l.marker("fetch");
954
- return L(this.timeoutMs, fetch(s, f).then(async (u) => {
954
+ return G(this.timeoutMs, fetch(s, f).then(async (u) => {
955
955
  if (h == null || h(), !u.ok)
956
956
  throw new Error(`Bad response: ${u.status} for ${s}`);
957
957
  return {
@@ -967,11 +967,11 @@ Ot(["exports"], function(o) {
967
967
  return $.fromRawDem(_).split(m, i % f, n % f);
968
968
  }
969
969
  fetchContourTile(e, i, n, a, l, s) {
970
- const { levels: c, multiplier: m = 1, buffer: f = 1, extent: h = 4096, contourLayer: u = "contours", elevationKey: _ = "ele", levelKey: F = "level", subsampleBelow: P = 100 } = a;
970
+ const { levels: c, multiplier: m = 1, buffer: f = 1, extent: h = 4096, contourLayer: u = "contours", elevationKey: _ = "ele", levelKey: F = "level", subsampleBelow: M = 100 } = a;
971
971
  if (!c || c.length === 0)
972
972
  return Promise.resolve({ arrayBuffer: new ArrayBuffer(0) });
973
- const M = [e, i, n, p(a)].join("/");
974
- return this.contourCache.get(M, async (I, R) => {
973
+ const P = [e, i, n, p(a)].join("/");
974
+ return this.contourCache.get(P, async (L, R) => {
975
975
  const V = 1 << e, dt = [];
976
976
  for (let q = n - 1; q <= n + 1; q++)
977
977
  for (let nt = i - 1; nt <= i + 1; nt++)
@@ -981,15 +981,15 @@ Ot(["exports"], function(o) {
981
981
  if (!X || B(R))
982
982
  return { arrayBuffer: new Uint8Array().buffer };
983
983
  const ot = s == null ? void 0 : s.marker("isoline");
984
- if (X.width >= P)
984
+ if (X.width >= M)
985
985
  X = X.materialize(2);
986
986
  else
987
- for (; X.width < P; )
987
+ for (; X.width < M; )
988
988
  X = X.subsamplePixelCenters(2).materialize(2);
989
989
  X = X.averagePixelCentersToGrid().scaleElevation(m).materialize(1);
990
990
  const C = w(c[0], X, h, f);
991
991
  ot == null || ot();
992
- const At = De({
992
+ const kt = De({
993
993
  extent: h,
994
994
  layers: {
995
995
  [u]: {
@@ -1000,26 +1000,26 @@ Ot(["exports"], function(o) {
1000
1000
  geometry: nt,
1001
1001
  properties: {
1002
1002
  [_]: _t,
1003
- [F]: Math.max(...c.map((bt, Y) => _t % bt === 0 ? Y : 0))
1003
+ [F]: Math.max(...c.map((bt, H) => _t % bt === 0 ? H : 0))
1004
1004
  }
1005
1005
  };
1006
1006
  })
1007
1007
  }
1008
1008
  }
1009
1009
  });
1010
- return ot == null || ot(), { arrayBuffer: At.buffer };
1010
+ return ot == null || ot(), { arrayBuffer: kt.buffer };
1011
1011
  }, l);
1012
1012
  }
1013
1013
  }
1014
1014
  const Q = typeof performance < "u" ? performance : void 0, Ce = Q ? Q.timeOrigin || (/* @__PURE__ */ new Date()).getTime() - Q.now() : (/* @__PURE__ */ new Date()).getTime();
1015
- function Pe(t) {
1015
+ function Me(t) {
1016
1016
  var e;
1017
1017
  return JSON.parse(JSON.stringify(((e = Q == null ? void 0 : Q.getEntriesByName) === null || e === void 0 ? void 0 : e.call(Q, t)) || []));
1018
1018
  }
1019
1019
  function Ut() {
1020
1020
  return Q ? Q.now() : (/* @__PURE__ */ new Date()).getTime();
1021
1021
  }
1022
- function Me(t) {
1022
+ function Pe(t) {
1023
1023
  const e = [];
1024
1024
  for (const i of t)
1025
1025
  e.push(...i);
@@ -1040,7 +1040,7 @@ Ot(["exports"], function(o) {
1040
1040
  marks: this.marks,
1041
1041
  resources: [
1042
1042
  ...this.resources,
1043
- ...Me(this.fetched.map(Pe))
1043
+ ...Pe(this.fetched.map(Me))
1044
1044
  ],
1045
1045
  duration: a,
1046
1046
  fetch: l,
@@ -1065,19 +1065,19 @@ Ot(["exports"], function(o) {
1065
1065
  const s = l;
1066
1066
  (this.marks[s] || (this.marks[s] = [])).push(...((n = i.marks[s]) === null || n === void 0 ? void 0 : n.map((m) => m.map((f) => f + a))) || []);
1067
1067
  }
1068
- this.resources.push(...i.resources.map((l) => Ie(l, a)));
1068
+ this.resources.push(...i.resources.map((l) => Le(l, a)));
1069
1069
  }, this.markFinish = this.marker(e);
1070
1070
  }
1071
1071
  }
1072
1072
  const Oe = /(Start$|End$|^start|^end)/;
1073
- function Ie(t, e) {
1073
+ function Le(t, e) {
1074
1074
  const i = {};
1075
1075
  for (const n in t)
1076
1076
  t[n] !== 0 && Oe.test(n) ? i[n] = Number(t[n]) + e : i[n] = t[n];
1077
1077
  return i;
1078
1078
  }
1079
- let Ge = 0;
1080
- class Le {
1079
+ let Ie = 0;
1080
+ class Ge {
1081
1081
  constructor(e, i, n = 2e4) {
1082
1082
  this.callbacks = {}, this.cancels = {}, this.dest = e, this.timeoutMs = n, this.dest.onmessage = async ({ data: a }) => {
1083
1083
  const l = a;
@@ -1121,31 +1121,31 @@ Ot(["exports"], function(o) {
1121
1121
  }
1122
1122
  /** Invokes a method by name with a set of arguments in the remote context. */
1123
1123
  send(e, i, n, a, ...l) {
1124
- const s = ++Ge, c = new Promise((m, f) => {
1124
+ const s = ++Ie, c = new Promise((m, f) => {
1125
1125
  this.postMessage({ id: s, type: "request", name: e, args: l }, i), this.callbacks[s] = (h, u, _) => {
1126
1126
  a == null || a.addAll(_), h ? f(h) : m(u);
1127
1127
  };
1128
1128
  });
1129
1129
  return U(n, () => {
1130
1130
  delete this.callbacks[s], this.postMessage({ id: s, type: "cancel" });
1131
- }), L(this.timeoutMs, c, n);
1131
+ }), G(this.timeoutMs, c, n);
1132
1132
  }
1133
1133
  }
1134
- o.A = Le, o.H = $, o.L = Re, o.T = Wt, o.a = z, o.b = w, o.c = Dt, o.d = It, o.e = k, o.f = A, o.g = x, o.p = D;
1134
+ o.A = Ge, o.H = $, o.L = Re, o.T = Wt, o.a = z, o.b = w, o.c = Dt, o.d = Lt, o.e = A, o.f = k, o.g = x, o.p = D;
1135
1135
  });
1136
1136
  Ot(["./shared"], function(o) {
1137
1137
  const r = (g) => Promise.reject(new Error(`No manager registered for ${g}`));
1138
1138
  class d {
1139
1139
  constructor() {
1140
- this.managers = {}, this.init = (w, b) => (this.managers[w.managerId] = new o.L(w.demUrlPattern, w.cacheSize, w.encoding, w.maxzoom, w.timeoutMs), Promise.resolve()), this.fetchTile = (w, b, S, O, k, z) => {
1140
+ this.managers = {}, this.init = (w, b) => (this.managers[w.managerId] = new o.L(w.demUrlPattern, w.cacheSize, w.encoding, w.maxzoom, w.timeoutMs), Promise.resolve()), this.fetchTile = (w, b, S, O, A, z) => {
1141
1141
  var p;
1142
- return ((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchTile(b, S, O, k, z)) || r(w);
1143
- }, this.fetchAndParseTile = (w, b, S, O, k, z) => {
1142
+ return ((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchTile(b, S, O, A, z)) || r(w);
1143
+ }, this.fetchAndParseTile = (w, b, S, O, A, z) => {
1144
1144
  var p;
1145
- return o.p(((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchAndParseTile(b, S, O, k, z)) || r(w), !0);
1146
- }, this.fetchContourTile = (w, b, S, O, k, z, p) => {
1145
+ return o.p(((p = this.managers[w]) === null || p === void 0 ? void 0 : p.fetchAndParseTile(b, S, O, A, z)) || r(w), !0);
1146
+ }, this.fetchContourTile = (w, b, S, O, A, z, p) => {
1147
1147
  var x;
1148
- return o.f(((x = this.managers[w]) === null || x === void 0 ? void 0 : x.fetchContourTile(b, S, O, k, z, p)) || r(w));
1148
+ return o.f(((x = this.managers[w]) === null || x === void 0 ? void 0 : x.fetchContourTile(b, S, O, A, z, p)) || r(w));
1149
1149
  };
1150
1150
  }
1151
1151
  }
@@ -1168,14 +1168,14 @@ Ot(["./shared"], function(o) {
1168
1168
  return d;
1169
1169
  }
1170
1170
  class b {
1171
- constructor(x, T, D, A, j, ct) {
1172
- this.fetchTile = (H, L, U, B, E) => this.actor.send("fetchTile", [], B, E, this.managerId, H, L, U), this.fetchAndParseTile = (H, L, U, B, E) => this.actor.send("fetchAndParseTile", [], B, E, this.managerId, H, L, U), this.fetchContourTile = (H, L, U, B, E, Z) => this.actor.send("fetchContourTile", [], E, Z, this.managerId, H, L, U, B);
1171
+ constructor(x, T, D, k, j, ct) {
1172
+ this.fetchTile = (Y, G, U, B, E) => this.actor.send("fetchTile", [], B, E, this.managerId, Y, G, U), this.fetchAndParseTile = (Y, G, U, B, E) => this.actor.send("fetchAndParseTile", [], B, E, this.managerId, Y, G, U), this.fetchContourTile = (Y, G, U, B, E, Z) => this.actor.send("fetchContourTile", [], E, Z, this.managerId, Y, G, U, B);
1173
1173
  const tt = this.managerId = ++y;
1174
1174
  this.actor = ct || w(), this.loaded = this.actor.send("init", [], new AbortController(), void 0, {
1175
1175
  cacheSize: T,
1176
1176
  demUrlPattern: x,
1177
1177
  encoding: D,
1178
- maxzoom: A,
1178
+ maxzoom: k,
1179
1179
  managerId: tt,
1180
1180
  timeoutMs: j
1181
1181
  });
@@ -1184,9 +1184,9 @@ Ot(["./shared"], function(o) {
1184
1184
  Blob.prototype.arrayBuffer || (Blob.prototype.arrayBuffer = function() {
1185
1185
  return new Promise((x, T) => {
1186
1186
  const D = new FileReader();
1187
- D.onload = (A) => {
1187
+ D.onload = (k) => {
1188
1188
  var j;
1189
- return x((j = A.target) === null || j === void 0 ? void 0 : j.result);
1189
+ return x((j = k.target) === null || j === void 0 ? void 0 : j.result);
1190
1190
  }, D.onerror = T, D.readAsArrayBuffer(this);
1191
1191
  });
1192
1192
  });
@@ -1195,11 +1195,11 @@ Ot(["./shared"], function(o) {
1195
1195
  return p(x, T);
1196
1196
  {
1197
1197
  const D = new AbortController();
1198
- return p(x, D).then((A) => T(void 0, A.data, A.cacheControl, A.expires), (A) => T(A)), { cancel: () => D.abort() };
1198
+ return p(x, D).then((k) => T(void 0, k.data, k.cacheControl, k.expires), (k) => T(k)), { cancel: () => D.abort() };
1199
1199
  }
1200
1200
  }, O = /* @__PURE__ */ new Set();
1201
- class k {
1202
- constructor({ url: x, cacheSize: T = 100, id: D = "dem", encoding: A = "terrarium", maxzoom: j = 12, worker: ct = !0, timeoutMs: tt = 1e4, actor: H }) {
1201
+ class A {
1202
+ constructor({ url: x, cacheSize: T = 100, id: D = "dem", encoding: k = "terrarium", maxzoom: j = 12, worker: ct = !0, timeoutMs: tt = 1e4, actor: Y }) {
1203
1203
  this.timingCallbacks = [], this.onTiming = (E) => {
1204
1204
  this.timingCallbacks.push(E);
1205
1205
  }, this.setupMaplibre = (E) => {
@@ -1231,24 +1231,24 @@ Ot(["./shared"], function(o) {
1231
1231
  this.timingCallbacks.forEach((N) => N(et));
1232
1232
  }
1233
1233
  }, this.contourProtocol = S(this.contourProtocolV4), this.sharedDemProtocol = S(this.sharedDemProtocolV4), this.contourProtocolUrl = (E) => `${this.contourProtocolUrlBase}?${o.e(E)}`;
1234
- let L = D, U = 1;
1235
- for (; O.has(L); )
1236
- L = D + U++;
1237
- O.add(L), this.sharedDemProtocolId = `${L}-shared`, this.contourProtocolId = `${L}-contour`, this.sharedDemProtocolUrl = `${this.sharedDemProtocolId}://{z}/{x}/{y}`, this.contourProtocolUrlBase = `${this.contourProtocolId}://{z}/{x}/{y}`;
1234
+ let G = D, U = 1;
1235
+ for (; O.has(G); )
1236
+ G = D + U++;
1237
+ O.add(G), this.sharedDemProtocolId = `${G}-shared`, this.contourProtocolId = `${G}-contour`, this.sharedDemProtocolUrl = `${this.sharedDemProtocolId}://{z}/{x}/{y}`, this.contourProtocolUrlBase = `${this.contourProtocolId}://{z}/{x}/{y}`;
1238
1238
  const B = ct ? b : o.L;
1239
- this.manager = new B(x, T, A, j, tt, H);
1239
+ this.manager = new B(x, T, k, j, tt, Y);
1240
1240
  }
1241
- getDemTile(x, T, D, A) {
1242
- return this.manager.fetchAndParseTile(x, T, D, A || new AbortController());
1241
+ getDemTile(x, T, D, k) {
1242
+ return this.manager.fetchAndParseTile(x, T, D, k || new AbortController());
1243
1243
  }
1244
1244
  parseUrl(x) {
1245
- const [, T, D, A] = /\/\/(\d+)\/(\d+)\/(\d+)/.exec(x) || [];
1246
- return [Number(T), Number(D), Number(A)];
1245
+ const [, T, D, k] = /\/\/(\d+)\/(\d+)\/(\d+)/.exec(x) || [];
1246
+ return [Number(T), Number(D), Number(k)];
1247
1247
  }
1248
1248
  }
1249
1249
  return {
1250
1250
  generateIsolines: o.b,
1251
- DemSource: k,
1251
+ DemSource: A,
1252
1252
  HeightTile: o.H,
1253
1253
  LocalDemManager: o.L,
1254
1254
  decodeParsedImage: o.c,
@@ -1260,7 +1260,7 @@ Ot(["./shared"], function(o) {
1260
1260
  }
1261
1261
  };
1262
1262
  });
1263
- var Be = Mt;
1263
+ var Be = Pt;
1264
1264
  function Xe(o) {
1265
1265
  return o;
1266
1266
  }
@@ -1269,8 +1269,8 @@ function Ne(o) {
1269
1269
  var r, d, y = o.scale[0], g = o.scale[1], w = o.translate[0], b = o.translate[1];
1270
1270
  return function(S, O) {
1271
1271
  O || (r = d = 0);
1272
- var k = 2, z = S.length, p = new Array(z);
1273
- for (p[0] = (r += S[0]) * y + w, p[1] = (d += S[1]) * g + b; k < z; ) p[k] = S[k], ++k;
1272
+ var A = 2, z = S.length, p = new Array(z);
1273
+ for (p[0] = (r += S[0]) * y + w, p[1] = (d += S[1]) * g + b; A < z; ) p[A] = S[A], ++A;
1274
1274
  return p;
1275
1275
  };
1276
1276
  }
@@ -1308,11 +1308,11 @@ function Ue(o, r) {
1308
1308
  function O(z) {
1309
1309
  return z.map(S);
1310
1310
  }
1311
- function k(z) {
1311
+ function A(z) {
1312
1312
  var p = z.type, x;
1313
1313
  switch (p) {
1314
1314
  case "GeometryCollection":
1315
- return { type: p, geometries: z.geometries.map(k) };
1315
+ return { type: p, geometries: z.geometries.map(A) };
1316
1316
  case "Point":
1317
1317
  x = w(z.coordinates);
1318
1318
  break;
@@ -1336,7 +1336,7 @@ function Ue(o, r) {
1336
1336
  }
1337
1337
  return { type: p, coordinates: x };
1338
1338
  }
1339
- return k(r);
1339
+ return A(r);
1340
1340
  }
1341
1341
  const We = {
1342
1342
  airspaceStroke: "#AAB7B8",
@@ -1491,13 +1491,6 @@ function je() {
1491
1491
  source: o,
1492
1492
  "source-layer": "controlled-fill",
1493
1493
  minzoom: 4,
1494
- filter: [
1495
- "all",
1496
- ["!=", ["get", "CODE_TYPE"], "CTA"],
1497
- ["!=", ["get", "CODE_TYPE"], "ARSA"],
1498
- ["!=", ["get", "CODE_TYPE"], "TCA"],
1499
- ["!=", ["get", "CODE_TYPE"], "TRSA"]
1500
- ],
1501
1494
  paint: {
1502
1495
  "fill-color": r.controlledFill,
1503
1496
  "fill-opacity": [
@@ -1520,12 +1513,6 @@ function je() {
1520
1513
  type: "line",
1521
1514
  source: o,
1522
1515
  "source-layer": "controlled",
1523
- filter: [
1524
- "all",
1525
- ["!=", ["get", "CODE_TYPE"], "ARSA"],
1526
- ["!=", ["get", "CODE_TYPE"], "TCA"],
1527
- ["!=", ["get", "CODE_TYPE"], "TRSA"]
1528
- ],
1529
1516
  paint: {
1530
1517
  "line-color": r.controlledStroke,
1531
1518
  "line-width": 1,
@@ -1538,12 +1525,6 @@ function je() {
1538
1525
  },
1539
1526
  {
1540
1527
  id: "controlled-label",
1541
- filter: [
1542
- "all",
1543
- ["!=", ["get", "CODE_TYPE"], "ARSA"],
1544
- ["!=", ["get", "CODE_TYPE"], "TCA"],
1545
- ["!=", ["get", "CODE_TYPE"], "TRSA"]
1546
- ],
1547
1528
  type: "symbol",
1548
1529
  source: o,
1549
1530
  "source-layer": "controlled",
@@ -2506,7 +2487,7 @@ const ut = {
2506
2487
  light: { id: "light", label: "日间", background: "#EAF2F8", build: je },
2507
2488
  dark: { id: "dark", label: "夜间", background: "#000000", build: Ke }
2508
2489
  };
2509
- function Yt(o = "light") {
2490
+ function Ht(o = "light") {
2510
2491
  return (ut[o] ?? ut.light).build();
2511
2492
  }
2512
2493
  const Ct = {
@@ -2521,7 +2502,7 @@ const Ct = {
2521
2502
  ndb: ["ndb-symbol"],
2522
2503
  airport: ["airport-circle", "airport-label"],
2523
2504
  runway: ["runway-line", "runway-line-amm", "runway-label"]
2524
- }, Ye = {
2505
+ }, He = {
2525
2506
  /** 机场边界(淡暖灰垫底,在纯白底上显现轮廓) */
2526
2507
  airport: "#e2e8f0",
2527
2508
  /** 跑道面(中深灰,作为白底上的绝对重心) */
@@ -2547,8 +2528,8 @@ const Ct = {
2547
2528
  /** 事故易发区(深橙色) */
2548
2529
  hotspot: "#ea580c"
2549
2530
  };
2550
- function He(o = "amm") {
2551
- const r = Ye;
2531
+ function Ye(o = "amm") {
2532
+ const r = He;
2552
2533
  return [
2553
2534
  // ── 机场边界轮廓(z11+)
2554
2535
  {
@@ -3163,8 +3144,8 @@ function qe(o = "amm") {
3163
3144
  }
3164
3145
  ];
3165
3146
  }
3166
- function Ht(o = "amm", r = "light") {
3167
- return r === "dark" ? Je(o) : r === "neutral" ? qe(o) : He(o);
3147
+ function Yt(o = "amm", r = "light") {
3148
+ return r === "dark" ? Je(o) : r === "neutral" ? qe(o) : Ye(o);
3168
3149
  }
3169
3150
  const oi = {
3170
3151
  ammAirport: ["amm-airport-fill", "amm-airport-stroke"],
@@ -3207,7 +3188,7 @@ const oi = {
3207
3188
  "#9c6b3f",
3208
3189
  4500,
3209
3190
  "#f2efe9"
3210
- ], Pt = [
3191
+ ], Mt = [
3211
3192
  "amm-airport-fill",
3212
3193
  "amm-airport-stroke",
3213
3194
  "amm-runway-fill",
@@ -3268,10 +3249,10 @@ class ri {
3268
3249
  period: b = null,
3269
3250
  layers: S = {},
3270
3251
  center: O = [104, 36],
3271
- zoom: k = 4,
3252
+ zoom: A = 4,
3272
3253
  terrainUrl: z = null
3273
3254
  } = r;
3274
- return this._apiUrl = g.replace(/\/$/, ""), this._spriteUrl = (w ?? g).replace(/\/$/, ""), this._terrainUrl = z ?? `${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`, this._theme = y, this._period = b, this._center = O, this._zoom = k, this._ready = !1, this._layerVisible = {
3255
+ return this._apiUrl = g.replace(/\/$/, ""), this._spriteUrl = (w ?? g).replace(/\/$/, ""), this._terrainUrl = z ?? `${this._apiUrl}/api/terrain/{z}/{x}/{y}.png`, this._theme = y, this._period = b, this._center = O, this._zoom = A, this._ready = !1, this._layerVisible = {
3275
3256
  // aviation groups — all visible by default
3276
3257
  adiz: !0,
3277
3258
  fir: !0,
@@ -3293,8 +3274,8 @@ class ri {
3293
3274
  }, this._initMap(d), new Proxy(this, {
3294
3275
  get(p, x) {
3295
3276
  if (typeof x == "symbol" || Reflect.has(p, x)) {
3296
- const A = p[x];
3297
- return typeof A == "function" ? A.bind(p) : A;
3277
+ const k = p[x];
3278
+ return typeof k == "function" ? k.bind(p) : k;
3298
3279
  }
3299
3280
  const T = p._map;
3300
3281
  if (!T) return;
@@ -3455,9 +3436,11 @@ class ri {
3455
3436
  "text-halo-width": 1
3456
3437
  }
3457
3438
  }), this._layerVisible.terrain && this._map.setTerrain({ source: "terrain", exaggeration: 4 });
3458
- for (const y of Yt(this._theme))
3439
+ for (const y of Ht(this._theme))
3459
3440
  this._map.getLayer(y.id) || this._map.addLayer(y);
3460
- for (const y of Ht("amm", this._theme))
3441
+ for (const y of ["terrain-color", "terrain-hillshade", "contour-line", "contour-label"])
3442
+ this._map.getLayer(y) && this._map.getLayer("boundary") && this._map.moveLayer(y, "boundary");
3443
+ for (const y of Yt("amm", this._theme))
3461
3444
  this._map.getLayer(y.id) || this._map.addLayer(y, "fir-line");
3462
3445
  }
3463
3446
  _applyVisibility() {
@@ -3467,7 +3450,7 @@ class ri {
3467
3450
  this._map.getLayer(S) && this._map.setLayoutProperty(S, "visibility", b);
3468
3451
  }
3469
3452
  const r = this._layerVisible.amm !== !1 ? "visible" : "none";
3470
- for (const g of Pt)
3453
+ for (const g of Mt)
3471
3454
  this._map.getLayer(g) && this._map.setLayoutProperty(g, "visibility", r);
3472
3455
  const d = this._layerVisible.terrain ? "visible" : "none";
3473
3456
  for (const g of Zt)
@@ -3502,13 +3485,13 @@ class ri {
3502
3485
  "landLaye",
3503
3486
  "boundary",
3504
3487
  ...Object.values(Ct).flat(),
3505
- ...Pt
3488
+ ...Mt
3506
3489
  ];
3507
3490
  for (const g of y)
3508
3491
  this._map.getLayer(g) && this._map.removeLayer(g);
3509
- for (const g of Yt(this._theme))
3492
+ for (const g of Ht(this._theme))
3510
3493
  this._map.addLayer(g);
3511
- for (const g of Ht("amm", this._theme))
3494
+ for (const g of Yt("amm", this._theme))
3512
3495
  this._map.getLayer(g.id) || this._map.addLayer(g, "fir-line");
3513
3496
  this._applyVisibility();
3514
3497
  }
@@ -3539,7 +3522,7 @@ class ri {
3539
3522
  }
3540
3523
  if (r === "amm") {
3541
3524
  const w = d ? "visible" : "none";
3542
- for (const b of Pt)
3525
+ for (const b of Mt)
3543
3526
  this._map.getLayer(b) && this._map.setLayoutProperty(b, "visibility", w);
3544
3527
  return;
3545
3528
  }