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