@kong-ui-public/analytics-utilities 5.6.0 → 5.7.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,8 +1,8 @@
1
- var Fe = Object.defineProperty;
2
- var Ce = (t, e, n) => e in t ? Fe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var g = (t, e, n) => Ce(t, typeof e != "symbol" ? e + "" : e, n);
1
+ var He = Object.defineProperty;
2
+ var Fe = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var h = (e, t, n) => Fe(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  const Vn = 3e4;
5
- var m = /* @__PURE__ */ ((t) => (t.FIFTEEN_MIN = "15m", t.ONE_HOUR = "1h", t.SIX_HOUR = "6h", t.TWELVE_HOUR = "12h", t.ONE_DAY = "24h", t.SEVEN_DAY = "7d", t.THIRTY_DAY = "30d", t.CURRENT_WEEK = "current_week", t.CURRENT_MONTH = "current_month", t.CURRENT_QUARTER = "current_quarter", t.PREVIOUS_WEEK = "previous_week", t.PREVIOUS_MONTH = "previous_month", t.PREVIOUS_QUARTER = "previous_quarter", t))(m || {});
5
+ var m = /* @__PURE__ */ ((e) => (e.FIFTEEN_MIN = "15m", e.ONE_HOUR = "1h", e.SIX_HOUR = "6h", e.TWELVE_HOUR = "12h", e.ONE_DAY = "24h", e.SEVEN_DAY = "7d", e.THIRTY_DAY = "30d", e.CURRENT_WEEK = "current_week", e.CURRENT_MONTH = "current_month", e.CURRENT_QUARTER = "current_quarter", e.PREVIOUS_WEEK = "previous_week", e.PREVIOUS_MONTH = "previous_month", e.PREVIOUS_QUARTER = "previous_quarter", e))(m || {});
6
6
  const jn = [
7
7
  "horizontal_bar",
8
8
  "vertical_bar",
@@ -21,14 +21,21 @@ const jn = [
21
21
  "30d",
22
22
  "current_month",
23
23
  "previous_month"
24
- ], He = [
24
+ ], Ce = [
25
25
  "secondly",
26
+ "tenSecondly",
27
+ "thirtySecondly",
26
28
  "minutely",
29
+ "fiveMinutely",
30
+ "tenMinutely",
31
+ "thirtyMinutely",
27
32
  "hourly",
33
+ "twoHourly",
34
+ "twelveHourly",
28
35
  "daily",
29
36
  "weekly",
30
37
  "trend"
31
- ], I = (t) => t.filter((e) => e !== "time"), be = [
38
+ ], I = (e) => e.filter((t) => t !== "time"), be = [
32
39
  "api_product",
33
40
  "api_product_version",
34
41
  "control_plane",
@@ -39,18 +46,18 @@ const jn = [
39
46
  "status_code",
40
47
  "status_code_grouped",
41
48
  "time"
42
- ], Le = I(be), qe = [
49
+ ], Ge = I(be), Le = [
43
50
  "active_services",
44
51
  "request_count",
45
52
  "request_per_minute",
46
53
  "response_latency_average"
47
- ], Ue = [
54
+ ], qe = [
48
55
  ...be,
49
56
  "application",
50
57
  "consumer",
51
58
  "iso_code"
52
- ], ze = I(Ue), nr = [
53
- ...qe,
59
+ ], Ue = I(qe), nr = [
60
+ ...Le,
54
61
  "response_latency_p99",
55
62
  "response_latency_p95",
56
63
  "response_latency_p50",
@@ -70,7 +77,7 @@ const jn = [
70
77
  "request_size_p50",
71
78
  "request_size_average",
72
79
  "response_size_average"
73
- ], Ge = [
80
+ ], ze = [
74
81
  "control_plane",
75
82
  "control_plane_group",
76
83
  "gateway_service",
@@ -84,7 +91,7 @@ const jn = [
84
91
  "llm_embeddings_provider",
85
92
  "llm_embeddings_model",
86
93
  "time"
87
- ], Ae = I(Ge), rr = [
94
+ ], Ae = I(ze), rr = [
88
95
  "total_tokens",
89
96
  "prompt_tokens",
90
97
  "completion_tokens",
@@ -142,7 +149,7 @@ const jn = [
142
149
  "service_protocol",
143
150
  "trace_id",
144
151
  "upstream_uri"
145
- ], sr = $e, Ve = [
152
+ ], ir = $e, Ve = [
146
153
  "ai_count",
147
154
  "latencies_response_ms",
148
155
  "latencies_upstream_ms",
@@ -152,7 +159,7 @@ const jn = [
152
159
  "response_header_content_length",
153
160
  "status_code",
154
161
  "upstream_status_code"
155
- ], ir = I(Ve), or = [
162
+ ], sr = I(Ve), or = [
156
163
  "15M",
157
164
  "1H",
158
165
  "6H",
@@ -160,29 +167,29 @@ const jn = [
160
167
  "24H",
161
168
  "7D"
162
169
  ], ur = ["basic", "advanced", "ai"], je = {
163
- basic: new Set(Le),
164
- advanced: new Set(ze),
170
+ basic: new Set(Ge),
171
+ advanced: new Set(Ue),
165
172
  ai: new Set(Ae)
166
- }, cr = (t, e) => e.filter((n) => je[t].has(n.dimension)), pe = 6048e5, Ze = 864e5, Qe = 60, Be = 3600, te = Symbol.for("constructDateFrom");
167
- function D(t, e) {
168
- return typeof t == "function" ? t(e) : t && typeof t == "object" && te in t ? t[te](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
169
- }
170
- function h(t, e) {
171
- return D(e || t, t);
172
- }
173
- function ne(t, e, n) {
174
- const r = h(t, n == null ? void 0 : n.in);
175
- return isNaN(e) ? D(t, NaN) : (r.setDate(r.getDate() + e), r);
176
- }
177
- function Je(t, e, n) {
178
- const r = h(t, n == null ? void 0 : n.in);
179
- if (isNaN(e)) return D(t, NaN);
180
- const a = r.getDate(), s = D(t, r.getTime());
181
- s.setMonth(r.getMonth() + e + 1, 0);
182
- const i = s.getDate();
183
- return a >= i ? s : (r.setFullYear(
184
- s.getFullYear(),
185
- s.getMonth(),
173
+ }, cr = (e, t) => t.filter((n) => je[e].has(n.dimension)), Oe = 6048e5, Ze = 864e5, Qe = 60, Be = 3600, te = Symbol.for("constructDateFrom");
174
+ function D(e, t) {
175
+ return typeof e == "function" ? e(t) : e && typeof e == "object" && te in e ? e[te](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
176
+ }
177
+ function y(e, t) {
178
+ return D(t || e, e);
179
+ }
180
+ function ne(e, t, n) {
181
+ const r = y(e, n == null ? void 0 : n.in);
182
+ return isNaN(t) ? D(e, NaN) : (r.setDate(r.getDate() + t), r);
183
+ }
184
+ function Je(e, t, n) {
185
+ const r = y(e, n == null ? void 0 : n.in);
186
+ if (isNaN(t)) return D(e, NaN);
187
+ const a = r.getDate(), i = D(e, r.getTime());
188
+ i.setMonth(r.getMonth() + t + 1, 0);
189
+ const s = i.getDate();
190
+ return a >= s ? i : (r.setFullYear(
191
+ i.getFullYear(),
192
+ i.getMonth(),
186
193
  a
187
194
  ), r);
188
195
  }
@@ -190,74 +197,74 @@ let Ke = {};
190
197
  function W() {
191
198
  return Ke;
192
199
  }
193
- function O(t, e) {
200
+ function p(e, t) {
194
201
  var o, u, l, c;
195
- const n = W(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((u = (o = e == null ? void 0 : e.locale) == null ? void 0 : o.options) == null ? void 0 : u.weekStartsOn) ?? n.weekStartsOn ?? ((c = (l = n.locale) == null ? void 0 : l.options) == null ? void 0 : c.weekStartsOn) ?? 0, a = h(t, e == null ? void 0 : e.in), s = a.getDay(), i = (s < r ? 7 : 0) + s - r;
196
- return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a;
202
+ const n = W(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((u = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : u.weekStartsOn) ?? n.weekStartsOn ?? ((c = (l = n.locale) == null ? void 0 : l.options) == null ? void 0 : c.weekStartsOn) ?? 0, a = y(e, t == null ? void 0 : t.in), i = a.getDay(), s = (i < r ? 7 : 0) + i - r;
203
+ return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
197
204
  }
198
- function C(t, e) {
199
- return O(t, { ...e, weekStartsOn: 1 });
205
+ function F(e, t) {
206
+ return p(e, { ...t, weekStartsOn: 1 });
200
207
  }
201
- function Oe(t, e) {
202
- const n = h(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = D(n, 0);
208
+ function pe(e, t) {
209
+ const n = y(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = D(n, 0);
203
210
  a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
204
- const s = C(a), i = D(n, 0);
205
- i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
206
- const o = C(i);
207
- return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= o.getTime() ? r : r - 1;
211
+ const i = F(a), s = D(n, 0);
212
+ s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0);
213
+ const o = F(s);
214
+ return n.getTime() >= i.getTime() ? r + 1 : n.getTime() >= o.getTime() ? r : r - 1;
208
215
  }
209
- function re(t) {
210
- const e = h(t), n = new Date(
216
+ function re(e) {
217
+ const t = y(e), n = new Date(
211
218
  Date.UTC(
212
- e.getFullYear(),
213
- e.getMonth(),
214
- e.getDate(),
215
- e.getHours(),
216
- e.getMinutes(),
217
- e.getSeconds(),
218
- e.getMilliseconds()
219
+ t.getFullYear(),
220
+ t.getMonth(),
221
+ t.getDate(),
222
+ t.getHours(),
223
+ t.getMinutes(),
224
+ t.getSeconds(),
225
+ t.getMilliseconds()
219
226
  )
220
227
  );
221
- return n.setUTCFullYear(e.getFullYear()), +t - +n;
228
+ return n.setUTCFullYear(t.getFullYear()), +e - +n;
222
229
  }
223
- function et(t, ...e) {
230
+ function et(e, ...t) {
224
231
  const n = D.bind(
225
232
  null,
226
- e.find((r) => typeof r == "object")
233
+ t.find((r) => typeof r == "object")
227
234
  );
228
- return e.map(n);
235
+ return t.map(n);
229
236
  }
230
- function H(t, e) {
231
- const n = h(t, e == null ? void 0 : e.in);
237
+ function C(e, t) {
238
+ const n = y(e, t == null ? void 0 : t.in);
232
239
  return n.setHours(0, 0, 0, 0), n;
233
240
  }
234
- function tt(t, e, n) {
241
+ function tt(e, t, n) {
235
242
  const [r, a] = et(
236
243
  n == null ? void 0 : n.in,
237
- t,
238
- e
239
- ), s = H(r), i = H(a), o = +s - re(s), u = +i - re(i);
244
+ e,
245
+ t
246
+ ), i = C(r), s = C(a), o = +i - re(i), u = +s - re(s);
240
247
  return Math.round((o - u) / Ze);
241
248
  }
242
- function nt(t, e) {
243
- const n = Oe(t, e), r = D(t, 0);
244
- return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), C(r);
249
+ function nt(e, t) {
250
+ const n = pe(e, t), r = D(e, 0);
251
+ return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), F(r);
245
252
  }
246
- function rt(t) {
247
- return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
253
+ function rt(e) {
254
+ return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
248
255
  }
249
- function at(t) {
250
- return !(!rt(t) && typeof t != "number" || isNaN(+h(t)));
256
+ function at(e) {
257
+ return !(!rt(e) && typeof e != "number" || isNaN(+y(e)));
251
258
  }
252
- function E(t, e) {
253
- const n = h(t, e == null ? void 0 : e.in);
259
+ function E(e, t) {
260
+ const n = y(e, t == null ? void 0 : t.in);
254
261
  return n.setDate(1), n.setHours(0, 0, 0, 0), n;
255
262
  }
256
- function st(t, e) {
257
- const n = h(t, e == null ? void 0 : e.in);
263
+ function it(e, t) {
264
+ const n = y(e, t == null ? void 0 : t.in);
258
265
  return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
259
266
  }
260
- const it = {
267
+ const st = {
261
268
  lessThanXSeconds: {
262
269
  one: "less than a second",
263
270
  other: "less than {{count}} seconds"
@@ -319,15 +326,15 @@ const it = {
319
326
  one: "almost 1 year",
320
327
  other: "almost {{count}} years"
321
328
  }
322
- }, ot = (t, e, n) => {
329
+ }, ot = (e, t, n) => {
323
330
  let r;
324
- const a = it[t];
325
- return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
331
+ const a = st[e];
332
+ return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
326
333
  };
327
- function A(t) {
328
- return (e = {}) => {
329
- const n = e.width ? String(e.width) : t.defaultWidth;
330
- return t.formats[n] || t.formats[t.defaultWidth];
334
+ function A(e) {
335
+ return (t = {}) => {
336
+ const n = t.width ? String(t.width) : e.defaultWidth;
337
+ return e.formats[n] || e.formats[e.defaultWidth];
331
338
  };
332
339
  }
333
340
  const ut = {
@@ -365,31 +372,31 @@ const ut = {
365
372
  tomorrow: "'tomorrow at' p",
366
373
  nextWeek: "eeee 'at' p",
367
374
  other: "P"
368
- }, mt = (t, e, n, r) => ft[t];
369
- function P(t) {
370
- return (e, n) => {
375
+ }, mt = (e, t, n, r) => ft[e];
376
+ function P(e) {
377
+ return (t, n) => {
371
378
  const r = n != null && n.context ? String(n.context) : "standalone";
372
379
  let a;
373
- if (r === "formatting" && t.formattingValues) {
374
- const i = t.defaultFormattingWidth || t.defaultWidth, o = n != null && n.width ? String(n.width) : i;
375
- a = t.formattingValues[o] || t.formattingValues[i];
380
+ if (r === "formatting" && e.formattingValues) {
381
+ const s = e.defaultFormattingWidth || e.defaultWidth, o = n != null && n.width ? String(n.width) : s;
382
+ a = e.formattingValues[o] || e.formattingValues[s];
376
383
  } else {
377
- const i = t.defaultWidth, o = n != null && n.width ? String(n.width) : t.defaultWidth;
378
- a = t.values[o] || t.values[i];
384
+ const s = e.defaultWidth, o = n != null && n.width ? String(n.width) : e.defaultWidth;
385
+ a = e.values[o] || e.values[s];
379
386
  }
380
- const s = t.argumentCallback ? t.argumentCallback(e) : e;
381
- return a[s];
387
+ const i = e.argumentCallback ? e.argumentCallback(t) : t;
388
+ return a[i];
382
389
  };
383
390
  }
384
391
  const ht = {
385
392
  narrow: ["B", "A"],
386
393
  abbreviated: ["BC", "AD"],
387
394
  wide: ["Before Christ", "Anno Domini"]
388
- }, gt = {
395
+ }, yt = {
389
396
  narrow: ["1", "2", "3", "4"],
390
397
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
391
398
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
392
- }, yt = {
399
+ }, gt = {
393
400
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
394
401
  abbreviated: [
395
402
  "Jan",
@@ -494,8 +501,8 @@ const ht = {
494
501
  evening: "in the evening",
495
502
  night: "at night"
496
503
  }
497
- }, Dt = (t, e) => {
498
- const n = Number(t), r = n % 100;
504
+ }, Dt = (e, t) => {
505
+ const n = Number(e), r = n % 100;
499
506
  if (r > 20 || r < 10)
500
507
  switch (r % 10) {
501
508
  case 1:
@@ -513,12 +520,12 @@ const ht = {
513
520
  defaultWidth: "wide"
514
521
  }),
515
522
  quarter: P({
516
- values: gt,
523
+ values: yt,
517
524
  defaultWidth: "wide",
518
- argumentCallback: (t) => t - 1
525
+ argumentCallback: (e) => e - 1
519
526
  }),
520
527
  month: P({
521
- values: yt,
528
+ values: gt,
522
529
  defaultWidth: "wide"
523
530
  }),
524
531
  day: P({
@@ -532,47 +539,47 @@ const ht = {
532
539
  defaultFormattingWidth: "wide"
533
540
  })
534
541
  };
535
- function R(t) {
536
- return (e, n = {}) => {
537
- const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], s = e.match(a);
538
- if (!s)
542
+ function R(e) {
543
+ return (t, n = {}) => {
544
+ const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], i = t.match(a);
545
+ if (!i)
539
546
  return null;
540
- const i = s[0], o = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], u = Array.isArray(o) ? pt(o, (d) => d.test(i)) : (
547
+ const s = i[0], o = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], u = Array.isArray(o) ? Ot(o, (d) => d.test(s)) : (
541
548
  // [TODO] -- I challenge you to fix the type
542
- bt(o, (d) => d.test(i))
549
+ bt(o, (d) => d.test(s))
543
550
  );
544
551
  let l;
545
- l = t.valueCallback ? t.valueCallback(u) : u, l = n.valueCallback ? (
552
+ l = e.valueCallback ? e.valueCallback(u) : u, l = n.valueCallback ? (
546
553
  // [TODO] -- I challenge you to fix the type
547
554
  n.valueCallback(l)
548
555
  ) : l;
549
- const c = e.slice(i.length);
556
+ const c = t.slice(s.length);
550
557
  return { value: l, rest: c };
551
558
  };
552
559
  }
553
- function bt(t, e) {
554
- for (const n in t)
555
- if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
560
+ function bt(e, t) {
561
+ for (const n in e)
562
+ if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
556
563
  return n;
557
564
  }
558
- function pt(t, e) {
559
- for (let n = 0; n < t.length; n++)
560
- if (e(t[n]))
565
+ function Ot(e, t) {
566
+ for (let n = 0; n < e.length; n++)
567
+ if (t(e[n]))
561
568
  return n;
562
569
  }
563
- function Ot(t) {
564
- return (e, n = {}) => {
565
- const r = e.match(t.matchPattern);
570
+ function pt(e) {
571
+ return (t, n = {}) => {
572
+ const r = t.match(e.matchPattern);
566
573
  if (!r) return null;
567
- const a = r[0], s = e.match(t.parsePattern);
568
- if (!s) return null;
569
- let i = t.valueCallback ? t.valueCallback(s[0]) : s[0];
570
- i = n.valueCallback ? n.valueCallback(i) : i;
571
- const o = e.slice(a.length);
572
- return { value: i, rest: o };
574
+ const a = r[0], i = t.match(e.parsePattern);
575
+ if (!i) return null;
576
+ let s = e.valueCallback ? e.valueCallback(i[0]) : i[0];
577
+ s = n.valueCallback ? n.valueCallback(s) : s;
578
+ const o = t.slice(a.length);
579
+ return { value: s, rest: o };
573
580
  };
574
581
  }
575
- const xt = /^(\d+)(th|st|nd|rd)?/i, vt = /\d+/i, St = {
582
+ const vt = /^(\d+)(th|st|nd|rd)?/i, xt = /\d+/i, St = {
576
583
  narrow: /^(b|a)/i,
577
584
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
578
585
  wide: /^(before christ|before common era|anno domini|common era)/i
@@ -628,7 +635,7 @@ const xt = /^(\d+)(th|st|nd|rd)?/i, vt = /\d+/i, St = {
628
635
  }, Wt = {
629
636
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
630
637
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
631
- }, Ft = {
638
+ }, Ht = {
632
639
  any: {
633
640
  am: /^a/i,
634
641
  pm: /^p/i,
@@ -639,11 +646,11 @@ const xt = /^(\d+)(th|st|nd|rd)?/i, vt = /\d+/i, St = {
639
646
  evening: /evening/i,
640
647
  night: /night/i
641
648
  }
642
- }, Ct = {
643
- ordinalNumber: Ot({
644
- matchPattern: xt,
645
- parsePattern: vt,
646
- valueCallback: (t) => parseInt(t, 10)
649
+ }, Ft = {
650
+ ordinalNumber: pt({
651
+ matchPattern: vt,
652
+ parsePattern: xt,
653
+ valueCallback: (e) => parseInt(e, 10)
647
654
  }),
648
655
  era: R({
649
656
  matchPatterns: St,
@@ -656,7 +663,7 @@ const xt = /^(\d+)(th|st|nd|rd)?/i, vt = /\d+/i, St = {
656
663
  defaultMatchWidth: "wide",
657
664
  parsePatterns: Et,
658
665
  defaultParseWidth: "any",
659
- valueCallback: (t) => t + 1
666
+ valueCallback: (e) => e + 1
660
667
  }),
661
668
  month: R({
662
669
  matchPatterns: Yt,
@@ -673,70 +680,70 @@ const xt = /^(\d+)(th|st|nd|rd)?/i, vt = /\d+/i, St = {
673
680
  dayPeriod: R({
674
681
  matchPatterns: Wt,
675
682
  defaultMatchWidth: "any",
676
- parsePatterns: Ft,
683
+ parsePatterns: Ht,
677
684
  defaultParseWidth: "any"
678
685
  })
679
- }, Ht = {
686
+ }, Ct = {
680
687
  code: "en-US",
681
688
  formatDistance: ot,
682
689
  formatLong: dt,
683
690
  formatRelative: mt,
684
691
  localize: Mt,
685
- match: Ct,
692
+ match: Ft,
686
693
  options: {
687
694
  weekStartsOn: 0,
688
695
  firstWeekContainsDate: 1
689
696
  }
690
697
  };
691
- function Lt(t, e) {
692
- const n = h(t, e == null ? void 0 : e.in);
693
- return tt(n, st(n)) + 1;
698
+ function Gt(e, t) {
699
+ const n = y(e, t == null ? void 0 : t.in);
700
+ return tt(n, it(n)) + 1;
694
701
  }
695
- function qt(t, e) {
696
- const n = h(t, e == null ? void 0 : e.in), r = +C(n) - +nt(n);
697
- return Math.round(r / pe) + 1;
702
+ function Lt(e, t) {
703
+ const n = y(e, t == null ? void 0 : t.in), r = +F(n) - +nt(n);
704
+ return Math.round(r / Oe) + 1;
698
705
  }
699
- function xe(t, e) {
706
+ function ve(e, t) {
700
707
  var c, d, b, M;
701
- const n = h(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = W(), s = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((d = (c = e == null ? void 0 : e.locale) == null ? void 0 : c.options) == null ? void 0 : d.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((M = (b = a.locale) == null ? void 0 : b.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, i = D((e == null ? void 0 : e.in) || t, 0);
702
- i.setFullYear(r + 1, 0, s), i.setHours(0, 0, 0, 0);
703
- const o = O(i, e), u = D((e == null ? void 0 : e.in) || t, 0);
704
- u.setFullYear(r, 0, s), u.setHours(0, 0, 0, 0);
705
- const l = O(u, e);
708
+ const n = y(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = W(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((d = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : d.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((M = (b = a.locale) == null ? void 0 : b.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, s = D((t == null ? void 0 : t.in) || e, 0);
709
+ s.setFullYear(r + 1, 0, i), s.setHours(0, 0, 0, 0);
710
+ const o = p(s, t), u = D((t == null ? void 0 : t.in) || e, 0);
711
+ u.setFullYear(r, 0, i), u.setHours(0, 0, 0, 0);
712
+ const l = p(u, t);
706
713
  return +n >= +o ? r + 1 : +n >= +l ? r : r - 1;
707
714
  }
708
- function Ut(t, e) {
715
+ function qt(e, t) {
709
716
  var o, u, l, c;
710
- const n = W(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((u = (o = e == null ? void 0 : e.locale) == null ? void 0 : o.options) == null ? void 0 : u.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((c = (l = n.locale) == null ? void 0 : l.options) == null ? void 0 : c.firstWeekContainsDate) ?? 1, a = xe(t, e), s = D((e == null ? void 0 : e.in) || t, 0);
711
- return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), O(s, e);
717
+ const n = W(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((u = (o = t == null ? void 0 : t.locale) == null ? void 0 : o.options) == null ? void 0 : u.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((c = (l = n.locale) == null ? void 0 : l.options) == null ? void 0 : c.firstWeekContainsDate) ?? 1, a = ve(e, t), i = D((t == null ? void 0 : t.in) || e, 0);
718
+ return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), p(i, t);
712
719
  }
713
- function zt(t, e) {
714
- const n = h(t, e == null ? void 0 : e.in), r = +O(n, e) - +Ut(n, e);
715
- return Math.round(r / pe) + 1;
720
+ function Ut(e, t) {
721
+ const n = y(e, t == null ? void 0 : t.in), r = +p(n, t) - +qt(n, t);
722
+ return Math.round(r / Oe) + 1;
716
723
  }
717
- function f(t, e) {
718
- const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
724
+ function f(e, t) {
725
+ const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
719
726
  return n + r;
720
727
  }
721
- const x = {
728
+ const v = {
722
729
  // Year
723
- y(t, e) {
724
- const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
725
- return f(e === "yy" ? r % 100 : r, e.length);
730
+ y(e, t) {
731
+ const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
732
+ return f(t === "yy" ? r % 100 : r, t.length);
726
733
  },
727
734
  // Month
728
- M(t, e) {
729
- const n = t.getMonth();
730
- return e === "M" ? String(n + 1) : f(n + 1, 2);
735
+ M(e, t) {
736
+ const n = e.getMonth();
737
+ return t === "M" ? String(n + 1) : f(n + 1, 2);
731
738
  },
732
739
  // Day of the month
733
- d(t, e) {
734
- return f(t.getDate(), e.length);
740
+ d(e, t) {
741
+ return f(e.getDate(), t.length);
735
742
  },
736
743
  // AM or PM
737
- a(t, e) {
738
- const n = t.getHours() / 12 >= 1 ? "pm" : "am";
739
- switch (e) {
744
+ a(e, t) {
745
+ const n = e.getHours() / 12 >= 1 ? "pm" : "am";
746
+ switch (t) {
740
747
  case "a":
741
748
  case "aa":
742
749
  return n.toUpperCase();
@@ -750,27 +757,27 @@ const x = {
750
757
  }
751
758
  },
752
759
  // Hour [1-12]
753
- h(t, e) {
754
- return f(t.getHours() % 12 || 12, e.length);
760
+ h(e, t) {
761
+ return f(e.getHours() % 12 || 12, t.length);
755
762
  },
756
763
  // Hour [0-23]
757
- H(t, e) {
758
- return f(t.getHours(), e.length);
764
+ H(e, t) {
765
+ return f(e.getHours(), t.length);
759
766
  },
760
767
  // Minute
761
- m(t, e) {
762
- return f(t.getMinutes(), e.length);
768
+ m(e, t) {
769
+ return f(e.getMinutes(), t.length);
763
770
  },
764
771
  // Second
765
- s(t, e) {
766
- return f(t.getSeconds(), e.length);
772
+ s(e, t) {
773
+ return f(e.getSeconds(), t.length);
767
774
  },
768
775
  // Fraction of second
769
- S(t, e) {
770
- const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
776
+ S(e, t) {
777
+ const n = t.length, r = e.getMilliseconds(), a = Math.trunc(
771
778
  r * Math.pow(10, n - 3)
772
779
  );
773
- return f(a, e.length);
780
+ return f(a, t.length);
774
781
  }
775
782
  }, k = {
776
783
  am: "am",
@@ -783,9 +790,9 @@ const x = {
783
790
  night: "night"
784
791
  }, ae = {
785
792
  // Era
786
- G: function(t, e, n) {
787
- const r = t.getFullYear() > 0 ? 1 : 0;
788
- switch (e) {
793
+ G: function(e, t, n) {
794
+ const r = e.getFullYear() > 0 ? 1 : 0;
795
+ switch (t) {
789
796
  case "G":
790
797
  case "GG":
791
798
  case "GGG":
@@ -798,26 +805,26 @@ const x = {
798
805
  }
799
806
  },
800
807
  // Year
801
- y: function(t, e, n) {
802
- if (e === "yo") {
803
- const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
808
+ y: function(e, t, n) {
809
+ if (t === "yo") {
810
+ const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
804
811
  return n.ordinalNumber(a, { unit: "year" });
805
812
  }
806
- return x.y(t, e);
813
+ return v.y(e, t);
807
814
  },
808
815
  // Local week-numbering year
809
- Y: function(t, e, n, r) {
810
- const a = xe(t, r), s = a > 0 ? a : 1 - a;
811
- if (e === "YY") {
812
- const i = s % 100;
813
- return f(i, 2);
816
+ Y: function(e, t, n, r) {
817
+ const a = ve(e, r), i = a > 0 ? a : 1 - a;
818
+ if (t === "YY") {
819
+ const s = i % 100;
820
+ return f(s, 2);
814
821
  }
815
- return e === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : f(s, e.length);
822
+ return t === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : f(i, t.length);
816
823
  },
817
824
  // ISO week-numbering year
818
- R: function(t, e) {
819
- const n = Oe(t);
820
- return f(n, e.length);
825
+ R: function(e, t) {
826
+ const n = pe(e);
827
+ return f(n, t.length);
821
828
  },
822
829
  // Extended year. This is a single number designating the year of this calendar system.
823
830
  // The main difference between `y` and `u` localizers are B.C. years:
@@ -828,14 +835,14 @@ const x = {
828
835
  // | BC 2 | 2 | -1 |
829
836
  // Also `yy` always returns the last two digits of a year,
830
837
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
831
- u: function(t, e) {
832
- const n = t.getFullYear();
833
- return f(n, e.length);
838
+ u: function(e, t) {
839
+ const n = e.getFullYear();
840
+ return f(n, t.length);
834
841
  },
835
842
  // Quarter
836
- Q: function(t, e, n) {
837
- const r = Math.ceil((t.getMonth() + 1) / 3);
838
- switch (e) {
843
+ Q: function(e, t, n) {
844
+ const r = Math.ceil((e.getMonth() + 1) / 3);
845
+ switch (t) {
839
846
  case "Q":
840
847
  return String(r);
841
848
  case "QQ":
@@ -861,9 +868,9 @@ const x = {
861
868
  }
862
869
  },
863
870
  // Stand-alone quarter
864
- q: function(t, e, n) {
865
- const r = Math.ceil((t.getMonth() + 1) / 3);
866
- switch (e) {
871
+ q: function(e, t, n) {
872
+ const r = Math.ceil((e.getMonth() + 1) / 3);
873
+ switch (t) {
867
874
  case "q":
868
875
  return String(r);
869
876
  case "qq":
@@ -889,12 +896,12 @@ const x = {
889
896
  }
890
897
  },
891
898
  // Month
892
- M: function(t, e, n) {
893
- const r = t.getMonth();
894
- switch (e) {
899
+ M: function(e, t, n) {
900
+ const r = e.getMonth();
901
+ switch (t) {
895
902
  case "M":
896
903
  case "MM":
897
- return x.M(t, e);
904
+ return v.M(e, t);
898
905
  case "Mo":
899
906
  return n.ordinalNumber(r + 1, { unit: "month" });
900
907
  case "MMM":
@@ -913,9 +920,9 @@ const x = {
913
920
  }
914
921
  },
915
922
  // Stand-alone month
916
- L: function(t, e, n) {
917
- const r = t.getMonth();
918
- switch (e) {
923
+ L: function(e, t, n) {
924
+ const r = e.getMonth();
925
+ switch (t) {
919
926
  case "L":
920
927
  return String(r + 1);
921
928
  case "LL":
@@ -938,28 +945,28 @@ const x = {
938
945
  }
939
946
  },
940
947
  // Local week of year
941
- w: function(t, e, n, r) {
942
- const a = zt(t, r);
943
- return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : f(a, e.length);
948
+ w: function(e, t, n, r) {
949
+ const a = Ut(e, r);
950
+ return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : f(a, t.length);
944
951
  },
945
952
  // ISO week of year
946
- I: function(t, e, n) {
947
- const r = qt(t);
948
- return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : f(r, e.length);
953
+ I: function(e, t, n) {
954
+ const r = Lt(e);
955
+ return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : f(r, t.length);
949
956
  },
950
957
  // Day of the month
951
- d: function(t, e, n) {
952
- return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : x.d(t, e);
958
+ d: function(e, t, n) {
959
+ return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : v.d(e, t);
953
960
  },
954
961
  // Day of year
955
- D: function(t, e, n) {
956
- const r = Lt(t);
957
- return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : f(r, e.length);
962
+ D: function(e, t, n) {
963
+ const r = Gt(e);
964
+ return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : f(r, t.length);
958
965
  },
959
966
  // Day of week
960
- E: function(t, e, n) {
961
- const r = t.getDay();
962
- switch (e) {
967
+ E: function(e, t, n) {
968
+ const r = e.getDay();
969
+ switch (t) {
963
970
  case "E":
964
971
  case "EE":
965
972
  case "EEE":
@@ -986,15 +993,15 @@ const x = {
986
993
  }
987
994
  },
988
995
  // Local day of week
989
- e: function(t, e, n, r) {
990
- const a = t.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
991
- switch (e) {
996
+ e: function(e, t, n, r) {
997
+ const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
998
+ switch (t) {
992
999
  case "e":
993
- return String(s);
1000
+ return String(i);
994
1001
  case "ee":
995
- return f(s, 2);
1002
+ return f(i, 2);
996
1003
  case "eo":
997
- return n.ordinalNumber(s, { unit: "day" });
1004
+ return n.ordinalNumber(i, { unit: "day" });
998
1005
  case "eee":
999
1006
  return n.day(a, {
1000
1007
  width: "abbreviated",
@@ -1019,15 +1026,15 @@ const x = {
1019
1026
  }
1020
1027
  },
1021
1028
  // Stand-alone local day of week
1022
- c: function(t, e, n, r) {
1023
- const a = t.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
1024
- switch (e) {
1029
+ c: function(e, t, n, r) {
1030
+ const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
1031
+ switch (t) {
1025
1032
  case "c":
1026
- return String(s);
1033
+ return String(i);
1027
1034
  case "cc":
1028
- return f(s, e.length);
1035
+ return f(i, t.length);
1029
1036
  case "co":
1030
- return n.ordinalNumber(s, { unit: "day" });
1037
+ return n.ordinalNumber(i, { unit: "day" });
1031
1038
  case "ccc":
1032
1039
  return n.day(a, {
1033
1040
  width: "abbreviated",
@@ -1052,13 +1059,13 @@ const x = {
1052
1059
  }
1053
1060
  },
1054
1061
  // ISO day of week
1055
- i: function(t, e, n) {
1056
- const r = t.getDay(), a = r === 0 ? 7 : r;
1057
- switch (e) {
1062
+ i: function(e, t, n) {
1063
+ const r = e.getDay(), a = r === 0 ? 7 : r;
1064
+ switch (t) {
1058
1065
  case "i":
1059
1066
  return String(a);
1060
1067
  case "ii":
1061
- return f(a, e.length);
1068
+ return f(a, t.length);
1062
1069
  case "io":
1063
1070
  return n.ordinalNumber(a, { unit: "day" });
1064
1071
  case "iii":
@@ -1085,9 +1092,9 @@ const x = {
1085
1092
  }
1086
1093
  },
1087
1094
  // AM or PM
1088
- a: function(t, e, n) {
1089
- const a = t.getHours() / 12 >= 1 ? "pm" : "am";
1090
- switch (e) {
1095
+ a: function(e, t, n) {
1096
+ const a = e.getHours() / 12 >= 1 ? "pm" : "am";
1097
+ switch (t) {
1091
1098
  case "a":
1092
1099
  case "aa":
1093
1100
  return n.dayPeriod(a, {
@@ -1113,10 +1120,10 @@ const x = {
1113
1120
  }
1114
1121
  },
1115
1122
  // AM, PM, midnight, noon
1116
- b: function(t, e, n) {
1117
- const r = t.getHours();
1123
+ b: function(e, t, n) {
1124
+ const r = e.getHours();
1118
1125
  let a;
1119
- switch (r === 12 ? a = k.noon : r === 0 ? a = k.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
1126
+ switch (r === 12 ? a = k.noon : r === 0 ? a = k.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
1120
1127
  case "b":
1121
1128
  case "bb":
1122
1129
  return n.dayPeriod(a, {
@@ -1142,10 +1149,10 @@ const x = {
1142
1149
  }
1143
1150
  },
1144
1151
  // in the morning, in the afternoon, in the evening, at night
1145
- B: function(t, e, n) {
1146
- const r = t.getHours();
1152
+ B: function(e, t, n) {
1153
+ const r = e.getHours();
1147
1154
  let a;
1148
- switch (r >= 17 ? a = k.evening : r >= 12 ? a = k.afternoon : r >= 4 ? a = k.morning : a = k.night, e) {
1155
+ switch (r >= 17 ? a = k.evening : r >= 12 ? a = k.afternoon : r >= 4 ? a = k.morning : a = k.night, t) {
1149
1156
  case "B":
1150
1157
  case "BB":
1151
1158
  case "BBB":
@@ -1167,192 +1174,192 @@ const x = {
1167
1174
  }
1168
1175
  },
1169
1176
  // Hour [1-12]
1170
- h: function(t, e, n) {
1171
- if (e === "ho") {
1172
- let r = t.getHours() % 12;
1177
+ h: function(e, t, n) {
1178
+ if (t === "ho") {
1179
+ let r = e.getHours() % 12;
1173
1180
  return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
1174
1181
  }
1175
- return x.h(t, e);
1182
+ return v.h(e, t);
1176
1183
  },
1177
1184
  // Hour [0-23]
1178
- H: function(t, e, n) {
1179
- return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : x.H(t, e);
1185
+ H: function(e, t, n) {
1186
+ return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : v.H(e, t);
1180
1187
  },
1181
1188
  // Hour [0-11]
1182
- K: function(t, e, n) {
1183
- const r = t.getHours() % 12;
1184
- return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : f(r, e.length);
1189
+ K: function(e, t, n) {
1190
+ const r = e.getHours() % 12;
1191
+ return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : f(r, t.length);
1185
1192
  },
1186
1193
  // Hour [1-24]
1187
- k: function(t, e, n) {
1188
- let r = t.getHours();
1189
- return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : f(r, e.length);
1194
+ k: function(e, t, n) {
1195
+ let r = e.getHours();
1196
+ return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : f(r, t.length);
1190
1197
  },
1191
1198
  // Minute
1192
- m: function(t, e, n) {
1193
- return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : x.m(t, e);
1199
+ m: function(e, t, n) {
1200
+ return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : v.m(e, t);
1194
1201
  },
1195
1202
  // Second
1196
- s: function(t, e, n) {
1197
- return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : x.s(t, e);
1203
+ s: function(e, t, n) {
1204
+ return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : v.s(e, t);
1198
1205
  },
1199
1206
  // Fraction of second
1200
- S: function(t, e) {
1201
- return x.S(t, e);
1207
+ S: function(e, t) {
1208
+ return v.S(e, t);
1202
1209
  },
1203
1210
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1204
- X: function(t, e, n) {
1205
- const r = t.getTimezoneOffset();
1211
+ X: function(e, t, n) {
1212
+ const r = e.getTimezoneOffset();
1206
1213
  if (r === 0)
1207
1214
  return "Z";
1208
- switch (e) {
1215
+ switch (t) {
1209
1216
  case "X":
1210
- return ie(r);
1217
+ return se(r);
1211
1218
  case "XXXX":
1212
1219
  case "XX":
1213
- return v(r);
1220
+ return x(r);
1214
1221
  case "XXXXX":
1215
1222
  case "XXX":
1216
1223
  default:
1217
- return v(r, ":");
1224
+ return x(r, ":");
1218
1225
  }
1219
1226
  },
1220
1227
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1221
- x: function(t, e, n) {
1222
- const r = t.getTimezoneOffset();
1223
- switch (e) {
1228
+ x: function(e, t, n) {
1229
+ const r = e.getTimezoneOffset();
1230
+ switch (t) {
1224
1231
  case "x":
1225
- return ie(r);
1232
+ return se(r);
1226
1233
  case "xxxx":
1227
1234
  case "xx":
1228
- return v(r);
1235
+ return x(r);
1229
1236
  case "xxxxx":
1230
1237
  case "xxx":
1231
1238
  default:
1232
- return v(r, ":");
1239
+ return x(r, ":");
1233
1240
  }
1234
1241
  },
1235
1242
  // Timezone (GMT)
1236
- O: function(t, e, n) {
1237
- const r = t.getTimezoneOffset();
1238
- switch (e) {
1243
+ O: function(e, t, n) {
1244
+ const r = e.getTimezoneOffset();
1245
+ switch (t) {
1239
1246
  case "O":
1240
1247
  case "OO":
1241
1248
  case "OOO":
1242
- return "GMT" + se(r, ":");
1249
+ return "GMT" + ie(r, ":");
1243
1250
  case "OOOO":
1244
1251
  default:
1245
- return "GMT" + v(r, ":");
1252
+ return "GMT" + x(r, ":");
1246
1253
  }
1247
1254
  },
1248
1255
  // Timezone (specific non-location)
1249
- z: function(t, e, n) {
1250
- const r = t.getTimezoneOffset();
1251
- switch (e) {
1256
+ z: function(e, t, n) {
1257
+ const r = e.getTimezoneOffset();
1258
+ switch (t) {
1252
1259
  case "z":
1253
1260
  case "zz":
1254
1261
  case "zzz":
1255
- return "GMT" + se(r, ":");
1262
+ return "GMT" + ie(r, ":");
1256
1263
  case "zzzz":
1257
1264
  default:
1258
- return "GMT" + v(r, ":");
1265
+ return "GMT" + x(r, ":");
1259
1266
  }
1260
1267
  },
1261
1268
  // Seconds timestamp
1262
- t: function(t, e, n) {
1263
- const r = Math.trunc(+t / 1e3);
1264
- return f(r, e.length);
1269
+ t: function(e, t, n) {
1270
+ const r = Math.trunc(+e / 1e3);
1271
+ return f(r, t.length);
1265
1272
  },
1266
1273
  // Milliseconds timestamp
1267
- T: function(t, e, n) {
1268
- return f(+t, e.length);
1274
+ T: function(e, t, n) {
1275
+ return f(+e, t.length);
1269
1276
  }
1270
1277
  };
1271
- function se(t, e = "") {
1272
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), s = r % 60;
1273
- return s === 0 ? n + String(a) : n + String(a) + e + f(s, 2);
1278
+ function ie(e, t = "") {
1279
+ const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), i = r % 60;
1280
+ return i === 0 ? n + String(a) : n + String(a) + t + f(i, 2);
1274
1281
  }
1275
- function ie(t, e) {
1276
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + f(Math.abs(t) / 60, 2) : v(t, e);
1282
+ function se(e, t) {
1283
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + f(Math.abs(e) / 60, 2) : x(e, t);
1277
1284
  }
1278
- function v(t, e = "") {
1279
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = f(Math.trunc(r / 60), 2), s = f(r % 60, 2);
1280
- return n + a + e + s;
1285
+ function x(e, t = "") {
1286
+ const n = e > 0 ? "-" : "+", r = Math.abs(e), a = f(Math.trunc(r / 60), 2), i = f(r % 60, 2);
1287
+ return n + a + t + i;
1281
1288
  }
1282
- const oe = (t, e) => {
1283
- switch (t) {
1289
+ const oe = (e, t) => {
1290
+ switch (e) {
1284
1291
  case "P":
1285
- return e.date({ width: "short" });
1292
+ return t.date({ width: "short" });
1286
1293
  case "PP":
1287
- return e.date({ width: "medium" });
1294
+ return t.date({ width: "medium" });
1288
1295
  case "PPP":
1289
- return e.date({ width: "long" });
1296
+ return t.date({ width: "long" });
1290
1297
  case "PPPP":
1291
1298
  default:
1292
- return e.date({ width: "full" });
1299
+ return t.date({ width: "full" });
1293
1300
  }
1294
- }, ve = (t, e) => {
1295
- switch (t) {
1301
+ }, xe = (e, t) => {
1302
+ switch (e) {
1296
1303
  case "p":
1297
- return e.time({ width: "short" });
1304
+ return t.time({ width: "short" });
1298
1305
  case "pp":
1299
- return e.time({ width: "medium" });
1306
+ return t.time({ width: "medium" });
1300
1307
  case "ppp":
1301
- return e.time({ width: "long" });
1308
+ return t.time({ width: "long" });
1302
1309
  case "pppp":
1303
1310
  default:
1304
- return e.time({ width: "full" });
1311
+ return t.time({ width: "full" });
1305
1312
  }
1306
- }, Gt = (t, e) => {
1307
- const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1313
+ }, zt = (e, t) => {
1314
+ const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1308
1315
  if (!a)
1309
- return oe(t, e);
1310
- let s;
1316
+ return oe(e, t);
1317
+ let i;
1311
1318
  switch (r) {
1312
1319
  case "P":
1313
- s = e.dateTime({ width: "short" });
1320
+ i = t.dateTime({ width: "short" });
1314
1321
  break;
1315
1322
  case "PP":
1316
- s = e.dateTime({ width: "medium" });
1323
+ i = t.dateTime({ width: "medium" });
1317
1324
  break;
1318
1325
  case "PPP":
1319
- s = e.dateTime({ width: "long" });
1326
+ i = t.dateTime({ width: "long" });
1320
1327
  break;
1321
1328
  case "PPPP":
1322
1329
  default:
1323
- s = e.dateTime({ width: "full" });
1330
+ i = t.dateTime({ width: "full" });
1324
1331
  break;
1325
1332
  }
1326
- return s.replace("{{date}}", oe(r, e)).replace("{{time}}", ve(a, e));
1333
+ return i.replace("{{date}}", oe(r, t)).replace("{{time}}", xe(a, t));
1327
1334
  }, At = {
1328
- p: ve,
1329
- P: Gt
1335
+ p: xe,
1336
+ P: zt
1330
1337
  }, Xt = /^D+$/, $t = /^Y+$/, Vt = ["D", "DD", "YY", "YYYY"];
1331
- function jt(t) {
1332
- return Xt.test(t);
1338
+ function jt(e) {
1339
+ return Xt.test(e);
1333
1340
  }
1334
- function Zt(t) {
1335
- return $t.test(t);
1341
+ function Zt(e) {
1342
+ return $t.test(e);
1336
1343
  }
1337
- function Qt(t, e, n) {
1338
- const r = Bt(t, e, n);
1339
- if (console.warn(r), Vt.includes(t)) throw new RangeError(r);
1344
+ function Qt(e, t, n) {
1345
+ const r = Bt(e, t, n);
1346
+ if (console.warn(r), Vt.includes(e)) throw new RangeError(r);
1340
1347
  }
1341
- function Bt(t, e, n) {
1342
- const r = t[0] === "Y" ? "years" : "days of the month";
1343
- return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1348
+ function Bt(e, t, n) {
1349
+ const r = e[0] === "Y" ? "years" : "days of the month";
1350
+ return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1344
1351
  }
1345
1352
  const Jt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Kt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, en = /^'([^]*?)'?$/, tn = /''/g, nn = /[a-zA-Z]/;
1346
- function Se(t, e, n) {
1347
- var c, d, b, M, p, S, K, ee;
1348
- const r = W(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? Ht, s = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((d = (c = n == null ? void 0 : n.locale) == null ? void 0 : c.options) == null ? void 0 : d.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((M = (b = r.locale) == null ? void 0 : b.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, i = (n == null ? void 0 : n.weekStartsOn) ?? ((S = (p = n == null ? void 0 : n.locale) == null ? void 0 : p.options) == null ? void 0 : S.weekStartsOn) ?? r.weekStartsOn ?? ((ee = (K = r.locale) == null ? void 0 : K.options) == null ? void 0 : ee.weekStartsOn) ?? 0, o = h(t, n == null ? void 0 : n.in);
1353
+ function Se(e, t, n) {
1354
+ var c, d, b, M, O, S, K, ee;
1355
+ const r = W(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? Ct, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((d = (c = n == null ? void 0 : n.locale) == null ? void 0 : c.options) == null ? void 0 : d.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((M = (b = r.locale) == null ? void 0 : b.options) == null ? void 0 : M.firstWeekContainsDate) ?? 1, s = (n == null ? void 0 : n.weekStartsOn) ?? ((S = (O = n == null ? void 0 : n.locale) == null ? void 0 : O.options) == null ? void 0 : S.weekStartsOn) ?? r.weekStartsOn ?? ((ee = (K = r.locale) == null ? void 0 : K.options) == null ? void 0 : ee.weekStartsOn) ?? 0, o = y(e, n == null ? void 0 : n.in);
1349
1356
  if (!at(o))
1350
1357
  throw new RangeError("Invalid time value");
1351
- let u = e.match(Kt).map((_) => {
1358
+ let u = t.match(Kt).map((_) => {
1352
1359
  const w = _[0];
1353
1360
  if (w === "p" || w === "P") {
1354
- const G = At[w];
1355
- return G(_, a.formatLong);
1361
+ const z = At[w];
1362
+ return z(_, a.formatLong);
1356
1363
  }
1357
1364
  return _;
1358
1365
  }).join("").match(Jt).map((_) => {
@@ -1371,68 +1378,68 @@ function Se(t, e, n) {
1371
1378
  });
1372
1379
  a.localize.preprocessor && (u = a.localize.preprocessor(o, u));
1373
1380
  const l = {
1374
- firstWeekContainsDate: s,
1375
- weekStartsOn: i,
1381
+ firstWeekContainsDate: i,
1382
+ weekStartsOn: s,
1376
1383
  locale: a
1377
1384
  };
1378
1385
  return u.map((_) => {
1379
1386
  if (!_.isToken) return _.value;
1380
1387
  const w = _.value;
1381
- (!(n != null && n.useAdditionalWeekYearTokens) && Zt(w) || !(n != null && n.useAdditionalDayOfYearTokens) && jt(w)) && Qt(w, e, String(t));
1382
- const G = ae[w[0]];
1383
- return G(o, w, a.localize, l);
1388
+ (!(n != null && n.useAdditionalWeekYearTokens) && Zt(w) || !(n != null && n.useAdditionalDayOfYearTokens) && jt(w)) && Qt(w, t, String(e));
1389
+ const z = ae[w[0]];
1390
+ return z(o, w, a.localize, l);
1384
1391
  }).join("");
1385
1392
  }
1386
- function rn(t) {
1387
- const e = t.match(en);
1388
- return e ? e[1].replace(tn, "'") : t;
1393
+ function rn(e) {
1394
+ const t = e.match(en);
1395
+ return t ? t[1].replace(tn, "'") : e;
1389
1396
  }
1390
- function an(t, e) {
1391
- const n = h(t, e == null ? void 0 : e.in), r = n.getFullYear(), a = n.getMonth(), s = D(n, 0);
1392
- return s.setFullYear(r, a + 1, 0), s.setHours(0, 0, 0, 0), s.getDate();
1397
+ function an(e, t) {
1398
+ const n = y(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = n.getMonth(), i = D(n, 0);
1399
+ return i.setFullYear(r, a + 1, 0), i.setHours(0, 0, 0, 0), i.getDate();
1393
1400
  }
1394
1401
  function sn() {
1395
1402
  return Object.assign({}, W());
1396
1403
  }
1397
- function ue(t) {
1398
- return +h(t);
1404
+ function ue(e) {
1405
+ return +y(e);
1399
1406
  }
1400
- function ce(t) {
1401
- return Math.trunc(+h(t) / 1e3);
1407
+ function ce(e) {
1408
+ return Math.trunc(+y(e) / 1e3);
1402
1409
  }
1403
- function on(t) {
1404
- return Math.trunc(t * Be);
1410
+ function on(e) {
1411
+ return Math.trunc(e * Be);
1405
1412
  }
1406
- function un(t) {
1407
- const e = t / Qe;
1408
- return Math.trunc(e);
1413
+ function un(e) {
1414
+ const t = e / Qe;
1415
+ return Math.trunc(t);
1409
1416
  }
1410
- function ke(t, e, n) {
1411
- return Je(t, -e, n);
1417
+ function ke(e, t, n) {
1418
+ return Je(e, -t, n);
1412
1419
  }
1413
- function le(t, e, n) {
1414
- const r = sn(), a = dn(t, n.timeZone, n.locale ?? r.locale);
1415
- return "formatToParts" in a ? cn(a, e) : ln(a, e);
1420
+ function le(e, t, n) {
1421
+ const r = sn(), a = dn(e, n.timeZone, n.locale ?? r.locale);
1422
+ return "formatToParts" in a ? cn(a, t) : ln(a, t);
1416
1423
  }
1417
- function cn(t, e) {
1418
- const n = t.formatToParts(e);
1424
+ function cn(e, t) {
1425
+ const n = e.formatToParts(t);
1419
1426
  for (let r = n.length - 1; r >= 0; --r)
1420
1427
  if (n[r].type === "timeZoneName")
1421
1428
  return n[r].value;
1422
1429
  }
1423
- function ln(t, e) {
1424
- const n = t.format(e).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
1430
+ function ln(e, t) {
1431
+ const n = e.format(t).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
1425
1432
  return r ? r[0].substr(1) : "";
1426
1433
  }
1427
- function dn(t, e, n) {
1434
+ function dn(e, t, n) {
1428
1435
  return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
1429
- timeZone: e,
1430
- timeZoneName: t
1436
+ timeZone: t,
1437
+ timeZoneName: e
1431
1438
  });
1432
1439
  }
1433
- function fn(t, e) {
1434
- const n = wn(e);
1435
- return "formatToParts" in n ? hn(n, t) : gn(n, t);
1440
+ function fn(e, t) {
1441
+ const n = wn(t);
1442
+ return "formatToParts" in n ? hn(n, e) : yn(n, e);
1436
1443
  }
1437
1444
  const mn = {
1438
1445
  year: 0,
@@ -1442,12 +1449,12 @@ const mn = {
1442
1449
  minute: 4,
1443
1450
  second: 5
1444
1451
  };
1445
- function hn(t, e) {
1452
+ function hn(e, t) {
1446
1453
  try {
1447
- const n = t.formatToParts(e), r = [];
1454
+ const n = e.formatToParts(t), r = [];
1448
1455
  for (let a = 0; a < n.length; a++) {
1449
- const s = mn[n[a].type];
1450
- s !== void 0 && (r[s] = parseInt(n[a].value, 10));
1456
+ const i = mn[n[a].type];
1457
+ i !== void 0 && (r[i] = parseInt(n[a].value, 10));
1451
1458
  }
1452
1459
  return r;
1453
1460
  } catch (n) {
@@ -1456,8 +1463,8 @@ function hn(t, e) {
1456
1463
  throw n;
1457
1464
  }
1458
1465
  }
1459
- function gn(t, e) {
1460
- const n = t.format(e), r = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);
1466
+ function yn(e, t) {
1467
+ const n = e.format(t), r = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);
1461
1468
  return [
1462
1469
  parseInt(r[3], 10),
1463
1470
  parseInt(r[1], 10),
@@ -1476,11 +1483,11 @@ const X = {}, de = new Intl.DateTimeFormat("en-US", {
1476
1483
  hour: "2-digit",
1477
1484
  minute: "2-digit",
1478
1485
  second: "2-digit"
1479
- }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), yn = de === "06/25/2014, 00:00:00" || de === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
1480
- function wn(t) {
1481
- return X[t] || (X[t] = yn ? new Intl.DateTimeFormat("en-US", {
1486
+ }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), gn = de === "06/25/2014, 00:00:00" || de === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
1487
+ function wn(e) {
1488
+ return X[e] || (X[e] = gn ? new Intl.DateTimeFormat("en-US", {
1482
1489
  hourCycle: "h23",
1483
- timeZone: t,
1490
+ timeZone: e,
1484
1491
  year: "numeric",
1485
1492
  month: "numeric",
1486
1493
  day: "2-digit",
@@ -1489,18 +1496,18 @@ function wn(t) {
1489
1496
  second: "2-digit"
1490
1497
  }) : new Intl.DateTimeFormat("en-US", {
1491
1498
  hour12: !1,
1492
- timeZone: t,
1499
+ timeZone: e,
1493
1500
  year: "numeric",
1494
1501
  month: "numeric",
1495
1502
  day: "2-digit",
1496
1503
  hour: "2-digit",
1497
1504
  minute: "2-digit",
1498
1505
  second: "2-digit"
1499
- })), X[t];
1506
+ })), X[e];
1500
1507
  }
1501
- function B(t, e, n, r, a, s, i) {
1508
+ function B(e, t, n, r, a, i, s) {
1502
1509
  const o = /* @__PURE__ */ new Date(0);
1503
- return o.setUTCFullYear(t, e, n), o.setUTCHours(r, a, s, i), o;
1510
+ return o.setUTCFullYear(e, t, n), o.setUTCHours(r, a, i, s), o;
1504
1511
  }
1505
1512
  const fe = 36e5, _n = 6e4, $ = {
1506
1513
  timezone: /([Z+-].*)$/,
@@ -1508,67 +1515,67 @@ const fe = 36e5, _n = 6e4, $ = {
1508
1515
  timezoneHH: /^([+-]\d{2})$/,
1509
1516
  timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
1510
1517
  };
1511
- function F(t, e, n) {
1512
- if (!t)
1518
+ function H(e, t, n) {
1519
+ if (!e)
1513
1520
  return 0;
1514
- let r = $.timezoneZ.exec(t);
1521
+ let r = $.timezoneZ.exec(e);
1515
1522
  if (r)
1516
1523
  return 0;
1517
- let a, s;
1518
- if (r = $.timezoneHH.exec(t), r)
1524
+ let a, i;
1525
+ if (r = $.timezoneHH.exec(e), r)
1519
1526
  return a = parseInt(r[1], 10), me(a) ? -(a * fe) : NaN;
1520
- if (r = $.timezoneHHMM.exec(t), r) {
1527
+ if (r = $.timezoneHHMM.exec(e), r) {
1521
1528
  a = parseInt(r[2], 10);
1522
- const i = parseInt(r[3], 10);
1523
- return me(a, i) ? (s = Math.abs(a) * fe + i * _n, r[1] === "+" ? -s : s) : NaN;
1529
+ const s = parseInt(r[3], 10);
1530
+ return me(a, s) ? (i = Math.abs(a) * fe + s * _n, r[1] === "+" ? -i : i) : NaN;
1524
1531
  }
1525
- if (Mn(t)) {
1526
- e = new Date(e || Date.now());
1527
- const i = n ? e : Tn(e), o = Q(i, t);
1528
- return -(n ? o : Dn(e, o, t));
1532
+ if (Mn(e)) {
1533
+ t = new Date(t || Date.now());
1534
+ const s = n ? t : Tn(t), o = Q(s, e);
1535
+ return -(n ? o : Dn(t, o, e));
1529
1536
  }
1530
1537
  return NaN;
1531
1538
  }
1532
- function Tn(t) {
1533
- return B(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds());
1539
+ function Tn(e) {
1540
+ return B(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
1534
1541
  }
1535
- function Q(t, e) {
1536
- const n = fn(t, e), r = B(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
1537
- let a = t.getTime();
1538
- const s = a % 1e3;
1539
- return a -= s >= 0 ? s : 1e3 + s, r - a;
1542
+ function Q(e, t) {
1543
+ const n = fn(e, t), r = B(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
1544
+ let a = e.getTime();
1545
+ const i = a % 1e3;
1546
+ return a -= i >= 0 ? i : 1e3 + i, r - a;
1540
1547
  }
1541
- function Dn(t, e, n) {
1542
- let a = t.getTime() - e;
1543
- const s = Q(new Date(a), n);
1544
- if (e === s)
1545
- return e;
1546
- a -= s - e;
1548
+ function Dn(e, t, n) {
1549
+ let a = e.getTime() - t;
1547
1550
  const i = Q(new Date(a), n);
1548
- return s === i ? s : Math.max(s, i);
1551
+ if (t === i)
1552
+ return t;
1553
+ a -= i - t;
1554
+ const s = Q(new Date(a), n);
1555
+ return i === s ? i : Math.max(i, s);
1549
1556
  }
1550
- function me(t, e) {
1551
- return -23 <= t && t <= 23 && (e == null || 0 <= e && e <= 59);
1557
+ function me(e, t) {
1558
+ return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
1552
1559
  }
1553
1560
  const he = {};
1554
- function Mn(t) {
1555
- if (he[t])
1561
+ function Mn(e) {
1562
+ if (he[e])
1556
1563
  return !0;
1557
1564
  try {
1558
- return new Intl.DateTimeFormat(void 0, { timeZone: t }), he[t] = !0, !0;
1565
+ return new Intl.DateTimeFormat(void 0, { timeZone: e }), he[e] = !0, !0;
1559
1566
  } catch {
1560
1567
  return !1;
1561
1568
  }
1562
1569
  }
1563
- const bn = 60 * 1e3, pn = {
1570
+ const bn = 60 * 1e3, On = {
1564
1571
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1565
- X: function(t, e, n) {
1566
- const r = V(n.timeZone, t);
1572
+ X: function(e, t, n) {
1573
+ const r = V(n.timeZone, e);
1567
1574
  if (r === 0)
1568
1575
  return "Z";
1569
- switch (e) {
1576
+ switch (t) {
1570
1577
  case "X":
1571
- return ge(r);
1578
+ return ye(r);
1572
1579
  case "XXXX":
1573
1580
  case "XX":
1574
1581
  return N(r);
@@ -1579,11 +1586,11 @@ const bn = 60 * 1e3, pn = {
1579
1586
  }
1580
1587
  },
1581
1588
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1582
- x: function(t, e, n) {
1583
- const r = V(n.timeZone, t);
1584
- switch (e) {
1589
+ x: function(e, t, n) {
1590
+ const r = V(n.timeZone, e);
1591
+ switch (t) {
1585
1592
  case "x":
1586
- return ge(r);
1593
+ return ye(r);
1587
1594
  case "xxxx":
1588
1595
  case "xx":
1589
1596
  return N(r);
@@ -1594,60 +1601,60 @@ const bn = 60 * 1e3, pn = {
1594
1601
  }
1595
1602
  },
1596
1603
  // Timezone (GMT)
1597
- O: function(t, e, n) {
1598
- const r = V(n.timeZone, t);
1599
- switch (e) {
1604
+ O: function(e, t, n) {
1605
+ const r = V(n.timeZone, e);
1606
+ switch (t) {
1600
1607
  case "O":
1601
1608
  case "OO":
1602
1609
  case "OOO":
1603
- return "GMT" + On(r, ":");
1610
+ return "GMT" + pn(r, ":");
1604
1611
  case "OOOO":
1605
1612
  default:
1606
1613
  return "GMT" + N(r, ":");
1607
1614
  }
1608
1615
  },
1609
1616
  // Timezone (specific non-location)
1610
- z: function(t, e, n) {
1611
- switch (e) {
1617
+ z: function(e, t, n) {
1618
+ switch (t) {
1612
1619
  case "z":
1613
1620
  case "zz":
1614
1621
  case "zzz":
1615
- return le("short", t, n);
1622
+ return le("short", e, n);
1616
1623
  case "zzzz":
1617
1624
  default:
1618
- return le("long", t, n);
1625
+ return le("long", e, n);
1619
1626
  }
1620
1627
  }
1621
1628
  };
1622
- function V(t, e) {
1623
- const n = t ? F(t, e, !0) / bn : (e == null ? void 0 : e.getTimezoneOffset()) ?? 0;
1629
+ function V(e, t) {
1630
+ const n = e ? H(e, t, !0) / bn : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
1624
1631
  if (Number.isNaN(n))
1625
- throw new RangeError("Invalid time zone specified: " + t);
1632
+ throw new RangeError("Invalid time zone specified: " + e);
1626
1633
  return n;
1627
1634
  }
1628
- function L(t, e) {
1629
- const n = t < 0 ? "-" : "";
1630
- let r = Math.abs(t).toString();
1631
- for (; r.length < e; )
1635
+ function G(e, t) {
1636
+ const n = e < 0 ? "-" : "";
1637
+ let r = Math.abs(e).toString();
1638
+ for (; r.length < t; )
1632
1639
  r = "0" + r;
1633
1640
  return n + r;
1634
1641
  }
1635
- function N(t, e = "") {
1636
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = L(Math.floor(r / 60), 2), s = L(Math.floor(r % 60), 2);
1637
- return n + a + e + s;
1642
+ function N(e, t = "") {
1643
+ const n = e > 0 ? "-" : "+", r = Math.abs(e), a = G(Math.floor(r / 60), 2), i = G(Math.floor(r % 60), 2);
1644
+ return n + a + t + i;
1638
1645
  }
1639
- function ge(t, e) {
1640
- return t % 60 === 0 ? (t > 0 ? "-" : "+") + L(Math.abs(t) / 60, 2) : N(t, e);
1646
+ function ye(e, t) {
1647
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + G(Math.abs(e) / 60, 2) : N(e, t);
1641
1648
  }
1642
- function On(t, e = "") {
1643
- const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.floor(r / 60), s = r % 60;
1644
- return s === 0 ? n + String(a) : n + String(a) + e + L(s, 2);
1649
+ function pn(e, t = "") {
1650
+ const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60), i = r % 60;
1651
+ return i === 0 ? n + String(a) : n + String(a) + t + G(i, 2);
1645
1652
  }
1646
- function ye(t) {
1647
- const e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()));
1648
- return e.setUTCFullYear(t.getFullYear()), +t - +e;
1653
+ function ge(e) {
1654
+ const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
1655
+ return t.setUTCFullYear(e.getFullYear()), +e - +t;
1649
1656
  }
1650
- const Ne = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, j = 36e5, we = 6e4, xn = 2, y = {
1657
+ const Ne = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, j = 36e5, we = 6e4, vn = 2, g = {
1651
1658
  dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
1652
1659
  datePattern: /^([0-9W+-]+)(.*)/,
1653
1660
  plainTime: /:/,
@@ -1682,62 +1689,62 @@ const Ne = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)
1682
1689
  // time zone tokens (to identify the presence of a tz)
1683
1690
  timeZone: Ne
1684
1691
  };
1685
- function q(t, e = {}) {
1692
+ function L(e, t = {}) {
1686
1693
  if (arguments.length < 1)
1687
1694
  throw new TypeError("1 argument required, but only " + arguments.length + " present");
1688
- if (t === null)
1695
+ if (e === null)
1689
1696
  return /* @__PURE__ */ new Date(NaN);
1690
- const n = e.additionalDigits == null ? xn : Number(e.additionalDigits);
1697
+ const n = t.additionalDigits == null ? vn : Number(t.additionalDigits);
1691
1698
  if (n !== 2 && n !== 1 && n !== 0)
1692
1699
  throw new RangeError("additionalDigits must be 0, 1 or 2");
1693
- if (t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]")
1694
- return new Date(t.getTime());
1695
- if (typeof t == "number" || Object.prototype.toString.call(t) === "[object Number]")
1696
- return new Date(t);
1697
- if (Object.prototype.toString.call(t) !== "[object String]")
1700
+ if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
1701
+ return new Date(e.getTime());
1702
+ if (typeof e == "number" || Object.prototype.toString.call(e) === "[object Number]")
1703
+ return new Date(e);
1704
+ if (Object.prototype.toString.call(e) !== "[object String]")
1698
1705
  return /* @__PURE__ */ new Date(NaN);
1699
- const r = vn(t), { year: a, restDateString: s } = Sn(r.date, n), i = kn(s, a);
1700
- if (i === null || isNaN(i.getTime()))
1706
+ const r = xn(e), { year: a, restDateString: i } = Sn(r.date, n), s = kn(i, a);
1707
+ if (s === null || isNaN(s.getTime()))
1701
1708
  return /* @__PURE__ */ new Date(NaN);
1702
- if (i) {
1703
- const o = i.getTime();
1709
+ if (s) {
1710
+ const o = s.getTime();
1704
1711
  let u = 0, l;
1705
1712
  if (r.time && (u = Nn(r.time), u === null || isNaN(u)))
1706
1713
  return /* @__PURE__ */ new Date(NaN);
1707
- if (r.timeZone || e.timeZone) {
1708
- if (l = F(r.timeZone || e.timeZone, new Date(o + u)), isNaN(l))
1714
+ if (r.timeZone || t.timeZone) {
1715
+ if (l = H(r.timeZone || t.timeZone, new Date(o + u)), isNaN(l))
1709
1716
  return /* @__PURE__ */ new Date(NaN);
1710
1717
  } else
1711
- l = ye(new Date(o + u)), l = ye(new Date(o + u + l));
1718
+ l = ge(new Date(o + u)), l = ge(new Date(o + u + l));
1712
1719
  return new Date(o + u + l);
1713
1720
  } else
1714
1721
  return /* @__PURE__ */ new Date(NaN);
1715
1722
  }
1716
- function vn(t) {
1717
- const e = {};
1718
- let n = y.dateTimePattern.exec(t), r;
1719
- if (n ? (e.date = n[1], r = n[3]) : (n = y.datePattern.exec(t), n ? (e.date = n[1], r = n[2]) : (e.date = null, r = t)), r) {
1720
- const a = y.timeZone.exec(r);
1721
- a ? (e.time = r.replace(a[1], ""), e.timeZone = a[1].trim()) : e.time = r;
1723
+ function xn(e) {
1724
+ const t = {};
1725
+ let n = g.dateTimePattern.exec(e), r;
1726
+ if (n ? (t.date = n[1], r = n[3]) : (n = g.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
1727
+ const a = g.timeZone.exec(r);
1728
+ a ? (t.time = r.replace(a[1], ""), t.timeZone = a[1].trim()) : t.time = r;
1722
1729
  }
1723
- return e;
1730
+ return t;
1724
1731
  }
1725
- function Sn(t, e) {
1726
- if (t) {
1727
- const n = y.YYY[e], r = y.YYYYY[e];
1728
- let a = y.YYYY.exec(t) || r.exec(t);
1732
+ function Sn(e, t) {
1733
+ if (e) {
1734
+ const n = g.YYY[t], r = g.YYYYY[t];
1735
+ let a = g.YYYY.exec(e) || r.exec(e);
1729
1736
  if (a) {
1730
- const s = a[1];
1737
+ const i = a[1];
1731
1738
  return {
1732
- year: parseInt(s, 10),
1733
- restDateString: t.slice(s.length)
1739
+ year: parseInt(i, 10),
1740
+ restDateString: e.slice(i.length)
1734
1741
  };
1735
1742
  }
1736
- if (a = y.YY.exec(t) || n.exec(t), a) {
1737
- const s = a[1];
1743
+ if (a = g.YY.exec(e) || n.exec(e), a) {
1744
+ const i = a[1];
1738
1745
  return {
1739
- year: parseInt(s, 10) * 100,
1740
- restDateString: t.slice(s.length)
1746
+ year: parseInt(i, 10) * 100,
1747
+ restDateString: e.slice(i.length)
1741
1748
  };
1742
1749
  }
1743
1750
  }
@@ -1745,194 +1752,202 @@ function Sn(t, e) {
1745
1752
  year: null
1746
1753
  };
1747
1754
  }
1748
- function kn(t, e) {
1749
- if (e === null)
1755
+ function kn(e, t) {
1756
+ if (t === null)
1750
1757
  return null;
1751
1758
  let n, r, a;
1752
- if (!t || !t.length)
1753
- return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(e), n;
1754
- let s = y.MM.exec(t);
1755
- if (s)
1756
- return n = /* @__PURE__ */ new Date(0), r = parseInt(s[1], 10) - 1, Te(e, r) ? (n.setUTCFullYear(e, r), n) : /* @__PURE__ */ new Date(NaN);
1757
- if (s = y.DDD.exec(t), s) {
1759
+ if (!e || !e.length)
1760
+ return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(t), n;
1761
+ let i = g.MM.exec(e);
1762
+ if (i)
1763
+ return n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1, Te(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
1764
+ if (i = g.DDD.exec(e), i) {
1758
1765
  n = /* @__PURE__ */ new Date(0);
1759
- const i = parseInt(s[1], 10);
1760
- return Pn(e, i) ? (n.setUTCFullYear(e, 0, i), n) : /* @__PURE__ */ new Date(NaN);
1766
+ const s = parseInt(i[1], 10);
1767
+ return Pn(t, s) ? (n.setUTCFullYear(t, 0, s), n) : /* @__PURE__ */ new Date(NaN);
1761
1768
  }
1762
- if (s = y.MMDD.exec(t), s) {
1763
- n = /* @__PURE__ */ new Date(0), r = parseInt(s[1], 10) - 1;
1764
- const i = parseInt(s[2], 10);
1765
- return Te(e, r, i) ? (n.setUTCFullYear(e, r, i), n) : /* @__PURE__ */ new Date(NaN);
1769
+ if (i = g.MMDD.exec(e), i) {
1770
+ n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1;
1771
+ const s = parseInt(i[2], 10);
1772
+ return Te(t, r, s) ? (n.setUTCFullYear(t, r, s), n) : /* @__PURE__ */ new Date(NaN);
1766
1773
  }
1767
- if (s = y.Www.exec(t), s)
1768
- return a = parseInt(s[1], 10) - 1, De(a) ? _e(e, a) : /* @__PURE__ */ new Date(NaN);
1769
- if (s = y.WwwD.exec(t), s) {
1770
- a = parseInt(s[1], 10) - 1;
1771
- const i = parseInt(s[2], 10) - 1;
1772
- return De(a, i) ? _e(e, a, i) : /* @__PURE__ */ new Date(NaN);
1774
+ if (i = g.Www.exec(e), i)
1775
+ return a = parseInt(i[1], 10) - 1, De(a) ? _e(t, a) : /* @__PURE__ */ new Date(NaN);
1776
+ if (i = g.WwwD.exec(e), i) {
1777
+ a = parseInt(i[1], 10) - 1;
1778
+ const s = parseInt(i[2], 10) - 1;
1779
+ return De(a, s) ? _e(t, a, s) : /* @__PURE__ */ new Date(NaN);
1773
1780
  }
1774
1781
  return null;
1775
1782
  }
1776
- function Nn(t) {
1777
- let e, n, r = y.HH.exec(t);
1783
+ function Nn(e) {
1784
+ let t, n, r = g.HH.exec(e);
1778
1785
  if (r)
1779
- return e = parseFloat(r[1].replace(",", ".")), Z(e) ? e % 24 * j : NaN;
1780
- if (r = y.HHMM.exec(t), r)
1781
- return e = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), Z(e, n) ? e % 24 * j + n * we : NaN;
1782
- if (r = y.HHMMSS.exec(t), r) {
1783
- e = parseInt(r[1], 10), n = parseInt(r[2], 10);
1786
+ return t = parseFloat(r[1].replace(",", ".")), Z(t) ? t % 24 * j : NaN;
1787
+ if (r = g.HHMM.exec(e), r)
1788
+ return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), Z(t, n) ? t % 24 * j + n * we : NaN;
1789
+ if (r = g.HHMMSS.exec(e), r) {
1790
+ t = parseInt(r[1], 10), n = parseInt(r[2], 10);
1784
1791
  const a = parseFloat(r[3].replace(",", "."));
1785
- return Z(e, n, a) ? e % 24 * j + n * we + a * 1e3 : NaN;
1792
+ return Z(t, n, a) ? t % 24 * j + n * we + a * 1e3 : NaN;
1786
1793
  }
1787
1794
  return null;
1788
1795
  }
1789
- function _e(t, e, n) {
1790
- e = e || 0, n = n || 0;
1796
+ function _e(e, t, n) {
1797
+ t = t || 0, n = n || 0;
1791
1798
  const r = /* @__PURE__ */ new Date(0);
1792
- r.setUTCFullYear(t, 0, 4);
1793
- const a = r.getUTCDay() || 7, s = e * 7 + n + 1 - a;
1794
- return r.setUTCDate(r.getUTCDate() + s), r;
1799
+ r.setUTCFullYear(e, 0, 4);
1800
+ const a = r.getUTCDay() || 7, i = t * 7 + n + 1 - a;
1801
+ return r.setUTCDate(r.getUTCDate() + i), r;
1795
1802
  }
1796
1803
  const En = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Yn = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1797
- function Ee(t) {
1798
- return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
1804
+ function Ee(e) {
1805
+ return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
1799
1806
  }
1800
- function Te(t, e, n) {
1801
- if (e < 0 || e > 11)
1807
+ function Te(e, t, n) {
1808
+ if (t < 0 || t > 11)
1802
1809
  return !1;
1803
1810
  if (n != null) {
1804
1811
  if (n < 1)
1805
1812
  return !1;
1806
- const r = Ee(t);
1807
- if (r && n > Yn[e] || !r && n > En[e])
1813
+ const r = Ee(e);
1814
+ if (r && n > Yn[t] || !r && n > En[t])
1808
1815
  return !1;
1809
1816
  }
1810
1817
  return !0;
1811
1818
  }
1812
- function Pn(t, e) {
1813
- if (e < 1)
1819
+ function Pn(e, t) {
1820
+ if (t < 1)
1814
1821
  return !1;
1815
- const n = Ee(t);
1816
- return !(n && e > 366 || !n && e > 365);
1822
+ const n = Ee(e);
1823
+ return !(n && t > 366 || !n && t > 365);
1817
1824
  }
1818
- function De(t, e) {
1819
- return !(t < 0 || t > 52 || e != null && (e < 0 || e > 6));
1825
+ function De(e, t) {
1826
+ return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
1820
1827
  }
1821
- function Z(t, e, n) {
1822
- return !(t < 0 || t >= 25 || e != null && (e < 0 || e >= 60) || n != null && (n < 0 || n >= 60));
1828
+ function Z(e, t, n) {
1829
+ return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || n != null && (n < 0 || n >= 60));
1823
1830
  }
1824
1831
  const Rn = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
1825
- function In(t, e, n = {}) {
1826
- e = String(e);
1827
- const r = e.match(Rn);
1832
+ function In(e, t, n = {}) {
1833
+ t = String(t);
1834
+ const r = t.match(Rn);
1828
1835
  if (r) {
1829
- const a = q(n.originalDate || t, n);
1830
- e = r.reduce(function(s, i) {
1831
- if (i[0] === "'")
1832
- return s;
1833
- const o = s.indexOf(i), u = s[o - 1] === "'", l = s.replace(i, "'" + pn[i[0]](a, i, n) + "'");
1836
+ const a = L(n.originalDate || e, n);
1837
+ t = r.reduce(function(i, s) {
1838
+ if (s[0] === "'")
1839
+ return i;
1840
+ const o = i.indexOf(s), u = i[o - 1] === "'", l = i.replace(s, "'" + On[s[0]](a, s, n) + "'");
1834
1841
  return u ? l.substring(0, o - 1) + l.substring(o + 1) : l;
1835
- }, e);
1842
+ }, t);
1836
1843
  }
1837
- return Se(t, e, n);
1844
+ return Se(e, t, n);
1838
1845
  }
1839
- function Ye(t, e, n) {
1840
- t = q(t, n);
1841
- const r = F(e, t, !0), a = new Date(t.getTime() - r), s = /* @__PURE__ */ new Date(0);
1842
- return s.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), s.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), s;
1846
+ function Ye(e, t, n) {
1847
+ e = L(e, n);
1848
+ const r = H(t, e, !0), a = new Date(e.getTime() - r), i = /* @__PURE__ */ new Date(0);
1849
+ return i.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), i.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), i;
1843
1850
  }
1844
- function Wn(t, e, n, r) {
1851
+ function Wn(e, t, n, r) {
1845
1852
  return r = {
1846
1853
  ...r,
1847
- timeZone: e,
1848
- originalDate: t
1849
- }, In(Ye(t, e, { timeZone: r.timeZone }), n, r);
1850
- }
1851
- function Fn(t, e, n) {
1852
- if (typeof t == "string" && !t.match(Ne))
1853
- return q(t, { ...n, timeZone: e });
1854
- t = q(t, n);
1855
- const r = B(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()).getTime(), a = F(e, new Date(r));
1854
+ timeZone: t,
1855
+ originalDate: e
1856
+ }, In(Ye(e, t, { timeZone: r.timeZone }), n, r);
1857
+ }
1858
+ function Hn(e, t, n) {
1859
+ if (typeof e == "string" && !e.match(Ne))
1860
+ return L(e, { ...n, timeZone: t });
1861
+ e = L(e, n);
1862
+ const r = B(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), a = H(t, new Date(r));
1856
1863
  return new Date(r + a);
1857
1864
  }
1858
- function Pe(t, e) {
1859
- return -F(t, e);
1865
+ function Pe(e, t) {
1866
+ return -H(e, t);
1860
1867
  }
1861
- function lr(t) {
1862
- return Se(t, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
1868
+ function lr(e) {
1869
+ return Se(e, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
1863
1870
  }
1864
- function Me(t, e = {}) {
1865
- if (!t)
1866
- return t;
1867
- const n = e.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
1871
+ function Me(e, t = {}) {
1872
+ if (!e)
1873
+ return e;
1874
+ const n = t.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
1868
1875
  try {
1869
1876
  let r = "MMM dd, yyy hh:mm a";
1870
- e.short && (r = "MMM dd, yyy"), e.includeTZ && (r += " (z)");
1871
- const a = new Date(t);
1877
+ t.short && (r = "MMM dd, yyy"), t.includeTZ && (r += " (z)");
1878
+ const a = new Date(e);
1872
1879
  return Wn(a, n, r);
1873
1880
  } catch {
1874
- return console.error("Invalid value passed to formatTime", t), "(invalid date)";
1881
+ return console.error("Invalid value passed to formatTime", e), "(invalid date)";
1875
1882
  }
1876
1883
  }
1877
- function dr(t, e) {
1878
- return `${Me(t.getTime())} - ${Me(e.getTime(), { includeTZ: !0 })}`;
1884
+ function dr(e, t) {
1885
+ return `${Me(e.getTime())} - ${Me(t.getTime(), { includeTZ: !0 })}`;
1879
1886
  }
1880
- const U = {
1887
+ const q = {
1881
1888
  secondly: 1e3,
1889
+ tenSecondly: 10 * 1e3,
1890
+ thirtySecondly: 30 * 1e3,
1882
1891
  minutely: 60 * 1e3,
1892
+ fiveMinutely: 5 * 60 * 1e3,
1893
+ tenMinutely: 10 * 60 * 1e3,
1894
+ thirtyMinutely: 30 * 60 * 1e3,
1883
1895
  hourly: 60 * 60 * 1e3,
1896
+ twoHourly: 2 * 60 * 60 * 1e3,
1897
+ twelveHourly: 12 * 60 * 60 * 1e3,
1884
1898
  daily: 60 * 60 * 24 * 1e3,
1885
1899
  weekly: 60 * 60 * 24 * 7 * 1e3,
1886
1900
  trend: 0
1887
1901
  };
1888
- function fr(t, e) {
1889
- return t.map((n) => ({
1902
+ function fr(e, t) {
1903
+ return e.map((n) => ({
1890
1904
  value: n,
1891
- label: e.t(`configuration.vitals.reports.granularity.${n}`)
1905
+ label: t.t(`configuration.vitals.reports.granularity.${n}`)
1892
1906
  }));
1893
1907
  }
1894
- function Cn(t, e) {
1895
- return t ? {
1896
- duration: t,
1908
+ function Fn(e, t) {
1909
+ return {
1910
+ duration: e,
1897
1911
  type: "duration",
1898
- origin: e
1899
- } : null;
1912
+ origin: t
1913
+ };
1900
1914
  }
1901
- function mr(t) {
1902
- return t && He.find((n) => t <= U[n]) || null;
1915
+ function mr(e) {
1916
+ return e && Ce.find((n) => e <= q[n]) || null;
1903
1917
  }
1904
- function Re(t, e, n, r) {
1905
- const a = U[n];
1906
- let s = 0;
1907
- return a >= U.daily && (r ? s = -Pe(r, e) : s = e.getTimezoneOffset() * 60 * 1e3), new Date(t((e.getTime() - s) / a) * a + s);
1918
+ function Re(e, t, n, r) {
1919
+ const a = q[n];
1920
+ let i = 0;
1921
+ return a >= q.daily && (r ? i = -Pe(r, t) : i = t.getTimezoneOffset() * 60 * 1e3), new Date(e((t.getTime() - i) / a) * a + i);
1908
1922
  }
1909
- function Hn(t, e, n) {
1910
- return Re(Math.floor, t, e, n);
1923
+ function Cn(e, t, n) {
1924
+ return Re(Math.floor, e, t, n);
1911
1925
  }
1912
- function Ie(t, e, n) {
1913
- return Re(Math.ceil, t, e, n);
1926
+ function Ie(e, t, n) {
1927
+ return Re(Math.ceil, e, t, n);
1914
1928
  }
1915
- class z {
1916
- constructor(e, n) {
1917
- g(this, "timeframe");
1918
- g(this, "tz");
1919
- if (this.constructor === z)
1929
+ class U {
1930
+ constructor(t, n, r) {
1931
+ h(this, "timeframe");
1932
+ h(this, "tz");
1933
+ h(this, "dataGranularity");
1934
+ if (this.constructor === U)
1920
1935
  throw new Error("BaseQueryTime is not meant to be used directly.");
1921
- this.timeframe = e, this.tz = n;
1936
+ this.timeframe = t, this.tz = n, this.dataGranularity = r ?? t.dataGranularity;
1922
1937
  }
1923
- calculateStartDate(e, n, r = 1) {
1924
- if (e)
1938
+ calculateStartDate(t, n, r = 1) {
1939
+ if (t)
1925
1940
  return new Date(this.endDate().getTime() - this.timeframe.timeframeLengthMs() * r);
1926
1941
  {
1927
- const a = this.endDate(), s = this.timeframe.rawStart(this.tz), i = Hn(s, n, this.tz), u = (a.getTime() - i.getTime()) * (r - 1);
1928
- return new Date(i.getTime() - u);
1942
+ const a = this.endDate(), i = this.timeframe.rawStart(this.tz), s = Cn(i, n, this.tz), u = (a.getTime() - s.getTime()) * (r - 1);
1943
+ return new Date(s.getTime() - u);
1929
1944
  }
1930
1945
  }
1931
1946
  granularitySeconds() {
1932
1947
  return Math.floor(this.granularityMs() / 1e3);
1933
1948
  }
1934
1949
  granularityDruid() {
1935
- return Cn(this.granularityMs(), this.startDate().toISOString());
1950
+ return Fn(this.granularityMs(), this.startDate().toISOString());
1936
1951
  }
1937
1952
  // Return a UNIX timestamp suitable for use in the `start` query param.
1938
1953
  startSeconds() {
@@ -1951,11 +1966,17 @@ class z {
1951
1966
  return ue(this.endDate());
1952
1967
  }
1953
1968
  }
1954
- class hr extends z {
1955
- constructor(n, r, a) {
1956
- super(n, a);
1957
- g(this, "granularity");
1958
- r && n.allowedGranularities().has(r) ? this.granularity = r : this.granularity = n.defaultResponseGranularity;
1969
+ class hr extends U {
1970
+ constructor(n, r, a, i, s) {
1971
+ super(n, a, i);
1972
+ h(this, "granularity");
1973
+ if (r && n.allowedGranularities(s).has(r))
1974
+ this.granularity = r;
1975
+ else if (s) {
1976
+ const o = n.allowedGranularities(s).keys().next().value;
1977
+ this.granularity = o ?? n.defaultResponseGranularity;
1978
+ } else
1979
+ this.granularity = n.defaultResponseGranularity;
1959
1980
  }
1960
1981
  startDate() {
1961
1982
  return this.calculateStartDate(this.timeframe.isRelative, this.granularity);
@@ -1964,63 +1985,64 @@ class hr extends z {
1964
1985
  return Ie(this.timeframe.rawEnd(), this.granularity, this.tz);
1965
1986
  }
1966
1987
  granularityMs() {
1967
- return U[this.granularity];
1988
+ return q[this.granularity];
1968
1989
  }
1969
1990
  }
1970
- class Ln extends z {
1991
+ class Gn extends U {
1971
1992
  startDate() {
1972
- return this.calculateStartDate(this.timeframe.isRelative, this.timeframe.dataGranularity);
1993
+ return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity);
1973
1994
  }
1974
1995
  endDate() {
1975
- return Ie(this.timeframe.rawEnd(this.tz), this.timeframe.dataGranularity, this.tz);
1996
+ return Ie(this.timeframe.rawEnd(this.tz), this.dataGranularity, this.tz);
1976
1997
  }
1977
1998
  granularityMs() {
1978
1999
  return this.endDate().getTime() - this.startDate().getTime();
1979
2000
  }
1980
2001
  }
1981
- class gr extends Ln {
2002
+ class yr extends Gn {
1982
2003
  startDate() {
1983
- return this.calculateStartDate(this.timeframe.isRelative, this.timeframe.dataGranularity, 2);
2004
+ return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity, 2);
1984
2005
  }
1985
2006
  granularityMs() {
1986
2007
  return this.endDate().getTime() - super.startDate().getTime();
1987
2008
  }
1988
2009
  }
1989
- const Y = (t, e) => new Date(t.getTime() - Pe(e, t));
2010
+ const Y = (e, t) => new Date(e.getTime() - Pe(t, e));
1990
2011
  class T {
1991
- constructor(e) {
1992
- g(this, "timeframeText");
1993
- g(this, "key");
1994
- g(this, "display");
1995
- g(this, "timeframeLength");
1996
- g(this, "allowedTiers");
2012
+ constructor(t) {
2013
+ h(this, "timeframeText");
2014
+ h(this, "key");
2015
+ h(this, "display");
2016
+ h(this, "timeframeLength");
2017
+ h(this, "allowedTiers");
1997
2018
  // defaultResponseGranularity tracks which of the allowed granularities is picked for a given
1998
2019
  // timeframe if the user does not or cannot specify a granularity.
1999
- g(this, "defaultResponseGranularity");
2020
+ h(this, "defaultResponseGranularity");
2000
2021
  // dataGranularity tracks the granularity of the available data on the server for a specific timeframe.
2001
2022
  // As of writing, it's always the same as the default response granularity, but it may not always be.
2002
2023
  // It controls how timeframes are rounded to ensure complete time buckets from the server.
2003
- g(this, "dataGranularity");
2024
+ h(this, "dataGranularity");
2004
2025
  // isRelative impacts whether we take the `floor` or the `ceil` of the start time.
2005
2026
  // If the time range is relative, we want the ceil -- because we take the ceil of the
2006
2027
  // end time to make sure we're showing all the data we can for the last time bucket.
2007
2028
  // If the time range is absolute, we want the floor -- because otherwise we wouldn't be including
2008
2029
  // the first time bucket.
2009
- g(this, "isRelative");
2010
- g(this, "_startCustom");
2011
- g(this, "_endCustom");
2012
- this.display = e.display, this.timeframeText = e.timeframeText, this.key = e.key, this.timeframeLength = e.timeframeLength, this.allowedTiers = e.allowedTiers, this.defaultResponseGranularity = e.defaultResponseGranularity, this.dataGranularity = e.dataGranularity, this.isRelative = e.isRelative, this._startCustom = e.startCustom, this._endCustom = e.endCustom;
2030
+ h(this, "isRelative");
2031
+ h(this, "_startCustom");
2032
+ h(this, "_endCustom");
2033
+ h(this, "_allowedGranularitiesOverride");
2034
+ this.display = t.display, this.timeframeText = t.timeframeText, this.key = t.key, this.timeframeLength = t.timeframeLength, this.allowedTiers = t.allowedTiers, this.defaultResponseGranularity = t.defaultResponseGranularity, this.dataGranularity = t.dataGranularity, this.isRelative = t.isRelative, this._startCustom = t.startCustom, this._endCustom = t.endCustom, this._allowedGranularitiesOverride = t.allowedGranularitiesOverride;
2013
2035
  }
2014
2036
  // rawEnd does not consider granularity and should not be used directly in queries.
2015
2037
  // Use `new QueryTime(timeframe, granularity?).queryEndSeconds()` instead.
2016
2038
  // eslint-disable-next-line -- `tz` is required because it's used in subclasses.
2017
- rawEnd(e) {
2039
+ rawEnd(t) {
2018
2040
  return this._endCustom || /* @__PURE__ */ new Date();
2019
2041
  }
2020
2042
  // rawStart does not consider granularity and should not be used directly in queries.
2021
2043
  // Use `new QueryTime(timeframe, granularity?).queryStartSeconds()` instead.
2022
2044
  // eslint-disable-next-line -- `tz` is required because it's used in subclasses.
2023
- rawStart(e) {
2045
+ rawStart(t) {
2024
2046
  return this._startCustom || new Date(this.rawEnd().getTime() - this.timeframeLengthMs());
2025
2047
  }
2026
2048
  timeframeLengthMs() {
@@ -2029,71 +2051,73 @@ class T {
2029
2051
  maximumTimeframeLength() {
2030
2052
  return this.timeframeLength();
2031
2053
  }
2032
- allowedGranularities() {
2033
- const e = /* @__PURE__ */ new Set(), n = this.maximumTimeframeLength() / 3600;
2034
- return n <= 6 && e.add("minutely"), n >= 2 && n <= 7 * 24 && e.add("hourly"), n >= 2 * 24 && e.add("daily"), n >= 2 * 24 * 14 && e.add("weekly"), e;
2054
+ allowedGranularities(t) {
2055
+ if (this._allowedGranularitiesOverride && t)
2056
+ return new Set(this._allowedGranularitiesOverride);
2057
+ const n = /* @__PURE__ */ new Set(), r = this.maximumTimeframeLength() / 3600;
2058
+ return r <= 6 && n.add("minutely"), r >= 2 && r <= 7 * 24 && n.add("hourly"), r >= 2 * 24 && n.add("daily"), r >= 2 * 24 * 14 && n.add("weekly"), n;
2035
2059
  }
2036
2060
  cacheKey() {
2037
2061
  return this.key !== "custom" ? this.key : `${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`;
2038
2062
  }
2039
- v4Query(e) {
2063
+ v4Query(t) {
2040
2064
  return this.key === "custom" ? {
2041
2065
  type: "absolute",
2042
2066
  start: this.rawStart(),
2043
2067
  end: this.rawEnd(),
2044
- tz: e
2068
+ tz: t
2045
2069
  } : {
2046
2070
  type: "relative",
2047
2071
  time_range: this.key,
2048
- tz: e
2072
+ tz: t
2049
2073
  };
2050
2074
  }
2051
- tzAdjustedDate(e) {
2052
- if (!e)
2075
+ tzAdjustedDate(t) {
2076
+ if (!t)
2053
2077
  return /* @__PURE__ */ new Date();
2054
- const n = Fn(/* @__PURE__ */ new Date(), new Intl.DateTimeFormat().resolvedOptions().timeZone);
2055
- return Ye(n, e);
2078
+ const n = Hn(/* @__PURE__ */ new Date(), new Intl.DateTimeFormat().resolvedOptions().timeZone);
2079
+ return Ye(n, t);
2056
2080
  }
2057
2081
  }
2058
- class qn extends T {
2059
- rawStart(e) {
2060
- let n = O(this.tzAdjustedDate(e), { weekStartsOn: 1 });
2061
- return e && (n = Y(n, e)), n;
2082
+ class Ln extends T {
2083
+ rawStart(t) {
2084
+ let n = p(this.tzAdjustedDate(t), { weekStartsOn: 1 });
2085
+ return t && (n = Y(n, t)), n;
2062
2086
  }
2063
2087
  maximumTimeframeLength() {
2064
2088
  return 60 * 60 * 24 * 7;
2065
2089
  }
2066
2090
  }
2067
- class Un extends T {
2068
- rawStart(e) {
2069
- let n = E(this.tzAdjustedDate(e));
2070
- return e && (n = Y(n, e)), n;
2091
+ class qn extends T {
2092
+ rawStart(t) {
2093
+ let n = E(this.tzAdjustedDate(t));
2094
+ return t && (n = Y(n, t)), n;
2071
2095
  }
2072
2096
  maximumTimeframeLength() {
2073
2097
  return 60 * 60 * 24 * 31;
2074
2098
  }
2075
2099
  }
2076
- class zn extends T {
2077
- rawEnd(e) {
2078
- let n = O(this.tzAdjustedDate(e), { weekStartsOn: 1 });
2079
- return e && (n = Y(n, e)), n;
2100
+ class Un extends T {
2101
+ rawEnd(t) {
2102
+ let n = p(this.tzAdjustedDate(t), { weekStartsOn: 1 });
2103
+ return t && (n = Y(n, t)), n;
2080
2104
  }
2081
- rawStart(e) {
2082
- const n = this.tzAdjustedDate(e);
2083
- let r = O(n.setDate(n.getDate() - 7), {
2105
+ rawStart(t) {
2106
+ const n = this.tzAdjustedDate(t);
2107
+ let r = p(n.setDate(n.getDate() - 7), {
2084
2108
  weekStartsOn: 1
2085
2109
  });
2086
- return e && (r = Y(r, e)), r;
2110
+ return t && (r = Y(r, t)), r;
2087
2111
  }
2088
2112
  }
2089
- class Gn extends T {
2090
- rawEnd(e) {
2091
- let n = E(this.tzAdjustedDate(e));
2092
- return e && (n = Y(n, e)), n;
2113
+ class zn extends T {
2114
+ rawEnd(t) {
2115
+ let n = E(this.tzAdjustedDate(t));
2116
+ return t && (n = Y(n, t)), n;
2093
2117
  }
2094
- rawStart(e) {
2095
- let n = E(ke(this.tzAdjustedDate(e), 1));
2096
- return e && (n = Y(n, e)), n;
2118
+ rawStart(t) {
2119
+ let n = E(ke(this.tzAdjustedDate(t), 1));
2120
+ return t && (n = Y(n, t)), n;
2097
2121
  }
2098
2122
  }
2099
2123
  const An = /* @__PURE__ */ new Map([
@@ -2107,7 +2131,8 @@ const An = /* @__PURE__ */ new Map([
2107
2131
  defaultResponseGranularity: "minutely",
2108
2132
  dataGranularity: "minutely",
2109
2133
  isRelative: !0,
2110
- allowedTiers: ["free", "trial", "plus", "enterprise"]
2134
+ allowedTiers: ["free", "trial", "plus", "enterprise"],
2135
+ allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely"]
2111
2136
  })
2112
2137
  ],
2113
2138
  [
@@ -2120,7 +2145,8 @@ const An = /* @__PURE__ */ new Map([
2120
2145
  defaultResponseGranularity: "minutely",
2121
2146
  dataGranularity: "minutely",
2122
2147
  isRelative: !0,
2123
- allowedTiers: ["free", "trial", "plus", "enterprise"]
2148
+ allowedTiers: ["free", "trial", "plus", "enterprise"],
2149
+ allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely", "fiveMinutely", "tenMinutely"]
2124
2150
  })
2125
2151
  ],
2126
2152
  [
@@ -2133,7 +2159,8 @@ const An = /* @__PURE__ */ new Map([
2133
2159
  defaultResponseGranularity: "hourly",
2134
2160
  dataGranularity: "hourly",
2135
2161
  isRelative: !0,
2136
- allowedTiers: ["free", "trial", "plus", "enterprise"]
2162
+ allowedTiers: ["free", "trial", "plus", "enterprise"],
2163
+ allowedGranularitiesOverride: ["thirtySecondly", "minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely"]
2137
2164
  })
2138
2165
  ],
2139
2166
  [
@@ -2146,7 +2173,8 @@ const An = /* @__PURE__ */ new Map([
2146
2173
  defaultResponseGranularity: "hourly",
2147
2174
  dataGranularity: "hourly",
2148
2175
  isRelative: !0,
2149
- allowedTiers: ["free", "trial", "plus", "enterprise"]
2176
+ allowedTiers: ["free", "trial", "plus", "enterprise"],
2177
+ allowedGranularitiesOverride: ["minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
2150
2178
  })
2151
2179
  ],
2152
2180
  [
@@ -2159,7 +2187,8 @@ const An = /* @__PURE__ */ new Map([
2159
2187
  defaultResponseGranularity: "hourly",
2160
2188
  dataGranularity: "hourly",
2161
2189
  isRelative: !0,
2162
- allowedTiers: ["free", "trial", "plus", "enterprise"]
2190
+ allowedTiers: ["free", "trial", "plus", "enterprise"],
2191
+ allowedGranularitiesOverride: ["fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
2163
2192
  })
2164
2193
  ],
2165
2194
  [
@@ -2172,7 +2201,8 @@ const An = /* @__PURE__ */ new Map([
2172
2201
  defaultResponseGranularity: "daily",
2173
2202
  dataGranularity: "daily",
2174
2203
  isRelative: !0,
2175
- allowedTiers: ["trial", "plus", "enterprise"]
2204
+ allowedTiers: ["trial", "plus", "enterprise"],
2205
+ allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
2176
2206
  })
2177
2207
  ],
2178
2208
  [
@@ -2185,18 +2215,19 @@ const An = /* @__PURE__ */ new Map([
2185
2215
  defaultResponseGranularity: "daily",
2186
2216
  dataGranularity: "daily",
2187
2217
  isRelative: !0,
2188
- allowedTiers: ["trial", "plus", "enterprise"]
2218
+ allowedTiers: ["trial", "plus", "enterprise"],
2219
+ allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
2189
2220
  })
2190
2221
  ],
2191
2222
  [
2192
2223
  m.CURRENT_WEEK,
2193
- new qn({
2224
+ new Ln({
2194
2225
  key: m.CURRENT_WEEK,
2195
2226
  display: "This week",
2196
2227
  timeframeText: "Week",
2197
2228
  timeframeLength: () => {
2198
- const t = O(/* @__PURE__ */ new Date(), { weekStartsOn: 1 });
2199
- return (H(ne(/* @__PURE__ */ new Date(), 1)).getTime() - t.getTime()) / 1e3;
2229
+ const e = p(/* @__PURE__ */ new Date(), { weekStartsOn: 1 });
2230
+ return (C(ne(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
2200
2231
  },
2201
2232
  defaultResponseGranularity: "daily",
2202
2233
  dataGranularity: "daily",
@@ -2206,13 +2237,13 @@ const An = /* @__PURE__ */ new Map([
2206
2237
  ],
2207
2238
  [
2208
2239
  m.CURRENT_MONTH,
2209
- new Un({
2240
+ new qn({
2210
2241
  key: m.CURRENT_MONTH,
2211
2242
  display: "This month",
2212
2243
  timeframeText: "Month",
2213
2244
  timeframeLength: () => {
2214
- const t = E(/* @__PURE__ */ new Date());
2215
- return (H(ne(/* @__PURE__ */ new Date(), 1)).getTime() - t.getTime()) / 1e3;
2245
+ const e = E(/* @__PURE__ */ new Date());
2246
+ return (C(ne(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
2216
2247
  },
2217
2248
  defaultResponseGranularity: "daily",
2218
2249
  dataGranularity: "daily",
@@ -2222,7 +2253,7 @@ const An = /* @__PURE__ */ new Map([
2222
2253
  ],
2223
2254
  [
2224
2255
  m.PREVIOUS_WEEK,
2225
- new zn({
2256
+ new Un({
2226
2257
  key: m.PREVIOUS_WEEK,
2227
2258
  display: "Previous week",
2228
2259
  timeframeText: "Week",
@@ -2235,14 +2266,14 @@ const An = /* @__PURE__ */ new Map([
2235
2266
  ],
2236
2267
  [
2237
2268
  m.PREVIOUS_MONTH,
2238
- new Gn({
2269
+ new zn({
2239
2270
  key: m.PREVIOUS_MONTH,
2240
2271
  display: "Previous month",
2241
2272
  timeframeText: "Month",
2242
2273
  timeframeLength: () => {
2243
- let t = 0;
2244
- const e = E(/* @__PURE__ */ new Date()), n = E(ke(/* @__PURE__ */ new Date(), 1));
2245
- return e.getTimezoneOffset() !== n.getTimezoneOffset() && (t = Xn(e, n)), 60 * 60 * 24 * an((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1)) + on(t);
2274
+ let e = 0;
2275
+ const t = E(/* @__PURE__ */ new Date()), n = E(ke(/* @__PURE__ */ new Date(), 1));
2276
+ return t.getTimezoneOffset() !== n.getTimezoneOffset() && (e = Xn(t, n)), 60 * 60 * 24 * an((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1)) + on(e);
2246
2277
  },
2247
2278
  defaultResponseGranularity: "daily",
2248
2279
  dataGranularity: "daily",
@@ -2251,13 +2282,13 @@ const An = /* @__PURE__ */ new Map([
2251
2282
  })
2252
2283
  ]
2253
2284
  ]);
2254
- function yr(t) {
2255
- const e = new Date(t.start), n = new Date(t.end), r = (n.getTime() - e.getTime()) / 1e3;
2256
- return t.timePeriodsKey && An.get(t.timePeriodsKey) || new T({
2285
+ function gr(e) {
2286
+ const t = new Date(e.start), n = new Date(e.end), r = (n.getTime() - t.getTime()) / 1e3;
2287
+ return e.timePeriodsKey && An.get(e.timePeriodsKey) || new T({
2257
2288
  key: "custom",
2258
2289
  timeframeText: "custom",
2259
2290
  display: "custom",
2260
- startCustom: e,
2291
+ startCustom: t,
2261
2292
  endCustom: n,
2262
2293
  timeframeLength: () => r,
2263
2294
  defaultResponseGranularity: "daily",
@@ -2266,54 +2297,54 @@ function yr(t) {
2266
2297
  allowedTiers: ["free", "plus", "enterprise"]
2267
2298
  });
2268
2299
  }
2269
- function wr(t) {
2300
+ function wr(e) {
2270
2301
  return {
2271
- ...t.key !== "custom" && { timePeriodsKey: t.key },
2272
- start: t.rawStart(),
2273
- end: t.rawEnd()
2302
+ ...e.key !== "custom" && { timePeriodsKey: e.key },
2303
+ start: e.rawStart(),
2304
+ end: e.rawEnd()
2274
2305
  };
2275
2306
  }
2276
- function _r(t) {
2307
+ function _r(e) {
2277
2308
  return {
2278
- key: t.key,
2279
- display: t.display,
2280
- timeframeText: t.timeframeText,
2281
- timeframeLength: () => t.key,
2309
+ key: e.key,
2310
+ display: e.display,
2311
+ timeframeText: e.timeframeText,
2312
+ timeframeLength: () => e.key,
2282
2313
  // Used to generate test IDs for the Kongponent.
2283
- start: () => t.rawStart(),
2284
- end: () => t.rawEnd()
2314
+ start: () => e.rawStart(),
2315
+ end: () => e.rawEnd()
2285
2316
  };
2286
2317
  }
2287
- function Xn(t, e) {
2288
- return un(t.getTimezoneOffset() - e.getTimezoneOffset());
2318
+ function Xn(e, t) {
2319
+ return un(e.getTimezoneOffset() - t.getTimezoneOffset());
2289
2320
  }
2290
2321
  class J {
2291
- constructor(e) {
2292
- g(this, "_seed");
2293
- this._seed = e;
2322
+ constructor(t) {
2323
+ h(this, "_seed");
2324
+ this._seed = t;
2294
2325
  }
2295
- next(e, n) {
2326
+ next(t, n) {
2296
2327
  const r = Math.sin(this._seed++) * 1e4, a = r - Math.floor(r);
2297
- return Math.floor(a * (n - e + 1)) + e;
2328
+ return Math.floor(a * (n - t + 1)) + t;
2298
2329
  }
2299
2330
  }
2300
- const Tr = (t, e) => {
2301
- const n = We(10, 1e4), r = new J(n), a = Date.now() - 6 * 60 * 60 * 1e3, s = Date.now(), i = [];
2331
+ const Tr = (e, t) => {
2332
+ const n = We(10, 1e4), r = new J(n), a = Date.now() - 6 * 60 * 60 * 1e3, i = Date.now(), s = [];
2302
2333
  let o = 0;
2303
- for (let c = a; c <= s; c += 60 * 60 * 1e3)
2304
- if (e)
2305
- for (const d in e)
2306
- e[d].forEach((b) => {
2334
+ for (let c = a; c <= i; c += 60 * 60 * 1e3)
2335
+ if (t)
2336
+ for (const d in t)
2337
+ t[d].forEach((b) => {
2307
2338
  o += r.next(50, 500);
2308
2339
  const M = {
2309
2340
  [d]: b,
2310
- [t.name]: o
2311
- }, p = {
2341
+ [e.name]: o
2342
+ }, O = {
2312
2343
  version: "1.0",
2313
2344
  timestamp: new Date(c).toISOString(),
2314
2345
  event: M
2315
2346
  };
2316
- i.push(p);
2347
+ s.push(O);
2317
2348
  });
2318
2349
  else {
2319
2350
  o += r.next(50, 500);
@@ -2321,15 +2352,15 @@ const Tr = (t, e) => {
2321
2352
  version: "1.0",
2322
2353
  timestamp: new Date(c).toISOString(),
2323
2354
  event: {
2324
- [t.name]: o
2355
+ [e.name]: o
2325
2356
  }
2326
2357
  };
2327
- i.push(d);
2358
+ s.push(d);
2328
2359
  }
2329
2360
  const u = {};
2330
- if (e)
2331
- for (const c in e)
2332
- u[c] = {}, e[c].forEach((d) => {
2361
+ if (t)
2362
+ for (const c in t)
2363
+ u[c] = {}, t[c].forEach((d) => {
2333
2364
  u[c][d] = {
2334
2365
  name: d,
2335
2366
  deleted: !1
@@ -2337,57 +2368,57 @@ const Tr = (t, e) => {
2337
2368
  });
2338
2369
  const l = {
2339
2370
  start_ms: a,
2340
- end_ms: s,
2371
+ end_ms: i,
2341
2372
  query_id: "12345",
2342
- metric_names: [t.name],
2373
+ metric_names: [e.name],
2343
2374
  metric_units: {
2344
- [t.name]: t.unit
2375
+ [e.name]: e.unit
2345
2376
  },
2346
2377
  granularity_ms: 60 * 60 * 1e3,
2347
2378
  // 1 hour in ms
2348
2379
  display: u
2349
2380
  };
2350
2381
  return {
2351
- data: i,
2382
+ data: s,
2352
2383
  meta: l
2353
2384
  };
2354
- }, Dr = (t) => {
2355
- const e = We(10, 1e4), n = new J(e), r = Date.now() - 6 * 60 * 60 * 1e3, a = Date.now(), s = [], i = {};
2356
- t.forEach((u) => {
2357
- i[u.name] = 0;
2385
+ }, Dr = (e) => {
2386
+ const t = We(10, 1e4), n = new J(t), r = Date.now() - 6 * 60 * 60 * 1e3, a = Date.now(), i = [], s = {};
2387
+ e.forEach((u) => {
2388
+ s[u.name] = 0;
2358
2389
  });
2359
2390
  for (let u = r; u <= a; u += 60 * 60 * 1e3) {
2360
2391
  const l = {};
2361
- t.forEach((d) => {
2362
- i[d.name] += n.next(50, 500), l[d.name] = i[d.name];
2392
+ e.forEach((d) => {
2393
+ s[d.name] += n.next(50, 500), l[d.name] = s[d.name];
2363
2394
  });
2364
2395
  const c = {
2365
2396
  version: "1.0",
2366
2397
  timestamp: new Date(u).toISOString(),
2367
2398
  event: l
2368
2399
  };
2369
- s.push(c);
2400
+ i.push(c);
2370
2401
  }
2371
2402
  const o = {
2372
2403
  start_ms: r,
2373
2404
  end_ms: a,
2374
2405
  query_id: "12345",
2375
- metric_names: t.map((u) => u.name),
2376
- metric_units: t.reduce((u, l) => (u[l.name] = l.unit, u), {}),
2406
+ metric_names: e.map((u) => u.name),
2407
+ metric_units: e.reduce((u, l) => (u[l.name] = l.unit, u), {}),
2377
2408
  granularity_ms: 60 * 60 * 1e3,
2378
2409
  // 1 hour in ms
2379
2410
  display: {}
2380
2411
  };
2381
2412
  return {
2382
- data: s,
2413
+ data: i,
2383
2414
  meta: o
2384
2415
  };
2385
- }, Mr = (t, e) => {
2386
- const n = Math.floor(Math.random() * 9991) + 10, r = new J(n), a = Date.now() - 6 * 60 * 60 * 1e3, s = Date.now(), i = new Date((a + s) / 2).toISOString(), o = [];
2387
- if (e) {
2388
- const c = Object.keys(e), d = Object.values(e), b = (M, p) => {
2389
- if (p === c.length) {
2390
- t.forEach((S) => {
2416
+ }, Mr = (e, t) => {
2417
+ const n = Math.floor(Math.random() * 9991) + 10, r = new J(n), a = Date.now() - 6 * 60 * 60 * 1e3, i = Date.now(), s = new Date((a + i) / 2).toISOString(), o = [];
2418
+ if (t) {
2419
+ const c = Object.keys(t), d = Object.values(t), b = (M, O) => {
2420
+ if (O === c.length) {
2421
+ e.forEach((S) => {
2391
2422
  M[S.name] = r.next(50, 500);
2392
2423
  }), o.push({
2393
2424
  version: "1.0",
@@ -2396,25 +2427,25 @@ const Tr = (t, e) => {
2396
2427
  });
2397
2428
  return;
2398
2429
  }
2399
- d[p].forEach((S) => {
2400
- b({ ...M, [c[p]]: S }, p + 1);
2430
+ d[O].forEach((S) => {
2431
+ b({ ...M, [c[O]]: S }, O + 1);
2401
2432
  });
2402
2433
  };
2403
2434
  b({}, 0);
2404
2435
  } else {
2405
2436
  const c = {};
2406
- t.forEach((d) => {
2437
+ e.forEach((d) => {
2407
2438
  c[d.name] = r.next(50, 500);
2408
2439
  }), o.push({
2409
2440
  version: "1.0",
2410
- timestamp: i,
2441
+ timestamp: s,
2411
2442
  event: c
2412
2443
  });
2413
2444
  }
2414
2445
  const u = {};
2415
- if (e)
2416
- for (const c in e)
2417
- u[c] = {}, e[c].forEach((d) => {
2446
+ if (t)
2447
+ for (const c in t)
2448
+ u[c] = {}, t[c].forEach((d) => {
2418
2449
  u[c][d] = {
2419
2450
  name: d,
2420
2451
  deleted: !1
@@ -2422,48 +2453,48 @@ const Tr = (t, e) => {
2422
2453
  });
2423
2454
  const l = {
2424
2455
  start_ms: a,
2425
- end_ms: s,
2456
+ end_ms: i,
2426
2457
  query_id: "12345",
2427
- metric_names: t.map((c) => c.name),
2428
- metric_units: t.reduce((c, d) => (c[d.name] = d.unit, c), {}),
2458
+ metric_names: e.map((c) => c.name),
2459
+ metric_units: e.reduce((c, d) => (c[d.name] = d.unit, c), {}),
2429
2460
  truncated: !1,
2430
2461
  limit: 50,
2431
2462
  display: u,
2432
- granularity_ms: s - a
2463
+ granularity_ms: i - a
2433
2464
  };
2434
2465
  return {
2435
2466
  data: o,
2436
2467
  meta: l
2437
2468
  };
2438
2469
  };
2439
- function We(t, e) {
2440
- return t = Math.ceil(t), e = Math.floor(e), Math.floor(Math.random() * (e - t + 1) + t);
2470
+ function We(e, t) {
2471
+ return e = Math.ceil(e), t = Math.floor(t), Math.floor(Math.random() * (t - e + 1) + e);
2441
2472
  }
2442
2473
  export {
2443
- gr as DeltaQueryTime,
2444
- U as Granularities,
2474
+ yr as DeltaQueryTime,
2475
+ q as Granularities,
2445
2476
  Vn as REFRESH_INTERVAL_MS,
2446
2477
  J as SeededRandom,
2447
2478
  An as TimePeriods,
2448
2479
  T as Timeframe,
2449
2480
  m as TimeframeKeys,
2450
2481
  hr as TimeseriesQueryTime,
2451
- Ln as UnaryQueryTime,
2482
+ Gn as UnaryQueryTime,
2452
2483
  rr as aiExploreAggregations,
2453
- qe as basicExploreAggregations,
2484
+ Le as basicExploreAggregations,
2454
2485
  Ie as ceilToNearestTimeGrain,
2455
2486
  je as datasourceToFilterableDimensions,
2456
- yr as datePickerSelectionToTimeframe,
2487
+ gr as datePickerSelectionToTimeframe,
2457
2488
  Xn as dstOffsetHours,
2458
2489
  nr as exploreAggregations,
2459
2490
  Zn as exploreFilterTypesV2,
2460
2491
  Ae as filterableAiExploreDimensions,
2461
- Le as filterableBasicExploreDimensions,
2462
- ze as filterableExploreDimensions,
2492
+ Ge as filterableBasicExploreDimensions,
2493
+ Ue as filterableExploreDimensions,
2463
2494
  ar as filterableRequestDimensions,
2464
- ir as filterableRequestMetrics,
2465
- sr as filterableRequestWildcardDimensions,
2466
- Hn as floorToNearestTimeGrain,
2495
+ sr as filterableRequestMetrics,
2496
+ ir as filterableRequestWildcardDimensions,
2497
+ Cn as floorToNearestTimeGrain,
2467
2498
  lr as formatISOTimeWithTZ,
2468
2499
  Me as formatTime,
2469
2500
  dr as formatTimeRange,
@@ -2471,13 +2502,13 @@ export {
2471
2502
  Dr as generateMultipleMetricTimeSeriesData,
2472
2503
  Tr as generateSingleMetricTimeSeriesData,
2473
2504
  fr as granularitiesToOptions,
2474
- Cn as granularityMsToQuery,
2475
- He as granularityValues,
2505
+ Fn as granularityMsToQuery,
2506
+ Ce as granularityValues,
2476
2507
  mr as msToGranularity,
2477
2508
  ur as queryDatasources,
2478
- Ge as queryableAiExploreDimensions,
2509
+ ze as queryableAiExploreDimensions,
2479
2510
  be as queryableBasicExploreDimensions,
2480
- Ue as queryableExploreDimensions,
2511
+ qe as queryableExploreDimensions,
2481
2512
  Xe as queryableRequestDimensions,
2482
2513
  Ve as queryableRequestMetrics,
2483
2514
  $e as queryableRequestWildcardDimensions,