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