cool-globe 0.1.2 → 0.1.3

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,1224 +1,99 @@
1
- import { jsx as Ze } from "react/jsx-runtime";
2
- import { useRef as W, useState as U, useMemo as me, useEffect as V } from "react";
3
- import At from "react-globe.gl";
4
- function _t(t) {
5
- return t;
6
- }
7
- function St(t) {
8
- if (t == null) return _t;
9
- var e, n, r = t.scale[0], i = t.scale[1], o = t.translate[0], s = t.translate[1];
10
- return function(a, c) {
11
- c || (e = n = 0);
12
- var u = 2, f = a.length, l = new Array(f);
13
- for (l[0] = (e += a[0]) * r + o, l[1] = (n += a[1]) * i + s; u < f; ) l[u] = a[u], ++u;
14
- return l;
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) {
6
+ return e;
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) {
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;
15
16
  };
16
17
  }
17
- function Rt(t, e) {
18
- for (var n, r = t.length, i = r - e; i < --r; ) n = t[i], t[i++] = t[r], t[r] = n;
19
- }
20
- function Lt(t, e) {
21
- return typeof e == "string" && (e = t.objects[e]), e.type === "GeometryCollection" ? { type: "FeatureCollection", features: e.geometries.map(function(n) {
22
- return Ye(t, n);
23
- }) } : Ye(t, e);
24
- }
25
- function Ye(t, e) {
26
- var n = e.id, r = e.bbox, i = e.properties == null ? {} : e.properties, o = Bt(t, e);
27
- return n == null && r == null ? { type: "Feature", properties: i, geometry: o } : r == null ? { type: "Feature", id: n, properties: i, geometry: o } : { type: "Feature", id: n, bbox: r, properties: i, geometry: o };
28
- }
29
- function Bt(t, e) {
30
- var n = St(t.transform), r = t.arcs;
31
- function i(f, l) {
32
- l.length && l.pop();
33
- for (var g = r[f < 0 ? ~f : f], w = 0, y = g.length; w < y; ++w)
34
- l.push(n(g[w], w));
35
- f < 0 && Rt(l, y);
18
+ function hn(e, n) {
19
+ for (var t, r = e.length, i = r - n; i < --r; ) t = e[i], e[i++] = e[r], e[r] = t;
20
+ }
21
+ function mn(e, n) {
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);
36
37
  }
37
- function o(f) {
38
- return n(f);
38
+ function a(h) {
39
+ return t(h);
39
40
  }
40
- function s(f) {
41
- for (var l = [], g = 0, w = f.length; g < w; ++g) i(f[g], l);
42
- return l.length < 2 && l.push(l[0]), l;
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;
43
44
  }
44
- function a(f) {
45
- for (var l = s(f); l.length < 4; ) l.push(l[0]);
46
- return l;
45
+ function s(h) {
46
+ for (var u = o(h); u.length < 4; ) u.push(u[0]);
47
+ return u;
47
48
  }
48
- function c(f) {
49
- return f.map(a);
49
+ function l(h) {
50
+ return h.map(s);
50
51
  }
51
- function u(f) {
52
- var l = f.type, g;
53
- switch (l) {
52
+ function f(h) {
53
+ var u = h.type, d;
54
+ switch (u) {
54
55
  case "GeometryCollection":
55
- return { type: l, geometries: f.geometries.map(u) };
56
+ return { type: u, geometries: h.geometries.map(f) };
56
57
  case "Point":
57
- g = o(f.coordinates);
58
+ d = a(h.coordinates);
58
59
  break;
59
60
  case "MultiPoint":
60
- g = f.coordinates.map(o);
61
+ d = h.coordinates.map(a);
61
62
  break;
62
63
  case "LineString":
63
- g = s(f.arcs);
64
+ d = o(h.arcs);
64
65
  break;
65
66
  case "MultiLineString":
66
- g = f.arcs.map(s);
67
+ d = h.arcs.map(o);
67
68
  break;
68
69
  case "Polygon":
69
- g = c(f.arcs);
70
+ d = l(h.arcs);
70
71
  break;
71
72
  case "MultiPolygon":
72
- g = f.arcs.map(c);
73
+ d = h.arcs.map(l);
73
74
  break;
74
75
  default:
75
76
  return null;
76
77
  }
77
- return { type: l, coordinates: g };
78
- }
79
- return u(e);
80
- }
81
- const xt = "180", $t = "", B = "srgb", Xe = "srgb-linear", We = "linear", _e = "srgb";
82
- function ie(t, e, n) {
83
- return Math.max(e, Math.min(n, t));
84
- }
85
- function Dt(t, e) {
86
- return (t % e + e) % e;
87
- }
88
- function Se(t, e, n) {
89
- return (1 - n) * t + n * e;
90
- }
91
- class ce {
92
- /**
93
- * Constructs a new 3x3 matrix. The arguments are supposed to be
94
- * in row-major order. If no arguments are provided, the constructor
95
- * initializes the matrix as an identity matrix.
96
- *
97
- * @param {number} [n11] - 1-1 matrix element.
98
- * @param {number} [n12] - 1-2 matrix element.
99
- * @param {number} [n13] - 1-3 matrix element.
100
- * @param {number} [n21] - 2-1 matrix element.
101
- * @param {number} [n22] - 2-2 matrix element.
102
- * @param {number} [n23] - 2-3 matrix element.
103
- * @param {number} [n31] - 3-1 matrix element.
104
- * @param {number} [n32] - 3-2 matrix element.
105
- * @param {number} [n33] - 3-3 matrix element.
106
- */
107
- constructor(e, n, r, i, o, s, a, c, u) {
108
- ce.prototype.isMatrix3 = !0, this.elements = [
109
- 1,
110
- 0,
111
- 0,
112
- 0,
113
- 1,
114
- 0,
115
- 0,
116
- 0,
117
- 1
118
- ], e !== void 0 && this.set(e, n, r, i, o, s, a, c, u);
119
- }
120
- /**
121
- * Sets the elements of the matrix.The arguments are supposed to be
122
- * in row-major order.
123
- *
124
- * @param {number} [n11] - 1-1 matrix element.
125
- * @param {number} [n12] - 1-2 matrix element.
126
- * @param {number} [n13] - 1-3 matrix element.
127
- * @param {number} [n21] - 2-1 matrix element.
128
- * @param {number} [n22] - 2-2 matrix element.
129
- * @param {number} [n23] - 2-3 matrix element.
130
- * @param {number} [n31] - 3-1 matrix element.
131
- * @param {number} [n32] - 3-2 matrix element.
132
- * @param {number} [n33] - 3-3 matrix element.
133
- * @return {Matrix3} A reference to this matrix.
134
- */
135
- set(e, n, r, i, o, s, a, c, u) {
136
- const f = this.elements;
137
- return f[0] = e, f[1] = i, f[2] = a, f[3] = n, f[4] = o, f[5] = c, f[6] = r, f[7] = s, f[8] = u, this;
138
- }
139
- /**
140
- * Sets this matrix to the 3x3 identity matrix.
141
- *
142
- * @return {Matrix3} A reference to this matrix.
143
- */
144
- identity() {
145
- return this.set(
146
- 1,
147
- 0,
148
- 0,
149
- 0,
150
- 1,
151
- 0,
152
- 0,
153
- 0,
154
- 1
155
- ), this;
156
- }
157
- /**
158
- * Copies the values of the given matrix to this instance.
159
- *
160
- * @param {Matrix3} m - The matrix to copy.
161
- * @return {Matrix3} A reference to this matrix.
162
- */
163
- copy(e) {
164
- const n = this.elements, r = e.elements;
165
- return n[0] = r[0], n[1] = r[1], n[2] = r[2], n[3] = r[3], n[4] = r[4], n[5] = r[5], n[6] = r[6], n[7] = r[7], n[8] = r[8], this;
166
- }
167
- /**
168
- * Extracts the basis of this matrix into the three axis vectors provided.
169
- *
170
- * @param {Vector3} xAxis - The basis's x axis.
171
- * @param {Vector3} yAxis - The basis's y axis.
172
- * @param {Vector3} zAxis - The basis's z axis.
173
- * @return {Matrix3} A reference to this matrix.
174
- */
175
- extractBasis(e, n, r) {
176
- return e.setFromMatrix3Column(this, 0), n.setFromMatrix3Column(this, 1), r.setFromMatrix3Column(this, 2), this;
177
- }
178
- /**
179
- * Set this matrix to the upper 3x3 matrix of the given 4x4 matrix.
180
- *
181
- * @param {Matrix4} m - The 4x4 matrix.
182
- * @return {Matrix3} A reference to this matrix.
183
- */
184
- setFromMatrix4(e) {
185
- const n = e.elements;
186
- return this.set(
187
- n[0],
188
- n[4],
189
- n[8],
190
- n[1],
191
- n[5],
192
- n[9],
193
- n[2],
194
- n[6],
195
- n[10]
196
- ), this;
197
- }
198
- /**
199
- * Post-multiplies this matrix by the given 3x3 matrix.
200
- *
201
- * @param {Matrix3} m - The matrix to multiply with.
202
- * @return {Matrix3} A reference to this matrix.
203
- */
204
- multiply(e) {
205
- return this.multiplyMatrices(this, e);
206
- }
207
- /**
208
- * Pre-multiplies this matrix by the given 3x3 matrix.
209
- *
210
- * @param {Matrix3} m - The matrix to multiply with.
211
- * @return {Matrix3} A reference to this matrix.
212
- */
213
- premultiply(e) {
214
- return this.multiplyMatrices(e, this);
215
- }
216
- /**
217
- * Multiples the given 3x3 matrices and stores the result
218
- * in this matrix.
219
- *
220
- * @param {Matrix3} a - The first matrix.
221
- * @param {Matrix3} b - The second matrix.
222
- * @return {Matrix3} A reference to this matrix.
223
- */
224
- multiplyMatrices(e, n) {
225
- const r = e.elements, i = n.elements, o = this.elements, s = r[0], a = r[3], c = r[6], u = r[1], f = r[4], l = r[7], g = r[2], w = r[5], y = r[8], F = i[0], S = i[3], _ = i[6], O = i[1], D = i[4], v = i[7], j = i[2], M = i[5], T = i[8];
226
- return o[0] = s * F + a * O + c * j, o[3] = s * S + a * D + c * M, o[6] = s * _ + a * v + c * T, o[1] = u * F + f * O + l * j, o[4] = u * S + f * D + l * M, o[7] = u * _ + f * v + l * T, o[2] = g * F + w * O + y * j, o[5] = g * S + w * D + y * M, o[8] = g * _ + w * v + y * T, this;
227
- }
228
- /**
229
- * Multiplies every component of the matrix by the given scalar.
230
- *
231
- * @param {number} s - The scalar.
232
- * @return {Matrix3} A reference to this matrix.
233
- */
234
- multiplyScalar(e) {
235
- const n = this.elements;
236
- return n[0] *= e, n[3] *= e, n[6] *= e, n[1] *= e, n[4] *= e, n[7] *= e, n[2] *= e, n[5] *= e, n[8] *= e, this;
237
- }
238
- /**
239
- * Computes and returns the determinant of this matrix.
240
- *
241
- * @return {number} The determinant.
242
- */
243
- determinant() {
244
- const e = this.elements, n = e[0], r = e[1], i = e[2], o = e[3], s = e[4], a = e[5], c = e[6], u = e[7], f = e[8];
245
- return n * s * f - n * a * u - r * o * f + r * a * c + i * o * u - i * s * c;
246
- }
247
- /**
248
- * Inverts this matrix, using the [analytic method]{@link https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution}.
249
- * You can not invert with a determinant of zero. If you attempt this, the method produces
250
- * a zero matrix instead.
251
- *
252
- * @return {Matrix3} A reference to this matrix.
253
- */
254
- invert() {
255
- const e = this.elements, n = e[0], r = e[1], i = e[2], o = e[3], s = e[4], a = e[5], c = e[6], u = e[7], f = e[8], l = f * s - a * u, g = a * c - f * o, w = u * o - s * c, y = n * l + r * g + i * w;
256
- if (y === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
257
- const F = 1 / y;
258
- return e[0] = l * F, e[1] = (i * u - f * r) * F, e[2] = (a * r - i * s) * F, e[3] = g * F, e[4] = (f * n - i * c) * F, e[5] = (i * o - a * n) * F, e[6] = w * F, e[7] = (r * c - u * n) * F, e[8] = (s * n - r * o) * F, this;
259
- }
260
- /**
261
- * Transposes this matrix in place.
262
- *
263
- * @return {Matrix3} A reference to this matrix.
264
- */
265
- transpose() {
266
- let e;
267
- const n = this.elements;
268
- return e = n[1], n[1] = n[3], n[3] = e, e = n[2], n[2] = n[6], n[6] = e, e = n[5], n[5] = n[7], n[7] = e, this;
269
- }
270
- /**
271
- * Computes the normal matrix which is the inverse transpose of the upper
272
- * left 3x3 portion of the given 4x4 matrix.
273
- *
274
- * @param {Matrix4} matrix4 - The 4x4 matrix.
275
- * @return {Matrix3} A reference to this matrix.
276
- */
277
- getNormalMatrix(e) {
278
- return this.setFromMatrix4(e).invert().transpose();
279
- }
280
- /**
281
- * Transposes this matrix into the supplied array, and returns itself unchanged.
282
- *
283
- * @param {Array<number>} r - An array to store the transposed matrix elements.
284
- * @return {Matrix3} A reference to this matrix.
285
- */
286
- transposeIntoArray(e) {
287
- const n = this.elements;
288
- return e[0] = n[0], e[1] = n[3], e[2] = n[6], e[3] = n[1], e[4] = n[4], e[5] = n[7], e[6] = n[2], e[7] = n[5], e[8] = n[8], this;
289
- }
290
- /**
291
- * Sets the UV transform matrix from offset, repeat, rotation, and center.
292
- *
293
- * @param {number} tx - Offset x.
294
- * @param {number} ty - Offset y.
295
- * @param {number} sx - Repeat x.
296
- * @param {number} sy - Repeat y.
297
- * @param {number} rotation - Rotation, in radians. Positive values rotate counterclockwise.
298
- * @param {number} cx - Center x of rotation.
299
- * @param {number} cy - Center y of rotation
300
- * @return {Matrix3} A reference to this matrix.
301
- */
302
- setUvTransform(e, n, r, i, o, s, a) {
303
- const c = Math.cos(o), u = Math.sin(o);
304
- return this.set(
305
- r * c,
306
- r * u,
307
- -r * (c * s + u * a) + s + e,
308
- -i * u,
309
- i * c,
310
- -i * (-u * s + c * a) + a + n,
311
- 0,
312
- 0,
313
- 1
314
- ), this;
315
- }
316
- /**
317
- * Scales this matrix with the given scalar values.
318
- *
319
- * @param {number} sx - The amount to scale in the X axis.
320
- * @param {number} sy - The amount to scale in the Y axis.
321
- * @return {Matrix3} A reference to this matrix.
322
- */
323
- scale(e, n) {
324
- return this.premultiply(Re.makeScale(e, n)), this;
325
- }
326
- /**
327
- * Rotates this matrix by the given angle.
328
- *
329
- * @param {number} theta - The rotation in radians.
330
- * @return {Matrix3} A reference to this matrix.
331
- */
332
- rotate(e) {
333
- return this.premultiply(Re.makeRotation(-e)), this;
334
- }
335
- /**
336
- * Translates this matrix by the given scalar values.
337
- *
338
- * @param {number} tx - The amount to translate in the X axis.
339
- * @param {number} ty - The amount to translate in the Y axis.
340
- * @return {Matrix3} A reference to this matrix.
341
- */
342
- translate(e, n) {
343
- return this.premultiply(Re.makeTranslation(e, n)), this;
344
- }
345
- // for 2D Transforms
346
- /**
347
- * Sets this matrix as a 2D translation transform.
348
- *
349
- * @param {number|Vector2} x - The amount to translate in the X axis or alternatively a translation vector.
350
- * @param {number} y - The amount to translate in the Y axis.
351
- * @return {Matrix3} A reference to this matrix.
352
- */
353
- makeTranslation(e, n) {
354
- return e.isVector2 ? this.set(
355
- 1,
356
- 0,
357
- e.x,
358
- 0,
359
- 1,
360
- e.y,
361
- 0,
362
- 0,
363
- 1
364
- ) : this.set(
365
- 1,
366
- 0,
367
- e,
368
- 0,
369
- 1,
370
- n,
371
- 0,
372
- 0,
373
- 1
374
- ), this;
375
- }
376
- /**
377
- * Sets this matrix as a 2D rotational transformation.
378
- *
379
- * @param {number} theta - The rotation in radians.
380
- * @return {Matrix3} A reference to this matrix.
381
- */
382
- makeRotation(e) {
383
- const n = Math.cos(e), r = Math.sin(e);
384
- return this.set(
385
- n,
386
- -r,
387
- 0,
388
- r,
389
- n,
390
- 0,
391
- 0,
392
- 0,
393
- 1
394
- ), this;
395
- }
396
- /**
397
- * Sets this matrix as a 2D scale transform.
398
- *
399
- * @param {number} x - The amount to scale in the X axis.
400
- * @param {number} y - The amount to scale in the Y axis.
401
- * @return {Matrix3} A reference to this matrix.
402
- */
403
- makeScale(e, n) {
404
- return this.set(
405
- e,
406
- 0,
407
- 0,
408
- 0,
409
- n,
410
- 0,
411
- 0,
412
- 0,
413
- 1
414
- ), this;
415
- }
416
- /**
417
- * Returns `true` if this matrix is equal with the given one.
418
- *
419
- * @param {Matrix3} matrix - The matrix to test for equality.
420
- * @return {boolean} Whether this matrix is equal with the given one.
421
- */
422
- equals(e) {
423
- const n = this.elements, r = e.elements;
424
- for (let i = 0; i < 9; i++)
425
- if (n[i] !== r[i]) return !1;
426
- return !0;
427
- }
428
- /**
429
- * Sets the elements of the matrix from the given array.
430
- *
431
- * @param {Array<number>} array - The matrix elements in column-major order.
432
- * @param {number} [offset=0] - Index of the first element in the array.
433
- * @return {Matrix3} A reference to this matrix.
434
- */
435
- fromArray(e, n = 0) {
436
- for (let r = 0; r < 9; r++)
437
- this.elements[r] = e[r + n];
438
- return this;
78
+ return { type: u, coordinates: d };
439
79
  }
440
- /**
441
- * Writes the elements of this matrix to the given array. If no array is provided,
442
- * the method returns a new instance.
443
- *
444
- * @param {Array<number>} [array=[]] - The target array holding the matrix elements in column-major order.
445
- * @param {number} [offset=0] - Index of the first element in the array.
446
- * @return {Array<number>} The matrix elements in column-major order.
447
- */
448
- toArray(e = [], n = 0) {
449
- const r = this.elements;
450
- return e[n] = r[0], e[n + 1] = r[1], e[n + 2] = r[2], e[n + 3] = r[3], e[n + 4] = r[4], e[n + 5] = r[5], e[n + 6] = r[6], e[n + 7] = r[7], e[n + 8] = r[8], e;
451
- }
452
- /**
453
- * Returns a matrix with copied values from this instance.
454
- *
455
- * @return {Matrix3} A clone of this instance.
456
- */
457
- clone() {
458
- return new this.constructor().fromArray(this.elements);
459
- }
460
- }
461
- const Re = /* @__PURE__ */ new ce(), Je = {};
462
- function Qe(t) {
463
- t in Je || (Je[t] = !0, console.warn(t));
464
- }
465
- const Ke = /* @__PURE__ */ new ce().set(
466
- 0.4123908,
467
- 0.3575843,
468
- 0.1804808,
469
- 0.212639,
470
- 0.7151687,
471
- 0.0721923,
472
- 0.0193308,
473
- 0.1191948,
474
- 0.9505322
475
- ), et = /* @__PURE__ */ new ce().set(
476
- 3.2409699,
477
- -1.5373832,
478
- -0.4986108,
479
- -0.9692436,
480
- 1.8759675,
481
- 0.0415551,
482
- 0.0556301,
483
- -0.203977,
484
- 1.0569715
485
- );
486
- function Tt() {
487
- const t = {
488
- enabled: !0,
489
- workingColorSpace: Xe,
490
- /**
491
- * Implementations of supported color spaces.
492
- *
493
- * Required:
494
- * - primaries: chromaticity coordinates [ rx ry gx gy bx by ]
495
- * - whitePoint: reference white [ x y ]
496
- * - transfer: transfer function (pre-defined)
497
- * - toXYZ: Matrix3 RGB to XYZ transform
498
- * - fromXYZ: Matrix3 XYZ to RGB transform
499
- * - luminanceCoefficients: RGB luminance coefficients
500
- *
501
- * Optional:
502
- * - outputColorSpaceConfig: { drawingBufferColorSpace: ColorSpace, toneMappingMode: 'extended' | 'standard' }
503
- * - workingColorSpaceConfig: { unpackColorSpace: ColorSpace }
504
- *
505
- * Reference:
506
- * - https://www.russellcottrell.com/photo/matrixCalculator.htm
507
- */
508
- spaces: {},
509
- convert: function(i, o, s) {
510
- return this.enabled === !1 || o === s || !o || !s || (this.spaces[o].transfer === _e && (i.r = Q(i.r), i.g = Q(i.g), i.b = Q(i.b)), this.spaces[o].primaries !== this.spaces[s].primaries && (i.applyMatrix3(this.spaces[o].toXYZ), i.applyMatrix3(this.spaces[s].fromXYZ)), this.spaces[s].transfer === _e && (i.r = K(i.r), i.g = K(i.g), i.b = K(i.b))), i;
511
- },
512
- workingToColorSpace: function(i, o) {
513
- return this.convert(i, this.workingColorSpace, o);
514
- },
515
- colorSpaceToWorking: function(i, o) {
516
- return this.convert(i, o, this.workingColorSpace);
517
- },
518
- getPrimaries: function(i) {
519
- return this.spaces[i].primaries;
520
- },
521
- getTransfer: function(i) {
522
- return i === $t ? We : this.spaces[i].transfer;
523
- },
524
- getToneMappingMode: function(i) {
525
- return this.spaces[i].outputColorSpaceConfig.toneMappingMode || "standard";
526
- },
527
- getLuminanceCoefficients: function(i, o = this.workingColorSpace) {
528
- return i.fromArray(this.spaces[o].luminanceCoefficients);
529
- },
530
- define: function(i) {
531
- Object.assign(this.spaces, i);
532
- },
533
- // Internal APIs
534
- _getMatrix: function(i, o, s) {
535
- return i.copy(this.spaces[o].toXYZ).multiply(this.spaces[s].fromXYZ);
536
- },
537
- _getDrawingBufferColorSpace: function(i) {
538
- return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace;
539
- },
540
- _getUnpackColorSpace: function(i = this.workingColorSpace) {
541
- return this.spaces[i].workingColorSpaceConfig.unpackColorSpace;
542
- },
543
- // Deprecated
544
- fromWorkingColorSpace: function(i, o) {
545
- return Qe("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."), t.workingToColorSpace(i, o);
546
- },
547
- toWorkingColorSpace: function(i, o) {
548
- return Qe("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."), t.colorSpaceToWorking(i, o);
549
- }
550
- }, e = [0.64, 0.33, 0.3, 0.6, 0.15, 0.06], n = [0.2126, 0.7152, 0.0722], r = [0.3127, 0.329];
551
- return t.define({
552
- [Xe]: {
553
- primaries: e,
554
- whitePoint: r,
555
- transfer: We,
556
- toXYZ: Ke,
557
- fromXYZ: et,
558
- luminanceCoefficients: n,
559
- workingColorSpaceConfig: { unpackColorSpace: B },
560
- outputColorSpaceConfig: { drawingBufferColorSpace: B }
561
- },
562
- [B]: {
563
- primaries: e,
564
- whitePoint: r,
565
- transfer: _e,
566
- toXYZ: Ke,
567
- fromXYZ: et,
568
- luminanceCoefficients: n,
569
- outputColorSpaceConfig: { drawingBufferColorSpace: B }
570
- }
571
- }), t;
80
+ return f(n);
572
81
  }
573
- const L = /* @__PURE__ */ Tt();
574
- function Q(t) {
575
- return t < 0.04045 ? t * 0.0773993808 : Math.pow(t * 0.9478672986 + 0.0521327014, 2.4);
576
- }
577
- function K(t) {
578
- return t < 31308e-7 ? t * 12.92 : 1.055 * Math.pow(t, 0.41666) - 0.055;
579
- }
580
- const pt = {
581
- aliceblue: 15792383,
582
- antiquewhite: 16444375,
583
- aqua: 65535,
584
- aquamarine: 8388564,
585
- azure: 15794175,
586
- beige: 16119260,
587
- bisque: 16770244,
588
- black: 0,
589
- blanchedalmond: 16772045,
590
- blue: 255,
591
- blueviolet: 9055202,
592
- brown: 10824234,
593
- burlywood: 14596231,
594
- cadetblue: 6266528,
595
- chartreuse: 8388352,
596
- chocolate: 13789470,
597
- coral: 16744272,
598
- cornflowerblue: 6591981,
599
- cornsilk: 16775388,
600
- crimson: 14423100,
601
- cyan: 65535,
602
- darkblue: 139,
603
- darkcyan: 35723,
604
- darkgoldenrod: 12092939,
605
- darkgray: 11119017,
606
- darkgreen: 25600,
607
- darkgrey: 11119017,
608
- darkkhaki: 12433259,
609
- darkmagenta: 9109643,
610
- darkolivegreen: 5597999,
611
- darkorange: 16747520,
612
- darkorchid: 10040012,
613
- darkred: 9109504,
614
- darksalmon: 15308410,
615
- darkseagreen: 9419919,
616
- darkslateblue: 4734347,
617
- darkslategray: 3100495,
618
- darkslategrey: 3100495,
619
- darkturquoise: 52945,
620
- darkviolet: 9699539,
621
- deeppink: 16716947,
622
- deepskyblue: 49151,
623
- dimgray: 6908265,
624
- dimgrey: 6908265,
625
- dodgerblue: 2003199,
626
- firebrick: 11674146,
627
- floralwhite: 16775920,
628
- forestgreen: 2263842,
629
- fuchsia: 16711935,
630
- gainsboro: 14474460,
631
- ghostwhite: 16316671,
632
- gold: 16766720,
633
- goldenrod: 14329120,
634
- gray: 8421504,
635
- green: 32768,
636
- greenyellow: 11403055,
637
- grey: 8421504,
638
- honeydew: 15794160,
639
- hotpink: 16738740,
640
- indianred: 13458524,
641
- indigo: 4915330,
642
- ivory: 16777200,
643
- khaki: 15787660,
644
- lavender: 15132410,
645
- lavenderblush: 16773365,
646
- lawngreen: 8190976,
647
- lemonchiffon: 16775885,
648
- lightblue: 11393254,
649
- lightcoral: 15761536,
650
- lightcyan: 14745599,
651
- lightgoldenrodyellow: 16448210,
652
- lightgray: 13882323,
653
- lightgreen: 9498256,
654
- lightgrey: 13882323,
655
- lightpink: 16758465,
656
- lightsalmon: 16752762,
657
- lightseagreen: 2142890,
658
- lightskyblue: 8900346,
659
- lightslategray: 7833753,
660
- lightslategrey: 7833753,
661
- lightsteelblue: 11584734,
662
- lightyellow: 16777184,
663
- lime: 65280,
664
- limegreen: 3329330,
665
- linen: 16445670,
666
- magenta: 16711935,
667
- maroon: 8388608,
668
- mediumaquamarine: 6737322,
669
- mediumblue: 205,
670
- mediumorchid: 12211667,
671
- mediumpurple: 9662683,
672
- mediumseagreen: 3978097,
673
- mediumslateblue: 8087790,
674
- mediumspringgreen: 64154,
675
- mediumturquoise: 4772300,
676
- mediumvioletred: 13047173,
677
- midnightblue: 1644912,
678
- mintcream: 16121850,
679
- mistyrose: 16770273,
680
- moccasin: 16770229,
681
- navajowhite: 16768685,
682
- navy: 128,
683
- oldlace: 16643558,
684
- olive: 8421376,
685
- olivedrab: 7048739,
686
- orange: 16753920,
687
- orangered: 16729344,
688
- orchid: 14315734,
689
- palegoldenrod: 15657130,
690
- palegreen: 10025880,
691
- paleturquoise: 11529966,
692
- palevioletred: 14381203,
693
- papayawhip: 16773077,
694
- peachpuff: 16767673,
695
- peru: 13468991,
696
- pink: 16761035,
697
- plum: 14524637,
698
- powderblue: 11591910,
699
- purple: 8388736,
700
- rebeccapurple: 6697881,
701
- red: 16711680,
702
- rosybrown: 12357519,
703
- royalblue: 4286945,
704
- saddlebrown: 9127187,
705
- salmon: 16416882,
706
- sandybrown: 16032864,
707
- seagreen: 3050327,
708
- seashell: 16774638,
709
- sienna: 10506797,
710
- silver: 12632256,
711
- skyblue: 8900331,
712
- slateblue: 6970061,
713
- slategray: 7372944,
714
- slategrey: 7372944,
715
- snow: 16775930,
716
- springgreen: 65407,
717
- steelblue: 4620980,
718
- tan: 13808780,
719
- teal: 32896,
720
- thistle: 14204888,
721
- tomato: 16737095,
722
- turquoise: 4251856,
723
- violet: 15631086,
724
- wheat: 16113331,
725
- white: 16777215,
726
- whitesmoke: 16119285,
727
- yellow: 16776960,
728
- yellowgreen: 10145074
729
- }, G = { h: 0, s: 0, l: 0 }, xe = { h: 0, s: 0, l: 0 };
730
- function Le(t, e, n) {
731
- return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (e - t) * 6 * n : n < 1 / 2 ? e : n < 2 / 3 ? t + (e - t) * 6 * (2 / 3 - n) : t;
732
- }
733
- let oe = class {
734
- /**
735
- * Constructs a new color.
736
- *
737
- * Note that standard method of specifying color in three.js is with a hexadecimal triplet,
738
- * and that method is used throughout the rest of the documentation.
739
- *
740
- * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are
741
- * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance.
742
- * @param {number} [g] - The green component.
743
- * @param {number} [b] - The blue component.
744
- */
745
- constructor(e, n, r) {
746
- return this.isColor = !0, this.r = 1, this.g = 1, this.b = 1, this.set(e, n, r);
747
- }
748
- /**
749
- * Sets the colors's components from the given values.
750
- *
751
- * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are
752
- * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance.
753
- * @param {number} [g] - The green component.
754
- * @param {number} [b] - The blue component.
755
- * @return {Color} A reference to this color.
756
- */
757
- set(e, n, r) {
758
- if (n === void 0 && r === void 0) {
759
- const i = e;
760
- i && i.isColor ? this.copy(i) : typeof i == "number" ? this.setHex(i) : typeof i == "string" && this.setStyle(i);
761
- } else
762
- this.setRGB(e, n, r);
763
- return this;
764
- }
765
- /**
766
- * Sets the colors's components to the given scalar value.
767
- *
768
- * @param {number} scalar - The scalar value.
769
- * @return {Color} A reference to this color.
770
- */
771
- setScalar(e) {
772
- return this.r = e, this.g = e, this.b = e, this;
773
- }
774
- /**
775
- * Sets this color from a hexadecimal value.
776
- *
777
- * @param {number} hex - The hexadecimal value.
778
- * @param {string} [colorSpace=SRGBColorSpace] - The color space.
779
- * @return {Color} A reference to this color.
780
- */
781
- setHex(e, n = B) {
782
- return e = Math.floor(e), this.r = (e >> 16 & 255) / 255, this.g = (e >> 8 & 255) / 255, this.b = (e & 255) / 255, L.colorSpaceToWorking(this, n), this;
783
- }
784
- /**
785
- * Sets this color from RGB values.
786
- *
787
- * @param {number} r - Red channel value between `0.0` and `1.0`.
788
- * @param {number} g - Green channel value between `0.0` and `1.0`.
789
- * @param {number} b - Blue channel value between `0.0` and `1.0`.
790
- * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
791
- * @return {Color} A reference to this color.
792
- */
793
- setRGB(e, n, r, i = L.workingColorSpace) {
794
- return this.r = e, this.g = n, this.b = r, L.colorSpaceToWorking(this, i), this;
795
- }
796
- /**
797
- * Sets this color from RGB values.
798
- *
799
- * @param {number} h - Hue value between `0.0` and `1.0`.
800
- * @param {number} s - Saturation value between `0.0` and `1.0`.
801
- * @param {number} l - Lightness value between `0.0` and `1.0`.
802
- * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
803
- * @return {Color} A reference to this color.
804
- */
805
- setHSL(e, n, r, i = L.workingColorSpace) {
806
- if (e = Dt(e, 1), n = ie(n, 0, 1), r = ie(r, 0, 1), n === 0)
807
- this.r = this.g = this.b = r;
808
- else {
809
- const o = r <= 0.5 ? r * (1 + n) : r + n - r * n, s = 2 * r - o;
810
- this.r = Le(s, o, e + 1 / 3), this.g = Le(s, o, e), this.b = Le(s, o, e - 1 / 3);
811
- }
812
- return L.colorSpaceToWorking(this, i), this;
813
- }
814
- /**
815
- * Sets this color from a CSS-style string. For example, `rgb(250, 0,0)`,
816
- * `rgb(100%, 0%, 0%)`, `hsl(0, 100%, 50%)`, `#ff0000`, `#f00`, or `red` ( or
817
- * any [X11 color name]{@link https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart} -
818
- * all 140 color names are supported).
819
- *
820
- * @param {string} style - Color as a CSS-style string.
821
- * @param {string} [colorSpace=SRGBColorSpace] - The color space.
822
- * @return {Color} A reference to this color.
823
- */
824
- setStyle(e, n = B) {
825
- function r(o) {
826
- o !== void 0 && parseFloat(o) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.");
827
- }
828
- let i;
829
- if (i = /^(\w+)\(([^\)]*)\)/.exec(e)) {
830
- let o;
831
- const s = i[1], a = i[2];
832
- switch (s) {
833
- case "rgb":
834
- case "rgba":
835
- if (o = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))
836
- return r(o[4]), this.setRGB(
837
- Math.min(255, parseInt(o[1], 10)) / 255,
838
- Math.min(255, parseInt(o[2], 10)) / 255,
839
- Math.min(255, parseInt(o[3], 10)) / 255,
840
- n
841
- );
842
- if (o = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))
843
- return r(o[4]), this.setRGB(
844
- Math.min(100, parseInt(o[1], 10)) / 100,
845
- Math.min(100, parseInt(o[2], 10)) / 100,
846
- Math.min(100, parseInt(o[3], 10)) / 100,
847
- n
848
- );
849
- break;
850
- case "hsl":
851
- case "hsla":
852
- if (o = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))
853
- return r(o[4]), this.setHSL(
854
- parseFloat(o[1]) / 360,
855
- parseFloat(o[2]) / 100,
856
- parseFloat(o[3]) / 100,
857
- n
858
- );
859
- break;
860
- default:
861
- console.warn("THREE.Color: Unknown color model " + e);
862
- }
863
- } else if (i = /^\#([A-Fa-f\d]+)$/.exec(e)) {
864
- const o = i[1], s = o.length;
865
- if (s === 3)
866
- return this.setRGB(
867
- parseInt(o.charAt(0), 16) / 15,
868
- parseInt(o.charAt(1), 16) / 15,
869
- parseInt(o.charAt(2), 16) / 15,
870
- n
871
- );
872
- if (s === 6)
873
- return this.setHex(parseInt(o, 16), n);
874
- console.warn("THREE.Color: Invalid hex color " + e);
875
- } else if (e && e.length > 0)
876
- return this.setColorName(e, n);
877
- return this;
878
- }
879
- /**
880
- * Sets this color from a color name. Faster than {@link Color#setStyle} if
881
- * you don't need the other CSS-style formats.
882
- *
883
- * For convenience, the list of names is exposed in `Color.NAMES` as a hash.
884
- * ```js
885
- * Color.NAMES.aliceblue // returns 0xF0F8FF
886
- * ```
887
- *
888
- * @param {string} style - The color name.
889
- * @param {string} [colorSpace=SRGBColorSpace] - The color space.
890
- * @return {Color} A reference to this color.
891
- */
892
- setColorName(e, n = B) {
893
- const r = pt[e.toLowerCase()];
894
- return r !== void 0 ? this.setHex(r, n) : console.warn("THREE.Color: Unknown color " + e), this;
895
- }
896
- /**
897
- * Returns a new color with copied values from this instance.
898
- *
899
- * @return {Color} A clone of this instance.
900
- */
901
- clone() {
902
- return new this.constructor(this.r, this.g, this.b);
903
- }
904
- /**
905
- * Copies the values of the given color to this instance.
906
- *
907
- * @param {Color} color - The color to copy.
908
- * @return {Color} A reference to this color.
909
- */
910
- copy(e) {
911
- return this.r = e.r, this.g = e.g, this.b = e.b, this;
912
- }
913
- /**
914
- * Copies the given color into this color, and then converts this color from
915
- * `SRGBColorSpace` to `LinearSRGBColorSpace`.
916
- *
917
- * @param {Color} color - The color to copy/convert.
918
- * @return {Color} A reference to this color.
919
- */
920
- copySRGBToLinear(e) {
921
- return this.r = Q(e.r), this.g = Q(e.g), this.b = Q(e.b), this;
922
- }
923
- /**
924
- * Copies the given color into this color, and then converts this color from
925
- * `LinearSRGBColorSpace` to `SRGBColorSpace`.
926
- *
927
- * @param {Color} color - The color to copy/convert.
928
- * @return {Color} A reference to this color.
929
- */
930
- copyLinearToSRGB(e) {
931
- return this.r = K(e.r), this.g = K(e.g), this.b = K(e.b), this;
932
- }
933
- /**
934
- * Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`.
935
- *
936
- * @return {Color} A reference to this color.
937
- */
938
- convertSRGBToLinear() {
939
- return this.copySRGBToLinear(this), this;
940
- }
941
- /**
942
- * Converts this color from `LinearSRGBColorSpace` to `SRGBColorSpace`.
943
- *
944
- * @return {Color} A reference to this color.
945
- */
946
- convertLinearToSRGB() {
947
- return this.copyLinearToSRGB(this), this;
948
- }
949
- /**
950
- * Returns the hexadecimal value of this color.
951
- *
952
- * @param {string} [colorSpace=SRGBColorSpace] - The color space.
953
- * @return {number} The hexadecimal value.
954
- */
955
- getHex(e = B) {
956
- return L.workingToColorSpace(k.copy(this), e), Math.round(ie(k.r * 255, 0, 255)) * 65536 + Math.round(ie(k.g * 255, 0, 255)) * 256 + Math.round(ie(k.b * 255, 0, 255));
957
- }
958
- /**
959
- * Returns the hexadecimal value of this color as a string (for example, 'FFFFFF').
960
- *
961
- * @param {string} [colorSpace=SRGBColorSpace] - The color space.
962
- * @return {string} The hexadecimal value as a string.
963
- */
964
- getHexString(e = B) {
965
- return ("000000" + this.getHex(e).toString(16)).slice(-6);
966
- }
967
- /**
968
- * Converts the colors RGB values into the HSL format and stores them into the
969
- * given target object.
970
- *
971
- * @param {{h:number,s:number,l:number}} target - The target object that is used to store the method's result.
972
- * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
973
- * @return {{h:number,s:number,l:number}} The HSL representation of this color.
974
- */
975
- getHSL(e, n = L.workingColorSpace) {
976
- L.workingToColorSpace(k.copy(this), n);
977
- const r = k.r, i = k.g, o = k.b, s = Math.max(r, i, o), a = Math.min(r, i, o);
978
- let c, u;
979
- const f = (a + s) / 2;
980
- if (a === s)
981
- c = 0, u = 0;
982
- else {
983
- const l = s - a;
984
- switch (u = f <= 0.5 ? l / (s + a) : l / (2 - s - a), s) {
985
- case r:
986
- c = (i - o) / l + (i < o ? 6 : 0);
987
- break;
988
- case i:
989
- c = (o - r) / l + 2;
990
- break;
991
- case o:
992
- c = (r - i) / l + 4;
993
- break;
994
- }
995
- c /= 6;
996
- }
997
- return e.h = c, e.s = u, e.l = f, e;
998
- }
999
- /**
1000
- * Returns the RGB values of this color and stores them into the given target object.
1001
- *
1002
- * @param {Color} target - The target color that is used to store the method's result.
1003
- * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space.
1004
- * @return {Color} The RGB representation of this color.
1005
- */
1006
- getRGB(e, n = L.workingColorSpace) {
1007
- return L.workingToColorSpace(k.copy(this), n), e.r = k.r, e.g = k.g, e.b = k.b, e;
1008
- }
1009
- /**
1010
- * Returns the value of this color as a CSS style string. Example: `rgb(255,0,0)`.
1011
- *
1012
- * @param {string} [colorSpace=SRGBColorSpace] - The color space.
1013
- * @return {string} The CSS representation of this color.
1014
- */
1015
- getStyle(e = B) {
1016
- L.workingToColorSpace(k.copy(this), e);
1017
- const n = k.r, r = k.g, i = k.b;
1018
- return e !== B ? `color(${e} ${n.toFixed(3)} ${r.toFixed(3)} ${i.toFixed(3)})` : `rgb(${Math.round(n * 255)},${Math.round(r * 255)},${Math.round(i * 255)})`;
1019
- }
1020
- /**
1021
- * Adds the given HSL values to this color's values.
1022
- * Internally, this converts the color's RGB values to HSL, adds HSL
1023
- * and then converts the color back to RGB.
1024
- *
1025
- * @param {number} h - Hue value between `0.0` and `1.0`.
1026
- * @param {number} s - Saturation value between `0.0` and `1.0`.
1027
- * @param {number} l - Lightness value between `0.0` and `1.0`.
1028
- * @return {Color} A reference to this color.
1029
- */
1030
- offsetHSL(e, n, r) {
1031
- return this.getHSL(G), this.setHSL(G.h + e, G.s + n, G.l + r);
1032
- }
1033
- /**
1034
- * Adds the RGB values of the given color to the RGB values of this color.
1035
- *
1036
- * @param {Color} color - The color to add.
1037
- * @return {Color} A reference to this color.
1038
- */
1039
- add(e) {
1040
- return this.r += e.r, this.g += e.g, this.b += e.b, this;
1041
- }
1042
- /**
1043
- * Adds the RGB values of the given colors and stores the result in this instance.
1044
- *
1045
- * @param {Color} color1 - The first color.
1046
- * @param {Color} color2 - The second color.
1047
- * @return {Color} A reference to this color.
1048
- */
1049
- addColors(e, n) {
1050
- return this.r = e.r + n.r, this.g = e.g + n.g, this.b = e.b + n.b, this;
1051
- }
1052
- /**
1053
- * Adds the given scalar value to the RGB values of this color.
1054
- *
1055
- * @param {number} s - The scalar to add.
1056
- * @return {Color} A reference to this color.
1057
- */
1058
- addScalar(e) {
1059
- return this.r += e, this.g += e, this.b += e, this;
1060
- }
1061
- /**
1062
- * Subtracts the RGB values of the given color from the RGB values of this color.
1063
- *
1064
- * @param {Color} color - The color to subtract.
1065
- * @return {Color} A reference to this color.
1066
- */
1067
- sub(e) {
1068
- return this.r = Math.max(0, this.r - e.r), this.g = Math.max(0, this.g - e.g), this.b = Math.max(0, this.b - e.b), this;
1069
- }
1070
- /**
1071
- * Multiplies the RGB values of the given color with the RGB values of this color.
1072
- *
1073
- * @param {Color} color - The color to multiply.
1074
- * @return {Color} A reference to this color.
1075
- */
1076
- multiply(e) {
1077
- return this.r *= e.r, this.g *= e.g, this.b *= e.b, this;
1078
- }
1079
- /**
1080
- * Multiplies the given scalar value with the RGB values of this color.
1081
- *
1082
- * @param {number} s - The scalar to multiply.
1083
- * @return {Color} A reference to this color.
1084
- */
1085
- multiplyScalar(e) {
1086
- return this.r *= e, this.g *= e, this.b *= e, this;
1087
- }
1088
- /**
1089
- * Linearly interpolates this color's RGB values toward the RGB values of the
1090
- * given color. The alpha argument can be thought of as the ratio between
1091
- * the two colors, where `0.0` is this color and `1.0` is the first argument.
1092
- *
1093
- * @param {Color} color - The color to converge on.
1094
- * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.
1095
- * @return {Color} A reference to this color.
1096
- */
1097
- lerp(e, n) {
1098
- return this.r += (e.r - this.r) * n, this.g += (e.g - this.g) * n, this.b += (e.b - this.b) * n, this;
1099
- }
1100
- /**
1101
- * Linearly interpolates between the given colors and stores the result in this instance.
1102
- * The alpha argument can be thought of as the ratio between the two colors, where `0.0`
1103
- * is the first and `1.0` is the second color.
1104
- *
1105
- * @param {Color} color1 - The first color.
1106
- * @param {Color} color2 - The second color.
1107
- * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.
1108
- * @return {Color} A reference to this color.
1109
- */
1110
- lerpColors(e, n, r) {
1111
- return this.r = e.r + (n.r - e.r) * r, this.g = e.g + (n.g - e.g) * r, this.b = e.b + (n.b - e.b) * r, this;
1112
- }
1113
- /**
1114
- * Linearly interpolates this color's HSL values toward the HSL values of the
1115
- * given color. It differs from {@link Color#lerp} by not interpolating straight
1116
- * from one color to the other, but instead going through all the hues in between
1117
- * those two colors. The alpha argument can be thought of as the ratio between
1118
- * the two colors, where 0.0 is this color and 1.0 is the first argument.
1119
- *
1120
- * @param {Color} color - The color to converge on.
1121
- * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`.
1122
- * @return {Color} A reference to this color.
1123
- */
1124
- lerpHSL(e, n) {
1125
- this.getHSL(G), e.getHSL(xe);
1126
- const r = Se(G.h, xe.h, n), i = Se(G.s, xe.s, n), o = Se(G.l, xe.l, n);
1127
- return this.setHSL(r, i, o), this;
1128
- }
1129
- /**
1130
- * Sets the color's RGB components from the given 3D vector.
1131
- *
1132
- * @param {Vector3} v - The vector to set.
1133
- * @return {Color} A reference to this color.
1134
- */
1135
- setFromVector3(e) {
1136
- return this.r = e.x, this.g = e.y, this.b = e.z, this;
1137
- }
1138
- /**
1139
- * Transforms this color with the given 3x3 matrix.
1140
- *
1141
- * @param {Matrix3} m - The matrix.
1142
- * @return {Color} A reference to this color.
1143
- */
1144
- applyMatrix3(e) {
1145
- const n = this.r, r = this.g, i = this.b, o = e.elements;
1146
- return this.r = o[0] * n + o[3] * r + o[6] * i, this.g = o[1] * n + o[4] * r + o[7] * i, this.b = o[2] * n + o[5] * r + o[8] * i, this;
1147
- }
1148
- /**
1149
- * Returns `true` if this color is equal with the given one.
1150
- *
1151
- * @param {Color} c - The color to test for equality.
1152
- * @return {boolean} Whether this bounding color is equal with the given one.
1153
- */
1154
- equals(e) {
1155
- return e.r === this.r && e.g === this.g && e.b === this.b;
1156
- }
1157
- /**
1158
- * Sets this color's RGB components from the given array.
1159
- *
1160
- * @param {Array<number>} array - An array holding the RGB values.
1161
- * @param {number} [offset=0] - The offset into the array.
1162
- * @return {Color} A reference to this color.
1163
- */
1164
- fromArray(e, n = 0) {
1165
- return this.r = e[n], this.g = e[n + 1], this.b = e[n + 2], this;
1166
- }
1167
- /**
1168
- * Writes the RGB components of this color to the given array. If no array is provided,
1169
- * the method returns a new instance.
1170
- *
1171
- * @param {Array<number>} [array=[]] - The target array holding the color components.
1172
- * @param {number} [offset=0] - Index of the first element in the array.
1173
- * @return {Array<number>} The color components.
1174
- */
1175
- toArray(e = [], n = 0) {
1176
- return e[n] = this.r, e[n + 1] = this.g, e[n + 2] = this.b, e;
1177
- }
1178
- /**
1179
- * Sets the components of this color from the given buffer attribute.
1180
- *
1181
- * @param {BufferAttribute} attribute - The buffer attribute holding color data.
1182
- * @param {number} index - The index into the attribute.
1183
- * @return {Color} A reference to this color.
1184
- */
1185
- fromBufferAttribute(e, n) {
1186
- return this.r = e.getX(n), this.g = e.getY(n), this.b = e.getZ(n), this;
1187
- }
1188
- /**
1189
- * This methods defines the serialization result of this class. Returns the color
1190
- * as a hexadecimal value.
1191
- *
1192
- * @return {number} The hexadecimal value.
1193
- */
1194
- toJSON() {
1195
- return this.getHex();
1196
- }
1197
- *[Symbol.iterator]() {
1198
- yield this.r, yield this.g, yield this.b;
1199
- }
1200
- };
1201
- const k = /* @__PURE__ */ new oe();
1202
- oe.NAMES = pt;
1203
- typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: {
1204
- revision: xt
1205
- } }));
1206
- typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = xt);
1207
- const It = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_110m_admin_0_countries.geojson", Ht = "https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json", Ot = "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_admin_1_states_provinces.geojson", Pt = "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>", jt = {
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 = {
1208
83
  minColor: "#f8fafc",
1209
84
  maxColor: "#e5e7eb"
1210
85
  };
1211
- function je(t, e, n) {
1212
- t.prototype = e.prototype = n, n.constructor = t;
86
+ function Ae(e, n, t) {
87
+ e.prototype = n.prototype = t, t.constructor = e;
1213
88
  }
1214
- function bt(t, e) {
1215
- var n = Object.create(t.prototype);
1216
- for (var r in e) n[r] = e[r];
1217
- return n;
89
+ function Qe(e, n) {
90
+ var t = Object.create(e.prototype);
91
+ for (var r in n) t[r] = n[r];
92
+ return t;
1218
93
  }
1219
- function fe() {
94
+ function te() {
1220
95
  }
1221
- var se = 0.7, Fe = 1 / se, ee = "\\s*([+-]?\\d+)\\s*", ae = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", H = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Gt = /^#([0-9a-f]{3,8})$/, qt = new RegExp(`^rgb\\(${ee},${ee},${ee}\\)$`), zt = new RegExp(`^rgb\\(${H},${H},${H}\\)$`), Ut = new RegExp(`^rgba\\(${ee},${ee},${ee},${ae}\\)$`), Vt = new RegExp(`^rgba\\(${H},${H},${H},${ae}\\)$`), Zt = new RegExp(`^hsl\\(${ae},${H},${H}\\)$`), Yt = new RegExp(`^hsla\\(${ae},${H},${H},${ae}\\)$`), tt = {
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 = {
1222
97
  aliceblue: 15792383,
1223
98
  antiquewhite: 16444375,
1224
99
  aqua: 65535,
@@ -1368,781 +243,818 @@ var se = 0.7, Fe = 1 / se, ee = "\\s*([+-]?\\d+)\\s*", ae = "\\s*([+-]?(?:\\d*\\
1368
243
  yellow: 16776960,
1369
244
  yellowgreen: 10145074
1370
245
  };
1371
- je(fe, ue, {
1372
- copy(t) {
1373
- return Object.assign(new this.constructor(), this, t);
246
+ Ae(te, ne, {
247
+ copy(e) {
248
+ return Object.assign(new this.constructor(), this, e);
1374
249
  },
1375
250
  displayable() {
1376
251
  return this.rgb().displayable();
1377
252
  },
1378
- hex: nt,
253
+ hex: ze,
1379
254
  // Deprecated! Use color.formatHex.
1380
- formatHex: nt,
1381
- formatHex8: Xt,
1382
- formatHsl: Wt,
1383
- formatRgb: rt,
1384
- toString: rt
255
+ formatHex: ze,
256
+ formatHex8: Cn,
257
+ formatHsl: Ln,
258
+ formatRgb: He,
259
+ toString: He
1385
260
  });
1386
- function nt() {
261
+ function ze() {
1387
262
  return this.rgb().formatHex();
1388
263
  }
1389
- function Xt() {
264
+ function Cn() {
1390
265
  return this.rgb().formatHex8();
1391
266
  }
1392
- function Wt() {
1393
- return wt(this).formatHsl();
267
+ function Ln() {
268
+ return en(this).formatHsl();
1394
269
  }
1395
- function rt() {
270
+ function He() {
1396
271
  return this.rgb().formatRgb();
1397
272
  }
1398
- function ue(t) {
1399
- var e, n;
1400
- return t = (t + "").trim().toLowerCase(), (e = Gt.exec(t)) ? (n = e[1].length, e = parseInt(e[1], 16), n === 6 ? it(e) : n === 3 ? new A(e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, (e & 15) << 4 | e & 15, 1) : n === 8 ? pe(e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, (e & 255) / 255) : n === 4 ? pe(e >> 12 & 15 | e >> 8 & 240, e >> 8 & 15 | e >> 4 & 240, e >> 4 & 15 | e & 240, ((e & 15) << 4 | e & 15) / 255) : null) : (e = qt.exec(t)) ? new A(e[1], e[2], e[3], 1) : (e = zt.exec(t)) ? new A(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, 1) : (e = Ut.exec(t)) ? pe(e[1], e[2], e[3], e[4]) : (e = Vt.exec(t)) ? pe(e[1] * 255 / 100, e[2] * 255 / 100, e[3] * 255 / 100, e[4]) : (e = Zt.exec(t)) ? at(e[1], e[2] / 100, e[3] / 100, 1) : (e = Yt.exec(t)) ? at(e[1], e[2] / 100, e[3] / 100, e[4]) : tt.hasOwnProperty(t) ? it(tt[t]) : t === "transparent" ? new A(NaN, NaN, NaN, 0) : null;
273
+ function ne(e) {
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;
1401
276
  }
1402
- function it(t) {
1403
- return new A(t >> 16 & 255, t >> 8 & 255, t & 255, 1);
277
+ function Te(e) {
278
+ return new $(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
1404
279
  }
1405
- function pe(t, e, n, r) {
1406
- return r <= 0 && (t = e = n = NaN), new A(t, e, n, r);
280
+ function fe(e, n, t, r) {
281
+ return r <= 0 && (e = n = t = NaN), new $(e, n, t, r);
1407
282
  }
1408
- function Jt(t) {
1409
- return t instanceof fe || (t = ue(t)), t ? (t = t.rgb(), new A(t.r, t.g, t.b, t.opacity)) : new A();
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 $();
1410
285
  }
1411
- function Te(t, e, n, r) {
1412
- return arguments.length === 1 ? Jt(t) : new A(t, e, n, r ?? 1);
286
+ function $e(e, n, t, r) {
287
+ return arguments.length === 1 ? An(e) : new $(e, n, t, r ?? 1);
1413
288
  }
1414
- function A(t, e, n, r) {
1415
- this.r = +t, this.g = +e, this.b = +n, this.opacity = +r;
289
+ function $(e, n, t, r) {
290
+ this.r = +e, this.g = +n, this.b = +t, this.opacity = +r;
1416
291
  }
1417
- je(A, Te, bt(fe, {
1418
- brighter(t) {
1419
- return t = t == null ? Fe : Math.pow(Fe, t), new A(this.r * t, this.g * t, this.b * t, this.opacity);
292
+ Ae($, $e, Qe(te, {
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);
1420
295
  },
1421
- darker(t) {
1422
- return t = t == null ? se : Math.pow(se, t), new A(this.r * t, this.g * t, this.b * t, this.opacity);
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);
1423
298
  },
1424
299
  rgb() {
1425
300
  return this;
1426
301
  },
1427
302
  clamp() {
1428
- return new A(Y(this.r), Y(this.g), Y(this.b), Ce(this.opacity));
303
+ return new $(U(this.r), U(this.g), U(this.b), he(this.opacity));
1429
304
  },
1430
305
  displayable() {
1431
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;
1432
307
  },
1433
- hex: ot,
308
+ hex: Ge,
1434
309
  // Deprecated! Use color.formatHex.
1435
- formatHex: ot,
1436
- formatHex8: Qt,
1437
- formatRgb: st,
1438
- toString: st
310
+ formatHex: Ge,
311
+ formatHex8: Sn,
312
+ formatRgb: Ue,
313
+ toString: Ue
1439
314
  }));
1440
- function ot() {
1441
- return `#${Z(this.r)}${Z(this.g)}${Z(this.b)}`;
315
+ function Ge() {
316
+ return `#${G(this.r)}${G(this.g)}${G(this.b)}`;
1442
317
  }
1443
- function Qt() {
1444
- return `#${Z(this.r)}${Z(this.g)}${Z(this.b)}${Z((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
318
+ function Sn() {
319
+ return `#${G(this.r)}${G(this.g)}${G(this.b)}${G((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
1445
320
  }
1446
- function st() {
1447
- const t = Ce(this.opacity);
1448
- return `${t === 1 ? "rgb(" : "rgba("}${Y(this.r)}, ${Y(this.g)}, ${Y(this.b)}${t === 1 ? ")" : `, ${t})`}`;
321
+ function Ue() {
322
+ const e = he(this.opacity);
323
+ return `${e === 1 ? "rgb(" : "rgba("}${U(this.r)}, ${U(this.g)}, ${U(this.b)}${e === 1 ? ")" : `, ${e})`}`;
1449
324
  }
1450
- function Ce(t) {
1451
- return isNaN(t) ? 1 : Math.max(0, Math.min(1, t));
325
+ function he(e) {
326
+ return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
1452
327
  }
1453
- function Y(t) {
1454
- return Math.max(0, Math.min(255, Math.round(t) || 0));
328
+ function U(e) {
329
+ return Math.max(0, Math.min(255, Math.round(e) || 0));
1455
330
  }
1456
- function Z(t) {
1457
- return t = Y(t), (t < 16 ? "0" : "") + t.toString(16);
331
+ function G(e) {
332
+ return e = U(e), (e < 16 ? "0" : "") + e.toString(16);
1458
333
  }
1459
- function at(t, e, n, r) {
1460
- return r <= 0 ? t = e = n = NaN : n <= 0 || n >= 1 ? t = e = NaN : e <= 0 && (t = NaN), new $(t, e, n, r);
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);
1461
336
  }
1462
- function wt(t) {
1463
- if (t instanceof $) return new $(t.h, t.s, t.l, t.opacity);
1464
- if (t instanceof fe || (t = ue(t)), !t) return new $();
1465
- if (t instanceof $) return t;
1466
- t = t.rgb();
1467
- var e = t.r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), o = Math.max(e, n, r), s = NaN, a = o - i, c = (o + i) / 2;
1468
- return a ? (e === o ? s = (n - r) / a + (n < r) * 6 : n === o ? s = (r - e) / a + 2 : s = (e - n) / a + 4, a /= c < 0.5 ? o + i : 2 - o - i, s *= 60) : a = c > 0 && c < 1 ? 0 : s, new $(s, a, c, t.opacity);
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;
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);
1469
344
  }
1470
- function Kt(t, e, n, r) {
1471
- return arguments.length === 1 ? wt(t) : new $(t, e, n, r ?? 1);
345
+ function En(e, n, t, r) {
346
+ return arguments.length === 1 ? en(e) : new L(e, n, t, r ?? 1);
1472
347
  }
1473
- function $(t, e, n, r) {
1474
- this.h = +t, this.s = +e, this.l = +n, this.opacity = +r;
348
+ function L(e, n, t, r) {
349
+ this.h = +e, this.s = +n, this.l = +t, this.opacity = +r;
1475
350
  }
1476
- je($, Kt, bt(fe, {
1477
- brighter(t) {
1478
- return t = t == null ? Fe : Math.pow(Fe, t), new $(this.h, this.s, this.l * t, this.opacity);
351
+ Ae(L, En, Qe(te, {
352
+ brighter(e) {
353
+ return e = e == null ? de : Math.pow(de, e), new L(this.h, this.s, this.l * e, this.opacity);
1479
354
  },
1480
- darker(t) {
1481
- return t = t == null ? se : Math.pow(se, t), new $(this.h, this.s, this.l * t, this.opacity);
355
+ darker(e) {
356
+ return e = e == null ? Q : Math.pow(Q, e), new L(this.h, this.s, this.l * e, this.opacity);
1482
357
  },
1483
358
  rgb() {
1484
- var t = this.h % 360 + (this.h < 0) * 360, e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r;
1485
- return new A(
1486
- Be(t >= 240 ? t - 240 : t + 120, i, r),
1487
- Be(t, i, r),
1488
- Be(t < 120 ? t + 240 : t - 120, i, r),
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),
1489
364
  this.opacity
1490
365
  );
1491
366
  },
1492
367
  clamp() {
1493
- return new $(ut(this.h), be(this.s), be(this.l), Ce(this.opacity));
368
+ return new L(Ve(this.h), ce(this.s), ce(this.l), he(this.opacity));
1494
369
  },
1495
370
  displayable() {
1496
371
  return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
1497
372
  },
1498
373
  formatHsl() {
1499
- const t = Ce(this.opacity);
1500
- return `${t === 1 ? "hsl(" : "hsla("}${ut(this.h)}, ${be(this.s) * 100}%, ${be(this.l) * 100}%${t === 1 ? ")" : `, ${t})`}`;
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})`}`;
1501
376
  }
1502
377
  }));
1503
- function ut(t) {
1504
- return t = (t || 0) % 360, t < 0 ? t + 360 : t;
378
+ function Ve(e) {
379
+ return e = (e || 0) % 360, e < 0 ? e + 360 : e;
1505
380
  }
1506
- function be(t) {
1507
- return Math.max(0, Math.min(1, t || 0));
381
+ function ce(e) {
382
+ return Math.max(0, Math.min(1, e || 0));
1508
383
  }
1509
- function Be(t, e, n) {
1510
- return (t < 60 ? e + (n - e) * t / 60 : t < 180 ? n : t < 240 ? e + (n - e) * (240 - t) / 60 : e) * 255;
384
+ function ve(e, n, t) {
385
+ return (e < 60 ? n + (t - n) * e / 60 : e < 180 ? t : e < 240 ? n + (t - n) * (240 - e) / 60 : n) * 255;
1511
386
  }
1512
- const Ge = (t) => () => t;
1513
- function en(t, e) {
1514
- return function(n) {
1515
- return t + n * e;
387
+ const Se = (e) => () => e;
388
+ function In(e, n) {
389
+ return function(t) {
390
+ return e + t * n;
1516
391
  };
1517
392
  }
1518
- function tn(t, e, n) {
1519
- return t = Math.pow(t, n), e = Math.pow(e, n) - t, n = 1 / n, function(r) {
1520
- return Math.pow(t + r * e, n);
393
+ function jn(e, n, t) {
394
+ return e = Math.pow(e, t), n = Math.pow(n, t) - e, t = 1 / t, function(r) {
395
+ return Math.pow(e + r * n, t);
1521
396
  };
1522
397
  }
1523
- function nn(t) {
1524
- return (t = +t) == 1 ? yt : function(e, n) {
1525
- return n - e ? tn(e, n, t) : Ge(isNaN(e) ? n : e);
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);
1526
401
  };
1527
402
  }
1528
- function yt(t, e) {
1529
- var n = e - t;
1530
- return n ? en(t, n) : Ge(isNaN(t) ? e : t);
403
+ function nn(e, n) {
404
+ var t = n - e;
405
+ return t ? In(e, t) : Se(isNaN(e) ? n : e);
1531
406
  }
1532
- const Ie = (function t(e) {
1533
- var n = nn(e);
1534
- function r(i, o) {
1535
- var s = n((i = Te(i)).r, (o = Te(o)).r), a = n(i.g, o.g), c = n(i.b, o.b), u = yt(i.opacity, o.opacity);
1536
- return function(f) {
1537
- return i.r = s(f), i.g = a(f), i.b = c(f), i.opacity = u(f), i + "";
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 + "";
1538
413
  };
1539
414
  }
1540
- return r.gamma = t, r;
415
+ return r.gamma = e, r;
1541
416
  })(1);
1542
- function rn(t, e) {
1543
- e || (e = []);
1544
- var n = t ? Math.min(e.length, t.length) : 0, r = e.slice(), i;
1545
- return function(o) {
1546
- for (i = 0; i < n; ++i) r[i] = t[i] * (1 - o) + e[i] * o;
417
+ function Pn(e, n) {
418
+ n || (n = []);
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;
1547
422
  return r;
1548
423
  };
1549
424
  }
1550
- function on(t) {
1551
- return ArrayBuffer.isView(t) && !(t instanceof DataView);
425
+ function On(e) {
426
+ return ArrayBuffer.isView(e) && !(e instanceof DataView);
1552
427
  }
1553
- function sn(t, e) {
1554
- var n = e ? e.length : 0, r = t ? Math.min(n, t.length) : 0, i = new Array(r), o = new Array(n), s;
1555
- for (s = 0; s < r; ++s) i[s] = qe(t[s], e[s]);
1556
- for (; s < n; ++s) o[s] = e[s];
1557
- return function(a) {
1558
- for (s = 0; s < r; ++s) o[s] = i[s](a);
1559
- return o;
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;
1560
435
  };
1561
436
  }
1562
- function an(t, e) {
1563
- var n = /* @__PURE__ */ new Date();
1564
- return t = +t, e = +e, function(r) {
1565
- return n.setTime(t * (1 - r) + e * r), n;
437
+ function Hn(e, n) {
438
+ var t = /* @__PURE__ */ new Date();
439
+ return e = +e, n = +n, function(r) {
440
+ return t.setTime(e * (1 - r) + n * r), t;
1566
441
  };
1567
442
  }
1568
- function Me(t, e) {
1569
- return t = +t, e = +e, function(n) {
1570
- return t * (1 - n) + e * n;
443
+ function me(e, n) {
444
+ return e = +e, n = +n, function(t) {
445
+ return e * (1 - t) + n * t;
1571
446
  };
1572
447
  }
1573
- function un(t, e) {
1574
- var n = {}, r = {}, i;
1575
- (t === null || typeof t != "object") && (t = {}), (e === null || typeof e != "object") && (e = {});
1576
- for (i in e)
1577
- i in t ? n[i] = qe(t[i], e[i]) : r[i] = e[i];
1578
- return function(o) {
1579
- for (i in n) r[i] = n[i](o);
448
+ function Tn(e, n) {
449
+ var t = {}, r = {}, i;
450
+ (e === null || typeof e != "object") && (e = {}), (n === null || typeof n != "object") && (n = {});
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);
1580
455
  return r;
1581
456
  };
1582
457
  }
1583
- var He = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, $e = new RegExp(He.source, "g");
1584
- function cn(t) {
458
+ var ke = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Ne = new RegExp(ke.source, "g");
459
+ function Gn(e) {
1585
460
  return function() {
1586
- return t;
461
+ return e;
1587
462
  };
1588
463
  }
1589
- function fn(t) {
1590
- return function(e) {
1591
- return t(e) + "";
464
+ function Un(e) {
465
+ return function(n) {
466
+ return e(n) + "";
1592
467
  };
1593
468
  }
1594
- function ln(t, e) {
1595
- var n = He.lastIndex = $e.lastIndex = 0, r, i, o, s = -1, a = [], c = [];
1596
- for (t = t + "", e = e + ""; (r = He.exec(t)) && (i = $e.exec(e)); )
1597
- (o = i.index) > n && (o = e.slice(n, 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, c.push({ i: s, x: Me(r, i) })), n = $e.lastIndex;
1598
- return n < e.length && (o = e.slice(n), a[s] ? a[s] += o : a[++s] = o), a.length < 2 ? c[0] ? fn(c[0].x) : cn(e) : (e = c.length, function(u) {
1599
- for (var f = 0, l; f < e; ++f) a[(l = c[f]).i] = l.x(u);
1600
- return a.join("");
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("");
1601
476
  });
1602
477
  }
1603
- function qe(t, e) {
1604
- var n = typeof e, r;
1605
- return e == null || n === "boolean" ? Ge(e) : (n === "number" ? Me : n === "string" ? (r = ue(e)) ? (e = r, Ie) : ln : e instanceof ue ? Ie : e instanceof Date ? an : on(e) ? rn : Array.isArray(e) ? sn : typeof e.valueOf != "function" && typeof e.toString != "function" || isNaN(e) ? un : Me)(t, e);
478
+ function Ee(e, n) {
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);
1606
481
  }
1607
- function hn(t, e) {
1608
- return t = +t, e = +e, function(n) {
1609
- return Math.round(t * (1 - n) + e * n);
482
+ function Vn(e, n) {
483
+ return e = +e, n = +n, function(t) {
484
+ return Math.round(e * (1 - t) + n * t);
1610
485
  };
1611
486
  }
1612
- function ye(t, e) {
1613
- return t == null || e == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
487
+ function le(e, n) {
488
+ return e == null || n == null ? NaN : e < n ? -1 : e > n ? 1 : e >= n ? 0 : NaN;
1614
489
  }
1615
- function gn(t, e) {
1616
- return t == null || e == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
490
+ function qn(e, n) {
491
+ return e == null || n == null ? NaN : n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
1617
492
  }
1618
- function Ft(t) {
1619
- let e, n, r;
1620
- t.length !== 2 ? (e = ye, n = (a, c) => ye(t(a), c), r = (a, c) => t(a) - c) : (e = t === ye || t === gn ? t : dn, n = t, r = t);
1621
- function i(a, c, u = 0, f = a.length) {
1622
- if (u < f) {
1623
- if (e(c, c) !== 0) return f;
493
+ function tn(e) {
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;
1624
499
  do {
1625
- const l = u + f >>> 1;
1626
- n(a[l], c) < 0 ? u = l + 1 : f = l;
1627
- } while (u < f);
500
+ const u = f + h >>> 1;
501
+ t(s[u], l) < 0 ? f = u + 1 : h = u;
502
+ } while (f < h);
1628
503
  }
1629
- return u;
504
+ return f;
1630
505
  }
1631
- function o(a, c, u = 0, f = a.length) {
1632
- if (u < f) {
1633
- if (e(c, c) !== 0) return f;
506
+ function a(s, l, f = 0, h = s.length) {
507
+ if (f < h) {
508
+ if (n(l, l) !== 0) return h;
1634
509
  do {
1635
- const l = u + f >>> 1;
1636
- n(a[l], c) <= 0 ? u = l + 1 : f = l;
1637
- } while (u < f);
510
+ const u = f + h >>> 1;
511
+ t(s[u], l) <= 0 ? f = u + 1 : h = u;
512
+ } while (f < h);
1638
513
  }
1639
- return u;
514
+ return f;
1640
515
  }
1641
- function s(a, c, u = 0, f = a.length) {
1642
- const l = i(a, c, u, f - 1);
1643
- return l > u && r(a[l - 1], c) > -r(a[l], c) ? l - 1 : l;
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;
1644
519
  }
1645
- return { left: i, center: s, right: o };
520
+ return { left: i, center: o, right: a };
1646
521
  }
1647
- function dn() {
522
+ function Bn() {
1648
523
  return 0;
1649
524
  }
1650
- function mn(t) {
1651
- return t === null ? NaN : +t;
1652
- }
1653
- const xn = Ft(ye), pn = xn.right;
1654
- Ft(mn).center;
1655
- const bn = Math.sqrt(50), wn = Math.sqrt(10), yn = Math.sqrt(2);
1656
- function ke(t, e, n) {
1657
- const r = (e - t) / Math.max(0, n), i = Math.floor(Math.log10(r)), o = r / Math.pow(10, i), s = o >= bn ? 10 : o >= wn ? 5 : o >= yn ? 2 : 1;
1658
- let a, c, u;
1659
- return i < 0 ? (u = Math.pow(10, -i) / s, a = Math.round(t * u), c = Math.round(e * u), a / u < t && ++a, c / u > e && --c, u = -u) : (u = Math.pow(10, i) * s, a = Math.round(t / u), c = Math.round(e / u), a * u < t && ++a, c * u > e && --c), c < a && 0.5 <= n && n < 2 ? ke(t, e, n * 2) : [a, c, u];
1660
- }
1661
- function Fn(t, e, n) {
1662
- if (e = +e, t = +t, n = +n, !(n > 0)) return [];
1663
- if (t === e) return [t];
1664
- const r = e < t, [i, o, s] = r ? ke(e, t, n) : ke(t, e, n);
1665
- if (!(o >= i)) return [];
1666
- const a = o - i + 1, c = new Array(a);
525
+ function Zn(e) {
526
+ return e === null ? NaN : +e;
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];
535
+ }
536
+ function Qn(e, n, t) {
537
+ if (n = +n, e = +e, t = +t, !(t > 0)) return [];
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);
1667
542
  if (r)
1668
- if (s < 0) for (let u = 0; u < a; ++u) c[u] = (o - u) / -s;
1669
- else for (let u = 0; u < a; ++u) c[u] = (o - u) * s;
1670
- else if (s < 0) for (let u = 0; u < a; ++u) c[u] = (i + u) / -s;
1671
- else for (let u = 0; u < a; ++u) c[u] = (i + u) * s;
1672
- return c;
1673
- }
1674
- function Oe(t, e, n) {
1675
- return e = +e, t = +t, n = +n, ke(t, e, n)[2];
1676
- }
1677
- function Cn(t, e, n) {
1678
- e = +e, t = +t, n = +n;
1679
- const r = e < t, i = r ? Oe(e, t, n) : Oe(t, e, n);
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;
547
+ return l;
548
+ }
549
+ function Ce(e, n, t) {
550
+ return n = +n, e = +e, t = +t, ge(e, n, t)[2];
551
+ }
552
+ function et(e, n, t) {
553
+ n = +n, e = +e, t = +t;
554
+ const r = n < e, i = r ? Ce(n, e, t) : Ce(e, n, t);
1680
555
  return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
1681
556
  }
1682
- function Mn(t, e) {
557
+ function nt(e, n) {
1683
558
  switch (arguments.length) {
1684
559
  case 0:
1685
560
  break;
1686
561
  case 1:
1687
- this.range(t);
562
+ this.range(e);
1688
563
  break;
1689
564
  default:
1690
- this.range(e).domain(t);
565
+ this.range(n).domain(e);
1691
566
  break;
1692
567
  }
1693
568
  return this;
1694
569
  }
1695
- function kn(t) {
570
+ function tt(e) {
1696
571
  return function() {
1697
- return t;
572
+ return e;
1698
573
  };
1699
574
  }
1700
- function vn(t) {
1701
- return +t;
575
+ function rt(e) {
576
+ return +e;
1702
577
  }
1703
- var ct = [0, 1];
1704
- function J(t) {
1705
- return t;
578
+ var qe = [0, 1];
579
+ function Z(e) {
580
+ return e;
1706
581
  }
1707
- function Pe(t, e) {
1708
- return (e -= t = +t) ? function(n) {
1709
- return (n - t) / e;
1710
- } : kn(isNaN(e) ? NaN : 0.5);
582
+ function Le(e, n) {
583
+ return (n -= e = +e) ? function(t) {
584
+ return (t - e) / n;
585
+ } : tt(isNaN(n) ? NaN : 0.5);
1711
586
  }
1712
- function En(t, e) {
1713
- var n;
1714
- return t > e && (n = t, t = e, e = n), function(r) {
1715
- return Math.max(t, Math.min(e, r));
587
+ function it(e, n) {
588
+ var t;
589
+ return e > n && (t = e, e = n, n = t), function(r) {
590
+ return Math.max(e, Math.min(n, r));
1716
591
  };
1717
592
  }
1718
- function Nn(t, e, n) {
1719
- var r = t[0], i = t[1], o = e[0], s = e[1];
1720
- return i < r ? (r = Pe(i, r), o = n(s, o)) : (r = Pe(r, i), o = n(o, s)), function(a) {
1721
- return o(r(a));
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));
1722
597
  };
1723
598
  }
1724
- function An(t, e, n) {
1725
- var r = Math.min(t.length, e.length) - 1, i = new Array(r), o = new Array(r), s = -1;
1726
- for (t[r] < t[0] && (t = t.slice().reverse(), e = e.slice().reverse()); ++s < r; )
1727
- i[s] = Pe(t[s], t[s + 1]), o[s] = n(e[s], e[s + 1]);
1728
- return function(a) {
1729
- var c = pn(t, a, 1, r) - 1;
1730
- return o[c](i[c](a));
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));
1731
606
  };
1732
607
  }
1733
- function _n(t, e) {
1734
- return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());
1735
- }
1736
- function Sn() {
1737
- var t = ct, e = ct, n = qe, r, i, o, s = J, a, c, u;
1738
- function f() {
1739
- var g = Math.min(t.length, e.length);
1740
- return s !== J && (s = En(t[0], t[g - 1])), a = g > 2 ? An : Nn, c = u = null, l;
1741
- }
1742
- function l(g) {
1743
- return g == null || isNaN(g = +g) ? o : (c || (c = a(t.map(r), e, n)))(r(s(g)));
1744
- }
1745
- return l.invert = function(g) {
1746
- return s(i((u || (u = a(e, t.map(r), Me)))(g)));
1747
- }, l.domain = function(g) {
1748
- return arguments.length ? (t = Array.from(g, vn), f()) : t.slice();
1749
- }, l.range = function(g) {
1750
- return arguments.length ? (e = Array.from(g), f()) : e.slice();
1751
- }, l.rangeRound = function(g) {
1752
- return e = Array.from(g), n = hn, f();
1753
- }, l.clamp = function(g) {
1754
- return arguments.length ? (s = g ? !0 : J, f()) : s !== J;
1755
- }, l.interpolate = function(g) {
1756
- return arguments.length ? (n = g, f()) : n;
1757
- }, l.unknown = function(g) {
1758
- return arguments.length ? (o = g, l) : o;
1759
- }, function(g, w) {
1760
- return r = g, i = w, f();
608
+ function st(e, n) {
609
+ return n.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());
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;
616
+ }
617
+ function u(d) {
618
+ return d == null || isNaN(d = +d) ? a : (l || (l = s(e.map(r), n, t)))(r(o(d)));
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();
1761
636
  };
1762
637
  }
1763
- function Rn() {
1764
- return Sn()(J, J);
638
+ function ct() {
639
+ return ft()(Z, Z);
1765
640
  }
1766
- function Ln(t) {
1767
- return Math.abs(t = Math.round(t)) >= 1e21 ? t.toLocaleString("en").replace(/,/g, "") : t.toString(10);
641
+ function ut(e) {
642
+ return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10);
1768
643
  }
1769
- function ve(t, e) {
1770
- if (!isFinite(t) || t === 0) return null;
1771
- var n = (t = e ? t.toExponential(e - 1) : t.toExponential()).indexOf("e"), r = t.slice(0, n);
644
+ function pe(e, n) {
645
+ if (!isFinite(e) || e === 0) return null;
646
+ var t = (e = n ? e.toExponential(n - 1) : e.toExponential()).indexOf("e"), r = e.slice(0, t);
1772
647
  return [
1773
648
  r.length > 1 ? r[0] + r.slice(2) : r,
1774
- +t.slice(n + 1)
649
+ +e.slice(t + 1)
1775
650
  ];
1776
651
  }
1777
- function te(t) {
1778
- return t = ve(Math.abs(t)), t ? t[1] : NaN;
652
+ function Y(e) {
653
+ return e = pe(Math.abs(e)), e ? e[1] : NaN;
1779
654
  }
1780
- function Bn(t, e) {
1781
- return function(n, r) {
1782
- for (var i = n.length, o = [], s = 0, a = t[0], c = 0; i > 0 && a > 0 && (c + a + 1 > r && (a = Math.max(1, r - c)), o.push(n.substring(i -= a, i + a)), !((c += a + 1) > r)); )
1783
- a = t[s = (s + 1) % t.length];
1784
- return o.reverse().join(e);
655
+ function lt(e, n) {
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);
1785
660
  };
1786
661
  }
1787
- function $n(t) {
1788
- return function(e) {
1789
- return e.replace(/[0-9]/g, function(n) {
1790
- return t[+n];
662
+ function dt(e) {
663
+ return function(n) {
664
+ return n.replace(/[0-9]/g, function(t) {
665
+ return e[+t];
1791
666
  });
1792
667
  };
1793
668
  }
1794
- var Dn = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
1795
- function Ee(t) {
1796
- if (!(e = Dn.exec(t))) throw new Error("invalid format: " + t);
1797
- var e;
1798
- return new ze({
1799
- fill: e[1],
1800
- align: e[2],
1801
- sign: e[3],
1802
- symbol: e[4],
1803
- zero: e[5],
1804
- width: e[6],
1805
- comma: e[7],
1806
- precision: e[8] && e[8].slice(1),
1807
- trim: e[9],
1808
- type: e[10]
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);
672
+ var n;
673
+ return new Ie({
674
+ fill: n[1],
675
+ align: n[2],
676
+ sign: n[3],
677
+ symbol: n[4],
678
+ zero: n[5],
679
+ width: n[6],
680
+ comma: n[7],
681
+ precision: n[8] && n[8].slice(1),
682
+ trim: n[9],
683
+ type: n[10]
1809
684
  });
1810
685
  }
1811
- Ee.prototype = ze.prototype;
1812
- function ze(t) {
1813
- this.fill = t.fill === void 0 ? " " : t.fill + "", this.align = t.align === void 0 ? ">" : t.align + "", this.sign = t.sign === void 0 ? "-" : t.sign + "", this.symbol = t.symbol === void 0 ? "" : t.symbol + "", this.zero = !!t.zero, this.width = t.width === void 0 ? void 0 : +t.width, this.comma = !!t.comma, this.precision = t.precision === void 0 ? void 0 : +t.precision, this.trim = !!t.trim, this.type = t.type === void 0 ? "" : t.type + "";
686
+ xe.prototype = Ie.prototype;
687
+ function Ie(e) {
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 + "";
1814
689
  }
1815
- ze.prototype.toString = function() {
690
+ Ie.prototype.toString = function() {
1816
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;
1817
692
  };
1818
- function Tn(t) {
1819
- e: for (var e = t.length, n = 1, r = -1, i; n < e; ++n)
1820
- switch (t[n]) {
693
+ function mt(e) {
694
+ e: for (var n = e.length, t = 1, r = -1, i; t < n; ++t)
695
+ switch (e[t]) {
1821
696
  case ".":
1822
- r = i = n;
697
+ r = i = t;
1823
698
  break;
1824
699
  case "0":
1825
- r === 0 && (r = n), i = n;
700
+ r === 0 && (r = t), i = t;
1826
701
  break;
1827
702
  default:
1828
- if (!+t[n]) break e;
703
+ if (!+e[t]) break e;
1829
704
  r > 0 && (r = 0);
1830
705
  break;
1831
706
  }
1832
- return r > 0 ? t.slice(0, r) + t.slice(i + 1) : t;
1833
- }
1834
- var Ne;
1835
- function In(t, e) {
1836
- var n = ve(t, e);
1837
- if (!n) return Ne = void 0, t.toPrecision(e);
1838
- var r = n[0], i = n[1], o = i - (Ne = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, s = r.length;
1839
- 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") + ve(t, Math.max(0, e + o - 1))[0];
1840
- }
1841
- function ft(t, e) {
1842
- var n = ve(t, e);
1843
- if (!n) return t + "";
1844
- var r = n[0], i = n[1];
707
+ return r > 0 ? e.slice(0, r) + e.slice(i + 1) : e;
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];
715
+ }
716
+ function Be(e, n) {
717
+ var t = pe(e, n);
718
+ if (!t) return e + "";
719
+ var r = t[0], i = t[1];
1845
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");
1846
721
  }
1847
- const lt = {
1848
- "%": (t, e) => (t * 100).toFixed(e),
1849
- b: (t) => Math.round(t).toString(2),
1850
- c: (t) => t + "",
1851
- d: Ln,
1852
- e: (t, e) => t.toExponential(e),
1853
- f: (t, e) => t.toFixed(e),
1854
- g: (t, e) => t.toPrecision(e),
1855
- o: (t) => Math.round(t).toString(8),
1856
- p: (t, e) => ft(t * 100, e),
1857
- r: ft,
1858
- s: In,
1859
- X: (t) => Math.round(t).toString(16).toUpperCase(),
1860
- x: (t) => Math.round(t).toString(16)
722
+ const Ze = {
723
+ "%": (e, n) => (e * 100).toFixed(n),
724
+ b: (e) => Math.round(e).toString(2),
725
+ c: (e) => e + "",
726
+ d: ut,
727
+ e: (e, n) => e.toExponential(n),
728
+ f: (e, n) => e.toFixed(n),
729
+ g: (e, n) => e.toPrecision(n),
730
+ o: (e) => Math.round(e).toString(8),
731
+ p: (e, n) => Be(e * 100, n),
732
+ r: Be,
733
+ s: gt,
734
+ X: (e) => Math.round(e).toString(16).toUpperCase(),
735
+ x: (e) => Math.round(e).toString(16)
1861
736
  };
1862
- function ht(t) {
1863
- return t;
1864
- }
1865
- var gt = Array.prototype.map, dt = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
1866
- function Hn(t) {
1867
- var e = t.grouping === void 0 || t.thousands === void 0 ? ht : Bn(gt.call(t.grouping, Number), t.thousands + ""), n = t.currency === void 0 ? "" : t.currency[0] + "", r = t.currency === void 0 ? "" : t.currency[1] + "", i = t.decimal === void 0 ? "." : t.decimal + "", o = t.numerals === void 0 ? ht : $n(gt.call(t.numerals, String)), s = t.percent === void 0 ? "%" : t.percent + "", a = t.minus === void 0 ? "−" : t.minus + "", c = t.nan === void 0 ? "NaN" : t.nan + "";
1868
- function u(l, g) {
1869
- l = Ee(l);
1870
- var w = l.fill, y = l.align, F = l.sign, S = l.symbol, _ = l.zero, O = l.width, D = l.comma, v = l.precision, j = l.trim, M = l.type;
1871
- M === "n" ? (D = !0, M = "g") : lt[M] || (v === void 0 && (v = 12), j = !0, M = "g"), (_ || w === "0" && y === "=") && (_ = !0, w = "0", y = "=");
1872
- var T = (g && g.prefix !== void 0 ? g.prefix : "") + (S === "$" ? n : S === "#" && /[boxX]/.test(M) ? "0" + M.toLowerCase() : ""), le = (S === "$" ? r : /[%p]/.test(M) ? s : "") + (g && g.suffix !== void 0 ? g.suffix : ""), he = lt[M], ge = /[defgprs%]/.test(M);
1873
- v = v === void 0 ? 6 : /[gprs]/.test(M) ? Math.max(1, Math.min(21, v)) : Math.max(0, Math.min(20, v));
1874
- function ne(p) {
1875
- var P = T, E = le, I, re, X;
737
+ function Je(e) {
738
+ return e;
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;
1876
751
  if (M === "c")
1877
- E = he(p) + E, p = "";
752
+ _ = oe(p) + _, p = "";
1878
753
  else {
1879
754
  p = +p;
1880
- var q = p < 0 || 1 / p < 0;
1881
- if (p = isNaN(p) ? c : he(Math.abs(p), v), j && (p = Tn(p)), q && +p == 0 && F !== "+" && (q = !1), P = (q ? F === "(" ? F : a : F === "-" || F === "(" ? "" : F) + P, E = (M === "s" && !isNaN(p) && Ne !== void 0 ? dt[8 + Ne / 3] : "") + E + (q && F === "(" ? ")" : ""), ge) {
1882
- for (I = -1, re = p.length; ++I < re; )
1883
- if (X = p.charCodeAt(I), 48 > X || X > 57) {
1884
- E = (X === 46 ? i + p.slice(I + 1) : p.slice(I)) + E, p = p.slice(0, I);
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);
1885
760
  break;
1886
761
  }
1887
762
  }
1888
763
  }
1889
- D && !_ && (p = e(p, 1 / 0));
1890
- var z = P.length + p.length + E.length, R = z < O ? new Array(O - z + 1).join(w) : "";
1891
- switch (D && _ && (p = e(R + p, R.length ? O - E.length : 1 / 0), R = ""), y) {
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) {
1892
767
  case "<":
1893
- p = P + p + E + R;
768
+ p = I + p + _ + C;
1894
769
  break;
1895
770
  case "=":
1896
- p = P + R + p + E;
771
+ p = I + C + p + _;
1897
772
  break;
1898
773
  case "^":
1899
- p = R.slice(0, z = R.length >> 1) + P + p + E + R.slice(z);
774
+ p = C.slice(0, z = C.length >> 1) + I + p + _ + C.slice(z);
1900
775
  break;
1901
776
  default:
1902
- p = R + P + p + E;
777
+ p = C + I + p + _;
1903
778
  break;
1904
779
  }
1905
- return o(p);
780
+ return a(p);
1906
781
  }
1907
- return ne.toString = function() {
1908
- return l + "";
1909
- }, ne;
1910
- }
1911
- function f(l, g) {
1912
- var w = Math.max(-8, Math.min(8, Math.floor(te(g) / 3))) * 3, y = Math.pow(10, -w), F = u((l = Ee(l), l.type = "f", l), { suffix: dt[8 + w / 3] });
1913
- return function(S) {
1914
- return F(y * S);
782
+ return X.toString = function() {
783
+ return u + "";
784
+ }, X;
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);
1915
790
  };
1916
791
  }
1917
792
  return {
1918
- format: u,
1919
- formatPrefix: f
793
+ format: f,
794
+ formatPrefix: h
1920
795
  };
1921
796
  }
1922
- var we, Ct, Mt;
1923
- On({
797
+ var ue, rn, on;
798
+ xt({
1924
799
  thousands: ",",
1925
800
  grouping: [3],
1926
801
  currency: ["$", ""]
1927
802
  });
1928
- function On(t) {
1929
- return we = Hn(t), Ct = we.format, Mt = we.formatPrefix, we;
803
+ function xt(e) {
804
+ return ue = pt(e), rn = ue.format, on = ue.formatPrefix, ue;
1930
805
  }
1931
- function Pn(t) {
1932
- return Math.max(0, -te(Math.abs(t)));
806
+ function bt(e) {
807
+ return Math.max(0, -Y(Math.abs(e)));
1933
808
  }
1934
- function jn(t, e) {
1935
- return Math.max(0, Math.max(-8, Math.min(8, Math.floor(te(e) / 3))) * 3 - te(Math.abs(t)));
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)));
1936
811
  }
1937
- function Gn(t, e) {
1938
- return t = Math.abs(t), e = Math.abs(e) - t, Math.max(0, te(e) - te(t)) + 1;
812
+ function wt(e, n) {
813
+ return e = Math.abs(e), n = Math.abs(n) - e, Math.max(0, Y(n) - Y(e)) + 1;
1939
814
  }
1940
- function qn(t, e, n, r) {
1941
- var i = Cn(t, e, n), o;
1942
- switch (r = Ee(r ?? ",f"), r.type) {
815
+ function vt(e, n, t, r) {
816
+ var i = et(e, n, t), a;
817
+ switch (r = xe(r ?? ",f"), r.type) {
1943
818
  case "s": {
1944
- var s = Math.max(Math.abs(t), Math.abs(e));
1945
- return r.precision == null && !isNaN(o = jn(i, s)) && (r.precision = o), Mt(r, 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);
1946
821
  }
1947
822
  case "":
1948
823
  case "e":
1949
824
  case "g":
1950
825
  case "p":
1951
826
  case "r": {
1952
- r.precision == null && !isNaN(o = Gn(i, Math.max(Math.abs(t), Math.abs(e)))) && (r.precision = o - (r.type === "e"));
827
+ r.precision == null && !isNaN(a = wt(i, Math.max(Math.abs(e), Math.abs(n)))) && (r.precision = a - (r.type === "e"));
1953
828
  break;
1954
829
  }
1955
830
  case "f":
1956
831
  case "%": {
1957
- r.precision == null && !isNaN(o = Pn(i)) && (r.precision = o - (r.type === "%") * 2);
832
+ r.precision == null && !isNaN(a = bt(i)) && (r.precision = a - (r.type === "%") * 2);
1958
833
  break;
1959
834
  }
1960
835
  }
1961
- return Ct(r);
1962
- }
1963
- function zn(t) {
1964
- var e = t.domain;
1965
- return t.ticks = function(n) {
1966
- var r = e();
1967
- return Fn(r[0], r[r.length - 1], n ?? 10);
1968
- }, t.tickFormat = function(n, r) {
1969
- var i = e();
1970
- return qn(i[0], i[i.length - 1], n ?? 10, r);
1971
- }, t.nice = function(n) {
1972
- n == null && (n = 10);
1973
- var r = e(), i = 0, o = r.length - 1, s = r[i], a = r[o], c, u, f = 10;
1974
- for (a < s && (u = s, s = a, a = u, u = i, i = o, o = u); f-- > 0; ) {
1975
- if (u = Oe(s, a, n), u === c)
1976
- return r[i] = s, r[o] = a, e(r);
1977
- if (u > 0)
1978
- s = Math.floor(s / u) * u, a = Math.ceil(a / u) * u;
1979
- else if (u < 0)
1980
- s = Math.ceil(s * u) / u, a = Math.floor(a * u) / u;
836
+ return rn(r);
837
+ }
838
+ function Nt(e) {
839
+ var n = e.domain;
840
+ return e.ticks = function(t) {
841
+ var r = n();
842
+ return Qn(r[0], r[r.length - 1], t ?? 10);
843
+ }, e.tickFormat = function(t, r) {
844
+ var i = n();
845
+ return vt(i[0], i[i.length - 1], t ?? 10, r);
846
+ }, e.nice = function(t) {
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);
852
+ if (f > 0)
853
+ o = Math.floor(o / f) * f, s = Math.ceil(s / f) * f;
854
+ else if (f < 0)
855
+ o = Math.ceil(o * f) / f, s = Math.floor(s * f) / f;
1981
856
  else
1982
857
  break;
1983
- c = u;
858
+ l = f;
1984
859
  }
1985
- return t;
1986
- }, t;
1987
- }
1988
- function kt() {
1989
- var t = Rn();
1990
- return t.copy = function() {
1991
- return _n(t, kt());
1992
- }, Mn.apply(t, arguments), zn(t);
1993
- }
1994
- const De = (t, e) => {
1995
- const n = t?.[e];
1996
- return typeof n == "number" ? n : 0;
1997
- }, mt = (t, e) => {
1998
- if (!t.length) return () => e.minColor;
1999
- const n = Math.min(...t), r = Math.max(...t);
2000
- if (n === r) return () => e.maxColor;
2001
- const i = kt().domain([n, r]).range([0, 1]), o = Ie(e.minColor, e.maxColor);
2002
- return (s) => o(i(s));
2003
- }, Un = (t) => t <= 1.35 ? 2 : t <= 2.1 ? 1 : 0, Vn = (t) => new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format(t), Jn = ({
2004
- statisticsData: t,
2005
- resetSignal: e,
2006
- countryNumericToIsoMap: n = {},
860
+ return e;
861
+ }, e;
862
+ }
863
+ function an() {
864
+ var e = ct();
865
+ return e.copy = function() {
866
+ return st(e, an());
867
+ }, nt.apply(e, arguments), Nt(e);
868
+ }
869
+ const Me = (e, n) => {
870
+ const t = e?.[n];
871
+ return typeof t == "number" ? t : 0;
872
+ }, Xe = (e, n) => {
873
+ if (!e.length) return () => n.minColor;
874
+ const t = Math.min(...e), r = Math.max(...e);
875
+ 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) => {
879
+ let t = e.trim();
880
+ if (!t) return t;
881
+ const r = n?.trim().toUpperCase();
882
+ 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([
884
+ "countrycode",
885
+ "country_code",
886
+ "iso_a2",
887
+ "iso",
888
+ "adm0_a3",
889
+ "iso_3166_1"
890
+ ]), Ct = (e) => kt.has(e.toLowerCase()), Lt = (e, n) => e.toLowerCase() === "revenue" ? new Intl.NumberFormat("en-US", {
891
+ style: "currency",
892
+ currency: "USD",
893
+ notation: "compact",
894
+ maximumFractionDigits: 1
895
+ }).format(n) : _t(n), We = "cool-globe-float-tooltip-override", At = () => {
896
+ if (typeof document > "u" || document.getElementById(We)) return;
897
+ const e = document.createElement("style");
898
+ e.id = We, e.textContent = `
899
+ .cool-globe-host .float-tooltip-kap {
900
+ background: transparent !important;
901
+ background-color: transparent !important;
902
+ padding: 0 !important;
903
+ border-radius: 0 !important;
904
+ box-shadow: none !important;
905
+ max-width: none !important;
906
+ font-size: inherit !important;
907
+ font-family: inherit !important;
908
+ color: transparent !important;
909
+ }
910
+ `, document.head.appendChild(e);
911
+ }, Ft = ({
912
+ statisticsData: e,
913
+ resetSignal: n,
914
+ countryNumericToIsoMap: t = {},
2007
915
  countryNameToIsoMap: r = {},
2008
916
  primaryMetric: i = "visits",
2009
- colorScale: o = jt
917
+ colorScale: a = wn
2010
918
  }) => {
2011
- const s = W(null), a = W(null), c = W(void 0), u = W({}), f = W(null), l = W(e), [g, w] = U(0), [y, F] = U(), [S, _] = U(), [O, D] = U(null), [v, j] = U([]), [M, T] = U([]), [le, he] = U({
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({
2012
920
  width: 900,
2013
921
  height: 760
2014
- }), ge = me(
2015
- () => Object.values(t.countries).map(
2016
- (h) => De(h, i)
922
+ });
923
+ P(() => {
924
+ At();
925
+ }, []);
926
+ const ae = se(
927
+ () => Object.values(e.countries).map(
928
+ (c) => Me(c, i)
2017
929
  ),
2018
- [i, t.countries]
2019
- ), ne = me(() => y ? Object.values(t.regions[y] ?? {}).map(
2020
- (h) => De(h, i)
2021
- ) : [], [y, i, t.regions]), p = me(
2022
- () => mt(ge, o),
2023
- [ge, o]
2024
- ), P = me(
2025
- () => mt(ne, o),
2026
- [ne, o]
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]
2027
939
  );
2028
- V(() => {
940
+ P(() => {
2029
941
  (async () => {
2030
- let d = [];
942
+ let m = [];
2031
943
  try {
2032
- d = (await (await fetch(It)).json()).features;
944
+ m = (await (await fetch(pn)).json()).features;
2033
945
  } catch {
2034
- const m = await (await fetch(Ht)).json(), C = m.objects.countries, N = Lt(
2035
- m,
2036
- C
946
+ const g = await (await fetch(xn)).json(), b = g.objects.countries, N = mn(
947
+ g,
948
+ b
2037
949
  );
2038
- d = N.type === "FeatureCollection" ? N.features : [N];
950
+ m = N.type === "FeatureCollection" ? N.features : [N];
2039
951
  }
2040
- const b = d.map((x) => {
2041
- const m = String(x.id ?? ""), C = x.properties ?? {}, N = String(
2042
- C.name ?? C.NAME ?? C.name_en ?? C.ADMIN ?? ""
2043
- ).trim() || `Country ${m}`, Ae = N.toLowerCase(), de = String(
2044
- C.iso_a2 ?? C.ISO_A2 ?? C.iso_a2_eh ?? ""
2045
- ).trim().toUpperCase(), Ve = n[m] ?? r[Ae] ?? (de && de !== "-99" ? de : void 0) ?? (m.length === 2 ? m.toUpperCase() : m);
952
+ 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);
2046
958
  return {
2047
959
  ...x,
2048
960
  properties: {
2049
- ...C,
2050
- __isoA2: Ve,
2051
- name: N || Ve || `Country ${m}`
961
+ ...b,
962
+ __isoA2: ye,
963
+ name: N || ye || `Country ${g}`
2052
964
  }
2053
965
  };
2054
966
  });
2055
- j(b);
967
+ re(y);
2056
968
  })();
2057
- }, []), V(() => {
2058
- if (!a.current) return;
2059
- const h = new ResizeObserver((d) => {
2060
- const b = d[0];
2061
- b && he({
2062
- width: Math.max(360, Math.floor(b.contentRect.width)),
2063
- height: Math.max(520, Math.floor(b.contentRect.height))
969
+ }, []), P(() => {
970
+ if (!s.current) return;
971
+ const c = new ResizeObserver((m) => {
972
+ const y = m[0];
973
+ y && oe({
974
+ width: Math.max(360, Math.floor(y.contentRect.width)),
975
+ height: Math.max(520, Math.floor(y.contentRect.height))
2064
976
  });
2065
977
  });
2066
- return h.observe(a.current), () => h.disconnect();
2067
- }, []), V(() => {
2068
- if (!y) {
2069
- T([]);
978
+ return c.observe(s.current), () => c.disconnect();
979
+ }, []), P(() => {
980
+ if (!v) {
981
+ V([]);
2070
982
  return;
2071
983
  }
2072
- const h = u.current[y];
2073
- if (h) {
2074
- T(h);
984
+ const c = f.current[v];
985
+ if (c) {
986
+ V(c);
2075
987
  return;
2076
988
  }
2077
989
  (async () => {
2078
- if (!f.current) {
2079
- const C = await (await fetch(Ot)).json();
2080
- f.current = C.features;
990
+ if (!h.current) {
991
+ const b = await (await fetch(bn)).json();
992
+ h.current = b.features;
2081
993
  }
2082
- const x = (f.current ?? []).filter(
2083
- (m) => (m.properties ?? {}).iso_a2 === y
2084
- ).map((m) => {
2085
- const C = m.properties ?? {}, N = String(C.name ?? "").trim();
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();
2086
998
  return {
2087
- ...m,
999
+ ...g,
2088
1000
  properties: {
2089
- ...C,
2090
- __countryCode: y,
1001
+ ...b,
1002
+ __countryCode: v,
2091
1003
  __regionName: N,
2092
1004
  name: N
2093
1005
  }
2094
1006
  };
2095
1007
  });
2096
- u.current[y] = x, T(x);
1008
+ f.current[v] = x, V(x);
2097
1009
  })();
2098
- }, [y]), V(() => {
2099
- if (S && g < 2) return void w(2);
2100
- y && g < 1 && w(1);
2101
- }, [y, S, g]), V(() => {
2102
- const h = s.current?.controls?.();
2103
- if (!h) return;
2104
- h.autoRotate = !0, h.autoRotateSpeed = 0.45, h.enablePan = !1, h.enableZoom = !0;
2105
- const d = s.current?.renderer?.();
2106
- d && d.setPixelRatio(Math.min(window.devicePixelRatio, 1.5));
2107
- }, []), V(() => {
2108
- const h = s.current?.controls?.();
2109
- h && (h.autoRotate = !y && g === 0);
2110
- }, [y, g]), V(() => {
2111
- if (e === l.current) return;
2112
- l.current = e, w(0), F(void 0), _(void 0), D(null), T([]);
2113
- const h = s.current?.controls?.();
2114
- h && (h.autoRotate = !0), s.current?.pointOfView({ lat: 20, lng: 15, altitude: 2.6 }, 650);
2115
- }, [e]);
2116
- const E = () => {
2117
- const h = s.current?.globeMaterial?.();
2118
- h && (h.map = null, h.color = new oe("#f5f5f5"), h.emissive = new oe("#ffffff"), h.emissiveIntensity = 0.35, h.specular = new oe("#d4d4d8"), h.shininess = 3, h.needsUpdate = !0);
2119
- }, I = (h, d, b) => {
2120
- s.current?.pointOfView({ lat: h, lng: d, altitude: b }, 650);
2121
- }, re = () => {
2122
- const h = s.current?.controls?.();
2123
- h && (h.autoRotate = !1);
2124
- }, X = (h) => {
2125
- if (typeof h != "object" || h === null || !("coordinates" in h))
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?.();
1018
+ 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))
2126
1038
  return [];
2127
- const d = h.coordinates, b = [], x = (m) => {
2128
- if (Array.isArray(m)) {
2129
- if (m.length >= 2 && typeof m[0] == "number" && typeof m[1] == "number") {
2130
- b.push([m[0], m[1]]);
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]]);
2131
1043
  return;
2132
1044
  }
2133
- m.forEach(x);
1045
+ g.forEach(x);
2134
1046
  }
2135
1047
  };
2136
- return x(d), b;
2137
- }, q = (h) => {
2138
- const d = X(h.geometry);
2139
- if (!d.length) return;
2140
- const b = d.reduce(
2141
- (x, [m, C]) => ({
2142
- minLat: Math.min(x.minLat, C),
2143
- maxLat: Math.max(x.maxLat, C),
2144
- minLng: Math.min(x.minLng, m),
2145
- maxLng: Math.max(x.maxLng, m)
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)
2146
1058
  }),
2147
1059
  {
2148
1060
  minLat: Number.POSITIVE_INFINITY,
@@ -2151,40 +1063,40 @@ const De = (t, e) => {
2151
1063
  maxLng: Number.NEGATIVE_INFINITY
2152
1064
  }
2153
1065
  );
2154
- if (!(!Number.isFinite(b.minLat) || !Number.isFinite(b.minLng)))
2155
- return b;
2156
- }, z = (h) => {
2157
- const d = Math.max(0.1, h.maxLat - h.minLat), b = Math.max(0.1, h.maxLng - h.minLng), m = Math.max(d, b) / 112;
2158
- return Math.min(0.9, Math.max(0.14, m));
2159
- }, R = () => {
2160
- c.current && window.clearTimeout(c.current), c.current = window.setTimeout(() => {
2161
- const h = s.current?.pointOfView?.().altitude ?? 2.4, d = Un(h);
2162
- w(d), d <= 0 && _(void 0);
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);
2163
1075
  }, 120);
2164
- }, vt = (h) => {
2165
- const d = h.properties ?? {};
2166
- if (g === 0) {
2167
- const b = r[String(d.name ?? "").toLowerCase()], x = d.__isoA2 ?? (typeof d.iso_a2 == "string" ? d.iso_a2.toUpperCase() : void 0) ?? b;
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;
2168
1080
  if (!x) return;
2169
- re(), w(1), F(x), _(void 0);
2170
- const m = q(h);
2171
- if (m) {
2172
- I(
2173
- (m.minLat + m.maxLat) / 2,
2174
- (m.minLng + m.maxLng) / 2,
2175
- z(m)
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)
2176
1088
  );
2177
1089
  return;
2178
1090
  }
2179
1091
  return;
2180
1092
  }
2181
- if (g >= 1) {
2182
- const b = d.__regionName;
2183
- if (!b) return;
2184
- re(), w(2), _(b);
2185
- const x = q(h);
1093
+ if (d >= 1) {
1094
+ const y = m.__regionName;
1095
+ if (!y) return;
1096
+ W(), w(2), E(y);
1097
+ const x = O(c);
2186
1098
  if (x) {
2187
- I(
1099
+ A(
2188
1100
  (x.minLat + x.maxLat) / 2,
2189
1101
  (x.minLng + x.maxLng) / 2,
2190
1102
  Math.max(0.2, z(x) * 0.52)
@@ -2192,76 +1104,90 @@ const De = (t, e) => {
2192
1104
  return;
2193
1105
  }
2194
1106
  }
2195
- }, Et = g === 0 ? v : M.length ? [...v, ...M] : v, Ue = (h, d) => {
2196
- if (d && h)
2197
- return t.regions[h]?.[d];
2198
- if (h) return t.countries[h];
2199
- }, Nt = (h) => {
2200
- if (!h)
2201
- return "<div>No data</div>";
2202
- const d = Object.entries(h).filter(
2203
- ([, b]) => typeof b == "number" && Number.isFinite(b)
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)
1113
+ 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)
2204
1116
  );
2205
- return d.length ? (d.sort(([b], [x]) => b === i ? -1 : x === i ? 1 : b.localeCompare(x)), d.map(
2206
- ([b, x]) => `<div>${b}: ${Vn(x)}</div>`
2207
- ).join("")) : "<div>No data</div>";
1117
+ if (!m.length)
1118
+ 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)
1124
+ );
1125
+ return `<div style="${y}"><span style="${x}">${H}</span><span style="${g}">${F}</span></div>`;
1126
+ }).join("");
2208
1127
  };
2209
- return /* @__PURE__ */ Ze(
1128
+ return /* @__PURE__ */ Fe(
2210
1129
  "div",
2211
1130
  {
2212
- ref: a,
1131
+ ref: s,
1132
+ className: "cool-globe-host",
2213
1133
  style: {
2214
1134
  position: "relative",
2215
1135
  height: "100%",
2216
1136
  overflow: "hidden",
2217
1137
  background: "white"
2218
1138
  },
2219
- children: /* @__PURE__ */ Ze(
2220
- At,
1139
+ children: /* @__PURE__ */ Fe(
1140
+ un,
2221
1141
  {
2222
- ref: s,
2223
- globeImageUrl: Pt,
1142
+ ref: o,
1143
+ globeImageUrl: yn,
2224
1144
  backgroundColor: "#ffffff",
2225
- polygonsData: Et,
1145
+ polygonsData: fn,
2226
1146
  polygonAltitude: 0.01,
2227
1147
  polygonsTransitionDuration: 180,
2228
- polygonCapColor: (h) => {
2229
- const d = h.properties ?? {}, b = !!d.__regionName;
2230
- if (g > 0 && !b)
1148
+ polygonCapColor: (c) => {
1149
+ const m = c.properties ?? {}, y = !!m.__regionName;
1150
+ if (d > 0 && !y)
2231
1151
  return "rgba(148,163,184,0.027)";
2232
- const x = g === 0 ? d.__isoA2 : d.__countryCode, m = d.__regionName, C = Ue(x, m), N = De(C, i), Ae = g === 0 ? p(N) : P(N);
2233
- return O === h ? "#60a5fa" : Ae;
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;
2234
1154
  },
2235
- polygonSideColor: (h) => {
2236
- const d = h.properties ?? {};
2237
- return g > 0 && !d.__regionName ? "rgba(148,163,184,0.027)" : d.__regionName ? "rgba(148,163,184,0.22)" : "rgba(226,232,240,0.45)";
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)";
2238
1158
  },
2239
- polygonStrokeColor: (h) => {
2240
- const d = h.properties ?? {};
2241
- return g > 0 && !d.__regionName ? "rgba(100,116,139,0.067)" : d.__regionName ? "rgba(51,65,85,0.98)" : "rgba(156,163,175,0.95)";
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)";
2242
1162
  },
2243
- polygonLabel: (h) => {
2244
- const d = h.properties ?? {}, b = g === 0 ? d.__isoA2 : d.__countryCode, x = d.__regionName, m = x ?? d.name ?? "Unknown", C = Ue(b, x), N = Nt(C);
2245
- return `<div style="padding:6px 8px; font-size:12px; background:#111827; color:#f9fafb; border-radius:6px;">
2246
- <div style="font-weight:700;">${m}</div>
2247
- ${N}
1163
+ polygonLabel: (c) => {
1164
+ const m = c.properties ?? {};
1165
+ if (d > 0 && !m.__regionName)
1166
+ 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);
1171
+ 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>
2248
1174
  </div>`;
2249
1175
  },
2250
- onPolygonHover: (h) => {
2251
- D(h ?? null);
1176
+ onPolygonHover: (c) => {
1177
+ D(c ?? null);
2252
1178
  },
2253
- onPolygonClick: (h) => vt(h),
2254
- onZoom: R,
1179
+ onPolygonClick: (c) => sn(c),
1180
+ onZoom: C,
2255
1181
  onGlobeReady: () => {
2256
- E(), I(20, 15, 2.6);
1182
+ _(), A(20, 15, 2.6);
2257
1183
  },
2258
1184
  onGlobeClick: () => {
2259
- const h = s.current?.controls?.();
2260
- h && (h.autoRotate = !1);
1185
+ const c = o.current?.controls?.();
1186
+ c && (c.autoRotate = !1);
2261
1187
  },
2262
1188
  lineHoverPrecision: 0,
2263
- width: le.width,
2264
- height: le.height,
1189
+ width: ie.width,
1190
+ height: ie.height,
2265
1191
  showAtmosphere: !1
2266
1192
  }
2267
1193
  )
@@ -2269,5 +1195,5 @@ const De = (t, e) => {
2269
1195
  );
2270
1196
  };
2271
1197
  export {
2272
- Jn as CoolGlobe
1198
+ Ft as CoolGlobe
2273
1199
  };