@kong-ui-public/analytics-metric-provider 8.3.0 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,11 @@
1
- import { ref as te, watchEffect as He, computed as g, getCurrentInstance as Be, reactive as Ue, onMounted as Ke, onUnmounted as Pe, watch as Ze, isReadonly as Xe, toRefs as Ge, defineComponent as k, inject as ke, toRef as le, provide as je, renderSlot as Le, openBlock as v, createBlock as T, resolveDynamicComponent as L, normalizeStyle as z, withCtx as A, createElementBlock as y, toDisplayString as w, createCommentVNode as R, pushScopeId as V, popScopeId as $, createElementVNode as E, resolveComponent as qe, normalizeClass as Y, unref as N, createTextVNode as Ae, createVNode as G, Fragment as _e, renderList as Ye, mergeProps as Qe, normalizeProps as We, guardReactiveProps as Je } from "vue";
2
- import { TimePeriods as pe, TimeframeKeys as re, stripUnknownFilters as et, queryableExploreDimensions as tt, DeltaQueryTime as rt, UnaryQueryTime as it } from "@kong-ui-public/analytics-utilities";
3
- import { createI18n as nt, i18nTComponent as at } from "@kong-ui-public/i18n";
4
- import { useAnalyticsConfigStore as ot } from "@kong-ui-public/analytics-config-store";
5
- const st = {
1
+ import { ref as j, watchEffect as Me, computed as g, getCurrentInstance as xe, reactive as qe, onMounted as Ue, onUnmounted as Ke, watch as ze, isReadonly as Pe, toRefs as $e, defineComponent as Q, inject as Ie, toRef as re, provide as Be, renderSlot as Ae, resolveComponent as De, openBlock as T, createElementBlock as C, createElementVNode as M, normalizeClass as P, unref as E, createBlock as N, resolveDynamicComponent as te, createCommentVNode as L, withCtx as he, createTextVNode as be, toDisplayString as D, createVNode as K, Fragment as ge, renderList as Xe, mergeProps as Ge, normalizeProps as je, guardReactiveProps as Ye } from "vue";
2
+ import { TimePeriods as ue, TimeframeKeys as Y, stripUnknownFilters as He, queryableExploreDimensions as Qe, DeltaQueryTime as We, UnaryQueryTime as Je } from "@kong-ui-public/analytics-utilities";
3
+ import { createI18n as Ze, i18nTComponent as er } from "@kong-ui-public/i18n";
4
+ import { useAnalyticsConfigStore as rr } from "@kong-ui-public/analytics-config-store";
5
+ import { TrendUpIcon as tr, TrendDownIcon as nr, IndeterminateSmallIcon as we, VitalsIcon as ar, CloudUploadIcon as ir, WarningOutlineIcon as or, ResponseIcon as sr, InfoIcon as ur, WarningIcon as Oe, EqualIcon as lr } from "@kong/icons";
6
+ const cr = {
6
7
  notAvailable: "N/A"
7
- }, lt = {
8
+ }, dr = {
8
9
  short: {
9
10
  traffic: "Requests",
10
11
  errorRate: "Error Rate",
@@ -17,7 +18,7 @@ const st = {
17
18
  averageLatency: "Average Latency",
18
19
  p99Latency: "P99 Latency"
19
20
  }
20
- }, ut = {
21
+ }, fr = {
21
22
  custom: "vs previous {numDays, plural, =1 {day} other {# days}}",
22
23
  "15m": "vs previous 15 minutes",
23
24
  "1h": "vs previous hour",
@@ -32,353 +33,353 @@ const st = {
32
33
  previous_week: "vs previous time period",
33
34
  previous_month: "vs previous time period",
34
35
  previous_quarter: "vs previous quarter"
35
- }, dt = {
36
- general: st,
37
- metricCard: lt,
38
- trendRange: ut
36
+ }, vr = {
37
+ general: cr,
38
+ metricCard: dr,
39
+ trendRange: fr
39
40
  };
40
- function ct() {
41
- const e = nt("en-us", dt);
41
+ function mr() {
42
+ const e = Ze("en-us", vr);
42
43
  return {
43
44
  i18n: e,
44
- i18nT: at(e)
45
+ i18nT: er(e)
45
46
  // Translation component <i18n-t>
46
47
  };
47
48
  }
48
- const ft = 2, Q = ["1XX", "2XX", "3XX", "4XX", "5XX"], we = ["4XX", "5XX"], hi = ["1XX", "2XX", "3XX"], vt = 30 * 1e3, pt = "analytics-query-provider";
49
- var ze = /* @__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))(ze || {});
50
- const gt = (e) => {
51
- var t, r, a, n, i;
49
+ const yr = 2, $ = ["1XX", "2XX", "3XX", "4XX", "5XX"], pe = ["4XX", "5XX"], pt = ["1XX", "2XX", "3XX"], hr = 30 * 1e3, gr = "analytics-query-provider";
50
+ var Le = /* @__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))(Le || {});
51
+ const pr = (e) => {
52
+ var r, t, o, a, n;
52
53
  return e ? !!// TODO: revisit: currently only the first check ever matters?
53
- ((t = Object.keys(e)) != null && t.length || (r = e.data) != null && r.length || (n = (a = e.data) == null ? void 0 : a.data) != null && n.length || !((i = e.data) != null && i.data) && typeof e.data == "object" && Object.keys(e == null ? void 0 : e.data).length) : !1;
54
+ ((r = Object.keys(e)) != null && r.length || (t = e.data) != null && t.length || (a = (o = e.data) == null ? void 0 : o.data) != null && a.length || !((n = e.data) != null && n.data) && typeof e.data == "object" && Object.keys(e == null ? void 0 : e.data).length) : !1;
54
55
  };
55
- function yt(e = te({}), t, r, a = gt) {
56
- const n = te(
56
+ function Rr(e = j({}), r, t, o = pr) {
57
+ const a = j(
57
58
  "PENDING"
58
59
  /* PENDING */
59
60
  );
60
- return He(() => {
61
- const i = a(e.value);
62
- if (e.value && i && r.value) {
63
- n.value = "VALIDATING_HAS_DATA";
61
+ return Me(() => {
62
+ const n = o(e.value);
63
+ if (e.value && n && t.value) {
64
+ a.value = "VALIDATING_HAS_DATA";
64
65
  return;
65
66
  }
66
- if (e.value && r.value) {
67
- n.value = "VALIDATING";
67
+ if (e.value && t.value) {
68
+ a.value = "VALIDATING";
68
69
  return;
69
70
  }
70
- if (e.value && t.value) {
71
- n.value = "STALE_IF_ERROR";
71
+ if (e.value && r.value) {
72
+ a.value = "STALE_IF_ERROR";
72
73
  return;
73
74
  }
74
- if (e.value === void 0 && !t.value) {
75
- n.value = "PENDING";
75
+ if (e.value === void 0 && !r.value) {
76
+ a.value = "PENDING";
76
77
  return;
77
78
  }
78
- if (e.value && !t.value && i) {
79
- n.value = "SUCCESS_HAS_DATA";
79
+ if (e.value && !r.value && n) {
80
+ a.value = "SUCCESS_HAS_DATA";
80
81
  return;
81
82
  }
82
- if (e.value && !t.value) {
83
- n.value = "SUCCESS";
83
+ if (e.value && !r.value) {
84
+ a.value = "SUCCESS";
84
85
  return;
85
86
  }
86
- e.value === void 0 && t && (n.value = "ERROR");
87
+ e.value === void 0 && r && (a.value = "ERROR");
87
88
  }), {
88
- state: n,
89
- swrvState: ze
89
+ state: a,
90
+ swrvState: Le
90
91
  };
91
92
  }
92
- const H = Symbol("default"), ue = "status_code_grouped", Ne = (e, t, r, a, n) => {
93
- e[t][r] || (e[t][r] = {}), e[t][r][a] = n;
93
+ const O = Symbol("default"), ne = "status_code_grouped", Re = (e, r, t, o, a) => {
94
+ e[r][t] || (e[r][t] = {}), e[r][t][o] = a;
94
95
  };
95
- function mt(e, t) {
96
- var c;
97
- const r = ((c = e.meta.metric_names) == null ? void 0 : c[0]) || "", a = e.meta.start_ms, n = Object.keys(e.meta.display || {}), i = !!n.find((d) => d === ue), l = n.find((d) => d !== ue);
98
- return n.length > 2 || n.length > 1 && !i ? (console.error("Don't know how to work with provided dimensions:", n), {
99
- previous: { [H]: { [H]: 0 } },
100
- current: { [H]: { [H]: 0 } }
101
- }) : e.data.reduce((d, o) => {
102
- const s = o.event[r], u = l ? o.event[l] : H, f = i ? o.event[ue] : H;
103
- return new Date(o.timestamp).getTime() === a && t ? Ne(d, "previous", u, f, s) : Ne(d, "current", u, f, s), d;
96
+ function Tr(e, r) {
97
+ var d;
98
+ const t = ((d = e.meta.metric_names) == null ? void 0 : d[0]) || "", o = e.meta.start_ms, a = Object.keys(e.meta.display || {}), n = !!a.find((c) => c === ne), u = a.find((c) => c !== ne);
99
+ return a.length > 2 || a.length > 1 && !n ? (console.error("Don't know how to work with provided dimensions:", a), {
100
+ previous: { [O]: { [O]: 0 } },
101
+ current: { [O]: { [O]: 0 } }
102
+ }) : e.data.reduce((c, i) => {
103
+ const s = i.event[t], l = u ? i.event[u] : O, f = n ? i.event[ne] : O;
104
+ return new Date(i.timestamp).getTime() === o && r ? Re(c, "previous", l, f, s) : Re(c, "current", l, f, s), c;
104
105
  }, {
105
106
  previous: {},
106
107
  current: {}
107
108
  });
108
109
  }
109
- function ht(e) {
110
+ function Er(e) {
110
111
  e.queryReady === void 0 && (e.queryReady = g(() => !0));
111
- const { i18n: t } = K.useI18n(), r = g(() => {
112
- var u, f;
112
+ const { i18n: r } = F.useI18n(), t = g(() => {
113
+ var l, f;
113
114
  return {
114
115
  metrics: e.metrics.value,
115
116
  dimensions: [
116
- ...(u = e.dimensions) != null && u.length ? [...e.dimensions] : [],
117
+ ...(l = e.dimensions) != null && l.length ? [...e.dimensions] : [],
117
118
  ...e.withTrend.value ? ["time"] : []
118
119
  ],
119
120
  granularity: e.withTrend.value ? "trend" : void 0,
120
121
  ...(f = e.filter.value) != null && f.length ? { filters: e.filter.value } : {},
121
122
  time_range: e.timeframe.value.v4Query(e.tz.value)
122
123
  };
123
- }), a = g(() => {
124
- var f, p, b, m;
124
+ }), o = g(() => {
125
+ var f, v, p, m;
125
126
  if (!((f = e.queryReady) != null && f.value))
126
127
  return null;
127
- const u = (p = e.filter) != null && p.value ? JSON.stringify(e.filter.value) : "";
128
- return `metric-fetcher-${e.timeframe.value.cacheKey()}-${(b = e.dimensions) == null ? void 0 : b.join("-")}-${(m = e.metrics.value) == null ? void 0 : m.join("-")}-${u}`;
129
- }), { response: n, error: i, isValidating: l } = K.useRequest(
130
- () => a.value,
128
+ const l = (v = e.filter) != null && v.value ? JSON.stringify(e.filter.value) : "";
129
+ return `metric-fetcher-${e.timeframe.value.cacheKey()}-${(p = e.dimensions) == null ? void 0 : p.join("-")}-${(m = e.metrics.value) == null ? void 0 : m.join("-")}-${l}`;
130
+ }), { response: a, error: n, isValidating: u } = F.useRequest(
131
+ () => o.value,
131
132
  () => e.queryFn({
132
133
  // TODO: Use a type guard to validate that if the datasource is basic,
133
134
  // the query is a valid basic explore query.
134
135
  datasource: e.datasource.value,
135
- query: r.value
136
+ query: t.value
136
137
  }, e.abortController ?? new AbortController()),
137
138
  {
138
139
  refreshInterval: e.refreshInterval,
139
140
  revalidateOnFocus: !1,
140
- errorRetryCount: ft
141
+ errorRetryCount: yr
141
142
  }
142
- ), { state: c, swrvState: d } = yt(n, i, l), o = g(() => {
143
- var u, f, p, b, m, C, I;
144
- return !((f = (u = n.value) == null ? void 0 : u.data) != null && f.length) || !((b = (p = n.value) == null ? void 0 : p.meta) != null && b.display) || !((I = (C = (m = n.value) == null ? void 0 : m.meta) == null ? void 0 : C.metric_names) != null && I.length) ? { current: {}, previous: {} } : mt(n.value, e.withTrend.value);
143
+ ), { state: d, swrvState: c } = Rr(a, n, u), i = g(() => {
144
+ var l, f, v, p, m, h, _;
145
+ return !((f = (l = a.value) == null ? void 0 : l.data) != null && f.length) || !((p = (v = a.value) == null ? void 0 : v.meta) != null && p.display) || !((_ = (h = (m = a.value) == null ? void 0 : m.meta) == null ? void 0 : h.metric_names) != null && _.length) ? { current: {}, previous: {} } : Tr(a.value, e.withTrend.value);
145
146
  }), s = g(() => {
146
- var u, f, p;
147
+ var l, f, v;
147
148
  if (e.timeframe.value.key === "custom") {
148
- if (!((f = (u = n.value) == null ? void 0 : u.meta) != null && f.start_ms))
149
+ if (!((f = (l = a.value) == null ? void 0 : l.meta) != null && f.start_ms))
149
150
  return "";
150
- const { start_ms: b, end_ms: m } = n.value.meta;
151
- let C = (m - b) / (1e3 * 60 * 60 * 24);
152
- return e.withTrend.value && (C /= 2), t.t("trendRange.custom", { numDays: Math.round(C) });
151
+ const { start_ms: p, end_ms: m } = a.value.meta;
152
+ let h = (m - p) / (1e3 * 60 * 60 * 24);
153
+ return e.withTrend.value && (h /= 2), r.t("trendRange.custom", { numDays: Math.round(h) });
153
154
  } else
154
- return e.withTrend.value ? t.t(`trendRange.${e.timeframe.value.key}`) : t.t(`trendRange.${(p = pe.get(re.ONE_DAY)) == null ? void 0 : p.key}`);
155
+ return e.withTrend.value ? r.t(`trendRange.${e.timeframe.value.key}`) : r.t(`trendRange.${(v = ue.get(Y.ONE_DAY)) == null ? void 0 : v.key}`);
155
156
  });
156
157
  return {
157
- isLoading: g(() => d.PENDING === c.value),
158
- hasError: g(() => d.ERROR === c.value),
159
- raw: n,
160
- mapped: o,
158
+ isLoading: g(() => c.PENDING === d.value),
159
+ hasError: g(() => c.ERROR === d.value),
160
+ raw: a,
161
+ mapped: i,
161
162
  trendRange: s
162
163
  };
163
164
  }
164
- const X = (e, t, r = H, a) => (a ?? [H]).reduce((i, l) => {
165
- const c = e[t][r];
166
- return c ? i + (c[l] || 0) : i;
165
+ const U = (e, r, t = O, o) => (o ?? [O]).reduce((n, u) => {
166
+ const d = e[r][t];
167
+ return d ? n + (d[u] || 0) : n;
167
168
  }, 0);
168
- function Ct(e) {
169
+ function _r(e) {
169
170
  const {
170
- cardType: t,
171
- title: r,
172
- description: a,
173
- record: n,
174
- hasError: i,
175
- increaseIsBad: l,
176
- formatValueFn: c,
177
- trendRange: d
171
+ cardType: r,
172
+ title: t,
173
+ description: o,
174
+ record: a,
175
+ hasError: n,
176
+ increaseIsBad: u,
177
+ formatValueFn: d,
178
+ trendRange: c
178
179
  } = e;
179
180
  return g(() => {
180
- let o = 0, s = 0;
181
- if (n != null && n.value)
181
+ let i = 0, s = 0;
182
+ if (a != null && a.value)
182
183
  try {
183
- o = X(n.value, "current", e.lookupKey, e.sumGroupedValues), s = X(n.value, "previous", e.lookupKey, e.sumGroupedValues);
184
- } catch (u) {
184
+ i = U(a.value, "current", e.lookupKey, e.sumGroupedValues), s = U(a.value, "previous", e.lookupKey, e.sumGroupedValues);
185
+ } catch (l) {
185
186
  console.error(
186
187
  "Metric card data doesn't have the expected structure:",
187
- u
188
+ l
188
189
  );
189
190
  }
190
191
  return {
191
- cardType: t,
192
- hasError: i.value,
193
- currentValue: o,
192
+ cardType: r,
193
+ hasError: n.value,
194
+ currentValue: i,
194
195
  previousValue: s,
195
- title: r.value,
196
- description: a,
197
- increaseIsBad: !!l,
196
+ title: t.value,
197
+ description: o,
198
+ increaseIsBad: !!u,
198
199
  // Coerce undefined to false
199
- formatValueFn: c,
200
- trendRange: d == null ? void 0 : d.value
200
+ formatValueFn: d,
201
+ trendRange: c == null ? void 0 : c.value
201
202
  };
202
203
  });
203
204
  }
204
- var de = /* @__PURE__ */ new WeakMap(), Re = 0;
205
- function bt(e) {
205
+ var ae = /* @__PURE__ */ new WeakMap(), Te = 0;
206
+ function Sr(e) {
206
207
  if (!e.length)
207
208
  return "";
208
- for (var t = "arg", r = 0; r < e.length; ++r) {
209
- var a = void 0;
210
- e[r] === null || typeof e[r] != "object" && typeof e[r] != "function" ? typeof e[r] == "string" ? a = '"' + e[r] + '"' : a = String(e[r]) : de.has(e[r]) ? a = de.get(e[r]) : (a = Re, de.set(e[r], Re++)), t += "@" + a;
209
+ for (var r = "arg", t = 0; t < e.length; ++t) {
210
+ var o = void 0;
211
+ e[t] === null || typeof e[t] != "object" && typeof e[t] != "function" ? typeof e[t] == "string" ? o = '"' + e[t] + '"' : o = String(e[t]) : ae.has(e[t]) ? o = ae.get(e[t]) : (o = Te, ae.set(e[t], Te++)), r += "@" + o;
211
212
  }
212
- return t;
213
+ return r;
213
214
  }
214
- function St(e) {
215
+ function Cr(e) {
215
216
  if (typeof e == "function")
216
217
  try {
217
218
  e = e();
218
219
  } catch {
219
220
  e = "";
220
221
  }
221
- return Array.isArray(e) ? e = bt(e) : e = String(e || ""), e;
222
+ return Array.isArray(e) ? e = Sr(e) : e = String(e || ""), e;
222
223
  }
223
- var ge = (
224
+ var le = (
224
225
  /** @class */
225
226
  function() {
226
- function e(t) {
227
- t === void 0 && (t = 0), this.items = /* @__PURE__ */ new Map(), this.ttl = t;
227
+ function e(r) {
228
+ r === void 0 && (r = 0), this.items = /* @__PURE__ */ new Map(), this.ttl = r;
228
229
  }
229
- return e.prototype.serializeKey = function(t) {
230
- return St(t);
231
- }, e.prototype.get = function(t) {
232
- var r = this.serializeKey(t);
233
- return this.items.get(r);
234
- }, e.prototype.set = function(t, r, a) {
235
- var n = this.serializeKey(t), i = a || this.ttl, l = Date.now(), c = {
236
- data: r,
237
- createdAt: l,
238
- expiresAt: i ? l + i : 1 / 0
230
+ return e.prototype.serializeKey = function(r) {
231
+ return Cr(r);
232
+ }, e.prototype.get = function(r) {
233
+ var t = this.serializeKey(r);
234
+ return this.items.get(t);
235
+ }, e.prototype.set = function(r, t, o) {
236
+ var a = this.serializeKey(r), n = o || this.ttl, u = Date.now(), d = {
237
+ data: t,
238
+ createdAt: u,
239
+ expiresAt: n ? u + n : 1 / 0
239
240
  };
240
- this.dispatchExpire(i, c, n), this.items.set(n, c);
241
- }, e.prototype.dispatchExpire = function(t, r, a) {
242
- var n = this;
243
- t && setTimeout(function() {
244
- var i = Date.now(), l = i >= r.expiresAt;
245
- l && n.delete(a);
246
- }, t);
247
- }, e.prototype.delete = function(t) {
248
- this.items.delete(t);
241
+ this.dispatchExpire(n, d, a), this.items.set(a, d);
242
+ }, e.prototype.dispatchExpire = function(r, t, o) {
243
+ var a = this;
244
+ r && setTimeout(function() {
245
+ var n = Date.now(), u = n >= t.expiresAt;
246
+ u && a.delete(o);
247
+ }, r);
248
+ }, e.prototype.delete = function(r) {
249
+ this.items.delete(r);
249
250
  }, e;
250
251
  }()
251
252
  );
252
- function _t() {
253
+ function Ir() {
253
254
  return typeof navigator.onLine < "u" ? navigator.onLine : !0;
254
255
  }
255
- function wt() {
256
+ function Ar() {
256
257
  return typeof document < "u" && typeof document.visibilityState < "u" ? document.visibilityState !== "hidden" : !0;
257
258
  }
258
- var Nt = function(e) {
259
- return fetch(e).then(function(t) {
260
- return t.json();
259
+ var Dr = function(e) {
260
+ return fetch(e).then(function(r) {
261
+ return r.json();
261
262
  });
262
263
  };
263
- const ce = {
264
- isOnline: _t,
265
- isDocumentVisible: wt,
266
- fetcher: Nt
264
+ const ie = {
265
+ isOnline: Ir,
266
+ isDocumentVisible: Ar,
267
+ fetcher: Dr
267
268
  };
268
- var O = function() {
269
- return O = Object.assign || function(e) {
270
- for (var t, r = 1, a = arguments.length; r < a; r++) {
271
- t = arguments[r];
272
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
269
+ var A = function() {
270
+ return A = Object.assign || function(e) {
271
+ for (var r, t = 1, o = arguments.length; t < o; t++) {
272
+ r = arguments[t];
273
+ for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]);
273
274
  }
274
275
  return e;
275
- }, O.apply(this, arguments);
276
- }, P = function(e, t, r, a) {
277
- function n(i) {
278
- return i instanceof r ? i : new r(function(l) {
279
- l(i);
276
+ }, A.apply(this, arguments);
277
+ }, x = function(e, r, t, o) {
278
+ function a(n) {
279
+ return n instanceof t ? n : new t(function(u) {
280
+ u(n);
280
281
  });
281
282
  }
282
- return new (r || (r = Promise))(function(i, l) {
283
- function c(s) {
283
+ return new (t || (t = Promise))(function(n, u) {
284
+ function d(s) {
284
285
  try {
285
- o(a.next(s));
286
- } catch (u) {
287
- l(u);
286
+ i(o.next(s));
287
+ } catch (l) {
288
+ u(l);
288
289
  }
289
290
  }
290
- function d(s) {
291
+ function c(s) {
291
292
  try {
292
- o(a.throw(s));
293
- } catch (u) {
294
- l(u);
293
+ i(o.throw(s));
294
+ } catch (l) {
295
+ u(l);
295
296
  }
296
297
  }
297
- function o(s) {
298
- s.done ? i(s.value) : n(s.value).then(c, d);
298
+ function i(s) {
299
+ s.done ? n(s.value) : a(s.value).then(d, c);
299
300
  }
300
- o((a = a.apply(e, t || [])).next());
301
+ i((o = o.apply(e, r || [])).next());
301
302
  });
302
- }, Z = function(e, t) {
303
- var r = { label: 0, sent: function() {
304
- if (i[0] & 1) throw i[1];
305
- return i[1];
306
- }, trys: [], ops: [] }, a, n, i, l;
307
- return l = { next: c(0), throw: c(1), return: c(2) }, typeof Symbol == "function" && (l[Symbol.iterator] = function() {
303
+ }, q = function(e, r) {
304
+ var t = { label: 0, sent: function() {
305
+ if (n[0] & 1) throw n[1];
306
+ return n[1];
307
+ }, trys: [], ops: [] }, o, a, n, u;
308
+ return u = { next: d(0), throw: d(1), return: d(2) }, typeof Symbol == "function" && (u[Symbol.iterator] = function() {
308
309
  return this;
309
- }), l;
310
- function c(o) {
310
+ }), u;
311
+ function d(i) {
311
312
  return function(s) {
312
- return d([o, s]);
313
+ return c([i, s]);
313
314
  };
314
315
  }
315
- function d(o) {
316
- if (a) throw new TypeError("Generator is already executing.");
317
- for (; r; ) try {
318
- if (a = 1, n && (i = o[0] & 2 ? n.return : o[0] ? n.throw || ((i = n.return) && i.call(n), 0) : n.next) && !(i = i.call(n, o[1])).done) return i;
319
- switch (n = 0, i && (o = [o[0] & 2, i.value]), o[0]) {
316
+ function c(i) {
317
+ if (o) throw new TypeError("Generator is already executing.");
318
+ for (; t; ) try {
319
+ if (o = 1, a && (n = i[0] & 2 ? a.return : i[0] ? a.throw || ((n = a.return) && n.call(a), 0) : a.next) && !(n = n.call(a, i[1])).done) return n;
320
+ switch (a = 0, n && (i = [i[0] & 2, n.value]), i[0]) {
320
321
  case 0:
321
322
  case 1:
322
- i = o;
323
+ n = i;
323
324
  break;
324
325
  case 4:
325
- return r.label++, { value: o[1], done: !1 };
326
+ return t.label++, { value: i[1], done: !1 };
326
327
  case 5:
327
- r.label++, n = o[1], o = [0];
328
+ t.label++, a = i[1], i = [0];
328
329
  continue;
329
330
  case 7:
330
- o = r.ops.pop(), r.trys.pop();
331
+ i = t.ops.pop(), t.trys.pop();
331
332
  continue;
332
333
  default:
333
- if (i = r.trys, !(i = i.length > 0 && i[i.length - 1]) && (o[0] === 6 || o[0] === 2)) {
334
- r = 0;
334
+ if (n = t.trys, !(n = n.length > 0 && n[n.length - 1]) && (i[0] === 6 || i[0] === 2)) {
335
+ t = 0;
335
336
  continue;
336
337
  }
337
- if (o[0] === 3 && (!i || o[1] > i[0] && o[1] < i[3])) {
338
- r.label = o[1];
338
+ if (i[0] === 3 && (!n || i[1] > n[0] && i[1] < n[3])) {
339
+ t.label = i[1];
339
340
  break;
340
341
  }
341
- if (o[0] === 6 && r.label < i[1]) {
342
- r.label = i[1], i = o;
342
+ if (i[0] === 6 && t.label < n[1]) {
343
+ t.label = n[1], n = i;
343
344
  break;
344
345
  }
345
- if (i && r.label < i[2]) {
346
- r.label = i[2], r.ops.push(o);
346
+ if (n && t.label < n[2]) {
347
+ t.label = n[2], t.ops.push(i);
347
348
  break;
348
349
  }
349
- i[2] && r.ops.pop(), r.trys.pop();
350
+ n[2] && t.ops.pop(), t.trys.pop();
350
351
  continue;
351
352
  }
352
- o = t.call(e, r);
353
+ i = r.call(e, t);
353
354
  } catch (s) {
354
- o = [6, s], n = 0;
355
+ i = [6, s], a = 0;
355
356
  } finally {
356
- a = i = 0;
357
+ o = n = 0;
357
358
  }
358
- if (o[0] & 5) throw o[1];
359
- return { value: o[0] ? o[1] : void 0, done: !0 };
359
+ if (i[0] & 5) throw i[1];
360
+ return { value: i[0] ? i[1] : void 0, done: !0 };
360
361
  }
361
- }, Rt = function(e, t) {
362
- var r = typeof Symbol == "function" && e[Symbol.iterator];
363
- if (!r) return e;
364
- var a = r.call(e), n, i = [], l;
362
+ }, br = function(e, r) {
363
+ var t = typeof Symbol == "function" && e[Symbol.iterator];
364
+ if (!t) return e;
365
+ var o = t.call(e), a, n = [], u;
365
366
  try {
366
- for (; (t === void 0 || t-- > 0) && !(n = a.next()).done; ) i.push(n.value);
367
- } catch (c) {
368
- l = { error: c };
367
+ for (; (r === void 0 || r-- > 0) && !(a = o.next()).done; ) n.push(a.value);
368
+ } catch (d) {
369
+ u = { error: d };
369
370
  } finally {
370
371
  try {
371
- n && !n.done && (r = a.return) && r.call(a);
372
+ a && !a.done && (t = o.return) && t.call(o);
372
373
  } finally {
373
- if (l) throw l.error;
374
+ if (u) throw u.error;
374
375
  }
375
376
  }
376
- return i;
377
- }, It = function(e, t, r) {
378
- if (r || arguments.length === 2) for (var a = 0, n = t.length, i; a < n; a++)
379
- (i || !(a in t)) && (i || (i = Array.prototype.slice.call(t, 0, a)), i[a] = t[a]);
380
- return e.concat(i || Array.prototype.slice.call(t));
381
- }, Ve = new ge(), ie = new ge(), fe = new ge(), $e = {
377
+ return n;
378
+ }, wr = function(e, r, t) {
379
+ if (t || arguments.length === 2) for (var o = 0, a = r.length, n; o < a; o++)
380
+ (n || !(o in r)) && (n || (n = Array.prototype.slice.call(r, 0, o)), n[o] = r[o]);
381
+ return e.concat(n || Array.prototype.slice.call(r));
382
+ }, Ve = new le(), H = new le(), oe = new le(), ke = {
382
383
  cache: Ve,
383
384
  refreshInterval: 0,
384
385
  ttl: 0,
@@ -389,121 +390,121 @@ var O = function() {
389
390
  shouldRetryOnError: !0,
390
391
  errorRetryInterval: 5e3,
391
392
  errorRetryCount: 5,
392
- fetcher: ce.fetcher,
393
- isOnline: ce.isOnline,
394
- isDocumentVisible: ce.isDocumentVisible
393
+ fetcher: ie.fetcher,
394
+ isOnline: ie.isOnline,
395
+ isDocumentVisible: ie.isDocumentVisible
395
396
  };
396
- function Tt(e, t, r) {
397
- var a = ie.get(e);
398
- if (a)
399
- a.data.push(t);
397
+ function Or(e, r, t) {
398
+ var o = H.get(e);
399
+ if (o)
400
+ o.data.push(r);
400
401
  else {
401
- var n = 5e3;
402
- ie.set(e, [t], r > 0 ? r + n : r);
402
+ var a = 5e3;
403
+ H.set(e, [r], t > 0 ? t + a : t);
403
404
  }
404
405
  }
405
- function xt(e, t, r) {
406
- if (r.isDocumentVisible() && !(r.errorRetryCount !== void 0 && t > r.errorRetryCount)) {
407
- var a = Math.min(t || 0, r.errorRetryCount), n = a * r.errorRetryInterval;
406
+ function Lr(e, r, t) {
407
+ if (t.isDocumentVisible() && !(t.errorRetryCount !== void 0 && r > t.errorRetryCount)) {
408
+ var o = Math.min(r || 0, t.errorRetryCount), a = o * t.errorRetryInterval;
408
409
  setTimeout(function() {
409
- e(null, { errorRetryCount: a + 1, shouldRetryOnError: !0 });
410
- }, n);
410
+ e(null, { errorRetryCount: o + 1, shouldRetryOnError: !0 });
411
+ }, a);
411
412
  }
412
413
  }
413
- var Ie = function(e, t, r, a) {
414
- return r === void 0 && (r = Ve), a === void 0 && (a = $e.ttl), P(void 0, void 0, void 0, function() {
415
- var n, i, l, c, d, o, s;
416
- return Z(this, function(u) {
417
- switch (u.label) {
414
+ var Ee = function(e, r, t, o) {
415
+ return t === void 0 && (t = Ve), o === void 0 && (o = ke.ttl), x(void 0, void 0, void 0, function() {
416
+ var a, n, u, d, c, i, s;
417
+ return q(this, function(l) {
418
+ switch (l.label) {
418
419
  case 0:
419
- if (!kt(t)) return [3, 5];
420
- u.label = 1;
420
+ if (!kr(r)) return [3, 5];
421
+ l.label = 1;
421
422
  case 1:
422
- return u.trys.push([1, 3, , 4]), [4, t];
423
+ return l.trys.push([1, 3, , 4]), [4, r];
423
424
  case 2:
424
- return n = u.sent(), [3, 4];
425
+ return a = l.sent(), [3, 4];
425
426
  case 3:
426
- return c = u.sent(), i = c, [3, 4];
427
+ return d = l.sent(), n = d, [3, 4];
427
428
  case 4:
428
429
  return [3, 6];
429
430
  case 5:
430
- n = t, u.label = 6;
431
+ a = r, l.label = 6;
431
432
  case 6:
432
- if (l = !1, d = { data: n, error: i, isValidating: l }, typeof n < "u")
433
+ if (u = !1, c = { data: a, error: n, isValidating: u }, typeof a < "u")
433
434
  try {
434
- r.set(e, d, a);
435
+ t.set(e, c, o);
435
436
  } catch (f) {
436
437
  console.error("swrv(mutate): failed to set cache", f);
437
438
  }
438
- return o = ie.get(e), o && o.data.length && (s = o.data.filter(function(f) {
439
+ return i = H.get(e), i && i.data.length && (s = i.data.filter(function(f) {
439
440
  return f.key === e;
440
- }), s.forEach(function(f, p) {
441
- typeof d.data < "u" && (f.data = d.data), f.error = d.error, f.isValidating = d.isValidating;
442
- var b = p === s.length - 1;
443
- b || delete s[p];
444
- }), s = s.filter(Boolean)), [2, d];
441
+ }), s.forEach(function(f, v) {
442
+ typeof c.data < "u" && (f.data = c.data), f.error = c.error, f.isValidating = c.isValidating;
443
+ var p = v === s.length - 1;
444
+ p || delete s[v];
445
+ }), s = s.filter(Boolean)), [2, c];
445
446
  }
446
447
  });
447
448
  });
448
449
  };
449
- function Et() {
450
- for (var e = this, t = [], r = 0; r < arguments.length; r++)
451
- t[r] = arguments[r];
452
- var a, n, i = O({}, $e), l = !1, c = !1, d = Be(), o = (d == null ? void 0 : d.proxy) || d;
453
- if (!o)
450
+ function Vr() {
451
+ for (var e = this, r = [], t = 0; t < arguments.length; t++)
452
+ r[t] = arguments[t];
453
+ var o, a, n = A({}, ke), u = !1, d = !1, c = xe(), i = (c == null ? void 0 : c.proxy) || c;
454
+ if (!i)
454
455
  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;
455
- var s = (o == null ? void 0 : o.$isServer) || !1;
456
- t.length >= 1 && (a = t[0]), t.length >= 2 && (n = t[1]), t.length > 2 && (i = O(O({}, i), t[2]));
457
- var u = s ? i.serverTTL : i.ttl, f = typeof a == "function" ? a : te(a);
458
- typeof n > "u" && (n = i.fetcher);
459
- var p = null;
460
- p || (p = Ue({
456
+ var s = (i == null ? void 0 : i.$isServer) || !1;
457
+ r.length >= 1 && (o = r[0]), r.length >= 2 && (a = r[1]), r.length > 2 && (n = A(A({}, n), r[2]));
458
+ var l = s ? n.serverTTL : n.ttl, f = typeof o == "function" ? o : j(o);
459
+ typeof a > "u" && (a = n.fetcher);
460
+ var v = null;
461
+ v || (v = qe({
461
462
  data: void 0,
462
463
  error: void 0,
463
464
  isValidating: !0,
464
465
  key: null
465
466
  }));
466
- var b = function(S, h) {
467
- return P(e, void 0, void 0, function() {
468
- var q, x, B, j, ne, he, ae, Ce = this;
469
- return Z(this, function(oe) {
470
- switch (oe.label) {
467
+ var p = function(R, y) {
468
+ return x(e, void 0, void 0, function() {
469
+ var I, S, V, z, W, fe, J, ve = this;
470
+ return q(this, function(Z) {
471
+ switch (Z.label) {
471
472
  case 0:
472
- return q = p.data === void 0, x = f.value, x ? (B = i.cache.get(x), j = B && B.data, p.isValidating = !0, j && (p.data = j.data, p.error = j.error), ne = S || n, !ne || !i.isDocumentVisible() && !q || (h == null ? void 0 : h.forceRevalidate) !== void 0 && !(h != null && h.forceRevalidate) ? (p.isValidating = !1, [
473
+ return I = v.data === void 0, S = f.value, S ? (V = n.cache.get(S), z = V && V.data, v.isValidating = !0, z && (v.data = z.data, v.error = z.error), W = R || a, !W || !n.isDocumentVisible() && !I || (y == null ? void 0 : y.forceRevalidate) !== void 0 && !(y != null && y.forceRevalidate) ? (v.isValidating = !1, [
473
474
  2
474
475
  /*return*/
475
- ]) : B && (he = !!(Date.now() - B.createdAt >= i.dedupingInterval || h != null && h.forceRevalidate), !he) ? (p.isValidating = !1, [
476
+ ]) : V && (fe = !!(Date.now() - V.createdAt >= n.dedupingInterval || y != null && y.forceRevalidate), !fe) ? (v.isValidating = !1, [
476
477
  2
477
478
  /*return*/
478
- ]) : (ae = function() {
479
- return P(Ce, void 0, void 0, function() {
480
- var U, be, se, Se;
481
- return Z(this, function(W) {
482
- switch (W.label) {
479
+ ]) : (J = function() {
480
+ return x(ve, void 0, void 0, function() {
481
+ var k, me, ee, ye;
482
+ return q(this, function(B) {
483
+ switch (B.label) {
483
484
  case 0:
484
- return U = fe.get(x), U ? [3, 2] : (be = Array.isArray(x) ? x : [x], se = ne.apply(void 0, It([], Rt(be), !1)), fe.set(x, se, i.dedupingInterval), [4, Ie(x, se, i.cache, u)]);
485
+ return k = oe.get(S), k ? [3, 2] : (me = Array.isArray(S) ? S : [S], ee = W.apply(void 0, wr([], br(me), !1)), oe.set(S, ee, n.dedupingInterval), [4, Ee(S, ee, n.cache, l)]);
485
486
  case 1:
486
- return W.sent(), [3, 4];
487
+ return B.sent(), [3, 4];
487
488
  case 2:
488
- return [4, Ie(x, U.data, i.cache, u)];
489
+ return [4, Ee(S, k.data, n.cache, l)];
489
490
  case 3:
490
- W.sent(), W.label = 4;
491
+ B.sent(), B.label = 4;
491
492
  case 4:
492
- return p.isValidating = !1, fe.delete(x), p.error !== void 0 && (Se = !l && i.shouldRetryOnError && (h ? h.shouldRetryOnError : !0), Se && xt(b, h ? h.errorRetryCount : 1, i)), [
493
+ return v.isValidating = !1, oe.delete(S), v.error !== void 0 && (ye = !u && n.shouldRetryOnError && (y ? y.shouldRetryOnError : !0), ye && Lr(p, y ? y.errorRetryCount : 1, n)), [
493
494
  2
494
495
  /*return*/
495
496
  ];
496
497
  }
497
498
  });
498
499
  });
499
- }, j && i.revalidateDebounce ? (setTimeout(function() {
500
- return P(Ce, void 0, void 0, function() {
501
- return Z(this, function(U) {
502
- switch (U.label) {
500
+ }, z && n.revalidateDebounce ? (setTimeout(function() {
501
+ return x(ve, void 0, void 0, function() {
502
+ return q(this, function(k) {
503
+ switch (k.label) {
503
504
  case 0:
504
- return l ? [3, 2] : [4, ae()];
505
+ return u ? [3, 2] : [4, J()];
505
506
  case 1:
506
- U.sent(), U.label = 2;
507
+ k.sent(), k.label = 2;
507
508
  case 2:
508
509
  return [
509
510
  2
@@ -512,14 +513,14 @@ function Et() {
512
513
  }
513
514
  });
514
515
  });
515
- }, i.revalidateDebounce), [3, 3]) : [3, 1])) : [
516
+ }, n.revalidateDebounce), [3, 3]) : [3, 1])) : [
516
517
  2
517
518
  /*return*/
518
519
  ];
519
520
  case 1:
520
- return [4, ae()];
521
+ return [4, J()];
521
522
  case 2:
522
- oe.sent(), oe.label = 3;
523
+ Z.sent(), Z.label = 3;
523
524
  case 3:
524
525
  return [
525
526
  2
@@ -529,25 +530,25 @@ function Et() {
529
530
  });
530
531
  });
531
532
  }, m = function() {
532
- return P(e, void 0, void 0, function() {
533
- return Z(this, function(S) {
534
- return [2, b(null, { shouldRetryOnError: !1 })];
533
+ return x(e, void 0, void 0, function() {
534
+ return q(this, function(R) {
535
+ return [2, p(null, { shouldRetryOnError: !1 })];
535
536
  });
536
537
  });
537
- }, C = null;
538
- Ke(function() {
539
- var S = function() {
540
- return P(e, void 0, void 0, function() {
541
- return Z(this, function(h) {
542
- switch (h.label) {
538
+ }, h = null;
539
+ Ue(function() {
540
+ var R = function() {
541
+ return x(e, void 0, void 0, function() {
542
+ return q(this, function(y) {
543
+ switch (y.label) {
543
544
  case 0:
544
- return !p.error && i.isOnline() ? [4, b()] : [3, 2];
545
+ return !v.error && n.isOnline() ? [4, p()] : [3, 2];
545
546
  case 1:
546
- return h.sent(), [3, 3];
547
+ return y.sent(), [3, 3];
547
548
  case 2:
548
- C && clearTimeout(C), h.label = 3;
549
+ h && clearTimeout(h), y.label = 3;
549
550
  case 3:
550
- return i.refreshInterval && !l && (C = setTimeout(S, i.refreshInterval)), [
551
+ return n.refreshInterval && !u && (h = setTimeout(R, n.refreshInterval)), [
551
552
  2
552
553
  /*return*/
553
554
  ];
@@ -555,133 +556,133 @@ function Et() {
555
556
  });
556
557
  });
557
558
  };
558
- i.refreshInterval && (C = setTimeout(S, i.refreshInterval)), i.revalidateOnFocus && (document.addEventListener("visibilitychange", m, !1), window.addEventListener("focus", m, !1));
559
- }), Pe(function() {
560
- l = !0, C && clearTimeout(C), i.revalidateOnFocus && (document.removeEventListener("visibilitychange", m, !1), window.removeEventListener("focus", m, !1));
561
- var S = ie.get(f.value);
562
- S && (S.data = S.data.filter(function(h) {
563
- return h !== p;
559
+ n.refreshInterval && (h = setTimeout(R, n.refreshInterval)), n.revalidateOnFocus && (document.addEventListener("visibilitychange", m, !1), window.addEventListener("focus", m, !1));
560
+ }), Ke(function() {
561
+ u = !0, h && clearTimeout(h), n.revalidateOnFocus && (document.removeEventListener("visibilitychange", m, !1), window.removeEventListener("focus", m, !1));
562
+ var R = H.get(f.value);
563
+ R && (R.data = R.data.filter(function(y) {
564
+ return y !== v;
564
565
  }));
565
566
  });
566
567
  try {
567
- Ze(f, function(S) {
568
- Xe(f) || (f.value = S), p.key = S, p.isValidating = !!S, Tt(f.value, p, u), !s && !c && f.value && b(), c = !1;
568
+ ze(f, function(R) {
569
+ Pe(f) || (f.value = R), v.key = R, v.isValidating = !!R, Or(f.value, v, l), !s && !d && f.value && p(), d = !1;
569
570
  }, {
570
571
  immediate: !0
571
572
  });
572
573
  } catch {
573
574
  }
574
- var I = O(O({}, Ge(p)), { mutate: function(S, h) {
575
- return b(S, O(O({}, h), { forceRevalidate: !0 }));
575
+ var _ = A(A({}, $e(v)), { mutate: function(R, y) {
576
+ return p(R, A(A({}, y), { forceRevalidate: !0 }));
576
577
  } });
577
- return I;
578
+ return _;
578
579
  }
579
- function kt(e) {
580
+ function kr(e) {
580
581
  return e !== null && typeof e == "object" && typeof e.then == "function";
581
582
  }
582
- function Lt(e, t, r) {
583
+ function Nr(e, r, t) {
583
584
  const {
584
- data: a,
585
- error: n,
586
- isValidating: i,
587
- mutate: l
588
- } = Et(e, t, {
585
+ data: o,
586
+ error: a,
587
+ isValidating: n,
588
+ mutate: u
589
+ } = Vr(e, r, {
589
590
  revalidateDebounce: 500,
590
591
  revalidateOnFocus: !1,
591
592
  dedupingInterval: 100,
592
- ...r
593
+ ...t
593
594
  });
594
595
  return {
595
- data: g(() => a.value),
596
- response: a,
597
- error: n,
598
- isValidating: i,
599
- revalidate: l
596
+ data: g(() => o.value),
597
+ response: o,
598
+ error: a,
599
+ isValidating: n,
600
+ revalidate: u
600
601
  };
601
602
  }
602
- const K = {
603
- useI18n: ct,
604
- useMetricCardBuilder: Ct,
605
- useMetricFetcher: ht,
606
- useRequest: Lt
607
- }, De = Symbol("METRICS_PROVIDER_KEY"), qt = (e) => {
603
+ const F = {
604
+ useI18n: mr,
605
+ useMetricCardBuilder: _r,
606
+ useMetricFetcher: Er,
607
+ useRequest: Nr
608
+ }, Ne = Symbol("METRICS_PROVIDER_KEY"), Fr = (e) => {
608
609
  const {
609
- datasource: t,
610
- dimension: r,
611
- dimensionFilterValue: a,
612
- additionalFilter: n,
613
- queryReady: i,
614
- timeframe: l,
615
- tz: c,
616
- hasTrendAccess: d,
617
- refreshInterval: o,
610
+ datasource: r,
611
+ dimension: t,
612
+ dimensionFilterValue: o,
613
+ additionalFilter: a,
614
+ queryReady: n,
615
+ timeframe: u,
616
+ tz: d,
617
+ hasTrendAccess: c,
618
+ refreshInterval: i,
618
619
  abortController: s,
619
- queryFn: u,
620
+ queryFn: l,
620
621
  averageLatencies: f
621
622
  } = e;
622
- if (a && !r)
623
+ if (o && !t)
623
624
  throw new Error("Must provide a dimension if filtering by a value");
624
- const p = !!(r && a), b = !!(r && !a), m = g(() => {
625
- const q = [];
626
- return p && q.push({
627
- dimension: r,
625
+ const v = !!(t && o), p = !!(t && !o), m = g(() => {
626
+ const I = [];
627
+ return v && I.push({
628
+ dimension: t,
628
629
  type: "in",
629
- values: [a]
630
- }), n.value && q.push(...et(t.value, n.value)), q;
631
- }), C = {
632
- datasource: t,
633
- metrics: te([
630
+ values: [o]
631
+ }), a.value && I.push(...He(r.value, a.value)), I;
632
+ }), h = {
633
+ datasource: r,
634
+ metrics: j([
634
635
  "request_count"
635
636
  ]),
636
637
  // Traffic and error rate cards should only try to query for the dimension if it's going to be used.
637
638
  // It isn't used for single entity queries.
638
639
  dimensions: [
639
- ...r && !p ? [r] : [],
640
+ ...t && !v ? [t] : [],
640
641
  "status_code_grouped"
641
642
  ],
642
643
  filter: m,
643
- queryReady: i,
644
- timeframe: l,
645
- tz: c,
644
+ queryReady: n,
645
+ timeframe: u,
646
+ tz: d,
646
647
  // Traffic and error rate cards can't query trend if multiple entities are expected.
647
- withTrend: g(() => d.value && !b),
648
- refreshInterval: o,
649
- queryFn: u,
648
+ withTrend: g(() => c.value && !p),
649
+ refreshInterval: i,
650
+ queryFn: l,
650
651
  abortController: s
651
- }, I = {
652
- datasource: t,
652
+ }, _ = {
653
+ datasource: r,
653
654
  metrics: g(() => [
654
655
  f.value ? "response_latency_average" : "response_latency_p99"
655
656
  ]),
656
657
  // To keep single-entity queries consistent, don't bother querying the dimension for latency
657
658
  // in the single-entity case, even though it's possible.
658
- ...r && !p ? { dimensions: [r] } : {},
659
+ ...t && !v ? { dimensions: [t] } : {},
659
660
  filter: m,
660
- queryReady: i,
661
- timeframe: l,
662
- tz: c,
661
+ queryReady: n,
662
+ timeframe: u,
663
+ tz: d,
663
664
  // Don't query latency trends in the multi-entity case: it's possible, but wasteful.
664
- withTrend: g(() => d.value && !b),
665
- refreshInterval: o,
666
- queryFn: u,
665
+ withTrend: g(() => c.value && !p),
666
+ refreshInterval: i,
667
+ queryFn: l,
667
668
  abortController: s
668
- }, S = K.useMetricFetcher(C), h = K.useMetricFetcher(I);
669
+ }, R = F.useMetricFetcher(h), y = F.useMetricFetcher(_);
669
670
  return {
670
- trafficData: S,
671
- latencyData: h
671
+ trafficData: R,
672
+ latencyData: y
672
673
  };
673
- }, Ci = /* @__PURE__ */ k({
674
+ }, Rt = /* @__PURE__ */ Q({
674
675
  __name: "MetricsProvider",
675
676
  props: {
676
677
  datasource: { default: void 0 },
677
- maxTimeframe: { default: re.THIRTY_DAY },
678
+ maxTimeframe: { default: Y.THIRTY_DAY },
678
679
  overrideTimeframe: { default: void 0 },
679
680
  tz: { default: void 0 },
680
681
  dimension: { default: void 0 },
681
682
  filterValue: { default: void 0 },
682
683
  additionalFilter: { default: void 0 },
683
684
  queryReady: { type: Boolean, default: !0 },
684
- refreshInterval: { default: vt },
685
+ refreshInterval: { default: hr },
685
686
  longCardTitles: { type: Boolean, default: !1 },
686
687
  containerTitle: { default: void 0 },
687
688
  description: { default: void 0 },
@@ -689,1090 +690,85 @@ const K = {
689
690
  abortController: { default: void 0 }
690
691
  },
691
692
  setup(e) {
692
- const t = e;
693
- if (t.dimension && tt.findIndex((p) => p === t.dimension) === -1)
694
- throw new Error(`Attempted to use MetricsProvider with an invalid dimension: ${t.dimension}`);
695
- const r = ke(pt);
696
- let a;
697
- r ? a = r.queryFn : (console.warn("Analytics dashboards require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/analytics-metric-provider/README.md#requirements"), a = () => Promise.reject(new Error("Query bridge required")));
698
- const n = ot(), i = g(() => !0), l = g(() => !n.loading && t.queryReady), c = g(() => t.tz ? t.tz : new Intl.DateTimeFormat().resolvedOptions().timeZone), d = g(() => t.datasource ? t.datasource : "basic"), o = g(() => t.overrideTimeframe || pe.get(re.SEVEN_DAY)), s = g(() => !t.percentileLatency), {
699
- trafficData: u,
693
+ const r = e;
694
+ if (r.dimension && Qe.findIndex((v) => v === r.dimension) === -1)
695
+ throw new Error(`Attempted to use MetricsProvider with an invalid dimension: ${r.dimension}`);
696
+ const t = Ie(gr);
697
+ let o;
698
+ t ? o = t.queryFn : (console.warn("Analytics dashboards require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/analytics-metric-provider/README.md#requirements"), o = () => Promise.reject(new Error("Query bridge required")));
699
+ const a = rr(), n = g(() => !0), u = g(() => !a.loading && r.queryReady), d = g(() => r.tz ? r.tz : new Intl.DateTimeFormat().resolvedOptions().timeZone), c = g(() => r.datasource ? r.datasource : "basic"), i = g(() => r.overrideTimeframe || ue.get(Y.SEVEN_DAY)), s = g(() => !r.percentileLatency), {
700
+ trafficData: l,
700
701
  latencyData: f
701
- } = qt({
702
- datasource: d,
703
- dimension: t.dimension,
704
- dimensionFilterValue: t.filterValue,
705
- additionalFilter: le(t, "additionalFilter"),
706
- queryReady: l,
707
- timeframe: o,
708
- tz: c,
709
- hasTrendAccess: i,
710
- refreshInterval: t.refreshInterval,
711
- queryFn: a,
702
+ } = Fr({
703
+ datasource: c,
704
+ dimension: r.dimension,
705
+ dimensionFilterValue: r.filterValue,
706
+ additionalFilter: re(r, "additionalFilter"),
707
+ queryReady: u,
708
+ timeframe: i,
709
+ tz: d,
710
+ hasTrendAccess: n,
711
+ refreshInterval: r.refreshInterval,
712
+ queryFn: o,
712
713
  averageLatencies: s,
713
- abortController: t.abortController
714
+ abortController: r.abortController
714
715
  });
715
- return je(De, {
716
+ return Be(Ne, {
716
717
  data: {
717
- traffic: u,
718
+ traffic: l,
718
719
  latency: f
719
720
  },
720
- description: le(() => t.description),
721
- containerTitle: le(() => t.containerTitle),
722
- hasTrendAccess: i,
723
- longCardTitles: t.longCardTitles,
721
+ description: re(() => r.description),
722
+ containerTitle: re(() => r.containerTitle),
723
+ hasTrendAccess: n,
724
+ longCardTitles: r.longCardTitles,
724
725
  averageLatencies: s
725
- }), (p, b) => Le(p.$slots, "default", {
726
- hasTrendAccess: i.value,
727
- timeframe: o.value
726
+ }), (v, p) => Ae(v.$slots, "default", {
727
+ hasTrendAccess: n.value,
728
+ timeframe: i.value
728
729
  });
729
730
  }
730
731
  });
731
- function At(e) {
732
+ function Mr(e) {
732
733
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
733
734
  }
734
- var Oe = { exports: {} };
735
+ var Fe = { exports: {} };
735
736
  (function(e) {
736
737
  (function() {
737
- function t(o, s) {
738
- if (s.separator === !1 || o < 1e3)
739
- return o.toString();
740
- var u = typeof s.separator == "string" ? s.separator : ",", f = [], p = Math.round(o).toString().split("");
741
- return p.reverse().forEach(function(b, m) {
742
- m && m % 3 === 0 && f.push(u), f.push(b);
738
+ function r(i, s) {
739
+ if (s.separator === !1 || i < 1e3)
740
+ return i.toString();
741
+ var l = typeof s.separator == "string" ? s.separator : ",", f = [], v = Math.round(i).toString().split("");
742
+ return v.reverse().forEach(function(p, m) {
743
+ m && m % 3 === 0 && f.push(l), f.push(p);
743
744
  }), f.reverse().join("");
744
745
  }
745
- function r(o, s, u) {
746
- var f = o / s, p = u.round ? "round" : "floor";
747
- return u.decimal === !1 ? (o = Math[p](f), o.toString()) : (u.precision ? o = f : o = f < 10 ? Math[p](f * 10) / 10 : Math[p](f), o = o.toString(), typeof u.decimal == "string" && (o = o.replace(".", u.decimal)), o);
746
+ function t(i, s, l) {
747
+ var f = i / s, v = l.round ? "round" : "floor";
748
+ return l.decimal === !1 ? (i = Math[v](f), i.toString()) : (l.precision ? i = f : i = f < 10 ? Math[v](f * 10) / 10 : Math[v](f), i = i.toString(), typeof l.decimal == "string" && (i = i.replace(".", l.decimal)), i);
748
749
  }
749
- var a = 1e3, n = 1e4, i = 1e6, l = 1e9, c = 1e12;
750
- function d(o, s) {
751
- var u;
750
+ var o = 1e3, a = 1e4, n = 1e6, u = 1e9, d = 1e12;
751
+ function c(i, s) {
752
+ var l;
752
753
  s = s || {};
753
- var f = o < 0;
754
- f && (o = Math.abs(o)), s.precision && (o = parseFloat(o.toPrecision(s.precision)));
755
- var p = s.min10k ? n : a;
756
- return o < p || s.precision && s.precision > Math.log10(o) ? u = t(r(o, 1, s), s) : o < i ? u = r(o, a, s) + "k" : o < l ? u = r(o, i, s) + "m" : o < c ? u = t(r(o, l, s), s) + "b" : u = t(r(o, c, s), s) + "t", f && (u = "-" + u), s.capital && (u = u.toUpperCase()), s.prefix && (u = s.prefix + u), s.suffix && (u = u + s.suffix), u;
754
+ var f = i < 0;
755
+ f && (i = Math.abs(i)), s.precision && (i = parseFloat(i.toPrecision(s.precision)));
756
+ var v = s.min10k ? a : o;
757
+ return i < v || s.precision && s.precision > Math.log10(i) ? l = r(t(i, 1, s), s) : i < n ? l = t(i, o, s) + "k" : i < u ? l = t(i, n, s) + "m" : i < d ? l = r(t(i, u, s), s) + "b" : l = r(t(i, d, s), s) + "t", f && (l = "-" + l), s.capital && (l = l.toUpperCase()), s.prefix && (l = s.prefix + l), s.suffix && (l = l + s.suffix), l;
757
758
  }
758
- d.addCommas = t, e.exports = d;
759
+ c.addCommas = r, e.exports = c;
759
760
  })();
760
- })(Oe);
761
- var zt = Oe.exports;
762
- const Vt = /* @__PURE__ */ At(zt);
763
- var M = /* @__PURE__ */ ((e) => (e.GENERIC_COUNT = "GenericCount", e.TRAFFIC = "Traffic", e.ERROR_RATE = "ErrorRate", e.LATENCY = "Latency", e))(M || {}), F = /* @__PURE__ */ ((e) => (e.Small = "sm", e.Medium = "md", e.Large = "lg", e.ExtraLarge = "xl", e))(F || {});
764
- const _ = "24px", D = (e, t) => {
765
- const r = e.__vccOpts || e;
766
- for (const [a, n] of t)
767
- r[a] = n;
768
- return r;
769
- }, $t = (e) => (V("data-v-c017eab7"), e = e(), $(), e), Dt = ["aria-hidden"], Ot = {
770
- key: 0,
771
- "data-testid": "kui-icon-svg-title"
772
- }, Mt = /* @__PURE__ */ $t(() => /* @__PURE__ */ E("path", {
773
- d: "M6.5 20C4.98333 20 3.6875 19.475 2.6125 18.425C1.5375 17.375 1 16.0917 1 14.575C1 13.275 1.39167 12.1167 2.175 11.1C2.95833 10.0833 3.98333 9.43333 5.25 9.15C5.66667 7.61667 6.5 6.375 7.75 5.425C9 4.475 10.4167 4 12 4C13.95 4 15.6042 4.67917 16.9625 6.0375C18.3208 7.39583 19 9.05 19 11C20.15 11.1333 21.1042 11.6292 21.8625 12.4875C22.6208 13.3458 23 14.35 23 15.5C23 16.75 22.5625 17.8125 21.6875 18.6875C20.8125 19.5625 19.75 20 18.5 20H13C12.45 20 11.9792 19.8042 11.5875 19.4125C11.1958 19.0208 11 18.55 11 18V12.85L9.4 14.4L8 13L12 9L16 13L14.6 14.4L13 12.85V18H18.5C19.2 18 19.7917 17.7583 20.275 17.275C20.7583 16.7917 21 16.2 21 15.5C21 14.8 20.7583 14.2083 20.275 13.725C19.7917 13.2417 19.2 13 18.5 13H17V11C17 9.61667 16.5125 8.4375 15.5375 7.4625C14.5625 6.4875 13.3833 6 12 6C10.6167 6 9.4375 6.4875 8.4625 7.4625C7.4875 8.4375 7 9.61667 7 11H6.5C5.53333 11 4.70833 11.3417 4.025 12.025C3.34167 12.7083 3 13.5333 3 14.5C3 15.4667 3.34167 16.2917 4.025 16.975C4.70833 17.6583 5.53333 18 6.5 18H9V20H6.5Z",
774
- fill: "currentColor"
775
- }, null, -1)), Ft = /* @__PURE__ */ k({
776
- __name: "CloudUploadIcon",
777
- props: {
778
- /** The accessibility text provided to screen readers */
779
- title: {
780
- type: String,
781
- required: !1,
782
- default: ""
783
- },
784
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
785
- color: {
786
- type: String,
787
- required: !1,
788
- default: "currentColor"
789
- },
790
- /** The CSS display property for the icon. Defaults to `block` */
791
- display: {
792
- type: String,
793
- required: !1,
794
- default: "block"
795
- },
796
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
797
- decorative: {
798
- type: Boolean,
799
- required: !1,
800
- default: !1
801
- },
802
- /** The icon size */
803
- size: {
804
- type: [Number, String],
805
- required: !1,
806
- default: _,
807
- // if setting to the imported const fails, just pass a number of 24 as the default.
808
- validator: (e) => {
809
- if (typeof e == "number" && e > 0)
810
- return !0;
811
- if (typeof e == "string") {
812
- const t = String(e).replace(/px/gi, ""), r = Number(t);
813
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
814
- return !0;
815
- }
816
- return !1;
817
- }
818
- },
819
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
820
- as: {
821
- type: String,
822
- required: !1,
823
- default: "span"
824
- }
825
- },
826
- setup(e) {
827
- const t = e, r = g(() => {
828
- if (typeof t.size == "number" && t.size > 0)
829
- return `${t.size}px`;
830
- if (typeof t.size == "string") {
831
- const n = String(t.size).replace(/px/gi, ""), i = Number(n);
832
- if (i && !isNaN(i) && Number.isInteger(i) && i > 0)
833
- return `${i}px`;
834
- }
835
- return _;
836
- }), a = g(() => ({
837
- boxSizing: "border-box",
838
- color: t.color,
839
- display: t.display,
840
- flexShrink: "0",
841
- height: r.value,
842
- lineHeight: "0",
843
- width: r.value
844
- }));
845
- return (n, i) => (v(), T(L(e.as), {
846
- "aria-hidden": e.decorative ? "true" : void 0,
847
- class: "kui-icon cloud-upload-icon",
848
- "data-testid": "kui-icon-wrapper-cloud-upload-icon",
849
- style: z(a.value)
850
- }, {
851
- default: A(() => [
852
- (v(), y("svg", {
853
- "aria-hidden": e.decorative ? "true" : void 0,
854
- "data-testid": "kui-icon-svg-cloud-upload-icon",
855
- fill: "none",
856
- height: "100%",
857
- role: "img",
858
- viewBox: "0 0 24 24",
859
- width: "100%",
860
- xmlns: "http://www.w3.org/2000/svg"
861
- }, [
862
- e.title ? (v(), y("title", Ot, w(e.title), 1)) : R("", !0),
863
- Mt
864
- ], 8, Dt))
865
- ]),
866
- _: 1
867
- }, 8, ["aria-hidden", "style"]));
868
- }
869
- }), Ht = /* @__PURE__ */ D(Ft, [["__scopeId", "data-v-c017eab7"]]), Bt = (e) => (V("data-v-68742da1"), e = e(), $(), e), Ut = ["aria-hidden"], Kt = {
870
- key: 0,
871
- "data-testid": "kui-icon-svg-title"
872
- }, Pt = /* @__PURE__ */ Bt(() => /* @__PURE__ */ E("path", {
873
- d: "M4 17V14H20V17H4ZM4 10V7H20V10H4Z",
874
- fill: "currentColor"
875
- }, null, -1)), Zt = /* @__PURE__ */ k({
876
- __name: "EqualIcon",
877
- props: {
878
- /** The accessibility text provided to screen readers */
879
- title: {
880
- type: String,
881
- required: !1,
882
- default: ""
883
- },
884
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
885
- color: {
886
- type: String,
887
- required: !1,
888
- default: "currentColor"
889
- },
890
- /** The CSS display property for the icon. Defaults to `block` */
891
- display: {
892
- type: String,
893
- required: !1,
894
- default: "block"
895
- },
896
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
897
- decorative: {
898
- type: Boolean,
899
- required: !1,
900
- default: !1
901
- },
902
- /** The icon size */
903
- size: {
904
- type: [Number, String],
905
- required: !1,
906
- default: _,
907
- // if setting to the imported const fails, just pass a number of 24 as the default.
908
- validator: (e) => {
909
- if (typeof e == "number" && e > 0)
910
- return !0;
911
- if (typeof e == "string") {
912
- const t = String(e).replace(/px/gi, ""), r = Number(t);
913
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
914
- return !0;
915
- }
916
- return !1;
917
- }
918
- },
919
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
920
- as: {
921
- type: String,
922
- required: !1,
923
- default: "span"
924
- }
925
- },
926
- setup(e) {
927
- const t = e, r = g(() => {
928
- if (typeof t.size == "number" && t.size > 0)
929
- return `${t.size}px`;
930
- if (typeof t.size == "string") {
931
- const n = String(t.size).replace(/px/gi, ""), i = Number(n);
932
- if (i && !isNaN(i) && Number.isInteger(i) && i > 0)
933
- return `${i}px`;
934
- }
935
- return _;
936
- }), a = g(() => ({
937
- boxSizing: "border-box",
938
- color: t.color,
939
- display: t.display,
940
- flexShrink: "0",
941
- height: r.value,
942
- lineHeight: "0",
943
- width: r.value
944
- }));
945
- return (n, i) => (v(), T(L(e.as), {
946
- "aria-hidden": e.decorative ? "true" : void 0,
947
- class: "kui-icon equal-icon",
948
- "data-testid": "kui-icon-wrapper-equal-icon",
949
- style: z(a.value)
950
- }, {
951
- default: A(() => [
952
- (v(), y("svg", {
953
- "aria-hidden": e.decorative ? "true" : void 0,
954
- "data-testid": "kui-icon-svg-equal-icon",
955
- fill: "none",
956
- height: "100%",
957
- role: "img",
958
- viewBox: "0 0 24 24",
959
- width: "100%",
960
- xmlns: "http://www.w3.org/2000/svg"
961
- }, [
962
- e.title ? (v(), y("title", Kt, w(e.title), 1)) : R("", !0),
963
- Pt
964
- ], 8, Ut))
965
- ]),
966
- _: 1
967
- }, 8, ["aria-hidden", "style"]));
968
- }
969
- }), Xt = /* @__PURE__ */ D(Zt, [["__scopeId", "data-v-68742da1"]]), Gt = (e) => (V("data-v-e4bfb72f"), e = e(), $(), e), jt = ["aria-hidden"], Yt = {
970
- key: 0,
971
- "data-testid": "kui-icon-svg-title"
972
- }, Qt = /* @__PURE__ */ Gt(() => /* @__PURE__ */ E("path", {
973
- d: "M5 11V9H15V11H5Z",
974
- fill: "currentColor"
975
- }, null, -1)), Wt = /* @__PURE__ */ k({
976
- __name: "IndeterminateSmallIcon",
977
- props: {
978
- /** The accessibility text provided to screen readers */
979
- title: {
980
- type: String,
981
- required: !1,
982
- default: ""
983
- },
984
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
985
- color: {
986
- type: String,
987
- required: !1,
988
- default: "currentColor"
989
- },
990
- /** The CSS display property for the icon. Defaults to `block` */
991
- display: {
992
- type: String,
993
- required: !1,
994
- default: "block"
995
- },
996
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
997
- decorative: {
998
- type: Boolean,
999
- required: !1,
1000
- default: !1
1001
- },
1002
- /** The icon size */
1003
- size: {
1004
- type: [Number, String],
1005
- required: !1,
1006
- default: _,
1007
- // if setting to the imported const fails, just pass a number of 24 as the default.
1008
- validator: (e) => {
1009
- if (typeof e == "number" && e > 0)
1010
- return !0;
1011
- if (typeof e == "string") {
1012
- const t = String(e).replace(/px/gi, ""), r = Number(t);
1013
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
1014
- return !0;
1015
- }
1016
- return !1;
1017
- }
1018
- },
1019
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
1020
- as: {
1021
- type: String,
1022
- required: !1,
1023
- default: "span"
1024
- }
1025
- },
1026
- setup(e) {
1027
- const t = e, r = g(() => {
1028
- if (typeof t.size == "number" && t.size > 0)
1029
- return `${t.size}px`;
1030
- if (typeof t.size == "string") {
1031
- const n = String(t.size).replace(/px/gi, ""), i = Number(n);
1032
- if (i && !isNaN(i) && Number.isInteger(i) && i > 0)
1033
- return `${i}px`;
1034
- }
1035
- return _;
1036
- }), a = g(() => ({
1037
- boxSizing: "border-box",
1038
- color: t.color,
1039
- display: t.display,
1040
- flexShrink: "0",
1041
- height: r.value,
1042
- lineHeight: "0",
1043
- width: r.value
1044
- }));
1045
- return (n, i) => (v(), T(L(e.as), {
1046
- "aria-hidden": e.decorative ? "true" : void 0,
1047
- class: "kui-icon indeterminate-small-icon",
1048
- "data-testid": "kui-icon-wrapper-indeterminate-small-icon",
1049
- style: z(a.value)
1050
- }, {
1051
- default: A(() => [
1052
- (v(), y("svg", {
1053
- "aria-hidden": e.decorative ? "true" : void 0,
1054
- "data-testid": "kui-icon-svg-indeterminate-small-icon",
1055
- fill: "none",
1056
- height: "100%",
1057
- role: "img",
1058
- viewBox: "0 0 24 24",
1059
- width: "100%",
1060
- xmlns: "http://www.w3.org/2000/svg"
1061
- }, [
1062
- e.title ? (v(), y("title", Yt, w(e.title), 1)) : R("", !0),
1063
- Qt
1064
- ], 8, jt))
1065
- ]),
1066
- _: 1
1067
- }, 8, ["aria-hidden", "style"]));
1068
- }
1069
- }), Me = /* @__PURE__ */ D(Wt, [["__scopeId", "data-v-e4bfb72f"]]), Jt = (e) => (V("data-v-b700bc86"), e = e(), $(), e), er = ["aria-hidden"], tr = {
1070
- key: 0,
1071
- "data-testid": "kui-icon-svg-title"
1072
- }, rr = /* @__PURE__ */ Jt(() => /* @__PURE__ */ E("path", {
1073
- d: "M11 17H13V11H11V17ZM12 9C12.2833 9 12.5208 8.90417 12.7125 8.7125C12.9042 8.52083 13 8.28333 13 8C13 7.71667 12.9042 7.47917 12.7125 7.2875C12.5208 7.09583 12.2833 7 12 7C11.7167 7 11.4792 7.09583 11.2875 7.2875C11.0958 7.47917 11 7.71667 11 8C11 8.28333 11.0958 8.52083 11.2875 8.7125C11.4792 8.90417 11.7167 9 12 9ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2C13.3833 2 14.6833 2.2625 15.9 2.7875C17.1167 3.3125 18.175 4.025 19.075 4.925C19.975 5.825 20.6875 6.88333 21.2125 8.1C21.7375 9.31667 22 10.6167 22 12C22 13.3833 21.7375 14.6833 21.2125 15.9C20.6875 17.1167 19.975 18.175 19.075 19.075C18.175 19.975 17.1167 20.6875 15.9 21.2125C14.6833 21.7375 13.3833 22 12 22Z",
1074
- fill: "currentColor"
1075
- }, null, -1)), ir = /* @__PURE__ */ k({
1076
- __name: "InfoIcon",
1077
- props: {
1078
- /** The accessibility text provided to screen readers */
1079
- title: {
1080
- type: String,
1081
- required: !1,
1082
- default: ""
1083
- },
1084
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
1085
- color: {
1086
- type: String,
1087
- required: !1,
1088
- default: "currentColor"
1089
- },
1090
- /** The CSS display property for the icon. Defaults to `block` */
1091
- display: {
1092
- type: String,
1093
- required: !1,
1094
- default: "block"
1095
- },
1096
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
1097
- decorative: {
1098
- type: Boolean,
1099
- required: !1,
1100
- default: !1
1101
- },
1102
- /** The icon size */
1103
- size: {
1104
- type: [Number, String],
1105
- required: !1,
1106
- default: _,
1107
- // if setting to the imported const fails, just pass a number of 24 as the default.
1108
- validator: (e) => {
1109
- if (typeof e == "number" && e > 0)
1110
- return !0;
1111
- if (typeof e == "string") {
1112
- const t = String(e).replace(/px/gi, ""), r = Number(t);
1113
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
1114
- return !0;
1115
- }
1116
- return !1;
1117
- }
1118
- },
1119
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
1120
- as: {
1121
- type: String,
1122
- required: !1,
1123
- default: "span"
1124
- }
1125
- },
1126
- setup(e) {
1127
- const t = e, r = g(() => {
1128
- if (typeof t.size == "number" && t.size > 0)
1129
- return `${t.size}px`;
1130
- if (typeof t.size == "string") {
1131
- const n = String(t.size).replace(/px/gi, ""), i = Number(n);
1132
- if (i && !isNaN(i) && Number.isInteger(i) && i > 0)
1133
- return `${i}px`;
1134
- }
1135
- return _;
1136
- }), a = g(() => ({
1137
- boxSizing: "border-box",
1138
- color: t.color,
1139
- display: t.display,
1140
- flexShrink: "0",
1141
- height: r.value,
1142
- lineHeight: "0",
1143
- width: r.value
1144
- }));
1145
- return (n, i) => (v(), T(L(e.as), {
1146
- "aria-hidden": e.decorative ? "true" : void 0,
1147
- class: "kui-icon info-icon",
1148
- "data-testid": "kui-icon-wrapper-info-icon",
1149
- style: z(a.value)
1150
- }, {
1151
- default: A(() => [
1152
- (v(), y("svg", {
1153
- "aria-hidden": e.decorative ? "true" : void 0,
1154
- "data-testid": "kui-icon-svg-info-icon",
1155
- fill: "none",
1156
- height: "100%",
1157
- role: "img",
1158
- viewBox: "0 0 24 24",
1159
- width: "100%",
1160
- xmlns: "http://www.w3.org/2000/svg"
1161
- }, [
1162
- e.title ? (v(), y("title", tr, w(e.title), 1)) : R("", !0),
1163
- rr
1164
- ], 8, er))
1165
- ]),
1166
- _: 1
1167
- }, 8, ["aria-hidden", "style"]));
1168
- }
1169
- }), nr = /* @__PURE__ */ D(ir, [["__scopeId", "data-v-b700bc86"]]), ar = (e) => (V("data-v-f152798a"), e = e(), $(), e), or = ["aria-hidden"], sr = {
1170
- key: 0,
1171
- "data-testid": "kui-icon-svg-title"
1172
- }, lr = /* @__PURE__ */ ar(() => /* @__PURE__ */ E("path", {
1173
- d: "M15.25 5C14.9 5 14.6042 4.87917 14.3625 4.6375C14.1208 4.39583 14 4.1 14 3.75C14 3.4 14.1208 3.10417 14.3625 2.8625C14.6042 2.62083 14.9 2.5 15.25 2.5C15.6 2.5 15.8958 2.62083 16.1375 2.8625C16.3792 3.10417 16.5 3.4 16.5 3.75C16.5 4.1 16.3792 4.39583 16.1375 4.6375C15.8958 4.87917 15.6 5 15.25 5ZM15.25 21.5C14.9 21.5 14.6042 21.3792 14.3625 21.1375C14.1208 20.8958 14 20.6 14 20.25C14 19.9 14.1208 19.6042 14.3625 19.3625C14.6042 19.1208 14.9 19 15.25 19C15.6 19 15.8958 19.1208 16.1375 19.3625C16.3792 19.6042 16.5 19.9 16.5 20.25C16.5 20.6 16.3792 20.8958 16.1375 21.1375C15.8958 21.3792 15.6 21.5 15.25 21.5ZM19.25 8.5C18.9 8.5 18.6042 8.37917 18.3625 8.1375C18.1208 7.89583 18 7.6 18 7.25C18 6.9 18.1208 6.60417 18.3625 6.3625C18.6042 6.12083 18.9 6 19.25 6C19.6 6 19.8958 6.12083 20.1375 6.3625C20.3792 6.60417 20.5 6.9 20.5 7.25C20.5 7.6 20.3792 7.89583 20.1375 8.1375C19.8958 8.37917 19.6 8.5 19.25 8.5ZM19.25 18C18.9 18 18.6042 17.8792 18.3625 17.6375C18.1208 17.3958 18 17.1 18 16.75C18 16.4 18.1208 16.1042 18.3625 15.8625C18.6042 15.6208 18.9 15.5 19.25 15.5C19.6 15.5 19.8958 15.6208 20.1375 15.8625C20.3792 16.1042 20.5 16.4 20.5 16.75C20.5 17.1 20.3792 17.3958 20.1375 17.6375C19.8958 17.8792 19.6 18 19.25 18ZM20.75 13.25C20.4 13.25 20.1042 13.1292 19.8625 12.8875C19.6208 12.6458 19.5 12.35 19.5 12C19.5 11.65 19.6208 11.3542 19.8625 11.1125C20.1042 10.8708 20.4 10.75 20.75 10.75C21.1 10.75 21.3958 10.8708 21.6375 11.1125C21.8792 11.3542 22 11.65 22 12C22 12.35 21.8792 12.6458 21.6375 12.8875C21.3958 13.1292 21.1 13.25 20.75 13.25ZM12 22C10.6167 22 9.31667 21.7375 8.1 21.2125C6.88333 20.6875 5.825 19.975 4.925 19.075C4.025 18.175 3.3125 17.1167 2.7875 15.9C2.2625 14.6833 2 13.3833 2 12C2 10.6167 2.2625 9.31667 2.7875 8.1C3.3125 6.88333 4.025 5.825 4.925 4.925C5.825 4.025 6.88333 3.3125 8.1 2.7875C9.31667 2.2625 10.6167 2 12 2V4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20V22ZM12 14C11.45 14 10.9792 13.8042 10.5875 13.4125C10.1958 13.0208 10 12.55 10 12C10 11.9167 10.0042 11.8292 10.0125 11.7375C10.0208 11.6458 10.0417 11.5583 10.075 11.475L8 9.4L9.4 8L11.475 10.075C11.5417 10.0583 11.7167 10.0333 12 10C12.55 10 13.0208 10.1958 13.4125 10.5875C13.8042 10.9792 14 11.45 14 12C14 12.55 13.8042 13.0208 13.4125 13.4125C13.0208 13.8042 12.55 14 12 14Z",
1174
- fill: "currentColor"
1175
- }, null, -1)), ur = /* @__PURE__ */ k({
1176
- __name: "ResponseIcon",
1177
- props: {
1178
- /** The accessibility text provided to screen readers */
1179
- title: {
1180
- type: String,
1181
- required: !1,
1182
- default: ""
1183
- },
1184
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
1185
- color: {
1186
- type: String,
1187
- required: !1,
1188
- default: "currentColor"
1189
- },
1190
- /** The CSS display property for the icon. Defaults to `block` */
1191
- display: {
1192
- type: String,
1193
- required: !1,
1194
- default: "block"
1195
- },
1196
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
1197
- decorative: {
1198
- type: Boolean,
1199
- required: !1,
1200
- default: !1
1201
- },
1202
- /** The icon size */
1203
- size: {
1204
- type: [Number, String],
1205
- required: !1,
1206
- default: _,
1207
- // if setting to the imported const fails, just pass a number of 24 as the default.
1208
- validator: (e) => {
1209
- if (typeof e == "number" && e > 0)
1210
- return !0;
1211
- if (typeof e == "string") {
1212
- const t = String(e).replace(/px/gi, ""), r = Number(t);
1213
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
1214
- return !0;
1215
- }
1216
- return !1;
1217
- }
1218
- },
1219
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
1220
- as: {
1221
- type: String,
1222
- required: !1,
1223
- default: "span"
1224
- }
1225
- },
1226
- setup(e) {
1227
- const t = e, r = g(() => {
1228
- if (typeof t.size == "number" && t.size > 0)
1229
- return `${t.size}px`;
1230
- if (typeof t.size == "string") {
1231
- const n = String(t.size).replace(/px/gi, ""), i = Number(n);
1232
- if (i && !isNaN(i) && Number.isInteger(i) && i > 0)
1233
- return `${i}px`;
1234
- }
1235
- return _;
1236
- }), a = g(() => ({
1237
- boxSizing: "border-box",
1238
- color: t.color,
1239
- display: t.display,
1240
- flexShrink: "0",
1241
- height: r.value,
1242
- lineHeight: "0",
1243
- width: r.value
1244
- }));
1245
- return (n, i) => (v(), T(L(e.as), {
1246
- "aria-hidden": e.decorative ? "true" : void 0,
1247
- class: "kui-icon response-icon",
1248
- "data-testid": "kui-icon-wrapper-response-icon",
1249
- style: z(a.value)
1250
- }, {
1251
- default: A(() => [
1252
- (v(), y("svg", {
1253
- "aria-hidden": e.decorative ? "true" : void 0,
1254
- "data-testid": "kui-icon-svg-response-icon",
1255
- fill: "none",
1256
- height: "100%",
1257
- role: "img",
1258
- viewBox: "0 0 24 24",
1259
- width: "100%",
1260
- xmlns: "http://www.w3.org/2000/svg"
1261
- }, [
1262
- e.title ? (v(), y("title", sr, w(e.title), 1)) : R("", !0),
1263
- lr
1264
- ], 8, or))
1265
- ]),
1266
- _: 1
1267
- }, 8, ["aria-hidden", "style"]));
1268
- }
1269
- }), dr = /* @__PURE__ */ D(ur, [["__scopeId", "data-v-f152798a"]]), cr = (e) => (V("data-v-218c4e42"), e = e(), $(), e), fr = ["aria-hidden"], vr = {
1270
- key: 0,
1271
- "data-testid": "kui-icon-svg-title"
1272
- }, pr = /* @__PURE__ */ cr(() => /* @__PURE__ */ E("path", {
1273
- d: "M16 18V16H18.6L13.4 10.85L9.4 14.85L2 7.4L3.4 6L9.4 12L13.4 8L20 14.6V12H22V18H16Z",
1274
- fill: "currentColor"
1275
- }, null, -1)), gr = /* @__PURE__ */ k({
1276
- __name: "TrendDownIcon",
1277
- props: {
1278
- /** The accessibility text provided to screen readers */
1279
- title: {
1280
- type: String,
1281
- required: !1,
1282
- default: ""
1283
- },
1284
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
1285
- color: {
1286
- type: String,
1287
- required: !1,
1288
- default: "currentColor"
1289
- },
1290
- /** The CSS display property for the icon. Defaults to `block` */
1291
- display: {
1292
- type: String,
1293
- required: !1,
1294
- default: "block"
1295
- },
1296
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
1297
- decorative: {
1298
- type: Boolean,
1299
- required: !1,
1300
- default: !1
1301
- },
1302
- /** The icon size */
1303
- size: {
1304
- type: [Number, String],
1305
- required: !1,
1306
- default: _,
1307
- // if setting to the imported const fails, just pass a number of 24 as the default.
1308
- validator: (e) => {
1309
- if (typeof e == "number" && e > 0)
1310
- return !0;
1311
- if (typeof e == "string") {
1312
- const t = String(e).replace(/px/gi, ""), r = Number(t);
1313
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
1314
- return !0;
1315
- }
1316
- return !1;
1317
- }
1318
- },
1319
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
1320
- as: {
1321
- type: String,
1322
- required: !1,
1323
- default: "span"
1324
- }
1325
- },
1326
- setup(e) {
1327
- const t = e, r = g(() => {
1328
- if (typeof t.size == "number" && t.size > 0)
1329
- return `${t.size}px`;
1330
- if (typeof t.size == "string") {
1331
- const n = String(t.size).replace(/px/gi, ""), i = Number(n);
1332
- if (i && !isNaN(i) && Number.isInteger(i) && i > 0)
1333
- return `${i}px`;
1334
- }
1335
- return _;
1336
- }), a = g(() => ({
1337
- boxSizing: "border-box",
1338
- color: t.color,
1339
- display: t.display,
1340
- flexShrink: "0",
1341
- height: r.value,
1342
- lineHeight: "0",
1343
- width: r.value
1344
- }));
1345
- return (n, i) => (v(), T(L(e.as), {
1346
- "aria-hidden": e.decorative ? "true" : void 0,
1347
- class: "kui-icon trend-down-icon",
1348
- "data-testid": "kui-icon-wrapper-trend-down-icon",
1349
- style: z(a.value)
1350
- }, {
1351
- default: A(() => [
1352
- (v(), y("svg", {
1353
- "aria-hidden": e.decorative ? "true" : void 0,
1354
- "data-testid": "kui-icon-svg-trend-down-icon",
1355
- fill: "none",
1356
- height: "100%",
1357
- role: "img",
1358
- viewBox: "0 0 24 24",
1359
- width: "100%",
1360
- xmlns: "http://www.w3.org/2000/svg"
1361
- }, [
1362
- e.title ? (v(), y("title", vr, w(e.title), 1)) : R("", !0),
1363
- pr
1364
- ], 8, fr))
1365
- ]),
1366
- _: 1
1367
- }, 8, ["aria-hidden", "style"]));
1368
- }
1369
- }), yr = /* @__PURE__ */ D(gr, [["__scopeId", "data-v-218c4e42"]]), mr = (e) => (V("data-v-decff498"), e = e(), $(), e), hr = ["aria-hidden"], Cr = {
1370
- key: 0,
1371
- "data-testid": "kui-icon-svg-title"
1372
- }, br = /* @__PURE__ */ mr(() => /* @__PURE__ */ E("path", {
1373
- d: "M3.4 18L2 16.6L9.4 9.15L13.4 13.15L18.6 8H16V6H22V12H20V9.4L13.4 16L9.4 12L3.4 18Z",
1374
- fill: "currentColor"
1375
- }, null, -1)), Sr = /* @__PURE__ */ k({
1376
- __name: "TrendUpIcon",
1377
- props: {
1378
- /** The accessibility text provided to screen readers */
1379
- title: {
1380
- type: String,
1381
- required: !1,
1382
- default: ""
1383
- },
1384
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
1385
- color: {
1386
- type: String,
1387
- required: !1,
1388
- default: "currentColor"
1389
- },
1390
- /** The CSS display property for the icon. Defaults to `block` */
1391
- display: {
1392
- type: String,
1393
- required: !1,
1394
- default: "block"
1395
- },
1396
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
1397
- decorative: {
1398
- type: Boolean,
1399
- required: !1,
1400
- default: !1
1401
- },
1402
- /** The icon size */
1403
- size: {
1404
- type: [Number, String],
1405
- required: !1,
1406
- default: _,
1407
- // if setting to the imported const fails, just pass a number of 24 as the default.
1408
- validator: (e) => {
1409
- if (typeof e == "number" && e > 0)
1410
- return !0;
1411
- if (typeof e == "string") {
1412
- const t = String(e).replace(/px/gi, ""), r = Number(t);
1413
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
1414
- return !0;
1415
- }
1416
- return !1;
1417
- }
1418
- },
1419
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
1420
- as: {
1421
- type: String,
1422
- required: !1,
1423
- default: "span"
1424
- }
1425
- },
1426
- setup(e) {
1427
- const t = e, r = g(() => {
1428
- if (typeof t.size == "number" && t.size > 0)
1429
- return `${t.size}px`;
1430
- if (typeof t.size == "string") {
1431
- const n = String(t.size).replace(/px/gi, ""), i = Number(n);
1432
- if (i && !isNaN(i) && Number.isInteger(i) && i > 0)
1433
- return `${i}px`;
1434
- }
1435
- return _;
1436
- }), a = g(() => ({
1437
- boxSizing: "border-box",
1438
- color: t.color,
1439
- display: t.display,
1440
- flexShrink: "0",
1441
- height: r.value,
1442
- lineHeight: "0",
1443
- width: r.value
1444
- }));
1445
- return (n, i) => (v(), T(L(e.as), {
1446
- "aria-hidden": e.decorative ? "true" : void 0,
1447
- class: "kui-icon trend-up-icon",
1448
- "data-testid": "kui-icon-wrapper-trend-up-icon",
1449
- style: z(a.value)
1450
- }, {
1451
- default: A(() => [
1452
- (v(), y("svg", {
1453
- "aria-hidden": e.decorative ? "true" : void 0,
1454
- "data-testid": "kui-icon-svg-trend-up-icon",
1455
- fill: "none",
1456
- height: "100%",
1457
- role: "img",
1458
- viewBox: "0 0 24 24",
1459
- width: "100%",
1460
- xmlns: "http://www.w3.org/2000/svg"
1461
- }, [
1462
- e.title ? (v(), y("title", Cr, w(e.title), 1)) : R("", !0),
1463
- br
1464
- ], 8, hr))
1465
- ]),
1466
- _: 1
1467
- }, 8, ["aria-hidden", "style"]));
1468
- }
1469
- }), _r = /* @__PURE__ */ D(Sr, [["__scopeId", "data-v-decff498"]]), wr = (e) => (V("data-v-065a8b56"), e = e(), $(), e), Nr = ["aria-hidden"], Rr = {
1470
- key: 0,
1471
- "data-testid": "kui-icon-svg-title"
1472
- }, Ir = /* @__PURE__ */ wr(() => /* @__PURE__ */ E("path", {
1473
- d: "M9 20C8.68333 20 8.4 19.9083 8.15 19.725C7.9 19.5417 7.71667 19.3083 7.6 19.025L5.3 13H1V11H6.7L9 17.1L13.6 4.975C13.7167 4.69167 13.9 4.45833 14.15 4.275C14.4 4.09167 14.6833 4 15 4C15.3167 4 15.6 4.09167 15.85 4.275C16.1 4.45833 16.2833 4.69167 16.4 4.975L18.7 11H23V13H17.3L15 6.9L10.4 19.025C10.2833 19.3083 10.1 19.5417 9.85 19.725C9.6 19.9083 9.31667 20 9 20Z",
1474
- fill: "currentColor"
1475
- }, null, -1)), Tr = /* @__PURE__ */ k({
1476
- __name: "VitalsIcon",
1477
- props: {
1478
- /** The accessibility text provided to screen readers */
1479
- title: {
1480
- type: String,
1481
- required: !1,
1482
- default: ""
1483
- },
1484
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
1485
- color: {
1486
- type: String,
1487
- required: !1,
1488
- default: "currentColor"
1489
- },
1490
- /** The CSS display property for the icon. Defaults to `block` */
1491
- display: {
1492
- type: String,
1493
- required: !1,
1494
- default: "block"
1495
- },
1496
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
1497
- decorative: {
1498
- type: Boolean,
1499
- required: !1,
1500
- default: !1
1501
- },
1502
- /** The icon size */
1503
- size: {
1504
- type: [Number, String],
1505
- required: !1,
1506
- default: _,
1507
- // if setting to the imported const fails, just pass a number of 24 as the default.
1508
- validator: (e) => {
1509
- if (typeof e == "number" && e > 0)
1510
- return !0;
1511
- if (typeof e == "string") {
1512
- const t = String(e).replace(/px/gi, ""), r = Number(t);
1513
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
1514
- return !0;
1515
- }
1516
- return !1;
1517
- }
1518
- },
1519
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
1520
- as: {
1521
- type: String,
1522
- required: !1,
1523
- default: "span"
1524
- }
1525
- },
1526
- setup(e) {
1527
- const t = e, r = g(() => {
1528
- if (typeof t.size == "number" && t.size > 0)
1529
- return `${t.size}px`;
1530
- if (typeof t.size == "string") {
1531
- const n = String(t.size).replace(/px/gi, ""), i = Number(n);
1532
- if (i && !isNaN(i) && Number.isInteger(i) && i > 0)
1533
- return `${i}px`;
1534
- }
1535
- return _;
1536
- }), a = g(() => ({
1537
- boxSizing: "border-box",
1538
- color: t.color,
1539
- display: t.display,
1540
- flexShrink: "0",
1541
- height: r.value,
1542
- lineHeight: "0",
1543
- width: r.value
1544
- }));
1545
- return (n, i) => (v(), T(L(e.as), {
1546
- "aria-hidden": e.decorative ? "true" : void 0,
1547
- class: "kui-icon vitals-icon",
1548
- "data-testid": "kui-icon-wrapper-vitals-icon",
1549
- style: z(a.value)
1550
- }, {
1551
- default: A(() => [
1552
- (v(), y("svg", {
1553
- "aria-hidden": e.decorative ? "true" : void 0,
1554
- "data-testid": "kui-icon-svg-vitals-icon",
1555
- fill: "none",
1556
- height: "100%",
1557
- role: "img",
1558
- viewBox: "0 0 24 24",
1559
- width: "100%",
1560
- xmlns: "http://www.w3.org/2000/svg"
1561
- }, [
1562
- e.title ? (v(), y("title", Rr, w(e.title), 1)) : R("", !0),
1563
- Ir
1564
- ], 8, Nr))
1565
- ]),
1566
- _: 1
1567
- }, 8, ["aria-hidden", "style"]));
1568
- }
1569
- }), xr = /* @__PURE__ */ D(Tr, [["__scopeId", "data-v-065a8b56"]]), Er = (e) => (V("data-v-2776a8e5"), e = e(), $(), e), kr = ["aria-hidden"], Lr = {
1570
- key: 0,
1571
- "data-testid": "kui-icon-svg-title"
1572
- }, qr = /* @__PURE__ */ Er(() => /* @__PURE__ */ E("path", {
1573
- d: "M12.0001 22.025C11.7334 22.025 11.4793 21.975 11.2376 21.875C10.9959 21.775 10.7751 21.6333 10.5751 21.45L2.5501 13.425C2.36676 13.225 2.2251 13.0041 2.1251 12.7625C2.0251 12.5208 1.9751 12.2666 1.9751 12C1.9751 11.7333 2.0251 11.475 2.1251 11.225C2.2251 10.975 2.36676 10.7583 2.5501 10.575L10.5751 2.54998C10.7751 2.34998 10.9959 2.20414 11.2376 2.11248C11.4793 2.02081 11.7334 1.97498 12.0001 1.97498C12.2668 1.97498 12.5251 2.02081 12.7751 2.11248C13.0251 2.20414 13.2418 2.34998 13.4251 2.54998L21.4501 10.575C21.6501 10.7583 21.7959 10.975 21.8876 11.225C21.9793 11.475 22.0251 11.7333 22.0251 12C22.0251 12.2666 21.9793 12.5208 21.8876 12.7625C21.7959 13.0041 21.6501 13.225 21.4501 13.425L13.4251 21.45C13.2418 21.6333 13.0251 21.775 12.7751 21.875C12.5251 21.975 12.2668 22.025 12.0001 22.025ZM12.0001 20.025L20.0251 12L12.0001 3.97498L3.9751 12L12.0001 20.025ZM11.0001 13H13.0001V6.99998H11.0001V13ZM12.0001 16C12.2834 16 12.5209 15.9041 12.7126 15.7125C12.9043 15.5208 13.0001 15.2833 13.0001 15C13.0001 14.7166 12.9043 14.4791 12.7126 14.2875C12.5209 14.0958 12.2834 14 12.0001 14C11.7168 14 11.4793 14.0958 11.2876 14.2875C11.0959 14.4791 11.0001 14.7166 11.0001 15C11.0001 15.2833 11.0959 15.5208 11.2876 15.7125C11.4793 15.9041 11.7168 16 12.0001 16Z",
1574
- fill: "currentColor"
1575
- }, null, -1)), Ar = /* @__PURE__ */ k({
1576
- __name: "WarningOutlineIcon",
1577
- props: {
1578
- /** The accessibility text provided to screen readers */
1579
- title: {
1580
- type: String,
1581
- required: !1,
1582
- default: ""
1583
- },
1584
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
1585
- color: {
1586
- type: String,
1587
- required: !1,
1588
- default: "currentColor"
1589
- },
1590
- /** The CSS display property for the icon. Defaults to `block` */
1591
- display: {
1592
- type: String,
1593
- required: !1,
1594
- default: "block"
1595
- },
1596
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
1597
- decorative: {
1598
- type: Boolean,
1599
- required: !1,
1600
- default: !1
1601
- },
1602
- /** The icon size */
1603
- size: {
1604
- type: [Number, String],
1605
- required: !1,
1606
- default: _,
1607
- // if setting to the imported const fails, just pass a number of 24 as the default.
1608
- validator: (e) => {
1609
- if (typeof e == "number" && e > 0)
1610
- return !0;
1611
- if (typeof e == "string") {
1612
- const t = String(e).replace(/px/gi, ""), r = Number(t);
1613
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
1614
- return !0;
1615
- }
1616
- return !1;
1617
- }
1618
- },
1619
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
1620
- as: {
1621
- type: String,
1622
- required: !1,
1623
- default: "span"
1624
- }
1625
- },
1626
- setup(e) {
1627
- const t = e, r = g(() => {
1628
- if (typeof t.size == "number" && t.size > 0)
1629
- return `${t.size}px`;
1630
- if (typeof t.size == "string") {
1631
- const n = String(t.size).replace(/px/gi, ""), i = Number(n);
1632
- if (i && !isNaN(i) && Number.isInteger(i) && i > 0)
1633
- return `${i}px`;
1634
- }
1635
- return _;
1636
- }), a = g(() => ({
1637
- boxSizing: "border-box",
1638
- color: t.color,
1639
- display: t.display,
1640
- flexShrink: "0",
1641
- height: r.value,
1642
- lineHeight: "0",
1643
- width: r.value
1644
- }));
1645
- return (n, i) => (v(), T(L(e.as), {
1646
- "aria-hidden": e.decorative ? "true" : void 0,
1647
- class: "kui-icon warning-outline-icon",
1648
- "data-testid": "kui-icon-wrapper-warning-outline-icon",
1649
- style: z(a.value)
1650
- }, {
1651
- default: A(() => [
1652
- (v(), y("svg", {
1653
- "aria-hidden": e.decorative ? "true" : void 0,
1654
- "data-testid": "kui-icon-svg-warning-outline-icon",
1655
- fill: "none",
1656
- height: "100%",
1657
- role: "img",
1658
- viewBox: "0 0 24 24",
1659
- width: "100%",
1660
- xmlns: "http://www.w3.org/2000/svg"
1661
- }, [
1662
- e.title ? (v(), y("title", Lr, w(e.title), 1)) : R("", !0),
1663
- qr
1664
- ], 8, kr))
1665
- ]),
1666
- _: 1
1667
- }, 8, ["aria-hidden", "style"]));
1668
- }
1669
- }), zr = /* @__PURE__ */ D(Ar, [["__scopeId", "data-v-2776a8e5"]]), Vr = (e) => (V("data-v-1a0beec9"), e = e(), $(), e), $r = ["aria-hidden"], Dr = {
1670
- key: 0,
1671
- "data-testid": "kui-icon-svg-title"
1672
- }, Or = /* @__PURE__ */ Vr(() => /* @__PURE__ */ E("path", {
1673
- d: "M12.025 22.05C11.7583 22.05 11.5042 22 11.2625 21.9C11.0208 21.8 10.8 21.6583 10.6 21.475L2.575 13.45C2.39167 13.25 2.25 13.0292 2.15 12.7875C2.05 12.5458 2 12.2917 2 12.025C2 11.7583 2.05 11.5 2.15 11.25C2.25 11 2.39167 10.7833 2.575 10.6L10.6 2.575C10.8 2.375 11.0208 2.22917 11.2625 2.1375C11.5042 2.04583 11.7583 2 12.025 2C12.2917 2 12.55 2.04583 12.8 2.1375C13.05 2.22917 13.2667 2.375 13.45 2.575L21.475 10.6C21.675 10.7833 21.8208 11 21.9125 11.25C22.0042 11.5 22.05 11.7583 22.05 12.025C22.05 12.2917 22.0042 12.5458 21.9125 12.7875C21.8208 13.0292 21.675 13.25 21.475 13.45L13.45 21.475C13.2667 21.6583 13.05 21.8 12.8 21.9C12.55 22 12.2917 22.05 12.025 22.05ZM11.025 13.025H13.025V7.025H11.025V13.025ZM12.025 16.025C12.3083 16.025 12.5458 15.9292 12.7375 15.7375C12.9292 15.5458 13.025 15.3083 13.025 15.025C13.025 14.7417 12.9292 14.5042 12.7375 14.3125C12.5458 14.1208 12.3083 14.025 12.025 14.025C11.7417 14.025 11.5042 14.1208 11.3125 14.3125C11.1208 14.5042 11.025 14.7417 11.025 15.025C11.025 15.3083 11.1208 15.5458 11.3125 15.7375C11.5042 15.9292 11.7417 16.025 12.025 16.025Z",
1674
- fill: "currentColor"
1675
- }, null, -1)), Mr = /* @__PURE__ */ k({
1676
- __name: "WarningIcon",
1677
- props: {
1678
- /** The accessibility text provided to screen readers */
1679
- title: {
1680
- type: String,
1681
- required: !1,
1682
- default: ""
1683
- },
1684
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
1685
- color: {
1686
- type: String,
1687
- required: !1,
1688
- default: "currentColor"
1689
- },
1690
- /** The CSS display property for the icon. Defaults to `block` */
1691
- display: {
1692
- type: String,
1693
- required: !1,
1694
- default: "block"
1695
- },
1696
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
1697
- decorative: {
1698
- type: Boolean,
1699
- required: !1,
1700
- default: !1
1701
- },
1702
- /** The icon size */
1703
- size: {
1704
- type: [Number, String],
1705
- required: !1,
1706
- default: _,
1707
- // if setting to the imported const fails, just pass a number of 24 as the default.
1708
- validator: (e) => {
1709
- if (typeof e == "number" && e > 0)
1710
- return !0;
1711
- if (typeof e == "string") {
1712
- const t = String(e).replace(/px/gi, ""), r = Number(t);
1713
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
1714
- return !0;
1715
- }
1716
- return !1;
1717
- }
1718
- },
1719
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
1720
- as: {
1721
- type: String,
1722
- required: !1,
1723
- default: "span"
1724
- }
1725
- },
1726
- setup(e) {
1727
- const t = e, r = g(() => {
1728
- if (typeof t.size == "number" && t.size > 0)
1729
- return `${t.size}px`;
1730
- if (typeof t.size == "string") {
1731
- const n = String(t.size).replace(/px/gi, ""), i = Number(n);
1732
- if (i && !isNaN(i) && Number.isInteger(i) && i > 0)
1733
- return `${i}px`;
1734
- }
1735
- return _;
1736
- }), a = g(() => ({
1737
- boxSizing: "border-box",
1738
- color: t.color,
1739
- display: t.display,
1740
- flexShrink: "0",
1741
- height: r.value,
1742
- lineHeight: "0",
1743
- width: r.value
1744
- }));
1745
- return (n, i) => (v(), T(L(e.as), {
1746
- "aria-hidden": e.decorative ? "true" : void 0,
1747
- class: "kui-icon warning-icon",
1748
- "data-testid": "kui-icon-wrapper-warning-icon",
1749
- style: z(a.value)
1750
- }, {
1751
- default: A(() => [
1752
- (v(), y("svg", {
1753
- "aria-hidden": e.decorative ? "true" : void 0,
1754
- "data-testid": "kui-icon-svg-warning-icon",
1755
- fill: "none",
1756
- height: "100%",
1757
- role: "img",
1758
- viewBox: "0 0 24 24",
1759
- width: "100%",
1760
- xmlns: "http://www.w3.org/2000/svg"
1761
- }, [
1762
- e.title ? (v(), y("title", Dr, w(e.title), 1)) : R("", !0),
1763
- Or
1764
- ], 8, $r))
1765
- ]),
1766
- _: 1
1767
- }, 8, ["aria-hidden", "style"]));
1768
- }
1769
- }), Fe = /* @__PURE__ */ D(Mr, [["__scopeId", "data-v-1a0beec9"]]), ye = 2, Te = ye + 2, Fr = (e, t, r = !1) => {
1770
- let a = !t || Number(e.toFixed(Te)) === 0 ? 0 : Number(e.toFixed(Te)) > 0 ? 1 : -1;
1771
- return r && (a *= -1), a;
1772
- }, Hr = (e, t, r) => t ? `${Math.abs(e * 100).toFixed(ye)}%` : r, Br = (e, t) => t === 0 ? 0 : e / t - 1, Ur = (e, t = !1) => (t && (e *= -1), e > 0 ? _r : e < 0 ? yr : Me), Kr = "#ad000e", ve = "#6c7489", xe = "#52596e", Pr = "#007d60", J = "16px", Zr = "20px", Xr = { class: "metricscard" }, Gr = {
761
+ })(Fe);
762
+ var xr = Fe.exports;
763
+ const qr = /* @__PURE__ */ Mr(xr);
764
+ var b = /* @__PURE__ */ ((e) => (e.GENERIC_COUNT = "GenericCount", e.TRAFFIC = "Traffic", e.ERROR_RATE = "ErrorRate", e.LATENCY = "Latency", e))(b || {}), w = /* @__PURE__ */ ((e) => (e.Small = "sm", e.Medium = "md", e.Large = "lg", e.ExtraLarge = "xl", e))(w || {});
765
+ const ce = 2, _e = ce + 2, Ur = (e, r, t = !1) => {
766
+ let o = !r || Number(e.toFixed(_e)) === 0 ? 0 : Number(e.toFixed(_e)) > 0 ? 1 : -1;
767
+ return t && (o *= -1), o;
768
+ }, Kr = (e, r, t) => r ? `${Math.abs(e * 100).toFixed(ce)}%` : t, zr = (e, r) => r === 0 ? 0 : e / r - 1, Pr = (e, r = !1) => (r && (e *= -1), e > 0 ? tr : e < 0 ? nr : we), $r = "#ad000e", se = "#6c7489", Se = "#52596e", Br = "#007d60", X = "16px", Xr = "20px", Gr = { class: "metricscard" }, jr = {
1773
769
  key: 0,
1774
770
  class: "metricscard-description"
1775
- }, jr = { class: "metricscard-valuetrend" }, Yr = {
771
+ }, Yr = { class: "metricscard-valuetrend" }, Hr = {
1776
772
  key: 0,
1777
773
  class: "metricscard-error"
1778
774
  }, Qr = {
@@ -1781,13 +777,13 @@ const _ = "24px", D = (e, t) => {
1781
777
  }, Wr = { "data-testid": "metric-trend-change" }, Jr = {
1782
778
  key: 0,
1783
779
  class: "metricscard-trend-range"
1784
- }, ei = /* @__PURE__ */ k({
780
+ }, Zr = /* @__PURE__ */ Q({
1785
781
  __name: "MetricsCard",
1786
782
  props: {
1787
783
  cardType: {
1788
784
  type: String,
1789
785
  required: !0,
1790
- default: M.GENERIC_COUNT
786
+ default: b.GENERIC_COUNT
1791
787
  },
1792
788
  title: {
1793
789
  type: String,
@@ -1823,7 +819,7 @@ const _ = "24px", D = (e, t) => {
1823
819
  },
1824
820
  trendIcon: {
1825
821
  type: Object,
1826
- default: Me
822
+ default: we
1827
823
  },
1828
824
  trendRange: {
1829
825
  type: String,
@@ -1840,7 +836,7 @@ const _ = "24px", D = (e, t) => {
1840
836
  cardSize: {
1841
837
  type: String,
1842
838
  required: !1,
1843
- default: () => F.Large
839
+ default: () => w.Large
1844
840
  },
1845
841
  hasContainerTitle: {
1846
842
  type: Boolean,
@@ -1853,118 +849,118 @@ const _ = "24px", D = (e, t) => {
1853
849
  }
1854
850
  },
1855
851
  setup(e) {
1856
- const t = /* @__PURE__ */ new Map([
1857
- [M.GENERIC_COUNT, xr],
1858
- [M.TRAFFIC, Ht],
1859
- [M.ERROR_RATE, zr],
1860
- [M.LATENCY, dr]
1861
- ]), r = e, a = (c) => {
1862
- const d = {
1863
- red: `var(--kui-color-text-danger-strong, ${Kr})`,
1864
- green: `var(--kui-color-text-success, ${Pr})`,
1865
- grey: `var(--kui-color-text-neutral-strong, ${xe})`
852
+ const r = /* @__PURE__ */ new Map([
853
+ [b.GENERIC_COUNT, ar],
854
+ [b.TRAFFIC, ir],
855
+ [b.ERROR_RATE, or],
856
+ [b.LATENCY, sr]
857
+ ]), t = e, o = (d) => {
858
+ const c = {
859
+ red: `var(--kui-color-text-danger-strong, ${$r})`,
860
+ green: `var(--kui-color-text-success, ${Br})`,
861
+ grey: `var(--kui-color-text-neutral-strong, ${Se})`
1866
862
  };
1867
- return c > 0 ? d.green : c < 0 ? d.red : d.grey;
1868
- }, n = (c) => c > 0 ? "positive" : c < 0 ? "negative" : "neutral", i = [F.Medium, F.Large].includes(r.cardSize), l = [F.Small].includes(r.cardSize);
1869
- return (c, d) => {
1870
- const o = qe("KTooltip");
1871
- return v(), y("div", Xr, [
1872
- E("div", {
1873
- class: Y(["metricscard-title", e.cardSize])
863
+ return d > 0 ? c.green : d < 0 ? c.red : c.grey;
864
+ }, a = (d) => d > 0 ? "positive" : d < 0 ? "negative" : "neutral", n = [w.Medium, w.Large].includes(t.cardSize), u = [w.Small].includes(t.cardSize);
865
+ return (d, c) => {
866
+ const i = De("KTooltip");
867
+ return T(), C("div", Gr, [
868
+ M("div", {
869
+ class: P(["metricscard-title", e.cardSize])
1874
870
  }, [
1875
- N(l) ? R("", !0) : (v(), T(L(N(t).get(e.cardType)), {
871
+ E(u) ? L("", !0) : (T(), N(te(E(r).get(e.cardType)), {
1876
872
  key: 0,
1877
873
  class: "metricscard-icon",
1878
- color: `var(--kui-color-text-neutral, ${N(ve)})`,
1879
- size: N(J)
874
+ color: `var(--kui-color-text-neutral, ${E(se)})`,
875
+ size: E(X)
1880
876
  }, null, 8, ["color", "size"])),
1881
- (v(), T(L(e.titleTag), null, {
1882
- default: A(() => [
1883
- Ae(w(e.title), 1)
877
+ (T(), N(te(e.titleTag), null, {
878
+ default: he(() => [
879
+ be(D(e.title), 1)
1884
880
  ]),
1885
881
  _: 1
1886
882
  })),
1887
- e.tooltip ? (v(), T(o, {
883
+ e.tooltip ? (T(), N(i, {
1888
884
  key: 1,
1889
885
  class: "metricscard-tooltip",
1890
886
  placement: "right",
1891
887
  text: e.tooltip
1892
888
  }, {
1893
- default: A(() => [
1894
- G(N(nr), {
1895
- color: `var(--kui-color-text-neutral, ${N(ve)})`,
1896
- size: N(J)
889
+ default: he(() => [
890
+ K(E(ur), {
891
+ color: `var(--kui-color-text-neutral, ${E(se)})`,
892
+ size: E(X)
1897
893
  }, null, 8, ["color", "size"])
1898
894
  ]),
1899
895
  _: 1
1900
- }, 8, ["text"])) : R("", !0)
896
+ }, 8, ["text"])) : L("", !0)
1901
897
  ], 2),
1902
- e.description && N(i) ? (v(), y("div", Gr, [
1903
- E("span", null, w(e.description), 1)
1904
- ])) : R("", !0),
1905
- E("div", jr, [
1906
- e.hasError ? (v(), y("div", Yr, [
1907
- G(N(Fe), {
1908
- color: `var(--kui-color-text-neutral, ${N(ve)})`,
1909
- size: N(Zr)
898
+ e.description && E(n) ? (T(), C("div", jr, [
899
+ M("span", null, D(e.description), 1)
900
+ ])) : L("", !0),
901
+ M("div", Yr, [
902
+ e.hasError ? (T(), C("div", Hr, [
903
+ K(E(Oe), {
904
+ color: `var(--kui-color-text-neutral, ${E(se)})`,
905
+ size: E(Xr)
1910
906
  }, null, 8, ["color", "size"]),
1911
- E("div", null, " " + w(e.errorMessage), 1)
1912
- ])) : (v(), y("div", {
907
+ M("div", null, " " + D(e.errorMessage), 1)
908
+ ])) : (T(), C("div", {
1913
909
  key: 1,
1914
- class: Y(["metricscard-value", e.cardSize]),
910
+ class: P(["metricscard-value", e.cardSize]),
1915
911
  "data-testid": "metric-value"
1916
- }, w(e.metricValue), 3)),
1917
- N(i) ? (v(), y("div", Qr, [
1918
- E("div", {
1919
- class: Y(["metricscard-trend-change", n(e.changePolarity)]),
912
+ }, D(e.metricValue), 3)),
913
+ E(n) ? (T(), C("div", Qr, [
914
+ M("div", {
915
+ class: P(["metricscard-trend-change", a(e.changePolarity)]),
1920
916
  "data-testid": "metric-trend-parent"
1921
917
  }, [
1922
- e.changePolarity !== 0 ? (v(), T(L(e.trendIcon), {
918
+ e.changePolarity !== 0 ? (T(), N(te(e.trendIcon), {
1923
919
  key: 0,
1924
- color: a(e.changePolarity),
1925
- size: N(J)
1926
- }, null, 8, ["color", "size"])) : (v(), T(N(Xt), {
920
+ color: o(e.changePolarity),
921
+ size: E(X)
922
+ }, null, 8, ["color", "size"])) : (T(), N(E(lr), {
1927
923
  key: 1,
1928
- color: `var(--kui-color-text-neutral-strong, ${N(xe)})`,
1929
- size: N(J)
924
+ color: `var(--kui-color-text-neutral-strong, ${E(Se)})`,
925
+ size: E(X)
1930
926
  }, null, 8, ["color", "size"])),
1931
- E("div", Wr, w(e.metricChange), 1)
927
+ M("div", Wr, D(e.metricChange), 1)
1932
928
  ], 2),
1933
- e.trendRange ? (v(), y("div", Jr, w(e.trendRange), 1)) : R("", !0)
1934
- ])) : R("", !0)
929
+ e.trendRange ? (T(), C("div", Jr, D(e.trendRange), 1)) : L("", !0)
930
+ ])) : L("", !0)
1935
931
  ])
1936
932
  ]);
1937
933
  };
1938
934
  }
1939
- }), me = (e, t) => {
1940
- const r = e.__vccOpts || e;
1941
- for (const [a, n] of t)
1942
- r[a] = n;
1943
- return r;
1944
- }, ti = /* @__PURE__ */ me(ei, [["__scopeId", "data-v-43293fa2"]]), ri = {}, ii = { class: "loading-tabs" };
1945
- function ni(e, t) {
1946
- const r = qe("KSkeletonBox");
1947
- return v(), y("div", ii, [
1948
- G(r, { width: "100" }),
1949
- G(r, { width: "75" })
935
+ }), de = (e, r) => {
936
+ const t = e.__vccOpts || e;
937
+ for (const [o, a] of r)
938
+ t[o] = a;
939
+ return t;
940
+ }, et = /* @__PURE__ */ de(Zr, [["__scopeId", "data-v-43293fa2"]]), rt = {}, tt = { class: "loading-tabs" };
941
+ function nt(e, r) {
942
+ const t = De("KSkeletonBox");
943
+ return T(), C("div", tt, [
944
+ K(t, { width: "100" }),
945
+ K(t, { width: "75" })
1950
946
  ]);
1951
947
  }
1952
- const ai = /* @__PURE__ */ me(ri, [["render", ni], ["__scopeId", "data-v-f7eb9c40"]]), oi = {
948
+ const at = /* @__PURE__ */ de(rt, [["render", nt], ["__scopeId", "data-v-f7eb9c40"]]), it = {
1953
949
  key: 0,
1954
950
  class: "container-title"
1955
- }, si = {
951
+ }, ot = {
1956
952
  key: 0,
1957
953
  class: "container-description"
1958
- }, li = {
954
+ }, st = {
1959
955
  key: 1,
1960
956
  class: "error-display"
1961
- }, ui = {
957
+ }, ut = {
1962
958
  key: 0,
1963
959
  class: "error-display-message"
1964
- }, di = {
960
+ }, lt = {
1965
961
  key: 2,
1966
962
  class: "cards-wrapper"
1967
- }, ci = /* @__PURE__ */ k({
963
+ }, ct = /* @__PURE__ */ Q({
1968
964
  __name: "MetricCardContainer",
1969
965
  props: {
1970
966
  fallbackDisplayText: {
@@ -1993,7 +989,7 @@ const ai = /* @__PURE__ */ me(ri, [["render", ni], ["__scopeId", "data-v-f7eb9c4
1993
989
  cardSize: {
1994
990
  type: String,
1995
991
  required: !1,
1996
- default: () => F.Large
992
+ default: () => w.Large
1997
993
  },
1998
994
  containerTitle: {
1999
995
  type: String,
@@ -2007,170 +1003,170 @@ const ai = /* @__PURE__ */ me(ri, [["render", ni], ["__scopeId", "data-v-f7eb9c4
2007
1003
  }
2008
1004
  },
2009
1005
  setup(e) {
2010
- const t = e, r = g(() => t.cards.every((n) => (n == null ? void 0 : n.hasError) === !0)), a = (n) => {
2011
- const i = Br(n.currentValue, n.previousValue) || 0, l = Fr(i, t.hasTrendAccess, n.increaseIsBad);
1006
+ const r = e, t = g(() => r.cards.every((a) => (a == null ? void 0 : a.hasError) === !0)), o = (a) => {
1007
+ const n = zr(a.currentValue, a.previousValue) || 0, u = Ur(n, r.hasTrendAccess, a.increaseIsBad);
2012
1008
  return {
2013
- metricValue: n.formatValueFn ? n.formatValueFn(n.currentValue) : Vt(n.currentValue, { capital: !0, round: !0 }) || "0",
2014
- metricChange: n.formatChangeFn ? n.formatChangeFn(i) : Hr(i, t.hasTrendAccess, t.fallbackDisplayText),
2015
- changePolarity: l,
2016
- trendIcon: Ur(l, n.increaseIsBad),
2017
- cardSize: t.cardSize,
2018
- hasContainerTitle: !!t.containerTitle
1009
+ metricValue: a.formatValueFn ? a.formatValueFn(a.currentValue) : qr(a.currentValue, { capital: !0, round: !0 }) || "0",
1010
+ metricChange: a.formatChangeFn ? a.formatChangeFn(n) : Kr(n, r.hasTrendAccess, r.fallbackDisplayText),
1011
+ changePolarity: u,
1012
+ trendIcon: Pr(u, a.increaseIsBad),
1013
+ cardSize: r.cardSize,
1014
+ hasContainerTitle: !!r.containerTitle
2019
1015
  };
2020
1016
  };
2021
- return (n, i) => (v(), y("div", {
2022
- class: Y(["kong-ui-public-metric-card-container", e.cardSize])
1017
+ return (a, n) => (T(), C("div", {
1018
+ class: P(["kong-ui-public-metric-card-container", e.cardSize])
2023
1019
  }, [
2024
- t.containerTitle ? (v(), y("div", oi, [
2025
- Ae(w(t.containerTitle) + " ", 1),
2026
- t.containerDescription ? (v(), y("div", si, w(t.containerDescription), 1)) : R("", !0)
2027
- ])) : R("", !0),
2028
- r.value ? (v(), y("div", li, [
2029
- G(N(Fe), { class: "error-display-icon" }),
2030
- e.errorMessage ? (v(), y("div", ui, w(e.errorMessage), 1)) : R("", !0)
2031
- ])) : (v(), y("div", di, [
2032
- (v(!0), y(_e, null, Ye(e.cards, (l, c) => (v(), y(_e, null, [
2033
- e.loading ? (v(), T(ai, {
2034
- key: `skeleton-${c}`,
2035
- class: Y(e.cardSize === N(F).Small ? "loading-tabs-small" : "loading-tabs-large")
2036
- }, null, 8, ["class"])) : (v(), T(ti, Qe({
2037
- key: c,
1020
+ r.containerTitle ? (T(), C("div", it, [
1021
+ be(D(r.containerTitle) + " ", 1),
1022
+ r.containerDescription ? (T(), C("div", ot, D(r.containerDescription), 1)) : L("", !0)
1023
+ ])) : L("", !0),
1024
+ t.value ? (T(), C("div", st, [
1025
+ K(E(Oe), { class: "error-display-icon" }),
1026
+ e.errorMessage ? (T(), C("div", ut, D(e.errorMessage), 1)) : L("", !0)
1027
+ ])) : (T(), C("div", lt, [
1028
+ (T(!0), C(ge, null, Xe(e.cards, (u, d) => (T(), C(ge, null, [
1029
+ e.loading ? (T(), N(at, {
1030
+ key: `skeleton-${d}`,
1031
+ class: P(e.cardSize === E(w).Small ? "loading-tabs-small" : "loading-tabs-large")
1032
+ }, null, 8, ["class"])) : (T(), N(et, Ge({
1033
+ key: d,
2038
1034
  ref_for: !0
2039
- }, a(l), {
1035
+ }, o(u), {
2040
1036
  "card-size": e.cardSize,
2041
- "card-type": l.cardType,
2042
- description: l.description,
1037
+ "card-type": u.cardType,
1038
+ description: u.description,
2043
1039
  "error-message": e.errorMessage,
2044
- "has-error": l.hasError,
2045
- title: l.title,
2046
- "title-tag": l.titleTag,
2047
- tooltip: l.tooltip,
2048
- "trend-range": l.trendRange
1040
+ "has-error": u.hasError,
1041
+ title: u.title,
1042
+ "title-tag": u.titleTag,
1043
+ tooltip: u.tooltip,
1044
+ "trend-range": u.trendRange
2049
1045
  }), null, 16, ["card-size", "card-type", "description", "error-message", "has-error", "title", "title-tag", "tooltip", "trend-range"]))
2050
1046
  ], 64))), 256))
2051
1047
  ]))
2052
1048
  ], 2));
2053
1049
  }
2054
- }), fi = /* @__PURE__ */ me(ci, [["__scopeId", "data-v-f8f8341b"]]), bi = /* @__PURE__ */ k({
1050
+ }), dt = /* @__PURE__ */ de(ct, [["__scopeId", "data-v-f8f8341b"]]), Tt = /* @__PURE__ */ Q({
2055
1051
  __name: "MetricsConsumer",
2056
1052
  props: {
2057
1053
  lookupKey: { default: void 0 },
2058
- cardSize: { default: F.Large },
1054
+ cardSize: { default: w.Large },
2059
1055
  cardToDisplay: { default: void 0 }
2060
1056
  },
2061
1057
  setup(e) {
2062
- const t = e, r = ke(De);
2063
- if (!r)
1058
+ const r = e, t = Ie(Ne);
1059
+ if (!t)
2064
1060
  throw new Error("MetricsConsumer must be nested inside a MetricsProvider instance.");
2065
- const { traffic: a, latency: n } = r.data, { i18n: i } = K.useI18n(), l = K.useMetricCardBuilder({
2066
- cardType: M.TRAFFIC,
2067
- title: g(() => r.longCardTitles ? i.t("metricCard.long.traffic") : i.t("metricCard.short.traffic")),
2068
- record: a.mapped,
2069
- hasError: a.hasError,
2070
- lookupKey: t.lookupKey,
2071
- sumGroupedValues: Q,
2072
- trendRange: a.trendRange
2073
- }), c = (m) => `${m.toFixed(ye)}%`, d = g(() => {
2074
- const m = a.mapped.value, C = X(m, "current", t.lookupKey, we), I = X(m, "current", t.lookupKey, Q), S = C / I * 100 || 0, h = X(m, "previous", t.lookupKey, we), q = X(m, "previous", t.lookupKey, Q), x = h / q * 100 || 0;
1061
+ const { traffic: o, latency: a } = t.data, { i18n: n } = F.useI18n(), u = F.useMetricCardBuilder({
1062
+ cardType: b.TRAFFIC,
1063
+ title: g(() => t.longCardTitles ? n.t("metricCard.long.traffic") : n.t("metricCard.short.traffic")),
1064
+ record: o.mapped,
1065
+ hasError: o.hasError,
1066
+ lookupKey: r.lookupKey,
1067
+ sumGroupedValues: $,
1068
+ trendRange: o.trendRange
1069
+ }), d = (m) => `${m.toFixed(ce)}%`, c = g(() => {
1070
+ const m = o.mapped.value, h = U(m, "current", r.lookupKey, pe), _ = U(m, "current", r.lookupKey, $), R = h / _ * 100 || 0, y = U(m, "previous", r.lookupKey, pe), I = U(m, "previous", r.lookupKey, $), S = y / I * 100 || 0;
2075
1071
  return {
2076
- cardType: M.ERROR_RATE,
2077
- hasError: a.hasError.value,
2078
- currentValue: S,
2079
- previousValue: x,
2080
- formatValueFn: c,
2081
- title: r.longCardTitles ? i.t("metricCard.long.errorRate") : i.t("metricCard.short.errorRate"),
1072
+ cardType: b.ERROR_RATE,
1073
+ hasError: o.hasError.value,
1074
+ currentValue: R,
1075
+ previousValue: S,
1076
+ formatValueFn: d,
1077
+ title: t.longCardTitles ? n.t("metricCard.long.errorRate") : n.t("metricCard.short.errorRate"),
2082
1078
  increaseIsBad: !0,
2083
- trendRange: a.trendRange.value
1079
+ trendRange: o.trendRange.value
2084
1080
  };
2085
- }), o = (m) => `${m}ms`, s = K.useMetricCardBuilder({
2086
- cardType: M.LATENCY,
1081
+ }), i = (m) => `${m}ms`, s = F.useMetricCardBuilder({
1082
+ cardType: b.LATENCY,
2087
1083
  title: g(() => {
2088
- const { longCardTitles: m, averageLatencies: C } = r, I = C.value ? "averageLatency" : "p99Latency";
2089
- return m ? i.t(`metricCard.long.${I}`) : i.t(`metricCard.short.${I}`);
1084
+ const { longCardTitles: m, averageLatencies: h } = t, _ = h.value ? "averageLatency" : "p99Latency";
1085
+ return m ? n.t(`metricCard.long.${_}`) : n.t(`metricCard.short.${_}`);
2090
1086
  }),
2091
- hasError: n.hasError,
2092
- record: n.mapped,
2093
- lookupKey: t.lookupKey,
1087
+ hasError: a.hasError,
1088
+ record: a.mapped,
1089
+ lookupKey: r.lookupKey,
2094
1090
  increaseIsBad: !0,
2095
- formatValueFn: o,
2096
- trendRange: n.trendRange
2097
- }), u = g(() => t.cardToDisplay === "TRAFFIC" ? [l.value] : t.cardToDisplay === "ERROR_RATE" ? [d.value] : t.cardToDisplay === "LATENCY" ? [s.value] : [l.value, d.value, s.value]), f = g(() => t.cardToDisplay === "TRAFFIC" || t.cardToDisplay === "ERROR_RATE" ? a.isLoading.value : t.cardToDisplay === "LATENCY" ? n.isLoading.value : a.isLoading.value || n.isLoading.value), p = g(() => ({
2098
- cards: u.value,
2099
- containerTitle: r.containerTitle.value,
2100
- containerDescription: r.description.value,
1091
+ formatValueFn: i,
1092
+ trendRange: a.trendRange
1093
+ }), l = g(() => r.cardToDisplay === "TRAFFIC" ? [u.value] : r.cardToDisplay === "ERROR_RATE" ? [c.value] : r.cardToDisplay === "LATENCY" ? [s.value] : [u.value, c.value, s.value]), f = g(() => r.cardToDisplay === "TRAFFIC" || r.cardToDisplay === "ERROR_RATE" ? o.isLoading.value : r.cardToDisplay === "LATENCY" ? a.isLoading.value : o.isLoading.value || a.isLoading.value), v = g(() => ({
1094
+ cards: l.value,
1095
+ containerTitle: t.containerTitle.value,
1096
+ containerDescription: t.description.value,
2101
1097
  loading: f.value,
2102
- hasTrendAccess: r.hasTrendAccess.value,
2103
- fallbackDisplayText: i.t("general.notAvailable"),
1098
+ hasTrendAccess: t.hasTrendAccess.value,
1099
+ fallbackDisplayText: n.t("general.notAvailable"),
2104
1100
  // If the parent container has a title, we enforce a Medium card size; otherwise, pass down provided cardSize
2105
- cardSize: r.containerTitle.value ? F.Medium : t.cardSize,
1101
+ cardSize: t.containerTitle.value ? w.Medium : r.cardSize,
2106
1102
  hideTitle: !0
2107
- })), b = g(() => ({
2108
- loading: p.value.loading,
2109
- trafficCard: l.value,
2110
- errorRateCard: d.value,
1103
+ })), p = g(() => ({
1104
+ loading: v.value.loading,
1105
+ trafficCard: u.value,
1106
+ errorRateCard: c.value,
2111
1107
  latencyCard: s.value,
2112
- errorRateFormatted: c(d.value.currentValue),
2113
- latencyFormatted: o(s.value.currentValue)
1108
+ errorRateFormatted: d(c.value.currentValue),
1109
+ latencyFormatted: i(s.value.currentValue)
2114
1110
  }));
2115
- return (m, C) => Le(m.$slots, "default", { cardValues: b.value }, () => [
2116
- G(fi, We(Je(p.value)), null, 16)
1111
+ return (m, h) => Ae(m.$slots, "default", { cardValues: p.value }, () => [
1112
+ K(dt, je(Ye(v.value)), null, 16)
2117
1113
  ]);
2118
1114
  }
2119
- }), ee = (e) => new Date(e), Si = (e, t) => {
2120
- const r = e.body;
1115
+ }), G = (e) => new Date(e), Et = (e, r) => {
1116
+ const t = e.body;
2121
1117
  e.reply({
2122
1118
  statusCode: 200,
2123
- body: vi(r, t)
1119
+ body: ft(t, r)
2124
1120
  });
2125
- }, Ee = (e) => e.reduce((t, r) => (t[r] = { name: r }, t), {}), vi = (e, t) => {
2126
- var b, m;
2127
- const r = pe.get(re.ONE_DAY), a = e.granularity === "trend" ? new rt(r) : new it(r), n = a.endMs(), i = a.startMs(), l = a.granularityMs(), c = e.granularity === "trend" ? 2 : 1;
1121
+ }, Ce = (e) => e.reduce((r, t) => (r[t] = { name: t }, r), {}), ft = (e, r) => {
1122
+ var p, m;
1123
+ const t = ue.get(Y.ONE_DAY), o = e.granularity === "trend" ? new We(t) : new Je(t), a = o.endMs(), n = o.startMs(), u = o.granularityMs(), d = e.granularity === "trend" ? 2 : 1;
2128
1124
  if ((e.dimensions ?? []).length > 2)
2129
1125
  throw new Error(`Explore only supports 0-2 dimensions; got: ${JSON.stringify(e.dimensions)}`);
2130
- const d = (e.dimensions ?? []).find((C) => C !== "time"), o = (t == null ? void 0 : t.dimensionNames) ?? [], s = Math.max(o.length, 1), u = e.metrics || [], f = [];
2131
- for (let C = 0; C < c; C++)
2132
- for (let I = 0; I < s; I++) {
2133
- const S = d ? { [d]: o[I] } : {};
2134
- (b = e.dimensions) != null && b.includes("status_code_grouped") ? Q.forEach((h) => {
2135
- const q = u.reduce((x, B) => (x[B] = (c - C) * 1e3 + 100 * I + 1, x), { ...S, status_code_grouped: h });
1126
+ const c = (e.dimensions ?? []).find((h) => h !== "time"), i = (r == null ? void 0 : r.dimensionNames) ?? [], s = Math.max(i.length, 1), l = e.metrics || [], f = [];
1127
+ for (let h = 0; h < d; h++)
1128
+ for (let _ = 0; _ < s; _++) {
1129
+ const R = c ? { [c]: i[_] } : {};
1130
+ (p = e.dimensions) != null && p.includes("status_code_grouped") ? $.forEach((y) => {
1131
+ const I = l.reduce((S, V) => (S[V] = (d - h) * 1e3 + 100 * _ + 1, S), { ...R, status_code_grouped: y });
2136
1132
  f.push({
2137
1133
  version: "v1",
2138
- timestamp: C === 0 ? ee(i).toISOString() : ee(i + l).toISOString(),
2139
- event: q
1134
+ timestamp: h === 0 ? G(n).toISOString() : G(n + u).toISOString(),
1135
+ event: I
2140
1136
  });
2141
1137
  }) : f.push({
2142
1138
  version: "v1",
2143
- timestamp: C === 0 ? ee(i).toISOString() : ee(i + l).toISOString(),
2144
- event: u.reduce((h, q) => (h[q] = (c - C) * 1e3 + 100 * I + 1, h), { ...S })
1139
+ timestamp: h === 0 ? G(n).toISOString() : G(n + u).toISOString(),
1140
+ event: l.reduce((y, I) => (y[I] = (d - h) * 1e3 + 100 * _ + 1, y), { ...R })
2145
1141
  });
2146
1142
  }
2147
- const p = {
2148
- start_ms: i,
2149
- end_ms: n,
2150
- granularity_ms: l,
2151
- display: d ? {
2152
- [d]: Ee(o),
2153
- ...(m = e.dimensions) != null && m.includes("status_code_grouped") ? { status_code_grouped: Ee(Q) } : {}
1143
+ const v = {
1144
+ start_ms: n,
1145
+ end_ms: a,
1146
+ granularity_ms: u,
1147
+ display: c ? {
1148
+ [c]: Ce(i),
1149
+ ...(m = e.dimensions) != null && m.includes("status_code_grouped") ? { status_code_grouped: Ce($) } : {}
2154
1150
  } : {},
2155
1151
  metric_names: e.metrics,
2156
1152
  query_id: "test"
2157
1153
  };
2158
1154
  return {
2159
1155
  data: f,
2160
- meta: p
1156
+ meta: v
2161
1157
  };
2162
1158
  };
2163
1159
  export {
2164
- Q as ALL_STATUS_CODE_GROUPS,
2165
- vt as DEFAULT_REFRESH_INTERVAL,
2166
- pt as INJECT_QUERY_PROVIDER,
2167
- ft as MAX_ANALYTICS_REQUEST_RETRIES,
2168
- F as MetricCardSize,
2169
- M as MetricCardType,
2170
- bi as MetricsConsumer,
2171
- Ci as MetricsProvider,
2172
- we as STATUS_CODES_FAILED,
2173
- hi as STATUS_CODES_SUCCESS,
2174
- vi as mockExploreResponse,
2175
- Si as mockExploreResponseFromCypress
1160
+ $ as ALL_STATUS_CODE_GROUPS,
1161
+ hr as DEFAULT_REFRESH_INTERVAL,
1162
+ gr as INJECT_QUERY_PROVIDER,
1163
+ yr as MAX_ANALYTICS_REQUEST_RETRIES,
1164
+ w as MetricCardSize,
1165
+ b as MetricCardType,
1166
+ Tt as MetricsConsumer,
1167
+ Rt as MetricsProvider,
1168
+ pe as STATUS_CODES_FAILED,
1169
+ pt as STATUS_CODES_SUCCESS,
1170
+ ft as mockExploreResponse,
1171
+ Et as mockExploreResponseFromCypress
2176
1172
  };