@kong-ui-public/dashboard-renderer 0.24.1 → 0.24.2

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,22 +1,21 @@
1
- import { ref as v, watchEffect as Ye, defineComponent as O, inject as ie, onUnmounted as Ie, computed as g, resolveComponent as U, unref as m, openBlock as h, createBlock as E, withCtx as I, createTextVNode as Ae, toDisplayString as z, renderSlot as ae, createCommentVNode as B, useCssVars as H, createElementVNode as K, createVNode as R, createElementBlock as C, normalizeProps as Ee, guardReactiveProps as Ze, withModifiers as Qe, toValue as We, watch as Je, resolveDynamicComponent as Ce, normalizeStyle as te, pushScopeId as Xe, popScopeId as et, createSlots as tt, mergeProps as rt, onMounted as nt, Fragment as it, renderList as at, normalizeClass as ot } from "vue";
2
- import { ChartMetricDisplay as st, ChartTypesSimple as lt, SimpleChart as ct, ChartTypes as re, AnalyticsChart as qe, TopNTable as ut } from "@kong-ui-public/analytics-chart";
3
- import { granularityValues as pt, exploreFilterTypesV2 as dt, exploreAggregations as yt, queryableExploreDimensions as ft, filterableExploreDimensions as ht, basicExploreAggregations as mt, queryableBasicExploreDimensions as gt, filterableBasicExploreDimensions as vt, aiExploreAggregations as bt, queryableAiExploreDimensions as wt, filterableAiExploreDimensions as _t, relativeTimeRangeValuesV4 as St, stripUnknownFilters as xt, Timeframe as kt, TimePeriods as Tt } from "@kong-ui-public/analytics-utilities";
4
- import It from "swrv";
5
- import ye from "axios";
6
- import { createI18n as Oe, i18nTComponent as Ne } from "@kong-ui-public/i18n";
7
- import { MetricsProvider as At, MetricsConsumer as Et } from "@kong-ui-public/analytics-metric-provider";
8
- import "@kong/kongponents";
9
- import "vue-router";
10
- import { useAnalyticsConfigStore as Ct } from "@kong-ui-public/analytics-config-store";
11
- const Q = 170, Re = "analytics-query-provider", fe = "{entity-id}", qt = "{cp-id}", Ot = "{timeframe}", Nt = 30 * 1e3;
12
- var A = /* @__PURE__ */ ((e) => (e.HorizontalBar = "horizontal_bar", e.VerticalBar = "vertical_bar", e.Gauge = "gauge", e.TimeseriesLine = "timeseries_line", e.GoldenSignals = "golden_signals", e.TopN = "top_n", e.Slottable = "slottable", e))(A || {});
13
- const W = {
1
+ import { ref as I, watchEffect as ue, defineComponent as _, inject as Q, onUnmounted as Z, computed as d, resolveComponent as z, unref as p, openBlock as l, createBlock as f, withCtx as v, createTextVNode as J, toDisplayString as W, renderSlot as V, createCommentVNode as Y, useCssVars as x, createElementVNode as G, createVNode as T, createElementBlock as S, normalizeProps as X, guardReactiveProps as de, createSlots as ye, resolveDynamicComponent as me, mergeProps as he, onMounted as ge, Fragment as fe, renderList as ve, normalizeClass as _e, normalizeStyle as K } from "vue";
2
+ import { ChartMetricDisplay as be, ChartTypesSimple as qe, SimpleChart as Se, ChartTypes as j, AnalyticsChart as ee, TopNTable as Te } from "@kong-ui-public/analytics-chart";
3
+ import { granularityValues as Re, exploreFilterTypesV2 as Ae, exploreAggregations as Ee, queryableExploreDimensions as De, filterableExploreDimensions as Ce, basicExploreAggregations as Ie, queryableBasicExploreDimensions as xe, filterableBasicExploreDimensions as Oe, aiExploreAggregations as ke, queryableAiExploreDimensions as we, filterableAiExploreDimensions as Pe, relativeTimeRangeValuesV4 as Le, stripUnknownFilters as Ne, Timeframe as ze, TimePeriods as je } from "@kong-ui-public/analytics-utilities";
4
+ import Ve from "swrv";
5
+ import "axios";
6
+ import { createI18n as Ge, i18nTComponent as $e } from "@kong-ui-public/i18n";
7
+ import { MetricsProvider as Be, MetricsConsumer as Fe } from "@kong-ui-public/analytics-metric-provider";
8
+ import { EntityLink as He } from "@kong-ui-public/entities-shared";
9
+ import { useAnalyticsConfigStore as Ke } from "@kong-ui-public/analytics-config-store";
10
+ const P = 170, te = "analytics-query-provider", U = "{entity-id}", Ue = "{cp-id}", Me = "{timeframe}", Qe = 30 * 1e3;
11
+ var y = /* @__PURE__ */ ((t) => (t.HorizontalBar = "horizontal_bar", t.VerticalBar = "vertical_bar", t.Gauge = "gauge", t.TimeseriesLine = "timeseries_line", t.GoldenSignals = "golden_signals", t.TopN = "top_n", t.Slottable = "slottable", t))(y || {});
12
+ const L = {
14
13
  type: "string"
15
- }, Y = {
14
+ }, O = {
16
15
  type: "string"
17
- }, Le = {
16
+ }, re = {
18
17
  type: "boolean"
19
- }, De = {
18
+ }, oe = {
20
19
  type: ["object", "array"],
21
20
  items: {
22
21
  type: "string"
@@ -24,7 +23,7 @@ const W = {
24
23
  additionalProperties: {
25
24
  type: "string"
26
25
  }
27
- }, Rt = {
26
+ }, Ze = {
28
27
  type: "object",
29
28
  properties: {
30
29
  type: {
@@ -40,7 +39,7 @@ const W = {
40
39
  },
41
40
  required: ["type", "id"],
42
41
  additionalProperties: !1
43
- }, Lt = {
42
+ }, Je = {
44
43
  type: "object",
45
44
  properties: {
46
45
  type: {
@@ -54,14 +53,14 @@ const W = {
54
53
  stacked: {
55
54
  type: "boolean"
56
55
  },
57
- chartDatasetColors: De,
58
- syntheticsDataKey: W,
59
- chartTitle: Y,
60
- allowCsvExport: Le
56
+ chartDatasetColors: oe,
57
+ syntheticsDataKey: L,
58
+ chartTitle: O,
59
+ allowCsvExport: re
61
60
  },
62
61
  required: ["type"],
63
62
  additionalProperties: !1
64
- }, Dt = {
63
+ }, We = {
65
64
  type: "object",
66
65
  properties: {
67
66
  type: {
@@ -74,14 +73,14 @@ const W = {
74
73
  stacked: {
75
74
  type: "boolean"
76
75
  },
77
- chartDatasetColors: De,
78
- syntheticsDataKey: W,
79
- chartTitle: Y,
80
- allowCsvExport: Le
76
+ chartDatasetColors: oe,
77
+ syntheticsDataKey: L,
78
+ chartTitle: O,
79
+ allowCsvExport: re
81
80
  },
82
81
  required: ["type"],
83
82
  additionalProperties: !1
84
- }, jt = {
83
+ }, Ye = {
85
84
  type: "object",
86
85
  properties: {
87
86
  type: {
@@ -93,7 +92,7 @@ const W = {
93
92
  },
94
93
  metricDisplay: {
95
94
  type: "string",
96
- enum: Object.values(st)
95
+ enum: Object.values(be)
97
96
  },
98
97
  reverseDataset: {
99
98
  type: "boolean"
@@ -101,16 +100,16 @@ const W = {
101
100
  numerator: {
102
101
  type: "number"
103
102
  },
104
- syntheticsDataKey: W,
105
- chartTitle: Y
103
+ syntheticsDataKey: L,
104
+ chartTitle: O
106
105
  },
107
106
  required: ["type"],
108
107
  additionalProperties: !1
109
- }, $t = {
108
+ }, Xe = {
110
109
  type: "object",
111
110
  properties: {
112
- chartTitle: Y,
113
- syntheticsDataKey: W,
111
+ chartTitle: O,
112
+ syntheticsDataKey: L,
114
113
  type: {
115
114
  type: "string",
116
115
  enum: [
@@ -127,10 +126,10 @@ const W = {
127
126
  },
128
127
  required: ["type"],
129
128
  additionalProperties: !1
130
- }, Pt = {
129
+ }, et = {
131
130
  type: "object",
132
131
  properties: {
133
- chartTitle: Y,
132
+ chartTitle: O,
134
133
  type: {
135
134
  type: "string",
136
135
  enum: [
@@ -150,7 +149,7 @@ const W = {
150
149
  },
151
150
  required: ["type"],
152
151
  additionalProperties: !1
153
- }, Ft = {
152
+ }, tt = {
154
153
  type: "object",
155
154
  properties: {
156
155
  tz: {
@@ -165,7 +164,7 @@ const W = {
165
164
  },
166
165
  time_range: {
167
166
  type: "string",
168
- enum: St,
167
+ enum: Le,
169
168
  default: "1h"
170
169
  }
171
170
  },
@@ -174,7 +173,7 @@ const W = {
174
173
  "time_range"
175
174
  ],
176
175
  additionalProperties: !1
177
- }, Ut = {
176
+ }, rt = {
178
177
  type: "object",
179
178
  description: "A duration representing an exact start and end time.",
180
179
  properties: {
@@ -200,18 +199,18 @@ const W = {
200
199
  "end"
201
200
  ],
202
201
  additionalProperties: !1
203
- }, oe = {
202
+ }, $ = {
204
203
  granularity: {
205
204
  type: "string",
206
205
  description: 'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',
207
- enum: pt
206
+ enum: Re
208
207
  },
209
208
  time_range: {
210
209
  type: "object",
211
210
  description: "The time range to query.",
212
211
  anyOf: [
213
- Ft,
214
- Ut
212
+ tt,
213
+ rt
215
214
  ],
216
215
  default: {
217
216
  type: "relative",
@@ -224,23 +223,23 @@ const W = {
224
223
  meta: {
225
224
  type: "object"
226
225
  }
227
- }, se = (e) => ({
226
+ }, B = (t) => ({
228
227
  type: "array",
229
228
  description: "List of aggregated metrics to collect across the requested time span.",
230
229
  items: {
231
230
  type: "string",
232
- enum: e
231
+ enum: t
233
232
  }
234
- }), le = (e) => ({
233
+ }), F = (t) => ({
235
234
  type: "array",
236
235
  description: "List of attributes or entity types to group by.",
237
236
  minItems: 0,
238
237
  maxItems: 2,
239
238
  items: {
240
239
  type: "string",
241
- enum: e
240
+ enum: t
242
241
  }
243
- }), ce = (e) => ({
242
+ }), H = (t) => ({
244
243
  type: "array",
245
244
  description: "A list of filters to apply to the query.",
246
245
  items: {
@@ -249,11 +248,11 @@ const W = {
249
248
  properties: {
250
249
  dimension: {
251
250
  type: "string",
252
- enum: e
251
+ enum: t
253
252
  },
254
253
  type: {
255
254
  type: "string",
256
- enum: dt
255
+ enum: Ae
257
256
  },
258
257
  values: {
259
258
  type: "array",
@@ -269,7 +268,7 @@ const W = {
269
268
  ],
270
269
  additionalProperties: !1
271
270
  }
272
- }), zt = {
271
+ }), ot = {
273
272
  type: "object",
274
273
  description: "A query to launch at the advanced explore API",
275
274
  properties: {
@@ -279,14 +278,14 @@ const W = {
279
278
  "advanced"
280
279
  ]
281
280
  },
282
- metrics: se(yt),
283
- dimensions: le(ft),
284
- filters: ce(ht),
285
- ...oe
281
+ metrics: B(Ee),
282
+ dimensions: F(De),
283
+ filters: H(Ce),
284
+ ...$
286
285
  },
287
286
  required: ["datasource"],
288
287
  additionalProperties: !1
289
- }, Kt = {
288
+ }, it = {
290
289
  type: "object",
291
290
  description: "A query to launch at the basic explore API",
292
291
  properties: {
@@ -296,14 +295,14 @@ const W = {
296
295
  "basic"
297
296
  ]
298
297
  },
299
- metrics: se(mt),
300
- dimensions: le(gt),
301
- filters: ce(vt),
302
- ...oe
298
+ metrics: B(Ie),
299
+ dimensions: F(xe),
300
+ filters: H(Oe),
301
+ ...$
303
302
  },
304
303
  required: ["datasource"],
305
304
  additionalProperties: !1
306
- }, Vt = {
305
+ }, nt = {
307
306
  type: "object",
308
307
  description: "A query to launch at the AI explore API",
309
308
  properties: {
@@ -313,26 +312,26 @@ const W = {
313
312
  "ai"
314
313
  ]
315
314
  },
316
- metrics: se(bt),
317
- dimensions: le(wt),
318
- filters: ce(_t),
319
- ...oe
315
+ metrics: B(ke),
316
+ dimensions: F(we),
317
+ filters: H(Pe),
318
+ ...$
320
319
  },
321
320
  required: ["datasource"],
322
321
  additionalProperties: !1
323
- }, Mt = {
324
- anyOf: [zt, Kt, Vt]
325
- }, Bt = {
322
+ }, at = {
323
+ anyOf: [ot, it, nt]
324
+ }, st = {
326
325
  type: "object",
327
326
  properties: {
328
- query: Mt,
327
+ query: at,
329
328
  chart: {
330
- anyOf: [Lt, jt, Dt, Pt, $t, Rt]
329
+ anyOf: [Je, Ye, We, et, Xe, Ze]
331
330
  }
332
331
  },
333
332
  required: ["query", "chart"],
334
333
  additionalProperties: !1
335
- }, Gt = {
334
+ }, ct = {
336
335
  type: "object",
337
336
  properties: {
338
337
  position: {
@@ -369,24 +368,24 @@ const W = {
369
368
  },
370
369
  required: ["position", "size"],
371
370
  additionalProperties: !1
372
- }, Ht = {
371
+ }, lt = {
373
372
  type: "object",
374
373
  properties: {
375
- definition: Bt,
376
- layout: Gt
374
+ definition: st,
375
+ layout: ct
377
376
  },
378
377
  required: ["definition", "layout"],
379
378
  additionalProperties: !1
380
- }, Fi = {
379
+ }, Ut = {
381
380
  type: "object",
382
381
  properties: {
383
382
  tiles: {
384
383
  type: "array",
385
- items: Ht
384
+ items: lt
386
385
  },
387
386
  tileHeight: {
388
387
  type: "number",
389
- description: `Height of each tile in pixels. Default: ${Q}`
388
+ description: `Height of each tile in pixels. Default: ${P}`
390
389
  },
391
390
  gridSize: {
392
391
  type: "object",
@@ -406,73 +405,73 @@ const W = {
406
405
  required: ["tiles", "gridSize"],
407
406
  additionalProperties: !1
408
407
  };
409
- var je = /* @__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))(je || {});
410
- const Yt = (e) => {
411
- var t, r, i, n, a;
412
- return e ? !!// TODO: revisit: currently only the first check ever matters?
413
- ((t = Object.keys(e)) != null && t.length || (r = e.data) != null && r.length || (n = (i = e.data) == null ? void 0 : i.data) != null && n.length || !((a = e.data) != null && a.data) && typeof e.data == "object" && Object.keys(e == null ? void 0 : e.data).length) : !1;
408
+ var ie = /* @__PURE__ */ ((t) => (t.VALIDATING = "VALIDATING", t.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", t.PENDING = "PENDING", t.SUCCESS = "SUCCESS", t.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", t.ERROR = "ERROR", t.STALE_IF_ERROR = "STALE_IF_ERROR", t))(ie || {});
409
+ const pt = (t) => {
410
+ var r, o, n, e, i;
411
+ return t ? !!// TODO: revisit: currently only the first check ever matters?
412
+ ((r = Object.keys(t)) != null && r.length || (o = t.data) != null && o.length || (e = (n = t.data) == null ? void 0 : n.data) != null && e.length || !((i = t.data) != null && i.data) && typeof t.data == "object" && Object.keys(t == null ? void 0 : t.data).length) : !1;
414
413
  };
415
- function Zt(e = v({}), t, r, i = Yt) {
416
- const n = v(
414
+ function ut(t = I({}), r, o, n = pt) {
415
+ const e = I(
417
416
  "PENDING"
418
417
  /* PENDING */
419
418
  );
420
- return Ye(() => {
421
- const a = i(e.value);
422
- if (e.value && a && r.value) {
423
- n.value = "VALIDATING_HAS_DATA";
419
+ return ue(() => {
420
+ const i = n(t.value);
421
+ if (t.value && i && o.value) {
422
+ e.value = "VALIDATING_HAS_DATA";
424
423
  return;
425
424
  }
426
- if (e.value && r.value) {
427
- n.value = "VALIDATING";
425
+ if (t.value && o.value) {
426
+ e.value = "VALIDATING";
428
427
  return;
429
428
  }
430
- if (e.value && t.value) {
431
- n.value = "STALE_IF_ERROR";
429
+ if (t.value && r.value) {
430
+ e.value = "STALE_IF_ERROR";
432
431
  return;
433
432
  }
434
- if (e.value === void 0 && !t.value) {
435
- n.value = "PENDING";
433
+ if (t.value === void 0 && !r.value) {
434
+ e.value = "PENDING";
436
435
  return;
437
436
  }
438
- if (e.value && !t.value && a) {
439
- n.value = "SUCCESS_HAS_DATA";
437
+ if (t.value && !r.value && i) {
438
+ e.value = "SUCCESS_HAS_DATA";
440
439
  return;
441
440
  }
442
- if (e.value && !t.value) {
443
- n.value = "SUCCESS";
441
+ if (t.value && !r.value) {
442
+ e.value = "SUCCESS";
444
443
  return;
445
444
  }
446
- e.value === void 0 && t && (n.value = "ERROR");
445
+ t.value === void 0 && r && (e.value = "ERROR");
447
446
  }), {
448
- state: n,
449
- swrvState: je
447
+ state: e,
448
+ swrvState: ie
450
449
  };
451
450
  }
452
- const Qt = {
451
+ const dt = {
453
452
  noQueryBridge: "No query bridge provided. Unable to render dashboard.",
454
453
  trendRange: {
455
454
  "24h": "Last 24-Hour Summary",
456
455
  "7d": "Last 7-Day Summary",
457
456
  "30d": "Last 30-Day Summary"
458
457
  }
459
- }, Wt = {
458
+ }, yt = {
460
459
  timeRangeExceeded: "The time range for this report is outside of your organization's data retention period"
461
- }, Jt = {
462
- renderer: Qt,
463
- queryDataProvider: Wt
460
+ }, mt = {
461
+ renderer: dt,
462
+ queryDataProvider: yt
464
463
  };
465
- function Xt() {
466
- const e = Oe("en-us", Jt);
464
+ function ht() {
465
+ const t = Ge("en-us", mt);
467
466
  return {
468
- i18n: e,
469
- i18nT: Ne(e)
467
+ i18n: t,
468
+ i18nT: $e(t)
470
469
  // Translation component <i18n-t>
471
470
  };
472
471
  }
473
- const $e = {
474
- useI18n: Xt
475
- }, J = /* @__PURE__ */ O({
472
+ const ne = {
473
+ useI18n: ht
474
+ }, N = /* @__PURE__ */ _({
476
475
  __name: "QueryDataProvider",
477
476
  props: {
478
477
  context: {},
@@ -480,66 +479,66 @@ const $e = {
480
479
  queryReady: { type: Boolean }
481
480
  },
482
481
  emits: ["queryComplete"],
483
- setup(e, { emit: t }) {
484
- const r = e, i = t, { i18n: n } = $e.useI18n(), a = ie(Re), o = () => r.queryReady && a ? JSON.stringify([r.query, r.context]) : null, s = new AbortController();
485
- Ie(() => {
482
+ setup(t, { emit: r }) {
483
+ const o = t, n = r, { i18n: e } = ne.useI18n(), i = Q(te), a = () => o.queryReady && i ? JSON.stringify([o.query, o.context]) : null, s = new AbortController();
484
+ Z(() => {
486
485
  s.abort();
487
486
  });
488
- const c = (N, L, f) => {
487
+ const m = (A, E, D) => {
489
488
  const q = [];
490
- return L && q.push(...L), q.push(...xt(N, f)), q;
491
- }, { data: u, error: p, isValidating: l } = It(o, async () => {
492
- var N, L, f, q;
489
+ return E && q.push(...E), q.push(...Ne(A, D)), q;
490
+ }, { data: c, error: b, isValidating: h } = Ve(a, async () => {
491
+ var A, E, D, q;
493
492
  try {
494
493
  let {
495
- datasource: w,
496
- ...Z
497
- } = r.query;
498
- w || (w = "basic");
499
- const x = c(w, r.query.filters, r.context.filters), k = {
500
- datasource: w,
494
+ datasource: u,
495
+ ...ce
496
+ } = o.query;
497
+ u || (u = "basic");
498
+ const le = m(u, o.query.filters, o.context.filters), pe = {
499
+ datasource: u,
501
500
  query: {
502
- ...Z,
501
+ ...ce,
503
502
  time_range: {
504
- ...r.context.timeSpec,
505
- tz: r.context.tz
503
+ ...o.context.timeSpec,
504
+ tz: o.context.tz
506
505
  },
507
- filters: x
506
+ filters: le
508
507
  }
509
508
  };
510
- return a == null ? void 0 : a.queryFn(k, s);
511
- } catch (w) {
512
- b.value = ((L = (N = w == null ? void 0 : w.response) == null ? void 0 : N.data) == null ? void 0 : L.message) === "Range not allowed for this tier" ? n.t("queryDataProvider.timeRangeExceeded") : ((q = (f = w == null ? void 0 : w.response) == null ? void 0 : f.data) == null ? void 0 : q.message) || (w == null ? void 0 : w.message);
509
+ return i == null ? void 0 : i.queryFn(pe, s);
510
+ } catch (u) {
511
+ w.value = ((E = (A = u == null ? void 0 : u.response) == null ? void 0 : A.data) == null ? void 0 : E.message) === "Range not allowed for this tier" ? e.t("queryDataProvider.timeRangeExceeded") : ((q = (D = u == null ? void 0 : u.response) == null ? void 0 : D.data) == null ? void 0 : q.message) || (u == null ? void 0 : u.message);
513
512
  } finally {
514
- i("queryComplete");
513
+ n("queryComplete");
515
514
  }
516
515
  }, {
517
- refreshInterval: r.context.refreshInterval,
516
+ refreshInterval: o.context.refreshInterval,
518
517
  revalidateOnFocus: !1
519
- }), { state: d, swrvState: y } = Zt(u, p, l), b = v(null), S = g(() => d.value === y.ERROR || !!b.value), V = g(() => !r.queryReady || d.value === y.PENDING);
520
- return (N, L) => {
521
- const f = U("KSkeleton"), q = U("KEmptyState");
522
- return V.value || !m(u) && !S.value ? (h(), E(f, {
518
+ }), { state: g, swrvState: k } = ut(c, b, h), w = I(null), C = d(() => g.value === k.ERROR || !!w.value), se = d(() => !o.queryReady || g.value === k.PENDING);
519
+ return (A, E) => {
520
+ const D = z("KSkeleton"), q = z("KEmptyState");
521
+ return se.value || !p(c) && !C.value ? (l(), f(D, {
523
522
  key: 0,
524
523
  class: "chart-skeleton",
525
524
  type: "table"
526
- })) : S.value ? (h(), E(q, {
525
+ })) : C.value ? (l(), f(q, {
527
526
  key: 1,
528
527
  "action-button-visible": !1,
529
528
  "data-testid": "chart-empty-state",
530
529
  "icon-variant": "error"
531
530
  }, {
532
- default: I(() => [
533
- Ae(z(b.value), 1)
531
+ default: v(() => [
532
+ J(W(w.value), 1)
534
533
  ]),
535
534
  _: 1
536
- })) : m(u) ? ae(N.$slots, "default", {
535
+ })) : p(c) ? V(A.$slots, "default", {
537
536
  key: 2,
538
- data: m(u)
539
- }) : B("", !0);
537
+ data: p(c)
538
+ }) : Y("", !0);
540
539
  };
541
540
  }
542
- }), er = { class: "analytics-chart" }, tr = /* @__PURE__ */ O({
541
+ }), gt = { class: "analytics-chart" }, ft = /* @__PURE__ */ _({
543
542
  __name: "SimpleChartRenderer",
544
543
  props: {
545
544
  query: {},
@@ -548,39 +547,39 @@ const $e = {
548
547
  chartOptions: {},
549
548
  height: {}
550
549
  },
551
- setup(e) {
552
- H((n) => ({
553
- "8c62ff26": `${n.height}px`
550
+ setup(t) {
551
+ x((e) => ({
552
+ "8c62ff26": `${e.height}px`
554
553
  }));
555
- const t = e, r = {
556
- [A.Gauge]: lt.GAUGE
557
- }, i = g(() => ({
558
- ...t.chartOptions,
559
- type: r[t.chartOptions.type]
554
+ const r = t, o = {
555
+ [y.Gauge]: qe.GAUGE
556
+ }, n = d(() => ({
557
+ ...r.chartOptions,
558
+ type: o[r.chartOptions.type]
560
559
  }));
561
- return (n, a) => (h(), E(J, {
562
- context: n.context,
563
- query: n.query,
564
- "query-ready": n.queryReady
560
+ return (e, i) => (l(), f(N, {
561
+ context: e.context,
562
+ query: e.query,
563
+ "query-ready": e.queryReady
565
564
  }, {
566
- default: I(({ data: o }) => [
567
- K("div", er, [
568
- R(m(ct), {
569
- "chart-data": o,
570
- "chart-options": i.value,
571
- "synthetics-data-key": n.chartOptions.syntheticsDataKey
565
+ default: v(({ data: a }) => [
566
+ G("div", gt, [
567
+ T(p(Se), {
568
+ "chart-data": a,
569
+ "chart-options": n.value,
570
+ "synthetics-data-key": e.chartOptions.syntheticsDataKey
572
571
  }, null, 8, ["chart-data", "chart-options", "synthetics-data-key"])
573
572
  ])
574
573
  ]),
575
574
  _: 1
576
575
  }, 8, ["context", "query", "query-ready"]));
577
576
  }
578
- }), $ = (e, t) => {
579
- const r = e.__vccOpts || e;
580
- for (const [i, n] of t)
581
- r[i] = n;
582
- return r;
583
- }, rr = /* @__PURE__ */ $(tr, [["__scopeId", "data-v-f0f6ed41"]]), nr = { class: "analytics-chart" }, ir = /* @__PURE__ */ O({
577
+ }), R = (t, r) => {
578
+ const o = t.__vccOpts || t;
579
+ for (const [n, e] of r)
580
+ o[n] = e;
581
+ return o;
582
+ }, vt = /* @__PURE__ */ R(ft, [["__scopeId", "data-v-f0f6ed41"]]), _t = { class: "analytics-chart" }, bt = /* @__PURE__ */ _({
584
583
  __name: "BarChartRenderer",
585
584
  props: {
586
585
  query: {},
@@ -589,33 +588,33 @@ const $e = {
589
588
  chartOptions: {},
590
589
  height: {}
591
590
  },
592
- setup(e) {
593
- H((n) => ({
594
- "1eed717c": `${n.height}px`
591
+ setup(t) {
592
+ x((e) => ({
593
+ "1eed717c": `${e.height}px`
595
594
  }));
596
- const t = e, r = {
597
- [A.HorizontalBar]: re.HORIZONTAL_BAR,
598
- [A.VerticalBar]: re.VERTICAL_BAR
599
- }, i = g(() => ({
600
- type: r[t.chartOptions.type],
601
- stacked: t.chartOptions.stacked,
602
- chartDatasetColors: t.chartOptions.chartDatasetColors
595
+ const r = t, o = {
596
+ [y.HorizontalBar]: j.HORIZONTAL_BAR,
597
+ [y.VerticalBar]: j.VERTICAL_BAR
598
+ }, n = d(() => ({
599
+ type: o[r.chartOptions.type],
600
+ stacked: r.chartOptions.stacked,
601
+ chartDatasetColors: r.chartOptions.chartDatasetColors
603
602
  }));
604
- return (n, a) => (h(), E(J, {
605
- context: n.context,
606
- query: n.query,
607
- "query-ready": n.queryReady
603
+ return (e, i) => (l(), f(N, {
604
+ context: e.context,
605
+ query: e.query,
606
+ "query-ready": e.queryReady
608
607
  }, {
609
- default: I(({ data: o }) => [
610
- K("div", nr, [
611
- R(m(qe), {
612
- "allow-csv-export": n.chartOptions.allowCsvExport,
613
- "chart-data": o,
614
- "chart-options": i.value,
615
- "chart-title": n.chartOptions.chartTitle,
608
+ default: v(({ data: a }) => [
609
+ G("div", _t, [
610
+ T(p(ee), {
611
+ "allow-csv-export": e.chartOptions.allowCsvExport,
612
+ "chart-data": a,
613
+ "chart-options": n.value,
614
+ "chart-title": e.chartOptions.chartTitle,
616
615
  "legend-position": "bottom",
617
616
  "show-annotations": !1,
618
- "synthetics-data-key": n.chartOptions.syntheticsDataKey,
617
+ "synthetics-data-key": e.chartOptions.syntheticsDataKey,
619
618
  "tooltip-title": ""
620
619
  }, null, 8, ["allow-csv-export", "chart-data", "chart-options", "chart-title", "synthetics-data-key"])
621
620
  ])
@@ -623,7 +622,7 @@ const $e = {
623
622
  _: 1
624
623
  }, 8, ["context", "query", "query-ready"]));
625
624
  }
626
- }), he = /* @__PURE__ */ $(ir, [["__scopeId", "data-v-36598a1b"]]), ar = { class: "analytics-chart" }, or = /* @__PURE__ */ O({
625
+ }), M = /* @__PURE__ */ R(bt, [["__scopeId", "data-v-36598a1b"]]), qt = { class: "analytics-chart" }, St = /* @__PURE__ */ _({
627
626
  __name: "TimeseriesChartRenderer",
628
627
  props: {
629
628
  query: {},
@@ -632,35 +631,35 @@ const $e = {
632
631
  chartOptions: {},
633
632
  height: {}
634
633
  },
635
- setup(e) {
636
- H((n) => ({
637
- "4efa9c90": `${n.height}px`
634
+ setup(t) {
635
+ x((e) => ({
636
+ "4efa9c90": `${e.height}px`
638
637
  }));
639
- const t = e, r = {
640
- [A.TimeseriesLine]: re.TIMESERIES_LINE
638
+ const r = t, o = {
639
+ [y.TimeseriesLine]: j.TIMESERIES_LINE
641
640
  // TODO: Timeseries bar
642
- }, i = g(() => {
643
- const n = t.chartOptions.stacked ?? !1;
641
+ }, n = d(() => {
642
+ const e = r.chartOptions.stacked ?? !1;
644
643
  return {
645
- type: r[t.chartOptions.type],
646
- stacked: n,
647
- chartDatasetColors: t.chartOptions.chartDatasetColors
644
+ type: o[r.chartOptions.type],
645
+ stacked: e,
646
+ chartDatasetColors: r.chartOptions.chartDatasetColors
648
647
  };
649
648
  });
650
- return (n, a) => (h(), E(J, {
651
- context: n.context,
652
- query: n.query,
653
- "query-ready": n.queryReady
649
+ return (e, i) => (l(), f(N, {
650
+ context: e.context,
651
+ query: e.query,
652
+ "query-ready": e.queryReady
654
653
  }, {
655
- default: I(({ data: o }) => [
656
- K("div", ar, [
657
- R(m(qe), {
658
- "allow-csv-export": n.chartOptions.allowCsvExport,
659
- "chart-data": o,
660
- "chart-options": i.value,
661
- "chart-title": n.chartOptions.chartTitle,
654
+ default: v(({ data: a }) => [
655
+ G("div", qt, [
656
+ T(p(ee), {
657
+ "allow-csv-export": e.chartOptions.allowCsvExport,
658
+ "chart-data": a,
659
+ "chart-options": n.value,
660
+ "chart-title": e.chartOptions.chartTitle,
662
661
  "legend-position": "bottom",
663
- "synthetics-data-key": n.chartOptions.syntheticsDataKey,
662
+ "synthetics-data-key": e.chartOptions.syntheticsDataKey,
664
663
  "tooltip-title": ""
665
664
  }, null, 8, ["allow-csv-export", "chart-data", "chart-options", "chart-title", "synthetics-data-key"])
666
665
  ])
@@ -668,7 +667,7 @@ const $e = {
668
667
  _: 1
669
668
  }, 8, ["context", "query", "query-ready"]));
670
669
  }
671
- }), sr = /* @__PURE__ */ $(or, [["__scopeId", "data-v-ceb07ca8"]]), lr = { class: "metric-card-tile-wrapper" }, cr = /* @__PURE__ */ O({
670
+ }), Tt = /* @__PURE__ */ R(St, [["__scopeId", "data-v-ceb07ca8"]]), Rt = { class: "metric-card-tile-wrapper" }, At = /* @__PURE__ */ _({
672
671
  __name: "GoldenSignalsRenderer",
673
672
  props: {
674
673
  query: {},
@@ -677,1276 +676,52 @@ const $e = {
677
676
  chartOptions: {},
678
677
  height: {}
679
678
  },
680
- setup(e) {
681
- const t = e, r = g(() => {
682
- const n = t.context.timeSpec;
683
- if (n.type === "absolute")
684
- return new kt({
679
+ setup(t) {
680
+ const r = t, o = d(() => {
681
+ const e = r.context.timeSpec;
682
+ if (e.type === "absolute")
683
+ return new ze({
685
684
  key: "custom",
686
685
  timeframeText: "custom",
687
686
  display: "custom",
688
- startCustom: n.start,
689
- endCustom: n.end,
690
- timeframeLength: () => n.end.getTime() - n.start.getTime(),
687
+ startCustom: e.start,
688
+ endCustom: e.end,
689
+ timeframeLength: () => e.end.getTime() - e.start.getTime(),
691
690
  defaultResponseGranularity: "daily",
692
691
  dataGranularity: "daily",
693
692
  isRelative: !1,
694
693
  allowedTiers: ["free", "plus", "enterprise"]
695
694
  });
696
- const a = Tt.get(n.time_range);
697
- if (!a)
695
+ const i = je.get(e.time_range);
696
+ if (!i)
698
697
  throw new Error("Unknown time range");
699
- return a;
700
- }), i = g(() => {
701
- var n;
698
+ return i;
699
+ }), n = d(() => {
700
+ var e;
702
701
  return {
703
- datasource: (n = t.query) == null ? void 0 : n.datasource,
704
- overrideTimeframe: r.value,
705
- tz: t.context.tz,
706
- additionalFilter: t.context.filters,
702
+ datasource: (e = r.query) == null ? void 0 : e.datasource,
703
+ overrideTimeframe: o.value,
704
+ tz: r.context.tz,
705
+ additionalFilter: r.context.filters,
707
706
  // TODO: Decide how to handle metric card filters.
708
- longCardTitles: t.chartOptions.longCardTitles,
709
- containerTitle: t.chartOptions.chartTitle,
710
- description: t.chartOptions.description,
711
- percentileLatency: t.chartOptions.percentileLatency,
712
- refreshInterval: t.context.refreshInterval,
713
- queryReady: t.queryReady
707
+ longCardTitles: r.chartOptions.longCardTitles,
708
+ containerTitle: r.chartOptions.chartTitle,
709
+ description: r.chartOptions.description,
710
+ percentileLatency: r.chartOptions.percentileLatency,
711
+ refreshInterval: r.context.refreshInterval,
712
+ queryReady: r.queryReady
714
713
  };
715
714
  });
716
- return (n, a) => (h(), C("div", lr, [
717
- R(m(At), Ee(Ze(i.value)), {
718
- default: I(() => [
719
- R(m(Et))
715
+ return (e, i) => (l(), S("div", Rt, [
716
+ T(p(Be), X(de(n.value)), {
717
+ default: v(() => [
718
+ T(p(Fe))
720
719
  ]),
721
720
  _: 1
722
721
  }, 16)
723
722
  ]));
724
723
  }
725
- }), ur = /* @__PURE__ */ $(cr, [["__scopeId", "data-v-7d1a3f03"]]), Pe = "20px";
726
- var F = /* @__PURE__ */ ((e) => (e[e.Loading = 0] = "Loading", e[e.Idle = 1] = "Idle", e[e.NoResults = 2] = "NoResults", e[e.Error = 3] = "Error", e))(F || {}), Fe = /* @__PURE__ */ ((e) => (e.CaCertificate = "ca_certificate", e.Certificate = "certificate", e.Consumer = "consumer", e.ConsumerGroup = "consumer_group", e.GatewayService = "service", e.Key = "key", e.KeySet = "set", e.Plugin = "plugin", e.Route = "route", e.SNI = "sni", e.Upstream = "upstream", e.Target = "target", e.Vault = "vault", e.Other = "other", e))(Fe || {});
727
- Object.values(Fe);
728
- function pr() {
729
- return {
730
- getAxiosInstance: (e = {}) => {
731
- try {
732
- const t = ie("get-axios-instance", void 0);
733
- return typeof t == "function" ? t(e) : ye.create({
734
- withCredentials: !0,
735
- timeout: 3e4,
736
- ...e
737
- });
738
- } catch (t) {
739
- return console.warn("getAxiosInstance:", t.message || t), ye.create({
740
- withCredentials: !0,
741
- timeout: 3e4,
742
- ...e
743
- });
744
- }
745
- },
746
- getTraceIdFromError: (e) => {
747
- var t;
748
- return ((t = e == null ? void 0 : e.response) == null ? void 0 : t.headers["x-datadog-trace-id"]) || "";
749
- }
750
- };
751
- }
752
- function dr() {
753
- return {
754
- debounce: (e, t) => {
755
- let r;
756
- return (...i) => {
757
- clearTimeout(r), r = window == null ? void 0 : window.setTimeout(() => {
758
- e(...i);
759
- }, t);
760
- };
761
- }
762
- };
763
- }
764
- function ue(e = {}) {
765
- const { getAxiosInstance: t } = pr();
766
- return {
767
- axiosInstance: t(e)
768
- };
769
- }
770
- const yr = {
771
- actions: {
772
- copyId: "Copy ID",
773
- copied_id: 'Copied "{id}" to the clipboard',
774
- copyToClipboard: "Copied successfully!",
775
- copyToClipboardFailed: "Failed to copy to the clipboard"
776
- }
777
- }, fr = {
778
- message: "Are you sure you want to delete this {entityType}?",
779
- messageWithName: "Are you sure you want to delete this {entityType} {entityName}?"
780
- }, hr = {
781
- actions: {
782
- viewConfiguration: "View Configuration",
783
- save: "Save",
784
- cancel: "Cancel",
785
- back: "Back"
786
- },
787
- configuration: {
788
- title: "Configuration",
789
- message: "Export configurations for core Kong Gateway objects, like services, routes, and plugins, to either YAML or JSON. This allows for straightforward importing into APIOps tools like decK with YAML, or Insomnia and cURL with JSON.",
790
- yaml: "YAML",
791
- json: "JSON",
792
- terraform: "Terraform"
793
- },
794
- errors: {
795
- edit: "The entity could not be edited at this time."
796
- }
797
- }, mr = {
798
- emptyState: {
799
- noSearchResultsTitle: "No results found",
800
- noSearchResultsMessage: "Please adjust the criteria and try again.",
801
- noSearchResultsCtaText: "Clear"
802
- }
803
- }, gr = {
804
- title: "Configuration",
805
- actions: {
806
- copy: "Copy JSON"
807
- },
808
- sections: {
809
- advanced: "Advanced",
810
- plugin: "Plugin Specific Configuration"
811
- },
812
- commonFields: {
813
- id_label: "ID",
814
- name_label: "Name",
815
- enabled_label: "Enabled",
816
- enabled_tooltip: "Enabled is FTW",
817
- updated_at_label: "Last Updated",
818
- created_at_label: "Created",
819
- tags_label: "Tags",
820
- link: "Link"
821
- },
822
- statusBadge: {
823
- enabledLabel: "Enabled",
824
- disabledLabel: "Disabled"
825
- },
826
- copy: {
827
- tooltip: "Copy {label}",
828
- success: "Copied!"
829
- },
830
- errors: {
831
- load: "The entity configuration data could not be loaded at this time.",
832
- copy: "Failed to copy to clipboard"
833
- },
834
- general: {
835
- entryTitle: "Entry {index}",
836
- structuredFormat: "Structured"
837
- }
838
- }, vr = {
839
- filterButtonText: "Filter",
840
- fieldLabel: "Filter by:",
841
- inputPlaceholder: "Enter a value",
842
- selectPlaceholder: "Select an item",
843
- applyButtonText: "Apply",
844
- clearButtonText: "Clear",
845
- clearAllButtonText: "Clear all filters"
846
- }, br = {
847
- errors: {
848
- fetch: "Could not fetch available items",
849
- invalid: "Please select a valid value"
850
- }
851
- }, wr = {
852
- unexpected: "An unexpected error has occurred",
853
- dataKeyUndefined: 'The data key "{dataKey}" does not exist in the response.'
854
- }, _r = {
855
- utf8Name: "The name can be any string containing characters, letters, numbers, or the following characters: ., -, _, or ~. Do not use spaces."
856
- }, Sr = {
857
- enable: {
858
- title: "Enable {entityType}",
859
- message: "Are you sure you want to enable the {entityType} {entityName}?",
860
- confirmText: "Yes, enable"
861
- },
862
- disable: {
863
- title: "Disable {entityType}",
864
- message: "Are you sure you want to disable the {entityType} {entityName}?",
865
- confirmText: "Yes, disable"
866
- }
867
- }, xr = {
868
- global: yr,
869
- deleteModal: fr,
870
- baseForm: hr,
871
- baseTable: mr,
872
- baseConfigCard: gr,
873
- filter: vr,
874
- debouncedFilter: br,
875
- errors: wr,
876
- validationErrors: _r,
877
- toggleModal: Sr
878
- };
879
- function X() {
880
- const e = Oe("en-us", xr);
881
- return {
882
- i18n: e,
883
- i18nT: Ne(e)
884
- // Translation component <i18n-t>
885
- };
886
- }
887
- function Ue() {
888
- const e = (r, i) => (i == null ? void 0 : i[r]) ?? void 0, t = (r, i) => {
889
- if (r.length !== i.length) return !1;
890
- const n = /* @__PURE__ */ new Set([...r, ...i]);
891
- for (const a of n) {
892
- const o = r.filter((c) => c === a).length, s = i.filter((c) => c === a).length;
893
- if (o !== s) return !1;
894
- }
895
- return !0;
896
- };
897
- return {
898
- getPropValue: e,
899
- objectsAreEqual: (r, i, n) => {
900
- if (n) {
901
- if (Object.keys(r).length === Object.keys(i).length)
902
- for (const a in r)
903
- if (Array.isArray(r[a]) && Array.isArray(i[a])) {
904
- if (t(r[a], i[a]))
905
- continue;
906
- return !1;
907
- } else {
908
- if (r[a] === i[a])
909
- continue;
910
- return !1;
911
- }
912
- else
913
- return !1;
914
- return !0;
915
- }
916
- try {
917
- return JSON.stringify(r) === JSON.stringify(i);
918
- } catch {
919
- return !1;
920
- }
921
- },
922
- sortAlpha: (r) => (i, n) => {
923
- let a = i[r] === void 0 || i[r] === null ? "" : i[r], o = n[r] === void 0 || n[r] === null ? "" : n[r];
924
- return Array.isArray(i[r]) && (a = i[r][0]), Array.isArray(n[r]) && (o = n[r][0]), a.localeCompare(o);
925
- },
926
- isValidUuid: (r) => r ? /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(r) : !1
927
- };
928
- }
929
- function kr(e, t, r, i = {
930
- fetchedItemsKey: "data",
931
- searchKeys: ["id"]
932
- }) {
933
- r || (r = "1000");
934
- const { axiosInstance: n } = ue(e.axiosRequestConfig), { i18n: { t: a } } = X(), { debounce: o } = dr(), s = o(async (f) => {
935
- await L(f);
936
- }, 200), c = v(!1), u = v(""), p = v(""), l = v([]), d = v([]), y = v(void 0), b = g(() => {
937
- const f = `${e.apiBaseUrl}${m(t)}`;
938
- return e.app === "konnect" ? f.replace(/{controlPlaneId}/gi, (e == null ? void 0 : e.controlPlaneId) || "") : e.app === "kongManager" ? f.replace(/\/{workspace}/gi, e != null && e.workspace ? `/${e.workspace}` : "") : f;
939
- }), { isValidUuid: S } = Ue(), V = async () => {
940
- try {
941
- c.value = !0;
942
- const { data: f } = await n.get(`${b.value}?size=${r}`);
943
- f != null && f.next || (y.value = i.fetchedItemsKey in f ? f[i.fetchedItemsKey] : []), d.value = i.fetchedItemsKey in f ? f[i.fetchedItemsKey] : [], l.value = d.value;
944
- } catch {
945
- l.value = [], u.value = a("debouncedFilter.errors.fetch");
946
- } finally {
947
- c.value = !1;
948
- }
949
- }, N = v(""), L = async (f) => {
950
- var q, w, Z;
951
- if (N.value !== f) {
952
- if (N.value = f ?? "", !f) {
953
- l.value = d.value;
954
- return;
955
- }
956
- if (y.value === void 0)
957
- try {
958
- if (c.value = !0, u.value = "", p.value = "", e.app === "konnect") {
959
- const x = `${b.value}/${f}`, { data: k } = await n.get(`${x}?size=${r}`);
960
- i.fetchedItemsKey in k ? l.value = k[i.fetchedItemsKey] : k != null && k[i.exactMatchKey ?? "id"] ? l.value = [k] : l.value = [];
961
- } else {
962
- const x = [];
963
- S(f) && i.searchKeys.includes("id") ? x.push((async () => {
964
- const { data: T } = await n.get(`${b.value}/${f}`);
965
- return [T[i.fetchedItemsKey] ?? T];
966
- })()) : x.push(
967
- ...i.searchKeys.filter((T) => T !== "id").map(async (T) => {
968
- const { data: D } = await n.get(`${b.value}?${T}=${f}`);
969
- return D[i.fetchedItemsKey];
970
- })
971
- );
972
- const k = await Promise.all(x), M = /* @__PURE__ */ new Set();
973
- l.value = [], (q = k == null ? void 0 : k.forEach) == null || q.call(k, (T) => {
974
- var D;
975
- (D = T == null ? void 0 : T.forEach) == null || D.call(T, (ee) => {
976
- M.has(ee.id) || (M.add(ee.id), l.value.push(ee));
977
- });
978
- });
979
- }
980
- } catch (x) {
981
- ((w = x == null ? void 0 : x.response) == null ? void 0 : w.status) === 404 ? p.value = a("debouncedFilter.errors.invalid") : (l.value = [], u.value = a("debouncedFilter.errors.fetch"));
982
- } finally {
983
- c.value = !1;
984
- }
985
- else
986
- c.value = !0, p.value = "", l.value = (Z = y.value) == null ? void 0 : Z.filter((x) => {
987
- var k;
988
- let M = !1;
989
- for (const T of i.searchKeys) {
990
- const D = typeof x[T] == "string" ? (k = x[T]) == null ? void 0 : k.toLowerCase() : x[T];
991
- D != null && D.includes(f.toLowerCase()) && (M = !0);
992
- }
993
- return M;
994
- }), (!l.value || !l.value.length) && (p.value = a("debouncedFilter.errors.invalid")), c.value = !1;
995
- }
996
- };
997
- return {
998
- loading: c,
999
- error: u,
1000
- validationError: p,
1001
- results: l,
1002
- allRecords: y,
1003
- loadItems: V,
1004
- debouncedQueryChange: s
1005
- };
1006
- }
1007
- function Tr(e, t) {
1008
- const r = m(t), i = g(
1009
- () => e.apiBaseUrl.startsWith("/") ? new URL(`${window.location.origin}${r}`) : new URL(r)
1010
- );
1011
- return i.value.search = "", (n) => `${i.value.href}/${n}`;
1012
- }
1013
- function Ir() {
1014
- const { i18n: { t: e } } = X();
1015
- return {
1016
- getMessageFromError: (t) => {
1017
- var r, i, n, a;
1018
- if (!t)
1019
- return e("errors.unexpected");
1020
- if (((r = t == null ? void 0 : t.response) == null ? void 0 : r.status) === 401)
1021
- return console.warn("getMessageFromError: User auth token is expired or missing, returning empty message."), "";
1022
- if ((i = t == null ? void 0 : t.response) != null && i.data) {
1023
- if (t.response.data.detail)
1024
- return t.response.data.detail;
1025
- if ((n = t.response.data.details) != null && n.length)
1026
- return t.response.data.details.map((o) => {
1027
- let s = e("errors.unexpected");
1028
- return o.messages && typeof o.messages == "object" && o.messages.length && (s = o.messages.join(", ")), o.field ? `${o.field} - ${s}` : s;
1029
- }).join("; ");
1030
- if (t.response.data.message) {
1031
- const { message: o } = t.response.data;
1032
- return Array.isArray(o) ? (a = o[0]) != null && a.constraints ? Object.values(o[0].constraints)[0] : o[0] : o;
1033
- }
1034
- if (typeof t.response.data == "string")
1035
- return t.response.data;
1036
- if (typeof t.response.data == "object")
1037
- return Object.keys(t.response.data).map((o) => `${o} ${t.response.data[o]}`).join(", ");
1038
- }
1039
- return t.message || e("errors.unexpected");
1040
- }
1041
- };
1042
- }
1043
- function Ar(e) {
1044
- const t = window.location.origin, r = t.endsWith("/") ? t : `${t}/`;
1045
- try {
1046
- const i = e.join("/"), n = `${r}${i}`, a = e.some((o) => o.trim() === "");
1047
- if (/^(https:\/\/(www\.)?([a-zA-Z0-9-]+\.){1,}[a-zA-Z]{2,}(:[0-9]+)?(\/[^\/]+)*)$|^(https|http):\/\/localhost(:[0-9]+)?(\/[^\/]+)*$/.test(n) && !a && new URL(n))
1048
- return `${r}${i}`;
1049
- throw new Error("Invalid url");
1050
- } catch (i) {
1051
- return console.warn("Failed to build valid URL:", i), "";
1052
- }
1053
- }
1054
- function ze(e, t) {
1055
- const r = v(m(e)), i = v(m(t)), n = g(
1056
- () => !!(r.value.app === "konnect" || r.value.isExactMatch)
1057
- ), a = g(
1058
- () => i.value.startsWith("/") ? new URL(`${window.location.origin}${i.value}`) : new URL(i.value)
1059
- );
1060
- return (o) => {
1061
- const { page: s, pageSize: c, offset: u, sortColumnKey: p, sortColumnOrder: l, query: d } = o;
1062
- try {
1063
- let y = new URL(a.value.href);
1064
- return n.value && d ? (y.search = "", y = r.value.isExactMatch ? new URL(`${y.href}/${d}/`) : new URL(`${y.href}?filter[name][contains]=${d}`)) : (n.value || new URLSearchParams(d).forEach((b, S) => {
1065
- y.searchParams.append(S, b);
1066
- }), p && y.searchParams.append("sort_by", p), l === "desc" && y.searchParams.append("sort_desc", "1"), y.searchParams.append("size", String(c))), u && s !== 1 && y.searchParams.append("offset", String(u)), y.href;
1067
- } catch (y) {
1068
- return console.error("RouteList(fetcher)", y), i.value;
1069
- }
1070
- };
1071
- }
1072
- function Er(e, t, r) {
1073
- const i = m(t), { axiosInstance: n } = ue(e.axiosRequestConfig), a = ze(e, i), o = v({
1074
- status: F.Idle
1075
- });
1076
- return { fetcher: async (s) => {
1077
- var c;
1078
- const u = We(r) || "data";
1079
- try {
1080
- o.value = { status: F.Loading };
1081
- let p = a(s);
1082
- p.includes("filter[name]") && (p = `${p}&page[size]=${s.pageSize}&page[number]=${s.page}`);
1083
- const l = await n.get(p);
1084
- if (l.status >= 400)
1085
- throw l;
1086
- const d = l.data, y = u && u.replace(/[^\w-_]/gi, "");
1087
- let b;
1088
- d[y] ? b = Array.isArray(d[y]) ? d[y] : [d[y]] : Array.isArray(d) ? b = d : b = Object.keys(d).length ? [d] : [];
1089
- const S = {
1090
- data: b,
1091
- total: b.length,
1092
- ...d.offset ? {
1093
- pagination: {
1094
- offset: d.offset
1095
- }
1096
- } : null
1097
- };
1098
- return o.value = {
1099
- status: F.Idle,
1100
- response: S
1101
- }, S;
1102
- } catch (p) {
1103
- const l = {
1104
- data: [],
1105
- total: 0
1106
- };
1107
- return s.query && (((c = p.response) == null ? void 0 : c.status) === 404 || p.status === 404) ? (o.value = {
1108
- status: F.NoResults,
1109
- response: l,
1110
- error: p.response ? p : { response: p }
1111
- }, l) : (o.value = {
1112
- status: F.Error,
1113
- response: l,
1114
- error: p.response ? p : { response: p }
1115
- }, l);
1116
- }
1117
- }, fetcherState: o };
1118
- }
1119
- function Cr() {
1120
- const e = (r, i = "_") => r ? r.split(i).map((n) => n.toLowerCase() === "id" ? n.toUpperCase() : n.charAt(0).toUpperCase() + n.substring(1)).join(" ") : "", t = /(?:^|[\s-:'"])\w/g;
1121
- return {
1122
- capitalize: (r) => r ? r.replace(t, (i) => i.toUpperCase()) : "",
1123
- convertKeyToTitle: e
1124
- };
1125
- }
1126
- const Ke = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, me = (e) => {
1127
- if (typeof e != "string")
1128
- throw new TypeError("Invalid argument expected string");
1129
- const t = e.match(Ke);
1130
- if (!t)
1131
- throw new Error(`Invalid argument not valid semver ('${e}' received)`);
1132
- return t.shift(), t;
1133
- }, ge = (e) => e === "*" || e === "x" || e === "X", ve = (e) => {
1134
- const t = parseInt(e, 10);
1135
- return isNaN(t) ? e : t;
1136
- }, qr = (e, t) => typeof e != typeof t ? [String(e), String(t)] : [e, t], Or = (e, t) => {
1137
- if (ge(e) || ge(t))
1138
- return 0;
1139
- const [r, i] = qr(ve(e), ve(t));
1140
- return r > i ? 1 : r < i ? -1 : 0;
1141
- }, be = (e, t) => {
1142
- for (let r = 0; r < Math.max(e.length, t.length); r++) {
1143
- const i = Or(e[r] || "0", t[r] || "0");
1144
- if (i !== 0)
1145
- return i;
1146
- }
1147
- return 0;
1148
- }, Nr = (e, t) => {
1149
- const r = me(e), i = me(t), n = r.pop(), a = i.pop(), o = be(r, i);
1150
- return o !== 0 ? o : n && a ? be(n.split("."), a.split(".")) : n || a ? n ? -1 : 1 : 0;
1151
- }, we = (e, t, r) => {
1152
- Rr(r);
1153
- const i = Nr(e, t);
1154
- return Ve[r].includes(i);
1155
- }, Ve = {
1156
- ">": [1],
1157
- ">=": [0, 1],
1158
- "=": [0],
1159
- "<=": [-1, 0],
1160
- "<": [-1],
1161
- "!=": [-1, 1]
1162
- }, _e = Object.keys(Ve), Rr = (e) => {
1163
- if (typeof e != "string")
1164
- throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);
1165
- if (_e.indexOf(e) === -1)
1166
- throw new Error(`Invalid operator, expected one of ${_e.join("|")}`);
1167
- }, Lr = (e) => typeof e == "string" && /^[v\d]/.test(e) && Ke.test(e);
1168
- function Dr(e) {
1169
- const { gatewayInfo: t, supportedRange: r } = e;
1170
- if (!t)
1171
- return !0;
1172
- const { edition: i, version: n } = t;
1173
- if (!Lr(n))
1174
- return console.error("Invalid version"), !1;
1175
- const a = r[i];
1176
- if (!a)
1177
- return !1;
1178
- const [o, s] = a;
1179
- return !(o && we(n, o, "<") || s && we(n, s, ">"));
1180
- }
1181
- function jr(e) {
1182
- const t = v(0), r = v(0), i = v(!1);
1183
- return Je(e, (n) => {
1184
- n && !i.value && (t.value = n.offsetWidth, r.value = n.scrollWidth, i.value = !0);
1185
- }), {
1186
- isTruncated: g(() => t.value < r.value)
1187
- };
1188
- }
1189
- function $r() {
1190
- const { i18n: { t: e } } = X();
1191
- return {
1192
- utf8Name: (t) => /^[\p{N}\p{L}.\-_~]*$/u.test(t) ? "" : e("validationErrors.utf8Name")
1193
- };
1194
- }
1195
- const Se = {
1196
- useAxios: ue,
1197
- useDebouncedFilter: kr,
1198
- useDeleteUrlBuilder: Tr,
1199
- useErrors: Ir,
1200
- useExternalLinkCreator: Ar,
1201
- useFetcher: Er,
1202
- useFetchUrlBuilder: ze,
1203
- useHelpers: Ue,
1204
- useStringHelpers: Cr,
1205
- useI18n: X,
1206
- useGatewayFeatureSupported: Dr,
1207
- useTruncationDetector: jr,
1208
- useValidators: $r
1209
- }, Pr = (e, t) => {
1210
- const r = e.__vccOpts || e;
1211
- for (const [i, n] of t)
1212
- r[i] = n;
1213
- return r;
1214
- }, Fr = "#0044f4", Ur = "16px";
1215
- /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
1216
- function Me(e) {
1217
- return typeof e > "u" || e === null;
1218
- }
1219
- function zr(e) {
1220
- return typeof e == "object" && e !== null;
1221
- }
1222
- function Kr(e) {
1223
- return Array.isArray(e) ? e : Me(e) ? [] : [e];
1224
- }
1225
- function Vr(e, t) {
1226
- var r, i, n, a;
1227
- if (t)
1228
- for (a = Object.keys(t), r = 0, i = a.length; r < i; r += 1)
1229
- n = a[r], e[n] = t[n];
1230
- return e;
1231
- }
1232
- function Mr(e, t) {
1233
- var r = "", i;
1234
- for (i = 0; i < t; i += 1)
1235
- r += e;
1236
- return r;
1237
- }
1238
- function Br(e) {
1239
- return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
1240
- }
1241
- var Gr = Me, Hr = zr, Yr = Kr, Zr = Mr, Qr = Br, Wr = Vr, pe = {
1242
- isNothing: Gr,
1243
- isObject: Hr,
1244
- toArray: Yr,
1245
- repeat: Zr,
1246
- isNegativeZero: Qr,
1247
- extend: Wr
1248
- };
1249
- function Be(e, t) {
1250
- var r = "", i = e.reason || "(unknown reason)";
1251
- return e.mark ? (e.mark.name && (r += 'in "' + e.mark.name + '" '), r += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !t && e.mark.snippet && (r += `
1252
-
1253
- ` + e.mark.snippet), i + " " + r) : i;
1254
- }
1255
- function G(e, t) {
1256
- Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = Be(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
1257
- }
1258
- G.prototype = Object.create(Error.prototype);
1259
- G.prototype.constructor = G;
1260
- G.prototype.toString = function(e) {
1261
- return this.name + ": " + Be(this, e);
1262
- };
1263
- var j = G, Jr = [
1264
- "kind",
1265
- "multi",
1266
- "resolve",
1267
- "construct",
1268
- "instanceOf",
1269
- "predicate",
1270
- "represent",
1271
- "representName",
1272
- "defaultStyle",
1273
- "styleAliases"
1274
- ], Xr = [
1275
- "scalar",
1276
- "sequence",
1277
- "mapping"
1278
- ];
1279
- function en(e) {
1280
- var t = {};
1281
- return e !== null && Object.keys(e).forEach(function(r) {
1282
- e[r].forEach(function(i) {
1283
- t[String(i)] = r;
1284
- });
1285
- }), t;
1286
- }
1287
- function tn(e, t) {
1288
- if (t = t || {}, Object.keys(t).forEach(function(r) {
1289
- if (Jr.indexOf(r) === -1)
1290
- throw new j('Unknown option "' + r + '" is met in definition of "' + e + '" YAML type.');
1291
- }), this.options = t, this.tag = e, this.kind = t.kind || null, this.resolve = t.resolve || function() {
1292
- return !0;
1293
- }, this.construct = t.construct || function(r) {
1294
- return r;
1295
- }, this.instanceOf = t.instanceOf || null, this.predicate = t.predicate || null, this.represent = t.represent || null, this.representName = t.representName || null, this.defaultStyle = t.defaultStyle || null, this.multi = t.multi || !1, this.styleAliases = en(t.styleAliases || null), Xr.indexOf(this.kind) === -1)
1296
- throw new j('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
1297
- }
1298
- var _ = tn;
1299
- function xe(e, t) {
1300
- var r = [];
1301
- return e[t].forEach(function(i) {
1302
- var n = r.length;
1303
- r.forEach(function(a, o) {
1304
- a.tag === i.tag && a.kind === i.kind && a.multi === i.multi && (n = o);
1305
- }), r[n] = i;
1306
- }), r;
1307
- }
1308
- function rn() {
1309
- var e = {
1310
- scalar: {},
1311
- sequence: {},
1312
- mapping: {},
1313
- fallback: {},
1314
- multi: {
1315
- scalar: [],
1316
- sequence: [],
1317
- mapping: [],
1318
- fallback: []
1319
- }
1320
- }, t, r;
1321
- function i(n) {
1322
- n.multi ? (e.multi[n.kind].push(n), e.multi.fallback.push(n)) : e[n.kind][n.tag] = e.fallback[n.tag] = n;
1323
- }
1324
- for (t = 0, r = arguments.length; t < r; t += 1)
1325
- arguments[t].forEach(i);
1326
- return e;
1327
- }
1328
- function ne(e) {
1329
- return this.extend(e);
1330
- }
1331
- ne.prototype.extend = function(e) {
1332
- var t = [], r = [];
1333
- if (e instanceof _)
1334
- r.push(e);
1335
- else if (Array.isArray(e))
1336
- r = r.concat(e);
1337
- else if (e && (Array.isArray(e.implicit) || Array.isArray(e.explicit)))
1338
- e.implicit && (t = t.concat(e.implicit)), e.explicit && (r = r.concat(e.explicit));
1339
- else
1340
- throw new j("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
1341
- t.forEach(function(n) {
1342
- if (!(n instanceof _))
1343
- throw new j("Specified list of YAML types (or a single Type object) contains a non-Type object.");
1344
- if (n.loadKind && n.loadKind !== "scalar")
1345
- throw new j("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
1346
- if (n.multi)
1347
- throw new j("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
1348
- }), r.forEach(function(n) {
1349
- if (!(n instanceof _))
1350
- throw new j("Specified list of YAML types (or a single Type object) contains a non-Type object.");
1351
- });
1352
- var i = Object.create(ne.prototype);
1353
- return i.implicit = (this.implicit || []).concat(t), i.explicit = (this.explicit || []).concat(r), i.compiledImplicit = xe(i, "implicit"), i.compiledExplicit = xe(i, "explicit"), i.compiledTypeMap = rn(i.compiledImplicit, i.compiledExplicit), i;
1354
- };
1355
- var nn = ne, an = new _("tag:yaml.org,2002:str", {
1356
- kind: "scalar",
1357
- construct: function(e) {
1358
- return e !== null ? e : "";
1359
- }
1360
- }), on = new _("tag:yaml.org,2002:seq", {
1361
- kind: "sequence",
1362
- construct: function(e) {
1363
- return e !== null ? e : [];
1364
- }
1365
- }), sn = new _("tag:yaml.org,2002:map", {
1366
- kind: "mapping",
1367
- construct: function(e) {
1368
- return e !== null ? e : {};
1369
- }
1370
- }), ln = new nn({
1371
- explicit: [
1372
- an,
1373
- on,
1374
- sn
1375
- ]
1376
- });
1377
- function cn(e) {
1378
- if (e === null) return !0;
1379
- var t = e.length;
1380
- return t === 1 && e === "~" || t === 4 && (e === "null" || e === "Null" || e === "NULL");
1381
- }
1382
- function un() {
1383
- return null;
1384
- }
1385
- function pn(e) {
1386
- return e === null;
1387
- }
1388
- var dn = new _("tag:yaml.org,2002:null", {
1389
- kind: "scalar",
1390
- resolve: cn,
1391
- construct: un,
1392
- predicate: pn,
1393
- represent: {
1394
- canonical: function() {
1395
- return "~";
1396
- },
1397
- lowercase: function() {
1398
- return "null";
1399
- },
1400
- uppercase: function() {
1401
- return "NULL";
1402
- },
1403
- camelcase: function() {
1404
- return "Null";
1405
- },
1406
- empty: function() {
1407
- return "";
1408
- }
1409
- },
1410
- defaultStyle: "lowercase"
1411
- });
1412
- function yn(e) {
1413
- if (e === null) return !1;
1414
- var t = e.length;
1415
- return t === 4 && (e === "true" || e === "True" || e === "TRUE") || t === 5 && (e === "false" || e === "False" || e === "FALSE");
1416
- }
1417
- function fn(e) {
1418
- return e === "true" || e === "True" || e === "TRUE";
1419
- }
1420
- function hn(e) {
1421
- return Object.prototype.toString.call(e) === "[object Boolean]";
1422
- }
1423
- var mn = new _("tag:yaml.org,2002:bool", {
1424
- kind: "scalar",
1425
- resolve: yn,
1426
- construct: fn,
1427
- predicate: hn,
1428
- represent: {
1429
- lowercase: function(e) {
1430
- return e ? "true" : "false";
1431
- },
1432
- uppercase: function(e) {
1433
- return e ? "TRUE" : "FALSE";
1434
- },
1435
- camelcase: function(e) {
1436
- return e ? "True" : "False";
1437
- }
1438
- },
1439
- defaultStyle: "lowercase"
1440
- });
1441
- function gn(e) {
1442
- return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
1443
- }
1444
- function vn(e) {
1445
- return 48 <= e && e <= 55;
1446
- }
1447
- function bn(e) {
1448
- return 48 <= e && e <= 57;
1449
- }
1450
- function wn(e) {
1451
- if (e === null) return !1;
1452
- var t = e.length, r = 0, i = !1, n;
1453
- if (!t) return !1;
1454
- if (n = e[r], (n === "-" || n === "+") && (n = e[++r]), n === "0") {
1455
- if (r + 1 === t) return !0;
1456
- if (n = e[++r], n === "b") {
1457
- for (r++; r < t; r++)
1458
- if (n = e[r], n !== "_") {
1459
- if (n !== "0" && n !== "1") return !1;
1460
- i = !0;
1461
- }
1462
- return i && n !== "_";
1463
- }
1464
- if (n === "x") {
1465
- for (r++; r < t; r++)
1466
- if (n = e[r], n !== "_") {
1467
- if (!gn(e.charCodeAt(r))) return !1;
1468
- i = !0;
1469
- }
1470
- return i && n !== "_";
1471
- }
1472
- if (n === "o") {
1473
- for (r++; r < t; r++)
1474
- if (n = e[r], n !== "_") {
1475
- if (!vn(e.charCodeAt(r))) return !1;
1476
- i = !0;
1477
- }
1478
- return i && n !== "_";
1479
- }
1480
- }
1481
- if (n === "_") return !1;
1482
- for (; r < t; r++)
1483
- if (n = e[r], n !== "_") {
1484
- if (!bn(e.charCodeAt(r)))
1485
- return !1;
1486
- i = !0;
1487
- }
1488
- return !(!i || n === "_");
1489
- }
1490
- function _n(e) {
1491
- var t = e, r = 1, i;
1492
- if (t.indexOf("_") !== -1 && (t = t.replace(/_/g, "")), i = t[0], (i === "-" || i === "+") && (i === "-" && (r = -1), t = t.slice(1), i = t[0]), t === "0") return 0;
1493
- if (i === "0") {
1494
- if (t[1] === "b") return r * parseInt(t.slice(2), 2);
1495
- if (t[1] === "x") return r * parseInt(t.slice(2), 16);
1496
- if (t[1] === "o") return r * parseInt(t.slice(2), 8);
1497
- }
1498
- return r * parseInt(t, 10);
1499
- }
1500
- function Sn(e) {
1501
- return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !pe.isNegativeZero(e);
1502
- }
1503
- var xn = new _("tag:yaml.org,2002:int", {
1504
- kind: "scalar",
1505
- resolve: wn,
1506
- construct: _n,
1507
- predicate: Sn,
1508
- represent: {
1509
- binary: function(e) {
1510
- return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
1511
- },
1512
- octal: function(e) {
1513
- return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
1514
- },
1515
- decimal: function(e) {
1516
- return e.toString(10);
1517
- },
1518
- /* eslint-disable max-len */
1519
- hexadecimal: function(e) {
1520
- return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
1521
- }
1522
- },
1523
- defaultStyle: "decimal",
1524
- styleAliases: {
1525
- binary: [2, "bin"],
1526
- octal: [8, "oct"],
1527
- decimal: [10, "dec"],
1528
- hexadecimal: [16, "hex"]
1529
- }
1530
- }), kn = new RegExp(
1531
- // 2.5e4, 2.5 and integers
1532
- "^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
1533
- );
1534
- function Tn(e) {
1535
- return !(e === null || !kn.test(e) || // Quick hack to not allow integers end with `_`
1536
- // Probably should update regexp & check speed
1537
- e[e.length - 1] === "_");
1538
- }
1539
- function In(e) {
1540
- var t, r;
1541
- return t = e.replace(/_/g, "").toLowerCase(), r = t[0] === "-" ? -1 : 1, "+-".indexOf(t[0]) >= 0 && (t = t.slice(1)), t === ".inf" ? r === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : t === ".nan" ? NaN : r * parseFloat(t, 10);
1542
- }
1543
- var An = /^[-+]?[0-9]+e/;
1544
- function En(e, t) {
1545
- var r;
1546
- if (isNaN(e))
1547
- switch (t) {
1548
- case "lowercase":
1549
- return ".nan";
1550
- case "uppercase":
1551
- return ".NAN";
1552
- case "camelcase":
1553
- return ".NaN";
1554
- }
1555
- else if (Number.POSITIVE_INFINITY === e)
1556
- switch (t) {
1557
- case "lowercase":
1558
- return ".inf";
1559
- case "uppercase":
1560
- return ".INF";
1561
- case "camelcase":
1562
- return ".Inf";
1563
- }
1564
- else if (Number.NEGATIVE_INFINITY === e)
1565
- switch (t) {
1566
- case "lowercase":
1567
- return "-.inf";
1568
- case "uppercase":
1569
- return "-.INF";
1570
- case "camelcase":
1571
- return "-.Inf";
1572
- }
1573
- else if (pe.isNegativeZero(e))
1574
- return "-0.0";
1575
- return r = e.toString(10), An.test(r) ? r.replace("e", ".e") : r;
1576
- }
1577
- function Cn(e) {
1578
- return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || pe.isNegativeZero(e));
1579
- }
1580
- var qn = new _("tag:yaml.org,2002:float", {
1581
- kind: "scalar",
1582
- resolve: Tn,
1583
- construct: In,
1584
- predicate: Cn,
1585
- represent: En,
1586
- defaultStyle: "lowercase"
1587
- }), On = ln.extend({
1588
- implicit: [
1589
- dn,
1590
- mn,
1591
- xn,
1592
- qn
1593
- ]
1594
- }), Nn = On, Ge = new RegExp(
1595
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
1596
- ), He = new RegExp(
1597
- "^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
1598
- );
1599
- function Rn(e) {
1600
- return e === null ? !1 : Ge.exec(e) !== null || He.exec(e) !== null;
1601
- }
1602
- function Ln(e) {
1603
- var t, r, i, n, a, o, s, c = 0, u = null, p, l, d;
1604
- if (t = Ge.exec(e), t === null && (t = He.exec(e)), t === null) throw new Error("Date resolve error");
1605
- if (r = +t[1], i = +t[2] - 1, n = +t[3], !t[4])
1606
- return new Date(Date.UTC(r, i, n));
1607
- if (a = +t[4], o = +t[5], s = +t[6], t[7]) {
1608
- for (c = t[7].slice(0, 3); c.length < 3; )
1609
- c += "0";
1610
- c = +c;
1611
- }
1612
- return t[9] && (p = +t[10], l = +(t[11] || 0), u = (p * 60 + l) * 6e4, t[9] === "-" && (u = -u)), d = new Date(Date.UTC(r, i, n, a, o, s, c)), u && d.setTime(d.getTime() - u), d;
1613
- }
1614
- function Dn(e) {
1615
- return e.toISOString();
1616
- }
1617
- var jn = new _("tag:yaml.org,2002:timestamp", {
1618
- kind: "scalar",
1619
- resolve: Rn,
1620
- construct: Ln,
1621
- instanceOf: Date,
1622
- represent: Dn
1623
- });
1624
- function $n(e) {
1625
- return e === "<<" || e === null;
1626
- }
1627
- var Pn = new _("tag:yaml.org,2002:merge", {
1628
- kind: "scalar",
1629
- resolve: $n
1630
- }), de = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
1631
- \r`;
1632
- function Fn(e) {
1633
- if (e === null) return !1;
1634
- var t, r, i = 0, n = e.length, a = de;
1635
- for (r = 0; r < n; r++)
1636
- if (t = a.indexOf(e.charAt(r)), !(t > 64)) {
1637
- if (t < 0) return !1;
1638
- i += 6;
1639
- }
1640
- return i % 8 === 0;
1641
- }
1642
- function Un(e) {
1643
- var t, r, i = e.replace(/[\r\n=]/g, ""), n = i.length, a = de, o = 0, s = [];
1644
- for (t = 0; t < n; t++)
1645
- t % 4 === 0 && t && (s.push(o >> 16 & 255), s.push(o >> 8 & 255), s.push(o & 255)), o = o << 6 | a.indexOf(i.charAt(t));
1646
- return r = n % 4 * 6, r === 0 ? (s.push(o >> 16 & 255), s.push(o >> 8 & 255), s.push(o & 255)) : r === 18 ? (s.push(o >> 10 & 255), s.push(o >> 2 & 255)) : r === 12 && s.push(o >> 4 & 255), new Uint8Array(s);
1647
- }
1648
- function zn(e) {
1649
- var t = "", r = 0, i, n, a = e.length, o = de;
1650
- for (i = 0; i < a; i++)
1651
- i % 3 === 0 && i && (t += o[r >> 18 & 63], t += o[r >> 12 & 63], t += o[r >> 6 & 63], t += o[r & 63]), r = (r << 8) + e[i];
1652
- return n = a % 3, n === 0 ? (t += o[r >> 18 & 63], t += o[r >> 12 & 63], t += o[r >> 6 & 63], t += o[r & 63]) : n === 2 ? (t += o[r >> 10 & 63], t += o[r >> 4 & 63], t += o[r << 2 & 63], t += o[64]) : n === 1 && (t += o[r >> 2 & 63], t += o[r << 4 & 63], t += o[64], t += o[64]), t;
1653
- }
1654
- function Kn(e) {
1655
- return Object.prototype.toString.call(e) === "[object Uint8Array]";
1656
- }
1657
- var Vn = new _("tag:yaml.org,2002:binary", {
1658
- kind: "scalar",
1659
- resolve: Fn,
1660
- construct: Un,
1661
- predicate: Kn,
1662
- represent: zn
1663
- }), Mn = Object.prototype.hasOwnProperty, Bn = Object.prototype.toString;
1664
- function Gn(e) {
1665
- if (e === null) return !0;
1666
- var t = [], r, i, n, a, o, s = e;
1667
- for (r = 0, i = s.length; r < i; r += 1) {
1668
- if (n = s[r], o = !1, Bn.call(n) !== "[object Object]") return !1;
1669
- for (a in n)
1670
- if (Mn.call(n, a))
1671
- if (!o) o = !0;
1672
- else return !1;
1673
- if (!o) return !1;
1674
- if (t.indexOf(a) === -1) t.push(a);
1675
- else return !1;
1676
- }
1677
- return !0;
1678
- }
1679
- function Hn(e) {
1680
- return e !== null ? e : [];
1681
- }
1682
- var Yn = new _("tag:yaml.org,2002:omap", {
1683
- kind: "sequence",
1684
- resolve: Gn,
1685
- construct: Hn
1686
- }), Zn = Object.prototype.toString;
1687
- function Qn(e) {
1688
- if (e === null) return !0;
1689
- var t, r, i, n, a, o = e;
1690
- for (a = new Array(o.length), t = 0, r = o.length; t < r; t += 1) {
1691
- if (i = o[t], Zn.call(i) !== "[object Object]" || (n = Object.keys(i), n.length !== 1)) return !1;
1692
- a[t] = [n[0], i[n[0]]];
1693
- }
1694
- return !0;
1695
- }
1696
- function Wn(e) {
1697
- if (e === null) return [];
1698
- var t, r, i, n, a, o = e;
1699
- for (a = new Array(o.length), t = 0, r = o.length; t < r; t += 1)
1700
- i = o[t], n = Object.keys(i), a[t] = [n[0], i[n[0]]];
1701
- return a;
1702
- }
1703
- var Jn = new _("tag:yaml.org,2002:pairs", {
1704
- kind: "sequence",
1705
- resolve: Qn,
1706
- construct: Wn
1707
- }), Xn = Object.prototype.hasOwnProperty;
1708
- function ei(e) {
1709
- if (e === null) return !0;
1710
- var t, r = e;
1711
- for (t in r)
1712
- if (Xn.call(r, t) && r[t] !== null)
1713
- return !1;
1714
- return !0;
1715
- }
1716
- function ti(e) {
1717
- return e !== null ? e : {};
1718
- }
1719
- var ri = new _("tag:yaml.org,2002:set", {
1720
- kind: "mapping",
1721
- resolve: ei,
1722
- construct: ti
1723
- });
1724
- Nn.extend({
1725
- implicit: [
1726
- jn,
1727
- Pn
1728
- ],
1729
- explicit: [
1730
- Vn,
1731
- Yn,
1732
- Jn,
1733
- ri
1734
- ]
1735
- });
1736
- function ke(e) {
1737
- return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
1738
- ` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "…" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
1739
- }
1740
- var ni = new Array(256), ii = new Array(256);
1741
- for (var P = 0; P < 256; P++)
1742
- ni[P] = ke(P) ? 1 : 0, ii[P] = ke(P);
1743
- const Te = "24px", ai = (e, t) => {
1744
- const r = e.__vccOpts || e;
1745
- for (const [i, n] of t)
1746
- r[i] = n;
1747
- return r;
1748
- }, oi = (e) => (Xe("data-v-cd88dfcc"), e = e(), et(), e), si = ["aria-hidden"], li = {
1749
- key: 0,
1750
- "data-testid": "kui-icon-svg-title"
1751
- }, ci = /* @__PURE__ */ oi(() => /* @__PURE__ */ K("path", {
1752
- d: "M5 22C4.45 22 3.97917 21.8042 3.5875 21.4125C3.19583 21.0208 3 20.55 3 20V6H5V20H16V22H5ZM9 18C8.45 18 7.97917 17.8042 7.5875 17.4125C7.19583 17.0208 7 16.55 7 16V4C7 3.45 7.19583 2.97917 7.5875 2.5875C7.97917 2.19583 8.45 2 9 2H18C18.55 2 19.0208 2.19583 19.4125 2.5875C19.8042 2.97917 20 3.45 20 4V16C20 16.55 19.8042 17.0208 19.4125 17.4125C19.0208 17.8042 18.55 18 18 18H9ZM9 16H18V4H9V16Z",
1753
- fill: "currentColor"
1754
- }, null, -1)), ui = /* @__PURE__ */ O({
1755
- __name: "CopyIcon",
1756
- props: {
1757
- /** The accessibility text provided to screen readers */
1758
- title: {
1759
- type: String,
1760
- required: !1,
1761
- default: ""
1762
- },
1763
- /** The icon color. Defaults to `currentColor` which inherits text color from the parent element */
1764
- color: {
1765
- type: String,
1766
- required: !1,
1767
- default: "currentColor"
1768
- },
1769
- /** The CSS display property for the icon. Defaults to `block` */
1770
- display: {
1771
- type: String,
1772
- required: !1,
1773
- default: "block"
1774
- },
1775
- /** Whether the icon is just eye-candy or is meaningful to the page (should screen-readers ignore the icon?) */
1776
- decorative: {
1777
- type: Boolean,
1778
- required: !1,
1779
- default: !1
1780
- },
1781
- /** The icon size */
1782
- size: {
1783
- type: [Number, String],
1784
- required: !1,
1785
- default: Te,
1786
- // if setting to the imported const fails, just pass a number of 24 as the default.
1787
- validator: (e) => {
1788
- if (typeof e == "number" && e > 0)
1789
- return !0;
1790
- if (typeof e == "string") {
1791
- const t = String(e).replace(/px/gi, ""), r = Number(t);
1792
- if (r && !isNaN(r) && Number.isInteger(r) && r > 0)
1793
- return !0;
1794
- }
1795
- return !1;
1796
- }
1797
- },
1798
- /** The HTML tag to utilize for the icon's wrapper element. Defaults to `span` */
1799
- as: {
1800
- type: String,
1801
- required: !1,
1802
- default: "span"
1803
- }
1804
- },
1805
- setup(e) {
1806
- const t = e, r = g(() => {
1807
- if (typeof t.size == "number" && t.size > 0)
1808
- return `${t.size}px`;
1809
- if (typeof t.size == "string") {
1810
- const n = String(t.size).replace(/px/gi, ""), a = Number(n);
1811
- if (a && !isNaN(a) && Number.isInteger(a) && a > 0)
1812
- return `${a}px`;
1813
- }
1814
- return Te;
1815
- }), i = g(() => ({
1816
- boxSizing: "border-box",
1817
- color: t.color,
1818
- display: t.display,
1819
- flexShrink: "0",
1820
- height: r.value,
1821
- lineHeight: "0",
1822
- width: r.value
1823
- }));
1824
- return (n, a) => (h(), E(Ce(e.as), {
1825
- "aria-hidden": e.decorative ? "true" : void 0,
1826
- class: "kui-icon copy-icon",
1827
- "data-testid": "kui-icon-wrapper-copy-icon",
1828
- style: te(i.value)
1829
- }, {
1830
- default: I(() => [
1831
- (h(), C("svg", {
1832
- "aria-hidden": e.decorative ? "true" : void 0,
1833
- "data-testid": "kui-icon-svg-copy-icon",
1834
- fill: "none",
1835
- height: "100%",
1836
- role: "img",
1837
- viewBox: "0 0 24 24",
1838
- width: "100%",
1839
- xmlns: "http://www.w3.org/2000/svg"
1840
- }, [
1841
- e.title ? (h(), C("title", li, z(e.title), 1)) : B("", !0),
1842
- ci
1843
- ], 8, si))
1844
- ]),
1845
- _: 1
1846
- }, 8, ["aria-hidden", "style"]));
1847
- }
1848
- }), pi = /* @__PURE__ */ ai(ui, [["__scopeId", "data-v-cd88dfcc"]]), di = [];
1849
- for (let e = 0; e < 256; ++e)
1850
- di.push((e + 256).toString(16).slice(1));
1851
- typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1852
- const yi = {
1853
- class: "kong-ui-public-entity-link",
1854
- "data-testid": "entity-link-parent"
1855
- }, fi = {
1856
- key: 0,
1857
- class: "deleted-entity"
1858
- }, hi = { key: 1 }, mi = ["onClick"], gi = /* @__PURE__ */ O({
1859
- __name: "EntityLink",
1860
- props: {
1861
- entityLinkData: {
1862
- type: Object,
1863
- required: !0
1864
- },
1865
- externalLink: {
1866
- type: String,
1867
- required: !1,
1868
- default: ""
1869
- },
1870
- newWindow: {
1871
- type: Boolean,
1872
- required: !1,
1873
- default: !1
1874
- },
1875
- allowCopy: {
1876
- type: Boolean,
1877
- required: !1,
1878
- default: !1
1879
- }
1880
- },
1881
- setup(e) {
1882
- const t = e, r = v(), { isTruncated: i } = Se.useTruncationDetector(r), { i18n: { t: n } } = Se.useI18n(), a = n("global.actions.copyId"), o = v(a), s = g(() => t.entityLinkData.deleted ?? !1), c = g(() => {
1883
- var l;
1884
- return (l = t.entityLinkData.id) != null && l.toString().includes(":") ? t.entityLinkData.id.toString().split(":")[1] : t.entityLinkData.id;
1885
- }), u = g(() => {
1886
- var l;
1887
- return `${(l = c.value) == null ? void 0 : l.toString().slice(0, 5)} (deleted)`;
1888
- }), p = async (l) => {
1889
- await l(c.value || "") && (o.value = n("global.actions.copyToClipboard"), setTimeout(() => {
1890
- o.value = a;
1891
- }, 1800));
1892
- };
1893
- return (l, d) => {
1894
- const y = U("KTooltip"), b = U("KExternalLink"), S = U("KClipboardProvider");
1895
- return h(), C("div", yi, [
1896
- s.value ? (h(), C("div", fi, z(u.value), 1)) : c.value ? c.value ? (h(), E(b, {
1897
- key: 2,
1898
- class: "entity-link",
1899
- "hide-icon": !e.newWindow,
1900
- href: e.externalLink,
1901
- target: e.newWindow ? "_blank" : "_self"
1902
- }, {
1903
- default: I(() => [
1904
- R(y, {
1905
- text: m(i) && e.entityLinkData.label || ""
1906
- }, {
1907
- default: I(() => [
1908
- K("span", {
1909
- ref_key: "textContent",
1910
- ref: r,
1911
- class: "entity-link-label"
1912
- }, z(e.entityLinkData.label), 513)
1913
- ]),
1914
- _: 1
1915
- }, 8, ["text"])
1916
- ]),
1917
- _: 1
1918
- }, 8, ["hide-icon", "href", "target"])) : B("", !0) : (h(), C("div", hi, z(" – "))),
1919
- c.value && e.allowCopy ? (h(), E(y, {
1920
- key: o.value,
1921
- class: "copy-uuid-tooltip",
1922
- "max-width": "160",
1923
- placement: "bottom-end",
1924
- text: o.value
1925
- }, {
1926
- default: I(() => [
1927
- R(S, null, {
1928
- default: I(({ copyToClipboard: V }) => [
1929
- K("span", {
1930
- class: "entity-link-copy-id",
1931
- onClick: Qe((N) => p(V), ["stop"])
1932
- }, [
1933
- R(m(pi), {
1934
- class: "copy-icon",
1935
- color: m(Fr),
1936
- "data-testid": "copy-id",
1937
- size: m(Ur)
1938
- }, null, 8, ["color", "size"])
1939
- ], 8, mi)
1940
- ]),
1941
- _: 1
1942
- })
1943
- ]),
1944
- _: 1
1945
- }, 8, ["text"])) : B("", !0)
1946
- ]);
1947
- };
1948
- }
1949
- }), vi = /* @__PURE__ */ Pr(gi, [["__scopeId", "data-v-60e3ef7c"]]), bi = /* @__PURE__ */ O({
724
+ }), Et = /* @__PURE__ */ R(At, [["__scopeId", "data-v-7d1a3f03"]]), ae = "20px", Dt = /* @__PURE__ */ _({
1950
725
  __name: "TopNTableRenderer",
1951
726
  props: {
1952
727
  query: {},
@@ -1955,39 +730,39 @@ const yi = {
1955
730
  chartOptions: {},
1956
731
  height: {}
1957
732
  },
1958
- setup(e) {
1959
- const t = e, r = (i) => {
1960
- var n;
1961
- if ((n = t.chartOptions) != null && n.entityLink)
1962
- if (i.id.includes(":")) {
1963
- const [a, o] = i.id.split(":");
1964
- return t.chartOptions.entityLink.replace(qt, a).replace(fe, o);
733
+ setup(t) {
734
+ const r = t, o = (n) => {
735
+ var e;
736
+ if ((e = r.chartOptions) != null && e.entityLink)
737
+ if (n.id.includes(":")) {
738
+ const [i, a] = n.id.split(":");
739
+ return r.chartOptions.entityLink.replace(Ue, i).replace(U, a);
1965
740
  } else
1966
- return t.chartOptions.entityLink.replace(fe, i.id);
741
+ return r.chartOptions.entityLink.replace(U, n.id);
1967
742
  return "";
1968
743
  };
1969
- return (i, n) => (h(), E(J, {
1970
- context: i.context,
1971
- query: i.query,
1972
- "query-ready": i.queryReady
744
+ return (n, e) => (l(), f(N, {
745
+ context: n.context,
746
+ query: n.query,
747
+ "query-ready": n.queryReady
1973
748
  }, {
1974
- default: I(({ data: a }) => [
1975
- R(m(ut), {
1976
- data: a,
1977
- description: i.chartOptions.description,
1978
- "synthetics-data-key": i.chartOptions.syntheticsDataKey,
1979
- title: i.chartOptions.chartTitle || ""
1980
- }, tt({ _: 2 }, [
1981
- t.chartOptions.entityLink ? {
749
+ default: v(({ data: i }) => [
750
+ T(p(Te), {
751
+ data: i,
752
+ description: n.chartOptions.description,
753
+ "synthetics-data-key": n.chartOptions.syntheticsDataKey,
754
+ title: n.chartOptions.chartTitle || ""
755
+ }, ye({ _: 2 }, [
756
+ r.chartOptions.entityLink ? {
1982
757
  name: "name",
1983
- fn: I(({ record: o }) => [
1984
- R(m(vi), {
758
+ fn: v(({ record: a }) => [
759
+ T(p(He), {
1985
760
  "entity-link-data": {
1986
- id: o.id,
1987
- label: o.name,
1988
- deleted: o.deleted
761
+ id: a.id,
762
+ label: a.name,
763
+ deleted: a.deleted
1989
764
  },
1990
- "external-link": r(o)
765
+ "external-link": o(a)
1991
766
  }, null, 8, ["entity-link-data", "external-link"])
1992
767
  ]),
1993
768
  key: "0"
@@ -1997,54 +772,54 @@ const yi = {
1997
772
  _: 1
1998
773
  }, 8, ["context", "query", "query-ready"]));
1999
774
  }
2000
- }), wi = { class: "tile-boundary" }, _i = /* @__PURE__ */ O({
775
+ }), Ct = { class: "tile-boundary" }, It = /* @__PURE__ */ _({
2001
776
  __name: "DashboardTile",
2002
777
  props: {
2003
778
  definition: {},
2004
779
  context: {},
2005
- height: { default: Q },
780
+ height: { default: P },
2006
781
  queryReady: { type: Boolean }
2007
782
  },
2008
- setup(e) {
2009
- H((a) => ({
2010
- 58871060: `${a.height}px`
783
+ setup(t) {
784
+ x((i) => ({
785
+ 58871060: `${i.height}px`
2011
786
  }));
2012
- const t = parseInt(Pe, 10), r = e, i = {
2013
- [A.TimeseriesLine]: sr,
2014
- [A.HorizontalBar]: he,
2015
- [A.VerticalBar]: he,
2016
- [A.Gauge]: rr,
2017
- [A.GoldenSignals]: ur,
2018
- [A.TopN]: bi,
2019
- [A.Slottable]: void 0
2020
- }, n = g(() => {
2021
- const a = i[r.definition.chart.type];
2022
- return a && {
2023
- component: a,
787
+ const r = parseInt(ae, 10), o = t, n = {
788
+ [y.TimeseriesLine]: Tt,
789
+ [y.HorizontalBar]: M,
790
+ [y.VerticalBar]: M,
791
+ [y.Gauge]: vt,
792
+ [y.GoldenSignals]: Et,
793
+ [y.TopN]: Dt,
794
+ [y.Slottable]: void 0
795
+ }, e = d(() => {
796
+ const i = n[o.definition.chart.type];
797
+ return i && {
798
+ component: i,
2024
799
  rendererProps: {
2025
- query: r.definition.query,
2026
- context: r.context,
2027
- queryReady: r.queryReady,
2028
- chartOptions: r.definition.chart,
2029
- height: r.height - t * 2
800
+ query: o.definition.query,
801
+ context: o.context,
802
+ queryReady: o.queryReady,
803
+ chartOptions: o.definition.chart,
804
+ height: o.height - r * 2
2030
805
  }
2031
806
  };
2032
807
  });
2033
- return (a, o) => (h(), C("div", wi, [
2034
- n.value ? (h(), E(Ce(n.value.component), Ee(rt({ key: 0 }, n.value.rendererProps)), null, 16)) : B("", !0)
808
+ return (i, a) => (l(), S("div", Ct, [
809
+ e.value ? (l(), f(me(e.value.component), X(he({ key: 0 }, e.value.rendererProps)), null, 16)) : Y("", !0)
2035
810
  ]));
2036
811
  }
2037
- }), Si = /* @__PURE__ */ $(_i, [["__scopeId", "data-v-69b5e552"]]), xi = (e, t, r) => {
2038
- const i = /* @__PURE__ */ new Map();
2039
- r.forEach((a) => {
2040
- const o = a.layout.position.row, s = i.get(o), c = a.layout.size.rows === 1 && !!a.layout.size.fitToContent;
2041
- s === void 0 ? i.set(o, c) : i.set(o, s && c);
812
+ }), xt = /* @__PURE__ */ R(It, [["__scopeId", "data-v-69b5e552"]]), Ot = (t, r, o) => {
813
+ const n = /* @__PURE__ */ new Map();
814
+ o.forEach((i) => {
815
+ const a = i.layout.position.row, s = n.get(a), m = i.layout.size.rows === 1 && !!i.layout.size.fitToContent;
816
+ s === void 0 ? n.set(a, m) : n.set(a, s && m);
2042
817
  });
2043
- const n = [];
2044
- for (let a = 0; a < e; a++)
2045
- i.get(a) ? n.push("auto") : n.push(`${t}px`);
2046
- return n;
2047
- }, ki = /* @__PURE__ */ O({
818
+ const e = [];
819
+ for (let i = 0; i < t; i++)
820
+ n.get(i) ? e.push("auto") : e.push(`${r}px`);
821
+ return e;
822
+ }, kt = /* @__PURE__ */ _({
2048
823
  __name: "GridLayout",
2049
824
  props: {
2050
825
  gridSize: {
@@ -2054,33 +829,33 @@ const yi = {
2054
829
  tileHeight: {
2055
830
  type: Number,
2056
831
  required: !1,
2057
- default: () => Q
832
+ default: () => P
2058
833
  },
2059
834
  tiles: {
2060
835
  type: Array,
2061
836
  required: !0
2062
837
  }
2063
838
  },
2064
- setup(e) {
2065
- H((s) => ({
2066
- cfb759a4: e.gridSize.cols,
2067
- "208951e1": a.value
839
+ setup(t) {
840
+ x((s) => ({
841
+ cfb759a4: t.gridSize.cols,
842
+ "208951e1": i.value
2068
843
  }));
2069
- const t = e, r = v(null), i = v(0), n = new ResizeObserver((s) => {
844
+ const r = t, o = I(null), n = I(0), e = new ResizeObserver((s) => {
2070
845
  window.requestAnimationFrame(() => {
2071
- !Array.isArray(s) || !s.length || (i.value = s[0].contentRect.width);
846
+ !Array.isArray(s) || !s.length || (n.value = s[0].contentRect.width);
2072
847
  });
2073
848
  });
2074
- nt(() => {
2075
- r.value && n.observe(r.value);
2076
- }), Ie(() => {
2077
- r.value && n.unobserve(r.value);
849
+ ge(() => {
850
+ o.value && e.observe(o.value);
851
+ }), Z(() => {
852
+ o.value && e.unobserve(o.value);
2078
853
  });
2079
- const a = g(() => {
2080
- var c;
2081
- return xi((c = t.gridSize) == null ? void 0 : c.rows, t.tileHeight, t.tiles).join(" ");
2082
- }), o = g(() => t.tiles.map((s, c) => ({
2083
- key: `tile-${c}`,
854
+ const i = d(() => {
855
+ var m;
856
+ return Ot((m = r.gridSize) == null ? void 0 : m.rows, r.tileHeight, r.tiles).join(" ");
857
+ }), a = d(() => r.tiles.map((s, m) => ({
858
+ key: `tile-${m}`,
2084
859
  tile: s,
2085
860
  style: {
2086
861
  "grid-column-start": s.layout.position.col + 1,
@@ -2089,128 +864,128 @@ const yi = {
2089
864
  "grid-row-end": s.layout.position.row + 1 + s.layout.size.rows
2090
865
  }
2091
866
  })));
2092
- return (s, c) => (h(), C("div", {
867
+ return (s, m) => (l(), S("div", {
2093
868
  ref_key: "gridContainer",
2094
- ref: r,
869
+ ref: o,
2095
870
  class: "kong-ui-public-grid-layout"
2096
871
  }, [
2097
- (h(!0), C(it, null, at(o.value, (u) => (h(), C("div", {
2098
- key: u.key,
2099
- class: ot(["grid-cell", {
2100
- "empty-cell": !u.tile
872
+ (l(!0), S(fe, null, ve(a.value, (c) => (l(), S("div", {
873
+ key: c.key,
874
+ class: _e(["grid-cell", {
875
+ "empty-cell": !c.tile
2101
876
  }]),
2102
- style: te(u.style)
877
+ style: K(c.style)
2103
878
  }, [
2104
- ae(s.$slots, "tile", {
2105
- style: te(u.style),
2106
- tile: u.tile
879
+ V(s.$slots, "tile", {
880
+ style: K(c.style),
881
+ tile: c.tile
2107
882
  }, void 0, !0)
2108
883
  ], 6))), 128))
2109
884
  ], 512));
2110
885
  }
2111
- }), Ti = /* @__PURE__ */ $(ki, [["__scopeId", "data-v-056142a9"]]), Ii = { class: "kong-ui-public-dashboard-renderer" }, Ai = {
886
+ }), wt = /* @__PURE__ */ R(kt, [["__scopeId", "data-v-056142a9"]]), Pt = { class: "kong-ui-public-dashboard-renderer" }, Lt = {
2112
887
  key: 0,
2113
888
  class: "tile-container"
2114
- }, Ei = /* @__PURE__ */ O({
889
+ }, Nt = /* @__PURE__ */ _({
2115
890
  __name: "DashboardRenderer",
2116
891
  props: {
2117
892
  context: {},
2118
893
  config: {}
2119
894
  },
2120
- setup(e) {
2121
- const t = e, { i18n: r } = $e.useI18n(), i = ie(Re);
2122
- i || (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/dashboard-renderer/README.md#requirements"));
2123
- const n = Ct(), a = g(() => t.context.timeSpec ? t.context.timeSpec : {
895
+ setup(t) {
896
+ const r = t, { i18n: o } = ne.useI18n(), n = Q(te);
897
+ n || (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/dashboard-renderer/README.md#requirements"));
898
+ const e = Ke(), i = d(() => r.context.timeSpec ? r.context.timeSpec : {
2124
899
  type: "relative",
2125
- time_range: n.defaultQueryTimeForOrg
2126
- }), o = g(() => !!t.context.timeSpec || !n.loading), s = g(() => t.config.tiles.map((u, p) => {
2127
- var d;
2128
- let l = u.definition;
2129
- if ("description" in l.chart) {
2130
- const y = (d = l.chart.description) == null ? void 0 : d.replace(Ot, () => {
2131
- const S = `renderer.trendRange.${a.value.type === "absolute" ? "custom" : a.value.time_range}`;
2132
- return r.te(S) ? r.t(S) : "";
900
+ time_range: e.defaultQueryTimeForOrg
901
+ }), a = d(() => !!r.context.timeSpec || !e.loading), s = d(() => r.config.tiles.map((c, b) => {
902
+ var g;
903
+ let h = c.definition;
904
+ if ("description" in h.chart) {
905
+ const k = (g = h.chart.description) == null ? void 0 : g.replace(Me, () => {
906
+ const C = `renderer.trendRange.${i.value.type === "absolute" ? "custom" : i.value.time_range}`;
907
+ return o.te(C) ? o.t(C) : "";
2133
908
  });
2134
- l = {
2135
- ...l,
909
+ h = {
910
+ ...h,
2136
911
  chart: {
2137
- ...l.chart,
2138
- description: y
912
+ ...h.chart,
913
+ description: k
2139
914
  }
2140
915
  };
2141
916
  }
2142
917
  return {
2143
- layout: u.layout,
2144
- meta: l,
918
+ layout: c.layout,
919
+ meta: h,
2145
920
  // Add a unique key to each tile internally.
2146
- id: p
921
+ id: b
2147
922
  };
2148
- })), c = g(() => {
2149
- let { tz: u, refreshInterval: p } = t.context;
2150
- return u || (u = new Intl.DateTimeFormat().resolvedOptions().timeZone), p === void 0 && (p = Nt), {
2151
- ...t.context,
2152
- tz: u,
2153
- timeSpec: a.value,
2154
- refreshInterval: p
923
+ })), m = d(() => {
924
+ let { tz: c, refreshInterval: b } = r.context;
925
+ return c || (c = new Intl.DateTimeFormat().resolvedOptions().timeZone), b === void 0 && (b = Qe), {
926
+ ...r.context,
927
+ tz: c,
928
+ timeSpec: i.value,
929
+ refreshInterval: b
2155
930
  };
2156
931
  });
2157
- return (u, p) => {
2158
- const l = U("KAlert");
2159
- return h(), C("div", Ii, [
2160
- m(i) ? (h(), E(Ti, {
932
+ return (c, b) => {
933
+ const h = z("KAlert");
934
+ return l(), S("div", Pt, [
935
+ p(n) ? (l(), f(wt, {
2161
936
  key: 1,
2162
- "grid-size": u.config.gridSize,
2163
- "tile-height": u.config.tileHeight,
937
+ "grid-size": c.config.gridSize,
938
+ "tile-height": c.config.tileHeight,
2164
939
  tiles: s.value
2165
940
  }, {
2166
- tile: I(({ tile: d }) => [
2167
- d.meta.chart.type === m(A).Slottable ? (h(), C("div", Ai, [
2168
- ae(u.$slots, d.meta.chart.id, {}, void 0, !0)
2169
- ])) : (h(), E(Si, {
941
+ tile: v(({ tile: g }) => [
942
+ g.meta.chart.type === p(y).Slottable ? (l(), S("div", Lt, [
943
+ V(c.$slots, g.meta.chart.id, {}, void 0, !0)
944
+ ])) : (l(), f(xt, {
2170
945
  key: 1,
2171
946
  class: "tile-container",
2172
- context: c.value,
2173
- definition: d.meta,
2174
- height: d.layout.size.rows * (u.config.tileHeight || m(Q)) + parseInt(m(Pe), 10),
2175
- "query-ready": o.value
947
+ context: m.value,
948
+ definition: g.meta,
949
+ height: g.layout.size.rows * (c.config.tileHeight || p(P)) + parseInt(p(ae), 10),
950
+ "query-ready": a.value
2176
951
  }, null, 8, ["context", "definition", "height", "query-ready"]))
2177
952
  ]),
2178
953
  _: 3
2179
- }, 8, ["grid-size", "tile-height", "tiles"])) : (h(), E(l, {
954
+ }, 8, ["grid-size", "tile-height", "tiles"])) : (l(), f(h, {
2180
955
  key: 0,
2181
956
  appearance: "danger"
2182
957
  }, {
2183
- default: I(() => [
2184
- Ae(z(m(r).t("renderer.noQueryBridge")), 1)
958
+ default: v(() => [
959
+ J(W(p(o).t("renderer.noQueryBridge")), 1)
2185
960
  ]),
2186
961
  _: 1
2187
962
  }))
2188
963
  ]);
2189
964
  };
2190
965
  }
2191
- }), Ui = /* @__PURE__ */ $(Ei, [["__scopeId", "data-v-2dd03268"]]);
966
+ }), Mt = /* @__PURE__ */ R(Nt, [["__scopeId", "data-v-2dd03268"]]);
2192
967
  export {
2193
- qt as CP_ID_TOKEN,
2194
- A as ChartTypes,
2195
- Q as DEFAULT_TILE_HEIGHT,
2196
- Nt as DEFAULT_TILE_REFRESH_INTERVAL_MS,
2197
- Ui as DashboardRenderer,
2198
- fe as ENTITY_ID_TOKEN,
2199
- Ti as GridLayout,
2200
- Re as INJECT_QUERY_PROVIDER,
2201
- Ot as TIMEFRAME_TOKEN,
2202
- Vt as aiQuerySchema,
2203
- Lt as barChartSchema,
2204
- Kt as basicQuerySchema,
2205
- Fi as dashboardConfigSchema,
2206
- zt as exploreV4QuerySchema,
2207
- jt as gaugeChartSchema,
2208
- Pt as metricCardSchema,
2209
- Rt as slottableSchema,
2210
- Ht as tileConfigSchema,
2211
- Bt as tileDefinitionSchema,
2212
- Gt as tileLayoutSchema,
2213
- Dt as timeseriesChartSchema,
2214
- $t as topNTableSchema,
2215
- Mt as validDashboardQuery
968
+ Ue as CP_ID_TOKEN,
969
+ y as ChartTypes,
970
+ P as DEFAULT_TILE_HEIGHT,
971
+ Qe as DEFAULT_TILE_REFRESH_INTERVAL_MS,
972
+ Mt as DashboardRenderer,
973
+ U as ENTITY_ID_TOKEN,
974
+ wt as GridLayout,
975
+ te as INJECT_QUERY_PROVIDER,
976
+ Me as TIMEFRAME_TOKEN,
977
+ nt as aiQuerySchema,
978
+ Je as barChartSchema,
979
+ it as basicQuerySchema,
980
+ Ut as dashboardConfigSchema,
981
+ ot as exploreV4QuerySchema,
982
+ Ye as gaugeChartSchema,
983
+ et as metricCardSchema,
984
+ Ze as slottableSchema,
985
+ lt as tileConfigSchema,
986
+ st as tileDefinitionSchema,
987
+ ct as tileLayoutSchema,
988
+ We as timeseriesChartSchema,
989
+ Xe as topNTableSchema,
990
+ at as validDashboardQuery
2216
991
  };