@kong-ui-public/analytics-geo-map 1.4.10 → 1.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { Map as
|
|
3
|
-
import { createI18n as
|
|
4
|
-
import { AnalyticsIcon as
|
|
5
|
-
const
|
|
1
|
+
import { computed as k, defineComponent as f0, createElementBlock as T, openBlock as M, createCommentVNode as W, toDisplayString as R, Fragment as I0, renderList as R0, createElementVNode as B, normalizeStyle as O0, useCssVars as E0, toRef as v0, ref as j, useId as A0, onMounted as $0, watch as s0, createBlock as g0, renderSlot as l0, createVNode as G0, unref as I, createTextVNode as q0 } from "vue";
|
|
2
|
+
import { Map as H0 } from "maplibre-gl";
|
|
3
|
+
import { createI18n as K0, i18nTComponent as j0 } from "@kong-ui-public/i18n";
|
|
4
|
+
import { AnalyticsIcon as W0 } from "@kong/icons";
|
|
5
|
+
const Z0 = {
|
|
6
6
|
ms: "ms",
|
|
7
7
|
bytes: "Byte{plural}",
|
|
8
8
|
count: "request{plural}",
|
|
9
9
|
"count/minute": "rpm",
|
|
10
10
|
requests: "request{plural}"
|
|
11
|
-
},
|
|
11
|
+
}, J0 = {
|
|
12
12
|
request_count: "Request count",
|
|
13
13
|
request_per_minute: "Requests per minute",
|
|
14
14
|
response_latency_average: "Response latency (avg)",
|
|
@@ -33,110 +33,117 @@ const W0 = {
|
|
|
33
33
|
request_size_p95: "Request size (p95)",
|
|
34
34
|
request_size_p50: "Request size (p50)",
|
|
35
35
|
request_size_sum: "Request size (sum)"
|
|
36
|
-
},
|
|
36
|
+
}, X0 = {
|
|
37
37
|
windows_zoom_help_text: "Use Ctrl + Scroll to zoom the map",
|
|
38
38
|
mac_zoom_help_text: "Use ⌘ + Scroll to zoom the map",
|
|
39
39
|
mobile_zoom_help_text: "Use two fingers to zoom the map"
|
|
40
|
-
},
|
|
41
|
-
metricUnits:
|
|
42
|
-
metrics:
|
|
43
|
-
cooperative_gestures:
|
|
44
|
-
no_location_data:
|
|
45
|
-
no_location_data_description:
|
|
40
|
+
}, Q0 = "No location", Y0 = "No location data found.", b0 = {
|
|
41
|
+
metricUnits: Z0,
|
|
42
|
+
metrics: J0,
|
|
43
|
+
cooperative_gestures: X0,
|
|
44
|
+
no_location_data: Q0,
|
|
45
|
+
no_location_data_description: Y0
|
|
46
46
|
};
|
|
47
|
-
function
|
|
48
|
-
const e =
|
|
47
|
+
function ee() {
|
|
48
|
+
const e = K0("en-us", b0);
|
|
49
49
|
return {
|
|
50
50
|
i18n: e,
|
|
51
|
-
i18nT:
|
|
51
|
+
i18nT: j0(e)
|
|
52
52
|
// Translation component <i18n-t>
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function P0(e) {
|
|
56
56
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
57
57
|
}
|
|
58
|
-
var
|
|
58
|
+
var S0 = { exports: {} };
|
|
59
59
|
(function(e) {
|
|
60
60
|
(function() {
|
|
61
61
|
function t(l, r) {
|
|
62
62
|
if (r.separator === !1 || l < 1e3)
|
|
63
63
|
return l.toString();
|
|
64
|
-
var u = typeof r.separator == "string" ? r.separator : ",",
|
|
65
|
-
return m.reverse().forEach(function(
|
|
66
|
-
|
|
67
|
-
}),
|
|
64
|
+
var u = typeof r.separator == "string" ? r.separator : ",", h = [], m = Math.round(l).toString().split("");
|
|
65
|
+
return m.reverse().forEach(function(_, v) {
|
|
66
|
+
v && v % 3 === 0 && h.push(u), h.push(_);
|
|
67
|
+
}), h.reverse().join("");
|
|
68
68
|
}
|
|
69
69
|
function i(l, r, u) {
|
|
70
|
-
var
|
|
71
|
-
return u.decimal === !1 ? (l = Math[m](
|
|
70
|
+
var h = l / r, m = u.round ? "round" : "floor";
|
|
71
|
+
return u.decimal === !1 ? (l = Math[m](h), l.toString()) : (u.precision ? l = h : l = h < 10 ? Math[m](h * 10) / 10 : Math[m](h), l = l.toString(), typeof u.decimal == "string" && (l = l.replace(".", u.decimal)), l);
|
|
72
72
|
}
|
|
73
|
-
var a = 1e3, n = 1e4, o = 1e6, s = 1e9,
|
|
73
|
+
var a = 1e3, n = 1e4, o = 1e6, s = 1e9, c = 1e12;
|
|
74
74
|
function f(l, r) {
|
|
75
75
|
var u;
|
|
76
76
|
r = r || {};
|
|
77
|
-
var
|
|
78
|
-
|
|
77
|
+
var h = l < 0;
|
|
78
|
+
h && (l = Math.abs(l)), r.precision && (l = parseFloat(l.toPrecision(r.precision)));
|
|
79
79
|
var m = r.min10k ? n : a;
|
|
80
|
-
return l < m || r.precision && r.precision > Math.log10(l) ? u = t(i(l, 1, r), r) : l < o ? u = i(l, a, r) + "k" : l < s ? u = i(l, o, r) + "m" : l <
|
|
80
|
+
return l < m || r.precision && r.precision > Math.log10(l) ? u = t(i(l, 1, r), r) : l < o ? u = i(l, a, r) + "k" : l < s ? u = i(l, o, r) + "m" : l < c ? u = t(i(l, s, r), r) + "b" : u = t(i(l, c, r), r) + "t", h && (u = "-" + u), r.capital && (u = u.toUpperCase()), r.prefix && (u = r.prefix + u), r.suffix && (u = u + r.suffix), u;
|
|
81
81
|
}
|
|
82
82
|
f.addCommas = t, e.exports = f;
|
|
83
83
|
})();
|
|
84
|
-
})(
|
|
85
|
-
var
|
|
86
|
-
const
|
|
84
|
+
})(S0);
|
|
85
|
+
var te = S0.exports;
|
|
86
|
+
const ie = /* @__PURE__ */ P0(te), Z = "#e0e4ea", ne = "#828a9e", ae = "32px", _0 = 5, u0 = [
|
|
87
87
|
"#00819d",
|
|
88
88
|
"#00abd2",
|
|
89
89
|
"#00c8f4",
|
|
90
90
|
"#67e3ff",
|
|
91
91
|
"#b3f1ff"
|
|
92
|
-
],
|
|
92
|
+
], re = (e, t) => {
|
|
93
93
|
const i = e.length;
|
|
94
94
|
if (!i)
|
|
95
95
|
return NaN;
|
|
96
96
|
const a = (i - 1) * t, n = Math.floor(a), o = Math.ceil(a);
|
|
97
97
|
return n === o ? e[n] : e[n] + (a - n) * (e[o] - e[n]);
|
|
98
|
-
},
|
|
98
|
+
}, c0 = (e, t) => {
|
|
99
99
|
if (e.length === 0)
|
|
100
100
|
return [];
|
|
101
|
-
const i = e.filter((
|
|
102
|
-
return Array.from({ length: t }, (
|
|
101
|
+
const i = e.filter((c) => c > 0).map(Math.log).sort((c, f) => c - f), a = Math.min(...i), o = (Math.max(...i) - a) / t;
|
|
102
|
+
return Array.from({ length: t }, (c, f) => a + f * o).map((c) => Math.exp(c)).reverse();
|
|
103
103
|
};
|
|
104
104
|
function oe({
|
|
105
105
|
countryMetrics: e,
|
|
106
106
|
metric: t
|
|
107
107
|
}) {
|
|
108
|
-
const i =
|
|
108
|
+
const i = k(() => Object.values(e.value)), a = k(() => Object.keys(e.value).length), n = k(() => a.value < _0 - 1 ? a.value : _0), o = k(() => {
|
|
109
109
|
var r;
|
|
110
110
|
return !((r = t.value) != null && r.includes("latency"));
|
|
111
|
-
}), s =
|
|
111
|
+
}), s = k(() => {
|
|
112
|
+
const r = [];
|
|
113
|
+
if (i.value.length > 10) {
|
|
114
|
+
const u = [...i.value].sort((C, X) => C - X), h = re(u, 0.25), m = i.value.filter((C) => C >= h), _ = i.value.filter((C) => C < h), v = c0(m, 3), o0 = c0(_, 2);
|
|
115
|
+
return r.push(...v, ...o0), r;
|
|
116
|
+
}
|
|
117
|
+
return c0(i.value, n.value);
|
|
118
|
+
}), c = k(() => i.value.length === 1 ? [{
|
|
112
119
|
color: f(i.value[0]),
|
|
113
120
|
range: l(i.value[0])
|
|
114
121
|
}] : s.value.map((r, u) => {
|
|
115
|
-
const
|
|
116
|
-
let
|
|
117
|
-
return u === 0 ?
|
|
122
|
+
const h = u === 0 ? Math.max(...s.value) : s.value[u - 1], m = r, _ = h;
|
|
123
|
+
let v = "";
|
|
124
|
+
return u === 0 ? v = `> ${l(m)}` : u === s.value.length - 1 ? v = `< ${l(_)}` : v = `${l(m)} - ${l(_)}`, {
|
|
118
125
|
color: f(m),
|
|
119
|
-
range:
|
|
126
|
+
range: v
|
|
120
127
|
};
|
|
121
128
|
})), f = (r) => {
|
|
122
129
|
if (r === 0)
|
|
123
|
-
return
|
|
124
|
-
const u = s.value.findIndex((
|
|
125
|
-
return u === -1 ?
|
|
130
|
+
return Z;
|
|
131
|
+
const u = s.value.findIndex((h) => r >= h);
|
|
132
|
+
return u === -1 ? u0[u0.length - 1] : u0[u] ?? Z;
|
|
126
133
|
}, l = (r) => {
|
|
127
|
-
var
|
|
134
|
+
var h;
|
|
128
135
|
const u = Math.trunc(r);
|
|
129
|
-
return o.value ?
|
|
136
|
+
return o.value ? ie(u, { capital: !0 }) : new Intl.NumberFormat(((h = document == null ? void 0 : document.documentElement) == null ? void 0 : h.lang) || "en-US").format(u);
|
|
130
137
|
};
|
|
131
138
|
return {
|
|
132
139
|
getColor: f,
|
|
133
140
|
formatMetric: l,
|
|
134
|
-
legendData:
|
|
141
|
+
legendData: c,
|
|
135
142
|
scale: s
|
|
136
143
|
};
|
|
137
144
|
}
|
|
138
|
-
const
|
|
139
|
-
useI18n:
|
|
145
|
+
const F0 = {
|
|
146
|
+
useI18n: ee,
|
|
140
147
|
useMetricUtils: oe
|
|
141
148
|
}, se = "FeatureCollection", le = [
|
|
142
149
|
{
|
|
@@ -2574,7 +2581,7 @@ const v0 = {
|
|
|
2574
2581
|
type: se,
|
|
2575
2582
|
features: le
|
|
2576
2583
|
};
|
|
2577
|
-
var ce = fe,
|
|
2584
|
+
var ce = fe, i0, G, F, n0, r0, de = [
|
|
2578
2585
|
"Point",
|
|
2579
2586
|
"MultiPoint",
|
|
2580
2587
|
"LineString",
|
|
@@ -2584,86 +2591,86 @@ var ce = fe, e0, $, _, t0, n0, de = [
|
|
|
2584
2591
|
"GeometryCollection"
|
|
2585
2592
|
];
|
|
2586
2593
|
function fe(e) {
|
|
2587
|
-
|
|
2594
|
+
n0 = 2, r0 = Math.pow(10, 6), F = null, i0 = [], G = [];
|
|
2588
2595
|
var t = e.readFields(he, {});
|
|
2589
|
-
return
|
|
2596
|
+
return i0 = null, t;
|
|
2590
2597
|
}
|
|
2591
2598
|
function he(e, t, i) {
|
|
2592
|
-
e === 1 ?
|
|
2599
|
+
e === 1 ? i0.push(i.readString()) : e === 2 ? n0 = i.readVarint() : e === 3 ? r0 = Math.pow(10, i.readVarint()) : e === 4 ? pe(i, t) : e === 5 ? V0(i, t) : e === 6 && h0(i, t);
|
|
2593
2600
|
}
|
|
2594
2601
|
function pe(e, t) {
|
|
2595
2602
|
return t.type = "FeatureCollection", t.features = [], e.readMessage(me, t);
|
|
2596
2603
|
}
|
|
2597
|
-
function
|
|
2604
|
+
function V0(e, t) {
|
|
2598
2605
|
t.type = "Feature";
|
|
2599
2606
|
var i = e.readMessage(ye, t);
|
|
2600
2607
|
return "geometry" in i || (i.geometry = null), i;
|
|
2601
2608
|
}
|
|
2602
|
-
function
|
|
2609
|
+
function h0(e, t) {
|
|
2603
2610
|
return t.type = "Point", e.readMessage(xe, t);
|
|
2604
2611
|
}
|
|
2605
2612
|
function me(e, t, i) {
|
|
2606
|
-
e === 1 ? t.features.push(
|
|
2613
|
+
e === 1 ? t.features.push(V0(i, {})) : e === 13 ? G.push(p0(i)) : e === 15 && a0(i, t);
|
|
2607
2614
|
}
|
|
2608
2615
|
function ye(e, t, i) {
|
|
2609
|
-
e === 1 ? t.geometry =
|
|
2616
|
+
e === 1 ? t.geometry = h0(i, {}) : e === 11 ? t.id = i.readString() : e === 12 ? t.id = i.readSVarint() : e === 13 ? G.push(p0(i)) : e === 14 ? t.properties = a0(i, {}) : e === 15 && a0(i, t);
|
|
2610
2617
|
}
|
|
2611
2618
|
function xe(e, t, i) {
|
|
2612
|
-
e === 1 ? t.type = de[i.readVarint()] : e === 2 ?
|
|
2619
|
+
e === 1 ? t.type = de[i.readVarint()] : e === 2 ? F = i.readPackedVarint() : e === 3 ? ve(t, i, t.type) : e === 4 ? (t.geometries = t.geometries || [], t.geometries.push(h0(i, {}))) : e === 13 ? G.push(p0(i)) : e === 15 && a0(i, t);
|
|
2613
2620
|
}
|
|
2614
2621
|
function ve(e, t, i) {
|
|
2615
|
-
i === "Point" ? e.coordinates = ge(t) : i === "MultiPoint" || i === "LineString" ? e.coordinates =
|
|
2622
|
+
i === "Point" ? e.coordinates = ge(t) : i === "MultiPoint" || i === "LineString" ? e.coordinates = w0(t) : i === "MultiLineString" ? e.coordinates = k0(t) : i === "Polygon" ? e.coordinates = k0(t, !0) : i === "MultiPolygon" && (e.coordinates = _e(t));
|
|
2616
2623
|
}
|
|
2617
|
-
function
|
|
2624
|
+
function p0(e) {
|
|
2618
2625
|
for (var t = e.readVarint() + e.pos, i = null; e.pos < t; ) {
|
|
2619
2626
|
var a = e.readVarint(), n = a >> 3;
|
|
2620
2627
|
n === 1 ? i = e.readString() : n === 2 ? i = e.readDouble() : n === 3 ? i = e.readVarint() : n === 4 ? i = -e.readVarint() : n === 5 ? i = e.readBoolean() : n === 6 && (i = JSON.parse(e.readString()));
|
|
2621
2628
|
}
|
|
2622
2629
|
return i;
|
|
2623
2630
|
}
|
|
2624
|
-
function
|
|
2625
|
-
for (var i = e.readVarint() + e.pos; e.pos < i; ) t[
|
|
2626
|
-
return
|
|
2631
|
+
function a0(e, t) {
|
|
2632
|
+
for (var i = e.readVarint() + e.pos; e.pos < i; ) t[i0[e.readVarint()]] = G[e.readVarint()];
|
|
2633
|
+
return G = [], t;
|
|
2627
2634
|
}
|
|
2628
2635
|
function ge(e) {
|
|
2629
|
-
for (var t = e.readVarint() + e.pos, i = []; e.pos < t; ) i.push(e.readSVarint() /
|
|
2636
|
+
for (var t = e.readVarint() + e.pos, i = []; e.pos < t; ) i.push(e.readSVarint() / r0);
|
|
2630
2637
|
return i;
|
|
2631
2638
|
}
|
|
2632
|
-
function
|
|
2633
|
-
var n = 0, o = [], s,
|
|
2634
|
-
for (
|
|
2639
|
+
function J(e, t, i, a) {
|
|
2640
|
+
var n = 0, o = [], s, c, f = [];
|
|
2641
|
+
for (c = 0; c < n0; c++) f[c] = 0;
|
|
2635
2642
|
for (; i ? n < i : e.pos < t; ) {
|
|
2636
|
-
for (s = [],
|
|
2637
|
-
f[
|
|
2643
|
+
for (s = [], c = 0; c < n0; c++)
|
|
2644
|
+
f[c] += e.readSVarint(), s[c] = f[c] / r0;
|
|
2638
2645
|
o.push(s), n++;
|
|
2639
2646
|
}
|
|
2640
2647
|
return a && o.push(o[0]), o;
|
|
2641
2648
|
}
|
|
2642
|
-
function
|
|
2643
|
-
return
|
|
2649
|
+
function w0(e) {
|
|
2650
|
+
return J(e, e.readVarint() + e.pos);
|
|
2644
2651
|
}
|
|
2645
|
-
function
|
|
2652
|
+
function k0(e, t) {
|
|
2646
2653
|
var i = e.readVarint() + e.pos;
|
|
2647
|
-
if (!
|
|
2648
|
-
for (var a = [], n = 0; n <
|
|
2649
|
-
return
|
|
2654
|
+
if (!F) return [J(e, i, null, t)];
|
|
2655
|
+
for (var a = [], n = 0; n < F.length; n++) a.push(J(e, i, F[n], t));
|
|
2656
|
+
return F = null, a;
|
|
2650
2657
|
}
|
|
2651
2658
|
function _e(e) {
|
|
2652
2659
|
var t = e.readVarint() + e.pos;
|
|
2653
|
-
if (!
|
|
2654
|
-
for (var i = [], a = 1, n = 0; n <
|
|
2655
|
-
for (var o = [], s = 0; s <
|
|
2656
|
-
a +=
|
|
2660
|
+
if (!F) return [[J(e, t, null, !0)]];
|
|
2661
|
+
for (var i = [], a = 1, n = 0; n < F[0]; n++) {
|
|
2662
|
+
for (var o = [], s = 0; s < F[a]; s++) o.push(J(e, t, F[a + 1 + s], !0));
|
|
2663
|
+
a += F[a] + 1, i.push(o);
|
|
2657
2664
|
}
|
|
2658
|
-
return
|
|
2665
|
+
return F = null, i;
|
|
2659
2666
|
}
|
|
2660
|
-
var Fe = ce,
|
|
2667
|
+
var Fe = ce, m0 = {};
|
|
2661
2668
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
2662
|
-
|
|
2663
|
-
var o, s,
|
|
2664
|
-
for (u +=
|
|
2669
|
+
m0.read = function(e, t, i, a, n) {
|
|
2670
|
+
var o, s, c = n * 8 - a - 1, f = (1 << c) - 1, l = f >> 1, r = -7, u = i ? n - 1 : 0, h = i ? -1 : 1, m = e[t + u];
|
|
2671
|
+
for (u += h, o = m & (1 << -r) - 1, m >>= -r, r += c; r > 0; o = o * 256 + e[t + u], u += h, r -= 8)
|
|
2665
2672
|
;
|
|
2666
|
-
for (s = o & (1 << -r) - 1, o >>= -r, r += a; r > 0; s = s * 256 + e[t + u], u +=
|
|
2673
|
+
for (s = o & (1 << -r) - 1, o >>= -r, r += a; r > 0; s = s * 256 + e[t + u], u += h, r -= 8)
|
|
2667
2674
|
;
|
|
2668
2675
|
if (o === 0)
|
|
2669
2676
|
o = 1 - l;
|
|
@@ -2674,24 +2681,24 @@ d0.read = function(e, t, i, a, n) {
|
|
|
2674
2681
|
}
|
|
2675
2682
|
return (m ? -1 : 1) * s * Math.pow(2, o - a);
|
|
2676
2683
|
};
|
|
2677
|
-
|
|
2678
|
-
var s,
|
|
2679
|
-
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (
|
|
2684
|
+
m0.write = function(e, t, i, a, n, o) {
|
|
2685
|
+
var s, c, f, l = o * 8 - n - 1, r = (1 << l) - 1, u = r >> 1, h = n === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = a ? 0 : o - 1, _ = a ? 1 : -1, v = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
|
|
2686
|
+
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (c = isNaN(t) ? 1 : 0, s = r) : (s = Math.floor(Math.log(t) / Math.LN2), t * (f = Math.pow(2, -s)) < 1 && (s--, f *= 2), s + u >= 1 ? t += h / f : t += h * Math.pow(2, 1 - u), t * f >= 2 && (s++, f /= 2), s + u >= r ? (c = 0, s = r) : s + u >= 1 ? (c = (t * f - 1) * Math.pow(2, n), s = s + u) : (c = t * Math.pow(2, u - 1) * Math.pow(2, n), s = 0)); n >= 8; e[i + m] = c & 255, m += _, c /= 256, n -= 8)
|
|
2680
2687
|
;
|
|
2681
|
-
for (s = s << n |
|
|
2688
|
+
for (s = s << n | c, l += n; l > 0; e[i + m] = s & 255, m += _, s /= 256, l -= 8)
|
|
2682
2689
|
;
|
|
2683
|
-
e[i + m -
|
|
2690
|
+
e[i + m - _] |= v * 128;
|
|
2684
2691
|
};
|
|
2685
|
-
var we =
|
|
2686
|
-
function
|
|
2692
|
+
var we = p, e0 = m0;
|
|
2693
|
+
function p(e) {
|
|
2687
2694
|
this.buf = ArrayBuffer.isView && ArrayBuffer.isView(e) ? e : new Uint8Array(e || 0), this.pos = 0, this.type = 0, this.length = this.buf.length;
|
|
2688
2695
|
}
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
var
|
|
2694
|
-
|
|
2696
|
+
p.Varint = 0;
|
|
2697
|
+
p.Fixed64 = 1;
|
|
2698
|
+
p.Bytes = 2;
|
|
2699
|
+
p.Fixed32 = 5;
|
|
2700
|
+
var d0 = 65536 * 65536, M0 = 1 / d0, ke = 12, z0 = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8");
|
|
2701
|
+
p.prototype = {
|
|
2695
2702
|
destroy: function() {
|
|
2696
2703
|
this.buf = null;
|
|
2697
2704
|
},
|
|
@@ -2707,28 +2714,28 @@ h.prototype = {
|
|
|
2707
2714
|
return this.readFields(e, t, this.readVarint() + this.pos);
|
|
2708
2715
|
},
|
|
2709
2716
|
readFixed32: function() {
|
|
2710
|
-
var e =
|
|
2717
|
+
var e = t0(this.buf, this.pos);
|
|
2711
2718
|
return this.pos += 4, e;
|
|
2712
2719
|
},
|
|
2713
2720
|
readSFixed32: function() {
|
|
2714
|
-
var e =
|
|
2721
|
+
var e = B0(this.buf, this.pos);
|
|
2715
2722
|
return this.pos += 4, e;
|
|
2716
2723
|
},
|
|
2717
2724
|
// 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)
|
|
2718
2725
|
readFixed64: function() {
|
|
2719
|
-
var e =
|
|
2726
|
+
var e = t0(this.buf, this.pos) + t0(this.buf, this.pos + 4) * d0;
|
|
2720
2727
|
return this.pos += 8, e;
|
|
2721
2728
|
},
|
|
2722
2729
|
readSFixed64: function() {
|
|
2723
|
-
var e =
|
|
2730
|
+
var e = t0(this.buf, this.pos) + B0(this.buf, this.pos + 4) * d0;
|
|
2724
2731
|
return this.pos += 8, e;
|
|
2725
2732
|
},
|
|
2726
2733
|
readFloat: function() {
|
|
2727
|
-
var e =
|
|
2734
|
+
var e = e0.read(this.buf, this.pos, !0, 23, 4);
|
|
2728
2735
|
return this.pos += 4, e;
|
|
2729
2736
|
},
|
|
2730
2737
|
readDouble: function() {
|
|
2731
|
-
var e =
|
|
2738
|
+
var e = e0.read(this.buf, this.pos, !0, 52, 8);
|
|
2732
2739
|
return this.pos += 8, e;
|
|
2733
2740
|
},
|
|
2734
2741
|
readVarint: function(e) {
|
|
@@ -2747,7 +2754,7 @@ h.prototype = {
|
|
|
2747
2754
|
},
|
|
2748
2755
|
readString: function() {
|
|
2749
2756
|
var e = this.readVarint() + this.pos, t = this.pos;
|
|
2750
|
-
return this.pos = e, e - t >= ke &&
|
|
2757
|
+
return this.pos = e, e - t >= ke && z0 ? Oe(this.buf, t, e) : Re(this.buf, t, e);
|
|
2751
2758
|
},
|
|
2752
2759
|
readBytes: function() {
|
|
2753
2760
|
var e = this.readVarint() + this.pos, t = this.buf.subarray(this.pos, e);
|
|
@@ -2755,66 +2762,66 @@ h.prototype = {
|
|
|
2755
2762
|
},
|
|
2756
2763
|
// verbose for performance reasons; doesn't affect gzipped size
|
|
2757
2764
|
readPackedVarint: function(e, t) {
|
|
2758
|
-
if (this.type !==
|
|
2765
|
+
if (this.type !== p.Bytes) return e.push(this.readVarint(t));
|
|
2759
2766
|
var i = L(this);
|
|
2760
2767
|
for (e = e || []; this.pos < i; ) e.push(this.readVarint(t));
|
|
2761
2768
|
return e;
|
|
2762
2769
|
},
|
|
2763
2770
|
readPackedSVarint: function(e) {
|
|
2764
|
-
if (this.type !==
|
|
2771
|
+
if (this.type !== p.Bytes) return e.push(this.readSVarint());
|
|
2765
2772
|
var t = L(this);
|
|
2766
2773
|
for (e = e || []; this.pos < t; ) e.push(this.readSVarint());
|
|
2767
2774
|
return e;
|
|
2768
2775
|
},
|
|
2769
2776
|
readPackedBoolean: function(e) {
|
|
2770
|
-
if (this.type !==
|
|
2777
|
+
if (this.type !== p.Bytes) return e.push(this.readBoolean());
|
|
2771
2778
|
var t = L(this);
|
|
2772
2779
|
for (e = e || []; this.pos < t; ) e.push(this.readBoolean());
|
|
2773
2780
|
return e;
|
|
2774
2781
|
},
|
|
2775
2782
|
readPackedFloat: function(e) {
|
|
2776
|
-
if (this.type !==
|
|
2783
|
+
if (this.type !== p.Bytes) return e.push(this.readFloat());
|
|
2777
2784
|
var t = L(this);
|
|
2778
2785
|
for (e = e || []; this.pos < t; ) e.push(this.readFloat());
|
|
2779
2786
|
return e;
|
|
2780
2787
|
},
|
|
2781
2788
|
readPackedDouble: function(e) {
|
|
2782
|
-
if (this.type !==
|
|
2789
|
+
if (this.type !== p.Bytes) return e.push(this.readDouble());
|
|
2783
2790
|
var t = L(this);
|
|
2784
2791
|
for (e = e || []; this.pos < t; ) e.push(this.readDouble());
|
|
2785
2792
|
return e;
|
|
2786
2793
|
},
|
|
2787
2794
|
readPackedFixed32: function(e) {
|
|
2788
|
-
if (this.type !==
|
|
2795
|
+
if (this.type !== p.Bytes) return e.push(this.readFixed32());
|
|
2789
2796
|
var t = L(this);
|
|
2790
2797
|
for (e = e || []; this.pos < t; ) e.push(this.readFixed32());
|
|
2791
2798
|
return e;
|
|
2792
2799
|
},
|
|
2793
2800
|
readPackedSFixed32: function(e) {
|
|
2794
|
-
if (this.type !==
|
|
2801
|
+
if (this.type !== p.Bytes) return e.push(this.readSFixed32());
|
|
2795
2802
|
var t = L(this);
|
|
2796
2803
|
for (e = e || []; this.pos < t; ) e.push(this.readSFixed32());
|
|
2797
2804
|
return e;
|
|
2798
2805
|
},
|
|
2799
2806
|
readPackedFixed64: function(e) {
|
|
2800
|
-
if (this.type !==
|
|
2807
|
+
if (this.type !== p.Bytes) return e.push(this.readFixed64());
|
|
2801
2808
|
var t = L(this);
|
|
2802
2809
|
for (e = e || []; this.pos < t; ) e.push(this.readFixed64());
|
|
2803
2810
|
return e;
|
|
2804
2811
|
},
|
|
2805
2812
|
readPackedSFixed64: function(e) {
|
|
2806
|
-
if (this.type !==
|
|
2813
|
+
if (this.type !== p.Bytes) return e.push(this.readSFixed64());
|
|
2807
2814
|
var t = L(this);
|
|
2808
2815
|
for (e = e || []; this.pos < t; ) e.push(this.readSFixed64());
|
|
2809
2816
|
return e;
|
|
2810
2817
|
},
|
|
2811
2818
|
skip: function(e) {
|
|
2812
2819
|
var t = e & 7;
|
|
2813
|
-
if (t ===
|
|
2820
|
+
if (t === p.Varint) for (; this.buf[this.pos++] > 127; )
|
|
2814
2821
|
;
|
|
2815
|
-
else if (t ===
|
|
2816
|
-
else if (t ===
|
|
2817
|
-
else if (t ===
|
|
2822
|
+
else if (t === p.Bytes) this.pos = this.readVarint() + this.pos;
|
|
2823
|
+
else if (t === p.Fixed32) this.pos += 4;
|
|
2824
|
+
else if (t === p.Fixed64) this.pos += 8;
|
|
2818
2825
|
else throw new Error("Unimplemented type: " + t);
|
|
2819
2826
|
},
|
|
2820
2827
|
// === WRITING =================================================================
|
|
@@ -2832,16 +2839,16 @@ h.prototype = {
|
|
|
2832
2839
|
return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length);
|
|
2833
2840
|
},
|
|
2834
2841
|
writeFixed32: function(e) {
|
|
2835
|
-
this.realloc(4),
|
|
2842
|
+
this.realloc(4), $(this.buf, e, this.pos), this.pos += 4;
|
|
2836
2843
|
},
|
|
2837
2844
|
writeSFixed32: function(e) {
|
|
2838
|
-
this.realloc(4),
|
|
2845
|
+
this.realloc(4), $(this.buf, e, this.pos), this.pos += 4;
|
|
2839
2846
|
},
|
|
2840
2847
|
writeFixed64: function(e) {
|
|
2841
|
-
this.realloc(8),
|
|
2848
|
+
this.realloc(8), $(this.buf, e & -1, this.pos), $(this.buf, Math.floor(e * M0), this.pos + 4), this.pos += 8;
|
|
2842
2849
|
},
|
|
2843
2850
|
writeSFixed64: function(e) {
|
|
2844
|
-
this.realloc(8),
|
|
2851
|
+
this.realloc(8), $(this.buf, e & -1, this.pos), $(this.buf, Math.floor(e * M0), this.pos + 4), this.pos += 8;
|
|
2845
2852
|
},
|
|
2846
2853
|
writeVarint: function(e) {
|
|
2847
2854
|
if (e = +e || 0, e > 268435455 || e < 0) {
|
|
@@ -2861,13 +2868,13 @@ h.prototype = {
|
|
|
2861
2868
|
var t = this.pos;
|
|
2862
2869
|
this.pos = Ee(this.buf, e, this.pos);
|
|
2863
2870
|
var i = this.pos - t;
|
|
2864
|
-
i >= 128 &&
|
|
2871
|
+
i >= 128 && L0(t, i, this), this.pos = t - 1, this.writeVarint(i), this.pos += i;
|
|
2865
2872
|
},
|
|
2866
2873
|
writeFloat: function(e) {
|
|
2867
|
-
this.realloc(4),
|
|
2874
|
+
this.realloc(4), e0.write(this.buf, e, this.pos, !0, 23, 4), this.pos += 4;
|
|
2868
2875
|
},
|
|
2869
2876
|
writeDouble: function(e) {
|
|
2870
|
-
this.realloc(8),
|
|
2877
|
+
this.realloc(8), e0.write(this.buf, e, this.pos, !0, 52, 8), this.pos += 8;
|
|
2871
2878
|
},
|
|
2872
2879
|
writeBytes: function(e) {
|
|
2873
2880
|
var t = e.length;
|
|
@@ -2879,10 +2886,10 @@ h.prototype = {
|
|
|
2879
2886
|
var i = this.pos;
|
|
2880
2887
|
e(t, this);
|
|
2881
2888
|
var a = this.pos - i;
|
|
2882
|
-
a >= 128 &&
|
|
2889
|
+
a >= 128 && L0(i, a, this), this.pos = i - 1, this.writeVarint(a), this.pos += a;
|
|
2883
2890
|
},
|
|
2884
2891
|
writeMessage: function(e, t, i) {
|
|
2885
|
-
this.writeTag(e,
|
|
2892
|
+
this.writeTag(e, p.Bytes), this.writeRawMessage(t, i);
|
|
2886
2893
|
},
|
|
2887
2894
|
writePackedVarint: function(e, t) {
|
|
2888
2895
|
t.length && this.writeMessage(e, Se, t);
|
|
@@ -2912,34 +2919,34 @@ h.prototype = {
|
|
|
2912
2919
|
t.length && this.writeMessage(e, Ie, t);
|
|
2913
2920
|
},
|
|
2914
2921
|
writeBytesField: function(e, t) {
|
|
2915
|
-
this.writeTag(e,
|
|
2922
|
+
this.writeTag(e, p.Bytes), this.writeBytes(t);
|
|
2916
2923
|
},
|
|
2917
2924
|
writeFixed32Field: function(e, t) {
|
|
2918
|
-
this.writeTag(e,
|
|
2925
|
+
this.writeTag(e, p.Fixed32), this.writeFixed32(t);
|
|
2919
2926
|
},
|
|
2920
2927
|
writeSFixed32Field: function(e, t) {
|
|
2921
|
-
this.writeTag(e,
|
|
2928
|
+
this.writeTag(e, p.Fixed32), this.writeSFixed32(t);
|
|
2922
2929
|
},
|
|
2923
2930
|
writeFixed64Field: function(e, t) {
|
|
2924
|
-
this.writeTag(e,
|
|
2931
|
+
this.writeTag(e, p.Fixed64), this.writeFixed64(t);
|
|
2925
2932
|
},
|
|
2926
2933
|
writeSFixed64Field: function(e, t) {
|
|
2927
|
-
this.writeTag(e,
|
|
2934
|
+
this.writeTag(e, p.Fixed64), this.writeSFixed64(t);
|
|
2928
2935
|
},
|
|
2929
2936
|
writeVarintField: function(e, t) {
|
|
2930
|
-
this.writeTag(e,
|
|
2937
|
+
this.writeTag(e, p.Varint), this.writeVarint(t);
|
|
2931
2938
|
},
|
|
2932
2939
|
writeSVarintField: function(e, t) {
|
|
2933
|
-
this.writeTag(e,
|
|
2940
|
+
this.writeTag(e, p.Varint), this.writeSVarint(t);
|
|
2934
2941
|
},
|
|
2935
2942
|
writeStringField: function(e, t) {
|
|
2936
|
-
this.writeTag(e,
|
|
2943
|
+
this.writeTag(e, p.Bytes), this.writeString(t);
|
|
2937
2944
|
},
|
|
2938
2945
|
writeFloatField: function(e, t) {
|
|
2939
|
-
this.writeTag(e,
|
|
2946
|
+
this.writeTag(e, p.Fixed32), this.writeFloat(t);
|
|
2940
2947
|
},
|
|
2941
2948
|
writeDoubleField: function(e, t) {
|
|
2942
|
-
this.writeTag(e,
|
|
2949
|
+
this.writeTag(e, p.Fixed64), this.writeDouble(t);
|
|
2943
2950
|
},
|
|
2944
2951
|
writeBooleanField: function(e, t) {
|
|
2945
2952
|
this.writeVarintField(e, !!t);
|
|
@@ -2947,13 +2954,13 @@ h.prototype = {
|
|
|
2947
2954
|
};
|
|
2948
2955
|
function Me(e, t, i) {
|
|
2949
2956
|
var a = i.buf, n, o;
|
|
2950
|
-
if (o = a[i.pos++], n = (o & 112) >> 4, o < 128 || (o = a[i.pos++], n |= (o & 127) << 3, o < 128) || (o = a[i.pos++], n |= (o & 127) << 10, o < 128) || (o = a[i.pos++], n |= (o & 127) << 17, o < 128) || (o = a[i.pos++], n |= (o & 127) << 24, o < 128) || (o = a[i.pos++], n |= (o & 1) << 31, o < 128)) return
|
|
2957
|
+
if (o = a[i.pos++], n = (o & 112) >> 4, o < 128 || (o = a[i.pos++], n |= (o & 127) << 3, o < 128) || (o = a[i.pos++], n |= (o & 127) << 10, o < 128) || (o = a[i.pos++], n |= (o & 127) << 17, o < 128) || (o = a[i.pos++], n |= (o & 127) << 24, o < 128) || (o = a[i.pos++], n |= (o & 1) << 31, o < 128)) return A(e, n, t);
|
|
2951
2958
|
throw new Error("Expected varint not more than 10 bytes");
|
|
2952
2959
|
}
|
|
2953
2960
|
function L(e) {
|
|
2954
|
-
return e.type ===
|
|
2961
|
+
return e.type === p.Bytes ? e.readVarint() + e.pos : e.pos + 1;
|
|
2955
2962
|
}
|
|
2956
|
-
function
|
|
2963
|
+
function A(e, t, i) {
|
|
2957
2964
|
return i ? t * 4294967296 + (e >>> 0) : (t >>> 0) * 4294967296 + (e >>> 0);
|
|
2958
2965
|
}
|
|
2959
2966
|
function Le(e, t) {
|
|
@@ -2969,7 +2976,7 @@ function Pe(e, t) {
|
|
|
2969
2976
|
var i = (e & 7) << 4;
|
|
2970
2977
|
t.buf[t.pos++] |= i | ((e >>>= 3) ? 128 : 0), e && (t.buf[t.pos++] = e & 127 | ((e >>>= 7) ? 128 : 0), e && (t.buf[t.pos++] = e & 127 | ((e >>>= 7) ? 128 : 0), e && (t.buf[t.pos++] = e & 127 | ((e >>>= 7) ? 128 : 0), e && (t.buf[t.pos++] = e & 127 | ((e >>>= 7) ? 128 : 0), e && (t.buf[t.pos++] = e & 127)))));
|
|
2971
2978
|
}
|
|
2972
|
-
function
|
|
2979
|
+
function L0(e, t, i) {
|
|
2973
2980
|
var a = t <= 16383 ? 1 : t <= 2097151 ? 2 : t <= 268435455 ? 3 : Math.floor(Math.log(t) / (Math.LN2 * 7));
|
|
2974
2981
|
i.realloc(a);
|
|
2975
2982
|
for (var n = i.pos - 1; n >= e; n--) i.buf[n + a] = i.buf[n];
|
|
@@ -3001,26 +3008,26 @@ function Ue(e, t) {
|
|
|
3001
3008
|
function Ie(e, t) {
|
|
3002
3009
|
for (var i = 0; i < e.length; i++) t.writeSFixed64(e[i]);
|
|
3003
3010
|
}
|
|
3004
|
-
function
|
|
3011
|
+
function t0(e, t) {
|
|
3005
3012
|
return (e[t] | e[t + 1] << 8 | e[t + 2] << 16) + e[t + 3] * 16777216;
|
|
3006
3013
|
}
|
|
3007
|
-
function
|
|
3014
|
+
function $(e, t, i) {
|
|
3008
3015
|
e[i] = t, e[i + 1] = t >>> 8, e[i + 2] = t >>> 16, e[i + 3] = t >>> 24;
|
|
3009
3016
|
}
|
|
3010
|
-
function
|
|
3017
|
+
function B0(e, t) {
|
|
3011
3018
|
return (e[t] | e[t + 1] << 8 | e[t + 2] << 16) + (e[t + 3] << 24);
|
|
3012
3019
|
}
|
|
3013
3020
|
function Re(e, t, i) {
|
|
3014
3021
|
for (var a = "", n = t; n < i; ) {
|
|
3015
|
-
var o = e[n], s = null,
|
|
3016
|
-
if (n +
|
|
3022
|
+
var o = e[n], s = null, c = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
|
|
3023
|
+
if (n + c > i) break;
|
|
3017
3024
|
var f, l, r;
|
|
3018
|
-
|
|
3025
|
+
c === 1 ? o < 128 && (s = o) : c === 2 ? (f = e[n + 1], (f & 192) === 128 && (s = (o & 31) << 6 | f & 63, s <= 127 && (s = null))) : c === 3 ? (f = e[n + 1], l = e[n + 2], (f & 192) === 128 && (l & 192) === 128 && (s = (o & 15) << 12 | (f & 63) << 6 | l & 63, (s <= 2047 || s >= 55296 && s <= 57343) && (s = null))) : c === 4 && (f = e[n + 1], l = e[n + 2], r = e[n + 3], (f & 192) === 128 && (l & 192) === 128 && (r & 192) === 128 && (s = (o & 15) << 18 | (f & 63) << 12 | (l & 63) << 6 | r & 63, (s <= 65535 || s >= 1114112) && (s = null))), s === null ? (s = 65533, c = 1) : s > 65535 && (s -= 65536, a += String.fromCharCode(s >>> 10 & 1023 | 55296), s = 56320 | s & 1023), a += String.fromCharCode(s), n += c;
|
|
3019
3026
|
}
|
|
3020
3027
|
return a;
|
|
3021
3028
|
}
|
|
3022
3029
|
function Oe(e, t, i) {
|
|
3023
|
-
return
|
|
3030
|
+
return z0.decode(e.subarray(t, i));
|
|
3024
3031
|
}
|
|
3025
3032
|
function Ee(e, t, i) {
|
|
3026
3033
|
for (var a = 0, n, o; a < t.length; a++) {
|
|
@@ -3040,15 +3047,15 @@ function Ee(e, t, i) {
|
|
|
3040
3047
|
}
|
|
3041
3048
|
return i;
|
|
3042
3049
|
}
|
|
3043
|
-
const Ae = /* @__PURE__ */
|
|
3050
|
+
const Ae = /* @__PURE__ */ P0(we), u1 = (e) => {
|
|
3044
3051
|
var a, n;
|
|
3045
3052
|
if (!e || !e.data)
|
|
3046
3053
|
return {};
|
|
3047
3054
|
const t = {}, i = e.data;
|
|
3048
3055
|
if (i)
|
|
3049
3056
|
for (const o of i) {
|
|
3050
|
-
const s = (a = o == null ? void 0 : o.event) == null ? void 0 : a.country_code,
|
|
3051
|
-
s && (t[s] =
|
|
3057
|
+
const s = (a = o == null ? void 0 : o.event) == null ? void 0 : a.country_code, c = (n = e.meta.metric_names) == null ? void 0 : n[0];
|
|
3058
|
+
s && (t[s] = c ? o.event[c] : 0);
|
|
3052
3059
|
}
|
|
3053
3060
|
return t;
|
|
3054
3061
|
};
|
|
@@ -3061,7 +3068,7 @@ function $e(e, t = 0) {
|
|
|
3061
3068
|
const Ge = { class: "legend" }, qe = {
|
|
3062
3069
|
key: 0,
|
|
3063
3070
|
class: "legend-title"
|
|
3064
|
-
}, He = { class: "legend-text" }, Ke = /* @__PURE__ */
|
|
3071
|
+
}, He = { class: "legend-text" }, Ke = /* @__PURE__ */ f0({
|
|
3065
3072
|
__name: "MapLegend",
|
|
3066
3073
|
props: {
|
|
3067
3074
|
metric: {},
|
|
@@ -3070,25 +3077,25 @@ const Ge = { class: "legend" }, qe = {
|
|
|
3070
3077
|
},
|
|
3071
3078
|
setup(e) {
|
|
3072
3079
|
return (t, i) => (M(), T("div", Ge, [
|
|
3073
|
-
t.metric ? (M(), T("div", qe,
|
|
3074
|
-
(M(!0), T(
|
|
3080
|
+
t.metric ? (M(), T("div", qe, R(t.title), 1)) : W("", !0),
|
|
3081
|
+
(M(!0), T(I0, null, R0(t.data, (a, n) => (M(), T("div", {
|
|
3075
3082
|
key: n,
|
|
3076
3083
|
class: "legend-item"
|
|
3077
3084
|
}, [
|
|
3078
3085
|
B("span", {
|
|
3079
3086
|
class: "legend-color",
|
|
3080
|
-
style:
|
|
3087
|
+
style: O0({ backgroundColor: a.color })
|
|
3081
3088
|
}, null, 4),
|
|
3082
|
-
B("span", He,
|
|
3089
|
+
B("span", He, R(a.range), 1)
|
|
3083
3090
|
]))), 128))
|
|
3084
3091
|
]));
|
|
3085
3092
|
}
|
|
3086
|
-
}),
|
|
3093
|
+
}), y0 = (e, t) => {
|
|
3087
3094
|
const i = e.__vccOpts || e;
|
|
3088
3095
|
for (const [a, n] of t)
|
|
3089
3096
|
i[a] = n;
|
|
3090
3097
|
return i;
|
|
3091
|
-
}, je = /* @__PURE__ */
|
|
3098
|
+
}, je = /* @__PURE__ */ y0(Ke, [["__scopeId", "data-v-5f034736"]]), We = { class: "map-tooltip" }, Ze = { class: "map-tooltip-text" }, Je = { key: 0 }, Xe = /* @__PURE__ */ f0({
|
|
3092
3099
|
__name: "MapTooltip",
|
|
3093
3100
|
props: {
|
|
3094
3101
|
data: {},
|
|
@@ -3097,22 +3104,22 @@ const Ge = { class: "legend" }, qe = {
|
|
|
3097
3104
|
left: {}
|
|
3098
3105
|
},
|
|
3099
3106
|
setup(e) {
|
|
3100
|
-
return
|
|
3107
|
+
return E0((t) => ({
|
|
3101
3108
|
"55ff282a": t.left,
|
|
3102
3109
|
"23ce2e1e": t.top,
|
|
3103
3110
|
"011f7503": t.data.color
|
|
3104
3111
|
})), (t, i) => (M(), T("div", We, [
|
|
3105
3112
|
i[0] || (i[0] = B("div", { class: "map-tooltip-color" }, null, -1)),
|
|
3106
3113
|
B("div", Ze, [
|
|
3107
|
-
B("div", null,
|
|
3108
|
-
t.showValue ? (M(), T("span", Je,
|
|
3114
|
+
B("div", null, R(t.data.label), 1),
|
|
3115
|
+
t.showValue ? (M(), T("span", Je, R(t.data.value) + " " + R(t.data.unit), 1)) : W("", !0)
|
|
3109
3116
|
])
|
|
3110
3117
|
]));
|
|
3111
3118
|
}
|
|
3112
|
-
}), Qe = /* @__PURE__ */
|
|
3119
|
+
}), Qe = /* @__PURE__ */ y0(Xe, [["__scopeId", "data-v-5e8af715"]]), Ye = { class: "kong-ui-public-analytics-geo-map" }, be = {
|
|
3113
3120
|
key: 0,
|
|
3114
3121
|
class: "no-location-overlay"
|
|
3115
|
-
}, e1 = { class: "no-location-overlay-title" }, t1 = { class: "no-location-overlay-description" }, i1 = ["id"], n1 = /* @__PURE__ */
|
|
3122
|
+
}, e1 = { class: "no-location-overlay-title" }, t1 = { class: "no-location-overlay-description" }, i1 = ["id"], n1 = /* @__PURE__ */ f0({
|
|
3116
3123
|
__name: "AnalyticsGeoMap",
|
|
3117
3124
|
props: {
|
|
3118
3125
|
countryMetrics: {},
|
|
@@ -3127,10 +3134,10 @@ const Ge = { class: "legend" }, qe = {
|
|
|
3127
3134
|
},
|
|
3128
3135
|
emits: ["boundsChange"],
|
|
3129
3136
|
setup(e, { emit: t }) {
|
|
3130
|
-
const i = import("./countries-simple-geo-BFUDnSiE.js").then((
|
|
3131
|
-
countryMetrics:
|
|
3132
|
-
metric:
|
|
3133
|
-
}), f =
|
|
3137
|
+
const i = import("./countries-simple-geo-BFUDnSiE.js").then((d) => d.default), a = t, { i18n: n } = F0.useI18n(), { getColor: o, formatMetric: s, legendData: c } = F0.useMetricUtils({
|
|
3138
|
+
countryMetrics: v0(() => e.countryMetrics),
|
|
3139
|
+
metric: v0(() => e.metric)
|
|
3140
|
+
}), f = j(), l = A0(), r = j(), u = j(null), h = j({ left: "0px", top: "0px" }), m = j(!1), _ = k(() => Object.keys(e.countryMetrics).length === 0 && !e.fitToCountry), v = k(() => ({
|
|
3134
3141
|
"fill-color": [
|
|
3135
3142
|
"match",
|
|
3136
3143
|
[
|
|
@@ -3143,59 +3150,59 @@ const Ge = { class: "legend" }, qe = {
|
|
|
3143
3150
|
],
|
|
3144
3151
|
["get", "ISO_A2"]
|
|
3145
3152
|
],
|
|
3146
|
-
...Object.keys(e.countryMetrics).length ? Object.entries(e.countryMetrics).flatMap(([
|
|
3147
|
-
|
|
3153
|
+
...Object.keys(e.countryMetrics).length ? Object.entries(e.countryMetrics).flatMap(([d, y]) => [
|
|
3154
|
+
d,
|
|
3148
3155
|
o(y)
|
|
3149
|
-
]) : [
|
|
3150
|
-
|
|
3156
|
+
]) : [Z, Z],
|
|
3157
|
+
Z
|
|
3151
3158
|
// default color if no match
|
|
3152
3159
|
],
|
|
3153
3160
|
"fill-opacity": 0.7
|
|
3154
|
-
})),
|
|
3155
|
-
const y =
|
|
3156
|
-
return Array.isArray(y[0]) && Array.isArray(y[0][0]) ?
|
|
3157
|
-
},
|
|
3158
|
-
var x,
|
|
3159
|
-
if (
|
|
3161
|
+
})), o0 = k(() => e.withLegend && Object.keys(e.countryMetrics).length > 0), C = k(() => e.metric && n.t(`metrics.${e.metric}`) || ""), X = (d) => {
|
|
3162
|
+
const y = d.flat(1);
|
|
3163
|
+
return Array.isArray(y[0]) && Array.isArray(y[0][0]) ? X(y) : y;
|
|
3164
|
+
}, x0 = (d) => {
|
|
3165
|
+
var x, g, q, O, N, H, K;
|
|
3166
|
+
if (d === "RU") {
|
|
3160
3167
|
(x = r.value) == null || x.fitBounds([
|
|
3161
3168
|
[20, 40],
|
|
3162
3169
|
[180, 80]
|
|
3163
3170
|
]);
|
|
3164
3171
|
return;
|
|
3165
|
-
} else if (
|
|
3166
|
-
(
|
|
3172
|
+
} else if (d === "US") {
|
|
3173
|
+
(g = r.value) == null || g.fitBounds([
|
|
3167
3174
|
[-130, 20],
|
|
3168
3175
|
[-60, 50]
|
|
3169
3176
|
]);
|
|
3170
3177
|
return;
|
|
3171
|
-
} else if (
|
|
3172
|
-
(
|
|
3178
|
+
} else if (d === "FR") {
|
|
3179
|
+
(q = r.value) == null || q.fitBounds([
|
|
3173
3180
|
[-5, 42],
|
|
3174
3181
|
[9, 51]
|
|
3175
3182
|
]);
|
|
3176
3183
|
return;
|
|
3177
|
-
} else if (
|
|
3178
|
-
(
|
|
3184
|
+
} else if (d === "NO") {
|
|
3185
|
+
(O = r.value) == null || O.fitBounds([
|
|
3179
3186
|
[4, 57],
|
|
3180
3187
|
[32, 71]
|
|
3181
3188
|
]);
|
|
3182
3189
|
return;
|
|
3183
3190
|
}
|
|
3184
|
-
const y = (
|
|
3185
|
-
var P, S, V,
|
|
3186
|
-
return (P =
|
|
3191
|
+
const y = (N = u.value) == null ? void 0 : N.features.find((w) => {
|
|
3192
|
+
var P, S, V, U, z;
|
|
3193
|
+
return (P = w.properties) != null && P.ISO_A2 ? ((S = w.properties) == null ? void 0 : S.ISO_A2) === d : ((V = w.properties) == null ? void 0 : V.iso_a2) === "-99" ? ((U = w.properties) == null ? void 0 : U.iso_a2_eh) === d : ((z = w.properties) == null ? void 0 : z.iso_a2) === d;
|
|
3187
3194
|
});
|
|
3188
3195
|
if (y) {
|
|
3189
|
-
const
|
|
3190
|
-
if (!
|
|
3191
|
-
const P =
|
|
3192
|
-
(
|
|
3193
|
-
[
|
|
3194
|
-
[
|
|
3196
|
+
const w = (H = y.geometry) == null ? void 0 : H.coordinates;
|
|
3197
|
+
if (!w) return;
|
|
3198
|
+
const P = X(w), S = P.map((E) => E[1]), V = P.map((E) => E[0]), U = Math.min(...S), z = Math.max(...S), Q = Math.min(...V), Y = Math.max(...V);
|
|
3199
|
+
(K = r.value) == null || K.fitBounds([
|
|
3200
|
+
[Q, U],
|
|
3201
|
+
[Y, z]
|
|
3195
3202
|
]);
|
|
3196
3203
|
}
|
|
3197
|
-
},
|
|
3198
|
-
const
|
|
3204
|
+
}, D = k(() => {
|
|
3205
|
+
const d = {
|
|
3199
3206
|
container: l,
|
|
3200
3207
|
style: { version: 8, sources: {}, layers: [] },
|
|
3201
3208
|
attributionControl: !1,
|
|
@@ -3212,30 +3219,30 @@ const Ge = { class: "legend" }, qe = {
|
|
|
3212
3219
|
"CooperativeGesturesHandler.MobileHelpText": n.t("cooperative_gestures.mobile_zoom_help_text")
|
|
3213
3220
|
}
|
|
3214
3221
|
};
|
|
3215
|
-
return e.bounds && (
|
|
3216
|
-
}),
|
|
3222
|
+
return e.bounds && (d.bounds = e.bounds), d;
|
|
3223
|
+
}), T0 = $e(() => {
|
|
3217
3224
|
if (!r.value) return;
|
|
3218
|
-
const
|
|
3225
|
+
const d = r.value.getBounds(), y = d.getSouthWest(), x = d.getNorthEast();
|
|
3219
3226
|
a("boundsChange", [
|
|
3220
3227
|
[y.lng, y.lat],
|
|
3221
3228
|
[x.lng, x.lat]
|
|
3222
3229
|
]);
|
|
3223
3230
|
}, 300);
|
|
3224
|
-
return
|
|
3225
|
-
var
|
|
3231
|
+
return $0(async () => {
|
|
3232
|
+
var d, y, x;
|
|
3226
3233
|
try {
|
|
3227
|
-
const
|
|
3228
|
-
u.value =
|
|
3229
|
-
var
|
|
3230
|
-
(
|
|
3234
|
+
const g = await i, q = await fetch(g), O = new Uint8Array(await q.arrayBuffer()), N = Fe(new Ae(O));
|
|
3235
|
+
u.value = N, r.value = new H0(D.value), r.value.on("load", () => {
|
|
3236
|
+
var H, K, w, P, S, V, U;
|
|
3237
|
+
(H = r.value) == null || H.addSource("countries", {
|
|
3231
3238
|
type: "geojson",
|
|
3232
|
-
data:
|
|
3233
|
-
}), (
|
|
3239
|
+
data: N
|
|
3240
|
+
}), (K = r.value) == null || K.addLayer({
|
|
3234
3241
|
id: "countries-layer",
|
|
3235
3242
|
type: "fill",
|
|
3236
3243
|
source: "countries",
|
|
3237
|
-
paint:
|
|
3238
|
-
}), (
|
|
3244
|
+
paint: v.value
|
|
3245
|
+
}), (w = r.value) == null || w.addSource("lakes", {
|
|
3239
3246
|
type: "geojson",
|
|
3240
3247
|
data: ue
|
|
3241
3248
|
}), (P = r.value) == null || P.addLayer({
|
|
@@ -3246,35 +3253,35 @@ const Ge = { class: "legend" }, qe = {
|
|
|
3246
3253
|
"fill-color": "#FFFFFF"
|
|
3247
3254
|
}
|
|
3248
3255
|
}), (S = r.value) == null || S.on("mousemove", "countries-layer", (z) => {
|
|
3249
|
-
var
|
|
3250
|
-
const
|
|
3251
|
-
if (
|
|
3252
|
-
const { iso_a2:
|
|
3253
|
-
|
|
3254
|
-
label:
|
|
3255
|
-
color: o(
|
|
3256
|
-
value: s(
|
|
3257
|
-
unit: n.t(`metricUnits.${e.metricUnit}`, { plural:
|
|
3258
|
-
}, m.value = !0,
|
|
3256
|
+
var Y;
|
|
3257
|
+
const Q = (Y = z.features) == null ? void 0 : Y[0];
|
|
3258
|
+
if (Q) {
|
|
3259
|
+
const { iso_a2: E, iso_a2_eh: C0, ISO_A2: D0, admin: N0 } = Q.properties, U0 = D0 ?? E === "-99" ? C0 : E, b = e.countryMetrics[U0];
|
|
3260
|
+
b !== void 0 && (f.value = {
|
|
3261
|
+
label: N0,
|
|
3262
|
+
color: o(b),
|
|
3263
|
+
value: s(b),
|
|
3264
|
+
unit: n.t(`metricUnits.${e.metricUnit}`, { plural: b > 1 ? "s" : "" })
|
|
3265
|
+
}, m.value = !0, h.value = {
|
|
3259
3266
|
left: `${z.point.x}px`,
|
|
3260
3267
|
top: `${z.point.y}px`
|
|
3261
3268
|
});
|
|
3262
3269
|
}
|
|
3263
3270
|
}), (V = r.value) == null || V.on("mouseleave", "countries-layer", () => {
|
|
3264
3271
|
m.value = !1;
|
|
3265
|
-
}), (
|
|
3266
|
-
}), (
|
|
3267
|
-
} catch (
|
|
3268
|
-
console.error(
|
|
3272
|
+
}), (U = r.value) == null || U.on("move", T0), e.fitToCountry && x0(e.fitToCountry);
|
|
3273
|
+
}), (d = r.value) == null || d.dragRotate.disable(), (y = r.value) == null || y.keyboard.disable(), (x = r.value) == null || x.touchZoomRotate.disableRotation();
|
|
3274
|
+
} catch (g) {
|
|
3275
|
+
console.error(g);
|
|
3269
3276
|
}
|
|
3270
|
-
}),
|
|
3271
|
-
var
|
|
3277
|
+
}), s0(() => e.countryMetrics, () => {
|
|
3278
|
+
var d;
|
|
3272
3279
|
r.value && r.value.isStyleLoaded() && (r.value.getLayer("countries-layer") && r.value.removeLayer("countries-layer"), r.value.addLayer({
|
|
3273
3280
|
id: "countries-layer",
|
|
3274
3281
|
type: "fill",
|
|
3275
3282
|
source: "countries",
|
|
3276
|
-
paint:
|
|
3277
|
-
}), r.value.removeLayer("lakes-layer"), (
|
|
3283
|
+
paint: v.value
|
|
3284
|
+
}), r.value.removeLayer("lakes-layer"), (d = r.value) == null || d.addLayer({
|
|
3278
3285
|
id: "lakes-layer",
|
|
3279
3286
|
type: "fill",
|
|
3280
3287
|
source: "lakes",
|
|
@@ -3282,56 +3289,56 @@ const Ge = { class: "legend" }, qe = {
|
|
|
3282
3289
|
"fill-color": "#FFFFFF"
|
|
3283
3290
|
}
|
|
3284
3291
|
}));
|
|
3285
|
-
}),
|
|
3286
|
-
var y, x,
|
|
3287
|
-
r.value &&
|
|
3292
|
+
}), s0(() => e.fitToCountry, (d) => {
|
|
3293
|
+
var y, x, g;
|
|
3294
|
+
r.value && d ? x0(d) : !D.value.center && !D.value.zoom ? (y = r.value) == null || y.fitBounds([
|
|
3288
3295
|
[-180, -90],
|
|
3289
3296
|
[180, 90]
|
|
3290
|
-
]) : (
|
|
3291
|
-
}),
|
|
3292
|
-
if (!
|
|
3293
|
-
const x =
|
|
3294
|
-
!(x &&
|
|
3295
|
-
}), (
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
color:
|
|
3300
|
-
size:
|
|
3297
|
+
]) : (D.value.zoom && ((x = r.value) == null || x.setZoom(D.value.zoom)), D.value.center && ((g = r.value) == null || g.flyTo({ center: D.value.center })));
|
|
3298
|
+
}), s0(() => e.bounds, (d, y) => {
|
|
3299
|
+
if (!d) return;
|
|
3300
|
+
const x = d == null ? void 0 : d.flat(), g = y == null ? void 0 : y.flat();
|
|
3301
|
+
!(x && g && x.length === g.length && x.every((O, N) => Math.round(O * 100) / 100 === Math.round(g[N] * 100) / 100)) && r.value && r.value.fitBounds(d);
|
|
3302
|
+
}), (d, y) => (M(), T("div", Ye, [
|
|
3303
|
+
_.value ? (M(), T("div", be, [
|
|
3304
|
+
l0(d.$slots, "no-location-icon", {}, () => [
|
|
3305
|
+
G0(I(W0), {
|
|
3306
|
+
color: I(ne),
|
|
3307
|
+
size: I(ae)
|
|
3301
3308
|
}, null, 8, ["color", "size"])
|
|
3302
3309
|
], !0),
|
|
3303
3310
|
B("div", e1, [
|
|
3304
|
-
|
|
3305
|
-
|
|
3311
|
+
l0(d.$slots, "no-location-title", {}, () => [
|
|
3312
|
+
q0(R(I(n).t("no_location_data")), 1)
|
|
3306
3313
|
], !0)
|
|
3307
3314
|
]),
|
|
3308
3315
|
B("div", t1, [
|
|
3309
|
-
|
|
3310
|
-
B("p", null, I(
|
|
3316
|
+
l0(d.$slots, "no-location-description", {}, () => [
|
|
3317
|
+
B("p", null, R(I(n).t("no_location_data_description")), 1)
|
|
3311
3318
|
], !0)
|
|
3312
3319
|
])
|
|
3313
|
-
])) :
|
|
3320
|
+
])) : W("", !0),
|
|
3314
3321
|
B("div", {
|
|
3315
|
-
id:
|
|
3322
|
+
id: I(l),
|
|
3316
3323
|
class: "analytics-geo-map-container"
|
|
3317
3324
|
}, null, 8, i1),
|
|
3318
|
-
|
|
3325
|
+
o0.value ? (M(), g0(je, {
|
|
3319
3326
|
key: 1,
|
|
3320
3327
|
class: "legend-container",
|
|
3321
|
-
data:
|
|
3322
|
-
metric:
|
|
3323
|
-
title:
|
|
3324
|
-
}, null, 8, ["data", "metric", "title"])) :
|
|
3325
|
-
m.value && f.value ? (M(),
|
|
3328
|
+
data: I(c),
|
|
3329
|
+
metric: d.metric,
|
|
3330
|
+
title: C.value
|
|
3331
|
+
}, null, 8, ["data", "metric", "title"])) : W("", !0),
|
|
3332
|
+
m.value && f.value ? (M(), g0(Qe, {
|
|
3326
3333
|
key: 2,
|
|
3327
3334
|
data: f.value,
|
|
3328
|
-
left:
|
|
3329
|
-
"show-value":
|
|
3330
|
-
top:
|
|
3331
|
-
}, null, 8, ["data", "left", "show-value", "top"])) :
|
|
3335
|
+
left: h.value.left,
|
|
3336
|
+
"show-value": d.showTooltipValue,
|
|
3337
|
+
top: h.value.top
|
|
3338
|
+
}, null, 8, ["data", "left", "show-value", "top"])) : W("", !0)
|
|
3332
3339
|
]));
|
|
3333
3340
|
}
|
|
3334
|
-
}), c1 = /* @__PURE__ */
|
|
3341
|
+
}), c1 = /* @__PURE__ */ y0(n1, [["__scopeId", "data-v-f8b9de28"]]);
|
|
3335
3342
|
export {
|
|
3336
3343
|
c1 as AnalyticsGeoMap,
|
|
3337
3344
|
$e as debounce,
|