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