cool-globe 0.1.3 → 0.1.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.
@@ -1,99 +1,99 @@
1
- import { jsx as Fe } from "react/jsx-runtime";
2
- import { useRef as B, useState as T, useEffect as P, useMemo as se } from "react";
3
- import un from "react-globe.gl";
4
- import { Color as we } from "three";
5
- function ln(e) {
1
+ import { jsx as Oe } from "react/jsx-runtime";
2
+ import { useRef as V, useState as G, useEffect as z, useMemo as se, useCallback as ve } from "react";
3
+ import xn from "react-globe.gl";
4
+ import { Color as Ne } from "three";
5
+ function bn(e) {
6
6
  return e;
7
7
  }
8
- function dn(e) {
9
- if (e == null) return ln;
10
- var n, t, r = e.scale[0], i = e.scale[1], a = e.translate[0], o = e.translate[1];
11
- return function(s, l) {
8
+ function yn(e) {
9
+ if (e == null) return bn;
10
+ var n, t, r = e.scale[0], i = e.scale[1], o = e.translate[0], s = e.translate[1];
11
+ return function(a, l) {
12
12
  l || (n = t = 0);
13
- var f = 2, h = s.length, u = new Array(h);
14
- for (u[0] = (n += s[0]) * r + a, u[1] = (t += s[1]) * i + o; f < h; ) u[f] = s[f], ++f;
15
- return u;
13
+ var f = 2, d = a.length, c = new Array(d);
14
+ for (c[0] = (n += a[0]) * r + o, c[1] = (t += a[1]) * i + s; f < d; ) c[f] = a[f], ++f;
15
+ return c;
16
16
  };
17
17
  }
18
- function hn(e, n) {
18
+ function wn(e, n) {
19
19
  for (var t, r = e.length, i = r - n; i < --r; ) t = e[i], e[i++] = e[r], e[r] = t;
20
20
  }
21
- function mn(e, n) {
21
+ function vn(e, n) {
22
22
  return typeof n == "string" && (n = e.objects[n]), n.type === "GeometryCollection" ? { type: "FeatureCollection", features: n.geometries.map(function(t) {
23
- return Pe(e, t);
24
- }) } : Pe(e, n);
25
- }
26
- function Pe(e, n) {
27
- var t = n.id, r = n.bbox, i = n.properties == null ? {} : n.properties, a = gn(e, n);
28
- return t == null && r == null ? { type: "Feature", properties: i, geometry: a } : r == null ? { type: "Feature", id: t, properties: i, geometry: a } : { type: "Feature", id: t, bbox: r, properties: i, geometry: a };
29
- }
30
- function gn(e, n) {
31
- var t = dn(e.transform), r = e.arcs;
32
- function i(h, u) {
33
- u.length && u.pop();
34
- for (var d = r[h < 0 ? ~h : h], w = 0, v = d.length; w < v; ++w)
35
- u.push(t(d[w], w));
36
- h < 0 && hn(u, v);
23
+ return ze(e, t);
24
+ }) } : ze(e, n);
25
+ }
26
+ function ze(e, n) {
27
+ var t = n.id, r = n.bbox, i = n.properties == null ? {} : n.properties, o = Nn(e, n);
28
+ return t == null && r == null ? { type: "Feature", properties: i, geometry: o } : r == null ? { type: "Feature", id: t, properties: i, geometry: o } : { type: "Feature", id: t, bbox: r, properties: i, geometry: o };
29
+ }
30
+ function Nn(e, n) {
31
+ var t = yn(e.transform), r = e.arcs;
32
+ function i(d, c) {
33
+ c.length && c.pop();
34
+ for (var h = r[d < 0 ? ~d : d], N = 0, k = h.length; N < k; ++N)
35
+ c.push(t(h[N], N));
36
+ d < 0 && wn(c, k);
37
37
  }
38
- function a(h) {
39
- return t(h);
38
+ function o(d) {
39
+ return t(d);
40
40
  }
41
- function o(h) {
42
- for (var u = [], d = 0, w = h.length; d < w; ++d) i(h[d], u);
43
- return u.length < 2 && u.push(u[0]), u;
41
+ function s(d) {
42
+ for (var c = [], h = 0, N = d.length; h < N; ++h) i(d[h], c);
43
+ return c.length < 2 && c.push(c[0]), c;
44
44
  }
45
- function s(h) {
46
- for (var u = o(h); u.length < 4; ) u.push(u[0]);
47
- return u;
45
+ function a(d) {
46
+ for (var c = s(d); c.length < 4; ) c.push(c[0]);
47
+ return c;
48
48
  }
49
- function l(h) {
50
- return h.map(s);
49
+ function l(d) {
50
+ return d.map(a);
51
51
  }
52
- function f(h) {
53
- var u = h.type, d;
54
- switch (u) {
52
+ function f(d) {
53
+ var c = d.type, h;
54
+ switch (c) {
55
55
  case "GeometryCollection":
56
- return { type: u, geometries: h.geometries.map(f) };
56
+ return { type: c, geometries: d.geometries.map(f) };
57
57
  case "Point":
58
- d = a(h.coordinates);
58
+ h = o(d.coordinates);
59
59
  break;
60
60
  case "MultiPoint":
61
- d = h.coordinates.map(a);
61
+ h = d.coordinates.map(o);
62
62
  break;
63
63
  case "LineString":
64
- d = o(h.arcs);
64
+ h = s(d.arcs);
65
65
  break;
66
66
  case "MultiLineString":
67
- d = h.arcs.map(o);
67
+ h = d.arcs.map(s);
68
68
  break;
69
69
  case "Polygon":
70
- d = l(h.arcs);
70
+ h = l(d.arcs);
71
71
  break;
72
72
  case "MultiPolygon":
73
- d = h.arcs.map(l);
73
+ h = d.arcs.map(l);
74
74
  break;
75
75
  default:
76
76
  return null;
77
77
  }
78
- return { type: u, coordinates: d };
78
+ return { type: c, coordinates: h };
79
79
  }
80
80
  return f(n);
81
81
  }
82
- const pn = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_110m_admin_0_countries.geojson", xn = "https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json", bn = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_admin_1_states_provinces.geojson", yn = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='4'><rect width='4' height='4' fill='%23f5f5f5'/></svg>", wn = {
82
+ const Mn = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_110m_admin_0_countries.geojson", _n = "https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json", $n = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_admin_1_states_provinces.geojson", Rn = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='4'><rect width='4' height='4' fill='%23f5f5f5'/></svg>", Cn = {
83
83
  minColor: "#f8fafc",
84
84
  maxColor: "#e5e7eb"
85
85
  };
86
- function Ae(e, n, t) {
86
+ function Ee(e, n, t) {
87
87
  e.prototype = n.prototype = t, t.constructor = e;
88
88
  }
89
- function Qe(e, n) {
89
+ function on(e, n) {
90
90
  var t = Object.create(e.prototype);
91
91
  for (var r in n) t[r] = n[r];
92
92
  return t;
93
93
  }
94
94
  function te() {
95
95
  }
96
- var Q = 0.7, de = 1 / Q, J = "\\s*([+-]?\\d+)\\s*", ee = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", S = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", vn = /^#([0-9a-f]{3,8})$/, Nn = new RegExp(`^rgb\\(${J},${J},${J}\\)$`), Mn = new RegExp(`^rgb\\(${S},${S},${S}\\)$`), _n = new RegExp(`^rgba\\(${J},${J},${J},${ee}\\)$`), $n = new RegExp(`^rgba\\(${S},${S},${S},${ee}\\)$`), Rn = new RegExp(`^hsl\\(${ee},${S},${S}\\)$`), kn = new RegExp(`^hsla\\(${ee},${S},${S},${ee}\\)$`), Oe = {
96
+ var Q = 0.7, me = 1 / Q, X = "\\s*([+-]?\\d+)\\s*", ee = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", j = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", kn = /^#([0-9a-f]{3,8})$/, Ln = new RegExp(`^rgb\\(${X},${X},${X}\\)$`), An = new RegExp(`^rgb\\(${j},${j},${j}\\)$`), Sn = new RegExp(`^rgba\\(${X},${X},${X},${ee}\\)$`), En = new RegExp(`^rgba\\(${j},${j},${j},${ee}\\)$`), In = new RegExp(`^hsl\\(${ee},${j},${j}\\)$`), Fn = new RegExp(`^hsla\\(${ee},${j},${j},${ee}\\)$`), He = {
97
97
  aliceblue: 15792383,
98
98
  antiquewhite: 16444375,
99
99
  aqua: 65535,
@@ -243,243 +243,243 @@ var Q = 0.7, de = 1 / Q, J = "\\s*([+-]?\\d+)\\s*", ee = "\\s*([+-]?(?:\\d*\\.)?
243
243
  yellow: 16776960,
244
244
  yellowgreen: 10145074
245
245
  };
246
- Ae(te, ne, {
246
+ Ee(te, ne, {
247
247
  copy(e) {
248
248
  return Object.assign(new this.constructor(), this, e);
249
249
  },
250
250
  displayable() {
251
251
  return this.rgb().displayable();
252
252
  },
253
- hex: ze,
253
+ hex: Te,
254
254
  // Deprecated! Use color.formatHex.
255
- formatHex: ze,
256
- formatHex8: Cn,
257
- formatHsl: Ln,
258
- formatRgb: He,
259
- toString: He
255
+ formatHex: Te,
256
+ formatHex8: jn,
257
+ formatHsl: Pn,
258
+ formatRgb: Ge,
259
+ toString: Ge
260
260
  });
261
- function ze() {
261
+ function Te() {
262
262
  return this.rgb().formatHex();
263
263
  }
264
- function Cn() {
264
+ function jn() {
265
265
  return this.rgb().formatHex8();
266
266
  }
267
- function Ln() {
268
- return en(this).formatHsl();
267
+ function Pn() {
268
+ return an(this).formatHsl();
269
269
  }
270
- function He() {
270
+ function Ge() {
271
271
  return this.rgb().formatRgb();
272
272
  }
273
273
  function ne(e) {
274
274
  var n, t;
275
- return e = (e + "").trim().toLowerCase(), (n = vn.exec(e)) ? (t = n[1].length, n = parseInt(n[1], 16), t === 6 ? Te(n) : t === 3 ? new $(n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, (n & 15) << 4 | n & 15, 1) : t === 8 ? fe(n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, (n & 255) / 255) : t === 4 ? fe(n >> 12 & 15 | n >> 8 & 240, n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, ((n & 15) << 4 | n & 15) / 255) : null) : (n = Nn.exec(e)) ? new $(n[1], n[2], n[3], 1) : (n = Mn.exec(e)) ? new $(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, 1) : (n = _n.exec(e)) ? fe(n[1], n[2], n[3], n[4]) : (n = $n.exec(e)) ? fe(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, n[4]) : (n = Rn.exec(e)) ? De(n[1], n[2] / 100, n[3] / 100, 1) : (n = kn.exec(e)) ? De(n[1], n[2] / 100, n[3] / 100, n[4]) : Oe.hasOwnProperty(e) ? Te(Oe[e]) : e === "transparent" ? new $(NaN, NaN, NaN, 0) : null;
275
+ return e = (e + "").trim().toLowerCase(), (n = kn.exec(e)) ? (t = n[1].length, n = parseInt(n[1], 16), t === 6 ? Ue(n) : t === 3 ? new C(n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, (n & 15) << 4 | n & 15, 1) : t === 8 ? fe(n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, (n & 255) / 255) : t === 4 ? fe(n >> 12 & 15 | n >> 8 & 240, n >> 8 & 15 | n >> 4 & 240, n >> 4 & 15 | n & 240, ((n & 15) << 4 | n & 15) / 255) : null) : (n = Ln.exec(e)) ? new C(n[1], n[2], n[3], 1) : (n = An.exec(e)) ? new C(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, 1) : (n = Sn.exec(e)) ? fe(n[1], n[2], n[3], n[4]) : (n = En.exec(e)) ? fe(n[1] * 255 / 100, n[2] * 255 / 100, n[3] * 255 / 100, n[4]) : (n = In.exec(e)) ? Ve(n[1], n[2] / 100, n[3] / 100, 1) : (n = Fn.exec(e)) ? Ve(n[1], n[2] / 100, n[3] / 100, n[4]) : He.hasOwnProperty(e) ? Ue(He[e]) : e === "transparent" ? new C(NaN, NaN, NaN, 0) : null;
276
276
  }
277
- function Te(e) {
278
- return new $(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
277
+ function Ue(e) {
278
+ return new C(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
279
279
  }
280
280
  function fe(e, n, t, r) {
281
- return r <= 0 && (e = n = t = NaN), new $(e, n, t, r);
281
+ return r <= 0 && (e = n = t = NaN), new C(e, n, t, r);
282
282
  }
283
- function An(e) {
284
- return e instanceof te || (e = ne(e)), e ? (e = e.rgb(), new $(e.r, e.g, e.b, e.opacity)) : new $();
283
+ function On(e) {
284
+ return e instanceof te || (e = ne(e)), e ? (e = e.rgb(), new C(e.r, e.g, e.b, e.opacity)) : new C();
285
285
  }
286
- function $e(e, n, t, r) {
287
- return arguments.length === 1 ? An(e) : new $(e, n, t, r ?? 1);
286
+ function Ce(e, n, t, r) {
287
+ return arguments.length === 1 ? On(e) : new C(e, n, t, r ?? 1);
288
288
  }
289
- function $(e, n, t, r) {
289
+ function C(e, n, t, r) {
290
290
  this.r = +e, this.g = +n, this.b = +t, this.opacity = +r;
291
291
  }
292
- Ae($, $e, Qe(te, {
292
+ Ee(C, Ce, on(te, {
293
293
  brighter(e) {
294
- return e = e == null ? de : Math.pow(de, e), new $(this.r * e, this.g * e, this.b * e, this.opacity);
294
+ return e = e == null ? me : Math.pow(me, e), new C(this.r * e, this.g * e, this.b * e, this.opacity);
295
295
  },
296
296
  darker(e) {
297
- return e = e == null ? Q : Math.pow(Q, e), new $(this.r * e, this.g * e, this.b * e, this.opacity);
297
+ return e = e == null ? Q : Math.pow(Q, e), new C(this.r * e, this.g * e, this.b * e, this.opacity);
298
298
  },
299
299
  rgb() {
300
300
  return this;
301
301
  },
302
302
  clamp() {
303
- return new $(U(this.r), U(this.g), U(this.b), he(this.opacity));
303
+ return new C(Z(this.r), Z(this.g), Z(this.b), he(this.opacity));
304
304
  },
305
305
  displayable() {
306
306
  return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
307
307
  },
308
- hex: Ge,
308
+ hex: De,
309
309
  // Deprecated! Use color.formatHex.
310
- formatHex: Ge,
311
- formatHex8: Sn,
312
- formatRgb: Ue,
313
- toString: Ue
310
+ formatHex: De,
311
+ formatHex8: zn,
312
+ formatRgb: qe,
313
+ toString: qe
314
314
  }));
315
- function Ge() {
316
- return `#${G(this.r)}${G(this.g)}${G(this.b)}`;
315
+ function De() {
316
+ return `#${B(this.r)}${B(this.g)}${B(this.b)}`;
317
317
  }
318
- function Sn() {
319
- return `#${G(this.r)}${G(this.g)}${G(this.b)}${G((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
318
+ function zn() {
319
+ return `#${B(this.r)}${B(this.g)}${B(this.b)}${B((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
320
320
  }
321
- function Ue() {
321
+ function qe() {
322
322
  const e = he(this.opacity);
323
- return `${e === 1 ? "rgb(" : "rgba("}${U(this.r)}, ${U(this.g)}, ${U(this.b)}${e === 1 ? ")" : `, ${e})`}`;
323
+ return `${e === 1 ? "rgb(" : "rgba("}${Z(this.r)}, ${Z(this.g)}, ${Z(this.b)}${e === 1 ? ")" : `, ${e})`}`;
324
324
  }
325
325
  function he(e) {
326
326
  return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
327
327
  }
328
- function U(e) {
328
+ function Z(e) {
329
329
  return Math.max(0, Math.min(255, Math.round(e) || 0));
330
330
  }
331
- function G(e) {
332
- return e = U(e), (e < 16 ? "0" : "") + e.toString(16);
331
+ function B(e) {
332
+ return e = Z(e), (e < 16 ? "0" : "") + e.toString(16);
333
333
  }
334
- function De(e, n, t, r) {
335
- return r <= 0 ? e = n = t = NaN : t <= 0 || t >= 1 ? e = n = NaN : n <= 0 && (e = NaN), new L(e, n, t, r);
334
+ function Ve(e, n, t, r) {
335
+ return r <= 0 ? e = n = t = NaN : t <= 0 || t >= 1 ? e = n = NaN : n <= 0 && (e = NaN), new E(e, n, t, r);
336
336
  }
337
- function en(e) {
338
- if (e instanceof L) return new L(e.h, e.s, e.l, e.opacity);
339
- if (e instanceof te || (e = ne(e)), !e) return new L();
340
- if (e instanceof L) return e;
337
+ function an(e) {
338
+ if (e instanceof E) return new E(e.h, e.s, e.l, e.opacity);
339
+ if (e instanceof te || (e = ne(e)), !e) return new E();
340
+ if (e instanceof E) return e;
341
341
  e = e.rgb();
342
- var n = e.r / 255, t = e.g / 255, r = e.b / 255, i = Math.min(n, t, r), a = Math.max(n, t, r), o = NaN, s = a - i, l = (a + i) / 2;
343
- return s ? (n === a ? o = (t - r) / s + (t < r) * 6 : t === a ? o = (r - n) / s + 2 : o = (n - t) / s + 4, s /= l < 0.5 ? a + i : 2 - a - i, o *= 60) : s = l > 0 && l < 1 ? 0 : o, new L(o, s, l, e.opacity);
342
+ var n = e.r / 255, t = e.g / 255, r = e.b / 255, i = Math.min(n, t, r), o = Math.max(n, t, r), s = NaN, a = o - i, l = (o + i) / 2;
343
+ return a ? (n === o ? s = (t - r) / a + (t < r) * 6 : t === o ? s = (r - n) / a + 2 : s = (n - t) / a + 4, a /= l < 0.5 ? o + i : 2 - o - i, s *= 60) : a = l > 0 && l < 1 ? 0 : s, new E(s, a, l, e.opacity);
344
344
  }
345
- function En(e, n, t, r) {
346
- return arguments.length === 1 ? en(e) : new L(e, n, t, r ?? 1);
345
+ function Hn(e, n, t, r) {
346
+ return arguments.length === 1 ? an(e) : new E(e, n, t, r ?? 1);
347
347
  }
348
- function L(e, n, t, r) {
348
+ function E(e, n, t, r) {
349
349
  this.h = +e, this.s = +n, this.l = +t, this.opacity = +r;
350
350
  }
351
- Ae(L, En, Qe(te, {
351
+ Ee(E, Hn, on(te, {
352
352
  brighter(e) {
353
- return e = e == null ? de : Math.pow(de, e), new L(this.h, this.s, this.l * e, this.opacity);
353
+ return e = e == null ? me : Math.pow(me, e), new E(this.h, this.s, this.l * e, this.opacity);
354
354
  },
355
355
  darker(e) {
356
- return e = e == null ? Q : Math.pow(Q, e), new L(this.h, this.s, this.l * e, this.opacity);
356
+ return e = e == null ? Q : Math.pow(Q, e), new E(this.h, this.s, this.l * e, this.opacity);
357
357
  },
358
358
  rgb() {
359
359
  var e = this.h % 360 + (this.h < 0) * 360, n = isNaN(e) || isNaN(this.s) ? 0 : this.s, t = this.l, r = t + (t < 0.5 ? t : 1 - t) * n, i = 2 * t - r;
360
- return new $(
361
- ve(e >= 240 ? e - 240 : e + 120, i, r),
362
- ve(e, i, r),
363
- ve(e < 120 ? e + 240 : e - 120, i, r),
360
+ return new C(
361
+ Me(e >= 240 ? e - 240 : e + 120, i, r),
362
+ Me(e, i, r),
363
+ Me(e < 120 ? e + 240 : e - 120, i, r),
364
364
  this.opacity
365
365
  );
366
366
  },
367
367
  clamp() {
368
- return new L(Ve(this.h), ce(this.s), ce(this.l), he(this.opacity));
368
+ return new E(Be(this.h), ce(this.s), ce(this.l), he(this.opacity));
369
369
  },
370
370
  displayable() {
371
371
  return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
372
372
  },
373
373
  formatHsl() {
374
374
  const e = he(this.opacity);
375
- return `${e === 1 ? "hsl(" : "hsla("}${Ve(this.h)}, ${ce(this.s) * 100}%, ${ce(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
375
+ return `${e === 1 ? "hsl(" : "hsla("}${Be(this.h)}, ${ce(this.s) * 100}%, ${ce(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
376
376
  }
377
377
  }));
378
- function Ve(e) {
378
+ function Be(e) {
379
379
  return e = (e || 0) % 360, e < 0 ? e + 360 : e;
380
380
  }
381
381
  function ce(e) {
382
382
  return Math.max(0, Math.min(1, e || 0));
383
383
  }
384
- function ve(e, n, t) {
384
+ function Me(e, n, t) {
385
385
  return (e < 60 ? n + (t - n) * e / 60 : e < 180 ? t : e < 240 ? n + (t - n) * (240 - e) / 60 : n) * 255;
386
386
  }
387
- const Se = (e) => () => e;
388
- function In(e, n) {
387
+ const Ie = (e) => () => e;
388
+ function Tn(e, n) {
389
389
  return function(t) {
390
390
  return e + t * n;
391
391
  };
392
392
  }
393
- function jn(e, n, t) {
393
+ function Gn(e, n, t) {
394
394
  return e = Math.pow(e, t), n = Math.pow(n, t) - e, t = 1 / t, function(r) {
395
395
  return Math.pow(e + r * n, t);
396
396
  };
397
397
  }
398
- function Fn(e) {
399
- return (e = +e) == 1 ? nn : function(n, t) {
400
- return t - n ? jn(n, t, e) : Se(isNaN(n) ? t : n);
398
+ function Un(e) {
399
+ return (e = +e) == 1 ? sn : function(n, t) {
400
+ return t - n ? Gn(n, t, e) : Ie(isNaN(n) ? t : n);
401
401
  };
402
402
  }
403
- function nn(e, n) {
403
+ function sn(e, n) {
404
404
  var t = n - e;
405
- return t ? In(e, t) : Se(isNaN(e) ? n : e);
406
- }
407
- const Re = (function e(n) {
408
- var t = Fn(n);
409
- function r(i, a) {
410
- var o = t((i = $e(i)).r, (a = $e(a)).r), s = t(i.g, a.g), l = t(i.b, a.b), f = nn(i.opacity, a.opacity);
411
- return function(h) {
412
- return i.r = o(h), i.g = s(h), i.b = l(h), i.opacity = f(h), i + "";
405
+ return t ? Tn(e, t) : Ie(isNaN(e) ? n : e);
406
+ }
407
+ const ke = (function e(n) {
408
+ var t = Un(n);
409
+ function r(i, o) {
410
+ var s = t((i = Ce(i)).r, (o = Ce(o)).r), a = t(i.g, o.g), l = t(i.b, o.b), f = sn(i.opacity, o.opacity);
411
+ return function(d) {
412
+ return i.r = s(d), i.g = a(d), i.b = l(d), i.opacity = f(d), i + "";
413
413
  };
414
414
  }
415
415
  return r.gamma = e, r;
416
416
  })(1);
417
- function Pn(e, n) {
417
+ function Dn(e, n) {
418
418
  n || (n = []);
419
419
  var t = e ? Math.min(n.length, e.length) : 0, r = n.slice(), i;
420
- return function(a) {
421
- for (i = 0; i < t; ++i) r[i] = e[i] * (1 - a) + n[i] * a;
420
+ return function(o) {
421
+ for (i = 0; i < t; ++i) r[i] = e[i] * (1 - o) + n[i] * o;
422
422
  return r;
423
423
  };
424
424
  }
425
- function On(e) {
425
+ function qn(e) {
426
426
  return ArrayBuffer.isView(e) && !(e instanceof DataView);
427
427
  }
428
- function zn(e, n) {
429
- var t = n ? n.length : 0, r = e ? Math.min(t, e.length) : 0, i = new Array(r), a = new Array(t), o;
430
- for (o = 0; o < r; ++o) i[o] = Ee(e[o], n[o]);
431
- for (; o < t; ++o) a[o] = n[o];
432
- return function(s) {
433
- for (o = 0; o < r; ++o) a[o] = i[o](s);
434
- return a;
428
+ function Vn(e, n) {
429
+ var t = n ? n.length : 0, r = e ? Math.min(t, e.length) : 0, i = new Array(r), o = new Array(t), s;
430
+ for (s = 0; s < r; ++s) i[s] = Fe(e[s], n[s]);
431
+ for (; s < t; ++s) o[s] = n[s];
432
+ return function(a) {
433
+ for (s = 0; s < r; ++s) o[s] = i[s](a);
434
+ return o;
435
435
  };
436
436
  }
437
- function Hn(e, n) {
437
+ function Bn(e, n) {
438
438
  var t = /* @__PURE__ */ new Date();
439
439
  return e = +e, n = +n, function(r) {
440
440
  return t.setTime(e * (1 - r) + n * r), t;
441
441
  };
442
442
  }
443
- function me(e, n) {
443
+ function ge(e, n) {
444
444
  return e = +e, n = +n, function(t) {
445
445
  return e * (1 - t) + n * t;
446
446
  };
447
447
  }
448
- function Tn(e, n) {
448
+ function Zn(e, n) {
449
449
  var t = {}, r = {}, i;
450
450
  (e === null || typeof e != "object") && (e = {}), (n === null || typeof n != "object") && (n = {});
451
451
  for (i in n)
452
- i in e ? t[i] = Ee(e[i], n[i]) : r[i] = n[i];
453
- return function(a) {
454
- for (i in t) r[i] = t[i](a);
452
+ i in e ? t[i] = Fe(e[i], n[i]) : r[i] = n[i];
453
+ return function(o) {
454
+ for (i in t) r[i] = t[i](o);
455
455
  return r;
456
456
  };
457
457
  }
458
- var ke = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Ne = new RegExp(ke.source, "g");
459
- function Gn(e) {
458
+ var Le = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, _e = new RegExp(Le.source, "g");
459
+ function Jn(e) {
460
460
  return function() {
461
461
  return e;
462
462
  };
463
463
  }
464
- function Un(e) {
464
+ function Kn(e) {
465
465
  return function(n) {
466
466
  return e(n) + "";
467
467
  };
468
468
  }
469
- function Dn(e, n) {
470
- var t = ke.lastIndex = Ne.lastIndex = 0, r, i, a, o = -1, s = [], l = [];
471
- for (e = e + "", n = n + ""; (r = ke.exec(e)) && (i = Ne.exec(n)); )
472
- (a = i.index) > t && (a = n.slice(t, a), s[o] ? s[o] += a : s[++o] = a), (r = r[0]) === (i = i[0]) ? s[o] ? s[o] += i : s[++o] = i : (s[++o] = null, l.push({ i: o, x: me(r, i) })), t = Ne.lastIndex;
473
- return t < n.length && (a = n.slice(t), s[o] ? s[o] += a : s[++o] = a), s.length < 2 ? l[0] ? Un(l[0].x) : Gn(n) : (n = l.length, function(f) {
474
- for (var h = 0, u; h < n; ++h) s[(u = l[h]).i] = u.x(f);
475
- return s.join("");
469
+ function Yn(e, n) {
470
+ var t = Le.lastIndex = _e.lastIndex = 0, r, i, o, s = -1, a = [], l = [];
471
+ for (e = e + "", n = n + ""; (r = Le.exec(e)) && (i = _e.exec(n)); )
472
+ (o = i.index) > t && (o = n.slice(t, o), a[s] ? a[s] += o : a[++s] = o), (r = r[0]) === (i = i[0]) ? a[s] ? a[s] += i : a[++s] = i : (a[++s] = null, l.push({ i: s, x: ge(r, i) })), t = _e.lastIndex;
473
+ return t < n.length && (o = n.slice(t), a[s] ? a[s] += o : a[++s] = o), a.length < 2 ? l[0] ? Kn(l[0].x) : Jn(n) : (n = l.length, function(f) {
474
+ for (var d = 0, c; d < n; ++d) a[(c = l[d]).i] = c.x(f);
475
+ return a.join("");
476
476
  });
477
477
  }
478
- function Ee(e, n) {
478
+ function Fe(e, n) {
479
479
  var t = typeof n, r;
480
- return n == null || t === "boolean" ? Se(n) : (t === "number" ? me : t === "string" ? (r = ne(n)) ? (n = r, Re) : Dn : n instanceof ne ? Re : n instanceof Date ? Hn : On(n) ? Pn : Array.isArray(n) ? zn : typeof n.valueOf != "function" && typeof n.toString != "function" || isNaN(n) ? Tn : me)(e, n);
480
+ return n == null || t === "boolean" ? Ie(n) : (t === "number" ? ge : t === "string" ? (r = ne(n)) ? (n = r, ke) : Yn : n instanceof ne ? ke : n instanceof Date ? Bn : qn(n) ? Dn : Array.isArray(n) ? Vn : typeof n.valueOf != "function" && typeof n.toString != "function" || isNaN(n) ? Zn : ge)(e, n);
481
481
  }
482
- function Vn(e, n) {
482
+ function Xn(e, n) {
483
483
  return e = +e, n = +n, function(t) {
484
484
  return Math.round(e * (1 - t) + n * t);
485
485
  };
@@ -487,74 +487,74 @@ function Vn(e, n) {
487
487
  function le(e, n) {
488
488
  return e == null || n == null ? NaN : e < n ? -1 : e > n ? 1 : e >= n ? 0 : NaN;
489
489
  }
490
- function qn(e, n) {
490
+ function Wn(e, n) {
491
491
  return e == null || n == null ? NaN : n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
492
492
  }
493
- function tn(e) {
493
+ function fn(e) {
494
494
  let n, t, r;
495
- e.length !== 2 ? (n = le, t = (s, l) => le(e(s), l), r = (s, l) => e(s) - l) : (n = e === le || e === qn ? e : Bn, t = e, r = e);
496
- function i(s, l, f = 0, h = s.length) {
497
- if (f < h) {
498
- if (n(l, l) !== 0) return h;
495
+ e.length !== 2 ? (n = le, t = (a, l) => le(e(a), l), r = (a, l) => e(a) - l) : (n = e === le || e === Wn ? e : Qn, t = e, r = e);
496
+ function i(a, l, f = 0, d = a.length) {
497
+ if (f < d) {
498
+ if (n(l, l) !== 0) return d;
499
499
  do {
500
- const u = f + h >>> 1;
501
- t(s[u], l) < 0 ? f = u + 1 : h = u;
502
- } while (f < h);
500
+ const c = f + d >>> 1;
501
+ t(a[c], l) < 0 ? f = c + 1 : d = c;
502
+ } while (f < d);
503
503
  }
504
504
  return f;
505
505
  }
506
- function a(s, l, f = 0, h = s.length) {
507
- if (f < h) {
508
- if (n(l, l) !== 0) return h;
506
+ function o(a, l, f = 0, d = a.length) {
507
+ if (f < d) {
508
+ if (n(l, l) !== 0) return d;
509
509
  do {
510
- const u = f + h >>> 1;
511
- t(s[u], l) <= 0 ? f = u + 1 : h = u;
512
- } while (f < h);
510
+ const c = f + d >>> 1;
511
+ t(a[c], l) <= 0 ? f = c + 1 : d = c;
512
+ } while (f < d);
513
513
  }
514
514
  return f;
515
515
  }
516
- function o(s, l, f = 0, h = s.length) {
517
- const u = i(s, l, f, h - 1);
518
- return u > f && r(s[u - 1], l) > -r(s[u], l) ? u - 1 : u;
516
+ function s(a, l, f = 0, d = a.length) {
517
+ const c = i(a, l, f, d - 1);
518
+ return c > f && r(a[c - 1], l) > -r(a[c], l) ? c - 1 : c;
519
519
  }
520
- return { left: i, center: o, right: a };
520
+ return { left: i, center: s, right: o };
521
521
  }
522
- function Bn() {
522
+ function Qn() {
523
523
  return 0;
524
524
  }
525
- function Zn(e) {
525
+ function et(e) {
526
526
  return e === null ? NaN : +e;
527
527
  }
528
- const Jn = tn(le), Yn = Jn.right;
529
- tn(Zn).center;
530
- const Kn = Math.sqrt(50), Xn = Math.sqrt(10), Wn = Math.sqrt(2);
531
- function ge(e, n, t) {
532
- const r = (n - e) / Math.max(0, t), i = Math.floor(Math.log10(r)), a = r / Math.pow(10, i), o = a >= Kn ? 10 : a >= Xn ? 5 : a >= Wn ? 2 : 1;
533
- let s, l, f;
534
- return i < 0 ? (f = Math.pow(10, -i) / o, s = Math.round(e * f), l = Math.round(n * f), s / f < e && ++s, l / f > n && --l, f = -f) : (f = Math.pow(10, i) * o, s = Math.round(e / f), l = Math.round(n / f), s * f < e && ++s, l * f > n && --l), l < s && 0.5 <= t && t < 2 ? ge(e, n, t * 2) : [s, l, f];
528
+ const nt = fn(le), tt = nt.right;
529
+ fn(et).center;
530
+ const rt = Math.sqrt(50), it = Math.sqrt(10), ot = Math.sqrt(2);
531
+ function pe(e, n, t) {
532
+ const r = (n - e) / Math.max(0, t), i = Math.floor(Math.log10(r)), o = r / Math.pow(10, i), s = o >= rt ? 10 : o >= it ? 5 : o >= ot ? 2 : 1;
533
+ let a, l, f;
534
+ return i < 0 ? (f = Math.pow(10, -i) / s, a = Math.round(e * f), l = Math.round(n * f), a / f < e && ++a, l / f > n && --l, f = -f) : (f = Math.pow(10, i) * s, a = Math.round(e / f), l = Math.round(n / f), a * f < e && ++a, l * f > n && --l), l < a && 0.5 <= t && t < 2 ? pe(e, n, t * 2) : [a, l, f];
535
535
  }
536
- function Qn(e, n, t) {
536
+ function at(e, n, t) {
537
537
  if (n = +n, e = +e, t = +t, !(t > 0)) return [];
538
538
  if (e === n) return [e];
539
- const r = n < e, [i, a, o] = r ? ge(n, e, t) : ge(e, n, t);
540
- if (!(a >= i)) return [];
541
- const s = a - i + 1, l = new Array(s);
539
+ const r = n < e, [i, o, s] = r ? pe(n, e, t) : pe(e, n, t);
540
+ if (!(o >= i)) return [];
541
+ const a = o - i + 1, l = new Array(a);
542
542
  if (r)
543
- if (o < 0) for (let f = 0; f < s; ++f) l[f] = (a - f) / -o;
544
- else for (let f = 0; f < s; ++f) l[f] = (a - f) * o;
545
- else if (o < 0) for (let f = 0; f < s; ++f) l[f] = (i + f) / -o;
546
- else for (let f = 0; f < s; ++f) l[f] = (i + f) * o;
543
+ if (s < 0) for (let f = 0; f < a; ++f) l[f] = (o - f) / -s;
544
+ else for (let f = 0; f < a; ++f) l[f] = (o - f) * s;
545
+ else if (s < 0) for (let f = 0; f < a; ++f) l[f] = (i + f) / -s;
546
+ else for (let f = 0; f < a; ++f) l[f] = (i + f) * s;
547
547
  return l;
548
548
  }
549
- function Ce(e, n, t) {
550
- return n = +n, e = +e, t = +t, ge(e, n, t)[2];
549
+ function Ae(e, n, t) {
550
+ return n = +n, e = +e, t = +t, pe(e, n, t)[2];
551
551
  }
552
- function et(e, n, t) {
552
+ function st(e, n, t) {
553
553
  n = +n, e = +e, t = +t;
554
- const r = n < e, i = r ? Ce(n, e, t) : Ce(e, n, t);
554
+ const r = n < e, i = r ? Ae(n, e, t) : Ae(e, n, t);
555
555
  return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
556
556
  }
557
- function nt(e, n) {
557
+ function ft(e, n) {
558
558
  switch (arguments.length) {
559
559
  case 0:
560
560
  break;
@@ -567,81 +567,81 @@ function nt(e, n) {
567
567
  }
568
568
  return this;
569
569
  }
570
- function tt(e) {
570
+ function ct(e) {
571
571
  return function() {
572
572
  return e;
573
573
  };
574
574
  }
575
- function rt(e) {
575
+ function ut(e) {
576
576
  return +e;
577
577
  }
578
- var qe = [0, 1];
579
- function Z(e) {
578
+ var Ze = [0, 1];
579
+ function Y(e) {
580
580
  return e;
581
581
  }
582
- function Le(e, n) {
582
+ function Se(e, n) {
583
583
  return (n -= e = +e) ? function(t) {
584
584
  return (t - e) / n;
585
- } : tt(isNaN(n) ? NaN : 0.5);
585
+ } : ct(isNaN(n) ? NaN : 0.5);
586
586
  }
587
- function it(e, n) {
587
+ function lt(e, n) {
588
588
  var t;
589
589
  return e > n && (t = e, e = n, n = t), function(r) {
590
590
  return Math.max(e, Math.min(n, r));
591
591
  };
592
592
  }
593
- function ot(e, n, t) {
594
- var r = e[0], i = e[1], a = n[0], o = n[1];
595
- return i < r ? (r = Le(i, r), a = t(o, a)) : (r = Le(r, i), a = t(a, o)), function(s) {
596
- return a(r(s));
593
+ function dt(e, n, t) {
594
+ var r = e[0], i = e[1], o = n[0], s = n[1];
595
+ return i < r ? (r = Se(i, r), o = t(s, o)) : (r = Se(r, i), o = t(o, s)), function(a) {
596
+ return o(r(a));
597
597
  };
598
598
  }
599
- function at(e, n, t) {
600
- var r = Math.min(e.length, n.length) - 1, i = new Array(r), a = new Array(r), o = -1;
601
- for (e[r] < e[0] && (e = e.slice().reverse(), n = n.slice().reverse()); ++o < r; )
602
- i[o] = Le(e[o], e[o + 1]), a[o] = t(n[o], n[o + 1]);
603
- return function(s) {
604
- var l = Yn(e, s, 1, r) - 1;
605
- return a[l](i[l](s));
599
+ function mt(e, n, t) {
600
+ var r = Math.min(e.length, n.length) - 1, i = new Array(r), o = new Array(r), s = -1;
601
+ for (e[r] < e[0] && (e = e.slice().reverse(), n = n.slice().reverse()); ++s < r; )
602
+ i[s] = Se(e[s], e[s + 1]), o[s] = t(n[s], n[s + 1]);
603
+ return function(a) {
604
+ var l = tt(e, a, 1, r) - 1;
605
+ return o[l](i[l](a));
606
606
  };
607
607
  }
608
- function st(e, n) {
608
+ function ht(e, n) {
609
609
  return n.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());
610
610
  }
611
- function ft() {
612
- var e = qe, n = qe, t = Ee, r, i, a, o = Z, s, l, f;
613
- function h() {
614
- var d = Math.min(e.length, n.length);
615
- return o !== Z && (o = it(e[0], e[d - 1])), s = d > 2 ? at : ot, l = f = null, u;
611
+ function gt() {
612
+ var e = Ze, n = Ze, t = Fe, r, i, o, s = Y, a, l, f;
613
+ function d() {
614
+ var h = Math.min(e.length, n.length);
615
+ return s !== Y && (s = lt(e[0], e[h - 1])), a = h > 2 ? mt : dt, l = f = null, c;
616
616
  }
617
- function u(d) {
618
- return d == null || isNaN(d = +d) ? a : (l || (l = s(e.map(r), n, t)))(r(o(d)));
617
+ function c(h) {
618
+ return h == null || isNaN(h = +h) ? o : (l || (l = a(e.map(r), n, t)))(r(s(h)));
619
619
  }
620
- return u.invert = function(d) {
621
- return o(i((f || (f = s(n, e.map(r), me)))(d)));
622
- }, u.domain = function(d) {
623
- return arguments.length ? (e = Array.from(d, rt), h()) : e.slice();
624
- }, u.range = function(d) {
625
- return arguments.length ? (n = Array.from(d), h()) : n.slice();
626
- }, u.rangeRound = function(d) {
627
- return n = Array.from(d), t = Vn, h();
628
- }, u.clamp = function(d) {
629
- return arguments.length ? (o = d ? !0 : Z, h()) : o !== Z;
630
- }, u.interpolate = function(d) {
631
- return arguments.length ? (t = d, h()) : t;
632
- }, u.unknown = function(d) {
633
- return arguments.length ? (a = d, u) : a;
634
- }, function(d, w) {
635
- return r = d, i = w, h();
620
+ return c.invert = function(h) {
621
+ return s(i((f || (f = a(n, e.map(r), ge)))(h)));
622
+ }, c.domain = function(h) {
623
+ return arguments.length ? (e = Array.from(h, ut), d()) : e.slice();
624
+ }, c.range = function(h) {
625
+ return arguments.length ? (n = Array.from(h), d()) : n.slice();
626
+ }, c.rangeRound = function(h) {
627
+ return n = Array.from(h), t = Xn, d();
628
+ }, c.clamp = function(h) {
629
+ return arguments.length ? (s = h ? !0 : Y, d()) : s !== Y;
630
+ }, c.interpolate = function(h) {
631
+ return arguments.length ? (t = h, d()) : t;
632
+ }, c.unknown = function(h) {
633
+ return arguments.length ? (o = h, c) : o;
634
+ }, function(h, N) {
635
+ return r = h, i = N, d();
636
636
  };
637
637
  }
638
- function ct() {
639
- return ft()(Z, Z);
638
+ function pt() {
639
+ return gt()(Y, Y);
640
640
  }
641
- function ut(e) {
641
+ function xt(e) {
642
642
  return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10);
643
643
  }
644
- function pe(e, n) {
644
+ function xe(e, n) {
645
645
  if (!isFinite(e) || e === 0) return null;
646
646
  var t = (e = n ? e.toExponential(n - 1) : e.toExponential()).indexOf("e"), r = e.slice(0, t);
647
647
  return [
@@ -649,28 +649,28 @@ function pe(e, n) {
649
649
  +e.slice(t + 1)
650
650
  ];
651
651
  }
652
- function Y(e) {
653
- return e = pe(Math.abs(e)), e ? e[1] : NaN;
652
+ function W(e) {
653
+ return e = xe(Math.abs(e)), e ? e[1] : NaN;
654
654
  }
655
- function lt(e, n) {
655
+ function bt(e, n) {
656
656
  return function(t, r) {
657
- for (var i = t.length, a = [], o = 0, s = e[0], l = 0; i > 0 && s > 0 && (l + s + 1 > r && (s = Math.max(1, r - l)), a.push(t.substring(i -= s, i + s)), !((l += s + 1) > r)); )
658
- s = e[o = (o + 1) % e.length];
659
- return a.reverse().join(n);
657
+ for (var i = t.length, o = [], s = 0, a = e[0], l = 0; i > 0 && a > 0 && (l + a + 1 > r && (a = Math.max(1, r - l)), o.push(t.substring(i -= a, i + a)), !((l += a + 1) > r)); )
658
+ a = e[s = (s + 1) % e.length];
659
+ return o.reverse().join(n);
660
660
  };
661
661
  }
662
- function dt(e) {
662
+ function yt(e) {
663
663
  return function(n) {
664
664
  return n.replace(/[0-9]/g, function(t) {
665
665
  return e[+t];
666
666
  });
667
667
  };
668
668
  }
669
- var ht = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
670
- function xe(e) {
671
- if (!(n = ht.exec(e))) throw new Error("invalid format: " + e);
669
+ var wt = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
670
+ function be(e) {
671
+ if (!(n = wt.exec(e))) throw new Error("invalid format: " + e);
672
672
  var n;
673
- return new Ie({
673
+ return new je({
674
674
  fill: n[1],
675
675
  align: n[2],
676
676
  sign: n[3],
@@ -683,14 +683,14 @@ function xe(e) {
683
683
  type: n[10]
684
684
  });
685
685
  }
686
- xe.prototype = Ie.prototype;
687
- function Ie(e) {
686
+ be.prototype = je.prototype;
687
+ function je(e) {
688
688
  this.fill = e.fill === void 0 ? " " : e.fill + "", this.align = e.align === void 0 ? ">" : e.align + "", this.sign = e.sign === void 0 ? "-" : e.sign + "", this.symbol = e.symbol === void 0 ? "" : e.symbol + "", this.zero = !!e.zero, this.width = e.width === void 0 ? void 0 : +e.width, this.comma = !!e.comma, this.precision = e.precision === void 0 ? void 0 : +e.precision, this.trim = !!e.trim, this.type = e.type === void 0 ? "" : e.type + "";
689
689
  }
690
- Ie.prototype.toString = function() {
690
+ je.prototype.toString = function() {
691
691
  return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
692
692
  };
693
- function mt(e) {
693
+ function vt(e) {
694
694
  e: for (var n = e.length, t = 1, r = -1, i; t < n; ++t)
695
695
  switch (e[t]) {
696
696
  case ".":
@@ -706,153 +706,153 @@ function mt(e) {
706
706
  }
707
707
  return r > 0 ? e.slice(0, r) + e.slice(i + 1) : e;
708
708
  }
709
- var be;
710
- function gt(e, n) {
711
- var t = pe(e, n);
712
- if (!t) return be = void 0, e.toPrecision(n);
713
- var r = t[0], i = t[1], a = i - (be = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, o = r.length;
714
- return a === o ? r : a > o ? r + new Array(a - o + 1).join("0") : a > 0 ? r.slice(0, a) + "." + r.slice(a) : "0." + new Array(1 - a).join("0") + pe(e, Math.max(0, n + a - 1))[0];
709
+ var ye;
710
+ function Nt(e, n) {
711
+ var t = xe(e, n);
712
+ if (!t) return ye = void 0, e.toPrecision(n);
713
+ var r = t[0], i = t[1], o = i - (ye = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, s = r.length;
714
+ return o === s ? r : o > s ? r + new Array(o - s + 1).join("0") : o > 0 ? r.slice(0, o) + "." + r.slice(o) : "0." + new Array(1 - o).join("0") + xe(e, Math.max(0, n + o - 1))[0];
715
715
  }
716
- function Be(e, n) {
717
- var t = pe(e, n);
716
+ function Je(e, n) {
717
+ var t = xe(e, n);
718
718
  if (!t) return e + "";
719
719
  var r = t[0], i = t[1];
720
720
  return i < 0 ? "0." + new Array(-i).join("0") + r : r.length > i + 1 ? r.slice(0, i + 1) + "." + r.slice(i + 1) : r + new Array(i - r.length + 2).join("0");
721
721
  }
722
- const Ze = {
722
+ const Ke = {
723
723
  "%": (e, n) => (e * 100).toFixed(n),
724
724
  b: (e) => Math.round(e).toString(2),
725
725
  c: (e) => e + "",
726
- d: ut,
726
+ d: xt,
727
727
  e: (e, n) => e.toExponential(n),
728
728
  f: (e, n) => e.toFixed(n),
729
729
  g: (e, n) => e.toPrecision(n),
730
730
  o: (e) => Math.round(e).toString(8),
731
- p: (e, n) => Be(e * 100, n),
732
- r: Be,
733
- s: gt,
731
+ p: (e, n) => Je(e * 100, n),
732
+ r: Je,
733
+ s: Nt,
734
734
  X: (e) => Math.round(e).toString(16).toUpperCase(),
735
735
  x: (e) => Math.round(e).toString(16)
736
736
  };
737
- function Je(e) {
737
+ function Ye(e) {
738
738
  return e;
739
739
  }
740
- var Ye = Array.prototype.map, Ke = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
741
- function pt(e) {
742
- var n = e.grouping === void 0 || e.thousands === void 0 ? Je : lt(Ye.call(e.grouping, Number), e.thousands + ""), t = e.currency === void 0 ? "" : e.currency[0] + "", r = e.currency === void 0 ? "" : e.currency[1] + "", i = e.decimal === void 0 ? "." : e.decimal + "", a = e.numerals === void 0 ? Je : dt(Ye.call(e.numerals, String)), o = e.percent === void 0 ? "%" : e.percent + "", s = e.minus === void 0 ? "−" : e.minus + "", l = e.nan === void 0 ? "NaN" : e.nan + "";
743
- function f(u, d) {
744
- u = xe(u);
745
- var w = u.fill, v = u.align, R = u.sign, j = u.symbol, E = u.zero, K = u.width, D = u.comma, k = u.precision, re = u.trim, M = u.type;
746
- M === "n" ? (D = !0, M = "g") : Ze[M] || (k === void 0 && (k = 12), re = !0, M = "g"), (E || w === "0" && v === "=") && (E = !0, w = "0", v = "=");
747
- var V = (d && d.prefix !== void 0 ? d.prefix : "") + (j === "$" ? t : j === "#" && /[boxX]/.test(M) ? "0" + M.toLowerCase() : ""), ie = (j === "$" ? r : /[%p]/.test(M) ? o : "") + (d && d.suffix !== void 0 ? d.suffix : ""), oe = Ze[M], ae = /[defgprs%]/.test(M);
748
- k = k === void 0 ? 6 : /[gprs]/.test(M) ? Math.max(1, Math.min(21, k)) : Math.max(0, Math.min(20, k));
749
- function X(p) {
750
- var I = V, _ = ie, A, W, q;
751
- if (M === "c")
752
- _ = oe(p) + _, p = "";
740
+ var Xe = Array.prototype.map, We = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
741
+ function Mt(e) {
742
+ var n = e.grouping === void 0 || e.thousands === void 0 ? Ye : bt(Xe.call(e.grouping, Number), e.thousands + ""), t = e.currency === void 0 ? "" : e.currency[0] + "", r = e.currency === void 0 ? "" : e.currency[1] + "", i = e.decimal === void 0 ? "." : e.decimal + "", o = e.numerals === void 0 ? Ye : yt(Xe.call(e.numerals, String)), s = e.percent === void 0 ? "%" : e.percent + "", a = e.minus === void 0 ? "−" : e.minus + "", l = e.nan === void 0 ? "NaN" : e.nan + "";
743
+ function f(c, h) {
744
+ c = be(c);
745
+ var N = c.fill, k = c.align, L = c.sign, w = c.symbol, A = c.zero, M = c.width, J = c.comma, I = c.precision, U = c.trim, R = c.type;
746
+ R === "n" ? (J = !0, R = "g") : Ke[R] || (I === void 0 && (I = 12), U = !0, R = "g"), (A || N === "0" && k === "=") && (A = !0, N = "0", k = "=");
747
+ var re = (h && h.prefix !== void 0 ? h.prefix : "") + (w === "$" ? t : w === "#" && /[boxX]/.test(R) ? "0" + R.toLowerCase() : ""), F = (w === "$" ? r : /[%p]/.test(R) ? s : "") + (h && h.suffix !== void 0 ? h.suffix : ""), ie = Ke[R], oe = /[defgprs%]/.test(R);
748
+ I = I === void 0 ? 6 : /[gprs]/.test(R) ? Math.max(1, Math.min(21, I)) : Math.max(0, Math.min(20, I));
749
+ function D(g) {
750
+ var P = re, _ = F, O, ae, K;
751
+ if (R === "c")
752
+ _ = ie(g) + _, g = "";
753
753
  else {
754
- p = +p;
755
- var O = p < 0 || 1 / p < 0;
756
- if (p = isNaN(p) ? l : oe(Math.abs(p), k), re && (p = mt(p)), O && +p == 0 && R !== "+" && (O = !1), I = (O ? R === "(" ? R : s : R === "-" || R === "(" ? "" : R) + I, _ = (M === "s" && !isNaN(p) && be !== void 0 ? Ke[8 + be / 3] : "") + _ + (O && R === "(" ? ")" : ""), ae) {
757
- for (A = -1, W = p.length; ++A < W; )
758
- if (q = p.charCodeAt(A), 48 > q || q > 57) {
759
- _ = (q === 46 ? i + p.slice(A + 1) : p.slice(A)) + _, p = p.slice(0, A);
754
+ g = +g;
755
+ var S = g < 0 || 1 / g < 0;
756
+ if (g = isNaN(g) ? l : ie(Math.abs(g), I), U && (g = vt(g)), S && +g == 0 && L !== "+" && (S = !1), P = (S ? L === "(" ? L : a : L === "-" || L === "(" ? "" : L) + P, _ = (R === "s" && !isNaN(g) && ye !== void 0 ? We[8 + ye / 3] : "") + _ + (S && L === "(" ? ")" : ""), oe) {
757
+ for (O = -1, ae = g.length; ++O < ae; )
758
+ if (K = g.charCodeAt(O), 48 > K || K > 57) {
759
+ _ = (K === 46 ? i + g.slice(O + 1) : g.slice(O)) + _, g = g.slice(0, O);
760
760
  break;
761
761
  }
762
762
  }
763
763
  }
764
- D && !E && (p = n(p, 1 / 0));
765
- var z = I.length + p.length + _.length, C = z < K ? new Array(K - z + 1).join(w) : "";
766
- switch (D && E && (p = n(C + p, C.length ? K - _.length : 1 / 0), C = ""), v) {
764
+ J && !A && (g = n(g, 1 / 0));
765
+ var H = P.length + g.length + _.length, $ = H < M ? new Array(M - H + 1).join(N) : "";
766
+ switch (J && A && (g = n($ + g, $.length ? M - _.length : 1 / 0), $ = ""), k) {
767
767
  case "<":
768
- p = I + p + _ + C;
768
+ g = P + g + _ + $;
769
769
  break;
770
770
  case "=":
771
- p = I + C + p + _;
771
+ g = P + $ + g + _;
772
772
  break;
773
773
  case "^":
774
- p = C.slice(0, z = C.length >> 1) + I + p + _ + C.slice(z);
774
+ g = $.slice(0, H = $.length >> 1) + P + g + _ + $.slice(H);
775
775
  break;
776
776
  default:
777
- p = C + I + p + _;
777
+ g = $ + P + g + _;
778
778
  break;
779
779
  }
780
- return a(p);
780
+ return o(g);
781
781
  }
782
- return X.toString = function() {
783
- return u + "";
784
- }, X;
782
+ return D.toString = function() {
783
+ return c + "";
784
+ }, D;
785
785
  }
786
- function h(u, d) {
787
- var w = Math.max(-8, Math.min(8, Math.floor(Y(d) / 3))) * 3, v = Math.pow(10, -w), R = f((u = xe(u), u.type = "f", u), { suffix: Ke[8 + w / 3] });
788
- return function(j) {
789
- return R(v * j);
786
+ function d(c, h) {
787
+ var N = Math.max(-8, Math.min(8, Math.floor(W(h) / 3))) * 3, k = Math.pow(10, -N), L = f((c = be(c), c.type = "f", c), { suffix: We[8 + N / 3] });
788
+ return function(w) {
789
+ return L(k * w);
790
790
  };
791
791
  }
792
792
  return {
793
793
  format: f,
794
- formatPrefix: h
794
+ formatPrefix: d
795
795
  };
796
796
  }
797
- var ue, rn, on;
798
- xt({
797
+ var ue, cn, un;
798
+ _t({
799
799
  thousands: ",",
800
800
  grouping: [3],
801
801
  currency: ["$", ""]
802
802
  });
803
- function xt(e) {
804
- return ue = pt(e), rn = ue.format, on = ue.formatPrefix, ue;
803
+ function _t(e) {
804
+ return ue = Mt(e), cn = ue.format, un = ue.formatPrefix, ue;
805
805
  }
806
- function bt(e) {
807
- return Math.max(0, -Y(Math.abs(e)));
806
+ function $t(e) {
807
+ return Math.max(0, -W(Math.abs(e)));
808
808
  }
809
- function yt(e, n) {
810
- return Math.max(0, Math.max(-8, Math.min(8, Math.floor(Y(n) / 3))) * 3 - Y(Math.abs(e)));
809
+ function Rt(e, n) {
810
+ return Math.max(0, Math.max(-8, Math.min(8, Math.floor(W(n) / 3))) * 3 - W(Math.abs(e)));
811
811
  }
812
- function wt(e, n) {
813
- return e = Math.abs(e), n = Math.abs(n) - e, Math.max(0, Y(n) - Y(e)) + 1;
812
+ function Ct(e, n) {
813
+ return e = Math.abs(e), n = Math.abs(n) - e, Math.max(0, W(n) - W(e)) + 1;
814
814
  }
815
- function vt(e, n, t, r) {
816
- var i = et(e, n, t), a;
817
- switch (r = xe(r ?? ",f"), r.type) {
815
+ function kt(e, n, t, r) {
816
+ var i = st(e, n, t), o;
817
+ switch (r = be(r ?? ",f"), r.type) {
818
818
  case "s": {
819
- var o = Math.max(Math.abs(e), Math.abs(n));
820
- return r.precision == null && !isNaN(a = yt(i, o)) && (r.precision = a), on(r, o);
819
+ var s = Math.max(Math.abs(e), Math.abs(n));
820
+ return r.precision == null && !isNaN(o = Rt(i, s)) && (r.precision = o), un(r, s);
821
821
  }
822
822
  case "":
823
823
  case "e":
824
824
  case "g":
825
825
  case "p":
826
826
  case "r": {
827
- r.precision == null && !isNaN(a = wt(i, Math.max(Math.abs(e), Math.abs(n)))) && (r.precision = a - (r.type === "e"));
827
+ r.precision == null && !isNaN(o = Ct(i, Math.max(Math.abs(e), Math.abs(n)))) && (r.precision = o - (r.type === "e"));
828
828
  break;
829
829
  }
830
830
  case "f":
831
831
  case "%": {
832
- r.precision == null && !isNaN(a = bt(i)) && (r.precision = a - (r.type === "%") * 2);
832
+ r.precision == null && !isNaN(o = $t(i)) && (r.precision = o - (r.type === "%") * 2);
833
833
  break;
834
834
  }
835
835
  }
836
- return rn(r);
836
+ return cn(r);
837
837
  }
838
- function Nt(e) {
838
+ function Lt(e) {
839
839
  var n = e.domain;
840
840
  return e.ticks = function(t) {
841
841
  var r = n();
842
- return Qn(r[0], r[r.length - 1], t ?? 10);
842
+ return at(r[0], r[r.length - 1], t ?? 10);
843
843
  }, e.tickFormat = function(t, r) {
844
844
  var i = n();
845
- return vt(i[0], i[i.length - 1], t ?? 10, r);
845
+ return kt(i[0], i[i.length - 1], t ?? 10, r);
846
846
  }, e.nice = function(t) {
847
847
  t == null && (t = 10);
848
- var r = n(), i = 0, a = r.length - 1, o = r[i], s = r[a], l, f, h = 10;
849
- for (s < o && (f = o, o = s, s = f, f = i, i = a, a = f); h-- > 0; ) {
850
- if (f = Ce(o, s, t), f === l)
851
- return r[i] = o, r[a] = s, n(r);
848
+ var r = n(), i = 0, o = r.length - 1, s = r[i], a = r[o], l, f, d = 10;
849
+ for (a < s && (f = s, s = a, a = f, f = i, i = o, o = f); d-- > 0; ) {
850
+ if (f = Ae(s, a, t), f === l)
851
+ return r[i] = s, r[o] = a, n(r);
852
852
  if (f > 0)
853
- o = Math.floor(o / f) * f, s = Math.ceil(s / f) * f;
853
+ s = Math.floor(s / f) * f, a = Math.ceil(a / f) * f;
854
854
  else if (f < 0)
855
- o = Math.ceil(o * f) / f, s = Math.floor(s * f) / f;
855
+ s = Math.ceil(s * f) / f, a = Math.floor(a * f) / f;
856
856
  else
857
857
  break;
858
858
  l = f;
@@ -860,42 +860,85 @@ function Nt(e) {
860
860
  return e;
861
861
  }, e;
862
862
  }
863
- function an() {
864
- var e = ct();
863
+ function ln() {
864
+ var e = pt();
865
865
  return e.copy = function() {
866
- return st(e, an());
867
- }, nt.apply(e, arguments), Nt(e);
868
- }
869
- const Me = (e, n) => {
866
+ return ht(e, ln());
867
+ }, ft.apply(e, arguments), Lt(e);
868
+ }
869
+ const de = (e) => e.trim().toUpperCase(), Qe = (e, n, t = {}) => {
870
+ const r = de(n);
871
+ return e.find((i) => {
872
+ const o = i.properties ?? {};
873
+ if ((o.__isoA2 ?? (typeof o.iso_a2 == "string" ? o.iso_a2.toUpperCase() : void 0)) === r) return !0;
874
+ const a = String(o.name ?? "").toLowerCase();
875
+ return t[a] === r;
876
+ });
877
+ }, At = (e) => {
878
+ if (typeof e != "object" || e === null || !("coordinates" in e))
879
+ return [];
880
+ const n = e.coordinates, t = [], r = (i) => {
881
+ if (Array.isArray(i)) {
882
+ if (i.length >= 2 && typeof i[0] == "number" && typeof i[1] == "number") {
883
+ t.push([i[0], i[1]]);
884
+ return;
885
+ }
886
+ i.forEach(r);
887
+ }
888
+ };
889
+ return r(n), t;
890
+ }, en = (e) => {
891
+ const n = At(e.geometry);
892
+ if (!n.length) return;
893
+ const t = n.reduce(
894
+ (r, [i, o]) => ({
895
+ minLat: Math.min(r.minLat, o),
896
+ maxLat: Math.max(r.maxLat, o),
897
+ minLng: Math.min(r.minLng, i),
898
+ maxLng: Math.max(r.maxLng, i)
899
+ }),
900
+ {
901
+ minLat: Number.POSITIVE_INFINITY,
902
+ maxLat: Number.NEGATIVE_INFINITY,
903
+ minLng: Number.POSITIVE_INFINITY,
904
+ maxLng: Number.NEGATIVE_INFINITY
905
+ }
906
+ );
907
+ if (!(!Number.isFinite(t.minLat) || !Number.isFinite(t.minLng)))
908
+ return t;
909
+ }, nn = (e) => {
910
+ const n = Math.max(0.1, e.maxLat - e.minLat), t = Math.max(0.1, e.maxLng - e.minLng), i = Math.max(n, t) / 112;
911
+ return Math.min(0.9, Math.max(0.14, i));
912
+ }, $e = (e, n) => {
870
913
  const t = e?.[n];
871
914
  return typeof t == "number" ? t : 0;
872
- }, Xe = (e, n) => {
915
+ }, tn = (e, n) => {
873
916
  if (!e.length) return () => n.minColor;
874
917
  const t = Math.min(...e), r = Math.max(...e);
875
918
  if (t === r) return () => n.maxColor;
876
- const i = an().domain([t, r]).range([0, 1]), a = Re(n.minColor, n.maxColor);
877
- return (o) => a(i(o));
878
- }, Mt = (e) => e <= 1.35 ? 2 : e <= 2.1 ? 1 : 0, _t = (e) => new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format(e), _e = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), $t = (e, n) => {
919
+ const i = ln().domain([t, r]).range([0, 1]), o = ke(n.minColor, n.maxColor);
920
+ return (s) => o(i(s));
921
+ }, St = (e) => e <= 1.35 ? 2 : e <= 2.1 ? 1 : 0, Et = (e) => new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format(e), Re = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), It = (e, n) => {
879
922
  let t = e.trim();
880
923
  if (!t) return t;
881
924
  const r = n?.trim().toUpperCase();
882
925
  return r && /^[A-Z]{2}$/.test(r) && (t = t.replace(new RegExp(`\\s*\\(${r}\\)`, "gi"), "").replace(new RegExp(`\\s*\\[${r}\\]`, "gi"), "").replace(new RegExp(`\\s*[-–—]\\s*${r}\\s*$`, "i"), "").replace(new RegExp(`\\s+${r}\\s*$`, "i"), "")), t.trim() || e.trim();
883
- }, Rt = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), kt = /* @__PURE__ */ new Set([
926
+ }, Ft = (e) => e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()), jt = /* @__PURE__ */ new Set([
884
927
  "countrycode",
885
928
  "country_code",
886
929
  "iso_a2",
887
930
  "iso",
888
931
  "adm0_a3",
889
932
  "iso_3166_1"
890
- ]), Ct = (e) => kt.has(e.toLowerCase()), Lt = (e, n) => e.toLowerCase() === "revenue" ? new Intl.NumberFormat("en-US", {
933
+ ]), Pt = (e) => jt.has(e.toLowerCase()), Ot = (e, n) => e.toLowerCase() === "revenue" ? new Intl.NumberFormat("en-US", {
891
934
  style: "currency",
892
935
  currency: "USD",
893
936
  notation: "compact",
894
937
  maximumFractionDigits: 1
895
- }).format(n) : _t(n), We = "cool-globe-float-tooltip-override", At = () => {
896
- if (typeof document > "u" || document.getElementById(We)) return;
938
+ }).format(n) : Et(n), rn = "cool-globe-float-tooltip-override", zt = () => {
939
+ if (typeof document > "u" || document.getElementById(rn)) return;
897
940
  const e = document.createElement("style");
898
- e.id = We, e.textContent = `
941
+ e.id = rn, e.textContent = `
899
942
  .cool-globe-host .float-tooltip-kap {
900
943
  background: transparent !important;
901
944
  background-color: transparent !important;
@@ -908,227 +951,226 @@ const Me = (e, n) => {
908
951
  color: transparent !important;
909
952
  }
910
953
  `, document.head.appendChild(e);
911
- }, Ft = ({
954
+ }, Dt = ({
912
955
  statisticsData: e,
913
956
  resetSignal: n,
914
- countryNumericToIsoMap: t = {},
915
- countryNameToIsoMap: r = {},
916
- primaryMetric: i = "visits",
917
- colorScale: a = wn
957
+ preselectedCountry: t,
958
+ countryNumericToIsoMap: r = {},
959
+ countryNameToIsoMap: i = {},
960
+ primaryMetric: o = "visits",
961
+ colorScale: s = Cn
918
962
  }) => {
919
- const o = B(null), s = B(null), l = B(void 0), f = B({}), h = B(null), u = B(n), [d, w] = T(0), [v, R] = T(), [j, E] = T(), [K, D] = T(null), [k, re] = T([]), [M, V] = T([]), [ie, oe] = T({
963
+ const a = V(null), l = V(null), f = V(void 0), d = V({}), c = V(null), h = V(n), N = V(void 0), [k, L] = G(!1), [w, A] = G(0), [M, J] = G(), [I, U] = G(), [R, re] = G(null), [F, ie] = G([]), [oe, D] = G([]), [g, P] = G({
920
964
  width: 900,
921
965
  height: 760
922
966
  });
923
- P(() => {
924
- At();
967
+ z(() => {
968
+ zt();
925
969
  }, []);
926
- const ae = se(
970
+ const _ = se(
927
971
  () => Object.values(e.countries).map(
928
- (c) => Me(c, i)
972
+ (u) => $e(u, o)
929
973
  ),
930
- [i, e.countries]
931
- ), X = se(() => v ? Object.values(e.regions[v] ?? {}).map(
932
- (c) => Me(c, i)
933
- ) : [], [v, i, e.regions]), p = se(
934
- () => Xe(ae, a),
935
- [ae, a]
936
- ), I = se(
937
- () => Xe(X, a),
938
- [X, a]
974
+ [o, e.countries]
975
+ ), O = se(() => M ? Object.values(e.regions[M] ?? {}).map(
976
+ (u) => $e(u, o)
977
+ ) : [], [M, o, e.regions]), ae = se(
978
+ () => tn(_, s),
979
+ [_, s]
980
+ ), K = se(
981
+ () => tn(O, s),
982
+ [O, s]
939
983
  );
940
- P(() => {
984
+ z(() => {
941
985
  (async () => {
942
986
  let m = [];
943
987
  try {
944
- m = (await (await fetch(pn)).json()).features;
988
+ m = (await (await fetch(Mn)).json()).features;
945
989
  } catch {
946
- const g = await (await fetch(xn)).json(), b = g.objects.countries, N = mn(
947
- g,
948
- b
990
+ const b = await (await fetch(_n)).json(), p = b.objects.countries, v = vn(
991
+ b,
992
+ p
949
993
  );
950
- m = N.type === "FeatureCollection" ? N.features : [N];
994
+ m = v.type === "FeatureCollection" ? v.features : [v];
951
995
  }
952
996
  const y = m.map((x) => {
953
- const g = String(x.id ?? ""), b = x.properties ?? {}, N = String(
954
- b.name ?? b.NAME ?? b.name_en ?? b.ADMIN ?? ""
955
- ).trim() || `Country ${g}`, H = N.toLowerCase(), F = String(
956
- b.iso_a2 ?? b.ISO_A2 ?? b.iso_a2_eh ?? ""
957
- ).trim().toUpperCase(), ye = t[g] ?? r[H] ?? (F && F !== "-99" ? F : void 0) ?? (g.length === 2 ? g.toUpperCase() : g);
997
+ const b = String(x.id ?? ""), p = x.properties ?? {}, v = String(
998
+ p.name ?? p.NAME ?? p.name_en ?? p.ADMIN ?? ""
999
+ ).trim() || `Country ${b}`, q = v.toLowerCase(), T = String(
1000
+ p.iso_a2 ?? p.ISO_A2 ?? p.iso_a2_eh ?? ""
1001
+ ).trim().toUpperCase(), we = r[b] ?? i[q] ?? (T && T !== "-99" ? T : void 0) ?? (b.length === 2 ? b.toUpperCase() : b);
958
1002
  return {
959
1003
  ...x,
960
1004
  properties: {
961
- ...b,
962
- __isoA2: ye,
963
- name: N || ye || `Country ${g}`
1005
+ ...p,
1006
+ __isoA2: we,
1007
+ name: v || we || `Country ${b}`
964
1008
  }
965
1009
  };
966
1010
  });
967
- re(y);
1011
+ ie(y);
968
1012
  })();
969
- }, []), P(() => {
970
- if (!s.current) return;
971
- const c = new ResizeObserver((m) => {
1013
+ }, []), z(() => {
1014
+ if (!l.current) return;
1015
+ const u = new ResizeObserver((m) => {
972
1016
  const y = m[0];
973
- y && oe({
1017
+ y && P({
974
1018
  width: Math.max(360, Math.floor(y.contentRect.width)),
975
1019
  height: Math.max(520, Math.floor(y.contentRect.height))
976
1020
  });
977
1021
  });
978
- return c.observe(s.current), () => c.disconnect();
979
- }, []), P(() => {
980
- if (!v) {
981
- V([]);
1022
+ return u.observe(l.current), () => u.disconnect();
1023
+ }, []), z(() => {
1024
+ if (!M) {
1025
+ D([]);
982
1026
  return;
983
1027
  }
984
- const c = f.current[v];
985
- if (c) {
986
- V(c);
1028
+ const u = d.current[M];
1029
+ if (u) {
1030
+ D(u);
987
1031
  return;
988
1032
  }
989
1033
  (async () => {
990
- if (!h.current) {
991
- const b = await (await fetch(bn)).json();
992
- h.current = b.features;
1034
+ if (!c.current) {
1035
+ const p = await (await fetch($n)).json();
1036
+ c.current = p.features;
993
1037
  }
994
- const x = (h.current ?? []).filter(
995
- (g) => (g.properties ?? {}).iso_a2 === v
996
- ).map((g) => {
997
- const b = g.properties ?? {}, N = String(b.name ?? "").trim();
1038
+ const x = (c.current ?? []).filter(
1039
+ (b) => (b.properties ?? {}).iso_a2 === M
1040
+ ).map((b) => {
1041
+ const p = b.properties ?? {}, v = String(p.name ?? "").trim();
998
1042
  return {
999
- ...g,
1043
+ ...b,
1000
1044
  properties: {
1001
- ...b,
1002
- __countryCode: v,
1003
- __regionName: N,
1004
- name: N
1045
+ ...p,
1046
+ __countryCode: M,
1047
+ __regionName: v,
1048
+ name: v
1005
1049
  }
1006
1050
  };
1007
1051
  });
1008
- f.current[v] = x, V(x);
1052
+ d.current[M] = x, D(x);
1009
1053
  })();
1010
- }, [v]), P(() => {
1011
- if (j && d < 2) return void w(2);
1012
- v && d < 1 && w(1);
1013
- }, [v, j, d]), P(() => {
1014
- const c = o.current?.controls?.();
1015
- if (!c) return;
1016
- c.autoRotate = !0, c.autoRotateSpeed = 0.45, c.enablePan = !1, c.enableZoom = !0;
1017
- const m = o.current?.renderer?.();
1054
+ }, [M]), z(() => {
1055
+ if (I && w < 2) return void A(2);
1056
+ M && w < 1 && A(1);
1057
+ }, [M, I, w]), z(() => {
1058
+ const u = a.current?.controls?.();
1059
+ if (!u) return;
1060
+ u.autoRotate = !0, u.autoRotateSpeed = 0.45, u.enablePan = !1, u.enableZoom = !0;
1061
+ const m = a.current?.renderer?.();
1018
1062
  m && m.setPixelRatio(Math.min(window.devicePixelRatio, 1.5));
1019
- }, []), P(() => {
1020
- const c = o.current?.controls?.();
1021
- c && (c.autoRotate = !v && d === 0);
1022
- }, [v, d]), P(() => {
1023
- if (n === u.current) return;
1024
- u.current = n, w(0), R(void 0), E(void 0), D(null), V([]);
1025
- const c = o.current?.controls?.();
1026
- c && (c.autoRotate = !0), o.current?.pointOfView({ lat: 20, lng: 15, altitude: 2.6 }, 650);
1027
- }, [n]);
1028
- const _ = () => {
1029
- const c = o.current?.globeMaterial?.();
1030
- c && (c.map = null, c.color = new we("#f5f5f5"), c.emissive = new we("#ffffff"), c.emissiveIntensity = 0.35, c.specular = new we("#d4d4d8"), c.shininess = 3, c.needsUpdate = !0);
1031
- }, A = (c, m, y) => {
1032
- o.current?.pointOfView({ lat: c, lng: m, altitude: y }, 650);
1033
- }, W = () => {
1034
- const c = o.current?.controls?.();
1035
- c && (c.autoRotate = !1);
1036
- }, q = (c) => {
1037
- if (typeof c != "object" || c === null || !("coordinates" in c))
1038
- return [];
1039
- const m = c.coordinates, y = [], x = (g) => {
1040
- if (Array.isArray(g)) {
1041
- if (g.length >= 2 && typeof g[0] == "number" && typeof g[1] == "number") {
1042
- y.push([g[0], g[1]]);
1043
- return;
1044
- }
1045
- g.forEach(x);
1046
- }
1047
- };
1048
- return x(m), y;
1049
- }, O = (c) => {
1050
- const m = q(c.geometry);
1051
- if (!m.length) return;
1052
- const y = m.reduce(
1053
- (x, [g, b]) => ({
1054
- minLat: Math.min(x.minLat, b),
1055
- maxLat: Math.max(x.maxLat, b),
1056
- minLng: Math.min(x.minLng, g),
1057
- maxLng: Math.max(x.maxLng, g)
1058
- }),
1059
- {
1060
- minLat: Number.POSITIVE_INFINITY,
1061
- maxLat: Number.NEGATIVE_INFINITY,
1062
- minLng: Number.POSITIVE_INFINITY,
1063
- maxLng: Number.NEGATIVE_INFINITY
1064
- }
1063
+ }, []), z(() => {
1064
+ const u = a.current?.controls?.();
1065
+ u && (u.autoRotate = !M && w === 0);
1066
+ }, [M, w]);
1067
+ const S = ve((u, m, y) => {
1068
+ a.current?.pointOfView({ lat: u, lng: m, altitude: y }, 650);
1069
+ }, []), H = ve(() => {
1070
+ const u = a.current?.controls?.();
1071
+ u && (u.autoRotate = !1);
1072
+ }, []), $ = ve(
1073
+ (u, m, y) => {
1074
+ const x = de(u);
1075
+ if (!x || (H(), A(1), J(x), U(void 0), y?.focusCamera === !1)) return;
1076
+ const b = m ?? Qe(
1077
+ F,
1078
+ x,
1079
+ i
1080
+ ), p = b ? en(b) : void 0;
1081
+ p && S(
1082
+ (p.minLat + p.maxLat) / 2,
1083
+ (p.minLng + p.maxLng) / 2,
1084
+ nn(p)
1085
+ );
1086
+ },
1087
+ [F, i, S, H]
1088
+ );
1089
+ z(() => {
1090
+ if (n === h.current) return;
1091
+ h.current = n, U(void 0), re(null), N.current = void 0;
1092
+ const u = t?.trim() ? de(t) : void 0;
1093
+ if (u) {
1094
+ $(u);
1095
+ return;
1096
+ }
1097
+ A(0), J(void 0), D([]);
1098
+ const m = a.current?.controls?.();
1099
+ m && (m.autoRotate = !0), S(20, 15, 2.6);
1100
+ }, [S, t, n, $]), z(() => {
1101
+ const u = t?.trim() ? de(t) : void 0;
1102
+ if (!u || !k || !F.length) return;
1103
+ const m = `${u}:${String(n ?? "")}`;
1104
+ if (N.current === m) return;
1105
+ const y = Qe(
1106
+ F,
1107
+ u,
1108
+ i
1065
1109
  );
1066
- if (!(!Number.isFinite(y.minLat) || !Number.isFinite(y.minLng)))
1067
- return y;
1068
- }, z = (c) => {
1069
- const m = Math.max(0.1, c.maxLat - c.minLat), y = Math.max(0.1, c.maxLng - c.minLng), g = Math.max(m, y) / 112;
1070
- return Math.min(0.9, Math.max(0.14, g));
1071
- }, C = () => {
1072
- l.current && window.clearTimeout(l.current), l.current = window.setTimeout(() => {
1073
- const c = o.current?.pointOfView?.().altitude ?? 2.4, m = Mt(c);
1074
- w(m), m <= 0 && E(void 0);
1110
+ $(u, y), N.current = m;
1111
+ }, [
1112
+ F,
1113
+ i,
1114
+ k,
1115
+ t,
1116
+ n,
1117
+ $
1118
+ ]);
1119
+ const dn = () => {
1120
+ const u = a.current?.globeMaterial?.();
1121
+ u && (u.map = null, u.color = new Ne("#f5f5f5"), u.emissive = new Ne("#ffffff"), u.emissiveIntensity = 0.35, u.specular = new Ne("#d4d4d8"), u.shininess = 3, u.needsUpdate = !0);
1122
+ }, mn = () => {
1123
+ f.current && window.clearTimeout(f.current), f.current = window.setTimeout(() => {
1124
+ const u = a.current?.pointOfView?.().altitude ?? 2.4, m = St(u);
1125
+ A(m), m <= 0 && U(void 0);
1075
1126
  }, 120);
1076
- }, sn = (c) => {
1077
- const m = c.properties ?? {};
1078
- if (d === 0) {
1079
- const y = r[String(m.name ?? "").toLowerCase()], x = m.__isoA2 ?? (typeof m.iso_a2 == "string" ? m.iso_a2.toUpperCase() : void 0) ?? y;
1127
+ }, hn = (u) => {
1128
+ const m = u.properties ?? {};
1129
+ if (w === 0) {
1130
+ const y = i[String(m.name ?? "").toLowerCase()], x = m.__isoA2 ?? (typeof m.iso_a2 == "string" ? m.iso_a2.toUpperCase() : void 0) ?? y;
1080
1131
  if (!x) return;
1081
- W(), w(1), R(x), E(void 0);
1082
- const g = O(c);
1083
- if (g) {
1084
- A(
1085
- (g.minLat + g.maxLat) / 2,
1086
- (g.minLng + g.maxLng) / 2,
1087
- z(g)
1088
- );
1089
- return;
1090
- }
1132
+ $(x, u);
1091
1133
  return;
1092
1134
  }
1093
- if (d >= 1) {
1135
+ if (w >= 1) {
1094
1136
  const y = m.__regionName;
1095
1137
  if (!y) return;
1096
- W(), w(2), E(y);
1097
- const x = O(c);
1138
+ H(), A(2), U(y);
1139
+ const x = en(u);
1098
1140
  if (x) {
1099
- A(
1141
+ S(
1100
1142
  (x.minLat + x.maxLat) / 2,
1101
1143
  (x.minLng + x.maxLng) / 2,
1102
- Math.max(0.2, z(x) * 0.52)
1144
+ Math.max(0.2, nn(x) * 0.52)
1103
1145
  );
1104
1146
  return;
1105
1147
  }
1106
1148
  }
1107
- }, fn = d === 0 ? k : M.length ? [...k, ...M] : k, je = (c, m) => {
1108
- if (m && c)
1109
- return e.regions[c]?.[m];
1110
- if (c) return e.countries[c];
1111
- }, cn = (c) => {
1112
- if (!c)
1149
+ }, gn = w === 0 ? F : oe.length ? [...F, ...oe] : F, Pe = (u, m) => {
1150
+ if (m && u)
1151
+ return e.regions[u]?.[m];
1152
+ if (u) return e.countries[u];
1153
+ }, pn = (u) => {
1154
+ if (!u)
1113
1155
  return '<div style="color:#697386;font-weight:500;font-size:15px;">No data available</div>';
1114
- const m = Object.entries(c).filter(
1115
- ([b, N]) => !Ct(b) && typeof N == "number" && Number.isFinite(N)
1156
+ const m = Object.entries(u).filter(
1157
+ ([p, v]) => !Pt(p) && typeof v == "number" && Number.isFinite(v)
1116
1158
  );
1117
1159
  if (!m.length)
1118
1160
  return '<div style="color:#697386;font-weight:500;font-size:15px;">No data available</div>';
1119
- m.sort(([b], [N]) => b === i ? -1 : N === i ? 1 : b.localeCompare(N));
1120
- const y = "display:flex;justify-content:space-between;align-items:center;gap:24px;padding:6px 0;", x = "font-weight:500;color:#697386;font-size:15px;", g = "font-weight:600;color:#1A1F36;font-size:15px;font-variant-numeric:tabular-nums;white-space:nowrap;";
1121
- return m.map(([b, N]) => {
1122
- const H = _e(Rt(b)), F = _e(
1123
- Lt(b, N)
1161
+ m.sort(([p], [v]) => p === o ? -1 : v === o ? 1 : p.localeCompare(v));
1162
+ const y = "display:flex;justify-content:space-between;align-items:center;gap:24px;padding:6px 0;", x = "font-weight:500;color:#697386;font-size:15px;", b = "font-weight:600;color:#1A1F36;font-size:15px;font-variant-numeric:tabular-nums;white-space:nowrap;";
1163
+ return m.map(([p, v]) => {
1164
+ const q = Re(Ft(p)), T = Re(
1165
+ Ot(p, v)
1124
1166
  );
1125
- return `<div style="${y}"><span style="${x}">${H}</span><span style="${g}">${F}</span></div>`;
1167
+ return `<div style="${y}"><span style="${x}">${q}</span><span style="${b}">${T}</span></div>`;
1126
1168
  }).join("");
1127
1169
  };
1128
- return /* @__PURE__ */ Fe(
1170
+ return /* @__PURE__ */ Oe(
1129
1171
  "div",
1130
1172
  {
1131
- ref: s,
1173
+ ref: l,
1132
1174
  className: "cool-globe-host",
1133
1175
  style: {
1134
1176
  position: "relative",
@@ -1136,58 +1178,58 @@ const Me = (e, n) => {
1136
1178
  overflow: "hidden",
1137
1179
  background: "white"
1138
1180
  },
1139
- children: /* @__PURE__ */ Fe(
1140
- un,
1181
+ children: /* @__PURE__ */ Oe(
1182
+ xn,
1141
1183
  {
1142
- ref: o,
1143
- globeImageUrl: yn,
1184
+ ref: a,
1185
+ globeImageUrl: Rn,
1144
1186
  backgroundColor: "#ffffff",
1145
- polygonsData: fn,
1187
+ polygonsData: gn,
1146
1188
  polygonAltitude: 0.01,
1147
1189
  polygonsTransitionDuration: 180,
1148
- polygonCapColor: (c) => {
1149
- const m = c.properties ?? {}, y = !!m.__regionName;
1150
- if (d > 0 && !y)
1190
+ polygonCapColor: (u) => {
1191
+ const m = u.properties ?? {}, y = !!m.__regionName;
1192
+ if (w > 0 && !y)
1151
1193
  return "rgba(148,163,184,0.027)";
1152
- const x = d === 0 ? m.__isoA2 : m.__countryCode, g = m.__regionName, b = je(x, g), N = Me(b, i), H = d === 0 ? p(N) : I(N);
1153
- return K === c ? "#60a5fa" : H;
1194
+ const x = w === 0 ? m.__isoA2 : m.__countryCode, b = m.__regionName, p = Pe(x, b), v = $e(p, o), q = w === 0 ? ae(v) : K(v);
1195
+ return R === u ? "#60a5fa" : q;
1154
1196
  },
1155
- polygonSideColor: (c) => {
1156
- const m = c.properties ?? {};
1157
- return d > 0 && !m.__regionName ? "rgba(148,163,184,0.027)" : m.__regionName ? "rgba(148,163,184,0.22)" : "rgba(226,232,240,0.45)";
1197
+ polygonSideColor: (u) => {
1198
+ const m = u.properties ?? {};
1199
+ return w > 0 && !m.__regionName ? "rgba(148,163,184,0.027)" : m.__regionName ? "rgba(148,163,184,0.22)" : "rgba(226,232,240,0.45)";
1158
1200
  },
1159
- polygonStrokeColor: (c) => {
1160
- const m = c.properties ?? {};
1161
- return d > 0 && !m.__regionName ? "rgba(100,116,139,0.067)" : m.__regionName ? "rgba(51,65,85,0.98)" : "rgba(156,163,175,0.95)";
1201
+ polygonStrokeColor: (u) => {
1202
+ const m = u.properties ?? {};
1203
+ return w > 0 && !m.__regionName ? "rgba(100,116,139,0.067)" : m.__regionName ? "rgba(51,65,85,0.98)" : "rgba(156,163,175,0.95)";
1162
1204
  },
1163
- polygonLabel: (c) => {
1164
- const m = c.properties ?? {};
1165
- if (d > 0 && !m.__regionName)
1205
+ polygonLabel: (u) => {
1206
+ const m = u.properties ?? {};
1207
+ if (w > 0 && !m.__regionName)
1166
1208
  return "";
1167
- const y = d === 0 ? m.__isoA2 : m.__countryCode, x = m.__regionName, g = x ?? m.name ?? "Unknown", b = d === 0 ? m.__isoA2 : m.__countryCode ?? m.__isoA2, N = $t(
1168
- String(g),
1169
- b
1170
- ), H = je(y, x), F = cn(H);
1209
+ const y = w === 0 ? m.__isoA2 : m.__countryCode, x = m.__regionName, b = x ?? m.name ?? "Unknown", p = w === 0 ? m.__isoA2 : m.__countryCode ?? m.__isoA2, v = It(
1210
+ String(b),
1211
+ p
1212
+ ), q = Pe(y, x), T = pn(q);
1171
1213
  return `<div style="font-family:system-ui,-apple-system,'Segoe UI',Roboto,Inter,sans-serif;min-width:272px;max-width:320px;padding:20px;background:#ffffff;color:#1A1F36;border-radius:14px;box-shadow:0 8px 24px rgba(15,23,42,0.12);">
1172
- <div style="font-size:17px;font-weight:600;color:#1A1F36;line-height:1.25;margin-bottom:4px;">${_e(N)}</div>
1173
- <div style="margin-top:8px;">${F}</div>
1214
+ <div style="font-size:17px;font-weight:600;color:#1A1F36;line-height:1.25;margin-bottom:4px;">${Re(v)}</div>
1215
+ <div style="margin-top:8px;">${T}</div>
1174
1216
  </div>`;
1175
1217
  },
1176
- onPolygonHover: (c) => {
1177
- D(c ?? null);
1218
+ onPolygonHover: (u) => {
1219
+ re(u ?? null);
1178
1220
  },
1179
- onPolygonClick: (c) => sn(c),
1180
- onZoom: C,
1221
+ onPolygonClick: (u) => hn(u),
1222
+ onZoom: mn,
1181
1223
  onGlobeReady: () => {
1182
- _(), A(20, 15, 2.6);
1224
+ dn(), L(!0), t?.trim() || S(20, 15, 2.6);
1183
1225
  },
1184
1226
  onGlobeClick: () => {
1185
- const c = o.current?.controls?.();
1186
- c && (c.autoRotate = !1);
1227
+ const u = a.current?.controls?.();
1228
+ u && (u.autoRotate = !1);
1187
1229
  },
1188
1230
  lineHoverPrecision: 0,
1189
- width: ie.width,
1190
- height: ie.height,
1231
+ width: g.width,
1232
+ height: g.height,
1191
1233
  showAtmosphere: !1
1192
1234
  }
1193
1235
  )
@@ -1195,5 +1237,5 @@ const Me = (e, n) => {
1195
1237
  );
1196
1238
  };
1197
1239
  export {
1198
- Ft as CoolGlobe
1240
+ Dt as CoolGlobe
1199
1241
  };