@kong-ui-public/analytics-metric-provider 1.1.19 → 1.1.20
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,144 +1,544 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { createI18n as
|
|
3
|
-
var
|
|
4
|
-
|
|
1
|
+
import { ref as De, watchEffect as Dt, computed as E, getCurrentInstance as Et, reactive as wt, onMounted as St, onUnmounted as Rt, watch as _t, isReadonly as It, toRefs as Nt, defineComponent as se, toRef as He, provide as Ct, renderSlot as st, resolveComponent as ee, openBlock as S, createElementBlock as M, normalizeClass as te, unref as B, createVNode as z, toDisplayString as q, createCommentVNode as X, Fragment as Ve, renderList as At, createBlock as re, mergeProps as Mt, createElementVNode as K, withCtx as bt, normalizeStyle as Ot, inject as Ut, normalizeProps as Yt, guardReactiveProps as xt } from "vue";
|
|
2
|
+
import { createI18n as Lt, i18nTComponent as Pt } from "@kong-ui-public/i18n";
|
|
3
|
+
var Ft = Object.defineProperty, kt = (e, t, r) => t in e ? Ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, I = (e, t, r) => (kt(e, typeof t != "symbol" ? t + "" : t, r), r), v = /* @__PURE__ */ ((e) => (e.MINUTELY = "Minutely", e.HOURLY = "Hourly", e.DAILY = "Daily", e.WEEKLY = "Weekly", e))(v || {}), p = /* @__PURE__ */ ((e) => (e.FIFTEEN_MIN = "15m", e.ONE_HOUR = "1h", e.SIX_HOUR = "6h", e.TWELVE_HOUR = "12h", e.ONE_DAY = "24h", e.SEVEN_DAY = "7d", e.THIRTY_DAY = "30d", e.CURRENT_WEEK = "current_week", e.CURRENT_MONTH = "current_month", e.CURRENT_QUARTER = "current_quarter", e.PREVIOUS_WEEK = "previous_week", e.PREVIOUS_MONTH = "previous_month", e.PREVIOUS_QUARTER = "previous_quarter", e))(p || {});
|
|
4
|
+
function Me(e) {
|
|
5
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
6
|
+
}
|
|
7
|
+
var ot = { exports: {} };
|
|
8
|
+
(function(e) {
|
|
9
|
+
function t(r) {
|
|
10
|
+
return r && r.__esModule ? r : {
|
|
11
|
+
default: r
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
|
|
15
|
+
})(ot);
|
|
16
|
+
var Ht = ot.exports, Ee = { exports: {} };
|
|
17
|
+
(function(e, t) {
|
|
18
|
+
Object.defineProperty(t, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), t.default = r;
|
|
21
|
+
function r(n) {
|
|
22
|
+
if (n === null || n === !0 || n === !1)
|
|
23
|
+
return NaN;
|
|
24
|
+
var i = Number(n);
|
|
25
|
+
return isNaN(i) ? i : i < 0 ? Math.ceil(i) : Math.floor(i);
|
|
26
|
+
}
|
|
27
|
+
e.exports = t.default;
|
|
28
|
+
})(Ee, Ee.exports);
|
|
29
|
+
var Vt = Ee.exports;
|
|
30
|
+
const $t = /* @__PURE__ */ Me(Vt);
|
|
31
|
+
var we = { exports: {} };
|
|
32
|
+
(function(e, t) {
|
|
33
|
+
Object.defineProperty(t, "__esModule", {
|
|
34
|
+
value: !0
|
|
35
|
+
}), t.default = r;
|
|
36
|
+
function r(n) {
|
|
37
|
+
var i = new Date(Date.UTC(n.getFullYear(), n.getMonth(), n.getDate(), n.getHours(), n.getMinutes(), n.getSeconds(), n.getMilliseconds()));
|
|
38
|
+
return i.setUTCFullYear(n.getFullYear()), n.getTime() - i.getTime();
|
|
39
|
+
}
|
|
40
|
+
e.exports = t.default;
|
|
41
|
+
})(we, we.exports);
|
|
42
|
+
var zt = we.exports;
|
|
43
|
+
const $e = /* @__PURE__ */ Me(zt);
|
|
44
|
+
function jt(e, t) {
|
|
45
|
+
var r = qt(t);
|
|
46
|
+
return r.formatToParts ? Gt(r, e) : Kt(r, e);
|
|
47
|
+
}
|
|
48
|
+
var Zt = {
|
|
49
|
+
year: 0,
|
|
50
|
+
month: 1,
|
|
51
|
+
day: 2,
|
|
52
|
+
hour: 3,
|
|
53
|
+
minute: 4,
|
|
54
|
+
second: 5
|
|
55
|
+
};
|
|
56
|
+
function Gt(e, t) {
|
|
57
|
+
try {
|
|
58
|
+
for (var r = e.formatToParts(t), n = [], i = 0; i < r.length; i++) {
|
|
59
|
+
var a = Zt[r[i].type];
|
|
60
|
+
a >= 0 && (n[a] = parseInt(r[i].value, 10));
|
|
61
|
+
}
|
|
62
|
+
return n;
|
|
63
|
+
} catch (o) {
|
|
64
|
+
if (o instanceof RangeError)
|
|
65
|
+
return [NaN];
|
|
66
|
+
throw o;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function Kt(e, t) {
|
|
70
|
+
var r = e.format(t).replace(/\u200E/g, ""), n = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);
|
|
71
|
+
return [n[3], n[1], n[2], n[4], n[5], n[6]];
|
|
72
|
+
}
|
|
73
|
+
var fe = {};
|
|
74
|
+
function qt(e) {
|
|
75
|
+
if (!fe[e]) {
|
|
76
|
+
var t = new Intl.DateTimeFormat("en-US", {
|
|
77
|
+
hour12: !1,
|
|
78
|
+
timeZone: "America/New_York",
|
|
79
|
+
year: "numeric",
|
|
80
|
+
month: "numeric",
|
|
81
|
+
day: "2-digit",
|
|
82
|
+
hour: "2-digit",
|
|
83
|
+
minute: "2-digit",
|
|
84
|
+
second: "2-digit"
|
|
85
|
+
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), r = t === "06/25/2014, 00:00:00" || t === "06/25/2014 00:00:00";
|
|
86
|
+
fe[e] = r ? new Intl.DateTimeFormat("en-US", {
|
|
87
|
+
hour12: !1,
|
|
88
|
+
timeZone: e,
|
|
89
|
+
year: "numeric",
|
|
90
|
+
month: "numeric",
|
|
91
|
+
day: "2-digit",
|
|
92
|
+
hour: "2-digit",
|
|
93
|
+
minute: "2-digit",
|
|
94
|
+
second: "2-digit"
|
|
95
|
+
}) : new Intl.DateTimeFormat("en-US", {
|
|
96
|
+
hourCycle: "h23",
|
|
97
|
+
timeZone: e,
|
|
98
|
+
year: "numeric",
|
|
99
|
+
month: "numeric",
|
|
100
|
+
day: "2-digit",
|
|
101
|
+
hour: "2-digit",
|
|
102
|
+
minute: "2-digit",
|
|
103
|
+
second: "2-digit"
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return fe[e];
|
|
107
|
+
}
|
|
108
|
+
function be(e, t, r, n, i, a, o) {
|
|
109
|
+
var l = /* @__PURE__ */ new Date(0);
|
|
110
|
+
return l.setUTCFullYear(e, t, r), l.setUTCHours(n, i, a, o), l;
|
|
111
|
+
}
|
|
112
|
+
var ze = 36e5, Wt = 6e4, me = {
|
|
113
|
+
timezone: /([Z+-].*)$/,
|
|
114
|
+
timezoneZ: /^(Z)$/,
|
|
115
|
+
timezoneHH: /^([+-]\d{2})$/,
|
|
116
|
+
timezoneHHMM: /^([+-]\d{2}):?(\d{2})$/
|
|
117
|
+
};
|
|
118
|
+
function oe(e, t, r) {
|
|
119
|
+
var n, i;
|
|
120
|
+
if (!e || (n = me.timezoneZ.exec(e), n))
|
|
121
|
+
return 0;
|
|
122
|
+
var a;
|
|
123
|
+
if (n = me.timezoneHH.exec(e), n)
|
|
124
|
+
return a = parseInt(n[1], 10), je(a) ? -(a * ze) : NaN;
|
|
125
|
+
if (n = me.timezoneHHMM.exec(e), n) {
|
|
126
|
+
a = parseInt(n[1], 10);
|
|
127
|
+
var o = parseInt(n[2], 10);
|
|
128
|
+
return je(a, o) ? (i = Math.abs(a) * ze + o * Wt, a > 0 ? -i : i) : NaN;
|
|
129
|
+
}
|
|
130
|
+
if (Jt(e)) {
|
|
131
|
+
t = new Date(t || Date.now());
|
|
132
|
+
var l = r ? t : Bt(t), d = Se(l, e), s = r ? d : Qt(t, d, e);
|
|
133
|
+
return -s;
|
|
134
|
+
}
|
|
135
|
+
return NaN;
|
|
136
|
+
}
|
|
137
|
+
function Bt(e) {
|
|
138
|
+
return be(
|
|
139
|
+
e.getFullYear(),
|
|
140
|
+
e.getMonth(),
|
|
141
|
+
e.getDate(),
|
|
142
|
+
e.getHours(),
|
|
143
|
+
e.getMinutes(),
|
|
144
|
+
e.getSeconds(),
|
|
145
|
+
e.getMilliseconds()
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
function Se(e, t) {
|
|
149
|
+
var r = jt(e, t), n = be(
|
|
150
|
+
r[0],
|
|
151
|
+
r[1] - 1,
|
|
152
|
+
r[2],
|
|
153
|
+
r[3] % 24,
|
|
154
|
+
r[4],
|
|
155
|
+
r[5],
|
|
156
|
+
0
|
|
157
|
+
).getTime(), i = e.getTime(), a = i % 1e3;
|
|
158
|
+
return i -= a >= 0 ? a : 1e3 + a, n - i;
|
|
159
|
+
}
|
|
160
|
+
function Qt(e, t, r) {
|
|
161
|
+
var n = e.getTime(), i = n - t, a = Se(new Date(i), r);
|
|
162
|
+
if (t === a)
|
|
163
|
+
return t;
|
|
164
|
+
i -= a - t;
|
|
165
|
+
var o = Se(new Date(i), r);
|
|
166
|
+
return a === o ? a : Math.max(a, o);
|
|
167
|
+
}
|
|
168
|
+
function je(e, t) {
|
|
169
|
+
return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
|
|
170
|
+
}
|
|
171
|
+
var Ze = {};
|
|
172
|
+
function Jt(e) {
|
|
173
|
+
if (Ze[e])
|
|
174
|
+
return !0;
|
|
175
|
+
try {
|
|
176
|
+
return new Intl.DateTimeFormat(void 0, { timeZone: e }), Ze[e] = !0, !0;
|
|
177
|
+
} catch {
|
|
178
|
+
return !1;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
var Xt = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;
|
|
182
|
+
const ut = Xt;
|
|
183
|
+
var ve = 36e5, Ge = 6e4, er = 2, w = {
|
|
184
|
+
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
|
|
185
|
+
datePattern: /^([0-9W+-]+)(.*)/,
|
|
186
|
+
plainTime: /:/,
|
|
187
|
+
// year tokens
|
|
188
|
+
YY: /^(\d{2})$/,
|
|
189
|
+
YYY: [
|
|
190
|
+
/^([+-]\d{2})$/,
|
|
191
|
+
// 0 additional digits
|
|
192
|
+
/^([+-]\d{3})$/,
|
|
193
|
+
// 1 additional digit
|
|
194
|
+
/^([+-]\d{4})$/
|
|
195
|
+
// 2 additional digits
|
|
196
|
+
],
|
|
197
|
+
YYYY: /^(\d{4})/,
|
|
198
|
+
YYYYY: [
|
|
199
|
+
/^([+-]\d{4})/,
|
|
200
|
+
// 0 additional digits
|
|
201
|
+
/^([+-]\d{5})/,
|
|
202
|
+
// 1 additional digit
|
|
203
|
+
/^([+-]\d{6})/
|
|
204
|
+
// 2 additional digits
|
|
205
|
+
],
|
|
206
|
+
// date tokens
|
|
207
|
+
MM: /^-(\d{2})$/,
|
|
208
|
+
DDD: /^-?(\d{3})$/,
|
|
209
|
+
MMDD: /^-?(\d{2})-?(\d{2})$/,
|
|
210
|
+
Www: /^-?W(\d{2})$/,
|
|
211
|
+
WwwD: /^-?W(\d{2})-?(\d{1})$/,
|
|
212
|
+
HH: /^(\d{2}([.,]\d*)?)$/,
|
|
213
|
+
HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
214
|
+
HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
215
|
+
// time zone tokens (to identify the presence of a tz)
|
|
216
|
+
timeZone: ut
|
|
217
|
+
};
|
|
218
|
+
function Re(e, t) {
|
|
219
|
+
if (arguments.length < 1)
|
|
220
|
+
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
221
|
+
if (e === null)
|
|
222
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
223
|
+
var r = t || {}, n = r.additionalDigits == null ? er : $t(r.additionalDigits);
|
|
224
|
+
if (n !== 2 && n !== 1 && n !== 0)
|
|
225
|
+
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
226
|
+
if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
|
|
227
|
+
return new Date(e.getTime());
|
|
228
|
+
if (typeof e == "number" || Object.prototype.toString.call(e) === "[object Number]")
|
|
229
|
+
return new Date(e);
|
|
230
|
+
if (!(typeof e == "string" || Object.prototype.toString.call(e) === "[object String]"))
|
|
231
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
232
|
+
var i = tr(e), a = rr(i.date, n), o = a.year, l = a.restDateString, d = nr(l, o);
|
|
233
|
+
if (isNaN(d))
|
|
234
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
235
|
+
if (d) {
|
|
236
|
+
var s = d.getTime(), u = 0, c;
|
|
237
|
+
if (i.time && (u = ar(i.time), isNaN(u)))
|
|
238
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
239
|
+
if (i.timeZone || r.timeZone) {
|
|
240
|
+
if (c = oe(i.timeZone || r.timeZone, new Date(s + u)), isNaN(c))
|
|
241
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
242
|
+
} else
|
|
243
|
+
c = $e(new Date(s + u)), c = $e(new Date(s + u + c));
|
|
244
|
+
return new Date(s + u + c);
|
|
245
|
+
} else
|
|
246
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
247
|
+
}
|
|
248
|
+
function tr(e) {
|
|
249
|
+
var t = {}, r = w.dateTimePattern.exec(e), n;
|
|
250
|
+
if (r ? (t.date = r[1], n = r[3]) : (r = w.datePattern.exec(e), r ? (t.date = r[1], n = r[2]) : (t.date = null, n = e)), n) {
|
|
251
|
+
var i = w.timeZone.exec(n);
|
|
252
|
+
i ? (t.time = n.replace(i[1], ""), t.timeZone = i[1].trim()) : t.time = n;
|
|
253
|
+
}
|
|
254
|
+
return t;
|
|
255
|
+
}
|
|
256
|
+
function rr(e, t) {
|
|
257
|
+
var r = w.YYY[t], n = w.YYYYY[t], i;
|
|
258
|
+
if (i = w.YYYY.exec(e) || n.exec(e), i) {
|
|
259
|
+
var a = i[1];
|
|
260
|
+
return {
|
|
261
|
+
year: parseInt(a, 10),
|
|
262
|
+
restDateString: e.slice(a.length)
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
if (i = w.YY.exec(e) || r.exec(e), i) {
|
|
266
|
+
var o = i[1];
|
|
267
|
+
return {
|
|
268
|
+
year: parseInt(o, 10) * 100,
|
|
269
|
+
restDateString: e.slice(o.length)
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
year: null
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
function nr(e, t) {
|
|
277
|
+
if (t === null)
|
|
278
|
+
return null;
|
|
279
|
+
var r, n, i, a;
|
|
280
|
+
if (e.length === 0)
|
|
281
|
+
return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(t), n;
|
|
282
|
+
if (r = w.MM.exec(e), r)
|
|
283
|
+
return n = /* @__PURE__ */ new Date(0), i = parseInt(r[1], 10) - 1, qe(t, i) ? (n.setUTCFullYear(t, i), n) : /* @__PURE__ */ new Date(NaN);
|
|
284
|
+
if (r = w.DDD.exec(e), r) {
|
|
285
|
+
n = /* @__PURE__ */ new Date(0);
|
|
286
|
+
var o = parseInt(r[1], 10);
|
|
287
|
+
return or(t, o) ? (n.setUTCFullYear(t, 0, o), n) : /* @__PURE__ */ new Date(NaN);
|
|
288
|
+
}
|
|
289
|
+
if (r = w.MMDD.exec(e), r) {
|
|
290
|
+
n = /* @__PURE__ */ new Date(0), i = parseInt(r[1], 10) - 1;
|
|
291
|
+
var l = parseInt(r[2], 10);
|
|
292
|
+
return qe(t, i, l) ? (n.setUTCFullYear(t, i, l), n) : /* @__PURE__ */ new Date(NaN);
|
|
293
|
+
}
|
|
294
|
+
if (r = w.Www.exec(e), r)
|
|
295
|
+
return a = parseInt(r[1], 10) - 1, We(t, a) ? Ke(t, a) : /* @__PURE__ */ new Date(NaN);
|
|
296
|
+
if (r = w.WwwD.exec(e), r) {
|
|
297
|
+
a = parseInt(r[1], 10) - 1;
|
|
298
|
+
var d = parseInt(r[2], 10) - 1;
|
|
299
|
+
return We(t, a, d) ? Ke(t, a, d) : /* @__PURE__ */ new Date(NaN);
|
|
300
|
+
}
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
function ar(e) {
|
|
304
|
+
var t, r, n;
|
|
305
|
+
if (t = w.HH.exec(e), t)
|
|
306
|
+
return r = parseFloat(t[1].replace(",", ".")), he(r) ? r % 24 * ve : NaN;
|
|
307
|
+
if (t = w.HHMM.exec(e), t)
|
|
308
|
+
return r = parseInt(t[1], 10), n = parseFloat(t[2].replace(",", ".")), he(r, n) ? r % 24 * ve + n * Ge : NaN;
|
|
309
|
+
if (t = w.HHMMSS.exec(e), t) {
|
|
310
|
+
r = parseInt(t[1], 10), n = parseInt(t[2], 10);
|
|
311
|
+
var i = parseFloat(t[3].replace(",", "."));
|
|
312
|
+
return he(r, n, i) ? r % 24 * ve + n * Ge + i * 1e3 : NaN;
|
|
313
|
+
}
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
function Ke(e, t, r) {
|
|
317
|
+
t = t || 0, r = r || 0;
|
|
318
|
+
var n = /* @__PURE__ */ new Date(0);
|
|
319
|
+
n.setUTCFullYear(e, 0, 4);
|
|
320
|
+
var i = n.getUTCDay() || 7, a = t * 7 + r + 1 - i;
|
|
321
|
+
return n.setUTCDate(n.getUTCDate() + a), n;
|
|
322
|
+
}
|
|
323
|
+
var ir = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], sr = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
324
|
+
function lt(e) {
|
|
325
|
+
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
326
|
+
}
|
|
327
|
+
function qe(e, t, r) {
|
|
328
|
+
if (t < 0 || t > 11)
|
|
329
|
+
return !1;
|
|
330
|
+
if (r != null) {
|
|
331
|
+
if (r < 1)
|
|
332
|
+
return !1;
|
|
333
|
+
var n = lt(e);
|
|
334
|
+
if (n && r > sr[t] || !n && r > ir[t])
|
|
335
|
+
return !1;
|
|
336
|
+
}
|
|
337
|
+
return !0;
|
|
338
|
+
}
|
|
339
|
+
function or(e, t) {
|
|
340
|
+
if (t < 1)
|
|
341
|
+
return !1;
|
|
342
|
+
var r = lt(e);
|
|
343
|
+
return !(r && t > 366 || !r && t > 365);
|
|
344
|
+
}
|
|
345
|
+
function We(e, t, r) {
|
|
346
|
+
return !(t < 0 || t > 52 || r != null && (r < 0 || r > 6));
|
|
347
|
+
}
|
|
348
|
+
function he(e, t, r) {
|
|
349
|
+
return !(e != null && (e < 0 || e >= 25) || t != null && (t < 0 || t >= 60) || r != null && (r < 0 || r >= 60));
|
|
350
|
+
}
|
|
351
|
+
var _e = { exports: {} }, Ie = { exports: {} };
|
|
352
|
+
(function(e, t) {
|
|
353
|
+
Object.defineProperty(t, "__esModule", {
|
|
354
|
+
value: !0
|
|
355
|
+
}), t.default = r;
|
|
356
|
+
function r(n, i) {
|
|
357
|
+
if (n == null)
|
|
358
|
+
throw new TypeError("assign requires that input parameter not be null or undefined");
|
|
359
|
+
for (var a in i)
|
|
360
|
+
Object.prototype.hasOwnProperty.call(i, a) && (n[a] = i[a]);
|
|
361
|
+
return n;
|
|
362
|
+
}
|
|
363
|
+
e.exports = t.default;
|
|
364
|
+
})(Ie, Ie.exports);
|
|
365
|
+
var ur = Ie.exports;
|
|
366
|
+
(function(e, t) {
|
|
367
|
+
var r = Ht.default;
|
|
368
|
+
Object.defineProperty(t, "__esModule", {
|
|
369
|
+
value: !0
|
|
370
|
+
}), t.default = i;
|
|
371
|
+
var n = r(ur);
|
|
372
|
+
function i(a) {
|
|
373
|
+
return (0, n.default)({}, a);
|
|
374
|
+
}
|
|
375
|
+
e.exports = t.default;
|
|
376
|
+
})(_e, _e.exports);
|
|
377
|
+
var lr = _e.exports;
|
|
378
|
+
const cr = /* @__PURE__ */ Me(lr);
|
|
379
|
+
function dr(e, t, r) {
|
|
380
|
+
var n = Re(e, r), i = oe(t, n, !0), a = new Date(n.getTime() - i), o = /* @__PURE__ */ new Date(0);
|
|
381
|
+
return o.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), o.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), o;
|
|
382
|
+
}
|
|
383
|
+
function ct(e, t) {
|
|
384
|
+
return -oe(e, t);
|
|
385
|
+
}
|
|
386
|
+
function fr(e, t, r) {
|
|
387
|
+
if (typeof e == "string" && !e.match(ut)) {
|
|
388
|
+
var n = cr(r);
|
|
389
|
+
return n.timeZone = t, Re(e, n);
|
|
390
|
+
}
|
|
391
|
+
var i = Re(e, r), a = be(
|
|
392
|
+
i.getFullYear(),
|
|
393
|
+
i.getMonth(),
|
|
394
|
+
i.getDate(),
|
|
395
|
+
i.getHours(),
|
|
396
|
+
i.getMinutes(),
|
|
397
|
+
i.getSeconds(),
|
|
398
|
+
i.getMilliseconds()
|
|
399
|
+
).getTime(), o = oe(t, new Date(a));
|
|
400
|
+
return new Date(a + o);
|
|
401
|
+
}
|
|
402
|
+
const Be = {
|
|
5
403
|
[v.MINUTELY]: 60 * 1e3,
|
|
6
404
|
[v.HOURLY]: 60 * 60 * 1e3,
|
|
7
405
|
[v.DAILY]: 60 * 60 * 24 * 1e3,
|
|
8
406
|
[v.WEEKLY]: 60 * 60 * 24 * 7 * 1e3
|
|
9
407
|
};
|
|
10
|
-
function
|
|
408
|
+
function mr(e, t) {
|
|
11
409
|
return e ? {
|
|
12
410
|
duration: e,
|
|
13
411
|
type: "duration",
|
|
14
412
|
origin: t
|
|
15
413
|
} : null;
|
|
16
414
|
}
|
|
17
|
-
function
|
|
18
|
-
const i =
|
|
19
|
-
|
|
415
|
+
function dt(e, t, r, n) {
|
|
416
|
+
const i = Be[r];
|
|
417
|
+
let a = 0;
|
|
418
|
+
return i >= Be[v.DAILY] && (n ? a = -ct(n, t) : a = t.getTimezoneOffset() * 60 * 1e3), new Date(e((t.getTime() - a) / i) * i + a);
|
|
20
419
|
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
420
|
+
function Qe(e, t, r) {
|
|
421
|
+
return dt(Math.floor, e, t, r);
|
|
23
422
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
423
|
+
function vr(e, t, r) {
|
|
424
|
+
return dt(Math.ceil, e, t, r);
|
|
26
425
|
}
|
|
27
|
-
function
|
|
426
|
+
function ne(e) {
|
|
28
427
|
"@babel/helpers - typeof";
|
|
29
|
-
return
|
|
428
|
+
return ne = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
30
429
|
return typeof t;
|
|
31
430
|
} : function(t) {
|
|
32
431
|
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
33
|
-
},
|
|
432
|
+
}, ne(e);
|
|
34
433
|
}
|
|
35
|
-
function
|
|
434
|
+
function N(e) {
|
|
36
435
|
if (e === null || e === !0 || e === !1)
|
|
37
436
|
return NaN;
|
|
38
437
|
var t = Number(e);
|
|
39
438
|
return isNaN(t) ? t : t < 0 ? Math.ceil(t) : Math.floor(t);
|
|
40
439
|
}
|
|
41
|
-
function
|
|
440
|
+
function R(e, t) {
|
|
42
441
|
if (t.length < e)
|
|
43
442
|
throw new TypeError(e + " argument" + (e > 1 ? "s" : "") + " required, but only " + t.length + " present");
|
|
44
443
|
}
|
|
45
444
|
function P(e) {
|
|
46
|
-
|
|
445
|
+
R(1, arguments);
|
|
47
446
|
var t = Object.prototype.toString.call(e);
|
|
48
|
-
return e instanceof Date ||
|
|
447
|
+
return e instanceof Date || ne(e) === "object" && t === "[object Date]" ? new Date(e.getTime()) : typeof e == "number" || t === "[object Number]" ? new Date(e) : ((typeof e == "string" || t === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
|
|
49
448
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
var r = P(e),
|
|
53
|
-
return isNaN(
|
|
449
|
+
function Ne(e, t) {
|
|
450
|
+
R(2, arguments);
|
|
451
|
+
var r = P(e), n = N(t);
|
|
452
|
+
return isNaN(n) ? /* @__PURE__ */ new Date(NaN) : (n && r.setDate(r.getDate() + n), r);
|
|
54
453
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
-
var r = P(e),
|
|
58
|
-
if (isNaN(
|
|
454
|
+
function hr(e, t) {
|
|
455
|
+
R(2, arguments);
|
|
456
|
+
var r = P(e), n = N(t);
|
|
457
|
+
if (isNaN(n))
|
|
59
458
|
return /* @__PURE__ */ new Date(NaN);
|
|
60
|
-
if (!
|
|
459
|
+
if (!n)
|
|
61
460
|
return r;
|
|
62
|
-
var
|
|
63
|
-
a.setMonth(r.getMonth() +
|
|
461
|
+
var i = r.getDate(), a = new Date(r.getTime());
|
|
462
|
+
a.setMonth(r.getMonth() + n + 1, 0);
|
|
64
463
|
var o = a.getDate();
|
|
65
|
-
return
|
|
464
|
+
return i >= o ? a : (r.setFullYear(a.getFullYear(), a.getMonth(), i), r);
|
|
66
465
|
}
|
|
67
|
-
var
|
|
68
|
-
function
|
|
69
|
-
return
|
|
466
|
+
var gr = {};
|
|
467
|
+
function yr() {
|
|
468
|
+
return gr;
|
|
70
469
|
}
|
|
71
|
-
function
|
|
72
|
-
var r,
|
|
73
|
-
|
|
74
|
-
var u =
|
|
75
|
-
if (!(
|
|
470
|
+
function ae(e, t) {
|
|
471
|
+
var r, n, i, a, o, l, d, s;
|
|
472
|
+
R(1, arguments);
|
|
473
|
+
var u = yr(), c = N((r = (n = (i = (a = t == null ? void 0 : t.weekStartsOn) !== null && a !== void 0 ? a : t == null || (o = t.locale) === null || o === void 0 || (l = o.options) === null || l === void 0 ? void 0 : l.weekStartsOn) !== null && i !== void 0 ? i : u.weekStartsOn) !== null && n !== void 0 ? n : (d = u.locale) === null || d === void 0 || (s = d.options) === null || s === void 0 ? void 0 : s.weekStartsOn) !== null && r !== void 0 ? r : 0);
|
|
474
|
+
if (!(c >= 0 && c <= 6))
|
|
76
475
|
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
77
|
-
var f = P(e), m = f.getDay(), h = (m <
|
|
476
|
+
var f = P(e), m = f.getDay(), h = (m < c ? 7 : 0) + m - c;
|
|
78
477
|
return f.setDate(f.getDate() - h), f.setHours(0, 0, 0, 0), f;
|
|
79
478
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
479
|
+
function Je(e) {
|
|
480
|
+
R(1, arguments);
|
|
82
481
|
var t = P(e);
|
|
83
482
|
return t.setHours(0, 0, 0, 0), t;
|
|
84
483
|
}
|
|
85
|
-
var
|
|
86
|
-
function
|
|
87
|
-
|
|
484
|
+
var pr = 60, Tr = 3600;
|
|
485
|
+
function V(e) {
|
|
486
|
+
R(1, arguments);
|
|
88
487
|
var t = P(e);
|
|
89
488
|
return t.setDate(1), t.setHours(0, 0, 0, 0), t;
|
|
90
489
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
93
|
-
var t = P(e), r = t.getFullYear(),
|
|
94
|
-
return
|
|
490
|
+
function Dr(e) {
|
|
491
|
+
R(1, arguments);
|
|
492
|
+
var t = P(e), r = t.getFullYear(), n = t.getMonth(), i = /* @__PURE__ */ new Date(0);
|
|
493
|
+
return i.setFullYear(r, n + 1, 0), i.setHours(0, 0, 0, 0), i.getDate();
|
|
95
494
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
495
|
+
function Ce(e) {
|
|
496
|
+
R(1, arguments);
|
|
98
497
|
var t = P(e), r = t.getTime();
|
|
99
498
|
return r;
|
|
100
499
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
500
|
+
function Xe(e) {
|
|
501
|
+
return R(1, arguments), Math.floor(Ce(e) / 1e3);
|
|
103
502
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
503
|
+
function Er(e) {
|
|
504
|
+
return R(1, arguments), Math.floor(e * Tr);
|
|
106
505
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
109
|
-
var r =
|
|
110
|
-
return
|
|
506
|
+
function wr(e, t) {
|
|
507
|
+
R(2, arguments);
|
|
508
|
+
var r = N(t);
|
|
509
|
+
return Ne(e, -r);
|
|
111
510
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
var t = e /
|
|
511
|
+
function Sr(e) {
|
|
512
|
+
R(1, arguments);
|
|
513
|
+
var t = e / pr;
|
|
115
514
|
return Math.floor(t);
|
|
116
515
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
var r =
|
|
120
|
-
return
|
|
516
|
+
function Oe(e, t) {
|
|
517
|
+
R(2, arguments);
|
|
518
|
+
var r = N(t);
|
|
519
|
+
return hr(e, -r);
|
|
121
520
|
}
|
|
122
|
-
function
|
|
123
|
-
if (
|
|
521
|
+
function Rr(e, t) {
|
|
522
|
+
if (R(2, arguments), !t || ne(t) !== "object")
|
|
124
523
|
return /* @__PURE__ */ new Date(NaN);
|
|
125
|
-
var r = t.years ?
|
|
524
|
+
var r = t.years ? N(t.years) : 0, n = t.months ? N(t.months) : 0, i = t.weeks ? N(t.weeks) : 0, a = t.days ? N(t.days) : 0, o = t.hours ? N(t.hours) : 0, l = t.minutes ? N(t.minutes) : 0, d = t.seconds ? N(t.seconds) : 0, s = Oe(e, n + r * 12), u = wr(s, a + i * 7), c = l + o * 60, f = d + c * 60, m = f * 1e3, h = new Date(u.getTime() - m);
|
|
126
525
|
return h;
|
|
127
526
|
}
|
|
128
|
-
class
|
|
129
|
-
constructor(t) {
|
|
130
|
-
if (I(this, "timeframe"), this.constructor ===
|
|
527
|
+
let _r = class ft {
|
|
528
|
+
constructor(t, r) {
|
|
529
|
+
if (I(this, "timeframe"), I(this, "tz"), this.constructor === ft)
|
|
131
530
|
throw new Error("BaseQueryTime is not meant to be used directly.");
|
|
132
|
-
this.timeframe = t;
|
|
531
|
+
this.timeframe = t, this.tz = r;
|
|
133
532
|
}
|
|
134
|
-
calculateStartDate(t, r,
|
|
533
|
+
calculateStartDate(t, r, n = 1) {
|
|
135
534
|
if (t)
|
|
136
|
-
return new Date(this.endDate().getTime() - this.timeframe.timeframeLengthMs() *
|
|
535
|
+
return new Date(this.endDate().getTime() - this.timeframe.timeframeLengthMs() * n);
|
|
137
536
|
{
|
|
138
|
-
const
|
|
139
|
-
return
|
|
140
|
-
new Date(
|
|
141
|
-
r
|
|
537
|
+
const i = this.endDate(), a = this.timeframe.rawStart(this.tz), o = Qe(a, r, this.tz), l = (i.getTime() - o.getTime()) * (n - 1);
|
|
538
|
+
return Qe(
|
|
539
|
+
new Date(a.getTime() - l),
|
|
540
|
+
r,
|
|
541
|
+
this.tz
|
|
142
542
|
);
|
|
143
543
|
}
|
|
144
544
|
}
|
|
@@ -146,59 +546,63 @@ class pe {
|
|
|
146
546
|
return Math.floor(this.granularityMs() / 1e3);
|
|
147
547
|
}
|
|
148
548
|
granularityDruid() {
|
|
149
|
-
return
|
|
549
|
+
return mr(this.granularityMs(), this.startDate().toISOString());
|
|
150
550
|
}
|
|
151
551
|
// Return a UNIX timestamp suitable for use in the `start` query param.
|
|
152
552
|
startSeconds() {
|
|
153
|
-
return
|
|
553
|
+
return Xe(this.startDate());
|
|
154
554
|
}
|
|
155
555
|
// Return a UNIX timestamp suitable for use in the `end` query param.
|
|
156
556
|
endSeconds() {
|
|
157
|
-
return
|
|
557
|
+
return Xe(this.endDate());
|
|
158
558
|
}
|
|
159
559
|
// Return epoch time in milliseconds, suitable for use in the `startMs` query param.
|
|
160
560
|
startMs() {
|
|
161
|
-
return
|
|
561
|
+
return Ce(this.startDate());
|
|
162
562
|
}
|
|
163
563
|
// Return epoch time in milliseconds, suitable for use in the `endMs` query param.
|
|
164
564
|
endMs() {
|
|
165
|
-
return
|
|
565
|
+
return Ce(this.endDate());
|
|
166
566
|
}
|
|
167
567
|
// Return whether the timeframe's bounds are within the allotment for a free tier user.
|
|
168
568
|
withinFreeTier() {
|
|
169
|
-
return this.startDate() >=
|
|
569
|
+
return this.startDate() >= Rr(/* @__PURE__ */ new Date(), { days: 1 });
|
|
170
570
|
}
|
|
171
|
-
}
|
|
172
|
-
|
|
571
|
+
};
|
|
572
|
+
class mt extends _r {
|
|
173
573
|
startDate() {
|
|
174
574
|
return this.calculateStartDate(this.timeframe.isRelative, this.timeframe.dataGranularity);
|
|
175
575
|
}
|
|
176
576
|
endDate() {
|
|
177
|
-
return
|
|
577
|
+
return vr(this.timeframe.rawEnd(this.tz), this.timeframe.dataGranularity, this.tz);
|
|
178
578
|
}
|
|
179
579
|
granularityMs() {
|
|
180
580
|
return this.endDate().getTime() - this.startDate().getTime();
|
|
181
581
|
}
|
|
182
|
-
}
|
|
582
|
+
}
|
|
583
|
+
class Ir extends mt {
|
|
183
584
|
startDate() {
|
|
184
585
|
return this.calculateStartDate(this.timeframe.isRelative, this.timeframe.dataGranularity, 2);
|
|
185
586
|
}
|
|
186
587
|
granularityMs() {
|
|
187
588
|
return this.endDate().getTime() - super.startDate().getTime();
|
|
188
589
|
}
|
|
189
|
-
}
|
|
190
|
-
|
|
590
|
+
}
|
|
591
|
+
const j = (e, t) => new Date(e.getTime() - ct(t, e));
|
|
592
|
+
let C = class {
|
|
191
593
|
constructor(t) {
|
|
192
594
|
I(this, "timeframeText"), I(this, "key"), I(this, "display"), I(this, "timeframeLength"), I(this, "allowedTiers"), I(this, "defaultResponseGranularity"), I(this, "dataGranularity"), I(this, "isRelative"), I(this, "_startCustom"), I(this, "_endCustom"), this.display = t.display, this.timeframeText = t.timeframeText, this.key = t.key, this.timeframeLength = t.timeframeLength, this.allowedTiers = t.allowedTiers, this.defaultResponseGranularity = t.defaultResponseGranularity, this.dataGranularity = t.dataGranularity, this.isRelative = t.isRelative, this._startCustom = t.startCustom, this._endCustom = t.endCustom;
|
|
193
595
|
}
|
|
194
596
|
// rawEnd does not consider granularity and should not be used directly in queries.
|
|
195
597
|
// Use `new QueryTime(timeframe, granularity?).queryEndSeconds()` instead.
|
|
196
|
-
|
|
598
|
+
// eslint-disable-next-line -- `tz` is required because it's used in subclasses.
|
|
599
|
+
rawEnd(t) {
|
|
197
600
|
return this._endCustom || /* @__PURE__ */ new Date();
|
|
198
601
|
}
|
|
199
602
|
// rawStart does not consider granularity and should not be used directly in queries.
|
|
200
603
|
// Use `new QueryTime(timeframe, granularity?).queryStartSeconds()` instead.
|
|
201
|
-
|
|
604
|
+
// eslint-disable-next-line -- `tz` is required because it's used in subclasses.
|
|
605
|
+
rawStart(t) {
|
|
202
606
|
return this._startCustom || new Date(this.rawEnd().getTime() - this.timeframeLengthMs());
|
|
203
607
|
}
|
|
204
608
|
timeframeLengthMs() {
|
|
@@ -211,43 +615,58 @@ class A {
|
|
|
211
615
|
const t = /* @__PURE__ */ new Set(), r = this.maximumTimeframeLength() / 3600;
|
|
212
616
|
return r <= 6 && t.add(v.MINUTELY), r >= 2 && r <= 7 * 24 && t.add(v.HOURLY), r >= 2 * 24 && t.add(v.DAILY), r >= 2 * 24 * 14 && t.add(v.WEEKLY), t;
|
|
213
617
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
618
|
+
tzAdjustedDate(t) {
|
|
619
|
+
if (!t)
|
|
620
|
+
return /* @__PURE__ */ new Date();
|
|
621
|
+
const r = fr(/* @__PURE__ */ new Date(), new Intl.DateTimeFormat().resolvedOptions().timeZone);
|
|
622
|
+
return dr(r, t);
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
class Nr extends C {
|
|
626
|
+
rawStart(t) {
|
|
627
|
+
let r = ae(this.tzAdjustedDate(t), { weekStartsOn: 1 });
|
|
628
|
+
return t && (r = j(r, t)), r;
|
|
218
629
|
}
|
|
219
630
|
maximumTimeframeLength() {
|
|
220
631
|
return 60 * 60 * 24 * 7;
|
|
221
632
|
}
|
|
222
633
|
}
|
|
223
|
-
|
|
224
|
-
rawStart() {
|
|
225
|
-
|
|
634
|
+
class Cr extends C {
|
|
635
|
+
rawStart(t) {
|
|
636
|
+
let r = V(this.tzAdjustedDate(t));
|
|
637
|
+
return t && (r = j(r, t)), r;
|
|
226
638
|
}
|
|
227
639
|
maximumTimeframeLength() {
|
|
228
640
|
return 60 * 60 * 24 * 31;
|
|
229
641
|
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
642
|
+
}
|
|
643
|
+
class Ar extends C {
|
|
644
|
+
rawEnd(t) {
|
|
645
|
+
let r = ae(this.tzAdjustedDate(t), { weekStartsOn: 1 });
|
|
646
|
+
return t && (r = j(r, t)), r;
|
|
233
647
|
}
|
|
234
|
-
rawStart() {
|
|
235
|
-
|
|
648
|
+
rawStart(t) {
|
|
649
|
+
const r = this.tzAdjustedDate(t);
|
|
650
|
+
let n = ae(r.setDate(r.getDate() - 7), {
|
|
236
651
|
weekStartsOn: 1
|
|
237
652
|
});
|
|
653
|
+
return t && (n = j(n, t)), n;
|
|
238
654
|
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
655
|
+
}
|
|
656
|
+
class Mr extends C {
|
|
657
|
+
rawEnd(t) {
|
|
658
|
+
let r = V(this.tzAdjustedDate(t));
|
|
659
|
+
return t && (r = j(r, t)), r;
|
|
242
660
|
}
|
|
243
|
-
rawStart() {
|
|
244
|
-
|
|
661
|
+
rawStart(t) {
|
|
662
|
+
let r = V(Oe(this.tzAdjustedDate(t), 1));
|
|
663
|
+
return t && (r = j(r, t)), r;
|
|
245
664
|
}
|
|
246
|
-
}
|
|
247
|
-
const
|
|
665
|
+
}
|
|
666
|
+
const et = /* @__PURE__ */ new Map([
|
|
248
667
|
[
|
|
249
668
|
p.FIFTEEN_MIN,
|
|
250
|
-
new
|
|
669
|
+
new C({
|
|
251
670
|
key: p.FIFTEEN_MIN,
|
|
252
671
|
display: "Last 15 minutes",
|
|
253
672
|
timeframeText: "15 minutes",
|
|
@@ -260,7 +679,7 @@ const Ue = /* @__PURE__ */ new Map([
|
|
|
260
679
|
],
|
|
261
680
|
[
|
|
262
681
|
p.ONE_HOUR,
|
|
263
|
-
new
|
|
682
|
+
new C({
|
|
264
683
|
key: p.ONE_HOUR,
|
|
265
684
|
display: "Last hour",
|
|
266
685
|
timeframeText: "One hour",
|
|
@@ -273,7 +692,7 @@ const Ue = /* @__PURE__ */ new Map([
|
|
|
273
692
|
],
|
|
274
693
|
[
|
|
275
694
|
p.SIX_HOUR,
|
|
276
|
-
new
|
|
695
|
+
new C({
|
|
277
696
|
key: p.SIX_HOUR,
|
|
278
697
|
display: "Last 6 hours",
|
|
279
698
|
timeframeText: "6 hours",
|
|
@@ -286,7 +705,7 @@ const Ue = /* @__PURE__ */ new Map([
|
|
|
286
705
|
],
|
|
287
706
|
[
|
|
288
707
|
p.TWELVE_HOUR,
|
|
289
|
-
new
|
|
708
|
+
new C({
|
|
290
709
|
key: p.TWELVE_HOUR,
|
|
291
710
|
display: "Last 12 hours",
|
|
292
711
|
timeframeText: "12 hours",
|
|
@@ -299,7 +718,7 @@ const Ue = /* @__PURE__ */ new Map([
|
|
|
299
718
|
],
|
|
300
719
|
[
|
|
301
720
|
p.ONE_DAY,
|
|
302
|
-
new
|
|
721
|
+
new C({
|
|
303
722
|
key: p.ONE_DAY,
|
|
304
723
|
display: "Last 24 hours",
|
|
305
724
|
timeframeText: "24 hours",
|
|
@@ -312,7 +731,7 @@ const Ue = /* @__PURE__ */ new Map([
|
|
|
312
731
|
],
|
|
313
732
|
[
|
|
314
733
|
p.SEVEN_DAY,
|
|
315
|
-
new
|
|
734
|
+
new C({
|
|
316
735
|
key: p.SEVEN_DAY,
|
|
317
736
|
display: "Last 7 days",
|
|
318
737
|
timeframeText: "7 days",
|
|
@@ -325,7 +744,7 @@ const Ue = /* @__PURE__ */ new Map([
|
|
|
325
744
|
],
|
|
326
745
|
[
|
|
327
746
|
p.THIRTY_DAY,
|
|
328
|
-
new
|
|
747
|
+
new C({
|
|
329
748
|
key: p.THIRTY_DAY,
|
|
330
749
|
display: "Last 30 days",
|
|
331
750
|
timeframeText: "30 days",
|
|
@@ -338,13 +757,13 @@ const Ue = /* @__PURE__ */ new Map([
|
|
|
338
757
|
],
|
|
339
758
|
[
|
|
340
759
|
p.CURRENT_WEEK,
|
|
341
|
-
new
|
|
760
|
+
new Nr({
|
|
342
761
|
key: p.CURRENT_WEEK,
|
|
343
762
|
display: "This week",
|
|
344
763
|
timeframeText: "Week",
|
|
345
764
|
timeframeLength: () => {
|
|
346
|
-
const e =
|
|
347
|
-
return (
|
|
765
|
+
const e = ae(/* @__PURE__ */ new Date(), { weekStartsOn: 1 });
|
|
766
|
+
return (Je(Ne(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
|
|
348
767
|
},
|
|
349
768
|
defaultResponseGranularity: v.DAILY,
|
|
350
769
|
dataGranularity: v.DAILY,
|
|
@@ -354,13 +773,13 @@ const Ue = /* @__PURE__ */ new Map([
|
|
|
354
773
|
],
|
|
355
774
|
[
|
|
356
775
|
p.CURRENT_MONTH,
|
|
357
|
-
new
|
|
776
|
+
new Cr({
|
|
358
777
|
key: p.CURRENT_MONTH,
|
|
359
778
|
display: "This month",
|
|
360
779
|
timeframeText: "Month",
|
|
361
780
|
timeframeLength: () => {
|
|
362
|
-
const e =
|
|
363
|
-
return (
|
|
781
|
+
const e = V(/* @__PURE__ */ new Date());
|
|
782
|
+
return (Je(Ne(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
|
|
364
783
|
},
|
|
365
784
|
defaultResponseGranularity: v.DAILY,
|
|
366
785
|
dataGranularity: v.DAILY,
|
|
@@ -370,7 +789,7 @@ const Ue = /* @__PURE__ */ new Map([
|
|
|
370
789
|
],
|
|
371
790
|
[
|
|
372
791
|
p.PREVIOUS_WEEK,
|
|
373
|
-
new
|
|
792
|
+
new Ar({
|
|
374
793
|
key: p.PREVIOUS_WEEK,
|
|
375
794
|
display: "Previous week",
|
|
376
795
|
timeframeText: "Week",
|
|
@@ -383,14 +802,14 @@ const Ue = /* @__PURE__ */ new Map([
|
|
|
383
802
|
],
|
|
384
803
|
[
|
|
385
804
|
p.PREVIOUS_MONTH,
|
|
386
|
-
new
|
|
805
|
+
new Mr({
|
|
387
806
|
key: p.PREVIOUS_MONTH,
|
|
388
807
|
display: "Previous month",
|
|
389
808
|
timeframeText: "Month",
|
|
390
809
|
timeframeLength: () => {
|
|
391
810
|
let e = 0;
|
|
392
|
-
const t =
|
|
393
|
-
return t.getTimezoneOffset() !== r.getTimezoneOffset() && (e =
|
|
811
|
+
const t = V(/* @__PURE__ */ new Date()), r = V(Oe(/* @__PURE__ */ new Date(), 1));
|
|
812
|
+
return t.getTimezoneOffset() !== r.getTimezoneOffset() && (e = br(t, r)), 60 * 60 * 24 * Dr((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1)) + Er(e);
|
|
394
813
|
},
|
|
395
814
|
defaultResponseGranularity: v.DAILY,
|
|
396
815
|
dataGranularity: v.DAILY,
|
|
@@ -399,12 +818,12 @@ const Ue = /* @__PURE__ */ new Map([
|
|
|
399
818
|
})
|
|
400
819
|
]
|
|
401
820
|
]);
|
|
402
|
-
function
|
|
403
|
-
return
|
|
821
|
+
function br(e, t) {
|
|
822
|
+
return Sr(e.getTimezoneOffset() - t.getTimezoneOffset());
|
|
404
823
|
}
|
|
405
|
-
const
|
|
824
|
+
const Or = {
|
|
406
825
|
notAvailable: "N/A"
|
|
407
|
-
},
|
|
826
|
+
}, Ur = {
|
|
408
827
|
short: {
|
|
409
828
|
traffic: "Requests",
|
|
410
829
|
errorRate: "Error Rate",
|
|
@@ -415,273 +834,273 @@ const Nt = {
|
|
|
415
834
|
errorRate: "Average Error Rate",
|
|
416
835
|
latency: "P99 Latency"
|
|
417
836
|
}
|
|
418
|
-
},
|
|
419
|
-
general:
|
|
420
|
-
metricCard:
|
|
837
|
+
}, Yr = {
|
|
838
|
+
general: Or,
|
|
839
|
+
metricCard: Ur
|
|
421
840
|
};
|
|
422
|
-
function
|
|
423
|
-
const e =
|
|
841
|
+
function xr() {
|
|
842
|
+
const e = Lt("en-us", Yr);
|
|
424
843
|
return {
|
|
425
844
|
i18n: e,
|
|
426
|
-
i18nT:
|
|
845
|
+
i18nT: Pt(e)
|
|
427
846
|
// Translation component <i18n-t>
|
|
428
847
|
};
|
|
429
848
|
}
|
|
430
|
-
var
|
|
431
|
-
const
|
|
432
|
-
var
|
|
433
|
-
const
|
|
434
|
-
var t, r,
|
|
849
|
+
var L = /* @__PURE__ */ ((e) => (e.API_PRODUCT = "API_PRODUCT", e.API_PRODUCT_VERSION = "API_PRODUCT_VERSION", e.RUNTIME_GROUP = "RUNTIME_GROUP", e.GATEWAY_INSTANCE_ID = "GATEWAY_INSTANCE_ID", e.GATEWAY_SERVICE = "GATEWAY_SERVICE", e.ROUTE = "ROUTE", e.APPLICATION = "APPLICATION", e.STATUS_CODE = "STATUS_CODE", e.STATUS_CODE_GROUPED = "STATUS_CODE_GROUPED", e.TIME = "TIME", e.ORGANIZATION = "ORGANIZATION", e))(L || {}), Ae = /* @__PURE__ */ ((e) => (e.REQUEST_COUNT = "REQUEST_COUNT", e.REQUEST_PER_MINUTE = "REQUEST_PER_MINUTE", e.RESPONSE_LATENCY_P99 = "RESPONSE_LATENCY_P99", e.RESPONSE_LATENCY_P95 = "RESPONSE_LATENCY_P95", e.RESPONSE_LATENCY_P50 = "RESPONSE_LATENCY_P50", e.RESPONSE_SIZE_P99 = "RESPONSE_SIZE_P99", e.RESPONSE_SIZE_P95 = "RESPONSE_SIZE_P95", e.RESPONSE_SIZE_P50 = "RESPONSE_SIZE_P50", e.REQUEST_SIZE_P99 = "REQUEST_SIZE_P99", e.REQUEST_SIZE_P95 = "REQUEST_SIZE_P95", e.REQUEST_SIZE_P50 = "REQUEST_SIZE_P50", e))(Ae || {}), vt = /* @__PURE__ */ ((e) => (e.IN = "IN", e.NOT_IN = "NOT_IN", e))(vt || {});
|
|
850
|
+
const Lr = 2, W = ["1XX", "2XX", "3XX", "4XX", "5XX"], tt = ["4XX", "5XX"];
|
|
851
|
+
var ht = /* @__PURE__ */ ((e) => (e.VALIDATING = "VALIDATING", e.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", e.PENDING = "PENDING", e.SUCCESS = "SUCCESS", e.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", e.ERROR = "ERROR", e.STALE_IF_ERROR = "STALE_IF_ERROR", e))(ht || {});
|
|
852
|
+
const Pr = (e) => {
|
|
853
|
+
var t, r, n, i, a;
|
|
435
854
|
return e ? !!// TODO: revisit: currently only the first check ever matters?
|
|
436
|
-
((t = Object.keys(e)) != null && t.length || (r = e.data) != null && r.length || (
|
|
855
|
+
((t = Object.keys(e)) != null && t.length || (r = e.data) != null && r.length || (i = (n = e.data) == null ? void 0 : n.data) != null && i.length || !((a = e.data) != null && a.data) && typeof e.data == "object" && Object.keys(e == null ? void 0 : e.data).length) : !1;
|
|
437
856
|
};
|
|
438
|
-
function
|
|
439
|
-
const
|
|
857
|
+
function Fr(e = De({}), t, r, n = Pr) {
|
|
858
|
+
const i = De(
|
|
440
859
|
"PENDING"
|
|
441
860
|
/* PENDING */
|
|
442
861
|
);
|
|
443
|
-
return
|
|
444
|
-
const a =
|
|
862
|
+
return Dt(() => {
|
|
863
|
+
const a = n(e.value);
|
|
445
864
|
if (e.value && a && r.value) {
|
|
446
|
-
|
|
865
|
+
i.value = "VALIDATING_HAS_DATA";
|
|
447
866
|
return;
|
|
448
867
|
}
|
|
449
868
|
if (e.value && r.value) {
|
|
450
|
-
|
|
869
|
+
i.value = "VALIDATING";
|
|
451
870
|
return;
|
|
452
871
|
}
|
|
453
872
|
if (e.value && t.value) {
|
|
454
|
-
|
|
873
|
+
i.value = "STALE_IF_ERROR";
|
|
455
874
|
return;
|
|
456
875
|
}
|
|
457
876
|
if (e.value === void 0 && !t.value) {
|
|
458
|
-
|
|
877
|
+
i.value = "PENDING";
|
|
459
878
|
return;
|
|
460
879
|
}
|
|
461
880
|
if (e.value && !t.value && a) {
|
|
462
|
-
|
|
881
|
+
i.value = "SUCCESS_HAS_DATA";
|
|
463
882
|
return;
|
|
464
883
|
}
|
|
465
884
|
if (e.value && !t.value) {
|
|
466
|
-
|
|
885
|
+
i.value = "SUCCESS";
|
|
467
886
|
return;
|
|
468
887
|
}
|
|
469
|
-
e.value === void 0 && t && (
|
|
888
|
+
e.value === void 0 && t && (i.value = "ERROR");
|
|
470
889
|
}), {
|
|
471
|
-
state:
|
|
472
|
-
swrvState:
|
|
890
|
+
state: i,
|
|
891
|
+
swrvState: ht
|
|
473
892
|
};
|
|
474
893
|
}
|
|
475
|
-
const U = Symbol("default"),
|
|
476
|
-
e[t][r] || (e[t][r] = {}), e[t][r][
|
|
894
|
+
const U = Symbol("default"), ge = L.STATUS_CODE_GROUPED, rt = (e, t, r, n, i) => {
|
|
895
|
+
e[t][r] || (e[t][r] = {}), e[t][r][n] = i;
|
|
477
896
|
};
|
|
478
|
-
function
|
|
479
|
-
var
|
|
480
|
-
const
|
|
481
|
-
return
|
|
897
|
+
function kr(e, t, r) {
|
|
898
|
+
var l;
|
|
899
|
+
const n = ((l = e.meta.metricNames) == null ? void 0 : l[0]) || "", i = Object.keys(e.meta.dimensions || {}), a = !!i.find((d) => d === ge), o = i.find((d) => d !== ge);
|
|
900
|
+
return i.length > 2 || i.length > 1 && !a ? (console.error("Don't know how to work with provided dimensions:", i), {
|
|
482
901
|
previous: { [U]: { [U]: 0 } },
|
|
483
902
|
current: { [U]: { [U]: 0 } }
|
|
484
|
-
}) : e.records.reduce((
|
|
485
|
-
const u = s.event[
|
|
486
|
-
return new Date(s.timestamp).getTime() === t.startDate().getTime() && r ?
|
|
903
|
+
}) : e.records.reduce((d, s) => {
|
|
904
|
+
const u = s.event[n], c = o ? s.event[o] : U, f = a ? s.event[ge] : U;
|
|
905
|
+
return new Date(s.timestamp).getTime() === t.startDate().getTime() && r ? rt(d, "previous", c, f, u) : rt(d, "current", c, f, u), d;
|
|
487
906
|
}, {
|
|
488
907
|
previous: {},
|
|
489
908
|
current: {}
|
|
490
909
|
});
|
|
491
910
|
}
|
|
492
|
-
function
|
|
493
|
-
e.queryReady === void 0 && (e.queryReady =
|
|
494
|
-
const t =
|
|
495
|
-
var
|
|
911
|
+
function Hr(e) {
|
|
912
|
+
e.queryReady === void 0 && (e.queryReady = E(() => !0));
|
|
913
|
+
const t = E(() => e.withTrend ? new Ir(e.timeframe.value) : new mt(e.timeframe.value)), r = E(() => {
|
|
914
|
+
var c, f;
|
|
496
915
|
return {
|
|
497
916
|
metrics: e.metrics,
|
|
498
917
|
dimensions: [
|
|
499
|
-
...(
|
|
500
|
-
...e.withTrend ? [
|
|
918
|
+
...(c = e.dimensions) != null && c.length ? [...e.dimensions] : [],
|
|
919
|
+
...e.withTrend ? [L.TIME] : []
|
|
501
920
|
],
|
|
502
921
|
granularityMs: t.value.granularityMs(),
|
|
503
922
|
...(f = e.filter.value) != null && f.length ? { filter: e.filter.value } : {}
|
|
504
923
|
};
|
|
505
|
-
}),
|
|
506
|
-
var f, m, h,
|
|
507
|
-
if (!((f = e.queryReady) != null && f.value) || e.featureFlags && !e.featureFlags.every((
|
|
924
|
+
}), n = E(() => `${t.value.endDate().toString()}-${t.value.startDate().toString()}`), i = E(() => {
|
|
925
|
+
var f, m, h, g;
|
|
926
|
+
if (!((f = e.queryReady) != null && f.value) || e.featureFlags && !e.featureFlags.every((D) => D))
|
|
508
927
|
return null;
|
|
509
|
-
const
|
|
510
|
-
return `metric-fetcher-${
|
|
511
|
-
}), { response: a, error: o, isValidating:
|
|
512
|
-
() =>
|
|
928
|
+
const c = (m = e.filter) != null && m.value ? JSON.stringify(e.filter.value) : "";
|
|
929
|
+
return `metric-fetcher-${n.value}-${(h = e.dimensions) == null ? void 0 : h.join("-")}-${(g = e.metrics) == null ? void 0 : g.join("-")}-${c}`;
|
|
930
|
+
}), { response: a, error: o, isValidating: l } = $.useRequest(
|
|
931
|
+
() => i.value,
|
|
513
932
|
() => e.dataFetcher(t.value, r.value),
|
|
514
933
|
{
|
|
515
934
|
refreshInterval: e.refreshInterval,
|
|
516
935
|
revalidateOnFocus: !1,
|
|
517
|
-
errorRetryCount:
|
|
936
|
+
errorRetryCount: Lr
|
|
518
937
|
}
|
|
519
|
-
), { state:
|
|
520
|
-
var
|
|
521
|
-
return !((m = (f = (
|
|
938
|
+
), { state: d, swrvState: s } = Fr(a, o, l), u = E(() => {
|
|
939
|
+
var c, f, m, h, g, D, A, T, y, Y;
|
|
940
|
+
return !((m = (f = (c = a.value) == null ? void 0 : c.data) == null ? void 0 : f.records) != null && m.length) || !((D = (g = (h = a.value) == null ? void 0 : h.data) == null ? void 0 : g.meta) != null && D.dimensions) || !((Y = (y = (T = (A = a.value) == null ? void 0 : A.data) == null ? void 0 : T.meta) == null ? void 0 : y.metricNames) != null && Y.length) ? { current: {}, previous: {} } : kr(a.value.data, t.value, !!e.withTrend);
|
|
522
941
|
});
|
|
523
942
|
return {
|
|
524
|
-
isLoading:
|
|
525
|
-
hasError:
|
|
943
|
+
isLoading: E(() => s.PENDING === d.value),
|
|
944
|
+
hasError: E(() => s.ERROR === d.value),
|
|
526
945
|
raw: a,
|
|
527
946
|
mapped: u
|
|
528
947
|
};
|
|
529
948
|
}
|
|
530
|
-
const
|
|
531
|
-
const
|
|
532
|
-
return
|
|
949
|
+
const H = (e, t, r = U, n) => (n ?? [U]).reduce((a, o) => {
|
|
950
|
+
const l = e[t][r];
|
|
951
|
+
return l ? a + (l[o] || 0) : a;
|
|
533
952
|
}, 0);
|
|
534
|
-
function
|
|
953
|
+
function Vr(e) {
|
|
535
954
|
const {
|
|
536
955
|
title: t,
|
|
537
956
|
record: r,
|
|
538
|
-
hasError:
|
|
539
|
-
increaseIsBad:
|
|
957
|
+
hasError: n,
|
|
958
|
+
increaseIsBad: i,
|
|
540
959
|
formatValueFn: a
|
|
541
960
|
} = e;
|
|
542
|
-
return
|
|
543
|
-
let o = 0,
|
|
961
|
+
return E(() => {
|
|
962
|
+
let o = 0, l = 0;
|
|
544
963
|
if (r != null && r.value)
|
|
545
964
|
try {
|
|
546
|
-
o =
|
|
547
|
-
} catch (
|
|
965
|
+
o = H(r.value, "current", e.lookupKey, e.sumGroupedValues), l = H(r.value, "previous", e.lookupKey, e.sumGroupedValues);
|
|
966
|
+
} catch (d) {
|
|
548
967
|
console.error(
|
|
549
968
|
"Metric card data doesn't have the expected structure:",
|
|
550
|
-
|
|
969
|
+
d
|
|
551
970
|
);
|
|
552
971
|
}
|
|
553
972
|
return {
|
|
554
|
-
hasError:
|
|
973
|
+
hasError: n.value,
|
|
555
974
|
currentValue: o,
|
|
556
|
-
previousValue:
|
|
975
|
+
previousValue: l,
|
|
557
976
|
title: t.value,
|
|
558
|
-
increaseIsBad: !!
|
|
977
|
+
increaseIsBad: !!i,
|
|
559
978
|
// Coerce undefined to false
|
|
560
979
|
formatValueFn: a
|
|
561
980
|
};
|
|
562
981
|
});
|
|
563
982
|
}
|
|
564
|
-
var
|
|
565
|
-
function
|
|
983
|
+
var ye = /* @__PURE__ */ new WeakMap(), nt = 0;
|
|
984
|
+
function $r(e) {
|
|
566
985
|
if (!e.length)
|
|
567
986
|
return "";
|
|
568
987
|
for (var t = "arg", r = 0; r < e.length; ++r) {
|
|
569
|
-
var
|
|
570
|
-
e[r] === null || typeof e[r] != "object" && typeof e[r] != "function" ? typeof e[r] == "string" ?
|
|
988
|
+
var n = void 0;
|
|
989
|
+
e[r] === null || typeof e[r] != "object" && typeof e[r] != "function" ? typeof e[r] == "string" ? n = '"' + e[r] + '"' : n = String(e[r]) : ye.has(e[r]) ? n = ye.get(e[r]) : (n = nt, ye.set(e[r], nt++)), t += "@" + n;
|
|
571
990
|
}
|
|
572
991
|
return t;
|
|
573
992
|
}
|
|
574
|
-
function
|
|
993
|
+
function zr(e) {
|
|
575
994
|
if (typeof e == "function")
|
|
576
995
|
try {
|
|
577
996
|
e = e();
|
|
578
997
|
} catch {
|
|
579
998
|
e = "";
|
|
580
999
|
}
|
|
581
|
-
return Array.isArray(e) ? e =
|
|
1000
|
+
return Array.isArray(e) ? e = $r(e) : e = String(e || ""), e;
|
|
582
1001
|
}
|
|
583
|
-
var
|
|
1002
|
+
var Ue = (
|
|
584
1003
|
/** @class */
|
|
585
1004
|
function() {
|
|
586
1005
|
function e(t) {
|
|
587
1006
|
t === void 0 && (t = 0), this.items = /* @__PURE__ */ new Map(), this.ttl = t;
|
|
588
1007
|
}
|
|
589
1008
|
return e.prototype.serializeKey = function(t) {
|
|
590
|
-
return
|
|
1009
|
+
return zr(t);
|
|
591
1010
|
}, e.prototype.get = function(t) {
|
|
592
1011
|
var r = this.serializeKey(t);
|
|
593
1012
|
return this.items.get(r);
|
|
594
|
-
}, e.prototype.set = function(t, r,
|
|
595
|
-
var
|
|
1013
|
+
}, e.prototype.set = function(t, r, n) {
|
|
1014
|
+
var i = this.serializeKey(t), a = n || this.ttl, o = Date.now(), l = {
|
|
596
1015
|
data: r,
|
|
597
1016
|
createdAt: o,
|
|
598
1017
|
expiresAt: a ? o + a : 1 / 0
|
|
599
1018
|
};
|
|
600
|
-
this.dispatchExpire(a,
|
|
601
|
-
}, e.prototype.dispatchExpire = function(t, r,
|
|
602
|
-
var
|
|
1019
|
+
this.dispatchExpire(a, l, i), this.items.set(i, l);
|
|
1020
|
+
}, e.prototype.dispatchExpire = function(t, r, n) {
|
|
1021
|
+
var i = this;
|
|
603
1022
|
t && setTimeout(function() {
|
|
604
1023
|
var a = Date.now(), o = a >= r.expiresAt;
|
|
605
|
-
o &&
|
|
1024
|
+
o && i.delete(n);
|
|
606
1025
|
}, t);
|
|
607
1026
|
}, e.prototype.delete = function(t) {
|
|
608
1027
|
this.items.delete(t);
|
|
609
1028
|
}, e;
|
|
610
1029
|
}()
|
|
611
1030
|
);
|
|
612
|
-
function
|
|
1031
|
+
function jr() {
|
|
613
1032
|
return typeof navigator.onLine < "u" ? navigator.onLine : !0;
|
|
614
1033
|
}
|
|
615
|
-
function
|
|
1034
|
+
function Zr() {
|
|
616
1035
|
return typeof document < "u" && typeof document.visibilityState < "u" ? document.visibilityState !== "hidden" : !0;
|
|
617
1036
|
}
|
|
618
|
-
var
|
|
1037
|
+
var Gr = function(e) {
|
|
619
1038
|
return fetch(e).then(function(t) {
|
|
620
1039
|
return t.json();
|
|
621
1040
|
});
|
|
622
1041
|
};
|
|
623
|
-
const
|
|
624
|
-
isOnline:
|
|
625
|
-
isDocumentVisible:
|
|
626
|
-
fetcher:
|
|
1042
|
+
const pe = {
|
|
1043
|
+
isOnline: jr,
|
|
1044
|
+
isDocumentVisible: Zr,
|
|
1045
|
+
fetcher: Gr
|
|
627
1046
|
};
|
|
628
1047
|
var b = globalThis && globalThis.__assign || function() {
|
|
629
1048
|
return b = Object.assign || function(e) {
|
|
630
|
-
for (var t, r = 1,
|
|
1049
|
+
for (var t, r = 1, n = arguments.length; r < n; r++) {
|
|
631
1050
|
t = arguments[r];
|
|
632
|
-
for (var
|
|
633
|
-
Object.prototype.hasOwnProperty.call(t,
|
|
1051
|
+
for (var i in t)
|
|
1052
|
+
Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
634
1053
|
}
|
|
635
1054
|
return e;
|
|
636
1055
|
}, b.apply(this, arguments);
|
|
637
|
-
},
|
|
638
|
-
function
|
|
1056
|
+
}, F = globalThis && globalThis.__awaiter || function(e, t, r, n) {
|
|
1057
|
+
function i(a) {
|
|
639
1058
|
return a instanceof r ? a : new r(function(o) {
|
|
640
1059
|
o(a);
|
|
641
1060
|
});
|
|
642
1061
|
}
|
|
643
1062
|
return new (r || (r = Promise))(function(a, o) {
|
|
644
|
-
function
|
|
1063
|
+
function l(u) {
|
|
645
1064
|
try {
|
|
646
|
-
s(
|
|
647
|
-
} catch (
|
|
648
|
-
o(
|
|
1065
|
+
s(n.next(u));
|
|
1066
|
+
} catch (c) {
|
|
1067
|
+
o(c);
|
|
649
1068
|
}
|
|
650
1069
|
}
|
|
651
|
-
function
|
|
1070
|
+
function d(u) {
|
|
652
1071
|
try {
|
|
653
|
-
s(
|
|
654
|
-
} catch (
|
|
655
|
-
o(
|
|
1072
|
+
s(n.throw(u));
|
|
1073
|
+
} catch (c) {
|
|
1074
|
+
o(c);
|
|
656
1075
|
}
|
|
657
1076
|
}
|
|
658
1077
|
function s(u) {
|
|
659
|
-
u.done ? a(u.value) :
|
|
1078
|
+
u.done ? a(u.value) : i(u.value).then(l, d);
|
|
660
1079
|
}
|
|
661
|
-
s((
|
|
1080
|
+
s((n = n.apply(e, t || [])).next());
|
|
662
1081
|
});
|
|
663
|
-
},
|
|
1082
|
+
}, k = globalThis && globalThis.__generator || function(e, t) {
|
|
664
1083
|
var r = { label: 0, sent: function() {
|
|
665
1084
|
if (a[0] & 1)
|
|
666
1085
|
throw a[1];
|
|
667
1086
|
return a[1];
|
|
668
|
-
}, trys: [], ops: [] },
|
|
669
|
-
return o = { next:
|
|
1087
|
+
}, trys: [], ops: [] }, n, i, a, o;
|
|
1088
|
+
return o = { next: l(0), throw: l(1), return: l(2) }, typeof Symbol == "function" && (o[Symbol.iterator] = function() {
|
|
670
1089
|
return this;
|
|
671
1090
|
}), o;
|
|
672
|
-
function
|
|
1091
|
+
function l(s) {
|
|
673
1092
|
return function(u) {
|
|
674
|
-
return
|
|
1093
|
+
return d([s, u]);
|
|
675
1094
|
};
|
|
676
1095
|
}
|
|
677
|
-
function
|
|
678
|
-
if (
|
|
1096
|
+
function d(s) {
|
|
1097
|
+
if (n)
|
|
679
1098
|
throw new TypeError("Generator is already executing.");
|
|
680
1099
|
for (; r; )
|
|
681
1100
|
try {
|
|
682
|
-
if (
|
|
1101
|
+
if (n = 1, i && (a = s[0] & 2 ? i.return : s[0] ? i.throw || ((a = i.return) && a.call(i), 0) : i.next) && !(a = a.call(i, s[1])).done)
|
|
683
1102
|
return a;
|
|
684
|
-
switch (
|
|
1103
|
+
switch (i = 0, a && (s = [s[0] & 2, a.value]), s[0]) {
|
|
685
1104
|
case 0:
|
|
686
1105
|
case 1:
|
|
687
1106
|
a = s;
|
|
@@ -689,7 +1108,7 @@ var b = globalThis && globalThis.__assign || function() {
|
|
|
689
1108
|
case 4:
|
|
690
1109
|
return r.label++, { value: s[1], done: !1 };
|
|
691
1110
|
case 5:
|
|
692
|
-
r.label++,
|
|
1111
|
+
r.label++, i = s[1], s = [0];
|
|
693
1112
|
continue;
|
|
694
1113
|
case 7:
|
|
695
1114
|
s = r.ops.pop(), r.trys.pop();
|
|
@@ -716,40 +1135,40 @@ var b = globalThis && globalThis.__assign || function() {
|
|
|
716
1135
|
}
|
|
717
1136
|
s = t.call(e, r);
|
|
718
1137
|
} catch (u) {
|
|
719
|
-
s = [6, u],
|
|
1138
|
+
s = [6, u], i = 0;
|
|
720
1139
|
} finally {
|
|
721
|
-
|
|
1140
|
+
n = a = 0;
|
|
722
1141
|
}
|
|
723
1142
|
if (s[0] & 5)
|
|
724
1143
|
throw s[1];
|
|
725
1144
|
return { value: s[0] ? s[1] : void 0, done: !0 };
|
|
726
1145
|
}
|
|
727
|
-
},
|
|
1146
|
+
}, Kr = globalThis && globalThis.__read || function(e, t) {
|
|
728
1147
|
var r = typeof Symbol == "function" && e[Symbol.iterator];
|
|
729
1148
|
if (!r)
|
|
730
1149
|
return e;
|
|
731
|
-
var
|
|
1150
|
+
var n = r.call(e), i, a = [], o;
|
|
732
1151
|
try {
|
|
733
|
-
for (; (t === void 0 || t-- > 0) && !(
|
|
734
|
-
a.push(
|
|
735
|
-
} catch (
|
|
736
|
-
o = { error:
|
|
1152
|
+
for (; (t === void 0 || t-- > 0) && !(i = n.next()).done; )
|
|
1153
|
+
a.push(i.value);
|
|
1154
|
+
} catch (l) {
|
|
1155
|
+
o = { error: l };
|
|
737
1156
|
} finally {
|
|
738
1157
|
try {
|
|
739
|
-
|
|
1158
|
+
i && !i.done && (r = n.return) && r.call(n);
|
|
740
1159
|
} finally {
|
|
741
1160
|
if (o)
|
|
742
1161
|
throw o.error;
|
|
743
1162
|
}
|
|
744
1163
|
}
|
|
745
1164
|
return a;
|
|
746
|
-
},
|
|
1165
|
+
}, qr = globalThis && globalThis.__spreadArray || function(e, t, r) {
|
|
747
1166
|
if (r || arguments.length === 2)
|
|
748
|
-
for (var
|
|
749
|
-
(a || !(
|
|
1167
|
+
for (var n = 0, i = t.length, a; n < i; n++)
|
|
1168
|
+
(a || !(n in t)) && (a || (a = Array.prototype.slice.call(t, 0, n)), a[n] = t[n]);
|
|
750
1169
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
751
|
-
},
|
|
752
|
-
cache:
|
|
1170
|
+
}, gt = new Ue(), ie = new Ue(), Te = new Ue(), yt = {
|
|
1171
|
+
cache: gt,
|
|
753
1172
|
refreshInterval: 0,
|
|
754
1173
|
ttl: 0,
|
|
755
1174
|
serverTTL: 1e3,
|
|
@@ -759,108 +1178,108 @@ var b = globalThis && globalThis.__assign || function() {
|
|
|
759
1178
|
shouldRetryOnError: !0,
|
|
760
1179
|
errorRetryInterval: 5e3,
|
|
761
1180
|
errorRetryCount: 5,
|
|
762
|
-
fetcher:
|
|
763
|
-
isOnline:
|
|
764
|
-
isDocumentVisible:
|
|
1181
|
+
fetcher: pe.fetcher,
|
|
1182
|
+
isOnline: pe.isOnline,
|
|
1183
|
+
isDocumentVisible: pe.isDocumentVisible
|
|
765
1184
|
};
|
|
766
|
-
function
|
|
767
|
-
var
|
|
768
|
-
if (
|
|
769
|
-
|
|
1185
|
+
function Wr(e, t, r) {
|
|
1186
|
+
var n = ie.get(e);
|
|
1187
|
+
if (n)
|
|
1188
|
+
n.data.push(t);
|
|
770
1189
|
else {
|
|
771
|
-
var
|
|
772
|
-
|
|
1190
|
+
var i = 5e3;
|
|
1191
|
+
ie.set(e, [t], r > 0 ? r + i : r);
|
|
773
1192
|
}
|
|
774
1193
|
}
|
|
775
|
-
function
|
|
1194
|
+
function Br(e, t, r) {
|
|
776
1195
|
if (r.isDocumentVisible() && !(r.errorRetryCount !== void 0 && t > r.errorRetryCount)) {
|
|
777
|
-
var
|
|
1196
|
+
var n = Math.min(t || 0, r.errorRetryCount), i = n * r.errorRetryInterval;
|
|
778
1197
|
setTimeout(function() {
|
|
779
|
-
e(null, { errorRetryCount:
|
|
780
|
-
},
|
|
1198
|
+
e(null, { errorRetryCount: n + 1, shouldRetryOnError: !0 });
|
|
1199
|
+
}, i);
|
|
781
1200
|
}
|
|
782
1201
|
}
|
|
783
|
-
var
|
|
784
|
-
return r === void 0 && (r =
|
|
785
|
-
var
|
|
786
|
-
return
|
|
787
|
-
switch (
|
|
1202
|
+
var at = function(e, t, r, n) {
|
|
1203
|
+
return r === void 0 && (r = gt), n === void 0 && (n = yt.ttl), F(void 0, void 0, void 0, function() {
|
|
1204
|
+
var i, a, o, l, d, s, u;
|
|
1205
|
+
return k(this, function(c) {
|
|
1206
|
+
switch (c.label) {
|
|
788
1207
|
case 0:
|
|
789
|
-
if (!
|
|
1208
|
+
if (!Jr(t))
|
|
790
1209
|
return [3, 5];
|
|
791
|
-
|
|
1210
|
+
c.label = 1;
|
|
792
1211
|
case 1:
|
|
793
|
-
return
|
|
1212
|
+
return c.trys.push([1, 3, , 4]), [4, t];
|
|
794
1213
|
case 2:
|
|
795
|
-
return
|
|
1214
|
+
return i = c.sent(), [3, 4];
|
|
796
1215
|
case 3:
|
|
797
|
-
return
|
|
1216
|
+
return l = c.sent(), a = l, [3, 4];
|
|
798
1217
|
case 4:
|
|
799
1218
|
return [3, 6];
|
|
800
1219
|
case 5:
|
|
801
|
-
|
|
1220
|
+
i = t, c.label = 6;
|
|
802
1221
|
case 6:
|
|
803
|
-
if (o = !1,
|
|
1222
|
+
if (o = !1, d = { data: i, error: a, isValidating: o }, typeof i < "u")
|
|
804
1223
|
try {
|
|
805
|
-
r.set(e,
|
|
1224
|
+
r.set(e, d, n);
|
|
806
1225
|
} catch (f) {
|
|
807
1226
|
console.error("swrv(mutate): failed to set cache", f);
|
|
808
1227
|
}
|
|
809
|
-
return s =
|
|
1228
|
+
return s = ie.get(e), s && s.data.length && (u = s.data.filter(function(f) {
|
|
810
1229
|
return f.key === e;
|
|
811
1230
|
}), u.forEach(function(f, m) {
|
|
812
|
-
typeof
|
|
1231
|
+
typeof d.data < "u" && (f.data = d.data), f.error = d.error, f.isValidating = d.isValidating;
|
|
813
1232
|
var h = m === u.length - 1;
|
|
814
1233
|
h || delete u[m];
|
|
815
|
-
}), u = u.filter(Boolean)), [2,
|
|
1234
|
+
}), u = u.filter(Boolean)), [2, d];
|
|
816
1235
|
}
|
|
817
1236
|
});
|
|
818
1237
|
});
|
|
819
1238
|
};
|
|
820
|
-
function
|
|
1239
|
+
function Qr() {
|
|
821
1240
|
for (var e = this, t = [], r = 0; r < arguments.length; r++)
|
|
822
1241
|
t[r] = arguments[r];
|
|
823
|
-
var
|
|
1242
|
+
var n, i, a = b({}, yt), o = !1, l = !1, d = Et(), s = (d == null ? void 0 : d.proxy) || d;
|
|
824
1243
|
if (!s)
|
|
825
1244
|
return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."), null;
|
|
826
1245
|
var u = (s == null ? void 0 : s.$isServer) || !1;
|
|
827
|
-
t.length >= 1 && (
|
|
828
|
-
var
|
|
829
|
-
typeof
|
|
1246
|
+
t.length >= 1 && (n = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a = b(b({}, a), t[2]));
|
|
1247
|
+
var c = u ? a.serverTTL : a.ttl, f = typeof n == "function" ? n : De(n);
|
|
1248
|
+
typeof i > "u" && (i = a.fetcher);
|
|
830
1249
|
var m = null;
|
|
831
|
-
m || (m =
|
|
1250
|
+
m || (m = wt({
|
|
832
1251
|
data: void 0,
|
|
833
1252
|
error: void 0,
|
|
834
1253
|
isValidating: !0,
|
|
835
1254
|
key: null
|
|
836
1255
|
}));
|
|
837
|
-
var h = function(T,
|
|
838
|
-
return
|
|
839
|
-
var
|
|
840
|
-
return
|
|
841
|
-
switch (
|
|
1256
|
+
var h = function(T, y) {
|
|
1257
|
+
return F(e, void 0, void 0, function() {
|
|
1258
|
+
var Y, _, Z, G, ue, Le, le, Pe = this;
|
|
1259
|
+
return k(this, function(ce) {
|
|
1260
|
+
switch (ce.label) {
|
|
842
1261
|
case 0:
|
|
843
|
-
return
|
|
1262
|
+
return Y = m.data === void 0, _ = f.value, _ ? (Z = a.cache.get(_), G = Z && Z.data, m.isValidating = !0, G && (m.data = G.data, m.error = G.error), ue = T || i, !ue || !a.isDocumentVisible() && !Y || (y == null ? void 0 : y.forceRevalidate) !== void 0 && !(y != null && y.forceRevalidate) ? (m.isValidating = !1, [
|
|
844
1263
|
2
|
|
845
1264
|
/*return*/
|
|
846
|
-
]) :
|
|
1265
|
+
]) : Z && (Le = !!(Date.now() - Z.createdAt >= a.dedupingInterval || y != null && y.forceRevalidate), !Le) ? (m.isValidating = !1, [
|
|
847
1266
|
2
|
|
848
1267
|
/*return*/
|
|
849
|
-
]) : (
|
|
850
|
-
return
|
|
851
|
-
var
|
|
852
|
-
return
|
|
853
|
-
switch (
|
|
1268
|
+
]) : (le = function() {
|
|
1269
|
+
return F(Pe, void 0, void 0, function() {
|
|
1270
|
+
var x, Fe, de, ke;
|
|
1271
|
+
return k(this, function(Q) {
|
|
1272
|
+
switch (Q.label) {
|
|
854
1273
|
case 0:
|
|
855
|
-
return
|
|
1274
|
+
return x = Te.get(_), x ? [3, 2] : (Fe = Array.isArray(_) ? _ : [_], de = ue.apply(void 0, qr([], Kr(Fe), !1)), Te.set(_, de, a.dedupingInterval), [4, at(_, de, a.cache, c)]);
|
|
856
1275
|
case 1:
|
|
857
|
-
return
|
|
1276
|
+
return Q.sent(), [3, 4];
|
|
858
1277
|
case 2:
|
|
859
|
-
return [4,
|
|
1278
|
+
return [4, at(_, x.data, a.cache, c)];
|
|
860
1279
|
case 3:
|
|
861
|
-
|
|
1280
|
+
Q.sent(), Q.label = 4;
|
|
862
1281
|
case 4:
|
|
863
|
-
return m.isValidating = !1,
|
|
1282
|
+
return m.isValidating = !1, Te.delete(_), m.error !== void 0 && (ke = !o && a.shouldRetryOnError && (y ? y.shouldRetryOnError : !0), ke && Br(h, y ? y.errorRetryCount : 1, a)), [
|
|
864
1283
|
2
|
|
865
1284
|
/*return*/
|
|
866
1285
|
];
|
|
@@ -868,13 +1287,13 @@ function Qt() {
|
|
|
868
1287
|
});
|
|
869
1288
|
});
|
|
870
1289
|
}, G && a.revalidateDebounce ? (setTimeout(function() {
|
|
871
|
-
return
|
|
872
|
-
return
|
|
873
|
-
switch (
|
|
1290
|
+
return F(Pe, void 0, void 0, function() {
|
|
1291
|
+
return k(this, function(x) {
|
|
1292
|
+
switch (x.label) {
|
|
874
1293
|
case 0:
|
|
875
|
-
return o ? [3, 2] : [4,
|
|
1294
|
+
return o ? [3, 2] : [4, le()];
|
|
876
1295
|
case 1:
|
|
877
|
-
|
|
1296
|
+
x.sent(), x.label = 2;
|
|
878
1297
|
case 2:
|
|
879
1298
|
return [
|
|
880
1299
|
2
|
|
@@ -888,9 +1307,9 @@ function Qt() {
|
|
|
888
1307
|
/*return*/
|
|
889
1308
|
];
|
|
890
1309
|
case 1:
|
|
891
|
-
return [4,
|
|
1310
|
+
return [4, le()];
|
|
892
1311
|
case 2:
|
|
893
|
-
|
|
1312
|
+
ce.sent(), ce.label = 3;
|
|
894
1313
|
case 3:
|
|
895
1314
|
return [
|
|
896
1315
|
2
|
|
@@ -899,26 +1318,26 @@ function Qt() {
|
|
|
899
1318
|
}
|
|
900
1319
|
});
|
|
901
1320
|
});
|
|
902
|
-
},
|
|
903
|
-
return
|
|
904
|
-
return
|
|
1321
|
+
}, g = function() {
|
|
1322
|
+
return F(e, void 0, void 0, function() {
|
|
1323
|
+
return k(this, function(T) {
|
|
905
1324
|
return [2, h(null, { shouldRetryOnError: !1 })];
|
|
906
1325
|
});
|
|
907
1326
|
});
|
|
908
|
-
},
|
|
909
|
-
|
|
1327
|
+
}, D = null;
|
|
1328
|
+
St(function() {
|
|
910
1329
|
var T = function() {
|
|
911
|
-
return
|
|
912
|
-
return
|
|
913
|
-
switch (
|
|
1330
|
+
return F(e, void 0, void 0, function() {
|
|
1331
|
+
return k(this, function(y) {
|
|
1332
|
+
switch (y.label) {
|
|
914
1333
|
case 0:
|
|
915
1334
|
return !m.error && a.isOnline() ? [4, h()] : [3, 2];
|
|
916
1335
|
case 1:
|
|
917
|
-
return
|
|
1336
|
+
return y.sent(), [3, 3];
|
|
918
1337
|
case 2:
|
|
919
|
-
|
|
1338
|
+
D && clearTimeout(D), y.label = 3;
|
|
920
1339
|
case 3:
|
|
921
|
-
return a.refreshInterval && !o && (
|
|
1340
|
+
return a.refreshInterval && !o && (D = setTimeout(T, a.refreshInterval)), [
|
|
922
1341
|
2
|
|
923
1342
|
/*return*/
|
|
924
1343
|
];
|
|
@@ -926,115 +1345,115 @@ function Qt() {
|
|
|
926
1345
|
});
|
|
927
1346
|
});
|
|
928
1347
|
};
|
|
929
|
-
a.refreshInterval && (
|
|
930
|
-
}),
|
|
931
|
-
o = !0,
|
|
932
|
-
var T =
|
|
933
|
-
T && (T.data = T.data.filter(function(
|
|
934
|
-
return
|
|
1348
|
+
a.refreshInterval && (D = setTimeout(T, a.refreshInterval)), a.revalidateOnFocus && (document.addEventListener("visibilitychange", g, !1), window.addEventListener("focus", g, !1));
|
|
1349
|
+
}), Rt(function() {
|
|
1350
|
+
o = !0, D && clearTimeout(D), a.revalidateOnFocus && (document.removeEventListener("visibilitychange", g, !1), window.removeEventListener("focus", g, !1));
|
|
1351
|
+
var T = ie.get(f.value);
|
|
1352
|
+
T && (T.data = T.data.filter(function(y) {
|
|
1353
|
+
return y !== m;
|
|
935
1354
|
}));
|
|
936
1355
|
});
|
|
937
1356
|
try {
|
|
938
|
-
|
|
939
|
-
|
|
1357
|
+
_t(f, function(T) {
|
|
1358
|
+
It(f) || (f.value = T), m.key = T, m.isValidating = !!T, Wr(f.value, m, c), !u && !l && f.value && h(), l = !1;
|
|
940
1359
|
}, {
|
|
941
1360
|
immediate: !0
|
|
942
1361
|
});
|
|
943
1362
|
} catch {
|
|
944
1363
|
}
|
|
945
|
-
var
|
|
946
|
-
return h(T, b(b({},
|
|
1364
|
+
var A = b(b({}, Nt(m)), { mutate: function(T, y) {
|
|
1365
|
+
return h(T, b(b({}, y), { forceRevalidate: !0 }));
|
|
947
1366
|
} });
|
|
948
|
-
return
|
|
1367
|
+
return A;
|
|
949
1368
|
}
|
|
950
|
-
function
|
|
1369
|
+
function Jr(e) {
|
|
951
1370
|
return e !== null && typeof e == "object" && typeof e.then == "function";
|
|
952
1371
|
}
|
|
953
|
-
function
|
|
1372
|
+
function Xr(e, t, r) {
|
|
954
1373
|
const {
|
|
955
|
-
data:
|
|
956
|
-
error:
|
|
1374
|
+
data: n,
|
|
1375
|
+
error: i,
|
|
957
1376
|
isValidating: a,
|
|
958
1377
|
mutate: o
|
|
959
|
-
} =
|
|
1378
|
+
} = Qr(e, t, {
|
|
960
1379
|
revalidateDebounce: 500,
|
|
961
1380
|
revalidateOnFocus: !1,
|
|
962
1381
|
dedupingInterval: 100,
|
|
963
1382
|
...r
|
|
964
1383
|
});
|
|
965
1384
|
return {
|
|
966
|
-
data:
|
|
967
|
-
var
|
|
968
|
-
return (
|
|
1385
|
+
data: E(() => {
|
|
1386
|
+
var d;
|
|
1387
|
+
return (d = n.value) == null ? void 0 : d.data;
|
|
969
1388
|
}),
|
|
970
|
-
response:
|
|
971
|
-
error:
|
|
1389
|
+
response: n,
|
|
1390
|
+
error: i,
|
|
972
1391
|
isValidating: a,
|
|
973
1392
|
revalidate: o
|
|
974
1393
|
};
|
|
975
1394
|
}
|
|
976
|
-
const
|
|
977
|
-
useI18n:
|
|
978
|
-
useMetricCardBuilder:
|
|
979
|
-
useMetricFetcher:
|
|
980
|
-
useRequest:
|
|
981
|
-
},
|
|
1395
|
+
const $ = {
|
|
1396
|
+
useI18n: xr,
|
|
1397
|
+
useMetricCardBuilder: Vr,
|
|
1398
|
+
useMetricFetcher: Hr,
|
|
1399
|
+
useRequest: Xr
|
|
1400
|
+
}, pt = Symbol("METRICS_PROVIDER_KEY"), en = (e) => {
|
|
982
1401
|
const {
|
|
983
1402
|
dimension: t,
|
|
984
1403
|
dimensionFilterValue: r,
|
|
985
|
-
additionalFilter:
|
|
986
|
-
queryReady:
|
|
1404
|
+
additionalFilter: n,
|
|
1405
|
+
queryReady: i,
|
|
987
1406
|
timeframe: a,
|
|
988
1407
|
hasTrendAccess: o,
|
|
989
|
-
refreshInterval:
|
|
990
|
-
dataFetcher:
|
|
1408
|
+
refreshInterval: l,
|
|
1409
|
+
dataFetcher: d
|
|
991
1410
|
} = e;
|
|
992
1411
|
if (r && !t)
|
|
993
1412
|
throw new Error("Must provide a dimension if filtering by a value");
|
|
994
|
-
const s = !!(t && r), u = !!(t && !r),
|
|
995
|
-
const
|
|
996
|
-
return s &&
|
|
1413
|
+
const s = !!(t && r), u = !!(t && !r), c = E(() => {
|
|
1414
|
+
const D = [];
|
|
1415
|
+
return s && D.push({
|
|
997
1416
|
dimension: t,
|
|
998
|
-
type:
|
|
1417
|
+
type: vt.IN,
|
|
999
1418
|
values: [r]
|
|
1000
|
-
}),
|
|
1419
|
+
}), n.value && D.push(...n.value), D;
|
|
1001
1420
|
}), f = {
|
|
1002
1421
|
metrics: [
|
|
1003
|
-
|
|
1422
|
+
Ae.REQUEST_COUNT
|
|
1004
1423
|
],
|
|
1005
1424
|
// Traffic and error rate cards should only try to query for the dimension if it's going to be used.
|
|
1006
1425
|
// It isn't used for single entity queries.
|
|
1007
1426
|
dimensions: [
|
|
1008
1427
|
...t && !s ? [t] : [],
|
|
1009
|
-
|
|
1428
|
+
L.STATUS_CODE_GROUPED
|
|
1010
1429
|
],
|
|
1011
|
-
filter:
|
|
1012
|
-
queryReady:
|
|
1430
|
+
filter: c,
|
|
1431
|
+
queryReady: i,
|
|
1013
1432
|
timeframe: a,
|
|
1014
1433
|
// Traffic and error rate cards can't query trend if multiple entities are expected.
|
|
1015
1434
|
withTrend: o && !u,
|
|
1016
|
-
refreshInterval:
|
|
1017
|
-
dataFetcher:
|
|
1435
|
+
refreshInterval: l,
|
|
1436
|
+
dataFetcher: d
|
|
1018
1437
|
}, m = {
|
|
1019
1438
|
metrics: [
|
|
1020
|
-
|
|
1439
|
+
Ae.RESPONSE_LATENCY_P99
|
|
1021
1440
|
],
|
|
1022
1441
|
// To keep single-entity queries consistent, don't bother querying the dimension for latency
|
|
1023
1442
|
// in the single-entity case, even though it's possible.
|
|
1024
1443
|
...t && !s ? { dimensions: [t] } : {},
|
|
1025
|
-
filter:
|
|
1026
|
-
queryReady:
|
|
1444
|
+
filter: c,
|
|
1445
|
+
queryReady: i,
|
|
1027
1446
|
timeframe: a,
|
|
1028
1447
|
// Don't query latency trends in the multi-entity case: it's possible, but wasteful.
|
|
1029
1448
|
withTrend: o && !u,
|
|
1030
|
-
refreshInterval:
|
|
1031
|
-
dataFetcher:
|
|
1032
|
-
}, h =
|
|
1449
|
+
refreshInterval: l,
|
|
1450
|
+
dataFetcher: d
|
|
1451
|
+
}, h = $.useMetricFetcher(f), g = $.useMetricFetcher(m);
|
|
1033
1452
|
return {
|
|
1034
1453
|
trafficData: h,
|
|
1035
|
-
latencyData:
|
|
1454
|
+
latencyData: g
|
|
1036
1455
|
};
|
|
1037
|
-
},
|
|
1456
|
+
}, In = /* @__PURE__ */ se({
|
|
1038
1457
|
__name: "MetricsProviderInternal",
|
|
1039
1458
|
props: {
|
|
1040
1459
|
maxTimeframe: { default: p.THIRTY_DAY },
|
|
@@ -1050,84 +1469,84 @@ const H = {
|
|
|
1050
1469
|
},
|
|
1051
1470
|
setup(e) {
|
|
1052
1471
|
const t = e;
|
|
1053
|
-
if (t.dimension && !{}.hasOwnProperty.call(
|
|
1472
|
+
if (t.dimension && !{}.hasOwnProperty.call(L, t.dimension))
|
|
1054
1473
|
throw new Error(`Attempted to use MetricsProvider with an invalid dimension: ${t.dimension}`);
|
|
1055
|
-
const r =
|
|
1474
|
+
const r = E(() => {
|
|
1056
1475
|
if (t.overrideTimeframe)
|
|
1057
1476
|
return t.overrideTimeframe;
|
|
1058
|
-
const a = t.hasTrendAccess ?
|
|
1477
|
+
const a = t.hasTrendAccess ? et.get(t.maxTimeframe) : et.get(p.ONE_DAY);
|
|
1059
1478
|
if (!a)
|
|
1060
1479
|
throw new Error("Metrics provider failed to resolve fallback timeframe.");
|
|
1061
1480
|
return a;
|
|
1062
1481
|
}), {
|
|
1063
|
-
trafficData:
|
|
1064
|
-
latencyData:
|
|
1065
|
-
} =
|
|
1482
|
+
trafficData: n,
|
|
1483
|
+
latencyData: i
|
|
1484
|
+
} = en({
|
|
1066
1485
|
dimension: t.dimension,
|
|
1067
1486
|
dimensionFilterValue: t.filterValue,
|
|
1068
|
-
additionalFilter:
|
|
1069
|
-
queryReady:
|
|
1487
|
+
additionalFilter: He(t, "additionalFilter"),
|
|
1488
|
+
queryReady: He(t, "queryReady"),
|
|
1070
1489
|
timeframe: r,
|
|
1071
1490
|
hasTrendAccess: t.hasTrendAccess,
|
|
1072
1491
|
refreshInterval: t.refreshInterval,
|
|
1073
1492
|
dataFetcher: t.dataFetcher
|
|
1074
1493
|
});
|
|
1075
|
-
return
|
|
1494
|
+
return Ct(pt, {
|
|
1076
1495
|
data: {
|
|
1077
|
-
traffic:
|
|
1078
|
-
latency:
|
|
1496
|
+
traffic: n,
|
|
1497
|
+
latency: i
|
|
1079
1498
|
},
|
|
1080
1499
|
hasTrendAccess: t.hasTrendAccess,
|
|
1081
1500
|
longCardTitles: t.longCardTitles
|
|
1082
|
-
}), (a, o) =>
|
|
1501
|
+
}), (a, o) => st(a.$slots, "default", {
|
|
1083
1502
|
hasTrendAccess: t.hasTrendAccess,
|
|
1084
1503
|
timeframe: r.value
|
|
1085
1504
|
});
|
|
1086
1505
|
}
|
|
1087
1506
|
});
|
|
1088
|
-
function
|
|
1507
|
+
function tn(e) {
|
|
1089
1508
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1090
1509
|
}
|
|
1091
|
-
var
|
|
1510
|
+
var Tt = { exports: {} };
|
|
1092
1511
|
(function(e) {
|
|
1093
1512
|
(function() {
|
|
1094
1513
|
function t(s, u) {
|
|
1095
1514
|
if (u.separator === !1 || s < 1e3)
|
|
1096
1515
|
return s.toString();
|
|
1097
|
-
var
|
|
1098
|
-
return m.reverse().forEach(function(h,
|
|
1099
|
-
|
|
1516
|
+
var c = typeof u.separator == "string" ? u.separator : ",", f = [], m = Math.round(s).toString().split("");
|
|
1517
|
+
return m.reverse().forEach(function(h, g) {
|
|
1518
|
+
g && g % 3 === 0 && f.push(c), f.push(h);
|
|
1100
1519
|
}), f.reverse().join("");
|
|
1101
1520
|
}
|
|
1102
|
-
function r(s, u,
|
|
1103
|
-
var f = s / u, m =
|
|
1104
|
-
return
|
|
1521
|
+
function r(s, u, c) {
|
|
1522
|
+
var f = s / u, m = c.round ? "round" : "floor";
|
|
1523
|
+
return c.decimal === !1 ? (s = Math[m](f), s.toString()) : (c.precision ? s = f : s = f < 10 ? Math[m](f * 10) / 10 : Math[m](f), s = s.toString(), typeof c.decimal == "string" && (s = s.replace(".", c.decimal)), s);
|
|
1105
1524
|
}
|
|
1106
|
-
var
|
|
1107
|
-
function
|
|
1108
|
-
var
|
|
1525
|
+
var n = 1e3, i = 1e4, a = 1e6, o = 1e9, l = 1e12;
|
|
1526
|
+
function d(s, u) {
|
|
1527
|
+
var c;
|
|
1109
1528
|
u = u || {};
|
|
1110
1529
|
var f = s < 0;
|
|
1111
1530
|
f && (s = Math.abs(s)), u.precision && (s = parseFloat(s.toPrecision(u.precision)));
|
|
1112
|
-
var m = u.min10k ?
|
|
1113
|
-
return s < m || u.precision && u.precision > Math.log10(s) ?
|
|
1531
|
+
var m = u.min10k ? i : n;
|
|
1532
|
+
return s < m || u.precision && u.precision > Math.log10(s) ? c = t(r(s, 1, u), u) : s < a ? c = r(s, n, u) + "k" : s < o ? c = r(s, a, u) + "m" : s < l ? c = t(r(s, o, u), u) + "b" : c = t(r(s, l, u), u) + "t", f && (c = "-" + c), u.capital && (c = c.toUpperCase()), u.prefix && (c = u.prefix + c), u.suffix && (c = c + u.suffix), c;
|
|
1114
1533
|
}
|
|
1115
|
-
|
|
1534
|
+
d.addCommas = t, e.exports = d;
|
|
1116
1535
|
})();
|
|
1117
|
-
})(
|
|
1118
|
-
var
|
|
1119
|
-
const
|
|
1120
|
-
var
|
|
1121
|
-
const
|
|
1122
|
-
let
|
|
1123
|
-
return r && (
|
|
1124
|
-
},
|
|
1536
|
+
})(Tt);
|
|
1537
|
+
var rn = Tt.exports;
|
|
1538
|
+
const nn = /* @__PURE__ */ tn(rn);
|
|
1539
|
+
var O = /* @__PURE__ */ ((e) => (e.Small = "sm", e.Medium = "md", e.Large = "lg", e.ExtraLarge = "xl", e))(O || {});
|
|
1540
|
+
const Ye = 2, it = Ye + 2, an = (e, t, r = !1) => {
|
|
1541
|
+
let n = !t || Number(e.toFixed(it)) === 0 ? 0 : Number(e.toFixed(it)) > 0 ? 1 : -1;
|
|
1542
|
+
return r && (n *= -1), n;
|
|
1543
|
+
}, sn = (e, t, r) => t ? `${Math.abs(e * 100).toFixed(Ye)}%` : r, on = (e, t) => t === 0 ? 0 : e / t - 1, un = (e, t = !1) => (t && (e *= -1), e > 0 ? "arrowUp" : e < 0 ? "arrowDown" : "noData"), ln = { class: "metricscard" }, cn = {
|
|
1125
1544
|
key: 0,
|
|
1126
1545
|
class: "metricscard-error"
|
|
1127
|
-
},
|
|
1546
|
+
}, dn = {
|
|
1128
1547
|
key: 1,
|
|
1129
1548
|
class: "metricscard-value"
|
|
1130
|
-
},
|
|
1549
|
+
}, fn = /* @__PURE__ */ se({
|
|
1131
1550
|
__name: "MetricsCard",
|
|
1132
1551
|
props: {
|
|
1133
1552
|
title: {
|
|
@@ -1177,81 +1596,81 @@ const Ee = 2, Ye = Ee + 2, ar = (e, t, r = !1) => {
|
|
|
1177
1596
|
},
|
|
1178
1597
|
setup(e) {
|
|
1179
1598
|
const t = e, r = (o) => {
|
|
1180
|
-
const
|
|
1599
|
+
const l = {
|
|
1181
1600
|
red: "var(--kong-ui-metric-card-trend-negative, var(--red-500, '#d44324'))",
|
|
1182
1601
|
green: "var(--kong-ui-metric-card-trend-positive, var(--green-500, '#07a88d'))",
|
|
1183
1602
|
grey: "var(--kong-ui-metric-card-trend-neutral, var(--grey-500, '#6f7787'))"
|
|
1184
1603
|
};
|
|
1185
|
-
return o > 0 ?
|
|
1186
|
-
},
|
|
1187
|
-
return (o,
|
|
1188
|
-
const
|
|
1189
|
-
return S(),
|
|
1190
|
-
|
|
1191
|
-
class:
|
|
1604
|
+
return o > 0 ? l.green : o < 0 ? l.red : l.grey;
|
|
1605
|
+
}, n = (o) => o > 0 ? "positive" : o < 0 ? "negative" : "neutral", i = [O.Medium, O.Large].includes(t.cardSize), a = t.cardSize === O.ExtraLarge ? "48px" : [O.Medium, O.Large].includes(t.cardSize) ? "22px" : "16px";
|
|
1606
|
+
return (o, l) => {
|
|
1607
|
+
const d = ee("KIcon"), s = ee("KTooltip");
|
|
1608
|
+
return S(), M("div", ln, [
|
|
1609
|
+
K("div", {
|
|
1610
|
+
class: te(["metricscard-title", e.cardSize])
|
|
1192
1611
|
}, [
|
|
1193
|
-
|
|
1194
|
-
e.tooltip ? (S(),
|
|
1612
|
+
K("span", null, q(e.title), 1),
|
|
1613
|
+
e.tooltip ? (S(), re(s, {
|
|
1195
1614
|
key: 0,
|
|
1196
1615
|
class: "metricscard-tooltip",
|
|
1197
1616
|
label: e.tooltip,
|
|
1198
1617
|
placement: "right"
|
|
1199
1618
|
}, {
|
|
1200
|
-
default:
|
|
1201
|
-
|
|
1619
|
+
default: bt(() => [
|
|
1620
|
+
z(d, {
|
|
1202
1621
|
icon: "info",
|
|
1203
1622
|
size: "12"
|
|
1204
1623
|
})
|
|
1205
1624
|
]),
|
|
1206
1625
|
_: 1
|
|
1207
|
-
}, 8, ["label"])) :
|
|
1626
|
+
}, 8, ["label"])) : X("", !0)
|
|
1208
1627
|
], 2),
|
|
1209
|
-
e.hasError ? (S(),
|
|
1210
|
-
|
|
1628
|
+
e.hasError ? (S(), M("div", cn, [
|
|
1629
|
+
z(d, {
|
|
1211
1630
|
icon: "warning",
|
|
1212
1631
|
size: "20"
|
|
1213
1632
|
}),
|
|
1214
|
-
|
|
1215
|
-
])) : (S(),
|
|
1216
|
-
|
|
1217
|
-
style:
|
|
1633
|
+
K("div", null, q(e.errorMessage), 1)
|
|
1634
|
+
])) : (S(), M("div", dn, [
|
|
1635
|
+
K("div", {
|
|
1636
|
+
style: Ot(`font-size:${B(a)}`)
|
|
1218
1637
|
}, q(e.metricValue), 5),
|
|
1219
|
-
|
|
1638
|
+
B(i) ? (S(), M("div", {
|
|
1220
1639
|
key: 0,
|
|
1221
|
-
class:
|
|
1640
|
+
class: te(["metricscard-value-trend", n(e.changePolarity)])
|
|
1222
1641
|
}, [
|
|
1223
|
-
e.changePolarity !== 0 ? (S(),
|
|
1642
|
+
e.changePolarity !== 0 ? (S(), re(d, {
|
|
1224
1643
|
key: 0,
|
|
1225
1644
|
color: r(e.changePolarity),
|
|
1226
1645
|
icon: e.icon,
|
|
1227
1646
|
size: "18"
|
|
1228
|
-
}, null, 8, ["color", "icon"])) :
|
|
1229
|
-
|
|
1230
|
-
], 2)) :
|
|
1647
|
+
}, null, 8, ["color", "icon"])) : X("", !0),
|
|
1648
|
+
K("div", null, q(e.metricChange), 1)
|
|
1649
|
+
], 2)) : X("", !0)
|
|
1231
1650
|
]))
|
|
1232
1651
|
]);
|
|
1233
1652
|
};
|
|
1234
1653
|
}
|
|
1235
|
-
}),
|
|
1654
|
+
}), xe = (e, t) => {
|
|
1236
1655
|
const r = e.__vccOpts || e;
|
|
1237
|
-
for (const [
|
|
1238
|
-
r[
|
|
1656
|
+
for (const [n, i] of t)
|
|
1657
|
+
r[n] = i;
|
|
1239
1658
|
return r;
|
|
1240
|
-
},
|
|
1241
|
-
function
|
|
1242
|
-
const r =
|
|
1243
|
-
return S(),
|
|
1244
|
-
|
|
1245
|
-
|
|
1659
|
+
}, mn = /* @__PURE__ */ xe(fn, [["__scopeId", "data-v-ee980c4c"]]), vn = {}, hn = { class: "loading-tabs" };
|
|
1660
|
+
function gn(e, t) {
|
|
1661
|
+
const r = ee("KSkeletonBox");
|
|
1662
|
+
return S(), M("div", hn, [
|
|
1663
|
+
z(r, { width: "100" }),
|
|
1664
|
+
z(r, { width: "75" })
|
|
1246
1665
|
]);
|
|
1247
1666
|
}
|
|
1248
|
-
const
|
|
1667
|
+
const yn = /* @__PURE__ */ xe(vn, [["render", gn], ["__scopeId", "data-v-e4239529"]]), pn = {
|
|
1249
1668
|
key: 0,
|
|
1250
1669
|
class: "error-display"
|
|
1251
|
-
},
|
|
1670
|
+
}, Tn = {
|
|
1252
1671
|
key: 0,
|
|
1253
1672
|
class: "error-display-message"
|
|
1254
|
-
},
|
|
1673
|
+
}, Dn = /* @__PURE__ */ se({
|
|
1255
1674
|
__name: "MetricCardContainer",
|
|
1256
1675
|
props: {
|
|
1257
1676
|
fallbackDisplayText: {
|
|
@@ -1280,140 +1699,140 @@ const hr = /* @__PURE__ */ Re(fr, [["render", vr], ["__scopeId", "data-v-e423952
|
|
|
1280
1699
|
cardSize: {
|
|
1281
1700
|
type: String,
|
|
1282
1701
|
required: !1,
|
|
1283
|
-
default: () =>
|
|
1702
|
+
default: () => O.Large
|
|
1284
1703
|
}
|
|
1285
1704
|
},
|
|
1286
1705
|
setup(e) {
|
|
1287
|
-
const t = e, r =
|
|
1288
|
-
const a =
|
|
1706
|
+
const t = e, r = E(() => t.cards.every((i) => (i == null ? void 0 : i.hasError) === !0)), n = (i) => {
|
|
1707
|
+
const a = on(i.currentValue, i.previousValue) || 0, o = an(a, t.hasTrendAccess, i.increaseIsBad);
|
|
1289
1708
|
return {
|
|
1290
|
-
metricValue:
|
|
1291
|
-
metricChange:
|
|
1709
|
+
metricValue: i.formatValueFn ? i.formatValueFn(i.currentValue) : nn(i.currentValue, { capital: !0, round: !0 }) || "0",
|
|
1710
|
+
metricChange: i.formatChangeFn ? i.formatChangeFn(a) : sn(a, t.hasTrendAccess, t.fallbackDisplayText),
|
|
1292
1711
|
changePolarity: o,
|
|
1293
|
-
icon:
|
|
1712
|
+
icon: un(o, i.increaseIsBad),
|
|
1294
1713
|
cardSize: t.cardSize
|
|
1295
1714
|
};
|
|
1296
1715
|
};
|
|
1297
|
-
return (
|
|
1298
|
-
const o =
|
|
1299
|
-
return S(),
|
|
1300
|
-
class:
|
|
1716
|
+
return (i, a) => {
|
|
1717
|
+
const o = ee("KIcon");
|
|
1718
|
+
return S(), M("div", {
|
|
1719
|
+
class: te(["kong-ui-public-metric-card-container", e.cardSize])
|
|
1301
1720
|
}, [
|
|
1302
|
-
|
|
1303
|
-
|
|
1721
|
+
B(r) ? (S(), M("div", pn, [
|
|
1722
|
+
z(o, {
|
|
1304
1723
|
class: "error-display-icon",
|
|
1305
1724
|
icon: "warning",
|
|
1306
1725
|
size: "24"
|
|
1307
1726
|
}),
|
|
1308
|
-
e.errorMessage ? (S(),
|
|
1309
|
-
])) : (S(!0),
|
|
1310
|
-
e.loading ? (S(),
|
|
1311
|
-
key: `skeleton-${
|
|
1312
|
-
class:
|
|
1313
|
-
}, null, 8, ["class"])) : (S(),
|
|
1727
|
+
e.errorMessage ? (S(), M("div", Tn, q(e.errorMessage), 1)) : X("", !0)
|
|
1728
|
+
])) : (S(!0), M(Ve, { key: 1 }, At(e.cards, (l, d) => (S(), M(Ve, null, [
|
|
1729
|
+
e.loading ? (S(), re(yn, {
|
|
1730
|
+
key: `skeleton-${d}`,
|
|
1731
|
+
class: te(e.cardSize === B(O).Small ? "loading-tabs-small" : "loading-tabs-large")
|
|
1732
|
+
}, null, 8, ["class"])) : (S(), re(mn, Mt({ key: d }, n(l), {
|
|
1314
1733
|
"card-size": e.cardSize,
|
|
1315
1734
|
"error-message": e.errorMessage,
|
|
1316
|
-
"has-error":
|
|
1317
|
-
title:
|
|
1318
|
-
tooltip:
|
|
1735
|
+
"has-error": l.hasError,
|
|
1736
|
+
title: l.title,
|
|
1737
|
+
tooltip: l.tooltip
|
|
1319
1738
|
}), null, 16, ["card-size", "error-message", "has-error", "title", "tooltip"]))
|
|
1320
1739
|
], 64))), 256))
|
|
1321
1740
|
], 2);
|
|
1322
1741
|
};
|
|
1323
1742
|
}
|
|
1324
|
-
}),
|
|
1325
|
-
const
|
|
1743
|
+
}), En = /* @__PURE__ */ xe(Dn, [["__scopeId", "data-v-390af84f"]]);
|
|
1744
|
+
const Nn = /* @__PURE__ */ se({
|
|
1326
1745
|
__name: "MetricsConsumer",
|
|
1327
1746
|
props: {
|
|
1328
1747
|
lookupKey: { default: void 0 },
|
|
1329
|
-
cardSize: { default:
|
|
1748
|
+
cardSize: { default: O.Large },
|
|
1330
1749
|
cardToDisplay: { default: void 0 }
|
|
1331
1750
|
},
|
|
1332
1751
|
setup(e) {
|
|
1333
|
-
const t = e, r =
|
|
1752
|
+
const t = e, r = Ut(pt);
|
|
1334
1753
|
if (!r)
|
|
1335
1754
|
throw new Error("MetricsConsumer must be nested inside a MetricsProvider instance.");
|
|
1336
|
-
const { traffic:
|
|
1337
|
-
title:
|
|
1338
|
-
record:
|
|
1339
|
-
hasError:
|
|
1755
|
+
const { traffic: n, latency: i } = r.data, { i18n: a } = $.useI18n(), o = $.useMetricCardBuilder({
|
|
1756
|
+
title: E(() => r.longCardTitles ? a.t("metricCard.long.traffic") : a.t("metricCard.short.traffic")),
|
|
1757
|
+
record: n.mapped,
|
|
1758
|
+
hasError: n.hasError,
|
|
1340
1759
|
lookupKey: t.lookupKey,
|
|
1341
1760
|
sumGroupedValues: W
|
|
1342
|
-
}),
|
|
1343
|
-
const
|
|
1761
|
+
}), l = (g) => `${g.toFixed(Ye)}%`, d = E(() => {
|
|
1762
|
+
const g = n.mapped.value, D = H(g, "current", t.lookupKey, tt), A = H(g, "current", t.lookupKey, W), T = D / A * 100 || 0, y = H(g, "previous", t.lookupKey, tt), Y = H(g, "previous", t.lookupKey, W), _ = y / Y * 100 || 0;
|
|
1344
1763
|
return {
|
|
1345
|
-
hasError:
|
|
1764
|
+
hasError: n.hasError.value,
|
|
1346
1765
|
currentValue: T,
|
|
1347
|
-
previousValue:
|
|
1348
|
-
formatValueFn:
|
|
1766
|
+
previousValue: _,
|
|
1767
|
+
formatValueFn: l,
|
|
1349
1768
|
title: r.longCardTitles ? a.t("metricCard.long.errorRate") : a.t("metricCard.short.errorRate"),
|
|
1350
1769
|
increaseIsBad: !0
|
|
1351
1770
|
};
|
|
1352
|
-
}), s = (
|
|
1353
|
-
title:
|
|
1354
|
-
hasError:
|
|
1355
|
-
record:
|
|
1771
|
+
}), s = (g) => `${g}ms`, u = $.useMetricCardBuilder({
|
|
1772
|
+
title: E(() => r.longCardTitles ? a.t("metricCard.long.latency") : a.t("metricCard.short.latency")),
|
|
1773
|
+
hasError: i.hasError,
|
|
1774
|
+
record: i.mapped,
|
|
1356
1775
|
lookupKey: t.lookupKey,
|
|
1357
1776
|
increaseIsBad: !0,
|
|
1358
1777
|
formatValueFn: s
|
|
1359
|
-
}),
|
|
1360
|
-
cards:
|
|
1778
|
+
}), c = E(() => t.cardToDisplay === "TRAFFIC" ? [o.value] : t.cardToDisplay === "ERROR_RATE" ? [d.value] : t.cardToDisplay === "LATENCY" ? [u.value] : [o.value, d.value, u.value]), f = E(() => t.cardToDisplay === "TRAFFIC" || t.cardToDisplay === "ERROR_RATE" ? n.isLoading.value : t.cardToDisplay === "LATENCY" ? i.isLoading.value : n.isLoading.value || i.isLoading.value), m = E(() => ({
|
|
1779
|
+
cards: c.value,
|
|
1361
1780
|
loading: f.value,
|
|
1362
1781
|
hasTrendAccess: r.hasTrendAccess,
|
|
1363
1782
|
fallbackDisplayText: a.t("general.notAvailable"),
|
|
1364
1783
|
cardSize: t.cardSize,
|
|
1365
1784
|
hideTitle: !0
|
|
1366
|
-
})), h =
|
|
1785
|
+
})), h = E(() => ({
|
|
1367
1786
|
loading: m.value.loading,
|
|
1368
1787
|
trafficCard: o.value,
|
|
1369
|
-
errorRateCard:
|
|
1788
|
+
errorRateCard: d.value,
|
|
1370
1789
|
latencyCard: u.value,
|
|
1371
|
-
errorRateFormatted: d
|
|
1790
|
+
errorRateFormatted: l(d.value.currentValue),
|
|
1372
1791
|
latencyFormatted: s(u.value.currentValue)
|
|
1373
1792
|
}));
|
|
1374
|
-
return (
|
|
1375
|
-
|
|
1793
|
+
return (g, D) => st(g.$slots, "default", { cardValues: h.value }, () => [
|
|
1794
|
+
z(B(En), Yt(xt(m.value)), null, 16)
|
|
1376
1795
|
]);
|
|
1377
1796
|
}
|
|
1378
|
-
}),
|
|
1379
|
-
const r = e.body, { startMs:
|
|
1797
|
+
}), J = (e) => new Date(e), Cn = (e, t) => {
|
|
1798
|
+
const r = e.body, { startMs: n, endMs: i } = e.query, a = typeof n != "number" ? parseInt(n, 10) : n, o = typeof i != "number" ? parseInt(i, 10) : i;
|
|
1380
1799
|
e.reply({
|
|
1381
1800
|
statusCode: 200,
|
|
1382
|
-
body:
|
|
1801
|
+
body: wn(r, a, o, t)
|
|
1383
1802
|
});
|
|
1384
|
-
},
|
|
1385
|
-
var
|
|
1386
|
-
const
|
|
1803
|
+
}, wn = (e, t, r, n) => {
|
|
1804
|
+
var c, f;
|
|
1805
|
+
const i = e.granularityMs || 0, a = i ? (r - t) / i : 1;
|
|
1387
1806
|
if (a !== 1 && a !== 2)
|
|
1388
1807
|
throw new Error(
|
|
1389
1808
|
"Query did not request 1 or 2 records. Perhaps there's a chart query on the same page interfering with the stub?"
|
|
1390
1809
|
);
|
|
1391
1810
|
if ((e.dimensions ?? []).length > 2)
|
|
1392
1811
|
throw new Error(`Explore only supports 0-2 dimensions; got: ${JSON.stringify(e.dimensions)}`);
|
|
1393
|
-
const o = (e.dimensions ?? []).find((m) => m !== "TIME"),
|
|
1812
|
+
const o = (e.dimensions ?? []).find((m) => m !== "TIME"), l = (n == null ? void 0 : n.dimensionNames) ?? [], d = Math.max(l.length, 1), s = [];
|
|
1394
1813
|
for (let m = 0; m < a; m++)
|
|
1395
|
-
for (let h = 0; h <
|
|
1396
|
-
const
|
|
1397
|
-
(
|
|
1398
|
-
const
|
|
1814
|
+
for (let h = 0; h < d; h++) {
|
|
1815
|
+
const g = o ? { [o]: l[h] } : {};
|
|
1816
|
+
(c = e.dimensions) != null && c.includes(L.STATUS_CODE_GROUPED) ? W.forEach((D) => {
|
|
1817
|
+
const A = e.metrics.reduce((T, y) => (T[y] = (a - m) * 1e3 + 100 * h + 1, T), { ...g, STATUS_CODE_GROUPED: D });
|
|
1399
1818
|
s.push({
|
|
1400
1819
|
version: "v1",
|
|
1401
|
-
timestamp: m === 0 ?
|
|
1402
|
-
event:
|
|
1820
|
+
timestamp: m === 0 ? J(t).toISOString() : J(t + i).toISOString(),
|
|
1821
|
+
event: A
|
|
1403
1822
|
});
|
|
1404
1823
|
}) : s.push({
|
|
1405
1824
|
version: "v1",
|
|
1406
|
-
timestamp: m === 0 ?
|
|
1407
|
-
event: e.metrics.reduce((
|
|
1825
|
+
timestamp: m === 0 ? J(t).toISOString() : J(t + i).toISOString(),
|
|
1826
|
+
event: e.metrics.reduce((D, A) => (D[A] = (a - m) * 1e3 + 100 * h + 1, D), { ...g })
|
|
1408
1827
|
});
|
|
1409
1828
|
}
|
|
1410
1829
|
const u = {
|
|
1411
1830
|
start: t,
|
|
1412
1831
|
end: r,
|
|
1413
|
-
granularity:
|
|
1832
|
+
granularity: i,
|
|
1414
1833
|
dimensions: o ? {
|
|
1415
|
-
[o]:
|
|
1416
|
-
...(f = e.dimensions) != null && f.includes(
|
|
1834
|
+
[o]: l,
|
|
1835
|
+
...(f = e.dimensions) != null && f.includes(L.STATUS_CODE_GROUPED) ? { STATUS_CODE_GROUPED: W } : {}
|
|
1417
1836
|
} : {},
|
|
1418
1837
|
metricNames: e.metrics
|
|
1419
1838
|
};
|
|
@@ -1423,12 +1842,12 @@ const Or = /* @__PURE__ */ ne({
|
|
|
1423
1842
|
};
|
|
1424
1843
|
};
|
|
1425
1844
|
export {
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1845
|
+
Ae as EXPLORE_V2_AGGREGATIONS,
|
|
1846
|
+
L as EXPLORE_V2_DIMENSIONS,
|
|
1847
|
+
vt as EXPLORE_V2_FILTER_TYPES,
|
|
1848
|
+
Nn as MetricsConsumer,
|
|
1849
|
+
In as MetricsProviderInternal,
|
|
1850
|
+
wn as mockExploreResponse,
|
|
1851
|
+
Cn as mockExploreResponseFromCypress
|
|
1433
1852
|
};
|
|
1434
1853
|
//# sourceMappingURL=vitals-metric-provider.es.js.map
|