@navaramap/core 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -118,6 +118,10 @@ export declare class ConstructedPolygonGeometryLike {
118
118
  rtc_translation: Vec3Like | undefined;
119
119
  outline_position: Float32Array | undefined;
120
120
  outline_position_size: number | undefined;
121
+ outline_position_3d_high: Float32Array | undefined;
122
+ outline_position_3d_high_size: number | undefined;
123
+ outline_position_3d_low: Float32Array | undefined;
124
+ outline_position_3d_low_size: number | undefined;
121
125
  outline_scale_normal_and_cap: Float32Array | undefined;
122
126
  outline_scale_normal_and_cap_size: number | undefined;
123
127
  outline_skip_indices: Uint32Array | undefined;
package/dist/index.js CHANGED
@@ -60,6 +60,7 @@ var i = class {
60
60
  stacks = {
61
61
  camera_transform_updated: [],
62
62
  camera_frustum_updated: [],
63
+ camera_flight_ended: [],
63
64
  data_requested: [],
64
65
  data_requester_removed: [],
65
66
  mesh_added: [],
@@ -430,6 +431,10 @@ var p = class {
430
431
  rtc_translation;
431
432
  outline_position;
432
433
  outline_position_size;
434
+ outline_position_3d_high;
435
+ outline_position_3d_high_size;
436
+ outline_position_3d_low;
437
+ outline_position_3d_low_size;
433
438
  outline_scale_normal_and_cap;
434
439
  outline_scale_normal_and_cap_size;
435
440
  outline_skip_indices;
@@ -439,7 +444,7 @@ var p = class {
439
444
  let t = e.extent;
440
445
  this.extent = t ? new x(t) : void 0, this.position_3d_high = e.position_3d_high()?.slice(), this.position_3d_high_size = e.position_3d_high_size(), this.position_3d_low = e.position_3d_low()?.slice(), this.position_3d_low_size = e.position_3d_low_size(), this.position = e.position()?.slice(), this.position_size = e.position_size(), this.normal = e.normal()?.slice(), this.normal_size = e.normal_size(), this.scale_normal_and_cap = e.scale_normal_and_cap()?.slice(), this.scale_normal_and_cap_size = e.scale_normal_and_cap_size(), this.batch_id = e.batch_id()?.slice(), this.batch_id_size = e.batch_id_size(), this.batch_index = e.batch_index()?.slice(), this.batch_index_size = e.batch_index_size(), this.indices = e.indices().slice(), this.rtc_translation = e.rtc_translation ? new b(e.rtc_translation) : void 0;
441
446
  let n = e.outline();
442
- n && (this.outline_position = n.position()?.slice(), this.outline_position_size = n.position_size(), this.outline_scale_normal_and_cap = n.scale_normal_and_cap()?.slice(), this.outline_scale_normal_and_cap_size = n.scale_normal_and_cap_size(), this.outline_skip_indices = n.skip_indices()?.slice(), this.outline_batch_index = n.batch_index()?.slice(), this.outline_batch_index_size = n.batch_index_size(), n.free());
447
+ n && (this.outline_position = n.position()?.slice(), this.outline_position_size = n.position_size(), this.outline_position_3d_high = n.position_3d_high()?.slice(), this.outline_position_3d_high_size = n.position_3d_high_size(), this.outline_position_3d_low = n.position_3d_low()?.slice(), this.outline_position_3d_low_size = n.position_3d_low_size(), this.outline_scale_normal_and_cap = n.scale_normal_and_cap()?.slice(), this.outline_scale_normal_and_cap_size = n.scale_normal_and_cap_size(), this.outline_skip_indices = n.skip_indices()?.slice(), this.outline_batch_index = n.batch_index()?.slice(), this.outline_batch_index_size = n.batch_index_size(), n.free());
443
448
  }
444
449
  }, C = class {
445
450
  points;
@@ -540,7 +545,10 @@ var p = class {
540
545
  }
541
546
  }, se = (e, t, n) => {
542
547
  let r = t.length;
543
- for (let i = 0; i < r; i++) n[i] = e[t[i]];
548
+ for (let i = 0; i < r; i++) {
549
+ let r = e[t[i]];
550
+ n[i] = r;
551
+ }
544
552
  }, ce = class extends Error {
545
553
  constructor(e) {
546
554
  super(e ?? "Unimplemented");
@@ -679,9 +687,10 @@ function we(e, t, n) {
679
687
  let r = t < e, [i, a, o] = r ? Ce(t, e, n) : Ce(e, t, n);
680
688
  if (!(a >= i)) return [];
681
689
  let s = a - i + 1, c = Array(s);
682
- if (r) if (o < 0) for (let e = 0; e < s; ++e) c[e] = (a - e) / -o;
683
- else for (let e = 0; e < s; ++e) c[e] = (a - e) * o;
684
- else if (o < 0) for (let e = 0; e < s; ++e) c[e] = (i + e) / -o;
690
+ if (r) {
691
+ if (o < 0) for (let e = 0; e < s; ++e) c[e] = (a - e) / -o;
692
+ else for (let e = 0; e < s; ++e) c[e] = (a - e) * o;
693
+ } else if (o < 0) for (let e = 0; e < s; ++e) c[e] = (i + e) / -o;
685
694
  else for (let e = 0; e < s; ++e) c[e] = (i + e) * o;
686
695
  return c;
687
696
  }
@@ -2419,7 +2428,7 @@ function Xi(e) {
2419
2428
  //#endregion
2420
2429
  //#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js
2421
2430
  function Zi() {
2422
- for (var e = this._name, t = this._id, n = ta(), r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) if (c = o[l]) {
2431
+ for (var e = this._name, t = this._id, n = ea(), r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) if (c = o[l]) {
2423
2432
  var u = q(c, t);
2424
2433
  qr(c, e, n, l, o, {
2425
2434
  time: u.time + u.delay + u.duration,
@@ -2450,14 +2459,11 @@ var $i = 0;
2450
2459
  function J(e, t, n, r) {
2451
2460
  this._groups = e, this._parents = t, this._name = n, this._id = r;
2452
2461
  }
2453
- function ea(e) {
2454
- return D().transition(e);
2455
- }
2456
- function ta() {
2462
+ function ea() {
2457
2463
  return ++$i;
2458
2464
  }
2459
2465
  var Y = D.prototype;
2460
- J.prototype = ea.prototype = {
2466
+ J.prototype = {
2461
2467
  constructor: J,
2462
2468
  select: Mi,
2463
2469
  selectAll: Ni,
@@ -2491,32 +2497,32 @@ J.prototype = ea.prototype = {
2491
2497
  };
2492
2498
  //#endregion
2493
2499
  //#region ../../node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js
2494
- function na(e) {
2500
+ function ta(e) {
2495
2501
  return ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2;
2496
2502
  }
2497
2503
  //#endregion
2498
2504
  //#region ../../node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js
2499
- var ra = {
2505
+ var na = {
2500
2506
  time: null,
2501
2507
  delay: 0,
2502
2508
  duration: 250,
2503
- ease: na
2509
+ ease: ta
2504
2510
  };
2505
- function ia(e, t) {
2511
+ function ra(e, t) {
2506
2512
  for (var n; !(n = e.__transition) || !(n = n[t]);) if (!(e = e.parentNode)) throw Error(`transition ${t} not found`);
2507
2513
  return n;
2508
2514
  }
2509
- function aa(e) {
2515
+ function ia(e) {
2510
2516
  var t, n;
2511
- e instanceof J ? (t = e._id, e = e._name) : (t = ta(), (n = ra).time = Fr(), e = e == null ? null : e + "");
2512
- for (var r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) (c = o[l]) && qr(c, e, t, l, o, n || ia(c, t));
2517
+ e instanceof J ? (t = e._id, e = e._name) : (t = ea(), (n = na).time = Fr(), e = e == null ? null : e + "");
2518
+ for (var r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) (c = o[l]) && qr(c, e, t, l, o, n || ra(c, t));
2513
2519
  return new J(r, this._parents, e, t);
2514
2520
  }
2515
- D.prototype.interrupt = Zr, D.prototype.transition = aa;
2521
+ D.prototype.interrupt = Zr, D.prototype.transition = ia;
2516
2522
  //#endregion
2517
2523
  //#region ../../node_modules/.pnpm/d3-brush@3.0.0/node_modules/d3-brush/src/brush.js
2518
- var { abs: oa, max: sa, min: ca } = Math;
2519
- ["w", "e"].map(la), ["n", "s"].map(la), [
2524
+ var { abs: aa, max: oa, min: sa } = Math;
2525
+ ["w", "e"].map(ca), ["n", "s"].map(ca), [
2520
2526
  "n",
2521
2527
  "w",
2522
2528
  "e",
@@ -2525,16 +2531,16 @@ var { abs: oa, max: sa, min: ca } = Math;
2525
2531
  "ne",
2526
2532
  "sw",
2527
2533
  "se"
2528
- ].map(la);
2529
- function la(e) {
2534
+ ].map(ca);
2535
+ function ca(e) {
2530
2536
  return { type: e };
2531
2537
  }
2532
2538
  //#endregion
2533
2539
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatDecimal.js
2534
- function ua(e) {
2540
+ function la(e) {
2535
2541
  return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10);
2536
2542
  }
2537
- function da(e, t) {
2543
+ function ua(e, t) {
2538
2544
  if (!isFinite(e) || e === 0) return null;
2539
2545
  var n = (e = t ? e.toExponential(t - 1) : e.toExponential()).indexOf("e"), r = e.slice(0, n);
2540
2546
  return [r.length > 1 ? r[0] + r.slice(2) : r, +e.slice(n + 1)];
@@ -2542,11 +2548,11 @@ function da(e, t) {
2542
2548
  //#endregion
2543
2549
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/exponent.js
2544
2550
  function X(e) {
2545
- return e = da(Math.abs(e)), e ? e[1] : NaN;
2551
+ return e = ua(Math.abs(e)), e ? e[1] : NaN;
2546
2552
  }
2547
2553
  //#endregion
2548
2554
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatGroup.js
2549
- function fa(e, t) {
2555
+ function da(e, t) {
2550
2556
  return function(n, r) {
2551
2557
  for (var i = n.length, a = [], o = 0, s = e[0], c = 0; i > 0 && s > 0 && (c + s + 1 > r && (s = Math.max(1, r - c)), a.push(n.substring(i -= s, i + s)), !((c += s + 1) > r));) s = e[o = (o + 1) % e.length];
2552
2558
  return a.reverse().join(t);
@@ -2554,7 +2560,7 @@ function fa(e, t) {
2554
2560
  }
2555
2561
  //#endregion
2556
2562
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatNumerals.js
2557
- function pa(e) {
2563
+ function fa(e) {
2558
2564
  return function(t) {
2559
2565
  return t.replace(/[0-9]/g, function(t) {
2560
2566
  return e[+t];
@@ -2563,11 +2569,11 @@ function pa(e) {
2563
2569
  }
2564
2570
  //#endregion
2565
2571
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatSpecifier.js
2566
- var ma = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
2567
- function ha(e) {
2568
- if (!(t = ma.exec(e))) throw Error("invalid format: " + e);
2572
+ var pa = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
2573
+ function ma(e) {
2574
+ if (!(t = pa.exec(e))) throw Error("invalid format: " + e);
2569
2575
  var t;
2570
- return new ga({
2576
+ return new ha({
2571
2577
  fill: t[1],
2572
2578
  align: t[2],
2573
2579
  sign: t[3],
@@ -2580,16 +2586,16 @@ function ha(e) {
2580
2586
  type: t[10]
2581
2587
  });
2582
2588
  }
2583
- ha.prototype = ga.prototype;
2584
- function ga(e) {
2589
+ ma.prototype = ha.prototype;
2590
+ function ha(e) {
2585
2591
  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 + "";
2586
2592
  }
2587
- ga.prototype.toString = function() {
2593
+ ha.prototype.toString = function() {
2588
2594
  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;
2589
2595
  };
2590
2596
  //#endregion
2591
2597
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatTrim.js
2592
- function _a(e) {
2598
+ function ga(e) {
2593
2599
  out: for (var t = e.length, n = 1, r = -1, i; n < t; ++n) switch (e[n]) {
2594
2600
  case ".":
2595
2601
  r = i = n;
@@ -2600,52 +2606,51 @@ function _a(e) {
2600
2606
  default:
2601
2607
  if (!+e[n]) break out;
2602
2608
  r > 0 && (r = 0);
2603
- break;
2604
2609
  }
2605
2610
  return r > 0 ? e.slice(0, r) + e.slice(i + 1) : e;
2606
2611
  }
2607
2612
  //#endregion
2608
2613
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatPrefixAuto.js
2609
- var va;
2610
- function ya(e, t) {
2611
- var n = da(e, t);
2612
- if (!n) return va = void 0, e.toPrecision(t);
2613
- var r = n[0], i = n[1], a = i - (va = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, o = r.length;
2614
- return a === o ? r : a > o ? r + Array(a - o + 1).join("0") : a > 0 ? r.slice(0, a) + "." + r.slice(a) : "0." + Array(1 - a).join("0") + da(e, Math.max(0, t + a - 1))[0];
2614
+ var _a;
2615
+ function va(e, t) {
2616
+ var n = ua(e, t);
2617
+ if (!n) return _a = void 0, e.toPrecision(t);
2618
+ var r = n[0], i = n[1], a = i - (_a = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, o = r.length;
2619
+ return a === o ? r : a > o ? r + Array(a - o + 1).join("0") : a > 0 ? r.slice(0, a) + "." + r.slice(a) : "0." + Array(1 - a).join("0") + ua(e, Math.max(0, t + a - 1))[0];
2615
2620
  }
2616
2621
  //#endregion
2617
2622
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatRounded.js
2618
- function ba(e, t) {
2619
- var n = da(e, t);
2623
+ function ya(e, t) {
2624
+ var n = ua(e, t);
2620
2625
  if (!n) return e + "";
2621
2626
  var r = n[0], i = n[1];
2622
2627
  return i < 0 ? "0." + Array(-i).join("0") + r : r.length > i + 1 ? r.slice(0, i + 1) + "." + r.slice(i + 1) : r + Array(i - r.length + 2).join("0");
2623
2628
  }
2624
2629
  //#endregion
2625
2630
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/formatTypes.js
2626
- var xa = {
2631
+ var ba = {
2627
2632
  "%": (e, t) => (e * 100).toFixed(t),
2628
2633
  b: (e) => Math.round(e).toString(2),
2629
2634
  c: (e) => e + "",
2630
- d: ua,
2635
+ d: la,
2631
2636
  e: (e, t) => e.toExponential(t),
2632
2637
  f: (e, t) => e.toFixed(t),
2633
2638
  g: (e, t) => e.toPrecision(t),
2634
2639
  o: (e) => Math.round(e).toString(8),
2635
- p: (e, t) => ba(e * 100, t),
2636
- r: ba,
2637
- s: ya,
2640
+ p: (e, t) => ya(e * 100, t),
2641
+ r: ya,
2642
+ s: va,
2638
2643
  X: (e) => Math.round(e).toString(16).toUpperCase(),
2639
2644
  x: (e) => Math.round(e).toString(16)
2640
2645
  };
2641
2646
  //#endregion
2642
2647
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/identity.js
2643
- function Sa(e) {
2648
+ function xa(e) {
2644
2649
  return e;
2645
2650
  }
2646
2651
  //#endregion
2647
2652
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/locale.js
2648
- var Ca = Array.prototype.map, wa = [
2653
+ var Sa = Array.prototype.map, Ca = [
2649
2654
  "y",
2650
2655
  "z",
2651
2656
  "a",
@@ -2664,13 +2669,13 @@ var Ca = Array.prototype.map, wa = [
2664
2669
  "Z",
2665
2670
  "Y"
2666
2671
  ];
2667
- function Ta(e) {
2668
- var t = e.grouping === void 0 || e.thousands === void 0 ? Sa : fa(Ca.call(e.grouping, Number), e.thousands + ""), n = 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 ? Sa : pa(Ca.call(e.numerals, String)), o = e.percent === void 0 ? "%" : e.percent + "", s = e.minus === void 0 ? "−" : e.minus + "", c = e.nan === void 0 ? "NaN" : e.nan + "";
2672
+ function wa(e) {
2673
+ var t = e.grouping === void 0 || e.thousands === void 0 ? xa : da(Sa.call(e.grouping, Number), e.thousands + ""), n = 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 ? xa : fa(Sa.call(e.numerals, String)), o = e.percent === void 0 ? "%" : e.percent + "", s = e.minus === void 0 ? "−" : e.minus + "", c = e.nan === void 0 ? "NaN" : e.nan + "";
2669
2674
  function l(e, l) {
2670
- e = ha(e);
2675
+ e = ma(e);
2671
2676
  var u = e.fill, d = e.align, f = e.sign, p = e.symbol, m = e.zero, h = e.width, g = e.comma, _ = e.precision, v = e.trim, y = e.type;
2672
- y === "n" ? (g = !0, y = "g") : xa[y] || (_ === void 0 && (_ = 12), v = !0, y = "g"), (m || u === "0" && d === "=") && (m = !0, u = "0", d = "=");
2673
- var b = (l && l.prefix !== void 0 ? l.prefix : "") + (p === "$" ? n : p === "#" && /[boxX]/.test(y) ? "0" + y.toLowerCase() : ""), ee = (p === "$" ? r : /[%p]/.test(y) ? o : "") + (l && l.suffix !== void 0 ? l.suffix : ""), te = xa[y], ne = /[defgprs%]/.test(y);
2677
+ y === "n" ? (g = !0, y = "g") : ba[y] || (_ === void 0 && (_ = 12), v = !0, y = "g"), (m || u === "0" && d === "=") && (m = !0, u = "0", d = "=");
2678
+ var b = (l && l.prefix !== void 0 ? l.prefix : "") + (p === "$" ? n : p === "#" && /[boxX]/.test(y) ? "0" + y.toLowerCase() : ""), ee = (p === "$" ? r : /[%p]/.test(y) ? o : "") + (l && l.suffix !== void 0 ? l.suffix : ""), te = ba[y], ne = /[defgprs%]/.test(y);
2674
2679
  _ = _ === void 0 ? 6 : /[gprs]/.test(y) ? Math.max(1, Math.min(21, _)) : Math.max(0, Math.min(20, _));
2675
2680
  function x(e) {
2676
2681
  var n = b, r = ee, o, l, p;
@@ -2678,7 +2683,7 @@ function Ta(e) {
2678
2683
  else {
2679
2684
  e = +e;
2680
2685
  var x = e < 0 || 1 / e < 0;
2681
- if (e = isNaN(e) ? c : te(Math.abs(e), _), v && (e = _a(e)), x && +e == 0 && f !== "+" && (x = !1), n = (x ? f === "(" ? f : s : f === "-" || f === "(" ? "" : f) + n, r = (y === "s" && !isNaN(e) && va !== void 0 ? wa[8 + va / 3] : "") + r + (x && f === "(" ? ")" : ""), ne) {
2686
+ if (e = isNaN(e) ? c : te(Math.abs(e), _), v && (e = ga(e)), x && +e == 0 && f !== "+" && (x = !1), n = (x ? f === "(" ? f : s : f === "-" || f === "(" ? "" : f) + n, r = (y === "s" && !isNaN(e) && _a !== void 0 ? Ca[8 + _a / 3] : "") + r + (x && f === "(" ? ")" : ""), ne) {
2682
2687
  for (o = -1, l = e.length; ++o < l;) if (p = e.charCodeAt(o), 48 > p || p > 57) {
2683
2688
  r = (p === 46 ? i + e.slice(o + 1) : e.slice(o)) + r, e = e.slice(0, o);
2684
2689
  break;
@@ -2697,9 +2702,7 @@ function Ta(e) {
2697
2702
  case "^":
2698
2703
  e = C.slice(0, S = C.length >> 1) + n + e + r + C.slice(S);
2699
2704
  break;
2700
- default:
2701
- e = C + n + e + r;
2702
- break;
2705
+ default: e = C + n + e + r;
2703
2706
  }
2704
2707
  return a(e);
2705
2708
  }
@@ -2708,7 +2711,7 @@ function Ta(e) {
2708
2711
  }, x;
2709
2712
  }
2710
2713
  function u(e, t) {
2711
- var n = Math.max(-8, Math.min(8, Math.floor(X(t) / 3))) * 3, r = 10 ** -n, i = l((e = ha(e), e.type = "f", e), { suffix: wa[8 + n / 3] });
2714
+ var n = Math.max(-8, Math.min(8, Math.floor(X(t) / 3))) * 3, r = 10 ** -n, i = l((e = ma(e), e.type = "f", e), { suffix: Ca[8 + n / 3] });
2712
2715
  return function(e) {
2713
2716
  return i(r * e);
2714
2717
  };
@@ -2720,95 +2723,93 @@ function Ta(e) {
2720
2723
  }
2721
2724
  //#endregion
2722
2725
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/defaultLocale.js
2723
- var Ea, Da, Oa;
2724
- ka({
2726
+ var Ta, Ea, Da;
2727
+ Oa({
2725
2728
  thousands: ",",
2726
2729
  grouping: [3],
2727
2730
  currency: ["$", ""]
2728
2731
  });
2729
- function ka(e) {
2730
- return Ea = Ta(e), Da = Ea.format, Oa = Ea.formatPrefix, Ea;
2732
+ function Oa(e) {
2733
+ return Ta = wa(e), Ea = Ta.format, Da = Ta.formatPrefix, Ta;
2731
2734
  }
2732
2735
  //#endregion
2733
2736
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/precisionFixed.js
2734
- function Aa(e) {
2737
+ function ka(e) {
2735
2738
  return Math.max(0, -X(Math.abs(e)));
2736
2739
  }
2737
2740
  //#endregion
2738
2741
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/precisionPrefix.js
2739
- function ja(e, t) {
2742
+ function Aa(e, t) {
2740
2743
  return Math.max(0, Math.max(-8, Math.min(8, Math.floor(X(t) / 3))) * 3 - X(Math.abs(e)));
2741
2744
  }
2742
2745
  //#endregion
2743
2746
  //#region ../../node_modules/.pnpm/d3-format@3.1.2/node_modules/d3-format/src/precisionRound.js
2744
- function Ma(e, t) {
2747
+ function ja(e, t) {
2745
2748
  return e = Math.abs(e), t = Math.abs(t) - e, Math.max(0, X(t) - X(e)) + 1;
2746
2749
  }
2747
2750
  //#endregion
2748
2751
  //#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/init.js
2749
- function Na(e, t) {
2752
+ function Ma(e, t) {
2750
2753
  switch (arguments.length) {
2751
2754
  case 0: break;
2752
2755
  case 1:
2753
2756
  this.range(e);
2754
2757
  break;
2755
- default:
2756
- this.range(t).domain(e);
2757
- break;
2758
+ default: this.range(t).domain(e);
2758
2759
  }
2759
2760
  return this;
2760
2761
  }
2761
2762
  //#endregion
2762
2763
  //#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/constant.js
2763
- function Pa(e) {
2764
+ function Na(e) {
2764
2765
  return function() {
2765
2766
  return e;
2766
2767
  };
2767
2768
  }
2768
2769
  //#endregion
2769
2770
  //#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/number.js
2770
- function Fa(e) {
2771
+ function Pa(e) {
2771
2772
  return +e;
2772
2773
  }
2773
2774
  //#endregion
2774
2775
  //#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/continuous.js
2775
- var Ia = [0, 1];
2776
+ var Fa = [0, 1];
2776
2777
  function Z(e) {
2777
2778
  return e;
2778
2779
  }
2779
- function La(e, t) {
2780
+ function Ia(e, t) {
2780
2781
  return (t -= e = +e) ? function(n) {
2781
2782
  return (n - e) / t;
2782
- } : Pa(isNaN(t) ? NaN : .5);
2783
+ } : Na(isNaN(t) ? NaN : .5);
2783
2784
  }
2784
- function Ra(e, t) {
2785
+ function La(e, t) {
2785
2786
  var n;
2786
2787
  return e > t && (n = e, e = t, t = n), function(n) {
2787
2788
  return Math.max(e, Math.min(t, n));
2788
2789
  };
2789
2790
  }
2790
- function za(e, t, n) {
2791
+ function Ra(e, t, n) {
2791
2792
  var r = e[0], i = e[1], a = t[0], o = t[1];
2792
- return i < r ? (r = La(i, r), a = n(o, a)) : (r = La(r, i), a = n(a, o)), function(e) {
2793
+ return i < r ? (r = Ia(i, r), a = n(o, a)) : (r = Ia(r, i), a = n(a, o)), function(e) {
2793
2794
  return a(r(e));
2794
2795
  };
2795
2796
  }
2796
- function Ba(e, t, n) {
2797
+ function za(e, t, n) {
2797
2798
  var r = Math.min(e.length, t.length) - 1, i = Array(r), a = Array(r), o = -1;
2798
- for (e[r] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++o < r;) i[o] = La(e[o], e[o + 1]), a[o] = n(t[o], t[o + 1]);
2799
+ for (e[r] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++o < r;) i[o] = Ia(e[o], e[o + 1]), a[o] = n(t[o], t[o + 1]);
2799
2800
  return function(t) {
2800
2801
  var n = ye(e, t, 1, r) - 1;
2801
2802
  return a[n](i[n](t));
2802
2803
  };
2803
2804
  }
2804
- function Va(e, t) {
2805
+ function Ba(e, t) {
2805
2806
  return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());
2806
2807
  }
2807
- function Ha() {
2808
- var e = Ia, t = Ia, n = _r, r, i, a, o = Z, s, c, l;
2808
+ function Va() {
2809
+ var e = Fa, t = Fa, n = _r, r, i, a, o = Z, s, c, l;
2809
2810
  function u() {
2810
2811
  var n = Math.min(e.length, t.length);
2811
- return o !== Z && (o = Ra(e[0], e[n - 1])), s = n > 2 ? Ba : za, c = l = null, d;
2812
+ return o !== Z && (o = La(e[0], e[n - 1])), s = n > 2 ? za : Ra, c = l = null, d;
2812
2813
  }
2813
2814
  function d(i) {
2814
2815
  return i == null || isNaN(i = +i) ? a : (c ||= s(e.map(r), t, n))(r(o(i)));
@@ -2816,7 +2817,7 @@ function Ha() {
2816
2817
  return d.invert = function(n) {
2817
2818
  return o(i((l ||= s(t, e.map(r), B))(n)));
2818
2819
  }, d.domain = function(t) {
2819
- return arguments.length ? (e = Array.from(t, Fa), u()) : e.slice();
2820
+ return arguments.length ? (e = Array.from(t, Pa), u()) : e.slice();
2820
2821
  }, d.range = function(e) {
2821
2822
  return arguments.length ? (t = Array.from(e), u()) : t.slice();
2822
2823
  }, d.rangeRound = function(e) {
@@ -2831,41 +2832,39 @@ function Ha() {
2831
2832
  return r = e, i = t, u();
2832
2833
  };
2833
2834
  }
2834
- function Ua() {
2835
- return Ha()(Z, Z);
2835
+ function Ha() {
2836
+ return Va()(Z, Z);
2836
2837
  }
2837
2838
  //#endregion
2838
2839
  //#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/tickFormat.js
2839
- function Wa(e, t, n, r) {
2840
+ function Ua(e, t, n, r) {
2840
2841
  var i = Ee(e, t, n), a;
2841
- switch (r = ha(r ?? ",f"), r.type) {
2842
+ switch (r = ma(r ?? ",f"), r.type) {
2842
2843
  case "s":
2843
2844
  var o = Math.max(Math.abs(e), Math.abs(t));
2844
- return r.precision == null && !isNaN(a = ja(i, o)) && (r.precision = a), Oa(r, o);
2845
+ return r.precision == null && !isNaN(a = Aa(i, o)) && (r.precision = a), Da(r, o);
2845
2846
  case "":
2846
2847
  case "e":
2847
2848
  case "g":
2848
2849
  case "p":
2849
2850
  case "r":
2850
- r.precision == null && !isNaN(a = Ma(i, Math.max(Math.abs(e), Math.abs(t)))) && (r.precision = a - (r.type === "e"));
2851
+ r.precision == null && !isNaN(a = ja(i, Math.max(Math.abs(e), Math.abs(t)))) && (r.precision = a - (r.type === "e"));
2851
2852
  break;
2852
2853
  case "f":
2853
- case "%":
2854
- r.precision == null && !isNaN(a = Aa(i)) && (r.precision = a - (r.type === "%") * 2);
2855
- break;
2854
+ case "%": r.precision == null && !isNaN(a = ka(i)) && (r.precision = a - (r.type === "%") * 2);
2856
2855
  }
2857
- return Da(r);
2856
+ return Ea(r);
2858
2857
  }
2859
2858
  //#endregion
2860
2859
  //#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/linear.js
2861
- function Ga(e) {
2860
+ function Wa(e) {
2862
2861
  var t = e.domain;
2863
2862
  return e.ticks = function(e) {
2864
2863
  var n = t();
2865
2864
  return we(n[0], n[n.length - 1], e ?? 10);
2866
2865
  }, e.tickFormat = function(e, n) {
2867
2866
  var r = t();
2868
- return Wa(r[0], r[r.length - 1], e ?? 10, n);
2867
+ return Ua(r[0], r[r.length - 1], e ?? 10, n);
2869
2868
  }, e.nice = function(n) {
2870
2869
  n ??= 10;
2871
2870
  var r = t(), i = 0, a = r.length - 1, o = r[i], s = r[a], c, l, u = 10;
@@ -2879,11 +2878,11 @@ function Ga(e) {
2879
2878
  return e;
2880
2879
  }, e;
2881
2880
  }
2882
- function Ka() {
2883
- var e = Ua();
2881
+ function Ga() {
2882
+ var e = Ha();
2884
2883
  return e.copy = function() {
2885
- return Va(e, Ka());
2886
- }, Na.apply(e, arguments), Ga(e);
2884
+ return Ba(e, Ga());
2885
+ }, Ma.apply(e, arguments), Wa(e);
2887
2886
  }
2888
2887
  //#endregion
2889
2888
  //#region ../../node_modules/.pnpm/d3-zoom@3.0.0/node_modules/d3-zoom/src/transform.js
@@ -2926,21 +2925,21 @@ Q.prototype = {
2926
2925
  return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
2927
2926
  }
2928
2927
  };
2929
- var qa = new Q(1, 0, 0);
2930
- Ja.prototype = Q.prototype;
2931
- function Ja(e) {
2932
- for (; !e.__zoom;) if (!(e = e.parentNode)) return qa;
2928
+ var Ka = new Q(1, 0, 0);
2929
+ qa.prototype = Q.prototype;
2930
+ function qa(e) {
2931
+ for (; !e.__zoom;) if (!(e = e.parentNode)) return Ka;
2933
2932
  return e.__zoom;
2934
2933
  }
2935
2934
  //#endregion
2936
2935
  //#region ../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js
2937
- var Ya = "Invariant failed";
2936
+ var Ja = "Invariant failed";
2938
2937
  function $(e, t) {
2939
- if (!e) throw Error(Ya);
2938
+ if (!e) throw Error(Ja);
2940
2939
  }
2941
2940
  //#endregion
2942
2941
  //#region src/color/ColorMap.ts
2943
- var Xa = class {
2942
+ var Ya = class {
2944
2943
  type;
2945
2944
  name;
2946
2945
  lut;
@@ -2954,13 +2953,13 @@ var Xa = class {
2954
2953
  return $(t != null), t;
2955
2954
  }
2956
2955
  buildLinear() {
2957
- this.#e ??= Ka().domain(Or(_r(0, 1), this.lut.length)).range(this.lut).clamp(!0);
2956
+ this.#e ??= Ga().domain(Or(_r(0, 1), this.lut.length)).range(this.lut).clamp(!0);
2958
2957
  }
2959
2958
  get count() {
2960
2959
  return this.lut.length;
2961
2960
  }
2962
2961
  ticks(e, t) {
2963
- return Ka().domain(e).ticks(t);
2962
+ return Ga().domain(e).ticks(t);
2964
2963
  }
2965
2964
  quantize(e) {
2966
2965
  return $(e > 1), [...Array(e)].map((t, n) => this.linear(n / (e - 1)));
@@ -2978,7 +2977,7 @@ var Xa = class {
2978
2977
  for (let t = 0; t < this.lut.length; t++) e[t * 3] = this.lut[t][0], e[t * 3 + 1] = this.lut[t][1], e[t * 3 + 2] = this.lut[t][2];
2979
2978
  return e;
2980
2979
  }
2981
- }, Za = class {}, Qa = class {
2980
+ }, Xa = class {}, Za = class {
2982
2981
  handler;
2983
2982
  _elevationColormap;
2984
2983
  constructor(e, t) {
@@ -3041,6 +3040,6 @@ var Xa = class {
3041
3040
  set elevationColormap(e) {
3042
3041
  this._elevationColormap = e, this.handler.setElevationColormap(e);
3043
3042
  }
3044
- }, $a = class {};
3043
+ }, Qa = class {};
3045
3044
  //#endregion
3046
- export { fe as BaseAbstractedVec3, h as CachedMeshHandleLike, Za as Color, Xa as ColorMap, S as ConstructedPolygonGeometryLike, ie as ConstructedPolylineGeometryLike, y as ElevationDecoderLike, oe as EventHandler, c as EventManager, x as ExtentRadianF32Like, Qa as Globe, ae as IMAGE_EXTENSIONS, ue as NamedIndexMap, de as Observed, $a as Plugin, ne as PolygonMaterialLike, re as PolylineMaterialLike, ee as ReturnedConstructedTerrainMeshLike, m as TileXYZLike, a as Transaction, i as TransactionManager, g as TransferableMartiniLike, te as TransferablePolygonBatchedFeatureLike, C as TransferablePolylineBatchedFeatureLike, v as TransferableRasterDEMDataLike, p as TransferableTileLike, ce as Unimplemented, le as Unreachable, _ as UpsamplableTerrainGeometryLike, b as Vec3Like, l as assertType, t as generate_id_from_entity, n as generate_id_from_ind_gen, r as isEntityEvent, f as isNotFalse, u as isNotNullish, d as isNotUndefined, se as setBatchedValuesToBatchedAttribute };
3045
+ export { fe as BaseAbstractedVec3, h as CachedMeshHandleLike, Xa as Color, Ya as ColorMap, S as ConstructedPolygonGeometryLike, ie as ConstructedPolylineGeometryLike, y as ElevationDecoderLike, oe as EventHandler, c as EventManager, x as ExtentRadianF32Like, Za as Globe, ae as IMAGE_EXTENSIONS, ue as NamedIndexMap, de as Observed, Qa as Plugin, ne as PolygonMaterialLike, re as PolylineMaterialLike, ee as ReturnedConstructedTerrainMeshLike, m as TileXYZLike, a as Transaction, i as TransactionManager, g as TransferableMartiniLike, te as TransferablePolygonBatchedFeatureLike, C as TransferablePolylineBatchedFeatureLike, v as TransferableRasterDEMDataLike, p as TransferableTileLike, ce as Unimplemented, le as Unreachable, _ as UpsamplableTerrainGeometryLike, b as Vec3Like, l as assertType, t as generate_id_from_entity, n as generate_id_from_ind_gen, r as isEntityEvent, f as isNotFalse, u as isNotNullish, d as isNotUndefined, se as setBatchedValuesToBatchedAttribute };
@@ -1 +1 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@navaramap/engine")):typeof define==`function`&&define.amd?define([`exports`,`@navaramap/engine`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.NavaraCore={},e._navaramap_engine))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function n(e){return r(e.ind,e.gen)}function r(e,t){return`${e}_${t}`}function i(e){return!!e&&typeof e==`object`&&`ind`in e&&`gen`in e}var a=class{record={};getOrInsert(e){return this.record[e]||(this.record[e]=new o(e)),this.record[e]}},o=class e{id;continuable;currentPending;next;parent;constructor(e,t=!0){this.id=e,this.continuable=t}then(t){if(this.next||(this.next=new e(this.id,!1),this.next.parent=this),!this.currentPending&&this.continuable){this.continuable=!1,this.next.continuable=!1;let e=()=>{this.currentPending=void 0,this.next&&(this.next.continuable=!0)},n=t=>{console.error(`Transaction "${this.id}" callback failed:`,t),e()};try{this.currentPending=t().then(e,n)}catch(e){n(e)}}return this.next}end(){if(!this.continuable)return;let e=this.parent;if(!e){this.continuable=!0;return}for(this.continuable=!1;e.parent;)e=e.parent;e.continuable=!0}},s=e=>{e&&`free`in e&&e.free instanceof Function&&e.free()},c=e=>{let{event:t}=e;if(i(t))return n(t)},l=class{stacks={camera_transform_updated:[],camera_frustum_updated:[],data_requested:[],data_requester_removed:[],mesh_added:[],mesh_updated:[],mesh_removed:[],object_transform_updated:[],renderable_feature_added:[],renderable_feature_changed:[],renderable_feature_removed:[],texture_fragment_removed:[],texture_fragment_requested:[],update_sample_terrain_height:[],worker_task_delegated:[],worker_task_removed:[],hillshade_backfilled:[],hillshade_canceled:[]};addedEventIds=new Map;transactionManager=new a;needsUpdate(){return Object.values(this.stacks).some(e=>!!e.length)}pushEvents(e){if(e)for(let t of Object.keys(this.stacks)){let n=e[`take_${t}`].call(e);n&&(Array.isArray(n)?this.stacks[t].push(...n):this.stacks[t].push(n))}}forEachStack(e,t,n=100){let r=0;for(let i of this.stacks[e]){if(r===n)break;t(i),s(i),r++}this.stacks[e].splice(0,r)}async forEachStackAsync(e,t,n=100,r){let i=[],a=0,o=[];for(let s of this.stacks[e]){if(a===n)break;let e=s;if(r&&!r(e)){a++;continue}i.push(t(e)),o.push(a),a++}let c=[],l=0;for(let t of o){let n=t-l;c.push(this.stacks[e][n]),this.stacks[e].splice(n,1),l++}let u=await Promise.allSettled(i);for(let t of u)t.status===`rejected`&&console.error(`Event handler for "${e}" failed:`,t.reason);for(let e of c)s(e)}removeDuplicatedTransactionEvents(e){let t=new Map,r=e.change?new Map:null;this.stacks[e.add.key].forEach((e,r)=>{if(i(e)){let i=n(e);t.set(i,r)}}),r&&e.change&&this.stacks[e.change.key].forEach((e,t)=>{if(i(e)){let i=n(e);r.set(i,t)}});let a=new Set,o=new Set,s=new Set;this.stacks[e.remove.key].forEach((c,l)=>{if(!i(c))return;let u=n(c),d=t.get(u),f=!1;if(d!==void 0&&(a.add(d),f=!0),r&&e.change){let e=r.get(u);e!==void 0&&o.add(e)}f&&s.add(l)}),a.size>0&&this.removeStacksByIndices(e.add.key,a),o.size>0&&e.change&&this.removeStacksByIndices(e.change.key,o),s.size>0&&this.removeStacksByIndices(e.remove.key,s)}removeStacksByIndices(e,t){let n=[...t].sort((e,t)=>t-e);for(let t of n)s(this.stacks[e][t]),this.stacks[e].splice(t,1)}processTransactionEvents(e,t,n,r){let{shouldProcess:i,generateEventId:a=c,onAbort:o}=r??{};this.removeDuplicatedTransactionEvents(t);let s=this.addedEventIds.get(e)??new Set;this.addedEventIds.set(e,s);let l=this.transactionManager.getOrInsert(e).then(()=>this.forEachStackAsync(t.add.key,e=>(o&&s.add(a({type:`add`,event:e})),n({type:`add`,event:e})),t.add.max,i?e=>i({type:`add`,event:e}):void 0)).then(()=>(o&&s.clear(),this.forEachStackAsync(t.remove.key,e=>n({type:`remove`,event:e}),t.remove.max,i?e=>i({type:`remove`,event:e}):void 0)));if(o&&s.size)for(let n of this.stacks[t.remove.key]){if(!n)continue;let t=n,r=a({type:`remove`,event:t});if(r&&s.has(r)){try{Promise.resolve(o(t)).catch(t=>{console.error(`onAbort handler for "${e}" failed:`,t)})}catch(t){console.error(`onAbort handler for "${e}" failed:`,t)}s.delete(r)}}if(t.change){let e=t.change;l.then(()=>this.forEachStackAsync(e.key,e=>n({type:`change`,event:e}),e.max,i?e=>i({type:`change`,event:e}):void 0)).end()}else l.end()}};function u(e){}function d(e){return e!=null}function f(e){return e!==void 0}function p(e){return e!==!1}var m=class{cached_mesh_handle;coords;max_height;min_height;constructor(e){this.cached_mesh_handle=e.cached_mesh_handle?new g(e.cached_mesh_handle):void 0,this.coords=new h(e.coords),this.max_height=e.max_height,this.min_height=e.min_height}free(){}},h=class{x;y;z;constructor(e){this.x=e.x,this.y=e.y,this.z=e.z}},g=class{vertices;uvs;indices;heights;constructor(e){this.vertices=e.vertices,this.uvs=e.uvs,this.indices=e.indices,this.heights=e.heights}free(){}},_=class e{coords;size;constructor(e,t){this.coords=e,this.size=t}transfer_coords(){return this.coords}clone(){return new e(this.coords.slice(),this.size)}},v=class{uvs;indices;heights;normals;watermask;constructor(e,t,n,r,i){this.uvs=e,this.indices=t,this.heights=n,this.normals=r,this.watermask=i}},y=class{decoder;constructor(e){this.decoder=new b(e)}},b=class{b_scaler;boundary;epsilon;g_scaler;max_offset;min_offset;offset;r_scaler;constructor(e){this.b_scaler=e.b_scaler,this.boundary=e.boundary,this.epsilon=e.epsilon,this.g_scaler=e.g_scaler,this.max_offset=e.max_offset,this.min_offset=e.min_offset,this.offset=e.offset,this.r_scaler=e.r_scaler}},ee=class{x;y;z;constructor(e){this.x=e.x,this.y=e.y,this.z=e.z}},te=class{vertices;uvs;indices;heights;max_height;min_height;rtc_translation;normals;skirt_vertices;skirt_uvs;skirt_indices;skirt_normals;watermask;constructor(e){this.vertices=e.transferVertices(),this.uvs=e.transferUvs(),this.indices=e.transferIndices(),this.heights=e.transferHeights(),this.max_height=e.max_height,this.min_height=e.min_height,this.rtc_translation=e.rtc_translation?new ee(e.rtc_translation):void 0,e.hasNormals()&&(this.normals=e.transferNormals()),e.hasSkirt()&&(this.skirt_vertices=e.transferSkirtVertices(),this.skirt_uvs=e.transferSkirtUvs(),this.skirt_indices=e.transferSkirtIndices(),this.skirt_normals=e.transferSkirtNormals()),e.hasWatermask()&&(this.watermask=e.transferWatermask())}transferVertices(){throw Error()}transferUvs(){throw Error()}transferIndices(){throw Error()}transferHeights(){throw Error()}transferNormals(){throw Error()}transferSkirtVertices(){throw Error()}transferSkirtUvs(){throw Error()}transferSkirtIndices(){throw Error()}transferSkirtNormals(){throw Error()}transferWatermask(){throw Error()}hasSkirt(){return this.skirt_vertices!==void 0&&this.skirt_uvs!==void 0&&this.skirt_indices!==void 0}hasNormals(){return this.normals!==void 0}hasWatermask(){return this.watermask!==void 0}},ne=class{batch_ids;batch_indices;crs;expected_winding_orders;holes;holes_boundaries;holes_sizes;holes_total_sizes;length;outer_ring;outer_ring_sizes;constructor(e){this.batch_ids=e.transferBatchIds(),this.batch_indices=e.transferBatchIndices(),this.crs=e.crs(),this.expected_winding_orders=e.transferExpectedWindingOrders(),this.holes=e.transferHoles(),this.holes_boundaries=e.transferHolesBoundaries(),this.holes_sizes=e.transferHolesSizes(),this.holes_total_sizes=e.transferHolesTotalSizes(),this.length=e.length(),this.outer_ring=e.transferOuterRing(),this.outer_ring_sizes=e.transferOuterRingSizes()}setBatchIds(e,t){}setBatchIndices(e,t){}setExpectedWindingOrders(e,t){}setOuterRing(e,t){}setOuterRingSizes(e,t){}setHoles(e,t){}setHolesBoundaries(e,t){}setHolesSizes(e,t){}setHolesTotalSizes(e,t){}transferBatchIds(){throw Error()}transferBatchIndices(){throw Error()}transferExpectedWindingOrders(){throw Error()}transferOuterRing(){throw Error()}transferOuterRingSizes(){throw Error()}transferHoles(){throw Error()}transferHolesBoundaries(){throw Error()}transferHolesSizes(){throw Error()}transferHolesTotalSizes(){throw Error()}},x=class{clampToGround;tiled;castShadow;receiveShadow;color;extrudedHeight;height;show;perPositionHeight;wireframe;outline;__internal__;constructor(e){this.clampToGround=e.clampToGround,this.tiled=e.tiled,this.receiveShadow=e.receiveShadow,this.castShadow=e.castShadow,this.color=e.color,this.extrudedHeight=e.extrudedHeight,this.height=e.height,this.show=e.show,this.perPositionHeight=e.perPositionHeight,this.wireframe=e.wireframe,this.outline=e.outline}free(){}},S=class{east;north;south;west;constructor(e){this.east=e.east,this.north=e.north,this.south=e.south,this.west=e.west}},C=class{extent;position_3d_high;position_3d_high_size;position_3d_low;position_3d_low_size;position;position_size;normal;normal_size;scale_normal_and_cap;scale_normal_and_cap_size;batch_id;batch_id_size;batch_index;batch_index_size;indices;rtc_translation;outline_position;outline_position_size;outline_scale_normal_and_cap;outline_scale_normal_and_cap_size;outline_skip_indices;outline_batch_index;outline_batch_index_size;constructor(e){let t=e.extent;this.extent=t?new S(t):void 0,this.position_3d_high=e.position_3d_high()?.slice(),this.position_3d_high_size=e.position_3d_high_size(),this.position_3d_low=e.position_3d_low()?.slice(),this.position_3d_low_size=e.position_3d_low_size(),this.position=e.position()?.slice(),this.position_size=e.position_size(),this.normal=e.normal()?.slice(),this.normal_size=e.normal_size(),this.scale_normal_and_cap=e.scale_normal_and_cap()?.slice(),this.scale_normal_and_cap_size=e.scale_normal_and_cap_size(),this.batch_id=e.batch_id()?.slice(),this.batch_id_size=e.batch_id_size(),this.batch_index=e.batch_index()?.slice(),this.batch_index_size=e.batch_index_size(),this.indices=e.indices().slice(),this.rtc_translation=e.rtc_translation?new ee(e.rtc_translation):void 0;let n=e.outline();n&&(this.outline_position=n.position()?.slice(),this.outline_position_size=n.position_size(),this.outline_scale_normal_and_cap=n.scale_normal_and_cap()?.slice(),this.outline_scale_normal_and_cap_size=n.scale_normal_and_cap_size(),this.outline_skip_indices=n.skip_indices()?.slice(),this.outline_batch_index=n.batch_index()?.slice(),this.outline_batch_index_size=n.batch_index_size(),n.free())}},re=class{points;points_sizes;batch_ids;batch_indices;crs;length;constructor(e){this.points=e.transferPoints(),this.points_sizes=e.transferPointsSizes(),this.batch_ids=e.transferBatchIds(),this.batch_indices=e.transferBatchIndices(),this.crs=e.crs(),this.length=e.length()}setPoints(e,t){}setPointsSizes(e,t){}setBatchIds(e,t){}setBatchIndices(e,t){}transferPoints(){throw Error()}transferPointsSizes(){throw Error()}transferBatchIds(){throw Error()}transferBatchIndices(){throw Error()}},ie=class{clampToGround;tiled;castShadow;receiveShadow;color;height;width;maxWidth;show;__internal__;constructor(e){this.clampToGround=e.clampToGround,this.tiled=e.tiled,this.receiveShadow=e.receiveShadow,this.castShadow=e.castShadow,this.color=e.color,this.width=e.width,this.maxWidth=e.maxWidth,this.height=e.height,this.show=e.show}free(){}},ae=class{extent;position;position_size;position_high;position_high_size;position_low;position_low_size;start;start_size;start_high;start_high_size;start_low;start_low_size;forward_offset;forward_offset_size;end_high;end_high_size;end_low;end_low_size;start_normals;start_normals_size;end_normal_and_texture_coordinate_normalization_x;end_normal_and_texture_coordinate_normalization_x_size;right_normal_and_texture_coordinate_normalization_y;right_normal_and_texture_coordinate_normalization_y_size;batch_id;batch_id_size;batch_index;batch_index_size;indices;constructor(e){let t=e.extent;this.extent=t?new S(t):void 0,this.position=e.position().slice(),this.position_size=e.position_size(),this.position_high=e.position_high()?.slice(),this.position_high_size=e.position_high_size(),this.position_low=e.position_low()?.slice(),this.position_low_size=e.position_low_size(),this.start=e.start()?.slice(),this.start_size=e.start_size(),this.start_high=e.start_high()?.slice(),this.start_high_size=e.start_high_size(),this.start_low=e.start_low()?.slice(),this.start_low_size=e.start_low_size(),this.forward_offset=e.forward_offset()?.slice(),this.forward_offset_size=e.forward_offset_size(),this.end_high=e.end_high()?.slice(),this.end_high_size=e.end_high_size(),this.end_low=e.end_low()?.slice(),this.end_low_size=e.end_low_size(),this.start_normals=e.start_normals()?.slice(),this.start_normals_size=e.start_normals_size(),this.end_normal_and_texture_coordinate_normalization_x=e.end_normal_and_texture_coordinate_normalization_x()?.slice(),this.end_normal_and_texture_coordinate_normalization_x_size=e.end_normal_and_texture_coordinate_normalization_x_size(),this.right_normal_and_texture_coordinate_normalization_y=e.right_normal_and_texture_coordinate_normalization_y().slice(),this.right_normal_and_texture_coordinate_normalization_y_size=e.right_normal_and_texture_coordinate_normalization_y_size(),this.batch_id=e.batch_id()?.slice(),this.batch_id_size=e.batch_id_size(),this.batch_index=e.batch_index()?.slice(),this.batch_index_size=e.batch_index_size(),this.indices=e.indices().slice()}},oe=[`png`,`webp`],se=class{events={};onceEvents={};on(e,t){this.events[e]||(this.events[e]=new Set),this.events[e].add(t)}off(e,t){this.events[e]?.delete(t),this.onceEvents[e]?.delete(t)}clear(e){this.events[e]?.clear(),this.onceEvents[e]?.clear()}size(e){return this.events[e]?.size||this.onceEvents[e]?.size}once(e,t){this.onceEvents[e]||(this.onceEvents[e]=new Set),this.onceEvents[e].add(t)}emit(e,...t){this.events[e]?.forEach(e=>e(...t)),this.onceEvents[e]?.size&&(this.onceEvents[e]?.forEach(e=>e(...t)),this.onceEvents[e]?.clear())}},ce=(e,t,n)=>{let r=t.length;for(let i=0;i<r;i++)n[i]=e[t[i]]},le=class extends Error{constructor(e){super(e??`Unimplemented`)}},ue=class extends Error{constructor(e){super(e??`Unreachable`)}},de=class{list=[];indexMap={};add(e){this.assertUnique(e.name);let t=this.list.length;this.list.push(e),this.indexMap[e.name]=t}insertBefore(e,t){let n=this.findIndex(e);return this.insertAt(n,t)}insertAfter(e,t){let n=this.findIndex(e);return this.insertAt(n+1,t)}insertAt(e,t){if(this.assertUnique(t.name),e<0||e>this.list.length)throw RangeError(`index out of range: ${e}`);this.list.splice(e,0,t);for(let t=e;t<this.list.length;t++)this.indexMap[this.list[t].name]=t;return e}findIndex(e){let t=this.indexMap[e];if(t===void 0)throw Error(`target not found: ${e}`);return t}assertUnique(e){if(this.indexMap[e]!==void 0)throw Error(`duplicate name: ${e}`)}},fe=class extends se{_value;constructor(e){super(),this._value=e}get value(){return this._value}set value(e){this._value=e,this.emit(`changed`,e)}changed(e){let t=n=>{e(n),this.off(`changed`,t)};this.on(`changed`,t)}},pe=class{value;constructor(e,n,r){this.value=new t.Vec3(e,n,r)}copy(e,t,n){this.value.x=e,this.value.y=t,this.value.z=n}};function me(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function he(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ge(e){let t,n,r;e.length===2?(t=e===me||e===he?e:_e,n=e,r=e):(t=me,n=(t,n)=>me(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function _e(){return 0}function ve(e){return e===null?NaN:+e}var ye=ge(me),be=ye.right;ye.left,ge(ve).center;var xe=Math.sqrt(50),Se=Math.sqrt(10),Ce=Math.sqrt(2);function w(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=xe?10:a>=Se?5:a>=Ce?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?w(e,t,n*2):[s,c,l]}function we(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?w(t,e,n):w(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function Te(e,t,n){return t=+t,e=+e,n=+n,w(e,t,n)[2]}function Ee(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?Te(t,e,n):Te(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}var De={value:()=>{}};function Oe(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new T(n)}function T(e){this._=e}function ke(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}T.prototype=Oe.prototype={constructor:T,on:function(e,t){var n=this._,r=ke(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Ae(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=je(n[i],e.name,t);else if(t==null)for(i in n)n[i]=je(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new T(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Ae(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function je(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=De,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Me={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function E(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Me.hasOwnProperty(t)?{space:Me[t],local:e}:e}function Ne(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Pe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Fe(e){var t=E(e);return(t.local?Pe:Ne)(t)}function Ie(){}function Le(e){return e==null?Ie:function(){return this.querySelector(e)}}function Re(e){typeof e!=`function`&&(e=Le(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new O(r,this._parents)}function ze(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Be(){return[]}function Ve(e){return e==null?Be:function(){return this.querySelectorAll(e)}}function He(e){return function(){return ze(e.apply(this,arguments))}}function Ue(e){e=typeof e==`function`?He(e):Ve(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new O(r,i)}function We(e){return function(){return this.matches(e)}}function Ge(e){return function(t){return t.matches(e)}}var Ke=Array.prototype.find;function qe(e){return function(){return Ke.call(this.children,e)}}function Je(){return this.firstElementChild}function Ye(e){return this.select(e==null?Je:qe(typeof e==`function`?e:Ge(e)))}var Xe=Array.prototype.filter;function Ze(){return Array.from(this.children)}function Qe(e){return function(){return Xe.call(this.children,e)}}function $e(e){return this.selectAll(e==null?Ze:Qe(typeof e==`function`?e:Ge(e)))}function et(e){typeof e!=`function`&&(e=We(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new O(r,this._parents)}function tt(e){return Array(e.length)}function nt(){return new O(this._enter||this._groups.map(tt),this._parents)}function rt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}rt.prototype={constructor:rt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function it(e){return function(){return e}}function at(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new rt(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function ot(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new rt(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function st(e){return e.__data__}function ct(e,t){if(!arguments.length)return Array.from(this,st);var n=t?ot:at,r=this._parents,i=this._groups;typeof e!=`function`&&(e=it(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=lt(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new O(o,r),o._enter=s,o._exit=c,o}function lt(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function ut(){return new O(this._exit||this._groups.map(tt),this._parents)}function dt(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function ft(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new O(s,this._parents)}function pt(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function mt(e){e||=ht;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new O(i,this._parents).order()}function ht(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function gt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function _t(){return Array.from(this)}function vt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function yt(){let e=0;for(let t of this)++e;return e}function bt(){return!this.node()}function xt(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function St(e){return function(){this.removeAttribute(e)}}function Ct(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wt(e,t){return function(){this.setAttribute(e,t)}}function Tt(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Et(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Dt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ot(e,t){var n=E(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Ct:St:typeof t==`function`?n.local?Dt:Et:n.local?Tt:wt)(n,t))}function kt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function At(e){return function(){this.style.removeProperty(e)}}function jt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Mt(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Nt(e,t,n){return arguments.length>1?this.each((t==null?At:typeof t==`function`?Mt:jt)(e,t,n??``)):D(this.node(),e)}function D(e,t){return e.style.getPropertyValue(t)||kt(e).getComputedStyle(e,null).getPropertyValue(t)}function Pt(e){return function(){delete this[e]}}function Ft(e,t){return function(){this[e]=t}}function It(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Lt(e,t){return arguments.length>1?this.each((t==null?Pt:typeof t==`function`?It:Ft)(e,t)):this.node()[e]}function Rt(e){return e.trim().split(/^|\s+/)}function zt(e){return e.classList||new Bt(e)}function Bt(e){this._node=e,this._names=Rt(e.getAttribute(`class`)||``)}Bt.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Vt(e,t){for(var n=zt(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Ht(e,t){for(var n=zt(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Ut(e){return function(){Vt(this,e)}}function Wt(e){return function(){Ht(this,e)}}function Gt(e,t){return function(){(t.apply(this,arguments)?Vt:Ht)(this,e)}}function Kt(e,t){var n=Rt(e+``);if(arguments.length<2){for(var r=zt(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Gt:t?Ut:Wt)(n,t))}function qt(){this.textContent=``}function Jt(e){return function(){this.textContent=e}}function Yt(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Xt(e){return arguments.length?this.each(e==null?qt:(typeof e==`function`?Yt:Jt)(e)):this.node().textContent}function Zt(){this.innerHTML=``}function Qt(e){return function(){this.innerHTML=e}}function $t(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function en(e){return arguments.length?this.each(e==null?Zt:(typeof e==`function`?$t:Qt)(e)):this.node().innerHTML}function tn(){this.nextSibling&&this.parentNode.appendChild(this)}function nn(){return this.each(tn)}function rn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function an(){return this.each(rn)}function on(e){var t=typeof e==`function`?e:Fe(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function sn(){return null}function cn(e,t){var n=typeof e==`function`?e:Fe(e),r=t==null?sn:typeof t==`function`?t:Le(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ln(){var e=this.parentNode;e&&e.removeChild(this)}function un(){return this.each(ln)}function dn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pn(e){return this.select(e?fn:dn)}function mn(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function hn(e){return function(t){e.call(this,t,this.__data__)}}function gn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function _n(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function vn(e,t,n){return function(){var r=this.__on,i,a=hn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function yn(e,t,n){var r=gn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?vn:_n,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function bn(e,t,n){var r=kt(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function xn(e,t){return function(){return bn(this,e,t)}}function Sn(e,t){return function(){return bn(this,e,t.apply(this,arguments))}}function Cn(e,t){return this.each((typeof t==`function`?Sn:xn)(e,t))}function*wn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Tn=[null];function O(e,t){this._groups=e,this._parents=t}function k(){return new O([[document.documentElement]],Tn)}function En(){return this}O.prototype=k.prototype={constructor:O,select:Re,selectAll:Ue,selectChild:Ye,selectChildren:$e,filter:et,data:ct,enter:nt,exit:ut,join:dt,merge:ft,selection:En,order:pt,sort:mt,call:gt,nodes:_t,node:vt,size:yt,empty:bt,each:xt,attr:Ot,style:Nt,property:Lt,classed:Kt,text:Xt,html:en,raise:nn,lower:an,append:on,insert:cn,remove:un,clone:pn,datum:mn,on:yn,dispatch:Cn,[Symbol.iterator]:wn};function Dn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function On(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function A(){}var j=.7,kn=1/j,M=`\\s*([+-]?\\d+)\\s*`,N=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,P=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,An=/^#([0-9a-f]{3,8})$/,jn=RegExp(`^rgb\\(${M},${M},${M}\\)$`),Mn=RegExp(`^rgb\\(${P},${P},${P}\\)$`),Nn=RegExp(`^rgba\\(${M},${M},${M},${N}\\)$`),Pn=RegExp(`^rgba\\(${P},${P},${P},${N}\\)$`),Fn=RegExp(`^hsl\\(${N},${P},${P}\\)$`),In=RegExp(`^hsla\\(${N},${P},${P},${N}\\)$`),Ln={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Dn(A,F,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Rn,formatHex:Rn,formatHex8:zn,formatHsl:Bn,formatRgb:Vn,toString:Vn});function Rn(){return this.rgb().formatHex()}function zn(){return this.rgb().formatHex8()}function Bn(){return Xn(this).formatHsl()}function Vn(){return this.rgb().formatRgb()}function F(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=An.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Hn(t):n===3?new L(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Un(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Un(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=jn.exec(e))?new L(t[1],t[2],t[3],1):(t=Mn.exec(e))?new L(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Nn.exec(e))?Un(t[1],t[2],t[3],t[4]):(t=Pn.exec(e))?Un(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Fn.exec(e))?Yn(t[1],t[2]/100,t[3]/100,1):(t=In.exec(e))?Yn(t[1],t[2]/100,t[3]/100,t[4]):Ln.hasOwnProperty(e)?Hn(Ln[e]):e===`transparent`?new L(NaN,NaN,NaN,0):null}function Hn(e){return new L(e>>16&255,e>>8&255,e&255,1)}function Un(e,t,n,r){return r<=0&&(e=t=n=NaN),new L(e,t,n,r)}function Wn(e){return e instanceof A||(e=F(e)),e?(e=e.rgb(),new L(e.r,e.g,e.b,e.opacity)):new L}function I(e,t,n,r){return arguments.length===1?Wn(e):new L(e,t,n,r??1)}function L(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Dn(L,I,On(A,{brighter(e){return e=e==null?kn:kn**+e,new L(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?j:j**+e,new L(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new L(R(this.r),R(this.g),R(this.b),Jn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Gn,formatHex:Gn,formatHex8:Kn,formatRgb:qn,toString:qn}));function Gn(){return`#${z(this.r)}${z(this.g)}${z(this.b)}`}function Kn(){return`#${z(this.r)}${z(this.g)}${z(this.b)}${z((isNaN(this.opacity)?1:this.opacity)*255)}`}function qn(){let e=Jn(this.opacity);return`${e===1?`rgb(`:`rgba(`}${R(this.r)}, ${R(this.g)}, ${R(this.b)}${e===1?`)`:`, ${e})`}`}function Jn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function R(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function z(e){return e=R(e),(e<16?`0`:``)+e.toString(16)}function Yn(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new B(e,t,n,r)}function Xn(e){if(e instanceof B)return new B(e.h,e.s,e.l,e.opacity);if(e instanceof A||(e=F(e)),!e)return new B;if(e instanceof B)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new B(o,s,c,e.opacity)}function Zn(e,t,n,r){return arguments.length===1?Xn(e):new B(e,t,n,r??1)}function B(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Dn(B,Zn,On(A,{brighter(e){return e=e==null?kn:kn**+e,new B(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?j:j**+e,new B(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new L(er(e>=240?e-240:e+120,i,r),er(e,i,r),er(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new B(Qn(this.h),$n(this.s),$n(this.l),Jn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Jn(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Qn(this.h)}, ${$n(this.s)*100}%, ${$n(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Qn(e){return e=(e||0)%360,e<0?e+360:e}function $n(e){return Math.max(0,Math.min(1,e||0))}function er(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var tr=e=>()=>e;function nr(e,t){return function(n){return e+n*t}}function rr(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function ir(e){return(e=+e)==1?ar:function(t,n){return n-t?rr(t,n,e):tr(isNaN(t)?n:t)}}function ar(e,t){var n=t-e;return n?nr(e,n):tr(isNaN(e)?t:e)}var or=(function e(t){var n=ir(t);function r(e,t){var r=n((e=I(e)).r,(t=I(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=ar(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function sr(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function cr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lr(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=_r(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function ur(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function V(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function dr(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=_r(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var fr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pr=new RegExp(fr.source,`g`);function mr(e){return function(){return e}}function hr(e){return function(t){return e(t)+``}}function gr(e,t){var n=fr.lastIndex=pr.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=fr.exec(e))&&(i=pr.exec(t));)(a=i.index)>n&&(a=t.slice(n,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,c.push({i:o,x:V(r,i)})),n=pr.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?hr(c[0].x):mr(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function _r(e,t){var n=typeof t,r;return t==null||n===`boolean`?tr(t):(n===`number`?V:n===`string`?(r=F(t))?(t=r,or):gr:t instanceof F?or:t instanceof Date?ur:cr(t)?sr:Array.isArray(t)?lr:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?dr:V)(e,t)}function vr(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var yr=180/Math.PI,br={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xr(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*yr,skewX:Math.atan(c)*yr,scaleX:o,scaleY:s}}var Sr;function Cr(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?br:xr(t.a,t.b,t.c,t.d,t.e,t.f)}function wr(e){return e==null||(Sr||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Sr.setAttribute(`transform`,e),!(e=Sr.transform.baseVal.consolidate()))?br:(e=e.matrix,xr(e.a,e.b,e.c,e.d,e.e,e.f))}function Tr(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:V(e,i)},{i:c-2,x:V(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:V(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:V(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:V(e,n)},{i:s-2,x:V(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Er=Tr(Cr,`px, `,`px)`,`deg)`),Dr=Tr(wr,`, `,`)`,`)`);function Or(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var H=0,kr=0,Ar=0,jr=1e3,Mr,U,Nr=0,W=0,Pr=0,G=typeof performance==`object`&&performance.now?performance:Date,Fr=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ir(){return W||=(Fr(Lr),G.now()+Pr)}function Lr(){W=0}function Rr(){this._call=this._time=this._next=null}Rr.prototype=zr.prototype={constructor:Rr,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Ir():+n)+(t==null?0:+t),!this._next&&U!==this&&(U?U._next=this:Mr=this,U=this),this._call=e,this._time=n,Wr()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wr())}};function zr(e,t,n){var r=new Rr;return r.restart(e,t,n),r}function Br(){Ir(),++H;for(var e=Mr,t;e;)(t=W-e._time)>=0&&e._call.call(void 0,t),e=e._next;--H}function Vr(){W=(Nr=G.now())+Pr,H=kr=0;try{Br()}finally{H=0,Ur(),W=0}}function Hr(){var e=G.now(),t=e-Nr;t>jr&&(Pr-=t,Nr=e)}function Ur(){for(var e,t=Mr,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Mr=n);U=e,Wr(r)}function Wr(e){H||(kr&&=clearTimeout(kr),e-W>24?(e<1/0&&(kr=setTimeout(Vr,e-G.now()-Pr)),Ar&&=clearInterval(Ar)):(Ar||=(Nr=G.now(),setInterval(Hr,jr)),H=1,Fr(Vr)))}function Gr(e,t,n){var r=new Rr;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Kr=Oe(`start`,`end`,`cancel`,`interrupt`),qr=[];function Jr(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Xr(e,n,{name:t,index:r,group:i,on:Kr,tween:qr,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Yr(e,t){var n=q(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function K(e,t){var n=q(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function q(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Xr(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zr(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return Gr(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Gr(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Zr(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Qr(e){return this.each(function(){Zr(this,e)})}function $r(e,t){var n,r;return function(){var i=K(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function ei(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=K(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function ti(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=q(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?$r:ei)(n,e,t))}function ni(e,t,n){var r=e._id;return e.each(function(){var e=K(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return q(e,r).value[t]}}function ri(e,t){var n;return(typeof t==`number`?V:t instanceof F?or:(n=F(t))?(t=n,or):gr)(e,t)}function ii(e){return function(){this.removeAttribute(e)}}function ai(e){return function(){this.removeAttributeNS(e.space,e.local)}}function oi(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function si(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ci(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function li(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ui(e,t){var n=E(e),r=n===`transform`?Dr:ri;return this.attrTween(e,typeof t==`function`?(n.local?li:ci)(n,r,ni(this,`attr.`+e,t)):t==null?(n.local?ai:ii)(n):(n.local?si:oi)(n,r,t))}function di(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function fi(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function pi(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&fi(e,i)),n}return i._value=t,i}function mi(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&di(e,i)),n}return i._value=t,i}function hi(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=E(e);return this.tween(n,(r.local?pi:mi)(r,t))}function gi(e,t){return function(){Yr(this,e).delay=+t.apply(this,arguments)}}function _i(e,t){return t=+t,function(){Yr(this,e).delay=t}}function vi(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?gi:_i)(t,e)):q(this.node(),t).delay}function yi(e,t){return function(){K(this,e).duration=+t.apply(this,arguments)}}function bi(e,t){return t=+t,function(){K(this,e).duration=t}}function xi(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?yi:bi)(t,e)):q(this.node(),t).duration}function Si(e,t){if(typeof t!=`function`)throw Error();return function(){K(this,e).ease=t}}function Ci(e){var t=this._id;return arguments.length?this.each(Si(t,e)):q(this.node(),t).ease}function wi(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();K(this,e).ease=n}}function Ti(e){if(typeof e!=`function`)throw Error();return this.each(wi(this._id,e))}function Ei(e){typeof e!=`function`&&(e=We(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new J(r,this._parents,this._name,this._id)}function Di(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new J(o,this._parents,this._name,this._id)}function Oi(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function ki(e,t,n){var r,i,a=Oi(t)?Yr:K;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ai(e,t){var n=this._id;return arguments.length<2?q(this.node(),n).on.on(e):this.each(ki(n,e,t))}function ji(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Mi(){return this.on(`end.remove`,ji(this._id))}function Ni(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Le(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Jr(l[f],t,n,f,l,q(u,n)));return new J(a,this._parents,t,n)}function Pi(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Ve(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=q(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Jr(p,t,n,h,f,m);a.push(f),o.push(u)}return new J(a,o,t,n)}var Fi=k.prototype.constructor;function Ii(){return new Fi(this._groups,this._parents)}function Li(e,t){var n,r,i;return function(){var a=D(this,e),o=(this.style.removeProperty(e),D(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Ri(e){return function(){this.style.removeProperty(e)}}function zi(e,t,n){var r,i=n+``,a;return function(){var o=D(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Bi(e,t,n){var r,i,a;return function(){var o=D(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),D(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Vi(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=K(this,e),l=c.on,u=c.value[a]==null?s||=Ri(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Hi(e,t,n){var r=(e+=``)==`transform`?Er:ri;return t==null?this.styleTween(e,Li(e,r)).on(`end.style.`+e,Ri(e)):typeof t==`function`?this.styleTween(e,Bi(e,r,ni(this,`style.`+e,t))).each(Vi(this._id,e)):this.styleTween(e,zi(e,r,t),n).on(`end.style.`+e,null)}function Ui(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Wi(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Ui(e,a,n)),r}return a._value=t,a}function Gi(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Wi(e,t,n??``))}function Ki(e){return function(){this.textContent=e}}function qi(e){return function(){var t=e(this);this.textContent=t??``}}function Ji(e){return this.tween(`text`,typeof e==`function`?qi(ni(this,`text`,e)):Ki(e==null?``:e+``))}function Yi(e){return function(t){this.textContent=e.call(this,t)}}function Xi(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Yi(r)),t}return r._value=e,r}function Zi(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Xi(e))}function Qi(){for(var e=this._name,t=this._id,n=na(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=q(c,t);Jr(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new J(r,this._parents,e,n)}function $i(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=K(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var ea=0;function J(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ta(e){return k().transition(e)}function na(){return++ea}var Y=k.prototype;J.prototype=ta.prototype={constructor:J,select:Ni,selectAll:Pi,selectChild:Y.selectChild,selectChildren:Y.selectChildren,filter:Ei,merge:Di,selection:Ii,transition:Qi,call:Y.call,nodes:Y.nodes,node:Y.node,size:Y.size,empty:Y.empty,each:Y.each,on:Ai,attr:ui,attrTween:hi,style:Hi,styleTween:Gi,text:Ji,textTween:Zi,remove:Mi,tween:ti,delay:vi,duration:xi,ease:Ci,easeVarying:Ti,end:$i,[Symbol.iterator]:Y[Symbol.iterator]};function ra(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ia={time:null,delay:0,duration:250,ease:ra};function aa(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function oa(e){var t,n;e instanceof J?(t=e._id,e=e._name):(t=na(),(n=ia).time=Ir(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Jr(c,e,t,l,o,n||aa(c,t));return new J(r,this._parents,e,t)}k.prototype.interrupt=Qr,k.prototype.transition=oa;var{abs:sa,max:ca,min:la}=Math;[`w`,`e`].map(ua),[`n`,`s`].map(ua),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(ua);function ua(e){return{type:e}}function da(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function fa(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function X(e){return e=fa(Math.abs(e)),e?e[1]:NaN}function pa(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function ma(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var ha=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ga(e){if(!(t=ha.exec(e)))throw Error(`invalid format: `+e);var t;return new _a({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ga.prototype=_a.prototype;function _a(e){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+``}_a.prototype.toString=function(){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};function va(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var ya;function ba(e,t){var n=fa(e,t);if(!n)return ya=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(ya=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+fa(e,Math.max(0,t+a-1))[0]}function xa(e,t){var n=fa(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Sa={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:da,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>xa(e*100,t),r:xa,s:ba,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ca(e){return e}var wa=Array.prototype.map,Ta=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function Ea(e){var t=e.grouping===void 0||e.thousands===void 0?Ca:pa(wa.call(e.grouping,Number),e.thousands+``),n=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?Ca:ma(wa.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=ga(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):Sa[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),ee=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),te=Sa[y],ne=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function x(e){var n=b,r=ee,o,l,p;if(y===`c`)r=te(e)+r,e=``;else{e=+e;var x=e<0||1/e<0;if(e=isNaN(e)?c:te(Math.abs(e),_),v&&(e=va(e)),x&&+e==0&&f!==`+`&&(x=!1),n=(x?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&ya!==void 0?Ta[8+ya/3]:``)+r+(x&&f===`(`?`)`:``),ne){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var S=n.length+e.length+r.length,C=S<h?Array(h-S+1).join(u):``;switch(g&&m&&(e=t(C+e,C.length?h-r.length:1/0),C=``),d){case`<`:e=n+e+r+C;break;case`=`:e=n+C+e+r;break;case`^`:e=C.slice(0,S=C.length>>1)+n+e+r+C.slice(S);break;default:e=C+n+e+r;break}return a(e)}return x.toString=function(){return e+``},x}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(X(t)/3)))*3,r=10**-n,i=l((e=ga(e),e.type=`f`,e),{suffix:Ta[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var Da,Oa,ka;Aa({thousands:`,`,grouping:[3],currency:[`$`,``]});function Aa(e){return Da=Ea(e),Oa=Da.format,ka=Da.formatPrefix,Da}function ja(e){return Math.max(0,-X(Math.abs(e)))}function Ma(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(X(t)/3)))*3-X(Math.abs(e)))}function Na(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,X(t)-X(e))+1}function Pa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Fa(e){return function(){return e}}function Ia(e){return+e}var La=[0,1];function Z(e){return e}function Ra(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Fa(isNaN(t)?NaN:.5)}function za(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Ba(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Ra(i,r),a=n(o,a)):(r=Ra(r,i),a=n(a,o)),function(e){return a(r(e))}}function Va(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Ra(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=be(e,t,1,r)-1;return a[n](i[n](t))}}function Ha(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ua(){var e=La,t=La,n=_r,r,i,a,o=Z,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==Z&&(o=za(e[0],e[n-1])),s=n>2?Va:Ba,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),V))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,Ia),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=vr,u()},d.clamp=function(e){return arguments.length?(o=e?!0:Z,u()):o!==Z},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function Wa(){return Ua()(Z,Z)}function Ga(e,t,n,r){var i=Ee(e,t,n),a;switch(r=ga(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Ma(i,o))&&(r.precision=a),ka(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Na(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=ja(i))&&(r.precision=a-(r.type===`%`)*2);break}return Oa(r)}function Ka(e){var t=e.domain;return e.ticks=function(e){var n=t();return we(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return Ga(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=Te(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function qa(){var e=Wa();return e.copy=function(){return Ha(e,qa())},Pa.apply(e,arguments),Ka(e)}function Q(e,t,n){this.k=e,this.x=t,this.y=n}Q.prototype={constructor:Q,scale:function(e){return e===1?this:new Q(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Q(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var Ja=new Q(1,0,0);Ya.prototype=Q.prototype;function Ya(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ja;return e.__zoom}var Xa=`Invariant failed`;function $(e,t){if(!e)throw Error(Xa)}var Za=class{type;name;lut;constructor(e,t,n){this.type=e,this.name=t,$(n.length>1),this.lut=n.map(e=>Array.isArray(e)?e:e.srgb().toArray())}#e;linear(e){this.buildLinear(),$(this.#e);let t=this.#e(e);return $(t!=null),t}buildLinear(){this.#e??=qa().domain(Or(_r(0,1),this.lut.length)).range(this.lut).clamp(!0)}get count(){return this.lut.length}ticks(e,t){return qa().domain(e).ticks(t)}quantize(e){return $(e>1),[...Array(e)].map((t,n)=>this.linear(n/(e-1)))}createImage(){let e=document.createElement(`canvas`);e.width=this.lut.length,e.height=1;let t=e.getContext(`2d`);return $(t!=null),this.lut.forEach(([e,n,r],i)=>{t.fillStyle=I(e*255,n*255,r*255).toString(),t.fillRect(i,0,1,1)}),e}flatten(){let e=new Float32Array(this.lut.length*3);for(let t=0;t<this.lut.length;t++)e[t*3]=this.lut[t][0],e[t*3+1]=this.lut[t][1],e[t*3+2]=this.lut[t][2];return e}},Qa=class{},$a=class{handler;_elevationColormap;constructor(e,t){this.handler=e,this.setOptions(t)}setOptions(e){e?.maxSse!=null&&(this.maxSse=e.maxSse),e?.segments!=null&&(this.segments=e.segments),e?.color!=null&&(this.color=e.color),e?.hideUnderground!=null&&(this.hideUnderground=e.hideUnderground),e?.useNormal!=null&&(this.useNormal=e.useNormal),e?.transparent!=null&&(this.transparent=e.transparent),e?.opacity!=null&&(this.opacity=e.opacity),e?.wireframe!=null&&(this.wireframe=e.wireframe),e?.elevationColormap!=null&&(this.elevationColormap=e.elevationColormap)}get maxSse(){return this.handler.getMaxSse()??2}set maxSse(e){this.handler.setMaxSse(e)}get segments(){return this.handler.getSegments()??64}set segments(e){this.handler.setSegments(e)}get color(){return this.handler.getColor()}set color(e){this.handler.setColor(e)}get hideUnderground(){return this.handler.getHideUnderground()??!0}set hideUnderground(e){this.handler.setHideUnderground(e)}get useNormal(){return this.handler.getUseNormal()??!1}set useNormal(e){this.handler.setUseNormal(e)}get transparent(){return this.handler.getTransparent()??!1}set transparent(e){this.handler.setTransparent(e)}get opacity(){return this.handler.getOpacity()??1}set opacity(e){this.handler.setOpacity(e)}get wireframe(){return this.handler.getWireframe()??!1}set wireframe(e){this.handler.setWireframe(e)}get elevationColormap(){return this._elevationColormap}set elevationColormap(e){this._elevationColormap=e,this.handler.setElevationColormap(e)}},eo=class{};e.BaseAbstractedVec3=pe,e.CachedMeshHandleLike=g,e.Color=Qa,e.ColorMap=Za,e.ConstructedPolygonGeometryLike=C,e.ConstructedPolylineGeometryLike=ae,e.ElevationDecoderLike=b,e.EventHandler=se,e.EventManager=l,e.ExtentRadianF32Like=S,e.Globe=$a,e.IMAGE_EXTENSIONS=oe,e.NamedIndexMap=de,e.Observed=fe,e.Plugin=eo,e.PolygonMaterialLike=x,e.PolylineMaterialLike=ie,e.ReturnedConstructedTerrainMeshLike=te,e.TileXYZLike=h,e.Transaction=o,e.TransactionManager=a,e.TransferableMartiniLike=_,e.TransferablePolygonBatchedFeatureLike=ne,e.TransferablePolylineBatchedFeatureLike=re,e.TransferableRasterDEMDataLike=y,e.TransferableTileLike=m,e.Unimplemented=le,e.Unreachable=ue,e.UpsamplableTerrainGeometryLike=v,e.Vec3Like=ee,e.assertType=u,e.generate_id_from_entity=n,e.generate_id_from_ind_gen=r,e.isEntityEvent=i,e.isNotFalse=p,e.isNotNullish=d,e.isNotUndefined=f,e.setBatchedValuesToBatchedAttribute=ce});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@navaramap/engine")):typeof define==`function`&&define.amd?define([`exports`,`@navaramap/engine`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.NavaraCore={},e._navaramap_engine))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function n(e){return r(e.ind,e.gen)}function r(e,t){return`${e}_${t}`}function i(e){return!!e&&typeof e==`object`&&`ind`in e&&`gen`in e}var a=class{record={};getOrInsert(e){return this.record[e]||(this.record[e]=new o(e)),this.record[e]}},o=class e{id;continuable;currentPending;next;parent;constructor(e,t=!0){this.id=e,this.continuable=t}then(t){if(this.next||(this.next=new e(this.id,!1),this.next.parent=this),!this.currentPending&&this.continuable){this.continuable=!1,this.next.continuable=!1;let e=()=>{this.currentPending=void 0,this.next&&(this.next.continuable=!0)},n=t=>{console.error(`Transaction "${this.id}" callback failed:`,t),e()};try{this.currentPending=t().then(e,n)}catch(e){n(e)}}return this.next}end(){if(!this.continuable)return;let e=this.parent;if(!e){this.continuable=!0;return}for(this.continuable=!1;e.parent;)e=e.parent;e.continuable=!0}},s=e=>{e&&`free`in e&&e.free instanceof Function&&e.free()},c=e=>{let{event:t}=e;if(i(t))return n(t)},l=class{stacks={camera_transform_updated:[],camera_frustum_updated:[],camera_flight_ended:[],data_requested:[],data_requester_removed:[],mesh_added:[],mesh_updated:[],mesh_removed:[],object_transform_updated:[],renderable_feature_added:[],renderable_feature_changed:[],renderable_feature_removed:[],texture_fragment_removed:[],texture_fragment_requested:[],update_sample_terrain_height:[],worker_task_delegated:[],worker_task_removed:[],hillshade_backfilled:[],hillshade_canceled:[]};addedEventIds=new Map;transactionManager=new a;needsUpdate(){return Object.values(this.stacks).some(e=>!!e.length)}pushEvents(e){if(e)for(let t of Object.keys(this.stacks)){let n=e[`take_${t}`].call(e);n&&(Array.isArray(n)?this.stacks[t].push(...n):this.stacks[t].push(n))}}forEachStack(e,t,n=100){let r=0;for(let i of this.stacks[e]){if(r===n)break;t(i),s(i),r++}this.stacks[e].splice(0,r)}async forEachStackAsync(e,t,n=100,r){let i=[],a=0,o=[];for(let s of this.stacks[e]){if(a===n)break;let e=s;if(r&&!r(e)){a++;continue}i.push(t(e)),o.push(a),a++}let c=[],l=0;for(let t of o){let n=t-l;c.push(this.stacks[e][n]),this.stacks[e].splice(n,1),l++}let u=await Promise.allSettled(i);for(let t of u)t.status===`rejected`&&console.error(`Event handler for "${e}" failed:`,t.reason);for(let e of c)s(e)}removeDuplicatedTransactionEvents(e){let t=new Map,r=e.change?new Map:null;this.stacks[e.add.key].forEach((e,r)=>{if(i(e)){let i=n(e);t.set(i,r)}}),r&&e.change&&this.stacks[e.change.key].forEach((e,t)=>{if(i(e)){let i=n(e);r.set(i,t)}});let a=new Set,o=new Set,s=new Set;this.stacks[e.remove.key].forEach((c,l)=>{if(!i(c))return;let u=n(c),d=t.get(u),f=!1;if(d!==void 0&&(a.add(d),f=!0),r&&e.change){let e=r.get(u);e!==void 0&&o.add(e)}f&&s.add(l)}),a.size>0&&this.removeStacksByIndices(e.add.key,a),o.size>0&&e.change&&this.removeStacksByIndices(e.change.key,o),s.size>0&&this.removeStacksByIndices(e.remove.key,s)}removeStacksByIndices(e,t){let n=[...t].sort((e,t)=>t-e);for(let t of n)s(this.stacks[e][t]),this.stacks[e].splice(t,1)}processTransactionEvents(e,t,n,r){let{shouldProcess:i,generateEventId:a=c,onAbort:o}=r??{};this.removeDuplicatedTransactionEvents(t);let s=this.addedEventIds.get(e)??new Set;this.addedEventIds.set(e,s);let l=this.transactionManager.getOrInsert(e).then(()=>this.forEachStackAsync(t.add.key,e=>(o&&s.add(a({type:`add`,event:e})),n({type:`add`,event:e})),t.add.max,i?e=>i({type:`add`,event:e}):void 0)).then(()=>(o&&s.clear(),this.forEachStackAsync(t.remove.key,e=>n({type:`remove`,event:e}),t.remove.max,i?e=>i({type:`remove`,event:e}):void 0)));if(o&&s.size)for(let n of this.stacks[t.remove.key]){if(!n)continue;let t=n,r=a({type:`remove`,event:t});if(r&&s.has(r)){try{Promise.resolve(o(t)).catch(t=>{console.error(`onAbort handler for "${e}" failed:`,t)})}catch(t){console.error(`onAbort handler for "${e}" failed:`,t)}s.delete(r)}}if(t.change){let e=t.change;l.then(()=>this.forEachStackAsync(e.key,e=>n({type:`change`,event:e}),e.max,i?e=>i({type:`change`,event:e}):void 0)).end()}else l.end()}};function u(e){}function d(e){return e!=null}function f(e){return e!==void 0}function p(e){return e!==!1}var m=class{cached_mesh_handle;coords;max_height;min_height;constructor(e){this.cached_mesh_handle=e.cached_mesh_handle?new g(e.cached_mesh_handle):void 0,this.coords=new h(e.coords),this.max_height=e.max_height,this.min_height=e.min_height}free(){}},h=class{x;y;z;constructor(e){this.x=e.x,this.y=e.y,this.z=e.z}},g=class{vertices;uvs;indices;heights;constructor(e){this.vertices=e.vertices,this.uvs=e.uvs,this.indices=e.indices,this.heights=e.heights}free(){}},_=class e{coords;size;constructor(e,t){this.coords=e,this.size=t}transfer_coords(){return this.coords}clone(){return new e(this.coords.slice(),this.size)}},v=class{uvs;indices;heights;normals;watermask;constructor(e,t,n,r,i){this.uvs=e,this.indices=t,this.heights=n,this.normals=r,this.watermask=i}},y=class{decoder;constructor(e){this.decoder=new b(e)}},b=class{b_scaler;boundary;epsilon;g_scaler;max_offset;min_offset;offset;r_scaler;constructor(e){this.b_scaler=e.b_scaler,this.boundary=e.boundary,this.epsilon=e.epsilon,this.g_scaler=e.g_scaler,this.max_offset=e.max_offset,this.min_offset=e.min_offset,this.offset=e.offset,this.r_scaler=e.r_scaler}},ee=class{x;y;z;constructor(e){this.x=e.x,this.y=e.y,this.z=e.z}},te=class{vertices;uvs;indices;heights;max_height;min_height;rtc_translation;normals;skirt_vertices;skirt_uvs;skirt_indices;skirt_normals;watermask;constructor(e){this.vertices=e.transferVertices(),this.uvs=e.transferUvs(),this.indices=e.transferIndices(),this.heights=e.transferHeights(),this.max_height=e.max_height,this.min_height=e.min_height,this.rtc_translation=e.rtc_translation?new ee(e.rtc_translation):void 0,e.hasNormals()&&(this.normals=e.transferNormals()),e.hasSkirt()&&(this.skirt_vertices=e.transferSkirtVertices(),this.skirt_uvs=e.transferSkirtUvs(),this.skirt_indices=e.transferSkirtIndices(),this.skirt_normals=e.transferSkirtNormals()),e.hasWatermask()&&(this.watermask=e.transferWatermask())}transferVertices(){throw Error()}transferUvs(){throw Error()}transferIndices(){throw Error()}transferHeights(){throw Error()}transferNormals(){throw Error()}transferSkirtVertices(){throw Error()}transferSkirtUvs(){throw Error()}transferSkirtIndices(){throw Error()}transferSkirtNormals(){throw Error()}transferWatermask(){throw Error()}hasSkirt(){return this.skirt_vertices!==void 0&&this.skirt_uvs!==void 0&&this.skirt_indices!==void 0}hasNormals(){return this.normals!==void 0}hasWatermask(){return this.watermask!==void 0}},ne=class{batch_ids;batch_indices;crs;expected_winding_orders;holes;holes_boundaries;holes_sizes;holes_total_sizes;length;outer_ring;outer_ring_sizes;constructor(e){this.batch_ids=e.transferBatchIds(),this.batch_indices=e.transferBatchIndices(),this.crs=e.crs(),this.expected_winding_orders=e.transferExpectedWindingOrders(),this.holes=e.transferHoles(),this.holes_boundaries=e.transferHolesBoundaries(),this.holes_sizes=e.transferHolesSizes(),this.holes_total_sizes=e.transferHolesTotalSizes(),this.length=e.length(),this.outer_ring=e.transferOuterRing(),this.outer_ring_sizes=e.transferOuterRingSizes()}setBatchIds(e,t){}setBatchIndices(e,t){}setExpectedWindingOrders(e,t){}setOuterRing(e,t){}setOuterRingSizes(e,t){}setHoles(e,t){}setHolesBoundaries(e,t){}setHolesSizes(e,t){}setHolesTotalSizes(e,t){}transferBatchIds(){throw Error()}transferBatchIndices(){throw Error()}transferExpectedWindingOrders(){throw Error()}transferOuterRing(){throw Error()}transferOuterRingSizes(){throw Error()}transferHoles(){throw Error()}transferHolesBoundaries(){throw Error()}transferHolesSizes(){throw Error()}transferHolesTotalSizes(){throw Error()}},x=class{clampToGround;tiled;castShadow;receiveShadow;color;extrudedHeight;height;show;perPositionHeight;wireframe;outline;__internal__;constructor(e){this.clampToGround=e.clampToGround,this.tiled=e.tiled,this.receiveShadow=e.receiveShadow,this.castShadow=e.castShadow,this.color=e.color,this.extrudedHeight=e.extrudedHeight,this.height=e.height,this.show=e.show,this.perPositionHeight=e.perPositionHeight,this.wireframe=e.wireframe,this.outline=e.outline}free(){}},S=class{east;north;south;west;constructor(e){this.east=e.east,this.north=e.north,this.south=e.south,this.west=e.west}},C=class{extent;position_3d_high;position_3d_high_size;position_3d_low;position_3d_low_size;position;position_size;normal;normal_size;scale_normal_and_cap;scale_normal_and_cap_size;batch_id;batch_id_size;batch_index;batch_index_size;indices;rtc_translation;outline_position;outline_position_size;outline_position_3d_high;outline_position_3d_high_size;outline_position_3d_low;outline_position_3d_low_size;outline_scale_normal_and_cap;outline_scale_normal_and_cap_size;outline_skip_indices;outline_batch_index;outline_batch_index_size;constructor(e){let t=e.extent;this.extent=t?new S(t):void 0,this.position_3d_high=e.position_3d_high()?.slice(),this.position_3d_high_size=e.position_3d_high_size(),this.position_3d_low=e.position_3d_low()?.slice(),this.position_3d_low_size=e.position_3d_low_size(),this.position=e.position()?.slice(),this.position_size=e.position_size(),this.normal=e.normal()?.slice(),this.normal_size=e.normal_size(),this.scale_normal_and_cap=e.scale_normal_and_cap()?.slice(),this.scale_normal_and_cap_size=e.scale_normal_and_cap_size(),this.batch_id=e.batch_id()?.slice(),this.batch_id_size=e.batch_id_size(),this.batch_index=e.batch_index()?.slice(),this.batch_index_size=e.batch_index_size(),this.indices=e.indices().slice(),this.rtc_translation=e.rtc_translation?new ee(e.rtc_translation):void 0;let n=e.outline();n&&(this.outline_position=n.position()?.slice(),this.outline_position_size=n.position_size(),this.outline_position_3d_high=n.position_3d_high()?.slice(),this.outline_position_3d_high_size=n.position_3d_high_size(),this.outline_position_3d_low=n.position_3d_low()?.slice(),this.outline_position_3d_low_size=n.position_3d_low_size(),this.outline_scale_normal_and_cap=n.scale_normal_and_cap()?.slice(),this.outline_scale_normal_and_cap_size=n.scale_normal_and_cap_size(),this.outline_skip_indices=n.skip_indices()?.slice(),this.outline_batch_index=n.batch_index()?.slice(),this.outline_batch_index_size=n.batch_index_size(),n.free())}},re=class{points;points_sizes;batch_ids;batch_indices;crs;length;constructor(e){this.points=e.transferPoints(),this.points_sizes=e.transferPointsSizes(),this.batch_ids=e.transferBatchIds(),this.batch_indices=e.transferBatchIndices(),this.crs=e.crs(),this.length=e.length()}setPoints(e,t){}setPointsSizes(e,t){}setBatchIds(e,t){}setBatchIndices(e,t){}transferPoints(){throw Error()}transferPointsSizes(){throw Error()}transferBatchIds(){throw Error()}transferBatchIndices(){throw Error()}},ie=class{clampToGround;tiled;castShadow;receiveShadow;color;height;width;maxWidth;show;__internal__;constructor(e){this.clampToGround=e.clampToGround,this.tiled=e.tiled,this.receiveShadow=e.receiveShadow,this.castShadow=e.castShadow,this.color=e.color,this.width=e.width,this.maxWidth=e.maxWidth,this.height=e.height,this.show=e.show}free(){}},ae=class{extent;position;position_size;position_high;position_high_size;position_low;position_low_size;start;start_size;start_high;start_high_size;start_low;start_low_size;forward_offset;forward_offset_size;end_high;end_high_size;end_low;end_low_size;start_normals;start_normals_size;end_normal_and_texture_coordinate_normalization_x;end_normal_and_texture_coordinate_normalization_x_size;right_normal_and_texture_coordinate_normalization_y;right_normal_and_texture_coordinate_normalization_y_size;batch_id;batch_id_size;batch_index;batch_index_size;indices;constructor(e){let t=e.extent;this.extent=t?new S(t):void 0,this.position=e.position().slice(),this.position_size=e.position_size(),this.position_high=e.position_high()?.slice(),this.position_high_size=e.position_high_size(),this.position_low=e.position_low()?.slice(),this.position_low_size=e.position_low_size(),this.start=e.start()?.slice(),this.start_size=e.start_size(),this.start_high=e.start_high()?.slice(),this.start_high_size=e.start_high_size(),this.start_low=e.start_low()?.slice(),this.start_low_size=e.start_low_size(),this.forward_offset=e.forward_offset()?.slice(),this.forward_offset_size=e.forward_offset_size(),this.end_high=e.end_high()?.slice(),this.end_high_size=e.end_high_size(),this.end_low=e.end_low()?.slice(),this.end_low_size=e.end_low_size(),this.start_normals=e.start_normals()?.slice(),this.start_normals_size=e.start_normals_size(),this.end_normal_and_texture_coordinate_normalization_x=e.end_normal_and_texture_coordinate_normalization_x()?.slice(),this.end_normal_and_texture_coordinate_normalization_x_size=e.end_normal_and_texture_coordinate_normalization_x_size(),this.right_normal_and_texture_coordinate_normalization_y=e.right_normal_and_texture_coordinate_normalization_y().slice(),this.right_normal_and_texture_coordinate_normalization_y_size=e.right_normal_and_texture_coordinate_normalization_y_size(),this.batch_id=e.batch_id()?.slice(),this.batch_id_size=e.batch_id_size(),this.batch_index=e.batch_index()?.slice(),this.batch_index_size=e.batch_index_size(),this.indices=e.indices().slice()}},oe=[`png`,`webp`],se=class{events={};onceEvents={};on(e,t){this.events[e]||(this.events[e]=new Set),this.events[e].add(t)}off(e,t){this.events[e]?.delete(t),this.onceEvents[e]?.delete(t)}clear(e){this.events[e]?.clear(),this.onceEvents[e]?.clear()}size(e){return this.events[e]?.size||this.onceEvents[e]?.size}once(e,t){this.onceEvents[e]||(this.onceEvents[e]=new Set),this.onceEvents[e].add(t)}emit(e,...t){this.events[e]?.forEach(e=>e(...t)),this.onceEvents[e]?.size&&(this.onceEvents[e]?.forEach(e=>e(...t)),this.onceEvents[e]?.clear())}},ce=(e,t,n)=>{let r=t.length;for(let i=0;i<r;i++){let r=e[t[i]];n[i]=r}},le=class extends Error{constructor(e){super(e??`Unimplemented`)}},ue=class extends Error{constructor(e){super(e??`Unreachable`)}},de=class{list=[];indexMap={};add(e){this.assertUnique(e.name);let t=this.list.length;this.list.push(e),this.indexMap[e.name]=t}insertBefore(e,t){let n=this.findIndex(e);return this.insertAt(n,t)}insertAfter(e,t){let n=this.findIndex(e);return this.insertAt(n+1,t)}insertAt(e,t){if(this.assertUnique(t.name),e<0||e>this.list.length)throw RangeError(`index out of range: ${e}`);this.list.splice(e,0,t);for(let t=e;t<this.list.length;t++)this.indexMap[this.list[t].name]=t;return e}findIndex(e){let t=this.indexMap[e];if(t===void 0)throw Error(`target not found: ${e}`);return t}assertUnique(e){if(this.indexMap[e]!==void 0)throw Error(`duplicate name: ${e}`)}},fe=class extends se{_value;constructor(e){super(),this._value=e}get value(){return this._value}set value(e){this._value=e,this.emit(`changed`,e)}changed(e){let t=n=>{e(n),this.off(`changed`,t)};this.on(`changed`,t)}},pe=class{value;constructor(e,n,r){this.value=new t.Vec3(e,n,r)}copy(e,t,n){this.value.x=e,this.value.y=t,this.value.z=n}};function me(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function he(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ge(e){let t,n,r;e.length===2?(t=e===me||e===he?e:_e,n=e,r=e):(t=me,n=(t,n)=>me(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function _e(){return 0}function ve(e){return e===null?NaN:+e}var ye=ge(me),be=ye.right;ye.left,ge(ve).center;var xe=Math.sqrt(50),Se=Math.sqrt(10),Ce=Math.sqrt(2);function w(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=xe?10:a>=Se?5:a>=Ce?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?w(e,t,n*2):[s,c,l]}function we(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?w(t,e,n):w(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r){if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o}else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function Te(e,t,n){return t=+t,e=+e,n=+n,w(e,t,n)[2]}function Ee(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?Te(t,e,n):Te(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}var De={value:()=>{}};function Oe(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new T(n)}function T(e){this._=e}function ke(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}T.prototype=Oe.prototype={constructor:T,on:function(e,t){var n=this._,r=ke(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Ae(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=je(n[i],e.name,t);else if(t==null)for(i in n)n[i]=je(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new T(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Ae(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function je(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=De,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Me={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function E(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Me.hasOwnProperty(t)?{space:Me[t],local:e}:e}function Ne(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Pe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Fe(e){var t=E(e);return(t.local?Pe:Ne)(t)}function Ie(){}function Le(e){return e==null?Ie:function(){return this.querySelector(e)}}function Re(e){typeof e!=`function`&&(e=Le(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new O(r,this._parents)}function ze(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Be(){return[]}function Ve(e){return e==null?Be:function(){return this.querySelectorAll(e)}}function He(e){return function(){return ze(e.apply(this,arguments))}}function Ue(e){e=typeof e==`function`?He(e):Ve(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new O(r,i)}function We(e){return function(){return this.matches(e)}}function Ge(e){return function(t){return t.matches(e)}}var Ke=Array.prototype.find;function qe(e){return function(){return Ke.call(this.children,e)}}function Je(){return this.firstElementChild}function Ye(e){return this.select(e==null?Je:qe(typeof e==`function`?e:Ge(e)))}var Xe=Array.prototype.filter;function Ze(){return Array.from(this.children)}function Qe(e){return function(){return Xe.call(this.children,e)}}function $e(e){return this.selectAll(e==null?Ze:Qe(typeof e==`function`?e:Ge(e)))}function et(e){typeof e!=`function`&&(e=We(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new O(r,this._parents)}function tt(e){return Array(e.length)}function nt(){return new O(this._enter||this._groups.map(tt),this._parents)}function rt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}rt.prototype={constructor:rt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function it(e){return function(){return e}}function at(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new rt(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function ot(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new rt(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function st(e){return e.__data__}function ct(e,t){if(!arguments.length)return Array.from(this,st);var n=t?ot:at,r=this._parents,i=this._groups;typeof e!=`function`&&(e=it(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=lt(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new O(o,r),o._enter=s,o._exit=c,o}function lt(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function ut(){return new O(this._exit||this._groups.map(tt),this._parents)}function dt(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function ft(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new O(s,this._parents)}function pt(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function mt(e){e||=ht;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new O(i,this._parents).order()}function ht(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function gt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function _t(){return Array.from(this)}function vt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function yt(){let e=0;for(let t of this)++e;return e}function bt(){return!this.node()}function xt(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function St(e){return function(){this.removeAttribute(e)}}function Ct(e){return function(){this.removeAttributeNS(e.space,e.local)}}function wt(e,t){return function(){this.setAttribute(e,t)}}function Tt(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Et(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Dt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Ot(e,t){var n=E(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Ct:St:typeof t==`function`?n.local?Dt:Et:n.local?Tt:wt)(n,t))}function kt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function At(e){return function(){this.style.removeProperty(e)}}function jt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Mt(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Nt(e,t,n){return arguments.length>1?this.each((t==null?At:typeof t==`function`?Mt:jt)(e,t,n??``)):D(this.node(),e)}function D(e,t){return e.style.getPropertyValue(t)||kt(e).getComputedStyle(e,null).getPropertyValue(t)}function Pt(e){return function(){delete this[e]}}function Ft(e,t){return function(){this[e]=t}}function It(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Lt(e,t){return arguments.length>1?this.each((t==null?Pt:typeof t==`function`?It:Ft)(e,t)):this.node()[e]}function Rt(e){return e.trim().split(/^|\s+/)}function zt(e){return e.classList||new Bt(e)}function Bt(e){this._node=e,this._names=Rt(e.getAttribute(`class`)||``)}Bt.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Vt(e,t){for(var n=zt(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Ht(e,t){for(var n=zt(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Ut(e){return function(){Vt(this,e)}}function Wt(e){return function(){Ht(this,e)}}function Gt(e,t){return function(){(t.apply(this,arguments)?Vt:Ht)(this,e)}}function Kt(e,t){var n=Rt(e+``);if(arguments.length<2){for(var r=zt(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?Gt:t?Ut:Wt)(n,t))}function qt(){this.textContent=``}function Jt(e){return function(){this.textContent=e}}function Yt(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Xt(e){return arguments.length?this.each(e==null?qt:(typeof e==`function`?Yt:Jt)(e)):this.node().textContent}function Zt(){this.innerHTML=``}function Qt(e){return function(){this.innerHTML=e}}function $t(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function en(e){return arguments.length?this.each(e==null?Zt:(typeof e==`function`?$t:Qt)(e)):this.node().innerHTML}function tn(){this.nextSibling&&this.parentNode.appendChild(this)}function nn(){return this.each(tn)}function rn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function an(){return this.each(rn)}function on(e){var t=typeof e==`function`?e:Fe(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function sn(){return null}function cn(e,t){var n=typeof e==`function`?e:Fe(e),r=t==null?sn:typeof t==`function`?t:Le(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ln(){var e=this.parentNode;e&&e.removeChild(this)}function un(){return this.each(ln)}function dn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fn(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pn(e){return this.select(e?fn:dn)}function mn(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function hn(e){return function(t){e.call(this,t,this.__data__)}}function gn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function _n(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function vn(e,t,n){return function(){var r=this.__on,i,a=hn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function yn(e,t,n){var r=gn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?vn:_n,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function bn(e,t,n){var r=kt(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function xn(e,t){return function(){return bn(this,e,t)}}function Sn(e,t){return function(){return bn(this,e,t.apply(this,arguments))}}function Cn(e,t){return this.each((typeof t==`function`?Sn:xn)(e,t))}function*wn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Tn=[null];function O(e,t){this._groups=e,this._parents=t}function k(){return new O([[document.documentElement]],Tn)}function En(){return this}O.prototype=k.prototype={constructor:O,select:Re,selectAll:Ue,selectChild:Ye,selectChildren:$e,filter:et,data:ct,enter:nt,exit:ut,join:dt,merge:ft,selection:En,order:pt,sort:mt,call:gt,nodes:_t,node:vt,size:yt,empty:bt,each:xt,attr:Ot,style:Nt,property:Lt,classed:Kt,text:Xt,html:en,raise:nn,lower:an,append:on,insert:cn,remove:un,clone:pn,datum:mn,on:yn,dispatch:Cn,[Symbol.iterator]:wn};function Dn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function On(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function A(){}var j=.7,kn=1/j,M=`\\s*([+-]?\\d+)\\s*`,N=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,P=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,An=/^#([0-9a-f]{3,8})$/,jn=RegExp(`^rgb\\(${M},${M},${M}\\)$`),Mn=RegExp(`^rgb\\(${P},${P},${P}\\)$`),Nn=RegExp(`^rgba\\(${M},${M},${M},${N}\\)$`),Pn=RegExp(`^rgba\\(${P},${P},${P},${N}\\)$`),Fn=RegExp(`^hsl\\(${N},${P},${P}\\)$`),In=RegExp(`^hsla\\(${N},${P},${P},${N}\\)$`),Ln={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Dn(A,F,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Rn,formatHex:Rn,formatHex8:zn,formatHsl:Bn,formatRgb:Vn,toString:Vn});function Rn(){return this.rgb().formatHex()}function zn(){return this.rgb().formatHex8()}function Bn(){return Xn(this).formatHsl()}function Vn(){return this.rgb().formatRgb()}function F(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=An.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Hn(t):n===3?new L(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Un(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Un(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=jn.exec(e))?new L(t[1],t[2],t[3],1):(t=Mn.exec(e))?new L(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Nn.exec(e))?Un(t[1],t[2],t[3],t[4]):(t=Pn.exec(e))?Un(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Fn.exec(e))?Yn(t[1],t[2]/100,t[3]/100,1):(t=In.exec(e))?Yn(t[1],t[2]/100,t[3]/100,t[4]):Ln.hasOwnProperty(e)?Hn(Ln[e]):e===`transparent`?new L(NaN,NaN,NaN,0):null}function Hn(e){return new L(e>>16&255,e>>8&255,e&255,1)}function Un(e,t,n,r){return r<=0&&(e=t=n=NaN),new L(e,t,n,r)}function Wn(e){return e instanceof A||(e=F(e)),e?(e=e.rgb(),new L(e.r,e.g,e.b,e.opacity)):new L}function I(e,t,n,r){return arguments.length===1?Wn(e):new L(e,t,n,r??1)}function L(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Dn(L,I,On(A,{brighter(e){return e=e==null?kn:kn**+e,new L(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?j:j**+e,new L(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new L(R(this.r),R(this.g),R(this.b),Jn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Gn,formatHex:Gn,formatHex8:Kn,formatRgb:qn,toString:qn}));function Gn(){return`#${z(this.r)}${z(this.g)}${z(this.b)}`}function Kn(){return`#${z(this.r)}${z(this.g)}${z(this.b)}${z((isNaN(this.opacity)?1:this.opacity)*255)}`}function qn(){let e=Jn(this.opacity);return`${e===1?`rgb(`:`rgba(`}${R(this.r)}, ${R(this.g)}, ${R(this.b)}${e===1?`)`:`, ${e})`}`}function Jn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function R(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function z(e){return e=R(e),(e<16?`0`:``)+e.toString(16)}function Yn(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new B(e,t,n,r)}function Xn(e){if(e instanceof B)return new B(e.h,e.s,e.l,e.opacity);if(e instanceof A||(e=F(e)),!e)return new B;if(e instanceof B)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new B(o,s,c,e.opacity)}function Zn(e,t,n,r){return arguments.length===1?Xn(e):new B(e,t,n,r??1)}function B(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Dn(B,Zn,On(A,{brighter(e){return e=e==null?kn:kn**+e,new B(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?j:j**+e,new B(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new L(er(e>=240?e-240:e+120,i,r),er(e,i,r),er(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new B(Qn(this.h),$n(this.s),$n(this.l),Jn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Jn(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Qn(this.h)}, ${$n(this.s)*100}%, ${$n(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Qn(e){return e=(e||0)%360,e<0?e+360:e}function $n(e){return Math.max(0,Math.min(1,e||0))}function er(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var tr=e=>()=>e;function nr(e,t){return function(n){return e+n*t}}function rr(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function ir(e){return(e=+e)==1?ar:function(t,n){return n-t?rr(t,n,e):tr(isNaN(t)?n:t)}}function ar(e,t){var n=t-e;return n?nr(e,n):tr(isNaN(e)?t:e)}var or=(function e(t){var n=ir(t);function r(e,t){var r=n((e=I(e)).r,(t=I(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=ar(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function sr(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function cr(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function lr(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=_r(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function ur(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function V(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function dr(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=_r(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var fr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pr=new RegExp(fr.source,`g`);function mr(e){return function(){return e}}function hr(e){return function(t){return e(t)+``}}function gr(e,t){var n=fr.lastIndex=pr.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=fr.exec(e))&&(i=pr.exec(t));)(a=i.index)>n&&(a=t.slice(n,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,c.push({i:o,x:V(r,i)})),n=pr.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?hr(c[0].x):mr(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function _r(e,t){var n=typeof t,r;return t==null||n===`boolean`?tr(t):(n===`number`?V:n===`string`?(r=F(t))?(t=r,or):gr:t instanceof F?or:t instanceof Date?ur:cr(t)?sr:Array.isArray(t)?lr:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?dr:V)(e,t)}function vr(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var yr=180/Math.PI,br={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xr(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*yr,skewX:Math.atan(c)*yr,scaleX:o,scaleY:s}}var Sr;function Cr(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?br:xr(t.a,t.b,t.c,t.d,t.e,t.f)}function wr(e){return e==null||(Sr||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Sr.setAttribute(`transform`,e),!(e=Sr.transform.baseVal.consolidate()))?br:(e=e.matrix,xr(e.a,e.b,e.c,e.d,e.e,e.f))}function Tr(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:V(e,i)},{i:c-2,x:V(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:V(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:V(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:V(e,n)},{i:s-2,x:V(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Er=Tr(Cr,`px, `,`px)`,`deg)`),Dr=Tr(wr,`, `,`)`,`)`);function Or(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var H=0,kr=0,Ar=0,jr=1e3,Mr,U,Nr=0,W=0,Pr=0,G=typeof performance==`object`&&performance.now?performance:Date,Fr=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ir(){return W||=(Fr(Lr),G.now()+Pr)}function Lr(){W=0}function Rr(){this._call=this._time=this._next=null}Rr.prototype=zr.prototype={constructor:Rr,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Ir():+n)+(t==null?0:+t),!this._next&&U!==this&&(U?U._next=this:Mr=this,U=this),this._call=e,this._time=n,Wr()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wr())}};function zr(e,t,n){var r=new Rr;return r.restart(e,t,n),r}function Br(){Ir(),++H;for(var e=Mr,t;e;)(t=W-e._time)>=0&&e._call.call(void 0,t),e=e._next;--H}function Vr(){W=(Nr=G.now())+Pr,H=kr=0;try{Br()}finally{H=0,Ur(),W=0}}function Hr(){var e=G.now(),t=e-Nr;t>jr&&(Pr-=t,Nr=e)}function Ur(){for(var e,t=Mr,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Mr=n);U=e,Wr(r)}function Wr(e){H||(kr&&=clearTimeout(kr),e-W>24?(e<1/0&&(kr=setTimeout(Vr,e-G.now()-Pr)),Ar&&=clearInterval(Ar)):(Ar||=(Nr=G.now(),setInterval(Hr,jr)),H=1,Fr(Vr)))}function Gr(e,t,n){var r=new Rr;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Kr=Oe(`start`,`end`,`cancel`,`interrupt`),qr=[];function Jr(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Xr(e,n,{name:t,index:r,group:i,on:Kr,tween:qr,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Yr(e,t){var n=q(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function K(e,t){var n=q(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function q(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Xr(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zr(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return Gr(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Gr(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Zr(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Qr(e){return this.each(function(){Zr(this,e)})}function $r(e,t){var n,r;return function(){var i=K(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function ei(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=K(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function ti(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=q(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?$r:ei)(n,e,t))}function ni(e,t,n){var r=e._id;return e.each(function(){var e=K(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return q(e,r).value[t]}}function ri(e,t){var n;return(typeof t==`number`?V:t instanceof F?or:(n=F(t))?(t=n,or):gr)(e,t)}function ii(e){return function(){this.removeAttribute(e)}}function ai(e){return function(){this.removeAttributeNS(e.space,e.local)}}function oi(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function si(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ci(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function li(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ui(e,t){var n=E(e),r=n===`transform`?Dr:ri;return this.attrTween(e,typeof t==`function`?(n.local?li:ci)(n,r,ni(this,`attr.`+e,t)):t==null?(n.local?ai:ii)(n):(n.local?si:oi)(n,r,t))}function di(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function fi(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function pi(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&fi(e,i)),n}return i._value=t,i}function mi(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&di(e,i)),n}return i._value=t,i}function hi(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=E(e);return this.tween(n,(r.local?pi:mi)(r,t))}function gi(e,t){return function(){Yr(this,e).delay=+t.apply(this,arguments)}}function _i(e,t){return t=+t,function(){Yr(this,e).delay=t}}function vi(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?gi:_i)(t,e)):q(this.node(),t).delay}function yi(e,t){return function(){K(this,e).duration=+t.apply(this,arguments)}}function bi(e,t){return t=+t,function(){K(this,e).duration=t}}function xi(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?yi:bi)(t,e)):q(this.node(),t).duration}function Si(e,t){if(typeof t!=`function`)throw Error();return function(){K(this,e).ease=t}}function Ci(e){var t=this._id;return arguments.length?this.each(Si(t,e)):q(this.node(),t).ease}function wi(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();K(this,e).ease=n}}function Ti(e){if(typeof e!=`function`)throw Error();return this.each(wi(this._id,e))}function Ei(e){typeof e!=`function`&&(e=We(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new J(r,this._parents,this._name,this._id)}function Di(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new J(o,this._parents,this._name,this._id)}function Oi(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function ki(e,t,n){var r,i,a=Oi(t)?Yr:K;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ai(e,t){var n=this._id;return arguments.length<2?q(this.node(),n).on.on(e):this.each(ki(n,e,t))}function ji(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Mi(){return this.on(`end.remove`,ji(this._id))}function Ni(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Le(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Jr(l[f],t,n,f,l,q(u,n)));return new J(a,this._parents,t,n)}function Pi(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Ve(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=q(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Jr(p,t,n,h,f,m);a.push(f),o.push(u)}return new J(a,o,t,n)}var Fi=k.prototype.constructor;function Ii(){return new Fi(this._groups,this._parents)}function Li(e,t){var n,r,i;return function(){var a=D(this,e),o=(this.style.removeProperty(e),D(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Ri(e){return function(){this.style.removeProperty(e)}}function zi(e,t,n){var r,i=n+``,a;return function(){var o=D(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Bi(e,t,n){var r,i,a;return function(){var o=D(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),D(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Vi(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=K(this,e),l=c.on,u=c.value[a]==null?s||=Ri(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Hi(e,t,n){var r=(e+=``)==`transform`?Er:ri;return t==null?this.styleTween(e,Li(e,r)).on(`end.style.`+e,Ri(e)):typeof t==`function`?this.styleTween(e,Bi(e,r,ni(this,`style.`+e,t))).each(Vi(this._id,e)):this.styleTween(e,zi(e,r,t),n).on(`end.style.`+e,null)}function Ui(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Wi(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Ui(e,a,n)),r}return a._value=t,a}function Gi(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Wi(e,t,n??``))}function Ki(e){return function(){this.textContent=e}}function qi(e){return function(){var t=e(this);this.textContent=t??``}}function Ji(e){return this.tween(`text`,typeof e==`function`?qi(ni(this,`text`,e)):Ki(e==null?``:e+``))}function Yi(e){return function(t){this.textContent=e.call(this,t)}}function Xi(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Yi(r)),t}return r._value=e,r}function Zi(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Xi(e))}function Qi(){for(var e=this._name,t=this._id,n=ta(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=q(c,t);Jr(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new J(r,this._parents,e,n)}function $i(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=K(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var ea=0;function J(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ta(){return++ea}var Y=k.prototype;J.prototype={constructor:J,select:Ni,selectAll:Pi,selectChild:Y.selectChild,selectChildren:Y.selectChildren,filter:Ei,merge:Di,selection:Ii,transition:Qi,call:Y.call,nodes:Y.nodes,node:Y.node,size:Y.size,empty:Y.empty,each:Y.each,on:Ai,attr:ui,attrTween:hi,style:Hi,styleTween:Gi,text:Ji,textTween:Zi,remove:Mi,tween:ti,delay:vi,duration:xi,ease:Ci,easeVarying:Ti,end:$i,[Symbol.iterator]:Y[Symbol.iterator]};function na(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ra={time:null,delay:0,duration:250,ease:na};function ia(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function aa(e){var t,n;e instanceof J?(t=e._id,e=e._name):(t=ta(),(n=ra).time=Ir(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Jr(c,e,t,l,o,n||ia(c,t));return new J(r,this._parents,e,t)}k.prototype.interrupt=Qr,k.prototype.transition=aa;var{abs:oa,max:sa,min:ca}=Math;[`w`,`e`].map(la),[`n`,`s`].map(la),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(la);function la(e){return{type:e}}function ua(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function da(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function X(e){return e=da(Math.abs(e)),e?e[1]:NaN}function fa(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function pa(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var ma=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ha(e){if(!(t=ma.exec(e)))throw Error(`invalid format: `+e);var t;return new ga({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ha.prototype=ga.prototype;function ga(e){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+``}ga.prototype.toString=function(){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};function _a(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(i+1):e}var va;function ya(e,t){var n=da(e,t);if(!n)return va=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(va=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+da(e,Math.max(0,t+a-1))[0]}function ba(e,t){var n=da(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var xa={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:ua,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ba(e*100,t),r:ba,s:ya,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Sa(e){return e}var Ca=Array.prototype.map,wa=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function Ta(e){var t=e.grouping===void 0||e.thousands===void 0?Sa:fa(Ca.call(e.grouping,Number),e.thousands+``),n=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?Sa:pa(Ca.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=ha(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):xa[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),ee=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),te=xa[y],ne=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function x(e){var n=b,r=ee,o,l,p;if(y===`c`)r=te(e)+r,e=``;else{e=+e;var x=e<0||1/e<0;if(e=isNaN(e)?c:te(Math.abs(e),_),v&&(e=_a(e)),x&&+e==0&&f!==`+`&&(x=!1),n=(x?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&va!==void 0?wa[8+va/3]:``)+r+(x&&f===`(`?`)`:``),ne){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var S=n.length+e.length+r.length,C=S<h?Array(h-S+1).join(u):``;switch(g&&m&&(e=t(C+e,C.length?h-r.length:1/0),C=``),d){case`<`:e=n+e+r+C;break;case`=`:e=n+C+e+r;break;case`^`:e=C.slice(0,S=C.length>>1)+n+e+r+C.slice(S);break;default:e=C+n+e+r}return a(e)}return x.toString=function(){return e+``},x}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(X(t)/3)))*3,r=10**-n,i=l((e=ha(e),e.type=`f`,e),{suffix:wa[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var Ea,Da,Oa;ka({thousands:`,`,grouping:[3],currency:[`$`,``]});function ka(e){return Ea=Ta(e),Da=Ea.format,Oa=Ea.formatPrefix,Ea}function Aa(e){return Math.max(0,-X(Math.abs(e)))}function ja(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(X(t)/3)))*3-X(Math.abs(e)))}function Ma(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,X(t)-X(e))+1}function Na(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Pa(e){return function(){return e}}function Fa(e){return+e}var Ia=[0,1];function Z(e){return e}function La(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Pa(isNaN(t)?NaN:.5)}function Ra(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function za(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=La(i,r),a=n(o,a)):(r=La(r,i),a=n(a,o)),function(e){return a(r(e))}}function Ba(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=La(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=be(e,t,1,r)-1;return a[n](i[n](t))}}function Va(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ha(){var e=Ia,t=Ia,n=_r,r,i,a,o=Z,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==Z&&(o=Ra(e[0],e[n-1])),s=n>2?Ba:za,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),V))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,Fa),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=vr,u()},d.clamp=function(e){return arguments.length?(o=e?!0:Z,u()):o!==Z},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function Ua(){return Ha()(Z,Z)}function Wa(e,t,n,r){var i=Ee(e,t,n),a;switch(r=ha(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=ja(i,o))&&(r.precision=a),Oa(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Ma(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=Aa(i))&&(r.precision=a-(r.type===`%`)*2)}return Da(r)}function Ga(e){var t=e.domain;return e.ticks=function(e){var n=t();return we(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return Wa(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-->0;){if(l=Te(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function Ka(){var e=Ua();return e.copy=function(){return Va(e,Ka())},Na.apply(e,arguments),Ga(e)}function Q(e,t,n){this.k=e,this.x=t,this.y=n}Q.prototype={constructor:Q,scale:function(e){return e===1?this:new Q(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Q(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var qa=new Q(1,0,0);Ja.prototype=Q.prototype;function Ja(e){for(;!e.__zoom;)if(!(e=e.parentNode))return qa;return e.__zoom}var Ya=`Invariant failed`;function $(e,t){if(!e)throw Error(Ya)}var Xa=class{type;name;lut;constructor(e,t,n){this.type=e,this.name=t,$(n.length>1),this.lut=n.map(e=>Array.isArray(e)?e:e.srgb().toArray())}#e;linear(e){this.buildLinear(),$(this.#e);let t=this.#e(e);return $(t!=null),t}buildLinear(){this.#e??=Ka().domain(Or(_r(0,1),this.lut.length)).range(this.lut).clamp(!0)}get count(){return this.lut.length}ticks(e,t){return Ka().domain(e).ticks(t)}quantize(e){return $(e>1),[...Array(e)].map((t,n)=>this.linear(n/(e-1)))}createImage(){let e=document.createElement(`canvas`);e.width=this.lut.length,e.height=1;let t=e.getContext(`2d`);return $(t!=null),this.lut.forEach(([e,n,r],i)=>{t.fillStyle=I(e*255,n*255,r*255).toString(),t.fillRect(i,0,1,1)}),e}flatten(){let e=new Float32Array(this.lut.length*3);for(let t=0;t<this.lut.length;t++)e[t*3]=this.lut[t][0],e[t*3+1]=this.lut[t][1],e[t*3+2]=this.lut[t][2];return e}},Za=class{},Qa=class{handler;_elevationColormap;constructor(e,t){this.handler=e,this.setOptions(t)}setOptions(e){e?.maxSse!=null&&(this.maxSse=e.maxSse),e?.segments!=null&&(this.segments=e.segments),e?.color!=null&&(this.color=e.color),e?.hideUnderground!=null&&(this.hideUnderground=e.hideUnderground),e?.useNormal!=null&&(this.useNormal=e.useNormal),e?.transparent!=null&&(this.transparent=e.transparent),e?.opacity!=null&&(this.opacity=e.opacity),e?.wireframe!=null&&(this.wireframe=e.wireframe),e?.elevationColormap!=null&&(this.elevationColormap=e.elevationColormap)}get maxSse(){return this.handler.getMaxSse()??2}set maxSse(e){this.handler.setMaxSse(e)}get segments(){return this.handler.getSegments()??64}set segments(e){this.handler.setSegments(e)}get color(){return this.handler.getColor()}set color(e){this.handler.setColor(e)}get hideUnderground(){return this.handler.getHideUnderground()??!0}set hideUnderground(e){this.handler.setHideUnderground(e)}get useNormal(){return this.handler.getUseNormal()??!1}set useNormal(e){this.handler.setUseNormal(e)}get transparent(){return this.handler.getTransparent()??!1}set transparent(e){this.handler.setTransparent(e)}get opacity(){return this.handler.getOpacity()??1}set opacity(e){this.handler.setOpacity(e)}get wireframe(){return this.handler.getWireframe()??!1}set wireframe(e){this.handler.setWireframe(e)}get elevationColormap(){return this._elevationColormap}set elevationColormap(e){this._elevationColormap=e,this.handler.setElevationColormap(e)}},$a=class{};e.BaseAbstractedVec3=pe,e.CachedMeshHandleLike=g,e.Color=Za,e.ColorMap=Xa,e.ConstructedPolygonGeometryLike=C,e.ConstructedPolylineGeometryLike=ae,e.ElevationDecoderLike=b,e.EventHandler=se,e.EventManager=l,e.ExtentRadianF32Like=S,e.Globe=Qa,e.IMAGE_EXTENSIONS=oe,e.NamedIndexMap=de,e.Observed=fe,e.Plugin=$a,e.PolygonMaterialLike=x,e.PolylineMaterialLike=ie,e.ReturnedConstructedTerrainMeshLike=te,e.TileXYZLike=h,e.Transaction=o,e.TransactionManager=a,e.TransferableMartiniLike=_,e.TransferablePolygonBatchedFeatureLike=ne,e.TransferablePolylineBatchedFeatureLike=re,e.TransferableRasterDEMDataLike=y,e.TransferableTileLike=m,e.Unimplemented=le,e.Unreachable=ue,e.UpsamplableTerrainGeometryLike=v,e.Vec3Like=ee,e.assertType=u,e.generate_id_from_entity=n,e.generate_id_from_ind_gen=r,e.isEntityEvent=i,e.isNotFalse=p,e.isNotNullish=d,e.isNotUndefined=f,e.setBatchedValuesToBatchedAttribute=ce});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@navaramap/core",
3
3
  "type": "module",
4
- "version": "0.0.6",
4
+ "version": "0.0.8",
5
5
  "main": "dist/index.umd.cjs",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -78,6 +78,7 @@ export class EventManager {
78
78
  stacks: EventsStacks = {
79
79
  camera_transform_updated: [],
80
80
  camera_frustum_updated: [],
81
+ camera_flight_ended: [],
81
82
  data_requested: [],
82
83
  data_requester_removed: [],
83
84
  mesh_added: [],
@@ -24,6 +24,10 @@ export class ConstructedPolygonGeometryLike {
24
24
  rtc_translation: Vec3Like | undefined;
25
25
  outline_position: Float32Array | undefined;
26
26
  outline_position_size: number | undefined;
27
+ outline_position_3d_high: Float32Array | undefined;
28
+ outline_position_3d_high_size: number | undefined;
29
+ outline_position_3d_low: Float32Array | undefined;
30
+ outline_position_3d_low_size: number | undefined;
27
31
  outline_scale_normal_and_cap: Float32Array | undefined;
28
32
  outline_scale_normal_and_cap_size: number | undefined;
29
33
  outline_skip_indices: Uint32Array | undefined;
@@ -56,6 +60,10 @@ export class ConstructedPolygonGeometryLike {
56
60
  if (outline) {
57
61
  this.outline_position = outline.position()?.slice();
58
62
  this.outline_position_size = outline.position_size();
63
+ this.outline_position_3d_high = outline.position_3d_high()?.slice();
64
+ this.outline_position_3d_high_size = outline.position_3d_high_size();
65
+ this.outline_position_3d_low = outline.position_3d_low()?.slice();
66
+ this.outline_position_3d_low_size = outline.position_3d_low_size();
59
67
  this.outline_scale_normal_and_cap = outline
60
68
  .scale_normal_and_cap()
61
69
  ?.slice();