@kong-ui-public/analytics-utilities 10.1.1-pr.2292.ab669b0be.0 → 10.1.1
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.
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/explore/all.d.ts +3 -6
- package/dist/types/types/explore/all.d.ts.map +1 -1
- package/dist/types/types/query-bridge.d.ts +1 -0
- package/dist/types/types/query-bridge.d.ts.map +1 -1
- package/dist/vitals-utilities.cjs +1 -1
- package/dist/vitals-utilities.cjs.map +1 -1
- package/dist/vitals-utilities.es.js +605 -609
- package/dist/vitals-utilities.es.js.map +1 -1
- package/dist/vitals-utilities.umd.js +1 -1
- package/dist/vitals-utilities.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/filters.d.ts +0 -3
- package/dist/types/filters.d.ts.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from './constants';
|
|
|
2
2
|
export * as dashboardsSchemaV1 from './dashboardSchema';
|
|
3
3
|
export * from './dashboardSchema.v2';
|
|
4
4
|
export * from './types';
|
|
5
|
-
export * from './filters';
|
|
6
5
|
export * from './format';
|
|
7
6
|
export * from './granularity';
|
|
8
7
|
export * from './queryTime';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,KAAK,kBAAkB,MAAM,mBAAmB,CAAA;AACvD,cAAc,sBAAsB,CAAA;AACpC,cAAc,SAAS,CAAA;AACvB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,KAAK,kBAAkB,MAAM,mBAAmB,CAAA;AACvD,cAAc,sBAAsB,CAAA;AACpC,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { type BasicExploreAggregations, type BasicExploreFilterAll
|
|
2
|
-
import { type AiExploreAggregations, type AiExploreFilterAll
|
|
3
|
-
import { type ExploreAggregations, type ExploreFilterAll
|
|
4
|
-
import { type FilterableRequestDimensions, type FilterableRequestMetrics, type FilterableRequestWildcardDimensions } from './requests';
|
|
1
|
+
import { type BasicExploreAggregations, type BasicExploreFilterAll } from './basic';
|
|
2
|
+
import { type AiExploreAggregations, type AiExploreFilterAll } from './ai';
|
|
3
|
+
import { type ExploreAggregations, type ExploreFilterAll } from './advanced';
|
|
5
4
|
export type AllAggregations = BasicExploreAggregations | AiExploreAggregations | ExploreAggregations;
|
|
6
5
|
export type AllFilters = BasicExploreFilterAll | AiExploreFilterAll | ExploreFilterAll;
|
|
7
|
-
export type AllFilterableDimensionsAndMetrics = FilterableExploreDimensions | FilterableAiExploreDimensions | FilterableBasicExploreDimensions | FilterableRequestDimensions | FilterableRequestMetrics | FilterableRequestWildcardDimensions;
|
|
8
6
|
export declare const queryDatasources: readonly ["basic", "api_usage", "llm_usage"];
|
|
9
7
|
export type QueryDatasource = typeof queryDatasources[number];
|
|
10
|
-
export type FilterDatasource = QueryDatasource | 'requests';
|
|
11
8
|
export interface FilterTypeMap extends Record<QueryDatasource, AllFilters> {
|
|
12
9
|
basic: BasicExploreFilterAll;
|
|
13
10
|
api_usage: ExploreFilterAll;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../../../../src/types/explore/all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,qBAAqB,
|
|
1
|
+
{"version":3,"file":"all.d.ts","sourceRoot":"","sources":["../../../../src/types/explore/all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,qBAAqB,EAAoC,MAAM,SAAS,CAAA;AACrH,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,kBAAkB,EAAiC,MAAM,MAAM,CAAA;AACzG,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAA+B,MAAM,YAAY,CAAA;AAEzG,MAAM,MAAM,eAAe,GAAG,wBAAwB,GAAG,qBAAqB,GAAG,mBAAmB,CAAA;AACpG,MAAM,MAAM,UAAU,GAAG,qBAAqB,GAAG,kBAAkB,GAAG,gBAAgB,CAAA;AAEtF,eAAO,MAAM,gBAAgB,8CAA+C,CAAA;AAE5E,MAAM,MAAM,eAAe,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAE7D,MAAM,WAAW,aAAc,SAAQ,MAAM,CAAC,eAAe,EAAE,UAAU,CAAC;IACxE,KAAK,EAAE,qBAAqB,CAAA;IAC5B,SAAS,EAAE,gBAAgB,CAAA;IAC3B,SAAS,EAAE,kBAAkB,CAAA;CAC9B;AAED,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAIxE,CAAA;AAGV,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,MAAM,OAAO,gCAAgC,cAAc,CAAC,WAAW,UAAU,EAAE,KAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAIzJ,CAAA"}
|
|
@@ -19,6 +19,7 @@ export interface AnalyticsBridge {
|
|
|
19
19
|
configFn: () => Promise<AnalyticsConfigV2>;
|
|
20
20
|
evaluateFeatureFlagFn: <T = boolean>(key: string, defaultValue: T) => T;
|
|
21
21
|
exploreBaseUrl?: () => Promise<string>;
|
|
22
|
+
requestsBaseUrl?: () => Promise<string>;
|
|
22
23
|
fetchComponent?: (name: string) => Promise<Component>;
|
|
23
24
|
}
|
|
24
25
|
//# sourceMappingURL=query-bridge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-bridge.d.ts","sourceRoot":"","sources":["../../../src/types/query-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AACjG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,EAAE,iBAAiB,CAAA;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,WAAW,CAAA;IACvB,KAAK,EAAE,YAAY,CAAA;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,WAAW,CAAA;IACvB,KAAK,EAAE,cAAc,CAAA;CACtB;AAED,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG,uBAAuB,GAAG,iBAAiB,CAAA;AAErG,MAAM,WAAW,eAAe;IAE9B,OAAO,EAAE,CAAC,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,eAAe,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;IAGpG,QAAQ,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAG1C,qBAAqB,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAA;IAIvE,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"query-bridge.d.ts","sourceRoot":"","sources":["../../../src/types/query-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AACjG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,EAAE,iBAAiB,CAAA;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,WAAW,CAAA;IACvB,KAAK,EAAE,YAAY,CAAA;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,WAAW,CAAA;IACvB,KAAK,EAAE,cAAc,CAAA;CACtB;AAED,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG,uBAAuB,GAAG,iBAAiB,CAAA;AAErG,MAAM,WAAW,eAAe;IAE9B,OAAO,EAAE,CAAC,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,eAAe,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;IAGpG,QAAQ,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAG1C,qBAAqB,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAA;IAIvE,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAItC,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAGvC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAA;CACtD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var Ua=Object.defineProperty;var za=(e,t,r)=>t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var b=(e,t,r)=>za(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $a=30*1e3;var h=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e))(h||{});const Va=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value"],nt=["in","not_in","selector"],Qa=["=","!="],Xa=["=","!=","<",">","<=",">="],at=["empty","not_empty"],Za=["starts_with","ends_with"],Ba=["absolute","relative"],it=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Pe=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],le=e=>e.filter(t=>t!=="time"),de=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],$=le(de),Ce=["active_services","request_count","request_per_minute","response_latency_average"],Ne=[...de,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],V=le(Ne),st=[...Ce,"response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],Ie=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],Q=le(Ie),ot=["total_tokens","prompt_tokens","completion_tokens","ai_request_count","cost","llm_cache_embeddings_latency_average","llm_cache_fetch_latency_average","llm_latency_average","llm_embeddings_tokens","llm_embeddings_cost"],_r=["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","portal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"],et=le(_r),wr=["auth_type","client_ip","country_code","data_plane_node_version","header_host","header_user_agent","http_method","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],Ka=wr,br=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],Tr=le(br),Ja=["15M","1H","6H","12H","24H","7D"],ei=["basic","api_usage","llm_usage"],Dr={basic:new Set($),api_usage:new Set(V),llm_usage:new Set(Q)},ti=(e,t)=>t.filter(r=>Dr[e].has(r.field)),ri=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],fe={type:"string"},X={type:"string"},Sr={type:"boolean"},Or={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},Mr={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},vr={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:Or,syntheticsDataKey:fe,chartTitle:X,allowCsvExport:Sr},required:["type"],additionalProperties:!1},xr={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chartDatasetColors:Or,syntheticsDataKey:fe,chartTitle:X,allowCsvExport:Sr},required:["type"],additionalProperties:!1},Er={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:["hidden","single","full"]},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:fe,chartTitle:X},required:["type"],additionalProperties:!1},Pr={type:"object",properties:{type:{type:"string",enum:["donut"]},syntheticsDataKey:fe,chartTitle:X},required:["type"],additionalProperties:!1},Cr={type:"object",properties:{chartTitle:X,syntheticsDataKey:fe,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},Nr={type:"object",properties:{chartTitle:X,type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"},percentileLatency:{type:"boolean"}},required:["type"],additionalProperties:!1},Ir={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimalPoints:{type:"number"},chartTitle:X},required:["type"],additionalProperties:!1},ni={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:it,default:"1h"}},required:["type","time_range"],additionalProperties:!1},ai={type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type","start","end"],additionalProperties:!1},ut={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Pe},time_range:{type:"object",description:"The time range to query.",anyOf:[ni,ai],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},ct=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),lt=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),ke=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:nt},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:at}},required:["field","operator"],additionalProperties:!1}]}}),kr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["advanced"]},metrics:ct(st),dimensions:lt(Ne),filters:ke(V),...ut},required:["datasource"],additionalProperties:!1},qr={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:ct(Ce),dimensions:lt(de),filters:ke($),...ut},required:["datasource"],additionalProperties:!1},Rr={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["ai"]},metrics:ct(ot),dimensions:lt(Ie),filters:ke(Q),...ut},required:["datasource"],additionalProperties:!1},Yr={anyOf:[kr,qr,Rr]},Ar={type:"object",properties:{query:Yr,chart:{anyOf:[vr,Er,Pr,xr,Nr,Cr,Mr,Ir]}},required:["query","chart"],additionalProperties:!1},Hr={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fitToContent:{type:"boolean"}},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.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},Fr={type:"object",properties:{definition:Ar,layout:Hr,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["definition","layout"],additionalProperties:!1},ii={type:"object",properties:{tiles:{type:"array",items:Fr},tileHeight:{type:"number",description:"Height of each tile in pixels."},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1},global_filters:ke([...new Set([...V,...$,...Q])])},required:["tiles"],additionalProperties:!1},si=Object.freeze(Object.defineProperty({__proto__:null,aiQuerySchema:Rr,barChartSchema:vr,basicQuerySchema:qr,dashboardConfigSchema:ii,dashboardTileTypes:ri,donutChartSchema:Pr,exploreV4QuerySchema:kr,gaugeChartSchema:Er,metricCardSchema:Nr,singleValueSchema:Ir,slottableSchema:Mr,tileConfigSchema:Fr,tileDefinitionSchema:Ar,tileLayoutSchema:Hr,timeseriesChartSchema:xr,topNTableSchema:Cr,validDashboardQuery:Yr},Symbol.toStringTag,{value:"Module"})),oi=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],me={type:"string"},Z={type:"string"},jr={type:"boolean"},Gr={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},Wr={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Lr={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chart_dataset_colors:Gr,synthetics_data_key:me,chart_title:Z,allow_csv_export:jr},required:["type"],additionalProperties:!1},Ur={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chart_dataset_colors:Gr,synthetics_data_key:me,chart_title:Z,allow_csv_export:jr},required:["type"],additionalProperties:!1},zr={type:"object",properties:{type:{type:"string",enum:["gauge"]},metric_display:{type:"string",enum:["hidden","single","full"]},reverse_dataset:{type:"boolean"},numerator:{type:"number"},synthetics_data_key:me,chart_title:Z},required:["type"],additionalProperties:!1},$r={type:"object",properties:{type:{type:"string",enum:["donut"]},synthetics_data_key:me,chart_title:Z},required:["type"],additionalProperties:!1},Vr={type:"object",properties:{chart_title:Z,synthetics_data_key:me,type:{type:"string",enum:["top_n"]},description:{type:"string"},entity_link:{type:"string"}},required:["type"],additionalProperties:!1},Qr={type:"object",properties:{chart_title:Z,type:{type:"string",enum:["golden_signals"]},long_card_titles:{type:"boolean"},description:{type:"string"},percentile_latency:{type:"boolean"}},required:["type"],additionalProperties:!1},Xr={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimal_points:{type:"number"},chart_title:Z},required:["type"],additionalProperties:!1},ui={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:it,default:"1h"}},required:["type","time_range"],additionalProperties:!1},ci={type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type","start","end"],additionalProperties:!1},dt={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Pe},time_range:{type:"object",description:"The time range to query.",anyOf:[ui,ci],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},ft=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),mt=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),qe=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:nt},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:at}},required:["field","operator"],additionalProperties:!1}]}}),Zr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["api_usage"]},metrics:ft(st),dimensions:mt(Ne),filters:qe(V),...dt},required:["datasource"],additionalProperties:!1},Br={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:ft(Ce),dimensions:mt(de),filters:qe($),...dt},required:["datasource"],additionalProperties:!1},Kr={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["llm_usage"]},metrics:ft(ot),dimensions:mt(Ie),filters:qe(Q),...dt},required:["datasource"],additionalProperties:!1},Jr={anyOf:[Zr,Br,Kr]},en={type:"object",properties:{query:Jr,chart:{anyOf:[Lr,zr,$r,Ur,Qr,Vr,Wr,Xr]}},required:["query","chart"],additionalProperties:!1},tn={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fit_to_content:{type:"boolean"}},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.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},rn={type:"object",properties:{type:{type:"string",enum:["chart"]},definition:en,layout:tn,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["type","definition","layout"],additionalProperties:!1},li={type:"object",properties:{tiles:{type:"array",items:rn},tile_height:{type:"number",description:"Height of each tile in pixels."},preset_filters:qe([...new Set([...V,...$,...Q])])},required:["tiles"],additionalProperties:!1},di=e=>{const t=new Set;return $.includes(e)&&t.add("basic"),V.includes(e)&&t.add("api_usage"),Q.includes(e)&&t.add("llm_usage"),(et.includes(e)||Tr.includes(e)||et.includes(e))&&t.add("requests"),Array.from(t)},nn=6048e5,fi=864e5,mi=60,hi=3600,Kt=Symbol.for("constructDateFrom");function I(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Kt in e?e[Kt](t):e instanceof Date?new e.constructor(t):new Date(t)}function S(e,t){return I(t||e,e)}function Jt(e,t,r){const n=S(e,r==null?void 0:r.in);return isNaN(t)?I(e,NaN):(n.setDate(n.getDate()+t),n)}function yi(e,t,r){const n=S(e,r==null?void 0:r.in);if(isNaN(t))return I(e,NaN);const i=n.getDate(),o=I(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const c=o.getDate();return i>=c?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}let pi={};function he(){return pi}function A(e,t){var d,m,f,_;const r=he(),n=(t==null?void 0:t.weekStartsOn)??((m=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((_=(f=r.locale)==null?void 0:f.options)==null?void 0:_.weekStartsOn)??0,i=S(e,t==null?void 0:t.in),o=i.getDay(),c=(o<n?7:0)+o-n;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function Oe(e,t){return A(e,{...t,weekStartsOn:1})}function an(e,t){const r=S(e,t==null?void 0:t.in),n=r.getFullYear(),i=I(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const o=Oe(i),c=I(r,0);c.setFullYear(n,0,4),c.setHours(0,0,0,0);const d=Oe(c);return r.getTime()>=o.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function er(e){const t=S(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function gi(e,...t){const r=I.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function Me(e,t){const r=S(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function _i(e,t,r){const[n,i]=gi(r==null?void 0:r.in,e,t),o=Me(n),c=Me(i),d=+o-er(o),m=+c-er(c);return Math.round((d-m)/fi)}function wi(e,t){const r=an(e,t),n=I(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Oe(n)}function bi(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Ti(e){return!(!bi(e)&&typeof e!="number"||isNaN(+S(e)))}function ne(e,t){const r=S(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Di(e,t){const r=S(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const Si={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Oi=(e,t,r)=>{let n;const i=Si[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Qe(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Mi={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},vi={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xi={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ei={date:Qe({formats:Mi,defaultWidth:"full"}),time:Qe({formats:vi,defaultWidth:"full"}),dateTime:Qe({formats:xi,defaultWidth:"full"})},Pi={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ci=(e,t,r,n)=>Pi[e];function oe(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=r!=null&&r.width?String(r.width):c;i=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[d]||e.values[c]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const Ni={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ii={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ki={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},qi={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ri={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Yi={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ai=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Hi={ordinalNumber:Ai,era:oe({values:Ni,defaultWidth:"wide"}),quarter:oe({values:Ii,defaultWidth:"wide",argumentCallback:e=>e-1}),month:oe({values:ki,defaultWidth:"wide"}),day:oe({values:qi,defaultWidth:"wide"}),dayPeriod:oe({values:Ri,defaultWidth:"wide",formattingValues:Yi,defaultFormattingWidth:"wide"})};function ue(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const c=o[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(d)?ji(d,y=>y.test(c)):Fi(d,y=>y.test(c));let f;f=e.valueCallback?e.valueCallback(m):m,f=r.valueCallback?r.valueCallback(f):f;const _=t.slice(c.length);return{value:f,rest:_}}}function Fi(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function ji(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Gi(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let c=e.valueCallback?e.valueCallback(o[0]):o[0];c=r.valueCallback?r.valueCallback(c):c;const d=t.slice(i.length);return{value:c,rest:d}}}const Wi=/^(\d+)(th|st|nd|rd)?/i,Li=/\d+/i,Ui={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},zi={any:[/^b/i,/^(a|c)/i]},$i={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vi={any:[/1/i,/2/i,/3/i,/4/i]},Qi={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Xi={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Zi={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Bi={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ki={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ji={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},es={ordinalNumber:Gi({matchPattern:Wi,parsePattern:Li,valueCallback:e=>parseInt(e,10)}),era:ue({matchPatterns:Ui,defaultMatchWidth:"wide",parsePatterns:zi,defaultParseWidth:"any"}),quarter:ue({matchPatterns:$i,defaultMatchWidth:"wide",parsePatterns:Vi,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ue({matchPatterns:Qi,defaultMatchWidth:"wide",parsePatterns:Xi,defaultParseWidth:"any"}),day:ue({matchPatterns:Zi,defaultMatchWidth:"wide",parsePatterns:Bi,defaultParseWidth:"any"}),dayPeriod:ue({matchPatterns:Ki,defaultMatchWidth:"any",parsePatterns:Ji,defaultParseWidth:"any"})},ts={code:"en-US",formatDistance:Oi,formatLong:Ei,formatRelative:Ci,localize:Hi,match:es,options:{weekStartsOn:0,firstWeekContainsDate:1}};function rs(e,t){const r=S(e,t==null?void 0:t.in);return _i(r,Di(r))+1}function ns(e,t){const r=S(e,t==null?void 0:t.in),n=+Oe(r)-+wi(r);return Math.round(n/nn)+1}function sn(e,t){var _,y,p,E;const r=S(e,t==null?void 0:t.in),n=r.getFullYear(),i=he(),o=(t==null?void 0:t.firstWeekContainsDate)??((y=(_=t==null?void 0:t.locale)==null?void 0:_.options)==null?void 0:y.firstWeekContainsDate)??i.firstWeekContainsDate??((E=(p=i.locale)==null?void 0:p.options)==null?void 0:E.firstWeekContainsDate)??1,c=I((t==null?void 0:t.in)||e,0);c.setFullYear(n+1,0,o),c.setHours(0,0,0,0);const d=A(c,t),m=I((t==null?void 0:t.in)||e,0);m.setFullYear(n,0,o),m.setHours(0,0,0,0);const f=A(m,t);return+r>=+d?n+1:+r>=+f?n:n-1}function as(e,t){var d,m,f,_;const r=he(),n=(t==null?void 0:t.firstWeekContainsDate)??((m=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((_=(f=r.locale)==null?void 0:f.options)==null?void 0:_.firstWeekContainsDate)??1,i=sn(e,t),o=I((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),A(o,t)}function is(e,t){const r=S(e,t==null?void 0:t.in),n=+A(r,t)-+as(r,t);return Math.round(n/nn)+1}function g(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const F={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return g(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):g(r+1,2)},d(e,t){return g(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return g(e.getHours()%12||12,t.length)},H(e,t){return g(e.getHours(),t.length)},m(e,t){return g(e.getMinutes(),t.length)},s(e,t){return g(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return g(i,t.length)}},te={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tr={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return F.y(e,t)},Y:function(e,t,r,n){const i=sn(e,n),o=i>0?i:1-i;if(t==="YY"){const c=o%100;return g(c,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):g(o,t.length)},R:function(e,t){const r=an(e);return g(r,t.length)},u:function(e,t){const r=e.getFullYear();return g(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return g(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return g(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return F.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return g(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=is(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):g(i,t.length)},I:function(e,t,r){const n=ns(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):g(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):F.d(e,t)},D:function(e,t,r){const n=rs(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):g(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return g(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return g(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return g(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=te.noon:n===0?i=te.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=te.evening:n>=12?i=te.afternoon:n>=4?i=te.morning:i=te.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return F.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):F.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):g(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):g(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):F.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):F.s(e,t)},S:function(e,t){return F.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return nr(n);case"XXXX":case"XX":return z(n);case"XXXXX":case"XXX":default:return z(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return nr(n);case"xxxx":case"xx":return z(n);case"xxxxx":case"xxx":default:return z(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rr(n,":");case"OOOO":default:return"GMT"+z(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rr(n,":");case"zzzz":default:return"GMT"+z(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return g(n,t.length)},T:function(e,t,r){return g(+e,t.length)}};function rr(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+g(o,2)}function nr(e,t){return e%60===0?(e>0?"-":"+")+g(Math.abs(e)/60,2):z(e,t)}function z(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=g(Math.trunc(n/60),2),o=g(n%60,2);return r+i+t+o}const ar=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},on=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},ss=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return ar(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",ar(n,t)).replace("{{time}}",on(i,t))},os={p:on,P:ss},us=/^D+$/,cs=/^Y+$/,ls=["D","DD","YY","YYYY"];function ds(e){return us.test(e)}function fs(e){return cs.test(e)}function ms(e,t,r){const n=hs(e,t,r);if(console.warn(n),ls.includes(e))throw new RangeError(n)}function hs(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ys=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ps=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,gs=/^'([^]*?)'?$/,_s=/''/g,ws=/[a-zA-Z]/;function un(e,t,r){var _,y,p,E,C,N,k,j;const n=he(),i=(r==null?void 0:r.locale)??n.locale??ts,o=(r==null?void 0:r.firstWeekContainsDate)??((y=(_=r==null?void 0:r.locale)==null?void 0:_.options)==null?void 0:y.firstWeekContainsDate)??n.firstWeekContainsDate??((E=(p=n.locale)==null?void 0:p.options)==null?void 0:E.firstWeekContainsDate)??1,c=(r==null?void 0:r.weekStartsOn)??((N=(C=r==null?void 0:r.locale)==null?void 0:C.options)==null?void 0:N.weekStartsOn)??n.weekStartsOn??((j=(k=n.locale)==null?void 0:k.options)==null?void 0:j.weekStartsOn)??0,d=S(e,r==null?void 0:r.in);if(!Ti(d))throw new RangeError("Invalid time value");let m=t.match(ps).map(O=>{const T=O[0];if(T==="p"||T==="P"){const G=os[T];return G(O,i.formatLong)}return O}).join("").match(ys).map(O=>{if(O==="''")return{isToken:!1,value:"'"};const T=O[0];if(T==="'")return{isToken:!1,value:bs(O)};if(tr[T])return{isToken:!0,value:O};if(T.match(ws))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return{isToken:!1,value:O}});i.localize.preprocessor&&(m=i.localize.preprocessor(d,m));const f={firstWeekContainsDate:o,weekStartsOn:c,locale:i};return m.map(O=>{if(!O.isToken)return O.value;const T=O.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&fs(T)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&ds(T))&&ms(T,t,String(e));const G=tr[T[0]];return G(d,T,i.localize,f)}).join("")}function bs(e){const t=e.match(gs);return t?t[1].replace(_s,"'"):e}function Ts(e,t){const r=S(e,t==null?void 0:t.in),n=r.getFullYear(),i=r.getMonth(),o=I(r,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Ds(){return Object.assign({},he())}function ir(e){return+S(e)}function sr(e){return Math.trunc(+S(e)/1e3)}function Ss(e){return Math.trunc(e*hi)}function Os(e){const t=e/mi;return Math.trunc(t)}function cn(e,t,r){return yi(e,-1,r)}function or(e,t,r){const n=Ds(),i=xs(e,r.timeZone,r.locale??n.locale);return"formatToParts"in i?Ms(i,t):vs(i,t)}function Ms(e,t){const r=e.formatToParts(t);for(let n=r.length-1;n>=0;--n)if(r[n].type==="timeZoneName")return r[n].value}function vs(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function xs(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function Es(e,t){const r=ks(t);return"formatToParts"in r?Cs(r,e):Ns(r,e)}const Ps={year:0,month:1,day:2,hour:3,minute:4,second:5};function Cs(e,t){try{const r=e.formatToParts(t),n=[];for(let i=0;i<r.length;i++){const o=Ps[r[i].type];o!==void 0&&(n[o]=parseInt(r[i].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}function Ns(e,t){const r=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}const Xe={},ur=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Is=ur==="06/25/2014, 00:00:00"||ur==="06/25/2014 00:00:00";function ks(e){return Xe[e]||(Xe[e]=Is?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Xe[e]}function ht(e,t,r,n,i,o,c){const d=new Date(0);return d.setUTCFullYear(e,t,r),d.setUTCHours(n,i,o,c),d}const cr=36e5,qs=6e4,Ze={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ye(e,t,r){if(!e)return 0;let n=Ze.timezoneZ.exec(e);if(n)return 0;let i,o;if(n=Ze.timezoneHH.exec(e),n)return i=parseInt(n[1],10),lr(i)?-(i*cr):NaN;if(n=Ze.timezoneHHMM.exec(e),n){i=parseInt(n[2],10);const c=parseInt(n[3],10);return lr(i,c)?(o=Math.abs(i)*cr+c*qs,n[1]==="+"?-o:o):NaN}if(As(e)){t=new Date(t||Date.now());const c=r?t:Rs(t),d=tt(c,e);return-(r?d:Ys(t,d,e))}return NaN}function Rs(e){return ht(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function tt(e,t){const r=Es(e,t),n=ht(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=e.getTime();const o=i%1e3;return i-=o>=0?o:1e3+o,n-i}function Ys(e,t,r){let i=e.getTime()-t;const o=tt(new Date(i),r);if(t===o)return t;i-=o-t;const c=tt(new Date(i),r);return o===c?o:Math.max(o,c)}function lr(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const dr={};function As(e){if(dr[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),dr[e]=!0,!0}catch{return!1}}const Hs=60*1e3,Fs={X:function(e,t,r){const n=Be(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return fr(n);case"XXXX":case"XX":return re(n);case"XXXXX":case"XXX":default:return re(n,":")}},x:function(e,t,r){const n=Be(r.timeZone,e);switch(t){case"x":return fr(n);case"xxxx":case"xx":return re(n);case"xxxxx":case"xxx":default:return re(n,":")}},O:function(e,t,r){const n=Be(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+js(n,":");case"OOOO":default:return"GMT"+re(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return or("short",e,r);case"zzzz":default:return or("long",e,r)}}};function Be(e,t){const r=e?ye(e,t,!0)/Hs:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function ve(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function re(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=ve(Math.floor(n/60),2),o=ve(Math.floor(n%60),2);return r+i+t+o}function fr(e,t){return e%60===0?(e>0?"-":"+")+ve(Math.abs(e)/60,2):re(e,t)}function js(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+ve(o,2)}function mr(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const ln=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ke=36e5,hr=6e4,Gs=2,M={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:ln};function xe(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const r=t.additionalDigits==null?Gs:Number(t.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const n=Ws(e),{year:i,restDateString:o}=Ls(n.date,r),c=Us(o,i);if(c===null||isNaN(c.getTime()))return new Date(NaN);if(c){const d=c.getTime();let m=0,f;if(n.time&&(m=zs(n.time),m===null||isNaN(m)))return new Date(NaN);if(n.timeZone||t.timeZone){if(f=ye(n.timeZone||t.timeZone,new Date(d+m)),isNaN(f))return new Date(NaN)}else f=mr(new Date(d+m)),f=mr(new Date(d+m+f));return new Date(d+m+f)}else return new Date(NaN)}function Ws(e){const t={};let r=M.dateTimePattern.exec(e),n;if(r?(t.date=r[1],n=r[3]):(r=M.datePattern.exec(e),r?(t.date=r[1],n=r[2]):(t.date=null,n=e)),n){const i=M.timeZone.exec(n);i?(t.time=n.replace(i[1],""),t.timeZone=i[1].trim()):t.time=n}return t}function Ls(e,t){if(e){const r=M.YYY[t],n=M.YYYYY[t];let i=M.YYYY.exec(e)||n.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=M.YY.exec(e)||r.exec(e),i){const o=i[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function Us(e,t){if(t===null)return null;let r,n,i;if(!e||!e.length)return r=new Date(0),r.setUTCFullYear(t),r;let o=M.MM.exec(e);if(o)return r=new Date(0),n=parseInt(o[1],10)-1,pr(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(o=M.DDD.exec(e),o){r=new Date(0);const c=parseInt(o[1],10);return Qs(t,c)?(r.setUTCFullYear(t,0,c),r):new Date(NaN)}if(o=M.MMDD.exec(e),o){r=new Date(0),n=parseInt(o[1],10)-1;const c=parseInt(o[2],10);return pr(t,n,c)?(r.setUTCFullYear(t,n,c),r):new Date(NaN)}if(o=M.Www.exec(e),o)return i=parseInt(o[1],10)-1,gr(i)?yr(t,i):new Date(NaN);if(o=M.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const c=parseInt(o[2],10)-1;return gr(i,c)?yr(t,i,c):new Date(NaN)}return null}function zs(e){let t,r,n=M.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),Je(t)?t%24*Ke:NaN;if(n=M.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),Je(t,r)?t%24*Ke+r*hr:NaN;if(n=M.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const i=parseFloat(n[3].replace(",","."));return Je(t,r,i)?t%24*Ke+r*hr+i*1e3:NaN}return null}function yr(e,t,r){t=t||0,r=r||0;const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,o=t*7+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}const $s=[31,28,31,30,31,30,31,31,30,31,30,31],Vs=[31,29,31,30,31,30,31,31,30,31,30,31];function dn(e){return e%400===0||e%4===0&&e%100!==0}function pr(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=dn(e);if(n&&r>Vs[t]||!n&&r>$s[t])return!1}return!0}function Qs(e,t){if(t<1)return!1;const r=dn(e);return!(r&&t>366||!r&&t>365)}function gr(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Je(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const Xs=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Zs(e,t,r={}){t=String(t);const n=t.match(Xs);if(n){const i=xe(r.originalDate||e,r);t=n.reduce(function(o,c){if(c[0]==="'")return o;const d=o.indexOf(c),m=o[d-1]==="'",f=o.replace(c,"'"+Fs[c[0]](i,c,r)+"'");return m?f.substring(0,d-1)+f.substring(d+1):f},t)}return un(e,t,r)}function fn(e,t,r){e=xe(e,r);const n=ye(t,e,!0),i=new Date(e.getTime()-n),o=new Date(0);return o.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),o.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),o}function Bs(e,t,r,n){return n={...n,timeZone:t,originalDate:e},Zs(fn(e,t,{timeZone:n.timeZone}),r,n)}function Ks(e,t,r){if(typeof e=="string"&&!e.match(ln))return xe(e,{...r,timeZone:t});e=xe(e,r);const n=ht(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=ye(t,new Date(n));return new Date(n+i)}function mn(e,t){return-ye(e,t)}function Js(e){return un(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function rt(e,t={}){if(!e)return e;const r=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let n="MMM dd, yyy hh:mm a";t.short&&(n="MMM dd, yyy"),t.includeTZ&&(n+=" (z)");const i=new Date(e);return Bs(i,r,n)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function eo(e,t){return`${rt(e.getTime())} - ${rt(t.getTime(),{includeTZ:!0})}`}const ce={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function to(e,t){return e.map(r=>({value:r,label:t.t(`configuration.vitals.reports.granularity.${r}`)}))}function hn(e,t){return{duration:e,type:"duration",origin:t}}function ro(e){return e&&Pe.find(r=>e<=ce[r])||null}function yn(e,t,r,n){const i=ce[r];let o=0;return i>=ce.daily&&(n?o=-mn(n,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function pn(e,t,r){return yn(Math.floor,e,t,r)}function yt(e,t,r){return yn(Math.ceil,e,t,r)}class Re{constructor(t,r,n){b(this,"timeframe");b(this,"tz");b(this,"dataGranularity");if(this.constructor===Re)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=r,this.dataGranularity=n??t.dataGranularity}calculateStartDate(t,r,n=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*n);{const i=this.endDate(),o=this.timeframe.rawStart(this.tz),c=pn(o,r,this.tz),m=(i.getTime()-c.getTime())*(n-1);return new Date(c.getTime()-m)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return hn(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return sr(this.startDate())}endSeconds(){return sr(this.endDate())}startMs(){return ir(this.startDate())}endMs(){return ir(this.endDate())}}class no extends Re{constructor(r,n,i,o,c){super(r,i,o);b(this,"granularity");n&&r.allowedGranularities(c).has(n)?this.granularity=n:c?this.granularity=r.fineGrainedDefaultGranularity??r.defaultResponseGranularity:this.granularity=r.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return yt(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return ce[this.granularity]}}class gn extends Re{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return yt(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class ao extends gn{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function io(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ee={exports:{}};Ee.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",c="[object Array]",d="[object Boolean]",m="[object Date]",f="[object Error]",_="[object Function]",y="[object GeneratorFunction]",p="[object Map]",E="[object Number]",C="[object Object]",N="[object Promise]",k="[object RegExp]",j="[object Set]",O="[object String]",T="[object Symbol]",G="[object WeakMap]",gt="[object ArrayBuffer]",pe="[object DataView]",_t="[object Float32Array]",wt="[object Float64Array]",bt="[object Int8Array]",Tt="[object Int16Array]",Dt="[object Int32Array]",St="[object Uint8Array]",Ot="[object Uint8ClampedArray]",Mt="[object Uint16Array]",vt="[object Uint32Array]",bn=/[\\^$.*+?()[\]{}|]/g,Tn=/\w*$/,Dn=/^\[object .+?Constructor\]$/,Sn=/^(?:0|[1-9]\d*)$/,w={};w[o]=w[c]=w[gt]=w[pe]=w[d]=w[m]=w[_t]=w[wt]=w[bt]=w[Tt]=w[Dt]=w[p]=w[E]=w[C]=w[k]=w[j]=w[O]=w[T]=w[St]=w[Ot]=w[Mt]=w[vt]=!0,w[f]=w[_]=w[G]=!1;var On=typeof Se=="object"&&Se&&Se.Object===Object&&Se,Mn=typeof self=="object"&&self&&self.Object===Object&&self,q=On||Mn||Function("return this")(),xt=t&&!t.nodeType&&t,Et=xt&&!0&&e&&!e.nodeType&&e,vn=Et&&Et.exports===xt;function xn(a,s){return a.set(s[0],s[1]),a}function En(a,s){return a.add(s),a}function Pn(a,s){for(var u=-1,l=a?a.length:0;++u<l&&s(a[u],u,a)!==!1;);return a}function Cn(a,s){for(var u=-1,l=s.length,D=a.length;++u<l;)a[D+u]=s[u];return a}function Pt(a,s,u,l){for(var D=-1,v=a?a.length:0;++D<v;)u=s(u,a[D],D,a);return u}function Nn(a,s){for(var u=-1,l=Array(a);++u<a;)l[u]=s(u);return l}function In(a,s){return a==null?void 0:a[s]}function Ct(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function Nt(a){var s=-1,u=Array(a.size);return a.forEach(function(l,D){u[++s]=[D,l]}),u}function Ae(a,s){return function(u){return a(s(u))}}function It(a){var s=-1,u=Array(a.size);return a.forEach(function(l){u[++s]=l}),u}var kn=Array.prototype,qn=Function.prototype,ge=Object.prototype,He=q["__core-js_shared__"],kt=function(){var a=/[^.]+$/.exec(He&&He.keys&&He.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),qt=qn.toString,H=ge.hasOwnProperty,_e=ge.toString,Rn=RegExp("^"+qt.call(H).replace(bn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rt=vn?q.Buffer:void 0,Yt=q.Symbol,At=q.Uint8Array,Yn=Ae(Object.getPrototypeOf,Object),An=Object.create,Hn=ge.propertyIsEnumerable,Fn=kn.splice,Ht=Object.getOwnPropertySymbols,jn=Rt?Rt.isBuffer:void 0,Gn=Ae(Object.keys,Object),Fe=J(q,"DataView"),ie=J(q,"Map"),je=J(q,"Promise"),Ge=J(q,"Set"),We=J(q,"WeakMap"),se=J(Object,"create"),Wn=U(Fe),Ln=U(ie),Un=U(je),zn=U(Ge),$n=U(We),Ft=Yt?Yt.prototype:void 0,jt=Ft?Ft.valueOf:void 0;function W(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function Vn(){this.__data__=se?se(null):{}}function Qn(a){return this.has(a)&&delete this.__data__[a]}function Xn(a){var s=this.__data__;if(se){var u=s[a];return u===n?void 0:u}return H.call(s,a)?s[a]:void 0}function Zn(a){var s=this.__data__;return se?s[a]!==void 0:H.call(s,a)}function Bn(a,s){var u=this.__data__;return u[a]=se&&s===void 0?n:s,this}W.prototype.clear=Vn,W.prototype.delete=Qn,W.prototype.get=Xn,W.prototype.has=Zn,W.prototype.set=Bn;function R(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function Kn(){this.__data__=[]}function Jn(a){var s=this.__data__,u=we(s,a);if(u<0)return!1;var l=s.length-1;return u==l?s.pop():Fn.call(s,u,1),!0}function ea(a){var s=this.__data__,u=we(s,a);return u<0?void 0:s[u][1]}function ta(a){return we(this.__data__,a)>-1}function ra(a,s){var u=this.__data__,l=we(u,a);return l<0?u.push([a,s]):u[l][1]=s,this}R.prototype.clear=Kn,R.prototype.delete=Jn,R.prototype.get=ea,R.prototype.has=ta,R.prototype.set=ra;function B(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function na(){this.__data__={hash:new W,map:new(ie||R),string:new W}}function aa(a){return be(this,a).delete(a)}function ia(a){return be(this,a).get(a)}function sa(a){return be(this,a).has(a)}function oa(a,s){return be(this,a).set(a,s),this}B.prototype.clear=na,B.prototype.delete=aa,B.prototype.get=ia,B.prototype.has=sa,B.prototype.set=oa;function K(a){this.__data__=new R(a)}function ua(){this.__data__=new R}function ca(a){return this.__data__.delete(a)}function la(a){return this.__data__.get(a)}function da(a){return this.__data__.has(a)}function fa(a,s){var u=this.__data__;if(u instanceof R){var l=u.__data__;if(!ie||l.length<r-1)return l.push([a,s]),this;u=this.__data__=new B(l)}return u.set(a,s),this}K.prototype.clear=ua,K.prototype.delete=ca,K.prototype.get=la,K.prototype.has=da,K.prototype.set=fa;function ma(a,s){var u=ze(a)||Aa(a)?Nn(a.length,String):[],l=u.length,D=!!l;for(var v in a)H.call(a,v)&&!(D&&(v=="length"||ka(v,l)))&&u.push(v);return u}function Gt(a,s,u){var l=a[s];(!(H.call(a,s)&&zt(l,u))||u===void 0&&!(s in a))&&(a[s]=u)}function we(a,s){for(var u=a.length;u--;)if(zt(a[u][0],s))return u;return-1}function ha(a,s){return a&&Wt(s,$e(s),a)}function Le(a,s,u,l,D,v,Y){var x;if(l&&(x=v?l(a,D,v,Y):l(a)),x!==void 0)return x;if(!Te(a))return a;var Qt=ze(a);if(Qt){if(x=Ca(a),!s)return xa(a,x)}else{var ee=L(a),Xt=ee==_||ee==y;if(Fa(a))return ba(a,s);if(ee==C||ee==o||Xt&&!v){if(Ct(a))return v?a:{};if(x=Na(Xt?{}:a),!s)return Ea(a,ha(x,a))}else{if(!w[ee])return v?a:{};x=Ia(a,ee,Le,s)}}Y||(Y=new K);var Zt=Y.get(a);if(Zt)return Zt;if(Y.set(a,x),!Qt)var Bt=u?Pa(a):$e(a);return Pn(Bt||a,function(Ve,De){Bt&&(De=Ve,Ve=a[De]),Gt(x,De,Le(Ve,s,u,l,De,a,Y))}),x}function ya(a){return Te(a)?An(a):{}}function pa(a,s,u){var l=s(a);return ze(a)?l:Cn(l,u(a))}function ga(a){return _e.call(a)}function _a(a){if(!Te(a)||Ra(a))return!1;var s=Vt(a)||Ct(a)?Rn:Dn;return s.test(U(a))}function wa(a){if(!Ut(a))return Gn(a);var s=[];for(var u in Object(a))H.call(a,u)&&u!="constructor"&&s.push(u);return s}function ba(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function Ue(a){var s=new a.constructor(a.byteLength);return new At(s).set(new At(a)),s}function Ta(a,s){var u=s?Ue(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function Da(a,s,u){var l=s?u(Nt(a),!0):Nt(a);return Pt(l,xn,new a.constructor)}function Sa(a){var s=new a.constructor(a.source,Tn.exec(a));return s.lastIndex=a.lastIndex,s}function Oa(a,s,u){var l=s?u(It(a),!0):It(a);return Pt(l,En,new a.constructor)}function Ma(a){return jt?Object(jt.call(a)):{}}function va(a,s){var u=s?Ue(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function xa(a,s){var u=-1,l=a.length;for(s||(s=Array(l));++u<l;)s[u]=a[u];return s}function Wt(a,s,u,l){u||(u={});for(var D=-1,v=s.length;++D<v;){var Y=s[D],x=void 0;Gt(u,Y,x===void 0?a[Y]:x)}return u}function Ea(a,s){return Wt(a,Lt(a),s)}function Pa(a){return pa(a,$e,Lt)}function be(a,s){var u=a.__data__;return qa(s)?u[typeof s=="string"?"string":"hash"]:u.map}function J(a,s){var u=In(a,s);return _a(u)?u:void 0}var Lt=Ht?Ae(Ht,Object):Wa,L=ga;(Fe&&L(new Fe(new ArrayBuffer(1)))!=pe||ie&&L(new ie)!=p||je&&L(je.resolve())!=N||Ge&&L(new Ge)!=j||We&&L(new We)!=G)&&(L=function(a){var s=_e.call(a),u=s==C?a.constructor:void 0,l=u?U(u):void 0;if(l)switch(l){case Wn:return pe;case Ln:return p;case Un:return N;case zn:return j;case $n:return G}return s});function Ca(a){var s=a.length,u=a.constructor(s);return s&&typeof a[0]=="string"&&H.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function Na(a){return typeof a.constructor=="function"&&!Ut(a)?ya(Yn(a)):{}}function Ia(a,s,u,l){var D=a.constructor;switch(s){case gt:return Ue(a);case d:case m:return new D(+a);case pe:return Ta(a,l);case _t:case wt:case bt:case Tt:case Dt:case St:case Ot:case Mt:case vt:return va(a,l);case p:return Da(a,l,u);case E:case O:return new D(a);case k:return Sa(a);case j:return Oa(a,l,u);case T:return Ma(a)}}function ka(a,s){return s=s??i,!!s&&(typeof a=="number"||Sn.test(a))&&a>-1&&a%1==0&&a<s}function qa(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function Ra(a){return!!kt&&kt in a}function Ut(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||ge;return a===u}function U(a){if(a!=null){try{return qt.call(a)}catch{}try{return a+""}catch{}}return""}function Ya(a){return Le(a,!0,!0)}function zt(a,s){return a===s||a!==a&&s!==s}function Aa(a){return Ha(a)&&H.call(a,"callee")&&(!Hn.call(a,"callee")||_e.call(a)==o)}var ze=Array.isArray;function $t(a){return a!=null&&ja(a.length)&&!Vt(a)}function Ha(a){return Ga(a)&&$t(a)}var Fa=jn||La;function Vt(a){var s=Te(a)?_e.call(a):"";return s==_||s==y}function ja(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function Te(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function Ga(a){return!!a&&typeof a=="object"}function $e(a){return $t(a)?ma(a):wa(a)}function Wa(){return[]}function La(){return!1}e.exports=Ya})(Ee,Ee.exports);var so=Ee.exports;const oo=io(so),ae=(e,t)=>new Date(e.getTime()-mn(t,e));class P{constructor(t){b(this,"timeframeText");b(this,"key");b(this,"display");b(this,"timeframeLength");b(this,"allowedTiers");b(this,"defaultResponseGranularity");b(this,"dataGranularity");b(this,"isRelative");b(this,"fineGrainedDefaultGranularity");b(this,"_startCustom");b(this,"_endCustom");b(this,"_allowedGranularitiesOverride");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}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const r=new Set,n=this.maximumTimeframeLength()/3600;return n<=6&&r.add("minutely"),n>=2&&n<=7*24&&r.add("hourly"),n>=2*24&&r.add("daily"),n>=2*24*14&&r.add("weekly"),r}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const r=Ks(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return fn(r,t)}}class uo extends P{rawStart(t){let r=A(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ae(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class co extends P{rawStart(t){let r=ne(this.tzAdjustedDate(t));return t&&(r=ae(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class lo extends P{rawEnd(t){let r=A(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=ae(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let n=A(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(n=ae(n,t)),n}}class fo extends P{rawEnd(t){let r=ne(this.tzAdjustedDate(t));return t&&(r=ae(r,t)),r}rawStart(t){let r=ne(cn(this.tzAdjustedDate(t)));return t&&(r=ae(r,t)),r}}const _n=new Map([[h.FIFTEEN_MIN,new P({key:h.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]})],[h.ONE_HOUR,new P({key:h.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]})],[h.SIX_HOUR,new P({key:h.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.TWELVE_HOUR,new P({key:h.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.ONE_DAY,new P({key:h.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.SEVEN_DAY,new P({key:h.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.THIRTY_DAY,new P({key:h.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]})],[h.CURRENT_WEEK,new uo({key:h.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=A(new Date,{weekStartsOn:1});return(Me(Jt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.CURRENT_MONTH,new co({key:h.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=ne(new Date);return(Me(Jt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[h.PREVIOUS_WEEK,new lo({key:h.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.PREVIOUS_MONTH,new fo({key:h.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=ne(new Date),r=ne(cn(new Date));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=wn(t,r)),60*60*24*Ts(new Date().setMonth(new Date().getMonth()-1))+Ss(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function mo(e){const t=new Date(e.start),r=new Date(e.end),n=(r.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&oo(_n.get(e.timePeriodsKey))||new P({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:r,timeframeLength:()=>n,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function ho(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function yo(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function wn(e,t){return Os(e.getTimezoneOffset()-t.getTimezoneOffset())}const po={"15M":h.FIFTEEN_MIN,"1H":h.ONE_HOUR,"6H":h.SIX_HOUR,"12H":h.TWELVE_HOUR,"24H":h.ONE_DAY,"7D":h.SEVEN_DAY,"15m":h.FIFTEEN_MIN,"1h":h.ONE_HOUR,"6h":h.SIX_HOUR,"12h":h.TWELVE_HOUR,"24h":h.ONE_DAY,"7d":h.SEVEN_DAY,"30d":h.THIRTY_DAY,current_week:h.CURRENT_WEEK,current_month:h.CURRENT_MONTH,previous_week:h.PREVIOUS_WEEK,previous_month:h.PREVIOUS_MONTH};class Ye{constructor(t){b(this,"_seed");this._seed=t}next(t,r){const n=Math.sin(this._seed++)*1e4,i=n-Math.floor(n);return Math.floor(i*(r-t+1))+t}}const go=(e,t,r)=>{const n=pt(10,1e4),i=new Ye(n),o=Date.now()-6*60*60*1e3,c=Date.now(),d=[];let m=0;for(let y=o;y<=c;y+=60*60*1e3)if(t)for(const p in t)t[p].forEach(E=>{m+=i.next(50,500);const C={[p]:E,[e.name]:m},N={version:"1.0",timestamp:new Date(y).toISOString(),event:C};d.push(N)});else{m+=i.next(50,500);const p={version:"1.0",timestamp:new Date(y).toISOString(),event:{[e.name]:m}};d.push(p)}const f={};if(t)for(const y in t)f[y]={},t[y].forEach(p=>{f[y][p]={name:p,deleted:!1}});const _={start_ms:o,end_ms:c,start:new Date(o).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:f,...r??{}};return{data:d,meta:_}},_o=(e,t)=>{const r=pt(10,1e4),n=new Ye(r),i=Date.now()-6*60*60*1e3,o=Date.now(),c=[],d={};e.forEach(f=>{d[f.name]=0});for(let f=i;f<=o;f+=60*60*1e3){const _={};e.forEach(p=>{d[p.name]+=n.next(50,500),_[p.name]=d[p.name]});const y={version:"1.0",timestamp:new Date(f).toISOString(),event:_};c.push(y)}const m={start_ms:i,end_ms:o,start:new Date(i).toISOString(),end:new Date(o).toISOString(),query_id:"12345",metric_names:e.map(f=>f.name),metric_units:e.reduce((f,_)=>(f[_.name]=_.unit,f),{}),granularity_ms:60*60*1e3,display:{},...t??{}};return{data:c,meta:m}},wo=(e,t,r)=>{const n=Math.floor(Math.random()*9991)+10,i=new Ye(n),o=Date.now()-6*60*60*1e3,c=Date.now(),d=new Date((o+c)/2).toISOString(),m=[];if(t){const y=Object.keys(t),p=Object.values(t),E=(C,N)=>{if(N===y.length){e.forEach(k=>{C[k.name]=i.next(1e3,5e7)}),m.push({version:"1.0",timestamp:new Date().toISOString(),event:{...C}});return}p[N].forEach(k=>{E({...C,[y[N]]:k},N+1)})};E({},0)}else{const y={};e.forEach(p=>{y[p.name]=i.next(50,500)}),m.push({version:"1.0",timestamp:d,event:y})}const f={};if(t)for(const y in t)f[y]={},t[y].forEach(p=>{f[y][p]={name:p,deleted:!1}});const _={start_ms:o,end_ms:c,start:new Date(o).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:e.map(y=>y.name),metric_units:e.reduce((y,p)=>(y[p.name]=p.unit,y),{}),truncated:!1,limit:50,display:f,granularity_ms:c-o,...r??{}};return{data:m,meta:_}};function pt(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}exports.DeltaQueryTime=ao;exports.Granularities=ce;exports.REFRESH_INTERVAL_MS=$a;exports.SeededRandom=Ye;exports.TIMEFRAME_LOOKUP=po;exports.TimePeriods=_n;exports.Timeframe=P;exports.TimeframeKeys=h;exports.TimeseriesQueryTime=no;exports.UnaryQueryTime=gn;exports.aiExploreAggregations=ot;exports.apiUsageQuerySchema=Zr;exports.barChartSchema=Lr;exports.basicExploreAggregations=Ce;exports.basicQuerySchema=Br;exports.ceilToNearestTimeGrain=yt;exports.dashboardConfigSchema=li;exports.dashboardTileTypes=oi;exports.dashboardsSchemaV1=si;exports.datasourceToFilterableDimensions=Dr;exports.datePickerSelectionToTimeframe=mo;exports.donutChartSchema=$r;exports.dstOffsetHours=wn;exports.exploreAggregations=st;exports.exploreFilterTypesV2=nt;exports.filterableAiExploreDimensions=Q;exports.filterableBasicExploreDimensions=$;exports.filterableExploreDimensions=V;exports.filterableRequestDimensions=et;exports.filterableRequestMetrics=Tr;exports.filterableRequestWildcardDimensions=Ka;exports.floorToNearestTimeGrain=pn;exports.formatISOTimeWithTZ=Js;exports.formatTime=rt;exports.formatTimeRange=eo;exports.gaugeChartSchema=zr;exports.generateCrossSectionalData=wo;exports.generateMultipleMetricTimeSeriesData=_o;exports.generateSingleMetricTimeSeriesData=go;exports.getFieldDataSources=di;exports.granularitiesToOptions=to;exports.granularityMsToQuery=hn;exports.granularityValues=Pe;exports.llmUsageSchema=Kr;exports.metricCardSchema=Qr;exports.msToGranularity=ro;exports.queryDatasources=ei;exports.queryableAiExploreDimensions=Ie;exports.queryableBasicExploreDimensions=de;exports.queryableExploreDimensions=Ne;exports.queryableRequestDimensions=_r;exports.queryableRequestMetrics=br;exports.queryableRequestWildcardDimensions=wr;exports.rand=pt;exports.relativeTimeRangeValuesRequestV2=Ja;exports.relativeTimeRangeValuesV4=it;exports.reportChartTypes=Va;exports.requestFilterTypeEmptyV2=at;exports.requestFilterTypeEqualsV2=Qa;exports.requestFilterTypeMetricV2=Xa;exports.requestFilterTypeWildcardV2=Za;exports.singleValueSchema=Xr;exports.slottableSchema=Wr;exports.stripUnknownFilters=ti;exports.tileConfigSchema=rn;exports.tileDefinitionSchema=en;exports.tileLayoutSchema=tn;exports.timeRangeTypeV2=Ba;exports.timeframeToDatepickerSelection=ho;exports.timeframeToDatepickerTimeperiod=yo;exports.timeseriesChartSchema=Ur;exports.topNTableSchema=Vr;exports.validDashboardQuery=Jr;
|
|
1
|
+
"use strict";var Wa=Object.defineProperty;var La=(e,t,r)=>t in e?Wa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var b=(e,t,r)=>La(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ua=30*1e3;var h=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e))(h||{});const za=["horizontal_bar","vertical_bar","timeseries_line","choropleth_map","timeseries_bar","donut","single_value"],rt=["in","not_in","selector"],$a=["=","!="],Va=["=","!=","<",">","<=",">="],nt=["empty","not_empty"],Qa=["starts_with","ends_with"],Xa=["absolute","relative"],at=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Pe=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],le=e=>e.filter(t=>t!=="time"),de=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],re=le(de),Ce=["active_services","request_count","request_per_minute","response_latency_average"],Ne=[...de,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],ne=le(Ne),it=[...Ce,"response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],Ie=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time","realm","status_code","status_code_grouped","ai_plugin"],ae=le(Ie),st=["total_tokens","prompt_tokens","completion_tokens","ai_request_count","cost","llm_cache_embeddings_latency_average","llm_cache_fetch_latency_average","llm_latency_average","llm_embeddings_tokens","llm_embeddings_cost"],gr=["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","portal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"],Za=le(gr),_r=["auth_type","client_ip","country_code","data_plane_node_version","header_host","header_user_agent","http_method","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],Ba=_r,wr=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],Ka=le(wr),Ja=["15M","1H","6H","12H","24H","7D"],ei=["basic","api_usage","llm_usage"],br={basic:new Set(re),api_usage:new Set(ne),llm_usage:new Set(ae)},ti=(e,t)=>t.filter(r=>br[e].has(r.field)),ri=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],fe={type:"string"},$={type:"string"},Tr={type:"boolean"},Dr={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},Sr={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Or={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chartDatasetColors:Dr,syntheticsDataKey:fe,chartTitle:$,allowCsvExport:Tr},required:["type"],additionalProperties:!1},Mr={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chartDatasetColors:Dr,syntheticsDataKey:fe,chartTitle:$,allowCsvExport:Tr},required:["type"],additionalProperties:!1},vr={type:"object",properties:{type:{type:"string",enum:["gauge"]},metricDisplay:{type:"string",enum:["hidden","single","full"]},reverseDataset:{type:"boolean"},numerator:{type:"number"},syntheticsDataKey:fe,chartTitle:$},required:["type"],additionalProperties:!1},xr={type:"object",properties:{type:{type:"string",enum:["donut"]},syntheticsDataKey:fe,chartTitle:$},required:["type"],additionalProperties:!1},Er={type:"object",properties:{chartTitle:$,syntheticsDataKey:fe,type:{type:"string",enum:["top_n"]},description:{type:"string"},entityLink:{type:"string"}},required:["type"],additionalProperties:!1},Pr={type:"object",properties:{chartTitle:$,type:{type:"string",enum:["golden_signals"]},longCardTitles:{type:"boolean"},description:{type:"string"},percentileLatency:{type:"boolean"}},required:["type"],additionalProperties:!1},Cr={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimalPoints:{type:"number"},chartTitle:$},required:["type"],additionalProperties:!1},ni={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:at,default:"1h"}},required:["type","time_range"],additionalProperties:!1},ai={type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type","start","end"],additionalProperties:!1},ot={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Pe},time_range:{type:"object",description:"The time range to query.",anyOf:[ni,ai],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},ut=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),ct=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),ke=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:rt},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:nt}},required:["field","operator"],additionalProperties:!1}]}}),Nr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["advanced"]},metrics:ut(it),dimensions:ct(Ne),filters:ke(ne),...ot},required:["datasource"],additionalProperties:!1},Ir={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:ut(Ce),dimensions:ct(de),filters:ke(re),...ot},required:["datasource"],additionalProperties:!1},kr={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["ai"]},metrics:ut(st),dimensions:ct(Ie),filters:ke(ae),...ot},required:["datasource"],additionalProperties:!1},qr={anyOf:[Nr,Ir,kr]},Rr={type:"object",properties:{query:qr,chart:{anyOf:[Or,vr,xr,Mr,Pr,Er,Sr,Cr]}},required:["query","chart"],additionalProperties:!1},Yr={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fitToContent:{type:"boolean"}},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.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},Ar={type:"object",properties:{definition:Rr,layout:Yr,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["definition","layout"],additionalProperties:!1},ii={type:"object",properties:{tiles:{type:"array",items:Ar},tileHeight:{type:"number",description:"Height of each tile in pixels."},gridSize:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"}},description:"Number of columns and rows in the grid.",required:["cols","rows"],additionalProperties:!1},global_filters:ke([...new Set([...ne,...re,...ae])])},required:["tiles"],additionalProperties:!1},si=Object.freeze(Object.defineProperty({__proto__:null,aiQuerySchema:kr,barChartSchema:Or,basicQuerySchema:Ir,dashboardConfigSchema:ii,dashboardTileTypes:ri,donutChartSchema:xr,exploreV4QuerySchema:Nr,gaugeChartSchema:vr,metricCardSchema:Pr,singleValueSchema:Cr,slottableSchema:Sr,tileConfigSchema:Ar,tileDefinitionSchema:Rr,tileLayoutSchema:Yr,timeseriesChartSchema:Mr,topNTableSchema:Er,validDashboardQuery:qr},Symbol.toStringTag,{value:"Module"})),oi=["horizontal_bar","vertical_bar","gauge","donut","timeseries_line","timeseries_bar","golden_signals","top_n","slottable","single_value"],me={type:"string"},V={type:"string"},Hr={type:"boolean"},jr={type:["object","array"],items:{type:"string"},additionalProperties:{type:"string"}},Fr={type:"object",properties:{type:{type:"string",enum:["slottable"]},id:{type:"string"}},required:["type","id"],additionalProperties:!1},Gr={type:"object",properties:{type:{type:"string",enum:["horizontal_bar","vertical_bar"]},stacked:{type:"boolean"},chart_dataset_colors:jr,synthetics_data_key:me,chart_title:V,allow_csv_export:Hr},required:["type"],additionalProperties:!1},Wr={type:"object",properties:{type:{type:"string",enum:["timeseries_line","timeseries_bar"]},stacked:{type:"boolean"},threshold:{type:"object",additionalProperties:{type:"number"}},chart_dataset_colors:jr,synthetics_data_key:me,chart_title:V,allow_csv_export:Hr},required:["type"],additionalProperties:!1},Lr={type:"object",properties:{type:{type:"string",enum:["gauge"]},metric_display:{type:"string",enum:["hidden","single","full"]},reverse_dataset:{type:"boolean"},numerator:{type:"number"},synthetics_data_key:me,chart_title:V},required:["type"],additionalProperties:!1},Ur={type:"object",properties:{type:{type:"string",enum:["donut"]},synthetics_data_key:me,chart_title:V},required:["type"],additionalProperties:!1},zr={type:"object",properties:{chart_title:V,synthetics_data_key:me,type:{type:"string",enum:["top_n"]},description:{type:"string"},entity_link:{type:"string"}},required:["type"],additionalProperties:!1},$r={type:"object",properties:{chart_title:V,type:{type:"string",enum:["golden_signals"]},long_card_titles:{type:"boolean"},description:{type:"string"},percentile_latency:{type:"boolean"}},required:["type"],additionalProperties:!1},Vr={type:"object",properties:{type:{type:"string",enum:["single_value"]},decimal_points:{type:"number"},chart_title:V},required:["type"],additionalProperties:!1},ui={type:"object",properties:{tz:{type:"string",default:"Etc/UTC"},type:{type:"string",enum:["relative"]},time_range:{type:"string",enum:at,default:"1h"}},required:["type","time_range"],additionalProperties:!1},ci={type:"object",description:"A duration representing an exact start and end time.",properties:{tz:{type:"string"},type:{type:"string",enum:["absolute"]},start:{type:"string"},end:{type:"string"}},required:["type","start","end"],additionalProperties:!1},lt={granularity:{type:"string",description:'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',enum:Pe},time_range:{type:"object",description:"The time range to query.",anyOf:[ui,ci],default:{type:"relative",time_range:"1h"}},limit:{type:"number"},meta:{type:"object"}},dt=e=>({type:"array",description:"List of aggregated metrics to collect across the requested time span.",items:{type:"string",enum:e}}),ft=e=>({type:"array",description:"List of attributes or entity types to group by.",minItems:0,maxItems:2,items:{type:"string",enum:e}}),qe=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:rt},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:nt}},required:["field","operator"],additionalProperties:!1}]}}),Qr={type:"object",description:"A query to launch at the advanced explore API",properties:{datasource:{type:"string",enum:["api_usage"]},metrics:dt(it),dimensions:ft(Ne),filters:qe(ne),...lt},required:["datasource"],additionalProperties:!1},Xr={type:"object",description:"A query to launch at the basic explore API",properties:{datasource:{type:"string",enum:["basic"]},metrics:dt(Ce),dimensions:ft(de),filters:qe(re),...lt},required:["datasource"],additionalProperties:!1},Zr={type:"object",description:"A query to launch at the AI explore API",properties:{datasource:{type:"string",enum:["llm_usage"]},metrics:dt(st),dimensions:ft(Ie),filters:qe(ae),...lt},required:["datasource"],additionalProperties:!1},Br={anyOf:[Qr,Xr,Zr]},Kr={type:"object",properties:{query:Br,chart:{anyOf:[Gr,Lr,Ur,Wr,$r,zr,Fr,Vr]}},required:["query","chart"],additionalProperties:!1},Jr={type:"object",properties:{position:{type:"object",properties:{col:{type:"number"},row:{type:"number"}},description:"Position of the tile in the grid.",required:["col","row"],additionalProperties:!1},size:{type:"object",properties:{cols:{type:"number"},rows:{type:"number"},fit_to_content:{type:"boolean"}},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.",required:["cols","rows"],additionalProperties:!1}},required:["position","size"],additionalProperties:!1},en={type:"object",properties:{type:{type:"string",enum:["chart"]},definition:Kr,layout:Jr,id:{type:"string",description:"Unique identifier for the tile. If not provided, one will be generated."}},required:["type","definition","layout"],additionalProperties:!1},li={type:"object",properties:{tiles:{type:"array",items:en},tile_height:{type:"number",description:"Height of each tile in pixels."},preset_filters:qe([...new Set([...ne,...re,...ae])])},required:["tiles"],additionalProperties:!1},tn=6048e5,di=864e5,fi=60,mi=3600,Bt=Symbol.for("constructDateFrom");function I(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Bt in e?e[Bt](t):e instanceof Date?new e.constructor(t):new Date(t)}function S(e,t){return I(t||e,e)}function Kt(e,t,r){const n=S(e,r==null?void 0:r.in);return isNaN(t)?I(e,NaN):(n.setDate(n.getDate()+t),n)}function hi(e,t,r){const n=S(e,r==null?void 0:r.in);if(isNaN(t))return I(e,NaN);const i=n.getDate(),o=I(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const c=o.getDate();return i>=c?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}let yi={};function he(){return yi}function A(e,t){var d,m,f,_;const r=he(),n=(t==null?void 0:t.weekStartsOn)??((m=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:m.weekStartsOn)??r.weekStartsOn??((_=(f=r.locale)==null?void 0:f.options)==null?void 0:_.weekStartsOn)??0,i=S(e,t==null?void 0:t.in),o=i.getDay(),c=(o<n?7:0)+o-n;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function Oe(e,t){return A(e,{...t,weekStartsOn:1})}function rn(e,t){const r=S(e,t==null?void 0:t.in),n=r.getFullYear(),i=I(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const o=Oe(i),c=I(r,0);c.setFullYear(n,0,4),c.setHours(0,0,0,0);const d=Oe(c);return r.getTime()>=o.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function Jt(e){const t=S(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function pi(e,...t){const r=I.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function Me(e,t){const r=S(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function gi(e,t,r){const[n,i]=pi(r==null?void 0:r.in,e,t),o=Me(n),c=Me(i),d=+o-Jt(o),m=+c-Jt(c);return Math.round((d-m)/di)}function _i(e,t){const r=rn(e,t),n=I(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Oe(n)}function wi(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function bi(e){return!(!wi(e)&&typeof e!="number"||isNaN(+S(e)))}function ee(e,t){const r=S(e,t==null?void 0:t.in);return r.setDate(1),r.setHours(0,0,0,0),r}function Ti(e,t){const r=S(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const Di={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Si=(e,t,r)=>{let n;const i=Di[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Qe(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Oi={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Mi={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},vi={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xi={date:Qe({formats:Oi,defaultWidth:"full"}),time:Qe({formats:Mi,defaultWidth:"full"}),dateTime:Qe({formats:vi,defaultWidth:"full"})},Ei={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Pi=(e,t,r,n)=>Ei[e];function oe(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=r!=null&&r.width?String(r.width):c;i=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[d]||e.values[c]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const Ci={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ni={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ii={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ki={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},qi={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ri={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Yi=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Ai={ordinalNumber:Yi,era:oe({values:Ci,defaultWidth:"wide"}),quarter:oe({values:Ni,defaultWidth:"wide",argumentCallback:e=>e-1}),month:oe({values:Ii,defaultWidth:"wide"}),day:oe({values:ki,defaultWidth:"wide"}),dayPeriod:oe({values:qi,defaultWidth:"wide",formattingValues:Ri,defaultFormattingWidth:"wide"})};function ue(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const c=o[0],d=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(d)?ji(d,y=>y.test(c)):Hi(d,y=>y.test(c));let f;f=e.valueCallback?e.valueCallback(m):m,f=r.valueCallback?r.valueCallback(f):f;const _=t.slice(c.length);return{value:f,rest:_}}}function Hi(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function ji(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Fi(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],o=t.match(e.parsePattern);if(!o)return null;let c=e.valueCallback?e.valueCallback(o[0]):o[0];c=r.valueCallback?r.valueCallback(c):c;const d=t.slice(i.length);return{value:c,rest:d}}}const Gi=/^(\d+)(th|st|nd|rd)?/i,Wi=/\d+/i,Li={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ui={any:[/^b/i,/^(a|c)/i]},zi={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$i={any:[/1/i,/2/i,/3/i,/4/i]},Vi={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Qi={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Xi={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Zi={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Bi={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Ki={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ji={ordinalNumber:Fi({matchPattern:Gi,parsePattern:Wi,valueCallback:e=>parseInt(e,10)}),era:ue({matchPatterns:Li,defaultMatchWidth:"wide",parsePatterns:Ui,defaultParseWidth:"any"}),quarter:ue({matchPatterns:zi,defaultMatchWidth:"wide",parsePatterns:$i,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ue({matchPatterns:Vi,defaultMatchWidth:"wide",parsePatterns:Qi,defaultParseWidth:"any"}),day:ue({matchPatterns:Xi,defaultMatchWidth:"wide",parsePatterns:Zi,defaultParseWidth:"any"}),dayPeriod:ue({matchPatterns:Bi,defaultMatchWidth:"any",parsePatterns:Ki,defaultParseWidth:"any"})},es={code:"en-US",formatDistance:Si,formatLong:xi,formatRelative:Pi,localize:Ai,match:Ji,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ts(e,t){const r=S(e,t==null?void 0:t.in);return gi(r,Ti(r))+1}function rs(e,t){const r=S(e,t==null?void 0:t.in),n=+Oe(r)-+_i(r);return Math.round(n/tn)+1}function nn(e,t){var _,y,p,E;const r=S(e,t==null?void 0:t.in),n=r.getFullYear(),i=he(),o=(t==null?void 0:t.firstWeekContainsDate)??((y=(_=t==null?void 0:t.locale)==null?void 0:_.options)==null?void 0:y.firstWeekContainsDate)??i.firstWeekContainsDate??((E=(p=i.locale)==null?void 0:p.options)==null?void 0:E.firstWeekContainsDate)??1,c=I((t==null?void 0:t.in)||e,0);c.setFullYear(n+1,0,o),c.setHours(0,0,0,0);const d=A(c,t),m=I((t==null?void 0:t.in)||e,0);m.setFullYear(n,0,o),m.setHours(0,0,0,0);const f=A(m,t);return+r>=+d?n+1:+r>=+f?n:n-1}function ns(e,t){var d,m,f,_;const r=he(),n=(t==null?void 0:t.firstWeekContainsDate)??((m=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??r.firstWeekContainsDate??((_=(f=r.locale)==null?void 0:f.options)==null?void 0:_.firstWeekContainsDate)??1,i=nn(e,t),o=I((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,n),o.setHours(0,0,0,0),A(o,t)}function as(e,t){const r=S(e,t==null?void 0:t.in),n=+A(r,t)-+ns(r,t);return Math.round(n/tn)+1}function g(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const j={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return g(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):g(r+1,2)},d(e,t){return g(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return g(e.getHours()%12||12,t.length)},H(e,t){return g(e.getHours(),t.length)},m(e,t){return g(e.getMinutes(),t.length)},s(e,t){return g(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return g(i,t.length)}},K={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},er={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return j.y(e,t)},Y:function(e,t,r,n){const i=nn(e,n),o=i>0?i:1-i;if(t==="YY"){const c=o%100;return g(c,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):g(o,t.length)},R:function(e,t){const r=rn(e);return g(r,t.length)},u:function(e,t){const r=e.getFullYear();return g(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return g(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return g(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return j.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return g(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=as(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):g(i,t.length)},I:function(e,t,r){const n=rs(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):g(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):j.d(e,t)},D:function(e,t,r){const n=ts(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):g(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return g(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return g(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return g(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=K.noon:n===0?i=K.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=K.evening:n>=12?i=K.afternoon:n>=4?i=K.morning:i=K.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return j.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):j.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):g(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):g(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):j.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):j.s(e,t)},S:function(e,t){return j.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return rr(n);case"XXXX":case"XX":return z(n);case"XXXXX":case"XXX":default:return z(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return rr(n);case"xxxx":case"xx":return z(n);case"xxxxx":case"xxx":default:return z(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+tr(n,":");case"OOOO":default:return"GMT"+z(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+tr(n,":");case"zzzz":default:return"GMT"+z(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return g(n,t.length)},T:function(e,t,r){return g(+e,t.length)}};function tr(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+g(o,2)}function rr(e,t){return e%60===0?(e>0?"-":"+")+g(Math.abs(e)/60,2):z(e,t)}function z(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=g(Math.trunc(n/60),2),o=g(n%60,2);return r+i+t+o}const nr=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},an=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},is=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return nr(e,t);let o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",nr(n,t)).replace("{{time}}",an(i,t))},ss={p:an,P:is},os=/^D+$/,us=/^Y+$/,cs=["D","DD","YY","YYYY"];function ls(e){return os.test(e)}function ds(e){return us.test(e)}function fs(e,t,r){const n=ms(e,t,r);if(console.warn(n),cs.includes(e))throw new RangeError(n)}function ms(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const hs=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ys=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ps=/^'([^]*?)'?$/,gs=/''/g,_s=/[a-zA-Z]/;function sn(e,t,r){var _,y,p,E,C,N,k,F;const n=he(),i=(r==null?void 0:r.locale)??n.locale??es,o=(r==null?void 0:r.firstWeekContainsDate)??((y=(_=r==null?void 0:r.locale)==null?void 0:_.options)==null?void 0:y.firstWeekContainsDate)??n.firstWeekContainsDate??((E=(p=n.locale)==null?void 0:p.options)==null?void 0:E.firstWeekContainsDate)??1,c=(r==null?void 0:r.weekStartsOn)??((N=(C=r==null?void 0:r.locale)==null?void 0:C.options)==null?void 0:N.weekStartsOn)??n.weekStartsOn??((F=(k=n.locale)==null?void 0:k.options)==null?void 0:F.weekStartsOn)??0,d=S(e,r==null?void 0:r.in);if(!bi(d))throw new RangeError("Invalid time value");let m=t.match(ys).map(O=>{const T=O[0];if(T==="p"||T==="P"){const G=ss[T];return G(O,i.formatLong)}return O}).join("").match(hs).map(O=>{if(O==="''")return{isToken:!1,value:"'"};const T=O[0];if(T==="'")return{isToken:!1,value:ws(O)};if(er[T])return{isToken:!0,value:O};if(T.match(_s))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return{isToken:!1,value:O}});i.localize.preprocessor&&(m=i.localize.preprocessor(d,m));const f={firstWeekContainsDate:o,weekStartsOn:c,locale:i};return m.map(O=>{if(!O.isToken)return O.value;const T=O.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&ds(T)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&ls(T))&&fs(T,t,String(e));const G=er[T[0]];return G(d,T,i.localize,f)}).join("")}function ws(e){const t=e.match(ps);return t?t[1].replace(gs,"'"):e}function bs(e,t){const r=S(e,t==null?void 0:t.in),n=r.getFullYear(),i=r.getMonth(),o=I(r,0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function Ts(){return Object.assign({},he())}function ar(e){return+S(e)}function ir(e){return Math.trunc(+S(e)/1e3)}function Ds(e){return Math.trunc(e*mi)}function Ss(e){const t=e/fi;return Math.trunc(t)}function on(e,t,r){return hi(e,-1,r)}function sr(e,t,r){const n=Ts(),i=vs(e,r.timeZone,r.locale??n.locale);return"formatToParts"in i?Os(i,t):Ms(i,t)}function Os(e,t){const r=e.formatToParts(t);for(let n=r.length-1;n>=0;--n)if(r[n].type==="timeZoneName")return r[n].value}function Ms(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/ [\w-+ ]+$/.exec(r);return n?n[0].substr(1):""}function vs(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function xs(e,t){const r=Is(t);return"formatToParts"in r?Ps(r,e):Cs(r,e)}const Es={year:0,month:1,day:2,hour:3,minute:4,second:5};function Ps(e,t){try{const r=e.formatToParts(t),n=[];for(let i=0;i<r.length;i++){const o=Es[r[i].type];o!==void 0&&(n[o]=parseInt(r[i].value,10))}return n}catch(r){if(r instanceof RangeError)return[NaN];throw r}}function Cs(e,t){const r=e.format(t),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[parseInt(n[3],10),parseInt(n[1],10),parseInt(n[2],10),parseInt(n[4],10),parseInt(n[5],10),parseInt(n[6],10)]}const Xe={},or=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),Ns=or==="06/25/2014, 00:00:00"||or==="06/25/2014 00:00:00";function Is(e){return Xe[e]||(Xe[e]=Ns?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Xe[e]}function mt(e,t,r,n,i,o,c){const d=new Date(0);return d.setUTCFullYear(e,t,r),d.setUTCHours(n,i,o,c),d}const ur=36e5,ks=6e4,Ze={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ye(e,t,r){if(!e)return 0;let n=Ze.timezoneZ.exec(e);if(n)return 0;let i,o;if(n=Ze.timezoneHH.exec(e),n)return i=parseInt(n[1],10),cr(i)?-(i*ur):NaN;if(n=Ze.timezoneHHMM.exec(e),n){i=parseInt(n[2],10);const c=parseInt(n[3],10);return cr(i,c)?(o=Math.abs(i)*ur+c*ks,n[1]==="+"?-o:o):NaN}if(Ys(e)){t=new Date(t||Date.now());const c=r?t:qs(t),d=et(c,e);return-(r?d:Rs(t,d,e))}return NaN}function qs(e){return mt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function et(e,t){const r=xs(e,t),n=mt(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime();let i=e.getTime();const o=i%1e3;return i-=o>=0?o:1e3+o,n-i}function Rs(e,t,r){let i=e.getTime()-t;const o=et(new Date(i),r);if(t===o)return t;i-=o-t;const c=et(new Date(i),r);return o===c?o:Math.max(o,c)}function cr(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const lr={};function Ys(e){if(lr[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),lr[e]=!0,!0}catch{return!1}}const As=60*1e3,Hs={X:function(e,t,r){const n=Be(r.timeZone,e);if(n===0)return"Z";switch(t){case"X":return dr(n);case"XXXX":case"XX":return J(n);case"XXXXX":case"XXX":default:return J(n,":")}},x:function(e,t,r){const n=Be(r.timeZone,e);switch(t){case"x":return dr(n);case"xxxx":case"xx":return J(n);case"xxxxx":case"xxx":default:return J(n,":")}},O:function(e,t,r){const n=Be(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+js(n,":");case"OOOO":default:return"GMT"+J(n,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return sr("short",e,r);case"zzzz":default:return sr("long",e,r)}}};function Be(e,t){const r=e?ye(e,t,!0)/As:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function ve(e,t){const r=e<0?"-":"";let n=Math.abs(e).toString();for(;n.length<t;)n="0"+n;return r+n}function J(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=ve(Math.floor(n/60),2),o=ve(Math.floor(n%60),2);return r+i+t+o}function dr(e,t){return e%60===0?(e>0?"-":"+")+ve(Math.abs(e)/60,2):J(e,t)}function js(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;return o===0?r+String(i):r+String(i)+t+ve(o,2)}function fr(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const un=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Ke=36e5,mr=6e4,Fs=2,M={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:un};function xe(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const r=t.additionalDigits==null?Fs:Number(t.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const n=Gs(e),{year:i,restDateString:o}=Ws(n.date,r),c=Ls(o,i);if(c===null||isNaN(c.getTime()))return new Date(NaN);if(c){const d=c.getTime();let m=0,f;if(n.time&&(m=Us(n.time),m===null||isNaN(m)))return new Date(NaN);if(n.timeZone||t.timeZone){if(f=ye(n.timeZone||t.timeZone,new Date(d+m)),isNaN(f))return new Date(NaN)}else f=fr(new Date(d+m)),f=fr(new Date(d+m+f));return new Date(d+m+f)}else return new Date(NaN)}function Gs(e){const t={};let r=M.dateTimePattern.exec(e),n;if(r?(t.date=r[1],n=r[3]):(r=M.datePattern.exec(e),r?(t.date=r[1],n=r[2]):(t.date=null,n=e)),n){const i=M.timeZone.exec(n);i?(t.time=n.replace(i[1],""),t.timeZone=i[1].trim()):t.time=n}return t}function Ws(e,t){if(e){const r=M.YYY[t],n=M.YYYYY[t];let i=M.YYYY.exec(e)||n.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=M.YY.exec(e)||r.exec(e),i){const o=i[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function Ls(e,t){if(t===null)return null;let r,n,i;if(!e||!e.length)return r=new Date(0),r.setUTCFullYear(t),r;let o=M.MM.exec(e);if(o)return r=new Date(0),n=parseInt(o[1],10)-1,yr(t,n)?(r.setUTCFullYear(t,n),r):new Date(NaN);if(o=M.DDD.exec(e),o){r=new Date(0);const c=parseInt(o[1],10);return Vs(t,c)?(r.setUTCFullYear(t,0,c),r):new Date(NaN)}if(o=M.MMDD.exec(e),o){r=new Date(0),n=parseInt(o[1],10)-1;const c=parseInt(o[2],10);return yr(t,n,c)?(r.setUTCFullYear(t,n,c),r):new Date(NaN)}if(o=M.Www.exec(e),o)return i=parseInt(o[1],10)-1,pr(i)?hr(t,i):new Date(NaN);if(o=M.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const c=parseInt(o[2],10)-1;return pr(i,c)?hr(t,i,c):new Date(NaN)}return null}function Us(e){let t,r,n=M.HH.exec(e);if(n)return t=parseFloat(n[1].replace(",",".")),Je(t)?t%24*Ke:NaN;if(n=M.HHMM.exec(e),n)return t=parseInt(n[1],10),r=parseFloat(n[2].replace(",",".")),Je(t,r)?t%24*Ke+r*mr:NaN;if(n=M.HHMMSS.exec(e),n){t=parseInt(n[1],10),r=parseInt(n[2],10);const i=parseFloat(n[3].replace(",","."));return Je(t,r,i)?t%24*Ke+r*mr+i*1e3:NaN}return null}function hr(e,t,r){t=t||0,r=r||0;const n=new Date(0);n.setUTCFullYear(e,0,4);const i=n.getUTCDay()||7,o=t*7+r+1-i;return n.setUTCDate(n.getUTCDate()+o),n}const zs=[31,28,31,30,31,30,31,31,30,31,30,31],$s=[31,29,31,30,31,30,31,31,30,31,30,31];function cn(e){return e%400===0||e%4===0&&e%100!==0}function yr(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const n=cn(e);if(n&&r>$s[t]||!n&&r>zs[t])return!1}return!0}function Vs(e,t){if(t<1)return!1;const r=cn(e);return!(r&&t>366||!r&&t>365)}function pr(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Je(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const Qs=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Xs(e,t,r={}){t=String(t);const n=t.match(Qs);if(n){const i=xe(r.originalDate||e,r);t=n.reduce(function(o,c){if(c[0]==="'")return o;const d=o.indexOf(c),m=o[d-1]==="'",f=o.replace(c,"'"+Hs[c[0]](i,c,r)+"'");return m?f.substring(0,d-1)+f.substring(d+1):f},t)}return sn(e,t,r)}function ln(e,t,r){e=xe(e,r);const n=ye(t,e,!0),i=new Date(e.getTime()-n),o=new Date(0);return o.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),o.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),o}function Zs(e,t,r,n){return n={...n,timeZone:t,originalDate:e},Xs(ln(e,t,{timeZone:n.timeZone}),r,n)}function Bs(e,t,r){if(typeof e=="string"&&!e.match(un))return xe(e,{...r,timeZone:t});e=xe(e,r);const n=mt(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),i=ye(t,new Date(n));return new Date(n+i)}function dn(e,t){return-ye(e,t)}function Ks(e){return sn(e,"yyyy-MM-dd'T'HH:mm:ss.SSSXXX")}function tt(e,t={}){if(!e)return e;const r=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let n="MMM dd, yyy hh:mm a";t.short&&(n="MMM dd, yyy"),t.includeTZ&&(n+=" (z)");const i=new Date(e);return Zs(i,r,n)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}function Js(e,t){return`${tt(e.getTime())} - ${tt(t.getTime(),{includeTZ:!0})}`}const ce={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function eo(e,t){return e.map(r=>({value:r,label:t.t(`configuration.vitals.reports.granularity.${r}`)}))}function fn(e,t){return{duration:e,type:"duration",origin:t}}function to(e){return e&&Pe.find(r=>e<=ce[r])||null}function mn(e,t,r,n){const i=ce[r];let o=0;return i>=ce.daily&&(n?o=-dn(n,t):o=t.getTimezoneOffset()*60*1e3),new Date(e((t.getTime()-o)/i)*i+o)}function hn(e,t,r){return mn(Math.floor,e,t,r)}function ht(e,t,r){return mn(Math.ceil,e,t,r)}class Re{constructor(t,r,n){b(this,"timeframe");b(this,"tz");b(this,"dataGranularity");if(this.constructor===Re)throw new Error("BaseQueryTime is not meant to be used directly.");this.timeframe=t,this.tz=r,this.dataGranularity=n??t.dataGranularity}calculateStartDate(t,r,n=1){if(t)return new Date(this.endDate().getTime()-this.timeframe.timeframeLengthMs()*n);{const i=this.endDate(),o=this.timeframe.rawStart(this.tz),c=hn(o,r,this.tz),m=(i.getTime()-c.getTime())*(n-1);return new Date(c.getTime()-m)}}granularitySeconds(){return Math.floor(this.granularityMs()/1e3)}granularityDruid(){return fn(this.granularityMs(),this.startDate().toISOString())}startSeconds(){return ir(this.startDate())}endSeconds(){return ir(this.endDate())}startMs(){return ar(this.startDate())}endMs(){return ar(this.endDate())}}class ro extends Re{constructor(r,n,i,o,c){super(r,i,o);b(this,"granularity");n&&r.allowedGranularities(c).has(n)?this.granularity=n:c?this.granularity=r.fineGrainedDefaultGranularity??r.defaultResponseGranularity:this.granularity=r.defaultResponseGranularity}startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.granularity)}endDate(){return ht(this.timeframe.rawEnd(),this.granularity,this.tz)}granularityMs(){return ce[this.granularity]}}class yn extends Re{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity)}endDate(){return ht(this.timeframe.rawEnd(this.tz),this.dataGranularity,this.tz)}granularityMs(){return this.endDate().getTime()-this.startDate().getTime()}}class no extends yn{startDate(){return this.calculateStartDate(this.timeframe.isRelative,this.dataGranularity,2)}granularityMs(){return this.endDate().getTime()-super.startDate().getTime()}}var Se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ao(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ee={exports:{}};Ee.exports;(function(e,t){var r=200,n="__lodash_hash_undefined__",i=9007199254740991,o="[object Arguments]",c="[object Array]",d="[object Boolean]",m="[object Date]",f="[object Error]",_="[object Function]",y="[object GeneratorFunction]",p="[object Map]",E="[object Number]",C="[object Object]",N="[object Promise]",k="[object RegExp]",F="[object Set]",O="[object String]",T="[object Symbol]",G="[object WeakMap]",pt="[object ArrayBuffer]",pe="[object DataView]",gt="[object Float32Array]",_t="[object Float64Array]",wt="[object Int8Array]",bt="[object Int16Array]",Tt="[object Int32Array]",Dt="[object Uint8Array]",St="[object Uint8ClampedArray]",Ot="[object Uint16Array]",Mt="[object Uint32Array]",_n=/[\\^$.*+?()[\]{}|]/g,wn=/\w*$/,bn=/^\[object .+?Constructor\]$/,Tn=/^(?:0|[1-9]\d*)$/,w={};w[o]=w[c]=w[pt]=w[pe]=w[d]=w[m]=w[gt]=w[_t]=w[wt]=w[bt]=w[Tt]=w[p]=w[E]=w[C]=w[k]=w[F]=w[O]=w[T]=w[Dt]=w[St]=w[Ot]=w[Mt]=!0,w[f]=w[_]=w[G]=!1;var Dn=typeof Se=="object"&&Se&&Se.Object===Object&&Se,Sn=typeof self=="object"&&self&&self.Object===Object&&self,q=Dn||Sn||Function("return this")(),vt=t&&!t.nodeType&&t,xt=vt&&!0&&e&&!e.nodeType&&e,On=xt&&xt.exports===vt;function Mn(a,s){return a.set(s[0],s[1]),a}function vn(a,s){return a.add(s),a}function xn(a,s){for(var u=-1,l=a?a.length:0;++u<l&&s(a[u],u,a)!==!1;);return a}function En(a,s){for(var u=-1,l=s.length,D=a.length;++u<l;)a[D+u]=s[u];return a}function Et(a,s,u,l){for(var D=-1,v=a?a.length:0;++D<v;)u=s(u,a[D],D,a);return u}function Pn(a,s){for(var u=-1,l=Array(a);++u<a;)l[u]=s(u);return l}function Cn(a,s){return a==null?void 0:a[s]}function Pt(a){var s=!1;if(a!=null&&typeof a.toString!="function")try{s=!!(a+"")}catch{}return s}function Ct(a){var s=-1,u=Array(a.size);return a.forEach(function(l,D){u[++s]=[D,l]}),u}function Ae(a,s){return function(u){return a(s(u))}}function Nt(a){var s=-1,u=Array(a.size);return a.forEach(function(l){u[++s]=l}),u}var Nn=Array.prototype,In=Function.prototype,ge=Object.prototype,He=q["__core-js_shared__"],It=function(){var a=/[^.]+$/.exec(He&&He.keys&&He.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),kt=In.toString,H=ge.hasOwnProperty,_e=ge.toString,kn=RegExp("^"+kt.call(H).replace(_n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=On?q.Buffer:void 0,Rt=q.Symbol,Yt=q.Uint8Array,qn=Ae(Object.getPrototypeOf,Object),Rn=Object.create,Yn=ge.propertyIsEnumerable,An=Nn.splice,At=Object.getOwnPropertySymbols,Hn=qt?qt.isBuffer:void 0,jn=Ae(Object.keys,Object),je=Z(q,"DataView"),ie=Z(q,"Map"),Fe=Z(q,"Promise"),Ge=Z(q,"Set"),We=Z(q,"WeakMap"),se=Z(Object,"create"),Fn=U(je),Gn=U(ie),Wn=U(Fe),Ln=U(Ge),Un=U(We),Ht=Rt?Rt.prototype:void 0,jt=Ht?Ht.valueOf:void 0;function W(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function zn(){this.__data__=se?se(null):{}}function $n(a){return this.has(a)&&delete this.__data__[a]}function Vn(a){var s=this.__data__;if(se){var u=s[a];return u===n?void 0:u}return H.call(s,a)?s[a]:void 0}function Qn(a){var s=this.__data__;return se?s[a]!==void 0:H.call(s,a)}function Xn(a,s){var u=this.__data__;return u[a]=se&&s===void 0?n:s,this}W.prototype.clear=zn,W.prototype.delete=$n,W.prototype.get=Vn,W.prototype.has=Qn,W.prototype.set=Xn;function R(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function Zn(){this.__data__=[]}function Bn(a){var s=this.__data__,u=we(s,a);if(u<0)return!1;var l=s.length-1;return u==l?s.pop():An.call(s,u,1),!0}function Kn(a){var s=this.__data__,u=we(s,a);return u<0?void 0:s[u][1]}function Jn(a){return we(this.__data__,a)>-1}function ea(a,s){var u=this.__data__,l=we(u,a);return l<0?u.push([a,s]):u[l][1]=s,this}R.prototype.clear=Zn,R.prototype.delete=Bn,R.prototype.get=Kn,R.prototype.has=Jn,R.prototype.set=ea;function Q(a){var s=-1,u=a?a.length:0;for(this.clear();++s<u;){var l=a[s];this.set(l[0],l[1])}}function ta(){this.__data__={hash:new W,map:new(ie||R),string:new W}}function ra(a){return be(this,a).delete(a)}function na(a){return be(this,a).get(a)}function aa(a){return be(this,a).has(a)}function ia(a,s){return be(this,a).set(a,s),this}Q.prototype.clear=ta,Q.prototype.delete=ra,Q.prototype.get=na,Q.prototype.has=aa,Q.prototype.set=ia;function X(a){this.__data__=new R(a)}function sa(){this.__data__=new R}function oa(a){return this.__data__.delete(a)}function ua(a){return this.__data__.get(a)}function ca(a){return this.__data__.has(a)}function la(a,s){var u=this.__data__;if(u instanceof R){var l=u.__data__;if(!ie||l.length<r-1)return l.push([a,s]),this;u=this.__data__=new Q(l)}return u.set(a,s),this}X.prototype.clear=sa,X.prototype.delete=oa,X.prototype.get=ua,X.prototype.has=ca,X.prototype.set=la;function da(a,s){var u=ze(a)||Ra(a)?Pn(a.length,String):[],l=u.length,D=!!l;for(var v in a)H.call(a,v)&&!(D&&(v=="length"||Na(v,l)))&&u.push(v);return u}function Ft(a,s,u){var l=a[s];(!(H.call(a,s)&&Ut(l,u))||u===void 0&&!(s in a))&&(a[s]=u)}function we(a,s){for(var u=a.length;u--;)if(Ut(a[u][0],s))return u;return-1}function fa(a,s){return a&&Gt(s,$e(s),a)}function Le(a,s,u,l,D,v,Y){var x;if(l&&(x=v?l(a,D,v,Y):l(a)),x!==void 0)return x;if(!Te(a))return a;var Vt=ze(a);if(Vt){if(x=Ea(a),!s)return Ma(a,x)}else{var B=L(a),Qt=B==_||B==y;if(Aa(a))return _a(a,s);if(B==C||B==o||Qt&&!v){if(Pt(a))return v?a:{};if(x=Pa(Qt?{}:a),!s)return va(a,fa(x,a))}else{if(!w[B])return v?a:{};x=Ca(a,B,Le,s)}}Y||(Y=new X);var Xt=Y.get(a);if(Xt)return Xt;if(Y.set(a,x),!Vt)var Zt=u?xa(a):$e(a);return xn(Zt||a,function(Ve,De){Zt&&(De=Ve,Ve=a[De]),Ft(x,De,Le(Ve,s,u,l,De,a,Y))}),x}function ma(a){return Te(a)?Rn(a):{}}function ha(a,s,u){var l=s(a);return ze(a)?l:En(l,u(a))}function ya(a){return _e.call(a)}function pa(a){if(!Te(a)||ka(a))return!1;var s=$t(a)||Pt(a)?kn:bn;return s.test(U(a))}function ga(a){if(!Lt(a))return jn(a);var s=[];for(var u in Object(a))H.call(a,u)&&u!="constructor"&&s.push(u);return s}function _a(a,s){if(s)return a.slice();var u=new a.constructor(a.length);return a.copy(u),u}function Ue(a){var s=new a.constructor(a.byteLength);return new Yt(s).set(new Yt(a)),s}function wa(a,s){var u=s?Ue(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.byteLength)}function ba(a,s,u){var l=s?u(Ct(a),!0):Ct(a);return Et(l,Mn,new a.constructor)}function Ta(a){var s=new a.constructor(a.source,wn.exec(a));return s.lastIndex=a.lastIndex,s}function Da(a,s,u){var l=s?u(Nt(a),!0):Nt(a);return Et(l,vn,new a.constructor)}function Sa(a){return jt?Object(jt.call(a)):{}}function Oa(a,s){var u=s?Ue(a.buffer):a.buffer;return new a.constructor(u,a.byteOffset,a.length)}function Ma(a,s){var u=-1,l=a.length;for(s||(s=Array(l));++u<l;)s[u]=a[u];return s}function Gt(a,s,u,l){u||(u={});for(var D=-1,v=s.length;++D<v;){var Y=s[D],x=void 0;Ft(u,Y,x===void 0?a[Y]:x)}return u}function va(a,s){return Gt(a,Wt(a),s)}function xa(a){return ha(a,$e,Wt)}function be(a,s){var u=a.__data__;return Ia(s)?u[typeof s=="string"?"string":"hash"]:u.map}function Z(a,s){var u=Cn(a,s);return pa(u)?u:void 0}var Wt=At?Ae(At,Object):Fa,L=ya;(je&&L(new je(new ArrayBuffer(1)))!=pe||ie&&L(new ie)!=p||Fe&&L(Fe.resolve())!=N||Ge&&L(new Ge)!=F||We&&L(new We)!=G)&&(L=function(a){var s=_e.call(a),u=s==C?a.constructor:void 0,l=u?U(u):void 0;if(l)switch(l){case Fn:return pe;case Gn:return p;case Wn:return N;case Ln:return F;case Un:return G}return s});function Ea(a){var s=a.length,u=a.constructor(s);return s&&typeof a[0]=="string"&&H.call(a,"index")&&(u.index=a.index,u.input=a.input),u}function Pa(a){return typeof a.constructor=="function"&&!Lt(a)?ma(qn(a)):{}}function Ca(a,s,u,l){var D=a.constructor;switch(s){case pt:return Ue(a);case d:case m:return new D(+a);case pe:return wa(a,l);case gt:case _t:case wt:case bt:case Tt:case Dt:case St:case Ot:case Mt:return Oa(a,l);case p:return ba(a,l,u);case E:case O:return new D(a);case k:return Ta(a);case F:return Da(a,l,u);case T:return Sa(a)}}function Na(a,s){return s=s??i,!!s&&(typeof a=="number"||Tn.test(a))&&a>-1&&a%1==0&&a<s}function Ia(a){var s=typeof a;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?a!=="__proto__":a===null}function ka(a){return!!It&&It in a}function Lt(a){var s=a&&a.constructor,u=typeof s=="function"&&s.prototype||ge;return a===u}function U(a){if(a!=null){try{return kt.call(a)}catch{}try{return a+""}catch{}}return""}function qa(a){return Le(a,!0,!0)}function Ut(a,s){return a===s||a!==a&&s!==s}function Ra(a){return Ya(a)&&H.call(a,"callee")&&(!Yn.call(a,"callee")||_e.call(a)==o)}var ze=Array.isArray;function zt(a){return a!=null&&Ha(a.length)&&!$t(a)}function Ya(a){return ja(a)&&zt(a)}var Aa=Hn||Ga;function $t(a){var s=Te(a)?_e.call(a):"";return s==_||s==y}function Ha(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=i}function Te(a){var s=typeof a;return!!a&&(s=="object"||s=="function")}function ja(a){return!!a&&typeof a=="object"}function $e(a){return zt(a)?da(a):ga(a)}function Fa(){return[]}function Ga(){return!1}e.exports=qa})(Ee,Ee.exports);var io=Ee.exports;const so=ao(io),te=(e,t)=>new Date(e.getTime()-dn(t,e));class P{constructor(t){b(this,"timeframeText");b(this,"key");b(this,"display");b(this,"timeframeLength");b(this,"allowedTiers");b(this,"defaultResponseGranularity");b(this,"dataGranularity");b(this,"isRelative");b(this,"fineGrainedDefaultGranularity");b(this,"_startCustom");b(this,"_endCustom");b(this,"_allowedGranularitiesOverride");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}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const r=new Set,n=this.maximumTimeframeLength()/3600;return n<=6&&r.add("minutely"),n>=2&&n<=7*24&&r.add("hourly"),n>=2*24&&r.add("daily"),n>=2*24*14&&r.add("weekly"),r}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const r=Bs(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return ln(r,t)}}class oo extends P{rawStart(t){let r=A(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=te(r,t)),r}maximumTimeframeLength(){return 60*60*24*7}}class uo extends P{rawStart(t){let r=ee(this.tzAdjustedDate(t));return t&&(r=te(r,t)),r}maximumTimeframeLength(){return 60*60*24*31}}class co extends P{rawEnd(t){let r=A(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(r=te(r,t)),r}rawStart(t){const r=this.tzAdjustedDate(t);let n=A(r.setDate(r.getDate()-7),{weekStartsOn:1});return t&&(n=te(n,t)),n}}class lo extends P{rawEnd(t){let r=ee(this.tzAdjustedDate(t));return t&&(r=te(r,t)),r}rawStart(t){let r=ee(on(this.tzAdjustedDate(t)));return t&&(r=te(r,t)),r}}const pn=new Map([[h.FIFTEEN_MIN,new P({key:h.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]})],[h.ONE_HOUR,new P({key:h.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]})],[h.SIX_HOUR,new P({key:h.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.TWELVE_HOUR,new P({key:h.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.ONE_DAY,new P({key:h.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]})],[h.SEVEN_DAY,new P({key:h.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.THIRTY_DAY,new P({key:h.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]})],[h.CURRENT_WEEK,new oo({key:h.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=A(new Date,{weekStartsOn:1});return(Me(Kt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.CURRENT_MONTH,new uo({key:h.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=ee(new Date);return(Me(Kt(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})],[h.PREVIOUS_WEEK,new co({key:h.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]})],[h.PREVIOUS_MONTH,new lo({key:h.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=ee(new Date),r=ee(on(new Date));return t.getTimezoneOffset()!==r.getTimezoneOffset()&&(e=gn(t,r)),60*60*24*bs(new Date().setMonth(new Date().getMonth()-1))+Ds(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]})]]);function fo(e){const t=new Date(e.start),r=new Date(e.end),n=(r.getTime()-t.getTime())/1e3;return e.timePeriodsKey&&so(pn.get(e.timePeriodsKey))||new P({key:"custom",timeframeText:"custom",display:"custom",startCustom:t,endCustom:r,timeframeLength:()=>n,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["free","plus","enterprise"]})}function mo(e){return{...e.key!=="custom"&&{timePeriodsKey:e.key},start:e.rawStart(),end:e.rawEnd()}}function ho(e){return{key:e.key,display:e.display,timeframeText:e.timeframeText,timeframeLength:()=>e.key,start:()=>e.rawStart(),end:()=>e.rawEnd()}}function gn(e,t){return Ss(e.getTimezoneOffset()-t.getTimezoneOffset())}const yo={"15M":h.FIFTEEN_MIN,"1H":h.ONE_HOUR,"6H":h.SIX_HOUR,"12H":h.TWELVE_HOUR,"24H":h.ONE_DAY,"7D":h.SEVEN_DAY,"15m":h.FIFTEEN_MIN,"1h":h.ONE_HOUR,"6h":h.SIX_HOUR,"12h":h.TWELVE_HOUR,"24h":h.ONE_DAY,"7d":h.SEVEN_DAY,"30d":h.THIRTY_DAY,current_week:h.CURRENT_WEEK,current_month:h.CURRENT_MONTH,previous_week:h.PREVIOUS_WEEK,previous_month:h.PREVIOUS_MONTH};class Ye{constructor(t){b(this,"_seed");this._seed=t}next(t,r){const n=Math.sin(this._seed++)*1e4,i=n-Math.floor(n);return Math.floor(i*(r-t+1))+t}}const po=(e,t,r)=>{const n=yt(10,1e4),i=new Ye(n),o=Date.now()-6*60*60*1e3,c=Date.now(),d=[];let m=0;for(let y=o;y<=c;y+=60*60*1e3)if(t)for(const p in t)t[p].forEach(E=>{m+=i.next(50,500);const C={[p]:E,[e.name]:m},N={version:"1.0",timestamp:new Date(y).toISOString(),event:C};d.push(N)});else{m+=i.next(50,500);const p={version:"1.0",timestamp:new Date(y).toISOString(),event:{[e.name]:m}};d.push(p)}const f={};if(t)for(const y in t)f[y]={},t[y].forEach(p=>{f[y][p]={name:p,deleted:!1}});const _={start_ms:o,end_ms:c,start:new Date(o).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:[e.name],metric_units:{[e.name]:e.unit},granularity_ms:60*60*1e3,display:f,...r??{}};return{data:d,meta:_}},go=(e,t)=>{const r=yt(10,1e4),n=new Ye(r),i=Date.now()-6*60*60*1e3,o=Date.now(),c=[],d={};e.forEach(f=>{d[f.name]=0});for(let f=i;f<=o;f+=60*60*1e3){const _={};e.forEach(p=>{d[p.name]+=n.next(50,500),_[p.name]=d[p.name]});const y={version:"1.0",timestamp:new Date(f).toISOString(),event:_};c.push(y)}const m={start_ms:i,end_ms:o,start:new Date(i).toISOString(),end:new Date(o).toISOString(),query_id:"12345",metric_names:e.map(f=>f.name),metric_units:e.reduce((f,_)=>(f[_.name]=_.unit,f),{}),granularity_ms:60*60*1e3,display:{},...t??{}};return{data:c,meta:m}},_o=(e,t,r)=>{const n=Math.floor(Math.random()*9991)+10,i=new Ye(n),o=Date.now()-6*60*60*1e3,c=Date.now(),d=new Date((o+c)/2).toISOString(),m=[];if(t){const y=Object.keys(t),p=Object.values(t),E=(C,N)=>{if(N===y.length){e.forEach(k=>{C[k.name]=i.next(1e3,5e7)}),m.push({version:"1.0",timestamp:new Date().toISOString(),event:{...C}});return}p[N].forEach(k=>{E({...C,[y[N]]:k},N+1)})};E({},0)}else{const y={};e.forEach(p=>{y[p.name]=i.next(50,500)}),m.push({version:"1.0",timestamp:d,event:y})}const f={};if(t)for(const y in t)f[y]={},t[y].forEach(p=>{f[y][p]={name:p,deleted:!1}});const _={start_ms:o,end_ms:c,start:new Date(o).toISOString(),end:new Date(c).toISOString(),query_id:"12345",metric_names:e.map(y=>y.name),metric_units:e.reduce((y,p)=>(y[p.name]=p.unit,y),{}),truncated:!1,limit:50,display:f,granularity_ms:c-o,...r??{}};return{data:m,meta:_}};function yt(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1)+e)}exports.DeltaQueryTime=no;exports.Granularities=ce;exports.REFRESH_INTERVAL_MS=Ua;exports.SeededRandom=Ye;exports.TIMEFRAME_LOOKUP=yo;exports.TimePeriods=pn;exports.Timeframe=P;exports.TimeframeKeys=h;exports.TimeseriesQueryTime=ro;exports.UnaryQueryTime=yn;exports.aiExploreAggregations=st;exports.apiUsageQuerySchema=Qr;exports.barChartSchema=Gr;exports.basicExploreAggregations=Ce;exports.basicQuerySchema=Xr;exports.ceilToNearestTimeGrain=ht;exports.dashboardConfigSchema=li;exports.dashboardTileTypes=oi;exports.dashboardsSchemaV1=si;exports.datasourceToFilterableDimensions=br;exports.datePickerSelectionToTimeframe=fo;exports.donutChartSchema=Ur;exports.dstOffsetHours=gn;exports.exploreAggregations=it;exports.exploreFilterTypesV2=rt;exports.filterableAiExploreDimensions=ae;exports.filterableBasicExploreDimensions=re;exports.filterableExploreDimensions=ne;exports.filterableRequestDimensions=Za;exports.filterableRequestMetrics=Ka;exports.filterableRequestWildcardDimensions=Ba;exports.floorToNearestTimeGrain=hn;exports.formatISOTimeWithTZ=Ks;exports.formatTime=tt;exports.formatTimeRange=Js;exports.gaugeChartSchema=Lr;exports.generateCrossSectionalData=_o;exports.generateMultipleMetricTimeSeriesData=go;exports.generateSingleMetricTimeSeriesData=po;exports.granularitiesToOptions=eo;exports.granularityMsToQuery=fn;exports.granularityValues=Pe;exports.llmUsageSchema=Zr;exports.metricCardSchema=$r;exports.msToGranularity=to;exports.queryDatasources=ei;exports.queryableAiExploreDimensions=Ie;exports.queryableBasicExploreDimensions=de;exports.queryableExploreDimensions=Ne;exports.queryableRequestDimensions=gr;exports.queryableRequestMetrics=wr;exports.queryableRequestWildcardDimensions=_r;exports.rand=yt;exports.relativeTimeRangeValuesRequestV2=Ja;exports.relativeTimeRangeValuesV4=at;exports.reportChartTypes=za;exports.requestFilterTypeEmptyV2=nt;exports.requestFilterTypeEqualsV2=$a;exports.requestFilterTypeMetricV2=Va;exports.requestFilterTypeWildcardV2=Qa;exports.singleValueSchema=Vr;exports.slottableSchema=Fr;exports.stripUnknownFilters=ti;exports.tileConfigSchema=en;exports.tileDefinitionSchema=Kr;exports.tileLayoutSchema=Jr;exports.timeRangeTypeV2=Xa;exports.timeframeToDatepickerSelection=mo;exports.timeframeToDatepickerTimeperiod=ho;exports.timeseriesChartSchema=Wr;exports.topNTableSchema=zr;exports.validDashboardQuery=Br;
|
|
2
2
|
//# sourceMappingURL=vitals-utilities.cjs.map
|