@kong-ui-public/analytics-utilities 9.9.1-pr.2198.4eddb2429.0 → 9.9.1-pr.2221.a8c1dbd25.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.
Files changed (77) hide show
  1. package/dist/types/constants.d.ts +2 -0
  2. package/dist/types/constants.d.ts.map +1 -0
  3. package/dist/types/dashboardSchema.d.ts +2978 -0
  4. package/dist/types/dashboardSchema.d.ts.map +1 -0
  5. package/dist/types/dashboardSchema.v2.d.ts +2972 -0
  6. package/dist/types/dashboardSchema.v2.d.ts.map +1 -0
  7. package/dist/types/format.d.ts +15 -0
  8. package/dist/types/format.d.ts.map +1 -0
  9. package/dist/types/format.spec.tz.d.ts +2 -0
  10. package/dist/types/format.spec.tz.d.ts.map +1 -0
  11. package/dist/types/granularity.d.ts +27 -0
  12. package/dist/types/granularity.d.ts.map +1 -0
  13. package/dist/types/index.d.ts +10 -0
  14. package/dist/types/index.d.ts.map +1 -0
  15. package/dist/types/queryTime.d.ts +36 -0
  16. package/dist/types/queryTime.d.ts.map +1 -0
  17. package/dist/types/queryTime.spec.tz.d.ts +2 -0
  18. package/dist/types/queryTime.spec.tz.d.ts.map +1 -0
  19. package/dist/types/specUtils.d.ts +3 -0
  20. package/dist/types/specUtils.d.ts.map +1 -0
  21. package/dist/types/timeframes.d.ts +33 -0
  22. package/dist/types/timeframes.d.ts.map +1 -0
  23. package/dist/types/types/analytics-config.d.ts +23 -0
  24. package/dist/types/types/analytics-config.d.ts.map +1 -0
  25. package/dist/types/types/chart-types.d.ts +3 -0
  26. package/dist/types/types/chart-types.d.ts.map +1 -0
  27. package/dist/types/types/datepicker-selection.d.ts +6 -0
  28. package/dist/types/types/datepicker-selection.d.ts.map +1 -0
  29. package/dist/types/types/druid-granularity.d.ts +6 -0
  30. package/dist/types/types/druid-granularity.d.ts.map +1 -0
  31. package/dist/types/types/explore/advanced.d.ts +20 -0
  32. package/dist/types/types/explore/advanced.d.ts.map +1 -0
  33. package/dist/types/types/explore/ai.d.ts +20 -0
  34. package/dist/types/types/explore/ai.d.ts.map +1 -0
  35. package/dist/types/types/explore/all.d.ts +15 -0
  36. package/dist/types/types/explore/all.d.ts.map +1 -0
  37. package/dist/types/types/explore/basic.d.ts +31 -0
  38. package/dist/types/types/explore/basic.d.ts.map +1 -0
  39. package/dist/types/types/explore/common.d.ts +34 -0
  40. package/dist/types/types/explore/common.d.ts.map +1 -0
  41. package/dist/types/types/explore/index.d.ts +8 -0
  42. package/dist/types/types/explore/index.d.ts.map +1 -0
  43. package/dist/types/types/explore/requests.d.ts +57 -0
  44. package/dist/types/types/explore/requests.d.ts.map +1 -0
  45. package/dist/types/types/explore/result.d.ts +48 -0
  46. package/dist/types/types/explore/result.d.ts.map +1 -0
  47. package/dist/types/types/explore/util.d.ts +8 -0
  48. package/dist/types/types/explore/util.d.ts.map +1 -0
  49. package/dist/types/types/index.d.ts +12 -0
  50. package/dist/types/types/index.d.ts.map +1 -0
  51. package/dist/types/types/query-bridge.d.ts +24 -0
  52. package/dist/types/types/query-bridge.d.ts.map +1 -0
  53. package/dist/types/types/query-time.d.ts +13 -0
  54. package/dist/types/types/query-time.d.ts.map +1 -0
  55. package/dist/types/types/time-period.d.ts +9 -0
  56. package/dist/types/types/time-period.d.ts.map +1 -0
  57. package/dist/types/types/timeframe-keys.d.ts +16 -0
  58. package/dist/types/types/timeframe-keys.d.ts.map +1 -0
  59. package/dist/types/types/timeframe-options.d.ts +16 -0
  60. package/dist/types/types/timeframe-options.d.ts.map +1 -0
  61. package/dist/types/types/timeframe.d.ts +17 -0
  62. package/dist/types/types/timeframe.d.ts.map +1 -0
  63. package/dist/types/utils/SeedRandom.d.ts +6 -0
  64. package/dist/types/utils/SeedRandom.d.ts.map +1 -0
  65. package/dist/types/utils/chartDataGenerator.d.ts +9 -0
  66. package/dist/types/utils/chartDataGenerator.d.ts.map +1 -0
  67. package/dist/types/utils/helpers.d.ts +2 -0
  68. package/dist/types/utils/helpers.d.ts.map +1 -0
  69. package/dist/types/utils/index.d.ts +4 -0
  70. package/dist/types/utils/index.d.ts.map +1 -0
  71. package/dist/vitals-utilities.cjs +2 -0
  72. package/dist/vitals-utilities.cjs.map +1 -0
  73. package/dist/vitals-utilities.es.js +3974 -0
  74. package/dist/vitals-utilities.es.js.map +1 -0
  75. package/dist/vitals-utilities.umd.js +2 -0
  76. package/dist/vitals-utilities.umd.js.map +1 -0
  77. package/package.json +1 -1
@@ -0,0 +1,3974 @@
1
+ var _a = Object.defineProperty;
2
+ var wa = (e, t, r) => t in e ? _a(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var b = (e, t, r) => wa(e, typeof t != "symbol" ? t + "" : t, r);
4
+ const zs = 3e4;
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
+ const $s = [
7
+ "horizontal_bar",
8
+ "vertical_bar",
9
+ "timeseries_line",
10
+ "choropleth_map",
11
+ "timeseries_bar",
12
+ "donut",
13
+ "single_value"
14
+ ], lr = ["in", "not_in", "selector"], Vs = ["=", "!="], Xs = ["=", "!=", "<", ">", "<=", ">="], dr = ["empty", "not_empty"], Qs = ["starts_with", "ends_with"], Zs = ["absolute", "relative"], fr = [
15
+ "15m",
16
+ "1h",
17
+ "6h",
18
+ "12h",
19
+ "24h",
20
+ "7d",
21
+ "current_week",
22
+ "previous_week",
23
+ "30d",
24
+ "current_month",
25
+ "previous_month"
26
+ ], Ze = [
27
+ "secondly",
28
+ "tenSecondly",
29
+ "thirtySecondly",
30
+ "minutely",
31
+ "fiveMinutely",
32
+ "tenMinutely",
33
+ "thirtyMinutely",
34
+ "hourly",
35
+ "twoHourly",
36
+ "twelveHourly",
37
+ "daily",
38
+ "weekly",
39
+ "trend"
40
+ ], se = (e) => e.filter((t) => t !== "time"), Ee = [
41
+ "api",
42
+ "api_product",
43
+ "api_product_version",
44
+ "control_plane",
45
+ "control_plane_group",
46
+ "data_plane_node",
47
+ "gateway_service",
48
+ "portal",
49
+ "route",
50
+ "status_code",
51
+ "status_code_grouped",
52
+ "time"
53
+ ], oe = se(Ee), Be = [
54
+ "active_services",
55
+ "request_count",
56
+ "request_per_minute",
57
+ "response_latency_average"
58
+ ], Ke = [
59
+ ...Ee,
60
+ "application",
61
+ "consumer",
62
+ "country_code",
63
+ "iso_code",
64
+ "upstream_status_code",
65
+ "upstream_status_code_grouped",
66
+ "response_source",
67
+ "data_plane_node_version",
68
+ "realm"
69
+ ], ue = se(Ke), hr = [
70
+ ...Be,
71
+ "response_latency_p99",
72
+ "response_latency_p95",
73
+ "response_latency_p50",
74
+ "upstream_latency_p99",
75
+ "upstream_latency_p95",
76
+ "upstream_latency_p50",
77
+ "upstream_latency_average",
78
+ "kong_latency_p99",
79
+ "kong_latency_p95",
80
+ "kong_latency_p50",
81
+ "kong_latency_average",
82
+ "response_size_p99",
83
+ "response_size_p95",
84
+ "response_size_p50",
85
+ "response_size_average",
86
+ "response_size_sum",
87
+ "request_size_p99",
88
+ "request_size_p95",
89
+ "request_size_p50",
90
+ "request_size_average",
91
+ "request_size_sum"
92
+ ], Je = [
93
+ "control_plane",
94
+ "control_plane_group",
95
+ "gateway_service",
96
+ "consumer",
97
+ "application",
98
+ "route",
99
+ "ai_provider",
100
+ "ai_response_model",
101
+ "ai_request_model",
102
+ "llm_cache_status",
103
+ "llm_embeddings_provider",
104
+ "llm_embeddings_model",
105
+ "time",
106
+ "realm",
107
+ "status_code",
108
+ "status_code_grouped",
109
+ "ai_plugin"
110
+ ], ce = se(Je), mr = [
111
+ "total_tokens",
112
+ "prompt_tokens",
113
+ "completion_tokens",
114
+ "ai_request_count",
115
+ "cost",
116
+ "llm_cache_embeddings_latency_average",
117
+ "llm_cache_fetch_latency_average",
118
+ "llm_latency_average",
119
+ "llm_embeddings_tokens",
120
+ "llm_embeddings_cost"
121
+ ], ba = [
122
+ "api",
123
+ "api_product",
124
+ "api_product_version",
125
+ "application",
126
+ "auth_type",
127
+ "client_ip",
128
+ "consumer",
129
+ "consumer_group",
130
+ "control_plane",
131
+ "control_plane_group",
132
+ "country_code",
133
+ "data_plane_node",
134
+ "data_plane_node_version",
135
+ "gateway_service",
136
+ "header_host",
137
+ "header_user_agent",
138
+ "http_method",
139
+ "iso_code",
140
+ "portal",
141
+ "realm",
142
+ "request_id",
143
+ "request_uri",
144
+ "response_header_content_type",
145
+ "response_source",
146
+ "route",
147
+ "service_port",
148
+ "service_protocol",
149
+ "sse",
150
+ "status_code_grouped",
151
+ "time",
152
+ "trace_id",
153
+ "upstream_uri",
154
+ "upstream_status_code_grouped",
155
+ "websocket"
156
+ ], Bs = se(ba), Ta = [
157
+ "auth_type",
158
+ "client_ip",
159
+ "country_code",
160
+ "data_plane_node_version",
161
+ "header_host",
162
+ "header_user_agent",
163
+ "http_method",
164
+ "request_id",
165
+ "request_uri",
166
+ "response_header_content_type",
167
+ "response_source",
168
+ "service_port",
169
+ "service_protocol",
170
+ "trace_id",
171
+ "upstream_uri"
172
+ ], Ks = Ta, Da = [
173
+ "ai_count",
174
+ "latencies_response_ms",
175
+ "latencies_upstream_ms",
176
+ "latencies_kong_gateway_ms",
177
+ "request_body_size",
178
+ "response_body_size",
179
+ "response_header_content_length",
180
+ "status_code",
181
+ "upstream_status_code"
182
+ ], Js = se(Da), eo = [
183
+ "15M",
184
+ "1H",
185
+ "6H",
186
+ "12H",
187
+ "24H",
188
+ "7D"
189
+ ], to = ["basic", "api_usage", "llm_usage"], Oa = {
190
+ basic: new Set(oe),
191
+ api_usage: new Set(ue),
192
+ llm_usage: new Set(ce)
193
+ }, ro = (e, t) => t.filter((r) => Oa[e].has(r.field)), Sa = [
194
+ "horizontal_bar",
195
+ "vertical_bar",
196
+ "gauge",
197
+ "donut",
198
+ "timeseries_line",
199
+ "timeseries_bar",
200
+ "golden_signals",
201
+ "top_n",
202
+ "slottable",
203
+ "single_value"
204
+ ], le = {
205
+ type: "string"
206
+ }, $ = {
207
+ type: "string"
208
+ }, yr = {
209
+ type: "boolean"
210
+ }, pr = {
211
+ type: ["object", "array"],
212
+ items: {
213
+ type: "string"
214
+ },
215
+ additionalProperties: {
216
+ type: "string"
217
+ }
218
+ }, gr = {
219
+ type: "object",
220
+ properties: {
221
+ type: {
222
+ type: "string",
223
+ enum: ["slottable"]
224
+ },
225
+ id: {
226
+ type: "string"
227
+ }
228
+ },
229
+ required: ["type", "id"],
230
+ additionalProperties: !1
231
+ }, _r = {
232
+ type: "object",
233
+ properties: {
234
+ type: {
235
+ type: "string",
236
+ enum: ["horizontal_bar", "vertical_bar"]
237
+ },
238
+ stacked: {
239
+ type: "boolean"
240
+ },
241
+ chartDatasetColors: pr,
242
+ syntheticsDataKey: le,
243
+ chartTitle: $,
244
+ allowCsvExport: yr
245
+ },
246
+ required: ["type"],
247
+ additionalProperties: !1
248
+ }, wr = {
249
+ type: "object",
250
+ properties: {
251
+ type: {
252
+ type: "string",
253
+ enum: ["timeseries_line", "timeseries_bar"]
254
+ },
255
+ stacked: {
256
+ type: "boolean"
257
+ },
258
+ threshold: {
259
+ type: "object",
260
+ additionalProperties: {
261
+ type: "number"
262
+ }
263
+ },
264
+ chartDatasetColors: pr,
265
+ syntheticsDataKey: le,
266
+ chartTitle: $,
267
+ allowCsvExport: yr
268
+ },
269
+ required: ["type"],
270
+ additionalProperties: !1
271
+ }, br = {
272
+ type: "object",
273
+ properties: {
274
+ type: {
275
+ type: "string",
276
+ enum: ["gauge"]
277
+ },
278
+ metricDisplay: {
279
+ type: "string",
280
+ enum: ["hidden", "single", "full"]
281
+ // This matches the SimpleChartMetricDisplay type.
282
+ },
283
+ reverseDataset: {
284
+ type: "boolean"
285
+ },
286
+ numerator: {
287
+ type: "number"
288
+ },
289
+ syntheticsDataKey: le,
290
+ chartTitle: $
291
+ },
292
+ required: ["type"],
293
+ additionalProperties: !1
294
+ }, Tr = {
295
+ type: "object",
296
+ properties: {
297
+ type: {
298
+ type: "string",
299
+ enum: ["donut"]
300
+ },
301
+ syntheticsDataKey: le,
302
+ chartTitle: $
303
+ },
304
+ required: ["type"],
305
+ additionalProperties: !1
306
+ }, Dr = {
307
+ type: "object",
308
+ properties: {
309
+ chartTitle: $,
310
+ syntheticsDataKey: le,
311
+ type: {
312
+ type: "string",
313
+ enum: ["top_n"]
314
+ },
315
+ description: {
316
+ type: "string"
317
+ },
318
+ entityLink: {
319
+ type: "string"
320
+ }
321
+ },
322
+ required: ["type"],
323
+ additionalProperties: !1
324
+ }, Or = {
325
+ type: "object",
326
+ properties: {
327
+ chartTitle: $,
328
+ type: {
329
+ type: "string",
330
+ enum: ["golden_signals"]
331
+ },
332
+ longCardTitles: {
333
+ type: "boolean"
334
+ },
335
+ description: {
336
+ type: "string"
337
+ },
338
+ percentileLatency: {
339
+ type: "boolean"
340
+ }
341
+ },
342
+ required: ["type"],
343
+ additionalProperties: !1
344
+ }, Sr = {
345
+ type: "object",
346
+ properties: {
347
+ type: {
348
+ type: "string",
349
+ enum: ["single_value"]
350
+ },
351
+ decimalPoints: {
352
+ type: "number"
353
+ },
354
+ chartTitle: $
355
+ },
356
+ required: ["type"],
357
+ additionalProperties: !1
358
+ }, Ma = {
359
+ type: "object",
360
+ properties: {
361
+ tz: {
362
+ type: "string",
363
+ default: "Etc/UTC"
364
+ },
365
+ type: {
366
+ type: "string",
367
+ enum: [
368
+ "relative"
369
+ ]
370
+ },
371
+ time_range: {
372
+ type: "string",
373
+ enum: fr,
374
+ default: "1h"
375
+ }
376
+ },
377
+ required: [
378
+ "type",
379
+ "time_range"
380
+ ],
381
+ additionalProperties: !1
382
+ }, va = {
383
+ type: "object",
384
+ description: "A duration representing an exact start and end time.",
385
+ properties: {
386
+ tz: {
387
+ type: "string"
388
+ },
389
+ type: {
390
+ type: "string",
391
+ enum: [
392
+ "absolute"
393
+ ]
394
+ },
395
+ start: {
396
+ type: "string"
397
+ },
398
+ end: {
399
+ type: "string"
400
+ }
401
+ },
402
+ required: [
403
+ "type",
404
+ "start",
405
+ "end"
406
+ ],
407
+ additionalProperties: !1
408
+ }, et = {
409
+ granularity: {
410
+ type: "string",
411
+ description: 'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',
412
+ enum: Ze
413
+ },
414
+ time_range: {
415
+ type: "object",
416
+ description: "The time range to query.",
417
+ anyOf: [
418
+ Ma,
419
+ va
420
+ ],
421
+ default: {
422
+ type: "relative",
423
+ time_range: "1h"
424
+ }
425
+ },
426
+ limit: {
427
+ type: "number"
428
+ },
429
+ meta: {
430
+ type: "object"
431
+ }
432
+ }, tt = (e) => ({
433
+ type: "array",
434
+ description: "List of aggregated metrics to collect across the requested time span.",
435
+ items: {
436
+ type: "string",
437
+ enum: e
438
+ }
439
+ }), rt = (e) => ({
440
+ type: "array",
441
+ description: "List of attributes or entity types to group by.",
442
+ minItems: 0,
443
+ maxItems: 2,
444
+ items: {
445
+ type: "string",
446
+ enum: e
447
+ }
448
+ }), Pe = (e) => ({
449
+ type: "array",
450
+ description: "A list of filters to apply to the query",
451
+ items: {
452
+ oneOf: [
453
+ {
454
+ type: "object",
455
+ description: "In filter",
456
+ properties: {
457
+ field: {
458
+ type: "string",
459
+ enum: e
460
+ },
461
+ operator: {
462
+ type: "string",
463
+ enum: lr
464
+ },
465
+ value: {
466
+ type: "array",
467
+ items: {
468
+ type: ["string", "number", "null"]
469
+ }
470
+ }
471
+ },
472
+ required: [
473
+ "field",
474
+ "operator",
475
+ "value"
476
+ ],
477
+ additionalProperties: !1
478
+ },
479
+ {
480
+ type: "object",
481
+ description: "Empty filter",
482
+ properties: {
483
+ field: {
484
+ type: "string",
485
+ enum: e
486
+ },
487
+ operator: {
488
+ type: "string",
489
+ enum: dr
490
+ }
491
+ },
492
+ required: [
493
+ "field",
494
+ "operator"
495
+ ],
496
+ additionalProperties: !1
497
+ }
498
+ ]
499
+ }
500
+ }), Mr = {
501
+ type: "object",
502
+ description: "A query to launch at the advanced explore API",
503
+ properties: {
504
+ datasource: {
505
+ type: "string",
506
+ enum: [
507
+ "advanced"
508
+ ]
509
+ },
510
+ metrics: tt(hr),
511
+ dimensions: rt(Ke),
512
+ filters: Pe(ue),
513
+ ...et
514
+ },
515
+ required: ["datasource"],
516
+ additionalProperties: !1
517
+ }, vr = {
518
+ type: "object",
519
+ description: "A query to launch at the basic explore API",
520
+ properties: {
521
+ datasource: {
522
+ type: "string",
523
+ enum: [
524
+ "basic"
525
+ ]
526
+ },
527
+ metrics: tt(Be),
528
+ dimensions: rt(Ee),
529
+ filters: Pe(oe),
530
+ ...et
531
+ },
532
+ required: ["datasource"],
533
+ additionalProperties: !1
534
+ }, xr = {
535
+ type: "object",
536
+ description: "A query to launch at the AI explore API",
537
+ properties: {
538
+ datasource: {
539
+ type: "string",
540
+ enum: [
541
+ "ai"
542
+ ]
543
+ },
544
+ metrics: tt(mr),
545
+ dimensions: rt(Je),
546
+ filters: Pe(ce),
547
+ ...et
548
+ },
549
+ required: ["datasource"],
550
+ additionalProperties: !1
551
+ }, Er = {
552
+ anyOf: [Mr, vr, xr]
553
+ }, Pr = {
554
+ type: "object",
555
+ properties: {
556
+ query: Er,
557
+ chart: {
558
+ anyOf: [
559
+ _r,
560
+ br,
561
+ Tr,
562
+ wr,
563
+ Or,
564
+ Dr,
565
+ gr,
566
+ Sr
567
+ ]
568
+ }
569
+ },
570
+ required: ["query", "chart"],
571
+ additionalProperties: !1
572
+ }, Nr = {
573
+ type: "object",
574
+ properties: {
575
+ position: {
576
+ type: "object",
577
+ properties: {
578
+ col: {
579
+ type: "number"
580
+ },
581
+ row: {
582
+ type: "number"
583
+ }
584
+ },
585
+ description: "Position of the tile in the grid.",
586
+ required: ["col", "row"],
587
+ additionalProperties: !1
588
+ },
589
+ size: {
590
+ type: "object",
591
+ properties: {
592
+ cols: {
593
+ type: "number"
594
+ },
595
+ rows: {
596
+ type: "number"
597
+ },
598
+ fitToContent: {
599
+ type: "boolean"
600
+ }
601
+ },
602
+ description: "Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",
603
+ required: ["cols", "rows"],
604
+ additionalProperties: !1
605
+ }
606
+ },
607
+ required: ["position", "size"],
608
+ additionalProperties: !1
609
+ }, Cr = {
610
+ type: "object",
611
+ properties: {
612
+ definition: Pr,
613
+ layout: Nr,
614
+ id: {
615
+ type: "string",
616
+ description: "Unique identifier for the tile. If not provided, one will be generated."
617
+ }
618
+ },
619
+ required: ["definition", "layout"],
620
+ additionalProperties: !1
621
+ }, xa = {
622
+ type: "object",
623
+ properties: {
624
+ tiles: {
625
+ type: "array",
626
+ items: Cr
627
+ },
628
+ tileHeight: {
629
+ type: "number",
630
+ description: "Height of each tile in pixels."
631
+ },
632
+ gridSize: {
633
+ type: "object",
634
+ properties: {
635
+ cols: {
636
+ type: "number"
637
+ },
638
+ rows: {
639
+ type: "number"
640
+ }
641
+ },
642
+ description: "Number of columns and rows in the grid.",
643
+ required: ["cols", "rows"],
644
+ additionalProperties: !1
645
+ },
646
+ global_filters: Pe([.../* @__PURE__ */ new Set([...ue, ...oe, ...ce])])
647
+ },
648
+ required: ["tiles"],
649
+ additionalProperties: !1
650
+ }, no = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
651
+ __proto__: null,
652
+ aiQuerySchema: xr,
653
+ barChartSchema: _r,
654
+ basicQuerySchema: vr,
655
+ dashboardConfigSchema: xa,
656
+ dashboardTileTypes: Sa,
657
+ donutChartSchema: Tr,
658
+ exploreV4QuerySchema: Mr,
659
+ gaugeChartSchema: br,
660
+ metricCardSchema: Or,
661
+ singleValueSchema: Sr,
662
+ slottableSchema: gr,
663
+ tileConfigSchema: Cr,
664
+ tileDefinitionSchema: Pr,
665
+ tileLayoutSchema: Nr,
666
+ timeseriesChartSchema: wr,
667
+ topNTableSchema: Dr,
668
+ validDashboardQuery: Er
669
+ }, Symbol.toStringTag, { value: "Module" })), ao = [
670
+ "horizontal_bar",
671
+ "vertical_bar",
672
+ "gauge",
673
+ "donut",
674
+ "timeseries_line",
675
+ "timeseries_bar",
676
+ "golden_signals",
677
+ "top_n",
678
+ "slottable",
679
+ "single_value"
680
+ ], de = {
681
+ type: "string"
682
+ }, V = {
683
+ type: "string"
684
+ }, Ir = {
685
+ type: "boolean"
686
+ }, kr = {
687
+ type: ["object", "array"],
688
+ items: {
689
+ type: "string"
690
+ },
691
+ additionalProperties: {
692
+ type: "string"
693
+ }
694
+ }, Ea = {
695
+ type: "object",
696
+ properties: {
697
+ type: {
698
+ type: "string",
699
+ enum: ["slottable"]
700
+ },
701
+ id: {
702
+ type: "string"
703
+ }
704
+ },
705
+ required: ["type", "id"],
706
+ additionalProperties: !1
707
+ }, Pa = {
708
+ type: "object",
709
+ properties: {
710
+ type: {
711
+ type: "string",
712
+ enum: ["horizontal_bar", "vertical_bar"]
713
+ },
714
+ stacked: {
715
+ type: "boolean"
716
+ },
717
+ chart_dataset_colors: kr,
718
+ synthetics_data_key: de,
719
+ chart_title: V,
720
+ allow_csv_export: Ir
721
+ },
722
+ required: ["type"],
723
+ additionalProperties: !1
724
+ }, Na = {
725
+ type: "object",
726
+ properties: {
727
+ type: {
728
+ type: "string",
729
+ enum: ["timeseries_line", "timeseries_bar"]
730
+ },
731
+ stacked: {
732
+ type: "boolean"
733
+ },
734
+ threshold: {
735
+ type: "object",
736
+ additionalProperties: {
737
+ type: "number"
738
+ }
739
+ },
740
+ chart_dataset_colors: kr,
741
+ synthetics_data_key: de,
742
+ chart_title: V,
743
+ allow_csv_export: Ir
744
+ },
745
+ required: ["type"],
746
+ additionalProperties: !1
747
+ }, Ca = {
748
+ type: "object",
749
+ properties: {
750
+ type: {
751
+ type: "string",
752
+ enum: ["gauge"]
753
+ },
754
+ metric_display: {
755
+ type: "string",
756
+ enum: ["hidden", "single", "full"]
757
+ // This matches the SimpleChartMetricDisplay type.
758
+ },
759
+ reverse_dataset: {
760
+ type: "boolean"
761
+ },
762
+ numerator: {
763
+ type: "number"
764
+ },
765
+ synthetics_data_key: de,
766
+ chart_title: V
767
+ },
768
+ required: ["type"],
769
+ additionalProperties: !1
770
+ }, Ia = {
771
+ type: "object",
772
+ properties: {
773
+ type: {
774
+ type: "string",
775
+ enum: ["donut"]
776
+ },
777
+ synthetics_data_key: de,
778
+ chart_title: V
779
+ },
780
+ required: ["type"],
781
+ additionalProperties: !1
782
+ }, ka = {
783
+ type: "object",
784
+ properties: {
785
+ chart_title: V,
786
+ synthetics_data_key: de,
787
+ type: {
788
+ type: "string",
789
+ enum: ["top_n"]
790
+ },
791
+ description: {
792
+ type: "string"
793
+ },
794
+ entity_link: {
795
+ type: "string"
796
+ }
797
+ },
798
+ required: ["type"],
799
+ additionalProperties: !1
800
+ }, Ya = {
801
+ type: "object",
802
+ properties: {
803
+ chart_title: V,
804
+ type: {
805
+ type: "string",
806
+ enum: ["golden_signals"]
807
+ },
808
+ long_card_titles: {
809
+ type: "boolean"
810
+ },
811
+ description: {
812
+ type: "string"
813
+ },
814
+ percentile_latency: {
815
+ type: "boolean"
816
+ }
817
+ },
818
+ required: ["type"],
819
+ additionalProperties: !1
820
+ }, Ra = {
821
+ type: "object",
822
+ properties: {
823
+ type: {
824
+ type: "string",
825
+ enum: ["single_value"]
826
+ },
827
+ decimal_points: {
828
+ type: "number"
829
+ },
830
+ chart_title: V
831
+ },
832
+ required: ["type"],
833
+ additionalProperties: !1
834
+ }, qa = {
835
+ type: "object",
836
+ properties: {
837
+ tz: {
838
+ type: "string",
839
+ default: "Etc/UTC"
840
+ },
841
+ type: {
842
+ type: "string",
843
+ enum: [
844
+ "relative"
845
+ ]
846
+ },
847
+ time_range: {
848
+ type: "string",
849
+ enum: fr,
850
+ default: "1h"
851
+ }
852
+ },
853
+ required: [
854
+ "type",
855
+ "time_range"
856
+ ],
857
+ additionalProperties: !1
858
+ }, Ha = {
859
+ type: "object",
860
+ description: "A duration representing an exact start and end time.",
861
+ properties: {
862
+ tz: {
863
+ type: "string"
864
+ },
865
+ type: {
866
+ type: "string",
867
+ enum: [
868
+ "absolute"
869
+ ]
870
+ },
871
+ start: {
872
+ type: "string"
873
+ },
874
+ end: {
875
+ type: "string"
876
+ }
877
+ },
878
+ required: [
879
+ "type",
880
+ "start",
881
+ "end"
882
+ ],
883
+ additionalProperties: !1
884
+ }, nt = {
885
+ granularity: {
886
+ type: "string",
887
+ description: 'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',
888
+ enum: Ze
889
+ },
890
+ time_range: {
891
+ type: "object",
892
+ description: "The time range to query.",
893
+ anyOf: [
894
+ qa,
895
+ Ha
896
+ ],
897
+ default: {
898
+ type: "relative",
899
+ time_range: "1h"
900
+ }
901
+ },
902
+ limit: {
903
+ type: "number"
904
+ },
905
+ meta: {
906
+ type: "object"
907
+ }
908
+ }, at = (e) => ({
909
+ type: "array",
910
+ description: "List of aggregated metrics to collect across the requested time span.",
911
+ items: {
912
+ type: "string",
913
+ enum: e
914
+ }
915
+ }), it = (e) => ({
916
+ type: "array",
917
+ description: "List of attributes or entity types to group by.",
918
+ minItems: 0,
919
+ maxItems: 2,
920
+ items: {
921
+ type: "string",
922
+ enum: e
923
+ }
924
+ }), Ne = (e) => ({
925
+ type: "array",
926
+ description: "A list of filters to apply to the query",
927
+ items: {
928
+ oneOf: [
929
+ {
930
+ type: "object",
931
+ description: "In filter",
932
+ properties: {
933
+ field: {
934
+ type: "string",
935
+ enum: e
936
+ },
937
+ operator: {
938
+ type: "string",
939
+ enum: lr
940
+ },
941
+ value: {
942
+ type: "array",
943
+ items: {
944
+ type: ["string", "number", "null"]
945
+ }
946
+ }
947
+ },
948
+ required: [
949
+ "field",
950
+ "operator",
951
+ "value"
952
+ ],
953
+ additionalProperties: !1
954
+ },
955
+ {
956
+ type: "object",
957
+ description: "Empty filter",
958
+ properties: {
959
+ field: {
960
+ type: "string",
961
+ enum: e
962
+ },
963
+ operator: {
964
+ type: "string",
965
+ enum: dr
966
+ }
967
+ },
968
+ required: [
969
+ "field",
970
+ "operator"
971
+ ],
972
+ additionalProperties: !1
973
+ }
974
+ ]
975
+ }
976
+ }), ja = {
977
+ type: "object",
978
+ description: "A query to launch at the advanced explore API",
979
+ properties: {
980
+ datasource: {
981
+ type: "string",
982
+ enum: [
983
+ "api_usage"
984
+ ]
985
+ },
986
+ metrics: at(hr),
987
+ dimensions: it(Ke),
988
+ filters: Ne(ue),
989
+ ...nt
990
+ },
991
+ required: ["datasource"],
992
+ additionalProperties: !1
993
+ }, Aa = {
994
+ type: "object",
995
+ description: "A query to launch at the basic explore API",
996
+ properties: {
997
+ datasource: {
998
+ type: "string",
999
+ enum: [
1000
+ "basic"
1001
+ ]
1002
+ },
1003
+ metrics: at(Be),
1004
+ dimensions: it(Ee),
1005
+ filters: Ne(oe),
1006
+ ...nt
1007
+ },
1008
+ required: ["datasource"],
1009
+ additionalProperties: !1
1010
+ }, Ga = {
1011
+ type: "object",
1012
+ description: "A query to launch at the AI explore API",
1013
+ properties: {
1014
+ datasource: {
1015
+ type: "string",
1016
+ enum: [
1017
+ "llm_usage"
1018
+ ]
1019
+ },
1020
+ metrics: at(mr),
1021
+ dimensions: it(Je),
1022
+ filters: Ne(ce),
1023
+ ...nt
1024
+ },
1025
+ required: ["datasource"],
1026
+ additionalProperties: !1
1027
+ }, Fa = {
1028
+ anyOf: [ja, Aa, Ga]
1029
+ }, Wa = {
1030
+ type: "object",
1031
+ properties: {
1032
+ query: Fa,
1033
+ chart: {
1034
+ anyOf: [
1035
+ Pa,
1036
+ Ca,
1037
+ Ia,
1038
+ Na,
1039
+ Ya,
1040
+ ka,
1041
+ Ea,
1042
+ Ra
1043
+ ]
1044
+ }
1045
+ },
1046
+ required: ["query", "chart"],
1047
+ additionalProperties: !1
1048
+ }, La = {
1049
+ type: "object",
1050
+ properties: {
1051
+ position: {
1052
+ type: "object",
1053
+ properties: {
1054
+ col: {
1055
+ type: "number"
1056
+ },
1057
+ row: {
1058
+ type: "number"
1059
+ }
1060
+ },
1061
+ description: "Position of the tile in the grid.",
1062
+ required: ["col", "row"],
1063
+ additionalProperties: !1
1064
+ },
1065
+ size: {
1066
+ type: "object",
1067
+ properties: {
1068
+ cols: {
1069
+ type: "number"
1070
+ },
1071
+ rows: {
1072
+ type: "number"
1073
+ },
1074
+ fit_to_content: {
1075
+ type: "boolean"
1076
+ }
1077
+ },
1078
+ description: "Number of columns and rows the tile occupies. If fitToContent is true for every tile in a row, and each tile only occupies 1 row, then the row will auto-fit to its content.",
1079
+ required: ["cols", "rows"],
1080
+ additionalProperties: !1
1081
+ }
1082
+ },
1083
+ required: ["position", "size"],
1084
+ additionalProperties: !1
1085
+ }, Ua = {
1086
+ type: "object",
1087
+ properties: {
1088
+ type: {
1089
+ type: "string",
1090
+ enum: ["chart"]
1091
+ },
1092
+ definition: Wa,
1093
+ layout: La,
1094
+ id: {
1095
+ type: "string",
1096
+ description: "Unique identifier for the tile. If not provided, one will be generated."
1097
+ }
1098
+ },
1099
+ required: ["type", "definition", "layout"],
1100
+ additionalProperties: !1
1101
+ }, io = {
1102
+ type: "object",
1103
+ properties: {
1104
+ tiles: {
1105
+ type: "array",
1106
+ items: Ua
1107
+ },
1108
+ tile_height: {
1109
+ type: "number",
1110
+ description: "Height of each tile in pixels."
1111
+ },
1112
+ preset_filters: Ne([.../* @__PURE__ */ new Set([...ue, ...oe, ...ce])])
1113
+ },
1114
+ required: ["tiles"],
1115
+ additionalProperties: !1
1116
+ }, Yr = 6048e5, za = 864e5, $a = 60, Va = 3600, Lt = Symbol.for("constructDateFrom");
1117
+ function I(e, t) {
1118
+ return typeof e == "function" ? e(t) : e && typeof e == "object" && Lt in e ? e[Lt](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
1119
+ }
1120
+ function O(e, t) {
1121
+ return I(t || e, e);
1122
+ }
1123
+ function Ut(e, t, r) {
1124
+ const n = O(e, r == null ? void 0 : r.in);
1125
+ return isNaN(t) ? I(e, NaN) : (n.setDate(n.getDate() + t), n);
1126
+ }
1127
+ function Xa(e, t, r) {
1128
+ const n = O(e, r == null ? void 0 : r.in);
1129
+ if (isNaN(t)) return I(e, NaN);
1130
+ const i = n.getDate(), o = I(e, n.getTime());
1131
+ o.setMonth(n.getMonth() + t + 1, 0);
1132
+ const c = o.getDate();
1133
+ return i >= c ? o : (n.setFullYear(
1134
+ o.getFullYear(),
1135
+ o.getMonth(),
1136
+ i
1137
+ ), n);
1138
+ }
1139
+ let Qa = {};
1140
+ function fe() {
1141
+ return Qa;
1142
+ }
1143
+ function H(e, t) {
1144
+ var d, h, f, _;
1145
+ const r = fe(), n = (t == null ? void 0 : t.weekStartsOn) ?? ((h = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : h.weekStartsOn) ?? r.weekStartsOn ?? ((_ = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : _.weekStartsOn) ?? 0, i = O(e, t == null ? void 0 : t.in), o = i.getDay(), c = (o < n ? 7 : 0) + o - n;
1146
+ return i.setDate(i.getDate() - c), i.setHours(0, 0, 0, 0), i;
1147
+ }
1148
+ function De(e, t) {
1149
+ return H(e, { ...t, weekStartsOn: 1 });
1150
+ }
1151
+ function Rr(e, t) {
1152
+ const r = O(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = I(r, 0);
1153
+ i.setFullYear(n + 1, 0, 4), i.setHours(0, 0, 0, 0);
1154
+ const o = De(i), c = I(r, 0);
1155
+ c.setFullYear(n, 0, 4), c.setHours(0, 0, 0, 0);
1156
+ const d = De(c);
1157
+ return r.getTime() >= o.getTime() ? n + 1 : r.getTime() >= d.getTime() ? n : n - 1;
1158
+ }
1159
+ function zt(e) {
1160
+ const t = O(e), r = new Date(
1161
+ Date.UTC(
1162
+ t.getFullYear(),
1163
+ t.getMonth(),
1164
+ t.getDate(),
1165
+ t.getHours(),
1166
+ t.getMinutes(),
1167
+ t.getSeconds(),
1168
+ t.getMilliseconds()
1169
+ )
1170
+ );
1171
+ return r.setUTCFullYear(t.getFullYear()), +e - +r;
1172
+ }
1173
+ function Za(e, ...t) {
1174
+ const r = I.bind(
1175
+ null,
1176
+ t.find((n) => typeof n == "object")
1177
+ );
1178
+ return t.map(r);
1179
+ }
1180
+ function Oe(e, t) {
1181
+ const r = O(e, t == null ? void 0 : t.in);
1182
+ return r.setHours(0, 0, 0, 0), r;
1183
+ }
1184
+ function Ba(e, t, r) {
1185
+ const [n, i] = Za(
1186
+ r == null ? void 0 : r.in,
1187
+ e,
1188
+ t
1189
+ ), o = Oe(n), c = Oe(i), d = +o - zt(o), h = +c - zt(c);
1190
+ return Math.round((d - h) / za);
1191
+ }
1192
+ function Ka(e, t) {
1193
+ const r = Rr(e, t), n = I(e, 0);
1194
+ return n.setFullYear(r, 0, 4), n.setHours(0, 0, 0, 0), De(n);
1195
+ }
1196
+ function Ja(e) {
1197
+ return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
1198
+ }
1199
+ function ei(e) {
1200
+ return !(!Ja(e) && typeof e != "number" || isNaN(+O(e)));
1201
+ }
1202
+ function ee(e, t) {
1203
+ const r = O(e, t == null ? void 0 : t.in);
1204
+ return r.setDate(1), r.setHours(0, 0, 0, 0), r;
1205
+ }
1206
+ function ti(e, t) {
1207
+ const r = O(e, t == null ? void 0 : t.in);
1208
+ return r.setFullYear(r.getFullYear(), 0, 1), r.setHours(0, 0, 0, 0), r;
1209
+ }
1210
+ const ri = {
1211
+ lessThanXSeconds: {
1212
+ one: "less than a second",
1213
+ other: "less than {{count}} seconds"
1214
+ },
1215
+ xSeconds: {
1216
+ one: "1 second",
1217
+ other: "{{count}} seconds"
1218
+ },
1219
+ halfAMinute: "half a minute",
1220
+ lessThanXMinutes: {
1221
+ one: "less than a minute",
1222
+ other: "less than {{count}} minutes"
1223
+ },
1224
+ xMinutes: {
1225
+ one: "1 minute",
1226
+ other: "{{count}} minutes"
1227
+ },
1228
+ aboutXHours: {
1229
+ one: "about 1 hour",
1230
+ other: "about {{count}} hours"
1231
+ },
1232
+ xHours: {
1233
+ one: "1 hour",
1234
+ other: "{{count}} hours"
1235
+ },
1236
+ xDays: {
1237
+ one: "1 day",
1238
+ other: "{{count}} days"
1239
+ },
1240
+ aboutXWeeks: {
1241
+ one: "about 1 week",
1242
+ other: "about {{count}} weeks"
1243
+ },
1244
+ xWeeks: {
1245
+ one: "1 week",
1246
+ other: "{{count}} weeks"
1247
+ },
1248
+ aboutXMonths: {
1249
+ one: "about 1 month",
1250
+ other: "about {{count}} months"
1251
+ },
1252
+ xMonths: {
1253
+ one: "1 month",
1254
+ other: "{{count}} months"
1255
+ },
1256
+ aboutXYears: {
1257
+ one: "about 1 year",
1258
+ other: "about {{count}} years"
1259
+ },
1260
+ xYears: {
1261
+ one: "1 year",
1262
+ other: "{{count}} years"
1263
+ },
1264
+ overXYears: {
1265
+ one: "over 1 year",
1266
+ other: "over {{count}} years"
1267
+ },
1268
+ almostXYears: {
1269
+ one: "almost 1 year",
1270
+ other: "almost {{count}} years"
1271
+ }
1272
+ }, ni = (e, t, r) => {
1273
+ let n;
1274
+ const i = ri[e];
1275
+ return typeof i == "string" ? n = i : t === 1 ? n = i.one : n = i.other.replace("{{count}}", t.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n : n + " ago" : n;
1276
+ };
1277
+ function Le(e) {
1278
+ return (t = {}) => {
1279
+ const r = t.width ? String(t.width) : e.defaultWidth;
1280
+ return e.formats[r] || e.formats[e.defaultWidth];
1281
+ };
1282
+ }
1283
+ const ai = {
1284
+ full: "EEEE, MMMM do, y",
1285
+ long: "MMMM do, y",
1286
+ medium: "MMM d, y",
1287
+ short: "MM/dd/yyyy"
1288
+ }, ii = {
1289
+ full: "h:mm:ss a zzzz",
1290
+ long: "h:mm:ss a z",
1291
+ medium: "h:mm:ss a",
1292
+ short: "h:mm a"
1293
+ }, si = {
1294
+ full: "{{date}} 'at' {{time}}",
1295
+ long: "{{date}} 'at' {{time}}",
1296
+ medium: "{{date}}, {{time}}",
1297
+ short: "{{date}}, {{time}}"
1298
+ }, oi = {
1299
+ date: Le({
1300
+ formats: ai,
1301
+ defaultWidth: "full"
1302
+ }),
1303
+ time: Le({
1304
+ formats: ii,
1305
+ defaultWidth: "full"
1306
+ }),
1307
+ dateTime: Le({
1308
+ formats: si,
1309
+ defaultWidth: "full"
1310
+ })
1311
+ }, ui = {
1312
+ lastWeek: "'last' eeee 'at' p",
1313
+ yesterday: "'yesterday at' p",
1314
+ today: "'today at' p",
1315
+ tomorrow: "'tomorrow at' p",
1316
+ nextWeek: "eeee 'at' p",
1317
+ other: "P"
1318
+ }, ci = (e, t, r, n) => ui[e];
1319
+ function ae(e) {
1320
+ return (t, r) => {
1321
+ const n = r != null && r.context ? String(r.context) : "standalone";
1322
+ let i;
1323
+ if (n === "formatting" && e.formattingValues) {
1324
+ const c = e.defaultFormattingWidth || e.defaultWidth, d = r != null && r.width ? String(r.width) : c;
1325
+ i = e.formattingValues[d] || e.formattingValues[c];
1326
+ } else {
1327
+ const c = e.defaultWidth, d = r != null && r.width ? String(r.width) : e.defaultWidth;
1328
+ i = e.values[d] || e.values[c];
1329
+ }
1330
+ const o = e.argumentCallback ? e.argumentCallback(t) : t;
1331
+ return i[o];
1332
+ };
1333
+ }
1334
+ const li = {
1335
+ narrow: ["B", "A"],
1336
+ abbreviated: ["BC", "AD"],
1337
+ wide: ["Before Christ", "Anno Domini"]
1338
+ }, di = {
1339
+ narrow: ["1", "2", "3", "4"],
1340
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
1341
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
1342
+ }, fi = {
1343
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
1344
+ abbreviated: [
1345
+ "Jan",
1346
+ "Feb",
1347
+ "Mar",
1348
+ "Apr",
1349
+ "May",
1350
+ "Jun",
1351
+ "Jul",
1352
+ "Aug",
1353
+ "Sep",
1354
+ "Oct",
1355
+ "Nov",
1356
+ "Dec"
1357
+ ],
1358
+ wide: [
1359
+ "January",
1360
+ "February",
1361
+ "March",
1362
+ "April",
1363
+ "May",
1364
+ "June",
1365
+ "July",
1366
+ "August",
1367
+ "September",
1368
+ "October",
1369
+ "November",
1370
+ "December"
1371
+ ]
1372
+ }, hi = {
1373
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
1374
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
1375
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1376
+ wide: [
1377
+ "Sunday",
1378
+ "Monday",
1379
+ "Tuesday",
1380
+ "Wednesday",
1381
+ "Thursday",
1382
+ "Friday",
1383
+ "Saturday"
1384
+ ]
1385
+ }, mi = {
1386
+ narrow: {
1387
+ am: "a",
1388
+ pm: "p",
1389
+ midnight: "mi",
1390
+ noon: "n",
1391
+ morning: "morning",
1392
+ afternoon: "afternoon",
1393
+ evening: "evening",
1394
+ night: "night"
1395
+ },
1396
+ abbreviated: {
1397
+ am: "AM",
1398
+ pm: "PM",
1399
+ midnight: "midnight",
1400
+ noon: "noon",
1401
+ morning: "morning",
1402
+ afternoon: "afternoon",
1403
+ evening: "evening",
1404
+ night: "night"
1405
+ },
1406
+ wide: {
1407
+ am: "a.m.",
1408
+ pm: "p.m.",
1409
+ midnight: "midnight",
1410
+ noon: "noon",
1411
+ morning: "morning",
1412
+ afternoon: "afternoon",
1413
+ evening: "evening",
1414
+ night: "night"
1415
+ }
1416
+ }, yi = {
1417
+ narrow: {
1418
+ am: "a",
1419
+ pm: "p",
1420
+ midnight: "mi",
1421
+ noon: "n",
1422
+ morning: "in the morning",
1423
+ afternoon: "in the afternoon",
1424
+ evening: "in the evening",
1425
+ night: "at night"
1426
+ },
1427
+ abbreviated: {
1428
+ am: "AM",
1429
+ pm: "PM",
1430
+ midnight: "midnight",
1431
+ noon: "noon",
1432
+ morning: "in the morning",
1433
+ afternoon: "in the afternoon",
1434
+ evening: "in the evening",
1435
+ night: "at night"
1436
+ },
1437
+ wide: {
1438
+ am: "a.m.",
1439
+ pm: "p.m.",
1440
+ midnight: "midnight",
1441
+ noon: "noon",
1442
+ morning: "in the morning",
1443
+ afternoon: "in the afternoon",
1444
+ evening: "in the evening",
1445
+ night: "at night"
1446
+ }
1447
+ }, pi = (e, t) => {
1448
+ const r = Number(e), n = r % 100;
1449
+ if (n > 20 || n < 10)
1450
+ switch (n % 10) {
1451
+ case 1:
1452
+ return r + "st";
1453
+ case 2:
1454
+ return r + "nd";
1455
+ case 3:
1456
+ return r + "rd";
1457
+ }
1458
+ return r + "th";
1459
+ }, gi = {
1460
+ ordinalNumber: pi,
1461
+ era: ae({
1462
+ values: li,
1463
+ defaultWidth: "wide"
1464
+ }),
1465
+ quarter: ae({
1466
+ values: di,
1467
+ defaultWidth: "wide",
1468
+ argumentCallback: (e) => e - 1
1469
+ }),
1470
+ month: ae({
1471
+ values: fi,
1472
+ defaultWidth: "wide"
1473
+ }),
1474
+ day: ae({
1475
+ values: hi,
1476
+ defaultWidth: "wide"
1477
+ }),
1478
+ dayPeriod: ae({
1479
+ values: mi,
1480
+ defaultWidth: "wide",
1481
+ formattingValues: yi,
1482
+ defaultFormattingWidth: "wide"
1483
+ })
1484
+ };
1485
+ function ie(e) {
1486
+ return (t, r = {}) => {
1487
+ const n = r.width, i = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], o = t.match(i);
1488
+ if (!o)
1489
+ return null;
1490
+ const c = o[0], d = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], h = Array.isArray(d) ? wi(d, (y) => y.test(c)) : (
1491
+ // [TODO] -- I challenge you to fix the type
1492
+ _i(d, (y) => y.test(c))
1493
+ );
1494
+ let f;
1495
+ f = e.valueCallback ? e.valueCallback(h) : h, f = r.valueCallback ? (
1496
+ // [TODO] -- I challenge you to fix the type
1497
+ r.valueCallback(f)
1498
+ ) : f;
1499
+ const _ = t.slice(c.length);
1500
+ return { value: f, rest: _ };
1501
+ };
1502
+ }
1503
+ function _i(e, t) {
1504
+ for (const r in e)
1505
+ if (Object.prototype.hasOwnProperty.call(e, r) && t(e[r]))
1506
+ return r;
1507
+ }
1508
+ function wi(e, t) {
1509
+ for (let r = 0; r < e.length; r++)
1510
+ if (t(e[r]))
1511
+ return r;
1512
+ }
1513
+ function bi(e) {
1514
+ return (t, r = {}) => {
1515
+ const n = t.match(e.matchPattern);
1516
+ if (!n) return null;
1517
+ const i = n[0], o = t.match(e.parsePattern);
1518
+ if (!o) return null;
1519
+ let c = e.valueCallback ? e.valueCallback(o[0]) : o[0];
1520
+ c = r.valueCallback ? r.valueCallback(c) : c;
1521
+ const d = t.slice(i.length);
1522
+ return { value: c, rest: d };
1523
+ };
1524
+ }
1525
+ const Ti = /^(\d+)(th|st|nd|rd)?/i, Di = /\d+/i, Oi = {
1526
+ narrow: /^(b|a)/i,
1527
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1528
+ wide: /^(before christ|before common era|anno domini|common era)/i
1529
+ }, Si = {
1530
+ any: [/^b/i, /^(a|c)/i]
1531
+ }, Mi = {
1532
+ narrow: /^[1234]/i,
1533
+ abbreviated: /^q[1234]/i,
1534
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1535
+ }, vi = {
1536
+ any: [/1/i, /2/i, /3/i, /4/i]
1537
+ }, xi = {
1538
+ narrow: /^[jfmasond]/i,
1539
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1540
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1541
+ }, Ei = {
1542
+ narrow: [
1543
+ /^j/i,
1544
+ /^f/i,
1545
+ /^m/i,
1546
+ /^a/i,
1547
+ /^m/i,
1548
+ /^j/i,
1549
+ /^j/i,
1550
+ /^a/i,
1551
+ /^s/i,
1552
+ /^o/i,
1553
+ /^n/i,
1554
+ /^d/i
1555
+ ],
1556
+ any: [
1557
+ /^ja/i,
1558
+ /^f/i,
1559
+ /^mar/i,
1560
+ /^ap/i,
1561
+ /^may/i,
1562
+ /^jun/i,
1563
+ /^jul/i,
1564
+ /^au/i,
1565
+ /^s/i,
1566
+ /^o/i,
1567
+ /^n/i,
1568
+ /^d/i
1569
+ ]
1570
+ }, Pi = {
1571
+ narrow: /^[smtwf]/i,
1572
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1573
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1574
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1575
+ }, Ni = {
1576
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1577
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1578
+ }, Ci = {
1579
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1580
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1581
+ }, Ii = {
1582
+ any: {
1583
+ am: /^a/i,
1584
+ pm: /^p/i,
1585
+ midnight: /^mi/i,
1586
+ noon: /^no/i,
1587
+ morning: /morning/i,
1588
+ afternoon: /afternoon/i,
1589
+ evening: /evening/i,
1590
+ night: /night/i
1591
+ }
1592
+ }, ki = {
1593
+ ordinalNumber: bi({
1594
+ matchPattern: Ti,
1595
+ parsePattern: Di,
1596
+ valueCallback: (e) => parseInt(e, 10)
1597
+ }),
1598
+ era: ie({
1599
+ matchPatterns: Oi,
1600
+ defaultMatchWidth: "wide",
1601
+ parsePatterns: Si,
1602
+ defaultParseWidth: "any"
1603
+ }),
1604
+ quarter: ie({
1605
+ matchPatterns: Mi,
1606
+ defaultMatchWidth: "wide",
1607
+ parsePatterns: vi,
1608
+ defaultParseWidth: "any",
1609
+ valueCallback: (e) => e + 1
1610
+ }),
1611
+ month: ie({
1612
+ matchPatterns: xi,
1613
+ defaultMatchWidth: "wide",
1614
+ parsePatterns: Ei,
1615
+ defaultParseWidth: "any"
1616
+ }),
1617
+ day: ie({
1618
+ matchPatterns: Pi,
1619
+ defaultMatchWidth: "wide",
1620
+ parsePatterns: Ni,
1621
+ defaultParseWidth: "any"
1622
+ }),
1623
+ dayPeriod: ie({
1624
+ matchPatterns: Ci,
1625
+ defaultMatchWidth: "any",
1626
+ parsePatterns: Ii,
1627
+ defaultParseWidth: "any"
1628
+ })
1629
+ }, Yi = {
1630
+ code: "en-US",
1631
+ formatDistance: ni,
1632
+ formatLong: oi,
1633
+ formatRelative: ci,
1634
+ localize: gi,
1635
+ match: ki,
1636
+ options: {
1637
+ weekStartsOn: 0,
1638
+ firstWeekContainsDate: 1
1639
+ }
1640
+ };
1641
+ function Ri(e, t) {
1642
+ const r = O(e, t == null ? void 0 : t.in);
1643
+ return Ba(r, ti(r)) + 1;
1644
+ }
1645
+ function qi(e, t) {
1646
+ const r = O(e, t == null ? void 0 : t.in), n = +De(r) - +Ka(r);
1647
+ return Math.round(n / Yr) + 1;
1648
+ }
1649
+ function qr(e, t) {
1650
+ var _, y, p, E;
1651
+ const r = O(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = fe(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((y = (_ = t == null ? void 0 : t.locale) == null ? void 0 : _.options) == null ? void 0 : y.firstWeekContainsDate) ?? i.firstWeekContainsDate ?? ((E = (p = i.locale) == null ? void 0 : p.options) == null ? void 0 : E.firstWeekContainsDate) ?? 1, c = I((t == null ? void 0 : t.in) || e, 0);
1652
+ c.setFullYear(n + 1, 0, o), c.setHours(0, 0, 0, 0);
1653
+ const d = H(c, t), h = I((t == null ? void 0 : t.in) || e, 0);
1654
+ h.setFullYear(n, 0, o), h.setHours(0, 0, 0, 0);
1655
+ const f = H(h, t);
1656
+ return +r >= +d ? n + 1 : +r >= +f ? n : n - 1;
1657
+ }
1658
+ function Hi(e, t) {
1659
+ var d, h, f, _;
1660
+ const r = fe(), n = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((h = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : h.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((_ = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : _.firstWeekContainsDate) ?? 1, i = qr(e, t), o = I((t == null ? void 0 : t.in) || e, 0);
1661
+ return o.setFullYear(i, 0, n), o.setHours(0, 0, 0, 0), H(o, t);
1662
+ }
1663
+ function ji(e, t) {
1664
+ const r = O(e, t == null ? void 0 : t.in), n = +H(r, t) - +Hi(r, t);
1665
+ return Math.round(n / Yr) + 1;
1666
+ }
1667
+ function g(e, t) {
1668
+ const r = e < 0 ? "-" : "", n = Math.abs(e).toString().padStart(t, "0");
1669
+ return r + n;
1670
+ }
1671
+ const A = {
1672
+ // Year
1673
+ y(e, t) {
1674
+ const r = e.getFullYear(), n = r > 0 ? r : 1 - r;
1675
+ return g(t === "yy" ? n % 100 : n, t.length);
1676
+ },
1677
+ // Month
1678
+ M(e, t) {
1679
+ const r = e.getMonth();
1680
+ return t === "M" ? String(r + 1) : g(r + 1, 2);
1681
+ },
1682
+ // Day of the month
1683
+ d(e, t) {
1684
+ return g(e.getDate(), t.length);
1685
+ },
1686
+ // AM or PM
1687
+ a(e, t) {
1688
+ const r = e.getHours() / 12 >= 1 ? "pm" : "am";
1689
+ switch (t) {
1690
+ case "a":
1691
+ case "aa":
1692
+ return r.toUpperCase();
1693
+ case "aaa":
1694
+ return r;
1695
+ case "aaaaa":
1696
+ return r[0];
1697
+ case "aaaa":
1698
+ default:
1699
+ return r === "am" ? "a.m." : "p.m.";
1700
+ }
1701
+ },
1702
+ // Hour [1-12]
1703
+ h(e, t) {
1704
+ return g(e.getHours() % 12 || 12, t.length);
1705
+ },
1706
+ // Hour [0-23]
1707
+ H(e, t) {
1708
+ return g(e.getHours(), t.length);
1709
+ },
1710
+ // Minute
1711
+ m(e, t) {
1712
+ return g(e.getMinutes(), t.length);
1713
+ },
1714
+ // Second
1715
+ s(e, t) {
1716
+ return g(e.getSeconds(), t.length);
1717
+ },
1718
+ // Fraction of second
1719
+ S(e, t) {
1720
+ const r = t.length, n = e.getMilliseconds(), i = Math.trunc(
1721
+ n * Math.pow(10, r - 3)
1722
+ );
1723
+ return g(i, t.length);
1724
+ }
1725
+ }, K = {
1726
+ am: "am",
1727
+ pm: "pm",
1728
+ midnight: "midnight",
1729
+ noon: "noon",
1730
+ morning: "morning",
1731
+ afternoon: "afternoon",
1732
+ evening: "evening",
1733
+ night: "night"
1734
+ }, $t = {
1735
+ // Era
1736
+ G: function(e, t, r) {
1737
+ const n = e.getFullYear() > 0 ? 1 : 0;
1738
+ switch (t) {
1739
+ case "G":
1740
+ case "GG":
1741
+ case "GGG":
1742
+ return r.era(n, { width: "abbreviated" });
1743
+ case "GGGGG":
1744
+ return r.era(n, { width: "narrow" });
1745
+ case "GGGG":
1746
+ default:
1747
+ return r.era(n, { width: "wide" });
1748
+ }
1749
+ },
1750
+ // Year
1751
+ y: function(e, t, r) {
1752
+ if (t === "yo") {
1753
+ const n = e.getFullYear(), i = n > 0 ? n : 1 - n;
1754
+ return r.ordinalNumber(i, { unit: "year" });
1755
+ }
1756
+ return A.y(e, t);
1757
+ },
1758
+ // Local week-numbering year
1759
+ Y: function(e, t, r, n) {
1760
+ const i = qr(e, n), o = i > 0 ? i : 1 - i;
1761
+ if (t === "YY") {
1762
+ const c = o % 100;
1763
+ return g(c, 2);
1764
+ }
1765
+ return t === "Yo" ? r.ordinalNumber(o, { unit: "year" }) : g(o, t.length);
1766
+ },
1767
+ // ISO week-numbering year
1768
+ R: function(e, t) {
1769
+ const r = Rr(e);
1770
+ return g(r, t.length);
1771
+ },
1772
+ // Extended year. This is a single number designating the year of this calendar system.
1773
+ // The main difference between `y` and `u` localizers are B.C. years:
1774
+ // | Year | `y` | `u` |
1775
+ // |------|-----|-----|
1776
+ // | AC 1 | 1 | 1 |
1777
+ // | BC 1 | 1 | 0 |
1778
+ // | BC 2 | 2 | -1 |
1779
+ // Also `yy` always returns the last two digits of a year,
1780
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1781
+ u: function(e, t) {
1782
+ const r = e.getFullYear();
1783
+ return g(r, t.length);
1784
+ },
1785
+ // Quarter
1786
+ Q: function(e, t, r) {
1787
+ const n = Math.ceil((e.getMonth() + 1) / 3);
1788
+ switch (t) {
1789
+ case "Q":
1790
+ return String(n);
1791
+ case "QQ":
1792
+ return g(n, 2);
1793
+ case "Qo":
1794
+ return r.ordinalNumber(n, { unit: "quarter" });
1795
+ case "QQQ":
1796
+ return r.quarter(n, {
1797
+ width: "abbreviated",
1798
+ context: "formatting"
1799
+ });
1800
+ case "QQQQQ":
1801
+ return r.quarter(n, {
1802
+ width: "narrow",
1803
+ context: "formatting"
1804
+ });
1805
+ case "QQQQ":
1806
+ default:
1807
+ return r.quarter(n, {
1808
+ width: "wide",
1809
+ context: "formatting"
1810
+ });
1811
+ }
1812
+ },
1813
+ // Stand-alone quarter
1814
+ q: function(e, t, r) {
1815
+ const n = Math.ceil((e.getMonth() + 1) / 3);
1816
+ switch (t) {
1817
+ case "q":
1818
+ return String(n);
1819
+ case "qq":
1820
+ return g(n, 2);
1821
+ case "qo":
1822
+ return r.ordinalNumber(n, { unit: "quarter" });
1823
+ case "qqq":
1824
+ return r.quarter(n, {
1825
+ width: "abbreviated",
1826
+ context: "standalone"
1827
+ });
1828
+ case "qqqqq":
1829
+ return r.quarter(n, {
1830
+ width: "narrow",
1831
+ context: "standalone"
1832
+ });
1833
+ case "qqqq":
1834
+ default:
1835
+ return r.quarter(n, {
1836
+ width: "wide",
1837
+ context: "standalone"
1838
+ });
1839
+ }
1840
+ },
1841
+ // Month
1842
+ M: function(e, t, r) {
1843
+ const n = e.getMonth();
1844
+ switch (t) {
1845
+ case "M":
1846
+ case "MM":
1847
+ return A.M(e, t);
1848
+ case "Mo":
1849
+ return r.ordinalNumber(n + 1, { unit: "month" });
1850
+ case "MMM":
1851
+ return r.month(n, {
1852
+ width: "abbreviated",
1853
+ context: "formatting"
1854
+ });
1855
+ case "MMMMM":
1856
+ return r.month(n, {
1857
+ width: "narrow",
1858
+ context: "formatting"
1859
+ });
1860
+ case "MMMM":
1861
+ default:
1862
+ return r.month(n, { width: "wide", context: "formatting" });
1863
+ }
1864
+ },
1865
+ // Stand-alone month
1866
+ L: function(e, t, r) {
1867
+ const n = e.getMonth();
1868
+ switch (t) {
1869
+ case "L":
1870
+ return String(n + 1);
1871
+ case "LL":
1872
+ return g(n + 1, 2);
1873
+ case "Lo":
1874
+ return r.ordinalNumber(n + 1, { unit: "month" });
1875
+ case "LLL":
1876
+ return r.month(n, {
1877
+ width: "abbreviated",
1878
+ context: "standalone"
1879
+ });
1880
+ case "LLLLL":
1881
+ return r.month(n, {
1882
+ width: "narrow",
1883
+ context: "standalone"
1884
+ });
1885
+ case "LLLL":
1886
+ default:
1887
+ return r.month(n, { width: "wide", context: "standalone" });
1888
+ }
1889
+ },
1890
+ // Local week of year
1891
+ w: function(e, t, r, n) {
1892
+ const i = ji(e, n);
1893
+ return t === "wo" ? r.ordinalNumber(i, { unit: "week" }) : g(i, t.length);
1894
+ },
1895
+ // ISO week of year
1896
+ I: function(e, t, r) {
1897
+ const n = qi(e);
1898
+ return t === "Io" ? r.ordinalNumber(n, { unit: "week" }) : g(n, t.length);
1899
+ },
1900
+ // Day of the month
1901
+ d: function(e, t, r) {
1902
+ return t === "do" ? r.ordinalNumber(e.getDate(), { unit: "date" }) : A.d(e, t);
1903
+ },
1904
+ // Day of year
1905
+ D: function(e, t, r) {
1906
+ const n = Ri(e);
1907
+ return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : g(n, t.length);
1908
+ },
1909
+ // Day of week
1910
+ E: function(e, t, r) {
1911
+ const n = e.getDay();
1912
+ switch (t) {
1913
+ case "E":
1914
+ case "EE":
1915
+ case "EEE":
1916
+ return r.day(n, {
1917
+ width: "abbreviated",
1918
+ context: "formatting"
1919
+ });
1920
+ case "EEEEE":
1921
+ return r.day(n, {
1922
+ width: "narrow",
1923
+ context: "formatting"
1924
+ });
1925
+ case "EEEEEE":
1926
+ return r.day(n, {
1927
+ width: "short",
1928
+ context: "formatting"
1929
+ });
1930
+ case "EEEE":
1931
+ default:
1932
+ return r.day(n, {
1933
+ width: "wide",
1934
+ context: "formatting"
1935
+ });
1936
+ }
1937
+ },
1938
+ // Local day of week
1939
+ e: function(e, t, r, n) {
1940
+ const i = e.getDay(), o = (i - n.weekStartsOn + 8) % 7 || 7;
1941
+ switch (t) {
1942
+ case "e":
1943
+ return String(o);
1944
+ case "ee":
1945
+ return g(o, 2);
1946
+ case "eo":
1947
+ return r.ordinalNumber(o, { unit: "day" });
1948
+ case "eee":
1949
+ return r.day(i, {
1950
+ width: "abbreviated",
1951
+ context: "formatting"
1952
+ });
1953
+ case "eeeee":
1954
+ return r.day(i, {
1955
+ width: "narrow",
1956
+ context: "formatting"
1957
+ });
1958
+ case "eeeeee":
1959
+ return r.day(i, {
1960
+ width: "short",
1961
+ context: "formatting"
1962
+ });
1963
+ case "eeee":
1964
+ default:
1965
+ return r.day(i, {
1966
+ width: "wide",
1967
+ context: "formatting"
1968
+ });
1969
+ }
1970
+ },
1971
+ // Stand-alone local day of week
1972
+ c: function(e, t, r, n) {
1973
+ const i = e.getDay(), o = (i - n.weekStartsOn + 8) % 7 || 7;
1974
+ switch (t) {
1975
+ case "c":
1976
+ return String(o);
1977
+ case "cc":
1978
+ return g(o, t.length);
1979
+ case "co":
1980
+ return r.ordinalNumber(o, { unit: "day" });
1981
+ case "ccc":
1982
+ return r.day(i, {
1983
+ width: "abbreviated",
1984
+ context: "standalone"
1985
+ });
1986
+ case "ccccc":
1987
+ return r.day(i, {
1988
+ width: "narrow",
1989
+ context: "standalone"
1990
+ });
1991
+ case "cccccc":
1992
+ return r.day(i, {
1993
+ width: "short",
1994
+ context: "standalone"
1995
+ });
1996
+ case "cccc":
1997
+ default:
1998
+ return r.day(i, {
1999
+ width: "wide",
2000
+ context: "standalone"
2001
+ });
2002
+ }
2003
+ },
2004
+ // ISO day of week
2005
+ i: function(e, t, r) {
2006
+ const n = e.getDay(), i = n === 0 ? 7 : n;
2007
+ switch (t) {
2008
+ case "i":
2009
+ return String(i);
2010
+ case "ii":
2011
+ return g(i, t.length);
2012
+ case "io":
2013
+ return r.ordinalNumber(i, { unit: "day" });
2014
+ case "iii":
2015
+ return r.day(n, {
2016
+ width: "abbreviated",
2017
+ context: "formatting"
2018
+ });
2019
+ case "iiiii":
2020
+ return r.day(n, {
2021
+ width: "narrow",
2022
+ context: "formatting"
2023
+ });
2024
+ case "iiiiii":
2025
+ return r.day(n, {
2026
+ width: "short",
2027
+ context: "formatting"
2028
+ });
2029
+ case "iiii":
2030
+ default:
2031
+ return r.day(n, {
2032
+ width: "wide",
2033
+ context: "formatting"
2034
+ });
2035
+ }
2036
+ },
2037
+ // AM or PM
2038
+ a: function(e, t, r) {
2039
+ const i = e.getHours() / 12 >= 1 ? "pm" : "am";
2040
+ switch (t) {
2041
+ case "a":
2042
+ case "aa":
2043
+ return r.dayPeriod(i, {
2044
+ width: "abbreviated",
2045
+ context: "formatting"
2046
+ });
2047
+ case "aaa":
2048
+ return r.dayPeriod(i, {
2049
+ width: "abbreviated",
2050
+ context: "formatting"
2051
+ }).toLowerCase();
2052
+ case "aaaaa":
2053
+ return r.dayPeriod(i, {
2054
+ width: "narrow",
2055
+ context: "formatting"
2056
+ });
2057
+ case "aaaa":
2058
+ default:
2059
+ return r.dayPeriod(i, {
2060
+ width: "wide",
2061
+ context: "formatting"
2062
+ });
2063
+ }
2064
+ },
2065
+ // AM, PM, midnight, noon
2066
+ b: function(e, t, r) {
2067
+ const n = e.getHours();
2068
+ let i;
2069
+ switch (n === 12 ? i = K.noon : n === 0 ? i = K.midnight : i = n / 12 >= 1 ? "pm" : "am", t) {
2070
+ case "b":
2071
+ case "bb":
2072
+ return r.dayPeriod(i, {
2073
+ width: "abbreviated",
2074
+ context: "formatting"
2075
+ });
2076
+ case "bbb":
2077
+ return r.dayPeriod(i, {
2078
+ width: "abbreviated",
2079
+ context: "formatting"
2080
+ }).toLowerCase();
2081
+ case "bbbbb":
2082
+ return r.dayPeriod(i, {
2083
+ width: "narrow",
2084
+ context: "formatting"
2085
+ });
2086
+ case "bbbb":
2087
+ default:
2088
+ return r.dayPeriod(i, {
2089
+ width: "wide",
2090
+ context: "formatting"
2091
+ });
2092
+ }
2093
+ },
2094
+ // in the morning, in the afternoon, in the evening, at night
2095
+ B: function(e, t, r) {
2096
+ const n = e.getHours();
2097
+ let i;
2098
+ switch (n >= 17 ? i = K.evening : n >= 12 ? i = K.afternoon : n >= 4 ? i = K.morning : i = K.night, t) {
2099
+ case "B":
2100
+ case "BB":
2101
+ case "BBB":
2102
+ return r.dayPeriod(i, {
2103
+ width: "abbreviated",
2104
+ context: "formatting"
2105
+ });
2106
+ case "BBBBB":
2107
+ return r.dayPeriod(i, {
2108
+ width: "narrow",
2109
+ context: "formatting"
2110
+ });
2111
+ case "BBBB":
2112
+ default:
2113
+ return r.dayPeriod(i, {
2114
+ width: "wide",
2115
+ context: "formatting"
2116
+ });
2117
+ }
2118
+ },
2119
+ // Hour [1-12]
2120
+ h: function(e, t, r) {
2121
+ if (t === "ho") {
2122
+ let n = e.getHours() % 12;
2123
+ return n === 0 && (n = 12), r.ordinalNumber(n, { unit: "hour" });
2124
+ }
2125
+ return A.h(e, t);
2126
+ },
2127
+ // Hour [0-23]
2128
+ H: function(e, t, r) {
2129
+ return t === "Ho" ? r.ordinalNumber(e.getHours(), { unit: "hour" }) : A.H(e, t);
2130
+ },
2131
+ // Hour [0-11]
2132
+ K: function(e, t, r) {
2133
+ const n = e.getHours() % 12;
2134
+ return t === "Ko" ? r.ordinalNumber(n, { unit: "hour" }) : g(n, t.length);
2135
+ },
2136
+ // Hour [1-24]
2137
+ k: function(e, t, r) {
2138
+ let n = e.getHours();
2139
+ return n === 0 && (n = 24), t === "ko" ? r.ordinalNumber(n, { unit: "hour" }) : g(n, t.length);
2140
+ },
2141
+ // Minute
2142
+ m: function(e, t, r) {
2143
+ return t === "mo" ? r.ordinalNumber(e.getMinutes(), { unit: "minute" }) : A.m(e, t);
2144
+ },
2145
+ // Second
2146
+ s: function(e, t, r) {
2147
+ return t === "so" ? r.ordinalNumber(e.getSeconds(), { unit: "second" }) : A.s(e, t);
2148
+ },
2149
+ // Fraction of second
2150
+ S: function(e, t) {
2151
+ return A.S(e, t);
2152
+ },
2153
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
2154
+ X: function(e, t, r) {
2155
+ const n = e.getTimezoneOffset();
2156
+ if (n === 0)
2157
+ return "Z";
2158
+ switch (t) {
2159
+ case "X":
2160
+ return Xt(n);
2161
+ case "XXXX":
2162
+ case "XX":
2163
+ return z(n);
2164
+ case "XXXXX":
2165
+ case "XXX":
2166
+ default:
2167
+ return z(n, ":");
2168
+ }
2169
+ },
2170
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
2171
+ x: function(e, t, r) {
2172
+ const n = e.getTimezoneOffset();
2173
+ switch (t) {
2174
+ case "x":
2175
+ return Xt(n);
2176
+ case "xxxx":
2177
+ case "xx":
2178
+ return z(n);
2179
+ case "xxxxx":
2180
+ case "xxx":
2181
+ default:
2182
+ return z(n, ":");
2183
+ }
2184
+ },
2185
+ // Timezone (GMT)
2186
+ O: function(e, t, r) {
2187
+ const n = e.getTimezoneOffset();
2188
+ switch (t) {
2189
+ case "O":
2190
+ case "OO":
2191
+ case "OOO":
2192
+ return "GMT" + Vt(n, ":");
2193
+ case "OOOO":
2194
+ default:
2195
+ return "GMT" + z(n, ":");
2196
+ }
2197
+ },
2198
+ // Timezone (specific non-location)
2199
+ z: function(e, t, r) {
2200
+ const n = e.getTimezoneOffset();
2201
+ switch (t) {
2202
+ case "z":
2203
+ case "zz":
2204
+ case "zzz":
2205
+ return "GMT" + Vt(n, ":");
2206
+ case "zzzz":
2207
+ default:
2208
+ return "GMT" + z(n, ":");
2209
+ }
2210
+ },
2211
+ // Seconds timestamp
2212
+ t: function(e, t, r) {
2213
+ const n = Math.trunc(+e / 1e3);
2214
+ return g(n, t.length);
2215
+ },
2216
+ // Milliseconds timestamp
2217
+ T: function(e, t, r) {
2218
+ return g(+e, t.length);
2219
+ }
2220
+ };
2221
+ function Vt(e, t = "") {
2222
+ const r = e > 0 ? "-" : "+", n = Math.abs(e), i = Math.trunc(n / 60), o = n % 60;
2223
+ return o === 0 ? r + String(i) : r + String(i) + t + g(o, 2);
2224
+ }
2225
+ function Xt(e, t) {
2226
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + g(Math.abs(e) / 60, 2) : z(e, t);
2227
+ }
2228
+ function z(e, t = "") {
2229
+ const r = e > 0 ? "-" : "+", n = Math.abs(e), i = g(Math.trunc(n / 60), 2), o = g(n % 60, 2);
2230
+ return r + i + t + o;
2231
+ }
2232
+ const Qt = (e, t) => {
2233
+ switch (e) {
2234
+ case "P":
2235
+ return t.date({ width: "short" });
2236
+ case "PP":
2237
+ return t.date({ width: "medium" });
2238
+ case "PPP":
2239
+ return t.date({ width: "long" });
2240
+ case "PPPP":
2241
+ default:
2242
+ return t.date({ width: "full" });
2243
+ }
2244
+ }, Hr = (e, t) => {
2245
+ switch (e) {
2246
+ case "p":
2247
+ return t.time({ width: "short" });
2248
+ case "pp":
2249
+ return t.time({ width: "medium" });
2250
+ case "ppp":
2251
+ return t.time({ width: "long" });
2252
+ case "pppp":
2253
+ default:
2254
+ return t.time({ width: "full" });
2255
+ }
2256
+ }, Ai = (e, t) => {
2257
+ const r = e.match(/(P+)(p+)?/) || [], n = r[1], i = r[2];
2258
+ if (!i)
2259
+ return Qt(e, t);
2260
+ let o;
2261
+ switch (n) {
2262
+ case "P":
2263
+ o = t.dateTime({ width: "short" });
2264
+ break;
2265
+ case "PP":
2266
+ o = t.dateTime({ width: "medium" });
2267
+ break;
2268
+ case "PPP":
2269
+ o = t.dateTime({ width: "long" });
2270
+ break;
2271
+ case "PPPP":
2272
+ default:
2273
+ o = t.dateTime({ width: "full" });
2274
+ break;
2275
+ }
2276
+ return o.replace("{{date}}", Qt(n, t)).replace("{{time}}", Hr(i, t));
2277
+ }, Gi = {
2278
+ p: Hr,
2279
+ P: Ai
2280
+ }, Fi = /^D+$/, Wi = /^Y+$/, Li = ["D", "DD", "YY", "YYYY"];
2281
+ function Ui(e) {
2282
+ return Fi.test(e);
2283
+ }
2284
+ function zi(e) {
2285
+ return Wi.test(e);
2286
+ }
2287
+ function $i(e, t, r) {
2288
+ const n = Vi(e, t, r);
2289
+ if (console.warn(n), Li.includes(e)) throw new RangeError(n);
2290
+ }
2291
+ function Vi(e, t, r) {
2292
+ const n = e[0] === "Y" ? "years" : "days of the month";
2293
+ return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
2294
+ }
2295
+ const Xi = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Qi = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Zi = /^'([^]*?)'?$/, Bi = /''/g, Ki = /[a-zA-Z]/;
2296
+ function jr(e, t, r) {
2297
+ var _, y, p, E, P, N, k, G;
2298
+ const n = fe(), i = (r == null ? void 0 : r.locale) ?? n.locale ?? Yi, o = (r == null ? void 0 : r.firstWeekContainsDate) ?? ((y = (_ = r == null ? void 0 : r.locale) == null ? void 0 : _.options) == null ? void 0 : y.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((E = (p = n.locale) == null ? void 0 : p.options) == null ? void 0 : E.firstWeekContainsDate) ?? 1, c = (r == null ? void 0 : r.weekStartsOn) ?? ((N = (P = r == null ? void 0 : r.locale) == null ? void 0 : P.options) == null ? void 0 : N.weekStartsOn) ?? n.weekStartsOn ?? ((G = (k = n.locale) == null ? void 0 : k.options) == null ? void 0 : G.weekStartsOn) ?? 0, d = O(e, r == null ? void 0 : r.in);
2299
+ if (!ei(d))
2300
+ throw new RangeError("Invalid time value");
2301
+ let h = t.match(Qi).map((S) => {
2302
+ const T = S[0];
2303
+ if (T === "p" || T === "P") {
2304
+ const F = Gi[T];
2305
+ return F(S, i.formatLong);
2306
+ }
2307
+ return S;
2308
+ }).join("").match(Xi).map((S) => {
2309
+ if (S === "''")
2310
+ return { isToken: !1, value: "'" };
2311
+ const T = S[0];
2312
+ if (T === "'")
2313
+ return { isToken: !1, value: Ji(S) };
2314
+ if ($t[T])
2315
+ return { isToken: !0, value: S };
2316
+ if (T.match(Ki))
2317
+ throw new RangeError(
2318
+ "Format string contains an unescaped latin alphabet character `" + T + "`"
2319
+ );
2320
+ return { isToken: !1, value: S };
2321
+ });
2322
+ i.localize.preprocessor && (h = i.localize.preprocessor(d, h));
2323
+ const f = {
2324
+ firstWeekContainsDate: o,
2325
+ weekStartsOn: c,
2326
+ locale: i
2327
+ };
2328
+ return h.map((S) => {
2329
+ if (!S.isToken) return S.value;
2330
+ const T = S.value;
2331
+ (!(r != null && r.useAdditionalWeekYearTokens) && zi(T) || !(r != null && r.useAdditionalDayOfYearTokens) && Ui(T)) && $i(T, t, String(e));
2332
+ const F = $t[T[0]];
2333
+ return F(d, T, i.localize, f);
2334
+ }).join("");
2335
+ }
2336
+ function Ji(e) {
2337
+ const t = e.match(Zi);
2338
+ return t ? t[1].replace(Bi, "'") : e;
2339
+ }
2340
+ function es(e, t) {
2341
+ const r = O(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = r.getMonth(), o = I(r, 0);
2342
+ return o.setFullYear(n, i + 1, 0), o.setHours(0, 0, 0, 0), o.getDate();
2343
+ }
2344
+ function ts() {
2345
+ return Object.assign({}, fe());
2346
+ }
2347
+ function Zt(e) {
2348
+ return +O(e);
2349
+ }
2350
+ function Bt(e) {
2351
+ return Math.trunc(+O(e) / 1e3);
2352
+ }
2353
+ function rs(e) {
2354
+ return Math.trunc(e * Va);
2355
+ }
2356
+ function ns(e) {
2357
+ const t = e / $a;
2358
+ return Math.trunc(t);
2359
+ }
2360
+ function Ar(e, t, r) {
2361
+ return Xa(e, -t, r);
2362
+ }
2363
+ function Kt(e, t, r) {
2364
+ const n = ts(), i = ss(e, r.timeZone, r.locale ?? n.locale);
2365
+ return "formatToParts" in i ? as(i, t) : is(i, t);
2366
+ }
2367
+ function as(e, t) {
2368
+ const r = e.formatToParts(t);
2369
+ for (let n = r.length - 1; n >= 0; --n)
2370
+ if (r[n].type === "timeZoneName")
2371
+ return r[n].value;
2372
+ }
2373
+ function is(e, t) {
2374
+ const r = e.format(t).replace(/\u200E/g, ""), n = / [\w-+ ]+$/.exec(r);
2375
+ return n ? n[0].substr(1) : "";
2376
+ }
2377
+ function ss(e, t, r) {
2378
+ return new Intl.DateTimeFormat(r ? [r.code, "en-US"] : void 0, {
2379
+ timeZone: t,
2380
+ timeZoneName: e
2381
+ });
2382
+ }
2383
+ function os(e, t) {
2384
+ const r = fs(t);
2385
+ return "formatToParts" in r ? cs(r, e) : ls(r, e);
2386
+ }
2387
+ const us = {
2388
+ year: 0,
2389
+ month: 1,
2390
+ day: 2,
2391
+ hour: 3,
2392
+ minute: 4,
2393
+ second: 5
2394
+ };
2395
+ function cs(e, t) {
2396
+ try {
2397
+ const r = e.formatToParts(t), n = [];
2398
+ for (let i = 0; i < r.length; i++) {
2399
+ const o = us[r[i].type];
2400
+ o !== void 0 && (n[o] = parseInt(r[i].value, 10));
2401
+ }
2402
+ return n;
2403
+ } catch (r) {
2404
+ if (r instanceof RangeError)
2405
+ return [NaN];
2406
+ throw r;
2407
+ }
2408
+ }
2409
+ function ls(e, t) {
2410
+ const r = e.format(t), n = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);
2411
+ return [
2412
+ parseInt(n[3], 10),
2413
+ parseInt(n[1], 10),
2414
+ parseInt(n[2], 10),
2415
+ parseInt(n[4], 10),
2416
+ parseInt(n[5], 10),
2417
+ parseInt(n[6], 10)
2418
+ ];
2419
+ }
2420
+ const Ue = {}, Jt = new Intl.DateTimeFormat("en-US", {
2421
+ hourCycle: "h23",
2422
+ timeZone: "America/New_York",
2423
+ year: "numeric",
2424
+ month: "2-digit",
2425
+ day: "2-digit",
2426
+ hour: "2-digit",
2427
+ minute: "2-digit",
2428
+ second: "2-digit"
2429
+ }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), ds = Jt === "06/25/2014, 00:00:00" || Jt === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
2430
+ function fs(e) {
2431
+ return Ue[e] || (Ue[e] = ds ? new Intl.DateTimeFormat("en-US", {
2432
+ hourCycle: "h23",
2433
+ timeZone: e,
2434
+ year: "numeric",
2435
+ month: "numeric",
2436
+ day: "2-digit",
2437
+ hour: "2-digit",
2438
+ minute: "2-digit",
2439
+ second: "2-digit"
2440
+ }) : new Intl.DateTimeFormat("en-US", {
2441
+ hour12: !1,
2442
+ timeZone: e,
2443
+ year: "numeric",
2444
+ month: "numeric",
2445
+ day: "2-digit",
2446
+ hour: "2-digit",
2447
+ minute: "2-digit",
2448
+ second: "2-digit"
2449
+ })), Ue[e];
2450
+ }
2451
+ function st(e, t, r, n, i, o, c) {
2452
+ const d = /* @__PURE__ */ new Date(0);
2453
+ return d.setUTCFullYear(e, t, r), d.setUTCHours(n, i, o, c), d;
2454
+ }
2455
+ const er = 36e5, hs = 6e4, ze = {
2456
+ timezone: /([Z+-].*)$/,
2457
+ timezoneZ: /^(Z)$/,
2458
+ timezoneHH: /^([+-]\d{2})$/,
2459
+ timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
2460
+ };
2461
+ function he(e, t, r) {
2462
+ if (!e)
2463
+ return 0;
2464
+ let n = ze.timezoneZ.exec(e);
2465
+ if (n)
2466
+ return 0;
2467
+ let i, o;
2468
+ if (n = ze.timezoneHH.exec(e), n)
2469
+ return i = parseInt(n[1], 10), tr(i) ? -(i * er) : NaN;
2470
+ if (n = ze.timezoneHHMM.exec(e), n) {
2471
+ i = parseInt(n[2], 10);
2472
+ const c = parseInt(n[3], 10);
2473
+ return tr(i, c) ? (o = Math.abs(i) * er + c * hs, n[1] === "+" ? -o : o) : NaN;
2474
+ }
2475
+ if (ps(e)) {
2476
+ t = new Date(t || Date.now());
2477
+ const c = r ? t : ms(t), d = Qe(c, e);
2478
+ return -(r ? d : ys(t, d, e));
2479
+ }
2480
+ return NaN;
2481
+ }
2482
+ function ms(e) {
2483
+ return st(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
2484
+ }
2485
+ function Qe(e, t) {
2486
+ const r = os(e, t), n = st(r[0], r[1] - 1, r[2], r[3] % 24, r[4], r[5], 0).getTime();
2487
+ let i = e.getTime();
2488
+ const o = i % 1e3;
2489
+ return i -= o >= 0 ? o : 1e3 + o, n - i;
2490
+ }
2491
+ function ys(e, t, r) {
2492
+ let i = e.getTime() - t;
2493
+ const o = Qe(new Date(i), r);
2494
+ if (t === o)
2495
+ return t;
2496
+ i -= o - t;
2497
+ const c = Qe(new Date(i), r);
2498
+ return o === c ? o : Math.max(o, c);
2499
+ }
2500
+ function tr(e, t) {
2501
+ return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
2502
+ }
2503
+ const rr = {};
2504
+ function ps(e) {
2505
+ if (rr[e])
2506
+ return !0;
2507
+ try {
2508
+ return new Intl.DateTimeFormat(void 0, { timeZone: e }), rr[e] = !0, !0;
2509
+ } catch {
2510
+ return !1;
2511
+ }
2512
+ }
2513
+ const gs = 60 * 1e3, _s = {
2514
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
2515
+ X: function(e, t, r) {
2516
+ const n = $e(r.timeZone, e);
2517
+ if (n === 0)
2518
+ return "Z";
2519
+ switch (t) {
2520
+ case "X":
2521
+ return nr(n);
2522
+ case "XXXX":
2523
+ case "XX":
2524
+ return J(n);
2525
+ case "XXXXX":
2526
+ case "XXX":
2527
+ default:
2528
+ return J(n, ":");
2529
+ }
2530
+ },
2531
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
2532
+ x: function(e, t, r) {
2533
+ const n = $e(r.timeZone, e);
2534
+ switch (t) {
2535
+ case "x":
2536
+ return nr(n);
2537
+ case "xxxx":
2538
+ case "xx":
2539
+ return J(n);
2540
+ case "xxxxx":
2541
+ case "xxx":
2542
+ default:
2543
+ return J(n, ":");
2544
+ }
2545
+ },
2546
+ // Timezone (GMT)
2547
+ O: function(e, t, r) {
2548
+ const n = $e(r.timeZone, e);
2549
+ switch (t) {
2550
+ case "O":
2551
+ case "OO":
2552
+ case "OOO":
2553
+ return "GMT" + ws(n, ":");
2554
+ case "OOOO":
2555
+ default:
2556
+ return "GMT" + J(n, ":");
2557
+ }
2558
+ },
2559
+ // Timezone (specific non-location)
2560
+ z: function(e, t, r) {
2561
+ switch (t) {
2562
+ case "z":
2563
+ case "zz":
2564
+ case "zzz":
2565
+ return Kt("short", e, r);
2566
+ case "zzzz":
2567
+ default:
2568
+ return Kt("long", e, r);
2569
+ }
2570
+ }
2571
+ };
2572
+ function $e(e, t) {
2573
+ const r = e ? he(e, t, !0) / gs : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
2574
+ if (Number.isNaN(r))
2575
+ throw new RangeError("Invalid time zone specified: " + e);
2576
+ return r;
2577
+ }
2578
+ function Se(e, t) {
2579
+ const r = e < 0 ? "-" : "";
2580
+ let n = Math.abs(e).toString();
2581
+ for (; n.length < t; )
2582
+ n = "0" + n;
2583
+ return r + n;
2584
+ }
2585
+ function J(e, t = "") {
2586
+ const r = e > 0 ? "-" : "+", n = Math.abs(e), i = Se(Math.floor(n / 60), 2), o = Se(Math.floor(n % 60), 2);
2587
+ return r + i + t + o;
2588
+ }
2589
+ function nr(e, t) {
2590
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + Se(Math.abs(e) / 60, 2) : J(e, t);
2591
+ }
2592
+ function ws(e, t = "") {
2593
+ const r = e > 0 ? "-" : "+", n = Math.abs(e), i = Math.floor(n / 60), o = n % 60;
2594
+ return o === 0 ? r + String(i) : r + String(i) + t + Se(o, 2);
2595
+ }
2596
+ function ar(e) {
2597
+ const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
2598
+ return t.setUTCFullYear(e.getFullYear()), +e - +t;
2599
+ }
2600
+ const Gr = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Ve = 36e5, ir = 6e4, bs = 2, M = {
2601
+ dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
2602
+ datePattern: /^([0-9W+-]+)(.*)/,
2603
+ plainTime: /:/,
2604
+ // year tokens
2605
+ YY: /^(\d{2})$/,
2606
+ YYY: [
2607
+ /^([+-]\d{2})$/,
2608
+ // 0 additional digits
2609
+ /^([+-]\d{3})$/,
2610
+ // 1 additional digit
2611
+ /^([+-]\d{4})$/
2612
+ // 2 additional digits
2613
+ ],
2614
+ YYYY: /^(\d{4})/,
2615
+ YYYYY: [
2616
+ /^([+-]\d{4})/,
2617
+ // 0 additional digits
2618
+ /^([+-]\d{5})/,
2619
+ // 1 additional digit
2620
+ /^([+-]\d{6})/
2621
+ // 2 additional digits
2622
+ ],
2623
+ // date tokens
2624
+ MM: /^-(\d{2})$/,
2625
+ DDD: /^-?(\d{3})$/,
2626
+ MMDD: /^-?(\d{2})-?(\d{2})$/,
2627
+ Www: /^-?W(\d{2})$/,
2628
+ WwwD: /^-?W(\d{2})-?(\d{1})$/,
2629
+ HH: /^(\d{2}([.,]\d*)?)$/,
2630
+ HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
2631
+ HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
2632
+ // time zone tokens (to identify the presence of a tz)
2633
+ timeZone: Gr
2634
+ };
2635
+ function Me(e, t = {}) {
2636
+ if (arguments.length < 1)
2637
+ throw new TypeError("1 argument required, but only " + arguments.length + " present");
2638
+ if (e === null)
2639
+ return /* @__PURE__ */ new Date(NaN);
2640
+ const r = t.additionalDigits == null ? bs : Number(t.additionalDigits);
2641
+ if (r !== 2 && r !== 1 && r !== 0)
2642
+ throw new RangeError("additionalDigits must be 0, 1 or 2");
2643
+ if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
2644
+ return new Date(e.getTime());
2645
+ if (typeof e == "number" || Object.prototype.toString.call(e) === "[object Number]")
2646
+ return new Date(e);
2647
+ if (Object.prototype.toString.call(e) !== "[object String]")
2648
+ return /* @__PURE__ */ new Date(NaN);
2649
+ const n = Ts(e), { year: i, restDateString: o } = Ds(n.date, r), c = Os(o, i);
2650
+ if (c === null || isNaN(c.getTime()))
2651
+ return /* @__PURE__ */ new Date(NaN);
2652
+ if (c) {
2653
+ const d = c.getTime();
2654
+ let h = 0, f;
2655
+ if (n.time && (h = Ss(n.time), h === null || isNaN(h)))
2656
+ return /* @__PURE__ */ new Date(NaN);
2657
+ if (n.timeZone || t.timeZone) {
2658
+ if (f = he(n.timeZone || t.timeZone, new Date(d + h)), isNaN(f))
2659
+ return /* @__PURE__ */ new Date(NaN);
2660
+ } else
2661
+ f = ar(new Date(d + h)), f = ar(new Date(d + h + f));
2662
+ return new Date(d + h + f);
2663
+ } else
2664
+ return /* @__PURE__ */ new Date(NaN);
2665
+ }
2666
+ function Ts(e) {
2667
+ const t = {};
2668
+ let r = M.dateTimePattern.exec(e), n;
2669
+ if (r ? (t.date = r[1], n = r[3]) : (r = M.datePattern.exec(e), r ? (t.date = r[1], n = r[2]) : (t.date = null, n = e)), n) {
2670
+ const i = M.timeZone.exec(n);
2671
+ i ? (t.time = n.replace(i[1], ""), t.timeZone = i[1].trim()) : t.time = n;
2672
+ }
2673
+ return t;
2674
+ }
2675
+ function Ds(e, t) {
2676
+ if (e) {
2677
+ const r = M.YYY[t], n = M.YYYYY[t];
2678
+ let i = M.YYYY.exec(e) || n.exec(e);
2679
+ if (i) {
2680
+ const o = i[1];
2681
+ return {
2682
+ year: parseInt(o, 10),
2683
+ restDateString: e.slice(o.length)
2684
+ };
2685
+ }
2686
+ if (i = M.YY.exec(e) || r.exec(e), i) {
2687
+ const o = i[1];
2688
+ return {
2689
+ year: parseInt(o, 10) * 100,
2690
+ restDateString: e.slice(o.length)
2691
+ };
2692
+ }
2693
+ }
2694
+ return {
2695
+ year: null
2696
+ };
2697
+ }
2698
+ function Os(e, t) {
2699
+ if (t === null)
2700
+ return null;
2701
+ let r, n, i;
2702
+ if (!e || !e.length)
2703
+ return r = /* @__PURE__ */ new Date(0), r.setUTCFullYear(t), r;
2704
+ let o = M.MM.exec(e);
2705
+ if (o)
2706
+ return r = /* @__PURE__ */ new Date(0), n = parseInt(o[1], 10) - 1, or(t, n) ? (r.setUTCFullYear(t, n), r) : /* @__PURE__ */ new Date(NaN);
2707
+ if (o = M.DDD.exec(e), o) {
2708
+ r = /* @__PURE__ */ new Date(0);
2709
+ const c = parseInt(o[1], 10);
2710
+ return xs(t, c) ? (r.setUTCFullYear(t, 0, c), r) : /* @__PURE__ */ new Date(NaN);
2711
+ }
2712
+ if (o = M.MMDD.exec(e), o) {
2713
+ r = /* @__PURE__ */ new Date(0), n = parseInt(o[1], 10) - 1;
2714
+ const c = parseInt(o[2], 10);
2715
+ return or(t, n, c) ? (r.setUTCFullYear(t, n, c), r) : /* @__PURE__ */ new Date(NaN);
2716
+ }
2717
+ if (o = M.Www.exec(e), o)
2718
+ return i = parseInt(o[1], 10) - 1, ur(i) ? sr(t, i) : /* @__PURE__ */ new Date(NaN);
2719
+ if (o = M.WwwD.exec(e), o) {
2720
+ i = parseInt(o[1], 10) - 1;
2721
+ const c = parseInt(o[2], 10) - 1;
2722
+ return ur(i, c) ? sr(t, i, c) : /* @__PURE__ */ new Date(NaN);
2723
+ }
2724
+ return null;
2725
+ }
2726
+ function Ss(e) {
2727
+ let t, r, n = M.HH.exec(e);
2728
+ if (n)
2729
+ return t = parseFloat(n[1].replace(",", ".")), Xe(t) ? t % 24 * Ve : NaN;
2730
+ if (n = M.HHMM.exec(e), n)
2731
+ return t = parseInt(n[1], 10), r = parseFloat(n[2].replace(",", ".")), Xe(t, r) ? t % 24 * Ve + r * ir : NaN;
2732
+ if (n = M.HHMMSS.exec(e), n) {
2733
+ t = parseInt(n[1], 10), r = parseInt(n[2], 10);
2734
+ const i = parseFloat(n[3].replace(",", "."));
2735
+ return Xe(t, r, i) ? t % 24 * Ve + r * ir + i * 1e3 : NaN;
2736
+ }
2737
+ return null;
2738
+ }
2739
+ function sr(e, t, r) {
2740
+ t = t || 0, r = r || 0;
2741
+ const n = /* @__PURE__ */ new Date(0);
2742
+ n.setUTCFullYear(e, 0, 4);
2743
+ const i = n.getUTCDay() || 7, o = t * 7 + r + 1 - i;
2744
+ return n.setUTCDate(n.getUTCDate() + o), n;
2745
+ }
2746
+ const Ms = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], vs = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2747
+ function Fr(e) {
2748
+ return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
2749
+ }
2750
+ function or(e, t, r) {
2751
+ if (t < 0 || t > 11)
2752
+ return !1;
2753
+ if (r != null) {
2754
+ if (r < 1)
2755
+ return !1;
2756
+ const n = Fr(e);
2757
+ if (n && r > vs[t] || !n && r > Ms[t])
2758
+ return !1;
2759
+ }
2760
+ return !0;
2761
+ }
2762
+ function xs(e, t) {
2763
+ if (t < 1)
2764
+ return !1;
2765
+ const r = Fr(e);
2766
+ return !(r && t > 366 || !r && t > 365);
2767
+ }
2768
+ function ur(e, t) {
2769
+ return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
2770
+ }
2771
+ function Xe(e, t, r) {
2772
+ return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || r != null && (r < 0 || r >= 60));
2773
+ }
2774
+ const Es = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
2775
+ function Ps(e, t, r = {}) {
2776
+ t = String(t);
2777
+ const n = t.match(Es);
2778
+ if (n) {
2779
+ const i = Me(r.originalDate || e, r);
2780
+ t = n.reduce(function(o, c) {
2781
+ if (c[0] === "'")
2782
+ return o;
2783
+ const d = o.indexOf(c), h = o[d - 1] === "'", f = o.replace(c, "'" + _s[c[0]](i, c, r) + "'");
2784
+ return h ? f.substring(0, d - 1) + f.substring(d + 1) : f;
2785
+ }, t);
2786
+ }
2787
+ return jr(e, t, r);
2788
+ }
2789
+ function Wr(e, t, r) {
2790
+ e = Me(e, r);
2791
+ const n = he(t, e, !0), i = new Date(e.getTime() - n), o = /* @__PURE__ */ new Date(0);
2792
+ return o.setFullYear(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate()), o.setHours(i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds()), o;
2793
+ }
2794
+ function Ns(e, t, r, n) {
2795
+ return n = {
2796
+ ...n,
2797
+ timeZone: t,
2798
+ originalDate: e
2799
+ }, Ps(Wr(e, t, { timeZone: n.timeZone }), r, n);
2800
+ }
2801
+ function Cs(e, t, r) {
2802
+ if (typeof e == "string" && !e.match(Gr))
2803
+ return Me(e, { ...r, timeZone: t });
2804
+ e = Me(e, r);
2805
+ const n = st(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), i = he(t, new Date(n));
2806
+ return new Date(n + i);
2807
+ }
2808
+ function Lr(e, t) {
2809
+ return -he(e, t);
2810
+ }
2811
+ function so(e) {
2812
+ return jr(e, "yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
2813
+ }
2814
+ function cr(e, t = {}) {
2815
+ if (!e)
2816
+ return e;
2817
+ const r = t.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
2818
+ try {
2819
+ let n = "MMM dd, yyy hh:mm a";
2820
+ t.short && (n = "MMM dd, yyy"), t.includeTZ && (n += " (z)");
2821
+ const i = new Date(e);
2822
+ return Ns(i, r, n);
2823
+ } catch {
2824
+ return console.error("Invalid value passed to formatTime", e), "(invalid date)";
2825
+ }
2826
+ }
2827
+ function oo(e, t) {
2828
+ return `${cr(e.getTime())} - ${cr(t.getTime(), { includeTZ: !0 })}`;
2829
+ }
2830
+ const ve = {
2831
+ secondly: 1e3,
2832
+ tenSecondly: 10 * 1e3,
2833
+ thirtySecondly: 30 * 1e3,
2834
+ minutely: 60 * 1e3,
2835
+ fiveMinutely: 5 * 60 * 1e3,
2836
+ tenMinutely: 10 * 60 * 1e3,
2837
+ thirtyMinutely: 30 * 60 * 1e3,
2838
+ hourly: 60 * 60 * 1e3,
2839
+ twoHourly: 2 * 60 * 60 * 1e3,
2840
+ twelveHourly: 12 * 60 * 60 * 1e3,
2841
+ daily: 60 * 60 * 24 * 1e3,
2842
+ weekly: 60 * 60 * 24 * 7 * 1e3,
2843
+ trend: 0
2844
+ };
2845
+ function uo(e, t) {
2846
+ return e.map((r) => ({
2847
+ value: r,
2848
+ label: t.t(`configuration.vitals.reports.granularity.${r}`)
2849
+ }));
2850
+ }
2851
+ function Is(e, t) {
2852
+ return {
2853
+ duration: e,
2854
+ type: "duration",
2855
+ origin: t
2856
+ };
2857
+ }
2858
+ function co(e) {
2859
+ return e && Ze.find((r) => e <= ve[r]) || null;
2860
+ }
2861
+ function Ur(e, t, r, n) {
2862
+ const i = ve[r];
2863
+ let o = 0;
2864
+ return i >= ve.daily && (n ? o = -Lr(n, t) : o = t.getTimezoneOffset() * 60 * 1e3), new Date(e((t.getTime() - o) / i) * i + o);
2865
+ }
2866
+ function ks(e, t, r) {
2867
+ return Ur(Math.floor, e, t, r);
2868
+ }
2869
+ function zr(e, t, r) {
2870
+ return Ur(Math.ceil, e, t, r);
2871
+ }
2872
+ class Ce {
2873
+ constructor(t, r, n) {
2874
+ b(this, "timeframe");
2875
+ b(this, "tz");
2876
+ b(this, "dataGranularity");
2877
+ if (this.constructor === Ce)
2878
+ throw new Error("BaseQueryTime is not meant to be used directly.");
2879
+ this.timeframe = t, this.tz = r, this.dataGranularity = n ?? t.dataGranularity;
2880
+ }
2881
+ calculateStartDate(t, r, n = 1) {
2882
+ if (t)
2883
+ return new Date(this.endDate().getTime() - this.timeframe.timeframeLengthMs() * n);
2884
+ {
2885
+ const i = this.endDate(), o = this.timeframe.rawStart(this.tz), c = ks(o, r, this.tz), h = (i.getTime() - c.getTime()) * (n - 1);
2886
+ return new Date(c.getTime() - h);
2887
+ }
2888
+ }
2889
+ granularitySeconds() {
2890
+ return Math.floor(this.granularityMs() / 1e3);
2891
+ }
2892
+ granularityDruid() {
2893
+ return Is(this.granularityMs(), this.startDate().toISOString());
2894
+ }
2895
+ // Return a UNIX timestamp suitable for use in the `start` query param.
2896
+ startSeconds() {
2897
+ return Bt(this.startDate());
2898
+ }
2899
+ // Return a UNIX timestamp suitable for use in the `end` query param.
2900
+ endSeconds() {
2901
+ return Bt(this.endDate());
2902
+ }
2903
+ // Return epoch time in milliseconds, suitable for use in the `startMs` query param.
2904
+ startMs() {
2905
+ return Zt(this.startDate());
2906
+ }
2907
+ // Return epoch time in milliseconds, suitable for use in the `endMs` query param.
2908
+ endMs() {
2909
+ return Zt(this.endDate());
2910
+ }
2911
+ }
2912
+ class lo extends Ce {
2913
+ constructor(r, n, i, o, c) {
2914
+ super(r, i, o);
2915
+ b(this, "granularity");
2916
+ n && r.allowedGranularities(c).has(n) ? this.granularity = n : c ? this.granularity = r.fineGrainedDefaultGranularity ?? r.defaultResponseGranularity : this.granularity = r.defaultResponseGranularity;
2917
+ }
2918
+ startDate() {
2919
+ return this.calculateStartDate(this.timeframe.isRelative, this.granularity);
2920
+ }
2921
+ endDate() {
2922
+ return zr(this.timeframe.rawEnd(), this.granularity, this.tz);
2923
+ }
2924
+ granularityMs() {
2925
+ return ve[this.granularity];
2926
+ }
2927
+ }
2928
+ class Ys extends Ce {
2929
+ startDate() {
2930
+ return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity);
2931
+ }
2932
+ endDate() {
2933
+ return zr(this.timeframe.rawEnd(this.tz), this.dataGranularity, this.tz);
2934
+ }
2935
+ granularityMs() {
2936
+ return this.endDate().getTime() - this.startDate().getTime();
2937
+ }
2938
+ }
2939
+ class fo extends Ys {
2940
+ startDate() {
2941
+ return this.calculateStartDate(this.timeframe.isRelative, this.dataGranularity, 2);
2942
+ }
2943
+ granularityMs() {
2944
+ return this.endDate().getTime() - super.startDate().getTime();
2945
+ }
2946
+ }
2947
+ var Te = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2948
+ function Rs(e) {
2949
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2950
+ }
2951
+ var xe = { exports: {} };
2952
+ xe.exports;
2953
+ (function(e, t) {
2954
+ var r = 200, n = "__lodash_hash_undefined__", i = 9007199254740991, o = "[object Arguments]", c = "[object Array]", d = "[object Boolean]", h = "[object Date]", f = "[object Error]", _ = "[object Function]", y = "[object GeneratorFunction]", p = "[object Map]", E = "[object Number]", P = "[object Object]", N = "[object Promise]", k = "[object RegExp]", G = "[object Set]", S = "[object String]", T = "[object Symbol]", F = "[object WeakMap]", ut = "[object ArrayBuffer]", me = "[object DataView]", ct = "[object Float32Array]", lt = "[object Float64Array]", dt = "[object Int8Array]", ft = "[object Int16Array]", ht = "[object Int32Array]", mt = "[object Uint8Array]", yt = "[object Uint8ClampedArray]", pt = "[object Uint16Array]", gt = "[object Uint32Array]", Vr = /[\\^$.*+?()[\]{}|]/g, Xr = /\w*$/, Qr = /^\[object .+?Constructor\]$/, Zr = /^(?:0|[1-9]\d*)$/, w = {};
2955
+ w[o] = w[c] = w[ut] = w[me] = w[d] = w[h] = w[ct] = w[lt] = w[dt] = w[ft] = w[ht] = w[p] = w[E] = w[P] = w[k] = w[G] = w[S] = w[T] = w[mt] = w[yt] = w[pt] = w[gt] = !0, w[f] = w[_] = w[F] = !1;
2956
+ var Br = typeof Te == "object" && Te && Te.Object === Object && Te, Kr = typeof self == "object" && self && self.Object === Object && self, Y = Br || Kr || Function("return this")(), _t = t && !t.nodeType && t, wt = _t && !0 && e && !e.nodeType && e, Jr = wt && wt.exports === _t;
2957
+ function en(a, s) {
2958
+ return a.set(s[0], s[1]), a;
2959
+ }
2960
+ function tn(a, s) {
2961
+ return a.add(s), a;
2962
+ }
2963
+ function rn(a, s) {
2964
+ for (var u = -1, l = a ? a.length : 0; ++u < l && s(a[u], u, a) !== !1; )
2965
+ ;
2966
+ return a;
2967
+ }
2968
+ function nn(a, s) {
2969
+ for (var u = -1, l = s.length, D = a.length; ++u < l; )
2970
+ a[D + u] = s[u];
2971
+ return a;
2972
+ }
2973
+ function bt(a, s, u, l) {
2974
+ for (var D = -1, v = a ? a.length : 0; ++D < v; )
2975
+ u = s(u, a[D], D, a);
2976
+ return u;
2977
+ }
2978
+ function an(a, s) {
2979
+ for (var u = -1, l = Array(a); ++u < a; )
2980
+ l[u] = s(u);
2981
+ return l;
2982
+ }
2983
+ function sn(a, s) {
2984
+ return a == null ? void 0 : a[s];
2985
+ }
2986
+ function Tt(a) {
2987
+ var s = !1;
2988
+ if (a != null && typeof a.toString != "function")
2989
+ try {
2990
+ s = !!(a + "");
2991
+ } catch {
2992
+ }
2993
+ return s;
2994
+ }
2995
+ function Dt(a) {
2996
+ var s = -1, u = Array(a.size);
2997
+ return a.forEach(function(l, D) {
2998
+ u[++s] = [D, l];
2999
+ }), u;
3000
+ }
3001
+ function Ie(a, s) {
3002
+ return function(u) {
3003
+ return a(s(u));
3004
+ };
3005
+ }
3006
+ function Ot(a) {
3007
+ var s = -1, u = Array(a.size);
3008
+ return a.forEach(function(l) {
3009
+ u[++s] = l;
3010
+ }), u;
3011
+ }
3012
+ var on = Array.prototype, un = Function.prototype, ye = Object.prototype, ke = Y["__core-js_shared__"], St = function() {
3013
+ var a = /[^.]+$/.exec(ke && ke.keys && ke.keys.IE_PROTO || "");
3014
+ return a ? "Symbol(src)_1." + a : "";
3015
+ }(), Mt = un.toString, j = ye.hasOwnProperty, pe = ye.toString, cn = RegExp(
3016
+ "^" + Mt.call(j).replace(Vr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
3017
+ ), vt = Jr ? Y.Buffer : void 0, xt = Y.Symbol, Et = Y.Uint8Array, ln = Ie(Object.getPrototypeOf, Object), dn = Object.create, fn = ye.propertyIsEnumerable, hn = on.splice, Pt = Object.getOwnPropertySymbols, mn = vt ? vt.isBuffer : void 0, yn = Ie(Object.keys, Object), Ye = Z(Y, "DataView"), re = Z(Y, "Map"), Re = Z(Y, "Promise"), qe = Z(Y, "Set"), He = Z(Y, "WeakMap"), ne = Z(Object, "create"), pn = U(Ye), gn = U(re), _n = U(Re), wn = U(qe), bn = U(He), Nt = xt ? xt.prototype : void 0, Ct = Nt ? Nt.valueOf : void 0;
3018
+ function W(a) {
3019
+ var s = -1, u = a ? a.length : 0;
3020
+ for (this.clear(); ++s < u; ) {
3021
+ var l = a[s];
3022
+ this.set(l[0], l[1]);
3023
+ }
3024
+ }
3025
+ function Tn() {
3026
+ this.__data__ = ne ? ne(null) : {};
3027
+ }
3028
+ function Dn(a) {
3029
+ return this.has(a) && delete this.__data__[a];
3030
+ }
3031
+ function On(a) {
3032
+ var s = this.__data__;
3033
+ if (ne) {
3034
+ var u = s[a];
3035
+ return u === n ? void 0 : u;
3036
+ }
3037
+ return j.call(s, a) ? s[a] : void 0;
3038
+ }
3039
+ function Sn(a) {
3040
+ var s = this.__data__;
3041
+ return ne ? s[a] !== void 0 : j.call(s, a);
3042
+ }
3043
+ function Mn(a, s) {
3044
+ var u = this.__data__;
3045
+ return u[a] = ne && s === void 0 ? n : s, this;
3046
+ }
3047
+ W.prototype.clear = Tn, W.prototype.delete = Dn, W.prototype.get = On, W.prototype.has = Sn, W.prototype.set = Mn;
3048
+ function R(a) {
3049
+ var s = -1, u = a ? a.length : 0;
3050
+ for (this.clear(); ++s < u; ) {
3051
+ var l = a[s];
3052
+ this.set(l[0], l[1]);
3053
+ }
3054
+ }
3055
+ function vn() {
3056
+ this.__data__ = [];
3057
+ }
3058
+ function xn(a) {
3059
+ var s = this.__data__, u = ge(s, a);
3060
+ if (u < 0)
3061
+ return !1;
3062
+ var l = s.length - 1;
3063
+ return u == l ? s.pop() : hn.call(s, u, 1), !0;
3064
+ }
3065
+ function En(a) {
3066
+ var s = this.__data__, u = ge(s, a);
3067
+ return u < 0 ? void 0 : s[u][1];
3068
+ }
3069
+ function Pn(a) {
3070
+ return ge(this.__data__, a) > -1;
3071
+ }
3072
+ function Nn(a, s) {
3073
+ var u = this.__data__, l = ge(u, a);
3074
+ return l < 0 ? u.push([a, s]) : u[l][1] = s, this;
3075
+ }
3076
+ R.prototype.clear = vn, R.prototype.delete = xn, R.prototype.get = En, R.prototype.has = Pn, R.prototype.set = Nn;
3077
+ function X(a) {
3078
+ var s = -1, u = a ? a.length : 0;
3079
+ for (this.clear(); ++s < u; ) {
3080
+ var l = a[s];
3081
+ this.set(l[0], l[1]);
3082
+ }
3083
+ }
3084
+ function Cn() {
3085
+ this.__data__ = {
3086
+ hash: new W(),
3087
+ map: new (re || R)(),
3088
+ string: new W()
3089
+ };
3090
+ }
3091
+ function In(a) {
3092
+ return _e(this, a).delete(a);
3093
+ }
3094
+ function kn(a) {
3095
+ return _e(this, a).get(a);
3096
+ }
3097
+ function Yn(a) {
3098
+ return _e(this, a).has(a);
3099
+ }
3100
+ function Rn(a, s) {
3101
+ return _e(this, a).set(a, s), this;
3102
+ }
3103
+ X.prototype.clear = Cn, X.prototype.delete = In, X.prototype.get = kn, X.prototype.has = Yn, X.prototype.set = Rn;
3104
+ function Q(a) {
3105
+ this.__data__ = new R(a);
3106
+ }
3107
+ function qn() {
3108
+ this.__data__ = new R();
3109
+ }
3110
+ function Hn(a) {
3111
+ return this.__data__.delete(a);
3112
+ }
3113
+ function jn(a) {
3114
+ return this.__data__.get(a);
3115
+ }
3116
+ function An(a) {
3117
+ return this.__data__.has(a);
3118
+ }
3119
+ function Gn(a, s) {
3120
+ var u = this.__data__;
3121
+ if (u instanceof R) {
3122
+ var l = u.__data__;
3123
+ if (!re || l.length < r - 1)
3124
+ return l.push([a, s]), this;
3125
+ u = this.__data__ = new X(l);
3126
+ }
3127
+ return u.set(a, s), this;
3128
+ }
3129
+ Q.prototype.clear = qn, Q.prototype.delete = Hn, Q.prototype.get = jn, Q.prototype.has = An, Q.prototype.set = Gn;
3130
+ function Fn(a, s) {
3131
+ var u = Ge(a) || da(a) ? an(a.length, String) : [], l = u.length, D = !!l;
3132
+ for (var v in a)
3133
+ j.call(a, v) && !(D && (v == "length" || oa(v, l))) && u.push(v);
3134
+ return u;
3135
+ }
3136
+ function It(a, s, u) {
3137
+ var l = a[s];
3138
+ (!(j.call(a, s) && qt(l, u)) || u === void 0 && !(s in a)) && (a[s] = u);
3139
+ }
3140
+ function ge(a, s) {
3141
+ for (var u = a.length; u--; )
3142
+ if (qt(a[u][0], s))
3143
+ return u;
3144
+ return -1;
3145
+ }
3146
+ function Wn(a, s) {
3147
+ return a && kt(s, Fe(s), a);
3148
+ }
3149
+ function je(a, s, u, l, D, v, q) {
3150
+ var x;
3151
+ if (l && (x = v ? l(a, D, v, q) : l(a)), x !== void 0)
3152
+ return x;
3153
+ if (!we(a))
3154
+ return a;
3155
+ var At = Ge(a);
3156
+ if (At) {
3157
+ if (x = aa(a), !s)
3158
+ return ta(a, x);
3159
+ } else {
3160
+ var B = L(a), Gt = B == _ || B == y;
3161
+ if (ha(a))
3162
+ return Xn(a, s);
3163
+ if (B == P || B == o || Gt && !v) {
3164
+ if (Tt(a))
3165
+ return v ? a : {};
3166
+ if (x = ia(Gt ? {} : a), !s)
3167
+ return ra(a, Wn(x, a));
3168
+ } else {
3169
+ if (!w[B])
3170
+ return v ? a : {};
3171
+ x = sa(a, B, je, s);
3172
+ }
3173
+ }
3174
+ q || (q = new Q());
3175
+ var Ft = q.get(a);
3176
+ if (Ft)
3177
+ return Ft;
3178
+ if (q.set(a, x), !At)
3179
+ var Wt = u ? na(a) : Fe(a);
3180
+ return rn(Wt || a, function(We, be) {
3181
+ Wt && (be = We, We = a[be]), It(x, be, je(We, s, u, l, be, a, q));
3182
+ }), x;
3183
+ }
3184
+ function Ln(a) {
3185
+ return we(a) ? dn(a) : {};
3186
+ }
3187
+ function Un(a, s, u) {
3188
+ var l = s(a);
3189
+ return Ge(a) ? l : nn(l, u(a));
3190
+ }
3191
+ function zn(a) {
3192
+ return pe.call(a);
3193
+ }
3194
+ function $n(a) {
3195
+ if (!we(a) || ca(a))
3196
+ return !1;
3197
+ var s = jt(a) || Tt(a) ? cn : Qr;
3198
+ return s.test(U(a));
3199
+ }
3200
+ function Vn(a) {
3201
+ if (!Rt(a))
3202
+ return yn(a);
3203
+ var s = [];
3204
+ for (var u in Object(a))
3205
+ j.call(a, u) && u != "constructor" && s.push(u);
3206
+ return s;
3207
+ }
3208
+ function Xn(a, s) {
3209
+ if (s)
3210
+ return a.slice();
3211
+ var u = new a.constructor(a.length);
3212
+ return a.copy(u), u;
3213
+ }
3214
+ function Ae(a) {
3215
+ var s = new a.constructor(a.byteLength);
3216
+ return new Et(s).set(new Et(a)), s;
3217
+ }
3218
+ function Qn(a, s) {
3219
+ var u = s ? Ae(a.buffer) : a.buffer;
3220
+ return new a.constructor(u, a.byteOffset, a.byteLength);
3221
+ }
3222
+ function Zn(a, s, u) {
3223
+ var l = s ? u(Dt(a), !0) : Dt(a);
3224
+ return bt(l, en, new a.constructor());
3225
+ }
3226
+ function Bn(a) {
3227
+ var s = new a.constructor(a.source, Xr.exec(a));
3228
+ return s.lastIndex = a.lastIndex, s;
3229
+ }
3230
+ function Kn(a, s, u) {
3231
+ var l = s ? u(Ot(a), !0) : Ot(a);
3232
+ return bt(l, tn, new a.constructor());
3233
+ }
3234
+ function Jn(a) {
3235
+ return Ct ? Object(Ct.call(a)) : {};
3236
+ }
3237
+ function ea(a, s) {
3238
+ var u = s ? Ae(a.buffer) : a.buffer;
3239
+ return new a.constructor(u, a.byteOffset, a.length);
3240
+ }
3241
+ function ta(a, s) {
3242
+ var u = -1, l = a.length;
3243
+ for (s || (s = Array(l)); ++u < l; )
3244
+ s[u] = a[u];
3245
+ return s;
3246
+ }
3247
+ function kt(a, s, u, l) {
3248
+ u || (u = {});
3249
+ for (var D = -1, v = s.length; ++D < v; ) {
3250
+ var q = s[D], x = void 0;
3251
+ It(u, q, x === void 0 ? a[q] : x);
3252
+ }
3253
+ return u;
3254
+ }
3255
+ function ra(a, s) {
3256
+ return kt(a, Yt(a), s);
3257
+ }
3258
+ function na(a) {
3259
+ return Un(a, Fe, Yt);
3260
+ }
3261
+ function _e(a, s) {
3262
+ var u = a.__data__;
3263
+ return ua(s) ? u[typeof s == "string" ? "string" : "hash"] : u.map;
3264
+ }
3265
+ function Z(a, s) {
3266
+ var u = sn(a, s);
3267
+ return $n(u) ? u : void 0;
3268
+ }
3269
+ var Yt = Pt ? Ie(Pt, Object) : pa, L = zn;
3270
+ (Ye && L(new Ye(new ArrayBuffer(1))) != me || re && L(new re()) != p || Re && L(Re.resolve()) != N || qe && L(new qe()) != G || He && L(new He()) != F) && (L = function(a) {
3271
+ var s = pe.call(a), u = s == P ? a.constructor : void 0, l = u ? U(u) : void 0;
3272
+ if (l)
3273
+ switch (l) {
3274
+ case pn:
3275
+ return me;
3276
+ case gn:
3277
+ return p;
3278
+ case _n:
3279
+ return N;
3280
+ case wn:
3281
+ return G;
3282
+ case bn:
3283
+ return F;
3284
+ }
3285
+ return s;
3286
+ });
3287
+ function aa(a) {
3288
+ var s = a.length, u = a.constructor(s);
3289
+ return s && typeof a[0] == "string" && j.call(a, "index") && (u.index = a.index, u.input = a.input), u;
3290
+ }
3291
+ function ia(a) {
3292
+ return typeof a.constructor == "function" && !Rt(a) ? Ln(ln(a)) : {};
3293
+ }
3294
+ function sa(a, s, u, l) {
3295
+ var D = a.constructor;
3296
+ switch (s) {
3297
+ case ut:
3298
+ return Ae(a);
3299
+ case d:
3300
+ case h:
3301
+ return new D(+a);
3302
+ case me:
3303
+ return Qn(a, l);
3304
+ case ct:
3305
+ case lt:
3306
+ case dt:
3307
+ case ft:
3308
+ case ht:
3309
+ case mt:
3310
+ case yt:
3311
+ case pt:
3312
+ case gt:
3313
+ return ea(a, l);
3314
+ case p:
3315
+ return Zn(a, l, u);
3316
+ case E:
3317
+ case S:
3318
+ return new D(a);
3319
+ case k:
3320
+ return Bn(a);
3321
+ case G:
3322
+ return Kn(a, l, u);
3323
+ case T:
3324
+ return Jn(a);
3325
+ }
3326
+ }
3327
+ function oa(a, s) {
3328
+ return s = s ?? i, !!s && (typeof a == "number" || Zr.test(a)) && a > -1 && a % 1 == 0 && a < s;
3329
+ }
3330
+ function ua(a) {
3331
+ var s = typeof a;
3332
+ return s == "string" || s == "number" || s == "symbol" || s == "boolean" ? a !== "__proto__" : a === null;
3333
+ }
3334
+ function ca(a) {
3335
+ return !!St && St in a;
3336
+ }
3337
+ function Rt(a) {
3338
+ var s = a && a.constructor, u = typeof s == "function" && s.prototype || ye;
3339
+ return a === u;
3340
+ }
3341
+ function U(a) {
3342
+ if (a != null) {
3343
+ try {
3344
+ return Mt.call(a);
3345
+ } catch {
3346
+ }
3347
+ try {
3348
+ return a + "";
3349
+ } catch {
3350
+ }
3351
+ }
3352
+ return "";
3353
+ }
3354
+ function la(a) {
3355
+ return je(a, !0, !0);
3356
+ }
3357
+ function qt(a, s) {
3358
+ return a === s || a !== a && s !== s;
3359
+ }
3360
+ function da(a) {
3361
+ return fa(a) && j.call(a, "callee") && (!fn.call(a, "callee") || pe.call(a) == o);
3362
+ }
3363
+ var Ge = Array.isArray;
3364
+ function Ht(a) {
3365
+ return a != null && ma(a.length) && !jt(a);
3366
+ }
3367
+ function fa(a) {
3368
+ return ya(a) && Ht(a);
3369
+ }
3370
+ var ha = mn || ga;
3371
+ function jt(a) {
3372
+ var s = we(a) ? pe.call(a) : "";
3373
+ return s == _ || s == y;
3374
+ }
3375
+ function ma(a) {
3376
+ return typeof a == "number" && a > -1 && a % 1 == 0 && a <= i;
3377
+ }
3378
+ function we(a) {
3379
+ var s = typeof a;
3380
+ return !!a && (s == "object" || s == "function");
3381
+ }
3382
+ function ya(a) {
3383
+ return !!a && typeof a == "object";
3384
+ }
3385
+ function Fe(a) {
3386
+ return Ht(a) ? Fn(a) : Vn(a);
3387
+ }
3388
+ function pa() {
3389
+ return [];
3390
+ }
3391
+ function ga() {
3392
+ return !1;
3393
+ }
3394
+ e.exports = la;
3395
+ })(xe, xe.exports);
3396
+ var qs = xe.exports;
3397
+ const Hs = /* @__PURE__ */ Rs(qs), te = (e, t) => new Date(e.getTime() - Lr(t, e));
3398
+ class C {
3399
+ constructor(t) {
3400
+ b(this, "timeframeText");
3401
+ b(this, "key");
3402
+ b(this, "display");
3403
+ b(this, "timeframeLength");
3404
+ b(this, "allowedTiers");
3405
+ // defaultResponseGranularity tracks which of the allowed granularities is picked for a given
3406
+ // timeframe if the user does not or cannot specify a granularity.
3407
+ b(this, "defaultResponseGranularity");
3408
+ // dataGranularity tracks the granularity of the available data on the server for a specific timeframe.
3409
+ // As of writing, it's always the same as the default response granularity, but it may not always be.
3410
+ // It controls how timeframes are rounded to ensure complete time buckets from the server.
3411
+ b(this, "dataGranularity");
3412
+ // isRelative impacts whether we take the `floor` or the `ceil` of the start time.
3413
+ // If the time range is relative, we want the ceil -- because we take the ceil of the
3414
+ // end time to make sure we're showing all the data we can for the last time bucket.
3415
+ // If the time range is absolute, we want the floor -- because otherwise we wouldn't be including
3416
+ // the first time bucket.
3417
+ b(this, "isRelative");
3418
+ b(this, "fineGrainedDefaultGranularity");
3419
+ b(this, "_startCustom");
3420
+ b(this, "_endCustom");
3421
+ b(this, "_allowedGranularitiesOverride");
3422
+ 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, this.fineGrainedDefaultGranularity = t.fineGrainedDefaultGranularity;
3423
+ }
3424
+ // rawEnd does not consider granularity and should not be used directly in queries.
3425
+ // Use `new QueryTime(timeframe, granularity?).queryEndSeconds()` instead.
3426
+ // eslint-disable-next-line -- `tz` is required because it's used in subclasses.
3427
+ rawEnd(t) {
3428
+ return this._endCustom || /* @__PURE__ */ new Date();
3429
+ }
3430
+ // rawStart does not consider granularity and should not be used directly in queries.
3431
+ // Use `new QueryTime(timeframe, granularity?).queryStartSeconds()` instead.
3432
+ // eslint-disable-next-line -- `tz` is required because it's used in subclasses.
3433
+ rawStart(t) {
3434
+ return this._startCustom || new Date(this.rawEnd().getTime() - this.timeframeLengthMs());
3435
+ }
3436
+ timeframeLengthMs() {
3437
+ return this.timeframeLength() * 1e3;
3438
+ }
3439
+ maximumTimeframeLength() {
3440
+ return this.timeframeLength();
3441
+ }
3442
+ allowedGranularities(t) {
3443
+ if (this._allowedGranularitiesOverride && t)
3444
+ return new Set(this._allowedGranularitiesOverride);
3445
+ const r = /* @__PURE__ */ new Set(), n = this.maximumTimeframeLength() / 3600;
3446
+ return n <= 6 && r.add("minutely"), n >= 2 && n <= 7 * 24 && r.add("hourly"), n >= 2 * 24 && r.add("daily"), n >= 2 * 24 * 14 && r.add("weekly"), r;
3447
+ }
3448
+ cacheKey() {
3449
+ return this.key !== "custom" ? this.key : `${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`;
3450
+ }
3451
+ v4Query(t) {
3452
+ return this.key === "custom" ? {
3453
+ type: "absolute",
3454
+ start: this.rawStart(),
3455
+ end: this.rawEnd(),
3456
+ tz: t
3457
+ } : {
3458
+ type: "relative",
3459
+ time_range: this.key,
3460
+ tz: t
3461
+ };
3462
+ }
3463
+ tzAdjustedDate(t) {
3464
+ if (!t)
3465
+ return /* @__PURE__ */ new Date();
3466
+ const r = Cs(/* @__PURE__ */ new Date(), new Intl.DateTimeFormat().resolvedOptions().timeZone);
3467
+ return Wr(r, t);
3468
+ }
3469
+ }
3470
+ class js extends C {
3471
+ rawStart(t) {
3472
+ let r = H(this.tzAdjustedDate(t), { weekStartsOn: 1 });
3473
+ return t && (r = te(r, t)), r;
3474
+ }
3475
+ maximumTimeframeLength() {
3476
+ return 60 * 60 * 24 * 7;
3477
+ }
3478
+ }
3479
+ class As extends C {
3480
+ rawStart(t) {
3481
+ let r = ee(this.tzAdjustedDate(t));
3482
+ return t && (r = te(r, t)), r;
3483
+ }
3484
+ maximumTimeframeLength() {
3485
+ return 60 * 60 * 24 * 31;
3486
+ }
3487
+ }
3488
+ class Gs extends C {
3489
+ rawEnd(t) {
3490
+ let r = H(this.tzAdjustedDate(t), { weekStartsOn: 1 });
3491
+ return t && (r = te(r, t)), r;
3492
+ }
3493
+ rawStart(t) {
3494
+ const r = this.tzAdjustedDate(t);
3495
+ let n = H(r.setDate(r.getDate() - 7), {
3496
+ weekStartsOn: 1
3497
+ });
3498
+ return t && (n = te(n, t)), n;
3499
+ }
3500
+ }
3501
+ class Fs extends C {
3502
+ rawEnd(t) {
3503
+ let r = ee(this.tzAdjustedDate(t));
3504
+ return t && (r = te(r, t)), r;
3505
+ }
3506
+ rawStart(t) {
3507
+ let r = ee(Ar(this.tzAdjustedDate(t), 1));
3508
+ return t && (r = te(r, t)), r;
3509
+ }
3510
+ }
3511
+ const Ws = /* @__PURE__ */ new Map([
3512
+ [
3513
+ m.FIFTEEN_MIN,
3514
+ new C({
3515
+ key: m.FIFTEEN_MIN,
3516
+ display: "Last 15 minutes",
3517
+ timeframeText: "15 minutes",
3518
+ timeframeLength: () => 60 * 15,
3519
+ defaultResponseGranularity: "minutely",
3520
+ dataGranularity: "minutely",
3521
+ isRelative: !0,
3522
+ fineGrainedDefaultGranularity: "thirtySecondly",
3523
+ allowedTiers: ["free", "trial", "plus", "enterprise"],
3524
+ allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely"]
3525
+ })
3526
+ ],
3527
+ [
3528
+ m.ONE_HOUR,
3529
+ new C({
3530
+ key: m.ONE_HOUR,
3531
+ display: "Last hour",
3532
+ timeframeText: "One hour",
3533
+ timeframeLength: () => 60 * 60 * 1,
3534
+ defaultResponseGranularity: "minutely",
3535
+ dataGranularity: "minutely",
3536
+ isRelative: !0,
3537
+ fineGrainedDefaultGranularity: "minutely",
3538
+ allowedTiers: ["free", "trial", "plus", "enterprise"],
3539
+ allowedGranularitiesOverride: ["tenSecondly", "thirtySecondly", "minutely", "fiveMinutely", "tenMinutely"]
3540
+ })
3541
+ ],
3542
+ [
3543
+ m.SIX_HOUR,
3544
+ new C({
3545
+ key: m.SIX_HOUR,
3546
+ display: "Last 6 hours",
3547
+ timeframeText: "6 hours",
3548
+ timeframeLength: () => 60 * 60 * 6,
3549
+ defaultResponseGranularity: "hourly",
3550
+ dataGranularity: "hourly",
3551
+ isRelative: !0,
3552
+ fineGrainedDefaultGranularity: "fiveMinutely",
3553
+ allowedTiers: ["free", "trial", "plus", "enterprise"],
3554
+ allowedGranularitiesOverride: ["thirtySecondly", "minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
3555
+ })
3556
+ ],
3557
+ [
3558
+ m.TWELVE_HOUR,
3559
+ new C({
3560
+ key: m.TWELVE_HOUR,
3561
+ display: "Last 12 hours",
3562
+ timeframeText: "12 hours",
3563
+ timeframeLength: () => 60 * 60 * 12,
3564
+ defaultResponseGranularity: "hourly",
3565
+ dataGranularity: "hourly",
3566
+ isRelative: !0,
3567
+ fineGrainedDefaultGranularity: "tenMinutely",
3568
+ allowedTiers: ["free", "trial", "plus", "enterprise"],
3569
+ allowedGranularitiesOverride: ["minutely", "fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
3570
+ })
3571
+ ],
3572
+ [
3573
+ m.ONE_DAY,
3574
+ new C({
3575
+ key: m.ONE_DAY,
3576
+ display: "Last 24 hours",
3577
+ timeframeText: "24 hours",
3578
+ timeframeLength: () => 60 * 60 * 24,
3579
+ defaultResponseGranularity: "hourly",
3580
+ dataGranularity: "hourly",
3581
+ isRelative: !0,
3582
+ fineGrainedDefaultGranularity: "thirtyMinutely",
3583
+ allowedTiers: ["free", "trial", "plus", "enterprise"],
3584
+ allowedGranularitiesOverride: ["fiveMinutely", "tenMinutely", "thirtyMinutely", "hourly"]
3585
+ })
3586
+ ],
3587
+ [
3588
+ m.SEVEN_DAY,
3589
+ new C({
3590
+ key: m.SEVEN_DAY,
3591
+ display: "Last 7 days",
3592
+ timeframeText: "7 days",
3593
+ timeframeLength: () => 60 * 60 * 24 * 7,
3594
+ defaultResponseGranularity: "daily",
3595
+ dataGranularity: "daily",
3596
+ isRelative: !0,
3597
+ fineGrainedDefaultGranularity: "twoHourly",
3598
+ allowedTiers: ["trial", "plus", "enterprise"],
3599
+ allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
3600
+ })
3601
+ ],
3602
+ [
3603
+ m.THIRTY_DAY,
3604
+ new C({
3605
+ key: m.THIRTY_DAY,
3606
+ display: "Last 30 days",
3607
+ timeframeText: "30 days",
3608
+ timeframeLength: () => 60 * 60 * 24 * 30,
3609
+ defaultResponseGranularity: "daily",
3610
+ dataGranularity: "daily",
3611
+ isRelative: !0,
3612
+ fineGrainedDefaultGranularity: "twelveHourly",
3613
+ allowedTiers: ["trial", "plus", "enterprise"],
3614
+ allowedGranularitiesOverride: ["hourly", "twoHourly", "twelveHourly", "daily", "weekly"]
3615
+ })
3616
+ ],
3617
+ [
3618
+ m.CURRENT_WEEK,
3619
+ new js({
3620
+ key: m.CURRENT_WEEK,
3621
+ display: "This week",
3622
+ timeframeText: "Week",
3623
+ timeframeLength: () => {
3624
+ const e = H(/* @__PURE__ */ new Date(), { weekStartsOn: 1 });
3625
+ return (Oe(Ut(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
3626
+ },
3627
+ defaultResponseGranularity: "daily",
3628
+ dataGranularity: "daily",
3629
+ isRelative: !1,
3630
+ fineGrainedDefaultGranularity: "twoHourly",
3631
+ allowedTiers: ["plus", "enterprise"],
3632
+ allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
3633
+ })
3634
+ ],
3635
+ [
3636
+ m.CURRENT_MONTH,
3637
+ new As({
3638
+ key: m.CURRENT_MONTH,
3639
+ display: "This month",
3640
+ timeframeText: "Month",
3641
+ timeframeLength: () => {
3642
+ const e = ee(/* @__PURE__ */ new Date());
3643
+ return (Oe(Ut(/* @__PURE__ */ new Date(), 1)).getTime() - e.getTime()) / 1e3;
3644
+ },
3645
+ defaultResponseGranularity: "daily",
3646
+ dataGranularity: "daily",
3647
+ isRelative: !1,
3648
+ allowedTiers: ["plus", "enterprise"]
3649
+ })
3650
+ ],
3651
+ [
3652
+ m.PREVIOUS_WEEK,
3653
+ new Gs({
3654
+ key: m.PREVIOUS_WEEK,
3655
+ display: "Previous week",
3656
+ timeframeText: "Week",
3657
+ timeframeLength: () => 60 * 60 * 24 * 7,
3658
+ defaultResponseGranularity: "daily",
3659
+ dataGranularity: "daily",
3660
+ isRelative: !1,
3661
+ fineGrainedDefaultGranularity: "twoHourly",
3662
+ allowedTiers: ["plus", "enterprise"],
3663
+ allowedGranularitiesOverride: ["thirtyMinutely", "hourly", "twoHourly", "twelveHourly", "daily"]
3664
+ })
3665
+ ],
3666
+ [
3667
+ m.PREVIOUS_MONTH,
3668
+ new Fs({
3669
+ key: m.PREVIOUS_MONTH,
3670
+ display: "Previous month",
3671
+ timeframeText: "Month",
3672
+ timeframeLength: () => {
3673
+ let e = 0;
3674
+ const t = ee(/* @__PURE__ */ new Date()), r = ee(Ar(/* @__PURE__ */ new Date(), 1));
3675
+ return t.getTimezoneOffset() !== r.getTimezoneOffset() && (e = Ls(t, r)), 60 * 60 * 24 * es((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1)) + rs(e);
3676
+ },
3677
+ defaultResponseGranularity: "daily",
3678
+ dataGranularity: "daily",
3679
+ isRelative: !1,
3680
+ allowedTiers: ["plus", "enterprise"]
3681
+ })
3682
+ ]
3683
+ ]);
3684
+ function ho(e) {
3685
+ const t = new Date(e.start), r = new Date(e.end), n = (r.getTime() - t.getTime()) / 1e3;
3686
+ return e.timePeriodsKey && Hs(Ws.get(e.timePeriodsKey)) || new C({
3687
+ key: "custom",
3688
+ timeframeText: "custom",
3689
+ display: "custom",
3690
+ startCustom: t,
3691
+ endCustom: r,
3692
+ timeframeLength: () => n,
3693
+ defaultResponseGranularity: "daily",
3694
+ dataGranularity: "daily",
3695
+ isRelative: !1,
3696
+ allowedTiers: ["free", "plus", "enterprise"]
3697
+ });
3698
+ }
3699
+ function mo(e) {
3700
+ return {
3701
+ ...e.key !== "custom" && { timePeriodsKey: e.key },
3702
+ start: e.rawStart(),
3703
+ end: e.rawEnd()
3704
+ };
3705
+ }
3706
+ function yo(e) {
3707
+ return {
3708
+ key: e.key,
3709
+ display: e.display,
3710
+ timeframeText: e.timeframeText,
3711
+ timeframeLength: () => e.key,
3712
+ // Used to generate test IDs for the Kongponent.
3713
+ start: () => e.rawStart(),
3714
+ end: () => e.rawEnd()
3715
+ };
3716
+ }
3717
+ function Ls(e, t) {
3718
+ return ns(e.getTimezoneOffset() - t.getTimezoneOffset());
3719
+ }
3720
+ const po = {
3721
+ "15M": m.FIFTEEN_MIN,
3722
+ "1H": m.ONE_HOUR,
3723
+ "6H": m.SIX_HOUR,
3724
+ "12H": m.TWELVE_HOUR,
3725
+ "24H": m.ONE_DAY,
3726
+ "7D": m.SEVEN_DAY,
3727
+ "15m": m.FIFTEEN_MIN,
3728
+ "1h": m.ONE_HOUR,
3729
+ "6h": m.SIX_HOUR,
3730
+ "12h": m.TWELVE_HOUR,
3731
+ "24h": m.ONE_DAY,
3732
+ "7d": m.SEVEN_DAY,
3733
+ "30d": m.THIRTY_DAY,
3734
+ current_week: m.CURRENT_WEEK,
3735
+ current_month: m.CURRENT_MONTH,
3736
+ previous_week: m.PREVIOUS_WEEK,
3737
+ previous_month: m.PREVIOUS_MONTH
3738
+ };
3739
+ class ot {
3740
+ constructor(t) {
3741
+ b(this, "_seed");
3742
+ this._seed = t;
3743
+ }
3744
+ next(t, r) {
3745
+ const n = Math.sin(this._seed++) * 1e4, i = n - Math.floor(n);
3746
+ return Math.floor(i * (r - t + 1)) + t;
3747
+ }
3748
+ }
3749
+ const go = (e, t, r) => {
3750
+ const n = $r(10, 1e4), i = new ot(n), o = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), d = [];
3751
+ let h = 0;
3752
+ for (let y = o; y <= c; y += 60 * 60 * 1e3)
3753
+ if (t)
3754
+ for (const p in t)
3755
+ t[p].forEach((E) => {
3756
+ h += i.next(50, 500);
3757
+ const P = {
3758
+ [p]: E,
3759
+ [e.name]: h
3760
+ }, N = {
3761
+ version: "1.0",
3762
+ timestamp: new Date(y).toISOString(),
3763
+ event: P
3764
+ };
3765
+ d.push(N);
3766
+ });
3767
+ else {
3768
+ h += i.next(50, 500);
3769
+ const p = {
3770
+ version: "1.0",
3771
+ timestamp: new Date(y).toISOString(),
3772
+ event: {
3773
+ [e.name]: h
3774
+ }
3775
+ };
3776
+ d.push(p);
3777
+ }
3778
+ const f = {};
3779
+ if (t)
3780
+ for (const y in t)
3781
+ f[y] = {}, t[y].forEach((p) => {
3782
+ f[y][p] = {
3783
+ name: p,
3784
+ deleted: !1
3785
+ };
3786
+ });
3787
+ const _ = {
3788
+ start_ms: o,
3789
+ end_ms: c,
3790
+ start: new Date(o).toISOString(),
3791
+ end: new Date(c).toISOString(),
3792
+ query_id: "12345",
3793
+ metric_names: [e.name],
3794
+ metric_units: {
3795
+ [e.name]: e.unit
3796
+ },
3797
+ granularity_ms: 60 * 60 * 1e3,
3798
+ // 1 hour in ms
3799
+ display: f,
3800
+ ...r ?? {}
3801
+ };
3802
+ return {
3803
+ data: d,
3804
+ meta: _
3805
+ };
3806
+ }, _o = (e, t) => {
3807
+ const r = $r(10, 1e4), n = new ot(r), i = Date.now() - 6 * 60 * 60 * 1e3, o = Date.now(), c = [], d = {};
3808
+ e.forEach((f) => {
3809
+ d[f.name] = 0;
3810
+ });
3811
+ for (let f = i; f <= o; f += 60 * 60 * 1e3) {
3812
+ const _ = {};
3813
+ e.forEach((p) => {
3814
+ d[p.name] += n.next(50, 500), _[p.name] = d[p.name];
3815
+ });
3816
+ const y = {
3817
+ version: "1.0",
3818
+ timestamp: new Date(f).toISOString(),
3819
+ event: _
3820
+ };
3821
+ c.push(y);
3822
+ }
3823
+ const h = {
3824
+ start_ms: i,
3825
+ end_ms: o,
3826
+ start: new Date(i).toISOString(),
3827
+ end: new Date(o).toISOString(),
3828
+ query_id: "12345",
3829
+ metric_names: e.map((f) => f.name),
3830
+ metric_units: e.reduce((f, _) => (f[_.name] = _.unit, f), {}),
3831
+ granularity_ms: 60 * 60 * 1e3,
3832
+ // 1 hour in ms
3833
+ display: {},
3834
+ ...t ?? {}
3835
+ };
3836
+ return {
3837
+ data: c,
3838
+ meta: h
3839
+ };
3840
+ }, wo = (e, t, r) => {
3841
+ const n = Math.floor(Math.random() * 9991) + 10, i = new ot(n), o = Date.now() - 6 * 60 * 60 * 1e3, c = Date.now(), d = new Date((o + c) / 2).toISOString(), h = [];
3842
+ if (t) {
3843
+ const y = Object.keys(t), p = Object.values(t), E = (P, N) => {
3844
+ if (N === y.length) {
3845
+ e.forEach((k) => {
3846
+ P[k.name] = i.next(1e3, 5e7);
3847
+ }), h.push({
3848
+ version: "1.0",
3849
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
3850
+ event: { ...P }
3851
+ });
3852
+ return;
3853
+ }
3854
+ p[N].forEach((k) => {
3855
+ E({ ...P, [y[N]]: k }, N + 1);
3856
+ });
3857
+ };
3858
+ E({}, 0);
3859
+ } else {
3860
+ const y = {};
3861
+ e.forEach((p) => {
3862
+ y[p.name] = i.next(50, 500);
3863
+ }), h.push({
3864
+ version: "1.0",
3865
+ timestamp: d,
3866
+ event: y
3867
+ });
3868
+ }
3869
+ const f = {};
3870
+ if (t)
3871
+ for (const y in t)
3872
+ f[y] = {}, t[y].forEach((p) => {
3873
+ f[y][p] = {
3874
+ name: p,
3875
+ deleted: !1
3876
+ };
3877
+ });
3878
+ const _ = {
3879
+ start_ms: o,
3880
+ end_ms: c,
3881
+ start: new Date(o).toISOString(),
3882
+ end: new Date(c).toISOString(),
3883
+ query_id: "12345",
3884
+ metric_names: e.map((y) => y.name),
3885
+ metric_units: e.reduce((y, p) => (y[p.name] = p.unit, y), {}),
3886
+ truncated: !1,
3887
+ limit: 50,
3888
+ display: f,
3889
+ granularity_ms: c - o,
3890
+ ...r ?? {}
3891
+ };
3892
+ return {
3893
+ data: h,
3894
+ meta: _
3895
+ };
3896
+ };
3897
+ function $r(e, t) {
3898
+ return e = Math.ceil(e), t = Math.floor(t), Math.floor(Math.random() * (t - e + 1) + e);
3899
+ }
3900
+ export {
3901
+ fo as DeltaQueryTime,
3902
+ ve as Granularities,
3903
+ zs as REFRESH_INTERVAL_MS,
3904
+ ot as SeededRandom,
3905
+ po as TIMEFRAME_LOOKUP,
3906
+ Ws as TimePeriods,
3907
+ C as Timeframe,
3908
+ m as TimeframeKeys,
3909
+ lo as TimeseriesQueryTime,
3910
+ Ys as UnaryQueryTime,
3911
+ mr as aiExploreAggregations,
3912
+ ja as apiUsageQuerySchema,
3913
+ Pa as barChartSchema,
3914
+ Be as basicExploreAggregations,
3915
+ Aa as basicQuerySchema,
3916
+ zr as ceilToNearestTimeGrain,
3917
+ io as dashboardConfigSchema,
3918
+ ao as dashboardTileTypes,
3919
+ no as dashboardsSchemaV1,
3920
+ Oa as datasourceToFilterableDimensions,
3921
+ ho as datePickerSelectionToTimeframe,
3922
+ Ia as donutChartSchema,
3923
+ Ls as dstOffsetHours,
3924
+ hr as exploreAggregations,
3925
+ lr as exploreFilterTypesV2,
3926
+ ce as filterableAiExploreDimensions,
3927
+ oe as filterableBasicExploreDimensions,
3928
+ ue as filterableExploreDimensions,
3929
+ Bs as filterableRequestDimensions,
3930
+ Js as filterableRequestMetrics,
3931
+ Ks as filterableRequestWildcardDimensions,
3932
+ ks as floorToNearestTimeGrain,
3933
+ so as formatISOTimeWithTZ,
3934
+ cr as formatTime,
3935
+ oo as formatTimeRange,
3936
+ Ca as gaugeChartSchema,
3937
+ wo as generateCrossSectionalData,
3938
+ _o as generateMultipleMetricTimeSeriesData,
3939
+ go as generateSingleMetricTimeSeriesData,
3940
+ uo as granularitiesToOptions,
3941
+ Is as granularityMsToQuery,
3942
+ Ze as granularityValues,
3943
+ Ga as llmUsageSchema,
3944
+ Ya as metricCardSchema,
3945
+ co as msToGranularity,
3946
+ to as queryDatasources,
3947
+ Je as queryableAiExploreDimensions,
3948
+ Ee as queryableBasicExploreDimensions,
3949
+ Ke as queryableExploreDimensions,
3950
+ ba as queryableRequestDimensions,
3951
+ Da as queryableRequestMetrics,
3952
+ Ta as queryableRequestWildcardDimensions,
3953
+ $r as rand,
3954
+ eo as relativeTimeRangeValuesRequestV2,
3955
+ fr as relativeTimeRangeValuesV4,
3956
+ $s as reportChartTypes,
3957
+ dr as requestFilterTypeEmptyV2,
3958
+ Vs as requestFilterTypeEqualsV2,
3959
+ Xs as requestFilterTypeMetricV2,
3960
+ Qs as requestFilterTypeWildcardV2,
3961
+ Ra as singleValueSchema,
3962
+ Ea as slottableSchema,
3963
+ ro as stripUnknownFilters,
3964
+ Ua as tileConfigSchema,
3965
+ Wa as tileDefinitionSchema,
3966
+ La as tileLayoutSchema,
3967
+ Zs as timeRangeTypeV2,
3968
+ mo as timeframeToDatepickerSelection,
3969
+ yo as timeframeToDatepickerTimeperiod,
3970
+ Na as timeseriesChartSchema,
3971
+ ka as topNTableSchema,
3972
+ Fa as validDashboardQuery
3973
+ };
3974
+ //# sourceMappingURL=vitals-utilities.es.js.map